likec4 1.27.2 → 1.28.0

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.
@@ -0,0 +1,2192 @@
1
+ import*as qw from"node:fs";import{existsSync as i_}from"node:fs";import Bi,{resolve as s_,basename as o_}from"node:path";import{fileURLToPath as a_,pathToFileURL as u_}from"node:url";import{isatty as c_}from"tty";import l_,{stripVTControlCharacters as d_}from"node:util";import f_ from"util";import qi from"path";import p_ from"os";import h_ from"crypto";import m_ from"net";import g_ from"url";import La from"fs";import y_ from"child_process";import{BiMap as v_,nonNullable as It,invariant as _e,defaultTheme as Jt,
2
+ DefaultRelationshipColor as Ma,nonexhaustive as qe,hierarchyDistance as w_,DefaultThemeColor as Ao,nameFromFqn as Hh,isThemeColor as jw,compareFqnHierarchically as b_,DefaultArrowType as ws,ComputedNode as Ad,extractStep as E_,ComputedView as Ba,delay as $_,DefaultLineStyle as D_,FqnRef as wn,hasAtLeast as R_,LikeC4Model as bs,stringHash as k_,ThemeColors as T_,AsFqn as C_,ancestorsFqn as A_,compareNatural as Gw,MultiMap as S_,computeColorValues as __,sortByFqnHierarchically as Uw,isGlobalFqn as Ww,
3
+ parentFqn as zw,DeploymentElement as P_,isScopedElementView as x_,splitGlobalFqn as Hw,isSameHierarchy as Kw,isAncestor as Kh,FqnExpr as rn,RelationExpr as Sd,GlobalFqn as N_,isNonEmptyArray as Un,LinkedList as Vw,isAutoLayoutDirection as I_,isOrOperator as Xw,isAndOperator as Yw,ModelLayer as O_}from"@likec4/core";import{ComputedNode as Jw,DefaultShapeSize as F_,DefaultTextSize as L_,DefaultPaddingSize as M_,AsFqn as B_,FqnRef as Es}from"@likec4/core/types";import{EventEmitter as q_}from"events";
4
+ import{Buffer as Vh}from"buffer";import{Graphviz as Xh}from"@hpcc-js/wasm-graphviz";import{resolveRulesExtendedViews as j_}from"@likec4/core/compute-view";import{MultiMap as xn,DefaultWeakMap as Qw,compareNatural as Yh,sortNaturalByFqn as G_,ancestorsFqn as U_}from"@likec4/core/utils";import ji,{hrtime as Zw}from"node:process";import W_ from"boxen";import{spawn as z_}from"node:child_process";import{once as eb,on as H_}from"node:events";import{stat as K_}from"node:fs/promises";import{pipeline as V_}from"node:stream/promises";
5
+ import X_ from"node:os";import tb from"fs/promises";import{LikeC4Model as Y_}from"@likec4/core/model";const J_={},So=Q_(globalThis,J_);function Q_(t,e){return new Proxy(t,{get(n,r,i){return r in e?e[r]:t[r]},set(n,r,i){return r in e&&delete e[r],t[r]=i,!0},deleteProperty(n,r){let i=!1;return r in e&&(delete e[r],i=!0),r in t&&(delete t[r],i=!0),i},ownKeys(n){const r=Reflect.ownKeys(t),i=Reflect.ownKeys(e),s=new Set(i);return[...r.filter(o=>!s.has(o)),...i]},defineProperty(n,r,i){return r in e&&delete e[r],
6
+ Reflect.defineProperty(t,r,i),!0},getOwnPropertyDescriptor(n,r){return r in e?Reflect.getOwnPropertyDescriptor(e,r):Reflect.getOwnPropertyDescriptor(t,r)},has(n,r){return r in e||r in t}})}function nb(t){return typeof t=="function"?t:Z_(t)}function Z_(t){if(t==null)return()=>!1;if(t==="fatal")return e=>e.level==="fatal";if(t==="error")return e=>e.level==="fatal"||e.level==="error";if(t==="warning")return e=>e.level==="fatal"||e.level==="error"||e.level==="warning";if(t==="info")return e=>e.level===
7
+ "fatal"||e.level==="error"||e.level==="warning"||e.level==="info";if(t==="debug")return()=>!0;throw new TypeError(`Invalid log level: ${t}.`)}const rb=["debug","info","warning","error","fatal"];function ib(t,e){const n=rb.indexOf(t);if(n<0)throw new TypeError(`Invalid log level: ${JSON.stringify(t)}.`);const r=rb.indexOf(e);if(r<0)throw new TypeError(`Invalid log level: ${JSON.stringify(e)}.`);return n-r}function eP(t=[]){return Gn.getLogger(t)}const Jh=Symbol.for("logtape.rootLogger");class Gn{static getLogger(e=[]){
8
+ let n=Jh in So?So[Jh]??null:null;return n==null&&(n=new Gn(null,[]),So[Jh]=n),typeof e=="string"?n.getChild(e):e.length===0?n:n.getChild(e)}constructor(e,n){Object.defineProperty(this,"parent",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"children",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"category",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sinks",{enumerable:!0,configurable:!0,
9
+ writable:!0,value:void 0}),Object.defineProperty(this,"parentSinks",{enumerable:!0,configurable:!0,writable:!0,value:"inherit"}),Object.defineProperty(this,"filters",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"lowestLevel",{enumerable:!0,configurable:!0,writable:!0,value:"debug"}),Object.defineProperty(this,"contextLocalStorage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.parent=e,this.children={},this.category=n,this.sinks=[],this.filters=
10
+ []}getChild(e){const n=typeof e=="string"?e:e[0],r=this.children[n];let i=r instanceof Gn?r:r?.deref();return i==null&&(i=new Gn(this,[...this.category,n]),this.children[n]="WeakRef"in So?new WeakRef(i):i),typeof e=="string"||e.length===1?i:i.getChild(e.slice(1))}reset(){for(;this.sinks.length>0;)this.sinks.shift();for(this.parentSinks="inherit";this.filters.length>0;)this.filters.shift();this.lowestLevel="debug"}resetDescendants(){for(const e of Object.values(this.children)){const n=e instanceof
11
+ Gn?e:e.deref();n?.resetDescendants()}this.reset()}with(e){return new Iw(this,{...e})}filter(e){for(const n of this.filters)if(!n(e))return!1;return this.filters.length<1?this.parent?.filter(e)??!0:!0}*getSinks(e){if(!(this.lowestLevel===null||ib(e,this.lowestLevel)<0)){if(this.parent!=null&&this.parentSinks==="inherit")for(const n of this.parent.getSinks(e))yield n;for(const n of this.sinks)yield n}}emit(e,n){if(!(this.lowestLevel===null||ib(e.level,this.lowestLevel)<0||!this.filter(e))){for(const r of this.
12
+ getSinks(e.level))if(!n?.has(r))try{r(e)}catch(i){const s=new Set(n);s.add(r),tP.log("fatal","Failed to emit a log record to sink {sink}: {error}",{sink:r,error:i,record:e},s)}}}log(e,n,r,i){const s=Gn.getLogger().contextLocalStorage?.getStore()??{};let o;const a=typeof r=="function"?{category:this.category,level:e,timestamp:Date.now(),get message(){return sb(n,this.properties)},rawMessage:n,get properties(){return o==null&&(o={...s,...r()}),o}}:{category:this.category,level:e,timestamp:Date.now(),
13
+ message:sb(n,{...s,...r}),rawMessage:n,properties:{...s,...r}};this.emit(a,i)}logLazily(e,n,r={}){const i=Gn.getLogger().contextLocalStorage?.getStore()??{};let s,o;function a(){if((o==null||s==null)&&(o=n((u,...c)=>(s=u,ob(u,c))),s==null))throw new TypeError("No log record was made.");return[o,s]}this.emit({category:this.category,level:e,get message(){return a()[0]},get rawMessage(){return a()[1]},timestamp:Date.now(),properties:{...i,...r}})}logTemplate(e,n,r,i={}){const s=Gn.getLogger().contextLocalStorage?.
14
+ getStore()??{};this.emit({category:this.category,level:e,message:ob(n,r),rawMessage:n,timestamp:Date.now(),properties:{...s,...i}})}debug(e,...n){typeof e=="string"?this.log("debug",e,n[0]??{}):typeof e=="function"?this.logLazily("debug",e):this.logTemplate("debug",e,n)}info(e,...n){typeof e=="string"?this.log("info",e,n[0]??{}):typeof e=="function"?this.logLazily("info",e):this.logTemplate("info",e,n)}warn(e,...n){typeof e=="string"?this.log("warning",e,n[0]??{}):typeof e=="function"?this.logLazily(
15
+ "warning",e):this.logTemplate("warning",e,n)}error(e,...n){typeof e=="string"?this.log("error",e,n[0]??{}):typeof e=="function"?this.logLazily("error",e):this.logTemplate("error",e,n)}fatal(e,...n){typeof e=="string"?this.log("fatal",e,n[0]??{}):typeof e=="function"?this.logLazily("fatal",e):this.logTemplate("fatal",e,n)}}class Iw{constructor(e,n){Object.defineProperty(this,"logger",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"properties",{enumerable:!0,configurable:!0,
16
+ writable:!0,value:void 0}),this.logger=e,this.properties=n}get category(){return this.logger.category}get parent(){return this.logger.parent}getChild(e){return this.logger.getChild(e).with(this.properties)}with(e){return new Iw(this.logger,{...this.properties,...e})}log(e,n,r,i){this.logger.log(e,n,typeof r=="function"?()=>({...this.properties,...r()}):{...this.properties,...r},i)}logLazily(e,n){this.logger.logLazily(e,n,this.properties)}logTemplate(e,n,r){this.logger.logTemplate(e,n,r,this.properties)}debug(e,...n){
17
+ typeof e=="string"?this.log("debug",e,n[0]??{}):typeof e=="function"?this.logLazily("debug",e):this.logTemplate("debug",e,n)}info(e,...n){typeof e=="string"?this.log("info",e,n[0]??{}):typeof e=="function"?this.logLazily("info",e):this.logTemplate("info",e,n)}warn(e,...n){typeof e=="string"?this.log("warning",e,n[0]??{}):typeof e=="function"?this.logLazily("warning",e):this.logTemplate("warning",e,n)}error(e,...n){typeof e=="string"?this.log("error",e,n[0]??{}):typeof e=="function"?this.logLazily(
18
+ "error",e):this.logTemplate("error",e,n)}fatal(e,...n){typeof e=="string"?this.log("fatal",e,n[0]??{}):typeof e=="function"?this.logLazily("fatal",e):this.logTemplate("fatal",e,n)}}const tP=Gn.getLogger(["logtape","meta"]);function sb(t,e){const n=[];let r="";for(let i=0;i<t.length;i++){const s=t.charAt(i),o=t.charAt(i+1);if(s==="{"&&o==="{")r=r+s,i++;else if(s==="}"&&o==="}")r=r+s,i++;else if(s==="{")n.push(r),r="";else if(s==="}"){let a;r.match(/^\s|\s$/)?a=r in e?e[r]:e[r.trim()]:a=e[r],n.push(
19
+ a),r=""}else r=r+s}return n.push(r),n}function ob(t,e){const n=[];for(let r=0;r<t.length;r++)n.push(t[r]),r<e.length&&n.push(e[r]);return n}function Jr(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function nP(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var n=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(
20
+ n,"__esModule",{value:!0}),Object.keys(t).forEach(function(r){var i=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return t[r]}})}),n}function ab(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Qh,ub;function rP(){if(ub)return Qh;ub=1;let t=null;if(typeof window>"u"&&("process"in
21
+ globalThis&&"versions"in globalThis.process&&"node"in globalThis.process.versions&&typeof globalThis.caches>"u"&&typeof globalThis.addEventListener!="function"||"Bun"in globalThis))try{t=[ab][0](`${["node","util"].join(":")}`)}catch{t=null}return Qh=t,Qh}var iP=rP();const _d=Jr(iP),Zh={debug:"DBG",info:"INF",warning:"WRN",error:"ERR",fatal:"FTL"},cb="Deno"in globalThis&&"inspect"in globalThis.Deno&&typeof globalThis.Deno.inspect=="function"?(t,e)=>globalThis.Deno.inspect(t,{strAbbreviateSize:1/0,
22
+ iterableLimit:1/0,...e}):_d!=null&&"inspect"in _d&&typeof _d.inspect=="function"?(t,e)=>_d.inspect(t,{maxArrayLength:1/0,maxStringLength:1/0,...e}):t=>JSON.stringify(t);function lb(t={}){const e=t.timestamp==null||t.timestamp==="date-time-timezone"?o=>new Date(o).toISOString().replace("T"," ").replace("Z"," +00:00"):t.timestamp==="date-time-tz"?o=>new Date(o).toISOString().replace("T"," ").replace("Z"," +00"):t.timestamp==="date-time"?o=>new Date(o).toISOString().replace("T"," ").replace("Z",""):
23
+ t.timestamp==="time-timezone"?o=>new Date(o).toISOString().replace(/.*T/,"").replace("Z"," +00:00"):t.timestamp==="time-tz"?o=>new Date(o).toISOString().replace(/.*T/,"").replace("Z"," +00"):t.timestamp==="time"?o=>new Date(o).toISOString().replace(/.*T/,"").replace("Z",""):t.timestamp==="date"?o=>new Date(o).toISOString().replace(/T.*/,""):t.timestamp==="rfc3339"?o=>new Date(o).toISOString():t.timestamp,n=t.category??"\xB7",r=t.value??cb,i=t.level==null||t.level==="ABBR"?o=>Zh[o]:t.level==="abb\
24
+ r"?o=>Zh[o].toLowerCase():t.level==="FULL"?o=>o.toUpperCase():t.level==="full"?o=>o:t.level==="L"?o=>o.charAt(0).toUpperCase():t.level==="l"?o=>o.charAt(0):t.level,s=t.format??(({timestamp:o,level:a,category:u,message:c})=>`${o} [${a}] ${u}: ${c}`);return o=>{let a="";for(let d=0;d<o.message.length;d++)d%2===0?a+=o.message[d]:a+=r(o.message[d]);const u=e(o.timestamp),c=i(o.level),l=typeof n=="function"?n(o.category):o.category.join(n);return`${s({timestamp:u,level:c,category:l,message:a,record:o})}\
25
+
26
+ `}}lb();const em="\x1B[0m",tm={black:"\x1B[30m",red:"\x1B[31m",green:"\x1B[32m",yellow:"\x1B[33m",blue:"\x1B[34m",magenta:"\x1B[35m",cyan:"\x1B[36m",white:"\x1B[37m"},nm={bold:"\x1B[1m",dim:"\x1B[2m",italic:"\x1B[3m",underline:"\x1B[4m",strikethrough:"\x1B[9m"},sP={debug:"blue",info:"green",warning:"yellow",error:"red",fatal:"magenta"};function db(t={}){const e=t.format,n=typeof t.timestampStyle>"u"?"dim":t.timestampStyle,r=t.timestampColor??null,i=`${n==null?"":nm[n]}${r==null?"":tm[r]}`,s=n==null&&
27
+ r==null?"":em,o=typeof t.levelStyle>"u"?"bold":t.levelStyle,a=t.levelColors??sP,u=typeof t.categoryStyle>"u"?"dim":t.categoryStyle,c=t.categoryColor??null,l=`${u==null?"":nm[u]}${c==null?"":tm[c]}`,f=u==null&&c==null?"":em;return lb({timestamp:"date-time-tz",value(d){return cb(d,{colors:!0})},...t,format({timestamp:d,level:p,category:m,message:v,record:w}){const y=a[w.level];return d=`${i}${d}${s}`,p=`${o==null?"":nm[o]}${y==null?"":tm[y]}${p}${o==null&&y==null?"":em}`,e==null?`${d} ${p} ${l}${m}\
28
+ :${f} ${v}`:e({timestamp:d,level:p,category:`${l}${m}${f}`,message:v,record:w})}})}db();const oP={debug:"background-color: gray; color: white;",info:"background-color: white; color: black;",warning:"background-color: orange; color: black;",error:"background-color: red; color: white;",fatal:"background-color: maroon; color: white;"};function aP(t){let e="";const n=[];for(let s=0;s<t.message.length;s++)s%2===0?e+=t.message[s]:(e+="%o",n.push(t.message[s]));const r=new Date(t.timestamp);return[`%c${`${r.
29
+ getUTCHours().toString().padStart(2,"0")}:${r.getUTCMinutes().toString().padStart(2,"0")}:${r.getUTCSeconds().toString().padStart(2,"0")}.${r.getUTCMilliseconds().toString().padStart(3,"0")}`} %c${Zh[t.level]}%c %c${t.category.join("\xB7")} %c${e}`,"color: gray;",oP[t.level],"background-color: default;","color: gray;","color: default;",...n]}function fb(t={}){const e=t.formatter??aP,n={debug:"debug",info:"info",warning:"warn",error:"error",fatal:"error",...t.levelMap??{}},r=t.console??globalThis.
30
+ console;return i=>{const s=e(i),o=n[i.level];if(o===void 0)throw new TypeError(`Invalid log level: ${i.level}.`);if(typeof s=="string"){const a=s.replace(/\r?\n$/,"");r[o](a)}else r[o](...s)}}let rm=null;const pb=new Set,Pd=new Set,uP=new Set;function cP(t){return t.category.length===0||t.category.length===1&&t.category[0]==="logtape"||t.category.length===2&&t.category[0]==="logtape"&&t.category[1]==="meta"}function lP(t){if(rm!=null&&!t.reset)throw new $s("Already configured; if you want to res\
31
+ et, turn on the reset flag.");if(uP.size>0)throw new $s("Previously configured async disposables are still active. Use configure() instead or explicitly dispose them using dispose().");hb();try{dP(t,!1)}catch(e){throw e instanceof $s&&hb(),e}}function dP(t,e){rm=t;let n=!1,r=!1;for(const s of t.loggers){cP(s)&&(n=!0);const o=Gn.getLogger(s.category);for(const a of s.sinks??[]){const u=t.sinks[a];if(!u)throw new $s(`Sink not found: ${a}.`);o.sinks.push(u)}o.parentSinks=s.parentSinks??"inherit",s.
32
+ lowestLevel!==void 0&&(o.lowestLevel=s.lowestLevel),s.level!==void 0&&(r=!0,o.filters.push(nb(s.level)));for(const a of s.filters??[]){const u=t.filters?.[a];if(u===void 0)throw new $s(`Filter not found: ${a}.`);o.filters.push(nb(u))}pb.add(o)}Gn.getLogger().contextLocalStorage=t.contextLocalStorage;for(const s of Object.values(t.sinks)){if(Symbol.asyncDispose in s)throw new $s("Async disposables cannot be used with configureSync().");Symbol.dispose in s&&Pd.add(s)}for(const s of Object.values(t.
33
+ filters??{}))if(!(s==null||typeof s=="string")){if(Symbol.asyncDispose in s)throw new $s("Async disposables cannot be used with configureSync().");Symbol.dispose in s&&Pd.add(s)}"process"in So&&!("Deno"in So)?process.on("exit",im):addEventListener("unload",im);const i=Gn.getLogger(["logtape","meta"]);n||i.sinks.push(fb()),i.info("LogTape loggers are configured. Note that LogTape itself uses the meta logger, which has category {metaLoggerCategory}. The meta logger purposes to log internal error\
34
+ s such as sink exceptions. If you are seeing this message, the meta logger is automatically configured. It's recommended to configure the meta logger with a separate sink so that you can easily notice if logging itself fails or is misconfigured. To turn off this message, configure the meta logger with higher log levels than {dismissLevel}. See also <https://logtape.org/manual/categories#meta-logger>.",{metaLoggerCategory:["logtape","meta"],dismissLevel:"info"}),r&&i.warn("The level option is\
35
+ deprecated in favor of lowestLevel option. Please update your configuration. See also <https://logtape.org/manual/levels#configuring-severity-levels>.")}function hb(){im(),fP()}function fP(){const t=Gn.getLogger([]);t.resetDescendants(),delete t.contextLocalStorage,pb.clear(),rm=null}function im(){for(const t of Pd)t[Symbol.dispose]();Pd.clear()}class $s extends Error{constructor(e){super(e),this.name="ConfigureError"}}const pP=t=>{sm.forEach(e=>{hP(t,e)})},sm=["name","message","stack","cause",
36
+ "errors"],hP=(t,e)=>{const n=om(t,e);if(n!==void 0){if(mP(n)){Qr(t,e,t[e]);return}gP(n)&&mb(t,e,n)}},om=(t,e)=>{const n=Object.getOwnPropertyDescriptor(t,e);if(n!==void 0)return n;const r=Object.getPrototypeOf(t);return r===null?void 0:om(r,e)},mP=({get:t,set:e})=>t!==void 0&&e===void 0,gP=({enumerable:t,writable:e})=>t||!e,Qr=(t,e,n)=>{mb(t,e,{value:n})},mb=(t,e,n)=>{Object.defineProperty(t,e,{...n,..."get"in n||"set"in n?{}:{writable:!0},enumerable:!1,configurable:!0})},yP=(t,e)=>{if(Array.isArray(
37
+ t.errors)){const n=t.errors.filter(vP).map(e).filter(Boolean);Qr(t,"errors",n)}else wP(t)?Qr(t,"errors",[]):t.errors!==void 0&&bP(t)},vP=t=>t!==void 0,wP=t=>"AggregateError"in globalThis&&(t.name==="AggregateError"||t instanceof AggregateError),bP=t=>{delete t.errors,t.errors!==void 0&&Qr(t,"errors",[])},EP=(t,e)=>{if(!("cause"in t))return;const n=t.cause===void 0?t.cause:e(t.cause);n===void 0?delete t.cause:Qr(t,"cause",n)},gb=t=>$P(t)||DP(t),$P=t=>{try{return t instanceof Error}catch{return!1}},
38
+ DP=t=>{try{return RP.has(Object.prototype.toString.call(t))}catch{return!1}},RP=new Set(["[object Error]","[object DOMException]","[object DOMError]","[object Exception]"]);function xd(t){if(typeof t!="object"||t===null)return!1;const e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)}const kP=t=>!Object.isExtensible(t)||sm.some(e=>TP(t,e)||CP(t,e)),TP=(t,e)=>{const n=Object.getOwnPropertyDescriptor(
39
+ t,e);return n!==void 0&&!n.configurable},CP=(t,e)=>{try{return t[e],!1}catch{return!0}},am=t=>{const e=AP(t.message,t.name);Qr(t,"stack",e)},AP=(t="",e="Error")=>{const n=SP(e),{stack:r}=new n(t);return typeof r=="string"&&r!==""?r:`${e}: ${t}`},SP=t=>{const e={value:t,enumerable:!1,writable:!0,configurable:!0},n=Object.defineProperty(class extends Error{},"name",e);return Object.defineProperty(n.prototype,"name",e),n},_P=t=>{const e={};for(const n of PP(t))try{const r=t[n],{enumerable:i,configurable:s,
40
+ writable:o=!0}=om(t,n);Object.defineProperty(e,n,{value:r,enumerable:i,configurable:s,writable:o})}catch{}return e},PP=t=>{const e=xP(t);for(const n of sm)NP(t,n)&&e.push(n);return e},xP=t=>{try{return Reflect.ownKeys(t)}catch{return[]}},NP=(t,e)=>{try{return e in t&&!Object.hasOwn(t,e)}catch{return!1}},yb=t=>{const{name:e,message:n,stack:r,cause:i,errors:s,...o}=_P(t),a=IP(n,o),u=MP(e,a);return n===a&&BP(u,o),Object.entries({name:e,stack:r,cause:i,errors:s}).forEach(([c,l])=>{qP(u,c,l)}),r===void 0&&
41
+ am(u),u},IP=(t,e)=>typeof t=="string"&&t!==""?t:LP(OP(e)),OP=t=>{try{return JSON.stringify(t)}catch{return FP(t)}},FP=t=>{try{return String(t)}catch{return"Invalid error"}},LP=t=>t.length<vb?t:`${t.slice(0,vb)}...`,vb=1e3,MP=(t,e)=>t==="AggregateError"&&"AggregateError"in globalThis?new AggregateError([],e):t in wb?new wb[t](e):new Error(e),wb={Error,ReferenceError,TypeError,SyntaxError,RangeError,URIError,EvalError},BP=(t,e)=>{for(const n in e)n in t||(t[n]=e[n])},qP=(t,e,n)=>{n!==void 0&&Qr(t,
42
+ e,n)},jP=t=>{try{const e=new Error(String(t));return am(e),e}catch(e){return e}},{toString:GP}=Object.prototype,UP=t=>WP(t)?yb(t):gb(t)?zP(t)?yb(t):t:jP(t),WP=t=>{try{return xd(t)}catch{return!1}},zP=t=>HP(t)||kP(t)||KP(t),HP=t=>{try{return GP.call(t)==="[object Object]"}catch{return!0}},KP=t=>typeof t.constructor!="function"||typeof t.constructor.name!="string"||t.constructor.name===""||t.constructor.prototype!==Object.getPrototypeOf(t),Nd=(t,{shallow:e=!1}={})=>bb(t,[],e),bb=(t,e,n)=>{if(e.includes(
43
+ t))return;const r=n?VP:s=>bb(s,[...e,t],n),i=UP(t);return XP(i,r),i},VP=t=>t,XP=(t,e)=>{YP(t),JP(t),QP(t),EP(t,e),yP(t,e),pP(t)},YP=t=>{if(Id(t.name))return;const e=Object.getPrototypeOf(t).name,n=Id(e)?e:t.constructor.name;Qr(t,"name",n)},JP=t=>{Id(t.message)||Qr(t,"message","")},QP=t=>{Id(t.stack)||am(t)},Id=t=>typeof t=="string"&&t!=="",ZP=(t,e,n=t.name)=>{if(ex(e),typeof n!="string")throw new TypeError(`currentName must be a string: ${n}`);return n},ex=t=>{if(!tx(t))throw new TypeError(`Erro\
44
+ rClass must be a class: ${t}`);if(!Eb(t.prototype))throw new TypeError(`ErrorClass must inherit from Error: ${t}`);if(!nx(t))throw new TypeError(`ErrorClass must be have a valid constructor: ${t}`)},tx=t=>typeof t=="function"&&typeof t.prototype=="object"&&t.prototype!==null,Eb=t=>t!==null&&(t.name==="Error"||Eb(Object.getPrototypeOf(t))),nx=t=>typeof t.prototype.constructor=="function",$b=(t,e,n)=>{Object.defineProperty(t,e,{value:n,enumerable:!1,writable:!0,configurable:!0})},rx=(t,e)=>{Object.
45
+ getPrototypeOf(t)!==e.prototype&&(ix(t,e),kb(t,"constructor"),sx(t,e))},ix=(t,e)=>{Object.setPrototypeOf(t,e.prototype)},sx=(t,e)=>{kb(t,"name");const n=Db(e.prototype);t.name!==n&&$b(t,"name",n)},Db=t=>ox(t)??ax(t)??Db(Object.getPrototypeOf(t)),ox=t=>Object.hasOwn(t,"name")&&Rb(t.name)?t.name:void 0,ax=t=>typeof t.constructor=="function"&&Rb(t.constructor.name)?t.constructor.name:void 0,Rb=t=>typeof t=="string"&&t!=="",kb=(t,e)=>{Object.hasOwn(t,e)&&delete t[e]},ux=(t,e)=>{if(!cx(t,e))return;const n=dx(
46
+ t,e);$b(t,"stack",n)},cx=(t,e)=>e!==t.name&&e!==""&&t.stack.includes(e)&&lx(),lx=()=>{class t extends Error{}const e={value:Tb,enumerable:!1,writable:!0,configurable:!0};Object.defineProperty(t,"name",e),Object.defineProperty(t.prototype,"name",e);const{stack:n}=new t("");return typeof n=="string"&&n.includes(Tb)},Tb="SetErrorClassError",dx=({name:t,stack:e},n)=>{if(e.startsWith(`${n}: `))return e.replace(n,t);const r=fx(n,t),[i,s]=r.find(([o])=>e.includes(o));return e.replace(i,s)},fx=(t,e)=>[[
47
+ `
48
+ ${t}: `,`
49
+ ${e}: `],[`${t}: `,`${e}: `],[`${t} `,`${e} `],[t,e]],px=(t,e,n)=>{const r=Nd(t),i=ZP(r,e,n);return rx(r,e),ux(r,i),r},hx=(t,e)=>e.configurable===!1?mx(t,e):vx(t,e),mx=(t,e)=>({...e,...gx(t,e),...yx(t,e)}),gx=(t,e)=>e.writable===!0&&t.writable===!1?{writable:!1}:{},yx=(t,e)=>t.hasValue&&"value"in e&&e.writable===!0?{value:t.value}:{},vx=(t,e)=>{const n=qa(t.enumerable,e.enumerable,!0),r=qa(t.writable,e.writable,!0),i=qa(t.configurable,e.configurable,!0);return{...wx(t,e,r),enumerable:n,configurable:i}},
50
+ wx=(t,e,n)=>t.hasValue?{value:t.value,writable:n}:!Cb(t)&&!Cb(e)?{value:e.value,writable:n}:{get:qa(t.get,e.get),set:qa(t.set,e.set)},Cb=({get:t,set:e})=>t!==void 0||e!==void 0,qa=(t,e,n)=>t??e??n,bx=(t,e,n)=>{if(!Ex(t))throw new TypeError(`Argument must be an object: ${t}`);if(!$x(e))throw new TypeError(`Property key must be a string, a symbol or an integer: ${e}`);return Dx(n)},Ex=t=>typeof t=="object"&&t!==null,$x=t=>{const e=typeof t;return e==="string"||e==="symbol"||e==="number"},Dx=t=>{if(!xd(
51
+ t))throw new TypeError(`Descriptor must be a plain object: ${t}`);const{enumerable:e,writable:n,configurable:r,value:i,get:s,set:o,...a}=t,u="value"in t;return Rx({enumerable:e,writable:n,configurable:r,get:s,set:o,unknownProps:a,hasValue:u}),{enumerable:e,writable:n,configurable:r,value:i,get:s,set:o,hasValue:u}},Rx=({enumerable:t,writable:e,configurable:n,get:r,set:i,unknownProps:s,hasValue:o})=>{Ab(o,r,"get"),Ab(o,i,"set"),um(t,"enumerable"),um(e,"writable"),um(n,"configurable"),Tx(s)},Ab=(t,e,n)=>{
52
+ if(kx(e,n),t&&e!==void 0)throw new TypeError(`Descriptor property "value" and "${n}" must not both be defined: ${e}`)},kx=(t,e)=>{if(t!==void 0&&typeof t!="function")throw new TypeError(`Descriptor property "${e}" must be a function: ${t}`)},um=(t,e)=>{if(t!==void 0&&typeof t!="boolean")throw new TypeError(`Descriptor property "${e}" must be a boolean: ${t}`)},Tx=t=>{const[e]=Object.keys(t);if(e!==void 0)throw new TypeError(`Unknown descriptor property "${e}": ${t[e]}`)},Cx=(t,e,n)=>{const r=bx(
53
+ t,e,n),i=Sb(t,e),s=hx(r,i);return Ax(t,e,s),t},Sb=(t,e)=>{const n=Object.getOwnPropertyDescriptor(t,e);if(n!==void 0)return n;const r=Object.getPrototypeOf(t);return r===null?{}:Sb(r,e)},Ax=(t,e,n)=>{try{Object.defineProperty(t,e,n)}catch{}},Sx=(t,e,n)=>{if(n!==void 0)return _b(t,e,n);try{delete t[e]}catch{}if(t[e]!==void 0)return _b(t,e)},_b=(t,e,n)=>{const r=_x(e);Cx(t,e,{value:n,...r})},_x=t=>typeof t=="string"&&t.startsWith("_")?{enumerable:!1}:{},Px=(t,e,n={})=>{if(Pb(t,"First argument"),Pb(
54
+ e,"Second argument"),!xd(n))throw new TypeError(`Options must be a plain object: ${n}`);const{soft:r=!1}=n;if(typeof r!="boolean")throw new TypeError(`Option "soft" must be a boolean: ${r}`);return{soft:r}},Pb=(t,e)=>{if(t===void 0)throw new TypeError(`${e} is required.`);if(!xx(t))throw new TypeError(`${e} must be a plain object or an error: ${t}`)},xx=t=>xd(t)||gb(t),Nx=({error:t,props:e,propName:n,soft:r})=>Ix(n)||!Lx.call(e,n)||r&&t[n]!==void 0,Ix=t=>t in Ox||Fx.has(t),Ox=new Error("check"),
55
+ Fx=new Set(["prototype","errors","cause"]),{propertyIsEnumerable:Lx}=Object.prototype,Mx=(t,e,n)=>{const{soft:r}=Px(t,e,n);for(const i of Reflect.ownKeys(e))Bx({error:t,props:e,propName:i,soft:r});return t},Bx=({error:t,props:e,propName:n,soft:r})=>{Nx({error:t,props:e,propName:n,soft:r})||Sx(t,n,e[n])},Od=(t,e,n)=>{Object.defineProperty(t,e,{value:n,writable:!0,enumerable:!1,configurable:!0})},qx=(t,e)=>{if(t.errors===void 0)return;const n=t.errors.map(r=>e(r).error).filter(Boolean);Od(t,"error\
56
+ s",n)},jx=({target:t,source:e,parent:n,child:r})=>{if(!xb(t)){Gx(t,e);return}xb(e)&&Od(t,"errors",[...r.errors,...n.errors])},Gx=(t,e)=>{e.errors!==void 0&&Od(t,"errors",e.errors)},xb=t=>t.errors!==void 0&&t.errors.length!==0,Ux=(t,e,n=t.message)=>{if(typeof e!="string")throw new TypeError(`newMessage must be a string: ${e}`);if(typeof n!="string")throw new TypeError(`currentMessage must be a string: ${n}`);return n},Wx=({name:t,stack:e},n,r)=>r!==""&&e.includes(r)?zx({name:t,stack:e,newMessage:n,
57
+ currentMessage:r}):Kx(t,e,n),zx=({name:t,stack:e,newMessage:n,currentMessage:r})=>{const i=Hx(t,n,r),[s,o]=i.find(([a])=>e.includes(a));return e.replace(s,o)},Hx=(t,e,n)=>[[`${t}: ${n}`,`${t}: ${e}`],[`: ${n}`,`: ${e}`],[`
58
+ ${n}`,`
59
+ ${e}`],[` ${n}`,` ${e}`],[n,e]],Kx=(t,e,n)=>{const r=`${t}: `,i=n.trimEnd();return e===t||e.startsWith(`${t}
60
+ `)?e.replace(t,`${r}${i}`):e.startsWith(r)?e.replace(r,`${r}${i}
61
+ `):`${r}${i}
62
+ ${e}`},Vx=(t,e,n)=>{const r=Nd(t),i=Ux(r,e,n);return Ib(r,"message",e),Xx(r,e,i),r},Xx=(t,e,n)=>{if(e===n||!Yx())return;const r=Wx(t,e,n);Ib(t,"stack",r)},Yx=()=>{const{stack:t}=new Error(Nb);return typeof t=="string"&&t.includes(Nb)},Nb="set-error-message test message",Ib=(t,e,n)=>{Object.defineProperty(t,e,{value:n,enumerable:!1,writable:!0,configurable:!0})},Jx=(t,e,n)=>{if(typeof e!="string")throw new TypeError(`Second argument must be a message string: ${e}`);const r=Nd(t),i=Qx(e,r.message);
63
+ return Vx(r,i,n)},Qx=(t,e)=>{const n=t.trim(),r=e.trim();return n===""?r:r===""?n:Zx(n,r,t)},Zx=(t,e,n)=>t.endsWith(e1)?n.endsWith(t1)?`${t}
64
+ ${e}`:`${t} ${e}`:`${e}
65
+ ${t}`,e1=":",t1=`
66
+ `,n1=({parent:t,child:e,target:n,stackError:r})=>{const i=t.message,s=r.message;return n.message=e.message,Jx(n,i,s)},r1=(t,e)=>Ob(t)===e,Ob=t=>typeof t=="object"&&t!==null?t.stack:void 0,i1=({wrap:t,target:e,source:n,childHasStack:r})=>t===r?e:(Od(e,"stack",n.stack),n),s1=t=>{const{wrap:e,name:n}=t;return typeof e!="boolean"?n==="Error":(Object.hasOwn(t,"wrap")&&delete t.wrap,e)},Fb=t=>Lb(t,[]).error,Lb=(t,e)=>{if(e.includes(t))return{};const n=u=>Lb(u,[...e,t]),r=Ob(t),i=Nd(t,{shallow:!0}),s=r1(
67
+ i,r);qx(i,n);const{parent:o,childHasStack:a}=o1(i,n);return{error:o,errorHasStack:s||a}},o1=(t,e)=>{const n=s1(t);if(t.cause===void 0)return{parent:t,childHasStack:!1};const{error:r,errorHasStack:i}=e(t.cause);return delete t.cause,{parent:a1({parent:t,child:r,childHasStack:i,wrap:n}),childHasStack:i}},a1=({parent:t,child:e,childHasStack:n,wrap:r})=>{if(e===void 0)return t;const[i,s]=r?[e,t]:[t,e],o=i1({wrap:r,target:i,source:s,childHasStack:n}),a=px(i,i.constructor,o.name),u=n1({parent:t,child:e,
68
+ target:a,stackError:o});return jx({target:u,source:s,parent:t,child:e}),Mx(u,s,{soft:!r})};function Mb(t){return function(e,n){if(typeof n?.toJSON=="function"&&(n=n.toJSON()),!(n!==null&&typeof n=="object"))return n;if(t.has(n))return"[Circular]";t.add(n);const r=Array.isArray(n)?[]:{};for(const[i,s]of Object.entries(n))r[i]=Mb(t)(i,s);return t.delete(n),r}}function u1(t,{indentation:e}={}){return JSON.stringify(t,Mb(new WeakSet),e)}const Bb=t=>t.split(`
69
+ `).map(e=>e.trim().replace("file://",""));function cm(t,e=2){return t=Array.isArray(t)?t:t.split(`
70
+ `),t.map(n=>`${" ".repeat(e)}${n}`).join(`
71
+ `)}function yr(t){if(typeof t=="string")return t;if(t instanceof Error){const e=Fb(t);if(e.stack){const n=Bb(e.stack);return e.message+`
72
+ `+cm(n.slice(1))}return e.message}return u1(t)}function c1(t){const e=Object.values(t.properties).filter(n=>n instanceof Error).map(n=>{const r=Fb(n);return r.stack&&(r.stack=Bb(r.stack).join(`
73
+ `)),r});return e.length===0?null:e.length===1?e[0]:new AggregateError(e)}function l1(t,e){const n=c1(t.record);if(n){let r=n.message;return n.stack&&(r=r+`
74
+ `+cm(n.stack.split(`
75
+ `).slice(1))),r=`${h1.red}${r}${p1}`,{...t,message:t.message+`
76
+ `+cm(r)}}return t}const d1={debug:"DEBUG",info:"INFO ",warning:"WARN ",error:"ERROR",fatal:"FATAL"},f1=t=>d1[t],p1="\x1B[0m",h1={red:"\x1B[31m"};function m1(t){const e=({timestamp:n,level:r,category:i,message:s})=>`${n} ${r} ${i} ${s}`;return db({timestamp:"time",level:f1,categoryStyle:"bold",categoryColor:"cyan",category:".",...t,format:n=>e(l1(n))})}function qb(t){return fb({formatter:m1(),...t})}const bn=eP("likec4");function g1(t){return bn.getChild(t)}let y1=!1;function v1(t){try{y1=!0;const e=t?.
77
+ sinks??{};lP({...t,sinks:{...e,console:e.console??qb()},loggers:[{category:["logtape","meta"],sinks:["console"],lowestLevel:"warning"},...t?.loggers??[{category:"likec4",sinks:["console"],lowestLevel:"debug"}]]})}catch(e){console.error(e)}}function lm(t){if(t===null||typeof t!="object")return!1;const e=Object.getPrototypeOf(t);return e!==null&&e!==Object.prototype&&Object.getPrototypeOf(e)!==null||Symbol.iterator in t?!1:Symbol.toStringTag in t?Object.prototype.toString.call(t)==="[object Module\
78
+ ]":!0}function dm(t,e,n=".",r){if(!lm(e))return dm(t,{},n,r);const i=Object.assign({},e);for(const s in t){if(s==="__proto__"||s==="constructor")continue;const o=t[s];o!=null&&(r&&r(i,s,o,n)||(Array.isArray(o)&&Array.isArray(i[s])?i[s]=[...o,...i[s]]:lm(o)&&lm(i[s])?i[s]=dm(o,i[s],(n?`${n}.`:"")+s.toString(),r):i[s]=o))}return i}function w1(t){return(...e)=>e.reduce((n,r)=>dm(n,r,"",t),{})}const fm=w1();function kt(t){return typeof t=="object"&&t!==null&&typeof t.$type=="string"}function rr(t){return typeof t==
79
+ "object"&&t!==null&&typeof t.$refText=="string"}function b1(t){return typeof t=="object"&&t!==null&&typeof t.name=="string"&&typeof t.type=="string"&&typeof t.path=="string"}function Fd(t){return typeof t=="object"&&t!==null&&kt(t.container)&&rr(t.reference)&&typeof t.message=="string"}class jb{constructor(){this.subtypes={},this.allSubtypes={}}isInstance(e,n){return kt(e)&&this.isSubtype(e.$type,n)}isSubtype(e,n){if(e===n)return!0;let r=this.subtypes[e];r||(r=this.subtypes[e]={});const i=r[n];if(i!==
80
+ void 0)return i;{const s=this.computeIsSubtype(e,n);return r[n]=s,s}}getAllSubTypes(e){const n=this.allSubtypes[e];if(n)return n;{const r=this.getAllTypes(),i=[];for(const s of r)this.isSubtype(s,e)&&i.push(s);return this.allSubtypes[e]=i,i}}}function Gi(t){return typeof t=="object"&&t!==null&&Array.isArray(t.content)}function Ds(t){return typeof t=="object"&&t!==null&&typeof t.tokenType=="object"}function Gb(t){return Gi(t)&&typeof t.fullText=="string"}class en{constructor(e,n){this.startFn=e,this.
81
+ nextFn=n}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 n=0,r=e.next();for(;!r.done;)n++,r=e.next();return n}toArray(){const e=[],n=this.iterator();let r;do r=n.next(),r.value!==void 0&&e.push(r.value);while(!r.done);return e}toSet(){return new Set(this)}toMap(e,n){const r=this.map(i=>[e?e(i):i,n?n(i):i]);return new Map(
82
+ r)}toString(){return this.join()}concat(e){return new en(()=>({first:this.startFn(),firstDone:!1,iterator:e[Symbol.iterator]()}),n=>{let r;if(!n.firstDone){do if(r=this.nextFn(n.first),!r.done)return r;while(!r.done);n.firstDone=!0}do if(r=n.iterator.next(),!r.done)return r;while(!r.done);return Nn})}join(e=","){const n=this.iterator();let r="",i,s=!1;do i=n.next(),i.done||(s&&(r+=e),r+=E1(i.value)),s=!0;while(!i.done);return r}indexOf(e,n=0){const r=this.iterator();let i=0,s=r.next();for(;!s.done;){
83
+ if(i>=n&&s.value===e)return i;s=r.next(),i++}return-1}every(e){const n=this.iterator();let r=n.next();for(;!r.done;){if(!e(r.value))return!1;r=n.next()}return!0}some(e){const n=this.iterator();let r=n.next();for(;!r.done;){if(e(r.value))return!0;r=n.next()}return!1}forEach(e){const n=this.iterator();let r=0,i=n.next();for(;!i.done;)e(i.value,r),i=n.next(),r++}map(e){return new en(this.startFn,n=>{const{done:r,value:i}=this.nextFn(n);return r?Nn:{done:!1,value:e(i)}})}filter(e){return new en(this.
84
+ startFn,n=>{let r;do if(r=this.nextFn(n),!r.done&&e(r.value))return r;while(!r.done);return Nn})}nonNullable(){return this.filter(e=>e!=null)}reduce(e,n){const r=this.iterator();let i=n,s=r.next();for(;!s.done;)i===void 0?i=s.value:i=e(i,s.value),s=r.next();return i}reduceRight(e,n){return this.recursiveReduce(this.iterator(),e,n)}recursiveReduce(e,n,r){const i=e.next();if(i.done)return r;const s=this.recursiveReduce(e,n,r);return s===void 0?i.value:n(s,i.value)}find(e){const n=this.iterator();let r=n.
85
+ next();for(;!r.done;){if(e(r.value))return r.value;r=n.next()}}findIndex(e){const n=this.iterator();let r=0,i=n.next();for(;!i.done;){if(e(i.value))return r;i=n.next(),r++}return-1}includes(e){const n=this.iterator();let r=n.next();for(;!r.done;){if(r.value===e)return!0;r=n.next()}return!1}flatMap(e){return new en(()=>({this:this.startFn()}),n=>{do{if(n.iterator){const s=n.iterator.next();if(s.done)n.iterator=void 0;else return s}const{done:r,value:i}=this.nextFn(n.this);if(!r){const s=e(i);if(Ld(
86
+ s))n.iterator=s[Symbol.iterator]();else return{done:!1,value:s}}}while(n.iterator);return Nn})}flat(e){if(e===void 0&&(e=1),e<=0)return this;const n=e>1?this.flat(e-1):this;return new en(()=>({this:n.startFn()}),r=>{do{if(r.iterator){const o=r.iterator.next();if(o.done)r.iterator=void 0;else return o}const{done:i,value:s}=n.nextFn(r.this);if(!i)if(Ld(s))r.iterator=s[Symbol.iterator]();else return{done:!1,value:s}}while(r.iterator);return Nn})}head(){const n=this.iterator().next();if(!n.done)return n.
87
+ value}tail(e=1){return new en(()=>{const n=this.startFn();for(let r=0;r<e;r++)if(this.nextFn(n).done)return n;return n},this.nextFn)}limit(e){return new en(()=>({size:0,state:this.startFn()}),n=>(n.size++,n.size>e?Nn:this.nextFn(n.state)))}distinct(e){return new en(()=>({set:new Set,internalState:this.startFn()}),n=>{let r;do if(r=this.nextFn(n.internalState),!r.done){const i=e?e(r.value):r.value;if(!n.set.has(i))return n.set.add(i),r}while(!r.done);return Nn})}exclude(e,n){const r=new Set;for(const i of e){
88
+ const s=n?n(i):i;r.add(s)}return this.filter(i=>{const s=n?n(i):i;return!r.has(s)})}}function E1(t){return typeof t=="string"?t:typeof t>"u"?"undefined":typeof t.toString=="function"?t.toString():Object.prototype.toString.call(t)}function Ld(t){return!!t&&typeof t[Symbol.iterator]=="function"}const ja=new en(()=>{},()=>Nn),Nn=Object.freeze({done:!0,value:void 0});function Xe(...t){if(t.length===1){const e=t[0];if(e instanceof en)return e;if(Ld(e))return new en(()=>e[Symbol.iterator](),n=>n.next());
89
+ if(typeof e.length=="number")return new en(()=>({index:0}),n=>n.index<e.length?{done:!1,value:e[n.index++]}:Nn)}return t.length>1?new en(()=>({collIndex:0,arrIndex:0}),e=>{do{if(e.iterator){const n=e.iterator.next();if(!n.done)return n;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 n=t[e.collIndex++];Ld(n)?e.iterator=n[Symbol.iterator]():n&&typeof n.length=="number"&&(e.array=n)}}while(e.
90
+ iterator||e.array||e.collIndex<t.length);return Nn}):ja}class _o extends en{constructor(e,n,r){super(()=>({iterators:r?.includeRoot?[[e][Symbol.iterator]()]:[n(e)[Symbol.iterator]()],pruned:!1}),i=>{for(i.pruned&&(i.iterators.pop(),i.pruned=!1);i.iterators.length>0;){const o=i.iterators[i.iterators.length-1].next();if(o.done)i.iterators.pop();else return i.iterators.push(n(o.value)[Symbol.iterator]()),o}return Nn})}iterator(){const e={state:this.startFn(),next:()=>this.nextFn(e.state),prune:()=>{
91
+ e.state.pruned=!0},[Symbol.iterator]:()=>e};return e}}var pm;(function(t){function e(s){return s.reduce((o,a)=>o+a,0)}t.sum=e;function n(s){return s.reduce((o,a)=>o*a,0)}t.product=n;function r(s){return s.reduce((o,a)=>Math.min(o,a))}t.min=r;function i(s){return s.reduce((o,a)=>Math.max(o,a))}t.max=i})(pm||(pm={}));function Md(t){return new _o(t,e=>Gi(e)?e.content:[],{includeRoot:!0})}function $1(t){return Md(t).filter(Ds)}function D1(t,e){for(;t.container;)if(t=t.container,t===e)return!0;return!1}
92
+ function hm(t){return{start:{character:t.startColumn-1,line:t.startLine-1},end:{character:t.endColumn,line:t.endLine-1}}}function Bd(t){if(!t)return;const{offset:e,end:n,range:r}=t;return{range:r,offset:e,end:n,length:n-e}}var Zr;(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"})(Zr||(Zr={}));function R1(t,e){if(t.end.line<e.start.line||t.end.line===e.start.line&&t.end.character<=
93
+ e.start.character)return Zr.Before;if(t.start.line>e.end.line||t.start.line===e.end.line&&t.start.character>=e.end.character)return Zr.After;const n=t.start.line>e.start.line||t.start.line===e.start.line&&t.start.character>=e.start.character,r=t.end.line<e.end.line||t.end.line===e.end.line&&t.end.character<=e.end.character;return n&&r?Zr.Inside:n?Zr.OverlapBack:r?Zr.OverlapFront:Zr.Outside}function Ub(t,e){return R1(t,e)>Zr.After}const Wb=/^[\w\p{L}]$/u;function Rs(t,e,n=Wb){if(t){if(e>0){const r=e-
94
+ t.offset,i=t.text.charAt(r);n.test(i)||e--}return Hb(t,e)}}function mm(t,e){if(t){const n=k1(t,!0);if(n&&zb(n,e))return n;if(Gb(t)){const r=t.content.findIndex(i=>!i.hidden);for(let i=r-1;i>=0;i--){const s=t.content[i];if(zb(s,e))return s}}}}function zb(t,e){return Ds(t)&&e.includes(t.tokenType.name)}function Hb(t,e){if(Ds(t))return t;if(Gi(t)){const n=Kb(t,e,!1);if(n)return Hb(n,e)}}function gm(t,e){if(Ds(t))return t;if(Gi(t)){const n=Kb(t,e,!0);if(n)return gm(n,e)}}function Kb(t,e,n){let r=0,i=t.
95
+ content.length-1,s;for(;r<=i;){const o=Math.floor((r+i)/2),a=t.content[o];if(a.offset<=e&&a.end>e)return a;a.end<=e?(s=n?a:void 0,r=o+1):i=o-1}return s}function k1(t,e=!0){for(;t.container;){const n=t.container;let r=n.content.indexOf(t);for(;r>0;){r--;const i=n.content[r];if(e||!i.hidden)return i}t=n}}function T1(t,e=!0){for(;t.container;){const n=t.container;let r=n.content.indexOf(t);const i=n.content.length-1;for(;r<i;){r++;const s=n.content[r];if(e||!s.hidden)return s}t=n}}function C1(t,e){
96
+ const n=A1(t,e);return n?n.parent.content.slice(n.a+1,n.b):[]}function A1(t,e){const n=Vb(t),r=Vb(e);let i;for(let s=0;s<n.length&&s<r.length;s++){const o=n[s],a=r[s];if(o.parent===a.parent)i={parent:o.parent,a:o.index,b:a.index};else break}return i}function Vb(t){const e=[];for(;t.container;){const n=t.container,r=n.content.indexOf(t);e.push({parent:n,index:r}),t=n}return e.reverse()}class Xb extends Error{constructor(e,n){super(e?`${n} at ${e.range.start.line}:${e.range.start.character}`:n)}}function Ga(t){
97
+ throw new Error("Error! The input value was not handled.")}const qd="AbstractRule",jd="AbstractType",ym="Condition",Yb="TypeDefinition",vm="ValueLiteral",Ua="AbstractElement";function wm(t){return Je.isInstance(t,Ua)}const Gd="ArrayLiteral",Wa="ArrayType";function S1(t){return Je.isInstance(t,Wa)}const za="BooleanLiteral";function _1(t){return Je.isInstance(t,za)}const Ha="Conjunction";function P1(t){return Je.isInstance(t,Ha)}const Ka="Disjunction";function x1(t){return Je.isInstance(t,Ka)}const Ud="\
98
+ Grammar",bm="GrammarImport",Va="InferredType";function Jb(t){return Je.isInstance(t,Va)}const Xa="Interface";function Qb(t){return Je.isInstance(t,Xa)}const Em="NamedArgument",Ya="Negation";function N1(t){return Je.isInstance(t,Ya)}const Wd="NumberLiteral",zd="Parameter",Ja="ParameterReference";function I1(t){return Je.isInstance(t,Ja)}const Qa="ParserRule";function fn(t){return Je.isInstance(t,Qa)}const Za="ReferenceType";function O1(t){return Je.isInstance(t,Za)}const Hd="ReturnType";function F1(t){
99
+ return Je.isInstance(t,Hd)}const eu="SimpleType";function Zb(t){return Je.isInstance(t,eu)}const Kd="StringLiteral",Po="TerminalRule";function ei(t){return Je.isInstance(t,Po)}const tu="Type";function $m(t){return Je.isInstance(t,tu)}const Dm="TypeAttribute",nu="UnionType";function L1(t){return Je.isInstance(t,nu)}const ru="Action";function ks(t){return Je.isInstance(t,ru)}const iu="Alternatives";function Rm(t){return Je.isInstance(t,iu)}const su="Assignment";function Fr(t){return Je.isInstance(
100
+ t,su)}const ou="CharacterRange";function M1(t){return Je.isInstance(t,ou)}const au="CrossReference";function uu(t){return Je.isInstance(t,au)}const cu="EndOfFile";function B1(t){return Je.isInstance(t,cu)}const lu="Group";function Ui(t){return Je.isInstance(t,lu)}const du="Keyword";function Lr(t){return Je.isInstance(t,du)}const fu="NegatedToken";function q1(t){return Je.isInstance(t,fu)}const pu="RegexToken";function j1(t){return Je.isInstance(t,pu)}const hu="RuleCall";function ti(t){return Je.
101
+ isInstance(t,hu)}const mu="TerminalAlternatives";function G1(t){return Je.isInstance(t,mu)}const gu="TerminalGroup";function U1(t){return Je.isInstance(t,gu)}const yu="TerminalRuleCall";function e0(t){return Je.isInstance(t,yu)}const vu="UnorderedGroup";function km(t){return Je.isInstance(t,vu)}const wu="UntilToken";function W1(t){return Je.isInstance(t,wu)}const bu="Wildcard";function z1(t){return Je.isInstance(t,bu)}class t0 extends jb{getAllTypes(){return[Ua,qd,jd,ru,iu,Gd,Wa,su,za,ou,ym,Ha,au,
102
+ Ka,cu,Ud,bm,lu,Va,Xa,du,Em,fu,Ya,Wd,zd,Ja,Qa,Za,pu,Hd,hu,eu,Kd,mu,gu,Po,yu,tu,Dm,Yb,nu,vu,wu,vm,bu]}computeIsSubtype(e,n){switch(e){case ru:case iu:case su:case ou:case au:case cu:case lu:case du:case fu:case pu:case hu:case mu:case gu:case yu:case vu:case wu:case bu:return this.isSubtype(Ua,n);case Gd:case Wd:case Kd:return this.isSubtype(vm,n);case Wa:case Za:case eu:case nu:return this.isSubtype(Yb,n);case za:return this.isSubtype(ym,n)||this.isSubtype(vm,n);case Ha:case Ka:case Ya:case Ja:return this.
103
+ isSubtype(ym,n);case Va:case Xa:case tu:return this.isSubtype(jd,n);case Qa:return this.isSubtype(qd,n)||this.isSubtype(jd,n);case Po:return this.isSubtype(qd,n);default:return!1}}getReferenceType(e){const n=`${e.container.$type}:${e.property}`;switch(n){case"Action:type":case"CrossReference:type":case"Interface:superTypes":case"ParserRule:returnType":case"SimpleType:typeRef":return jd;case"Grammar:hiddenTokens":case"ParserRule:hiddenTokens":case"RuleCall:rule":return qd;case"Grammar:usedGrammar\
104
+ s":return Ud;case"NamedArgument:parameter":case"ParameterReference:parameter":return zd;case"TerminalRuleCall:rule":return Po;default:throw new Error(`${n} is not a valid reference id.`)}}getTypeMetaData(e){switch(e){case Ua:return{name:Ua,properties:[{name:"cardinality"},{name:"lookahead"}]};case Gd:return{name:Gd,properties:[{name:"elements",defaultValue:[]}]};case Wa:return{name:Wa,properties:[{name:"elementType"}]};case za:return{name:za,properties:[{name:"true",defaultValue:!1}]};case Ha:return{
105
+ name:Ha,properties:[{name:"left"},{name:"right"}]};case Ka:return{name:Ka,properties:[{name:"left"},{name:"right"}]};case Ud:return{name:Ud,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 bm:return{name:bm,properties:[{name:"pa\
106
+ th"}]};case Va:return{name:Va,properties:[{name:"name"}]};case Xa:return{name:Xa,properties:[{name:"attributes",defaultValue:[]},{name:"name"},{name:"superTypes",defaultValue:[]}]};case Em:return{name:Em,properties:[{name:"calledByName",defaultValue:!1},{name:"parameter"},{name:"value"}]};case Ya:return{name:Ya,properties:[{name:"value"}]};case Wd:return{name:Wd,properties:[{name:"value"}]};case zd:return{name:zd,properties:[{name:"name"}]};case Ja:return{name:Ja,properties:[{name:"parameter"}]};case Qa:
107
+ return{name:Qa,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 Za:return{name:Za,properties:[{name:"referenceType"}]};case Hd:return{name:Hd,properties:[{name:"name"}]};case eu:return{name:eu,properties:[{name:"primit\
108
+ iveType"},{name:"stringType"},{name:"typeRef"}]};case Kd:return{name:Kd,properties:[{name:"value"}]};case Po:return{name:Po,properties:[{name:"definition"},{name:"fragment",defaultValue:!1},{name:"hidden",defaultValue:!1},{name:"name"},{name:"type"}]};case tu:return{name:tu,properties:[{name:"name"},{name:"type"}]};case Dm:return{name:Dm,properties:[{name:"defaultValue"},{name:"isOptional",defaultValue:!1},{name:"name"},{name:"type"}]};case nu:return{name:nu,properties:[{name:"types",defaultValue:[]}]};case ru:
109
+ return{name:ru,properties:[{name:"cardinality"},{name:"feature"},{name:"inferredType"},{name:"lookahead"},{name:"operator"},{name:"type"}]};case iu:return{name:iu,properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"lookahead"}]};case su:return{name:su,properties:[{name:"cardinality"},{name:"feature"},{name:"lookahead"},{name:"operator"},{name:"terminal"}]};case ou:return{name:ou,properties:[{name:"cardinality"},{name:"left"},{name:"lookahead"},{name:"right"}]};case au:return{
110
+ name:au,properties:[{name:"cardinality"},{name:"deprecatedSyntax",defaultValue:!1},{name:"lookahead"},{name:"terminal"},{name:"type"}]};case cu:return{name:cu,properties:[{name:"cardinality"},{name:"lookahead"}]};case lu:return{name:lu,properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"guardCondition"},{name:"lookahead"}]};case du:return{name:du,properties:[{name:"cardinality"},{name:"lookahead"},{name:"value"}]};case fu:return{name:fu,properties:[{name:"cardinality"},{name:"\
111
+ lookahead"},{name:"terminal"}]};case pu:return{name:pu,properties:[{name:"cardinality"},{name:"lookahead"},{name:"regex"}]};case hu:return{name:hu,properties:[{name:"arguments",defaultValue:[]},{name:"cardinality"},{name:"lookahead"},{name:"rule"}]};case mu:return{name:mu,properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"lookahead"}]};case gu:return{name:gu,properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"lookahead"}]};case yu:return{name:yu,properties:[
112
+ {name:"cardinality"},{name:"lookahead"},{name:"rule"}]};case vu:return{name:vu,properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"lookahead"}]};case wu:return{name:wu,properties:[{name:"cardinality"},{name:"lookahead"},{name:"terminal"}]};case bu:return{name:bu,properties:[{name:"cardinality"},{name:"lookahead"}]};default:return{name:e,properties:[]}}}}const Je=new t0;function Tm(t){for(const[e,n]of Object.entries(t))e.startsWith("$")||(Array.isArray(n)?n.forEach((r,i)=>{kt(
113
+ r)&&(r.$container=t,r.$containerProperty=e,r.$containerIndex=i)}):kt(n)&&(n.$container=t,n.$containerProperty=e))}function Wn(t,e){let n=t;for(;n;){if(e(n))return n;n=n.$container}}function Mr(t,e){let n=t;for(;n;){if(e(n))return!0;n=n.$container}return!1}function at(t){const n=Vd(t).$document;if(!n)throw new Error("AST node has no document.");return n}function Vd(t){for(;t.$container;)t=t.$container;return t}function Eu(t,e){if(!t)throw new Error("Node must be an AstNode.");const n=e?.range;return new en(
114
+ ()=>({keys:Object.keys(t),keyIndex:0,arrayIndex:0}),r=>{for(;r.keyIndex<r.keys.length;){const i=r.keys[r.keyIndex];if(!i.startsWith("$")){const s=t[i];if(kt(s)){if(r.keyIndex++,Cm(s,n))return{done:!1,value:s}}else if(Array.isArray(s)){for(;r.arrayIndex<s.length;){const o=r.arrayIndex++,a=s[o];if(kt(a)&&Cm(a,n))return{done:!1,value:a}}r.arrayIndex=0}}r.keyIndex++}return Nn})}function Br(t,e){if(!t)throw new Error("Root node must be an AstNode.");return new _o(t,n=>Eu(n,e))}function ni(t,e){if(t){
115
+ if(e?.range&&!Cm(t,e.range))return new _o(t,()=>[])}else throw new Error("Root node must be an AstNode.");return new _o(t,n=>Eu(n,e),{includeRoot:!0})}function Cm(t,e){var n;if(!e)return!0;const r=(n=t.$cstNode)===null||n===void 0?void 0:n.range;return r?Ub(r,e):!1}function Xd(t){return new en(()=>({keys:Object.keys(t),keyIndex:0,arrayIndex:0}),e=>{for(;e.keyIndex<e.keys.length;){const n=e.keys[e.keyIndex];if(!n.startsWith("$")){const r=t[n];if(rr(r))return e.keyIndex++,{done:!1,value:{reference:r,
116
+ container:t,property:n}};if(Array.isArray(r)){for(;e.arrayIndex<r.length;){const i=e.arrayIndex++,s=r[i];if(rr(s))return{done:!1,value:{reference:s,container:t,property:n,index:i}}}e.arrayIndex=0}}e.keyIndex++}return Nn})}function H1(t,e=at(t).parseResult.value){const n=[];return ni(e).forEach(r=>{Xd(r).forEach(i=>{i.reference.ref===t&&n.push(i.reference)})}),Xe(n)}function Am(t,e){const n=t.getTypeMetaData(e.$type),r=e;for(const i of n.properties)i.defaultValue!==void 0&&r[i.name]===void 0&&(r[i.
117
+ name]=n0(i.defaultValue))}function n0(t){return Array.isArray(t)?[...t.map(n0)]:t}function Sm(t,e){const n={$type:t.$type};for(const[r,i]of Object.entries(t))if(!r.startsWith("$"))if(kt(i))n[r]=Sm(i,e);else if(rr(i))n[r]=e(n,r,i.$refNode,i.$refText);else if(Array.isArray(i)){const s=[];for(const o of i)kt(o)?s.push(Sm(o,e)):rr(o)?s.push(e(n,r,o.$refNode,o.$refText)):s.push(o);n[r]=s}else n[r]=i;return Tm(n),n}const xo={__proto__:null,assignMandatoryProperties:Am,copyAstNode:Sm,findLocalReferences:H1,
118
+ findRootNode:Vd,getContainerOfType:Wn,getDocument:at,hasContainerOfType:Mr,linkContentToContainer:Tm,streamAllContents:Br,streamAst:ni,streamContents:Eu,streamReferences:Xd};function Ae(t){return t.charCodeAt(0)}function _m(t,e){Array.isArray(t)?t.forEach(function(n){e.push(n)}):e.push(t)}function $u(t,e){if(t[e]===!0)throw"duplicate flag "+e;t[e],t[e]=!0}function No(t){if(t===void 0)throw Error("Internal Error - Should never get here!");return!0}function K1(){throw Error("Internal Error - Shoul\
119
+ d never get here!")}function r0(t){return t.type==="Character"}const Yd=[];for(let t=Ae("0");t<=Ae("9");t++)Yd.push(t);const Jd=[Ae("_")].concat(Yd);for(let t=Ae("a");t<=Ae("z");t++)Jd.push(t);for(let t=Ae("A");t<=Ae("Z");t++)Jd.push(t);const i0=[Ae(" "),Ae("\f"),Ae(`
120
+ `),Ae("\r"),Ae(" "),Ae("\v"),Ae(" "),Ae("\xA0"),Ae("\u1680"),Ae("\u2000"),Ae("\u2001"),Ae("\u2002"),Ae("\u2003"),Ae("\u2004"),Ae("\u2005"),Ae("\u2006"),Ae("\u2007"),Ae("\u2008"),Ae("\u2009"),Ae("\u200A"),Ae("\u2028"),Ae("\u2029"),Ae("\u202F"),Ae("\u205F"),Ae("\u3000"),Ae("\uFEFF")],V1=/[0-9a-fA-F]/,Qd=/[0-9]/,X1=/[1-9]/;class s0{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=
121
+ e.input,this.groupIdx=e.groupIdx}pattern(e){this.idx=0,this.input=e,this.groupIdx=0,this.consumeChar("/");const n=this.disjunction();this.consumeChar("/");const r={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":$u(r,"global");break;case"i":$u(r,"ignoreCase");break;case"m":$u(r,"multiLine");break;case"u":$u(r,"unicode");break;case"y":$u(r,"sticky");break}if(this.idx!==this.input.length)
122
+ throw Error("Redundant input: "+this.input.substring(this.idx));return{type:"Pattern",flags:r,value:n,loc:this.loc(0)}}disjunction(){const e=[],n=this.idx;for(e.push(this.alternative());this.peekChar()==="|";)this.consumeChar("|"),e.push(this.alternative());return{type:"Disjunction",value:e,loc:this.loc(n)}}alternative(){const e=[],n=this.idx;for(;this.isTerm();)e.push(this.term());return{type:"Alternative",value:e,loc:this.loc(n)}}term(){return this.isAssertion()?this.assertion():this.atom()}assertion(){
123
+ 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 n;switch(this.popChar()){case"=":n="Lookahead";break;case"!":n="NegativeLookahead";break}No(n);const r=this.disjunction();return this.consumeChar("\
124
+ )"),{type:n,value:r,loc:this.loc(e)}}return K1()}quantifier(e=!1){let n;const r=this.idx;switch(this.popChar()){case"*":n={atLeast:0,atMost:1/0};break;case"+":n={atLeast:1,atMost:1/0};break;case"?":n={atLeast:0,atMost:1};break;case"{":const i=this.integerIncludingZero();switch(this.popChar()){case"}":n={atLeast:i,atMost:i};break;case",":let s;this.isDigit()?(s=this.integerIncludingZero(),n={atLeast:i,atMost:s}):n={atLeast:i,atMost:1/0},this.consumeChar("}");break}if(e===!0&&n===void 0)return;No(
125
+ n);break}if(!(e===!0&&n===void 0)&&No(n))return this.peekChar(0)==="?"?(this.consumeChar("?"),n.greedy=!1):n.greedy=!0,n.type="Quantifier",n.loc=this.loc(r),n}atom(){let e;const n=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()),No(e))return e.loc=this.loc(n),this.isQuantifier()&&(e.quantifier=this.quantifier()),
126
+ e}dotAll(){return this.consumeChar("."),{type:"Set",complement:!0,value:[Ae(`
127
+ `),Ae("\r"),Ae("\u2028"),Ae("\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.
128
+ regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}}decimalEscapeAtom(){return{type:"GroupBackReference",value:this.positiveInteger()}}characterClassEscape(){let e,n=!1;switch(this.popChar()){case"d":e=Yd;break;case"D":e=Yd,n=!0;break;case"s":e=i0;break;case"S":e=i0,n=!0;break;case"w":e=Jd;break;case"W":e=Jd,n=!0;break}if(No(e))return{type:"Set",value:e,complement:n}}controlEscapeAtom(){let e;switch(this.popChar()){case"f":e=Ae("\f");break;case"n":e=Ae(`
129
+ `);break;case"r":e=Ae("\r");break;case"t":e=Ae(" ");break;case"v":e=Ae("\v");break}if(No(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:Ae("\0")}}hexEscapeSequenceAtom(){return this.consumeChar("x"),this.parseHexDigits(2)}regExpUnicodeEscapeSequenceAtom(){
130
+ return this.consumeChar("u"),this.parseHexDigits(4)}identityEscapeAtom(){const e=this.popChar();return{type:"Character",value:Ae(e)}}classPatternCharacterAtom(){switch(this.peekChar()){case`
131
+ `:case"\r":case"\u2028":case"\u2029":case"\\":case"]":throw Error("TBD");default:const e=this.popChar();return{type:"Character",value:Ae(e)}}}characterClass(){const e=[];let n=!1;for(this.consumeChar("["),this.peekChar(0)==="^"&&(this.consumeChar("^"),n=!0);this.isClassAtom();){const r=this.classAtom();if(r.type,r0(r)&&this.isRangeDash()){this.consumeChar("-");const i=this.classAtom();if(i.type,r0(i)){if(i.value<r.value)throw Error("Range out of order in character class");e.push({from:r.value,to:i.
132
+ value})}else _m(r.value,e),e.push(Ae("-")),_m(i.value,e)}else _m(r.value,e)}return this.consumeChar("]"),{type:"Set",complement:n,value:e}}classAtom(){switch(this.peekChar()){case"]":case`
133
+ `: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:Ae("\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"\
134
+ 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 n=this.disjunction();this.consumeChar(")");const r={type:"Group",capturing:e,value:n};return e&&(r.idx=this.groupIdx),r}positiveInteger(){let e=this.popChar();if(X1.test(e)===!1)throw Error("Expecting a\
135
+ positive integer");for(;Qd.test(this.peekChar(0));)e+=this.popChar();return parseInt(e,10)}integerIncludingZero(){let e=this.popChar();if(Qd.test(e)===!1)throw Error("Expecting an integer");for(;Qd.test(this.peekChar(0));)e+=this.popChar();return parseInt(e,10)}patternCharacter(){const e=this.popChar();switch(e){case`
136
+ `: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:Ae(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 Qd.test(this.peekChar(0))}isClassAtom(e=0){switch(this.peekChar(e)){case"]":case`
137
+ `: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(){
138
+ 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`
139
+ `:case"\r":case"\u2028":case"\u2029":return!1;default:return!0}}parseHexDigits(e){let n="";for(let i=0;i<e;i++){const s=this.popChar();if(V1.test(s)===!1)throw Error("Expecting a HexDecimal digits");n+=s}return{type:"Character",value:parseInt(n,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: "+
140
+ 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 Zd{visitChildren(e){for(const n in e){const r=e[n];e.hasOwnProperty(n)&&(r.type!==void 0?this.visit(r):Array.isArray(r)&&r.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"Sta\
141
+ rtAnchor":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.
142
+ 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 o0=/\r?\n/gm,Y1=new s0;class J1 extends Zd{constructor(){super(...arguments),this.isStarting=!0,this.endRegexpStack=[],this.multiline=!1}get endRegex(){
143
+ 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 n=String.fromCharCode(e.value);if(!this.multiline&&n===`
144
+ `&&(this.multiline=!0),e.quantifier)this.isStarting=!1,this.endRegexpStack=[];else{const r=ef(n);this.endRegexpStack.push(r),this.isStarting&&(this.startRegexp+=r)}}visitSet(e){if(!this.multiline){const n=this.regex.substring(e.loc.begin,e.loc.end),r=new RegExp(n);this.multiline=!!`
145
+ `.match(r)}if(e.quantifier)this.isStarting=!1,this.endRegexpStack=[];else{const n=this.regex.substring(e.loc.begin,e.loc.end);this.endRegexpStack.push(n),this.isStarting&&(this.startRegexp+=n)}}visitChildren(e){e.type==="Group"&&e.quantifier||super.visitChildren(e)}}const Pm=new J1;function Q1(t){try{return typeof t=="string"&&(t=new RegExp(t)),t=t.toString(),Pm.reset(t),Pm.visit(Y1.pattern(t)),Pm.multiline}catch{return!1}}const Z1=`\f
146
+ \r \v \xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF`.split("");function xm(t){const e=typeof t=="string"?new RegExp(t):t;return Z1.some(n=>e.test(n))}function ef(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function eN(t){return Array.prototype.map.call(t,e=>/\w/.test(e)?`[${e.toLowerCase()}${e.toUpperCase()}]`:ef(e)).join("")}function tN(t,e){const n=nN(t),r=e.match(n);return!!r&&r[0].length>0}function nN(t){typeof t=="stri\
147
+ ng"&&(t=new RegExp(t));const e=t,n=t.source;let r=0;function i(){let s="",o;function a(c){s+=n.substr(r,c),r+=c}function u(c){s+="(?:"+n.substr(r,c)+"|$)",r+=c}for(;r<n.length;)switch(n[r]){case"\\":switch(n[r+1]){case"c":u(3);break;case"x":u(4);break;case"u":e.unicode?n[r+2]==="{"?u(n.indexOf("}",r)-r+1):u(6):u(2);break;case"p":case"P":e.unicode?u(n.indexOf("}",r)-r+1):u(2);break;case"k":u(n.indexOf(">",r)-r+1);break;default:u(2);break}break;case"[":o=/\[(?:\\.|.)*?\]/g,o.lastIndex=r,o=o.exec(n)||
148
+ [],u(o[0].length);break;case"|":case"^":case"$":case"*":case"+":case"?":a(1);break;case"{":o=/\{\d+,?\d*\}/g,o.lastIndex=r,o=o.exec(n),o?a(o[0].length):u(1);break;case"(":if(n[r+1]==="?")switch(n[r+2]){case":":s+="(?:",r+=3,s+=i()+"|$)";break;case"=":s+="(?=",r+=3,s+=i()+")";break;case"!":o=r,r+=3,i(),s+=n.substr(o,r-o);break;case"<":switch(n[r+3]){case"=":case"!":o=r,r+=4,i(),s+=n.substr(o,r-o);break;default:a(n.indexOf(">",r)-r+1),s+=i()+"|$)";break}break}else a(1),s+=i()+"|$)";break;case")":return++r,
149
+ s;default:u(1);break}return s}return new RegExp(i(),t.flags)}function tf(t){return t.rules.find(e=>fn(e)&&e.entry)}function a0(t){return t.rules.filter(e=>ei(e)&&e.hidden)}function Nm(t,e){const n=new Set,r=tf(t);if(!r)return new Set(t.rules);const i=[r].concat(a0(t));for(const o of i)u0(o,n,e);const s=new Set;for(const o of t.rules)(n.has(o.name)||ei(o)&&o.hidden)&&s.add(o);return s}function u0(t,e,n){e.add(t.name),Br(t).forEach(r=>{if(ti(r)||n&&e0(r)){const i=r.rule.ref;i&&!e.has(i.name)&&u0(i,
150
+ e,n)}})}function Im(t){if(t.terminal)return t.terminal;if(t.type.ref){const e=Mm(t.type.ref);return e?.terminal}}function c0(t){return t.hidden&&!xm(ku(t))}function Io(t,e){return!t||!e?[]:Om(t,e,t.astNode,!0)}function pn(t,e,n){if(!t||!e)return;const r=Om(t,e,t.astNode,!0);if(r.length!==0)return n!==void 0?n=Math.max(0,Math.min(n,r.length-1)):n=0,r[n]}function Om(t,e,n,r){if(!r){const i=Wn(t.grammarSource,Fr);if(i&&i.feature===e)return[t]}return Gi(t)&&t.astNode===n?t.content.flatMap(i=>Om(i,e,
151
+ n,!1)):[]}function Fm(t,e){return t?Lm(t,e,t?.astNode):[]}function Du(t,e,n){if(!t)return;const r=Lm(t,e,t?.astNode);if(r.length!==0)return n!==void 0?n=Math.max(0,Math.min(n,r.length-1)):n=0,r[n]}function Lm(t,e,n){if(t.astNode!==n)return[];if(Lr(t.grammarSource)&&t.grammarSource.value===e)return[t];const r=Md(t).iterator();let i;const s=[];do if(i=r.next(),!i.done){const o=i.value;o.astNode===n?Lr(o.grammarSource)&&o.grammarSource.value===e&&s.push(o):r.prune()}while(!i.done);return s}function l0(t){
152
+ var e;const n=t.astNode;for(;n===((e=t.container)===null||e===void 0?void 0:e.astNode);){const r=Wn(t.grammarSource,Fr);if(r)return r;t=t.container}}function Mm(t){let e=t;return Jb(e)&&(ks(e.$container)?e=e.$container.$container:fn(e.$container)?e=e.$container:Ga(e.$container)),d0(t,e,new Map)}function d0(t,e,n){var r;function i(s,o){let a;return Wn(s,Fr)||(a=d0(o,o,n)),n.set(t,a),a}if(n.has(t))return n.get(t);n.set(t,void 0);for(const s of Br(e)){if(Fr(s)&&s.feature.toLowerCase()==="name")return n.
153
+ set(t,s),s;if(ti(s)&&fn(s.rule.ref))return i(s,s.rule.ref);if(Zb(s)&&(!((r=s.typeRef)===null||r===void 0)&&r.ref))return i(s,s.typeRef.ref)}}function f0(t){const e=t.$container;if(Ui(e)){const n=e.elements,r=n.indexOf(t);for(let i=r-1;i>=0;i--){const s=n[i];if(ks(s))return s;{const o=Br(n[i]).find(ks);if(o)return o}}}if(wm(e))return f0(e)}function Oo(t,e){return t==="?"||t==="*"||Ui(e)&&!!e.guardCondition}function p0(t){return t==="*"||t==="+"}function rN(t){return t==="+="}function nf(t){return h0(
154
+ t,new Set)}function h0(t,e){if(e.has(t))return!0;e.add(t);for(const n of Br(t))if(ti(n)){if(!n.rule.ref||fn(n.rule.ref)&&!h0(n.rule.ref,e))return!1}else{if(Fr(n))return!1;if(ks(n))return!1}return!!t.definition}function iN(t){return Bm(t.type,new Set)}function Bm(t,e){if(e.has(t))return!0;if(e.add(t),S1(t))return!1;if(O1(t))return!1;if(L1(t))return t.types.every(n=>Bm(n,e));if(Zb(t)){if(t.primitiveType!==void 0)return!0;if(t.stringType!==void 0)return!0;if(t.typeRef!==void 0){const n=t.typeRef.ref;
155
+ return $m(n)?Bm(n.type,e):!1}else return!1}else return!1}function Ts(t){if(t.inferredType)return t.inferredType.name;if(t.dataType)return t.dataType;if(t.returnType){const e=t.returnType.ref;if(e){if(fn(e))return e.name;if(Qb(e)||$m(e))return e.name}}}function Ru(t){var e;if(fn(t))return nf(t)?t.name:(e=Ts(t))!==null&&e!==void 0?e:t.name;if(Qb(t)||$m(t)||F1(t))return t.name;if(ks(t)){const n=m0(t);if(n)return n}else if(Jb(t))return t.name;throw new Error("Cannot get name of Unknown Type")}function m0(t){
156
+ var e;if(t.inferredType)return t.inferredType.name;if(!((e=t.type)===null||e===void 0)&&e.ref)return Ru(t.type.ref)}function sN(t){var e,n,r;return ei(t)?(n=(e=t.type)===null||e===void 0?void 0:e.name)!==null&&n!==void 0?n:"string":nf(t)?t.name:(r=Ts(t))!==null&&r!==void 0?r:t.name}function g0(t){var e,n,r;return ei(t)?(n=(e=t.type)===null||e===void 0?void 0:e.name)!==null&&n!==void 0?n:"string":(r=Ts(t))!==null&&r!==void 0?r:t.name}function ku(t){const e={s:!1,i:!1,u:!1},n=Fo(t.definition,e),r=Object.
157
+ entries(e).filter(([,i])=>i).map(([i])=>i).join("");return new RegExp(n,r)}const qm=/[\s\S]/.source;function Fo(t,e){if(G1(t))return oN(t);if(U1(t))return aN(t);if(M1(t))return lN(t);if(e0(t)){const n=t.rule.ref;if(!n)throw new Error("Missing rule reference.");return ri(Fo(n.definition),{cardinality:t.cardinality,lookahead:t.lookahead})}else{if(q1(t))return cN(t);if(W1(t))return uN(t);if(j1(t)){const n=t.regex.lastIndexOf("/"),r=t.regex.substring(1,n),i=t.regex.substring(n+1);return e&&(e.i=i.includes(
158
+ "i"),e.s=i.includes("s"),e.u=i.includes("u")),ri(r,{cardinality:t.cardinality,lookahead:t.lookahead,wrap:!1})}else{if(z1(t))return ri(qm,{cardinality:t.cardinality,lookahead:t.lookahead});throw new Error(`Invalid terminal element: ${t?.$type}`)}}}function oN(t){return ri(t.elements.map(e=>Fo(e)).join("|"),{cardinality:t.cardinality,lookahead:t.lookahead})}function aN(t){return ri(t.elements.map(e=>Fo(e)).join(""),{cardinality:t.cardinality,lookahead:t.lookahead})}function uN(t){return ri(`${qm}*\
159
+ ?${Fo(t.terminal)}`,{cardinality:t.cardinality,lookahead:t.lookahead})}function cN(t){return ri(`(?!${Fo(t.terminal)})${qm}*?`,{cardinality:t.cardinality,lookahead:t.lookahead})}function lN(t){return t.right?ri(`[${jm(t.left)}-${jm(t.right)}]`,{cardinality:t.cardinality,lookahead:t.lookahead,wrap:!1}):ri(jm(t.left),{cardinality:t.cardinality,lookahead:t.lookahead,wrap:!1})}function jm(t){return ef(t.value)}function ri(t,e){var n;return(e.wrap!==!1||e.lookahead)&&(t=`(${(n=e.lookahead)!==null&&n!==
160
+ void 0?n:""}${t})`),e.cardinality?`${t}${e.cardinality}`:t}const Gm={__proto__:null,findAssignment:l0,findNameAssignment:Mm,findNodeForKeyword:Du,findNodeForProperty:pn,findNodesForKeyword:Fm,findNodesForKeywordInternal:Lm,findNodesForProperty:Io,getActionAtElement:f0,getActionType:m0,getAllReachableRules:Nm,getCrossReferenceTerminal:Im,getEntryRule:tf,getExplicitRuleType:Ts,getHiddenRules:a0,getRuleType:g0,getRuleTypeName:sN,getTypeName:Ru,isArrayCardinality:p0,isArrayOperator:rN,isCommentTerminal:c0,
161
+ isDataType:iN,isDataTypeRule:nf,isOptionalCardinality:Oo,terminalRegex:ku};function dN(t){const e=[],n=t.Grammar;for(const r of n.rules)ei(r)&&c0(r)&&Q1(ku(r))&&e.push(r.name);return{multilineCommentRules:e,nameRegexp:Wb}}var y0=typeof global=="object"&&global&&global.Object===Object&&global,fN=typeof self=="object"&&self&&self.Object===Object&&self,qr=y0||fN||Function("return this")(),ir=qr.Symbol,v0=Object.prototype,pN=v0.hasOwnProperty,hN=v0.toString,Tu=ir?ir.toStringTag:void 0;function mN(t){
162
+ var e=pN.call(t,Tu),n=t[Tu];try{t[Tu]=void 0;var r=!0}catch{}var i=hN.call(t);return r&&(e?t[Tu]=n:delete t[Tu]),i}var gN=Object.prototype,yN=gN.toString;function vN(t){return yN.call(t)}var wN="[object Null]",bN="[object Undefined]",w0=ir?ir.toStringTag:void 0;function Wi(t){return t==null?t===void 0?bN:wN:w0&&w0 in Object(t)?mN(t):vN(t)}function vr(t){return t!=null&&typeof t=="object"}var EN="[object Symbol]";function Cu(t){return typeof t=="symbol"||vr(t)&&Wi(t)==EN}function rf(t,e){for(var n=-1,
163
+ r=t==null?0:t.length,i=Array(r);++n<r;)i[n]=e(t[n],n,t);return i}var Qe=Array.isArray,b0=ir?ir.prototype:void 0,E0=b0?b0.toString:void 0;function $0(t){if(typeof t=="string")return t;if(Qe(t))return rf(t,$0)+"";if(Cu(t))return E0?E0.call(t):"";var e=t+"";return e=="0"&&1/t==-1/0?"-0":e}var $N=/\s/;function DN(t){for(var e=t.length;e--&&$N.test(t.charAt(e)););return e}var RN=/^\s+/;function kN(t){return t&&t.slice(0,DN(t)+1).replace(RN,"")}function sr(t){var e=typeof t;return t!=null&&(e=="object"||
164
+ e=="function")}var D0=NaN,TN=/^[-+]0x[0-9a-f]+$/i,CN=/^0b[01]+$/i,AN=/^0o[0-7]+$/i,SN=parseInt;function _N(t){if(typeof t=="number")return t;if(Cu(t))return D0;if(sr(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=sr(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=kN(t);var n=CN.test(t);return n||AN.test(t)?SN(t.slice(2),n?2:8):TN.test(t)?D0:+t}var PN=1/0,xN=17976931348623157e292;function NN(t){if(!t)return t===0?t:0;if(t=_N(t),t===PN||t===-1/0){var e=t<0?-1:1;return e*xN}return t===t?
165
+ t:0}function sf(t){var e=NN(t),n=e%1;return e===e?n?e-n:e:0}function Cs(t){return t}var IN="[object AsyncFunction]",ON="[object Function]",FN="[object GeneratorFunction]",LN="[object Proxy]";function ii(t){if(!sr(t))return!1;var e=Wi(t);return e==ON||e==FN||e==IN||e==LN}var Um=qr["__core-js_shared__"],R0=function(){var t=/[^.]+$/.exec(Um&&Um.keys&&Um.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function MN(t){return!!R0&&R0 in t}var BN=Function.prototype,qN=BN.toString;function As(t){if(t!=
166
+ null){try{return qN.call(t)}catch{}try{return t+""}catch{}}return""}var jN=/[\\^$.*+?()[\]{}|]/g,GN=/^\[object .+?Constructor\]$/,UN=Function.prototype,WN=Object.prototype,zN=UN.toString,HN=WN.hasOwnProperty,KN=RegExp("^"+zN.call(HN).replace(jN,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function VN(t){if(!sr(t)||MN(t))return!1;var e=ii(t)?KN:GN;return e.test(As(t))}function XN(t,e){return t?.[e]}function Ss(t,e){var n=XN(t,e);return VN(n)?n:void 0}var Wm=Ss(
167
+ qr,"WeakMap"),k0=Object.create,YN=function(){function t(){}return function(e){if(!sr(e))return{};if(k0)return k0(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}();function JN(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function Ht(){}function QN(t,e){var n=-1,r=t.length;for(e||(e=Array(r));++n<r;)e[n]=t[n];return e}var ZN=800,eI=16,tI=Date.now;function nI(t){var e=0,
168
+ n=0;return function(){var r=tI(),i=eI-(r-n);if(n=r,i>0){if(++e>=ZN)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function rI(t){return function(){return t}}var of=function(){try{var t=Ss(Object,"defineProperty");return t({},"",{}),t}catch{}}(),iI=of?function(t,e){return of(t,"toString",{configurable:!0,enumerable:!1,value:rI(e),writable:!0})}:Cs,sI=nI(iI);function T0(t,e){for(var n=-1,r=t==null?0:t.length;++n<r&&e(t[n],n,t)!==!1;);return t}function C0(t,e,n,r){for(var i=t.length,
169
+ s=n+-1;++s<i;)if(e(t[s],s,t))return s;return-1}function oI(t){return t!==t}function aI(t,e,n){for(var r=n-1,i=t.length;++r<i;)if(t[r]===e)return r;return-1}function zm(t,e,n){return e===e?aI(t,e,n):C0(t,oI,n)}function A0(t,e){var n=t==null?0:t.length;return!!n&&zm(t,e,0)>-1}var uI=9007199254740991,cI=/^(?:0|[1-9]\d*)$/;function af(t,e){var n=typeof t;return e=e??uI,!!e&&(n=="number"||n!="symbol"&&cI.test(t))&&t>-1&&t%1==0&&t<e}function Hm(t,e,n){e=="__proto__"&&of?of(t,e,{configurable:!0,enumerable:!0,
170
+ value:n,writable:!0}):t[e]=n}function Au(t,e){return t===e||t!==t&&e!==e}var lI=Object.prototype,dI=lI.hasOwnProperty;function uf(t,e,n){var r=t[e];(!(dI.call(t,e)&&Au(r,n))||n===void 0&&!(e in t))&&Hm(t,e,n)}function Su(t,e,n,r){var i=!n;n||(n={});for(var s=-1,o=e.length;++s<o;){var a=e[s],u=void 0;u===void 0&&(u=t[a]),i?Hm(n,a,u):uf(n,a,u)}return n}var S0=Math.max;function fI(t,e,n){return e=S0(e===void 0?t.length-1:e,0),function(){for(var r=arguments,i=-1,s=S0(r.length-e,0),o=Array(s);++i<s;)
171
+ o[i]=r[e+i];i=-1;for(var a=Array(e+1);++i<e;)a[i]=r[i];return a[e]=n(o),JN(t,this,a)}}function Km(t,e){return sI(fI(t,e,Cs),t+"")}var pI=9007199254740991;function Vm(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=pI}function jr(t){return t!=null&&Vm(t.length)&&!ii(t)}function _0(t,e,n){if(!sr(n))return!1;var r=typeof e;return(r=="number"?jr(n)&&af(e,n.length):r=="string"&&e in n)?Au(n[e],t):!1}function hI(t){return Km(function(e,n){var r=-1,i=n.length,s=i>1?n[i-1]:void 0,o=i>2?n[2]:void 0;for(s=
172
+ t.length>3&&typeof s=="function"?(i--,s):void 0,o&&_0(n[0],n[1],o)&&(s=i<3?void 0:s,i=1),e=Object(e);++r<i;){var a=n[r];a&&t(e,a,r,s)}return e})}var mI=Object.prototype;function _u(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||mI;return t===n}function gI(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}var yI="[object Arguments]";function P0(t){return vr(t)&&Wi(t)==yI}var x0=Object.prototype,vI=x0.hasOwnProperty,wI=x0.propertyIsEnumerable,cf=P0(function(){return arguments}())?
173
+ P0:function(t){return vr(t)&&vI.call(t,"callee")&&!wI.call(t,"callee")};function bI(){return!1}var N0=typeof exports=="object"&&exports&&!exports.nodeType&&exports,I0=N0&&typeof module=="object"&&module&&!module.nodeType&&module,EI=I0&&I0.exports===N0,O0=EI?qr.Buffer:void 0,$I=O0?O0.isBuffer:void 0,Pu=$I||bI,DI="[object Arguments]",RI="[object Array]",kI="[object Boolean]",TI="[object Date]",CI="[object Error]",AI="[object Function]",SI="[object Map]",_I="[object Number]",PI="[object Object]",xI="\
174
+ [object RegExp]",NI="[object Set]",II="[object String]",OI="[object WeakMap]",FI="[object ArrayBuffer]",LI="[object DataView]",MI="[object Float32Array]",BI="[object Float64Array]",qI="[object Int8Array]",jI="[object Int16Array]",GI="[object Int32Array]",UI="[object Uint8Array]",WI="[object Uint8ClampedArray]",zI="[object Uint16Array]",HI="[object Uint32Array]",bt={};bt[MI]=bt[BI]=bt[qI]=bt[jI]=bt[GI]=bt[UI]=bt[WI]=bt[zI]=bt[HI]=!0,bt[DI]=bt[RI]=bt[FI]=bt[kI]=bt[LI]=bt[TI]=bt[CI]=bt[AI]=bt[SI]=bt[_I]=
175
+ bt[PI]=bt[xI]=bt[NI]=bt[II]=bt[OI]=!1;function KI(t){return vr(t)&&Vm(t.length)&&!!bt[Wi(t)]}function lf(t){return function(e){return t(e)}}var F0=typeof exports=="object"&&exports&&!exports.nodeType&&exports,xu=F0&&typeof module=="object"&&module&&!module.nodeType&&module,VI=xu&&xu.exports===F0,Xm=VI&&y0.process,zi=function(){try{var t=xu&&xu.require&&xu.require("util").types;return t||Xm&&Xm.binding&&Xm.binding("util")}catch{}}(),L0=zi&&zi.isTypedArray,Ym=L0?lf(L0):KI,XI=Object.prototype,YI=XI.
176
+ hasOwnProperty;function M0(t,e){var n=Qe(t),r=!n&&cf(t),i=!n&&!r&&Pu(t),s=!n&&!r&&!i&&Ym(t),o=n||r||i||s,a=o?gI(t.length,String):[],u=a.length;for(var c in t)(e||YI.call(t,c))&&!(o&&(c=="length"||i&&(c=="offset"||c=="parent")||s&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||af(c,u)))&&a.push(c);return a}function B0(t,e){return function(n){return t(e(n))}}var JI=B0(Object.keys,Object),QI=Object.prototype,ZI=QI.hasOwnProperty;function q0(t){if(!_u(t))return JI(t);var e=[];for(var n in Object(t))
177
+ ZI.call(t,n)&&n!="constructor"&&e.push(n);return e}function or(t){return jr(t)?M0(t):q0(t)}var eO=Object.prototype,tO=eO.hasOwnProperty,zn=hI(function(t,e){if(_u(e)||jr(e)){Su(e,or(e),t);return}for(var n in e)tO.call(e,n)&&uf(t,n,e[n])});function nO(t){var e=[];if(t!=null)for(var n in Object(t))e.push(n);return e}var rO=Object.prototype,iO=rO.hasOwnProperty;function sO(t){if(!sr(t))return nO(t);var e=_u(t),n=[];for(var r in t)r=="constructor"&&(e||!iO.call(t,r))||n.push(r);return n}function Jm(t){
178
+ return jr(t)?M0(t,!0):sO(t)}var oO=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,aO=/^\w*$/;function Qm(t,e){if(Qe(t))return!1;var n=typeof t;return n=="number"||n=="symbol"||n=="boolean"||t==null||Cu(t)?!0:aO.test(t)||!oO.test(t)||e!=null&&t in Object(e)}var Nu=Ss(Object,"create");function uO(){this.__data__=Nu?Nu(null):{},this.size=0}function cO(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var lO="__lodash_hash_undefined__",dO=Object.prototype,fO=dO.hasOwnProperty;
179
+ function pO(t){var e=this.__data__;if(Nu){var n=e[t];return n===lO?void 0:n}return fO.call(e,t)?e[t]:void 0}var hO=Object.prototype,mO=hO.hasOwnProperty;function gO(t){var e=this.__data__;return Nu?e[t]!==void 0:mO.call(e,t)}var yO="__lodash_hash_undefined__";function vO(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=Nu&&e===void 0?yO:e,this}function _s(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}_s.prototype.clear=uO,_s.prototype.delete=
180
+ cO,_s.prototype.get=pO,_s.prototype.has=gO,_s.prototype.set=vO;function wO(){this.__data__=[],this.size=0}function df(t,e){for(var n=t.length;n--;)if(Au(t[n][0],e))return n;return-1}var bO=Array.prototype,EO=bO.splice;function $O(t){var e=this.__data__,n=df(e,t);if(n<0)return!1;var r=e.length-1;return n==r?e.pop():EO.call(e,n,1),--this.size,!0}function DO(t){var e=this.__data__,n=df(e,t);return n<0?void 0:e[n][1]}function RO(t){return df(this.__data__,t)>-1}function kO(t,e){var n=this.__data__,r=df(
181
+ n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}function si(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}si.prototype.clear=wO,si.prototype.delete=$O,si.prototype.get=DO,si.prototype.has=RO,si.prototype.set=kO;var Iu=Ss(qr,"Map");function TO(){this.size=0,this.__data__={hash:new _s,map:new(Iu||si),string:new _s}}function CO(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function ff(t,e){
182
+ var n=t.__data__;return CO(e)?n[typeof e=="string"?"string":"hash"]:n.map}function AO(t){var e=ff(this,t).delete(t);return this.size-=e?1:0,e}function SO(t){return ff(this,t).get(t)}function _O(t){return ff(this,t).has(t)}function PO(t,e){var n=ff(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this}function oi(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}oi.prototype.clear=TO,oi.prototype.delete=AO,oi.prototype.get=SO,oi.prototype.has=_O,
183
+ oi.prototype.set=PO;var xO="Expected a function";function Zm(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(xO);var n=function(){var r=arguments,i=e?e.apply(this,r):r[0],s=n.cache;if(s.has(i))return s.get(i);var o=t.apply(this,r);return n.cache=s.set(i,o)||s,o};return n.cache=new(Zm.Cache||oi),n}Zm.Cache=oi;var NO=500;function IO(t){var e=Zm(t,function(r){return n.size===NO&&n.clear(),r}),n=e.cache;return e}var OO=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,
184
+ FO=/\\(\\)?/g,LO=IO(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(OO,function(n,r,i,s){e.push(i?s.replace(FO,"$1"):r||n)}),e});function MO(t){return t==null?"":$0(t)}function pf(t,e){return Qe(t)?t:Qm(t,e)?[t]:LO(MO(t))}function Ou(t){if(typeof t=="string"||Cu(t))return t;var e=t+"";return e=="0"&&1/t==-1/0?"-0":e}function eg(t,e){e=pf(e,t);for(var n=0,r=e.length;t!=null&&n<r;)t=t[Ou(e[n++])];return n&&n==r?t:void 0}function BO(t,e,n){var r=t==null?void 0:eg(t,e);return r===
185
+ void 0?n:r}function tg(t,e){for(var n=-1,r=e.length,i=t.length;++n<r;)t[i+n]=e[n];return t}var j0=ir?ir.isConcatSpreadable:void 0;function qO(t){return Qe(t)||cf(t)||!!(j0&&t&&t[j0])}function ng(t,e,n,r,i){var s=-1,o=t.length;for(n||(n=qO),i||(i=[]);++s<o;){var a=t[s];n(a)?tg(i,a):r||(i[i.length]=a)}return i}function ar(t){var e=t==null?0:t.length;return e?ng(t):[]}var G0=B0(Object.getPrototypeOf,Object);function U0(t,e,n){var r=-1,i=t.length;e<0&&(e=-e>i?0:i+e),n=n>i?i:n,n<0&&(n+=i),i=e>n?0:n-e>>>
186
+ 0,e>>>=0;for(var s=Array(i);++r<i;)s[r]=t[r+e];return s}function jO(t,e,n,r){var i=-1,s=t==null?0:t.length;for(r&&s&&(n=t[++i]);++i<s;)n=e(n,t[i],i,t);return n}function GO(){this.__data__=new si,this.size=0}function UO(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}function WO(t){return this.__data__.get(t)}function zO(t){return this.__data__.has(t)}var HO=200;function KO(t,e){var n=this.__data__;if(n instanceof si){var r=n.__data__;if(!Iu||r.length<HO-1)return r.push([t,e]),this.
187
+ size=++n.size,this;n=this.__data__=new oi(r)}return n.set(t,e),this.size=n.size,this}function Gr(t){var e=this.__data__=new si(t);this.size=e.size}Gr.prototype.clear=GO,Gr.prototype.delete=UO,Gr.prototype.get=WO,Gr.prototype.has=zO,Gr.prototype.set=KO;function VO(t,e){return t&&Su(e,or(e),t)}function XO(t,e){return t&&Su(e,Jm(e),t)}var W0=typeof exports=="object"&&exports&&!exports.nodeType&&exports,z0=W0&&typeof module=="object"&&module&&!module.nodeType&&module,YO=z0&&z0.exports===W0,H0=YO?qr.
188
+ Buffer:void 0,K0=H0?H0.allocUnsafe:void 0;function JO(t,e){var n=t.length,r=K0?K0(n):new t.constructor(n);return t.copy(r),r}function rg(t,e){for(var n=-1,r=t==null?0:t.length,i=0,s=[];++n<r;){var o=t[n];e(o,n,t)&&(s[i++]=o)}return s}function V0(){return[]}var QO=Object.prototype,ZO=QO.propertyIsEnumerable,X0=Object.getOwnPropertySymbols,ig=X0?function(t){return t==null?[]:(t=Object(t),rg(X0(t),function(e){return ZO.call(t,e)}))}:V0;function eF(t,e){return Su(t,ig(t),e)}var tF=Object.getOwnPropertySymbols,
189
+ Y0=tF?function(t){for(var e=[];t;)tg(e,ig(t)),t=G0(t);return e}:V0;function nF(t,e){return Su(t,Y0(t),e)}function J0(t,e,n){var r=e(t);return Qe(t)?r:tg(r,n(t))}function sg(t){return J0(t,or,ig)}function rF(t){return J0(t,Jm,Y0)}var og=Ss(qr,"DataView"),ag=Ss(qr,"Promise"),Lo=Ss(qr,"Set"),Q0="[object Map]",iF="[object Object]",Z0="[object Promise]",eE="[object Set]",tE="[object WeakMap]",nE="[object DataView]",sF=As(og),oF=As(Iu),aF=As(ag),uF=As(Lo),cF=As(Wm),ur=Wi;(og&&ur(new og(new ArrayBuffer(
190
+ 1)))!=nE||Iu&&ur(new Iu)!=Q0||ag&&ur(ag.resolve())!=Z0||Lo&&ur(new Lo)!=eE||Wm&&ur(new Wm)!=tE)&&(ur=function(t){var e=Wi(t),n=e==iF?t.constructor:void 0,r=n?As(n):"";if(r)switch(r){case sF:return nE;case oF:return Q0;case aF:return Z0;case uF:return eE;case cF:return tE}return e});var lF=Object.prototype,dF=lF.hasOwnProperty;function fF(t){var e=t.length,n=new t.constructor(e);return e&&typeof t[0]=="string"&&dF.call(t,"index")&&(n.index=t.index,n.input=t.input),n}var hf=qr.Uint8Array;function pF(t){
191
+ var e=new t.constructor(t.byteLength);return new hf(e).set(new hf(t)),e}function hF(t,e){var n=t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}var mF=/\w*$/;function gF(t){var e=new t.constructor(t.source,mF.exec(t));return e.lastIndex=t.lastIndex,e}var rE=ir?ir.prototype:void 0,iE=rE?rE.valueOf:void 0;function yF(t){return iE?Object(iE.call(t)):{}}function vF(t,e){var n=t.buffer;return new t.constructor(n,t.byteOffset,t.length)}var wF="[object Boolean]",bF="[object Date]",EF="[ob\
192
+ ject Map]",$F="[object Number]",DF="[object RegExp]",RF="[object Set]",kF="[object String]",TF="[object Symbol]",CF="[object ArrayBuffer]",AF="[object DataView]",SF="[object Float32Array]",_F="[object Float64Array]",PF="[object Int8Array]",xF="[object Int16Array]",NF="[object Int32Array]",IF="[object Uint8Array]",OF="[object Uint8ClampedArray]",FF="[object Uint16Array]",LF="[object Uint32Array]";function MF(t,e,n){var r=t.constructor;switch(e){case CF:return pF(t);case wF:case bF:return new r(+t);case AF:
193
+ return hF(t);case SF:case _F:case PF:case xF:case NF:case IF:case OF:case FF:case LF:return vF(t);case EF:return new r;case $F:case kF:return new r(t);case DF:return gF(t);case RF:return new r;case TF:return yF(t)}}function BF(t){return typeof t.constructor=="function"&&!_u(t)?YN(G0(t)):{}}var qF="[object Map]";function jF(t){return vr(t)&&ur(t)==qF}var sE=zi&&zi.isMap,GF=sE?lf(sE):jF,UF="[object Set]";function WF(t){return vr(t)&&ur(t)==UF}var oE=zi&&zi.isSet,zF=oE?lf(oE):WF,HF=2,aE="[object Ar\
194
+ guments]",KF="[object Array]",VF="[object Boolean]",XF="[object Date]",YF="[object Error]",uE="[object Function]",JF="[object GeneratorFunction]",QF="[object Map]",ZF="[object Number]",cE="[object Object]",eL="[object RegExp]",tL="[object Set]",nL="[object String]",rL="[object Symbol]",iL="[object WeakMap]",sL="[object ArrayBuffer]",oL="[object DataView]",aL="[object Float32Array]",uL="[object Float64Array]",cL="[object Int8Array]",lL="[object Int16Array]",dL="[object Int32Array]",fL="[object Ui\
195
+ nt8Array]",pL="[object Uint8ClampedArray]",hL="[object Uint16Array]",mL="[object Uint32Array]",gt={};gt[aE]=gt[KF]=gt[sL]=gt[oL]=gt[VF]=gt[XF]=gt[aL]=gt[uL]=gt[cL]=gt[lL]=gt[dL]=gt[QF]=gt[ZF]=gt[cE]=gt[eL]=gt[tL]=gt[nL]=gt[rL]=gt[fL]=gt[pL]=gt[hL]=gt[mL]=!0,gt[YF]=gt[uE]=gt[iL]=!1;function mf(t,e,n,r,i,s){var o,a=e&HF;if(o!==void 0)return o;if(!sr(t))return t;var u=Qe(t);if(u)return o=fF(t),QN(t,o);var c=ur(t),l=c==uE||c==JF;if(Pu(t))return JO(t);if(c==cE||c==aE||l&&!i)return o=l?{}:BF(t),a?nF(t,
196
+ XO(o,t)):eF(t,VO(o,t));if(!gt[c])return i?t:{};o=MF(t,c),s||(s=new Gr);var f=s.get(t);if(f)return f;s.set(t,o),zF(t)?t.forEach(function(m){o.add(mf(m,e,n,m,t,s))}):GF(t)&&t.forEach(function(m,v){o.set(v,mf(m,e,n,v,t,s))});var d=sg,p=u?void 0:d(t);return T0(p||t,function(m,v){p&&(v=m,m=t[v]),uf(o,v,mf(m,e,n,v,t,s))}),o}var gL=4;function sn(t){return mf(t,gL)}function Fu(t){for(var e=-1,n=t==null?0:t.length,r=0,i=[];++e<n;){var s=t[e];s&&(i[r++]=s)}return i}var yL="__lodash_hash_undefined__";function vL(t){
197
+ return this.__data__.set(t,yL),this}function wL(t){return this.__data__.has(t)}function Mo(t){var e=-1,n=t==null?0:t.length;for(this.__data__=new oi;++e<n;)this.add(t[e])}Mo.prototype.add=Mo.prototype.push=vL,Mo.prototype.has=wL;function lE(t,e){for(var n=-1,r=t==null?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}function ug(t,e){return t.has(e)}var bL=1,EL=2;function dE(t,e,n,r,i,s){var o=n&bL,a=t.length,u=e.length;if(a!=u&&!(o&&u>a))return!1;var c=s.get(t),l=s.get(e);if(c&&l)return c==e&&
198
+ l==t;var f=-1,d=!0,p=n&EL?new Mo:void 0;for(s.set(t,e),s.set(e,t);++f<a;){var m=t[f],v=e[f];if(r)var w=o?r(v,m,f,e,t,s):r(m,v,f,t,e,s);if(w!==void 0){if(w)continue;d=!1;break}if(p){if(!lE(e,function(y,E){if(!ug(p,E)&&(m===y||i(m,y,n,r,s)))return p.push(E)})){d=!1;break}}else if(!(m===v||i(m,v,n,r,s))){d=!1;break}}return s.delete(t),s.delete(e),d}function $L(t){var e=-1,n=Array(t.size);return t.forEach(function(r,i){n[++e]=[i,r]}),n}function cg(t){var e=-1,n=Array(t.size);return t.forEach(function(r){
199
+ n[++e]=r}),n}var DL=1,RL=2,kL="[object Boolean]",TL="[object Date]",CL="[object Error]",AL="[object Map]",SL="[object Number]",_L="[object RegExp]",PL="[object Set]",xL="[object String]",NL="[object Symbol]",IL="[object ArrayBuffer]",OL="[object DataView]",fE=ir?ir.prototype:void 0,lg=fE?fE.valueOf:void 0;function FL(t,e,n,r,i,s,o){switch(n){case OL:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case IL:return!(t.byteLength!=e.byteLength||!s(new hf(t),new hf(
200
+ e)));case kL:case TL:case SL:return Au(+t,+e);case CL:return t.name==e.name&&t.message==e.message;case _L:case xL:return t==e+"";case AL:var a=$L;case PL:var u=r&DL;if(a||(a=cg),t.size!=e.size&&!u)return!1;var c=o.get(t);if(c)return c==e;r|=RL,o.set(t,e);var l=dE(a(t),a(e),r,i,s,o);return o.delete(t),l;case NL:if(lg)return lg.call(t)==lg.call(e)}return!1}var LL=1,ML=Object.prototype,BL=ML.hasOwnProperty;function qL(t,e,n,r,i,s){var o=n&LL,a=sg(t),u=a.length,c=sg(e),l=c.length;if(u!=l&&!o)return!1;
201
+ for(var f=u;f--;){var d=a[f];if(!(o?d in e:BL.call(e,d)))return!1}var p=s.get(t),m=s.get(e);if(p&&m)return p==e&&m==t;var v=!0;s.set(t,e),s.set(e,t);for(var w=o;++f<u;){d=a[f];var y=t[d],E=e[d];if(r)var R=o?r(E,y,d,e,t,s):r(y,E,d,t,e,s);if(!(R===void 0?y===E||i(y,E,n,r,s):R)){v=!1;break}w||(w=d=="constructor")}if(v&&!w){var A=t.constructor,N=e.constructor;A!=N&&"constructor"in t&&"constructor"in e&&!(typeof A=="function"&&A instanceof A&&typeof N=="function"&&N instanceof N)&&(v=!1)}return s.delete(
202
+ t),s.delete(e),v}var jL=1,pE="[object Arguments]",hE="[object Array]",gf="[object Object]",GL=Object.prototype,mE=GL.hasOwnProperty;function UL(t,e,n,r,i,s){var o=Qe(t),a=Qe(e),u=o?hE:ur(t),c=a?hE:ur(e);u=u==pE?gf:u,c=c==pE?gf:c;var l=u==gf,f=c==gf,d=u==c;if(d&&Pu(t)){if(!Pu(e))return!1;o=!0,l=!1}if(d&&!l)return s||(s=new Gr),o||Ym(t)?dE(t,e,n,r,i,s):FL(t,e,u,n,r,i,s);if(!(n&jL)){var p=l&&mE.call(t,"__wrapped__"),m=f&&mE.call(e,"__wrapped__");if(p||m){var v=p?t.value():t,w=m?e.value():e;return s||
203
+ (s=new Gr),i(v,w,n,r,s)}}return d?(s||(s=new Gr),qL(t,e,n,r,i,s)):!1}function dg(t,e,n,r,i){return t===e?!0:t==null||e==null||!vr(t)&&!vr(e)?t!==t&&e!==e:UL(t,e,n,r,dg,i)}var WL=1,zL=2;function HL(t,e,n,r){var i=n.length,s=i;if(t==null)return!s;for(t=Object(t);i--;){var o=n[i];if(o[2]?o[1]!==t[o[0]]:!(o[0]in t))return!1}for(;++i<s;){o=n[i];var a=o[0],u=t[a],c=o[1];if(o[2]){if(u===void 0&&!(a in t))return!1}else{var l=new Gr,f;if(!(f===void 0?dg(c,u,WL|zL,r,l):f))return!1}}return!0}function gE(t){
204
+ return t===t&&!sr(t)}function KL(t){for(var e=or(t),n=e.length;n--;){var r=e[n],i=t[r];e[n]=[r,i,gE(i)]}return e}function yE(t,e){return function(n){return n==null?!1:n[t]===e&&(e!==void 0||t in Object(n))}}function VL(t){var e=KL(t);return e.length==1&&e[0][2]?yE(e[0][0],e[0][1]):function(n){return n===t||HL(n,t,e)}}function XL(t,e){return t!=null&&e in Object(t)}function vE(t,e,n){e=pf(e,t);for(var r=-1,i=e.length,s=!1;++r<i;){var o=Ou(e[r]);if(!(s=t!=null&&n(t,o)))break;t=t[o]}return s||++r!=
205
+ i?s:(i=t==null?0:t.length,!!i&&Vm(i)&&af(o,i)&&(Qe(t)||cf(t)))}function YL(t,e){return t!=null&&vE(t,e,XL)}var JL=1,QL=2;function ZL(t,e){return Qm(t)&&gE(e)?yE(Ou(t),e):function(n){var r=BO(n,t);return r===void 0&&r===e?YL(n,t):dg(e,r,JL|QL)}}function eM(t){return function(e){return e?.[t]}}function tM(t){return function(e){return eg(e,t)}}function nM(t){return Qm(t)?eM(Ou(t)):tM(t)}function wr(t){return typeof t=="function"?t:t==null?Cs:typeof t=="object"?Qe(t)?ZL(t[0],t[1]):VL(t):nM(t)}function rM(t,e,n,r){
206
+ for(var i=-1,s=t==null?0:t.length;++i<s;){var o=t[i];e(r,o,n(o),t)}return r}function iM(t){return function(e,n,r){for(var i=-1,s=Object(e),o=r(e),a=o.length;a--;){var u=o[++i];if(n(s[u],u,s)===!1)break}return e}}var sM=iM();function oM(t,e){return t&&sM(t,e,or)}function aM(t,e){return function(n,r){if(n==null)return n;if(!jr(n))return t(n,r);for(var i=n.length,s=-1,o=Object(n);++s<i&&r(o[s],s,o)!==!1;);return n}}var Ps=aM(oM);function uM(t,e,n,r){return Ps(t,function(i,s,o){e(r,i,n(i),o)}),r}function cM(t,e){
207
+ return function(n,r){var i=Qe(n)?rM:uM,s=e?e():{};return i(n,t,wr(r),s)}}var wE=Object.prototype,lM=wE.hasOwnProperty,fg=Km(function(t,e){t=Object(t);var n=-1,r=e.length,i=r>2?e[2]:void 0;for(i&&_0(e[0],e[1],i)&&(r=1);++n<r;)for(var s=e[n],o=Jm(s),a=-1,u=o.length;++a<u;){var c=o[a],l=t[c];(l===void 0||Au(l,wE[c])&&!lM.call(t,c))&&(t[c]=s[c])}return t});function bE(t){return vr(t)&&jr(t)}var dM=200;function fM(t,e,n,r){var i=-1,s=A0,o=!0,a=t.length,u=[],c=e.length;if(!a)return u;e.length>=dM&&(s=
208
+ ug,o=!1,e=new Mo(e));e:for(;++i<a;){var l=t[i],f=l;if(l=l!==0?l:0,o&&f===f){for(var d=c;d--;)if(e[d]===f)continue e;u.push(l)}else s(e,f,r)||u.push(l)}return u}var yf=Km(function(t,e){return bE(t)?fM(t,ng(e,1,bE,!0)):[]});function Bo(t){var e=t==null?0:t.length;return e?t[e-1]:void 0}function on(t,e,n){var r=t==null?0:t.length;return r?(e=e===void 0?1:sf(e),U0(t,e<0?0:e,r)):[]}function Lu(t,e,n){var r=t==null?0:t.length;return r?(e=e===void 0?1:sf(e),e=r-e,U0(t,0,e<0?0:e)):[]}function pM(t){return typeof t==
209
+ "function"?t:Cs}function ke(t,e){var n=Qe(t)?T0:Ps;return n(t,pM(e))}function hM(t,e){for(var n=-1,r=t==null?0:t.length;++n<r;)if(!e(t[n],n,t))return!1;return!0}function mM(t,e){var n=!0;return Ps(t,function(r,i,s){return n=!!e(r,i,s),n}),n}function br(t,e,n){var r=Qe(t)?hM:mM;return r(t,wr(e))}function EE(t,e){var n=[];return Ps(t,function(r,i,s){e(r,i,s)&&n.push(r)}),n}function Hn(t,e){var n=Qe(t)?rg:EE;return n(t,wr(e))}function gM(t){return function(e,n,r){var i=Object(e);if(!jr(e)){var s=wr(
210
+ n);e=or(e),n=function(a){return s(i[a],a,i)}}var o=t(e,n,r);return o>-1?i[s?e[o]:o]:void 0}}var yM=Math.max;function vM(t,e,n){var r=t==null?0:t.length;if(!r)return-1;var i=n==null?0:sf(n);return i<0&&(i=yM(r+i,0)),C0(t,wr(e),i)}var qo=gM(vM);function Er(t){return t&&t.length?t[0]:void 0}function wM(t,e){var n=-1,r=jr(t)?Array(t.length):[];return Ps(t,function(i,s,o){r[++n]=e(i,s,o)}),r}function ve(t,e){var n=Qe(t)?rf:wM;return n(t,wr(e))}function Kn(t,e){return ng(ve(t,e))}var bM=Object.prototype,
211
+ EM=bM.hasOwnProperty,$M=cM(function(t,e,n){EM.call(t,n)?t[n].push(e):Hm(t,n,[e])}),DM=Object.prototype,RM=DM.hasOwnProperty;function kM(t,e){return t!=null&&RM.call(t,e)}function Te(t,e){return t!=null&&vE(t,e,kM)}var TM="[object String]";function In(t){return typeof t=="string"||!Qe(t)&&vr(t)&&Wi(t)==TM}function CM(t,e){return rf(e,function(n){return t[n]})}function Kt(t){return t==null?[]:CM(t,or(t))}var AM=Math.max;function En(t,e,n,r){t=jr(t)?t:Kt(t),n=n?sf(n):0;var i=t.length;return n<0&&(n=
212
+ AM(i+n,0)),In(t)?n<=i&&t.indexOf(e,n)>-1:!!i&&zm(t,e,n)>-1}function $E(t,e,n){var r=t==null?0:t.length;if(!r)return-1;var i=0;return zm(t,e,i)}var SM="[object Map]",_M="[object Set]",PM=Object.prototype,xM=PM.hasOwnProperty;function ft(t){if(t==null)return!0;if(jr(t)&&(Qe(t)||typeof t=="string"||typeof t.splice=="function"||Pu(t)||Ym(t)||cf(t)))return!t.length;var e=ur(t);if(e==SM||e==_M)return!t.size;if(_u(t))return!q0(t).length;for(var n in t)if(xM.call(t,n))return!1;return!0}var NM="[object R\
213
+ egExp]";function IM(t){return vr(t)&&Wi(t)==NM}var DE=zi&&zi.isRegExp,ai=DE?lf(DE):IM;function ui(t){return t===void 0}function OM(t,e){return t<e}function FM(t,e,n){for(var r=-1,i=t.length;++r<i;){var s=t[r],o=e(s);if(o!=null&&(a===void 0?o===o&&!Cu(o):n(o,a)))var a=o,u=s}return u}function LM(t){return t&&t.length?FM(t,Cs,OM):void 0}var MM="Expected a function";function BM(t){if(typeof t!="function")throw new TypeError(MM);return function(){var e=arguments;switch(e.length){case 0:return!t.call(
214
+ 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 qM(t,e,n,r){if(!sr(t))return t;e=pf(e,t);for(var i=-1,s=e.length,o=s-1,a=t;a!=null&&++i<s;){var u=Ou(e[i]),c=n;if(u==="__proto__"||u==="constructor"||u==="prototype")return t;if(i!=o){var l=a[u];c=void 0,c===void 0&&(c=sr(l)?l:af(e[i+1])?[]:{})}uf(a,u,c),a=a[u]}return t}function jM(t,e,n){for(var r=-1,i=e.length,s={};++r<i;){var o=e[r],a=eg(t,o);n(
215
+ a,o)&&qM(s,pf(o,t),a)}return s}function $r(t,e){if(t==null)return{};var n=rf(rF(t),function(r){return[r]});return e=wr(e),jM(t,n,function(r,i){return e(r,i[0])})}function GM(t,e,n,r,i){return i(t,function(s,o,a){n=r?(r=!1,s):e(n,s,o,a)}),n}function $n(t,e,n){var r=Qe(t)?jO:GM,i=arguments.length<3;return r(t,wr(e),n,i,Ps)}function vf(t,e){var n=Qe(t)?rg:EE;return n(t,BM(wr(e)))}function UM(t,e){var n;return Ps(t,function(r,i,s){return n=e(r,i,s),!n}),!!n}function RE(t,e,n){var r=Qe(t)?lE:UM;return r(
216
+ t,wr(e))}var WM=1/0,zM=Lo&&1/cg(new Lo([,-0]))[1]==WM?function(t){return new Lo(t)}:Ht,HM=200;function kE(t,e,n){var r=-1,i=A0,s=t.length,o=!0,a=[],u=a;if(s>=HM){var c=e?null:zM(t);if(c)return cg(c);o=!1,i=ug,u=new Mo}else u=e?[]:a;e:for(;++r<s;){var l=t[r],f=e?e(l):l;if(l=l!==0?l:0,o&&f===f){for(var d=u.length;d--;)if(u[d]===f)continue e;e&&u.push(f),a.push(l)}else i(u,f,n)||(u!==a&&u.push(f),a.push(l))}return a}function pg(t){return t&&t.length?kE(t):[]}function KM(t,e){return t&&t.length?kE(t,
217
+ wr(e)):[]}function hg(t){console&&console.error&&console.error(`Error: ${t}`)}function TE(t){console&&console.warn&&console.warn(`Warning: ${t}`)}function CE(t){const e=new Date().getTime(),n=t();return{time:new Date().getTime()-e,value:n}}function AE(t){function e(){}e.prototype=t;const n=new e;function r(){return typeof n.bar}return r(),r(),t}function VM(t){return XM(t)?t.LABEL:t.name}function XM(t){return In(t.LABEL)&&t.LABEL!==""}class Ur{get definition(){return this._definition}set definition(e){
218
+ this._definition=e}constructor(e){this._definition=e}accept(e){e.visit(this),ke(this.definition,n=>{n.accept(e)})}}class Dn extends Ur{constructor(e){super([]),this.idx=1,zn(this,$r(e,n=>n!==void 0))}set definition(e){}get definition(){return this.referencedRule!==void 0?this.referencedRule.definition:[]}accept(e){e.visit(this)}}class jo extends Ur{constructor(e){super(e.definition),this.orgText="",zn(this,$r(e,n=>n!==void 0))}}class On extends Ur{constructor(e){super(e.definition),this.ignoreAmbiguities=
219
+ !1,zn(this,$r(e,n=>n!==void 0))}}class an extends Ur{constructor(e){super(e.definition),this.idx=1,zn(this,$r(e,n=>n!==void 0))}}class Vn extends Ur{constructor(e){super(e.definition),this.idx=1,zn(this,$r(e,n=>n!==void 0))}}class Xn extends Ur{constructor(e){super(e.definition),this.idx=1,zn(this,$r(e,n=>n!==void 0))}}class _t extends Ur{constructor(e){super(e.definition),this.idx=1,zn(this,$r(e,n=>n!==void 0))}}class Fn extends Ur{constructor(e){super(e.definition),this.idx=1,zn(this,$r(e,n=>n!==
220
+ void 0))}}class Ln extends Ur{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,zn(this,$r(e,n=>n!==void 0))}}class Et{constructor(e){this.idx=1,zn(this,$r(e,n=>n!==void 0))}accept(e){e.visit(this)}}function YM(t){return ve(t,wf)}function wf(t){function e(n){return ve(n,wf)}if(t instanceof Dn){const n={type:"NonTerminal",name:t.nonTerminalName,idx:t.idx};return In(t.label)&&(n.
221
+ label=t.label),n}else{if(t instanceof On)return{type:"Alternative",definition:e(t.definition)};if(t instanceof an)return{type:"Option",idx:t.idx,definition:e(t.definition)};if(t instanceof Vn)return{type:"RepetitionMandatory",idx:t.idx,definition:e(t.definition)};if(t instanceof Xn)return{type:"RepetitionMandatoryWithSeparator",idx:t.idx,separator:wf(new Et({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof Fn)return{type:"RepetitionWithSeparator",idx:t.idx,separator:wf(new Et(
222
+ {terminalType:t.separator})),definition:e(t.definition)};if(t instanceof _t)return{type:"Repetition",idx:t.idx,definition:e(t.definition)};if(t instanceof Ln)return{type:"Alternation",idx:t.idx,definition:e(t.definition)};if(t instanceof Et){const n={type:"Terminal",name:t.terminalType.name,label:VM(t.terminalType),idx:t.idx};In(t.label)&&(n.terminalLabel=t.label);const r=t.terminalType.PATTERN;return t.terminalType.PATTERN&&(n.pattern=ai(r)?r.source:r),n}else{if(t instanceof jo)return{type:"Rul\
223
+ e",name:t.name,orgText:t.orgText,definition:e(t.definition)};throw Error("non exhaustive match")}}}class Go{visit(e){const n=e;switch(n.constructor){case Dn:return this.visitNonTerminal(n);case On:return this.visitAlternative(n);case an:return this.visitOption(n);case Vn:return this.visitRepetitionMandatory(n);case Xn:return this.visitRepetitionMandatoryWithSeparator(n);case Fn:return this.visitRepetitionWithSeparator(n);case _t:return this.visitRepetition(n);case Ln:return this.visitAlternation(
224
+ n);case Et:return this.visitTerminal(n);case jo:return this.visitRule(n);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 JM(t){return t instanceof On||t instanceof an||t instanceof _t||t instanceof Vn||t instanceof Xn||t instanceof Fn||t instanceof Et||t instanceof
225
+ jo}function bf(t,e=[]){return t instanceof an||t instanceof _t||t instanceof Fn?!0:t instanceof Ln?RE(t.definition,r=>bf(r,e)):t instanceof Dn&&En(e,t)?!1:t instanceof Ur?(t instanceof Dn&&e.push(t),br(t.definition,r=>bf(r,e))):!1}function QM(t){return t instanceof Ln}function Wr(t){if(t instanceof Dn)return"SUBRULE";if(t instanceof an)return"OPTION";if(t instanceof Ln)return"OR";if(t instanceof Vn)return"AT_LEAST_ONE";if(t instanceof Xn)return"AT_LEAST_ONE_SEP";if(t instanceof Fn)return"MANY_SE\
226
+ P";if(t instanceof _t)return"MANY";if(t instanceof Et)return"CONSUME";throw Error("non exhaustive match")}class Ef{walk(e,n=[]){ke(e.definition,(r,i)=>{const s=on(e.definition,i+1);if(r instanceof Dn)this.walkProdRef(r,s,n);else if(r instanceof Et)this.walkTerminal(r,s,n);else if(r instanceof On)this.walkFlat(r,s,n);else if(r instanceof an)this.walkOption(r,s,n);else if(r instanceof Vn)this.walkAtLeastOne(r,s,n);else if(r instanceof Xn)this.walkAtLeastOneSep(r,s,n);else if(r instanceof Fn)this.walkManySep(
227
+ r,s,n);else if(r instanceof _t)this.walkMany(r,s,n);else if(r instanceof Ln)this.walkOr(r,s,n);else throw Error("non exhaustive match")})}walkTerminal(e,n,r){}walkProdRef(e,n,r){}walkFlat(e,n,r){const i=n.concat(r);this.walk(e,i)}walkOption(e,n,r){const i=n.concat(r);this.walk(e,i)}walkAtLeastOne(e,n,r){const i=[new an({definition:e.definition})].concat(n,r);this.walk(e,i)}walkAtLeastOneSep(e,n,r){const i=SE(e,n,r);this.walk(e,i)}walkMany(e,n,r){const i=[new an({definition:e.definition})].concat(
228
+ n,r);this.walk(e,i)}walkManySep(e,n,r){const i=SE(e,n,r);this.walk(e,i)}walkOr(e,n,r){const i=n.concat(r);ke(e.definition,s=>{const o=new On({definition:[s]});this.walk(o,i)})}}function SE(t,e,n){return[new an({definition:[new Et({terminalType:t.separator})].concat(t.definition)})].concat(e,n)}function Mu(t){if(t instanceof Dn)return Mu(t.referencedRule);if(t instanceof Et)return t2(t);if(JM(t))return ZM(t);if(QM(t))return e2(t);throw Error("non exhaustive match")}function ZM(t){let e=[];const n=t.
229
+ definition;let r=0,i=n.length>r,s,o=!0;for(;i&&o;)s=n[r],o=bf(s),e=e.concat(Mu(s)),r=r+1,i=n.length>r;return pg(e)}function e2(t){const e=ve(t.definition,n=>Mu(n));return pg(ar(e))}function t2(t){return[t.terminalType]}const _E="_~IN~_";class n2 extends Ef{constructor(e){super(),this.topProd=e,this.follows={}}startWalking(){return this.walk(this.topProd),this.follows}walkTerminal(e,n,r){}walkProdRef(e,n,r){const i=i2(e.referencedRule,e.idx)+this.topProd.name,s=n.concat(r),o=new On({definition:s}),
230
+ a=Mu(o);this.follows[i]=a}}function r2(t){const e={};return ke(t,n=>{const r=new n2(n).startWalking();zn(e,r)}),e}function i2(t,e){return t.name+e+_E}let $f={};const s2=new s0;function Df(t){const e=t.toString();if($f.hasOwnProperty(e))return $f[e];{const n=s2.pattern(e);return $f[e]=n,n}}function o2(){$f={}}const PE="Complement Sets are not supported for first char optimization",Rf=`Unable to use "first char" lexer optimizations:
231
+ `;function a2(t,e=!1){try{const n=Df(t);return mg(n.value,{},n.flags.ignoreCase)}catch(n){if(n.message===PE)e&&TE(`${Rf} Unable to optimize: < ${t.toString()} >
232
+ Complement Sets cannot be automatically optimized.
233
+ This will disable the lexer's first char optimizations.
234
+ See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#COMPLEMENT for details.`);else{let r="";e&&(r=`
235
+ This will disable the lexer's first char optimizations.
236
+ See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details.`),hg(`${Rf}
237
+ Failed parsing: < ${t.toString()} >
238
+ Using the @chevrotain/regexp-to-ast library
239
+ Please open an issue at: https://github.com/chevrotain/chevrotain/issues`+r)}}return[]}function mg(t,e,n){switch(t.type){case"Disjunction":for(let i=0;i<t.value.length;i++)mg(t.value[i],e,n);break;case"Alternative":const r=t.value;for(let i=0;i<r.length;i++){const s=r[i];switch(s.type){case"EndAnchor":case"GroupBackReference":case"Lookahead":case"NegativeLookahead":case"StartAnchor":case"WordBoundary":case"NonWordBoundary":continue}const o=s;switch(o.type){case"Character":kf(o.value,e,n);break;case"\
240
+ Set":if(o.complement===!0)throw Error(PE);ke(o.value,u=>{if(typeof u=="number")kf(u,e,n);else{const c=u;if(n===!0)for(let l=c.from;l<=c.to;l++)kf(l,e,n);else{for(let l=c.from;l<=c.to&&l<qu;l++)kf(l,e,n);if(c.to>=qu){const l=c.from>=qu?c.from:qu,f=c.to,d=Hi(l),p=Hi(f);for(let m=d;m<=p;m++)e[m]=m}}}});break;case"Group":mg(o.value,e,n);break;default:throw Error("Non Exhaustive Match")}const a=o.quantifier!==void 0&&o.quantifier.atLeast===0;if(o.type==="Group"&&gg(o)===!1||o.type!=="Group"&&a===!1)break}
241
+ break;default:throw Error("non exhaustive match!")}return Kt(e)}function kf(t,e,n){const r=Hi(t);e[r]=r,n===!0&&u2(t,e)}function u2(t,e){const n=String.fromCharCode(t),r=n.toUpperCase();if(r!==n){const i=Hi(r.charCodeAt(0));e[i]=i}else{const i=n.toLowerCase();if(i!==n){const s=Hi(i.charCodeAt(0));e[s]=s}}}function xE(t,e){return qo(t.value,n=>{if(typeof n=="number")return En(e,n);{const r=n;return qo(e,i=>r.from<=i&&i<=r.to)!==void 0}})}function gg(t){const e=t.quantifier;return e&&e.atLeast===0?
242
+ !0:t.value?Qe(t.value)?br(t.value,gg):gg(t.value):!1}class c2 extends Zd{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){En(this.targetCharCodes,e.value)&&(this.found=!0)}visitSet(e){e.complement?xE(e,this.targetCharCodes)===void 0&&(this.found=!0):xE(e,this.targetCharCodes)!==void 0&&
243
+ (this.found=!0)}}function yg(t,e){if(e instanceof RegExp){const n=Df(e),r=new c2(t);return r.visit(n),r.found}else return qo(e,n=>En(t,n.charCodeAt(0)))!==void 0}const xs="PATTERN",Bu="defaultMode",Tf="modes";let NE=typeof new RegExp("(?:)").sticky=="boolean";function l2(t,e){e=fg(e,{useSticky:NE,debug:!1,safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r",`
244
+ `],tracer:(E,R)=>R()});const n=e.tracer;n("initCharCodeToOptimizedIndexMap",()=>{N2()});let r;n("Reject Lexer.NA",()=>{r=vf(t,E=>E[xs]===Mn.NA)});let i=!1,s;n("Transform Patterns",()=>{i=!1,s=ve(r,E=>{const R=E[xs];if(ai(R)){const A=R.source;return A.length===1&&A!=="^"&&A!=="$"&&A!=="."&&!R.ignoreCase?A:A.length===2&&A[0]==="\\"&&!En(["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"],A[1])?A[1]:e.useSticky?OE(R):IE(R)}else{if(ii(R))return i=!0,{exec:R};if(typeof R=="object")return i=
245
+ !0,R;if(typeof R=="string"){if(R.length===1)return R;{const A=R.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"),N=new RegExp(A);return e.useSticky?OE(N):IE(N)}}else throw Error("non exhaustive match")}})});let o,a,u,c,l;n("misc mapping",()=>{o=ve(r,E=>E.tokenTypeIdx),a=ve(r,E=>{const R=E.GROUP;if(R!==Mn.SKIPPED){if(In(R))return R;if(ui(R))return!1;throw Error("non exhaustive match")}}),u=ve(r,E=>{const R=E.LONGER_ALT;if(R)return Qe(R)?ve(R,N=>$E(r,N)):[$E(r,R)]}),c=ve(r,E=>E.PUSH_MODE),l=ve(r,E=>Te(E,"POP\
246
+ _MODE"))});let f;n("Line Terminator Handling",()=>{const E=ME(e.lineTerminatorCharacters);f=ve(r,R=>!1),e.positionTracking!=="onlyOffset"&&(f=ve(r,R=>Te(R,"LINE_BREAKS")?!!R.LINE_BREAKS:LE(R,E)===!1&&yg(E,R.PATTERN)))});let d,p,m,v;n("Misc Mapping #2",()=>{d=ve(r,FE),p=ve(s,_2),m=$n(r,(E,R)=>{const A=R.GROUP;return In(A)&&A!==Mn.SKIPPED&&(E[A]=[]),E},{}),v=ve(s,(E,R)=>({pattern:s[R],longerAlt:u[R],canLineTerminator:f[R],isCustom:d[R],short:p[R],group:a[R],push:c[R],pop:l[R],tokenTypeIdx:o[R],tokenType:r[R]}))});
247
+ let w=!0,y=[];return e.safeMode||n("First Char Optimization",()=>{y=$n(r,(E,R,A)=>{if(typeof R.PATTERN=="string"){const N=R.PATTERN.charCodeAt(0),V=Hi(N);vg(E,V,v[A])}else if(Qe(R.START_CHARS_HINT)){let N;ke(R.START_CHARS_HINT,V=>{const J=typeof V=="string"?V.charCodeAt(0):V,se=Hi(J);N!==se&&(N=se,vg(E,se,v[A]))})}else if(ai(R.PATTERN))if(R.PATTERN.unicode)w=!1,e.ensureOptimizations&&hg(`${Rf} Unable to analyze < ${R.PATTERN.toString()} > pattern.
248
+ The regexp unicode flag is not currently supported by the regexp-to-ast library.
249
+ This will disable the lexer's first char optimizations.
250
+ For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE`);else{const N=a2(R.PATTERN,e.ensureOptimizations);ft(N)&&(w=!1),ke(N,V=>{vg(E,V,v[A])})}else e.ensureOptimizations&&hg(`${Rf} TokenType: <${R.name}> is using a custom token pattern without providing <start_chars_hint> parameter.
251
+ This will disable the lexer's first char optimizations.
252
+ For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE`),w=!1;return E},[])}),{emptyGroups:m,patternIdxToConfig:v,charCodeToPatternIdxToConfig:y,hasCustom:i,canBeOptimized:w}}function d2(t,e){let n=[];const r=p2(t);n=n.concat(r.errors);const i=h2(r.valid),s=i.valid;return n=n.concat(i.errors),n=n.concat(f2(s)),n=n.concat($2(s)),n=n.concat(D2(s,e)),n=n.concat(R2(s)),n}function f2(t){let e=[];const n=Hn(t,r=>ai(r[xs]));return e=e.concat(g2(n)),e=e.concat(w2(
253
+ n)),e=e.concat(b2(n)),e=e.concat(E2(n)),e=e.concat(y2(n)),e}function p2(t){const e=Hn(t,i=>!Te(i,xs)),n=ve(e,i=>({message:"Token Type: ->"+i.name+"<- missing static 'PATTERN' property",type:Pt.MISSING_PATTERN,tokenTypes:[i]})),r=yf(t,e);return{errors:n,valid:r}}function h2(t){const e=Hn(t,i=>{const s=i[xs];return!ai(s)&&!ii(s)&&!Te(s,"exec")&&!In(s)}),n=ve(e,i=>({message:"Token Type: ->"+i.name+"<- static 'PATTERN' can only be a RegExp, a Function matching the {CustomPatternMatcherFunc} type or \
254
+ an Object matching the {ICustomPattern} interface.",type:Pt.INVALID_PATTERN,tokenTypes:[i]})),r=yf(t,e);return{errors:n,valid:r}}const m2=/[^\\][$]/;function g2(t){class e extends Zd{constructor(){super(...arguments),this.found=!1}visitEndAnchor(s){this.found=!0}}const n=Hn(t,i=>{const s=i.PATTERN;try{const o=Df(s),a=new e;return a.visit(o),a.found}catch{return m2.test(s.source)}});return ve(n,i=>({message:`Unexpected RegExp Anchor Error:
255
+ Token Type: ->`+i.name+`<- static 'PATTERN' cannot contain end of input anchor '$'
256
+ See chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:Pt.EOI_ANCHOR_FOUND,tokenTypes:[i]}))}function y2(t){const e=Hn(t,r=>r.PATTERN.test(""));return ve(e,r=>({message:"Token Type: ->"+r.name+"<- static 'PATTERN' must not match an empty string",type:Pt.EMPTY_MATCH_PATTERN,tokenTypes:[r]}))}const v2=/[^\\[][\^]|^\^/;function w2(t){class e extends Zd{constructor(){super(...arguments),this.found=!1}visitStartAnchor(s){this.found=!0}}const n=Hn(t,i=>{const s=i.PATTERN;
257
+ try{const o=Df(s),a=new e;return a.visit(o),a.found}catch{return v2.test(s.source)}});return ve(n,i=>({message:`Unexpected RegExp Anchor Error:
258
+ Token Type: ->`+i.name+`<- static 'PATTERN' cannot contain start of input anchor '^'
259
+ See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:Pt.SOI_ANCHOR_FOUND,tokenTypes:[i]}))}function b2(t){const e=Hn(t,r=>{const i=r[xs];return i instanceof RegExp&&(i.multiline||i.global)});return ve(e,r=>({message:"Token Type: ->"+r.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:Pt.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[r]}))}function E2(t){const e=[];let n=ve(t,s=>$n(t,(o,a)=>(s.PATTERN.source===a.PATTERN.source&&!En(e,a)&&a.
260
+ PATTERN!==Mn.NA&&(e.push(a),o.push(a)),o),[]));n=Fu(n);const r=Hn(n,s=>s.length>1);return ve(r,s=>{const o=ve(s,u=>u.name);return{message:`The same RegExp pattern ->${Er(s).PATTERN}<-has been used in all of the following Token Types: ${o.join(", ")} <-`,type:Pt.DUPLICATE_PATTERNS_FOUND,tokenTypes:s}})}function $2(t){const e=Hn(t,r=>{if(!Te(r,"GROUP"))return!1;const i=r.GROUP;return i!==Mn.SKIPPED&&i!==Mn.NA&&!In(i)});return ve(e,r=>({message:"Token Type: ->"+r.name+"<- static 'GROUP' can only be\
261
+ Lexer.SKIPPED/Lexer.NA/A String",type:Pt.INVALID_GROUP_TYPE_FOUND,tokenTypes:[r]}))}function D2(t,e){const n=Hn(t,i=>i.PUSH_MODE!==void 0&&!En(e,i.PUSH_MODE));return ve(n,i=>({message:`Token Type: ->${i.name}<- static 'PUSH_MODE' value cannot refer to a Lexer Mode ->${i.PUSH_MODE}<-which does not exist`,type:Pt.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[i]}))}function R2(t){const e=[],n=$n(t,(r,i,s)=>{const o=i.PATTERN;return o===Mn.NA||(In(o)?r.push({str:o,idx:s,tokenType:i}):ai(o)&&T2(o)&&r.push({str:o.
262
+ source,idx:s,tokenType:i})),r},[]);return ke(t,(r,i)=>{ke(n,({str:s,idx:o,tokenType:a})=>{if(i<o&&k2(s,r.PATTERN)){const u=`Token: ->${a.name}<- can never be matched.
263
+ Because it appears AFTER the Token Type ->${r.name}<-in the lexer's definition.
264
+ See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;e.push({message:u,type:Pt.UNREACHABLE_PATTERN,tokenTypes:[r,a]})}})}),e}function k2(t,e){if(ai(e)){const n=e.exec(t);return n!==null&&n.index===0}else{if(ii(e))return e(t,0,[],{});if(Te(e,"exec"))return e.exec(t,0,[],{});if(typeof e=="string")return e===t;throw Error("non exhaustive match")}}function T2(t){return qo([".","\\","[","]","|","^","$","(",")","?","*","+","{"],n=>t.source.indexOf(n)!==-1)===void 0}function IE(t){
265
+ const e=t.ignoreCase?"i":"";return new RegExp(`^(?:${t.source})`,e)}function OE(t){const e=t.ignoreCase?"iy":"y";return new RegExp(`${t.source}`,e)}function C2(t,e,n){const r=[];return Te(t,Bu)||r.push({message:"A MultiMode Lexer cannot be initialized without a <"+Bu+`> property in its definition
266
+ `,type:Pt.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),Te(t,Tf)||r.push({message:"A MultiMode Lexer cannot be initialized without a <"+Tf+`> property in its definition
267
+ `,type:Pt.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),Te(t,Tf)&&Te(t,Bu)&&!Te(t.modes,t.defaultMode)&&r.push({message:`A MultiMode Lexer cannot be initialized with a ${Bu}: <${t.defaultMode}>which does not exist
268
+ `,type:Pt.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),Te(t,Tf)&&ke(t.modes,(i,s)=>{ke(i,(o,a)=>{if(ui(o))r.push({message:`A Lexer cannot be initialized using an undefined Token Type. Mode:<${s}> at index: <${a}>
269
+ `,type:Pt.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED});else if(Te(o,"LONGER_ALT")){const u=Qe(o.LONGER_ALT)?o.LONGER_ALT:[o.LONGER_ALT];ke(u,c=>{!ui(c)&&!En(i,c)&&r.push({message:`A MultiMode Lexer cannot be initialized with a longer_alt <${c.name}> on token <${o.name}> outside of mode <${s}>
270
+ `,type:Pt.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE})})}})}),r}function A2(t,e,n){const r=[];let i=!1;const s=Fu(ar(Kt(t.modes))),o=vf(s,u=>u[xs]===Mn.NA),a=ME(n);return e&&ke(o,u=>{const c=LE(u,a);if(c!==!1){const f={message:x2(u,c),type:c.issue,tokenType:u};r.push(f)}else Te(u,"LINE_BREAKS")?u.LINE_BREAKS===!0&&(i=!0):yg(a,u.PATTERN)&&(i=!0)}),e&&!i&&r.push({message:`Warning: No LINE_BREAKS Found.
271
+ This Lexer has been defined to track line and column information,
272
+ But none of the Token Types can be identified as matching a line terminator.
273
+ See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#LINE_BREAKS
274
+ for details.`,type:Pt.NO_LINE_BREAKS_FLAGS}),r}function S2(t){const e={},n=or(t);return ke(n,r=>{const i=t[r];if(Qe(i))e[r]=[];else throw Error("non exhaustive match")}),e}function FE(t){const e=t.PATTERN;if(ai(e))return!1;if(ii(e))return!0;if(Te(e,"exec"))return!0;if(In(e))return!1;throw Error("non exhaustive match")}function _2(t){return In(t)&&t.length===1?t.charCodeAt(0):!1}const P2={test:function(t){const e=t.length;for(let n=this.lastIndex;n<e;n++){const r=t.charCodeAt(n);if(r===10)return this.
275
+ lastIndex=n+1,!0;if(r===13)return t.charCodeAt(n+1)===10?this.lastIndex=n+2:this.lastIndex=n+1,!0}return!1},lastIndex:0};function LE(t,e){if(Te(t,"LINE_BREAKS"))return!1;if(ai(t.PATTERN)){try{yg(e,t.PATTERN)}catch(n){return{issue:Pt.IDENTIFY_TERMINATOR,errMsg:n.message}}return!1}else{if(In(t.PATTERN))return!1;if(FE(t))return{issue:Pt.CUSTOM_LINE_BREAK};throw Error("non exhaustive match")}}function x2(t,e){if(e.issue===Pt.IDENTIFY_TERMINATOR)return`Warning: unable to identify line terminator usag\
276
+ e in pattern.
277
+ The problem is in the <${t.name}> Token Type
278
+ Root cause: ${e.errMsg}.
279
+ For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR`;if(e.issue===Pt.CUSTOM_LINE_BREAK)return`Warning: A Custom Token Pattern should specify the <line_breaks> option.
280
+ The problem is in the <${t.name}> Token Type
281
+ For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK`;throw Error("non exhaustive match")}function ME(t){return ve(t,n=>In(n)?n.charCodeAt(0):n)}function vg(t,e,n){t[e]===void 0?t[e]=[n]:t[e].push(n)}const qu=256;let Cf=[];function Hi(t){return t<qu?t:Cf[t]}function N2(){if(ft(Cf)){Cf=new Array(65536);for(let t=0;t<65536;t++)Cf[t]=t>255?255+~~(t/255):t}}function ju(t,e){const n=t.tokenTypeIdx;return n===e.tokenTypeIdx?!0:e.isParent===!0&&e.categoryMatchesMap[n]===
282
+ !0}function Af(t,e){return t.tokenTypeIdx===e.tokenTypeIdx}let BE=1;const qE={};function Gu(t){const e=I2(t);O2(e),L2(e),F2(e),ke(e,n=>{n.isParent=n.categoryMatches.length>0})}function I2(t){let e=sn(t),n=t,r=!0;for(;r;){n=Fu(ar(ve(n,s=>s.CATEGORIES)));const i=yf(n,e);e=e.concat(i),ft(i)?r=!1:n=i}return e}function O2(t){ke(t,e=>{GE(e)||(qE[BE]=e,e.tokenTypeIdx=BE++),UE(e)&&!Qe(e.CATEGORIES)&&(e.CATEGORIES=[e.CATEGORIES]),UE(e)||(e.CATEGORIES=[]),M2(e)||(e.categoryMatches=[]),B2(e)||(e.categoryMatchesMap=
283
+ {})})}function F2(t){ke(t,e=>{e.categoryMatches=[],ke(e.categoryMatchesMap,(n,r)=>{e.categoryMatches.push(qE[r].tokenTypeIdx)})})}function L2(t){ke(t,e=>{jE([],e)})}function jE(t,e){ke(t,n=>{e.categoryMatchesMap[n.tokenTypeIdx]=!0}),ke(e.CATEGORIES,n=>{const r=t.concat(e);En(r,n)||jE(r,n)})}function GE(t){return Te(t,"tokenTypeIdx")}function UE(t){return Te(t,"CATEGORIES")}function M2(t){return Te(t,"categoryMatches")}function B2(t){return Te(t,"categoryMatchesMap")}function q2(t){return Te(t,"t\
284
+ okenTypeIdx")}const wg={buildUnableToPopLexerModeMessage(t){return`Unable to pop Lexer Mode after encountering Token ->${t.image}<- The Mode Stack is empty`},buildUnexpectedCharactersMessage(t,e,n,r,i){return`unexpected character: ->${t.charAt(e)}<- at offset: ${e}, skipped ${n} characters.`}};var Pt;(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.
285
+ 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=
286
+ 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"})(Pt||(Pt={}));const Uu={deferDefinitionErrorsHandling:!1,
287
+ positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:[`
288
+ `,"\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:wg,traceInitPerf:!1,skipValidations:!1,recoveryEnabled:!0};Object.freeze(Uu);class Mn{constructor(e,n=Uu){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,s)=>{if(this.traceInitPerf===!0){this.
289
+ traceInitIndent++;const o=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent<this.traceInitMaxIdent&&console.log(`${o}--> <${i}>`);const{time:a,value:u}=CE(s),c=a>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&c(`${o}<-- <${i}> time: ${a}ms`),this.traceInitIndent--,u}else return s()},typeof n=="boolean")throw Error(`The second argument to the Lexer constructor is now an ILexerConfig Object.
290
+ a boolean 2nd argument is no longer supported`);this.config=zn({},Uu,n);const r=this.config.traceInitPerf;r===!0?(this.traceInitMaxIdent=1/0,this.traceInitPerf=!0):typeof r=="number"&&(this.traceInitMaxIdent=r,this.traceInitPerf=!0),this.traceInitIndent=-1,this.TRACE_INIT("Lexer Constructor",()=>{let i,s=!0;this.TRACE_INIT("Lexer Config handling",()=>{if(this.config.lineTerminatorsPattern===Uu.lineTerminatorsPattern)this.config.lineTerminatorsPattern=P2;else if(this.config.lineTerminatorCharacters===
291
+ Uu.lineTerminatorCharacters)throw Error(`Error: Missing <lineTerminatorCharacters> property on the Lexer config.
292
+ For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#MISSING_LINE_TERM_CHARS`);if(n.safeMode&&n.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),Qe(e)?i={modes:{defaultMode:sn(e)},defaultMode:Bu}:(s=!1,i=sn(e))}),this.config.skipValidations===!1&&(this.TRACE_INIT("performRuntimeChecks",
293
+ ()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(C2(i,this.trackStartLines,this.config.lineTerminatorCharacters))}),this.TRACE_INIT("performWarningRuntimeChecks",()=>{this.lexerDefinitionWarning=this.lexerDefinitionWarning.concat(A2(i,this.trackStartLines,this.config.lineTerminatorCharacters))})),i.modes=i.modes?i.modes:{},ke(i.modes,(a,u)=>{i.modes[u]=vf(a,c=>ui(c))});const o=or(i.modes);if(ke(i.modes,(a,u)=>{this.TRACE_INIT(`Mode: <${u}> processing`,()=>{if(this.modes.push(u),
294
+ this.config.skipValidations===!1&&this.TRACE_INIT("validatePatterns",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(d2(a,o))}),ft(this.lexerDefinitionErrors)){Gu(a);let c;this.TRACE_INIT("analyzeTokenTypes",()=>{c=l2(a,{lineTerminatorCharacters:this.config.lineTerminatorCharacters,positionTracking:n.positionTracking,ensureOptimizations:n.ensureOptimizations,safeMode:n.safeMode,tracer:this.TRACE_INIT})}),this.patternIdxToConfig[u]=c.patternIdxToConfig,this.charCodeToPatternIdxToConfig[u]=
295
+ c.charCodeToPatternIdxToConfig,this.emptyGroups=zn({},this.emptyGroups,c.emptyGroups),this.hasCustom=c.hasCustom||this.hasCustom,this.canModeBeOptimized[u]=c.canBeOptimized}})}),this.defaultMode=i.defaultMode,!ft(this.lexerDefinitionErrors)&&!this.config.deferDefinitionErrorsHandling){const u=ve(this.lexerDefinitionErrors,c=>c.message).join(`-----------------------
296
+ `);throw new Error(`Errors detected in definition of Lexer:
297
+ `+u)}ke(this.lexerDefinitionWarning,a=>{TE(a.message)}),this.TRACE_INIT("Choosing sub-methods implementations",()=>{if(NE?(this.chopInput=Cs,this.match=this.matchWithTest):(this.updateLastIndex=Ht,this.match=this.matchWithExec),s&&(this.handleModes=Ht),this.trackStartLines===!1&&(this.computeNewColumn=Cs),this.trackEndLines===!1&&(this.updateTokenEndLineColumnLocation=Ht),/full/i.test(this.config.positionTracking))this.createTokenInstance=this.createFullToken;else if(/onlyStart/i.test(this.config.
298
+ 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 Optim\
299
+ ization Warnings",()=>{const a=$n(this.canModeBeOptimized,(u,c,l)=>(c===!1&&u.push(l),u),[]);if(n.ensureOptimizations&&!ft(a))throw Error(`Lexer Modes: < ${a.join(", ")} > cannot be optimized.
300
+ Disable the "ensureOptimizations" lexer config flag to silently ignore this and run the lexer in an un-optimized mode.
301
+ Or inspect the console log for details on how to resolve these issues.`)}),this.TRACE_INIT("clearRegExpParserCache",()=>{o2()}),this.TRACE_INIT("toFastProperties",()=>{AE(this)})})}tokenize(e,n=this.defaultMode){if(!ft(this.lexerDefinitionErrors)){const i=ve(this.lexerDefinitionErrors,s=>s.message).join(`-----------------------
302
+ `);throw new Error(`Unable to Tokenize because Errors detected in definition of Lexer:
303
+ `+i)}return this.tokenizeInternal(e,n)}tokenizeInternal(e,n){let r,i,s,o,a,u,c,l,f,d,p,m,v,w,y;const E=e,R=E.length;let A=0,N=0;const V=this.hasCustom?0:Math.floor(e.length/10),J=new Array(V),se=[];let ie=this.trackStartLines?1:void 0,we=this.trackStartLines?1:void 0;const B=S2(this.emptyGroups),T=this.trackStartLines,D=this.config.lineTerminatorsPattern;let M=0,S=[],P=[];const O=[],Q=[];Object.freeze(Q);let z;function C(){return S}function ne(Se){const le=Hi(Se),$e=P[le];return $e===void 0?Q:$e}
304
+ const ye=Se=>{if(O.length===1&&Se.tokenType.PUSH_MODE===void 0){const le=this.config.errorMessageProvider.buildUnableToPopLexerModeMessage(Se);se.push({offset:Se.startOffset,line:Se.startLine,column:Se.startColumn,length:Se.image.length,message:le})}else{O.pop();const le=Bo(O);S=this.patternIdxToConfig[le],P=this.charCodeToPatternIdxToConfig[le],M=S.length;const $e=this.canModeBeOptimized[le]&&this.config.safeMode===!1;P&&$e?z=ne:z=C}};function xe(Se){O.push(Se),P=this.charCodeToPatternIdxToConfig[Se],
305
+ S=this.patternIdxToConfig[Se],M=S.length,M=S.length;const le=this.canModeBeOptimized[Se]&&this.config.safeMode===!1;P&&le?z=ne:z=C}xe.call(this,n);let L;const H=this.config.recoveryEnabled;for(;A<R;){u=null;const Se=E.charCodeAt(A),le=z(Se),$e=le.length;for(r=0;r<$e;r++){L=le[r];const Ne=L.pattern;c=null;const de=L.short;if(de!==!1?Se===de&&(u=Ne):L.isCustom===!0?(y=Ne.exec(E,A,J,B),y!==null?(u=y[0],y.payload!==void 0&&(c=y.payload)):u=null):(this.updateLastIndex(Ne,A),u=this.match(Ne,e,A)),u!==
306
+ null){if(a=L.longerAlt,a!==void 0){const I=a.length;for(s=0;s<I;s++){const G=S[a[s]],pe=G.pattern;if(l=null,G.isCustom===!0?(y=pe.exec(E,A,J,B),y!==null?(o=y[0],y.payload!==void 0&&(l=y.payload)):o=null):(this.updateLastIndex(pe,A),o=this.match(pe,e,A)),o&&o.length>u.length){u=o,c=l,L=G;break}}}break}}if(u!==null){if(f=u.length,d=L.group,d!==void 0&&(p=L.tokenTypeIdx,m=this.createTokenInstance(u,A,p,L.tokenType,ie,we,f),this.handlePayload(m,c),d===!1?N=this.addToken(J,N,m):B[d].push(m)),e=this.chopInput(
307
+ e,f),A=A+f,we=this.computeNewColumn(we,f),T===!0&&L.canLineTerminator===!0){let Ne=0,de,I;D.lastIndex=0;do de=D.test(u),de===!0&&(I=D.lastIndex-1,Ne++);while(de===!0);Ne!==0&&(ie=ie+Ne,we=f-I,this.updateTokenEndLineColumnLocation(m,d,I,Ne,ie,we,f))}this.handleModes(L,ye,xe,m)}else{const Ne=A,de=ie,I=we;let G=H===!1;for(;G===!1&&A<R;)for(e=this.chopInput(e,1),A++,i=0;i<M;i++){const pe=S[i],U=pe.pattern,fe=pe.short;if(fe!==!1?E.charCodeAt(A)===fe&&(G=!0):pe.isCustom===!0?G=U.exec(E,A,J,B)!==null:(this.
308
+ updateLastIndex(U,A),G=U.exec(e)!==null),G===!0)break}if(v=A-Ne,we=this.computeNewColumn(we,v),w=this.config.errorMessageProvider.buildUnexpectedCharactersMessage(E,Ne,v,de,I),se.push({offset:Ne,line:de,column:I,length:v,message:w}),H===!1)break}}return this.hasCustom||(J.length=N),{tokens:J,groups:B,errors:se}}handleModes(e,n,r,i){if(e.pop===!0){const s=e.push;n(i),s!==void 0&&r.call(this,s)}else e.push!==void 0&&r.call(this,e.push)}chopInput(e,n){return e.substring(n)}updateLastIndex(e,n){e.lastIndex=
309
+ n}updateTokenEndLineColumnLocation(e,n,r,i,s,o,a){let u,c;n!==void 0&&(u=r===a-1,c=u?-1:0,i===1&&u===!0||(e.endLine=s+c,e.endColumn=o-1+-c))}computeNewColumn(e,n){return e+n}createOffsetOnlyToken(e,n,r,i){return{image:e,startOffset:n,tokenTypeIdx:r,tokenType:i}}createStartOnlyToken(e,n,r,i,s,o){return{image:e,startOffset:n,startLine:s,startColumn:o,tokenTypeIdx:r,tokenType:i}}createFullToken(e,n,r,i,s,o,a){return{image:e,startOffset:n,endOffset:n+a-1,startLine:s,endLine:s,startColumn:o,endColumn:o+
310
+ a-1,tokenTypeIdx:r,tokenType:i}}addTokenUsingPush(e,n,r){return e.push(r),n}addTokenUsingMemberAccess(e,n,r){return e[n]=r,n++,n}handlePayloadNoCustom(e,n){}handlePayloadWithCustom(e,n){n!==null&&(e.payload=n)}matchWithTest(e,n,r){return e.test(n)===!0?n.substring(r,e.lastIndex):null}matchWithExec(e,n){const r=e.exec(n);return r!==null?r[0]:null}}Mn.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 \
311
+ to for example to completely ignore whitespace.",Mn.NA=/NOT_APPLICABLE/;function Uo(t){return WE(t)?t.LABEL:t.name}function WE(t){return In(t.LABEL)&&t.LABEL!==""}const j2="parent",zE="categories",HE="label",KE="group",VE="push_mode",XE="pop_mode",YE="longer_alt",JE="line_breaks",QE="start_chars_hint";function ZE(t){return G2(t)}function G2(t){const e=t.pattern,n={};if(n.name=t.name,ui(e)||(n.PATTERN=e),Te(t,j2))throw`The parent property is no longer supported.
312
+ See: https://github.com/chevrotain/chevrotain/issues/564#issuecomment-349062346 for details.`;return Te(t,zE)&&(n.CATEGORIES=t[zE]),Gu([n]),Te(t,HE)&&(n.LABEL=t[HE]),Te(t,KE)&&(n.GROUP=t[KE]),Te(t,XE)&&(n.POP_MODE=t[XE]),Te(t,VE)&&(n.PUSH_MODE=t[VE]),Te(t,YE)&&(n.LONGER_ALT=t[YE]),Te(t,JE)&&(n.LINE_BREAKS=t[JE]),Te(t,QE)&&(n.START_CHARS_HINT=t[QE]),n}const Ki=ZE({name:"EOF",pattern:Mn.NA});Gu([Ki]);function bg(t,e,n,r,i,s,o,a){return{image:e,startOffset:n,endOffset:r,startLine:i,endLine:s,startColumn:o,
313
+ endColumn:a,tokenTypeIdx:t.tokenTypeIdx,tokenType:t}}function e$(t,e){return ju(t,e)}const Wo={buildMismatchTokenMessage({expected:t,actual:e,previous:n,ruleName:r}){return`Expecting ${WE(t)?`--> ${Uo(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:n,customUserDescription:r,ruleName:i}){
314
+ const s="Expecting: ",a=`
315
+ but found: '`+Er(e).image+"'";if(r)return s+r+a;{const u=$n(t,(d,p)=>d.concat(p),[]),c=ve(u,d=>`[${ve(d,p=>Uo(p)).join(", ")}]`),f=`one of these possible Token sequences:
316
+ ${ve(c,(d,p)=>` ${p+1}. ${d}`).join(`
317
+ `)}`;return s+f+a}},buildEarlyExitMessage({expectedIterationPaths:t,actual:e,customUserDescription:n,ruleName:r}){const i="Expecting: ",o=`
318
+ but found: '`+Er(e).image+"'";if(n)return i+n+o;{const u=`expecting at least one iteration which starts with one of these possible Token sequences::
319
+ <${ve(t,c=>`[${ve(c,l=>Uo(l)).join(",")}]`).join(" ,")}>`;return i+u+o}}};Object.freeze(Wo);const U2={buildRuleNotFoundError(t,e){return"Invalid grammar, reference to a rule which is not defined: ->"+e.nonTerminalName+`<-
320
+ inside top level rule: ->`+t.name+"<-"}},Ns={buildDuplicateFoundError(t,e){function n(l){return l instanceof Et?l.terminalType.name:l instanceof Dn?l.nonTerminalName:""}const r=t.name,i=Er(e),s=i.idx,o=Wr(i),a=n(i),u=s>0;let c=`->${o}${u?s:""}<- ${a?`with argument: ->${a}<-`:""}
321
+ appears more than once (${e.length} times) in the top level rule: ->${r}<-.
322
+ For further details see: https://chevrotain.io/docs/FAQ.html#NUMERICAL_SUFFIXES
323
+ `;return c=c.replace(/[ \t]+/g," "),c=c.replace(/\s\s+/g,`
324
+ `),c},buildNamespaceConflictError(t){return`Namespace conflict found in grammar.
325
+ The grammar has both a Terminal(Token) and a Non-Terminal(Rule) named: <${t.name}>.
326
+ To resolve this make sure each Terminal and Non-Terminal names are unique
327
+ This is easy to accomplish by using the convention that Terminal names start with an uppercase letter
328
+ and Non-Terminal names start with a lower case letter.`},buildAlternationPrefixAmbiguityError(t){const e=ve(t.prefixPath,i=>Uo(i)).join(", "),n=t.alternation.idx===0?"":t.alternation.idx;return`Ambiguous alternatives: <${t.ambiguityIndices.join(" ,")}> due to common lookahead prefix
329
+ in <OR${n}> inside <${t.topLevelRule.name}> Rule,
330
+ <${e}> may appears as a prefix path in all these alternatives.
331
+ See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#COMMON_PREFIX
332
+ For Further details.`},buildAlternationAmbiguityError(t){const e=ve(t.prefixPath,i=>Uo(i)).join(", "),n=t.alternation.idx===0?"":t.alternation.idx;let r=`Ambiguous Alternatives Detected: <${t.ambiguityIndices.join(" ,")}> in <OR${n}> inside <${t.topLevelRule.name}> Rule,
333
+ <${e}> may appears as a prefix path in all these alternatives.
334
+ `;return r=r+`See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES
335
+ For Further details.`,r},buildEmptyRepetitionError(t){let e=Wr(t.repetition);return t.repetition.idx!==0&&(e+=t.repetition.idx),`The repetition <${e}> within Rule <${t.topLevelRule.name}> can never consume any tokens.
336
+ 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.
337
+ Only the last alternative may be an empty alternative.`},buildTooManyAlternativesError(t){return`An Alternation cannot have more than 256 alternatives:
338
+ <OR${t.alternation.idx}> inside <${t.topLevelRule.name}> Rule.
339
+ has ${t.alternation.definition.length+1} alternatives.`},buildLeftRecursionError(t){const e=t.topLevelRule.name,n=ve(t.leftRecursionPath,s=>s.name),r=`${e} --> ${n.concat([e]).join(" --> ")}`;return`Left Recursion found in grammar.
340
+ rule: <${e}> can be invoked from itself (directly or indirectly)
341
+ without consuming any Tokens. The grammar path that causes this is:
342
+ ${r}
343
+ To fix this refactor your grammar to remove the left recursion.
344
+ see: https://en.wikipedia.org/wiki/LL_parser#Left_factoring.`},buildInvalidRuleNameError(t){return"deprecated"},buildDuplicateRuleNameError(t){let e;return t.topLevelRule instanceof jo?e=t.topLevelRule.name:e=t.topLevelRule,`Duplicate definition, rule: ->${e}<- is already defined in the grammar: ->${t.grammarName}<-`}};function W2(t,e){const n=new z2(t,e);return n.resolveRefs(),n.errors}class z2 extends Go{constructor(e,n){super(),this.nameToTopRule=e,this.errMsgProvider=n,this.errors=[]}resolveRefs(){
345
+ ke(Kt(this.nameToTopRule),e=>{this.currTopLevel=e,e.accept(this)})}visitNonTerminal(e){const n=this.nameToTopRule[e.nonTerminalName];if(n)e.referencedRule=n;else{const r=this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel,e);this.errors.push({message:r,type:Rn.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:e.nonTerminalName})}}}class H2 extends Ef{constructor(e,n){super(),this.topProd=e,this.path=n,this.possibleTokTypes=[],this.nextProductionName="",this.nextProductionOccurrence=
346
+ 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=sn(this.path.ruleStack).reverse(),this.occurrenceStack=sn(this.path.occurrenceStack).reverse(),this.ruleStack.pop(),this.occurrenceStack.pop(),this.updateExpectedNext(),this.walk(this.topProd),this.possibleTokTypes}walk(e,n=[]){this.found||super.walk(e,n)}walkProdRef(e,n,r){if(e.referencedRule.name===
347
+ this.nextProductionName&&e.idx===this.nextProductionOccurrence){const i=n.concat(r);this.updateExpectedNext(),this.walk(e.referencedRule,i)}}updateExpectedNext(){ft(this.ruleStack)?(this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())}}class K2 extends H2{constructor(e,n){super(e,n),this.path=n,this.nextTerminalName="",this.nextTerminalOccurrence=0,this.nextTerminalName=
348
+ this.path.lastTok.name,this.nextTerminalOccurrence=this.path.lastTokOccurrence}walkTerminal(e,n,r){if(this.isAtEndOfPath&&e.terminalType.name===this.nextTerminalName&&e.idx===this.nextTerminalOccurrence&&!this.found){const i=n.concat(r),s=new On({definition:i});this.possibleTokTypes=Mu(s),this.found=!0}}}class Sf extends Ef{constructor(e,n){super(),this.topRule=e,this.occurrence=n,this.result={token:void 0,occurrence:void 0,isEndOfRule:void 0}}startWalking(){return this.walk(this.topRule),this.result}}
349
+ class V2 extends Sf{walkMany(e,n,r){if(e.idx===this.occurrence){const i=Er(n.concat(r));this.result.isEndOfRule=i===void 0,i instanceof Et&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkMany(e,n,r)}}class t$ extends Sf{walkManySep(e,n,r){if(e.idx===this.occurrence){const i=Er(n.concat(r));this.result.isEndOfRule=i===void 0,i instanceof Et&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkManySep(e,n,r)}}class X2 extends Sf{walkAtLeastOne(e,n,r){
350
+ if(e.idx===this.occurrence){const i=Er(n.concat(r));this.result.isEndOfRule=i===void 0,i instanceof Et&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOne(e,n,r)}}class n$ extends Sf{walkAtLeastOneSep(e,n,r){if(e.idx===this.occurrence){const i=Er(n.concat(r));this.result.isEndOfRule=i===void 0,i instanceof Et&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOneSep(e,n,r)}}function Eg(t,e,n=[]){n=sn(n);let r=[],i=0;function s(a){
351
+ return a.concat(on(t,i+1))}function o(a){const u=Eg(s(a),e,n);return r.concat(u)}for(;n.length<e&&i<t.length;){const a=t[i];if(a instanceof On)return o(a.definition);if(a instanceof Dn)return o(a.definition);if(a instanceof an)r=o(a.definition);else if(a instanceof Vn){const u=a.definition.concat([new _t({definition:a.definition})]);return o(u)}else if(a instanceof Xn){const u=[new On({definition:a.definition}),new _t({definition:[new Et({terminalType:a.separator})].concat(a.definition)})];return o(
352
+ u)}else if(a instanceof Fn){const u=a.definition.concat([new _t({definition:[new Et({terminalType:a.separator})].concat(a.definition)})]);r=o(u)}else if(a instanceof _t){const u=a.definition.concat([new _t({definition:a.definition})]);r=o(u)}else{if(a instanceof Ln)return ke(a.definition,u=>{ft(u.definition)===!1&&(r=o(u.definition))}),r;if(a instanceof Et)n.push(a.terminalType);else throw Error("non exhaustive match")}i++}return r.push({partialPath:n,suffixDef:on(t,i)}),r}function r$(t,e,n,r){const i="\
353
+ EXIT_NONE_TERMINAL",s=[i],o="EXIT_ALTERNATIVE";let a=!1;const u=e.length,c=u-r-1,l=[],f=[];for(f.push({idx:-1,def:t,ruleStack:[],occurrenceStack:[]});!ft(f);){const d=f.pop();if(d===o){a&&Bo(f).idx<=c&&f.pop();continue}const p=d.def,m=d.idx,v=d.ruleStack,w=d.occurrenceStack;if(ft(p))continue;const y=p[0];if(y===i){const E={idx:m,def:on(p),ruleStack:Lu(v),occurrenceStack:Lu(w)};f.push(E)}else if(y instanceof Et)if(m<u-1){const E=m+1,R=e[E];if(n(R,y.terminalType)){const A={idx:E,def:on(p),ruleStack:v,
354
+ occurrenceStack:w};f.push(A)}}else if(m===u-1)l.push({nextTokenType:y.terminalType,nextTokenOccurrence:y.idx,ruleStack:v,occurrenceStack:w}),a=!0;else throw Error("non exhaustive match");else if(y instanceof Dn){const E=sn(v);E.push(y.nonTerminalName);const R=sn(w);R.push(y.idx);const A={idx:m,def:y.definition.concat(s,on(p)),ruleStack:E,occurrenceStack:R};f.push(A)}else if(y instanceof an){const E={idx:m,def:on(p),ruleStack:v,occurrenceStack:w};f.push(E),f.push(o);const R={idx:m,def:y.definition.
355
+ concat(on(p)),ruleStack:v,occurrenceStack:w};f.push(R)}else if(y instanceof Vn){const E=new _t({definition:y.definition,idx:y.idx}),R=y.definition.concat([E],on(p)),A={idx:m,def:R,ruleStack:v,occurrenceStack:w};f.push(A)}else if(y instanceof Xn){const E=new Et({terminalType:y.separator}),R=new _t({definition:[E].concat(y.definition),idx:y.idx}),A=y.definition.concat([R],on(p)),N={idx:m,def:A,ruleStack:v,occurrenceStack:w};f.push(N)}else if(y instanceof Fn){const E={idx:m,def:on(p),ruleStack:v,occurrenceStack:w};
356
+ f.push(E),f.push(o);const R=new Et({terminalType:y.separator}),A=new _t({definition:[R].concat(y.definition),idx:y.idx}),N=y.definition.concat([A],on(p)),V={idx:m,def:N,ruleStack:v,occurrenceStack:w};f.push(V)}else if(y instanceof _t){const E={idx:m,def:on(p),ruleStack:v,occurrenceStack:w};f.push(E),f.push(o);const R=new _t({definition:y.definition,idx:y.idx}),A=y.definition.concat([R],on(p)),N={idx:m,def:A,ruleStack:v,occurrenceStack:w};f.push(N)}else if(y instanceof Ln)for(let E=y.definition.length-
357
+ 1;E>=0;E--){const R=y.definition[E],A={idx:m,def:R.definition.concat(on(p)),ruleStack:v,occurrenceStack:w};f.push(A),f.push(o)}else if(y instanceof On)f.push({idx:m,def:y.definition.concat(on(p)),ruleStack:v,occurrenceStack:w});else if(y instanceof jo)f.push(Y2(y,m,v,w));else throw Error("non exhaustive match")}return l}function Y2(t,e,n,r){const i=sn(n);i.push(t.name);const s=sn(r);return s.push(1),{idx:e,def:t.definition,ruleStack:i,occurrenceStack:s}}var Tt;(function(t){t[t.OPTION=0]="OPTION",
358
+ 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"})(Tt||(Tt={}));function $g(t){if(t instanceof an||t==="Option")return Tt.OPTION;if(t instanceof _t||t==="Repetition")return Tt.REPETITION;if(t instanceof Vn||t==="RepetitionMandatory")return Tt.REPETITION_MANDATORY;if(t instanceof Xn||t==="Rep\
359
+ etitionMandatoryWithSeparator")return Tt.REPETITION_MANDATORY_WITH_SEPARATOR;if(t instanceof Fn||t==="RepetitionWithSeparator")return Tt.REPETITION_WITH_SEPARATOR;if(t instanceof Ln||t==="Alternation")return Tt.ALTERNATION;throw Error("non exhaustive match")}function i$(t){const{occurrence:e,rule:n,prodType:r,maxLookahead:i}=t,s=$g(r);return s===Tt.ALTERNATION?_f(e,n,i):Pf(e,n,s,i)}function J2(t,e,n,r,i,s){const o=_f(t,e,n),a=u$(o)?Af:ju;return s(o,r,a,i)}function Q2(t,e,n,r,i,s){const o=Pf(t,e,
360
+ i,n),a=u$(o)?Af:ju;return s(o[0],a,r)}function Z2(t,e,n,r){const i=t.length,s=br(t,o=>br(o,a=>a.length===1));if(e)return function(o){const a=ve(o,u=>u.GATE);for(let u=0;u<i;u++){const c=t[u],l=c.length,f=a[u];if(!(f!==void 0&&f.call(this)===!1))e:for(let d=0;d<l;d++){const p=c[d],m=p.length;for(let v=0;v<m;v++){const w=this.LA(v+1);if(n(w,p[v])===!1)continue e}return u}}};if(s&&!r){const o=ve(t,u=>ar(u)),a=$n(o,(u,c,l)=>(ke(c,f=>{Te(u,f.tokenTypeIdx)||(u[f.tokenTypeIdx]=l),ke(f.categoryMatches,d=>{
361
+ Te(u,d)||(u[d]=l)})}),u),{});return function(){const u=this.LA(1);return a[u.tokenTypeIdx]}}else return function(){for(let o=0;o<i;o++){const a=t[o],u=a.length;e:for(let c=0;c<u;c++){const l=a[c],f=l.length;for(let d=0;d<f;d++){const p=this.LA(d+1);if(n(p,l[d])===!1)continue e}return o}}}}function eB(t,e,n){const r=br(t,s=>s.length===1),i=t.length;if(r&&!n){const s=ar(t);if(s.length===1&&ft(s[0].categoryMatches)){const a=s[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===a}}else{
362
+ const o=$n(s,(a,u,c)=>(a[u.tokenTypeIdx]=!0,ke(u.categoryMatches,l=>{a[l]=!0}),a),[]);return function(){const a=this.LA(1);return o[a.tokenTypeIdx]===!0}}}else return function(){e:for(let s=0;s<i;s++){const o=t[s],a=o.length;for(let u=0;u<a;u++){const c=this.LA(u+1);if(e(c,o[u])===!1)continue e}return!0}return!1}}class tB extends Ef{constructor(e,n,r){super(),this.topProd=e,this.targetOccurrence=n,this.targetProdType=r}startWalking(){return this.walk(this.topProd),this.restDef}checkIsTarget(e,n,r,i){
363
+ return e.idx===this.targetOccurrence&&this.targetProdType===n?(this.restDef=r.concat(i),!0):!1}walkOption(e,n,r){this.checkIsTarget(e,Tt.OPTION,n,r)||super.walkOption(e,n,r)}walkAtLeastOne(e,n,r){this.checkIsTarget(e,Tt.REPETITION_MANDATORY,n,r)||super.walkOption(e,n,r)}walkAtLeastOneSep(e,n,r){this.checkIsTarget(e,Tt.REPETITION_MANDATORY_WITH_SEPARATOR,n,r)||super.walkOption(e,n,r)}walkMany(e,n,r){this.checkIsTarget(e,Tt.REPETITION,n,r)||super.walkOption(e,n,r)}walkManySep(e,n,r){this.checkIsTarget(
364
+ e,Tt.REPETITION_WITH_SEPARATOR,n,r)||super.walkOption(e,n,r)}}class s$ extends Go{constructor(e,n,r){super(),this.targetOccurrence=e,this.targetProdType=n,this.targetRef=r,this.result=[]}checkIsTarget(e,n){e.idx===this.targetOccurrence&&this.targetProdType===n&&(this.targetRef===void 0||e===this.targetRef)&&(this.result=e.definition)}visitOption(e){this.checkIsTarget(e,Tt.OPTION)}visitRepetition(e){this.checkIsTarget(e,Tt.REPETITION)}visitRepetitionMandatory(e){this.checkIsTarget(e,Tt.REPETITION_MANDATORY)}visitRepetitionMandatoryWithSeparator(e){
365
+ this.checkIsTarget(e,Tt.REPETITION_MANDATORY_WITH_SEPARATOR)}visitRepetitionWithSeparator(e){this.checkIsTarget(e,Tt.REPETITION_WITH_SEPARATOR)}visitAlternation(e){this.checkIsTarget(e,Tt.ALTERNATION)}}function o$(t){const e=new Array(t);for(let n=0;n<t;n++)e[n]=[];return e}function Dg(t){let e=[""];for(let n=0;n<t.length;n++){const r=t[n],i=[];for(let s=0;s<e.length;s++){const o=e[s];i.push(o+"_"+r.tokenTypeIdx);for(let a=0;a<r.categoryMatches.length;a++){const u="_"+r.categoryMatches[a];i.push(
366
+ o+u)}}e=i}return e}function nB(t,e,n){for(let r=0;r<t.length;r++){if(r===n)continue;const i=t[r];for(let s=0;s<e.length;s++){const o=e[s];if(i[o]===!0)return!1}}return!0}function a$(t,e){const n=ve(t,o=>Eg([o],1)),r=o$(n.length),i=ve(n,o=>{const a={};return ke(o,u=>{const c=Dg(u.partialPath);ke(c,l=>{a[l]=!0})}),a});let s=n;for(let o=1;o<=e;o++){const a=s;s=o$(a.length);for(let u=0;u<a.length;u++){const c=a[u];for(let l=0;l<c.length;l++){const f=c[l].partialPath,d=c[l].suffixDef,p=Dg(f);if(nB(i,
367
+ p,u)||ft(d)||f.length===e){const v=r[u];if(Rg(v,f)===!1){v.push(f);for(let w=0;w<p.length;w++){const y=p[w];i[u][y]=!0}}}else{const v=Eg(d,o+1,f);s[u]=s[u].concat(v),ke(v,w=>{const y=Dg(w.partialPath);ke(y,E=>{i[u][E]=!0})})}}}}return r}function _f(t,e,n,r){const i=new s$(t,Tt.ALTERNATION,r);return e.accept(i),a$(i.result,n)}function Pf(t,e,n,r){const i=new s$(t,n);e.accept(i);const s=i.result,a=new tB(e,t,n).startWalking(),u=new On({definition:s}),c=new On({definition:a});return a$([u,c],r)}function Rg(t,e){
368
+ e:for(let n=0;n<t.length;n++){const r=t[n];if(r.length===e.length){for(let i=0;i<r.length;i++){const s=e[i],o=r[i];if((s===o||o.categoryMatchesMap[s.tokenTypeIdx]!==void 0)===!1)continue e}return!0}}return!1}function rB(t,e){return t.length<e.length&&br(t,(n,r)=>{const i=e[r];return n===i||i.categoryMatchesMap[n.tokenTypeIdx]})}function u$(t){return br(t,e=>br(e,n=>br(n,r=>ft(r.categoryMatches))))}function iB(t){const e=t.lookaheadStrategy.validate({rules:t.rules,tokenTypes:t.tokenTypes,grammarName:t.
369
+ grammarName});return ve(e,n=>Object.assign({type:Rn.CUSTOM_LOOKAHEAD_VALIDATION},n))}function sB(t,e,n,r){const i=Kn(t,u=>oB(u,n)),s=vB(t,e,n),o=Kn(t,u=>hB(u,n)),a=Kn(t,u=>cB(u,t,r,n));return i.concat(s,o,a)}function oB(t,e){const n=new uB;t.accept(n);const r=n.allProductions,i=$M(r,aB),s=$r(i,a=>a.length>1);return ve(Kt(s),a=>{const u=Er(a),c=e.buildDuplicateFoundError(t,a),l=Wr(u),f={message:c,type:Rn.DUPLICATE_PRODUCTIONS,ruleName:t.name,dslName:l,occurrence:u.idx},d=c$(u);return d&&(f.parameter=
370
+ d),f})}function aB(t){return`${Wr(t)}_#_${t.idx}_#_${c$(t)}`}function c$(t){return t instanceof Et?t.terminalType.name:t instanceof Dn?t.nonTerminalName:""}class uB extends Go{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.
371
+ push(e)}visitRepetition(e){this.allProductions.push(e)}visitAlternation(e){this.allProductions.push(e)}visitTerminal(e){this.allProductions.push(e)}}function cB(t,e,n,r){const i=[];if($n(e,(o,a)=>a.name===t.name?o+1:o,0)>1){const o=r.buildDuplicateRuleNameError({topLevelRule:t,grammarName:n});i.push({message:o,type:Rn.DUPLICATE_RULE_NAME,ruleName:t.name})}return i}function lB(t,e,n){const r=[];let i;return En(e,t)||(i=`Invalid rule override, rule: ->${t}<- cannot be overridden in the grammar: ->${n}\
372
+ <-as it is not defined in any of the super grammars `,r.push({message:i,type:Rn.INVALID_RULE_OVERRIDE,ruleName:t})),r}function l$(t,e,n,r=[]){const i=[],s=xf(e.definition);if(ft(s))return[];{const o=t.name;En(s,t)&&i.push({message:n.buildLeftRecursionError({topLevelRule:t,leftRecursionPath:r}),type:Rn.LEFT_RECURSION,ruleName:o});const u=yf(s,r.concat([t])),c=Kn(u,l=>{const f=sn(r);return f.push(l),l$(t,l,n,f)});return i.concat(c)}}function xf(t){let e=[];if(ft(t))return e;const n=Er(t);if(n instanceof
373
+ Dn)e.push(n.referencedRule);else if(n instanceof On||n instanceof an||n instanceof Vn||n instanceof Xn||n instanceof Fn||n instanceof _t)e=e.concat(xf(n.definition));else if(n instanceof Ln)e=ar(ve(n.definition,s=>xf(s.definition)));else if(!(n instanceof Et))throw Error("non exhaustive match");const r=bf(n),i=t.length>1;if(r&&i){const s=on(t);return e.concat(xf(s))}else return e}class kg extends Go{constructor(){super(...arguments),this.alternations=[]}visitAlternation(e){this.alternations.push(
374
+ e)}}function dB(t,e){const n=new kg;t.accept(n);const r=n.alternations;return Kn(r,s=>{const o=Lu(s.definition);return Kn(o,(a,u)=>{const c=r$([a],[],ju,1);return ft(c)?[{message:e.buildEmptyAlternationError({topLevelRule:t,alternation:s,emptyChoiceIdx:u}),type:Rn.NONE_LAST_EMPTY_ALT,ruleName:t.name,occurrence:s.idx,alternative:u+1}]:[]})})}function fB(t,e,n){const r=new kg;t.accept(r);let i=r.alternations;return i=vf(i,o=>o.ignoreAmbiguities===!0),Kn(i,o=>{const a=o.idx,u=o.maxLookahead||e,c=_f(
375
+ a,t,u,o),l=gB(c,o,t,n),f=yB(c,o,t,n);return l.concat(f)})}class pB extends Go{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 hB(t,e){const n=new kg;t.accept(n);const r=n.alternations;return Kn(r,s=>s.definition.length>255?[{message:e.buildTooManyAlternativesError(
376
+ {topLevelRule:t,alternation:s}),type:Rn.TOO_MANY_ALTS,ruleName:t.name,occurrence:s.idx}]:[])}function mB(t,e,n){const r=[];return ke(t,i=>{const s=new pB;i.accept(s);const o=s.allProductions;ke(o,a=>{const u=$g(a),c=a.maxLookahead||e,l=a.idx,d=Pf(l,i,u,c)[0];if(ft(ar(d))){const p=n.buildEmptyRepetitionError({topLevelRule:i,repetition:a});r.push({message:p,type:Rn.NO_NON_EMPTY_LOOKAHEAD,ruleName:i.name})}})}),r}function gB(t,e,n,r){const i=[],s=$n(t,(a,u,c)=>(e.definition[c].ignoreAmbiguities===!0||
377
+ ke(u,l=>{const f=[c];ke(t,(d,p)=>{c!==p&&Rg(d,l)&&e.definition[p].ignoreAmbiguities!==!0&&f.push(p)}),f.length>1&&!Rg(i,l)&&(i.push(l),a.push({alts:f,path:l}))}),a),[]);return ve(s,a=>{const u=ve(a.alts,l=>l+1);return{message:r.buildAlternationAmbiguityError({topLevelRule:n,alternation:e,ambiguityIndices:u,prefixPath:a.path}),type:Rn.AMBIGUOUS_ALTS,ruleName:n.name,occurrence:e.idx,alternatives:a.alts}})}function yB(t,e,n,r){const i=$n(t,(o,a,u)=>{const c=ve(a,l=>({idx:u,path:l}));return o.concat(
378
+ c)},[]);return Fu(Kn(i,o=>{if(e.definition[o.idx].ignoreAmbiguities===!0)return[];const u=o.idx,c=o.path,l=Hn(i,d=>e.definition[d.idx].ignoreAmbiguities!==!0&&d.idx<u&&rB(d.path,c));return ve(l,d=>{const p=[d.idx+1,u+1],m=e.idx===0?"":e.idx;return{message:r.buildAlternationPrefixAmbiguityError({topLevelRule:n,alternation:e,ambiguityIndices:p,prefixPath:d.path}),type:Rn.AMBIGUOUS_PREFIX_ALTS,ruleName:n.name,occurrence:m,alternatives:p}})}))}function vB(t,e,n){const r=[],i=ve(e,s=>s.name);return ke(
379
+ t,s=>{const o=s.name;if(En(i,o)){const a=n.buildNamespaceConflictError(s);r.push({message:a,type:Rn.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:o})}}),r}function wB(t){const e=fg(t,{errMsgProvider:U2}),n={};return ke(t.rules,r=>{n[r.name]=r}),W2(n,e.errMsgProvider)}function bB(t){return t=fg(t,{errMsgProvider:Ns}),sB(t.rules,t.tokenTypes,t.errMsgProvider,t.grammarName)}const d$="MismatchedTokenException",f$="NoViableAltException",p$="EarlyExitException",h$="NotAllInputParsedException",m$=[d$,f$,p$,
380
+ h$];Object.freeze(m$);function Nf(t){return En(m$,t.name)}class If extends Error{constructor(e,n){super(e),this.token=n,this.resyncedTokens=[],Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}class g$ extends If{constructor(e,n,r){super(e,n),this.previousToken=r,this.name=d$}}class EB extends If{constructor(e,n,r){super(e,n),this.previousToken=r,this.name=f$}}class $B extends If{constructor(e,n){super(e,n),this.name=h$}}class DB extends If{constructor(e,n,r){
381
+ super(e,n),this.previousToken=r,this.name=p$}}const Tg={},y$="InRuleRecoveryException";class RB extends Error{constructor(e){super(e),this.name=y$}}class kB{initRecoverable(e){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=Te(e,"recoveryEnabled")?e.recoveryEnabled:ci.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=TB)}getTokenToInsert(e){const n=bg(e,"",NaN,NaN,NaN,NaN,NaN,NaN);return n.isInsertedInRecovery=!0,n}canTokenTypeBeInsertedInRecovery(e){return!0}canTokenTypeBeDeletedInRecovery(e){
382
+ return!0}tryInRepetitionRecovery(e,n,r,i){const s=this.findReSyncTokenType(),o=this.exportLexerState(),a=[];let u=!1;const c=this.LA(1);let l=this.LA(1);const f=()=>{const d=this.LA(0),p=this.errorMessageProvider.buildMismatchTokenMessage({expected:i,actual:c,previous:d,ruleName:this.getCurrRuleFullName()}),m=new g$(p,c,this.LA(0));m.resyncedTokens=Lu(a),this.SAVE_ERROR(m)};for(;!u;)if(this.tokenMatcher(l,i)){f();return}else if(r.call(this)){f(),e.apply(this,n);return}else this.tokenMatcher(l,s)?
383
+ u=!0:(l=this.SKIP_TOKEN(),this.addToResyncTokens(l,a));this.importLexerState(o)}shouldInRepetitionRecoveryBeTried(e,n,r){return!(r===!1||this.tokenMatcher(this.LA(1),e)||this.isBackTracking()||this.canPerformInRuleRecovery(e,this.getFollowsForInRuleRecovery(e,n)))}getFollowsForInRuleRecovery(e,n){const r=this.getCurrentGrammarPath(e,n);return this.getNextPossibleTokenTypes(r)}tryInRuleRecovery(e,n){if(this.canRecoverWithSingleTokenInsertion(e,n))return this.getTokenToInsert(e);if(this.canRecoverWithSingleTokenDeletion(
384
+ e)){const r=this.SKIP_TOKEN();return this.consumeToken(),r}throw new RB("sad sad panda")}canPerformInRuleRecovery(e,n){return this.canRecoverWithSingleTokenInsertion(e,n)||this.canRecoverWithSingleTokenDeletion(e)}canRecoverWithSingleTokenInsertion(e,n){if(!this.canTokenTypeBeInsertedInRecovery(e)||ft(n))return!1;const r=this.LA(1);return qo(n,s=>this.tokenMatcher(r,s))!==void 0}canRecoverWithSingleTokenDeletion(e){return this.canTokenTypeBeDeletedInRecovery(e)?this.tokenMatcher(this.LA(2),e):!1}isInCurrentRuleReSyncSet(e){
385
+ const n=this.getCurrFollowKey(),r=this.getFollowSetFromFollowKey(n);return En(r,e)}findReSyncTokenType(){const e=this.flattenFollowSet();let n=this.LA(1),r=2;for(;;){const i=qo(e,s=>e$(n,s));if(i!==void 0)return i;n=this.LA(r),r++}}getCurrFollowKey(){if(this.RULE_STACK.length===1)return Tg;const e=this.getLastExplicitRuleShortName(),n=this.getLastExplicitRuleOccurrenceIndex(),r=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(e),idxInCallingRule:n,inRule:this.
386
+ shortRuleNameToFullName(r)}}buildFullFollowKeyStack(){const e=this.RULE_STACK,n=this.RULE_OCCURRENCE_STACK;return ve(e,(r,i)=>i===0?Tg:{ruleName:this.shortRuleNameToFullName(r),idxInCallingRule:n[i],inRule:this.shortRuleNameToFullName(e[i-1])})}flattenFollowSet(){const e=ve(this.buildFullFollowKeyStack(),n=>this.getFollowSetFromFollowKey(n));return ar(e)}getFollowSetFromFollowKey(e){if(e===Tg)return[Ki];const n=e.ruleName+e.idxInCallingRule+_E+e.inRule;return this.resyncFollows[n]}addToResyncTokens(e,n){
387
+ return this.tokenMatcher(e,Ki)||n.push(e),n}reSyncTo(e){const n=[];let r=this.LA(1);for(;this.tokenMatcher(r,e)===!1;)r=this.SKIP_TOKEN(),this.addToResyncTokens(r,n);return Lu(n)}attemptInRepetitionRecovery(e,n,r,i,s,o,a){}getCurrentGrammarPath(e,n){const r=this.getHumanReadableRuleStack(),i=sn(this.RULE_OCCURRENCE_STACK);return{ruleStack:r,occurrenceStack:i,lastTok:e,lastTokOccurrence:n}}getHumanReadableRuleStack(){return ve(this.RULE_STACK,e=>this.shortRuleNameToFullName(e))}}function TB(t,e,n,r,i,s,o){
388
+ const a=this.getKeyForAutomaticLookahead(r,i);let u=this.firstAfterRepMap[a];if(u===void 0){const d=this.getCurrRuleFullName(),p=this.getGAstProductions()[d];u=new s(p,i).startWalking(),this.firstAfterRepMap[a]=u}let c=u.token,l=u.occurrence;const f=u.isEndOfRule;this.RULE_STACK.length===1&&f&&c===void 0&&(c=Ki,l=1),!(c===void 0||l===void 0)&&this.shouldInRepetitionRecoveryBeTried(c,l,o)&&this.tryInRepetitionRecovery(t,e,n,c)}const CB=4,Vi=8,v$=1<<Vi,w$=2<<Vi,Cg=3<<Vi,Ag=4<<Vi,Sg=5<<Vi,Of=6<<Vi;
389
+ function _g(t,e,n){return n|e|t}class Pg{constructor(e){var n;this.maxLookahead=(n=e?.maxLookahead)!==null&&n!==void 0?n:ci.maxLookahead}validate(e){const n=this.validateNoLeftRecursion(e.rules);if(ft(n)){const r=this.validateEmptyOrAlternatives(e.rules),i=this.validateAmbiguousAlternationAlternatives(e.rules,this.maxLookahead),s=this.validateSomeNonEmptyLookaheadPath(e.rules,this.maxLookahead);return[...n,...r,...i,...s]}return n}validateNoLeftRecursion(e){return Kn(e,n=>l$(n,n,Ns))}validateEmptyOrAlternatives(e){
390
+ return Kn(e,n=>dB(n,Ns))}validateAmbiguousAlternationAlternatives(e,n){return Kn(e,r=>fB(r,n,Ns))}validateSomeNonEmptyLookaheadPath(e,n){return mB(e,n,Ns)}buildLookaheadForAlternation(e){return J2(e.prodOccurrence,e.rule,e.maxLookahead,e.hasPredicates,e.dynamicTokensEnabled,Z2)}buildLookaheadForOptional(e){return Q2(e.prodOccurrence,e.rule,e.maxLookahead,e.dynamicTokensEnabled,$g(e.prodType),eB)}}class AB{initLooksAhead(e){this.dynamicTokensEnabled=Te(e,"dynamicTokensEnabled")?e.dynamicTokensEnabled:
391
+ ci.dynamicTokensEnabled,this.maxLookahead=Te(e,"maxLookahead")?e.maxLookahead:ci.maxLookahead,this.lookaheadStrategy=Te(e,"lookaheadStrategy")?e.lookaheadStrategy:new Pg({maxLookahead:this.maxLookahead}),this.lookAheadFuncsCache=new Map}preComputeLookaheadFunctions(e){ke(e,n=>{this.TRACE_INIT(`${n.name} Rule Lookahead`,()=>{const{alternation:r,repetition:i,option:s,repetitionMandatory:o,repetitionMandatoryWithSeparator:a,repetitionWithSeparator:u}=_B(n);ke(r,c=>{const l=c.idx===0?"":c.idx;this.TRACE_INIT(
392
+ `${Wr(c)}${l}`,()=>{const f=this.lookaheadStrategy.buildLookaheadForAlternation({prodOccurrence:c.idx,rule:n,maxLookahead:c.maxLookahead||this.maxLookahead,hasPredicates:c.hasPredicates,dynamicTokensEnabled:this.dynamicTokensEnabled}),d=_g(this.fullRuleNameToShort[n.name],v$,c.idx);this.setLaFuncCache(d,f)})}),ke(i,c=>{this.computeLookaheadFunc(n,c.idx,Cg,"Repetition",c.maxLookahead,Wr(c))}),ke(s,c=>{this.computeLookaheadFunc(n,c.idx,w$,"Option",c.maxLookahead,Wr(c))}),ke(o,c=>{this.computeLookaheadFunc(
393
+ n,c.idx,Ag,"RepetitionMandatory",c.maxLookahead,Wr(c))}),ke(a,c=>{this.computeLookaheadFunc(n,c.idx,Of,"RepetitionMandatoryWithSeparator",c.maxLookahead,Wr(c))}),ke(u,c=>{this.computeLookaheadFunc(n,c.idx,Sg,"RepetitionWithSeparator",c.maxLookahead,Wr(c))})})})}computeLookaheadFunc(e,n,r,i,s,o){this.TRACE_INIT(`${o}${n===0?"":n}`,()=>{const a=this.lookaheadStrategy.buildLookaheadForOptional({prodOccurrence:n,rule:e,maxLookahead:s||this.maxLookahead,dynamicTokensEnabled:this.dynamicTokensEnabled,
394
+ prodType:i}),u=_g(this.fullRuleNameToShort[e.name],r,n);this.setLaFuncCache(u,a)})}getKeyForAutomaticLookahead(e,n){const r=this.getLastExplicitRuleShortName();return _g(r,e,n)}getLaFuncFromCache(e){return this.lookAheadFuncsCache.get(e)}setLaFuncCache(e,n){this.lookAheadFuncsCache.set(e,n)}}class SB extends Go{constructor(){super(...arguments),this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}reset(){this.
395
+ 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){
396
+ this.dslMethods.alternation.push(e)}}const Ff=new SB;function _B(t){Ff.reset(),t.accept(Ff);const e=Ff.dslMethods;return Ff.reset(),e}function b$(t,e){isNaN(t.startOffset)===!0?(t.startOffset=e.startOffset,t.endOffset=e.endOffset):t.endOffset<e.endOffset&&(t.endOffset=e.endOffset)}function E$(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&&
397
+ (t.endOffset=e.endOffset,t.endColumn=e.endColumn,t.endLine=e.endLine)}function PB(t,e,n){t.children[n]===void 0?t.children[n]=[e]:t.children[n].push(e)}function xB(t,e,n){t.children[e]===void 0?t.children[e]=[n]:t.children[e].push(n)}const NB="name";function $$(t,e){Object.defineProperty(t,NB,{enumerable:!1,configurable:!0,writable:!1,value:e})}function IB(t,e){const n=or(t),r=n.length;for(let i=0;i<r;i++){const s=n[i],o=t[s],a=o.length;for(let u=0;u<a;u++){const c=o[u];c.tokenTypeIdx===void 0&&
398
+ this[c.name](c.children,e)}}}function OB(t,e){const n=function(){};$$(n,t+"BaseSemantics");const r={visit:function(i,s){if(Qe(i)&&(i=i[0]),!ui(i))return this[i.name](i.children,s)},validateVisitor:function(){const i=LB(this,e);if(!ft(i)){const s=ve(i,o=>o.msg);throw Error(`Errors Detected in CST Visitor <${this.constructor.name}>:
399
+ ${s.join(`
400
+
401
+ `).replace(/\n/g,`
402
+ `)}`)}}};return n.prototype=r,n.prototype.constructor=n,n._RULE_NAMES=e,n}function FB(t,e,n){const r=function(){};$$(r,t+"BaseSemanticsWithDefaults");const i=Object.create(n.prototype);return ke(e,s=>{i[s]=IB}),r.prototype=i,r.prototype.constructor=r,r}var xg;(function(t){t[t.REDUNDANT_METHOD=0]="REDUNDANT_METHOD",t[t.MISSING_METHOD=1]="MISSING_METHOD"})(xg||(xg={}));function LB(t,e){return MB(t,e)}function MB(t,e){const n=Hn(e,i=>ii(t[i])===!1),r=ve(n,i=>({msg:`Missing visitor method: <${i}> o\
403
+ n ${t.constructor.name} CST Visitor.`,type:xg.MISSING_METHOD,methodName:i}));return Fu(r)}class BB{initTreeBuilder(e){if(this.CST_STACK=[],this.outputCst=e.outputCst,this.nodeLocationTracking=Te(e,"nodeLocationTracking")?e.nodeLocationTracking:ci.nodeLocationTracking,!this.outputCst)this.cstInvocationStateUpdate=Ht,this.cstFinallyStateUpdate=Ht,this.cstPostTerminal=Ht,this.cstPostNonTerminal=Ht,this.cstPostRule=Ht;else if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=
404
+ E$,this.setNodeLocationFromNode=E$,this.cstPostRule=Ht,this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=Ht,this.setNodeLocationFromNode=Ht,this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=b$,this.setNodeLocationFromNode=b$,this.cstPostRule=Ht,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):
405
+ (this.setNodeLocationFromToken=Ht,this.setNodeLocationFromNode=Ht,this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else if(/none/i.test(this.nodeLocationTracking))this.setNodeLocationFromToken=Ht,this.setNodeLocationFromNode=Ht,this.cstPostRule=Ht,this.setInitialNodeLocation=Ht;else throw Error(`Invalid <nodeLocationTracking> config option: "${e.nodeLocationTracking}"`)}setInitialNodeLocationOnlyOffsetRecovery(e){e.location={startOffset:NaN,
406
+ 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 n=this.LA(1);e.location={startOffset:n.startOffset,startLine:n.startLine,startColumn:n.startColumn,endOffset:NaN,endLine:NaN,endColumn:NaN}}cstInvocationStateUpdate(e){const n={name:e,children:Object.
407
+ create(null)};this.setInitialNodeLocation(n),this.CST_STACK.push(n)}cstFinallyStateUpdate(){this.CST_STACK.pop()}cstPostRuleFull(e){const n=this.LA(0),r=e.location;r.startOffset<=n.startOffset?(r.endOffset=n.endOffset,r.endLine=n.endLine,r.endColumn=n.endColumn):(r.startOffset=NaN,r.startLine=NaN,r.startColumn=NaN)}cstPostRuleOnlyOffset(e){const n=this.LA(0),r=e.location;r.startOffset<=n.startOffset?r.endOffset=n.endOffset:r.startOffset=NaN}cstPostTerminal(e,n){const r=this.CST_STACK[this.CST_STACK.
408
+ length-1];PB(r,n,e),this.setNodeLocationFromToken(r.location,n)}cstPostNonTerminal(e,n){const r=this.CST_STACK[this.CST_STACK.length-1];xB(r,n,e),this.setNodeLocationFromNode(r.location,e.location)}getBaseCstVisitorConstructor(){if(ui(this.baseCstVisitorConstructor)){const e=OB(this.className,or(this.gastProductionsCache));return this.baseCstVisitorConstructor=e,e}return this.baseCstVisitorConstructor}getBaseCstVisitorConstructorWithDefaults(){if(ui(this.baseCstVisitorWithDefaultsConstructor)){const e=FB(
409
+ this.className,or(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 qB{initLexerAdapter(){this.tokVector=[],this.tokVectorLength=
410
+ 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)):Bf}LA(e){const n=this.currIdx+e;return n<0||this.tokVectorLength<=n?Bf:this.tokVector[n]}consumeToken(){this.currIdx++}exportLexerState(){return this.currIdx}importLexerState(e){
411
+ this.currIdx=e}resetLexerState(){this.currIdx=-1}moveToTerminatedState(){this.currIdx=this.tokVector.length-1}getLexerPosition(){return this.exportLexerState()}}class jB{ACTION(e){return e.call(this)}consume(e,n,r){return this.consumeInternal(n,e,r)}subrule(e,n,r){return this.subruleInternal(n,e,r)}option(e,n){return this.optionInternal(n,e)}or(e,n){return this.orInternal(n,e)}many(e,n){return this.manyInternal(e,n)}atLeastOne(e,n){return this.atLeastOneInternal(e,n)}CONSUME(e,n){return this.consumeInternal(
412
+ e,0,n)}CONSUME1(e,n){return this.consumeInternal(e,1,n)}CONSUME2(e,n){return this.consumeInternal(e,2,n)}CONSUME3(e,n){return this.consumeInternal(e,3,n)}CONSUME4(e,n){return this.consumeInternal(e,4,n)}CONSUME5(e,n){return this.consumeInternal(e,5,n)}CONSUME6(e,n){return this.consumeInternal(e,6,n)}CONSUME7(e,n){return this.consumeInternal(e,7,n)}CONSUME8(e,n){return this.consumeInternal(e,8,n)}CONSUME9(e,n){return this.consumeInternal(e,9,n)}SUBRULE(e,n){return this.subruleInternal(e,0,n)}SUBRULE1(e,n){
413
+ return this.subruleInternal(e,1,n)}SUBRULE2(e,n){return this.subruleInternal(e,2,n)}SUBRULE3(e,n){return this.subruleInternal(e,3,n)}SUBRULE4(e,n){return this.subruleInternal(e,4,n)}SUBRULE5(e,n){return this.subruleInternal(e,5,n)}SUBRULE6(e,n){return this.subruleInternal(e,6,n)}SUBRULE7(e,n){return this.subruleInternal(e,7,n)}SUBRULE8(e,n){return this.subruleInternal(e,8,n)}SUBRULE9(e,n){return this.subruleInternal(e,9,n)}OPTION(e){return this.optionInternal(e,0)}OPTION1(e){return this.optionInternal(
414
+ 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.
415
+ 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(
416
+ 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){
417
+ 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(
418
+ 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,n,r=qf){if(En(this.definedRulesNames,
419
+ e)){const o={message:Ns.buildDuplicateRuleNameError({topLevelRule:e,grammarName:this.className}),type:Rn.DUPLICATE_RULE_NAME,ruleName:e};this.definitionErrors.push(o)}this.definedRulesNames.push(e);const i=this.defineRule(e,n,r);return this[e]=i,i}OVERRIDE_RULE(e,n,r=qf){const i=lB(e,this.definedRulesNames,this.className);this.definitionErrors=this.definitionErrors.concat(i);const s=this.defineRule(e,n,r);return this[e]=s,s}BACKTRACK(e,n){return function(){this.isBackTrackingStack.push(1);const r=this.
420
+ saveRecogState();try{return e.apply(this,n),!0}catch(i){if(Nf(i))return!1;throw i}finally{this.reloadRecogState(r),this.isBackTrackingStack.pop()}}}getGAstProductions(){return this.gastProductionsCache}getSerializedGastProductions(){return YM(Kt(this.gastProductionsCache))}}class GB{initRecognizerEngine(e,n){if(this.className=this.constructor.name,this.shortRuleNameToFull={},this.fullRuleNameToShort={},this.ruleShortNameIdx=256,this.tokenMatcher=Af,this.subruleIdx=0,this.definedRulesNames=[],this.
421
+ tokensMap={},this.isBackTrackingStack=[],this.RULE_STACK=[],this.RULE_OCCURRENCE_STACK=[],this.gastProductionsCache={},Te(n,"serializedGrammar"))throw Error(`The Parser's configuration can no longer contain a <serializedGrammar> property.
422
+ See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_6-0-0
423
+ For Further details.`);if(Qe(e)){if(ft(e))throw Error(`A Token Vocabulary cannot be empty.
424
+ Note that the first argument for the parser constructor
425
+ 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.
426
+ See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_4-0-0
427
+ For Further details.`)}if(Qe(e))this.tokensMap=$n(e,(s,o)=>(s[o.name]=o,s),{});else if(Te(e,"modes")&&br(ar(Kt(e.modes)),q2)){const s=ar(Kt(e.modes)),o=pg(s);this.tokensMap=$n(o,(a,u)=>(a[u.name]=u,a),{})}else if(sr(e))this.tokensMap=sn(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=Ki;const r=Te(e,"modes")?ar(Kt(e.modes)):Kt(e),i=br(r,s=>ft(s.categoryMatches));this.
428
+ tokenMatcher=i?Af:ju,Gu(Kt(this.tokensMap))}defineRule(e,n,r){if(this.selfAnalysisDone)throw Error(`Grammar rule <${e}> may not be defined after the 'performSelfAnalysis' method has been called'
429
+ Make sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.`);const i=Te(r,"resyncEnabled")?r.resyncEnabled:qf.resyncEnabled,s=Te(r,"recoveryValueFunc")?r.recoveryValueFunc:qf.recoveryValueFunc,o=this.ruleShortNameIdx<<CB+Vi;this.ruleShortNameIdx++,this.shortRuleNameToFull[o]=e,this.fullRuleNameToShort[e]=o;let a;return this.outputCst===!0?a=function(...l){try{this.ruleInvocationStateUpdate(o,e,this.subruleIdx),n.apply(this,l);const f=this.CST_STACK[this.CST_STACK.
430
+ length-1];return this.cstPostRule(f),f}catch(f){return this.invokeRuleCatch(f,i,s)}finally{this.ruleFinallyStateUpdate()}}:a=function(...l){try{return this.ruleInvocationStateUpdate(o,e,this.subruleIdx),n.apply(this,l)}catch(f){return this.invokeRuleCatch(f,i,s)}finally{this.ruleFinallyStateUpdate()}},Object.assign(a,{ruleName:e,originalGrammarAction:n})}invokeRuleCatch(e,n,r){const i=this.RULE_STACK.length===1,s=n&&!this.isBackTracking()&&this.recoveryEnabled;if(Nf(e)){const o=e;if(s){const a=this.
431
+ findReSyncTokenType();if(this.isInCurrentRuleReSyncSet(a))if(o.resyncedTokens=this.reSyncTo(a),this.outputCst){const u=this.CST_STACK[this.CST_STACK.length-1];return u.recoveredNode=!0,u}else return r(e);else{if(this.outputCst){const u=this.CST_STACK[this.CST_STACK.length-1];u.recoveredNode=!0,o.partialCstResult=u}throw o}}else{if(i)return this.moveToTerminatedState(),r(e);throw o}}else throw e}optionInternal(e,n){const r=this.getKeyForAutomaticLookahead(w$,n);return this.optionInternalLogic(e,n,
432
+ r)}optionInternalLogic(e,n,r){let i=this.getLaFuncFromCache(r),s;if(typeof e!="function"){s=e.DEF;const o=e.GATE;if(o!==void 0){const a=i;i=()=>o.call(this)&&a.call(this)}}else s=e;if(i.call(this)===!0)return s.call(this)}atLeastOneInternal(e,n){const r=this.getKeyForAutomaticLookahead(Ag,e);return this.atLeastOneInternalLogic(e,n,r)}atLeastOneInternalLogic(e,n,r){let i=this.getLaFuncFromCache(r),s;if(typeof n!="function"){s=n.DEF;const o=n.GATE;if(o!==void 0){const a=i;i=()=>o.call(this)&&a.call(
433
+ this)}}else s=n;if(i.call(this)===!0){let o=this.doSingleRepetition(s);for(;i.call(this)===!0&&o===!0;)o=this.doSingleRepetition(s)}else throw this.raiseEarlyExitException(e,Tt.REPETITION_MANDATORY,n.ERR_MSG);this.attemptInRepetitionRecovery(this.atLeastOneInternal,[e,n],i,Ag,e,X2)}atLeastOneSepFirstInternal(e,n){const r=this.getKeyForAutomaticLookahead(Of,e);this.atLeastOneSepFirstInternalLogic(e,n,r)}atLeastOneSepFirstInternalLogic(e,n,r){const i=n.DEF,s=n.SEP;if(this.getLaFuncFromCache(r).call(
434
+ this)===!0){i.call(this);const a=()=>this.tokenMatcher(this.LA(1),s);for(;this.tokenMatcher(this.LA(1),s)===!0;)this.CONSUME(s),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,s,a,i,n$],a,Of,e,n$)}else throw this.raiseEarlyExitException(e,Tt.REPETITION_MANDATORY_WITH_SEPARATOR,n.ERR_MSG)}manyInternal(e,n){const r=this.getKeyForAutomaticLookahead(Cg,e);return this.manyInternalLogic(e,n,r)}manyInternalLogic(e,n,r){let i=this.getLaFuncFromCache(r),s;if(typeof n!="f\
435
+ unction"){s=n.DEF;const a=n.GATE;if(a!==void 0){const u=i;i=()=>a.call(this)&&u.call(this)}}else s=n;let o=!0;for(;i.call(this)===!0&&o===!0;)o=this.doSingleRepetition(s);this.attemptInRepetitionRecovery(this.manyInternal,[e,n],i,Cg,e,V2,o)}manySepFirstInternal(e,n){const r=this.getKeyForAutomaticLookahead(Sg,e);this.manySepFirstInternalLogic(e,n,r)}manySepFirstInternalLogic(e,n,r){const i=n.DEF,s=n.SEP;if(this.getLaFuncFromCache(r).call(this)===!0){i.call(this);const a=()=>this.tokenMatcher(this.
436
+ LA(1),s);for(;this.tokenMatcher(this.LA(1),s)===!0;)this.CONSUME(s),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,s,a,i,t$],a,Sg,e,t$)}}repetitionSepSecondInternal(e,n,r,i,s){for(;r();)this.CONSUME(n),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,n,r,i,s],r,Of,e,s)}doSingleRepetition(e){const n=this.getLexerPosition();return e.call(this),this.getLexerPosition()>n}orInternal(e,n){const r=this.getKeyForAutomaticLookahead(v$,n),
437
+ i=Qe(e)?e:e.DEF,o=this.getLaFuncFromCache(r).call(this,i);if(o!==void 0)return i[o].ALT.call(this);this.raiseNoAltException(n,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),n=this.errorMessageProvider.buildNotAllInputParsedMessage({firstRedundant:e,ruleName:this.getCurrRuleFullName()});this.SAVE_ERROR(new $B(n,e))}}subruleInternal(e,n,r){let i;try{
438
+ const s=r!==void 0?r.ARGS:void 0;return this.subruleIdx=n,i=e.apply(this,s),this.cstPostNonTerminal(i,r!==void 0&&r.LABEL!==void 0?r.LABEL:e.ruleName),i}catch(s){throw this.subruleInternalError(s,r,e.ruleName)}}subruleInternalError(e,n,r){throw Nf(e)&&e.partialCstResult!==void 0&&(this.cstPostNonTerminal(e.partialCstResult,n!==void 0&&n.LABEL!==void 0?n.LABEL:r),delete e.partialCstResult),e}consumeInternal(e,n,r){let i;try{const s=this.LA(1);this.tokenMatcher(s,e)===!0?(this.consumeToken(),i=s):
439
+ this.consumeInternalError(e,s,r)}catch(s){i=this.consumeInternalRecovery(e,n,s)}return this.cstPostTerminal(r!==void 0&&r.LABEL!==void 0?r.LABEL:e.name,i),i}consumeInternalError(e,n,r){let i;const s=this.LA(0);throw r!==void 0&&r.ERR_MSG?i=r.ERR_MSG:i=this.errorMessageProvider.buildMismatchTokenMessage({expected:e,actual:n,previous:s,ruleName:this.getCurrRuleFullName()}),this.SAVE_ERROR(new g$(i,n,s))}consumeInternalRecovery(e,n,r){if(this.recoveryEnabled&&r.name==="MismatchedTokenException"&&!this.
440
+ isBackTracking()){const i=this.getFollowsForInRuleRecovery(e,n);try{return this.tryInRuleRecovery(e,i)}catch(s){throw s.name===y$?r:s}}else throw r}saveRecogState(){const e=this.errors,n=sn(this.RULE_STACK);return{errors:e,lexerState:this.exportLexerState(),RULE_STACK:n,CST_STACK:this.CST_STACK}}reloadRecogState(e){this.errors=e.errors,this.importLexerState(e.lexerState),this.RULE_STACK=e.RULE_STACK}ruleInvocationStateUpdate(e,n,r){this.RULE_OCCURRENCE_STACK.push(r),this.RULE_STACK.push(e),this.
441
+ cstInvocationStateUpdate(n)}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),Ki)}reset(){this.resetLexerState(),this.subruleIdx=0,this.isBackTrackingStack=[],this.errors=[],this.RULE_STACK=[],this.CST_STACK=[],this.RULE_OCCURRENCE_STACK=[]}}class UB{initErrorHandler(e){this.
442
+ _errors=[],this.errorMessageProvider=Te(e,"errorMessageProvider")?e.errorMessageProvider:ci.errorMessageProvider}SAVE_ERROR(e){if(Nf(e))return e.context={ruleStack:this.getHumanReadableRuleStack(),ruleOccurrenceStack:sn(this.RULE_OCCURRENCE_STACK)},this._errors.push(e),e;throw Error("Trying to save an Error which is not a RecognitionException")}get errors(){return sn(this._errors)}set errors(e){this._errors=e}raiseEarlyExitException(e,n,r){const i=this.getCurrRuleFullName(),s=this.getGAstProductions()[i],
443
+ a=Pf(e,s,n,this.maxLookahead)[0],u=[];for(let l=1;l<=this.maxLookahead;l++)u.push(this.LA(l));const c=this.errorMessageProvider.buildEarlyExitMessage({expectedIterationPaths:a,actual:u,previous:this.LA(0),customUserDescription:r,ruleName:i});throw this.SAVE_ERROR(new DB(c,this.LA(1),this.LA(0)))}raiseNoAltException(e,n){const r=this.getCurrRuleFullName(),i=this.getGAstProductions()[r],s=_f(e,i,this.maxLookahead),o=[];for(let c=1;c<=this.maxLookahead;c++)o.push(this.LA(c));const a=this.LA(0),u=this.
444
+ errorMessageProvider.buildNoViableAltMessage({expectedPathsPerAlt:s,actual:o,previous:a,customUserDescription:n,ruleName:this.getCurrRuleFullName()});throw this.SAVE_ERROR(new EB(u,this.LA(1),a))}}class WB{initContentAssist(){}computeContentAssist(e,n){const r=this.gastProductionsCache[e];if(ui(r))throw Error(`Rule ->${e}<- does not exist in this grammar.`);return r$([r],n,this.tokenMatcher,this.maxLookahead)}getNextPossibleTokenTypes(e){const n=Er(e.ruleStack),i=this.getGAstProductions()[n];return new K2(
445
+ i,e).startWalking()}}const Lf={description:"This Object indicates the Parser is during Recording Phase"};Object.freeze(Lf);const D$=!0,R$=Math.pow(2,Vi)-1,k$=ZE({name:"RECORDING_PHASE_TOKEN",pattern:Mn.NA});Gu([k$]);const T$=bg(k$,`This IToken indicates the Parser is in Recording Phase
446
+ See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,-1,-1,-1,-1,-1,-1);Object.freeze(T$);const zB={name:`This CSTNode indicates the Parser is in Recording Phase
447
+ See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,children:{}};class HB{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 n=e>0?e:"";this[`CONSUME${n}`]=function(r,i){return this.consumeInternalRecord(r,e,i)},this[`SUBRULE${n}`]=function(r,i){return this.subruleInternalRecord(r,e,i)},this[`OPTION${n}`]=function(r){return this.optionInternalRecord(
448
+ r,e)},this[`OR${n}`]=function(r){return this.orInternalRecord(r,e)},this[`MANY${n}`]=function(r){this.manyInternalRecord(e,r)},this[`MANY_SEP${n}`]=function(r){this.manySepFirstInternalRecord(e,r)},this[`AT_LEAST_ONE${n}`]=function(r){this.atLeastOneInternalRecord(e,r)},this[`AT_LEAST_ONE_SEP${n}`]=function(r){this.atLeastOneSepFirstInternalRecord(e,r)}}this.consume=function(e,n,r){return this.consumeInternalRecord(n,e,r)},this.subrule=function(e,n,r){return this.subruleInternalRecord(n,e,r)},this.
449
+ option=function(e,n){return this.optionInternalRecord(n,e)},this.or=function(e,n){return this.orInternalRecord(n,e)},this.many=function(e,n){this.manyInternalRecord(e,n)},this.atLeastOne=function(e,n){this.atLeastOneInternalRecord(e,n)},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 n=0;n<10;n++){const r=n>0?n:"";delete e[`CONSUME${r}`],delete e[`\
450
+ SUBRULE${r}`],delete e[`OPTION${r}`],delete e[`OR${r}`],delete e[`MANY${r}`],delete e[`MANY_SEP${r}`],delete e[`AT_LEAST_ONE${r}`],delete e[`AT_LEAST_ONE_SEP${r}`]}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,n){return()=>!0}LA_RECORD(e){return Bf}topLevelRuleRecord(e,n){try{const r=new jo({definition:[],name:e});return r.name=e,this.recordingProdStack.push(r),
451
+ n.call(this),this.recordingProdStack.pop(),r}catch(r){if(r.KNOWN_RECORDER_ERROR!==!0)try{r.message=r.message+`
452
+ This error was thrown during the "grammar recording phase" For more info see:
453
+ https://chevrotain.io/docs/guide/internals.html#grammar-recording`}catch{throw r}throw r}}optionInternalRecord(e,n){return Wu.call(this,an,e,n)}atLeastOneInternalRecord(e,n){Wu.call(this,Vn,n,e)}atLeastOneSepFirstInternalRecord(e,n){Wu.call(this,Xn,n,e,D$)}manyInternalRecord(e,n){Wu.call(this,_t,n,e)}manySepFirstInternalRecord(e,n){Wu.call(this,Fn,n,e,D$)}orInternalRecord(e,n){return KB.call(this,e,n)}subruleInternalRecord(e,n,r){if(Mf(n),!e||Te(e,"ruleName")===!1){const a=new Error(`<SUBRULE${C$(
454
+ n)}> argument is invalid expecting a Parser method reference but got: <${JSON.stringify(e)}>
455
+ inside top level rule: <${this.recordingProdStack[0].name}>`);throw a.KNOWN_RECORDER_ERROR=!0,a}const i=Bo(this.recordingProdStack),s=e.ruleName,o=new Dn({idx:n,nonTerminalName:s,label:r?.LABEL,referencedRule:void 0});return i.definition.push(o),this.outputCst?zB:Lf}consumeInternalRecord(e,n,r){if(Mf(n),!GE(e)){const o=new Error(`<CONSUME${C$(n)}> argument is invalid expecting a TokenType reference but got: <${JSON.stringify(e)}>
456
+ inside top level rule: <${this.recordingProdStack[0].name}>`);throw o.KNOWN_RECORDER_ERROR=!0,o}const i=Bo(this.recordingProdStack),s=new Et({idx:n,terminalType:e,label:r?.LABEL});return i.definition.push(s),T$}}function Wu(t,e,n,r=!1){Mf(n);const i=Bo(this.recordingProdStack),s=ii(e)?e:e.DEF,o=new t({definition:[],idx:n});return r&&(o.separator=e.SEP),Te(e,"MAX_LOOKAHEAD")&&(o.maxLookahead=e.MAX_LOOKAHEAD),this.recordingProdStack.push(o),s.call(this),i.definition.push(o),this.recordingProdStack.
457
+ pop(),Lf}function KB(t,e){Mf(e);const n=Bo(this.recordingProdStack),r=Qe(t)===!1,i=r===!1?t:t.DEF,s=new Ln({definition:[],idx:e,ignoreAmbiguities:r&&t.IGNORE_AMBIGUITIES===!0});Te(t,"MAX_LOOKAHEAD")&&(s.maxLookahead=t.MAX_LOOKAHEAD);const o=RE(i,a=>ii(a.GATE));return s.hasPredicates=o,n.definition.push(s),ke(i,a=>{const u=new On({definition:[]});s.definition.push(u),Te(a,"IGNORE_AMBIGUITIES")?u.ignoreAmbiguities=a.IGNORE_AMBIGUITIES:Te(a,"GATE")&&(u.ignoreAmbiguities=!0),this.recordingProdStack.
458
+ push(u),a.ALT.call(this),this.recordingProdStack.pop()}),Lf}function C$(t){return t===0?"":`${t}`}function Mf(t){if(t<0||t>R$){const e=new Error(`Invalid DSL Method idx value: <${t}>
459
+ Idx value must be a none negative value smaller than ${R$+1}`);throw e.KNOWN_RECORDER_ERROR=!0,e}}class VB{initPerformanceTracer(e){if(Te(e,"traceInitPerf")){const n=e.traceInitPerf,r=typeof n=="number";this.traceInitMaxIdent=r?n:1/0,this.traceInitPerf=r?n>0:n}else this.traceInitMaxIdent=0,this.traceInitPerf=ci.traceInitPerf;this.traceInitIndent=-1}TRACE_INIT(e,n){if(this.traceInitPerf===!0){this.traceInitIndent++;const r=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent<this.traceInitMaxIdent&&
460
+ console.log(`${r}--> <${e}>`);const{time:i,value:s}=CE(n),o=i>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&o(`${r}<-- <${e}> time: ${i}ms`),this.traceInitIndent--,s}else return n()}}function XB(t,e){e.forEach(n=>{const r=n.prototype;Object.getOwnPropertyNames(r).forEach(i=>{if(i==="constructor")return;const s=Object.getOwnPropertyDescriptor(r,i);s&&(s.get||s.set)?Object.defineProperty(t.prototype,i,s):t.prototype[i]=n.prototype[i]})})}const Bf=bg(Ki,"",NaN,NaN,
461
+ NaN,NaN,NaN,NaN);Object.freeze(Bf);const ci=Object.freeze({recoveryEnabled:!1,maxLookahead:3,dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:Wo,nodeLocationTracking:"none",traceInitPerf:!1,skipValidations:!1}),qf=Object.freeze({recoveryValueFunc:()=>{},resyncEnabled:!0});var Rn;(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",
462
+ 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_LOOKAH\
463
+ EAD_VALIDATION"})(Rn||(Rn={}));function A$(t=void 0){return function(){return t}}class Td{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 n=this.className;this.TRACE_INIT("toFastProps",()=>{AE(this)}),this.TRACE_INIT("Grammar Recording",()=>{try{this.enableRecording(),ke(this.definedRulesNames,
464
+ i=>{const o=this[i].originalGrammarAction;let a;this.TRACE_INIT(`${i} Rule`,()=>{a=this.topLevelRuleRecord(i,o)}),this.gastProductionsCache[i]=a})}finally{this.disableRecording()}});let r=[];if(this.TRACE_INIT("Grammar Resolving",()=>{r=wB({rules:Kt(this.gastProductionsCache)}),this.definitionErrors=this.definitionErrors.concat(r)}),this.TRACE_INIT("Grammar Validations",()=>{if(ft(r)&&this.skipValidations===!1){const i=bB({rules:Kt(this.gastProductionsCache),tokenTypes:Kt(this.tokensMap),errMsgProvider:Ns,
465
+ grammarName:n}),s=iB({lookaheadStrategy:this.lookaheadStrategy,rules:Kt(this.gastProductionsCache),tokenTypes:Kt(this.tokensMap),grammarName:n});this.definitionErrors=this.definitionErrors.concat(i,s)}}),ft(this.definitionErrors)&&(this.recoveryEnabled&&this.TRACE_INIT("computeAllProdsFollows",()=>{const i=r2(Kt(this.gastProductionsCache));this.resyncFollows=i}),this.TRACE_INIT("ComputeLookaheadFunctions",()=>{var i,s;(s=(i=this.lookaheadStrategy).initialize)===null||s===void 0||s.call(i,{rules:Kt(
466
+ this.gastProductionsCache)}),this.preComputeLookaheadFunctions(Kt(this.gastProductionsCache))})),!Td.DEFER_DEFINITION_ERRORS_HANDLING&&!ft(this.definitionErrors))throw e=ve(this.definitionErrors,i=>i.message),new Error(`Parser Definition Errors detected:
467
+ ${e.join(`
468
+ -------------------------------
469
+ `)}`)})}constructor(e,n){this.definitionErrors=[],this.selfAnalysisDone=!1;const r=this;if(r.initErrorHandler(n),r.initLexerAdapter(),r.initLooksAhead(n),r.initRecognizerEngine(e,n),r.initRecoverable(n),r.initTreeBuilder(n),r.initContentAssist(),r.initGastRecorder(n),r.initPerformanceTracer(n),Te(n,"ignoredIssues"))throw new Error(`The <ignoredIssues> IParserConfig property has been deprecated.
470
+ Please use the <IGNORE_AMBIGUITIES> flag on the relevant DSL method instead.
471
+ See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#IGNORING_AMBIGUITIES
472
+ For further details.`);this.skipValidations=Te(n,"skipValidations")?n.skipValidations:ci.skipValidations}}Td.DEFER_DEFINITION_ERRORS_HANDLING=!1,XB(Td,[kB,AB,BB,qB,GB,jB,UB,WB,HB,VB]);class YB extends Td{constructor(e,n=ci){const r=sn(n);r.outputCst=!1,super(e,r)}}function zo(t,e,n){return`${t.name}_${e}_${n}`}const Xi=1,JB=2,S$=4,_$=5,zu=7,QB=8,ZB=9,eq=10,tq=11,P$=12;class Ng{constructor(e){this.target=e}isEpsilon(){return!1}}class Ig extends Ng{constructor(e,n){super(e),this.tokenType=n}}class x$ extends Ng{constructor(e){
473
+ super(e)}isEpsilon(){return!0}}class Og extends Ng{constructor(e,n,r){super(e),this.rule=n,this.followState=r}isEpsilon(){return!0}}function nq(t){const e={decisionMap:{},decisionStates:[],ruleToStartState:new Map,ruleToStopState:new Map,states:[]};rq(e,t);const n=t.length;for(let r=0;r<n;r++){const i=t[r],s=Is(e,i,i);s!==void 0&&hq(e,i,s)}return e}function rq(t,e){const n=e.length;for(let r=0;r<n;r++){const i=e[r],s=Qt(t,i,void 0,{type:JB}),o=Qt(t,i,void 0,{type:zu});s.stop=o,t.ruleToStartState.
474
+ set(i,s),t.ruleToStopState.set(i,o)}}function N$(t,e,n){return n instanceof Et?Fg(t,e,n.terminalType,n):n instanceof Dn?pq(t,e,n):n instanceof Ln?uq(t,e,n):n instanceof an?cq(t,e,n):n instanceof _t?iq(t,e,n):n instanceof Fn?sq(t,e,n):n instanceof Vn?oq(t,e,n):n instanceof Xn?aq(t,e,n):Is(t,e,n)}function iq(t,e,n){const r=Qt(t,e,n,{type:_$});Yi(t,r);const i=Ho(t,e,r,n,Is(t,e,n));return O$(t,e,n,i)}function sq(t,e,n){const r=Qt(t,e,n,{type:_$});Yi(t,r);const i=Ho(t,e,r,n,Is(t,e,n)),s=Fg(t,e,n.separator,
475
+ n);return O$(t,e,n,i,s)}function oq(t,e,n){const r=Qt(t,e,n,{type:S$});Yi(t,r);const i=Ho(t,e,r,n,Is(t,e,n));return I$(t,e,n,i)}function aq(t,e,n){const r=Qt(t,e,n,{type:S$});Yi(t,r);const i=Ho(t,e,r,n,Is(t,e,n)),s=Fg(t,e,n.separator,n);return I$(t,e,n,i,s)}function uq(t,e,n){const r=Qt(t,e,n,{type:Xi});Yi(t,r);const i=ve(n.definition,o=>N$(t,e,o));return Ho(t,e,r,n,...i)}function cq(t,e,n){const r=Qt(t,e,n,{type:Xi});Yi(t,r);const i=Ho(t,e,r,n,Is(t,e,n));return lq(t,e,n,i)}function Is(t,e,n){const r=Hn(
476
+ ve(n.definition,i=>N$(t,e,i)),i=>i!==void 0);return r.length===1?r[0]:r.length===0?void 0:fq(t,r)}function I$(t,e,n,r,i){const s=r.left,o=r.right,a=Qt(t,e,n,{type:tq});Yi(t,a);const u=Qt(t,e,n,{type:P$});return s.loopback=a,u.loopback=a,t.decisionMap[zo(e,i?"RepetitionMandatoryWithSeparator":"RepetitionMandatory",n.idx)]=a,qt(o,a),i===void 0?(qt(a,s),qt(a,u)):(qt(a,u),qt(a,i.left),qt(i.right,s)),{left:s,right:u}}function O$(t,e,n,r,i){const s=r.left,o=r.right,a=Qt(t,e,n,{type:eq});Yi(t,a);const u=Qt(
477
+ t,e,n,{type:P$}),c=Qt(t,e,n,{type:ZB});return a.loopback=c,u.loopback=c,qt(a,s),qt(a,u),qt(o,c),i!==void 0?(qt(c,u),qt(c,i.left),qt(i.right,s)):qt(c,a),t.decisionMap[zo(e,i?"RepetitionWithSeparator":"Repetition",n.idx)]=a,{left:a,right:u}}function lq(t,e,n,r){const i=r.left,s=r.right;return qt(i,s),t.decisionMap[zo(e,"Option",n.idx)]=i,r}function Yi(t,e){return t.decisionStates.push(e),e.decision=t.decisionStates.length-1,e.decision}function Ho(t,e,n,r,...i){const s=Qt(t,e,r,{type:QB,start:n});n.
478
+ end=s;for(const a of i)a!==void 0?(qt(n,a.left),qt(a.right,s)):qt(n,s);const o={left:n,right:s};return t.decisionMap[zo(e,dq(r),r.idx)]=n,o}function dq(t){if(t instanceof Ln)return"Alternation";if(t instanceof an)return"Option";if(t instanceof _t)return"Repetition";if(t instanceof Fn)return"RepetitionWithSeparator";if(t instanceof Vn)return"RepetitionMandatory";if(t instanceof Xn)return"RepetitionMandatoryWithSeparator";throw new Error("Invalid production type encountered")}function fq(t,e){const n=e.
479
+ length;for(let s=0;s<n-1;s++){const o=e[s];let a;o.left.transitions.length===1&&(a=o.left.transitions[0]);const u=a instanceof Og,c=a,l=e[s+1].left;o.left.type===Xi&&o.right.type===Xi&&a!==void 0&&(u&&c.followState===o.right||a.target===o.right)?(u?c.followState=l:a.target=l,mq(t,o.right)):qt(o.right,l)}const r=e[0],i=e[n-1];return{left:r.left,right:i.right}}function Fg(t,e,n,r){const i=Qt(t,e,r,{type:Xi}),s=Qt(t,e,r,{type:Xi});return Lg(i,new Ig(s,n)),{left:i,right:s}}function pq(t,e,n){const r=n.
480
+ referencedRule,i=t.ruleToStartState.get(r),s=Qt(t,e,n,{type:Xi}),o=Qt(t,e,n,{type:Xi}),a=new Og(i,r,o);return Lg(s,a),{left:s,right:o}}function hq(t,e,n){const r=t.ruleToStartState.get(e);qt(r,n.left);const i=t.ruleToStopState.get(e);return qt(n.right,i),{left:r,right:i}}function qt(t,e){const n=new x$(e);Lg(t,n)}function Qt(t,e,n,r){const i=Object.assign({atn:t,production:n,epsilonOnlyTransitions:!1,rule:e,transitions:[],nextTokenWithinRule:[],stateNumber:t.states.length},r);return t.states.push(
481
+ i),i}function Lg(t,e){t.transitions.length===0&&(t.epsilonOnlyTransitions=e.isEpsilon()),t.transitions.push(e)}function mq(t,e){t.states.splice(t.states.indexOf(e),1)}const jf={};class Mg{constructor(){this.map={},this.configs=[]}get size(){return this.configs.length}finalize(){this.map={}}add(e){const n=F$(e);n in this.map||(this.map[n]=this.configs.length,this.configs.push(e))}get elements(){return this.configs}get alts(){return ve(this.configs,e=>e.alt)}get key(){let e="";for(const n in this.
482
+ map)e+=n+":";return e}}function F$(t,e=!0){return`${e?`a${t.alt}`:""}s${t.state.stateNumber}:${t.stack.map(n=>n.stateNumber.toString()).join("_")}`}function gq(t,e){const n={};return r=>{const i=r.toString();let s=n[i];return s!==void 0||(s={atnStartState:t,decision:e,states:{}},n[i]=s),s}}class L${constructor(){this.predicates=[]}is(e){return e>=this.predicates.length||this.predicates[e]}set(e,n){this.predicates[e]=n}toString(){let e="";const n=this.predicates.length;for(let r=0;r<n;r++)e+=this.
483
+ predicates[r]===!0?"1":"0";return e}}const M$=new L$;class yq extends Pg{constructor(e){var n;super(),this.logging=(n=e?.logging)!==null&&n!==void 0?n:r=>console.log(r)}initialize(e){this.atn=nq(e.rules),this.dfas=vq(this.atn)}validateAmbiguousAlternationAlternatives(){return[]}validateEmptyOrAlternatives(){return[]}buildLookaheadForAlternation(e){const{prodOccurrence:n,rule:r,hasPredicates:i,dynamicTokensEnabled:s}=e,o=this.dfas,a=this.logging,u=zo(r,"Alternation",n),l=this.atn.decisionMap[u].decision,
484
+ f=ve(i$({maxLookahead:1,occurrence:n,prodType:"Alternation",rule:r}),d=>ve(d,p=>p[0]));if(B$(f,!1)&&!s){const d=$n(f,(p,m,v)=>(ke(m,w=>{w&&(p[w.tokenTypeIdx]=v,ke(w.categoryMatches,y=>{p[y]=v}))}),p),{});return i?function(p){var m;const v=this.LA(1),w=d[v.tokenTypeIdx];if(p!==void 0&&w!==void 0){const y=(m=p[w])===null||m===void 0?void 0:m.GATE;if(y!==void 0&&y.call(this)===!1)return}return w}:function(){const p=this.LA(1);return d[p.tokenTypeIdx]}}else return i?function(d){const p=new L$,m=d===
485
+ void 0?0:d.length;for(let w=0;w<m;w++){const y=d?.[w].GATE;p.set(w,y===void 0||y.call(this))}const v=Bg.call(this,o,l,p,a);return typeof v=="number"?v:void 0}:function(){const d=Bg.call(this,o,l,M$,a);return typeof d=="number"?d:void 0}}buildLookaheadForOptional(e){const{prodOccurrence:n,rule:r,prodType:i,dynamicTokensEnabled:s}=e,o=this.dfas,a=this.logging,u=zo(r,i,n),l=this.atn.decisionMap[u].decision,f=ve(i$({maxLookahead:1,occurrence:n,prodType:i,rule:r}),d=>ve(d,p=>p[0]));if(B$(f)&&f[0][0]&&
486
+ !s){const d=f[0],p=ar(d);if(p.length===1&&ft(p[0].categoryMatches)){const v=p[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===v}}else{const m=$n(p,(v,w)=>(w!==void 0&&(v[w.tokenTypeIdx]=!0,ke(w.categoryMatches,y=>{v[y]=!0})),v),{});return function(){const v=this.LA(1);return m[v.tokenTypeIdx]===!0}}}return function(){const d=Bg.call(this,o,l,M$,a);return typeof d=="object"?!1:d===0}}}function B$(t,e=!0){const n=new Set;for(const r of t){const i=new Set;for(const s of r){if(s===
487
+ void 0){if(e)break;return!1}const o=[s.tokenTypeIdx].concat(s.categoryMatches);for(const a of o)if(n.has(a)){if(!i.has(a))return!1}else n.add(a),i.add(a)}}return!0}function vq(t){const e=t.decisionStates.length,n=Array(e);for(let r=0;r<e;r++)n[r]=gq(t.decisionStates[r],r);return n}function Bg(t,e,n,r){const i=t[e](n);let s=i.start;if(s===void 0){const a=Sq(i.atnStartState);s=G$(i,q$(a)),i.start=s}return wq.apply(this,[i,s,n,r])}function wq(t,e,n,r){let i=e,s=1;const o=[];let a=this.LA(s++);for(;;){
488
+ let u=kq(i,a);if(u===void 0&&(u=bq.apply(this,[t,i,a,s,n,r])),u===jf)return Rq(o,i,a);if(u.isAcceptState===!0)return u.prediction;i=u,o.push(a),a=this.LA(s++)}}function bq(t,e,n,r,i,s){const o=Tq(e.configs,n,i);if(o.size===0)return j$(t,e,n,jf),jf;let a=q$(o);const u=Aq(o,i);if(u!==void 0)a.isAcceptState=!0,a.prediction=u,a.configs.uniqueAlt=u;else if(Nq(o)){const c=LM(o.alts);a.isAcceptState=!0,a.prediction=c,a.configs.uniqueAlt=c,Eq.apply(this,[t,r,o.alts,s])}return a=j$(t,e,n,a),a}function Eq(t,e,n,r){
489
+ const i=[];for(let c=1;c<=e;c++)i.push(this.LA(c).tokenType);const s=t.atnStartState,o=s.rule,a=s.production,u=$q({topLevelRule:o,ambiguityIndices:n,production:a,prefixPath:i});r(u)}function $q(t){const e=ve(t.prefixPath,i=>Uo(i)).join(", "),n=t.production.idx===0?"":t.production.idx;let r=`Ambiguous Alternatives Detected: <${t.ambiguityIndices.join(", ")}> in <${Dq(t.production)}${n}> inside <${t.topLevelRule.name}> Rule,
490
+ <${e}> may appears as a prefix path in all these alternatives.
491
+ `;return r=r+`See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES
492
+ For Further details.`,r}function Dq(t){if(t instanceof Dn)return"SUBRULE";if(t instanceof an)return"OPTION";if(t instanceof Ln)return"OR";if(t instanceof Vn)return"AT_LEAST_ONE";if(t instanceof Xn)return"AT_LEAST_ONE_SEP";if(t instanceof Fn)return"MANY_SEP";if(t instanceof _t)return"MANY";if(t instanceof Et)return"CONSUME";throw Error("non exhaustive match")}function Rq(t,e,n){const r=Kn(e.configs.elements,s=>s.state.transitions),i=KM(r.filter(s=>s instanceof Ig).map(s=>s.tokenType),s=>s.tokenTypeIdx);
493
+ return{actualToken:n,possibleTokenTypes:i,tokenPath:t}}function kq(t,e){return t.edges[e.tokenTypeIdx]}function Tq(t,e,n){const r=new Mg,i=[];for(const o of t.elements){if(n.is(o.alt)===!1)continue;if(o.state.type===zu){i.push(o);continue}const a=o.state.transitions.length;for(let u=0;u<a;u++){const c=o.state.transitions[u],l=Cq(c,e);l!==void 0&&r.add({state:l,alt:o.alt,stack:o.stack})}}let s;if(i.length===0&&r.size===1&&(s=r),s===void 0){s=new Mg;for(const o of r.elements)Gf(o,s)}if(i.length>0&&
494
+ !Pq(s))for(const o of i)s.add(o);return s}function Cq(t,e){if(t instanceof Ig&&e$(e,t.tokenType))return t.target}function Aq(t,e){let n;for(const r of t.elements)if(e.is(r.alt)===!0){if(n===void 0)n=r.alt;else if(n!==r.alt)return}return n}function q$(t){return{configs:t,edges:{},isAcceptState:!1,prediction:-1}}function j$(t,e,n,r){return r=G$(t,r),e.edges[n.tokenTypeIdx]=r,r}function G$(t,e){if(e===jf)return e;const n=e.configs.key,r=t.states[n];return r!==void 0?r:(e.configs.finalize(),t.states[n]=
495
+ e,e)}function Sq(t){const e=new Mg,n=t.transitions.length;for(let r=0;r<n;r++){const s={state:t.transitions[r].target,alt:r,stack:[]};Gf(s,e)}return e}function Gf(t,e){const n=t.state;if(n.type===zu){if(t.stack.length>0){const i=[...t.stack],o={state:i.pop(),alt:t.alt,stack:i};Gf(o,e)}else e.add(t);return}n.epsilonOnlyTransitions||e.add(t);const r=n.transitions.length;for(let i=0;i<r;i++){const s=n.transitions[i],o=_q(t,s);o!==void 0&&Gf(o,e)}}function _q(t,e){if(e instanceof x$)return{state:e.target,
496
+ alt:t.alt,stack:t.stack};if(e instanceof Og){const n=[...t.stack,e.followState];return{state:e.target,alt:t.alt,stack:n}}}function Pq(t){for(const e of t.elements)if(e.state.type===zu)return!0;return!1}function xq(t){for(const e of t.elements)if(e.state.type!==zu)return!1;return!0}function Nq(t){if(xq(t))return!0;const e=Iq(t.elements);return Oq(e)&&!Fq(e)}function Iq(t){const e=new Map;for(const n of t){const r=F$(n,!1);let i=e.get(r);i===void 0&&(i={},e.set(r,i)),i[n.alt]=!0}return e}function Oq(t){
497
+ for(const e of Array.from(t.values()))if(Object.keys(e).length>1)return!0;return!1}function Fq(t){for(const e of Array.from(t.values()))if(Object.keys(e).length===1)return!0;return!1}var U$;(function(t){function e(n){return typeof n=="string"}t.is=e})(U$||(U$={}));var qg;(function(t){function e(n){return typeof n=="string"}t.is=e})(qg||(qg={}));var W$;(function(t){t.MIN_VALUE=-2147483648,t.MAX_VALUE=2147483647;function e(n){return typeof n=="number"&&t.MIN_VALUE<=n&&n<=t.MAX_VALUE}t.is=e})(W$||(W$=
498
+ {}));var Uf;(function(t){t.MIN_VALUE=0,t.MAX_VALUE=2147483647;function e(n){return typeof n=="number"&&t.MIN_VALUE<=n&&n<=t.MAX_VALUE}t.is=e})(Uf||(Uf={}));var ot;(function(t){function e(r,i){return r===Number.MAX_VALUE&&(r=Uf.MAX_VALUE),i===Number.MAX_VALUE&&(i=Uf.MAX_VALUE),{line:r,character:i}}t.create=e;function n(r){let i=r;return j.objectLiteral(i)&&j.uinteger(i.line)&&j.uinteger(i.character)}t.is=n})(ot||(ot={}));var Ye;(function(t){function e(r,i,s,o){if(j.uinteger(r)&&j.uinteger(i)&&j.uinteger(
499
+ s)&&j.uinteger(o))return{start:ot.create(r,i),end:ot.create(s,o)};if(ot.is(r)&&ot.is(i))return{start:r,end:i};throw new Error(`Range#create called with invalid arguments[${r}, ${i}, ${s}, ${o}]`)}t.create=e;function n(r){let i=r;return j.objectLiteral(i)&&ot.is(i.start)&&ot.is(i.end)}t.is=n})(Ye||(Ye={}));var Wf;(function(t){function e(r,i){return{uri:r,range:i}}t.create=e;function n(r){let i=r;return j.objectLiteral(i)&&Ye.is(i.range)&&(j.string(i.uri)||j.undefined(i.uri))}t.is=n})(Wf||(Wf={}));
500
+ var z$;(function(t){function e(r,i,s,o){return{targetUri:r,targetRange:i,targetSelectionRange:s,originSelectionRange:o}}t.create=e;function n(r){let i=r;return j.objectLiteral(i)&&Ye.is(i.targetRange)&&j.string(i.targetUri)&&Ye.is(i.targetSelectionRange)&&(Ye.is(i.originSelectionRange)||j.undefined(i.originSelectionRange))}t.is=n})(z$||(z$={}));var jg;(function(t){function e(r,i,s,o){return{red:r,green:i,blue:s,alpha:o}}t.create=e;function n(r){const i=r;return j.objectLiteral(i)&&j.numberRange(
501
+ i.red,0,1)&&j.numberRange(i.green,0,1)&&j.numberRange(i.blue,0,1)&&j.numberRange(i.alpha,0,1)}t.is=n})(jg||(jg={}));var H$;(function(t){function e(r,i){return{range:r,color:i}}t.create=e;function n(r){const i=r;return j.objectLiteral(i)&&Ye.is(i.range)&&jg.is(i.color)}t.is=n})(H$||(H$={}));var K$;(function(t){function e(r,i,s){return{label:r,textEdit:i,additionalTextEdits:s}}t.create=e;function n(r){const i=r;return j.objectLiteral(i)&&j.string(i.label)&&(j.undefined(i.textEdit)||Bn.is(i))&&(j.undefined(
502
+ i.additionalTextEdits)||j.typedArray(i.additionalTextEdits,Bn.is))}t.is=n})(K$||(K$={}));var V$;(function(t){t.Comment="comment",t.Imports="imports",t.Region="region"})(V$||(V$={}));var X$;(function(t){function e(r,i,s,o,a,u){const c={startLine:r,endLine:i};return j.defined(s)&&(c.startCharacter=s),j.defined(o)&&(c.endCharacter=o),j.defined(a)&&(c.kind=a),j.defined(u)&&(c.collapsedText=u),c}t.create=e;function n(r){const i=r;return j.objectLiteral(i)&&j.uinteger(i.startLine)&&j.uinteger(i.startLine)&&
503
+ (j.undefined(i.startCharacter)||j.uinteger(i.startCharacter))&&(j.undefined(i.endCharacter)||j.uinteger(i.endCharacter))&&(j.undefined(i.kind)||j.string(i.kind))}t.is=n})(X$||(X$={}));var Gg;(function(t){function e(r,i){return{location:r,message:i}}t.create=e;function n(r){let i=r;return j.defined(i)&&Wf.is(i.location)&&j.string(i.message)}t.is=n})(Gg||(Gg={}));var Os;(function(t){t.Error=1,t.Warning=2,t.Information=3,t.Hint=4})(Os||(Os={}));var Y$;(function(t){t.Unnecessary=1,t.Deprecated=2})(Y$||
504
+ (Y$={}));var J$;(function(t){function e(n){const r=n;return j.objectLiteral(r)&&j.string(r.href)}t.is=e})(J$||(J$={}));var zf;(function(t){function e(r,i,s,o,a,u){let c={range:r,message:i};return j.defined(s)&&(c.severity=s),j.defined(o)&&(c.code=o),j.defined(a)&&(c.source=a),j.defined(u)&&(c.relatedInformation=u),c}t.create=e;function n(r){var i;let s=r;return j.defined(s)&&Ye.is(s.range)&&j.string(s.message)&&(j.number(s.severity)||j.undefined(s.severity))&&(j.integer(s.code)||j.string(s.code)||
505
+ j.undefined(s.code))&&(j.undefined(s.codeDescription)||j.string((i=s.codeDescription)===null||i===void 0?void 0:i.href))&&(j.string(s.source)||j.undefined(s.source))&&(j.undefined(s.relatedInformation)||j.typedArray(s.relatedInformation,Gg.is))}t.is=n})(zf||(zf={}));var Ko;(function(t){function e(r,i,...s){let o={title:r,command:i};return j.defined(s)&&s.length>0&&(o.arguments=s),o}t.create=e;function n(r){let i=r;return j.defined(i)&&j.string(i.title)&&j.string(i.command)}t.is=n})(Ko||(Ko={}));
506
+ var Bn;(function(t){function e(s,o){return{range:s,newText:o}}t.replace=e;function n(s,o){return{range:{start:s,end:s},newText:o}}t.insert=n;function r(s){return{range:s,newText:""}}t.del=r;function i(s){const o=s;return j.objectLiteral(o)&&j.string(o.newText)&&Ye.is(o.range)}t.is=i})(Bn||(Bn={}));var Ug;(function(t){function e(r,i,s){const o={label:r};return i!==void 0&&(o.needsConfirmation=i),s!==void 0&&(o.description=s),o}t.create=e;function n(r){const i=r;return j.objectLiteral(i)&&j.string(
507
+ i.label)&&(j.boolean(i.needsConfirmation)||i.needsConfirmation===void 0)&&(j.string(i.description)||i.description===void 0)}t.is=n})(Ug||(Ug={}));var Vo;(function(t){function e(n){const r=n;return j.string(r)}t.is=e})(Vo||(Vo={}));var Q$;(function(t){function e(s,o,a){return{range:s,newText:o,annotationId:a}}t.replace=e;function n(s,o,a){return{range:{start:s,end:s},newText:o,annotationId:a}}t.insert=n;function r(s,o){return{range:s,newText:"",annotationId:o}}t.del=r;function i(s){const o=s;return Bn.
508
+ is(o)&&(Ug.is(o.annotationId)||Vo.is(o.annotationId))}t.is=i})(Q$||(Q$={}));var Wg;(function(t){function e(r,i){return{textDocument:r,edits:i}}t.create=e;function n(r){let i=r;return j.defined(i)&&Xg.is(i.textDocument)&&Array.isArray(i.edits)}t.is=n})(Wg||(Wg={}));var zg;(function(t){function e(r,i,s){let o={kind:"create",uri:r};return i!==void 0&&(i.overwrite!==void 0||i.ignoreIfExists!==void 0)&&(o.options=i),s!==void 0&&(o.annotationId=s),o}t.create=e;function n(r){let i=r;return i&&i.kind===
509
+ "create"&&j.string(i.uri)&&(i.options===void 0||(i.options.overwrite===void 0||j.boolean(i.options.overwrite))&&(i.options.ignoreIfExists===void 0||j.boolean(i.options.ignoreIfExists)))&&(i.annotationId===void 0||Vo.is(i.annotationId))}t.is=n})(zg||(zg={}));var Hg;(function(t){function e(r,i,s,o){let a={kind:"rename",oldUri:r,newUri:i};return s!==void 0&&(s.overwrite!==void 0||s.ignoreIfExists!==void 0)&&(a.options=s),o!==void 0&&(a.annotationId=o),a}t.create=e;function n(r){let i=r;return i&&i.
510
+ kind==="rename"&&j.string(i.oldUri)&&j.string(i.newUri)&&(i.options===void 0||(i.options.overwrite===void 0||j.boolean(i.options.overwrite))&&(i.options.ignoreIfExists===void 0||j.boolean(i.options.ignoreIfExists)))&&(i.annotationId===void 0||Vo.is(i.annotationId))}t.is=n})(Hg||(Hg={}));var Kg;(function(t){function e(r,i,s){let o={kind:"delete",uri:r};return i!==void 0&&(i.recursive!==void 0||i.ignoreIfNotExists!==void 0)&&(o.options=i),s!==void 0&&(o.annotationId=s),o}t.create=e;function n(r){let i=r;
511
+ return i&&i.kind==="delete"&&j.string(i.uri)&&(i.options===void 0||(i.options.recursive===void 0||j.boolean(i.options.recursive))&&(i.options.ignoreIfNotExists===void 0||j.boolean(i.options.ignoreIfNotExists)))&&(i.annotationId===void 0||Vo.is(i.annotationId))}t.is=n})(Kg||(Kg={}));var Vg;(function(t){function e(n){let r=n;return r&&(r.changes!==void 0||r.documentChanges!==void 0)&&(r.documentChanges===void 0||r.documentChanges.every(i=>j.string(i.kind)?zg.is(i)||Hg.is(i)||Kg.is(i):Wg.is(i)))}t.
512
+ is=e})(Vg||(Vg={}));var Z$;(function(t){function e(r){return{uri:r}}t.create=e;function n(r){let i=r;return j.defined(i)&&j.string(i.uri)}t.is=n})(Z$||(Z$={}));var eD;(function(t){function e(r,i){return{uri:r,version:i}}t.create=e;function n(r){let i=r;return j.defined(i)&&j.string(i.uri)&&j.integer(i.version)}t.is=n})(eD||(eD={}));var Xg;(function(t){function e(r,i){return{uri:r,version:i}}t.create=e;function n(r){let i=r;return j.defined(i)&&j.string(i.uri)&&(i.version===null||j.integer(i.version))}
513
+ t.is=n})(Xg||(Xg={}));var tD;(function(t){function e(r,i,s,o){return{uri:r,languageId:i,version:s,text:o}}t.create=e;function n(r){let i=r;return j.defined(i)&&j.string(i.uri)&&j.string(i.languageId)&&j.integer(i.version)&&j.string(i.text)}t.is=n})(tD||(tD={}));var Yg;(function(t){t.PlainText="plaintext",t.Markdown="markdown";function e(n){const r=n;return r===t.PlainText||r===t.Markdown}t.is=e})(Yg||(Yg={}));var Hu;(function(t){function e(n){const r=n;return j.objectLiteral(n)&&Yg.is(r.kind)&&j.
514
+ string(r.value)}t.is=e})(Hu||(Hu={}));var Ct;(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})(Ct||(Ct={}));var kn;(function(t){t.PlainText=1,t.Snippet=2})(kn||(kn={}));var nD;(function(t){t.Deprecated=1})(nD||(nD={}));var rD;
515
+ (function(t){function e(r,i,s){return{newText:r,insert:i,replace:s}}t.create=e;function n(r){const i=r;return i&&j.string(i.newText)&&Ye.is(i.insert)&&Ye.is(i.replace)}t.is=n})(rD||(rD={}));var iD;(function(t){t.asIs=1,t.adjustIndentation=2})(iD||(iD={}));var sD;(function(t){function e(n){const r=n;return r&&(j.string(r.detail)||r.detail===void 0)&&(j.string(r.description)||r.description===void 0)}t.is=e})(sD||(sD={}));var oD;(function(t){function e(n){return{label:n}}t.create=e})(oD||(oD={}));var aD;
516
+ (function(t){function e(n,r){return{items:n||[],isIncomplete:!!r}}t.create=e})(aD||(aD={}));var Hf;(function(t){function e(r){return r.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}t.fromPlainText=e;function n(r){const i=r;return j.string(i)||j.objectLiteral(i)&&j.string(i.language)&&j.string(i.value)}t.is=n})(Hf||(Hf={}));var uD;(function(t){function e(n){let r=n;return!!r&&j.objectLiteral(r)&&(Hu.is(r.contents)||Hf.is(r.contents)||j.typedArray(r.contents,Hf.is))&&(n.range===void 0||Ye.is(n.range))}t.
517
+ is=e})(uD||(uD={}));var cD;(function(t){function e(n,r){return r?{label:n,documentation:r}:{label:n}}t.create=e})(cD||(cD={}));var lD;(function(t){function e(n,r,...i){let s={label:n};return j.defined(r)&&(s.documentation=r),j.defined(i)?s.parameters=i:s.parameters=[],s}t.create=e})(lD||(lD={}));var dD;(function(t){t.Text=1,t.Read=2,t.Write=3})(dD||(dD={}));var fD;(function(t){function e(n,r){let i={range:n};return j.number(r)&&(i.kind=r),i}t.create=e})(fD||(fD={}));var Dr;(function(t){t.File=1,
518
+ 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})(Dr||(Dr={}));var pD;(function(t){t.Deprecated=1})(pD||(pD={}));var hD;(function(t){function e(n,r,i,s,o){let a={name:n,kind:r,location:{uri:s,range:i}};return o&&(a.containerName=o),a}
519
+ t.create=e})(hD||(hD={}));var mD;(function(t){function e(n,r,i,s){return s!==void 0?{name:n,kind:r,location:{uri:i,range:s}}:{name:n,kind:r,location:{uri:i}}}t.create=e})(mD||(mD={}));var gD;(function(t){function e(r,i,s,o,a,u){let c={name:r,detail:i,kind:s,range:o,selectionRange:a};return u!==void 0&&(c.children=u),c}t.create=e;function n(r){let i=r;return i&&j.string(i.name)&&j.number(i.kind)&&Ye.is(i.range)&&Ye.is(i.selectionRange)&&(i.detail===void 0||j.string(i.detail))&&(i.deprecated===void 0||
520
+ j.boolean(i.deprecated))&&(i.children===void 0||Array.isArray(i.children))&&(i.tags===void 0||Array.isArray(i.tags))}t.is=n})(gD||(gD={}));var yD;(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"})(yD||(yD={}));var Kf;(function(t){t.Invoked=1,t.Automatic=2})(Kf||(Kf={}));var vD;
521
+ (function(t){function e(r,i,s){let o={diagnostics:r};return i!=null&&(o.only=i),s!=null&&(o.triggerKind=s),o}t.create=e;function n(r){let i=r;return j.defined(i)&&j.typedArray(i.diagnostics,zf.is)&&(i.only===void 0||j.typedArray(i.only,j.string))&&(i.triggerKind===void 0||i.triggerKind===Kf.Invoked||i.triggerKind===Kf.Automatic)}t.is=n})(vD||(vD={}));var wD;(function(t){function e(r,i,s){let o={title:r},a=!0;return typeof i=="string"?(a=!1,o.kind=i):Ko.is(i)?o.command=i:o.edit=i,a&&s!==void 0&&(o.
522
+ kind=s),o}t.create=e;function n(r){let i=r;return i&&j.string(i.title)&&(i.diagnostics===void 0||j.typedArray(i.diagnostics,zf.is))&&(i.kind===void 0||j.string(i.kind))&&(i.edit!==void 0||i.command!==void 0)&&(i.command===void 0||Ko.is(i.command))&&(i.isPreferred===void 0||j.boolean(i.isPreferred))&&(i.edit===void 0||Vg.is(i.edit))}t.is=n})(wD||(wD={}));var bD;(function(t){function e(r,i){let s={range:r};return j.defined(i)&&(s.data=i),s}t.create=e;function n(r){let i=r;return j.defined(i)&&Ye.is(
523
+ i.range)&&(j.undefined(i.command)||Ko.is(i.command))}t.is=n})(bD||(bD={}));var ED;(function(t){function e(r,i){return{tabSize:r,insertSpaces:i}}t.create=e;function n(r){let i=r;return j.defined(i)&&j.uinteger(i.tabSize)&&j.boolean(i.insertSpaces)}t.is=n})(ED||(ED={}));var $D;(function(t){function e(r,i,s){return{range:r,target:i,data:s}}t.create=e;function n(r){let i=r;return j.defined(i)&&Ye.is(i.range)&&(j.undefined(i.target)||j.string(i.target))}t.is=n})($D||($D={}));var DD;(function(t){function e(r,i){
524
+ return{range:r,parent:i}}t.create=e;function n(r){let i=r;return j.objectLiteral(i)&&Ye.is(i.range)&&(i.parent===void 0||t.is(i.parent))}t.is=n})(DD||(DD={}));var Be;(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="ke\
525
+ yword",t.modifier="modifier",t.comment="comment",t.string="string",t.number="number",t.regexp="regexp",t.operator="operator",t.decorator="decorator"})(Be||(Be={}));var We;(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"})(We||(We={}));var RD;(function(t){function e(n){const r=n;return j.
526
+ objectLiteral(r)&&(r.resultId===void 0||typeof r.resultId=="string")&&Array.isArray(r.data)&&(r.data.length===0||typeof r.data[0]=="number")}t.is=e})(RD||(RD={}));var kD;(function(t){function e(r,i){return{range:r,text:i}}t.create=e;function n(r){const i=r;return i!=null&&Ye.is(i.range)&&j.string(i.text)}t.is=n})(kD||(kD={}));var TD;(function(t){function e(r,i,s){return{range:r,variableName:i,caseSensitiveLookup:s}}t.create=e;function n(r){const i=r;return i!=null&&Ye.is(i.range)&&j.boolean(i.caseSensitiveLookup)&&
527
+ (j.string(i.variableName)||i.variableName===void 0)}t.is=n})(TD||(TD={}));var CD;(function(t){function e(r,i){return{range:r,expression:i}}t.create=e;function n(r){const i=r;return i!=null&&Ye.is(i.range)&&(j.string(i.expression)||i.expression===void 0)}t.is=n})(CD||(CD={}));var AD;(function(t){function e(r,i){return{frameId:r,stoppedLocation:i}}t.create=e;function n(r){const i=r;return j.defined(i)&&Ye.is(r.stoppedLocation)}t.is=n})(AD||(AD={}));var Jg;(function(t){t.Type=1,t.Parameter=2;function e(n){
528
+ return n===1||n===2}t.is=e})(Jg||(Jg={}));var Qg;(function(t){function e(r){return{value:r}}t.create=e;function n(r){const i=r;return j.objectLiteral(i)&&(i.tooltip===void 0||j.string(i.tooltip)||Hu.is(i.tooltip))&&(i.location===void 0||Wf.is(i.location))&&(i.command===void 0||Ko.is(i.command))}t.is=n})(Qg||(Qg={}));var SD;(function(t){function e(r,i,s){const o={position:r,label:i};return s!==void 0&&(o.kind=s),o}t.create=e;function n(r){const i=r;return j.objectLiteral(i)&&ot.is(i.position)&&(j.
529
+ string(i.label)||j.typedArray(i.label,Qg.is))&&(i.kind===void 0||Jg.is(i.kind))&&i.textEdits===void 0||j.typedArray(i.textEdits,Bn.is)&&(i.tooltip===void 0||j.string(i.tooltip)||Hu.is(i.tooltip))&&(i.paddingLeft===void 0||j.boolean(i.paddingLeft))&&(i.paddingRight===void 0||j.boolean(i.paddingRight))}t.is=n})(SD||(SD={}));var _D;(function(t){function e(n){return{kind:"snippet",value:n}}t.createSnippet=e})(_D||(_D={}));var PD;(function(t){function e(n,r,i,s){return{insertText:n,filterText:r,range:i,
530
+ command:s}}t.create=e})(PD||(PD={}));var xD;(function(t){function e(n){return{items:n}}t.create=e})(xD||(xD={}));var ND;(function(t){t.Invoked=0,t.Automatic=1})(ND||(ND={}));var ID;(function(t){function e(n,r){return{range:n,text:r}}t.create=e})(ID||(ID={}));var OD;(function(t){function e(n,r){return{triggerKind:n,selectedCompletionInfo:r}}t.create=e})(OD||(OD={}));var FD;(function(t){function e(n){const r=n;return j.objectLiteral(r)&&qg.is(r.uri)&&j.string(r.name)}t.is=e})(FD||(FD={}));var LD;(function(t){
531
+ function e(s,o,a,u){return new Lq(s,o,a,u)}t.create=e;function n(s){let o=s;return!!(j.defined(o)&&j.string(o.uri)&&(j.undefined(o.languageId)||j.string(o.languageId))&&j.uinteger(o.lineCount)&&j.func(o.getText)&&j.func(o.positionAt)&&j.func(o.offsetAt))}t.is=n;function r(s,o){let a=s.getText(),u=i(o,(l,f)=>{let d=l.range.start.line-f.range.start.line;return d===0?l.range.start.character-f.range.start.character:d}),c=a.length;for(let l=u.length-1;l>=0;l--){let f=u[l],d=s.offsetAt(f.range.start),
532
+ p=s.offsetAt(f.range.end);if(p<=c)a=a.substring(0,d)+f.newText+a.substring(p,a.length);else throw new Error("Overlapping edit");c=d}return a}t.applyEdits=r;function i(s,o){if(s.length<=1)return s;const a=s.length/2|0,u=s.slice(0,a),c=s.slice(a);i(u,o),i(c,o);let l=0,f=0,d=0;for(;l<u.length&&f<c.length;)o(u[l],c[f])<=0?s[d++]=u[l++]:s[d++]=c[f++];for(;l<u.length;)s[d++]=u[l++];for(;f<c.length;)s[d++]=c[f++];return s}})(LD||(LD={}));let Lq=class{constructor(e,n,r,i){this._uri=e,this._languageId=n,
533
+ this._version=r,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){let n=this.offsetAt(e.start),r=this.offsetAt(e.end);return this._content.substring(n,r)}return this._content}update(e,n){this._content=e.text,this._version=n,this._lineOffsets=void 0}getLineOffsets(){if(this._lineOffsets===void 0){let e=[],n=this._content,r=!0;for(let i=0;i<n.length;i++){r&&(e.push(i),r=!1);let s=n.charAt(
534
+ i);r=s==="\r"||s===`
535
+ `,s==="\r"&&i+1<n.length&&n.charAt(i+1)===`
536
+ `&&i++}r&&n.length>0&&e.push(n.length),this._lineOffsets=e}return this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let n=this.getLineOffsets(),r=0,i=n.length;if(i===0)return ot.create(0,e);for(;r<i;){let o=Math.floor((r+i)/2);n[o]>e?i=o:r=o+1}let s=r-1;return ot.create(s,e-n[s])}offsetAt(e){let n=this.getLineOffsets();if(e.line>=n.length)return this._content.length;if(e.line<0)return 0;let r=n[e.line],i=e.line+1<n.length?n[e.line+1]:this._content.length;return Math.
537
+ max(Math.min(r+e.character,i),r)}get lineCount(){return this.getLineOffsets().length}};var j;(function(t){const e=Object.prototype.toString;function n(p){return typeof p<"u"}t.defined=n;function r(p){return typeof p>"u"}t.undefined=r;function i(p){return p===!0||p===!1}t.boolean=i;function s(p){return e.call(p)==="[object String]"}t.string=s;function o(p){return e.call(p)==="[object Number]"}t.number=o;function a(p,m,v){return e.call(p)==="[object Number]"&&m<=p&&p<=v}t.numberRange=a;function u(p){
538
+ return e.call(p)==="[object Number]"&&-2147483648<=p&&p<=2147483647}t.integer=u;function c(p){return e.call(p)==="[object Number]"&&0<=p&&p<=2147483647}t.uinteger=c;function l(p){return e.call(p)==="[object Function]"}t.func=l;function f(p){return p!==null&&typeof p=="object"}t.objectLiteral=f;function d(p,m){return Array.isArray(p)&&p.every(m)}t.typedArray=d})(j||(j={}));class Mq{constructor(){this.nodeStack=[]}get current(){var e;return(e=this.nodeStack[this.nodeStack.length-1])!==null&&e!==void 0?
539
+ e:this.rootNode}buildRootNode(e){return this.rootNode=new BD(e),this.rootNode.root=this.rootNode,this.nodeStack=[this.rootNode],this.rootNode}buildCompositeNode(e){const n=new ey;return n.grammarSource=e,n.root=this.rootNode,this.current.content.push(n),this.nodeStack.push(n),n}buildLeafNode(e,n){const r=new Zg(e.startOffset,e.image.length,hm(e),e.tokenType,!n);return r.grammarSource=n,r.root=this.rootNode,this.current.content.push(r),r}removeNode(e){const n=e.container;if(n){const r=n.content.indexOf(
540
+ e);r>=0&&n.content.splice(r,1)}}addHiddenNodes(e){const n=[];for(const s of e){const o=new Zg(s.startOffset,s.image.length,hm(s),s.tokenType,!0);o.root=this.rootNode,n.push(o)}let r=this.current,i=!1;if(r.content.length>0){r.content.push(...n);return}for(;r.container;){const s=r.container.content.indexOf(r);if(s>0){r.container.content.splice(s,0,...n),i=!0;break}r=r.container}i||this.rootNode.content.unshift(...n)}construct(e){const n=this.current;typeof e.$type=="string"&&(this.current.astNode=
541
+ e),e.$cstNode=n;const r=this.nodeStack.pop();r?.content.length===0&&this.removeNode(r)}}class MD{get parent(){return this.container}get feature(){return this.grammarSource}get hidden(){return!1}get astNode(){var e,n;const r=typeof((e=this._astNode)===null||e===void 0?void 0:e.$type)=="string"?this._astNode:(n=this.container)===null||n===void 0?void 0:n.astNode;if(!r)throw new Error("This node has no associated AST element");return r}set astNode(e){this._astNode=e}get element(){return this.astNode}get text(){
542
+ return this.root.fullText.substring(this.offset,this.end)}}class Zg extends MD{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,n,r,i,s=!1){super(),this._hidden=s,this._offset=e,this._tokenType=i,this._length=n,this._range=r}}class ey extends MD{constructor(){super(...arguments),this.content=new Ow(this)}get children(){return this.
543
+ content}get offset(){var e,n;return(n=(e=this.firstNonHiddenNode)===null||e===void 0?void 0:e.offset)!==null&&n!==void 0?n:0}get length(){return this.end-this.offset}get end(){var e,n;return(n=(e=this.lastNonHiddenNode)===null||e===void 0?void 0:e.end)!==null&&n!==void 0?n:0}get range(){const e=this.firstNonHiddenNode,n=this.lastNonHiddenNode;if(e&&n){if(this._rangeCache===void 0){const{range:r}=e,{range:i}=n;this._rangeCache={start:r.start,end:i.end.line<r.start.line?r.start:i.end}}return this.
544
+ _rangeCache}else return{start:ot.create(0,0),end:ot.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 n=this.content[e];if(!n.hidden)return n}return this.content[this.content.length-1]}}class Ow extends Array{constructor(e){super(),this.parent=e,Object.setPrototypeOf(this,Ow.prototype)}push(...e){return this.addParents(e),super.push(...e)}unshift(...e){return this.
545
+ addParents(e),super.unshift(...e)}splice(e,n,...r){return this.addParents(r),super.splice(e,n,...r)}addParents(e){for(const n of e)n.container=this.parent}}class BD extends ey{get text(){return this._text.substring(this.offset,this.end)}get fullText(){return this._text}constructor(e){super(),this._text="",this._text=e??""}}const ty=Symbol("Datatype");function ny(t){return t.$type===ty}const qD="\u200B",jD=t=>t.endsWith(qD)?t:t+qD;class GD{constructor(e){this._unorderedGroups=new Map,this.allRules=
546
+ new Map,this.lexer=e.parser.Lexer;const n=this.lexer.definition,r=e.LanguageMetaData.mode==="production";this.wrapper=new Uq(n,Object.assign(Object.assign({},e.parser.ParserConfig),{skipValidations:r,errorMessageProvider:e.parser.ParserErrorMessageProvider}))}alternatives(e,n){this.wrapper.wrapOr(e,n)}optional(e,n){this.wrapper.wrapOption(e,n)}many(e,n){this.wrapper.wrapMany(e,n)}atLeastOne(e,n){this.wrapper.wrapAtLeastOne(e,n)}getRule(e){return this.allRules.get(e)}isRecording(){return this.wrapper.
547
+ IS_RECORDING}get unorderedGroups(){return this._unorderedGroups}getRuleStack(){return this.wrapper.RULE_STACK}finalize(){this.wrapper.wrapSelfAnalysis()}}class Bq extends GD{get current(){return this.stack[this.stack.length-1]}constructor(e){super(e),this.nodeBuilder=new Mq,this.stack=[],this.assignmentMap=new Map,this.linker=e.references.Linker,this.converter=e.parser.ValueConverter,this.astReflection=e.shared.AstReflection}rule(e,n){const r=this.computeRuleType(e),i=this.wrapper.DEFINE_RULE(jD(
548
+ e.name),this.startImplementation(r,n).bind(this));return this.allRules.set(e.name,i),e.entry&&(this.mainRule=i),i}computeRuleType(e){if(!e.fragment){if(nf(e))return ty;{const n=Ts(e);return n??e.name}}}parse(e,n={}){this.nodeBuilder.buildRootNode(e);const r=this.lexerResult=this.lexer.tokenize(e);this.wrapper.input=r.tokens;const i=n.rule?this.allRules.get(n.rule):this.mainRule;if(!i)throw new Error(n.rule?`No rule found with name '${n.rule}'`:"No main rule available.");const s=i.call(this.wrapper,
549
+ {});return this.nodeBuilder.addHiddenNodes(r.hidden),this.unorderedGroups.clear(),this.lexerResult=void 0,{value:s,lexerErrors:r.errors,lexerReport:r.report,parserErrors:this.wrapper.errors}}startImplementation(e,n){return r=>{const i=!this.isRecording()&&e!==void 0;if(i){const o={$type:e};this.stack.push(o),e===ty&&(o.value="")}let s;try{s=n(r)}catch{s=void 0}return s===void 0&&i&&(s=this.construct()),s}}extractHiddenTokens(e){const n=this.lexerResult.hidden;if(!n.length)return[];const r=e.startOffset;
550
+ for(let i=0;i<n.length;i++)if(n[i].startOffset>r)return n.splice(0,i);return n.splice(0,n.length)}consume(e,n,r){const i=this.wrapper.wrapConsume(e,n);if(!this.isRecording()&&this.isValidToken(i)){const s=this.extractHiddenTokens(i);this.nodeBuilder.addHiddenNodes(s);const o=this.nodeBuilder.buildLeafNode(i,r),{assignment:a,isCrossRef:u}=this.getAssignment(r),c=this.current;if(a){const l=Lr(r)?i.image:this.converter.convert(i.image,o);this.assign(a.operator,a.feature,l,o,u)}else if(ny(c)){let l=i.
551
+ image;Lr(r)||(l=this.converter.convert(l,o).toString()),c.value+=l}}}isValidToken(e){return!e.isInsertedInRecovery&&!isNaN(e.startOffset)&&typeof e.endOffset=="number"&&!isNaN(e.endOffset)}subrule(e,n,r,i,s){let o;!this.isRecording()&&!r&&(o=this.nodeBuilder.buildCompositeNode(i));const a=this.wrapper.wrapSubrule(e,n,s);!this.isRecording()&&o&&o.length>0&&this.performSubruleAssignment(a,i,o)}performSubruleAssignment(e,n,r){const{assignment:i,isCrossRef:s}=this.getAssignment(n);if(i)this.assign(i.
552
+ operator,i.feature,e,r,s);else if(!i){const o=this.current;if(ny(o))o.value+=e.toString();else if(typeof e=="object"&&e){const u=this.assignWithoutOverride(e,o);this.stack.pop(),this.stack.push(u)}}}action(e,n){if(!this.isRecording()){let r=this.current;if(n.feature&&n.operator){r=this.construct(),this.nodeBuilder.removeNode(r.$cstNode),this.nodeBuilder.buildCompositeNode(n).content.push(r.$cstNode);const s={$type:e};this.stack.push(s),this.assign(n.operator,n.feature,r,r.$cstNode,!1)}else r.$type=
553
+ e}}construct(){if(this.isRecording())return;const e=this.current;return Tm(e),this.nodeBuilder.construct(e),this.stack.pop(),ny(e)?this.converter.convert(e.value,e.$cstNode):(Am(this.astReflection,e),e)}getAssignment(e){if(!this.assignmentMap.has(e)){const n=Wn(e,Fr);this.assignmentMap.set(e,{assignment:n,isCrossRef:n?uu(n.terminal):!1})}return this.assignmentMap.get(e)}assign(e,n,r,i,s){const o=this.current;let a;switch(s&&typeof r=="string"?a=this.linker.buildReference(o,n,i,r):a=r,e){case"=":{
554
+ o[n]=a;break}case"?=":{o[n]=!0;break}case"+=":Array.isArray(o[n])||(o[n]=[]),o[n].push(a)}}assignWithoutOverride(e,n){for(const[i,s]of Object.entries(n)){const o=e[i];o===void 0?e[i]=s:Array.isArray(o)&&Array.isArray(s)&&(s.push(...o),e[i]=s)}const r=e.$cstNode;return r&&(r.astNode=void 0,e.$cstNode=void 0),e}get definitionErrors(){return this.wrapper.definitionErrors}}class qq{buildMismatchTokenMessage(e){return Wo.buildMismatchTokenMessage(e)}buildNotAllInputParsedMessage(e){return Wo.buildNotAllInputParsedMessage(
555
+ e)}buildNoViableAltMessage(e){return Wo.buildNoViableAltMessage(e)}buildEarlyExitMessage(e){return Wo.buildEarlyExitMessage(e)}}class UD extends qq{buildMismatchTokenMessage({expected:e,actual:n}){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 \`${n.image}\`.`}buildNotAllInputParsedMessage({firstRedundant:e}){return`Expecting end of file but found \`${e.image}\`.`}}class jq extends GD{constructor(){
556
+ super(...arguments),this.tokens=[],this.elementStack=[],this.lastElementStack=[],this.nextTokenIndex=0,this.stackSize=0}action(){}construct(){}parse(e){this.resetState();const n=this.lexer.tokenize(e,{mode:"partial"});return this.tokens=n.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,n){const r=this.wrapper.DEFINE_RULE(jD(e.name),this.startImplementation(
557
+ n).bind(this));return this.allRules.set(e.name,r),e.entry&&(this.mainRule=r),r}resetState(){this.elementStack=[],this.lastElementStack=[],this.nextTokenIndex=0,this.stackSize=0}startImplementation(e){return n=>{const r=this.keepStackSize();try{e(n)}finally{this.resetStackSize(r)}}}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,n,r){
558
+ this.wrapper.wrapConsume(e,n),this.isRecording()||(this.lastElementStack=[...this.elementStack,r],this.nextTokenIndex=this.currIdx+1)}subrule(e,n,r,i,s){this.before(i),this.wrapper.wrapSubrule(e,n,s),this.after(i)}before(e){this.isRecording()||this.elementStack.push(e)}after(e){if(!this.isRecording()){const n=this.elementStack.lastIndexOf(e);n>=0&&this.elementStack.splice(n)}}get currIdx(){return this.wrapper.currIdx}}const Gq={recoveryEnabled:!0,nodeLocationTracking:"full",skipValidations:!0,errorMessageProvider:new UD};
559
+ class Uq extends YB{constructor(e,n){const r=n&&"maxLookahead"in n;super(e,Object.assign(Object.assign(Object.assign({},Gq),{lookaheadStrategy:r?new Pg({maxLookahead:n.maxLookahead}):new yq({logging:n.skipValidations?()=>{}:void 0})}),n))}get IS_RECORDING(){return this.RECORDING_PHASE}DEFINE_RULE(e,n){return this.RULE(e,n)}wrapSelfAnalysis(){this.performSelfAnalysis()}wrapConsume(e,n){return this.consume(e,n)}wrapSubrule(e,n,r){return this.subrule(e,n,{ARGS:[r]})}wrapOr(e,n){this.or(e,n)}wrapOption(e,n){
560
+ this.option(e,n)}wrapMany(e,n){this.many(e,n)}wrapAtLeastOne(e,n){this.atLeastOne(e,n)}}function WD(t,e,n){return Wq({parser:e,tokens:n,ruleNames:new Map},t),e}function Wq(t,e){const n=Nm(e,!1),r=Xe(e.rules).filter(fn).filter(i=>n.has(i));for(const i of r){const s=Object.assign(Object.assign({},t),{consume:1,optional:1,subrule:1,many:1,or:1});t.parser.rule(i,Fs(s,i.definition))}}function Fs(t,e,n=!1){let r;if(Lr(e))r=Jq(t,e);else if(ks(e))r=zq(t,e);else if(Fr(e))r=Fs(t,e.terminal);else if(uu(e))
561
+ r=zD(t,e);else if(ti(e))r=Hq(t,e);else if(Rm(e))r=Vq(t,e);else if(km(e))r=Xq(t,e);else if(Ui(e))r=Yq(t,e);else if(B1(e)){const i=t.consume++;r=()=>t.parser.consume(i,Ki,e)}else throw new Xb(e.$cstNode,`Unexpected element type: ${e.$type}`);return HD(t,n?void 0:Vf(e),r,e.cardinality)}function zq(t,e){const n=Ru(e);return()=>t.parser.action(n,e)}function Hq(t,e){const n=e.rule.ref;if(fn(n)){const r=t.subrule++,i=n.fragment,s=e.arguments.length>0?Kq(n,e.arguments):()=>({});return o=>t.parser.subrule(
562
+ r,KD(t,n),i,e,s(o))}else if(ei(n)){const r=t.consume++,i=ry(t,n.name);return()=>t.parser.consume(r,i,e)}else if(n)Ga();else throw new Xb(e.$cstNode,`Undefined rule: ${e.rule.$refText}`)}function Kq(t,e){const n=e.map(r=>li(r.value));return r=>{const i={};for(let s=0;s<n.length;s++){const o=t.parameters[s],a=n[s];i[o.name]=a(r)}return i}}function li(t){if(x1(t)){const e=li(t.left),n=li(t.right);return r=>e(r)||n(r)}else if(P1(t)){const e=li(t.left),n=li(t.right);return r=>e(r)&&n(r)}else if(N1(t)){
563
+ const e=li(t.value);return n=>!e(n)}else if(I1(t)){const e=t.parameter.ref.name;return n=>n!==void 0&&n[e]===!0}else if(_1(t)){const e=!!t.true;return()=>e}Ga()}function Vq(t,e){if(e.elements.length===1)return Fs(t,e.elements[0]);{const n=[];for(const i of e.elements){const s={ALT:Fs(t,i,!0)},o=Vf(i);o&&(s.GATE=li(o)),n.push(s)}const r=t.or++;return i=>t.parser.alternatives(r,n.map(s=>{const o={ALT:()=>s.ALT(i)},a=s.GATE;return a&&(o.GATE=()=>a(i)),o}))}}function Xq(t,e){if(e.elements.length===1)
564
+ return Fs(t,e.elements[0]);const n=[];for(const a of e.elements){const u={ALT:Fs(t,a,!0)},c=Vf(a);c&&(u.GATE=li(c)),n.push(u)}const r=t.or++,i=(a,u)=>{const c=u.getRuleStack().join("-");return`uGroup_${a}_${c}`},s=a=>t.parser.alternatives(r,n.map((u,c)=>{const l={ALT:()=>!0},f=t.parser;l.ALT=()=>{if(u.ALT(a),!f.isRecording()){const p=i(r,f);f.unorderedGroups.get(p)||f.unorderedGroups.set(p,[]);const m=f.unorderedGroups.get(p);typeof m?.[c]>"u"&&(m[c]=!0)}};const d=u.GATE;return d?l.GATE=()=>d(a):
565
+ l.GATE=()=>{const p=f.unorderedGroups.get(i(r,f));return!p?.[c]},l})),o=HD(t,Vf(e),s,"*");return a=>{o(a),t.parser.isRecording()||t.parser.unorderedGroups.delete(i(r,t.parser))}}function Yq(t,e){const n=e.elements.map(r=>Fs(t,r));return r=>n.forEach(i=>i(r))}function Vf(t){if(Ui(t))return t.guardCondition}function zD(t,e,n=e.terminal){if(n)if(ti(n)&&fn(n.rule.ref)){const r=n.rule.ref,i=t.subrule++;return s=>t.parser.subrule(i,KD(t,r),!1,e,s)}else if(ti(n)&&ei(n.rule.ref)){const r=t.consume++,i=ry(
566
+ t,n.rule.ref.name);return()=>t.parser.consume(r,i,e)}else if(Lr(n)){const r=t.consume++,i=ry(t,n.value);return()=>t.parser.consume(r,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 r=Mm(e.type.ref),i=r?.terminal;if(!i)throw new Error("Could not find name assignment for type: "+Ru(e.type.ref));return zD(t,e,i)}}function Jq(t,e){const n=t.consume++,r=t.tokens[e.value];if(!r)throw new Error(
567
+ "Could not find token for keyword: "+e.value);return()=>t.parser.consume(n,r,e)}function HD(t,e,n,r){const i=e&&li(e);if(!r)if(i){const s=t.or++;return o=>t.parser.alternatives(s,[{ALT:()=>n(o),GATE:()=>i(o)},{ALT:A$(),GATE:()=>!i(o)}])}else return n;if(r==="*"){const s=t.many++;return o=>t.parser.many(s,{DEF:()=>n(o),GATE:i?()=>i(o):void 0})}else if(r==="+"){const s=t.many++;if(i){const o=t.or++;return a=>t.parser.alternatives(o,[{ALT:()=>t.parser.atLeastOne(s,{DEF:()=>n(a)}),GATE:()=>i(a)},{ALT:A$(),
568
+ GATE:()=>!i(a)}])}else return o=>t.parser.atLeastOne(s,{DEF:()=>n(o)})}else if(r==="?"){const s=t.optional++;return o=>t.parser.optional(s,{DEF:()=>n(o),GATE:i?()=>i(o):void 0})}else Ga()}function KD(t,e){const n=Qq(t,e),r=t.parser.getRule(n);if(!r)throw new Error(`Rule "${n}" not found."`);return r}function Qq(t,e){if(fn(e))return e.name;if(t.ruleNames.has(e))return t.ruleNames.get(e);{let n=e,r=n.$container,i=e.$type;for(;!fn(r);)(Ui(r)||Rm(r)||km(r))&&(i=r.elements.indexOf(n).toString()+":"+i),
569
+ n=r,r=r.$container;return i=r.name+":"+i,t.ruleNames.set(e,i),i}}function ry(t,e){const n=t.tokens[e];if(!n)throw new Error(`Token "${e}" not found."`);return n}function Zq(t){const e=t.Grammar,n=t.parser.Lexer,r=new jq(t);return WD(e,r,n.definition),r.finalize(),r}function ej(t){const e=tj(t);return e.finalize(),e}function tj(t){const e=t.Grammar,n=t.parser.Lexer,r=new Bq(t);return WD(e,r,n.definition)}class nj{constructor(){this.diagnostics=[]}buildTokens(e,n){const r=Xe(Nm(e,!1)),i=this.buildTerminalTokens(
570
+ r),s=this.buildKeywordTokens(r,i,n);return i.forEach(o=>{const a=o.PATTERN;typeof a=="object"&&a&&"test"in a&&xm(a)?s.unshift(o):s.push(o)}),s}flushLexingReport(e){return{diagnostics:this.popDiagnostics()}}popDiagnostics(){const e=[...this.diagnostics];return this.diagnostics=[],e}buildTerminalTokens(e){return e.filter(ei).filter(n=>!n.fragment).map(n=>this.buildTerminalToken(n)).toArray()}buildTerminalToken(e){const n=ku(e),r=this.requiresCustomPattern(n)?this.regexPatternFunction(n):n,i={name:e.
571
+ name,PATTERN:r};return typeof r=="function"&&(i.LINE_BREAKS=!0),e.hidden&&(i.GROUP=xm(n)?Mn.SKIPPED:"hidden"),i}requiresCustomPattern(e){return e.flags.includes("u")||e.flags.includes("s")?!0:!!(e.source.includes("?<=")||e.source.includes("?<!"))}regexPatternFunction(e){const n=new RegExp(e,e.flags+"y");return(r,i)=>(n.lastIndex=i,n.exec(r))}buildKeywordTokens(e,n,r){return e.filter(fn).flatMap(i=>Br(i).filter(Lr)).distinct(i=>i.value).toArray().sort((i,s)=>s.value.length-i.value.length).map(i=>this.
572
+ buildKeywordToken(i,n,!!r?.caseInsensitive))}buildKeywordToken(e,n,r){const i=this.buildKeywordPattern(e,r),s={name:e.value,PATTERN:i,LONGER_ALT:this.findLongerAlt(e,n)};return typeof i=="function"&&(s.LINE_BREAKS=!0),s}buildKeywordPattern(e,n){return n?new RegExp(eN(e.value)):e.value}findLongerAlt(e,n){return n.reduce((r,i)=>{const s=i?.PATTERN;return s?.source&&tN("^"+s.source+"$",e.value)&&r.push(i),r},[])}}class rj{convert(e,n){let r=n.grammarSource;if(uu(r)&&(r=Im(r)),ti(r)){const i=r.rule.
573
+ ref;if(!i)throw new Error("This cst node was not parsed by a rule.");return this.runConverter(i,e,n)}return e}runConverter(e,n,r){var i;switch(e.name.toUpperCase()){case"INT":return di.convertInt(n);case"STRING":return di.convertString(n);case"ID":return di.convertID(n)}switch((i=g0(e))===null||i===void 0?void 0:i.toLowerCase()){case"number":return di.convertNumber(n);case"boolean":return di.convertBoolean(n);case"bigint":return di.convertBigint(n);case"date":return di.convertDate(n);default:return n}}}
574
+ var di;(function(t){function e(c){let l="";for(let f=1;f<c.length-1;f++){const d=c.charAt(f);if(d==="\\"){const p=c.charAt(++f);l+=n(p)}else l+=d}return l}t.convertString=e;function n(c){switch(c){case"b":return"\b";case"f":return"\f";case"n":return`
575
+ `;case"r":return"\r";case"t":return" ";case"v":return"\v";case"0":return"\0";default:return c}}function r(c){return c.charAt(0)==="^"?c.substring(1):c}t.convertID=r;function i(c){return parseInt(c)}t.convertInt=i;function s(c){return BigInt(c)}t.convertBigint=s;function o(c){return new Date(c)}t.convertDate=o;function a(c){return Number(c)}t.convertNumber=a;function u(c){return c.toLowerCase()==="true"}t.convertBoolean=u})(di||(di={}));var Ls={},Xf={},VD;function Ms(){if(VD)return Xf;VD=1,Object.
576
+ defineProperty(Xf,"__esModule",{value:!0});let t;function e(){if(t===void 0)throw new Error("No runtime abstraction layer installed");return t}return function(n){function r(i){if(i===void 0)throw new Error("No runtime abstraction layer provided");t=i}n.install=r}(e||(e={})),Xf.default=e,Xf}var un={},XD;function Ku(){if(XD)return un;XD=1,Object.defineProperty(un,"__esModule",{value:!0}),un.stringArray=un.array=un.func=un.error=un.number=un.string=un.boolean=void 0;function t(a){return a===!0||a===
577
+ !1}un.boolean=t;function e(a){return typeof a=="string"||a instanceof String}un.string=e;function n(a){return typeof a=="number"||a instanceof Number}un.number=n;function r(a){return a instanceof Error}un.error=r;function i(a){return typeof a=="function"}un.func=i;function s(a){return Array.isArray(a)}un.array=s;function o(a){return s(a)&&a.every(u=>e(u))}return un.stringArray=o,un}var Bs={},YD;function Xo(){if(YD)return Bs;YD=1,Object.defineProperty(Bs,"__esModule",{value:!0}),Bs.Emitter=Bs.Event=
578
+ void 0;const t=Ms();var e;(function(i){const s={dispose(){}};i.None=function(){return s}})(e||(Bs.Event=e={}));class n{add(s,o=null,a){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(s),this._contexts.push(o),Array.isArray(a)&&a.push({dispose:()=>this.remove(s,o)})}remove(s,o=null){if(!this._callbacks)return;let a=!1;for(let u=0,c=this._callbacks.length;u<c;u++)if(this._callbacks[u]===s)if(this._contexts[u]===o){this._callbacks.splice(u,1),this._contexts.splice(u,1);
579
+ return}else a=!0;if(a)throw new Error("When adding a listener with a context, you should remove it with the same context")}invoke(...s){if(!this._callbacks)return[];const o=[],a=this._callbacks.slice(0),u=this._contexts.slice(0);for(let c=0,l=a.length;c<l;c++)try{o.push(a[c].apply(u[c],s))}catch(f){(0,t.default)().console.error(f)}return o}isEmpty(){return!this._callbacks||this._callbacks.length===0}dispose(){this._callbacks=void 0,this._contexts=void 0}}class r{constructor(s){this._options=s}get event(){
580
+ return this._event||(this._event=(s,o,a)=>{this._callbacks||(this._callbacks=new n),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(s,o);const u={dispose:()=>{this._callbacks&&(this._callbacks.remove(s,o),u.dispose=r._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(a)&&a.push(u),u}),this._event}fire(s){this._callbacks&&
581
+ this._callbacks.invoke.call(this._callbacks,s)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}}return Bs.Emitter=r,r._noop=function(){},Bs}var JD;function Yf(){if(JD)return Ls;JD=1,Object.defineProperty(Ls,"__esModule",{value:!0}),Ls.CancellationTokenSource=Ls.CancellationToken=void 0;const t=Ms(),e=Ku(),n=Xo();var r;(function(a){a.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:n.Event.None}),a.Cancelled=Object.freeze({isCancellationRequested:!0,
582
+ onCancellationRequested:n.Event.None});function u(c){const l=c;return l&&(l===a.None||l===a.Cancelled||e.boolean(l.isCancellationRequested)&&!!l.onCancellationRequested)}a.is=u})(r||(Ls.CancellationToken=r={}));const i=Object.freeze(function(a,u){const c=(0,t.default)().timer.setTimeout(a.bind(u),0);return{dispose(){c.dispose()}}});class s{constructor(){this._isCancelled=!1}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){
583
+ return this._isCancelled}get onCancellationRequested(){return this._isCancelled?i:(this._emitter||(this._emitter=new n.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}}class o{get token(){return this._token||(this._token=new s),this._token}cancel(){this._token?this._token.cancel():this._token=r.Cancelled}dispose(){this._token?this._token instanceof s&&this._token.dispose():this._token=r.None}}return Ls.CancellationTokenSource=o,Ls}var pt=Yf();
584
+ function ij(){return new Promise(t=>{typeof setImmediate>"u"?setTimeout(t,0):setImmediate(t)})}let Jf=0,sj=10;function oj(){return Jf=performance.now(),new pt.CancellationTokenSource}const Qf=Symbol("OperationCancelled");function Zf(t){return t===Qf}async function jt(t){if(t===pt.CancellationToken.None)return;const e=performance.now();if(e-Jf>=sj&&(Jf=e,await ij(),Jf=performance.now()),t.isCancellationRequested)throw Qf}class iy{constructor(){this.promise=new Promise((e,n)=>{this.resolve=r=>(e(r),
585
+ this),this.reject=r=>(n(r),this)})}}class Cd{constructor(e,n,r,i){this._uri=e,this._languageId=n,this._version=r,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 n=this.offsetAt(e.start),r=this.offsetAt(e.end);return this._content.substring(n,r)}return this._content}update(e,n){for(const r of e)if(Cd.isIncremental(r)){const i=eR(r.range),s=this.offsetAt(i.start),o=this.offsetAt(i.
586
+ end);this._content=this._content.substring(0,s)+r.text+this._content.substring(o,this._content.length);const a=Math.max(i.start.line,0),u=Math.max(i.end.line,0);let c=this._lineOffsets;const l=QD(r.text,!1,s);if(u-a===l.length)for(let d=0,p=l.length;d<p;d++)c[d+a+1]=l[d];else l.length<1e4?c.splice(a+1,u-a,...l):this._lineOffsets=c=c.slice(0,a+1).concat(l,c.slice(u+1));const f=r.text.length-(o-s);if(f!==0)for(let d=a+1+l.length,p=c.length;d<p;d++)c[d]=c[d]+f}else if(Cd.isFull(r))this._content=r.text,
587
+ this._lineOffsets=void 0;else throw new Error("Unknown change event received");this._version=n}getLineOffsets(){return this._lineOffsets===void 0&&(this._lineOffsets=QD(this._content,!0)),this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);const n=this.getLineOffsets();let r=0,i=n.length;if(i===0)return{line:0,character:e};for(;r<i;){const o=Math.floor((r+i)/2);n[o]>e?i=o:r=o+1}const s=r-1;return e=this.ensureBeforeEOL(e,n[s]),{line:s,character:e-n[s]}}offsetAt(e){const n=this.
588
+ getLineOffsets();if(e.line>=n.length)return this._content.length;if(e.line<0)return 0;const r=n[e.line];if(e.character<=0)return r;const i=e.line+1<n.length?n[e.line+1]:this._content.length,s=Math.min(r+e.character,i);return this.ensureBeforeEOL(s,r)}ensureBeforeEOL(e,n){for(;e>n&&ZD(this._content.charCodeAt(e-1));)e--;return e}get lineCount(){return this.getLineOffsets().length}static isIncremental(e){const n=e;return n!=null&&typeof n.text=="string"&&n.range!==void 0&&(n.rangeLength===void 0||
589
+ typeof n.rangeLength=="number")}static isFull(e){const n=e;return n!=null&&typeof n.text=="string"&&n.range===void 0&&n.rangeLength===void 0}}var ep;(function(t){function e(i,s,o,a){return new Cd(i,s,o,a)}t.create=e;function n(i,s,o){if(i instanceof Cd)return i.update(s,o),i;throw new Error("TextDocument.update: document must be created by TextDocument.create")}t.update=n;function r(i,s){const o=i.getText(),a=sy(s.map(aj),(l,f)=>{const d=l.range.start.line-f.range.start.line;return d===0?l.range.
590
+ start.character-f.range.start.character:d});let u=0;const c=[];for(const l of a){const f=i.offsetAt(l.range.start);if(f<u)throw new Error("Overlapping edit");f>u&&c.push(o.substring(u,f)),l.newText.length&&c.push(l.newText),u=i.offsetAt(l.range.end)}return c.push(o.substr(u)),c.join("")}t.applyEdits=r})(ep||(ep={}));function sy(t,e){if(t.length<=1)return t;const n=t.length/2|0,r=t.slice(0,n),i=t.slice(n);sy(r,e),sy(i,e);let s=0,o=0,a=0;for(;s<r.length&&o<i.length;)e(r[s],i[o])<=0?t[a++]=r[s++]:t[a++]=
591
+ i[o++];for(;s<r.length;)t[a++]=r[s++];for(;o<i.length;)t[a++]=i[o++];return t}function QD(t,e,n=0){const r=e?[n]:[];for(let i=0;i<t.length;i++){const s=t.charCodeAt(i);ZD(s)&&(s===13&&i+1<t.length&&t.charCodeAt(i+1)===10&&i++,r.push(n+i+1))}return r}function ZD(t){return t===13||t===10}function eR(t){const e=t.start,n=t.end;return e.line>n.line||e.line===n.line&&e.character>n.character?{start:n,end:e}:t}function aj(t){const e=eR(t.range);return e!==t.range?{newText:t.newText,range:e}:t}var tR;(()=>{
592
+ var t={975:B=>{function T(S){if(typeof S!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(S))}function D(S,P){for(var O,Q="",z=0,C=-1,ne=0,ye=0;ye<=S.length;++ye){if(ye<S.length)O=S.charCodeAt(ye);else{if(O===47)break;O=47}if(O===47){if(!(C===ye-1||ne===1))if(C!==ye-1&&ne===2){if(Q.length<2||z!==2||Q.charCodeAt(Q.length-1)!==46||Q.charCodeAt(Q.length-2)!==46){if(Q.length>2){var xe=Q.lastIndexOf("/");if(xe!==Q.length-1){xe===-1?(Q="",z=0):z=(Q=Q.slice(0,xe)).length-
593
+ 1-Q.lastIndexOf("/"),C=ye,ne=0;continue}}else if(Q.length===2||Q.length===1){Q="",z=0,C=ye,ne=0;continue}}P&&(Q.length>0?Q+="/..":Q="..",z=2)}else Q.length>0?Q+="/"+S.slice(C+1,ye):Q=S.slice(C+1,ye),z=ye-C-1;C=ye,ne=0}else O===46&&ne!==-1?++ne:ne=-1}return Q}var M={resolve:function(){for(var S,P="",O=!1,Q=arguments.length-1;Q>=-1&&!O;Q--){var z;Q>=0?z=arguments[Q]:(S===void 0&&(S=process.cwd()),z=S),T(z),z.length!==0&&(P=z+"/"+P,O=z.charCodeAt(0)===47)}return P=D(P,!O),O?P.length>0?"/"+P:"/":P.length>
594
+ 0?P:"."},normalize:function(S){if(T(S),S.length===0)return".";var P=S.charCodeAt(0)===47,O=S.charCodeAt(S.length-1)===47;return(S=D(S,!P)).length!==0||P||(S="."),S.length>0&&O&&(S+="/"),P?"/"+S:S},isAbsolute:function(S){return T(S),S.length>0&&S.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var S,P=0;P<arguments.length;++P){var O=arguments[P];T(O),O.length>0&&(S===void 0?S=O:S+="/"+O)}return S===void 0?".":M.normalize(S)},relative:function(S,P){if(T(S),T(P),S===P||(S=
595
+ M.resolve(S))===(P=M.resolve(P)))return"";for(var O=1;O<S.length&&S.charCodeAt(O)===47;++O);for(var Q=S.length,z=Q-O,C=1;C<P.length&&P.charCodeAt(C)===47;++C);for(var ne=P.length-C,ye=z<ne?z:ne,xe=-1,L=0;L<=ye;++L){if(L===ye){if(ne>ye){if(P.charCodeAt(C+L)===47)return P.slice(C+L+1);if(L===0)return P.slice(C+L)}else z>ye&&(S.charCodeAt(O+L)===47?xe=L:L===0&&(xe=0));break}var H=S.charCodeAt(O+L);if(H!==P.charCodeAt(C+L))break;H===47&&(xe=L)}var Se="";for(L=O+xe+1;L<=Q;++L)L!==Q&&S.charCodeAt(L)!==
596
+ 47||(Se.length===0?Se+="..":Se+="/..");return Se.length>0?Se+P.slice(C+xe):(C+=xe,P.charCodeAt(C)===47&&++C,P.slice(C))},_makeLong:function(S){return S},dirname:function(S){if(T(S),S.length===0)return".";for(var P=S.charCodeAt(0),O=P===47,Q=-1,z=!0,C=S.length-1;C>=1;--C)if((P=S.charCodeAt(C))===47){if(!z){Q=C;break}}else z=!1;return Q===-1?O?"/":".":O&&Q===1?"//":S.slice(0,Q)},basename:function(S,P){if(P!==void 0&&typeof P!="string")throw new TypeError('"ext" argument must be a string');T(S);var O,
597
+ Q=0,z=-1,C=!0;if(P!==void 0&&P.length>0&&P.length<=S.length){if(P.length===S.length&&P===S)return"";var ne=P.length-1,ye=-1;for(O=S.length-1;O>=0;--O){var xe=S.charCodeAt(O);if(xe===47){if(!C){Q=O+1;break}}else ye===-1&&(C=!1,ye=O+1),ne>=0&&(xe===P.charCodeAt(ne)?--ne==-1&&(z=O):(ne=-1,z=ye))}return Q===z?z=ye:z===-1&&(z=S.length),S.slice(Q,z)}for(O=S.length-1;O>=0;--O)if(S.charCodeAt(O)===47){if(!C){Q=O+1;break}}else z===-1&&(C=!1,z=O+1);return z===-1?"":S.slice(Q,z)},extname:function(S){T(S);for(var P=-1,
598
+ O=0,Q=-1,z=!0,C=0,ne=S.length-1;ne>=0;--ne){var ye=S.charCodeAt(ne);if(ye!==47)Q===-1&&(z=!1,Q=ne+1),ye===46?P===-1?P=ne:C!==1&&(C=1):P!==-1&&(C=-1);else if(!z){O=ne+1;break}}return P===-1||Q===-1||C===0||C===1&&P===Q-1&&P===O+1?"":S.slice(P,Q)},format:function(S){if(S===null||typeof S!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof S);return function(P,O){var Q=O.dir||O.root,z=O.base||(O.name||"")+(O.ext||"");return Q?Q===O.root?Q+z:Q+"/"+
599
+ z:z}(0,S)},parse:function(S){T(S);var P={root:"",dir:"",base:"",ext:"",name:""};if(S.length===0)return P;var O,Q=S.charCodeAt(0),z=Q===47;z?(P.root="/",O=1):O=0;for(var C=-1,ne=0,ye=-1,xe=!0,L=S.length-1,H=0;L>=O;--L)if((Q=S.charCodeAt(L))!==47)ye===-1&&(xe=!1,ye=L+1),Q===46?C===-1?C=L:H!==1&&(H=1):C!==-1&&(H=-1);else if(!xe){ne=L+1;break}return C===-1||ye===-1||H===0||H===1&&C===ye-1&&C===ne+1?ye!==-1&&(P.base=P.name=ne===0&&z?S.slice(1,ye):S.slice(ne,ye)):(ne===0&&z?(P.name=S.slice(1,C),P.base=
600
+ S.slice(1,ye)):(P.name=S.slice(ne,C),P.base=S.slice(ne,ye)),P.ext=S.slice(C,ye)),ne>0?P.dir=S.slice(0,ne-1):z&&(P.dir="/"),P},sep:"/",delimiter:":",win32:null,posix:null};M.posix=M,B.exports=M}},e={};function n(B){var T=e[B];if(T!==void 0)return T.exports;var D=e[B]={exports:{}};return t[B](D,D.exports,n),D.exports}n.d=(B,T)=>{for(var D in T)n.o(T,D)&&!n.o(B,D)&&Object.defineProperty(B,D,{enumerable:!0,get:T[D]})},n.o=(B,T)=>Object.prototype.hasOwnProperty.call(B,T),n.r=B=>{typeof Symbol<"u"&&Symbol.
601
+ toStringTag&&Object.defineProperty(B,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(B,"__esModule",{value:!0})};var r={};let i;n.r(r),n.d(r,{URI:()=>d,Utils:()=>we}),typeof process=="object"?i=process.platform==="win32":typeof navigator=="object"&&(i=navigator.userAgent.indexOf("Windows")>=0);const s=/^\w[\w\d+.-]*$/,o=/^\//,a=/^\/\//;function u(B,T){if(!B.scheme&&T)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${B.authority}", path: "${B.path}", query: "${B.
602
+ query}", fragment: "${B.fragment}"}`);if(B.scheme&&!s.test(B.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(B.path){if(B.authority){if(!o.test(B.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(a.test(B.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}
603
+ const c="",l="/",f=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;class d{static isUri(T){return T instanceof d||!!T&&typeof T.authority=="string"&&typeof T.fragment=="string"&&typeof T.path=="string"&&typeof T.query=="string"&&typeof T.scheme=="string"&&typeof T.fsPath=="string"&&typeof T.with=="function"&&typeof T.toString=="function"}scheme;authority;path;query;fragment;constructor(T,D,M,S,P,O=!1){typeof T=="object"?(this.scheme=T.scheme||c,this.authority=T.authority||c,this.path=
604
+ T.path||c,this.query=T.query||c,this.fragment=T.fragment||c):(this.scheme=function(Q,z){return Q||z?Q:"file"}(T,O),this.authority=D||c,this.path=function(Q,z){switch(Q){case"https":case"http":case"file":z?z[0]!==l&&(z=l+z):z=l}return z}(this.scheme,M||c),this.query=S||c,this.fragment=P||c,u(this,O))}get fsPath(){return E(this)}with(T){if(!T)return this;let{scheme:D,authority:M,path:S,query:P,fragment:O}=T;return D===void 0?D=this.scheme:D===null&&(D=c),M===void 0?M=this.authority:M===null&&(M=c),
605
+ S===void 0?S=this.path:S===null&&(S=c),P===void 0?P=this.query:P===null&&(P=c),O===void 0?O=this.fragment:O===null&&(O=c),D===this.scheme&&M===this.authority&&S===this.path&&P===this.query&&O===this.fragment?this:new m(D,M,S,P,O)}static parse(T,D=!1){const M=f.exec(T);return M?new m(M[2]||c,V(M[4]||c),V(M[5]||c),V(M[7]||c),V(M[9]||c),D):new m(c,c,c,c,c)}static file(T){let D=c;if(i&&(T=T.replace(/\\/g,l)),T[0]===l&&T[1]===l){const M=T.indexOf(l,2);M===-1?(D=T.substring(2),T=l):(D=T.substring(2,M),
606
+ T=T.substring(M)||l)}return new m("file",D,T,c,c)}static from(T){const D=new m(T.scheme,T.authority,T.path,T.query,T.fragment);return u(D,!0),D}toString(T=!1){return R(this,T)}toJSON(){return this}static revive(T){if(T){if(T instanceof d)return T;{const D=new m(T);return D._formatted=T.external,D._fsPath=T._sep===p?T.fsPath:null,D}}return T}}const p=i?1:void 0;class m extends d{_formatted=null;_fsPath=null;get fsPath(){return this._fsPath||(this._fsPath=E(this)),this._fsPath}toString(T=!1){return T?
607
+ R(this,!0):(this._formatted||(this._formatted=R(this,!1)),this._formatted)}toJSON(){const T={$mid:1};return this._fsPath&&(T.fsPath=this._fsPath,T._sep=p),this._formatted&&(T.external=this._formatted),this.path&&(T.path=this.path),this.scheme&&(T.scheme=this.scheme),this.authority&&(T.authority=this.authority),this.query&&(T.query=this.query),this.fragment&&(T.fragment=this.fragment),T}}const v={58:"%3A",47:"%2F",63:"%3F",35:"%23",91:"%5B",93:"%5D",64:"%40",33:"%21",36:"%24",38:"%26",39:"%27",40:"\
608
+ %28",41:"%29",42:"%2A",43:"%2B",44:"%2C",59:"%3B",61:"%3D",32:"%20"};function w(B,T,D){let M,S=-1;for(let P=0;P<B.length;P++){const O=B.charCodeAt(P);if(O>=97&&O<=122||O>=65&&O<=90||O>=48&&O<=57||O===45||O===46||O===95||O===126||T&&O===47||D&&O===91||D&&O===93||D&&O===58)S!==-1&&(M+=encodeURIComponent(B.substring(S,P)),S=-1),M!==void 0&&(M+=B.charAt(P));else{M===void 0&&(M=B.substr(0,P));const Q=v[O];Q!==void 0?(S!==-1&&(M+=encodeURIComponent(B.substring(S,P)),S=-1),M+=Q):S===-1&&(S=P)}}return S!==
609
+ -1&&(M+=encodeURIComponent(B.substring(S))),M!==void 0?M:B}function y(B){let T;for(let D=0;D<B.length;D++){const M=B.charCodeAt(D);M===35||M===63?(T===void 0&&(T=B.substr(0,D)),T+=v[M]):T!==void 0&&(T+=B[D])}return T!==void 0?T:B}function E(B,T){let D;return D=B.authority&&B.path.length>1&&B.scheme==="file"?`//${B.authority}${B.path}`:B.path.charCodeAt(0)===47&&(B.path.charCodeAt(1)>=65&&B.path.charCodeAt(1)<=90||B.path.charCodeAt(1)>=97&&B.path.charCodeAt(1)<=122)&&B.path.charCodeAt(2)===58?B.path[1].
610
+ toLowerCase()+B.path.substr(2):B.path,i&&(D=D.replace(/\//g,"\\")),D}function R(B,T){const D=T?y:w;let M="",{scheme:S,authority:P,path:O,query:Q,fragment:z}=B;if(S&&(M+=S,M+=":"),(P||S==="file")&&(M+=l,M+=l),P){let C=P.indexOf("@");if(C!==-1){const ne=P.substr(0,C);P=P.substr(C+1),C=ne.lastIndexOf(":"),C===-1?M+=D(ne,!1,!1):(M+=D(ne.substr(0,C),!1,!1),M+=":",M+=D(ne.substr(C+1),!1,!0)),M+="@"}P=P.toLowerCase(),C=P.lastIndexOf(":"),C===-1?M+=D(P,!1,!0):(M+=D(P.substr(0,C),!1,!0),M+=P.substr(C))}if(O){
611
+ if(O.length>=3&&O.charCodeAt(0)===47&&O.charCodeAt(2)===58){const C=O.charCodeAt(1);C>=65&&C<=90&&(O=`/${String.fromCharCode(C+32)}:${O.substr(3)}`)}else if(O.length>=2&&O.charCodeAt(1)===58){const C=O.charCodeAt(0);C>=65&&C<=90&&(O=`${String.fromCharCode(C+32)}:${O.substr(2)}`)}M+=D(O,!0,!1)}return Q&&(M+="?",M+=D(Q,!1,!1)),z&&(M+="#",M+=T?z:w(z,!1,!1)),M}function A(B){try{return decodeURIComponent(B)}catch{return B.length>3?B.substr(0,3)+A(B.substr(3)):B}}const N=/(%[0-9A-Za-z][0-9A-Za-z])+/g;
612
+ function V(B){return B.match(N)?B.replace(N,T=>A(T)):B}var J=n(975);const se=J.posix||J,ie="/";var we;(function(B){B.joinPath=function(T,...D){return T.with({path:se.join(T.path,...D)})},B.resolvePath=function(T,...D){let M=T.path,S=!1;M[0]!==ie&&(M=ie+M,S=!0);let P=se.resolve(M,...D);return S&&P[0]===ie&&!T.authority&&(P=P.substring(1)),T.with({path:P})},B.dirname=function(T){if(T.path.length===0||T.path===ie)return T;let D=se.dirname(T.path);return D.length===1&&D.charCodeAt(0)===46&&(D=""),T.
613
+ with({path:D})},B.basename=function(T){return se.basename(T.path)},B.extname=function(T){return se.extname(T.path)}})(we||(we={})),tR=r})();const{URI:yt,Utils:Vu}=tR;var ht;(function(t){t.basename=Vu.basename,t.dirname=Vu.dirname,t.extname=Vu.extname,t.joinPath=Vu.joinPath,t.resolvePath=Vu.resolvePath;const e=typeof process=="object"&&(process==null?void 0:process.platform)==="win32";function n(s,o){return s?.toString()===o?.toString()}t.equals=n;function r(s,o){const a=typeof s=="string"?yt.parse(
614
+ s).path:s.path,u=typeof o=="string"?yt.parse(o).path:o.path,c=a.split("/").filter(m=>m.length>0),l=u.split("/").filter(m=>m.length>0);if(e){const m=/^[A-Z]:$/;if(c[0]&&m.test(c[0])&&(c[0]=c[0].toLowerCase()),l[0]&&m.test(l[0])&&(l[0]=l[0].toLowerCase()),c[0]!==l[0])return u.substring(1)}let f=0;for(;f<c.length&&c[f]===l[f];f++);const d="../".repeat(c.length-f),p=l.slice(f).join("/");return d+p}t.relative=r;function i(s){return yt.parse(s.toString()).toString()}t.normalize=i})(ht||(ht={}));var je;
615
+ (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"})(je||(je={}));class uj{constructor(e){this.serviceRegistry=e.ServiceRegistry,this.textDocuments=e.workspace.TextDocuments,this.fileSystemProvider=e.workspace.FileSystemProvider}async fromUri(e,n=pt.CancellationToken.None){const r=await this.fileSystemProvider.readFile(
616
+ e);return this.createAsync(e,r,n)}fromTextDocument(e,n,r){return n=n??yt.parse(e.uri),pt.CancellationToken.is(r)?this.createAsync(n,e,r):this.create(n,e,r)}fromString(e,n,r){return pt.CancellationToken.is(r)?this.createAsync(n,e,r):this.create(n,e,r)}fromModel(e,n){return this.create(n,{$model:e})}create(e,n,r){if(typeof n=="string"){const i=this.parse(e,n,r);return this.createLangiumDocument(i,e,void 0,n)}else if("$model"in n){const i={value:n.$model,parserErrors:[],lexerErrors:[]};return this.
617
+ createLangiumDocument(i,e)}else{const i=this.parse(e,n.getText(),r);return this.createLangiumDocument(i,e,n)}}async createAsync(e,n,r){if(typeof n=="string"){const i=await this.parseAsync(e,n,r);return this.createLangiumDocument(i,e,void 0,n)}else{const i=await this.parseAsync(e,n.getText(),r);return this.createLangiumDocument(i,e,n)}}createLangiumDocument(e,n,r,i){let s;if(r)s={parseResult:e,uri:n,state:je.Parsed,references:[],textDocument:r};else{const o=this.createTextDocumentGetter(n,i);s={parseResult:e,
618
+ uri:n,state:je.Parsed,references:[],get textDocument(){return o()}}}return e.value.$document=s,s}async update(e,n){var r,i;const s=(r=e.parseResult.value.$cstNode)===null||r===void 0?void 0:r.root.fullText,o=(i=this.textDocuments)===null||i===void 0?void 0:i.get(e.uri.toString()),a=o?o.getText():await this.fileSystemProvider.readFile(e.uri);if(o)Object.defineProperty(e,"textDocument",{value:o});else{const u=this.createTextDocumentGetter(e.uri,a);Object.defineProperty(e,"textDocument",{get:u})}return s!==
619
+ a&&(e.parseResult=await this.parseAsync(e.uri,a,n),e.parseResult.value.$document=e),e.state=je.Parsed,e}parse(e,n,r){return this.serviceRegistry.getServices(e).parser.LangiumParser.parse(n,r)}parseAsync(e,n,r){return this.serviceRegistry.getServices(e).parser.AsyncParser.parse(n,r)}createTextDocumentGetter(e,n){const r=this.serviceRegistry;let i;return()=>i??(i=ep.create(e.toString(),r.getServices(e).LanguageMetaData.languageId,0,n??""))}}class nR{constructor(e){this.documentMap=new Map,this.langiumDocumentFactory=
620
+ e.workspace.LangiumDocumentFactory,this.serviceRegistry=e.ServiceRegistry}get all(){return Xe(this.documentMap.values())}addDocument(e){const n=e.uri.toString();if(this.documentMap.has(n))throw new Error(`A document with the URI '${n}' is already present.`);this.documentMap.set(n,e)}getDocument(e){const n=e.toString();return this.documentMap.get(n)}async getOrCreateDocument(e,n){let r=this.getDocument(e);return r||(r=await this.langiumDocumentFactory.fromUri(e,n),this.addDocument(r),r)}createDocument(e,n,r){
621
+ if(r)return this.langiumDocumentFactory.fromString(n,e,r).then(i=>(this.addDocument(i),i));{const i=this.langiumDocumentFactory.fromString(n,e);return this.addDocument(i),i}}hasDocument(e){return this.documentMap.has(e.toString())}invalidateDocument(e){const n=e.toString(),r=this.documentMap.get(n);return r&&(this.serviceRegistry.getServices(e).references.Linker.unlink(r),r.state=je.Changed,r.precomputedScopes=void 0,r.diagnostics=void 0),r}deleteDocument(e){const n=e.toString(),r=this.documentMap.
622
+ get(n);return r&&(r.state=je.Changed,this.documentMap.delete(n)),r}}const oy=Symbol("ref_resolving");class cj{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,n=pt.CancellationToken.None){for(const r of ni(e.parseResult.value))await jt(n),Xd(r).forEach(i=>this.doLink(i,e))}doLink(e,n){var r;const i=e.reference;if(i._ref===void 0){
623
+ i._ref=oy;try{const s=this.getCandidate(e);if(Fd(s))i._ref=s;else if(i._nodeDescription=s,this.langiumDocuments().hasDocument(s.documentUri)){const o=this.loadAstNode(s);i._ref=o??this.createLinkingError(e,s)}else i._ref=void 0}catch(s){console.error(`An error occurred while resolving reference to '${i.$refText}':`,s);const o=(r=s.message)!==null&&r!==void 0?r:String(s);i._ref=Object.assign(Object.assign({},e),{message:`An error occurred while resolving reference to '${i.$refText}': ${o}`})}n.references.
624
+ push(i)}}unlink(e){for(const n of e.references)delete n._ref,delete n._nodeDescription;e.references=[]}getCandidate(e){const r=this.scopeProvider.getScope(e).getElement(e.reference.$refText);return r??this.createLinkingError(e)}buildReference(e,n,r,i){const s=this,o={$refNode:r,$refText:i,get ref(){var a;if(kt(this._ref))return this._ref;if(b1(this._nodeDescription)){const u=s.loadAstNode(this._nodeDescription);this._ref=u??s.createLinkingError({reference:o,container:e,property:n},this._nodeDescription)}else if(this.
625
+ _ref===void 0){this._ref=oy;const u=Vd(e).$document,c=s.getLinkedNode({reference:o,container:e,property:n});if(c.error&&u&&u.state<je.ComputedScopes)return this._ref=void 0;this._ref=(a=c.node)!==null&&a!==void 0?a:c.error,this._nodeDescription=c.descr,u?.references.push(this)}else if(this._ref===oy)throw new Error(`Cyclic reference resolution detected: ${s.astNodeLocator.getAstNodePath(e)}/${n} (symbol '${i}')`);return kt(this._ref)?this._ref:void 0},get $nodeDescription(){return this._nodeDescription},
626
+ get error(){return Fd(this._ref)?this._ref:void 0}};return o}getLinkedNode(e){var n;try{const r=this.getCandidate(e);if(Fd(r))return{error:r};const i=this.loadAstNode(r);return i?{node:i,descr:r}:{descr:r,error:this.createLinkingError(e,r)}}catch(r){console.error(`An error occurred while resolving reference to '${e.reference.$refText}':`,r);const i=(n=r.message)!==null&&n!==void 0?n:String(r);return{error:Object.assign(Object.assign({},e),{message:`An error occurred while resolving reference to \
627
+ '${e.reference.$refText}': ${i}`})}}}loadAstNode(e){if(e.node)return e.node;const n=this.langiumDocuments().getDocument(e.documentUri);if(n)return this.astNodeLocator.getAstNode(n.parseResult.value,e.path)}createLinkingError(e,n){const r=Vd(e.container).$document;r&&r.state<je.ComputedScopes&&console.warn(`Attempted reference resolution before document reached ComputedScopes state (${r.uri}).`);const i=this.reflection.getReferenceType(e);return Object.assign(Object.assign({},e),{message:`Could n\
628
+ ot resolve reference to ${i} named '${e.reference.$refText}'.`,targetDescription:n})}}function tp(t){return typeof t.name=="string"}class rR{getName(e){if(tp(e))return e.name}getNameNode(e){return pn(e.$cstNode,"name")}}class lj{constructor(e){this.nameProvider=e.references.NameProvider,this.index=e.shared.workspace.IndexManager,this.nodeLocator=e.workspace.AstNodeLocator}findDeclaration(e){if(e){const n=l0(e),r=e.astNode;if(n&&r){const i=r[n.feature];if(rr(i))return i.ref;if(Array.isArray(i)){for(const s of i)
629
+ if(rr(s)&&s.$refNode&&s.$refNode.offset<=e.offset&&s.$refNode.end>=e.end)return s.ref}}if(r){const i=this.nameProvider.getNameNode(r);if(i&&(i===e||D1(e,i)))return r}}}findDeclarationNode(e){const n=this.findDeclaration(e);if(n?.$cstNode){const r=this.nameProvider.getNameNode(n);return r??n.$cstNode}}findReferences(e,n){const r=[];if(n.includeDeclaration){const s=this.getReferenceToSelf(e);s&&r.push(s)}let i=this.index.findAllReferences(e,this.nodeLocator.getAstNodePath(e));return n.documentUri&&
630
+ (i=i.filter(s=>ht.equals(s.sourceUri,n.documentUri))),r.push(...i),Xe(r)}getReferenceToSelf(e){const n=this.nameProvider.getNameNode(e);if(n){const r=at(e),i=this.nodeLocator.getAstNodePath(e);return{sourceUri:r.uri,sourcePath:i,targetUri:r.uri,targetPath:i,segment:Bd(n),local:!0}}}}class qs{constructor(e){if(this.map=new Map,e)for(const[n,r]of e)this.add(n,r)}get size(){return pm.sum(Xe(this.map.values()).map(e=>e.length))}clear(){this.map.clear()}delete(e,n){if(n===void 0)return this.map.delete(
631
+ e);{const r=this.map.get(e);if(r){const i=r.indexOf(n);if(i>=0)return r.length===1?this.map.delete(e):r.splice(i,1),!0}return!1}}get(e){var n;return(n=this.map.get(e))!==null&&n!==void 0?n:[]}has(e,n){if(n===void 0)return this.map.has(e);{const r=this.map.get(e);return r?r.indexOf(n)>=0:!1}}add(e,n){return this.map.has(e)?this.map.get(e).push(n):this.map.set(e,[n]),this}addAll(e,n){return this.map.has(e)?this.map.get(e).push(...n):this.map.set(e,Array.from(n)),this}forEach(e){this.map.forEach((n,r)=>n.
632
+ forEach(i=>e(i,r,this)))}[Symbol.iterator](){return this.entries().iterator()}entries(){return Xe(this.map.entries()).flatMap(([e,n])=>n.map(r=>[e,r]))}keys(){return Xe(this.map.keys())}values(){return Xe(this.map.values()).flat()}entriesGroupedByKey(){return Xe(this.map.entries())}}class iR{get size(){return this.map.size}constructor(e){if(this.map=new Map,this.inverse=new Map,e)for(const[n,r]of e)this.set(n,r)}clear(){this.map.clear(),this.inverse.clear()}set(e,n){return this.map.set(e,n),this.
633
+ inverse.set(n,e),this}get(e){return this.map.get(e)}getKey(e){return this.inverse.get(e)}delete(e){const n=this.map.get(e);return n!==void 0?(this.map.delete(e),this.inverse.delete(n),!0):!1}}class sR{constructor(e){this.nameProvider=e.references.NameProvider,this.descriptions=e.workspace.AstNodeDescriptionProvider}async computeExports(e,n=pt.CancellationToken.None){return this.computeExportsForNode(e.parseResult.value,e,void 0,n)}async computeExportsForNode(e,n,r=Eu,i=pt.CancellationToken.None){
634
+ const s=[];this.exportNode(e,s,n);for(const o of r(e))await jt(i),this.exportNode(o,s,n);return s}exportNode(e,n,r){const i=this.nameProvider.getName(e);i&&n.push(this.descriptions.createDescription(e,i,r))}async computeLocalScopes(e,n=pt.CancellationToken.None){const r=e.parseResult.value,i=new qs;for(const s of Br(r))await jt(n),this.processNode(s,e,i);return i}processNode(e,n,r){const i=e.$container;if(i){const s=this.nameProvider.getName(e);s&&r.add(i,this.descriptions.createDescription(e,s,
635
+ n))}}}class js{constructor(e,n,r){var i;this.elements=e,this.outerScope=n,this.caseInsensitive=(i=r?.caseInsensitive)!==null&&i!==void 0?i:!1}getAllElements(){return this.outerScope?this.elements.concat(this.outerScope.getAllElements()):this.elements}getElement(e){const n=this.caseInsensitive?this.elements.find(r=>r.name.toLowerCase()===e.toLowerCase()):this.elements.find(r=>r.name===e);if(n)return n;if(this.outerScope)return this.outerScope.getElement(e)}}class oR{constructor(e,n,r){var i;this.
636
+ elements=new Map,this.caseInsensitive=(i=r?.caseInsensitive)!==null&&i!==void 0?i:!1;for(const s of e){const o=this.caseInsensitive?s.name.toLowerCase():s.name;this.elements.set(o,s)}this.outerScope=n}getElement(e){const n=this.caseInsensitive?e.toLowerCase():e,r=this.elements.get(n);if(r)return r;if(this.outerScope)return this.outerScope.getElement(e)}getAllElements(){let e=Xe(this.elements.values());return this.outerScope&&(e=e.concat(this.outerScope.getAllElements())),e}}const dj={getElement(){},
637
+ getAllElements(){return ja}};class aR{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 fj extends aR{constructor(){super(...arguments),this.cache=new Map}has(e){return this.throwIfDisposed(),this.cache.has(e)}set(e,n){this.throwIfDisposed(),this.cache.set(e,
638
+ n)}get(e,n){if(this.throwIfDisposed(),this.cache.has(e))return this.cache.get(e);if(n){const r=n();return this.cache.set(e,r),r}else return}delete(e){return this.throwIfDisposed(),this.cache.delete(e)}clear(){this.throwIfDisposed(),this.cache.clear()}}class pj extends aR{constructor(e){super(),this.cache=new Map,this.converter=e??(n=>n)}has(e,n){return this.throwIfDisposed(),this.cacheForContext(e).has(n)}set(e,n,r){this.throwIfDisposed(),this.cacheForContext(e).set(n,r)}get(e,n,r){this.throwIfDisposed();
639
+ const i=this.cacheForContext(e);if(i.has(n))return i.get(n);if(r){const s=r();return i.set(n,s),s}else return}delete(e,n){return this.throwIfDisposed(),this.cacheForContext(e).delete(n)}clear(e){if(this.throwIfDisposed(),e){const n=this.converter(e);this.cache.delete(n)}else this.cache.clear()}cacheForContext(e){const n=this.converter(e);let r=this.cache.get(n);return r||(r=new Map,this.cache.set(n,r)),r}}class np extends fj{constructor(e,n){super(),n?(this.toDispose.push(e.workspace.DocumentBuilder.
640
+ onBuildPhase(n,()=>{this.clear()})),this.toDispose.push(e.workspace.DocumentBuilder.onUpdate((r,i)=>{i.length>0&&this.clear()}))):this.toDispose.push(e.workspace.DocumentBuilder.onUpdate(()=>{this.clear()}))}}class uR{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 np(e.shared)}getScope(e){const n=[],r=this.reflection.
641
+ getReferenceType(e),i=at(e.container).precomputedScopes;if(i){let o=e.container;do{const a=i.get(o);a.length>0&&n.push(Xe(a).filter(u=>this.reflection.isSubtype(u.type,r))),o=o.$container}while(o)}let s=this.getGlobalScope(r,e);for(let o=n.length-1;o>=0;o--)s=this.createScope(n[o],s);return s}createScope(e,n,r){return new js(Xe(e),n,r)}createScopeForNodes(e,n,r){const i=Xe(e).map(s=>{const o=this.nameProvider.getName(s);if(o)return this.descriptions.createDescription(s,o)}).nonNullable();return new js(
642
+ i,n,r)}getGlobalScope(e,n){return this.globalScopeCache.get(e,()=>new oR(this.indexManager.allElements(e)))}}function hj(t){return typeof t.$comment=="string"}function cR(t){return typeof t=="object"&&!!t&&("$ref"in t||"$error"in t)}class mj{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.
643
+ NameProvider,this.commentProvider=e.documentation.CommentProvider}serialize(e,n){const r=n??{},i=n?.replacer,s=(a,u)=>this.replacer(a,u,r),o=i?(a,u)=>i(a,u,s):s;try{return this.currentDocument=at(e),JSON.stringify(e,o,n?.space)}finally{this.currentDocument=void 0}}deserialize(e,n){const r=n??{},i=JSON.parse(e);return this.linkNode(i,i,r),i}replacer(e,n,{refText:r,sourceText:i,textRegions:s,comments:o,uriConverter:a}){var u,c,l,f;if(!this.ignoreProperties.has(e))if(rr(n)){const d=n.ref,p=r?n.$refText:
644
+ void 0;if(d){const m=at(d);let v="";this.currentDocument&&this.currentDocument!==m&&(a?v=a(m.uri,n):v=m.uri.toString());const w=this.astNodeLocator.getAstNodePath(d);return{$ref:`${v}#${w}`,$refText:p}}else return{$error:(c=(u=n.error)===null||u===void 0?void 0:u.message)!==null&&c!==void 0?c:"Could not resolve reference",$refText:p}}else if(kt(n)){let d;if(s&&(d=this.addAstNodeRegionWithAssignmentsTo(Object.assign({},n)),(!e||n.$document)&&d?.$textRegion&&(d.$textRegion.documentURI=(l=this.currentDocument)===
645
+ null||l===void 0?void 0:l.uri.toString())),i&&!e&&(d??(d=Object.assign({},n)),d.$sourceText=(f=n.$cstNode)===null||f===void 0?void 0:f.text),o){d??(d=Object.assign({},n));const p=this.commentProvider.getComment(n);p&&(d.$comment=p.replace(/\r/g,""))}return d??n}else return n}addAstNodeRegionWithAssignmentsTo(e){const n=r=>({offset:r.offset,end:r.end,length:r.length,range:r.range});if(e.$cstNode){const r=e.$textRegion=n(e.$cstNode),i=r.assignments={};return Object.keys(e).filter(s=>!s.startsWith(
646
+ "$")).forEach(s=>{const o=Io(e.$cstNode,s).map(n);o.length!==0&&(i[s]=o)}),e}}linkNode(e,n,r,i,s,o){for(const[u,c]of Object.entries(e))if(Array.isArray(c))for(let l=0;l<c.length;l++){const f=c[l];cR(f)?c[l]=this.reviveReference(e,u,n,f,r):kt(f)&&this.linkNode(f,n,r,e,u,l)}else cR(c)?e[u]=this.reviveReference(e,u,n,c,r):kt(c)&&this.linkNode(c,n,r,e,u);const a=e;a.$container=i,a.$containerProperty=s,a.$containerIndex=o}reviveReference(e,n,r,i,s){let o=i.$refText,a=i.$error;if(i.$ref){const u=this.
647
+ getRefNode(r,i.$ref,s.uriConverter);if(kt(u))return o||(o=this.nameProvider.getName(u)),{$refText:o??"",ref:u};a=u}if(a){const u={$refText:o??""};return u.error={container:e,property:n,message:a,reference:u},u}else return}getRefNode(e,n,r){try{const i=n.indexOf("#");if(i===0){const u=this.astNodeLocator.getAstNode(e,n.substring(1));return u||"Could not resolve path: "+n}if(i<0){const u=r?r(n):yt.parse(n),c=this.langiumDocuments.getDocument(u);return c?c.parseResult.value:"Could not find document\
648
+ for URI: "+n}const s=r?r(n.substring(0,i)):yt.parse(n.substring(0,i)),o=this.langiumDocuments.getDocument(s);if(!o)return"Could not find document for URI: "+n;if(i===n.length-1)return o.parseResult.value;const a=this.astNodeLocator.getAstNode(o.parseResult.value,n.substring(i+1));return a||"Could not resolve URI: "+n}catch(i){return String(i)}}}class gj{get map(){return this.fileExtensionMap}constructor(e){this.languageIdMap=new Map,this.fileExtensionMap=new Map,this.textDocuments=e?.workspace.
649
+ TextDocuments}register(e){const n=e.LanguageMetaData;for(const r of n.fileExtensions)this.fileExtensionMap.has(r)&&console.warn(`The file extension ${r} is used by multiple languages. It is now assigned to '${n.languageId}'.`),this.fileExtensionMap.set(r,e);this.languageIdMap.set(n.languageId,e),this.languageIdMap.size===1?this.singleton=e:this.singleton=void 0}getServices(e){var n,r;if(this.singleton!==void 0)return this.singleton;if(this.languageIdMap.size===0)throw new Error("The service regi\
650
+ stry is empty. Use `register` to register the services of a language.");const i=(r=(n=this.textDocuments)===null||n===void 0?void 0:n.get(e))===null||r===void 0?void 0:r.languageId;if(i!==void 0){const a=this.languageIdMap.get(i);if(a)return a}const s=ht.extname(e),o=this.fileExtensionMap.get(s);if(!o)throw i?new Error(`The service registry contains no services for the extension '${s}' for language '${i}'.`):new Error(`The service registry contains no services for the extension '${s}'.`);return o}hasServices(e){
651
+ try{return this.getServices(e),!0}catch{return!1}}get all(){return Array.from(this.languageIdMap.values())}}function Xu(t){return{code:t}}var rp;(function(t){t.all=["fast","slow","built-in"]})(rp||(rp={}));class yj{constructor(e){this.entries=new qs,this.entriesBefore=[],this.entriesAfter=[],this.reflection=e.shared.AstReflection}register(e,n=this,r="fast"){if(r==="built-in")throw new Error("The 'built-in' category is reserved for lexer, parser, and linker errors.");for(const[i,s]of Object.entries(
652
+ e)){const o=s;if(Array.isArray(o))for(const a of o){const u={check:this.wrapValidationException(a,n),category:r};this.addEntry(i,u)}else if(typeof o=="function"){const a={check:this.wrapValidationException(o,n),category:r};this.addEntry(i,a)}else Ga()}}wrapValidationException(e,n){return async(r,i,s)=>{await this.handleException(()=>e.call(n,r,i,s),"An error occurred during validation",i,r)}}async handleException(e,n,r,i){try{await e()}catch(s){if(Zf(s))throw s;console.error(`${n}:`,s),s instanceof
653
+ Error&&s.stack&&console.error(s.stack);const o=s instanceof Error?s.message:String(s);r("error",`${n}: ${o}`,{node:i})}}addEntry(e,n){if(e==="AstNode"){this.entries.add("AstNode",n);return}for(const r of this.reflection.getAllSubTypes(e))this.entries.add(r,n)}getChecks(e,n){let r=Xe(this.entries.get(e)).concat(this.entries.get("AstNode"));return n&&(r=r.filter(i=>n.includes(i.category))),r.map(i=>i.check)}registerBeforeDocument(e,n=this){this.entriesBefore.push(this.wrapPreparationException(e,"A\
654
+ n error occurred during set-up of the validation",n))}registerAfterDocument(e,n=this){this.entriesAfter.push(this.wrapPreparationException(e,"An error occurred during tear-down of the validation",n))}wrapPreparationException(e,n,r){return async(i,s,o,a)=>{await this.handleException(()=>e.call(r,i,s,o,a),n,s,i)}}get checksBefore(){return this.entriesBefore}get checksAfter(){return this.entriesAfter}}class vj{constructor(e){this.validationRegistry=e.validation.ValidationRegistry,this.metadata=e.LanguageMetaData}async validateDocument(e,n={},r=pt.
655
+ CancellationToken.None){const i=e.parseResult,s=[];if(await jt(r),(!n.categories||n.categories.includes("built-in"))&&(this.processLexingErrors(i,s,n),n.stopAfterLexingErrors&&s.some(o=>{var a;return((a=o.data)===null||a===void 0?void 0:a.code)===Rr.LexingError})||(this.processParsingErrors(i,s,n),n.stopAfterParsingErrors&&s.some(o=>{var a;return((a=o.data)===null||a===void 0?void 0:a.code)===Rr.ParsingError}))||(this.processLinkingErrors(e,s,n),n.stopAfterLinkingErrors&&s.some(o=>{var a;return((a=
656
+ o.data)===null||a===void 0?void 0:a.code)===Rr.LinkingError}))))return s;try{s.push(...await this.validateAst(i.value,n,r))}catch(o){if(Zf(o))throw o;console.error("An error occurred during validation:",o)}return await jt(r),s}processLexingErrors(e,n,r){var i,s,o;const a=[...e.lexerErrors,...(s=(i=e.lexerReport)===null||i===void 0?void 0:i.diagnostics)!==null&&s!==void 0?s:[]];for(const u of a){const c=(o=u.severity)!==null&&o!==void 0?o:"error",l={severity:ay(c),range:{start:{line:u.line-1,character:u.
657
+ column-1},end:{line:u.line-1,character:u.column+u.length-1}},message:u.message,data:bj(c),source:this.getSource()};n.push(l)}}processParsingErrors(e,n,r){for(const i of e.parserErrors){let s;if(isNaN(i.token.startOffset)){if("previousToken"in i){const o=i.previousToken;if(isNaN(o.startOffset)){const a={line:0,character:0};s={start:a,end:a}}else{const a={line:o.endLine-1,character:o.endColumn};s={start:a,end:a}}}}else s=hm(i.token);if(s){const o={severity:ay("error"),range:s,message:i.message,data:Xu(
658
+ Rr.ParsingError),source:this.getSource()};n.push(o)}}}processLinkingErrors(e,n,r){for(const i of e.references){const s=i.error;if(s){const o={node:s.container,property:s.property,index:s.index,data:{code:Rr.LinkingError,containerType:s.container.$type,property:s.property,refText:s.reference.$refText}};n.push(this.toDiagnostic("error",s.message,o))}}}async validateAst(e,n,r=pt.CancellationToken.None){const i=[],s=(o,a,u)=>{i.push(this.toDiagnostic(o,a,u))};return await this.validateAstBefore(e,n,
659
+ s,r),await this.validateAstNodes(e,n,s,r),await this.validateAstAfter(e,n,s,r),i}async validateAstBefore(e,n,r,i=pt.CancellationToken.None){var s;const o=this.validationRegistry.checksBefore;for(const a of o)await jt(i),await a(e,r,(s=n.categories)!==null&&s!==void 0?s:[],i)}async validateAstNodes(e,n,r,i=pt.CancellationToken.None){await Promise.all(ni(e).map(async s=>{await jt(i);const o=this.validationRegistry.getChecks(s.$type,n.categories);for(const a of o)await a(s,r,i)}))}async validateAstAfter(e,n,r,i=pt.
660
+ CancellationToken.None){var s;const o=this.validationRegistry.checksAfter;for(const a of o)await jt(i),await a(e,r,(s=n.categories)!==null&&s!==void 0?s:[],i)}toDiagnostic(e,n,r){return{message:n,range:wj(r),severity:ay(e),code:r.code,codeDescription:r.codeDescription,tags:r.tags,relatedInformation:r.relatedInformation,data:r.data,source:this.getSource()}}getSource(){return this.metadata.languageId}}function wj(t){if(t.range)return t.range;let e;return typeof t.property=="string"?e=pn(t.node.$cstNode,
661
+ t.property,t.index):typeof t.keyword=="string"&&(e=Du(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 ay(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 bj(t){switch(t){case"error":return Xu(Rr.LexingError);case"warning":return Xu(Rr.LexingWarning);case"info":return Xu(Rr.LexingInfo);case"hint":return Xu(
662
+ Rr.LexingHint);default:throw new Error("Invalid diagnostic severity: "+t)}}var Rr;(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"})(Rr||(Rr={}));class lR{constructor(e){this.astNodeLocator=e.workspace.AstNodeLocator,this.nameProvider=e.references.NameProvider}createDescription(e,n,r){const i=r??at(e);n??(n=this.nameProvider.getName(e));const s=this.astNodeLocator.
663
+ getAstNodePath(e);if(!n)throw new Error(`Node at path ${s} has no name.`);let o;const a=()=>{var u;return o??(o=Bd((u=this.nameProvider.getNameNode(e))!==null&&u!==void 0?u:e.$cstNode))};return{node:e,name:n,get nameSegment(){return a()},selectionSegment:Bd(e.$cstNode),type:e.$type,documentUri:i.uri,path:s}}}class Ej{constructor(e){this.nodeLocator=e.workspace.AstNodeLocator}async createDescriptions(e,n=pt.CancellationToken.None){const r=[],i=e.parseResult.value;for(const s of ni(i))await jt(n),
664
+ Xd(s).filter(o=>!Fd(o)).forEach(o=>{const a=this.createDescription(o);a&&r.push(a)});return r}createDescription(e){const n=e.reference.$nodeDescription,r=e.reference.$refNode;if(!n||!r)return;const i=at(e.container).uri;return{sourceUri:i,sourcePath:this.nodeLocator.getAstNodePath(e.container),targetUri:n.documentUri,targetPath:n.path,segment:Bd(r),local:ht.equals(n.documentUri,i)}}}class $j{constructor(){this.segmentSeparator="/",this.indexSeparator="@"}getAstNodePath(e){if(e.$container){const n=this.
665
+ getAstNodePath(e.$container),r=this.getPathSegment(e);return n+this.segmentSeparator+r}return""}getPathSegment({$containerProperty:e,$containerIndex:n}){if(!e)throw new Error("Missing '$containerProperty' in AST node.");return n!==void 0?e+this.indexSeparator+n:e}getAstNode(e,n){return n.split(this.segmentSeparator).reduce((i,s)=>{if(!i||s.length===0)return i;const o=s.indexOf(this.indexSeparator);if(o>0){const a=s.substring(0,o),u=parseInt(s.substring(o+1)),c=i[a];return c?.[u]}return i[s]},e)}}
666
+ var Dj=Xo();class Rj{constructor(e){this._ready=new iy,this.settings={},this.workspaceConfig=!1,this.onConfigurationSectionUpdateEmitter=new Dj.Emitter,this.serviceRegistry=e.ServiceRegistry}get ready(){return this._ready.promise}initialize(e){var n,r;this.workspaceConfig=(r=(n=e.capabilities.workspace)===null||n===void 0?void 0:n.configuration)!==null&&r!==void 0?r:!1}async initialized(e){if(this.workspaceConfig){if(e.register){const n=this.serviceRegistry.all;e.register({section:n.map(r=>this.
667
+ toSectionName(r.LanguageMetaData.languageId))})}if(e.fetchConfiguration){const n=this.serviceRegistry.all.map(i=>({section:this.toSectionName(i.LanguageMetaData.languageId)})),r=await e.fetchConfiguration(n);n.forEach((i,s)=>{this.updateSectionConfiguration(i.section,r[s])})}}this._ready.resolve()}updateConfiguration(e){e.settings&&Object.keys(e.settings).forEach(n=>{const r=e.settings[n];this.updateSectionConfiguration(n,r),this.onConfigurationSectionUpdateEmitter.fire({section:n,configuration:r})})}updateSectionConfiguration(e,n){
668
+ this.settings[e]=n}async getConfiguration(e,n){await this.ready;const r=this.toSectionName(e);if(this.settings[r])return this.settings[r][n]}toSectionName(e){return`${e}`}get onConfigurationSectionUpdate(){return this.onConfigurationSectionUpdateEmitter.event}}var Gs;(function(t){function e(n){return{dispose:async()=>await n()}}t.create=e})(Gs||(Gs={}));class kj{constructor(e){this.updateBuildOptions={validation:{categories:["built-in","fast"]}},this.updateListeners=[],this.buildPhaseListeners=new qs,
669
+ this.documentPhaseListeners=new qs,this.buildState=new Map,this.documentBuildWaiters=new Map,this.currentState=je.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,n={},r=pt.CancellationToken.None){var i,s;for(const o of e){const a=o.uri.toString();if(o.state===je.Validated){if(typeof n.
670
+ validation=="boolean"&&n.validation)o.state=je.IndexedReferences,o.diagnostics=void 0,this.buildState.delete(a);else if(typeof n.validation=="object"){const u=this.buildState.get(a),c=(i=u?.result)===null||i===void 0?void 0:i.validationChecks;if(c){const f=((s=n.validation.categories)!==null&&s!==void 0?s:rp.all).filter(d=>!c.includes(d));f.length>0&&(this.buildState.set(a,{completed:!1,options:{validation:Object.assign(Object.assign({},n.validation),{categories:f})},result:u.result}),o.state=je.
671
+ IndexedReferences)}}}else this.buildState.delete(a)}this.currentState=je.Changed,await this.emitUpdate(e.map(o=>o.uri),[]),await this.buildDocuments(e,n,r)}async update(e,n,r=pt.CancellationToken.None){this.currentState=je.Changed;for(const o of n)this.langiumDocuments.deleteDocument(o),this.buildState.delete(o.toString()),this.indexManager.remove(o);for(const o of e){if(!this.langiumDocuments.invalidateDocument(o)){const u=this.langiumDocumentFactory.fromModel({$type:"INVALID"},o);u.state=je.Changed,
672
+ this.langiumDocuments.addDocument(u)}this.buildState.delete(o.toString())}const i=Xe(e).concat(n).map(o=>o.toString()).toSet();this.langiumDocuments.all.filter(o=>!i.has(o.uri.toString())&&this.shouldRelink(o,i)).forEach(o=>{this.serviceRegistry.getServices(o.uri).references.Linker.unlink(o),o.state=Math.min(o.state,je.ComputedScopes),o.diagnostics=void 0}),await this.emitUpdate(e,n),await jt(r);const s=this.sortDocuments(this.langiumDocuments.all.filter(o=>{var a;return o.state<je.Linked||!(!((a=
673
+ this.buildState.get(o.uri.toString()))===null||a===void 0)&&a.completed)}).toArray());await this.buildDocuments(s,this.updateBuildOptions,r)}async emitUpdate(e,n){await Promise.all(this.updateListeners.map(r=>r(e,n)))}sortDocuments(e){let n=0,r=e.length-1;for(;n<r;){for(;n<e.length&&this.hasTextDocument(e[n]);)n++;for(;r>=0&&!this.hasTextDocument(e[r]);)r--;n<r&&([e[n],e[r]]=[e[r],e[n]])}return e}hasTextDocument(e){var n;return!!(!((n=this.textDocuments)===null||n===void 0)&&n.get(e.uri))}shouldRelink(e,n){
674
+ return e.references.some(r=>r.error!==void 0)?!0:this.indexManager.isAffected(e,n)}onUpdate(e){return this.updateListeners.push(e),Gs.create(()=>{const n=this.updateListeners.indexOf(e);n>=0&&this.updateListeners.splice(n,1)})}async buildDocuments(e,n,r){this.prepareBuild(e,n),await this.runCancelable(e,je.Parsed,r,s=>this.langiumDocumentFactory.update(s,r)),await this.runCancelable(e,je.IndexedContent,r,s=>this.indexManager.updateContent(s,r)),await this.runCancelable(e,je.ComputedScopes,r,async s=>{
675
+ const o=this.serviceRegistry.getServices(s.uri).references.ScopeComputation;s.precomputedScopes=await o.computeLocalScopes(s,r)}),await this.runCancelable(e,je.Linked,r,s=>this.serviceRegistry.getServices(s.uri).references.Linker.link(s,r)),await this.runCancelable(e,je.IndexedReferences,r,s=>this.indexManager.updateReferences(s,r));const i=e.filter(s=>this.shouldValidate(s));await this.runCancelable(i,je.Validated,r,s=>this.validate(s,r));for(const s of e){const o=this.buildState.get(s.uri.toString());
676
+ o&&(o.completed=!0)}}prepareBuild(e,n){for(const r of e){const i=r.uri.toString(),s=this.buildState.get(i);(!s||s.completed)&&this.buildState.set(i,{completed:!1,options:n,result:s?.result})}}async runCancelable(e,n,r,i){const s=e.filter(a=>a.state<n);for(const a of s)await jt(r),await i(a),a.state=n,await this.notifyDocumentPhase(a,n,r);const o=e.filter(a=>a.state===n);await this.notifyBuildPhase(o,n,r),this.currentState=n}onBuildPhase(e,n){return this.buildPhaseListeners.add(e,n),Gs.create(()=>{
677
+ this.buildPhaseListeners.delete(e,n)})}onDocumentPhase(e,n){return this.documentPhaseListeners.add(e,n),Gs.create(()=>{this.documentPhaseListeners.delete(e,n)})}waitUntil(e,n,r){let i;if(n&&"path"in n?i=n:r=n,r??(r=pt.CancellationToken.None),i){const s=this.langiumDocuments.getDocument(i);if(s&&s.state>e)return Promise.resolve(i)}return this.currentState>=e?Promise.resolve(void 0):r.isCancellationRequested?Promise.reject(Qf):new Promise((s,o)=>{const a=this.onBuildPhase(e,()=>{if(a.dispose(),u.dispose(),
678
+ i){const c=this.langiumDocuments.getDocument(i);s(c?.uri)}else s(void 0)}),u=r.onCancellationRequested(()=>{a.dispose(),u.dispose(),o(Qf)})})}async notifyDocumentPhase(e,n,r){const s=this.documentPhaseListeners.get(n).slice();for(const o of s)try{await o(e,r)}catch(a){if(!Zf(a))throw a}}async notifyBuildPhase(e,n,r){if(e.length===0)return;const s=this.buildPhaseListeners.get(n).slice();for(const o of s)await jt(r),await o(e,r)}shouldValidate(e){return!!this.getBuildOptions(e).validation}async validate(e,n){
679
+ var r,i;const s=this.serviceRegistry.getServices(e.uri).validation.DocumentValidator,o=this.getBuildOptions(e).validation,a=typeof o=="object"?o:void 0,u=await s.validateDocument(e,a,n);e.diagnostics?e.diagnostics.push(...u):e.diagnostics=u;const c=this.buildState.get(e.uri.toString());if(c){(r=c.result)!==null&&r!==void 0||(c.result={});const l=(i=a?.categories)!==null&&i!==void 0?i:rp.all;c.result.validationChecks?c.result.validationChecks.push(...l):c.result.validationChecks=[...l]}}getBuildOptions(e){
680
+ var n,r;return(r=(n=this.buildState.get(e.uri.toString()))===null||n===void 0?void 0:n.options)!==null&&r!==void 0?r:{}}}class dR{constructor(e){this.symbolIndex=new Map,this.symbolByTypeIndex=new pj,this.referenceIndex=new Map,this.documents=e.workspace.LangiumDocuments,this.serviceRegistry=e.ServiceRegistry,this.astReflection=e.AstReflection}findAllReferences(e,n){const r=at(e).uri,i=[];return this.referenceIndex.forEach(s=>{s.forEach(o=>{ht.equals(o.targetUri,r)&&o.targetPath===n&&i.push(o)})}),
681
+ Xe(i)}allElements(e,n){let r=Xe(this.symbolIndex.keys());return n&&(r=r.filter(i=>!n||n.has(i))),r.map(i=>this.getFileDescriptions(i,e)).flat()}getFileDescriptions(e,n){var r;return n?this.symbolByTypeIndex.get(e,n,()=>{var s;return((s=this.symbolIndex.get(e))!==null&&s!==void 0?s:[]).filter(a=>this.astReflection.isSubtype(a.type,n))}):(r=this.symbolIndex.get(e))!==null&&r!==void 0?r:[]}remove(e){const n=e.toString();this.symbolIndex.delete(n),this.symbolByTypeIndex.clear(n),this.referenceIndex.
682
+ delete(n)}async updateContent(e,n=pt.CancellationToken.None){const i=await this.serviceRegistry.getServices(e.uri).references.ScopeComputation.computeExports(e,n),s=e.uri.toString();this.symbolIndex.set(s,i),this.symbolByTypeIndex.clear(s)}async updateReferences(e,n=pt.CancellationToken.None){const i=await this.serviceRegistry.getServices(e.uri).workspace.ReferenceDescriptionProvider.createDescriptions(e,n);this.referenceIndex.set(e.uri.toString(),i)}isAffected(e,n){const r=this.referenceIndex.get(
683
+ e.uri.toString());return r?r.some(i=>!i.local&&n.has(i.targetUri.toString())):!1}}class fR{constructor(e){this.initialBuildOptions={},this._ready=new iy,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 n;this.folders=(n=
684
+ e.workspaceFolders)!==null&&n!==void 0?n:void 0}initialized(e){return this.mutex.write(n=>{var r;return this.initializeWorkspace((r=this.folders)!==null&&r!==void 0?r:[],n)})}async initializeWorkspace(e,n=pt.CancellationToken.None){const r=await this.performStartup(e);await jt(n),await this.documentBuilder.build(r,this.initialBuildOptions,n)}async performStartup(e){const n=this.serviceRegistry.all.flatMap(s=>s.LanguageMetaData.fileExtensions),r=[],i=s=>{r.push(s),this.langiumDocuments.hasDocument(
685
+ s.uri)||this.langiumDocuments.addDocument(s)};return await this.loadAdditionalDocuments(e,i),await Promise.all(e.map(s=>[s,this.getRootFolder(s)]).map(async s=>this.traverseFolder(...s,n,i))),this._ready.resolve(),r}loadAdditionalDocuments(e,n){return Promise.resolve()}getRootFolder(e){return yt.parse(e.uri)}async traverseFolder(e,n,r,i){const s=await this.fileSystemProvider.readDirectory(n);await Promise.all(s.map(async o=>{if(this.includeEntry(e,o,r)){if(o.isDirectory)await this.traverseFolder(
686
+ e,o.uri,r,i);else if(o.isFile){const a=await this.langiumDocuments.getOrCreateDocument(o.uri);i(a)}}}))}includeEntry(e,n,r){const i=ht.basename(n.uri);if(i.startsWith("."))return!1;if(n.isDirectory)return i!=="node_modules"&&i!=="out";if(n.isFile){const s=ht.extname(n.uri);return r.includes(s)}return!1}}class Tj{buildUnexpectedCharactersMessage(e,n,r,i,s){return wg.buildUnexpectedCharactersMessage(e,n,r,i,s)}buildUnableToPopLexerModeMessage(e){return wg.buildUnableToPopLexerModeMessage(e)}}const Cj={
687
+ mode:"full"};class Aj{constructor(e){this.errorMessageProvider=e.parser.LexerErrorMessageProvider,this.tokenBuilder=e.parser.TokenBuilder;const n=this.tokenBuilder.buildTokens(e.Grammar,{caseInsensitive:e.LanguageMetaData.caseInsensitive});this.tokenTypes=this.toTokenTypeDictionary(n);const r=hR(n)?Object.values(n):n,i=e.LanguageMetaData.mode==="production";this.chevrotainLexer=new Mn(r,{positionTracking:"full",skipValidations:i,errorMessageProvider:this.errorMessageProvider})}get definition(){return this.
688
+ tokenTypes}tokenize(e,n=Cj){var r,i,s;const o=this.chevrotainLexer.tokenize(e);return{tokens:o.tokens,errors:o.errors,hidden:(r=o.groups.hidden)!==null&&r!==void 0?r:[],report:(s=(i=this.tokenBuilder).flushLexingReport)===null||s===void 0?void 0:s.call(i,e)}}toTokenTypeDictionary(e){if(hR(e))return e;const n=pR(e)?Object.values(e.modes).flat():e,r={};return n.forEach(i=>r[i.name]=i),r}}function Sj(t){return Array.isArray(t)&&(t.length===0||"name"in t[0])}function pR(t){return t&&"modes"in t&&"de\
689
+ faultMode"in t}function hR(t){return!Sj(t)&&!pR(t)}function _j(t,e,n){let r,i;typeof t=="string"?(i=e,r=n):(i=t.range.start,r=e),i||(i=ot.create(0,0));const s=mR(t),o=cy(r),a=Nj({lines:s,position:i,options:o});return Mj({index:0,tokens:a,position:i})}function Pj(t,e){const n=cy(e),r=mR(t);if(r.length===0)return!1;const i=r[0],s=r[r.length-1],o=n.start,a=n.end;return!!o?.exec(i)&&!!a?.exec(s)}function mR(t){let e="";return typeof t=="string"?e=t:e=t.text,e.split(o0)}const gR=/\s*(@([\p{L}][\p{L}\p{N}]*)?)/uy,
690
+ xj=/\{(@[\p{L}][\p{L}\p{N}]*)(\s*)([^\r\n}]+)?\}/gu;function Nj(t){var e,n,r;const i=[];let s=t.position.line,o=t.position.character;for(let a=0;a<t.lines.length;a++){const u=a===0,c=a===t.lines.length-1;let l=t.lines[a],f=0;if(u&&t.options.start){const p=(e=t.options.start)===null||e===void 0?void 0:e.exec(l);p&&(f=p.index+p[0].length)}else{const p=(n=t.options.line)===null||n===void 0?void 0:n.exec(l);p&&(f=p.index+p[0].length)}if(c){const p=(r=t.options.end)===null||r===void 0?void 0:r.exec(l);
691
+ p&&(l=l.substring(0,p.index))}if(l=l.substring(0,Lj(l)),uy(l,f)>=l.length){if(i.length>0){const p=ot.create(s,o);i.push({type:"break",content:"",range:Ye.create(p,p)})}}else{gR.lastIndex=f;const p=gR.exec(l);if(p){const m=p[0],v=p[1],w=ot.create(s,o+f),y=ot.create(s,o+f+m.length);i.push({type:"tag",content:v,range:Ye.create(w,y)}),f+=m.length,f=uy(l,f)}if(f<l.length){const m=l.substring(f),v=Array.from(m.matchAll(xj));i.push(...Ij(v,m,s,o+f))}}s++,o=0}return i.length>0&&i[i.length-1].type==="bre\
692
+ ak"?i.slice(0,-1):i}function Ij(t,e,n,r){const i=[];if(t.length===0){const s=ot.create(n,r),o=ot.create(n,r+e.length);i.push({type:"text",content:e,range:Ye.create(s,o)})}else{let s=0;for(const a of t){const u=a.index,c=e.substring(s,u);c.length>0&&i.push({type:"text",content:e.substring(s,u),range:Ye.create(ot.create(n,s+r),ot.create(n,u+r))});let l=c.length+1;const f=a[1];if(i.push({type:"inline-tag",content:f,range:Ye.create(ot.create(n,s+l+r),ot.create(n,s+l+f.length+r))}),l+=f.length,a.length===
693
+ 4){l+=a[2].length;const d=a[3];i.push({type:"text",content:d,range:Ye.create(ot.create(n,s+l+r),ot.create(n,s+l+d.length+r))})}else i.push({type:"text",content:"",range:Ye.create(ot.create(n,s+l+r),ot.create(n,s+l+r))});s=u+a[0].length}const o=e.substring(s);o.length>0&&i.push({type:"text",content:o,range:Ye.create(ot.create(n,s+r),ot.create(n,s+r+o.length))})}return i}const Oj=/\S/,Fj=/\s*$/;function uy(t,e){const n=t.substring(e).match(Oj);return n?e+n.index:t.length}function Lj(t){const e=t.match(
694
+ Fj);if(e&&typeof e.index=="number")return e.index}function Mj(t){var e,n,r,i;const s=ot.create(t.position.line,t.position.character);if(t.tokens.length===0)return new bR([],Ye.create(s,s));const o=[];for(;t.index<t.tokens.length;){const c=Bj(t,o[o.length-1]);c&&o.push(c)}const a=(n=(e=o[0])===null||e===void 0?void 0:e.range.start)!==null&&n!==void 0?n:s,u=(i=(r=o[o.length-1])===null||r===void 0?void 0:r.range.end)!==null&&i!==void 0?i:s;return new bR(o,Ye.create(a,u))}function Bj(t,e){const n=t.
695
+ tokens[t.index];if(n.type==="tag")return vR(t,!1);if(n.type==="text"||n.type==="inline-tag")return yR(t);qj(n,e),t.index++}function qj(t,e){if(e){const n=new ER("",t.range);"inlines"in e?e.inlines.push(n):e.content.inlines.push(n)}}function yR(t){let e=t.tokens[t.index];const n=e;let r=e;const i=[];for(;e&&e.type!=="break"&&e.type!=="tag";)i.push(jj(t)),r=e,e=t.tokens[t.index];return new fy(i,Ye.create(n.range.start,r.range.end))}function jj(t){return t.tokens[t.index].type==="inline-tag"?vR(t,!0):
696
+ wR(t)}function vR(t,e){const n=t.tokens[t.index++],r=n.content.substring(1),i=t.tokens[t.index];if(i?.type==="text")if(e){const s=wR(t);return new dy(r,new fy([s],s.range),e,Ye.create(n.range.start,s.range.end))}else{const s=yR(t);return new dy(r,s,e,Ye.create(n.range.start,s.range.end))}else{const s=n.range;return new dy(r,new fy([],s),e,s)}}function wR(t){const e=t.tokens[t.index++];return new ER(e.content,e.range)}function cy(t){if(!t)return cy({start:"/**",end:"*/",line:"*"});const{start:e,end:n,
697
+ line:r}=t;return{start:ly(e,!0),end:ly(n,!1),line:ly(r,!0)}}function ly(t,e){if(typeof t=="string"||typeof t=="object"){const n=typeof t=="string"?ef(t):t.source;return e?new RegExp(`^\\s*${n}`):new RegExp(`\\s*${n}\\s*$`)}else return t}class bR{constructor(e,n){this.elements=e,this.range=n}getTag(e){return this.getAllTags().find(n=>n.name===e)}getTags(e){return this.getAllTags().filter(n=>n.name===e)}getAllTags(){return this.elements.filter(e=>"name"in e)}toString(){let e="";for(const n of this.
698
+ elements)if(e.length===0)e=n.toString();else{const r=n.toString();e+=$R(e)+r}return e.trim()}toMarkdown(e){let n="";for(const r of this.elements)if(n.length===0)n=r.toMarkdown(e);else{const i=r.toMarkdown(e);n+=$R(n)+i}return n.trim()}}class dy{constructor(e,n,r,i){this.name=e,this.content=n,this.inline=r,this.range=i}toString(){let e=`@${this.name}`;const n=this.content.toString();return this.content.inlines.length===1?e=`${e} ${n}`:this.content.inlines.length>1&&(e=`${e}
699
+ ${n}`),this.inline?`{${e}}`:e}toMarkdown(e){var n,r;return(r=(n=e?.renderTag)===null||n===void 0?void 0:n.call(e,this))!==null&&r!==void 0?r:this.toMarkdownDefault(e)}toMarkdownDefault(e){const n=this.content.toMarkdown(e);if(this.inline){const s=Gj(this.name,n,e??{});if(typeof s=="string")return s}let r="";e?.tag==="italic"||e?.tag===void 0?r="*":e?.tag==="bold"?r="**":e?.tag==="bold-italic"&&(r="***");let i=`${r}@${this.name}${r}`;return this.content.inlines.length===1?i=`${i} \u2014 ${n}`:this.
700
+ content.inlines.length>1&&(i=`${i}
701
+ ${n}`),this.inline?`{${i}}`:i}}function Gj(t,e,n){var r,i;if(t==="linkplain"||t==="linkcode"||t==="link"){const s=e.indexOf(" ");let o=e;if(s>0){const u=uy(e,s);o=e.substring(u),e=e.substring(0,s)}return(t==="linkcode"||t==="link"&&n.link==="code")&&(o=`\`${o}\``),(i=(r=n.renderLink)===null||r===void 0?void 0:r.call(n,e,o))!==null&&i!==void 0?i:Uj(e,o)}}function Uj(t,e){try{return yt.parse(t,!0),`[${e}](${t})`}catch{return t}}class fy{constructor(e,n){this.inlines=e,this.range=n}toString(){let e="";
702
+ for(let n=0;n<this.inlines.length;n++){const r=this.inlines[n],i=this.inlines[n+1];e+=r.toString(),i&&i.range.start.line>r.range.start.line&&(e+=`
703
+ `)}return e}toMarkdown(e){let n="";for(let r=0;r<this.inlines.length;r++){const i=this.inlines[r],s=this.inlines[r+1];n+=i.toMarkdown(e),s&&s.range.start.line>i.range.start.line&&(n+=`
704
+ `)}return n}}class ER{constructor(e,n){this.text=e,this.range=n}toString(){return this.text}toMarkdown(){return this.text}}function $R(t){return t.endsWith(`
705
+ `)?`
706
+ `:`
707
+
708
+ `}class Wj{constructor(e){this.indexManager=e.shared.workspace.IndexManager,this.commentProvider=e.documentation.CommentProvider}getDocumentation(e){const n=this.commentProvider.getComment(e);if(n&&Pj(n))return _j(n).toMarkdown({renderLink:(i,s)=>this.documentationLinkRenderer(e,i,s),renderTag:i=>this.documentationTagRenderer(e,i)})}documentationLinkRenderer(e,n,r){var i;const s=(i=this.findNameInPrecomputedScopes(e,n))!==null&&i!==void 0?i:this.findNameInGlobalScope(e,n);if(s&&s.nameSegment){const o=s.
709
+ nameSegment.range.start.line+1,a=s.nameSegment.range.start.character+1,u=s.documentUri.with({fragment:`L${o},${a}`});return`[${r}](${u.toString()})`}else return}documentationTagRenderer(e,n){}findNameInPrecomputedScopes(e,n){const i=at(e).precomputedScopes;if(!i)return;let s=e;do{const a=i.get(s).find(u=>u.name===n);if(a)return a;s=s.$container}while(s)}findNameInGlobalScope(e,n){return this.indexManager.allElements().find(i=>i.name===n)}}class zj{constructor(e){this.grammarConfig=()=>e.parser.GrammarConfig}getComment(e){
710
+ var n;return hj(e)?e.$comment:(n=mm(e.$cstNode,this.grammarConfig().multilineCommentRules))===null||n===void 0?void 0:n.text}}class Hj{constructor(e){this.syncParser=e.parser.LangiumParser}parse(e,n){return Promise.resolve(this.syncParser.parse(e))}}class Kj{constructor(){this.previousTokenSource=new pt.CancellationTokenSource,this.writeQueue=[],this.readQueue=[],this.done=!0}write(e){this.cancelWrite();const n=oj();return this.previousTokenSource=n,this.enqueue(this.writeQueue,e,n.token)}read(e){
711
+ return this.enqueue(this.readQueue,e)}enqueue(e,n,r=pt.CancellationToken.None){const i=new iy,s={action:n,deferred:i,cancellationToken:r};return e.push(s),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:n,deferred:r,cancellationToken:i})=>{
712
+ try{const s=await Promise.resolve().then(()=>n(i));r.resolve(s)}catch(s){Zf(s)?r.resolve(void 0):r.reject(s)}})),this.done=!0,this.performNextOperation()}cancelWrite(){this.previousTokenSource.cancel()}}class Vj{constructor(e){this.grammarElementIdMap=new iR,this.tokenTypeIdMap=new iR,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.
713
+ parserErrors.map(n=>Object.assign(Object.assign({},n),{message:n.message})),value:this.dehydrateAstNode(e.value,this.createDehyrationContext(e.value))}}dehydrateLexerReport(e){return e}createDehyrationContext(e){const n=new Map,r=new Map;for(const i of ni(e))n.set(i,{});if(e.$cstNode)for(const i of Md(e.$cstNode))r.set(i,{});return{astNodes:n,cstNodes:r}}dehydrateAstNode(e,n){const r=n.astNodes.get(e);r.$type=e.$type,r.$containerIndex=e.$containerIndex,r.$containerProperty=e.$containerProperty,e.
714
+ $cstNode!==void 0&&(r.$cstNode=this.dehydrateCstNode(e.$cstNode,n));for(const[i,s]of Object.entries(e))if(!i.startsWith("$"))if(Array.isArray(s)){const o=[];r[i]=o;for(const a of s)kt(a)?o.push(this.dehydrateAstNode(a,n)):rr(a)?o.push(this.dehydrateReference(a,n)):o.push(a)}else kt(s)?r[i]=this.dehydrateAstNode(s,n):rr(s)?r[i]=this.dehydrateReference(s,n):s!==void 0&&(r[i]=s);return r}dehydrateReference(e,n){const r={};return r.$refText=e.$refText,e.$refNode&&(r.$refNode=n.cstNodes.get(e.$refNode)),
715
+ r}dehydrateCstNode(e,n){const r=n.cstNodes.get(e);return Gb(e)?r.fullText=e.fullText:r.grammarSource=this.getGrammarElementId(e.grammarSource),r.hidden=e.hidden,r.astNode=n.astNodes.get(e.astNode),Gi(e)?r.content=e.content.map(i=>this.dehydrateCstNode(i,n)):Ds(e)&&(r.tokenType=e.tokenType.name,r.offset=e.offset,r.length=e.length,r.startLine=e.range.start.line,r.startColumn=e.range.start.character,r.endLine=e.range.end.line,r.endColumn=e.range.end.character),r}hydrate(e){const n=e.value,r=this.createHydrationContext(
716
+ n);return"$cstNode"in n&&this.hydrateCstNode(n.$cstNode,r),{lexerErrors:e.lexerErrors,lexerReport:e.lexerReport,parserErrors:e.parserErrors,value:this.hydrateAstNode(n,r)}}createHydrationContext(e){const n=new Map,r=new Map;for(const s of ni(e))n.set(s,{});let i;if(e.$cstNode)for(const s of Md(e.$cstNode)){let o;"fullText"in s?(o=new BD(s.fullText),i=o):"content"in s?o=new ey:"tokenType"in s&&(o=this.hydrateCstLeafNode(s)),o&&(r.set(s,o),o.root=i)}return{astNodes:n,cstNodes:r}}hydrateAstNode(e,n){
717
+ const r=n.astNodes.get(e);r.$type=e.$type,r.$containerIndex=e.$containerIndex,r.$containerProperty=e.$containerProperty,e.$cstNode&&(r.$cstNode=n.cstNodes.get(e.$cstNode));for(const[i,s]of Object.entries(e))if(!i.startsWith("$"))if(Array.isArray(s)){const o=[];r[i]=o;for(const a of s)kt(a)?o.push(this.setParent(this.hydrateAstNode(a,n),r)):rr(a)?o.push(this.hydrateReference(a,r,i,n)):o.push(a)}else kt(s)?r[i]=this.setParent(this.hydrateAstNode(s,n),r):rr(s)?r[i]=this.hydrateReference(s,r,i,n):s!==
718
+ void 0&&(r[i]=s);return r}setParent(e,n){return e.$container=n,e}hydrateReference(e,n,r,i){return this.linker.buildReference(n,r,i.cstNodes.get(e.$refNode),e.$refText)}hydrateCstNode(e,n,r=0){const i=n.cstNodes.get(e);if(typeof e.grammarSource=="number"&&(i.grammarSource=this.getGrammarElement(e.grammarSource)),i.astNode=n.astNodes.get(e.astNode),Gi(i))for(const s of e.content){const o=this.hydrateCstNode(s,n,r++);i.content.push(o)}return i}hydrateCstLeafNode(e){const n=this.getTokenType(e.tokenType),
719
+ r=e.offset,i=e.length,s=e.startLine,o=e.startColumn,a=e.endLine,u=e.endColumn,c=e.hidden;return new Zg(r,i,{start:{line:s,character:o},end:{line:a,character:u}},n,c)}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(){
720
+ let e=0;for(const n of ni(this.grammar))wm(n)&&this.grammarElementIdMap.set(n,e++)}}function DR(t){return{documentation:{CommentProvider:e=>new zj(e),DocumentationProvider:e=>new Wj(e)},parser:{AsyncParser:e=>new Hj(e),GrammarConfig:e=>dN(e),LangiumParser:e=>ej(e),CompletionParser:e=>Zq(e),ValueConverter:()=>new rj,TokenBuilder:()=>new nj,Lexer:e=>new Aj(e),ParserErrorMessageProvider:()=>new UD,LexerErrorMessageProvider:()=>new Tj},workspace:{AstNodeLocator:()=>new $j,AstNodeDescriptionProvider:e=>new lR(
721
+ e),ReferenceDescriptionProvider:e=>new Ej(e)},references:{Linker:e=>new cj(e),NameProvider:()=>new rR,ScopeProvider:e=>new uR(e),ScopeComputation:e=>new sR(e),References:e=>new lj(e)},serializer:{Hydrator:e=>new Vj(e),JsonSerializer:e=>new mj(e)},validation:{DocumentValidator:e=>new vj(e),ValidationRegistry:e=>new yj(e)},shared:()=>t.shared}}function RR(t){return{ServiceRegistry:e=>new gj(e),workspace:{LangiumDocuments:e=>new nR(e),LangiumDocumentFactory:e=>new uj(e),DocumentBuilder:e=>new kj(e),
722
+ IndexManager:e=>new dR(e),WorkspaceManager:e=>new fR(e),FileSystemProvider:e=>t.fileSystemProvider(e),WorkspaceLock:()=>new Kj,ConfigurationProvider:e=>new Rj(e)}}}var ip;(function(t){t.merge=(e,n)=>op(op({},e),n)})(ip||(ip={}));function sp(t,e,n,r,i,s,o,a,u){const c=[t,e,n,r,i,s,o,a,u].reduce(op,{});return TR(c)}const kR=Symbol("isProxy");function py(t){if(t&&t[kR])for(const e of Object.values(t))py(e);return t}function TR(t,e){const n=new Proxy({},{deleteProperty:()=>!1,set:()=>{throw new Error(
723
+ "Cannot set property on injected service container")},get:(r,i)=>i===kR?!0:AR(r,i,t,e||n),getOwnPropertyDescriptor:(r,i)=>(AR(r,i,t,e||n),Object.getOwnPropertyDescriptor(r,i)),has:(r,i)=>i in t,ownKeys:()=>[...Object.getOwnPropertyNames(t)]});return n}const CR=Symbol();function AR(t,e,n,r){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]===CR)throw new Error('Cycle detected. Please make "'+
724
+ String(e)+'" lazy. Visit https://langium.org/docs/reference/configuration-services/#resolving-cyclic-dependencies');return t[e]}else if(e in n){const i=n[e];t[e]=CR;try{t[e]=typeof i=="function"?i(r):TR(i,r)}catch(s){throw t[e]=s instanceof Error?s:void 0,s}return t[e]}else return}function op(t,e){if(e){for(const[n,r]of Object.entries(e))if(r!==void 0){const i=t[n];i!==null&&r!==null&&typeof i=="object"&&typeof r=="object"?t[n]=op(i,r):t[n]=r}}return t}class Xj{readFile(){throw new Error("No fil\
725
+ e system is available.")}async readDirectory(){return[]}}const SR={fileSystemProvider:()=>new Xj},Yj={Grammar:()=>{},LanguageMetaData:()=>({caseInsensitive:!1,fileExtensions:[".langium"],languageId:"langium"})},Jj={AstReflection:()=>new t0};function Qj(){const t=sp(RR(SR),Jj),e=sp(DR({shared:t}),Yj);return t.ServiceRegistry.register(e),e}function Zj(t){var e;const n=Qj(),r=n.serializer.JsonSerializer.deserialize(t);return n.shared.workspace.LangiumDocumentFactory.fromModel(r,yt.parse(`memory://${(e=
726
+ r.name)!==null&&e!==void 0?e:"grammar"}.langium`)),r}var e4={done:!0,hasNext:!1},Yu={done:!1,hasNext:!1},t4=()=>e4,n4=t=>({hasNext:!0,next:t,done:!1});function He(t,...e){let n=t,r=e.map(s=>"lazy"in s?r4(s):void 0),i=0;for(;i<e.length;){if(r[i]===void 0||!i4(n)){let u=e[i];n=u(n),i+=1;continue}let s=[];for(let u=i;u<e.length;u++){let c=r[u];if(c===void 0||(s.push(c),c.isSingle))break}let o=[];for(let u of n)if(_R(u,o,s))break;let{isSingle:a}=s.at(-1);n=a?o[0]:o,i+=s.length}return n}function _R(t,e,n){
727
+ if(n.length===0)return e.push(t),!1;let r=t,i=Yu,s=!1;for(let[o,a]of n.entries()){let{index:u,items:c}=a;if(c.push(r),i=a(r,u,c),a.index+=1,i.hasNext){if(i.hasMany??!1){for(let l of i.next)if(_R(l,e,n.slice(o+1)))return!0;return s}r=i.next}if(!i.hasNext)break;i.done&&(s=!0)}return i.hasNext&&e.push(r),s}function r4(t){let{lazy:e,lazyArgs:n}=t,r=e(...n);return Object.assign(r,{isSingle:e.single??!1,index:0,items:[]})}function i4(t){return typeof t=="string"||typeof t=="object"&&t!==null&&Symbol.iterator in
728
+ t}function PR(t,e){let n=e.length-t.length;if(n===1){let[r,...i]=e;return He(r,{lazy:t,lazyArgs:i})}if(n===0){let r={lazy:t,lazyArgs:e};return Object.assign(i=>He(i,r),r)}throw new Error("Wrong number of arguments")}function s4(t,e,n){let r=i=>t(i,...e);return n===void 0?r:Object.assign(r,{lazy:n,lazyArgs:e})}function ct(t,e,n){let r=t.length-e.length;if(r===0)return t(...e);if(r===1)return s4(t,e,n);throw new Error("Wrong number of arguments")}function ap(...t){return ct(Object.values,t)}function Yo(...t){
729
+ return PR(o4,t)}function o4(){let t=new Set;return e=>t.has(e)?Yu:(t.add(e),{done:!1,hasNext:!0,next:e})}function a4(...t){return ct(u4,t,c4)}var u4=(t,e)=>e<0?[]:t.slice(0,e);function c4(t){if(t<=0)return t4;let e=t;return n=>(e-=1,{done:e<=0,hasNext:!0,next:n})}function cr(...t){return ct(l4,t)}var l4=(t,e)=>t.length>=e,xR={asc:(t,e)=>t>e,desc:(t,e)=>t<e};function d4(t,e){let[n,...r]=e;if(!f4(n)){let s=hy(...r);return t(n,s)}let i=hy(n,...r);return s=>t(s,i)}function hy(t,e,...n){let r=typeof t==
730
+ "function"?t:t[0],i=typeof t=="function"?"asc":t[1],{[i]:s}=xR,o=e===void 0?void 0:hy(e,...n);return(a,u)=>{let c=r(a),l=r(u);return s(c,l)?1:s(l,c)?-1:o?.(a,u)??0}}function f4(t){if(NR(t))return!0;if(typeof t!="object"||!Array.isArray(t))return!1;let[e,n,...r]=t;return NR(e)&&typeof n=="string"&&n in xR&&r.length===0}var NR=t=>typeof t=="function"&&t.length===1;function p4(...t){return ct(h4,t)}function h4(t,e){return e(t),t}function IR(...t){return ct(m4,t)}function m4(t,e){let n=[...t];return n.
731
+ sort(e),n}function g4(...t){return d4(y4,t)}var y4=(t,e)=>[...t].sort(e);function my(...t){return ct(v4,t)}var v4=(t,e,n)=>t.reduce(e,n);function w4(...t){return ct(b4,t)}function b4(t){return[...t].reverse()}function fi(...t){return ct(E4,t)}var E4=(t,e)=>t[e];function Jo(...t){return ct($4,t)}function $4(t,e){let n={};for(let[r,i]of Object.entries(t)){let s=e(i,r,t);n[r]=s}return n}function ce(t){return!!t}function Ju(...t){return ct(Object.keys,t)}function Qu(...t){return ct(D4,t)}var D4=t=>t.
732
+ at(-1);function xt(...t){return ct(R4,t,k4)}var R4=(t,e)=>t.map(e),k4=t=>(e,n,r)=>({done:!1,hasNext:!0,next:t(e,n,r)});function zr(...t){return ct(T4,t)}function T4(t,e){let n={};for(let[r,i]of t.entries()){let[s,o]=e(i,r,t);n[s]=o}return n}function up(t){return typeof t=="number"&&!Number.isNaN(t)}function C4(t){return t instanceof Promise}function gy(t){return typeof t=="string"}function Gt(t){return t===void 0?!0:typeof t=="string"||Array.isArray(t)?t.length===0:Object.keys(t).length===0}function Tn(t){
733
+ return t!=null}function A4(t){return e=>!t(e)}function Rt(t){return t==null}function OR(t){return Array.isArray(t)}function yy(t){return typeof t=="boolean"}function cn(t){return t!==void 0}function S4(t,{triggerAt:e="end",minQuietPeriodMs:n,maxBurstDurationMs:r,minGapMs:i,reducer:s=_4}){let o,a,u,c,l=()=>{let p=u;p!==void 0&&(u=void 0,t(p),a=setTimeout(f,i))},f=()=>{clearTimeout(a),a=void 0,o===void 0&&l()},d=()=>{clearTimeout(o),o=void 0,c=void 0,a===void 0&&l()};return{call:(...p)=>{let m=o===
734
+ void 0&&a===void 0;if((e!=="start"||m)&&(u=s(u,...p)),!(o===void 0&&!m)){{clearTimeout(o);let v=Date.now();c??=v;let w=Math.min(n,r-(v-c));o=setTimeout(d,w)}e!=="end"&&m&&l()}},cancel:()=>{clearTimeout(o),o=void 0,c=void 0,clearTimeout(a),a=void 0,u=void 0},flush:()=>{d(),f()},get isIdle(){return o===void 0&&a===void 0}}}var _4=()=>"";function Qo(...t){return ct(P4,t)}var P4=(t,e)=>{let n=new Map;for(let[r,i]of t.entries()){let s=e(i,r,t);if(s!==void 0){let o=n.get(s);o===void 0&&(o=[],n.set(s,o)),
735
+ o.push(i)}}return Object.fromEntries(n)};function x4(){return N4}var N4=t=>t;function Zu(...t){return ct(I4,t)}function I4(t,e){let n={};for(let[r,i]of t.entries()){let s=e(i,r,t);n[s]=i}return n}function Hr(...t){return ct(O4,t,F4)}var O4=(t,e)=>t.flatMap(e),F4=t=>(e,n,r)=>{let i=t(e,n,r);return Array.isArray(i)?{done:!1,hasNext:!0,hasMany:!0,next:i}:{done:!1,hasNext:!0,next:i}};function L4(...t){return ct(M4,t,B4)}function M4(t,e){return t.forEach(e),t}var B4=t=>(e,n,r)=>(t(e,n,r),{done:!1,hasNext:!0,
736
+ next:e});function FR(...t){return ct(q4,t)}function q4(t,e){for(let[n,r]of Object.entries(t))e(r,n,t);return t}function j4(...t){return ct(Object.fromEntries,t)}function ec(...t){return ct(Object.entries,t)}function ze(...t){return ct(G4,t,U4)}var G4=(t,e)=>t.filter(e),U4=t=>(e,n,r)=>t(e,n,r)?{done:!1,hasNext:!0,next:e}:Yu,LR=t=>Object.assign(t,{single:!0});function MR(...t){return ct(W4,t,LR(z4))}var W4=(t,e)=>t.find(e),z4=t=>(e,n,r)=>t(e,n,r)?{done:!0,hasNext:!0,next:e}:Yu;function BR(...t){return ct(
737
+ H4,t)}var H4=(t,e)=>{for(let n=t.length-1;n>=0;n--){let r=t[n];if(e(r,n,t))return r}};function Zo(...t){return ct(K4,t,LR(V4))}var K4=([t])=>t,V4=()=>X4,X4=t=>({hasNext:!0,next:t,done:!0});function qR(...t){return ct(Y4,t)}var Y4=(t,e)=>[...t,...e];function J4(...t){return PR(Q4,t)}function Q4(t){if(t.length===0)return n4;let e=new Map;for(let n of t)e.set(n,(e.get(n)??0)+1);return n=>{let r=e.get(n);return r===void 0||r===0?{done:!1,hasNext:!0,next:n}:(e.set(n,r-1),Yu)}}function Z4(...t){return ct(
738
+ e3,t)}var e3=(t,e)=>e.some(n=>n(t));function t3(...t){return ct(n3,t)}function n3(t,e){if(e<1)throw new RangeError(`chunk: A chunk size of '${e.toString()}' would result in an infinite array`);if(t.length===0)return[];if(e>=t.length)return[[...t]];let n=Math.ceil(t.length/e),r=new Array(n);if(e===1)for(let[i,s]of t.entries())r[i]=[s];else for(let i=0;i<n;i+=1){let s=i*e;r[i]=t.slice(s,s+e)}return r}function jR(...t){return ct(r3,t)}var r3=(t,{min:e,max:n})=>e!==void 0&&t<e?e:n!==void 0&&t>n?n:t,
739
+ i3={reset:[0,0],bold:[1,22,"\x1B[22m\x1B[1m"],dim:[2,22,"\x1B[22m\x1B[2m"],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29],black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],gray:[90,39],bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,
740
+ 39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]},s3=Object.entries(i3);function vy(t){return String(t)}vy.open="",vy.close="";function o3(t=!1){let e=typeof process<"u"?process:void 0,n=e?.env||{},r=e?.argv||[];return!("NO_COLOR"in n||r.includes("--no-color"))&&("FORCE_COLOR"in n||r.includes("--colo\
741
+ r")||e?.platform==="win32"||t&&n.TERM!=="dumb"||"CI"in n)||typeof window<"u"&&!!window.chrome}function a3(t=!1){let e=o3(t),n=(o,a,u,c)=>{let l="",f=0;do l+=o.substring(f,c)+u,f=c+a.length,c=o.indexOf(a,f);while(~c);return l+o.substring(f)},r=(o,a,u=o)=>{let c=l=>{let f=String(l),d=f.indexOf(a,o.length);return~d?o+n(f,a,u,d)+a:o+f+a};return c.open=o,c.close=a,c},i={isColorSupported:e},s=o=>`\x1B[${o}m`;for(let[o,a]of s3)i[o]=e?r(s(a[0]),s(a[1]),a[2]):vy;return i}var u3=process.env.FORCE_TTY!==void 0||
742
+ c_(1),Ut=a3(u3),Us={},Ot={},GR;function wy(){if(GR)return Ot;GR=1,Object.defineProperty(Ot,"__esModule",{value:!0}),Ot.thenable=Ot.typedArray=Ot.stringArray=Ot.array=Ot.func=Ot.error=Ot.number=Ot.string=Ot.boolean=void 0;function t(c){return c===!0||c===!1}Ot.boolean=t;function e(c){return typeof c=="string"||c instanceof String}Ot.string=e;function n(c){return typeof c=="number"||c instanceof Number}Ot.number=n;function r(c){return c instanceof Error}Ot.error=r;function i(c){return typeof c=="f\
743
+ unction"}Ot.func=i;function s(c){return Array.isArray(c)}Ot.array=s;function o(c){return s(c)&&c.every(l=>e(l))}Ot.stringArray=o;function a(c,l){return Array.isArray(c)&&c.every(l)}Ot.typedArray=a;function u(c){return c&&i(c.then)}return Ot.thenable=u,Ot}var Ze={},Ws={},zs={},cp={},by={},Ee={},UR;function WR(){if(UR)return Ee;UR=1,Object.defineProperty(Ee,"__esModule",{value:!0}),Ee.Message=Ee.NotificationType9=Ee.NotificationType8=Ee.NotificationType7=Ee.NotificationType6=Ee.NotificationType5=Ee.
744
+ NotificationType4=Ee.NotificationType3=Ee.NotificationType2=Ee.NotificationType1=Ee.NotificationType0=Ee.NotificationType=Ee.RequestType9=Ee.RequestType8=Ee.RequestType7=Ee.RequestType6=Ee.RequestType5=Ee.RequestType4=Ee.RequestType3=Ee.RequestType2=Ee.RequestType1=Ee.RequestType=Ee.RequestType0=Ee.AbstractMessageSignature=Ee.ParameterStructures=Ee.ResponseError=Ee.ErrorCodes=void 0;const t=Ku();var e;(function(T){T.ParseError=-32700,T.InvalidRequest=-32600,T.MethodNotFound=-32601,T.InvalidParams=
745
+ -32602,T.InternalError=-32603,T.jsonrpcReservedErrorRangeStart=-32099,T.serverErrorStart=-32099,T.MessageWriteError=-32099,T.MessageReadError=-32098,T.PendingResponseRejected=-32097,T.ConnectionInactive=-32096,T.ServerNotInitialized=-32002,T.UnknownErrorCode=-32001,T.jsonrpcReservedErrorRangeEnd=-32e3,T.serverErrorEnd=-32e3})(e||(Ee.ErrorCodes=e={}));class n extends Error{constructor(D,M,S){super(M),this.code=t.number(D)?D:e.UnknownErrorCode,this.data=S,Object.setPrototypeOf(this,n.prototype)}toJson(){
746
+ const D={code:this.code,message:this.message};return this.data!==void 0&&(D.data=this.data),D}}Ee.ResponseError=n;class r{constructor(D){this.kind=D}static is(D){return D===r.auto||D===r.byName||D===r.byPosition}toString(){return this.kind}}Ee.ParameterStructures=r,r.auto=new r("auto"),r.byPosition=new r("byPosition"),r.byName=new r("byName");class i{constructor(D,M){this.method=D,this.numberOfParams=M}get parameterStructures(){return r.auto}}Ee.AbstractMessageSignature=i;class s extends i{constructor(D){
747
+ super(D,0)}}Ee.RequestType0=s;class o extends i{constructor(D,M=r.auto){super(D,1),this._parameterStructures=M}get parameterStructures(){return this._parameterStructures}}Ee.RequestType=o;class a extends i{constructor(D,M=r.auto){super(D,1),this._parameterStructures=M}get parameterStructures(){return this._parameterStructures}}Ee.RequestType1=a;class u extends i{constructor(D){super(D,2)}}Ee.RequestType2=u;class c extends i{constructor(D){super(D,3)}}Ee.RequestType3=c;class l extends i{constructor(D){
748
+ super(D,4)}}Ee.RequestType4=l;class f extends i{constructor(D){super(D,5)}}Ee.RequestType5=f;class d extends i{constructor(D){super(D,6)}}Ee.RequestType6=d;class p extends i{constructor(D){super(D,7)}}Ee.RequestType7=p;class m extends i{constructor(D){super(D,8)}}Ee.RequestType8=m;class v extends i{constructor(D){super(D,9)}}Ee.RequestType9=v;class w extends i{constructor(D,M=r.auto){super(D,1),this._parameterStructures=M}get parameterStructures(){return this._parameterStructures}}Ee.NotificationType=
749
+ w;class y extends i{constructor(D){super(D,0)}}Ee.NotificationType0=y;class E extends i{constructor(D,M=r.auto){super(D,1),this._parameterStructures=M}get parameterStructures(){return this._parameterStructures}}Ee.NotificationType1=E;class R extends i{constructor(D){super(D,2)}}Ee.NotificationType2=R;class A extends i{constructor(D){super(D,3)}}Ee.NotificationType3=A;class N extends i{constructor(D){super(D,4)}}Ee.NotificationType4=N;class V extends i{constructor(D){super(D,5)}}Ee.NotificationType5=
750
+ V;class J extends i{constructor(D){super(D,6)}}Ee.NotificationType6=J;class se extends i{constructor(D){super(D,7)}}Ee.NotificationType7=se;class ie extends i{constructor(D){super(D,8)}}Ee.NotificationType8=ie;class we extends i{constructor(D){super(D,9)}}Ee.NotificationType9=we;var B;return function(T){function D(P){const O=P;return O&&t.string(O.method)&&(t.string(O.id)||t.number(O.id))}T.isRequest=D;function M(P){const O=P;return O&&t.string(O.method)&&P.id===void 0}T.isNotification=M;function S(P){
751
+ const O=P;return O&&(O.result!==void 0||!!O.error)&&(t.string(O.id)||t.number(O.id)||O.id===null)}T.isResponse=S}(B||(Ee.Message=B={})),Ee}var pi={},zR;function HR(){if(zR)return pi;zR=1;var t;Object.defineProperty(pi,"__esModule",{value:!0}),pi.LRUCache=pi.LinkedMap=pi.Touch=void 0;var e;(function(i){i.None=0,i.First=1,i.AsOld=i.First,i.Last=2,i.AsNew=i.Last})(e||(pi.Touch=e={}));class n{constructor(){this[t]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=
752
+ 0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){return this._head?.value}get last(){return this._tail?.value}has(s){return this._map.has(s)}get(s,o=e.None){const a=this._map.get(s);if(a)return o!==e.None&&this.touch(a,o),a.value}set(s,o,a=e.None){let u=this._map.get(s);if(u)u.value=o,a!==e.None&&this.touch(u,a);else{switch(u={key:s,value:o,next:void 0,previous:void 0},a){case e.
753
+ None:this.addItemLast(u);break;case e.First:this.addItemFirst(u);break;case e.Last:this.addItemLast(u);break;default:this.addItemLast(u);break}this._map.set(s,u),this._size++}return this}delete(s){return!!this.remove(s)}remove(s){const o=this._map.get(s);if(o)return this._map.delete(s),this.removeItem(o),this._size--,o.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");const s=this._head;return this._map.delete(s.key),this.removeItem(s),this.
754
+ _size--,s.value}forEach(s,o){const a=this._state;let u=this._head;for(;u;){if(o?s.bind(o)(u.value,u.key,this):s(u.value,u.key,this),this._state!==a)throw new Error("LinkedMap got modified during iteration.");u=u.next}}keys(){const s=this._state;let o=this._head;const a={[Symbol.iterator]:()=>a,next:()=>{if(this._state!==s)throw new Error("LinkedMap got modified during iteration.");if(o){const u={value:o.key,done:!1};return o=o.next,u}else return{value:void 0,done:!0}}};return a}values(){const s=this.
755
+ _state;let o=this._head;const a={[Symbol.iterator]:()=>a,next:()=>{if(this._state!==s)throw new Error("LinkedMap got modified during iteration.");if(o){const u={value:o.value,done:!1};return o=o.next,u}else return{value:void 0,done:!0}}};return a}entries(){const s=this._state;let o=this._head;const a={[Symbol.iterator]:()=>a,next:()=>{if(this._state!==s)throw new Error("LinkedMap got modified during iteration.");if(o){const u={value:[o.key,o.value],done:!1};return o=o.next,u}else return{value:void 0,
756
+ done:!0}}};return a}[(t=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(s){if(s>=this.size)return;if(s===0){this.clear();return}let o=this._head,a=this.size;for(;o&&a>s;)this._map.delete(o.key),o=o.next,a--;this._head=o,this._size=a,o&&(o.previous=void 0),this._state++}addItemFirst(s){if(!this._head&&!this._tail)this._tail=s;else if(this._head)s.next=this._head,this._head.previous=s;else throw new Error("Invalid list");this._head=s,this._state++}addItemLast(s){if(!this._head&&
757
+ !this._tail)this._head=s;else if(this._tail)s.previous=this._tail,this._tail.next=s;else throw new Error("Invalid list");this._tail=s,this._state++}removeItem(s){if(s===this._head&&s===this._tail)this._head=void 0,this._tail=void 0;else if(s===this._head){if(!s.next)throw new Error("Invalid list");s.next.previous=void 0,this._head=s.next}else if(s===this._tail){if(!s.previous)throw new Error("Invalid list");s.previous.next=void 0,this._tail=s.previous}else{const o=s.next,a=s.previous;if(!o||!a)throw new Error(
758
+ "Invalid list");o.previous=a,a.next=o}s.next=void 0,s.previous=void 0,this._state++}touch(s,o){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(o!==e.First&&o!==e.Last)){if(o===e.First){if(s===this._head)return;const a=s.next,u=s.previous;s===this._tail?(u.next=void 0,this._tail=u):(a.previous=u,u.next=a),s.previous=void 0,s.next=this._head,this._head.previous=s,this._head=s,this._state++}else if(o===e.Last){if(s===this._tail)return;const a=s.next,u=s.previous;s===this._head?(a.previous=
759
+ void 0,this._head=a):(a.previous=u,u.next=a),s.next=void 0,s.previous=this._tail,this._tail.next=s,this._tail=s,this._state++}}}toJSON(){const s=[];return this.forEach((o,a)=>{s.push([a,o])}),s}fromJSON(s){this.clear();for(const[o,a]of s)this.set(o,a)}}pi.LinkedMap=n;class r extends n{constructor(s,o=1){super(),this._limit=s,this._ratio=Math.min(Math.max(0,o),1)}get limit(){return this._limit}set limit(s){this._limit=s,this.checkTrim()}get ratio(){return this._ratio}set ratio(s){this._ratio=Math.
760
+ min(Math.max(0,s),1),this.checkTrim()}get(s,o=e.AsNew){return super.get(s,o)}peek(s){return super.get(s,e.None)}set(s,o){return super.set(s,o,e.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}}return pi.LRUCache=r,pi}var tc={},KR;function c3(){if(KR)return tc;KR=1,Object.defineProperty(tc,"__esModule",{value:!0}),tc.Disposable=void 0;var t;return function(e){function n(r){return{dispose:r}}e.create=n}(t||(tc.Disposable=t={})),tc}var Hs={},
761
+ VR;function l3(){if(VR)return Hs;VR=1,Object.defineProperty(Hs,"__esModule",{value:!0}),Hs.SharedArrayReceiverStrategy=Hs.SharedArraySenderStrategy=void 0;const t=Yf();var e;(function(o){o.Continue=0,o.Cancelled=1})(e||(e={}));class n{constructor(){this.buffers=new Map}enableCancellation(a){if(a.id===null)return;const u=new SharedArrayBuffer(4),c=new Int32Array(u,0,1);c[0]=e.Continue,this.buffers.set(a.id,u),a.$cancellationData=u}async sendCancellation(a,u){const c=this.buffers.get(u);if(c===void 0)
762
+ return;const l=new Int32Array(c,0,1);Atomics.store(l,0,e.Cancelled)}cleanup(a){this.buffers.delete(a)}dispose(){this.buffers.clear()}}Hs.SharedArraySenderStrategy=n;class r{constructor(a){this.data=new Int32Array(a,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===e.Cancelled}get onCancellationRequested(){throw new Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}}class i{constructor(a){this.token=new r(a)}cancel(){}dispose(){}}class s{constructor(){
763
+ this.kind="request"}createCancellationTokenSource(a){const u=a.$cancellationData;return u===void 0?new t.CancellationTokenSource:new i(u)}}return Hs.SharedArrayReceiverStrategy=s,Hs}var hi={},nc={},XR;function YR(){if(XR)return nc;XR=1,Object.defineProperty(nc,"__esModule",{value:!0}),nc.Semaphore=void 0;const t=Ms();class e{constructor(r=1){if(r<=0)throw new Error("Capacity must be greater than 0");this._capacity=r,this._active=0,this._waiting=[]}lock(r){return new Promise((i,s)=>{this._waiting.
764
+ push({thunk:r,resolve:i,reject:s}),this.runNext()})}get active(){return this._active}runNext(){this._waiting.length===0||this._active===this._capacity||(0,t.default)().timer.setImmediate(()=>this.doRunNext())}doRunNext(){if(this._waiting.length===0||this._active===this._capacity)return;const r=this._waiting.shift();if(this._active++,this._active>this._capacity)throw new Error("To many thunks active");try{const i=r.thunk();i instanceof Promise?i.then(s=>{this._active--,r.resolve(s),this.runNext()},
765
+ s=>{this._active--,r.reject(s),this.runNext()}):(this._active--,r.resolve(i),this.runNext())}catch(i){this._active--,r.reject(i),this.runNext()}}}return nc.Semaphore=e,nc}var JR;function d3(){if(JR)return hi;JR=1,Object.defineProperty(hi,"__esModule",{value:!0}),hi.ReadableStreamMessageReader=hi.AbstractMessageReader=hi.MessageReader=void 0;const t=Ms(),e=Ku(),n=Xo(),r=YR();var i;(function(u){function c(l){let f=l;return f&&e.func(f.listen)&&e.func(f.dispose)&&e.func(f.onError)&&e.func(f.onClose)&&
766
+ e.func(f.onPartialMessage)}u.is=c})(i||(hi.MessageReader=i={}));class s{constructor(){this.errorEmitter=new n.Emitter,this.closeEmitter=new n.Emitter,this.partialMessageEmitter=new n.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(c){this.errorEmitter.fire(this.asError(c))}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}get onPartialMessage(){return this.partialMessageEmitter.
767
+ event}firePartialMessage(c){this.partialMessageEmitter.fire(c)}asError(c){return c instanceof Error?c:new Error(`Reader received error. Reason: ${e.string(c.message)?c.message:"unknown"}`)}}hi.AbstractMessageReader=s;var o;(function(u){function c(l){let f,d;const p=new Map;let m;const v=new Map;if(l===void 0||typeof l=="string")f=l??"utf-8";else{if(f=l.charset??"utf-8",l.contentDecoder!==void 0&&(d=l.contentDecoder,p.set(d.name,d)),l.contentDecoders!==void 0)for(const w of l.contentDecoders)p.set(
768
+ w.name,w);if(l.contentTypeDecoder!==void 0&&(m=l.contentTypeDecoder,v.set(m.name,m)),l.contentTypeDecoders!==void 0)for(const w of l.contentTypeDecoders)v.set(w.name,w)}return m===void 0&&(m=(0,t.default)().applicationJson.decoder,v.set(m.name,m)),{charset:f,contentDecoder:d,contentDecoders:p,contentTypeDecoder:m,contentTypeDecoders:v}}u.fromOptions=c})(o||(o={}));class a extends s{constructor(c,l){super(),this.readable=c,this.options=o.fromOptions(l),this.buffer=(0,t.default)().messageBuffer.create(
769
+ this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new r.Semaphore(1)}set partialMessageTimeout(c){this._partialMessageTimeout=c}get partialMessageTimeout(){return this._partialMessageTimeout}listen(c){this.nextMessageLength=-1,this.messageToken=0,this.partialMessageTimer=void 0,this.callback=c;const l=this.readable.onData(f=>{this.onData(f)});return this.readable.onError(f=>this.fireError(f)),this.readable.onClose(()=>this.fireClose()),
770
+ l}onData(c){try{for(this.buffer.append(c);;){if(this.nextMessageLength===-1){const f=this.buffer.tryReadHeaders(!0);if(!f)return;const d=f.get("content-length");if(!d){this.fireError(new Error(`Header must provide a Content-Length property.
771
+ ${JSON.stringify(Object.fromEntries(f))}`));return}const p=parseInt(d);if(isNaN(p)){this.fireError(new Error(`Content-Length value must be a number. Got ${d}`));return}this.nextMessageLength=p}const l=this.buffer.tryReadBody(this.nextMessageLength);if(l===void 0){this.setPartialMessageTimer();return}this.clearPartialMessageTimer(),this.nextMessageLength=-1,this.readSemaphore.lock(async()=>{const f=this.options.contentDecoder!==void 0?await this.options.contentDecoder.decode(l):l,d=await this.options.
772
+ contentTypeDecoder.decode(f,this.options);this.callback(d)}).catch(f=>{this.fireError(f)})}}catch(l){this.fireError(l)}}clearPartialMessageTimer(){this.partialMessageTimer&&(this.partialMessageTimer.dispose(),this.partialMessageTimer=void 0)}setPartialMessageTimer(){this.clearPartialMessageTimer(),!(this._partialMessageTimeout<=0)&&(this.partialMessageTimer=(0,t.default)().timer.setTimeout((c,l)=>{this.partialMessageTimer=void 0,c===this.messageToken&&(this.firePartialMessage({messageToken:c,waitingTime:l}),
773
+ this.setPartialMessageTimer())},this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout))}}return hi.ReadableStreamMessageReader=a,hi}var mi={},QR;function f3(){if(QR)return mi;QR=1,Object.defineProperty(mi,"__esModule",{value:!0}),mi.WriteableStreamMessageWriter=mi.AbstractMessageWriter=mi.MessageWriter=void 0;const t=Ms(),e=Ku(),n=YR(),r=Xo(),i="Content-Length: ",s=`\r
774
+ `;var o;(function(l){function f(d){let p=d;return p&&e.func(p.dispose)&&e.func(p.onClose)&&e.func(p.onError)&&e.func(p.write)}l.is=f})(o||(mi.MessageWriter=o={}));class a{constructor(){this.errorEmitter=new r.Emitter,this.closeEmitter=new r.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(f,d,p){this.errorEmitter.fire([this.asError(f),d,p])}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(
775
+ void 0)}asError(f){return f instanceof Error?f:new Error(`Writer received error. Reason: ${e.string(f.message)?f.message:"unknown"}`)}}mi.AbstractMessageWriter=a;var u;(function(l){function f(d){return d===void 0||typeof d=="string"?{charset:d??"utf-8",contentTypeEncoder:(0,t.default)().applicationJson.encoder}:{charset:d.charset??"utf-8",contentEncoder:d.contentEncoder,contentTypeEncoder:d.contentTypeEncoder??(0,t.default)().applicationJson.encoder}}l.fromOptions=f})(u||(u={}));class c extends a{constructor(f,d){
776
+ super(),this.writable=f,this.options=u.fromOptions(d),this.errorCount=0,this.writeSemaphore=new n.Semaphore(1),this.writable.onError(p=>this.fireError(p)),this.writable.onClose(()=>this.fireClose())}async write(f){return this.writeSemaphore.lock(async()=>this.options.contentTypeEncoder.encode(f,this.options).then(p=>this.options.contentEncoder!==void 0?this.options.contentEncoder.encode(p):p).then(p=>{const m=[];return m.push(i,p.byteLength.toString(),s),m.push(s),this.doWrite(f,m,p)},p=>{throw this.
777
+ fireError(p),p}))}async doWrite(f,d,p){try{return await this.writable.write(d.join(""),"ascii"),this.writable.write(p)}catch(m){return this.handleError(m,f),Promise.reject(m)}}handleError(f,d){this.errorCount++,this.fireError(f,d,this.errorCount)}end(){this.writable.end()}}return mi.WriteableStreamMessageWriter=c,mi}var rc={},ZR;function p3(){if(ZR)return rc;ZR=1,Object.defineProperty(rc,"__esModule",{value:!0}),rc.AbstractMessageBuffer=void 0;const t=13,e=10,n=`\r
778
+ `;class r{constructor(s="utf-8"){this._encoding=s,this._chunks=[],this._totalLength=0}get encoding(){return this._encoding}append(s){const o=typeof s=="string"?this.fromString(s,this._encoding):s;this._chunks.push(o),this._totalLength+=o.byteLength}tryReadHeaders(s=!1){if(this._chunks.length===0)return;let o=0,a=0,u=0,c=0;e:for(;a<this._chunks.length;){const p=this._chunks[a];for(u=0;u<p.length;){switch(p[u]){case t:switch(o){case 0:o=1;break;case 2:o=3;break;default:o=0}break;case e:switch(o){case 1:
779
+ o=2;break;case 3:o=4,u++;break e;default:o=0}break;default:o=0}u++}c+=p.byteLength,a++}if(o!==4)return;const l=this._read(c+u),f=new Map,d=this.toString(l,"ascii").split(n);if(d.length<2)return f;for(let p=0;p<d.length-2;p++){const m=d[p],v=m.indexOf(":");if(v===-1)throw new Error(`Message header must separate key and value using ':'
780
+ ${m}`);const w=m.substr(0,v),y=m.substr(v+1).trim();f.set(s?w.toLowerCase():w,y)}return f}tryReadBody(s){if(!(this._totalLength<s))return this._read(s)}get numberOfBytes(){return this._totalLength}_read(s){if(s===0)return this.emptyBuffer();if(s>this._totalLength)throw new Error("Cannot read so many bytes!");if(this._chunks[0].byteLength===s){const c=this._chunks[0];return this._chunks.shift(),this._totalLength-=s,this.asNative(c)}if(this._chunks[0].byteLength>s){const c=this._chunks[0],l=this.asNative(
781
+ c,s);return this._chunks[0]=c.slice(s),this._totalLength-=s,l}const o=this.allocNative(s);let a=0,u=0;for(;s>0;){const c=this._chunks[u];if(c.byteLength>s){const l=c.slice(0,s);o.set(l,a),a+=s,this._chunks[u]=c.slice(s),this._totalLength-=s,s-=s}else o.set(c,a),a+=c.byteLength,this._chunks.shift(),this._totalLength-=c.byteLength,s-=c.byteLength}return o}}return rc.AbstractMessageBuffer=r,rc}var Ey={},ek;function h3(){return ek||(ek=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.
782
+ createMessageConnection=t.ConnectionOptions=t.MessageStrategy=t.CancellationStrategy=t.CancellationSenderStrategy=t.CancellationReceiverStrategy=t.RequestCancellationReceiverStrategy=t.IdCancellationReceiverStrategy=t.ConnectionStrategy=t.ConnectionError=t.ConnectionErrors=t.LogTraceNotification=t.SetTraceNotification=t.TraceFormat=t.TraceValues=t.Trace=t.NullLogger=t.ProgressType=t.ProgressToken=void 0;const e=Ms(),n=Ku(),r=WR(),i=HR(),s=Xo(),o=Yf();var a;(function(D){D.type=new r.NotificationType(
783
+ "$/cancelRequest")})(a||(a={}));var u;(function(D){function M(S){return typeof S=="string"||typeof S=="number"}D.is=M})(u||(t.ProgressToken=u={}));var c;(function(D){D.type=new r.NotificationType("$/progress")})(c||(c={}));class l{constructor(){}}t.ProgressType=l;var f;(function(D){function M(S){return n.func(S)}D.is=M})(f||(f={})),t.NullLogger=Object.freeze({error:()=>{},warn:()=>{},info:()=>{},log:()=>{}});var d;(function(D){D[D.Off=0]="Off",D[D.Messages=1]="Messages",D[D.Compact=2]="Compact",
784
+ D[D.Verbose=3]="Verbose"})(d||(t.Trace=d={}));var p;(function(D){D.Off="off",D.Messages="messages",D.Compact="compact",D.Verbose="verbose"})(p||(t.TraceValues=p={})),function(D){function M(P){if(!n.string(P))return D.Off;switch(P=P.toLowerCase(),P){case"off":return D.Off;case"messages":return D.Messages;case"compact":return D.Compact;case"verbose":return D.Verbose;default:return D.Off}}D.fromString=M;function S(P){switch(P){case D.Off:return"off";case D.Messages:return"messages";case D.Compact:return"\
785
+ compact";case D.Verbose:return"verbose";default:return"off"}}D.toString=S}(d||(t.Trace=d={}));var m;(function(D){D.Text="text",D.JSON="json"})(m||(t.TraceFormat=m={})),function(D){function M(S){return n.string(S)?(S=S.toLowerCase(),S==="json"?D.JSON:D.Text):D.Text}D.fromString=M}(m||(t.TraceFormat=m={}));var v;(function(D){D.type=new r.NotificationType("$/setTrace")})(v||(t.SetTraceNotification=v={}));var w;(function(D){D.type=new r.NotificationType("$/logTrace")})(w||(t.LogTraceNotification=w={}));
786
+ var y;(function(D){D[D.Closed=1]="Closed",D[D.Disposed=2]="Disposed",D[D.AlreadyListening=3]="AlreadyListening"})(y||(t.ConnectionErrors=y={}));class E extends Error{constructor(M,S){super(S),this.code=M,Object.setPrototypeOf(this,E.prototype)}}t.ConnectionError=E;var R;(function(D){function M(S){const P=S;return P&&n.func(P.cancelUndispatched)}D.is=M})(R||(t.ConnectionStrategy=R={}));var A;(function(D){function M(S){const P=S;return P&&(P.kind===void 0||P.kind==="id")&&n.func(P.createCancellationTokenSource)&&
787
+ (P.dispose===void 0||n.func(P.dispose))}D.is=M})(A||(t.IdCancellationReceiverStrategy=A={}));var N;(function(D){function M(S){const P=S;return P&&P.kind==="request"&&n.func(P.createCancellationTokenSource)&&(P.dispose===void 0||n.func(P.dispose))}D.is=M})(N||(t.RequestCancellationReceiverStrategy=N={}));var V;(function(D){D.Message=Object.freeze({createCancellationTokenSource(S){return new o.CancellationTokenSource}});function M(S){return A.is(S)||N.is(S)}D.is=M})(V||(t.CancellationReceiverStrategy=
788
+ V={}));var J;(function(D){D.Message=Object.freeze({sendCancellation(S,P){return S.sendNotification(a.type,{id:P})},cleanup(S){}});function M(S){const P=S;return P&&n.func(P.sendCancellation)&&n.func(P.cleanup)}D.is=M})(J||(t.CancellationSenderStrategy=J={}));var se;(function(D){D.Message=Object.freeze({receiver:V.Message,sender:J.Message});function M(S){const P=S;return P&&V.is(P.receiver)&&J.is(P.sender)}D.is=M})(se||(t.CancellationStrategy=se={}));var ie;(function(D){function M(S){const P=S;return P&&
789
+ n.func(P.handleMessage)}D.is=M})(ie||(t.MessageStrategy=ie={}));var we;(function(D){function M(S){const P=S;return P&&(se.is(P.cancellationStrategy)||R.is(P.connectionStrategy)||ie.is(P.messageStrategy))}D.is=M})(we||(t.ConnectionOptions=we={}));var B;(function(D){D[D.New=1]="New",D[D.Listening=2]="Listening",D[D.Closed=3]="Closed",D[D.Disposed=4]="Disposed"})(B||(B={}));function T(D,M,S,P){const O=S!==void 0?S:t.NullLogger;let Q=0,z=0,C=0;const ne="2.0";let ye;const xe=new Map;let L;const H=new Map,
790
+ Se=new Map;let le,$e=new i.LinkedMap,Ne=new Map,de=new Set,I=new Map,G=d.Off,pe=m.Text,U,fe=B.New;const Ve=new s.Emitter,it=new s.Emitter,ue=new s.Emitter,Ie=new s.Emitter,re=new s.Emitter,De=P&&P.cancellationStrategy?P.cancellationStrategy:se.Message;function Ge($){if($===null)throw new Error("Can't send requests with id null since the response can't be correlated.");return"req-"+$.toString()}function wt($){return $===null?"res-unknown-"+(++C).toString():"res-"+$.toString()}function et(){return"\
791
+ not-"+(++z).toString()}function Xt($,W){r.Message.isRequest(W)?$.set(Ge(W.id),W):r.Message.isResponse(W)?$.set(wt(W.id),W):$.set(et(),W)}function tn($){}function yn(){return fe===B.Listening}function X(){return fe===B.Closed}function Y(){return fe===B.Disposed}function he(){(fe===B.New||fe===B.Listening)&&(fe=B.Closed,it.fire(void 0))}function nn($){Ve.fire([$,void 0,void 0])}function Yt($){Ve.fire($)}D.onClose(he),D.onError(nn),M.onClose(he),M.onError(Yt);function Nr(){le||$e.size===0||(le=(0,e.
792
+ default)().timer.setImmediate(()=>{le=void 0,ds()}))}function Fi($){r.Message.isRequest($)?ps($):r.Message.isNotification($)?Li($):r.Message.isResponse($)?hs($):Mi($)}function ds(){if($e.size===0)return;const $=$e.shift();try{const W=P?.messageStrategy;ie.is(W)?W.handleMessage($,Fi):Fi($)}finally{Nr()}}const fs=$=>{try{if(r.Message.isNotification($)&&$.method===a.type.method){const W=$.params.id,te=Ge(W),oe=$e.get(te);if(r.Message.isRequest(oe)){const Me=P?.connectionStrategy,tt=Me&&Me.cancelUndispatched?
793
+ Me.cancelUndispatched(oe,tn):void 0;if(tt&&(tt.error!==void 0||tt.result!==void 0)){$e.delete(te),I.delete(W),tt.id=oe.id,Ir(tt,$.method,Date.now()),M.write(tt).catch(()=>O.error("Sending response for canceled message failed."));return}}const Ue=I.get(W);if(Ue!==void 0){Ue.cancel(),Yr($);return}else de.add(W)}Xt($e,$)}finally{Nr()}};function ps($){if(Y())return;function W(Oe,ut,nt){const zt={jsonrpc:ne,id:$.id};Oe instanceof r.ResponseError?zt.error=Oe.toJson():zt.result=Oe===void 0?null:Oe,Ir(zt,
794
+ ut,nt),M.write(zt).catch(()=>O.error("Sending response failed."))}function te(Oe,ut,nt){const zt={jsonrpc:ne,id:$.id,error:Oe.toJson()};Ir(zt,ut,nt),M.write(zt).catch(()=>O.error("Sending response failed."))}function oe(Oe,ut,nt){Oe===void 0&&(Oe=null);const zt={jsonrpc:ne,id:$.id,result:Oe};Ir(zt,ut,nt),M.write(zt).catch(()=>O.error("Sending response failed."))}ys($);const Ue=xe.get($.method);let Me,tt;Ue&&(Me=Ue.type,tt=Ue.handler);const be=Date.now();if(tt||ye){const Oe=$.id??String(Date.now()),
795
+ ut=A.is(De.receiver)?De.receiver.createCancellationTokenSource(Oe):De.receiver.createCancellationTokenSource($);$.id!==null&&de.has($.id)&&ut.cancel(),$.id!==null&&I.set(Oe,ut);try{let nt;if(tt)if($.params===void 0){if(Me!==void 0&&Me.numberOfParams!==0){te(new r.ResponseError(r.ErrorCodes.InvalidParams,`Request ${$.method} defines ${Me.numberOfParams} params but received none.`),$.method,be);return}nt=tt(ut.token)}else if(Array.isArray($.params)){if(Me!==void 0&&Me.parameterStructures===r.ParameterStructures.
796
+ byName){te(new r.ResponseError(r.ErrorCodes.InvalidParams,`Request ${$.method} defines parameters by name but received parameters by position`),$.method,be);return}nt=tt(...$.params,ut.token)}else{if(Me!==void 0&&Me.parameterStructures===r.ParameterStructures.byPosition){te(new r.ResponseError(r.ErrorCodes.InvalidParams,`Request ${$.method} defines parameters by position but received parameters by name`),$.method,be);return}nt=tt($.params,ut.token)}else ye&&(nt=ye($.method,$.params,ut.token));const zt=nt;
797
+ nt?zt.then?zt.then(vn=>{I.delete(Oe),W(vn,$.method,be)},vn=>{I.delete(Oe),vn instanceof r.ResponseError?te(vn,$.method,be):vn&&n.string(vn.message)?te(new r.ResponseError(r.ErrorCodes.InternalError,`Request ${$.method} failed with message: ${vn.message}`),$.method,be):te(new r.ResponseError(r.ErrorCodes.InternalError,`Request ${$.method} failed unexpectedly without providing any details.`),$.method,be)}):(I.delete(Oe),W(nt,$.method,be)):(I.delete(Oe),oe(nt,$.method,be))}catch(nt){I.delete(Oe),nt instanceof
798
+ r.ResponseError?W(nt,$.method,be):nt&&n.string(nt.message)?te(new r.ResponseError(r.ErrorCodes.InternalError,`Request ${$.method} failed with message: ${nt.message}`),$.method,be):te(new r.ResponseError(r.ErrorCodes.InternalError,`Request ${$.method} failed unexpectedly without providing any details.`),$.method,be)}}else te(new r.ResponseError(r.ErrorCodes.MethodNotFound,`Unhandled method ${$.method}`),$.method,be)}function hs($){if(!Y())if($.id===null)$.error?O.error(`Received response message \
799
+ without id: Error is:
800
+ ${JSON.stringify($.error,void 0,4)}`):O.error("Received response message without id. No further error information provided.");else{const W=$.id,te=Ne.get(W);if(vs($,te),te!==void 0){Ne.delete(W);try{if($.error){const oe=$.error;te.reject(new r.ResponseError(oe.code,oe.message,oe.data))}else if($.result!==void 0)te.resolve($.result);else throw new Error("Should never happen.")}catch(oe){oe.message?O.error(`Response handler '${te.method}' failed with message: ${oe.message}`):O.error(`Response hand\
801
+ ler '${te.method}' failed unexpectedly.`)}}}}function Li($){if(Y())return;let W,te;if($.method===a.type.method){const oe=$.params.id;de.delete(oe),Yr($);return}else{const oe=H.get($.method);oe&&(te=oe.handler,W=oe.type)}if(te||L)try{if(Yr($),te)if($.params===void 0)W!==void 0&&W.numberOfParams!==0&&W.parameterStructures!==r.ParameterStructures.byName&&O.error(`Notification ${$.method} defines ${W.numberOfParams} params but received none.`),te();else if(Array.isArray($.params)){const oe=$.params;
802
+ $.method===c.type.method&&oe.length===2&&u.is(oe[0])?te({token:oe[0],value:oe[1]}):(W!==void 0&&(W.parameterStructures===r.ParameterStructures.byName&&O.error(`Notification ${$.method} defines parameters by name but received parameters by position`),W.numberOfParams!==$.params.length&&O.error(`Notification ${$.method} defines ${W.numberOfParams} params but received ${oe.length} arguments`)),te(...oe))}else W!==void 0&&W.parameterStructures===r.ParameterStructures.byPosition&&O.error(`Notificatio\
803
+ n ${$.method} defines parameters by position but received parameters by name`),te($.params);else L&&L($.method,$.params)}catch(oe){oe.message?O.error(`Notification handler '${$.method}' failed with message: ${oe.message}`):O.error(`Notification handler '${$.method}' failed unexpectedly.`)}else ue.fire($)}function Mi($){if(!$){O.error("Received empty message.");return}O.error(`Received message which is neither a response nor a notification message:
804
+ ${JSON.stringify($,null,4)}`);const W=$;if(n.string(W.id)||n.number(W.id)){const te=W.id,oe=Ne.get(te);oe&&oe.reject(new Error("The received response has neither a result nor an error property."))}}function Pn($){if($!=null)switch(G){case d.Verbose:return JSON.stringify($,null,4);case d.Compact:return JSON.stringify($);default:return}}function ms($){if(!(G===d.Off||!U))if(pe===m.Text){let W;(G===d.Verbose||G===d.Compact)&&$.params&&(W=`Params: ${Pn($.params)}
805
+
806
+ `),U.log(`Sending request '${$.method} - (${$.id})'.`,W)}else nr("send-request",$)}function gs($){if(!(G===d.Off||!U))if(pe===m.Text){let W;(G===d.Verbose||G===d.Compact)&&($.params?W=`Params: ${Pn($.params)}
807
+
808
+ `:W=`No parameters provided.
809
+
810
+ `),U.log(`Sending notification '${$.method}'.`,W)}else nr("send-notification",$)}function Ir($,W,te){if(!(G===d.Off||!U))if(pe===m.Text){let oe;(G===d.Verbose||G===d.Compact)&&($.error&&$.error.data?oe=`Error data: ${Pn($.error.data)}
811
+
812
+ `:$.result?oe=`Result: ${Pn($.result)}
813
+
814
+ `:$.error===void 0&&(oe=`No result returned.
815
+
816
+ `)),U.log(`Sending response '${W} - (${$.id})'. Processing request took ${Date.now()-te}ms`,oe)}else nr("send-response",$)}function ys($){if(!(G===d.Off||!U))if(pe===m.Text){let W;(G===d.Verbose||G===d.Compact)&&$.params&&(W=`Params: ${Pn($.params)}
817
+
818
+ `),U.log(`Received request '${$.method} - (${$.id})'.`,W)}else nr("receive-request",$)}function Yr($){if(!(G===d.Off||!U||$.method===w.type.method))if(pe===m.Text){let W;(G===d.Verbose||G===d.Compact)&&($.params?W=`Params: ${Pn($.params)}
819
+
820
+ `:W=`No parameters provided.
821
+
822
+ `),U.log(`Received notification '${$.method}'.`,W)}else nr("receive-notification",$)}function vs($,W){if(!(G===d.Off||!U))if(pe===m.Text){let te;if((G===d.Verbose||G===d.Compact)&&($.error&&$.error.data?te=`Error data: ${Pn($.error.data)}
823
+
824
+ `:$.result?te=`Result: ${Pn($.result)}
825
+
826
+ `:$.error===void 0&&(te=`No result returned.
827
+
828
+ `)),W){const oe=$.error?` Request failed: ${$.error.message} (${$.error.code}).`:"";U.log(`Received response '${W.method} - (${$.id})' in ${Date.now()-W.timerStart}ms.${oe}`,te)}else U.log(`Received response ${$.id} without active response promise.`,te)}else nr("receive-response",$)}function nr($,W){if(!U||G===d.Off)return;const te={isLSPMessage:!0,type:$,message:W,timestamp:Date.now()};U.log(te)}function gr(){if(X())throw new E(y.Closed,"Connection is closed.");if(Y())throw new E(y.Disposed,"Co\
829
+ nnection is disposed.")}function Co(){if(yn())throw new E(y.AlreadyListening,"Connection is already listening")}function q(){if(!yn())throw new Error("Call listen() first.")}function b($){return $===void 0?null:$}function _($){if($!==null)return $}function h($){return $!=null&&!Array.isArray($)&&typeof $=="object"}function k($,W){switch($){case r.ParameterStructures.auto:return h(W)?_(W):[b(W)];case r.ParameterStructures.byName:if(!h(W))throw new Error("Received parameters by name but param is n\
830
+ ot an object literal.");return _(W);case r.ParameterStructures.byPosition:return[b(W)];default:throw new Error(`Unknown parameter structure ${$.toString()}`)}}function g($,W){let te;const oe=$.numberOfParams;switch(oe){case 0:te=void 0;break;case 1:te=k($.parameterStructures,W[0]);break;default:te=[];for(let Ue=0;Ue<W.length&&Ue<oe;Ue++)te.push(b(W[Ue]));if(W.length<oe)for(let Ue=W.length;Ue<oe;Ue++)te.push(null);break}return te}const x={sendNotification:($,...W)=>{gr();let te,oe;if(n.string($)){
831
+ te=$;const Me=W[0];let tt=0,be=r.ParameterStructures.auto;r.ParameterStructures.is(Me)&&(tt=1,be=Me);let Oe=W.length;const ut=Oe-tt;switch(ut){case 0:oe=void 0;break;case 1:oe=k(be,W[tt]);break;default:if(be===r.ParameterStructures.byName)throw new Error(`Received ${ut} parameters for 'by Name' notification parameter structure.`);oe=W.slice(tt,Oe).map(nt=>b(nt));break}}else{const Me=W;te=$.method,oe=g($,Me)}const Ue={jsonrpc:ne,method:te,params:oe};return gs(Ue),M.write(Ue).catch(Me=>{throw O.error(
832
+ "Sending notification failed."),Me})},onNotification:($,W)=>{gr();let te;return n.func($)?L=$:W&&(n.string($)?(te=$,H.set($,{type:void 0,handler:W})):(te=$.method,H.set($.method,{type:$,handler:W}))),{dispose:()=>{te!==void 0?H.delete(te):L=void 0}}},onProgress:($,W,te)=>{if(Se.has(W))throw new Error(`Progress handler for token ${W} already registered`);return Se.set(W,te),{dispose:()=>{Se.delete(W)}}},sendProgress:($,W,te)=>x.sendNotification(c.type,{token:W,value:te}),onUnhandledProgress:Ie.event,
833
+ sendRequest:($,...W)=>{gr(),q();let te,oe,Ue;if(n.string($)){te=$;const Oe=W[0],ut=W[W.length-1];let nt=0,zt=r.ParameterStructures.auto;r.ParameterStructures.is(Oe)&&(nt=1,zt=Oe);let vn=W.length;o.CancellationToken.is(ut)&&(vn=vn-1,Ue=ut);const Or=vn-nt;switch(Or){case 0:oe=void 0;break;case 1:oe=k(zt,W[nt]);break;default:if(zt===r.ParameterStructures.byName)throw new Error(`Received ${Or} parameters for 'by Name' request parameter structure.`);oe=W.slice(nt,vn).map(r_=>b(r_));break}}else{const Oe=W;
834
+ te=$.method,oe=g($,Oe);const ut=$.numberOfParams;Ue=o.CancellationToken.is(Oe[ut])?Oe[ut]:void 0}const Me=Q++;let tt;Ue&&(tt=Ue.onCancellationRequested(()=>{const Oe=De.sender.sendCancellation(x,Me);return Oe===void 0?(O.log(`Received no promise from cancellation strategy when cancelling id ${Me}`),Promise.resolve()):Oe.catch(()=>{O.log(`Sending cancellation messages for id ${Me} failed`)})}));const be={jsonrpc:ne,id:Me,method:te,params:oe};return ms(be),typeof De.sender.enableCancellation=="fun\
835
+ ction"&&De.sender.enableCancellation(be),new Promise(async(Oe,ut)=>{const nt=Or=>{Oe(Or),De.sender.cleanup(Me),tt?.dispose()},zt=Or=>{ut(Or),De.sender.cleanup(Me),tt?.dispose()},vn={method:te,timerStart:Date.now(),resolve:nt,reject:zt};try{await M.write(be),Ne.set(Me,vn)}catch(Or){throw O.error("Sending request failed."),vn.reject(new r.ResponseError(r.ErrorCodes.MessageWriteError,Or.message?Or.message:"Unknown reason")),Or}})},onRequest:($,W)=>{gr();let te=null;return f.is($)?(te=void 0,ye=$):n.
836
+ string($)?(te=null,W!==void 0&&(te=$,xe.set($,{handler:W,type:void 0}))):W!==void 0&&(te=$.method,xe.set($.method,{type:$,handler:W})),{dispose:()=>{te!==null&&(te!==void 0?xe.delete(te):ye=void 0)}}},hasPendingResponse:()=>Ne.size>0,trace:async($,W,te)=>{let oe=!1,Ue=m.Text;te!==void 0&&(n.boolean(te)?oe=te:(oe=te.sendNotification||!1,Ue=te.traceFormat||m.Text)),G=$,pe=Ue,G===d.Off?U=void 0:U=W,oe&&!X()&&!Y()&&await x.sendNotification(v.type,{value:d.toString($)})},onError:Ve.event,onClose:it.event,
837
+ onUnhandledNotification:ue.event,onDispose:re.event,end:()=>{M.end()},dispose:()=>{if(Y())return;fe=B.Disposed,re.fire(void 0);const $=new r.ResponseError(r.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(const W of Ne.values())W.reject($);Ne=new Map,I=new Map,de=new Set,$e=new i.LinkedMap,n.func(M.dispose)&&M.dispose(),n.func(D.dispose)&&D.dispose()},listen:()=>{gr(),Co(),fe=B.Listening,D.listen(fs)},inspect:()=>{(0,e.default)().console.log("ins\
838
+ pect")}};return x.onNotification(w.type,$=>{if(G===d.Off||!U)return;const W=G===d.Verbose||G===d.Compact;U.log($.message,W?$.verbose:void 0)}),x.onNotification(c.type,$=>{const W=Se.get($.token);W?W($.value):Ie.fire($)}),x}t.createMessageConnection=T}(Ey)),Ey}var tk;function $y(){return tk||(tk=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ProgressType=t.ProgressToken=t.createMessageConnection=t.NullLogger=t.ConnectionOptions=t.ConnectionStrategy=t.AbstractMessageBuffer=t.WriteableStreamMessageWriter=
839
+ t.AbstractMessageWriter=t.MessageWriter=t.ReadableStreamMessageReader=t.AbstractMessageReader=t.MessageReader=t.SharedArrayReceiverStrategy=t.SharedArraySenderStrategy=t.CancellationToken=t.CancellationTokenSource=t.Emitter=t.Event=t.Disposable=t.LRUCache=t.Touch=t.LinkedMap=t.ParameterStructures=t.NotificationType9=t.NotificationType8=t.NotificationType7=t.NotificationType6=t.NotificationType5=t.NotificationType4=t.NotificationType3=t.NotificationType2=t.NotificationType1=t.NotificationType0=t.
840
+ NotificationType=t.ErrorCodes=t.ResponseError=t.RequestType9=t.RequestType8=t.RequestType7=t.RequestType6=t.RequestType5=t.RequestType4=t.RequestType3=t.RequestType2=t.RequestType1=t.RequestType0=t.RequestType=t.Message=t.RAL=void 0,t.MessageStrategy=t.CancellationStrategy=t.CancellationSenderStrategy=t.CancellationReceiverStrategy=t.ConnectionError=t.ConnectionErrors=t.LogTraceNotification=t.SetTraceNotification=t.TraceFormat=t.TraceValues=t.Trace=void 0;const e=WR();Object.defineProperty(t,"Me\
841
+ ssage",{enumerable:!0,get:function(){return e.Message}}),Object.defineProperty(t,"RequestType",{enumerable:!0,get:function(){return e.RequestType}}),Object.defineProperty(t,"RequestType0",{enumerable:!0,get:function(){return e.RequestType0}}),Object.defineProperty(t,"RequestType1",{enumerable:!0,get:function(){return e.RequestType1}}),Object.defineProperty(t,"RequestType2",{enumerable:!0,get:function(){return e.RequestType2}}),Object.defineProperty(t,"RequestType3",{enumerable:!0,get:function(){
842
+ return e.RequestType3}}),Object.defineProperty(t,"RequestType4",{enumerable:!0,get:function(){return e.RequestType4}}),Object.defineProperty(t,"RequestType5",{enumerable:!0,get:function(){return e.RequestType5}}),Object.defineProperty(t,"RequestType6",{enumerable:!0,get:function(){return e.RequestType6}}),Object.defineProperty(t,"RequestType7",{enumerable:!0,get:function(){return e.RequestType7}}),Object.defineProperty(t,"RequestType8",{enumerable:!0,get:function(){return e.RequestType8}}),Object.
843
+ defineProperty(t,"RequestType9",{enumerable:!0,get:function(){return e.RequestType9}}),Object.defineProperty(t,"ResponseError",{enumerable:!0,get:function(){return e.ResponseError}}),Object.defineProperty(t,"ErrorCodes",{enumerable:!0,get:function(){return e.ErrorCodes}}),Object.defineProperty(t,"NotificationType",{enumerable:!0,get:function(){return e.NotificationType}}),Object.defineProperty(t,"NotificationType0",{enumerable:!0,get:function(){return e.NotificationType0}}),Object.defineProperty(
844
+ t,"NotificationType1",{enumerable:!0,get:function(){return e.NotificationType1}}),Object.defineProperty(t,"NotificationType2",{enumerable:!0,get:function(){return e.NotificationType2}}),Object.defineProperty(t,"NotificationType3",{enumerable:!0,get:function(){return e.NotificationType3}}),Object.defineProperty(t,"NotificationType4",{enumerable:!0,get:function(){return e.NotificationType4}}),Object.defineProperty(t,"NotificationType5",{enumerable:!0,get:function(){return e.NotificationType5}}),Object.
845
+ defineProperty(t,"NotificationType6",{enumerable:!0,get:function(){return e.NotificationType6}}),Object.defineProperty(t,"NotificationType7",{enumerable:!0,get:function(){return e.NotificationType7}}),Object.defineProperty(t,"NotificationType8",{enumerable:!0,get:function(){return e.NotificationType8}}),Object.defineProperty(t,"NotificationType9",{enumerable:!0,get:function(){return e.NotificationType9}}),Object.defineProperty(t,"ParameterStructures",{enumerable:!0,get:function(){return e.ParameterStructures}});
846
+ const n=HR();Object.defineProperty(t,"LinkedMap",{enumerable:!0,get:function(){return n.LinkedMap}}),Object.defineProperty(t,"LRUCache",{enumerable:!0,get:function(){return n.LRUCache}}),Object.defineProperty(t,"Touch",{enumerable:!0,get:function(){return n.Touch}});const r=c3();Object.defineProperty(t,"Disposable",{enumerable:!0,get:function(){return r.Disposable}});const i=Xo();Object.defineProperty(t,"Event",{enumerable:!0,get:function(){return i.Event}}),Object.defineProperty(t,"Emitter",{enumerable:!0,
847
+ get:function(){return i.Emitter}});const s=Yf();Object.defineProperty(t,"CancellationTokenSource",{enumerable:!0,get:function(){return s.CancellationTokenSource}}),Object.defineProperty(t,"CancellationToken",{enumerable:!0,get:function(){return s.CancellationToken}});const o=l3();Object.defineProperty(t,"SharedArraySenderStrategy",{enumerable:!0,get:function(){return o.SharedArraySenderStrategy}}),Object.defineProperty(t,"SharedArrayReceiverStrategy",{enumerable:!0,get:function(){return o.SharedArrayReceiverStrategy}});
848
+ const a=d3();Object.defineProperty(t,"MessageReader",{enumerable:!0,get:function(){return a.MessageReader}}),Object.defineProperty(t,"AbstractMessageReader",{enumerable:!0,get:function(){return a.AbstractMessageReader}}),Object.defineProperty(t,"ReadableStreamMessageReader",{enumerable:!0,get:function(){return a.ReadableStreamMessageReader}});const u=f3();Object.defineProperty(t,"MessageWriter",{enumerable:!0,get:function(){return u.MessageWriter}}),Object.defineProperty(t,"AbstractMessageWriter",
849
+ {enumerable:!0,get:function(){return u.AbstractMessageWriter}}),Object.defineProperty(t,"WriteableStreamMessageWriter",{enumerable:!0,get:function(){return u.WriteableStreamMessageWriter}});const c=p3();Object.defineProperty(t,"AbstractMessageBuffer",{enumerable:!0,get:function(){return c.AbstractMessageBuffer}});const l=h3();Object.defineProperty(t,"ConnectionStrategy",{enumerable:!0,get:function(){return l.ConnectionStrategy}}),Object.defineProperty(t,"ConnectionOptions",{enumerable:!0,get:function(){
850
+ return l.ConnectionOptions}}),Object.defineProperty(t,"NullLogger",{enumerable:!0,get:function(){return l.NullLogger}}),Object.defineProperty(t,"createMessageConnection",{enumerable:!0,get:function(){return l.createMessageConnection}}),Object.defineProperty(t,"ProgressToken",{enumerable:!0,get:function(){return l.ProgressToken}}),Object.defineProperty(t,"ProgressType",{enumerable:!0,get:function(){return l.ProgressType}}),Object.defineProperty(t,"Trace",{enumerable:!0,get:function(){return l.Trace}}),
851
+ Object.defineProperty(t,"TraceValues",{enumerable:!0,get:function(){return l.TraceValues}}),Object.defineProperty(t,"TraceFormat",{enumerable:!0,get:function(){return l.TraceFormat}}),Object.defineProperty(t,"SetTraceNotification",{enumerable:!0,get:function(){return l.SetTraceNotification}}),Object.defineProperty(t,"LogTraceNotification",{enumerable:!0,get:function(){return l.LogTraceNotification}}),Object.defineProperty(t,"ConnectionErrors",{enumerable:!0,get:function(){return l.ConnectionErrors}}),
852
+ Object.defineProperty(t,"ConnectionError",{enumerable:!0,get:function(){return l.ConnectionError}}),Object.defineProperty(t,"CancellationReceiverStrategy",{enumerable:!0,get:function(){return l.CancellationReceiverStrategy}}),Object.defineProperty(t,"CancellationSenderStrategy",{enumerable:!0,get:function(){return l.CancellationSenderStrategy}}),Object.defineProperty(t,"CancellationStrategy",{enumerable:!0,get:function(){return l.CancellationStrategy}}),Object.defineProperty(t,"MessageStrategy",
853
+ {enumerable:!0,get:function(){return l.MessageStrategy}});const f=Ms();t.RAL=f.default}(by)),by}var nk;function m3(){if(nk)return cp;nk=1,Object.defineProperty(cp,"__esModule",{value:!0});const t=f_,e=$y();class n extends e.AbstractMessageBuffer{constructor(u="utf-8"){super(u)}emptyBuffer(){return n.emptyBuffer}fromString(u,c){return Buffer.from(u,c)}toString(u,c){return u instanceof Buffer?u.toString(c):new t.TextDecoder(c).decode(u)}asNative(u,c){return c===void 0?u instanceof Buffer?u:Buffer.
854
+ from(u):u instanceof Buffer?u.slice(0,c):Buffer.from(u,0,c)}allocNative(u){return Buffer.allocUnsafe(u)}}n.emptyBuffer=Buffer.allocUnsafe(0);class r{constructor(u){this.stream=u}onClose(u){return this.stream.on("close",u),e.Disposable.create(()=>this.stream.off("close",u))}onError(u){return this.stream.on("error",u),e.Disposable.create(()=>this.stream.off("error",u))}onEnd(u){return this.stream.on("end",u),e.Disposable.create(()=>this.stream.off("end",u))}onData(u){return this.stream.on("data",u),
855
+ e.Disposable.create(()=>this.stream.off("data",u))}}class i{constructor(u){this.stream=u}onClose(u){return this.stream.on("close",u),e.Disposable.create(()=>this.stream.off("close",u))}onError(u){return this.stream.on("error",u),e.Disposable.create(()=>this.stream.off("error",u))}onEnd(u){return this.stream.on("end",u),e.Disposable.create(()=>this.stream.off("end",u))}write(u,c){return new Promise((l,f)=>{const d=p=>{p==null?l():f(p)};typeof u=="string"?this.stream.write(u,c,d):this.stream.write(
856
+ u,d)})}end(){this.stream.end()}}const s=Object.freeze({messageBuffer:Object.freeze({create:a=>new n(a)}),applicationJson:Object.freeze({encoder:Object.freeze({name:"application/json",encode:(a,u)=>{try{return Promise.resolve(Buffer.from(JSON.stringify(a,void 0,0),u.charset))}catch(c){return Promise.reject(c)}}}),decoder:Object.freeze({name:"application/json",decode:(a,u)=>{try{return a instanceof Buffer?Promise.resolve(JSON.parse(a.toString(u.charset))):Promise.resolve(JSON.parse(new t.TextDecoder(
857
+ u.charset).decode(a)))}catch(c){return Promise.reject(c)}}})}),stream:Object.freeze({asReadableStream:a=>new r(a),asWritableStream:a=>new i(a)}),console,timer:Object.freeze({setTimeout(a,u,...c){const l=setTimeout(a,u,...c);return{dispose:()=>clearTimeout(l)}},setImmediate(a,...u){const c=setImmediate(a,...u);return{dispose:()=>clearImmediate(c)}},setInterval(a,u,...c){const l=setInterval(a,u,...c);return{dispose:()=>clearInterval(l)}}})});function o(){return s}return function(a){function u(){e.
858
+ RAL.install(s)}a.install=u}(o||(o={})),cp.default=o,cp}var rk;function Ks(){return rk||(rk=1,function(t){var e=zs&&zs.__createBinding||(Object.create?function(B,T,D,M){M===void 0&&(M=D);var S=Object.getOwnPropertyDescriptor(T,D);(!S||("get"in S?!T.__esModule:S.writable||S.configurable))&&(S={enumerable:!0,get:function(){return T[D]}}),Object.defineProperty(B,M,S)}:function(B,T,D,M){M===void 0&&(M=D),B[M]=T[D]}),n=zs&&zs.__exportStar||function(B,T){for(var D in B)D!=="default"&&!Object.prototype.
859
+ hasOwnProperty.call(T,D)&&e(T,B,D)};Object.defineProperty(t,"__esModule",{value:!0}),t.createMessageConnection=t.createServerSocketTransport=t.createClientSocketTransport=t.createServerPipeTransport=t.createClientPipeTransport=t.generateRandomPipeName=t.StreamMessageWriter=t.StreamMessageReader=t.SocketMessageWriter=t.SocketMessageReader=t.PortMessageWriter=t.PortMessageReader=t.IPCMessageWriter=t.IPCMessageReader=void 0;const r=m3();r.default.install();const i=qi,s=p_,o=h_,a=m_,u=$y();n($y(),t);
860
+ class c extends u.AbstractMessageReader{constructor(T){super(),this.process=T;let D=this.process;D.on("error",M=>this.fireError(M)),D.on("close",()=>this.fireClose())}listen(T){return this.process.on("message",T),u.Disposable.create(()=>this.process.off("message",T))}}t.IPCMessageReader=c;class l extends u.AbstractMessageWriter{constructor(T){super(),this.process=T,this.errorCount=0;const D=this.process;D.on("error",M=>this.fireError(M)),D.on("close",()=>this.fireClose)}write(T){try{return typeof this.
861
+ process.send=="function"&&this.process.send(T,void 0,void 0,D=>{D?(this.errorCount++,this.handleError(D,T)):this.errorCount=0}),Promise.resolve()}catch(D){return this.handleError(D,T),Promise.reject(D)}}handleError(T,D){this.errorCount++,this.fireError(T,D,this.errorCount)}end(){}}t.IPCMessageWriter=l;class f extends u.AbstractMessageReader{constructor(T){super(),this.onData=new u.Emitter,T.on("close",()=>this.fireClose),T.on("error",D=>this.fireError(D)),T.on("message",D=>{this.onData.fire(D)})}listen(T){
862
+ return this.onData.event(T)}}t.PortMessageReader=f;class d extends u.AbstractMessageWriter{constructor(T){super(),this.port=T,this.errorCount=0,T.on("close",()=>this.fireClose()),T.on("error",D=>this.fireError(D))}write(T){try{return this.port.postMessage(T),Promise.resolve()}catch(D){return this.handleError(D,T),Promise.reject(D)}}handleError(T,D){this.errorCount++,this.fireError(T,D,this.errorCount)}end(){}}t.PortMessageWriter=d;class p extends u.ReadableStreamMessageReader{constructor(T,D="ut\
863
+ f-8"){super((0,r.default)().stream.asReadableStream(T),D)}}t.SocketMessageReader=p;class m extends u.WriteableStreamMessageWriter{constructor(T,D){super((0,r.default)().stream.asWritableStream(T),D),this.socket=T}dispose(){super.dispose(),this.socket.destroy()}}t.SocketMessageWriter=m;class v extends u.ReadableStreamMessageReader{constructor(T,D){super((0,r.default)().stream.asReadableStream(T),D)}}t.StreamMessageReader=v;class w extends u.WriteableStreamMessageWriter{constructor(T,D){super((0,r.
864
+ default)().stream.asWritableStream(T),D)}}t.StreamMessageWriter=w;const y=process.env.XDG_RUNTIME_DIR,E=new Map([["linux",107],["darwin",103]]);function R(){const B=(0,o.randomBytes)(21).toString("hex");if(process.platform==="win32")return`\\\\.\\pipe\\vscode-jsonrpc-${B}-sock`;let T;y?T=i.join(y,`vscode-ipc-${B}.sock`):T=i.join(s.tmpdir(),`vscode-${B}.sock`);const D=E.get(process.platform);return D!==void 0&&T.length>D&&(0,r.default)().console.warn(`WARNING: IPC handle "${T}" is longer than ${D}\
865
+ characters.`),T}t.generateRandomPipeName=R;function A(B,T="utf-8"){let D;const M=new Promise((S,P)=>{D=S});return new Promise((S,P)=>{let O=(0,a.createServer)(Q=>{O.close(),D([new p(Q,T),new m(Q,T)])});O.on("error",P),O.listen(B,()=>{O.removeListener("error",P),S({onConnected:()=>M})})})}t.createClientPipeTransport=A;function N(B,T="utf-8"){const D=(0,a.createConnection)(B);return[new p(D,T),new m(D,T)]}t.createServerPipeTransport=N;function V(B,T="utf-8"){let D;const M=new Promise((S,P)=>{D=S});
866
+ return new Promise((S,P)=>{const O=(0,a.createServer)(Q=>{O.close(),D([new p(Q,T),new m(Q,T)])});O.on("error",P),O.listen(B,"127.0.0.1",()=>{O.removeListener("error",P),S({onConnected:()=>M})})})}t.createClientSocketTransport=V;function J(B,T="utf-8"){const D=(0,a.createConnection)(B,"127.0.0.1");return[new p(D,T),new m(D,T)]}t.createServerSocketTransport=J;function se(B){const T=B;return T.read!==void 0&&T.addListener!==void 0}function ie(B){const T=B;return T.write!==void 0&&T.addListener!==void 0}
867
+ function we(B,T,D,M){D||(D=u.NullLogger);const S=se(B)?new v(B):B,P=ie(T)?new w(T):T;return u.ConnectionStrategy.is(M)&&(M={connectionStrategy:M}),(0,u.createMessageConnection)(S,P,D,M)}t.createMessageConnection=we}(zs)),zs}var Dy,ik;function sk(){return ik||(ik=1,Dy=Ks()),Dy}var Vs={},lp={exports:{}},ok;function Ry(){return ok||(ok=1,function(t,e){(function(n){{var r=n(ab,e);r!==void 0&&(t.exports=r)}})(function(n,r){Object.defineProperty(r,"__esModule",{value:!0}),r.TextDocument=r.EOL=r.WorkspaceFolder=
868
+ r.InlineCompletionContext=r.SelectedCompletionInfo=r.InlineCompletionTriggerKind=r.InlineCompletionList=r.InlineCompletionItem=r.StringValue=r.InlayHint=r.InlayHintLabelPart=r.InlayHintKind=r.InlineValueContext=r.InlineValueEvaluatableExpression=r.InlineValueVariableLookup=r.InlineValueText=r.SemanticTokens=r.SemanticTokenModifiers=r.SemanticTokenTypes=r.SelectionRange=r.DocumentLink=r.FormattingOptions=r.CodeLens=r.CodeAction=r.CodeActionContext=r.CodeActionTriggerKind=r.CodeActionKind=r.DocumentSymbol=
869
+ r.WorkspaceSymbol=r.SymbolInformation=r.SymbolTag=r.SymbolKind=r.DocumentHighlight=r.DocumentHighlightKind=r.SignatureInformation=r.ParameterInformation=r.Hover=r.MarkedString=r.CompletionList=r.CompletionItem=r.CompletionItemLabelDetails=r.InsertTextMode=r.InsertReplaceEdit=r.CompletionItemTag=r.InsertTextFormat=r.CompletionItemKind=r.MarkupContent=r.MarkupKind=r.TextDocumentItem=r.OptionalVersionedTextDocumentIdentifier=r.VersionedTextDocumentIdentifier=r.TextDocumentIdentifier=r.WorkspaceChange=
870
+ r.WorkspaceEdit=r.DeleteFile=r.RenameFile=r.CreateFile=r.TextDocumentEdit=r.AnnotatedTextEdit=r.ChangeAnnotationIdentifier=r.ChangeAnnotation=r.TextEdit=r.Command=r.Diagnostic=r.CodeDescription=r.DiagnosticTag=r.DiagnosticSeverity=r.DiagnosticRelatedInformation=r.FoldingRange=r.FoldingRangeKind=r.ColorPresentation=r.ColorInformation=r.Color=r.LocationLink=r.Location=r.Range=r.Position=r.uinteger=r.integer=r.URI=r.DocumentUri=void 0;var i;(function(b){function _(h){return typeof h=="string"}b.is=
871
+ _})(i||(r.DocumentUri=i={}));var s;(function(b){function _(h){return typeof h=="string"}b.is=_})(s||(r.URI=s={}));var o;(function(b){b.MIN_VALUE=-2147483648,b.MAX_VALUE=2147483647;function _(h){return typeof h=="number"&&b.MIN_VALUE<=h&&h<=b.MAX_VALUE}b.is=_})(o||(r.integer=o={}));var a;(function(b){b.MIN_VALUE=0,b.MAX_VALUE=2147483647;function _(h){return typeof h=="number"&&b.MIN_VALUE<=h&&h<=b.MAX_VALUE}b.is=_})(a||(r.uinteger=a={}));var u;(function(b){function _(k,g){return k===Number.MAX_VALUE&&
872
+ (k=a.MAX_VALUE),g===Number.MAX_VALUE&&(g=a.MAX_VALUE),{line:k,character:g}}b.create=_;function h(k){var g=k;return q.objectLiteral(g)&&q.uinteger(g.line)&&q.uinteger(g.character)}b.is=h})(u||(r.Position=u={}));var c;(function(b){function _(k,g,x,$){if(q.uinteger(k)&&q.uinteger(g)&&q.uinteger(x)&&q.uinteger($))return{start:u.create(k,g),end:u.create(x,$)};if(u.is(k)&&u.is(g))return{start:k,end:g};throw new Error("Range#create called with invalid arguments[".concat(k,", ").concat(g,", ").concat(x,
873
+ ", ").concat($,"]"))}b.create=_;function h(k){var g=k;return q.objectLiteral(g)&&u.is(g.start)&&u.is(g.end)}b.is=h})(c||(r.Range=c={}));var l;(function(b){function _(k,g){return{uri:k,range:g}}b.create=_;function h(k){var g=k;return q.objectLiteral(g)&&c.is(g.range)&&(q.string(g.uri)||q.undefined(g.uri))}b.is=h})(l||(r.Location=l={}));var f;(function(b){function _(k,g,x,$){return{targetUri:k,targetRange:g,targetSelectionRange:x,originSelectionRange:$}}b.create=_;function h(k){var g=k;return q.objectLiteral(
874
+ g)&&c.is(g.targetRange)&&q.string(g.targetUri)&&c.is(g.targetSelectionRange)&&(c.is(g.originSelectionRange)||q.undefined(g.originSelectionRange))}b.is=h})(f||(r.LocationLink=f={}));var d;(function(b){function _(k,g,x,$){return{red:k,green:g,blue:x,alpha:$}}b.create=_;function h(k){var g=k;return q.objectLiteral(g)&&q.numberRange(g.red,0,1)&&q.numberRange(g.green,0,1)&&q.numberRange(g.blue,0,1)&&q.numberRange(g.alpha,0,1)}b.is=h})(d||(r.Color=d={}));var p;(function(b){function _(k,g){return{range:k,
875
+ color:g}}b.create=_;function h(k){var g=k;return q.objectLiteral(g)&&c.is(g.range)&&d.is(g.color)}b.is=h})(p||(r.ColorInformation=p={}));var m;(function(b){function _(k,g,x){return{label:k,textEdit:g,additionalTextEdits:x}}b.create=_;function h(k){var g=k;return q.objectLiteral(g)&&q.string(g.label)&&(q.undefined(g.textEdit)||J.is(g))&&(q.undefined(g.additionalTextEdits)||q.typedArray(g.additionalTextEdits,J.is))}b.is=h})(m||(r.ColorPresentation=m={}));var v;(function(b){b.Comment="comment",b.Imports=
876
+ "imports",b.Region="region"})(v||(r.FoldingRangeKind=v={}));var w;(function(b){function _(k,g,x,$,W,te){var oe={startLine:k,endLine:g};return q.defined(x)&&(oe.startCharacter=x),q.defined($)&&(oe.endCharacter=$),q.defined(W)&&(oe.kind=W),q.defined(te)&&(oe.collapsedText=te),oe}b.create=_;function h(k){var g=k;return q.objectLiteral(g)&&q.uinteger(g.startLine)&&q.uinteger(g.startLine)&&(q.undefined(g.startCharacter)||q.uinteger(g.startCharacter))&&(q.undefined(g.endCharacter)||q.uinteger(g.endCharacter))&&
877
+ (q.undefined(g.kind)||q.string(g.kind))}b.is=h})(w||(r.FoldingRange=w={}));var y;(function(b){function _(k,g){return{location:k,message:g}}b.create=_;function h(k){var g=k;return q.defined(g)&&l.is(g.location)&&q.string(g.message)}b.is=h})(y||(r.DiagnosticRelatedInformation=y={}));var E;(function(b){b.Error=1,b.Warning=2,b.Information=3,b.Hint=4})(E||(r.DiagnosticSeverity=E={}));var R;(function(b){b.Unnecessary=1,b.Deprecated=2})(R||(r.DiagnosticTag=R={}));var A;(function(b){function _(h){var k=h;
878
+ return q.objectLiteral(k)&&q.string(k.href)}b.is=_})(A||(r.CodeDescription=A={}));var N;(function(b){function _(k,g,x,$,W,te){var oe={range:k,message:g};return q.defined(x)&&(oe.severity=x),q.defined($)&&(oe.code=$),q.defined(W)&&(oe.source=W),q.defined(te)&&(oe.relatedInformation=te),oe}b.create=_;function h(k){var g,x=k;return q.defined(x)&&c.is(x.range)&&q.string(x.message)&&(q.number(x.severity)||q.undefined(x.severity))&&(q.integer(x.code)||q.string(x.code)||q.undefined(x.code))&&(q.undefined(
879
+ x.codeDescription)||q.string((g=x.codeDescription)===null||g===void 0?void 0:g.href))&&(q.string(x.source)||q.undefined(x.source))&&(q.undefined(x.relatedInformation)||q.typedArray(x.relatedInformation,y.is))}b.is=h})(N||(r.Diagnostic=N={}));var V;(function(b){function _(k,g){for(var x=[],$=2;$<arguments.length;$++)x[$-2]=arguments[$];var W={title:k,command:g};return q.defined(x)&&x.length>0&&(W.arguments=x),W}b.create=_;function h(k){var g=k;return q.defined(g)&&q.string(g.title)&&q.string(g.command)}
880
+ b.is=h})(V||(r.Command=V={}));var J;(function(b){function _(x,$){return{range:x,newText:$}}b.replace=_;function h(x,$){return{range:{start:x,end:x},newText:$}}b.insert=h;function k(x){return{range:x,newText:""}}b.del=k;function g(x){var $=x;return q.objectLiteral($)&&q.string($.newText)&&c.is($.range)}b.is=g})(J||(r.TextEdit=J={}));var se;(function(b){function _(k,g,x){var $={label:k};return g!==void 0&&($.needsConfirmation=g),x!==void 0&&($.description=x),$}b.create=_;function h(k){var g=k;return q.
881
+ objectLiteral(g)&&q.string(g.label)&&(q.boolean(g.needsConfirmation)||g.needsConfirmation===void 0)&&(q.string(g.description)||g.description===void 0)}b.is=h})(se||(r.ChangeAnnotation=se={}));var ie;(function(b){function _(h){var k=h;return q.string(k)}b.is=_})(ie||(r.ChangeAnnotationIdentifier=ie={}));var we;(function(b){function _(x,$,W){return{range:x,newText:$,annotationId:W}}b.replace=_;function h(x,$,W){return{range:{start:x,end:x},newText:$,annotationId:W}}b.insert=h;function k(x,$){return{
882
+ range:x,newText:"",annotationId:$}}b.del=k;function g(x){var $=x;return J.is($)&&(se.is($.annotationId)||ie.is($.annotationId))}b.is=g})(we||(r.AnnotatedTextEdit=we={}));var B;(function(b){function _(k,g){return{textDocument:k,edits:g}}b.create=_;function h(k){var g=k;return q.defined(g)&&ne.is(g.textDocument)&&Array.isArray(g.edits)}b.is=h})(B||(r.TextDocumentEdit=B={}));var T;(function(b){function _(k,g,x){var $={kind:"create",uri:k};return g!==void 0&&(g.overwrite!==void 0||g.ignoreIfExists!==
883
+ void 0)&&($.options=g),x!==void 0&&($.annotationId=x),$}b.create=_;function h(k){var g=k;return g&&g.kind==="create"&&q.string(g.uri)&&(g.options===void 0||(g.options.overwrite===void 0||q.boolean(g.options.overwrite))&&(g.options.ignoreIfExists===void 0||q.boolean(g.options.ignoreIfExists)))&&(g.annotationId===void 0||ie.is(g.annotationId))}b.is=h})(T||(r.CreateFile=T={}));var D;(function(b){function _(k,g,x,$){var W={kind:"rename",oldUri:k,newUri:g};return x!==void 0&&(x.overwrite!==void 0||x.
884
+ ignoreIfExists!==void 0)&&(W.options=x),$!==void 0&&(W.annotationId=$),W}b.create=_;function h(k){var g=k;return g&&g.kind==="rename"&&q.string(g.oldUri)&&q.string(g.newUri)&&(g.options===void 0||(g.options.overwrite===void 0||q.boolean(g.options.overwrite))&&(g.options.ignoreIfExists===void 0||q.boolean(g.options.ignoreIfExists)))&&(g.annotationId===void 0||ie.is(g.annotationId))}b.is=h})(D||(r.RenameFile=D={}));var M;(function(b){function _(k,g,x){var $={kind:"delete",uri:k};return g!==void 0&&
885
+ (g.recursive!==void 0||g.ignoreIfNotExists!==void 0)&&($.options=g),x!==void 0&&($.annotationId=x),$}b.create=_;function h(k){var g=k;return g&&g.kind==="delete"&&q.string(g.uri)&&(g.options===void 0||(g.options.recursive===void 0||q.boolean(g.options.recursive))&&(g.options.ignoreIfNotExists===void 0||q.boolean(g.options.ignoreIfNotExists)))&&(g.annotationId===void 0||ie.is(g.annotationId))}b.is=h})(M||(r.DeleteFile=M={}));var S;(function(b){function _(h){var k=h;return k&&(k.changes!==void 0||
886
+ k.documentChanges!==void 0)&&(k.documentChanges===void 0||k.documentChanges.every(function(g){return q.string(g.kind)?T.is(g)||D.is(g)||M.is(g):B.is(g)}))}b.is=_})(S||(r.WorkspaceEdit=S={}));var P=function(){function b(_,h){this.edits=_,this.changeAnnotations=h}return b.prototype.insert=function(_,h,k){var g,x;if(k===void 0?g=J.insert(_,h):ie.is(k)?(x=k,g=we.insert(_,h,k)):(this.assertChangeAnnotations(this.changeAnnotations),x=this.changeAnnotations.manage(k),g=we.insert(_,h,x)),this.edits.push(
887
+ g),x!==void 0)return x},b.prototype.replace=function(_,h,k){var g,x;if(k===void 0?g=J.replace(_,h):ie.is(k)?(x=k,g=we.replace(_,h,k)):(this.assertChangeAnnotations(this.changeAnnotations),x=this.changeAnnotations.manage(k),g=we.replace(_,h,x)),this.edits.push(g),x!==void 0)return x},b.prototype.delete=function(_,h){var k,g;if(h===void 0?k=J.del(_):ie.is(h)?(g=h,k=we.del(_,h)):(this.assertChangeAnnotations(this.changeAnnotations),g=this.changeAnnotations.manage(h),k=we.del(_,g)),this.edits.push(k),
888
+ g!==void 0)return g},b.prototype.add=function(_){this.edits.push(_)},b.prototype.all=function(){return this.edits},b.prototype.clear=function(){this.edits.splice(0,this.edits.length)},b.prototype.assertChangeAnnotations=function(_){if(_===void 0)throw new Error("Text edit change is not configured to manage change annotations.")},b}(),O=function(){function b(_){this._annotations=_===void 0?Object.create(null):_,this._counter=0,this._size=0}return b.prototype.all=function(){return this._annotations},
889
+ Object.defineProperty(b.prototype,"size",{get:function(){return this._size},enumerable:!1,configurable:!0}),b.prototype.manage=function(_,h){var k;if(ie.is(_)?k=_:(k=this.nextId(),h=_),this._annotations[k]!==void 0)throw new Error("Id ".concat(k," is already in use."));if(h===void 0)throw new Error("No annotation provided for id ".concat(k));return this._annotations[k]=h,this._size++,k},b.prototype.nextId=function(){return this._counter++,this._counter.toString()},b}(),Q=function(){function b(_){
890
+ var h=this;this._textEditChanges=Object.create(null),_!==void 0?(this._workspaceEdit=_,_.documentChanges?(this._changeAnnotations=new O(_.changeAnnotations),_.changeAnnotations=this._changeAnnotations.all(),_.documentChanges.forEach(function(k){if(B.is(k)){var g=new P(k.edits,h._changeAnnotations);h._textEditChanges[k.textDocument.uri]=g}})):_.changes&&Object.keys(_.changes).forEach(function(k){var g=new P(_.changes[k]);h._textEditChanges[k]=g})):this._workspaceEdit={}}return Object.defineProperty(
891
+ b.prototype,"edit",{get:function(){return this.initDocumentChanges(),this._changeAnnotations!==void 0&&(this._changeAnnotations.size===0?this._workspaceEdit.changeAnnotations=void 0:this._workspaceEdit.changeAnnotations=this._changeAnnotations.all()),this._workspaceEdit},enumerable:!1,configurable:!0}),b.prototype.getTextEditChange=function(_){if(ne.is(_)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document cha\
892
+ nges.");var h={uri:_.uri,version:_.version},k=this._textEditChanges[h.uri];if(!k){var g=[],x={textDocument:h,edits:g};this._workspaceEdit.documentChanges.push(x),k=new P(g,this._changeAnnotations),this._textEditChanges[h.uri]=k}return k}else{if(this.initChanges(),this._workspaceEdit.changes===void 0)throw new Error("Workspace edit is not configured for normal text edit changes.");var k=this._textEditChanges[_];if(!k){var g=[];this._workspaceEdit.changes[_]=g,k=new P(g),this._textEditChanges[_]=k}
893
+ return k}},b.prototype.initDocumentChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new O,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())},b.prototype.initChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._workspaceEdit.changes=Object.create(null))},b.prototype.createFile=function(_,h,k){if(this.initDocumentChanges(),
894
+ this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var g;se.is(h)||ie.is(h)?g=h:k=h;var x,$;if(g===void 0?x=T.create(_,k):($=ie.is(g)?g:this._changeAnnotations.manage(g),x=T.create(_,k,$)),this._workspaceEdit.documentChanges.push(x),$!==void 0)return $},b.prototype.renameFile=function(_,h,k,g){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document\
895
+ changes.");var x;se.is(k)||ie.is(k)?x=k:g=k;var $,W;if(x===void 0?$=D.create(_,h,g):(W=ie.is(x)?x:this._changeAnnotations.manage(x),$=D.create(_,h,g,W)),this._workspaceEdit.documentChanges.push($),W!==void 0)return W},b.prototype.deleteFile=function(_,h,k){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var g;se.is(h)||ie.is(h)?g=h:k=h;var x,$;if(g===void 0?x=M.create(_,k):($=ie.is(g)?g:this._changeAnnotations.
896
+ manage(g),x=M.create(_,k,$)),this._workspaceEdit.documentChanges.push(x),$!==void 0)return $},b}();r.WorkspaceChange=Q;var z;(function(b){function _(k){return{uri:k}}b.create=_;function h(k){var g=k;return q.defined(g)&&q.string(g.uri)}b.is=h})(z||(r.TextDocumentIdentifier=z={}));var C;(function(b){function _(k,g){return{uri:k,version:g}}b.create=_;function h(k){var g=k;return q.defined(g)&&q.string(g.uri)&&q.integer(g.version)}b.is=h})(C||(r.VersionedTextDocumentIdentifier=C={}));var ne;(function(b){
897
+ function _(k,g){return{uri:k,version:g}}b.create=_;function h(k){var g=k;return q.defined(g)&&q.string(g.uri)&&(g.version===null||q.integer(g.version))}b.is=h})(ne||(r.OptionalVersionedTextDocumentIdentifier=ne={}));var ye;(function(b){function _(k,g,x,$){return{uri:k,languageId:g,version:x,text:$}}b.create=_;function h(k){var g=k;return q.defined(g)&&q.string(g.uri)&&q.string(g.languageId)&&q.integer(g.version)&&q.string(g.text)}b.is=h})(ye||(r.TextDocumentItem=ye={}));var xe;(function(b){b.PlainText=
898
+ "plaintext",b.Markdown="markdown";function _(h){var k=h;return k===b.PlainText||k===b.Markdown}b.is=_})(xe||(r.MarkupKind=xe={}));var L;(function(b){function _(h){var k=h;return q.objectLiteral(h)&&xe.is(k.kind)&&q.string(k.value)}b.is=_})(L||(r.MarkupContent=L={}));var H;(function(b){b.Text=1,b.Method=2,b.Function=3,b.Constructor=4,b.Field=5,b.Variable=6,b.Class=7,b.Interface=8,b.Module=9,b.Property=10,b.Unit=11,b.Value=12,b.Enum=13,b.Keyword=14,b.Snippet=15,b.Color=16,b.File=17,b.Reference=18,
899
+ b.Folder=19,b.EnumMember=20,b.Constant=21,b.Struct=22,b.Event=23,b.Operator=24,b.TypeParameter=25})(H||(r.CompletionItemKind=H={}));var Se;(function(b){b.PlainText=1,b.Snippet=2})(Se||(r.InsertTextFormat=Se={}));var le;(function(b){b.Deprecated=1})(le||(r.CompletionItemTag=le={}));var $e;(function(b){function _(k,g,x){return{newText:k,insert:g,replace:x}}b.create=_;function h(k){var g=k;return g&&q.string(g.newText)&&c.is(g.insert)&&c.is(g.replace)}b.is=h})($e||(r.InsertReplaceEdit=$e={}));var Ne;
900
+ (function(b){b.asIs=1,b.adjustIndentation=2})(Ne||(r.InsertTextMode=Ne={}));var de;(function(b){function _(h){var k=h;return k&&(q.string(k.detail)||k.detail===void 0)&&(q.string(k.description)||k.description===void 0)}b.is=_})(de||(r.CompletionItemLabelDetails=de={}));var I;(function(b){function _(h){return{label:h}}b.create=_})(I||(r.CompletionItem=I={}));var G;(function(b){function _(h,k){return{items:h||[],isIncomplete:!!k}}b.create=_})(G||(r.CompletionList=G={}));var pe;(function(b){function _(k){
901
+ return k.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}b.fromPlainText=_;function h(k){var g=k;return q.string(g)||q.objectLiteral(g)&&q.string(g.language)&&q.string(g.value)}b.is=h})(pe||(r.MarkedString=pe={}));var U;(function(b){function _(h){var k=h;return!!k&&q.objectLiteral(k)&&(L.is(k.contents)||pe.is(k.contents)||q.typedArray(k.contents,pe.is))&&(h.range===void 0||c.is(h.range))}b.is=_})(U||(r.Hover=U={}));var fe;(function(b){function _(h,k){return k?{label:h,documentation:k}:{label:h}}b.create=
902
+ _})(fe||(r.ParameterInformation=fe={}));var Ve;(function(b){function _(h,k){for(var g=[],x=2;x<arguments.length;x++)g[x-2]=arguments[x];var $={label:h};return q.defined(k)&&($.documentation=k),q.defined(g)?$.parameters=g:$.parameters=[],$}b.create=_})(Ve||(r.SignatureInformation=Ve={}));var it;(function(b){b.Text=1,b.Read=2,b.Write=3})(it||(r.DocumentHighlightKind=it={}));var ue;(function(b){function _(h,k){var g={range:h};return q.number(k)&&(g.kind=k),g}b.create=_})(ue||(r.DocumentHighlight=ue=
903
+ {}));var Ie;(function(b){b.File=1,b.Module=2,b.Namespace=3,b.Package=4,b.Class=5,b.Method=6,b.Property=7,b.Field=8,b.Constructor=9,b.Enum=10,b.Interface=11,b.Function=12,b.Variable=13,b.Constant=14,b.String=15,b.Number=16,b.Boolean=17,b.Array=18,b.Object=19,b.Key=20,b.Null=21,b.EnumMember=22,b.Struct=23,b.Event=24,b.Operator=25,b.TypeParameter=26})(Ie||(r.SymbolKind=Ie={}));var re;(function(b){b.Deprecated=1})(re||(r.SymbolTag=re={}));var De;(function(b){function _(h,k,g,x,$){var W={name:h,kind:k,
904
+ location:{uri:x,range:g}};return $&&(W.containerName=$),W}b.create=_})(De||(r.SymbolInformation=De={}));var Ge;(function(b){function _(h,k,g,x){return x!==void 0?{name:h,kind:k,location:{uri:g,range:x}}:{name:h,kind:k,location:{uri:g}}}b.create=_})(Ge||(r.WorkspaceSymbol=Ge={}));var wt;(function(b){function _(k,g,x,$,W,te){var oe={name:k,detail:g,kind:x,range:$,selectionRange:W};return te!==void 0&&(oe.children=te),oe}b.create=_;function h(k){var g=k;return g&&q.string(g.name)&&q.number(g.kind)&&
905
+ c.is(g.range)&&c.is(g.selectionRange)&&(g.detail===void 0||q.string(g.detail))&&(g.deprecated===void 0||q.boolean(g.deprecated))&&(g.children===void 0||Array.isArray(g.children))&&(g.tags===void 0||Array.isArray(g.tags))}b.is=h})(wt||(r.DocumentSymbol=wt={}));var et;(function(b){b.Empty="",b.QuickFix="quickfix",b.Refactor="refactor",b.RefactorExtract="refactor.extract",b.RefactorInline="refactor.inline",b.RefactorRewrite="refactor.rewrite",b.Source="source",b.SourceOrganizeImports="source.organi\
906
+ zeImports",b.SourceFixAll="source.fixAll"})(et||(r.CodeActionKind=et={}));var Xt;(function(b){b.Invoked=1,b.Automatic=2})(Xt||(r.CodeActionTriggerKind=Xt={}));var tn;(function(b){function _(k,g,x){var $={diagnostics:k};return g!=null&&($.only=g),x!=null&&($.triggerKind=x),$}b.create=_;function h(k){var g=k;return q.defined(g)&&q.typedArray(g.diagnostics,N.is)&&(g.only===void 0||q.typedArray(g.only,q.string))&&(g.triggerKind===void 0||g.triggerKind===Xt.Invoked||g.triggerKind===Xt.Automatic)}b.is=
907
+ h})(tn||(r.CodeActionContext=tn={}));var yn;(function(b){function _(k,g,x){var $={title:k},W=!0;return typeof g=="string"?(W=!1,$.kind=g):V.is(g)?$.command=g:$.edit=g,W&&x!==void 0&&($.kind=x),$}b.create=_;function h(k){var g=k;return g&&q.string(g.title)&&(g.diagnostics===void 0||q.typedArray(g.diagnostics,N.is))&&(g.kind===void 0||q.string(g.kind))&&(g.edit!==void 0||g.command!==void 0)&&(g.command===void 0||V.is(g.command))&&(g.isPreferred===void 0||q.boolean(g.isPreferred))&&(g.edit===void 0||
908
+ S.is(g.edit))}b.is=h})(yn||(r.CodeAction=yn={}));var X;(function(b){function _(k,g){var x={range:k};return q.defined(g)&&(x.data=g),x}b.create=_;function h(k){var g=k;return q.defined(g)&&c.is(g.range)&&(q.undefined(g.command)||V.is(g.command))}b.is=h})(X||(r.CodeLens=X={}));var Y;(function(b){function _(k,g){return{tabSize:k,insertSpaces:g}}b.create=_;function h(k){var g=k;return q.defined(g)&&q.uinteger(g.tabSize)&&q.boolean(g.insertSpaces)}b.is=h})(Y||(r.FormattingOptions=Y={}));var he;(function(b){
909
+ function _(k,g,x){return{range:k,target:g,data:x}}b.create=_;function h(k){var g=k;return q.defined(g)&&c.is(g.range)&&(q.undefined(g.target)||q.string(g.target))}b.is=h})(he||(r.DocumentLink=he={}));var nn;(function(b){function _(k,g){return{range:k,parent:g}}b.create=_;function h(k){var g=k;return q.objectLiteral(g)&&c.is(g.range)&&(g.parent===void 0||b.is(g.parent))}b.is=h})(nn||(r.SelectionRange=nn={}));var Yt;(function(b){b.namespace="namespace",b.type="type",b.class="class",b.enum="enum",b.
910
+ interface="interface",b.struct="struct",b.typeParameter="typeParameter",b.parameter="parameter",b.variable="variable",b.property="property",b.enumMember="enumMember",b.event="event",b.function="function",b.method="method",b.macro="macro",b.keyword="keyword",b.modifier="modifier",b.comment="comment",b.string="string",b.number="number",b.regexp="regexp",b.operator="operator",b.decorator="decorator"})(Yt||(r.SemanticTokenTypes=Yt={}));var Nr;(function(b){b.declaration="declaration",b.definition="de\
911
+ finition",b.readonly="readonly",b.static="static",b.deprecated="deprecated",b.abstract="abstract",b.async="async",b.modification="modification",b.documentation="documentation",b.defaultLibrary="defaultLibrary"})(Nr||(r.SemanticTokenModifiers=Nr={}));var Fi;(function(b){function _(h){var k=h;return q.objectLiteral(k)&&(k.resultId===void 0||typeof k.resultId=="string")&&Array.isArray(k.data)&&(k.data.length===0||typeof k.data[0]=="number")}b.is=_})(Fi||(r.SemanticTokens=Fi={}));var ds;(function(b){
912
+ function _(k,g){return{range:k,text:g}}b.create=_;function h(k){var g=k;return g!=null&&c.is(g.range)&&q.string(g.text)}b.is=h})(ds||(r.InlineValueText=ds={}));var fs;(function(b){function _(k,g,x){return{range:k,variableName:g,caseSensitiveLookup:x}}b.create=_;function h(k){var g=k;return g!=null&&c.is(g.range)&&q.boolean(g.caseSensitiveLookup)&&(q.string(g.variableName)||g.variableName===void 0)}b.is=h})(fs||(r.InlineValueVariableLookup=fs={}));var ps;(function(b){function _(k,g){return{range:k,
913
+ expression:g}}b.create=_;function h(k){var g=k;return g!=null&&c.is(g.range)&&(q.string(g.expression)||g.expression===void 0)}b.is=h})(ps||(r.InlineValueEvaluatableExpression=ps={}));var hs;(function(b){function _(k,g){return{frameId:k,stoppedLocation:g}}b.create=_;function h(k){var g=k;return q.defined(g)&&c.is(k.stoppedLocation)}b.is=h})(hs||(r.InlineValueContext=hs={}));var Li;(function(b){b.Type=1,b.Parameter=2;function _(h){return h===1||h===2}b.is=_})(Li||(r.InlayHintKind=Li={}));var Mi;(function(b){
914
+ function _(k){return{value:k}}b.create=_;function h(k){var g=k;return q.objectLiteral(g)&&(g.tooltip===void 0||q.string(g.tooltip)||L.is(g.tooltip))&&(g.location===void 0||l.is(g.location))&&(g.command===void 0||V.is(g.command))}b.is=h})(Mi||(r.InlayHintLabelPart=Mi={}));var Pn;(function(b){function _(k,g,x){var $={position:k,label:g};return x!==void 0&&($.kind=x),$}b.create=_;function h(k){var g=k;return q.objectLiteral(g)&&u.is(g.position)&&(q.string(g.label)||q.typedArray(g.label,Mi.is))&&(g.
915
+ kind===void 0||Li.is(g.kind))&&g.textEdits===void 0||q.typedArray(g.textEdits,J.is)&&(g.tooltip===void 0||q.string(g.tooltip)||L.is(g.tooltip))&&(g.paddingLeft===void 0||q.boolean(g.paddingLeft))&&(g.paddingRight===void 0||q.boolean(g.paddingRight))}b.is=h})(Pn||(r.InlayHint=Pn={}));var ms;(function(b){function _(h){return{kind:"snippet",value:h}}b.createSnippet=_})(ms||(r.StringValue=ms={}));var gs;(function(b){function _(h,k,g,x){return{insertText:h,filterText:k,range:g,command:x}}b.create=_})(
916
+ gs||(r.InlineCompletionItem=gs={}));var Ir;(function(b){function _(h){return{items:h}}b.create=_})(Ir||(r.InlineCompletionList=Ir={}));var ys;(function(b){b.Invoked=0,b.Automatic=1})(ys||(r.InlineCompletionTriggerKind=ys={}));var Yr;(function(b){function _(h,k){return{range:h,text:k}}b.create=_})(Yr||(r.SelectedCompletionInfo=Yr={}));var vs;(function(b){function _(h,k){return{triggerKind:h,selectedCompletionInfo:k}}b.create=_})(vs||(r.InlineCompletionContext=vs={}));var nr;(function(b){function _(h){
917
+ var k=h;return q.objectLiteral(k)&&s.is(k.uri)&&q.string(k.name)}b.is=_})(nr||(r.WorkspaceFolder=nr={})),r.EOL=[`
918
+ `,`\r
919
+ `,"\r"];var gr;(function(b){function _(x,$,W,te){return new Co(x,$,W,te)}b.create=_;function h(x){var $=x;return!!(q.defined($)&&q.string($.uri)&&(q.undefined($.languageId)||q.string($.languageId))&&q.uinteger($.lineCount)&&q.func($.getText)&&q.func($.positionAt)&&q.func($.offsetAt))}b.is=h;function k(x,$){for(var W=x.getText(),te=g($,function(Oe,ut){var nt=Oe.range.start.line-ut.range.start.line;return nt===0?Oe.range.start.character-ut.range.start.character:nt}),oe=W.length,Ue=te.length-1;Ue>=
920
+ 0;Ue--){var Me=te[Ue],tt=x.offsetAt(Me.range.start),be=x.offsetAt(Me.range.end);if(be<=oe)W=W.substring(0,tt)+Me.newText+W.substring(be,W.length);else throw new Error("Overlapping edit");oe=tt}return W}b.applyEdits=k;function g(x,$){if(x.length<=1)return x;var W=x.length/2|0,te=x.slice(0,W),oe=x.slice(W);g(te,$),g(oe,$);for(var Ue=0,Me=0,tt=0;Ue<te.length&&Me<oe.length;){var be=$(te[Ue],oe[Me]);be<=0?x[tt++]=te[Ue++]:x[tt++]=oe[Me++]}for(;Ue<te.length;)x[tt++]=te[Ue++];for(;Me<oe.length;)x[tt++]=
921
+ oe[Me++];return x}})(gr||(r.TextDocument=gr={}));var Co=function(){function b(_,h,k,g){this._uri=_,this._languageId=h,this._version=k,this._content=g,this._lineOffsets=void 0}return Object.defineProperty(b.prototype,"uri",{get:function(){return this._uri},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"languageId",{get:function(){return this._languageId},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"version",{get:function(){return this._version},enumerable:!1,
922
+ configurable:!0}),b.prototype.getText=function(_){if(_){var h=this.offsetAt(_.start),k=this.offsetAt(_.end);return this._content.substring(h,k)}return this._content},b.prototype.update=function(_,h){this._content=_.text,this._version=h,this._lineOffsets=void 0},b.prototype.getLineOffsets=function(){if(this._lineOffsets===void 0){for(var _=[],h=this._content,k=!0,g=0;g<h.length;g++){k&&(_.push(g),k=!1);var x=h.charAt(g);k=x==="\r"||x===`
923
+ `,x==="\r"&&g+1<h.length&&h.charAt(g+1)===`
924
+ `&&g++}k&&h.length>0&&_.push(h.length),this._lineOffsets=_}return this._lineOffsets},b.prototype.positionAt=function(_){_=Math.max(Math.min(_,this._content.length),0);var h=this.getLineOffsets(),k=0,g=h.length;if(g===0)return u.create(0,_);for(;k<g;){var x=Math.floor((k+g)/2);h[x]>_?g=x:k=x+1}var $=k-1;return u.create($,_-h[$])},b.prototype.offsetAt=function(_){var h=this.getLineOffsets();if(_.line>=h.length)return this._content.length;if(_.line<0)return 0;var k=h[_.line],g=_.line+1<h.length?h[_.
925
+ line+1]:this._content.length;return Math.max(Math.min(k+_.character,g),k)},Object.defineProperty(b.prototype,"lineCount",{get:function(){return this.getLineOffsets().length},enumerable:!1,configurable:!0}),b}(),q;(function(b){var _=Object.prototype.toString;function h(be){return typeof be<"u"}b.defined=h;function k(be){return typeof be>"u"}b.undefined=k;function g(be){return be===!0||be===!1}b.boolean=g;function x(be){return _.call(be)==="[object String]"}b.string=x;function $(be){return _.call(
926
+ be)==="[object Number]"}b.number=$;function W(be,Oe,ut){return _.call(be)==="[object Number]"&&Oe<=be&&be<=ut}b.numberRange=W;function te(be){return _.call(be)==="[object Number]"&&-2147483648<=be&&be<=2147483647}b.integer=te;function oe(be){return _.call(be)==="[object Number]"&&0<=be&&be<=2147483647}b.uinteger=oe;function Ue(be){return _.call(be)==="[object Function]"}b.func=Ue;function Me(be){return be!==null&&typeof be=="object"}b.objectLiteral=Me;function tt(be,Oe){return Array.isArray(be)&&
927
+ be.every(Oe)}b.typedArray=tt})(q||(q={}))})}(lp,lp.exports)),lp.exports}var Cn={},ak;function At(){if(ak)return Cn;ak=1,Object.defineProperty(Cn,"__esModule",{value:!0}),Cn.ProtocolNotificationType=Cn.ProtocolNotificationType0=Cn.ProtocolRequestType=Cn.ProtocolRequestType0=Cn.RegistrationType=Cn.MessageDirection=void 0;const t=Ks();var e;(function(a){a.clientToServer="clientToServer",a.serverToClient="serverToClient",a.both="both"})(e||(Cn.MessageDirection=e={}));class n{constructor(u){this.method=
928
+ u}}Cn.RegistrationType=n;class r extends t.RequestType0{constructor(u){super(u)}}Cn.ProtocolRequestType0=r;class i extends t.RequestType{constructor(u){super(u,t.ParameterStructures.byName)}}Cn.ProtocolRequestType=i;class s extends t.NotificationType0{constructor(u){super(u)}}Cn.ProtocolNotificationType0=s;class o extends t.NotificationType{constructor(u){super(u,t.ParameterStructures.byName)}}return Cn.ProtocolNotificationType=o,Cn}var ky={},Ft={},uk;function Ty(){if(uk)return Ft;uk=1,Object.defineProperty(
929
+ Ft,"__esModule",{value:!0}),Ft.objectLiteral=Ft.typedArray=Ft.stringArray=Ft.array=Ft.func=Ft.error=Ft.number=Ft.string=Ft.boolean=void 0;function t(c){return c===!0||c===!1}Ft.boolean=t;function e(c){return typeof c=="string"||c instanceof String}Ft.string=e;function n(c){return typeof c=="number"||c instanceof Number}Ft.number=n;function r(c){return c instanceof Error}Ft.error=r;function i(c){return typeof c=="function"}Ft.func=i;function s(c){return Array.isArray(c)}Ft.array=s;function o(c){return s(
930
+ c)&&c.every(l=>e(l))}Ft.stringArray=o;function a(c,l){return Array.isArray(c)&&c.every(l)}Ft.typedArray=a;function u(c){return c!==null&&typeof c=="object"}return Ft.objectLiteral=u,Ft}var ic={},ck;function g3(){if(ck)return ic;ck=1,Object.defineProperty(ic,"__esModule",{value:!0}),ic.ImplementationRequest=void 0;const t=At();var e;return function(n){n.method="textDocument/implementation",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method)}(e||(ic.ImplementationRequest=
931
+ e={})),ic}var sc={},lk;function y3(){if(lk)return sc;lk=1,Object.defineProperty(sc,"__esModule",{value:!0}),sc.TypeDefinitionRequest=void 0;const t=At();var e;return function(n){n.method="textDocument/typeDefinition",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method)}(e||(sc.TypeDefinitionRequest=e={})),sc}var Xs={},dk;function v3(){if(dk)return Xs;dk=1,Object.defineProperty(Xs,"__esModule",{value:!0}),Xs.DidChangeWorkspaceFoldersNotification=Xs.WorkspaceFoldersRequest=
932
+ void 0;const t=At();var e;(function(r){r.method="workspace/workspaceFolders",r.messageDirection=t.MessageDirection.serverToClient,r.type=new t.ProtocolRequestType0(r.method)})(e||(Xs.WorkspaceFoldersRequest=e={}));var n;return function(r){r.method="workspace/didChangeWorkspaceFolders",r.messageDirection=t.MessageDirection.clientToServer,r.type=new t.ProtocolNotificationType(r.method)}(n||(Xs.DidChangeWorkspaceFoldersNotification=n={})),Xs}var oc={},fk;function w3(){if(fk)return oc;fk=1,Object.defineProperty(
933
+ oc,"__esModule",{value:!0}),oc.ConfigurationRequest=void 0;const t=At();var e;return function(n){n.method="workspace/configuration",n.messageDirection=t.MessageDirection.serverToClient,n.type=new t.ProtocolRequestType(n.method)}(e||(oc.ConfigurationRequest=e={})),oc}var Ys={},pk;function b3(){if(pk)return Ys;pk=1,Object.defineProperty(Ys,"__esModule",{value:!0}),Ys.ColorPresentationRequest=Ys.DocumentColorRequest=void 0;const t=At();var e;(function(r){r.method="textDocument/documentColor",r.messageDirection=
934
+ t.MessageDirection.clientToServer,r.type=new t.ProtocolRequestType(r.method)})(e||(Ys.DocumentColorRequest=e={}));var n;return function(r){r.method="textDocument/colorPresentation",r.messageDirection=t.MessageDirection.clientToServer,r.type=new t.ProtocolRequestType(r.method)}(n||(Ys.ColorPresentationRequest=n={})),Ys}var Js={},hk;function E3(){if(hk)return Js;hk=1,Object.defineProperty(Js,"__esModule",{value:!0}),Js.FoldingRangeRefreshRequest=Js.FoldingRangeRequest=void 0;const t=At();var e;(function(r){
935
+ r.method="textDocument/foldingRange",r.messageDirection=t.MessageDirection.clientToServer,r.type=new t.ProtocolRequestType(r.method)})(e||(Js.FoldingRangeRequest=e={}));var n;return function(r){r.method="workspace/foldingRange/refresh",r.messageDirection=t.MessageDirection.serverToClient,r.type=new t.ProtocolRequestType0(r.method)}(n||(Js.FoldingRangeRefreshRequest=n={})),Js}var ac={},mk;function $3(){if(mk)return ac;mk=1,Object.defineProperty(ac,"__esModule",{value:!0}),ac.DeclarationRequest=void 0;
936
+ const t=At();var e;return function(n){n.method="textDocument/declaration",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method)}(e||(ac.DeclarationRequest=e={})),ac}var uc={},gk;function D3(){if(gk)return uc;gk=1,Object.defineProperty(uc,"__esModule",{value:!0}),uc.SelectionRangeRequest=void 0;const t=At();var e;return function(n){n.method="textDocument/selectionRange",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(
937
+ n.method)}(e||(uc.SelectionRangeRequest=e={})),uc}var gi={},yk;function R3(){if(yk)return gi;yk=1,Object.defineProperty(gi,"__esModule",{value:!0}),gi.WorkDoneProgressCancelNotification=gi.WorkDoneProgressCreateRequest=gi.WorkDoneProgress=void 0;const t=Ks(),e=At();var n;(function(s){s.type=new t.ProgressType;function o(a){return a===s.type}s.is=o})(n||(gi.WorkDoneProgress=n={}));var r;(function(s){s.method="window/workDoneProgress/create",s.messageDirection=e.MessageDirection.serverToClient,s.type=
938
+ new e.ProtocolRequestType(s.method)})(r||(gi.WorkDoneProgressCreateRequest=r={}));var i;return function(s){s.method="window/workDoneProgress/cancel",s.messageDirection=e.MessageDirection.clientToServer,s.type=new e.ProtocolNotificationType(s.method)}(i||(gi.WorkDoneProgressCancelNotification=i={})),gi}var yi={},vk;function k3(){if(vk)return yi;vk=1,Object.defineProperty(yi,"__esModule",{value:!0}),yi.CallHierarchyOutgoingCallsRequest=yi.CallHierarchyIncomingCallsRequest=yi.CallHierarchyPrepareRequest=
939
+ void 0;const t=At();var e;(function(i){i.method="textDocument/prepareCallHierarchy",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)})(e||(yi.CallHierarchyPrepareRequest=e={}));var n;(function(i){i.method="callHierarchy/incomingCalls",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)})(n||(yi.CallHierarchyIncomingCallsRequest=n={}));var r;return function(i){i.method="callHierarchy/outgoingCalls",i.messageDirection=
940
+ t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)}(r||(yi.CallHierarchyOutgoingCallsRequest=r={})),yi}var An={},wk;function T3(){if(wk)return An;wk=1,Object.defineProperty(An,"__esModule",{value:!0}),An.SemanticTokensRefreshRequest=An.SemanticTokensRangeRequest=An.SemanticTokensDeltaRequest=An.SemanticTokensRequest=An.SemanticTokensRegistrationType=An.TokenFormat=void 0;const t=At();var e;(function(a){a.Relative="relative"})(e||(An.TokenFormat=e={}));var n;(function(a){
941
+ a.method="textDocument/semanticTokens",a.type=new t.RegistrationType(a.method)})(n||(An.SemanticTokensRegistrationType=n={}));var r;(function(a){a.method="textDocument/semanticTokens/full",a.messageDirection=t.MessageDirection.clientToServer,a.type=new t.ProtocolRequestType(a.method),a.registrationMethod=n.method})(r||(An.SemanticTokensRequest=r={}));var i;(function(a){a.method="textDocument/semanticTokens/full/delta",a.messageDirection=t.MessageDirection.clientToServer,a.type=new t.ProtocolRequestType(
942
+ a.method),a.registrationMethod=n.method})(i||(An.SemanticTokensDeltaRequest=i={}));var s;(function(a){a.method="textDocument/semanticTokens/range",a.messageDirection=t.MessageDirection.clientToServer,a.type=new t.ProtocolRequestType(a.method),a.registrationMethod=n.method})(s||(An.SemanticTokensRangeRequest=s={}));var o;return function(a){a.method="workspace/semanticTokens/refresh",a.messageDirection=t.MessageDirection.serverToClient,a.type=new t.ProtocolRequestType0(a.method)}(o||(An.SemanticTokensRefreshRequest=
943
+ o={})),An}var cc={},bk;function C3(){if(bk)return cc;bk=1,Object.defineProperty(cc,"__esModule",{value:!0}),cc.ShowDocumentRequest=void 0;const t=At();var e;return function(n){n.method="window/showDocument",n.messageDirection=t.MessageDirection.serverToClient,n.type=new t.ProtocolRequestType(n.method)}(e||(cc.ShowDocumentRequest=e={})),cc}var lc={},Ek;function A3(){if(Ek)return lc;Ek=1,Object.defineProperty(lc,"__esModule",{value:!0}),lc.LinkedEditingRangeRequest=void 0;const t=At();var e;return function(n){
944
+ n.method="textDocument/linkedEditingRange",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method)}(e||(lc.LinkedEditingRangeRequest=e={})),lc}var ln={},$k;function S3(){if($k)return ln;$k=1,Object.defineProperty(ln,"__esModule",{value:!0}),ln.WillDeleteFilesRequest=ln.DidDeleteFilesNotification=ln.DidRenameFilesNotification=ln.WillRenameFilesRequest=ln.DidCreateFilesNotification=ln.WillCreateFilesRequest=ln.FileOperationPatternKind=void 0;const t=At();var e;
945
+ (function(u){u.file="file",u.folder="folder"})(e||(ln.FileOperationPatternKind=e={}));var n;(function(u){u.method="workspace/willCreateFiles",u.messageDirection=t.MessageDirection.clientToServer,u.type=new t.ProtocolRequestType(u.method)})(n||(ln.WillCreateFilesRequest=n={}));var r;(function(u){u.method="workspace/didCreateFiles",u.messageDirection=t.MessageDirection.clientToServer,u.type=new t.ProtocolNotificationType(u.method)})(r||(ln.DidCreateFilesNotification=r={}));var i;(function(u){u.method=
946
+ "workspace/willRenameFiles",u.messageDirection=t.MessageDirection.clientToServer,u.type=new t.ProtocolRequestType(u.method)})(i||(ln.WillRenameFilesRequest=i={}));var s;(function(u){u.method="workspace/didRenameFiles",u.messageDirection=t.MessageDirection.clientToServer,u.type=new t.ProtocolNotificationType(u.method)})(s||(ln.DidRenameFilesNotification=s={}));var o;(function(u){u.method="workspace/didDeleteFiles",u.messageDirection=t.MessageDirection.clientToServer,u.type=new t.ProtocolNotificationType(
947
+ u.method)})(o||(ln.DidDeleteFilesNotification=o={}));var a;return function(u){u.method="workspace/willDeleteFiles",u.messageDirection=t.MessageDirection.clientToServer,u.type=new t.ProtocolRequestType(u.method)}(a||(ln.WillDeleteFilesRequest=a={})),ln}var vi={},Dk;function _3(){if(Dk)return vi;Dk=1,Object.defineProperty(vi,"__esModule",{value:!0}),vi.MonikerRequest=vi.MonikerKind=vi.UniquenessLevel=void 0;const t=At();var e;(function(i){i.document="document",i.project="project",i.group="group",i.
948
+ scheme="scheme",i.global="global"})(e||(vi.UniquenessLevel=e={}));var n;(function(i){i.$import="import",i.$export="export",i.local="local"})(n||(vi.MonikerKind=n={}));var r;return function(i){i.method="textDocument/moniker",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)}(r||(vi.MonikerRequest=r={})),vi}var wi={},Rk;function P3(){if(Rk)return wi;Rk=1,Object.defineProperty(wi,"__esModule",{value:!0}),wi.TypeHierarchySubtypesRequest=wi.TypeHierarchySupertypesRequest=
949
+ wi.TypeHierarchyPrepareRequest=void 0;const t=At();var e;(function(i){i.method="textDocument/prepareTypeHierarchy",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)})(e||(wi.TypeHierarchyPrepareRequest=e={}));var n;(function(i){i.method="typeHierarchy/supertypes",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)})(n||(wi.TypeHierarchySupertypesRequest=n={}));var r;return function(i){i.method="typeHierarch\
950
+ y/subtypes",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)}(r||(wi.TypeHierarchySubtypesRequest=r={})),wi}var Qs={},kk;function x3(){if(kk)return Qs;kk=1,Object.defineProperty(Qs,"__esModule",{value:!0}),Qs.InlineValueRefreshRequest=Qs.InlineValueRequest=void 0;const t=At();var e;(function(r){r.method="textDocument/inlineValue",r.messageDirection=t.MessageDirection.clientToServer,r.type=new t.ProtocolRequestType(r.method)})(e||(Qs.InlineValueRequest=
951
+ e={}));var n;return function(r){r.method="workspace/inlineValue/refresh",r.messageDirection=t.MessageDirection.serverToClient,r.type=new t.ProtocolRequestType0(r.method)}(n||(Qs.InlineValueRefreshRequest=n={})),Qs}var bi={},Tk;function N3(){if(Tk)return bi;Tk=1,Object.defineProperty(bi,"__esModule",{value:!0}),bi.InlayHintRefreshRequest=bi.InlayHintResolveRequest=bi.InlayHintRequest=void 0;const t=At();var e;(function(i){i.method="textDocument/inlayHint",i.messageDirection=t.MessageDirection.clientToServer,
952
+ i.type=new t.ProtocolRequestType(i.method)})(e||(bi.InlayHintRequest=e={}));var n;(function(i){i.method="inlayHint/resolve",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)})(n||(bi.InlayHintResolveRequest=n={}));var r;return function(i){i.method="workspace/inlayHint/refresh",i.messageDirection=t.MessageDirection.serverToClient,i.type=new t.ProtocolRequestType0(i.method)}(r||(bi.InlayHintRefreshRequest=r={})),bi}var Yn={},Ck;function I3(){if(Ck)return Yn;
953
+ Ck=1,Object.defineProperty(Yn,"__esModule",{value:!0}),Yn.DiagnosticRefreshRequest=Yn.WorkspaceDiagnosticRequest=Yn.DocumentDiagnosticRequest=Yn.DocumentDiagnosticReportKind=Yn.DiagnosticServerCancellationData=void 0;const t=Ks(),e=Ty(),n=At();var r;(function(u){function c(l){const f=l;return f&&e.boolean(f.retriggerRequest)}u.is=c})(r||(Yn.DiagnosticServerCancellationData=r={}));var i;(function(u){u.Full="full",u.Unchanged="unchanged"})(i||(Yn.DocumentDiagnosticReportKind=i={}));var s;(function(u){
954
+ u.method="textDocument/diagnostic",u.messageDirection=n.MessageDirection.clientToServer,u.type=new n.ProtocolRequestType(u.method),u.partialResult=new t.ProgressType})(s||(Yn.DocumentDiagnosticRequest=s={}));var o;(function(u){u.method="workspace/diagnostic",u.messageDirection=n.MessageDirection.clientToServer,u.type=new n.ProtocolRequestType(u.method),u.partialResult=new t.ProgressType})(o||(Yn.WorkspaceDiagnosticRequest=o={}));var a;return function(u){u.method="workspace/diagnostic/refresh",u.
955
+ messageDirection=n.MessageDirection.serverToClient,u.type=new n.ProtocolRequestType0(u.method)}(a||(Yn.DiagnosticRefreshRequest=a={})),Yn}var St={},Ak;function O3(){if(Ak)return St;Ak=1,Object.defineProperty(St,"__esModule",{value:!0}),St.DidCloseNotebookDocumentNotification=St.DidSaveNotebookDocumentNotification=St.DidChangeNotebookDocumentNotification=St.NotebookCellArrayChange=St.DidOpenNotebookDocumentNotification=St.NotebookDocumentSyncRegistrationType=St.NotebookDocument=St.NotebookCell=St.
956
+ ExecutionSummary=St.NotebookCellKind=void 0;const t=Ry(),e=Ty(),n=At();var r;(function(p){p.Markup=1,p.Code=2;function m(v){return v===1||v===2}p.is=m})(r||(St.NotebookCellKind=r={}));var i;(function(p){function m(y,E){const R={executionOrder:y};return(E===!0||E===!1)&&(R.success=E),R}p.create=m;function v(y){const E=y;return e.objectLiteral(E)&&t.uinteger.is(E.executionOrder)&&(E.success===void 0||e.boolean(E.success))}p.is=v;function w(y,E){return y===E?!0:y==null||E===null||E===void 0?!1:y.executionOrder===
957
+ E.executionOrder&&y.success===E.success}p.equals=w})(i||(St.ExecutionSummary=i={}));var s;(function(p){function m(E,R){return{kind:E,document:R}}p.create=m;function v(E){const R=E;return e.objectLiteral(R)&&r.is(R.kind)&&t.DocumentUri.is(R.document)&&(R.metadata===void 0||e.objectLiteral(R.metadata))}p.is=v;function w(E,R){const A=new Set;return E.document!==R.document&&A.add("document"),E.kind!==R.kind&&A.add("kind"),E.executionSummary!==R.executionSummary&&A.add("executionSummary"),(E.metadata!==
958
+ void 0||R.metadata!==void 0)&&!y(E.metadata,R.metadata)&&A.add("metadata"),(E.executionSummary!==void 0||R.executionSummary!==void 0)&&!i.equals(E.executionSummary,R.executionSummary)&&A.add("executionSummary"),A}p.diff=w;function y(E,R){if(E===R)return!0;if(E==null||R===null||R===void 0||typeof E!=typeof R||typeof E!="object")return!1;const A=Array.isArray(E),N=Array.isArray(R);if(A!==N)return!1;if(A&&N){if(E.length!==R.length)return!1;for(let V=0;V<E.length;V++)if(!y(E[V],R[V]))return!1}if(e.objectLiteral(
959
+ E)&&e.objectLiteral(R)){const V=Object.keys(E),J=Object.keys(R);if(V.length!==J.length||(V.sort(),J.sort(),!y(V,J)))return!1;for(let se=0;se<V.length;se++){const ie=V[se];if(!y(E[ie],R[ie]))return!1}}return!0}})(s||(St.NotebookCell=s={}));var o;(function(p){function m(w,y,E,R){return{uri:w,notebookType:y,version:E,cells:R}}p.create=m;function v(w){const y=w;return e.objectLiteral(y)&&e.string(y.uri)&&t.integer.is(y.version)&&e.typedArray(y.cells,s.is)}p.is=v})(o||(St.NotebookDocument=o={}));var a;
960
+ (function(p){p.method="notebookDocument/sync",p.messageDirection=n.MessageDirection.clientToServer,p.type=new n.RegistrationType(p.method)})(a||(St.NotebookDocumentSyncRegistrationType=a={}));var u;(function(p){p.method="notebookDocument/didOpen",p.messageDirection=n.MessageDirection.clientToServer,p.type=new n.ProtocolNotificationType(p.method),p.registrationMethod=a.method})(u||(St.DidOpenNotebookDocumentNotification=u={}));var c;(function(p){function m(w){const y=w;return e.objectLiteral(y)&&
961
+ t.uinteger.is(y.start)&&t.uinteger.is(y.deleteCount)&&(y.cells===void 0||e.typedArray(y.cells,s.is))}p.is=m;function v(w,y,E){const R={start:w,deleteCount:y};return E!==void 0&&(R.cells=E),R}p.create=v})(c||(St.NotebookCellArrayChange=c={}));var l;(function(p){p.method="notebookDocument/didChange",p.messageDirection=n.MessageDirection.clientToServer,p.type=new n.ProtocolNotificationType(p.method),p.registrationMethod=a.method})(l||(St.DidChangeNotebookDocumentNotification=l={}));var f;(function(p){
962
+ p.method="notebookDocument/didSave",p.messageDirection=n.MessageDirection.clientToServer,p.type=new n.ProtocolNotificationType(p.method),p.registrationMethod=a.method})(f||(St.DidSaveNotebookDocumentNotification=f={}));var d;return function(p){p.method="notebookDocument/didClose",p.messageDirection=n.MessageDirection.clientToServer,p.type=new n.ProtocolNotificationType(p.method),p.registrationMethod=a.method}(d||(St.DidCloseNotebookDocumentNotification=d={})),St}var dc={},Sk;function F3(){if(Sk)
963
+ return dc;Sk=1,Object.defineProperty(dc,"__esModule",{value:!0}),dc.InlineCompletionRequest=void 0;const t=At();var e;return function(n){n.method="textDocument/inlineCompletion",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method)}(e||(dc.InlineCompletionRequest=e={})),dc}var _k;function L3(){return _k||(_k=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.WorkspaceSymbolRequest=t.CodeActionResolveRequest=t.CodeActionRequest=t.DocumentSymbolRequest=
964
+ t.DocumentHighlightRequest=t.ReferencesRequest=t.DefinitionRequest=t.SignatureHelpRequest=t.SignatureHelpTriggerKind=t.HoverRequest=t.CompletionResolveRequest=t.CompletionRequest=t.CompletionTriggerKind=t.PublishDiagnosticsNotification=t.WatchKind=t.RelativePattern=t.FileChangeType=t.DidChangeWatchedFilesNotification=t.WillSaveTextDocumentWaitUntilRequest=t.WillSaveTextDocumentNotification=t.TextDocumentSaveReason=t.DidSaveTextDocumentNotification=t.DidCloseTextDocumentNotification=t.DidChangeTextDocumentNotification=
965
+ t.TextDocumentContentChangeEvent=t.DidOpenTextDocumentNotification=t.TextDocumentSyncKind=t.TelemetryEventNotification=t.LogMessageNotification=t.ShowMessageRequest=t.ShowMessageNotification=t.MessageType=t.DidChangeConfigurationNotification=t.ExitNotification=t.ShutdownRequest=t.InitializedNotification=t.InitializeErrorCodes=t.InitializeRequest=t.WorkDoneProgressOptions=t.TextDocumentRegistrationOptions=t.StaticRegistrationOptions=t.PositionEncodingKind=t.FailureHandlingKind=t.ResourceOperationKind=
966
+ t.UnregistrationRequest=t.RegistrationRequest=t.DocumentSelector=t.NotebookCellTextDocumentFilter=t.NotebookDocumentFilter=t.TextDocumentFilter=void 0,t.MonikerRequest=t.MonikerKind=t.UniquenessLevel=t.WillDeleteFilesRequest=t.DidDeleteFilesNotification=t.WillRenameFilesRequest=t.DidRenameFilesNotification=t.WillCreateFilesRequest=t.DidCreateFilesNotification=t.FileOperationPatternKind=t.LinkedEditingRangeRequest=t.ShowDocumentRequest=t.SemanticTokensRegistrationType=t.SemanticTokensRefreshRequest=
967
+ t.SemanticTokensRangeRequest=t.SemanticTokensDeltaRequest=t.SemanticTokensRequest=t.TokenFormat=t.CallHierarchyPrepareRequest=t.CallHierarchyOutgoingCallsRequest=t.CallHierarchyIncomingCallsRequest=t.WorkDoneProgressCancelNotification=t.WorkDoneProgressCreateRequest=t.WorkDoneProgress=t.SelectionRangeRequest=t.DeclarationRequest=t.FoldingRangeRefreshRequest=t.FoldingRangeRequest=t.ColorPresentationRequest=t.DocumentColorRequest=t.ConfigurationRequest=t.DidChangeWorkspaceFoldersNotification=t.WorkspaceFoldersRequest=
968
+ t.TypeDefinitionRequest=t.ImplementationRequest=t.ApplyWorkspaceEditRequest=t.ExecuteCommandRequest=t.PrepareRenameRequest=t.RenameRequest=t.PrepareSupportDefaultBehavior=t.DocumentOnTypeFormattingRequest=t.DocumentRangesFormattingRequest=t.DocumentRangeFormattingRequest=t.DocumentFormattingRequest=t.DocumentLinkResolveRequest=t.DocumentLinkRequest=t.CodeLensRefreshRequest=t.CodeLensResolveRequest=t.CodeLensRequest=t.WorkspaceSymbolResolveRequest=void 0,t.InlineCompletionRequest=t.DidCloseNotebookDocumentNotification=
969
+ t.DidSaveNotebookDocumentNotification=t.DidChangeNotebookDocumentNotification=t.NotebookCellArrayChange=t.DidOpenNotebookDocumentNotification=t.NotebookDocumentSyncRegistrationType=t.NotebookDocument=t.NotebookCell=t.ExecutionSummary=t.NotebookCellKind=t.DiagnosticRefreshRequest=t.WorkspaceDiagnosticRequest=t.DocumentDiagnosticRequest=t.DocumentDiagnosticReportKind=t.DiagnosticServerCancellationData=t.InlayHintRefreshRequest=t.InlayHintResolveRequest=t.InlayHintRequest=t.InlineValueRefreshRequest=
970
+ t.InlineValueRequest=t.TypeHierarchySupertypesRequest=t.TypeHierarchySubtypesRequest=t.TypeHierarchyPrepareRequest=void 0;const e=At(),n=Ry(),r=Ty(),i=g3();Object.defineProperty(t,"ImplementationRequest",{enumerable:!0,get:function(){return i.ImplementationRequest}});const s=y3();Object.defineProperty(t,"TypeDefinitionRequest",{enumerable:!0,get:function(){return s.TypeDefinitionRequest}});const o=v3();Object.defineProperty(t,"WorkspaceFoldersRequest",{enumerable:!0,get:function(){return o.WorkspaceFoldersRequest}}),
971
+ Object.defineProperty(t,"DidChangeWorkspaceFoldersNotification",{enumerable:!0,get:function(){return o.DidChangeWorkspaceFoldersNotification}});const a=w3();Object.defineProperty(t,"ConfigurationRequest",{enumerable:!0,get:function(){return a.ConfigurationRequest}});const u=b3();Object.defineProperty(t,"DocumentColorRequest",{enumerable:!0,get:function(){return u.DocumentColorRequest}}),Object.defineProperty(t,"ColorPresentationRequest",{enumerable:!0,get:function(){return u.ColorPresentationRequest}});
972
+ const c=E3();Object.defineProperty(t,"FoldingRangeRequest",{enumerable:!0,get:function(){return c.FoldingRangeRequest}}),Object.defineProperty(t,"FoldingRangeRefreshRequest",{enumerable:!0,get:function(){return c.FoldingRangeRefreshRequest}});const l=$3();Object.defineProperty(t,"DeclarationRequest",{enumerable:!0,get:function(){return l.DeclarationRequest}});const f=D3();Object.defineProperty(t,"SelectionRangeRequest",{enumerable:!0,get:function(){return f.SelectionRangeRequest}});const d=R3();
973
+ Object.defineProperty(t,"WorkDoneProgress",{enumerable:!0,get:function(){return d.WorkDoneProgress}}),Object.defineProperty(t,"WorkDoneProgressCreateRequest",{enumerable:!0,get:function(){return d.WorkDoneProgressCreateRequest}}),Object.defineProperty(t,"WorkDoneProgressCancelNotification",{enumerable:!0,get:function(){return d.WorkDoneProgressCancelNotification}});const p=k3();Object.defineProperty(t,"CallHierarchyIncomingCallsRequest",{enumerable:!0,get:function(){return p.CallHierarchyIncomingCallsRequest}}),
974
+ Object.defineProperty(t,"CallHierarchyOutgoingCallsRequest",{enumerable:!0,get:function(){return p.CallHierarchyOutgoingCallsRequest}}),Object.defineProperty(t,"CallHierarchyPrepareRequest",{enumerable:!0,get:function(){return p.CallHierarchyPrepareRequest}});const m=T3();Object.defineProperty(t,"TokenFormat",{enumerable:!0,get:function(){return m.TokenFormat}}),Object.defineProperty(t,"SemanticTokensRequest",{enumerable:!0,get:function(){return m.SemanticTokensRequest}}),Object.defineProperty(t,
975
+ "SemanticTokensDeltaRequest",{enumerable:!0,get:function(){return m.SemanticTokensDeltaRequest}}),Object.defineProperty(t,"SemanticTokensRangeRequest",{enumerable:!0,get:function(){return m.SemanticTokensRangeRequest}}),Object.defineProperty(t,"SemanticTokensRefreshRequest",{enumerable:!0,get:function(){return m.SemanticTokensRefreshRequest}}),Object.defineProperty(t,"SemanticTokensRegistrationType",{enumerable:!0,get:function(){return m.SemanticTokensRegistrationType}});const v=C3();Object.defineProperty(
976
+ t,"ShowDocumentRequest",{enumerable:!0,get:function(){return v.ShowDocumentRequest}});const w=A3();Object.defineProperty(t,"LinkedEditingRangeRequest",{enumerable:!0,get:function(){return w.LinkedEditingRangeRequest}});const y=S3();Object.defineProperty(t,"FileOperationPatternKind",{enumerable:!0,get:function(){return y.FileOperationPatternKind}}),Object.defineProperty(t,"DidCreateFilesNotification",{enumerable:!0,get:function(){return y.DidCreateFilesNotification}}),Object.defineProperty(t,"Wil\
977
+ lCreateFilesRequest",{enumerable:!0,get:function(){return y.WillCreateFilesRequest}}),Object.defineProperty(t,"DidRenameFilesNotification",{enumerable:!0,get:function(){return y.DidRenameFilesNotification}}),Object.defineProperty(t,"WillRenameFilesRequest",{enumerable:!0,get:function(){return y.WillRenameFilesRequest}}),Object.defineProperty(t,"DidDeleteFilesNotification",{enumerable:!0,get:function(){return y.DidDeleteFilesNotification}}),Object.defineProperty(t,"WillDeleteFilesRequest",{enumerable:!0,
978
+ get:function(){return y.WillDeleteFilesRequest}});const E=_3();Object.defineProperty(t,"UniquenessLevel",{enumerable:!0,get:function(){return E.UniquenessLevel}}),Object.defineProperty(t,"MonikerKind",{enumerable:!0,get:function(){return E.MonikerKind}}),Object.defineProperty(t,"MonikerRequest",{enumerable:!0,get:function(){return E.MonikerRequest}});const R=P3();Object.defineProperty(t,"TypeHierarchyPrepareRequest",{enumerable:!0,get:function(){return R.TypeHierarchyPrepareRequest}}),Object.defineProperty(
979
+ t,"TypeHierarchySubtypesRequest",{enumerable:!0,get:function(){return R.TypeHierarchySubtypesRequest}}),Object.defineProperty(t,"TypeHierarchySupertypesRequest",{enumerable:!0,get:function(){return R.TypeHierarchySupertypesRequest}});const A=x3();Object.defineProperty(t,"InlineValueRequest",{enumerable:!0,get:function(){return A.InlineValueRequest}}),Object.defineProperty(t,"InlineValueRefreshRequest",{enumerable:!0,get:function(){return A.InlineValueRefreshRequest}});const N=N3();Object.defineProperty(
980
+ t,"InlayHintRequest",{enumerable:!0,get:function(){return N.InlayHintRequest}}),Object.defineProperty(t,"InlayHintResolveRequest",{enumerable:!0,get:function(){return N.InlayHintResolveRequest}}),Object.defineProperty(t,"InlayHintRefreshRequest",{enumerable:!0,get:function(){return N.InlayHintRefreshRequest}});const V=I3();Object.defineProperty(t,"DiagnosticServerCancellationData",{enumerable:!0,get:function(){return V.DiagnosticServerCancellationData}}),Object.defineProperty(t,"DocumentDiagnost\
981
+ icReportKind",{enumerable:!0,get:function(){return V.DocumentDiagnosticReportKind}}),Object.defineProperty(t,"DocumentDiagnosticRequest",{enumerable:!0,get:function(){return V.DocumentDiagnosticRequest}}),Object.defineProperty(t,"WorkspaceDiagnosticRequest",{enumerable:!0,get:function(){return V.WorkspaceDiagnosticRequest}}),Object.defineProperty(t,"DiagnosticRefreshRequest",{enumerable:!0,get:function(){return V.DiagnosticRefreshRequest}});const J=O3();Object.defineProperty(t,"NotebookCellKind",
982
+ {enumerable:!0,get:function(){return J.NotebookCellKind}}),Object.defineProperty(t,"ExecutionSummary",{enumerable:!0,get:function(){return J.ExecutionSummary}}),Object.defineProperty(t,"NotebookCell",{enumerable:!0,get:function(){return J.NotebookCell}}),Object.defineProperty(t,"NotebookDocument",{enumerable:!0,get:function(){return J.NotebookDocument}}),Object.defineProperty(t,"NotebookDocumentSyncRegistrationType",{enumerable:!0,get:function(){return J.NotebookDocumentSyncRegistrationType}}),Object.
983
+ defineProperty(t,"DidOpenNotebookDocumentNotification",{enumerable:!0,get:function(){return J.DidOpenNotebookDocumentNotification}}),Object.defineProperty(t,"NotebookCellArrayChange",{enumerable:!0,get:function(){return J.NotebookCellArrayChange}}),Object.defineProperty(t,"DidChangeNotebookDocumentNotification",{enumerable:!0,get:function(){return J.DidChangeNotebookDocumentNotification}}),Object.defineProperty(t,"DidSaveNotebookDocumentNotification",{enumerable:!0,get:function(){return J.DidSaveNotebookDocumentNotification}}),
984
+ Object.defineProperty(t,"DidCloseNotebookDocumentNotification",{enumerable:!0,get:function(){return J.DidCloseNotebookDocumentNotification}});const se=F3();Object.defineProperty(t,"InlineCompletionRequest",{enumerable:!0,get:function(){return se.InlineCompletionRequest}});var ie;(function(h){function k(g){const x=g;return r.string(x)||r.string(x.language)||r.string(x.scheme)||r.string(x.pattern)}h.is=k})(ie||(t.TextDocumentFilter=ie={}));var we;(function(h){function k(g){const x=g;return r.objectLiteral(
985
+ x)&&(r.string(x.notebookType)||r.string(x.scheme)||r.string(x.pattern))}h.is=k})(we||(t.NotebookDocumentFilter=we={}));var B;(function(h){function k(g){const x=g;return r.objectLiteral(x)&&(r.string(x.notebook)||we.is(x.notebook))&&(x.language===void 0||r.string(x.language))}h.is=k})(B||(t.NotebookCellTextDocumentFilter=B={}));var T;(function(h){function k(g){if(!Array.isArray(g))return!1;for(let x of g)if(!r.string(x)&&!ie.is(x)&&!B.is(x))return!1;return!0}h.is=k})(T||(t.DocumentSelector=T={}));
986
+ var D;(function(h){h.method="client/registerCapability",h.messageDirection=e.MessageDirection.serverToClient,h.type=new e.ProtocolRequestType(h.method)})(D||(t.RegistrationRequest=D={}));var M;(function(h){h.method="client/unregisterCapability",h.messageDirection=e.MessageDirection.serverToClient,h.type=new e.ProtocolRequestType(h.method)})(M||(t.UnregistrationRequest=M={}));var S;(function(h){h.Create="create",h.Rename="rename",h.Delete="delete"})(S||(t.ResourceOperationKind=S={}));var P;(function(h){
987
+ h.Abort="abort",h.Transactional="transactional",h.TextOnlyTransactional="textOnlyTransactional",h.Undo="undo"})(P||(t.FailureHandlingKind=P={}));var O;(function(h){h.UTF8="utf-8",h.UTF16="utf-16",h.UTF32="utf-32"})(O||(t.PositionEncodingKind=O={}));var Q;(function(h){function k(g){const x=g;return x&&r.string(x.id)&&x.id.length>0}h.hasId=k})(Q||(t.StaticRegistrationOptions=Q={}));var z;(function(h){function k(g){const x=g;return x&&(x.documentSelector===null||T.is(x.documentSelector))}h.is=k})(z||
988
+ (t.TextDocumentRegistrationOptions=z={}));var C;(function(h){function k(x){const $=x;return r.objectLiteral($)&&($.workDoneProgress===void 0||r.boolean($.workDoneProgress))}h.is=k;function g(x){const $=x;return $&&r.boolean($.workDoneProgress)}h.hasWorkDoneProgress=g})(C||(t.WorkDoneProgressOptions=C={}));var ne;(function(h){h.method="initialize",h.messageDirection=e.MessageDirection.clientToServer,h.type=new e.ProtocolRequestType(h.method)})(ne||(t.InitializeRequest=ne={}));var ye;(function(h){
989
+ h.unknownProtocolVersion=1})(ye||(t.InitializeErrorCodes=ye={}));var xe;(function(h){h.method="initialized",h.messageDirection=e.MessageDirection.clientToServer,h.type=new e.ProtocolNotificationType(h.method)})(xe||(t.InitializedNotification=xe={}));var L;(function(h){h.method="shutdown",h.messageDirection=e.MessageDirection.clientToServer,h.type=new e.ProtocolRequestType0(h.method)})(L||(t.ShutdownRequest=L={}));var H;(function(h){h.method="exit",h.messageDirection=e.MessageDirection.clientToServer,
990
+ h.type=new e.ProtocolNotificationType0(h.method)})(H||(t.ExitNotification=H={}));var Se;(function(h){h.method="workspace/didChangeConfiguration",h.messageDirection=e.MessageDirection.clientToServer,h.type=new e.ProtocolNotificationType(h.method)})(Se||(t.DidChangeConfigurationNotification=Se={}));var le;(function(h){h.Error=1,h.Warning=2,h.Info=3,h.Log=4,h.Debug=5})(le||(t.MessageType=le={}));var $e;(function(h){h.method="window/showMessage",h.messageDirection=e.MessageDirection.serverToClient,h.
991
+ type=new e.ProtocolNotificationType(h.method)})($e||(t.ShowMessageNotification=$e={}));var Ne;(function(h){h.method="window/showMessageRequest",h.messageDirection=e.MessageDirection.serverToClient,h.type=new e.ProtocolRequestType(h.method)})(Ne||(t.ShowMessageRequest=Ne={}));var de;(function(h){h.method="window/logMessage",h.messageDirection=e.MessageDirection.serverToClient,h.type=new e.ProtocolNotificationType(h.method)})(de||(t.LogMessageNotification=de={}));var I;(function(h){h.method="telem\
992
+ etry/event",h.messageDirection=e.MessageDirection.serverToClient,h.type=new e.ProtocolNotificationType(h.method)})(I||(t.TelemetryEventNotification=I={}));var G;(function(h){h.None=0,h.Full=1,h.Incremental=2})(G||(t.TextDocumentSyncKind=G={}));var pe;(function(h){h.method="textDocument/didOpen",h.messageDirection=e.MessageDirection.clientToServer,h.type=new e.ProtocolNotificationType(h.method)})(pe||(t.DidOpenTextDocumentNotification=pe={}));var U;(function(h){function k(x){let $=x;return $!=null&&
993
+ typeof $.text=="string"&&$.range!==void 0&&($.rangeLength===void 0||typeof $.rangeLength=="number")}h.isIncremental=k;function g(x){let $=x;return $!=null&&typeof $.text=="string"&&$.range===void 0&&$.rangeLength===void 0}h.isFull=g})(U||(t.TextDocumentContentChangeEvent=U={}));var fe;(function(h){h.method="textDocument/didChange",h.messageDirection=e.MessageDirection.clientToServer,h.type=new e.ProtocolNotificationType(h.method)})(fe||(t.DidChangeTextDocumentNotification=fe={}));var Ve;(function(h){
994
+ h.method="textDocument/didClose",h.messageDirection=e.MessageDirection.clientToServer,h.type=new e.ProtocolNotificationType(h.method)})(Ve||(t.DidCloseTextDocumentNotification=Ve={}));var it;(function(h){h.method="textDocument/didSave",h.messageDirection=e.MessageDirection.clientToServer,h.type=new e.ProtocolNotificationType(h.method)})(it||(t.DidSaveTextDocumentNotification=it={}));var ue;(function(h){h.Manual=1,h.AfterDelay=2,h.FocusOut=3})(ue||(t.TextDocumentSaveReason=ue={}));var Ie;(function(h){
995
+ h.method="textDocument/willSave",h.messageDirection=e.MessageDirection.clientToServer,h.type=new e.ProtocolNotificationType(h.method)})(Ie||(t.WillSaveTextDocumentNotification=Ie={}));var re;(function(h){h.method="textDocument/willSaveWaitUntil",h.messageDirection=e.MessageDirection.clientToServer,h.type=new e.ProtocolRequestType(h.method)})(re||(t.WillSaveTextDocumentWaitUntilRequest=re={}));var De;(function(h){h.method="workspace/didChangeWatchedFiles",h.messageDirection=e.MessageDirection.clientToServer,
996
+ h.type=new e.ProtocolNotificationType(h.method)})(De||(t.DidChangeWatchedFilesNotification=De={}));var Ge;(function(h){h.Created=1,h.Changed=2,h.Deleted=3})(Ge||(t.FileChangeType=Ge={}));var wt;(function(h){function k(g){const x=g;return r.objectLiteral(x)&&(n.URI.is(x.baseUri)||n.WorkspaceFolder.is(x.baseUri))&&r.string(x.pattern)}h.is=k})(wt||(t.RelativePattern=wt={}));var et;(function(h){h.Create=1,h.Change=2,h.Delete=4})(et||(t.WatchKind=et={}));var Xt;(function(h){h.method="textDocument/pub\
997
+ lishDiagnostics",h.messageDirection=e.MessageDirection.serverToClient,h.type=new e.ProtocolNotificationType(h.method)})(Xt||(t.PublishDiagnosticsNotification=Xt={}));var tn;(function(h){h.Invoked=1,h.TriggerCharacter=2,h.TriggerForIncompleteCompletions=3})(tn||(t.CompletionTriggerKind=tn={}));var yn;(function(h){h.method="textDocument/completion",h.messageDirection=e.MessageDirection.clientToServer,h.type=new e.ProtocolRequestType(h.method)})(yn||(t.CompletionRequest=yn={}));var X;(function(h){h.
998
+ method="completionItem/resolve",h.messageDirection=e.MessageDirection.clientToServer,h.type=new e.ProtocolRequestType(h.method)})(X||(t.CompletionResolveRequest=X={}));var Y;(function(h){h.method="textDocument/hover",h.messageDirection=e.MessageDirection.clientToServer,h.type=new e.ProtocolRequestType(h.method)})(Y||(t.HoverRequest=Y={}));var he;(function(h){h.Invoked=1,h.TriggerCharacter=2,h.ContentChange=3})(he||(t.SignatureHelpTriggerKind=he={}));var nn;(function(h){h.method="textDocument/sig\
999
+ natureHelp",h.messageDirection=e.MessageDirection.clientToServer,h.type=new e.ProtocolRequestType(h.method)})(nn||(t.SignatureHelpRequest=nn={}));var Yt;(function(h){h.method="textDocument/definition",h.messageDirection=e.MessageDirection.clientToServer,h.type=new e.ProtocolRequestType(h.method)})(Yt||(t.DefinitionRequest=Yt={}));var Nr;(function(h){h.method="textDocument/references",h.messageDirection=e.MessageDirection.clientToServer,h.type=new e.ProtocolRequestType(h.method)})(Nr||(t.ReferencesRequest=
1000
+ Nr={}));var Fi;(function(h){h.method="textDocument/documentHighlight",h.messageDirection=e.MessageDirection.clientToServer,h.type=new e.ProtocolRequestType(h.method)})(Fi||(t.DocumentHighlightRequest=Fi={}));var ds;(function(h){h.method="textDocument/documentSymbol",h.messageDirection=e.MessageDirection.clientToServer,h.type=new e.ProtocolRequestType(h.method)})(ds||(t.DocumentSymbolRequest=ds={}));var fs;(function(h){h.method="textDocument/codeAction",h.messageDirection=e.MessageDirection.clientToServer,
1001
+ h.type=new e.ProtocolRequestType(h.method)})(fs||(t.CodeActionRequest=fs={}));var ps;(function(h){h.method="codeAction/resolve",h.messageDirection=e.MessageDirection.clientToServer,h.type=new e.ProtocolRequestType(h.method)})(ps||(t.CodeActionResolveRequest=ps={}));var hs;(function(h){h.method="workspace/symbol",h.messageDirection=e.MessageDirection.clientToServer,h.type=new e.ProtocolRequestType(h.method)})(hs||(t.WorkspaceSymbolRequest=hs={}));var Li;(function(h){h.method="workspaceSymbol/reso\
1002
+ lve",h.messageDirection=e.MessageDirection.clientToServer,h.type=new e.ProtocolRequestType(h.method)})(Li||(t.WorkspaceSymbolResolveRequest=Li={}));var Mi;(function(h){h.method="textDocument/codeLens",h.messageDirection=e.MessageDirection.clientToServer,h.type=new e.ProtocolRequestType(h.method)})(Mi||(t.CodeLensRequest=Mi={}));var Pn;(function(h){h.method="codeLens/resolve",h.messageDirection=e.MessageDirection.clientToServer,h.type=new e.ProtocolRequestType(h.method)})(Pn||(t.CodeLensResolveRequest=
1003
+ Pn={}));var ms;(function(h){h.method="workspace/codeLens/refresh",h.messageDirection=e.MessageDirection.serverToClient,h.type=new e.ProtocolRequestType0(h.method)})(ms||(t.CodeLensRefreshRequest=ms={}));var gs;(function(h){h.method="textDocument/documentLink",h.messageDirection=e.MessageDirection.clientToServer,h.type=new e.ProtocolRequestType(h.method)})(gs||(t.DocumentLinkRequest=gs={}));var Ir;(function(h){h.method="documentLink/resolve",h.messageDirection=e.MessageDirection.clientToServer,h.
1004
+ type=new e.ProtocolRequestType(h.method)})(Ir||(t.DocumentLinkResolveRequest=Ir={}));var ys;(function(h){h.method="textDocument/formatting",h.messageDirection=e.MessageDirection.clientToServer,h.type=new e.ProtocolRequestType(h.method)})(ys||(t.DocumentFormattingRequest=ys={}));var Yr;(function(h){h.method="textDocument/rangeFormatting",h.messageDirection=e.MessageDirection.clientToServer,h.type=new e.ProtocolRequestType(h.method)})(Yr||(t.DocumentRangeFormattingRequest=Yr={}));var vs;(function(h){
1005
+ h.method="textDocument/rangesFormatting",h.messageDirection=e.MessageDirection.clientToServer,h.type=new e.ProtocolRequestType(h.method)})(vs||(t.DocumentRangesFormattingRequest=vs={}));var nr;(function(h){h.method="textDocument/onTypeFormatting",h.messageDirection=e.MessageDirection.clientToServer,h.type=new e.ProtocolRequestType(h.method)})(nr||(t.DocumentOnTypeFormattingRequest=nr={}));var gr;(function(h){h.Identifier=1})(gr||(t.PrepareSupportDefaultBehavior=gr={}));var Co;(function(h){h.method=
1006
+ "textDocument/rename",h.messageDirection=e.MessageDirection.clientToServer,h.type=new e.ProtocolRequestType(h.method)})(Co||(t.RenameRequest=Co={}));var q;(function(h){h.method="textDocument/prepareRename",h.messageDirection=e.MessageDirection.clientToServer,h.type=new e.ProtocolRequestType(h.method)})(q||(t.PrepareRenameRequest=q={}));var b;(function(h){h.method="workspace/executeCommand",h.messageDirection=e.MessageDirection.clientToServer,h.type=new e.ProtocolRequestType(h.method)})(b||(t.ExecuteCommandRequest=
1007
+ b={}));var _;(function(h){h.method="workspace/applyEdit",h.messageDirection=e.MessageDirection.serverToClient,h.type=new e.ProtocolRequestType("workspace/applyEdit")})(_||(t.ApplyWorkspaceEditRequest=_={}))}(ky)),ky}var fc={},Pk;function M3(){if(Pk)return fc;Pk=1,Object.defineProperty(fc,"__esModule",{value:!0}),fc.createProtocolConnection=void 0;const t=Ks();function e(n,r,i,s){return t.ConnectionStrategy.is(s)&&(s={connectionStrategy:s}),(0,t.createMessageConnection)(n,r,i,s)}return fc.createProtocolConnection=
1008
+ e,fc}var xk;function B3(){return xk||(xk=1,function(t){var e=Vs&&Vs.__createBinding||(Object.create?function(s,o,a,u){u===void 0&&(u=a);var c=Object.getOwnPropertyDescriptor(o,a);(!c||("get"in c?!o.__esModule:c.writable||c.configurable))&&(c={enumerable:!0,get:function(){return o[a]}}),Object.defineProperty(s,u,c)}:function(s,o,a,u){u===void 0&&(u=a),s[u]=o[a]}),n=Vs&&Vs.__exportStar||function(s,o){for(var a in s)a!=="default"&&!Object.prototype.hasOwnProperty.call(o,a)&&e(o,s,a)};Object.defineProperty(
1009
+ t,"__esModule",{value:!0}),t.LSPErrorCodes=t.createProtocolConnection=void 0,n(Ks(),t),n(Ry(),t),n(At(),t),n(L3(),t);var r=M3();Object.defineProperty(t,"createProtocolConnection",{enumerable:!0,get:function(){return r.createProtocolConnection}});var i;(function(s){s.lspReservedErrorRangeStart=-32899,s.RequestFailed=-32803,s.ServerCancelled=-32802,s.ContentModified=-32801,s.RequestCancelled=-32800,s.lspReservedErrorRangeEnd=-32800})(i||(t.LSPErrorCodes=i={}))}(Vs)),Vs}var Nk;function Lt(){return Nk||
1010
+ (Nk=1,function(t){var e=Ws&&Ws.__createBinding||(Object.create?function(s,o,a,u){u===void 0&&(u=a);var c=Object.getOwnPropertyDescriptor(o,a);(!c||("get"in c?!o.__esModule:c.writable||c.configurable))&&(c={enumerable:!0,get:function(){return o[a]}}),Object.defineProperty(s,u,c)}:function(s,o,a,u){u===void 0&&(u=a),s[u]=o[a]}),n=Ws&&Ws.__exportStar||function(s,o){for(var a in s)a!=="default"&&!Object.prototype.hasOwnProperty.call(o,a)&&e(o,s,a)};Object.defineProperty(t,"__esModule",{value:!0}),t.
1011
+ createProtocolConnection=void 0;const r=sk();n(sk(),t),n(B3(),t);function i(s,o,a,u){return(0,r.createMessageConnection)(s,o,a,u)}t.createProtocolConnection=i}(Ws)),Ws}var Jn={},Ik;function Ok(){if(Ik)return Jn;Ik=1,Object.defineProperty(Jn,"__esModule",{value:!0}),Jn.generateUuid=Jn.parse=Jn.isUUID=Jn.v4=Jn.empty=void 0;class t{constructor(u){this._value=u}asHex(){return this._value}equals(u){return this.asHex()===u.asHex()}}class e extends t{static _oneOf(u){return u[Math.floor(u.length*Math.random())]}static _randomHex(){
1012
+ return e._oneOf(e._chars)}constructor(){super([e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),"-",e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),"-","4",e._randomHex(),e._randomHex(),e._randomHex(),"-",e._oneOf(e._timeHighBits),e._randomHex(),e._randomHex(),e._randomHex(),"-",e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e.
1013
+ _randomHex(),e._randomHex(),e._randomHex()].join(""))}}e._chars=["0","1","2","3","4","5","6","6","7","8","9","a","b","c","d","e","f"],e._timeHighBits=["8","9","a","b"],Jn.empty=new t("00000000-0000-0000-0000-000000000000");function n(){return new e}Jn.v4=n;const r=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function i(a){return r.test(a)}Jn.isUUID=i;function s(a){if(!i(a))throw new Error("invalid uuid");return new t(a)}Jn.parse=s;function o(){return n().asHex()}return Jn.generateUuid=
1014
+ o,Jn}var Ei={},Fk;function q3(){if(Fk)return Ei;Fk=1,Object.defineProperty(Ei,"__esModule",{value:!0}),Ei.attachPartialResult=Ei.ProgressFeature=Ei.attachWorkDone=void 0;const t=Lt(),e=Ok();class n{constructor(d,p){this._connection=d,this._token=p,n.Instances.set(this._token,this)}begin(d,p,m,v){let w={kind:"begin",title:d,percentage:p,message:m,cancellable:v};this._connection.sendProgress(t.WorkDoneProgress.type,this._token,w)}report(d,p){let m={kind:"report"};typeof d=="number"?(m.percentage=d,
1015
+ p!==void 0&&(m.message=p)):m.message=d,this._connection.sendProgress(t.WorkDoneProgress.type,this._token,m)}done(){n.Instances.delete(this._token),this._connection.sendProgress(t.WorkDoneProgress.type,this._token,{kind:"end"})}}n.Instances=new Map;class r extends n{constructor(d,p){super(d,p),this._source=new t.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose(),super.done()}cancel(){this._source.cancel()}}class i{constructor(){}begin(){}report(){}done(){}}
1016
+ class s extends i{constructor(){super(),this._source=new t.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose()}cancel(){this._source.cancel()}}function o(f,d){if(d===void 0||d.workDoneToken===void 0)return new i;const p=d.workDoneToken;return delete d.workDoneToken,new n(f,p)}Ei.attachWorkDone=o;const a=f=>class extends f{constructor(){super(),this._progressSupported=!1}initialize(d){super.initialize(d),d?.window?.workDoneProgress===!0&&(this._progressSupported=
1017
+ !0,this.connection.onNotification(t.WorkDoneProgressCancelNotification.type,p=>{let m=n.Instances.get(p.token);(m instanceof r||m instanceof s)&&m.cancel()}))}attachWorkDoneProgress(d){return d===void 0?new i:new n(this.connection,d)}createWorkDoneProgress(){if(this._progressSupported){const d=(0,e.generateUuid)();return this.connection.sendRequest(t.WorkDoneProgressCreateRequest.type,{token:d}).then(()=>new r(this.connection,d))}else return Promise.resolve(new s)}};Ei.ProgressFeature=a;var u;(function(f){
1018
+ f.type=new t.ProgressType})(u||(u={}));class c{constructor(d,p){this._connection=d,this._token=p}report(d){this._connection.sendProgress(u.type,this._token,d)}}function l(f,d){if(d===void 0||d.partialResultToken===void 0)return;const p=d.partialResultToken;return delete d.partialResultToken,new c(f,p)}return Ei.attachPartialResult=l,Ei}var pc={},Lk;function j3(){if(Lk)return pc;Lk=1,Object.defineProperty(pc,"__esModule",{value:!0}),pc.ConfigurationFeature=void 0;const t=Lt(),e=wy(),n=r=>class extends r{getConfiguration(i){
1019
+ return i?e.string(i)?this._getConfiguration({section:i}):this._getConfiguration(i):this._getConfiguration({})}_getConfiguration(i){let s={items:Array.isArray(i)?i:[i]};return this.connection.sendRequest(t.ConfigurationRequest.type,s).then(o=>Array.isArray(o)?Array.isArray(i)?o:o[0]:Array.isArray(i)?[]:null)}};return pc.ConfigurationFeature=n,pc}var hc={},Mk;function G3(){if(Mk)return hc;Mk=1,Object.defineProperty(hc,"__esModule",{value:!0}),hc.WorkspaceFoldersFeature=void 0;const t=Lt(),e=n=>class extends n{constructor(){
1020
+ super(),this._notificationIsAutoRegistered=!1}initialize(r){super.initialize(r);let i=r.workspace;i&&i.workspaceFolders&&(this._onDidChangeWorkspaceFolders=new t.Emitter,this.connection.onNotification(t.DidChangeWorkspaceFoldersNotification.type,s=>{this._onDidChangeWorkspaceFolders.fire(s.event)}))}fillServerCapabilities(r){super.fillServerCapabilities(r);const i=r.workspace?.workspaceFolders?.changeNotifications;this._notificationIsAutoRegistered=i===!0||typeof i=="string"}getWorkspaceFolders(){
1021
+ return this.connection.sendRequest(t.WorkspaceFoldersRequest.type)}get onDidChangeWorkspaceFolders(){if(!this._onDidChangeWorkspaceFolders)throw new Error("Client doesn't support sending workspace folder change events.");return!this._notificationIsAutoRegistered&&!this._unregistration&&(this._unregistration=this.connection.client.register(t.DidChangeWorkspaceFoldersNotification.type)),this._onDidChangeWorkspaceFolders.event}};return hc.WorkspaceFoldersFeature=e,hc}var mc={},Bk;function U3(){if(Bk)
1022
+ return mc;Bk=1,Object.defineProperty(mc,"__esModule",{value:!0}),mc.CallHierarchyFeature=void 0;const t=Lt(),e=n=>class extends n{get callHierarchy(){return{onPrepare:r=>this.connection.onRequest(t.CallHierarchyPrepareRequest.type,(i,s)=>r(i,s,this.attachWorkDoneProgress(i),void 0)),onIncomingCalls:r=>{const i=t.CallHierarchyIncomingCallsRequest.type;return this.connection.onRequest(i,(s,o)=>r(s,o,this.attachWorkDoneProgress(s),this.attachPartialResultProgress(i,s)))},onOutgoingCalls:r=>{const i=t.
1023
+ CallHierarchyOutgoingCallsRequest.type;return this.connection.onRequest(i,(s,o)=>r(s,o,this.attachWorkDoneProgress(s),this.attachPartialResultProgress(i,s)))}}}};return mc.CallHierarchyFeature=e,mc}var $i={},qk;function jk(){if(qk)return $i;qk=1,Object.defineProperty($i,"__esModule",{value:!0}),$i.SemanticTokensBuilder=$i.SemanticTokensDiff=$i.SemanticTokensFeature=void 0;const t=Lt(),e=i=>class extends i{get semanticTokens(){return{refresh:()=>this.connection.sendRequest(t.SemanticTokensRefreshRequest.
1024
+ type),on:s=>{const o=t.SemanticTokensRequest.type;return this.connection.onRequest(o,(a,u)=>s(a,u,this.attachWorkDoneProgress(a),this.attachPartialResultProgress(o,a)))},onDelta:s=>{const o=t.SemanticTokensDeltaRequest.type;return this.connection.onRequest(o,(a,u)=>s(a,u,this.attachWorkDoneProgress(a),this.attachPartialResultProgress(o,a)))},onRange:s=>{const o=t.SemanticTokensRangeRequest.type;return this.connection.onRequest(o,(a,u)=>s(a,u,this.attachWorkDoneProgress(a),this.attachPartialResultProgress(
1025
+ o,a)))}}}};$i.SemanticTokensFeature=e;class n{constructor(s,o){this.originalSequence=s,this.modifiedSequence=o}computeDiff(){const s=this.originalSequence.length,o=this.modifiedSequence.length;let a=0;for(;a<o&&a<s&&this.originalSequence[a]===this.modifiedSequence[a];)a++;if(a<o&&a<s){let u=s-1,c=o-1;for(;u>=a&&c>=a&&this.originalSequence[u]===this.modifiedSequence[c];)u--,c--;(u<a||c<a)&&(u++,c++);const l=u-a+1,f=this.modifiedSequence.slice(a,c+1);return f.length===1&&f[0]===this.originalSequence[u]?
1026
+ [{start:a,deleteCount:l-1}]:[{start:a,deleteCount:l,data:f}]}else return a<o?[{start:a,deleteCount:0,data:this.modifiedSequence.slice(a)}]:a<s?[{start:a,deleteCount:s-a}]:[]}}$i.SemanticTokensDiff=n;class r{constructor(){this._prevData=void 0,this.initialize()}initialize(){this._id=Date.now(),this._prevLine=0,this._prevChar=0,this._data=[],this._dataLen=0}push(s,o,a,u,c){let l=s,f=o;this._dataLen>0&&(l-=this._prevLine,l===0&&(f-=this._prevChar)),this._data[this._dataLen++]=l,this._data[this._dataLen++]=
1027
+ f,this._data[this._dataLen++]=a,this._data[this._dataLen++]=u,this._data[this._dataLen++]=c,this._prevLine=s,this._prevChar=o}get id(){return this._id.toString()}previousResult(s){this.id===s&&(this._prevData=this._data),this.initialize()}build(){return this._prevData=void 0,{resultId:this.id,data:this._data}}canBuildEdits(){return this._prevData!==void 0}buildEdits(){return this._prevData!==void 0?{resultId:this.id,edits:new n(this._prevData,this._data).computeDiff()}:this.build()}}return $i.SemanticTokensBuilder=
1028
+ r,$i}var gc={},Gk;function W3(){if(Gk)return gc;Gk=1,Object.defineProperty(gc,"__esModule",{value:!0}),gc.ShowDocumentFeature=void 0;const t=Lt(),e=n=>class extends n{showDocument(r){return this.connection.sendRequest(t.ShowDocumentRequest.type,r)}};return gc.ShowDocumentFeature=e,gc}var yc={},Uk;function z3(){if(Uk)return yc;Uk=1,Object.defineProperty(yc,"__esModule",{value:!0}),yc.FileOperationsFeature=void 0;const t=Lt(),e=n=>class extends n{onDidCreateFiles(r){return this.connection.onNotification(
1029
+ t.DidCreateFilesNotification.type,i=>{r(i)})}onDidRenameFiles(r){return this.connection.onNotification(t.DidRenameFilesNotification.type,i=>{r(i)})}onDidDeleteFiles(r){return this.connection.onNotification(t.DidDeleteFilesNotification.type,i=>{r(i)})}onWillCreateFiles(r){return this.connection.onRequest(t.WillCreateFilesRequest.type,(i,s)=>r(i,s))}onWillRenameFiles(r){return this.connection.onRequest(t.WillRenameFilesRequest.type,(i,s)=>r(i,s))}onWillDeleteFiles(r){return this.connection.onRequest(
1030
+ t.WillDeleteFilesRequest.type,(i,s)=>r(i,s))}};return yc.FileOperationsFeature=e,yc}var vc={},Wk;function H3(){if(Wk)return vc;Wk=1,Object.defineProperty(vc,"__esModule",{value:!0}),vc.LinkedEditingRangeFeature=void 0;const t=Lt(),e=n=>class extends n{onLinkedEditingRange(r){return this.connection.onRequest(t.LinkedEditingRangeRequest.type,(i,s)=>r(i,s,this.attachWorkDoneProgress(i),void 0))}};return vc.LinkedEditingRangeFeature=e,vc}var wc={},zk;function K3(){if(zk)return wc;zk=1,Object.defineProperty(
1031
+ wc,"__esModule",{value:!0}),wc.TypeHierarchyFeature=void 0;const t=Lt(),e=n=>class extends n{get typeHierarchy(){return{onPrepare:r=>this.connection.onRequest(t.TypeHierarchyPrepareRequest.type,(i,s)=>r(i,s,this.attachWorkDoneProgress(i),void 0)),onSupertypes:r=>{const i=t.TypeHierarchySupertypesRequest.type;return this.connection.onRequest(i,(s,o)=>r(s,o,this.attachWorkDoneProgress(s),this.attachPartialResultProgress(i,s)))},onSubtypes:r=>{const i=t.TypeHierarchySubtypesRequest.type;return this.
1032
+ connection.onRequest(i,(s,o)=>r(s,o,this.attachWorkDoneProgress(s),this.attachPartialResultProgress(i,s)))}}}};return wc.TypeHierarchyFeature=e,wc}var bc={},Hk;function V3(){if(Hk)return bc;Hk=1,Object.defineProperty(bc,"__esModule",{value:!0}),bc.InlineValueFeature=void 0;const t=Lt(),e=n=>class extends n{get inlineValue(){return{refresh:()=>this.connection.sendRequest(t.InlineValueRefreshRequest.type),on:r=>this.connection.onRequest(t.InlineValueRequest.type,(i,s)=>r(i,s,this.attachWorkDoneProgress(
1033
+ i)))}}};return bc.InlineValueFeature=e,bc}var Ec={},Kk;function X3(){if(Kk)return Ec;Kk=1,Object.defineProperty(Ec,"__esModule",{value:!0}),Ec.FoldingRangeFeature=void 0;const t=Lt(),e=n=>class extends n{get foldingRange(){return{refresh:()=>this.connection.sendRequest(t.FoldingRangeRefreshRequest.type),on:r=>{const i=t.FoldingRangeRequest.type;return this.connection.onRequest(i,(s,o)=>r(s,o,this.attachWorkDoneProgress(s),this.attachPartialResultProgress(i,s)))}}}};return Ec.FoldingRangeFeature=
1034
+ e,Ec}var $c={},Vk;function Y3(){if(Vk)return $c;Vk=1,Object.defineProperty($c,"__esModule",{value:!0}),$c.InlayHintFeature=void 0;const t=Lt(),e=n=>class extends n{get inlayHint(){return{refresh:()=>this.connection.sendRequest(t.InlayHintRefreshRequest.type),on:r=>this.connection.onRequest(t.InlayHintRequest.type,(i,s)=>r(i,s,this.attachWorkDoneProgress(i))),resolve:r=>this.connection.onRequest(t.InlayHintResolveRequest.type,(i,s)=>r(i,s))}}};return $c.InlayHintFeature=e,$c}var Dc={},Xk;function J3(){
1035
+ if(Xk)return Dc;Xk=1,Object.defineProperty(Dc,"__esModule",{value:!0}),Dc.DiagnosticFeature=void 0;const t=Lt(),e=n=>class extends n{get diagnostics(){return{refresh:()=>this.connection.sendRequest(t.DiagnosticRefreshRequest.type),on:r=>this.connection.onRequest(t.DocumentDiagnosticRequest.type,(i,s)=>r(i,s,this.attachWorkDoneProgress(i),this.attachPartialResultProgress(t.DocumentDiagnosticRequest.partialResult,i))),onWorkspace:r=>this.connection.onRequest(t.WorkspaceDiagnosticRequest.type,(i,s)=>r(
1036
+ i,s,this.attachWorkDoneProgress(i),this.attachPartialResultProgress(t.WorkspaceDiagnosticRequest.partialResult,i)))}}};return Dc.DiagnosticFeature=e,Dc}var Zs={},Rc={},Yk;function Jk(){if(Yk)return Rc;Yk=1,Object.defineProperty(Rc,"__esModule",{value:!0}),Rc.TextDocuments=void 0;const t=Lt();class e{constructor(r){this._configuration=r,this._syncedDocuments=new Map,this._onDidChangeContent=new t.Emitter,this._onDidOpen=new t.Emitter,this._onDidClose=new t.Emitter,this._onDidSave=new t.Emitter,this.
1037
+ _onWillSave=new t.Emitter}get onDidOpen(){return this._onDidOpen.event}get onDidChangeContent(){return this._onDidChangeContent.event}get onWillSave(){return this._onWillSave.event}onWillSaveWaitUntil(r){this._willSaveWaitUntil=r}get onDidSave(){return this._onDidSave.event}get onDidClose(){return this._onDidClose.event}get(r){return this._syncedDocuments.get(r)}all(){return Array.from(this._syncedDocuments.values())}keys(){return Array.from(this._syncedDocuments.keys())}listen(r){r.__textDocumentSync=
1038
+ t.TextDocumentSyncKind.Incremental;const i=[];return i.push(r.onDidOpenTextDocument(s=>{const o=s.textDocument,a=this._configuration.create(o.uri,o.languageId,o.version,o.text);this._syncedDocuments.set(o.uri,a);const u=Object.freeze({document:a});this._onDidOpen.fire(u),this._onDidChangeContent.fire(u)})),i.push(r.onDidChangeTextDocument(s=>{const o=s.textDocument,a=s.contentChanges;if(a.length===0)return;const{version:u}=o;if(u==null)throw new Error(`Received document change event for ${o.uri}\
1039
+ without valid version identifier`);let c=this._syncedDocuments.get(o.uri);c!==void 0&&(c=this._configuration.update(c,a,u),this._syncedDocuments.set(o.uri,c),this._onDidChangeContent.fire(Object.freeze({document:c})))})),i.push(r.onDidCloseTextDocument(s=>{let o=this._syncedDocuments.get(s.textDocument.uri);o!==void 0&&(this._syncedDocuments.delete(s.textDocument.uri),this._onDidClose.fire(Object.freeze({document:o})))})),i.push(r.onWillSaveTextDocument(s=>{let o=this._syncedDocuments.get(s.textDocument.
1040
+ uri);o!==void 0&&this._onWillSave.fire(Object.freeze({document:o,reason:s.reason}))})),i.push(r.onWillSaveTextDocumentWaitUntil((s,o)=>{let a=this._syncedDocuments.get(s.textDocument.uri);return a!==void 0&&this._willSaveWaitUntil?this._willSaveWaitUntil(Object.freeze({document:a,reason:s.reason}),o):[]})),i.push(r.onDidSaveTextDocument(s=>{let o=this._syncedDocuments.get(s.textDocument.uri);o!==void 0&&this._onDidSave.fire(Object.freeze({document:o}))})),t.Disposable.create(()=>{i.forEach(s=>s.
1041
+ dispose())})}}return Rc.TextDocuments=e,Rc}var Qk;function Zk(){if(Qk)return Zs;Qk=1,Object.defineProperty(Zs,"__esModule",{value:!0}),Zs.NotebookDocuments=Zs.NotebookSyncFeature=void 0;const t=Lt(),e=Jk(),n=s=>class extends s{get synchronization(){return{onDidOpenNotebookDocument:o=>this.connection.onNotification(t.DidOpenNotebookDocumentNotification.type,a=>{o(a)}),onDidChangeNotebookDocument:o=>this.connection.onNotification(t.DidChangeNotebookDocumentNotification.type,a=>{o(a)}),onDidSaveNotebookDocument:o=>this.
1042
+ connection.onNotification(t.DidSaveNotebookDocumentNotification.type,a=>{o(a)}),onDidCloseNotebookDocument:o=>this.connection.onNotification(t.DidCloseNotebookDocumentNotification.type,a=>{o(a)})}}};Zs.NotebookSyncFeature=n;class r{onDidOpenTextDocument(o){return this.openHandler=o,t.Disposable.create(()=>{this.openHandler=void 0})}openTextDocument(o){this.openHandler&&this.openHandler(o)}onDidChangeTextDocument(o){return this.changeHandler=o,t.Disposable.create(()=>{this.changeHandler=o})}changeTextDocument(o){
1043
+ this.changeHandler&&this.changeHandler(o)}onDidCloseTextDocument(o){return this.closeHandler=o,t.Disposable.create(()=>{this.closeHandler=void 0})}closeTextDocument(o){this.closeHandler&&this.closeHandler(o)}onWillSaveTextDocument(){return r.NULL_DISPOSE}onWillSaveTextDocumentWaitUntil(){return r.NULL_DISPOSE}onDidSaveTextDocument(){return r.NULL_DISPOSE}}r.NULL_DISPOSE=Object.freeze({dispose:()=>{}});class i{constructor(o){o instanceof e.TextDocuments?this._cellTextDocuments=o:this._cellTextDocuments=
1044
+ new e.TextDocuments(o),this.notebookDocuments=new Map,this.notebookCellMap=new Map,this._onDidOpen=new t.Emitter,this._onDidChange=new t.Emitter,this._onDidSave=new t.Emitter,this._onDidClose=new t.Emitter}get cellTextDocuments(){return this._cellTextDocuments}getCellTextDocument(o){return this._cellTextDocuments.get(o.document)}getNotebookDocument(o){return this.notebookDocuments.get(o)}getNotebookCell(o){const a=this.notebookCellMap.get(o);return a&&a[0]}findNotebookDocumentForCell(o){const a=typeof o==
1045
+ "string"?o:o.document,u=this.notebookCellMap.get(a);return u&&u[1]}get onDidOpen(){return this._onDidOpen.event}get onDidSave(){return this._onDidSave.event}get onDidChange(){return this._onDidChange.event}get onDidClose(){return this._onDidClose.event}listen(o){const a=new r,u=[];return u.push(this.cellTextDocuments.listen(a)),u.push(o.notebooks.synchronization.onDidOpenNotebookDocument(c=>{this.notebookDocuments.set(c.notebookDocument.uri,c.notebookDocument);for(const l of c.cellTextDocuments)
1046
+ a.openTextDocument({textDocument:l});this.updateCellMap(c.notebookDocument),this._onDidOpen.fire(c.notebookDocument)})),u.push(o.notebooks.synchronization.onDidChangeNotebookDocument(c=>{const l=this.notebookDocuments.get(c.notebookDocument.uri);if(l===void 0)return;l.version=c.notebookDocument.version;const f=l.metadata;let d=!1;const p=c.change;p.metadata!==void 0&&(d=!0,l.metadata=p.metadata);const m=[],v=[],w=[],y=[];if(p.cells!==void 0){const V=p.cells;if(V.structure!==void 0){const J=V.structure.
1047
+ array;if(l.cells.splice(J.start,J.deleteCount,...J.cells!==void 0?J.cells:[]),V.structure.didOpen!==void 0)for(const se of V.structure.didOpen)a.openTextDocument({textDocument:se}),m.push(se.uri);if(V.structure.didClose)for(const se of V.structure.didClose)a.closeTextDocument({textDocument:se}),v.push(se.uri)}if(V.data!==void 0){const J=new Map(V.data.map(se=>[se.document,se]));for(let se=0;se<=l.cells.length;se++){const ie=J.get(l.cells[se].document);if(ie!==void 0){const we=l.cells.splice(se,1,
1048
+ ie);if(w.push({old:we[0],new:ie}),J.delete(ie.document),J.size===0)break}}}if(V.textContent!==void 0)for(const J of V.textContent)a.changeTextDocument({textDocument:J.document,contentChanges:J.changes}),y.push(J.document.uri)}this.updateCellMap(l);const E={notebookDocument:l};d&&(E.metadata={old:f,new:l.metadata});const R=[];for(const V of m)R.push(this.getNotebookCell(V));const A=[];for(const V of v)A.push(this.getNotebookCell(V));const N=[];for(const V of y)N.push(this.getNotebookCell(V));(R.length>
1049
+ 0||A.length>0||w.length>0||N.length>0)&&(E.cells={added:R,removed:A,changed:{data:w,textContent:N}}),(E.metadata!==void 0||E.cells!==void 0)&&this._onDidChange.fire(E)})),u.push(o.notebooks.synchronization.onDidSaveNotebookDocument(c=>{const l=this.notebookDocuments.get(c.notebookDocument.uri);l!==void 0&&this._onDidSave.fire(l)})),u.push(o.notebooks.synchronization.onDidCloseNotebookDocument(c=>{const l=this.notebookDocuments.get(c.notebookDocument.uri);if(l!==void 0){this._onDidClose.fire(l);for(const f of c.
1050
+ cellTextDocuments)a.closeTextDocument({textDocument:f});this.notebookDocuments.delete(c.notebookDocument.uri);for(const f of l.cells)this.notebookCellMap.delete(f.document)}})),t.Disposable.create(()=>{u.forEach(c=>c.dispose())})}updateCellMap(o){for(const a of o.cells)this.notebookCellMap.set(a.document,[a,o])}}return Zs.NotebookDocuments=i,Zs}var kc={},eT;function Q3(){if(eT)return kc;eT=1,Object.defineProperty(kc,"__esModule",{value:!0}),kc.MonikerFeature=void 0;const t=Lt(),e=n=>class extends n{get moniker(){
1051
+ return{on:r=>{const i=t.MonikerRequest.type;return this.connection.onRequest(i,(s,o)=>r(s,o,this.attachWorkDoneProgress(s),this.attachPartialResultProgress(i,s)))}}}};return kc.MonikerFeature=e,kc}var tT;function nT(){if(tT)return Ze;tT=1,Object.defineProperty(Ze,"__esModule",{value:!0}),Ze.createConnection=Ze.combineFeatures=Ze.combineNotebooksFeatures=Ze.combineLanguagesFeatures=Ze.combineWorkspaceFeatures=Ze.combineWindowFeatures=Ze.combineClientFeatures=Ze.combineTracerFeatures=Ze.combineTelemetryFeatures=
1052
+ Ze.combineConsoleFeatures=Ze._NotebooksImpl=Ze._LanguagesImpl=Ze.BulkUnregistration=Ze.BulkRegistration=Ze.ErrorMessageTracker=void 0;const t=Lt(),e=wy(),n=Ok(),r=q3(),i=j3(),s=G3(),o=U3(),a=jk(),u=W3(),c=z3(),l=H3(),f=K3(),d=V3(),p=X3(),m=Y3(),v=J3(),w=Zk(),y=Q3();function E(de){if(de!==null)return de}class R{constructor(){this._messages=Object.create(null)}add(I){let G=this._messages[I];G||(G=0),G++,this._messages[I]=G}sendErrors(I){Object.keys(this._messages).forEach(G=>{I.window.showErrorMessage(
1053
+ G)})}}Ze.ErrorMessageTracker=R;class A{constructor(){}rawAttach(I){this._rawConnection=I}attach(I){this._connection=I}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}fillServerCapabilities(I){}initialize(I){}error(I){this.send(t.MessageType.Error,I)}warn(I){this.send(t.MessageType.Warning,I)}info(I){this.send(t.MessageType.Info,I)}log(I){this.send(t.MessageType.Log,I)}debug(I){this.send(t.MessageType.Debug,I)}send(I,G){
1054
+ this._rawConnection&&this._rawConnection.sendNotification(t.LogMessageNotification.type,{type:I,message:G}).catch(()=>{(0,t.RAL)().console.error("Sending log message failed")})}}class N{constructor(){}attach(I){this._connection=I}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(I){}fillServerCapabilities(I){}showErrorMessage(I,...G){let pe={type:t.MessageType.Error,message:I,actions:G};return this.connection.sendRequest(
1055
+ t.ShowMessageRequest.type,pe).then(E)}showWarningMessage(I,...G){let pe={type:t.MessageType.Warning,message:I,actions:G};return this.connection.sendRequest(t.ShowMessageRequest.type,pe).then(E)}showInformationMessage(I,...G){let pe={type:t.MessageType.Info,message:I,actions:G};return this.connection.sendRequest(t.ShowMessageRequest.type,pe).then(E)}}const V=(0,u.ShowDocumentFeature)((0,r.ProgressFeature)(N));var J;(function(de){function I(){return new se}de.create=I})(J||(Ze.BulkRegistration=J={}));
1056
+ class se{constructor(){this._registrations=[],this._registered=new Set}add(I,G){const pe=e.string(I)?I:I.method;if(this._registered.has(pe))throw new Error(`${pe} is already added to this registration`);const U=n.generateUuid();this._registrations.push({id:U,method:pe,registerOptions:G||{}}),this._registered.add(pe)}asRegistrationParams(){return{registrations:this._registrations}}}var ie;(function(de){function I(){return new we(void 0,[])}de.create=I})(ie||(Ze.BulkUnregistration=ie={}));class we{constructor(I,G){
1057
+ this._connection=I,this._unregistrations=new Map,G.forEach(pe=>{this._unregistrations.set(pe.method,pe)})}get isAttached(){return!!this._connection}attach(I){this._connection=I}add(I){this._unregistrations.set(I.method,I)}dispose(){let I=[];for(let pe of this._unregistrations.values())I.push(pe);let G={unregisterations:I};this._connection.sendRequest(t.UnregistrationRequest.type,G).catch(()=>{this._connection.console.info("Bulk unregistration failed.")})}disposeSingle(I){const G=e.string(I)?I:I.
1058
+ method,pe=this._unregistrations.get(G);if(!pe)return!1;let U={unregisterations:[pe]};return this._connection.sendRequest(t.UnregistrationRequest.type,U).then(()=>{this._unregistrations.delete(G)},fe=>{this._connection.console.info(`Un-registering request handler for ${pe.id} failed.`)}),!0}}class B{attach(I){this._connection=I}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(I){}fillServerCapabilities(I){}register(I,G,pe){
1059
+ return I instanceof se?this.registerMany(I):I instanceof we?this.registerSingle1(I,G,pe):this.registerSingle2(I,G)}registerSingle1(I,G,pe){const U=e.string(G)?G:G.method,fe=n.generateUuid();let Ve={registrations:[{id:fe,method:U,registerOptions:pe||{}}]};return I.isAttached||I.attach(this.connection),this.connection.sendRequest(t.RegistrationRequest.type,Ve).then(it=>(I.add({id:fe,method:U}),I),it=>(this.connection.console.info(`Registering request handler for ${U} failed.`),Promise.reject(it)))}registerSingle2(I,G){
1060
+ const pe=e.string(I)?I:I.method,U=n.generateUuid();let fe={registrations:[{id:U,method:pe,registerOptions:G||{}}]};return this.connection.sendRequest(t.RegistrationRequest.type,fe).then(Ve=>t.Disposable.create(()=>{this.unregisterSingle(U,pe).catch(()=>{this.connection.console.info(`Un-registering capability with id ${U} failed.`)})}),Ve=>(this.connection.console.info(`Registering request handler for ${pe} failed.`),Promise.reject(Ve)))}unregisterSingle(I,G){let pe={unregisterations:[{id:I,method:G}]};
1061
+ return this.connection.sendRequest(t.UnregistrationRequest.type,pe).catch(()=>{this.connection.console.info(`Un-registering request handler for ${I} failed.`)})}registerMany(I){let G=I.asRegistrationParams();return this.connection.sendRequest(t.RegistrationRequest.type,G).then(()=>new we(this._connection,G.registrations.map(pe=>({id:pe.id,method:pe.method}))),pe=>(this.connection.console.info("Bulk registration failed."),Promise.reject(pe)))}}class T{constructor(){}attach(I){this._connection=I}get connection(){
1062
+ if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(I){}fillServerCapabilities(I){}applyEdit(I){function G(U){return U&&!!U.edit}let pe=G(I)?I:{edit:I};return this.connection.sendRequest(t.ApplyWorkspaceEditRequest.type,pe)}}const D=(0,c.FileOperationsFeature)((0,s.WorkspaceFoldersFeature)((0,i.ConfigurationFeature)(T)));class M{constructor(){this._trace=t.Trace.Off}attach(I){this._connection=I}get connection(){if(!this._connection)
1063
+ throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(I){}fillServerCapabilities(I){}set trace(I){this._trace=I}log(I,G){this._trace!==t.Trace.Off&&this.connection.sendNotification(t.LogTraceNotification.type,{message:I,verbose:this._trace===t.Trace.Verbose?G:void 0}).catch(()=>{})}}class S{constructor(){}attach(I){this._connection=I}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(I){}fillServerCapabilities(I){}logEvent(I){
1064
+ this.connection.sendNotification(t.TelemetryEventNotification.type,I).catch(()=>{this.connection.console.log("Sending TelemetryEventNotification failed")})}}class P{constructor(){}attach(I){this._connection=I}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(I){}fillServerCapabilities(I){}attachWorkDoneProgress(I){return(0,r.attachWorkDone)(this.connection,I)}attachPartialResultProgress(I,G){return(0,r.attachPartialResult)(
1065
+ this.connection,G)}}Ze._LanguagesImpl=P;const O=(0,p.FoldingRangeFeature)((0,y.MonikerFeature)((0,v.DiagnosticFeature)((0,m.InlayHintFeature)((0,d.InlineValueFeature)((0,f.TypeHierarchyFeature)((0,l.LinkedEditingRangeFeature)((0,a.SemanticTokensFeature)((0,o.CallHierarchyFeature)(P)))))))));class Q{constructor(){}attach(I){this._connection=I}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(I){}fillServerCapabilities(I){}attachWorkDoneProgress(I){
1066
+ return(0,r.attachWorkDone)(this.connection,I)}attachPartialResultProgress(I,G){return(0,r.attachPartialResult)(this.connection,G)}}Ze._NotebooksImpl=Q;const z=(0,w.NotebookSyncFeature)(Q);function C(de,I){return function(G){return I(de(G))}}Ze.combineConsoleFeatures=C;function ne(de,I){return function(G){return I(de(G))}}Ze.combineTelemetryFeatures=ne;function ye(de,I){return function(G){return I(de(G))}}Ze.combineTracerFeatures=ye;function xe(de,I){return function(G){return I(de(G))}}Ze.combineClientFeatures=
1067
+ xe;function L(de,I){return function(G){return I(de(G))}}Ze.combineWindowFeatures=L;function H(de,I){return function(G){return I(de(G))}}Ze.combineWorkspaceFeatures=H;function Se(de,I){return function(G){return I(de(G))}}Ze.combineLanguagesFeatures=Se;function le(de,I){return function(G){return I(de(G))}}Ze.combineNotebooksFeatures=le;function $e(de,I){function G(U,fe,Ve){return U&&fe?Ve(U,fe):U||fe}return{__brand:"features",console:G(de.console,I.console,C),tracer:G(de.tracer,I.tracer,ye),telemetry:G(
1068
+ de.telemetry,I.telemetry,ne),client:G(de.client,I.client,xe),window:G(de.window,I.window,L),workspace:G(de.workspace,I.workspace,H),languages:G(de.languages,I.languages,Se),notebooks:G(de.notebooks,I.notebooks,le)}}Ze.combineFeatures=$e;function Ne(de,I,G){const pe=G&&G.console?new(G.console(A)):new A,U=de(pe);pe.rawAttach(U);const fe=G&&G.tracer?new(G.tracer(M)):new M,Ve=G&&G.telemetry?new(G.telemetry(S)):new S,it=G&&G.client?new(G.client(B)):new B,ue=G&&G.window?new(G.window(V)):new V,Ie=G&&G.
1069
+ workspace?new(G.workspace(D)):new D,re=G&&G.languages?new(G.languages(O)):new O,De=G&&G.notebooks?new(G.notebooks(z)):new z,Ge=[pe,fe,Ve,it,ue,Ie,re,De];function wt(X){return X instanceof Promise?X:e.thenable(X)?new Promise((Y,he)=>{X.then(nn=>Y(nn),nn=>he(nn))}):Promise.resolve(X)}let et,Xt,tn,yn={listen:()=>U.listen(),sendRequest:(X,...Y)=>U.sendRequest(e.string(X)?X:X.method,...Y),onRequest:(X,Y)=>U.onRequest(X,Y),sendNotification:(X,Y)=>{const he=e.string(X)?X:X.method;return U.sendNotification(
1070
+ he,Y)},onNotification:(X,Y)=>U.onNotification(X,Y),onProgress:U.onProgress,sendProgress:U.sendProgress,onInitialize:X=>(Xt=X,{dispose:()=>{Xt=void 0}}),onInitialized:X=>U.onNotification(t.InitializedNotification.type,X),onShutdown:X=>(et=X,{dispose:()=>{et=void 0}}),onExit:X=>(tn=X,{dispose:()=>{tn=void 0}}),get console(){return pe},get telemetry(){return Ve},get tracer(){return fe},get client(){return it},get window(){return ue},get workspace(){return Ie},get languages(){return re},get notebooks(){
1071
+ return De},onDidChangeConfiguration:X=>U.onNotification(t.DidChangeConfigurationNotification.type,X),onDidChangeWatchedFiles:X=>U.onNotification(t.DidChangeWatchedFilesNotification.type,X),__textDocumentSync:void 0,onDidOpenTextDocument:X=>U.onNotification(t.DidOpenTextDocumentNotification.type,X),onDidChangeTextDocument:X=>U.onNotification(t.DidChangeTextDocumentNotification.type,X),onDidCloseTextDocument:X=>U.onNotification(t.DidCloseTextDocumentNotification.type,X),onWillSaveTextDocument:X=>U.
1072
+ onNotification(t.WillSaveTextDocumentNotification.type,X),onWillSaveTextDocumentWaitUntil:X=>U.onRequest(t.WillSaveTextDocumentWaitUntilRequest.type,X),onDidSaveTextDocument:X=>U.onNotification(t.DidSaveTextDocumentNotification.type,X),sendDiagnostics:X=>U.sendNotification(t.PublishDiagnosticsNotification.type,X),onHover:X=>U.onRequest(t.HoverRequest.type,(Y,he)=>X(Y,he,(0,r.attachWorkDone)(U,Y),void 0)),onCompletion:X=>U.onRequest(t.CompletionRequest.type,(Y,he)=>X(Y,he,(0,r.attachWorkDone)(U,Y),
1073
+ (0,r.attachPartialResult)(U,Y))),onCompletionResolve:X=>U.onRequest(t.CompletionResolveRequest.type,X),onSignatureHelp:X=>U.onRequest(t.SignatureHelpRequest.type,(Y,he)=>X(Y,he,(0,r.attachWorkDone)(U,Y),void 0)),onDeclaration:X=>U.onRequest(t.DeclarationRequest.type,(Y,he)=>X(Y,he,(0,r.attachWorkDone)(U,Y),(0,r.attachPartialResult)(U,Y))),onDefinition:X=>U.onRequest(t.DefinitionRequest.type,(Y,he)=>X(Y,he,(0,r.attachWorkDone)(U,Y),(0,r.attachPartialResult)(U,Y))),onTypeDefinition:X=>U.onRequest(
1074
+ t.TypeDefinitionRequest.type,(Y,he)=>X(Y,he,(0,r.attachWorkDone)(U,Y),(0,r.attachPartialResult)(U,Y))),onImplementation:X=>U.onRequest(t.ImplementationRequest.type,(Y,he)=>X(Y,he,(0,r.attachWorkDone)(U,Y),(0,r.attachPartialResult)(U,Y))),onReferences:X=>U.onRequest(t.ReferencesRequest.type,(Y,he)=>X(Y,he,(0,r.attachWorkDone)(U,Y),(0,r.attachPartialResult)(U,Y))),onDocumentHighlight:X=>U.onRequest(t.DocumentHighlightRequest.type,(Y,he)=>X(Y,he,(0,r.attachWorkDone)(U,Y),(0,r.attachPartialResult)(U,
1075
+ Y))),onDocumentSymbol:X=>U.onRequest(t.DocumentSymbolRequest.type,(Y,he)=>X(Y,he,(0,r.attachWorkDone)(U,Y),(0,r.attachPartialResult)(U,Y))),onWorkspaceSymbol:X=>U.onRequest(t.WorkspaceSymbolRequest.type,(Y,he)=>X(Y,he,(0,r.attachWorkDone)(U,Y),(0,r.attachPartialResult)(U,Y))),onWorkspaceSymbolResolve:X=>U.onRequest(t.WorkspaceSymbolResolveRequest.type,X),onCodeAction:X=>U.onRequest(t.CodeActionRequest.type,(Y,he)=>X(Y,he,(0,r.attachWorkDone)(U,Y),(0,r.attachPartialResult)(U,Y))),onCodeActionResolve:X=>U.
1076
+ onRequest(t.CodeActionResolveRequest.type,(Y,he)=>X(Y,he)),onCodeLens:X=>U.onRequest(t.CodeLensRequest.type,(Y,he)=>X(Y,he,(0,r.attachWorkDone)(U,Y),(0,r.attachPartialResult)(U,Y))),onCodeLensResolve:X=>U.onRequest(t.CodeLensResolveRequest.type,(Y,he)=>X(Y,he)),onDocumentFormatting:X=>U.onRequest(t.DocumentFormattingRequest.type,(Y,he)=>X(Y,he,(0,r.attachWorkDone)(U,Y),void 0)),onDocumentRangeFormatting:X=>U.onRequest(t.DocumentRangeFormattingRequest.type,(Y,he)=>X(Y,he,(0,r.attachWorkDone)(U,Y),
1077
+ void 0)),onDocumentOnTypeFormatting:X=>U.onRequest(t.DocumentOnTypeFormattingRequest.type,(Y,he)=>X(Y,he)),onRenameRequest:X=>U.onRequest(t.RenameRequest.type,(Y,he)=>X(Y,he,(0,r.attachWorkDone)(U,Y),void 0)),onPrepareRename:X=>U.onRequest(t.PrepareRenameRequest.type,(Y,he)=>X(Y,he)),onDocumentLinks:X=>U.onRequest(t.DocumentLinkRequest.type,(Y,he)=>X(Y,he,(0,r.attachWorkDone)(U,Y),(0,r.attachPartialResult)(U,Y))),onDocumentLinkResolve:X=>U.onRequest(t.DocumentLinkResolveRequest.type,(Y,he)=>X(Y,
1078
+ he)),onDocumentColor:X=>U.onRequest(t.DocumentColorRequest.type,(Y,he)=>X(Y,he,(0,r.attachWorkDone)(U,Y),(0,r.attachPartialResult)(U,Y))),onColorPresentation:X=>U.onRequest(t.ColorPresentationRequest.type,(Y,he)=>X(Y,he,(0,r.attachWorkDone)(U,Y),(0,r.attachPartialResult)(U,Y))),onFoldingRanges:X=>U.onRequest(t.FoldingRangeRequest.type,(Y,he)=>X(Y,he,(0,r.attachWorkDone)(U,Y),(0,r.attachPartialResult)(U,Y))),onSelectionRanges:X=>U.onRequest(t.SelectionRangeRequest.type,(Y,he)=>X(Y,he,(0,r.attachWorkDone)(
1079
+ U,Y),(0,r.attachPartialResult)(U,Y))),onExecuteCommand:X=>U.onRequest(t.ExecuteCommandRequest.type,(Y,he)=>X(Y,he,(0,r.attachWorkDone)(U,Y),void 0)),dispose:()=>U.dispose()};for(let X of Ge)X.attach(yn);return U.onRequest(t.InitializeRequest.type,X=>{I.initialize(X),e.string(X.trace)&&(fe.trace=t.Trace.fromString(X.trace));for(let Y of Ge)Y.initialize(X.capabilities);if(Xt){let Y=Xt(X,new t.CancellationTokenSource().token,(0,r.attachWorkDone)(U,X),void 0);return wt(Y).then(he=>{if(he instanceof t.
1080
+ ResponseError)return he;let nn=he;nn||(nn={capabilities:{}});let Yt=nn.capabilities;Yt||(Yt={},nn.capabilities=Yt),Yt.textDocumentSync===void 0||Yt.textDocumentSync===null?Yt.textDocumentSync=e.number(yn.__textDocumentSync)?yn.__textDocumentSync:t.TextDocumentSyncKind.None:!e.number(Yt.textDocumentSync)&&!e.number(Yt.textDocumentSync.change)&&(Yt.textDocumentSync.change=e.number(yn.__textDocumentSync)?yn.__textDocumentSync:t.TextDocumentSyncKind.None);for(let Nr of Ge)Nr.fillServerCapabilities(Yt);
1081
+ return nn})}else{let Y={capabilities:{textDocumentSync:t.TextDocumentSyncKind.None}};for(let he of Ge)he.fillServerCapabilities(Y.capabilities);return Y}}),U.onRequest(t.ShutdownRequest.type,()=>{if(I.shutdownReceived=!0,et)return et(new t.CancellationTokenSource().token)}),U.onNotification(t.ExitNotification.type,()=>{try{tn&&tn()}finally{I.shutdownReceived?I.exit(0):I.exit(1)}}),U.onNotification(t.SetTraceNotification.type,X=>{fe.trace=t.Trace.fromString(X.value)}),yn}return Ze.createConnection=
1082
+ Ne,Ze}var Sn={},rT;function Z3(){if(rT)return Sn;rT=1,Object.defineProperty(Sn,"__esModule",{value:!0}),Sn.resolveModulePath=Sn.FileSystem=Sn.resolveGlobalYarnPath=Sn.resolveGlobalNodePath=Sn.resolve=Sn.uriToFilePath=void 0;const t=g_,e=qi,n=La,r=y_;function i(f){let d=t.parse(f);if(d.protocol!=="file:"||!d.path)return;let p=d.path.split("/");for(var m=0,v=p.length;m<v;m++)p[m]=decodeURIComponent(p[m]);if(process.platform==="win32"&&p.length>1){let w=p[0],y=p[1];w.length===0&&y.length>1&&y[1]===
1083
+ ":"&&p.shift()}return e.normalize(p.join("/"))}Sn.uriToFilePath=i;function s(){return process.platform==="win32"}function o(f,d,p,m){const v="NODE_PATH",w=["var p = process;","p.on('message',function(m){","if(m.c==='e'){","p.exit(0);","}","else if(m.c==='rs'){","try{","var r=require.resolve(m.a);","p.send({c:'r',s:true,r:r});","}","catch(err){","p.send({c:'r',s:false});","}","}","});"].join("");return new Promise((y,E)=>{let R=process.env,A=Object.create(null);Object.keys(R).forEach(N=>A[N]=R[N]),
1084
+ d&&n.existsSync(d)&&(A[v]?A[v]=d+e.delimiter+A[v]:A[v]=d,m&&m(`NODE_PATH value is: ${A[v]}`)),A.ELECTRON_RUN_AS_NODE="1";try{let N=(0,r.fork)("",[],{cwd:p,env:A,execArgv:["-e",w]});if(N.pid===void 0){E(new Error(`Starting process to resolve node module ${f} failed`));return}N.on("error",J=>{E(J)}),N.on("message",J=>{J.c==="r"&&(N.send({c:"e"}),J.s?y(J.r):E(new Error(`Failed to resolve module: ${f}`)))});let V={c:"rs",a:f};N.send(V)}catch(N){E(N)}})}Sn.resolve=o;function a(f){let d="npm";const p=Object.
1085
+ create(null);Object.keys(process.env).forEach(w=>p[w]=process.env[w]),p.NO_UPDATE_NOTIFIER="true";const m={encoding:"utf8",env:p};s()&&(d="npm.cmd",m.shell=!0);let v=()=>{};try{process.on("SIGPIPE",v);let w=(0,r.spawnSync)(d,["config","get","prefix"],m).stdout;if(!w){f&&f("'npm config get prefix' didn't return a value.");return}let y=w.trim();return f&&f(`'npm config get prefix' value is: ${y}`),y.length>0?s()?e.join(y,"node_modules"):e.join(y,"lib","node_modules"):void 0}catch{return}finally{process.
1086
+ removeListener("SIGPIPE",v)}}Sn.resolveGlobalNodePath=a;function u(f){let d="yarn",p={encoding:"utf8"};s()&&(d="yarn.cmd",p.shell=!0);let m=()=>{};try{process.on("SIGPIPE",m);let v=(0,r.spawnSync)(d,["global","dir","--json"],p),w=v.stdout;if(!w){f&&(f("'yarn global dir' didn't return a value."),v.stderr&&f(v.stderr));return}let y=w.trim().split(/\r?\n/);for(let E of y)try{let R=JSON.parse(E);if(R.type==="log")return e.join(R.data,"node_modules")}catch{}return}catch{return}finally{process.removeListener(
1087
+ "SIGPIPE",m)}}Sn.resolveGlobalYarnPath=u;var c;(function(f){let d;function p(){return d!==void 0||(process.platform==="win32"?d=!1:d=!n.existsSync(__filename.toUpperCase())||!n.existsSync(__filename.toLowerCase())),d}f.isCaseSensitive=p;function m(v,w){return p()?e.normalize(w).indexOf(e.normalize(v))===0:e.normalize(w).toLowerCase().indexOf(e.normalize(v).toLowerCase())===0}f.isParent=m})(c||(Sn.FileSystem=c={}));function l(f,d,p,m){return p?(e.isAbsolute(p)||(p=e.join(f,p)),o(d,p,p,m).then(v=>c.
1088
+ isParent(p,v)?v:Promise.reject(new Error(`Failed to load ${d} from node path location.`))).then(void 0,v=>o(d,a(m),f,m))):o(d,a(m),f,m)}return Sn.resolveModulePath=l,Sn}var Cy,iT;function sT(){return iT||(iT=1,Cy=Lt()),Cy}var eo={},Tc={},oT;function eG(){if(oT)return Tc;oT=1,Object.defineProperty(Tc,"__esModule",{value:!0}),Tc.InlineCompletionFeature=void 0;const t=Lt(),e=n=>class extends n{get inlineCompletion(){return{on:r=>this.connection.onRequest(t.InlineCompletionRequest.type,(i,s)=>r(i,s,
1089
+ this.attachWorkDoneProgress(i)))}}};return Tc.InlineCompletionFeature=e,Tc}var aT;function tG(){return aT||(aT=1,function(t){var e=eo&&eo.__createBinding||(Object.create?function(u,c,l,f){f===void 0&&(f=l);var d=Object.getOwnPropertyDescriptor(c,l);(!d||("get"in d?!c.__esModule:d.writable||d.configurable))&&(d={enumerable:!0,get:function(){return c[l]}}),Object.defineProperty(u,f,d)}:function(u,c,l,f){f===void 0&&(f=l),u[f]=c[l]}),n=eo&&eo.__exportStar||function(u,c){for(var l in u)l!=="default"&&
1090
+ !Object.prototype.hasOwnProperty.call(c,l)&&e(c,u,l)};Object.defineProperty(t,"__esModule",{value:!0}),t.ProposedFeatures=t.NotebookDocuments=t.TextDocuments=t.SemanticTokensBuilder=void 0;const r=jk();Object.defineProperty(t,"SemanticTokensBuilder",{enumerable:!0,get:function(){return r.SemanticTokensBuilder}});const i=eG();n(Lt(),t);const s=Jk();Object.defineProperty(t,"TextDocuments",{enumerable:!0,get:function(){return s.TextDocuments}});const o=Zk();Object.defineProperty(t,"NotebookDocument\
1091
+ s",{enumerable:!0,get:function(){return o.NotebookDocuments}}),n(nT(),t);var a;(function(u){u.all={__brand:"features",languages:i.InlineCompletionFeature}})(a||(t.ProposedFeatures=a={}))}(eo)),eo}var uT;function cT(){return uT||(uT=1,function(t){var e=Us&&Us.__createBinding||(Object.create?function(y,E,R,A){A===void 0&&(A=R);var N=Object.getOwnPropertyDescriptor(E,R);(!N||("get"in N?!E.__esModule:N.writable||N.configurable))&&(N={enumerable:!0,get:function(){return E[R]}}),Object.defineProperty(
1092
+ y,A,N)}:function(y,E,R,A){A===void 0&&(A=R),y[A]=E[R]}),n=Us&&Us.__exportStar||function(y,E){for(var R in y)R!=="default"&&!Object.prototype.hasOwnProperty.call(E,R)&&e(E,y,R)};Object.defineProperty(t,"__esModule",{value:!0}),t.createConnection=t.Files=void 0;const r=l_,i=wy(),s=nT(),o=Z3(),a=sT();n(sT(),t),n(tG(),t);var u;(function(y){y.uriToFilePath=o.uriToFilePath,y.resolveGlobalNodePath=o.resolveGlobalNodePath,y.resolveGlobalYarnPath=o.resolveGlobalYarnPath,y.resolve=o.resolve,y.resolveModulePath=
1093
+ o.resolveModulePath})(u||(t.Files=u={}));function c(){}let l=!1,f;function d(){const y="--clientProcessId";function E(R){try{let A=parseInt(R);isNaN(A)||(f=setInterval(()=>{try{process.kill(A,0)}catch{process.exit(l?0:1)}},3e3))}catch{}}for(let R=2;R<process.argv.length;R++){let A=process.argv[R];if(A===y&&R+1<process.argv.length){E(process.argv[R+1]);return}else{let N=A.split("=");N[0]===y&&E(N[1])}}}d();const p={initialize:y=>{const E=y.processId;i.number(E)&&f===void 0&&setInterval(()=>{try{process.
1094
+ kill(E,0)}catch{process.exit(l?0:1)}},3e3)},get shutdownReceived(){return l},set shutdownReceived(y){l=y},exit:y=>{process.exit(y)}};function m(y,E,R,A){let N,V,J,se;return y!==void 0&&y.__brand==="features"&&(N=y,y=E,E=R,R=A),a.ConnectionStrategy.is(y)||a.ConnectionOptions.is(y)?se=y:(V=y,J=E,se=R),v(V,J,se,N)}t.createConnection=m;function v(y,E,R,A){let N=!1;if(!y&&!E&&process.argv.length>2){let ie,we,B=process.argv.slice(2);for(let T=0;T<B.length;T++){let D=B[T];if(D==="--node-ipc"){y=new a.IPCMessageReader(
1095
+ process),E=new a.IPCMessageWriter(process);break}else if(D==="--stdio"){N=!0,y=process.stdin,E=process.stdout;break}else if(D==="--socket"){ie=parseInt(B[T+1]);break}else if(D==="--pipe"){we=B[T+1];break}else{var V=D.split("=");if(V[0]==="--socket"){ie=parseInt(V[1]);break}else if(V[0]==="--pipe"){we=V[1];break}}}if(ie){let T=(0,a.createServerSocketTransport)(ie);y=T[0],E=T[1]}else if(we){let T=(0,a.createServerPipeTransport)(we);y=T[0],E=T[1]}}var J="Use arguments of createConnection or set com\
1096
+ mand line parameters: '--node-ipc', '--stdio' or '--socket={number}'";if(!y)throw new Error("Connection input stream is not set. "+J);if(!E)throw new Error("Connection output stream is not set. "+J);if(i.func(y.read)&&i.func(y.on)){let ie=y;ie.on("end",()=>{process.exit(l?0:1)}),ie.on("close",()=>{process.exit(l?0:1)})}const se=ie=>{const we=(0,a.createProtocolConnection)(y,E,ie,R);return N&&w(ie),we};return(0,s.createConnection)(se,p,A)}function w(y){function E(A){return A.map(N=>typeof N=="str\
1097
+ ing"?N:(0,r.inspect)(N)).join(" ")}const R=new Map;console.assert=function(N,...V){if(!N)if(V.length===0)y.error("Assertion failed");else{const[J,...se]=V;y.error(`Assertion failed: ${J} ${E(se)}`)}},console.count=function(N="default"){const V=String(N);let J=R.get(V)??0;J+=1,R.set(V,J),y.log(`${V}: ${V}`)},console.countReset=function(N){N===void 0?R.clear():R.delete(String(N))},console.debug=function(...N){y.log(E(N))},console.dir=function(N,V){y.log((0,r.inspect)(N,V))},console.log=function(...N){
1098
+ y.log(E(N))},console.error=function(...N){y.error(E(N))},console.trace=function(...N){const V=new Error().stack.replace(/(.+\n){2}/,"");let J="Trace";N.length!==0&&(J+=`: ${E(N)}`),y.log(`${J}
1099
+ ${V}`)},console.warn=function(...N){y.warn(E(N))}}}(Us)),Us}var ge=cT();function lT(t,e){const n={stacks:t,tokens:e};return nG(n),n.stacks.flat().forEach(i=>{i.property=void 0}),fT(n.stacks).map(i=>i[i.length-1])}function Ay(t){const{next:e,cardinalities:n,visited:r,plus:i}=t,s=[],o=e.feature;if(r.has(o))return[];Ui(o)||r.add(o);let a,u=o;for(;u.$container;)if(Ui(u.$container)){a=u.$container;break}else if(wm(u.$container))u=u.$container;else break;if(p0(u.cardinality)){const c=ea({next:{feature:u,
1100
+ type:e.type},cardinalities:n,visited:r,plus:i});for(const l of c)i.add(l.feature);s.push(...c)}if(a){const c=a.elements.indexOf(u);c!==void 0&&c<a.elements.length-1&&s.push(...dT({feature:a,type:e.type},c+1,n,r,i)),s.every(l=>Oo(l.feature.cardinality,l.feature)||Oo(n.get(l.feature))||i.has(l.feature))&&s.push(...Ay({next:{feature:a,type:e.type},cardinalities:n,visited:r,plus:i}))}return s}function Sy(t){return kt(t)&&(t={feature:t}),ea({next:t,cardinalities:new Map,visited:new Set,plus:new Set})}
1101
+ function ea(t){var e,n,r;const{next:i,cardinalities:s,visited:o,plus:a}=t;if(i===void 0)return[];const{feature:u,type:c}=i;if(Ui(u))return o.has(u)?[]:(o.add(u),dT(i,0,s,o,a).map(l=>dp(l,u.cardinality,s)));if(Rm(u)||km(u))return u.elements.flatMap(l=>ea({next:{feature:l,type:c,property:i.property},cardinalities:s,visited:o,plus:a})).map(l=>dp(l,u.cardinality,s));if(Fr(u)){const l={feature:u.terminal,type:c,property:(e=i.property)!==null&&e!==void 0?e:u.feature};return ea({next:l,cardinalities:s,
1102
+ visited:o,plus:a}).map(f=>dp(f,u.cardinality,s))}else{if(ks(u))return Ay({next:{feature:u,type:Ru(u),property:(n=i.property)!==null&&n!==void 0?n:u.feature},cardinalities:s,visited:o,plus:a});if(ti(u)&&fn(u.rule.ref)){const l=u.rule.ref,f={feature:l.definition,type:l.fragment||l.dataType?void 0:(r=Ts(l))!==null&&r!==void 0?r:l.name,property:i.property};return ea({next:f,cardinalities:s,visited:o,plus:a}).map(d=>dp(d,u.cardinality,s))}else return[i]}}function dp(t,e,n){return n.set(t.feature,e),t}
1103
+ function dT(t,e,n,r,i){var s;const o=[];let a;for(;e<t.feature.elements.length&&(a={feature:t.feature.elements[e++],type:t.type},o.push(...ea({next:a,cardinalities:n,visited:r,plus:i})),!!Oo((s=a.feature.cardinality)!==null&&s!==void 0?s:n.get(a.feature),a.feature)););return o}function nG(t){for(const e of t.tokens){const n=fT(t.stacks,e);t.stacks=n}}function fT(t,e){const n=[];for(const r of t)n.push(...rG(r,e));return n}function rG(t,e){const n=new Map,r=new Set(t.map(s=>s.feature).filter(iG)),
1104
+ i=[];for(;t.length>0;){const s=t.pop(),o=Ay({next:s,cardinalities:n,plus:r,visited:new Set}).filter(a=>e?_y(a.feature,e):!0);for(const a of o)i.push([...t,a]);if(!o.every(a=>Oo(a.feature.cardinality,a.feature)||Oo(n.get(a.feature))))break}return i}function iG(t){if(t.cardinality==="+")return!0;const e=Wn(t,Fr);return!!(e&&e.cardinality==="+")}function _y(t,e){if(Lr(t))return t.value===e.image;if(ti(t))return sG(t.rule.ref,e);if(uu(t)){const n=Im(t);if(n)return _y(n,e)}return!1}function sG(t,e){return fn(
1105
+ t)?Sy(t.definition).some(r=>_y(r.feature,e)):ei(t)?ku(t).test(e.image):!1}function oG(t){const e=Array.from(new Set(t.flatMap(r=>{var i;return(i=r?.triggerCharacters)!==null&&i!==void 0?i:[]}))),n=Array.from(new Set(t.flatMap(r=>{var i;return(i=r?.allCommitCharacters)!==null&&i!==void 0?i:[]})));return{triggerCharacters:e.length>0?e:void 0,allCommitCharacters:n.length>0?n:void 0}}class pT{constructor(e){this.scopeProvider=e.references.ScopeProvider,this.grammar=e.Grammar,this.completionParser=e.
1106
+ parser.CompletionParser,this.nameProvider=e.references.NameProvider,this.lexer=e.parser.Lexer,this.nodeKindProvider=e.shared.lsp.NodeKindProvider,this.fuzzyMatcher=e.shared.lsp.FuzzyMatcher,this.grammarConfig=e.parser.GrammarConfig,this.astReflection=e.shared.AstReflection,this.documentationProvider=e.documentation.DocumentationProvider}async getCompletion(e,n,r){const i=[],s=this.buildContexts(e,n.position),o=(c,l)=>{const f=this.fillCompletionItem(c,l);f&&i.push(f)},a=c=>Lr(c.feature)?c.feature.
1107
+ value:c.feature,u=[];for(const c of s)if(await Promise.all(Xe(c.features).distinct(a).exclude(u).map(l=>this.completionFor(c,l,o))),u.push(...c.features),!this.continueCompletion(i))break;return ge.CompletionList.create(this.deduplicateItems(i),!0)}deduplicateItems(e){return Xe(e).distinct(n=>`${n.kind}_${n.label}_${n.detail}`).toArray()}findFeaturesAt(e,n){const r=e.getText({start:ge.Position.create(0,0),end:e.positionAt(n)}),i=this.completionParser.parse(r),s=i.tokens;if(i.tokenIndex===0){const u=tf(
1108
+ this.grammar),c=Sy({feature:u.definition,type:Ts(u)});return s.length>0?(s.shift(),lT(c.map(l=>[l]),s)):c}const o=[...s].splice(i.tokenIndex);return lT([i.elementStack.map(u=>({feature:u}))],o)}*buildContexts(e,n){var r,i;const s=e.parseResult.value.$cstNode;if(!s)return;const o=e.textDocument,a=o.getText(),u=o.offsetAt(n),c={document:e,textDocument:o,offset:u,position:n},l=this.findDataTypeRuleStart(s,u);if(l){const[E,R]=l,A=(r=gm(s,E))===null||r===void 0?void 0:r.astNode;yield Object.assign(Object.
1109
+ assign({},c),{node:A,tokenOffset:E,tokenEndOffset:R,features:this.findFeaturesAt(o,E)})}const{nextTokenStart:f,nextTokenEnd:d,previousTokenStart:p,previousTokenEnd:m}=this.backtrackToAnyToken(a,u);let v=f;u<=f&&p!==void 0&&(v=p);const w=(i=gm(s,v))===null||i===void 0?void 0:i.astNode;let y=!0;if(p!==void 0&&m!==void 0&&m===u&&(yield Object.assign(Object.assign({},c),{node:w,tokenOffset:p,tokenEndOffset:m,features:this.findFeaturesAt(o,p)}),y=this.performNextTokenCompletion(e,a.substring(p,m),p,m),
1110
+ y&&(yield Object.assign(Object.assign({},c),{node:w,tokenOffset:m,tokenEndOffset:m,features:this.findFeaturesAt(o,m)}))),w)y&&(yield Object.assign(Object.assign({},c),{node:w,tokenOffset:f,tokenEndOffset:d,features:this.findFeaturesAt(o,f)}));else{const E=tf(this.grammar);if(!E)throw new Error("Missing entry parser rule");yield Object.assign(Object.assign({},c),{tokenOffset:f,tokenEndOffset:d,features:Sy(E.definition)})}}performNextTokenCompletion(e,n,r,i){return new RegExp("\\P{L}$","u").test(n)}findDataTypeRuleStart(e,n){
1111
+ var r,i;let s=Rs(e,n,this.grammarConfig.nameRegexp),o=!!(!((r=Wn(s?.grammarSource,fn))===null||r===void 0)&&r.dataType);if(o){for(;o;)s=s?.container,o=!!(!((i=Wn(s?.grammarSource,fn))===null||i===void 0)&&i.dataType);if(s)return[s.offset,s.end]}}continueCompletion(e){return e.length===0}backtrackToAnyToken(e,n){const r=this.lexer.tokenize(e).tokens;if(r.length===0)return{nextTokenStart:n,nextTokenEnd:n};let i;for(const s of r){if(s.startOffset>=n)return{nextTokenStart:n,nextTokenEnd:n,previousTokenStart:i?
1112
+ i.startOffset:void 0,previousTokenEnd:i?i.endOffset+1:void 0};if(s.endOffset>=n)return{nextTokenStart:s.startOffset,nextTokenEnd:s.endOffset+1,previousTokenStart:i?i.startOffset:void 0,previousTokenEnd:i?i.endOffset+1:void 0};i=s}return{nextTokenStart:n,nextTokenEnd:n,previousTokenStart:i?i.startOffset:void 0,previousTokenEnd:i?i.endOffset+1:void 0}}completionFor(e,n,r){if(Lr(n.feature))return this.completionForKeyword(e,n.feature,r);if(uu(n.feature)&&e.node)return this.completionForCrossReference(
1113
+ e,n,r)}completionForCrossReference(e,n,r){const i=Wn(n.feature,Fr);let s=e.node;if(i&&s){n.type&&(s={$type:n.type,$container:s,$containerProperty:n.property},Am(this.astReflection,s));const o={reference:{$refText:""},container:s,property:i.feature};try{for(const a of this.getReferenceCandidates(o,e))r(e,this.createReferenceCompletionItem(a))}catch(a){console.error(a)}}}getReferenceCandidates(e,n){return this.scopeProvider.getScope(e).getAllElements()}createReferenceCompletionItem(e){const n=this.
1114
+ nodeKindProvider.getCompletionItemKind(e),r=this.getReferenceDocumentation(e);return{nodeDescription:e,kind:n,documentation:r,detail:e.type,sortText:"0"}}getReferenceDocumentation(e){if(!e.node)return;const n=this.documentationProvider.getDocumentation(e.node);if(n)return{kind:"markdown",value:n}}completionForKeyword(e,n,r){this.filterKeyword(e,n)&&r(e,{label:n.value,kind:this.getKeywordCompletionItemKind(n),detail:"Keyword",sortText:"1"})}getKeywordCompletionItemKind(e){return ge.CompletionItemKind.
1115
+ Keyword}filterKeyword(e,n){return new RegExp("\\p{L}","u").test(n.value)}fillCompletionItem(e,n){var r,i;let s;if(typeof n.label=="string")s=n.label;else if("node"in n){const c=this.nameProvider.getName(n.node);if(!c)return;s=c}else if("nodeDescription"in n)s=n.nodeDescription.name;else return;let o;typeof((r=n.textEdit)===null||r===void 0?void 0:r.newText)=="string"?o=n.textEdit.newText:typeof n.insertText=="string"?o=n.insertText:o=s;const a=(i=n.textEdit)!==null&&i!==void 0?i:this.buildCompletionTextEdit(
1116
+ e,s,o);return a?{additionalTextEdits:n.additionalTextEdits,command:n.command,commitCharacters:n.commitCharacters,data:n.data,detail:n.detail,documentation:n.documentation,filterText:n.filterText,insertText:n.insertText,insertTextFormat:n.insertTextFormat,insertTextMode:n.insertTextMode,kind:n.kind,labelDetails:n.labelDetails,preselect:n.preselect,sortText:n.sortText,tags:n.tags,textEditText:n.textEditText,textEdit:a,label:s}:void 0}buildCompletionTextEdit(e,n,r){const s=e.textDocument.getText().
1117
+ substring(e.tokenOffset,e.offset);if(this.fuzzyMatcher.match(s,n)){const o=e.textDocument.positionAt(e.tokenOffset),a=e.position;return{newText:r,range:{start:o,end:a}}}else return}}class aG{constructor(e){this.nameProvider=e.references.NameProvider,this.references=e.references.References,this.grammarConfig=e.parser.GrammarConfig}getDefinition(e,n,r){const i=e.parseResult.value;if(i.$cstNode){const s=i.$cstNode,o=Rs(s,e.textDocument.offsetAt(n.position),this.grammarConfig.nameRegexp);if(o)return this.
1118
+ collectLocationLinks(o,n)}}collectLocationLinks(e,n){var r;const i=this.findLink(e);if(i)return[ge.LocationLink.create(i.targetDocument.textDocument.uri,((r=i.target.astNode.$cstNode)!==null&&r!==void 0?r:i.target).range,i.target.range,i.source.range)]}findLink(e){const n=this.references.findDeclarationNode(e);if(n?.astNode){const r=at(n.astNode);if(n&&r)return{source:e,target:n,targetDocument:r}}}}class hT{constructor(e){this.references=e.references.References,this.nameProvider=e.references.NameProvider,
1119
+ this.grammarConfig=e.parser.GrammarConfig}getDocumentHighlight(e,n,r){const i=e.parseResult.value.$cstNode;if(!i)return;const s=Rs(i,e.textDocument.offsetAt(n.position),this.grammarConfig.nameRegexp);if(!s)return;const o=this.references.findDeclaration(s);if(o){const a=ht.equals(at(o).uri,e.uri),u={documentUri:e.uri,includeDeclaration:a};return this.references.findReferences(o,u).map(l=>this.createDocumentHighlight(l)).toArray()}}createDocumentHighlight(e){return ge.DocumentHighlight.create(e.segment.
1120
+ range)}}class uG{constructor(e){this.nameProvider=e.references.NameProvider,this.nodeKindProvider=e.shared.lsp.NodeKindProvider}getSymbols(e,n,r){return this.getSymbol(e,e.parseResult.value)}getSymbol(e,n){const r=n.$cstNode,i=this.nameProvider.getNameNode(n);if(i&&r){const s=this.nameProvider.getName(n);return[{kind:this.nodeKindProvider.getSymbolKind(n),name:s||i.text,range:r.range,selectionRange:i.range,children:this.getChildSymbols(e,n)}]}else return this.getChildSymbols(e,n)||[]}getChildSymbols(e,n){
1121
+ const r=[];for(const i of Eu(n)){const s=this.getSymbol(e,i);r.push(...s)}if(r.length>0)return r}}class cG{constructor(e){this.workspaceManager=e.workspace.WorkspaceManager,this.documentBuilder=e.workspace.DocumentBuilder,this.workspaceLock=e.workspace.WorkspaceLock,this.serviceRegistry=e.ServiceRegistry;let n=!1;e.lsp.LanguageServer.onInitialize(r=>{var i,s;n=!!(!((s=(i=r.capabilities.workspace)===null||i===void 0?void 0:i.didChangeWatchedFiles)===null||s===void 0)&&s.dynamicRegistration)}),e.lsp.
1122
+ LanguageServer.onInitialized(r=>{n&&this.registerFileWatcher(e)})}registerFileWatcher(e){const n=Xe(e.ServiceRegistry.all).flatMap(r=>r.LanguageMetaData.fileExtensions).map(r=>r.startsWith(".")?r.substring(1):r).distinct().toArray();if(n.length>0){const r=e.lsp.Connection,i={watchers:[{globPattern:n.length===1?`**/*.${n[0]}`:`**/*.{${n.join(",")}}`}]};r?.client.register(ge.DidChangeWatchedFilesNotification.type,i)}}fireDocumentUpdate(e,n){e=e.filter(r=>this.serviceRegistry.hasServices(r)),this.workspaceManager.
1123
+ ready.then(()=>{this.workspaceLock.write(r=>this.documentBuilder.update(e,n,r))}).catch(r=>{console.error("Workspace initialization failed. Could not perform document update.",r)})}didChangeContent(e){this.fireDocumentUpdate([yt.parse(e.document.uri)],[])}didChangeWatchedFiles(e){const n=Xe(e.changes).filter(i=>i.type!==ge.FileChangeType.Deleted).distinct(i=>i.uri).map(i=>yt.parse(i.uri)).toArray(),r=Xe(e.changes).filter(i=>i.type===ge.FileChangeType.Deleted).distinct(i=>i.uri).map(i=>yt.parse(i.
1124
+ uri)).toArray();this.fireDocumentUpdate(n,r)}}class lG{constructor(e){this.commentNames=e.parser.GrammarConfig.multilineCommentRules}getFoldingRanges(e,n,r){const i=[],s=o=>i.push(o);return this.collectFolding(e,s),i}collectFolding(e,n){var r;const i=(r=e.parseResult)===null||r===void 0?void 0:r.value;if(i){if(this.shouldProcessContent(i)){const s=Br(i).iterator();let o;do if(o=s.next(),!o.done){const a=o.value;this.shouldProcess(a)&&this.collectObjectFolding(e,a,n),this.shouldProcessContent(a)||
1125
+ s.prune()}while(!o.done)}this.collectCommentFolding(e,i,n)}}shouldProcess(e){return!0}shouldProcessContent(e){return!0}collectObjectFolding(e,n,r){const i=n.$cstNode;if(i){const s=this.toFoldingRange(e,i);s&&r(s)}}collectCommentFolding(e,n,r){const i=n.$cstNode;if(i){for(const s of $1(i))if(this.commentNames.includes(s.tokenType.name)){const o=this.toFoldingRange(e,s,ge.FoldingRangeKind.Comment);o&&r(o)}}}toFoldingRange(e,n,r){const i=n.range,s=i.start;let o=i.end;if(!(o.line-s.line<2))return this.
1126
+ includeLastFoldingLine(n,r)||(o=e.textDocument.positionAt(e.textDocument.offsetAt({line:o.line,character:0})-1)),ge.FoldingRange.create(s.line,o.line,s.character,o.character,r)}includeLastFoldingLine(e,n){if(n===ge.FoldingRangeKind.Comment)return!1;const r=e.text,i=r.charAt(r.length-1);return!(i==="}"||i===")"||i==="]")}}class dG{match(e,n){if(e.length===0)return!0;let r=!1,i,s=0;const o=n.length;for(let a=0;a<o;a++){const u=n.charCodeAt(a),c=e.charCodeAt(s);if((u===c||this.toUpperCharCode(u)===
1127
+ this.toUpperCharCode(c))&&(r||(r=i===void 0||this.isWordTransition(i,u)),r&&s++,s===e.length))return!0;i=u}return!1}isWordTransition(e,n){return mT<=e&&e<=gT&&fG<=n&&n<=pG||e===yT&&n!==yT}toUpperCharCode(e){return mT<=e&&e<=gT?e-32:e}}const mT=97,gT=122,fG=65,pG=90,yT=95;class vT{constructor(e){this.references=e.references.References,this.grammarConfig=e.parser.GrammarConfig}getHoverContent(e,n){var r,i;const s=(i=(r=e.parseResult)===null||r===void 0?void 0:r.value)===null||i===void 0?void 0:i.$cstNode;
1128
+ if(s){const o=e.textDocument.offsetAt(n.position),a=Rs(s,o,this.grammarConfig.nameRegexp);if(a&&a.offset+a.length>o){const u=this.references.findDeclaration(a);if(u)return this.getAstNodeHoverContent(u)}}}}class hG extends vT{constructor(e){super(e),this.documentationProvider=e.documentation.DocumentationProvider}getAstNodeHoverContent(e){const n=this.documentationProvider.getDocumentation(e);if(n)return{contents:{kind:"markdown",value:n}}}}var fp=Lt();const mG={[ge.SemanticTokenTypes.class]:0,[ge.
1129
+ SemanticTokenTypes.comment]:1,[ge.SemanticTokenTypes.enum]:2,[ge.SemanticTokenTypes.enumMember]:3,[ge.SemanticTokenTypes.event]:4,[ge.SemanticTokenTypes.function]:5,[ge.SemanticTokenTypes.interface]:6,[ge.SemanticTokenTypes.keyword]:7,[ge.SemanticTokenTypes.macro]:8,[ge.SemanticTokenTypes.method]:9,[ge.SemanticTokenTypes.modifier]:10,[ge.SemanticTokenTypes.namespace]:11,[ge.SemanticTokenTypes.number]:12,[ge.SemanticTokenTypes.operator]:13,[ge.SemanticTokenTypes.parameter]:14,[ge.SemanticTokenTypes.
1130
+ property]:15,[ge.SemanticTokenTypes.regexp]:16,[ge.SemanticTokenTypes.string]:17,[ge.SemanticTokenTypes.struct]:18,[ge.SemanticTokenTypes.type]:19,[ge.SemanticTokenTypes.typeParameter]:20,[ge.SemanticTokenTypes.variable]:21,[ge.SemanticTokenTypes.decorator]:22},gG={[ge.SemanticTokenModifiers.abstract]:1,[ge.SemanticTokenModifiers.async]:2,[ge.SemanticTokenModifiers.declaration]:4,[ge.SemanticTokenModifiers.defaultLibrary]:8,[ge.SemanticTokenModifiers.definition]:16,[ge.SemanticTokenModifiers.deprecated]:32,
1131
+ [ge.SemanticTokenModifiers.documentation]:64,[ge.SemanticTokenModifiers.modification]:128,[ge.SemanticTokenModifiers.readonly]:256,[ge.SemanticTokenModifiers.static]:512};function yG(t){const e=[],n=[];let r=!0,i=!0,s=!0;for(const o of t)o&&(o.legend.tokenTypes.forEach((a,u)=>{const c=e[u];if(c&&c!==a)throw new Error(`Cannot merge '${c}' and '${a}' token types. They use the same index ${u}.`);e[u]=a}),o.legend.tokenModifiers.forEach((a,u)=>{const c=n[u];if(c&&c!==a)throw new Error(`Cannot merge \
1132
+ '${c}' and '${a}' token modifier. They use the same index ${u}.`);n[u]=a}),o.full?typeof o.full=="object"&&!o.full.delta&&(i=!1):r=!1,o.range||(s=!1));return{legend:{tokenTypes:e,tokenModifiers:n},full:r&&{delta:i},range:s}}class vG extends ge.SemanticTokensBuilder{constructor(){super(...arguments),this._tokens=[]}push(e,n,r,i,s){this._tokens.push({line:e,char:n,length:r,tokenType:i,tokenModifiers:s})}build(){return this.applyTokens(),super.build()}buildEdits(){return this.applyTokens(),super.buildEdits()}flush(){
1133
+ this.previousResult(this.id)}applyTokens(){for(const e of this._tokens.sort(this.compareTokens))super.push(e.line,e.char,e.length,e.tokenType,e.tokenModifiers);this._tokens=[]}compareTokens(e,n){return e.line===n.line?e.char-n.char:e.line-n.line}}class wG{constructor(e){this.tokensBuilders=new Map,e.shared.workspace.TextDocuments.onDidClose(n=>{this.tokensBuilders.delete(n.document.uri)}),e.shared.lsp.LanguageServer.onInitialize(n=>{var r;this.initialize((r=n.capabilities.textDocument)===null||r===
1134
+ void 0?void 0:r.semanticTokens)})}initialize(e){this.clientCapabilities=e}get tokenTypes(){return mG}get tokenModifiers(){return gG}get semanticTokensOptions(){return{legend:{tokenTypes:Object.keys(this.tokenTypes),tokenModifiers:Object.keys(this.tokenModifiers)},full:{delta:!0},range:!0}}async semanticHighlight(e,n,r=pt.CancellationToken.None){return this.currentRange=void 0,this.currentDocument=e,this.currentTokensBuilder=this.getDocumentTokensBuilder(e),this.currentTokensBuilder.flush(),await this.
1135
+ computeHighlighting(e,this.createAcceptor(),r),this.currentTokensBuilder.build()}async semanticHighlightRange(e,n,r=pt.CancellationToken.None){return this.currentRange=n.range,this.currentDocument=e,this.currentTokensBuilder=this.getDocumentTokensBuilder(e),this.currentTokensBuilder.flush(),await this.computeHighlighting(e,this.createAcceptor(),r),this.currentTokensBuilder.build()}async semanticHighlightDelta(e,n,r=pt.CancellationToken.None){return this.currentRange=void 0,this.currentDocument=e,
1136
+ this.currentTokensBuilder=this.getDocumentTokensBuilder(e),this.currentTokensBuilder.previousResult(n.previousResultId),await this.computeHighlighting(e,this.createAcceptor(),r),this.currentTokensBuilder.buildEdits()}createAcceptor(){return n=>{"line"in n?this.highlightToken({range:{start:{line:n.line,character:n.char},end:{line:n.line,character:n.char+n.length}},type:n.type,modifier:n.modifier}):"range"in n?this.highlightToken(n):"keyword"in n?this.highlightKeyword(n):"property"in n?this.highlightProperty(
1137
+ n):this.highlightNode({node:n.cst,type:n.type,modifier:n.modifier})}}getDocumentTokensBuilder(e){const n=this.tokensBuilders.get(e.uri.toString());if(n)return n;const r=new vG;return this.tokensBuilders.set(e.uri.toString(),r),r}async computeHighlighting(e,n,r){const i=e.parseResult.value,s=ni(i,{range:this.currentRange}).iterator();let o;do if(o=s.next(),!o.done){await jt(r);const a=o.value;this.highlightElement(a,n)==="prune"&&s.prune()}while(!o.done)}highlightToken(e){var n;const{range:r,type:i}=e;
1138
+ let s=e.modifier;if(this.currentRange&&!Ub(r,this.currentRange)||!this.currentDocument||!this.currentTokensBuilder)return;const o=this.tokenTypes[i];let a=0;if(s!==void 0){typeof s=="string"&&(s=[s]);for(const l of s){const f=this.tokenModifiers[l];a|=f}}const u=r.start.line,c=r.end.line;if(u===c){const l=r.start.character,f=r.end.character-l;this.currentTokensBuilder.push(u,l,f,o,a)}else if(!((n=this.clientCapabilities)===null||n===void 0)&&n.multilineTokenSupport){const l=r.start.character,f=this.
1139
+ currentDocument.textDocument.offsetAt(r.start),d=this.currentDocument.textDocument.offsetAt(r.end);this.currentTokensBuilder.push(u,l,d-f,o,a)}else{const l=r.start;let f=this.currentDocument.textDocument.offsetAt({line:u+1,character:0});this.currentTokensBuilder.push(l.line,l.character,f-l.character-1,o,a);for(let d=u+1;d<c;d++){const p=f;f=this.currentDocument.textDocument.offsetAt({line:d+1,character:0}),this.currentTokensBuilder.push(d,0,f-p-1,o,a)}this.currentTokensBuilder.push(c,0,r.end.character,
1140
+ o,a)}}highlightProperty(e){const n=[];if(typeof e.index=="number"){const s=pn(e.node.$cstNode,e.property,e.index);s&&n.push(s)}else n.push(...Io(e.node.$cstNode,e.property));const{type:r,modifier:i}=e;for(const s of n)this.highlightNode({node:s,type:r,modifier:i})}highlightKeyword(e){const{node:n,keyword:r,type:i,index:s,modifier:o}=e,a=[];if(typeof s=="number"){const u=Du(n.$cstNode,r,s);u&&a.push(u)}else a.push(...Fm(n.$cstNode,r));for(const u of a)this.highlightNode({node:u,type:i,modifier:o})}highlightNode(e){
1141
+ const{node:n,type:r,modifier:i}=e,s=n.range;this.highlightToken({range:s,type:r,modifier:i})}}var wT;(function(t){function e(r,i,s){const o=new Map;Object.entries(i).forEach(([c,l])=>o.set(l,c));let a=0,u=0;return n(r.data,5).map(c=>{a+=c[0],c[0]!==0&&(u=0),u+=c[1];const l=c[2];return{offset:s.textDocument.offsetAt({line:a,character:u}),tokenType:o.get(c[3]),tokenModifiers:c[4],text:s.textDocument.getText({start:{line:a,character:u},end:{line:a,character:u+l}})}})}t.decode=e;function n(r,i){const s=[];
1142
+ for(let o=0;o<r.length;o+=i){const a=r.slice(o,o+i);s.push(a)}return s}})(wT||(wT={}));function bG(t){const e=[],n=[];t.forEach(i=>{i?.triggerCharacters&&e.push(...i.triggerCharacters),i?.retriggerCharacters&&n.push(...i.retriggerCharacters)});const r={triggerCharacters:e.length>0?Array.from(new Set(e)).sort():void 0,retriggerCharacters:n.length>0?Array.from(new Set(n)).sort():void 0};return r.triggerCharacters?r:void 0}class EG{constructor(e){this.onInitializeEmitter=new fp.Emitter,this.onInitializedEmitter=
1143
+ new fp.Emitter,this.services=e}get onInitialize(){return this.onInitializeEmitter.event}get onInitialized(){return this.onInitializedEmitter.event}async initialize(e){return this.eagerLoadServices(),this.fireInitializeOnDefaultServices(e),this.onInitializeEmitter.fire(e),this.onInitializeEmitter.dispose(),this.buildInitializeResult(e)}eagerLoadServices(){py(this.services),this.services.ServiceRegistry.all.forEach(e=>py(e))}hasService(e){return this.services.ServiceRegistry.all.some(r=>e(r)!==void 0)}buildInitializeResult(e){
1144
+ var n,r,i,s;const o=this.services.lsp.DocumentUpdateHandler,a=(n=this.services.lsp.FileOperationHandler)===null||n===void 0?void 0:n.fileOperationOptions,u=this.services.ServiceRegistry.all,c=this.hasService(z=>{var C;return(C=z.lsp)===null||C===void 0?void 0:C.Formatter}),l=u.map(z=>{var C,ne;return(ne=(C=z.lsp)===null||C===void 0?void 0:C.Formatter)===null||ne===void 0?void 0:ne.formatOnTypeOptions}).find(z=>!!z),f=this.hasService(z=>{var C;return(C=z.lsp)===null||C===void 0?void 0:C.CodeActionProvider}),
1145
+ d=this.hasService(z=>{var C;return(C=z.lsp)===null||C===void 0?void 0:C.SemanticTokenProvider}),p=yG(u.map(z=>{var C,ne;return(ne=(C=z.lsp)===null||C===void 0?void 0:C.SemanticTokenProvider)===null||ne===void 0?void 0:ne.semanticTokensOptions})),m=(i=(r=this.services.lsp)===null||r===void 0?void 0:r.ExecuteCommandHandler)===null||i===void 0?void 0:i.commands,v=this.hasService(z=>{var C;return(C=z.lsp)===null||C===void 0?void 0:C.DocumentLinkProvider}),w=bG(u.map(z=>{var C,ne;return(ne=(C=z.lsp)===
1146
+ null||C===void 0?void 0:C.SignatureHelp)===null||ne===void 0?void 0:ne.signatureHelpOptions})),y=this.hasService(z=>{var C;return(C=z.lsp)===null||C===void 0?void 0:C.TypeProvider}),E=this.hasService(z=>{var C;return(C=z.lsp)===null||C===void 0?void 0:C.ImplementationProvider}),R=this.hasService(z=>{var C;return(C=z.lsp)===null||C===void 0?void 0:C.CompletionProvider}),A=oG(u.map(z=>{var C,ne;return(ne=(C=z.lsp)===null||C===void 0?void 0:C.CompletionProvider)===null||ne===void 0?void 0:ne.completionOptions})),
1147
+ N=this.hasService(z=>{var C;return(C=z.lsp)===null||C===void 0?void 0:C.ReferencesProvider}),V=this.hasService(z=>{var C;return(C=z.lsp)===null||C===void 0?void 0:C.DocumentSymbolProvider}),J=this.hasService(z=>{var C;return(C=z.lsp)===null||C===void 0?void 0:C.DefinitionProvider}),se=this.hasService(z=>{var C;return(C=z.lsp)===null||C===void 0?void 0:C.DocumentHighlightProvider}),ie=this.hasService(z=>{var C;return(C=z.lsp)===null||C===void 0?void 0:C.FoldingRangeProvider}),we=this.hasService(z=>{
1148
+ var C;return(C=z.lsp)===null||C===void 0?void 0:C.HoverProvider}),B=this.hasService(z=>{var C;return(C=z.lsp)===null||C===void 0?void 0:C.RenameProvider}),T=this.hasService(z=>{var C;return(C=z.lsp)===null||C===void 0?void 0:C.CallHierarchyProvider}),D=this.hasService(z=>{var C;return(C=z.lsp)===null||C===void 0?void 0:C.TypeHierarchyProvider}),M=this.hasService(z=>{var C;return(C=z.lsp)===null||C===void 0?void 0:C.CodeLensProvider}),S=this.hasService(z=>{var C;return(C=z.lsp)===null||C===void 0?
1149
+ void 0:C.DeclarationProvider}),P=this.hasService(z=>{var C;return(C=z.lsp)===null||C===void 0?void 0:C.InlayHintProvider}),O=(s=this.services.lsp)===null||s===void 0?void 0:s.WorkspaceSymbolProvider;return{capabilities:{workspace:{workspaceFolders:{supported:!0},fileOperations:a},executeCommandProvider:m&&{commands:m},textDocumentSync:{change:fp.TextDocumentSyncKind.Incremental,openClose:!0,save:!!o.didSaveDocument,willSave:!!o.willSaveDocument,willSaveWaitUntil:!!o.willSaveDocumentWaitUntil},completionProvider:R?
1150
+ A:void 0,referencesProvider:N,documentSymbolProvider:V,definitionProvider:J,typeDefinitionProvider:y,documentHighlightProvider:se,codeActionProvider:f,documentFormattingProvider:c,documentRangeFormattingProvider:c,documentOnTypeFormattingProvider:l,foldingRangeProvider:ie,hoverProvider:we,renameProvider:B?{prepareProvider:!0}:void 0,semanticTokensProvider:d?p:void 0,signatureHelpProvider:w,implementationProvider:E,callHierarchyProvider:T?{}:void 0,typeHierarchyProvider:D?{}:void 0,documentLinkProvider:v?
1151
+ {resolveProvider:!1}:void 0,codeLensProvider:M?{resolveProvider:!1}:void 0,declarationProvider:S,inlayHintProvider:P?{resolveProvider:!1}:void 0,workspaceSymbolProvider:O?{resolveProvider:!!O.resolveSymbol}:void 0}}}initialized(e){this.fireInitializedOnDefaultServices(e),this.onInitializedEmitter.fire(e),this.onInitializedEmitter.dispose()}fireInitializeOnDefaultServices(e){this.services.workspace.ConfigurationProvider.initialize(e),this.services.workspace.WorkspaceManager.initialize(e)}fireInitializedOnDefaultServices(e){
1152
+ const n=this.services.lsp.Connection,r=n?Object.assign(Object.assign({},e),{register:i=>n.client.register(fp.DidChangeConfigurationNotification.type,i),fetchConfiguration:i=>n.workspace.getConfiguration(i)}):e;this.services.workspace.ConfigurationProvider.initialized(r).catch(i=>console.error("Error in ConfigurationProvider initialization:",i)),this.services.workspace.WorkspaceManager.initialized(e).catch(i=>console.error("Error in WorkspaceManager initialization:",i))}}class $G{getSymbolKind(e){
1153
+ return ge.SymbolKind.Field}getCompletionItemKind(e){return ge.CompletionItemKind.Reference}}class DG{constructor(e){this.nameProvider=e.references.NameProvider,this.references=e.references.References,this.grammarConfig=e.parser.GrammarConfig}findReferences(e,n,r){const i=e.parseResult.value.$cstNode;if(!i)return[];const s=Rs(i,e.textDocument.offsetAt(n.position),this.grammarConfig.nameRegexp);return s?this.getReferences(s,n,e):[]}getReferences(e,n,r){const i=[],s=this.references.findDeclaration(
1154
+ e);if(s){const o={includeDeclaration:n.context.includeDeclaration};this.references.findReferences(s,o).forEach(a=>{i.push(ge.Location.create(a.sourceUri.toString(),a.segment.range))})}return i}}class RG{constructor(e){this.references=e.references.References,this.nameProvider=e.references.NameProvider,this.grammarConfig=e.parser.GrammarConfig}async rename(e,n,r){const i={},s=e.parseResult.value.$cstNode;if(!s)return;const o=e.textDocument.offsetAt(n.position),a=Rs(s,o,this.grammarConfig.nameRegexp);
1155
+ if(!a)return;const u=this.references.findDeclaration(a);if(!u)return;const c={onlyLocal:!1,includeDeclaration:!0};return this.references.findReferences(u,c).forEach(f=>{const d=Bn.replace(f.segment.range,n.newName),p=f.sourceUri.toString();i[p]?i[p].push(d):i[p]=[d]}),{changes:i}}prepareRename(e,n,r){return this.renameNodeRange(e,n.position)}renameNodeRange(e,n){const r=e.parseResult.value.$cstNode,i=e.textDocument.offsetAt(n);if(r&&i){const s=Rs(r,i,this.grammarConfig.nameRegexp);if(!s)return;if(this.
1156
+ references.findDeclaration(s)||this.isNameNode(s))return s.range}}isNameNode(e){return e?.astNode&&tp(e.astNode)&&e===this.nameProvider.getNameNode(e.astNode)}}class bT{constructor(e){this.indexManager=e.workspace.IndexManager,this.nodeKindProvider=e.lsp.NodeKindProvider,this.fuzzyMatcher=e.lsp.FuzzyMatcher}async getSymbols(e,n=pt.CancellationToken.None){const r=[],i=e.query.toLowerCase();for(const s of this.indexManager.allElements())if(await jt(n),this.fuzzyMatcher.match(i,s.name)){const o=this.
1157
+ getWorkspaceSymbol(s);o&&r.push(o)}return r}getWorkspaceSymbol(e){const n=e.nameSegment;if(n)return{kind:this.nodeKindProvider.getSymbolKind(e),name:e.name,location:{range:n.range,uri:e.documentUri.toString()}}}}class ET{constructor(e){this._configuration=e,this._syncedDocuments=new Map,this._onDidChangeContent=new ge.Emitter,this._onDidOpen=new ge.Emitter,this._onDidClose=new ge.Emitter,this._onDidSave=new ge.Emitter,this._onWillSave=new ge.Emitter}get onDidOpen(){return this._onDidOpen.event}get onDidChangeContent(){
1158
+ return this._onDidChangeContent.event}get onWillSave(){return this._onWillSave.event}onWillSaveWaitUntil(e){this._willSaveWaitUntil=e}get onDidSave(){return this._onDidSave.event}get onDidClose(){return this._onDidClose.event}get(e){return this._syncedDocuments.get(ht.normalize(e))}set(e){const n=ht.normalize(e.uri);let r=!0;this._syncedDocuments.has(n)&&(r=!1),this._syncedDocuments.set(n,e);const i=Object.freeze({document:e});return this._onDidOpen.fire(i),this._onDidChangeContent.fire(i),r}delete(e){
1159
+ const n=ht.normalize(typeof e=="object"&&"uri"in e?e.uri:e),r=this._syncedDocuments.get(n);r!==void 0&&(this._syncedDocuments.delete(n),this._onDidClose.fire(Object.freeze({document:r})))}all(){return Array.from(this._syncedDocuments.values())}keys(){return Array.from(this._syncedDocuments.keys())}listen(e){e.__textDocumentSync=ge.TextDocumentSyncKind.Incremental;const n=[];return n.push(e.onDidOpenTextDocument(r=>{const i=r.textDocument,s=ht.normalize(i.uri),o=this._configuration.create(s,i.languageId,
1160
+ i.version,i.text);this._syncedDocuments.set(s,o);const a=Object.freeze({document:o});this._onDidOpen.fire(a),this._onDidChangeContent.fire(a)})),n.push(e.onDidChangeTextDocument(r=>{const i=r.textDocument,s=r.contentChanges;if(s.length===0)return;const{version:o}=i;if(o==null)throw new Error(`Received document change event for ${i.uri} without valid version identifier`);const a=ht.normalize(i.uri);let u=this._syncedDocuments.get(a);u!==void 0&&(u=this._configuration.update(u,s,o),this._syncedDocuments.
1161
+ set(a,u),this._onDidChangeContent.fire(Object.freeze({document:u})))})),n.push(e.onDidCloseTextDocument(r=>{const i=ht.normalize(r.textDocument.uri),s=this._syncedDocuments.get(i);s!==void 0&&(this._syncedDocuments.delete(i),this._onDidClose.fire(Object.freeze({document:s})))})),n.push(e.onWillSaveTextDocument(r=>{const i=this._syncedDocuments.get(ht.normalize(r.textDocument.uri));i!==void 0&&this._onWillSave.fire(Object.freeze({document:i,reason:r.reason}))})),n.push(e.onWillSaveTextDocumentWaitUntil(
1162
+ (r,i)=>{const s=this._syncedDocuments.get(ht.normalize(r.textDocument.uri));return s!==void 0&&this._willSaveWaitUntil?this._willSaveWaitUntil(Object.freeze({document:s,reason:r.reason}),i):[]})),n.push(e.onDidSaveTextDocument(r=>{const i=this._syncedDocuments.get(ht.normalize(r.textDocument.uri));i!==void 0&&this._onDidSave.fire(Object.freeze({document:i}))})),ge.Disposable.create(()=>{n.forEach(r=>r.dispose())})}}class kG{constructor(e){this.notebookDocuments=new Map,this.notebookCellMap=new Map,
1163
+ this._onDidOpen=new ge.Emitter,this._onDidSave=new ge.Emitter,this._onDidChange=new ge.Emitter,this._onDidClose=new ge.Emitter,"listen"in e?this._cellTextDocuments=e:this._cellTextDocuments=new ET(e)}get cellTextDocuments(){return this._cellTextDocuments}getCellTextDocument(e){return this._cellTextDocuments.get(e.document)}getNotebookDocument(e){return this.notebookDocuments.get(ht.normalize(e))}getNotebookCell(e){const n=this.notebookCellMap.get(ht.normalize(e));return n&&n[0]}findNotebookDocumentForCell(e){
1164
+ const n=typeof e=="string"||"scheme"in e?e:e.document,r=this.notebookCellMap.get(ht.normalize(n));return r&&r[1]}get onDidOpen(){return this._onDidOpen.event}get onDidSave(){return this._onDidSave.event}get onDidChange(){return this._onDidChange.event}get onDidClose(){return this._onDidClose.event}listen(e){const n=new Oa,r=[];return r.push(this.cellTextDocuments.listen(n)),r.push(e.notebooks.synchronization.onDidOpenNotebookDocument(i=>{const s=ht.normalize(i.notebookDocument.uri);this.notebookDocuments.
1165
+ set(s,i.notebookDocument);for(const o of i.cellTextDocuments)n.openTextDocument({textDocument:o});this.updateCellMap(i.notebookDocument),this._onDidOpen.fire(i.notebookDocument)})),r.push(e.notebooks.synchronization.onDidChangeNotebookDocument(i=>{const s=ht.normalize(i.notebookDocument.uri),o=this.notebookDocuments.get(s);if(o===void 0)return;o.version=i.notebookDocument.version;const a=o.metadata;let u=!1;const c=i.change;c.metadata!==void 0&&(u=!0,o.metadata=c.metadata);const l=[],f=[],d=[],p=[];
1166
+ if(c.cells!==void 0){const E=c.cells;if(E.structure!==void 0){const R=E.structure.array;if(o.cells.splice(R.start,R.deleteCount,...R.cells!==void 0?R.cells:[]),E.structure.didOpen!==void 0)for(const A of E.structure.didOpen)n.openTextDocument({textDocument:A}),l.push(A.uri);if(E.structure.didClose)for(const A of E.structure.didClose)n.closeTextDocument({textDocument:A}),f.push(A.uri)}if(E.data!==void 0){const R=new Map(E.data.map(A=>[A.document,A]));for(let A=0;A<=o.cells.length;A++){const N=R.get(
1167
+ o.cells[A].document);if(N!==void 0){const V=o.cells.splice(A,1,N);if(d.push({old:V[0],new:N}),R.delete(N.document),R.size===0)break}}}if(E.textContent!==void 0)for(const R of E.textContent)n.changeTextDocument({textDocument:R.document,contentChanges:R.changes}),p.push(R.document.uri)}this.updateCellMap(o);const m={notebookDocument:o};u&&(m.metadata={old:a,new:o.metadata});const v=[];for(const E of l)v.push(this.getNotebookCell(E));const w=[];for(const E of f)w.push(this.getNotebookCell(E));const y=[];
1168
+ for(const E of p)y.push(this.getNotebookCell(E));(v.length>0||w.length>0||d.length>0||y.length>0)&&(m.cells={added:v,removed:w,changed:{data:d,textContent:y}}),(m.metadata!==void 0||m.cells!==void 0)&&this._onDidChange.fire(m)})),r.push(e.notebooks.synchronization.onDidSaveNotebookDocument(i=>{const s=this.getNotebookDocument(i.notebookDocument.uri);s!==void 0&&this._onDidSave.fire(s)})),r.push(e.notebooks.synchronization.onDidCloseNotebookDocument(i=>{const s=ht.normalize(i.notebookDocument.uri),
1169
+ o=this.notebookDocuments.get(s);if(o!==void 0){this._onDidClose.fire(o);for(const a of i.cellTextDocuments)n.closeTextDocument({textDocument:a});this.notebookDocuments.delete(s);for(const a of o.cells)this.notebookCellMap.delete(a.document)}})),ge.Disposable.create(()=>{r.forEach(i=>i.dispose())})}updateCellMap(e){for(const n of e.cells)this.notebookCellMap.set(n.document,[n,e])}}class Oa{onDidOpenTextDocument(e){return this.openHandler=e,ge.Disposable.create(()=>{this.openHandler=void 0})}openTextDocument(e){
1170
+ this.openHandler&&this.openHandler(e)}onDidChangeTextDocument(e){return this.changeHandler=e,ge.Disposable.create(()=>{this.changeHandler=e})}changeTextDocument(e){this.changeHandler&&this.changeHandler(e)}onDidCloseTextDocument(e){return this.closeHandler=e,ge.Disposable.create(()=>{this.closeHandler=void 0})}closeTextDocument(e){this.closeHandler&&this.closeHandler(e)}onWillSaveTextDocument(){return Oa.NULL_DISPOSE}onWillSaveTextDocumentWaitUntil(){return Oa.NULL_DISPOSE}onDidSaveTextDocument(){
1171
+ return Oa.NULL_DISPOSE}}Oa.NULL_DISPOSE=Object.freeze({dispose:()=>{}});function TG(t){return ip.merge(DR(t),CG(t))}function CG(t){return{lsp:{CompletionProvider:e=>new pT(e),DocumentSymbolProvider:e=>new uG(e),HoverProvider:e=>new hG(e),FoldingRangeProvider:e=>new lG(e),ReferencesProvider:e=>new DG(e),DefinitionProvider:e=>new aG(e),DocumentHighlightProvider:e=>new hT(e),RenameProvider:e=>new RG(e)},shared:()=>t.shared}}function AG(t){return ip.merge(RR(t),SG(t))}function SG(t){return{lsp:{Connection:()=>t.
1172
+ connection,LanguageServer:e=>new EG(e),DocumentUpdateHandler:e=>new cG(e),WorkspaceSymbolProvider:e=>new bT(e),NodeKindProvider:()=>new $G,FuzzyMatcher:()=>new dG},workspace:{TextDocuments:()=>new ET(ep),NotebookDocuments:e=>new kG(e.workspace.TextDocuments)}}}class _G{constructor(){this.collector=()=>{}}getNodeFormatter(e){return new PG(e,this.collector)}formatDocument(e,n){const r=e.parseResult;return r.lexerErrors.length===0&&r.parserErrors.length===0?this.doDocumentFormat(e,n.options):[]}isFormatRangeErrorFree(e,n){
1173
+ const r=e.parseResult;return r.lexerErrors.length||r.parserErrors.length?Math.min(...r.lexerErrors.map(s=>{var o;return(o=s.line)!==null&&o!==void 0?o:Number.MAX_VALUE}),...r.parserErrors.map(s=>{var o;return(o=s.token.startLine)!==null&&o!==void 0?o:Number.MAX_VALUE}))>n.end.line:!0}formatDocumentRange(e,n){return this.isFormatRangeErrorFree(e,n.range)?this.doDocumentFormat(e,n.options,n.range):[]}formatDocumentOnType(e,n){const r={start:{character:0,line:n.position.line},end:n.position};return this.
1174
+ isFormatRangeErrorFree(e,r)?this.doDocumentFormat(e,n.options,r):[]}get formatOnTypeOptions(){}doDocumentFormat(e,n,r){const i=new Map,s=(a,u,c)=>{var l,f;const d=this.nodeModeToKey(a,u),p=i.get(d),m=(l=c.options.priority)!==null&&l!==void 0?l:0,v=(f=p?.options.priority)!==null&&f!==void 0?f:0;(!p||v<=m)&&i.set(d,c)};this.collector=s,this.iterateAstFormatting(e,r);const o=this.iterateCstFormatting(e,i,n,r);return this.avoidOverlappingEdits(e.textDocument,o)}avoidOverlappingEdits(e,n){const r=[];
1175
+ for(const i of n){let s=r[r.length-1];for(;s;){const o=e.offsetAt(i.range.start),a=e.offsetAt(s.range.end);if(o<a)r.pop(),s=r[r.length-1];else break}r.push(i)}return r.filter(i=>this.isNecessary(i,e))}iterateAstFormatting(e,n){const r=e.parseResult.value;this.format(r);const i=Br(r).iterator();let s;do if(s=i.next(),!s.done){const o=s.value;this.insideRange(o.$cstNode.range,n)?this.format(o):i.prune()}while(!s.done)}nodeModeToKey(e,n){return`${e.offset}:${e.end}:${n}`}insideRange(e,n){return!n||
1176
+ e.start.line<=n.start.line&&e.end.line>=n.end.line||e.start.line>=n.start.line&&e.end.line<=n.end.line||e.start.line<=n.end.line&&e.end.line>=n.end.line}isNecessary(e,n){return e.newText!==n.getText(e.range).replace(/\r/g,"")}iterateCstFormatting(e,n,r,i){const s={indentation:0,options:r,document:e.textDocument},o=[],u=this.iterateCstTree(e,s).iterator();let c,l;do if(l=u.next(),!l.done){const f=l.value,d=Ds(f),p=this.nodeModeToKey(f,"prepend"),m=n.get(p);if(n.delete(p),m){const y=this.createTextEdit(
1177
+ c,f,m,s);for(const E of y)E&&this.insideRange(E.range,i)&&o.push(E)}const v=this.nodeModeToKey(f,"append"),w=n.get(v);if(n.delete(v),w){const y=T1(f);if(y){const E=this.createTextEdit(f,y,w,s);for(const R of E)R&&this.insideRange(R.range,i)&&o.push(R)}}if(!m&&f.hidden){const y=this.createHiddenTextEdits(c,f,void 0,s);for(const E of y)E&&this.insideRange(E.range,i)&&o.push(E)}d&&(c=f)}while(!l.done);return o}createHiddenTextEdits(e,n,r,i){var s;const o=n.range.start.line;if(e&&e.range.end.line===
1178
+ o)return[];const a=[],u={start:{character:0,line:o},end:n.range.start},c=i.document.getText(u),l=this.findFittingMove(u,(s=r?.moves)!==null&&s!==void 0?s:[],i),f=this.getExistingIndentationCharacterCount(c,i),p=this.getIndentationCharacterCount(i,l)-f;if(p===0)return[];let m="";p>0&&(m=(i.options.insertSpaces?" ":" ").repeat(p));const v=n.text.split(`
1179
+ `);v[0]=c+v[0];for(let w=0;w<v.length;w++){const y=o+w,E={character:0,line:y};if(p>0)a.push({newText:m,range:{start:E,end:E}});else{const R=v[w];let A=0;for(;A<R.length;A++){const N=R.charAt(A);if(N!==" "&&N!==" ")break}a.push({newText:"",range:{start:E,end:{line:y,character:Math.min(A,Math.abs(p))}}})}}return a}getExistingIndentationCharacterCount(e,n){const r=" ".repeat(n.options.tabSize);return(n.options.insertSpaces?e.replaceAll(" ",r):e.replaceAll(r," ")).length}getIndentationCharacterCount(e,n){
1180
+ let r=e.indentation;return n&&n.tabs&&(r+=n.tabs),(e.options.insertSpaces?e.options.tabSize:1)*r}createTextEdit(e,n,r,i){var s;if(n.hidden)return this.createHiddenTextEdits(e,n,r,i);if(e&&(e.range.end.line>n.range.start.line||e.range.end.line===n.range.start.line&&e.range.end.character>n.range.start.character))return[];const o={start:(s=e?.range.end)!==null&&s!==void 0?s:{character:0,line:0},end:n.range.start},a=this.findFittingMove(o,r.moves,i);if(!a)return[];const u=a.characters,c=a.lines,l=a.
1181
+ tabs,f=i.indentation;i.indentation+=l??0;const d=[];return u!==void 0?e?.hidden||d.push(this.createSpaceTextEdit(o,u,r.options)):c!==void 0?d.push(this.createLineTextEdit(o,c,i,r.options)):l!==void 0&&d.push(this.createTabTextEdit(o,!!e,i)),Ds(n)&&(i.indentation=f),d}createSpaceTextEdit(e,n,r){if(e.start.line===e.end.line){const s=e.end.character-e.start.character;n=this.fitIntoOptions(n,s,r)}return{newText:" ".repeat(n),range:e}}createLineTextEdit(e,n,r,i){const s=e.end.line-e.start.line;n=this.
1182
+ fitIntoOptions(n,s,i);const a=(r.options.insertSpaces?" ".repeat(r.options.tabSize):" ").repeat(r.indentation);return{newText:`${`
1183
+ `.repeat(n)}${a}`,range:e}}createTabTextEdit(e,n,r){const s=(r.options.insertSpaces?" ".repeat(r.options.tabSize):" ").repeat(r.indentation),o=n?1:0,a=Math.max(e.end.line-e.start.line,o);return{newText:`${`
1184
+ `.repeat(a)}${s}`,range:e}}fitIntoOptions(e,n,r){return r.allowMore?e=Math.max(n,e):r.allowLess&&(e=Math.min(n,e)),e}findFittingMove(e,n,r){if(n.length===0)return;if(n.length===1)return n[0];const i=e.end.line-e.start.line;for(const s of n){if(s.lines!==void 0&&i<=s.lines)return s;if(s.lines===void 0&&i===0)return s}return n[n.length-1]}iterateCstTree(e,n){const i=e.parseResult.value.$cstNode;return i?new _o(i,s=>this.iterateCst(s,n)):ja}iterateCst(e,n){if(!Gi(e))return ja;const r=n.indentation;
1185
+ return new en(()=>({index:0}),i=>i.index<e.content.length?{done:!1,value:e.content[i.index++]}:(n.indentation=r,Nn))}}class PG{constructor(e,n){this.astNode=e,this.collector=n}node(e){return new xr(e.$cstNode?[e.$cstNode]:[],this.collector)}nodes(...e){const n=[];for(const r of e)r.$cstNode&&n.push(r.$cstNode);return new xr(n,this.collector)}property(e,n){const r=pn(this.astNode.$cstNode,e,n);return new xr(r?[r]:[],this.collector)}properties(...e){const n=[];for(const r of e){const i=Io(this.astNode.
1186
+ $cstNode,r);n.push(...i)}return new xr(n,this.collector)}keyword(e,n){const r=Du(this.astNode.$cstNode,e,n);return new xr(r?[r]:[],this.collector)}keywords(...e){const n=[];for(const r of e){const i=Fm(this.astNode.$cstNode,r);n.push(...i)}return new xr(n,this.collector)}cst(e){return new xr([...e],this.collector)}interior(e,n){const r=e.nodes,i=n.nodes;if(r.length!==1||i.length!==1)return new xr([],this.collector);let s=r[0],o=i[0];if(s.offset>o.offset){const a=s;s=o,o=a}return new xr(C1(s,o),this.
1187
+ collector)}}class xr{constructor(e,n){this.nodes=e,this.collector=n}prepend(e){for(const n of this.nodes)this.collector(n,"prepend",e);return this}append(e){for(const n of this.nodes)this.collector(n,"append",e);return this}surround(e){for(const n of this.nodes)this.collector(n,"prepend",e),this.collector(n,"append",e);return this}slice(e,n){return new xr(this.nodes.slice(e,n),this.collector)}}var Ji;(function(t){function e(...l){return{options:{},moves:l.flatMap(f=>f.moves).sort(c)}}t.fit=e;function n(l){
1188
+ return i(0,l)}t.noSpace=n;function r(l){return i(1,l)}t.oneSpace=r;function i(l,f){return{options:f??{},moves:[{characters:l}]}}t.spaces=i;function s(l){return o(1,l)}t.newLine=s;function o(l,f){return{options:f??{},moves:[{lines:l}]}}t.newLines=o;function a(l){return{options:l??{},moves:[{tabs:1,lines:1}]}}t.indent=a;function u(l){return{options:l??{},moves:[{tabs:0}]}}t.noIndent=u;function c(l,f){var d,p,m,v,w,y;const E=(d=l.lines)!==null&&d!==void 0?d:0,R=(p=f.lines)!==null&&p!==void 0?p:0,A=(m=
1189
+ l.tabs)!==null&&m!==void 0?m:0,N=(v=f.tabs)!==null&&v!==void 0?v:0,V=(w=l.characters)!==null&&w!==void 0?w:0,J=(y=f.characters)!==null&&y!==void 0?y:0;return E<R?-1:E>R?1:A<N?-1:A>N?1:V<J?-1:V>J?1:0}})(Ji||(Ji={}));var Py,$T;function xG(){return $T||($T=1,Py=cT()),Py}xG();var to={},Cc={},Ac={},no={},kr={},Di={},DT;function RT(){if(DT)return Di;DT=1,Object.defineProperty(Di,"__esModule",{value:!0}),Di.normalizePath=Di.convertSlashes=Di.cleanPath=void 0;const t=qi;function e(s){let o=(0,t.normalize)(
1190
+ s);return o.length>1&&o[o.length-1]===t.sep&&(o=o.substring(0,o.length-1)),o}Di.cleanPath=e;const n=/[\\/]/g;function r(s,o){return s.replace(n,o)}Di.convertSlashes=r;function i(s,o){const{resolvePaths:a,normalizePath:u,pathSeparator:c}=o,l=process.platform==="win32"&&s.includes("/")||s.startsWith(".");if(a&&(s=(0,t.resolve)(s)),(u||l)&&(s=e(s)),s===".")return"";const f=s[s.length-1]!==c;return r(f?s+c:s,c)}return Di.normalizePath=i,Di}var Ri={},kT;function NG(){if(kT)return Ri;kT=1,Object.defineProperty(
1191
+ Ri,"__esModule",{value:!0}),Ri.build=Ri.joinDirectoryPath=Ri.joinPathWithBasePath=void 0;const t=qi,e=RT();function n(a,u){return u+a}Ri.joinPathWithBasePath=n;function r(a,u){return function(c,l){return l.startsWith(a)?l.replace(a,"")+c:(0,e.convertSlashes)((0,t.relative)(a,l),u.pathSeparator)+u.pathSeparator+c}}function i(a){return a}function s(a,u,c){return u+a+c}Ri.joinDirectoryPath=s;function o(a,u){const{relativePaths:c,includeBasePath:l}=u;return c&&a?r(a,u):l?n:i}return Ri.build=o,Ri}var Sc={},
1192
+ TT;function IG(){if(TT)return Sc;TT=1,Object.defineProperty(Sc,"__esModule",{value:!0}),Sc.build=void 0;function t(o){return function(a,u){u.push(a.substring(o.length)||".")}}function e(o){return function(a,u,c){const l=a.substring(o.length)||".";c.every(f=>f(l,!0))&&u.push(l)}}const n=(o,a)=>{a.push(o||".")},r=(o,a,u)=>{const c=o||".";u.every(l=>l(c,!0))&&a.push(c)},i=()=>{};function s(o,a){const{includeDirs:u,filters:c,relativePaths:l}=a;return u?l?c&&c.length?e(o):t(o):c&&c.length?r:n:i}return Sc.
1193
+ build=s,Sc}var _c={},CT;function OG(){if(CT)return _c;CT=1,Object.defineProperty(_c,"__esModule",{value:!0}),_c.build=void 0;const t=(o,a,u,c)=>{c.every(l=>l(o,!1))&&u.files++},e=(o,a,u,c)=>{c.every(l=>l(o,!1))&&a.push(o)},n=(o,a,u,c)=>{u.files++},r=(o,a)=>{a.push(o)},i=()=>{};function s(o){const{excludeFiles:a,filters:u,onlyCounts:c}=o;return a?i:u&&u.length?c?t:e:c?n:r}return _c.build=s,_c}var Pc={},AT;function FG(){if(AT)return Pc;AT=1,Object.defineProperty(Pc,"__esModule",{value:!0}),Pc.build=
1194
+ void 0;const t=r=>r,e=()=>[""].slice(0,0);function n(r){return r.group?e:t}return Pc.build=n,Pc}var xc={},ST;function LG(){if(ST)return xc;ST=1,Object.defineProperty(xc,"__esModule",{value:!0}),xc.build=void 0;const t=(r,i,s)=>{r.push({directory:i,files:s,dir:i})},e=()=>{};function n(r){return r.group?t:e}return xc.build=n,xc}var ro={},_T;function MG(){if(_T)return ro;_T=1;var t=ro&&ro.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(ro,"__esModule",{value:!0}),
1195
+ ro.build=void 0;const e=t(La),n=qi,r=function(u,c,l){const{queue:f,options:{suppressErrors:d}}=c;f.enqueue(),e.default.realpath(u,(p,m)=>{if(p)return f.dequeue(d?null:p,c);e.default.stat(m,(v,w)=>{if(v)return f.dequeue(d?null:v,c);if(w.isDirectory()&&o(u,m,c))return f.dequeue(null,c);l(w,m),f.dequeue(null,c)})})},i=function(u,c,l){const{queue:f,options:{suppressErrors:d}}=c;f.enqueue();try{const p=e.default.realpathSync(u),m=e.default.statSync(p);if(m.isDirectory()&&o(u,p,c))return;l(m,p)}catch(p){
1196
+ if(!d)throw p}};function s(u,c){return!u.resolveSymlinks||u.excludeSymlinks?null:c?i:r}ro.build=s;function o(u,c,l){if(l.options.useRealPaths)return a(c,l);let f=(0,n.dirname)(u),d=1;for(;f!==l.root&&d<2;){const p=l.symlinks.get(f);!!p&&(p===c||p.startsWith(c)||c.startsWith(p))?d++:f=(0,n.dirname)(f)}return l.symlinks.set(u,c),d>1}function a(u,c){return c.visited.includes(u+c.options.pathSeparator)}return ro}var Nc={},PT;function BG(){if(PT)return Nc;PT=1,Object.defineProperty(Nc,"__esModule",{value:!0}),
1197
+ Nc.build=void 0;const t=l=>l.counts,e=l=>l.groups,n=l=>l.paths,r=l=>l.paths.slice(0,l.options.maxFiles),i=(l,f,d)=>(u(f,d,l.counts,l.options.suppressErrors),null),s=(l,f,d)=>(u(f,d,l.paths,l.options.suppressErrors),null),o=(l,f,d)=>(u(f,d,l.paths.slice(0,l.options.maxFiles),l.options.suppressErrors),null),a=(l,f,d)=>(u(f,d,l.groups,l.options.suppressErrors),null);function u(l,f,d,p){f(l&&!p?l:null,d)}function c(l,f){const{onlyCounts:d,group:p,maxFiles:m}=l;return d?f?t:i:p?f?e:a:m?f?r:o:f?n:s}return Nc.
1198
+ build=c,Nc}var io={},xT;function qG(){if(xT)return io;xT=1;var t=io&&io.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(io,"__esModule",{value:!0}),io.build=void 0;const e=t(La),n={withFileTypes:!0},r=(o,a,u,c,l)=>{if(c<0)return o.queue.dequeue(null,o);o.visited.push(a),o.counts.directories++,o.queue.enqueue(),e.default.readdir(a||".",n,(f,d=[])=>{l(d,u,c),o.queue.dequeue(o.options.suppressErrors?null:f,o)})},i=(o,a,u,c,l)=>{if(c<0)return;o.visited.push(a),
1199
+ o.counts.directories++;let f=[];try{f=e.default.readdirSync(a||".",n)}catch(d){if(!o.options.suppressErrors)throw d}l(f,u,c)};function s(o){return o?i:r}return io.build=s,io}var Ic={},NT;function jG(){if(NT)return Ic;NT=1,Object.defineProperty(Ic,"__esModule",{value:!0}),Ic.Queue=void 0;class t{onQueueEmpty;count=0;constructor(n){this.onQueueEmpty=n}enqueue(){this.count++}dequeue(n,r){(--this.count<=0||n)&&this.onQueueEmpty(n,r)}}return Ic.Queue=t,Ic}var Oc={},IT;function GG(){if(IT)return Oc;IT=
1200
+ 1,Object.defineProperty(Oc,"__esModule",{value:!0}),Oc.Counter=void 0;class t{_files=0;_directories=0;set files(n){this._files=n}get files(){return this._files}set directories(n){this._directories=n}get directories(){return this._directories}get dirs(){return this._directories}}return Oc.Counter=t,Oc}var OT;function FT(){if(OT)return kr;OT=1;var t=kr&&kr.__createBinding||(Object.create?function(w,y,E,R){R===void 0&&(R=E);var A=Object.getOwnPropertyDescriptor(y,E);(!A||("get"in A?!y.__esModule:A.
1201
+ writable||A.configurable))&&(A={enumerable:!0,get:function(){return y[E]}}),Object.defineProperty(w,R,A)}:function(w,y,E,R){R===void 0&&(R=E),w[R]=y[E]}),e=kr&&kr.__setModuleDefault||(Object.create?function(w,y){Object.defineProperty(w,"default",{enumerable:!0,value:y})}:function(w,y){w.default=y}),n=kr&&kr.__importStar||function(w){if(w&&w.__esModule)return w;var y={};if(w!=null)for(var E in w)E!=="default"&&Object.prototype.hasOwnProperty.call(w,E)&&t(y,w,E);return e(y,w),y};Object.defineProperty(
1202
+ kr,"__esModule",{value:!0}),kr.Walker=void 0;const r=qi,i=RT(),s=n(NG()),o=n(IG()),a=n(OG()),u=n(FG()),c=n(LG()),l=n(MG()),f=n(BG()),d=n(qG()),p=jG(),m=GG();class v{root;isSynchronous;state;joinPath;pushDirectory;pushFile;getArray;groupFiles;resolveSymlink;walkDirectory;callbackInvoker;constructor(y,E,R){this.isSynchronous=!R,this.callbackInvoker=f.build(E,this.isSynchronous),this.root=(0,i.normalizePath)(y,E),this.state={root:this.root.slice(0,-1),paths:[""].slice(0,0),groups:[],counts:new m.Counter,
1203
+ options:E,queue:new p.Queue((A,N)=>this.callbackInvoker(N,A,R)),symlinks:new Map,visited:[""].slice(0,0)},this.joinPath=s.build(this.root,E),this.pushDirectory=o.build(this.root,E),this.pushFile=a.build(E),this.getArray=u.build(E),this.groupFiles=c.build(E),this.resolveSymlink=l.build(E,this.isSynchronous),this.walkDirectory=d.build(this.isSynchronous)}start(){return this.walkDirectory(this.state,this.root,this.root,this.state.options.maxDepth,this.walk),this.isSynchronous?this.callbackInvoker(this.
1204
+ state,null):null}walk=(y,E,R)=>{const{paths:A,options:{filters:N,resolveSymlinks:V,excludeSymlinks:J,exclude:se,maxFiles:ie,signal:we,useRealPaths:B,pathSeparator:T}}=this.state;if(we&&we.aborted||ie&&A.length>ie)return;this.pushDirectory(E,A,N);const D=this.getArray(this.state.paths);for(let M=0;M<y.length;++M){const S=y[M];if(S.isFile()||S.isSymbolicLink()&&!V&&!J){const P=this.joinPath(S.name,E);this.pushFile(P,D,this.state.counts,N)}else if(S.isDirectory()){let P=s.joinDirectoryPath(S.name,E,
1205
+ this.state.options.pathSeparator);if(se&&se(S.name,P))continue;this.walkDirectory(this.state,P,P,R-1,this.walk)}else if(S.isSymbolicLink()&&this.resolveSymlink){let P=s.joinPathWithBasePath(S.name,E);this.resolveSymlink(P,this.state,(O,Q)=>{if(O.isDirectory()){if(Q=(0,i.normalizePath)(Q,this.state.options),se&&se(S.name,B?Q:P+T))return;this.walkDirectory(this.state,Q,B?Q:P+T,R-1,this.walk)}else{Q=B?Q:P;const z=(0,r.basename)(Q),C=(0,i.normalizePath)((0,r.dirname)(Q),this.state.options);Q=this.joinPath(
1206
+ z,C),this.pushFile(Q,D,this.state.counts,N)}})}}this.groupFiles(this.state.groups,E,D)}}return kr.Walker=v,kr}var LT;function UG(){if(LT)return no;LT=1,Object.defineProperty(no,"__esModule",{value:!0}),no.callback=no.promise=void 0;const t=FT();function e(r,i){return new Promise((s,o)=>{n(r,i,(a,u)=>{if(a)return o(a);s(u)})})}no.promise=e;function n(r,i,s){new t.Walker(r,i,s).start()}return no.callback=n,no}var Fc={},MT;function WG(){if(MT)return Fc;MT=1,Object.defineProperty(Fc,"__esModule",{value:!0}),
1207
+ Fc.sync=void 0;const t=FT();function e(n,r){return new t.Walker(n,r).start()}return Fc.sync=e,Fc}var BT;function zG(){if(BT)return Ac;BT=1,Object.defineProperty(Ac,"__esModule",{value:!0}),Ac.APIBuilder=void 0;const t=UG(),e=WG();class n{root;options;constructor(i,s){this.root=i,this.options=s}withPromise(){return(0,t.promise)(this.root,this.options)}withCallback(i){(0,t.callback)(this.root,this.options,i)}sync(){return(0,e.sync)(this.root,this.options)}}return Ac.APIBuilder=n,Ac}var xy={},Ny,qT;
1208
+ function pp(){if(qT)return Ny;qT=1;const t="\\\\/",e=`[^${t}]`,n="\\.",r="\\+",i="\\?",s="\\/",o="(?=.)",a="[^/]",u=`(?:${s}|$)`,c=`(?:^|${s})`,l=`${n}{1,2}${u}`,f=`(?!${n})`,d=`(?!${c}${l})`,p=`(?!${n}{0,1}${u})`,m=`(?!${l})`,v=`[^.${s}]`,w=`${a}*?`,E={DOT_LITERAL:n,PLUS_LITERAL:r,QMARK_LITERAL:i,SLASH_LITERAL:s,ONE_CHAR:o,QMARK:a,END_ANCHOR:u,DOTS_SLASH:l,NO_DOT:f,NO_DOTS:d,NO_DOT_SLASH:p,NO_DOTS_SLASH:m,QMARK_NO_DOT:v,STAR:w,START_ANCHOR:c,SEP:"/"},R={...E,SLASH_LITERAL:`[${t}]`,QMARK:e,STAR:`${e}\
1209
+ *?`,DOTS_SLASH:`${n}{1,2}(?:[${t}]|$)`,NO_DOT:`(?!${n})`,NO_DOTS:`(?!(?:^|[${t}])${n}{1,2}(?:[${t}]|$))`,NO_DOT_SLASH:`(?!${n}{0,1}(?:[${t}]|$))`,NO_DOTS_SLASH:`(?!${n}{1,2}(?:[${t}]|$))`,QMARK_NO_DOT:`[^.${t}]`,START_ANCHOR:`(?:^|[${t}])`,END_ANCHOR:`(?:[${t}]|$)`,SEP:"\\"},A={alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",
1210
+ upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};return Ny={MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:A,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,
1211
+ CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,
1212
+ CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,extglobChars(N){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${N.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"\
1213
+ (?:",close:")"}}},globChars(N){return N===!0?R:E}},Ny}var jT;function hp(){return jT||(jT=1,function(t){const{REGEX_BACKSLASH:e,REGEX_REMOVE_BACKSLASH:n,REGEX_SPECIAL_CHARS:r,REGEX_SPECIAL_CHARS_GLOBAL:i}=pp();t.isObject=s=>s!==null&&typeof s=="object"&&!Array.isArray(s),t.hasRegexChars=s=>r.test(s),t.isRegexChar=s=>s.length===1&&t.hasRegexChars(s),t.escapeRegex=s=>s.replace(i,"\\$1"),t.toPosixSlashes=s=>s.replace(e,"/"),t.isWindows=()=>{if(typeof navigator<"u"&&navigator.platform){const s=navigator.
1214
+ platform.toLowerCase();return s==="win32"||s==="windows"}return typeof process<"u"&&process.platform?process.platform==="win32":!1},t.removeBackslashes=s=>s.replace(n,o=>o==="\\"?"":o),t.escapeLast=(s,o,a)=>{const u=s.lastIndexOf(o,a);return u===-1?s:s[u-1]==="\\"?t.escapeLast(s,o,u-1):`${s.slice(0,u)}\\${s.slice(u)}`},t.removePrefix=(s,o={})=>{let a=s;return a.startsWith("./")&&(a=a.slice(2),o.prefix="./"),a},t.wrapOutput=(s,o={},a={})=>{const u=a.contains?"":"^",c=a.contains?"":"$";let l=`${u}\
1215
+ (?:${s})${c}`;return o.negated===!0&&(l=`(?:^(?!${l}).*$)`),l},t.basename=(s,{windows:o}={})=>{const a=s.split(o?/[\\/]/:"/"),u=a[a.length-1];return u===""?a[a.length-2]:u}}(xy)),xy}var Iy,GT;function HG(){if(GT)return Iy;GT=1;const t=hp(),{CHAR_ASTERISK:e,CHAR_AT:n,CHAR_BACKWARD_SLASH:r,CHAR_COMMA:i,CHAR_DOT:s,CHAR_EXCLAMATION_MARK:o,CHAR_FORWARD_SLASH:a,CHAR_LEFT_CURLY_BRACE:u,CHAR_LEFT_PARENTHESES:c,CHAR_LEFT_SQUARE_BRACKET:l,CHAR_PLUS:f,CHAR_QUESTION_MARK:d,CHAR_RIGHT_CURLY_BRACE:p,CHAR_RIGHT_PARENTHESES:m,
1216
+ CHAR_RIGHT_SQUARE_BRACKET:v}=pp(),w=R=>R===a||R===r,y=R=>{R.isPrefix!==!0&&(R.depth=R.isGlobstar?1/0:1)};return Iy=(R,A)=>{const N=A||{},V=R.length-1,J=N.parts===!0||N.scanToEnd===!0,se=[],ie=[],we=[];let B=R,T=-1,D=0,M=0,S=!1,P=!1,O=!1,Q=!1,z=!1,C=!1,ne=!1,ye=!1,xe=!1,L=!1,H=0,Se,le,$e={value:"",depth:0,isGlob:!1};const Ne=()=>T>=V,de=()=>B.charCodeAt(T+1),I=()=>(Se=le,B.charCodeAt(++T));for(;T<V;){le=I();let Ve;if(le===r){ne=$e.backslashes=!0,le=I(),le===u&&(C=!0);continue}if(C===!0||le===u){for(H++;Ne()!==
1217
+ !0&&(le=I());){if(le===r){ne=$e.backslashes=!0,I();continue}if(le===u){H++;continue}if(C!==!0&&le===s&&(le=I())===s){if(S=$e.isBrace=!0,O=$e.isGlob=!0,L=!0,J===!0)continue;break}if(C!==!0&&le===i){if(S=$e.isBrace=!0,O=$e.isGlob=!0,L=!0,J===!0)continue;break}if(le===p&&(H--,H===0)){C=!1,S=$e.isBrace=!0,L=!0;break}}if(J===!0)continue;break}if(le===a){if(se.push(T),ie.push($e),$e={value:"",depth:0,isGlob:!1},L===!0)continue;if(Se===s&&T===D+1){D+=2;continue}M=T+1;continue}if(N.noext!==!0&&(le===f||
1218
+ le===n||le===e||le===d||le===o)===!0&&de()===c){if(O=$e.isGlob=!0,Q=$e.isExtglob=!0,L=!0,le===o&&T===D&&(xe=!0),J===!0){for(;Ne()!==!0&&(le=I());){if(le===r){ne=$e.backslashes=!0,le=I();continue}if(le===m){O=$e.isGlob=!0,L=!0;break}}continue}break}if(le===e){if(Se===e&&(z=$e.isGlobstar=!0),O=$e.isGlob=!0,L=!0,J===!0)continue;break}if(le===d){if(O=$e.isGlob=!0,L=!0,J===!0)continue;break}if(le===l){for(;Ne()!==!0&&(Ve=I());){if(Ve===r){ne=$e.backslashes=!0,I();continue}if(Ve===v){P=$e.isBracket=!0,
1219
+ O=$e.isGlob=!0,L=!0;break}}if(J===!0)continue;break}if(N.nonegate!==!0&&le===o&&T===D){ye=$e.negated=!0,D++;continue}if(N.noparen!==!0&&le===c){if(O=$e.isGlob=!0,J===!0){for(;Ne()!==!0&&(le=I());){if(le===c){ne=$e.backslashes=!0,le=I();continue}if(le===m){L=!0;break}}continue}break}if(O===!0){if(L=!0,J===!0)continue;break}}N.noext===!0&&(Q=!1,O=!1);let G=B,pe="",U="";D>0&&(pe=B.slice(0,D),B=B.slice(D),M-=D),G&&O===!0&&M>0?(G=B.slice(0,M),U=B.slice(M)):O===!0?(G="",U=B):G=B,G&&G!==""&&G!=="/"&&G!==
1220
+ B&&w(G.charCodeAt(G.length-1))&&(G=G.slice(0,-1)),N.unescape===!0&&(U&&(U=t.removeBackslashes(U)),G&&ne===!0&&(G=t.removeBackslashes(G)));const fe={prefix:pe,input:R,start:D,base:G,glob:U,isBrace:S,isBracket:P,isGlob:O,isExtglob:Q,isGlobstar:z,negated:ye,negatedExtglob:xe};if(N.tokens===!0&&(fe.maxDepth=0,w(le)||ie.push($e),fe.tokens=ie),N.parts===!0||N.tokens===!0){let Ve;for(let it=0;it<se.length;it++){const ue=Ve?Ve+1:D,Ie=se[it],re=R.slice(ue,Ie);N.tokens&&(it===0&&D!==0?(ie[it].isPrefix=!0,
1221
+ ie[it].value=pe):ie[it].value=re,y(ie[it]),fe.maxDepth+=ie[it].depth),(it!==0||re!=="")&&we.push(re),Ve=Ie}if(Ve&&Ve+1<R.length){const it=R.slice(Ve+1);we.push(it),N.tokens&&(ie[ie.length-1].value=it,y(ie[ie.length-1]),fe.maxDepth+=ie[ie.length-1].depth)}fe.slashes=se,fe.parts=we}return fe},Iy}var Oy,UT;function KG(){if(UT)return Oy;UT=1;const t=pp(),e=hp(),{MAX_LENGTH:n,POSIX_REGEX_SOURCE:r,REGEX_NON_SPECIAL_CHARS:i,REGEX_SPECIAL_CHARS_BACKREF:s,REPLACEMENTS:o}=t,a=(l,f)=>{if(typeof f.expandRange==
1222
+ "function")return f.expandRange(...l,f);l.sort();const d=`[${l.join("-")}]`;try{new RegExp(d)}catch{return l.map(m=>e.escapeRegex(m)).join("..")}return d},u=(l,f)=>`Missing ${l}: "${f}" - use "\\\\${f}" to match literal characters`,c=(l,f)=>{if(typeof l!="string")throw new TypeError("Expected a string");l=o[l]||l;const d={...f},p=typeof d.maxLength=="number"?Math.min(n,d.maxLength):n;let m=l.length;if(m>p)throw new SyntaxError(`Input length: ${m}, exceeds maximum allowed length: ${p}`);const v={
1223
+ type:"bos",value:"",output:d.prepend||""},w=[v],y=d.capture?"":"?:",E=t.globChars(d.windows),R=t.extglobChars(E),{DOT_LITERAL:A,PLUS_LITERAL:N,SLASH_LITERAL:V,ONE_CHAR:J,DOTS_SLASH:se,NO_DOT:ie,NO_DOT_SLASH:we,NO_DOTS_SLASH:B,QMARK:T,QMARK_NO_DOT:D,STAR:M,START_ANCHOR:S}=E,P=ue=>`(${y}(?:(?!${S}${ue.dot?se:A}).)*?)`,O=d.dot?"":ie,Q=d.dot?T:D;let z=d.bash===!0?P(d):M;d.capture&&(z=`(${z})`),typeof d.noext=="boolean"&&(d.noextglob=d.noext);const C={input:l,index:-1,start:0,dot:d.dot===!0,consumed:"",
1224
+ output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:w};l=e.removePrefix(l,C),m=l.length;const ne=[],ye=[],xe=[];let L=v,H;const Se=()=>C.index===m-1,le=C.peek=(ue=1)=>l[C.index+ue],$e=C.advance=()=>l[++C.index]||"",Ne=()=>l.slice(C.index+1),de=(ue="",Ie=0)=>{C.consumed+=ue,C.index+=Ie},I=ue=>{C.output+=ue.output!=null?ue.output:ue.value,de(ue.value)},G=()=>{let ue=1;for(;le()==="!"&&(le(2)!=="("||le(3)==="?");)$e(),C.start++,ue++;return ue%2===0?!1:
1225
+ (C.negated=!0,C.start++,!0)},pe=ue=>{C[ue]++,xe.push(ue)},U=ue=>{C[ue]--,xe.pop()},fe=ue=>{if(L.type==="globstar"){const Ie=C.braces>0&&(ue.type==="comma"||ue.type==="brace"),re=ue.extglob===!0||ne.length&&(ue.type==="pipe"||ue.type==="paren");ue.type!=="slash"&&ue.type!=="paren"&&!Ie&&!re&&(C.output=C.output.slice(0,-L.output.length),L.type="star",L.value="*",L.output=z,C.output+=L.output)}if(ne.length&&ue.type!=="paren"&&(ne[ne.length-1].inner+=ue.value),(ue.value||ue.output)&&I(ue),L&&L.type===
1226
+ "text"&&ue.type==="text"){L.output=(L.output||L.value)+ue.value,L.value+=ue.value;return}ue.prev=L,w.push(ue),L=ue},Ve=(ue,Ie)=>{const re={...R[Ie],conditions:1,inner:""};re.prev=L,re.parens=C.parens,re.output=C.output;const De=(d.capture?"(":"")+re.open;pe("parens"),fe({type:ue,value:Ie,output:C.output?"":J}),fe({type:"paren",extglob:!0,value:$e(),output:De}),ne.push(re)},it=ue=>{let Ie=ue.close+(d.capture?")":""),re;if(ue.type==="negate"){let De=z;if(ue.inner&&ue.inner.length>1&&ue.inner.includes(
1227
+ "/")&&(De=P(d)),(De!==z||Se()||/^\)+$/.test(Ne()))&&(Ie=ue.close=`)$))${De}`),ue.inner.includes("*")&&(re=Ne())&&/^\.[^\\/.]+$/.test(re)){const Ge=c(re,{...f,fastpaths:!1}).output;Ie=ue.close=`)${Ge})${De})`}ue.prev.type==="bos"&&(C.negatedExtglob=!0)}fe({type:"paren",extglob:!0,value:H,output:Ie}),U("parens")};if(d.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(l)){let ue=!1,Ie=l.replace(s,(re,De,Ge,wt,et,Xt)=>wt==="\\"?(ue=!0,re):wt==="?"?De?De+wt+(et?T.repeat(et.length):""):Xt===0?Q+(et?T.repeat(
1228
+ et.length):""):T.repeat(Ge.length):wt==="."?A.repeat(Ge.length):wt==="*"?De?De+wt+(et?z:""):z:De?re:`\\${re}`);return ue===!0&&(d.unescape===!0?Ie=Ie.replace(/\\/g,""):Ie=Ie.replace(/\\+/g,re=>re.length%2===0?"\\\\":re?"\\":"")),Ie===l&&d.contains===!0?(C.output=l,C):(C.output=e.wrapOutput(Ie,C,f),C)}for(;!Se();){if(H=$e(),H==="\0")continue;if(H==="\\"){const re=le();if(re==="/"&&d.bash!==!0||re==="."||re===";")continue;if(!re){H+="\\",fe({type:"text",value:H});continue}const De=/^\\+/.exec(Ne());
1229
+ let Ge=0;if(De&&De[0].length>2&&(Ge=De[0].length,C.index+=Ge,Ge%2!==0&&(H+="\\")),d.unescape===!0?H=$e():H+=$e(),C.brackets===0){fe({type:"text",value:H});continue}}if(C.brackets>0&&(H!=="]"||L.value==="["||L.value==="[^")){if(d.posix!==!1&&H===":"){const re=L.value.slice(1);if(re.includes("[")&&(L.posix=!0,re.includes(":"))){const De=L.value.lastIndexOf("["),Ge=L.value.slice(0,De),wt=L.value.slice(De+2),et=r[wt];if(et){L.value=Ge+et,C.backtrack=!0,$e(),!v.output&&w.indexOf(L)===1&&(v.output=J);
1230
+ continue}}}(H==="["&&le()!==":"||H==="-"&&le()==="]")&&(H=`\\${H}`),H==="]"&&(L.value==="["||L.value==="[^")&&(H=`\\${H}`),d.posix===!0&&H==="!"&&L.value==="["&&(H="^"),L.value+=H,I({value:H});continue}if(C.quotes===1&&H!=='"'){H=e.escapeRegex(H),L.value+=H,I({value:H});continue}if(H==='"'){C.quotes=C.quotes===1?0:1,d.keepQuotes===!0&&fe({type:"text",value:H});continue}if(H==="("){pe("parens"),fe({type:"paren",value:H});continue}if(H===")"){if(C.parens===0&&d.strictBrackets===!0)throw new SyntaxError(
1231
+ u("opening","("));const re=ne[ne.length-1];if(re&&C.parens===re.parens+1){it(ne.pop());continue}fe({type:"paren",value:H,output:C.parens?")":"\\)"}),U("parens");continue}if(H==="["){if(d.nobracket===!0||!Ne().includes("]")){if(d.nobracket!==!0&&d.strictBrackets===!0)throw new SyntaxError(u("closing","]"));H=`\\${H}`}else pe("brackets");fe({type:"bracket",value:H});continue}if(H==="]"){if(d.nobracket===!0||L&&L.type==="bracket"&&L.value.length===1){fe({type:"text",value:H,output:`\\${H}`});continue}
1232
+ if(C.brackets===0){if(d.strictBrackets===!0)throw new SyntaxError(u("opening","["));fe({type:"text",value:H,output:`\\${H}`});continue}U("brackets");const re=L.value.slice(1);if(L.posix!==!0&&re[0]==="^"&&!re.includes("/")&&(H=`/${H}`),L.value+=H,I({value:H}),d.literalBrackets===!1||e.hasRegexChars(re))continue;const De=e.escapeRegex(L.value);if(C.output=C.output.slice(0,-L.value.length),d.literalBrackets===!0){C.output+=De,L.value=De;continue}L.value=`(${y}${De}|${L.value})`,C.output+=L.value;continue}
1233
+ if(H==="{"&&d.nobrace!==!0){pe("braces");const re={type:"brace",value:H,output:"(",outputIndex:C.output.length,tokensIndex:C.tokens.length};ye.push(re),fe(re);continue}if(H==="}"){const re=ye[ye.length-1];if(d.nobrace===!0||!re){fe({type:"text",value:H,output:H});continue}let De=")";if(re.dots===!0){const Ge=w.slice(),wt=[];for(let et=Ge.length-1;et>=0&&(w.pop(),Ge[et].type!=="brace");et--)Ge[et].type!=="dots"&&wt.unshift(Ge[et].value);De=a(wt,d),C.backtrack=!0}if(re.comma!==!0&&re.dots!==!0){const Ge=C.
1234
+ output.slice(0,re.outputIndex),wt=C.tokens.slice(re.tokensIndex);re.value=re.output="\\{",H=De="\\}",C.output=Ge;for(const et of wt)C.output+=et.output||et.value}fe({type:"brace",value:H,output:De}),U("braces"),ye.pop();continue}if(H==="|"){ne.length>0&&ne[ne.length-1].conditions++,fe({type:"text",value:H});continue}if(H===","){let re=H;const De=ye[ye.length-1];De&&xe[xe.length-1]==="braces"&&(De.comma=!0,re="|"),fe({type:"comma",value:H,output:re});continue}if(H==="/"){if(L.type==="dot"&&C.index===
1235
+ C.start+1){C.start=C.index+1,C.consumed="",C.output="",w.pop(),L=v;continue}fe({type:"slash",value:H,output:V});continue}if(H==="."){if(C.braces>0&&L.type==="dot"){L.value==="."&&(L.output=A);const re=ye[ye.length-1];L.type="dots",L.output+=H,L.value+=H,re.dots=!0;continue}if(C.braces+C.parens===0&&L.type!=="bos"&&L.type!=="slash"){fe({type:"text",value:H,output:A});continue}fe({type:"dot",value:H,output:A});continue}if(H==="?"){if(!(L&&L.value==="(")&&d.noextglob!==!0&&le()==="("&&le(2)!=="?"){
1236
+ Ve("qmark",H);continue}if(L&&L.type==="paren"){const De=le();let Ge=H;(L.value==="("&&!/[!=<:]/.test(De)||De==="<"&&!/<([!=]|\w+>)/.test(Ne()))&&(Ge=`\\${H}`),fe({type:"text",value:H,output:Ge});continue}if(d.dot!==!0&&(L.type==="slash"||L.type==="bos")){fe({type:"qmark",value:H,output:D});continue}fe({type:"qmark",value:H,output:T});continue}if(H==="!"){if(d.noextglob!==!0&&le()==="("&&(le(2)!=="?"||!/[!=<:]/.test(le(3)))){Ve("negate",H);continue}if(d.nonegate!==!0&&C.index===0){G();continue}}if(H===
1237
+ "+"){if(d.noextglob!==!0&&le()==="("&&le(2)!=="?"){Ve("plus",H);continue}if(L&&L.value==="("||d.regex===!1){fe({type:"plus",value:H,output:N});continue}if(L&&(L.type==="bracket"||L.type==="paren"||L.type==="brace")||C.parens>0){fe({type:"plus",value:H});continue}fe({type:"plus",value:N});continue}if(H==="@"){if(d.noextglob!==!0&&le()==="("&&le(2)!=="?"){fe({type:"at",extglob:!0,value:H,output:""});continue}fe({type:"text",value:H});continue}if(H!=="*"){(H==="$"||H==="^")&&(H=`\\${H}`);const re=i.
1238
+ exec(Ne());re&&(H+=re[0],C.index+=re[0].length),fe({type:"text",value:H});continue}if(L&&(L.type==="globstar"||L.star===!0)){L.type="star",L.star=!0,L.value+=H,L.output=z,C.backtrack=!0,C.globstar=!0,de(H);continue}let ue=Ne();if(d.noextglob!==!0&&/^\([^?]/.test(ue)){Ve("star",H);continue}if(L.type==="star"){if(d.noglobstar===!0){de(H);continue}const re=L.prev,De=re.prev,Ge=re.type==="slash"||re.type==="bos",wt=De&&(De.type==="star"||De.type==="globstar");if(d.bash===!0&&(!Ge||ue[0]&&ue[0]!=="/")){
1239
+ fe({type:"star",value:H,output:""});continue}const et=C.braces>0&&(re.type==="comma"||re.type==="brace"),Xt=ne.length&&(re.type==="pipe"||re.type==="paren");if(!Ge&&re.type!=="paren"&&!et&&!Xt){fe({type:"star",value:H,output:""});continue}for(;ue.slice(0,3)==="/**";){const tn=l[C.index+4];if(tn&&tn!=="/")break;ue=ue.slice(3),de("/**",3)}if(re.type==="bos"&&Se()){L.type="globstar",L.value+=H,L.output=P(d),C.output=L.output,C.globstar=!0,de(H);continue}if(re.type==="slash"&&re.prev.type!=="bos"&&!wt&&
1240
+ Se()){C.output=C.output.slice(0,-(re.output+L.output).length),re.output=`(?:${re.output}`,L.type="globstar",L.output=P(d)+(d.strictSlashes?")":"|$)"),L.value+=H,C.globstar=!0,C.output+=re.output+L.output,de(H);continue}if(re.type==="slash"&&re.prev.type!=="bos"&&ue[0]==="/"){const tn=ue[1]!==void 0?"|$":"";C.output=C.output.slice(0,-(re.output+L.output).length),re.output=`(?:${re.output}`,L.type="globstar",L.output=`${P(d)}${V}|${V}${tn})`,L.value+=H,C.output+=re.output+L.output,C.globstar=!0,de(
1241
+ H+$e()),fe({type:"slash",value:"/",output:""});continue}if(re.type==="bos"&&ue[0]==="/"){L.type="globstar",L.value+=H,L.output=`(?:^|${V}|${P(d)}${V})`,C.output=L.output,C.globstar=!0,de(H+$e()),fe({type:"slash",value:"/",output:""});continue}C.output=C.output.slice(0,-L.output.length),L.type="globstar",L.output=P(d),L.value+=H,C.output+=L.output,C.globstar=!0,de(H);continue}const Ie={type:"star",value:H,output:z};if(d.bash===!0){Ie.output=".*?",(L.type==="bos"||L.type==="slash")&&(Ie.output=O+Ie.
1242
+ output),fe(Ie);continue}if(L&&(L.type==="bracket"||L.type==="paren")&&d.regex===!0){Ie.output=H,fe(Ie);continue}(C.index===C.start||L.type==="slash"||L.type==="dot")&&(L.type==="dot"?(C.output+=we,L.output+=we):d.dot===!0?(C.output+=B,L.output+=B):(C.output+=O,L.output+=O),le()!=="*"&&(C.output+=J,L.output+=J)),fe(Ie)}for(;C.brackets>0;){if(d.strictBrackets===!0)throw new SyntaxError(u("closing","]"));C.output=e.escapeLast(C.output,"["),U("brackets")}for(;C.parens>0;){if(d.strictBrackets===!0)throw new SyntaxError(
1243
+ u("closing",")"));C.output=e.escapeLast(C.output,"("),U("parens")}for(;C.braces>0;){if(d.strictBrackets===!0)throw new SyntaxError(u("closing","}"));C.output=e.escapeLast(C.output,"{"),U("braces")}if(d.strictSlashes!==!0&&(L.type==="star"||L.type==="bracket")&&fe({type:"maybe_slash",value:"",output:`${V}?`}),C.backtrack===!0){C.output="";for(const ue of C.tokens)C.output+=ue.output!=null?ue.output:ue.value,ue.suffix&&(C.output+=ue.suffix)}return C};return c.fastpaths=(l,f)=>{const d={...f},p=typeof d.
1244
+ maxLength=="number"?Math.min(n,d.maxLength):n,m=l.length;if(m>p)throw new SyntaxError(`Input length: ${m}, exceeds maximum allowed length: ${p}`);l=o[l]||l;const{DOT_LITERAL:v,SLASH_LITERAL:w,ONE_CHAR:y,DOTS_SLASH:E,NO_DOT:R,NO_DOTS:A,NO_DOTS_SLASH:N,STAR:V,START_ANCHOR:J}=t.globChars(d.windows),se=d.dot?A:R,ie=d.dot?N:R,we=d.capture?"":"?:",B={negated:!1,prefix:""};let T=d.bash===!0?".*?":V;d.capture&&(T=`(${T})`);const D=O=>O.noglobstar===!0?T:`(${we}(?:(?!${J}${O.dot?E:v}).)*?)`,M=O=>{switch(O){case"\
1245
+ *":return`${se}${y}${T}`;case".*":return`${v}${y}${T}`;case"*.*":return`${se}${T}${v}${y}${T}`;case"*/*":return`${se}${T}${w}${y}${ie}${T}`;case"**":return se+D(d);case"**/*":return`(?:${se}${D(d)}${w})?${ie}${y}${T}`;case"**/*.*":return`(?:${se}${D(d)}${w})?${ie}${T}${v}${y}${T}`;case"**/.*":return`(?:${se}${D(d)}${w})?${v}${y}${T}`;default:{const Q=/^(.*?)\.(\w+)$/.exec(O);if(!Q)return;const z=M(Q[1]);return z?z+v+Q[2]:void 0}}},S=e.removePrefix(l,B);let P=M(S);return P&&d.strictSlashes!==!0&&
1246
+ (P+=`${w}?`),P},Oy=c,Oy}var Fy,WT;function zT(){if(WT)return Fy;WT=1;const t=HG(),e=KG(),n=hp(),r=pp(),i=o=>o&&typeof o=="object"&&!Array.isArray(o),s=(o,a,u=!1)=>{if(Array.isArray(o)){const w=o.map(E=>s(E,a,u));return E=>{for(const R of w){const A=R(E);if(A)return A}return!1}}const c=i(o)&&o.tokens&&o.input;if(o===""||typeof o!="string"&&!c)throw new TypeError("Expected pattern to be a non-empty string");const l=a||{},f=l.windows,d=c?s.compileRe(o,a):s.makeRe(o,a,!1,!0),p=d.state;delete d.state;
1247
+ let m=()=>!1;if(l.ignore){const w={...a,ignore:null,onMatch:null,onResult:null};m=s(l.ignore,w,u)}const v=(w,y=!1)=>{const{isMatch:E,match:R,output:A}=s.test(w,d,a,{glob:o,posix:f}),N={glob:o,state:p,regex:d,posix:f,input:w,output:A,match:R,isMatch:E};return typeof l.onResult=="function"&&l.onResult(N),E===!1?(N.isMatch=!1,y?N:!1):m(w)?(typeof l.onIgnore=="function"&&l.onIgnore(N),N.isMatch=!1,y?N:!1):(typeof l.onMatch=="function"&&l.onMatch(N),y?N:!0)};return u&&(v.state=p),v};return s.test=(o,a,u,{
1248
+ glob:c,posix:l}={})=>{if(typeof o!="string")throw new TypeError("Expected input to be a string");if(o==="")return{isMatch:!1,output:""};const f=u||{},d=f.format||(l?n.toPosixSlashes:null);let p=o===c,m=p&&d?d(o):o;return p===!1&&(m=d?d(o):o,p=m===c),(p===!1||f.capture===!0)&&(f.matchBase===!0||f.basename===!0?p=s.matchBase(o,a,u,l):p=a.exec(m)),{isMatch:!!p,match:p,output:m}},s.matchBase=(o,a,u)=>(a instanceof RegExp?a:s.makeRe(a,u)).test(n.basename(o)),s.isMatch=(o,a,u)=>s(a,u)(o),s.parse=(o,a)=>Array.
1249
+ isArray(o)?o.map(u=>s.parse(u,a)):e(o,{...a,fastpaths:!1}),s.scan=(o,a)=>t(o,a),s.compileRe=(o,a,u=!1,c=!1)=>{if(u===!0)return o.output;const l=a||{},f=l.contains?"":"^",d=l.contains?"":"$";let p=`${f}(?:${o.output})${d}`;o&&o.negated===!0&&(p=`^(?!${p}).*$`);const m=s.toRegex(p,a);return c===!0&&(m.state=o),m},s.makeRe=(o,a={},u=!1,c=!1)=>{if(!o||typeof o!="string")throw new TypeError("Expected a non-empty string");let l={negated:!1,fastpaths:!0};return a.fastpaths!==!1&&(o[0]==="."||o[0]==="*")&&
1250
+ (l.output=e.fastpaths(o,a)),l.output||(l=e(o,a)),s.compileRe(l,a,u,c)},s.toRegex=(o,a)=>{try{const u=a||{};return new RegExp(o,u.flags||(u.nocase?"i":""))}catch(u){if(a&&a.debug===!0)throw u;return/$^/}},s.constants=r,Fy=s,Fy}var Ly,HT;function VG(){if(HT)return Ly;HT=1;const t=zT(),e=hp();function n(r,i,s=!1){return i&&(i.windows===null||i.windows===void 0)&&(i={...i,windows:e.isWindows()}),t(r,i,s)}return Object.assign(n,t),Ly=n,Ly}var KT;function XG(){if(KT)return Cc;KT=1,Object.defineProperty(
1251
+ Cc,"__esModule",{value:!0}),Cc.Builder=void 0;const t=qi,e=zG();var n=null;try{require.resolve("picomatch"),n=VG()}catch{}class r{globCache={};options={maxDepth:1/0,suppressErrors:!0,pathSeparator:t.sep,filters:[]};globFunction;constructor(s){this.options={...this.options,...s},this.globFunction=this.options.globFunction}group(){return this.options.group=!0,this}withPathSeparator(s){return this.options.pathSeparator=s,this}withBasePath(){return this.options.includeBasePath=!0,this}withRelativePaths(){
1252
+ return this.options.relativePaths=!0,this}withDirs(){return this.options.includeDirs=!0,this}withMaxDepth(s){return this.options.maxDepth=s,this}withMaxFiles(s){return this.options.maxFiles=s,this}withFullPaths(){return this.options.resolvePaths=!0,this.options.includeBasePath=!0,this}withErrors(){return this.options.suppressErrors=!1,this}withSymlinks({resolvePaths:s=!0}={}){return this.options.resolveSymlinks=!0,this.options.useRealPaths=s,this.withFullPaths()}withAbortSignal(s){return this.options.
1253
+ signal=s,this}normalize(){return this.options.normalizePath=!0,this}filter(s){return this.options.filters.push(s),this}onlyDirs(){return this.options.excludeFiles=!0,this.options.includeDirs=!0,this}exclude(s){return this.options.exclude=s,this}onlyCounts(){return this.options.onlyCounts=!0,this}crawl(s){return new e.APIBuilder(s||".",this.options)}withGlobFunction(s){return this.globFunction=s,this}crawlWithOptions(s,o){return this.options={...this.options,...o},new e.APIBuilder(s||".",this.options)}glob(...s){
1254
+ return this.globFunction?this.globWithOptions(s):this.globWithOptions(s,{dot:!0})}globWithOptions(s,...o){const a=this.globFunction||n;if(!a)throw new Error("Please specify a glob function to use glob matching.");var u=this.globCache[s.join("\0")];return u||(u=a(s,...o),this.globCache[s.join("\0")]=u),this.options.filters.push(c=>u(c)),this}}return Cc.Builder=r,Cc}var My={},VT;function YG(){return VT||(VT=1,Object.defineProperty(My,"__esModule",{value:!0})),My}var XT;function JG(){return XT||(XT=
1255
+ 1,function(t){var e=to&&to.__createBinding||(Object.create?function(i,s,o,a){a===void 0&&(a=o);var u=Object.getOwnPropertyDescriptor(s,o);(!u||("get"in u?!s.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:function(){return s[o]}}),Object.defineProperty(i,a,u)}:function(i,s,o,a){a===void 0&&(a=o),i[a]=s[o]}),n=to&&to.__exportStar||function(i,s){for(var o in i)o!=="default"&&!Object.prototype.hasOwnProperty.call(s,o)&&e(s,i,o)};Object.defineProperty(t,"__esModule",{value:!0}),t.fdir=
1256
+ void 0;const r=XG();Object.defineProperty(t,"fdir",{enumerable:!0,get:function(){return r.Builder}}),n(YG(),t)}(to)),to}var QG=JG();class ZG{constructor(){this.encoding="utf-8"}readFile(e){return qw.promises.readFile(e.fsPath,this.encoding)}async readDirectory(e){return(await qw.promises.readdir(e.fsPath,{withFileTypes:!0})).map(r=>({dirent:r,isFile:r.isFile(),isDirectory:r.isDirectory(),uri:ht.joinPath(e,r.name)}))}}const mp="DeploymentElement";function gp(t){return K.isInstance(t,mp)}const By="\
1257
+ DeploymentNodeOrElementKind",yp="DeploymentViewRule";function e8(t){return K.isInstance(t,yp)}const Lc="DynamicViewRule";function qy(t){return K.isInstance(t,Lc)}const so="ElementProperty";function t8(t){return K.isInstance(t,so)}const jy="ExpressionV2";function n8(t){return K.isInstance(t,jy)}const Gy="ExtendElementProperty",vp="FqnExpr";function YT(t){return K.isInstance(t,vp)}const wp="FqnExprOrWhere";function JT(t){return K.isInstance(t,wp)}const bp="FqnExprOrWith";function QT(t){return K.isInstance(
1258
+ t,bp)}const Uy="FqnReferenceable",oo="LikeC4View";function Wy(t){return K.isInstance(t,oo)}const Ep="MetadataProperty";function Qi(t){return K.isInstance(t,Ep)}const zy="ModelReferenceable",ta="Referenceable",$p="RelationExpr";function Dp(t){return K.isInstance(t,$p)}const Rp="RelationExprOrWhere";function r8(t){return K.isInstance(t,Rp)}const kp="RelationExprOrWith";function i8(t){return K.isInstance(t,kp)}const Mc="RelationProperty",Tp="RelationshipStyleProperty";function ZT(t){return K.isInstance(
1259
+ t,Tp)}const Hy="SizeProperty";function s8(t){return K.isInstance(t,Hy)}const na="StringProperty";function eC(t){return K.isInstance(t,na)}const ra="StyleProperty";function Ky(t){return K.isInstance(t,ra)}const Cp="ViewProperty";function o8(t){return K.isInstance(t,Cp)}const Bc="ViewRule";function a8(t){return K.isInstance(t,Bc)}const Ap="ViewRuleStyleOrGlobalRef";function Vy(t){return K.isInstance(t,Ap)}const qc="WhereElement";function tC(t){return K.isInstance(t,qc)}const jc="WhereElementExpres\
1260
+ sion";function u8(t){return K.isInstance(t,jc)}const nC="WhereExpression",Sp="WhereKindEqual";function c8(t){return K.isInstance(t,Sp)}const Gc="WhereRelation";function rC(t){return K.isInstance(t,Gc)}const Uc="WhereRelationExpression";function l8(t){return K.isInstance(t,Uc)}const _p="WhereTagEqual";function d8(t){return K.isInstance(t,_p)}const Wc="ArrowProperty";function zc(t){return K.isInstance(t,Wc)}const Hc="BorderProperty";function Pp(t){return K.isInstance(t,Hc)}const Kc="ColorProperty";
1261
+ function ao(t){return K.isInstance(t,Kc)}const uo="CustomColor",xp="CustomElementProperties";function f8(t){return K.isInstance(t,xp)}const Np="CustomRelationProperties";function p8(t){return K.isInstance(t,Np)}const ki="DeployedInstance";function Qn(t){return K.isInstance(t,ki)}const Ip="DeployedInstanceBody";function iC(t){return K.isInstance(t,Ip)}const Tr="DeploymentNode";function qn(t){return K.isInstance(t,Tr)}const Op="DeploymentNodeBody";function sC(t){return K.isInstance(t,Op)}const Ti="\
1262
+ DeploymentNodeKind";function h8(t){return K.isInstance(t,Ti)}const Fp="DeploymentRelation";function Ci(t){return K.isInstance(t,Fp)}const Lp="DeploymentRelationBody";function m8(t){return K.isInstance(t,Lp)}const Vc="DeploymentView";function oC(t){return K.isInstance(t,Vc)}const Mp="DeploymentViewBody";function Xy(t){return K.isInstance(t,Mp)}const Xc="DeploymentViewRulePredicate";function ia(t){return K.isInstance(t,Xc)}const Yc="DeploymentViewRuleStyle";function Yy(t){return K.isInstance(t,Yc)}
1263
+ const Jc="DirectedRelationExpr";function g8(t){return K.isInstance(t,Jc)}const sa="DynamicView";function aC(t){return K.isInstance(t,sa)}const Bp="DynamicViewBody";function uC(t){return K.isInstance(t,Bp)}const Qc="DynamicViewGlobalPredicateRef";function cC(t){return K.isInstance(t,Qc)}const Zc="DynamicViewIncludePredicate";function lC(t){return K.isInstance(t,Zc)}const qp="DynamicViewParallelSteps";function Jy(t){return K.isInstance(t,qp)}const Qy="DynamicViewRef",jp="DynamicViewStep";function Zy(t){
1264
+ return K.isInstance(t,jp)}const Zn="Element";function hn(t){return K.isInstance(t,Zn)}const Gp="ElementBody";function Up(t){return K.isInstance(t,Gp)}const Ai="ElementKind";function dC(t){return K.isInstance(t,Ai)}const el="ElementKindExpression";function fC(t){return K.isInstance(t,el)}const Wp="ElementRef";function ev(t){return K.isInstance(t,Wp)}const tl="ElementStringProperty";function nl(t){return K.isInstance(t,tl)}const rl="ElementStyleProperty";function oa(t){return K.isInstance(t,rl)}const il="\
1265
+ ElementTagExpression";function pC(t){return K.isInstance(t,il)}const aa="ElementView";function zp(t){return K.isInstance(t,aa)}const Hp="ElementViewBody";function tv(t){return K.isInstance(t,Hp)}const nv="ElementViewRef",Kp="Expressions";function hC(t){return K.isInstance(t,Kp)}const sl="ExtendDeployment";function co(t){return K.isInstance(t,sl)}const Vp="ExtendDeploymentBody";function mC(t){return K.isInstance(t,Vp)}const lo="ExtendElement";function ua(t){return K.isInstance(t,lo)}const Xp="Ext\
1266
+ endElementBody";function rv(t){return K.isInstance(t,Xp)}const Yp="FqnExpressions";function y8(t){return K.isInstance(t,Yp)}const ol="FqnExprWhere";function iv(t){return K.isInstance(t,ol)}const al="FqnExprWith";function Jp(t){return K.isInstance(t,al)}const Qp="FqnRef";function gC(t){return K.isInstance(t,Qp)}const ul="FqnRefExpr";function Zp(t){return K.isInstance(t,ul)}const ca="GlobalDynamicPredicateGroup";function cl(t){return K.isInstance(t,ca)}const la="GlobalPredicateGroup";function ll(t){
1267
+ return K.isInstance(t,la)}const da="Globals";function sv(t){return K.isInstance(t,da)}const eh="GlobalStyle";function fa(t){return K.isInstance(t,eh)}const th="GlobalStyleGroup";function fo(t){return K.isInstance(t,th)}const dl="GlobalStyleId",fl="IconProperty";function Zi(t){return K.isInstance(t,fl)}const es="Imported";function Kr(t){return K.isInstance(t,es)}const nh="ImportsFromPoject";function ov(t){return K.isInstance(t,nh)}const pl="IncomingRelationExpr";function v8(t){return K.isInstance(
1268
+ t,pl)}const hl="InOutRelationExpr";function yC(t){return K.isInstance(t,hl)}const Si="LibIcon";function w8(t){return K.isInstance(t,Si)}const rh="LikeC4Grammar";function vC(t){return K.isInstance(t,rh)}const ih="LikeC4Lib";function b8(t){return K.isInstance(t,ih)}const ml="LineProperty";function gl(t){return K.isInstance(t,ml)}const yl="LinkProperty";function sh(t){return K.isInstance(t,yl)}const vl="MetadataAttribute";function E8(t){return K.isInstance(t,vl)}const wl="MetadataBody";function $8(t){
1269
+ return K.isInstance(t,wl)}const pa="Model";function wC(t){return K.isInstance(t,pa)}const ha="ModelDeployments";function bC(t){return K.isInstance(t,ha)}const ma="ModelViews";function bl(t){return K.isInstance(t,ma)}const El="MultipleProperty";function av(t){return K.isInstance(t,El)}const oh="NavigateToProperty";function ah(t){return K.isInstance(t,oh)}const $l="NotationProperty";function ga(t){return K.isInstance(t,$l)}const Dl="NotesProperty";function EC(t){return K.isInstance(t,Dl)}const Rl="\
1270
+ OpacityProperty";function uh(t){return K.isInstance(t,Rl)}const kl="OutgoingRelationExpr";function $C(t){return K.isInstance(t,kl)}const Tl="PaddingSizeProperty";function uv(t){return K.isInstance(t,Tl)}const ch="Relation";function _i(t){return K.isInstance(t,ch)}const lh="RelationBody";function D8(t){return K.isInstance(t,lh)}const Cl="RelationExprWhere";function cv(t){return K.isInstance(t,Cl)}const Al="RelationExprWith";function lv(t){return K.isInstance(t,Al)}const Sl="RelationNavigateToProp\
1271
+ erty";function _l(t){return K.isInstance(t,Sl)}const ts="RelationshipKind";function R8(t){return K.isInstance(t,ts)}const Pl="RelationStringProperty";function xl(t){return K.isInstance(t,Pl)}const Nl="RelationStyleProperty";function dh(t){return K.isInstance(t,Nl)}const Il="ShapeProperty";function fh(t){return K.isInstance(t,Il)}const Ol="ShapeSizeProperty";function dv(t){return K.isInstance(t,Ol)}const ph="SpecificationColor";function hh(t){return K.isInstance(t,ph)}const ya="SpecificationDeplo\
1272
+ ymentNodeKind";function va(t){return K.isInstance(t,ya)}const wa="SpecificationElementKind";function ba(t){return K.isInstance(t,wa)}const Fl="SpecificationElementStringProperty";function fv(t){return K.isInstance(t,Fl)}const Ea="SpecificationRelationshipKind";function $a(t){return K.isInstance(t,Ea)}const Ll="SpecificationRelationshipStringProperty";function DC(t){return K.isInstance(t,Ll)}const Da="SpecificationRule";function RC(t){return K.isInstance(t,Da)}const Ra="SpecificationTag";function mh(t){
1273
+ return K.isInstance(t,Ra)}const gh="StrictFqnElementRef";function pv(t){return K.isInstance(t,gh)}const yh="StrictFqnRef";function kC(t){return K.isInstance(t,yh)}const ns="Tag";function TC(t){return K.isInstance(t,ns)}const vh="Tags";function hv(t){return K.isInstance(t,vh)}const Ml="TextSizeProperty";function mv(t){return K.isInstance(t,Ml)}const gv="ViewRef",Bl="ViewRuleAutoLayout";function ql(t){return K.isInstance(t,Bl)}const jl="ViewRuleGlobalPredicateRef";function yv(t){return K.isInstance(
1274
+ t,jl)}const Gl="ViewRuleGlobalStyle";function vv(t){return K.isInstance(t,Gl)}const Ul="ViewRuleGroup";function wh(t){return K.isInstance(t,Ul)}const Wl="ViewRulePredicate";function zl(t){return K.isInstance(t,Wl)}const Hl="ViewRuleStyle";function ka(t){return K.isInstance(t,Hl)}const Kl="ViewStringProperty";function k8(t){return K.isInstance(t,Kl)}const Vl="WhereBinaryExpression";function T8(t){return K.isInstance(t,Vl)}const Xl="WhereElementKind";function C8(t){return K.isInstance(t,Xl)}const Yl="\
1275
+ WhereElementNegation";function CC(t){return K.isInstance(t,Yl)}const Jl="WhereElementTag";function A8(t){return K.isInstance(t,Jl)}const Ql="WhereRelationKind";function AC(t){return K.isInstance(t,Ql)}const Zl="WhereRelationNegation";function SC(t){return K.isInstance(t,Zl)}const ed="WhereRelationParticipantKind";function _C(t){return K.isInstance(t,ed)}const td="WhereRelationParticipantTag";function PC(t){return K.isInstance(t,td)}const nd="WhereRelationTag";function S8(t){return K.isInstance(t,
1276
+ nd)}const rd="WildcardExpression";function xC(t){return K.isInstance(t,rd)}class NC extends jb{getAllTypes(){return[Wc,Hc,Kc,uo,xp,Np,ki,Ip,mp,Tr,Op,Ti,By,Fp,Lp,Vc,Mp,yp,Xc,Yc,Jc,sa,Bp,Qc,Zc,qp,Qy,Lc,jp,Zn,Gp,Ai,el,so,Wp,tl,rl,il,aa,Hp,nv,jy,Kp,sl,Vp,lo,Xp,Gy,vp,wp,bp,ol,al,Yp,Qp,ul,Uy,ca,la,eh,th,dl,da,fl,es,nh,hl,pl,Si,rh,ih,oo,ml,yl,vl,wl,Ep,pa,ha,zy,ma,El,oh,$l,Dl,Rl,kl,Tl,ta,ch,lh,$p,Rp,kp,Cl,Al,Sl,Mc,Pl,Nl,ts,Tp,Il,Ol,Hy,ph,ya,wa,Fl,Ea,Ll,Da,Ra,gh,yh,na,ra,ns,vh,Ml,Cp,gv,Bc,Bl,jl,Gl,Ul,Wl,
1277
+ Hl,Ap,Kl,Vl,qc,jc,Xl,Yl,Jl,nC,Sp,Gc,Uc,Ql,Zl,ed,td,nd,_p,rd]}computeIsSubtype(e,n){switch(e){case Wc:case ml:return this.isSubtype(Tp,n);case Hc:case El:case Rl:case Il:return this.isSubtype(ra,n);case Kc:return this.isSubtype(Tp,n)||this.isSubtype(ra,n);case ki:case Tr:return this.isSubtype(mp,n)||this.isSubtype(ta,n);case Ti:case Ai:return this.isSubtype(By,n);case Vc:case sa:case aa:return this.isSubtype(oo,n);case Xc:case Yc:return this.isSubtype(yp,n);case Jc:case pl:case hl:case kl:return this.
1278
+ isSubtype($p,n);case Qc:case Zc:return this.isSubtype(Lc,n);case Zn:return this.isSubtype(Uy,n)||this.isSubtype(zy,n)||this.isSubtype(ta,n);case el:case il:case ul:case rd:return this.isSubtype(vp,n);case tl:return this.isSubtype(so,n)||this.isSubtype(na,n);case rl:return this.isSubtype(so,n);case sl:case lo:case ta:return this.isSubtype(Uy,n);case vp:case ol:return this.isSubtype(wp,n);case wp:case al:return this.isSubtype(bp,n);case bp:case kp:return this.isSubtype(jy,n);case fl:return this.isSubtype(
1279
+ so,n)||this.isSubtype(ra,n);case es:return this.isSubtype(zy,n)||this.isSubtype(ta,n);case yl:return this.isSubtype(so,n)||this.isSubtype(Gy,n)||this.isSubtype(Mc,n)||this.isSubtype(Cp,n);case vl:case $l:case Dl:case Fl:case Ll:return this.isSubtype(na,n);case wl:return this.isSubtype(Ep,n);case Ep:return this.isSubtype(so,n)||this.isSubtype(Gy,n)||this.isSubtype(Mc,n);case Tl:case Ol:case Ml:return this.isSubtype(Hy,n)||this.isSubtype(ra,n);case $p:case Cl:return this.isSubtype(Rp,n);case Rp:case Al:
1280
+ return this.isSubtype(kp,n);case Sl:case Nl:return this.isSubtype(Mc,n);case Pl:return this.isSubtype(Mc,n)||this.isSubtype(na,n);case Bl:return this.isSubtype(yp,n)||this.isSubtype(Lc,n)||this.isSubtype(Bc,n);case jl:case Ul:case Wl:return this.isSubtype(Bc,n);case Gl:case Hl:return this.isSubtype(Ap,n);case Ap:return this.isSubtype(Lc,n)||this.isSubtype(Bc,n);case Kl:return this.isSubtype(na,n)||this.isSubtype(Cp,n);case Vl:return this.isSubtype(jc,n)||this.isSubtype(Uc,n);case qc:case Yl:return this.
1281
+ isSubtype(jc,n);case jc:case Uc:return this.isSubtype(nC,n);case Xl:return this.isSubtype(qc,n)||this.isSubtype(Sp,n);case Jl:return this.isSubtype(qc,n)||this.isSubtype(_p,n);case Gc:case Zl:return this.isSubtype(Uc,n);case Ql:case ed:return this.isSubtype(Sp,n)||this.isSubtype(Gc,n);case td:case nd:return this.isSubtype(Gc,n)||this.isSubtype(_p,n);default:return!1}}getReferenceType(e){const n=`${e.container.$type}:${e.property}`;switch(n){case"ColorProperty:customColor":return uo;case"Deployme\
1282
+ ntNode:kind":return Ti;case"DeploymentRelation:kind":case"DynamicViewStep:kind":case"OutgoingRelationExpr:kind":case"Relation:kind":case"WhereRelationKind:value":return ts;case"DynamicViewGlobalPredicateRef:predicate":return ca;case"DynamicViewRef:view":return sa;case"Element:kind":case"ElementKindExpression:kind":return Ai;case"ElementTagExpression:tag":case"Tags:values":case"WhereElementTag:value":case"WhereRelationParticipantTag:value":case"WhereRelationTag:value":return ns;case"ElementViewRe\
1283
+ f:view":return aa;case"FqnRef:value":case"StrictFqnRef:value":return ta;case"IconProperty:libicon":return Si;case"Imported:imported":case"StrictFqnElementRef:el":return Zn;case"ViewRef:view":return oo;case"ViewRuleGlobalPredicateRef:predicate":return la;case"ViewRuleGlobalStyle:style":return dl;case"WhereElementKind:value":case"WhereRelationParticipantKind:value":return By;default:throw new Error(`${n} is not a valid reference id.`)}}getTypeMetaData(e){switch(e){case Wc:return{name:Wc,properties:[
1284
+ {name:"key"},{name:"value"}]};case Hc:return{name:Hc,properties:[{name:"key"},{name:"value"}]};case Kc:return{name:Kc,properties:[{name:"customColor"},{name:"key"},{name:"themeColor"}]};case uo:return{name:uo,properties:[{name:"name"}]};case xp:return{name:xp,properties:[{name:"props",defaultValue:[]}]};case Np:return{name:Np,properties:[{name:"props",defaultValue:[]}]};case ki:return{name:ki,properties:[{name:"body"},{name:"name"},{name:"target"},{name:"title"}]};case Ip:return{name:Ip,properties:[
1285
+ {name:"elements",defaultValue:[]},{name:"props",defaultValue:[]},{name:"tags"}]};case Tr:return{name:Tr,properties:[{name:"body"},{name:"kind"},{name:"name"},{name:"title"}]};case Op:return{name:Op,properties:[{name:"elements",defaultValue:[]},{name:"props",defaultValue:[]},{name:"tags"}]};case Ti:return{name:Ti,properties:[{name:"name"}]};case Fp:return{name:Fp,properties:[{name:"body"},{name:"kind"},{name:"source"},{name:"tags"},{name:"target"},{name:"technology"},{name:"title"}]};case Lp:return{
1286
+ name:Lp,properties:[{name:"props",defaultValue:[]},{name:"tags"}]};case Vc:return{name:Vc,properties:[{name:"body"},{name:"name"}]};case Mp:return{name:Mp,properties:[{name:"props",defaultValue:[]},{name:"rules",defaultValue:[]},{name:"tags"}]};case Xc:return{name:Xc,properties:[{name:"expr"},{name:"isInclude",defaultValue:!1}]};case Yc:return{name:Yc,properties:[{name:"props",defaultValue:[]},{name:"targets"}]};case Jc:return{name:Jc,properties:[{name:"source"},{name:"target"}]};case sa:return{
1287
+ name:sa,properties:[{name:"body"},{name:"name"}]};case Bp:return{name:Bp,properties:[{name:"props",defaultValue:[]},{name:"rules",defaultValue:[]},{name:"steps",defaultValue:[]},{name:"tags"}]};case Qc:return{name:Qc,properties:[{name:"predicate"}]};case Zc:return{name:Zc,properties:[{name:"exprs"}]};case qp:return{name:qp,properties:[{name:"steps",defaultValue:[]}]};case Qy:return{name:Qy,properties:[{name:"view"}]};case jp:return{name:jp,properties:[{name:"custom"},{name:"isBackward",defaultValue:!1},
1288
+ {name:"kind"},{name:"source"},{name:"target"},{name:"title"}]};case Zn:return{name:Zn,properties:[{name:"body"},{name:"kind"},{name:"name"},{name:"props",defaultValue:[]}]};case Gp:return{name:Gp,properties:[{name:"elements",defaultValue:[]},{name:"props",defaultValue:[]},{name:"tags"}]};case Ai:return{name:Ai,properties:[{name:"name"}]};case el:return{name:el,properties:[{name:"isEqual",defaultValue:!1},{name:"kind"}]};case Wp:return{name:Wp,properties:[{name:"modelElement"}]};case tl:return{name:tl,
1289
+ properties:[{name:"key"},{name:"value"}]};case rl:return{name:rl,properties:[{name:"key"},{name:"props",defaultValue:[]}]};case il:return{name:il,properties:[{name:"isEqual",defaultValue:!1},{name:"tag"}]};case aa:return{name:aa,properties:[{name:"body"},{name:"extends"},{name:"name"},{name:"viewOf"}]};case Hp:return{name:Hp,properties:[{name:"props",defaultValue:[]},{name:"rules",defaultValue:[]},{name:"tags"}]};case nv:return{name:nv,properties:[{name:"view"}]};case Kp:return{name:Kp,properties:[
1290
+ {name:"prev"},{name:"value"}]};case sl:return{name:sl,properties:[{name:"body"},{name:"deploymentNode"}]};case Vp:return{name:Vp,properties:[{name:"elements",defaultValue:[]},{name:"props",defaultValue:[]},{name:"tags"}]};case lo:return{name:lo,properties:[{name:"body"},{name:"element"}]};case Xp:return{name:Xp,properties:[{name:"elements",defaultValue:[]},{name:"props",defaultValue:[]},{name:"tags"}]};case Yp:return{name:Yp,properties:[{name:"prev"},{name:"value"}]};case ol:return{name:ol,properties:[
1291
+ {name:"subject"},{name:"where"}]};case al:return{name:al,properties:[{name:"custom"},{name:"subject"}]};case Qp:return{name:Qp,properties:[{name:"parent"},{name:"value"}]};case ul:return{name:ul,properties:[{name:"ref"},{name:"selector"}]};case ca:return{name:ca,properties:[{name:"name"},{name:"predicates",defaultValue:[]}]};case la:return{name:la,properties:[{name:"name"},{name:"predicates",defaultValue:[]}]};case da:return{name:da,properties:[{name:"name"},{name:"predicates",defaultValue:[]},{
1292
+ name:"styles",defaultValue:[]}]};case eh:return{name:eh,properties:[{name:"id"},{name:"props",defaultValue:[]},{name:"target"}]};case th:return{name:th,properties:[{name:"id"},{name:"styles",defaultValue:[]}]};case dl:return{name:dl,properties:[{name:"name"}]};case fl:return{name:fl,properties:[{name:"key"},{name:"libicon"},{name:"value"}]};case es:return{name:es,properties:[{name:"imported"},{name:"prev"}]};case nh:return{name:nh,properties:[{name:"imports"},{name:"project"}]};case pl:return{name:pl,
1293
+ properties:[{name:"to"}]};case hl:return{name:hl,properties:[{name:"inout"}]};case Si:return{name:Si,properties:[{name:"name"}]};case rh:return{name:rh,properties:[{name:"deployments",defaultValue:[]},{name:"globals",defaultValue:[]},{name:"imports",defaultValue:[]},{name:"likec4lib",defaultValue:[]},{name:"models",defaultValue:[]},{name:"specifications",defaultValue:[]},{name:"views",defaultValue:[]}]};case ih:return{name:ih,properties:[{name:"icons",defaultValue:[]}]};case ml:return{name:ml,properties:[
1294
+ {name:"key"},{name:"value"}]};case yl:return{name:yl,properties:[{name:"key"},{name:"title"},{name:"value"}]};case vl:return{name:vl,properties:[{name:"key"},{name:"value"}]};case wl:return{name:wl,properties:[{name:"props",defaultValue:[]}]};case pa:return{name:pa,properties:[{name:"elements",defaultValue:[]},{name:"name"}]};case ha:return{name:ha,properties:[{name:"elements",defaultValue:[]},{name:"name"}]};case ma:return{name:ma,properties:[{name:"name"},{name:"styles",defaultValue:[]},{name:"\
1295
+ views",defaultValue:[]}]};case El:return{name:El,properties:[{name:"key"},{name:"value"}]};case oh:return{name:oh,properties:[{name:"key"},{name:"value"}]};case $l:return{name:$l,properties:[{name:"key"},{name:"value"}]};case Dl:return{name:Dl,properties:[{name:"key"},{name:"value"}]};case Rl:return{name:Rl,properties:[{name:"key"},{name:"value"}]};case kl:return{name:kl,properties:[{name:"from"},{name:"isBidirectional",defaultValue:!1},{name:"kind"}]};case Tl:return{name:Tl,properties:[{name:"k\
1296
+ ey"},{name:"value"}]};case ch:return{name:ch,properties:[{name:"body"},{name:"kind"},{name:"source"},{name:"tags"},{name:"target"},{name:"technology"},{name:"title"}]};case lh:return{name:lh,properties:[{name:"props",defaultValue:[]},{name:"tags"}]};case Cl:return{name:Cl,properties:[{name:"subject"},{name:"where"}]};case Al:return{name:Al,properties:[{name:"custom"},{name:"subject"}]};case Sl:return{name:Sl,properties:[{name:"key"},{name:"value"}]};case ts:return{name:ts,properties:[{name:"name"}]};case Pl:
1297
+ return{name:Pl,properties:[{name:"key"},{name:"value"}]};case Nl:return{name:Nl,properties:[{name:"key"},{name:"props",defaultValue:[]}]};case Il:return{name:Il,properties:[{name:"key"},{name:"value"}]};case Ol:return{name:Ol,properties:[{name:"key"},{name:"value"}]};case ph:return{name:ph,properties:[{name:"color"},{name:"name"}]};case ya:return{name:ya,properties:[{name:"kind"},{name:"props",defaultValue:[]}]};case wa:return{name:wa,properties:[{name:"kind"},{name:"props",defaultValue:[]}]};case Fl:
1298
+ return{name:Fl,properties:[{name:"key"},{name:"value"}]};case Ea:return{name:Ea,properties:[{name:"kind"},{name:"props",defaultValue:[]}]};case Ll:return{name:Ll,properties:[{name:"key"},{name:"value"}]};case Da:return{name:Da,properties:[{name:"colors",defaultValue:[]},{name:"deploymentNodes",defaultValue:[]},{name:"elements",defaultValue:[]},{name:"name"},{name:"relationships",defaultValue:[]},{name:"tags",defaultValue:[]}]};case Ra:return{name:Ra,properties:[{name:"tag"}]};case gh:return{name:gh,
1299
+ properties:[{name:"el"},{name:"parent"}]};case yh:return{name:yh,properties:[{name:"parent"},{name:"value"}]};case ns:return{name:ns,properties:[{name:"name"}]};case vh:return{name:vh,properties:[{name:"prev"},{name:"values",defaultValue:[]}]};case Ml:return{name:Ml,properties:[{name:"key"},{name:"value"}]};case gv:return{name:gv,properties:[{name:"view"}]};case Bl:return{name:Bl,properties:[{name:"direction"},{name:"nodeSep"},{name:"rankSep"}]};case jl:return{name:jl,properties:[{name:"predicat\
1300
+ e"}]};case Gl:return{name:Gl,properties:[{name:"style"}]};case Ul:return{name:Ul,properties:[{name:"groupRules",defaultValue:[]},{name:"props",defaultValue:[]},{name:"title"}]};case Wl:return{name:Wl,properties:[{name:"exprs"},{name:"isInclude",defaultValue:!1}]};case Hl:return{name:Hl,properties:[{name:"props",defaultValue:[]},{name:"target"}]};case Kl:return{name:Kl,properties:[{name:"key"},{name:"value"}]};case Vl:return{name:Vl,properties:[{name:"left"},{name:"operator"},{name:"right"}]};case Xl:
1301
+ return{name:Xl,properties:[{name:"not",defaultValue:!1},{name:"operator"},{name:"value"}]};case Yl:return{name:Yl,properties:[{name:"value"}]};case Jl:return{name:Jl,properties:[{name:"not",defaultValue:!1},{name:"operator"},{name:"value"}]};case Ql:return{name:Ql,properties:[{name:"not",defaultValue:!1},{name:"operator"},{name:"value"}]};case Zl:return{name:Zl,properties:[{name:"value"}]};case ed:return{name:ed,properties:[{name:"not",defaultValue:!1},{name:"operator"},{name:"participant"},{name:"\
1302
+ value"}]};case td:return{name:td,properties:[{name:"not",defaultValue:!1},{name:"operator"},{name:"participant"},{name:"value"}]};case nd:return{name:nd,properties:[{name:"not",defaultValue:!1},{name:"operator"},{name:"value"}]};case rd:return{name:rd,properties:[{name:"isWildcard",defaultValue:!1}]};default:return{name:e,properties:[]}}}}const K=new NC;let IC;const _8=()=>IC??(IC=Zj(`{"$type":"Grammar","isDeclared":true,"name":"LikeC4","rules":[{"$type":"ParserRule","entry":true,"name":"LikeC4G\
1303
+ rammar","definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"imports","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Assignment","feature":"specifications","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}},{"$type":"Assignment","feature":"models","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Assignment","feature":"\
1304
+ views","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}},{"$type":"Assignment","feature":"globals","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@110"},"arguments":[]}},{"$type":"Assignment","feature":"deployments","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@96"},"arguments":[]}},{"$type":"Assignment","feature":"likec4lib","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"argum\
1305
+ ents":[]}}],"cardinality":"*"},"definesHiddenTokens":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"LikeC4Lib","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"likec4lib"},{"$type":"Keyword","value":"{"},{"$type":"Keyword","value":"icons"},{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"icons","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]},"cardinality":"+"}\
1306
+ ,{"$type":"Keyword","value":"}"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"LibIcon","definition":{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@140"},"arguments":[]}},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name\
1307
+ ":"ElementKind","definition":{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@145"},"arguments":[]}},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Tag","definition":{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@145"},"arguments":[]}},"definesHiddenTokens":false,"entry":false,"fragm\
1308
+ ent":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"RelationshipKind","definition":{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@145"},"arguments":[]}},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"CustomColor","definition":{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Ru\
1309
+ leCall","rule":{"$ref":"#/rules@144"},"arguments":[]}},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DeploymentNodeKind","definition":{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@145"},"arguments":[]}},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name"\
1310
+ :"SpecificationRule","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"specification"}},{"$type":"Keyword","value":"{"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"argument\
1311
+ s":[]}},{"$type":"Assignment","feature":"relationships","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Assignment","feature":"colors","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}},{"$type":"Assignment","feature":"deploymentNodes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}}],"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens\
1312
+ ":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"SpecificationElementKind","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"element"},{"$type":"Assignment","feature":"kind","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"Alter\
1313
+ natives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@129"},"arguments":[]}]},"cardinality":"*"},{"$type":"Keyword","value":"}"}],"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"SpecificationElementStringProperty","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"key","operator":"=","\
1314
+ terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"technology"},{"$type":"Keyword","value":"notation"}]}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@163"},"arguments":[]}},{"$type":"Keyword","value":";","cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","na\
1315
+ me":"SpecificationDeploymentNodeKind","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"deploymentNode"},{"$type":"Assignment","feature":"kind","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]},{"$type":"RuleCa\
1316
+ ll","rule":{"$ref":"#/rules@129"},"arguments":[]}]},"cardinality":"*"},{"$type":"Keyword","value":"}"}],"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"SpecificationTag","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"tag"},{"$type":"Assignment","feature":"tag","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}}]},"definesH\
1317
+ iddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"SpecificationColor","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"color"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"color","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@139"},"arguments":[]}}]},"defi\
1318
+ nesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"SpecificationRelationshipKind","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"relationship"},{"$type":"Assignment","feature":"kind","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"props","operator":"+=","\
1319
+ terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@132"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}]},"cardinality":"*"},{"$type":"Keyword","value":"}"}],"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"SpecificationRelationshipStringProperty","definition":{"$type":"Group","elements":[{"$type":"Assignment","f\
1320
+ eature":"key","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"technology"},{"$type":"Keyword","value":"notation"}]}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@163"},"arguments":[]}},{"$type":"Keyword","value":";","cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":fa\
1321
+ lse},{"$type":"ParserRule","name":"ImportsFromPoject","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"import"},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"imports","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}},{"$type":"Keyword","value":"}"}]},{"$type":"Assignment","feature":"imports","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref"\
1322
+ :"#/rules@17"},"arguments":[]}}]},{"$type":"Keyword","value":"from"},{"$type":"Assignment","feature":"project","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@163"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Imported","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"imported","operator":"=","terminal":{"$type":"CrossReference","type"\
1323
+ :{"$ref":"#/rules@20"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@145"},"arguments":[]},"deprecatedSyntax":false}},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"Imported"},"feature":"prev","operator":"="},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"imported","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@20"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@145"},"arguments":[]},"d\
1324
+ eprecatedSyntax":false}}],"cardinality":"*"},{"$type":"Keyword","value":";","cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Tags","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"values","operator":"+=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@4"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@142"},"arguments":[]},"deprecatedSynt\
1325
+ ax":false},"cardinality":"+"},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"Tags"},"feature":"prev","operator":"="},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"values","operator":"+=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@4"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@142"},"arguments":[]},"deprecatedSyntax":false},"cardinality":"*"}],"cardinality":"*"},{"$type":"Keyword","value":";","cardinal\
1326
+ ity":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Model","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"model"}},{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"argument\
1327
+ s":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@31"},"arguments":[{"$type":"NamedArgument","value":{"$type":"BooleanLiteral","true":true},"calledByName":false}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Element","definition":{"$type":"Group","elements":[{"$type":"Alternatives"\
1328
+ ,"elements":[{"$type":"Group","elements":[{"$type":"Assignment","feature":"kind","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@3"},"deprecatedSyntax":false}},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@145"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@145"},"arguments":[]}},{"$type":"RuleCal\
1329
+ l","rule":{"$ref":"#/rules@161"},"arguments":[]},{"$type":"Assignment","feature":"kind","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@3"},"deprecatedSyntax":false}}]}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@163"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rule\
1330
+ s@163"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@163"},"arguments":[]}},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@163"},"arguments":[]},"cardinality":"?"}],"cardinality":"?"}],"cardinality":"?"}],"cardinality":"?"},{"$type":"Assignment","feature":"body","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":\
1331
+ "#/rules@21"},"arguments":[]},"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ElementBody","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"tags","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$ty\
1332
+ pe":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]},"cardinality":"*"},{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@31"},"arguments":[{"$type":"NamedArgument","value":{"$type":"BooleanLiteral","true":false},"calledByName":false}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":\
1333
+ false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ElementProperty","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@129"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@116"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@120"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@36"},"arguments":[]}]}\
1334
+ ,"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ElementStringProperty","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"key","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"title"},{"$type":"Keyword","value":"technology"},{"$type":"Keyword","value":"description"}]}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment"\
1335
+ ,"feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@163"},"arguments":[]}},{"$type":"Keyword","value":";","cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ExtendElement","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"extend"},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref\
1336
+ ":"#/rules@28"},"arguments":[]}},{"$type":"Assignment","feature":"body","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@25"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ExtendElementBody","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"tags","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":\
1337
+ "#/rules@18"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@26"},"arguments":[]},"cardinality":"*"},{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@31"},"arguments":[{"$type":"NamedArgument","value":{"$type":"BooleanLiteral","true":true},"calledByName":false}]},{"$type":"RuleCall","rule":{"$ref":"\
1338
+ #/rules@20"},"arguments":[]}]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ExtendElementProperty","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@116"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@36"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenToke\
1339
+ ns":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ElementRef","definition":{"$type":"Assignment","feature":"modelElement","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]}},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"StrictFqnElementRef","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"el","operator":"=","terminal\
1340
+ ":{"$type":"CrossReference","type":{"$ref":"#/rules@20"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@145"},"arguments":[]},"deprecatedSyntax":false}},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"StrictFqnElementRef"},"feature":"parent","operator":"="},{"$type":"RuleCall","rule":{"$ref":"#/rules@158"},"arguments":[]},{"$type":"Assignment","feature":"el","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@20"},"ter\
1341
+ minal":{"$type":"RuleCall","rule":{"$ref":"#/rules@145"},"arguments":[]},"deprecatedSyntax":false}}],"cardinality":"*"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"FqnRef","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/types@1"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@145"},"argum\
1342
+ ents":[]},"deprecatedSyntax":false}},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"FqnRef"},"feature":"parent","operator":"="},{"$type":"RuleCall","rule":{"$ref":"#/rules@158"},"arguments":[]},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/types@1"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@145"},"arguments":[]},"deprecatedSyntax":false}}],"cardinality":"*"}]},"definesHidde\
1343
+ nTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"StrictFqnRef","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/types@1"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@145"},"arguments":[]},"deprecatedSyntax":false}},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name"\
1344
+ :"StrictFqnRef"},"feature":"parent","operator":"="},{"$type":"RuleCall","rule":{"$ref":"#/rules@158"},"arguments":[]},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/types@1"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@145"},"arguments":[]},"deprecatedSyntax":false}}],"cardinality":"*"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","na\
1345
+ me":"Relation","parameters":[{"$type":"Parameter","name":"isExplicit"}],"definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Group","guardCondition":{"$type":"ParameterReference","parameter":{"$ref":"#/rules@31/parameters@0"}},"elements":[{"$type":"Assignment","feature":"source","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]}}]},{"$type":"Group","guardCondition":{"$type":"Negation","value":{"$type":"ParameterReference"\
1346
+ ,"parameter":{"$ref":"#/rules@31/parameters@0"}}},"elements":[{"$type":"Assignment","feature":"source","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]},"cardinality":"?"}]}]},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"kind","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@5"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@143"},"arguments":[]},"deprecatedSyntax":false}},{"$type":"Group","elemen\
1347
+ ts":[{"$type":"Keyword","value":"-["},{"$type":"Assignment","feature":"kind","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@5"},"deprecatedSyntax":false}},{"$type":"Keyword","value":"]->"}]},{"$type":"Keyword","value":"->"}]},{"$type":"Assignment","feature":"target","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCal\
1348
+ l","rule":{"$ref":"#/rules@163"},"arguments":[]}},{"$type":"Assignment","feature":"technology","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@163"},"arguments":[]},"cardinality":"?"}],"cardinality":"?"},{"$type":"Assignment","feature":"tags","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"body","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@32"},"arguments"\
1349
+ :[]},"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"wildcard":false},{"$type":"ParserRule","name":"RelationBody","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"tags","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3\
1350
+ 3"},"arguments":[]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"RelationProperty","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@34"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@69"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@35"},"arguments":[]},{"$type":"RuleCall","rul\
1351
+ e":{"$ref":"#/rules@116"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@36"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"RelationStringProperty","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"key","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"title"},{"$type":"Keyword","value":"technology"},{"$type\
1352
+ ":"Keyword","value":"description"}]}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@163"},"arguments":[]}},{"$type":"Keyword","value":";","cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"RelationStyleProperty","definition":{"$type":"Group","elements":[{"$type":"Assignment"\
1353
+ ,"feature":"key","operator":"=","terminal":{"$type":"Keyword","value":"style"}},{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@132"},"arguments":[]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"MetadataProperty","definition":{"$type":"Group","elements":[{\
1354
+ "$type":"Keyword","value":"metadata"},{"$type":"RuleCall","rule":{"$ref":"#/rules@37"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"MetadataBody","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@38"},"arguments":[]},"cardinality":"*"},{"$type":"Keywo\
1355
+ rd","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"MetadataAttribute","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"key","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@164"},"arguments":[]}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$re\
1356
+ f":"#/rules@163"},"arguments":[]}},{"$type":"Keyword","value":";","cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ModelViews","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"views"}},{"$type":"Keyword","value":"{"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"views","operato\
1357
+ r":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@40"},"arguments":[]}},{"$type":"Assignment","feature":"styles","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@62"},"arguments":[]}}],"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"LikeC4ViewRule","returnType":{"$ref":"#/types@2"},"definition":{"$type":"Alternatives"\
1358
+ ,"elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@42"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@105"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ElementView","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"view"},{"$type":"Assignment","feature":"name","operator":"=","ter\
1359
+ minal":{"$type":"RuleCall","rule":{"$ref":"#/rules@145"},"arguments":[]},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"extends"},{"$type":"Assignment","feature":"extends","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@44"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"of"},{"$type":"Assignment","feature":"viewOf","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/ru\
1360
+ les@27"},"arguments":[]}}]}],"cardinality":"?"},{"$type":"Assignment","feature":"body","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@46"},"arguments":[]},"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DynamicView","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"dynamic"},{"$type":"Keyword","value":"view"},{"$type":"Assignment","feature":\
1361
+ "name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@145"},"arguments":[]}},{"$type":"Assignment","feature":"body","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@47"},"arguments":[]},"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ViewRef","definition":{"$type":"Assignment","feature":"view","operator":"=","terminal":{"$type":"CrossRefere\
1362
+ nce","type":{"$ref":"#/types@2"},"deprecatedSyntax":false}},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ElementViewRef","definition":{"$type":"Assignment","feature":"view","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@41"},"deprecatedSyntax":false}},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"Pa\
1363
+ rserRule","name":"DynamicViewRef","definition":{"$type":"Assignment","feature":"view","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@42"},"deprecatedSyntax":false}},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ElementViewBody","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"tags","operator":"=","terminal":{"$type":\
1364
+ "RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]},"cardinality":"*"},{"$type":"Assignment","feature":"rules","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters"\
1365
+ :[],"wildcard":false},{"$type":"ParserRule","name":"DynamicViewBody","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"tags","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]},"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Assignment"\
1366
+ ,"feature":"steps","operator":"+=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@54"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[]}]}},{"$type":"Assignment","feature":"rules","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@53"},"arguments":[]}}],"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wild\
1367
+ card":false},{"$type":"ParserRule","name":"ViewProperty","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@49"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@116"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ViewStringProperty","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"key","operator":"=","term\
1368
+ inal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"title"},{"$type":"Keyword","value":"description"}]}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@163"},"arguments":[]}},{"$type":"Keyword","value":";","cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"V\
1369
+ iewLayoutDirection","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"TopBottom"},{"$type":"Keyword","value":"LeftRight"},{"$type":"Keyword","value":"BottomTop"},{"$type":"Keyword","value":"RightLeft"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ViewRule","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@56"},\
1370
+ "arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@57"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@52"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@62"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@63"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ViewRuleGroup","definition":{"$type":"Group","elements":[{"$type":"Keyword","valu\
1371
+ e":"group"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@163"},"arguments":[]},"cardinality":"?"},{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@117"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@123"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@118"},"arguments":[]}]},"c\
1372
+ ardinality":"*"},{"$type":"Assignment","feature":"groupRules","operator":"+=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@56"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@52"},"arguments":[]}]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DynamicViewRule","definition":{"$type":"Alternati\
1373
+ ves","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@58"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@59"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@62"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@63"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DynamicViewParallelSteps","definition":{"$type":"Group","elements":[{"$type":"Al\
1374
+ ternatives","elements":[{"$type":"Keyword","value":"parallel"},{"$type":"Keyword","value":"par"}]},{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"steps","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DynamicViewStep","definition":{"$type":"Gro\
1375
+ up","elements":[{"$type":"Assignment","feature":"source","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@27"},"arguments":[]}},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"isBackward","operator":"?=","terminal":{"$type":"Keyword","value":"<-"}},{"$type":"Keyword","value":"->"},{"$type":"Group","elements":[{"$type":"Keyword","value":"-["},{"$type":"Assignment","feature":"kind","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules\
1376
+ @5"},"deprecatedSyntax":false}},{"$type":"Keyword","value":"]->"}]},{"$type":"Assignment","feature":"kind","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@5"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@143"},"arguments":[]},"deprecatedSyntax":false}}]},{"$type":"Assignment","feature":"target","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@27"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type"\
1377
+ :"RuleCall","rule":{"$ref":"#/rules@163"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"custom","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@67"},"arguments":[]},"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ViewRulePredicate","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":\
1378
+ "isInclude","operator":"?=","terminal":{"$type":"Keyword","value":"include"}},{"$type":"Keyword","value":"exclude"}]},{"$type":"Assignment","feature":"exprs","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@70"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ViewRuleGlobalPredicateRef","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"global"},\
1379
+ {"$type":"Keyword","value":"predicate"},{"$type":"Assignment","feature":"predicate","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@111"},"deprecatedSyntax":false}}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DynamicViewIncludePredicate","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"include"},{"$type":"Assignment","feature":"exprs","operator":"=",\
1380
+ "terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@70"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DynamicViewGlobalPredicateRef","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"global"},{"$type":"Keyword","value":"predicate"},{"$type":"Assignment","feature":"predicate","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@112"},"dep\
1381
+ recatedSyntax":false}}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ViewRuleStyle","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"style"},{"$type":"Assignment","feature":"target","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@83"},"arguments":[]}},{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":\
1382
+ "Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@128"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@64"},"arguments":[]}]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ViewRuleGlobalStyle","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"global"},{"$type":"Keyword","value":"style"},{"$type":"\
1383
+ Assignment","feature":"style","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@113"},"deprecatedSyntax":false}}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ViewRuleStyleOrGlobalRef","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@60"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@61"},"arguments":[]}]},"definesHid\
1384
+ denTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ViewRuleAutoLayout","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"autoLayout"},{"$type":"Assignment","feature":"direction","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Assignment","feature":"rankSep","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref"\
1385
+ :"#/rules@165"},"arguments":[]}},{"$type":"Assignment","feature":"nodeSep","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@165"},"arguments":[]},"cardinality":"?"}],"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"NotationProperty","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"key","operator":"=","terminal":{"$type":"Keyword","value":\
1386
+ "notation"}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@163"},"arguments":[]}},{"$type":"Keyword","value":";","cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"NotesProperty","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"key","operator":"=","\
1387
+ terminal":{"$type":"Keyword","value":"notes"}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@163"},"arguments":[]}},{"$type":"Keyword","value":";","cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"CustomElementProperties","definition":{"$type":"Group","elements":[{"$type":"\
1388
+ Keyword","value":"{"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@68"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@64"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@128"},"arguments":[]}]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,\
1389
+ "hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"CustomRelationProperties","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@69"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@34"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@64"},"arguments":[]},{"$type":"RuleCall",\
1390
+ "rule":{"$ref":"#/rules@65"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@132"},"arguments":[]}]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"NavigateToProperty","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"key","operator":"=","terminal":{"$type":"Keyword","value":"navigateTo"}},{"$type":"Assignment","fe\
1391
+ ature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@43"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"RelationNavigateToProperty","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"key","operator":"=","terminal":{"$type":"Keyword","value":"navigateTo"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type"\
1392
+ :"RuleCall","rule":{"$ref":"#/rules@45"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Expressions","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@71"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"Expressions"},"fea\
1393
+ ture":"prev","operator":"="},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@71"},"arguments":[]},"cardinality":"?"}],"cardinality":"*"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ExpressionV2","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@74"},"arguments":[]\
1394
+ },{"$type":"RuleCall","rule":{"$ref":"#/rules@72"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"FqnExprOrWith","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@73"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"FqnExprWith"},"feature":"subject","operator":"="},{"$type":"Keyword","valu\
1395
+ e":"with"},{"$type":"Assignment","feature":"custom","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@66"},"arguments":[]},"cardinality":"?"}],"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"FqnExprOrWhere","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@76"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Action","infe\
1396
+ rredType":{"$type":"InferredType","name":"FqnExprWhere"},"feature":"subject","operator":"="},{"$type":"Keyword","value":"where"},{"$type":"Assignment","feature":"where","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@84"},"arguments":[]},"cardinality":"?"}],"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"RelationExprOrWith","definition":{"$type":"Group","element\
1397
+ s":[{"$type":"RuleCall","rule":{"$ref":"#/rules@75"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"RelationExprWith"},"feature":"subject","operator":"="},{"$type":"Keyword","value":"with"},{"$type":"Assignment","feature":"custom","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@67"},"arguments":[]},"cardinality":"?"}],"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":\
1398
+ [],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"RelationExprOrWhere","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@78"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"RelationExprWhere"},"feature":"subject","operator":"="},{"$type":"Keyword","value":"where"},{"$type":"Assignment","feature":"where","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@90"},"arg\
1399
+ uments":[]},"cardinality":"?"}],"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"FqnExpr","definition":{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"WildcardExpression"}},{"$type":"Assignment","feature":"isWildcard","operator":"?=","terminal":{"$type":"Keyword","value":"*"}}]},{"$type":"Group","element\
1400
+ s":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"ElementTagExpression"}},{"$type":"Keyword","value":"element.tag"},{"$type":"RuleCall","rule":{"$ref":"#/rules@147"},"arguments":[]},{"$type":"Assignment","feature":"tag","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@4"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@142"},"arguments":[]},"deprecatedSyntax":false},"cardinality":"?"}]},{"$type":"Group","elements":[{"$type":"Action","inferredT\
1401
+ ype":{"$type":"InferredType","name":"ElementKindExpression"}},{"$type":"Keyword","value":"element.kind"},{"$type":"RuleCall","rule":{"$ref":"#/rules@147"},"arguments":[]},{"$type":"Assignment","feature":"kind","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@3"},"deprecatedSyntax":false},"cardinality":"?"}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@77"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wi\
1402
+ ldcard":false},{"$type":"ParserRule","name":"FqnRefExpr","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"ref","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]}},{"$type":"Assignment","feature":"selector","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@155"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@156"},"arguments":[]}]},"cardinality":"?"}]},"definesHid\
1403
+ denTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"RelationExpr","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@79"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@81"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"InOutRelationExpr","inferredType":\
1404
+ {"$type":"InferredType","name":"RelationExpr"},"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@80"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"InOutRelationExpr"},"feature":"inout","operator":"="},{"$type":"Keyword","value":"->"}],"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"In\
1405
+ comingRelationExpr","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"->"},{"$type":"Assignment","feature":"to","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@76"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DirectedRelationExpr","inferredType":{"$type":"InferredType","name":"RelationExpr"},"definition":{"$type":"Group","elements":[{"$type\
1406
+ ":"RuleCall","rule":{"$ref":"#/rules@82"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"DirectedRelationExpr"},"feature":"source","operator":"="},{"$type":"Assignment","feature":"target","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@76"},"arguments":[]}}],"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","n\
1407
+ ame":"OutgoingRelationExpr","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"from","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@76"},"arguments":[]}},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"isBidirectional","operator":"?=","terminal":{"$type":"Keyword","value":"<->"}},{"$type":"Keyword","value":"->"},{"$type":"Group","elements":[{"$type":"Keyword","value":"-["},{"$type":"Assignment","feature":"kind","operator":"=","t\
1408
+ erminal":{"$type":"CrossReference","type":{"$ref":"#/rules@5"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@145"},"arguments":[]},"deprecatedSyntax":false}},{"$type":"Keyword","value":"]->"}]},{"$type":"Assignment","feature":"kind","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@5"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@143"},"arguments":[]},"deprecatedSyntax":false}}]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenToke\
1409
+ ns":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"FqnExpressions","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@76"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"FqnExpressions"},"feature":"prev","operator":"="},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"value","operator":"=","termina\
1410
+ l":{"$type":"RuleCall","rule":{"$ref":"#/rules@76"},"arguments":[]},"cardinality":"?"}],"cardinality":"*"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"WhereElementExpression","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@85"},"arguments":[]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"WhereEl\
1411
+ ementOr","inferredType":{"$type":"InferredType","name":"WhereElementExpression"},"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@86"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"WhereBinaryExpression"},"feature":"left","operator":"="},{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"or"}},{"$type":"Assignment","feature":"right","operator":"=","te\
1412
+ rminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@86"},"arguments":[]}}],"cardinality":"*"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"WhereElementAnd","inferredType":{"$type":"InferredType","name":"WhereElementExpression"},"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@87"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$ty\
1413
+ pe":"InferredType","name":"WhereBinaryExpression"},"feature":"left","operator":"="},{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"and"}},{"$type":"Assignment","feature":"right","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@87"},"arguments":[]}}],"cardinality":"*"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"WhereElementPrima\
1414
+ ry","inferredType":{"$type":"InferredType","name":"WhereElementExpression"},"definition":{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"RuleCall","rule":{"$ref":"#/rules@84"},"arguments":[]},{"$type":"Keyword","value":")"}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@88"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@89"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"param\
1415
+ eters":[],"wildcard":false},{"$type":"ParserRule","name":"WhereElementNegation","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"not"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@84"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"WhereElement","definition":{"$type":"Alternatives","elements":[{"$typ\
1416
+ e":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"WhereElementTag"}},{"$type":"Keyword","value":"tag"},{"$type":"RuleCall","rule":{"$ref":"#/rules@146"},"arguments":[]},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@4"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@142"},"arguments":[]},"deprecatedSyntax":false},"cardinality":"?"}]},{"$type":"Group","elements":[{"$type":"Action","i\
1417
+ nferredType":{"$type":"InferredType","name":"WhereElementKind"}},{"$type":"Keyword","value":"kind"},{"$type":"RuleCall","rule":{"$ref":"#/rules@146"},"arguments":[]},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/types@4"},"deprecatedSyntax":false},"cardinality":"?"}]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"WhereRelationExpression"\
1418
+ ,"definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@91"},"arguments":[]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"WhereRelationOr","inferredType":{"$type":"InferredType","name":"WhereRelationExpression"},"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@92"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredTyp\
1419
+ e","name":"WhereBinaryExpression"},"feature":"left","operator":"="},{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"or"}},{"$type":"Assignment","feature":"right","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@92"},"arguments":[]}}],"cardinality":"*"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"WhereRelationAnd","inferredType":{\
1420
+ "$type":"InferredType","name":"WhereRelationExpression"},"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@93"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"WhereBinaryExpression"},"feature":"left","operator":"="},{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"and"}},{"$type":"Assignment","feature":"right","operator":"=","terminal":{"$type":"RuleC\
1421
+ all","rule":{"$ref":"#/rules@93"},"arguments":[]}}],"cardinality":"*"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"WhereRelationPrimary","inferredType":{"$type":"InferredType","name":"WhereRelationExpression"},"definition":{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"RuleCall","rule":{"$ref":"#/rules@90"},"arguments":[]},{"$type":"Keywor\
1422
+ d","value":")"}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@94"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@95"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"WhereRelationNegation","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"not"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@\
1423
+ 90"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"WhereRelation","definition":{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"WhereRelationTag"}},{"$type":"Keyword","value":"tag"},{"$type":"RuleCall","rule":{"$ref":"#/rules@146"},"arguments":[]},{"$type":"Assignment","feature":"value","operator":"=","t\
1424
+ erminal":{"$type":"CrossReference","type":{"$ref":"#/rules@4"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@142"},"arguments":[]},"deprecatedSyntax":false},"cardinality":"?"}]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"WhereRelationKind"}},{"$type":"Keyword","value":"kind"},{"$type":"RuleCall","rule":{"$ref":"#/rules@146"},"arguments":[]},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"CrossReference","type\
1425
+ ":{"$ref":"#/rules@5"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@145"},"arguments":[]},"deprecatedSyntax":false},"cardinality":"?"}]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"WhereRelationParticipantTag"}},{"$type":"Assignment","feature":"participant","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@138"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@158"},"arguments":[]},{"$type":"Keyword","val\
1426
+ ue":"tag"},{"$type":"RuleCall","rule":{"$ref":"#/rules@146"},"arguments":[]},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@4"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@142"},"arguments":[]},"deprecatedSyntax":false},"cardinality":"?"}]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"WhereRelationParticipantKind"}},{"$type":"Assignment","feature":"participant","operat\
1427
+ or":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@138"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@158"},"arguments":[]},{"$type":"Keyword","value":"kind"},{"$type":"RuleCall","rule":{"$ref":"#/rules@146"},"arguments":[]},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/types@4"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@145"},"arguments":[]},"deprecatedSyntax":false},"cardinality":"?"}]}]},"\
1428
+ definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ModelDeployments","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"deployment"}},{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@97"},"argum\
1429
+ ents":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@103"},"arguments":[{"$type":"NamedArgument","value":{"$type":"BooleanLiteral","true":true},"calledByName":false}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@101"},"arguments":[]}]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DeploymentNode","definition":{"$type":"Group","elements":[{"$type":"A\
1430
+ lternatives","elements":[{"$type":"Group","elements":[{"$type":"Assignment","feature":"kind","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@7"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@145"},"arguments":[]},"deprecatedSyntax":false}},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@145"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","termi\
1431
+ nal":{"$type":"RuleCall","rule":{"$ref":"#/rules@145"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@161"},"arguments":[]},{"$type":"Assignment","feature":"kind","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@7"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@145"},"arguments":[]},"deprecatedSyntax":false}}]}]},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@163"},"arguments":[]},"ca\
1432
+ rdinality":"?"},{"$type":"Assignment","feature":"body","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@98"},"arguments":[]},"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DeploymentNodeBody","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"tags","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref\
1433
+ ":"#/rules@18"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]},"cardinality":"*"},{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@99"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@103"},"arguments":[{"$type":"NamedArgument","value":{"$type":"BooleanLiteral","true\
1434
+ ":false},"calledByName":false}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@97"},"arguments":[]}]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DeployedInstance","definition":{"$type":"Group","elements":[{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@145"},"a\
1435
+ rguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@161"},"arguments":[]}],"cardinality":"?"},{"$type":"Keyword","value":"instanceOf"},{"$type":"Assignment","feature":"target","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@27"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@163"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"body","operator":"=","terminal":{"$type":\
1436
+ "RuleCall","rule":{"$ref":"#/rules@100"},"arguments":[]},"cardinality":"?"},{"$type":"Keyword","value":";","cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DeployedInstanceBody","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"tags","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]},"card\
1437
+ inality":"?"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]},"cardinality":"*"},{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@103"},"arguments":[{"$type":"NamedArgument","value":{"$type":"BooleanLiteral","true":false},"calledByName":false}]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment"\
1438
+ :false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ExtendDeployment","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"extend"},{"$type":"Assignment","feature":"deploymentNode","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@30"},"arguments":[]}},{"$type":"Assignment","feature":"body","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@102"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":fal\
1439
+ se,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ExtendDeploymentBody","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"tags","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@26"},"arguments":[]},"cardinality":"*"},{"\
1440
+ $type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@99"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@103"},"arguments":[{"$type":"NamedArgument","value":{"$type":"BooleanLiteral","true":true},"calledByName":false}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@97"},"arguments":[]}]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment"\
1441
+ :false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DeploymentRelation","parameters":[{"$type":"Parameter","name":"isExplicit"}],"definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Group","guardCondition":{"$type":"ParameterReference","parameter":{"$ref":"#/rules@103/parameters@0"}},"elements":[{"$type":"Assignment","feature":"source","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]}\
1442
+ }]},{"$type":"Group","guardCondition":{"$type":"Negation","value":{"$type":"ParameterReference","parameter":{"$ref":"#/rules@103/parameters@0"}}},"elements":[{"$type":"Assignment","feature":"source","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]},"cardinality":"?"}]}]},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"->"},{"$type":"Group","elements":[{"$type":"Keyword","value":"-["},{"$type":"Assignment","feature":"kind","operator":"=","t\
1443
+ erminal":{"$type":"CrossReference","type":{"$ref":"#/rules@5"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@145"},"arguments":[]},"deprecatedSyntax":false}},{"$type":"Keyword","value":"]->"}]},{"$type":"Assignment","feature":"kind","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@5"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@143"},"arguments":[]},"deprecatedSyntax":false}}]},{"$type":"Assignment","feature":"target","operator":"=","terminal":{"$ty\
1444
+ pe":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@163"},"arguments":[]}},{"$type":"Assignment","feature":"technology","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@163"},"arguments":[]},"cardinality":"?"}],"cardinality":"?"},{"$type":"Assignment","feature":"tags","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"\
1445
+ #/rules@18"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"body","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@104"},"arguments":[]},"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"wildcard":false},{"$type":"ParserRule","name":"DeploymentRelationBody","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"tags","operator":"=","terminal":{"$type":"Ru\
1446
+ leCall","rule":{"$ref":"#/rules@18"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@33"},"arguments":[]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DeploymentView","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"deployment"},{"$\
1447
+ type":"Keyword","value":"view"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@145"},"arguments":[]}},{"$type":"Assignment","feature":"body","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@106"},"arguments":[]},"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DeploymentViewBody","definition":{"$type":"\
1448
+ Group","elements":[{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"tags","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]},"cardinality":"*"},{"$type":"Assignment","feature":"rules","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@107"},"arguments":[]},"cardinality":"*\
1449
+ "},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DeploymentViewRule","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@109"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@108"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@63"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":f\
1450
+ alse,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DeploymentViewRuleStyle","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"style"},{"$type":"Assignment","feature":"targets","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@83"},"arguments":[]}},{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rul\
1451
+ es@128"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@64"},"arguments":[]}]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DeploymentViewRulePredicate","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"isInclude","operator":"?=","terminal":{"$type":"Keyword","value":"include"\
1452
+ }},{"$type":"Keyword","value":"exclude"}]},{"$type":"Assignment","feature":"expr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@70"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Globals","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"global"}},{"$type":"Keyword","value":"{\
1453
+ "},{"$type":"Group","elements":[{"$type":"Assignment","feature":"predicates","operator":"+=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@111"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@112"},"arguments":[]}]},"cardinality":"*"},{"$type":"Assignment","feature":"styles","operator":"+=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@114"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#\
1454
+ /rules@115"},"arguments":[]}]},"cardinality":"*"}],"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"GlobalPredicateGroup","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"predicateGroup"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@164"},"arguments":[]}},{"$type":"Keyw\
1455
+ ord","value":"{"},{"$type":"Assignment","feature":"predicates","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@56"},"arguments":[]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"GlobalDynamicPredicateGroup","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"dynamicPredicateGroup"},{"$type":"Assignment","featu\
1456
+ re":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@164"},"arguments":[]}},{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"predicates","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@58"},"arguments":[]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"GlobalStyleId","definition":{"$ty\
1457
+ pe":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@164"},"arguments":[]}},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"GlobalStyle","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"style"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@113"},"arguments":[]}},{"$type":"A\
1458
+ ssignment","feature":"target","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@83"},"arguments":[]}},{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@128"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@64"},"arguments":[]}]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":fals\
1459
+ e,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"GlobalStyleGroup","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"styleGroup"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@113"},"arguments":[]}},{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"styles","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@60"},"arguments":[]},"cardinality":"*"},{\
1460
+ "$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"LinkProperty","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"key","operator":"=","terminal":{"$type":"Keyword","value":"link"}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@141"},"arg\
1461
+ uments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@163"},"arguments":[]},"cardinality":"?"},{"$type":"Keyword","value":";","cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ColorProperty","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"key","operator":"=","terminal":{"$type":"Keyword","va\
1462
+ lue":"color"}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"themeColor","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@136"},"arguments":[]}},{"$type":"Assignment","feature":"customColor","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@6"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@144"},"arguments":[]},"deprecatedSyntax":false}}]},{"$type":"Keyword","value":";\
1463
+ ","cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"OpacityProperty","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"key","operator":"=","terminal":{"$type":"Keyword","value":"opacity"}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@162"},"argumen\
1464
+ ts":[]}},{"$type":"Keyword","value":";","cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"MultipleProperty","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"key","operator":"=","terminal":{"$type":"Keyword","value":"multiple"}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall\
1465
+ ","rule":{"$ref":"#/rules@133"},"arguments":[]}},{"$type":"Keyword","value":";","cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"IconProperty","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"key","operator":"=","terminal":{"$type":"Keyword","value":"icon"}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Assign\
1466
+ ment","feature":"libicon","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@2"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@140"},"arguments":[]},"deprecatedSyntax":false}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"none"},{"$type":"RuleCall","rule":{"$ref":"#/rules@141"},"arguments":[]}]}}]},{"$type":"Keyword","value":";","cardinality":"?"}]},"definesHiddenTokens":false,"e\
1467
+ ntry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ShapeProperty","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"key","operator":"=","terminal":{"$type":"Keyword","value":"shape"}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@137"},"arguments":[]}},{"$type":"Keyword","value":";","cardinality":"?"\
1468
+ }]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"BorderStyleValue","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@134"},"arguments":[]},{"$type":"Keyword","value":"none"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"BorderProperty","definit\
1469
+ ion":{"$type":"Group","elements":[{"$type":"Assignment","feature":"key","operator":"=","terminal":{"$type":"Keyword","value":"border"}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@122"},"arguments":[]}},{"$type":"Keyword","value":";","cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRu\
1470
+ le","name":"SizeValue","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"xs"},{"$type":"Keyword","value":"sm"},{"$type":"Keyword","value":"md"},{"$type":"Keyword","value":"lg"},{"$type":"Keyword","value":"xl"},{"$type":"Keyword","value":"xsmall"},{"$type":"Keyword","value":"small"},{"$type":"Keyword","value":"medium"},{"$type":"Keyword","value":"large"},{"$type":"Keyword","value":"xlarge"}]},"definesHiddenTokens":false,"entry":false,"fragment":false\
1471
+ ,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ShapeSizeProperty","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"key","operator":"=","terminal":{"$type":"Keyword","value":"size"}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@124"},"arguments":[]}},{"$type":"Keyword","value":";","cardinality":"?"}]},"definesHiddenTokens"\
1472
+ :false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"PaddingSizeProperty","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"key","operator":"=","terminal":{"$type":"Keyword","value":"padding"}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@124"},"arguments":[]}},{"$type":"Keyword","value":";",\
1473
+ "cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"TextSizeProperty","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"key","operator":"=","terminal":{"$type":"Keyword","value":"textSize"}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@124"},"argumen\
1474
+ ts":[]}},{"$type":"Keyword","value":";","cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"StyleProperty","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@117"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@121"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@123"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"\
1475
+ #/rules@118"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@120"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@119"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@125"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@126"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@127"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name\
1476
+ ":"ElementStyleProperty","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"key","operator":"=","terminal":{"$type":"Keyword","value":"style"}},{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@128"},"arguments":[]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$\
1477
+ type":"ParserRule","name":"LineProperty","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"key","operator":"=","terminal":{"$type":"Keyword","value":"line"}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@134"},"arguments":[]}},{"$type":"Keyword","value":";","cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"para\
1478
+ meters":[],"wildcard":false},{"$type":"ParserRule","name":"ArrowProperty","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"key","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"head"},{"$type":"Keyword","value":"tail"}]}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@135"},"arguments":[]}},{"$type":"Keyword","value":"\
1479
+ ;","cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"RelationshipStyleProperty","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@117"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@130"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@131"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,\
1480
+ "hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Boolean","dataType":"boolean","definition":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"true"},{"$type":"Keyword","value":"false"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"LineOptions","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"solid"},{"$type\
1481
+ ":"Keyword","value":"dashed"},{"$type":"Keyword","value":"dotted"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ArrowType","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"none"},{"$type":"Keyword","value":"normal"},{"$type":"Keyword","value":"onormal"},{"$type":"Keyword","value":"dot"},{"$type":"Keyword","value":"odot"},{"$type":"Keyword","value":"dia\
1482
+ mond"},{"$type":"Keyword","value":"odiamond"},{"$type":"Keyword","value":"crow"},{"$type":"Keyword","value":"open"},{"$type":"Keyword","value":"vee"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ThemeColor","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"primary"},{"$type":"Keyword","value":"secondary"},{"$type":"Keyword","value":"muted"},{"$type":"Ke\
1483
+ yword","value":"slate"},{"$type":"Keyword","value":"blue"},{"$type":"Keyword","value":"indigo"},{"$type":"Keyword","value":"sky"},{"$type":"Keyword","value":"red"},{"$type":"Keyword","value":"gray"},{"$type":"Keyword","value":"green"},{"$type":"Keyword","value":"amber"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ElementShape","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$\
1484
+ type":"Keyword","value":"rectangle"},{"$type":"Keyword","value":"person"},{"$type":"Keyword","value":"browser"},{"$type":"Keyword","value":"mobile"},{"$type":"Keyword","value":"cylinder"},{"$type":"Keyword","value":"storage"},{"$type":"Keyword","value":"queue"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Participant","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"Key\
1485
+ word","value":"source"},{"$type":"Keyword","value":"target"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"CustomColorValue","dataType":"string","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@157"},"arguments":[]},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@145"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@166"\
1486
+ },"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@165"},"arguments":[]}]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"IconId","dataType":"string","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@152"},"arguments":[]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Uri","dataType":"string\
1487
+ ","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@153"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@154"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"TagId","dataType":"string","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@157"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/r\
1488
+ ules@145"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DotId","dataType":"string","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@159"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@145"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"Parser\
1489
+ Rule","name":"CustomColorId","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@164"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@137"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@135"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@134"},"arguments":[]},{"$type":"Keyword","value":"element"},{"$type":"Keyword","value":"model"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hi\
1490
+ ddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Id","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@164"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@137"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@136"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@135"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@134"},"arguments":[]},{"$type":"RuleCall\
1491
+ ","rule":{"$ref":"#/rules@138"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@124"},"arguments":[]},{"$type":"Keyword","value":"element"},{"$type":"Keyword","value":"model"},{"$type":"Keyword","value":"group"},{"$type":"Keyword","value":"node"},{"$type":"Keyword","value":"deployment"},{"$type":"Keyword","value":"instance"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"Eq\
1492
+ Operator","definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@161"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@160"},"arguments":[]}]}},{"$type":"Group","elements":[{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"is"}},{"$type":"Assignment","feature":"not","operator":"?=","terminal":{"$t\
1493
+ ype":"Keyword","value":"not"},"cardinality":"?"}]}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"IsEqual","definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"isEqual","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@161"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@160"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"hi\
1494
+ ddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","hidden":true,"name":"BLOCK_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\/\\\\*[\\\\s\\\\S]*?\\\\*\\\\//"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\/\\\\/[^\\\\n\\\\r]*/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"WS","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/"},"fragment":false},{"$type":"TerminalRule","hidden":t\
1495
+ rue,"name":"NL","definition":{"$type":"RegexToken","regex":"/[\\\\r\\\\n]+/"},"fragment":false},{"$type":"TerminalRule","name":"LIB_ICON","definition":{"$type":"RegexToken","regex":"/(aws|azure|gcp|tech):[-\\\\w]*/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"URI_WITH_SCHEMA","definition":{"$type":"RegexToken","regex":"/\\\\w+:\\\\/{2}\\\\S+/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"URI_RELATIVE","definition":{"$type":"RegexToken","regex":"/\\\\.{0,2}\\\\/[^\\\\/]\\\\\
1496
+ S+/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"DotUnderscore","definition":{"$type":"RegexToken","regex":"/\\\\b\\\\._(?![_a-zA-Z])/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"DotWildcard","definition":{"$type":"RegexToken","regex":"/\\\\b\\\\.\\\\*{1,2}/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"Hash","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"#"}},"fragment":false,"hidden":false},{"$type":"TerminalRul\
1497
+ e","name":"StickyDot","definition":{"$type":"RegexToken","regex":"/\\\\b\\\\./"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"Dot","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"."}},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NotEqual","definition":{"$type":"RegexToken","regex":"/\\\\!\\\\={1,2}/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"Eq","definition":{"$type":"RegexToken","regex":"/\\\\={1,2}/"},"fragment":fa\
1498
+ lse,"hidden":false},{"$type":"TerminalRule","name":"Percent","definition":{"$type":"RegexToken","regex":"/\\\\b\\\\d+%/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"String","definition":{"$type":"RegexToken","regex":"/\\"[^\\"]*\\"|'[^']*'/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"IdTerminal","definition":{"$type":"RegexToken","regex":"/[_]*[a-zA-Z][-\\\\w]*/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"Number","type":{"$type":"ReturnT\
1499
+ ype","name":"number"},"definition":{"$type":"RegexToken","regex":"/\\\\b\\\\d+\\\\b/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"Hex","definition":{"$type":"RegexToken","regex":"/\\\\b[a-zA-Z0-9]+\\\\b/"},"fragment":false,"hidden":false}],"types":[{"$type":"Type","name":"ModelReferenceable","type":{"$type":"UnionType","types":[{"$type":"SimpleType","typeRef":{"$ref":"#/rules@20"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@17"}}]}},{"$type":"Type","name":"Referenceable","type"\
1500
+ :{"$type":"UnionType","types":[{"$type":"SimpleType","typeRef":{"$ref":"#/rules@97"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@99"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@20"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@17"}}]}},{"$type":"Type","name":"LikeC4View","type":{"$type":"UnionType","types":[{"$type":"SimpleType","typeRef":{"$ref":"#/rules@41"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@42"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@105"}}]}},{"$t\
1501
+ ype":"Type","name":"StringProperty","type":{"$type":"UnionType","types":[{"$type":"SimpleType","typeRef":{"$ref":"#/rules@23"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@49"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@34"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@38"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@10"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@15"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@64"}},{"$type":"SimpleType","typeRef":{"$ref":"#\
1502
+ /rules@65"}}]}},{"$type":"Type","name":"DeploymentNodeOrElementKind","type":{"$type":"UnionType","types":[{"$type":"SimpleType","typeRef":{"$ref":"#/rules@3"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@7"}}]}},{"$type":"Type","name":"WhereTagEqual","type":{"$type":"UnionType","types":[{"$type":"SimpleType","typeRef":{"$ref":"#/rules@89/definition/elements@0/elements@0/inferredType"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@95/definition/elements@0/elements@0/inferredType"}},{"$ty\
1503
+ pe":"SimpleType","typeRef":{"$ref":"#/rules@95/definition/elements@2/elements@0/inferredType"}}]}},{"$type":"Type","name":"WhereKindEqual","type":{"$type":"UnionType","types":[{"$type":"SimpleType","typeRef":{"$ref":"#/rules@89/definition/elements@1/elements@0/inferredType"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@95/definition/elements@1/elements@0/inferredType"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@95/definition/elements@3/elements@0/inferredType"}}]}},{"$type":"Type","n\
1504
+ ame":"WhereExpression","type":{"$type":"UnionType","types":[{"$type":"SimpleType","typeRef":{"$ref":"#/rules@84"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@90"}}]}},{"$type":"Type","name":"DeploymentElement","type":{"$type":"UnionType","types":[{"$type":"SimpleType","typeRef":{"$ref":"#/rules@97"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@99"}}]}},{"$type":"Type","name":"FqnReferenceable","type":{"$type":"UnionType","types":[{"$type":"SimpleType","typeRef":{"$ref":"#/types@1"}},{\
1505
+ "$type":"SimpleType","typeRef":{"$ref":"#/rules@20"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@24"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@101"}}]}},{"$type":"Type","name":"SizeProperty","type":{"$type":"UnionType","types":[{"$type":"SimpleType","typeRef":{"$ref":"#/rules@125"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@126"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@127"}}]}}],"definesHiddenTokens":false,"hiddenTokens":[],"imports":[],"interfaces":[],"usedGramm\
1506
+ ars":[]}`)),wv={languageId:"likec4",fileExtensions:[".c4",".likec4",".like-c4"],caseInsensitive:!1,mode:"production"},P8={skipValidations:!0,recoveryEnabled:!0,nodeLocationTracking:"full"},x8={AstReflection:()=>new NC},N8={Grammar:()=>_8(),LanguageMetaData:()=>wv,parser:{ParserConfig:()=>P8}},I8=[...Object.entries({aws:["activate","alexa-for-business","amplify","apache-mxnet-on-aws","api-gateway","app-config","app-flow","app-mesh","app-runner","app-stream","app-sync","application-auto-scaling","\
1507
+ application-composer","application-cost-profiler","application-discovery-service","application-migration-service","artifact","athena","audit-manager","augmented-ai-a2i","aurora","auto-scaling","backint-agent","backup","batch","billing-conductor","bottlerocket","braket","budgets","certificate-manager","chatbot","chime","chime-sdk","chime-voice-connector","clean-rooms","client-vpn","cloud-control-api","cloud-development-kit","cloud-directory","cloud-formation","cloud-front","cloud-hsm","cloud-map",
1508
+ "cloud-search","cloud-shell","cloud-trail","cloud-wan","cloud-watch","cloud9","code-artifact","code-build","code-catalyst","code-commit","code-deploy","code-guru","code-pipeline","code-star","code-whisperer","cognito","command-line-interface","comprehend","comprehend-medical","compute-optimizer","config","connect","console-mobile-application","control-tower","corretto","cost-and-usage-report","cost-explorer","data-exchange","data-pipeline","data-sync","data-zone","database-migration-service","de\
1509
+ ep-composer","deep-learning-amis","deep-learning-containers","deep-lens","deep-racer","detective","dev-ops-guru","device-farm","direct-connect","directory-service","distro-for-open-telemetry","document-db","dynamo-db","ec2","ec2-auto-scaling","ec2-image-builder","ecs-anywhere","efs","eks-anywhere","eks-cloud","eks-distro","elasti-cache","elastic-beanstalk","elastic-block-store","elastic-container-registry","elastic-container-service","elastic-disaster-recovery","elastic-fabric-adapter","elastic-\
1510
+ inference","elastic-kubernetes-service","elastic-load-balancing","elastic-transcoder","elemental-appliances-software","elemental-conductor","elemental-delta","elemental-link","elemental-live","elemental-media-connect","elemental-media-convert","elemental-media-live","elemental-media-package","elemental-media-store","elemental-media-tailor","elemental-server","emr","event-bridge","express-workflows","fargate","fault-injection-simulator","file-cache","fin-space","firewall-manager","forecast","frau\
1511
+ d-detector","free-rtos","fsx","fsx-for-lustre","fsx-for-net-app-ontap","fsx-for-open-zfs","fsx-for-wfs","game-kit","game-lift","game-sparks","genomics-cli","global-accelerator","glue","glue-data-brew","glue-elastic-views","ground-station","guard-duty","health-lake","honeycode","iam-identity-center","identity-and-access-management","inspector","interactive-video-service","io-t-1-click","io-t-analytics","io-t-button","io-t-core","io-t-device-defender","io-t-device-management","io-t-edu-kit","io-t-\
1512
+ events","io-t-express-link","io-t-fleet-wise","io-t-greengrass","io-t-robo-runner","io-t-site-wise","io-t-things-graph","io-t-twin-maker","iq","kendra","key-management-service","keyspaces","kinesis","kinesis-data-analytics","kinesis-data-streams","kinesis-firehose","kinesis-video-streams","lake-formation","lambda","launch-wizard","lex","license-manager","lightsail","local-zones","location-service","lookout-for-equipment","lookout-for-metrics","lookout-for-vision","lumberyard","macie","mainframe-\
1513
+ modernization","managed-blockchain","managed-grafana","managed-service-for-prometheus","managed-services","managed-streaming-for-apache-kafka","managed-workflows-for-apache-airflow","management-console","marketplace-dark","marketplace-light","memory-db-for-redis","migration-evaluator","migration-hub","monitron","mq","neptune","network-firewall","neuron","nice-dcv","nice-engin-frame","nimble-studio","nitro-enclaves","omics","open-3d-engine","open-search-service","ops-works","organizations","outpo\
1514
+ sts-family","outposts-rack","outposts-servers","panorama","parallel-cluster","personal-health-dashboard","personalize","pinpoint","pinpoint-apis","polly","private-5g","private-certificate-authority","private-link","professional-services","proton","quantum-ledger-database","quick-sight","rds","rds-on-vmware","re-post","red-hat-open-shift-service-on-aws","redshift","rekognition","reserved-instance-reporting","resilience-hub","resource-access-manager","resource-explorer","robo-maker","route-53","s3\
1515
+ -on-outposts","sage-maker","sage-maker-ground-truth","sage-maker-studio-lab","savings-plans","secrets-manager","security-hub","security-lake","server-migration-service","serverless-application-repository","service-catalog","service-management-connector","shield","signer","sim-space-weaver","simple-email-service","simple-notification-service","simple-queue-service","simple-storage-service","simple-storage-service-glacier","site-to-site-vpn","snowball","snowball-edge","snowcone","snowmobile","step\
1516
+ -functions","storage-gateway","sumerian","supply-chain","support","systems-manager","tensor-flow-on-aws","textract","thinkbox-deadline","thinkbox-frost","thinkbox-krakatoa","thinkbox-sequoia","thinkbox-stoke","thinkbox-xmesh","timestream","tools-and-sdks","torch-serve","training-certification","transcribe","transfer-family","transit-gateway","translate","trusted-advisor","verified-access","verified-permissions","virtual-private-cloud","vmware-cloud-on-aws","vpc-lattice","waf","wavelength","well-\
1517
+ architected-tool","wickr","work-docs","work-docs-sdk","work-link","work-mail","work-spaces-family","x-ray"],azure:["abs-member","active-directory-connect-health","activity-log","administrative-units","advisor","ai-studio","aks-automatic","aks-istio","alerts","all-resources","analysis-services","anomaly-detector","api-center","api-connections","api-management-services","api-proxy","app-compliance-automation","app-configuration","app-registrations","app-service-certificates","app-service-domains",
1518
+ "app-service-environments","app-service-plans","app-services","app-space","app-space-component","applens","application-gateway-containers","application-gateways","application-group","application-insights","application-security-groups","aquila","arc-data-services","arc-kubernetes","arc-machines","arc-postgre-sql","arc-sql-managed-instance","arc-sql-server","atm-multistack","auto-scale","automanaged-vm","automation-accounts","availability-sets","avs-vm","azure-a","azure-ad-b2c","azure-api-for-fhir",
1519
+ "azure-applied-ai-services","azure-arc","azure-attestation","azure-backup-center","azure-blockchain-service","azure-center-for-sap","azure-chaos-studio","azure-cloud-shell","azure-communication-services","azure-communications-gateway","azure-compute-galleries","azure-cosmos-db","azure-data-catalog","azure-data-explorer-clusters","azure-database-maria-db-server","azure-database-migration-services","azure-database-my-sql-server","azure-database-postgre-sql-server","azure-database-postgre-sql-serve\
1520
+ r-group","azure-databox-gateway","azure-databricks","azure-deployment-environments","azure-dev-ops","azure-dev-tunnels","azure-edge-hardware-center","azure-experimentation-studio","azure-fileshares","azure-firewall-manager","azure-firewall-policy","azure-hcp-cache","azure-hpc-workbenches","azure-hybrid-center","azure-information-protection","azure-io-t-operations","azure-lighthouse","azure-load-testing","azure-managed-grafana","azure-maps-accounts","azure-media-service","azure-migrate","azure-mo\
1521
+ nitor-dashboard","azure-monitor-pipeline","azure-monitors-for-sap-solutions","azure-net-app-files","azure-network-function-manager","azure-network-function-manager-functions","azure-object-understanding","azure-open-ai","azure-operator-5g-core","azure-operator-insights","azure-operator-nexus","azure-operator-service-manager","azure-orbital","azure-programmable-connectivity","azure-purview-accounts","azure-quotas","azure-red-hat-open-shift","azure-sentinel","azure-service-bus","azure-sphere","azu\
1522
+ re-spring-apps","azure-sql","azure-sql-edge","azure-sql-server-stretch-databases","azure-sql-vm","azure-stack","azure-stack-edge","azure-stack-hci-sizer","azure-storage-mover","azure-support-center-blue","azure-sustainability","azure-synapse-analytics","azure-token-service","azure-video-indexer","azure-virtual-desktop","azure-vmware-solution","azure-workbooks","azurite","backlog","backup-vault","bare-metal-infrastructure","bastions","batch-accounts","batch-ai","biz-talk","blob-block","blob-page",
1523
+ "blockchain-applications","blueprints","bonsai","bot-services","branch","browser","bug","builds","business-process-tracking","cache","cache-redis","capacity","capacity-reservation-groups","cdn-profiles","central-service-instance-for-sap","ceres","change-analysis","client-apps","cloud-services-classic","cloud-services-extended-support","cloud-test","code","code-optimization","cognitive-search","cognitive-services","cognitive-services-decisions","collaborative-service","commit","community-images",
1524
+ "compliance","compliance-center","compute-fleet","computer-vision","conditional-access","confidential-ledgers","connected-cache","connected-vehicle-platform","connections","consortium","container-apps-environments","container-instances","container-registries","container-services-deprecated","content-moderators","content-safety","controls","controls-horizontal","cost-alerts","cost-analysis","cost-budgets","cost-export","cost-management","cost-management-and-billing","counter","cubes","custom-ip-p\
1525
+ refix","custom-vision","customer-lockbox-for-microsoft-azure","dashboard","dashboard-hub","data-box","data-collection-rules","data-factories","data-lake-analytics","data-lake-storage-gen1","data-lake-store-gen1","data-share-invitations","data-shares","database-instance-for-sap","ddo-s-protection-plans","dedicated-hsm","defender-cm-local-manager","defender-dcs-controller","defender-distributer-control-system","defender-engineering-station","defender-external-management","defender-freezer-monitor",
1526
+ "defender-historian","defender-hmi","defender-industrial-packaging-system","defender-industrial-printer","defender-industrial-robot","defender-industrial-scale-system","defender-marquee","defender-meter","defender-plc","defender-pneumatic-device","defender-programable-board","defender-relay","defender-robot-controller","defender-rtu","defender-sensor","defender-slot","defender-web-guiding-system","detonation","dev-console","dev-ops-starter","dev-test-labs","device-compliance","device-configurati\
1527
+ on","device-enrollment","device-provisioning-services","device-security-apple","device-security-google","device-security-windows","device-update-io-t-hub","devices","diagnostics-settings","digital-twins","disk-encryption-sets","disk-pool","disks","disks-classic","disks-snapshots","dns-multistack","dns-private-resolver","dns-security-policy","dns-zones","download","e-books","edge-management","education","elastic-job-agents","elastic-san","endpoint-analytics","enterprise-applications","entra-conne\
1528
+ ct","entra-connect-health","entra-connect-sync","entra-domain-services","entra-global-secure-access","entra-id-protection","entra-identity-custom-roles","entra-identity-licenses","entra-identity-risky-signins","entra-identity-risky-users","entra-identity-roles-and-administrators","entra-internet-access","entra-managed-identities","entra-private-access","entra-privleged-identity-management","entra-verified-id","error","event-grid-domains","event-grid-subscriptions","event-grid-topics","event-hub-\
1529
+ clusters","event-hubs","exchange-access","exchange-on-premises-access","express-route-circuits","express-route-direct","express-route-traffic-collector","extended-security-updates","extensions","external-identities","face-apis","feature-previews","fhir-service","fiji","file","files","firewalls","folder-blank","folder-website","form-recognizers","free-services","front-door-and-cdn-profiles","ftp","function-apps","gear","genomics","genomics-accounts","globe-error","globe-success","globe-warning","\
1530
+ groups","guide","hd-insight-clusters","hdi-aks-cluster","heart","help-and-support","host-groups","host-pools","hosts","ic-m-troubleshooting","identity-governance","identity-multi-factor-authentication","identity-secure-score","image","image-definitions","image-templates","image-versions","images","immersive-readers","import-export-jobs","industrial-io-t","information","infrastructure-backup","input-output","instance-pools","integration-accounts","integration-environments","integration-service-en\
1531
+ vironments","internet-analyzer-profiles","intune","intune-app-protection","intune-for-education","intune-trends","io-t-central-applications","io-t-edge","io-t-hub","ip-address-manager","ip-groups","journey-hub","key-vaults","keys","kubernetes-fleet-manager","kubernetes-services","lab-accounts","lab-services","language","language-understanding","launch-portal","learn","load-balancer-hub","load-balancers","load-test","load-testing","local-network-gateways","location","log-analytics-query-pack","lo\
1532
+ g-analytics-workspaces","log-streaming","logic-apps","logic-apps-custom-connector","machine-learning","machine-learning-studio-classic-web-services","machine-learning-studio-web-service-plans","machine-learning-studio-workspaces","machines-azure-arc","maintenance-configuration","managed-applications-center","managed-database","managed-desktop","managed-dev-ops-pools","managed-file-shares","managed-identities","managed-instance-apache-cassandra","managed-service-fabric","management-groups","manag\
1533
+ ement-portal","marketplace","marketplace-management","med-tech-service","media","media-file","mesh-applications","metrics","metrics-advisor","microsoft-defender-easm","microsoft-defender-for-cloud","microsoft-defender-for-io-t","microsoft-dev-box","mindaro","mission-landing-zone","mobile","mobile-engagement","mobile-networks","modular-data-center","module","monitor","monitor-health-models","multi-tenancy","multifactor-authentication","my-customers","nat","network-interfaces","network-managers","\
1534
+ network-security-groups","network-security-perimeters","network-watcher","notification-hub-namespaces","notification-hubs","offers","on-premises-data-gateways","open-supply-chain-platform","operation-log-classic","oracle-database","os-images-classic","osconfig","outbound-connection","partner-namespace","partner-registration","partner-topic","peering-service","peerings","personalizers","plans","policy","power","power-bi-embedded","power-platform","power-up","powershell","preview-features","privat\
1535
+ e-endpoints","private-link","private-link-service","private-link-services","process-explorer","production-ready-database","proximity-placement-groups","public-ip-addresses","public-ip-addresses-classic","public-ip-prefixes","qn-a-makers","quickstart-center","recent","recovery-services-vaults","region-management","relays","remote-rendering","reservations","reserved-capacity","reserved-ip-addresses-classic","resource-explorer","resource-graph-explorer","resource-group-list","resource-groups","reso\
1536
+ urce-guard","resource-linked","resource-management-private-link","resource-mover","resources-provider","restore-points","restore-points-collections","route-filters","route-tables","rtos","savings-plans","scheduler","scheduler-job-collections","scvmm-management-servers","search","search-grid","security","security-baselines","send-grid-accounts","server-farm","serverless-search","service-catalog-mad","service-endpoint-policies","service-fabric-clusters","service-health","service-providers","shared\
1537
+ -image-galleries","signal-r","software-as-a-service","software-updates","solutions","sonic-dash","spatial-anchor-accounts","speech-services","spot-vm","spot-vmss","sql-data-warehouses","sql-database","sql-elastic-pools","sql-managed-instance","sql-server","sql-server-registries","ssd","ssh-keys","ssis-lift-and-shift-ir","stack-hci-premium","static-apps","stor-simple-data-managers","stor-simple-device-managers","storage-accounts","storage-accounts-classic","storage-actions","storage-azure-files",
1538
+ "storage-container","storage-explorer","storage-functions","storage-queue","storage-sync-services","stream-analytics-jobs","subnet","subscriptions","system-topic","table","tag","tags","targets-management","template-specs","templates","tenant-properties","tenant-status","test-base","tfs-vc-repository","time-series-data-sets","time-series-insights-access-policies","time-series-insights-environments","time-series-insights-event-sources","toolbox","traffic-manager-profiles","translator-text","troubl\
1539
+ eshoot","universal-print","update-management-center","updates","user-privacy","user-settings","user-subscriptions","users","verifiable-credentials","verification-as-a-service","versions","video-analyzers","virtual-clusters","virtual-enclaves","virtual-instance-for-sap","virtual-machine","virtual-machines-classic","virtual-network-gateways","virtual-networks","virtual-networks-classic","virtual-router","virtual-visits-builder","virtual-wan-hub","virtual-wans","vm-app-definitions","vm-app-versions",
1540
+ "vm-image-version","vm-images-classic","vm-scale-sets","wac","wac-installer","web-app-database","web-application-firewall-policies-waf","web-jobs","web-slots","web-test","website-power","website-staging","windows-notification-services","windows10-core-services","workbooks","worker-container-app","workflow","workspace-gateway","workspaces"],gcp:["access-context-manager","administration","advanced-agent-modeling","advanced-solutions-lab","agent-assist","ai-hub","ai-platform","ai-platform-unified",
1541
+ "analytics-hub","anthos","anthos-config-management","anthos-service-mesh","api","api-analytics","api-monetization","apigee-api-platform","apigee-sense","app-engine","artifact-registry","asset-inventory","assured-workloads","auto-ml","auto-ml-natural-language","auto-ml-tables","auto-ml-translation","auto-ml-video-intelligence","auto-ml-vision","bare-metal-solutions","batch","beyondcorp","big-query","bigtable","billing","binary-authorization","catalog","certificate-authority-service","certificate-\
1542
+ manager","cloud-api-gateway","cloud-apis","cloud-armor","cloud-asset-inventory","cloud-audit-logs","cloud-build","cloud-cdn","cloud-code","cloud-composer","cloud-data-fusion","cloud-deploy","cloud-deployment-manager","cloud-dns","cloud-domains","cloud-ekm","cloud-endpoints","cloud-external-ip-addresses","cloud-firewall-rules","cloud-for-marketing","cloud-functions","cloud-generic","cloud-gpu","cloud-healthcare-api","cloud-healthcare-marketplace","cloud-hsm","cloud-ids","cloud-inference-api","clo\
1543
+ ud-interconnect","cloud-jobs-api","cloud-load-balancing","cloud-logging","cloud-media-edge","cloud-monitoring","cloud-nat","cloud-natural-language-api","cloud-network","cloud-ops","cloud-optimization-ai","cloud-optimization-ai-fleet-routing-api","cloud-router","cloud-routes","cloud-run","cloud-run-for-anthos","cloud-scheduler","cloud-security-scanner","cloud-shell","cloud-spanner","cloud-sql","cloud-storage","cloud-tasks","cloud-test-lab","cloud-tpu","cloud-translation-api","cloud-vision-api","c\
1544
+ loud-vpn","compute-engine","configuration-management","connectivity-test","connectors","contact-center-ai","container-optimized-os","container-registry","data-catalog","data-labeling","data-layers","data-loss-prevention-api","data-qn-a","data-studio","data-transfer","database-migration-service","dataflow","datalab","dataplex","datapol","dataprep","dataproc","dataproc-metastore","datashare","datastore","datastream","debugger","developer-portal","dialogflow","dialogflow-cx","dialogflow-insights","\
1545
+ document-ai","early-access-center","error-reporting","eventarc","filestore","financial-services-marketplace","firestore","fleet-engine","free-trial","game-servers","gce-systems-management","genomics","gke-on-prem","google-cloud-marketplace","google-kubernetes-engine","google-maps-platform","healthcare-nlp-api","home","identity-and-access-management","identity-aware-proxy","identity-platform","iot-core","iot-edge","key-access-justifications","key-management-service","kuberun","launcher","local-ss\
1546
+ d","looker","managed-service-for-microsoft-active-directory","media-translation-api","memorystore","migrate-for-anthos","migrate-for-compute-engine","my-cloud","network-connectivity-center","network-intelligence-center","network-security","network-tiers","network-topology","onboarding","os-configuration-management","os-inventory-management","os-patch-management","partner-interconnect","partner-portal","performance-dashboard","permissions","persistent-disk","phishing-protection","policy-analyzer",
1547
+ "premium-network-tier","private-connectivity","private-service-connect","producer-portal","profiler","project","pub-sub","quantum-engine","quotas","real-world-insights","recommendations-ai","release-notes","retail-api","risk-manager","runtime-config","secret-manager","security","security-command-center","security-health-advisor","security-key-enforcement","service-discovery","speech-to-text","stackdriver","standard-network-tier","stream-suite","support","tensorflow-enterprise","text-to-speech","\
1548
+ tools-for-powershell","trace","traffic-director","transfer","transfer-appliance","user-preferences","vertex-ai","video-intelligence-api","virtual-private-cloud","visual-inspection","vmware-engine","web-risk","web-security-scanner","workflows","workload-identity-pool"],tech:["aarch64","adobe-illustrator","adobe-photoshop","adobe-premiere-pro","adobe-xd","adonis-js","after-effects","airflow","akka","algolia","alpine-js","amazon-web-services","anaconda","android","android-studio","angular","angular\
1549
+ -js","ansible","ant-design","apache","apl","appcelerator","apple","apple-safari","appwrite","arch-linux","arduino","argo-cd","astro","atom","autodesk-maya","autodesk-shot-grid","awk","azios","azure","azure-devops","azure-sql-database","babel","backbone-js","ballerina","bamboo","bash","behance","bitbucket","blender","bootstrap","bower","browserstack","bulma","bun","c","cairo-graphics","cake-php","canva","capacitor","cassandra","cent-os","chrome","circle-ci","clarity","clion","clojure","clojure-sc\
1550
+ ript","cloudflare","cloudflare-workers","cmake","code-igniter","code-pen","codeac","codecov","coffee-script","composer","confluence","consul","contao","corejs","cosmosdb","couchdb","cplusplus","crystal","csharp","css3","cucumber","cypress","d3js","dart","data-grip","data-spell","dbeaver","debian","deno","devicon","digital-ocean","discord-js","django","django-rest","docker","doctrine","dropwizard","drupal","eclipse-ceylon","eclipse-ide","eclipse-vert-x","elasticbeats","elasticsearch","electron","\
1551
+ eleventy-11ty","elixir","elm","embedded-c","ember-js","envoy","erlang","eslint","express","facebook","fast-api","fastify","fauna","feathers","fedora","figma","file-zilla","firebase","firefox","flask","flutter","fortran","foundation","fsharp","gatling","gatsby","gazebo","gcc","gentoo","ghost","gimp","git","gitbook","github","github-actions","github-codespaces","gitlab","gitpod","gitter","gnu-emacs","go","go-land","godot-engine","google","google-cloud","gradle","grafana","grails","graphql","groovy",
1552
+ "grunt-js","gulp-js","hadoop","handlebars","hardhat","harvester","hashicorp-vault","haskell","haxe","helm","heroku","hibernate","homebrew","html5","hugo","ibm-spss-statistics","ie10","ifttt","influxdb","inkscape","insomnia","intellij-idea","ionic","jaeger","jamstack","jasmine","java","javascript","jeet","jekyll","jenkins","jest","jetbrains","jira","jira-align","jquery","json","jule","julia","junit","jupyter","k3os","k3s","kafka","kaggle","karate","karma","keras","kibana","knex-js","knockout","ko\
1553
+ tlin","krakenjs","ktor","kubernetes","labview","laravel","latex","less-js","linkedin","linux","liquibase","livewire","llvm","logstash","lua","lumen","magento","markdown","material-ui","materialize","matlab","matplotlib","maven","meteor-js","microsoft-sql-server","minitab","mob-x","mocha","modx","moleculer","mongodb","mongoose-js","moodle","ms-dos","mysql","nano","nerog","nestjs","net","net-core","network-x","new4j","nextjs","nginx","nhibernate","nim","nimble","nix","nodejs","nodemon","nodewebkit",
1554
+ "npm","nuget","num-py","nuxt-js","objective-c","ocaml","oh-my-zsh","okta","open-al","open-api","open-cl","open-cv","open-gl","open-stack","open-suse","open-telemetry","opera","oracle","p5js","packer","pandas","perl","pf-sense","phalcon","phoenix-framework","photon-engine","php","php-storm","playwrite","ploty","podman","polygon","portainer","postcss","postgresql","postman","powershell","processing","prometheus","protractor","purescript","putty","pycharm","pyscript","pytest","python","python-poetr\
1555
+ y","pytorch","qodana","qt","quarkus","quasar","qwik","r","rabbitmq","rancher","raspberrypi","reach","react","react-bootstrap","realm","red-cube-s-epic-compiler-thingy-programming-re-ct","redhat","redis","redux","ren-py","rider","robot-operating-system-ros","rocksdb","rollup-js","rspec","rstudio","ruby","ruby-mine","ruby-on-rails","rust","salesforce","sanity","sass","scala","scalingo","sdl","selenium","sema-software","sequelize","shopware","sketch","slack","socket-io","solid-js","solidity","sonar\
1556
+ qube","sourcetree","spark","splunk","spring","sql-developer","sqlalchemy","sqlite","ssh","stackoverflow","stata","storybook","streamlit","stylus","subversion","svelte","swagger","swift","symfony","tailwind-css","tauri","tensorflow","terraform","tex","the-algorithms","three-js","titanium-sdk","tomcat","tortoise-git","tower","traefik-mesh","traefik-proxy","travis-ci","trello","twitter","typescript","typo3","ubuntu","uml","unity","unix","unreal-engine","uwsgi","v8","vagrant","vala","vercel","veutif\
1557
+ y","vim","visualstudio","vite","vitejs","vscode","vsphere","vue","vue-storefront","vyper","webassembly","webflow","weblate","webpack","webstorm","windows8","windows11","woo-commerce","wordpress","xamarin","xcode","xml","yaml","yarn","yii-framework","yuno-host","zend-framework","zig"]})].flatMap(([t,e])=>e.map(n=>t+":"+n)),OC=["likec4lib {"," icons {",...I8.map(t=>" "+t)," }","}"].join(`
1558
+ `),FC="likec4builtin",O8=`${FC}:///likec4/lib/icons.c4`;function id(t){return t.scheme===FC}const st=bn.getChild("server");function sd(t){st.error(yr(t))}function Re(t){st.warn(yr(t))}var bv,LC;function F8(){return LC||(LC=1,bv=zT()),bv}var L8=F8();const MC=Jr(L8),M8=/^[\s\w\0+.-]{2,}:([/\\]{1,2})/,BC=/^[\s\w\0+.-]{2,}:([/\\]{2})?/,B8=/^([/\\]\s*){2,}[^/\\]/,q8=/^\.?\//;function Ev(t){return["./","../"].some(e=>t.startsWith(e))}function rs(t,e={}){return typeof e=="boolean"&&(e={acceptRelative:e}),
1559
+ e.strict?M8.test(t):BC.test(t)||(e.acceptRelative?B8.test(t):!1)}function j8(t="",e){return t.endsWith("/")}function G8(t="",e){return(j8(t)?t.slice(0,-1):t)||"/"}function qC(t="",e){return t.endsWith("/")?t:t+"/"}function od(t=""){return t.startsWith("/")}function jC(t=""){return(od(t)?t.slice(1):t)||"/"}function U8(t=""){return od(t)?t:"/"+t}function W8(t,e){if(z8(e))return t;const n=G8(e);if(!t.startsWith(n))return t;const r=t.slice(n.length);return r[0]==="/"?r:"/"+r}function z8(t){return!t||
1560
+ t==="/"}function H8(t){return t&&t!=="/"}function GC(t,...e){let n=t||"";for(const r of e.filter(i=>H8(i)))if(n){const i=r.replace(q8,"");n=qC(n)+i}else n=r;return n}function bh(...t){const e=/\/(?!\/)/,n=t.filter(Boolean),r=[];let i=0;for(const o of n)if(!(!o||o==="/")){for(const[a,u]of o.split(e).entries())if(!(!u||u===".")){if(u===".."){if(r.length===1&&rs(r[0]))continue;r.pop(),i--;continue}if(a===1&&r[r.length-1]?.endsWith(":/")){r[r.length-1]+="/"+u;continue}r.push(u),i++}}let s=r.join("/");
1561
+ return i>=0?n[0]?.startsWith("/")&&!s.startsWith("/")?s="/"+s:n[0]?.startsWith("./")&&!s.startsWith("./")&&(s="./"+s):s="../".repeat(-1*i)+s,n[n.length-1]?.endsWith("/")&&!s.endsWith("/")&&(s+="/"),s}function UC(t){return $v(t,"")}function $v(t,e){let n=t.match(BC);return n||(n=t.match(/^\/{2,}/)),n?e+t.slice(n[0].length):e+t}const K8=Symbol.for("ufo:protocolRelative");function V8(t="",e){const n=t.match(/^[\s\0]*(blob:|data:|javascript:|vbscript:)(.*)/i);if(n){const[,f,d=""]=n;return{protocol:f.
1562
+ toLowerCase(),pathname:d,href:f+d,auth:"",host:"",search:"",hash:""}}if(!rs(t,{acceptRelative:!0}))return Ta(t);const[,r="",i,s=""]=t.replace(/\\/g,"/").match(/^[\s\0]*([\w+.-]{2,}:)?\/\/([^/@]+@)?(.*)/)||[];let[,o="",a=""]=s.match(/([^#/?]*)(.*)?/)||[];r==="file:"&&(a=a.replace(/\/(?=[A-Za-z]:)/,""));const{pathname:u,search:c,hash:l}=Ta(a);return{protocol:r.toLowerCase(),auth:i?i.slice(0,Math.max(0,i.length-1)):"",host:o,pathname:u,search:c,hash:l,[K8]:!r}}function Ta(t=""){const[e="",n="",r=""]=(t.
1563
+ match(/([^#?]*)(\?[^#]*)?(#.*)?/)||[]).splice(1);return{pathname:e,search:n,hash:r}}const X8=/\/([^/]+)$/;function Y8(t="",{strict:e}){const{pathname:n}=V8(t),r=n.match(X8);return r?r[1]:void 0}var J8=/[\u1680\u2000-\u200A\u202F\u205F\u3000]/,Q8=/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]/,
1564
+ Z8=/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09FC\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF9\u1D00-\u1DF9\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDE00-\uDE3E\uDE47\uDE50-\uDE83\uDE86-\uDE99\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4A\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/,
1565
+ Dv={Space_Separator:J8,ID_Start:Q8,ID_Continue:Z8},Mt={isSpaceSeparator(t){return typeof t=="string"&&Dv.Space_Separator.test(t)},isIdStartChar(t){return typeof t=="string"&&(t>="a"&&t<="z"||t>="A"&&t<="Z"||t==="$"||t==="_"||Dv.ID_Start.test(t))},isIdContinueChar(t){return typeof t=="string"&&(t>="a"&&t<="z"||t>="A"&&t<="Z"||t>="0"&&t<="9"||t==="$"||t==="_"||t==="\u200C"||t==="\u200D"||Dv.ID_Continue.test(t))},isDigit(t){return typeof t=="string"&&/[0-9]/.test(t)},isHexDigit(t){return typeof t==
1566
+ "string"&&/[0-9A-Fa-f]/.test(t)}};let Rv,_n,Pi,Eh,is,Cr,Zt,kv,ad;var eU=function(e,n){Rv=String(e),_n="start",Pi=[],Eh=0,is=1,Cr=0,Zt=void 0,kv=void 0,ad=void 0;do Zt=tU(),iU[_n]();while(Zt.type!=="eof");return typeof n=="function"?Tv({"":ad},"",n):ad};function Tv(t,e,n){const r=t[e];if(r!=null&&typeof r=="object")if(Array.isArray(r))for(let i=0;i<r.length;i++){const s=String(i),o=Tv(r,s,n);o===void 0?delete r[s]:Object.defineProperty(r,s,{value:o,writable:!0,enumerable:!0,configurable:!0})}else
1567
+ for(const i in r){const s=Tv(r,i,n);s===void 0?delete r[i]:Object.defineProperty(r,i,{value:s,writable:!0,enumerable:!0,configurable:!0})}return n.call(t,e,r)}let Fe,Pe,ud,xi,Ke;function tU(){for(Fe="default",Pe="",ud=!1,xi=1;;){Ke=Ni();const t=WC[Fe]();if(t)return t}}function Ni(){if(Rv[Eh])return String.fromCodePoint(Rv.codePointAt(Eh))}function Z(){const t=Ni();return t===`
1568
+ `?(is++,Cr=0):t?Cr+=t.length:Cr++,t&&(Eh+=t.length),t}const WC={default(){switch(Ke){case" ":case"\v":case"\f":case" ":case"\xA0":case"\uFEFF":case`
1569
+ `:case"\r":case"\u2028":case"\u2029":Z();return;case"/":Z(),Fe="comment";return;case void 0:return Z(),$t("eof")}if(Mt.isSpaceSeparator(Ke)){Z();return}return WC[_n]()},comment(){switch(Ke){case"*":Z(),Fe="multiLineComment";return;case"/":Z(),Fe="singleLineComment";return}throw Dt(Z())},multiLineComment(){switch(Ke){case"*":Z(),Fe="multiLineCommentAsterisk";return;case void 0:throw Dt(Z())}Z()},multiLineCommentAsterisk(){switch(Ke){case"*":Z();return;case"/":Z(),Fe="default";return;case void 0:throw Dt(
1570
+ Z())}Z(),Fe="multiLineComment"},singleLineComment(){switch(Ke){case`
1571
+ `:case"\r":case"\u2028":case"\u2029":Z(),Fe="default";return;case void 0:return Z(),$t("eof")}Z()},value(){switch(Ke){case"{":case"[":return $t("punctuator",Z());case"n":return Z(),po("ull"),$t("null",null);case"t":return Z(),po("rue"),$t("boolean",!0);case"f":return Z(),po("alse"),$t("boolean",!1);case"-":case"+":Z()==="-"&&(xi=-1),Fe="sign";return;case".":Pe=Z(),Fe="decimalPointLeading";return;case"0":Pe=Z(),Fe="zero";return;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"\
1572
+ 9":Pe=Z(),Fe="decimalInteger";return;case"I":return Z(),po("nfinity"),$t("numeric",1/0);case"N":return Z(),po("aN"),$t("numeric",NaN);case'"':case"'":ud=Z()==='"',Pe="",Fe="string";return}throw Dt(Z())},identifierNameStartEscape(){if(Ke!=="u")throw Dt(Z());Z();const t=Cv();switch(t){case"$":case"_":break;default:if(!Mt.isIdStartChar(t))throw zC();break}Pe+=t,Fe="identifierName"},identifierName(){switch(Ke){case"$":case"_":case"\u200C":case"\u200D":Pe+=Z();return;case"\\":Z(),Fe="identifierNameEs\
1573
+ cape";return}if(Mt.isIdContinueChar(Ke)){Pe+=Z();return}return $t("identifier",Pe)},identifierNameEscape(){if(Ke!=="u")throw Dt(Z());Z();const t=Cv();switch(t){case"$":case"_":case"\u200C":case"\u200D":break;default:if(!Mt.isIdContinueChar(t))throw zC();break}Pe+=t,Fe="identifierName"},sign(){switch(Ke){case".":Pe=Z(),Fe="decimalPointLeading";return;case"0":Pe=Z(),Fe="zero";return;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":Pe=Z(),Fe="decimalInteger";return;case"I":return Z(),
1574
+ po("nfinity"),$t("numeric",xi*(1/0));case"N":return Z(),po("aN"),$t("numeric",NaN)}throw Dt(Z())},zero(){switch(Ke){case".":Pe+=Z(),Fe="decimalPoint";return;case"e":case"E":Pe+=Z(),Fe="decimalExponent";return;case"x":case"X":Pe+=Z(),Fe="hexadecimal";return}return $t("numeric",xi*0)},decimalInteger(){switch(Ke){case".":Pe+=Z(),Fe="decimalPoint";return;case"e":case"E":Pe+=Z(),Fe="decimalExponent";return}if(Mt.isDigit(Ke)){Pe+=Z();return}return $t("numeric",xi*Number(Pe))},decimalPointLeading(){if(Mt.
1575
+ isDigit(Ke)){Pe+=Z(),Fe="decimalFraction";return}throw Dt(Z())},decimalPoint(){switch(Ke){case"e":case"E":Pe+=Z(),Fe="decimalExponent";return}if(Mt.isDigit(Ke)){Pe+=Z(),Fe="decimalFraction";return}return $t("numeric",xi*Number(Pe))},decimalFraction(){switch(Ke){case"e":case"E":Pe+=Z(),Fe="decimalExponent";return}if(Mt.isDigit(Ke)){Pe+=Z();return}return $t("numeric",xi*Number(Pe))},decimalExponent(){switch(Ke){case"+":case"-":Pe+=Z(),Fe="decimalExponentSign";return}if(Mt.isDigit(Ke)){Pe+=Z(),Fe="\
1576
+ decimalExponentInteger";return}throw Dt(Z())},decimalExponentSign(){if(Mt.isDigit(Ke)){Pe+=Z(),Fe="decimalExponentInteger";return}throw Dt(Z())},decimalExponentInteger(){if(Mt.isDigit(Ke)){Pe+=Z();return}return $t("numeric",xi*Number(Pe))},hexadecimal(){if(Mt.isHexDigit(Ke)){Pe+=Z(),Fe="hexadecimalInteger";return}throw Dt(Z())},hexadecimalInteger(){if(Mt.isHexDigit(Ke)){Pe+=Z();return}return $t("numeric",xi*Number(Pe))},string(){switch(Ke){case"\\":Z(),Pe+=nU();return;case'"':if(ud)return Z(),$t(
1577
+ "string",Pe);Pe+=Z();return;case"'":if(!ud)return Z(),$t("string",Pe);Pe+=Z();return;case`
1578
+ `:case"\r":throw Dt(Z());case"\u2028":case"\u2029":sU(Ke);break;case void 0:throw Dt(Z())}Pe+=Z()},start(){switch(Ke){case"{":case"[":return $t("punctuator",Z())}Fe="value"},beforePropertyName(){switch(Ke){case"$":case"_":Pe=Z(),Fe="identifierName";return;case"\\":Z(),Fe="identifierNameStartEscape";return;case"}":return $t("punctuator",Z());case'"':case"'":ud=Z()==='"',Fe="string";return}if(Mt.isIdStartChar(Ke)){Pe+=Z(),Fe="identifierName";return}throw Dt(Z())},afterPropertyName(){if(Ke===":")return $t(
1579
+ "punctuator",Z());throw Dt(Z())},beforePropertyValue(){Fe="value"},afterPropertyValue(){switch(Ke){case",":case"}":return $t("punctuator",Z())}throw Dt(Z())},beforeArrayValue(){if(Ke==="]")return $t("punctuator",Z());Fe="value"},afterArrayValue(){switch(Ke){case",":case"]":return $t("punctuator",Z())}throw Dt(Z())},end(){throw Dt(Z())}};function $t(t,e){return{type:t,value:e,line:is,column:Cr}}function po(t){for(const e of t){if(Ni()!==e)throw Dt(Z());Z()}}function nU(){switch(Ni()){case"b":return Z(),
1580
+ "\b";case"f":return Z(),"\f";case"n":return Z(),`
1581
+ `;case"r":return Z(),"\r";case"t":return Z()," ";case"v":return Z(),"\v";case"0":if(Z(),Mt.isDigit(Ni()))throw Dt(Z());return"\0";case"x":return Z(),rU();case"u":return Z(),Cv();case`
1582
+ `:case"\u2028":case"\u2029":return Z(),"";case"\r":return Z(),Ni()===`
1583
+ `&&Z(),"";case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":throw Dt(Z());case void 0:throw Dt(Z())}return Z()}function rU(){let t="",e=Ni();if(!Mt.isHexDigit(e)||(t+=Z(),e=Ni(),!Mt.isHexDigit(e)))throw Dt(Z());return t+=Z(),String.fromCodePoint(parseInt(t,16))}function Cv(){let t="",e=4;for(;e-- >0;){const n=Ni();if(!Mt.isHexDigit(n))throw Dt(Z());t+=Z()}return String.fromCodePoint(parseInt(t,16))}const iU={start(){if(Zt.type==="eof")throw ho();Av()},beforePropertyName(){switch(Zt.
1584
+ type){case"identifier":case"string":kv=Zt.value,_n="afterPropertyName";return;case"punctuator":$h();return;case"eof":throw ho()}},afterPropertyName(){if(Zt.type==="eof")throw ho();_n="beforePropertyValue"},beforePropertyValue(){if(Zt.type==="eof")throw ho();Av()},beforeArrayValue(){if(Zt.type==="eof")throw ho();if(Zt.type==="punctuator"&&Zt.value==="]"){$h();return}Av()},afterPropertyValue(){if(Zt.type==="eof")throw ho();switch(Zt.value){case",":_n="beforePropertyName";return;case"}":$h()}},afterArrayValue(){
1585
+ if(Zt.type==="eof")throw ho();switch(Zt.value){case",":_n="beforeArrayValue";return;case"]":$h()}},end(){}};function Av(){let t;switch(Zt.type){case"punctuator":switch(Zt.value){case"{":t={};break;case"[":t=[];break}break;case"null":case"boolean":case"numeric":case"string":t=Zt.value;break}if(ad===void 0)ad=t;else{const e=Pi[Pi.length-1];Array.isArray(e)?e.push(t):Object.defineProperty(e,kv,{value:t,writable:!0,enumerable:!0,configurable:!0})}if(t!==null&&typeof t=="object")Pi.push(t),Array.isArray(
1586
+ t)?_n="beforeArrayValue":_n="beforePropertyName";else{const e=Pi[Pi.length-1];e==null?_n="end":Array.isArray(e)?_n="afterArrayValue":_n="afterPropertyValue"}}function $h(){Pi.pop();const t=Pi[Pi.length-1];t==null?_n="end":Array.isArray(t)?_n="afterArrayValue":_n="afterPropertyValue"}function Dt(t){return Dh(t===void 0?`JSON5: invalid end of input at ${is}:${Cr}`:`JSON5: invalid character '${HC(t)}' at ${is}:${Cr}`)}function ho(){return Dh(`JSON5: invalid end of input at ${is}:${Cr}`)}function zC(){
1587
+ return Cr-=5,Dh(`JSON5: invalid identifier character at ${is}:${Cr}`)}function sU(t){console.warn(`JSON5: '${HC(t)}' in strings is not valid ECMAScript; consider escaping`)}function HC(t){const e={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};if(e[t])return e[t];if(t<" "){const n=t.charCodeAt(0).toString(16);return"\\x"+("00"+n).substring(n.length)}return t}function Dh(t){const e=new SyntaxError(
1588
+ t);return e.lineNumber=is,e.columnNumber=Cr,e}var oU=function(e,n,r){const i=[];let s="",o,a,u="",c;if(n!=null&&typeof n=="object"&&!Array.isArray(n)&&(r=n.space,c=n.quote,n=n.replacer),typeof n=="function")a=n;else if(Array.isArray(n)){o=[];for(const v of n){let w;typeof v=="string"?w=v:(typeof v=="number"||v instanceof String||v instanceof Number)&&(w=String(v)),w!==void 0&&o.indexOf(w)<0&&o.push(w)}}return r instanceof Number?r=Number(r):r instanceof String&&(r=String(r)),typeof r=="number"?r>
1589
+ 0&&(r=Math.min(10,Math.floor(r)),u=" ".substr(0,r)):typeof r=="string"&&(u=r.substr(0,10)),l("",{"":e});function l(v,w){let y=w[v];switch(y!=null&&(typeof y.toJSON5=="function"?y=y.toJSON5(v):typeof y.toJSON=="function"&&(y=y.toJSON(v))),a&&(y=a.call(w,v,y)),y instanceof Number?y=Number(y):y instanceof String?y=String(y):y instanceof Boolean&&(y=y.valueOf()),y){case null:return"null";case!0:return"true";case!1:return"false"}if(typeof y=="string")return f(y);if(typeof y=="number")return String(
1590
+ y);if(typeof y=="object")return Array.isArray(y)?m(y):d(y)}function f(v){const w={"'":.1,'"':.2},y={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};let E="";for(let A=0;A<v.length;A++){const N=v[A];switch(N){case"'":case'"':w[N]++,E+=N;continue;case"\0":if(Mt.isDigit(v[A+1])){E+="\\x00";continue}}if(y[N]){E+=y[N];continue}if(N<" "){let V=N.charCodeAt(0).toString(16);E+="\\x"+("00"+V).substring(V.length);
1591
+ continue}E+=N}const R=c||Object.keys(w).reduce((A,N)=>w[A]<w[N]?A:N);return E=E.replace(new RegExp(R,"g"),y[R]),R+E+R}function d(v){if(i.indexOf(v)>=0)throw TypeError("Converting circular structure to JSON5");i.push(v);let w=s;s=s+u;let y=o||Object.keys(v),E=[];for(const A of y){const N=l(A,v);if(N!==void 0){let V=p(A)+":";u!==""&&(V+=" "),V+=N,E.push(V)}}let R;if(E.length===0)R="{}";else{let A;if(u==="")A=E.join(","),R="{"+A+"}";else{let N=`,
1592
+ `+s;A=E.join(N),R=`{
1593
+ `+s+A+`,
1594
+ `+w+"}"}}return i.pop(),s=w,R}function p(v){if(v.length===0)return f(v);const w=String.fromCodePoint(v.codePointAt(0));if(!Mt.isIdStartChar(w))return f(v);for(let y=w.length;y<v.length;y++)if(!Mt.isIdContinueChar(String.fromCodePoint(v.codePointAt(y))))return f(v);return v}function m(v){if(i.indexOf(v)>=0)throw TypeError("Converting circular structure to JSON5");i.push(v);let w=s;s=s+u;let y=[];for(let R=0;R<v.length;R++){const A=l(String(R),v);y.push(A!==void 0?A:"null")}let E;if(y.length===0)E=
1595
+ "[]";else if(u==="")E="["+y.join(",")+"]";else{let R=`,
1596
+ `+s,A=y.join(R);E=`[
1597
+ `+s+A+`,
1598
+ `+w+"]"}return i.pop(),s=w,E}};const aU={parse:eU,stringify:oU};var KC=aU,Sv;function VC(t){return{lang:t?.lang??Sv?.lang,message:t?.message,abortEarly:t?.abortEarly??Sv?.abortEarly,abortPipeEarly:t?.abortPipeEarly??Sv?.abortPipeEarly}}var uU;function cU(t){return uU?.get(t)}var lU;function dU(t){return lU?.get(t)}var fU;function pU(t,e){return fU?.get(t)?.get(e)}function hU(t){const e=typeof t;return e==="string"?`"${t}"`:e==="number"||e==="bigint"||e==="boolean"?`${t}`:e==="object"||e==="funct\
1599
+ ion"?(t&&Object.getPrototypeOf(t)?.constructor?.name)??"null":e}function cd(t,e,n,r,i){const s=i&&"input"in i?i.input:n.value,o=i?.expected??t.expects??null,a=i?.received??hU(s),u={kind:t.kind,type:t.type,input:s,expected:o,received:a,message:`Invalid ${e}: ${o?`Expected ${o} but r`:"R"}eceived ${a}`,requirement:t.requirement,path:i?.path,issues:i?.issues,lang:r.lang,abortEarly:r.abortEarly,abortPipeEarly:r.abortPipeEarly},c=t.kind==="schema",l=i?.message??t.message??pU(t.reference,u.lang)??(c?dU(
1600
+ u.lang):null)??r.message??cU(u.lang);l!==void 0&&(u.message=typeof l=="function"?l(u):l),c&&(n.typed=!1),n.issues?n.issues.push(u):n.issues=[u]}function ld(t){return{version:1,vendor:"valibot",validate(e){return t["~run"]({value:e},VC())}}}var mU=class extends Error{constructor(t){super(t[0].message),this.name="ValiError",this.issues=t}};function Rh(t){return{kind:"metadata",type:"description",reference:Rh,description:t}}function XC(t){return{kind:"validation",type:"non_empty",reference:XC,async:!1,
1601
+ expects:"!0",message:t,"~run"(e,n){return e.typed&&e.value.length===0&&cd(this,"length",e,n,{received:"0"}),e}}}function gU(t,e,n){return typeof t.fallback=="function"?t.fallback(e,n):t.fallback}function YC(t,e,n){return typeof t.default=="function"?t.default(e,n):t.default}function JC(t,e){return{kind:"schema",type:"array",reference:JC,expects:"Array",async:!1,item:t,message:e,get"~standard"(){return ld(this)},"~run"(n,r){const i=n.value;if(Array.isArray(i)){n.typed=!0,n.value=[];for(let s=0;s<
1602
+ i.length;s++){const o=i[s],a=this.item["~run"]({value:o},r);if(a.issues){const u={type:"array",origin:"value",input:i,key:s,value:o};for(const c of a.issues)c.path?c.path.unshift(u):c.path=[u],n.issues?.push(c);if(n.issues||(n.issues=a.issues),r.abortEarly){n.typed=!1;break}}a.typed||(n.typed=!1),n.value.push(a.value)}}else cd(this,"type",n,r);return n}}}function QC(t,e){return{kind:"schema",type:"object",reference:QC,expects:"Object",async:!1,entries:t,message:e,get"~standard"(){return ld(this)},
1603
+ "~run"(n,r){const i=n.value;if(i&&typeof i=="object"){n.typed=!0,n.value={};for(const s in this.entries){const o=this.entries[s];if(s in i||(o.type==="exact_optional"||o.type==="optional"||o.type==="nullish")&&o.default!==void 0){const a=s in i?i[s]:YC(o),u=o["~run"]({value:a},r);if(u.issues){const c={type:"object",origin:"value",input:i,key:s,value:a};for(const l of u.issues)l.path?l.path.unshift(c):l.path=[c],n.issues?.push(l);if(n.issues||(n.issues=u.issues),r.abortEarly){n.typed=!1;break}}u.
1604
+ typed||(n.typed=!1),n.value[s]=u.value}else if(o.fallback!==void 0)n.value[s]=gU(o);else if(o.type!=="exact_optional"&&o.type!=="optional"&&o.type!=="nullish"&&(cd(this,"key",n,r,{input:void 0,expected:`"${s}"`,path:[{type:"object",origin:"key",input:i,key:s,value:i[s]}]}),r.abortEarly))break}}else cd(this,"type",n,r);return n}}}function _v(t,e){return{kind:"schema",type:"optional",reference:_v,expects:`(${t.expects} | undefined)`,async:!1,wrapped:t,default:e,get"~standard"(){return ld(this)},"~\
1605
+ run"(n,r){return n.value===void 0&&(this.default!==void 0&&(n.value=YC(this,n,r)),n.value===void 0)?(n.typed=!0,n):this.wrapped["~run"](n,r)}}}function Pv(t){return{kind:"schema",type:"string",reference:Pv,expects:"string",async:!1,message:t,get"~standard"(){return ld(this)},"~run"(e,n){return typeof e.value=="string"?e.typed=!0:cd(this,"type",e,n),e}}}function yU(t,e,n){const r=t["~run"]({value:e},VC(n));if(r.issues)throw new mU(r.issues);return r.value}function kh(...t){return{...t[0],pipe:t,get"\
1606
+ ~standard"(){return ld(this)},"~run"(e,n){for(const r of t)if(r.kind!=="metadata"){if(e.issues&&(r.kind==="schema"||r.kind==="transformation")){e.typed=!1;break}(!e.issues||!n.abortEarly&&!n.abortPipeEarly)&&(e=r["~run"](e,n))}return e}}}const ZC=kh(Pv(),XC()),vU=QC({name:kh(ZC,Rh("Project name, must be unique in the workspace")),contactPerson:_v(kh(ZC,Rh("A person who has been involved in creating or maintaining this project"))),exclude:_v(kh(JC(Pv()),Rh('List of file patterns to exclude from t\
1607
+ he project, default is ["**/node_modules/**/*"]')))});function wU(t){return bU(KC.parse(t))}function bU(t){return yU(vU,t)}const eA=st.getChild("ProjectsManager");class jn{constructor(e){this.services=e,eA.debug`created`}static DefaultProjectId="default";static ConfigFileNames=[".likec4rc",".likec4.config.json","likec4.config.json"];projectIdToFolder=new v_;_projects=[];defaultGlobalProject={id:jn.DefaultProjectId,config:{name:jn.DefaultProjectId,exclude:["**/node_modules/**/*"]},exclude:MC("**/\
1608
+ node_modules/**/*")};get defaultProjectId(){if(!(this._projects.length>1))return this._projects[0]?.id??jn.DefaultProjectId}get all(){return cr(this._projects,1)?[...xt(this._projects,fi("id")),jn.DefaultProjectId]:[jn.DefaultProjectId]}getProject(e){const n=typeof e=="string"?e:e.likec4ProjectId||this.belongsTo(e);if(n===jn.DefaultProjectId){const s=this.services.workspace.WorkspaceManager.workspaceUri;return{id:n,folder:s,config:this.defaultGlobalProject.config}}const{config:r,folder:i}=It(this.
1609
+ _projects.find(s=>s.id===n),`Project "${n}" not found`);return{id:n,folder:yt.parse(i),config:r}}ensureProjectId(e){return e===jn.DefaultProjectId?e:e?(_e(this.projectIdToFolder.has(e),`Project ID ${e} is not registered`),e):It(this.defaultProjectId,()=>`Specify exact project, known: [${[...this.projectIdToFolder.keys()].join(", ")}]`)}hasMultipleProjects(){return this._projects.length>1}checkIfExcluded(e){let n=e.toString();const r=this.findProjectForDocument(n);return r.exclude?r.exclude(UC(n)):
1610
+ !1}isConfigFile(e){const n=Y8(e.uri.toString(),{strict:!1})?.toLowerCase();return!!n&&jn.ConfigFileNames.includes(n)}async loadConfigFile(e){if(!e.isDirectory&&this.isConfigFile(e))return await this.registerProject(e.uri)}async registerProject(e){if(yt.isUri(e)){const u=e,c=await this.services.workspace.FileSystemProvider.readFile(u),l=wU(c),f=bh(u.path,".."),d=u.with({path:f});return this.registerProject({config:l,folderUri:d})}const{config:n,folderUri:r}=e;let i=n.name,s=1;for(;this.projectIdToFolder.
1611
+ has(i);)i=`${n.name}-${s++}`;let o;yt.isUri(r)?o=r.toString():o=rs(r)?r:$v(r,"file://");const a={id:i,config:n,folder:o};return Rt(n.exclude)?a.exclude=this.defaultGlobalProject.exclude:cr(n.exclude,1)&&(a.exclude=MC(n.exclude)),this._projects=He([...this._projects,a],g4([({folder:u})=>UC(u).split("/").length,"desc"])),this.projectIdToFolder.set(i,o),eA.info`register project ${i} folder: ${o})`,a}belongsTo(e){let n;return typeof e=="string"?n=rs(e)?e:$v(e,"file://"):yt.isUri(e)?n=e.toString():n=
1612
+ e.uri.toString(),this.findProjectForDocument(n).id}findProjectForDocument(e){return this.mappingsToProject.get(e,()=>this._projects.find(({folder:n})=>e.startsWith(n))??this.defaultGlobalProject)}_mappingsToProject;get mappingsToProject(){return this._mappingsToProject??=new np(this.services),this._mappingsToProject}}const EU={fileSystemProvider:()=>new RU},$U=[...wv.fileExtensions,...jn.ConfigFileNames],DU=t=>$U.some(e=>t.endsWith(e));let RU=class extends ZG{async readFile(e){return id(e)?Promise.
1613
+ resolve(OC):await super.readFile(e)}async readDirectory(e){const n=[];try{const r=await new QG.fdir().withSymlinks({resolvePaths:!1}).withFullPaths().filter(DU).crawl(e.fsPath).withPromise();for(const i of r)n.push({isFile:!0,isDirectory:!1,uri:yt.file(i)})}catch(r){sd(r)}return n}};var kU=Object.getOwnPropertyNames,TU=Object.getOwnPropertySymbols,CU=Object.prototype.hasOwnProperty;function tA(t,e){return function(r,i,s){return t(r,i,s)&&e(r,i,s)}}function Th(t){return function(n,r,i){if(!n||!r||
1614
+ typeof n!="object"||typeof r!="object")return t(n,r,i);var s=i.cache,o=s.get(n),a=s.get(r);if(o&&a)return o===r&&a===n;s.set(n,r),s.set(r,n);var u=t(n,r,i);return s.delete(n),s.delete(r),u}}function nA(t){return kU(t).concat(TU(t))}var AU=Object.hasOwn||function(t,e){return CU.call(t,e)};function mo(t,e){return t===e||!t&&!e&&t!==t&&e!==e}var SU="__v",_U="__o",PU="_owner",rA=Object.getOwnPropertyDescriptor,iA=Object.keys;function xU(t,e,n){var r=t.length;if(e.length!==r)return!1;for(;r-- >0;)if(!n.
1615
+ equals(t[r],e[r],r,r,t,e,n))return!1;return!0}function NU(t,e){return mo(t.getTime(),e.getTime())}function IU(t,e){return t.name===e.name&&t.message===e.message&&t.cause===e.cause&&t.stack===e.stack}function OU(t,e){return t===e}function sA(t,e,n){var r=t.size;if(r!==e.size)return!1;if(!r)return!0;for(var i=new Array(r),s=t.entries(),o,a,u=0;(o=s.next())&&!o.done;){for(var c=e.entries(),l=!1,f=0;(a=c.next())&&!a.done;){if(i[f]){f++;continue}var d=o.value,p=a.value;if(n.equals(d[0],p[0],u,f,t,e,n)&&
1616
+ n.equals(d[1],p[1],d[0],p[0],t,e,n)){l=i[f]=!0;break}f++}if(!l)return!1;u++}return!0}var FU=mo;function LU(t,e,n){var r=iA(t),i=r.length;if(iA(e).length!==i)return!1;for(;i-- >0;)if(!aA(t,e,n,r[i]))return!1;return!0}function dd(t,e,n){var r=nA(t),i=r.length;if(nA(e).length!==i)return!1;for(var s,o,a;i-- >0;)if(s=r[i],!aA(t,e,n,s)||(o=rA(t,s),a=rA(e,s),(o||a)&&(!o||!a||o.configurable!==a.configurable||o.enumerable!==a.enumerable||o.writable!==a.writable)))return!1;return!0}function MU(t,e){return mo(
1617
+ t.valueOf(),e.valueOf())}function BU(t,e){return t.source===e.source&&t.flags===e.flags}function oA(t,e,n){var r=t.size;if(r!==e.size)return!1;if(!r)return!0;for(var i=new Array(r),s=t.values(),o,a;(o=s.next())&&!o.done;){for(var u=e.values(),c=!1,l=0;(a=u.next())&&!a.done;){if(!i[l]&&n.equals(o.value,a.value,o.value,a.value,t,e,n)){c=i[l]=!0;break}l++}if(!c)return!1}return!0}function qU(t,e){var n=t.length;if(e.length!==n)return!1;for(;n-- >0;)if(t[n]!==e[n])return!1;return!0}function jU(t,e){return t.
1618
+ hostname===e.hostname&&t.pathname===e.pathname&&t.protocol===e.protocol&&t.port===e.port&&t.hash===e.hash&&t.username===e.username&&t.password===e.password}function aA(t,e,n,r){return(r===PU||r===_U||r===SU)&&(t.$$typeof||e.$$typeof)?!0:AU(e,r)&&n.equals(t[r],e[r],r,r,t,e,n)}var GU="[object Arguments]",UU="[object Boolean]",WU="[object Date]",zU="[object Error]",HU="[object Map]",KU="[object Number]",VU="[object Object]",XU="[object RegExp]",YU="[object Set]",JU="[object String]",QU="[object URL\
1619
+ ]",ZU=Array.isArray,uA=typeof ArrayBuffer=="function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,cA=Object.assign,eW=Object.prototype.toString.call.bind(Object.prototype.toString);function tW(t){var e=t.areArraysEqual,n=t.areDatesEqual,r=t.areErrorsEqual,i=t.areFunctionsEqual,s=t.areMapsEqual,o=t.areNumbersEqual,a=t.areObjectsEqual,u=t.arePrimitiveWrappersEqual,c=t.areRegExpsEqual,l=t.areSetsEqual,f=t.areTypedArraysEqual,d=t.areUrlsEqual;return function(m,v,w){if(m===v)return!0;if(m==null||v==null)
1620
+ return!1;var y=typeof m;if(y!==typeof v)return!1;if(y!=="object")return y==="number"?o(m,v,w):y==="function"?i(m,v,w):!1;var E=m.constructor;if(E!==v.constructor)return!1;if(E===Object)return a(m,v,w);if(ZU(m))return e(m,v,w);if(uA!=null&&uA(m))return f(m,v,w);if(E===Date)return n(m,v,w);if(E===RegExp)return c(m,v,w);if(E===Map)return s(m,v,w);if(E===Set)return l(m,v,w);var R=eW(m);return R===WU?n(m,v,w):R===XU?c(m,v,w):R===HU?s(m,v,w):R===YU?l(m,v,w):R===VU?typeof m.then!="function"&&typeof v.then!=
1621
+ "function"&&a(m,v,w):R===QU?d(m,v,w):R===zU?r(m,v,w):R===GU?a(m,v,w):R===UU||R===KU||R===JU?u(m,v,w):!1}}function nW(t){var e=t.circular,n=t.createCustomConfig,r=t.strict,i={areArraysEqual:r?dd:xU,areDatesEqual:NU,areErrorsEqual:IU,areFunctionsEqual:OU,areMapsEqual:r?tA(sA,dd):sA,areNumbersEqual:FU,areObjectsEqual:r?dd:LU,arePrimitiveWrappersEqual:MU,areRegExpsEqual:BU,areSetsEqual:r?tA(oA,dd):oA,areTypedArraysEqual:r?dd:qU,areUrlsEqual:jU};if(n&&(i=cA({},i,n(i))),e){var s=Th(i.areArraysEqual),o=Th(
1622
+ i.areMapsEqual),a=Th(i.areObjectsEqual),u=Th(i.areSetsEqual);i=cA({},i,{areArraysEqual:s,areMapsEqual:o,areObjectsEqual:a,areSetsEqual:u})}return i}function rW(t){return function(e,n,r,i,s,o,a){return t(e,n,a)}}function iW(t){var e=t.circular,n=t.comparator,r=t.createState,i=t.equals,s=t.strict;if(r)return function(u,c){var l=r(),f=l.cache,d=f===void 0?e?new WeakMap:void 0:f,p=l.meta;return n(u,c,{cache:d,equals:i,meta:p,strict:s})};if(e)return function(u,c){return n(u,c,{cache:new WeakMap,equals:i,
1623
+ meta:void 0,strict:s})};var o={cache:void 0,equals:i,meta:void 0,strict:s};return function(u,c){return n(u,c,o)}}var xv=ss();ss({strict:!0}),ss({circular:!0}),ss({circular:!0,strict:!0}),ss({createInternalComparator:function(){return mo}}),ss({strict:!0,createInternalComparator:function(){return mo}}),ss({circular:!0,createInternalComparator:function(){return mo}}),ss({circular:!0,createInternalComparator:function(){return mo},strict:!0});function ss(t){t===void 0&&(t={});var e=t.circular,n=e===
1624
+ void 0?!1:e,r=t.createInternalComparator,i=t.createState,s=t.strict,o=s===void 0?!1:s,a=nW(t),u=tW(a),c=r?r(u):rW(u);return iW({circular:n,comparator:u,createState:i,equals:c,strict:o})}function lA(t,e){const n=t.nodes.map(i=>{const s=e.nodes[i.id];if(!s)return i;const{x:o,y:a,width:u,height:c}=s;return{...i,width:u,height:c,position:[o,a]}}),r=t.edges.map(i=>{const s=e.edges[i.id];return s?{...i,...s}:i});return{...t,bounds:{x:e.x,y:e.y,width:e.width,height:e.height},nodes:n,edges:r}}const dA=(t,e)=>t.
1625
+ width>e.width+10||t.height>e.height+10;function sW(t,e){if(t.hash===e.hash)return{diagram:lA(t,e)};if(xv(t.autoLayout,e.autoLayout)&&t.nodes.every(r=>{const i=e.nodes[r.id];return!!i&&(r.children.length>0&&i.isCompound||r.children.length===0&&!i.isCompound)&&(i.isCompound||dA(r,i)===!1)})&&t.edges.every(r=>{const i=e.edges[r.id];return!!i&&(!r.labelBBox&&!i.labelBBox||!!r.labelBBox&&!!i.labelBBox&&r.labelBBox.width<=i.labelBBox.width&&r.labelBBox.height<=i.labelBBox.height)}))return{diagram:lA(t,
1626
+ e)};const n=t.nodes.reduce((r,i)=>{const s=e.nodes[i.id];if(i.children.length>0||!s)return r;const o={id:i.id,center:{x:Math.round(s.x+s.width/2),y:Math.round(s.y+s.height/2)}};return s.isCompound||dA(i,s)||(o.fixedsize={width:s.width,height:s.height}),r.push(o),r},[]);return{relayout:{x:e.x,y:e.y,height:e.height,nodes:n,edges:ec(e.edges).flatMap(([r,i])=>i.dotpos?{id:r,dotpos:i.dotpos}:[])}}}function fA(t){return typeof t=="object"&&t!==null&&typeof t.id=="string"}function Nv(t){return typeof t==
1627
+ "object"&&t!==null&&t.$$type==="Node"&&typeof t.id=="string"}function pA(t){return Nv(t)||fA(t)}function fd(t){return typeof t=="string"||pA(t)}function oW(t){return Array.isArray(t)&&t.every(fd)}function aW(t){return["n","ne","e","se","s","sw","w","nw","c"].includes(t)}function hA(t){if(pA(t))return t;const[e,n,r]=t.split(":");return aW(r)?{id:e,port:n,compass:r}:{id:e,port:n}}function uW(t){if(t.length<2&&(fd(t[0])&&fd(t[1]))===!1)throw Error("EdgeTargets must have at least 2 elements.");return t.
1628
+ map(e=>hA(e))}const Ch=Object.seal({Graph:null,Digraph:null,Subgraph:null,Node:null,Edge:null});function cW(t){return Object.assign(Object.seal(Object.assign({},Ch)),t)}function lW(...t){const[e,...n]=t;return(...r)=>n.reduce((i,s)=>s(i),e(...r))}function lr(t,...e){return lW(t,...e)}const dW=t=>(...e)=>n=>t(n,...e),fW=t=>({[Symbol.iterator]:t}),Ar=dW((t,e)=>Array.from(fW(function*(){for(const n of t)yield e(n)})));class mA{options;getLocation(){return this.options?.locationFunction?.()??null}constructor(e){
1629
+ this.options=e}createElement(e,n,r=[]){return{location:this.getLocation(),...n,type:e,children:r}}}const rt=mA.prototype.createElement.bind(new mA),pW=/\r?\n/;function Sr(t){return e=>e.join(t)}function hW(t){return e=>t+e+t}function os(t,e){return n=>t+n+e}function Ah(t){return e=>t+e}const gA=t=>t.replace(/\r/g,"\\r").replace(/\n/g,"\\n").replace(/"/g,'\\"'),Sh=t=>t.split(pW),pd=(t,e,n)=>lr(Sh,Ar(Ah(t==="space"?" ".repeat(e):`
1630
+ `)),Sr(n)),go=t=>{switch(t){case"crlf":return`\r
1631
+ `;case"lf":return`
1632
+ `}},mW={match(t){return t.type==="AttributeList"},print(t,e){if(e.children.length===0)return`${e.kind.toLocaleLowerCase()} [];`;const n=go(t.endOfLine);return lr(Ar(t.print),Sr(n),pd(t.indentStyle,t.indentSize,n),os(`${e.kind.toLocaleLowerCase()} [${n}`,`${n}];`))(e.children)}},gW={match(t){return t.type==="Attribute"},print(t,e){return`${t.print(e.key)} = ${t.print(e.value)};`}},yW={match(t){return t.type==="Comment"},print(t,e){const n=go(t.endOfLine);switch(e.kind){case"Block":return lr(Sh,Ar(
1633
+ Ah(" * ")),Sr(n),os(`/**${n}`,`${n} */`))(e.value);case"Macro":return lr(Sh,Ar(Ah("# ")),Sr(n))(e.value);case"Slash":default:return lr(Sh,Ar(Ah("// ")),Sr(n))(e.value)}}},vW={match(t){return t.type==="Dot"},print(t,e){return e.children.map(t.print).join(go(t.endOfLine))}},wW={match(t){return t.type==="Edge"},print(t,e){const n=lr(Ar(t.print),Sr(t.directed?" -> ":" -- "))(e.targets);if(e.children.length===0)return`${n};`;const r=go(t.endOfLine),i=lr(Ar(t.print),Sr(r),pd(t.indentStyle,t.indentSize,
1634
+ r),os(`[${r}`,`${r}];`))(e.children);return`${n} ${i}`}},bW={match(t){return t.type==="Graph"},print(t,e){t.directed=e.directed;const n=[];if(e.strict&&n.push("strict"),n.push(e.directed?"digraph":"graph"),e.id&&n.push(t.print(e.id)),e.children.length===0)return`${n.join(" ")} {}`;const r=go(t.endOfLine),i=lr(Ar(t.print),Sr(r),pd(t.indentStyle,t.indentSize,r),os(`{${r}`,`${r}}`))(e.children);return`${n.join(" ")} ${i}`}},EW=lr(gA,hW('"')),$W=os("<",">"),DW={match(t){return t.type==="Literal"},print(t,e){
1635
+ switch(e.quoted){case"html":return $W(e.value);case!0:return EW(e.value);case!1:default:return gA(e.value)}}},RW={match(t){return t.type==="Node"},print(t,e){const n=t.print(e.id);if(e.children.length===0)return`${n};`;const r=go(t.endOfLine),i=lr(Ar(t.print),Sr(r),pd(t.indentStyle,t.indentSize,r),os(`[${r}`,`${r}];`))(e.children);return`${n} ${i}`}},kW={match(t){return t.type==="NodeRefGroup"},print(t,e){return lr(Ar(t.print),Sr(" "),os("{","}"))(e.children)}},TW={match(t){return t.type==="Node\
1636
+ Ref"},print(t,e){const n=[t.print(e.id)];return e.port&&n.push(t.print(e.port)),e.compass&&n.push(t.print(e.compass)),n.join(":")}},CW={match(t){return t.type==="Subgraph"},print(t,e){const n=["subgraph"];if(e.id&&n.push(t.print(e.id)),e.children.length===0)return`${n.join(" ")} {}`;const r=go(t.endOfLine),i=lr(Ar(t.print),Sr(r),pd(t.indentStyle,t.indentSize,r),os(`{${r}`,`${r}}`))(e.children);return`${n.join(" ")} ${i}`}},AW=[mW,gW,yW,vW,wW,bW,DW,RW,kW,TW,CW];class SW{options;#e=[...AW];constructor(e={}){
1637
+ this.options=e}print(e){const n=[...this.#e],{indentSize:r=2,indentStyle:i="space",endOfLine:s="lf"}=this.options,o={directed:!0,indentSize:r,indentStyle:i,endOfLine:s,print(a){for(const u of n)if(u.match(a))return u.print(o,a);throw Error()}};return o.print(e)}}function _W(t,e){const n=new SW(e).print(t);if(!n)throw new Error;return n}function _h(t,e){if(typeof e=="string"){const n=e.trim();return/^<.+>$/ms.test(n)?rt("Attribute",{key:rt("Literal",{value:t,quoted:!1},[]),value:rt("Literal",{value:n.
1638
+ slice(1,n.length-1),quoted:"html"},[])},[]):rt("Attribute",{key:rt("Literal",{value:t,quoted:!1},[]),value:rt("Literal",{value:e,quoted:!0},[])},[])}return rt("Attribute",{key:rt("Literal",{value:t,quoted:!1},[]),value:rt("Literal",{value:String(e),quoted:!1},[])},[])}function yo(t,e){return rt("Comment",{kind:e,value:t},[])}function yA(t,e){return Array.from(function*(){for(const[n,r]of e.values)yield _h(n,r);for(const n of Object.values(e.attributes))n.size>0&&(n.comment&&(yield yo(n.comment,t.
1639
+ commentKind)),yield t.convert(n));for(const n of e.nodes)n.comment&&(yield yo(n.comment,t.commentKind)),yield t.convert(n);for(const n of e.subgraphs)n.comment&&(yield yo(n.comment,t.commentKind)),yield t.convert(n);for(const n of e.edges)n.comment&&(yield yo(n.comment,t.commentKind)),yield t.convert(n)}())}const PW={match(t){return t.$$type==="AttributeList"},convert(t,e){return rt("AttributeList",{kind:e.$$kind},e.values.map(([n,r])=>_h(n,r)))}},xW={match(t){return t.$$type==="Edge"},convert(t,e){
1640
+ return rt("Edge",{targets:e.targets.map(n=>Nv(n)?rt("NodeRef",{id:rt("Literal",{value:n.id,quoted:!0},[])},[]):fA(n)?rt("NodeRef",{id:rt("Literal",{value:n.id,quoted:!0},[]),port:n.port?rt("Literal",{value:n.port,quoted:!0},[]):void 0,compass:n.compass?rt("Literal",{value:n.compass,quoted:!0},[]):void 0},[]):rt("NodeRefGroup",{},n.map(r=>Nv(r)?rt("NodeRef",{id:rt("Literal",{value:r.id,quoted:!0},[])},[]):rt("NodeRef",{id:rt("Literal",{value:r.id,quoted:!0},[]),port:r.port?rt("Literal",{value:r.port,
1641
+ quoted:!0},[]):void 0,compass:r.compass?rt("Literal",{value:r.compass,quoted:!0},[]):void 0},[]))))},[...e.attributes.comment?[yo(e.attributes.comment,t.commentKind)]:[],...e.attributes.values.map(([n,r])=>_h(n,r))])}},NW={match(t){return t.$$type==="Graph"},convert(t,e){return rt("Dot",{},[...e.comment?[yo(e.comment,t.commentKind)]:[],rt("Graph",{directed:e.directed,strict:e.strict,id:e.id?rt("Literal",{value:e.id,quoted:!0},[]):void 0},yA(t,e))])}},IW={match(t){return t.$$type==="Node"},convert(t,e){
1642
+ return rt("Node",{id:rt("Literal",{value:e.id,quoted:!0},[])},[...e.attributes.comment?[yo(e.attributes.comment,t.commentKind)]:[],...e.attributes.values.map(([n,r])=>_h(n,r))])}},OW={match(t){return t.$$type==="Subgraph"},convert(t,e){return rt("Subgraph",{id:e.id?rt("Literal",{value:e.id,quoted:!0},[]):void 0},yA(t,e))}},FW=[PW,xW,IW,NW,OW];class LW{options;#e=[...FW];constructor(e={}){this.options=e}convert(e){const n=[...this.#e],{commentKind:r="Slash"}=this.options,i={commentKind:r,convert(s){
1643
+ for(const o of n)if(o.match(s))return o.convert(i,s);throw Error()}};return i.convert(e)}}function MW(t,e){return new LW(e).convert(t)}const F=new Proxy(Object.freeze({}),{get:(t,e)=>e});class Iv{}class Ov extends Iv{#e=new Map;constructor(e){super(),e!==void 0&&this.apply(e)}get values(){return Array.from(this.#e.entries())}get size(){return this.#e.size}get(e){return this.#e.get(e)}set(e,n){n!=null&&this.#e.set(e,n)}delete(e){this.#e.delete(e)}apply(e){const n=Array.isArray(e)?e:Object.entries(
1644
+ e);for(const[r,i]of n)this.set(r,i)}clear(){this.#e.clear()}}class Fv extends Ov{$$kind;get $$type(){return"AttributeList"}comment;constructor(e,n){super(n),this.$$kind=e}}class vA extends Ov{#e=Ch;id;comment;attributes=Object.freeze({graph:new Fv("Graph"),edge:new Fv("Edge"),node:new Fv("Node")});get nodes(){return Array.from(this.#t.nodes.values())}get edges(){return Array.from(this.#t.edges.values())}get subgraphs(){return Array.from(this.#t.subgraphs.values())}#t={nodes:new Map,edges:new Set,
1645
+ subgraphs:new Set};with(e){this.#e=cW(e)}addNode(e){this.#t.nodes.set(e.id,e)}addEdge(e){this.#t.edges.add(e)}addSubgraph(e){this.#t.subgraphs.add(e)}existNode(e){return this.#t.nodes.has(e)}existEdge(e){return this.#t.edges.has(e)}existSubgraph(e){return this.#t.subgraphs.has(e)}createSubgraph(...e){const n=new this.#e.Subgraph(...e);return n.with(this.#e),this.addSubgraph(n),n}removeNode(e){this.#t.nodes.delete(typeof e=="string"?e:e.id)}removeEdge(e){this.#t.edges.delete(e)}removeSubgraph(e){
1646
+ this.#t.subgraphs.delete(e)}createNode(e,n){const r=new this.#e.Node(e,n);return this.addNode(r),r}getSubgraph(e){return Array.from(this.#t.subgraphs.values()).find(n=>n.id===e)}getNode(e){return this.#t.nodes.get(e)}createEdge(e,n){const r=e.map(s=>oW(s)?uW(s):hA(s)),i=new this.#e.Edge(r,n);return this.addEdge(i),i}subgraph(...e){const n=e.find(o=>typeof o=="string"),r=e.find(o=>typeof o=="object"&&o!==null),i=e.find(o=>typeof o=="function"),s=n?this.getSubgraph(n)??this.createSubgraph(n):this.
1647
+ createSubgraph();return r!==void 0&&s.apply(r),i!==void 0&&i(s),s}node(e,...n){if(typeof e=="string"){const r=e,i=n.find(a=>typeof a=="object"&&a!==null),s=n.find(a=>typeof a=="function"),o=this.getNode(r)??this.createNode(r);return i!==void 0&&o.attributes.apply(i),s!==void 0&&s(o),o}typeof e=="object"&&e!==null&&this.attributes.node.apply(e)}edge(e,...n){if(Array.isArray(e)){const r=e,i=n.find(a=>typeof a=="object"),s=n.find(a=>typeof a=="function"),o=this.createEdge(r,i);return s!==void 0&&s(
1648
+ o),o}typeof e=="object"&&e!==null&&this.attributes.edge.apply(e)}graph(e){this.attributes.graph.apply(e)}}class wA extends vA{get $$type(){return"Graph"}id;strict;constructor(...e){super(),this.id=e.find(r=>typeof r=="string"),this.strict=e.find(r=>typeof r=="boolean")??!1;const n=e.find(r=>typeof r=="object"&&r!==null);n!==void 0&&this.apply(n)}}class BW extends wA{get directed(){return!0}}let qW=class extends wA{get directed(){return!1}};class jW extends vA{get $$type(){return"Subgraph"}id;constructor(...e){
1649
+ super(),this.id=e.find(r=>typeof r=="string");const n=e.find(r=>typeof r=="object"&&r!==null);n!==void 0&&this.apply(n)}isSubgraphCluster(){return typeof this.id=="string"?this.id.startsWith("cluster"):!1}}class bA extends Ov{comment}let GW=class extends Iv{id;get $$type(){return"Node"}comment;attributes;constructor(e,n){super(),this.id=e,this.attributes=new bA(n)}port(e){return typeof e=="string"?{id:this.id,port:e}:{id:this.id,...e}}};class UW extends Iv{targets;get $$type(){return"Edge"}comment;attributes;constructor(e,n){
1650
+ if(super(),this.targets=e,e.length<2&&(fd(e[0])&&fd(e[1]))===!1)throw Error("The element of Edge target is missing or not satisfied as Edge target.");this.attributes=new bA(n)}}Object.assign(Ch,{Graph:qW,Digraph:BW,Subgraph:jW,Node:GW,Edge:UW});function EA(t,e){return(...n)=>{const r=t?this.Digraph:this.Graph,i=n.find(u=>typeof u=="string"),s=n.find(u=>typeof u=="object"),o=n.find(u=>typeof u=="function"),a=new r(i,e,s);return a.with(this),typeof o=="function"&&o(a),a}}function $A(t,e=Ch){return Object.
1651
+ freeze({digraph:EA.call(e,!0,t),graph:EA.call(e,!1,t)})}const DA=$A(!1),WW=DA.digraph;DA.graph;const zW=$A(!0);function RA(t,e){const n=MW(t,e?.convert);return _W(n,e?.print)}var Lv,kA;function HW(){if(kA)return Lv;kA=1;function t(r){let i=r.length-1,s=r[i];for(;s===" "||s===" ";)s=r[--i];return r.substring(0,i+1)}function e(r){return r.split(`
1652
+ `).map(o=>t(o)).join(`
1653
+ `)}Lv=function(r,i){if(i=i||{},r==null)return r;var s=i.width||50,o=typeof i.indent=="string"?i.indent:" ",a=i.newline||`
1654
+ `+o,u=typeof i.escape=="function"?i.escape:n,c=".{1,"+s+"}";i.cut!==!0&&(c+="([\\s\u200B]+|$)|[^\\s\u200B]+?([\\s\u200B]+|$)");var l=new RegExp(c,"g"),f=r.match(l)||[],d=o+f.map(function(p){return p.slice(-1)===`
1655
+ `&&(p=p.slice(0,p.length-1)),u(p)}).join(a);return i.trim===!0&&(d=e(d)),d};function n(r){return r}return Lv}var KW=HW();const VW=Jr(KW),Ph={min:{r:0,g:0,b:0,s:0,l:0,a:0},max:{r:255,g:255,b:255,h:360,s:100,l:100,a:1},clamp:{r:t=>t>=255?255:t<0?0:t,g:t=>t>=255?255:t<0?0:t,b:t=>t>=255?255:t<0?0:t,h:t=>t%360,s:t=>t>=100?100:t<0?0:t,l:t=>t>=100?100:t<0?0:t,a:t=>t>=1?1:t<0?0:t},toLinear:t=>{const e=t/255;return t>.03928?Math.pow((e+.055)/1.055,2.4):e/12.92},hue2rgb:(t,e,n)=>(n<0&&(n+=1),n>1&&(n-=1),n<
1656
+ 1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*(2/3-n)*6:t),hsl2rgb:({h:t,s:e,l:n},r)=>{if(!e)return n*2.55;t/=360,e/=100,n/=100;const i=n<.5?n*(1+e):n+e-n*e,s=2*n-i;switch(r){case"r":return Ph.hue2rgb(s,i,t+1/3)*255;case"g":return Ph.hue2rgb(s,i,t)*255;case"b":return Ph.hue2rgb(s,i,t-1/3)*255}},rgb2hsl:({r:t,g:e,b:n},r)=>{t/=255,e/=255,n/=255;const i=Math.max(t,e,n),s=Math.min(t,e,n),o=(i+s)/2;if(r==="l")return o*100;if(i===s)return 0;const a=i-s,u=o>.5?a/(2-i-s):a/(i+s);if(r==="s")return u*100;switch(i){case t:
1657
+ return((e-n)/a+(e<n?6:0))*60;case e:return((n-t)/a+2)*60;case n:return((t-e)/a+4)*60;default:return-1}}},XW={clamp:(t,e,n)=>e>n?Math.min(e,Math.max(n,t)):Math.min(n,Math.max(e,t)),round:t=>Math.round(t*1e10)/1e10},YW={dec2hex:t=>{const e=Math.round(t).toString(16);return e.length>1?e:`0${e}`}},Le={channel:Ph,lang:XW,unit:YW},as={};for(let t=0;t<=255;t++)as[t]=Le.unit.dec2hex(t);const mn={ALL:0,RGB:1,HSL:2};class JW{constructor(){this.type=mn.ALL}get(){return this.type}set(e){if(this.type&&this.type!==
1658
+ e)throw new Error("Cannot change both RGB and HSL channels at the same time");this.type=e}reset(){this.type=mn.ALL}is(e){return this.type===e}}class QW{constructor(e,n){this.color=n,this.changed=!1,this.data=e,this.type=new JW}set(e,n){return this.color=n,this.changed=!1,this.data=e,this.type.type=mn.ALL,this}_ensureHSL(){const e=this.data,{h:n,s:r,l:i}=e;n===void 0&&(e.h=Le.channel.rgb2hsl(e,"h")),r===void 0&&(e.s=Le.channel.rgb2hsl(e,"s")),i===void 0&&(e.l=Le.channel.rgb2hsl(e,"l"))}_ensureRGB(){
1659
+ const e=this.data,{r:n,g:r,b:i}=e;n===void 0&&(e.r=Le.channel.hsl2rgb(e,"r")),r===void 0&&(e.g=Le.channel.hsl2rgb(e,"g")),i===void 0&&(e.b=Le.channel.hsl2rgb(e,"b"))}get r(){const e=this.data,n=e.r;return!this.type.is(mn.HSL)&&n!==void 0?n:(this._ensureHSL(),Le.channel.hsl2rgb(e,"r"))}get g(){const e=this.data,n=e.g;return!this.type.is(mn.HSL)&&n!==void 0?n:(this._ensureHSL(),Le.channel.hsl2rgb(e,"g"))}get b(){const e=this.data,n=e.b;return!this.type.is(mn.HSL)&&n!==void 0?n:(this._ensureHSL(),Le.
1660
+ channel.hsl2rgb(e,"b"))}get h(){const e=this.data,n=e.h;return!this.type.is(mn.RGB)&&n!==void 0?n:(this._ensureRGB(),Le.channel.rgb2hsl(e,"h"))}get s(){const e=this.data,n=e.s;return!this.type.is(mn.RGB)&&n!==void 0?n:(this._ensureRGB(),Le.channel.rgb2hsl(e,"s"))}get l(){const e=this.data,n=e.l;return!this.type.is(mn.RGB)&&n!==void 0?n:(this._ensureRGB(),Le.channel.rgb2hsl(e,"l"))}get a(){return this.data.a}set r(e){this.type.set(mn.RGB),this.changed=!0,this.data.r=e}set g(e){this.type.set(mn.RGB),
1661
+ this.changed=!0,this.data.g=e}set b(e){this.type.set(mn.RGB),this.changed=!0,this.data.b=e}set h(e){this.type.set(mn.HSL),this.changed=!0,this.data.h=e}set s(e){this.type.set(mn.HSL),this.changed=!0,this.data.s=e}set l(e){this.type.set(mn.HSL),this.changed=!0,this.data.l=e}set a(e){this.changed=!0,this.data.a=e}}const Mv=new QW({r:0,g:0,b:0,a:0},"transparent"),Ca={re:/^#((?:[a-f0-9]{2}){2,4}|[a-f0-9]{3})$/i,parse:t=>{if(t.charCodeAt(0)!==35)return;const e=t.match(Ca.re);if(!e)return;const n=e[1],
1662
+ r=parseInt(n,16),i=n.length,s=i%4===0,o=i>4,a=o?1:17,u=o?8:4,c=s?0:-1,l=o?255:15;return Mv.set({r:(r>>u*(c+3)&l)*a,g:(r>>u*(c+2)&l)*a,b:(r>>u*(c+1)&l)*a,a:s?(r&l)*a/255:1},t)},stringify:t=>{const{r:e,g:n,b:r,a:i}=t;return i<1?`#${as[Math.round(e)]}${as[Math.round(n)]}${as[Math.round(r)]}${as[Math.round(i*255)]}`:`#${as[Math.round(e)]}${as[Math.round(n)]}${as[Math.round(r)]}`}},vo={re:/^hsla?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?(?:deg|grad|rad|turn)?)\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?%)\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?%)(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?(%)?))?\s*?\)$/i,
1663
+ hueRe:/^(.+?)(deg|grad|rad|turn)$/i,_hue2deg:t=>{const e=t.match(vo.hueRe);if(e){const[,n,r]=e;switch(r){case"grad":return Le.channel.clamp.h(parseFloat(n)*.9);case"rad":return Le.channel.clamp.h(parseFloat(n)*180/Math.PI);case"turn":return Le.channel.clamp.h(parseFloat(n)*360)}}return Le.channel.clamp.h(parseFloat(t))},parse:t=>{const e=t.charCodeAt(0);if(e!==104&&e!==72)return;const n=t.match(vo.re);if(!n)return;const[,r,i,s,o,a]=n;return Mv.set({h:vo._hue2deg(r),s:Le.channel.clamp.s(parseFloat(
1664
+ i)),l:Le.channel.clamp.l(parseFloat(s)),a:o?Le.channel.clamp.a(a?parseFloat(o)/100:parseFloat(o)):1},t)},stringify:t=>{const{h:e,s:n,l:r,a:i}=t;return i<1?`hsla(${Le.lang.round(e)}, ${Le.lang.round(n)}%, ${Le.lang.round(r)}%, ${i})`:`hsl(${Le.lang.round(e)}, ${Le.lang.round(n)}%, ${Le.lang.round(r)}%)`}},hd={colors:{aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",
1665
+ blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyanaqua:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8f\
1666
+ bc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c\
1667
+ 5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"\
1668
+ #32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"\
1669
+ #da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"\
1670
+ #708090",snow:"#fffafa",springgreen:"#00ff7f",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",transparent:"#00000000",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},parse:t=>{t=t.toLowerCase();const e=hd.colors[t];if(e)return Ca.parse(e)},stringify:t=>{const e=Ca.stringify(t);for(const n in hd.colors)if(hd.colors[n]===e)return n}},md={re:/^rgba?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?)))?\s*?\)$/i,
1671
+ parse:t=>{const e=t.charCodeAt(0);if(e!==114&&e!==82)return;const n=t.match(md.re);if(!n)return;const[,r,i,s,o,a,u,c,l]=n;return Mv.set({r:Le.channel.clamp.r(i?parseFloat(r)*2.55:parseFloat(r)),g:Le.channel.clamp.g(o?parseFloat(s)*2.55:parseFloat(s)),b:Le.channel.clamp.b(u?parseFloat(a)*2.55:parseFloat(a)),a:c?Le.channel.clamp.a(l?parseFloat(c)/100:parseFloat(c)):1},t)},stringify:t=>{const{r:e,g:n,b:r,a:i}=t;return i<1?`rgba(${Le.lang.round(e)}, ${Le.lang.round(n)}, ${Le.lang.round(r)}, ${Le.lang.
1672
+ round(i)})`:`rgb(${Le.lang.round(e)}, ${Le.lang.round(n)}, ${Le.lang.round(r)})`}},us={format:{keyword:hd,hex:Ca,rgb:md,rgba:md,hsl:vo,hsla:vo},parse:t=>{if(typeof t!="string")return t;const e=Ca.parse(t)||md.parse(t)||vo.parse(t)||hd.parse(t);if(e)return e;throw new Error(`Unsupported color format: "${t}"`)},stringify:t=>!t.changed&&t.color?t.color:t.type.is(mn.HSL)||t.data.r===void 0?vo.stringify(t):t.a<1||!Number.isInteger(t.r)||!Number.isInteger(t.g)||!Number.isInteger(t.b)?md.stringify(t):Ca.
1673
+ stringify(t)},ZW=(t,e)=>{const n=us.parse(t);for(const r in e)n[r]=Le.channel.clamp[r](e[r]);return us.stringify(n)},TA=t=>us.format.hex.stringify(us.parse(t)),ez=(t,e,n)=>{const r=us.parse(t),i=r[e],s=Le.channel.clamp[e](i+n);return i!==s&&(r[e]=s),us.stringify(r)},tz=(t,e)=>ez(t,"a",-.3),nz=(t,e)=>{const n=us.parse(t),r={};for(const i in e)e[i]&&(r[i]=n[i]+e[i]);return ZW(t,r)},rz=(t,e)=>{const n=us.parse(t),r={},i=(s,o,a)=>o>0?(a-s)*o/100:s*o/100;for(const s in e)r[s]=i(n[s],e[s],Le.channel.max[s]);
1674
+ return nz(t,r)};function er(t){return t.children.length>0}function gn(t){switch(t){case"open":return"vee";default:return t}}function Vr(t){return Array.isArray(t)?[Vr(t[0]),Vr(t[1])]:(_e(isFinite(t),`Invalid not finite point value ${t}`),Math.round(t))}const CA=t=>(_e(isFinite(t),`Invalid not finite inch value ${t}`),Math.floor(t*72)),vt=t=>Math.ceil(t/72*1e3)/1e3,dr=t=>Math.ceil(t);dr(40).toString();function AA(t,e){return TA(rz(t,{l:-35-5*e,s:-15-5*e}))}function iz(t){return TA(tz(t))}function sz(t){
1675
+ return t.trim().replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;")}function SA(t,{maxchars:e,maxLines:n,sanitize:r=x4()}){let i=VW(t,{width:e,indent:"",escape:r}).split(`
1676
+ `);return cn(n)&&n>0&&i.length>n&&(i=i.slice(0,n-1)),i}function wo({text:t,maxchars:e,fontsize:n,maxLines:r,bold:i,color:s}){let o=SA(t,{maxchars:e,maxLines:r,sanitize:sz}).join("<BR/>");i&&(o=`<B>${o}</B>`);const a=s?` COLOR="${s}"`:"";return`<FONT POINT-SIZE="${dr(n)}"${a}>${o}</FONT>`}function Bv(t){return Jt.textSizes[t]}function oz(t){switch(t){case"xs":case"sm":return 25;case"md":return 35;case"lg":case"xl":return 45;default:qe(t)}}function az(t,e,n){const r=["sm","xs"].includes(n.shape),i=ce(
1677
+ t.icon),s=[wo({text:t.title,fontsize:Bv(n.text),maxchars:oz(n.shape),maxLines:r?1:3})];if(n.shape!=="xs"&&(ce(t.technology?.trim())&&s.push(wo({text:t.technology,fontsize:Math.ceil(Bv(n.text)*.65),maxchars:i?35:45,maxLines:1,color:e.loContrast})),ce(t.description?.trim())&&s.push(wo({text:t.description,fontsize:Math.ceil(Bv(n.text)*.75),maxchars:i?35:45,maxLines:r?3:5,color:e.loContrast}))),s.length===1&&!i)return`<${s[0]}>`;const o=i?(a,u,c)=>{let l=`<TD ALIGN="TEXT" BALIGN="LEFT">${a}</TD>`;if(u===
1678
+ 0){const f=c.length>1?` ROWSPAN="${c.length}"`:"";let d=76;["xs","sm"].includes(n.shape)&&(d=16),(t.shape==="queue"||t.shape==="mobile")&&(d+=20),l=`<TD${f} WIDTH="${d}"> </TD>${l}`,l=`${l}<TD${f} WIDTH="16"> </TD>`}return`<TR>${l}</TR>`}:a=>`<TR><TD>${a}</TD></TR>`;return`<<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="4">${s.map(o).join("")}</TABLE>>`}function uz(t,e){const n=wo({text:t.title.toUpperCase(),maxchars:50,fontsize:11,maxLines:1,bold:!0,color:e});return n.includes("<BR/>")?`<<TABLE\
1679
+ BORDER="0" CELLPADDING="0" CELLSPACING="0"><TR><TD ALIGN="TEXT" BALIGN="LEFT">${n}</TD></TR></TABLE>>`:`<${n}>`}const xh=40,_A=5,qv=`BGCOLOR="${Jt.relationships[Ma].labelBgColor}A0"`;function PA({label:t,technology:e}){const n=[];if(ce(t?.trim())&&n.push(wo({text:t,maxchars:xh,fontsize:14,maxLines:_A,bold:t==="[...]"})),ce(e?.trim())&&n.push(wo({text:`[ ${e} ]`,fontsize:12,maxLines:1,maxchars:xh})),n.length===0)return null;const r=n.map(i=>`<TR><TD ALIGN="TEXT" BALIGN="LEFT">${i}</TD></TR>`).join(
1680
+ "");return`<<TABLE BORDER="0" CELLPADDING="3" CELLSPACING="0" ${qv}>${r}</TABLE>>`}function cz(t,e){const n=`<TABLE BORDER="0" CELLPADDING="6" ${qv}><TR><TD WIDTH="20" HEIGHT="20"><FONT POINT-SIZE="${dr(14)}"><B>${t}</B></FONT></TD></TR></TABLE>`;return ce(e?.trim())?`<${['<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3">',"<TR>",`<TD>${n}</TD>`,`<TD ${qv} CELLPADDING="3">`,wo({text:e,maxchars:xh,fontsize:14,maxLines:5}),"</TD>","</TR>","</TABLE>"].join("")}>`:`<${n}>`}var jv,xA;function Gv(){if(xA)
1681
+ return jv;xA=1;function t(e){if(typeof e!="function")throw new Error("obliterator/iterator: expecting a function!");this.next=e}return typeof Symbol<"u"&&(t.prototype[Symbol.iterator]=function(){return this}),t.of=function(){var e=arguments,n=e.length,r=0;return new t(function(){return r>=n?{done:!0}:{done:!1,value:e[r++]}})},t.empty=function(){var e=new t(function(){return{done:!0}});return e},t.fromSequence=function(e){var n=0,r=e.length;return new t(function(){return n>=r?{done:!0}:{done:!1,value:e[n++]}})},
1682
+ t.is=function(e){return e instanceof t?!0:typeof e=="object"&&e!==null&&typeof e.next=="function"},jv=t,jv}var lz=Gv();const fr=Jr(lz);var Nh={},NA;function dz(){return NA||(NA=1,Nh.ARRAY_BUFFER_SUPPORT=typeof ArrayBuffer<"u",Nh.SYMBOL_SUPPORT=typeof Symbol<"u"),Nh}var Uv,IA;function OA(){if(IA)return Uv;IA=1;var t=Gv(),e=dz(),n=e.ARRAY_BUFFER_SUPPORT,r=e.SYMBOL_SUPPORT;function i(s){return typeof s=="string"||Array.isArray(s)||n&&ArrayBuffer.isView(s)?t.fromSequence(s):typeof s!="object"||s===null?
1683
+ null:r&&typeof s[Symbol.iterator]=="function"?s[Symbol.iterator]():typeof s.next=="function"?s:null}return Uv=function(o){var a=i(o);if(!a)throw new Error("obliterator: target is not iterable nor a valid iterator.");return a},Uv}var Wv,FA;function fz(){if(FA)return Wv;FA=1;var t=OA();return Wv=function(n,r){for(var i=arguments.length>1?r:1/0,s=i!==1/0?new Array(i):[],o,a=0,u=t(n);;){if(a===i)return s;if(o=u.next(),o.done)return a!==r&&(s.length=a),s;s[a++]=o.value}},Wv}var pz=fz();const LA=Jr(pz);
1684
+ var zv,MA;function hz(){if(MA)return zv;MA=1;var t=Gv(),e=OA();return zv=function(){var r=arguments,i=null,s=-1;return new t(function(){var a=null;do{if(i===null){if(s++,s>=r.length)return{done:!0};i=e(r[s])}if(a=i.next(),a.done===!0){i=null;continue}break}while(!0);return a})},zv}var mz=hz();const Ii=Jr(mz);function gz(){const t=arguments[0];for(let e=1,n=arguments.length;e<n;e++)if(arguments[e])for(const r in arguments[e])t[r]=arguments[e][r];return t}let Vt=gz;typeof Object.assign=="function"&&
1685
+ (Vt=Object.assign);function pr(t,e,n,r){const i=t._nodes.get(e);let s=null;return i&&(r==="mixed"?s=i.out&&i.out[n]||i.undirected&&i.undirected[n]:r==="directed"?s=i.out&&i.out[n]:s=i.undirected&&i.undirected[n]),s}function dn(t){return typeof t=="object"&&t!==null}function BA(t){let e;for(e in t)return!1;return!0}function hr(t,e,n){Object.defineProperty(t,e,{enumerable:!1,configurable:!1,writable:!0,value:n})}function _r(t,e,n){const r={enumerable:!0,configurable:!0};typeof n=="function"?r.get=
1686
+ n:(r.value=n,r.writable=!1),Object.defineProperty(t,e,r)}function qA(t){return!(!dn(t)||t.attributes&&!Array.isArray(t.attributes))}function yz(){let t=Math.floor(Math.random()*256)&255;return()=>t++}class Hv extends Error{constructor(e){super(),this.name="GraphError",this.message=e}}class me extends Hv{constructor(e){super(e),this.name="InvalidArgumentsGraphError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,me.prototype.constructor)}}class ae extends Hv{constructor(e){
1687
+ super(e),this.name="NotFoundGraphError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,ae.prototype.constructor)}}class Ce extends Hv{constructor(e){super(e),this.name="UsageGraphError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,Ce.prototype.constructor)}}function jA(t,e){this.key=t,this.attributes=e,this.clear()}jA.prototype.clear=function(){this.inDegree=0,this.outDegree=0,this.undirectedDegree=0,this.undirectedLoops=0,this.directedLoops=
1688
+ 0,this.in={},this.out={},this.undirected={}};function GA(t,e){this.key=t,this.attributes=e,this.clear()}GA.prototype.clear=function(){this.inDegree=0,this.outDegree=0,this.directedLoops=0,this.in={},this.out={}};function UA(t,e){this.key=t,this.attributes=e,this.clear()}UA.prototype.clear=function(){this.undirectedDegree=0,this.undirectedLoops=0,this.undirected={}};function Aa(t,e,n,r,i){this.key=e,this.attributes=i,this.undirected=t,this.source=n,this.target=r}Aa.prototype.attach=function(){let t="\
1689
+ out",e="in";this.undirected&&(t=e="undirected");const n=this.source.key,r=this.target.key;this.source[t][r]=this,!(this.undirected&&n===r)&&(this.target[e][n]=this)},Aa.prototype.attachMulti=function(){let t="out",e="in";const n=this.source.key,r=this.target.key;this.undirected&&(t=e="undirected");const i=this.source[t],s=i[r];if(typeof s>"u"){i[r]=this,this.undirected&&n===r||(this.target[e][n]=this);return}s.previous=this,this.next=s,i[r]=this,this.target[e][n]=this},Aa.prototype.detach=function(){
1690
+ const t=this.source.key,e=this.target.key;let n="out",r="in";this.undirected&&(n=r="undirected"),delete this.source[n][e],delete this.target[r][t]},Aa.prototype.detachMulti=function(){const t=this.source.key,e=this.target.key;let n="out",r="in";this.undirected&&(n=r="undirected"),this.previous===void 0?this.next===void 0?(delete this.source[n][e],delete this.target[r][t]):(this.next.previous=void 0,this.source[n][e]=this.next,this.target[r][t]=this.next):(this.previous.next=this.next,this.next!==
1691
+ void 0&&(this.next.previous=this.previous))};const WA=0,zA=1,vz=2,HA=3;function Oi(t,e,n,r,i,s,o){let a,u,c,l;if(r=""+r,n===WA){if(a=t._nodes.get(r),!a)throw new ae(`Graph.${e}: could not find the "${r}" node in the graph.`);c=i,l=s}else if(n===HA){if(i=""+i,u=t._edges.get(i),!u)throw new ae(`Graph.${e}: could not find the "${i}" edge in the graph.`);const f=u.source.key,d=u.target.key;if(r===f)a=u.target;else if(r===d)a=u.source;else throw new ae(`Graph.${e}: the "${r}" node is not attached to \
1692
+ the "${i}" edge (${f}, ${d}).`);c=s,l=o}else{if(u=t._edges.get(r),!u)throw new ae(`Graph.${e}: could not find the "${r}" edge in the graph.`);n===zA?a=u.source:a=u.target,c=i,l=s}return[a,c,l]}function wz(t,e,n){t.prototype[e]=function(r,i,s){const[o,a]=Oi(this,e,n,r,i,s);return o.attributes[a]}}function bz(t,e,n){t.prototype[e]=function(r,i){const[s]=Oi(this,e,n,r,i);return s.attributes}}function Ez(t,e,n){t.prototype[e]=function(r,i,s){const[o,a]=Oi(this,e,n,r,i,s);return o.attributes.hasOwnProperty(
1693
+ a)}}function $z(t,e,n){t.prototype[e]=function(r,i,s,o){const[a,u,c]=Oi(this,e,n,r,i,s,o);return a.attributes[u]=c,this.emit("nodeAttributesUpdated",{key:a.key,type:"set",attributes:a.attributes,name:u}),this}}function Dz(t,e,n){t.prototype[e]=function(r,i,s,o){const[a,u,c]=Oi(this,e,n,r,i,s,o);if(typeof c!="function")throw new me(`Graph.${e}: updater should be a function.`);const l=a.attributes,f=c(l[u]);return l[u]=f,this.emit("nodeAttributesUpdated",{key:a.key,type:"set",attributes:a.attributes,
1694
+ name:u}),this}}function Rz(t,e,n){t.prototype[e]=function(r,i,s){const[o,a]=Oi(this,e,n,r,i,s);return delete o.attributes[a],this.emit("nodeAttributesUpdated",{key:o.key,type:"remove",attributes:o.attributes,name:a}),this}}function kz(t,e,n){t.prototype[e]=function(r,i,s){const[o,a]=Oi(this,e,n,r,i,s);if(!dn(a))throw new me(`Graph.${e}: provided attributes are not a plain object.`);return o.attributes=a,this.emit("nodeAttributesUpdated",{key:o.key,type:"replace",attributes:o.attributes}),this}}function Tz(t,e,n){
1695
+ t.prototype[e]=function(r,i,s){const[o,a]=Oi(this,e,n,r,i,s);if(!dn(a))throw new me(`Graph.${e}: provided attributes are not a plain object.`);return Vt(o.attributes,a),this.emit("nodeAttributesUpdated",{key:o.key,type:"merge",attributes:o.attributes,data:a}),this}}function Cz(t,e,n){t.prototype[e]=function(r,i,s){const[o,a]=Oi(this,e,n,r,i,s);if(typeof a!="function")throw new me(`Graph.${e}: provided updater is not a function.`);return o.attributes=a(o.attributes),this.emit("nodeAttributesUpdat\
1696
+ ed",{key:o.key,type:"update",attributes:o.attributes}),this}}const Az=[{name:t=>`get${t}Attribute`,attacher:wz},{name:t=>`get${t}Attributes`,attacher:bz},{name:t=>`has${t}Attribute`,attacher:Ez},{name:t=>`set${t}Attribute`,attacher:$z},{name:t=>`update${t}Attribute`,attacher:Dz},{name:t=>`remove${t}Attribute`,attacher:Rz},{name:t=>`replace${t}Attributes`,attacher:kz},{name:t=>`merge${t}Attributes`,attacher:Tz},{name:t=>`update${t}Attributes`,attacher:Cz}];function Sz(t){Az.forEach(function({name:e,
1697
+ attacher:n}){n(t,e("Node"),WA),n(t,e("Source"),zA),n(t,e("Target"),vz),n(t,e("Opposite"),HA)})}function _z(t,e,n){t.prototype[e]=function(r,i){let s;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Ce(`Graph.${e}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new Ce(`Graph.${e}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);
1698
+ const o=""+r,a=""+i;if(i=arguments[2],s=pr(this,o,a,n),!s)throw new ae(`Graph.${e}: could not find an edge for the given path ("${o}" - "${a}").`)}else{if(n!=="mixed")throw new Ce(`Graph.${e}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,s=this._edges.get(r),!s)throw new ae(`Graph.${e}: could not find the "${r}" edge in the graph.`)}return s.attributes[i]}}function Pz(t,e,n){t.prototype[e]=function(r){
1699
+ let i;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Ce(`Graph.${e}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>1){if(this.multi)throw new Ce(`Graph.${e}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const s=""+r,o=""+arguments[1];if(i=pr(this,s,o,n),!i)throw new ae(`Graph.${e}: could not find an edge for the given path ("${s}" - "${o}").`)}else{
1700
+ if(n!=="mixed")throw new Ce(`Graph.${e}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,i=this._edges.get(r),!i)throw new ae(`Graph.${e}: could not find the "${r}" edge in the graph.`)}return i.attributes}}function xz(t,e,n){t.prototype[e]=function(r,i){let s;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Ce(`Graph.${e}: cannot find this type of edges in your ${this.type} graph.`);
1701
+ if(arguments.length>2){if(this.multi)throw new Ce(`Graph.${e}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const o=""+r,a=""+i;if(i=arguments[2],s=pr(this,o,a,n),!s)throw new ae(`Graph.${e}: could not find an edge for the given path ("${o}" - "${a}").`)}else{if(n!=="mixed")throw new Ce(`Graph.${e}: calling this method with only a key (vs. a source and target) does not make sense since an edg\
1702
+ e with this key could have the other type.`);if(r=""+r,s=this._edges.get(r),!s)throw new ae(`Graph.${e}: could not find the "${r}" edge in the graph.`)}return s.attributes.hasOwnProperty(i)}}function Nz(t,e,n){t.prototype[e]=function(r,i,s){let o;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Ce(`Graph.${e}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>3){if(this.multi)throw new Ce(`Graph.${e}: cannot use a {source,target} combo when asking about\
1703
+ an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const a=""+r,u=""+i;if(i=arguments[2],s=arguments[3],o=pr(this,a,u,n),!o)throw new ae(`Graph.${e}: could not find an edge for the given path ("${a}" - "${u}").`)}else{if(n!=="mixed")throw new Ce(`Graph.${e}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,o=this._edges.get(r),!o)throw new ae(`Graph.${e}\
1704
+ : could not find the "${r}" edge in the graph.`)}return o.attributes[i]=s,this.emit("edgeAttributesUpdated",{key:o.key,type:"set",attributes:o.attributes,name:i}),this}}function Iz(t,e,n){t.prototype[e]=function(r,i,s){let o;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Ce(`Graph.${e}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>3){if(this.multi)throw new Ce(`Graph.${e}: cannot use a {source,target} combo when asking about an edge's attributes \
1705
+ in a MultiGraph since we cannot infer the one you want information about.`);const a=""+r,u=""+i;if(i=arguments[2],s=arguments[3],o=pr(this,a,u,n),!o)throw new ae(`Graph.${e}: could not find an edge for the given path ("${a}" - "${u}").`)}else{if(n!=="mixed")throw new Ce(`Graph.${e}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,o=this._edges.get(r),!o)throw new ae(`Graph.${e}: could not find th\
1706
+ e "${r}" edge in the graph.`)}if(typeof s!="function")throw new me(`Graph.${e}: updater should be a function.`);return o.attributes[i]=s(o.attributes[i]),this.emit("edgeAttributesUpdated",{key:o.key,type:"set",attributes:o.attributes,name:i}),this}}function Oz(t,e,n){t.prototype[e]=function(r,i){let s;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Ce(`Graph.${e}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new Ce(`Graph.${e}\
1707
+ : cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const o=""+r,a=""+i;if(i=arguments[2],s=pr(this,o,a,n),!s)throw new ae(`Graph.${e}: could not find an edge for the given path ("${o}" - "${a}").`)}else{if(n!=="mixed")throw new Ce(`Graph.${e}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,s=this.
1708
+ _edges.get(r),!s)throw new ae(`Graph.${e}: could not find the "${r}" edge in the graph.`)}return delete s.attributes[i],this.emit("edgeAttributesUpdated",{key:s.key,type:"remove",attributes:s.attributes,name:i}),this}}function Fz(t,e,n){t.prototype[e]=function(r,i){let s;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Ce(`Graph.${e}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new Ce(`Graph.${e}: cannot use a {source,target\
1709
+ } combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const o=""+r,a=""+i;if(i=arguments[2],s=pr(this,o,a,n),!s)throw new ae(`Graph.${e}: could not find an edge for the given path ("${o}" - "${a}").`)}else{if(n!=="mixed")throw new Ce(`Graph.${e}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,s=this._edges.get(r),!s)throw new ae(
1710
+ `Graph.${e}: could not find the "${r}" edge in the graph.`)}if(!dn(i))throw new me(`Graph.${e}: provided attributes are not a plain object.`);return s.attributes=i,this.emit("edgeAttributesUpdated",{key:s.key,type:"replace",attributes:s.attributes}),this}}function Lz(t,e,n){t.prototype[e]=function(r,i){let s;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Ce(`Graph.${e}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new Ce(`G\
1711
+ raph.${e}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const o=""+r,a=""+i;if(i=arguments[2],s=pr(this,o,a,n),!s)throw new ae(`Graph.${e}: could not find an edge for the given path ("${o}" - "${a}").`)}else{if(n!=="mixed")throw new Ce(`Graph.${e}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+
1712
+ r,s=this._edges.get(r),!s)throw new ae(`Graph.${e}: could not find the "${r}" edge in the graph.`)}if(!dn(i))throw new me(`Graph.${e}: provided attributes are not a plain object.`);return Vt(s.attributes,i),this.emit("edgeAttributesUpdated",{key:s.key,type:"merge",attributes:s.attributes,data:i}),this}}function Mz(t,e,n){t.prototype[e]=function(r,i){let s;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Ce(`Graph.${e}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.
1713
+ length>2){if(this.multi)throw new Ce(`Graph.${e}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const o=""+r,a=""+i;if(i=arguments[2],s=pr(this,o,a,n),!s)throw new ae(`Graph.${e}: could not find an edge for the given path ("${o}" - "${a}").`)}else{if(n!=="mixed")throw new Ce(`Graph.${e}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this k\
1714
+ ey could have the other type.`);if(r=""+r,s=this._edges.get(r),!s)throw new ae(`Graph.${e}: could not find the "${r}" edge in the graph.`)}if(typeof i!="function")throw new me(`Graph.${e}: provided updater is not a function.`);return s.attributes=i(s.attributes),this.emit("edgeAttributesUpdated",{key:s.key,type:"update",attributes:s.attributes}),this}}const Bz=[{name:t=>`get${t}Attribute`,attacher:_z},{name:t=>`get${t}Attributes`,attacher:Pz},{name:t=>`has${t}Attribute`,attacher:xz},{name:t=>`se\
1715
+ t${t}Attribute`,attacher:Nz},{name:t=>`update${t}Attribute`,attacher:Iz},{name:t=>`remove${t}Attribute`,attacher:Oz},{name:t=>`replace${t}Attributes`,attacher:Fz},{name:t=>`merge${t}Attributes`,attacher:Lz},{name:t=>`update${t}Attributes`,attacher:Mz}];function qz(t){Bz.forEach(function({name:e,attacher:n}){n(t,e("Edge"),"mixed"),n(t,e("DirectedEdge"),"directed"),n(t,e("UndirectedEdge"),"undirected")})}const jz=[{name:"edges",type:"mixed"},{name:"inEdges",type:"directed",direction:"in"},{name:"o\
1716
+ utEdges",type:"directed",direction:"out"},{name:"inboundEdges",type:"mixed",direction:"in"},{name:"outboundEdges",type:"mixed",direction:"out"},{name:"directedEdges",type:"directed"},{name:"undirectedEdges",type:"undirected"}];function Gz(t,e,n,r){let i=!1;for(const s in e){if(s===r)continue;const o=e[s];if(i=n(o.key,o.attributes,o.source.key,o.target.key,o.source.attributes,o.target.attributes,o.undirected),t&&i)return o.key}}function Uz(t,e,n,r){let i,s,o,a=!1;for(const u in e)if(u!==r){i=e[u];
1717
+ do{if(s=i.source,o=i.target,a=n(i.key,i.attributes,s.key,o.key,s.attributes,o.attributes,i.undirected),t&&a)return i.key;i=i.next}while(i!==void 0)}}function Kv(t,e){const n=Object.keys(t),r=n.length;let i,s=0;return new fr(function(){do if(i)i=i.next;else{if(s>=r)return{done:!0};const a=n[s++];if(a===e){i=void 0;continue}i=t[a]}while(!i);return{done:!1,value:{edge:i.key,attributes:i.attributes,source:i.source.key,target:i.target.key,sourceAttributes:i.source.attributes,targetAttributes:i.target.
1718
+ attributes,undirected:i.undirected}}})}function Wz(t,e,n,r){const i=e[n];if(!i)return;const s=i.source,o=i.target;if(r(i.key,i.attributes,s.key,o.key,s.attributes,o.attributes,i.undirected)&&t)return i.key}function zz(t,e,n,r){let i=e[n];if(!i)return;let s=!1;do{if(s=r(i.key,i.attributes,i.source.key,i.target.key,i.source.attributes,i.target.attributes,i.undirected),t&&s)return i.key;i=i.next}while(i!==void 0)}function Vv(t,e){let n=t[e];return n.next!==void 0?new fr(function(){if(!n)return{done:!0};
1719
+ const r={edge:n.key,attributes:n.attributes,source:n.source.key,target:n.target.key,sourceAttributes:n.source.attributes,targetAttributes:n.target.attributes,undirected:n.undirected};return n=n.next,{done:!1,value:r}}):fr.of({edge:n.key,attributes:n.attributes,source:n.source.key,target:n.target.key,sourceAttributes:n.source.attributes,targetAttributes:n.target.attributes,undirected:n.undirected})}function Hz(t,e){if(t.size===0)return[];if(e==="mixed"||e===t.type)return typeof Array.from=="funct\
1720
+ ion"?Array.from(t._edges.keys()):LA(t._edges.keys(),t._edges.size);const n=e==="undirected"?t.undirectedSize:t.directedSize,r=new Array(n),i=e==="undirected",s=t._edges.values();let o=0,a,u;for(;a=s.next(),a.done!==!0;)u=a.value,u.undirected===i&&(r[o++]=u.key);return r}function KA(t,e,n,r){if(e.size===0)return;const i=n!=="mixed"&&n!==e.type,s=n==="undirected";let o,a,u=!1;const c=e._edges.values();for(;o=c.next(),o.done!==!0;){if(a=o.value,i&&a.undirected!==s)continue;const{key:l,attributes:f,
1721
+ source:d,target:p}=a;if(u=r(l,f,d.key,p.key,d.attributes,p.attributes,a.undirected),t&&u)return l}}function Kz(t,e){if(t.size===0)return fr.empty();const n=e!=="mixed"&&e!==t.type,r=e==="undirected",i=t._edges.values();return new fr(function(){let o,a;for(;;){if(o=i.next(),o.done)return o;if(a=o.value,!(n&&a.undirected!==r))break}return{value:{edge:a.key,attributes:a.attributes,source:a.source.key,target:a.target.key,sourceAttributes:a.source.attributes,targetAttributes:a.target.attributes,undirected:a.
1722
+ undirected},done:!1}})}function Xv(t,e,n,r,i,s){const o=e?Uz:Gz;let a;if(n!=="undirected"&&(r!=="out"&&(a=o(t,i.in,s),t&&a)||r!=="in"&&(a=o(t,i.out,s,r?void 0:i.key),t&&a))||n!=="directed"&&(a=o(t,i.undirected,s),t&&a))return a}function Vz(t,e,n,r){const i=[];return Xv(!1,t,e,n,r,function(s){i.push(s)}),i}function Xz(t,e,n){let r=fr.empty();return t!=="undirected"&&(e!=="out"&&typeof n.in<"u"&&(r=Ii(r,Kv(n.in))),e!=="in"&&typeof n.out<"u"&&(r=Ii(r,Kv(n.out,e?void 0:n.key)))),t!=="directed"&&typeof n.
1723
+ undirected<"u"&&(r=Ii(r,Kv(n.undirected))),r}function Yv(t,e,n,r,i,s,o){const a=n?zz:Wz;let u;if(e!=="undirected"&&(typeof i.in<"u"&&r!=="out"&&(u=a(t,i.in,s,o),t&&u)||typeof i.out<"u"&&r!=="in"&&(r||i.key!==s)&&(u=a(t,i.out,s,o),t&&u))||e!=="directed"&&typeof i.undirected<"u"&&(u=a(t,i.undirected,s,o),t&&u))return u}function Yz(t,e,n,r,i){const s=[];return Yv(!1,t,e,n,r,i,function(o){s.push(o)}),s}function Jz(t,e,n,r){let i=fr.empty();return t!=="undirected"&&(typeof n.in<"u"&&e!=="out"&&r in n.
1724
+ in&&(i=Ii(i,Vv(n.in,r))),typeof n.out<"u"&&e!=="in"&&r in n.out&&(e||n.key!==r)&&(i=Ii(i,Vv(n.out,r)))),t!=="directed"&&typeof n.undirected<"u"&&r in n.undirected&&(i=Ii(i,Vv(n.undirected,r))),i}function Qz(t,e){const{name:n,type:r,direction:i}=e;t.prototype[n]=function(s,o){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return[];if(!arguments.length)return Hz(this,r);if(arguments.length===1){s=""+s;const a=this._nodes.get(s);if(typeof a>"u")throw new ae(`Graph.${n}: could not find the "${s}\
1725
+ " node in the graph.`);return Vz(this.multi,r==="mixed"?this.type:r,i,a)}if(arguments.length===2){s=""+s,o=""+o;const a=this._nodes.get(s);if(!a)throw new ae(`Graph.${n}: could not find the "${s}" source node in the graph.`);if(!this._nodes.has(o))throw new ae(`Graph.${n}: could not find the "${o}" target node in the graph.`);return Yz(r,this.multi,i,a,o)}throw new me(`Graph.${n}: too many arguments (expecting 0, 1 or 2 and got ${arguments.length}).`)}}function Zz(t,e){const{name:n,type:r,direction:i}=e,
1726
+ s="forEach"+n[0].toUpperCase()+n.slice(1,-1);t.prototype[s]=function(c,l,f){if(!(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)){if(arguments.length===1)return f=c,KA(!1,this,r,f);if(arguments.length===2){c=""+c,f=l;const d=this._nodes.get(c);if(typeof d>"u")throw new ae(`Graph.${s}: could not find the "${c}" node in the graph.`);return Xv(!1,this.multi,r==="mixed"?this.type:r,i,d,f)}if(arguments.length===3){c=""+c,l=""+l;const d=this._nodes.get(c);if(!d)throw new ae(`Graph.${s}: could not fi\
1727
+ nd the "${c}" source node in the graph.`);if(!this._nodes.has(l))throw new ae(`Graph.${s}: could not find the "${l}" target node in the graph.`);return Yv(!1,r,this.multi,i,d,l,f)}throw new me(`Graph.${s}: too many arguments (expecting 1, 2 or 3 and got ${arguments.length}).`)}};const o="map"+n[0].toUpperCase()+n.slice(1);t.prototype[o]=function(){const c=Array.prototype.slice.call(arguments),l=c.pop();let f;if(c.length===0){let d=0;r!=="directed"&&(d+=this.undirectedSize),r!=="undirected"&&(d+=
1728
+ this.directedSize),f=new Array(d);let p=0;c.push((m,v,w,y,E,R,A)=>{f[p++]=l(m,v,w,y,E,R,A)})}else f=[],c.push((d,p,m,v,w,y,E)=>{f.push(l(d,p,m,v,w,y,E))});return this[s].apply(this,c),f};const a="filter"+n[0].toUpperCase()+n.slice(1);t.prototype[a]=function(){const c=Array.prototype.slice.call(arguments),l=c.pop(),f=[];return c.push((d,p,m,v,w,y,E)=>{l(d,p,m,v,w,y,E)&&f.push(d)}),this[s].apply(this,c),f};const u="reduce"+n[0].toUpperCase()+n.slice(1);t.prototype[u]=function(){let c=Array.prototype.
1729
+ slice.call(arguments);if(c.length<2||c.length>4)throw new me(`Graph.${u}: invalid number of arguments (expecting 2, 3 or 4 and got ${c.length}).`);if(typeof c[c.length-1]=="function"&&typeof c[c.length-2]!="function")throw new me(`Graph.${u}: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.`);let l,f;c.length===2?(l=c[0],f=c[1],c=[]):c.length===3?(l=c[1],f=
1730
+ c[2],c=[c[0]]):c.length===4&&(l=c[2],f=c[3],c=[c[0],c[1]]);let d=f;return c.push((p,m,v,w,y,E,R)=>{d=l(d,p,m,v,w,y,E,R)}),this[s].apply(this,c),d}}function e6(t,e){const{name:n,type:r,direction:i}=e,s="find"+n[0].toUpperCase()+n.slice(1,-1);t.prototype[s]=function(u,c,l){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return!1;if(arguments.length===1)return l=u,KA(!0,this,r,l);if(arguments.length===2){u=""+u,l=c;const f=this._nodes.get(u);if(typeof f>"u")throw new ae(`Graph.${s}: could not fi\
1731
+ nd the "${u}" node in the graph.`);return Xv(!0,this.multi,r==="mixed"?this.type:r,i,f,l)}if(arguments.length===3){u=""+u,c=""+c;const f=this._nodes.get(u);if(!f)throw new ae(`Graph.${s}: could not find the "${u}" source node in the graph.`);if(!this._nodes.has(c))throw new ae(`Graph.${s}: could not find the "${c}" target node in the graph.`);return Yv(!0,r,this.multi,i,f,c,l)}throw new me(`Graph.${s}: too many arguments (expecting 1, 2 or 3 and got ${arguments.length}).`)};const o="some"+n[0].
1732
+ toUpperCase()+n.slice(1,-1);t.prototype[o]=function(){const u=Array.prototype.slice.call(arguments),c=u.pop();return u.push((f,d,p,m,v,w,y)=>c(f,d,p,m,v,w,y)),!!this[s].apply(this,u)};const a="every"+n[0].toUpperCase()+n.slice(1,-1);t.prototype[a]=function(){const u=Array.prototype.slice.call(arguments),c=u.pop();return u.push((f,d,p,m,v,w,y)=>!c(f,d,p,m,v,w,y)),!this[s].apply(this,u)}}function t6(t,e){const{name:n,type:r,direction:i}=e,s=n.slice(0,-1)+"Entries";t.prototype[s]=function(o,a){if(r!==
1733
+ "mixed"&&this.type!=="mixed"&&r!==this.type)return fr.empty();if(!arguments.length)return Kz(this,r);if(arguments.length===1){o=""+o;const u=this._nodes.get(o);if(!u)throw new ae(`Graph.${s}: could not find the "${o}" node in the graph.`);return Xz(r,i,u)}if(arguments.length===2){o=""+o,a=""+a;const u=this._nodes.get(o);if(!u)throw new ae(`Graph.${s}: could not find the "${o}" source node in the graph.`);if(!this._nodes.has(a))throw new ae(`Graph.${s}: could not find the "${a}" target node in \
1734
+ the graph.`);return Jz(r,i,u,a)}throw new me(`Graph.${s}: too many arguments (expecting 0, 1 or 2 and got ${arguments.length}).`)}}function n6(t){jz.forEach(e=>{Qz(t,e),Zz(t,e),e6(t,e),t6(t,e)})}const r6=[{name:"neighbors",type:"mixed"},{name:"inNeighbors",type:"directed",direction:"in"},{name:"outNeighbors",type:"directed",direction:"out"},{name:"inboundNeighbors",type:"mixed",direction:"in"},{name:"outboundNeighbors",type:"mixed",direction:"out"},{name:"directedNeighbors",type:"directed"},{name:"\
1735
+ undirectedNeighbors",type:"undirected"}];function Ih(){this.A=null,this.B=null}Ih.prototype.wrap=function(t){this.A===null?this.A=t:this.B===null&&(this.B=t)},Ih.prototype.has=function(t){return this.A!==null&&t in this.A||this.B!==null&&t in this.B};function gd(t,e,n,r,i){for(const s in r){const o=r[s],a=o.source,u=o.target,c=a===n?u:a;if(e&&e.has(c.key))continue;const l=i(c.key,c.attributes);if(t&&l)return c.key}}function Jv(t,e,n,r,i){if(e!=="mixed"){if(e==="undirected")return gd(t,null,r,r.undirected,
1736
+ i);if(typeof n=="string")return gd(t,null,r,r[n],i)}const s=new Ih;let o;if(e!=="undirected"){if(n!=="out"){if(o=gd(t,null,r,r.in,i),t&&o)return o;s.wrap(r.in)}if(n!=="in"){if(o=gd(t,s,r,r.out,i),t&&o)return o;s.wrap(r.out)}}if(e!=="directed"&&(o=gd(t,s,r,r.undirected,i),t&&o))return o}function i6(t,e,n){if(t!=="mixed"){if(t==="undirected")return Object.keys(n.undirected);if(typeof e=="string")return Object.keys(n[e])}const r=[];return Jv(!1,t,e,n,function(i){r.push(i)}),r}function yd(t,e,n){const r=Object.
1737
+ keys(n),i=r.length;let s=0;return new fr(function(){let a=null;do{if(s>=i)return t&&t.wrap(n),{done:!0};const u=n[r[s++]],c=u.source,l=u.target;if(a=c===e?l:c,t&&t.has(a.key)){a=null;continue}}while(a===null);return{done:!1,value:{neighbor:a.key,attributes:a.attributes}}})}function s6(t,e,n){if(t!=="mixed"){if(t==="undirected")return yd(null,n,n.undirected);if(typeof e=="string")return yd(null,n,n[e])}let r=fr.empty();const i=new Ih;return t!=="undirected"&&(e!=="out"&&(r=Ii(r,yd(i,n,n.in))),e!==
1738
+ "in"&&(r=Ii(r,yd(i,n,n.out)))),t!=="directed"&&(r=Ii(r,yd(i,n,n.undirected))),r}function o6(t,e){const{name:n,type:r,direction:i}=e;t.prototype[n]=function(s){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return[];s=""+s;const o=this._nodes.get(s);if(typeof o>"u")throw new ae(`Graph.${n}: could not find the "${s}" node in the graph.`);return i6(r==="mixed"?this.type:r,i,o)}}function a6(t,e){const{name:n,type:r,direction:i}=e,s="forEach"+n[0].toUpperCase()+n.slice(1,-1);t.prototype[s]=function(c,l){
1739
+ if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return;c=""+c;const f=this._nodes.get(c);if(typeof f>"u")throw new ae(`Graph.${s}: could not find the "${c}" node in the graph.`);Jv(!1,r==="mixed"?this.type:r,i,f,l)};const o="map"+n[0].toUpperCase()+n.slice(1);t.prototype[o]=function(c,l){const f=[];return this[s](c,(d,p)=>{f.push(l(d,p))}),f};const a="filter"+n[0].toUpperCase()+n.slice(1);t.prototype[a]=function(c,l){const f=[];return this[s](c,(d,p)=>{l(d,p)&&f.push(d)}),f};const u="reduce"+
1740
+ n[0].toUpperCase()+n.slice(1);t.prototype[u]=function(c,l,f){if(arguments.length<3)throw new me(`Graph.${u}: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.`);let d=f;return this[s](c,(p,m)=>{d=l(d,p,m)}),d}}function u6(t,e){const{name:n,type:r,direction:i}=e,s=n[0].toUpperCase()+n.slice(1,-1),o="find"+s;t.prototype[o]=function(c,l){if(r!=="mixed"&&this.type!==
1741
+ "mixed"&&r!==this.type)return;c=""+c;const f=this._nodes.get(c);if(typeof f>"u")throw new ae(`Graph.${o}: could not find the "${c}" node in the graph.`);return Jv(!0,r==="mixed"?this.type:r,i,f,l)};const a="some"+s;t.prototype[a]=function(c,l){return!!this[o](c,l)};const u="every"+s;t.prototype[u]=function(c,l){return!this[o](c,(d,p)=>!l(d,p))}}function c6(t,e){const{name:n,type:r,direction:i}=e,s=n.slice(0,-1)+"Entries";t.prototype[s]=function(o){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)
1742
+ return fr.empty();o=""+o;const a=this._nodes.get(o);if(typeof a>"u")throw new ae(`Graph.${s}: could not find the "${o}" node in the graph.`);return s6(r==="mixed"?this.type:r,i,a)}}function l6(t){r6.forEach(e=>{o6(t,e),a6(t,e),u6(t,e),c6(t,e)})}function Oh(t,e,n,r,i){const s=r._nodes.values(),o=r.type;let a,u,c,l,f,d;for(;a=s.next(),a.done!==!0;){let p=!1;if(u=a.value,o!=="undirected"){l=u.out;for(c in l){f=l[c];do d=f.target,p=!0,i(u.key,d.key,u.attributes,d.attributes,f.key,f.attributes,f.undirected),
1743
+ f=f.next;while(f)}}if(o!=="directed"){l=u.undirected;for(c in l)if(!(e&&u.key>c)){f=l[c];do d=f.target,d.key!==c&&(d=f.source),p=!0,i(u.key,d.key,u.attributes,d.attributes,f.key,f.attributes,f.undirected),f=f.next;while(f)}}n&&!p&&i(u.key,null,u.attributes,null,null,null,null)}}function d6(t,e){const n={key:t};return BA(e.attributes)||(n.attributes=Vt({},e.attributes)),n}function f6(t,e,n){const r={key:e,source:n.source.key,target:n.target.key};return BA(n.attributes)||(r.attributes=Vt({},n.attributes)),
1744
+ t==="mixed"&&n.undirected&&(r.undirected=!0),r}function p6(t){if(!dn(t))throw new me('Graph.import: invalid serialized node. A serialized node should be a plain object with at least a "key" property.');if(!("key"in t))throw new me("Graph.import: serialized node is missing its key.");if("attributes"in t&&(!dn(t.attributes)||t.attributes===null))throw new me("Graph.import: invalid attributes. Attributes should be a plain object, null or omitted.")}function h6(t){if(!dn(t))throw new me('Graph.impor\
1745
+ t: invalid serialized edge. A serialized edge should be a plain object with at least a "source" & "target" property.');if(!("source"in t))throw new me("Graph.import: serialized edge is missing its source.");if(!("target"in t))throw new me("Graph.import: serialized edge is missing its target.");if("attributes"in t&&(!dn(t.attributes)||t.attributes===null))throw new me("Graph.import: invalid attributes. Attributes should be a plain object, null or omitted.");if("undirected"in t&&typeof t.undirected!=
1746
+ "boolean")throw new me("Graph.import: invalid undirectedness information. Undirected should be boolean or omitted.")}const m6=yz(),g6=new Set(["directed","undirected","mixed"]),VA=new Set(["domain","_events","_eventsCount","_maxListeners"]),y6=[{name:t=>`${t}Edge`,generateKey:!0},{name:t=>`${t}DirectedEdge`,generateKey:!0,type:"directed"},{name:t=>`${t}UndirectedEdge`,generateKey:!0,type:"undirected"},{name:t=>`${t}EdgeWithKey`},{name:t=>`${t}DirectedEdgeWithKey`,type:"directed"},{name:t=>`${t}U\
1747
+ ndirectedEdgeWithKey`,type:"undirected"}],v6={allowSelfLoops:!0,multi:!1,type:"mixed"};function w6(t,e,n){if(n&&!dn(n))throw new me(`Graph.addNode: invalid attributes. Expecting an object but got "${n}"`);if(e=""+e,n=n||{},t._nodes.has(e))throw new Ce(`Graph.addNode: the "${e}" node already exist in the graph.`);const r=new t.NodeDataClass(e,n);return t._nodes.set(e,r),t.emit("nodeAdded",{key:e,attributes:n}),r}function XA(t,e,n){const r=new t.NodeDataClass(e,n);return t._nodes.set(e,r),t.emit("\
1748
+ nodeAdded",{key:e,attributes:n}),r}function YA(t,e,n,r,i,s,o,a){if(!r&&t.type==="undirected")throw new Ce(`Graph.${e}: you cannot add a directed edge to an undirected graph. Use the #.addEdge or #.addUndirectedEdge instead.`);if(r&&t.type==="directed")throw new Ce(`Graph.${e}: you cannot add an undirected edge to a directed graph. Use the #.addEdge or #.addDirectedEdge instead.`);if(a&&!dn(a))throw new me(`Graph.${e}: invalid attributes. Expecting an object but got "${a}"`);if(s=""+s,o=""+o,a=a||
1749
+ {},!t.allowSelfLoops&&s===o)throw new Ce(`Graph.${e}: source & target are the same ("${s}"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false.`);const u=t._nodes.get(s),c=t._nodes.get(o);if(!u)throw new ae(`Graph.${e}: source node "${s}" not found.`);if(!c)throw new ae(`Graph.${e}: target node "${o}" not found.`);const l={key:null,undirected:r,source:s,target:o,attributes:a};if(n)i=t._edgeKeyGenerator();else if(i=""+i,t._edges.has(i))throw new Ce(`Grap\
1750
+ h.${e}: the "${i}" edge already exists in the graph.`);if(!t.multi&&(r?typeof u.undirected[o]<"u":typeof u.out[o]<"u"))throw new Ce(`Graph.${e}: an edge linking "${s}" to "${o}" already exists. If you really want to add multiple edges linking those nodes, you should create a multi graph by using the 'multi' option.`);const f=new Aa(r,i,u,c,a);t._edges.set(i,f);const d=s===o;return r?(u.undirectedDegree++,c.undirectedDegree++,d&&(u.undirectedLoops++,t._undirectedSelfLoopCount++)):(u.outDegree++,c.
1751
+ inDegree++,d&&(u.directedLoops++,t._directedSelfLoopCount++)),t.multi?f.attachMulti():f.attach(),r?t._undirectedSize++:t._directedSize++,l.key=i,t.emit("edgeAdded",l),i}function b6(t,e,n,r,i,s,o,a,u){if(!r&&t.type==="undirected")throw new Ce(`Graph.${e}: you cannot merge/update a directed edge to an undirected graph. Use the #.mergeEdge/#.updateEdge or #.addUndirectedEdge instead.`);if(r&&t.type==="directed")throw new Ce(`Graph.${e}: you cannot merge/update an undirected edge to a directed graph\
1752
+ . Use the #.mergeEdge/#.updateEdge or #.addDirectedEdge instead.`);if(a){if(u){if(typeof a!="function")throw new me(`Graph.${e}: invalid updater function. Expecting a function but got "${a}"`)}else if(!dn(a))throw new me(`Graph.${e}: invalid attributes. Expecting an object but got "${a}"`)}s=""+s,o=""+o;let c;if(u&&(c=a,a=void 0),!t.allowSelfLoops&&s===o)throw new Ce(`Graph.${e}: source & target are the same ("${s}"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' optio\
1753
+ n set to false.`);let l=t._nodes.get(s),f=t._nodes.get(o),d,p;if(!n&&(d=t._edges.get(i),d)){if((d.source.key!==s||d.target.key!==o)&&(!r||d.source.key!==o||d.target.key!==s))throw new Ce(`Graph.${e}: inconsistency detected when attempting to merge the "${i}" edge with "${s}" source & "${o}" target vs. ("${d.source.key}", "${d.target.key}").`);p=d}if(!p&&!t.multi&&l&&(p=r?l.undirected[o]:l.out[o]),p){const E=[p.key,!1,!1,!1];if(u?!c:!a)return E;if(u){const R=p.attributes;p.attributes=c(R),t.emit(
1754
+ "edgeAttributesUpdated",{type:"replace",key:p.key,attributes:p.attributes})}else Vt(p.attributes,a),t.emit("edgeAttributesUpdated",{type:"merge",key:p.key,attributes:p.attributes,data:a});return E}a=a||{},u&&c&&(a=c(a));const m={key:null,undirected:r,source:s,target:o,attributes:a};if(n)i=t._edgeKeyGenerator();else if(i=""+i,t._edges.has(i))throw new Ce(`Graph.${e}: the "${i}" edge already exists in the graph.`);let v=!1,w=!1;l||(l=XA(t,s,{}),v=!0,s===o&&(f=l,w=!0)),f||(f=XA(t,o,{}),w=!0),d=new Aa(
1755
+ r,i,l,f,a),t._edges.set(i,d);const y=s===o;return r?(l.undirectedDegree++,f.undirectedDegree++,y&&(l.undirectedLoops++,t._undirectedSelfLoopCount++)):(l.outDegree++,f.inDegree++,y&&(l.directedLoops++,t._directedSelfLoopCount++)),t.multi?d.attachMulti():d.attach(),r?t._undirectedSize++:t._directedSize++,m.key=i,t.emit("edgeAdded",m),[i,!0,v,w]}function Sa(t,e){t._edges.delete(e.key);const{source:n,target:r,attributes:i}=e,s=e.undirected,o=n===r;s?(n.undirectedDegree--,r.undirectedDegree--,o&&(n.undirectedLoops--,
1756
+ t._undirectedSelfLoopCount--)):(n.outDegree--,r.inDegree--,o&&(n.directedLoops--,t._directedSelfLoopCount--)),t.multi?e.detachMulti():e.detach(),s?t._undirectedSize--:t._directedSize--,t.emit("edgeDropped",{key:e.key,attributes:i,source:n.key,target:r.key,undirected:s})}class dt extends q_{constructor(e){if(super(),e=Vt({},v6,e),typeof e.multi!="boolean")throw new me(`Graph.constructor: invalid 'multi' option. Expecting a boolean but got "${e.multi}".`);if(!g6.has(e.type))throw new me(`Graph.con\
1757
+ structor: invalid 'type' option. Should be one of "mixed", "directed" or "undirected" but got "${e.type}".`);if(typeof e.allowSelfLoops!="boolean")throw new me(`Graph.constructor: invalid 'allowSelfLoops' option. Expecting a boolean but got "${e.allowSelfLoops}".`);const n=e.type==="mixed"?jA:e.type==="directed"?GA:UA;hr(this,"NodeDataClass",n);const r="geid_"+m6()+"_";let i=0;const s=()=>{let o;do o=r+i++;while(this._edges.has(o));return o};hr(this,"_attributes",{}),hr(this,"_nodes",new Map),hr(
1758
+ this,"_edges",new Map),hr(this,"_directedSize",0),hr(this,"_undirectedSize",0),hr(this,"_directedSelfLoopCount",0),hr(this,"_undirectedSelfLoopCount",0),hr(this,"_edgeKeyGenerator",s),hr(this,"_options",e),VA.forEach(o=>hr(this,o,this[o])),_r(this,"order",()=>this._nodes.size),_r(this,"size",()=>this._edges.size),_r(this,"directedSize",()=>this._directedSize),_r(this,"undirectedSize",()=>this._undirectedSize),_r(this,"selfLoopCount",()=>this._directedSelfLoopCount+this._undirectedSelfLoopCount),
1759
+ _r(this,"directedSelfLoopCount",()=>this._directedSelfLoopCount),_r(this,"undirectedSelfLoopCount",()=>this._undirectedSelfLoopCount),_r(this,"multi",this._options.multi),_r(this,"type",this._options.type),_r(this,"allowSelfLoops",this._options.allowSelfLoops),_r(this,"implementation",()=>"graphology")}_resetInstanceCounters(){this._directedSize=0,this._undirectedSize=0,this._directedSelfLoopCount=0,this._undirectedSelfLoopCount=0}hasNode(e){return this._nodes.has(""+e)}hasDirectedEdge(e,n){if(this.
1760
+ type==="undirected")return!1;if(arguments.length===1){const r=""+e,i=this._edges.get(r);return!!i&&!i.undirected}else if(arguments.length===2){e=""+e,n=""+n;const r=this._nodes.get(e);return r?r.out.hasOwnProperty(n):!1}throw new me(`Graph.hasDirectedEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.`)}hasUndirectedEdge(e,n){if(this.type==="directed")return!1;if(arguments.length===1){const r=""+
1761
+ e,i=this._edges.get(r);return!!i&&i.undirected}else if(arguments.length===2){e=""+e,n=""+n;const r=this._nodes.get(e);return r?r.undirected.hasOwnProperty(n):!1}throw new me(`Graph.hasDirectedEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.`)}hasEdge(e,n){if(arguments.length===1){const r=""+e;return this._edges.has(r)}else if(arguments.length===2){e=""+e,n=""+n;const r=this._nodes.get(e);return r?
1762
+ typeof r.out<"u"&&r.out.hasOwnProperty(n)||typeof r.undirected<"u"&&r.undirected.hasOwnProperty(n):!1}throw new me(`Graph.hasEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.`)}directedEdge(e,n){if(this.type==="undirected")return;if(e=""+e,n=""+n,this.multi)throw new Ce("Graph.directedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & targe\
1763
+ t. See #.directedEdges instead.");const r=this._nodes.get(e);if(!r)throw new ae(`Graph.directedEdge: could not find the "${e}" source node in the graph.`);if(!this._nodes.has(n))throw new ae(`Graph.directedEdge: could not find the "${n}" target node in the graph.`);const i=r.out&&r.out[n]||void 0;if(i)return i.key}undirectedEdge(e,n){if(this.type==="directed")return;if(e=""+e,n=""+n,this.multi)throw new Ce("Graph.undirectedEdge: this method is irrelevant with multigraphs since there might be mul\
1764
+ tiple edges between source & target. See #.undirectedEdges instead.");const r=this._nodes.get(e);if(!r)throw new ae(`Graph.undirectedEdge: could not find the "${e}" source node in the graph.`);if(!this._nodes.has(n))throw new ae(`Graph.undirectedEdge: could not find the "${n}" target node in the graph.`);const i=r.undirected&&r.undirected[n]||void 0;if(i)return i.key}edge(e,n){if(this.multi)throw new Ce("Graph.edge: this method is irrelevant with multigraphs since there might be multiple edges b\
1765
+ etween source & target. See #.edges instead.");e=""+e,n=""+n;const r=this._nodes.get(e);if(!r)throw new ae(`Graph.edge: could not find the "${e}" source node in the graph.`);if(!this._nodes.has(n))throw new ae(`Graph.edge: could not find the "${n}" target node in the graph.`);const i=r.out&&r.out[n]||r.undirected&&r.undirected[n]||void 0;if(i)return i.key}areDirectedNeighbors(e,n){e=""+e,n=""+n;const r=this._nodes.get(e);if(!r)throw new ae(`Graph.areDirectedNeighbors: could not find the "${e}" n\
1766
+ ode in the graph.`);return this.type==="undirected"?!1:n in r.in||n in r.out}areOutNeighbors(e,n){e=""+e,n=""+n;const r=this._nodes.get(e);if(!r)throw new ae(`Graph.areOutNeighbors: could not find the "${e}" node in the graph.`);return this.type==="undirected"?!1:n in r.out}areInNeighbors(e,n){e=""+e,n=""+n;const r=this._nodes.get(e);if(!r)throw new ae(`Graph.areInNeighbors: could not find the "${e}" node in the graph.`);return this.type==="undirected"?!1:n in r.in}areUndirectedNeighbors(e,n){e=
1767
+ ""+e,n=""+n;const r=this._nodes.get(e);if(!r)throw new ae(`Graph.areUndirectedNeighbors: could not find the "${e}" node in the graph.`);return this.type==="directed"?!1:n in r.undirected}areNeighbors(e,n){e=""+e,n=""+n;const r=this._nodes.get(e);if(!r)throw new ae(`Graph.areNeighbors: could not find the "${e}" node in the graph.`);return this.type!=="undirected"&&(n in r.in||n in r.out)||this.type!=="directed"&&n in r.undirected}areInboundNeighbors(e,n){e=""+e,n=""+n;const r=this._nodes.get(e);if(!r)
1768
+ throw new ae(`Graph.areInboundNeighbors: could not find the "${e}" node in the graph.`);return this.type!=="undirected"&&n in r.in||this.type!=="directed"&&n in r.undirected}areOutboundNeighbors(e,n){e=""+e,n=""+n;const r=this._nodes.get(e);if(!r)throw new ae(`Graph.areOutboundNeighbors: could not find the "${e}" node in the graph.`);return this.type!=="undirected"&&n in r.out||this.type!=="directed"&&n in r.undirected}inDegree(e){e=""+e;const n=this._nodes.get(e);if(!n)throw new ae(`Graph.inDeg\
1769
+ ree: could not find the "${e}" node in the graph.`);return this.type==="undirected"?0:n.inDegree}outDegree(e){e=""+e;const n=this._nodes.get(e);if(!n)throw new ae(`Graph.outDegree: could not find the "${e}" node in the graph.`);return this.type==="undirected"?0:n.outDegree}directedDegree(e){e=""+e;const n=this._nodes.get(e);if(!n)throw new ae(`Graph.directedDegree: could not find the "${e}" node in the graph.`);return this.type==="undirected"?0:n.inDegree+n.outDegree}undirectedDegree(e){e=""+e;const n=this.
1770
+ _nodes.get(e);if(!n)throw new ae(`Graph.undirectedDegree: could not find the "${e}" node in the graph.`);return this.type==="directed"?0:n.undirectedDegree}inboundDegree(e){e=""+e;const n=this._nodes.get(e);if(!n)throw new ae(`Graph.inboundDegree: could not find the "${e}" node in the graph.`);let r=0;return this.type!=="directed"&&(r+=n.undirectedDegree),this.type!=="undirected"&&(r+=n.inDegree),r}outboundDegree(e){e=""+e;const n=this._nodes.get(e);if(!n)throw new ae(`Graph.outboundDegree: coul\
1771
+ d not find the "${e}" node in the graph.`);let r=0;return this.type!=="directed"&&(r+=n.undirectedDegree),this.type!=="undirected"&&(r+=n.outDegree),r}degree(e){e=""+e;const n=this._nodes.get(e);if(!n)throw new ae(`Graph.degree: could not find the "${e}" node in the graph.`);let r=0;return this.type!=="directed"&&(r+=n.undirectedDegree),this.type!=="undirected"&&(r+=n.inDegree+n.outDegree),r}inDegreeWithoutSelfLoops(e){e=""+e;const n=this._nodes.get(e);if(!n)throw new ae(`Graph.inDegreeWithoutSe\
1772
+ lfLoops: could not find the "${e}" node in the graph.`);return this.type==="undirected"?0:n.inDegree-n.directedLoops}outDegreeWithoutSelfLoops(e){e=""+e;const n=this._nodes.get(e);if(!n)throw new ae(`Graph.outDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);return this.type==="undirected"?0:n.outDegree-n.directedLoops}directedDegreeWithoutSelfLoops(e){e=""+e;const n=this._nodes.get(e);if(!n)throw new ae(`Graph.directedDegreeWithoutSelfLoops: could not find the "${e}" node i\
1773
+ n the graph.`);return this.type==="undirected"?0:n.inDegree+n.outDegree-n.directedLoops*2}undirectedDegreeWithoutSelfLoops(e){e=""+e;const n=this._nodes.get(e);if(!n)throw new ae(`Graph.undirectedDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);return this.type==="directed"?0:n.undirectedDegree-n.undirectedLoops*2}inboundDegreeWithoutSelfLoops(e){e=""+e;const n=this._nodes.get(e);if(!n)throw new ae(`Graph.inboundDegreeWithoutSelfLoops: could not find the "${e}" node in the \
1774
+ graph.`);let r=0,i=0;return this.type!=="directed"&&(r+=n.undirectedDegree,i+=n.undirectedLoops*2),this.type!=="undirected"&&(r+=n.inDegree,i+=n.directedLoops),r-i}outboundDegreeWithoutSelfLoops(e){e=""+e;const n=this._nodes.get(e);if(!n)throw new ae(`Graph.outboundDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);let r=0,i=0;return this.type!=="directed"&&(r+=n.undirectedDegree,i+=n.undirectedLoops*2),this.type!=="undirected"&&(r+=n.outDegree,i+=n.directedLoops),r-i}degreeWithoutSelfLoops(e){
1775
+ e=""+e;const n=this._nodes.get(e);if(!n)throw new ae(`Graph.degreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);let r=0,i=0;return this.type!=="directed"&&(r+=n.undirectedDegree,i+=n.undirectedLoops*2),this.type!=="undirected"&&(r+=n.inDegree+n.outDegree,i+=n.directedLoops*2),r-i}source(e){e=""+e;const n=this._edges.get(e);if(!n)throw new ae(`Graph.source: could not find the "${e}" edge in the graph.`);return n.source.key}target(e){e=""+e;const n=this._edges.get(e);if(!n)throw new ae(
1776
+ `Graph.target: could not find the "${e}" edge in the graph.`);return n.target.key}extremities(e){e=""+e;const n=this._edges.get(e);if(!n)throw new ae(`Graph.extremities: could not find the "${e}" edge in the graph.`);return[n.source.key,n.target.key]}opposite(e,n){e=""+e,n=""+n;const r=this._edges.get(n);if(!r)throw new ae(`Graph.opposite: could not find the "${n}" edge in the graph.`);const i=r.source.key,s=r.target.key;if(e===i)return s;if(e===s)return i;throw new ae(`Graph.opposite: the "${e}\
1777
+ " node is not attached to the "${n}" edge (${i}, ${s}).`)}hasExtremity(e,n){e=""+e,n=""+n;const r=this._edges.get(e);if(!r)throw new ae(`Graph.hasExtremity: could not find the "${e}" edge in the graph.`);return r.source.key===n||r.target.key===n}isUndirected(e){e=""+e;const n=this._edges.get(e);if(!n)throw new ae(`Graph.isUndirected: could not find the "${e}" edge in the graph.`);return n.undirected}isDirected(e){e=""+e;const n=this._edges.get(e);if(!n)throw new ae(`Graph.isDirected: could not f\
1778
+ ind the "${e}" edge in the graph.`);return!n.undirected}isSelfLoop(e){e=""+e;const n=this._edges.get(e);if(!n)throw new ae(`Graph.isSelfLoop: could not find the "${e}" edge in the graph.`);return n.source===n.target}addNode(e,n){return w6(this,e,n).key}mergeNode(e,n){if(n&&!dn(n))throw new me(`Graph.mergeNode: invalid attributes. Expecting an object but got "${n}"`);e=""+e,n=n||{};let r=this._nodes.get(e);return r?(n&&(Vt(r.attributes,n),this.emit("nodeAttributesUpdated",{type:"merge",key:e,attributes:r.
1779
+ attributes,data:n})),[e,!1]):(r=new this.NodeDataClass(e,n),this._nodes.set(e,r),this.emit("nodeAdded",{key:e,attributes:n}),[e,!0])}updateNode(e,n){if(n&&typeof n!="function")throw new me(`Graph.updateNode: invalid updater function. Expecting a function but got "${n}"`);e=""+e;let r=this._nodes.get(e);if(r){if(n){const s=r.attributes;r.attributes=n(s),this.emit("nodeAttributesUpdated",{type:"replace",key:e,attributes:r.attributes})}return[e,!1]}const i=n?n({}):{};return r=new this.NodeDataClass(
1780
+ e,i),this._nodes.set(e,r),this.emit("nodeAdded",{key:e,attributes:i}),[e,!0]}dropNode(e){e=""+e;const n=this._nodes.get(e);if(!n)throw new ae(`Graph.dropNode: could not find the "${e}" node in the graph.`);let r;if(this.type!=="undirected"){for(const i in n.out){r=n.out[i];do Sa(this,r),r=r.next;while(r)}for(const i in n.in){r=n.in[i];do Sa(this,r),r=r.next;while(r)}}if(this.type!=="directed")for(const i in n.undirected){r=n.undirected[i];do Sa(this,r),r=r.next;while(r)}this._nodes.delete(e),this.
1781
+ emit("nodeDropped",{key:e,attributes:n.attributes})}dropEdge(e){let n;if(arguments.length>1){const r=""+arguments[0],i=""+arguments[1];if(n=pr(this,r,i,this.type),!n)throw new ae(`Graph.dropEdge: could not find the "${r}" -> "${i}" edge in the graph.`)}else if(e=""+e,n=this._edges.get(e),!n)throw new ae(`Graph.dropEdge: could not find the "${e}" edge in the graph.`);return Sa(this,n),this}dropDirectedEdge(e,n){if(arguments.length<2)throw new Ce("Graph.dropDirectedEdge: it does not make sense to \
1782
+ try and drop a directed edge by key. What if the edge with this key is undirected? Use #.dropEdge for this purpose instead.");if(this.multi)throw new Ce("Graph.dropDirectedEdge: cannot use a {source,target} combo when dropping an edge in a MultiGraph since we cannot infer the one you want to delete as there could be multiple ones.");e=""+e,n=""+n;const r=pr(this,e,n,"directed");if(!r)throw new ae(`Graph.dropDirectedEdge: could not find a "${e}" -> "${n}" edge in the graph.`);return Sa(this,r),this}dropUndirectedEdge(e,n){
1783
+ if(arguments.length<2)throw new Ce("Graph.dropUndirectedEdge: it does not make sense to drop a directed edge by key. What if the edge with this key is undirected? Use #.dropEdge for this purpose instead.");if(this.multi)throw new Ce("Graph.dropUndirectedEdge: cannot use a {source,target} combo when dropping an edge in a MultiGraph since we cannot infer the one you want to delete as there could be multiple ones.");const r=pr(this,e,n,"undirected");if(!r)throw new ae(`Graph.dropUndirectedEdge: cou\
1784
+ ld not find a "${e}" -> "${n}" edge in the graph.`);return Sa(this,r),this}clear(){this._edges.clear(),this._nodes.clear(),this._resetInstanceCounters(),this.emit("cleared")}clearEdges(){const e=this._nodes.values();let n;for(;n=e.next(),n.done!==!0;)n.value.clear();this._edges.clear(),this._resetInstanceCounters(),this.emit("edgesCleared")}getAttribute(e){return this._attributes[e]}getAttributes(){return this._attributes}hasAttribute(e){return this._attributes.hasOwnProperty(e)}setAttribute(e,n){
1785
+ return this._attributes[e]=n,this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:e}),this}updateAttribute(e,n){if(typeof n!="function")throw new me("Graph.updateAttribute: updater should be a function.");const r=this._attributes[e];return this._attributes[e]=n(r),this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:e}),this}removeAttribute(e){return delete this._attributes[e],this.emit("attributesUpdated",{type:"remove",attributes:this._attributes,name:e}),
1786
+ this}replaceAttributes(e){if(!dn(e))throw new me("Graph.replaceAttributes: provided attributes are not a plain object.");return this._attributes=e,this.emit("attributesUpdated",{type:"replace",attributes:this._attributes}),this}mergeAttributes(e){if(!dn(e))throw new me("Graph.mergeAttributes: provided attributes are not a plain object.");return Vt(this._attributes,e),this.emit("attributesUpdated",{type:"merge",attributes:this._attributes,data:e}),this}updateAttributes(e){if(typeof e!="function")
1787
+ throw new me("Graph.updateAttributes: provided updater is not a function.");return this._attributes=e(this._attributes),this.emit("attributesUpdated",{type:"update",attributes:this._attributes}),this}updateEachNodeAttributes(e,n){if(typeof e!="function")throw new me("Graph.updateEachNodeAttributes: expecting an updater function.");if(n&&!qA(n))throw new me("Graph.updateEachNodeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");const r=this._nodes.
1788
+ values();let i,s;for(;i=r.next(),i.done!==!0;)s=i.value,s.attributes=e(s.key,s.attributes);this.emit("eachNodeAttributesUpdated",{hints:n||null})}updateEachEdgeAttributes(e,n){if(typeof e!="function")throw new me("Graph.updateEachEdgeAttributes: expecting an updater function.");if(n&&!qA(n))throw new me("Graph.updateEachEdgeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");const r=this._edges.values();let i,s,o,a;for(;i=r.next(),i.done!==!0;)s=i.
1789
+ value,o=s.source,a=s.target,s.attributes=e(s.key,s.attributes,o.key,a.key,o.attributes,a.attributes,s.undirected);this.emit("eachEdgeAttributesUpdated",{hints:n||null})}forEachAdjacencyEntry(e){if(typeof e!="function")throw new me("Graph.forEachAdjacencyEntry: expecting a callback.");Oh(!1,!1,!1,this,e)}forEachAdjacencyEntryWithOrphans(e){if(typeof e!="function")throw new me("Graph.forEachAdjacencyEntryWithOrphans: expecting a callback.");Oh(!1,!1,!0,this,e)}forEachAssymetricAdjacencyEntry(e){if(typeof e!=
1790
+ "function")throw new me("Graph.forEachAssymetricAdjacencyEntry: expecting a callback.");Oh(!1,!0,!1,this,e)}forEachAssymetricAdjacencyEntryWithOrphans(e){if(typeof e!="function")throw new me("Graph.forEachAssymetricAdjacencyEntryWithOrphans: expecting a callback.");Oh(!1,!0,!0,this,e)}nodes(){return typeof Array.from=="function"?Array.from(this._nodes.keys()):LA(this._nodes.keys(),this._nodes.size)}forEachNode(e){if(typeof e!="function")throw new me("Graph.forEachNode: expecting a callback.");const n=this.
1791
+ _nodes.values();let r,i;for(;r=n.next(),r.done!==!0;)i=r.value,e(i.key,i.attributes)}findNode(e){if(typeof e!="function")throw new me("Graph.findNode: expecting a callback.");const n=this._nodes.values();let r,i;for(;r=n.next(),r.done!==!0;)if(i=r.value,e(i.key,i.attributes))return i.key}mapNodes(e){if(typeof e!="function")throw new me("Graph.mapNode: expecting a callback.");const n=this._nodes.values();let r,i;const s=new Array(this.order);let o=0;for(;r=n.next(),r.done!==!0;)i=r.value,s[o++]=e(
1792
+ i.key,i.attributes);return s}someNode(e){if(typeof e!="function")throw new me("Graph.someNode: expecting a callback.");const n=this._nodes.values();let r,i;for(;r=n.next(),r.done!==!0;)if(i=r.value,e(i.key,i.attributes))return!0;return!1}everyNode(e){if(typeof e!="function")throw new me("Graph.everyNode: expecting a callback.");const n=this._nodes.values();let r,i;for(;r=n.next(),r.done!==!0;)if(i=r.value,!e(i.key,i.attributes))return!1;return!0}filterNodes(e){if(typeof e!="function")throw new me(
1793
+ "Graph.filterNodes: expecting a callback.");const n=this._nodes.values();let r,i;const s=[];for(;r=n.next(),r.done!==!0;)i=r.value,e(i.key,i.attributes)&&s.push(i.key);return s}reduceNodes(e,n){if(typeof e!="function")throw new me("Graph.reduceNodes: expecting a callback.");if(arguments.length<2)throw new me("Graph.reduceNodes: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could \
1794
+ with a simple array.");let r=n;const i=this._nodes.values();let s,o;for(;s=i.next(),s.done!==!0;)o=s.value,r=e(r,o.key,o.attributes);return r}nodeEntries(){const e=this._nodes.values();return new fr(()=>{const n=e.next();if(n.done)return n;const r=n.value;return{value:{node:r.key,attributes:r.attributes},done:!1}})}export(){const e=new Array(this._nodes.size);let n=0;this._nodes.forEach((i,s)=>{e[n++]=d6(s,i)});const r=new Array(this._edges.size);return n=0,this._edges.forEach((i,s)=>{r[n++]=f6(
1795
+ this.type,s,i)}),{options:{type:this.type,multi:this.multi,allowSelfLoops:this.allowSelfLoops},attributes:this.getAttributes(),nodes:e,edges:r}}import(e,n=!1){if(e instanceof dt)return e.forEachNode((u,c)=>{n?this.mergeNode(u,c):this.addNode(u,c)}),e.forEachEdge((u,c,l,f,d,p,m)=>{n?m?this.mergeUndirectedEdgeWithKey(u,l,f,c):this.mergeDirectedEdgeWithKey(u,l,f,c):m?this.addUndirectedEdgeWithKey(u,l,f,c):this.addDirectedEdgeWithKey(u,l,f,c)}),this;if(!dn(e))throw new me("Graph.import: invalid argu\
1796
+ ment. Expecting a serialized graph or, alternatively, a Graph instance.");if(e.attributes){if(!dn(e.attributes))throw new me("Graph.import: invalid attributes. Expecting a plain object.");n?this.mergeAttributes(e.attributes):this.replaceAttributes(e.attributes)}let r,i,s,o,a;if(e.nodes){if(s=e.nodes,!Array.isArray(s))throw new me("Graph.import: invalid nodes. Expecting an array.");for(r=0,i=s.length;r<i;r++){o=s[r],p6(o);const{key:u,attributes:c}=o;n?this.mergeNode(u,c):this.addNode(u,c)}}if(e.edges){
1797
+ let u=!1;if(this.type==="undirected"&&(u=!0),s=e.edges,!Array.isArray(s))throw new me("Graph.import: invalid edges. Expecting an array.");for(r=0,i=s.length;r<i;r++){a=s[r],h6(a);const{source:c,target:l,attributes:f,undirected:d=u}=a;let p;"key"in a?(p=n?d?this.mergeUndirectedEdgeWithKey:this.mergeDirectedEdgeWithKey:d?this.addUndirectedEdgeWithKey:this.addDirectedEdgeWithKey,p.call(this,a.key,c,l,f)):(p=n?d?this.mergeUndirectedEdge:this.mergeDirectedEdge:d?this.addUndirectedEdge:this.addDirectedEdge,
1798
+ p.call(this,c,l,f))}}return this}nullCopy(e){const n=new dt(Vt({},this._options,e));return n.replaceAttributes(Vt({},this.getAttributes())),n}emptyCopy(e){const n=this.nullCopy(e);return this._nodes.forEach((r,i)=>{const s=Vt({},r.attributes);r=new n.NodeDataClass(i,s),n._nodes.set(i,r)}),n}copy(e){if(e=e||{},typeof e.type=="string"&&e.type!==this.type&&e.type!=="mixed")throw new Ce(`Graph.copy: cannot create an incompatible copy from "${this.type}" type to "${e.type}" because this would mean lo\
1799
+ sing information about the current graph.`);if(typeof e.multi=="boolean"&&e.multi!==this.multi&&e.multi!==!0)throw new Ce("Graph.copy: cannot create an incompatible copy by downgrading a multi graph to a simple one because this would mean losing information about the current graph.");if(typeof e.allowSelfLoops=="boolean"&&e.allowSelfLoops!==this.allowSelfLoops&&e.allowSelfLoops!==!0)throw new Ce("Graph.copy: cannot create an incompatible copy from a graph allowing self loops to one that does not\
1800
+ because this would mean losing information about the current graph.");const n=this.emptyCopy(e),r=this._edges.values();let i,s;for(;i=r.next(),i.done!==!0;)s=i.value,YA(n,"copy",!1,s.undirected,s.key,s.source.key,s.target.key,Vt({},s.attributes));return n}toJSON(){return this.export()}toString(){return"[object Graph]"}inspect(){const e={};this._nodes.forEach((s,o)=>{e[o]=s.attributes});const n={},r={};this._edges.forEach((s,o)=>{const a=s.undirected?"--":"->";let u="",c=s.source.key,l=s.target.
1801
+ key,f;s.undirected&&c>l&&(f=c,c=l,l=f);const d=`(${c})${a}(${l})`;o.startsWith("geid_")?this.multi&&(typeof r[d]>"u"?r[d]=0:r[d]++,u+=`${r[d]}. `):u+=`[${o}]: `,u+=d,n[u]=s.attributes});const i={};for(const s in this)this.hasOwnProperty(s)&&!VA.has(s)&&typeof this[s]!="function"&&typeof s!="symbol"&&(i[s]=this[s]);return i.attributes=this._attributes,i.nodes=e,i.edges=n,hr(i,"constructor",this.constructor),i}}typeof Symbol<"u"&&(dt.prototype[Symbol.for("nodejs.util.inspect.custom")]=dt.prototype.
1802
+ inspect),y6.forEach(t=>{["add","merge","update"].forEach(e=>{const n=t.name(e),r=e==="add"?YA:b6;t.generateKey?dt.prototype[n]=function(i,s,o){return r(this,n,!0,(t.type||this.type)==="undirected",null,i,s,o,e==="update")}:dt.prototype[n]=function(i,s,o,a){return r(this,n,!1,(t.type||this.type)==="undirected",i,s,o,a,e==="update")}})}),Sz(dt),qz(dt),n6(dt),l6(dt);class JA extends dt{constructor(e){const n=Vt({type:"directed"},e);if("multi"in n&&n.multi!==!1)throw new me("DirectedGraph.from: inco\
1803
+ nsistent indication that the graph should be multi in given options!");if(n.type!=="directed")throw new me('DirectedGraph.from: inconsistent "'+n.type+'" type in given options!');super(n)}}class QA extends dt{constructor(e){const n=Vt({type:"undirected"},e);if("multi"in n&&n.multi!==!1)throw new me("UndirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if(n.type!=="undirected")throw new me('UndirectedGraph.from: inconsistent "'+n.type+'" type in given o\
1804
+ ptions!');super(n)}}class ZA extends dt{constructor(e){const n=Vt({multi:!0},e);if("multi"in n&&n.multi!==!0)throw new me("MultiGraph.from: inconsistent indication that the graph should be simple in given options!");super(n)}}class eS extends dt{constructor(e){const n=Vt({type:"directed",multi:!0},e);if("multi"in n&&n.multi!==!0)throw new me("MultiDirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if(n.type!=="directed")throw new me('MultiDirectedGrap\
1805
+ h.from: inconsistent "'+n.type+'" type in given options!');super(n)}}class tS extends dt{constructor(e){const n=Vt({type:"undirected",multi:!0},e);if("multi"in n&&n.multi!==!0)throw new me("MultiUndirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if(n.type!=="undirected")throw new me('MultiUndirectedGraph.from: inconsistent "'+n.type+'" type in given options!');super(n)}}function _a(t){t.from=function(e,n){const r=Vt({},e.options,n),i=new t(r);return i.
1806
+ import(e),i}}_a(dt),_a(JA),_a(QA),_a(ZA),_a(eS),_a(tS),dt.Graph=dt,dt.DirectedGraph=JA,dt.UndirectedGraph=QA,dt.MultiGraph=ZA,dt.MultiDirectedGraph=eS,dt.MultiUndirectedGraph=tS,dt.InvalidArgumentsGraphError=me,dt.NotFoundGraphError=ae,dt.UsageGraphError=Ce;const Qv="dashed",Zv=Jt.font,nS=g1("dot");class ew{constructor(e){this.view=e,this.compoundIds=new Set(e.nodes.filter(er).map(r=>r.id)),this.edgesWithCompounds=new Set(this.compoundIds.size>0?e.edges.filter(r=>this.compoundIds.has(r.source)||
1807
+ this.compoundIds.has(r.target)).map(r=>r.id):[]);for(const r of e.nodes)this.graphology.addNode(r.id,{origin:r,level:r.level,depth:r.depth??0,modelRef:Jw.modelRef(r),deploymentRef:Jw.deploymentRef(r),maxConnectedHierarchyDistance:0});for(const r of e.edges){let i=this.graphology.getNodeAttribute(r.source,"deploymentRef"),s=this.graphology.getNodeAttribute(r.target,"deploymentRef");(i===null||s===null)&&(i=this.graphology.getNodeAttribute(r.source,"modelRef"),s=this.graphology.getNodeAttribute(r.
1808
+ target,"modelRef"));let o=-1;i!==null&&s!==null?o=w_(i,s):nS.warn(`Edge ${r.id} of view ${e.id} is invalid, sourceFqn: ${i}, targetFqn: ${s}`),this.graphology.addEdgeWithKey(r.id,r.source,r.target,{origin:r,hierarchyDistance:o,weight:1}),o>this.graphology.getNodeAttribute(r.source,"maxConnectedHierarchyDistance")&&this.graphology.mergeNodeAttributes(r.source,{maxConnectedHierarchyDistance:o}),o>this.graphology.getNodeAttribute(r.target,"maxConnectedHierarchyDistance")&&this.graphology.mergeNodeAttributes(
1809
+ r.target,{maxConnectedHierarchyDistance:o})}this.graphology.forEachEdge((r,{hierarchyDistance:i},s,o,a,u)=>{const c=Math.max(a.maxConnectedHierarchyDistance,u.maxConnectedHierarchyDistance);if(c>i)this.graphology.mergeEdgeAttributes(r,{weight:c-i+1});else{const l=this.graphology.directedDegree(s),f=this.graphology.directedDegree(o);l===1&&f===1&&i>1&&this.graphology.mergeEdgeAttributes(r,{weight:i})}});const n=this.graphvizModel=this.createGraph();this.applyNodeAttributes(n.attributes.node),this.
1810
+ applyEdgeAttributes(n.attributes.edge)}ids=new Set;subgraphs=new Map;nodes=new Map;edges=new Map;compoundIds;edgesWithCompounds;graphology=new dt({allowSelfLoops:!0,multi:!0,type:"directed"});graphvizModel;get hasEdgesWithCompounds(){return this.edgesWithCompounds.size>0}postBuild(e){}build(e){const n=(i,s)=>{const o=this.generateGraphvizId(i),a=this.elementToSubgraph(i,s.subgraph(o));this.subgraphs.set(i.id,a);for(const u of i.children){const c=this.computedNode(u);if(er(c))n(c,a);else{const l=It(
1811
+ this.getGraphNode(c.id),`Graphviz Node not found for ${c.id}`);a.node(l.id)}}},r=[];for(const i of this.view.nodes)if(er(i))Rt(i.parent)&&r.push(i);else{const s=this.generateGraphvizId(i),o=this.elementToNode(i,e.node(s));this.nodes.set(i.id,o)}for(const i of r)n(i,e);for(const i of this.view.edges){const s=this.addEdge(i,e);s&&this.edges.set(i.id,s)}}print(){const e=this.graphvizModel;return this.build(e),this.postBuild(e),RA(this.graphvizModel,{print:{indentStyle:"space",indentSize:2}})}createGraph(){
1812
+ const e=this.view.autoLayout,n=WW({[F.likec4_viewId]:this.view.id,[F.bgcolor]:"transparent",[F.layout]:"dot",[F.compound]:!0,[F.rankdir]:e.direction,[F.TBbalance]:"min",[F.splines]:"spline",[F.outputorder]:"nodesfirst",[F.nodesep]:vt(e.nodeSep??110),[F.ranksep]:vt(e.rankSep??120),[F.pad]:vt(15),[F.fontname]:Zv});return n.attributes.graph.apply({[F.fontsize]:dr(15),[F.labeljust]:e.direction==="RL"?"r":"l",[F.labelloc]:e.direction==="BT"?"b":"t",[F.margin]:50.1}),n}applyNodeAttributes(e){e.apply({
1813
+ [F.fontname]:Zv,[F.shape]:"rect",[F.fillcolor]:Jt.elements[Ao].fill,[F.fontcolor]:Jt.elements[Ao].hiContrast,[F.color]:Jt.elements[Ao].stroke,[F.style]:"filled",[F.penwidth]:0})}applyEdgeAttributes(e){e.apply({[F.arrowsize]:.75,[F.fontname]:Zv,[F.fontsize]:dr(14),[F.penwidth]:dr(2),[F.color]:Jt.relationships[Ma].lineColor,[F.fontcolor]:Jt.relationships[Ma].labelColor})}checkNodeId(e,n=!1){return n?e="cluster_"+e:e.toLowerCase().startsWith("cluster")&&(e="nd_"+e),this.ids.has(e)?null:(this.ids.add(
1814
+ e),e)}generateGraphvizId(e){const n=er(e);let r=Hh(e.id).toLowerCase(),i=this.checkNodeId(r,n);if(i!==null)return i;r=Hh(e.id).toLowerCase();let s=1;do i=this.checkNodeId(r+"_"+s++,n);while(i===null);return i}elementToSubgraph(e,n){_e(er(e),"node should be compound"),_e(up(e.depth),"node.depth should be defined");const r=this.getElementColorValues(e.color),i=iz(r.loContrast);return n.apply({[F.likec4_id]:e.id,[F.likec4_level]:e.level,[F.likec4_depth]:e.depth,[F.fillcolor]:AA(r.fill,e.depth),[F.color]:AA(
1815
+ r.stroke,e.depth),[F.style]:"filled",[F.margin]:dr(e.children.length>1?40:32)}),Gt(e.title.trim())||n.set(F.label,uz(e,i)),n}elementToNode(e,n){_e(!er(e),"node should not be compound");const r=ce(e.icon),i=this.getElementColorValues(e.color);let s=e.style.size,o=e.style.textSize,a=e.style.padding;!s&&o&&(s=o),!o&&s&&(o=s),!a&&s&&(a=s),s??=F_,o??=L_,a??=M_;const u=Jt.spacing[a];switch(n.attributes.apply({[F.likec4_id]:e.id,[F.likec4_level]:e.level,[F.label]:az(e,i,{shape:s,text:o}),[F.margin]:`${vt(
1816
+ r?8:u)},${vt(u)}`}),n.attributes.set(F.width,vt(Jt.sizes[s].width)),n.attributes.set(F.height,vt(Jt.sizes[s].height)),e.color!==Ao&&n.attributes.apply({[F.fillcolor]:i.fill,[F.fontcolor]:i.hiContrast,[F.color]:i.stroke}),e.shape){case"cylinder":case"storage":{n.attributes.apply({[F.margin]:`${vt(r?8:u)},${vt(0)}`,[F.penwidth]:dr(2),[F.shape]:"cylinder"});break}case"browser":{n.attributes.apply({[F.margin]:`${vt(r?8:u+4)},${vt(u+6)}`});break}case"mobile":{n.attributes.apply({[F.margin]:`${vt(r?8:
1817
+ u+4)},${vt(u)}`});break}case"queue":{n.attributes.apply({[F.width]:vt(Jt.sizes[s].width),[F.height]:vt(Jt.sizes[s].height-8),[F.margin]:`${vt(r?8:u+4)},${vt(u)}`});break}}return n}leafElements(e){return e===null?this.view.nodes.filter(n=>!er(n)):this.computedNode(e).children.flatMap(n=>{const r=this.computedNode(n);return er(r)?this.leafElements(r.id):r})}descendants(e){return e===null?this.view.nodes.slice():this.computedNode(e).children.flatMap(n=>{const r=this.computedNode(n);return[r,...this.
1818
+ descendants(r.id)]})}computedNode(e){return It(this.view.nodes.find(n=>n.id===e),`Node ${e} not found`)}getGraphNode(e){return this.nodes.get(e)??null}getSubgraph(e){return this.subgraphs.get(e)??null}edgeEndpoint(e,n){let r=this.computedNode(e),i=this.getGraphNode(e),s;return i||(_e(er(r),"endpoint node should be compound"),s=this.getSubgraph(e)?.id,_e(s,`subgraph ${e} not found`),r=It(n(this.leafElements(e)),`leaf element in ${e} not found`),i=It(this.getGraphNode(r.id),`source graphviz node ${r.
1819
+ id} not found`)),[r,i,s]}findInternalEdges(e){if(e===null)return this.view.edges.slice();const n=this.computedNode(e);return He(this.descendants(e),Hr(r=>qR(r.inEdges,r.outEdges)),Yo(),J4(qR(n.inEdges,n.outEdges)),xt(r=>this.view.edges.find(i=>i.id===r)),ze(ce))}withoutCompoundEdges(e){return this.edgesWithCompounds.size===0?e:{...e,inEdges:e.inEdges.filter(n=>!this.edgesWithCompounds.has(n)),outEdges:e.outEdges.filter(n=>!this.edgesWithCompounds.has(n))}}assignGroups(){const e=He(this.view.nodes,
1820
+ ze(er),xt(r=>r.id),IR(b_),w4(),xt(r=>{const i=this.findInternalEdges(r).filter(s=>s.source!==s.target&&!this.compoundIds.has(s.source)&&!this.compoundIds.has(s.target));return{id:r,edges:i}}),ze(({edges:r})=>r.length>1&&r.length<8),a4(4)),n=new Set;for(const r of e){const i=r.edges.filter(s=>!n.has(s.source)&&!n.has(s.target));for(const s of i)try{const o=It(this.getGraphNode(s.source),`Graphviz Node not found for ${s.source}`),a=It(this.getGraphNode(s.target),`Graphviz Node not found for ${s.target}`);
1821
+ n.add(s.source),n.add(s.target),o.attributes.set(F.group,r.id),a.attributes.set(F.group,r.id)}catch(o){nS.error(`Failed to assign group to edge ${s.id}`,{error:o})}}}applyManualLayout({height:e,...n}){const r=n.x<0?-n.x:0,i=n.y<0?-n.y:0,s=r>0||i>0;for(const{id:o,...a}of n.nodes){const u=this.getGraphNode(o);if(!u)continue;const c=vt(a.center.x)+r,l=vt(e-a.center.y);a.fixedsize?u.attributes.apply({[F.pos]:`${c},${l}!`,[F.pin]:!0,[F.width]:vt(a.fixedsize.width),[F.height]:vt(a.fixedsize.height),[F.
1822
+ fixedsize]:!0}):u.attributes.set(F.pos,`${c},${l}`)}for(const[o,a]of this.edges.entries()){a.attributes.delete(F.weight),a.attributes.delete(F.minlen),a.attributes.delete(F.constraint);const u=n.edges.find(c=>c.id===o)?.dotpos;u&&!s&&a.attributes.set(F.pos,u)}return this.graphvizModel.apply({[F.layout]:"fdp",[F.overlap]:"vpsc",[F.sep]:"+50,50",[F.esep]:"+10,10",[F.start]:"random2",[F.splines]:"compound"}),this.graphvizModel.delete(F.compound),this.graphvizModel.delete(F.rankdir),this.graphvizModel.
1823
+ delete(F.nodesep),this.graphvizModel.delete(F.ranksep),this.graphvizModel.delete(F.pack),this.graphvizModel.delete(F.pad),this.graphvizModel.delete(F.packmode),this.graphvizModel.attributes.graph.delete(F.margin),this}getRelationshipColorValues(e){return jw(e)?Jt.relationships[e]:this.view.customColorDefinitions[e]?.relationships??Jt.relationships[Ao]}getElementColorValues(e){return jw(e)?Jt.elements[e]:this.view.customColorDefinitions[e]?.elements??Jt.elements[Ao]}}class E6 extends ew{createGraph(){
1824
+ const e=super.createGraph(),n=this.view.autoLayout;return e.delete(F.TBbalance),e.apply({[F.nodesep]:vt(n.nodeSep??130),[F.ranksep]:vt(n.rankSep??130)}),e}postBuild(e){He(this.view.nodes,xt(n=>({node:n,graphvizNode:this.getGraphNode(n.id)})),Qo(({node:n,graphvizNode:r})=>{if(r!=null)return Ad.modelRef(n)??void 0}),ap(),ze(cr(2)),L4(n=>{e.subgraph({[F.rank]:"same"},r=>{for(const{graphvizNode:i}of n)r.node(It(i).id)})}),p4(()=>{e.set(F.newrank,!0),e.set(F.clusterrank,"global"),e.delete(F.pack),e.delete(
1825
+ F.packmode)}))}elementToSubgraph(e,n){const r=super.elementToSubgraph(e,n);return e.children.length>1&&r.set(F.margin,dr(50)),r}addEdge(e,n){const[r,i]=[e.source,e.target],[s,o,a]=this.edgeEndpoint(r,y=>Qu(y)),[u,c,l]=this.edgeEndpoint(i,Zo),f=Tn(l)||Tn(a),d=n.edge([o,c],{[F.likec4_id]:e.id,[F.style]:e.line??Qv});l&&d.attributes.set(F.lhead,l),a&&d.attributes.set(F.ltail,a);const p=this.graphology.getEdgeAttribute(e.id,"weight");p>1&&!this.graphology.hasDirectedEdge(e.target,e.source)&&d.attributes.
1826
+ set(F.weight,p);const m=PA(e);if(m&&d.attributes.set(f?F.xlabel:F.label,m),e.color){const y=this.getRelationshipColorValues(e.color);d.attributes.apply({[F.color]:y.lineColor,[F.fontcolor]:y.labelColor})}let[v,w]=[e.head??ws,e.tail??"none"];return v==="none"&&w==="none"?(d.attributes.apply({[F.arrowtail]:"none",[F.arrowhead]:"none",[F.dir]:"none"}),d):e.dir==="both"?(d.attributes.apply({[F.arrowhead]:gn(v),[F.arrowtail]:gn(e.tail??v),[F.dir]:"both"}),!f&&Ad.modelRef(s)!==Ad.modelRef(u)&&d.attributes.
1827
+ set(F.constraint,!1),d):(v!==ws&&d.attributes.set(F.arrowhead,gn(v)),w!=="none"&&d.attributes.set(F.arrowtail,gn(w)),d)}}class Fw extends ew{static toDot(e){return new Fw(e).print()}postBuild(e){e.delete(F.TBbalance)}addEdge(e,n){const{nodes:r}=this.view,[i,s]=e.dir==="back"?[e.target,e.source]:[e.source,e.target],[o,a,u]=this.edgeEndpoint(i,A=>Qu(A)),[c,l,f]=this.edgeEndpoint(s,Zo),d=n.edge([a,l],{[F.likec4_id]:e.id,[F.style]:e.line??Qv});if(f&&d.attributes.set(F.lhead,f),u&&d.attributes.set(F.
1828
+ ltail,u),e.color&&e.color!==Ma){const A=this.getRelationshipColorValues(e.color);d.attributes.apply({[F.color]:A.lineColor,[F.fontcolor]:A.labelColor})}const p=[e.label?.trim(),e.technology?.trim()].filter(ce).join(`
1829
+ `),m=E_(e.id),v=cz(m,p);d.attributes.set(F.label,v);const w=this.graphology.getEdgeAttribute(e.id,"weight");e.source!==e.target&&w>1&&d.attributes.set(F.weight,w);const y=r.findIndex(A=>A.id===i);r.findIndex(A=>A.id===s)<y&&e.dir!=="back"&&d.attributes.apply({[F.constraint]:!1});let[E,R]=[e.head??ws,e.tail??"none"];return e.dir==="back"?(d.attributes.apply({[F.arrowtail]:gn(E),[F.minlen]:0,[F.dir]:"back"}),R!=="none"&&d.attributes.apply({[F.arrowhead]:gn(R),[F.dir]:"both"}),d):E==="none"&&R==="n\
1830
+ one"||E!=="none"&&R!=="none"?(d.attributes.apply({[F.arrowhead]:gn(E),[F.arrowtail]:gn(R),[F.dir]:"both"}),d):E==="none"?(d.attributes.delete(F.arrowhead),d.attributes.apply({[F.arrowtail]:gn(R),[F.minlen]:0,[F.dir]:"back"}),d):(E!==ws&&d.attributes.set(F.arrowhead,gn(E)),d)}}class $6 extends ew{postBuild(e){this.assignGroups();const n=new Set,r=this.view.nodes.reduce((s,o)=>(er(o)&&(n.add(o.id),s.push(o)),s),[]);let i=!1;for(const s of r){const o=He(s.children,ze(l=>!this.compoundIds.has(l)),xt(
1831
+ l=>this.computedNode(l)),ze(l=>l.inEdges.length===0&&l.outEdges.length===0));if(o.length<=2)continue;let a=2;switch(!0){case o.length>11:a=4;break;case o.length>4:a=3;break}const u=It(this.getSubgraph(s.id),`Subgraph not found for ${s.id}`);let c=null;t3(o,a).forEach(l=>{const f=l.length>1?u.createSubgraph({[F.rank]:"same"}):null;l.forEach((d,p)=>{const m=this.getGraphNode(d.id);m&&(f?.node(m.id),p===0&&(c&&u.edge([c,m],{[F.style]:"invis"}),c=m))}),i=i||!!f})}i&&(e.set(F.newrank,!0),e.set(F.clusterrank,
1832
+ "global"))}addEdge(e,n){const[r,i]=e.dir==="back"?[e.target,e.source]:[e.source,e.target],[s,o,a]=this.edgeEndpoint(r,R=>Qu(R)),[u,c,l]=this.edgeEndpoint(i,Zo),f=e.parent,d=this.graphology.getEdgeAttributes(e.id),p=n.edge([o,c],{[F.likec4_id]:e.id,[F.style]:e.line??Qv});l&&p.attributes.set(F.lhead,l),a&&p.attributes.set(F.ltail,a);const m=Tn(l)||Tn(a);!this.graphology.hasDirectedEdge(e.target,e.source)&&d.weight>1&&p.attributes.set(F.weight,d.weight);const v=PA(e);if(v&&p.attributes.set(m?F.xlabel:
1833
+ F.label,v),e.color){const R=this.getRelationshipColorValues(e.color);p.attributes.apply({[F.color]:R.lineColor,[F.fontcolor]:R.labelColor})}let[w,y]=[e.head??ws,e.tail??"none"];if(e.dir==="back")return p.attributes.apply({[F.arrowtail]:gn(w),[F.dir]:"back"}),y!=="none"&&p.attributes.apply({[F.arrowhead]:gn(y),[F.dir]:"both",[F.minlen]:0}),p;if(w==="none"&&y==="none")return p.attributes.apply({[F.arrowtail]:"none",[F.arrowhead]:"none",[F.dir]:"none",[F.minlen]:0,[F.constraint]:!1}),p;if(w!=="none"&&
1834
+ y!=="none")return p.attributes.apply({[F.arrowhead]:gn(w),[F.arrowtail]:gn(y),[F.dir]:"both",[F.minlen]:0}),p;if(w!==ws&&p.attributes.set(F.arrowhead,gn(w)),y!=="none"&&p.attributes.set(F.arrowtail,gn(y)),this.view.edges.length===1)return p;let E;return f===null&&s.parent==null&&u.parent==null?E=this.view.edges.filter(R=>{if(R.id===e.id||R.parent!==null||R.source===e.source&&R.target===e.target||R.source===e.target&&R.target===e.source)return!1;const A=this.computedNode(R.source),N=this.computedNode(
1835
+ R.target);return er(A)||er(N)?!1:A.parent==null&&N.parent==null}):E=this.findInternalEdges(f).filter(R=>!(R.id===e.id||R.source===e.source&&R.target===e.target||R.source===e.target&&R.target===e.source)),E.length===0&&(f===null||this.leafElements(f).length<=3)&&p.attributes.set(F.minlen,0),p}}function Fh(t){const[e,n,r,i]=t?t.split(",").map(a=>Vr(+a)):[0,0,0,0],s=Math.round(r-e),o=Math.round(n-i);return{x:Math.round(e),y:Math.round(i),width:s,height:o}}function D6(t){try{const[e,n]=t.split(",");
1836
+ return{x:Vr(parseFloat(e)),y:Vr(parseFloat(n))}}catch(e){throw new Error(`Failed on parsing pos: ${t}`,{cause:e})}}function rS(t){const{x:e,y:n}=D6(t.pos),r=CA(parseFloat(t.width)),i=CA(parseFloat(t.height));return{x:e-Math.round(r/2),y:n-Math.round(i/2),width:r,height:i}}function iS(t,[e,n]=[0,0]){if(!t||t.length===0)return null;let r=1/0,i=1/0,s=-1/0,o=-1/0,a=13;try{for(const c of t){if(c.op==="F"){a=Vr(c.size);continue}if(c.op==="T"){let l=Vr(c.pt[0])-e,f=Vr(c.width);switch(c.align){case"r":l-=
1837
+ f;break;case"c":l-=Math.round(f/2);break}r=Math.min(r,l),s=Math.max(s,l+f);let d=Vr(c.pt[1])-n;i=Math.min(i,Math.round(d-a)),o=Math.max(o,d)}}}catch(c){return bn.warn(`Failed on parsing label draw ops:
1838
+ {labelDrawOps}`,{e:c,labelDrawOps:t}),null}if(r===1/0)return null;const u=2;return{x:r-u,y:i-u,width:s-r+2*u,height:o-i+2*u}}function sS({_draw_:t,likec4_id:e="???"},n="<unknown view>"){try{const r=t.filter(s=>s.op.toLowerCase()==="b");_e(cr(r,1),`view ${n} edge ${e} should have at least one bezier draw op`),r.length>1&&bn.warn(`view ${n} edge ${e} has more than one bezier draw op, using the first one only`);const i=r[0].points.map(s=>Vr(s));return _e(cr(i,2),`view ${n} edge ${e} should have at \
1839
+ least two points`),i}catch(r){throw new Error(`failed on parsing view ${n} edge ${e} _draw_:
1840
+ ${JSON.stringify(t,null,2)}`,{cause:r})}}function R6(t,{id:e,source:n,target:r,dir:i,label:s,description:o,...a},u){const c=iS(t._ldraw_??t._tldraw_??t._hldraw_),l=t.dir==="back"||i==="back";return s=s&&c?SA(s,{maxchars:xh,maxLines:_A}).join(`
1841
+ `):null,{id:e,source:n,target:r,label:s,...ce(o)&&{description:o},...ce(t.pos)&&{dotpos:t.pos},points:sS(t,u),labelBBox:c,...l?{dir:"back"}:{},...a}}function oS(t,e){const n=Fh(t.bb),{nodes:r,edges:i,manualLayout:s,...o}=e,a={...o,bounds:n,nodes:[],edges:[]},u=t.objects??[];for(const l of r){const f=u.find(d=>d.likec4_id===l.id);_e(f,`View ${o.id} node ${l.id} not found in graphviz output`);try{const{x:d,y:p,width:m,height:v}="bb"in f?Fh(f.bb):rS(f),w=[d,p];a.nodes.push({...l,position:w,width:m,
1842
+ height:v,labelBBox:iS(f._ldraw_,w)??{x:d,y:p,width:m,height:v}})}catch(d){throw new Error(`Failed on parsing node ${l.id}:
1843
+ ${JSON.stringify(f,null,2)}`,{cause:d})}}const c=t.edges??[];for(const l of i){const f=c.find(d=>d.likec4_id===l.id);if(!f){bn.warn`View ${o.id} edge ${l.id} not found in graphviz output, skipping`;continue}a.edges.push(R6(f,l,o.id))}return a}const Lh=t=>String(t+1).padStart(2,"0");function k6(t){const e=Fh(t.bb),n={nodes:[],edges:[],bounds:e},r=new Map,i=t.objects??[];for(const s of i){if(!s.likec4_type)continue;const o=Lh(s._gvid),a=s.likec4_path??"",u=r.get(s._gvid),{x:c,y:l,width:f,height:d}="\
1844
+ bb"in s?Fh(s.bb):rS(s),p={x:c,y:l};if(s.likec4_type==="view")_e(s.likec4_id,`View ${s} has no likec4_id`),n.nodes.push({id:o,type:"view",parentId:u?.id??null,height:d,width:f,position:p,label:s.label??"",viewId:s.likec4_id});else{const m={id:o,type:s.likec4_type,parentId:u?.id??null,height:d,width:f,position:p,path:a,label:s.label??""},v=[..."subgraphs"in s?s.subgraphs:[],..."nodes"in s?s.nodes:[]];for(const w of v)r.set(w,m);n.nodes.push(m)}}for(const s of t.edges??[])try{const o=Lh(s.tail),a=Lh(
1845
+ s.head);n.edges.push({id:`link${Lh(s._gvid)}`,source:o,target:a,points:sS(s)})}catch(o){bn.warn(`Failed on parsing edge:
1846
+ {edge}`,{error:o,edge:s})}return n}const aS=Jt.font,Mh="/";class Lw{static toDot(e){return new Lw(e).print()}subgraphs=new Map;graphvizModel;constructor(e){const n=this.graphvizModel=zW.graph({[F.layout]:"osage",[F.pack]:dr(100),[F.packmode]:"array_ltc",[F.pad]:vt(15),[F.fontname]:aS,[F.splines]:"polyline",[F.esep]:"+20"});n.attributes.graph.apply({[F.fontsize]:dr(20),[F.labeljust]:"l",[F.labelloc]:"t"}),n.attributes.node.apply({[F.fontname]:aS,[F.shape]:"rect",[F.width]:vt(400),[F.height]:vt(300),
1847
+ [F.fixedsize]:!0,[F.fontsize]:10}),n.attributes.edge.apply({[F.penwidth]:dr(2)});const r=new Set(e.map(u=>u.relativePath??""));let i=0,s=[...e];const o=r.size>1;o&&s.sort((u,c)=>{const l=u.relativePath?.split(Mh)??[""],f=c.relativePath?.split(Mh)??[""];l.push(u.title??"Untitled"),f.push(c.title??"Untitled");const d=l.length,p=f.length;switch(i=Math.max(i,d,p),!0){case d>p:return-1;case d<p:return 1;default:{for(let m=0;m<d;m++){const v=l[m].localeCompare(f[m]);if(v!==0)return v}return 0}}});const a=new Map;
1848
+ s.forEach((u,c)=>{this.addView(o?u:{...u,relativePath:""},c+i);const l=u.nodes.reduce((f,d)=>(d.navigateTo&&f.add(d.navigateTo),f),new Set);l.size>0&&a.set(u.id,l)});for(const[u,c]of a)for(const l of c)n.edge([u,l])}getParentForPath(e){if(e==="")return this.graphvizModel;const n=e.toLowerCase();let r=this.subgraphs.get(n);if(!r){const i=n.endsWith(".c4")||n.endsWith(".likec4"),s=e.includes(Mh)?e.slice(0,e.lastIndexOf(Mh)):"";r=this.getParentForPath(s).subgraph("cluster"+String(this.subgraphs.size+
1849
+ 1),{[F.likec4_type]:i?"file":"folder",[F.likec4_path]:e,[F.sortv]:this.subgraphs.size,[F.label]:ce(s)?e.slice(s.length+1):e}),this.subgraphs.set(n,r)}return r}addView(e,n=0){return this.getParentForPath(e.relativePath??"").node(e.id,{[F.likec4_type]:"view",[F.likec4_id]:e.id,[F.sortv]:n,[F.label]:e.title||"Untitled"})}print(){return RA(this.graphvizModel,{print:{indentStyle:"space",indentSize:2}})}}const uS=t=>{switch(!0){case Ba.isDynamic(t):return new Fw(t);case Ba.isDeployment(t):return new E6(
1850
+ t);case Ba.isElement(t):return new $6(t);default:qe(t)}},Pa=bn.getChild("graphviz-layouter");class cS{constructor(e){this.graphviz=e}get port(){return this.graphviz}changePort(e){this.graphviz=e}async dotToJson(e){let n;try{n=await this.graphviz.layoutJson(e)}catch(r){throw Pa.error(yr(r)),Pa.error`Failed to convert DOT to JSON:\n${e}`,r}try{return JSON.parse(n)}catch(r){throw Pa.error(yr(r)),Pa.error`Failed to parse JSON:\n${n}\n. Generated from DOT:\n${e}`,r}}async layout(e){try{let n=await this.
1851
+ dot(e);const r=await this.dotToJson(n);let i=oS(r,e);if(e.manualLayout){const s=sW(i,e.manualLayout);if(s.diagram)i=s.diagram;else{if(s.relayout.nodes.length>0){const o=uS(e);if(o.hasEdgesWithCompounds)Pa.warn(`Manual layout for view ${e.id} is ignored, as edges with compounds are not supported`);else{o.applyManualLayout(s.relayout);const a=await this.dotToJson(o.print());i=oS(a,e)}}i.hasLayoutDrift=!0}}return n=n.split(`
1852
+ `).filter(s=>!(s.includes("margin")&&s.includes("50.1"))).join(`
1853
+ `),{dot:n,diagram:i}}catch(n){throw new Error(`Error during layout: ${e.id}`,{cause:n})}}async svg(e){let n=await this.dot(e);return n=n.split(`
1854
+ `).filter(r=>!(r.includes("margin")&&r.includes("50.1"))).join(`
1855
+ `),{svg:await this.graphviz.svg(n),dot:n}}async dot(e){let n=uS(e).print();if(!Ba.isElement(e))return n;try{return await this.graphviz.unflatten(n)}catch(r){return Pa.warn(`Error during unflatten: ${e.id}`,{error:r}),n}}async layoutOverviewGraph(e){if(e.length===0)return Promise.resolve({nodes:[],edges:[],bounds:{x:0,y:0,width:10,height:10}});const n=Lw.toDot(e),r=await this.dotToJson(n);return k6(r)}}class T6{value;next;constructor(e){this.value=e}}class C6{#e;#t;#n;constructor(){this.clear()}enqueue(e){
1856
+ const n=new T6(e);this.#e?(this.#t.next=n,this.#t=n):(this.#e=n,this.#t=n),this.#n++}dequeue(){const e=this.#e;if(e)return this.#e=this.#e.next,this.#n--,e.value}peek(){if(this.#e)return this.#e.value}clear(){this.#e=void 0,this.#t=void 0,this.#n=0}get size(){return this.#n}*[Symbol.iterator](){let e=this.#e;for(;e;)yield e.value,e=e.next}}function lS(t){dS(t);const e=new C6;let n=0;const r=()=>{n<t&&e.size>0&&(e.dequeue()(),n++)},i=()=>{n--,r()},s=async(u,c,l)=>{const f=(async()=>u(...l))();c(f);
1857
+ try{await f}catch{}i()},o=(u,c,l)=>{new Promise(f=>{e.enqueue(f)}).then(s.bind(void 0,u,c,l)),(async()=>(await Promise.resolve(),n<t&&r()))()},a=(u,...c)=>new Promise(l=>{o(u,l,c)});return Object.defineProperties(a,{activeCount:{get:()=>n},pendingCount:{get:()=>e.size},clearQueue:{value(){e.clear()}},concurrency:{get:()=>t,set(u){dS(u),t=u,queueMicrotask(()=>{for(;n<t&&e.size>0;)r()})}}}),a}function dS(t){if(!((Number.isInteger(t)||t===Number.POSITIVE_INFINITY)&&t>0))throw new TypeError("Expecte\
1858
+ d `concurrency` to be a number from 1 and up")}const A6=lS(1);class Fa{static _graphviz=null;graphviz(){return Promise.resolve().then(()=>Fa._graphviz??=Xh.load())}async attempt(e,n,r){return await A6(async()=>{const i=bn.getChild("graphviz-wasm");try{return await r()}catch(s){i.error("FAILED GraphvizWasm. {logMessage}",{error:s,logMessage:e}),i.warn("FAILED DOT:"),i.warn(n),Xh.unload(),Fa._graphviz=null}i.warn("Retrying..."),await $_(50,300);try{return await r()}finally{Xh.unload(),Fa._graphviz=
1859
+ null}})}async unflatten(e){return await this.attempt("unflatten",e,async()=>(await this.graphviz()).unflatten(e,1,!1,3).replaceAll(/\t\[/g," [").replaceAll(/\t/g," "))}async acyclic(e){return await this.attempt("acyclic",e,async()=>{const n=(await this.graphviz()).acyclic(e,!0);return n.acyclic&&n.outFile||e})}async layoutJson(e){return await this.attempt("layout",e,async()=>(await this.graphviz()).layout(e,"json",void 0,{yInvert:!0}))}async svg(e){return await this.attempt("svg",e,async()=>(await this.
1860
+ graphviz()).layout(e,"svg"))}}const vd=Symbol.for("idattr"),Bh={writeId(t,e){return t[vd]=e,t},readId(t){return t[vd]}},qh={writeId(t,e){return Rt(e)?t[vd]=void 0:t[vd]=e,t},readId(t){return t[vd]}};function bo(t){return t.textDocument.languageId===wv.languageId}function fS({value:t}){const e=parseFloat(t);return isNaN(e)?100:jR(e,{min:0,max:100})}function xa({value:t}){switch(t){case"xs":case"sm":case"md":case"lg":case"xl":return t;case"xsmall":return"xs";case"small":return"sm";case"medium":return"\
1861
+ md";case"large":return"lg";case"xlarge":return"xl";default:qe(t)}}function S6(t,e){const n={};if(!t||t.length===0)return n;for(const r of t)if(e(r))switch(!0){case ao(r):{const i=wd(r);ce(i)&&(n.color=i);break}case gl(r):{n.line=r.value;break}case zc(r):{switch(r.key){case"head":{n.head=r.value;break}case"tail":{n.tail=r.value;break}default:qe(r)}break}default:qe(r)}return n}function tw(t,e){const{color:n,line:r,head:i,tail:s}=S6(t?.filter(ZT),e);return{...n&&n!==Ma?{color:n}:{},...r&&r!==D_?{line:r}:
1862
+ {},...i&&i!==ws?{head:i}:{},...s?{tail:s}:{}}}function wd(t){return t?.themeColor??t?.customColor?.$refText}function nw(t){const e=t.rankSep,n=t.nodeSep;let r;switch(t.direction){case"TopBottom":{r="TB";break}case"BottomTop":{r="BT";break}case"LeftRight":{r="LR";break}case"RightLeft":{r="RL";break}default:qe(t.direction)}return{direction:r,...n&&{nodeSep:n},...e&&{rankSep:e}}}function _6(t){switch(t){case"TB":return"TopBottom";case"BT":return"BottomTop";case"LR":return"LeftRight";case"RL":return"\
1863
+ RightLeft";default:qe(t)}}function jh(t){return Wn(t,e=>zl(e)||ia(e)||lC(e))}const rw=t=>wC(t)||Up(t)||rv(t)||tv(t)||uC(t)||ev(t),iw=t=>bC(t)||Xy(t)||sC(t)||mC(t)||iC(t);function P6(t){for(;;){if(iw(t)||rw(t))return!1;if(sv(t)||bl(t))return!0;if(t.$container)t=t.$container;else return!1}}function x6(t){for(;;){if(iw(t))return!1;if(rw(t))return!0;if(t.$container)t=t.$container;else return!1}}function N6(t){for(;;){if(rw(t))return!1;if(iw(t))return!0;if(t.$container)t=t.$container;else return!1}}class I6{parser;locator;constructor(e){
1864
+ this.parser=e.likec4.ModelParser,this.locator=e.likec4.ModelLocator}getDocumentation(e){try{if(qn(e)){const n=at(e),r=this.parser.forDocument(n).parseDeploymentNode(e),i=[r.id];return r.title!==e.name&&i.push(" ",`**${r.title}**`),i.join(`
1865
+ `)}if(Qn(e)){const n=at(e),r=this.parser.forDocument(n).parseDeployedInstance(e),[i,s]=wn.isImportRef(r.element)?[r.element.project,r.element.model]:[n.likec4ProjectId,r.element.model],o=i?this.locator.getParsedElement(s,i):this.locator.getParsedElement(s),a=[r.id,`_instance of_ ${r.element}`];return o&&a.push(" ",`**${o.title}**`),a.join(`
1866
+ `)}if(hn(e)){const n=at(e),r=this.parser.forDocument(n).parseElement(e);return r?[r.id," ",`**${r.title}**`].join(`
1867
+ `):void 0}}catch(n){Re(n)}}}function O6(t,e){return[t,e]=sw(t,e)>0?[e,t]:[t,e],F6(t.range,e.range.start)}function sw(t,e){const n=t.range.start.line-e.range.start.line;return n!==0?n:t.range.start.character-e.range.start.character}function F6(t,e){return!(e.line<t.start.line||e.line>t.end.line||e.line==t.start.line&&e.character<t.start.character||e.line==t.end.line&&e.character>t.end.character)}function pS(t){return t.range.start.line!=t.range.end.line}const ee={newLine:Ji.newLine({allowMore:!0}),
1868
+ oneSpace:Ji.oneSpace(),noSpace:Ji.noSpace(),indent:Ji.indent({allowMore:!0}),noIndent:Ji.noIndent()};class L6 extends _G{format(e){this.removeIndentFromTopLevelStatements(e),this.indentContentInBraces(e),this.formatSpecificationRule(e),this.formatGlobals(e),this.formatElementDeclaration(e),this.formatRelation(e),this.formatMetadataProperty(e),this.formatDeploymentNodeDeclaration(e),this.formatDeployedInstance(e),this.formatDeploymentRelation(e),this.formatView(e),this.formatViewRuleGroup(e),this.
1869
+ formatViewRuleGlobalStyle(e),this.formatViewRuleGlobalPredicate(e),this.formatIncludeExcludeExpressions(e),this.formatWhereExpression(e),this.formatWhereRelationExpression(e),this.formatWhereElementExpression(e),this.formatRelationExpression(e),this.formatAutolayoutProperty(e),this.formatWithPredicate(e),this.formatViewRuleStyle(e),this.formatLeafProperty(e),this.formatLinkProperty(e),this.formatNavigateToProperty(e),this.formatTags(e)}formatTags(e){this.on(e,hv,(n,r)=>{r.cst(Io(n.$cstNode,"valu\
1870
+ es").slice(1)).prepend(ee.oneSpace),r.keywords(",").prepend(ee.noSpace).append(ee.oneSpace)})}formatDeploymentRelation(e){this.on(e,Ci,(n,r)=>{const i=n?.source?.$cstNode?[n?.source?.$cstNode]:[];r.cst(i).append(ee.oneSpace),r.keywords("]->").prepend(ee.noSpace),r.keywords("-[").append(ee.noSpace),r.nodes(...ze([n.target,n.tags],ce)).prepend(ee.oneSpace),r.properties("title","technology").prepend(ee.oneSpace)})}formatRelation(e){this.on(e,n=>_i(n)||Ci(n),(n,r)=>{const i=n?.source?.$cstNode?[n?.source?.
1871
+ $cstNode]:[];r.cst(i).append(ee.oneSpace),r.keywords("]->").prepend(ee.noSpace),r.keywords("-[").append(ee.noSpace),r.nodes(...ze([n.target,n.tags],ce)).prepend(ee.oneSpace),r.properties("title","technology").prepend(ee.oneSpace)}),this.on(e,Zy,(n,r)=>{r.keywords("->","<-").surround(ee.oneSpace);const i=r.property("kind");i.nodes[0]?.text.startsWith(".")&&i.surround(ee.oneSpace),r.keywords("]->").prepend(ee.noSpace).append(ee.oneSpace),r.keywords("-[").prepend(ee.oneSpace).append(ee.noSpace),r.properties(
1872
+ "title").prepend(ee.oneSpace)})}removeIndentFromTopLevelStatements(e){vC(e.$container)&&this.getNodeFormatter(e).keywords("specification","model","views","likec4lib","global","deployments","import").prepend(ee.noIndent)}indentContentInBraces(e){if(b8(e)||RC(e)||ba(e)||$a(e)||va(e)||sv(e)||fa(e)||fo(e)||ll(e)||cl(e)||fo(e)||wC(e)||Up(e)||rv(e)||D8(e)||dh(e)||$8(e)||bl(e)||tv(e)||uC(e)||Xy(e)||ka(e)||wh(e)||f8(e)||p8(e)||oa(e)||Jy(e)||bC(e)||sC(e)||m8(e)||iC(e)){const n=this.getNodeFormatter(e),r=n.
1873
+ keywords("{"),i=n.keywords("}"),s=n.interior(r,i);let o=null;for(const a of s.nodes)(!o||!O6(o,a))&&n.cst([a]).prepend(ee.indent),o=a;r.prepend(ee.noIndent).prepend(ee.oneSpace),i.prepend(ee.noIndent).prepend(Ji.newLine({allowMore:!0}))}}appendKeywordsWithSpace(e){this.on(e,dC)?.keywords("element").append(ee.oneSpace)}formatView(e){this.on(e,zp,(n,r)=>{(n.extends||n.viewOf||n.name)&&r.keywords("view").append(ee.oneSpace),r.keywords("of","extends").surround(ee.oneSpace)}),this.on(e,aC)?.keywords(
1874
+ "dynamic","view").append(ee.oneSpace),this.on(e,oC)?.keywords("deployment","view").append(ee.oneSpace)}formatLeafProperty(e){if(nl(e)||xl(e)||k8(e)||ga(e)||fv(e)||DC(e)||ao(e)||gl(e)||zc(e)||Zi(e)||fh(e)||Pp(e)||uh(e)||av(e)||dv(e)||uv(e)||mv(e)){const n=this.getNodeFormatter(e),r=n.keyword(":"),i=n.keywords("title","description","technology","notation","color","line","head","tail","icon","shape","border","opacity","multiple","size","padding","textSize");r.nodes.length===0?i.append(ee.oneSpace):
1875
+ r.prepend(ee.noSpace).append(ee.oneSpace),n.keyword(";").prepend(ee.noSpace).append(ee.newLine)}}formatLinkProperty(e){this.on(e,sh,(n,r)=>{r.keyword("link").append(ee.oneSpace),r.property("value").append(ee.oneSpace),r.keyword(":").prepend(ee.noSpace).append(ee.oneSpace),r.keyword(";").prepend(ee.noSpace).append(ee.newLine)})}formatNavigateToProperty(e){this.on(e,ah)?.property("key").append(ee.oneSpace)}formatAutolayoutProperty(e){this.on(e,ql,(n,r)=>{r.keyword("autoLayout").append(ee.oneSpace),
1876
+ r.property("rankSep").prepend(ee.oneSpace),r.property("nodeSep").prepend(ee.oneSpace)})}formatMetadataProperty(e){this.on(e,E8,(n,r)=>{r.property("key").append(ee.oneSpace),r.keyword(":").prepend(ee.noSpace).append(ee.oneSpace),r.keyword(";").prepend(ee.noSpace).append(ee.newLine)})}formatElementDeclaration(e){this.on(e,hn,(n,r)=>{const i=pn(n.$cstNode,"kind"),s=pn(n.$cstNode,"name");s&&i&&(sw(s,i)>0?r.cst([i]).append(ee.oneSpace):(r.cst([s]).append(ee.oneSpace),r.cst([i]).prepend(ee.oneSpace))),
1877
+ r.properties("props").prepend(ee.oneSpace)})}formatGlobals(e){this.on(e,fa,(n,r)=>{r.keyword("style").append(ee.oneSpace),r.property("id").append(ee.oneSpace)}),this.on(e,fo,(n,r)=>{r.keyword("styleGroup").append(ee.oneSpace)}),this.on(e,ll,(n,r)=>{r.keyword("predicateGroup").append(ee.oneSpace)}),this.on(e,cl,(n,r)=>{r.keyword("dynamicPredicateGroup").append(ee.oneSpace)})}formatSpecificationRule(e){if((ba(e)||$a(e)||mh(e)||va(e))&&this.getNodeFormatter(e).keywords("element","relationship","tag",
1878
+ "deploymentNode").append(ee.oneSpace),hh(e)){const n=this.getNodeFormatter(e);n.keyword("color").append(ee.oneSpace),n.property("name").append(ee.oneSpace)}}formatWithPredicate(e){(Jp(e)||lv(e))&&this.getNodeFormatter(e).keyword("with").prepend(ee.oneSpace)}formatDeploymentNodeDeclaration(e){this.on(e,qn,(n,r)=>{const i=pn(n.$cstNode,"kind"),s=pn(n.$cstNode,"name");s&&i&&(sw(s,i)>0?r.cst([i]).append(ee.oneSpace):(r.cst([s]).append(ee.oneSpace),r.cst([i]).prepend(ee.oneSpace))),r.properties("titl\
1879
+ e").prepend(ee.oneSpace)})}formatDeployedInstance(e){this.on(e,Qn,(n,r)=>{const i=n.$cstNode?.content.find(s=>s.text==="=");i&&r.cst([i]).surround(ee.oneSpace),r.keyword("instanceOf").append(ee.oneSpace),r.property("title").prepend(ee.oneSpace)})}formatViewRuleGlobalStyle(e){this.on(e,vv,(n,r)=>{r.keywords("global","style").append(ee.oneSpace)})}formatViewRuleGlobalPredicate(e){const n=this.getNodeFormatter(e);(yv(e)||cC(e))&&n.keywords("global","predicate").append(ee.oneSpace)}formatViewRuleGroup(e){
1880
+ this.on(e,wh,(n,r)=>{r.keyword("group").append(ee.oneSpace)})}formatViewRuleStyle(e){this.on(e,ka)?.keyword("style").append(ee.oneSpace),this.on(e,Yy)?.keyword("style").append(ee.oneSpace),this.on(e,hC)?.keyword(",").prepend(ee.noSpace).append(ee.oneSpace),this.on(e,y8)?.keyword(",").prepend(ee.noSpace).append(ee.oneSpace)}formatWhereExpression(e){(cv(e)||iv(e))&&this.getNodeFormatter(e).keyword("where").append(ee.oneSpace)}formatWhereRelationExpression(e){if(this.on(e,l8,(n,r)=>{r.property("ope\
1881
+ rator").surround(ee.oneSpace)}),this.on(e,SC,(n,r)=>{r.keyword("not").append(ee.oneSpace)}),rC(e)||S8(e)||AC(e)){const n=this.getNodeFormatter(e);n.property("operator").surround(ee.oneSpace),n.property("not").surround(ee.oneSpace)}}formatWhereElementExpression(e){if(this.on(e,u8,(n,r)=>{r.property("operator").surround(ee.oneSpace)}),this.on(e,CC,(n,r)=>{r.keyword("not").append(ee.oneSpace)}),tC(e)||A8(e)||C8(e)){const n=this.getNodeFormatter(e);n.property("operator").surround(ee.oneSpace),n.property(
1882
+ "not").surround(ee.oneSpace)}}formatIncludeExcludeExpressions(e){if(qy(e)||zl(e)||ia(e)){const n=this.getNodeFormatter(e);(!e.$cstNode||!pS(e.$cstNode))&&n.keywords("include","exclude").append(ee.oneSpace)}if(hC(e)){const n=this.getNodeFormatter(e),r=this.findPredicateExpressionRoot(e),i=r?.$cstNode&&pS(r?.$cstNode);i&&n.property("value").prepend(ee.indent),n.keyword(",").prepend(ee.noSpace).append(i?ee.newLine:ee.oneSpace)}}formatRelationExpression(e){this.on(e,v8,(n,r)=>{r.keyword("->").append(
1883
+ ee.oneSpace)}),this.on(e,yC,(n,r)=>{r.keyword("->").prepend(ee.oneSpace)}),this.on(e,$C,(n,r)=>{r.keywords("->","<->").prepend(ee.oneSpace),r.keywords("-[").prepend(ee.oneSpace).append(ee.noSpace),r.keywords("]->").prepend(ee.noSpace).append(ee.oneSpace);const i=r.property("kind");i.nodes[0]?.text.startsWith(".")&&i.surround(ee.oneSpace)}),this.on(e,g8,(n,r)=>{r.property("target").prepend(ee.oneSpace)})}findPredicateExpressionRoot(e){let n=e.$container;for(;;){if(!n||qy(n)||zl(n)||ia(n))return n;
1884
+ n=n.$container}}on(e,n,r){const i=n(e)?this.getNodeFormatter(e):void 0;return r&&i&&r(e,i),i}}class M6 extends lR{constructor(e){super(e),this.services=e}createDescription(e,n,r){const i=r??at(e),s=super.createDescription(e,n,r);return i.likec4ProjectId??=this.services.shared.workspace.ProjectsManager.belongsTo(i.uri),s.likec4ProjectId=i.likec4ProjectId,s}}var Bt=Ks();class B6 extends dR{constructor(e){super(e),this.services=e}async updateContent(e,n=Bt.CancellationToken.None){const r=this.services.
1885
+ workspace.ProjectsManager;e.likec4ProjectId=r.belongsTo(e.uri),await super.updateContent(e,n)}projectElements(e,n,r){const i=this.services.workspace.ProjectsManager;return Xe(this.symbolIndex.keys()).filter(s=>i.belongsTo(s)===e&&(!r||r.has(s))).flatMap(s=>this.getFileDescriptions(s,n))}}class q6 extends nR{constructor(e){super(e),this.services=e}get allExcludingBuiltin(){const e=this.services.workspace.ProjectsManager;return super.all.filter(n=>!bo(n)||id(n.uri)?!1:(n.likec4ProjectId??=e.belongsTo(
1886
+ n.uri),!0))}projectDocuments(e){return this.allExcludingBuiltin.filter(n=>n.likec4ProjectId===e)}groupedByProject(){return Qo(this.allExcludingBuiltin.toArray(),fi("likec4ProjectId"))}}class j6 extends fR{constructor(e){super(e),this.services=e,this.documentFactory=e.workspace.LangiumDocumentFactory}documentFactory;async loadAdditionalDocuments(e,n){const r=this.services.workspace.ProjectsManager;for(const i of e)try{const s=await this.fileSystemProvider.readDirectory(yt.parse(i.uri));for(const o of s)
1887
+ try{await r.loadConfigFile(o)}catch(a){sd(a)}}catch(s){sd(s)}n(this.documentFactory.fromString(OC,yt.parse(O8))),await super.loadAdditionalDocuments(e,n)}includeEntry(e,n,r){return this.services.workspace.ProjectsManager.isConfigFile(n)?!1:n.isFile?!this.services.workspace.ProjectsManager.checkIfExcluded(n.uri):super.includeEntry(e,n,r)}workspace(){return this.folders&&R_(this.folders,1)?this.folders[0]:null}get workspaceUri(){const e=this.workspace();return _e(e,"Workspace not initialized"),yt.
1888
+ parse(e.uri)}get workspaceURL(){const e=this.workspace();return _e(e,"Workspace not initialized"),new URL(e.uri)}}const G6=st.getChild("LikeC4LanguageServices");class U6{constructor(e){this.services=e,this.views=e.likec4.Views,this.builder=e.likec4.ModelBuilder,this.projectsManager=e.shared.workspace.ProjectsManager}views;builder;projectsManager;get workspaceUri(){return this.services.shared.workspace.WorkspaceManager.workspaceUri}projects(){const e=this.services.shared.workspace.ProjectsManager,
1889
+ n=He(this.services.shared.workspace.LangiumDocuments.groupedByProject(),ec(),xt(([s,o])=>{const a=s,{folder:u,config:c}=e.getProject(a);return{id:a,folder:u,config:c,documents:xt(o,fi("uri"))}}));if(cr(n,1))return n;const{folder:r,config:i}=e.getProject(jn.DefaultProjectId);return[{id:jn.DefaultProjectId,folder:r,config:i,documents:null}]}async diagrams(){return await this.views.diagrams()}async computedModel(e){const n=this.projectsManager.ensureProjectId(e);return await this.builder.buildLikeC4Model(
1890
+ n)}async layoutedModel(e){const n=this.projectsManager.ensureProjectId(e),r=await this.builder.parseModel(n);if(!r)throw new Error("Failed to parse model");const i=await this.views.diagrams(n);return bs.create({...r,__:"layouted",views:Zu(i,fi("id"))})}getErrors(){return this.services.shared.workspace.LangiumDocuments.allExcludingBuiltin.toArray().flatMap(e=>(e.diagnostics??[]).filter(n=>n.severity===Os.Error).map(({message:n,range:r})=>({message:n,line:r.start.line,range:r,sourceFsPath:e.uri.fsPath})))}async notifyUpdate({
1891
+ changed:e,removed:n}){if(!e&&!n)return!1;const r=this.services.shared.workspace.WorkspaceLock;try{let i=!1;return await r.write(async s=>{await this.services.shared.workspace.DocumentBuilder.update(e?[yt.file(e)]:[],n?[yt.file(n)]:[],s),i=!s.isCancellationRequested}),i}catch(i){return G6.error(yr(i)),!1}}}class ow{toDispose=[];isDisposed=!1;onDispose(...e){this.toDispose.push(...e)}dispose(){this.throwIfDisposed(),this.isDisposed=!0;let e;for(;e=this.toDispose.pop();)try{e.dispose()}catch(n){sd(
1892
+ n)}}throwIfDisposed(){if(this.isDisposed)throw new Error("This has already been disposed")}}function Eo(t){let e=pv(t)?t.el.ref:t.modelElement.value.ref;return e?.$type==="Imported"&&(e=e.imported.ref),e?.$type==="Element"?e:void 0}function $o(t){const e=[t.$type==="StrictFqnRef"?t.value.$refText:t.el.$refText];let n=t.parent;for(;n;)e.push(n.$type==="StrictFqnRef"?n.value.$refText:n.el.$refText),n=n.parent;return e.length===1?e[0]:e.reverse().join(".")}function hS(t){for(;t.parent;)t=t.parent;return t.
1893
+ value.ref??null}function W6(t){let e;for(;e=t.value?.ref;){if(qn(e))return null;if(Qn(e))return e;if(Rt(t.parent))return null;t=t.parent}return null}function z6(t){const e=hS(t);return e?.$type==="Imported"?e:null}function H6(t){return hS(t)?.$type==="Element"}function K6(t){let e;for(;e=t.value?.ref;){if(gp(e))return!0;if(Rt(t.parent))return!1;t=t.parent}return!1}function Wt(t){if(Kr(t)){for(;t.$type==="Imported"&&t.$container;)t=t.$container;_e(ov(t))}if(ov(t))return t.project;const e=kt(t)?at(
1894
+ t):t;return It(e.likec4ProjectId,()=>`Invalid state, document ${e.uri} has no project ID assigned`)}function bd(...t){var e=t.length>1?t.join(":::"):t[0];return k_(e)}function mS(t){try{return t()}catch(e){st.debug("Safe call failed",{error:e});return}}class V6{constructor(e){this.services=e}async provideCodeLens(e,n,r){return bo(e)?(e.state<=je.Linked&&(st.debug(`Waiting for document ${e.uri.path} to be Linked`),await this.services.shared.workspace.DocumentBuilder.waitUntil(je.Linked,e.uri,r),st.
1895
+ debug("Document is linked")),e.parseResult.value.views.flatMap(i=>i.views).flatMap(i=>{const s=Bh.readId(i),o=i.$cstNode?.range;if(!o||!s)return[];const a=Wt(i);return{range:{start:o.start,end:{line:o.start.line,character:o.start.character+4}},command:{command:"likec4.open-preview",arguments:[s,a],title:"open preview"}}})):void 0}}const aw=["color","shape","icon","border","opacity","multiple","size","textSize"].join(",");class X6 extends pT{constructor(e){super(e),this.services=e}completionOptions={
1896
+ triggerCharacters:["."]};completionForKeyword(e,n,r){if(this.filterKeyword(e,n))switch(!0){case n.value==="import":r(e,{label:n.value,kind:Ct.Snippet,insertTextFormat:kn.Snippet,insertText:`${n.value} { $0 } from '\${1|${this.services.shared.workspace.ProjectsManager.all.join(",")}|}'`});break;case(n.value==="deployment"&&Mr(e.node,bl)):r(e,{label:n.value,detail:"Insert deployment view",kind:Ct.Class,insertTextFormat:kn.Snippet,insertText:["deployment view ${1:view_${TM_FILENAME_BASE}_${CURRENT_\
1897
+ SECOND}} {"," title '${2:Untitled}'"," "," include $0","}"].join(`
1898
+ `)});break;case["title","description","technology"].includes(n.value):r(e,{label:n.value,kind:Ct.Property,insertTextFormat:kn.Snippet,insertText:`${n.value} '\${0}'`});break;case n.value==="color":r(e,{label:n.value,kind:Ct.Property,insertTextFormat:kn.Snippet,insertText:`${n.value} \${1|${T_.join(",")}|}$0`});break;case n.value==="opacity":r(e,{label:n.value,kind:Ct.Property,insertTextFormat:kn.Snippet,insertText:`${n.value} \${0:100}%`});break;case["views","specification","model","deployment",
1899
+ "with"].includes(n.value):r(e,{label:n.value,detail:`Insert ${n.value} block`,kind:Ct.Module,insertTextFormat:kn.Snippet,insertText:`${n.value} {
1900
+ $0
1901
+ }`});break;case n.value==="group":r(e,{label:n.value,detail:"Insert group block",kind:Ct.Class,insertTextFormat:kn.Snippet,insertText:["group '${1:Title}' {"," $0","}"].join(`
1902
+ `)});break;case(n.value==="dynamic"&&Mr(e.node,bl)):r(e,{label:n.value,detail:"Insert dynamic view",kind:Ct.Class,insertTextFormat:kn.Snippet,insertText:["dynamic view ${1:view_${TM_FILENAME_BASE}_${CURRENT_SECOND}} {"," title '${2:Untitled}'"," "," $0","}"].join(`
1903
+ `)});break;case(n.value==="style"&&e.node&&Mr(e.node,fa)):r(e,{label:n.value,detail:`Insert ${n.value} block`,kind:Ct.Module,insertTextFormat:kn.Snippet,insertText:`${n.value} \${1:name} \${2:*} {
1904
+ \${3|${aw}|} $0
1905
+ }`});break;case(n.value==="style"&&e.node&&Mr(e.node,Z4([bl,fo]))):r(e,{label:n.value,detail:`Insert ${n.value} block`,kind:Ct.Module,insertTextFormat:kn.Snippet,insertText:`${n.value} \${1:*} {
1906
+ \${2|${aw}|} $0
1907
+ }`});break;case n.value==="style":r(e,{label:n.value,detail:`Insert ${n.value} block`,kind:Ct.Module,insertTextFormat:kn.Snippet,insertText:`${n.value} {
1908
+ \${1|${aw}|} $0
1909
+ }`});break;case n.value==="extend":r(e,{label:n.value,detail:"Extend another view",kind:Ct.Class,insertTextFormat:kn.Snippet,insertText:`extend $1 {
1910
+ $0
1911
+ }`});break;case n.value==="autoLayout":r(e,{label:n.value,kind:Ct.Class,insertTextFormat:kn.Snippet,insertText:"autoLayout ${1|TopBottom,BottomTop,LeftRight,RightLeft|}$0"});break;default:r(e,{label:n.value,kind:this.getKeywordCompletionItemKind(n),detail:"Keyword",sortText:"1"})}}}class Y6 extends hT{createDocumentHighlight(e){return ge.DocumentHighlight.create(e.segment.range,ge.DocumentHighlightKind.Read)}}class J6{constructor(e){this.services=e}async getDocumentLinks(e,n,r){return bo(e)?Br(e.
1912
+ parseResult.value).filter(sh).map(i=>{try{const s=pn(i.$cstNode,"value")?.range,o=s&&this.resolveLink(e,i.value);if(o&&rs(o))return{range:s,target:o}}catch(s){Re(s)}return null}).nonNullable().toArray():[]}resolveLink(e,n){if(rs(n)||od(n))return n;if(Ev(n))return bh(e.uri.toString(),"../",n);const r=this.services.shared.workspace.ProjectsManager.getProject(e).folder;return bh(r.toString(),n)}relativeLink(e,n){if(od(n))return jC(n);if(Ev(n)){const r=new URL(e.uri.toString(!0)),i=new URL(n,r).toString();
1913
+ return jC(W8(i,this.services.shared.workspace.WorkspaceManager.workspaceURL.toString()))}return null}}const gS=st.getChild("DocumentSymbolProvider");class Q6{constructor(e){this.services=e,this.nodeKindProvider=e.shared.lsp.NodeKindProvider,this.parser=e.likec4.ModelParser,this.locator=e.likec4.ModelLocator,this.nameProvider=e.references.NameProvider}nodeKindProvider;nameProvider;parser;locator;async getSymbols(e,n,r){if(!bo(e))return[];e.state<=je.Linked&&(gS.debug(`Waiting for document ${e.uri.
1914
+ path} to be Linked`),await this.services.shared.workspace.DocumentBuilder.waitUntil(je.Linked,e.uri,r),gS.debug("document is Linked"));const{parseResult:{value:{specifications:i,models:s,deployments:o,views:a,likec4lib:u}}}=e;return[...u.map(c=>()=>this.getLikec4LibSymbol(c)),...i.map(c=>()=>this.getSpecSymbol(c)),...s.map(c=>()=>this.getModelSymbol(c)),...o.map(c=>()=>this.getDeploymentModelSymbol(c)),...a.map(c=>()=>this.getModelViewsSymbol(c))].flatMap(c=>{try{return c()??[]}catch(l){return Re(
1915
+ l),[]}})}getLikec4LibSymbol(e){const n=e?.$cstNode;if(!n)return[];const r=e.icons.map(i=>this.getLibIconSymbol(i)).filter(ce);return r.length===0?[]:[{kind:Dr.Namespace,name:"icons",range:n.range,selectionRange:Du(n,"icons")?.range??n.range,children:r}]}getSpecSymbol(e){const n=e?.$cstNode;if(!n)return[];const r=pn(n,"name");if(!r)return[];const i=He([...e.elements,...e.tags,...e.relationships],xt(s=>{try{if(ba(s)||$a(s)||va(s))return this.getKindSymbol(s);if(mh(s))return this.getTagSymbol(s)}catch(o){
1916
+ return Re(o),null}qe(s)}),ze(ce));return i.length===0?[]:[{kind:Dr.Namespace,name:e.name,range:n.range,selectionRange:r.range,children:i}]}getModelSymbol(e){const n=e.$cstNode;if(!n)return[];const r=pn(n,"name");return r?[{kind:this.symbolKind(e),name:e.name,range:n.range,selectionRange:r.range,children:e.elements.flatMap(i=>this.getElementsSymbol(i))}]:[]}getDeploymentModelSymbol(e){const n=e.$cstNode;if(!n)return[];const r=pn(n,"name");return r?[{kind:this.symbolKind(e),name:e.name,range:n.range,
1917
+ selectionRange:r.range,children:e.elements.flatMap(i=>this.getDeploymentElementSymbol(i))}]:[]}getElementsSymbol(e){try{if(ua(e))return this.getExtendElementSymbol(e);if(hn(e))return this.getElementSymbol(e)}catch(n){Re(n)}return[]}getExtendElementSymbol(e){const n=e.$cstNode,r=e.element.$cstNode,i=e.body;return!n||!r?[]:[{kind:this.symbolKind(e),name:$o(e.element),range:n.range,selectionRange:r.range,children:i.elements.flatMap(s=>this.getElementsSymbol(s))}]}getElementSymbol(e){const n=e.$cstNode,
1918
+ r=pn(n,"name");if(!r||!n)return[];const i=e.name,s=e.kind.$refText;return[{kind:this.symbolKind(e),name:i,range:n.range,selectionRange:r.range,detail:s,children:e.body?.elements.flatMap(o=>this.getElementsSymbol(o))??[]}]}getModelViewsSymbol(e){const n=e.$cstNode,r=pn(n,"name");return!r||!n?[]:[{kind:this.symbolKind(e),name:e.name,range:n.range,selectionRange:r.range,children:e.views.flatMap(i=>this.getViewSymbol(i))}]}getKindSymbol(e){return!e.$cstNode||!e.kind.$cstNode||Gt(e.kind.name)?null:{kind:this.
1919
+ symbolKind(e),name:e.kind.name,range:e.$cstNode.range,selectionRange:e.kind.$cstNode.range}}getTagSymbol(e){return!e.$cstNode||!e.tag.$cstNode||Gt(e.tag.name)?null:{kind:this.symbolKind(e),name:"#"+e.tag.name,range:e.$cstNode.range,selectionRange:e.tag.$cstNode.range}}getLibIconSymbol(e){return!e.$cstNode||Gt(e.name)?null:{kind:this.symbolKind(e),name:e.name,range:e.$cstNode.range,selectionRange:e.$cstNode.range}}getViewSymbol(e){const n=e?.$cstNode;if(!n)return[];const r=e.name?pn(n,"name"):null;
1920
+ return r?[{kind:this.symbolKind(e),name:r.text,range:n.range,selectionRange:r.range,children:[]}]:[]}getDeploymentElementSymbol(e){try{if(qn(e))return this.getDeploymentNodeSymbol(e);if(Qn(e))return this.getDeployedInstanceSymbol(e);if(co(e))return[]}catch(n){Re(n)}return[]}getDeploymentNodeSymbol(e){const n=e.$cstNode,r=this.nameProvider.getNameNode(e);if(!r||!n)return[];const i=this.nameProvider.getNameStrict(e),s=e.kind.$refText;return[{kind:this.symbolKind(e),name:i,range:n.range,selectionRange:r.
1921
+ range,detail:s,children:e.body?.elements.flatMap(o=>this.getDeploymentElementSymbol(o))??[]}]}getDeployedInstanceSymbol(e){const n=e.$cstNode,r=this.nameProvider.getNameNode(e);if(!r||!n)return[];const i=at(e),s=this.parser.forDocument(i).parseDeployedInstance(e),o=this.nameProvider.getNameStrict(e),a="instance of "+s.element;return[{kind:this.symbolKind(e),name:o,range:n.range,selectionRange:r.range,detail:a,children:[]}]}symbolKind(e){return this.nodeKindProvider.getSymbolKind(e)}}class Z6 extends vT{parser;locator;constructor(e){
1922
+ super(e),this.parser=e.likec4.ModelParser,this.locator=e.likec4.ModelLocator}getAstNodeHoverContent(e){if(TC(e))return{contents:{kind:"markdown",value:"tag `"+e.name+"`"}};if(qn(e)){const n=at(e),r=this.parser.forDocument(n).parseDeploymentNode(e),i=[r.id+" "];return r.title!==e.name&&i.push(`### ${r.title}`),i.push("deployment node `"+r.kind+"` "),{contents:{kind:"markdown",value:i.join(`
1923
+ `)}}}if(Qn(e)){const n=at(e),r=this.parser.forDocument(n).parseDeployedInstance(e),[i,s]=wn.isImportRef(r.element)?[r.element.project,r.element.model]:[n.likec4ProjectId,r.element.model],o=i?this.locator.getParsedElement(s,i):this.locator.getParsedElement(s),a=[r.id+" ",`instance of \`${r.element}\``];return o&&a.push(`### ${o.title}`,"element kind `"+o.kind+"` "),{contents:{kind:"markdown",value:a.join(`
1924
+ `)}}}if(dC(e))return{contents:{kind:"markdown",value:"element kind `"+e.name+"`"}};if(h8(e))return{contents:{kind:"markdown",value:"deployment node `"+e.name+"`"}};if(hn(e)){const n=this.locator.getParsedElement(e);return n?{contents:{kind:"markdown",value:[n.id,`### ${n.title}`,"element kind `"+n.kind+"` "].join(`
1925
+ `)}}:void 0}}}class eH extends wG{highlightElement(e,n){if(hn(e)||qn(e)||Qn(e))return this.highlightNameAndKind(e,n);if(Wy(e))return this.highlightView(e,n);if(R8(e))return n({node:e,property:"name",type:Be.function});if(w8(e))return n({node:e,property:"name",type:Be.type,modifier:[We.definition]}),"prune";if((_i(e)||$C(e)&&"kind"in e)&&n({node:e,property:"kind",type:Be.function}),ah(e)||_l(e))return n({node:e,property:"key",type:Be.property}),n({node:e,property:"value",type:Be.variable,modifier:[
1926
+ We.definition,We.readonly]}),"prune";if(Zp(e)||xC(e))return n({cst:e.$cstNode,type:Be.variable,modifier:[We.definition,We.readonly]}),Zp(e)&&e.selector&&n({node:e,property:"selector",type:Be.variable,modifier:[We.definition,We.readonly]}),"prune";if(AC(e)&&ce(e.value)){n({node:e,property:"value",type:Be.function});return}if((tC(e)||rC(e))&&ce(e.value)){n({node:e,property:"value",type:Be.type,modifier:[We.definition,We.readonly]});return}if((_C(e)||PC(e))&&n({node:e,property:"participant",type:Be.
1927
+ keyword}),fC(e)&&ce(e.kind))return n({node:e,property:"kind",type:Be.type,modifier:[We.definition]}),"prune";if(fo(e)||fa(e)){n({node:e,property:"id",type:Be.variable,modifier:[We.definition,We.readonly]});return}if(vv(e)){n({node:e,property:"style",type:Be.variable,modifier:[We.definition,We.readonly]});return}if(ll(e)||cl(e)){n({node:e,property:"name",type:Be.variable,modifier:[We.definition,We.readonly]});return}if(yv(e)){n({node:e,property:"predicate",type:Be.variable,modifier:[We.definition,
1928
+ We.readonly]});return}if(pC(e)&&ce(e.tag))return n({node:e,property:"tag",type:Be.type,modifier:[We.definition]}),"prune";if(gC(e)||kC(e))return n({node:e,property:"value",type:Be.variable,modifier:[We.definition,We.readonly]}),e.parent?void 0:"prune";if(pv(e))return n({node:e,property:"el",type:Be.variable,modifier:[We.definition,We.readonly]}),e.parent?void 0:"prune";if(Kr(e))return n({node:e,property:"imported",type:Be.variable,modifier:[We.definition,We.readonly]}),"prune";if(hh(e)){n({node:e,
1929
+ keyword:"color",type:Be.keyword}),n({node:e,property:"name",type:Be.type,modifier:[We.declaration,We.readonly]});return}if((ba(e)||$a(e)||va(e))&&n({node:e,property:"kind",type:Be.type,modifier:[We.declaration,We.readonly]}),hv(e))return n({node:e,property:"values",type:Be.interface}),"prune";if(TC(e))return n({node:e,property:"name",type:Be.type,modifier:[We.definition]});if((dh(e)||oa(e))&&n({node:e,property:"key",type:Be.property}),uh(e))return n({node:e,property:"key",type:Be.property}),n({node:e,
1930
+ property:"value",type:Be.number}),"prune";if(sh(e)||Zi(e)||eC(e))return n({node:e,property:"key",type:Be.property}),Zi(e)&&(e.libicon||e.value==="none")?(n({node:e,property:e.libicon?"libicon":"value",type:Be.enum,modifier:[We.defaultLibrary]}),"prune"):("value"in e&&e.value&&n({node:e,property:"value",type:Be.string}),"prune");if(ao(e)||fh(e)||zc(e)||gl(e)||Pp(e)||s8(e))return n({node:e,property:"key",type:Be.property}),"value"in e&&n({node:e,property:"value",type:Be.enum}),"prune"}highlightNameAndKind(e,n){
1931
+ if(n({node:e,property:"name",type:Be.function,modifier:[We.declaration,We.readonly]}),Qn(e)||n({node:e,property:"kind",type:Be.keyword,modifier:[]}),hn(e)){e.props.length>0&&n({node:e,property:"props",type:Be.string});return}e.title&&n({node:e,property:"title",type:Be.string})}highlightView(e,n){e.name&&n({node:e,property:"name",type:Be.interface,modifier:[We.declaration,We.readonly,"local"]})}}class yS extends ow{constructor(e,n="fqn-index"){super(),this.services=e,this.cachePrefix=n,this.langiumDocuments=
1932
+ e.shared.workspace.LangiumDocuments,this.projects=e.shared.workspace.ProjectsManager,this.documentCache=new Qw(r=>this.createDocumentIndex(r)),this.workspaceCache=new np(e.shared,je.IndexedContent),this.onDispose(e.shared.workspace.DocumentBuilder.onDocumentPhase(je.IndexedContent,r=>{bo(r)&&this.documentCache.set(r,this.createDocumentIndex(r))}))}projects;langiumDocuments;documentCache;workspaceCache;documents(e){return this.langiumDocuments.projectDocuments(e).filter(n=>bo(n)&&n.state>=je.IndexedContent)}get(e){
1933
+ return e.state<je.IndexedContent&&Re(`Document ${e.uri.path} is not indexed`),this.documentCache.get(e)}resolve(e){return e.$type==="Imported"?this.getFqn(e.imported.ref):e.$type==="Element"?this.getFqn(e):this.services.likec4.DeploymentsIndex.getFqn(e)}getFqn(e){_e(hn(e)||gp(e));let n=qh.readId(e);if(ce(n))return n;const r=at(e);return _e(bo(r)),Re(`Document ${r.uri.path} is not indexed, but getFqn was called`),this.get(r),It(qh.readId(e),"Element fqn must be set, invalid state")}byFqn(e,n){return Xe(
1934
+ this.workspaceCache.get(`${this.cachePrefix}:${e}:fqn:${n}`,()=>this.documents(e).toArray().flatMap(r=>this.get(r).byFqn(n))))}rootElements(e){return Xe(this.workspaceCache.get(`${this.cachePrefix}:${e}:rootElements`,()=>{const n=this.documents(e).reduce((r,i)=>(this.get(i).rootElements().forEach(s=>{r.set(s.name,s)}),r),new xn);return uw(n).sort((r,i)=>Yh(r.name,i.name))}))}directChildrenOf(e,n){return Xe(this.workspaceCache.get(`${this.cachePrefix}:${e}:directChildrenOf:${n}`,()=>{const r=this.
1935
+ documents(e).reduce((i,s)=>(this.get(s).children(n).forEach(o=>{i.set(o.name,o)}),i),new xn);return uw(r).sort((i,s)=>Yh(i.name,s.name))}))}uniqueDescedants(e,n){return Xe(this.workspaceCache.get(`${this.cachePrefix}:${e}:uniqueDescedants:${n}`,()=>{const{children:r,descendants:i}=this.documents(e).reduce((a,u)=>{const c=this.get(u);return c.children(n).forEach(l=>{a.children.set(l.name,l)}),c.descendants(n).forEach(l=>{a.descendants.set(l.name,l)}),a},{children:new xn,descendants:new xn}),s=uw(
1936
+ r).sort((a,u)=>Yh(a.name,u.name)),o=[...i.associations()].flatMap(([a,u])=>u.length===1&&!r.has(a)?u:[]);return[...s,...G_(o)]}))}createDocumentIndex(e){const n=e.parseResult.value.models.flatMap(f=>f.elements);if(n.length===0)return Ia.EMPTY;const r=e.likec4ProjectId??=this.projects.belongsTo(e),i=new Array,s=new xn,o=new xn,a=new xn,u=this.services.workspace.AstNodeDescriptionProvider,c=(f,d,p)=>{const m={...u.createDescription(f,d,e),id:p,likec4ProjectId:r};return qh.writeId(f,p),a.set(p,m),m},
1937
+ l=(f,d)=>{let p;if(hn(f)){p=B_(f.name,d);const v=c(f,f.name,p);d?s.set(d,v):i.push(v)}else p=$o(f.element);let m=[];if(cn(f.body)&&!Gt(f.body.elements)){for(const v of f.body.elements)if(!_i(v))try{m.push(...l(v,p))}catch(w){Re(w)}}m=[...s.get(p)??[],...m];for(const v of m)o.set(p,v);if(ua(f))for(const v of U_(p))for(const w of m)o.set(v,w);return o.get(p)??[]};for(const f of n)try{if(_i(f))continue;l(f,null)}catch(d){Re(d)}return new Ia(i,s,o,a,r)}}function uw(t){return[...t.associations()].flatMap(
1938
+ ([e,n])=>n.length===1?n:[])}class Ia{constructor(e,n,r,i,s){this._rootElements=e,this._children=n,this._descendants=r,this._byfqn=i,this.projectId=s}static EMPTY=new Ia([],new xn,new xn,new xn,jn.DefaultProjectId);rootElements(){return this._rootElements}byFqn(e){return this._byfqn.get(e)??[]}children(e){return this._children.get(e)??[]}descendants(e){return this._descendants.get(e)??[]}}class tH extends yS{constructor(e){super(e,"deployments-index"),this.services=e,this.Names=e.references.NameProvider}Names;createDocumentIndex(e){
1939
+ const n=e.parseResult.value.deployments.flatMap(d=>d.elements);if(n.length===0)return Ia.EMPTY;const r=e.likec4ProjectId??=this.projects.belongsTo(e),i=new Array,s=new xn,o=new xn,a=new xn,u=this.Names,c=this.services.workspace.AstNodeDescriptionProvider,l=(d,p,m)=>{const v={...c.createDescription(d,p,e),id:m,likec4ProjectId:r};return qh.writeId(d,m),a.set(m,v),v},f=(d,p)=>{let m;if(co(d))m=$o(d.deploymentNode);else{const w=u.getName(d);if(!ce(w))return[];m=C_(w,p);const y=l(d,w,m);if(p?s.set(p,
1940
+ y):i.push(y),Qn(d))return[]}let v=[];if(cn(d.body)){for(const w of d.body.elements)if(!Ci(w))try{v.push(...f(w,m))}catch(y){Re(y)}}v=[...s.get(m)??[],...v];for(const w of v)o.set(m,w);if(co(d))for(const w of A_(m))for(const y of v)o.set(w,y);return o.get(m)??[]};for(const d of n)try{if(Ci(d))continue;f(d,null)}catch(p){Re(p)}return new Ia(i,s,o,a,r)}}const vS=t=>Number.isFinite(t)?t:0;function nH(t){return{days:Math.trunc(t/864e5),hours:Math.trunc(t/36e5%24),minutes:Math.trunc(t/6e4%60),seconds:Math.
1941
+ trunc(t/1e3%60),milliseconds:Math.trunc(t%1e3),microseconds:Math.trunc(vS(t*1e3)%1e3),nanoseconds:Math.trunc(vS(t*1e6)%1e3)}}function rH(t){return{days:t/86400000n,hours:t/3600000n%24n,minutes:t/60000n%60n,seconds:t/1000n%60n,milliseconds:t%1000n,microseconds:0n,nanoseconds:0n}}function iH(t){switch(typeof t){case"number":{if(Number.isFinite(t))return nH(t);break}case"bigint":return rH(t)}throw new TypeError("Expected a finite number or bigint")}const sH=t=>t===0||t===0n,oH=(t,e)=>e===1||e===1n?
1942
+ t:`${t}s`,aH=1e-7,uH=24n*60n*60n*1000n;function Gh(t,e){const n=typeof t=="bigint";if(!n&&!Number.isFinite(t))throw new TypeError("Expected a finite number or bigint");e={...e};const r=t<0?"-":"";t=t<0?-t:t,e.colonNotation&&(e.compact=!1,e.formatSubMilliseconds=!1,e.separateMilliseconds=!1,e.verbose=!1),e.compact&&(e.unitCount=1,e.secondsDecimalDigits=0,e.millisecondsDecimalDigits=0);let i=[];const s=(l,f)=>{const d=Math.floor(l*10**f+aH);return(Math.round(d)/10**f).toFixed(f)},o=(l,f,d,p)=>{if(!((i.
1943
+ length===0||!e.colonNotation)&&sH(l)&&!(e.colonNotation&&d==="m"))){if(p??=String(l),e.colonNotation){const m=p.includes(".")?p.split(".")[0].length:p.length,v=i.length>0?2:1;p="0".repeat(Math.max(0,v-m))+p}else p+=e.verbose?" "+oH(f,l):d;i.push(p)}},a=iH(t),u=BigInt(a.days);if(e.hideYearAndDays?o(BigInt(u)*24n+BigInt(a.hours),"hour","h"):(e.hideYear?o(u,"day","d"):(o(u/365n,"year","y"),o(u%365n,"day","d")),o(Number(a.hours),"hour","h")),o(Number(a.minutes),"minute","m"),!e.hideSeconds)if(e.separateMilliseconds||
1944
+ e.formatSubMilliseconds||!e.colonNotation&&t<1e3){const l=Number(a.seconds),f=Number(a.milliseconds),d=Number(a.microseconds),p=Number(a.nanoseconds);if(o(l,"second","s"),e.formatSubMilliseconds)o(f,"millisecond","ms"),o(d,"microsecond","\xB5s"),o(p,"nanosecond","ns");else{const m=f+d/1e3+p/1e6,v=typeof e.millisecondsDecimalDigits=="number"?e.millisecondsDecimalDigits:0,w=m>=1?Math.round(m):Math.ceil(m),y=v?m.toFixed(v):w;o(Number.parseFloat(y),"millisecond","ms",y)}}else{const l=(n?Number(t%uH):
1945
+ t)/1e3%60,f=typeof e.secondsDecimalDigits=="number"?e.secondsDecimalDigits:1,d=s(l,f),p=e.keepDecimalsOnWholeSeconds?d:d.replace(/\.0+$/,"");o(Number.parseFloat(p),"second","s",p)}if(i.length===0)return r+"0"+(e.verbose?" milliseconds":"ms");const c=e.colonNotation?":":" ";return typeof e.unitCount=="number"&&(i=i.slice(0,Math.max(e.unitCount,1))),r+i.join(c)}function cH(t){const e=new Map;for(const n of t)if(Ba.isElement(n)&&n.viewOf&&Rt(n.extends)){const r=e.get(n.viewOf)??[];r.push(n.id),e.set(
1946
+ n.viewOf,r)}for(const{id:n,nodes:r}of t)for(const i of r){const s=Ad.modelRef(i);if(i.navigateTo||!s)continue;const o=MR(e.get(s)??[],a=>a!==n);o&&(i.navigateTo=o)}return t}function lH(t,e="/"){const n=He(t,xt(u=>u.docUri),ze(ce),Yo());if(n.length===0)return"";if(n.length===1){const u=Ta(n[0]).pathname.split(e);return u.length<=1?e:(u.pop(),u.join(e)+e)}_e(cr(n,2),"Expected at least 2 unique URIs");const[r,...i]=n,s=Ta(r).pathname.split(e);let o=s.length;for(const u of i){if(u===r)continue;const c=Ta(
1947
+ u).pathname.split(e);for(let l=0;l<o;l++)c[l]!==s[l]&&(o=l);if(o===0)return""}const a=s.slice(0,o).join(e);return a.endsWith(e)?a:a+e}function dH(t){const e="/",n=lH(t,e);return t.map(r=>{if(!r.docUri)return{view:r,parts:[]};let i=Ta(r.docUri).pathname;return n.length>0?(_e(i.startsWith(n),`Expect path "${i}" to start with common prefix: "${n}"`),i=i.slice(n.length)):i=i.includes(e)?i.slice(i.lastIndexOf(e)+1):i,{view:r,parts:i.split(e)}}).sort((r,i)=>{if(r.parts.length!==i.parts.length)return r.
1948
+ parts.length-i.parts.length;for(let s=0;s<r.parts.length;s++){const o=Gw(r.parts[s],i.parts[s]);if(o!==0)return o}return Gw(r.view.title??r.view.id,i.view.title??i.view.id)}).map(({parts:r,view:i})=>({...i,relativePath:r.join(e)}))}class wS{mergedData=new Map;merge(e){for(const n of e){const{id:r,links:i,tags:s,metadata:o}=n,a=this.mergedData.get(r)??{links:[],tags:[],metadata:{}};i&&a.links.push(...i),s&&(a.tags=Yo([...a.tags,...s])),o&&(a.metadata={...a.metadata,...o}),this.mergedData.set(r,a)}}apply(e){
1949
+ const n=this.mergedData.get(e.id);if(!n)return e;let r=n.links;e.links&&e.links.length>0&&(r=[...e.links,...r]);let i=n.tags;e.tags&&e.tags.length>0&&(i=Yo([...e.tags,...i]));let s=n.metadata;return e.metadata&&(s={...e.metadata,...n.metadata}),{...e,tags:cr(i,1)?i:null,links:cr(r,1)?r:null,...!Gt(s)&&{metadata:s}}}}class fH{specs={tags:new Set,elements:{},deployments:{},relationships:{},colors:{}};globals={predicates:{},dynamicPredicates:{},styles:{}};imports=new S_(Set);constructor(e){for(const n of e){
1950
+ const{c4Specification:r,c4Globals:i,c4Imports:s}=n;r.tags.forEach(o=>this.specs.tags.add(o)),Object.assign(this.specs.elements,r.elements),Object.assign(this.specs.relationships,r.relationships),Object.assign(this.specs.colors,r.colors),Object.assign(this.specs.deployments,r.deployments),Object.assign(this.globals.predicates,i.predicates),Object.assign(this.globals.dynamicPredicates,i.dynamicPredicates),Object.assign(this.globals.styles,i.styles);for(const[o,a]of s)this.imports.set(o,a)}}toModelElement=({
1951
+ tags:e,links:n,style:{color:r,shape:i,icon:s,opacity:o,border:a,size:u,multiple:c,padding:l,textSize:f},id:d,kind:p,title:m,description:v,technology:w,metadata:y})=>{try{const E=this.specs.elements[p];return E?(r??=E.style.color,i??=E.style.shape,s??=E.style.icon,o??=E.style.opacity,a??=E.style.border,w??=E.technology,c??=E.style.multiple,u??=E.style.size,l??=E.style.padding,f??=E.style.textSize,{...r&&{color:r},...i&&{shape:i},...s&&{icon:s},...y&&!Gt(y)&&{metadata:y},...E.notation&&{notation:E.
1952
+ notation},style:{...a&&{border:a},...u&&{size:u},...l&&{padding:l},...f&&{textSize:f},...yy(c)&&{multiple:c},...up(o)&&{opacity:o}},links:n??null,tags:e??null,technology:w??null,description:v??null,title:m,kind:p,id:d}):(st.warn`No kind '${p}' found for ${d}`,null)}catch(E){Re(E)}return null};toModelRelation=({astPath:e,source:n,target:r,kind:i,links:s,id:o,...a})=>{const u=Es.toModelFqn(r),c=Es.toModelFqn(n);return Tn(i)&&this.specs.relationships[i]?{...this.specs.relationships[i],...a,...s&&{links:s},
1953
+ source:c,target:u,kind:i,id:o}:{...s&&{links:s},...a,source:c,target:u,id:o}};toDeploymentElement=e=>{if("element"in e&&!("kind"in e))return{...e,element:Es.toModelFqn(e.element)};if("element"in e)return null;try{const n=this.specs.deployments[e.kind];if(!n)return st.warn`No kind ${e.kind} found for ${e.id}`,null;let{technology:r=n.technology,notation:i=n.notation,style:s}=e;return{...e,...i&&{notation:i},...r&&{technology:r},style:{border:"dashed",opacity:10,...n.style,...s}}}catch(n){Re(n)}return null};toDeploymentRelation=({
1954
+ astPath:e,source:n,target:r,kind:i,links:s,id:o,...a})=>Tn(i)&&this.specs.relationships[i]?{...this.specs.relationships[i],...a,...s&&{links:s},source:n,target:r,kind:i,id:o}:{...s&&{links:s},...a,source:n,target:r,id:o}}function pH(t){const e=new fH(t),n=Jo(e.specs.colors,d=>__(d.color)),r=new wS,i=new wS,s=He(t,Hr(d=>(r.merge(d.c4ExtendElements),xt(d.c4Elements,e.toModelElement))),ze(ce),Uw,my((d,p)=>{const m=zw(p.id);return m&&Rt(d[m])?(st.debug`No parent found for ${p.id}`,d):(d[p.id]=r.apply(
1955
+ p),d)},{})),o=He(t,Hr(d=>xt(d.c4Relations,e.toModelRelation)),ze(d=>d?Rt(s[d.source])&&!Ww(d.source)||Rt(s[d.target])&&!Ww(d.target)?(st.debug`Invalid relation ${d.id}
1956
+ source: ${d.source} resolved: ${!!s[d.source]}
1957
+ target: ${d.target} resolved: ${!!s[d.target]}\n`,!1):!0:!1),Zu(fi("id"))),a=He(t,Hr(d=>(i.merge(d.c4ExtendDeployments),xt(d.c4Deployments,e.toDeploymentElement))),ze(ce),Uw,my((d,p)=>{const m=zw(p.id);return m&&Rt(d[m])?(st.debug`No parent found for deployment element ${p.id}`,d):(d[p.id]=P_.isDeploymentNode(p)?i.apply(p):p,d)},{})),u=He(t,Hr(d=>xt(d.c4DeploymentRelations,e.toDeploymentRelation)),ze(d=>d?Rt(a[d.source.id])||Rt(a[d.target.id])?(st.debug`Invalid deployment relation ${d.id}
1958
+ source: ${d.source.id} resolved: ${!!a[d.source.id]}
1959
+ target: ${d.target.id} resolved: ${!!a[d.target.id]}\n`,!1):!0:!1),my((d,p)=>cn(d[p.id])?(st.debug`Duplicate deployment relation ${p.id}`,d):(d[p.id]=p,d),{}));function c(d){const p=d.uri.toString();return m=>{let{id:v,title:w,description:y,astPath:E,...R}=m;return m.__==="element"&&Rt(w)&&"viewOf"in m&&(w=s[m.viewOf]?.title??null),Rt(w)&&v==="index"&&(w="Landscape view"),{...R,customColorDefinitions:n,docUri:p,description:y,title:w,id:v}}}const l=He(t,Hr(d=>xt(d.c4Views,c(d))),dH);l.some(d=>d.
1960
+ id==="index")||l.unshift({__:"element",id:"index",title:"Landscape view",description:null,tags:null,links:null,customColorDefinitions:n,rules:[{include:[{wildcard:!0}]}]});const f=He(l,Zu(fi("id")),j_);return{data:{specification:{tags:Array.from(e.specs.tags),elements:e.specs.elements,relationships:e.specs.relationships,deployments:e.specs.deployments},elements:s,relations:o,globals:e.globals,views:f,deployments:{elements:a,relations:u},imports:{}},imports:e.imports}}const hH=t=>`parsed-without-\
1961
+ imports-${t}`,bS=t=>`parsed-model-${t}`,ES=t=>`computed-model-${t}`,cs=st.getChild("ModelBuilder");class mH extends ow{projects;parser;listeners=[];cache;DocumentBuilder;mutex;constructor(e){super(),this.projects=e.shared.workspace.ProjectsManager,this.parser=e.likec4.ModelParser,this.cache=e.ValidatedWorkspaceCache,this.DocumentBuilder=e.shared.workspace.DocumentBuilder,this.mutex=e.shared.workspace.WorkspaceLock,this.onDispose(this.DocumentBuilder.onUpdate((n,r)=>{r.length>0&&this.notifyListeners(
1962
+ r)})),this.onDispose(this.DocumentBuilder.onBuildPhase(je.Validated,(n,r)=>{const i=n.map(fi("uri")).filter(A4(id));i.length>0&&this.notifyListeners(i)})),cs.debug`created`}unsafeSyncParseModelData(e){const n=this.cache,r=cs.getChild(["project",e]),i=hH(e);return n.has(i)&&r.debug`unsafeSyncBuildModelData from cache, project ${e}`,n.get(i,()=>{try{const s=this.documents(e);return s.length===0?(cs.debug`no documents to build model, project ${e}`,null):(r.debug`unsafeSyncBuildModelData, project ${e}`,
1963
+ pH(s))}catch(s){return Re(s),null}})}unsafeSyncJoinedModelData(e){const n=this.cache,r=bS(e);return n.get(r,()=>{const i=this.unsafeSyncParseModelData(e);if(!i)return null;if(i.imports.size>0){cs.debug`processing imports of ${e}`;const s=[...i.imports.associations()].reduce((o,[a,u])=>{const c=this.unsafeSyncParseModelData(a);if(c){const l=He([...u],Hr(f=>c.data.elements[f]??[]));cr(l,1)&&(o[a]=l)}return o},{});return{...i.data,imports:s}}return i.data})}async parseModel(e,n=Bt.CancellationToken.
1964
+ None){const r=this.projects.ensureProjectId(e),i=cs.getChild(["project",r]),s=this.cache.get(bS(r));if(s)return i.debug`parseModel from cache, project ${r}`,s;const o=performance.now();return await this.mutex.read(async()=>{await jt(n);const a=this.unsafeSyncJoinedModelData(r);return i.debug(`parseModel, project ${r} in ${Gh(performance.now()-o)}`),a})}previousViews={};unsafeSyncBuildModel(e){const n=this.cache,r=this.cache;return n.get(ES(e),()=>{const i=this.unsafeSyncJoinedModelData(e);if(!i)
1965
+ return bs.EMPTY;const{views:s,...o}=i,a=bs.makeCompute(i),u=[];for(const l of ap(s)){const f=a(l);if(!f.isSuccess){cs.warn(yr(f.error));continue}u.push(f.view)}cH(u);const c=zr(u,l=>{const f=$S(e,l.id),d=this.previousViews[f],p=d&&xv(l,d)?d:l;return r.set(f,p),[l.id,p]});return this.previousViews={...this.previousViews,...c},bs.create({...o,views:c})})}async buildLikeC4Model(e,n=Bt.CancellationToken.None){const r=this.projects.ensureProjectId(e),i=cs.getChild(["project",r]),s=this.cache.get(ES(r));
1966
+ if(s)return i.debug("buildLikeC4Model from cache"),s;const o=performance.now();return await this.mutex.read(async()=>{await jt(n);const a=this.unsafeSyncBuildModel(r);return i.debug(`buildLikeC4Model in ${Gh(performance.now()-o)}`),a})}async computeView(e,n,r=Bt.CancellationToken.None){const i=this.projects.ensureProjectId(n),s=cs.getChild(["project",i]),o=this.cache,a=$S(i,e);if(o.has(a))return o.get(a);const u=await this.parseModel(i,r);return u?o.get(a,()=>{const c=u.views[e];if(!c)return s.warn`computeView: cant find view ${e}`,
1967
+ null;s.debug`computeView: ${e}`;const l=bs.makeCompute(u)(c);if(!l.isSuccess)return Re(l.error),null;let f=l.view;const d=He(u.views,ap(),ze(x_),ze(m=>m.id!==e),Qo(m=>m.viewOf));for(const m of f.nodes)if(!m.navigateTo){const v=d[m.id];v&&(m.navigateTo=v[0].id)}const p=this.previousViews[a];return p&&xv(f,p)?f=p:this.previousViews[a]=f,f}):null}onModelParsed(e){return this.listeners.push(e),Gs.create(()=>{const n=this.listeners.indexOf(e);n>=0&&this.listeners.splice(n,1)})}documents(e){return this.
1968
+ parser.documents(e).toArray()}notifyListeners(e){for(const n of this.listeners)try{n(e)}catch(r){Re(r)}}}function $S(t,e){return`computed-view-${t}-${e}`}const{findNodeForKeyword:gH,findNodeForProperty:Uh}=Gm,{getDocument:yH}=xo;class vH{constructor(e){this.services=e,this.fqnIndex=e.likec4.FqnIndex,this.deploymentsIndex=e.likec4.DeploymentsIndex,this.langiumDocuments=e.shared.workspace.LangiumDocuments,this.parser=e.likec4.ModelParser,this.projects=e.shared.workspace.ProjectsManager}fqnIndex;deploymentsIndex;langiumDocuments;parser;projects;documents(e){
1969
+ return this.parser.documents(e)}getParsedElement(...e){let n,r;if(e.length===2?(n=e[0],r=e[1]):(n=e[0],r=gy(n)?this.projects.ensureProjectId():Wt(n)),gy(n)){const s=n,o=this.fqnIndex.byFqn(r,n).head();if(!o)return null;const a=this.langiumDocuments.getDocument(o.documentUri);return a?this.parser.parse(a).c4Elements.find(u=>u.id===s)??null:null}const i=this.fqnIndex.getFqn(n);return this.parser.parse(yH(n)).c4Elements.find(s=>s.id===i)??null}locateElement(e,n){let[r,i]=Hw(e);r??=this.projects.ensureProjectId(
1970
+ n);const s=this.fqnIndex.byFqn(r,i).head(),o=s?.nameSegment??s?.selectionSegment;return!s||!o?null:{uri:s.documentUri.toString(),range:o.range}}locateDeploymentElement(e,n){let[r,i]=Hw(e);r??=this.projects.ensureProjectId(n);const s=this.deploymentsIndex.byFqn(r,i).head(),o=s?.nameSegment??s?.selectionSegment;return!s||!o?null:{uri:s.documentUri.toString(),range:o.range}}locateRelation(e,n){const r=this.projects.ensureProjectId(n);for(const i of this.documents(r)){const s=i.c4Relations.find(u=>u.
1971
+ id===e)??i.c4DeploymentRelations.find(u=>u.id===e);if(!s)continue;const o=this.services.workspace.AstNodeLocator.getAstNode(i.parseResult.value,s.astPath);if(!_i(o)&&!Ci(o))continue;let a=o.title?Uh(o.$cstNode,"title"):void 0;if(a??=o.kind?Uh(o.$cstNode,"kind"):void 0,a??=Uh(o.$cstNode,"target"),a??=o.$cstNode,!!a)return{uri:i.uri.toString(),range:a.range}}return null}locateViewAst(e,n){const r=this.projects.ensureProjectId(n);for(const i of this.documents(r)){const s=i.c4Views.find(a=>a.id===e);
1972
+ if(!s)continue;const o=this.services.workspace.AstNodeLocator.getAstNode(i.parseResult.value,s.astPath);if(Wy(o))return{doc:i,view:s,viewAst:o}}return null}locateView(e,n){const r=this.locateViewAst(e,n);if(!r)return null;const i=r.viewAst;let s=i.name?Uh(i.$cstNode,"name"):void 0;return s??=gH(i.$cstNode,"view"),s??=i.$cstNode,s?{uri:r.doc.uri.toString(),range:s.range}:null}}var cw,DS;function wH(){return DS||(DS=1,cw=t=>{const e=t.match(/^[ \t]*(?=\S)/gm);return e?e.reduce((n,r)=>Math.min(n,r.
1973
+ length),1/0):0}),cw}var bH=wH();const EH=Jr(bH);function RS(t){const e=EH(t);if(e===0)return t;const n=new RegExp(`^[ \\t]{${e}}`,"gm");return t.replace(n,"")}const Do=["this","it","self","super","likec4lib","global"];function lt(t){return async function(e,n,r){try{const i=t(e,n,r);C4(i)&&await i;return}catch(i){const s=i instanceof Error?i.message:String(i);n("error",`Validation failed: ${s}`,{node:e}),st.debug(`Validation failed: ${s}`,{error:i})}}}const{getDocument:$H}=xo,DH=t=>{const e=t.likec4.
1974
+ DeploymentsIndex,n=t.references.NameProvider;return lt((r,i)=>{const s=n.getName(r);if(!s){i("error","DeploymentNode must be named",{node:r});return}const o=It(n.getNameNode(r),"name CstNode not found").range;Do.includes(s)&&i("error",`Reserved word: ${s}`,{node:r,range:o});const a=Wt(r),u=e.getFqn(r);e.byFqn(a,u).limit(2).toArray().length>1&&i("error",`Duplicate node name "${u}"`,{node:r,range:o})})},RH=t=>{const e=t.likec4.DeploymentsIndex,n=t.references.NameProvider;return lt((r,i)=>{const s=n.
1975
+ getName(r);if(!s){i("error","Deployed instance must be named, unique inside node",{node:r});return}const o=It(n.getNameNode(r),"name CstNode not found").range;Do.includes(s)&&i("error",`Reserved word: ${s}`,{node:r,range:o});const a=Wt(r),u=e.getFqn(r);e.byFqn(a,u).limit(2).toArray().length>1&&i("error",`Duplicate instance name "${u}"`,{node:r,range:o})})},kH=t=>{const e=t.likec4.ModelParser;return lt((n,r)=>{if(!n.target?.value?.ref){let u=n.target?.$cstNode?.text??"";r("error",`DeploymentRelat\
1976
+ ion target '${u}' not resolved`,{node:n,property:"target"});return}const i=$H(n),s=e.forDocument(i);let o;try{o=s._resolveDeploymentRelationSource(n)}catch{r("error","DeploymentRelation source not resolved",{node:n,property:"source"});return}if(wn.isImportRef(o)){r("error","DeploymentRelation cannot refer imported model (not implemented yet)",{node:n,property:"source"});return}if(wn.isModelRef(o)){r("error","DeploymentRelation must refer deployment element",{node:n,property:"source"});return}const a=s.
1977
+ parseFqnRef(n.target);if(wn.isImportRef(a)){r("error","DeploymentRelation cannot refer imported model (not implemented yet)",{node:n,property:"target"});return}if(wn.isModelRef(a)){r("error","DeploymentRelation must refer deployment element",{node:n,property:"target"});return}Kw(o.deployment,a.deployment)&&r("error","Invalid parent-child relationship",{node:n})})},TH=t=>lt((e,n)=>{const r=e.deploymentNode.value.ref;(!r||!qn(r))&&n("error","ExtendDeployment allows only DeploymentNode",{node:e,property:"\
1978
+ deploymentNode"})}),CH=t=>{const e=t.likec4.FqnIndex;return lt((n,r)=>{const i=Eo(n.source),s=i&&e.getFqn(i);s||r("error","Source not found (not parsed/indexed yet)",{node:n,property:"source"});const o=Eo(n.target),a=o&&e.getFqn(o);a||r("error","Target not found (not parsed/indexed yet)",{node:n,property:"target"}),s&&a&&(Kh(s,a)||Kh(a,s))&&r("error","Invalid parent-child relationship",{node:n})})},{getDocument:AH}=xo,SH=t=>{const e=t.likec4.FqnIndex,n=t.workspace.AstNodeLocator;return lt((r,i)=>{
1979
+ const s=e.getFqn(r);if(!s){i("error","Not indexed element",{node:r,property:"name"});return}Do.includes(r.name)&&i("error",`Reserved word: ${r.name}`,{node:r,property:"name"});const o=AH(r),a=o.uri,u=n.getAstNodePath(r),c=e.byFqn(Wt(o),s).filter(l=>l.documentUri!==a||l.path!==u).head();if(c){const l=c.documentUri!==a;i("error",`Duplicate element name ${r.name!==s?r.name+" ("+s+")":r.name}`,{node:r,property:"name",...l&&{relatedInformation:[{location:{range:c.nameSegment?.range??c.selectionSegment?.
1980
+ range,uri:c.documentUri.toString()},message:"conflicting element"}]}})}})},_H=t=>lt((e,n)=>{K6(e.modelElement)&&n("error","Only model elements allowed here",{node:e,property:"modelElement"})}),{getDocument:PH}=xo,xH=t=>{const e=t.shared.workspace.ProjectsManager;return lt((n,r)=>{const i=PH(n),s=Wt(i);if(n.project===s){r("error","Imported project cannot be the same as the current project",{node:n,property:"project"});return}if(!e.all.includes(n.project)){r("error","Imported project not found",{node:n,
1981
+ property:"project"});return}})},NH=t=>(t.likec4.FqnIndex,lt((e,n)=>{})),IH=t=>lt((e,n)=>{const r=parseFloat(e.value);(isNaN(r)||r<0||r>100)&&n("warning","Value ignored, must be between 0% and 100%",{node:e,property:"value"})}),OH=t=>(e,n)=>{const r=e.$container;r.props.some(i=>Zi(i)&&i!==e)&&n("error","Icon must be defined once",{node:e}),oa(r)&&Up(r.$container)&&r.$container.props.some(i=>Zi(i))&&n("warning","Redundant as icon defined on element",{node:e})},FH=t=>(e,n)=>{Mr(e,Zy)||n("error","No\
1982
+ tes can be defined only inside dynamic view",{node:e})},LH=t=>{const e=t.likec4.ModelParser;return lt((n,r)=>{const i=e.forDocument(at(n)),s=mS(()=>i._resolveRelationSource(n));if(!s){r("error","Source not resolved",{node:n,property:"source"});return}const o=mS(()=>i.parseFqnRef(n.target));if(!o){r("error","Target not resolved",{node:n,property:"target"});return}wn.isImportRef(s)&&(wn.isImportRef(o)?r("warning","Relationship between imported elements may not be visible in origin projects",{node:n}):
1983
+ r("warning","Relationship from imported element to local element may not be visible in origin project",{node:n,property:"source"})),Kw(wn.toModelFqn(s),wn.toModelFqn(o))&&r("error","Invalid parent-child relationship",{node:n})})},MH=t=>lt((e,n)=>{e.$container.tags?.values&&e.tags?.values&&n("error","Relation cannot have tags in both header and body",{node:e.tags})}),BH=t=>lt((e,n)=>{e.$containerIndex&&e.$containerIndex>0&&n("warning","Prefer one specification per document",{node:e,property:"name"})}),
1984
+ qH=t=>lt((e,n)=>{e.$containerIndex&&e.$containerIndex>0&&n("warning","Prefer one model per document",{node:e,property:"name"})}),jH=t=>lt((e,n)=>{e.$containerIndex&&e.$containerIndex>0&&n("warning","Prefer one global block per document",{node:e,property:"name"})}),GH=t=>{const e=t.shared.workspace.IndexManager;return lt((n,r)=>{Do.includes(n.name)&&r("error",`Reserved word: ${n.name}`,{node:n,property:"name"});const i=Wt(n),s=e.projectElements(i,Ai).filter(o=>o.name===n.name&&o.node!==n).head();
1985
+ if(s){const o=s.documentUri!==at(n).uri;r("error",`Duplicate element kind '${n.name}'`,{node:n,property:"name",...o&&{relatedInformation:[{location:{range:s.nameSegment.range,uri:s.documentUri.toString()},message:"conflicting definition"}]}})}})},UH=t=>{const e=t.shared.workspace.IndexManager;return lt((n,r)=>{Do.includes(n.name)&&r("error",`Reserved word: ${n.name}`,{node:n,property:"name"});const i=Wt(n),s=e.projectElements(i,Ti).filter(o=>o.name===n.name&&o.node!==n).head();if(s){const o=s.documentUri!==
1986
+ at(n).uri;r("error",`Duplicate deploymentNode kind '${n.name}'`,{node:n,property:"name",...o&&{relatedInformation:[{location:{range:s.nameSegment.range,uri:s.documentUri.toString()},message:"conflicting definition"}]}})}})},WH=t=>{const e=t.shared.workspace.IndexManager;return lt((n,r)=>{const i="#"+n.name,s=Wt(n),o=e.projectElements(s,ns).filter(a=>a.name===i&&a.node!==n).head();if(o){const a=o.documentUri!==at(n).uri;r("error",`Duplicate tag '${n.name}'`,{node:n,property:"name",...a&&{relatedInformation:[
1987
+ {location:{range:o.nameSegment.range,uri:o.documentUri.toString()},message:"conflicting definition"}]}})}})},zH=t=>{const e=t.shared.workspace.IndexManager;return lt((n,r)=>{Do.includes(n.name)&&r("error",`Reserved word: ${n.name}`,{node:n,property:"name"});const i=Wt(n);e.projectElements(i,ts).filter(s=>s.name===n.name).limit(2).count()>1&&r("error",`Duplicate RelationshipKind '${n.name}'`,{node:n,property:"name"})})},kS=t=>{const e=t.shared.workspace.IndexManager;return lt((n,r)=>{const i=Wt(n),
1988
+ s=e.projectElements(i,la),o=e.projectElements(i,ca);s.concat(o).filter(a=>a.name===n.name).limit(2).count()>1&&r("error",`Duplicate GlobalPredicateGroup or GlobalDynamicPredicateGroup name '${n.name}'`,{node:n,property:"name"})})},HH=t=>{const e=t.shared.workspace.IndexManager;return lt((n,r)=>{const i=Wt(n);e.projectElements(i,dl).filter(s=>s.name===n.name).limit(2).count()>1&&r("error",`Duplicate GlobalStyleId name '${n.name}'`,{node:n,property:"name"})})},KH=t=>{const e=t.shared.workspace.IndexManager;
1989
+ return lt((n,r)=>{if(!n.name)return;Do.includes(n.name)&&r("error",`Reserved word: ${n.name}`,{node:n,property:"name"});const i=Wt(n);e.projectElements(i,oo).filter(s=>s.name===n.name).limit(2).count()>1&&r("error",`Duplicate view '${n.name}'`,{node:n,property:"name"})})},VH=t=>{const e=t.likec4.ModelParser;return lt((n,r)=>{const i=jh(n);if(i?.$type!=="DynamicViewIncludePredicate"&&i?.isInclude!==!0){r("error",'Invalid usage inside "exclude"',{node:n});return}const s=i.$type==="DynamicViewInclu\
1990
+ dePredicate",o=e.forDocument(at(i));let a=rn.unwrap(o.parseFqnExprWith(n).custom.expr);switch(!0){case(rn.isWildcard(a)&&s):case(rn.isElementKindExpr(a)&&s):case(rn.isElementTagExpr(a)&&s):{r("warning","Predicate is ignored, as not supported in dynamic views",{node:n});return}case rn.isWildcard(a):case rn.isModelRef(a):case rn.isDeploymentRef(a):return;case rn.isElementKindExpr(a):case rn.isElementTagExpr(a):r("error","Invalid target (expect reference to specific element)",{node:n,property:"subj\
1991
+ ect"});return;default:qe(a)}})},XH=t=>{const e=t.likec4.ModelParser;return lt((n,r)=>{const i=e.forDocument(at(n)).parseFqnRefExpr(n),s=jh(n),o=N6(n)&&!Mr(n,a=>Yy(a)||ka(a));if(s?.$type==="DeploymentViewRulePredicate"||o){if(!Mr(n,Dp)){if(rn.isModelRef(i)){r("error","Deployment view predicate must reference deployment model",{node:n});return}if(rn.isDeploymentRef(i)&&wn.isInsideInstanceRef(i.ref)){r("error","Must reference deployment nodes or instances, but not internals",{node:n});return}}ce(n.
1992
+ selector)&&!qn(n.ref.value?.ref)&&r("warning",`Selector '${n.selector}' applies to deployment nodes only, ignored here`,{node:n,property:"selector"});return}if(s?.$type==="DynamicViewIncludePredicate")switch(!0){case rn.isElementKindExpr(i):case rn.isElementTagExpr(i):case rn.isWildcard(i):{r("warning","Predicate is ignored, as not supported in dynamic views",{node:n});return}}})},YH=t=>lt((e,n)=>{if(e.to.$type==="WildcardExpression"&&!yC(e.$container)){const r=Wn(e,zp);Rt(r?.viewOf)&&n("warning",
1993
+ "Predicate is ignored as it concerns all relationships",{node:e})}}),JH=t=>lt((e,n)=>{if(jh(e)?.$type==="ViewRulePredicate"&&e.$container.$type!=="DirectedRelationExpr"&&e.from.$type==="WildcardExpression"){const r=Wn(e,zp);r&&Rt(r.viewOf)&&n("warning","Predicate is ignored as it concerns all relationships",{node:e})}}),QH=t=>{const e=t.likec4.ModelParser;return lt((n,r)=>{const i=Wn(n,ia);if(!i||i.isInclude!==!0)return;const s=at(n),o=e.forDocument(s);let a=Sd.unwrap(o.parseRelationExpr(n));const u="\
1994
+ Model reference is allowed in exclude predicate only";if(Sd.isDirect(a)){(rn.isModelRef(a.source)||rn.isModelRef(a.target))&&r("error",u,{node:n});return}let c;if(Sd.isIncoming(a)?c=a.incoming:Sd.isOutgoing(a)?c=a.outgoing:c=a.inout,rn.isModelRef(c)){r("error",u,{node:n});return}})},ZH=t=>lt((e,n)=>{const r=jh(e);if(!(!r||r.$type=="DynamicViewIncludePredicate")&&!r.isInclude){n("error",'Invalid usage inside "exclude"',{node:e});return}});function e5(t){return e=>t.some(n=>n(e))}const t5=e5([ov,Kr,
1995
+ sv,ll,cl,fa,fo,Jp,lv,YT,Dp,Jy,Zy,e8,ia,n8,Dp,Zp,o8,Ky,hv,a8,qy,Wy,Vy,Qn,qn,Ci,ZT,Qi,_i,t8,eC,ah,hn,ev,ua,co,ba,$a,va,mh,hh,RC]),n5=t=>{let e=t;for(;e&&!vC(e);){if(t5(e))return e;e=e.$container}};function r5(t){const e=t.state>=je.Validated?t.diagnostics?.filter(r=>r.severity===Os.Error)??[]:[],n=new WeakSet;for(const{node:r}of e){if(Rt(r)||n.has(r))continue;n.add(r);const i=n5(r);i&&n.add(i)}return{isValid:r=>!n.has(r),invalidNodes:n}}function i5(t){st.debug("registerValidationChecks"),t.validation.
1996
+ ValidationRegistry.register({DeployedInstance:RH(t),DeploymentNodeKind:UH(t),DeploymentNode:DH(t),DeploymentRelation:kH(t),ExtendDeployment:TH(),FqnRefExpr:XH(t),RelationExpr:QH(t),NotesProperty:FH(),OpacityProperty:IH(),IconProperty:OH(),SpecificationRule:BH(),Model:qH(),Globals:jH(),GlobalPredicateGroup:kS(t),GlobalDynamicPredicateGroup:kS(t),GlobalStyleId:HH(t),DynamicViewStep:CH(t),LikeC4View:KH(t),Element:SH(t),ElementRef:_H(),ElementKind:GH(t),Relation:LH(t),RelationBody:MH(),Tag:WH(t),FqnExprWith:VH(
1997
+ t),RelationExprWith:ZH(),RelationshipKind:zH(t),IncomingRelationExpr:YH(),OutgoingRelationExpr:JH(),ImportsFromPoject:xH(t),Imported:NH(t)});const e=t.shared.lsp.Connection;e&&t.shared.workspace.DocumentBuilder.onUpdate((n,r)=>{for(const i of r)st.debug(`clear diagnostics for deleted ${i.path}`),e.sendDiagnostics({uri:i.toString(),diagnostics:[]})})}function Xr(t){return Tn(t)?mt(t).split(`
1998
+ `).join(" "):void 0}function mt(t){return Tn(t)?RS(t).trim():void 0}class s5{constructor(e,n){this.services=e,this.doc=n,this.isValid=r5(n).isValid}isValid;get project(){return this.services.shared.workspace.ProjectsManager.getProject(this.doc)}resolveFqn(e){if(Kr(e)){const n=Wt(e),r=this.resolveFqn(It(e.imported.ref,`FqnRef is empty of imported: ${e.$cstNode?.text}`));return this.doc.c4Imports.set(n,r),N_(n,r)}return ua(e)?$o(e.element):co(e)?$o(e.deploymentNode):gp(e)?this.services.likec4.DeploymentsIndex.
1999
+ getFqn(e):this.services.likec4.FqnIndex.getFqn(e)}getAstNodePath(e){return this.services.workspace.AstNodeLocator.getAstNodePath(e)}getMetadata(e){if(!e||!this.isValid(e)||Gt(e.props))return;const n=He(e.props,xt(r=>[r.key,mt(r.value)]),ze(([r,i])=>ce(i)),j4());return Gt(n)?void 0:n}convertTags(e){return this.parseTags(e)}parseTags(e){let n=e?.tags;if(!n)return null;let r=[];for(;n;){try{if(this.isValid(n)){const i=n.values.map(s=>s.ref?.name).filter(ce);i.length>0&&r.push(...i)}}catch{}n=n.prev}
2000
+ return r=Yo(r.reverse()),Un(r)?r:null}convertLinks(e){return this.parseLinks(e)}parseLinks(e){if(!(!e?.props||e.props.length===0))return He(e.props,ze(sh),Hr(n=>{if(!this.isValid(n))return[];const r=n.value;if(ce(r)){const i=ce(n.title)?Xr(n.title):void 0,s=this.services.lsp.DocumentLinkProvider.relativeLink(this.doc,r);return{url:r,...i&&{title:i},...s&&s!==r&&{relative:s}}}return[]}))}parseIconProperty(e){if(!e||!this.isValid(e))return;const{libicon:n,value:r}=e;switch(!0){case!!n:return n.ref?.
2001
+ name;case(r&&rs(r)):return r;case(r&&Ev(r)):return bh(this.doc.uri.toString(),"../",r);case(r&&od(r)):return GC(this.project.folder.toString(),r);default:return}}parseElementStyle(e){if(!e)return{};if(OR(e)){const n=this.parseStyleProps(e?.find(oa)?.props),r=this.parseIconProperty(e?.find(Zi));return r&&(n.icon=r),n}return this.parseStyleProps(e.props)}parseStyleProps(e){const n={};if(!e||e.length===0)return n;for(const r of e)if(this.isValid(r))switch(!0){case Pp(r):{ce(r.value)&&(n.border=r.value);
2002
+ break}case ao(r):{const i=wd(r);ce(i)&&(n.color=i);break}case fh(r):{ce(r.value)&&(n.shape=r.value);break}case Zi(r):{const i=this.parseIconProperty(r);ce(i)&&(n.icon=i);break}case uh(r):{n.opacity=fS(r);break}case av(r):{n.multiple=yy(r.value)?r.value:!1;break}case dv(r):{ce(r.value)&&(n.size=xa(r));break}case uv(r):{ce(r.value)&&(n.padding=xa(r));break}case mv(r):{ce(r.value)&&(n.textSize=xa(r));break}default:qe(r)}return n}}function*o5(t){const e=Vw.from(t.parseResult.value.deployments.flatMap(
2003
+ i=>i.elements)),n=[];let r;for(;r=e.shift();){if(Ci(r)){n.push(r);continue}if(r.body&&r.body.elements.length>0)for(const i of r.body.elements)e.push(i);yield r}yield*n}function a5(t){return class extends t{parseDeployment(){const e=this.doc;for(const n of o5(e))try{switch(!0){case Ci(n):{this.isValid(n)&&e.c4DeploymentRelations.push(this.parseDeploymentRelation(n));break}case Qn(n):e.c4Deployments.push(this.parseDeployedInstance(n));break;case qn(n):{e.c4Deployments.push(this.parseDeploymentNode(
2004
+ n));break}case co(n):{const r=this.parseExtendDeployment(n);r&&e.c4ExtendDeployments.push(r);break}default:qe(n)}}catch(r){Re(r)}}parseDeploymentNode(e){const n=this.isValid,r=this.resolveFqn(e),i=It(e.kind.ref,"DeploymentKind not resolved").name,s=this.convertTags(e.body),o=this.parseElementStyle(e.body?.props),a=this.getMetadata(e.body?.props.find(Qi)),u=He(e.body?.props??[],ze(n),ze(nl),zr(p=>[p.key,p.value||void 0])),c=mt(e.title??u.title),l=mt(u.description),f=Xr(u.technology),d=this.convertLinks(
2005
+ e.body);return{id:r,kind:i,title:c??Hh(r),...a&&{metadata:a},...s&&{tags:s},...d&&Un(d)&&{links:d},...ce(f)&&{technology:f},...ce(l)&&{description:l},style:o}}parseDeployedInstance(e){const n=this.isValid,r=this.resolveFqn(e),i=this.parseFqnRef(e.target.modelElement);_e(wn.isModelRef(i)||wn.isImportRef(i),"Target must be a model reference");const s=this.convertTags(e.body),o=this.parseElementStyle(e.body?.props),a=this.getMetadata(e.body?.props.find(Qi)),u=He(e.body?.props??[],ze(n),ze(nl),zr(p=>[
2006
+ p.key,p.value||void 0])),c=mt(e.title??u.title),l=mt(u.description),f=Xr(u.technology),d=this.convertLinks(e.body);return{id:r,element:i,...a&&{metadata:a},...c&&{title:c},...s&&{tags:s},...d&&Un(d)&&{links:d},...ce(f)&&{technology:f},...ce(l)&&{description:l},style:o}}parseExtendDeployment(e){if(!this.isValid(e))return null;const n=this.resolveFqn(e),r=this.parseTags(e.body),i=this.getMetadata(e.body?.props.find(Qi)),s=this.getAstNodePath(e),o=this.parseLinks(e.body)??[];return!r&&Gt(i??{})&&Gt(
2007
+ o)?null:{id:n,astPath:s,...i&&{metadata:i},...r&&{tags:r},...o&&Un(o)&&{links:o}}}_resolveDeploymentRelationSource(e){if(cn(e.source))return this.parseFqnRef(e.source);if(e.$container.$type==="DeploymentNodeBody"||e.$container.$type==="DeployedInstanceBody")return{deployment:this.resolveFqn(e.$container.$container)};throw new Error("RelationRefError: Invalid container for sourceless relation")}parseDeploymentRelation(e){const n=this.isValid,r=this.getAstNodePath(e),i=wn.toDeploymentRef(this._resolveDeploymentRelationSource(
2008
+ e)),s=wn.toDeploymentRef(this.parseFqnRef(e.target)),o=this.convertTags(e)??this.convertTags(e.body),a=this.convertLinks(e.body),u=e.kind?.ref?.name,c=this.getMetadata(e.body?.props.find(Qi)),l=zr(e.body?.props.filter(xl)??[],w=>[w.key,w.value]),f=He(e.body?.props??[],ze(_l),xt(w=>w.value.view.ref?.name),ze(ce),Zo()),d=mt(e.title??l.title),p=mt(l.description),m=Xr(e.technology)??mt(l.technology),v=e.body?.props.find(dh);return{id:bd("deployment",r,i.id,s.id),source:i,target:s,...d&&{title:d},...c&&
2009
+ {metadata:c},...ce(m)&&{technology:m},...ce(p)&&{description:p},...u&&{kind:u},...o&&{tags:o},...Un(a)&&{links:a},...tw(v?.props,n),...f&&{navigateTo:f},astPath:r}}}}function u5(t){const e=t.length;let n=0,r=0;for(;r<e;){let i=t.charCodeAt(r++);if((i&4294967168)===0){n++;continue}else if((i&4294965248)===0)n+=2;else{if(i>=55296&&i<=56319&&r<e){const s=t.charCodeAt(r);(s&64512)===56320&&(++r,i=((i&1023)<<10)+(s&1023)+65536)}(i&4294901760)===0?n+=3:n+=4}}return n}function c5(t,e,n){const r=t.length;
2010
+ let i=n,s=0;for(;s<r;){let o=t.charCodeAt(s++);if((o&4294967168)===0){e[i++]=o;continue}else if((o&4294965248)===0)e[i++]=o>>6&31|192;else{if(o>=55296&&o<=56319&&s<r){const a=t.charCodeAt(s);(a&64512)===56320&&(++s,o=((o&1023)<<10)+(a&1023)+65536)}(o&4294901760)===0?(e[i++]=o>>12&15|224,e[i++]=o>>6&63|128):(e[i++]=o>>18&7|240,e[i++]=o>>12&63|128,e[i++]=o>>6&63|128)}e[i++]=o&63|128}}const l5=new TextEncoder,d5=50;function f5(t,e,n){l5.encodeInto(t,e.subarray(n))}function p5(t,e,n){t.length>d5?f5(
2011
+ t,e,n):c5(t,e,n)}const h5=4096;function TS(t,e,n){let r=e;const i=r+n,s=[];let o="";for(;r<i;){const a=t[r++];if((a&128)===0)s.push(a);else if((a&224)===192){const u=t[r++]&63;s.push((a&31)<<6|u)}else if((a&240)===224){const u=t[r++]&63,c=t[r++]&63;s.push((a&31)<<12|u<<6|c)}else if((a&248)===240){const u=t[r++]&63,c=t[r++]&63,l=t[r++]&63;let f=(a&7)<<18|u<<12|c<<6|l;f>65535&&(f-=65536,s.push(f>>>10&1023|55296),f=56320|f&1023),s.push(f)}else s.push(a);s.length>=h5&&(o+=String.fromCharCode(...s),s.
2012
+ length=0)}return s.length>0&&(o+=String.fromCharCode(...s)),o}const m5=new TextDecoder,g5=200;function y5(t,e,n){const r=t.subarray(e,e+n);return m5.decode(r)}function v5(t,e,n){return n>g5?y5(t,e,n):TS(t,e,n)}class Wh{constructor(e,n){this.type=e,this.data=n}}class tr extends Error{constructor(e){super(e);const n=Object.create(tr.prototype);Object.setPrototypeOf(this,n),Object.defineProperty(this,"name",{configurable:!0,enumerable:!1,value:tr.name})}}const Ed=4294967295;function w5(t,e,n){const r=n/
2013
+ 4294967296,i=n;t.setUint32(e,r),t.setUint32(e+4,i)}function CS(t,e,n){const r=Math.floor(n/4294967296),i=n;t.setUint32(e,r),t.setUint32(e+4,i)}function AS(t,e){const n=t.getInt32(e),r=t.getUint32(e+4);return n*4294967296+r}function b5(t,e){const n=t.getUint32(e),r=t.getUint32(e+4);return n*4294967296+r}const E5=-1,$5=4294967296-1,D5=17179869184-1;function R5({sec:t,nsec:e}){if(t>=0&&e>=0&&t<=D5)if(e===0&&t<=$5){const n=new Uint8Array(4);return new DataView(n.buffer).setUint32(0,t),n}else{const n=t/
2014
+ 4294967296,r=t&4294967295,i=new Uint8Array(8),s=new DataView(i.buffer);return s.setUint32(0,e<<2|n&3),s.setUint32(4,r),i}else{const n=new Uint8Array(12),r=new DataView(n.buffer);return r.setUint32(0,e),CS(r,4,t),n}}function k5(t){const e=t.getTime(),n=Math.floor(e/1e3),r=(e-n*1e3)*1e6,i=Math.floor(r/1e9);return{sec:n+i,nsec:r-i*1e9}}function T5(t){if(t instanceof Date){const e=k5(t);return R5(e)}else return null}function C5(t){const e=new DataView(t.buffer,t.byteOffset,t.byteLength);switch(t.byteLength){case 4:
2015
+ return{sec:e.getUint32(0),nsec:0};case 8:{const n=e.getUint32(0),r=e.getUint32(4),i=(n&3)*4294967296+r,s=n>>>2;return{sec:i,nsec:s}}case 12:{const n=AS(e,4),r=e.getUint32(0);return{sec:n,nsec:r}}default:throw new tr(`Unrecognized data size for timestamp (expected 4, 8, or 12): ${t.length}`)}}function A5(t){const e=C5(t);return new Date(e.sec*1e3+e.nsec/1e6)}const S5={type:E5,encode:T5,decode:A5};class zh{constructor(){this.builtInEncoders=[],this.builtInDecoders=[],this.encoders=[],this.decoders=
2016
+ [],this.register(S5)}register({type:e,encode:n,decode:r}){if(e>=0)this.encoders[e]=n,this.decoders[e]=r;else{const i=-1-e;this.builtInEncoders[i]=n,this.builtInDecoders[i]=r}}tryToEncode(e,n){for(let r=0;r<this.builtInEncoders.length;r++){const i=this.builtInEncoders[r];if(i!=null){const s=i(e,n);if(s!=null){const o=-1-r;return new Wh(o,s)}}}for(let r=0;r<this.encoders.length;r++){const i=this.encoders[r];if(i!=null){const s=i(e,n);if(s!=null){const o=r;return new Wh(o,s)}}}return e instanceof Wh?
2017
+ e:null}decode(e,n,r){const i=n<0?this.builtInDecoders[-1-n]:this.decoders[n];return i?i(e,n,r):new Wh(n,e)}}zh.defaultCodec=new zh;function _5(t){return t instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&t instanceof SharedArrayBuffer}function lw(t){return t instanceof Uint8Array?t:ArrayBuffer.isView(t)?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):_5(t)?new Uint8Array(t):Uint8Array.from(t)}const P5=100,x5=2048;class Mw{constructor(e){this.entered=!1,this.extensionCodec=e?.extensionCodec??
2018
+ zh.defaultCodec,this.context=e?.context,this.useBigInt64=e?.useBigInt64??!1,this.maxDepth=e?.maxDepth??P5,this.initialBufferSize=e?.initialBufferSize??x5,this.sortKeys=e?.sortKeys??!1,this.forceFloat32=e?.forceFloat32??!1,this.ignoreUndefined=e?.ignoreUndefined??!1,this.forceIntegerToFloat=e?.forceIntegerToFloat??!1,this.pos=0,this.view=new DataView(new ArrayBuffer(this.initialBufferSize)),this.bytes=new Uint8Array(this.view.buffer)}clone(){return new Mw({extensionCodec:this.extensionCodec,context:this.
2019
+ context,useBigInt64:this.useBigInt64,maxDepth:this.maxDepth,initialBufferSize:this.initialBufferSize,sortKeys:this.sortKeys,forceFloat32:this.forceFloat32,ignoreUndefined:this.ignoreUndefined,forceIntegerToFloat:this.forceIntegerToFloat})}reinitializeState(){this.pos=0}encodeSharedRef(e){if(this.entered)return this.clone().encodeSharedRef(e);try{return this.entered=!0,this.reinitializeState(),this.doEncode(e,1),this.bytes.subarray(0,this.pos)}finally{this.entered=!1}}encode(e){if(this.entered)return this.
2020
+ clone().encode(e);try{return this.entered=!0,this.reinitializeState(),this.doEncode(e,1),this.bytes.slice(0,this.pos)}finally{this.entered=!1}}doEncode(e,n){if(n>this.maxDepth)throw new Error(`Too deep objects in depth ${n}`);e==null?this.encodeNil():typeof e=="boolean"?this.encodeBoolean(e):typeof e=="number"?this.forceIntegerToFloat?this.encodeNumberAsFloat(e):this.encodeNumber(e):typeof e=="string"?this.encodeString(e):this.useBigInt64&&typeof e=="bigint"?this.encodeBigInt64(e):this.encodeObject(
2021
+ e,n)}ensureBufferSizeToWrite(e){const n=this.pos+e;this.view.byteLength<n&&this.resizeBuffer(n*2)}resizeBuffer(e){const n=new ArrayBuffer(e),r=new Uint8Array(n),i=new DataView(n);r.set(this.bytes),this.view=i,this.bytes=r}encodeNil(){this.writeU8(192)}encodeBoolean(e){e===!1?this.writeU8(194):this.writeU8(195)}encodeNumber(e){!this.forceIntegerToFloat&&Number.isSafeInteger(e)?e>=0?e<128?this.writeU8(e):e<256?(this.writeU8(204),this.writeU8(e)):e<65536?(this.writeU8(205),this.writeU16(e)):e<4294967296?
2022
+ (this.writeU8(206),this.writeU32(e)):this.useBigInt64?this.encodeNumberAsFloat(e):(this.writeU8(207),this.writeU64(e)):e>=-32?this.writeU8(224|e+32):e>=-128?(this.writeU8(208),this.writeI8(e)):e>=-32768?(this.writeU8(209),this.writeI16(e)):e>=-2147483648?(this.writeU8(210),this.writeI32(e)):this.useBigInt64?this.encodeNumberAsFloat(e):(this.writeU8(211),this.writeI64(e)):this.encodeNumberAsFloat(e)}encodeNumberAsFloat(e){this.forceFloat32?(this.writeU8(202),this.writeF32(e)):(this.writeU8(203),this.
2023
+ writeF64(e))}encodeBigInt64(e){e>=BigInt(0)?(this.writeU8(207),this.writeBigUint64(e)):(this.writeU8(211),this.writeBigInt64(e))}writeStringHeader(e){if(e<32)this.writeU8(160+e);else if(e<256)this.writeU8(217),this.writeU8(e);else if(e<65536)this.writeU8(218),this.writeU16(e);else if(e<4294967296)this.writeU8(219),this.writeU32(e);else throw new Error(`Too long string: ${e} bytes in UTF-8`)}encodeString(e){const r=u5(e);this.ensureBufferSizeToWrite(5+r),this.writeStringHeader(r),p5(e,this.bytes,
2024
+ this.pos),this.pos+=r}encodeObject(e,n){const r=this.extensionCodec.tryToEncode(e,this.context);if(r!=null)this.encodeExtension(r);else if(Array.isArray(e))this.encodeArray(e,n);else if(ArrayBuffer.isView(e))this.encodeBinary(e);else if(typeof e=="object")this.encodeMap(e,n);else throw new Error(`Unrecognized object: ${Object.prototype.toString.apply(e)}`)}encodeBinary(e){const n=e.byteLength;if(n<256)this.writeU8(196),this.writeU8(n);else if(n<65536)this.writeU8(197),this.writeU16(n);else if(n<
2025
+ 4294967296)this.writeU8(198),this.writeU32(n);else throw new Error(`Too large binary: ${n}`);const r=lw(e);this.writeU8a(r)}encodeArray(e,n){const r=e.length;if(r<16)this.writeU8(144+r);else if(r<65536)this.writeU8(220),this.writeU16(r);else if(r<4294967296)this.writeU8(221),this.writeU32(r);else throw new Error(`Too large array: ${r}`);for(const i of e)this.doEncode(i,n+1)}countWithoutUndefined(e,n){let r=0;for(const i of n)e[i]!==void 0&&r++;return r}encodeMap(e,n){const r=Object.keys(e);this.
2026
+ sortKeys&&r.sort();const i=this.ignoreUndefined?this.countWithoutUndefined(e,r):r.length;if(i<16)this.writeU8(128+i);else if(i<65536)this.writeU8(222),this.writeU16(i);else if(i<4294967296)this.writeU8(223),this.writeU32(i);else throw new Error(`Too large map object: ${i}`);for(const s of r){const o=e[s];this.ignoreUndefined&&o===void 0||(this.encodeString(s),this.doEncode(o,n+1))}}encodeExtension(e){if(typeof e.data=="function"){const r=e.data(this.pos+6),i=r.length;if(i>=4294967296)throw new Error(
2027
+ `Too large extension object: ${i}`);this.writeU8(201),this.writeU32(i),this.writeI8(e.type),this.writeU8a(r);return}const n=e.data.length;if(n===1)this.writeU8(212);else if(n===2)this.writeU8(213);else if(n===4)this.writeU8(214);else if(n===8)this.writeU8(215);else if(n===16)this.writeU8(216);else if(n<256)this.writeU8(199),this.writeU8(n);else if(n<65536)this.writeU8(200),this.writeU16(n);else if(n<4294967296)this.writeU8(201),this.writeU32(n);else throw new Error(`Too large extension object: ${n}`);
2028
+ this.writeI8(e.type),this.writeU8a(e.data)}writeU8(e){this.ensureBufferSizeToWrite(1),this.view.setUint8(this.pos,e),this.pos++}writeU8a(e){const n=e.length;this.ensureBufferSizeToWrite(n),this.bytes.set(e,this.pos),this.pos+=n}writeI8(e){this.ensureBufferSizeToWrite(1),this.view.setInt8(this.pos,e),this.pos++}writeU16(e){this.ensureBufferSizeToWrite(2),this.view.setUint16(this.pos,e),this.pos+=2}writeI16(e){this.ensureBufferSizeToWrite(2),this.view.setInt16(this.pos,e),this.pos+=2}writeU32(e){this.
2029
+ ensureBufferSizeToWrite(4),this.view.setUint32(this.pos,e),this.pos+=4}writeI32(e){this.ensureBufferSizeToWrite(4),this.view.setInt32(this.pos,e),this.pos+=4}writeF32(e){this.ensureBufferSizeToWrite(4),this.view.setFloat32(this.pos,e),this.pos+=4}writeF64(e){this.ensureBufferSizeToWrite(8),this.view.setFloat64(this.pos,e),this.pos+=8}writeU64(e){this.ensureBufferSizeToWrite(8),w5(this.view,this.pos,e),this.pos+=8}writeI64(e){this.ensureBufferSizeToWrite(8),CS(this.view,this.pos,e),this.pos+=8}writeBigUint64(e){
2030
+ this.ensureBufferSizeToWrite(8),this.view.setBigUint64(this.pos,e),this.pos+=8}writeBigInt64(e){this.ensureBufferSizeToWrite(8),this.view.setBigInt64(this.pos,e),this.pos+=8}}function N5(t,e){return new Mw(e).encodeSharedRef(t)}function dw(t){return`${t<0?"-":""}0x${Math.abs(t).toString(16).padStart(2,"0")}`}const I5=16,O5=16;class F5{constructor(e=I5,n=O5){this.hit=0,this.miss=0,this.maxKeyLength=e,this.maxLengthPerKey=n,this.caches=[];for(let r=0;r<this.maxKeyLength;r++)this.caches.push([])}canBeCached(e){
2031
+ return e>0&&e<=this.maxKeyLength}find(e,n,r){const i=this.caches[r-1];e:for(const s of i){const o=s.bytes;for(let a=0;a<r;a++)if(o[a]!==e[n+a])continue e;return s.str}return null}store(e,n){const r=this.caches[e.length-1],i={bytes:e,str:n};r.length>=this.maxLengthPerKey?r[Math.random()*r.length|0]=i:r.push(i)}decode(e,n,r){const i=this.find(e,n,r);if(i!=null)return this.hit++,i;this.miss++;const s=TS(e,n,r),o=Uint8Array.prototype.slice.call(e,n,n+r);return this.store(o,s),s}}const fw="array",$d="\
2032
+ map_key",SS="map_value",L5=t=>{if(typeof t=="string"||typeof t=="number")return t;throw new tr("The type of key must be string or number but "+typeof t)};class M5{constructor(){this.stack=[],this.stackHeadPosition=-1}get length(){return this.stackHeadPosition+1}top(){return this.stack[this.stackHeadPosition]}pushArrayState(e){const n=this.getUninitializedStateFromPool();n.type=fw,n.position=0,n.size=e,n.array=new Array(e)}pushMapState(e){const n=this.getUninitializedStateFromPool();n.type=$d,n.readCount=
2033
+ 0,n.size=e,n.map={}}getUninitializedStateFromPool(){if(this.stackHeadPosition++,this.stackHeadPosition===this.stack.length){const e={type:void 0,size:0,array:void 0,position:0,readCount:0,map:void 0,key:null};this.stack.push(e)}return this.stack[this.stackHeadPosition]}release(e){if(this.stack[this.stackHeadPosition]!==e)throw new Error("Invalid stack state. Released state is not on top of the stack.");if(e.type===fw){const r=e;r.size=0,r.array=void 0,r.position=0,r.type=void 0}if(e.type===$d||e.
2034
+ type===SS){const r=e;r.size=0,r.map=void 0,r.readCount=0,r.type=void 0}this.stackHeadPosition--}reset(){this.stack.length=0,this.stackHeadPosition=-1}}const Dd=-1,pw=new DataView(new ArrayBuffer(0)),B5=new Uint8Array(pw.buffer);try{pw.getInt8(0)}catch(t){if(!(t instanceof RangeError))throw new Error("This module is not supported in the current JavaScript engine because DataView does not throw RangeError on out-of-bounds access")}const _S=new RangeError("Insufficient data"),q5=new F5;class Bw{constructor(e){
2035
+ this.totalPos=0,this.pos=0,this.view=pw,this.bytes=B5,this.headByte=Dd,this.stack=new M5,this.entered=!1,this.extensionCodec=e?.extensionCodec??zh.defaultCodec,this.context=e?.context,this.useBigInt64=e?.useBigInt64??!1,this.rawStrings=e?.rawStrings??!1,this.maxStrLength=e?.maxStrLength??Ed,this.maxBinLength=e?.maxBinLength??Ed,this.maxArrayLength=e?.maxArrayLength??Ed,this.maxMapLength=e?.maxMapLength??Ed,this.maxExtLength=e?.maxExtLength??Ed,this.keyDecoder=e?.keyDecoder!==void 0?e.keyDecoder:
2036
+ q5,this.mapKeyConverter=e?.mapKeyConverter??L5}clone(){return new Bw({extensionCodec:this.extensionCodec,context:this.context,useBigInt64:this.useBigInt64,rawStrings:this.rawStrings,maxStrLength:this.maxStrLength,maxBinLength:this.maxBinLength,maxArrayLength:this.maxArrayLength,maxMapLength:this.maxMapLength,maxExtLength:this.maxExtLength,keyDecoder:this.keyDecoder})}reinitializeState(){this.totalPos=0,this.headByte=Dd,this.stack.reset()}setBuffer(e){const n=lw(e);this.bytes=n,this.view=new DataView(
2037
+ n.buffer,n.byteOffset,n.byteLength),this.pos=0}appendBuffer(e){if(this.headByte===Dd&&!this.hasRemaining(1))this.setBuffer(e);else{const n=this.bytes.subarray(this.pos),r=lw(e),i=new Uint8Array(n.length+r.length);i.set(n),i.set(r,n.length),this.setBuffer(i)}}hasRemaining(e){return this.view.byteLength-this.pos>=e}createExtraByteError(e){const{view:n,pos:r}=this;return new RangeError(`Extra ${n.byteLength-r} of ${n.byteLength} byte(s) found at buffer[${e}]`)}decode(e){if(this.entered)return this.
2038
+ clone().decode(e);try{this.entered=!0,this.reinitializeState(),this.setBuffer(e);const n=this.doDecodeSync();if(this.hasRemaining(1))throw this.createExtraByteError(this.pos);return n}finally{this.entered=!1}}*decodeMulti(e){if(this.entered){yield*this.clone().decodeMulti(e);return}try{for(this.entered=!0,this.reinitializeState(),this.setBuffer(e);this.hasRemaining(1);)yield this.doDecodeSync()}finally{this.entered=!1}}async decodeAsync(e){if(this.entered)return this.clone().decodeAsync(e);try{this.
2039
+ entered=!0;let n=!1,r;for await(const a of e){if(n)throw this.entered=!1,this.createExtraByteError(this.totalPos);this.appendBuffer(a);try{r=this.doDecodeSync(),n=!0}catch(u){if(!(u instanceof RangeError))throw u}this.totalPos+=this.pos}if(n){if(this.hasRemaining(1))throw this.createExtraByteError(this.totalPos);return r}const{headByte:i,pos:s,totalPos:o}=this;throw new RangeError(`Insufficient data in parsing ${dw(i)} at ${o} (${s} in the current buffer)`)}finally{this.entered=!1}}decodeArrayStream(e){
2040
+ return this.decodeMultiAsync(e,!0)}decodeStream(e){return this.decodeMultiAsync(e,!1)}async*decodeMultiAsync(e,n){if(this.entered){yield*this.clone().decodeMultiAsync(e,n);return}try{this.entered=!0;let r=n,i=-1;for await(const s of e){if(n&&i===0)throw this.createExtraByteError(this.totalPos);this.appendBuffer(s),r&&(i=this.readArraySize(),r=!1,this.complete());try{for(;yield this.doDecodeSync(),--i!==0;);}catch(o){if(!(o instanceof RangeError))throw o}this.totalPos+=this.pos}}finally{this.entered=
2041
+ !1}}doDecodeSync(){e:for(;;){const e=this.readHeadByte();let n;if(e>=224)n=e-256;else if(e<192)if(e<128)n=e;else if(e<144){const i=e-128;if(i!==0){this.pushMapState(i),this.complete();continue e}else n={}}else if(e<160){const i=e-144;if(i!==0){this.pushArrayState(i),this.complete();continue e}else n=[]}else{const i=e-160;n=this.decodeString(i,0)}else if(e===192)n=null;else if(e===194)n=!1;else if(e===195)n=!0;else if(e===202)n=this.readF32();else if(e===203)n=this.readF64();else if(e===204)n=this.
2042
+ readU8();else if(e===205)n=this.readU16();else if(e===206)n=this.readU32();else if(e===207)this.useBigInt64?n=this.readU64AsBigInt():n=this.readU64();else if(e===208)n=this.readI8();else if(e===209)n=this.readI16();else if(e===210)n=this.readI32();else if(e===211)this.useBigInt64?n=this.readI64AsBigInt():n=this.readI64();else if(e===217){const i=this.lookU8();n=this.decodeString(i,1)}else if(e===218){const i=this.lookU16();n=this.decodeString(i,2)}else if(e===219){const i=this.lookU32();n=this.decodeString(
2043
+ i,4)}else if(e===220){const i=this.readU16();if(i!==0){this.pushArrayState(i),this.complete();continue e}else n=[]}else if(e===221){const i=this.readU32();if(i!==0){this.pushArrayState(i),this.complete();continue e}else n=[]}else if(e===222){const i=this.readU16();if(i!==0){this.pushMapState(i),this.complete();continue e}else n={}}else if(e===223){const i=this.readU32();if(i!==0){this.pushMapState(i),this.complete();continue e}else n={}}else if(e===196){const i=this.lookU8();n=this.decodeBinary(
2044
+ i,1)}else if(e===197){const i=this.lookU16();n=this.decodeBinary(i,2)}else if(e===198){const i=this.lookU32();n=this.decodeBinary(i,4)}else if(e===212)n=this.decodeExtension(1,0);else if(e===213)n=this.decodeExtension(2,0);else if(e===214)n=this.decodeExtension(4,0);else if(e===215)n=this.decodeExtension(8,0);else if(e===216)n=this.decodeExtension(16,0);else if(e===199){const i=this.lookU8();n=this.decodeExtension(i,1)}else if(e===200){const i=this.lookU16();n=this.decodeExtension(i,2)}else if(e===
2045
+ 201){const i=this.lookU32();n=this.decodeExtension(i,4)}else throw new tr(`Unrecognized type byte: ${dw(e)}`);this.complete();const r=this.stack;for(;r.length>0;){const i=r.top();if(i.type===fw)if(i.array[i.position]=n,i.position++,i.position===i.size)n=i.array,r.release(i);else continue e;else if(i.type===$d){if(n==="__proto__")throw new tr("The key __proto__ is not allowed");i.key=this.mapKeyConverter(n),i.type=SS;continue e}else if(i.map[i.key]=n,i.readCount++,i.readCount===i.size)n=i.map,r.release(
2046
+ i);else{i.key=null,i.type=$d;continue e}}return n}}readHeadByte(){return this.headByte===Dd&&(this.headByte=this.readU8()),this.headByte}complete(){this.headByte=Dd}readArraySize(){const e=this.readHeadByte();switch(e){case 220:return this.readU16();case 221:return this.readU32();default:{if(e<160)return e-144;throw new tr(`Unrecognized array type byte: ${dw(e)}`)}}}pushMapState(e){if(e>this.maxMapLength)throw new tr(`Max length exceeded: map length (${e}) > maxMapLengthLength (${this.maxMapLength}\
2047
+ )`);this.stack.pushMapState(e)}pushArrayState(e){if(e>this.maxArrayLength)throw new tr(`Max length exceeded: array length (${e}) > maxArrayLength (${this.maxArrayLength})`);this.stack.pushArrayState(e)}decodeString(e,n){return!this.rawStrings||this.stateIsMapKey()?this.decodeUtf8String(e,n):this.decodeBinary(e,n)}decodeUtf8String(e,n){if(e>this.maxStrLength)throw new tr(`Max length exceeded: UTF-8 byte length (${e}) > maxStrLength (${this.maxStrLength})`);if(this.bytes.byteLength<this.pos+n+e)throw _S;
2048
+ const r=this.pos+n;let i;return this.stateIsMapKey()&&this.keyDecoder?.canBeCached(e)?i=this.keyDecoder.decode(this.bytes,r,e):i=v5(this.bytes,r,e),this.pos+=n+e,i}stateIsMapKey(){return this.stack.length>0?this.stack.top().type===$d:!1}decodeBinary(e,n){if(e>this.maxBinLength)throw new tr(`Max length exceeded: bin length (${e}) > maxBinLength (${this.maxBinLength})`);if(!this.hasRemaining(e+n))throw _S;const r=this.pos+n,i=this.bytes.subarray(r,r+e);return this.pos+=n+e,i}decodeExtension(e,n){if(e>
2049
+ this.maxExtLength)throw new tr(`Max length exceeded: ext length (${e}) > maxExtLength (${this.maxExtLength})`);const r=this.view.getInt8(this.pos+n),i=this.decodeBinary(e,n+1);return this.extensionCodec.decode(i,r,this.context)}lookU8(){return this.view.getUint8(this.pos)}lookU16(){return this.view.getUint16(this.pos)}lookU32(){return this.view.getUint32(this.pos)}readU8(){const e=this.view.getUint8(this.pos);return this.pos++,e}readI8(){const e=this.view.getInt8(this.pos);return this.pos++,e}readU16(){
2050
+ const e=this.view.getUint16(this.pos);return this.pos+=2,e}readI16(){const e=this.view.getInt16(this.pos);return this.pos+=2,e}readU32(){const e=this.view.getUint32(this.pos);return this.pos+=4,e}readI32(){const e=this.view.getInt32(this.pos);return this.pos+=4,e}readU64(){const e=b5(this.view,this.pos);return this.pos+=8,e}readI64(){const e=AS(this.view,this.pos);return this.pos+=8,e}readU64AsBigInt(){const e=this.view.getBigUint64(this.pos);return this.pos+=8,e}readI64AsBigInt(){const e=this.view.
2051
+ getBigInt64(this.pos);return this.pos+=8,e}readF32(){const e=this.view.getFloat32(this.pos);return this.pos+=4,e}readF64(){const e=this.view.getFloat64(this.pos);return this.pos+=8,e}}function j5(t,e){return new Bw(e).decode(t)}const G5=t=>typeof ArrayBuffer=="function"&&t instanceof ArrayBuffer||Object.prototype.toString.call(t)==="[object ArrayBuffer]",U5=(t,e=0,n=t.byteLength-e)=>{if(!G5(t))throw new TypeError(`The "input" argument must be ArrayBuffer. Received type ${typeof t} (${t})`);return Vh.
2052
+ from(t,e,n)},PS=(t,e)=>{if(typeof t!="string")throw new TypeError(`The "input" argument must be of type string. Received type ${typeof t} (${t})`);return e?Vh.from(t,e):Vh.from(t)},W5=/^[A-Za-z0-9+/]*={0,2}$/,z5=t=>{if(t.length*3%4!==0)throw new TypeError("Incorrect padding on base64 string.");if(!W5.exec(t))throw new TypeError("Invalid base64 string.");const e=PS(t,"base64");return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)},H5=t=>{const e=PS(t,"utf8");return new Uint8Array(e.buffer,e.byteOffset,
2053
+ e.byteLength/Uint8Array.BYTES_PER_ELEMENT)},K5=t=>{let e;if(typeof t=="string"?e=H5(t):e=t,typeof e!="object"||typeof e.byteOffset!="number"||typeof e.byteLength!="number")throw new Error("@smithy/util-base64: toBase64 encoder function only accepts string | Uint8Array.");return U5(e.buffer,e.byteOffset,e.byteLength).toString("base64")},{getDocument:V5}=xo;function X5({nodes:t,edges:e,...n}){return{...n,nodes:Jo(t,({x:r,y:i,width:s,height:o,isCompound:a,...u})=>({...u,b:[r,i,s,o],c:a})),edges:Jo(
2054
+ e,({points:r,controlPoints:i,labelBBox:s,dotpos:o,...a})=>({...!!i&&{cp:i},...!!s&&{l:s},...!!o&&{dp:o},...a,p:r}))}}function Y5({nodes:t,edges:e,autoLayout:n,...r}){return{...r,autoLayout:I_(n)?{direction:n}:n,nodes:Jo(t,({b:i,c:s,...o})=>({x:i[0],y:i[1],width:i[2],height:i[3],isCompound:s,...o})),edges:Jo(e,({p:i,cp:s,l:o,dp:a,...u})=>({...!!s&&{controlPoints:s},...!!o&&{labelBBox:o},...!!a&&{dotpos:a},...u,points:i}))}}const xS=500;function J5(t){const e=N5(X5(t)),n=K5(e),r=[];let i=0;for(;i<
2055
+ n.length;)r.push(" * "+n.slice(i,Math.min(i+xS,n.length))),i+=xS;return r.unshift("/**"," * @likec4-generated(v1)"),r.push(" */"),r.join(`
2056
+ `)}function NS(t){return t.includes("@likec4-generated")}function Q5(t){if(!NS(t))throw new Error(`Not a likec4-generated comment: ${t}`);const e=t.trim().split(`
2057
+ `).filter(r=>!r.includes("**")&&!r.includes("@likec4-")&&!r.includes("*/")).map(r=>r.replaceAll("*","").trim()).join(""),n=z5(e);return Y5(j5(n))}function hw(t){const e=mm(t.$cstNode,["BLOCK_COMMENT"]);if(!(!e||!NS(e.text)))try{return Q5(e.text)}catch(n){const r=V5(t);Re(n),st.warn(`Ignoring manual layout of "${t.name??"unnamed"}" at ${r.uri.fsPath}:${1+(e.range.start.line||0)}`);return}}function Z5(t){return class extends t{parseDeploymentView(e){const n=e.body;_e(n,"DynamicElementView body is \
2058
+ not defined");const r=n.props.filter(this.isValid),i=this.getAstNodePath(e);let s=e.name;s||(s="deployment_"+bd(this.doc.uri.toString(),i));const o=Xr(r.find(f=>f.key==="title")?.value)??null,a=mt(r.find(f=>f.key==="description")?.value)??null,u=this.convertTags(n),c=this.convertLinks(n);Bh.writeId(e,s);const l=hw(e);return{__:"deployment",id:s,astPath:i,title:o,description:a,tags:u,links:Un(c)?c:null,rules:n.rules.flatMap(f=>{try{return this.isValid(f)?this.parseDeploymentViewRule(f):[]}catch(d){
2059
+ return Re(d),[]}}),...l&&{manualLayout:l}}}parseDeploymentViewRule(e){if(ia(e))return this.parseDeploymentViewRulePredicate(e);if(ql(e))return nw(e);if(Yy(e))return this.parseDeploymentViewRuleStyle(e);qe(e)}parseDeploymentViewRulePredicate(e){const n=[];let r=e.expr;for(;r;){try{const i=r.value;Tn(i)&&this.isValid(i)&&n.unshift(this.parseExpressionV2(i))}catch(i){Re(i)}r=r.prev}return e.isInclude?{include:n}:{exclude:n}}parseDeploymentViewRuleStyle(e){const n=this.parseStyleProps(e.props.filter(
2060
+ Ky)),r=mt(e.props.find(ga)?.value);return{targets:this.parseFqnExpressions(e.targets),style:n,...r&&{notation:r}}}}}const IS=({operator:t,not:e},n)=>t.startsWith("!=")?{neq:n}:t.startsWith("=")?{eq:n}:e?{neq:n}:{eq:n};function OS(t){return!_C(t)&&!PC(t)?null:t.participant}function Rd(t){switch(!0){case d8(t):{const e=t.value?.ref?.name,n=OS(t);_e(e,"Expected tag name");const r={tag:IS(t,e)};return n?{participant:n,operator:r}:r}case c8(t):{const e=t.value?.ref?.name,n=OS(t);_e(e,"Expected kind n\
2061
+ ame");const r={kind:IS(t,e)};return n?{participant:n,operator:r}:r}case(CC(t)||SC(t)):return{not:Rd(t.value)};case T8(t):{const e=Rd(t.left),n=Rd(t.right),r=t.operator.toLowerCase();switch(r){case"and":{const i=[Yw(e)?e.and:e,Yw(n)?n.and:n].flat();return _e(Un(i),"Expected non-empty array"),{and:i}}case"or":{const i=[Xw(e)?e.or:e,Xw(n)?n.or:n].flat();return _e(Un(i),"Expected non-empty array"),{or:i}}default:qe(r)}}default:qe(t)}}function e9(t){return class extends t{parseFqnRef(e){const n=It(e.
2062
+ value?.ref,`FqnRef is empty ${e.$cstNode?.range.start.line}:${e.$cstNode?.range.start.character}`);if(Kr(n)){const r={project:Wt(n),model:this.resolveFqn(It(n.imported.ref,`FqnRef is empty of imported: ${n.$cstNode?.text}`))};return this.doc.c4Imports.set(r.project,r.model),r}if(hn(n)){const r=z6(e);if(r){const a={project:Wt(r),model:this.resolveFqn(n)};return this.doc.c4Imports.set(a.project,a.model),a}const i=W6(e);if(!i)return{model:this.resolveFqn(n)};const s=this.resolveFqn(i),o=this.resolveFqn(
2063
+ n);return{deployment:s,element:o}}if(gp(n))return{deployment:this.resolveFqn(n)};qe(n)}parseExpressionV2(e){if(QT(e))return this.parseFqnExprOrWith(e);if(i8(e))return this.parseRelationExprOrWith(e);qe(e)}parseFqnExprOrWith(e){if(Jp(e))return this.parseFqnExprWith(e);if(JT(e))return this.parseFqnExprOrWhere(e);qe(e)}parseFqnExprWith(e){const n=this.parseFqnExprOrWhere(e.subject);return(e.custom?.props??[]).reduce((r,i)=>{if(!this.isValid(i))return r;if(ah(i)){const s=i.value.view.$refText;return ce(
2064
+ s)&&(r.custom.navigateTo=s),r}if(nl(i))return cn(i.value)&&(r.custom[i.key]=mt(i.value)||""),r;if(Zi(i)){const s=this.parseIconProperty(i);return cn(s)&&(r.custom[i.key]=s),r}if(ao(i)){const s=wd(i);return cn(s)&&(r.custom[i.key]=s),r}if(fh(i)||Pp(i))return cn(i.value)&&(r.custom[i.key]=i.value),r;if(uh(i))return cn(i.value)&&(r.custom[i.key]=fS(i)),r;if(ga(i))return ce(i.value)&&(r.custom[i.key]=mt(i.value)),r;if(av(i))return yy(i.value)&&(r.custom[i.key]=i.value),r;if(dv(i)||mv(i)||uv(i))return ce(
2065
+ i.value)&&(r.custom[i.key]=xa(i)),r;qe(i)},{custom:{expr:n}})}parseFqnExprOrWhere(e){if(iv(e))return this.parseFqnExprWhere(e);if(YT(e))return this.parseFqnExpr(e);qe(e)}parseFqnExprWhere(e){return _e(!iv(e.subject),"FqnExprWhere is not allowed as subject of FqnExprWhere"),{where:{expr:this.parseFqnExpr(e.subject),condition:e.where?Rd(e.where):{kind:{neq:"--always-true--"}}}}}parseFqnExpr(e){if(xC(e))return{wildcard:!0};if(fC(e))return _e(e.kind?.ref,"ElementKindExpr kind is not resolved: "+e.$cstNode?.
2066
+ text),{elementKind:e.kind.ref.name,isEqual:e.isEqual};if(pC(e)){_e(e.tag?.ref,"ElementTagExpr tag is not resolved: "+e.$cstNode?.text);let n=e.tag.$refText;return n.startsWith("#")&&(n=n.slice(1)),{elementTag:n,isEqual:e.isEqual}}if(Zp(e))return this.parseFqnRefExpr(e);qe(e)}parseFqnRefExpr(e){const n=this.parseFqnRef(e.ref);switch(!0){case e.selector==="._":return{ref:n,selector:"expanded"};case e.selector===".**":return{ref:n,selector:"descendants"};case e.selector===".*":return{ref:n,selector:"\
2067
+ children"};default:return{ref:n}}}parseFqnExpressions(e){const n=[];let r=e;for(;r;){try{Tn(r.value)&&this.isValid(r.value)&&n.push(this.parseFqnExpr(r.value))}catch(i){Re(i)}r=r.prev}return n.reverse()}parseRelationExprOrWith(e){if(lv(e))return this.parseRelationExprWith(e);if(r8(e))return this.parseRelationExprOrWhere(e);qe(e)}parseRelationExprWith(e){const n=this.parseRelationExprOrWhere(e.subject);return(e.custom?.props??[]).reduce((r,i)=>{if(xl(i)||ga(i)||EC(i))return cn(i.value)&&(r.customRelation[i.
2068
+ key]=mt(i.value)??""),r;if(zc(i))return ce(i.value)&&(r.customRelation[i.key]=i.value),r;if(ao(i)){const s=wd(i);return ce(s)&&(r.customRelation[i.key]=s),r}if(gl(i))return ce(i.value)&&(r.customRelation[i.key]=i.value),r;if(_l(i)){const s=i.value.view.ref?.name;return ce(s)&&(r.customRelation.navigateTo=s),r}qe(i)},{customRelation:{expr:n}})}parseRelationExprOrWhere(e){if(cv(e))return this.parseRelationExprWhere(e);if(Dp(e))return this.parseRelationExpr(e);qe(e)}parseRelationExprWhere(e){return _e(
2069
+ !cv(e.subject),"RelationExprWhere is not allowed as subject of RelationExprWhere"),{where:{expr:this.parseRelationExpr(e.subject),condition:e.where?Rd(e.where):{kind:{neq:"--always-true--"}}}}}parseRelationExpr(e){switch(e.$type){case"DirectedRelationExpr":return{source:this.parseFqnExpr(e.source.from),target:this.parseFqnExpr(e.target),isBidirectional:e.source.isBidirectional};case"InOutRelationExpr":return{inout:this.parseFqnExpr(e.inout.to)};case"OutgoingRelationExpr":return{outgoing:this.parseFqnExpr(
2070
+ e.from)};case"IncomingRelationExpr":return{incoming:this.parseFqnExpr(e.to)};default:qe(e)}}}}function t9(t){return class extends t{parseGlobals(){const{parseResult:e,c4Globals:n}=this.doc,r=this.isValid,i=e.value.globals.filter(r),s=i.flatMap(a=>a.predicates.filter(r));for(const a of s)try{const u=a.name;if(!ce(u))continue;if(u in n.predicates){st.warn(`Global predicate named "${u}" is already defined`);continue}this.parseAndStoreGlobalPredicateGroupOrDynamic(a,u,n)}catch(u){Re(u)}const o=i.flatMap(
2071
+ a=>a.styles.filter(r));for(const a of o)try{const u=a.id.name;if(!ce(u))continue;if(u in n.styles){st.warn(`Global style named "${u}" is already defined`);continue}const c=this.parseGlobalStyleOrGroup(a);c.length>0&&(n.styles[u]=c)}catch(u){Re(u)}}parseAndStoreGlobalPredicateGroupOrDynamic(e,n,r){if(ll(e)){const i=this.parseGlobalPredicateGroup(e);i.length>0&&(r.predicates[n]=i);return}if(cl(e)){const i=this.parseGlobalDynamicPredicateGroup(e);i.length>0&&(r.dynamicPredicates[n]=i);return}qe(e)}parseGlobalPredicateGroup(e){
2072
+ return e.predicates.map(n=>this.parseViewRulePredicate(n))}parseGlobalDynamicPredicateGroup(e){return e.predicates.map(n=>this.parseDynamicViewIncludePredicate(n))}parseGlobalStyleOrGroup(e){if(fa(e))return[this.parseViewRuleStyle(e)];if(fo(e))return e.styles.map(n=>this.parseViewRuleStyle(n));qe(e)}}}function n9(t){return class extends t{parseImports(){const e=this.doc.parseResult.value.imports??[];for(const n of e){const r=n.project;let i=n.imports;for(;i;){try{this.doc.c4Imports.set(r,this.resolveFqn(
2073
+ It(i.imported.ref,`ElementRef is empty of imported: ${i.imported.$refText}`)))}catch(s){Re(s)}i=i.prev}}}}}const r9=st.getChild("ModelParser");function*i9(t){const e=Vw.from(t.parseResult.value.models.flatMap(i=>i.elements)),n=[];let r;for(;r=e.shift();){if(_i(r)){n.push(r);continue}if(r.body&&r.body.elements&&r.body.elements.length>0)for(const i of r.body.elements)e.push(i);yield r}yield*n}function s9(t){return class extends t{parseModel(){const e=this.doc;for(const n of i9(e))try{if(hn(n)){e.c4Elements.
2074
+ push(this.parseElement(n));continue}if(_i(n)){this.isValid(n)&&e.c4Relations.push(this.parseRelation(n));continue}if(ua(n)){const r=this.parseExtendElement(n);r&&e.c4ExtendElements.push(r);continue}qe(n)}catch(r){const i=this.getAstNodePath(n),s=yr(r),o=r instanceof Error?r.message:String(s);r9.warn(`Error on {eltype}: ${o}
2075
+ document: {path}
2076
+ astpath: {astPath}
2077
+ ${s}`,{path:e.uri.path,eltype:n.$type,astPath:i})}}parseElement(e){const n=this.isValid,r=this.resolveFqn(e),i=It(e.kind.ref,"Element kind is not resolved").name,s=this.parseTags(e.body),o=this.parseElementStyle(e.body?.props),a=this.getMetadata(e.body?.props.find(Qi)),u=this.getAstNodePath(e);let[c,l,f]=e.props??[];const d=He(e.body?.props??[],ze(n),ze(nl),zr(m=>[m.key,m.value||void 0]));c=mt(c??d.title),l=mt(d.description??l),f=Xr(d.technology??f);const p=this.parseLinks(e.body);return{id:r,kind:i,
2078
+ astPath:u,title:c??e.name,...a&&{metadata:a},...s&&{tags:s},...p&&Un(p)&&{links:p},...ce(f)&&{technology:f},...ce(l)&&{description:l},style:o}}parseExtendElement(e){const n=this.resolveFqn(e),r=this.parseTags(e.body),i=this.getMetadata(e.body?.props.find(Qi)),s=this.getAstNodePath(e),o=this.parseLinks(e.body)??[];return!r&&Gt(i??{})&&Gt(o)?null:{id:n,astPath:s,...i&&{metadata:i},...r&&{tags:r},...o&&Un(o)&&{links:o}}}_resolveRelationSource(e){if(cn(e.source)){const n=this.parseFqnRef(e.source);return _e(
2079
+ Es.isModelRef(n)||Es.isImportRef(n),"Relation source must be a model reference"),n}if(!Up(e.$container))throw new Error("RelationRefError: Invalid container for sourceless relation");return{model:this.resolveFqn(e.$container.$container)}}parseRelation(e){const n=this.isValid,r=this._resolveRelationSource(e),i=this.parseFqnRef(e.target);_e(Es.isModelRef(i)||Es.isImportRef(i),"Target must be a model reference");const s=this.parseTags(e)??this.parseTags(e.body),o=this.parseLinks(e.body),a=e.kind?.ref?.
2080
+ name,u=this.getMetadata(e.body?.props.find(Qi)),c=this.getAstNodePath(e),l=zr(e.body?.props.filter(xl).filter(w=>Tn(w.value))??[],w=>[w.key,w.value]),f=He(e.body?.props??[],ze(_l),xt(w=>w.value.view.ref?.name),ze(ce),Zo()),d=mt(e.title??l.title)??"",p=mt(l.description),m=Xr(e.technology)??mt(l.technology),v=e.body?.props.find(dh);return{id:bd(c,r.model,i.model),astPath:c,source:r,target:i,title:d,...u&&{metadata:u},...ce(m)&&{technology:m},...ce(p)&&{description:p},...a&&{kind:a},...s&&{tags:s},
2081
+ ...Un(o)&&{links:o},...tw(v?.props,n),...f&&{navigateTo:f}}}}}function o9(t){return class extends t{parsePredicate(e){return this.parseExpressionV2(e)}parseElementPredicate(e){if(Jp(e))return this.parseFqnExprWith(e);if(JT(e))return this.parseFqnExprOrWhere(e);qe(e)}parseElementPredicateOrWhere(e){return this.parseFqnExprOrWhere(e)}parseElementExpression(e){return this.parseFqnExpr(e)}parseElementPredicateWhere(e){return this.parseFqnExprWhere(e)}parseElementPredicateWith(e){return this.parseFqnExprWith(
2082
+ e)}parseRelationPredicate(e){return this.parseRelationExprOrWith(e)}parseRelationPredicateOrWhere(e){return this.parseRelationExprOrWhere(e)}parseRelationPredicateWhere(e){return this.parseRelationExprWhere(e)}parseRelationPredicateWith(e){return this.parseRelationExprWith(e)}parseRelationExpression(e){return this.parseRelationExpr(e)}}}function a9(t){return class extends t{parseSpecification(){const{parseResult:{value:{specifications:e}},c4Specification:n}=this.doc,r=this.isValid,i=e.flatMap(c=>c.
2083
+ elements.filter(this.isValid));for(const{kind:c,props:l}of i)try{const f=c.name;if(!ce(f))continue;if(f in n.elements){st.warn(`Element kind "${f}" is already defined`);continue}const d=this.parseElementStyle(l.find(oa)),p=He(l.filter(fv)??[],ze(m=>this.isValid(m)&&Tn(m.value)),zr(m=>[m.key,mt(m.value)]));n.elements[f]={...p,style:d}}catch(f){Re(f)}const s=e.flatMap(c=>c.relationships.filter(this.isValid));for(const{kind:c,props:l}of s)try{const f=c.name;if(!ce(f))continue;if(f in n.relationships){
2084
+ st.warn(`Relationship kind "${f}" is already defined`);continue}const d=He(l.filter(DC)??[],ze(p=>this.isValid(p)&&Tn(p.value)),zr(p=>[p.key,mt(p.value)]));n.relationships[f]={...d,...tw(l,this.isValid)}}catch(f){Re(f)}const o=e.flatMap(c=>c.tags.filter(this.isValid));for(const c of o){const l=c.tag.name;ce(l)&&n.tags.add(l)}const a=e.flatMap(c=>c.deploymentNodes.filter(r));for(const c of a)try{Object.assign(n.deployments,this.parseSpecificationDeploymentNodeKind(c))}catch(l){Re(l)}const u=e.flatMap(
2085
+ c=>c.colors.filter(r));for(const{name:c,color:l}of u)try{const f=c.name;if(f in n.colors){st.warn(`Custom color "${f}" is already defined`);continue}n.colors[f]={color:l}}catch(f){Re(f)}}parseSpecificationDeploymentNodeKind({kind:e,props:n}){const r=e.name;if(!ce(r))throw new Error("DeploymentNodeKind name is not resolved");const i=this.parseElementStyle(n.find(oa)),s=He(n.filter(fv)??[],ze(o=>this.isValid(o)&&Tn(o.value)),zr(o=>[o.key,mt(o.value)]));return{[r]:{...s,style:i}}}}}function u9(t){return class extends t{parseViews(){
2086
+ const e=this.isValid;for(const n of this.doc.parseResult.value.views){const r=n.styles.flatMap(i=>{try{return e(i)?this.parseViewRuleStyleOrGlobalRef(i):[]}catch(s){return Re(s),[]}});for(const i of n.views)try{if(!e(i))continue;switch(!0){case zp(i):this.doc.c4Views.push(this.parseElementView(i,r));break;case aC(i):this.doc.c4Views.push(this.parseDynamicElementView(i,r));break;case oC(i):this.doc.c4Views.push(this.parseDeploymentView(i));break;default:qe(i)}}catch(s){Re(s)}}}parseElementView(e,n){
2087
+ const r=e.body;_e(r,"ElementView body is not defined");const i=this.getAstNodePath(e);let s=null;if("viewOf"in e){const p=Eo(e.viewOf),m=p&&this.resolveFqn(p);m?s=m:st.warn("viewOf is not resolved: "+e.$cstNode?.text)}let o=e.name;o||(o="view_"+bd(this.doc.uri.toString(),i,s??""));const a=Xr(r.props.find(p=>p.key==="title")?.value)??null,u=mt(r.props.find(p=>p.key==="description")?.value)??null,c=this.convertTags(r),l=this.convertLinks(r),f=hw(e),d={__:"element",id:o,astPath:i,title:a,description:u,
2088
+ tags:c,links:Un(l)?l:null,rules:[...n,...r.rules.flatMap(p=>{try{return this.isValid(p)?this.parseViewRule(p):[]}catch(m){return Re(m),[]}})],...s&&{viewOf:s},...f&&{manualLayout:f}};if(Bh.writeId(e,d.id),"extends"in e){const p=e.extends.view.ref;return _e(p?.name,"view extends is not resolved: "+e.$cstNode?.text),Object.assign(d,{extends:p.name})}return d}parseViewRule(e){if(zl(e))return this.parseViewRulePredicate(e);if(yv(e))return this.parseViewRuleGlobalPredicateRef(e);if(Vy(e))return this.
2089
+ parseViewRuleStyleOrGlobalRef(e);if(ql(e))return nw(e);if(wh(e))return this.parseViewRuleGroup(e);qe(e)}parseViewRulePredicate(e){const n=[];let r=e.exprs;for(;r;){const{value:i,prev:s}=r;try{if(ce(i)&&this.isValid(i)){const o=this.parsePredicate(i);n.unshift(o)}}catch(o){Re(o)}if(!s)break;r=s}return e.isInclude?{include:n}:{exclude:n}}parseViewRuleGlobalPredicateRef(e){return{predicateId:e.predicate.$refText}}parseViewRuleStyleOrGlobalRef(e){if(ka(e))return this.parseViewRuleStyle(e);if(vv(e))return this.
2090
+ parseViewRuleGlobalStyle(e);qe(e)}parseViewRuleGroup(e){const n=[];for(const r of e.groupRules)try{if(!this.isValid(r))continue;if(zl(r)){n.push(this.parseViewRulePredicate(r));continue}if(wh(r)){n.push(this.parseViewRuleGroup(r));continue}qe(r)}catch(i){Re(i)}return{title:Xr(e.title)??null,groupRules:n,...this.parseStyleProps(e.props)}}parseViewRuleStyle(e){const n=e.props.filter(Ky),r=e.target,i=e.props.find(ga);return this.parseRuleStyle(n,r,i)}parseRuleStyle(e,n,r){const i=this.parseStyleProps(
2091
+ e),s=mt(r?.value);return{targets:this.parseFqnExpressions(n).filter(o=>O_.Expression.isFqnExpr(o)),...s&&{notation:s},style:{...i}}}parseViewRuleGlobalStyle(e){return{styleId:e.style.$refText}}parseDynamicElementView(e,n){const r=e.body;_e(r,"DynamicElementView body is not defined");const i=this.isValid,s=r.props.filter(i),o=this.getAstNodePath(e);let a=e.name;a||(a="dynamic_"+bd(this.doc.uri.toString(),o));const u=Xr(s.find(p=>p.key==="title")?.value)??null,c=mt(s.find(p=>p.key==="description")?.
2092
+ value)??null,l=this.convertTags(r),f=this.convertLinks(r);Bh.writeId(e,a);const d=hw(e);return{__:"dynamic",id:a,astPath:o,title:u,description:c,tags:l,links:Un(f)?f:null,rules:[...n,...r.rules.flatMap(p=>{try{return i(p)?this.parseDynamicViewRule(p):[]}catch(m){return Re(m),[]}},[])],steps:r.steps.reduce((p,m)=>{try{i(m)&&(Jy(m)?p.push(this.parseDynamicParallelSteps(m)):p.push(this.parseDynamicStep(m)))}catch(v){Re(v)}return p},[]),...d&&{manualLayout:d}}}parseDynamicViewRule(e){if(lC(e))return this.
2093
+ parseDynamicViewIncludePredicate(e);if(cC(e))return this.parseViewRuleGlobalPredicateRef(e);if(Vy(e))return this.parseViewRuleStyleOrGlobalRef(e);if(ql(e))return nw(e);qe(e)}parseDynamicViewIncludePredicate(e){const n=[];let r=e.exprs;for(;r;){try{if(Tn(r.value)&&this.isValid(r.value)&&QT(r.value)){const i=this.parseElementPredicate(r.value);n.unshift(i)}}catch(i){Re(i)}r=r.prev}return{include:n}}parseDynamicParallelSteps(e){return{__parallel:e.steps.map(n=>this.parseDynamicStep(n))}}parseDynamicStep(e){
2094
+ const n=Eo(e.source);if(!n)throw new Error("Invalid reference to source");const r=Eo(e.target);if(!r)throw new Error("Invalid reference to target");let i=this.resolveFqn(n),s=this.resolveFqn(r);const o=mt(e.title)??null;let a={source:i,target:s,title:o};if(e.isBackward&&(a={source:s,target:i,title:o,isBackward:!0}),!OR(e.custom?.props))return a;for(const u of e.custom.props)try{switch(!0){case _l(u):{const c=u.value.view.ref?.name;ce(c)&&(a.navigateTo=c);break}case xl(u):case ga(u):case EC(u):{cn(
2095
+ u.value)&&(a[u.key]=mt(u.value)??"");break}case zc(u):{cn(u.value)&&(a[u.key]=u.value);break}case ao(u):{const c=wd(u);cn(c)&&(a[u.key]=c);break}case gl(u):{cn(u.value)&&(a[u.key]=u.value);break}default:qe(u)}}catch(c){Re(c)}return a}}}const c9=He(s5,e9,n9,s9,a5,Z5,o9,a9,u9,t9);class l9 extends c9{}const FS=st.getChild("ModelParser");class d9{constructor(e){this.services=e,e.shared.workspace.DocumentBuilder.onDocumentPhase(je.Linked,n=>{try{id(n.uri)||this.cachedParsers.set(n,this.createParser(n))}catch(r){
2096
+ FS.warn(yr(r))}}),e.shared.workspace.DocumentBuilder.onDocumentPhase(je.Validated,n=>{n.diagnostics?.some(r=>r.severity===Os.Error)&&this.cachedParsers.delete(n)})}cachedParsers=new Qw(e=>this.createParser(e));documents(e){return this.services.shared.workspace.LangiumDocuments.projectDocuments(e).map(n=>this.parse(n))}parse(e){try{return this.forDocument(e).doc}catch(n){throw new Error(`Error parsing document ${e.uri.toString()}`,{cause:n})}}forDocument(e){return e.state<je.Linked&&FS.warn(`Docu\
2097
+ ment ${e.uri.toString()} is not linked`),this.cachedParsers.get(e)}createParser(e){const n={c4Specification:{tags:new Set,elements:{},relationships:{},colors:{},deployments:{}},c4Elements:[],c4ExtendElements:[],c4ExtendDeployments:[],c4Relations:[],c4Deployments:[],c4DeploymentRelations:[],c4Globals:{predicates:{},dynamicPredicates:{},styles:{}},c4Views:[],c4Imports:new xn(Set)};e=Object.assign(e,n);const r=new l9(this.services,e);return r.parseSpecification(),r.parseImports(),r.parseModel(),r.parseGlobals(),
2098
+ r.parseDeployment(),r.parseViews(),r}}const{findNodeForKeyword:f9}=Gm,p9=(t,e,n=0)=>{const r=n>0?" ".repeat(n):"";return[r+`style ${t} {`,...ec(e).map(([i,s])=>r+` ${i} ${i==="opacity"?s.toString()+"%":s}`),r+"}"]},h9=(t,e)=>n=>{if(!ka(n))return!1;const r=n.target.value;if(!r||ce(n.target.prev)||r.$type!=="FqnRefExpr"||!H6(r.ref))return!1;const i=r.el.ref;return(i?e.getFqn(i):null)===t};function m9(t,{view:e,viewAst:n,targets:r,style:i}){_e(n.body,`View ${e.id} has no body`);const s=n.$cstNode;
2099
+ _e(s,"viewCstNode");const o=Qu(n.body.rules)?.$cstNode?.range.end??n.body.$cstNode?.range.end;_e(o,"insertPos is not defined");const a=s.range.start.character+2,u=t.likec4.FqnIndex,c=ze(n.body.rules,ka),l=e.__==="element"?e.viewOf:null,f=[],d=[];r.forEach(w=>{const y=BR(c,h9(w,u)),E=l&&Kh(l,w)?w.substring(l.length+1):w;y?f.push({fqn:E,rule:y}):d.push({fqn:E})});const p={start:o,end:o},m=w=>{w.start.line<=p.start.line&&(w.start.line==p.start.line?p.start.character=Math.min(w.start.character,p.start.
2100
+ character):p.start=w.start),w.end.line>=p.end.line&&(w.end.line==p.end.line?p.end.character=Math.max(w.end.character,p.end.character):p.end=w.end)},v=[];if(d.length>0){const w=d.flatMap(({fqn:y})=>p9(y,i,a));v.push(Bn.insert(o,`
2101
+ `+w.join(`
2102
+ `))),p.start={line:o.line+1,character:a},p.end={line:o.line+w.length,character:Qu(w)?.length??0}}if(f.length>0)for(const{rule:w}of f){const y=w.$cstNode;_e(y,"RuleCstNode not found");for(const[E,R]of ec(i)){const A=E==="opacity"?R.toString()+"%":R,N=w.props.find(ie=>ie.key===E);if(N&&N.$cstNode){const{range:{start:ie,end:we}}=N.$cstNode;m({start:ie,end:we}),v.push(Bn.replace({start:ie,end:we},E+" "+A));continue}const V=f9(y,"{")?.range.end;_e(V,"Opening brace not found");const J=" ".repeat(2+y.range.
2103
+ start.character),se=J+E+" "+A;v.push(Bn.insert(V,`
2104
+ `+se)),m({start:{line:V.line+1,character:J.length},end:{line:V.line+1,character:se.length}})}}return{modifiedRange:p,edits:v}}const{findNodeForKeyword:g9}=Gm;function y9(t,{view:e,viewAst:n,layout:r}){_e(n.body,`View ${e.id} has no body`);const i=n.$cstNode;_e(i,"viewCstNode");const s=_6(r.direction),o=BR(n.body.rules,ql);let a=`autoLayout ${s}`;if(up(r.rankSep)&&(a+=` ${r.rankSep}`,up(r.nodeSep)&&(a+=` ${r.nodeSep}`)),o&&o.$cstNode)return Bn.replace(o.$cstNode.range,a);const u=g9(n.body.$cstNode,
2105
+ "}")?.range.start;_e(u,"Closing brace not found");const c=` ${a}
2106
+ `;return Bn.insert(u,c)}function v9(t,e=1,n={}){const{indent:r=" ",includeEmptyLines:i=!1}=n;if(typeof t!="string")throw new TypeError(`Expected \`input\` to be a \`string\`, got \`${typeof t}\``);if(typeof e!="number")throw new TypeError(`Expected \`count\` to be a \`number\`, got \`${typeof e}\``);if(e<0)throw new RangeError(`Expected \`count\` to be at least 0, got \`${e}\``);if(typeof r!="string")throw new TypeError(`Expected \`options.indent\` to be a \`string\`, got \`${typeof r}\``);if(e===
2107
+ 0)return t;const s=i?/^/gm:/^(?!\s*$)/gm;return t.replace(s,r.repeat(e))}function w9(t,{viewAst:e,layout:n}){_e(e.$cstNode,"invalid view.$cstNode");const r=mm(e.$cstNode,["BLOCK_COMMENT"]);let i=J5(n);return e.$cstNode.range.start.character>0&&(i=v9(i,e.$cstNode.range.start.character)),r?Bn.replace(r.range,i.trimStart()):Bn.insert({line:e.$cstNode.range.start.line,character:0},i+`
2108
+ `)}class b9{constructor(e){this.services=e,this.locator=e.likec4.ModelLocator}locator;async applyChange(e){const n=this.services.shared.lsp.Connection;_e(n,"LSP Connection not available");let r=null;try{await this.services.shared.workspace.WorkspaceLock.write(async()=>{const{doc:i,edits:s,modifiedRange:o}=this.convertToTextEdit(e),a={uri:i.textDocument.uri,version:i.textDocument.version};if(!s.length)return;const u=await n.workspace.applyEdit({label:`LikeC4 - change view ${e.viewId}`,edit:{changes:{
2109
+ [a.uri]:s}}});if(!u.applied){n.window.showErrorMessage(`Failed to apply changes ${u.failureReason}`);return}r={uri:a.uri,range:o}})}catch(i){bn.error(`Failed to apply change ${e.change.op} ${e.viewId}`,{error:i})}return r}convertToTextEdit({viewId:e,projectId:n,change:r}){const i=this.locator.locateViewAst(e,n);if(!i)throw new Error(`LikeC4ModelChanges: view not found: ${e}`);switch(r.op){case"change-element-style":return{doc:i.doc,...m9(this.services,{...i,targets:r.targets,style:r.style})};case"\
2110
+ change-autolayout":{const o=y9(this.services,{...i,layout:r.layout});return{doc:i.doc,modifiedRange:o.range,edits:[o]}}case"save-manual-layout":const s=w9(this.services,{...i,layout:r.layout});return{doc:i.doc,modifiedRange:s.range,edits:[s]};default:qe(r)}}}class E9 extends rR{constructor(e){super(),this.services=e}getNameStrict(e){return It(this.getName(e),`Failed getName for ${this.services.workspace.AstNodeLocator.getAstNodePath(e)}`)}getName(e){if(tp(e))return e.name;if(Kr(e))return e.imported.
2111
+ $refText;if(Qn(e))return e.target.modelElement.value.$refText}getNameNode(e){if(tp(e))return super.getNameNode(e);if(Kr(e))return e.imported.$refNode;if(Qn(e))return e.target.modelElement.value.$refNode}}function $9(t){return He(t,Qo(e=>`${e.type}.${e.name}`),ec(),Hr(([e,n])=>n.length===1?n:[]))}class D9 extends sR{constructor(e){super(e)}async computeExports(e,n){const r=[];try{const{specifications:i,models:s,views:o,globals:a,likec4lib:u,deployments:c,imports:l}=e.parseResult.value;this.exportLibrary(
2112
+ u,r,e),this.exportSpecification(i,r,e),this.exportModel(s,r,e),this.exportViews(o,r,e),this.exportGlobals(a,r,e),this.exportDeployments(c,r,e)}catch(i){Re(i)}return r}exportViews(e,n,r){const i=e?.flatMap(s=>s.views);if(!(Rt(i)||i.length===0))for(const s of i)try{ce(s.name)&&n.push(this.descriptions.createDescription(s,s.name,r))}catch(o){Re(o)}}exportGlobals(e,n,r){if(!(Rt(e)||e.length===0)){for(const i of e.flatMap(s=>s.predicates))try{const s=i;ce(s.name)&&n.push(this.descriptions.createDescription(
2113
+ s,s.name,r))}catch(s){Re(s)}for(const i of e.flatMap(s=>s.styles))try{const s=i.id;ce(s.name)&&n.push(this.descriptions.createDescription(s,s.name,r))}catch(s){Re(s)}}}exportModel(e,n,r){if(!(Rt(e)||e.length===0))for(const i of e.flatMap(s=>s.elements))try{hn(i)&&ce(i.name)&&n.push(this.descriptions.createDescription(i,i.name,r))}catch(s){Re(s)}}exportLibrary(e,n,r){if(!Rt(e))try{for(const i of e.flatMap(s=>s.icons))n.push(this.descriptions.createDescription(i,i.name,r))}catch(i){Re(i)}}exportSpecification(e,n,r){
2114
+ if(!(Rt(e)||e.length===0))for(const i of e.flatMap(s=>[...s.elements,...s.relationships,...s.deploymentNodes,...s.tags,...s.colors]))try{switch(!0){case va(i):case ba(i):{ce(i.kind.name)&&n.push(this.descriptions.createDescription(i.kind,i.kind.name,r));continue}case mh(i):{ce(i.tag.name)&&n.push(this.descriptions.createDescription(i.tag,"#"+i.tag.name,r));continue}case $a(i):{ce(i.kind.name)&&n.push(this.descriptions.createDescription(i.kind,i.kind.name,r),this.descriptions.createDescription(i.
2115
+ kind,"."+i.kind.name,r));continue}case hh(i):{ce(i.name.name)&&n.push(this.descriptions.createDescription(i.name,i.name.name,r));continue}default:qe(i)}}catch(s){Re(s)}}exportDeployments(e,n,r){const i=e?.flatMap(s=>s.elements);if(!(Rt(i)||i.length===0))for(const s of i)try{qn(s)&&ce(s.name)&&n.push(this.descriptions.createDescription(s,s.name,r))}catch(o){Re(o)}}computeLocalScopes(e,n){return new Promise(r=>{const i=e.parseResult.value,s=[],o=new qs;for(const a of i.models)try{s.push(...this.processContainer(
2116
+ a,o,e))}catch(u){Re(u)}for(const a of i.deployments)try{s.push(...this.processDeployments(a,o,e))}catch(u){Re(u)}for(const a of i.imports.flatMap(u=>u.imports))try{let u=a;for(;u;)s.push(this.descriptions.createDescription(u,u.imported.$refText,e)),u=u.prev}catch(u){Re(u)}$9(s).forEach(a=>{o.add(i,a)}),r(o)})}processContainer(e,n,r){const i=new qs,s=[];for(const a of e.elements){if(_i(a))continue;let u;if(hn(a)?(ce(a.name)&&i.add(a.name,this.descriptions.createDescription(a,a.name,r)),u=a.body,u&&
2117
+ (n.add(u,this.descriptions.createDescription(a,"this",r)),n.add(u,this.descriptions.createDescription(a,"it",r)))):ua(a)&&(u=a.body),u&&u.elements.length>0)try{s.push(...this.processContainer(u,n,r))}catch(c){Re(c)}}s.length&&He(s,ze(a=>!i.has(a.name)),Qo(a=>a.name),FR((a,u)=>{a.length===1&&i.add(u,a[0])}));const o=[...i.values()];return n.addAll(e,o),o}processDeployments(e,n,r){const i=new qs,s=[];for(const a of e.elements){if(Ci(a))continue;let u=a.body;if(!co(a)){let c=this.nameProvider.getName(
2118
+ a);if(ce(c)){const l=this.descriptions.createDescription(a,c,r);i.add(c,l)}u&&(n.add(u,this.descriptions.createDescription(a,"this",r)),n.add(u,this.descriptions.createDescription(a,"it",r)))}if(u)try{s.push(...this.processDeployments(u,n,r))}catch(c){Re(c)}}s.length&&He(s,ze(a=>!i.has(a.name)),Qo(a=>a.name),FR((a,u)=>{a.length===1&&i.add(u,a[0])}));const o=[...i.values()];return n.addAll(e,o),o}}const{getDocument:LS}=xo;class R9 extends uR{deploymentsIndex;fqnIndex;indexManager;constructor(e){super(
2119
+ e),this.indexManager=e.shared.workspace.IndexManager,this.fqnIndex=e.likec4.FqnIndex,this.deploymentsIndex=e.likec4.DeploymentsIndex}getScope(e){try{const n=Wt(e.container),r=this.reflection.getReferenceType(e);try{const i=e.container;if(gC(i))return new js(this.streamForFqnRef(n,i,e));if(kC(i))return this.getScopeForStrictFqnRef(n,i,e);if(r!==Zn)return this.getProjectScope(n,r,e);if(Kr(i)){const s=Wt(i);return new js(this.fqnIndex.rootElements(s))}if(pv(i)&&e.property==="el"){const s=i.parent;return s?
2120
+ new js(this.fqnIndex.directChildrenOf(n,$o(s))):this.getProjectScope(n,r,e)}return new js(Xe(this.computeScope(n,e)))}catch(i){return Re(i),this.getProjectScope(n,r,e)}}catch(n){return Re(n),dj}}*genUniqueDescedants(e){const n=e();if(!n)return;const r=Wt(n);if(hn(n)){const i=this.fqnIndex.getFqn(n);yield*this.fqnIndex.uniqueDescedants(r,i);return}if(qn(n)){const i=this.deploymentsIndex.getFqn(n);yield*this.deploymentsIndex.uniqueDescedants(r,i)}}*genScopeExtendElement({element:e}){e.el.$nodeDescription&&
2121
+ (yield e.el.$nodeDescription),yield*this.genUniqueDescedants(()=>Eo(e))}*genScopeElementView({viewOf:e,extends:n}){if(e){e.modelElement.value.$nodeDescription&&(yield e.modelElement.value.$nodeDescription),yield*this.genUniqueDescedants(()=>Eo(e));return}if(n){const r=n.view.ref;r&&(yield*this.genScopeElementView(r))}}getScopeForStrictFqnRef(e,n,r){const i=n.parent;return i?new js(this.deploymentsIndex.directChildrenOf(e,$o(i)).filter(s=>this.reflection.isSubtype(s.type,Tr))):this.getProjectScope(
2122
+ e,Tr,r)}*genScopeExtendDeployment({deploymentNode:e}){e.value.$nodeDescription&&(yield e.value.$nodeDescription),yield*this.genUniqueDescedants(()=>{const n=e.value.ref;return n&&qn(n)?n:void 0})}streamForFqnRef(e,n,r){const i=n.parent;if(!i)return Xe(this.genScopeForParentlessFqnRef(e,n,r));const s=i.value.ref;return s?Kr(s)?Xe(this.genUniqueDescedants(()=>s.imported.ref)):qn(s)?Xe(this.genUniqueDescedants(()=>s)):Qn(s)?Xe(this.genUniqueDescedants(()=>{const o=s.target.modelElement.value.ref;return Kr(
2123
+ o)?o.imported.ref:hn(o)?o:void 0})):hn(s)?Xe(this.genUniqueDescedants(()=>s)):qe(s):ja}*genScopeForParentlessFqnRef(e,n,r){Mr(n,ev)||x6(n)?yield*this.computeScope(e,r,Zn):P6(n)?(yield*this.computeScope(e,r,Zn),yield*this.computeScope(e,r,Tr),yield*this.computeScope(e,r,ki)):(yield*this.computeScope(e,r,Tr),yield*this.computeScope(e,r,ki),Mr(n,Xy)&&(yield*this.computeScope(e,r,Zn)));const i=LS(n).precomputedScopes;i&&(yield*i.values().filter(s=>this.reflection.isSubtype(s.type,es)))}*computeScope(e,n,r=this.
2124
+ reflection.getReferenceType(n)){const i=this.reflection.isSubtype(r,Zn),s=this.reflection.isSubtype(r,mp),o=LS(n.container).precomputedScopes;if(!o){yield*this.getProjectScope(e,r,n).getAllElements();return}const a=c=>this.reflection.isSubtype(c.type,r);let u=n.container;for(;u;){const c=o.get(u).filter(a);c.length>0&&(yield*c),s&&mC(u)&&(yield*this.genScopeExtendDeployment(u.$container)),i&&rv(u)&&(yield*this.genScopeExtendElement(u.$container)),i&&tv(u)&&(yield*this.genScopeElementView(u.$container)),
2125
+ u=u.$container}yield*this.getProjectScope(e,r,n).getAllElements()}getProjectScope(e,n,r){return n===Si?super.getGlobalScope(n,r):this.globalScopeCache.get(`${e}::${n}`,()=>new oR(this.indexManager.projectElements(e,n)))}getGlobalScope(e,n){if(e===Si)return super.getGlobalScope(e,n);const r=Wt(n.container);return this.getProjectScope(r,e,n)}}var mw;(t=>{t.type=new Bt.NotificationType("likec4/onDidChangeModel")})(mw||(mw={}));var gw;(t=>{t.req=new Bt.RequestType("likec4/fetchComputedModel")})(gw||
2126
+ (gw={}));var yw;(t=>{t.req=new Bt.RequestType0("likec4/fetchViewsFromAllProjects")})(yw||(yw={}));var vw;(t=>{t.req=new Bt.RequestType("likec4/computeView")})(vw||(vw={}));var ww;(t=>{t.req=new Bt.RequestType("likec4/fetchLayoutedModel")})(ww||(ww={}));var bw;(t=>{t.req=new Bt.RequestType("likec4/layout-view")})(bw||(bw={}));var Ew;(t=>{t.Req=new Bt.RequestType("likec4/validate-layout")})(Ew||(Ew={}));var $w;(t=>{t.req=new Bt.RequestType0("likec4/fetch-projects")})($w||($w={}));var Dw;(t=>{t.Req=
2127
+ new Bt.RequestType("likec4/build")})(Dw||(Dw={}));var Rw;(t=>{t.Req=new Bt.RequestType("likec4/locate")})(Rw||(Rw={}));var kw;(t=>{t.Req=new Bt.RequestType("likec4/change-view")})(kw||(kw={}));var Tw;(t=>{t.req=new Bt.RequestType0("likec4/metrics")})(Tw||(Tw={}));const mr=st.getChild("rpc");class k9 extends ow{constructor(e){super(),this.services=e}init(){const e=this.services.likec4.ModelBuilder,n=this.services.likec4.ModelLocator,r=this.services.likec4.ModelChanges,i=this.services.likec4.Views,
2128
+ s=this.services.shared.lsp.Connection,o=this.services.shared.workspace.ProjectsManager;if(!s){mr.info("[ServerRpc] no connection, not initializing");return}mr.info("[ServerRpc] init");const a=this.services.shared.workspace.LangiumDocuments,u=this.services.shared.workspace.DocumentBuilder,c=S4(()=>{mr.debug`sendNotification ${"onDidChangeModel"}`,s.sendNotification(mw.type,"").catch(d=>(mr.warn(`[ServerRpc] error sending onDidChangeModel: ${d}`),Promise.resolve()))},{triggerAt:"end",minQuietPeriodMs:100,
2129
+ maxBurstDurationMs:500,minGapMs:300});let l=!0;this.onDispose(e.onModelParsed(()=>c.call()),s.onRequest(gw.req,async({projectId:d,cleanCaches:p},m)=>{if(mr.debug`received request ${"fetchComputedModel"} for project ${d}`,p){const w=(d?a.projectDocuments(d):a.all).map(y=>y.uri).toArray();await u.update(w,[],m)}const v=await e.buildLikeC4Model(d,m);return v!==bs.EMPTY?{model:v.$model}:{model:null}}),s.onRequest(vw.req,async({viewId:d,projectId:p},m)=>({view:await e.computeView(d,p,m)})),s.onRequest(
2130
+ ww.req,async({projectId:d},p)=>{const m=await e.parseModel(d,p);if(m===null)return{model:null};const v=await i.diagrams(d,p);return{model:{...m,__:"layouted",views:Zu(v,w=>w.id)}}}),s.onRequest(bw.req,async({viewId:d,projectId:p},m)=>(mr.debug`received request ${"layoutView"} of ${d} from project ${p}`,{result:await i.layoutView(d,p,m)})),s.onRequest(Ew.Req,async({projectId:d},p)=>{const m=await i.layoutAllViews(d,p);return{result:f(m.map(v=>v.diagram))}}),s.onRequest($w.req,async d=>{mr.debug`received request ${"\
2131
+ FetchProjects"}`;const p=a.groupedByProject();return{projects:Jo(p,m=>xt(m,v=>v.uri.toString()))}}),s.onRequest(yw.req,async d=>{mr.debug`received request ${"FetchViewsFromAllProjects"}`;const p=o.all.map(async v=>{const w=await i.computedViews(v,d);return He(w,xt(y=>({id:y.id,title:y.title??y.id,projectId:v})),IR((y,E)=>y.id==="index"?-1:E.id==="index"?1:y.title.localeCompare(E.title)))}),m=await Promise.allSettled(p);return await jt(d),{views:He(m,ze(v=>v.status==="fulfilled"),Hr(v=>v.value))}}),
2132
+ s.onRequest(Dw.Req,async({docs:d},p)=>{const m=d.map(y=>yt.parse(y)),v=y=>m.every(E=>!ht.equals(E,y)),w=a.allExcludingBuiltin.toArray().filter(y=>v(y.uri)).map(y=>y.uri);mr.debug(`[ServerRpc] received request to build:
2133
+ changed (total ${m.length}):${d.map(y=>`
2134
+ - `+y).join("")}
2135
+ deleted (total ${w.length}):${w.map(y=>`
2136
+ - `+y.toString()).join(`
2137
+ `)}`),!l&&m.length+w.length>0&&await Promise.allSettled([...m,...w].map(async y=>{const E=y.toString();mr.debug(`clear diagnostics for ${E}`);try{await s.sendDiagnostics({uri:E,diagnostics:[]})}catch(R){mr.warn(`error clearing diagnostics for ${E}: ${R}`)}})),l=!1,await jt(p),await u.update(m,w,p)}),s.onRequest(Rw.Req,d=>{switch(!0){case"element"in d:return n.locateElement(d.element,d.projectId);case"relation"in d:return n.locateRelation(d.relation,d.projectId);case"view"in d:return n.locateView(
2138
+ d.view,d.projectId);case"deployment"in d:return n.locateDeploymentElement(d.deployment,d.projectId);default:qe(d)}}),s.onRequest(kw.Req,async(d,p)=>(mr.debug`received request ${"changeView"} of ${d.viewId} from project ${d.projectId}`,await r.applyChange(d))),s.onRequest(Tw.req,async d=>{const p=[...o.all].map(async w=>{const y=await e.buildLikeC4Model(w,d);return y===bs.EMPTY?Promise.reject(new Error("Model is empty")):{elementKinds:Ju(y.$model.specification.elements).length,relationshipKinds:Ju(
2139
+ y.$model.specification.relationships).length,tags:y.$model.specification.tags.length,elements:Ju(y.$model.elements).length,relationships:Ju(y.$model.relations).length,views:Ju(y.$model.views).length,projects:1}}),m=await Promise.allSettled(p);await jt(d);const v=m.filter(w=>w.status==="fulfilled").map(w=>w.value);return{metrics:v.length>0?v.reduce((w,y)=>({elementKinds:w.elementKinds+y.elementKinds,relationshipKinds:w.relationshipKinds+y.relationshipKinds,tags:w.tags+y.tags,elements:w.elements+y.
2140
+ elements,relationships:w.relationships+y.relationships,views:w.views+y.views,projects:w.projects+1})):null}}),Gs.create(()=>{c.cancel()}));function f(d){return He(d,ze(p=>!!p.hasLayoutDrift),xt(p=>({uri:n.locateView(p.id).uri,viewId:p.id,severity:ge.DiagnosticSeverity.Warning,message:`Layout drift detected for view '${p.id}'`,range:n.locateView(p.id).range})))}}}class T9{constructor(e){this.services=e}getSymbolKind(e){const n=kt(e)?e.$type:e.type,r=(...i)=>i.some(s=>this.services.AstReflection.isSubtype(
2141
+ n,s));switch(!0){case r(Zn,lo,Tr,ki,es):return Dr.Constructor;case r(pa,ma,ha,da,Da):return Dr.Namespace;case r(oo):return Dr.Class;case r(ns,Si,uo,Ra):return Dr.EnumMember;case r(ts,Ea):return Dr.Event;case r(Ai,Ti,wa,ya):return Dr.TypeParameter}return Dr.Field}getCompletionItemKind(e){const n=kt(e)?e.$type:e.type,r=(...i)=>i.some(s=>this.services.AstReflection.isSubtype(n,s));switch(!0){case r(uo):return Ct.Color;case r(Zn,Tr,ki,lo,es):return Ct.Constructor;case r(pa,ma,ha,da,Da):return Ct.Module;case r(
2142
+ oo):return Ct.Class;case r(ns,Si,uo,Ra):return Ct.EnumMember;case r(ts,Ea):return Ct.Event;case r(Ai,wa,Ti,ya):return Ct.TypeParameter;default:return Ct.Reference}}}class C9 extends bT{}const Na=st.getChild("Views");class A9{constructor(e){this.services=e,this.ModelBuilder=e.likec4.ModelBuilder}cache=new WeakMap;viewsWithReportedErrors=new Set;ModelBuilder;get layouter(){return this.services.likec4.Layouter}async computedViews(e,n=Bt.CancellationToken.None){const r=await this.ModelBuilder.buildLikeC4Model(
2143
+ e,n);return ap(r.$model.views)}async layoutAllViews(e,n=Bt.CancellationToken.None){const r=await this.computedViews(e,n);if(r.length===0)return[];Na.debug`layoutAll: ${r.length} views`;const i=[],s=[];for(const o of r)this.viewsWithReportedErrors.delete(o.id),s.push(this.layouter.layout(o).then(a=>(this.viewsWithReportedErrors.delete(o.id),this.cache.set(o,a),a)).catch(a=>(this.cache.delete(o),Re(a),Promise.reject(a))));for(const o of await Promise.allSettled(s))o.status==="fulfilled"&&i.push(o.
2144
+ value);return i.length!==r.length?Na.warn`layouted ${i.length} of ${r.length} views`:i.length>0&&Na.debug`layouted all ${i.length} views`,i}async layoutView(e,n,r=Bt.CancellationToken.None){const i=(await this.ModelBuilder.buildLikeC4Model(n,r)).findView(e)?.$view;if(!i)return Na.warn`layoutView ${e} not found`,null;let s=this.cache.get(i);if(s)return Na.debug`layout ${e} from cache`,await Promise.resolve(s);try{const o=performance.now(),a=await this.layouter.layout(i);return this.viewsWithReportedErrors.
2145
+ delete(e),this.cache.set(i,a),Na.debug(`layout {viewId} ready in ${Gh(performance.now()-o)}`,{viewId:e}),a}catch(o){if(!this.viewsWithReportedErrors.has(e)){const a=yr(o);this.services.shared.lsp.Connection?.window.showErrorMessage(`LikeC4: ${a}`),this.viewsWithReportedErrors.add(e),sd(o)}return Promise.reject(o)}}async diagrams(e,n=Bt.CancellationToken.None){return(await this.layoutAllViews(e,n)).map(r=>r.diagram)}async viewsAsGraphvizOut(e,n=Bt.CancellationToken.None){const r="All-LayoutedView\
2146
+ s-DotWithSvg",i=this.services.ValidatedWorkspaceCache;if(i.has(r))return await Promise.resolve(i.get(r));const s=(await this.computedViews(e,n)).map(async u=>{const{dot:c,svg:l}=await this.layouter.svg(u);return{id:u.id,dot:c,svg:l}}),o=[],a=await Promise.allSettled(s);for(const u of a)u.status==="fulfilled"?o.push(u.value):Re(u.reason);return i.set(r,o),o}async overviewGraph(){const e="OverviewGraph",n=this.services.ValidatedWorkspaceCache;if(n.has(e))return await Promise.resolve(n.get(e));const r=await this.
2147
+ computedViews(),i=await this.layouter.layoutOverviewGraph(r);return n.set(e,i),i}}const S9={lsp:{NodeKindProvider:t=>new T9(t),WorkspaceSymbolProvider:t=>new C9(t)},workspace:{IndexManager:t=>new B6(t),LangiumDocuments:t=>new q6(t),ProjectsManager:t=>new jn(t),WorkspaceManager:t=>new j6(t)}};function Nt(t){return e=>new t(e)}const _9={documentation:{DocumentationProvider:Nt(I6)},ValidatedWorkspaceCache:t=>new np(t.shared,je.Validated),Rpc:Nt(k9),likec4:{LanguageServices:Nt(U6),Layouter:t=>(st.debug(
2148
+ "Creating GraphvizLayouter with GraphvizWasmAdapter"),new cS(new Fa)),Views:Nt(A9),DeploymentsIndex:Nt(tH),ModelChanges:Nt(b9),FqnIndex:Nt(yS),ModelParser:Nt(d9),ModelBuilder:Nt(mH),ModelLocator:Nt(vH)},lsp:{CompletionProvider:Nt(X6),DocumentHighlightProvider:Nt(Y6),DocumentSymbolProvider:Nt(Q6),SemanticTokenProvider:Nt(eH),HoverProvider:Nt(Z6),CodeLensProvider:Nt(V6),DocumentLinkProvider:Nt(J6),Formatter:Nt(L6)},workspace:{AstNodeDescriptionProvider:Nt(M6)},references:{NameProvider:Nt(E9),ScopeComputation:Nt(
2149
+ D9),ScopeProvider:Nt(R9)}};function P9(t,e,n,r){const i=x9(t),s=[TG({shared:i}),N8,_9,e,n,r].reduce(MS,{}),o=sp(s);return i.ServiceRegistry.register(o),i5(o),t.connection?o.Rpc.init():i.workspace.ConfigurationProvider.initialized({}),{shared:i,likec4:o}}function x9(t={}){const e={...SR,...t};return sp(AG(e),x8,S9)}function MS(t,e){if(e){for(const[n,r]of Object.entries(e))if(r!==void 0){const i=t[n];i!==null&&r!==null&&typeof i=="object"&&typeof r=="object"?t[n]=MS(i,r):t[n]=r}}return t}const N9=t=>({
2150
+ start:ji.hrtime.bigint(),command:t.map(e=>I9(d_(e))).join(" "),state:{stdout:"",stderr:"",output:""}}),I9=t=>/[^\w./-]/.test(t)?`'${t.replaceAll("'","'\\''")}'`:t,O9=({stdin:t,stdout:e,stderr:n,stdio:r=[t,e,n],env:i,preferLocal:s,cwd:o=".",...a})=>{const u=o instanceof URL?a_(o):Bi.resolve(o),c=i?{...ji.env,...i}:void 0,l=r[0]?.string;return{...a,input:l,stdio:l===void 0?r:["pipe",...r.slice(1)],env:s?F9(c??ji.env,u):c,cwd:u}},F9=({Path:t="",PATH:e=t,...n},r)=>{const i=e.split(Bi.delimiter),s=BS(
2151
+ [],Bi.resolve(r)).map(o=>Bi.join(o,"node_modules/.bin")).filter(o=>!i.includes(o));return{...n,PATH:[...s,e].filter(Boolean).join(Bi.delimiter)}},BS=(t,e)=>t.at(-1)===e?t:BS([...t,e],Bi.resolve(e,"..")),L9=async(t,e,n)=>await M9(t,n)?[Cw(t),e.map(r=>G9(r)),{...n,shell:!0}]:[t,e,n],M9=async(t,{shell:e,cwd:n,env:r=ji.env})=>ji.platform==="win32"&&!e&&!await B9(t,n,r),B9=async(t,e,{Path:n="",PATH:r=n})=>qS.some(i=>t.toLowerCase().endsWith(i))||(q9[`${t}\0${e}\0${r}`]??=await j9(t,e,r)),q9={},j9=async(t,e,n)=>{
2152
+ const r=n.split(Bi.delimiter).filter(Boolean).map(i=>i.replace(/^"(.*)"$/,"$1"));try{await Promise.all(qS.flatMap(i=>[e,...r].map(s=>`${Bi.resolve(s,t)}${i}`)).map(async i=>{try{await K_(i)}catch{return}throw 0}))}catch{return!0}return!1},qS=[".exe",".com"],G9=t=>Cw(Cw(`"${t.replaceAll(/(\\*)"/g,'$1$1\\"').replace(/(\\*)$/,"$1$1")}"`)),Cw=t=>t.replaceAll(/([()\][%!^"`<>&|;, *?])/g,"^$1"),U9=async(t,{input:e},n)=>{const r=await t;e!==void 0&&r.stdin.end(e);const i=eb(r,"close");try{return await Promise.
2153
+ race([i,...r.stdio.filter(Boolean).map(s=>W9(s))]),z9(n,GS(r)),US(n)}catch(s){throw await Promise.allSettled([i]),jS(s,r,n)}},W9=async t=>{for await(const[e]of H_(t,"error"))if(!["ERR_STREAM_PREMATURE_CLOSE","EPIPE"].includes(e?.code))throw e},z9=({command:t},{exitCode:e,signalName:n})=>{if(n!==void 0)throw new Ro(`Command was terminated with ${n}: ${t}`);if(e!==void 0)throw new Ro(`Command failed with exit code ${e}: ${t}`)},jS=(t,e,n)=>Object.assign(H9(t,n),GS(e),US(n)),H9=(t,{command:e})=>t instanceof
2154
+ Ro?t:new Ro(`Command failed: ${e}`,{cause:t});class Ro extends Error{name="SubprocessError"}const GS=({exitCode:t,signalCode:e})=>({...t<1?{}:{exitCode:t},...e===null?{}:{signalName:e}}),US=({state:{stdout:t,stderr:e,output:n},command:r,start:i})=>({stdout:Aw(t),stderr:Aw(e),output:Aw(n),command:r,durationMs:Number(ji.hrtime.bigint()-i)/1e6}),Aw=t=>t.at(-1)===`
2155
+ `?t.slice(0,t.at(-2)==="\r"?-2:-1):t,K9=async(t,e,n,r)=>{try{[t,e]=["node","node.exe"].includes(t.toLowerCase())?[ji.execPath,[...ji.execArgv.filter(s=>!s.startsWith("--inspect")),...e]]:[t,e];const i=z_(...await L9(t,e,n));return WS(i.stdout,r,"stdout"),WS(i.stderr,r,"stderr"),i.once("error",()=>{}),await eb(i,"spawn"),i}catch(i){throw jS(i,{},r)}},WS=(t,{state:e},n)=>{t&&(t.setEncoding("utf8"),e.isIterating||(e.isIterating=!1,t.on("data",r=>{e[n]+=r,e.output+=r})))},V9=async t=>{const[[e,n]]=await Promise.
2156
+ all([Promise.allSettled(t),X9(t)]);if(n.reason)throw n.reason.pipedFrom=e.reason??e.value,n.reason;if(e.reason)throw e.reason;return{...n.value,pipedFrom:e.value}},X9=async t=>{try{const[{stdout:e},{stdin:n}]=await Promise.all(t.map(({nodeChildProcess:r})=>r));if(n===null)throw new Error('The "stdin" option must be set on the first "spawn()" call in the pipeline.');if(e===null)throw new Error('The "stdout" option must be set on the last "spawn()" call in the pipeline.');V_(e,n).catch(()=>{})}catch(e){
2157
+ throw await Promise.allSettled(t.map(({nodeChildProcess:n})=>Y9(n))),e}},Y9=async t=>{const{stdin:e}=await t;e.end()},zS=async function*(t,{state:e},n){if(e.isIterating===!1)throw new Error(`The subprocess must be iterated right away, for example:
2158
+ for await (const line of spawn(...)) { ... }`);e.isIterating=!0;try{const{[n]:r}=await t.nodeChildProcess;if(!r)return;let i="";for await(const s of r.iterator({destroyOnReturn:!1})){const o=`${i}${s}`.split(/\r?\n/);i=o.pop(),yield*o}i&&(yield i)}finally{await t}},J9=async function*(...t){try{let e=[];for(;t.length>0;){e=t.map((o,a)=>e[a]??Q9(o));const[{value:n,done:r},i]=await Promise.race(e.map((o,a)=>Promise.all([o,a]))),[s]=t.splice(i,1);e.splice(i,1),r||(t.push(s),yield n)}}finally{await Promise.
2159
+ all(t.map(e=>e.return()))}},Q9=async t=>{try{return await t.next()}catch(e){await t.throw(e)}};function kd(t,e,n,r){const[i=[],s={}]=Array.isArray(e)?[e,n]:[[],e],o=N9([t,...i]),a=O9(s),u=K9(t,i,a,o);let c=U9(u,a,o);Object.assign(c,{nodeChildProcess:u}),c=r?V9([r,c]):c;const l=zS(c,o,"stdout"),f=zS(c,o,"stderr");return Object.assign(c,{nodeChildProcess:u,stdout:l,stderr:f,[Symbol.asyncIterator]:()=>J9(l,f),pipe:(d,p,m)=>kd(d,p,m,c)})}var Pr={},ko={},HS;function Z9(){if(HS)return ko;HS=1,Object.defineProperty(
2160
+ ko,"__esModule",{value:!0}),ko.sync=ko.isexe=void 0;const t=La,e=tb,n=async(o,a={})=>{const{ignoreErrors:u=!1}=a;try{return i(await(0,e.stat)(o),a)}catch(c){const l=c;if(u||l.code==="EACCES")return!1;throw l}};ko.isexe=n;const r=(o,a={})=>{const{ignoreErrors:u=!1}=a;try{return i((0,t.statSync)(o),a)}catch(c){const l=c;if(u||l.code==="EACCES")return!1;throw l}};ko.sync=r;const i=(o,a)=>o.isFile()&&s(o,a),s=(o,a)=>{const u=a.uid??process.getuid?.(),c=a.groups??process.getgroups?.()??[],l=a.gid??process.
2161
+ getgid?.()??c[0];if(u===void 0||l===void 0)throw new Error("cannot get uid or gid");const f=new Set([l,...c]),d=o.mode,p=o.uid,m=o.gid,v=parseInt("100",8),w=parseInt("010",8),y=parseInt("001",8),E=v|w;return!!(d&y||d&w&&f.has(m)||d&v&&p===u||d&E&&u===0)};return ko}var To={},KS;function eK(){if(KS)return To;KS=1,Object.defineProperty(To,"__esModule",{value:!0}),To.sync=To.isexe=void 0;const t=La,e=tb,n=async(o,a={})=>{const{ignoreErrors:u=!1}=a;try{return s(await(0,e.stat)(o),o,a)}catch(c){const l=c;
2162
+ if(u||l.code==="EACCES")return!1;throw l}};To.isexe=n;const r=(o,a={})=>{const{ignoreErrors:u=!1}=a;try{return s((0,t.statSync)(o),o,a)}catch(c){const l=c;if(u||l.code==="EACCES")return!1;throw l}};To.sync=r;const i=(o,a)=>{const{pathExt:u=process.env.PATHEXT||""}=a,c=u.split(";");if(c.indexOf("")!==-1)return!0;for(let l=0;l<c.length;l++){const f=c[l].toLowerCase(),d=o.substring(o.length-f.length).toLowerCase();if(f&&d===f)return!0}return!1},s=(o,a,u)=>o.isFile()&&i(a,u);return To}var Sw={},VS;function tK(){
2163
+ return VS||(VS=1,Object.defineProperty(Sw,"__esModule",{value:!0})),Sw}var XS;function nK(){return XS||(XS=1,function(t){var e=Pr&&Pr.__createBinding||(Object.create?function(c,l,f,d){d===void 0&&(d=f);var p=Object.getOwnPropertyDescriptor(l,f);(!p||("get"in p?!l.__esModule:p.writable||p.configurable))&&(p={enumerable:!0,get:function(){return l[f]}}),Object.defineProperty(c,d,p)}:function(c,l,f,d){d===void 0&&(d=f),c[d]=l[f]}),n=Pr&&Pr.__setModuleDefault||(Object.create?function(c,l){Object.defineProperty(
2164
+ c,"default",{enumerable:!0,value:l})}:function(c,l){c.default=l}),r=Pr&&Pr.__importStar||function(c){if(c&&c.__esModule)return c;var l={};if(c!=null)for(var f in c)f!=="default"&&Object.prototype.hasOwnProperty.call(c,f)&&e(l,c,f);return n(l,c),l},i=Pr&&Pr.__exportStar||function(c,l){for(var f in c)f!=="default"&&!Object.prototype.hasOwnProperty.call(l,f)&&e(l,c,f)};Object.defineProperty(t,"__esModule",{value:!0}),t.sync=t.isexe=t.posix=t.win32=void 0;const s=r(Z9());t.posix=s;const o=r(eK());t.
2165
+ win32=o,i(tK(),t);const u=(process.env._ISEXE_TEST_PLATFORM_||process.platform)==="win32"?o:s;t.isexe=u.isexe,t.sync=u.sync}(Pr)),Pr}var _w,YS;function rK(){if(YS)return _w;YS=1;const{isexe:t,sync:e}=nK(),{join:n,delimiter:r,sep:i,posix:s}=qi,o=process.platform==="win32",a=new RegExp(`[${s.sep}${i===s.sep?"":i}]`.replace(/(\\)/g,"\\$1")),u=new RegExp(`^\\.${a.source}`),c=m=>Object.assign(new Error(`not found: ${m}`),{code:"ENOENT"}),l=(m,{path:v=process.env.PATH,pathExt:w=process.env.PATHEXT,delimiter:y=r})=>{
2166
+ const E=m.match(a)?[""]:[...o?[process.cwd()]:[],...(v||"").split(y)];if(o){const R=w||[".EXE",".CMD",".BAT",".COM"].join(y),A=R.split(y).flatMap(N=>[N,N.toLowerCase()]);return m.includes(".")&&A[0]!==""&&A.unshift(""),{pathEnv:E,pathExt:A,pathExtExe:R}}return{pathEnv:E,pathExt:[""]}},f=(m,v)=>{const w=/^".*"$/.test(m)?m.slice(1,-1):m;return(!w&&u.test(v)?v.slice(0,2):"")+n(w,v)},d=async(m,v={})=>{const{pathEnv:w,pathExt:y,pathExtExe:E}=l(m,v),R=[];for(const A of w){const N=f(A,m);for(const V of y){
2167
+ const J=N+V;if(await t(J,{pathExt:E,ignoreErrors:!0})){if(!v.all)return J;R.push(J)}}}if(v.all&&R.length)return R;if(v.nothrow)return null;throw c(m)},p=(m,v={})=>{const{pathEnv:w,pathExt:y,pathExtExe:E}=l(m,v),R=[];for(const A of w){const N=f(A,m);for(const V of y){const J=N+V;if(e(J,{pathExt:E,ignoreErrors:!0})){if(!v.all)return J;R.push(J)}}}if(v.all&&R.length)return R;if(v.nothrow)return null;throw c(m)};return _w=d,d.sync=p,_w}var iK=rK();const JS=Jr(iK),Pw=lS(Math.max(1,X_.cpus().length));
2168
+ class sK{dotpath;unflattenpath;constructor(e){this.dotpath=e||JS.sync("dot"),this.unflattenpath=JS.sync("unflatten")}async unflatten(e){return await Pw(async()=>{const n=bn.getChild("graphviz-binary");let r;try{const i=await kd(this.unflattenpath,["-l 1","-c 3"],{timeout:1e4,stdin:{string:e}});r=i.stdout,Gt(i.stderr)||n.warn`Command ${i.command} has stderr:\n${i.stderr}`}catch(i){n.error("FAILED GraphvizBinaryAdapter.unflatten",{error:i}),i instanceof Ro&&!Gt(i.stdout)&&(n.warn`Command: '${i.command}' returned result but also failed (exitcode ${i.
2169
+ exitCode}): "${i.stderr}"`,r=i.stdout)}return r&&(e=r.replaceAll(/\t\[/g," [").replaceAll(/\t/g," ")),e})}async layoutJson(e){return await Pw(async()=>{const n=bn.getChild("graphviz-binary");let r;try{const i=await kd(this.dotpath,["-Tjson","-y"],{timeout:1e4,stdin:{string:e}});r=i.stdout,Gt(i.stderr)||n.warn`Command ${i.command} has stderr:\n${i.stderr}`}catch(i){if(n.error("FAILED GraphvizBinaryAdapter.layoutJson",{error:i}),n.warn(`FAILED DOT:
2170
+ ${e}`),i instanceof Ro&&!Gt(i.stdout))n.warn(`Command: '${i.command}' returned result but also failed (exitcode ${i.exitCode}): "${i.stderr}"`),r=i.stdout;else throw i}return r})}async acyclic(e){return Promise.reject(new Error("Method not implemented."))}async svg(e){return await Pw(async()=>{const n=bn.getChild("graphviz-binary");let r;try{const i=await kd(this.dotpath,["-Tsvg","-y"],{timeout:1e4,stdin:{string:e}});r=i.stdout,Gt(i.stderr)||n.warn`Command ${i.command} has stderr:\n${i.stderr}`}catch(i){
2171
+ if(n.error("FAILED GraphvizBinaryAdapter.svg",{error:i}),n.warn(`FAILED DOT:
2172
+ ${e}`),i instanceof Ro&&!Gt(i.stdout))n.warn`Command: '${i.command}' returned result but also failed (exitcode ${i.exitCode}): "${i.stderr}"`,r=i.stdout;else throw i}return r})}}const oK="likec4",QS="1.28.0",xw=bn.getChild("cli");Ut.bold(Ut.bgRed(Ut.white("ERROR"))),Ut.bold(Ut.yellow("WARN")),Ut.bold(Ut.green("INFO"));function ZS(t){const e=bn.getChild(t);return{info(n){e.info(n)},warn(n){if(n instanceof Error){e.warn(`${Ut.red(n.name+" "+n.message)}`,{msg:n});return}if(typeof n=="string"){e.warn(
2173
+ n);return}e.warn`${n}`},warnOnce(n){e.warn(n)},error(n,r){let i=r?.error??n;if(i instanceof Error){if(n===i){e.error(`${Ut.red(i.name+" "+i.message)}`,{error:i});return}e.error(`${n}`,{error:i});return}if(typeof n=="string"){e.error(`${Ut.red(n)}`);return}e.error`${n}`},clearScreen:function(n){},hasErrorLogged:function(n){throw new Error("Function not implemented.")},hasWarned:!1}}const Nw=()=>{},aK={info:Nw,warn:Nw,error:Nw},uK=1e6;function e_(t){const[e,n]=Zw(t),r=e*1e3+n/uK;return{ms:r,pretty:Gh(
2174
+ r)}}function cK(t){const e=Zw();return{stopAndLog(n="done in "){n=Ut.green(`${n}${e_(e).pretty}`),(t||xw).info(n)}}}function lK(t,e){console.log(W_(t,{padding:1,margin:1,dimBorder:!0,...e}))}class dK{constructor(e){this.services=e}isInitialized=!1;async initWorkspace(e){if(this.isInitialized)throw new Error("Workspace already initialized");const n=this.services.logger,r=this.services.shared.workspace.WorkspaceManager;n.info(`${Ut.dim("workspace:")} ${e.uri}`),r.initialize({capabilities:{},processId:null,
2175
+ rootUri:null,workspaceFolders:[e]}),await r.initializeWorkspace([e])}async init(){if(this.isInitialized)throw new Error("Workspace already initialized");this.isInitialized=!0;const e=this.services.logger;this.services.likec4.ModelBuilder;const n=this.services.shared.workspace.LangiumDocuments,r=this.services.shared.workspace.DocumentBuilder,i=n.all.toArray(),s=i.filter(o=>!id(o.uri));if(s.length===0)throw e.error("no LikeC4 sources found"),new Error("no LikeC4 sources found");e.info(`${Ut.dim("w\
2176
+ orkspace:")} found ${s.length} source files`),s.length>1?await r.update(s.map(o=>o.uri),[],void 0):await r.build(i,{validation:!0})}}function fK(t){return e=>new t(e)}const pK={logger:()=>{throw new Error("Logger must be provided")},likec4:{Layouter:()=>{throw new Error("Layouter must be provided")}},cli:{Workspace:fK(dK)}};function t_(t){const e=fm(t,{useFileSystem:!0,logger:"default",graphviz:"wasm"});let n;switch(e.logger){case!1:n=aK;break;case"vite":n=ZS("lang");break;case"default":n=xw.getChild(
2177
+ "lang");break;default:n=e.logger;break}const r=e.graphviz==="binary";n.info(`${Ut.dim("version")} ${QS}`),n.info(`${Ut.dim("layout")} ${r?"binary":"wasm"}`);const i={logger:()=>n,likec4:{Layouter:()=>new cS(r===!0?new sK:new Fa)}};return P9(e.useFileSystem?EU:{},pK,i).likec4}const n_=t=>new Error(`Invalid model:
2178
+ ${t.getErrors().map(e=>` ${e.sourceFsPath}:${e.line} ${e.message.slice(0,200)}`).join(`
2179
+ `)}`);class ls{constructor(e,n,r){this.workspace=e,this.langium=n,this.isPrintErrorEnabled=r,this.logger=n.logger,this.isPrintErrorEnabled&&this.printErrors()}static async fromSource(e,n){const r=t_(fm(n,{useFileSystem:!1,logger:!1,graphviz:"wasm"})),i=yt.from({scheme:"virtual",path:"/workspace"});await r.cli.Workspace.initWorkspace({uri:i.toString(),name:"virtual"});const s=ht.joinPath(i,"source.likec4");r.shared.workspace.LangiumDocuments.createDocument(s,e),await r.cli.Workspace.init();const o=new ls(
2180
+ i.path,r,n?.printErrors??!0);return n?.throwIfInvalid===!0&&o.hasErrors()?(o.dispose(),Promise.reject(n_(o))):o}static likec4Instances=new Map;static async fromWorkspace(e="",n){const r=s_(e);if(!i_(r))throw new Error(`Workspace not found: ${r}`);let i=ls.likec4Instances.get(r);if(!i){const s=t_(fm(n,{useFileSystem:!0,logger:"default",graphviz:"wasm"}));await s.cli.Workspace.initWorkspace({uri:u_(r).toString(),name:o_(r)}),await s.cli.Workspace.init(),i=new ls(r,s,n?.printErrors??!0),ls.likec4Instances.
2181
+ set(r,i)}return n?.throwIfInvalid===!0&&i.hasErrors()?(i.dispose(),Promise.reject(n_(i))):i}logger;get languageServices(){return this.langium.likec4.LanguageServices}get viewsService(){return this.langium.likec4.Views}get LangiumDocuments(){return this.langium.shared.workspace.LangiumDocuments}ensureSingleProject(){const e=this.langium.likec4.LanguageServices.projects();if(e.length>1)throw this.logger.error(`Multiple projects found:
2182
+ ${e.map(n=>` - ${n.folder.fsPath}`).join(`
2183
+ `)}
2184
+
2185
+ ${Ut.red("Please specify a project folder")}
2186
+ `),new Error("Multiple projects found")}async diagrams(){return await this.langium.likec4.Views.diagrams()}computedModel(e){const n=this.langium.shared.workspace.ProjectsManager.ensureProjectId(e);return this.langium.likec4.ModelBuilder.unsafeSyncBuildModel(n)}async projects(){const e=this.langium.shared.workspace.ProjectsManager.defaultProjectId;if(e)return[e];const n=(await Promise.allSettled(this.langium.shared.workspace.ProjectsManager.all.map(async r=>await this.langium.likec4.ModelBuilder.
2187
+ parseModel(r)?r:void 0))).filter(r=>r.status==="fulfilled").flatMap(r=>r.value??[]);return cr(n,1)?n:["default"]}async layoutedModel(e){const n=this.langium.shared.workspace.ProjectsManager.ensureProjectId(e),r=await this.langium.likec4.ModelBuilder.parseModel(n);if(!r)throw new Error("Failed to parse model");const i=await this.viewsService.diagrams(n);return Y_.create({...r,__:"layouted",views:Zu(i,fi("id"))})}getErrors(){return this.LangiumDocuments.all.toArray().flatMap(e=>(e.diagnostics??[]).
2188
+ filter(n=>n.severity===Os.Error).map(({message:n,range:r})=>({message:n,line:r.start.line,range:r,sourceFsPath:e.uri.fsPath})))}hasErrors(){return this.LangiumDocuments.all.some(e=>e.diagnostics?.some(n=>n.severity===Os.Error)??!1)}printErrors(){let e=!1;for(const n of this.LangiumDocuments.all){const r=n.diagnostics?.filter(i=>i.severity===1);if(r&&r.length>0){e=!0;const i=r.flatMap(s=>{const o=s.range.start.line,a=s.message.split(`
2189
+ `);return a.length>10&&(a.length=10,a.push("...")),a.map((u,c)=>c===0?" "+Ut.dim(`Line ${o}: `)+Ut.red(u):" ".repeat(10)+Ut.red(u))}).join(`
2190
+ `);this.logger.error(`Invalid ${n.uri.fsPath}
2191
+ ${i}`)}}return e}async notifyUpdate({changed:e,removed:n}){const r=this.langium.shared.workspace.WorkspaceLock;try{let i=!1;return await r.write(async s=>{await this.langium.shared.workspace.DocumentBuilder.update(e?[yt.file(e)]:[],n?[yt.file(n)]:[],s),i=!s.isCancellationRequested}),i}catch(i){return this.logger.error(yr(i)),!1}}onModelUpdate(e){const n=this.langium.likec4.ModelBuilder.onModelParsed(()=>e());return()=>{n.dispose()}}dispose(){for(const[e,n]of ls.likec4Instances)n===this&&ls.likec4Instances.
2192
+ delete(e)}}export{oK as A,Gt as B,He as C,kd as D,QS as E,xw as F,yr as G,cK as H,RS as I,cr as J,v1 as K,ls as L,o0 as N,_o as T,qb as Y,Yo as a,ze as b,ce as c,KC as d,Zo as e,Io as f,at as g,ZS as h,kt as i,GC as j,MR as k,zr as l,xt as m,Rt as n,bn as o,fi as p,Jr as q,rs as r,U8 as s,gy as t,Ut as u,lK as v,qC as w,jR as x,e_ as y,nP as z};