likec4 1.19.2 → 1.20.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/__app__/react/likec4.tsx +16 -114
- package/__app__/src/chunks/{-index-overview-COSF42be.js → -index-overview-B8Ngh4J7.js} +20 -19
- package/__app__/src/chunks/{likec4-CusAw_j6.js → likec4-CK8zVxjc.js} +1172 -1209
- package/__app__/src/chunks/main-DwHOiMDD.js +23884 -0
- package/__app__/src/chunks/{mantine-B_6mKFFA.js → mantine-B9NZkjVg.js} +993 -981
- package/__app__/src/chunks/tanstack-router-B9I-d36d.js +3032 -0
- package/__app__/src/main.js +1 -2
- package/__app__/src/style.css +1 -1
- package/__app__/webcomponent/webcomponent.js +31795 -32402
- package/dist/chunks/prompt.cjs +1 -1
- package/dist/chunks/prompt.mjs +1 -1
- package/dist/cli/index.cjs +47 -58
- package/dist/cli/index.mjs +29 -40
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +106 -81
- package/dist/index.d.mts +106 -81
- package/dist/index.d.ts +106 -81
- package/dist/index.mjs +1 -1
- package/dist/model/index.cjs +1 -1
- package/dist/model/index.d.cts +4 -257
- package/dist/model/index.d.mts +4 -257
- package/dist/model/index.d.ts +4 -257
- package/dist/model/index.mjs +1 -1
- package/dist/shared/likec4.Buej2FfJ.mjs +1857 -0
- package/dist/shared/likec4.pZxbrzrY.cjs +1857 -0
- package/package.json +39 -39
- package/react/index.d.ts +771 -1546
- package/react/index.js +36196 -36908
- package/react/style.css +1 -1
- package/__app__/src/chunks/main-CtzxB_vG.js +0 -24136
- package/__app__/src/chunks/tanstack-router-BBWuTKWO.js +0 -2373
- package/dist/shared/likec4.-U9_Dinu.cjs +0 -1856
- package/dist/shared/likec4.CVn8U3Og.cjs +0 -9
- package/dist/shared/likec4.Cgd5VecV.mjs +0 -9
- package/dist/shared/likec4.D7BM0ZAO.mjs +0 -1856
- package/dist/shared/likec4.DJeGiAvE.d.cts +0 -1639
- package/dist/shared/likec4.DJeGiAvE.d.mts +0 -1639
- package/dist/shared/likec4.DJeGiAvE.d.ts +0 -1639
|
@@ -0,0 +1,1857 @@
|
|
|
1
|
+
import*as Eb from"node:fs";import{writeFileSync as Rb,statSync as kI,readFileSync as tm,appendFileSync as AI,createReadStream as Tb,createWriteStream as $b,existsSync as _I}from"node:fs";import Pr,{sep as Sb,resolve as PI,basename as II}from"node:path";import{fileURLToPath as nm,pathToFileURL as xI}from"node:url";import{isatty as OI}from"tty";import NI,{formatWithOptions as Cb,debuglog as FI,stripVTControlCharacters as LI,inspect as yd,promisify as MI,callbackify as Ys,aborted as BI}from"node:util";import zI from"util";import dr from"path";import qI from"os";import jI from"crypto";import UI from"net";import GI from"url";import Xs from"fs";import kb from"child_process";import{stat as WI}from"node:fs/promises";import{nonexhaustive as Ie,defaultTheme as Ir,DefaultRelationshipColor as Jo,ComputedView as Qo,delay as HI,invariant as $e,ComputedNode as vd,DefaultArrowType as Yi,isome as Ab,extractStep as VI,nonNullable as rn,hierarchyDistance as KI,nameFromFqn as Zo,parentFqn as ea,compareFqnHierarchically as YI,isThemeColor as _b,DefaultThemeColor as Pb,LinkedList as rm,DefaultLineStyle as XI,AsFqn as JI,compareNatural as Ib,LikeC4Model as xb,sortByFqnHierarchically as Ob,isScopedElementView as QI,computeColorValues as ZI,compareRelations as ex,DeploymentElement as tx,FqnRef as ta,isSameHierarchy as Nb,isAncestor as im,FqnExpr as na,isNonEmptyArray as Kn,stringHash as nx,isAutoLayoutDirection as rx,isOrOperator as Fb,isAndOperator as Lb,hasAtLeast as ix}from"@likec4/core";import tt,{cwd as sx,platform as ox,hrtime as wd,execPath as ax,execArgv as cx}from"node:process";import*as sm from"node:tty";import Mb from"node:tty";import{Graphviz as om}from"@hpcc-js/wasm-graphviz";import{Buffer as am}from"buffer";import{resolveRulesExtendedViews as ux}from"@likec4/core/compute-view";import{ChildProcess as Bb,spawnSync as lx,spawn as dx}from"node:child_process";import{StringDecoder as zb}from"node:string_decoder";import{setTimeout as qb,scheduler as jb,setImmediate as fx}from"node:timers/promises";import{constants as Xi}from"node:os";import{once as yn,addAbortListener as Ub,EventEmitter as px,on as bd,setMaxListeners as hx}from"node:events";import{serialize as mx}from"node:v8";import{Transform as gx,getDefaultHighWaterMark as Dd,PassThrough as Gb,Readable as Ji,Writable as cm,Duplex as um}from"node:stream";import{Buffer as lm}from"node:buffer";import{finished as li}from"node:stream/promises";import{createLogger as yx}from"vite";import{LikeC4Model as Wb}from"@likec4/core/model";function dm(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]":!0}function fm(t,e,n=".",r){if(!dm(e))return fm(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]]:dm(o)&&dm(i[s])?i[s]=fm(o,i[s],(n?`${n}.`:"")+s.toString(),r):i[s]=o))}return i}function vx(t){return(...e)=>e.reduce((n,r)=>fm(n,r,"",t),{})}const pm=vx();function bt(t){return typeof t=="object"&&t!==null&&typeof t.$type=="string"}function Mn(t){return typeof t=="object"&&t!==null&&typeof t.$refText=="string"}function wx(t){return typeof t=="object"&&t!==null&&typeof t.name=="string"&&typeof t.type=="string"&&typeof t.path=="string"}function Ed(t){return typeof t=="object"&&t!==null&&bt(t.container)&&Mn(t.reference)&&typeof t.message=="string"}class Hb{constructor(){this.subtypes={},this.allSubtypes={}}isInstance(e,n){return bt(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!==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 xr(t){return typeof t=="object"&&t!==null&&Array.isArray(t.content)}function Qi(t){return typeof t=="object"&&t!==null&&typeof t.tokenType=="object"}function Vb(t){return xr(t)&&typeof t.fullText=="string"}class Pt{constructor(e,n){this.startFn=e,this.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(r)}toString(){return this.join()}concat(e){return new Pt(()=>({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 Kt})}join(e=","){const n=this.iterator();let r="",i,s=!1;do i=n.next(),i.done||(s&&(r+=e),r+=bx(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;){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 Pt(this.startFn,n=>{const{done:r,value:i}=this.nextFn(n);return r?Kt:{done:!1,value:e(i)}})}filter(e){return new Pt(this.startFn,n=>{let r;do if(r=this.nextFn(n),!r.done&&e(r.value))return r;while(!r.done);return Kt})}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.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 Pt(()=>({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(Rd(s))n.iterator=s[Symbol.iterator]();else return{done:!1,value:s}}}while(n.iterator);return Kt})}flat(e){if(e===void 0&&(e=1),e<=0)return this;const n=e>1?this.flat(e-1):this;return new Pt(()=>({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(Rd(s))r.iterator=s[Symbol.iterator]();else return{done:!1,value:s}}while(r.iterator);return Kt})}head(){const n=this.iterator().next();if(!n.done)return n.value}tail(e=1){return new Pt(()=>{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 Pt(()=>({size:0,state:this.startFn()}),n=>(n.size++,n.size>e?Kt:this.nextFn(n.state)))}distinct(e){return new Pt(()=>({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 Kt})}exclude(e,n){const r=new Set;for(const i of e){const s=n?n(i):i;r.add(s)}return this.filter(i=>{const s=n?n(i):i;return!r.has(s)})}}function bx(t){return typeof t=="string"?t:typeof t>"u"?"undefined":typeof t.toString=="function"?t.toString():Object.prototype.toString.call(t)}function Rd(t){return!!t&&typeof t[Symbol.iterator]=="function"}const Js=new Pt(()=>{},()=>Kt),Kt=Object.freeze({done:!0,value:void 0});function et(...t){if(t.length===1){const e=t[0];if(e instanceof Pt)return e;if(Rd(e))return new Pt(()=>e[Symbol.iterator](),n=>n.next());if(typeof e.length=="number")return new Pt(()=>({index:0}),n=>n.index<e.length?{done:!1,value:e[n.index++]}:Kt)}return t.length>1?new Pt(()=>({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++];Rd(n)?e.iterator=n[Symbol.iterator]():n&&typeof n.length=="number"&&(e.array=n)}}while(e.iterator||e.array||e.collIndex<t.length);return Kt}):Js}class Qs extends Pt{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 Kt})}iterator(){const e={state:this.startFn(),next:()=>this.nextFn(e.state),prune:()=>{e.state.pruned=!0},[Symbol.iterator]:()=>e};return e}}var hm;(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})(hm||(hm={}));function ra(t){return new Qs(t,e=>xr(e)?e.content:[],{includeRoot:!0})}function Kb(t){return ra(t).filter(Qi)}function Yb(t,e){for(;t.container;)if(t=t.container,t===e)return!0;return!1}function Td(t){return{start:{character:t.startColumn-1,line:t.startLine-1},end:{character:t.endColumn,line:t.endLine-1}}}function ia(t){if(!t)return;const{offset:e,end:n,range:r}=t;return{range:r,offset:e,end:n,length:n-e}}var fr;(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"})(fr||(fr={}));function Xb(t,e){if(t.end.line<e.start.line||t.end.line===e.start.line&&t.end.character<=e.start.character)return fr.Before;if(t.start.line>e.end.line||t.start.line===e.end.line&&t.start.character>=e.end.character)return fr.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?fr.Inside:n?fr.OverlapBack:r?fr.OverlapFront:fr.Outside}function mm(t,e){return Xb(t,e)>fr.After}const gm=/^[\w\p{L}]$/u;function di(t,e,n=gm){if(t){if(e>0){const r=e-t.offset,i=t.text.charAt(r);n.test(i)||e--}return vm(t,e)}}function $d(t,e){if(t){const n=Qb(t,!0);if(n&&ym(n,e))return n;if(Vb(t)){const r=t.content.findIndex(i=>!i.hidden);for(let i=r-1;i>=0;i--){const s=t.content[i];if(ym(s,e))return s}}}}function ym(t,e){return Qi(t)&&e.includes(t.tokenType.name)}function vm(t,e){if(Qi(t))return t;if(xr(t)){const n=Jb(t,e,!1);if(n)return vm(n,e)}}function Sd(t,e){if(Qi(t))return t;if(xr(t)){const n=Jb(t,e,!0);if(n)return Sd(n,e)}}function Jb(t,e,n){let r=0,i=t.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 Qb(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 Zb(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 Dx(t){if(t.range.start.character===0)return t;const e=t.range.start.line;let n=t,r;for(;t.container;){const i=t.container,s=r??i.content.indexOf(t);if(s===0?(t=i,r=void 0):(r=s-1,t=i.content[r]),t.range.start.line!==e)break;n=t}return n}function eD(t,e){const n=Ex(t,e);return n?n.parent.content.slice(n.a+1,n.b):[]}function Ex(t,e){const n=tD(t),r=tD(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 tD(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()}const Rx={__proto__:null,DefaultNameRegexp:gm,get RangeComparison(){return fr},compareRange:Xb,findCommentNode:$d,findDeclarationNodeAtOffset:di,findLeafNodeAtOffset:vm,findLeafNodeBeforeOffset:Sd,flattenCst:Kb,getInteriorNodes:eD,getNextNode:Zb,getPreviousNode:Qb,getStartlineNode:Dx,inRange:mm,isChildNode:Yb,isCommentNode:ym,streamCst:ra,toDocumentSegment:ia,tokenToRange:Td};class nD extends Error{constructor(e,n){super(e?`${n} at ${e.range.start.line}:${e.range.start.character}`:n)}}function sa(t){throw new Error("Error! The input value was not handled.")}const Cd="AbstractRule",kd="AbstractType",wm="Condition",rD="TypeDefinition",bm="ValueLiteral",oa="AbstractElement";function Dm(t){return Be.isInstance(t,oa)}const Ad="ArrayLiteral",aa="ArrayType";function Tx(t){return Be.isInstance(t,aa)}const ca="BooleanLiteral";function $x(t){return Be.isInstance(t,ca)}const ua="Conjunction";function Sx(t){return Be.isInstance(t,ua)}const la="Disjunction";function Cx(t){return Be.isInstance(t,la)}const _d="Grammar",Em="GrammarImport",da="InferredType";function iD(t){return Be.isInstance(t,da)}const fa="Interface";function sD(t){return Be.isInstance(t,fa)}const Rm="NamedArgument",pa="Negation";function kx(t){return Be.isInstance(t,pa)}const Pd="NumberLiteral",Id="Parameter",ha="ParameterReference";function Ax(t){return Be.isInstance(t,ha)}const ma="ParserRule";function Yt(t){return Be.isInstance(t,ma)}const ga="ReferenceType";function _x(t){return Be.isInstance(t,ga)}const xd="ReturnType";function Px(t){return Be.isInstance(t,xd)}const ya="SimpleType";function oD(t){return Be.isInstance(t,ya)}const Od="StringLiteral",Zs="TerminalRule";function Or(t){return Be.isInstance(t,Zs)}const va="Type";function Tm(t){return Be.isInstance(t,va)}const $m="TypeAttribute",wa="UnionType";function Ix(t){return Be.isInstance(t,wa)}const ba="Action";function Zi(t){return Be.isInstance(t,ba)}const Da="Alternatives";function Sm(t){return Be.isInstance(t,Da)}const Ea="Assignment";function pr(t){return Be.isInstance(t,Ea)}const Ra="CharacterRange";function xx(t){return Be.isInstance(t,Ra)}const Ta="CrossReference";function $a(t){return Be.isInstance(t,Ta)}const Sa="EndOfFile";function Ox(t){return Be.isInstance(t,Sa)}const Ca="Group";function fi(t){return Be.isInstance(t,Ca)}const ka="Keyword";function hr(t){return Be.isInstance(t,ka)}const Aa="NegatedToken";function Nx(t){return Be.isInstance(t,Aa)}const _a="RegexToken";function Fx(t){return Be.isInstance(t,_a)}const Pa="RuleCall";function Nr(t){return Be.isInstance(t,Pa)}const Ia="TerminalAlternatives";function Lx(t){return Be.isInstance(t,Ia)}const xa="TerminalGroup";function Mx(t){return Be.isInstance(t,xa)}const Oa="TerminalRuleCall";function aD(t){return Be.isInstance(t,Oa)}const Na="UnorderedGroup";function Cm(t){return Be.isInstance(t,Na)}const Fa="UntilToken";function Bx(t){return Be.isInstance(t,Fa)}const La="Wildcard";function zx(t){return Be.isInstance(t,La)}class cD extends Hb{getAllTypes(){return[oa,Cd,kd,ba,Da,Ad,aa,Ea,ca,Ra,wm,ua,Ta,la,Sa,_d,Em,Ca,da,fa,ka,Rm,Aa,pa,Pd,Id,ha,ma,ga,_a,xd,Pa,ya,Od,Ia,xa,Zs,Oa,va,$m,rD,wa,Na,Fa,bm,La]}computeIsSubtype(e,n){switch(e){case ba:case Da:case Ea:case Ra:case Ta:case Sa:case Ca:case ka:case Aa:case _a:case Pa:case Ia:case xa:case Oa:case Na:case Fa:case La:return this.isSubtype(oa,n);case Ad:case Pd:case Od:return this.isSubtype(bm,n);case aa:case ga:case ya:case wa:return this.isSubtype(rD,n);case ca:return this.isSubtype(wm,n)||this.isSubtype(bm,n);case ua:case la:case pa:case ha:return this.isSubtype(wm,n);case da:case fa:case va:return this.isSubtype(kd,n);case ma:return this.isSubtype(Cd,n)||this.isSubtype(kd,n);case Zs:return this.isSubtype(Cd,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 kd;case"Grammar:hiddenTokens":case"ParserRule:hiddenTokens":case"RuleCall:rule":return Cd;case"Grammar:usedGrammars":return _d;case"NamedArgument:parameter":case"ParameterReference:parameter":return Id;case"TerminalRuleCall:rule":return Zs;default:throw new Error(`${n} is not a valid reference id.`)}}getTypeMetaData(e){switch(e){case oa:return{name:oa,properties:[{name:"cardinality"},{name:"lookahead"}]};case Ad:return{name:Ad,properties:[{name:"elements",defaultValue:[]}]};case aa:return{name:aa,properties:[{name:"elementType"}]};case ca:return{name:ca,properties:[{name:"true",defaultValue:!1}]};case ua:return{name:ua,properties:[{name:"left"},{name:"right"}]};case la:return{name:la,properties:[{name:"left"},{name:"right"}]};case _d:return{name:_d,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 Em:return{name:Em,properties:[{name:"path"}]};case da:return{name:da,properties:[{name:"name"}]};case fa:return{name:fa,properties:[{name:"attributes",defaultValue:[]},{name:"name"},{name:"superTypes",defaultValue:[]}]};case Rm:return{name:Rm,properties:[{name:"calledByName",defaultValue:!1},{name:"parameter"},{name:"value"}]};case pa:return{name:pa,properties:[{name:"value"}]};case Pd:return{name:Pd,properties:[{name:"value"}]};case Id:return{name:Id,properties:[{name:"name"}]};case ha:return{name:ha,properties:[{name:"parameter"}]};case ma:return{name:ma,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 ga:return{name:ga,properties:[{name:"referenceType"}]};case xd:return{name:xd,properties:[{name:"name"}]};case ya:return{name:ya,properties:[{name:"primitiveType"},{name:"stringType"},{name:"typeRef"}]};case Od:return{name:Od,properties:[{name:"value"}]};case Zs:return{name:Zs,properties:[{name:"definition"},{name:"fragment",defaultValue:!1},{name:"hidden",defaultValue:!1},{name:"name"},{name:"type"}]};case va:return{name:va,properties:[{name:"name"},{name:"type"}]};case $m:return{name:$m,properties:[{name:"defaultValue"},{name:"isOptional",defaultValue:!1},{name:"name"},{name:"type"}]};case wa:return{name:wa,properties:[{name:"types",defaultValue:[]}]};case ba:return{name:ba,properties:[{name:"cardinality"},{name:"feature"},{name:"inferredType"},{name:"lookahead"},{name:"operator"},{name:"type"}]};case Da:return{name:Da,properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"lookahead"}]};case Ea:return{name:Ea,properties:[{name:"cardinality"},{name:"feature"},{name:"lookahead"},{name:"operator"},{name:"terminal"}]};case Ra:return{name:Ra,properties:[{name:"cardinality"},{name:"left"},{name:"lookahead"},{name:"right"}]};case Ta:return{name:Ta,properties:[{name:"cardinality"},{name:"deprecatedSyntax",defaultValue:!1},{name:"lookahead"},{name:"terminal"},{name:"type"}]};case Sa:return{name:Sa,properties:[{name:"cardinality"},{name:"lookahead"}]};case Ca:return{name:Ca,properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"guardCondition"},{name:"lookahead"}]};case ka:return{name:ka,properties:[{name:"cardinality"},{name:"lookahead"},{name:"value"}]};case Aa:return{name:Aa,properties:[{name:"cardinality"},{name:"lookahead"},{name:"terminal"}]};case _a:return{name:_a,properties:[{name:"cardinality"},{name:"lookahead"},{name:"regex"}]};case Pa:return{name:Pa,properties:[{name:"arguments",defaultValue:[]},{name:"cardinality"},{name:"lookahead"},{name:"rule"}]};case Ia:return{name:Ia,properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"lookahead"}]};case xa:return{name:xa,properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"lookahead"}]};case Oa:return{name:Oa,properties:[{name:"cardinality"},{name:"lookahead"},{name:"rule"}]};case Na:return{name:Na,properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"lookahead"}]};case Fa:return{name:Fa,properties:[{name:"cardinality"},{name:"lookahead"},{name:"terminal"}]};case La:return{name:La,properties:[{name:"cardinality"},{name:"lookahead"}]};default:return{name:e,properties:[]}}}}const Be=new cD;function km(t){for(const[e,n]of Object.entries(t))e.startsWith("$")||(Array.isArray(n)?n.forEach((r,i)=>{bt(r)&&(r.$container=t,r.$containerProperty=e,r.$containerIndex=i)}):bt(n)&&(n.$container=t,n.$containerProperty=e))}function Xt(t,e){let n=t;for(;n;){if(e(n))return n;n=n.$container}}function pi(t,e){let n=t;for(;n;){if(e(n))return!0;n=n.$container}return!1}function mt(t){const n=Nd(t).$document;if(!n)throw new Error("AST node has no document.");return n}function Nd(t){for(;t.$container;)t=t.$container;return t}function Ma(t,e){if(!t)throw new Error("Node must be an AstNode.");const n=e?.range;return new Pt(()=>({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(bt(s)){if(r.keyIndex++,Am(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(bt(a)&&Am(a,n))return{done:!1,value:a}}r.arrayIndex=0}}r.keyIndex++}return Kt})}function mr(t,e){if(!t)throw new Error("Root node must be an AstNode.");return new Qs(t,n=>Ma(n,e))}function Fr(t,e){if(t){if(e?.range&&!Am(t,e.range))return new Qs(t,()=>[])}else throw new Error("Root node must be an AstNode.");return new Qs(t,n=>Ma(n,e),{includeRoot:!0})}function Am(t,e){var n;if(!e)return!0;const r=(n=t.$cstNode)===null||n===void 0?void 0:n.range;return r?mm(r,e):!1}function Fd(t){return new Pt(()=>({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(Mn(r))return e.keyIndex++,{done:!1,value:{reference:r,container:t,property:n}};if(Array.isArray(r)){for(;e.arrayIndex<r.length;){const i=e.arrayIndex++,s=r[i];if(Mn(s))return{done:!1,value:{reference:s,container:t,property:n,index:i}}}e.arrayIndex=0}}e.keyIndex++}return Kt})}function qx(t,e=mt(t).parseResult.value){const n=[];return Fr(e).forEach(r=>{Fd(r).forEach(i=>{i.reference.ref===t&&n.push(i.reference)})}),et(n)}function _m(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.name]=uD(i.defaultValue))}function uD(t){return Array.isArray(t)?[...t.map(uD)]:t}function Pm(t,e){const n={$type:t.$type};for(const[r,i]of Object.entries(t))if(!r.startsWith("$"))if(bt(i))n[r]=Pm(i,e);else if(Mn(i))n[r]=e(n,r,i.$refNode,i.$refText);else if(Array.isArray(i)){const s=[];for(const o of i)bt(o)?s.push(Pm(o,e)):Mn(o)?s.push(e(n,r,o.$refNode,o.$refText)):s.push(o);n[r]=s}else n[r]=i;return km(n),n}const Ba={__proto__:null,assignMandatoryProperties:_m,copyAstNode:Pm,findLocalReferences:qx,findRootNode:Nd,getContainerOfType:Xt,getDocument:mt,hasContainerOfType:pi,linkContentToContainer:km,streamAllContents:mr,streamAst:Fr,streamContents:Ma,streamReferences:Fd};function Re(t){return t.charCodeAt(0)}function Im(t,e){Array.isArray(t)?t.forEach(function(n){e.push(n)}):e.push(t)}function za(t,e){if(t[e]===!0)throw"duplicate flag "+e;t[e],t[e]=!0}function eo(t){if(t===void 0)throw Error("Internal Error - Should never get here!");return!0}function jx(){throw Error("Internal Error - Should never get here!")}function lD(t){return t.type==="Character"}const Ld=[];for(let t=Re("0");t<=Re("9");t++)Ld.push(t);const Md=[Re("_")].concat(Ld);for(let t=Re("a");t<=Re("z");t++)Md.push(t);for(let t=Re("A");t<=Re("Z");t++)Md.push(t);const dD=[Re(" "),Re("\f"),Re(`
|
|
2
|
+
`),Re("\r"),Re(" "),Re("\v"),Re(" "),Re("\xA0"),Re("\u1680"),Re("\u2000"),Re("\u2001"),Re("\u2002"),Re("\u2003"),Re("\u2004"),Re("\u2005"),Re("\u2006"),Re("\u2007"),Re("\u2008"),Re("\u2009"),Re("\u200A"),Re("\u2028"),Re("\u2029"),Re("\u202F"),Re("\u205F"),Re("\u3000"),Re("\uFEFF")],Ux=/[0-9a-fA-F]/,Bd=/[0-9]/,Gx=/[1-9]/;class fD{constructor(){this.idx=0,this.input="",this.groupIdx=0}saveState(){return{idx:this.idx,input:this.input,groupIdx:this.groupIdx}}restoreState(e){this.idx=e.idx,this.input=e.input,this.groupIdx=e.groupIdx}pattern(e){this.idx=0,this.input=e,this.groupIdx=0,this.consumeChar("/");const 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":za(r,"global");break;case"i":za(r,"ignoreCase");break;case"m":za(r,"multiLine");break;case"u":za(r,"unicode");break;case"y":za(r,"sticky");break}if(this.idx!==this.input.length)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(){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}eo(n);const r=this.disjunction();return this.consumeChar(")"),{type:n,value:r,loc:this.loc(e)}}return jx()}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;eo(n);break}if(!(e===!0&&n===void 0)&&eo(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()),eo(e))return e.loc=this.loc(n),this.isQuantifier()&&(e.quantifier=this.quantifier()),e}dotAll(){return this.consumeChar("."),{type:"Set",complement:!0,value:[Re(`
|
|
3
|
+
`),Re("\r"),Re("\u2028"),Re("\u2029")]}}atomEscape(){switch(this.consumeChar("\\"),this.peekChar()){case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return this.decimalEscapeAtom();case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}}decimalEscapeAtom(){return{type:"GroupBackReference",value:this.positiveInteger()}}characterClassEscape(){let e,n=!1;switch(this.popChar()){case"d":e=Ld;break;case"D":e=Ld,n=!0;break;case"s":e=dD;break;case"S":e=dD,n=!0;break;case"w":e=Md;break;case"W":e=Md,n=!0;break}if(eo(e))return{type:"Set",value:e,complement:n}}controlEscapeAtom(){let e;switch(this.popChar()){case"f":e=Re("\f");break;case"n":e=Re(`
|
|
4
|
+
`);break;case"r":e=Re("\r");break;case"t":e=Re(" ");break;case"v":e=Re("\v");break}if(eo(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:Re("\0")}}hexEscapeSequenceAtom(){return this.consumeChar("x"),this.parseHexDigits(2)}regExpUnicodeEscapeSequenceAtom(){return this.consumeChar("u"),this.parseHexDigits(4)}identityEscapeAtom(){const e=this.popChar();return{type:"Character",value:Re(e)}}classPatternCharacterAtom(){switch(this.peekChar()){case`
|
|
5
|
+
`:case"\r":case"\u2028":case"\u2029":case"\\":case"]":throw Error("TBD");default:const e=this.popChar();return{type:"Character",value:Re(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,lD(r)&&this.isRangeDash()){this.consumeChar("-");const i=this.classAtom();if(i.type,lD(i)){if(i.value<r.value)throw Error("Range out of order in character class");e.push({from:r.value,to:i.value})}else Im(r.value,e),e.push(Re("-")),Im(i.value,e)}else Im(r.value,e)}return this.consumeChar("]"),{type:"Set",complement:n,value:e}}classAtom(){switch(this.peekChar()){case"]":case`
|
|
6
|
+
`:case"\r":case"\u2028":case"\u2029":throw Error("TBD");case"\\":return this.classEscape();default:return this.classPatternCharacterAtom()}}classEscape(){switch(this.consumeChar("\\"),this.peekChar()){case"b":return this.consumeChar("b"),{type:"Character",value:Re("\b")};case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}}group(){let e=!0;switch(this.consumeChar("("),this.peekChar(0)){case"?":this.consumeChar("?"),this.consumeChar(":"),e=!1;break;default:this.groupIdx++;break}const 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(Gx.test(e)===!1)throw Error("Expecting a positive integer");for(;Bd.test(this.peekChar(0));)e+=this.popChar();return parseInt(e,10)}integerIncludingZero(){let e=this.popChar();if(Bd.test(e)===!1)throw Error("Expecting an integer");for(;Bd.test(this.peekChar(0));)e+=this.popChar();return parseInt(e,10)}patternCharacter(){const e=this.popChar();switch(e){case`
|
|
7
|
+
`:case"\r":case"\u2028":case"\u2029":case"^":case"$":case"\\":case".":case"*":case"+":case"?":case"(":case")":case"[":case"|":throw Error("TBD");default:return{type:"Character",value:Re(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 Bd.test(this.peekChar(0))}isClassAtom(e=0){switch(this.peekChar(e)){case"]":case`
|
|
8
|
+
`:case"\r":case"\u2028":case"\u2029":return!1;default:return!0}}isTerm(){return this.isAtom()||this.isAssertion()}isAtom(){if(this.isPatternCharacter())return!0;switch(this.peekChar(0)){case".":case"\\":case"[":case"(":return!0;default:return!1}}isAssertion(){switch(this.peekChar(0)){case"^":case"$":return!0;case"\\":switch(this.peekChar(1)){case"b":case"B":return!0;default:return!1}case"(":return this.peekChar(1)==="?"&&(this.peekChar(2)==="="||this.peekChar(2)==="!");default:return!1}}isQuantifier(){const e=this.saveState();try{return this.quantifier(!0)!==void 0}catch{return!1}finally{this.restoreState(e)}}isPatternCharacter(){switch(this.peekChar()){case"^":case"$":case"\\":case".":case"*":case"+":case"?":case"(":case")":case"[":case"|":case"/":case`
|
|
9
|
+
`: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(Ux.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: "+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"StartAnchor":this.visitStartAnchor(e);break;case"EndAnchor":this.visitEndAnchor(e);break;case"WordBoundary":this.visitWordBoundary(e);break;case"NonWordBoundary":this.visitNonWordBoundary(e);break;case"Lookahead":this.visitLookahead(e);break;case"NegativeLookahead":this.visitNegativeLookahead(e);break;case"Character":this.visitCharacter(e);break;case"Set":this.visitSet(e);break;case"Group":this.visitGroup(e);break;case"GroupBackReference":this.visitGroupBackReference(e);break;case"Quantifier":this.visitQuantifier(e);break}this.visitChildren(e)}visitPattern(e){}visitFlags(e){}visitDisjunction(e){}visitAlternative(e){}visitStartAnchor(e){}visitEndAnchor(e){}visitWordBoundary(e){}visitNonWordBoundary(e){}visitLookahead(e){}visitNegativeLookahead(e){}visitCharacter(e){}visitSet(e){}visitGroup(e){}visitGroupBackReference(e){}visitQuantifier(e){}}const pD=/\r?\n/gm,Wx=new fD;class Hx extends zd{constructor(){super(...arguments),this.isStarting=!0,this.endRegexpStack=[],this.multiline=!1}get endRegex(){return this.endRegexpStack.join("")}reset(e){this.multiline=!1,this.regex=e,this.startRegexp="",this.isStarting=!0,this.endRegexpStack=[]}visitGroup(e){e.quantifier&&(this.isStarting=!1,this.endRegexpStack=[])}visitCharacter(e){const n=String.fromCharCode(e.value);if(!this.multiline&&n===`
|
|
10
|
+
`&&(this.multiline=!0),e.quantifier)this.isStarting=!1,this.endRegexpStack=[];else{const r=qd(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=!!`
|
|
11
|
+
`.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 xm=new Hx;function Vx(t){try{return typeof t=="string"&&(t=new RegExp(t)),t=t.toString(),xm.reset(t),xm.visit(Wx.pattern(t)),xm.multiline}catch{return!1}}const Kx=`\f
|
|
12
|
+
\r \v \xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF`.split("");function Om(t){const e=typeof t=="string"?new RegExp(t):t;return Kx.some(n=>e.test(n))}function qd(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Yx(t){return Array.prototype.map.call(t,e=>/\w/.test(e)?`[${e.toLowerCase()}${e.toUpperCase()}]`:qd(e)).join("")}function Xx(t,e){const n=Jx(t),r=e.match(n);return!!r&&r[0].length>0}function Jx(t){typeof t=="string"&&(t=new RegExp(t));const e=t,n=t.source;let r=0;function i(){let s="",o;function a(u){s+=n.substr(r,u),r+=u}function c(u){s+="(?:"+n.substr(r,u)+"|$)",r+=u}for(;r<n.length;)switch(n[r]){case"\\":switch(n[r+1]){case"c":c(3);break;case"x":c(4);break;case"u":e.unicode?n[r+2]==="{"?c(n.indexOf("}",r)-r+1):c(6):c(2);break;case"p":case"P":e.unicode?c(n.indexOf("}",r)-r+1):c(2);break;case"k":c(n.indexOf(">",r)-r+1);break;default:c(2);break}break;case"[":o=/\[(?:\\.|.)*?\]/g,o.lastIndex=r,o=o.exec(n)||[],c(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):c(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,s;default:c(1);break}return s}return new RegExp(i(),t.flags)}function jd(t){return t.rules.find(e=>Yt(e)&&e.entry)}function hD(t){return t.rules.filter(e=>Or(e)&&e.hidden)}function Nm(t,e){const n=new Set,r=jd(t);if(!r)return new Set(t.rules);const i=[r].concat(hD(t));for(const o of i)mD(o,n,e);const s=new Set;for(const o of t.rules)(n.has(o.name)||Or(o)&&o.hidden)&&s.add(o);return s}function mD(t,e,n){e.add(t.name),mr(t).forEach(r=>{if(Nr(r)||n&&aD(r)){const i=r.rule.ref;i&&!e.has(i.name)&&mD(i,e,n)}})}function Fm(t){if(t.terminal)return t.terminal;if(t.type.ref){const e=zm(t.type.ref);return e?.terminal}}function gD(t){return t.hidden&&!Om(Ua(t))}function to(t,e){return!t||!e?[]:Lm(t,e,t.astNode,!0)}function vn(t,e,n){if(!t||!e)return;const r=Lm(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 Lm(t,e,n,r){if(!r){const i=Xt(t.grammarSource,pr);if(i&&i.feature===e)return[t]}return xr(t)&&t.astNode===n?t.content.flatMap(i=>Lm(i,e,n,!1)):[]}function Mm(t,e){return t?Bm(t,e,t?.astNode):[]}function qa(t,e,n){if(!t)return;const r=Bm(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 Bm(t,e,n){if(t.astNode!==n)return[];if(hr(t.grammarSource)&&t.grammarSource.value===e)return[t];const r=ra(t).iterator();let i;const s=[];do if(i=r.next(),!i.done){const o=i.value;o.astNode===n?hr(o.grammarSource)&&o.grammarSource.value===e&&s.push(o):r.prune()}while(!i.done);return s}function yD(t){var e;const n=t.astNode;for(;n===((e=t.container)===null||e===void 0?void 0:e.astNode);){const r=Xt(t.grammarSource,pr);if(r)return r;t=t.container}}function zm(t){let e=t;return iD(e)&&(Zi(e.$container)?e=e.$container.$container:Yt(e.$container)?e=e.$container:sa(e.$container)),vD(t,e,new Map)}function vD(t,e,n){var r;function i(s,o){let a;return Xt(s,pr)||(a=vD(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 mr(e)){if(pr(s)&&s.feature.toLowerCase()==="name")return n.set(t,s),s;if(Nr(s)&&Yt(s.rule.ref))return i(s,s.rule.ref);if(oD(s)&&(!((r=s.typeRef)===null||r===void 0)&&r.ref))return i(s,s.typeRef.ref)}}function wD(t){const e=t.$container;if(fi(e)){const n=e.elements,r=n.indexOf(t);for(let i=r-1;i>=0;i--){const s=n[i];if(Zi(s))return s;{const o=mr(n[i]).find(Zi);if(o)return o}}}if(Dm(e))return wD(e)}function no(t,e){return t==="?"||t==="*"||fi(e)&&!!e.guardCondition}function bD(t){return t==="*"||t==="+"}function Qx(t){return t==="+="}function Ud(t){return DD(t,new Set)}function DD(t,e){if(e.has(t))return!0;e.add(t);for(const n of mr(t))if(Nr(n)){if(!n.rule.ref||Yt(n.rule.ref)&&!DD(n.rule.ref,e))return!1}else{if(pr(n))return!1;if(Zi(n))return!1}return!!t.definition}function Zx(t){return qm(t.type,new Set)}function qm(t,e){if(e.has(t))return!0;if(e.add(t),Tx(t))return!1;if(_x(t))return!1;if(Ix(t))return t.types.every(n=>qm(n,e));if(oD(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;return Tm(n)?qm(n.type,e):!1}else return!1}else return!1}function es(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(Yt(e))return e.name;if(sD(e)||Tm(e))return e.name}}}function ja(t){var e;if(Yt(t))return Ud(t)?t.name:(e=es(t))!==null&&e!==void 0?e:t.name;if(sD(t)||Tm(t)||Px(t))return t.name;if(Zi(t)){const n=ED(t);if(n)return n}else if(iD(t))return t.name;throw new Error("Cannot get name of Unknown Type")}function ED(t){var e;if(t.inferredType)return t.inferredType.name;if(!((e=t.type)===null||e===void 0)&&e.ref)return ja(t.type.ref)}function eO(t){var e,n,r;return Or(t)?(n=(e=t.type)===null||e===void 0?void 0:e.name)!==null&&n!==void 0?n:"string":Ud(t)?t.name:(r=es(t))!==null&&r!==void 0?r:t.name}function RD(t){var e,n,r;return Or(t)?(n=(e=t.type)===null||e===void 0?void 0:e.name)!==null&&n!==void 0?n:"string":(r=es(t))!==null&&r!==void 0?r:t.name}function Ua(t){const e={s:!1,i:!1,u:!1},n=ro(t.definition,e),r=Object.entries(e).filter(([,i])=>i).map(([i])=>i).join("");return new RegExp(n,r)}const jm=/[\s\S]/.source;function ro(t,e){if(Lx(t))return tO(t);if(Mx(t))return nO(t);if(xx(t))return sO(t);if(aD(t)){const n=t.rule.ref;if(!n)throw new Error("Missing rule reference.");return Lr(ro(n.definition),{cardinality:t.cardinality,lookahead:t.lookahead})}else{if(Nx(t))return iO(t);if(Bx(t))return rO(t);if(Fx(t)){const n=t.regex.lastIndexOf("/"),r=t.regex.substring(1,n),i=t.regex.substring(n+1);return e&&(e.i=i.includes("i"),e.s=i.includes("s"),e.u=i.includes("u")),Lr(r,{cardinality:t.cardinality,lookahead:t.lookahead,wrap:!1})}else{if(zx(t))return Lr(jm,{cardinality:t.cardinality,lookahead:t.lookahead});throw new Error(`Invalid terminal element: ${t?.$type}`)}}}function tO(t){return Lr(t.elements.map(e=>ro(e)).join("|"),{cardinality:t.cardinality,lookahead:t.lookahead})}function nO(t){return Lr(t.elements.map(e=>ro(e)).join(""),{cardinality:t.cardinality,lookahead:t.lookahead})}function rO(t){return Lr(`${jm}*?${ro(t.terminal)}`,{cardinality:t.cardinality,lookahead:t.lookahead})}function iO(t){return Lr(`(?!${ro(t.terminal)})${jm}*?`,{cardinality:t.cardinality,lookahead:t.lookahead})}function sO(t){return t.right?Lr(`[${Um(t.left)}-${Um(t.right)}]`,{cardinality:t.cardinality,lookahead:t.lookahead,wrap:!1}):Lr(Um(t.left),{cardinality:t.cardinality,lookahead:t.lookahead,wrap:!1})}function Um(t){return qd(t.value)}function Lr(t,e){var n;return(e.wrap!==!1||e.lookahead)&&(t=`(${(n=e.lookahead)!==null&&n!==void 0?n:""}${t})`),e.cardinality?`${t}${e.cardinality}`:t}const Gd={__proto__:null,findAssignment:yD,findNameAssignment:zm,findNodeForKeyword:qa,findNodeForProperty:vn,findNodesForKeyword:Mm,findNodesForKeywordInternal:Bm,findNodesForProperty:to,getActionAtElement:wD,getActionType:ED,getAllReachableRules:Nm,getCrossReferenceTerminal:Fm,getEntryRule:jd,getExplicitRuleType:es,getHiddenRules:hD,getRuleType:RD,getRuleTypeName:eO,getTypeName:ja,isArrayCardinality:bD,isArrayOperator:Qx,isCommentTerminal:gD,isDataType:Zx,isDataTypeRule:Ud,isOptionalCardinality:no,terminalRegex:Ua};function oO(t){const e=[],n=t.Grammar;for(const r of n.rules)Or(r)&&gD(r)&&Vx(Ua(r))&&e.push(r.name);return{multilineCommentRules:e,nameRegexp:gm}}var TD=typeof global=="object"&&global&&global.Object===Object&&global,aO=typeof self=="object"&&self&&self.Object===Object&&self,gr=TD||aO||Function("return this")(),Bn=gr.Symbol,$D=Object.prototype,cO=$D.hasOwnProperty,uO=$D.toString,Ga=Bn?Bn.toStringTag:void 0;function lO(t){var e=cO.call(t,Ga),n=t[Ga];try{t[Ga]=void 0;var r=!0}catch{}var i=uO.call(t);return r&&(e?t[Ga]=n:delete t[Ga]),i}var dO=Object.prototype,fO=dO.toString;function pO(t){return fO.call(t)}var hO="[object Null]",mO="[object Undefined]",SD=Bn?Bn.toStringTag:void 0;function hi(t){return t==null?t===void 0?mO:hO:SD&&SD in Object(t)?lO(t):pO(t)}function Yn(t){return t!=null&&typeof t=="object"}var gO="[object Symbol]";function Wa(t){return typeof t=="symbol"||Yn(t)&&hi(t)==gO}function Wd(t,e){for(var n=-1,r=t==null?0:t.length,i=Array(r);++n<r;)i[n]=e(t[n],n,t);return i}var ze=Array.isArray,yO=1/0,CD=Bn?Bn.prototype:void 0,kD=CD?CD.toString:void 0;function AD(t){if(typeof t=="string")return t;if(ze(t))return Wd(t,AD)+"";if(Wa(t))return kD?kD.call(t):"";var e=t+"";return e=="0"&&1/t==-yO?"-0":e}var vO=/\s/;function wO(t){for(var e=t.length;e--&&vO.test(t.charAt(e)););return e}var bO=/^\s+/;function DO(t){return t&&t.slice(0,wO(t)+1).replace(bO,"")}function zn(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var _D=NaN,EO=/^[-+]0x[0-9a-f]+$/i,RO=/^0b[01]+$/i,TO=/^0o[0-7]+$/i,$O=parseInt;function SO(t){if(typeof t=="number")return t;if(Wa(t))return _D;if(zn(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=zn(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=DO(t);var n=RO.test(t);return n||TO.test(t)?$O(t.slice(2),n?2:8):EO.test(t)?_D:+t}var PD=1/0,CO=17976931348623157e292;function kO(t){if(!t)return t===0?t:0;if(t=SO(t),t===PD||t===-PD){var e=t<0?-1:1;return e*CO}return t===t?t:0}function Hd(t){var e=kO(t),n=e%1;return e===e?n?e-n:e:0}function ts(t){return t}var AO="[object AsyncFunction]",_O="[object Function]",PO="[object GeneratorFunction]",IO="[object Proxy]";function Mr(t){if(!zn(t))return!1;var e=hi(t);return e==_O||e==PO||e==AO||e==IO}var Gm=gr["__core-js_shared__"],ID=function(){var t=/[^.]+$/.exec(Gm&&Gm.keys&&Gm.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function xO(t){return!!ID&&ID in t}var OO=Function.prototype,NO=OO.toString;function ns(t){if(t!=null){try{return NO.call(t)}catch{}try{return t+""}catch{}}return""}var FO=/[\\^$.*+?()[\]{}|]/g,LO=/^\[object .+?Constructor\]$/,MO=Function.prototype,BO=Object.prototype,zO=MO.toString,qO=BO.hasOwnProperty,jO=RegExp("^"+zO.call(qO).replace(FO,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function UO(t){if(!zn(t)||xO(t))return!1;var e=Mr(t)?jO:LO;return e.test(ns(t))}function GO(t,e){return t?.[e]}function rs(t,e){var n=GO(t,e);return UO(n)?n:void 0}var Wm=rs(gr,"WeakMap"),xD=Object.create,WO=function(){function t(){}return function(e){if(!zn(e))return{};if(xD)return xD(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}();function HO(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 xt(){}function VO(t,e){var n=-1,r=t.length;for(e||(e=Array(r));++n<r;)e[n]=t[n];return e}var KO=800,YO=16,XO=Date.now;function JO(t){var e=0,n=0;return function(){var r=XO(),i=YO-(r-n);if(n=r,i>0){if(++e>=KO)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function QO(t){return function(){return t}}var Vd=function(){try{var t=rs(Object,"defineProperty");return t({},"",{}),t}catch{}}(),ZO=Vd?function(t,e){return Vd(t,"toString",{configurable:!0,enumerable:!1,value:QO(e),writable:!0})}:ts,eN=JO(ZO);function OD(t,e){for(var n=-1,r=t==null?0:t.length;++n<r&&e(t[n],n,t)!==!1;);return t}function ND(t,e,n,r){for(var i=t.length,s=n+-1;++s<i;)if(e(t[s],s,t))return s;return-1}function tN(t){return t!==t}function nN(t,e,n){for(var r=n-1,i=t.length;++r<i;)if(t[r]===e)return r;return-1}function Hm(t,e,n){return e===e?nN(t,e,n):ND(t,tN,n)}function FD(t,e){var n=t==null?0:t.length;return!!n&&Hm(t,e,0)>-1}var rN=9007199254740991,iN=/^(?:0|[1-9]\d*)$/;function Kd(t,e){var n=typeof t;return e=e??rN,!!e&&(n=="number"||n!="symbol"&&iN.test(t))&&t>-1&&t%1==0&&t<e}function Vm(t,e,n){e=="__proto__"&&Vd?Vd(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}function Ha(t,e){return t===e||t!==t&&e!==e}var sN=Object.prototype,oN=sN.hasOwnProperty;function Yd(t,e,n){var r=t[e];(!(oN.call(t,e)&&Ha(r,n))||n===void 0&&!(e in t))&&Vm(t,e,n)}function Km(t,e,n,r){var i=!n;n||(n={});for(var s=-1,o=e.length;++s<o;){var a=e[s],c=void 0;c===void 0&&(c=t[a]),i?Vm(n,a,c):Yd(n,a,c)}return n}var LD=Math.max;function aN(t,e,n){return e=LD(e===void 0?t.length-1:e,0),function(){for(var r=arguments,i=-1,s=LD(r.length-e,0),o=Array(s);++i<s;)o[i]=r[e+i];i=-1;for(var a=Array(e+1);++i<e;)a[i]=r[i];return a[e]=n(o),HO(t,this,a)}}function Ym(t,e){return eN(aN(t,e,ts),t+"")}var cN=9007199254740991;function Xm(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=cN}function yr(t){return t!=null&&Xm(t.length)&&!Mr(t)}function MD(t,e,n){if(!zn(n))return!1;var r=typeof e;return(r=="number"?yr(n)&&Kd(e,n.length):r=="string"&&e in n)?Ha(n[e],t):!1}function uN(t){return Ym(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=t.length>3&&typeof s=="function"?(i--,s):void 0,o&&MD(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 lN=Object.prototype;function Va(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||lN;return t===n}function dN(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}var fN="[object Arguments]";function BD(t){return Yn(t)&&hi(t)==fN}var zD=Object.prototype,pN=zD.hasOwnProperty,hN=zD.propertyIsEnumerable,Xd=BD(function(){return arguments}())?BD:function(t){return Yn(t)&&pN.call(t,"callee")&&!hN.call(t,"callee")};function mN(){return!1}var qD=typeof exports=="object"&&exports&&!exports.nodeType&&exports,jD=qD&&typeof module=="object"&&module&&!module.nodeType&&module,gN=jD&&jD.exports===qD,UD=gN?gr.Buffer:void 0,yN=UD?UD.isBuffer:void 0,Ka=yN||mN,vN="[object Arguments]",wN="[object Array]",bN="[object Boolean]",DN="[object Date]",EN="[object Error]",RN="[object Function]",TN="[object Map]",$N="[object Number]",SN="[object Object]",CN="[object RegExp]",kN="[object Set]",AN="[object String]",_N="[object WeakMap]",PN="[object ArrayBuffer]",IN="[object DataView]",xN="[object Float32Array]",ON="[object Float64Array]",NN="[object Int8Array]",FN="[object Int16Array]",LN="[object Int32Array]",MN="[object Uint8Array]",BN="[object Uint8ClampedArray]",zN="[object Uint16Array]",qN="[object Uint32Array]",lt={};lt[xN]=lt[ON]=lt[NN]=lt[FN]=lt[LN]=lt[MN]=lt[BN]=lt[zN]=lt[qN]=!0,lt[vN]=lt[wN]=lt[PN]=lt[bN]=lt[IN]=lt[DN]=lt[EN]=lt[RN]=lt[TN]=lt[$N]=lt[SN]=lt[CN]=lt[kN]=lt[AN]=lt[_N]=!1;function jN(t){return Yn(t)&&Xm(t.length)&&!!lt[hi(t)]}function Jd(t){return function(e){return t(e)}}var GD=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Ya=GD&&typeof module=="object"&&module&&!module.nodeType&&module,UN=Ya&&Ya.exports===GD,Jm=UN&&TD.process,mi=function(){try{var t=Ya&&Ya.require&&Ya.require("util").types;return t||Jm&&Jm.binding&&Jm.binding("util")}catch{}}(),WD=mi&&mi.isTypedArray,Qm=WD?Jd(WD):jN,GN=Object.prototype,WN=GN.hasOwnProperty;function HD(t,e){var n=ze(t),r=!n&&Xd(t),i=!n&&!r&&Ka(t),s=!n&&!r&&!i&&Qm(t),o=n||r||i||s,a=o?dN(t.length,String):[],c=a.length;for(var u in t)(e||WN.call(t,u))&&!(o&&(u=="length"||i&&(u=="offset"||u=="parent")||s&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||Kd(u,c)))&&a.push(u);return a}function VD(t,e){return function(n){return t(e(n))}}var HN=VD(Object.keys,Object),VN=Object.prototype,KN=VN.hasOwnProperty;function KD(t){if(!Va(t))return HN(t);var e=[];for(var n in Object(t))KN.call(t,n)&&n!="constructor"&&e.push(n);return e}function qn(t){return yr(t)?HD(t):KD(t)}var YN=Object.prototype,XN=YN.hasOwnProperty,Sn=uN(function(t,e){if(Va(e)||yr(e)){Km(e,qn(e),t);return}for(var n in e)XN.call(e,n)&&Yd(t,n,e[n])});function JN(t){var e=[];if(t!=null)for(var n in Object(t))e.push(n);return e}var QN=Object.prototype,ZN=QN.hasOwnProperty;function eF(t){if(!zn(t))return JN(t);var e=Va(t),n=[];for(var r in t)r=="constructor"&&(e||!ZN.call(t,r))||n.push(r);return n}function YD(t){return yr(t)?HD(t,!0):eF(t)}var tF=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,nF=/^\w*$/;function Zm(t,e){if(ze(t))return!1;var n=typeof t;return n=="number"||n=="symbol"||n=="boolean"||t==null||Wa(t)?!0:nF.test(t)||!tF.test(t)||e!=null&&t in Object(e)}var Xa=rs(Object,"create");function rF(){this.__data__=Xa?Xa(null):{},this.size=0}function iF(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var sF="__lodash_hash_undefined__",oF=Object.prototype,aF=oF.hasOwnProperty;function cF(t){var e=this.__data__;if(Xa){var n=e[t];return n===sF?void 0:n}return aF.call(e,t)?e[t]:void 0}var uF=Object.prototype,lF=uF.hasOwnProperty;function dF(t){var e=this.__data__;return Xa?e[t]!==void 0:lF.call(e,t)}var fF="__lodash_hash_undefined__";function pF(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=Xa&&e===void 0?fF:e,this}function is(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])}}is.prototype.clear=rF,is.prototype.delete=iF,is.prototype.get=cF,is.prototype.has=dF,is.prototype.set=pF;function hF(){this.__data__=[],this.size=0}function Qd(t,e){for(var n=t.length;n--;)if(Ha(t[n][0],e))return n;return-1}var mF=Array.prototype,gF=mF.splice;function yF(t){var e=this.__data__,n=Qd(e,t);if(n<0)return!1;var r=e.length-1;return n==r?e.pop():gF.call(e,n,1),--this.size,!0}function vF(t){var e=this.__data__,n=Qd(e,t);return n<0?void 0:e[n][1]}function wF(t){return Qd(this.__data__,t)>-1}function bF(t,e){var n=this.__data__,r=Qd(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}function Br(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])}}Br.prototype.clear=hF,Br.prototype.delete=yF,Br.prototype.get=vF,Br.prototype.has=wF,Br.prototype.set=bF;var Ja=rs(gr,"Map");function DF(){this.size=0,this.__data__={hash:new is,map:new(Ja||Br),string:new is}}function EF(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function Zd(t,e){var n=t.__data__;return EF(e)?n[typeof e=="string"?"string":"hash"]:n.map}function RF(t){var e=Zd(this,t).delete(t);return this.size-=e?1:0,e}function TF(t){return Zd(this,t).get(t)}function $F(t){return Zd(this,t).has(t)}function SF(t,e){var n=Zd(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this}function zr(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])}}zr.prototype.clear=DF,zr.prototype.delete=RF,zr.prototype.get=TF,zr.prototype.has=$F,zr.prototype.set=SF;var CF="Expected a function";function eg(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(CF);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(eg.Cache||zr),n}eg.Cache=zr;var kF=500;function AF(t){var e=eg(t,function(r){return n.size===kF&&n.clear(),r}),n=e.cache;return e}var _F=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,PF=/\\(\\)?/g,IF=AF(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(_F,function(n,r,i,s){e.push(i?s.replace(PF,"$1"):r||n)}),e});function xF(t){return t==null?"":AD(t)}function ef(t,e){return ze(t)?t:Zm(t,e)?[t]:IF(xF(t))}var OF=1/0;function Qa(t){if(typeof t=="string"||Wa(t))return t;var e=t+"";return e=="0"&&1/t==-OF?"-0":e}function tg(t,e){e=ef(e,t);for(var n=0,r=e.length;t!=null&&n<r;)t=t[Qa(e[n++])];return n&&n==r?t:void 0}function NF(t,e,n){var r=t==null?void 0:tg(t,e);return r===void 0?n:r}function ng(t,e){for(var n=-1,r=e.length,i=t.length;++n<r;)t[i+n]=e[n];return t}var XD=Bn?Bn.isConcatSpreadable:void 0;function FF(t){return ze(t)||Xd(t)||!!(XD&&t&&t[XD])}function rg(t,e,n,r,i){var s=-1,o=t.length;for(n||(n=FF),i||(i=[]);++s<o;){var a=t[s];n(a)?ng(i,a):r||(i[i.length]=a)}return i}function jn(t){var e=t==null?0:t.length;return e?rg(t):[]}var JD=VD(Object.getPrototypeOf,Object);function QD(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>>>0,e>>>=0;for(var s=Array(i);++r<i;)s[r]=t[r+e];return s}function LF(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 MF(){this.__data__=new Br,this.size=0}function BF(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}function zF(t){return this.__data__.get(t)}function qF(t){return this.__data__.has(t)}var jF=200;function UF(t,e){var n=this.__data__;if(n instanceof Br){var r=n.__data__;if(!Ja||r.length<jF-1)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new zr(r)}return n.set(t,e),this.size=n.size,this}function vr(t){var e=this.__data__=new Br(t);this.size=e.size}vr.prototype.clear=MF,vr.prototype.delete=BF,vr.prototype.get=zF,vr.prototype.has=qF,vr.prototype.set=UF;function GF(t,e){return t&&Km(e,qn(e),t)}var ZD=typeof exports=="object"&&exports&&!exports.nodeType&&exports,eE=ZD&&typeof module=="object"&&module&&!module.nodeType&&module,WF=eE&&eE.exports===ZD,tE=WF?gr.Buffer:void 0,nE=tE?tE.allocUnsafe:void 0;function HF(t,e){var n=t.length,r=nE?nE(n):new t.constructor(n);return t.copy(r),r}function ig(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 rE(){return[]}var VF=Object.prototype,KF=VF.propertyIsEnumerable,iE=Object.getOwnPropertySymbols,sg=iE?function(t){return t==null?[]:(t=Object(t),ig(iE(t),function(e){return KF.call(t,e)}))}:rE;function YF(t,e){return Km(t,sg(t),e)}var XF=Object.getOwnPropertySymbols,JF=XF?function(t){for(var e=[];t;)ng(e,sg(t)),t=JD(t);return e}:rE;function sE(t,e,n){var r=e(t);return ze(t)?r:ng(r,n(t))}function og(t){return sE(t,qn,sg)}function QF(t){return sE(t,YD,JF)}var ag=rs(gr,"DataView"),cg=rs(gr,"Promise"),io=rs(gr,"Set"),oE="[object Map]",ZF="[object Object]",aE="[object Promise]",cE="[object Set]",uE="[object WeakMap]",lE="[object DataView]",eL=ns(ag),tL=ns(Ja),nL=ns(cg),rL=ns(io),iL=ns(Wm),Un=hi;(ag&&Un(new ag(new ArrayBuffer(1)))!=lE||Ja&&Un(new Ja)!=oE||cg&&Un(cg.resolve())!=aE||io&&Un(new io)!=cE||Wm&&Un(new Wm)!=uE)&&(Un=function(t){var e=hi(t),n=e==ZF?t.constructor:void 0,r=n?ns(n):"";if(r)switch(r){case eL:return lE;case tL:return oE;case nL:return aE;case rL:return cE;case iL:return uE}return e});var sL=Object.prototype,oL=sL.hasOwnProperty;function aL(t){var e=t.length,n=new t.constructor(e);return e&&typeof t[0]=="string"&&oL.call(t,"index")&&(n.index=t.index,n.input=t.input),n}var tf=gr.Uint8Array;function cL(t){var e=new t.constructor(t.byteLength);return new tf(e).set(new tf(t)),e}function uL(t,e){var n=t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}var lL=/\w*$/;function dL(t){var e=new t.constructor(t.source,lL.exec(t));return e.lastIndex=t.lastIndex,e}var dE=Bn?Bn.prototype:void 0,fE=dE?dE.valueOf:void 0;function fL(t){return fE?Object(fE.call(t)):{}}function pL(t,e){var n=t.buffer;return new t.constructor(n,t.byteOffset,t.length)}var hL="[object Boolean]",mL="[object Date]",gL="[object Map]",yL="[object Number]",vL="[object RegExp]",wL="[object Set]",bL="[object String]",DL="[object Symbol]",EL="[object ArrayBuffer]",RL="[object DataView]",TL="[object Float32Array]",$L="[object Float64Array]",SL="[object Int8Array]",CL="[object Int16Array]",kL="[object Int32Array]",AL="[object Uint8Array]",_L="[object Uint8ClampedArray]",PL="[object Uint16Array]",IL="[object Uint32Array]";function xL(t,e,n){var r=t.constructor;switch(e){case EL:return cL(t);case hL:case mL:return new r(+t);case RL:return uL(t);case TL:case $L:case SL:case CL:case kL:case AL:case _L:case PL:case IL:return pL(t);case gL:return new r;case yL:case bL:return new r(t);case vL:return dL(t);case wL:return new r;case DL:return fL(t)}}function OL(t){return typeof t.constructor=="function"&&!Va(t)?WO(JD(t)):{}}var NL="[object Map]";function FL(t){return Yn(t)&&Un(t)==NL}var pE=mi&&mi.isMap,LL=pE?Jd(pE):FL,ML="[object Set]";function BL(t){return Yn(t)&&Un(t)==ML}var hE=mi&&mi.isSet,zL=hE?Jd(hE):BL,mE="[object Arguments]",qL="[object Array]",jL="[object Boolean]",UL="[object Date]",GL="[object Error]",gE="[object Function]",WL="[object GeneratorFunction]",HL="[object Map]",VL="[object Number]",yE="[object Object]",KL="[object RegExp]",YL="[object Set]",XL="[object String]",JL="[object Symbol]",QL="[object WeakMap]",ZL="[object ArrayBuffer]",eM="[object DataView]",tM="[object Float32Array]",nM="[object Float64Array]",rM="[object Int8Array]",iM="[object Int16Array]",sM="[object Int32Array]",oM="[object Uint8Array]",aM="[object Uint8ClampedArray]",cM="[object Uint16Array]",uM="[object Uint32Array]",ot={};ot[mE]=ot[qL]=ot[ZL]=ot[eM]=ot[jL]=ot[UL]=ot[tM]=ot[nM]=ot[rM]=ot[iM]=ot[sM]=ot[HL]=ot[VL]=ot[yE]=ot[KL]=ot[YL]=ot[XL]=ot[JL]=ot[oM]=ot[aM]=ot[cM]=ot[uM]=!0,ot[GL]=ot[gE]=ot[QL]=!1;function nf(t,e,n,r,i,s){var o;if(o!==void 0)return o;if(!zn(t))return t;var a=ze(t);if(a)return o=aL(t),VO(t,o);var c=Un(t),u=c==gE||c==WL;if(Ka(t))return HF(t);if(c==yE||c==mE||u&&!i)return o=u?{}:OL(t),YF(t,GF(o,t));if(!ot[c])return i?t:{};o=xL(t,c),s||(s=new vr);var l=s.get(t);if(l)return l;s.set(t,o),zL(t)?t.forEach(function(p){o.add(nf(p,e,n,p,t,s))}):LL(t)&&t.forEach(function(p,m){o.set(m,nf(p,e,n,m,t,s))});var d=og,f=a?void 0:d(t);return OD(f||t,function(p,m){f&&(m=p,p=t[m]),Yd(o,m,nf(p,e,n,m,t,s))}),o}var lM=4;function qt(t){return nf(t,lM)}function Za(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 dM="__lodash_hash_undefined__";function fM(t){return this.__data__.set(t,dM),this}function pM(t){return this.__data__.has(t)}function so(t){var e=-1,n=t==null?0:t.length;for(this.__data__=new zr;++e<n;)this.add(t[e])}so.prototype.add=so.prototype.push=fM,so.prototype.has=pM;function vE(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 hM=1,mM=2;function wE(t,e,n,r,i,s){var o=n&hM,a=t.length,c=e.length;if(a!=c&&!(o&&c>a))return!1;var u=s.get(t),l=s.get(e);if(u&&l)return u==e&&l==t;var d=-1,f=!0,p=n&mM?new so:void 0;for(s.set(t,e),s.set(e,t);++d<a;){var m=t[d],w=e[d];if(r)var E=o?r(w,m,d,e,t,s):r(m,w,d,t,e,s);if(E!==void 0){if(E)continue;f=!1;break}if(p){if(!vE(e,function(y,b){if(!ug(p,b)&&(m===y||i(m,y,n,r,s)))return p.push(b)})){f=!1;break}}else if(!(m===w||i(m,w,n,r,s))){f=!1;break}}return s.delete(t),s.delete(e),f}function gM(t){var e=-1,n=Array(t.size);return t.forEach(function(r,i){n[++e]=[i,r]}),n}function lg(t){var e=-1,n=Array(t.size);return t.forEach(function(r){n[++e]=r}),n}var yM=1,vM=2,wM="[object Boolean]",bM="[object Date]",DM="[object Error]",EM="[object Map]",RM="[object Number]",TM="[object RegExp]",$M="[object Set]",SM="[object String]",CM="[object Symbol]",kM="[object ArrayBuffer]",AM="[object DataView]",bE=Bn?Bn.prototype:void 0,dg=bE?bE.valueOf:void 0;function _M(t,e,n,r,i,s,o){switch(n){case AM:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case kM:return!(t.byteLength!=e.byteLength||!s(new tf(t),new tf(e)));case wM:case bM:case RM:return Ha(+t,+e);case DM:return t.name==e.name&&t.message==e.message;case TM:case SM:return t==e+"";case EM:var a=gM;case $M:var c=r&yM;if(a||(a=lg),t.size!=e.size&&!c)return!1;var u=o.get(t);if(u)return u==e;r|=vM,o.set(t,e);var l=wE(a(t),a(e),r,i,s,o);return o.delete(t),l;case CM:if(dg)return dg.call(t)==dg.call(e)}return!1}var PM=1,IM=Object.prototype,xM=IM.hasOwnProperty;function OM(t,e,n,r,i,s){var o=n&PM,a=og(t),c=a.length,u=og(e),l=u.length;if(c!=l&&!o)return!1;for(var d=c;d--;){var f=a[d];if(!(o?f in e:xM.call(e,f)))return!1}var p=s.get(t),m=s.get(e);if(p&&m)return p==e&&m==t;var w=!0;s.set(t,e),s.set(e,t);for(var E=o;++d<c;){f=a[d];var y=t[f],b=e[f];if(r)var R=o?r(b,y,f,e,t,s):r(y,b,f,t,e,s);if(!(R===void 0?y===b||i(y,b,n,r,s):R)){w=!1;break}E||(E=f=="constructor")}if(w&&!E){var C=t.constructor,A=e.constructor;C!=A&&"constructor"in t&&"constructor"in e&&!(typeof C=="function"&&C instanceof C&&typeof A=="function"&&A instanceof A)&&(w=!1)}return s.delete(t),s.delete(e),w}var NM=1,DE="[object Arguments]",EE="[object Array]",rf="[object Object]",FM=Object.prototype,RE=FM.hasOwnProperty;function LM(t,e,n,r,i,s){var o=ze(t),a=ze(e),c=o?EE:Un(t),u=a?EE:Un(e);c=c==DE?rf:c,u=u==DE?rf:u;var l=c==rf,d=u==rf,f=c==u;if(f&&Ka(t)){if(!Ka(e))return!1;o=!0,l=!1}if(f&&!l)return s||(s=new vr),o||Qm(t)?wE(t,e,n,r,i,s):_M(t,e,c,n,r,i,s);if(!(n&NM)){var p=l&&RE.call(t,"__wrapped__"),m=d&&RE.call(e,"__wrapped__");if(p||m){var w=p?t.value():t,E=m?e.value():e;return s||(s=new vr),i(w,E,n,r,s)}}return f?(s||(s=new vr),OM(t,e,n,r,i,s)):!1}function fg(t,e,n,r,i){return t===e?!0:t==null||e==null||!Yn(t)&&!Yn(e)?t!==t&&e!==e:LM(t,e,n,r,fg,i)}var MM=1,BM=2;function zM(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],c=t[a],u=o[1];if(o[2]){if(c===void 0&&!(a in t))return!1}else{var l=new vr,d;if(!(d===void 0?fg(u,c,MM|BM,r,l):d))return!1}}return!0}function TE(t){return t===t&&!zn(t)}function qM(t){for(var e=qn(t),n=e.length;n--;){var r=e[n],i=t[r];e[n]=[r,i,TE(i)]}return e}function $E(t,e){return function(n){return n==null?!1:n[t]===e&&(e!==void 0||t in Object(n))}}function jM(t){var e=qM(t);return e.length==1&&e[0][2]?$E(e[0][0],e[0][1]):function(n){return n===t||zM(n,t,e)}}function UM(t,e){return t!=null&&e in Object(t)}function SE(t,e,n){e=ef(e,t);for(var r=-1,i=e.length,s=!1;++r<i;){var o=Qa(e[r]);if(!(s=t!=null&&n(t,o)))break;t=t[o]}return s||++r!=i?s:(i=t==null?0:t.length,!!i&&Xm(i)&&Kd(o,i)&&(ze(t)||Xd(t)))}function GM(t,e){return t!=null&&SE(t,e,UM)}var WM=1,HM=2;function VM(t,e){return Zm(t)&&TE(e)?$E(Qa(t),e):function(n){var r=NF(n,t);return r===void 0&&r===e?GM(n,t):fg(e,r,WM|HM)}}function KM(t){return function(e){return e?.[t]}}function YM(t){return function(e){return tg(e,t)}}function XM(t){return Zm(t)?KM(Qa(t)):YM(t)}function Xn(t){return typeof t=="function"?t:t==null?ts:typeof t=="object"?ze(t)?VM(t[0],t[1]):jM(t):XM(t)}function JM(t,e,n,r){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 QM(t){return function(e,n,r){for(var i=-1,s=Object(e),o=r(e),a=o.length;a--;){var c=o[++i];if(n(s[c],c,s)===!1)break}return e}}var ZM=QM();function e2(t,e){return t&&ZM(t,e,qn)}function t2(t,e){return function(n,r){if(n==null)return n;if(!yr(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 ss=t2(e2);function n2(t,e,n,r){return ss(t,function(i,s,o){e(r,i,n(i),o)}),r}function r2(t,e){return function(n,r){var i=ze(n)?JM:n2,s=e?e():{};return i(n,t,Xn(r),s)}}var CE=Object.prototype,i2=CE.hasOwnProperty,pg=Ym(function(t,e){t=Object(t);var n=-1,r=e.length,i=r>2?e[2]:void 0;for(i&&MD(e[0],e[1],i)&&(r=1);++n<r;)for(var s=e[n],o=YD(s),a=-1,c=o.length;++a<c;){var u=o[a],l=t[u];(l===void 0||Ha(l,CE[u])&&!i2.call(t,u))&&(t[u]=s[u])}return t});function kE(t){return Yn(t)&&yr(t)}var s2=200;function o2(t,e,n,r){var i=-1,s=FD,o=!0,a=t.length,c=[],u=e.length;if(!a)return c;e.length>=s2&&(s=ug,o=!1,e=new so(e));e:for(;++i<a;){var l=t[i],d=l;if(l=l!==0?l:0,o&&d===d){for(var f=u;f--;)if(e[f]===d)continue e;c.push(l)}else s(e,d,r)||c.push(l)}return c}var sf=Ym(function(t,e){return kE(t)?o2(t,rg(e,1,kE,!0)):[]});function oo(t){var e=t==null?0:t.length;return e?t[e-1]:void 0}function jt(t,e,n){var r=t==null?0:t.length;return r?(e=e===void 0?1:Hd(e),QD(t,e<0?0:e,r)):[]}function ec(t,e,n){var r=t==null?0:t.length;return r?(e=e===void 0?1:Hd(e),e=r-e,QD(t,0,e<0?0:e)):[]}function a2(t){return typeof t=="function"?t:ts}function De(t,e){var n=ze(t)?OD:ss;return n(t,a2(e))}function c2(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 u2(t,e){var n=!0;return ss(t,function(r,i,s){return n=!!e(r,i,s),n}),n}function Jn(t,e,n){var r=ze(t)?c2:u2;return r(t,Xn(e))}function AE(t,e){var n=[];return ss(t,function(r,i,s){e(r,i,s)&&n.push(r)}),n}function Cn(t,e){var n=ze(t)?ig:AE;return n(t,Xn(e))}function l2(t){return function(e,n,r){var i=Object(e);if(!yr(e)){var s=Xn(n);e=qn(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 d2=Math.max;function f2(t,e,n){var r=t==null?0:t.length;if(!r)return-1;var i=n==null?0:Hd(n);return i<0&&(i=d2(r+i,0)),ND(t,Xn(e),i)}var ao=l2(f2);function Qn(t){return t&&t.length?t[0]:void 0}function p2(t,e){var n=-1,r=yr(t)?Array(t.length):[];return ss(t,function(i,s,o){r[++n]=e(i,s,o)}),r}function fe(t,e){var n=ze(t)?Wd:p2;return n(t,Xn(e))}function kn(t,e){return rg(fe(t,e))}var h2=Object.prototype,m2=h2.hasOwnProperty,g2=r2(function(t,e,n){m2.call(t,n)?t[n].push(e):Vm(t,n,[e])}),y2=Object.prototype,v2=y2.hasOwnProperty;function w2(t,e){return t!=null&&v2.call(t,e)}function Ee(t,e){return t!=null&&SE(t,e,w2)}var b2="[object String]";function wn(t){return typeof t=="string"||!ze(t)&&Yn(t)&&hi(t)==b2}function D2(t,e){return Wd(e,function(n){return t[n]})}function Ot(t){return t==null?[]:D2(t,qn(t))}var E2=Math.max;function sn(t,e,n,r){t=yr(t)?t:Ot(t),n=n&&!r?Hd(n):0;var i=t.length;return n<0&&(n=E2(i+n,0)),wn(t)?n<=i&&t.indexOf(e,n)>-1:!!i&&Hm(t,e,n)>-1}function _E(t,e,n){var r=t==null?0:t.length;if(!r)return-1;var i=0;return Hm(t,e,i)}var R2="[object Map]",T2="[object Set]",$2=Object.prototype,S2=$2.hasOwnProperty;function nt(t){if(t==null)return!0;if(yr(t)&&(ze(t)||typeof t=="string"||typeof t.splice=="function"||Ka(t)||Qm(t)||Xd(t)))return!t.length;var e=Un(t);if(e==R2||e==T2)return!t.size;if(Va(t))return!KD(t).length;for(var n in t)if(S2.call(t,n))return!1;return!0}var C2="[object RegExp]";function k2(t){return Yn(t)&&hi(t)==C2}var PE=mi&&mi.isRegExp,qr=PE?Jd(PE):k2;function jr(t){return t===void 0}function A2(t,e){return t<e}function _2(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&&!Wa(o):n(o,a)))var a=o,c=s}return c}function P2(t){return t&&t.length?_2(t,ts,A2):void 0}var I2="Expected a function";function x2(t){if(typeof t!="function")throw new TypeError(I2);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}function O2(t,e,n,r){if(!zn(t))return t;e=ef(e,t);for(var i=-1,s=e.length,o=s-1,a=t;a!=null&&++i<s;){var c=Qa(e[i]),u=n;if(c==="__proto__"||c==="constructor"||c==="prototype")return t;if(i!=o){var l=a[c];u=void 0,u===void 0&&(u=zn(l)?l:Kd(e[i+1])?[]:{})}Yd(a,c,u),a=a[c]}return t}function N2(t,e,n){for(var r=-1,i=e.length,s={};++r<i;){var o=e[r],a=tg(t,o);n(a,o)&&O2(s,ef(o,t),a)}return s}function Zn(t,e){if(t==null)return{};var n=Wd(QF(t),function(r){return[r]});return e=Xn(e),N2(t,n,function(r,i){return e(r,i[0])})}function F2(t,e,n,r,i){return i(t,function(s,o,a){n=r?(r=!1,s):e(n,s,o,a)}),n}function on(t,e,n){var r=ze(t)?LF:F2,i=arguments.length<3;return r(t,Xn(e),n,i,ss)}function of(t,e){var n=ze(t)?ig:AE;return n(t,x2(Xn(e)))}function L2(t,e){var n;return ss(t,function(r,i,s){return n=e(r,i,s),!n}),!!n}function IE(t,e,n){var r=ze(t)?vE:L2;return r(t,Xn(e))}var M2=1/0,B2=io&&1/lg(new io([,-0]))[1]==M2?function(t){return new io(t)}:xt,z2=200;function xE(t,e,n){var r=-1,i=FD,s=t.length,o=!0,a=[],c=a;if(s>=z2){var u=e?null:B2(t);if(u)return lg(u);o=!1,i=ug,c=new so}else c=e?[]:a;e:for(;++r<s;){var l=t[r],d=e?e(l):l;if(l=l!==0?l:0,o&&d===d){for(var f=c.length;f--;)if(c[f]===d)continue e;e&&c.push(d),a.push(l)}else i(c,d,n)||(c!==a&&c.push(d),a.push(l))}return a}function hg(t){return t&&t.length?xE(t):[]}function q2(t,e){return t&&t.length?xE(t,Xn(e)):[]}function mg(t){console&&console.error&&console.error(`Error: ${t}`)}function OE(t){console&&console.warn&&console.warn(`Warning: ${t}`)}function NE(t){const e=new Date().getTime(),n=t();return{time:new Date().getTime()-e,value:n}}function FE(t){function e(){}e.prototype=t;const n=new e;function r(){return typeof n.bar}return r(),r(),t}function j2(t){return U2(t)?t.LABEL:t.name}function U2(t){return wn(t.LABEL)&&t.LABEL!==""}class wr{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){this._definition=e}accept(e){e.visit(this),De(this.definition,n=>{n.accept(e)})}}class an extends wr{constructor(e){super([]),this.idx=1,Sn(this,Zn(e,n=>n!==void 0))}set definition(e){}get definition(){return this.referencedRule!==void 0?this.referencedRule.definition:[]}accept(e){e.visit(this)}}class co extends wr{constructor(e){super(e.definition),this.orgText="",Sn(this,Zn(e,n=>n!==void 0))}}class bn extends wr{constructor(e){super(e.definition),this.ignoreAmbiguities=!1,Sn(this,Zn(e,n=>n!==void 0))}}class Ut extends wr{constructor(e){super(e.definition),this.idx=1,Sn(this,Zn(e,n=>n!==void 0))}}class An extends wr{constructor(e){super(e.definition),this.idx=1,Sn(this,Zn(e,n=>n!==void 0))}}class _n extends wr{constructor(e){super(e.definition),this.idx=1,Sn(this,Zn(e,n=>n!==void 0))}}class Dt extends wr{constructor(e){super(e.definition),this.idx=1,Sn(this,Zn(e,n=>n!==void 0))}}class Dn extends wr{constructor(e){super(e.definition),this.idx=1,Sn(this,Zn(e,n=>n!==void 0))}}class En extends wr{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,Sn(this,Zn(e,n=>n!==void 0))}}class dt{constructor(e){this.idx=1,Sn(this,Zn(e,n=>n!==void 0))}accept(e){e.visit(this)}}function G2(t){return fe(t,af)}function af(t){function e(n){return fe(n,af)}if(t instanceof an){const n={type:"NonTerminal",name:t.nonTerminalName,idx:t.idx};return wn(t.label)&&(n.label=t.label),n}else{if(t instanceof bn)return{type:"Alternative",definition:e(t.definition)};if(t instanceof Ut)return{type:"Option",idx:t.idx,definition:e(t.definition)};if(t instanceof An)return{type:"RepetitionMandatory",idx:t.idx,definition:e(t.definition)};if(t instanceof _n)return{type:"RepetitionMandatoryWithSeparator",idx:t.idx,separator:af(new dt({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof Dn)return{type:"RepetitionWithSeparator",idx:t.idx,separator:af(new dt({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof Dt)return{type:"Repetition",idx:t.idx,definition:e(t.definition)};if(t instanceof En)return{type:"Alternation",idx:t.idx,definition:e(t.definition)};if(t instanceof dt){const n={type:"Terminal",name:t.terminalType.name,label:j2(t.terminalType),idx:t.idx};wn(t.label)&&(n.terminalLabel=t.label);const r=t.terminalType.PATTERN;return t.terminalType.PATTERN&&(n.pattern=qr(r)?r.source:r),n}else{if(t instanceof co)return{type:"Rule",name:t.name,orgText:t.orgText,definition:e(t.definition)};throw Error("non exhaustive match")}}}class uo{visit(e){const n=e;switch(n.constructor){case an:return this.visitNonTerminal(n);case bn:return this.visitAlternative(n);case Ut:return this.visitOption(n);case An:return this.visitRepetitionMandatory(n);case _n:return this.visitRepetitionMandatoryWithSeparator(n);case Dn:return this.visitRepetitionWithSeparator(n);case Dt:return this.visitRepetition(n);case En:return this.visitAlternation(n);case dt:return this.visitTerminal(n);case co: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 W2(t){return t instanceof bn||t instanceof Ut||t instanceof Dt||t instanceof An||t instanceof _n||t instanceof Dn||t instanceof dt||t instanceof co}function cf(t,e=[]){return t instanceof Ut||t instanceof Dt||t instanceof Dn?!0:t instanceof En?IE(t.definition,r=>cf(r,e)):t instanceof an&&sn(e,t)?!1:t instanceof wr?(t instanceof an&&e.push(t),Jn(t.definition,r=>cf(r,e))):!1}function H2(t){return t instanceof En}function br(t){if(t instanceof an)return"SUBRULE";if(t instanceof Ut)return"OPTION";if(t instanceof En)return"OR";if(t instanceof An)return"AT_LEAST_ONE";if(t instanceof _n)return"AT_LEAST_ONE_SEP";if(t instanceof Dn)return"MANY_SEP";if(t instanceof Dt)return"MANY";if(t instanceof dt)return"CONSUME";throw Error("non exhaustive match")}class uf{walk(e,n=[]){De(e.definition,(r,i)=>{const s=jt(e.definition,i+1);if(r instanceof an)this.walkProdRef(r,s,n);else if(r instanceof dt)this.walkTerminal(r,s,n);else if(r instanceof bn)this.walkFlat(r,s,n);else if(r instanceof Ut)this.walkOption(r,s,n);else if(r instanceof An)this.walkAtLeastOne(r,s,n);else if(r instanceof _n)this.walkAtLeastOneSep(r,s,n);else if(r instanceof Dn)this.walkManySep(r,s,n);else if(r instanceof Dt)this.walkMany(r,s,n);else if(r instanceof En)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 Ut({definition:e.definition})].concat(n,r);this.walk(e,i)}walkAtLeastOneSep(e,n,r){const i=LE(e,n,r);this.walk(e,i)}walkMany(e,n,r){const i=[new Ut({definition:e.definition})].concat(n,r);this.walk(e,i)}walkManySep(e,n,r){const i=LE(e,n,r);this.walk(e,i)}walkOr(e,n,r){const i=n.concat(r);De(e.definition,s=>{const o=new bn({definition:[s]});this.walk(o,i)})}}function LE(t,e,n){return[new Ut({definition:[new dt({terminalType:t.separator})].concat(t.definition)})].concat(e,n)}function tc(t){if(t instanceof an)return tc(t.referencedRule);if(t instanceof dt)return Y2(t);if(W2(t))return V2(t);if(H2(t))return K2(t);throw Error("non exhaustive match")}function V2(t){let e=[];const n=t.definition;let r=0,i=n.length>r,s,o=!0;for(;i&&o;)s=n[r],o=cf(s),e=e.concat(tc(s)),r=r+1,i=n.length>r;return hg(e)}function K2(t){const e=fe(t.definition,n=>tc(n));return hg(jn(e))}function Y2(t){return[t.terminalType]}const ME="_~IN~_";class X2 extends uf{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=Q2(e.referencedRule,e.idx)+this.topProd.name,s=n.concat(r),o=new bn({definition:s}),a=tc(o);this.follows[i]=a}}function J2(t){const e={};return De(t,n=>{const r=new X2(n).startWalking();Sn(e,r)}),e}function Q2(t,e){return t.name+e+ME}let lf={};const Z2=new fD;function df(t){const e=t.toString();if(lf.hasOwnProperty(e))return lf[e];{const n=Z2.pattern(e);return lf[e]=n,n}}function eB(){lf={}}const BE="Complement Sets are not supported for first char optimization",ff=`Unable to use "first char" lexer optimizations:
|
|
13
|
+
`;function tB(t,e=!1){try{const n=df(t);return gg(n.value,{},n.flags.ignoreCase)}catch(n){if(n.message===BE)e&&OE(`${ff} Unable to optimize: < ${t.toString()} >
|
|
14
|
+
Complement Sets cannot be automatically optimized.
|
|
15
|
+
This will disable the lexer's first char optimizations.
|
|
16
|
+
See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#COMPLEMENT for details.`);else{let r="";e&&(r=`
|
|
17
|
+
This will disable the lexer's first char optimizations.
|
|
18
|
+
See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details.`),mg(`${ff}
|
|
19
|
+
Failed parsing: < ${t.toString()} >
|
|
20
|
+
Using the @chevrotain/regexp-to-ast library
|
|
21
|
+
Please open an issue at: https://github.com/chevrotain/chevrotain/issues`+r)}}return[]}function gg(t,e,n){switch(t.type){case"Disjunction":for(let i=0;i<t.value.length;i++)gg(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":pf(o.value,e,n);break;case"Set":if(o.complement===!0)throw Error(BE);De(o.value,c=>{if(typeof c=="number")pf(c,e,n);else{const u=c;if(n===!0)for(let l=u.from;l<=u.to;l++)pf(l,e,n);else{for(let l=u.from;l<=u.to&&l<rc;l++)pf(l,e,n);if(u.to>=rc){const l=u.from>=rc?u.from:rc,d=u.to,f=gi(l),p=gi(d);for(let m=f;m<=p;m++)e[m]=m}}}});break;case"Group":gg(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"&&yg(o)===!1||o.type!=="Group"&&a===!1)break}break;default:throw Error("non exhaustive match!")}return Ot(e)}function pf(t,e,n){const r=gi(t);e[r]=r,n===!0&&nB(t,e)}function nB(t,e){const n=String.fromCharCode(t),r=n.toUpperCase();if(r!==n){const i=gi(r.charCodeAt(0));e[i]=i}else{const i=n.toLowerCase();if(i!==n){const s=gi(i.charCodeAt(0));e[s]=s}}}function zE(t,e){return ao(t.value,n=>{if(typeof n=="number")return sn(e,n);{const r=n;return ao(e,i=>r.from<=i&&i<=r.to)!==void 0}})}function yg(t){const e=t.quantifier;return e&&e.atLeast===0?!0:t.value?ze(t.value)?Jn(t.value,yg):yg(t.value):!1}class rB 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){sn(this.targetCharCodes,e.value)&&(this.found=!0)}visitSet(e){e.complement?zE(e,this.targetCharCodes)===void 0&&(this.found=!0):zE(e,this.targetCharCodes)!==void 0&&(this.found=!0)}}function vg(t,e){if(e instanceof RegExp){const n=df(e),r=new rB(t);return r.visit(n),r.found}else return ao(e,n=>sn(t,n.charCodeAt(0)))!==void 0}const os="PATTERN",nc="defaultMode",hf="modes";let qE=typeof new RegExp("(?:)").sticky=="boolean";function iB(t,e){e=pg(e,{useSticky:qE,debug:!1,safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r",`
|
|
22
|
+
`],tracer:(b,R)=>R()});const n=e.tracer;n("initCharCodeToOptimizedIndexMap",()=>{CB()});let r;n("Reject Lexer.NA",()=>{r=of(t,b=>b[os]===Rn.NA)});let i=!1,s;n("Transform Patterns",()=>{i=!1,s=fe(r,b=>{const R=b[os];if(qr(R)){const C=R.source;return C.length===1&&C!=="^"&&C!=="$"&&C!=="."&&!R.ignoreCase?C:C.length===2&&C[0]==="\\"&&!sn(["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"],C[1])?C[1]:e.useSticky?UE(R):jE(R)}else{if(Mr(R))return i=!0,{exec:R};if(typeof R=="object")return i=!0,R;if(typeof R=="string"){if(R.length===1)return R;{const C=R.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"),A=new RegExp(C);return e.useSticky?UE(A):jE(A)}}else throw Error("non exhaustive match")}})});let o,a,c,u,l;n("misc mapping",()=>{o=fe(r,b=>b.tokenTypeIdx),a=fe(r,b=>{const R=b.GROUP;if(R!==Rn.SKIPPED){if(wn(R))return R;if(jr(R))return!1;throw Error("non exhaustive match")}}),c=fe(r,b=>{const R=b.LONGER_ALT;if(R)return ze(R)?fe(R,A=>_E(r,A)):[_E(r,R)]}),u=fe(r,b=>b.PUSH_MODE),l=fe(r,b=>Ee(b,"POP_MODE"))});let d;n("Line Terminator Handling",()=>{const b=HE(e.lineTerminatorCharacters);d=fe(r,R=>!1),e.positionTracking!=="onlyOffset"&&(d=fe(r,R=>Ee(R,"LINE_BREAKS")?!!R.LINE_BREAKS:WE(R,b)===!1&&vg(b,R.PATTERN)))});let f,p,m,w;n("Misc Mapping #2",()=>{f=fe(r,GE),p=fe(s,TB),m=on(r,(b,R)=>{const C=R.GROUP;return wn(C)&&C!==Rn.SKIPPED&&(b[C]=[]),b},{}),w=fe(s,(b,R)=>({pattern:s[R],longerAlt:c[R],canLineTerminator:d[R],isCustom:f[R],short:p[R],group:a[R],push:u[R],pop:l[R],tokenTypeIdx:o[R],tokenType:r[R]}))});let E=!0,y=[];return e.safeMode||n("First Char Optimization",()=>{y=on(r,(b,R,C)=>{if(typeof R.PATTERN=="string"){const A=R.PATTERN.charCodeAt(0),q=gi(A);wg(b,q,w[C])}else if(ze(R.START_CHARS_HINT)){let A;De(R.START_CHARS_HINT,q=>{const G=typeof q=="string"?q.charCodeAt(0):q,Q=gi(G);A!==Q&&(A=Q,wg(b,Q,w[C]))})}else if(qr(R.PATTERN))if(R.PATTERN.unicode)E=!1,e.ensureOptimizations&&mg(`${ff} Unable to analyze < ${R.PATTERN.toString()} > pattern.
|
|
23
|
+
The regexp unicode flag is not currently supported by the regexp-to-ast library.
|
|
24
|
+
This will disable the lexer's first char optimizations.
|
|
25
|
+
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE`);else{const A=tB(R.PATTERN,e.ensureOptimizations);nt(A)&&(E=!1),De(A,q=>{wg(b,q,w[C])})}else e.ensureOptimizations&&mg(`${ff} TokenType: <${R.name}> is using a custom token pattern without providing <start_chars_hint> parameter.
|
|
26
|
+
This will disable the lexer's first char optimizations.
|
|
27
|
+
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE`),E=!1;return b},[])}),{emptyGroups:m,patternIdxToConfig:w,charCodeToPatternIdxToConfig:y,hasCustom:i,canBeOptimized:E}}function sB(t,e){let n=[];const r=aB(t);n=n.concat(r.errors);const i=cB(r.valid),s=i.valid;return n=n.concat(i.errors),n=n.concat(oB(s)),n=n.concat(gB(s)),n=n.concat(yB(s,e)),n=n.concat(vB(s)),n}function oB(t){let e=[];const n=Cn(t,r=>qr(r[os]));return e=e.concat(lB(n)),e=e.concat(pB(n)),e=e.concat(hB(n)),e=e.concat(mB(n)),e=e.concat(dB(n)),e}function aB(t){const e=Cn(t,i=>!Ee(i,os)),n=fe(e,i=>({message:"Token Type: ->"+i.name+"<- missing static 'PATTERN' property",type:Et.MISSING_PATTERN,tokenTypes:[i]})),r=sf(t,e);return{errors:n,valid:r}}function cB(t){const e=Cn(t,i=>{const s=i[os];return!qr(s)&&!Mr(s)&&!Ee(s,"exec")&&!wn(s)}),n=fe(e,i=>({message:"Token Type: ->"+i.name+"<- static 'PATTERN' can only be a RegExp, a Function matching the {CustomPatternMatcherFunc} type or an Object matching the {ICustomPattern} interface.",type:Et.INVALID_PATTERN,tokenTypes:[i]})),r=sf(t,e);return{errors:n,valid:r}}const uB=/[^\\][$]/;function lB(t){class e extends zd{constructor(){super(...arguments),this.found=!1}visitEndAnchor(s){this.found=!0}}const n=Cn(t,i=>{const s=i.PATTERN;try{const o=df(s),a=new e;return a.visit(o),a.found}catch{return uB.test(s.source)}});return fe(n,i=>({message:`Unexpected RegExp Anchor Error:
|
|
28
|
+
Token Type: ->`+i.name+`<- static 'PATTERN' cannot contain end of input anchor '$'
|
|
29
|
+
See chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:Et.EOI_ANCHOR_FOUND,tokenTypes:[i]}))}function dB(t){const e=Cn(t,r=>r.PATTERN.test(""));return fe(e,r=>({message:"Token Type: ->"+r.name+"<- static 'PATTERN' must not match an empty string",type:Et.EMPTY_MATCH_PATTERN,tokenTypes:[r]}))}const fB=/[^\\[][\^]|^\^/;function pB(t){class e extends zd{constructor(){super(...arguments),this.found=!1}visitStartAnchor(s){this.found=!0}}const n=Cn(t,i=>{const s=i.PATTERN;try{const o=df(s),a=new e;return a.visit(o),a.found}catch{return fB.test(s.source)}});return fe(n,i=>({message:`Unexpected RegExp Anchor Error:
|
|
30
|
+
Token Type: ->`+i.name+`<- static 'PATTERN' cannot contain start of input anchor '^'
|
|
31
|
+
See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:Et.SOI_ANCHOR_FOUND,tokenTypes:[i]}))}function hB(t){const e=Cn(t,r=>{const i=r[os];return i instanceof RegExp&&(i.multiline||i.global)});return fe(e,r=>({message:"Token Type: ->"+r.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:Et.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[r]}))}function mB(t){const e=[];let n=fe(t,s=>on(t,(o,a)=>(s.PATTERN.source===a.PATTERN.source&&!sn(e,a)&&a.PATTERN!==Rn.NA&&(e.push(a),o.push(a)),o),[]));n=Za(n);const r=Cn(n,s=>s.length>1);return fe(r,s=>{const o=fe(s,c=>c.name);return{message:`The same RegExp pattern ->${Qn(s).PATTERN}<-has been used in all of the following Token Types: ${o.join(", ")} <-`,type:Et.DUPLICATE_PATTERNS_FOUND,tokenTypes:s}})}function gB(t){const e=Cn(t,r=>{if(!Ee(r,"GROUP"))return!1;const i=r.GROUP;return i!==Rn.SKIPPED&&i!==Rn.NA&&!wn(i)});return fe(e,r=>({message:"Token Type: ->"+r.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:Et.INVALID_GROUP_TYPE_FOUND,tokenTypes:[r]}))}function yB(t,e){const n=Cn(t,i=>i.PUSH_MODE!==void 0&&!sn(e,i.PUSH_MODE));return fe(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:Et.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[i]}))}function vB(t){const e=[],n=on(t,(r,i,s)=>{const o=i.PATTERN;return o===Rn.NA||(wn(o)?r.push({str:o,idx:s,tokenType:i}):qr(o)&&bB(o)&&r.push({str:o.source,idx:s,tokenType:i})),r},[]);return De(t,(r,i)=>{De(n,({str:s,idx:o,tokenType:a})=>{if(i<o&&wB(s,r.PATTERN)){const c=`Token: ->${a.name}<- can never be matched.
|
|
32
|
+
Because it appears AFTER the Token Type ->${r.name}<-in the lexer's definition.
|
|
33
|
+
See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;e.push({message:c,type:Et.UNREACHABLE_PATTERN,tokenTypes:[r,a]})}})}),e}function wB(t,e){if(qr(e)){const n=e.exec(t);return n!==null&&n.index===0}else{if(Mr(e))return e(t,0,[],{});if(Ee(e,"exec"))return e.exec(t,0,[],{});if(typeof e=="string")return e===t;throw Error("non exhaustive match")}}function bB(t){return ao([".","\\","[","]","|","^","$","(",")","?","*","+","{"],n=>t.source.indexOf(n)!==-1)===void 0}function jE(t){const e=t.ignoreCase?"i":"";return new RegExp(`^(?:${t.source})`,e)}function UE(t){const e=t.ignoreCase?"iy":"y";return new RegExp(`${t.source}`,e)}function DB(t,e,n){const r=[];return Ee(t,nc)||r.push({message:"A MultiMode Lexer cannot be initialized without a <"+nc+`> property in its definition
|
|
34
|
+
`,type:Et.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),Ee(t,hf)||r.push({message:"A MultiMode Lexer cannot be initialized without a <"+hf+`> property in its definition
|
|
35
|
+
`,type:Et.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),Ee(t,hf)&&Ee(t,nc)&&!Ee(t.modes,t.defaultMode)&&r.push({message:`A MultiMode Lexer cannot be initialized with a ${nc}: <${t.defaultMode}>which does not exist
|
|
36
|
+
`,type:Et.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),Ee(t,hf)&&De(t.modes,(i,s)=>{De(i,(o,a)=>{if(jr(o))r.push({message:`A Lexer cannot be initialized using an undefined Token Type. Mode:<${s}> at index: <${a}>
|
|
37
|
+
`,type:Et.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED});else if(Ee(o,"LONGER_ALT")){const c=ze(o.LONGER_ALT)?o.LONGER_ALT:[o.LONGER_ALT];De(c,u=>{!jr(u)&&!sn(i,u)&&r.push({message:`A MultiMode Lexer cannot be initialized with a longer_alt <${u.name}> on token <${o.name}> outside of mode <${s}>
|
|
38
|
+
`,type:Et.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE})})}})}),r}function EB(t,e,n){const r=[];let i=!1;const s=Za(jn(Ot(t.modes))),o=of(s,c=>c[os]===Rn.NA),a=HE(n);return e&&De(o,c=>{const u=WE(c,a);if(u!==!1){const d={message:SB(c,u),type:u.issue,tokenType:c};r.push(d)}else Ee(c,"LINE_BREAKS")?c.LINE_BREAKS===!0&&(i=!0):vg(a,c.PATTERN)&&(i=!0)}),e&&!i&&r.push({message:`Warning: No LINE_BREAKS Found.
|
|
39
|
+
This Lexer has been defined to track line and column information,
|
|
40
|
+
But none of the Token Types can be identified as matching a line terminator.
|
|
41
|
+
See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#LINE_BREAKS
|
|
42
|
+
for details.`,type:Et.NO_LINE_BREAKS_FLAGS}),r}function RB(t){const e={},n=qn(t);return De(n,r=>{const i=t[r];if(ze(i))e[r]=[];else throw Error("non exhaustive match")}),e}function GE(t){const e=t.PATTERN;if(qr(e))return!1;if(Mr(e))return!0;if(Ee(e,"exec"))return!0;if(wn(e))return!1;throw Error("non exhaustive match")}function TB(t){return wn(t)&&t.length===1?t.charCodeAt(0):!1}const $B={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.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 WE(t,e){if(Ee(t,"LINE_BREAKS"))return!1;if(qr(t.PATTERN)){try{vg(e,t.PATTERN)}catch(n){return{issue:Et.IDENTIFY_TERMINATOR,errMsg:n.message}}return!1}else{if(wn(t.PATTERN))return!1;if(GE(t))return{issue:Et.CUSTOM_LINE_BREAK};throw Error("non exhaustive match")}}function SB(t,e){if(e.issue===Et.IDENTIFY_TERMINATOR)return`Warning: unable to identify line terminator usage in pattern.
|
|
43
|
+
The problem is in the <${t.name}> Token Type
|
|
44
|
+
Root cause: ${e.errMsg}.
|
|
45
|
+
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR`;if(e.issue===Et.CUSTOM_LINE_BREAK)return`Warning: A Custom Token Pattern should specify the <line_breaks> option.
|
|
46
|
+
The problem is in the <${t.name}> Token Type
|
|
47
|
+
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK`;throw Error("non exhaustive match")}function HE(t){return fe(t,n=>wn(n)?n.charCodeAt(0):n)}function wg(t,e,n){t[e]===void 0?t[e]=[n]:t[e].push(n)}const rc=256;let mf=[];function gi(t){return t<rc?t:mf[t]}function CB(){if(nt(mf)){mf=new Array(65536);for(let t=0;t<65536;t++)mf[t]=t>255?255+~~(t/255):t}}function ic(t,e){const n=t.tokenTypeIdx;return n===e.tokenTypeIdx?!0:e.isParent===!0&&e.categoryMatchesMap[n]===!0}function gf(t,e){return t.tokenTypeIdx===e.tokenTypeIdx}let VE=1;const KE={};function sc(t){const e=kB(t);AB(e),PB(e),_B(e),De(e,n=>{n.isParent=n.categoryMatches.length>0})}function kB(t){let e=qt(t),n=t,r=!0;for(;r;){n=Za(jn(fe(n,s=>s.CATEGORIES)));const i=sf(n,e);e=e.concat(i),nt(i)?r=!1:n=i}return e}function AB(t){De(t,e=>{XE(e)||(KE[VE]=e,e.tokenTypeIdx=VE++),JE(e)&&!ze(e.CATEGORIES)&&(e.CATEGORIES=[e.CATEGORIES]),JE(e)||(e.CATEGORIES=[]),IB(e)||(e.categoryMatches=[]),xB(e)||(e.categoryMatchesMap={})})}function _B(t){De(t,e=>{e.categoryMatches=[],De(e.categoryMatchesMap,(n,r)=>{e.categoryMatches.push(KE[r].tokenTypeIdx)})})}function PB(t){De(t,e=>{YE([],e)})}function YE(t,e){De(t,n=>{e.categoryMatchesMap[n.tokenTypeIdx]=!0}),De(e.CATEGORIES,n=>{const r=t.concat(e);sn(r,n)||YE(r,n)})}function XE(t){return Ee(t,"tokenTypeIdx")}function JE(t){return Ee(t,"CATEGORIES")}function IB(t){return Ee(t,"categoryMatches")}function xB(t){return Ee(t,"categoryMatchesMap")}function OB(t){return Ee(t,"tokenTypeIdx")}const bg={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 Et;(function(t){t[t.MISSING_PATTERN=0]="MISSING_PATTERN",t[t.INVALID_PATTERN=1]="INVALID_PATTERN",t[t.EOI_ANCHOR_FOUND=2]="EOI_ANCHOR_FOUND",t[t.UNSUPPORTED_FLAGS_FOUND=3]="UNSUPPORTED_FLAGS_FOUND",t[t.DUPLICATE_PATTERNS_FOUND=4]="DUPLICATE_PATTERNS_FOUND",t[t.INVALID_GROUP_TYPE_FOUND=5]="INVALID_GROUP_TYPE_FOUND",t[t.PUSH_MODE_DOES_NOT_EXIST=6]="PUSH_MODE_DOES_NOT_EXIST",t[t.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE=7]="MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE",t[t.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY=8]="MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY",t[t.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST=9]="MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST",t[t.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED=10]="LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED",t[t.SOI_ANCHOR_FOUND=11]="SOI_ANCHOR_FOUND",t[t.EMPTY_MATCH_PATTERN=12]="EMPTY_MATCH_PATTERN",t[t.NO_LINE_BREAKS_FLAGS=13]="NO_LINE_BREAKS_FLAGS",t[t.UNREACHABLE_PATTERN=14]="UNREACHABLE_PATTERN",t[t.IDENTIFY_TERMINATOR=15]="IDENTIFY_TERMINATOR",t[t.CUSTOM_LINE_BREAK=16]="CUSTOM_LINE_BREAK",t[t.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE=17]="MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE"})(Et||(Et={}));const oc={deferDefinitionErrorsHandling:!1,positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:[`
|
|
48
|
+
`,"\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:bg,traceInitPerf:!1,skipValidations:!1,recoveryEnabled:!0};Object.freeze(oc);class Rn{constructor(e,n=oc){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.traceInitIndent++;const o=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent<this.traceInitMaxIdent&&console.log(`${o}--> <${i}>`);const{time:a,value:c}=NE(s),u=a>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&u(`${o}<-- <${i}> time: ${a}ms`),this.traceInitIndent--,c}else return s()},typeof n=="boolean")throw Error(`The second argument to the Lexer constructor is now an ILexerConfig Object.
|
|
49
|
+
a boolean 2nd argument is no longer supported`);this.config=Sn({},oc,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===oc.lineTerminatorsPattern)this.config.lineTerminatorsPattern=$B;else if(this.config.lineTerminatorCharacters===oc.lineTerminatorCharacters)throw Error(`Error: Missing <lineTerminatorCharacters> property on the Lexer config.
|
|
50
|
+
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#MISSING_LINE_TERM_CHARS`);if(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),ze(e)?i={modes:{defaultMode:qt(e)},defaultMode:nc}:(s=!1,i=qt(e))}),this.config.skipValidations===!1&&(this.TRACE_INIT("performRuntimeChecks",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(DB(i,this.trackStartLines,this.config.lineTerminatorCharacters))}),this.TRACE_INIT("performWarningRuntimeChecks",()=>{this.lexerDefinitionWarning=this.lexerDefinitionWarning.concat(EB(i,this.trackStartLines,this.config.lineTerminatorCharacters))})),i.modes=i.modes?i.modes:{},De(i.modes,(a,c)=>{i.modes[c]=of(a,u=>jr(u))});const o=qn(i.modes);if(De(i.modes,(a,c)=>{this.TRACE_INIT(`Mode: <${c}> processing`,()=>{if(this.modes.push(c),this.config.skipValidations===!1&&this.TRACE_INIT("validatePatterns",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(sB(a,o))}),nt(this.lexerDefinitionErrors)){sc(a);let u;this.TRACE_INIT("analyzeTokenTypes",()=>{u=iB(a,{lineTerminatorCharacters:this.config.lineTerminatorCharacters,positionTracking:n.positionTracking,ensureOptimizations:n.ensureOptimizations,safeMode:n.safeMode,tracer:this.TRACE_INIT})}),this.patternIdxToConfig[c]=u.patternIdxToConfig,this.charCodeToPatternIdxToConfig[c]=u.charCodeToPatternIdxToConfig,this.emptyGroups=Sn({},this.emptyGroups,u.emptyGroups),this.hasCustom=u.hasCustom||this.hasCustom,this.canModeBeOptimized[c]=u.canBeOptimized}})}),this.defaultMode=i.defaultMode,!nt(this.lexerDefinitionErrors)&&!this.config.deferDefinitionErrorsHandling){const c=fe(this.lexerDefinitionErrors,u=>u.message).join(`-----------------------
|
|
51
|
+
`);throw new Error(`Errors detected in definition of Lexer:
|
|
52
|
+
`+c)}De(this.lexerDefinitionWarning,a=>{OE(a.message)}),this.TRACE_INIT("Choosing sub-methods implementations",()=>{if(qE?(this.chopInput=ts,this.match=this.matchWithTest):(this.updateLastIndex=xt,this.match=this.matchWithExec),s&&(this.handleModes=xt),this.trackStartLines===!1&&(this.computeNewColumn=ts),this.trackEndLines===!1&&(this.updateTokenEndLineColumnLocation=xt),/full/i.test(this.config.positionTracking))this.createTokenInstance=this.createFullToken;else if(/onlyStart/i.test(this.config.positionTracking))this.createTokenInstance=this.createStartOnlyToken;else if(/onlyOffset/i.test(this.config.positionTracking))this.createTokenInstance=this.createOffsetOnlyToken;else throw Error(`Invalid <positionTracking> config option: "${this.config.positionTracking}"`);this.hasCustom?(this.addToken=this.addTokenUsingPush,this.handlePayload=this.handlePayloadWithCustom):(this.addToken=this.addTokenUsingMemberAccess,this.handlePayload=this.handlePayloadNoCustom)}),this.TRACE_INIT("Failed Optimization Warnings",()=>{const a=on(this.canModeBeOptimized,(c,u,l)=>(u===!1&&c.push(l),c),[]);if(n.ensureOptimizations&&!nt(a))throw Error(`Lexer Modes: < ${a.join(", ")} > cannot be optimized.
|
|
53
|
+
Disable the "ensureOptimizations" lexer config flag to silently ignore this and run the lexer in an un-optimized mode.
|
|
54
|
+
Or inspect the console log for details on how to resolve these issues.`)}),this.TRACE_INIT("clearRegExpParserCache",()=>{eB()}),this.TRACE_INIT("toFastProperties",()=>{FE(this)})})}tokenize(e,n=this.defaultMode){if(!nt(this.lexerDefinitionErrors)){const i=fe(this.lexerDefinitionErrors,s=>s.message).join(`-----------------------
|
|
55
|
+
`);throw new Error(`Unable to Tokenize because Errors detected in definition of Lexer:
|
|
56
|
+
`+i)}return this.tokenizeInternal(e,n)}tokenizeInternal(e,n){let r,i,s,o,a,c,u,l,d,f,p,m,w,E,y;const b=e,R=b.length;let C=0,A=0;const q=this.hasCustom?0:Math.floor(e.length/10),G=new Array(q),Q=[];let J=this.trackStartLines?1:void 0,le=this.trackStartLines?1:void 0;const N=RB(this.emptyGroups),S=this.trackStartLines,T=this.config.lineTerminatorsPattern;let O=0,W=[],U=[];const K=[],be=[];Object.freeze(be);let ee;function k(){return W}function pe(_e){const ie=gi(_e),ve=U[ie];return ve===void 0?be:ve}const Qe=_e=>{if(K.length===1&&_e.tokenType.PUSH_MODE===void 0){const ie=this.config.errorMessageProvider.buildUnableToPopLexerModeMessage(_e);Q.push({offset:_e.startOffset,line:_e.startLine,column:_e.startColumn,length:_e.image.length,message:ie})}else{K.pop();const ie=oo(K);W=this.patternIdxToConfig[ie],U=this.charCodeToPatternIdxToConfig[ie],O=W.length;const ve=this.canModeBeOptimized[ie]&&this.config.safeMode===!1;U&&ve?ee=pe:ee=k}};function ct(_e){K.push(_e),U=this.charCodeToPatternIdxToConfig[_e],W=this.patternIdxToConfig[_e],O=W.length,O=W.length;const ie=this.canModeBeOptimized[_e]&&this.config.safeMode===!1;U&&ie?ee=pe:ee=k}ct.call(this,n);let j;const V=this.config.recoveryEnabled;for(;C<R;){c=null;const _e=b.charCodeAt(C),ie=ee(_e),ve=ie.length;for(r=0;r<ve;r++){j=ie[r];const Te=j.pattern;u=null;const se=j.short;if(se!==!1?_e===se&&(c=Te):j.isCustom===!0?(y=Te.exec(b,C,G,N),y!==null?(c=y[0],y.payload!==void 0&&(u=y.payload)):c=null):(this.updateLastIndex(Te,C),c=this.match(Te,e,C)),c!==null){if(a=j.longerAlt,a!==void 0){const I=a.length;for(s=0;s<I;s++){const M=W[a[s]],ue=M.pattern;if(l=null,M.isCustom===!0?(y=ue.exec(b,C,G,N),y!==null?(o=y[0],y.payload!==void 0&&(l=y.payload)):o=null):(this.updateLastIndex(ue,C),o=this.match(ue,e,C)),o&&o.length>c.length){c=o,u=l,j=M;break}}}break}}if(c!==null){if(d=c.length,f=j.group,f!==void 0&&(p=j.tokenTypeIdx,m=this.createTokenInstance(c,C,p,j.tokenType,J,le,d),this.handlePayload(m,u),f===!1?A=this.addToken(G,A,m):N[f].push(m)),e=this.chopInput(e,d),C=C+d,le=this.computeNewColumn(le,d),S===!0&&j.canLineTerminator===!0){let Te=0,se,I;T.lastIndex=0;do se=T.test(c),se===!0&&(I=T.lastIndex-1,Te++);while(se===!0);Te!==0&&(J=J+Te,le=d-I,this.updateTokenEndLineColumnLocation(m,f,I,Te,J,le,d))}this.handleModes(j,Qe,ct,m)}else{const Te=C,se=J,I=le;let M=V===!1;for(;M===!1&&C<R;)for(e=this.chopInput(e,1),C++,i=0;i<O;i++){const ue=W[i],B=ue.pattern,oe=ue.short;if(oe!==!1?b.charCodeAt(C)===oe&&(M=!0):ue.isCustom===!0?M=B.exec(b,C,G,N)!==null:(this.updateLastIndex(B,C),M=B.exec(e)!==null),M===!0)break}if(w=C-Te,le=this.computeNewColumn(le,w),E=this.config.errorMessageProvider.buildUnexpectedCharactersMessage(b,Te,w,se,I),Q.push({offset:Te,line:se,column:I,length:w,message:E}),V===!1)break}}return this.hasCustom||(G.length=A),{tokens:G,groups:N,errors:Q}}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=n}updateTokenEndLineColumnLocation(e,n,r,i,s,o,a){let c,u;n!==void 0&&(c=r===a-1,u=c?-1:0,i===1&&c===!0||(e.endLine=s+u,e.endColumn=o-1+-u))}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+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}}Rn.SKIPPED="This marks a skipped Token pattern, this means each token identified by it willbe consumed and then thrown into oblivion, this can be used to for example to completely ignore whitespace.",Rn.NA=/NOT_APPLICABLE/;function lo(t){return QE(t)?t.LABEL:t.name}function QE(t){return wn(t.LABEL)&&t.LABEL!==""}const NB="parent",ZE="categories",eR="label",tR="group",nR="push_mode",rR="pop_mode",iR="longer_alt",sR="line_breaks",oR="start_chars_hint";function aR(t){return FB(t)}function FB(t){const e=t.pattern,n={};if(n.name=t.name,jr(e)||(n.PATTERN=e),Ee(t,NB))throw`The parent property is no longer supported.
|
|
57
|
+
See: https://github.com/chevrotain/chevrotain/issues/564#issuecomment-349062346 for details.`;return Ee(t,ZE)&&(n.CATEGORIES=t[ZE]),sc([n]),Ee(t,eR)&&(n.LABEL=t[eR]),Ee(t,tR)&&(n.GROUP=t[tR]),Ee(t,rR)&&(n.POP_MODE=t[rR]),Ee(t,nR)&&(n.PUSH_MODE=t[nR]),Ee(t,iR)&&(n.LONGER_ALT=t[iR]),Ee(t,sR)&&(n.LINE_BREAKS=t[sR]),Ee(t,oR)&&(n.START_CHARS_HINT=t[oR]),n}const yi=aR({name:"EOF",pattern:Rn.NA});sc([yi]);function Dg(t,e,n,r,i,s,o,a){return{image:e,startOffset:n,endOffset:r,startLine:i,endLine:s,startColumn:o,endColumn:a,tokenTypeIdx:t.tokenTypeIdx,tokenType:t}}function cR(t,e){return ic(t,e)}const fo={buildMismatchTokenMessage({expected:t,actual:e,previous:n,ruleName:r}){return`Expecting ${QE(t)?`--> ${lo(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}){const s="Expecting: ",a=`
|
|
58
|
+
but found: '`+Qn(e).image+"'";if(r)return s+r+a;{const c=on(t,(f,p)=>f.concat(p),[]),u=fe(c,f=>`[${fe(f,p=>lo(p)).join(", ")}]`),d=`one of these possible Token sequences:
|
|
59
|
+
${fe(u,(f,p)=>` ${p+1}. ${f}`).join(`
|
|
60
|
+
`)}`;return s+d+a}},buildEarlyExitMessage({expectedIterationPaths:t,actual:e,customUserDescription:n,ruleName:r}){const i="Expecting: ",o=`
|
|
61
|
+
but found: '`+Qn(e).image+"'";if(n)return i+n+o;{const c=`expecting at least one iteration which starts with one of these possible Token sequences::
|
|
62
|
+
<${fe(t,u=>`[${fe(u,l=>lo(l)).join(",")}]`).join(" ,")}>`;return i+c+o}}};Object.freeze(fo);const LB={buildRuleNotFoundError(t,e){return"Invalid grammar, reference to a rule which is not defined: ->"+e.nonTerminalName+`<-
|
|
63
|
+
inside top level rule: ->`+t.name+"<-"}},as={buildDuplicateFoundError(t,e){function n(l){return l instanceof dt?l.terminalType.name:l instanceof an?l.nonTerminalName:""}const r=t.name,i=Qn(e),s=i.idx,o=br(i),a=n(i),c=s>0;let u=`->${o}${c?s:""}<- ${a?`with argument: ->${a}<-`:""}
|
|
64
|
+
appears more than once (${e.length} times) in the top level rule: ->${r}<-.
|
|
65
|
+
For further details see: https://chevrotain.io/docs/FAQ.html#NUMERICAL_SUFFIXES
|
|
66
|
+
`;return u=u.replace(/[ \t]+/g," "),u=u.replace(/\s\s+/g,`
|
|
67
|
+
`),u},buildNamespaceConflictError(t){return`Namespace conflict found in grammar.
|
|
68
|
+
The grammar has both a Terminal(Token) and a Non-Terminal(Rule) named: <${t.name}>.
|
|
69
|
+
To resolve this make sure each Terminal and Non-Terminal names are unique
|
|
70
|
+
This is easy to accomplish by using the convention that Terminal names start with an uppercase letter
|
|
71
|
+
and Non-Terminal names start with a lower case letter.`},buildAlternationPrefixAmbiguityError(t){const e=fe(t.prefixPath,i=>lo(i)).join(", "),n=t.alternation.idx===0?"":t.alternation.idx;return`Ambiguous alternatives: <${t.ambiguityIndices.join(" ,")}> due to common lookahead prefix
|
|
72
|
+
in <OR${n}> inside <${t.topLevelRule.name}> Rule,
|
|
73
|
+
<${e}> may appears as a prefix path in all these alternatives.
|
|
74
|
+
See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#COMMON_PREFIX
|
|
75
|
+
For Further details.`},buildAlternationAmbiguityError(t){const e=fe(t.prefixPath,i=>lo(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,
|
|
76
|
+
<${e}> may appears as a prefix path in all these alternatives.
|
|
77
|
+
`;return r=r+`See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES
|
|
78
|
+
For Further details.`,r},buildEmptyRepetitionError(t){let e=br(t.repetition);return t.repetition.idx!==0&&(e+=t.repetition.idx),`The repetition <${e}> within Rule <${t.topLevelRule.name}> can never consume any tokens.
|
|
79
|
+
This could lead to an infinite loop.`},buildTokenNameError(t){return"deprecated"},buildEmptyAlternationError(t){return`Ambiguous empty alternative: <${t.emptyChoiceIdx+1}> in <OR${t.alternation.idx}> inside <${t.topLevelRule.name}> Rule.
|
|
80
|
+
Only the last alternative may be an empty alternative.`},buildTooManyAlternativesError(t){return`An Alternation cannot have more than 256 alternatives:
|
|
81
|
+
<OR${t.alternation.idx}> inside <${t.topLevelRule.name}> Rule.
|
|
82
|
+
has ${t.alternation.definition.length+1} alternatives.`},buildLeftRecursionError(t){const e=t.topLevelRule.name,n=fe(t.leftRecursionPath,s=>s.name),r=`${e} --> ${n.concat([e]).join(" --> ")}`;return`Left Recursion found in grammar.
|
|
83
|
+
rule: <${e}> can be invoked from itself (directly or indirectly)
|
|
84
|
+
without consuming any Tokens. The grammar path that causes this is:
|
|
85
|
+
${r}
|
|
86
|
+
To fix this refactor your grammar to remove the left recursion.
|
|
87
|
+
see: https://en.wikipedia.org/wiki/LL_parser#Left_factoring.`},buildInvalidRuleNameError(t){return"deprecated"},buildDuplicateRuleNameError(t){let e;return t.topLevelRule instanceof co?e=t.topLevelRule.name:e=t.topLevelRule,`Duplicate definition, rule: ->${e}<- is already defined in the grammar: ->${t.grammarName}<-`}};function MB(t,e){const n=new BB(t,e);return n.resolveRefs(),n.errors}class BB extends uo{constructor(e,n){super(),this.nameToTopRule=e,this.errMsgProvider=n,this.errors=[]}resolveRefs(){De(Ot(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:cn.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:e.nonTerminalName})}}}class zB extends uf{constructor(e,n){super(),this.topProd=e,this.path=n,this.possibleTokTypes=[],this.nextProductionName="",this.nextProductionOccurrence=0,this.found=!1,this.isAtEndOfPath=!1}startWalking(){if(this.found=!1,this.path.ruleStack[0]!==this.topProd.name)throw Error("The path does not start with the walker's top Rule!");return this.ruleStack=qt(this.path.ruleStack).reverse(),this.occurrenceStack=qt(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===this.nextProductionName&&e.idx===this.nextProductionOccurrence){const i=n.concat(r);this.updateExpectedNext(),this.walk(e.referencedRule,i)}}updateExpectedNext(){nt(this.ruleStack)?(this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())}}class qB extends zB{constructor(e,n){super(e,n),this.path=n,this.nextTerminalName="",this.nextTerminalOccurrence=0,this.nextTerminalName=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 bn({definition:i});this.possibleTokTypes=tc(s),this.found=!0}}}class yf extends uf{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}}class jB extends yf{walkMany(e,n,r){if(e.idx===this.occurrence){const i=Qn(n.concat(r));this.result.isEndOfRule=i===void 0,i instanceof dt&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkMany(e,n,r)}}class uR extends yf{walkManySep(e,n,r){if(e.idx===this.occurrence){const i=Qn(n.concat(r));this.result.isEndOfRule=i===void 0,i instanceof dt&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkManySep(e,n,r)}}class UB extends yf{walkAtLeastOne(e,n,r){if(e.idx===this.occurrence){const i=Qn(n.concat(r));this.result.isEndOfRule=i===void 0,i instanceof dt&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOne(e,n,r)}}class lR extends yf{walkAtLeastOneSep(e,n,r){if(e.idx===this.occurrence){const i=Qn(n.concat(r));this.result.isEndOfRule=i===void 0,i instanceof dt&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOneSep(e,n,r)}}function Eg(t,e,n=[]){n=qt(n);let r=[],i=0;function s(a){return a.concat(jt(t,i+1))}function o(a){const c=Eg(s(a),e,n);return r.concat(c)}for(;n.length<e&&i<t.length;){const a=t[i];if(a instanceof bn)return o(a.definition);if(a instanceof an)return o(a.definition);if(a instanceof Ut)r=o(a.definition);else if(a instanceof An){const c=a.definition.concat([new Dt({definition:a.definition})]);return o(c)}else if(a instanceof _n){const c=[new bn({definition:a.definition}),new Dt({definition:[new dt({terminalType:a.separator})].concat(a.definition)})];return o(c)}else if(a instanceof Dn){const c=a.definition.concat([new Dt({definition:[new dt({terminalType:a.separator})].concat(a.definition)})]);r=o(c)}else if(a instanceof Dt){const c=a.definition.concat([new Dt({definition:a.definition})]);r=o(c)}else{if(a instanceof En)return De(a.definition,c=>{nt(c.definition)===!1&&(r=o(c.definition))}),r;if(a instanceof dt)n.push(a.terminalType);else throw Error("non exhaustive match")}i++}return r.push({partialPath:n,suffixDef:jt(t,i)}),r}function dR(t,e,n,r){const i="EXIT_NONE_TERMINAL",s=[i],o="EXIT_ALTERNATIVE";let a=!1;const c=e.length,u=c-r-1,l=[],d=[];for(d.push({idx:-1,def:t,ruleStack:[],occurrenceStack:[]});!nt(d);){const f=d.pop();if(f===o){a&&oo(d).idx<=u&&d.pop();continue}const p=f.def,m=f.idx,w=f.ruleStack,E=f.occurrenceStack;if(nt(p))continue;const y=p[0];if(y===i){const b={idx:m,def:jt(p),ruleStack:ec(w),occurrenceStack:ec(E)};d.push(b)}else if(y instanceof dt)if(m<c-1){const b=m+1,R=e[b];if(n(R,y.terminalType)){const C={idx:b,def:jt(p),ruleStack:w,occurrenceStack:E};d.push(C)}}else if(m===c-1)l.push({nextTokenType:y.terminalType,nextTokenOccurrence:y.idx,ruleStack:w,occurrenceStack:E}),a=!0;else throw Error("non exhaustive match");else if(y instanceof an){const b=qt(w);b.push(y.nonTerminalName);const R=qt(E);R.push(y.idx);const C={idx:m,def:y.definition.concat(s,jt(p)),ruleStack:b,occurrenceStack:R};d.push(C)}else if(y instanceof Ut){const b={idx:m,def:jt(p),ruleStack:w,occurrenceStack:E};d.push(b),d.push(o);const R={idx:m,def:y.definition.concat(jt(p)),ruleStack:w,occurrenceStack:E};d.push(R)}else if(y instanceof An){const b=new Dt({definition:y.definition,idx:y.idx}),R=y.definition.concat([b],jt(p)),C={idx:m,def:R,ruleStack:w,occurrenceStack:E};d.push(C)}else if(y instanceof _n){const b=new dt({terminalType:y.separator}),R=new Dt({definition:[b].concat(y.definition),idx:y.idx}),C=y.definition.concat([R],jt(p)),A={idx:m,def:C,ruleStack:w,occurrenceStack:E};d.push(A)}else if(y instanceof Dn){const b={idx:m,def:jt(p),ruleStack:w,occurrenceStack:E};d.push(b),d.push(o);const R=new dt({terminalType:y.separator}),C=new Dt({definition:[R].concat(y.definition),idx:y.idx}),A=y.definition.concat([C],jt(p)),q={idx:m,def:A,ruleStack:w,occurrenceStack:E};d.push(q)}else if(y instanceof Dt){const b={idx:m,def:jt(p),ruleStack:w,occurrenceStack:E};d.push(b),d.push(o);const R=new Dt({definition:y.definition,idx:y.idx}),C=y.definition.concat([R],jt(p)),A={idx:m,def:C,ruleStack:w,occurrenceStack:E};d.push(A)}else if(y instanceof En)for(let b=y.definition.length-1;b>=0;b--){const R=y.definition[b],C={idx:m,def:R.definition.concat(jt(p)),ruleStack:w,occurrenceStack:E};d.push(C),d.push(o)}else if(y instanceof bn)d.push({idx:m,def:y.definition.concat(jt(p)),ruleStack:w,occurrenceStack:E});else if(y instanceof co)d.push(GB(y,m,w,E));else throw Error("non exhaustive match")}return l}function GB(t,e,n,r){const i=qt(n);i.push(t.name);const s=qt(r);return s.push(1),{idx:e,def:t.definition,ruleStack:i,occurrenceStack:s}}var gt;(function(t){t[t.OPTION=0]="OPTION",t[t.REPETITION=1]="REPETITION",t[t.REPETITION_MANDATORY=2]="REPETITION_MANDATORY",t[t.REPETITION_MANDATORY_WITH_SEPARATOR=3]="REPETITION_MANDATORY_WITH_SEPARATOR",t[t.REPETITION_WITH_SEPARATOR=4]="REPETITION_WITH_SEPARATOR",t[t.ALTERNATION=5]="ALTERNATION"})(gt||(gt={}));function Rg(t){if(t instanceof Ut||t==="Option")return gt.OPTION;if(t instanceof Dt||t==="Repetition")return gt.REPETITION;if(t instanceof An||t==="RepetitionMandatory")return gt.REPETITION_MANDATORY;if(t instanceof _n||t==="RepetitionMandatoryWithSeparator")return gt.REPETITION_MANDATORY_WITH_SEPARATOR;if(t instanceof Dn||t==="RepetitionWithSeparator")return gt.REPETITION_WITH_SEPARATOR;if(t instanceof En||t==="Alternation")return gt.ALTERNATION;throw Error("non exhaustive match")}function fR(t){const{occurrence:e,rule:n,prodType:r,maxLookahead:i}=t,s=Rg(r);return s===gt.ALTERNATION?vf(e,n,i):wf(e,n,s,i)}function WB(t,e,n,r,i,s){const o=vf(t,e,n),a=gR(o)?gf:ic;return s(o,r,a,i)}function HB(t,e,n,r,i,s){const o=wf(t,e,i,n),a=gR(o)?gf:ic;return s(o[0],a,r)}function VB(t,e,n,r){const i=t.length,s=Jn(t,o=>Jn(o,a=>a.length===1));if(e)return function(o){const a=fe(o,c=>c.GATE);for(let c=0;c<i;c++){const u=t[c],l=u.length,d=a[c];if(!(d!==void 0&&d.call(this)===!1))e:for(let f=0;f<l;f++){const p=u[f],m=p.length;for(let w=0;w<m;w++){const E=this.LA(w+1);if(n(E,p[w])===!1)continue e}return c}}};if(s&&!r){const o=fe(t,c=>jn(c)),a=on(o,(c,u,l)=>(De(u,d=>{Ee(c,d.tokenTypeIdx)||(c[d.tokenTypeIdx]=l),De(d.categoryMatches,f=>{Ee(c,f)||(c[f]=l)})}),c),{});return function(){const c=this.LA(1);return a[c.tokenTypeIdx]}}else return function(){for(let o=0;o<i;o++){const a=t[o],c=a.length;e:for(let u=0;u<c;u++){const l=a[u],d=l.length;for(let f=0;f<d;f++){const p=this.LA(f+1);if(n(p,l[f])===!1)continue e}return o}}}}function KB(t,e,n){const r=Jn(t,s=>s.length===1),i=t.length;if(r&&!n){const s=jn(t);if(s.length===1&&nt(s[0].categoryMatches)){const a=s[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===a}}else{const o=on(s,(a,c,u)=>(a[c.tokenTypeIdx]=!0,De(c.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 c=0;c<a;c++){const u=this.LA(c+1);if(e(u,o[c])===!1)continue e}return!0}return!1}}class YB extends uf{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){return e.idx===this.targetOccurrence&&this.targetProdType===n?(this.restDef=r.concat(i),!0):!1}walkOption(e,n,r){this.checkIsTarget(e,gt.OPTION,n,r)||super.walkOption(e,n,r)}walkAtLeastOne(e,n,r){this.checkIsTarget(e,gt.REPETITION_MANDATORY,n,r)||super.walkOption(e,n,r)}walkAtLeastOneSep(e,n,r){this.checkIsTarget(e,gt.REPETITION_MANDATORY_WITH_SEPARATOR,n,r)||super.walkOption(e,n,r)}walkMany(e,n,r){this.checkIsTarget(e,gt.REPETITION,n,r)||super.walkOption(e,n,r)}walkManySep(e,n,r){this.checkIsTarget(e,gt.REPETITION_WITH_SEPARATOR,n,r)||super.walkOption(e,n,r)}}class pR extends uo{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,gt.OPTION)}visitRepetition(e){this.checkIsTarget(e,gt.REPETITION)}visitRepetitionMandatory(e){this.checkIsTarget(e,gt.REPETITION_MANDATORY)}visitRepetitionMandatoryWithSeparator(e){this.checkIsTarget(e,gt.REPETITION_MANDATORY_WITH_SEPARATOR)}visitRepetitionWithSeparator(e){this.checkIsTarget(e,gt.REPETITION_WITH_SEPARATOR)}visitAlternation(e){this.checkIsTarget(e,gt.ALTERNATION)}}function hR(t){const e=new Array(t);for(let n=0;n<t;n++)e[n]=[];return e}function Tg(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 c="_"+r.categoryMatches[a];i.push(o+c)}}e=i}return e}function XB(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 mR(t,e){const n=fe(t,o=>Eg([o],1)),r=hR(n.length),i=fe(n,o=>{const a={};return De(o,c=>{const u=Tg(c.partialPath);De(u,l=>{a[l]=!0})}),a});let s=n;for(let o=1;o<=e;o++){const a=s;s=hR(a.length);for(let c=0;c<a.length;c++){const u=a[c];for(let l=0;l<u.length;l++){const d=u[l].partialPath,f=u[l].suffixDef,p=Tg(d);if(XB(i,p,c)||nt(f)||d.length===e){const w=r[c];if($g(w,d)===!1){w.push(d);for(let E=0;E<p.length;E++){const y=p[E];i[c][y]=!0}}}else{const w=Eg(f,o+1,d);s[c]=s[c].concat(w),De(w,E=>{const y=Tg(E.partialPath);De(y,b=>{i[c][b]=!0})})}}}}return r}function vf(t,e,n,r){const i=new pR(t,gt.ALTERNATION,r);return e.accept(i),mR(i.result,n)}function wf(t,e,n,r){const i=new pR(t,n);e.accept(i);const s=i.result,a=new YB(e,t,n).startWalking(),c=new bn({definition:s}),u=new bn({definition:a});return mR([c,u],r)}function $g(t,e){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 JB(t,e){return t.length<e.length&&Jn(t,(n,r)=>{const i=e[r];return n===i||i.categoryMatchesMap[n.tokenTypeIdx]})}function gR(t){return Jn(t,e=>Jn(e,n=>Jn(n,r=>nt(r.categoryMatches))))}function QB(t){const e=t.lookaheadStrategy.validate({rules:t.rules,tokenTypes:t.tokenTypes,grammarName:t.grammarName});return fe(e,n=>Object.assign({type:cn.CUSTOM_LOOKAHEAD_VALIDATION},n))}function ZB(t,e,n,r){const i=kn(t,c=>ez(c,n)),s=fz(t,e,n),o=kn(t,c=>cz(c,n)),a=kn(t,c=>rz(c,t,r,n));return i.concat(s,o,a)}function ez(t,e){const n=new nz;t.accept(n);const r=n.allProductions,i=g2(r,tz),s=Zn(i,a=>a.length>1);return fe(Ot(s),a=>{const c=Qn(a),u=e.buildDuplicateFoundError(t,a),l=br(c),d={message:u,type:cn.DUPLICATE_PRODUCTIONS,ruleName:t.name,dslName:l,occurrence:c.idx},f=yR(c);return f&&(d.parameter=f),d})}function tz(t){return`${br(t)}_#_${t.idx}_#_${yR(t)}`}function yR(t){return t instanceof dt?t.terminalType.name:t instanceof an?t.nonTerminalName:""}class nz extends uo{constructor(){super(...arguments),this.allProductions=[]}visitNonTerminal(e){this.allProductions.push(e)}visitOption(e){this.allProductions.push(e)}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}visitAlternation(e){this.allProductions.push(e)}visitTerminal(e){this.allProductions.push(e)}}function rz(t,e,n,r){const i=[];if(on(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:cn.DUPLICATE_RULE_NAME,ruleName:t.name})}return i}function iz(t,e,n){const r=[];let i;return sn(e,t)||(i=`Invalid rule override, rule: ->${t}<- cannot be overridden in the grammar: ->${n}<-as it is not defined in any of the super grammars `,r.push({message:i,type:cn.INVALID_RULE_OVERRIDE,ruleName:t})),r}function vR(t,e,n,r=[]){const i=[],s=bf(e.definition);if(nt(s))return[];{const o=t.name;sn(s,t)&&i.push({message:n.buildLeftRecursionError({topLevelRule:t,leftRecursionPath:r}),type:cn.LEFT_RECURSION,ruleName:o});const c=sf(s,r.concat([t])),u=kn(c,l=>{const d=qt(r);return d.push(l),vR(t,l,n,d)});return i.concat(u)}}function bf(t){let e=[];if(nt(t))return e;const n=Qn(t);if(n instanceof an)e.push(n.referencedRule);else if(n instanceof bn||n instanceof Ut||n instanceof An||n instanceof _n||n instanceof Dn||n instanceof Dt)e=e.concat(bf(n.definition));else if(n instanceof En)e=jn(fe(n.definition,s=>bf(s.definition)));else if(!(n instanceof dt))throw Error("non exhaustive match");const r=cf(n),i=t.length>1;if(r&&i){const s=jt(t);return e.concat(bf(s))}else return e}class Sg extends uo{constructor(){super(...arguments),this.alternations=[]}visitAlternation(e){this.alternations.push(e)}}function sz(t,e){const n=new Sg;t.accept(n);const r=n.alternations;return kn(r,s=>{const o=ec(s.definition);return kn(o,(a,c)=>{const u=dR([a],[],ic,1);return nt(u)?[{message:e.buildEmptyAlternationError({topLevelRule:t,alternation:s,emptyChoiceIdx:c}),type:cn.NONE_LAST_EMPTY_ALT,ruleName:t.name,occurrence:s.idx,alternative:c+1}]:[]})})}function oz(t,e,n){const r=new Sg;t.accept(r);let i=r.alternations;return i=of(i,o=>o.ignoreAmbiguities===!0),kn(i,o=>{const a=o.idx,c=o.maxLookahead||e,u=vf(a,t,c,o),l=lz(u,o,t,n),d=dz(u,o,t,n);return l.concat(d)})}class az extends uo{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 cz(t,e){const n=new Sg;t.accept(n);const r=n.alternations;return kn(r,s=>s.definition.length>255?[{message:e.buildTooManyAlternativesError({topLevelRule:t,alternation:s}),type:cn.TOO_MANY_ALTS,ruleName:t.name,occurrence:s.idx}]:[])}function uz(t,e,n){const r=[];return De(t,i=>{const s=new az;i.accept(s);const o=s.allProductions;De(o,a=>{const c=Rg(a),u=a.maxLookahead||e,l=a.idx,f=wf(l,i,c,u)[0];if(nt(jn(f))){const p=n.buildEmptyRepetitionError({topLevelRule:i,repetition:a});r.push({message:p,type:cn.NO_NON_EMPTY_LOOKAHEAD,ruleName:i.name})}})}),r}function lz(t,e,n,r){const i=[],s=on(t,(a,c,u)=>(e.definition[u].ignoreAmbiguities===!0||De(c,l=>{const d=[u];De(t,(f,p)=>{u!==p&&$g(f,l)&&e.definition[p].ignoreAmbiguities!==!0&&d.push(p)}),d.length>1&&!$g(i,l)&&(i.push(l),a.push({alts:d,path:l}))}),a),[]);return fe(s,a=>{const c=fe(a.alts,l=>l+1);return{message:r.buildAlternationAmbiguityError({topLevelRule:n,alternation:e,ambiguityIndices:c,prefixPath:a.path}),type:cn.AMBIGUOUS_ALTS,ruleName:n.name,occurrence:e.idx,alternatives:a.alts}})}function dz(t,e,n,r){const i=on(t,(o,a,c)=>{const u=fe(a,l=>({idx:c,path:l}));return o.concat(u)},[]);return Za(kn(i,o=>{if(e.definition[o.idx].ignoreAmbiguities===!0)return[];const c=o.idx,u=o.path,l=Cn(i,f=>e.definition[f.idx].ignoreAmbiguities!==!0&&f.idx<c&&JB(f.path,u));return fe(l,f=>{const p=[f.idx+1,c+1],m=e.idx===0?"":e.idx;return{message:r.buildAlternationPrefixAmbiguityError({topLevelRule:n,alternation:e,ambiguityIndices:p,prefixPath:f.path}),type:cn.AMBIGUOUS_PREFIX_ALTS,ruleName:n.name,occurrence:m,alternatives:p}})}))}function fz(t,e,n){const r=[],i=fe(e,s=>s.name);return De(t,s=>{const o=s.name;if(sn(i,o)){const a=n.buildNamespaceConflictError(s);r.push({message:a,type:cn.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:o})}}),r}function pz(t){const e=pg(t,{errMsgProvider:LB}),n={};return De(t.rules,r=>{n[r.name]=r}),MB(n,e.errMsgProvider)}function hz(t){return t=pg(t,{errMsgProvider:as}),ZB(t.rules,t.tokenTypes,t.errMsgProvider,t.grammarName)}const wR="MismatchedTokenException",bR="NoViableAltException",DR="EarlyExitException",ER="NotAllInputParsedException",RR=[wR,bR,DR,ER];Object.freeze(RR);function Df(t){return sn(RR,t.name)}class Ef 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 TR extends Ef{constructor(e,n,r){super(e,n),this.previousToken=r,this.name=wR}}class mz extends Ef{constructor(e,n,r){super(e,n),this.previousToken=r,this.name=bR}}class gz extends Ef{constructor(e,n){super(e,n),this.name=ER}}class yz extends Ef{constructor(e,n,r){super(e,n),this.previousToken=r,this.name=DR}}const Cg={},$R="InRuleRecoveryException";class vz extends Error{constructor(e){super(e),this.name=$R}}class wz{initRecoverable(e){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=Ee(e,"recoveryEnabled")?e.recoveryEnabled:Ur.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=bz)}getTokenToInsert(e){const n=Dg(e,"",NaN,NaN,NaN,NaN,NaN,NaN);return n.isInsertedInRecovery=!0,n}canTokenTypeBeInsertedInRecovery(e){return!0}canTokenTypeBeDeletedInRecovery(e){return!0}tryInRepetitionRecovery(e,n,r,i){const s=this.findReSyncTokenType(),o=this.exportLexerState(),a=[];let c=!1;const u=this.LA(1);let l=this.LA(1);const d=()=>{const f=this.LA(0),p=this.errorMessageProvider.buildMismatchTokenMessage({expected:i,actual:u,previous:f,ruleName:this.getCurrRuleFullName()}),m=new TR(p,u,this.LA(0));m.resyncedTokens=ec(a),this.SAVE_ERROR(m)};for(;!c;)if(this.tokenMatcher(l,i)){d();return}else if(r.call(this)){d(),e.apply(this,n);return}else this.tokenMatcher(l,s)?c=!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(e)){const r=this.SKIP_TOKEN();return this.consumeToken(),r}throw new vz("sad sad panda")}canPerformInRuleRecovery(e,n){return this.canRecoverWithSingleTokenInsertion(e,n)||this.canRecoverWithSingleTokenDeletion(e)}canRecoverWithSingleTokenInsertion(e,n){if(!this.canTokenTypeBeInsertedInRecovery(e)||nt(n))return!1;const r=this.LA(1);return ao(n,s=>this.tokenMatcher(r,s))!==void 0}canRecoverWithSingleTokenDeletion(e){return this.canTokenTypeBeDeletedInRecovery(e)?this.tokenMatcher(this.LA(2),e):!1}isInCurrentRuleReSyncSet(e){const n=this.getCurrFollowKey(),r=this.getFollowSetFromFollowKey(n);return sn(r,e)}findReSyncTokenType(){const e=this.flattenFollowSet();let n=this.LA(1),r=2;for(;;){const i=ao(e,s=>cR(n,s));if(i!==void 0)return i;n=this.LA(r),r++}}getCurrFollowKey(){if(this.RULE_STACK.length===1)return Cg;const e=this.getLastExplicitRuleShortName(),n=this.getLastExplicitRuleOccurrenceIndex(),r=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(e),idxInCallingRule:n,inRule:this.shortRuleNameToFullName(r)}}buildFullFollowKeyStack(){const e=this.RULE_STACK,n=this.RULE_OCCURRENCE_STACK;return fe(e,(r,i)=>i===0?Cg:{ruleName:this.shortRuleNameToFullName(r),idxInCallingRule:n[i],inRule:this.shortRuleNameToFullName(e[i-1])})}flattenFollowSet(){const e=fe(this.buildFullFollowKeyStack(),n=>this.getFollowSetFromFollowKey(n));return jn(e)}getFollowSetFromFollowKey(e){if(e===Cg)return[yi];const n=e.ruleName+e.idxInCallingRule+ME+e.inRule;return this.resyncFollows[n]}addToResyncTokens(e,n){return this.tokenMatcher(e,yi)||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 ec(n)}attemptInRepetitionRecovery(e,n,r,i,s,o,a){}getCurrentGrammarPath(e,n){const r=this.getHumanReadableRuleStack(),i=qt(this.RULE_OCCURRENCE_STACK);return{ruleStack:r,occurrenceStack:i,lastTok:e,lastTokOccurrence:n}}getHumanReadableRuleStack(){return fe(this.RULE_STACK,e=>this.shortRuleNameToFullName(e))}}function bz(t,e,n,r,i,s,o){const a=this.getKeyForAutomaticLookahead(r,i);let c=this.firstAfterRepMap[a];if(c===void 0){const f=this.getCurrRuleFullName(),p=this.getGAstProductions()[f];c=new s(p,i).startWalking(),this.firstAfterRepMap[a]=c}let u=c.token,l=c.occurrence;const d=c.isEndOfRule;this.RULE_STACK.length===1&&d&&u===void 0&&(u=yi,l=1),!(u===void 0||l===void 0)&&this.shouldInRepetitionRecoveryBeTried(u,l,o)&&this.tryInRepetitionRecovery(t,e,n,u)}const Dz=4,vi=8,SR=1<<vi,CR=2<<vi,kg=3<<vi,Ag=4<<vi,_g=5<<vi,Rf=6<<vi;function Pg(t,e,n){return n|e|t}class Ig{constructor(e){var n;this.maxLookahead=(n=e?.maxLookahead)!==null&&n!==void 0?n:Ur.maxLookahead}validate(e){const n=this.validateNoLeftRecursion(e.rules);if(nt(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=>vR(n,n,as))}validateEmptyOrAlternatives(e){return kn(e,n=>sz(n,as))}validateAmbiguousAlternationAlternatives(e,n){return kn(e,r=>oz(r,n,as))}validateSomeNonEmptyLookaheadPath(e,n){return uz(e,n,as)}buildLookaheadForAlternation(e){return WB(e.prodOccurrence,e.rule,e.maxLookahead,e.hasPredicates,e.dynamicTokensEnabled,VB)}buildLookaheadForOptional(e){return HB(e.prodOccurrence,e.rule,e.maxLookahead,e.dynamicTokensEnabled,Rg(e.prodType),KB)}}class Ez{initLooksAhead(e){this.dynamicTokensEnabled=Ee(e,"dynamicTokensEnabled")?e.dynamicTokensEnabled:Ur.dynamicTokensEnabled,this.maxLookahead=Ee(e,"maxLookahead")?e.maxLookahead:Ur.maxLookahead,this.lookaheadStrategy=Ee(e,"lookaheadStrategy")?e.lookaheadStrategy:new Ig({maxLookahead:this.maxLookahead}),this.lookAheadFuncsCache=new Map}preComputeLookaheadFunctions(e){De(e,n=>{this.TRACE_INIT(`${n.name} Rule Lookahead`,()=>{const{alternation:r,repetition:i,option:s,repetitionMandatory:o,repetitionMandatoryWithSeparator:a,repetitionWithSeparator:c}=Tz(n);De(r,u=>{const l=u.idx===0?"":u.idx;this.TRACE_INIT(`${br(u)}${l}`,()=>{const d=this.lookaheadStrategy.buildLookaheadForAlternation({prodOccurrence:u.idx,rule:n,maxLookahead:u.maxLookahead||this.maxLookahead,hasPredicates:u.hasPredicates,dynamicTokensEnabled:this.dynamicTokensEnabled}),f=Pg(this.fullRuleNameToShort[n.name],SR,u.idx);this.setLaFuncCache(f,d)})}),De(i,u=>{this.computeLookaheadFunc(n,u.idx,kg,"Repetition",u.maxLookahead,br(u))}),De(s,u=>{this.computeLookaheadFunc(n,u.idx,CR,"Option",u.maxLookahead,br(u))}),De(o,u=>{this.computeLookaheadFunc(n,u.idx,Ag,"RepetitionMandatory",u.maxLookahead,br(u))}),De(a,u=>{this.computeLookaheadFunc(n,u.idx,Rf,"RepetitionMandatoryWithSeparator",u.maxLookahead,br(u))}),De(c,u=>{this.computeLookaheadFunc(n,u.idx,_g,"RepetitionWithSeparator",u.maxLookahead,br(u))})})})}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,prodType:i}),c=Pg(this.fullRuleNameToShort[e.name],r,n);this.setLaFuncCache(c,a)})}getKeyForAutomaticLookahead(e,n){const r=this.getLastExplicitRuleShortName();return Pg(r,e,n)}getLaFuncFromCache(e){return this.lookAheadFuncsCache.get(e)}setLaFuncCache(e,n){this.lookAheadFuncsCache.set(e,n)}}class Rz extends uo{constructor(){super(...arguments),this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}reset(){this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}visitOption(e){this.dslMethods.option.push(e)}visitRepetitionWithSeparator(e){this.dslMethods.repetitionWithSeparator.push(e)}visitRepetitionMandatory(e){this.dslMethods.repetitionMandatory.push(e)}visitRepetitionMandatoryWithSeparator(e){this.dslMethods.repetitionMandatoryWithSeparator.push(e)}visitRepetition(e){this.dslMethods.repetition.push(e)}visitAlternation(e){this.dslMethods.alternation.push(e)}}const Tf=new Rz;function Tz(t){Tf.reset(),t.accept(Tf);const e=Tf.dslMethods;return Tf.reset(),e}function kR(t,e){isNaN(t.startOffset)===!0?(t.startOffset=e.startOffset,t.endOffset=e.endOffset):t.endOffset<e.endOffset&&(t.endOffset=e.endOffset)}function AR(t,e){isNaN(t.startOffset)===!0?(t.startOffset=e.startOffset,t.startColumn=e.startColumn,t.startLine=e.startLine,t.endOffset=e.endOffset,t.endColumn=e.endColumn,t.endLine=e.endLine):t.endOffset<e.endOffset&&(t.endOffset=e.endOffset,t.endColumn=e.endColumn,t.endLine=e.endLine)}function $z(t,e,n){t.children[n]===void 0?t.children[n]=[e]:t.children[n].push(e)}function Sz(t,e,n){t.children[e]===void 0?t.children[e]=[n]:t.children[e].push(n)}const Cz="name";function _R(t,e){Object.defineProperty(t,Cz,{enumerable:!1,configurable:!0,writable:!1,value:e})}function kz(t,e){const n=qn(t),r=n.length;for(let i=0;i<r;i++){const s=n[i],o=t[s],a=o.length;for(let c=0;c<a;c++){const u=o[c];u.tokenTypeIdx===void 0&&this[u.name](u.children,e)}}}function Az(t,e){const n=function(){};_R(n,t+"BaseSemantics");const r={visit:function(i,s){if(ze(i)&&(i=i[0]),!jr(i))return this[i.name](i.children,s)},validateVisitor:function(){const i=Pz(this,e);if(!nt(i)){const s=fe(i,o=>o.msg);throw Error(`Errors Detected in CST Visitor <${this.constructor.name}>:
|
|
88
|
+
${s.join(`
|
|
89
|
+
|
|
90
|
+
`).replace(/\n/g,`
|
|
91
|
+
`)}`)}}};return n.prototype=r,n.prototype.constructor=n,n._RULE_NAMES=e,n}function _z(t,e,n){const r=function(){};_R(r,t+"BaseSemanticsWithDefaults");const i=Object.create(n.prototype);return De(e,s=>{i[s]=kz}),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 Pz(t,e){return Iz(t,e)}function Iz(t,e){const n=Cn(e,i=>Mr(t[i])===!1),r=fe(n,i=>({msg:`Missing visitor method: <${i}> on ${t.constructor.name} CST Visitor.`,type:xg.MISSING_METHOD,methodName:i}));return Za(r)}class xz{initTreeBuilder(e){if(this.CST_STACK=[],this.outputCst=e.outputCst,this.nodeLocationTracking=Ee(e,"nodeLocationTracking")?e.nodeLocationTracking:Ur.nodeLocationTracking,!this.outputCst)this.cstInvocationStateUpdate=xt,this.cstFinallyStateUpdate=xt,this.cstPostTerminal=xt,this.cstPostNonTerminal=xt,this.cstPostRule=xt;else if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=AR,this.setNodeLocationFromNode=AR,this.cstPostRule=xt,this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=xt,this.setNodeLocationFromNode=xt,this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=kR,this.setNodeLocationFromNode=kR,this.cstPostRule=xt,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=xt,this.setNodeLocationFromNode=xt,this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else if(/none/i.test(this.nodeLocationTracking))this.setNodeLocationFromToken=xt,this.setNodeLocationFromNode=xt,this.cstPostRule=xt,this.setInitialNodeLocation=xt;else throw Error(`Invalid <nodeLocationTracking> config option: "${e.nodeLocationTracking}"`)}setInitialNodeLocationOnlyOffsetRecovery(e){e.location={startOffset:NaN,endOffset:NaN}}setInitialNodeLocationOnlyOffsetRegular(e){e.location={startOffset:this.LA(1).startOffset,endOffset:NaN}}setInitialNodeLocationFullRecovery(e){e.location={startOffset:NaN,startLine:NaN,startColumn:NaN,endOffset:NaN,endLine:NaN,endColumn:NaN}}setInitialNodeLocationFullRegular(e){const 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.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.length-1];$z(r,n,e),this.setNodeLocationFromToken(r.location,n)}cstPostNonTerminal(e,n){const r=this.CST_STACK[this.CST_STACK.length-1];Sz(r,n,e),this.setNodeLocationFromNode(r.location,e.location)}getBaseCstVisitorConstructor(){if(jr(this.baseCstVisitorConstructor)){const e=Az(this.className,qn(this.gastProductionsCache));return this.baseCstVisitorConstructor=e,e}return this.baseCstVisitorConstructor}getBaseCstVisitorConstructorWithDefaults(){if(jr(this.baseCstVisitorWithDefaultsConstructor)){const e=_z(this.className,qn(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 Oz{initLexerAdapter(){this.tokVector=[],this.tokVectorLength=0,this.currIdx=-1}set input(e){if(this.selfAnalysisDone!==!0)throw Error("Missing <performSelfAnalysis> invocation at the end of the Parser's constructor.");this.reset(),this.tokVector=e,this.tokVectorLength=e.length}get input(){return this.tokVector}SKIP_TOKEN(){return this.currIdx<=this.tokVector.length-2?(this.consumeToken(),this.LA(1)):Cf}LA(e){const n=this.currIdx+e;return n<0||this.tokVectorLength<=n?Cf:this.tokVector[n]}consumeToken(){this.currIdx++}exportLexerState(){return this.currIdx}importLexerState(e){this.currIdx=e}resetLexerState(){this.currIdx=-1}moveToTerminatedState(){this.currIdx=this.tokVector.length-1}getLexerPosition(){return this.exportLexerState()}}class Nz{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(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){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(e,1)}OPTION2(e){return this.optionInternal(e,2)}OPTION3(e){return this.optionInternal(e,3)}OPTION4(e){return this.optionInternal(e,4)}OPTION5(e){return this.optionInternal(e,5)}OPTION6(e){return this.optionInternal(e,6)}OPTION7(e){return this.optionInternal(e,7)}OPTION8(e){return this.optionInternal(e,8)}OPTION9(e){return this.optionInternal(e,9)}OR(e){return this.orInternal(e,0)}OR1(e){return this.orInternal(e,1)}OR2(e){return this.orInternal(e,2)}OR3(e){return this.orInternal(e,3)}OR4(e){return this.orInternal(e,4)}OR5(e){return this.orInternal(e,5)}OR6(e){return this.orInternal(e,6)}OR7(e){return this.orInternal(e,7)}OR8(e){return this.orInternal(e,8)}OR9(e){return this.orInternal(e,9)}MANY(e){this.manyInternal(0,e)}MANY1(e){this.manyInternal(1,e)}MANY2(e){this.manyInternal(2,e)}MANY3(e){this.manyInternal(3,e)}MANY4(e){this.manyInternal(4,e)}MANY5(e){this.manyInternal(5,e)}MANY6(e){this.manyInternal(6,e)}MANY7(e){this.manyInternal(7,e)}MANY8(e){this.manyInternal(8,e)}MANY9(e){this.manyInternal(9,e)}MANY_SEP(e){this.manySepFirstInternal(0,e)}MANY_SEP1(e){this.manySepFirstInternal(1,e)}MANY_SEP2(e){this.manySepFirstInternal(2,e)}MANY_SEP3(e){this.manySepFirstInternal(3,e)}MANY_SEP4(e){this.manySepFirstInternal(4,e)}MANY_SEP5(e){this.manySepFirstInternal(5,e)}MANY_SEP6(e){this.manySepFirstInternal(6,e)}MANY_SEP7(e){this.manySepFirstInternal(7,e)}MANY_SEP8(e){this.manySepFirstInternal(8,e)}MANY_SEP9(e){this.manySepFirstInternal(9,e)}AT_LEAST_ONE(e){this.atLeastOneInternal(0,e)}AT_LEAST_ONE1(e){return this.atLeastOneInternal(1,e)}AT_LEAST_ONE2(e){this.atLeastOneInternal(2,e)}AT_LEAST_ONE3(e){this.atLeastOneInternal(3,e)}AT_LEAST_ONE4(e){this.atLeastOneInternal(4,e)}AT_LEAST_ONE5(e){this.atLeastOneInternal(5,e)}AT_LEAST_ONE6(e){this.atLeastOneInternal(6,e)}AT_LEAST_ONE7(e){this.atLeastOneInternal(7,e)}AT_LEAST_ONE8(e){this.atLeastOneInternal(8,e)}AT_LEAST_ONE9(e){this.atLeastOneInternal(9,e)}AT_LEAST_ONE_SEP(e){this.atLeastOneSepFirstInternal(0,e)}AT_LEAST_ONE_SEP1(e){this.atLeastOneSepFirstInternal(1,e)}AT_LEAST_ONE_SEP2(e){this.atLeastOneSepFirstInternal(2,e)}AT_LEAST_ONE_SEP3(e){this.atLeastOneSepFirstInternal(3,e)}AT_LEAST_ONE_SEP4(e){this.atLeastOneSepFirstInternal(4,e)}AT_LEAST_ONE_SEP5(e){this.atLeastOneSepFirstInternal(5,e)}AT_LEAST_ONE_SEP6(e){this.atLeastOneSepFirstInternal(6,e)}AT_LEAST_ONE_SEP7(e){this.atLeastOneSepFirstInternal(7,e)}AT_LEAST_ONE_SEP8(e){this.atLeastOneSepFirstInternal(8,e)}AT_LEAST_ONE_SEP9(e){this.atLeastOneSepFirstInternal(9,e)}RULE(e,n,r=kf){if(sn(this.definedRulesNames,e)){const o={message:as.buildDuplicateRuleNameError({topLevelRule:e,grammarName:this.className}),type:cn.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=kf){const i=iz(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.saveRecogState();try{return e.apply(this,n),!0}catch(i){if(Df(i))return!1;throw i}finally{this.reloadRecogState(r),this.isBackTrackingStack.pop()}}}getGAstProductions(){return this.gastProductionsCache}getSerializedGastProductions(){return G2(Ot(this.gastProductionsCache))}}class Fz{initRecognizerEngine(e,n){if(this.className=this.constructor.name,this.shortRuleNameToFull={},this.fullRuleNameToShort={},this.ruleShortNameIdx=256,this.tokenMatcher=gf,this.subruleIdx=0,this.definedRulesNames=[],this.tokensMap={},this.isBackTrackingStack=[],this.RULE_STACK=[],this.RULE_OCCURRENCE_STACK=[],this.gastProductionsCache={},Ee(n,"serializedGrammar"))throw Error(`The Parser's configuration can no longer contain a <serializedGrammar> property.
|
|
92
|
+
See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_6-0-0
|
|
93
|
+
For Further details.`);if(ze(e)){if(nt(e))throw Error(`A Token Vocabulary cannot be empty.
|
|
94
|
+
Note that the first argument for the parser constructor
|
|
95
|
+
is no longer a Token vector (since v4.0).`);if(typeof e[0].startOffset=="number")throw Error(`The Parser constructor no longer accepts a token vector as the first argument.
|
|
96
|
+
See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_4-0-0
|
|
97
|
+
For Further details.`)}if(ze(e))this.tokensMap=on(e,(s,o)=>(s[o.name]=o,s),{});else if(Ee(e,"modes")&&Jn(jn(Ot(e.modes)),OB)){const s=jn(Ot(e.modes)),o=hg(s);this.tokensMap=on(o,(a,c)=>(a[c.name]=c,a),{})}else if(zn(e))this.tokensMap=qt(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=yi;const r=Ee(e,"modes")?jn(Ot(e.modes)):Ot(e),i=Jn(r,s=>nt(s.categoryMatches));this.tokenMatcher=i?gf:ic,sc(Ot(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'
|
|
98
|
+
Make sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.`);const i=Ee(r,"resyncEnabled")?r.resyncEnabled:kf.resyncEnabled,s=Ee(r,"recoveryValueFunc")?r.recoveryValueFunc:kf.recoveryValueFunc,o=this.ruleShortNameIdx<<Dz+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 d=this.CST_STACK[this.CST_STACK.length-1];return this.cstPostRule(d),d}catch(d){return this.invokeRuleCatch(d,i,s)}finally{this.ruleFinallyStateUpdate()}}:a=function(...l){try{return this.ruleInvocationStateUpdate(o,e,this.subruleIdx),n.apply(this,l)}catch(d){return this.invokeRuleCatch(d,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(Df(e)){const o=e;if(s){const a=this.findReSyncTokenType();if(this.isInCurrentRuleReSyncSet(a))if(o.resyncedTokens=this.reSyncTo(a),this.outputCst){const c=this.CST_STACK[this.CST_STACK.length-1];return c.recoveredNode=!0,c}else return r(e);else{if(this.outputCst){const c=this.CST_STACK[this.CST_STACK.length-1];c.recoveredNode=!0,o.partialCstResult=c}throw o}}else{if(i)return this.moveToTerminatedState(),r(e);throw o}}else throw e}optionInternal(e,n){const r=this.getKeyForAutomaticLookahead(CR,n);return this.optionInternalLogic(e,n,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(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,gt.REPETITION_MANDATORY,n.ERR_MSG);this.attemptInRepetitionRecovery(this.atLeastOneInternal,[e,n],i,Ag,e,UB)}atLeastOneSepFirstInternal(e,n){const r=this.getKeyForAutomaticLookahead(Rf,e);this.atLeastOneSepFirstInternalLogic(e,n,r)}atLeastOneSepFirstInternalLogic(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.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,lR],a,Rf,e,lR)}else throw this.raiseEarlyExitException(e,gt.REPETITION_MANDATORY_WITH_SEPARATOR,n.ERR_MSG)}manyInternal(e,n){const r=this.getKeyForAutomaticLookahead(kg,e);return this.manyInternalLogic(e,n,r)}manyInternalLogic(e,n,r){let i=this.getLaFuncFromCache(r),s;if(typeof n!="function"){s=n.DEF;const a=n.GATE;if(a!==void 0){const c=i;i=()=>a.call(this)&&c.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,kg,e,jB,o)}manySepFirstInternal(e,n){const r=this.getKeyForAutomaticLookahead(_g,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.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,uR],a,_g,e,uR)}}repetitionSepSecondInternal(e,n,r,i,s){for(;r();)this.CONSUME(n),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,n,r,i,s],r,Rf,e,s)}doSingleRepetition(e){const n=this.getLexerPosition();return e.call(this),this.getLexerPosition()>n}orInternal(e,n){const r=this.getKeyForAutomaticLookahead(SR,n),i=ze(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 gz(n,e))}}subruleInternal(e,n,r){let i;try{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 Df(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):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 TR(i,n,s))}consumeInternalRecovery(e,n,r){if(this.recoveryEnabled&&r.name==="MismatchedTokenException"&&!this.isBackTracking()){const i=this.getFollowsForInRuleRecovery(e,n);try{return this.tryInRuleRecovery(e,i)}catch(s){throw s.name===$R?r:s}}else throw r}saveRecogState(){const e=this.errors,n=qt(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.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),yi)}reset(){this.resetLexerState(),this.subruleIdx=0,this.isBackTrackingStack=[],this.errors=[],this.RULE_STACK=[],this.CST_STACK=[],this.RULE_OCCURRENCE_STACK=[]}}class Lz{initErrorHandler(e){this._errors=[],this.errorMessageProvider=Ee(e,"errorMessageProvider")?e.errorMessageProvider:Ur.errorMessageProvider}SAVE_ERROR(e){if(Df(e))return e.context={ruleStack:this.getHumanReadableRuleStack(),ruleOccurrenceStack:qt(this.RULE_OCCURRENCE_STACK)},this._errors.push(e),e;throw Error("Trying to save an Error which is not a RecognitionException")}get errors(){return qt(this._errors)}set errors(e){this._errors=e}raiseEarlyExitException(e,n,r){const i=this.getCurrRuleFullName(),s=this.getGAstProductions()[i],a=wf(e,s,n,this.maxLookahead)[0],c=[];for(let l=1;l<=this.maxLookahead;l++)c.push(this.LA(l));const u=this.errorMessageProvider.buildEarlyExitMessage({expectedIterationPaths:a,actual:c,previous:this.LA(0),customUserDescription:r,ruleName:i});throw this.SAVE_ERROR(new yz(u,this.LA(1),this.LA(0)))}raiseNoAltException(e,n){const r=this.getCurrRuleFullName(),i=this.getGAstProductions()[r],s=vf(e,i,this.maxLookahead),o=[];for(let u=1;u<=this.maxLookahead;u++)o.push(this.LA(u));const a=this.LA(0),c=this.errorMessageProvider.buildNoViableAltMessage({expectedPathsPerAlt:s,actual:o,previous:a,customUserDescription:n,ruleName:this.getCurrRuleFullName()});throw this.SAVE_ERROR(new mz(c,this.LA(1),a))}}class Mz{initContentAssist(){}computeContentAssist(e,n){const r=this.gastProductionsCache[e];if(jr(r))throw Error(`Rule ->${e}<- does not exist in this grammar.`);return dR([r],n,this.tokenMatcher,this.maxLookahead)}getNextPossibleTokenTypes(e){const n=Qn(e.ruleStack),i=this.getGAstProductions()[n];return new qB(i,e).startWalking()}}const $f={description:"This Object indicates the Parser is during Recording Phase"};Object.freeze($f);const PR=!0,IR=Math.pow(2,vi)-1,xR=aR({name:"RECORDING_PHASE_TOKEN",pattern:Rn.NA});sc([xR]);const OR=Dg(xR,`This IToken indicates the Parser is in Recording Phase
|
|
99
|
+
See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,-1,-1,-1,-1,-1,-1);Object.freeze(OR);const Bz={name:`This CSTNode indicates the Parser is in Recording Phase
|
|
100
|
+
See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,children:{}};class zz{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(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.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[`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 Cf}topLevelRuleRecord(e,n){try{const r=new co({definition:[],name:e});return r.name=e,this.recordingProdStack.push(r),n.call(this),this.recordingProdStack.pop(),r}catch(r){if(r.KNOWN_RECORDER_ERROR!==!0)try{r.message=r.message+`
|
|
101
|
+
This error was thrown during the "grammar recording phase" For more info see:
|
|
102
|
+
https://chevrotain.io/docs/guide/internals.html#grammar-recording`}catch{throw r}throw r}}optionInternalRecord(e,n){return ac.call(this,Ut,e,n)}atLeastOneInternalRecord(e,n){ac.call(this,An,n,e)}atLeastOneSepFirstInternalRecord(e,n){ac.call(this,_n,n,e,PR)}manyInternalRecord(e,n){ac.call(this,Dt,n,e)}manySepFirstInternalRecord(e,n){ac.call(this,Dn,n,e,PR)}orInternalRecord(e,n){return qz.call(this,e,n)}subruleInternalRecord(e,n,r){if(Sf(n),!e||Ee(e,"ruleName")===!1){const a=new Error(`<SUBRULE${NR(n)}> argument is invalid expecting a Parser method reference but got: <${JSON.stringify(e)}>
|
|
103
|
+
inside top level rule: <${this.recordingProdStack[0].name}>`);throw a.KNOWN_RECORDER_ERROR=!0,a}const i=oo(this.recordingProdStack),s=e.ruleName,o=new an({idx:n,nonTerminalName:s,label:r?.LABEL,referencedRule:void 0});return i.definition.push(o),this.outputCst?Bz:$f}consumeInternalRecord(e,n,r){if(Sf(n),!XE(e)){const o=new Error(`<CONSUME${NR(n)}> argument is invalid expecting a TokenType reference but got: <${JSON.stringify(e)}>
|
|
104
|
+
inside top level rule: <${this.recordingProdStack[0].name}>`);throw o.KNOWN_RECORDER_ERROR=!0,o}const i=oo(this.recordingProdStack),s=new dt({idx:n,terminalType:e,label:r?.LABEL});return i.definition.push(s),OR}}function ac(t,e,n,r=!1){Sf(n);const i=oo(this.recordingProdStack),s=Mr(e)?e:e.DEF,o=new t({definition:[],idx:n});return r&&(o.separator=e.SEP),Ee(e,"MAX_LOOKAHEAD")&&(o.maxLookahead=e.MAX_LOOKAHEAD),this.recordingProdStack.push(o),s.call(this),i.definition.push(o),this.recordingProdStack.pop(),$f}function qz(t,e){Sf(e);const n=oo(this.recordingProdStack),r=ze(t)===!1,i=r===!1?t:t.DEF,s=new En({definition:[],idx:e,ignoreAmbiguities:r&&t.IGNORE_AMBIGUITIES===!0});Ee(t,"MAX_LOOKAHEAD")&&(s.maxLookahead=t.MAX_LOOKAHEAD);const o=IE(i,a=>Mr(a.GATE));return s.hasPredicates=o,n.definition.push(s),De(i,a=>{const c=new bn({definition:[]});s.definition.push(c),Ee(a,"IGNORE_AMBIGUITIES")?c.ignoreAmbiguities=a.IGNORE_AMBIGUITIES:Ee(a,"GATE")&&(c.ignoreAmbiguities=!0),this.recordingProdStack.push(c),a.ALT.call(this),this.recordingProdStack.pop()}),$f}function NR(t){return t===0?"":`${t}`}function Sf(t){if(t<0||t>IR){const e=new Error(`Invalid DSL Method idx value: <${t}>
|
|
105
|
+
Idx value must be a none negative value smaller than ${IR+1}`);throw e.KNOWN_RECORDER_ERROR=!0,e}}class jz{initPerformanceTracer(e){if(Ee(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=Ur.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&&console.log(`${r}--> <${e}>`);const{time:i,value:s}=NE(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 Uz(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 Cf=Dg(yi,"",NaN,NaN,NaN,NaN,NaN,NaN);Object.freeze(Cf);const Ur=Object.freeze({recoveryEnabled:!1,maxLookahead:3,dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:fo,nodeLocationTracking:"none",traceInitPerf:!1,skipValidations:!1}),kf=Object.freeze({recoveryValueFunc:()=>{},resyncEnabled:!0});var cn;(function(t){t[t.INVALID_RULE_NAME=0]="INVALID_RULE_NAME",t[t.DUPLICATE_RULE_NAME=1]="DUPLICATE_RULE_NAME",t[t.INVALID_RULE_OVERRIDE=2]="INVALID_RULE_OVERRIDE",t[t.DUPLICATE_PRODUCTIONS=3]="DUPLICATE_PRODUCTIONS",t[t.UNRESOLVED_SUBRULE_REF=4]="UNRESOLVED_SUBRULE_REF",t[t.LEFT_RECURSION=5]="LEFT_RECURSION",t[t.NONE_LAST_EMPTY_ALT=6]="NONE_LAST_EMPTY_ALT",t[t.AMBIGUOUS_ALTS=7]="AMBIGUOUS_ALTS",t[t.CONFLICT_TOKENS_RULES_NAMESPACE=8]="CONFLICT_TOKENS_RULES_NAMESPACE",t[t.INVALID_TOKEN_NAME=9]="INVALID_TOKEN_NAME",t[t.NO_NON_EMPTY_LOOKAHEAD=10]="NO_NON_EMPTY_LOOKAHEAD",t[t.AMBIGUOUS_PREFIX_ALTS=11]="AMBIGUOUS_PREFIX_ALTS",t[t.TOO_MANY_ALTS=12]="TOO_MANY_ALTS",t[t.CUSTOM_LOOKAHEAD_VALIDATION=13]="CUSTOM_LOOKAHEAD_VALIDATION"})(cn||(cn={}));function FR(t=void 0){return function(){return t}}class md{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",()=>{FE(this)}),this.TRACE_INIT("Grammar Recording",()=>{try{this.enableRecording(),De(this.definedRulesNames,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=pz({rules:Ot(this.gastProductionsCache)}),this.definitionErrors=this.definitionErrors.concat(r)}),this.TRACE_INIT("Grammar Validations",()=>{if(nt(r)&&this.skipValidations===!1){const i=hz({rules:Ot(this.gastProductionsCache),tokenTypes:Ot(this.tokensMap),errMsgProvider:as,grammarName:n}),s=QB({lookaheadStrategy:this.lookaheadStrategy,rules:Ot(this.gastProductionsCache),tokenTypes:Ot(this.tokensMap),grammarName:n});this.definitionErrors=this.definitionErrors.concat(i,s)}}),nt(this.definitionErrors)&&(this.recoveryEnabled&&this.TRACE_INIT("computeAllProdsFollows",()=>{const i=J2(Ot(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:Ot(this.gastProductionsCache)}),this.preComputeLookaheadFunctions(Ot(this.gastProductionsCache))})),!md.DEFER_DEFINITION_ERRORS_HANDLING&&!nt(this.definitionErrors))throw e=fe(this.definitionErrors,i=>i.message),new Error(`Parser Definition Errors detected:
|
|
106
|
+
${e.join(`
|
|
107
|
+
-------------------------------
|
|
108
|
+
`)}`)})}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),Ee(n,"ignoredIssues"))throw new Error(`The <ignoredIssues> IParserConfig property has been deprecated.
|
|
109
|
+
Please use the <IGNORE_AMBIGUITIES> flag on the relevant DSL method instead.
|
|
110
|
+
See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#IGNORING_AMBIGUITIES
|
|
111
|
+
For further details.`);this.skipValidations=Ee(n,"skipValidations")?n.skipValidations:Ur.skipValidations}}md.DEFER_DEFINITION_ERRORS_HANDLING=!1,Uz(md,[wz,Ez,xz,Oz,Fz,Nz,Lz,Mz,zz,jz]);class Gz extends md{constructor(e,n=Ur){const r=qt(n);r.outputCst=!1,super(e,r)}}function po(t,e,n){return`${t.name}_${e}_${n}`}const wi=1,Wz=2,LR=4,MR=5,cc=7,Hz=8,Vz=9,Kz=10,Yz=11,BR=12;class Og{constructor(e){this.target=e}isEpsilon(){return!1}}class Ng extends Og{constructor(e,n){super(e),this.tokenType=n}}class zR extends Og{constructor(e){super(e)}isEpsilon(){return!0}}class Fg extends Og{constructor(e,n,r){super(e),this.rule=n,this.followState=r}isEpsilon(){return!0}}function Xz(t){const e={decisionMap:{},decisionStates:[],ruleToStartState:new Map,ruleToStopState:new Map,states:[]};Jz(e,t);const n=t.length;for(let r=0;r<n;r++){const i=t[r],s=cs(e,i,i);s!==void 0&&cq(e,i,s)}return e}function Jz(t,e){const n=e.length;for(let r=0;r<n;r++){const i=e[r],s=Mt(t,i,void 0,{type:Wz}),o=Mt(t,i,void 0,{type:cc});s.stop=o,t.ruleToStartState.set(i,s),t.ruleToStopState.set(i,o)}}function qR(t,e,n){return n instanceof dt?Lg(t,e,n.terminalType,n):n instanceof an?aq(t,e,n):n instanceof En?nq(t,e,n):n instanceof Ut?rq(t,e,n):n instanceof Dt?Qz(t,e,n):n instanceof Dn?Zz(t,e,n):n instanceof An?eq(t,e,n):n instanceof _n?tq(t,e,n):cs(t,e,n)}function Qz(t,e,n){const r=Mt(t,e,n,{type:MR});bi(t,r);const i=ho(t,e,r,n,cs(t,e,n));return UR(t,e,n,i)}function Zz(t,e,n){const r=Mt(t,e,n,{type:MR});bi(t,r);const i=ho(t,e,r,n,cs(t,e,n)),s=Lg(t,e,n.separator,n);return UR(t,e,n,i,s)}function eq(t,e,n){const r=Mt(t,e,n,{type:LR});bi(t,r);const i=ho(t,e,r,n,cs(t,e,n));return jR(t,e,n,i)}function tq(t,e,n){const r=Mt(t,e,n,{type:LR});bi(t,r);const i=ho(t,e,r,n,cs(t,e,n)),s=Lg(t,e,n.separator,n);return jR(t,e,n,i,s)}function nq(t,e,n){const r=Mt(t,e,n,{type:wi});bi(t,r);const i=fe(n.definition,o=>qR(t,e,o));return ho(t,e,r,n,...i)}function rq(t,e,n){const r=Mt(t,e,n,{type:wi});bi(t,r);const i=ho(t,e,r,n,cs(t,e,n));return iq(t,e,n,i)}function cs(t,e,n){const r=Cn(fe(n.definition,i=>qR(t,e,i)),i=>i!==void 0);return r.length===1?r[0]:r.length===0?void 0:oq(t,r)}function jR(t,e,n,r,i){const s=r.left,o=r.right,a=Mt(t,e,n,{type:Yz});bi(t,a);const c=Mt(t,e,n,{type:BR});return s.loopback=a,c.loopback=a,t.decisionMap[po(e,i?"RepetitionMandatoryWithSeparator":"RepetitionMandatory",n.idx)]=a,kt(o,a),i===void 0?(kt(a,s),kt(a,c)):(kt(a,c),kt(a,i.left),kt(i.right,s)),{left:s,right:c}}function UR(t,e,n,r,i){const s=r.left,o=r.right,a=Mt(t,e,n,{type:Kz});bi(t,a);const c=Mt(t,e,n,{type:BR}),u=Mt(t,e,n,{type:Vz});return a.loopback=u,c.loopback=u,kt(a,s),kt(a,c),kt(o,u),i!==void 0?(kt(u,c),kt(u,i.left),kt(i.right,s)):kt(u,a),t.decisionMap[po(e,i?"RepetitionWithSeparator":"Repetition",n.idx)]=a,{left:a,right:c}}function iq(t,e,n,r){const i=r.left,s=r.right;return kt(i,s),t.decisionMap[po(e,"Option",n.idx)]=i,r}function bi(t,e){return t.decisionStates.push(e),e.decision=t.decisionStates.length-1,e.decision}function ho(t,e,n,r,...i){const s=Mt(t,e,r,{type:Hz,start:n});n.end=s;for(const a of i)a!==void 0?(kt(n,a.left),kt(a.right,s)):kt(n,s);const o={left:n,right:s};return t.decisionMap[po(e,sq(r),r.idx)]=n,o}function sq(t){if(t instanceof En)return"Alternation";if(t instanceof Ut)return"Option";if(t instanceof Dt)return"Repetition";if(t instanceof Dn)return"RepetitionWithSeparator";if(t instanceof An)return"RepetitionMandatory";if(t instanceof _n)return"RepetitionMandatoryWithSeparator";throw new Error("Invalid production type encountered")}function oq(t,e){const n=e.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 c=a instanceof Fg,u=a,l=e[s+1].left;o.left.type===wi&&o.right.type===wi&&a!==void 0&&(c&&u.followState===o.right||a.target===o.right)?(c?u.followState=l:a.target=l,uq(t,o.right)):kt(o.right,l)}const r=e[0],i=e[n-1];return{left:r.left,right:i.right}}function Lg(t,e,n,r){const i=Mt(t,e,r,{type:wi}),s=Mt(t,e,r,{type:wi});return Mg(i,new Ng(s,n)),{left:i,right:s}}function aq(t,e,n){const r=n.referencedRule,i=t.ruleToStartState.get(r),s=Mt(t,e,n,{type:wi}),o=Mt(t,e,n,{type:wi}),a=new Fg(i,r,o);return Mg(s,a),{left:s,right:o}}function cq(t,e,n){const r=t.ruleToStartState.get(e);kt(r,n.left);const i=t.ruleToStopState.get(e);return kt(n.right,i),{left:r,right:i}}function kt(t,e){const n=new zR(e);Mg(t,n)}function Mt(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(i),i}function Mg(t,e){t.transitions.length===0&&(t.epsilonOnlyTransitions=e.isEpsilon()),t.transitions.push(e)}function uq(t,e){t.states.splice(t.states.indexOf(e),1)}const Af={};class Bg{constructor(){this.map={},this.configs=[]}get size(){return this.configs.length}finalize(){this.map={}}add(e){const n=GR(e);n in this.map||(this.map[n]=this.configs.length,this.configs.push(e))}get elements(){return this.configs}get alts(){return fe(this.configs,e=>e.alt)}get key(){let e="";for(const n in this.map)e+=n+":";return e}}function GR(t,e=!0){return`${e?`a${t.alt}`:""}s${t.state.stateNumber}:${t.stack.map(n=>n.stateNumber.toString()).join("_")}`}function lq(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 WR{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.predicates[r]===!0?"1":"0";return e}}const HR=new WR;class dq extends Ig{constructor(e){var n;super(),this.logging=(n=e?.logging)!==null&&n!==void 0?n:r=>console.log(r)}initialize(e){this.atn=Xz(e.rules),this.dfas=fq(this.atn)}validateAmbiguousAlternationAlternatives(){return[]}validateEmptyOrAlternatives(){return[]}buildLookaheadForAlternation(e){const{prodOccurrence:n,rule:r,hasPredicates:i,dynamicTokensEnabled:s}=e,o=this.dfas,a=this.logging,c=po(r,"Alternation",n),l=this.atn.decisionMap[c].decision,d=fe(fR({maxLookahead:1,occurrence:n,prodType:"Alternation",rule:r}),f=>fe(f,p=>p[0]));if(VR(d,!1)&&!s){const f=on(d,(p,m,w)=>(De(m,E=>{E&&(p[E.tokenTypeIdx]=w,De(E.categoryMatches,y=>{p[y]=w}))}),p),{});return i?function(p){var m;const w=this.LA(1),E=f[w.tokenTypeIdx];if(p!==void 0&&E!==void 0){const y=(m=p[E])===null||m===void 0?void 0:m.GATE;if(y!==void 0&&y.call(this)===!1)return}return E}:function(){const p=this.LA(1);return f[p.tokenTypeIdx]}}else return i?function(f){const p=new WR,m=f===void 0?0:f.length;for(let E=0;E<m;E++){const y=f?.[E].GATE;p.set(E,y===void 0||y.call(this))}const w=zg.call(this,o,l,p,a);return typeof w=="number"?w:void 0}:function(){const f=zg.call(this,o,l,HR,a);return typeof f=="number"?f:void 0}}buildLookaheadForOptional(e){const{prodOccurrence:n,rule:r,prodType:i,dynamicTokensEnabled:s}=e,o=this.dfas,a=this.logging,c=po(r,i,n),l=this.atn.decisionMap[c].decision,d=fe(fR({maxLookahead:1,occurrence:n,prodType:i,rule:r}),f=>fe(f,p=>p[0]));if(VR(d)&&d[0][0]&&!s){const f=d[0],p=jn(f);if(p.length===1&&nt(p[0].categoryMatches)){const w=p[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===w}}else{const m=on(p,(w,E)=>(E!==void 0&&(w[E.tokenTypeIdx]=!0,De(E.categoryMatches,y=>{w[y]=!0})),w),{});return function(){const w=this.LA(1);return m[w.tokenTypeIdx]===!0}}}return function(){const f=zg.call(this,o,l,HR,a);return typeof f=="object"?!1:f===0}}}function VR(t,e=!0){const n=new Set;for(const r of t){const i=new Set;for(const s of r){if(s===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 fq(t){const e=t.decisionStates.length,n=Array(e);for(let r=0;r<e;r++)n[r]=lq(t.decisionStates[r],r);return n}function zg(t,e,n,r){const i=t[e](n);let s=i.start;if(s===void 0){const a=Rq(i.atnStartState);s=XR(i,KR(a)),i.start=s}return pq.apply(this,[i,s,n,r])}function pq(t,e,n,r){let i=e,s=1;const o=[];let a=this.LA(s++);for(;;){let c=wq(i,a);if(c===void 0&&(c=hq.apply(this,[t,i,a,s,n,r])),c===Af)return vq(o,i,a);if(c.isAcceptState===!0)return c.prediction;i=c,o.push(a),a=this.LA(s++)}}function hq(t,e,n,r,i,s){const o=bq(e.configs,n,i);if(o.size===0)return YR(t,e,n,Af),Af;let a=KR(o);const c=Eq(o,i);if(c!==void 0)a.isAcceptState=!0,a.prediction=c,a.configs.uniqueAlt=c;else if(Cq(o)){const u=P2(o.alts);a.isAcceptState=!0,a.prediction=u,a.configs.uniqueAlt=u,mq.apply(this,[t,r,o.alts,s])}return a=YR(t,e,n,a),a}function mq(t,e,n,r){const i=[];for(let u=1;u<=e;u++)i.push(this.LA(u).tokenType);const s=t.atnStartState,o=s.rule,a=s.production,c=gq({topLevelRule:o,ambiguityIndices:n,production:a,prefixPath:i});r(c)}function gq(t){const e=fe(t.prefixPath,i=>lo(i)).join(", "),n=t.production.idx===0?"":t.production.idx;let r=`Ambiguous Alternatives Detected: <${t.ambiguityIndices.join(", ")}> in <${yq(t.production)}${n}> inside <${t.topLevelRule.name}> Rule,
|
|
112
|
+
<${e}> may appears as a prefix path in all these alternatives.
|
|
113
|
+
`;return r=r+`See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES
|
|
114
|
+
For Further details.`,r}function yq(t){if(t instanceof an)return"SUBRULE";if(t instanceof Ut)return"OPTION";if(t instanceof En)return"OR";if(t instanceof An)return"AT_LEAST_ONE";if(t instanceof _n)return"AT_LEAST_ONE_SEP";if(t instanceof Dn)return"MANY_SEP";if(t instanceof Dt)return"MANY";if(t instanceof dt)return"CONSUME";throw Error("non exhaustive match")}function vq(t,e,n){const r=kn(e.configs.elements,s=>s.state.transitions),i=q2(r.filter(s=>s instanceof Ng).map(s=>s.tokenType),s=>s.tokenTypeIdx);return{actualToken:n,possibleTokenTypes:i,tokenPath:t}}function wq(t,e){return t.edges[e.tokenTypeIdx]}function bq(t,e,n){const r=new Bg,i=[];for(const o of t.elements){if(n.is(o.alt)===!1)continue;if(o.state.type===cc){i.push(o);continue}const a=o.state.transitions.length;for(let c=0;c<a;c++){const u=o.state.transitions[c],l=Dq(u,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 Bg;for(const o of r.elements)_f(o,s)}if(i.length>0&&!$q(s))for(const o of i)s.add(o);return s}function Dq(t,e){if(t instanceof Ng&&cR(e,t.tokenType))return t.target}function Eq(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 KR(t){return{configs:t,edges:{},isAcceptState:!1,prediction:-1}}function YR(t,e,n,r){return r=XR(t,r),e.edges[n.tokenTypeIdx]=r,r}function XR(t,e){if(e===Af)return e;const n=e.configs.key,r=t.states[n];return r!==void 0?r:(e.configs.finalize(),t.states[n]=e,e)}function Rq(t){const e=new Bg,n=t.transitions.length;for(let r=0;r<n;r++){const s={state:t.transitions[r].target,alt:r,stack:[]};_f(s,e)}return e}function _f(t,e){const n=t.state;if(n.type===cc){if(t.stack.length>0){const i=[...t.stack],o={state:i.pop(),alt:t.alt,stack:i};_f(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=Tq(t,s);o!==void 0&&_f(o,e)}}function Tq(t,e){if(e instanceof zR)return{state:e.target,alt:t.alt,stack:t.stack};if(e instanceof Fg){const n=[...t.stack,e.followState];return{state:e.target,alt:t.alt,stack:n}}}function $q(t){for(const e of t.elements)if(e.state.type===cc)return!0;return!1}function Sq(t){for(const e of t.elements)if(e.state.type!==cc)return!1;return!0}function Cq(t){if(Sq(t))return!0;const e=kq(t.elements);return Aq(e)&&!_q(e)}function kq(t){const e=new Map;for(const n of t){const r=GR(n,!1);let i=e.get(r);i===void 0&&(i={},e.set(r,i)),i[n.alt]=!0}return e}function Aq(t){for(const e of Array.from(t.values()))if(Object.keys(e).length>1)return!0;return!1}function _q(t){for(const e of Array.from(t.values()))if(Object.keys(e).length===1)return!0;return!1}var JR;(function(t){function e(n){return typeof n=="string"}t.is=e})(JR||(JR={}));var qg;(function(t){function e(n){return typeof n=="string"}t.is=e})(qg||(qg={}));var QR;(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})(QR||(QR={}));var Pf;(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})(Pf||(Pf={}));var Xe;(function(t){function e(r,i){return r===Number.MAX_VALUE&&(r=Pf.MAX_VALUE),i===Number.MAX_VALUE&&(i=Pf.MAX_VALUE),{line:r,character:i}}t.create=e;function n(r){let i=r;return L.objectLiteral(i)&&L.uinteger(i.line)&&L.uinteger(i.character)}t.is=n})(Xe||(Xe={}));var Me;(function(t){function e(r,i,s,o){if(L.uinteger(r)&&L.uinteger(i)&&L.uinteger(s)&&L.uinteger(o))return{start:Xe.create(r,i),end:Xe.create(s,o)};if(Xe.is(r)&&Xe.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 L.objectLiteral(i)&&Xe.is(i.start)&&Xe.is(i.end)}t.is=n})(Me||(Me={}));var If;(function(t){function e(r,i){return{uri:r,range:i}}t.create=e;function n(r){let i=r;return L.objectLiteral(i)&&Me.is(i.range)&&(L.string(i.uri)||L.undefined(i.uri))}t.is=n})(If||(If={}));var ZR;(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 L.objectLiteral(i)&&Me.is(i.targetRange)&&L.string(i.targetUri)&&Me.is(i.targetSelectionRange)&&(Me.is(i.originSelectionRange)||L.undefined(i.originSelectionRange))}t.is=n})(ZR||(ZR={}));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 L.objectLiteral(i)&&L.numberRange(i.red,0,1)&&L.numberRange(i.green,0,1)&&L.numberRange(i.blue,0,1)&&L.numberRange(i.alpha,0,1)}t.is=n})(jg||(jg={}));var e0;(function(t){function e(r,i){return{range:r,color:i}}t.create=e;function n(r){const i=r;return L.objectLiteral(i)&&Me.is(i.range)&&jg.is(i.color)}t.is=n})(e0||(e0={}));var t0;(function(t){function e(r,i,s){return{label:r,textEdit:i,additionalTextEdits:s}}t.create=e;function n(r){const i=r;return L.objectLiteral(i)&&L.string(i.label)&&(L.undefined(i.textEdit)||Tn.is(i))&&(L.undefined(i.additionalTextEdits)||L.typedArray(i.additionalTextEdits,Tn.is))}t.is=n})(t0||(t0={}));var n0;(function(t){t.Comment="comment",t.Imports="imports",t.Region="region"})(n0||(n0={}));var r0;(function(t){function e(r,i,s,o,a,c){const u={startLine:r,endLine:i};return L.defined(s)&&(u.startCharacter=s),L.defined(o)&&(u.endCharacter=o),L.defined(a)&&(u.kind=a),L.defined(c)&&(u.collapsedText=c),u}t.create=e;function n(r){const i=r;return L.objectLiteral(i)&&L.uinteger(i.startLine)&&L.uinteger(i.startLine)&&(L.undefined(i.startCharacter)||L.uinteger(i.startCharacter))&&(L.undefined(i.endCharacter)||L.uinteger(i.endCharacter))&&(L.undefined(i.kind)||L.string(i.kind))}t.is=n})(r0||(r0={}));var Ug;(function(t){function e(r,i){return{location:r,message:i}}t.create=e;function n(r){let i=r;return L.defined(i)&&If.is(i.location)&&L.string(i.message)}t.is=n})(Ug||(Ug={}));var uc;(function(t){t.Error=1,t.Warning=2,t.Information=3,t.Hint=4})(uc||(uc={}));var i0;(function(t){t.Unnecessary=1,t.Deprecated=2})(i0||(i0={}));var s0;(function(t){function e(n){const r=n;return L.objectLiteral(r)&&L.string(r.href)}t.is=e})(s0||(s0={}));var xf;(function(t){function e(r,i,s,o,a,c){let u={range:r,message:i};return L.defined(s)&&(u.severity=s),L.defined(o)&&(u.code=o),L.defined(a)&&(u.source=a),L.defined(c)&&(u.relatedInformation=c),u}t.create=e;function n(r){var i;let s=r;return L.defined(s)&&Me.is(s.range)&&L.string(s.message)&&(L.number(s.severity)||L.undefined(s.severity))&&(L.integer(s.code)||L.string(s.code)||L.undefined(s.code))&&(L.undefined(s.codeDescription)||L.string((i=s.codeDescription)===null||i===void 0?void 0:i.href))&&(L.string(s.source)||L.undefined(s.source))&&(L.undefined(s.relatedInformation)||L.typedArray(s.relatedInformation,Ug.is))}t.is=n})(xf||(xf={}));var mo;(function(t){function e(r,i,...s){let o={title:r,command:i};return L.defined(s)&&s.length>0&&(o.arguments=s),o}t.create=e;function n(r){let i=r;return L.defined(i)&&L.string(i.title)&&L.string(i.command)}t.is=n})(mo||(mo={}));var Tn;(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 L.objectLiteral(o)&&L.string(o.newText)&&Me.is(o.range)}t.is=i})(Tn||(Tn={}));var Gg;(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 L.objectLiteral(i)&&L.string(i.label)&&(L.boolean(i.needsConfirmation)||i.needsConfirmation===void 0)&&(L.string(i.description)||i.description===void 0)}t.is=n})(Gg||(Gg={}));var go;(function(t){function e(n){const r=n;return L.string(r)}t.is=e})(go||(go={}));var o0;(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 Tn.is(o)&&(Gg.is(o.annotationId)||go.is(o.annotationId))}t.is=i})(o0||(o0={}));var Wg;(function(t){function e(r,i){return{textDocument:r,edits:i}}t.create=e;function n(r){let i=r;return L.defined(i)&&Xg.is(i.textDocument)&&Array.isArray(i.edits)}t.is=n})(Wg||(Wg={}));var Hg;(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==="create"&&L.string(i.uri)&&(i.options===void 0||(i.options.overwrite===void 0||L.boolean(i.options.overwrite))&&(i.options.ignoreIfExists===void 0||L.boolean(i.options.ignoreIfExists)))&&(i.annotationId===void 0||go.is(i.annotationId))}t.is=n})(Hg||(Hg={}));var Vg;(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.kind==="rename"&&L.string(i.oldUri)&&L.string(i.newUri)&&(i.options===void 0||(i.options.overwrite===void 0||L.boolean(i.options.overwrite))&&(i.options.ignoreIfExists===void 0||L.boolean(i.options.ignoreIfExists)))&&(i.annotationId===void 0||go.is(i.annotationId))}t.is=n})(Vg||(Vg={}));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;return i&&i.kind==="delete"&&L.string(i.uri)&&(i.options===void 0||(i.options.recursive===void 0||L.boolean(i.options.recursive))&&(i.options.ignoreIfNotExists===void 0||L.boolean(i.options.ignoreIfNotExists)))&&(i.annotationId===void 0||go.is(i.annotationId))}t.is=n})(Kg||(Kg={}));var Yg;(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=>L.string(i.kind)?Hg.is(i)||Vg.is(i)||Kg.is(i):Wg.is(i)))}t.is=e})(Yg||(Yg={}));var a0;(function(t){function e(r){return{uri:r}}t.create=e;function n(r){let i=r;return L.defined(i)&&L.string(i.uri)}t.is=n})(a0||(a0={}));var c0;(function(t){function e(r,i){return{uri:r,version:i}}t.create=e;function n(r){let i=r;return L.defined(i)&&L.string(i.uri)&&L.integer(i.version)}t.is=n})(c0||(c0={}));var Xg;(function(t){function e(r,i){return{uri:r,version:i}}t.create=e;function n(r){let i=r;return L.defined(i)&&L.string(i.uri)&&(i.version===null||L.integer(i.version))}t.is=n})(Xg||(Xg={}));var u0;(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 L.defined(i)&&L.string(i.uri)&&L.string(i.languageId)&&L.integer(i.version)&&L.string(i.text)}t.is=n})(u0||(u0={}));var Jg;(function(t){t.PlainText="plaintext",t.Markdown="markdown";function e(n){const r=n;return r===t.PlainText||r===t.Markdown}t.is=e})(Jg||(Jg={}));var lc;(function(t){function e(n){const r=n;return L.objectLiteral(n)&&Jg.is(r.kind)&&L.string(r.value)}t.is=e})(lc||(lc={}));var At;(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})(At||(At={}));var Gn;(function(t){t.PlainText=1,t.Snippet=2})(Gn||(Gn={}));var l0;(function(t){t.Deprecated=1})(l0||(l0={}));var d0;(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&&L.string(i.newText)&&Me.is(i.insert)&&Me.is(i.replace)}t.is=n})(d0||(d0={}));var f0;(function(t){t.asIs=1,t.adjustIndentation=2})(f0||(f0={}));var p0;(function(t){function e(n){const r=n;return r&&(L.string(r.detail)||r.detail===void 0)&&(L.string(r.description)||r.description===void 0)}t.is=e})(p0||(p0={}));var h0;(function(t){function e(n){return{label:n}}t.create=e})(h0||(h0={}));var m0;(function(t){function e(n,r){return{items:n||[],isIncomplete:!!r}}t.create=e})(m0||(m0={}));var Of;(function(t){function e(r){return r.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}t.fromPlainText=e;function n(r){const i=r;return L.string(i)||L.objectLiteral(i)&&L.string(i.language)&&L.string(i.value)}t.is=n})(Of||(Of={}));var g0;(function(t){function e(n){let r=n;return!!r&&L.objectLiteral(r)&&(lc.is(r.contents)||Of.is(r.contents)||L.typedArray(r.contents,Of.is))&&(n.range===void 0||Me.is(n.range))}t.is=e})(g0||(g0={}));var y0;(function(t){function e(n,r){return r?{label:n,documentation:r}:{label:n}}t.create=e})(y0||(y0={}));var v0;(function(t){function e(n,r,...i){let s={label:n};return L.defined(r)&&(s.documentation=r),L.defined(i)?s.parameters=i:s.parameters=[],s}t.create=e})(v0||(v0={}));var w0;(function(t){t.Text=1,t.Read=2,t.Write=3})(w0||(w0={}));var b0;(function(t){function e(n,r){let i={range:n};return L.number(r)&&(i.kind=r),i}t.create=e})(b0||(b0={}));var er;(function(t){t.File=1,t.Module=2,t.Namespace=3,t.Package=4,t.Class=5,t.Method=6,t.Property=7,t.Field=8,t.Constructor=9,t.Enum=10,t.Interface=11,t.Function=12,t.Variable=13,t.Constant=14,t.String=15,t.Number=16,t.Boolean=17,t.Array=18,t.Object=19,t.Key=20,t.Null=21,t.EnumMember=22,t.Struct=23,t.Event=24,t.Operator=25,t.TypeParameter=26})(er||(er={}));var D0;(function(t){t.Deprecated=1})(D0||(D0={}));var E0;(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}t.create=e})(E0||(E0={}));var R0;(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})(R0||(R0={}));var T0;(function(t){function e(r,i,s,o,a,c){let u={name:r,detail:i,kind:s,range:o,selectionRange:a};return c!==void 0&&(u.children=c),u}t.create=e;function n(r){let i=r;return i&&L.string(i.name)&&L.number(i.kind)&&Me.is(i.range)&&Me.is(i.selectionRange)&&(i.detail===void 0||L.string(i.detail))&&(i.deprecated===void 0||L.boolean(i.deprecated))&&(i.children===void 0||Array.isArray(i.children))&&(i.tags===void 0||Array.isArray(i.tags))}t.is=n})(T0||(T0={}));var $0;(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"})($0||($0={}));var Nf;(function(t){t.Invoked=1,t.Automatic=2})(Nf||(Nf={}));var S0;(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 L.defined(i)&&L.typedArray(i.diagnostics,xf.is)&&(i.only===void 0||L.typedArray(i.only,L.string))&&(i.triggerKind===void 0||i.triggerKind===Nf.Invoked||i.triggerKind===Nf.Automatic)}t.is=n})(S0||(S0={}));var C0;(function(t){function e(r,i,s){let o={title:r},a=!0;return typeof i=="string"?(a=!1,o.kind=i):mo.is(i)?o.command=i:o.edit=i,a&&s!==void 0&&(o.kind=s),o}t.create=e;function n(r){let i=r;return i&&L.string(i.title)&&(i.diagnostics===void 0||L.typedArray(i.diagnostics,xf.is))&&(i.kind===void 0||L.string(i.kind))&&(i.edit!==void 0||i.command!==void 0)&&(i.command===void 0||mo.is(i.command))&&(i.isPreferred===void 0||L.boolean(i.isPreferred))&&(i.edit===void 0||Yg.is(i.edit))}t.is=n})(C0||(C0={}));var k0;(function(t){function e(r,i){let s={range:r};return L.defined(i)&&(s.data=i),s}t.create=e;function n(r){let i=r;return L.defined(i)&&Me.is(i.range)&&(L.undefined(i.command)||mo.is(i.command))}t.is=n})(k0||(k0={}));var A0;(function(t){function e(r,i){return{tabSize:r,insertSpaces:i}}t.create=e;function n(r){let i=r;return L.defined(i)&&L.uinteger(i.tabSize)&&L.boolean(i.insertSpaces)}t.is=n})(A0||(A0={}));var _0;(function(t){function e(r,i,s){return{range:r,target:i,data:s}}t.create=e;function n(r){let i=r;return L.defined(i)&&Me.is(i.range)&&(L.undefined(i.target)||L.string(i.target))}t.is=n})(_0||(_0={}));var P0;(function(t){function e(r,i){return{range:r,parent:i}}t.create=e;function n(r){let i=r;return L.objectLiteral(i)&&Me.is(i.range)&&(i.parent===void 0||t.is(i.parent))}t.is=n})(P0||(P0={}));var Fe;(function(t){t.namespace="namespace",t.type="type",t.class="class",t.enum="enum",t.interface="interface",t.struct="struct",t.typeParameter="typeParameter",t.parameter="parameter",t.variable="variable",t.property="property",t.enumMember="enumMember",t.event="event",t.function="function",t.method="method",t.macro="macro",t.keyword="keyword",t.modifier="modifier",t.comment="comment",t.string="string",t.number="number",t.regexp="regexp",t.operator="operator",t.decorator="decorator"})(Fe||(Fe={}));var Je;(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"})(Je||(Je={}));var I0;(function(t){function e(n){const r=n;return L.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})(I0||(I0={}));var x0;(function(t){function e(r,i){return{range:r,text:i}}t.create=e;function n(r){const i=r;return i!=null&&Me.is(i.range)&&L.string(i.text)}t.is=n})(x0||(x0={}));var O0;(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&&Me.is(i.range)&&L.boolean(i.caseSensitiveLookup)&&(L.string(i.variableName)||i.variableName===void 0)}t.is=n})(O0||(O0={}));var N0;(function(t){function e(r,i){return{range:r,expression:i}}t.create=e;function n(r){const i=r;return i!=null&&Me.is(i.range)&&(L.string(i.expression)||i.expression===void 0)}t.is=n})(N0||(N0={}));var F0;(function(t){function e(r,i){return{frameId:r,stoppedLocation:i}}t.create=e;function n(r){const i=r;return L.defined(i)&&Me.is(r.stoppedLocation)}t.is=n})(F0||(F0={}));var Qg;(function(t){t.Type=1,t.Parameter=2;function e(n){return n===1||n===2}t.is=e})(Qg||(Qg={}));var Zg;(function(t){function e(r){return{value:r}}t.create=e;function n(r){const i=r;return L.objectLiteral(i)&&(i.tooltip===void 0||L.string(i.tooltip)||lc.is(i.tooltip))&&(i.location===void 0||If.is(i.location))&&(i.command===void 0||mo.is(i.command))}t.is=n})(Zg||(Zg={}));var L0;(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 L.objectLiteral(i)&&Xe.is(i.position)&&(L.string(i.label)||L.typedArray(i.label,Zg.is))&&(i.kind===void 0||Qg.is(i.kind))&&i.textEdits===void 0||L.typedArray(i.textEdits,Tn.is)&&(i.tooltip===void 0||L.string(i.tooltip)||lc.is(i.tooltip))&&(i.paddingLeft===void 0||L.boolean(i.paddingLeft))&&(i.paddingRight===void 0||L.boolean(i.paddingRight))}t.is=n})(L0||(L0={}));var M0;(function(t){function e(n){return{kind:"snippet",value:n}}t.createSnippet=e})(M0||(M0={}));var B0;(function(t){function e(n,r,i,s){return{insertText:n,filterText:r,range:i,command:s}}t.create=e})(B0||(B0={}));var z0;(function(t){function e(n){return{items:n}}t.create=e})(z0||(z0={}));var q0;(function(t){t.Invoked=0,t.Automatic=1})(q0||(q0={}));var j0;(function(t){function e(n,r){return{range:n,text:r}}t.create=e})(j0||(j0={}));var U0;(function(t){function e(n,r){return{triggerKind:n,selectedCompletionInfo:r}}t.create=e})(U0||(U0={}));var G0;(function(t){function e(n){const r=n;return L.objectLiteral(r)&&qg.is(r.uri)&&L.string(r.name)}t.is=e})(G0||(G0={}));var W0;(function(t){function e(s,o,a,c){return new Pq(s,o,a,c)}t.create=e;function n(s){let o=s;return!!(L.defined(o)&&L.string(o.uri)&&(L.undefined(o.languageId)||L.string(o.languageId))&&L.uinteger(o.lineCount)&&L.func(o.getText)&&L.func(o.positionAt)&&L.func(o.offsetAt))}t.is=n;function r(s,o){let a=s.getText(),c=i(o,(l,d)=>{let f=l.range.start.line-d.range.start.line;return f===0?l.range.start.character-d.range.start.character:f}),u=a.length;for(let l=c.length-1;l>=0;l--){let d=c[l],f=s.offsetAt(d.range.start),p=s.offsetAt(d.range.end);if(p<=u)a=a.substring(0,f)+d.newText+a.substring(p,a.length);else throw new Error("Overlapping edit");u=f}return a}t.applyEdits=r;function i(s,o){if(s.length<=1)return s;const a=s.length/2|0,c=s.slice(0,a),u=s.slice(a);i(c,o),i(u,o);let l=0,d=0,f=0;for(;l<c.length&&d<u.length;)o(c[l],u[d])<=0?s[f++]=c[l++]:s[f++]=u[d++];for(;l<c.length;)s[f++]=c[l++];for(;d<u.length;)s[f++]=u[d++];return s}})(W0||(W0={}));let Pq=class{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){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(i);r=s==="\r"||s===`
|
|
115
|
+
`,s==="\r"&&i+1<n.length&&n.charAt(i+1)===`
|
|
116
|
+
`&&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 Xe.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 Xe.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.max(Math.min(r+e.character,i),r)}get lineCount(){return this.getLineOffsets().length}};var L;(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,w){return e.call(p)==="[object Number]"&&m<=p&&p<=w}t.numberRange=a;function c(p){return e.call(p)==="[object Number]"&&-2147483648<=p&&p<=2147483647}t.integer=c;function u(p){return e.call(p)==="[object Number]"&&0<=p&&p<=2147483647}t.uinteger=u;function l(p){return e.call(p)==="[object Function]"}t.func=l;function d(p){return p!==null&&typeof p=="object"}t.objectLiteral=d;function f(p,m){return Array.isArray(p)&&p.every(m)}t.typedArray=f})(L||(L={}));class Iq{constructor(){this.nodeStack=[]}get current(){return this.nodeStack[this.nodeStack.length-1]}buildRootNode(e){return this.rootNode=new V0(e),this.rootNode.root=this.rootNode,this.nodeStack=[this.rootNode],this.rootNode}buildCompositeNode(e){const n=new ty;return n.grammarSource=e,n.root=this.rootNode,this.current.content.push(n),this.nodeStack.push(n),n}buildLeafNode(e,n){const r=new ey(e.startOffset,e.image.length,Td(e),e.tokenType,!1);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(e);r>=0&&n.content.splice(r,1)}}construct(e){const n=this.current;typeof e.$type=="string"&&(this.current.astNode=e),e.$cstNode=n;const r=this.nodeStack.pop();r?.content.length===0&&this.removeNode(r)}addHiddenTokens(e){for(const n of e){const r=new ey(n.startOffset,n.image.length,Td(n),n.tokenType,!0);r.root=this.rootNode,this.addHiddenToken(this.rootNode,r)}}addHiddenToken(e,n){const{offset:r,end:i}=n;for(let s=0;s<e.content.length;s++){const o=e.content[s],{offset:a,end:c}=o;if(xr(o)&&r>a&&i<c){this.addHiddenToken(o,n);return}else if(i<=a){e.content.splice(s,0,n);return}}e.content.push(n)}}class H0{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(){return this.root.fullText.substring(this.offset,this.end)}}class ey extends H0{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 ty extends H0{constructor(){super(...arguments),this.content=new wb(this)}get children(){return this.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._rangeCache}else return{start:Xe.create(0,0),end:Xe.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 wb extends Array{constructor(e){super(),this.parent=e,Object.setPrototypeOf(this,wb.prototype)}push(...e){return this.addParents(e),super.push(...e)}unshift(...e){return this.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 V0 extends ty{get text(){return this._text.substring(this.offset,this.end)}get fullText(){return this._text}constructor(e){super(),this._text="",this._text=e??""}}const ny=Symbol("Datatype");function ry(t){return t.$type===ny}const K0="\u200B",Y0=t=>t.endsWith(K0)?t:t+K0;class X0{constructor(e){this._unorderedGroups=new Map,this.allRules=new Map,this.lexer=e.parser.Lexer;const n=this.lexer.definition,r=e.LanguageMetaData.mode==="production";this.wrapper=new Lq(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.IS_RECORDING}get unorderedGroups(){return this._unorderedGroups}getRuleStack(){return this.wrapper.RULE_STACK}finalize(){this.wrapper.wrapSelfAnalysis()}}class xq extends X0{get current(){return this.stack[this.stack.length-1]}constructor(e){super(e),this.nodeBuilder=new Iq,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(Y0(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(Ud(e))return ny;{const n=es(e);return n??e.name}}}parse(e,n={}){this.nodeBuilder.buildRootNode(e);const r=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,{});return this.nodeBuilder.addHiddenTokens(r.hidden),this.unorderedGroups.clear(),{value:s,lexerErrors:r.errors,lexerReport:r.report,parserErrors:this.wrapper.errors}}startImplementation(e,n){return r=>{if(!this.isRecording()){const s={$type:e};this.stack.push(s),e===ny&&(s.value="")}let i;try{i=n(r)}catch{i=void 0}return!this.isRecording()&&i===void 0&&(i=this.construct()),i}}consume(e,n,r){const i=this.wrapper.wrapConsume(e,n);if(!this.isRecording()&&this.isValidToken(i)){const s=this.nodeBuilder.buildLeafNode(i,r),{assignment:o,isCrossRef:a}=this.getAssignment(r),c=this.current;if(o){const u=hr(r)?i.image:this.converter.convert(i.image,s);this.assign(o.operator,o.feature,u,s,a)}else if(ry(c)){let u=i.image;hr(r)||(u=this.converter.convert(u,s).toString()),c.value+=u}}}isValidToken(e){return!e.isInsertedInRecovery&&!isNaN(e.startOffset)&&typeof e.endOffset=="number"&&!isNaN(e.endOffset)}subrule(e,n,r,i){let s;this.isRecording()||(s=this.nodeBuilder.buildCompositeNode(r));const o=this.wrapper.wrapSubrule(e,n,i);!this.isRecording()&&s&&s.length>0&&this.performSubruleAssignment(o,r,s)}performSubruleAssignment(e,n,r){const{assignment:i,isCrossRef:s}=this.getAssignment(n);if(i)this.assign(i.operator,i.feature,e,r,s);else if(!i){const o=this.current;if(ry(o))o.value+=e.toString();else if(typeof e=="object"&&e){const a=e.$type,c=this.assignWithoutOverride(e,o);a&&(c.$type=a);const u=c;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=e}}construct(){if(this.isRecording())return;const e=this.current;return km(e),this.nodeBuilder.construct(e),this.stack.pop(),ry(e)?this.converter.convert(e.value,e.$cstNode):(_m(this.astReflection,e),e)}getAssignment(e){if(!this.assignmentMap.has(e)){const n=Xt(e,pr);this.assignmentMap.set(e,{assignment:n,isCrossRef:n?$a(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"=":{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 Oq{buildMismatchTokenMessage(e){return fo.buildMismatchTokenMessage(e)}buildNotAllInputParsedMessage(e){return fo.buildNotAllInputParsedMessage(e)}buildNoViableAltMessage(e){return fo.buildNoViableAltMessage(e)}buildEarlyExitMessage(e){return fo.buildEarlyExitMessage(e)}}class J0 extends Oq{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 Nq extends X0{constructor(){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(Y0(e.name),this.startImplementation(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){this.wrapper.wrapConsume(e,n),this.isRecording()||(this.lastElementStack=[...this.elementStack,r],this.nextTokenIndex=this.currIdx+1)}subrule(e,n,r,i){this.before(r),this.wrapper.wrapSubrule(e,n,i),this.after(r)}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 Fq={recoveryEnabled:!0,nodeLocationTracking:"full",skipValidations:!0,errorMessageProvider:new J0};class Lq extends Gz{constructor(e,n){const r=n&&"maxLookahead"in n;super(e,Object.assign(Object.assign(Object.assign({},Fq),{lookaheadStrategy:r?new Ig({maxLookahead:n.maxLookahead}):new dq({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){this.option(e,n)}wrapMany(e,n){this.many(e,n)}wrapAtLeastOne(e,n){this.atLeastOne(e,n)}}function Q0(t,e,n){return Mq({parser:e,tokens:n,ruleNames:new Map},t),e}function Mq(t,e){const n=Nm(e,!1),r=et(e.rules).filter(Yt).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,us(s,i.definition))}}function us(t,e,n=!1){let r;if(hr(e))r=Wq(t,e);else if(Zi(e))r=Bq(t,e);else if(pr(e))r=us(t,e.terminal);else if($a(e))r=Z0(t,e);else if(Nr(e))r=zq(t,e);else if(Sm(e))r=jq(t,e);else if(Cm(e))r=Uq(t,e);else if(fi(e))r=Gq(t,e);else if(Ox(e)){const i=t.consume++;r=()=>t.parser.consume(i,yi,e)}else throw new nD(e.$cstNode,`Unexpected element type: ${e.$type}`);return eT(t,n?void 0:Ff(e),r,e.cardinality)}function Bq(t,e){const n=ja(e);return()=>t.parser.action(n,e)}function zq(t,e){const n=e.rule.ref;if(Yt(n)){const r=t.subrule++,i=e.arguments.length>0?qq(n,e.arguments):()=>({});return s=>t.parser.subrule(r,tT(t,n),e,i(s))}else if(Or(n)){const r=t.consume++,i=iy(t,n.name);return()=>t.parser.consume(r,i,e)}else if(n)sa();else throw new nD(e.$cstNode,`Undefined rule type: ${e.$type}`)}function qq(t,e){const n=e.map(r=>Gr(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 Gr(t){if(Cx(t)){const e=Gr(t.left),n=Gr(t.right);return r=>e(r)||n(r)}else if(Sx(t)){const e=Gr(t.left),n=Gr(t.right);return r=>e(r)&&n(r)}else if(kx(t)){const e=Gr(t.value);return n=>!e(n)}else if(Ax(t)){const e=t.parameter.ref.name;return n=>n!==void 0&&n[e]===!0}else if($x(t)){const e=!!t.true;return()=>e}sa()}function jq(t,e){if(e.elements.length===1)return us(t,e.elements[0]);{const n=[];for(const i of e.elements){const s={ALT:us(t,i,!0)},o=Ff(i);o&&(s.GATE=Gr(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 Uq(t,e){if(e.elements.length===1)return us(t,e.elements[0]);const n=[];for(const a of e.elements){const c={ALT:us(t,a,!0)},u=Ff(a);u&&(c.GATE=Gr(u)),n.push(c)}const r=t.or++,i=(a,c)=>{const u=c.getRuleStack().join("-");return`uGroup_${a}_${u}`},s=a=>t.parser.alternatives(r,n.map((c,u)=>{const l={ALT:()=>!0},d=t.parser;l.ALT=()=>{if(c.ALT(a),!d.isRecording()){const p=i(r,d);d.unorderedGroups.get(p)||d.unorderedGroups.set(p,[]);const m=d.unorderedGroups.get(p);typeof m?.[u]>"u"&&(m[u]=!0)}};const f=c.GATE;return f?l.GATE=()=>f(a):l.GATE=()=>{const p=d.unorderedGroups.get(i(r,d));return!p?.[u]},l})),o=eT(t,Ff(e),s,"*");return a=>{o(a),t.parser.isRecording()||t.parser.unorderedGroups.delete(i(r,t.parser))}}function Gq(t,e){const n=e.elements.map(r=>us(t,r));return r=>n.forEach(i=>i(r))}function Ff(t){if(fi(t))return t.guardCondition}function Z0(t,e,n=e.terminal){if(n)if(Nr(n)&&Yt(n.rule.ref)){const r=t.subrule++;return i=>t.parser.subrule(r,tT(t,n.rule.ref),e,i)}else if(Nr(n)&&Or(n.rule.ref)){const r=t.consume++,i=iy(t,n.rule.ref.name);return()=>t.parser.consume(r,i,e)}else if(hr(n)){const r=t.consume++,i=iy(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=zm(e.type.ref),i=r?.terminal;if(!i)throw new Error("Could not find name assignment for type: "+ja(e.type.ref));return Z0(t,e,i)}}function Wq(t,e){const n=t.consume++,r=t.tokens[e.value];if(!r)throw new Error("Could not find token for keyword: "+e.value);return()=>t.parser.consume(n,r,e)}function eT(t,e,n,r){const i=e&&Gr(e);if(!r)if(i){const s=t.or++;return o=>t.parser.alternatives(s,[{ALT:()=>n(o),GATE:()=>i(o)},{ALT:FR(),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:FR(),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 sa()}function tT(t,e){const n=Hq(t,e),r=t.parser.getRule(n);if(!r)throw new Error(`Rule "${n}" not found."`);return r}function Hq(t,e){if(Yt(e))return e.name;if(t.ruleNames.has(e))return t.ruleNames.get(e);{let n=e,r=n.$container,i=e.$type;for(;!Yt(r);)(fi(r)||Sm(r)||Cm(r))&&(i=r.elements.indexOf(n).toString()+":"+i),n=r,r=r.$container;return i=r.name+":"+i,t.ruleNames.set(e,i),i}}function iy(t,e){const n=t.tokens[e];if(!n)throw new Error(`Token "${e}" not found."`);return n}function Vq(t){const e=t.Grammar,n=t.parser.Lexer,r=new Nq(t);return Q0(e,r,n.definition),r.finalize(),r}function Kq(t){const e=Yq(t);return e.finalize(),e}function Yq(t){const e=t.Grammar,n=t.parser.Lexer,r=new xq(t);return Q0(e,r,n.definition)}class Xq{constructor(){this.diagnostics=[]}buildTokens(e,n){const r=et(Nm(e,!1)),i=this.buildTerminalTokens(r),s=this.buildKeywordTokens(r,i,n);return i.forEach(o=>{const a=o.PATTERN;typeof a=="object"&&a&&"test"in a&&Om(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(Or).filter(n=>!n.fragment).map(n=>this.buildTerminalToken(n)).toArray()}buildTerminalToken(e){const n=Ua(e),r=this.requiresCustomPattern(n)?this.regexPatternFunction(n):n,i={name:e.name,PATTERN:r};return typeof r=="function"&&(i.LINE_BREAKS=!0),e.hidden&&(i.GROUP=Om(n)?Rn.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(Yt).flatMap(i=>mr(i).filter(hr)).distinct(i=>i.value).toArray().sort((i,s)=>s.value.length-i.value.length).map(i=>this.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(Yx(e.value)):e.value}findLongerAlt(e,n){return n.reduce((r,i)=>{const s=i?.PATTERN;return s?.source&&Xx("^"+s.source+"$",e.value)&&r.push(i),r},[])}}class Jq{convert(e,n){let r=n.grammarSource;if($a(r)&&(r=Fm(r)),Nr(r)){const i=r.rule.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 Wr.convertInt(n);case"STRING":return Wr.convertString(n);case"ID":return Wr.convertID(n)}switch((i=RD(e))===null||i===void 0?void 0:i.toLowerCase()){case"number":return Wr.convertNumber(n);case"boolean":return Wr.convertBoolean(n);case"bigint":return Wr.convertBigint(n);case"date":return Wr.convertDate(n);default:return n}}}var Wr;(function(t){function e(u){let l="";for(let d=1;d<u.length-1;d++){const f=u.charAt(d);if(f==="\\"){const p=u.charAt(++d);l+=n(p)}else l+=f}return l}t.convertString=e;function n(u){switch(u){case"b":return"\b";case"f":return"\f";case"n":return`
|
|
117
|
+
`;case"r":return"\r";case"t":return" ";case"v":return"\v";case"0":return"\0";default:return u}}function r(u){return u.charAt(0)==="^"?u.substring(1):u}t.convertID=r;function i(u){return parseInt(u)}t.convertInt=i;function s(u){return BigInt(u)}t.convertBigint=s;function o(u){return new Date(u)}t.convertDate=o;function a(u){return Number(u)}t.convertNumber=a;function c(u){return u.toLowerCase()==="true"}t.convertBoolean=c})(Wr||(Wr={}));var Qq=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Lf(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var ls={},Mf={},nT;function ds(){if(nT)return Mf;nT=1,Object.defineProperty(Mf,"__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),Mf.default=e,Mf}var Gt={},rT;function dc(){if(rT)return Gt;rT=1,Object.defineProperty(Gt,"__esModule",{value:!0}),Gt.stringArray=Gt.array=Gt.func=Gt.error=Gt.number=Gt.string=Gt.boolean=void 0;function t(a){return a===!0||a===!1}Gt.boolean=t;function e(a){return typeof a=="string"||a instanceof String}Gt.string=e;function n(a){return typeof a=="number"||a instanceof Number}Gt.number=n;function r(a){return a instanceof Error}Gt.error=r;function i(a){return typeof a=="function"}Gt.func=i;function s(a){return Array.isArray(a)}Gt.array=s;function o(a){return s(a)&&a.every(c=>e(c))}return Gt.stringArray=o,Gt}var fs={},iT;function yo(){if(iT)return fs;iT=1,Object.defineProperty(fs,"__esModule",{value:!0}),fs.Emitter=fs.Event=void 0;const t=ds();var e;(function(i){const s={dispose(){}};i.None=function(){return s}})(e||(fs.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 c=0,u=this._callbacks.length;c<u;c++)if(this._callbacks[c]===s)if(this._contexts[c]===o){this._callbacks.splice(c,1),this._contexts.splice(c,1);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),c=this._contexts.slice(0);for(let u=0,l=a.length;u<l;u++)try{o.push(a[u].apply(c[u],s))}catch(d){(0,t.default)().console.error(d)}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(){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 c={dispose:()=>{this._callbacks&&(this._callbacks.remove(s,o),c.dispose=r._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(a)&&a.push(c),c}),this._event}fire(s){this._callbacks&&this._callbacks.invoke.call(this._callbacks,s)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}}return fs.Emitter=r,r._noop=function(){},fs}var sT;function Bf(){if(sT)return ls;sT=1,Object.defineProperty(ls,"__esModule",{value:!0}),ls.CancellationTokenSource=ls.CancellationToken=void 0;const t=ds(),e=dc(),n=yo();var r;(function(a){a.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:n.Event.None}),a.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:n.Event.None});function c(u){const l=u;return l&&(l===a.None||l===a.Cancelled||e.boolean(l.isCancellationRequested)&&!!l.onCancellationRequested)}a.is=c})(r||(ls.CancellationToken=r={}));const i=Object.freeze(function(a,c){const u=(0,t.default)().timer.setTimeout(a.bind(c),0);return{dispose(){u.dispose()}}});class s{constructor(){this._isCancelled=!1}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?i:(this._emitter||(this._emitter=new 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 rt=Bf();function Zq(){return new Promise(t=>{typeof setImmediate>"u"?setTimeout(t,0):setImmediate(t)})}let sy=0,e3=10;function t3(){return sy=performance.now(),new rt.CancellationTokenSource}const zf=Symbol("OperationCancelled");function qf(t){return t===zf}async function Nt(t){if(t===rt.CancellationToken.None)return;const e=performance.now();if(e-sy>=e3&&(sy=e,await Zq()),t.isCancellationRequested)throw zf}class oy{constructor(){this.promise=new Promise((e,n)=>{this.resolve=r=>(e(r),this),this.reject=r=>(n(r),this)})}}class gd{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(let r of e)if(gd.isIncremental(r)){const i=aT(r.range),s=this.offsetAt(i.start),o=this.offsetAt(i.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),c=Math.max(i.end.line,0);let u=this._lineOffsets;const l=oT(r.text,!1,s);if(c-a===l.length)for(let f=0,p=l.length;f<p;f++)u[f+a+1]=l[f];else l.length<1e4?u.splice(a+1,c-a,...l):this._lineOffsets=u=u.slice(0,a+1).concat(l,u.slice(c+1));const d=r.text.length-(o-s);if(d!==0)for(let f=a+1+l.length,p=u.length;f<p;f++)u[f]=u[f]+d}else if(gd.isFull(r))this._content=r.text,this._lineOffsets=void 0;else throw new Error("Unknown change event received");this._version=n}getLineOffsets(){return this._lineOffsets===void 0&&(this._lineOffsets=oT(this._content,!0)),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{line:0,character:e};for(;r<i;){let o=Math.floor((r+i)/2);n[o]>e?i=o:r=o+1}let s=r-1;return{line:s,character: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.max(Math.min(r+e.character,i),r)}get lineCount(){return this.getLineOffsets().length}static isIncremental(e){let n=e;return n!=null&&typeof n.text=="string"&&n.range!==void 0&&(n.rangeLength===void 0||typeof n.rangeLength=="number")}static isFull(e){let n=e;return n!=null&&typeof n.text=="string"&&n.range===void 0&&n.rangeLength===void 0}}var jf;(function(t){function e(i,s,o,a){return new gd(i,s,o,a)}t.create=e;function n(i,s,o){if(i instanceof gd)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){let o=i.getText(),a=ay(s.map(n3),(l,d)=>{let f=l.range.start.line-d.range.start.line;return f===0?l.range.start.character-d.range.start.character:f}),c=0;const u=[];for(const l of a){let d=i.offsetAt(l.range.start);if(d<c)throw new Error("Overlapping edit");d>c&&u.push(o.substring(c,d)),l.newText.length&&u.push(l.newText),c=i.offsetAt(l.range.end)}return u.push(o.substr(c)),u.join("")}t.applyEdits=r})(jf||(jf={}));function ay(t,e){if(t.length<=1)return t;const n=t.length/2|0,r=t.slice(0,n),i=t.slice(n);ay(r,e),ay(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++]=i[o++];for(;s<r.length;)t[a++]=r[s++];for(;o<i.length;)t[a++]=i[o++];return t}function oT(t,e,n=0){const r=e?[n]:[];for(let i=0;i<t.length;i++){let s=t.charCodeAt(i);(s===13||s===10)&&(s===13&&i+1<t.length&&t.charCodeAt(i+1)===10&&i++,r.push(n+i+1))}return r}function aT(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 n3(t){const e=aT(t.range);return e!==t.range?{newText:t.newText,range:e}:t}var cT;(()=>{var t={470:i=>{function s(c){if(typeof c!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(c))}function o(c,u){for(var l,d="",f=0,p=-1,m=0,w=0;w<=c.length;++w){if(w<c.length)l=c.charCodeAt(w);else{if(l===47)break;l=47}if(l===47){if(!(p===w-1||m===1))if(p!==w-1&&m===2){if(d.length<2||f!==2||d.charCodeAt(d.length-1)!==46||d.charCodeAt(d.length-2)!==46){if(d.length>2){var E=d.lastIndexOf("/");if(E!==d.length-1){E===-1?(d="",f=0):f=(d=d.slice(0,E)).length-1-d.lastIndexOf("/"),p=w,m=0;continue}}else if(d.length===2||d.length===1){d="",f=0,p=w,m=0;continue}}u&&(d.length>0?d+="/..":d="..",f=2)}else d.length>0?d+="/"+c.slice(p+1,w):d=c.slice(p+1,w),f=w-p-1;p=w,m=0}else l===46&&m!==-1?++m:m=-1}return d}var a={resolve:function(){for(var c,u="",l=!1,d=arguments.length-1;d>=-1&&!l;d--){var f;d>=0?f=arguments[d]:(c===void 0&&(c=process.cwd()),f=c),s(f),f.length!==0&&(u=f+"/"+u,l=f.charCodeAt(0)===47)}return u=o(u,!l),l?u.length>0?"/"+u:"/":u.length>0?u:"."},normalize:function(c){if(s(c),c.length===0)return".";var u=c.charCodeAt(0)===47,l=c.charCodeAt(c.length-1)===47;return(c=o(c,!u)).length!==0||u||(c="."),c.length>0&&l&&(c+="/"),u?"/"+c:c},isAbsolute:function(c){return s(c),c.length>0&&c.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var c,u=0;u<arguments.length;++u){var l=arguments[u];s(l),l.length>0&&(c===void 0?c=l:c+="/"+l)}return c===void 0?".":a.normalize(c)},relative:function(c,u){if(s(c),s(u),c===u||(c=a.resolve(c))===(u=a.resolve(u)))return"";for(var l=1;l<c.length&&c.charCodeAt(l)===47;++l);for(var d=c.length,f=d-l,p=1;p<u.length&&u.charCodeAt(p)===47;++p);for(var m=u.length-p,w=f<m?f:m,E=-1,y=0;y<=w;++y){if(y===w){if(m>w){if(u.charCodeAt(p+y)===47)return u.slice(p+y+1);if(y===0)return u.slice(p+y)}else f>w&&(c.charCodeAt(l+y)===47?E=y:y===0&&(E=0));break}var b=c.charCodeAt(l+y);if(b!==u.charCodeAt(p+y))break;b===47&&(E=y)}var R="";for(y=l+E+1;y<=d;++y)y!==d&&c.charCodeAt(y)!==47||(R.length===0?R+="..":R+="/..");return R.length>0?R+u.slice(p+E):(p+=E,u.charCodeAt(p)===47&&++p,u.slice(p))},_makeLong:function(c){return c},dirname:function(c){if(s(c),c.length===0)return".";for(var u=c.charCodeAt(0),l=u===47,d=-1,f=!0,p=c.length-1;p>=1;--p)if((u=c.charCodeAt(p))===47){if(!f){d=p;break}}else f=!1;return d===-1?l?"/":".":l&&d===1?"//":c.slice(0,d)},basename:function(c,u){if(u!==void 0&&typeof u!="string")throw new TypeError('"ext" argument must be a string');s(c);var l,d=0,f=-1,p=!0;if(u!==void 0&&u.length>0&&u.length<=c.length){if(u.length===c.length&&u===c)return"";var m=u.length-1,w=-1;for(l=c.length-1;l>=0;--l){var E=c.charCodeAt(l);if(E===47){if(!p){d=l+1;break}}else w===-1&&(p=!1,w=l+1),m>=0&&(E===u.charCodeAt(m)?--m==-1&&(f=l):(m=-1,f=w))}return d===f?f=w:f===-1&&(f=c.length),c.slice(d,f)}for(l=c.length-1;l>=0;--l)if(c.charCodeAt(l)===47){if(!p){d=l+1;break}}else f===-1&&(p=!1,f=l+1);return f===-1?"":c.slice(d,f)},extname:function(c){s(c);for(var u=-1,l=0,d=-1,f=!0,p=0,m=c.length-1;m>=0;--m){var w=c.charCodeAt(m);if(w!==47)d===-1&&(f=!1,d=m+1),w===46?u===-1?u=m:p!==1&&(p=1):u!==-1&&(p=-1);else if(!f){l=m+1;break}}return u===-1||d===-1||p===0||p===1&&u===d-1&&u===l+1?"":c.slice(u,d)},format:function(c){if(c===null||typeof c!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof c);return function(u,l){var d=l.dir||l.root,f=l.base||(l.name||"")+(l.ext||"");return d?d===l.root?d+f:d+"/"+f:f}(0,c)},parse:function(c){s(c);var u={root:"",dir:"",base:"",ext:"",name:""};if(c.length===0)return u;var l,d=c.charCodeAt(0),f=d===47;f?(u.root="/",l=1):l=0;for(var p=-1,m=0,w=-1,E=!0,y=c.length-1,b=0;y>=l;--y)if((d=c.charCodeAt(y))!==47)w===-1&&(E=!1,w=y+1),d===46?p===-1?p=y:b!==1&&(b=1):p!==-1&&(b=-1);else if(!E){m=y+1;break}return p===-1||w===-1||b===0||b===1&&p===w-1&&p===m+1?w!==-1&&(u.base=u.name=m===0&&f?c.slice(1,w):c.slice(m,w)):(m===0&&f?(u.name=c.slice(1,p),u.base=c.slice(1,w)):(u.name=c.slice(m,p),u.base=c.slice(m,w)),u.ext=c.slice(p,w)),m>0?u.dir=c.slice(0,m-1):f&&(u.dir="/"),u},sep:"/",delimiter:":",win32:null,posix:null};a.posix=a,i.exports=a}},e={};function n(i){var s=e[i];if(s!==void 0)return s.exports;var o=e[i]={exports:{}};return t[i](o,o.exports,n),o.exports}n.d=(i,s)=>{for(var o in s)n.o(s,o)&&!n.o(i,o)&&Object.defineProperty(i,o,{enumerable:!0,get:s[o]})},n.o=(i,s)=>Object.prototype.hasOwnProperty.call(i,s),n.r=i=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(i,"__esModule",{value:!0})};var r={};(()=>{let i;n.r(r),n.d(r,{URI:()=>f,Utils:()=>le}),typeof process=="object"?i=process.platform==="win32":typeof navigator=="object"&&(i=navigator.userAgent.indexOf("Windows")>=0);const s=/^\w[\w\d+.-]*$/,o=/^\//,a=/^\/\//;function c(N,S){if(!N.scheme&&S)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${N.authority}", path: "${N.path}", query: "${N.query}", fragment: "${N.fragment}"}`);if(N.scheme&&!s.test(N.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(N.path){if(N.authority){if(!o.test(N.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(N.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}const u="",l="/",d=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;class f{static isUri(S){return S instanceof f||!!S&&typeof S.authority=="string"&&typeof S.fragment=="string"&&typeof S.path=="string"&&typeof S.query=="string"&&typeof S.scheme=="string"&&typeof S.fsPath=="string"&&typeof S.with=="function"&&typeof S.toString=="function"}scheme;authority;path;query;fragment;constructor(S,T,O,W,U,K=!1){typeof S=="object"?(this.scheme=S.scheme||u,this.authority=S.authority||u,this.path=S.path||u,this.query=S.query||u,this.fragment=S.fragment||u):(this.scheme=function(be,ee){return be||ee?be:"file"}(S,K),this.authority=T||u,this.path=function(be,ee){switch(be){case"https":case"http":case"file":ee?ee[0]!==l&&(ee=l+ee):ee=l}return ee}(this.scheme,O||u),this.query=W||u,this.fragment=U||u,c(this,K))}get fsPath(){return b(this)}with(S){if(!S)return this;let{scheme:T,authority:O,path:W,query:U,fragment:K}=S;return T===void 0?T=this.scheme:T===null&&(T=u),O===void 0?O=this.authority:O===null&&(O=u),W===void 0?W=this.path:W===null&&(W=u),U===void 0?U=this.query:U===null&&(U=u),K===void 0?K=this.fragment:K===null&&(K=u),T===this.scheme&&O===this.authority&&W===this.path&&U===this.query&&K===this.fragment?this:new m(T,O,W,U,K)}static parse(S,T=!1){const O=d.exec(S);return O?new m(O[2]||u,q(O[4]||u),q(O[5]||u),q(O[7]||u),q(O[9]||u),T):new m(u,u,u,u,u)}static file(S){let T=u;if(i&&(S=S.replace(/\\/g,l)),S[0]===l&&S[1]===l){const O=S.indexOf(l,2);O===-1?(T=S.substring(2),S=l):(T=S.substring(2,O),S=S.substring(O)||l)}return new m("file",T,S,u,u)}static from(S){const T=new m(S.scheme,S.authority,S.path,S.query,S.fragment);return c(T,!0),T}toString(S=!1){return R(this,S)}toJSON(){return this}static revive(S){if(S){if(S instanceof f)return S;{const T=new m(S);return T._formatted=S.external,T._fsPath=S._sep===p?S.fsPath:null,T}}return S}}const p=i?1:void 0;class m extends f{_formatted=null;_fsPath=null;get fsPath(){return this._fsPath||(this._fsPath=b(this)),this._fsPath}toString(S=!1){return S?R(this,!0):(this._formatted||(this._formatted=R(this,!1)),this._formatted)}toJSON(){const S={$mid:1};return this._fsPath&&(S.fsPath=this._fsPath,S._sep=p),this._formatted&&(S.external=this._formatted),this.path&&(S.path=this.path),this.scheme&&(S.scheme=this.scheme),this.authority&&(S.authority=this.authority),this.query&&(S.query=this.query),this.fragment&&(S.fragment=this.fragment),S}}const w={58:"%3A",47:"%2F",63:"%3F",35:"%23",91:"%5B",93:"%5D",64:"%40",33:"%21",36:"%24",38:"%26",39:"%27",40:"%28",41:"%29",42:"%2A",43:"%2B",44:"%2C",59:"%3B",61:"%3D",32:"%20"};function E(N,S,T){let O,W=-1;for(let U=0;U<N.length;U++){const K=N.charCodeAt(U);if(K>=97&&K<=122||K>=65&&K<=90||K>=48&&K<=57||K===45||K===46||K===95||K===126||S&&K===47||T&&K===91||T&&K===93||T&&K===58)W!==-1&&(O+=encodeURIComponent(N.substring(W,U)),W=-1),O!==void 0&&(O+=N.charAt(U));else{O===void 0&&(O=N.substr(0,U));const be=w[K];be!==void 0?(W!==-1&&(O+=encodeURIComponent(N.substring(W,U)),W=-1),O+=be):W===-1&&(W=U)}}return W!==-1&&(O+=encodeURIComponent(N.substring(W))),O!==void 0?O:N}function y(N){let S;for(let T=0;T<N.length;T++){const O=N.charCodeAt(T);O===35||O===63?(S===void 0&&(S=N.substr(0,T)),S+=w[O]):S!==void 0&&(S+=N[T])}return S!==void 0?S:N}function b(N,S){let T;return T=N.authority&&N.path.length>1&&N.scheme==="file"?`//${N.authority}${N.path}`:N.path.charCodeAt(0)===47&&(N.path.charCodeAt(1)>=65&&N.path.charCodeAt(1)<=90||N.path.charCodeAt(1)>=97&&N.path.charCodeAt(1)<=122)&&N.path.charCodeAt(2)===58?N.path[1].toLowerCase()+N.path.substr(2):N.path,i&&(T=T.replace(/\//g,"\\")),T}function R(N,S){const T=S?y:E;let O="",{scheme:W,authority:U,path:K,query:be,fragment:ee}=N;if(W&&(O+=W,O+=":"),(U||W==="file")&&(O+=l,O+=l),U){let k=U.indexOf("@");if(k!==-1){const pe=U.substr(0,k);U=U.substr(k+1),k=pe.lastIndexOf(":"),k===-1?O+=T(pe,!1,!1):(O+=T(pe.substr(0,k),!1,!1),O+=":",O+=T(pe.substr(k+1),!1,!0)),O+="@"}U=U.toLowerCase(),k=U.lastIndexOf(":"),k===-1?O+=T(U,!1,!0):(O+=T(U.substr(0,k),!1,!0),O+=U.substr(k))}if(K){if(K.length>=3&&K.charCodeAt(0)===47&&K.charCodeAt(2)===58){const k=K.charCodeAt(1);k>=65&&k<=90&&(K=`/${String.fromCharCode(k+32)}:${K.substr(3)}`)}else if(K.length>=2&&K.charCodeAt(1)===58){const k=K.charCodeAt(0);k>=65&&k<=90&&(K=`${String.fromCharCode(k+32)}:${K.substr(2)}`)}O+=T(K,!0,!1)}return be&&(O+="?",O+=T(be,!1,!1)),ee&&(O+="#",O+=S?ee:E(ee,!1,!1)),O}function C(N){try{return decodeURIComponent(N)}catch{return N.length>3?N.substr(0,3)+C(N.substr(3)):N}}const A=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function q(N){return N.match(A)?N.replace(A,S=>C(S)):N}var G=n(470);const Q=G.posix||G,J="/";var le;(function(N){N.joinPath=function(S,...T){return S.with({path:Q.join(S.path,...T)})},N.resolvePath=function(S,...T){let O=S.path,W=!1;O[0]!==J&&(O=J+O,W=!0);let U=Q.resolve(O,...T);return W&&U[0]===J&&!S.authority&&(U=U.substring(1)),S.with({path:U})},N.dirname=function(S){if(S.path.length===0||S.path===J)return S;let T=Q.dirname(S.path);return T.length===1&&T.charCodeAt(0)===46&&(T=""),S.with({path:T})},N.basename=function(S){return Q.basename(S.path)},N.extname=function(S){return Q.extname(S.path)}})(le||(le={}))})(),cT=r})();const{URI:Wt,Utils:fc}=cT;var Rt;(function(t){t.basename=fc.basename,t.dirname=fc.dirname,t.extname=fc.extname,t.joinPath=fc.joinPath,t.resolvePath=fc.resolvePath;function e(i,s){return i?.toString()===s?.toString()}t.equals=e;function n(i,s){const o=typeof i=="string"?i:i.path,a=typeof s=="string"?s:s.path,c=o.split("/").filter(p=>p.length>0),u=a.split("/").filter(p=>p.length>0);let l=0;for(;l<c.length&&c[l]===u[l];l++);const d="../".repeat(c.length-l),f=u.slice(l).join("/");return d+f}t.relative=n;function r(i){return Wt.parse(i.toString()).toString()}t.normalize=r})(Rt||(Rt={}));var qe;(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"})(qe||(qe={}));class r3{constructor(e){this.serviceRegistry=e.ServiceRegistry,this.textDocuments=e.workspace.TextDocuments,this.fileSystemProvider=e.workspace.FileSystemProvider}async fromUri(e,n=rt.CancellationToken.None){const r=await this.fileSystemProvider.readFile(e);return this.createAsync(e,r,n)}fromTextDocument(e,n,r){return n=n??Wt.parse(e.uri),rt.CancellationToken.is(r)?this.createAsync(n,e,r):this.create(n,e,r)}fromString(e,n,r){return rt.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.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:qe.Parsed,references:[],textDocument:r};else{const o=this.createTextDocumentGetter(n,i);s={parseResult:e,uri:n,state:qe.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 c=this.createTextDocumentGetter(e.uri,a);Object.defineProperty(e,"textDocument",{get:c})}return s!==a&&(e.parseResult=await this.parseAsync(e.uri,a,n),e.parseResult.value.$document=e),e.state=qe.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=jf.create(e.toString(),r.getServices(e).LanguageMetaData.languageId,0,n??""))}}class i3{constructor(e){this.documentMap=new Map,this.langiumDocumentFactory=e.workspace.LangiumDocumentFactory,this.serviceRegistry=e.ServiceRegistry}get all(){return et(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){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=qe.Changed,r.precomputedScopes=void 0,r.diagnostics=void 0),r}deleteDocument(e){const n=e.toString(),r=this.documentMap.get(n);return r&&(r.state=qe.Changed,this.documentMap.delete(n)),r}}const cy=Symbol("ref_resolving");class s3{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=rt.CancellationToken.None){for(const r of Fr(e.parseResult.value))await Nt(n),Fd(r).forEach(i=>this.doLink(i,e))}doLink(e,n){var r;const i=e.reference;if(i._ref===void 0){i._ref=cy;try{const s=this.getCandidate(e);if(Ed(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.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(bt(this._ref))return this._ref;if(wx(this._nodeDescription)){const c=s.loadAstNode(this._nodeDescription);this._ref=c??s.createLinkingError({reference:o,container:e,property:n},this._nodeDescription)}else if(this._ref===void 0){this._ref=cy;const c=Nd(e).$document,u=s.getLinkedNode({reference:o,container:e,property:n});if(u.error&&c&&c.state<qe.ComputedScopes)return this._ref=void 0;this._ref=(a=u.node)!==null&&a!==void 0?a:u.error,this._nodeDescription=u.descr,c?.references.push(this)}else if(this._ref===cy)throw new Error(`Cyclic reference resolution detected: ${s.astNodeLocator.getAstNodePath(e)}/${n} (symbol '${i}')`);return bt(this._ref)?this._ref:void 0},get $nodeDescription(){return this._nodeDescription},get error(){return Ed(this._ref)?this._ref:void 0}};return o}getLinkedNode(e){var n;try{const r=this.getCandidate(e);if(Ed(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 '${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=Nd(e.container).$document;r&&r.state<qe.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 not resolve reference to ${i} named '${e.reference.$refText}'.`,targetDescription:n})}}function Uf(t){return typeof t.name=="string"}class uT{getName(e){if(Uf(e))return e.name}getNameNode(e){return vn(e.$cstNode,"name")}}class o3{constructor(e){this.nameProvider=e.references.NameProvider,this.index=e.shared.workspace.IndexManager,this.nodeLocator=e.workspace.AstNodeLocator}findDeclaration(e){if(e){const n=yD(e),r=e.astNode;if(n&&r){const i=r[n.feature];if(Mn(i))return i.ref;if(Array.isArray(i)){for(const s of i)if(Mn(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||Yb(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&&(i=i.filter(s=>Rt.equals(s.sourceUri,n.documentUri))),r.push(...i),et(r)}getReferenceToSelf(e){const n=this.nameProvider.getNameNode(e);if(n){const r=mt(e),i=this.nodeLocator.getAstNodePath(e);return{sourceUri:r.uri,sourcePath:i,targetUri:r.uri,targetPath:i,segment:ia(n),local:!0}}}}class Pn{constructor(e){if(this.map=new Map,e)for(const[n,r]of e)this.add(n,r)}get size(){return hm.sum(et(this.map.values()).map(e=>e.length))}clear(){this.map.clear()}delete(e,n){if(n===void 0)return this.map.delete(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.forEach(i=>e(i,r,this)))}[Symbol.iterator](){return this.entries().iterator()}entries(){return et(this.map.entries()).flatMap(([e,n])=>n.map(r=>[e,r]))}keys(){return et(this.map.keys())}values(){return et(this.map.values()).flat()}entriesGroupedByKey(){return et(this.map.entries())}}class lT{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.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 dT{constructor(e){this.nameProvider=e.references.NameProvider,this.descriptions=e.workspace.AstNodeDescriptionProvider}async computeExports(e,n=rt.CancellationToken.None){return this.computeExportsForNode(e.parseResult.value,e,void 0,n)}async computeExportsForNode(e,n,r=Ma,i=rt.CancellationToken.None){const s=[];this.exportNode(e,s,n);for(const o of r(e))await Nt(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=rt.CancellationToken.None){const r=e.parseResult.value,i=new Pn;for(const s of mr(r))await Nt(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,n))}}}class ps{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 fT{constructor(e,n,r){var i;this.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=et(this.elements.values());return this.outerScope&&(e=e.concat(this.outerScope.getAllElements())),e}}const Gf={getElement(){},getAllElements(){return Js}};class pT{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 a3 extends pT{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,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 hT extends pT{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();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 c3 extends hT{constructor(e,n){super(r=>r.toString()),n?(this.toDispose.push(e.workspace.DocumentBuilder.onDocumentPhase(n,r=>{this.clear(r.uri.toString())})),this.toDispose.push(e.workspace.DocumentBuilder.onUpdate((r,i)=>{for(const s of i)this.clear(s)}))):this.toDispose.push(e.workspace.DocumentBuilder.onUpdate((r,i)=>{const s=r.concat(i);for(const o of s)this.clear(o)}))}}class mT extends a3{constructor(e,n){super(),n?(this.toDispose.push(e.workspace.DocumentBuilder.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 gT{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 mT(e.shared)}getScope(e){const n=[],r=this.reflection.getReferenceType(e),i=mt(e.container).precomputedScopes;if(i){let o=e.container;do{const a=i.get(o);a.length>0&&n.push(et(a).filter(c=>this.reflection.isSubtype(c.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 ps(et(e),n,r)}createScopeForNodes(e,n,r){const i=et(e).map(s=>{const o=this.nameProvider.getName(s);if(o)return this.descriptions.createDescription(s,o)}).nonNullable();return new ps(i,n,r)}getGlobalScope(e,n){return this.globalScopeCache.get(e,()=>new fT(this.indexManager.allElements(e)))}}function u3(t){return typeof t.$comment=="string"}function yT(t){return typeof t=="object"&&!!t&&("$ref"in t||"$error"in t)}class l3{constructor(e){this.ignoreProperties=new Set(["$container","$containerProperty","$containerIndex","$document","$cstNode"]),this.langiumDocuments=e.shared.workspace.LangiumDocuments,this.astNodeLocator=e.workspace.AstNodeLocator,this.nameProvider=e.references.NameProvider,this.commentProvider=e.documentation.CommentProvider}serialize(e,n){const r=n??{},i=n?.replacer,s=(a,c)=>this.replacer(a,c,r),o=i?(a,c)=>i(a,c,s):s;try{return this.currentDocument=mt(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 c,u,l,d;if(!this.ignoreProperties.has(e))if(Mn(n)){const f=n.ref,p=r?n.$refText:void 0;if(f){const m=mt(f);let w="";this.currentDocument&&this.currentDocument!==m&&(a?w=a(m.uri,n):w=m.uri.toString());const E=this.astNodeLocator.getAstNodePath(f);return{$ref:`${w}#${E}`,$refText:p}}else return{$error:(u=(c=n.error)===null||c===void 0?void 0:c.message)!==null&&u!==void 0?u:"Could not resolve reference",$refText:p}}else if(bt(n)){let f;if(s&&(f=this.addAstNodeRegionWithAssignmentsTo(Object.assign({},n)),(!e||n.$document)&&f?.$textRegion&&(f.$textRegion.documentURI=(l=this.currentDocument)===null||l===void 0?void 0:l.uri.toString())),i&&!e&&(f??(f=Object.assign({},n)),f.$sourceText=(d=n.$cstNode)===null||d===void 0?void 0:d.text),o){f??(f=Object.assign({},n));const p=this.commentProvider.getComment(n);p&&(f.$comment=p.replace(/\r/g,""))}return f??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("$")).forEach(s=>{const o=to(e.$cstNode,s).map(n);o.length!==0&&(i[s]=o)}),e}}linkNode(e,n,r,i,s,o){for(const[c,u]of Object.entries(e))if(Array.isArray(u))for(let l=0;l<u.length;l++){const d=u[l];yT(d)?u[l]=this.reviveReference(e,c,n,d,r):bt(d)&&this.linkNode(d,n,r,e,c,l)}else yT(u)?e[c]=this.reviveReference(e,c,n,u,r):bt(u)&&this.linkNode(u,n,r,e,c);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 c=this.getRefNode(r,i.$ref,s.uriConverter);if(bt(c))return o||(o=this.nameProvider.getName(c)),{$refText:o??"",ref:c};a=c}if(a){const c={$refText:o??""};return c.error={container:e,property:n,message:a,reference:c},c}else return}getRefNode(e,n,r){try{const i=n.indexOf("#");if(i===0){const c=this.astNodeLocator.getAstNode(e,n.substring(1));return c||"Could not resolve path: "+n}if(i<0){const c=r?r(n):Wt.parse(n),u=this.langiumDocuments.getDocument(c);return u?u.parseResult.value:"Could not find document for URI: "+n}const s=r?r(n.substring(0,i)):Wt.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 d3{get map(){return this.fileExtensionMap}constructor(e){this.languageIdMap=new Map,this.fileExtensionMap=new Map,this.textDocuments=e?.workspace.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 registry 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=Rt.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){try{return this.getServices(e),!0}catch{return!1}}get all(){return Array.from(this.languageIdMap.values())}}function pc(t){return{code:t}}var Wf;(function(t){t.all=["fast","slow","built-in"]})(Wf||(Wf={}));class f3{constructor(e){this.entries=new Pn,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(e)){const o=s;if(Array.isArray(o))for(const a of o){const c={check:this.wrapValidationException(a,n),category:r};this.addEntry(i,c)}else if(typeof o=="function"){const a={check:this.wrapValidationException(o,n),category:r};this.addEntry(i,a)}else sa()}}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(qf(s))throw s;console.error(`${n}:`,s),s instanceof 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=et(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,"An 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 p3{constructor(e){this.validationRegistry=e.validation.ValidationRegistry,this.metadata=e.LanguageMetaData}async validateDocument(e,n={},r=rt.CancellationToken.None){const i=e.parseResult,s=[];if(await Nt(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)===tr.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)===tr.ParsingError}))||(this.processLinkingErrors(e,s,n),n.stopAfterLinkingErrors&&s.some(o=>{var a;return((a=o.data)===null||a===void 0?void 0:a.code)===tr.LinkingError}))))return s;try{s.push(...await this.validateAst(i.value,n,r))}catch(o){if(qf(o))throw o;console.error("An error occurred during validation:",o)}return await Nt(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 c of a){const u=(o=c.severity)!==null&&o!==void 0?o:"error",l={severity:uy(u),range:{start:{line:c.line-1,character:c.column-1},end:{line:c.line-1,character:c.column+c.length-1}},message:c.message,data:m3(u),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=Td(i.token);if(s){const o={severity:uy("error"),range:s,message:i.message,data:pc(tr.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:tr.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=rt.CancellationToken.None){const i=[],s=(o,a,c)=>{i.push(this.toDiagnostic(o,a,c))};return await this.validateAstBefore(e,n,s,r),await this.validateAstNodes(e,n,s,r),await this.validateAstAfter(e,n,s,r),i}async validateAstBefore(e,n,r,i=rt.CancellationToken.None){var s;const o=this.validationRegistry.checksBefore;for(const a of o)await Nt(i),await a(e,r,(s=n.categories)!==null&&s!==void 0?s:[],i)}async validateAstNodes(e,n,r,i=rt.CancellationToken.None){await Promise.all(Fr(e).map(async s=>{await Nt(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=rt.CancellationToken.None){var s;const o=this.validationRegistry.checksAfter;for(const a of o)await Nt(i),await a(e,r,(s=n.categories)!==null&&s!==void 0?s:[],i)}toDiagnostic(e,n,r){return{message:n,range:h3(r),severity:uy(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 h3(t){if(t.range)return t.range;let e;return typeof t.property=="string"?e=vn(t.node.$cstNode,t.property,t.index):typeof t.keyword=="string"&&(e=qa(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 uy(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 m3(t){switch(t){case"error":return pc(tr.LexingError);case"warning":return pc(tr.LexingWarning);case"info":return pc(tr.LexingInfo);case"hint":return pc(tr.LexingHint);default:throw new Error("Invalid diagnostic severity: "+t)}}var tr;(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"})(tr||(tr={}));class g3{constructor(e){this.astNodeLocator=e.workspace.AstNodeLocator,this.nameProvider=e.references.NameProvider}createDescription(e,n,r){const i=r??mt(e);n??(n=this.nameProvider.getName(e));const s=this.astNodeLocator.getAstNodePath(e);if(!n)throw new Error(`Node at path ${s} has no name.`);let o;const a=()=>{var c;return o??(o=ia((c=this.nameProvider.getNameNode(e))!==null&&c!==void 0?c:e.$cstNode))};return{node:e,name:n,get nameSegment(){return a()},selectionSegment:ia(e.$cstNode),type:e.$type,documentUri:i.uri,path:s}}}class y3{constructor(e){this.nodeLocator=e.workspace.AstNodeLocator}async createDescriptions(e,n=rt.CancellationToken.None){const r=[],i=e.parseResult.value;for(const s of Fr(i))await Nt(n),Fd(s).filter(o=>!Ed(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=mt(e.container).uri;return{sourceUri:i,sourcePath:this.nodeLocator.getAstNodePath(e.container),targetUri:n.documentUri,targetPath:n.path,segment:ia(r),local:Rt.equals(n.documentUri,i)}}}class v3{constructor(){this.segmentSeparator="/",this.indexSeparator="@"}getAstNodePath(e){if(e.$container){const n=this.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),c=parseInt(s.substring(o+1)),u=i[a];return u?.[c]}return i[s]},e)}}var w3=yo();class b3{constructor(e){this._ready=new oy,this.settings={},this.workspaceConfig=!1,this.onConfigurationSectionUpdateEmitter=new w3.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.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){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 hs;(function(t){function e(n){return{dispose:async()=>await n()}}t.create=e})(hs||(hs={}));class D3{constructor(e){this.updateBuildOptions={validation:{categories:["built-in","fast"]}},this.updateListeners=[],this.buildPhaseListeners=new Pn,this.documentPhaseListeners=new Pn,this.buildState=new Map,this.documentBuildWaiters=new Map,this.currentState=qe.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=rt.CancellationToken.None){var i,s;for(const o of e){const a=o.uri.toString();if(o.state===qe.Validated){if(typeof n.validation=="boolean"&&n.validation)o.state=qe.IndexedReferences,o.diagnostics=void 0,this.buildState.delete(a);else if(typeof n.validation=="object"){const c=this.buildState.get(a),u=(i=c?.result)===null||i===void 0?void 0:i.validationChecks;if(u){const d=((s=n.validation.categories)!==null&&s!==void 0?s:Wf.all).filter(f=>!u.includes(f));d.length>0&&(this.buildState.set(a,{completed:!1,options:{validation:Object.assign(Object.assign({},n.validation),{categories:d})},result:c.result}),o.state=qe.IndexedReferences)}}}else this.buildState.delete(a)}this.currentState=qe.Changed,await this.emitUpdate(e.map(o=>o.uri),[]),await this.buildDocuments(e,n,r)}async update(e,n,r=rt.CancellationToken.None){this.currentState=qe.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 c=this.langiumDocumentFactory.fromModel({$type:"INVALID"},o);c.state=qe.Changed,this.langiumDocuments.addDocument(c)}this.buildState.delete(o.toString())}const i=et(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,qe.ComputedScopes),o.diagnostics=void 0}),await this.emitUpdate(e,n),await Nt(r);const s=this.sortDocuments(this.langiumDocuments.all.filter(o=>{var a;return o.state<qe.Linked||!(!((a=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){return e.references.some(r=>r.error!==void 0)?!0:this.indexManager.isAffected(e,n)}onUpdate(e){return this.updateListeners.push(e),hs.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,qe.Parsed,r,s=>this.langiumDocumentFactory.update(s,r)),await this.runCancelable(e,qe.IndexedContent,r,s=>this.indexManager.updateContent(s,r)),await this.runCancelable(e,qe.ComputedScopes,r,async s=>{const o=this.serviceRegistry.getServices(s.uri).references.ScopeComputation;s.precomputedScopes=await o.computeLocalScopes(s,r)}),await this.runCancelable(e,qe.Linked,r,s=>this.serviceRegistry.getServices(s.uri).references.Linker.link(s,r)),await this.runCancelable(e,qe.IndexedReferences,r,s=>this.indexManager.updateReferences(s,r));const i=e.filter(s=>this.shouldValidate(s));await this.runCancelable(i,qe.Validated,r,s=>this.validate(s,r));for(const s of e){const o=this.buildState.get(s.uri.toString());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 Nt(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),hs.create(()=>{this.buildPhaseListeners.delete(e,n)})}onDocumentPhase(e,n){return this.documentPhaseListeners.add(e,n),hs.create(()=>{this.documentPhaseListeners.delete(e,n)})}waitUntil(e,n,r){let i;if(n&&"path"in n?i=n:r=n,r??(r=rt.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(zf):new Promise((s,o)=>{const a=this.onBuildPhase(e,()=>{if(a.dispose(),c.dispose(),i){const u=this.langiumDocuments.getDocument(i);s(u?.uri)}else s(void 0)}),c=r.onCancellationRequested(()=>{a.dispose(),c.dispose(),o(zf)})})}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(!qf(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 Nt(r),await o(e,r)}shouldValidate(e){return!!this.getBuildOptions(e).validation}async validate(e,n){var r,i;const s=this.serviceRegistry.getServices(e.uri).validation.DocumentValidator,o=this.getBuildOptions(e).validation,a=typeof o=="object"?o:void 0,c=await s.validateDocument(e,a,n);e.diagnostics?e.diagnostics.push(...c):e.diagnostics=c;const u=this.buildState.get(e.uri.toString());if(u){(r=u.result)!==null&&r!==void 0||(u.result={});const l=(i=a?.categories)!==null&&i!==void 0?i:Wf.all;u.result.validationChecks?u.result.validationChecks.push(...l):u.result.validationChecks=[...l]}}getBuildOptions(e){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 E3{constructor(e){this.symbolIndex=new Map,this.symbolByTypeIndex=new hT,this.referenceIndex=new Map,this.documents=e.workspace.LangiumDocuments,this.serviceRegistry=e.ServiceRegistry,this.astReflection=e.AstReflection}findAllReferences(e,n){const r=mt(e).uri,i=[];return this.referenceIndex.forEach(s=>{s.forEach(o=>{Rt.equals(o.targetUri,r)&&o.targetPath===n&&i.push(o)})}),et(i)}allElements(e,n){let r=et(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.delete(n)}async updateContent(e,n=rt.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=rt.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(e.uri.toString());return r?r.some(i=>!i.local&&n.has(i.targetUri.toString())):!1}}class vT{constructor(e){this.initialBuildOptions={},this._ready=new oy,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=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=rt.CancellationToken.None){const r=await this.performStartup(e);await Nt(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(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 Wt.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(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=Rt.basename(n.uri);if(i.startsWith("."))return!1;if(n.isDirectory)return i!=="node_modules"&&i!=="out";if(n.isFile){const s=Rt.extname(n.uri);return r.includes(s)}return!1}}class R3{buildUnexpectedCharactersMessage(e,n,r,i,s){return bg.buildUnexpectedCharactersMessage(e,n,r,i,s)}buildUnableToPopLexerModeMessage(e){return bg.buildUnableToPopLexerModeMessage(e)}}const T3={mode:"full"};class $3{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=bT(n)?Object.values(n):n,i=e.LanguageMetaData.mode==="production";this.chevrotainLexer=new Rn(r,{positionTracking:"full",skipValidations:i,errorMessageProvider:this.errorMessageProvider})}get definition(){return this.tokenTypes}tokenize(e,n=T3){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(bT(e))return e;const n=wT(e)?Object.values(e.modes).flat():e,r={};return n.forEach(i=>r[i.name]=i),r}}function S3(t){return Array.isArray(t)&&(t.length===0||"name"in t[0])}function wT(t){return t&&"modes"in t&&"defaultMode"in t}function bT(t){return!S3(t)&&!wT(t)}function C3(t,e,n){let r,i;typeof t=="string"?(i=e,r=n):(i=t.range.start,r=e),i||(i=Xe.create(0,0));const s=DT(t),o=dy(r),a=_3({lines:s,position:i,options:o});return N3({index:0,tokens:a,position:i})}function k3(t,e){const n=dy(e),r=DT(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 DT(t){let e="";return typeof t=="string"?e=t:e=t.text,e.split(pD)}const ET=/\s*(@([\p{L}][\p{L}\p{N}]*)?)/uy,A3=/\{(@[\p{L}][\p{L}\p{N}]*)(\s*)([^\r\n}]+)?\}/gu;function _3(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 c=a===0,u=a===t.lines.length-1;let l=t.lines[a],d=0;if(c&&t.options.start){const p=(e=t.options.start)===null||e===void 0?void 0:e.exec(l);p&&(d=p.index+p[0].length)}else{const p=(n=t.options.line)===null||n===void 0?void 0:n.exec(l);p&&(d=p.index+p[0].length)}if(u){const p=(r=t.options.end)===null||r===void 0?void 0:r.exec(l);p&&(l=l.substring(0,p.index))}if(l=l.substring(0,O3(l)),ly(l,d)>=l.length){if(i.length>0){const p=Xe.create(s,o);i.push({type:"break",content:"",range:Me.create(p,p)})}}else{ET.lastIndex=d;const p=ET.exec(l);if(p){const m=p[0],w=p[1],E=Xe.create(s,o+d),y=Xe.create(s,o+d+m.length);i.push({type:"tag",content:w,range:Me.create(E,y)}),d+=m.length,d=ly(l,d)}if(d<l.length){const m=l.substring(d),w=Array.from(m.matchAll(A3));i.push(...P3(w,m,s,o+d))}}s++,o=0}return i.length>0&&i[i.length-1].type==="break"?i.slice(0,-1):i}function P3(t,e,n,r){const i=[];if(t.length===0){const s=Xe.create(n,r),o=Xe.create(n,r+e.length);i.push({type:"text",content:e,range:Me.create(s,o)})}else{let s=0;for(const a of t){const c=a.index,u=e.substring(s,c);u.length>0&&i.push({type:"text",content:e.substring(s,c),range:Me.create(Xe.create(n,s+r),Xe.create(n,c+r))});let l=u.length+1;const d=a[1];if(i.push({type:"inline-tag",content:d,range:Me.create(Xe.create(n,s+l+r),Xe.create(n,s+l+d.length+r))}),l+=d.length,a.length===4){l+=a[2].length;const f=a[3];i.push({type:"text",content:f,range:Me.create(Xe.create(n,s+l+r),Xe.create(n,s+l+f.length+r))})}else i.push({type:"text",content:"",range:Me.create(Xe.create(n,s+l+r),Xe.create(n,s+l+r))});s=c+a[0].length}const o=e.substring(s);o.length>0&&i.push({type:"text",content:o,range:Me.create(Xe.create(n,s+r),Xe.create(n,s+r+o.length))})}return i}const I3=/\S/,x3=/\s*$/;function ly(t,e){const n=t.substring(e).match(I3);return n?e+n.index:t.length}function O3(t){const e=t.match(x3);if(e&&typeof e.index=="number")return e.index}function N3(t){var e,n,r,i;const s=Xe.create(t.position.line,t.position.character);if(t.tokens.length===0)return new ST([],Me.create(s,s));const o=[];for(;t.index<t.tokens.length;){const u=F3(t,o[o.length-1]);u&&o.push(u)}const a=(n=(e=o[0])===null||e===void 0?void 0:e.range.start)!==null&&n!==void 0?n:s,c=(i=(r=o[o.length-1])===null||r===void 0?void 0:r.range.end)!==null&&i!==void 0?i:s;return new ST(o,Me.create(a,c))}function F3(t,e){const n=t.tokens[t.index];if(n.type==="tag")return TT(t,!1);if(n.type==="text"||n.type==="inline-tag")return RT(t);L3(n,e),t.index++}function L3(t,e){if(e){const n=new CT("",t.range);"inlines"in e?e.inlines.push(n):e.content.inlines.push(n)}}function RT(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(M3(t)),r=e,e=t.tokens[t.index];return new hy(i,Me.create(n.range.start,r.range.end))}function M3(t){return t.tokens[t.index].type==="inline-tag"?TT(t,!0):$T(t)}function TT(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=$T(t);return new py(r,new hy([s],s.range),e,Me.create(n.range.start,s.range.end))}else{const s=RT(t);return new py(r,s,e,Me.create(n.range.start,s.range.end))}else{const s=n.range;return new py(r,new hy([],s),e,s)}}function $T(t){const e=t.tokens[t.index++];return new CT(e.content,e.range)}function dy(t){if(!t)return dy({start:"/**",end:"*/",line:"*"});const{start:e,end:n,line:r}=t;return{start:fy(e,!0),end:fy(n,!1),line:fy(r,!0)}}function fy(t,e){if(typeof t=="string"||typeof t=="object"){const n=typeof t=="string"?qd(t):t.source;return e?new RegExp(`^\\s*${n}`):new RegExp(`\\s*${n}\\s*$`)}else return t}class ST{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.elements)if(e.length===0)e=n.toString();else{const r=n.toString();e+=kT(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+=kT(n)+i}return n.trim()}}class py{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}
|
|
118
|
+
${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=B3(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.content.inlines.length>1&&(i=`${i}
|
|
119
|
+
${n}`),this.inline?`{${i}}`:i}}function B3(t,e,n){var r,i;if(t==="linkplain"||t==="linkcode"||t==="link"){const s=e.indexOf(" ");let o=e;if(s>0){const c=ly(e,s);o=e.substring(c),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:z3(e,o)}}function z3(t,e){try{return Wt.parse(t,!0),`[${e}](${t})`}catch{return t}}class hy{constructor(e,n){this.inlines=e,this.range=n}toString(){let e="";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+=`
|
|
120
|
+
`)}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+=`
|
|
121
|
+
`)}return n}}class CT{constructor(e,n){this.text=e,this.range=n}toString(){return this.text}toMarkdown(){return this.text}}function kT(t){return t.endsWith(`
|
|
122
|
+
`)?`
|
|
123
|
+
`:`
|
|
124
|
+
|
|
125
|
+
`}class q3{constructor(e){this.indexManager=e.shared.workspace.IndexManager,this.commentProvider=e.documentation.CommentProvider}getDocumentation(e){const n=this.commentProvider.getComment(e);if(n&&k3(n))return C3(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.nameSegment.range.start.line+1,a=s.nameSegment.range.start.character+1,c=s.documentUri.with({fragment:`L${o},${a}`});return`[${r}](${c.toString()})`}else return}documentationTagRenderer(e,n){}findNameInPrecomputedScopes(e,n){const i=mt(e).precomputedScopes;if(!i)return;let s=e;do{const a=i.get(s).find(c=>c.name===n);if(a)return a;s=s.$container}while(s)}findNameInGlobalScope(e,n){return this.indexManager.allElements().find(i=>i.name===n)}}class j3{constructor(e){this.grammarConfig=()=>e.parser.GrammarConfig}getComment(e){var n;return u3(e)?e.$comment:(n=$d(e.$cstNode,this.grammarConfig().multilineCommentRules))===null||n===void 0?void 0:n.text}}class U3{constructor(e){this.syncParser=e.parser.LangiumParser}parse(e,n){return Promise.resolve(this.syncParser.parse(e))}}class G3{constructor(){this.previousTokenSource=new rt.CancellationTokenSource,this.writeQueue=[],this.readQueue=[],this.done=!0}write(e){this.cancelWrite();const n=t3();return this.previousTokenSource=n,this.enqueue(this.writeQueue,e,n.token)}read(e){return this.enqueue(this.readQueue,e)}enqueue(e,n,r=rt.CancellationToken.None){const i=new oy,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})=>{try{const s=await Promise.resolve().then(()=>n(i));r.resolve(s)}catch(s){qf(s)?r.resolve(void 0):r.reject(s)}})),this.done=!0,this.performNextOperation()}cancelWrite(){this.previousTokenSource.cancel()}}class W3{constructor(e){this.grammarElementIdMap=new lT,this.tokenTypeIdMap=new lT,this.grammar=e.Grammar,this.lexer=e.parser.Lexer,this.linker=e.references.Linker}dehydrate(e){return{lexerErrors:e.lexerErrors,lexerReport:e.lexerReport?this.dehydrateLexerReport(e.lexerReport):void 0,parserErrors:e.parserErrors.map(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 Fr(e))n.set(i,{});if(e.$cstNode)for(const i of ra(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.$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)bt(a)?o.push(this.dehydrateAstNode(a,n)):Mn(a)?o.push(this.dehydrateReference(a,n)):o.push(a)}else bt(s)?r[i]=this.dehydrateAstNode(s,n):Mn(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)),r}dehydrateCstNode(e,n){const r=n.cstNodes.get(e);return Vb(e)?r.fullText=e.fullText:r.grammarSource=this.getGrammarElementId(e.grammarSource),r.hidden=e.hidden,r.astNode=n.astNodes.get(e.astNode),xr(e)?r.content=e.content.map(i=>this.dehydrateCstNode(i,n)):Qi(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(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 Fr(e))n.set(s,{});let i;if(e.$cstNode)for(const s of ra(e.$cstNode)){let o;"fullText"in s?(o=new V0(s.fullText),i=o):"content"in s?o=new ty:"tokenType"in s&&(o=this.hydrateCstLeafNode(s)),o&&(r.set(s,o),o.root=i)}return{astNodes:n,cstNodes:r}}hydrateAstNode(e,n){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)bt(a)?o.push(this.setParent(this.hydrateAstNode(a,n),r)):Mn(a)?o.push(this.hydrateReference(a,r,i,n)):o.push(a)}else bt(s)?r[i]=this.setParent(this.hydrateAstNode(s,n),r):Mn(s)?r[i]=this.hydrateReference(s,r,i,n):s!==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),xr(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),r=e.offset,i=e.length,s=e.startLine,o=e.startColumn,a=e.endLine,c=e.endColumn,u=e.hidden;return new ey(r,i,{start:{line:s,character:o},end:{line:a,character:c}},n,u)}getTokenType(e){return this.lexer.definition[e]}getGrammarElementId(e){return this.grammarElementIdMap.size===0&&this.createGrammarElementIdMap(),this.grammarElementIdMap.get(e)}getGrammarElement(e){this.grammarElementIdMap.size===0&&this.createGrammarElementIdMap();const n=this.grammarElementIdMap.getKey(e);if(n)return n;throw new Error("Invalid grammar element id: "+e)}createGrammarElementIdMap(){let e=0;for(const n of Fr(this.grammar))Dm(n)&&this.grammarElementIdMap.set(n,e++)}}function AT(t){return{documentation:{CommentProvider:e=>new j3(e),DocumentationProvider:e=>new q3(e)},parser:{AsyncParser:e=>new U3(e),GrammarConfig:e=>oO(e),LangiumParser:e=>Kq(e),CompletionParser:e=>Vq(e),ValueConverter:()=>new Jq,TokenBuilder:()=>new Xq,Lexer:e=>new $3(e),ParserErrorMessageProvider:()=>new J0,LexerErrorMessageProvider:()=>new R3},workspace:{AstNodeLocator:()=>new v3,AstNodeDescriptionProvider:e=>new g3(e),ReferenceDescriptionProvider:e=>new y3(e)},references:{Linker:e=>new s3(e),NameProvider:()=>new uT,ScopeProvider:e=>new gT(e),ScopeComputation:e=>new dT(e),References:e=>new o3(e)},serializer:{Hydrator:e=>new W3(e),JsonSerializer:e=>new l3(e)},validation:{DocumentValidator:e=>new p3(e),ValidationRegistry:e=>new f3(e)},shared:()=>t.shared}}function _T(t){return{ServiceRegistry:e=>new d3(e),workspace:{LangiumDocuments:e=>new i3(e),LangiumDocumentFactory:e=>new r3(e),DocumentBuilder:e=>new D3(e),IndexManager:e=>new E3(e),WorkspaceManager:e=>new vT(e),FileSystemProvider:e=>t.fileSystemProvider(e),WorkspaceLock:()=>new G3,ConfigurationProvider:e=>new b3(e)}}}var Hf;(function(t){t.merge=(e,n)=>Kf(Kf({},e),n)})(Hf||(Hf={}));function Vf(t,e,n,r,i,s,o,a,c){const u=[t,e,n,r,i,s,o,a,c].reduce(Kf,{});return IT(u)}const PT=Symbol("isProxy");function my(t){if(t&&t[PT])for(const e of Object.values(t))my(e);return t}function IT(t,e){const n=new Proxy({},{deleteProperty:()=>!1,set:()=>{throw new Error("Cannot set property on injected service container")},get:(r,i)=>i===PT?!0:OT(r,i,t,e||n),getOwnPropertyDescriptor:(r,i)=>(OT(r,i,t,e||n),Object.getOwnPropertyDescriptor(r,i)),has:(r,i)=>i in t,ownKeys:()=>[...Object.getOwnPropertyNames(t)]});return n}const xT=Symbol();function OT(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]===xT)throw new Error('Cycle detected. Please make "'+String(e)+'" lazy. Visit https://langium.org/docs/reference/configuration-services/#resolving-cyclic-dependencies');return t[e]}else if(e in n){const i=n[e];t[e]=xT;try{t[e]=typeof i=="function"?i(r):IT(i,r)}catch(s){throw t[e]=s instanceof Error?s:void 0,s}return t[e]}else return}function Kf(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]=Kf(i,r):t[n]=r}}return t}class H3{readFile(){throw new Error("No file system is available.")}async readDirectory(){return[]}}const NT={fileSystemProvider:()=>new H3},V3={Grammar:()=>{},LanguageMetaData:()=>({caseInsensitive:!1,fileExtensions:[".langium"],languageId:"langium"})},K3={AstReflection:()=>new cD};function Y3(){const t=Vf(_T(NT),K3),e=Vf(AT({shared:t}),V3);return t.ServiceRegistry.register(e),e}function X3(t){var e;const n=Y3(),r=n.serializer.JsonSerializer.deserialize(t);return n.shared.workspace.LangiumDocumentFactory.fromModel(r,Wt.parse(`memory://${(e=r.name)!==null&&e!==void 0?e:"grammar"}.langium`)),r}var J3={done:!0,hasNext:!1},hc={done:!1,hasNext:!1},Q3=()=>J3,Z3=t=>({hasNext:!0,next:t,done:!1});function Ye(t,...e){let n=t,r=e.map(s=>"lazy"in s?e8(s):void 0),i=0;for(;i<e.length;){if(r[i]===void 0||!t8(n)){let c=e[i];n=c(n),i+=1;continue}let s=[];for(let c=i;c<e.length;c++){let u=r[c];if(u===void 0||(s.push(u),u.isSingle))break}let o=[];for(let c of n)if(FT(c,o,s))break;let{isSingle:a}=s.at(-1);n=a?o[0]:o,i+=s.length}return n}function FT(t,e,n){if(n.length===0)return e.push(t),!1;let r=t,i=hc,s=!1;for(let[o,a]of n.entries()){let{index:c,items:u}=a;if(u.push(r),i=a(r,c,u),a.index+=1,i.hasNext){if(i.hasMany??!1){for(let l of i.next)if(FT(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 e8(t){let{lazy:e,lazyArgs:n}=t,r=e(...n);return Object.assign(r,{isSingle:e.single??!1,index:0,items:[]})}function t8(t){return typeof t=="string"||typeof t=="object"&&t!==null&&Symbol.iterator in t}function LT(t,e){let n=e.length-t.length;if(n===1){let[r,...i]=e;return Ye(r,{lazy:t,lazyArgs:i})}if(n===0){let r={lazy:t,lazyArgs:e};return Object.assign(i=>Ye(i,r),r)}throw new Error("Wrong number of arguments")}function n8(t,e,n){let r=i=>t(i,...e);return n===void 0?r:Object.assign(r,{lazy:n,lazyArgs:e})}function it(t,e,n){let r=t.length-e.length;if(r===0)return t(...e);if(r===1)return n8(t,e,n);throw new Error("Wrong number of arguments")}function mc(...t){return it(Object.values,t)}function gy(...t){return LT(r8,t)}function r8(){let t=new Set;return e=>t.has(e)?hc:(t.add(e),{done:!1,hasNext:!0,next:e})}function i8(...t){return it(s8,t,o8)}var s8=(t,e)=>e<0?[]:t.slice(0,e);function o8(t){if(t<=0)return Q3;let e=t;return n=>(e-=1,{done:e<=0,hasNext:!0,next:n})}function gc(...t){return it(a8,t)}var a8=(t,e)=>t.length>=e;function c8(...t){return it(u8,t)}function u8(t,e){return e(t),t}function MT(...t){return it(l8,t)}function l8(t,e){let n=[...t];return n.sort(e),n}function yy(...t){return it(d8,t)}var d8=(t,e,n)=>t.reduce(e,n);function BT(...t){return it(f8,t)}function f8(t){return[...t].reverse()}function yc(...t){return it(p8,t)}var p8=(t,e)=>t[e];function h8(...t){return it(m8,t)}function m8(t,e){let n={};for(let r of e)r in t&&(n[r]=t[r]);return n}function vc(...t){return it(g8,t)}function g8(t,e){let n={};for(let[r,i]of Object.entries(t)){let s=e(i,r,t);n[r]=s}return n}function ae(t){return!!t}function wc(...t){return it(y8,t)}var y8=t=>t.at(-1);function un(...t){return it(v8,t,w8)}var v8=(t,e)=>t.map(e),w8=t=>(e,n,r)=>({done:!1,hasNext:!0,next:t(e,n,r)});function nr(...t){return it(b8,t)}function b8(t,e){let n={};for(let[r,i]of t.entries()){let[s,o]=e(i,r,t);n[s]=o}return n}function Yf(t){return typeof t=="number"&&!Number.isNaN(t)}function D8(t){return t instanceof Promise}function zT(t){return typeof t=="string"}function ms(t){return t===void 0?!0:typeof t=="string"||Array.isArray(t)?t.length===0:Object.keys(t).length===0}function E8(t){return t instanceof Error}function Jt(t){return t!=null}function yt(t){return t==null}function R8(t){return Array.isArray(t)}function Ht(t){return t!==void 0}function gs(...t){return it(T8,t)}var T8=(t,e)=>{let n={};for(let[r,i]of t.entries()){let s=e(i,r,t);if(s!==void 0){let{[s]:o}=n;o===void 0&&(o=[],n[s]=o),o.push(i)}}return n};function vy(...t){return it($8,t)}function $8(t,e){let n={};for(let[r,i]of t.entries()){let s=e(i,r,t);n[s]=i}return n}function Di(...t){return it(S8,t,C8)}var S8=(t,e)=>t.flatMap(e),C8=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 k8(...t){return it(A8,t,_8)}function A8(t,e){return t.forEach(e),t}var _8=t=>(e,n,r)=>(t(e,n,r),{done:!1,hasNext:!0,next:e});function Xf(...t){return it(P8,t)}function P8(t,e){for(let[n,r]of Object.entries(t))e(r,n,t);return t}function Jf(...t){return it(Object.entries,t)}function je(...t){return it(I8,t,x8)}var I8=(t,e)=>t.filter(e),x8=t=>(e,n,r)=>t(e,n,r)?{done:!1,hasNext:!0,next:e}:hc,qT=t=>Object.assign(t,{single:!0});function jT(...t){return it(O8,t,qT(N8))}var O8=(t,e)=>t.find(e),N8=t=>(e,n,r)=>t(e,n,r)?{done:!0,hasNext:!0,next:e}:hc;function UT(...t){return it(F8,t)}var F8=(t,e)=>{for(let n=t.length-1;n>=0;n--){let r=t[n];if(e(r,n,t))return r}};function vo(...t){return it(L8,t,qT(M8))}var L8=([t])=>t,M8=()=>B8,B8=t=>({hasNext:!0,next:t,done:!0});function GT(...t){return it(z8,t)}var z8=(t,e)=>[...t,...e];function q8(t,{waitMs:e,timing:n="trailing",maxWaitMs:r}){if(r!==void 0&&e!==void 0&&r<e)throw new Error(`debounce: maxWaitMs (${r.toString()}) cannot be less than waitMs (${e.toString()})`);let i,s,o,a,c=()=>{if(s!==void 0){let f=s;s=void 0,clearTimeout(f)}if(o===void 0)throw new Error("REMEDA[debounce]: latestCallArgs was unexpectedly undefined.");let d=o;o=void 0,a=t(...d)},u=()=>{if(i===void 0)return;let d=i;i=void 0,clearTimeout(d),o!==void 0&&c()},l=d=>{o=d,r!==void 0&&s===void 0&&(s=setTimeout(c,r))};return{call:(...d)=>{if(i===void 0)n==="trailing"?l(d):a=t(...d);else{n!=="leading"&&l(d);let f=i;i=void 0,clearTimeout(f)}return i=setTimeout(u,e??r??0),a},cancel:()=>{if(i!==void 0){let d=i;i=void 0,clearTimeout(d)}if(s!==void 0){let d=s;s=void 0,clearTimeout(d)}o=void 0},flush:()=>(u(),a),get isPending(){return i!==void 0},get cachedValue(){return a}}}function j8(...t){return LT(U8,t)}function U8(t){if(t.length===0)return Z3;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),hc)}}function G8(...t){return it(W8,t)}var W8=(t,e)=>e.some(n=>n(t));function H8(...t){return it(V8,t)}function V8(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 WT(...t){return it(K8,t)}var K8=(t,{min:e,max:n})=>e!==void 0&&t<e?e:n!==void 0&&t>n?n:t,Y8={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,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]},X8=Object.entries(Y8);function wy(t){return String(t)}wy.open="",wy.close="";function J8(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("--color")||e?.platform==="win32"||t&&n.TERM!=="dumb"||"CI"in n)||typeof window<"u"&&!!window.chrome}function Q8(t=!1){let e=J8(t),n=(o,a,c,u)=>{let l="",d=0;do l+=o.substring(d,u)+c,d=u+a.length,u=o.indexOf(a,d);while(~u);return l+o.substring(d)},r=(o,a,c=o)=>{let u=l=>{let d=String(l),f=d.indexOf(a,o.length);return~f?o+n(d,a,c,f)+a:o+d+a};return u.open=o,u.close=a,u},i={isColorSupported:e},s=o=>`\x1B[${o}m`;for(let[o,a]of X8)i[o]=e?r(s(a[0]),s(a[1]),a[2]):wy;return i}var ft=Q8(OI(1)),bc={},Tt={},HT;function by(){if(HT)return Tt;HT=1,Object.defineProperty(Tt,"__esModule",{value:!0}),Tt.thenable=Tt.typedArray=Tt.stringArray=Tt.array=Tt.func=Tt.error=Tt.number=Tt.string=Tt.boolean=void 0;function t(u){return u===!0||u===!1}Tt.boolean=t;function e(u){return typeof u=="string"||u instanceof String}Tt.string=e;function n(u){return typeof u=="number"||u instanceof Number}Tt.number=n;function r(u){return u instanceof Error}Tt.error=r;function i(u){return typeof u=="function"}Tt.func=i;function s(u){return Array.isArray(u)}Tt.array=s;function o(u){return s(u)&&u.every(l=>e(l))}Tt.stringArray=o;function a(u,l){return Array.isArray(u)&&u.every(l)}Tt.typedArray=a;function c(u){return u&&i(u.then)}return Tt.thenable=c,Tt}var Ue={},Dc={},Ec={},Qf={},Dy={},me={},VT;function KT(){if(VT)return me;VT=1,Object.defineProperty(me,"__esModule",{value:!0}),me.Message=me.NotificationType9=me.NotificationType8=me.NotificationType7=me.NotificationType6=me.NotificationType5=me.NotificationType4=me.NotificationType3=me.NotificationType2=me.NotificationType1=me.NotificationType0=me.NotificationType=me.RequestType9=me.RequestType8=me.RequestType7=me.RequestType6=me.RequestType5=me.RequestType4=me.RequestType3=me.RequestType2=me.RequestType1=me.RequestType=me.RequestType0=me.AbstractMessageSignature=me.ParameterStructures=me.ResponseError=me.ErrorCodes=void 0;const t=dc();var e;(function(S){S.ParseError=-32700,S.InvalidRequest=-32600,S.MethodNotFound=-32601,S.InvalidParams=-32602,S.InternalError=-32603,S.jsonrpcReservedErrorRangeStart=-32099,S.serverErrorStart=-32099,S.MessageWriteError=-32099,S.MessageReadError=-32098,S.PendingResponseRejected=-32097,S.ConnectionInactive=-32096,S.ServerNotInitialized=-32002,S.UnknownErrorCode=-32001,S.jsonrpcReservedErrorRangeEnd=-32e3,S.serverErrorEnd=-32e3})(e||(me.ErrorCodes=e={}));class n extends Error{constructor(T,O,W){super(O),this.code=t.number(T)?T:e.UnknownErrorCode,this.data=W,Object.setPrototypeOf(this,n.prototype)}toJson(){const T={code:this.code,message:this.message};return this.data!==void 0&&(T.data=this.data),T}}me.ResponseError=n;class r{constructor(T){this.kind=T}static is(T){return T===r.auto||T===r.byName||T===r.byPosition}toString(){return this.kind}}me.ParameterStructures=r,r.auto=new r("auto"),r.byPosition=new r("byPosition"),r.byName=new r("byName");class i{constructor(T,O){this.method=T,this.numberOfParams=O}get parameterStructures(){return r.auto}}me.AbstractMessageSignature=i;class s extends i{constructor(T){super(T,0)}}me.RequestType0=s;class o extends i{constructor(T,O=r.auto){super(T,1),this._parameterStructures=O}get parameterStructures(){return this._parameterStructures}}me.RequestType=o;class a extends i{constructor(T,O=r.auto){super(T,1),this._parameterStructures=O}get parameterStructures(){return this._parameterStructures}}me.RequestType1=a;class c extends i{constructor(T){super(T,2)}}me.RequestType2=c;class u extends i{constructor(T){super(T,3)}}me.RequestType3=u;class l extends i{constructor(T){super(T,4)}}me.RequestType4=l;class d extends i{constructor(T){super(T,5)}}me.RequestType5=d;class f extends i{constructor(T){super(T,6)}}me.RequestType6=f;class p extends i{constructor(T){super(T,7)}}me.RequestType7=p;class m extends i{constructor(T){super(T,8)}}me.RequestType8=m;class w extends i{constructor(T){super(T,9)}}me.RequestType9=w;class E extends i{constructor(T,O=r.auto){super(T,1),this._parameterStructures=O}get parameterStructures(){return this._parameterStructures}}me.NotificationType=E;class y extends i{constructor(T){super(T,0)}}me.NotificationType0=y;class b extends i{constructor(T,O=r.auto){super(T,1),this._parameterStructures=O}get parameterStructures(){return this._parameterStructures}}me.NotificationType1=b;class R extends i{constructor(T){super(T,2)}}me.NotificationType2=R;class C extends i{constructor(T){super(T,3)}}me.NotificationType3=C;class A extends i{constructor(T){super(T,4)}}me.NotificationType4=A;class q extends i{constructor(T){super(T,5)}}me.NotificationType5=q;class G extends i{constructor(T){super(T,6)}}me.NotificationType6=G;class Q extends i{constructor(T){super(T,7)}}me.NotificationType7=Q;class J extends i{constructor(T){super(T,8)}}me.NotificationType8=J;class le extends i{constructor(T){super(T,9)}}me.NotificationType9=le;var N;return function(S){function T(U){const K=U;return K&&t.string(K.method)&&(t.string(K.id)||t.number(K.id))}S.isRequest=T;function O(U){const K=U;return K&&t.string(K.method)&&U.id===void 0}S.isNotification=O;function W(U){const K=U;return K&&(K.result!==void 0||!!K.error)&&(t.string(K.id)||t.number(K.id)||K.id===null)}S.isResponse=W}(N||(me.Message=N={})),me}var Hr={},YT;function XT(){if(YT)return Hr;YT=1;var t;Object.defineProperty(Hr,"__esModule",{value:!0}),Hr.LRUCache=Hr.LinkedMap=Hr.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||(Hr.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=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 c=this._map.get(s);if(c)c.value=o,a!==e.None&&this.touch(c,a);else{switch(c={key:s,value:o,next:void 0,previous:void 0},a){case e.None:this.addItemLast(c);break;case e.First:this.addItemFirst(c);break;case e.Last:this.addItemLast(c);break;default:this.addItemLast(c);break}this._map.set(s,c),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._size--,s.value}forEach(s,o){const a=this._state;let c=this._head;for(;c;){if(o?s.bind(o)(c.value,c.key,this):s(c.value,c.key,this),this._state!==a)throw new Error("LinkedMap got modified during iteration.");c=c.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 c={value:o.key,done:!1};return o=o.next,c}else return{value:void 0,done:!0}}};return a}values(){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 c={value:o.value,done:!1};return o=o.next,c}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 c={value:[o.key,o.value],done:!1};return o=o.next,c}else return{value:void 0,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&&!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("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,c=s.previous;s===this._tail?(c.next=void 0,this._tail=c):(a.previous=c,c.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,c=s.previous;s===this._head?(a.previous=void 0,this._head=a):(a.previous=c,c.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)}}Hr.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.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 Hr.LRUCache=r,Hr}var Rc={},JT;function Z8(){if(JT)return Rc;JT=1,Object.defineProperty(Rc,"__esModule",{value:!0}),Rc.Disposable=void 0;var t;return function(e){function n(r){return{dispose:r}}e.create=n}(t||(Rc.Disposable=t={})),Rc}var ys={},QT;function ej(){if(QT)return ys;QT=1,Object.defineProperty(ys,"__esModule",{value:!0}),ys.SharedArrayReceiverStrategy=ys.SharedArraySenderStrategy=void 0;const t=Bf();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 c=new SharedArrayBuffer(4),u=new Int32Array(c,0,1);u[0]=e.Continue,this.buffers.set(a.id,c),a.$cancellationData=c}async sendCancellation(a,c){const u=this.buffers.get(c);if(u===void 0)return;const l=new Int32Array(u,0,1);Atomics.store(l,0,e.Cancelled)}cleanup(a){this.buffers.delete(a)}dispose(){this.buffers.clear()}}ys.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(){this.kind="request"}createCancellationTokenSource(a){const c=a.$cancellationData;return c===void 0?new t.CancellationTokenSource:new i(c)}}return ys.SharedArrayReceiverStrategy=s,ys}var Vr={},Tc={},ZT;function e$(){if(ZT)return Tc;ZT=1,Object.defineProperty(Tc,"__esModule",{value:!0}),Tc.Semaphore=void 0;const t=ds();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.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()},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 Tc.Semaphore=e,Tc}var t$;function tj(){if(t$)return Vr;t$=1,Object.defineProperty(Vr,"__esModule",{value:!0}),Vr.ReadableStreamMessageReader=Vr.AbstractMessageReader=Vr.MessageReader=void 0;const t=ds(),e=dc(),n=yo(),r=e$();var i;(function(c){function u(l){let d=l;return d&&e.func(d.listen)&&e.func(d.dispose)&&e.func(d.onError)&&e.func(d.onClose)&&e.func(d.onPartialMessage)}c.is=u})(i||(Vr.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(u){this.errorEmitter.fire(this.asError(u))}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}get onPartialMessage(){return this.partialMessageEmitter.event}firePartialMessage(u){this.partialMessageEmitter.fire(u)}asError(u){return u instanceof Error?u:new Error(`Reader received error. Reason: ${e.string(u.message)?u.message:"unknown"}`)}}Vr.AbstractMessageReader=s;var o;(function(c){function u(l){let d,f;const p=new Map;let m;const w=new Map;if(l===void 0||typeof l=="string")d=l??"utf-8";else{if(d=l.charset??"utf-8",l.contentDecoder!==void 0&&(f=l.contentDecoder,p.set(f.name,f)),l.contentDecoders!==void 0)for(const E of l.contentDecoders)p.set(E.name,E);if(l.contentTypeDecoder!==void 0&&(m=l.contentTypeDecoder,w.set(m.name,m)),l.contentTypeDecoders!==void 0)for(const E of l.contentTypeDecoders)w.set(E.name,E)}return m===void 0&&(m=(0,t.default)().applicationJson.decoder,w.set(m.name,m)),{charset:d,contentDecoder:f,contentDecoders:p,contentTypeDecoder:m,contentTypeDecoders:w}}c.fromOptions=u})(o||(o={}));class a extends s{constructor(u,l){super(),this.readable=u,this.options=o.fromOptions(l),this.buffer=(0,t.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new r.Semaphore(1)}set partialMessageTimeout(u){this._partialMessageTimeout=u}get partialMessageTimeout(){return this._partialMessageTimeout}listen(u){this.nextMessageLength=-1,this.messageToken=0,this.partialMessageTimer=void 0,this.callback=u;const l=this.readable.onData(d=>{this.onData(d)});return this.readable.onError(d=>this.fireError(d)),this.readable.onClose(()=>this.fireClose()),l}onData(u){try{for(this.buffer.append(u);;){if(this.nextMessageLength===-1){const d=this.buffer.tryReadHeaders(!0);if(!d)return;const f=d.get("content-length");if(!f){this.fireError(new Error(`Header must provide a Content-Length property.
|
|
126
|
+
${JSON.stringify(Object.fromEntries(d))}`));return}const p=parseInt(f);if(isNaN(p)){this.fireError(new Error(`Content-Length value must be a number. Got ${f}`));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 d=this.options.contentDecoder!==void 0?await this.options.contentDecoder.decode(l):l,f=await this.options.contentTypeDecoder.decode(d,this.options);this.callback(f)}).catch(d=>{this.fireError(d)})}}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((u,l)=>{this.partialMessageTimer=void 0,u===this.messageToken&&(this.firePartialMessage({messageToken:u,waitingTime:l}),this.setPartialMessageTimer())},this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout))}}return Vr.ReadableStreamMessageReader=a,Vr}var Kr={},n$;function nj(){if(n$)return Kr;n$=1,Object.defineProperty(Kr,"__esModule",{value:!0}),Kr.WriteableStreamMessageWriter=Kr.AbstractMessageWriter=Kr.MessageWriter=void 0;const t=ds(),e=dc(),n=e$(),r=yo(),i="Content-Length: ",s=`\r
|
|
127
|
+
`;var o;(function(l){function d(f){let p=f;return p&&e.func(p.dispose)&&e.func(p.onClose)&&e.func(p.onError)&&e.func(p.write)}l.is=d})(o||(Kr.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(d,f,p){this.errorEmitter.fire([this.asError(d),f,p])}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}asError(d){return d instanceof Error?d:new Error(`Writer received error. Reason: ${e.string(d.message)?d.message:"unknown"}`)}}Kr.AbstractMessageWriter=a;var c;(function(l){function d(f){return f===void 0||typeof f=="string"?{charset:f??"utf-8",contentTypeEncoder:(0,t.default)().applicationJson.encoder}:{charset:f.charset??"utf-8",contentEncoder:f.contentEncoder,contentTypeEncoder:f.contentTypeEncoder??(0,t.default)().applicationJson.encoder}}l.fromOptions=d})(c||(c={}));class u extends a{constructor(d,f){super(),this.writable=d,this.options=c.fromOptions(f),this.errorCount=0,this.writeSemaphore=new n.Semaphore(1),this.writable.onError(p=>this.fireError(p)),this.writable.onClose(()=>this.fireClose())}async write(d){return this.writeSemaphore.lock(async()=>this.options.contentTypeEncoder.encode(d,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(d,m,p)},p=>{throw this.fireError(p),p}))}async doWrite(d,f,p){try{return await this.writable.write(f.join(""),"ascii"),this.writable.write(p)}catch(m){return this.handleError(m,d),Promise.reject(m)}}handleError(d,f){this.errorCount++,this.fireError(d,f,this.errorCount)}end(){this.writable.end()}}return Kr.WriteableStreamMessageWriter=u,Kr}var $c={},r$;function rj(){if(r$)return $c;r$=1,Object.defineProperty($c,"__esModule",{value:!0}),$c.AbstractMessageBuffer=void 0;const t=13,e=10,n=`\r
|
|
128
|
+
`;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,c=0,u=0;e:for(;a<this._chunks.length;){const p=this._chunks[a];for(c=0;c<p.length;){switch(p[c]){case t:switch(o){case 0:o=1;break;case 2:o=3;break;default:o=0}break;case e:switch(o){case 1:o=2;break;case 3:o=4,c++;break e;default:o=0}break;default:o=0}c++}u+=p.byteLength,a++}if(o!==4)return;const l=this._read(u+c),d=new Map,f=this.toString(l,"ascii").split(n);if(f.length<2)return d;for(let p=0;p<f.length-2;p++){const m=f[p],w=m.indexOf(":");if(w===-1)throw new Error(`Message header must separate key and value using ':'
|
|
129
|
+
${m}`);const E=m.substr(0,w),y=m.substr(w+1).trim();d.set(s?E.toLowerCase():E,y)}return d}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 u=this._chunks[0];return this._chunks.shift(),this._totalLength-=s,this.asNative(u)}if(this._chunks[0].byteLength>s){const u=this._chunks[0],l=this.asNative(u,s);return this._chunks[0]=u.slice(s),this._totalLength-=s,l}const o=this.allocNative(s);let a=0,c=0;for(;s>0;){const u=this._chunks[c];if(u.byteLength>s){const l=u.slice(0,s);o.set(l,a),a+=s,this._chunks[c]=u.slice(s),this._totalLength-=s,s-=s}else o.set(u,a),a+=u.byteLength,this._chunks.shift(),this._totalLength-=u.byteLength,s-=u.byteLength}return o}}return $c.AbstractMessageBuffer=r,$c}var Ey={},i$;function ij(){return i$||(i$=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.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=ds(),n=dc(),r=KT(),i=XT(),s=yo(),o=Bf();var a;(function(T){T.type=new r.NotificationType("$/cancelRequest")})(a||(a={}));var c;(function(T){function O(W){return typeof W=="string"||typeof W=="number"}T.is=O})(c||(t.ProgressToken=c={}));var u;(function(T){T.type=new r.NotificationType("$/progress")})(u||(u={}));class l{constructor(){}}t.ProgressType=l;var d;(function(T){function O(W){return n.func(W)}T.is=O})(d||(d={})),t.NullLogger=Object.freeze({error:()=>{},warn:()=>{},info:()=>{},log:()=>{}});var f;(function(T){T[T.Off=0]="Off",T[T.Messages=1]="Messages",T[T.Compact=2]="Compact",T[T.Verbose=3]="Verbose"})(f||(t.Trace=f={}));var p;(function(T){T.Off="off",T.Messages="messages",T.Compact="compact",T.Verbose="verbose"})(p||(t.TraceValues=p={})),function(T){function O(U){if(!n.string(U))return T.Off;switch(U=U.toLowerCase(),U){case"off":return T.Off;case"messages":return T.Messages;case"compact":return T.Compact;case"verbose":return T.Verbose;default:return T.Off}}T.fromString=O;function W(U){switch(U){case T.Off:return"off";case T.Messages:return"messages";case T.Compact:return"compact";case T.Verbose:return"verbose";default:return"off"}}T.toString=W}(f||(t.Trace=f={}));var m;(function(T){T.Text="text",T.JSON="json"})(m||(t.TraceFormat=m={})),function(T){function O(W){return n.string(W)?(W=W.toLowerCase(),W==="json"?T.JSON:T.Text):T.Text}T.fromString=O}(m||(t.TraceFormat=m={}));var w;(function(T){T.type=new r.NotificationType("$/setTrace")})(w||(t.SetTraceNotification=w={}));var E;(function(T){T.type=new r.NotificationType("$/logTrace")})(E||(t.LogTraceNotification=E={}));var y;(function(T){T[T.Closed=1]="Closed",T[T.Disposed=2]="Disposed",T[T.AlreadyListening=3]="AlreadyListening"})(y||(t.ConnectionErrors=y={}));class b extends Error{constructor(O,W){super(W),this.code=O,Object.setPrototypeOf(this,b.prototype)}}t.ConnectionError=b;var R;(function(T){function O(W){const U=W;return U&&n.func(U.cancelUndispatched)}T.is=O})(R||(t.ConnectionStrategy=R={}));var C;(function(T){function O(W){const U=W;return U&&(U.kind===void 0||U.kind==="id")&&n.func(U.createCancellationTokenSource)&&(U.dispose===void 0||n.func(U.dispose))}T.is=O})(C||(t.IdCancellationReceiverStrategy=C={}));var A;(function(T){function O(W){const U=W;return U&&U.kind==="request"&&n.func(U.createCancellationTokenSource)&&(U.dispose===void 0||n.func(U.dispose))}T.is=O})(A||(t.RequestCancellationReceiverStrategy=A={}));var q;(function(T){T.Message=Object.freeze({createCancellationTokenSource(W){return new o.CancellationTokenSource}});function O(W){return C.is(W)||A.is(W)}T.is=O})(q||(t.CancellationReceiverStrategy=q={}));var G;(function(T){T.Message=Object.freeze({sendCancellation(W,U){return W.sendNotification(a.type,{id:U})},cleanup(W){}});function O(W){const U=W;return U&&n.func(U.sendCancellation)&&n.func(U.cleanup)}T.is=O})(G||(t.CancellationSenderStrategy=G={}));var Q;(function(T){T.Message=Object.freeze({receiver:q.Message,sender:G.Message});function O(W){const U=W;return U&&q.is(U.receiver)&&G.is(U.sender)}T.is=O})(Q||(t.CancellationStrategy=Q={}));var J;(function(T){function O(W){const U=W;return U&&n.func(U.handleMessage)}T.is=O})(J||(t.MessageStrategy=J={}));var le;(function(T){function O(W){const U=W;return U&&(Q.is(U.cancellationStrategy)||R.is(U.connectionStrategy)||J.is(U.messageStrategy))}T.is=O})(le||(t.ConnectionOptions=le={}));var N;(function(T){T[T.New=1]="New",T[T.Listening=2]="Listening",T[T.Closed=3]="Closed",T[T.Disposed=4]="Disposed"})(N||(N={}));function S(T,O,W,U){const K=W!==void 0?W:t.NullLogger;let be=0,ee=0,k=0;const pe="2.0";let Qe;const ct=new Map;let j;const V=new Map,_e=new Map;let ie,ve=new i.LinkedMap,Te=new Map,se=new Set,I=new Map,M=f.Off,ue=m.Text,B,oe=N.New;const Le=new s.Emitter,Ke=new s.Emitter,re=new s.Emitter,Ce=new s.Emitter,te=new s.Emitter,we=U&&U.cancellationStrategy?U.cancellationStrategy:Q.Message;function Oe(D){if(D===null)throw new Error("Can't send requests with id null since the response can't be correlated.");return"req-"+D.toString()}function ut(D){return D===null?"res-unknown-"+(++k).toString():"res-"+D.toString()}function Ge(){return"not-"+(++ee).toString()}function Ft(D,z){r.Message.isRequest(z)?D.set(Oe(z.id),z):r.Message.isResponse(z)?D.set(ut(z.id),z):D.set(Ge(),z)}function Bt(D){}function tn(){return oe===N.Listening}function Y(){return oe===N.Closed}function X(){return oe===N.Disposed}function de(){(oe===N.New||oe===N.Listening)&&(oe=N.Closed,Ke.fire(void 0))}function zt(D){Le.fire([D,void 0,void 0])}function Lt(D){Le.fire(D)}T.onClose(de),T.onError(zt),O.onClose(de),O.onError(Lt);function cr(){ie||ve.size===0||(ie=(0,e.default)().timer.setImmediate(()=>{ie=void 0,qi()}))}function ai(D){r.Message.isRequest(D)?Ui(D):r.Message.isNotification(D)?ci(D):r.Message.isResponse(D)?Gi(D):ui(D)}function qi(){if(ve.size===0)return;const D=ve.shift();try{const z=U?.messageStrategy;J.is(z)?z.handleMessage(D,ai):ai(D)}finally{cr()}}const ji=D=>{try{if(r.Message.isNotification(D)&&D.method===a.type.method){const z=D.params.id,Z=Oe(z),ne=ve.get(Z);if(r.Message.isRequest(ne)){const Pe=U?.connectionStrategy,We=Pe&&Pe.cancelUndispatched?Pe.cancelUndispatched(ne,Bt):void 0;if(We&&(We.error!==void 0||We.result!==void 0)){ve.delete(Z),I.delete(z),We.id=ne.id,ur(We,D.method,Date.now()),O.write(We).catch(()=>K.error("Sending response for canceled message failed."));return}}const Ne=I.get(z);if(Ne!==void 0){Ne.cancel(),_r(D);return}else se.add(z)}Ft(ve,D)}finally{cr()}};function Ui(D){if(X())return;function z(ke,Ze,He){const It={jsonrpc:pe,id:D.id};ke instanceof r.ResponseError?It.error=ke.toJson():It.result=ke===void 0?null:ke,ur(It,Ze,He),O.write(It).catch(()=>K.error("Sending response failed."))}function Z(ke,Ze,He){const It={jsonrpc:pe,id:D.id,error:ke.toJson()};ur(It,Ze,He),O.write(It).catch(()=>K.error("Sending response failed."))}function ne(ke,Ze,He){ke===void 0&&(ke=null);const It={jsonrpc:pe,id:D.id,result:ke};ur(It,Ze,He),O.write(It).catch(()=>K.error("Sending response failed."))}Vi(D);const Ne=ct.get(D.method);let Pe,We;Ne&&(Pe=Ne.type,We=Ne.handler);const he=Date.now();if(We||Qe){const ke=D.id??String(Date.now()),Ze=C.is(we.receiver)?we.receiver.createCancellationTokenSource(ke):we.receiver.createCancellationTokenSource(D);D.id!==null&&se.has(D.id)&&Ze.cancel(),D.id!==null&&I.set(ke,Ze);try{let He;if(We)if(D.params===void 0){if(Pe!==void 0&&Pe.numberOfParams!==0){Z(new r.ResponseError(r.ErrorCodes.InvalidParams,`Request ${D.method} defines ${Pe.numberOfParams} params but received none.`),D.method,he);return}He=We(Ze.token)}else if(Array.isArray(D.params)){if(Pe!==void 0&&Pe.parameterStructures===r.ParameterStructures.byName){Z(new r.ResponseError(r.ErrorCodes.InvalidParams,`Request ${D.method} defines parameters by name but received parameters by position`),D.method,he);return}He=We(...D.params,Ze.token)}else{if(Pe!==void 0&&Pe.parameterStructures===r.ParameterStructures.byPosition){Z(new r.ResponseError(r.ErrorCodes.InvalidParams,`Request ${D.method} defines parameters by position but received parameters by name`),D.method,he);return}He=We(D.params,Ze.token)}else Qe&&(He=Qe(D.method,D.params,Ze.token));const It=He;He?It.then?It.then(nn=>{I.delete(ke),z(nn,D.method,he)},nn=>{I.delete(ke),nn instanceof r.ResponseError?Z(nn,D.method,he):nn&&n.string(nn.message)?Z(new r.ResponseError(r.ErrorCodes.InternalError,`Request ${D.method} failed with message: ${nn.message}`),D.method,he):Z(new r.ResponseError(r.ErrorCodes.InternalError,`Request ${D.method} failed unexpectedly without providing any details.`),D.method,he)}):(I.delete(ke),z(He,D.method,he)):(I.delete(ke),ne(He,D.method,he))}catch(He){I.delete(ke),He instanceof r.ResponseError?z(He,D.method,he):He&&n.string(He.message)?Z(new r.ResponseError(r.ErrorCodes.InternalError,`Request ${D.method} failed with message: ${He.message}`),D.method,he):Z(new r.ResponseError(r.ErrorCodes.InternalError,`Request ${D.method} failed unexpectedly without providing any details.`),D.method,he)}}else Z(new r.ResponseError(r.ErrorCodes.MethodNotFound,`Unhandled method ${D.method}`),D.method,he)}function Gi(D){if(!X())if(D.id===null)D.error?K.error(`Received response message without id: Error is:
|
|
130
|
+
${JSON.stringify(D.error,void 0,4)}`):K.error("Received response message without id. No further error information provided.");else{const z=D.id,Z=Te.get(z);if(Ki(D,Z),Z!==void 0){Te.delete(z);try{if(D.error){const ne=D.error;Z.reject(new r.ResponseError(ne.code,ne.message,ne.data))}else if(D.result!==void 0)Z.resolve(D.result);else throw new Error("Should never happen.")}catch(ne){ne.message?K.error(`Response handler '${Z.method}' failed with message: ${ne.message}`):K.error(`Response handler '${Z.method}' failed unexpectedly.`)}}}}function ci(D){if(X())return;let z,Z;if(D.method===a.type.method){const ne=D.params.id;se.delete(ne),_r(D);return}else{const ne=V.get(D.method);ne&&(Z=ne.handler,z=ne.type)}if(Z||j)try{if(_r(D),Z)if(D.params===void 0)z!==void 0&&z.numberOfParams!==0&&z.parameterStructures!==r.ParameterStructures.byName&&K.error(`Notification ${D.method} defines ${z.numberOfParams} params but received none.`),Z();else if(Array.isArray(D.params)){const ne=D.params;D.method===u.type.method&&ne.length===2&&c.is(ne[0])?Z({token:ne[0],value:ne[1]}):(z!==void 0&&(z.parameterStructures===r.ParameterStructures.byName&&K.error(`Notification ${D.method} defines parameters by name but received parameters by position`),z.numberOfParams!==D.params.length&&K.error(`Notification ${D.method} defines ${z.numberOfParams} params but received ${ne.length} arguments`)),Z(...ne))}else z!==void 0&&z.parameterStructures===r.ParameterStructures.byPosition&&K.error(`Notification ${D.method} defines parameters by position but received parameters by name`),Z(D.params);else j&&j(D.method,D.params)}catch(ne){ne.message?K.error(`Notification handler '${D.method}' failed with message: ${ne.message}`):K.error(`Notification handler '${D.method}' failed unexpectedly.`)}else re.fire(D)}function ui(D){if(!D){K.error("Received empty message.");return}K.error(`Received message which is neither a response nor a notification message:
|
|
131
|
+
${JSON.stringify(D,null,4)}`);const z=D;if(n.string(z.id)||n.number(z.id)){const Z=z.id,ne=Te.get(Z);ne&&ne.reject(new Error("The received response has neither a result nor an error property."))}}function gn(D){if(D!=null)switch(M){case f.Verbose:return JSON.stringify(D,null,4);case f.Compact:return JSON.stringify(D);default:return}}function Wi(D){if(!(M===f.Off||!B))if(ue===m.Text){let z;(M===f.Verbose||M===f.Compact)&&D.params&&(z=`Params: ${gn(D.params)}
|
|
132
|
+
|
|
133
|
+
`),B.log(`Sending request '${D.method} - (${D.id})'.`,z)}else Ln("send-request",D)}function Hi(D){if(!(M===f.Off||!B))if(ue===m.Text){let z;(M===f.Verbose||M===f.Compact)&&(D.params?z=`Params: ${gn(D.params)}
|
|
134
|
+
|
|
135
|
+
`:z=`No parameters provided.
|
|
136
|
+
|
|
137
|
+
`),B.log(`Sending notification '${D.method}'.`,z)}else Ln("send-notification",D)}function ur(D,z,Z){if(!(M===f.Off||!B))if(ue===m.Text){let ne;(M===f.Verbose||M===f.Compact)&&(D.error&&D.error.data?ne=`Error data: ${gn(D.error.data)}
|
|
138
|
+
|
|
139
|
+
`:D.result?ne=`Result: ${gn(D.result)}
|
|
140
|
+
|
|
141
|
+
`:D.error===void 0&&(ne=`No result returned.
|
|
142
|
+
|
|
143
|
+
`)),B.log(`Sending response '${z} - (${D.id})'. Processing request took ${Date.now()-Z}ms`,ne)}else Ln("send-response",D)}function Vi(D){if(!(M===f.Off||!B))if(ue===m.Text){let z;(M===f.Verbose||M===f.Compact)&&D.params&&(z=`Params: ${gn(D.params)}
|
|
144
|
+
|
|
145
|
+
`),B.log(`Received request '${D.method} - (${D.id})'.`,z)}else Ln("receive-request",D)}function _r(D){if(!(M===f.Off||!B||D.method===E.type.method))if(ue===m.Text){let z;(M===f.Verbose||M===f.Compact)&&(D.params?z=`Params: ${gn(D.params)}
|
|
146
|
+
|
|
147
|
+
`:z=`No parameters provided.
|
|
148
|
+
|
|
149
|
+
`),B.log(`Received notification '${D.method}'.`,z)}else Ln("receive-notification",D)}function Ki(D,z){if(!(M===f.Off||!B))if(ue===m.Text){let Z;if((M===f.Verbose||M===f.Compact)&&(D.error&&D.error.data?Z=`Error data: ${gn(D.error.data)}
|
|
150
|
+
|
|
151
|
+
`:D.result?Z=`Result: ${gn(D.result)}
|
|
152
|
+
|
|
153
|
+
`:D.error===void 0&&(Z=`No result returned.
|
|
154
|
+
|
|
155
|
+
`)),z){const ne=D.error?` Request failed: ${D.error.message} (${D.error.code}).`:"";B.log(`Received response '${z.method} - (${D.id})' in ${Date.now()-z.timerStart}ms.${ne}`,Z)}else B.log(`Received response ${D.id} without active response promise.`,Z)}else Ln("receive-response",D)}function Ln(D,z){if(!B||M===f.Off)return;const Z={isLSPMessage:!0,type:D,message:z,timestamp:Date.now()};B.log(Z)}function Vn(){if(Y())throw new b(y.Closed,"Connection is closed.");if(X())throw new b(y.Disposed,"Connection is disposed.")}function Ks(){if(tn())throw new b(y.AlreadyListening,"Connection is already listening")}function F(){if(!tn())throw new Error("Call listen() first.")}function v(D){return D===void 0?null:D}function _(D){if(D!==null)return D}function h(D){return D!=null&&!Array.isArray(D)&&typeof D=="object"}function $(D,z){switch(D){case r.ParameterStructures.auto:return h(z)?_(z):[v(z)];case r.ParameterStructures.byName:if(!h(z))throw new Error("Received parameters by name but param is not an object literal.");return _(z);case r.ParameterStructures.byPosition:return[v(z)];default:throw new Error(`Unknown parameter structure ${D.toString()}`)}}function g(D,z){let Z;const ne=D.numberOfParams;switch(ne){case 0:Z=void 0;break;case 1:Z=$(D.parameterStructures,z[0]);break;default:Z=[];for(let Ne=0;Ne<z.length&&Ne<ne;Ne++)Z.push(v(z[Ne]));if(z.length<ne)for(let Ne=z.length;Ne<ne;Ne++)Z.push(null);break}return Z}const P={sendNotification:(D,...z)=>{Vn();let Z,ne;if(n.string(D)){Z=D;const Pe=z[0];let We=0,he=r.ParameterStructures.auto;r.ParameterStructures.is(Pe)&&(We=1,he=Pe);let ke=z.length;const Ze=ke-We;switch(Ze){case 0:ne=void 0;break;case 1:ne=$(he,z[We]);break;default:if(he===r.ParameterStructures.byName)throw new Error(`Received ${Ze} parameters for 'by Name' notification parameter structure.`);ne=z.slice(We,ke).map(He=>v(He));break}}else{const Pe=z;Z=D.method,ne=g(D,Pe)}const Ne={jsonrpc:pe,method:Z,params:ne};return Hi(Ne),O.write(Ne).catch(Pe=>{throw K.error("Sending notification failed."),Pe})},onNotification:(D,z)=>{Vn();let Z;return n.func(D)?j=D:z&&(n.string(D)?(Z=D,V.set(D,{type:void 0,handler:z})):(Z=D.method,V.set(D.method,{type:D,handler:z}))),{dispose:()=>{Z!==void 0?V.delete(Z):j=void 0}}},onProgress:(D,z,Z)=>{if(_e.has(z))throw new Error(`Progress handler for token ${z} already registered`);return _e.set(z,Z),{dispose:()=>{_e.delete(z)}}},sendProgress:(D,z,Z)=>P.sendNotification(u.type,{token:z,value:Z}),onUnhandledProgress:Ce.event,sendRequest:(D,...z)=>{Vn(),F();let Z,ne,Ne;if(n.string(D)){Z=D;const ke=z[0],Ze=z[z.length-1];let He=0,It=r.ParameterStructures.auto;r.ParameterStructures.is(ke)&&(He=1,It=ke);let nn=z.length;o.CancellationToken.is(Ze)&&(nn=nn-1,Ne=Ze);const lr=nn-He;switch(lr){case 0:ne=void 0;break;case 1:ne=$(It,z[He]);break;default:if(It===r.ParameterStructures.byName)throw new Error(`Received ${lr} parameters for 'by Name' request parameter structure.`);ne=z.slice(He,nn).map(CI=>v(CI));break}}else{const ke=z;Z=D.method,ne=g(D,ke);const Ze=D.numberOfParams;Ne=o.CancellationToken.is(ke[Ze])?ke[Ze]:void 0}const Pe=be++;let We;Ne&&(We=Ne.onCancellationRequested(()=>{const ke=we.sender.sendCancellation(P,Pe);return ke===void 0?(K.log(`Received no promise from cancellation strategy when cancelling id ${Pe}`),Promise.resolve()):ke.catch(()=>{K.log(`Sending cancellation messages for id ${Pe} failed`)})}));const he={jsonrpc:pe,id:Pe,method:Z,params:ne};return Wi(he),typeof we.sender.enableCancellation=="function"&&we.sender.enableCancellation(he),new Promise(async(ke,Ze)=>{const He=lr=>{ke(lr),we.sender.cleanup(Pe),We?.dispose()},It=lr=>{Ze(lr),we.sender.cleanup(Pe),We?.dispose()},nn={method:Z,timerStart:Date.now(),resolve:He,reject:It};try{await O.write(he),Te.set(Pe,nn)}catch(lr){throw K.error("Sending request failed."),nn.reject(new r.ResponseError(r.ErrorCodes.MessageWriteError,lr.message?lr.message:"Unknown reason")),lr}})},onRequest:(D,z)=>{Vn();let Z=null;return d.is(D)?(Z=void 0,Qe=D):n.string(D)?(Z=null,z!==void 0&&(Z=D,ct.set(D,{handler:z,type:void 0}))):z!==void 0&&(Z=D.method,ct.set(D.method,{type:D,handler:z})),{dispose:()=>{Z!==null&&(Z!==void 0?ct.delete(Z):Qe=void 0)}}},hasPendingResponse:()=>Te.size>0,trace:async(D,z,Z)=>{let ne=!1,Ne=m.Text;Z!==void 0&&(n.boolean(Z)?ne=Z:(ne=Z.sendNotification||!1,Ne=Z.traceFormat||m.Text)),M=D,ue=Ne,M===f.Off?B=void 0:B=z,ne&&!Y()&&!X()&&await P.sendNotification(w.type,{value:f.toString(D)})},onError:Le.event,onClose:Ke.event,onUnhandledNotification:re.event,onDispose:te.event,end:()=>{O.end()},dispose:()=>{if(X())return;oe=N.Disposed,te.fire(void 0);const D=new r.ResponseError(r.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(const z of Te.values())z.reject(D);Te=new Map,I=new Map,se=new Set,ve=new i.LinkedMap,n.func(O.dispose)&&O.dispose(),n.func(T.dispose)&&T.dispose()},listen:()=>{Vn(),Ks(),oe=N.Listening,T.listen(ji)},inspect:()=>{(0,e.default)().console.log("inspect")}};return P.onNotification(E.type,D=>{if(M===f.Off||!B)return;const z=M===f.Verbose||M===f.Compact;B.log(D.message,z?D.verbose:void 0)}),P.onNotification(u.type,D=>{const z=_e.get(D.token);z?z(D.value):Ce.fire(D)}),P}t.createMessageConnection=S}(Ey)),Ey}var s$;function Ry(){return s$||(s$=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=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.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=KT();Object.defineProperty(t,"Message",{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(){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.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(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.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}});const n=XT();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=Z8();Object.defineProperty(t,"Disposable",{enumerable:!0,get:function(){return r.Disposable}});const i=yo();Object.defineProperty(t,"Event",{enumerable:!0,get:function(){return i.Event}}),Object.defineProperty(t,"Emitter",{enumerable:!0,get:function(){return i.Emitter}});const s=Bf();Object.defineProperty(t,"CancellationTokenSource",{enumerable:!0,get:function(){return s.CancellationTokenSource}}),Object.defineProperty(t,"CancellationToken",{enumerable:!0,get:function(){return s.CancellationToken}});const o=ej();Object.defineProperty(t,"SharedArraySenderStrategy",{enumerable:!0,get:function(){return o.SharedArraySenderStrategy}}),Object.defineProperty(t,"SharedArrayReceiverStrategy",{enumerable:!0,get:function(){return o.SharedArrayReceiverStrategy}});const a=tj();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 c=nj();Object.defineProperty(t,"MessageWriter",{enumerable:!0,get:function(){return c.MessageWriter}}),Object.defineProperty(t,"AbstractMessageWriter",{enumerable:!0,get:function(){return c.AbstractMessageWriter}}),Object.defineProperty(t,"WriteableStreamMessageWriter",{enumerable:!0,get:function(){return c.WriteableStreamMessageWriter}});const u=rj();Object.defineProperty(t,"AbstractMessageBuffer",{enumerable:!0,get:function(){return u.AbstractMessageBuffer}});const l=ij();Object.defineProperty(t,"ConnectionStrategy",{enumerable:!0,get:function(){return l.ConnectionStrategy}}),Object.defineProperty(t,"ConnectionOptions",{enumerable:!0,get:function(){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}}),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}}),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",{enumerable:!0,get:function(){return l.MessageStrategy}});const d=ds();t.RAL=d.default}(Dy)),Dy}var o$;function sj(){if(o$)return Qf;o$=1,Object.defineProperty(Qf,"__esModule",{value:!0});const t=zI,e=Ry();class n extends e.AbstractMessageBuffer{constructor(c="utf-8"){super(c)}emptyBuffer(){return n.emptyBuffer}fromString(c,u){return Buffer.from(c,u)}toString(c,u){return c instanceof Buffer?c.toString(u):new t.TextDecoder(u).decode(c)}asNative(c,u){return u===void 0?c instanceof Buffer?c:Buffer.from(c):c instanceof Buffer?c.slice(0,u):Buffer.from(c,0,u)}allocNative(c){return Buffer.allocUnsafe(c)}}n.emptyBuffer=Buffer.allocUnsafe(0);class r{constructor(c){this.stream=c}onClose(c){return this.stream.on("close",c),e.Disposable.create(()=>this.stream.off("close",c))}onError(c){return this.stream.on("error",c),e.Disposable.create(()=>this.stream.off("error",c))}onEnd(c){return this.stream.on("end",c),e.Disposable.create(()=>this.stream.off("end",c))}onData(c){return this.stream.on("data",c),e.Disposable.create(()=>this.stream.off("data",c))}}class i{constructor(c){this.stream=c}onClose(c){return this.stream.on("close",c),e.Disposable.create(()=>this.stream.off("close",c))}onError(c){return this.stream.on("error",c),e.Disposable.create(()=>this.stream.off("error",c))}onEnd(c){return this.stream.on("end",c),e.Disposable.create(()=>this.stream.off("end",c))}write(c,u){return new Promise((l,d)=>{const f=p=>{p==null?l():d(p)};typeof c=="string"?this.stream.write(c,u,f):this.stream.write(c,f)})}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,c)=>{try{return Promise.resolve(Buffer.from(JSON.stringify(a,void 0,0),c.charset))}catch(u){return Promise.reject(u)}}}),decoder:Object.freeze({name:"application/json",decode:(a,c)=>{try{return a instanceof Buffer?Promise.resolve(JSON.parse(a.toString(c.charset))):Promise.resolve(JSON.parse(new t.TextDecoder(c.charset).decode(a)))}catch(u){return Promise.reject(u)}}})}),stream:Object.freeze({asReadableStream:a=>new r(a),asWritableStream:a=>new i(a)}),console,timer:Object.freeze({setTimeout(a,c,...u){const l=setTimeout(a,c,...u);return{dispose:()=>clearTimeout(l)}},setImmediate(a,...c){const u=setImmediate(a,...c);return{dispose:()=>clearImmediate(u)}},setInterval(a,c,...u){const l=setInterval(a,c,...u);return{dispose:()=>clearInterval(l)}}})});function o(){return s}return function(a){function c(){e.RAL.install(s)}a.install=c}(o),Qf.default=o,Qf}var a$;function vs(){return a$||(a$=1,function(t){var e=Ec.__createBinding||(Object.create?function(N,S,T,O){O===void 0&&(O=T);var W=Object.getOwnPropertyDescriptor(S,T);(!W||("get"in W?!S.__esModule:W.writable||W.configurable))&&(W={enumerable:!0,get:function(){return S[T]}}),Object.defineProperty(N,O,W)}:function(N,S,T,O){O===void 0&&(O=T),N[O]=S[T]}),n=Ec.__exportStar||function(N,S){for(var T in N)T!=="default"&&!Object.prototype.hasOwnProperty.call(S,T)&&e(S,N,T)};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=sj();r.default.install();const i=dr,s=qI,o=jI,a=UI,c=Ry();n(Ry(),t);class u extends c.AbstractMessageReader{constructor(S){super(),this.process=S;let T=this.process;T.on("error",O=>this.fireError(O)),T.on("close",()=>this.fireClose())}listen(S){return this.process.on("message",S),c.Disposable.create(()=>this.process.off("message",S))}}t.IPCMessageReader=u;class l extends c.AbstractMessageWriter{constructor(S){super(),this.process=S,this.errorCount=0;const T=this.process;T.on("error",O=>this.fireError(O)),T.on("close",()=>this.fireClose)}write(S){try{return typeof this.process.send=="function"&&this.process.send(S,void 0,void 0,T=>{T?(this.errorCount++,this.handleError(T,S)):this.errorCount=0}),Promise.resolve()}catch(T){return this.handleError(T,S),Promise.reject(T)}}handleError(S,T){this.errorCount++,this.fireError(S,T,this.errorCount)}end(){}}t.IPCMessageWriter=l;class d extends c.AbstractMessageReader{constructor(S){super(),this.onData=new c.Emitter,S.on("close",()=>this.fireClose),S.on("error",T=>this.fireError(T)),S.on("message",T=>{this.onData.fire(T)})}listen(S){return this.onData.event(S)}}t.PortMessageReader=d;class f extends c.AbstractMessageWriter{constructor(S){super(),this.port=S,this.errorCount=0,S.on("close",()=>this.fireClose()),S.on("error",T=>this.fireError(T))}write(S){try{return this.port.postMessage(S),Promise.resolve()}catch(T){return this.handleError(T,S),Promise.reject(T)}}handleError(S,T){this.errorCount++,this.fireError(S,T,this.errorCount)}end(){}}t.PortMessageWriter=f;class p extends c.ReadableStreamMessageReader{constructor(S,T="utf-8"){super((0,r.default)().stream.asReadableStream(S),T)}}t.SocketMessageReader=p;class m extends c.WriteableStreamMessageWriter{constructor(S,T){super((0,r.default)().stream.asWritableStream(S),T),this.socket=S}dispose(){super.dispose(),this.socket.destroy()}}t.SocketMessageWriter=m;class w extends c.ReadableStreamMessageReader{constructor(S,T){super((0,r.default)().stream.asReadableStream(S),T)}}t.StreamMessageReader=w;class E extends c.WriteableStreamMessageWriter{constructor(S,T){super((0,r.default)().stream.asWritableStream(S),T)}}t.StreamMessageWriter=E;const y=process.env.XDG_RUNTIME_DIR,b=new Map([["linux",107],["darwin",103]]);function R(){const N=(0,o.randomBytes)(21).toString("hex");if(process.platform==="win32")return`\\\\.\\pipe\\vscode-jsonrpc-${N}-sock`;let S;y?S=i.join(y,`vscode-ipc-${N}.sock`):S=i.join(s.tmpdir(),`vscode-${N}.sock`);const T=b.get(process.platform);return T!==void 0&&S.length>T&&(0,r.default)().console.warn(`WARNING: IPC handle "${S}" is longer than ${T} characters.`),S}t.generateRandomPipeName=R;function C(N,S="utf-8"){let T;const O=new Promise((W,U)=>{T=W});return new Promise((W,U)=>{let K=(0,a.createServer)(be=>{K.close(),T([new p(be,S),new m(be,S)])});K.on("error",U),K.listen(N,()=>{K.removeListener("error",U),W({onConnected:()=>O})})})}t.createClientPipeTransport=C;function A(N,S="utf-8"){const T=(0,a.createConnection)(N);return[new p(T,S),new m(T,S)]}t.createServerPipeTransport=A;function q(N,S="utf-8"){let T;const O=new Promise((W,U)=>{T=W});return new Promise((W,U)=>{const K=(0,a.createServer)(be=>{K.close(),T([new p(be,S),new m(be,S)])});K.on("error",U),K.listen(N,"127.0.0.1",()=>{K.removeListener("error",U),W({onConnected:()=>O})})})}t.createClientSocketTransport=q;function G(N,S="utf-8"){const T=(0,a.createConnection)(N,"127.0.0.1");return[new p(T,S),new m(T,S)]}t.createServerSocketTransport=G;function Q(N){const S=N;return S.read!==void 0&&S.addListener!==void 0}function J(N){const S=N;return S.write!==void 0&&S.addListener!==void 0}function le(N,S,T,O){T||(T=c.NullLogger);const W=Q(N)?new w(N):N,U=J(S)?new E(S):S;return c.ConnectionStrategy.is(O)&&(O={connectionStrategy:O}),(0,c.createMessageConnection)(W,U,T,O)}t.createMessageConnection=le}(Ec)),Ec}var Ty,c$;function u$(){return c$||(c$=1,Ty=vs()),Ty}var Sc={};function oj(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 Zf={exports:{}},l$;function $y(){return l$||(l$=1,function(t,e){(function(n){{var r=n(oj,e);r!==void 0&&(t.exports=r)}})(function(n,r){Object.defineProperty(r,"__esModule",{value:!0}),r.TextDocument=r.EOL=r.WorkspaceFolder=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=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=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(v){function _(h){return typeof h=="string"}v.is=_})(i||(r.DocumentUri=i={}));var s;(function(v){function _(h){return typeof h=="string"}v.is=_})(s||(r.URI=s={}));var o;(function(v){v.MIN_VALUE=-2147483648,v.MAX_VALUE=2147483647;function _(h){return typeof h=="number"&&v.MIN_VALUE<=h&&h<=v.MAX_VALUE}v.is=_})(o||(r.integer=o={}));var a;(function(v){v.MIN_VALUE=0,v.MAX_VALUE=2147483647;function _(h){return typeof h=="number"&&v.MIN_VALUE<=h&&h<=v.MAX_VALUE}v.is=_})(a||(r.uinteger=a={}));var c;(function(v){function _($,g){return $===Number.MAX_VALUE&&($=a.MAX_VALUE),g===Number.MAX_VALUE&&(g=a.MAX_VALUE),{line:$,character:g}}v.create=_;function h($){var g=$;return F.objectLiteral(g)&&F.uinteger(g.line)&&F.uinteger(g.character)}v.is=h})(c||(r.Position=c={}));var u;(function(v){function _($,g,P,D){if(F.uinteger($)&&F.uinteger(g)&&F.uinteger(P)&&F.uinteger(D))return{start:c.create($,g),end:c.create(P,D)};if(c.is($)&&c.is(g))return{start:$,end:g};throw new Error("Range#create called with invalid arguments[".concat($,", ").concat(g,", ").concat(P,", ").concat(D,"]"))}v.create=_;function h($){var g=$;return F.objectLiteral(g)&&c.is(g.start)&&c.is(g.end)}v.is=h})(u||(r.Range=u={}));var l;(function(v){function _($,g){return{uri:$,range:g}}v.create=_;function h($){var g=$;return F.objectLiteral(g)&&u.is(g.range)&&(F.string(g.uri)||F.undefined(g.uri))}v.is=h})(l||(r.Location=l={}));var d;(function(v){function _($,g,P,D){return{targetUri:$,targetRange:g,targetSelectionRange:P,originSelectionRange:D}}v.create=_;function h($){var g=$;return F.objectLiteral(g)&&u.is(g.targetRange)&&F.string(g.targetUri)&&u.is(g.targetSelectionRange)&&(u.is(g.originSelectionRange)||F.undefined(g.originSelectionRange))}v.is=h})(d||(r.LocationLink=d={}));var f;(function(v){function _($,g,P,D){return{red:$,green:g,blue:P,alpha:D}}v.create=_;function h($){var g=$;return F.objectLiteral(g)&&F.numberRange(g.red,0,1)&&F.numberRange(g.green,0,1)&&F.numberRange(g.blue,0,1)&&F.numberRange(g.alpha,0,1)}v.is=h})(f||(r.Color=f={}));var p;(function(v){function _($,g){return{range:$,color:g}}v.create=_;function h($){var g=$;return F.objectLiteral(g)&&u.is(g.range)&&f.is(g.color)}v.is=h})(p||(r.ColorInformation=p={}));var m;(function(v){function _($,g,P){return{label:$,textEdit:g,additionalTextEdits:P}}v.create=_;function h($){var g=$;return F.objectLiteral(g)&&F.string(g.label)&&(F.undefined(g.textEdit)||G.is(g))&&(F.undefined(g.additionalTextEdits)||F.typedArray(g.additionalTextEdits,G.is))}v.is=h})(m||(r.ColorPresentation=m={}));var w;(function(v){v.Comment="comment",v.Imports="imports",v.Region="region"})(w||(r.FoldingRangeKind=w={}));var E;(function(v){function _($,g,P,D,z,Z){var ne={startLine:$,endLine:g};return F.defined(P)&&(ne.startCharacter=P),F.defined(D)&&(ne.endCharacter=D),F.defined(z)&&(ne.kind=z),F.defined(Z)&&(ne.collapsedText=Z),ne}v.create=_;function h($){var g=$;return F.objectLiteral(g)&&F.uinteger(g.startLine)&&F.uinteger(g.startLine)&&(F.undefined(g.startCharacter)||F.uinteger(g.startCharacter))&&(F.undefined(g.endCharacter)||F.uinteger(g.endCharacter))&&(F.undefined(g.kind)||F.string(g.kind))}v.is=h})(E||(r.FoldingRange=E={}));var y;(function(v){function _($,g){return{location:$,message:g}}v.create=_;function h($){var g=$;return F.defined(g)&&l.is(g.location)&&F.string(g.message)}v.is=h})(y||(r.DiagnosticRelatedInformation=y={}));var b;(function(v){v.Error=1,v.Warning=2,v.Information=3,v.Hint=4})(b||(r.DiagnosticSeverity=b={}));var R;(function(v){v.Unnecessary=1,v.Deprecated=2})(R||(r.DiagnosticTag=R={}));var C;(function(v){function _(h){var $=h;return F.objectLiteral($)&&F.string($.href)}v.is=_})(C||(r.CodeDescription=C={}));var A;(function(v){function _($,g,P,D,z,Z){var ne={range:$,message:g};return F.defined(P)&&(ne.severity=P),F.defined(D)&&(ne.code=D),F.defined(z)&&(ne.source=z),F.defined(Z)&&(ne.relatedInformation=Z),ne}v.create=_;function h($){var g,P=$;return F.defined(P)&&u.is(P.range)&&F.string(P.message)&&(F.number(P.severity)||F.undefined(P.severity))&&(F.integer(P.code)||F.string(P.code)||F.undefined(P.code))&&(F.undefined(P.codeDescription)||F.string((g=P.codeDescription)===null||g===void 0?void 0:g.href))&&(F.string(P.source)||F.undefined(P.source))&&(F.undefined(P.relatedInformation)||F.typedArray(P.relatedInformation,y.is))}v.is=h})(A||(r.Diagnostic=A={}));var q;(function(v){function _($,g){for(var P=[],D=2;D<arguments.length;D++)P[D-2]=arguments[D];var z={title:$,command:g};return F.defined(P)&&P.length>0&&(z.arguments=P),z}v.create=_;function h($){var g=$;return F.defined(g)&&F.string(g.title)&&F.string(g.command)}v.is=h})(q||(r.Command=q={}));var G;(function(v){function _(P,D){return{range:P,newText:D}}v.replace=_;function h(P,D){return{range:{start:P,end:P},newText:D}}v.insert=h;function $(P){return{range:P,newText:""}}v.del=$;function g(P){var D=P;return F.objectLiteral(D)&&F.string(D.newText)&&u.is(D.range)}v.is=g})(G||(r.TextEdit=G={}));var Q;(function(v){function _($,g,P){var D={label:$};return g!==void 0&&(D.needsConfirmation=g),P!==void 0&&(D.description=P),D}v.create=_;function h($){var g=$;return F.objectLiteral(g)&&F.string(g.label)&&(F.boolean(g.needsConfirmation)||g.needsConfirmation===void 0)&&(F.string(g.description)||g.description===void 0)}v.is=h})(Q||(r.ChangeAnnotation=Q={}));var J;(function(v){function _(h){var $=h;return F.string($)}v.is=_})(J||(r.ChangeAnnotationIdentifier=J={}));var le;(function(v){function _(P,D,z){return{range:P,newText:D,annotationId:z}}v.replace=_;function h(P,D,z){return{range:{start:P,end:P},newText:D,annotationId:z}}v.insert=h;function $(P,D){return{range:P,newText:"",annotationId:D}}v.del=$;function g(P){var D=P;return G.is(D)&&(Q.is(D.annotationId)||J.is(D.annotationId))}v.is=g})(le||(r.AnnotatedTextEdit=le={}));var N;(function(v){function _($,g){return{textDocument:$,edits:g}}v.create=_;function h($){var g=$;return F.defined(g)&&pe.is(g.textDocument)&&Array.isArray(g.edits)}v.is=h})(N||(r.TextDocumentEdit=N={}));var S;(function(v){function _($,g,P){var D={kind:"create",uri:$};return g!==void 0&&(g.overwrite!==void 0||g.ignoreIfExists!==void 0)&&(D.options=g),P!==void 0&&(D.annotationId=P),D}v.create=_;function h($){var g=$;return g&&g.kind==="create"&&F.string(g.uri)&&(g.options===void 0||(g.options.overwrite===void 0||F.boolean(g.options.overwrite))&&(g.options.ignoreIfExists===void 0||F.boolean(g.options.ignoreIfExists)))&&(g.annotationId===void 0||J.is(g.annotationId))}v.is=h})(S||(r.CreateFile=S={}));var T;(function(v){function _($,g,P,D){var z={kind:"rename",oldUri:$,newUri:g};return P!==void 0&&(P.overwrite!==void 0||P.ignoreIfExists!==void 0)&&(z.options=P),D!==void 0&&(z.annotationId=D),z}v.create=_;function h($){var g=$;return g&&g.kind==="rename"&&F.string(g.oldUri)&&F.string(g.newUri)&&(g.options===void 0||(g.options.overwrite===void 0||F.boolean(g.options.overwrite))&&(g.options.ignoreIfExists===void 0||F.boolean(g.options.ignoreIfExists)))&&(g.annotationId===void 0||J.is(g.annotationId))}v.is=h})(T||(r.RenameFile=T={}));var O;(function(v){function _($,g,P){var D={kind:"delete",uri:$};return g!==void 0&&(g.recursive!==void 0||g.ignoreIfNotExists!==void 0)&&(D.options=g),P!==void 0&&(D.annotationId=P),D}v.create=_;function h($){var g=$;return g&&g.kind==="delete"&&F.string(g.uri)&&(g.options===void 0||(g.options.recursive===void 0||F.boolean(g.options.recursive))&&(g.options.ignoreIfNotExists===void 0||F.boolean(g.options.ignoreIfNotExists)))&&(g.annotationId===void 0||J.is(g.annotationId))}v.is=h})(O||(r.DeleteFile=O={}));var W;(function(v){function _(h){var $=h;return $&&($.changes!==void 0||$.documentChanges!==void 0)&&($.documentChanges===void 0||$.documentChanges.every(function(g){return F.string(g.kind)?S.is(g)||T.is(g)||O.is(g):N.is(g)}))}v.is=_})(W||(r.WorkspaceEdit=W={}));var U=function(){function v(_,h){this.edits=_,this.changeAnnotations=h}return v.prototype.insert=function(_,h,$){var g,P;if($===void 0?g=G.insert(_,h):J.is($)?(P=$,g=le.insert(_,h,$)):(this.assertChangeAnnotations(this.changeAnnotations),P=this.changeAnnotations.manage($),g=le.insert(_,h,P)),this.edits.push(g),P!==void 0)return P},v.prototype.replace=function(_,h,$){var g,P;if($===void 0?g=G.replace(_,h):J.is($)?(P=$,g=le.replace(_,h,$)):(this.assertChangeAnnotations(this.changeAnnotations),P=this.changeAnnotations.manage($),g=le.replace(_,h,P)),this.edits.push(g),P!==void 0)return P},v.prototype.delete=function(_,h){var $,g;if(h===void 0?$=G.del(_):J.is(h)?(g=h,$=le.del(_,h)):(this.assertChangeAnnotations(this.changeAnnotations),g=this.changeAnnotations.manage(h),$=le.del(_,g)),this.edits.push($),g!==void 0)return g},v.prototype.add=function(_){this.edits.push(_)},v.prototype.all=function(){return this.edits},v.prototype.clear=function(){this.edits.splice(0,this.edits.length)},v.prototype.assertChangeAnnotations=function(_){if(_===void 0)throw new Error("Text edit change is not configured to manage change annotations.")},v}(),K=function(){function v(_){this._annotations=_===void 0?Object.create(null):_,this._counter=0,this._size=0}return v.prototype.all=function(){return this._annotations},Object.defineProperty(v.prototype,"size",{get:function(){return this._size},enumerable:!1,configurable:!0}),v.prototype.manage=function(_,h){var $;if(J.is(_)?$=_:($=this.nextId(),h=_),this._annotations[$]!==void 0)throw new Error("Id ".concat($," is already in use."));if(h===void 0)throw new Error("No annotation provided for id ".concat($));return this._annotations[$]=h,this._size++,$},v.prototype.nextId=function(){return this._counter++,this._counter.toString()},v}(),be=function(){function v(_){var h=this;this._textEditChanges=Object.create(null),_!==void 0?(this._workspaceEdit=_,_.documentChanges?(this._changeAnnotations=new K(_.changeAnnotations),_.changeAnnotations=this._changeAnnotations.all(),_.documentChanges.forEach(function($){if(N.is($)){var g=new U($.edits,h._changeAnnotations);h._textEditChanges[$.textDocument.uri]=g}})):_.changes&&Object.keys(_.changes).forEach(function($){var g=new U(_.changes[$]);h._textEditChanges[$]=g})):this._workspaceEdit={}}return Object.defineProperty(v.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}),v.prototype.getTextEditChange=function(_){if(pe.is(_)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var h={uri:_.uri,version:_.version},$=this._textEditChanges[h.uri];if(!$){var g=[],P={textDocument:h,edits:g};this._workspaceEdit.documentChanges.push(P),$=new U(g,this._changeAnnotations),this._textEditChanges[h.uri]=$}return $}else{if(this.initChanges(),this._workspaceEdit.changes===void 0)throw new Error("Workspace edit is not configured for normal text edit changes.");var $=this._textEditChanges[_];if(!$){var g=[];this._workspaceEdit.changes[_]=g,$=new U(g),this._textEditChanges[_]=$}return $}},v.prototype.initDocumentChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new K,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())},v.prototype.initChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._workspaceEdit.changes=Object.create(null))},v.prototype.createFile=function(_,h,$){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var g;Q.is(h)||J.is(h)?g=h:$=h;var P,D;if(g===void 0?P=S.create(_,$):(D=J.is(g)?g:this._changeAnnotations.manage(g),P=S.create(_,$,D)),this._workspaceEdit.documentChanges.push(P),D!==void 0)return D},v.prototype.renameFile=function(_,h,$,g){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var P;Q.is($)||J.is($)?P=$:g=$;var D,z;if(P===void 0?D=T.create(_,h,g):(z=J.is(P)?P:this._changeAnnotations.manage(P),D=T.create(_,h,g,z)),this._workspaceEdit.documentChanges.push(D),z!==void 0)return z},v.prototype.deleteFile=function(_,h,$){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var g;Q.is(h)||J.is(h)?g=h:$=h;var P,D;if(g===void 0?P=O.create(_,$):(D=J.is(g)?g:this._changeAnnotations.manage(g),P=O.create(_,$,D)),this._workspaceEdit.documentChanges.push(P),D!==void 0)return D},v}();r.WorkspaceChange=be;var ee;(function(v){function _($){return{uri:$}}v.create=_;function h($){var g=$;return F.defined(g)&&F.string(g.uri)}v.is=h})(ee||(r.TextDocumentIdentifier=ee={}));var k;(function(v){function _($,g){return{uri:$,version:g}}v.create=_;function h($){var g=$;return F.defined(g)&&F.string(g.uri)&&F.integer(g.version)}v.is=h})(k||(r.VersionedTextDocumentIdentifier=k={}));var pe;(function(v){function _($,g){return{uri:$,version:g}}v.create=_;function h($){var g=$;return F.defined(g)&&F.string(g.uri)&&(g.version===null||F.integer(g.version))}v.is=h})(pe||(r.OptionalVersionedTextDocumentIdentifier=pe={}));var Qe;(function(v){function _($,g,P,D){return{uri:$,languageId:g,version:P,text:D}}v.create=_;function h($){var g=$;return F.defined(g)&&F.string(g.uri)&&F.string(g.languageId)&&F.integer(g.version)&&F.string(g.text)}v.is=h})(Qe||(r.TextDocumentItem=Qe={}));var ct;(function(v){v.PlainText="plaintext",v.Markdown="markdown";function _(h){var $=h;return $===v.PlainText||$===v.Markdown}v.is=_})(ct||(r.MarkupKind=ct={}));var j;(function(v){function _(h){var $=h;return F.objectLiteral(h)&&ct.is($.kind)&&F.string($.value)}v.is=_})(j||(r.MarkupContent=j={}));var V;(function(v){v.Text=1,v.Method=2,v.Function=3,v.Constructor=4,v.Field=5,v.Variable=6,v.Class=7,v.Interface=8,v.Module=9,v.Property=10,v.Unit=11,v.Value=12,v.Enum=13,v.Keyword=14,v.Snippet=15,v.Color=16,v.File=17,v.Reference=18,v.Folder=19,v.EnumMember=20,v.Constant=21,v.Struct=22,v.Event=23,v.Operator=24,v.TypeParameter=25})(V||(r.CompletionItemKind=V={}));var _e;(function(v){v.PlainText=1,v.Snippet=2})(_e||(r.InsertTextFormat=_e={}));var ie;(function(v){v.Deprecated=1})(ie||(r.CompletionItemTag=ie={}));var ve;(function(v){function _($,g,P){return{newText:$,insert:g,replace:P}}v.create=_;function h($){var g=$;return g&&F.string(g.newText)&&u.is(g.insert)&&u.is(g.replace)}v.is=h})(ve||(r.InsertReplaceEdit=ve={}));var Te;(function(v){v.asIs=1,v.adjustIndentation=2})(Te||(r.InsertTextMode=Te={}));var se;(function(v){function _(h){var $=h;return $&&(F.string($.detail)||$.detail===void 0)&&(F.string($.description)||$.description===void 0)}v.is=_})(se||(r.CompletionItemLabelDetails=se={}));var I;(function(v){function _(h){return{label:h}}v.create=_})(I||(r.CompletionItem=I={}));var M;(function(v){function _(h,$){return{items:h||[],isIncomplete:!!$}}v.create=_})(M||(r.CompletionList=M={}));var ue;(function(v){function _($){return $.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}v.fromPlainText=_;function h($){var g=$;return F.string(g)||F.objectLiteral(g)&&F.string(g.language)&&F.string(g.value)}v.is=h})(ue||(r.MarkedString=ue={}));var B;(function(v){function _(h){var $=h;return!!$&&F.objectLiteral($)&&(j.is($.contents)||ue.is($.contents)||F.typedArray($.contents,ue.is))&&(h.range===void 0||u.is(h.range))}v.is=_})(B||(r.Hover=B={}));var oe;(function(v){function _(h,$){return $?{label:h,documentation:$}:{label:h}}v.create=_})(oe||(r.ParameterInformation=oe={}));var Le;(function(v){function _(h,$){for(var g=[],P=2;P<arguments.length;P++)g[P-2]=arguments[P];var D={label:h};return F.defined($)&&(D.documentation=$),F.defined(g)?D.parameters=g:D.parameters=[],D}v.create=_})(Le||(r.SignatureInformation=Le={}));var Ke;(function(v){v.Text=1,v.Read=2,v.Write=3})(Ke||(r.DocumentHighlightKind=Ke={}));var re;(function(v){function _(h,$){var g={range:h};return F.number($)&&(g.kind=$),g}v.create=_})(re||(r.DocumentHighlight=re={}));var Ce;(function(v){v.File=1,v.Module=2,v.Namespace=3,v.Package=4,v.Class=5,v.Method=6,v.Property=7,v.Field=8,v.Constructor=9,v.Enum=10,v.Interface=11,v.Function=12,v.Variable=13,v.Constant=14,v.String=15,v.Number=16,v.Boolean=17,v.Array=18,v.Object=19,v.Key=20,v.Null=21,v.EnumMember=22,v.Struct=23,v.Event=24,v.Operator=25,v.TypeParameter=26})(Ce||(r.SymbolKind=Ce={}));var te;(function(v){v.Deprecated=1})(te||(r.SymbolTag=te={}));var we;(function(v){function _(h,$,g,P,D){var z={name:h,kind:$,location:{uri:P,range:g}};return D&&(z.containerName=D),z}v.create=_})(we||(r.SymbolInformation=we={}));var Oe;(function(v){function _(h,$,g,P){return P!==void 0?{name:h,kind:$,location:{uri:g,range:P}}:{name:h,kind:$,location:{uri:g}}}v.create=_})(Oe||(r.WorkspaceSymbol=Oe={}));var ut;(function(v){function _($,g,P,D,z,Z){var ne={name:$,detail:g,kind:P,range:D,selectionRange:z};return Z!==void 0&&(ne.children=Z),ne}v.create=_;function h($){var g=$;return g&&F.string(g.name)&&F.number(g.kind)&&u.is(g.range)&&u.is(g.selectionRange)&&(g.detail===void 0||F.string(g.detail))&&(g.deprecated===void 0||F.boolean(g.deprecated))&&(g.children===void 0||Array.isArray(g.children))&&(g.tags===void 0||Array.isArray(g.tags))}v.is=h})(ut||(r.DocumentSymbol=ut={}));var Ge;(function(v){v.Empty="",v.QuickFix="quickfix",v.Refactor="refactor",v.RefactorExtract="refactor.extract",v.RefactorInline="refactor.inline",v.RefactorRewrite="refactor.rewrite",v.Source="source",v.SourceOrganizeImports="source.organizeImports",v.SourceFixAll="source.fixAll"})(Ge||(r.CodeActionKind=Ge={}));var Ft;(function(v){v.Invoked=1,v.Automatic=2})(Ft||(r.CodeActionTriggerKind=Ft={}));var Bt;(function(v){function _($,g,P){var D={diagnostics:$};return g!=null&&(D.only=g),P!=null&&(D.triggerKind=P),D}v.create=_;function h($){var g=$;return F.defined(g)&&F.typedArray(g.diagnostics,A.is)&&(g.only===void 0||F.typedArray(g.only,F.string))&&(g.triggerKind===void 0||g.triggerKind===Ft.Invoked||g.triggerKind===Ft.Automatic)}v.is=h})(Bt||(r.CodeActionContext=Bt={}));var tn;(function(v){function _($,g,P){var D={title:$},z=!0;return typeof g=="string"?(z=!1,D.kind=g):q.is(g)?D.command=g:D.edit=g,z&&P!==void 0&&(D.kind=P),D}v.create=_;function h($){var g=$;return g&&F.string(g.title)&&(g.diagnostics===void 0||F.typedArray(g.diagnostics,A.is))&&(g.kind===void 0||F.string(g.kind))&&(g.edit!==void 0||g.command!==void 0)&&(g.command===void 0||q.is(g.command))&&(g.isPreferred===void 0||F.boolean(g.isPreferred))&&(g.edit===void 0||W.is(g.edit))}v.is=h})(tn||(r.CodeAction=tn={}));var Y;(function(v){function _($,g){var P={range:$};return F.defined(g)&&(P.data=g),P}v.create=_;function h($){var g=$;return F.defined(g)&&u.is(g.range)&&(F.undefined(g.command)||q.is(g.command))}v.is=h})(Y||(r.CodeLens=Y={}));var X;(function(v){function _($,g){return{tabSize:$,insertSpaces:g}}v.create=_;function h($){var g=$;return F.defined(g)&&F.uinteger(g.tabSize)&&F.boolean(g.insertSpaces)}v.is=h})(X||(r.FormattingOptions=X={}));var de;(function(v){function _($,g,P){return{range:$,target:g,data:P}}v.create=_;function h($){var g=$;return F.defined(g)&&u.is(g.range)&&(F.undefined(g.target)||F.string(g.target))}v.is=h})(de||(r.DocumentLink=de={}));var zt;(function(v){function _($,g){return{range:$,parent:g}}v.create=_;function h($){var g=$;return F.objectLiteral(g)&&u.is(g.range)&&(g.parent===void 0||v.is(g.parent))}v.is=h})(zt||(r.SelectionRange=zt={}));var Lt;(function(v){v.namespace="namespace",v.type="type",v.class="class",v.enum="enum",v.interface="interface",v.struct="struct",v.typeParameter="typeParameter",v.parameter="parameter",v.variable="variable",v.property="property",v.enumMember="enumMember",v.event="event",v.function="function",v.method="method",v.macro="macro",v.keyword="keyword",v.modifier="modifier",v.comment="comment",v.string="string",v.number="number",v.regexp="regexp",v.operator="operator",v.decorator="decorator"})(Lt||(r.SemanticTokenTypes=Lt={}));var cr;(function(v){v.declaration="declaration",v.definition="definition",v.readonly="readonly",v.static="static",v.deprecated="deprecated",v.abstract="abstract",v.async="async",v.modification="modification",v.documentation="documentation",v.defaultLibrary="defaultLibrary"})(cr||(r.SemanticTokenModifiers=cr={}));var ai;(function(v){function _(h){var $=h;return F.objectLiteral($)&&($.resultId===void 0||typeof $.resultId=="string")&&Array.isArray($.data)&&($.data.length===0||typeof $.data[0]=="number")}v.is=_})(ai||(r.SemanticTokens=ai={}));var qi;(function(v){function _($,g){return{range:$,text:g}}v.create=_;function h($){var g=$;return g!=null&&u.is(g.range)&&F.string(g.text)}v.is=h})(qi||(r.InlineValueText=qi={}));var ji;(function(v){function _($,g,P){return{range:$,variableName:g,caseSensitiveLookup:P}}v.create=_;function h($){var g=$;return g!=null&&u.is(g.range)&&F.boolean(g.caseSensitiveLookup)&&(F.string(g.variableName)||g.variableName===void 0)}v.is=h})(ji||(r.InlineValueVariableLookup=ji={}));var Ui;(function(v){function _($,g){return{range:$,expression:g}}v.create=_;function h($){var g=$;return g!=null&&u.is(g.range)&&(F.string(g.expression)||g.expression===void 0)}v.is=h})(Ui||(r.InlineValueEvaluatableExpression=Ui={}));var Gi;(function(v){function _($,g){return{frameId:$,stoppedLocation:g}}v.create=_;function h($){var g=$;return F.defined(g)&&u.is($.stoppedLocation)}v.is=h})(Gi||(r.InlineValueContext=Gi={}));var ci;(function(v){v.Type=1,v.Parameter=2;function _(h){return h===1||h===2}v.is=_})(ci||(r.InlayHintKind=ci={}));var ui;(function(v){function _($){return{value:$}}v.create=_;function h($){var g=$;return F.objectLiteral(g)&&(g.tooltip===void 0||F.string(g.tooltip)||j.is(g.tooltip))&&(g.location===void 0||l.is(g.location))&&(g.command===void 0||q.is(g.command))}v.is=h})(ui||(r.InlayHintLabelPart=ui={}));var gn;(function(v){function _($,g,P){var D={position:$,label:g};return P!==void 0&&(D.kind=P),D}v.create=_;function h($){var g=$;return F.objectLiteral(g)&&c.is(g.position)&&(F.string(g.label)||F.typedArray(g.label,ui.is))&&(g.kind===void 0||ci.is(g.kind))&&g.textEdits===void 0||F.typedArray(g.textEdits,G.is)&&(g.tooltip===void 0||F.string(g.tooltip)||j.is(g.tooltip))&&(g.paddingLeft===void 0||F.boolean(g.paddingLeft))&&(g.paddingRight===void 0||F.boolean(g.paddingRight))}v.is=h})(gn||(r.InlayHint=gn={}));var Wi;(function(v){function _(h){return{kind:"snippet",value:h}}v.createSnippet=_})(Wi||(r.StringValue=Wi={}));var Hi;(function(v){function _(h,$,g,P){return{insertText:h,filterText:$,range:g,command:P}}v.create=_})(Hi||(r.InlineCompletionItem=Hi={}));var ur;(function(v){function _(h){return{items:h}}v.create=_})(ur||(r.InlineCompletionList=ur={}));var Vi;(function(v){v.Invoked=0,v.Automatic=1})(Vi||(r.InlineCompletionTriggerKind=Vi={}));var _r;(function(v){function _(h,$){return{range:h,text:$}}v.create=_})(_r||(r.SelectedCompletionInfo=_r={}));var Ki;(function(v){function _(h,$){return{triggerKind:h,selectedCompletionInfo:$}}v.create=_})(Ki||(r.InlineCompletionContext=Ki={}));var Ln;(function(v){function _(h){var $=h;return F.objectLiteral($)&&s.is($.uri)&&F.string($.name)}v.is=_})(Ln||(r.WorkspaceFolder=Ln={})),r.EOL=[`
|
|
156
|
+
`,`\r
|
|
157
|
+
`,"\r"];var Vn;(function(v){function _(P,D,z,Z){return new Ks(P,D,z,Z)}v.create=_;function h(P){var D=P;return!!(F.defined(D)&&F.string(D.uri)&&(F.undefined(D.languageId)||F.string(D.languageId))&&F.uinteger(D.lineCount)&&F.func(D.getText)&&F.func(D.positionAt)&&F.func(D.offsetAt))}v.is=h;function $(P,D){for(var z=P.getText(),Z=g(D,function(ke,Ze){var He=ke.range.start.line-Ze.range.start.line;return He===0?ke.range.start.character-Ze.range.start.character:He}),ne=z.length,Ne=Z.length-1;Ne>=0;Ne--){var Pe=Z[Ne],We=P.offsetAt(Pe.range.start),he=P.offsetAt(Pe.range.end);if(he<=ne)z=z.substring(0,We)+Pe.newText+z.substring(he,z.length);else throw new Error("Overlapping edit");ne=We}return z}v.applyEdits=$;function g(P,D){if(P.length<=1)return P;var z=P.length/2|0,Z=P.slice(0,z),ne=P.slice(z);g(Z,D),g(ne,D);for(var Ne=0,Pe=0,We=0;Ne<Z.length&&Pe<ne.length;){var he=D(Z[Ne],ne[Pe]);he<=0?P[We++]=Z[Ne++]:P[We++]=ne[Pe++]}for(;Ne<Z.length;)P[We++]=Z[Ne++];for(;Pe<ne.length;)P[We++]=ne[Pe++];return P}})(Vn||(r.TextDocument=Vn={}));var Ks=function(){function v(_,h,$,g){this._uri=_,this._languageId=h,this._version=$,this._content=g,this._lineOffsets=void 0}return Object.defineProperty(v.prototype,"uri",{get:function(){return this._uri},enumerable:!1,configurable:!0}),Object.defineProperty(v.prototype,"languageId",{get:function(){return this._languageId},enumerable:!1,configurable:!0}),Object.defineProperty(v.prototype,"version",{get:function(){return this._version},enumerable:!1,configurable:!0}),v.prototype.getText=function(_){if(_){var h=this.offsetAt(_.start),$=this.offsetAt(_.end);return this._content.substring(h,$)}return this._content},v.prototype.update=function(_,h){this._content=_.text,this._version=h,this._lineOffsets=void 0},v.prototype.getLineOffsets=function(){if(this._lineOffsets===void 0){for(var _=[],h=this._content,$=!0,g=0;g<h.length;g++){$&&(_.push(g),$=!1);var P=h.charAt(g);$=P==="\r"||P===`
|
|
158
|
+
`,P==="\r"&&g+1<h.length&&h.charAt(g+1)===`
|
|
159
|
+
`&&g++}$&&h.length>0&&_.push(h.length),this._lineOffsets=_}return this._lineOffsets},v.prototype.positionAt=function(_){_=Math.max(Math.min(_,this._content.length),0);var h=this.getLineOffsets(),$=0,g=h.length;if(g===0)return c.create(0,_);for(;$<g;){var P=Math.floor(($+g)/2);h[P]>_?g=P:$=P+1}var D=$-1;return c.create(D,_-h[D])},v.prototype.offsetAt=function(_){var h=this.getLineOffsets();if(_.line>=h.length)return this._content.length;if(_.line<0)return 0;var $=h[_.line],g=_.line+1<h.length?h[_.line+1]:this._content.length;return Math.max(Math.min($+_.character,g),$)},Object.defineProperty(v.prototype,"lineCount",{get:function(){return this.getLineOffsets().length},enumerable:!1,configurable:!0}),v}(),F;(function(v){var _=Object.prototype.toString;function h(he){return typeof he<"u"}v.defined=h;function $(he){return typeof he>"u"}v.undefined=$;function g(he){return he===!0||he===!1}v.boolean=g;function P(he){return _.call(he)==="[object String]"}v.string=P;function D(he){return _.call(he)==="[object Number]"}v.number=D;function z(he,ke,Ze){return _.call(he)==="[object Number]"&&ke<=he&&he<=Ze}v.numberRange=z;function Z(he){return _.call(he)==="[object Number]"&&-2147483648<=he&&he<=2147483647}v.integer=Z;function ne(he){return _.call(he)==="[object Number]"&&0<=he&&he<=2147483647}v.uinteger=ne;function Ne(he){return _.call(he)==="[object Function]"}v.func=Ne;function Pe(he){return he!==null&&typeof he=="object"}v.objectLiteral=Pe;function We(he,ke){return Array.isArray(he)&&he.every(ke)}v.typedArray=We})(F||(F={}))})}(Zf,Zf.exports)),Zf.exports}var ln={},d$;function vt(){if(d$)return ln;d$=1,Object.defineProperty(ln,"__esModule",{value:!0}),ln.ProtocolNotificationType=ln.ProtocolNotificationType0=ln.ProtocolRequestType=ln.ProtocolRequestType0=ln.RegistrationType=ln.MessageDirection=void 0;const t=vs();var e;(function(a){a.clientToServer="clientToServer",a.serverToClient="serverToClient",a.both="both"})(e||(ln.MessageDirection=e={}));class n{constructor(c){this.method=c}}ln.RegistrationType=n;class r extends t.RequestType0{constructor(c){super(c)}}ln.ProtocolRequestType0=r;class i extends t.RequestType{constructor(c){super(c,t.ParameterStructures.byName)}}ln.ProtocolRequestType=i;class s extends t.NotificationType0{constructor(c){super(c)}}ln.ProtocolNotificationType0=s;class o extends t.NotificationType{constructor(c){super(c,t.ParameterStructures.byName)}}return ln.ProtocolNotificationType=o,ln}var Sy={},$t={},f$;function Cy(){if(f$)return $t;f$=1,Object.defineProperty($t,"__esModule",{value:!0}),$t.objectLiteral=$t.typedArray=$t.stringArray=$t.array=$t.func=$t.error=$t.number=$t.string=$t.boolean=void 0;function t(u){return u===!0||u===!1}$t.boolean=t;function e(u){return typeof u=="string"||u instanceof String}$t.string=e;function n(u){return typeof u=="number"||u instanceof Number}$t.number=n;function r(u){return u instanceof Error}$t.error=r;function i(u){return typeof u=="function"}$t.func=i;function s(u){return Array.isArray(u)}$t.array=s;function o(u){return s(u)&&u.every(l=>e(l))}$t.stringArray=o;function a(u,l){return Array.isArray(u)&&u.every(l)}$t.typedArray=a;function c(u){return u!==null&&typeof u=="object"}return $t.objectLiteral=c,$t}var Cc={},p$;function aj(){if(p$)return Cc;p$=1,Object.defineProperty(Cc,"__esModule",{value:!0}),Cc.ImplementationRequest=void 0;const t=vt();var e;return function(n){n.method="textDocument/implementation",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method)}(e||(Cc.ImplementationRequest=e={})),Cc}var kc={},h$;function cj(){if(h$)return kc;h$=1,Object.defineProperty(kc,"__esModule",{value:!0}),kc.TypeDefinitionRequest=void 0;const t=vt();var e;return function(n){n.method="textDocument/typeDefinition",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method)}(e||(kc.TypeDefinitionRequest=e={})),kc}var ws={},m$;function uj(){if(m$)return ws;m$=1,Object.defineProperty(ws,"__esModule",{value:!0}),ws.DidChangeWorkspaceFoldersNotification=ws.WorkspaceFoldersRequest=void 0;const t=vt();var e;(function(r){r.method="workspace/workspaceFolders",r.messageDirection=t.MessageDirection.serverToClient,r.type=new t.ProtocolRequestType0(r.method)})(e||(ws.WorkspaceFoldersRequest=e={}));var n;return function(r){r.method="workspace/didChangeWorkspaceFolders",r.messageDirection=t.MessageDirection.clientToServer,r.type=new t.ProtocolNotificationType(r.method)}(n||(ws.DidChangeWorkspaceFoldersNotification=n={})),ws}var Ac={},g$;function lj(){if(g$)return Ac;g$=1,Object.defineProperty(Ac,"__esModule",{value:!0}),Ac.ConfigurationRequest=void 0;const t=vt();var e;return function(n){n.method="workspace/configuration",n.messageDirection=t.MessageDirection.serverToClient,n.type=new t.ProtocolRequestType(n.method)}(e||(Ac.ConfigurationRequest=e={})),Ac}var bs={},y$;function dj(){if(y$)return bs;y$=1,Object.defineProperty(bs,"__esModule",{value:!0}),bs.ColorPresentationRequest=bs.DocumentColorRequest=void 0;const t=vt();var e;(function(r){r.method="textDocument/documentColor",r.messageDirection=t.MessageDirection.clientToServer,r.type=new t.ProtocolRequestType(r.method)})(e||(bs.DocumentColorRequest=e={}));var n;return function(r){r.method="textDocument/colorPresentation",r.messageDirection=t.MessageDirection.clientToServer,r.type=new t.ProtocolRequestType(r.method)}(n||(bs.ColorPresentationRequest=n={})),bs}var Ds={},v$;function fj(){if(v$)return Ds;v$=1,Object.defineProperty(Ds,"__esModule",{value:!0}),Ds.FoldingRangeRefreshRequest=Ds.FoldingRangeRequest=void 0;const t=vt();var e;(function(r){r.method="textDocument/foldingRange",r.messageDirection=t.MessageDirection.clientToServer,r.type=new t.ProtocolRequestType(r.method)})(e||(Ds.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||(Ds.FoldingRangeRefreshRequest=n={})),Ds}var _c={},w$;function pj(){if(w$)return _c;w$=1,Object.defineProperty(_c,"__esModule",{value:!0}),_c.DeclarationRequest=void 0;const t=vt();var e;return function(n){n.method="textDocument/declaration",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method)}(e||(_c.DeclarationRequest=e={})),_c}var Pc={},b$;function hj(){if(b$)return Pc;b$=1,Object.defineProperty(Pc,"__esModule",{value:!0}),Pc.SelectionRangeRequest=void 0;const t=vt();var e;return function(n){n.method="textDocument/selectionRange",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method)}(e||(Pc.SelectionRangeRequest=e={})),Pc}var Yr={},D$;function mj(){if(D$)return Yr;D$=1,Object.defineProperty(Yr,"__esModule",{value:!0}),Yr.WorkDoneProgressCancelNotification=Yr.WorkDoneProgressCreateRequest=Yr.WorkDoneProgress=void 0;const t=vs(),e=vt();var n;(function(s){s.type=new t.ProgressType;function o(a){return a===s.type}s.is=o})(n||(Yr.WorkDoneProgress=n={}));var r;(function(s){s.method="window/workDoneProgress/create",s.messageDirection=e.MessageDirection.serverToClient,s.type=new e.ProtocolRequestType(s.method)})(r||(Yr.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||(Yr.WorkDoneProgressCancelNotification=i={})),Yr}var Xr={},E$;function gj(){if(E$)return Xr;E$=1,Object.defineProperty(Xr,"__esModule",{value:!0}),Xr.CallHierarchyOutgoingCallsRequest=Xr.CallHierarchyIncomingCallsRequest=Xr.CallHierarchyPrepareRequest=void 0;const t=vt();var e;(function(i){i.method="textDocument/prepareCallHierarchy",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)})(e||(Xr.CallHierarchyPrepareRequest=e={}));var n;(function(i){i.method="callHierarchy/incomingCalls",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)})(n||(Xr.CallHierarchyIncomingCallsRequest=n={}));var r;return function(i){i.method="callHierarchy/outgoingCalls",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)}(r||(Xr.CallHierarchyOutgoingCallsRequest=r={})),Xr}var dn={},R$;function yj(){if(R$)return dn;R$=1,Object.defineProperty(dn,"__esModule",{value:!0}),dn.SemanticTokensRefreshRequest=dn.SemanticTokensRangeRequest=dn.SemanticTokensDeltaRequest=dn.SemanticTokensRequest=dn.SemanticTokensRegistrationType=dn.TokenFormat=void 0;const t=vt();var e;(function(a){a.Relative="relative"})(e||(dn.TokenFormat=e={}));var n;(function(a){a.method="textDocument/semanticTokens",a.type=new t.RegistrationType(a.method)})(n||(dn.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||(dn.SemanticTokensRequest=r={}));var i;(function(a){a.method="textDocument/semanticTokens/full/delta",a.messageDirection=t.MessageDirection.clientToServer,a.type=new t.ProtocolRequestType(a.method),a.registrationMethod=n.method})(i||(dn.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||(dn.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||(dn.SemanticTokensRefreshRequest=o={})),dn}var Ic={},T$;function vj(){if(T$)return Ic;T$=1,Object.defineProperty(Ic,"__esModule",{value:!0}),Ic.ShowDocumentRequest=void 0;const t=vt();var e;return function(n){n.method="window/showDocument",n.messageDirection=t.MessageDirection.serverToClient,n.type=new t.ProtocolRequestType(n.method)}(e||(Ic.ShowDocumentRequest=e={})),Ic}var xc={},$$;function wj(){if($$)return xc;$$=1,Object.defineProperty(xc,"__esModule",{value:!0}),xc.LinkedEditingRangeRequest=void 0;const t=vt();var e;return function(n){n.method="textDocument/linkedEditingRange",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method)}(e||(xc.LinkedEditingRangeRequest=e={})),xc}var Vt={},S$;function bj(){if(S$)return Vt;S$=1,Object.defineProperty(Vt,"__esModule",{value:!0}),Vt.WillDeleteFilesRequest=Vt.DidDeleteFilesNotification=Vt.DidRenameFilesNotification=Vt.WillRenameFilesRequest=Vt.DidCreateFilesNotification=Vt.WillCreateFilesRequest=Vt.FileOperationPatternKind=void 0;const t=vt();var e;(function(c){c.file="file",c.folder="folder"})(e||(Vt.FileOperationPatternKind=e={}));var n;(function(c){c.method="workspace/willCreateFiles",c.messageDirection=t.MessageDirection.clientToServer,c.type=new t.ProtocolRequestType(c.method)})(n||(Vt.WillCreateFilesRequest=n={}));var r;(function(c){c.method="workspace/didCreateFiles",c.messageDirection=t.MessageDirection.clientToServer,c.type=new t.ProtocolNotificationType(c.method)})(r||(Vt.DidCreateFilesNotification=r={}));var i;(function(c){c.method="workspace/willRenameFiles",c.messageDirection=t.MessageDirection.clientToServer,c.type=new t.ProtocolRequestType(c.method)})(i||(Vt.WillRenameFilesRequest=i={}));var s;(function(c){c.method="workspace/didRenameFiles",c.messageDirection=t.MessageDirection.clientToServer,c.type=new t.ProtocolNotificationType(c.method)})(s||(Vt.DidRenameFilesNotification=s={}));var o;(function(c){c.method="workspace/didDeleteFiles",c.messageDirection=t.MessageDirection.clientToServer,c.type=new t.ProtocolNotificationType(c.method)})(o||(Vt.DidDeleteFilesNotification=o={}));var a;return function(c){c.method="workspace/willDeleteFiles",c.messageDirection=t.MessageDirection.clientToServer,c.type=new t.ProtocolRequestType(c.method)}(a||(Vt.WillDeleteFilesRequest=a={})),Vt}var Jr={},C$;function Dj(){if(C$)return Jr;C$=1,Object.defineProperty(Jr,"__esModule",{value:!0}),Jr.MonikerRequest=Jr.MonikerKind=Jr.UniquenessLevel=void 0;const t=vt();var e;(function(i){i.document="document",i.project="project",i.group="group",i.scheme="scheme",i.global="global"})(e||(Jr.UniquenessLevel=e={}));var n;(function(i){i.$import="import",i.$export="export",i.local="local"})(n||(Jr.MonikerKind=n={}));var r;return function(i){i.method="textDocument/moniker",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)}(r||(Jr.MonikerRequest=r={})),Jr}var Qr={},k$;function Ej(){if(k$)return Qr;k$=1,Object.defineProperty(Qr,"__esModule",{value:!0}),Qr.TypeHierarchySubtypesRequest=Qr.TypeHierarchySupertypesRequest=Qr.TypeHierarchyPrepareRequest=void 0;const t=vt();var e;(function(i){i.method="textDocument/prepareTypeHierarchy",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)})(e||(Qr.TypeHierarchyPrepareRequest=e={}));var n;(function(i){i.method="typeHierarchy/supertypes",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)})(n||(Qr.TypeHierarchySupertypesRequest=n={}));var r;return function(i){i.method="typeHierarchy/subtypes",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)}(r||(Qr.TypeHierarchySubtypesRequest=r={})),Qr}var Es={},A$;function Rj(){if(A$)return Es;A$=1,Object.defineProperty(Es,"__esModule",{value:!0}),Es.InlineValueRefreshRequest=Es.InlineValueRequest=void 0;const t=vt();var e;(function(r){r.method="textDocument/inlineValue",r.messageDirection=t.MessageDirection.clientToServer,r.type=new t.ProtocolRequestType(r.method)})(e||(Es.InlineValueRequest=e={}));var n;return function(r){r.method="workspace/inlineValue/refresh",r.messageDirection=t.MessageDirection.serverToClient,r.type=new t.ProtocolRequestType0(r.method)}(n||(Es.InlineValueRefreshRequest=n={})),Es}var Zr={},_$;function Tj(){if(_$)return Zr;_$=1,Object.defineProperty(Zr,"__esModule",{value:!0}),Zr.InlayHintRefreshRequest=Zr.InlayHintResolveRequest=Zr.InlayHintRequest=void 0;const t=vt();var e;(function(i){i.method="textDocument/inlayHint",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)})(e||(Zr.InlayHintRequest=e={}));var n;(function(i){i.method="inlayHint/resolve",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)})(n||(Zr.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||(Zr.InlayHintRefreshRequest=r={})),Zr}var In={},P$;function $j(){if(P$)return In;P$=1,Object.defineProperty(In,"__esModule",{value:!0}),In.DiagnosticRefreshRequest=In.WorkspaceDiagnosticRequest=In.DocumentDiagnosticRequest=In.DocumentDiagnosticReportKind=In.DiagnosticServerCancellationData=void 0;const t=vs(),e=Cy(),n=vt();var r;(function(c){function u(l){const d=l;return d&&e.boolean(d.retriggerRequest)}c.is=u})(r||(In.DiagnosticServerCancellationData=r={}));var i;(function(c){c.Full="full",c.Unchanged="unchanged"})(i||(In.DocumentDiagnosticReportKind=i={}));var s;(function(c){c.method="textDocument/diagnostic",c.messageDirection=n.MessageDirection.clientToServer,c.type=new n.ProtocolRequestType(c.method),c.partialResult=new t.ProgressType})(s||(In.DocumentDiagnosticRequest=s={}));var o;(function(c){c.method="workspace/diagnostic",c.messageDirection=n.MessageDirection.clientToServer,c.type=new n.ProtocolRequestType(c.method),c.partialResult=new t.ProgressType})(o||(In.WorkspaceDiagnosticRequest=o={}));var a;return function(c){c.method="workspace/diagnostic/refresh",c.messageDirection=n.MessageDirection.serverToClient,c.type=new n.ProtocolRequestType0(c.method)}(a||(In.DiagnosticRefreshRequest=a={})),In}var wt={},I$;function Sj(){if(I$)return wt;I$=1,Object.defineProperty(wt,"__esModule",{value:!0}),wt.DidCloseNotebookDocumentNotification=wt.DidSaveNotebookDocumentNotification=wt.DidChangeNotebookDocumentNotification=wt.NotebookCellArrayChange=wt.DidOpenNotebookDocumentNotification=wt.NotebookDocumentSyncRegistrationType=wt.NotebookDocument=wt.NotebookCell=wt.ExecutionSummary=wt.NotebookCellKind=void 0;const t=$y(),e=Cy(),n=vt();var r;(function(p){p.Markup=1,p.Code=2;function m(w){return w===1||w===2}p.is=m})(r||(wt.NotebookCellKind=r={}));var i;(function(p){function m(y,b){const R={executionOrder:y};return(b===!0||b===!1)&&(R.success=b),R}p.create=m;function w(y){const b=y;return e.objectLiteral(b)&&t.uinteger.is(b.executionOrder)&&(b.success===void 0||e.boolean(b.success))}p.is=w;function E(y,b){return y===b?!0:y==null||b===null||b===void 0?!1:y.executionOrder===b.executionOrder&&y.success===b.success}p.equals=E})(i||(wt.ExecutionSummary=i={}));var s;(function(p){function m(b,R){return{kind:b,document:R}}p.create=m;function w(b){const R=b;return e.objectLiteral(R)&&r.is(R.kind)&&t.DocumentUri.is(R.document)&&(R.metadata===void 0||e.objectLiteral(R.metadata))}p.is=w;function E(b,R){const C=new Set;return b.document!==R.document&&C.add("document"),b.kind!==R.kind&&C.add("kind"),b.executionSummary!==R.executionSummary&&C.add("executionSummary"),(b.metadata!==void 0||R.metadata!==void 0)&&!y(b.metadata,R.metadata)&&C.add("metadata"),(b.executionSummary!==void 0||R.executionSummary!==void 0)&&!i.equals(b.executionSummary,R.executionSummary)&&C.add("executionSummary"),C}p.diff=E;function y(b,R){if(b===R)return!0;if(b==null||R===null||R===void 0||typeof b!=typeof R||typeof b!="object")return!1;const C=Array.isArray(b),A=Array.isArray(R);if(C!==A)return!1;if(C&&A){if(b.length!==R.length)return!1;for(let q=0;q<b.length;q++)if(!y(b[q],R[q]))return!1}if(e.objectLiteral(b)&&e.objectLiteral(R)){const q=Object.keys(b),G=Object.keys(R);if(q.length!==G.length||(q.sort(),G.sort(),!y(q,G)))return!1;for(let Q=0;Q<q.length;Q++){const J=q[Q];if(!y(b[J],R[J]))return!1}}return!0}})(s||(wt.NotebookCell=s={}));var o;(function(p){function m(E,y,b,R){return{uri:E,notebookType:y,version:b,cells:R}}p.create=m;function w(E){const y=E;return e.objectLiteral(y)&&e.string(y.uri)&&t.integer.is(y.version)&&e.typedArray(y.cells,s.is)}p.is=w})(o||(wt.NotebookDocument=o={}));var a;(function(p){p.method="notebookDocument/sync",p.messageDirection=n.MessageDirection.clientToServer,p.type=new n.RegistrationType(p.method)})(a||(wt.NotebookDocumentSyncRegistrationType=a={}));var c;(function(p){p.method="notebookDocument/didOpen",p.messageDirection=n.MessageDirection.clientToServer,p.type=new n.ProtocolNotificationType(p.method),p.registrationMethod=a.method})(c||(wt.DidOpenNotebookDocumentNotification=c={}));var u;(function(p){function m(E){const y=E;return e.objectLiteral(y)&&t.uinteger.is(y.start)&&t.uinteger.is(y.deleteCount)&&(y.cells===void 0||e.typedArray(y.cells,s.is))}p.is=m;function w(E,y,b){const R={start:E,deleteCount:y};return b!==void 0&&(R.cells=b),R}p.create=w})(u||(wt.NotebookCellArrayChange=u={}));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||(wt.DidChangeNotebookDocumentNotification=l={}));var d;(function(p){p.method="notebookDocument/didSave",p.messageDirection=n.MessageDirection.clientToServer,p.type=new n.ProtocolNotificationType(p.method),p.registrationMethod=a.method})(d||(wt.DidSaveNotebookDocumentNotification=d={}));var f;return function(p){p.method="notebookDocument/didClose",p.messageDirection=n.MessageDirection.clientToServer,p.type=new n.ProtocolNotificationType(p.method),p.registrationMethod=a.method}(f||(wt.DidCloseNotebookDocumentNotification=f={})),wt}var Oc={},x$;function Cj(){if(x$)return Oc;x$=1,Object.defineProperty(Oc,"__esModule",{value:!0}),Oc.InlineCompletionRequest=void 0;const t=vt();var e;return function(n){n.method="textDocument/inlineCompletion",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method)}(e||(Oc.InlineCompletionRequest=e={})),Oc}var O$;function kj(){return O$||(O$=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.WorkspaceSymbolRequest=t.CodeActionResolveRequest=t.CodeActionRequest=t.DocumentSymbolRequest=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=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=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=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=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=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=t.InlineValueRequest=t.TypeHierarchySupertypesRequest=t.TypeHierarchySubtypesRequest=t.TypeHierarchyPrepareRequest=void 0;const e=vt(),n=$y(),r=Cy(),i=aj();Object.defineProperty(t,"ImplementationRequest",{enumerable:!0,get:function(){return i.ImplementationRequest}});const s=cj();Object.defineProperty(t,"TypeDefinitionRequest",{enumerable:!0,get:function(){return s.TypeDefinitionRequest}});const o=uj();Object.defineProperty(t,"WorkspaceFoldersRequest",{enumerable:!0,get:function(){return o.WorkspaceFoldersRequest}}),Object.defineProperty(t,"DidChangeWorkspaceFoldersNotification",{enumerable:!0,get:function(){return o.DidChangeWorkspaceFoldersNotification}});const a=lj();Object.defineProperty(t,"ConfigurationRequest",{enumerable:!0,get:function(){return a.ConfigurationRequest}});const c=dj();Object.defineProperty(t,"DocumentColorRequest",{enumerable:!0,get:function(){return c.DocumentColorRequest}}),Object.defineProperty(t,"ColorPresentationRequest",{enumerable:!0,get:function(){return c.ColorPresentationRequest}});const u=fj();Object.defineProperty(t,"FoldingRangeRequest",{enumerable:!0,get:function(){return u.FoldingRangeRequest}}),Object.defineProperty(t,"FoldingRangeRefreshRequest",{enumerable:!0,get:function(){return u.FoldingRangeRefreshRequest}});const l=pj();Object.defineProperty(t,"DeclarationRequest",{enumerable:!0,get:function(){return l.DeclarationRequest}});const d=hj();Object.defineProperty(t,"SelectionRangeRequest",{enumerable:!0,get:function(){return d.SelectionRangeRequest}});const f=mj();Object.defineProperty(t,"WorkDoneProgress",{enumerable:!0,get:function(){return f.WorkDoneProgress}}),Object.defineProperty(t,"WorkDoneProgressCreateRequest",{enumerable:!0,get:function(){return f.WorkDoneProgressCreateRequest}}),Object.defineProperty(t,"WorkDoneProgressCancelNotification",{enumerable:!0,get:function(){return f.WorkDoneProgressCancelNotification}});const p=gj();Object.defineProperty(t,"CallHierarchyIncomingCallsRequest",{enumerable:!0,get:function(){return p.CallHierarchyIncomingCallsRequest}}),Object.defineProperty(t,"CallHierarchyOutgoingCallsRequest",{enumerable:!0,get:function(){return p.CallHierarchyOutgoingCallsRequest}}),Object.defineProperty(t,"CallHierarchyPrepareRequest",{enumerable:!0,get:function(){return p.CallHierarchyPrepareRequest}});const m=yj();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,"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 w=vj();Object.defineProperty(t,"ShowDocumentRequest",{enumerable:!0,get:function(){return w.ShowDocumentRequest}});const E=wj();Object.defineProperty(t,"LinkedEditingRangeRequest",{enumerable:!0,get:function(){return E.LinkedEditingRangeRequest}});const y=bj();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,"WillCreateFilesRequest",{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,get:function(){return y.WillDeleteFilesRequest}});const b=Dj();Object.defineProperty(t,"UniquenessLevel",{enumerable:!0,get:function(){return b.UniquenessLevel}}),Object.defineProperty(t,"MonikerKind",{enumerable:!0,get:function(){return b.MonikerKind}}),Object.defineProperty(t,"MonikerRequest",{enumerable:!0,get:function(){return b.MonikerRequest}});const R=Ej();Object.defineProperty(t,"TypeHierarchyPrepareRequest",{enumerable:!0,get:function(){return R.TypeHierarchyPrepareRequest}}),Object.defineProperty(t,"TypeHierarchySubtypesRequest",{enumerable:!0,get:function(){return R.TypeHierarchySubtypesRequest}}),Object.defineProperty(t,"TypeHierarchySupertypesRequest",{enumerable:!0,get:function(){return R.TypeHierarchySupertypesRequest}});const C=Rj();Object.defineProperty(t,"InlineValueRequest",{enumerable:!0,get:function(){return C.InlineValueRequest}}),Object.defineProperty(t,"InlineValueRefreshRequest",{enumerable:!0,get:function(){return C.InlineValueRefreshRequest}});const A=Tj();Object.defineProperty(t,"InlayHintRequest",{enumerable:!0,get:function(){return A.InlayHintRequest}}),Object.defineProperty(t,"InlayHintResolveRequest",{enumerable:!0,get:function(){return A.InlayHintResolveRequest}}),Object.defineProperty(t,"InlayHintRefreshRequest",{enumerable:!0,get:function(){return A.InlayHintRefreshRequest}});const q=$j();Object.defineProperty(t,"DiagnosticServerCancellationData",{enumerable:!0,get:function(){return q.DiagnosticServerCancellationData}}),Object.defineProperty(t,"DocumentDiagnosticReportKind",{enumerable:!0,get:function(){return q.DocumentDiagnosticReportKind}}),Object.defineProperty(t,"DocumentDiagnosticRequest",{enumerable:!0,get:function(){return q.DocumentDiagnosticRequest}}),Object.defineProperty(t,"WorkspaceDiagnosticRequest",{enumerable:!0,get:function(){return q.WorkspaceDiagnosticRequest}}),Object.defineProperty(t,"DiagnosticRefreshRequest",{enumerable:!0,get:function(){return q.DiagnosticRefreshRequest}});const G=Sj();Object.defineProperty(t,"NotebookCellKind",{enumerable:!0,get:function(){return G.NotebookCellKind}}),Object.defineProperty(t,"ExecutionSummary",{enumerable:!0,get:function(){return G.ExecutionSummary}}),Object.defineProperty(t,"NotebookCell",{enumerable:!0,get:function(){return G.NotebookCell}}),Object.defineProperty(t,"NotebookDocument",{enumerable:!0,get:function(){return G.NotebookDocument}}),Object.defineProperty(t,"NotebookDocumentSyncRegistrationType",{enumerable:!0,get:function(){return G.NotebookDocumentSyncRegistrationType}}),Object.defineProperty(t,"DidOpenNotebookDocumentNotification",{enumerable:!0,get:function(){return G.DidOpenNotebookDocumentNotification}}),Object.defineProperty(t,"NotebookCellArrayChange",{enumerable:!0,get:function(){return G.NotebookCellArrayChange}}),Object.defineProperty(t,"DidChangeNotebookDocumentNotification",{enumerable:!0,get:function(){return G.DidChangeNotebookDocumentNotification}}),Object.defineProperty(t,"DidSaveNotebookDocumentNotification",{enumerable:!0,get:function(){return G.DidSaveNotebookDocumentNotification}}),Object.defineProperty(t,"DidCloseNotebookDocumentNotification",{enumerable:!0,get:function(){return G.DidCloseNotebookDocumentNotification}});const Q=Cj();Object.defineProperty(t,"InlineCompletionRequest",{enumerable:!0,get:function(){return Q.InlineCompletionRequest}});var J;(function(h){function $(g){const P=g;return r.string(P)||r.string(P.language)||r.string(P.scheme)||r.string(P.pattern)}h.is=$})(J||(t.TextDocumentFilter=J={}));var le;(function(h){function $(g){const P=g;return r.objectLiteral(P)&&(r.string(P.notebookType)||r.string(P.scheme)||r.string(P.pattern))}h.is=$})(le||(t.NotebookDocumentFilter=le={}));var N;(function(h){function $(g){const P=g;return r.objectLiteral(P)&&(r.string(P.notebook)||le.is(P.notebook))&&(P.language===void 0||r.string(P.language))}h.is=$})(N||(t.NotebookCellTextDocumentFilter=N={}));var S;(function(h){function $(g){if(!Array.isArray(g))return!1;for(let P of g)if(!r.string(P)&&!J.is(P)&&!N.is(P))return!1;return!0}h.is=$})(S||(t.DocumentSelector=S={}));var T;(function(h){h.method="client/registerCapability",h.messageDirection=e.MessageDirection.serverToClient,h.type=new e.ProtocolRequestType(h.method)})(T||(t.RegistrationRequest=T={}));var O;(function(h){h.method="client/unregisterCapability",h.messageDirection=e.MessageDirection.serverToClient,h.type=new e.ProtocolRequestType(h.method)})(O||(t.UnregistrationRequest=O={}));var W;(function(h){h.Create="create",h.Rename="rename",h.Delete="delete"})(W||(t.ResourceOperationKind=W={}));var U;(function(h){h.Abort="abort",h.Transactional="transactional",h.TextOnlyTransactional="textOnlyTransactional",h.Undo="undo"})(U||(t.FailureHandlingKind=U={}));var K;(function(h){h.UTF8="utf-8",h.UTF16="utf-16",h.UTF32="utf-32"})(K||(t.PositionEncodingKind=K={}));var be;(function(h){function $(g){const P=g;return P&&r.string(P.id)&&P.id.length>0}h.hasId=$})(be||(t.StaticRegistrationOptions=be={}));var ee;(function(h){function $(g){const P=g;return P&&(P.documentSelector===null||S.is(P.documentSelector))}h.is=$})(ee||(t.TextDocumentRegistrationOptions=ee={}));var k;(function(h){function $(P){const D=P;return r.objectLiteral(D)&&(D.workDoneProgress===void 0||r.boolean(D.workDoneProgress))}h.is=$;function g(P){const D=P;return D&&r.boolean(D.workDoneProgress)}h.hasWorkDoneProgress=g})(k||(t.WorkDoneProgressOptions=k={}));var pe;(function(h){h.method="initialize",h.messageDirection=e.MessageDirection.clientToServer,h.type=new e.ProtocolRequestType(h.method)})(pe||(t.InitializeRequest=pe={}));var Qe;(function(h){h.unknownProtocolVersion=1})(Qe||(t.InitializeErrorCodes=Qe={}));var ct;(function(h){h.method="initialized",h.messageDirection=e.MessageDirection.clientToServer,h.type=new e.ProtocolNotificationType(h.method)})(ct||(t.InitializedNotification=ct={}));var j;(function(h){h.method="shutdown",h.messageDirection=e.MessageDirection.clientToServer,h.type=new e.ProtocolRequestType0(h.method)})(j||(t.ShutdownRequest=j={}));var V;(function(h){h.method="exit",h.messageDirection=e.MessageDirection.clientToServer,h.type=new e.ProtocolNotificationType0(h.method)})(V||(t.ExitNotification=V={}));var _e;(function(h){h.method="workspace/didChangeConfiguration",h.messageDirection=e.MessageDirection.clientToServer,h.type=new e.ProtocolNotificationType(h.method)})(_e||(t.DidChangeConfigurationNotification=_e={}));var ie;(function(h){h.Error=1,h.Warning=2,h.Info=3,h.Log=4,h.Debug=5})(ie||(t.MessageType=ie={}));var ve;(function(h){h.method="window/showMessage",h.messageDirection=e.MessageDirection.serverToClient,h.type=new e.ProtocolNotificationType(h.method)})(ve||(t.ShowMessageNotification=ve={}));var Te;(function(h){h.method="window/showMessageRequest",h.messageDirection=e.MessageDirection.serverToClient,h.type=new e.ProtocolRequestType(h.method)})(Te||(t.ShowMessageRequest=Te={}));var se;(function(h){h.method="window/logMessage",h.messageDirection=e.MessageDirection.serverToClient,h.type=new e.ProtocolNotificationType(h.method)})(se||(t.LogMessageNotification=se={}));var I;(function(h){h.method="telemetry/event",h.messageDirection=e.MessageDirection.serverToClient,h.type=new e.ProtocolNotificationType(h.method)})(I||(t.TelemetryEventNotification=I={}));var M;(function(h){h.None=0,h.Full=1,h.Incremental=2})(M||(t.TextDocumentSyncKind=M={}));var ue;(function(h){h.method="textDocument/didOpen",h.messageDirection=e.MessageDirection.clientToServer,h.type=new e.ProtocolNotificationType(h.method)})(ue||(t.DidOpenTextDocumentNotification=ue={}));var B;(function(h){function $(P){let D=P;return D!=null&&typeof D.text=="string"&&D.range!==void 0&&(D.rangeLength===void 0||typeof D.rangeLength=="number")}h.isIncremental=$;function g(P){let D=P;return D!=null&&typeof D.text=="string"&&D.range===void 0&&D.rangeLength===void 0}h.isFull=g})(B||(t.TextDocumentContentChangeEvent=B={}));var oe;(function(h){h.method="textDocument/didChange",h.messageDirection=e.MessageDirection.clientToServer,h.type=new e.ProtocolNotificationType(h.method)})(oe||(t.DidChangeTextDocumentNotification=oe={}));var Le;(function(h){h.method="textDocument/didClose",h.messageDirection=e.MessageDirection.clientToServer,h.type=new e.ProtocolNotificationType(h.method)})(Le||(t.DidCloseTextDocumentNotification=Le={}));var Ke;(function(h){h.method="textDocument/didSave",h.messageDirection=e.MessageDirection.clientToServer,h.type=new e.ProtocolNotificationType(h.method)})(Ke||(t.DidSaveTextDocumentNotification=Ke={}));var re;(function(h){h.Manual=1,h.AfterDelay=2,h.FocusOut=3})(re||(t.TextDocumentSaveReason=re={}));var Ce;(function(h){h.method="textDocument/willSave",h.messageDirection=e.MessageDirection.clientToServer,h.type=new e.ProtocolNotificationType(h.method)})(Ce||(t.WillSaveTextDocumentNotification=Ce={}));var te;(function(h){h.method="textDocument/willSaveWaitUntil",h.messageDirection=e.MessageDirection.clientToServer,h.type=new e.ProtocolRequestType(h.method)})(te||(t.WillSaveTextDocumentWaitUntilRequest=te={}));var we;(function(h){h.method="workspace/didChangeWatchedFiles",h.messageDirection=e.MessageDirection.clientToServer,h.type=new e.ProtocolNotificationType(h.method)})(we||(t.DidChangeWatchedFilesNotification=we={}));var Oe;(function(h){h.Created=1,h.Changed=2,h.Deleted=3})(Oe||(t.FileChangeType=Oe={}));var ut;(function(h){function $(g){const P=g;return r.objectLiteral(P)&&(n.URI.is(P.baseUri)||n.WorkspaceFolder.is(P.baseUri))&&r.string(P.pattern)}h.is=$})(ut||(t.RelativePattern=ut={}));var Ge;(function(h){h.Create=1,h.Change=2,h.Delete=4})(Ge||(t.WatchKind=Ge={}));var Ft;(function(h){h.method="textDocument/publishDiagnostics",h.messageDirection=e.MessageDirection.serverToClient,h.type=new e.ProtocolNotificationType(h.method)})(Ft||(t.PublishDiagnosticsNotification=Ft={}));var Bt;(function(h){h.Invoked=1,h.TriggerCharacter=2,h.TriggerForIncompleteCompletions=3})(Bt||(t.CompletionTriggerKind=Bt={}));var tn;(function(h){h.method="textDocument/completion",h.messageDirection=e.MessageDirection.clientToServer,h.type=new e.ProtocolRequestType(h.method)})(tn||(t.CompletionRequest=tn={}));var Y;(function(h){h.method="completionItem/resolve",h.messageDirection=e.MessageDirection.clientToServer,h.type=new e.ProtocolRequestType(h.method)})(Y||(t.CompletionResolveRequest=Y={}));var X;(function(h){h.method="textDocument/hover",h.messageDirection=e.MessageDirection.clientToServer,h.type=new e.ProtocolRequestType(h.method)})(X||(t.HoverRequest=X={}));var de;(function(h){h.Invoked=1,h.TriggerCharacter=2,h.ContentChange=3})(de||(t.SignatureHelpTriggerKind=de={}));var zt;(function(h){h.method="textDocument/signatureHelp",h.messageDirection=e.MessageDirection.clientToServer,h.type=new e.ProtocolRequestType(h.method)})(zt||(t.SignatureHelpRequest=zt={}));var Lt;(function(h){h.method="textDocument/definition",h.messageDirection=e.MessageDirection.clientToServer,h.type=new e.ProtocolRequestType(h.method)})(Lt||(t.DefinitionRequest=Lt={}));var cr;(function(h){h.method="textDocument/references",h.messageDirection=e.MessageDirection.clientToServer,h.type=new e.ProtocolRequestType(h.method)})(cr||(t.ReferencesRequest=cr={}));var ai;(function(h){h.method="textDocument/documentHighlight",h.messageDirection=e.MessageDirection.clientToServer,h.type=new e.ProtocolRequestType(h.method)})(ai||(t.DocumentHighlightRequest=ai={}));var qi;(function(h){h.method="textDocument/documentSymbol",h.messageDirection=e.MessageDirection.clientToServer,h.type=new e.ProtocolRequestType(h.method)})(qi||(t.DocumentSymbolRequest=qi={}));var ji;(function(h){h.method="textDocument/codeAction",h.messageDirection=e.MessageDirection.clientToServer,h.type=new e.ProtocolRequestType(h.method)})(ji||(t.CodeActionRequest=ji={}));var Ui;(function(h){h.method="codeAction/resolve",h.messageDirection=e.MessageDirection.clientToServer,h.type=new e.ProtocolRequestType(h.method)})(Ui||(t.CodeActionResolveRequest=Ui={}));var Gi;(function(h){h.method="workspace/symbol",h.messageDirection=e.MessageDirection.clientToServer,h.type=new e.ProtocolRequestType(h.method)})(Gi||(t.WorkspaceSymbolRequest=Gi={}));var ci;(function(h){h.method="workspaceSymbol/resolve",h.messageDirection=e.MessageDirection.clientToServer,h.type=new e.ProtocolRequestType(h.method)})(ci||(t.WorkspaceSymbolResolveRequest=ci={}));var ui;(function(h){h.method="textDocument/codeLens",h.messageDirection=e.MessageDirection.clientToServer,h.type=new e.ProtocolRequestType(h.method)})(ui||(t.CodeLensRequest=ui={}));var gn;(function(h){h.method="codeLens/resolve",h.messageDirection=e.MessageDirection.clientToServer,h.type=new e.ProtocolRequestType(h.method)})(gn||(t.CodeLensResolveRequest=gn={}));var Wi;(function(h){h.method="workspace/codeLens/refresh",h.messageDirection=e.MessageDirection.serverToClient,h.type=new e.ProtocolRequestType0(h.method)})(Wi||(t.CodeLensRefreshRequest=Wi={}));var Hi;(function(h){h.method="textDocument/documentLink",h.messageDirection=e.MessageDirection.clientToServer,h.type=new e.ProtocolRequestType(h.method)})(Hi||(t.DocumentLinkRequest=Hi={}));var ur;(function(h){h.method="documentLink/resolve",h.messageDirection=e.MessageDirection.clientToServer,h.type=new e.ProtocolRequestType(h.method)})(ur||(t.DocumentLinkResolveRequest=ur={}));var Vi;(function(h){h.method="textDocument/formatting",h.messageDirection=e.MessageDirection.clientToServer,h.type=new e.ProtocolRequestType(h.method)})(Vi||(t.DocumentFormattingRequest=Vi={}));var _r;(function(h){h.method="textDocument/rangeFormatting",h.messageDirection=e.MessageDirection.clientToServer,h.type=new e.ProtocolRequestType(h.method)})(_r||(t.DocumentRangeFormattingRequest=_r={}));var Ki;(function(h){h.method="textDocument/rangesFormatting",h.messageDirection=e.MessageDirection.clientToServer,h.type=new e.ProtocolRequestType(h.method)})(Ki||(t.DocumentRangesFormattingRequest=Ki={}));var Ln;(function(h){h.method="textDocument/onTypeFormatting",h.messageDirection=e.MessageDirection.clientToServer,h.type=new e.ProtocolRequestType(h.method)})(Ln||(t.DocumentOnTypeFormattingRequest=Ln={}));var Vn;(function(h){h.Identifier=1})(Vn||(t.PrepareSupportDefaultBehavior=Vn={}));var Ks;(function(h){h.method="textDocument/rename",h.messageDirection=e.MessageDirection.clientToServer,h.type=new e.ProtocolRequestType(h.method)})(Ks||(t.RenameRequest=Ks={}));var F;(function(h){h.method="textDocument/prepareRename",h.messageDirection=e.MessageDirection.clientToServer,h.type=new e.ProtocolRequestType(h.method)})(F||(t.PrepareRenameRequest=F={}));var v;(function(h){h.method="workspace/executeCommand",h.messageDirection=e.MessageDirection.clientToServer,h.type=new e.ProtocolRequestType(h.method)})(v||(t.ExecuteCommandRequest=v={}));var _;(function(h){h.method="workspace/applyEdit",h.messageDirection=e.MessageDirection.serverToClient,h.type=new e.ProtocolRequestType("workspace/applyEdit")})(_||(t.ApplyWorkspaceEditRequest=_={}))}(Sy)),Sy}var Nc={},N$;function Aj(){if(N$)return Nc;N$=1,Object.defineProperty(Nc,"__esModule",{value:!0}),Nc.createProtocolConnection=void 0;const t=vs();function e(n,r,i,s){return t.ConnectionStrategy.is(s)&&(s={connectionStrategy:s}),(0,t.createMessageConnection)(n,r,i,s)}return Nc.createProtocolConnection=e,Nc}var F$;function _j(){return F$||(F$=1,function(t){var e=Sc.__createBinding||(Object.create?function(s,o,a,c){c===void 0&&(c=a);var u=Object.getOwnPropertyDescriptor(o,a);(!u||("get"in u?!o.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:function(){return o[a]}}),Object.defineProperty(s,c,u)}:function(s,o,a,c){c===void 0&&(c=a),s[c]=o[a]}),n=Sc.__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.LSPErrorCodes=t.createProtocolConnection=void 0,n(vs(),t),n($y(),t),n(vt(),t),n(kj(),t);var r=Aj();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={}))}(Sc)),Sc}var L$;function St(){return L$||(L$=1,function(t){var e=Dc.__createBinding||(Object.create?function(s,o,a,c){c===void 0&&(c=a);var u=Object.getOwnPropertyDescriptor(o,a);(!u||("get"in u?!o.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:function(){return o[a]}}),Object.defineProperty(s,c,u)}:function(s,o,a,c){c===void 0&&(c=a),s[c]=o[a]}),n=Dc.__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.createProtocolConnection=void 0;const r=u$();n(u$(),t),n(_j(),t);function i(s,o,a,c){return(0,r.createMessageConnection)(s,o,a,c)}t.createProtocolConnection=i}(Dc)),Dc}var xn={},M$;function B$(){if(M$)return xn;M$=1,Object.defineProperty(xn,"__esModule",{value:!0}),xn.generateUuid=xn.parse=xn.isUUID=xn.v4=xn.empty=void 0;class t{constructor(c){this._value=c}asHex(){return this._value}equals(c){return this.asHex()===c.asHex()}}class e extends t{static _oneOf(c){return c[Math.floor(c.length*Math.random())]}static _randomHex(){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._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"],xn.empty=new t("00000000-0000-0000-0000-000000000000");function n(){return new e}xn.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)}xn.isUUID=i;function s(a){if(!i(a))throw new Error("invalid uuid");return new t(a)}xn.parse=s;function o(){return n().asHex()}return xn.generateUuid=o,xn}var ei={},z$;function Pj(){if(z$)return ei;z$=1,Object.defineProperty(ei,"__esModule",{value:!0}),ei.attachPartialResult=ei.ProgressFeature=ei.attachWorkDone=void 0;const t=St(),e=B$();class n{constructor(f,p){this._connection=f,this._token=p,n.Instances.set(this._token,this)}begin(f,p,m,w){let E={kind:"begin",title:f,percentage:p,message:m,cancellable:w};this._connection.sendProgress(t.WorkDoneProgress.type,this._token,E)}report(f,p){let m={kind:"report"};typeof f=="number"?(m.percentage=f,p!==void 0&&(m.message=p)):m.message=f,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(f,p){super(f,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(){}}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(d,f){if(f===void 0||f.workDoneToken===void 0)return new i;const p=f.workDoneToken;return delete f.workDoneToken,new n(d,p)}ei.attachWorkDone=o;const a=d=>class extends d{constructor(){super(),this._progressSupported=!1}initialize(f){super.initialize(f),f?.window?.workDoneProgress===!0&&(this._progressSupported=!0,this.connection.onNotification(t.WorkDoneProgressCancelNotification.type,p=>{let m=n.Instances.get(p.token);(m instanceof r||m instanceof s)&&m.cancel()}))}attachWorkDoneProgress(f){return f===void 0?new i:new n(this.connection,f)}createWorkDoneProgress(){if(this._progressSupported){const f=(0,e.generateUuid)();return this.connection.sendRequest(t.WorkDoneProgressCreateRequest.type,{token:f}).then(()=>new r(this.connection,f))}else return Promise.resolve(new s)}};ei.ProgressFeature=a;var c;(function(d){d.type=new t.ProgressType})(c||(c={}));class u{constructor(f,p){this._connection=f,this._token=p}report(f){this._connection.sendProgress(c.type,this._token,f)}}function l(d,f){if(f===void 0||f.partialResultToken===void 0)return;const p=f.partialResultToken;return delete f.partialResultToken,new u(d,p)}return ei.attachPartialResult=l,ei}var Fc={},q$;function Ij(){if(q$)return Fc;q$=1,Object.defineProperty(Fc,"__esModule",{value:!0}),Fc.ConfigurationFeature=void 0;const t=St(),e=by(),n=r=>class extends r{getConfiguration(i){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 Fc.ConfigurationFeature=n,Fc}var Lc={},j$;function xj(){if(j$)return Lc;j$=1,Object.defineProperty(Lc,"__esModule",{value:!0}),Lc.WorkspaceFoldersFeature=void 0;const t=St(),e=n=>class extends n{constructor(){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(){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 Lc.WorkspaceFoldersFeature=e,Lc}var Mc={},U$;function Oj(){if(U$)return Mc;U$=1,Object.defineProperty(Mc,"__esModule",{value:!0}),Mc.CallHierarchyFeature=void 0;const t=St(),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.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 ti={},G$;function W$(){if(G$)return ti;G$=1,Object.defineProperty(ti,"__esModule",{value:!0}),ti.SemanticTokensBuilder=ti.SemanticTokensDiff=ti.SemanticTokensFeature=void 0;const t=St(),e=i=>class extends i{get semanticTokens(){return{refresh:()=>this.connection.sendRequest(t.SemanticTokensRefreshRequest.type),on:s=>{const o=t.SemanticTokensRequest.type;return this.connection.onRequest(o,(a,c)=>s(a,c,this.attachWorkDoneProgress(a),this.attachPartialResultProgress(o,a)))},onDelta:s=>{const o=t.SemanticTokensDeltaRequest.type;return this.connection.onRequest(o,(a,c)=>s(a,c,this.attachWorkDoneProgress(a),this.attachPartialResultProgress(o,a)))},onRange:s=>{const o=t.SemanticTokensRangeRequest.type;return this.connection.onRequest(o,(a,c)=>s(a,c,this.attachWorkDoneProgress(a),this.attachPartialResultProgress(o,a)))}}}};ti.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 c=s-1,u=o-1;for(;c>=a&&u>=a&&this.originalSequence[c]===this.modifiedSequence[u];)c--,u--;(c<a||u<a)&&(c++,u++);const l=c-a+1,d=this.modifiedSequence.slice(a,u+1);return d.length===1&&d[0]===this.originalSequence[c]?[{start:a,deleteCount:l-1}]:[{start:a,deleteCount:l,data:d}]}else return a<o?[{start:a,deleteCount:0,data:this.modifiedSequence.slice(a)}]:a<s?[{start:a,deleteCount:s-a}]:[]}}ti.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,c,u){let l=s,d=o;this._dataLen>0&&(l-=this._prevLine,l===0&&(d-=this._prevChar)),this._data[this._dataLen++]=l,this._data[this._dataLen++]=d,this._data[this._dataLen++]=a,this._data[this._dataLen++]=c,this._data[this._dataLen++]=u,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 ti.SemanticTokensBuilder=r,ti}var Bc={},H$;function Nj(){if(H$)return Bc;H$=1,Object.defineProperty(Bc,"__esModule",{value:!0}),Bc.ShowDocumentFeature=void 0;const t=St(),e=n=>class extends n{showDocument(r){return this.connection.sendRequest(t.ShowDocumentRequest.type,r)}};return Bc.ShowDocumentFeature=e,Bc}var zc={},V$;function Fj(){if(V$)return zc;V$=1,Object.defineProperty(zc,"__esModule",{value:!0}),zc.FileOperationsFeature=void 0;const t=St(),e=n=>class extends n{onDidCreateFiles(r){return this.connection.onNotification(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(t.WillDeleteFilesRequest.type,(i,s)=>r(i,s))}};return zc.FileOperationsFeature=e,zc}var qc={},K$;function Lj(){if(K$)return qc;K$=1,Object.defineProperty(qc,"__esModule",{value:!0}),qc.LinkedEditingRangeFeature=void 0;const t=St(),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 qc.LinkedEditingRangeFeature=e,qc}var jc={},Y$;function Mj(){if(Y$)return jc;Y$=1,Object.defineProperty(jc,"__esModule",{value:!0}),jc.TypeHierarchyFeature=void 0;const t=St(),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.connection.onRequest(i,(s,o)=>r(s,o,this.attachWorkDoneProgress(s),this.attachPartialResultProgress(i,s)))}}}};return jc.TypeHierarchyFeature=e,jc}var Uc={},X$;function Bj(){if(X$)return Uc;X$=1,Object.defineProperty(Uc,"__esModule",{value:!0}),Uc.InlineValueFeature=void 0;const t=St(),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(i)))}}};return Uc.InlineValueFeature=e,Uc}var Gc={},J$;function zj(){if(J$)return Gc;J$=1,Object.defineProperty(Gc,"__esModule",{value:!0}),Gc.FoldingRangeFeature=void 0;const t=St(),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 Gc.FoldingRangeFeature=e,Gc}var Wc={},Q$;function qj(){if(Q$)return Wc;Q$=1,Object.defineProperty(Wc,"__esModule",{value:!0}),Wc.InlayHintFeature=void 0;const t=St(),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 Wc.InlayHintFeature=e,Wc}var Hc={},Z$;function jj(){if(Z$)return Hc;Z$=1,Object.defineProperty(Hc,"__esModule",{value:!0}),Hc.DiagnosticFeature=void 0;const t=St(),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(i,s,this.attachWorkDoneProgress(i),this.attachPartialResultProgress(t.WorkspaceDiagnosticRequest.partialResult,i)))}}};return Hc.DiagnosticFeature=e,Hc}var Rs={},Vc={},eS;function tS(){if(eS)return Vc;eS=1,Object.defineProperty(Vc,"__esModule",{value:!0}),Vc.TextDocuments=void 0;const t=St();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._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=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 c=Object.freeze({document:a});this._onDidOpen.fire(c),this._onDidChangeContent.fire(c)})),i.push(r.onDidChangeTextDocument(s=>{const o=s.textDocument,a=s.contentChanges;if(a.length===0)return;const{version:c}=o;if(c==null)throw new Error(`Received document change event for ${o.uri} without valid version identifier`);let u=this._syncedDocuments.get(o.uri);u!==void 0&&(u=this._configuration.update(u,a,c),this._syncedDocuments.set(o.uri,u),this._onDidChangeContent.fire(Object.freeze({document:u})))})),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.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.dispose())})}}return Vc.TextDocuments=e,Vc}var nS;function rS(){if(nS)return Rs;nS=1,Object.defineProperty(Rs,"__esModule",{value:!0}),Rs.NotebookDocuments=Rs.NotebookSyncFeature=void 0;const t=St(),e=tS(),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.connection.onNotification(t.DidSaveNotebookDocumentNotification.type,a=>{o(a)}),onDidCloseNotebookDocument:o=>this.connection.onNotification(t.DidCloseNotebookDocumentNotification.type,a=>{o(a)})}}};Rs.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){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=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=="string"?o:o.document,c=this.notebookCellMap.get(a);return c&&c[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,c=[];return c.push(this.cellTextDocuments.listen(a)),c.push(o.notebooks.synchronization.onDidOpenNotebookDocument(u=>{this.notebookDocuments.set(u.notebookDocument.uri,u.notebookDocument);for(const l of u.cellTextDocuments)a.openTextDocument({textDocument:l});this.updateCellMap(u.notebookDocument),this._onDidOpen.fire(u.notebookDocument)})),c.push(o.notebooks.synchronization.onDidChangeNotebookDocument(u=>{const l=this.notebookDocuments.get(u.notebookDocument.uri);if(l===void 0)return;l.version=u.notebookDocument.version;const d=l.metadata;let f=!1;const p=u.change;p.metadata!==void 0&&(f=!0,l.metadata=p.metadata);const m=[],w=[],E=[],y=[];if(p.cells!==void 0){const q=p.cells;if(q.structure!==void 0){const G=q.structure.array;if(l.cells.splice(G.start,G.deleteCount,...G.cells!==void 0?G.cells:[]),q.structure.didOpen!==void 0)for(const Q of q.structure.didOpen)a.openTextDocument({textDocument:Q}),m.push(Q.uri);if(q.structure.didClose)for(const Q of q.structure.didClose)a.closeTextDocument({textDocument:Q}),w.push(Q.uri)}if(q.data!==void 0){const G=new Map(q.data.map(Q=>[Q.document,Q]));for(let Q=0;Q<=l.cells.length;Q++){const J=G.get(l.cells[Q].document);if(J!==void 0){const le=l.cells.splice(Q,1,J);if(E.push({old:le[0],new:J}),G.delete(J.document),G.size===0)break}}}if(q.textContent!==void 0)for(const G of q.textContent)a.changeTextDocument({textDocument:G.document,contentChanges:G.changes}),y.push(G.document.uri)}this.updateCellMap(l);const b={notebookDocument:l};f&&(b.metadata={old:d,new:l.metadata});const R=[];for(const q of m)R.push(this.getNotebookCell(q));const C=[];for(const q of w)C.push(this.getNotebookCell(q));const A=[];for(const q of y)A.push(this.getNotebookCell(q));(R.length>0||C.length>0||E.length>0||A.length>0)&&(b.cells={added:R,removed:C,changed:{data:E,textContent:A}}),(b.metadata!==void 0||b.cells!==void 0)&&this._onDidChange.fire(b)})),c.push(o.notebooks.synchronization.onDidSaveNotebookDocument(u=>{const l=this.notebookDocuments.get(u.notebookDocument.uri);l!==void 0&&this._onDidSave.fire(l)})),c.push(o.notebooks.synchronization.onDidCloseNotebookDocument(u=>{const l=this.notebookDocuments.get(u.notebookDocument.uri);if(l!==void 0){this._onDidClose.fire(l);for(const d of u.cellTextDocuments)a.closeTextDocument({textDocument:d});this.notebookDocuments.delete(u.notebookDocument.uri);for(const d of l.cells)this.notebookCellMap.delete(d.document)}})),t.Disposable.create(()=>{c.forEach(u=>u.dispose())})}updateCellMap(o){for(const a of o.cells)this.notebookCellMap.set(a.document,[a,o])}}return Rs.NotebookDocuments=i,Rs}var Kc={},iS;function Uj(){if(iS)return Kc;iS=1,Object.defineProperty(Kc,"__esModule",{value:!0}),Kc.MonikerFeature=void 0;const t=St(),e=n=>class extends n{get moniker(){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 sS;function oS(){if(sS)return Ue;sS=1,Object.defineProperty(Ue,"__esModule",{value:!0}),Ue.createConnection=Ue.combineFeatures=Ue.combineNotebooksFeatures=Ue.combineLanguagesFeatures=Ue.combineWorkspaceFeatures=Ue.combineWindowFeatures=Ue.combineClientFeatures=Ue.combineTracerFeatures=Ue.combineTelemetryFeatures=Ue.combineConsoleFeatures=Ue._NotebooksImpl=Ue._LanguagesImpl=Ue.BulkUnregistration=Ue.BulkRegistration=Ue.ErrorMessageTracker=void 0;const t=St(),e=by(),n=B$(),r=Pj(),i=Ij(),s=xj(),o=Oj(),a=W$(),c=Nj(),u=Fj(),l=Lj(),d=Mj(),f=Bj(),p=zj(),m=qj(),w=jj(),E=rS(),y=Uj();function b(se){if(se!==null)return se}class R{constructor(){this._messages=Object.create(null)}add(I){let M=this._messages[I];M||(M=0),M++,this._messages[I]=M}sendErrors(I){Object.keys(this._messages).forEach(M=>{I.window.showErrorMessage(M)})}}Ue.ErrorMessageTracker=R;class C{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,M){this._rawConnection&&this._rawConnection.sendNotification(t.LogMessageNotification.type,{type:I,message:M}).catch(()=>{(0,t.RAL)().console.error("Sending log message failed")})}}class A{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,...M){let ue={type:t.MessageType.Error,message:I,actions:M};return this.connection.sendRequest(t.ShowMessageRequest.type,ue).then(b)}showWarningMessage(I,...M){let ue={type:t.MessageType.Warning,message:I,actions:M};return this.connection.sendRequest(t.ShowMessageRequest.type,ue).then(b)}showInformationMessage(I,...M){let ue={type:t.MessageType.Info,message:I,actions:M};return this.connection.sendRequest(t.ShowMessageRequest.type,ue).then(b)}}const q=(0,c.ShowDocumentFeature)((0,r.ProgressFeature)(A));var G;(function(se){function I(){return new Q}se.create=I})(G||(Ue.BulkRegistration=G={}));class Q{constructor(){this._registrations=[],this._registered=new Set}add(I,M){const ue=e.string(I)?I:I.method;if(this._registered.has(ue))throw new Error(`${ue} is already added to this registration`);const B=n.generateUuid();this._registrations.push({id:B,method:ue,registerOptions:M||{}}),this._registered.add(ue)}asRegistrationParams(){return{registrations:this._registrations}}}var J;(function(se){function I(){return new le(void 0,[])}se.create=I})(J||(Ue.BulkUnregistration=J={}));class le{constructor(I,M){this._connection=I,this._unregistrations=new Map,M.forEach(ue=>{this._unregistrations.set(ue.method,ue)})}get isAttached(){return!!this._connection}attach(I){this._connection=I}add(I){this._unregistrations.set(I.method,I)}dispose(){let I=[];for(let ue of this._unregistrations.values())I.push(ue);let M={unregisterations:I};this._connection.sendRequest(t.UnregistrationRequest.type,M).catch(()=>{this._connection.console.info("Bulk unregistration failed.")})}disposeSingle(I){const M=e.string(I)?I:I.method,ue=this._unregistrations.get(M);if(!ue)return!1;let B={unregisterations:[ue]};return this._connection.sendRequest(t.UnregistrationRequest.type,B).then(()=>{this._unregistrations.delete(M)},oe=>{this._connection.console.info(`Un-registering request handler for ${ue.id} failed.`)}),!0}}class N{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,M,ue){return I instanceof Q?this.registerMany(I):I instanceof le?this.registerSingle1(I,M,ue):this.registerSingle2(I,M)}registerSingle1(I,M,ue){const B=e.string(M)?M:M.method,oe=n.generateUuid();let Le={registrations:[{id:oe,method:B,registerOptions:ue||{}}]};return I.isAttached||I.attach(this.connection),this.connection.sendRequest(t.RegistrationRequest.type,Le).then(Ke=>(I.add({id:oe,method:B}),I),Ke=>(this.connection.console.info(`Registering request handler for ${B} failed.`),Promise.reject(Ke)))}registerSingle2(I,M){const ue=e.string(I)?I:I.method,B=n.generateUuid();let oe={registrations:[{id:B,method:ue,registerOptions:M||{}}]};return this.connection.sendRequest(t.RegistrationRequest.type,oe).then(Le=>t.Disposable.create(()=>{this.unregisterSingle(B,ue).catch(()=>{this.connection.console.info(`Un-registering capability with id ${B} failed.`)})}),Le=>(this.connection.console.info(`Registering request handler for ${ue} failed.`),Promise.reject(Le)))}unregisterSingle(I,M){let ue={unregisterations:[{id:I,method:M}]};return this.connection.sendRequest(t.UnregistrationRequest.type,ue).catch(()=>{this.connection.console.info(`Un-registering request handler for ${I} failed.`)})}registerMany(I){let M=I.asRegistrationParams();return this.connection.sendRequest(t.RegistrationRequest.type,M).then(()=>new le(this._connection,M.registrations.map(ue=>({id:ue.id,method:ue.method}))),ue=>(this.connection.console.info("Bulk registration failed."),Promise.reject(ue)))}}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){}applyEdit(I){function M(B){return B&&!!B.edit}let ue=M(I)?I:{edit:I};return this.connection.sendRequest(t.ApplyWorkspaceEditRequest.type,ue)}}const T=(0,u.FileOperationsFeature)((0,s.WorkspaceFoldersFeature)((0,i.ConfigurationFeature)(S)));class O{constructor(){this._trace=t.Trace.Off}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){}set trace(I){this._trace=I}log(I,M){this._trace!==t.Trace.Off&&this.connection.sendNotification(t.LogTraceNotification.type,{message:I,verbose:this._trace===t.Trace.Verbose?M:void 0}).catch(()=>{})}}class W{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){this.connection.sendNotification(t.TelemetryEventNotification.type,I).catch(()=>{this.connection.console.log("Sending TelemetryEventNotification failed")})}}class U{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,M){return(0,r.attachPartialResult)(this.connection,M)}}Ue._LanguagesImpl=U;const K=(0,p.FoldingRangeFeature)((0,y.MonikerFeature)((0,w.DiagnosticFeature)((0,m.InlayHintFeature)((0,f.InlineValueFeature)((0,d.TypeHierarchyFeature)((0,l.LinkedEditingRangeFeature)((0,a.SemanticTokensFeature)((0,o.CallHierarchyFeature)(U)))))))));class be{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,M){return(0,r.attachPartialResult)(this.connection,M)}}Ue._NotebooksImpl=be;const ee=(0,E.NotebookSyncFeature)(be);function k(se,I){return function(M){return I(se(M))}}Ue.combineConsoleFeatures=k;function pe(se,I){return function(M){return I(se(M))}}Ue.combineTelemetryFeatures=pe;function Qe(se,I){return function(M){return I(se(M))}}Ue.combineTracerFeatures=Qe;function ct(se,I){return function(M){return I(se(M))}}Ue.combineClientFeatures=ct;function j(se,I){return function(M){return I(se(M))}}Ue.combineWindowFeatures=j;function V(se,I){return function(M){return I(se(M))}}Ue.combineWorkspaceFeatures=V;function _e(se,I){return function(M){return I(se(M))}}Ue.combineLanguagesFeatures=_e;function ie(se,I){return function(M){return I(se(M))}}Ue.combineNotebooksFeatures=ie;function ve(se,I){function M(B,oe,Le){return B&&oe?Le(B,oe):B||oe}return{__brand:"features",console:M(se.console,I.console,k),tracer:M(se.tracer,I.tracer,Qe),telemetry:M(se.telemetry,I.telemetry,pe),client:M(se.client,I.client,ct),window:M(se.window,I.window,j),workspace:M(se.workspace,I.workspace,V),languages:M(se.languages,I.languages,_e),notebooks:M(se.notebooks,I.notebooks,ie)}}Ue.combineFeatures=ve;function Te(se,I,M){const ue=M&&M.console?new(M.console(C)):new C,B=se(ue);ue.rawAttach(B);const oe=M&&M.tracer?new(M.tracer(O)):new O,Le=M&&M.telemetry?new(M.telemetry(W)):new W,Ke=M&&M.client?new(M.client(N)):new N,re=M&&M.window?new(M.window(q)):new q,Ce=M&&M.workspace?new(M.workspace(T)):new T,te=M&&M.languages?new(M.languages(K)):new K,we=M&&M.notebooks?new(M.notebooks(ee)):new ee,Oe=[ue,oe,Le,Ke,re,Ce,te,we];function ut(Y){return Y instanceof Promise?Y:e.thenable(Y)?new Promise((X,de)=>{Y.then(zt=>X(zt),zt=>de(zt))}):Promise.resolve(Y)}let Ge,Ft,Bt,tn={listen:()=>B.listen(),sendRequest:(Y,...X)=>B.sendRequest(e.string(Y)?Y:Y.method,...X),onRequest:(Y,X)=>B.onRequest(Y,X),sendNotification:(Y,X)=>{const de=e.string(Y)?Y:Y.method;return B.sendNotification(de,X)},onNotification:(Y,X)=>B.onNotification(Y,X),onProgress:B.onProgress,sendProgress:B.sendProgress,onInitialize:Y=>(Ft=Y,{dispose:()=>{Ft=void 0}}),onInitialized:Y=>B.onNotification(t.InitializedNotification.type,Y),onShutdown:Y=>(Ge=Y,{dispose:()=>{Ge=void 0}}),onExit:Y=>(Bt=Y,{dispose:()=>{Bt=void 0}}),get console(){return ue},get telemetry(){return Le},get tracer(){return oe},get client(){return Ke},get window(){return re},get workspace(){return Ce},get languages(){return te},get notebooks(){return we},onDidChangeConfiguration:Y=>B.onNotification(t.DidChangeConfigurationNotification.type,Y),onDidChangeWatchedFiles:Y=>B.onNotification(t.DidChangeWatchedFilesNotification.type,Y),__textDocumentSync:void 0,onDidOpenTextDocument:Y=>B.onNotification(t.DidOpenTextDocumentNotification.type,Y),onDidChangeTextDocument:Y=>B.onNotification(t.DidChangeTextDocumentNotification.type,Y),onDidCloseTextDocument:Y=>B.onNotification(t.DidCloseTextDocumentNotification.type,Y),onWillSaveTextDocument:Y=>B.onNotification(t.WillSaveTextDocumentNotification.type,Y),onWillSaveTextDocumentWaitUntil:Y=>B.onRequest(t.WillSaveTextDocumentWaitUntilRequest.type,Y),onDidSaveTextDocument:Y=>B.onNotification(t.DidSaveTextDocumentNotification.type,Y),sendDiagnostics:Y=>B.sendNotification(t.PublishDiagnosticsNotification.type,Y),onHover:Y=>B.onRequest(t.HoverRequest.type,(X,de)=>Y(X,de,(0,r.attachWorkDone)(B,X),void 0)),onCompletion:Y=>B.onRequest(t.CompletionRequest.type,(X,de)=>Y(X,de,(0,r.attachWorkDone)(B,X),(0,r.attachPartialResult)(B,X))),onCompletionResolve:Y=>B.onRequest(t.CompletionResolveRequest.type,Y),onSignatureHelp:Y=>B.onRequest(t.SignatureHelpRequest.type,(X,de)=>Y(X,de,(0,r.attachWorkDone)(B,X),void 0)),onDeclaration:Y=>B.onRequest(t.DeclarationRequest.type,(X,de)=>Y(X,de,(0,r.attachWorkDone)(B,X),(0,r.attachPartialResult)(B,X))),onDefinition:Y=>B.onRequest(t.DefinitionRequest.type,(X,de)=>Y(X,de,(0,r.attachWorkDone)(B,X),(0,r.attachPartialResult)(B,X))),onTypeDefinition:Y=>B.onRequest(t.TypeDefinitionRequest.type,(X,de)=>Y(X,de,(0,r.attachWorkDone)(B,X),(0,r.attachPartialResult)(B,X))),onImplementation:Y=>B.onRequest(t.ImplementationRequest.type,(X,de)=>Y(X,de,(0,r.attachWorkDone)(B,X),(0,r.attachPartialResult)(B,X))),onReferences:Y=>B.onRequest(t.ReferencesRequest.type,(X,de)=>Y(X,de,(0,r.attachWorkDone)(B,X),(0,r.attachPartialResult)(B,X))),onDocumentHighlight:Y=>B.onRequest(t.DocumentHighlightRequest.type,(X,de)=>Y(X,de,(0,r.attachWorkDone)(B,X),(0,r.attachPartialResult)(B,X))),onDocumentSymbol:Y=>B.onRequest(t.DocumentSymbolRequest.type,(X,de)=>Y(X,de,(0,r.attachWorkDone)(B,X),(0,r.attachPartialResult)(B,X))),onWorkspaceSymbol:Y=>B.onRequest(t.WorkspaceSymbolRequest.type,(X,de)=>Y(X,de,(0,r.attachWorkDone)(B,X),(0,r.attachPartialResult)(B,X))),onWorkspaceSymbolResolve:Y=>B.onRequest(t.WorkspaceSymbolResolveRequest.type,Y),onCodeAction:Y=>B.onRequest(t.CodeActionRequest.type,(X,de)=>Y(X,de,(0,r.attachWorkDone)(B,X),(0,r.attachPartialResult)(B,X))),onCodeActionResolve:Y=>B.onRequest(t.CodeActionResolveRequest.type,(X,de)=>Y(X,de)),onCodeLens:Y=>B.onRequest(t.CodeLensRequest.type,(X,de)=>Y(X,de,(0,r.attachWorkDone)(B,X),(0,r.attachPartialResult)(B,X))),onCodeLensResolve:Y=>B.onRequest(t.CodeLensResolveRequest.type,(X,de)=>Y(X,de)),onDocumentFormatting:Y=>B.onRequest(t.DocumentFormattingRequest.type,(X,de)=>Y(X,de,(0,r.attachWorkDone)(B,X),void 0)),onDocumentRangeFormatting:Y=>B.onRequest(t.DocumentRangeFormattingRequest.type,(X,de)=>Y(X,de,(0,r.attachWorkDone)(B,X),void 0)),onDocumentOnTypeFormatting:Y=>B.onRequest(t.DocumentOnTypeFormattingRequest.type,(X,de)=>Y(X,de)),onRenameRequest:Y=>B.onRequest(t.RenameRequest.type,(X,de)=>Y(X,de,(0,r.attachWorkDone)(B,X),void 0)),onPrepareRename:Y=>B.onRequest(t.PrepareRenameRequest.type,(X,de)=>Y(X,de)),onDocumentLinks:Y=>B.onRequest(t.DocumentLinkRequest.type,(X,de)=>Y(X,de,(0,r.attachWorkDone)(B,X),(0,r.attachPartialResult)(B,X))),onDocumentLinkResolve:Y=>B.onRequest(t.DocumentLinkResolveRequest.type,(X,de)=>Y(X,de)),onDocumentColor:Y=>B.onRequest(t.DocumentColorRequest.type,(X,de)=>Y(X,de,(0,r.attachWorkDone)(B,X),(0,r.attachPartialResult)(B,X))),onColorPresentation:Y=>B.onRequest(t.ColorPresentationRequest.type,(X,de)=>Y(X,de,(0,r.attachWorkDone)(B,X),(0,r.attachPartialResult)(B,X))),onFoldingRanges:Y=>B.onRequest(t.FoldingRangeRequest.type,(X,de)=>Y(X,de,(0,r.attachWorkDone)(B,X),(0,r.attachPartialResult)(B,X))),onSelectionRanges:Y=>B.onRequest(t.SelectionRangeRequest.type,(X,de)=>Y(X,de,(0,r.attachWorkDone)(B,X),(0,r.attachPartialResult)(B,X))),onExecuteCommand:Y=>B.onRequest(t.ExecuteCommandRequest.type,(X,de)=>Y(X,de,(0,r.attachWorkDone)(B,X),void 0)),dispose:()=>B.dispose()};for(let Y of Oe)Y.attach(tn);return B.onRequest(t.InitializeRequest.type,Y=>{I.initialize(Y),e.string(Y.trace)&&(oe.trace=t.Trace.fromString(Y.trace));for(let X of Oe)X.initialize(Y.capabilities);if(Ft){let X=Ft(Y,new t.CancellationTokenSource().token,(0,r.attachWorkDone)(B,Y),void 0);return ut(X).then(de=>{if(de instanceof t.ResponseError)return de;let zt=de;zt||(zt={capabilities:{}});let Lt=zt.capabilities;Lt||(Lt={},zt.capabilities=Lt),Lt.textDocumentSync===void 0||Lt.textDocumentSync===null?Lt.textDocumentSync=e.number(tn.__textDocumentSync)?tn.__textDocumentSync:t.TextDocumentSyncKind.None:!e.number(Lt.textDocumentSync)&&!e.number(Lt.textDocumentSync.change)&&(Lt.textDocumentSync.change=e.number(tn.__textDocumentSync)?tn.__textDocumentSync:t.TextDocumentSyncKind.None);for(let cr of Oe)cr.fillServerCapabilities(Lt);return zt})}else{let X={capabilities:{textDocumentSync:t.TextDocumentSyncKind.None}};for(let de of Oe)de.fillServerCapabilities(X.capabilities);return X}}),B.onRequest(t.ShutdownRequest.type,()=>{if(I.shutdownReceived=!0,Ge)return Ge(new t.CancellationTokenSource().token)}),B.onNotification(t.ExitNotification.type,()=>{try{Bt&&Bt()}finally{I.shutdownReceived?I.exit(0):I.exit(1)}}),B.onNotification(t.SetTraceNotification.type,Y=>{oe.trace=t.Trace.fromString(Y.value)}),tn}return Ue.createConnection=Te,Ue}var fn={},aS;function Gj(){if(aS)return fn;aS=1,Object.defineProperty(fn,"__esModule",{value:!0}),fn.resolveModulePath=fn.FileSystem=fn.resolveGlobalYarnPath=fn.resolveGlobalNodePath=fn.resolve=fn.uriToFilePath=void 0;const t=GI,e=dr,n=Xs,r=kb;function i(d){let f=t.parse(d);if(f.protocol!=="file:"||!f.path)return;let p=f.path.split("/");for(var m=0,w=p.length;m<w;m++)p[m]=decodeURIComponent(p[m]);if(process.platform==="win32"&&p.length>1){let E=p[0],y=p[1];E.length===0&&y.length>1&&y[1]===":"&&p.shift()}return e.normalize(p.join("/"))}fn.uriToFilePath=i;function s(){return process.platform==="win32"}function o(d,f,p,m){const w="NODE_PATH",E=["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,b)=>{let R=process.env,C=Object.create(null);Object.keys(R).forEach(A=>C[A]=R[A]),f&&n.existsSync(f)&&(C[w]?C[w]=f+e.delimiter+C[w]:C[w]=f,m&&m(`NODE_PATH value is: ${C[w]}`)),C.ELECTRON_RUN_AS_NODE="1";try{let A=(0,r.fork)("",[],{cwd:p,env:C,execArgv:["-e",E]});if(A.pid===void 0){b(new Error(`Starting process to resolve node module ${d} failed`));return}A.on("error",G=>{b(G)}),A.on("message",G=>{G.c==="r"&&(A.send({c:"e"}),G.s?y(G.r):b(new Error(`Failed to resolve module: ${d}`)))});let q={c:"rs",a:d};A.send(q)}catch(A){b(A)}})}fn.resolve=o;function a(d){let f="npm";const p=Object.create(null);Object.keys(process.env).forEach(E=>p[E]=process.env[E]),p.NO_UPDATE_NOTIFIER="true";const m={encoding:"utf8",env:p};s()&&(f="npm.cmd",m.shell=!0);let w=()=>{};try{process.on("SIGPIPE",w);let E=(0,r.spawnSync)(f,["config","get","prefix"],m).stdout;if(!E){d&&d("'npm config get prefix' didn't return a value.");return}let y=E.trim();return d&&d(`'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.removeListener("SIGPIPE",w)}}fn.resolveGlobalNodePath=a;function c(d){let f="yarn",p={encoding:"utf8"};s()&&(f="yarn.cmd",p.shell=!0);let m=()=>{};try{process.on("SIGPIPE",m);let w=(0,r.spawnSync)(f,["global","dir","--json"],p),E=w.stdout;if(!E){d&&(d("'yarn global dir' didn't return a value."),w.stderr&&d(w.stderr));return}let y=E.trim().split(/\r?\n/);for(let b of y)try{let R=JSON.parse(b);if(R.type==="log")return e.join(R.data,"node_modules")}catch{}return}catch{return}finally{process.removeListener("SIGPIPE",m)}}fn.resolveGlobalYarnPath=c;var u;(function(d){let f;function p(){return f!==void 0||(process.platform==="win32"?f=!1:f=!n.existsSync(__filename.toUpperCase())||!n.existsSync(__filename.toLowerCase())),f}d.isCaseSensitive=p;function m(w,E){return p()?e.normalize(E).indexOf(e.normalize(w))===0:e.normalize(E).toLowerCase().indexOf(e.normalize(w).toLowerCase())===0}d.isParent=m})(u||(fn.FileSystem=u={}));function l(d,f,p,m){return p?(e.isAbsolute(p)||(p=e.join(d,p)),o(f,p,p,m).then(w=>u.isParent(p,w)?w:Promise.reject(new Error(`Failed to load ${f} from node path location.`))).then(void 0,w=>o(f,a(m),d,m))):o(f,a(m),d,m)}return fn.resolveModulePath=l,fn}var ky,cS;function uS(){return cS||(cS=1,ky=St()),ky}var Yc={},Xc={},lS;function Wj(){if(lS)return Xc;lS=1,Object.defineProperty(Xc,"__esModule",{value:!0}),Xc.InlineCompletionFeature=void 0;const t=St(),e=n=>class extends n{get inlineCompletion(){return{on:r=>this.connection.onRequest(t.InlineCompletionRequest.type,(i,s)=>r(i,s,this.attachWorkDoneProgress(i)))}}};return Xc.InlineCompletionFeature=e,Xc}var dS;function Hj(){return dS||(dS=1,function(t){var e=Yc.__createBinding||(Object.create?function(c,u,l,d){d===void 0&&(d=l);var f=Object.getOwnPropertyDescriptor(u,l);(!f||("get"in f?!u.__esModule:f.writable||f.configurable))&&(f={enumerable:!0,get:function(){return u[l]}}),Object.defineProperty(c,d,f)}:function(c,u,l,d){d===void 0&&(d=l),c[d]=u[l]}),n=Yc.__exportStar||function(c,u){for(var l in c)l!=="default"&&!Object.prototype.hasOwnProperty.call(u,l)&&e(u,c,l)};Object.defineProperty(t,"__esModule",{value:!0}),t.ProposedFeatures=t.NotebookDocuments=t.TextDocuments=t.SemanticTokensBuilder=void 0;const r=W$();Object.defineProperty(t,"SemanticTokensBuilder",{enumerable:!0,get:function(){return r.SemanticTokensBuilder}});const i=Wj();n(St(),t);const s=tS();Object.defineProperty(t,"TextDocuments",{enumerable:!0,get:function(){return s.TextDocuments}});const o=rS();Object.defineProperty(t,"NotebookDocuments",{enumerable:!0,get:function(){return o.NotebookDocuments}}),n(oS(),t);var a;(function(c){c.all={__brand:"features",languages:i.InlineCompletionFeature}})(a||(t.ProposedFeatures=a={}))}(Yc)),Yc}var fS;function pS(){return fS||(fS=1,function(t){var e=bc.__createBinding||(Object.create?function(y,b,R,C){C===void 0&&(C=R);var A=Object.getOwnPropertyDescriptor(b,R);(!A||("get"in A?!b.__esModule:A.writable||A.configurable))&&(A={enumerable:!0,get:function(){return b[R]}}),Object.defineProperty(y,C,A)}:function(y,b,R,C){C===void 0&&(C=R),y[C]=b[R]}),n=bc.__exportStar||function(y,b){for(var R in y)R!=="default"&&!Object.prototype.hasOwnProperty.call(b,R)&&e(b,y,R)};Object.defineProperty(t,"__esModule",{value:!0}),t.createConnection=t.Files=void 0;const r=NI,i=by(),s=oS(),o=Gj(),a=uS();n(uS(),t),n(Hj(),t);var c;(function(y){y.uriToFilePath=o.uriToFilePath,y.resolveGlobalNodePath=o.resolveGlobalNodePath,y.resolveGlobalYarnPath=o.resolveGlobalYarnPath,y.resolve=o.resolve,y.resolveModulePath=o.resolveModulePath})(c||(t.Files=c={}));function u(){}let l=!1,d;function f(){const y="--clientProcessId";function b(R){try{let C=parseInt(R);isNaN(C)||(d=setInterval(()=>{try{process.kill(C,0)}catch{process.exit(l?0:1)}},3e3))}catch{}}for(let R=2;R<process.argv.length;R++){let C=process.argv[R];if(C===y&&R+1<process.argv.length){b(process.argv[R+1]);return}else{let A=C.split("=");A[0]===y&&b(A[1])}}}f();const p={initialize:y=>{const b=y.processId;i.number(b)&&d===void 0&&setInterval(()=>{try{process.kill(b,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,b,R,C){let A,q,G,Q;return y!==void 0&&y.__brand==="features"&&(A=y,y=b,b=R,R=C),a.ConnectionStrategy.is(y)||a.ConnectionOptions.is(y)?Q=y:(q=y,G=b,Q=R),w(q,G,Q,A)}t.createConnection=m;function w(y,b,R,C){let A=!1;if(!y&&!b&&process.argv.length>2){let J,le,N=process.argv.slice(2);for(let S=0;S<N.length;S++){let T=N[S];if(T==="--node-ipc"){y=new a.IPCMessageReader(process),b=new a.IPCMessageWriter(process);break}else if(T==="--stdio"){A=!0,y=process.stdin,b=process.stdout;break}else if(T==="--socket"){J=parseInt(N[S+1]);break}else if(T==="--pipe"){le=N[S+1];break}else{var q=T.split("=");if(q[0]==="--socket"){J=parseInt(q[1]);break}else if(q[0]==="--pipe"){le=q[1];break}}}if(J){let S=(0,a.createServerSocketTransport)(J);y=S[0],b=S[1]}else if(le){let S=(0,a.createServerPipeTransport)(le);y=S[0],b=S[1]}}var G="Use arguments of createConnection or set command line parameters: '--node-ipc', '--stdio' or '--socket={number}'";if(!y)throw new Error("Connection input stream is not set. "+G);if(!b)throw new Error("Connection output stream is not set. "+G);if(i.func(y.read)&&i.func(y.on)){let J=y;J.on("end",()=>{process.exit(l?0:1)}),J.on("close",()=>{process.exit(l?0:1)})}const Q=J=>{const le=(0,a.createProtocolConnection)(y,b,J,R);return A&&E(J),le};return(0,s.createConnection)(Q,p,C)}function E(y){function b(C){return C.map(A=>typeof A=="string"?A:(0,r.inspect)(A)).join(" ")}const R=new Map;console.assert=function(A,...q){if(!A)if(q.length===0)y.error("Assertion failed");else{const[G,...Q]=q;y.error(`Assertion failed: ${G} ${b(Q)}`)}},console.count=function(A="default"){const q=String(A);let G=R.get(q)??0;G+=1,R.set(q,G),y.log(`${q}: ${q}`)},console.countReset=function(A){A===void 0?R.clear():R.delete(String(A))},console.debug=function(...A){y.log(b(A))},console.dir=function(A,q){y.log((0,r.inspect)(A,q))},console.log=function(...A){y.log(b(A))},console.error=function(...A){y.error(b(A))},console.trace=function(...A){const q=new Error().stack.replace(/(.+\n){2}/,"");let G="Trace";A.length!==0&&(G+=`: ${b(A)}`),y.log(`${G}
|
|
160
|
+
${q}`)},console.warn=function(...A){y.warn(b(A))}}}(bc)),bc}var ge=pS();function hS(t,e){const n={stacks:t,tokens:e};return Vj(n),n.stacks.flat().forEach(i=>{i.property=void 0}),gS(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[];r.add(o);let a,c=o;for(;c.$container;)if(fi(c.$container)){a=c.$container;break}else if(Dm(c.$container))c=c.$container;else break;if(bD(c.cardinality)){const u=wo({next:{feature:c,type:e.type},cardinalities:n,visited:r,plus:i});for(const l of u)i.add(l.feature);s.push(...u)}if(a){const u=a.elements.indexOf(c);u!==void 0&&u<a.elements.length-1&&s.push(...mS({feature:a,type:e.type},u+1,n,r,i)),s.every(l=>no(l.feature.cardinality,l.feature)||no(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 _y(t){return bt(t)&&(t={feature:t}),wo({next:t,cardinalities:new Map,visited:new Set,plus:new Set})}function wo(t){var e,n,r;const{next:i,cardinalities:s,visited:o,plus:a}=t;if(i===void 0)return[];const{feature:c,type:u}=i;if(fi(c)){if(o.has(c))return[];o.add(c)}if(fi(c))return mS(i,0,s,o,a).map(l=>ep(l,c.cardinality,s));if(Sm(c)||Cm(c))return c.elements.flatMap(l=>wo({next:{feature:l,type:u,property:i.property},cardinalities:s,visited:o,plus:a})).map(l=>ep(l,c.cardinality,s));if(pr(c)){const l={feature:c.terminal,type:u,property:(e=i.property)!==null&&e!==void 0?e:c.feature};return wo({next:l,cardinalities:s,visited:o,plus:a}).map(d=>ep(d,c.cardinality,s))}else{if(Zi(c))return Ay({next:{feature:c,type:ja(c),property:(n=i.property)!==null&&n!==void 0?n:c.feature},cardinalities:s,visited:o,plus:a});if(Nr(c)&&Yt(c.rule.ref)){const l=c.rule.ref,d={feature:l.definition,type:l.fragment||l.dataType?void 0:(r=es(l))!==null&&r!==void 0?r:l.name,property:i.property};return wo({next:d,cardinalities:s,visited:o,plus:a}).map(f=>ep(f,c.cardinality,s))}else return[i]}}function ep(t,e,n){return n.set(t.feature,e),t}function mS(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(...wo({next:a,cardinalities:n,visited:r,plus:i})),!!no((s=a.feature.cardinality)!==null&&s!==void 0?s:n.get(a.feature),a.feature)););return o}function Vj(t){for(const e of t.tokens){const n=gS(t.stacks,e);t.stacks=n}}function gS(t,e){const n=[];for(const r of t)n.push(...Kj(r,e));return n}function Kj(t,e){const n=new Map,r=new Set(t.map(s=>s.feature).filter(Yj)),i=[];for(;t.length>0;){const s=t.pop(),o=Ay({next:s,cardinalities:n,plus:r,visited:new Set}).filter(a=>e?Py(a.feature,e):!0);for(const a of o)i.push([...t,a]);if(!o.every(a=>no(a.feature.cardinality,a.feature)||no(n.get(a.feature))))break}return i}function Yj(t){if(t.cardinality==="+")return!0;const e=Xt(t,pr);return!!(e&&e.cardinality==="+")}function Py(t,e){if(hr(t))return t.value===e.image;if(Nr(t))return Xj(t.rule.ref,e);if($a(t)){const n=Fm(t);if(n)return Py(n,e)}return!1}function Xj(t,e){return Yt(t)?_y(t.definition).some(r=>Py(r.feature,e)):Or(t)?Ua(t).test(e.image):!1}function Jj(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 yS{constructor(e){this.scopeProvider=e.references.ScopeProvider,this.grammar=e.Grammar,this.completionParser=e.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=(u,l)=>{const d=this.fillCompletionItem(u,l);d&&i.push(d)},a=u=>hr(u.feature)?u.feature.value:u.feature,c=[];for(const u of s)if(await Promise.all(et(u.features).distinct(a).exclude(c).map(l=>this.completionFor(u,l,o))),c.push(...u.features),!this.continueCompletion(i))break;return ge.CompletionList.create(this.deduplicateItems(i),!0)}deduplicateItems(e){return et(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 c=jd(this.grammar),u=_y({feature:c.definition,type:es(c)});return s.length>0?(s.shift(),hS(u.map(l=>[l]),s)):u}const o=[...s].splice(i.tokenIndex);return hS([i.elementStack.map(c=>({feature:c}))],o)}*buildContexts(e,n){var r,i;const s=e.parseResult.value.$cstNode;if(!s)return;const o=e.textDocument,a=o.getText(),c=o.offsetAt(n),u={document:e,textDocument:o,offset:c,position:n},l=this.findDataTypeRuleStart(s,c);if(l){const[b,R]=l,C=(r=Sd(s,b))===null||r===void 0?void 0:r.astNode;yield Object.assign(Object.assign({},u),{node:C,tokenOffset:b,tokenEndOffset:R,features:this.findFeaturesAt(o,b)})}const{nextTokenStart:d,nextTokenEnd:f,previousTokenStart:p,previousTokenEnd:m}=this.backtrackToAnyToken(a,c);let w=d;c<=d&&p!==void 0&&(w=p);const E=(i=Sd(s,w))===null||i===void 0?void 0:i.astNode;let y=!0;if(p!==void 0&&m!==void 0&&m===c&&(yield Object.assign(Object.assign({},u),{node:E,tokenOffset:p,tokenEndOffset:m,features:this.findFeaturesAt(o,p)}),y=this.performNextTokenCompletion(e,a.substring(p,m),p,m),y&&(yield Object.assign(Object.assign({},u),{node:E,tokenOffset:m,tokenEndOffset:m,features:this.findFeaturesAt(o,m)}))),E)y&&(yield Object.assign(Object.assign({},u),{node:E,tokenOffset:d,tokenEndOffset:f,features:this.findFeaturesAt(o,d)}));else{const b=jd(this.grammar);if(!b)throw new Error("Missing entry parser rule");yield Object.assign(Object.assign({},u),{tokenOffset:d,tokenEndOffset:f,features:_y(b.definition)})}}performNextTokenCompletion(e,n,r,i){return new RegExp("\\P{L}$","u").test(n)}findDataTypeRuleStart(e,n){var r,i;let s=di(e,n,this.grammarConfig.nameRegexp),o=!!(!((r=Xt(s?.grammarSource,Yt))===null||r===void 0)&&r.dataType);if(o){for(;o;)s=s?.container,o=!!(!((i=Xt(s?.grammarSource,Yt))===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?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(hr(n.feature))return this.completionForKeyword(e,n.feature,r);if($a(n.feature)&&e.node)return this.completionForCrossReference(e,n,r)}completionForCrossReference(e,n,r){const i=Xt(n.feature,pr);let s=e.node;if(i&&s){n.type&&(s={$type:n.type,$container:s,$containerProperty:n.property},_m(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.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.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 u=this.nameProvider.getName(n.node);if(!u)return;s=u}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(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().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 Qj{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=di(s,e.textDocument.offsetAt(n.position),this.grammarConfig.nameRegexp);if(o)return this.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=mt(n.astNode);if(n&&r)return{source:e,target:n,targetDocument:r}}}}class vS{constructor(e){this.references=e.references.References,this.nameProvider=e.references.NameProvider,this.grammarConfig=e.parser.GrammarConfig}getDocumentHighlight(e,n,r){const i=e.parseResult.value.$cstNode;if(!i)return;const s=di(i,e.textDocument.offsetAt(n.position),this.grammarConfig.nameRegexp);if(!s)return;const o=this.references.findDeclaration(s);if(o){const a=Rt.equals(mt(o).uri,e.uri),c={documentUri:e.uri,includeDeclaration:a};return this.references.findReferences(o,c).map(l=>this.createDocumentHighlight(l)).toArray()}}createDocumentHighlight(e){return ge.DocumentHighlight.create(e.segment.range)}}class Zj{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){const r=[];for(const i of Ma(n)){const s=this.getSymbol(e,i);r.push(...s)}if(r.length>0)return r}}class e4{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.LanguageServer.onInitialized(r=>{n&&this.registerFileWatcher(e)})}registerFileWatcher(e){const n=et(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.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([Wt.parse(e.document.uri)],[])}didChangeWatchedFiles(e){const n=et(e.changes).filter(i=>i.type!==ge.FileChangeType.Deleted).distinct(i=>i.uri).map(i=>Wt.parse(i.uri)).toArray(),r=et(e.changes).filter(i=>i.type===ge.FileChangeType.Deleted).distinct(i=>i.uri).map(i=>Wt.parse(i.uri)).toArray();this.fireDocumentUpdate(n,r)}}class t4{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=mr(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)||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 Kb(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.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 n4{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 c=n.charCodeAt(a),u=e.charCodeAt(s);if((c===u||this.toUpperCharCode(c)===this.toUpperCharCode(u))&&(r||(r=i===void 0||this.isWordTransition(i,c)),r&&s++,s===e.length))return!0;i=c}return!1}isWordTransition(e,n){return wS<=e&&e<=bS&&r4<=n&&n<=i4||e===DS&&n!==DS}toUpperCharCode(e){return wS<=e&&e<=bS?e-32:e}}const wS=97,bS=122,r4=65,i4=90,DS=95;class ES{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;if(s){const o=e.textDocument.offsetAt(n.position),a=di(s,o,this.grammarConfig.nameRegexp);if(a&&a.offset+a.length>o){const c=this.references.findDeclaration(a);if(c)return this.getAstNodeHoverContent(c)}}}}class s4 extends ES{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 tp=St();const o4={[ge.SemanticTokenTypes.class]:0,[ge.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.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},a4={[ge.SemanticTokenModifiers.abstract]:1,[ge.SemanticTokenModifiers.async]:2,[ge.SemanticTokenModifiers.declaration]:4,[ge.SemanticTokenModifiers.defaultLibrary]:8,[ge.SemanticTokenModifiers.definition]:16,[ge.SemanticTokenModifiers.deprecated]:32,[ge.SemanticTokenModifiers.documentation]:64,[ge.SemanticTokenModifiers.modification]:128,[ge.SemanticTokenModifiers.readonly]:256,[ge.SemanticTokenModifiers.static]:512};function c4(t){const e=[],n=[];let r=!0,i=!0,s=!0;for(const o of t)o&&(o.legend.tokenTypes.forEach((a,c)=>{const u=e[c];if(u&&u!==a)throw new Error(`Cannot merge '${u}' and '${a}' token types. They use the same index ${c}.`);e[c]=a}),o.legend.tokenModifiers.forEach((a,c)=>{const u=n[c];if(u&&u!==a)throw new Error(`Cannot merge '${u}' and '${a}' token modifier. They use the same index ${c}.`);n[c]=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 u4 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(){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 l4{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===void 0?void 0:r.semanticTokens)})}initialize(e){this.clientCapabilities=e}get tokenTypes(){return o4}get tokenModifiers(){return a4}get semanticTokensOptions(){return{legend:{tokenTypes:Object.keys(this.tokenTypes),tokenModifiers:Object.keys(this.tokenModifiers)},full:{delta:!0},range:!0}}async semanticHighlight(e,n,r=rt.CancellationToken.None){return this.currentRange=void 0,this.currentDocument=e,this.currentTokensBuilder=this.getDocumentTokensBuilder(e),this.currentTokensBuilder.flush(),await this.computeHighlighting(e,this.createAcceptor(),r),this.currentTokensBuilder.build()}async semanticHighlightRange(e,n,r=rt.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=rt.CancellationToken.None){return this.currentRange=void 0,this.currentDocument=e,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(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 u4;return this.tokensBuilders.set(e.uri.toString(),r),r}async computeHighlighting(e,n,r){const i=e.parseResult.value,s=Fr(i,{range:this.currentRange}).iterator();let o;do if(o=s.next(),!o.done){await Nt(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;let s=e.modifier;if(this.currentRange&&!mm(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 d=this.tokenModifiers[l];a|=d}}const c=r.start.line,u=r.end.line;if(c===u){const l=r.start.character,d=r.end.character-l;this.currentTokensBuilder.push(c,l,d,o,a)}else if(!((n=this.clientCapabilities)===null||n===void 0)&&n.multilineTokenSupport){const l=r.start.character,d=this.currentDocument.textDocument.offsetAt(r.start),f=this.currentDocument.textDocument.offsetAt(r.end);this.currentTokensBuilder.push(c,l,f-d,o,a)}else{const l=r.start;let d=this.currentDocument.textDocument.offsetAt({line:c+1,character:0});this.currentTokensBuilder.push(l.line,l.character,d-l.character-1,o,a);for(let f=c+1;f<u;f++){const p=d;d=this.currentDocument.textDocument.offsetAt({line:f+1,character:0}),this.currentTokensBuilder.push(f,0,d-p-1,o,a)}this.currentTokensBuilder.push(u,0,r.end.character,o,a)}}highlightProperty(e){const n=[];if(typeof e.index=="number"){const s=vn(e.node.$cstNode,e.property,e.index);s&&n.push(s)}else n.push(...to(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 c=qa(n.$cstNode,r,s);c&&a.push(c)}else a.push(...Mm(n.$cstNode,r));for(const c of a)this.highlightNode({node:c,type:i,modifier:o})}highlightNode(e){const{node:n,type:r,modifier:i}=e,s=n.range;this.highlightToken({range:s,type:r,modifier:i})}}var RS;(function(t){function e(r,i,s){const o=new Map;Object.entries(i).forEach(([u,l])=>o.set(l,u));let a=0,c=0;return n(r.data,5).map(u=>{a+=u[0],u[0]!==0&&(c=0),c+=u[1];const l=u[2];return{offset:s.textDocument.offsetAt({line:a,character:c}),tokenType:o.get(u[3]),tokenModifiers:u[4],text:s.textDocument.getText({start:{line:a,character:c},end:{line:a,character:c+l}})}})}t.decode=e;function n(r,i){const s=[];for(let o=0;o<r.length;o+=i){const a=r.slice(o,o+i);s.push(a)}return s}})(RS||(RS={}));function d4(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 f4{constructor(e){this.onInitializeEmitter=new tp.Emitter,this.onInitializedEmitter=new tp.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(){my(this.services),this.services.ServiceRegistry.all.forEach(e=>my(e))}hasService(e){return this.services.ServiceRegistry.all.some(r=>e(r)!==void 0)}buildInitializeResult(e){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,c=this.services.ServiceRegistry.all,u=this.hasService(ee=>{var k;return(k=ee.lsp)===null||k===void 0?void 0:k.Formatter}),l=c.map(ee=>{var k,pe;return(pe=(k=ee.lsp)===null||k===void 0?void 0:k.Formatter)===null||pe===void 0?void 0:pe.formatOnTypeOptions}).find(ee=>!!ee),d=this.hasService(ee=>{var k;return(k=ee.lsp)===null||k===void 0?void 0:k.CodeActionProvider}),f=this.hasService(ee=>{var k;return(k=ee.lsp)===null||k===void 0?void 0:k.SemanticTokenProvider}),p=c4(c.map(ee=>{var k,pe;return(pe=(k=ee.lsp)===null||k===void 0?void 0:k.SemanticTokenProvider)===null||pe===void 0?void 0:pe.semanticTokensOptions})),m=(i=(r=this.services.lsp)===null||r===void 0?void 0:r.ExecuteCommandHandler)===null||i===void 0?void 0:i.commands,w=this.hasService(ee=>{var k;return(k=ee.lsp)===null||k===void 0?void 0:k.DocumentLinkProvider}),E=d4(c.map(ee=>{var k,pe;return(pe=(k=ee.lsp)===null||k===void 0?void 0:k.SignatureHelp)===null||pe===void 0?void 0:pe.signatureHelpOptions})),y=this.hasService(ee=>{var k;return(k=ee.lsp)===null||k===void 0?void 0:k.TypeProvider}),b=this.hasService(ee=>{var k;return(k=ee.lsp)===null||k===void 0?void 0:k.ImplementationProvider}),R=this.hasService(ee=>{var k;return(k=ee.lsp)===null||k===void 0?void 0:k.CompletionProvider}),C=Jj(c.map(ee=>{var k,pe;return(pe=(k=ee.lsp)===null||k===void 0?void 0:k.CompletionProvider)===null||pe===void 0?void 0:pe.completionOptions})),A=this.hasService(ee=>{var k;return(k=ee.lsp)===null||k===void 0?void 0:k.ReferencesProvider}),q=this.hasService(ee=>{var k;return(k=ee.lsp)===null||k===void 0?void 0:k.DocumentSymbolProvider}),G=this.hasService(ee=>{var k;return(k=ee.lsp)===null||k===void 0?void 0:k.DefinitionProvider}),Q=this.hasService(ee=>{var k;return(k=ee.lsp)===null||k===void 0?void 0:k.DocumentHighlightProvider}),J=this.hasService(ee=>{var k;return(k=ee.lsp)===null||k===void 0?void 0:k.FoldingRangeProvider}),le=this.hasService(ee=>{var k;return(k=ee.lsp)===null||k===void 0?void 0:k.HoverProvider}),N=this.hasService(ee=>{var k;return(k=ee.lsp)===null||k===void 0?void 0:k.RenameProvider}),S=this.hasService(ee=>{var k;return(k=ee.lsp)===null||k===void 0?void 0:k.CallHierarchyProvider}),T=this.hasService(ee=>{var k;return(k=ee.lsp)===null||k===void 0?void 0:k.TypeHierarchyProvider}),O=this.hasService(ee=>{var k;return(k=ee.lsp)===null||k===void 0?void 0:k.CodeLensProvider}),W=this.hasService(ee=>{var k;return(k=ee.lsp)===null||k===void 0?void 0:k.DeclarationProvider}),U=this.hasService(ee=>{var k;return(k=ee.lsp)===null||k===void 0?void 0:k.InlayHintProvider}),K=(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:tp.TextDocumentSyncKind.Incremental,openClose:!0,save:!!o.didSaveDocument,willSave:!!o.willSaveDocument,willSaveWaitUntil:!!o.willSaveDocumentWaitUntil},completionProvider:R?C:void 0,referencesProvider:A,documentSymbolProvider:q,definitionProvider:G,typeDefinitionProvider:y,documentHighlightProvider:Q,codeActionProvider:d,documentFormattingProvider:u,documentRangeFormattingProvider:u,documentOnTypeFormattingProvider:l,foldingRangeProvider:J,hoverProvider:le,renameProvider:N?{prepareProvider:!0}:void 0,semanticTokensProvider:f?p:void 0,signatureHelpProvider:E,implementationProvider:b,callHierarchyProvider:S?{}:void 0,typeHierarchyProvider:T?{}:void 0,documentLinkProvider:w?{resolveProvider:!1}:void 0,codeLensProvider:O?{resolveProvider:!1}:void 0,declarationProvider:W,inlayHintProvider:U?{resolveProvider:!1}:void 0,workspaceSymbolProvider:K?{resolveProvider:!!K.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){const n=this.services.lsp.Connection,r=n?Object.assign(Object.assign({},e),{register:i=>n.client.register(tp.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 p4{getSymbolKind(e){return ge.SymbolKind.Field}getCompletionItemKind(e){return ge.CompletionItemKind.Reference}}class h4{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=di(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(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 m4{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=di(s,o,this.grammarConfig.nameRegexp);if(!a)return;const c=this.references.findDeclaration(a);if(!c)return;const u={onlyLocal:!1,includeDeclaration:!0};return this.references.findReferences(c,u).forEach(d=>{const f=Tn.replace(d.segment.range,n.newName),p=d.sourceUri.toString();i[p]?i[p].push(f):i[p]=[f]}),{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=di(r,i,this.grammarConfig.nameRegexp);if(!s)return;if(this.references.findDeclaration(s)||this.isNameNode(s))return s.range}}isNameNode(e){return e?.astNode&&Uf(e.astNode)&&e===this.nameProvider.getNameNode(e.astNode)}}class TS{constructor(e){this.indexManager=e.workspace.IndexManager,this.nodeKindProvider=e.lsp.NodeKindProvider,this.fuzzyMatcher=e.lsp.FuzzyMatcher}async getSymbols(e,n=rt.CancellationToken.None){const r=[],i=e.query.toLowerCase();for(const s of this.indexManager.allElements())if(await Nt(n),this.fuzzyMatcher.match(i,s.name)){const o=this.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 g4{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(){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(Rt.normalize(e))}set(e){const n=Rt.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){const n=Rt.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=Rt.normalize(i.uri),o=this._configuration.create(s,i.languageId,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=Rt.normalize(i.uri);let c=this._syncedDocuments.get(a);c!==void 0&&(c=this._configuration.update(c,s,o),this._syncedDocuments.set(a,c),this._onDidChangeContent.fire(Object.freeze({document:c})))})),n.push(e.onDidCloseTextDocument(r=>{const i=Rt.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(Rt.normalize(r.textDocument.uri));i!==void 0&&this._onWillSave.fire(Object.freeze({document:i,reason:r.reason}))})),n.push(e.onWillSaveTextDocumentWaitUntil((r,i)=>{const s=this._syncedDocuments.get(Rt.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(Rt.normalize(r.textDocument.uri));i!==void 0&&this._onDidSave.fire(Object.freeze({document:i}))})),ge.Disposable.create(()=>{n.forEach(r=>r.dispose())})}}function y4(t){return Hf.merge(AT(t),v4(t))}function v4(t){return{lsp:{CompletionProvider:e=>new yS(e),DocumentSymbolProvider:e=>new Zj(e),HoverProvider:e=>new s4(e),FoldingRangeProvider:e=>new t4(e),ReferencesProvider:e=>new h4(e),DefinitionProvider:e=>new Qj(e),DocumentHighlightProvider:e=>new vS(e),RenameProvider:e=>new m4(e)},shared:()=>t.shared}}function w4(t){return Hf.merge(_T(t),b4(t))}function b4(t){return{lsp:{Connection:()=>t.connection,LanguageServer:e=>new f4(e),DocumentUpdateHandler:e=>new e4(e),WorkspaceSymbolProvider:e=>new TS(e),NodeKindProvider:()=>new p4,FuzzyMatcher:()=>new n4},workspace:{TextDocuments:()=>new g4(jf)}}}class D4{constructor(){this.collector=()=>{}}getNodeFormatter(e){return new E4(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){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.isFormatRangeErrorFree(e,r)?this.doDocumentFormat(e,n.options,r):[]}get formatOnTypeOptions(){}doDocumentFormat(e,n,r){const i=new Map,s=(a,c,u)=>{var l,d;const f=this.nodeModeToKey(a,c),p=i.get(f),m=(l=u.options.priority)!==null&&l!==void 0?l:0,w=(d=p?.options.priority)!==null&&d!==void 0?d:0;(!p||w<=m)&&i.set(f,u)};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=[];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=mr(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||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=[],c=this.iterateCstTree(e,s).iterator();let u,l;do if(l=c.next(),!l.done){const d=l.value,f=Qi(d),p=this.nodeModeToKey(d,"prepend"),m=n.get(p);if(n.delete(p),m){const y=this.createTextEdit(u,d,m,s);for(const b of y)b&&this.insideRange(b.range,i)&&o.push(b)}const w=this.nodeModeToKey(d,"append"),E=n.get(w);if(n.delete(w),E){const y=Zb(d);if(y){const b=this.createTextEdit(d,y,E,s);for(const R of b)R&&this.insideRange(R.range,i)&&o.push(R)}}if(!m&&d.hidden){const y=this.createHiddenTextEdits(u,d,void 0,s);for(const b of y)b&&this.insideRange(b.range,i)&&o.push(b)}f&&(u=d)}while(!l.done);return o}createHiddenTextEdits(e,n,r,i){var s;const o=n.range.start.line;if(e&&e.range.end.line===o)return[];const a=[],c={start:{character:0,line:o},end:n.range.start},u=i.document.getText(c),l=this.findFittingMove(c,(s=r?.moves)!==null&&s!==void 0?s:[],i),d=this.getExistingIndentationCharacterCount(u,i),p=this.getIndentationCharacterCount(i,l)-d;if(p===0)return[];let m="";p>0&&(m=(i.options.insertSpaces?" ":" ").repeat(p));const w=n.text.split(`
|
|
161
|
+
`);w[0]=u+w[0];for(let E=0;E<w.length;E++){const y=o+E,b={character:0,line:y};if(p>0)a.push({newText:m,range:{start:b,end:b}});else{const R=w[E];let C=0;for(;C<R.length;C++){const A=R.charAt(C);if(A!==" "&&A!==" ")break}a.push({newText:"",range:{start:b,end:{line:y,character:Math.min(C,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){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 c=a.characters,u=a.lines,l=a.tabs,d=i.indentation;i.indentation+=l??0;const f=[];return c!==void 0?e?.hidden||f.push(this.createSpaceTextEdit(o,c,r.options)):u!==void 0?f.push(this.createLineTextEdit(o,u,i,r.options)):l!==void 0&&f.push(this.createTabTextEdit(o,!!e,i)),Qi(n)&&(i.indentation=d),f}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.fitIntoOptions(n,s,i);const a=(r.options.insertSpaces?" ".repeat(r.options.tabSize):" ").repeat(r.indentation);return{newText:`${`
|
|
162
|
+
`.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:`${`
|
|
163
|
+
`.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 Qs(i,s=>this.iterateCst(s,n)):Js}iterateCst(e,n){if(!xr(e))return Js;const r=n.indentation;return new Pt(()=>({index:0}),i=>i.index<e.content.length?{done:!1,value:e.content[i.index++]}:(n.indentation=r,Kt))}}class E4{constructor(e,n){this.astNode=e,this.collector=n}node(e){return new ar(e.$cstNode?[e.$cstNode]:[],this.collector)}nodes(...e){const n=[];for(const r of e)r.$cstNode&&n.push(r.$cstNode);return new ar(n,this.collector)}property(e,n){const r=vn(this.astNode.$cstNode,e,n);return new ar(r?[r]:[],this.collector)}properties(...e){const n=[];for(const r of e){const i=to(this.astNode.$cstNode,r);n.push(...i)}return new ar(n,this.collector)}keyword(e,n){const r=qa(this.astNode.$cstNode,e,n);return new ar(r?[r]:[],this.collector)}keywords(...e){const n=[];for(const r of e){const i=Mm(this.astNode.$cstNode,r);n.push(...i)}return new ar(n,this.collector)}cst(e){return new ar([...e],this.collector)}interior(e,n){const r=e.nodes,i=n.nodes;if(r.length!==1||i.length!==1)return new ar([],this.collector);let s=r[0],o=i[0];if(s.offset>o.offset){const a=s;s=o,o=a}return new ar(eD(s,o),this.collector)}}class ar{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 ar(this.nodes.slice(e,n),this.collector)}}var Ei;(function(t){function e(...l){return{options:{},moves:l.flatMap(d=>d.moves).sort(u)}}t.fit=e;function n(l){return i(0,l)}t.noSpace=n;function r(l){return i(1,l)}t.oneSpace=r;function i(l,d){return{options:d??{},moves:[{characters:l}]}}t.spaces=i;function s(l){return o(1,l)}t.newLine=s;function o(l,d){return{options:d??{},moves:[{lines:l}]}}t.newLines=o;function a(l){return{options:l??{},moves:[{tabs:1,lines:1}]}}t.indent=a;function c(l){return{options:l??{},moves:[{tabs:0}]}}t.noIndent=c;function u(l,d){var f,p,m,w,E,y;const b=(f=l.lines)!==null&&f!==void 0?f:0,R=(p=d.lines)!==null&&p!==void 0?p:0,C=(m=l.tabs)!==null&&m!==void 0?m:0,A=(w=d.tabs)!==null&&w!==void 0?w:0,q=(E=l.characters)!==null&&E!==void 0?E:0,G=(y=d.characters)!==null&&y!==void 0?y:0;return b<R?-1:b>R?1:C<A?-1:C>A?1:q<G?-1:q>G?1:0}})(Ei||(Ei={}));var Iy,$S;function R4(){return $S||($S=1,Iy=pS()),Iy}R4();var Jc={},Qc={},Zc={},Ts={},Ri={},ni={},SS;function CS(){if(SS)return ni;SS=1,Object.defineProperty(ni,"__esModule",{value:!0}),ni.normalizePath=ni.convertSlashes=ni.cleanPath=void 0;const t=dr;function e(s){let o=(0,t.normalize)(s);return o.length>1&&o[o.length-1]===t.sep&&(o=o.substring(0,o.length-1)),o}ni.cleanPath=e;const n=/[\\/]/g;function r(s,o){return s.replace(n,o)}ni.convertSlashes=r;function i(s,o){const{resolvePaths:a,normalizePath:c,pathSeparator:u}=o,l=process.platform==="win32"&&s.includes("/")||s.startsWith(".");if(a&&(s=(0,t.resolve)(s)),(c||l)&&(s=e(s)),s===".")return"";const d=s[s.length-1]!==u;return r(d?s+u:s,u)}return ni.normalizePath=i,ni}var ri={},kS;function T4(){if(kS)return ri;kS=1,Object.defineProperty(ri,"__esModule",{value:!0}),ri.build=ri.joinDirectoryPath=ri.joinPathWithBasePath=void 0;const t=dr,e=CS();function n(a,c){return c+a}ri.joinPathWithBasePath=n;function r(a,c){return function(u,l){return l.startsWith(a)?l.replace(a,"")+u:(0,e.convertSlashes)((0,t.relative)(a,l),c.pathSeparator)+c.pathSeparator+u}}function i(a){return a}function s(a,c,u){return c+a+u}ri.joinDirectoryPath=s;function o(a,c){const{relativePaths:u,includeBasePath:l}=c;return u&&a?r(a,c):l?n:i}return ri.build=o,ri}var eu={},AS;function $4(){if(AS)return eu;AS=1,Object.defineProperty(eu,"__esModule",{value:!0}),eu.build=void 0;function t(o){return function(a,c){c.push(a.substring(o.length)||".")}}function e(o){return function(a,c,u){const l=a.substring(o.length)||".";u.every(d=>d(l,!0))&&c.push(l)}}const n=(o,a)=>{a.push(o||".")},r=(o,a,c)=>{const u=o||".";c.every(l=>l(u,!0))&&a.push(u)},i=()=>{};function s(o,a){const{includeDirs:c,filters:u,relativePaths:l}=a;return c?l?u&&u.length?e(o):t(o):u&&u.length?r:n:i}return eu.build=s,eu}var tu={},_S;function S4(){if(_S)return tu;_S=1,Object.defineProperty(tu,"__esModule",{value:!0}),tu.build=void 0;const t=(o,a,c,u)=>{u.every(l=>l(o,!1))&&c.files++},e=(o,a,c,u)=>{u.every(l=>l(o,!1))&&a.push(o)},n=(o,a,c,u)=>{c.files++},r=(o,a)=>{a.push(o)},i=()=>{};function s(o){const{excludeFiles:a,filters:c,onlyCounts:u}=o;return a?i:c&&c.length?u?t:e:u?n:r}return tu.build=s,tu}var nu={},PS;function C4(){if(PS)return nu;PS=1,Object.defineProperty(nu,"__esModule",{value:!0}),nu.build=void 0;const t=r=>r,e=()=>[""].slice(0,0);function n(r){return r.group?e:t}return nu.build=n,nu}var ru={},IS;function k4(){if(IS)return ru;IS=1,Object.defineProperty(ru,"__esModule",{value:!0}),ru.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 ru.build=n,ru}var bo={},xS;function A4(){if(xS)return bo;xS=1;var t=bo.__importDefault||function(c){return c&&c.__esModule?c:{default:c}};Object.defineProperty(bo,"__esModule",{value:!0}),bo.build=void 0;const e=t(Xs),n=dr,r=function(c,u,l){const{queue:d,options:{suppressErrors:f}}=u;d.enqueue(),e.default.realpath(c,(p,m)=>{if(p)return d.dequeue(f?null:p,u);e.default.stat(m,(w,E)=>{if(w)return d.dequeue(f?null:w,u);if(E.isDirectory()&&o(c,m,u))return d.dequeue(null,u);l(E,m),d.dequeue(null,u)})})},i=function(c,u,l){const{queue:d,options:{suppressErrors:f}}=u;d.enqueue();try{const p=e.default.realpathSync(c),m=e.default.statSync(p);if(m.isDirectory()&&o(c,p,u))return;l(m,p)}catch(p){if(!f)throw p}};function s(c,u){return!c.resolveSymlinks||c.excludeSymlinks?null:u?i:r}bo.build=s;function o(c,u,l){if(l.options.useRealPaths)return a(u,l);let d=(0,n.dirname)(c),f=1;for(;d!==l.root&&f<2;){const p=l.symlinks.get(d);!!p&&(p===u||p.startsWith(u)||u.startsWith(p))?f++:d=(0,n.dirname)(d)}return l.symlinks.set(c,u),f>1}function a(c,u){return u.visited.includes(c+u.options.pathSeparator)}return bo}var iu={},OS;function _4(){if(OS)return iu;OS=1,Object.defineProperty(iu,"__esModule",{value:!0}),iu.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,d,f)=>(c(d,f,l.counts,l.options.suppressErrors),null),s=(l,d,f)=>(c(d,f,l.paths,l.options.suppressErrors),null),o=(l,d,f)=>(c(d,f,l.paths.slice(0,l.options.maxFiles),l.options.suppressErrors),null),a=(l,d,f)=>(c(d,f,l.groups,l.options.suppressErrors),null);function c(l,d,f,p){d(l&&!p?l:null,f)}function u(l,d){const{onlyCounts:f,group:p,maxFiles:m}=l;return f?d?t:i:p?d?e:a:m?d?r:o:d?n:s}return iu.build=u,iu}var Do={},NS;function P4(){if(NS)return Do;NS=1;var t=Do.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(Do,"__esModule",{value:!0}),Do.build=void 0;const e=t(Xs),n={withFileTypes:!0},r=(o,a,c,u,l)=>{if(u<0)return o.queue.dequeue(null,o);o.visited.push(a),o.counts.directories++,o.queue.enqueue(),e.default.readdir(a||".",n,(d,f=[])=>{l(f,c,u),o.queue.dequeue(o.options.suppressErrors?null:d,o)})},i=(o,a,c,u,l)=>{if(u<0)return;o.visited.push(a),o.counts.directories++;let d=[];try{d=e.default.readdirSync(a||".",n)}catch(f){if(!o.options.suppressErrors)throw f}l(d,c,u)};function s(o){return o?i:r}return Do.build=s,Do}var su={},FS;function I4(){if(FS)return su;FS=1,Object.defineProperty(su,"__esModule",{value:!0}),su.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 su.Queue=t,su}var ou={},LS;function x4(){if(LS)return ou;LS=1,Object.defineProperty(ou,"__esModule",{value:!0}),ou.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 ou.Counter=t,ou}var MS;function BS(){if(MS)return Ri;MS=1;var t=Ri.__createBinding||(Object.create?function(E,y,b,R){R===void 0&&(R=b);var C=Object.getOwnPropertyDescriptor(y,b);(!C||("get"in C?!y.__esModule:C.writable||C.configurable))&&(C={enumerable:!0,get:function(){return y[b]}}),Object.defineProperty(E,R,C)}:function(E,y,b,R){R===void 0&&(R=b),E[R]=y[b]}),e=Ri.__setModuleDefault||(Object.create?function(E,y){Object.defineProperty(E,"default",{enumerable:!0,value:y})}:function(E,y){E.default=y}),n=Ri.__importStar||function(E){if(E&&E.__esModule)return E;var y={};if(E!=null)for(var b in E)b!=="default"&&Object.prototype.hasOwnProperty.call(E,b)&&t(y,E,b);return e(y,E),y};Object.defineProperty(Ri,"__esModule",{value:!0}),Ri.Walker=void 0;const r=dr,i=CS(),s=n(T4()),o=n($4()),a=n(S4()),c=n(C4()),u=n(k4()),l=n(A4()),d=n(_4()),f=n(P4()),p=I4(),m=x4();class w{root;isSynchronous;state;joinPath;pushDirectory;pushFile;getArray;groupFiles;resolveSymlink;walkDirectory;callbackInvoker;constructor(y,b,R){this.isSynchronous=!R,this.callbackInvoker=d.build(b,this.isSynchronous),this.root=(0,i.normalizePath)(y,b),this.state={root:this.root.slice(0,-1),paths:[""].slice(0,0),groups:[],counts:new m.Counter,options:b,queue:new p.Queue((C,A)=>this.callbackInvoker(A,C,R)),symlinks:new Map,visited:[""].slice(0,0)},this.joinPath=s.build(this.root,b),this.pushDirectory=o.build(this.root,b),this.pushFile=a.build(b),this.getArray=c.build(b),this.groupFiles=u.build(b),this.resolveSymlink=l.build(b,this.isSynchronous),this.walkDirectory=f.build(this.isSynchronous)}start(){return this.walkDirectory(this.state,this.root,this.root,this.state.options.maxDepth,this.walk),this.isSynchronous?this.callbackInvoker(this.state,null):null}walk=(y,b,R)=>{const{paths:C,options:{filters:A,resolveSymlinks:q,excludeSymlinks:G,exclude:Q,maxFiles:J,signal:le,useRealPaths:N,pathSeparator:S}}=this.state;if(le&&le.aborted||J&&C.length>J)return;this.pushDirectory(b,C,A);const T=this.getArray(this.state.paths);for(let O=0;O<y.length;++O){const W=y[O];if(W.isFile()||W.isSymbolicLink()&&!q&&!G){const U=this.joinPath(W.name,b);this.pushFile(U,T,this.state.counts,A)}else if(W.isDirectory()){let U=s.joinDirectoryPath(W.name,b,this.state.options.pathSeparator);if(Q&&Q(W.name,U))continue;this.walkDirectory(this.state,U,U,R-1,this.walk)}else if(W.isSymbolicLink()&&this.resolveSymlink){let U=s.joinPathWithBasePath(W.name,b);this.resolveSymlink(U,this.state,(K,be)=>{if(K.isDirectory()){if(be=(0,i.normalizePath)(be,this.state.options),Q&&Q(W.name,be))return;this.walkDirectory(this.state,be,N?be:U+S,R-1,this.walk)}else{be=N?be:U;const ee=(0,r.basename)(be),k=(0,i.normalizePath)((0,r.dirname)(be),this.state.options);be=this.joinPath(ee,k),this.pushFile(be,T,this.state.counts,A)}})}}this.groupFiles(this.state.groups,b,T)}}return Ri.Walker=w,Ri}var zS;function O4(){if(zS)return Ts;zS=1,Object.defineProperty(Ts,"__esModule",{value:!0}),Ts.callback=Ts.promise=void 0;const t=BS();function e(r,i){return new Promise((s,o)=>{n(r,i,(a,c)=>{if(a)return o(a);s(c)})})}Ts.promise=e;function n(r,i,s){new t.Walker(r,i,s).start()}return Ts.callback=n,Ts}var au={},qS;function N4(){if(qS)return au;qS=1,Object.defineProperty(au,"__esModule",{value:!0}),au.sync=void 0;const t=BS();function e(n,r){return new t.Walker(n,r).start()}return au.sync=e,au}var jS;function F4(){if(jS)return Zc;jS=1,Object.defineProperty(Zc,"__esModule",{value:!0}),Zc.APIBuilder=void 0;const t=O4(),e=N4();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 Zc.APIBuilder=n,Zc}var xy={},Oy,US;function np(){if(US)return Oy;US=1;const t="\\\\/",e=`[^${t}]`,n="\\.",r="\\+",i="\\?",s="\\/",o="(?=.)",a="[^/]",c=`(?:${s}|$)`,u=`(?:^|${s})`,l=`${n}{1,2}${c}`,d=`(?!${n})`,f=`(?!${u}${l})`,p=`(?!${n}{0,1}${c})`,m=`(?!${l})`,w=`[^.${s}]`,E=`${a}*?`,b={DOT_LITERAL:n,PLUS_LITERAL:r,QMARK_LITERAL:i,SLASH_LITERAL:s,ONE_CHAR:o,QMARK:a,END_ANCHOR:c,DOTS_SLASH:l,NO_DOT:d,NO_DOTS:f,NO_DOT_SLASH:p,NO_DOTS_SLASH:m,QMARK_NO_DOT:w,STAR:E,START_ANCHOR:u,SEP:"/"},R={...b,SLASH_LITERAL:`[${t}]`,QMARK:e,STAR:`${e}*?`,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:"\\"},C={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",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};return Oy={MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:C,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,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,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(A){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${A.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(A){return A===!0?R:b}},Oy}var GS;function rp(){return GS||(GS=1,function(t){const{REGEX_BACKSLASH:e,REGEX_REMOVE_BACKSLASH:n,REGEX_SPECIAL_CHARS:r,REGEX_SPECIAL_CHARS_GLOBAL:i}=np();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.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 c=s.lastIndexOf(o,a);return c===-1?s:s[c-1]==="\\"?t.escapeLast(s,o,c-1):`${s.slice(0,c)}\\${s.slice(c)}`},t.removePrefix=(s,o={})=>{let a=s;return a.startsWith("./")&&(a=a.slice(2),o.prefix="./"),a},t.wrapOutput=(s,o={},a={})=>{const c=a.contains?"":"^",u=a.contains?"":"$";let l=`${c}(?:${s})${u}`;return o.negated===!0&&(l=`(?:^(?!${l}).*$)`),l},t.basename=(s,{windows:o}={})=>{const a=s.split(o?/[\\/]/:"/"),c=a[a.length-1];return c===""?a[a.length-2]:c}}(xy)),xy}var Ny,WS;function L4(){if(WS)return Ny;WS=1;const t=rp(),{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:c,CHAR_LEFT_PARENTHESES:u,CHAR_LEFT_SQUARE_BRACKET:l,CHAR_PLUS:d,CHAR_QUESTION_MARK:f,CHAR_RIGHT_CURLY_BRACE:p,CHAR_RIGHT_PARENTHESES:m,CHAR_RIGHT_SQUARE_BRACKET:w}=np(),E=R=>R===a||R===r,y=R=>{R.isPrefix!==!0&&(R.depth=R.isGlobstar?1/0:1)};return Ny=(R,C)=>{const A=C||{},q=R.length-1,G=A.parts===!0||A.scanToEnd===!0,Q=[],J=[],le=[];let N=R,S=-1,T=0,O=0,W=!1,U=!1,K=!1,be=!1,ee=!1,k=!1,pe=!1,Qe=!1,ct=!1,j=!1,V=0,_e,ie,ve={value:"",depth:0,isGlob:!1};const Te=()=>S>=q,se=()=>N.charCodeAt(S+1),I=()=>(_e=ie,N.charCodeAt(++S));for(;S<q;){ie=I();let Le;if(ie===r){pe=ve.backslashes=!0,ie=I(),ie===c&&(k=!0);continue}if(k===!0||ie===c){for(V++;Te()!==!0&&(ie=I());){if(ie===r){pe=ve.backslashes=!0,I();continue}if(ie===c){V++;continue}if(k!==!0&&ie===s&&(ie=I())===s){if(W=ve.isBrace=!0,K=ve.isGlob=!0,j=!0,G===!0)continue;break}if(k!==!0&&ie===i){if(W=ve.isBrace=!0,K=ve.isGlob=!0,j=!0,G===!0)continue;break}if(ie===p&&(V--,V===0)){k=!1,W=ve.isBrace=!0,j=!0;break}}if(G===!0)continue;break}if(ie===a){if(Q.push(S),J.push(ve),ve={value:"",depth:0,isGlob:!1},j===!0)continue;if(_e===s&&S===T+1){T+=2;continue}O=S+1;continue}if(A.noext!==!0&&(ie===d||ie===n||ie===e||ie===f||ie===o)===!0&&se()===u){if(K=ve.isGlob=!0,be=ve.isExtglob=!0,j=!0,ie===o&&S===T&&(ct=!0),G===!0){for(;Te()!==!0&&(ie=I());){if(ie===r){pe=ve.backslashes=!0,ie=I();continue}if(ie===m){K=ve.isGlob=!0,j=!0;break}}continue}break}if(ie===e){if(_e===e&&(ee=ve.isGlobstar=!0),K=ve.isGlob=!0,j=!0,G===!0)continue;break}if(ie===f){if(K=ve.isGlob=!0,j=!0,G===!0)continue;break}if(ie===l){for(;Te()!==!0&&(Le=I());){if(Le===r){pe=ve.backslashes=!0,I();continue}if(Le===w){U=ve.isBracket=!0,K=ve.isGlob=!0,j=!0;break}}if(G===!0)continue;break}if(A.nonegate!==!0&&ie===o&&S===T){Qe=ve.negated=!0,T++;continue}if(A.noparen!==!0&&ie===u){if(K=ve.isGlob=!0,G===!0){for(;Te()!==!0&&(ie=I());){if(ie===u){pe=ve.backslashes=!0,ie=I();continue}if(ie===m){j=!0;break}}continue}break}if(K===!0){if(j=!0,G===!0)continue;break}}A.noext===!0&&(be=!1,K=!1);let M=N,ue="",B="";T>0&&(ue=N.slice(0,T),N=N.slice(T),O-=T),M&&K===!0&&O>0?(M=N.slice(0,O),B=N.slice(O)):K===!0?(M="",B=N):M=N,M&&M!==""&&M!=="/"&&M!==N&&E(M.charCodeAt(M.length-1))&&(M=M.slice(0,-1)),A.unescape===!0&&(B&&(B=t.removeBackslashes(B)),M&&pe===!0&&(M=t.removeBackslashes(M)));const oe={prefix:ue,input:R,start:T,base:M,glob:B,isBrace:W,isBracket:U,isGlob:K,isExtglob:be,isGlobstar:ee,negated:Qe,negatedExtglob:ct};if(A.tokens===!0&&(oe.maxDepth=0,E(ie)||J.push(ve),oe.tokens=J),A.parts===!0||A.tokens===!0){let Le;for(let Ke=0;Ke<Q.length;Ke++){const re=Le?Le+1:T,Ce=Q[Ke],te=R.slice(re,Ce);A.tokens&&(Ke===0&&T!==0?(J[Ke].isPrefix=!0,J[Ke].value=ue):J[Ke].value=te,y(J[Ke]),oe.maxDepth+=J[Ke].depth),(Ke!==0||te!=="")&&le.push(te),Le=Ce}if(Le&&Le+1<R.length){const Ke=R.slice(Le+1);le.push(Ke),A.tokens&&(J[J.length-1].value=Ke,y(J[J.length-1]),oe.maxDepth+=J[J.length-1].depth)}oe.slashes=Q,oe.parts=le}return oe},Ny}var Fy,HS;function M4(){if(HS)return Fy;HS=1;const t=np(),e=rp(),{MAX_LENGTH:n,POSIX_REGEX_SOURCE:r,REGEX_NON_SPECIAL_CHARS:i,REGEX_SPECIAL_CHARS_BACKREF:s,REPLACEMENTS:o}=t,a=(l,d)=>{if(typeof d.expandRange=="function")return d.expandRange(...l,d);l.sort();const f=`[${l.join("-")}]`;try{new RegExp(f)}catch{return l.map(m=>e.escapeRegex(m)).join("..")}return f},c=(l,d)=>`Missing ${l}: "${d}" - use "\\\\${d}" to match literal characters`,u=(l,d)=>{if(typeof l!="string")throw new TypeError("Expected a string");l=o[l]||l;const f={...d},p=typeof f.maxLength=="number"?Math.min(n,f.maxLength):n;let m=l.length;if(m>p)throw new SyntaxError(`Input length: ${m}, exceeds maximum allowed length: ${p}`);const w={type:"bos",value:"",output:f.prepend||""},E=[w],y=f.capture?"":"?:",b=t.globChars(f.windows),R=t.extglobChars(b),{DOT_LITERAL:C,PLUS_LITERAL:A,SLASH_LITERAL:q,ONE_CHAR:G,DOTS_SLASH:Q,NO_DOT:J,NO_DOT_SLASH:le,NO_DOTS_SLASH:N,QMARK:S,QMARK_NO_DOT:T,STAR:O,START_ANCHOR:W}=b,U=re=>`(${y}(?:(?!${W}${re.dot?Q:C}).)*?)`,K=f.dot?"":J,be=f.dot?S:T;let ee=f.bash===!0?U(f):O;f.capture&&(ee=`(${ee})`),typeof f.noext=="boolean"&&(f.noextglob=f.noext);const k={input:l,index:-1,start:0,dot:f.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:E};l=e.removePrefix(l,k),m=l.length;const pe=[],Qe=[],ct=[];let j=w,V;const _e=()=>k.index===m-1,ie=k.peek=(re=1)=>l[k.index+re],ve=k.advance=()=>l[++k.index]||"",Te=()=>l.slice(k.index+1),se=(re="",Ce=0)=>{k.consumed+=re,k.index+=Ce},I=re=>{k.output+=re.output!=null?re.output:re.value,se(re.value)},M=()=>{let re=1;for(;ie()==="!"&&(ie(2)!=="("||ie(3)==="?");)ve(),k.start++,re++;return re%2===0?!1:(k.negated=!0,k.start++,!0)},ue=re=>{k[re]++,ct.push(re)},B=re=>{k[re]--,ct.pop()},oe=re=>{if(j.type==="globstar"){const Ce=k.braces>0&&(re.type==="comma"||re.type==="brace"),te=re.extglob===!0||pe.length&&(re.type==="pipe"||re.type==="paren");re.type!=="slash"&&re.type!=="paren"&&!Ce&&!te&&(k.output=k.output.slice(0,-j.output.length),j.type="star",j.value="*",j.output=ee,k.output+=j.output)}if(pe.length&&re.type!=="paren"&&(pe[pe.length-1].inner+=re.value),(re.value||re.output)&&I(re),j&&j.type==="text"&&re.type==="text"){j.output=(j.output||j.value)+re.value,j.value+=re.value;return}re.prev=j,E.push(re),j=re},Le=(re,Ce)=>{const te={...R[Ce],conditions:1,inner:""};te.prev=j,te.parens=k.parens,te.output=k.output;const we=(f.capture?"(":"")+te.open;ue("parens"),oe({type:re,value:Ce,output:k.output?"":G}),oe({type:"paren",extglob:!0,value:ve(),output:we}),pe.push(te)},Ke=re=>{let Ce=re.close+(f.capture?")":""),te;if(re.type==="negate"){let we=ee;if(re.inner&&re.inner.length>1&&re.inner.includes("/")&&(we=U(f)),(we!==ee||_e()||/^\)+$/.test(Te()))&&(Ce=re.close=`)$))${we}`),re.inner.includes("*")&&(te=Te())&&/^\.[^\\/.]+$/.test(te)){const Oe=u(te,{...d,fastpaths:!1}).output;Ce=re.close=`)${Oe})${we})`}re.prev.type==="bos"&&(k.negatedExtglob=!0)}oe({type:"paren",extglob:!0,value:V,output:Ce}),B("parens")};if(f.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(l)){let re=!1,Ce=l.replace(s,(te,we,Oe,ut,Ge,Ft)=>ut==="\\"?(re=!0,te):ut==="?"?we?we+ut+(Ge?S.repeat(Ge.length):""):Ft===0?be+(Ge?S.repeat(Ge.length):""):S.repeat(Oe.length):ut==="."?C.repeat(Oe.length):ut==="*"?we?we+ut+(Ge?ee:""):ee:we?te:`\\${te}`);return re===!0&&(f.unescape===!0?Ce=Ce.replace(/\\/g,""):Ce=Ce.replace(/\\+/g,te=>te.length%2===0?"\\\\":te?"\\":"")),Ce===l&&f.contains===!0?(k.output=l,k):(k.output=e.wrapOutput(Ce,k,d),k)}for(;!_e();){if(V=ve(),V==="\0")continue;if(V==="\\"){const te=ie();if(te==="/"&&f.bash!==!0||te==="."||te===";")continue;if(!te){V+="\\",oe({type:"text",value:V});continue}const we=/^\\+/.exec(Te());let Oe=0;if(we&&we[0].length>2&&(Oe=we[0].length,k.index+=Oe,Oe%2!==0&&(V+="\\")),f.unescape===!0?V=ve():V+=ve(),k.brackets===0){oe({type:"text",value:V});continue}}if(k.brackets>0&&(V!=="]"||j.value==="["||j.value==="[^")){if(f.posix!==!1&&V===":"){const te=j.value.slice(1);if(te.includes("[")&&(j.posix=!0,te.includes(":"))){const we=j.value.lastIndexOf("["),Oe=j.value.slice(0,we),ut=j.value.slice(we+2),Ge=r[ut];if(Ge){j.value=Oe+Ge,k.backtrack=!0,ve(),!w.output&&E.indexOf(j)===1&&(w.output=G);continue}}}(V==="["&&ie()!==":"||V==="-"&&ie()==="]")&&(V=`\\${V}`),V==="]"&&(j.value==="["||j.value==="[^")&&(V=`\\${V}`),f.posix===!0&&V==="!"&&j.value==="["&&(V="^"),j.value+=V,I({value:V});continue}if(k.quotes===1&&V!=='"'){V=e.escapeRegex(V),j.value+=V,I({value:V});continue}if(V==='"'){k.quotes=k.quotes===1?0:1,f.keepQuotes===!0&&oe({type:"text",value:V});continue}if(V==="("){ue("parens"),oe({type:"paren",value:V});continue}if(V===")"){if(k.parens===0&&f.strictBrackets===!0)throw new SyntaxError(c("opening","("));const te=pe[pe.length-1];if(te&&k.parens===te.parens+1){Ke(pe.pop());continue}oe({type:"paren",value:V,output:k.parens?")":"\\)"}),B("parens");continue}if(V==="["){if(f.nobracket===!0||!Te().includes("]")){if(f.nobracket!==!0&&f.strictBrackets===!0)throw new SyntaxError(c("closing","]"));V=`\\${V}`}else ue("brackets");oe({type:"bracket",value:V});continue}if(V==="]"){if(f.nobracket===!0||j&&j.type==="bracket"&&j.value.length===1){oe({type:"text",value:V,output:`\\${V}`});continue}if(k.brackets===0){if(f.strictBrackets===!0)throw new SyntaxError(c("opening","["));oe({type:"text",value:V,output:`\\${V}`});continue}B("brackets");const te=j.value.slice(1);if(j.posix!==!0&&te[0]==="^"&&!te.includes("/")&&(V=`/${V}`),j.value+=V,I({value:V}),f.literalBrackets===!1||e.hasRegexChars(te))continue;const we=e.escapeRegex(j.value);if(k.output=k.output.slice(0,-j.value.length),f.literalBrackets===!0){k.output+=we,j.value=we;continue}j.value=`(${y}${we}|${j.value})`,k.output+=j.value;continue}if(V==="{"&&f.nobrace!==!0){ue("braces");const te={type:"brace",value:V,output:"(",outputIndex:k.output.length,tokensIndex:k.tokens.length};Qe.push(te),oe(te);continue}if(V==="}"){const te=Qe[Qe.length-1];if(f.nobrace===!0||!te){oe({type:"text",value:V,output:V});continue}let we=")";if(te.dots===!0){const Oe=E.slice(),ut=[];for(let Ge=Oe.length-1;Ge>=0&&(E.pop(),Oe[Ge].type!=="brace");Ge--)Oe[Ge].type!=="dots"&&ut.unshift(Oe[Ge].value);we=a(ut,f),k.backtrack=!0}if(te.comma!==!0&&te.dots!==!0){const Oe=k.output.slice(0,te.outputIndex),ut=k.tokens.slice(te.tokensIndex);te.value=te.output="\\{",V=we="\\}",k.output=Oe;for(const Ge of ut)k.output+=Ge.output||Ge.value}oe({type:"brace",value:V,output:we}),B("braces"),Qe.pop();continue}if(V==="|"){pe.length>0&&pe[pe.length-1].conditions++,oe({type:"text",value:V});continue}if(V===","){let te=V;const we=Qe[Qe.length-1];we&&ct[ct.length-1]==="braces"&&(we.comma=!0,te="|"),oe({type:"comma",value:V,output:te});continue}if(V==="/"){if(j.type==="dot"&&k.index===k.start+1){k.start=k.index+1,k.consumed="",k.output="",E.pop(),j=w;continue}oe({type:"slash",value:V,output:q});continue}if(V==="."){if(k.braces>0&&j.type==="dot"){j.value==="."&&(j.output=C);const te=Qe[Qe.length-1];j.type="dots",j.output+=V,j.value+=V,te.dots=!0;continue}if(k.braces+k.parens===0&&j.type!=="bos"&&j.type!=="slash"){oe({type:"text",value:V,output:C});continue}oe({type:"dot",value:V,output:C});continue}if(V==="?"){if(!(j&&j.value==="(")&&f.noextglob!==!0&&ie()==="("&&ie(2)!=="?"){Le("qmark",V);continue}if(j&&j.type==="paren"){const we=ie();let Oe=V;(j.value==="("&&!/[!=<:]/.test(we)||we==="<"&&!/<([!=]|\w+>)/.test(Te()))&&(Oe=`\\${V}`),oe({type:"text",value:V,output:Oe});continue}if(f.dot!==!0&&(j.type==="slash"||j.type==="bos")){oe({type:"qmark",value:V,output:T});continue}oe({type:"qmark",value:V,output:S});continue}if(V==="!"){if(f.noextglob!==!0&&ie()==="("&&(ie(2)!=="?"||!/[!=<:]/.test(ie(3)))){Le("negate",V);continue}if(f.nonegate!==!0&&k.index===0){M();continue}}if(V==="+"){if(f.noextglob!==!0&&ie()==="("&&ie(2)!=="?"){Le("plus",V);continue}if(j&&j.value==="("||f.regex===!1){oe({type:"plus",value:V,output:A});continue}if(j&&(j.type==="bracket"||j.type==="paren"||j.type==="brace")||k.parens>0){oe({type:"plus",value:V});continue}oe({type:"plus",value:A});continue}if(V==="@"){if(f.noextglob!==!0&&ie()==="("&&ie(2)!=="?"){oe({type:"at",extglob:!0,value:V,output:""});continue}oe({type:"text",value:V});continue}if(V!=="*"){(V==="$"||V==="^")&&(V=`\\${V}`);const te=i.exec(Te());te&&(V+=te[0],k.index+=te[0].length),oe({type:"text",value:V});continue}if(j&&(j.type==="globstar"||j.star===!0)){j.type="star",j.star=!0,j.value+=V,j.output=ee,k.backtrack=!0,k.globstar=!0,se(V);continue}let re=Te();if(f.noextglob!==!0&&/^\([^?]/.test(re)){Le("star",V);continue}if(j.type==="star"){if(f.noglobstar===!0){se(V);continue}const te=j.prev,we=te.prev,Oe=te.type==="slash"||te.type==="bos",ut=we&&(we.type==="star"||we.type==="globstar");if(f.bash===!0&&(!Oe||re[0]&&re[0]!=="/")){oe({type:"star",value:V,output:""});continue}const Ge=k.braces>0&&(te.type==="comma"||te.type==="brace"),Ft=pe.length&&(te.type==="pipe"||te.type==="paren");if(!Oe&&te.type!=="paren"&&!Ge&&!Ft){oe({type:"star",value:V,output:""});continue}for(;re.slice(0,3)==="/**";){const Bt=l[k.index+4];if(Bt&&Bt!=="/")break;re=re.slice(3),se("/**",3)}if(te.type==="bos"&&_e()){j.type="globstar",j.value+=V,j.output=U(f),k.output=j.output,k.globstar=!0,se(V);continue}if(te.type==="slash"&&te.prev.type!=="bos"&&!ut&&_e()){k.output=k.output.slice(0,-(te.output+j.output).length),te.output=`(?:${te.output}`,j.type="globstar",j.output=U(f)+(f.strictSlashes?")":"|$)"),j.value+=V,k.globstar=!0,k.output+=te.output+j.output,se(V);continue}if(te.type==="slash"&&te.prev.type!=="bos"&&re[0]==="/"){const Bt=re[1]!==void 0?"|$":"";k.output=k.output.slice(0,-(te.output+j.output).length),te.output=`(?:${te.output}`,j.type="globstar",j.output=`${U(f)}${q}|${q}${Bt})`,j.value+=V,k.output+=te.output+j.output,k.globstar=!0,se(V+ve()),oe({type:"slash",value:"/",output:""});continue}if(te.type==="bos"&&re[0]==="/"){j.type="globstar",j.value+=V,j.output=`(?:^|${q}|${U(f)}${q})`,k.output=j.output,k.globstar=!0,se(V+ve()),oe({type:"slash",value:"/",output:""});continue}k.output=k.output.slice(0,-j.output.length),j.type="globstar",j.output=U(f),j.value+=V,k.output+=j.output,k.globstar=!0,se(V);continue}const Ce={type:"star",value:V,output:ee};if(f.bash===!0){Ce.output=".*?",(j.type==="bos"||j.type==="slash")&&(Ce.output=K+Ce.output),oe(Ce);continue}if(j&&(j.type==="bracket"||j.type==="paren")&&f.regex===!0){Ce.output=V,oe(Ce);continue}(k.index===k.start||j.type==="slash"||j.type==="dot")&&(j.type==="dot"?(k.output+=le,j.output+=le):f.dot===!0?(k.output+=N,j.output+=N):(k.output+=K,j.output+=K),ie()!=="*"&&(k.output+=G,j.output+=G)),oe(Ce)}for(;k.brackets>0;){if(f.strictBrackets===!0)throw new SyntaxError(c("closing","]"));k.output=e.escapeLast(k.output,"["),B("brackets")}for(;k.parens>0;){if(f.strictBrackets===!0)throw new SyntaxError(c("closing",")"));k.output=e.escapeLast(k.output,"("),B("parens")}for(;k.braces>0;){if(f.strictBrackets===!0)throw new SyntaxError(c("closing","}"));k.output=e.escapeLast(k.output,"{"),B("braces")}if(f.strictSlashes!==!0&&(j.type==="star"||j.type==="bracket")&&oe({type:"maybe_slash",value:"",output:`${q}?`}),k.backtrack===!0){k.output="";for(const re of k.tokens)k.output+=re.output!=null?re.output:re.value,re.suffix&&(k.output+=re.suffix)}return k};return u.fastpaths=(l,d)=>{const f={...d},p=typeof f.maxLength=="number"?Math.min(n,f.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:w,SLASH_LITERAL:E,ONE_CHAR:y,DOTS_SLASH:b,NO_DOT:R,NO_DOTS:C,NO_DOTS_SLASH:A,STAR:q,START_ANCHOR:G}=t.globChars(f.windows),Q=f.dot?C:R,J=f.dot?A:R,le=f.capture?"":"?:",N={negated:!1,prefix:""};let S=f.bash===!0?".*?":q;f.capture&&(S=`(${S})`);const T=K=>K.noglobstar===!0?S:`(${le}(?:(?!${G}${K.dot?b:w}).)*?)`,O=K=>{switch(K){case"*":return`${Q}${y}${S}`;case".*":return`${w}${y}${S}`;case"*.*":return`${Q}${S}${w}${y}${S}`;case"*/*":return`${Q}${S}${E}${y}${J}${S}`;case"**":return Q+T(f);case"**/*":return`(?:${Q}${T(f)}${E})?${J}${y}${S}`;case"**/*.*":return`(?:${Q}${T(f)}${E})?${J}${S}${w}${y}${S}`;case"**/.*":return`(?:${Q}${T(f)}${E})?${w}${y}${S}`;default:{const be=/^(.*?)\.(\w+)$/.exec(K);if(!be)return;const ee=O(be[1]);return ee?ee+w+be[2]:void 0}}},W=e.removePrefix(l,N);let U=O(W);return U&&f.strictSlashes!==!0&&(U+=`${E}?`),U},Fy=u,Fy}var Ly,VS;function B4(){if(VS)return Ly;VS=1;const t=L4(),e=M4(),n=rp(),r=np(),i=o=>o&&typeof o=="object"&&!Array.isArray(o),s=(o,a,c=!1)=>{if(Array.isArray(o)){const E=o.map(b=>s(b,a,c));return b=>{for(const R of E){const C=R(b);if(C)return C}return!1}}const u=i(o)&&o.tokens&&o.input;if(o===""||typeof o!="string"&&!u)throw new TypeError("Expected pattern to be a non-empty string");const l=a||{},d=l.windows,f=u?s.compileRe(o,a):s.makeRe(o,a,!1,!0),p=f.state;delete f.state;let m=()=>!1;if(l.ignore){const E={...a,ignore:null,onMatch:null,onResult:null};m=s(l.ignore,E,c)}const w=(E,y=!1)=>{const{isMatch:b,match:R,output:C}=s.test(E,f,a,{glob:o,posix:d}),A={glob:o,state:p,regex:f,posix:d,input:E,output:C,match:R,isMatch:b};return typeof l.onResult=="function"&&l.onResult(A),b===!1?(A.isMatch=!1,y?A:!1):m(E)?(typeof l.onIgnore=="function"&&l.onIgnore(A),A.isMatch=!1,y?A:!1):(typeof l.onMatch=="function"&&l.onMatch(A),y?A:!0)};return c&&(w.state=p),w};return s.test=(o,a,c,{glob:u,posix:l}={})=>{if(typeof o!="string")throw new TypeError("Expected input to be a string");if(o==="")return{isMatch:!1,output:""};const d=c||{},f=d.format||(l?n.toPosixSlashes:null);let p=o===u,m=p&&f?f(o):o;return p===!1&&(m=f?f(o):o,p=m===u),(p===!1||d.capture===!0)&&(d.matchBase===!0||d.basename===!0?p=s.matchBase(o,a,c,l):p=a.exec(m)),{isMatch:!!p,match:p,output:m}},s.matchBase=(o,a,c)=>(a instanceof RegExp?a:s.makeRe(a,c)).test(n.basename(o)),s.isMatch=(o,a,c)=>s(a,c)(o),s.parse=(o,a)=>Array.isArray(o)?o.map(c=>s.parse(c,a)):e(o,{...a,fastpaths:!1}),s.scan=(o,a)=>t(o,a),s.compileRe=(o,a,c=!1,u=!1)=>{if(c===!0)return o.output;const l=a||{},d=l.contains?"":"^",f=l.contains?"":"$";let p=`${d}(?:${o.output})${f}`;o&&o.negated===!0&&(p=`^(?!${p}).*$`);const m=s.toRegex(p,a);return u===!0&&(m.state=o),m},s.makeRe=(o,a={},c=!1,u=!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]==="*")&&(l.output=e.fastpaths(o,a)),l.output||(l=e(o,a)),s.compileRe(l,a,c,u)},s.toRegex=(o,a)=>{try{const c=a||{};return new RegExp(o,c.flags||(c.nocase?"i":""))}catch(c){if(a&&a.debug===!0)throw c;return/$^/}},s.constants=r,Ly=s,Ly}var My,KS;function z4(){if(KS)return My;KS=1;const t=B4(),e=rp();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),My=n,My}var YS;function q4(){if(YS)return Qc;YS=1,Object.defineProperty(Qc,"__esModule",{value:!0}),Qc.Builder=void 0;const t=dr,e=F4();var n=null;try{require.resolve("picomatch"),n=z4()}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(){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.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){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 c=this.globCache[s.join("\0")];return c||(c=a(s,...o),this.globCache[s.join("\0")]=c),this.options.filters.push(u=>c(u)),this}}return Qc.Builder=r,Qc}var By={},XS;function j4(){return XS||(XS=1,Object.defineProperty(By,"__esModule",{value:!0})),By}var JS;function U4(){return JS||(JS=1,function(t){var e=Jc.__createBinding||(Object.create?function(i,s,o,a){a===void 0&&(a=o);var c=Object.getOwnPropertyDescriptor(s,o);(!c||("get"in c?!s.__esModule:c.writable||c.configurable))&&(c={enumerable:!0,get:function(){return s[o]}}),Object.defineProperty(i,a,c)}:function(i,s,o,a){a===void 0&&(a=o),i[a]=s[o]}),n=Jc.__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=void 0;const r=q4();Object.defineProperty(t,"fdir",{enumerable:!0,get:function(){return r.Builder}}),n(j4(),t)}(Jc)),Jc}var G4=U4();class W4{constructor(){this.encoding="utf-8"}readFile(e){return Eb.promises.readFile(e.fsPath,this.encoding)}async readDirectory(e){return(await Eb.promises.readdir(e.fsPath,{withFileTypes:!0})).map(r=>({dirent:r,isFile:r.isFile(),isDirectory:r.isDirectory(),uri:Rt.joinPath(e,r.name)}))}}const ht={silent:Number.NEGATIVE_INFINITY,fatal:0,error:0,warn:1,log:2,info:3,success:3,fail:3,ready:3,start:3,box:3,debug:4,trace:5,verbose:Number.POSITIVE_INFINITY},QS={silent:{level:-1},fatal:{level:ht.fatal},error:{level:ht.error},warn:{level:ht.warn},log:{level:ht.log},info:{level:ht.info},success:{level:ht.success},fail:{level:ht.fail},ready:{level:ht.info},start:{level:ht.info},box:{level:ht.info},debug:{level:ht.debug},trace:{level:ht.trace},verbose:{level:ht.verbose}};function zy(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]":!0}function qy(t,e,n=".",r){if(!zy(e))return qy(t,{},n);const i=Object.assign({},e);for(const s in t){if(s==="__proto__"||s==="constructor")continue;const o=t[s];o!=null&&(Array.isArray(o)&&Array.isArray(i[s])?i[s]=[...o,...i[s]]:zy(o)&&zy(i[s])?i[s]=qy(o,i[s],(n?`${n}.`:"")+s.toString()):i[s]=o)}return i}function H4(t){return(...e)=>e.reduce((n,r)=>qy(n,r,""),{})}const V4=H4();function K4(t){return Object.prototype.toString.call(t)==="[object Object]"}function Y4(t){return!(!K4(t)||!t.message&&!t.args||t.stack)}let jy=!1;const ZS=[];let pn=class SI{options;_lastLog;_mockFn;constructor(e={}){const n=e.types||QS;this.options=V4({...e,defaults:{...e.defaults},level:Uy(e.level,n),reporters:[...e.reporters||[]]},{types:QS,throttle:1e3,throttleMin:5,formatOptions:{date:!0,colors:!1,compact:!0}});for(const r in n){const i={type:r,...this.options.defaults,...n[r]};this[r]=this._wrapLogFn(i),this[r].raw=this._wrapLogFn(i,!0)}this.options.mockFn&&this.mockTypes(),this._lastLog={}}get level(){return this.options.level}set level(e){this.options.level=Uy(e,this.options.types,this.options.level)}prompt(e,n){if(!this.options.prompt)throw new Error("prompt is not supported!");return this.options.prompt(e,n)}create(e){const n=new SI({...this.options,...e});return this._mockFn&&n.mockTypes(this._mockFn),n}withDefaults(e){return this.create({...this.options,defaults:{...this.options.defaults,...e}})}withTag(e){return this.withDefaults({tag:this.options.defaults.tag?this.options.defaults.tag+":"+e:e})}addReporter(e){return this.options.reporters.push(e),this}removeReporter(e){if(e){const n=this.options.reporters.indexOf(e);if(n!==-1)return this.options.reporters.splice(n,1)}else this.options.reporters.splice(0);return this}setReporters(e){return this.options.reporters=Array.isArray(e)?e:[e],this}wrapAll(){this.wrapConsole(),this.wrapStd()}restoreAll(){this.restoreConsole(),this.restoreStd()}wrapConsole(){for(const e in this.options.types)console["__"+e]||(console["__"+e]=console[e]),console[e]=this[e].raw}restoreConsole(){for(const e in this.options.types)console["__"+e]&&(console[e]=console["__"+e],delete console["__"+e])}wrapStd(){this._wrapStream(this.options.stdout,"log"),this._wrapStream(this.options.stderr,"log")}_wrapStream(e,n){e&&(e.__write||(e.__write=e.write),e.write=r=>{this[n].raw(String(r).trim())})}restoreStd(){this._restoreStream(this.options.stdout),this._restoreStream(this.options.stderr)}_restoreStream(e){e&&e.__write&&(e.write=e.__write,delete e.__write)}pauseLogs(){jy=!0}resumeLogs(){jy=!1;const e=ZS.splice(0);for(const n of e)n[0]._logFn(n[1],n[2])}mockTypes(e){const n=e||this.options.mockFn;if(this._mockFn=n,typeof n=="function")for(const r in this.options.types)this[r]=n(r,this.options.types[r])||this[r],this[r].raw=this[r]}_wrapLogFn(e,n){return(...r)=>{if(jy){ZS.push([this,e,r,n]);return}return this._logFn(e,r,n)}}_logFn(e,n,r){if((e.level||0)>this.level)return!1;const i={date:new Date,args:[],...e,level:Uy(e.level,this.options.types)};!r&&n.length===1&&Y4(n[0])?Object.assign(i,n[0]):i.args=[...n],i.message&&(i.args.unshift(i.message),delete i.message),i.additional&&(Array.isArray(i.additional)||(i.additional=i.additional.split(`
|
|
164
|
+
`)),i.args.push(`
|
|
165
|
+
`+i.additional.join(`
|
|
166
|
+
`)),delete i.additional),i.type=typeof i.type=="string"?i.type.toLowerCase():"log",i.tag=typeof i.tag=="string"?i.tag:"";const s=(a=!1)=>{const c=(this._lastLog.count||0)-this.options.throttleMin;if(this._lastLog.object&&c>0){const u=[...this._lastLog.object.args];c>1&&u.push(`(repeated ${c} times)`),this._log({...this._lastLog.object,args:u}),this._lastLog.count=1}a&&(this._lastLog.object=i,this._log(i))};clearTimeout(this._lastLog.timeout);const o=this._lastLog.time&&i.date?i.date.getTime()-this._lastLog.time.getTime():0;if(this._lastLog.time=i.date,o<this.options.throttle)try{const a=JSON.stringify([i.type,i.tag,i.args]),c=this._lastLog.serialized===a;if(this._lastLog.serialized=a,c&&(this._lastLog.count=(this._lastLog.count||0)+1,this._lastLog.count>this.options.throttleMin)){this._lastLog.timeout=setTimeout(s,this.options.throttle);return}}catch{}s(!0)}_log(e){for(const n of this.options.reporters)n.log(e,{options:this.options})}};function Uy(t,e={},n=3){return t===void 0?n:typeof t=="number"?t:e[t]&&e[t].level!==void 0?e[t].level:n}pn.prototype.add=pn.prototype.addReporter,pn.prototype.remove=pn.prototype.removeReporter,pn.prototype.clear=pn.prototype.removeReporter,pn.prototype.withScope=pn.prototype.withTag,pn.prototype.mock=pn.prototype.mockTypes,pn.prototype.pause=pn.prototype.pauseLogs,pn.prototype.resume=pn.prototype.resumeLogs;function X4(t={}){return new pn(t)}function eC(t){const e=process.cwd()+Sb;return t.split(`
|
|
167
|
+
`).splice(1).map(n=>n.trim().replace("file://","").replace(e,""))}function J4(t,e){return(e.__write||e.write).call(e,t)}const Gy=t=>t?`[${t}]`:"";class tC{formatStack(e,n){const r=" ".repeat((n?.errorLevel||0)+1);return r+eC(e).join(`
|
|
168
|
+
${r}`)}formatError(e,n){const r=e.message??Cb(n,e),i=e.stack?this.formatStack(e.stack,n):"",s=n?.errorLevel||0,o=s>0?`${" ".repeat(s)}[cause]: `:"",a=e.cause?`
|
|
169
|
+
|
|
170
|
+
`+this.formatError(e.cause,{...n,errorLevel:s+1}):"";return o+r+`
|
|
171
|
+
`+i+a}formatArgs(e,n){const r=e.map(i=>i&&typeof i.stack=="string"?this.formatError(i,n):i);return Cb(n,...r)}formatDate(e,n){return n.date?e.toLocaleTimeString():""}filterAndJoin(e){return e.filter(Boolean).join(" ")}formatLogObj(e,n){const r=this.formatArgs(e.args,n);return e.type==="box"?`
|
|
172
|
+
`+[Gy(e.tag),e.title&&e.title,...r.split(`
|
|
173
|
+
`)].filter(Boolean).map(i=>" > "+i).join(`
|
|
174
|
+
`)+`
|
|
175
|
+
`:this.filterAndJoin([Gy(e.type),Gy(e.tag),r])}log(e,n){const r=this.formatLogObj(e,{columns:n.options.stdout.columns||0,...n.options.formatOptions});return J4(r+`
|
|
176
|
+
`,e.level<2?n.options.stderr||process.stderr:n.options.stdout||process.stdout)}}const{env:Ti={},argv:nC=[],platform:Q4=""}=typeof process>"u"?{}:process,Z4="NO_COLOR"in Ti||nC.includes("--no-color"),eU="FORCE_COLOR"in Ti||nC.includes("--color"),tU=Q4==="win32",rC=Ti.TERM==="dumb",nU=sm&&sm.isatty&&sm.isatty(1)&&Ti.TERM&&!rC,rU="CI"in Ti&&("GITHUB_ACTIONS"in Ti||"GITLAB_CI"in Ti||"CIRCLECI"in Ti),iU=!Z4&&(eU||tU&&!rC||nU||rU);function iC(t,e,n,r,i=e.slice(0,Math.max(0,t))+r,s=e.slice(Math.max(0,t+n.length)),o=s.indexOf(n)){return i+(o<0?s:iC(o,s,n,r))}function sU(t,e,n,r,i){return t<0?n+e+r:n+iC(t,e,r,i)+r}function oU(t,e,n=t,r=t.length+1){return i=>i||!(i===""||i===void 0)?sU((""+i).indexOf(e,r),i,t,e,n):""}function Se(t,e,n){return oU(`\x1B[${t}m`,`\x1B[${e}m`,n)}const sC={reset:Se(0,0),bold:Se(1,22,"\x1B[22m\x1B[1m"),dim:Se(2,22,"\x1B[22m\x1B[2m"),italic:Se(3,23),underline:Se(4,24),inverse:Se(7,27),hidden:Se(8,28),strikethrough:Se(9,29),black:Se(30,39),red:Se(31,39),green:Se(32,39),yellow:Se(33,39),blue:Se(34,39),magenta:Se(35,39),cyan:Se(36,39),white:Se(37,39),gray:Se(90,39),bgBlack:Se(40,49),bgRed:Se(41,49),bgGreen:Se(42,49),bgYellow:Se(43,49),bgBlue:Se(44,49),bgMagenta:Se(45,49),bgCyan:Se(46,49),bgWhite:Se(47,49),blackBright:Se(90,39),redBright:Se(91,39),greenBright:Se(92,39),yellowBright:Se(93,39),blueBright:Se(94,39),magentaBright:Se(95,39),cyanBright:Se(96,39),whiteBright:Se(97,39),bgBlackBright:Se(100,49),bgRedBright:Se(101,49),bgGreenBright:Se(102,49),bgYellowBright:Se(103,49),bgBlueBright:Se(104,49),bgMagentaBright:Se(105,49),bgCyanBright:Se(106,49),bgWhiteBright:Se(107,49)};function aU(t=iU){return t?sC:Object.fromEntries(Object.keys(sC).map(e=>[e,String]))}const hn=aU();function cU(t,e="reset"){return hn[t]||hn[e]}const uU=[String.raw`[\u001B\u009B][[\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\d\/#&.:=?%@~_]+)*|[a-zA-Z\d]+(?:;[-a-zA-Z\d\/#&.:=?%@~_]*)*)?\u0007)`,String.raw`(?:(?:\d{1,4}(?:;\d{0,4})*)?[\dA-PR-TZcf-nq-uy=><~]))`].join("|");function cu(t){return t.replace(new RegExp(uU,"g"),"")}const oC={solid:{tl:"\u250C",tr:"\u2510",bl:"\u2514",br:"\u2518",h:"\u2500",v:"\u2502"},double:{tl:"\u2554",tr:"\u2557",bl:"\u255A",br:"\u255D",h:"\u2550",v:"\u2551"},doubleSingle:{tl:"\u2553",tr:"\u2556",bl:"\u2559",br:"\u255C",h:"\u2500",v:"\u2551"},doubleSingleRounded:{tl:"\u256D",tr:"\u256E",bl:"\u2570",br:"\u256F",h:"\u2500",v:"\u2551"},singleThick:{tl:"\u250F",tr:"\u2513",bl:"\u2517",br:"\u251B",h:"\u2501",v:"\u2503"},singleDouble:{tl:"\u2552",tr:"\u2555",bl:"\u2558",br:"\u255B",h:"\u2550",v:"\u2502"},singleDoubleRounded:{tl:"\u256D",tr:"\u256E",bl:"\u2570",br:"\u256F",h:"\u2550",v:"\u2502"},rounded:{tl:"\u256D",tr:"\u256E",bl:"\u2570",br:"\u256F",h:"\u2500",v:"\u2502"}},lU={borderColor:"white",borderStyle:"rounded",valign:"center",padding:2,marginLeft:1,marginTop:1,marginBottom:1};function dU(t,e={}){const n={...e,style:{...lU,...e.style}},r=t.split(`
|
|
177
|
+
`),i=[],s=cU(n.style.borderColor),o={...typeof n.style.borderStyle=="string"?oC[n.style.borderStyle]||oC.solid:n.style.borderStyle};if(s)for(const p in o)o[p]=s(o[p]);const a=n.style.padding%2===0?n.style.padding:n.style.padding+1,c=r.length+a,u=Math.max(...r.map(p=>p.length))+a,l=u+a,d=n.style.marginLeft>0?" ".repeat(n.style.marginLeft):"";if(n.style.marginTop>0&&i.push("".repeat(n.style.marginTop)),n.title){const p=s?s(n.title):n.title,m=o.h.repeat(Math.floor((u-cu(n.title).length)/2)),w=o.h.repeat(u-cu(n.title).length-cu(m).length+a);i.push(`${d}${o.tl}${m}${p}${w}${o.tr}`)}else i.push(`${d}${o.tl}${o.h.repeat(l)}${o.tr}`);const f=n.style.valign==="center"?Math.floor((c-r.length)/2):n.style.valign==="top"?c-r.length-a:c-r.length;for(let p=0;p<c;p++)if(p<f||p>=f+r.length)i.push(`${d}${o.v}${" ".repeat(l)}${o.v}`);else{const m=r[p-f],w=" ".repeat(a),E=" ".repeat(u-cu(m).length);i.push(`${d}${o.v}${w}${m}${E}${o.v}`)}return i.push(`${d}${o.bl}${o.h.repeat(l)}${o.br}`),n.style.marginBottom>0&&i.push("".repeat(n.style.marginBottom)),i.join(`
|
|
178
|
+
`)}const ip=Object.create(null),uu=t=>globalThis.process?.env||import.meta.env||globalThis.Deno?.env.toObject()||globalThis.__env__||(t?ip:globalThis),$i=new Proxy(ip,{get(t,e){return uu()[e]??ip[e]},has(t,e){const n=uu();return e in n||e in ip},set(t,e,n){const r=uu(!0);return r[e]=n,!0},deleteProperty(t,e){if(!e)return!1;const n=uu(!0);return delete n[e],!0},ownKeys(){const t=uu(!0);return Object.keys(t)}}),fU=typeof process<"u"&&process.env&&process.env.NODE_ENV||"",pU=[["APPVEYOR"],["AWS_AMPLIFY","AWS_APP_ID",{ci:!0}],["AZURE_PIPELINES","SYSTEM_TEAMFOUNDATIONCOLLECTIONURI"],["AZURE_STATIC","INPUT_AZURE_STATIC_WEB_APPS_API_TOKEN"],["APPCIRCLE","AC_APPCIRCLE"],["BAMBOO","bamboo_planKey"],["BITBUCKET","BITBUCKET_COMMIT"],["BITRISE","BITRISE_IO"],["BUDDY","BUDDY_WORKSPACE_ID"],["BUILDKITE"],["CIRCLE","CIRCLECI"],["CIRRUS","CIRRUS_CI"],["CLOUDFLARE_PAGES","CF_PAGES",{ci:!0}],["CODEBUILD","CODEBUILD_BUILD_ARN"],["CODEFRESH","CF_BUILD_ID"],["DRONE"],["DRONE","DRONE_BUILD_EVENT"],["DSARI"],["GITHUB_ACTIONS"],["GITLAB","GITLAB_CI"],["GITLAB","CI_MERGE_REQUEST_ID"],["GOCD","GO_PIPELINE_LABEL"],["LAYERCI"],["HUDSON","HUDSON_URL"],["JENKINS","JENKINS_URL"],["MAGNUM"],["NETLIFY"],["NETLIFY","NETLIFY_LOCAL",{ci:!1}],["NEVERCODE"],["RENDER"],["SAIL","SAILCI"],["SEMAPHORE"],["SCREWDRIVER"],["SHIPPABLE"],["SOLANO","TDDIUM"],["STRIDER"],["TEAMCITY","TEAMCITY_VERSION"],["TRAVIS"],["VERCEL","NOW_BUILDER"],["VERCEL","VERCEL",{ci:!1}],["VERCEL","VERCEL_ENV",{ci:!1}],["APPCENTER","APPCENTER_BUILD_ID"],["CODESANDBOX","CODESANDBOX_SSE",{ci:!1}],["STACKBLITZ"],["STORMKIT"],["CLEAVR"],["ZEABUR"],["CODESPHERE","CODESPHERE_APP_ID",{ci:!0}],["RAILWAY","RAILWAY_PROJECT_ID"],["RAILWAY","RAILWAY_SERVICE_ID"],["DENO-DEPLOY","DENO_DEPLOYMENT_ID"],["FIREBASE_APP_HOSTING","FIREBASE_APP_HOSTING",{ci:!0}]];function hU(){if(globalThis.process?.env)for(const t of pU){const e=t[1]||t[0];if(globalThis.process?.env[e])return{name:t[0].toLowerCase(),...t[2]}}return globalThis.process?.env?.SHELL==="/bin/jsh"&&globalThis.process?.versions?.webcontainer?{name:"stackblitz",ci:!1}:{name:"",ci:!1}}const aC=hU();aC.name;function $s(t){return t?t!=="false":!1}const mU=globalThis.process?.platform||"",gU=$s($i.CI)||aC.ci!==!1,yU=$s(globalThis.process?.stdout&&globalThis.process?.stdout.isTTY),vU=$s($i.DEBUG),cC=fU==="test"||$s($i.TEST);$s($i.MINIMAL);const wU=/^win/i.test(mU);!$s($i.NO_COLOR)&&($s($i.FORCE_COLOR)||(yU||wU)&&$i.TERM);const bU=(globalThis.process?.versions?.node||"").replace(/^v/,"")||null;Number(bU?.split(".")[0]);const DU=globalThis.process||Object.create(null),uC={versions:{}};new Proxy(DU,{get(t,e){if(e==="env")return $i;if(e in t)return t[e];if(e in uC)return uC[e]}});const EU=globalThis.process?.release?.name==="node",RU=!!globalThis.Bun||!!globalThis.process?.versions?.bun,TU=!!globalThis.Deno,$U=!!globalThis.fastly,SU=!!globalThis.Netlify,CU=!!globalThis.EdgeRuntime,kU=globalThis.navigator?.userAgent==="Cloudflare-Workers",AU=[[SU,"netlify"],[CU,"edge-light"],[kU,"workerd"],[$U,"fastly"],[TU,"deno"],[RU,"bun"],[EU,"node"]];function _U(){const t=AU.find(e=>e[0]);if(t)return{name:t[1]}}const PU=_U();PU?.name;function IU({onlyFirst:t=!1}={}){const e=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");return new RegExp(e,t?void 0:"g")}const xU=IU();function OU(t){if(typeof t!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);return t.replace(xU,"")}function NU(t){return t===161||t===164||t===167||t===168||t===170||t===173||t===174||t>=176&&t<=180||t>=182&&t<=186||t>=188&&t<=191||t===198||t===208||t===215||t===216||t>=222&&t<=225||t===230||t>=232&&t<=234||t===236||t===237||t===240||t===242||t===243||t>=247&&t<=250||t===252||t===254||t===257||t===273||t===275||t===283||t===294||t===295||t===299||t>=305&&t<=307||t===312||t>=319&&t<=322||t===324||t>=328&&t<=331||t===333||t===338||t===339||t===358||t===359||t===363||t===462||t===464||t===466||t===468||t===470||t===472||t===474||t===476||t===593||t===609||t===708||t===711||t>=713&&t<=715||t===717||t===720||t>=728&&t<=731||t===733||t===735||t>=768&&t<=879||t>=913&&t<=929||t>=931&&t<=937||t>=945&&t<=961||t>=963&&t<=969||t===1025||t>=1040&&t<=1103||t===1105||t===8208||t>=8211&&t<=8214||t===8216||t===8217||t===8220||t===8221||t>=8224&&t<=8226||t>=8228&&t<=8231||t===8240||t===8242||t===8243||t===8245||t===8251||t===8254||t===8308||t===8319||t>=8321&&t<=8324||t===8364||t===8451||t===8453||t===8457||t===8467||t===8470||t===8481||t===8482||t===8486||t===8491||t===8531||t===8532||t>=8539&&t<=8542||t>=8544&&t<=8555||t>=8560&&t<=8569||t===8585||t>=8592&&t<=8601||t===8632||t===8633||t===8658||t===8660||t===8679||t===8704||t===8706||t===8707||t===8711||t===8712||t===8715||t===8719||t===8721||t===8725||t===8730||t>=8733&&t<=8736||t===8739||t===8741||t>=8743&&t<=8748||t===8750||t>=8756&&t<=8759||t===8764||t===8765||t===8776||t===8780||t===8786||t===8800||t===8801||t>=8804&&t<=8807||t===8810||t===8811||t===8814||t===8815||t===8834||t===8835||t===8838||t===8839||t===8853||t===8857||t===8869||t===8895||t===8978||t>=9312&&t<=9449||t>=9451&&t<=9547||t>=9552&&t<=9587||t>=9600&&t<=9615||t>=9618&&t<=9621||t===9632||t===9633||t>=9635&&t<=9641||t===9650||t===9651||t===9654||t===9655||t===9660||t===9661||t===9664||t===9665||t>=9670&&t<=9672||t===9675||t>=9678&&t<=9681||t>=9698&&t<=9701||t===9711||t===9733||t===9734||t===9737||t===9742||t===9743||t===9756||t===9758||t===9792||t===9794||t===9824||t===9825||t>=9827&&t<=9829||t>=9831&&t<=9834||t===9836||t===9837||t===9839||t===9886||t===9887||t===9919||t>=9926&&t<=9933||t>=9935&&t<=9939||t>=9941&&t<=9953||t===9955||t===9960||t===9961||t>=9963&&t<=9969||t===9972||t>=9974&&t<=9977||t===9979||t===9980||t===9982||t===9983||t===10045||t>=10102&&t<=10111||t>=11094&&t<=11097||t>=12872&&t<=12879||t>=57344&&t<=63743||t>=65024&&t<=65039||t===65533||t>=127232&&t<=127242||t>=127248&&t<=127277||t>=127280&&t<=127337||t>=127344&&t<=127373||t===127375||t===127376||t>=127387&&t<=127404||t>=917760&&t<=917999||t>=983040&&t<=1048573||t>=1048576&&t<=1114109}function FU(t){return t===12288||t>=65281&&t<=65376||t>=65504&&t<=65510}function LU(t){return t>=4352&&t<=4447||t===8986||t===8987||t===9001||t===9002||t>=9193&&t<=9196||t===9200||t===9203||t===9725||t===9726||t===9748||t===9749||t>=9776&&t<=9783||t>=9800&&t<=9811||t===9855||t>=9866&&t<=9871||t===9875||t===9889||t===9898||t===9899||t===9917||t===9918||t===9924||t===9925||t===9934||t===9940||t===9962||t===9970||t===9971||t===9973||t===9978||t===9981||t===9989||t===9994||t===9995||t===10024||t===10060||t===10062||t>=10067&&t<=10069||t===10071||t>=10133&&t<=10135||t===10160||t===10175||t===11035||t===11036||t===11088||t===11093||t>=11904&&t<=11929||t>=11931&&t<=12019||t>=12032&&t<=12245||t>=12272&&t<=12287||t>=12289&&t<=12350||t>=12353&&t<=12438||t>=12441&&t<=12543||t>=12549&&t<=12591||t>=12593&&t<=12686||t>=12688&&t<=12773||t>=12783&&t<=12830||t>=12832&&t<=12871||t>=12880&&t<=42124||t>=42128&&t<=42182||t>=43360&&t<=43388||t>=44032&&t<=55203||t>=63744&&t<=64255||t>=65040&&t<=65049||t>=65072&&t<=65106||t>=65108&&t<=65126||t>=65128&&t<=65131||t>=94176&&t<=94180||t===94192||t===94193||t>=94208&&t<=100343||t>=100352&&t<=101589||t>=101631&&t<=101640||t>=110576&&t<=110579||t>=110581&&t<=110587||t===110589||t===110590||t>=110592&&t<=110882||t===110898||t>=110928&&t<=110930||t===110933||t>=110948&&t<=110951||t>=110960&&t<=111355||t>=119552&&t<=119638||t>=119648&&t<=119670||t===126980||t===127183||t===127374||t>=127377&&t<=127386||t>=127488&&t<=127490||t>=127504&&t<=127547||t>=127552&&t<=127560||t===127568||t===127569||t>=127584&&t<=127589||t>=127744&&t<=127776||t>=127789&&t<=127797||t>=127799&&t<=127868||t>=127870&&t<=127891||t>=127904&&t<=127946||t>=127951&&t<=127955||t>=127968&&t<=127984||t===127988||t>=127992&&t<=128062||t===128064||t>=128066&&t<=128252||t>=128255&&t<=128317||t>=128331&&t<=128334||t>=128336&&t<=128359||t===128378||t===128405||t===128406||t===128420||t>=128507&&t<=128591||t>=128640&&t<=128709||t===128716||t>=128720&&t<=128722||t>=128725&&t<=128727||t>=128732&&t<=128735||t===128747||t===128748||t>=128756&&t<=128764||t>=128992&&t<=129003||t===129008||t>=129292&&t<=129338||t>=129340&&t<=129349||t>=129351&&t<=129535||t>=129648&&t<=129660||t>=129664&&t<=129673||t>=129679&&t<=129734||t>=129742&&t<=129756||t>=129759&&t<=129769||t>=129776&&t<=129784||t>=131072&&t<=196605||t>=196608&&t<=262141}function MU(t){if(!Number.isSafeInteger(t))throw new TypeError(`Expected a code point, got \`${typeof t}\`.`)}function BU(t,{ambiguousAsWide:e=!1}={}){return MU(t),FU(t)||LU(t)||e&&NU(t)?2:1}const zU=()=>/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE89\uDE8F-\uDEC2\uDEC6\uDECE-\uDEDC\uDEDF-\uDEE9]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g,qU=globalThis.Intl?.Segmenter?new Intl.Segmenter:{segment:t=>t.split("")},jU=new RegExp("^\\p{Default_Ignorable_Code_Point}$","u");function UU(t,e={}){if(typeof t!="string"||t.length===0)return 0;const{ambiguousIsNarrow:n=!0,countAnsiEscapeCodes:r=!1}=e;if(r||(t=OU(t)),t.length===0)return 0;let i=0;const s={ambiguousAsWide:!n};for(const{segment:o}of qU.segment(t)){const a=o.codePointAt(0);if(!(a<=31||a>=127&&a<=159)&&!(a>=8203&&a<=8207||a===65279)&&!(a>=768&&a<=879||a>=6832&&a<=6911||a>=7616&&a<=7679||a>=8400&&a<=8447||a>=65056&&a<=65071)&&!(a>=55296&&a<=57343)&&!(a>=65024&&a<=65039)&&!jU.test(o)){if(zU().test(o)){i+=2;continue}i+=BU(a,s)}}return i}function lC(){const{env:t}=tt,{TERM:e,TERM_PROGRAM:n}=t;return tt.platform!=="win32"?e!=="linux":!!t.WT_SESSION||!!t.TERMINUS_SUBLIME||t.ConEmuTask==="{cmd::Cmder}"||n==="Terminus-Sublime"||n==="vscode"||e==="xterm-256color"||e==="alacritty"||e==="rxvt-unicode"||e==="rxvt-unicode-256color"||t.TERMINAL_EMULATOR==="JetBrains-JediTerm"}const GU={info:"cyan",fail:"red",success:"green",ready:"green",start:"magenta"},WU={0:"red",1:"yellow"},HU=lC(),Dr=(t,e)=>HU?t:e,dC={error:Dr("\u2716","\xD7"),fatal:Dr("\u2716","\xD7"),ready:Dr("\u2714","\u221A"),warn:Dr("\u26A0","\u203C"),info:Dr("\u2139","i"),success:Dr("\u2714","\u221A"),debug:Dr("\u2699","D"),trace:Dr("\u2192","\u2192"),fail:Dr("\u2716","\xD7"),start:Dr("\u25D0","o"),log:""};function fC(t){return typeof Intl!="object"||!Intl.Segmenter?cu(t).length:UU(t)}class VU extends tC{formatStack(e,n){const r=" ".repeat((n?.errorLevel||0)+1);return`
|
|
179
|
+
${r}`+eC(e).map(i=>" "+i.replace(/^at +/,s=>hn.gray(s)).replace(/\((.+)\)/,(s,o)=>`(${hn.cyan(o)})`)).join(`
|
|
180
|
+
${r}`)}formatType(e,n,r){const i=GU[e.type]||WU[e.level]||"gray";if(n)return YU(i)(hn.black(` ${e.type.toUpperCase()} `));const s=typeof dC[e.type]=="string"?dC[e.type]:e.icon||e.type;return s?KU(i)(s):""}formatLogObj(e,n){const[r,...i]=this.formatArgs(e.args,n).split(`
|
|
181
|
+
`);if(e.type==="box")return dU(sp(r+(i.length>0?`
|
|
182
|
+
`+i.join(`
|
|
183
|
+
`):"")),{title:e.title?sp(e.title):void 0,style:e.style});const s=this.formatDate(e.date,n),o=s&&hn.gray(s),a=e.badge??e.level<2,c=this.formatType(e,a,n),u=e.tag?hn.gray(e.tag):"";let l;const d=this.filterAndJoin([c,sp(r)]),f=this.filterAndJoin(n.columns?[u,o]:[u]),p=(n.columns||0)-fC(d)-fC(f)-2;if(l=p>0&&(n.columns||0)>=80?d+" ".repeat(p)+f:(f?`${hn.gray(`[${f}]`)} `:"")+d,l+=sp(i.length>0?`
|
|
184
|
+
`+i.join(`
|
|
185
|
+
`):""),e.type==="trace"){const m=new Error("Trace: "+e.message);l+=this.formatStack(m.stack||"")}return a?`
|
|
186
|
+
`+l+`
|
|
187
|
+
`:l}}function sp(t){return t.replace(/`([^`]+)`/gm,(e,n)=>hn.cyan(n)).replace(/\s+_([^_]+)_\s+/gm,(e,n)=>` ${hn.underline(n)} `)}function KU(t="white"){return hn[t]||hn.white}function YU(t="bgWhite"){return hn[`bg${t[0].toUpperCase()}${t.slice(1)}`]||hn.bgWhite}function pC(t={}){let e=XU();return process.env.CONSOLA_LEVEL&&(e=Number.parseInt(process.env.CONSOLA_LEVEL)??e),X4({level:e,defaults:{level:e},stdout:process.stdout,stderr:process.stderr,prompt:(...n)=>import("../chunks/prompt.mjs").then(r=>r.prompt(...n)),reporters:t.reporters||[t.fancy??!(gU||cC)?new VU:new tC],...t})}function XU(){return vU?ht.debug:cC?ht.warn:ht.info}pC();const JU=t=>{Wy.forEach(e=>{QU(t,e)})},Wy=["name","message","stack","cause","errors"],QU=(t,e)=>{const n=Hy(t,e);if(n!==void 0){if(ZU(n)){ii(t,e,t[e]);return}e6(n)&&hC(t,e,n)}},Hy=(t,e)=>{const n=Object.getOwnPropertyDescriptor(t,e);if(n!==void 0)return n;const r=Object.getPrototypeOf(t);return r===null?void 0:Hy(r,e)},ZU=({get:t,set:e})=>t!==void 0&&e===void 0,e6=({enumerable:t,writable:e})=>t||!e,ii=(t,e,n)=>{hC(t,e,{value:n})},hC=(t,e,n)=>{Object.defineProperty(t,e,{...n,..."get"in n||"set"in n?{}:{writable:!0},enumerable:!1,configurable:!0})},t6=(t,e)=>{if(Array.isArray(t.errors)){const n=t.errors.filter(n6).map(e).filter(Boolean);ii(t,"errors",n)}else r6(t)?ii(t,"errors",[]):t.errors!==void 0&&i6(t)},n6=t=>t!==void 0,r6=t=>"AggregateError"in globalThis&&(t.name==="AggregateError"||t instanceof AggregateError),i6=t=>{delete t.errors,t.errors!==void 0&&ii(t,"errors",[])},s6=(t,e)=>{if(!("cause"in t))return;const n=t.cause===void 0?t.cause:e(t.cause);n===void 0?delete t.cause:ii(t,"cause",n)},o6=t=>a6(t)||c6(t),a6=t=>{try{return t instanceof Error}catch{return!1}},c6=t=>{try{return u6.has(Object.prototype.toString.call(t))}catch{return!1}},u6=new Set(["[object Error]","[object DOMException]","[object DOMError]","[object Exception]"]);function op(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 l6=t=>!Object.isExtensible(t)||Wy.some(e=>d6(t,e)||f6(t,e)),d6=(t,e)=>{const n=Object.getOwnPropertyDescriptor(t,e);return n!==void 0&&!n.configurable},f6=(t,e)=>{try{return t[e],!1}catch{return!0}},Vy=t=>{const e=p6(t.message,t.name);ii(t,"stack",e)},p6=(t="",e="Error")=>{const n=h6(e),{stack:r}=new n(t);return typeof r=="string"&&r!==""?r:`${e}: ${t}`},h6=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},m6=t=>{const e={};for(const n of g6(t))try{const r=t[n],{enumerable:i,configurable:s,writable:o=!0}=Hy(t,n);Object.defineProperty(e,n,{value:r,enumerable:i,configurable:s,writable:o})}catch{}return e},g6=t=>{const e=y6(t);for(const n of Wy)v6(t,n)&&e.push(n);return e},y6=t=>{try{return Reflect.ownKeys(t)}catch{return[]}},v6=(t,e)=>{try{return e in t&&!Object.hasOwn(t,e)}catch{return!1}},mC=t=>{const{name:e,message:n,stack:r,cause:i,errors:s,...o}=m6(t),a=w6(n,o),c=R6(e,a);return n===a&&T6(c,o),Object.entries({name:e,stack:r,cause:i,errors:s}).forEach(([u,l])=>{$6(c,u,l)}),r===void 0&&Vy(c),c},w6=(t,e)=>typeof t=="string"&&t!==""?t:E6(b6(e)),b6=t=>{try{return JSON.stringify(t)}catch{return D6(t)}},D6=t=>{try{return String(t)}catch{return"Invalid error"}},E6=t=>t.length<gC?t:`${t.slice(0,gC)}...`,gC=1e3,R6=(t,e)=>t==="AggregateError"&&"AggregateError"in globalThis?new AggregateError([],e):t in yC?new yC[t](e):new Error(e),yC={Error,ReferenceError,TypeError,SyntaxError,RangeError,URIError,EvalError},T6=(t,e)=>{for(const n in e)n in t||(t[n]=e[n])},$6=(t,e,n)=>{n!==void 0&&ii(t,e,n)},S6=t=>{try{const e=new Error(String(t));return Vy(e),e}catch(e){return e}},{toString:C6}=Object.prototype,k6=t=>A6(t)?mC(t):o6(t)?_6(t)?mC(t):t:S6(t),A6=t=>{try{return op(t)}catch{return!1}},_6=t=>P6(t)||l6(t)||I6(t),P6=t=>{try{return C6.call(t)==="[object Object]"}catch{return!0}},I6=t=>typeof t.constructor!="function"||typeof t.constructor.name!="string"||t.constructor.name===""||t.constructor.prototype!==Object.getPrototypeOf(t),ap=(t,{shallow:e=!1}={})=>vC(t,[],e),vC=(t,e,n)=>{if(e.includes(t))return;const r=n?x6:s=>vC(s,[...e,t],n),i=k6(t);return O6(i,r),i},x6=t=>t,O6=(t,e)=>{N6(t),F6(t),L6(t),s6(t,e),t6(t,e),JU(t)},N6=t=>{if(cp(t.name))return;const e=Object.getPrototypeOf(t).name,n=cp(e)?e:t.constructor.name;ii(t,"name",n)},F6=t=>{cp(t.message)||ii(t,"message","")},L6=t=>{cp(t.stack)||Vy(t)},cp=t=>typeof t=="string"&&t!=="",M6=(t,e,n=t.name)=>{if(B6(e),typeof n!="string")throw new TypeError(`currentName must be a string: ${n}`);return n},B6=t=>{if(!z6(t))throw new TypeError(`ErrorClass must be a class: ${t}`);if(!wC(t.prototype))throw new TypeError(`ErrorClass must inherit from Error: ${t}`);if(!q6(t))throw new TypeError(`ErrorClass must be have a valid constructor: ${t}`)},z6=t=>typeof t=="function"&&typeof t.prototype=="object"&&t.prototype!==null,wC=t=>t!==null&&(t.name==="Error"||wC(Object.getPrototypeOf(t))),q6=t=>typeof t.prototype.constructor=="function",bC=(t,e,n)=>{Object.defineProperty(t,e,{value:n,enumerable:!1,writable:!0,configurable:!0})},j6=(t,e)=>{Object.getPrototypeOf(t)!==e.prototype&&(U6(t,e),RC(t,"constructor"),G6(t,e))},U6=(t,e)=>{Object.setPrototypeOf(t,e.prototype)},G6=(t,e)=>{RC(t,"name");const n=DC(e.prototype);t.name!==n&&bC(t,"name",n)},DC=t=>W6(t)??H6(t)??DC(Object.getPrototypeOf(t)),W6=t=>Object.hasOwn(t,"name")&&EC(t.name)?t.name:void 0,H6=t=>typeof t.constructor=="function"&&EC(t.constructor.name)?t.constructor.name:void 0,EC=t=>typeof t=="string"&&t!=="",RC=(t,e)=>{Object.hasOwn(t,e)&&delete t[e]},V6=(t,e)=>{if(!K6(t,e))return;const n=X6(t,e);bC(t,"stack",n)},K6=(t,e)=>e!==t.name&&e!==""&&t.stack.includes(e)&&Y6(),Y6=()=>{class t extends Error{}const e={value:TC,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(TC)},TC="SetErrorClassError",X6=({name:t,stack:e},n)=>{if(e.startsWith(`${n}: `))return e.replace(n,t);const r=J6(n,t),[i,s]=r.find(([o])=>e.includes(o));return e.replace(i,s)},J6=(t,e)=>[[`
|
|
188
|
+
${t}: `,`
|
|
189
|
+
${e}: `],[`${t}: `,`${e}: `],[`${t} `,`${e} `],[t,e]],Q6=(t,e,n)=>{const r=ap(t),i=M6(r,e,n);return j6(r,e),V6(r,i),r},Z6=(t,e)=>e.configurable===!1?eG(t,e):rG(t,e),eG=(t,e)=>({...e,...tG(t,e),...nG(t,e)}),tG=(t,e)=>e.writable===!0&&t.writable===!1?{writable:!1}:{},nG=(t,e)=>t.hasValue&&"value"in e&&e.writable===!0?{value:t.value}:{},rG=(t,e)=>{const n=lu(t.enumerable,e.enumerable,!0),r=lu(t.writable,e.writable,!0),i=lu(t.configurable,e.configurable,!0);return{...iG(t,e,r),enumerable:n,configurable:i}},iG=(t,e,n)=>t.hasValue?{value:t.value,writable:n}:!$C(t)&&!$C(e)?{value:e.value,writable:n}:{get:lu(t.get,e.get),set:lu(t.set,e.set)},$C=({get:t,set:e})=>t!==void 0||e!==void 0,lu=(t,e,n)=>t??e??n,sG=(t,e,n)=>{if(!oG(t))throw new TypeError(`Argument must be an object: ${t}`);if(!aG(e))throw new TypeError(`Property key must be a string, a symbol or an integer: ${e}`);return cG(n)},oG=t=>typeof t=="object"&&t!==null,aG=t=>{const e=typeof t;return e==="string"||e==="symbol"||e==="number"},cG=t=>{if(!op(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,c="value"in t;return uG({enumerable:e,writable:n,configurable:r,get:s,set:o,unknownProps:a,hasValue:c}),{enumerable:e,writable:n,configurable:r,value:i,get:s,set:o,hasValue:c}},uG=({enumerable:t,writable:e,configurable:n,get:r,set:i,unknownProps:s,hasValue:o})=>{SC(o,r,"get"),SC(o,i,"set"),Ky(t,"enumerable"),Ky(e,"writable"),Ky(n,"configurable"),dG(s)},SC=(t,e,n)=>{if(lG(e,n),t&&e!==void 0)throw new TypeError(`Descriptor property "value" and "${n}" must not both be defined: ${e}`)},lG=(t,e)=>{if(t!==void 0&&typeof t!="function")throw new TypeError(`Descriptor property "${e}" must be a function: ${t}`)},Ky=(t,e)=>{if(t!==void 0&&typeof t!="boolean")throw new TypeError(`Descriptor property "${e}" must be a boolean: ${t}`)},dG=t=>{const[e]=Object.keys(t);if(e!==void 0)throw new TypeError(`Unknown descriptor property "${e}": ${t[e]}`)},fG=(t,e,n)=>{const r=sG(t,e,n),i=CC(t,e),s=Z6(r,i);return pG(t,e,s),t},CC=(t,e)=>{const n=Object.getOwnPropertyDescriptor(t,e);if(n!==void 0)return n;const r=Object.getPrototypeOf(t);return r===null?{}:CC(r,e)},pG=(t,e,n)=>{try{Object.defineProperty(t,e,n)}catch{}},hG=(t,e,n)=>{if(n!==void 0)return kC(t,e,n);try{delete t[e]}catch{}if(t[e]!==void 0)return kC(t,e)},kC=(t,e,n)=>{const r=mG(e);fG(t,e,{value:n,...r})},mG=t=>typeof t=="string"&&t.startsWith("_")?{enumerable:!1}:{},gG=t=>yG(t)||vG(t),yG=t=>{try{return t instanceof Error}catch{return!1}},vG=t=>{try{return wG.has(Object.prototype.toString.call(t))}catch{return!1}},wG=new Set(["[object Error]","[object DOMException]","[object DOMError]","[object Exception]"]),bG=(t,e,n={})=>{if(AC(t,"First argument"),AC(e,"Second argument"),!op(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}},AC=(t,e)=>{if(t===void 0)throw new TypeError(`${e} is required.`);if(!DG(t))throw new TypeError(`${e} must be a plain object or an error: ${t}`)},DG=t=>op(t)||gG(t),EG=({error:t,props:e,propName:n,soft:r})=>RG(n)||!SG.call(e,n)||r&&t[n]!==void 0,RG=t=>t in TG||$G.has(t),TG=new Error("check"),$G=new Set(["prototype","errors","cause"]),{propertyIsEnumerable:SG}=Object.prototype,CG=(t,e,n)=>{const{soft:r}=bG(t,e,n);for(const i of Reflect.ownKeys(e))kG({error:t,props:e,propName:i,soft:r});return t},kG=({error:t,props:e,propName:n,soft:r})=>{EG({error:t,props:e,propName:n,soft:r})||hG(t,n,e[n])},up=(t,e,n)=>{Object.defineProperty(t,e,{value:n,writable:!0,enumerable:!1,configurable:!0})},AG=(t,e)=>{if(t.errors===void 0)return;const n=t.errors.map(r=>e(r).error).filter(Boolean);up(t,"errors",n)},_G=({target:t,source:e,parent:n,child:r})=>{if(!_C(t)){PG(t,e);return}_C(e)&&up(t,"errors",[...r.errors,...n.errors])},PG=(t,e)=>{e.errors!==void 0&&up(t,"errors",e.errors)},_C=t=>t.errors!==void 0&&t.errors.length!==0,IG=(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},xG=({name:t,stack:e},n,r)=>r!==""&&e.includes(r)?OG({name:t,stack:e,newMessage:n,currentMessage:r}):FG(t,e,n),OG=({name:t,stack:e,newMessage:n,currentMessage:r})=>{const i=NG(t,n,r),[s,o]=i.find(([a])=>e.includes(a));return e.replace(s,o)},NG=(t,e,n)=>[[`${t}: ${n}`,`${t}: ${e}`],[`: ${n}`,`: ${e}`],[`
|
|
190
|
+
${n}`,`
|
|
191
|
+
${e}`],[` ${n}`,` ${e}`],[n,e]],FG=(t,e,n)=>{const r=`${t}: `,i=n.trimEnd();return e===t||e.startsWith(`${t}
|
|
192
|
+
`)?e.replace(t,`${r}${i}`):e.startsWith(r)?e.replace(r,`${r}${i}
|
|
193
|
+
`):`${r}${i}
|
|
194
|
+
${e}`},LG=(t,e,n)=>{const r=ap(t),i=IG(r,e,n);return IC(r,"message",e),MG(r,e,i),r},MG=(t,e,n)=>{if(e===n||!BG())return;const r=xG(t,e,n);IC(t,"stack",r)},BG=()=>{const{stack:t}=new Error(PC);return typeof t=="string"&&t.includes(PC)},PC="set-error-message test message",IC=(t,e,n)=>{Object.defineProperty(t,e,{value:n,enumerable:!1,writable:!0,configurable:!0})},xC=(t,e,n)=>{if(typeof e!="string")throw new TypeError(`Second argument must be a message string: ${e}`);const r=ap(t),i=zG(e,r.message);return LG(r,i,n)},zG=(t,e)=>{const n=t.trim(),r=e.trim();return n===""?r:r===""?n:qG(n,r,t)},qG=(t,e,n)=>t.endsWith(jG)?n.endsWith(UG)?`${t}
|
|
195
|
+
${e}`:`${t} ${e}`:`${e}
|
|
196
|
+
${t}`,jG=":",UG=`
|
|
197
|
+
`,GG=({parent:t,child:e,target:n,stackError:r})=>{const i=t.message;return n.message=e.message,xC(n,i,r.message)},WG=(t,e)=>OC(t)===e,OC=t=>typeof t=="object"&&t!==null?t.stack:void 0,HG=({wrap:t,target:e,source:n,childHasStack:r})=>t===r?e:(up(e,"stack",n.stack),n),VG=t=>{const{wrap:e,name:n}=t;return typeof e!="boolean"?n==="Error":(Object.hasOwn(t,"wrap")&&delete t.wrap,e)},KG=t=>NC(t,[]).error,NC=(t,e)=>{if(e.includes(t))return{};const n=c=>NC(c,[...e,t]),r=OC(t),i=ap(t,{shallow:!0}),s=WG(i,r);AG(i,n);const{parent:o,childHasStack:a}=YG(i,n);return{error:o,errorHasStack:s||a}},YG=(t,e)=>{const n=VG(t);if(t.cause===void 0)return{parent:t,childHasStack:!1};const{error:r,errorHasStack:i}=e(t.cause);return delete t.cause,{parent:XG({parent:t,child:r,childHasStack:i,wrap:n}),childHasStack:i}},XG=({parent:t,child:e,childHasStack:n,wrap:r})=>{if(e===void 0)return t;const[i,s]=r?[e,t]:[t,e],o=HG({wrap:r,target:i,source:s,childHasStack:n}),a=Q6(i,i.constructor,o.name),c=GG({parent:t,child:e,target:a,stackError:o});return _G({target:c,source:s,parent:t,child:e}),CG(c,s,{soft:!r})};function FC(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]=FC(t)(i,s);return t.delete(n),r}}function LC(t,{indentation:e}={}){return JSON.stringify(t,FC(new WeakSet),e)}const JG=t=>t.split(`
|
|
198
|
+
`).map(e=>e.trim().replace("file://",""));function QG(t,e=JG){const n={message:""},r=t.args.find(s=>s instanceof Error);if(!r)return n.message=t.args.map(s=>typeof s=="string"?s:LC(s)).join("; "),typeof t.tag=="string"&&t.tag.length>0&&(n.message=`[${t.tag}] ${n.message}`),n;const i=t.args.reduce((s,o)=>{if(o===r)return s;const a=typeof o=="string"?o:LC(o);return xC(s,a)},KG(r));if(n.message=i.message,n.error={message:i.message,name:i.name},i.stack){const s=e(i.stack);n.error.stack=s.join(`
|
|
199
|
+
`),n.message+=`
|
|
200
|
+
`+s.slice(1).map(o=>" "+o).join(`
|
|
201
|
+
`)}return typeof t.tag=="string"&&t.tag.length>0&&(n.message=`[${t.tag}] ${n.message}`),n}function ZG(t){const e=sx()+Sb;return t.split(`
|
|
202
|
+
`).map(n=>n.trim().replace("file://","").replace(e,""))}function eW(t){return QG(t,ZG)}const MC=ht.debug,Ct=pC({level:MC,defaults:{level:MC},throttle:2,throttleMin:500,formatOptions:{colors:!0,compact:!1,date:!1}}),xe=Ct.withTag("lsp");function BC(t){xe.error(t)}function ye(t){if(t instanceof Error){xe.warn(t.stack??t.message);return}xe.warn(t)}function tW(t){xe.level=ht[t]}function nW(t){const e={log:(n,r)=>{const{message:i,error:s}=eW(n);switch(n.type){case"silent":break;case"verbose":case"trace":{t.tracer.log(i);break}case"debug":{t.console.debug(i);break}case"log":{t.console.log(i);break}case"info":case"box":case"ready":case"start":case"success":{t.console.info(i);break}case"warn":{t.console.warn(i);break}case"fail":case"error":case"fatal":{t.console.error(i),s?t.telemetry.logEvent({eventName:"error",...s}):t.telemetry.logEvent({eventName:"error",message:i});break}default:Ie(n.type)}}};Ct.setReporters([e]),xe.setReporters(Ct.options.reporters)}const rW={fileSystemProvider:()=>new iW};let iW=class extends W4{async readDirectory(e){const n=await new G4.fdir().withSymlinks().withFullPaths().crawl(e.fsPath).withPromise(),r=[];for(const i of n)try{const s=await WI(i);r.push({isFile:s.isFile(),isDirectory:s.isDirectory(),uri:Wt.file(i)})}catch(s){xe.error(s)}return r}};function zC(t){return typeof t=="object"&&t!==null&&typeof t.id=="string"}function Yy(t){return typeof t=="object"&&t!==null&&t.$$type==="Node"&&typeof t.id=="string"}function qC(t){return Yy(t)||zC(t)}function du(t){return typeof t=="string"||qC(t)}function sW(t){return Array.isArray(t)&&t.every(du)}function oW(t){return["n","ne","e","se","s","sw","w","nw","c"].includes(t)}function jC(t){if(qC(t))return t;const[e,n,r]=t.split(":");return oW(r)?{id:e,port:n,compass:r}:{id:e,port:n}}function aW(t){if(t.length<2&&(du(t[0])&&du(t[1]))===!1)throw Error("EdgeTargets must have at least 2 elements.");return t.map(e=>jC(e))}const lp=Object.seal({Graph:null,Digraph:null,Subgraph:null,Node:null,Edge:null});function cW(t){return Object.assign(Object.seal(Object.assign({},lp)),t)}function uW(...t){const[e,...n]=t;return(...r)=>n.reduce((i,s)=>s(i),e(...r))}function Wn(t,...e){return uW(t,...e)}const lW=t=>(...e)=>n=>t(n,...e),dW=t=>({[Symbol.iterator]:t}),rr=lW((t,e)=>Array.from(dW(function*(){for(const n of t)yield e(n)})));class UC{options;getLocation(){return this.options?.locationFunction?.()??null}constructor(e){this.options=e}createElement(e,n,r=[]){return{location:this.getLocation(),...n,type:e,children:r}}}const Ve=UC.prototype.createElement.bind(new UC),fW=/\r?\n/;function ir(t){return e=>e.join(t)}function pW(t){return e=>t+e+t}function Si(t,e){return n=>t+n+e}function dp(t){return e=>t+e}const GC=t=>t.replace(/\r/g,"\\r").replace(/\n/g,"\\n").replace(/"/g,'\\"'),fp=t=>t.split(fW),fu=(t,e,n)=>Wn(fp,rr(dp(t==="space"?" ".repeat(e):`
|
|
203
|
+
`)),ir(n)),Ss=t=>{switch(t){case"crlf":return`\r
|
|
204
|
+
`;case"lf":return`
|
|
205
|
+
`}},hW={match(t){return t.type==="AttributeList"},print(t,e){if(e.children.length===0)return`${e.kind.toLocaleLowerCase()} [];`;const n=Ss(t.endOfLine);return Wn(rr(t.print),ir(n),fu(t.indentStyle,t.indentSize,n),Si(`${e.kind.toLocaleLowerCase()} [${n}`,`${n}];`))(e.children)}},mW={match(t){return t.type==="Attribute"},print(t,e){return`${t.print(e.key)} = ${t.print(e.value)};`}},gW={match(t){return t.type==="Comment"},print(t,e){const n=Ss(t.endOfLine);switch(e.kind){case"Block":return Wn(fp,rr(dp(" * ")),ir(n),Si(`/**${n}`,`${n} */`))(e.value);case"Macro":return Wn(fp,rr(dp("# ")),ir(n))(e.value);case"Slash":default:return Wn(fp,rr(dp("// ")),ir(n))(e.value)}}},yW={match(t){return t.type==="Dot"},print(t,e){return e.children.map(t.print).join(Ss(t.endOfLine))}},vW={match(t){return t.type==="Edge"},print(t,e){const n=Wn(rr(t.print),ir(t.directed?" -> ":" -- "))(e.targets);if(e.children.length===0)return`${n};`;const r=Ss(t.endOfLine),i=Wn(rr(t.print),ir(r),fu(t.indentStyle,t.indentSize,r),Si(`[${r}`,`${r}];`))(e.children);return`${n} ${i}`}},wW={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=Ss(t.endOfLine),i=Wn(rr(t.print),ir(r),fu(t.indentStyle,t.indentSize,r),Si(`{${r}`,`${r}}`))(e.children);return`${n.join(" ")} ${i}`}},bW=Wn(GC,pW('"')),DW=Si("<",">"),EW={match(t){return t.type==="Literal"},print(t,e){switch(e.quoted){case"html":return DW(e.value);case!0:return bW(e.value);case!1:default:return GC(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=Ss(t.endOfLine),i=Wn(rr(t.print),ir(r),fu(t.indentStyle,t.indentSize,r),Si(`[${r}`,`${r}];`))(e.children);return`${n} ${i}`}},TW={match(t){return t.type==="NodeRefGroup"},print(t,e){return Wn(rr(t.print),ir(" "),Si("{","}"))(e.children)}},$W={match(t){return t.type==="NodeRef"},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(":")}},SW={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=Ss(t.endOfLine),i=Wn(rr(t.print),ir(r),fu(t.indentStyle,t.indentSize,r),Si(`{${r}`,`${r}}`))(e.children);return`${n.join(" ")} ${i}`}},CW=[hW,mW,gW,yW,vW,wW,EW,RW,TW,$W,SW];class kW{options;#e=[...CW];constructor(e={}){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 c of n)if(c.match(a))return c.print(o,a);throw Error()}};return o.print(e)}}function AW(t,e){const n=new kW(e).print(t);if(!n)throw new Error;return n}function pp(t,e){if(typeof e=="string"){const n=e.trim();return/^<.+>$/ms.test(n)?Ve("Attribute",{key:Ve("Literal",{value:t,quoted:!1},[]),value:Ve("Literal",{value:n.slice(1,n.length-1),quoted:"html"},[])},[]):Ve("Attribute",{key:Ve("Literal",{value:t,quoted:!1},[]),value:Ve("Literal",{value:e,quoted:!0},[])},[])}return Ve("Attribute",{key:Ve("Literal",{value:t,quoted:!1},[]),value:Ve("Literal",{value:String(e),quoted:!1},[])},[])}function Cs(t,e){return Ve("Comment",{kind:e,value:t},[])}function WC(t,e){return Array.from(function*(){for(const[n,r]of e.values)yield pp(n,r);for(const n of Object.values(e.attributes))n.size>0&&(n.comment&&(yield Cs(n.comment,t.commentKind)),yield t.convert(n));for(const n of e.nodes)n.comment&&(yield Cs(n.comment,t.commentKind)),yield t.convert(n);for(const n of e.subgraphs)n.comment&&(yield Cs(n.comment,t.commentKind)),yield t.convert(n);for(const n of e.edges)n.comment&&(yield Cs(n.comment,t.commentKind)),yield t.convert(n)}())}const _W={match(t){return t.$$type==="AttributeList"},convert(t,e){return Ve("AttributeList",{kind:e.$$kind},e.values.map(([n,r])=>pp(n,r)))}},PW={match(t){return t.$$type==="Edge"},convert(t,e){return Ve("Edge",{targets:e.targets.map(n=>Yy(n)?Ve("NodeRef",{id:Ve("Literal",{value:n.id,quoted:!0},[])},[]):zC(n)?Ve("NodeRef",{id:Ve("Literal",{value:n.id,quoted:!0},[]),port:n.port?Ve("Literal",{value:n.port,quoted:!0},[]):void 0,compass:n.compass?Ve("Literal",{value:n.compass,quoted:!0},[]):void 0},[]):Ve("NodeRefGroup",{},n.map(r=>Yy(r)?Ve("NodeRef",{id:Ve("Literal",{value:r.id,quoted:!0},[])},[]):Ve("NodeRef",{id:Ve("Literal",{value:r.id,quoted:!0},[]),port:r.port?Ve("Literal",{value:r.port,quoted:!0},[]):void 0,compass:r.compass?Ve("Literal",{value:r.compass,quoted:!0},[]):void 0},[]))))},[...e.attributes.comment?[Cs(e.attributes.comment,t.commentKind)]:[],...e.attributes.values.map(([n,r])=>pp(n,r))])}},IW={match(t){return t.$$type==="Graph"},convert(t,e){return Ve("Dot",{},[...e.comment?[Cs(e.comment,t.commentKind)]:[],Ve("Graph",{directed:e.directed,strict:e.strict,id:e.id?Ve("Literal",{value:e.id,quoted:!0},[]):void 0},WC(t,e))])}},xW={match(t){return t.$$type==="Node"},convert(t,e){return Ve("Node",{id:Ve("Literal",{value:e.id,quoted:!0},[])},[...e.attributes.comment?[Cs(e.attributes.comment,t.commentKind)]:[],...e.attributes.values.map(([n,r])=>pp(n,r))])}},OW={match(t){return t.$$type==="Subgraph"},convert(t,e){return Ve("Subgraph",{id:e.id?Ve("Literal",{value:e.id,quoted:!0},[]):void 0},WC(t,e))}},NW=[_W,PW,xW,IW,OW];class FW{options;#e=[...NW];constructor(e={}){this.options=e}convert(e){const n=[...this.#e],{commentKind:r="Slash"}=this.options,i={commentKind:r,convert(s){for(const o of n)if(o.match(s))return o.convert(i,s);throw Error()}};return i.convert(e)}}function LW(t,e){return new FW(e).convert(t)}const x=new Proxy(Object.freeze({}),{get:(t,e)=>e});class Xy{}class Jy extends Xy{#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(e);for(const[r,i]of n)this.set(r,i)}clear(){this.#e.clear()}}class Qy extends Jy{$$kind;get $$type(){return"AttributeList"}comment;constructor(e,n){super(n),this.$$kind=e}}class HC extends Jy{#e=lp;id;comment;attributes=Object.freeze({graph:new Qy("Graph"),edge:new Qy("Edge"),node:new Qy("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,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){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=>sW(s)?aW(s):jC(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.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(o),o}typeof e=="object"&&e!==null&&this.attributes.edge.apply(e)}graph(e){this.attributes.graph.apply(e)}}class VC extends HC{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 MW extends VC{get directed(){return!0}}class BW extends VC{get directed(){return!1}}class zW extends HC{get $$type(){return"Subgraph"}id;constructor(...e){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 KC extends Jy{comment}let qW=class extends Xy{id;get $$type(){return"Node"}comment;attributes;constructor(e,n){super(),this.id=e,this.attributes=new KC(n)}port(e){return typeof e=="string"?{id:this.id,port:e}:{id:this.id,...e}}};class jW extends Xy{targets;get $$type(){return"Edge"}comment;attributes;constructor(e,n){if(super(),this.targets=e,e.length<2&&(du(e[0])&&du(e[1]))===!1)throw Error("The element of Edge target is missing or not satisfied as Edge target.");this.attributes=new KC(n)}}Object.assign(lp,{Graph:BW,Digraph:MW,Subgraph:zW,Node:qW,Edge:jW});function YC(t,e){return(...n)=>{const r=t?this.Digraph:this.Graph,i=n.find(c=>typeof c=="string"),s=n.find(c=>typeof c=="object"),o=n.find(c=>typeof c=="function"),a=new r(i,e,s);return a.with(this),typeof o=="function"&&o(a),a}}function XC(t,e=lp){return Object.freeze({digraph:YC.call(e,!0,t),graph:YC.call(e,!1,t)})}const JC=XC(!1),UW=JC.digraph;JC.graph;const GW=XC(!0);function QC(t,e){const n=LW(t,e?.convert);return AW(n,e?.print)}var Zy,ZC;function WW(){if(ZC)return Zy;ZC=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(`
|
|
206
|
+
`).map(o=>t(o)).join(`
|
|
207
|
+
`)}Zy=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||`
|
|
208
|
+
`+o,c=typeof i.escape=="function"?i.escape:n,u=".{1,"+s+"}";i.cut!==!0&&(u+="([\\s\u200B]+|$)|[^\\s\u200B]+?([\\s\u200B]+|$)");var l=new RegExp(u,"g"),d=r.match(l)||[],f=o+d.map(function(p){return p.slice(-1)===`
|
|
209
|
+
`&&(p=p.slice(0,p.length-1)),c(p)}).join(a);return i.trim===!0&&(f=e(f)),f};function n(r){return r}return Zy}var HW=WW();const VW=Lf(HW),hp={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<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 hp.hue2rgb(s,i,t+1/3)*255;case"g":return hp.hue2rgb(s,i,t)*255;case"b":return hp.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,c=o>.5?a/(2-i-s):a/(i+s);if(r==="s")return c*100;switch(i){case t: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}}},KW={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}`}},Ae={channel:hp,lang:KW,unit:YW},Ci={};for(let t=0;t<=255;t++)Ci[t]=Ae.unit.dec2hex(t);const Qt={ALL:0,RGB:1,HSL:2};class XW{constructor(){this.type=Qt.ALL}get(){return this.type}set(e){if(this.type&&this.type!==e)throw new Error("Cannot change both RGB and HSL channels at the same time");this.type=e}reset(){this.type=Qt.ALL}is(e){return this.type===e}}class JW{constructor(e,n){this.color=n,this.changed=!1,this.data=e,this.type=new XW}set(e,n){return this.color=n,this.changed=!1,this.data=e,this.type.type=Qt.ALL,this}_ensureHSL(){const e=this.data,{h:n,s:r,l:i}=e;n===void 0&&(e.h=Ae.channel.rgb2hsl(e,"h")),r===void 0&&(e.s=Ae.channel.rgb2hsl(e,"s")),i===void 0&&(e.l=Ae.channel.rgb2hsl(e,"l"))}_ensureRGB(){const e=this.data,{r:n,g:r,b:i}=e;n===void 0&&(e.r=Ae.channel.hsl2rgb(e,"r")),r===void 0&&(e.g=Ae.channel.hsl2rgb(e,"g")),i===void 0&&(e.b=Ae.channel.hsl2rgb(e,"b"))}get r(){const e=this.data,n=e.r;return!this.type.is(Qt.HSL)&&n!==void 0?n:(this._ensureHSL(),Ae.channel.hsl2rgb(e,"r"))}get g(){const e=this.data,n=e.g;return!this.type.is(Qt.HSL)&&n!==void 0?n:(this._ensureHSL(),Ae.channel.hsl2rgb(e,"g"))}get b(){const e=this.data,n=e.b;return!this.type.is(Qt.HSL)&&n!==void 0?n:(this._ensureHSL(),Ae.channel.hsl2rgb(e,"b"))}get h(){const e=this.data,n=e.h;return!this.type.is(Qt.RGB)&&n!==void 0?n:(this._ensureRGB(),Ae.channel.rgb2hsl(e,"h"))}get s(){const e=this.data,n=e.s;return!this.type.is(Qt.RGB)&&n!==void 0?n:(this._ensureRGB(),Ae.channel.rgb2hsl(e,"s"))}get l(){const e=this.data,n=e.l;return!this.type.is(Qt.RGB)&&n!==void 0?n:(this._ensureRGB(),Ae.channel.rgb2hsl(e,"l"))}get a(){return this.data.a}set r(e){this.type.set(Qt.RGB),this.changed=!0,this.data.r=e}set g(e){this.type.set(Qt.RGB),this.changed=!0,this.data.g=e}set b(e){this.type.set(Qt.RGB),this.changed=!0,this.data.b=e}set h(e){this.type.set(Qt.HSL),this.changed=!0,this.data.h=e}set s(e){this.type.set(Qt.HSL),this.changed=!0,this.data.s=e}set l(e){this.type.set(Qt.HSL),this.changed=!0,this.data.l=e}set a(e){this.changed=!0,this.data.a=e}}const ev=new JW({r:0,g:0,b:0,a:0},"transparent"),Eo={re:/^#((?:[a-f0-9]{2}){2,4}|[a-f0-9]{3})$/i,parse:t=>{if(t.charCodeAt(0)!==35)return;const e=t.match(Eo.re);if(!e)return;const n=e[1],r=parseInt(n,16),i=n.length,s=i%4===0,o=i>4,a=o?1:17,c=o?8:4,u=s?0:-1,l=o?255:15;return ev.set({r:(r>>c*(u+3)&l)*a,g:(r>>c*(u+2)&l)*a,b:(r>>c*(u+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?`#${Ci[Math.round(e)]}${Ci[Math.round(n)]}${Ci[Math.round(r)]}${Ci[Math.round(i*255)]}`:`#${Ci[Math.round(e)]}${Ci[Math.round(n)]}${Ci[Math.round(r)]}`}},ks={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,hueRe:/^(.+?)(deg|grad|rad|turn)$/i,_hue2deg:t=>{const e=t.match(ks.hueRe);if(e){const[,n,r]=e;switch(r){case"grad":return Ae.channel.clamp.h(parseFloat(n)*.9);case"rad":return Ae.channel.clamp.h(parseFloat(n)*180/Math.PI);case"turn":return Ae.channel.clamp.h(parseFloat(n)*360)}}return Ae.channel.clamp.h(parseFloat(t))},parse:t=>{const e=t.charCodeAt(0);if(e!==104&&e!==72)return;const n=t.match(ks.re);if(!n)return;const[,r,i,s,o,a]=n;return ev.set({h:ks._hue2deg(r),s:Ae.channel.clamp.s(parseFloat(i)),l:Ae.channel.clamp.l(parseFloat(s)),a:o?Ae.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(${Ae.lang.round(e)}, ${Ae.lang.round(n)}%, ${Ae.lang.round(r)}%, ${i})`:`hsl(${Ae.lang.round(e)}, ${Ae.lang.round(n)}%, ${Ae.lang.round(r)}%)`}},pu={colors:{aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",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:"#8fbc8f",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:"#cd5c5c",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:"#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:"#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:"#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=pu.colors[t];if(e)return Eo.parse(e)},stringify:t=>{const e=Eo.stringify(t);for(const n in pu.colors)if(pu.colors[n]===e)return n}},hu={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,parse:t=>{const e=t.charCodeAt(0);if(e!==114&&e!==82)return;const n=t.match(hu.re);if(!n)return;const[,r,i,s,o,a,c,u,l]=n;return ev.set({r:Ae.channel.clamp.r(i?parseFloat(r)*2.55:parseFloat(r)),g:Ae.channel.clamp.g(o?parseFloat(s)*2.55:parseFloat(s)),b:Ae.channel.clamp.b(c?parseFloat(a)*2.55:parseFloat(a)),a:u?Ae.channel.clamp.a(l?parseFloat(u)/100:parseFloat(u)):1},t)},stringify:t=>{const{r:e,g:n,b:r,a:i}=t;return i<1?`rgba(${Ae.lang.round(e)}, ${Ae.lang.round(n)}, ${Ae.lang.round(r)}, ${Ae.lang.round(i)})`:`rgb(${Ae.lang.round(e)}, ${Ae.lang.round(n)}, ${Ae.lang.round(r)})`}},ki={format:{keyword:pu,hex:Eo,rgb:hu,rgba:hu,hsl:ks,hsla:ks},parse:t=>{if(typeof t!="string")return t;const e=Eo.parse(t)||hu.parse(t)||ks.parse(t)||pu.parse(t);if(e)return e;throw new Error(`Unsupported color format: "${t}"`)},stringify:t=>!t.changed&&t.color?t.color:t.type.is(Qt.HSL)||t.data.r===void 0?ks.stringify(t):t.a<1||!Number.isInteger(t.r)||!Number.isInteger(t.g)||!Number.isInteger(t.b)?hu.stringify(t):Eo.stringify(t)},QW=(t,e)=>{const n=ki.parse(t);for(const r in e)n[r]=Ae.channel.clamp[r](e[r]);return ki.stringify(n)},ek=t=>ki.format.hex.stringify(ki.parse(t)),ZW=(t,e,n)=>{const r=ki.parse(t),i=r[e],s=Ae.channel.clamp[e](i+n);return i!==s&&(r[e]=s),ki.stringify(r)},e9=(t,e)=>ZW(t,"a",-e),t9=(t,e)=>{const n=ki.parse(t),r={};for(const i in e)e[i]&&(r[i]=n[i]+e[i]);return QW(t,r)},n9=(t,e)=>{const n=ki.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],Ae.channel.max[s]);return t9(t,r)};class r9{value;next;constructor(e){this.value=e}}class i9{#e;#t;#n;constructor(){this.clear()}enqueue(e){const n=new r9(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 tv(t){tk(t);const e=new i9;let n=0;const r=()=>{n<t&&e.size>0&&(e.dequeue()(),n++)},i=()=>{n--,r()},s=async(c,u,l)=>{const d=(async()=>c(...l))();u(d);try{await d}catch{}i()},o=(c,u,l)=>{new Promise(d=>{e.enqueue(d)}).then(s.bind(void 0,c,u,l)),(async()=>(await Promise.resolve(),n<t&&r()))()},a=(c,...u)=>new Promise(l=>{o(c,l,u)});return Object.defineProperties(a,{activeCount:{get:()=>n},pendingCount:{get:()=>e.size},clearQueue:{value(){e.clear()}},concurrency:{get:()=>t,set(c){tk(c),t=c,queueMicrotask(()=>{for(;n<t&&e.size>0;)r()})}}}),a}function tk(t){if(!((Number.isInteger(t)||t===Number.POSITIVE_INFINITY)&&t>0))throw new TypeError("Expected `concurrency` to be a number from 1 and up")}var s9=Object.getOwnPropertyNames,o9=Object.getOwnPropertySymbols,a9=Object.prototype.hasOwnProperty;function nk(t,e){return function(n,r,i){return t(n,r,i)&&e(n,r,i)}}function mp(t){return function(e,n,r){if(!e||!n||typeof e!="object"||typeof n!="object")return t(e,n,r);var i=r.cache,s=i.get(e),o=i.get(n);if(s&&o)return s===n&&o===e;i.set(e,n),i.set(n,e);var a=t(e,n,r);return i.delete(e),i.delete(n),a}}function rk(t){return s9(t).concat(o9(t))}var ik=Object.hasOwn||function(t,e){return a9.call(t,e)};function Ro(t,e){return t||e?t===e:t===e||t!==t&&e!==e}var sk="_owner",ok=Object.getOwnPropertyDescriptor,ak=Object.keys;function c9(t,e,n){var r=t.length;if(e.length!==r)return!1;for(;r-- >0;)if(!n.equals(t[r],e[r],r,r,t,e,n))return!1;return!0}function u9(t,e){return Ro(t.getTime(),e.getTime())}function ck(t,e,n){if(t.size!==e.size)return!1;for(var r={},i=t.entries(),s=0,o,a;(o=i.next())&&!o.done;){for(var c=e.entries(),u=!1,l=0;(a=c.next())&&!a.done;){var d=o.value,f=d[0],p=d[1],m=a.value,w=m[0],E=m[1];!u&&!r[l]&&(u=n.equals(f,w,s,l,t,e,n)&&n.equals(p,E,f,w,t,e,n))&&(r[l]=!0),l++}if(!u)return!1;s++}return!0}function l9(t,e,n){var r=ak(t),i=r.length;if(ak(e).length!==i)return!1;for(var s;i-- >0;)if(s=r[i],s===sk&&(t.$$typeof||e.$$typeof)&&t.$$typeof!==e.$$typeof||!ik(e,s)||!n.equals(t[s],e[s],s,s,t,e,n))return!1;return!0}function mu(t,e,n){var r=rk(t),i=r.length;if(rk(e).length!==i)return!1;for(var s,o,a;i-- >0;)if(s=r[i],s===sk&&(t.$$typeof||e.$$typeof)&&t.$$typeof!==e.$$typeof||!ik(e,s)||!n.equals(t[s],e[s],s,s,t,e,n)||(o=ok(t,s),a=ok(e,s),(o||a)&&(!o||!a||o.configurable!==a.configurable||o.enumerable!==a.enumerable||o.writable!==a.writable)))return!1;return!0}function d9(t,e){return Ro(t.valueOf(),e.valueOf())}function f9(t,e){return t.source===e.source&&t.flags===e.flags}function uk(t,e,n){if(t.size!==e.size)return!1;for(var r={},i=t.values(),s,o;(s=i.next())&&!s.done;){for(var a=e.values(),c=!1,u=0;(o=a.next())&&!o.done;)!c&&!r[u]&&(c=n.equals(s.value,o.value,s.value,o.value,t,e,n))&&(r[u]=!0),u++;if(!c)return!1}return!0}function p9(t,e){var n=t.length;if(e.length!==n)return!1;for(;n-- >0;)if(t[n]!==e[n])return!1;return!0}var h9="[object Arguments]",m9="[object Boolean]",g9="[object Date]",y9="[object Map]",v9="[object Number]",w9="[object Object]",b9="[object RegExp]",D9="[object Set]",E9="[object String]",R9=Array.isArray,lk=typeof ArrayBuffer=="function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,dk=Object.assign,T9=Object.prototype.toString.call.bind(Object.prototype.toString);function $9(t){var e=t.areArraysEqual,n=t.areDatesEqual,r=t.areMapsEqual,i=t.areObjectsEqual,s=t.arePrimitiveWrappersEqual,o=t.areRegExpsEqual,a=t.areSetsEqual,c=t.areTypedArraysEqual;return function(u,l,d){if(u===l)return!0;if(u==null||l==null||typeof u!="object"||typeof l!="object")return u!==u&&l!==l;var f=u.constructor;if(f!==l.constructor)return!1;if(f===Object)return i(u,l,d);if(R9(u))return e(u,l,d);if(lk!=null&&lk(u))return c(u,l,d);if(f===Date)return n(u,l,d);if(f===RegExp)return o(u,l,d);if(f===Map)return r(u,l,d);if(f===Set)return a(u,l,d);var p=T9(u);return p===g9?n(u,l,d):p===b9?o(u,l,d):p===y9?r(u,l,d):p===D9?a(u,l,d):p===w9?typeof u.then!="function"&&typeof l.then!="function"&&i(u,l,d):p===h9?i(u,l,d):p===m9||p===v9||p===E9?s(u,l,d):!1}}function S9(t){var e=t.circular,n=t.createCustomConfig,r=t.strict,i={areArraysEqual:r?mu:c9,areDatesEqual:u9,areMapsEqual:r?nk(ck,mu):ck,areObjectsEqual:r?mu:l9,arePrimitiveWrappersEqual:d9,areRegExpsEqual:f9,areSetsEqual:r?nk(uk,mu):uk,areTypedArraysEqual:r?mu:p9};if(n&&(i=dk({},i,n(i))),e){var s=mp(i.areArraysEqual),o=mp(i.areMapsEqual),a=mp(i.areObjectsEqual),c=mp(i.areSetsEqual);i=dk({},i,{areArraysEqual:s,areMapsEqual:o,areObjectsEqual:a,areSetsEqual:c})}return i}function C9(t){return function(e,n,r,i,s,o,a){return t(e,n,a)}}function k9(t){var e=t.circular,n=t.comparator,r=t.createState,i=t.equals,s=t.strict;if(r)return function(a,c){var u=r(),l=u.cache,d=l===void 0?e?new WeakMap:void 0:l,f=u.meta;return n(a,c,{cache:d,equals:i,meta:f,strict:s})};if(e)return function(a,c){return n(a,c,{cache:new WeakMap,equals:i,meta:void 0,strict:s})};var o={cache:void 0,equals:i,meta:void 0,strict:s};return function(a,c){return n(a,c,o)}}var A9=Ai();Ai({strict:!0}),Ai({circular:!0}),Ai({circular:!0,strict:!0}),Ai({createInternalComparator:function(){return Ro}}),Ai({strict:!0,createInternalComparator:function(){return Ro}}),Ai({circular:!0,createInternalComparator:function(){return Ro}}),Ai({circular:!0,createInternalComparator:function(){return Ro},strict:!0});function Ai(t){t===void 0&&(t={});var e=t.circular,n=e===void 0?!1:e,r=t.createInternalComparator,i=t.createState,s=t.strict,o=s===void 0?!1:s,a=S9(t),c=$9(a),u=r?r(c):C9(c);return k9({circular:n,comparator:c,createState:i,equals:u,strict:o})}function fk(t,e){const n=t.nodes.map(i=>{const s=e.nodes[i.id];if(!s)return i;const{x:o,y:a,width:c,height:u}=s;return{...i,width:c,height:u,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 pk=(t,e)=>t.width>e.width+10||t.height>e.height+10;function _9(t,e){if(t.hash===e.hash)return{diagram:fk(t,e)};if(A9(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||pk(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:fk(t,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||pk(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:Jf(e.edges).flatMap(([r,i])=>i.dotpos?{id:r,dotpos:i.dotpos}:[])}}}function On(t){return t.children.length>0}function Zt(t){switch(t){case"open":return"vee";default:return t}}function Er(t){return Array.isArray(t)?[Er(t[0]),Er(t[1])]:($e(isFinite(t),`Invalid not finite point value ${t}`),Math.round(t))}const hk=t=>($e(isFinite(t),`Invalid not finite inch value ${t}`),Math.floor(t*72)),at=t=>Math.ceil(t/72*1e3)/1e3,Nn=t=>Math.ceil(t);Nn(40).toString();function mk(t,e){return ek(n9(t,{l:-35-5*e,s:-15-5*e}))}function P9(t){return ek(e9(t,.3))}function I9(t){return t.trim().replaceAll("&","&").replaceAll("<","<").replaceAll(">",">")}function nv(t,e,n){let r=VW(t,{width:e,indent:"",escape:I9}).split(`
|
|
210
|
+
`);return Ht(n)&&n>0&&r.length>n&&(r=r.slice(0,n-1)),r}function As({text:t,maxchars:e,fontsize:n,maxLines:r,bold:i,color:s}){let o=nv(t,e,r).join("<BR/>");i&&(o=`<B>${o}</B>`);const a=s?` COLOR="${s}"`:"";return`<FONT POINT-SIZE="${Nn(n)}"${a}>${o}</FONT>`}function x9(t,e){const n=ae(t.icon),r=[As({text:t.title,fontsize:19,maxchars:35,maxLines:3})];if(ae(t.technology?.trim())&&r.push(As({text:t.technology,fontsize:12,maxchars:n?35:45,maxLines:1,color:e.loContrast})),ae(t.description?.trim())&&r.push(As({text:t.description,fontsize:14,maxchars:n?35:45,maxLines:5,color:e.loContrast})),r.length===1&&!n)return`<${r[0]}>`;const i=n?(s,o,a)=>{let c=`<TD ALIGN="TEXT" BALIGN="LEFT">${s}</TD>`;if(o===0){const u=a.length>1?` ROWSPAN="${a.length}"`:"";let l=76;(t.shape==="queue"||t.shape==="mobile")&&(l+=20),c=`<TD${u} WIDTH="${l}"> </TD>${c}`,c=`${c}<TD${u} WIDTH="16"> </TD>`}return`<TR>${c}</TR>`}:s=>`<TR><TD>${s}</TD></TR>`;return`<<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="6">${r.map(i).join("")}</TABLE>>`}function O9(t,e){const n=As({text:t.title.toUpperCase(),maxchars:50,fontsize:11,maxLines:1,bold:!0,color:e});return n.includes("<BR/>")?`<<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0"><TR><TD ALIGN="TEXT" BALIGN="LEFT">${n}</TD></TR></TABLE>>`:`<${n}>`}const gu=40,rv=`BGCOLOR="${Ir.relationships[Jo].labelBgColor}A0"`;function gk({label:t,technology:e}){const n=[];if(ae(t?.trim())&&n.push(As({text:t,maxchars:gu,fontsize:14,maxLines:5,bold:t==="[...]"})),ae(e?.trim())&&n.push(As({text:`[ ${e} ]`,fontsize:12,maxLines:1,maxchars:gu})),n.length===0)return null;const r=n.map(i=>`<TR><TD ALIGN="TEXT" BALIGN="LEFT">${i}</TD></TR>`).join("");return`<<TABLE BORDER="0" CELLPADDING="3" CELLSPACING="0" ${rv}>${r}</TABLE>>`}function N9(t,e){const n=`<TABLE BORDER="0" CELLPADDING="6" ${rv}><TR><TD WIDTH="20" HEIGHT="20"><FONT POINT-SIZE="${Nn(14)}"><B>${t}</B></FONT></TD></TR></TABLE>`;return ae(e?.trim())?`<${['<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3">',"<TR>",`<TD>${n}</TD>`,`<TD ${rv} CELLPADDING="3">`,As({text:e,maxchars:gu,fontsize:14,maxLines:5}),"</TD>","</TR>","</TABLE>"].join("")}>`:`<${n}>`}const iv="dashed",sv=Ir.font;class ov{constructor(e){this.view=e,this.compoundIds=new Set(e.nodes.filter(On).map(i=>i.id)),this.edgesWithCompounds=new Set(this.compoundIds.size>0?e.edges.filter(i=>this.compoundIds.has(i.source)||this.compoundIds.has(i.target)).map(i=>i.id):[]);const n=new Map;for(const i of e.edges)n.set(i.id,KI(i.source,i.target));this.edgeDistances=n;const r=this.graphvizModel=this.createGraph();this.applyNodeAttributes(r.attributes.node),this.applyEdgeAttributes(r.attributes.edge)}ids=new Set;subgraphs=new Map;nodes=new Map;edges=new Map;compoundIds;edgesWithCompounds;edgeDistances;graphvizModel;get hasEdgesWithCompounds(){return this.edgesWithCompounds.size>0}postBuild(e){}build(e){const n=(i,s)=>{const o=this.nodeId(i),a=this.elementToSubgraph(i,s.subgraph(o));this.subgraphs.set(i.id,a);for(const c of i.children){const u=this.viewElement(c);if(On(u))n(u,a);else{const l=rn(this.getGraphNode(u.id),`Graphviz Node not found for ${u.id}`);a.node(l.id)}}},r=[];for(const i of this.view.nodes)if(On(i))yt(i.parent)&&r.push(i);else{const s=this.nodeId(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),QC(this.graphvizModel,{print:{indentStyle:"space",indentSize:2}})}createGraph(){const e=this.view.autoLayout,n=UW({[x.bgcolor]:"transparent",[x.layout]:"dot",[x.compound]:!0,[x.rankdir]:e.direction,[x.TBbalance]:"min",[x.splines]:"spline",[x.outputorder]:"nodesfirst",[x.nodesep]:at(e.nodeSep??110),[x.ranksep]:at(e.rankSep??120),[x.pack]:Nn(e.rankSep??120),[x.packmode]:"array_3",[x.pad]:at(15),[x.fontname]:sv});return n.attributes.graph.apply({[x.fontsize]:Nn(15),[x.labeljust]:e.direction==="RL"?"r":"l",[x.labelloc]:e.direction==="BT"?"b":"t",[x.margin]:50.1}),n}applyNodeAttributes(e){e.apply({[x.fontname]:sv,[x.shape]:"rect",[x.width]:at(320),[x.height]:at(180),[x.style]:"filled",[x.penwidth]:0})}applyEdgeAttributes(e){e.apply({[x.arrowsize]:.75,[x.fontname]:sv,[x.fontsize]:Nn(14),[x.penwidth]:Nn(2),[x.color]:Ir.relationships[Jo].lineColor,[x.fontcolor]:Ir.relationships[Jo].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(e),e)}nodeId(e){const n=On(e);let r=Zo(e.id).toLowerCase(),i=this.checkNodeId(r,n);if(i!==null)return i;let s=e.id,o;for(;o=ea(s);){if(r=Zo(o).toLowerCase()+"_"+r,i=this.checkNodeId(r,n),i!==null)return i;s=o}r=Zo(e.id).toLowerCase();let a=1;do i=this.checkNodeId(r+"_"+a++,n);while(i===null);return i}elementToSubgraph(e,n){$e(On(e),"node should be compound"),$e(Yf(e.depth),"node.depth should be defined");const r=this.getElementColorValues(e.color),i=P9(r.loContrast);return n.apply({[x.likec4_id]:e.id,[x.likec4_level]:e.level,[x.likec4_depth]:e.depth,[x.fillcolor]:mk(r.fill,e.depth),[x.color]:mk(r.stroke,e.depth),[x.style]:"filled",[x.margin]:Nn(e.children.length>1?40:32)}),ms(e.title.trim())||n.set(x.label,O9(e,i)),n}elementToNode(e,n){$e(!On(e),"node should not be compound");const r=ae(e.icon),i=this.getElementColorValues(e.color);switch(n.attributes.apply({[x.likec4_id]:e.id,[x.likec4_level]:e.level,[x.fillcolor]:i.fill,[x.fontcolor]:i.hiContrast,[x.color]:i.stroke,[x.margin]:`${at(r?10:26)},${at(26)}`}),e.shape){case"cylinder":case"storage":{n.attributes.apply({[x.margin]:`${at(r?10:26)},${at(0)}`,[x.penwidth]:Nn(2),[x.shape]:"cylinder"});break}case"browser":{n.attributes.apply({[x.margin]:`${at(r?10:30)},${at(32)}`});break}case"mobile":{n.attributes.apply({[x.margin]:`${at(r?10:30)},${at(26)}`});break}case"queue":{n.attributes.apply({[x.width]:at(320),[x.height]:at(165),[x.margin]:`${at(r?10:30)},${at(26)}`});break}}return n.attributes.set(x.label,x9(e,i)),n}leafElements(e){return e===null?this.view.nodes.filter(n=>!On(n)):this.viewElement(e).children.flatMap(n=>{const r=this.viewElement(n);return On(r)?this.leafElements(r.id):r})}descendants(e){return e===null?this.view.nodes.slice():this.viewElement(e).children.flatMap(n=>{const r=this.viewElement(n);return[r,...this.descendants(r.id)]})}viewElement(e){return rn(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.viewElement(e),i=this.getGraphNode(e),s;return i||($e(On(r),"endpoint node should be compound"),s=this.getSubgraph(e)?.id,$e(s,`subgraph ${e} not found`),r=rn(n(this.leafElements(e)),`leaf element in ${e} not found`),i=rn(this.getGraphNode(r.id),`source graphviz node ${r.id} not found`)),[r,i,s]}findInternalEdges(e){if(e===null)return this.view.edges.slice();const n=this.viewElement(e);return Ye(this.descendants(e),Di(r=>GT(r.inEdges,r.outEdges)),gy(),j8(GT(n.inEdges,n.outEdges)),un(r=>this.view.edges.find(i=>i.id===r)),je(ae))}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=Ye(this.view.nodes,je(On),un(r=>r.id),MT(YI),BT(),un(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}}),je(({edges:r})=>r.length>1&&r.length<8),i8(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=rn(this.getGraphNode(s.source),`Graphviz Node not found for ${s.source}`),a=rn(this.getGraphNode(s.target),`Graphviz Node not found for ${s.target}`);n.add(s.source),n.add(s.target),o.attributes.set(x.group,r.id),a.attributes.set(x.group,r.id)}catch(o){Ct.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 c=this.getGraphNode(o);if(!c)continue;const u=at(a.center.x)+r,l=at(e-a.center.y);a.fixedsize?c.attributes.apply({[x.pos]:`${u},${l}!`,[x.pin]:!0,[x.width]:at(a.fixedsize.width),[x.height]:at(a.fixedsize.height),[x.fixedsize]:!0}):c.attributes.set(x.pos,`${u},${l}`)}for(const[o,a]of this.edges.entries()){a.attributes.delete(x.weight),a.attributes.delete(x.minlen),a.attributes.delete(x.constraint);const c=n.edges.find(u=>u.id===o)?.dotpos;c&&!s&&a.attributes.set(x.pos,c)}return this.graphvizModel.apply({[x.layout]:"fdp",[x.overlap]:"vpsc",[x.sep]:"+50,50",[x.esep]:"+10,10",[x.start]:"random2",[x.splines]:"compound"}),this.graphvizModel.delete(x.compound),this.graphvizModel.delete(x.rankdir),this.graphvizModel.delete(x.nodesep),this.graphvizModel.delete(x.ranksep),this.graphvizModel.delete(x.pack),this.graphvizModel.delete(x.pad),this.graphvizModel.delete(x.packmode),this.graphvizModel.attributes.graph.delete(x.margin),this}getRelationshipColorValues(e){return _b(e)?Ir.relationships[e]:this.view.customColorDefinitions[e]?.relationships??Ir.relationships[Pb]}getElementColorValues(e){return _b(e)?Ir.elements[e]:this.view.customColorDefinitions[e]?.elements??Ir.elements[Pb]}}class F9 extends ov{createGraph(){const e=super.createGraph(),n=this.view.autoLayout;return e.delete(x.TBbalance),e.apply({[x.nodesep]:at(n.nodeSep??130),[x.ranksep]:at(n.rankSep??130)}),e}postBuild(e){Ye(this.view.nodes,un(n=>({node:n,graphvizNode:this.getGraphNode(n.id)})),gs(({node:n,graphvizNode:r})=>{if(r!=null)return vd.modelRef(n)??void 0}),mc(),je(gc(2)),k8(n=>{e.subgraph({[x.rank]:"same"},r=>{for(const{graphvizNode:i}of n)r.node(rn(i).id)})}),c8(()=>{e.set(x.newrank,!0),e.set(x.clusterrank,"global"),e.delete(x.pack),e.delete(x.packmode)}))}elementToSubgraph(e,n){const r=super.elementToSubgraph(e,n);return e.children.length>1&&r.set(x.margin,Nn(50)),r}addEdge(e,n){const[r,i]=[e.source,e.target],[s,o,a]=this.edgeEndpoint(r,b=>wc(b)),[c,u,l]=this.edgeEndpoint(i,vo),d=Jt(l)||Jt(a),f=n.edge([o,u],{[x.likec4_id]:e.id,[x.style]:e.line??iv});l&&f.attributes.set(x.lhead,l),a&&f.attributes.set(x.ltail,a);const p=this.edgeDistances.get(e.id)??0,m=[...s.inEdges,...s.outEdges,...c.inEdges,...c.outEdges].reduce((b,R)=>Math.max(b,this.edgeDistances.get(R)??0),0);m-p>1&&f.attributes.set(x.weight,m-p);const w=gk(e);if(w&&f.attributes.set(d?x.xlabel:x.label,w),e.color){const b=this.getRelationshipColorValues(e.color);f.attributes.apply({[x.color]:b.lineColor,[x.fontcolor]:b.labelColor})}let[E,y]=[e.head??Yi,e.tail??"none"];return E==="none"&&y==="none"?(f.attributes.apply({[x.arrowtail]:"none",[x.arrowhead]:"none",[x.dir]:"none"}),f):e.dir==="both"?(f.attributes.apply({[x.arrowhead]:Zt(E),[x.arrowtail]:Zt(e.tail??E),[x.dir]:"both"}),!d&&vd.modelRef(s)!==vd.modelRef(c)&&f.attributes.set(x.constraint,!1),f):(E!==Yi&&f.attributes.set(x.arrowhead,Zt(E)),y!=="none"&&f.attributes.set(x.arrowtail,Zt(y)),f)}}class bb extends ov{static toDot(e){return new bb(e).print()}postBuild(e){e.set(x.TBbalance,"max"),Ab(this.edgesWithCompounds,n=>this.view.edges.some(r=>r.id===n&&r.label))&&(e.delete(x.pack),e.delete(x.packmode))}addEdge(e,n){const{nodes:r}=this.view,[i,s]=e.dir==="back"?[e.target,e.source]:[e.source,e.target],[o,a,c]=this.edgeEndpoint(i,A=>wc(A)),[u,l,d]=this.edgeEndpoint(s,vo),f=n.edge([a,l],{[x.likec4_id]:e.id,[x.style]:e.line??iv});if(d&&f.attributes.set(x.lhead,d),c&&f.attributes.set(x.ltail,c),e.color&&e.color!==Jo){const A=this.getRelationshipColorValues(e.color);f.attributes.apply({[x.color]:A.lineColor,[x.fontcolor]:A.labelColor})}const p=[e.label?.trim(),e.technology?.trim()].filter(ae).join(`
|
|
211
|
+
`),m=VI(e.id),w=N9(m,p);f.attributes.set(x.label,w);const E=this.edgeDistances.get(e.id)??0,y=[...o.inEdges,...o.outEdges,...u.inEdges,...u.outEdges].reduce((A,q)=>Math.max(A,this.edgeDistances.get(q)??0),0);y-E>1&&f.attributes.set(x.weight,y-E);const b=r.findIndex(A=>A.id===i);r.findIndex(A=>A.id===s)<b&&e.dir!=="back"&&f.attributes.apply({[x.constraint]:!1});let[R,C]=[e.head??Yi,e.tail??"none"];return e.dir==="back"?(f.attributes.apply({[x.arrowtail]:Zt(R),[x.minlen]:0,[x.dir]:"back"}),C!=="none"&&f.attributes.apply({[x.arrowhead]:Zt(C),[x.dir]:"both"}),f):R==="none"&&C==="none"||R!=="none"&&C!=="none"?(f.attributes.apply({[x.arrowhead]:Zt(R),[x.arrowtail]:Zt(C),[x.dir]:"both"}),f):R==="none"?(f.attributes.delete(x.arrowhead),f.attributes.apply({[x.arrowtail]:Zt(C),[x.minlen]:0,[x.dir]:"back"}),f):(R!==Yi&&f.attributes.set(x.arrowhead,Zt(R)),f)}}class L9 extends ov{postBuild(e){this.assignGroups();const n=new Set,r=this.view.nodes.reduce((i,s)=>(On(s)&&(n.add(s.id),i.push(s)),i),[]);for(const i of r){const s=Ye(i.children,je(u=>!this.compoundIds.has(u)),un(u=>this.viewElement(u)),je(u=>u.inEdges.length===0&&u.outEdges.length===0));if(s.length<=2)continue;let o=2;switch(!0){case s.length>11:o=4;break;case s.length>4:o=3;break}const a=rn(this.getSubgraph(i.id),`Subgraph not found for ${i.id}`);let c=null;H8(s,o).forEach(u=>{const l=u.length>1?a.createSubgraph({[x.rank]:"same"}):null;u.forEach((d,f)=>{const p=this.getGraphNode(d.id);p&&(l?.node(p.id),f===0&&(c&&a.edge([c,p],{[x.style]:"invis"}),c=p))})})}Ab(this.edgesWithCompounds,i=>this.view.edges.some(s=>s.id===i&&s.label))&&(e.delete(x.pack),e.delete(x.packmode))}addEdge(e,n){const r=this.view.edges,[i,s]=e.dir==="back"?[e.target,e.source]:[e.source,e.target],[o,a,c]=this.edgeEndpoint(i,A=>wc(A)),[u,l,d]=this.edgeEndpoint(s,vo),f=e.parent,p=n.edge([a,l],{[x.likec4_id]:e.id,[x.style]:e.line??iv});d&&p.attributes.set(x.lhead,d),c&&p.attributes.set(x.ltail,c);const m=Jt(d)||Jt(c),w=this.edgeDistances.get(e.id)??0,E=[...o.inEdges,...o.outEdges,...u.inEdges,...u.outEdges].reduce((A,q)=>Math.max(A,this.edgeDistances.get(q)??0),0);E-w>1&&p.attributes.set(x.weight,E-w);const y=gk(e);if(y&&p.attributes.set(m?x.xlabel:x.label,y),e.color){const A=this.getRelationshipColorValues(e.color);p.attributes.apply({[x.color]:A.lineColor,[x.fontcolor]:A.labelColor})}let[b,R]=[e.head??Yi,e.tail??"none"];if(e.dir==="back")return p.attributes.apply({[x.arrowtail]:Zt(b),[x.dir]:"back"}),R!=="none"&&p.attributes.apply({[x.arrowhead]:Zt(R),[x.dir]:"both",[x.minlen]:0}),p;if(b==="none"&&R==="none")return p.attributes.apply({[x.arrowtail]:"none",[x.arrowhead]:"none",[x.dir]:"none",[x.minlen]:0,[x.constraint]:!1}),p;if(b!=="none"&&R!=="none")return p.attributes.apply({[x.arrowhead]:Zt(b),[x.arrowtail]:Zt(R),[x.dir]:"both",[x.minlen]:0}),p;if(b!==Yi&&p.attributes.set(x.arrowhead,Zt(b)),R!=="none"&&p.attributes.set(x.arrowtail,Zt(R)),r.length===1)return p;let C;return f===null&&o.parent==null&&u.parent==null?C=r.filter(A=>{if(A.id===e.id||A.parent!==null||A.source===e.source&&A.target===e.target||A.source===e.target&&A.target===e.source)return!1;const q=this.viewElement(A.source),G=this.viewElement(A.target);return On(q)||On(G)?!1:q.parent==null&&G.parent==null}):C=this.findInternalEdges(f).filter(A=>!(A.id===e.id||A.source===e.source&&A.target===e.target||A.source===e.target&&A.target===e.source)),C.length===0&&(f===null||this.leafElements(f).length<=3)&&p.attributes.set(x.minlen,0),p}}function gp(t){const[e,n,r,i]=t?t.split(",").map(a=>Er(+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 M9(t){try{const[e,n]=t.split(",");return{x:Er(parseFloat(e)),y:Er(parseFloat(n))}}catch(e){throw new Error(`Failed on parsing pos: ${t}`,{cause:e})}}function yk(t){const{x:e,y:n}=M9(t.pos),r=hk(parseFloat(t.width)),i=hk(parseFloat(t.height));return{x:e-Math.round(r/2),y:n-Math.round(i/2),width:r,height:i}}function vk(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 u of t){if(u.op==="F"){a=Er(u.size);continue}if(u.op==="T"){let l=Er(u.pt[0])-e,d=Er(u.width);switch(u.align){case"r":l-=d;break;case"c":l-=Math.round(d/2);break}r=Math.min(r,l),s=Math.max(s,l+d);let f=Er(u.pt[1])-n;i=Math.min(i,Math.round(f-a)),o=Math.max(o,f)}}}catch(u){return Ct.warn(`Failed on parsing label draw ops: ${u}
|
|
212
|
+
${JSON.stringify(t,null,2)}`),null}if(r===1/0)return null;const c=2;return{x:r-c,y:i-c,width:s-r+2*c,height:o-i+2*c}}function wk({_draw_:t,likec4_id:e="???"},n="<unknown view>"){try{const r=t.filter(s=>s.op.toLowerCase()==="b");$e(gc(r,1),`view ${n} edge ${e} should have at least one bezier draw op`),r.length>1&&Ct.warn(`view ${n} edge ${e} has more than one bezier draw op, using the first one only`);const i=r[0].points.map(s=>Er(s));return $e(gc(i,2),`view ${n} edge ${e} should have at least two points`),i}catch(r){throw new Error(`failed on parsing view ${n} edge ${e} _draw_:
|
|
213
|
+
${JSON.stringify(t,null,2)}`,{cause:r})}}function B9(t,{id:e,source:n,target:r,dir:i,label:s,description:o,...a},c){const u=vk(t._ldraw_??t._tldraw_??t._hldraw_),l=t.dir==="back"||i==="back";return s=s?nv(s,gu).join(`
|
|
214
|
+
`):null,o=o?nv(o,gu).join(`
|
|
215
|
+
`):void 0,{id:e,source:n,target:r,label:s,...ae(o)&&{description:o},...ae(t.pos)&&{dotpos:t.pos},points:wk(t,c),labelBBox:u,...l?{dir:"back"}:{},...a}}function bk(t,e){const n=JSON.parse(t),r=gp(n.bb),{nodes:i,edges:s,manualLayout:o,...a}=e,c={...a,bounds:r,nodes:[],edges:[]},u=n.objects??[];for(const d of i){const f=u.find(p=>p.likec4_id===d.id);$e(f,`View ${a.id} node ${d.id} not found in graphviz output`);try{const{x:p,y:m,width:w,height:E}="bb"in f?gp(f.bb):yk(f),y=[p,m];c.nodes.push({...d,position:y,width:w,height:E,labelBBox:vk(f._ldraw_,y)??{x:p,y:m,width:w,height:E}})}catch(p){throw new Error(`Failed on parsing node ${d.id}:
|
|
216
|
+
${JSON.stringify(f,null,2)}`,{cause:p})}}const l=n.edges??[];for(const d of s){const f=l.find(p=>p.likec4_id===d.id);if(!f){Ct.warn(`View ${a.id} edge ${d.id} not found in graphviz output, skipping`);continue}c.edges.push(B9(f,d,a.id))}return c}const yp=t=>String(t+1).padStart(2,"0");function z9(t){const e=JSON.parse(t),n=gp(e.bb),r={nodes:[],edges:[],bounds:n},i=new Map,s=e.objects??[];for(const o of s){if(!o.likec4_type)continue;const a=yp(o._gvid),c=o.likec4_path??"",u=i.get(o._gvid),{x:l,y:d,width:f,height:p}="bb"in o?gp(o.bb):yk(o),m={x:l,y:d};if(o.likec4_type==="view")$e(o.likec4_id,`View ${o} has no likec4_id`),r.nodes.push({id:a,type:"view",parentId:u?.id??null,height:p,width:f,position:m,label:o.label??"",viewId:o.likec4_id});else{const w={id:a,type:o.likec4_type,parentId:u?.id??null,height:p,width:f,position:m,path:c,label:o.label??""},E=[..."subgraphs"in o?o.subgraphs:[],..."nodes"in o?o.nodes:[]];for(const y of E)i.set(y,w);r.nodes.push(w)}}for(const o of e.edges??[])try{const a=yp(o.tail),c=yp(o.head);r.edges.push({id:`link${yp(o._gvid)}`,source:a,target:c,points:wk(o)})}catch(a){Ct.warn(a)}return r}const Dk=Ir.font,vp="/";class Db{static toDot(e){return new Db(e).print()}subgraphs=new Map;graphvizModel;constructor(e){const n=this.graphvizModel=GW.graph({[x.layout]:"osage",[x.pack]:Nn(100),[x.packmode]:"array_ltc",[x.pad]:at(15),[x.fontname]:Dk,[x.splines]:"polyline",[x.esep]:"+20"});n.attributes.graph.apply({[x.fontsize]:Nn(20),[x.labeljust]:"l",[x.labelloc]:"t"}),n.attributes.node.apply({[x.fontname]:Dk,[x.shape]:"rect",[x.width]:at(400),[x.height]:at(300),[x.fixedsize]:!0,[x.fontsize]:10}),n.attributes.edge.apply({[x.penwidth]:Nn(2)});const r=new Set(e.map(c=>c.relativePath??""));let i=0,s=[...e];const o=r.size>1;o&&s.sort((c,u)=>{const l=c.relativePath?.split(vp)??[""],d=u.relativePath?.split(vp)??[""];l.push(c.title??"Untitled"),d.push(u.title??"Untitled");const f=l.length,p=d.length;switch(i=Math.max(i,f,p),!0){case f>p:return-1;case f<p:return 1;default:{for(let m=0;m<f;m++){const w=l[m].localeCompare(d[m]);if(w!==0)return w}return 0}}});const a=new Map;s.forEach((c,u)=>{this.addView(o?c:{...c,relativePath:""},u+i);const l=c.nodes.reduce((d,f)=>(f.navigateTo&&d.add(f.navigateTo),d),new Set);l.size>0&&a.set(c.id,l)});for(const[c,u]of a)for(const l of u)n.edge([c,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(vp)?e.slice(0,e.lastIndexOf(vp)):"";r=this.getParentForPath(s).subgraph("cluster"+String(this.subgraphs.size+1),{[x.likec4_type]:i?"file":"folder",[x.likec4_path]:e,[x.sortv]:this.subgraphs.size,[x.label]:ae(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,{[x.likec4_type]:"view",[x.likec4_id]:e.id,[x.sortv]:n,[x.label]:e.title||"Untitled"})}print(){return QC(this.graphvizModel,{print:{indentStyle:"space",indentSize:2}})}}const Ek=t=>{switch(!0){case Qo.isDynamic(t):return new bb(t);case Qo.isDeployment(t):return new F9(t);case Qo.isElement(t):return new L9(t);default:Ie(t)}};class Rk{constructor(e){this.graphviz=e}get port(){return this.graphviz}changePort(e){this.graphviz=e}async layout(e){try{let n=await this.dot(e);const r=await this.graphviz.layoutJson(n);let i=bk(r,e);if(e.manualLayout){const s=_9(i,e.manualLayout);if(s.diagram)i=s.diagram;else{if(s.relayout.nodes.length>0){const o=Ek(e);if(o.hasEdgesWithCompounds)Ct.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.graphviz.layoutJson(o.print());i=bk(a,e)}}i.hasLayoutDrift=!0}}return n=n.split(`
|
|
217
|
+
`).filter(s=>!(s.includes("margin")&&s.includes("50.1"))).join(`
|
|
218
|
+
`),{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(`
|
|
219
|
+
`).filter(r=>!(r.includes("margin")&&r.includes("50.1"))).join(`
|
|
220
|
+
`),{svg:await this.graphviz.svg(n),dot:n}}async dot(e){let n=Ek(e).print();if(!Qo.isElement(e))return n;try{return await this.graphviz.unflatten(n)}catch(r){return Ct.warn(`Error during unflatten: ${e.id}`,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=Db.toDot(e),r=await this.graphviz.layoutJson(n);return z9(r)}}const q9=tv(1);let Tk=class Zh{static _graphviz=null;graphviz(){return Promise.resolve().then(()=>Zh._graphviz??=om.load())}async attempt(e,n){return await q9(async()=>{const r=Ct.withTag("graphviz-wasm");try{return await n()}catch(i){r.error(`FAILED GraphvizWasmAdapter: ${e}`,i),om.unload(),Zh._graphviz=null}r.warn("Retrying..."),await HI(50,300);try{return await n()}finally{om.unload(),Zh._graphviz=null}})}async unflatten(e){return await this.attempt(`unflatten
|
|
221
|
+
${e}`,async()=>(await this.graphviz()).unflatten(e,1,!1,3).replaceAll(/\t\[/g," [").replaceAll(/\t/g," "))}async acyclic(e){return await this.attempt(`acyclic
|
|
222
|
+
${e}`,async()=>{const n=(await this.graphviz()).acyclic(e,!0);return n.acyclic&&n.outFile||e})}async layoutJson(e){return await this.attempt(`dot
|
|
223
|
+
${e}`,async()=>(await this.graphviz()).layout(e,"json",void 0,{yInvert:!0}))}async svg(e){return await this.attempt(`svg
|
|
224
|
+
${e}`,async()=>(await this.graphviz()).layout(e,"svg"))}};const av="DeploymentElement";function $k(t){return H.isInstance(t,av)}const cv="DeploymentNodeOrElementKind",wp="DeploymentViewRule";function j9(t){return H.isInstance(t,wp)}const yu="DynamicViewRule";function uv(t){return H.isInstance(t,yu)}const vu="ElementExpression";function lv(t){return H.isInstance(t,vu)}const bp="ElementPredicate";function U9(t){return H.isInstance(t,bp)}const Dp="ElementPredicateOrWhere";function G9(t){return H.isInstance(t,Dp)}const _s="ElementProperty";function W9(t){return H.isInstance(t,_s)}const dv="ExpressionV2";function H9(t){return H.isInstance(t,dv)}const wu="FqnExpr";function V9(t){return H.isInstance(t,wu)}const fv="FqnReferenceable",Ps="LikeC4View";function pv(t){return H.isInstance(t,Ps)}const Ep="MetadataProperty";function To(t){return H.isInstance(t,Ep)}const hv="Predicate";function K9(t){return H.isInstance(t,hv)}const bu="Referenceable",Rp="RelationExpr";function Sk(t){return H.isInstance(t,Rp)}const Tp="RelationExpression";function mv(t){return H.isInstance(t,Tp)}const $p="RelationPredicate";function Y9(t){return H.isInstance(t,$p)}const Sp="RelationPredicateOrWhere";function X9(t){return H.isInstance(t,Sp)}const gv="RelationPredicateOrWhereV2",Du="RelationProperty",Cp="RelationshipStyleProperty";function Ck(t){return H.isInstance(t,Cp)}const $o="StringProperty";function kk(t){return H.isInstance(t,$o)}const Eu="StyleProperty";function yv(t){return H.isInstance(t,Eu)}const kp="ViewProperty";function J9(t){return H.isInstance(t,kp)}const Ru="ViewRule";function Q9(t){return H.isInstance(t,Ru)}const Ap="ViewRulePredicate";function _p(t){return H.isInstance(t,Ap)}const Pp="ViewRuleStyleOrGlobalRef";function vv(t){return H.isInstance(t,Pp)}const Tu="WhereElement";function Ak(t){return H.isInstance(t,Tu)}const $u="WhereElementExpression";function Z9(t){return H.isInstance(t,$u)}const _k="WhereExpression",Ip="WhereKindEqual";function eH(t){return H.isInstance(t,Ip)}const Su="WhereRelation";function Pk(t){return H.isInstance(t,Su)}const Cu="WhereRelationExpression";function tH(t){return H.isInstance(t,Cu)}const xp="WhereTagEqual";function nH(t){return H.isInstance(t,xp)}const ku="ArrowProperty";function Au(t){return H.isInstance(t,ku)}const _u="BorderProperty";function Op(t){return H.isInstance(t,_u)}const Pu="ColorProperty";function Is(t){return H.isInstance(t,Pu)}const xs="CustomColor",Np="CustomElementProperties";function rH(t){return H.isInstance(t,Np)}const Fp="CustomRelationProperties";function iH(t){return H.isInstance(t,Fp)}const _i="DeployedInstance";function Rr(t){return H.isInstance(t,_i)}const wv="DeployedInstanceBody",Pi="DeploymentNode";function $n(t){return H.isInstance(t,Pi)}const bv="DeploymentNodeBody",Os="DeploymentNodeKind",Lp="DeploymentRelation";function Ns(t){return H.isInstance(t,Lp)}const Dv="DeploymentRelationBody",Iu="DeploymentView";function Ik(t){return H.isInstance(t,Iu)}const Ev="DeploymentViewBody",xu="DeploymentViewRulePredicate";function Rv(t){return H.isInstance(t,xu)}const Tv="DeploymentViewRulePredicateExpression",Ou="DeploymentViewRuleStyle";function sH(t){return H.isInstance(t,Ou)}const Nu="DirectedRelationExpr";function xk(t){return H.isInstance(t,Nu)}const Fu="DirectedRelationExpression";function $v(t){return H.isInstance(t,Fu)}const So="DynamicView";function Ok(t){return H.isInstance(t,So)}const Mp="DynamicViewBody";function oH(t){return H.isInstance(t,Mp)}const Lu="DynamicViewGlobalPredicateRef";function aH(t){return H.isInstance(t,Lu)}const Mu="DynamicViewIncludePredicate";function cH(t){return H.isInstance(t,Mu)}const Bp="DynamicViewParallelSteps";function Sv(t){return H.isInstance(t,Bp)}const zp="DynamicViewPredicateIterator";function Nk(t){return H.isInstance(t,zp)}const Cv="DynamicViewRef",qp="DynamicViewStep";function kv(t){return H.isInstance(t,qp)}const Hn="Element";function Fn(t){return H.isInstance(t,Hn)}const jp="ElementBody";function Bu(t){return H.isInstance(t,jp)}const zu="ElementDescedantsExpression";function Av(t){return H.isInstance(t,zu)}const Up="ElementExpressionsIterator";function uH(t){return H.isInstance(t,Up)}const si="ElementKind";function lH(t){return H.isInstance(t,si)}const qu="ElementKindExpression";function Gp(t){return H.isInstance(t,qu)}const ju="ElementPredicateWhere";function _v(t){return H.isInstance(t,ju)}const Uu="ElementPredicateWith";function Wp(t){return H.isInstance(t,Uu)}const Gu="ElementRef";function Wu(t){return H.isInstance(t,Gu)}const Hu="ElementStringProperty";function Vu(t){return H.isInstance(t,Hu)}const Ku="ElementStyleProperty";function Ii(t){return H.isInstance(t,Ku)}const Yu="ElementTagExpression";function Hp(t){return H.isInstance(t,Yu)}const Co="ElementView";function Vp(t){return H.isInstance(t,Co)}const Kp="ElementViewBody";function Fk(t){return H.isInstance(t,Kp)}const Pv="ElementViewRef",Xu="ExcludePredicate";function Yp(t){return H.isInstance(t,Xu)}const Ju="ExpandElementExpression";function Lk(t){return H.isInstance(t,Ju)}const Fs="ExtendElement";function ko(t){return H.isInstance(t,Fs)}const Xp="ExtendElementBody";function Mk(t){return H.isInstance(t,Xp)}const Jp="FqnElementRef";function Bk(t){return H.isInstance(t,Jp)}const Iv="FqnExpressions",Qp="FqnRef";function zk(t){return H.isInstance(t,Qp)}const Qu="FqnRefExpr";function xv(t){return H.isInstance(t,Qu)}const Ao="GlobalDynamicPredicateGroup";function qk(t){return H.isInstance(t,Ao)}const _o="GlobalPredicateGroup";function jk(t){return H.isInstance(t,_o)}const Po="Globals";function Ov(t){return H.isInstance(t,Po)}const Zp="GlobalStyle";function Zu(t){return H.isInstance(t,Zp)}const eh="GlobalStyleGroup";function el(t){return H.isInstance(t,eh)}const tl="GlobalStyleId",nl="IconProperty";function Tr(t){return H.isInstance(t,nl)}const rl="IncludePredicate";function Nv(t){return H.isInstance(t,rl)}const il="IncomingRelationExpr";function Uk(t){return H.isInstance(t,il)}const sl="IncomingRelationExpression";function Gk(t){return H.isInstance(t,sl)}const ol="InOutRelationExpr";function dH(t){return H.isInstance(t,ol)}const al="InOutRelationExpression";function Fv(t){return H.isInstance(t,al)}const Ls="LibIcon";function fH(t){return H.isInstance(t,Ls)}const th="LikeC4Grammar";function pH(t){return H.isInstance(t,th)}const nh="LikeC4Lib";function Wk(t){return H.isInstance(t,nh)}const cl="LineProperty";function ul(t){return H.isInstance(t,cl)}const ll="LinkProperty";function rh(t){return H.isInstance(t,ll)}const dl="MetadataAttribute";function hH(t){return H.isInstance(t,dl)}const fl="MetadataBody";function mH(t){return H.isInstance(t,fl)}const Io="Model";function Hk(t){return H.isInstance(t,Io)}const pl="ModelDeployments",xo="ModelViews";function hl(t){return H.isInstance(t,xo)}const ih="NavigateToProperty";function sh(t){return H.isInstance(t,ih)}const ml="NotationProperty";function Oo(t){return H.isInstance(t,ml)}const gl="NotesProperty";function Vk(t){return H.isInstance(t,gl)}const yl="OpacityProperty";function oh(t){return H.isInstance(t,yl)}const vl="OutgoingRelationExpr";function Kk(t){return H.isInstance(t,vl)}const wl="OutgoingRelationExpression";function Lv(t){return H.isInstance(t,wl)}const ah="Predicates";function Yk(t){return H.isInstance(t,ah)}const ch="Relation";function $r(t){return H.isInstance(t,ch)}const uh="RelationBody";function gH(t){return H.isInstance(t,uh)}const bl="RelationNavigateToProperty";function Dl(t){return H.isInstance(t,bl)}const El="RelationPredicateWhere";function Mv(t){return H.isInstance(t,El)}const Rl="RelationPredicateWhereV2";function yH(t){return H.isInstance(t,Rl)}const Tl="RelationPredicateWith";function Bv(t){return H.isInstance(t,Tl)}const xi="RelationshipKind";function vH(t){return H.isInstance(t,xi)}const $l="RelationStringProperty";function Sl(t){return H.isInstance(t,$l)}const Cl="RelationStyleProperty";function lh(t){return H.isInstance(t,Cl)}const kl="ShapeProperty";function dh(t){return H.isInstance(t,kl)}const fh="SpecificationColor";function ph(t){return H.isInstance(t,fh)}const No="SpecificationDeploymentNodeKind";function hh(t){return H.isInstance(t,No)}const Fo="SpecificationElementKind";function Lo(t){return H.isInstance(t,Fo)}const Al="SpecificationElementStringProperty";function zv(t){return H.isInstance(t,Al)}const Mo="SpecificationRelationshipKind";function Bo(t){return H.isInstance(t,Mo)}const _l="SpecificationRelationshipStringProperty";function Xk(t){return H.isInstance(t,_l)}const zo="SpecificationRule";function qv(t){return H.isInstance(t,zo)}const qo="SpecificationTag";function mh(t){return H.isInstance(t,qo)}const Oi="Tag";function Jk(t){return H.isInstance(t,Oi)}const gh="Tags";function jv(t){return H.isInstance(t,gh)}const Uv="ViewRef",Pl="ViewRuleAutoLayout";function Il(t){return H.isInstance(t,Pl)}const xl="ViewRuleGlobalPredicateRef";function wH(t){return H.isInstance(t,xl)}const Ol="ViewRuleGlobalStyle";function Qk(t){return H.isInstance(t,Ol)}const Nl="ViewRuleGroup";function yh(t){return H.isInstance(t,Nl)}const Fl="ViewRuleStyle";function Ll(t){return H.isInstance(t,Fl)}const Ml="ViewStringProperty";function bH(t){return H.isInstance(t,Ml)}const Bl="WhereBinaryExpression";function DH(t){return H.isInstance(t,Bl)}const zl="WhereElementKind";function EH(t){return H.isInstance(t,zl)}const ql="WhereElementNegation";function Zk(t){return H.isInstance(t,ql)}const jl="WhereElementTag";function RH(t){return H.isInstance(t,jl)}const Ul="WhereRelationKind";function eA(t){return H.isInstance(t,Ul)}const Gl="WhereRelationNegation";function tA(t){return H.isInstance(t,Gl)}const Wl="WhereRelationParticipantKind";function nA(t){return H.isInstance(t,Wl)}const Hl="WhereRelationParticipantTag";function rA(t){return H.isInstance(t,Hl)}const Vl="WhereRelationTag";function TH(t){return H.isInstance(t,Vl)}const Kl="WildcardExpression";function Ms(t){return H.isInstance(t,Kl)}class iA extends Hb{getAllTypes(){return[ku,_u,Pu,xs,Np,Fp,_i,wv,av,Pi,bv,Os,cv,Lp,Dv,Iu,Ev,wp,xu,Tv,Ou,Nu,Fu,So,Mp,Lu,Mu,Bp,zp,Cv,yu,qp,Hn,jp,zu,vu,Up,si,qu,bp,Dp,ju,Uu,_s,Gu,Hu,Ku,Yu,Co,Kp,Pv,Xu,Ju,dv,Fs,Xp,Jp,wu,Iv,Qp,Qu,fv,Ao,_o,Zp,eh,tl,Po,nl,ol,al,rl,il,sl,Ls,th,nh,Ps,cl,ll,dl,fl,Ep,Io,pl,xo,ih,ml,gl,yl,vl,wl,hv,ah,bu,ch,uh,Rp,Tp,bl,$p,Sp,gv,El,Rl,Tl,Du,$l,Cl,xi,Cp,kl,fh,No,Fo,Al,Mo,_l,zo,qo,$o,Eu,Oi,gh,kp,Uv,Ru,Pl,xl,Ol,Nl,Ap,Fl,Pp,Ml,Bl,Tu,$u,zl,ql,jl,_k,Ip,Su,Cu,Ul,Gl,Wl,Hl,Vl,xp,Kl]}computeIsSubtype(e,n){switch(e){case ku:case cl:return this.isSubtype(Cp,n);case _u:case yl:case kl:return this.isSubtype(Eu,n);case Pu:return this.isSubtype(Cp,n)||this.isSubtype(Eu,n);case _i:case Pi:return this.isSubtype(av,n)||this.isSubtype(bu,n);case Os:case si:return this.isSubtype(cv,n);case Iu:case So:case Co:return this.isSubtype(Ps,n);case xu:case Ou:return this.isSubtype(wp,n);case Nu:case il:case ol:case vl:return this.isSubtype(Rp,n);case Fu:case sl:case al:case wl:return this.isSubtype(Tp,n);case Lu:case Mu:return this.isSubtype(yu,n);case Hn:return this.isSubtype(fv,n)||this.isSubtype(bu,n);case zu:case qu:case Gu:case Yu:case Ju:return this.isSubtype(vu,n);case vu:case ju:return this.isSubtype(Dp,n);case bp:case $p:return this.isSubtype(hv,n);case Dp:case Uu:return this.isSubtype(bp,n);case Hu:return this.isSubtype(_s,n)||this.isSubtype($o,n);case Ku:return this.isSubtype(_s,n);case Xu:case rl:return this.isSubtype(Ap,n);case Fs:case bu:return this.isSubtype(fv,n);case wu:case gv:return this.isSubtype(dv,n);case Qu:return this.isSubtype(wu,n);case nl:return this.isSubtype(_s,n)||this.isSubtype(Eu,n);case ll:return this.isSubtype(_s,n)||this.isSubtype(Du,n)||this.isSubtype(kp,n);case dl:case ml:case gl:case Al:case _l:return this.isSubtype($o,n);case fl:return this.isSubtype(Ep,n);case Ep:return this.isSubtype(_s,n)||this.isSubtype(Du,n);case Rp:case Rl:return this.isSubtype(gv,n);case Tp:case El:return this.isSubtype(Sp,n);case bl:case Cl:return this.isSubtype(Du,n);case Sp:case Tl:return this.isSubtype($p,n);case $l:return this.isSubtype(Du,n)||this.isSubtype($o,n);case Pl:return this.isSubtype(wp,n)||this.isSubtype(yu,n)||this.isSubtype(Ru,n);case xl:case Nl:case Ap:return this.isSubtype(Ru,n);case Ol:case Fl:return this.isSubtype(Pp,n);case Pp:return this.isSubtype(yu,n)||this.isSubtype(Ru,n);case Ml:return this.isSubtype($o,n)||this.isSubtype(kp,n);case Bl:return this.isSubtype($u,n)||this.isSubtype(Cu,n);case Tu:case ql:return this.isSubtype($u,n);case $u:case Cu:return this.isSubtype(_k,n);case zl:return this.isSubtype(Tu,n)||this.isSubtype(Ip,n);case jl:return this.isSubtype(Tu,n)||this.isSubtype(xp,n);case Su:case Gl:return this.isSubtype(Cu,n);case Ul:case Wl:return this.isSubtype(Ip,n)||this.isSubtype(Su,n);case Hl:case Vl:return this.isSubtype(Su,n)||this.isSubtype(xp,n);case Kl:return this.isSubtype(vu,n)||this.isSubtype(wu,n);default:return!1}}getReferenceType(e){const n=`${e.container.$type}:${e.property}`;switch(n){case"ColorProperty:customColor":return xs;case"DeploymentNode:kind":return Os;case"DeploymentRelation:kind":case"DynamicViewStep:kind":case"OutgoingRelationExpr:kind":case"OutgoingRelationExpression:kind":case"Relation:kind":case"WhereRelationKind:value":return xi;case"DynamicViewGlobalPredicateRef:predicate":return Ao;case"DynamicViewRef:view":return So;case"Element:kind":case"ElementKindExpression:kind":case"WhereElementKind:value":return si;case"ElementRef:el":case"FqnElementRef:el":return Hn;case"ElementTagExpression:tag":case"Tags:values":case"WhereElementTag:value":case"WhereRelationParticipantTag:value":case"WhereRelationTag:value":return Oi;case"ElementViewRef:view":return Co;case"FqnRef:value":return bu;case"IconProperty:libicon":return Ls;case"ViewRef:view":return Ps;case"ViewRuleGlobalPredicateRef:predicate":return _o;case"ViewRuleGlobalStyle:style":return tl;case"WhereRelationParticipantKind:value":return cv;default:throw new Error(`${n} is not a valid reference id.`)}}getTypeMetaData(e){switch(e){case ku:return{name:ku,properties:[{name:"key"},{name:"value"}]};case _u:return{name:_u,properties:[{name:"key"},{name:"value"}]};case Pu:return{name:Pu,properties:[{name:"customColor"},{name:"key"},{name:"themeColor"}]};case xs:return{name:xs,properties:[{name:"name"}]};case Np:return{name:Np,properties:[{name:"props",defaultValue:[]}]};case Fp:return{name:Fp,properties:[{name:"props",defaultValue:[]}]};case _i:return{name:_i,properties:[{name:"body"},{name:"element"},{name:"name"},{name:"title"}]};case wv:return{name:wv,properties:[{name:"props",defaultValue:[]},{name:"tags"}]};case Pi:return{name:Pi,properties:[{name:"body"},{name:"kind"},{name:"name"},{name:"title"}]};case bv:return{name:bv,properties:[{name:"elements",defaultValue:[]},{name:"props",defaultValue:[]},{name:"tags"}]};case Os:return{name:Os,properties:[{name:"name"}]};case Lp:return{name:Lp,properties:[{name:"body"},{name:"kind"},{name:"source"},{name:"tags"},{name:"target"},{name:"technology"},{name:"title"}]};case Dv:return{name:Dv,properties:[{name:"props",defaultValue:[]},{name:"tags"}]};case Iu:return{name:Iu,properties:[{name:"body"},{name:"name"}]};case Ev:return{name:Ev,properties:[{name:"props",defaultValue:[]},{name:"rules",defaultValue:[]},{name:"tags"}]};case xu:return{name:xu,properties:[{name:"expr"},{name:"isInclude",defaultValue:!1}]};case Tv:return{name:Tv,properties:[{name:"prev"},{name:"value"}]};case Ou:return{name:Ou,properties:[{name:"props",defaultValue:[]},{name:"targets"}]};case Nu:return{name:Nu,properties:[{name:"source"},{name:"target"}]};case Fu:return{name:Fu,properties:[{name:"source"},{name:"target"}]};case So:return{name:So,properties:[{name:"body"},{name:"name"}]};case Mp:return{name:Mp,properties:[{name:"props",defaultValue:[]},{name:"rules",defaultValue:[]},{name:"steps",defaultValue:[]},{name:"tags"}]};case Lu:return{name:Lu,properties:[{name:"predicate"}]};case Mu:return{name:Mu,properties:[{name:"predicates"}]};case Bp:return{name:Bp,properties:[{name:"steps",defaultValue:[]}]};case zp:return{name:zp,properties:[{name:"prev"},{name:"value"}]};case Cv:return{name:Cv,properties:[{name:"view"}]};case qp:return{name:qp,properties:[{name:"custom"},{name:"isBackward",defaultValue:!1},{name:"kind"},{name:"source"},{name:"target"},{name:"title"}]};case Hn:return{name:Hn,properties:[{name:"body"},{name:"kind"},{name:"name"},{name:"props",defaultValue:[]}]};case jp:return{name:jp,properties:[{name:"elements",defaultValue:[]},{name:"props",defaultValue:[]},{name:"tags"}]};case zu:return{name:zu,properties:[{name:"parent"},{name:"suffix"}]};case Up:return{name:Up,properties:[{name:"prev"},{name:"value"}]};case si:return{name:si,properties:[{name:"name"}]};case qu:return{name:qu,properties:[{name:"isEqual",defaultValue:!1},{name:"kind"}]};case ju:return{name:ju,properties:[{name:"subject"},{name:"where"}]};case Uu:return{name:Uu,properties:[{name:"custom"},{name:"subject"}]};case Gu:return{name:Gu,properties:[{name:"el"},{name:"parent"}]};case Hu:return{name:Hu,properties:[{name:"key"},{name:"value"}]};case Ku:return{name:Ku,properties:[{name:"key"},{name:"props",defaultValue:[]}]};case Yu:return{name:Yu,properties:[{name:"isEqual",defaultValue:!1},{name:"tag"}]};case Co:return{name:Co,properties:[{name:"body"},{name:"extends"},{name:"name"},{name:"viewOf"}]};case Kp:return{name:Kp,properties:[{name:"props",defaultValue:[]},{name:"rules",defaultValue:[]},{name:"tags"}]};case Pv:return{name:Pv,properties:[{name:"view"}]};case Xu:return{name:Xu,properties:[{name:"predicates"}]};case Ju:return{name:Ju,properties:[{name:"expand"}]};case Fs:return{name:Fs,properties:[{name:"body"},{name:"element"}]};case Xp:return{name:Xp,properties:[{name:"elements",defaultValue:[]}]};case Jp:return{name:Jp,properties:[{name:"el"},{name:"parent"}]};case Iv:return{name:Iv,properties:[{name:"prev"},{name:"value"}]};case Qp:return{name:Qp,properties:[{name:"parent"},{name:"value"}]};case Qu:return{name:Qu,properties:[{name:"ref"},{name:"selector"}]};case Ao:return{name:Ao,properties:[{name:"name"},{name:"predicates",defaultValue:[]}]};case _o:return{name:_o,properties:[{name:"name"},{name:"predicates",defaultValue:[]}]};case Po:return{name:Po,properties:[{name:"name"},{name:"predicates",defaultValue:[]},{name:"styles",defaultValue:[]}]};case Zp:return{name:Zp,properties:[{name:"id"},{name:"props",defaultValue:[]},{name:"target"}]};case eh:return{name:eh,properties:[{name:"id"},{name:"styles",defaultValue:[]}]};case tl:return{name:tl,properties:[{name:"name"}]};case nl:return{name:nl,properties:[{name:"key"},{name:"libicon"},{name:"value"}]};case rl:return{name:rl,properties:[{name:"predicates"}]};case il:return{name:il,properties:[{name:"to"}]};case sl:return{name:sl,properties:[{name:"to"}]};case ol:return{name:ol,properties:[{name:"inout"}]};case al:return{name:al,properties:[{name:"inout"}]};case Ls:return{name:Ls,properties:[{name:"name"}]};case th:return{name:th,properties:[{name:"deployments",defaultValue:[]},{name:"globals",defaultValue:[]},{name:"likec4lib",defaultValue:[]},{name:"models",defaultValue:[]},{name:"specifications",defaultValue:[]},{name:"views",defaultValue:[]}]};case nh:return{name:nh,properties:[{name:"icons",defaultValue:[]}]};case cl:return{name:cl,properties:[{name:"key"},{name:"value"}]};case ll:return{name:ll,properties:[{name:"key"},{name:"title"},{name:"value"}]};case dl:return{name:dl,properties:[{name:"key"},{name:"value"}]};case fl:return{name:fl,properties:[{name:"props",defaultValue:[]}]};case Io:return{name:Io,properties:[{name:"elements",defaultValue:[]},{name:"name"}]};case pl:return{name:pl,properties:[{name:"elements",defaultValue:[]},{name:"name"}]};case xo:return{name:xo,properties:[{name:"name"},{name:"styles",defaultValue:[]},{name:"views",defaultValue:[]}]};case ih:return{name:ih,properties:[{name:"key"},{name:"value"}]};case ml:return{name:ml,properties:[{name:"key"},{name:"value"}]};case gl:return{name:gl,properties:[{name:"key"},{name:"value"}]};case yl:return{name:yl,properties:[{name:"key"},{name:"value"}]};case vl:return{name:vl,properties:[{name:"from"},{name:"isBidirectional",defaultValue:!1},{name:"kind"}]};case wl:return{name:wl,properties:[{name:"from"},{name:"isBidirectional",defaultValue:!1},{name:"kind"}]};case ah:return{name:ah,properties:[{name:"prev"},{name:"value"}]};case ch:return{name:ch,properties:[{name:"body"},{name:"kind"},{name:"source"},{name:"tags"},{name:"target"},{name:"technology"},{name:"title"}]};case uh:return{name:uh,properties:[{name:"props",defaultValue:[]},{name:"tags"}]};case bl:return{name:bl,properties:[{name:"key"},{name:"value"}]};case El:return{name:El,properties:[{name:"subject"},{name:"where"}]};case Rl:return{name:Rl,properties:[{name:"subject"},{name:"where"}]};case Tl:return{name:Tl,properties:[{name:"custom"},{name:"subject"}]};case xi:return{name:xi,properties:[{name:"name"}]};case $l:return{name:$l,properties:[{name:"key"},{name:"value"}]};case Cl:return{name:Cl,properties:[{name:"key"},{name:"props",defaultValue:[]}]};case kl:return{name:kl,properties:[{name:"key"},{name:"value"}]};case fh:return{name:fh,properties:[{name:"color"},{name:"name"}]};case No:return{name:No,properties:[{name:"kind"},{name:"props",defaultValue:[]}]};case Fo:return{name:Fo,properties:[{name:"kind"},{name:"props",defaultValue:[]}]};case Al:return{name:Al,properties:[{name:"key"},{name:"value"}]};case Mo:return{name:Mo,properties:[{name:"kind"},{name:"props",defaultValue:[]}]};case _l:return{name:_l,properties:[{name:"key"},{name:"value"}]};case zo:return{name:zo,properties:[{name:"colors",defaultValue:[]},{name:"deploymentNodes",defaultValue:[]},{name:"elements",defaultValue:[]},{name:"name"},{name:"relationships",defaultValue:[]},{name:"tags",defaultValue:[]}]};case qo:return{name:qo,properties:[{name:"tag"}]};case Oi:return{name:Oi,properties:[{name:"name"}]};case gh:return{name:gh,properties:[{name:"prev"},{name:"values",defaultValue:[]}]};case Uv:return{name:Uv,properties:[{name:"view"}]};case Pl:return{name:Pl,properties:[{name:"direction"},{name:"nodeSep"},{name:"rankSep"}]};case xl:return{name:xl,properties:[{name:"predicate"}]};case Ol:return{name:Ol,properties:[{name:"style"}]};case Nl:return{name:Nl,properties:[{name:"groupRules",defaultValue:[]},{name:"props",defaultValue:[]},{name:"title"}]};case Fl:return{name:Fl,properties:[{name:"props",defaultValue:[]},{name:"target"}]};case Ml:return{name:Ml,properties:[{name:"key"},{name:"value"}]};case Bl:return{name:Bl,properties:[{name:"left"},{name:"operator"},{name:"right"}]};case zl:return{name:zl,properties:[{name:"not",defaultValue:!1},{name:"operator"},{name:"value"}]};case ql:return{name:ql,properties:[{name:"value"}]};case jl:return{name:jl,properties:[{name:"not",defaultValue:!1},{name:"operator"},{name:"value"}]};case Ul:return{name:Ul,properties:[{name:"not",defaultValue:!1},{name:"operator"},{name:"value"}]};case Gl:return{name:Gl,properties:[{name:"value"}]};case Wl:return{name:Wl,properties:[{name:"not",defaultValue:!1},{name:"operator"},{name:"participant"},{name:"value"}]};case Hl:return{name:Hl,properties:[{name:"not",defaultValue:!1},{name:"operator"},{name:"participant"},{name:"value"}]};case Vl:return{name:Vl,properties:[{name:"not",defaultValue:!1},{name:"operator"},{name:"value"}]};case Kl:return{name:Kl,properties:[{name:"isWildcard",defaultValue:!1}]};default:return{name:e,properties:[]}}}}const H=new iA;let sA;const $H=()=>sA??(sA=X3(`{"$type":"Grammar","isDeclared":true,"name":"LikeC4","rules":[{"$type":"ParserRule","name":"LikeC4Grammar","entry":true,"definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"specifications","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}},{"$type":"Assignment","feature":"models","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Assignment","feature":"views","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@34"},"arguments":[]}},{"$type":"Assignment","feature":"globals","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@119"},"arguments":[]}},{"$type":"Assignment","feature":"deployments","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@95"},"arguments":[]}},{"$type":"Assignment","feature":"likec4lib","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}}],"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":"+"},{"$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@143"},"arguments":[]}},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ElementKind","definition":{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@148"},"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@148"},"arguments":[]}},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"RelationshipKind","definition":{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@148"},"arguments":[]}},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"CustomColor","definition":{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@147"},"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@148"},"arguments":[]}},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"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"},"arguments":[]}},{"$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":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":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@133"},"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":"=","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@166"},"arguments":[]}},{"$type":"Keyword","value":";","cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"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":"RuleCall","rule":{"$ref":"#/rules@133"},"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":[]}}]},"definesHiddenTokens":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@142"},"arguments":[]}}]},"definesHiddenTokens":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":"+=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@136"},"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","feature":"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@166"},"arguments":[]}},{"$type":"Keyword","value":";","cardinality":"?"}]},"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@21"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@26"},"arguments":[{"$type":"NamedArgument","value":{"$type":"BooleanLiteral","true":true},"calledByName":false}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"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","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@148"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@148"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@164"},"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@166"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@166"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@166"},"arguments":[]}},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@166"},"arguments":[]},"cardinality":"?"}],"cardinality":"?"}],"cardinality":"?"}],"cardinality":"?"},{"$type":"Assignment","feature":"body","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"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@25"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},"cardinality":"*"},{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@26"},"arguments":[{"$type":"NamedArgument","value":{"$type":"BooleanLiteral","true":false},"calledByName":false}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ElementProperty","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@133"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@125"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@128"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@31"},"arguments":[]}]},"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","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@166"},"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":"#/rules@23"},"arguments":[]}},{"$type":"Assignment","feature":"body","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"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":"elements","operator":"+=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@26"},"arguments":[{"$type":"NamedArgument","value":{"$type":"BooleanLiteral","true":true},"calledByName":false}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"FqnElementRef","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"el","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@17"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@148"},"arguments":[]},"deprecatedSyntax":false}},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"FqnElementRef"},"feature":"parent","operator":"="},{"$type":"RuleCall","rule":{"$ref":"#/rules@161"},"arguments":[]},{"$type":"Assignment","feature":"el","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@17"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@148"},"arguments":[]},"deprecatedSyntax":false}}],"cardinality":"*"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ElementRef","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"el","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@17"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@148"},"arguments":[]},"deprecatedSyntax":false}},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"ElementRef"},"feature":"parent","operator":"="},{"$type":"RuleCall","rule":{"$ref":"#/rules@161"},"arguments":[]},{"$type":"Assignment","feature":"el","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@17"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@148"},"arguments":[]},"deprecatedSyntax":false}}],"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@145"},"arguments":[]},"deprecatedSyntax":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@145"},"arguments":[]},"deprecatedSyntax":false},"cardinality":"*"}],"cardinality":"*"},{"$type":"Keyword","value":";","cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Relation","parameters":[{"$type":"Parameter","name":"isExplicit"}],"definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Group","guardCondition":{"$type":"ParameterReference","parameter":{"$ref":"#/rules@26/parameters@0"}},"elements":[{"$type":"Assignment","feature":"source","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]}}]},{"$type":"Group","guardCondition":{"$type":"Negation","value":{"$type":"ParameterReference","parameter":{"$ref":"#/rules@26/parameters@0"}}},"elements":[{"$type":"Assignment","feature":"source","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},"cardinality":"?"}]}]},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"kind","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@5"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@146"},"arguments":[]},"deprecatedSyntax":false}},{"$type":"Group","elements":[{"$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@24"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@166"},"arguments":[]}},{"$type":"Assignment","feature":"technology","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@166"},"arguments":[]},"cardinality":"?"}],"cardinality":"?"},{"$type":"Assignment","feature":"tags","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@25"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"body","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@27"},"arguments":[]},"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@25"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@28"},"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@29"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@94"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@30"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@125"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@31"},"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":"Keyword","value":"description"}]}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@166"},"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","feature":"key","operator":"=","terminal":{"$type":"Keyword","value":"style"}},{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@136"},"arguments":[]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"MetadataProperty","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"metadata"},{"$type":"RuleCall","rule":{"$ref":"#/rules@32"},"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@33"},"arguments":[]},"cardinality":"*"},{"$type":"Keyword","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@167"},"arguments":[]}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@166"},"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","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@35"},"arguments":[]}},{"$type":"Assignment","feature":"styles","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@87"},"arguments":[]}}],"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"LikeC4ViewRule","returnType":{"$ref":"#/types@0"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@36"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@37"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@103"},"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":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@148"},"arguments":[]},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"extends"},{"$type":"Assignment","feature":"extends","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"of"},{"$type":"Assignment","feature":"viewOf","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]}}]}],"cardinality":"?"},{"$type":"Assignment","feature":"body","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"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":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@148"},"arguments":[]}},{"$type":"Assignment","feature":"body","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@42"},"arguments":[]},"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ViewRef","definition":{"$type":"Assignment","feature":"view","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/types@0"},"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@36"},"deprecatedSyntax":false}},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DynamicViewRef","definition":{"$type":"Assignment","feature":"view","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@37"},"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":"RuleCall","rule":{"$ref":"#/rules@25"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@43"},"arguments":[]},"cardinality":"*"},{"$type":"Assignment","feature":"rules","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@46"},"arguments":[]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DynamicViewBody","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"tags","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@25"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@43"},"arguments":[]},"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"steps","operator":"+=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@49"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]}]}},{"$type":"Assignment","feature":"rules","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}}],"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ViewProperty","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@44"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@125"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ViewStringProperty","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"key","operator":"=","terminal":{"$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@166"},"arguments":[]}},{"$type":"Keyword","value":";","cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ViewLayoutDirection","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@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@54"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@47"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@87"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@88"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ViewRuleGroup","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"group"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@166"},"arguments":[]},"cardinality":"?"},{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@126"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@131"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@127"},"arguments":[]}]},"cardinality":"*"},{"$type":"Assignment","feature":"groupRules","operator":"+=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@47"},"arguments":[]}]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DynamicViewRule","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@82"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@83"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@87"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@88"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DynamicViewParallelSteps","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"parallel"},{"$type":"Keyword","value":"par"}]},{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"steps","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DynamicViewStep","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"source","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"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@5"},"deprecatedSyntax":false}},{"$type":"Keyword","value":"]->"}]},{"$type":"Assignment","feature":"kind","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@5"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@146"},"arguments":[]},"deprecatedSyntax":false}}]},{"$type":"Assignment","feature":"target","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@166"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"custom","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@92"},"arguments":[]},"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ViewRulePredicate","definition":{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"IncludePredicate"}},{"$type":"Keyword","value":"include"},{"$type":"Assignment","feature":"predicates","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@52"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"ExcludePredicate"}},{"$type":"Keyword","value":"exclude"},{"$type":"Assignment","feature":"predicates","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@52"},"arguments":[]}}]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Predicates","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@53"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"Predicates"},"feature":"prev","operator":"="},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@53"},"arguments":[]},"cardinality":"?"}],"cardinality":"*"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Predicate","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@67"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ViewRuleGlobalPredicateRef","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"global"},{"$type":"Keyword","value":"predicate"},{"$type":"Assignment","feature":"predicate","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@120"},"deprecatedSyntax":false}}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ElementPredicate","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@56"},"arguments":[]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ElementPredicates","inferredType":{"$type":"InferredType","name":"ElementPredicate"},"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@57"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"ElementPredicateWith"},"feature":"subject","operator":"="},{"$type":"Keyword","value":"with"},{"$type":"Assignment","feature":"custom","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@91"},"arguments":[]},"cardinality":"?"}],"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ElementPredicateOrWhere","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@64"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"ElementPredicateWhere"},"feature":"subject","operator":"="},{"$type":"Keyword","value":"where"},{"$type":"Assignment","feature":"where","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@58"},"arguments":[]},"cardinality":"?"}],"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"WhereElementExpression","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@59"},"arguments":[]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"WhereElementOr","inferredType":{"$type":"InferredType","name":"WhereElementExpression"},"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@60"},"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":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@60"},"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@61"},"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":"RuleCall","rule":{"$ref":"#/rules@61"},"arguments":[]}}],"cardinality":"*"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"WhereElementPrimary","inferredType":{"$type":"InferredType","name":"WhereElementExpression"},"definition":{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"RuleCall","rule":{"$ref":"#/rules@58"},"arguments":[]},{"$type":"Keyword","value":")"}]},{"$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":"WhereElementNegation","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"not"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@58"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"WhereElement","definition":{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"WhereElementTag"}},{"$type":"Keyword","value":"tag"},{"$type":"RuleCall","rule":{"$ref":"#/rules@149"},"arguments":[]},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@4"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@145"},"arguments":[]},"deprecatedSyntax":false},"cardinality":"?"}]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"WhereElementKind"}},{"$type":"Keyword","value":"kind"},{"$type":"RuleCall","rule":{"$ref":"#/rules@149"},"arguments":[]},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@3"},"deprecatedSyntax":false},"cardinality":"?"}]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ElementExpression","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@65"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@66"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ElementSelectorExpression","inferredType":{"$type":"InferredType","name":"ElementExpression"},"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","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"ElementTagExpression"}},{"$type":"Keyword","value":"element.tag"},{"$type":"RuleCall","rule":{"$ref":"#/rules@150"},"arguments":[]},{"$type":"Assignment","feature":"tag","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@4"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@145"},"arguments":[]},"deprecatedSyntax":false},"cardinality":"?"}]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"ElementKindExpression"}},{"$type":"Keyword","value":"element.kind"},{"$type":"RuleCall","rule":{"$ref":"#/rules@150"},"arguments":[]},{"$type":"Assignment","feature":"kind","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@3"},"deprecatedSyntax":false},"cardinality":"?"}]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ElementDescedantsExpression","inferredType":{"$type":"InferredType","name":"ElementExpression"},"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"ExpandElementExpression"},"feature":"expand","operator":"="},{"$type":"RuleCall","rule":{"$ref":"#/rules@158"},"arguments":[]}]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"ElementDescedantsExpression"},"feature":"parent","operator":"="},{"$type":"Assignment","feature":"suffix","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@159"},"arguments":[]}}]}],"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"RelationPredicate","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@68"},"arguments":[]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"RelationPredicates","inferredType":{"$type":"InferredType","name":"RelationPredicate"},"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@69"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"RelationPredicateWith"},"feature":"subject","operator":"="},{"$type":"Keyword","value":"with"},{"$type":"Assignment","feature":"custom","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@92"},"arguments":[]},"cardinality":"?"}],"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"RelationPredicateOrWhere","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@76"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"RelationPredicateWhere"},"feature":"subject","operator":"="},{"$type":"Keyword","value":"where"},{"$type":"Assignment","feature":"where","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@70"},"arguments":[]},"cardinality":"?"}],"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"WhereRelationExpression","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@71"},"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@72"},"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":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@72"},"arguments":[]}}],"cardinality":"*"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"WhereRelationAnd","inferredType":{"$type":"InferredType","name":"WhereRelationExpression"},"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@73"},"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":"RuleCall","rule":{"$ref":"#/rules@73"},"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@70"},"arguments":[]},{"$type":"Keyword","value":")"}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@74"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@75"},"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@70"},"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@149"},"arguments":[]},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@4"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@145"},"arguments":[]},"deprecatedSyntax":false},"cardinality":"?"}]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"WhereRelationKind"}},{"$type":"Keyword","value":"kind"},{"$type":"RuleCall","rule":{"$ref":"#/rules@149"},"arguments":[]},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@5"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@148"},"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@141"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@161"},"arguments":[]},{"$type":"Keyword","value":"tag"},{"$type":"RuleCall","rule":{"$ref":"#/rules@149"},"arguments":[]},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@4"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@145"},"arguments":[]},"deprecatedSyntax":false},"cardinality":"?"}]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"WhereRelationParticipantKind"}},{"$type":"Assignment","feature":"participant","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@141"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@161"},"arguments":[]},{"$type":"Keyword","value":"kind"},{"$type":"RuleCall","rule":{"$ref":"#/rules@149"},"arguments":[]},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/types@2"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@148"},"arguments":[]},"deprecatedSyntax":false},"cardinality":"?"}]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"RelationExpression","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@77"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@79"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"InOutRelationExpressions","inferredType":{"$type":"InferredType","name":"RelationExpression"},"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@78"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"InOutRelationExpression"},"feature":"inout","operator":"="},{"$type":"Keyword","value":"->"}],"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"IncomingRelationExpression","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"->"},{"$type":"Assignment","feature":"to","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@64"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DirectedRelationExpressions","inferredType":{"$type":"InferredType","name":"RelationExpression"},"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@80"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"DirectedRelationExpression"},"feature":"source","operator":"="},{"$type":"Assignment","feature":"target","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@64"},"arguments":[]}}],"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"OutgoingRelationExpression","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"from","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@64"},"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":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@5"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@148"},"arguments":[]},"deprecatedSyntax":false}},{"$type":"Keyword","value":"]->"}]},{"$type":"Assignment","feature":"kind","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@5"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@146"},"arguments":[]},"deprecatedSyntax":false}}]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ElementExpressionsIterator","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@64"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"ElementExpressionsIterator"},"feature":"prev","operator":"="},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@64"},"arguments":[]},"cardinality":"?"}],"cardinality":"*"}]},"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":"predicates","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@84"},"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@121"},"deprecatedSyntax":false}}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DynamicViewPredicateIterator","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"DynamicViewPredicateIterator"},"feature":"prev","operator":"="},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[]},"cardinality":"?"}],"cardinality":"*"}]},"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@81"},"arguments":[]}},{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@132"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@89"},"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":"Assignment","feature":"style","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@122"},"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@85"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@86"},"arguments":[]}]},"definesHiddenTokens":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@45"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Assignment","feature":"rankSep","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@168"},"arguments":[]}},{"$type":"Assignment","feature":"nodeSep","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@168"},"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":"notation"}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@166"},"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":"=","terminal":{"$type":"Keyword","value":"notes"}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@166"},"arguments":[]}},{"$type":"Keyword","value":";","cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"CustomElementProperties","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@93"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@89"},"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":"CustomRelationProperties","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@94"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@89"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@90"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@136"},"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","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@38"},"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":"RuleCall","rule":{"$ref":"#/rules@40"},"arguments":[]}}]},"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@96"},"arguments":[]},{"$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":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Assignment","feature":"kind","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@7"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@148"},"arguments":[]},"deprecatedSyntax":false}},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@148"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@148"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@164"},"arguments":[]},{"$type":"Assignment","feature":"kind","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@7"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@148"},"arguments":[]},"deprecatedSyntax":false}}]}]},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@166"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"body","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@97"},"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":"#/rules@25"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},"cardinality":"*"},{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@98"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@101"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@96"},"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@148"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@164"},"arguments":[]}],"cardinality":"?"},{"$type":"Keyword","value":"instanceOf"},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@166"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"body","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@99"},"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@25"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"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@7"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@148"},"arguments":[]},"deprecatedSyntax":false}},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"FqnRef"},"feature":"parent","operator":"="},{"$type":"RuleCall","rule":{"$ref":"#/rules@161"},"arguments":[]},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/types@7"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@148"},"arguments":[]},"deprecatedSyntax":false}}],"cardinality":"*"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DeploymentRelation","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"source","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@100"},"arguments":[]}},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"->"},{"$type":"Group","elements":[{"$type":"Keyword","value":"-["},{"$type":"Assignment","feature":"kind","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@5"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@148"},"arguments":[]},"deprecatedSyntax":false}},{"$type":"Keyword","value":"]->"}]},{"$type":"Assignment","feature":"kind","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@5"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@146"},"arguments":[]},"deprecatedSyntax":false}}]},{"$type":"Assignment","feature":"target","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@100"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@166"},"arguments":[]}},{"$type":"Assignment","feature":"technology","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@166"},"arguments":[]},"cardinality":"?"}],"cardinality":"?"},{"$type":"Assignment","feature":"tags","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@25"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"body","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@102"},"arguments":[]},"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DeploymentRelationBody","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"tags","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@25"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@28"},"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"},{"$type":"Keyword","value":"view"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@148"},"arguments":[]}},{"$type":"Assignment","feature":"body","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@104"},"arguments":[]},"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DeploymentViewBody","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"tags","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@25"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@43"},"arguments":[]},"cardinality":"*"},{"$type":"Assignment","feature":"rules","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@105"},"arguments":[]},"cardinality":"*"},{"$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@107"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@106"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@88"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"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@118"},"arguments":[]}},{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@132"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@89"},"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"}},{"$type":"Keyword","value":"exclude"}]},{"$type":"Assignment","feature":"expr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@108"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DeploymentViewRulePredicateExpression","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@109"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"DeploymentViewRulePredicateExpression"},"feature":"prev","operator":"="},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@109"},"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@110"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@111"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"RelationPredicateOrWhereV2","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@113"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"RelationPredicateWhereV2"},"feature":"subject","operator":"="},{"$type":"Keyword","value":"where"},{"$type":"Assignment","feature":"where","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@70"},"arguments":[]},"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":"RuleCall","rule":{"$ref":"#/rules@112"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"FqnRefExpr","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"ref","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@100"},"arguments":[]}},{"$type":"Assignment","feature":"selector","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@158"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@159"},"arguments":[]}]},"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"RelationExpr","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@114"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@116"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"InOutRelationExpr","inferredType":{"$type":"InferredType","name":"RelationExpr"},"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@115"},"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":"IncomingRelationExpr","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"->"},{"$type":"Assignment","feature":"to","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@111"},"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":"RuleCall","rule":{"$ref":"#/rules@117"},"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@111"},"arguments":[]}}],"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"OutgoingRelationExpr","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"from","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@111"},"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":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@5"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@148"},"arguments":[]},"deprecatedSyntax":false}},{"$type":"Keyword","value":"]->"}]},{"$type":"Assignment","feature":"kind","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@5"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@146"},"arguments":[]},"deprecatedSyntax":false}}]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"FqnExpressions","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@111"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"FqnExpressions"},"feature":"prev","operator":"="},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@111"},"arguments":[]},"cardinality":"?"}],"cardinality":"*"}]},"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":"{"},{"$type":"Group","elements":[{"$type":"Assignment","feature":"predicates","operator":"+=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@120"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@121"},"arguments":[]}]},"cardinality":"*"},{"$type":"Assignment","feature":"styles","operator":"+=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@123"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@124"},"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@167"},"arguments":[]}},{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"predicates","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"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","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@167"},"arguments":[]}},{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"predicates","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@82"},"arguments":[]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"GlobalStyleId","definition":{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@167"},"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@122"},"arguments":[]}},{"$type":"Assignment","feature":"target","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@81"},"arguments":[]}},{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@132"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@89"},"arguments":[]}]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"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@122"},"arguments":[]}},{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"styles","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@85"},"arguments":[]},"cardinality":"*"},{"$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@144"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@166"},"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","value":"color"}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"themeColor","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@139"},"arguments":[]}},{"$type":"Assignment","feature":"customColor","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@6"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@147"},"arguments":[]},"deprecatedSyntax":false}}]},{"$type":"Keyword","value":";","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@165"},"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":"Assignment","feature":"libicon","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@2"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@143"},"arguments":[]},"deprecatedSyntax":false}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"none"},{"$type":"RuleCall","rule":{"$ref":"#/rules@144"},"arguments":[]}]}}]},{"$type":"Keyword","value":";","cardinality":"?"}]},"definesHiddenTokens":false,"entry":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@140"},"arguments":[]}},{"$type":"Keyword","value":";","cardinality":"?"}]},"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@137"},"arguments":[]},{"$type":"Keyword","value":"none"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"BorderProperty","definition":{"$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@130"},"arguments":[]}},{"$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@126"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@129"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@131"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@127"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@128"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"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@132"},"arguments":[]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$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@137"},"arguments":[]}},{"$type":"Keyword","value":";","cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"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@138"},"arguments":[]}},{"$type":"Keyword","value":";","cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"RelationshipStyleProperty","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@126"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@134"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@135"},"arguments":[]}]},"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":"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":"diamond"},{"$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":"Keyword","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":[{"$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":"Keyword","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@160"},"arguments":[]},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@148"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@169"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@168"},"arguments":[]}]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"IconId","dataType":"string","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@155"},"arguments":[]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Uri","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@156"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@157"},"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@160"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@148"},"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@162"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@148"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"CustomColorId","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@167"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@140"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@138"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@137"},"arguments":[]},{"$type":"Keyword","value":"element"},{"$type":"Keyword","value":"model"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Id","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@167"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@140"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@139"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@138"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@137"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@141"},"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","name":"EqOperator","fragment":true,"definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@164"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@163"},"arguments":[]}]}},{"$type":"Group","elements":[{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"is"}},{"$type":"Assignment","feature":"not","operator":"?=","terminal":{"$type":"Keyword","value":"not"},"cardinality":"?"}]}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"IsEqual","fragment":true,"definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"isEqual","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@164"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@163"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"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":true,"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+:\\\\/\\\\/\\\\S+/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"URI_RELATIVE","definition":{"$type":"RegexToken","regex":"/\\\\.{0,2}\\\\/[^\\\\/]\\\\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":"TerminalRule","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":false,"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":"ReturnType","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":"LikeC4View","type":{"$type":"UnionType","types":[{"$type":"SimpleType","typeRef":{"$ref":"#/rules@36"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@37"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@103"}}]}},{"$type":"Type","name":"StringProperty","type":{"$type":"UnionType","types":[{"$type":"SimpleType","typeRef":{"$ref":"#/rules@20"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@44"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@29"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@33"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@10"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@15"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@89"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@90"}}]}},{"$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@63/definition/elements@0/elements@0/inferredType"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@75/definition/elements@0/elements@0/inferredType"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@75/definition/elements@2/elements@0/inferredType"}}]}},{"$type":"Type","name":"WhereKindEqual","type":{"$type":"UnionType","types":[{"$type":"SimpleType","typeRef":{"$ref":"#/rules@63/definition/elements@1/elements@0/inferredType"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@75/definition/elements@1/elements@0/inferredType"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@75/definition/elements@3/elements@0/inferredType"}}]}},{"$type":"Type","name":"WhereExpression","type":{"$type":"UnionType","types":[{"$type":"SimpleType","typeRef":{"$ref":"#/rules@58"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@70"}}]}},{"$type":"Type","name":"DeploymentElement","type":{"$type":"UnionType","types":[{"$type":"SimpleType","typeRef":{"$ref":"#/rules@96"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@98"}}]}},{"$type":"Type","name":"Referenceable","type":{"$type":"UnionType","types":[{"$type":"SimpleType","typeRef":{"$ref":"#/rules@96"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@98"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@17"}}]}},{"$type":"Type","name":"FqnReferenceable","type":{"$type":"UnionType","types":[{"$type":"SimpleType","typeRef":{"$ref":"#/types@7"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@17"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@21"}}]}}],"definesHiddenTokens":false,"hiddenTokens":[],"imports":[],"interfaces":[],"usedGrammars":[]}`)),oA={languageId:"likec4",fileExtensions:[".c4",".likec4",".like-c4"],caseInsensitive:!1,mode:"production"},SH={skipValidations:!0,recoveryEnabled:!0,nodeLocationTracking:"full"},CH={AstReflection:()=>new iA},kH={Grammar:()=>$H(),LanguageMetaData:()=>oA,parser:{ParserConfig:()=>SH}};function mn(t){return t.el.ref}function vh(t){const e=[t.el.$refText];let n=t.parent;for(;n;)e.push(n.el.$refText),n=n.parent;return e.length===1?e[0]:e.reverse().join(".")}const Yl=Symbol.for("idattr"),wh={writeId(t,e){return t[Yl]=e,t},readId(t){return t[Yl]}},Xl={writeId(t,e){return yt(e)?t[Yl]=void 0:t[Yl]=e,t},readId(t){return t[Yl]}};function Jl(t){return t.textDocument.languageId===oA.languageId}function Gv(t){return Jl(t)&&t.state>=qe.IndexedContent&&!!t.c4fqnIndex}function jo(t){return Jl(t)&&t.state==qe.Validated&&!!t.c4Specification&&!!t.c4Elements&&!!t.c4Relations&&!!t.c4Views&&!!t.c4fqnIndex&&!!t.c4Deployments&&!!t.c4DeploymentRelations}function*AH(t){const e=rm.from(t.parseResult.value.models.flatMap(i=>i.elements)),n=[];let r;for(;r=e.shift();){if($r(r)){n.push(r);continue}if(ko(r)){if(r.body&&r.body.elements.length>0)for(const i of r.body.elements)e.push(i);continue}if(r.body&&r.body.elements.length>0)for(const i of r.body.elements)e.push(i);yield r}yield*n}function*_H(t){const e=rm.from(t.parseResult.value.deployments.flatMap(i=>i.elements)),n=[];let r;for(;r=e.shift();){if(Ns(r)){n.push(r);continue}if($n(r)&&r.body&&r.body.elements.length>0)for(const i of r.body.elements)e.push(i);yield r}yield*n}function PH(t){const e=mn(t.target);if(!e)throw new Error("RelationRefError: Invalid reference to target");if(Ht(t.source)){const n=mn(t.source);if(!n)throw new Error("RelationRefError: Invalid reference to source");return{source:n,target:e}}if(!Bu(t.$container))throw new Error("RelationRefError: Invalid container for sourceless relation");return{source:t.$container.$container,target:e}}function aA({value:t}){const e=parseFloat(t);return isNaN(e)?100:WT(e,{min:0,max:100})}function Ni(t,e){const n={};if(!t||t.length===0)return n;for(const r of t)if(e(r))switch(!0){case Op(r):{ae(r.value)&&(n.border=r.value);break}case Is(r):{const i=Ql(r);ae(i)&&(n.color=i);break}case dh(r):{ae(r.value)&&(n.shape=r.value);break}case Tr(r):{const i=r.libicon?.ref?.name??r.value;ae(i)&&(n.icon=i);break}case oh(r):{n.opacity=aA(r);break}default:Ie(r)}return n}function IH(t,e){const n={};if(!t||t.length===0)return n;for(const r of t)if(e(r))switch(!0){case Is(r):{const i=Ql(r);ae(i)&&(n.color=i);break}case ul(r):{n.line=r.value;break}case Au(r):{switch(r.key){case"head":{n.head=r.value;break}case"tail":{n.tail=r.value;break}default:Ie(r)}break}default:Ie(r)}return n}function Wv(t,e){const{color:n,line:r,head:i,tail:s}=IH(t?.filter(Ck),e);return{...n&&n!==Jo?{color:n}:{},...r&&r!==XI?{line:r}:{},...i&&i!==Yi?{head:i}:{},...s?{tail:s}:{}}}function Ql(t){return t?.themeColor??t?.customColor?.$refText}function Hv(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:Ie(t.direction)}return{direction:r,...n&&{nodeSep:n},...e&&{rankSep:e}}}function xH(t){switch(t){case"TB":return"TopBottom";case"BT":return"BottomTop";case"LR":return"LeftRight";case"RL":return"RightLeft";default:Ie(t)}}function cA(t){if(lv(t))return t;if(_v(t))return t.subject;if(Wp(t))return cA(t.subject);Ie(t)}class OH{parser;locator;constructor(e){this.parser=e.likec4.ModelParser,this.locator=e.likec4.ModelLocator}getDocumentation(e){try{if($n(e)){const n=mt(e),r=this.parser.forDocument(n).parseDeploymentNode(e),i=[r.id];return r.title!==e.name&&i.push(" ",`**${r.title}**`),i.join(`
|
|
225
|
+
`)}if(Rr(e)){const n=mt(e),r=this.parser.forDocument(n).parseDeployedInstance(e),i=this.locator.getParsedElement(r.element),s=[r.id,`_instance of_ ${r.element}`];return i&&s.push(" ",`**${i.title}**`),s.join(`
|
|
226
|
+
`)}if(Fn(e)){const n=mt(e),r=this.parser.forDocument(n).parseElement(e);return r?[r.id," ",`**${r.title}**`].join(`
|
|
227
|
+
`):void 0}}catch(n){ye(n)}}}function NH(t,e){return[t,e]=uA(t,e)>0?[e,t]:[t,e],FH(t.range,e.range.start)}function uA(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 FH(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 lA(t){return t.range.start.line!=t.range.end.line}const ce={newLine:Ei.newLine({allowMore:!0}),oneSpace:Ei.oneSpace(),noSpace:Ei.noSpace(),indent:Ei.indent({allowMore:!0}),noIndent:Ei.noIndent()};class LH extends D4{format(e){this.removeIndentFromTopLevelStatements(e),this.indentContentInBraces(e),this.formatSpecificationRule(e),this.formatGlobals(e),this.formatElementDeclaration(e),this.formatRelation(e),this.formatMetadataProperty(e),this.formatView(e),this.formatViewRuleGroup(e),this.formatViewRuleGlobalStyle(e),this.formatIncludeExcludeExpressions(e),this.formatWhereExpression(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,jv,(n,r)=>{r.cst(to(n.$cstNode,"values").slice(1)).prepend(ce.oneSpace),r.keywords(",").prepend(ce.noSpace).append(ce.oneSpace)})}formatRelation(e){this.on(e,$r,(n,r)=>{const i=n?.source?.$cstNode?[n?.source?.$cstNode]:[];r.cst(i).append(ce.oneSpace),r.keywords("]->").prepend(ce.noSpace),r.keywords("-[").append(ce.noSpace),r.nodes(...je([n.target,n.tags],ae)).prepend(ce.oneSpace),r.properties("title","technology").prepend(ce.oneSpace)}),this.on(e,kv,(n,r)=>{r.keywords("->","<-").surround(ce.oneSpace);const i=r.property("kind");i.nodes[0]?.text.startsWith(".")&&i.surround(ce.oneSpace),r.keywords("]->").prepend(ce.noSpace).append(ce.oneSpace),r.keywords("-[").prepend(ce.oneSpace).append(ce.noSpace),r.properties("title").prepend(ce.oneSpace)}),this.on(e,$v)?.property("target").prepend(ce.oneSpace),this.on(e,Lv,(n,r)=>{r.property("from").append(ce.oneSpace),r.keywords("]->").prepend(ce.noSpace),r.keywords("-[").append(ce.noSpace)}),this.on(e,Gk)?.keywords("->").append(ce.oneSpace),this.on(e,Fv)?.keyword("->").prepend(ce.oneSpace)}removeIndentFromTopLevelStatements(e){(Hk(e)||qv(e)||hl(e)||Wk(e)||Ov(e))&&this.getNodeFormatter(e).keywords("specification","model","views","likec4lib","global").prepend(ce.noIndent)}indentContentInBraces(e){if(Wk(e)||qv(e)||Lo(e)||Bo(e)||Ov(e)||Zu(e)||el(e)||Hk(e)||Bu(e)||Mk(e)||gH(e)||lh(e)||mH(e)||hl(e)||Fk(e)||oH(e)||Ll(e)||yh(e)||rH(e)||iH(e)||Ii(e)||Sv(e)){const n=this.getNodeFormatter(e),r=n.keywords("{"),i=n.keywords("}"),s=n.interior(r,i);let o=null;for(const a of s.nodes)(!o||!NH(o,a))&&n.cst([a]).prepend(ce.indent),o=a;r.prepend(ce.noIndent).prepend(ce.oneSpace),i.prepend(ce.noIndent).prepend(Ei.newLine({allowMore:!0}))}}appendKeywordsWithSpace(e){this.on(e,lH)?.keywords("element").append(ce.oneSpace)}formatView(e){this.on(e,Vp,(n,r)=>{(n.extends||n.viewOf||n.name)&&r.keywords("view").append(ce.oneSpace),r.keywords("of","extends").surround(ce.oneSpace)}),this.on(e,Ok)?.keywords("dynamic","view").append(ce.oneSpace)}formatLeafProperty(e){if(Vu(e)||Sl(e)||bH(e)||Oo(e)||zv(e)||Xk(e)||Is(e)||ul(e)||Au(e)||Tr(e)||dh(e)||Op(e)||oh(e)){const n=this.getNodeFormatter(e),r=n.keyword(":"),i=n.keywords("title","description","technology","notation","color","line","head","tail","icon","shape","border","opacity");r.nodes.length===0?i.append(ce.oneSpace):r.prepend(ce.noSpace).append(ce.oneSpace),n.keyword(";").prepend(ce.noSpace).append(ce.newLine)}}formatLinkProperty(e){this.on(e,rh,(n,r)=>{r.keyword("link").append(ce.oneSpace),r.property("value").append(ce.oneSpace),r.keyword(":").prepend(ce.noSpace).append(ce.oneSpace),r.keyword(";").prepend(ce.noSpace).append(ce.newLine)})}formatNavigateToProperty(e){this.on(e,sh)?.property("key").append(ce.oneSpace)}formatAutolayoutProperty(e){this.on(e,Il,(n,r)=>{r.keyword("autoLayout").append(ce.oneSpace),r.property("rankSep").prepend(ce.oneSpace),r.property("nodeSep").prepend(ce.oneSpace)})}formatMetadataProperty(e){this.on(e,hH,(n,r)=>{r.property("key").append(ce.oneSpace),r.keyword(":").prepend(ce.noSpace).append(ce.oneSpace),r.keyword(";").prepend(ce.noSpace).append(ce.newLine)})}formatElementDeclaration(e){this.on(e,Fn,(n,r)=>{const i=vn(n.$cstNode,"kind"),s=vn(n.$cstNode,"name");s&&i&&(uA(s,i)>0?r.cst([i]).append(ce.oneSpace):(r.cst([s]).append(ce.oneSpace),r.cst([i]).prepend(ce.oneSpace))),r.properties("props").prepend(ce.oneSpace)})}formatGlobals(e){this.on(e,Zu,(n,r)=>{r.keyword("style").append(ce.oneSpace),r.property("id").append(ce.oneSpace)}),this.on(e,el,(n,r)=>{r.keyword("styleGroup").append(ce.oneSpace)})}formatSpecificationRule(e){if((Lo(e)||Bo(e)||mh(e))&&this.getNodeFormatter(e).keywords("element","relationship","tag").append(ce.oneSpace),ph(e)){const n=this.getNodeFormatter(e);n.keyword("color").append(ce.oneSpace),n.property("name").append(ce.oneSpace)}}formatWithPredicate(e){const n=this.getNodeFormatter(e);(Wp(e)||Bv(e))&&n.keyword("with").prepend(ce.oneSpace)}formatViewRuleGlobalStyle(e){this.on(e,Qk,(n,r)=>{r.keywords("global","style").append(ce.oneSpace)})}formatViewRuleGroup(e){this.on(e,yh,(n,r)=>{r.keyword("group").append(ce.oneSpace)})}formatViewRuleStyle(e){this.on(e,Ll)?.keyword("style").append(ce.oneSpace),this.on(e,uH)?.keyword(",").prepend(ce.noSpace).append(ce.oneSpace)}formatWhereExpression(e){if((X9(e)||G9(e))&&this.getNodeFormatter(e).keyword("where").append(ce.oneSpace),(tH(e)||Z9(e))&&this.getNodeFormatter(e).property("operator").surround(ce.oneSpace),(Zk(e)||tA(e))&&this.getNodeFormatter(e).keyword("not").append(ce.oneSpace),Ak(e)||RH(e)||EH(e)||Pk(e)||TH(e)||eA(e)){const n=this.getNodeFormatter(e);n.property("operator").surround(ce.oneSpace),n.property("not").surround(ce.oneSpace)}}formatIncludeExcludeExpressions(e){if(uv(e)||Nv(e)||Yp(e)){const n=this.getNodeFormatter(e);(!e.$cstNode||!lA(e.$cstNode))&&n.keywords("include","exclude").append(ce.oneSpace)}if(Nk(e)||Yk(e)||Yk(e)){const n=this.getNodeFormatter(e),r=this.findPredicateExpressionRoot(e),i=r?.$cstNode&&lA(r?.$cstNode);i&&n.property("value").prepend(ce.indent),n.keyword(",").prepend(ce.noSpace).append(i?ce.newLine:ce.oneSpace)}}findPredicateExpressionRoot(e){let n=e.$container;for(;;){if(!n||uv(n)||Nv(n)||Yp(n))return n;n=n.$container}}on(e,n,r){const i=n(e)?this.getNodeFormatter(e):void 0;return r&&i&&r(e,i),i}}class MH{constructor(e){this.services=e}async provideCodeLens(e,n,r){return e.state!==qe.Validated&&(xe.debug(`Waiting for document ${e.uri.path} to be validated`),await this.services.shared.workspace.DocumentBuilder.waitUntil(qe.Validated,e.uri,r),xe.debug(`Document ${e.uri.path} is validated`)),jo(e)?e.parseResult.value.views.flatMap(i=>i.views).flatMap(i=>{const s=wh.readId(i),o=i.$cstNode?.range;return!o||!s?[]:{range:{start:o.start,end:{line:o.start.line,character:o.start.character+4}},command:{command:"likec4.open-preview",arguments:[s],title:"open preview"}}}):void 0}}class BH extends yS{completionOptions={triggerCharacters:["."]};completionForKeyword(e,n,r){if(this.filterKeyword(e,n)){if(n.value==="deployment"&&pi(e.node,hl))return r(e,{label:n.value,detail:"Insert deployment view",kind:At.Class,insertTextFormat:Gn.Snippet,insertText:["deployment view ${1:view_${TM_FILENAME_BASE}_${CURRENT_SECOND}} {"," title '${2:Untitled}'"," "," include $0","}"].join(`
|
|
228
|
+
`)});if(["title","description","technology"].includes(n.value))return r(e,{label:n.value,kind:At.Property,insertTextFormat:Gn.Snippet,insertText:`${n.value} '\${0}'`});if(["views","specification","model","deployment","with"].includes(n.value))return r(e,{label:n.value,detail:`Insert ${n.value} block`,kind:At.Module,insertTextFormat:Gn.Snippet,insertText:`${n.value} {
|
|
229
|
+
$0
|
|
230
|
+
}`});if(n.value==="group")return r(e,{label:n.value,detail:"Insert group block",kind:At.Class,insertTextFormat:Gn.Snippet,insertText:["group '${1:Title}' {"," $0","}"].join(`
|
|
231
|
+
`)});if(n.value==="dynamic"&&pi(e.node,hl))return r(e,{label:n.value,detail:"Insert dynamic view",kind:At.Class,insertTextFormat:Gn.Snippet,insertText:["dynamic view ${1:view_${TM_FILENAME_BASE}_${CURRENT_SECOND}} {"," title '${2:Untitled}'"," "," $0","}"].join(`
|
|
232
|
+
`)});if(n.value==="style"&&e.node)return pi(e.node,Zu)?r(e,{label:n.value,detail:`Insert ${n.value} block`,kind:At.Module,insertTextFormat:Gn.Snippet,insertText:`${n.value} \${1:name} \${2:*} {
|
|
233
|
+
\${3|color,shape,border,opacity,icon|} $0
|
|
234
|
+
}`}):pi(e.node,G8([hl,el]))?r(e,{label:n.value,detail:`Insert ${n.value} block`,kind:At.Module,insertTextFormat:Gn.Snippet,insertText:`${n.value} \${1:*} {
|
|
235
|
+
\${2|color,shape,border,opacity,icon|} $0
|
|
236
|
+
}`}):r(e,{label:n.value,detail:`Insert ${n.value} block`,kind:At.Module,insertTextFormat:Gn.Snippet,insertText:`${n.value} {
|
|
237
|
+
\${1|color,shape,border,opacity,icon|} $0
|
|
238
|
+
}`});if(n.value==="extend")return r(e,{label:n.value,detail:"Extend another view",kind:At.Class,insertTextFormat:Gn.Snippet,insertText:`extend \${1:element} {
|
|
239
|
+
$0
|
|
240
|
+
}`});if(n.value==="autoLayout")return r(e,{label:n.value,kind:At.Class,insertTextFormat:Gn.Snippet,insertText:"autoLayout ${1|TopBottom,BottomTop,LeftRight,RightLeft|}$0"});r(e,{label:n.value,kind:this.getKeywordCompletionItemKind(n),detail:"Keyword",sortText:"1"})}}}class zH extends vS{createDocumentHighlight(e){return ge.DocumentHighlight.create(e.segment.range,ge.DocumentHighlightKind.Read)}}const qH=/^[\s\w\0+.-]{2,}:([/\\]{1,2})/,jH=/^[\s\w\0+.-]{2,}:([/\\]{2})?/,UH=/^([/\\]\s*){2,}[^/\\]/;function dA(t){return["./","../"].some(e=>t.startsWith(e))}function Vv(t,e={}){return typeof e=="boolean"&&(e={acceptRelative:e}),e.strict?qH.test(t):jH.test(t)||(e.acceptRelative?UH.test(t):!1)}function GH(t="",e){return t.endsWith("/")}function WH(t="",e){return(GH(t)?t.slice(0,-1):t)||"/"}function HH(t="",e){return t.endsWith("/")?t:t+"/"}function bh(t=""){return t.startsWith("/")}function fA(t=""){return(bh(t)?t.slice(1):t)||"/"}function VH(t=""){return bh(t)?t:"/"+t}function KH(t,e){if(YH(e))return t;const n=WH(e);if(!t.startsWith(n))return t;const r=t.slice(n.length);return r[0]==="/"?r:"/"+r}function YH(t){return!t||t==="/"}function Dh(t=""){const[e="",n="",r=""]=(t.match(/([^#?]*)(\?[^#]*)?(#.*)?/)||[]).splice(1);return{pathname:e,search:n,hash:r}}class XH{constructor(e){this.services=e}getDocumentLinks(e,n){return jo(e)?mr(e.parseResult.value).filter(rh).map(r=>{try{const i=vn(r.$cstNode,"value")?.range,s=this.resolveLink(e,r.value);if(i&&Vv(s))return{range:i,target:s}}catch(i){ye(i)}return null}).nonNullable().toArray():[]}resolveLink(e,n){if(Vv(n)||bh(n))return n;const r=dA(n)?new URL(e.uri.toString(!0)):this.services.shared.workspace.WorkspaceManager.workspaceURL;return new URL(n,r).toString()}relativeLink(e,n){if(bh(n))return fA(n);if(dA(n)){const r=new URL(e.uri.toString(!0)),i=new URL(n,r).toString();return fA(KH(i,this.services.shared.workspace.WorkspaceManager.workspaceURL.toString()))}return null}}class JH{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;getSymbols({parseResult:{value:{specifications:e,models:n,deployments:r,views:i,likec4lib:s}}}){return[...s.map(o=>()=>this.getLikec4LibSymbol(o)),...e.map(o=>()=>this.getSpecSymbol(o)),...n.map(o=>()=>this.getModelSymbol(o)),...r.map(o=>()=>this.getDeploymentModelSymbol(o)),...i.map(o=>()=>this.getModelViewsSymbol(o))].flatMap(o=>{try{return o()??[]}catch(a){return ye(a),[]}})}getLikec4LibSymbol(e){const n=e?.$cstNode;if(!n)return[];const r=e.icons.map(i=>this.getLibIconSymbol(i)).filter(ae);return r.length===0?[]:[{kind:er.Namespace,name:"icons",range:n.range,selectionRange:qa(n,"icons")?.range??n.range,children:r}]}getSpecSymbol(e){const n=e?.$cstNode;if(!n)return[];const r=vn(n,"name");if(!r)return[];const i=Ye([...e.elements,...e.tags,...e.relationships],un(s=>{try{if(Lo(s)||Bo(s)||hh(s))return this.getKindSymbol(s);if(mh(s))return this.getTagSymbol(s)}catch(o){return ye(o),null}Ie(s)}),je(ae));return i.length===0?[]:[{kind:er.Namespace,name:e.name,range:n.range,selectionRange:r.range,children:i}]}getModelSymbol(e){const n=e.$cstNode;if(!n)return[];const r=vn(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=vn(n,"name");return r?[{kind:this.symbolKind(e),name:e.name,range:n.range,selectionRange:r.range,children:e.elements.flatMap(i=>this.getDeploymentElementSymbol(i))}]:[]}getElementsSymbol(e){try{if(ko(e))return this.getExtendElementSymbol(e);if(Fn(e))return this.getElementSymbol(e)}catch(n){ye(n)}return[]}getExtendElementSymbol(e){const n=e.$cstNode,r=e.element.$cstNode,i=e.body;return!n||!r?[]:[{kind:this.symbolKind(e),name:vh(e.element),range:n.range,selectionRange:r.range,children:i.elements.flatMap(s=>this.getElementsSymbol(s))}]}getElementSymbol(e){const n=e.$cstNode,r=vn(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=vn(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||ms(e.kind.name)?null:{kind:this.symbolKind(e),name:e.kind.name,range:e.$cstNode.range,selectionRange:e.kind.$cstNode.range}}getTagSymbol(e){return!e.$cstNode||!e.tag.$cstNode||ms(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||ms(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?vn(n,"name"):null;return r?[{kind:this.symbolKind(e),name:r.text,range:n.range,selectionRange:r.range,children:[]}]:[]}getDeploymentElementSymbol(e){try{if($n(e))return this.getDeploymentNodeSymbol(e);if(Rr(e))return this.getDeployedInstanceSymbol(e)}catch(n){ye(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.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=mt(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)}}var Kv,pA;function QH(){return pA||(pA=1,Kv=t=>{const e=t.match(/^[ \t]*(?=\S)/gm);return e?e.reduce((n,r)=>Math.min(n,r.length),1/0):0}),Kv}var ZH=QH();const e7=Lf(ZH);function Yv(t){const e=e7(t);if(e===0)return t;const n=new RegExp(`^[ \\t]{${e}}`,"gm");return t.replace(n,"")}class t7 extends ES{parser;locator;constructor(e){super(e),this.parser=e.likec4.ModelParser,this.locator=e.likec4.ModelLocator}getAstNodeHoverContent(e){if(Jk(e))return{contents:{kind:"markdown",value:Yv(`
|
|
241
|
+
tag: \`${e.name}\`
|
|
242
|
+
`)}};if($n(e)){const n=mt(e),r=this.parser.forDocument(n).parseDeploymentNode(e),i=[r.id+" "];return r.title!==e.name&&i.push(`### ${r.title}`),i.push("Deployment: `"+r.kind+"` "),{contents:{kind:"markdown",value:i.join(`
|
|
243
|
+
`)}}}if(Rr(e)){const n=mt(e),r=this.parser.forDocument(n).parseDeployedInstance(e),i=this.locator.getParsedElement(r.element),s=[r.id+" ",`instance of \`${r.element}\``];return i&&s.push(`### ${i.title}`,"Element: `"+i.kind+"` "),{contents:{kind:"markdown",value:s.join(`
|
|
244
|
+
`)}}}if(Fn(e)){const n=this.locator.getParsedElement(e);return n?{contents:{kind:"markdown",value:[n.id,`### ${n.title}`,"Element: `"+n.kind+"` "].join(`
|
|
245
|
+
`)}}:void 0}}}class n7 extends l4{highlightElement(e,n){if(Fn(e)||$n(e))return this.highlightNameAndKind(e,n);if(Rr(e)){"name"in e&&n({node:e,property:"name",type:Fe.variable,modifier:[Je.definition,Je.readonly]});return}if(pv(e))return this.highlightView(e,n);if(vH(e))return n({node:e,property:"name",type:Fe.function});if(fH(e))return n({node:e,property:"name",type:Fe.type,modifier:[Je.definition]}),"prune";if(Lv(e)&&"kind"in e){n({node:e,property:"kind",type:Fe.function});return}if($r(e)&&"kind"in e&&n({node:e,property:"kind",type:Fe.function}),sh(e)||Dl(e))return n({node:e,property:"key",type:Fe.property}),n({node:e,property:"value",type:Fe.variable,modifier:[Je.definition,Je.readonly]}),"prune";if((Av(e)||Ms(e))&&e.$cstNode)return n({cst:e.$cstNode,type:Fe.variable,modifier:[Je.definition,Je.readonly]}),"prune";if(xv(e)){e.selector&&n({node:e,property:"selector",type:Fe.variable,modifier:[Je.definition,Je.readonly]});return}if(eA(e)&&ae(e.value)){n({node:e,property:"value",type:Fe.function});return}if((Ak(e)||Pk(e))&&ae(e.value)){n({node:e,property:"value",type:Fe.type,modifier:[Je.definition,Je.readonly]});return}if((nA(e)||rA(e))&&n({node:e,property:"participant",type:Fe.keyword}),Gp(e)&&ae(e.kind))return n({node:e,property:"kind",type:Fe.type,modifier:[Je.definition]}),"prune";if(Hp(e)&&ae(e.tag))return n({node:e,property:"tag",type:Fe.type,modifier:[Je.definition]}),"prune";if(zk(e))return n({node:e,property:"value",type:e.parent?Fe.property:Fe.variable,modifier:[Je.definition,Je.readonly]}),e.parent?void 0:"prune";if(Wu(e)||Bk(e))return n({node:e,property:"el",type:e.parent?Fe.property:Fe.variable,modifier:[Je.definition,Je.readonly]}),e.parent?void 0:"prune";if(ph(e)){n({node:e,keyword:"color",type:Fe.keyword}),n({node:e,property:"name",type:Fe.type,modifier:[Je.declaration,Je.readonly]});return}if((Lo(e)||Bo(e)||hh(e))&&n({node:e,property:"kind",type:Fe.type,modifier:[Je.declaration,Je.readonly]}),jv(e))return n({node:e,property:"values",type:Fe.interface});if(Jk(e))return n({node:e,property:"name",type:Fe.type,modifier:[Je.definition]});if((lh(e)||Ii(e)&&Bu(e.$container))&&n({node:e,property:"key",type:Fe.property}),oh(e))return n({node:e,property:"key",type:Fe.property}),n({node:e,property:"value",type:Fe.number}),"prune";if(rh(e)||Tr(e)||kk(e))return n({node:e,property:"key",type:Fe.property}),Tr(e)&&(e.libicon||e.value==="none")?(n({node:e,property:e.libicon?"libicon":"value",type:Fe.enum,modifier:[Je.defaultLibrary]}),"prune"):("value"in e&&e.value&&n({node:e,property:"value",type:Fe.string}),"prune");if(Is(e)||dh(e)||Au(e)||ul(e)||Op(e))return n({node:e,property:"key",type:Fe.property}),"value"in e&&n({node:e,property:"value",type:Fe.enum}),"prune"}highlightNameAndKind(e,n){n({node:e,property:"name",type:Fe.variable,modifier:[Je.declaration,Je.readonly]}),n({node:e,property:"kind",type:Fe.keyword,modifier:[]})}highlightView(e,n){e.name&&n({node:e,property:"name",type:Fe.variable,modifier:[Je.declaration,Je.readonly,"local"]})}}const hA=Symbol.for("DeploymentsIndex");class r7{constructor(e){this.services=e,this.Names=e.references.NameProvider,this.langiumDocuments=e.shared.workspace.LangiumDocuments,e.shared.workspace.DocumentBuilder.onBuildPhase(qe.IndexedContent,(n,r)=>{for(const i of n)delete i[hA]})}Names;langiumDocuments;documents(){return this.langiumDocuments.all.filter(e=>Jl(e)&&e.state>=qe.IndexedContent)}get(e){return e.state<qe.IndexedContent&&ye(`Document ${e.uri.path} is not indexed`),e[hA]??=this.createDocumentIndex(e)}nested(e){const n=this.getFqn(e);return this.documents().flatMap(r=>this.get(r).nested(n))}byFqn(e){return this.documents().flatMap(n=>this.get(n).byFqn(e))}getFqn(e){let n=Xl.readId(e);if(ae(n))return n;const r=[this.Names.getNameStrict(e)];let i=e,s;for(;s=Xt(i.$container,$n);)r.push(this.Names.getNameStrict(s)),i=s;return n=r.reduceRight((o,a)=>`${o}.${a}`),Xl.writeId(e,n),n}createDocumentIndex(e){const n=e.parseResult.value.deployments.flatMap(l=>l.elements);if(n.length===0)return em.EMPTY;const r=new Array,i=new Pn,s=new Pn,o=this.Names,a=this.services.workspace.AstNodeDescriptionProvider,c=l=>{const d={...a.createDescription(l.node,l.name,e),fqn:l.fqn};return Xl.writeId(l.node,l.fqn),s.add(l.fqn,d),d},u=(l,d)=>{const f=[],p=l.body?.elements;if(!p||p.length===0)return[];const m=new Set;for(const w of p)if(!Ns(w))try{const E=o.getName(w);if(ae(E)){const y=`${d}.${E}`,b=c({node:w,name:E,fqn:y});i.add(d,b),m.add(b.name),$n(w)&&w.body&&f.push(...u(w,y))}}catch(E){ye(E)}return f.length>0&&Ye(f,gs(yc("name")),Xf((w,E)=>{w.length>1||m.has(E)||i.add(d,w[0])})),i.get(d)};for(const l of n)try{if(Ns(l))continue;const d=o.getName(l);ae(d)&&(r.push(c({node:l,name:d,fqn:d})),u(l,d))}catch(d){ye(d)}return new em(r,i,s)}}class em{constructor(e,n,r){this._rootNodes=e,this._nested=n,this._byfqn=r}static EMPTY=new em([],new Pn,new Pn);rootNodes(){return this._rootNodes}byFqn(e){return this._byfqn.get(e)}nested(e){return this._nested.get(e)}unique(){const e=[];return Ye([...this._byfqn.values()],gs(yc("name")),Xf(n=>{n.length===1&&e.push(n[0])})),e}}const{findNodeForProperty:i7}=Gd,{toDocumentSegment:mA}=Rx;function s7(t,e,n){const r=i7(e.$cstNode,"name");return{documentUri:n.uri,name:e.name,...e.$cstNode&&{selectionSegment:mA(e.$cstNode)},...r&&{nameSegment:mA(r)},path:t.getAstNodePath(e),type:Hn}}function o7(t,e){const n=t.c4fqnIndex=new Pn,r=t.parseResult.value.models.flatMap(a=>a.elements);if(r.length===0)return;const i=e.workspace.AstNodeLocator,s=rm.from(r.map(a=>[a,null]));let o;for(;o=s.shift();)try{const[a,c]=o;if($r(a))continue;if(ko(a)){if(Ht(a.body)&&!ms(a.body.elements)){const u=vh(a.element);for(const l of a.body.elements)$r(l)||s.push([l,u])}continue}if(Fn(a)){const u=JI(a.name,c);if(n.add(u,{...s7(i,a,t),fqn:u}),Xl.writeId(a,u),Ht(a.body)&&!ms(a.body.elements))for(const l of a.body.elements)$r(l)||s.push([l,u]);continue}Ie(a)}catch(a){BC(a)}}class a7{constructor(e){this.services=e,this.langiumDocuments=e.shared.workspace.LangiumDocuments,e.shared.workspace.DocumentBuilder.onBuildPhase(qe.IndexedContent,async(n,r)=>{for(const i of n)if(Jl(i)){delete i.c4fqnIndex,delete i.c4Elements,delete i.c4Specification,delete i.c4Relations,delete i.c4Views;try{o7(i,e)}catch(s){ye(s)}}return await Promise.resolve()}),xe.debug("[FqnIndex] Created")}langiumDocuments;get documents(){return this.langiumDocuments.all.filter(Gv)}entries(e){return this.documents.flatMap(n=>n.c4fqnIndex.keys().filter(e).flatMap(r=>n.c4fqnIndex.get(r)))}getFqn(e){return Xl.readId(e)??null}byFqn(e){return this.documents.flatMap(n=>n.c4fqnIndex.get(e))}directChildrenOf(e){return et([e]).flatMap(n=>{const r=this.entries(i=>ea(i)===n).map(i=>[i.name,i]).toArray();return r.length===0?[]:new Pn(r).entriesGroupedByKey().flatMap(([i,s])=>s.length===1?s:[]).iterator()})}uniqueDescedants(e){return new Pt(()=>{const n=`${e}.`,r=new Set,i=[],s=new Pn;if(this.entries(o=>o.startsWith(n)).forEach(o=>{const a=Zo(o.fqn),c={...o,name:a};ea(o.fqn)===e?(r.add(a),s.add(a,c)):i.push(c)}),s.size+i.length===0)return null;for(const o of i)r.has(o.name)||s.add(o.name,o);return s.entriesGroupedByKey().flatMap(([o,a])=>a.length===1?a:[]).iterator()},n=>n?n.next():Kt)}}var c7=Object.getOwnPropertyNames,u7=Object.getOwnPropertySymbols,l7=Object.prototype.hasOwnProperty;function gA(t,e){return function(r,i,s){return t(r,i,s)&&e(r,i,s)}}function Eh(t){return function(n,r,i){if(!n||!r||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 c=t(n,r,i);return s.delete(n),s.delete(r),c}}function yA(t){return c7(t).concat(u7(t))}var vA=Object.hasOwn||function(t,e){return l7.call(t,e)};function Uo(t,e){return t||e?t===e:t===e||t!==t&&e!==e}var wA="_owner",bA=Object.getOwnPropertyDescriptor,DA=Object.keys;function d7(t,e,n){var r=t.length;if(e.length!==r)return!1;for(;r-- >0;)if(!n.equals(t[r],e[r],r,r,t,e,n))return!1;return!0}function f7(t,e){return Uo(t.getTime(),e.getTime())}function EA(t,e,n){if(t.size!==e.size)return!1;for(var r={},i=t.entries(),s=0,o,a;(o=i.next())&&!o.done;){for(var c=e.entries(),u=!1,l=0;(a=c.next())&&!a.done;){var d=o.value,f=d[0],p=d[1],m=a.value,w=m[0],E=m[1];!u&&!r[l]&&(u=n.equals(f,w,s,l,t,e,n)&&n.equals(p,E,f,w,t,e,n))&&(r[l]=!0),l++}if(!u)return!1;s++}return!0}function p7(t,e,n){var r=DA(t),i=r.length;if(DA(e).length!==i)return!1;for(var s;i-- >0;)if(s=r[i],s===wA&&(t.$$typeof||e.$$typeof)&&t.$$typeof!==e.$$typeof||!vA(e,s)||!n.equals(t[s],e[s],s,s,t,e,n))return!1;return!0}function Zl(t,e,n){var r=yA(t),i=r.length;if(yA(e).length!==i)return!1;for(var s,o,a;i-- >0;)if(s=r[i],s===wA&&(t.$$typeof||e.$$typeof)&&t.$$typeof!==e.$$typeof||!vA(e,s)||!n.equals(t[s],e[s],s,s,t,e,n)||(o=bA(t,s),a=bA(e,s),(o||a)&&(!o||!a||o.configurable!==a.configurable||o.enumerable!==a.enumerable||o.writable!==a.writable)))return!1;return!0}function h7(t,e){return Uo(t.valueOf(),e.valueOf())}function m7(t,e){return t.source===e.source&&t.flags===e.flags}function RA(t,e,n){if(t.size!==e.size)return!1;for(var r={},i=t.values(),s,o;(s=i.next())&&!s.done;){for(var a=e.values(),c=!1,u=0;(o=a.next())&&!o.done;)!c&&!r[u]&&(c=n.equals(s.value,o.value,s.value,o.value,t,e,n))&&(r[u]=!0),u++;if(!c)return!1}return!0}function g7(t,e){var n=t.length;if(e.length!==n)return!1;for(;n-- >0;)if(t[n]!==e[n])return!1;return!0}var y7="[object Arguments]",v7="[object Boolean]",w7="[object Date]",b7="[object Map]",D7="[object Number]",E7="[object Object]",R7="[object RegExp]",T7="[object Set]",$7="[object String]",S7=Array.isArray,TA=typeof ArrayBuffer=="function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,$A=Object.assign,C7=Object.prototype.toString.call.bind(Object.prototype.toString);function k7(t){var e=t.areArraysEqual,n=t.areDatesEqual,r=t.areMapsEqual,i=t.areObjectsEqual,s=t.arePrimitiveWrappersEqual,o=t.areRegExpsEqual,a=t.areSetsEqual,c=t.areTypedArraysEqual;return function(l,d,f){if(l===d)return!0;if(l==null||d==null||typeof l!="object"||typeof d!="object")return l!==l&&d!==d;var p=l.constructor;if(p!==d.constructor)return!1;if(p===Object)return i(l,d,f);if(S7(l))return e(l,d,f);if(TA!=null&&TA(l))return c(l,d,f);if(p===Date)return n(l,d,f);if(p===RegExp)return o(l,d,f);if(p===Map)return r(l,d,f);if(p===Set)return a(l,d,f);var m=C7(l);return m===w7?n(l,d,f):m===R7?o(l,d,f):m===b7?r(l,d,f):m===T7?a(l,d,f):m===E7?typeof l.then!="function"&&typeof d.then!="function"&&i(l,d,f):m===y7?i(l,d,f):m===v7||m===D7||m===$7?s(l,d,f):!1}}function A7(t){var e=t.circular,n=t.createCustomConfig,r=t.strict,i={areArraysEqual:r?Zl:d7,areDatesEqual:f7,areMapsEqual:r?gA(EA,Zl):EA,areObjectsEqual:r?Zl:p7,arePrimitiveWrappersEqual:h7,areRegExpsEqual:m7,areSetsEqual:r?gA(RA,Zl):RA,areTypedArraysEqual:r?Zl:g7};if(n&&(i=$A({},i,n(i))),e){var s=Eh(i.areArraysEqual),o=Eh(i.areMapsEqual),a=Eh(i.areObjectsEqual),c=Eh(i.areSetsEqual);i=$A({},i,{areArraysEqual:s,areMapsEqual:o,areObjectsEqual:a,areSetsEqual:c})}return i}function _7(t){return function(e,n,r,i,s,o,a){return t(e,n,a)}}function P7(t){var e=t.circular,n=t.comparator,r=t.createState,i=t.equals,s=t.strict;if(r)return function(c,u){var l=r(),d=l.cache,f=d===void 0?e?new WeakMap:void 0:d,p=l.meta;return n(c,u,{cache:f,equals:i,meta:p,strict:s})};if(e)return function(c,u){return n(c,u,{cache:new WeakMap,equals:i,meta:void 0,strict:s})};var o={cache:void 0,equals:i,meta:void 0,strict:s};return function(c,u){return n(c,u,o)}}var SA=Fi();Fi({strict:!0}),Fi({circular:!0}),Fi({circular:!0,strict:!0}),Fi({createInternalComparator:function(){return Uo}}),Fi({strict:!0,createInternalComparator:function(){return Uo}}),Fi({circular:!0,createInternalComparator:function(){return Uo}}),Fi({circular:!0,createInternalComparator:function(){return Uo},strict:!0});function Fi(t){t===void 0&&(t={});var e=t.circular,n=e===void 0?!1:e,r=t.createInternalComparator,i=t.createState,s=t.strict,o=s===void 0?!1:s,a=A7(t),c=k7(a),u=r?r(c):_7(c);return P7({circular:n,comparator:c,createState:i,equals:u,strict:o})}function I7(t){const e=new Map;for(const n of t)if(Qo.isElement(n)&&n.viewOf&&yt(n.extends)){const r=e.get(n.viewOf)??[];r.push(n.id),e.set(n.viewOf,r)}for(const{id:n,nodes:r}of t)for(const i of r){const s=vd.modelRef(i);if(i.navigateTo||!s)continue;const o=jT(e.get(s)??[],a=>a!==n);o&&(i.navigateTo=o)}return t}function x7(t,e="/"){const n=Ye(t,un(c=>c.docUri),je(ae),gy());if(n.length===0)return"";if(n.length===1){const c=Dh(n[0]).pathname.split(e);return c.length<=1?e:(c.pop(),c.join(e)+e)}$e(gc(n,2),"Expected at least 2 unique URIs");const[r,...i]=n,s=Dh(r).pathname.split(e);let o=s.length;for(const c of i){if(c===r)continue;const u=Dh(c).pathname.split(e);for(let l=0;l<o;l++)u[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 O7(t){const e="/",n=x7(t,e);return t.map(r=>{if(!r.docUri)return{view:r,parts:[]};let i=Dh(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.parts.length-i.parts.length;for(let s=0;s<r.parts.length;s++){const o=Ib(r.parts[s],i.parts[s]);if(o!==0)return o}return Ib(r.view.title??r.view.id,i.view.title??i.view.id)}).map(({parts:r,view:i})=>({...i,relativePath:r.join(e)}))}function N7(t,e){const n={tags:new Set,deployments:{},elements:{},relationships:{},colors:{}},r={predicates:{},dynamicPredicates:{},styles:{}};for(const y of e){const{c4Specification:b,c4Globals:R}=y;b.tags.forEach(C=>n.tags.add(C)),Object.assign(n.elements,b.elements),Object.assign(n.relationships,b.relationships),Object.assign(n.colors,b.colors),Object.assign(n.deployments,b.deployments),Object.assign(r.predicates,R.predicates),Object.assign(r.dynamicPredicates,R.dynamicPredicates),Object.assign(r.styles,R.styles)}function i(y,b){return un(b,R=>{try{const C=t.lsp.DocumentLinkProvider.relativeLink(y,R.url);if(C&&C!==R.url)return{...R,relative:C}}catch(C){ye(C)}return R})}const s=vc(n.colors,y=>ZI(y.color));function o(y){return({tags:b,links:R,style:{color:C,shape:A,icon:q,opacity:G,border:Q},id:J,kind:le,title:N,description:S,technology:T,metadata:O})=>{try{const W=n.elements[le];if(!W)return xe.warn(`No kind '${le}' found for ${J}`),null;const U=R?i(y,R):null;return C??=W.style.color,A??=W.style.shape,q??=W.style.icon,G??=W.style.opacity,Q??=W.style.border,T??=W.technology,{...C&&{color:C},...A&&{shape:A},...q&&{icon:q},...O&&!ms(O)&&{metadata:O},...W.notation&&{notation:W.notation},style:{...Q&&{border:Q},...Yf(G)&&{opacity:G}},links:U,tags:b??null,technology:T??null,description:S??null,title:N,kind:le,id:J}}catch(W){ye(W)}return null}}const a=Ye(e,Di(y=>un(y.c4Elements,o(y))),je(ae),Ob,yy((y,b)=>{const R=ea(b.id);return R&&yt(y[R])?(ye(`No parent found for ${b.id}`),y):(y[b.id]=b,y)},{}));function c(y){return({astPath:b,source:R,target:C,kind:A,links:q,id:G,...Q})=>{if(yt(a[R])||yt(a[C]))return xe.warn(`Invalid relation ${G} at ${y.uri.path} ${b}, source: ${R}(${!!a[R]}), target: ${C}(${!!a[C]})`),null;const J=q?i(y,q):null;return Jt(A)&&A in n.relationships?{...n.relationships[A],...Q,...J&&{links:J},source:R,target:C,kind:A,id:G}:{...J&&{links:J},...Q,source:R,target:C,id:G}}}const u=Ye(e,Di(y=>un(y.c4Relations,c(y))),je(ae),MT(ex),BT(),vy(yc("id")));function l(y){return b=>{if(!tx.isDeploymentNode(b)){if(!b.links||b.links.length===0)return b;const R=i(y,b.links);return{...b,links:R}}try{const R=n.deployments[b.kind];if(!R)return xe.warn(`No kind '${b.kind}' found for ${b.id}`),null;let{technology:C=R.technology,notation:A=R.notation,links:q,style:G}=b;return{...b,...A&&{notation:A},...C&&{technology:C},style:{border:"dashed",opacity:10,...R.style,...G},links:q?i(y,q):null}}catch(R){ye(R)}return null}}const d=Ye(e,Di(y=>un(y.c4Deployments,l(y))),je(ae),Ob,yy((y,b)=>{const R=ea(b.id);return R&&yt(y[R])?(ye(`No parent found for deployment element ${b.id}`),y):(y[b.id]=b,y)},{}));function f(y){return({astPath:b,source:R,target:C,kind:A,links:q,id:G,...Q})=>{if(yt(d[R.id])||yt(d[C.id]))return xe.warn(`Invalid deployment relation ${G} at ${y.uri.path} ${b}, source: ${R.id}(${!!d[R.id]}), target: ${C.id}(${!!d[C.id]})`),null;const J=q?i(y,q):null;return Jt(A)&&A in n.relationships?{...n.relationships[A],...Q,...J&&{links:J},source:R,target:C,kind:A,id:G}:{...J&&{links:J},...Q,source:R,target:C,id:G}}}const p=Ye(e,Di(y=>un(y.c4DeploymentRelations,f(y))),je(ae),yy((y,b)=>Ht(y[b.id])?(ye(`Duplicate deployment relation ${b.id}`),y):(y[b.id]=b,y),{}));function m(y){const b=y.uri.toString();return R=>{let{id:C,title:A,description:q,tags:G,links:Q,astPath:J,...le}=R;R.__==="element"&&yt(A)&&"viewOf"in R&&(A=a[R.viewOf]?.title??null),yt(A)&&C==="index"&&(A="Landscape view");const N=Q?i(y,Q):null;return{...le,customColorDefinitions:s,tags:G,links:N,docUri:b,description:q,title:A,id:C}}}const w=Ye(e,Di(y=>un(y.c4Views,m(y))),O7);w.some(y=>y.id==="index")||w.unshift({__:"element",id:"index",title:"Landscape view",description:null,tags:null,links:null,customColorDefinitions:s,rules:[{include:[{wildcard:!0}]}]});const E=Ye(w,vy(yc("id")),ux);return{specification:{tags:Array.from(n.tags),elements:n.elements,relationships:n.relationships,deployments:n.deployments},elements:a,relations:u,globals:r,views:E,deployments:{elements:d,relations:p}}}const CA="ParsedLikeC4Model",Xv="ComputedLikeC4Model";class F7{constructor(e){this.services=e,this.langiumDocuments=e.shared.workspace.LangiumDocuments;const n=e.likec4.ModelParser;e.shared.workspace.DocumentBuilder.onUpdate((r,i)=>{i.length>0&&this.notifyListeners(i)}),e.shared.workspace.DocumentBuilder.onBuildPhase(qe.Validated,async(r,i)=>{let s=[];try{xe.debug(`[ModelBuilder] onValidated (${r.length} docs)`);for(const o of r)s.push(n.parse(o).uri)}catch(o){ye(o)}return s.length>0&&this.notifyListeners(s),await Promise.resolve()}),xe.debug("[ModelBuilder] Created")}langiumDocuments;listeners=[];unsafeSyncBuildModel(){const e=this.documents();return e.length===0?(xe.debug("[ModelBuilder] No documents to build model from"),null):this.services.WorkspaceCache.get(CA,()=>(xe.debug(`[ModelBuilder] buildModel (${e.length} docs)`),N7(this.services,e)))}async buildModel(e){return this.services.WorkspaceCache.get(CA)||await this.services.shared.workspace.WorkspaceLock.read(async()=>(e&&await Nt(e),this.unsafeSyncBuildModel()))}previousViews={};unsafeSyncBuildComputedModel(e){const n=this.services.WorkspaceCache,r=this.services.WorkspaceCache;return n.get(Xv,()=>{const i=xb.makeCompute(e),s=[];for(const a of mc(e.views)){const c=i(a);if(!c.isSuccess){ye(c.error);continue}s.push(c.view)}I7(s);const o=nr(s,a=>{const c=this.previousViews[a.id],u=c&&SA(a,c)?c:a;return r.set(kA(a.id),u),[a.id,u]});return this.previousViews={...o},{...structuredClone(h8(e,["specification","elements","relations","globals","deployments"])),views:o}})}async buildComputedModel(e){const n=this.services.WorkspaceCache;return n.has(Xv)?n.get(Xv):await this.services.shared.workspace.WorkspaceLock.read(async()=>{e&&await Nt(e);const r=this.unsafeSyncBuildModel();return r?this.unsafeSyncBuildComputedModel(r):null})}async computeView(e,n){const r=this.services.WorkspaceCache,i=kA(e);return r.has(i)?r.get(i):await this.services.shared.workspace.WorkspaceLock.read(async()=>(n&&await Nt(n),r.get(i,()=>{const s=this.unsafeSyncBuildModel(),o=s?.views[e];if(!o)return xe.warn(`[ModelBuilder] Cannot find view ${e}`),null;const a=xb.makeCompute(s)(o);if(!a.isSuccess)return ye(a.error),null;let c=a.view;const u=Ye(s.views,mc(),je(QI),je(d=>d.id!==e),gs(d=>d.viewOf));for(const d of c.nodes)if(!d.navigateTo){const f=u[d.id];f&&(d.navigateTo=f[0].id)}const l=this.previousViews[e];return l&&SA(c,l)?c=l:this.previousViews[e]=c,c})))}onModelParsed(e){return this.listeners.push(e),hs.create(()=>{const n=this.listeners.indexOf(e);n>=0&&this.listeners.splice(n,1)})}documents(){return this.langiumDocuments.all.filter(jo).toArray()}notifyListeners(e){for(const n of this.listeners)try{n(e)}catch(r){ye(r)}}}function kA(t){return`computed-view-${t}`}const{findNodeForKeyword:L7,findNodeForProperty:Rh}=Gd,{getDocument:M7}=Ba;class B7{constructor(e){this.services=e,this.fqnIndex=e.likec4.FqnIndex,this.deploymentsIndex=e.likec4.DeploymentsIndex,this.langiumDocuments=e.shared.workspace.LangiumDocuments}fqnIndex;deploymentsIndex;langiumDocuments;documents(){return this.langiumDocuments.all.filter(jo)}getParsedElement(e){if(zT(e)){const i=e,s=this.fqnIndex.byFqn(e).head();if(!s)return null;const o=this.langiumDocuments.getDocument(s.documentUri);return!o||!jo(o)?null:o.c4Elements.find(a=>a.id===i)??null}const n=this.fqnIndex.getFqn(e);if(!n)return null;const r=M7(e);return jo(r)?r.c4Elements.find(i=>i.id===n)??null:null}locateElement(e,n){const r=this.fqnIndex.byFqn(e).head(),i=r?.nameSegment??r?.selectionSegment;return!r||!i?null:{uri:r.documentUri.toString(),range:i.range}}locateDeploymentElement(e,n){const r=this.deploymentsIndex.byFqn(e).head(),i=r?.nameSegment??r?.selectionSegment;return!r||!i?null:{uri:r.documentUri.toString(),range:i.range}}locateRelation(e){for(const n of this.documents()){const r=n.c4Relations.find(o=>o.id===e)??n.c4DeploymentRelations.find(o=>o.id===e);if(!r)continue;const i=this.services.workspace.AstNodeLocator.getAstNode(n.parseResult.value,r.astPath);if(!$r(i)&&!Ns(i))continue;let s=i.title?Rh(i.$cstNode,"title"):void 0;if(s??=i.kind?Rh(i.$cstNode,"kind"):void 0,s??=Rh(i.$cstNode,"target"),s??=i.$cstNode,!!s)return{uri:n.uri.toString(),range:s.range}}return null}locateViewAst(e){for(const n of this.documents()){const r=n.c4Views.find(s=>s.id===e);if(!r)continue;const i=this.services.workspace.AstNodeLocator.getAstNode(n.parseResult.value,r.astPath);if(pv(i))return{doc:n,view:r,viewAst:i}}return null}locateView(e){const n=this.locateViewAst(e);if(!n)return null;const r=n.viewAst;let i=r.name?Rh(r.$cstNode,"name"):void 0;return i??=L7(r.$cstNode,"view"),i??=r.$cstNode,i?{uri:n.doc.uri.toString(),range:i.range}:null}}var Jv,AA;function z7(){if(AA)return Jv;AA=1;function t(e){if(typeof e!="function")throw new Error("mnemonist/DefaultWeakMap.constructor: expecting a function.");this.items=new WeakMap,this.factory=e}return t.prototype.clear=function(){this.items=new WeakMap},t.prototype.get=function(e){var n=this.items.get(e);return typeof n>"u"&&(n=this.factory(e),this.items.set(e,n)),n},t.prototype.peek=function(e){return this.items.get(e)},t.prototype.set=function(e,n){return this.items.set(e,n),this},t.prototype.has=function(e){return this.items.has(e)},t.prototype.delete=function(e){return this.items.delete(e)},t.prototype.inspect=function(){return this.items},typeof Symbol<"u"&&(t.prototype[Symbol.for("nodejs.util.inspect.custom")]=t.prototype.inspect),Jv=t,Jv}var q7=z7();const j7=Lf(q7),Go=["this","it","self","super","likec4lib","global"];function pt(t){return async(e,n,r)=>{try{const i=t(e,n,r);D8(i)&&await i}catch(i){ye(i)}}}const{getDocument:U7}=Ba,G7=t=>{const e=t.likec4.DeploymentsIndex,n=t.references.NameProvider;return pt((r,i)=>{const s=n.getName(r);if(!s){i("error","DeploymentNode must be named",{node:r});return}const o=rn(n.getNameNode(r),"name CstNode not found").range;Go.includes(s)&&i("error",`Reserved word: ${s}`,{node:r,range:o});const a=e.getFqn(r);e.byFqn(a).limit(2).toArray().length>1&&i("error",`Duplicate node name "${a}"`,{node:r,range:o})})},W7=t=>{const e=t.likec4.DeploymentsIndex,n=t.references.NameProvider;return pt((r,i)=>{const s=n.getName(r);if(!s){i("error","Deployed instance must be named, unique inside node",{node:r});return}const o=rn(n.getNameNode(r),"name CstNode not found").range;Go.includes(s)&&i("error",`Reserved word: ${s}`,{node:r,range:o});const a=e.getFqn(r);e.byFqn(a).limit(2).toArray().length>1&&i("error",`Duplicate instance name "${a}"`,{node:r,range:o})})},H7=t=>{const e=t.likec4.ModelParser;return pt((n,r)=>{if(!n.source?.value?.ref){let c=n.source?.$cstNode?.text??"";r("error",`DeploymentRelation source '${c}' not resolved`,{node:n,property:"source"});return}if(!n.target?.value?.ref){let c=n.target?.$cstNode?.text??"";r("error",`DeploymentRelation target '${c}' not resolved`,{node:n,property:"target"});return}const i=U7(n),s=e.forDocument(i),o=s.parseFqnRef(n.source);if(ta.isModelRef(o)){r("error","DeploymentRelation must refer deployment element",{node:n,property:"source"});return}const a=s.parseFqnRef(n.target);if(ta.isModelRef(a)){r("error","DeploymentRelation must refer deployment element",{node:n,property:"target"});return}Nb(o.deployment,a.deployment)&&r("error","Invalid parent-child relationship",{node:n})})},V7=t=>pt((e,n)=>{const r=cA(e.value);switch(!0){case Gp(r):case Hp(r):case Ms(r):{n("warning","Predicate is ignored, as not supported in dynamic views",{node:e});return}}}),K7=t=>{const e=t.likec4.FqnIndex;return pt((n,r)=>{const i=mn(n.source),s=i&&e.getFqn(i);s||r("error","Source not found (not parsed/indexed yet)",{node:n,property:"source"});const o=mn(n.target),a=o&&e.getFqn(o);a||r("error","Target not found (not parsed/indexed yet)",{node:n,property:"target"}),s&&a&&(im(s,a)||im(a,s))&&r("error","Invalid parent-child relationship",{node:n})})},{getDocument:Y7}=Ba,X7=t=>{const e=t.likec4.FqnIndex,n=t.workspace.AstNodeLocator;return pt((r,i)=>{const s=e.getFqn(r);if(!s){i("error","Not indexed element",{node:r,property:"name"});return}Go.includes(r.name)&&i("error",`Reserved word: ${r.name}`,{node:r,property:"name"});const o=Y7(r).uri,a=n.getAstNodePath(r),c=e.byFqn(s).filter(u=>u.documentUri!==o||u.path!==a).head();if(c){const u=c.documentUri!==o;i("error",`Duplicate element name ${r.name!==s?r.name+" ("+s+")":r.name}`,{node:r,property:"name",...u&&{relatedInformation:[{location:{range:c.nameSegment?.range??c.selectionSegment?.range,uri:c.documentUri.toString()},message:"conflicting element"}]}})}})},J7=t=>pt((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"})}),Q7=t=>(e,n)=>{const r=e.$container;r.props.some(i=>Tr(i)&&i!==e)&&n("error","Icon must be defined once",{node:e}),Ii(r)&&Bu(r.$container)&&r.$container.props.some(i=>Tr(i))&&n("warning","Redundant as icon defined on element",{node:e})},Z7=t=>(e,n)=>{pi(e,kv)||n("error","Notes can be defined only inside dynamic view",{node:e})},eV=t=>{const e=t.likec4.FqnIndex;return pt((n,r)=>{const i=mn(n.target),s=i&&e.getFqn(i);s||r("error","Target not resolved",{node:n,property:"target"});let o;if(Ht(n.source)){if(o=mn(n.source),!o)return r("error","Source not resolved",{node:n,property:"source"})}else{if(!Bu(n.$container))return r("error","Sourceless relation must be nested",{node:n});o=n.$container.$container}const a=e.getFqn(o);a||r("error","Source not resolved",{node:n}),a&&s&&Nb(a,s)&&r("error","Invalid parent-child relationship",{node:n})})},tV=t=>pt((e,n)=>{e.$container.tags?.values&&e.tags?.values&&n("error","Relation cannot have tags in both header and body",{node:e.tags})}),nV=t=>pt((e,n)=>{e.$containerIndex&&e.$containerIndex>0&&n("warning","Prefer one specification per document",{node:e,property:"name"})}),rV=t=>pt((e,n)=>{e.$containerIndex&&e.$containerIndex>0&&n("warning","Prefer one model per document",{node:e,property:"name"})}),iV=t=>pt((e,n)=>{e.$containerIndex&&e.$containerIndex>0&&n("warning","Prefer one global block per document",{node:e,property:"name"})}),sV=t=>{const e=t.shared.workspace.IndexManager;return pt((n,r)=>{Go.includes(n.name)&&r("error",`Reserved word: ${n.name}`,{node:n,property:"name"});const i=e.allElements(si).filter(s=>s.name===n.name&&s.node!==n).head();if(i){const s=i.documentUri!==mt(n).uri;r("error",`Duplicate element kind '${n.name}'`,{node:n,property:"name",...s&&{relatedInformation:[{location:{range:i.nameSegment.range,uri:i.documentUri.toString()},message:"conflicting definition"}]}})}})},oV=t=>{const e=t.shared.workspace.IndexManager;return pt((n,r)=>{const i="#"+n.name,s=e.allElements(Oi).filter(o=>o.name===i&&o.node!==n).head();if(s){const o=s.documentUri!==mt(n).uri;r("error",`Duplicate tag '${n.name}'`,{node:n,property:"name",...o&&{relatedInformation:[{location:{range:s.nameSegment.range,uri:s.documentUri.toString()},message:"conflicting definition"}]}})}})},aV=t=>{const e=t.shared.workspace.IndexManager;return pt((n,r)=>{Go.includes(n.name)&&r("error",`Reserved word: ${n.name}`,{node:n,property:"name"}),e.allElements(xi).filter(i=>i.name===n.name).limit(2).count()>1&&r("error",`Duplicate RelationshipKind '${n.name}'`,{node:n,property:"name"})})},_A=t=>{const e=t.shared.workspace.IndexManager;return pt((n,r)=>{const i=e.allElements(_o),s=e.allElements(Ao);i.concat(s).filter(o=>o.name===n.name).limit(2).count()>1&&r("error",`Duplicate GlobalPredicateGroup or GlobalDynamicPredicateGroup name '${n.name}'`,{node:n,property:"name"})})},cV=t=>{const e=t.shared.workspace.IndexManager;return pt((n,r)=>{e.allElements(tl).filter(i=>i.name===n.name).limit(2).count()>1&&r("error",`Duplicate GlobalStyleId name '${n.name}'`,{node:n,property:"name"})})},uV=t=>{const e=t.shared.workspace.IndexManager;return pt((n,r)=>{n.name&&(Go.includes(n.name)&&r("error",`Reserved word: ${n.name}`,{node:n,property:"name"}),e.allElements(Ps).filter(i=>i.name===n.name).limit(2).count()>1&&r("error",`Duplicate view '${n.name}'`,{node:n,property:"name"}))})},lV=t=>pt((e,n)=>{const r=Xt(e,_p);Yp(r)&&n("error",'Invalid usage inside "exclude"',{node:e});const i=_v(e.subject)?e.subject.subject:e.subject;switch(!0){case Wu(i):case Av(i):case Lk(i):case Ms(i):return;case Gp(i):case Hp(i):n("error","Invalid target (expect reference to specific element)",{node:e,property:"subject"});return;default:Ie(i)}}),dV=t=>pt((e,n)=>{pi(e,mv)&&n("warning","Redundant usage, expand predicate resolves parent element only when used in relations",{node:e})}),fV=t=>{const e=t.likec4.ModelParser;return pt((n,r)=>{if(n.$container.$type!=="DeploymentViewRulePredicateExpression")return;const i=Xt(n,Rv);if(!i||i.isInclude!==!0)return;const s=mt(n),o=e.forDocument(s),a="Model reference is allowed in exclude predicate only";if(xk(n)){na.isModelRef(o.parseFqnExpr(n.source.from))&&r("error",a,{node:n.source,property:"from"}),na.isModelRef(o.parseFqnExpr(n.target))&&r("error",a,{node:n,property:"target"});return}let c;if(Uk(n)?c=n.to:Kk(n)?c=n.from:c=n.inout.to,na.isModelRef(o.parseFqnExpr(c))){r("error",a,{node:n});return}})},pV=t=>{const e=t.likec4.ModelParser;return pt((n,r)=>{const i=n.ref.value.ref;if(yt(i)){r("error","Invalid empty reference",{node:n});return}const s=mt(n),o=e.forDocument(s).parseFqnRefExpr(n);if(n.$container.$type==="DeploymentViewRulePredicateExpression"){if(na.isModelRef(o)){r("error","Deployment view predicate must reference deployment model",{node:n});return}if(na.isDeploymentRef(o)&&ta.isInsideInstanceRef(o.ref)){r("error","Must reference deployment nodes or instances, but not internals",{node:n});return}}!$n(i)&&Jt(n.selector)&&r("warning",`Selector '${n.selector}' applies to deployment nodes only, ignored here`,{node:n,property:"selector"})})},hV=t=>pt((e,n)=>{if(Ms(e.to)&&!Fv(e.$container)){const r=Xt(e,Vp);yt(r?.viewOf)&&n("warning","Predicate is ignored as it concerns all relationships",{node:e})}}),mV=t=>pt((e,n)=>{if(Ms(e.from)&&!$v(e.$container)){const r=Xt(e,Vp);yt(r?.viewOf)&&n("warning","Predicate is ignored as it concerns all relationships",{node:e})}}),gV=t=>pt((e,n)=>{const r=Xt(e,_p);Yp(r)&&n("error",'Invalid usage inside "exclude"',{node:e})});function yV(t){return e=>t.some(n=>n(e))}const vV=yV([Ov,jk,qk,Zu,el,Nk,Wp,Bv,lv,mv,Sv,kv,j9,Rv,H9,Sk,xv,J9,yv,K9,jv,Q9,uv,pv,vv,Rr,$n,Ns,Ck,To,$r,W9,kk,sh,Fn,ko,Lo,Bo,hh,mh,ph,qv]),wV=t=>{let e=t;for(;e&&!pH(e);){if(vV(e))return e;e=e.$container}};function bV(t){const e=t.diagnostics?.filter(r=>r.severity===uc.Error)??[],n=new WeakSet;for(const{node:r}of e){if(yt(r)||n.has(r))continue;n.add(r);const i=wV(r);i&&n.add(i)}return{isValid:r=>!n.has(r),invalidNodes:n}}function DV(t){xe.debug("registerValidationChecks"),t.validation.ValidationRegistry.register({DeployedInstance:W7(t),DeploymentNode:G7(t),DeploymentRelation:H7(t),FqnRefExpr:pV(t),RelationExpr:fV(t),NotesProperty:Z7(),OpacityProperty:J7(),IconProperty:Q7(),SpecificationRule:nV(),Model:rV(),Globals:iV(),GlobalPredicateGroup:_A(t),GlobalDynamicPredicateGroup:_A(t),GlobalStyleId:cV(t),DynamicViewStep:K7(t),LikeC4View:uV(t),Element:X7(t),ElementKind:sV(t),Relation:eV(t),RelationBody:tV(),Tag:oV(t),DynamicViewPredicateIterator:V7(),ElementPredicateWith:lV(),RelationPredicateWith:gV(),ExpandElementExpression:dV(),RelationshipKind:aV(t),IncomingRelationExpression:hV(),OutgoingRelationExpression:mV()});const e=t.shared.lsp.Connection;e&&t.shared.workspace.DocumentBuilder.onUpdate((n,r)=>{for(const i of r)xe.debug(`clear diagnostics for deleted ${i.path}`),e.sendDiagnostics({uri:i.toString(),diagnostics:[]})})}function Sr(t){return Jt(t)?st(t).split(`
|
|
246
|
+
`).join(" "):void 0}function st(t){return Jt(t)?Yv(t).trim():void 0}class EV{constructor(e,n){this.services=e,this.doc=n,this.isValid=bV(n).isValid}isValid;resolveFqn(e){if($k(e))return this.services.likec4.DeploymentsIndex.getFqn(e);if(ko(e))return vh(e.element);const n=this.services.likec4.FqnIndex.getFqn(e);return $e(n,`Not indexed element: ${this.getAstNodePath(e)}`),n}getAstNodePath(e){return this.services.workspace.AstNodeLocator.getAstNodePath(e)}getMetadata(e){if(!(!e||!this.isValid(e)))return nr(e.props,n=>[n.key,st(n.value)])}convertTags(e){return this.parseTags(e)}parseTags(e){let n=e?.tags;if(!n)return null;const r=[];for(;n;){try{if(this.isValid(n)){const i=n.values.map(s=>s.ref?.name).filter(ae);i.length>0&&r.push(...i)}}catch{}n=n.prev}return r.reverse(),Kn(r)?r:null}convertLinks(e){return this.parseLinks(e)}parseLinks(e){if(!(!e?.props||e.props.length===0))return Ye(e.props,je(rh),Di(n=>{if(!this.isValid(n))return[];const r=n.value;if(ae(r)){const i=ae(n.title)?Sr(n.title):void 0;return i?{url:r,title:i}:{url:r}}return[]}))}}function ed(...t){var e=t.length>1?t.join(":::"):t[0];return nx(e)}function RV(t){return class extends t{parseDeployment(){const e=this.doc;for(const n of _H(e))try{switch(!0){case Ns(n):{this.isValid(n)&&e.c4DeploymentRelations.push(this.parseDeploymentRelation(n));break}case Rr(n):e.c4Deployments.push(this.parseDeployedInstance(n));break;case $n(n):{e.c4Deployments.push(this.parseDeploymentNode(n));break}default:Ie(n)}}catch(r){ye(r)}}parseDeploymentNode(e){const n=this.isValid,r=this.resolveFqn(e),i=rn(e.kind.ref,"DeploymentKind not resolved").name,s=this.convertTags(e.body),o=e.body?.props.find(Ii)?.props,a=Ni(o,n),c=this.getMetadata(e.body?.props.find(To)),u=Ye(e.body?.props??[],je(n),je(Vu),nr(w=>[w.key,w.value||void 0])),l=st(e.title??u.title),d=st(u.description),f=Sr(u.technology),p=this.convertLinks(e.body),m=e.body?.props.find(Tr);if(m&&n(m)){const w=m.libicon?.ref?.name??m.value;ae(w)&&(a.icon=w)}return{id:r,kind:i,title:l??Zo(r),...c&&{metadata:c},...s&&{tags:s},...p&&Kn(p)&&{links:p},...ae(f)&&{technology:f},...ae(d)&&{description:d},style:a}}parseDeployedInstance(e){const n=this.isValid,r=this.resolveFqn(e),i=this.resolveFqn(rn(mn(e.element),"DeployedInstance element not found")),s=this.convertTags(e.body),o=e.body?.props.find(Ii)?.props,a=Ni(o,n),c=this.getMetadata(e.body?.props.find(To)),u=Ye(e.body?.props??[],je(n),je(Vu),nr(w=>[w.key,w.value||void 0])),l=st(e.title??u.title),d=st(u.description),f=Sr(u.technology),p=this.convertLinks(e.body),m=e.body?.props.find(Tr);if(m&&n(m)){const w=m.libicon?.ref?.name??m.value;ae(w)&&(a.icon=w)}return{id:r,element:i,...c&&{metadata:c},...l&&{title:l},...s&&{tags:s},...p&&Kn(p)&&{links:p},...ae(f)&&{technology:f},...ae(d)&&{description:d},style:a}}parseDeploymentRelation(e){const n=this.isValid,r=this.getAstNodePath(e),i=ta.toDeploymentRef(this.parseFqnRef(e.source)),s=ta.toDeploymentRef(this.parseFqnRef(e.target)),o=this.convertTags(e)??this.convertTags(e.body),a=this.convertLinks(e.body),c=e.kind?.ref?.name,u=this.getMetadata(e.body?.props.find(To)),l=nr(e.body?.props.filter(Sl)??[],E=>[E.key,E.value]),d=Ye(e.body?.props??[],je(Dl),un(E=>E.value.view.ref?.name),je(ae),vo()),f=st(e.title??l.title),p=st(l.description),m=Sr(e.technology)??st(l.technology),w=e.body?.props.find(lh);return{id:ed("deployment",r,i.id,s.id),source:i,target:s,...f&&{title:f},...u&&{metadata:u},...ae(m)&&{technology:m},...ae(p)&&{description:p},...c&&{kind:c},...o&&{tags:o},...Kn(a)&&{links:a},...Wv(w?.props,n),...d&&{navigateTo:d},astPath:r}}}}function TV(t){for(var e=t.length,n=0,r=0;r<e;){var i=t.charCodeAt(r++);if(i&4294967168)if(!(i&4294965248))n+=2;else{if(i>=55296&&i<=56319&&r<e){var s=t.charCodeAt(r);(s&64512)===56320&&(++r,i=((i&1023)<<10)+(s&1023)+65536)}i&4294901760?n+=4:n+=3}else{n++;continue}}return n}function $V(t,e,n){for(var r=t.length,i=n,s=0;s<r;){var o=t.charCodeAt(s++);if(o&4294967168)if(!(o&4294965248))e[i++]=o>>6&31|192;else{if(o>=55296&&o<=56319&&s<r){var a=t.charCodeAt(s);(a&64512)===56320&&(++s,o=((o&1023)<<10)+(a&1023)+65536)}o&4294901760?(e[i++]=o>>18&7|240,e[i++]=o>>12&63|128,e[i++]=o>>6&63|128):(e[i++]=o>>12&15|224,e[i++]=o>>6&63|128)}else{e[i++]=o;continue}e[i++]=o&63|128}}var SV=new TextEncoder,CV=50;function kV(t,e,n){SV.encodeInto(t,e.subarray(n))}function AV(t,e,n){t.length>CV?kV(t,e,n):$V(t,e,n)}var _V=4096;function PA(t,e,n){for(var r=e,i=r+n,s=[],o="";r<i;){var a=t[r++];if(!(a&128))s.push(a);else if((a&224)===192){var c=t[r++]&63;s.push((a&31)<<6|c)}else if((a&240)===224){var c=t[r++]&63,u=t[r++]&63;s.push((a&31)<<12|c<<6|u)}else if((a&248)===240){var c=t[r++]&63,u=t[r++]&63,l=t[r++]&63,d=(a&7)<<18|c<<12|u<<6|l;d>65535&&(d-=65536,s.push(d>>>10&1023|55296),d=56320|d&1023),s.push(d)}else s.push(a);s.length>=_V&&(o+=String.fromCharCode.apply(String,s),s.length=0)}return s.length>0&&(o+=String.fromCharCode.apply(String,s)),o}var PV=new TextDecoder,IV=200;function xV(t,e,n){var r=t.subarray(e,e+n);return PV.decode(r)}function OV(t,e,n){return n>IV?xV(t,e,n):PA(t,e,n)}var Th=function(){function t(e,n){this.type=e,this.data=n}return t}(),NV=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(r[s]=i[s])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Cr=function(t){NV(e,t);function e(n){var r=t.call(this,n)||this,i=Object.create(e.prototype);return Object.setPrototypeOf(r,i),Object.defineProperty(r,"name",{configurable:!0,enumerable:!1,value:e.name}),r}return e}(Error),td=4294967295;function FV(t,e,n){var r=n/4294967296,i=n;t.setUint32(e,r),t.setUint32(e+4,i)}function IA(t,e,n){var r=Math.floor(n/4294967296),i=n;t.setUint32(e,r),t.setUint32(e+4,i)}function xA(t,e){var n=t.getInt32(e),r=t.getUint32(e+4);return n*4294967296+r}function LV(t,e){var n=t.getUint32(e),r=t.getUint32(e+4);return n*4294967296+r}var MV=-1,BV=4294967296-1,zV=17179869184-1;function qV(t){var e=t.sec,n=t.nsec;if(e>=0&&n>=0&&e<=zV)if(n===0&&e<=BV){var r=new Uint8Array(4),i=new DataView(r.buffer);return i.setUint32(0,e),r}else{var s=e/4294967296,o=e&4294967295,r=new Uint8Array(8),i=new DataView(r.buffer);return i.setUint32(0,n<<2|s&3),i.setUint32(4,o),r}else{var r=new Uint8Array(12),i=new DataView(r.buffer);return i.setUint32(0,n),IA(i,4,e),r}}function jV(t){var 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 UV(t){if(t instanceof Date){var e=jV(t);return qV(e)}else return null}function GV(t){var e=new DataView(t.buffer,t.byteOffset,t.byteLength);switch(t.byteLength){case 4:{var n=e.getUint32(0),r=0;return{sec:n,nsec:r}}case 8:{var i=e.getUint32(0),s=e.getUint32(4),n=(i&3)*4294967296+s,r=i>>>2;return{sec:n,nsec:r}}case 12:{var n=xA(e,4),r=e.getUint32(0);return{sec:n,nsec:r}}default:throw new Cr("Unrecognized data size for timestamp (expected 4, 8, or 12): ".concat(t.length))}}function WV(t){var e=GV(t);return new Date(e.sec*1e3+e.nsec/1e6)}var HV={type:MV,encode:UV,decode:WV},OA=function(){function t(){this.builtInEncoders=[],this.builtInDecoders=[],this.encoders=[],this.decoders=[],this.register(HV)}return t.prototype.register=function(e){var n=e.type,r=e.encode,i=e.decode;if(n>=0)this.encoders[n]=r,this.decoders[n]=i;else{var s=1+n;this.builtInEncoders[s]=r,this.builtInDecoders[s]=i}},t.prototype.tryToEncode=function(e,n){for(var r=0;r<this.builtInEncoders.length;r++){var i=this.builtInEncoders[r];if(i!=null){var s=i(e,n);if(s!=null){var o=-1-r;return new Th(o,s)}}}for(var r=0;r<this.encoders.length;r++){var i=this.encoders[r];if(i!=null){var s=i(e,n);if(s!=null){var o=r;return new Th(o,s)}}}return e instanceof Th?e:null},t.prototype.decode=function(e,n,r){var i=n<0?this.builtInDecoders[-1-n]:this.decoders[n];return i?i(e,n,r):new Th(n,e)},t.defaultCodec=new t,t}();function $h(t){return t instanceof Uint8Array?t:ArrayBuffer.isView(t)?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):t instanceof ArrayBuffer?new Uint8Array(t):Uint8Array.from(t)}function VV(t){if(t instanceof ArrayBuffer)return new DataView(t);var e=$h(t);return new DataView(e.buffer,e.byteOffset,e.byteLength)}var KV=100,YV=2048,XV=function(){function t(e){var n,r,i,s,o,a,c,u;this.extensionCodec=(n=e?.extensionCodec)!==null&&n!==void 0?n:OA.defaultCodec,this.context=e?.context,this.useBigInt64=(r=e?.useBigInt64)!==null&&r!==void 0?r:!1,this.maxDepth=(i=e?.maxDepth)!==null&&i!==void 0?i:KV,this.initialBufferSize=(s=e?.initialBufferSize)!==null&&s!==void 0?s:YV,this.sortKeys=(o=e?.sortKeys)!==null&&o!==void 0?o:!1,this.forceFloat32=(a=e?.forceFloat32)!==null&&a!==void 0?a:!1,this.ignoreUndefined=(c=e?.ignoreUndefined)!==null&&c!==void 0?c:!1,this.forceIntegerToFloat=(u=e?.forceIntegerToFloat)!==null&&u!==void 0?u:!1,this.pos=0,this.view=new DataView(new ArrayBuffer(this.initialBufferSize)),this.bytes=new Uint8Array(this.view.buffer)}return t.prototype.reinitializeState=function(){this.pos=0},t.prototype.encodeSharedRef=function(e){return this.reinitializeState(),this.doEncode(e,1),this.bytes.subarray(0,this.pos)},t.prototype.encode=function(e){return this.reinitializeState(),this.doEncode(e,1),this.bytes.slice(0,this.pos)},t.prototype.doEncode=function(e,n){if(n>this.maxDepth)throw new Error("Too deep objects in depth ".concat(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(e,n)},t.prototype.ensureBufferSizeToWrite=function(e){var n=this.pos+e;this.view.byteLength<n&&this.resizeBuffer(n*2)},t.prototype.resizeBuffer=function(e){var n=new ArrayBuffer(e),r=new Uint8Array(n),i=new DataView(n);r.set(this.bytes),this.view=i,this.bytes=r},t.prototype.encodeNil=function(){this.writeU8(192)},t.prototype.encodeBoolean=function(e){e===!1?this.writeU8(194):this.writeU8(195)},t.prototype.encodeNumber=function(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?(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)},t.prototype.encodeNumberAsFloat=function(e){this.forceFloat32?(this.writeU8(202),this.writeF32(e)):(this.writeU8(203),this.writeF64(e))},t.prototype.encodeBigInt64=function(e){e>=BigInt(0)?(this.writeU8(207),this.writeBigUint64(e)):(this.writeU8(211),this.writeBigInt64(e))},t.prototype.writeStringHeader=function(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: ".concat(e," bytes in UTF-8"))},t.prototype.encodeString=function(e){var n=5,r=TV(e);this.ensureBufferSizeToWrite(n+r),this.writeStringHeader(r),AV(e,this.bytes,this.pos),this.pos+=r},t.prototype.encodeObject=function(e,n){var 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: ".concat(Object.prototype.toString.apply(e)))},t.prototype.encodeBinary=function(e){var 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<4294967296)this.writeU8(198),this.writeU32(n);else throw new Error("Too large binary: ".concat(n));var r=$h(e);this.writeU8a(r)},t.prototype.encodeArray=function(e,n){var 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: ".concat(r));for(var i=0,s=e;i<s.length;i++){var o=s[i];this.doEncode(o,n+1)}},t.prototype.countWithoutUndefined=function(e,n){for(var r=0,i=0,s=n;i<s.length;i++){var o=s[i];e[o]!==void 0&&r++}return r},t.prototype.encodeMap=function(e,n){var r=Object.keys(e);this.sortKeys&&r.sort();var 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: ".concat(i));for(var s=0,o=r;s<o.length;s++){var a=o[s],c=e[a];this.ignoreUndefined&&c===void 0||(this.encodeString(a),this.doEncode(c,n+1))}},t.prototype.encodeExtension=function(e){var 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: ".concat(n));this.writeI8(e.type),this.writeU8a(e.data)},t.prototype.writeU8=function(e){this.ensureBufferSizeToWrite(1),this.view.setUint8(this.pos,e),this.pos++},t.prototype.writeU8a=function(e){var n=e.length;this.ensureBufferSizeToWrite(n),this.bytes.set(e,this.pos),this.pos+=n},t.prototype.writeI8=function(e){this.ensureBufferSizeToWrite(1),this.view.setInt8(this.pos,e),this.pos++},t.prototype.writeU16=function(e){this.ensureBufferSizeToWrite(2),this.view.setUint16(this.pos,e),this.pos+=2},t.prototype.writeI16=function(e){this.ensureBufferSizeToWrite(2),this.view.setInt16(this.pos,e),this.pos+=2},t.prototype.writeU32=function(e){this.ensureBufferSizeToWrite(4),this.view.setUint32(this.pos,e),this.pos+=4},t.prototype.writeI32=function(e){this.ensureBufferSizeToWrite(4),this.view.setInt32(this.pos,e),this.pos+=4},t.prototype.writeF32=function(e){this.ensureBufferSizeToWrite(4),this.view.setFloat32(this.pos,e),this.pos+=4},t.prototype.writeF64=function(e){this.ensureBufferSizeToWrite(8),this.view.setFloat64(this.pos,e),this.pos+=8},t.prototype.writeU64=function(e){this.ensureBufferSizeToWrite(8),FV(this.view,this.pos,e),this.pos+=8},t.prototype.writeI64=function(e){this.ensureBufferSizeToWrite(8),IA(this.view,this.pos,e),this.pos+=8},t.prototype.writeBigUint64=function(e){this.ensureBufferSizeToWrite(8),this.view.setBigUint64(this.pos,e),this.pos+=8},t.prototype.writeBigInt64=function(e){this.ensureBufferSizeToWrite(8),this.view.setBigInt64(this.pos,e),this.pos+=8},t}();function JV(t,e){var n=new XV(e);return n.encodeSharedRef(t)}function Qv(t){return"".concat(t<0?"-":"","0x").concat(Math.abs(t).toString(16).padStart(2,"0"))}var QV=16,ZV=16,e5=function(){function t(e,n){e===void 0&&(e=QV),n===void 0&&(n=ZV),this.maxKeyLength=e,this.maxLengthPerKey=n,this.hit=0,this.miss=0,this.caches=[];for(var r=0;r<this.maxKeyLength;r++)this.caches.push([])}return t.prototype.canBeCached=function(e){return e>0&&e<=this.maxKeyLength},t.prototype.find=function(e,n,r){var i=this.caches[r-1];e:for(var s=0,o=i;s<o.length;s++){for(var a=o[s],c=a.bytes,u=0;u<r;u++)if(c[u]!==e[n+u])continue e;return a.str}return null},t.prototype.store=function(e,n){var 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)},t.prototype.decode=function(e,n,r){var i=this.find(e,n,r);if(i!=null)return this.hit++,i;this.miss++;var s=PA(e,n,r),o=Uint8Array.prototype.slice.call(e,n,n+r);return this.store(o,s),s},t}(),t5=function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(l){try{u(r.next(l))}catch(d){o(d)}}function c(l){try{u(r.throw(l))}catch(d){o(d)}}function u(l){l.done?s(l.value):i(l.value).then(a,c)}u((r=r.apply(t,e||[])).next())})},Zv=function(t,e){var n={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},r,i,s,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(u){return function(l){return c([u,l])}}function c(u){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(n=0)),n;)try{if(r=1,i&&(s=u[0]&2?i.return:u[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,u[1])).done)return s;switch(i=0,s&&(u=[u[0]&2,s.value]),u[0]){case 0:case 1:s=u;break;case 4:return n.label++,{value:u[1],done:!1};case 5:n.label++,i=u[1],u=[0];continue;case 7:u=n.ops.pop(),n.trys.pop();continue;default:if(s=n.trys,!(s=s.length>0&&s[s.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!s||u[1]>s[0]&&u[1]<s[3])){n.label=u[1];break}if(u[0]===6&&n.label<s[1]){n.label=s[1],s=u;break}if(s&&n.label<s[2]){n.label=s[2],n.ops.push(u);break}s[2]&&n.ops.pop(),n.trys.pop();continue}u=e.call(t,n)}catch(l){u=[6,l],i=0}finally{r=s=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}},NA=function(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],n;return e?e.call(t):(t=typeof __values=="function"?__values(t):t[Symbol.iterator](),n={},r("next"),r("throw"),r("return"),n[Symbol.asyncIterator]=function(){return this},n);function r(s){n[s]=t[s]&&function(o){return new Promise(function(a,c){o=t[s](o),i(a,c,o.done,o.value)})}}function i(s,o,a,c){Promise.resolve(c).then(function(u){s({value:u,done:a})},o)}},Wo=function(t){return this instanceof Wo?(this.v=t,this):new Wo(t)},n5=function(t,e,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=n.apply(t,e||[]),i,s=[];return i={},o("next"),o("throw"),o("return"),i[Symbol.asyncIterator]=function(){return this},i;function o(f){r[f]&&(i[f]=function(p){return new Promise(function(m,w){s.push([f,p,m,w])>1||a(f,p)})})}function a(f,p){try{c(r[f](p))}catch(m){d(s[0][3],m)}}function c(f){f.value instanceof Wo?Promise.resolve(f.value.v).then(u,l):d(s[0][2],f)}function u(f){a("next",f)}function l(f){a("throw",f)}function d(f,p){f(p),s.shift(),s.length&&a(s[0][0],s[0][1])}},FA="array",Sh="map_key",r5="map_value",i5=function(t){return typeof t=="string"||typeof t=="number"},nd=-1,ew=new DataView(new ArrayBuffer(0)),s5=new Uint8Array(ew.buffer);try{ew.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")}var tw=RangeError,LA=new tw("Insufficient data"),o5=new e5,a5=function(){function t(e){var n,r,i,s,o,a,c;this.totalPos=0,this.pos=0,this.view=ew,this.bytes=s5,this.headByte=nd,this.stack=[],this.extensionCodec=(n=e?.extensionCodec)!==null&&n!==void 0?n:OA.defaultCodec,this.context=e?.context,this.useBigInt64=(r=e?.useBigInt64)!==null&&r!==void 0?r:!1,this.maxStrLength=(i=e?.maxStrLength)!==null&&i!==void 0?i:td,this.maxBinLength=(s=e?.maxBinLength)!==null&&s!==void 0?s:td,this.maxArrayLength=(o=e?.maxArrayLength)!==null&&o!==void 0?o:td,this.maxMapLength=(a=e?.maxMapLength)!==null&&a!==void 0?a:td,this.maxExtLength=(c=e?.maxExtLength)!==null&&c!==void 0?c:td,this.keyDecoder=e?.keyDecoder!==void 0?e.keyDecoder:o5}return t.prototype.reinitializeState=function(){this.totalPos=0,this.headByte=nd,this.stack.length=0},t.prototype.setBuffer=function(e){this.bytes=$h(e),this.view=VV(this.bytes),this.pos=0},t.prototype.appendBuffer=function(e){if(this.headByte===nd&&!this.hasRemaining(1))this.setBuffer(e);else{var n=this.bytes.subarray(this.pos),r=$h(e),i=new Uint8Array(n.length+r.length);i.set(n),i.set(r,n.length),this.setBuffer(i)}},t.prototype.hasRemaining=function(e){return this.view.byteLength-this.pos>=e},t.prototype.createExtraByteError=function(e){var n=this,r=n.view,i=n.pos;return new RangeError("Extra ".concat(r.byteLength-i," of ").concat(r.byteLength," byte(s) found at buffer[").concat(e,"]"))},t.prototype.decode=function(e){this.reinitializeState(),this.setBuffer(e);var n=this.doDecodeSync();if(this.hasRemaining(1))throw this.createExtraByteError(this.pos);return n},t.prototype.decodeMulti=function(e){return Zv(this,function(n){switch(n.label){case 0:this.reinitializeState(),this.setBuffer(e),n.label=1;case 1:return this.hasRemaining(1)?[4,this.doDecodeSync()]:[3,3];case 2:return n.sent(),[3,1];case 3:return[2]}})},t.prototype.decodeAsync=function(e){var n,r,i,s,o,a,c;return t5(this,void 0,void 0,function(){var u,l,d,f,p,m,w,E;return Zv(this,function(y){switch(y.label){case 0:u=!1,y.label=1;case 1:y.trys.push([1,6,7,12]),n=!0,r=NA(e),y.label=2;case 2:return[4,r.next()];case 3:if(i=y.sent(),s=i.done,!!s)return[3,5];c=i.value,n=!1;try{if(d=c,u)throw this.createExtraByteError(this.totalPos);this.appendBuffer(d);try{l=this.doDecodeSync(),u=!0}catch(b){if(!(b instanceof tw))throw b}this.totalPos+=this.pos}finally{n=!0}y.label=4;case 4:return[3,2];case 5:return[3,12];case 6:return f=y.sent(),o={error:f},[3,12];case 7:return y.trys.push([7,,10,11]),!n&&!s&&(a=r.return)?[4,a.call(r)]:[3,9];case 8:y.sent(),y.label=9;case 9:return[3,11];case 10:if(o)throw o.error;return[7];case 11:return[7];case 12:if(u){if(this.hasRemaining(1))throw this.createExtraByteError(this.totalPos);return[2,l]}throw p=this,m=p.headByte,w=p.pos,E=p.totalPos,new RangeError("Insufficient data in parsing ".concat(Qv(m)," at ").concat(E," (").concat(w," in the current buffer)"))}})})},t.prototype.decodeArrayStream=function(e){return this.decodeMultiAsync(e,!0)},t.prototype.decodeStream=function(e){return this.decodeMultiAsync(e,!1)},t.prototype.decodeMultiAsync=function(e,n){return n5(this,arguments,function(){var i,s,o,a,c,u,l,d,f,p,m,w;return Zv(this,function(E){switch(E.label){case 0:i=n,s=-1,E.label=1;case 1:E.trys.push([1,15,16,21]),o=!0,a=NA(e),E.label=2;case 2:return[4,Wo(a.next())];case 3:if(c=E.sent(),f=c.done,!!f)return[3,14];w=c.value,o=!1,E.label=4;case 4:if(E.trys.push([4,,12,13]),u=w,n&&s===0)throw this.createExtraByteError(this.totalPos);this.appendBuffer(u),i&&(s=this.readArraySize(),i=!1,this.complete()),E.label=5;case 5:E.trys.push([5,10,,11]),E.label=6;case 6:return[4,Wo(this.doDecodeSync())];case 7:return[4,E.sent()];case 8:return E.sent(),--s===0?[3,9]:[3,6];case 9:return[3,11];case 10:if(l=E.sent(),!(l instanceof tw))throw l;return[3,11];case 11:return this.totalPos+=this.pos,[3,13];case 12:return o=!0,[7];case 13:return[3,2];case 14:return[3,21];case 15:return d=E.sent(),p={error:d},[3,21];case 16:return E.trys.push([16,,19,20]),!o&&!f&&(m=a.return)?[4,Wo(m.call(a))]:[3,18];case 17:E.sent(),E.label=18;case 18:return[3,20];case 19:if(p)throw p.error;return[7];case 20:return[7];case 21:return[2]}})})},t.prototype.doDecodeSync=function(){e:for(;;){var e=this.readHeadByte(),n=void 0;if(e>=224)n=e-256;else if(e<192)if(e<128)n=e;else if(e<144){var r=e-128;if(r!==0){this.pushMapState(r),this.complete();continue e}else n={}}else if(e<160){var r=e-144;if(r!==0){this.pushArrayState(r),this.complete();continue e}else n=[]}else{var i=e-160;n=this.decodeUtf8String(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.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){var i=this.lookU8();n=this.decodeUtf8String(i,1)}else if(e===218){var i=this.lookU16();n=this.decodeUtf8String(i,2)}else if(e===219){var i=this.lookU32();n=this.decodeUtf8String(i,4)}else if(e===220){var r=this.readU16();if(r!==0){this.pushArrayState(r),this.complete();continue e}else n=[]}else if(e===221){var r=this.readU32();if(r!==0){this.pushArrayState(r),this.complete();continue e}else n=[]}else if(e===222){var r=this.readU16();if(r!==0){this.pushMapState(r),this.complete();continue e}else n={}}else if(e===223){var r=this.readU32();if(r!==0){this.pushMapState(r),this.complete();continue e}else n={}}else if(e===196){var r=this.lookU8();n=this.decodeBinary(r,1)}else if(e===197){var r=this.lookU16();n=this.decodeBinary(r,2)}else if(e===198){var r=this.lookU32();n=this.decodeBinary(r,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){var r=this.lookU8();n=this.decodeExtension(r,1)}else if(e===200){var r=this.lookU16();n=this.decodeExtension(r,2)}else if(e===201){var r=this.lookU32();n=this.decodeExtension(r,4)}else throw new Cr("Unrecognized type byte: ".concat(Qv(e)));this.complete();for(var s=this.stack;s.length>0;){var o=s[s.length-1];if(o.type===FA)if(o.array[o.position]=n,o.position++,o.position===o.size)s.pop(),n=o.array;else continue e;else if(o.type===Sh){if(!i5(n))throw new Cr("The type of key must be string or number but "+typeof n);if(n==="__proto__")throw new Cr("The key __proto__ is not allowed");o.key=n,o.type=r5;continue e}else if(o.map[o.key]=n,o.readCount++,o.readCount===o.size)s.pop(),n=o.map;else{o.key=null,o.type=Sh;continue e}}return n}},t.prototype.readHeadByte=function(){return this.headByte===nd&&(this.headByte=this.readU8()),this.headByte},t.prototype.complete=function(){this.headByte=nd},t.prototype.readArraySize=function(){var e=this.readHeadByte();switch(e){case 220:return this.readU16();case 221:return this.readU32();default:{if(e<160)return e-144;throw new Cr("Unrecognized array type byte: ".concat(Qv(e)))}}},t.prototype.pushMapState=function(e){if(e>this.maxMapLength)throw new Cr("Max length exceeded: map length (".concat(e,") > maxMapLengthLength (").concat(this.maxMapLength,")"));this.stack.push({type:Sh,size:e,key:null,readCount:0,map:{}})},t.prototype.pushArrayState=function(e){if(e>this.maxArrayLength)throw new Cr("Max length exceeded: array length (".concat(e,") > maxArrayLength (").concat(this.maxArrayLength,")"));this.stack.push({type:FA,size:e,array:new Array(e),position:0})},t.prototype.decodeUtf8String=function(e,n){var r;if(e>this.maxStrLength)throw new Cr("Max length exceeded: UTF-8 byte length (".concat(e,") > maxStrLength (").concat(this.maxStrLength,")"));if(this.bytes.byteLength<this.pos+n+e)throw LA;var i=this.pos+n,s;return this.stateIsMapKey()&&(!((r=this.keyDecoder)===null||r===void 0)&&r.canBeCached(e))?s=this.keyDecoder.decode(this.bytes,i,e):s=OV(this.bytes,i,e),this.pos+=n+e,s},t.prototype.stateIsMapKey=function(){if(this.stack.length>0){var e=this.stack[this.stack.length-1];return e.type===Sh}return!1},t.prototype.decodeBinary=function(e,n){if(e>this.maxBinLength)throw new Cr("Max length exceeded: bin length (".concat(e,") > maxBinLength (").concat(this.maxBinLength,")"));if(!this.hasRemaining(e+n))throw LA;var r=this.pos+n,i=this.bytes.subarray(r,r+e);return this.pos+=n+e,i},t.prototype.decodeExtension=function(e,n){if(e>this.maxExtLength)throw new Cr("Max length exceeded: ext length (".concat(e,") > maxExtLength (").concat(this.maxExtLength,")"));var r=this.view.getInt8(this.pos+n),i=this.decodeBinary(e,n+1);return this.extensionCodec.decode(i,r,this.context)},t.prototype.lookU8=function(){return this.view.getUint8(this.pos)},t.prototype.lookU16=function(){return this.view.getUint16(this.pos)},t.prototype.lookU32=function(){return this.view.getUint32(this.pos)},t.prototype.readU8=function(){var e=this.view.getUint8(this.pos);return this.pos++,e},t.prototype.readI8=function(){var e=this.view.getInt8(this.pos);return this.pos++,e},t.prototype.readU16=function(){var e=this.view.getUint16(this.pos);return this.pos+=2,e},t.prototype.readI16=function(){var e=this.view.getInt16(this.pos);return this.pos+=2,e},t.prototype.readU32=function(){var e=this.view.getUint32(this.pos);return this.pos+=4,e},t.prototype.readI32=function(){var e=this.view.getInt32(this.pos);return this.pos+=4,e},t.prototype.readU64=function(){var e=LV(this.view,this.pos);return this.pos+=8,e},t.prototype.readI64=function(){var e=xA(this.view,this.pos);return this.pos+=8,e},t.prototype.readU64AsBigInt=function(){var e=this.view.getBigUint64(this.pos);return this.pos+=8,e},t.prototype.readI64AsBigInt=function(){var e=this.view.getBigInt64(this.pos);return this.pos+=8,e},t.prototype.readF32=function(){var e=this.view.getFloat32(this.pos);return this.pos+=4,e},t.prototype.readF64=function(){var e=this.view.getFloat64(this.pos);return this.pos+=8,e},t}();function c5(t,e){var n=new a5(e);return n.decode(t)}const u5=t=>typeof ArrayBuffer=="function"&&t instanceof ArrayBuffer||Object.prototype.toString.call(t)==="[object ArrayBuffer]",l5=(t,e=0,n=t.byteLength-e)=>{if(!u5(t))throw new TypeError(`The "input" argument must be ArrayBuffer. Received type ${typeof t} (${t})`);return am.from(t,e,n)},MA=(t,e)=>{if(typeof t!="string")throw new TypeError(`The "input" argument must be of type string. Received type ${typeof t} (${t})`);return e?am.from(t,e):am.from(t)},d5=/^[A-Za-z0-9+/]*={0,2}$/,f5=t=>{if(t.length*3%4!==0)throw new TypeError("Incorrect padding on base64 string.");if(!d5.exec(t))throw new TypeError("Invalid base64 string.");const e=MA(t,"base64");return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)},p5=t=>{const e=MA(t,"utf8");return new Uint8Array(e.buffer,e.byteOffset,e.byteLength/Uint8Array.BYTES_PER_ELEMENT)},h5=t=>{let e;if(typeof t=="string"?e=p5(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 l5(e.buffer,e.byteOffset,e.byteLength).toString("base64")},{getDocument:m5}=Ba;function g5({nodes:t,edges:e,...n}){return{...n,nodes:vc(t,({x:r,y:i,width:s,height:o,isCompound:a,...c})=>({...c,b:[r,i,s,o],c:a})),edges:vc(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:rx(n)?{direction:n}:n,nodes:vc(t,({b:i,c:s,...o})=>({x:i[0],y:i[1],width:i[2],height:i[3],isCompound:s,...o})),edges:vc(e,({p:i,cp:s,l:o,dp:a,...c})=>({...!!s&&{controlPoints:s},...!!o&&{labelBBox:o},...!!a&&{dotpos:a},...c,points:i}))}}const BA=500;function v5(t){const e=JV(g5(t)),n=h5(e),r=[];let i=0;for(;i<n.length;)r.push(" * "+n.slice(i,Math.min(i+BA,n.length))),i+=BA;return r.unshift("/**"," * @likec4-generated(v1)"),r.push(" */"),r.join(`
|
|
247
|
+
`)}function zA(t){return t.includes("@likec4-generated")}function w5(t){if(!zA(t))throw new Error(`Not a likec4-generated comment: ${t}`);const e=t.trim().split(`
|
|
248
|
+
`).filter(r=>!r.includes("**")&&!r.includes("@likec4-")&&!r.includes("*/")).map(r=>r.replaceAll("*","").trim()).join(""),n=f5(e);return y5(c5(n))}function nw(t){const e=$d(t.$cstNode,["BLOCK_COMMENT"]);if(!(!e||!zA(e.text)))try{return w5(e.text)}catch(n){const r=m5(t);xe.warn(n),xe.warn(`Ignoring manual layout of "${t.name??"unnamed"}" at ${r.uri.fsPath}:${1+(e.range.start.line||0)}`);return}}function b5(t){return class extends t{parseDeploymentView(e){const n=e.body;$e(n,"DynamicElementView body is not defined");const r=n.props.filter(this.isValid),i=this.getAstNodePath(e);let s=e.name;s||(s="deployment_"+ed(this.doc.uri.toString(),i));const o=Sr(r.find(d=>d.key==="title")?.value)??null,a=st(r.find(d=>d.key==="description")?.value)??null,c=this.convertTags(n),u=this.convertLinks(n);wh.writeId(e,s);const l=nw(e);return{__:"deployment",id:s,astPath:i,title:o,description:a,tags:c,links:Kn(u)?u:null,rules:n.rules.flatMap(d=>{try{return this.isValid(d)?this.parseDeploymentViewRule(d):[]}catch(f){return ye(f),[]}}),...l&&{manualLayout:l}}}parseDeploymentViewRule(e){if(Rv(e))return this.parseDeploymentViewRulePredicate(e);if(Il(e))return Hv(e);if(sH(e))return this.parseDeploymentViewRuleStyle(e);Ie(e)}parseDeploymentViewRulePredicate(e){const n=[];let r=e.expr;for(;r;){try{const i=r.value;if(Jt(i)&&this.isValid(i))switch(!0){case V9(i):n.unshift(this.parseFqnExpr(i));break;case Sk(i):n.unshift(this.parseRelationExpr(i));break;case yH(i):n.unshift(this.parseRelationWhereExpr(i));break;default:Ie(i)}}catch(i){ye(i)}r=r.prev}return e.isInclude?{include:n}:{exclude:n}}parseDeploymentViewRuleStyle(e){const n=e.props.filter(yv),r=e.props.find(Oo),i=st(r?.value);return{targets:this.parseFqnExpressions(e.targets),...i&&{notation:i},style:{...Ni(n,this.isValid)}}}}}function D5(t){let e;for(;e=t.value?.ref;){if($n(e))return null;if(Rr(e))return e;if(yt(t.parent))return null;t=t.parent}return null}const qA=({operator:t,not:e},n)=>t.startsWith("!=")?{neq:n}:t.startsWith("=")?{eq:n}:e?{neq:n}:{eq:n};function jA(t){return!nA(t)&&!rA(t)?null:t.participant}function Ho(t){switch(!0){case nH(t):{const e=t.value?.ref?.name,n=jA(t);$e(e,"Expected tag name");const r={tag:qA(t,e)};return n?{participant:n,operator:r}:r}case eH(t):{const e=t.value?.ref?.name,n=jA(t);$e(e,"Expected kind name");const r={kind:qA(t,e)};return n?{participant:n,operator:r}:r}case(Zk(t)||tA(t)):return{not:Ho(t.value)};case DH(t):{const e=Ho(t.left),n=Ho(t.right),r=t.operator.toLowerCase();switch(r){case"and":{const i=[Lb(e)?e.and:e,Lb(n)?n.and:n].flat();return $e(Kn(i),"Expected non-empty array"),{and:i}}case"or":{const i=[Fb(e)?e.or:e,Fb(n)?n.or:n].flat();return $e(Kn(i),"Expected non-empty array"),{or:i}}default:Ie(r)}}default:Ie(t)}}function E5(t){return class extends t{parseFqnRef(e){const n=rn(e.value.ref,`FqnRef is empty ${e.$cstNode?.range.start.line}:${e.$cstNode?.range.start.character}`);if(Fn(n)){const r=D5(e);if(!r)return{model:this.resolveFqn(n)};const i=this.resolveFqn(r),s=this.resolveFqn(n);return{deployment:i,element:s}}if($k(n))return{deployment:this.resolveFqn(n)};Ie(n)}parseFqnExpr(e){if(Ms(e))return{wildcard:!0};if(xv(e))return this.parseFqnRefExpr(e);Ie(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:"children"};default:return{ref:n}}}parseFqnExpressions(e){const n=[];let r=e;for(;r;){try{Jt(r.value)&&this.isValid(r.value)&&n.push(this.parseFqnExpr(r.value))}catch(i){ye(i)}r=r.prev}return n.reverse()}parseRelationWhereExpr(e){return{where:{expr:this.parseRelationExpr(e.subject),condition:e.where?Ho(e.where):{kind:{neq:"--always-true--"}}}}}parseRelationExpr(e){if(Mv(e),xk(e))return{source:this.parseFqnExpr(e.source.from),target:this.parseFqnExpr(e.target),isBidirectional:e.source.isBidirectional};if(dH(e))return{inout:this.parseFqnExpr(e.inout.to)};if(Kk(e))return{outgoing:this.parseFqnExpr(e.from)};if(Uk(e))return{incoming:this.parseFqnExpr(e.to)};Ie(e)}}}function R5(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 c=a.name;if(!ae(c))continue;if(c in n.predicates){xe.warn(`Global predicate named "${c}" is already defined`);continue}this.parseAndStoreGlobalPredicateGroupOrDynamic(a,c,n)}catch(c){ye(c)}const o=i.flatMap(a=>a.styles.filter(r));for(const a of o)try{const c=a.id.name;if(!ae(c))continue;if(c in n.styles){xe.warn(`Global style named "${c}" is already defined`);continue}const u=this.parseGlobalStyleOrGroup(a);u.length>0&&(n.styles[c]=u)}catch(c){ye(c)}}parseAndStoreGlobalPredicateGroupOrDynamic(e,n,r){if(jk(e)){const i=this.parseGlobalPredicateGroup(e);i.length>0&&(r.predicates[n]=i);return}if(qk(e)){const i=this.parseGlobalDynamicPredicateGroup(e);i.length>0&&(r.dynamicPredicates[n]=i);return}Ie(e)}parseGlobalPredicateGroup(e){return e.predicates.map(n=>this.parseViewRulePredicate(n))}parseGlobalDynamicPredicateGroup(e){return e.predicates.map(n=>this.parseDynamicViewIncludePredicate(n))}parseGlobalStyleOrGroup(e){if(Zu(e))return[this.parseViewRuleStyle(e)];if(el(e))return e.styles.map(n=>this.parseViewRuleStyle(n));Ie(e)}}}function T5(t){return class extends t{parseModel(){const e=this.doc;for(const n of AH(e))try{if(Fn(n)){e.c4Elements.push(this.parseElement(n));continue}if($r(n)){this.isValid(n)&&e.c4Relations.push(this.parseRelation(n));continue}Ie(n)}catch(r){ye(r)}}parseElement(e){const n=this.isValid,r=this.resolveFqn(e),i=rn(e.kind.ref,"Element kind is not resolved").name,s=this.parseTags(e.body),o=e.body?.props.find(Ii)?.props,a=Ni(o,n),c=this.getMetadata(e.body?.props.find(To)),u=this.getAstNodePath(e);let[l,d,f]=e.props??[];const p=Ye(e.body?.props??[],je(n),je(Vu),nr(E=>[E.key,E.value||void 0]));l=st(l??p.title),d=st(p.description??d),f=Sr(p.technology??f);const m=this.parseLinks(e.body),w=e.body?.props.find(Tr);if(w&&n(w)){const E=w.libicon?.ref?.name??w.value;ae(E)&&(a.icon=E)}return{id:r,kind:i,astPath:u,title:l??e.name,...c&&{metadata:c},...s&&{tags:s},...m&&Kn(m)&&{links:m},...ae(f)&&{technology:f},...ae(d)&&{description:d},style:a}}parseRelation(e){const n=this.isValid,r=PH(e),i=this.resolveFqn(r.target),s=this.resolveFqn(r.source),o=this.parseTags(e)??this.parseTags(e.body),a=this.parseLinks(e.body),c=e.kind?.ref?.name,u=this.getMetadata(e.body?.props.find(To)),l=this.getAstNodePath(e),d=nr(e.body?.props.filter(Sl).filter(y=>Jt(y.value))??[],y=>[y.key,y.value]),f=Ye(e.body?.props??[],je(Dl),un(y=>y.value.view.ref?.name),je(ae),vo()),p=st(e.title??d.title)??"",m=st(d.description),w=Sr(e.technology)??st(d.technology),E=e.body?.props.find(lh);return{id:ed(l,s,i),astPath:l,source:s,target:i,title:p,...u&&{metadata:u},...ae(w)&&{technology:w},...ae(m)&&{description:m},...c&&{kind:c},...o&&{tags:o},...Kn(a)&&{links:a},...Wv(E?.props,n),...f&&{navigateTo:f}}}}}function $5(t){return class extends t{parsePredicate(e){if(U9(e))return this.parseElementPredicate(e);if(Y9(e))return this.parseRelationPredicate(e);Ie(e)}parseElementPredicate(e){if(Wp(e))return this.parseElementPredicateWith(e);if(_v(e))return this.parseElementPredicateWhere(e);if(lv(e))return this.parseElementExpression(e);Ie(e)}parseElementExpressionsIterator(e){const n=[];let r=e;for(;r;){try{r.value&&n.unshift(this.parseElementExpression(r.value))}catch(i){ye(i)}r=r.prev}return n}parseElementExpression(e){if(Ms(e))return{wildcard:!0};if(Gp(e))return $e(e.kind?.ref,"ElementKindExpr kind is not resolved: "+e.$cstNode?.text),{elementKind:e.kind.ref.name,isEqual:e.isEqual};if(Hp(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(Lk(e)){const n=mn(e.expand);return $e(n,"Element not found "+e.expand.$cstNode?.text),{expanded:this.resolveFqn(n)}}if(Av(e)){const n=mn(e.parent);return $e(n,"Element not found "+e.parent.$cstNode?.text),{element:this.resolveFqn(n),isChildren:e.suffix===".*",isDescendants:e.suffix===".**"}}if(Wu(e)){const n=mn(e);return $e(n,"Element not found "+e.$cstNode?.text),{element:this.resolveFqn(n)}}Ie(e)}parseElementPredicateWhere(e){return{where:{expr:this.parseElementExpression(e.subject),condition:e.where?Ho(e.where):{kind:{neq:"--always-true--"}}}}}parseElementPredicateWith(e){const n=this.parseElementPredicate(e.subject);return(e.custom?.props??[]).reduce((r,i)=>{if(!this.isValid(i))return r;if(sh(i)){const s=i.value.view.$refText;return ae(s)&&(r.custom.navigateTo=s),r}if(Vu(i))return Ht(i.value)&&(r.custom[i.key]=st(i.value)||""),r;if(Tr(i)){const s=i.libicon?.ref?.name??i.value;return Ht(s)&&(r.custom[i.key]=s),r}if(Is(i)){const s=Ql(i);return Ht(s)&&(r.custom[i.key]=s),r}if(dh(i)||Op(i))return Ht(i.value)&&(r.custom[i.key]=i.value),r;if(oh(i))return Ht(i.value)&&(r.custom[i.key]=aA(i)),r;if(Oo(i))return ae(i.value)&&(r.custom[i.key]=st(i.value)),r;Ie(i)},{custom:{expr:n}})}parseRelationPredicate(e){if(Bv(e)){let n=Mv(e.subject)?this.parseRelationPredicateWhere(e.subject):this.parseRelationExpression(e.subject);return this.parseRelationPredicateWith(e,n)}if(Mv(e))return this.parseRelationPredicateWhere(e);if(mv(e))return this.parseRelationExpression(e);Ie(e)}parseRelationPredicateWhere(e){return{where:{expr:this.parseRelationExpression(e.subject),condition:e.where?Ho(e.where):{kind:{neq:"--always-true--"}}}}}parseRelationPredicateWith(e,n){return(e.custom?.props??[]).reduce((r,i)=>{if(Sl(i)||Oo(i)||Vk(i))return Ht(i.value)&&(r.customRelation[i.key]=st(i.value)??""),r;if(Au(i))return ae(i.value)&&(r.customRelation[i.key]=i.value),r;if(Is(i)){const s=Ql(i);return ae(s)&&(r.customRelation[i.key]=s),r}if(ul(i))return ae(i.value)&&(r.customRelation[i.key]=i.value),r;if(Dl(i)){const s=i.value.view.ref?.name;return ae(s)&&(r.customRelation.navigateTo=s),r}Ie(i)},{customRelation:{relation:n}})}parseRelationExpression(e){if($v(e))return{source:this.parseElementExpression(e.source.from),target:this.parseElementExpression(e.target),isBidirectional:e.source.isBidirectional};if(Fv(e))return{inout:this.parseElementExpression(e.inout.to)};if(Lv(e))return{outgoing:this.parseElementExpression(e.from)};if(Gk(e))return{incoming:this.parseElementExpression(e.to)};Ie(e)}}}function S5(t){return class extends t{parseSpecification(){const{parseResult:{value:{specifications:e}},c4Specification:n}=this.doc,r=this.isValid,i=e.flatMap(u=>u.elements.filter(this.isValid));for(const{kind:u,props:l}of i)try{const d=u.name;if(!ae(d))continue;if(d in n.elements){xe.warn(`Element kind "${d}" is already defined`);continue}const f=l.find(Ii),p=Ye(l.filter(zv)??[],je(m=>this.isValid(m)&&Jt(m.value)),nr(m=>[m.key,st(m.value)]));n.elements[d]={...p,style:{...Ni(f?.props,this.isValid)}}}catch(d){ye(d)}const s=e.flatMap(u=>u.relationships.filter(this.isValid));for(const{kind:u,props:l}of s)try{const d=u.name;if(!ae(d))continue;if(d in n.relationships){xe.warn(`Relationship kind "${d}" is already defined`);continue}const f=Ye(l.filter(Xk)??[],je(p=>this.isValid(p)&&Jt(p.value)),nr(p=>[p.key,st(p.value)]));n.relationships[d]={...f,...Wv(l,this.isValid)}}catch(d){ye(d)}const o=e.flatMap(u=>u.tags.filter(this.isValid));for(const u of o){const l=u.tag.name;ae(l)&&n.tags.add(l)}const a=e.flatMap(u=>u.deploymentNodes.filter(r));for(const u of a)try{Object.assign(n.deployments,this.parseSpecificationDeploymentNodeKind(u))}catch(l){ye(l)}const c=e.flatMap(u=>u.colors.filter(r));for(const{name:u,color:l}of c)try{const d=u.name;if(d in n.colors){xe.warn(`Custom color "${d}" is already defined`);continue}n.colors[d]={color:l}}catch(d){ye(d)}}parseSpecificationDeploymentNodeKind({kind:e,props:n}){const r=e.name;if(!ae(r))throw new Error("DeploymentNodeKind name is not resolved");const i=n.find(Ii),s=Ye(n.filter(zv)??[],je(o=>this.isValid(o)&&Jt(o.value)),nr(o=>[o.key,st(o.value)]));return{[r]:{...s,style:{...Ni(i?.props,this.isValid)}}}}}}function C5(t){return class extends t{parseViews(){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 ye(s),[]}});for(const i of n.views)try{if(!e(i))continue;switch(!0){case Vp(i):this.doc.c4Views.push(this.parseElementView(i,r));break;case Ok(i):this.doc.c4Views.push(this.parseDynamicElementView(i,r));break;case Ik(i):this.doc.c4Views.push(this.parseDeploymentView(i));break;default:Ie(i)}}catch(s){ye(s)}}}parseElementView(e,n){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=mn(e.viewOf),m=p&&this.resolveFqn(p);m?s=m:xe.warn("viewOf is not resolved: "+e.$cstNode?.text)}let o=e.name;o||(o="view_"+ed(this.doc.uri.toString(),i,s??""));const a=Sr(r.props.find(p=>p.key==="title")?.value)??null,c=st(r.props.find(p=>p.key==="description")?.value)??null,u=this.convertTags(r),l=this.convertLinks(r),d=nw(e),f={__:"element",id:o,astPath:i,title:a,description:c,tags:u,links:Kn(l)?l:null,rules:[...n,...r.rules.flatMap(p=>{try{return this.isValid(p)?this.parseViewRule(p):[]}catch(m){return ye(m),[]}})],...s&&{viewOf:s},...d&&{manualLayout:d}};if(wh.writeId(e,f.id),"extends"in e){const p=e.extends.view.ref;return $e(p?.name,"view extends is not resolved: "+e.$cstNode?.text),Object.assign(f,{extends:p.name})}return f}parseViewRule(e){if(_p(e))return this.parseViewRulePredicate(e);if(wH(e))return this.parseViewRuleGlobalPredicateRef(e);if(vv(e))return this.parseViewRuleStyleOrGlobalRef(e);if(Il(e))return Hv(e);if(yh(e))return this.parseViewRuleGroup(e);Ie(e)}parseViewRulePredicate(e){const n=[];let r=e.predicates;for(;r;){const{value:i,prev:s}=r;try{ae(i)&&this.isValid(i)&&n.unshift(this.parsePredicate(i))}catch(o){ye(o)}if(!s)break;r=s}return Nv(e)?{include:n}:{exclude:n}}parseViewRuleGlobalPredicateRef(e){return{predicateId:e.predicate.$refText}}parseViewRuleStyleOrGlobalRef(e){if(Ll(e))return this.parseViewRuleStyle(e);if(Qk(e))return this.parseViewRuleGlobalStyle(e);Ie(e)}parseViewRuleGroup(e){const n=[];for(const r of e.groupRules)try{if(!this.isValid(r))continue;if(_p(r)){n.push(this.parseViewRulePredicate(r));continue}if(yh(r)){n.push(this.parseViewRuleGroup(r));continue}Ie(r)}catch(i){ye(i)}return{title:Sr(e.title)??null,groupRules:n,...Ni(e.props,this.isValid)}}parseViewRuleStyle(e){const n=e.props.filter(yv),r=e.target,i=e.props.find(Oo);return this.parseRuleStyle(n,r,i)}parseRuleStyle(e,n,r){const i=Ni(e,this.isValid),s=st(r?.value);return{targets:this.parseElementExpressionsIterator(n),...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_"+ed(this.doc.uri.toString(),o));const c=Sr(s.find(p=>p.key==="title")?.value)??null,u=st(s.find(p=>p.key==="description")?.value)??null,l=this.convertTags(r),d=this.convertLinks(r);wh.writeId(e,a);const f=nw(e);return{__:"dynamic",id:a,astPath:o,title:c,description:u,tags:l,links:Kn(d)?d:null,rules:[...n,...r.rules.flatMap(p=>{try{return i(p)?this.parseDynamicViewRule(p):[]}catch(m){return ye(m),[]}},[])],steps:r.steps.reduce((p,m)=>{try{i(m)&&(Sv(m)?p.push(this.parseDynamicParallelSteps(m)):p.push(this.parseDynamicStep(m)))}catch(w){ye(w)}return p},[]),...f&&{manualLayout:f}}}parseDynamicViewRule(e){if(cH(e))return this.parseDynamicViewIncludePredicate(e);if(aH(e))return this.parseViewRuleGlobalPredicateRef(e);if(vv(e))return this.parseViewRuleStyleOrGlobalRef(e);if(Il(e))return Hv(e);Ie(e)}parseDynamicViewIncludePredicate(e){const n=[];let r=e.predicates;for(;r;){try{if(Jt(r.value)&&this.isValid(r.value)){const i=this.parseElementPredicate(r.value);n.unshift(i)}}catch(i){ye(i)}r=r.prev}return{include:n}}parseDynamicParallelSteps(e){return{__parallel:e.steps.map(n=>this.parseDynamicStep(n))}}parseDynamicStep(e){const n=mn(e.source);if(!n)throw new Error("Invalid reference to source");const r=mn(e.target);if(!r)throw new Error("Invalid reference to target");let i=this.resolveFqn(n),s=this.resolveFqn(r);const o=st(e.title)??null;let a={source:i,target:s,title:o};if(e.isBackward&&(a={source:s,target:i,title:o,isBackward:!0}),!R8(e.custom?.props))return a;for(const c of e.custom.props)try{switch(!0){case Dl(c):{const u=c.value.view.ref?.name;ae(u)&&(a.navigateTo=u);break}case Sl(c):case Oo(c):case Vk(c):{Ht(c.value)&&(a[c.key]=st(c.value)??"");break}case Au(c):{Ht(c.value)&&(a[c.key]=c.value);break}case Is(c):{const u=Ql(c);Ht(u)&&(a[c.key]=u);break}case ul(c):{Ht(c.value)&&(a[c.key]=c.value);break}default:Ie(c)}}catch(u){ye(u)}return a}}}const k5=Ye(EV,E5,T5,RV,b5,$5,S5,C5,R5);class A5 extends k5{}class _5{constructor(e){this.services=e}cachedParsers=new j7(e=>new A5(this.services,e));parse(e){$e(Gv(e),`Not a FqnIndexedDocument: ${e.uri.toString(!0)}`);try{e=Object.assign(e,{c4Specification:{tags:new Set,elements:{},relationships:{},colors:{},deployments:{}},c4Elements:[],c4Relations:[],c4Deployments:[],c4DeploymentRelations:[],c4Globals:{predicates:{},dynamicPredicates:{},styles:{}},c4Views:[]});const n=this.cachedParsers.get(e);return n.parseSpecification(),n.parseModel(),n.parseGlobals(),n.parseDeployment(),n.parseViews(),n.doc}catch(n){throw new Error(`Error parsing document ${e.uri.toString()}`,{cause:n})}}forDocument(e){return $e(Gv(e),`Not a FqnIndexedDocument: ${e.uri.toString(!0)}`),this.cachedParsers.get(e)}}const{findNodeForKeyword:P5,findNodeForProperty:Qse}=Gd,I5=(t,e,n=0)=>{const r=n>0?" ".repeat(n):"";return[r+`style ${t} {`,...Jf(e).map(([i,s])=>r+` ${i} ${i==="opacity"?s.toString()+"%":s}`),r+"}"]},x5=(t,e)=>n=>{if(!Ll(n))return!1;const r=n.target.value;if(!r||ae(n.target.prev)||!Wu(r))return!1;const i=r.el.ref;return(i?e.getFqn(i):null)===t};function O5(t,{view:e,viewAst:n,targets:r,style:i}){$e(n.body,`View ${e.id} has no body`);const s=n.$cstNode;$e(s,"viewCstNode");const o=wc(n.body.rules)?.$cstNode?.range.end??n.body.$cstNode?.range.end;$e(o,"insertPos is not defined");const a=s.range.start.character+2,c=t.likec4.FqnIndex,u=je(n.body.rules,Ll),l=e.__==="element"?e.viewOf:null,d=[],f=[];r.forEach(E=>{const y=UT(u,x5(E,c)),b=l&&im(l,E)?E.substring(l.length+1):E;y?d.push({fqn:b,rule:y}):f.push({fqn:b})});const p={start:o,end:o},m=E=>{E.start.line<=p.start.line&&(E.start.line==p.start.line?p.start.character=Math.min(E.start.character,p.start.character):p.start=E.start),E.end.line>=p.end.line&&(E.end.line==p.end.line?p.end.character=Math.max(E.end.character,p.end.character):p.end=E.end)},w=[];if(f.length>0){const E=f.flatMap(({fqn:y})=>I5(y,i,a));w.push(Tn.insert(o,`
|
|
249
|
+
`+E.join(`
|
|
250
|
+
`))),p.start={line:o.line+1,character:a},p.end={line:o.line+E.length,character:wc(E)?.length??0}}if(d.length>0)for(const{rule:E}of d){const y=E.$cstNode;$e(y,"RuleCstNode not found");for(const[b,R]of Jf(i)){const C=b==="opacity"?R.toString()+"%":R,A=E.props.find(J=>J.key===b);if(A&&A.$cstNode){const{range:{start:J,end:le}}=A.$cstNode;m({start:J,end:le}),w.push(Tn.replace({start:J,end:le},b+" "+C));continue}const q=P5(y,"{")?.range.end;$e(q,"Opening brace not found");const G=" ".repeat(2+y.range.start.character),Q=G+b+" "+C;w.push(Tn.insert(q,`
|
|
251
|
+
`+Q)),m({start:{line:q.line+1,character:G.length},end:{line:q.line+1,character:Q.length}})}}return{modifiedRange:p,edits:w}}const{findNodeForProperty:Zse,findNodeForKeyword:N5}=Gd;function F5(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=xH(r.direction),o=UT(n.body.rules,Il);let a=`autoLayout ${s}`;if(Yf(r.rankSep)&&(a+=` ${r.rankSep}`,Yf(r.nodeSep)&&(a+=` ${r.nodeSep}`)),o&&o.$cstNode)return Tn.replace(o.$cstNode.range,a);const c=N5(n.body.$cstNode,"}")?.range.start;$e(c,"Closing brace not found");const u=` ${a}
|
|
252
|
+
`;return Tn.insert(c,u)}function L5(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===0)return t;const s=i?/^/gm:/^(?!\s*$)/gm;return t.replace(s,r.repeat(e))}function M5(t,{viewAst:e,layout:n}){$e(e.$cstNode,"invalid view.$cstNode");const r=$d(e.$cstNode,["BLOCK_COMMENT"]);let i=v5(n);return e.$cstNode.range.start.character>0&&(i=L5(i,e.$cstNode.range.start.character)),r?Tn.replace(r.range,i.trimStart()):Tn.insert({line:e.$cstNode.range.start.line,character:0},i+`
|
|
253
|
+
`)}class B5{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 c=await n.workspace.applyEdit({label:`LikeC4 - change view ${e.viewId}`,edit:{changes:{[a.uri]:s}}});if(!c.applied){n.window.showErrorMessage(`Failed to apply changes ${c.failureReason}`);return}r={uri:a.uri,range:o}})}catch(i){Ct.error(`Failed to apply change ${e.change.op} ${e.viewId}`,i)}return r}convertToTextEdit({viewId:e,change:n}){const r=this.locator.locateViewAst(e);if(!r)throw new Error(`LikeC4ModelChanges: view not found: ${e}`);switch(n.op){case"change-element-style":return{doc:r.doc,...O5(this.services,{...r,targets:n.targets,style:n.style})};case"change-autolayout":{const s=F5(this.services,{...r,layout:n.layout});return{doc:r.doc,modifiedRange:s.range,edits:[s]}}case"save-manual-layout":const i=M5(this.services,{...r,layout:n.layout});return{doc:r.doc,modifiedRange:i.range,edits:[i]};default:Ie(n)}}}class z5 extends uT{constructor(e){super(),this.services=e}getNameStrict(e){return rn(this.getName(e),`Failed getName for ${this.services.workspace.AstNodeLocator.getAstNodePath(e)}`)}getName(e){if(Uf(e))return e.name;if(Rr(e))return e.element.el.$refText}getNameNode(e){if(Uf(e))return super.getNameNode(e);if(Rr(e))return e.element.el.$refNode}}function q5(t){return Ye(t,gs(e=>`${e.type}.${e.name}`),Jf(),Di(([e,n])=>n.length===1?n:[]))}class j5 extends dT{constructor(e){super(e)}async computeExports(e,n){const r=[];try{const{specifications:i,models:s,views:o,globals:a,likec4lib:c,deployments:u}=e.parseResult.value;this.exportLibrary(c,r,e),this.exportSpecification(i,r,e),this.exportModel(s,r,e),this.exportViews(o,r,e),this.exportGlobals(a,r,e),this.exportDeployments(u,r,e)}catch(i){ye(i)}return r}exportViews(e,n,r){const i=e?.flatMap(s=>s.views);if(!(yt(i)||i.length===0))for(const s of i)try{ae(s.name)&&n.push(this.descriptions.createDescription(s,s.name,r))}catch(o){ye(o)}}exportGlobals(e,n,r){if(!(yt(e)||e.length===0)){for(const i of e.flatMap(s=>s.predicates))try{const s=i;ae(s.name)&&n.push(this.descriptions.createDescription(s,s.name,r))}catch(s){ye(s)}for(const i of e.flatMap(s=>s.styles))try{const s=i.id;ae(s.name)&&n.push(this.descriptions.createDescription(s,s.name,r))}catch(s){ye(s)}}}exportModel(e,n,r){if(!(yt(e)||e.length===0))for(const i of e.flatMap(s=>s.elements))try{Fn(i)&&ae(i.name)&&n.push(this.descriptions.createDescription(i,i.name,r))}catch(s){ye(s)}}exportLibrary(e,n,r){if(!yt(e))try{for(const i of e.flatMap(s=>s.icons))n.push(this.descriptions.createDescription(i,i.name,r))}catch(i){ye(i)}}exportSpecification(e,n,r){if(!(yt(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 hh(i):case Lo(i):{ae(i.kind.name)&&n.push(this.descriptions.createDescription(i.kind,i.kind.name,r));continue}case mh(i):{ae(i.tag.name)&&n.push(this.descriptions.createDescription(i.tag,"#"+i.tag.name,r));continue}case Bo(i):{ae(i.kind.name)&&n.push(this.descriptions.createDescription(i.kind,i.kind.name,r),this.descriptions.createDescription(i.kind,"."+i.kind.name,r));continue}case ph(i):{ae(i.name.name)&&n.push(this.descriptions.createDescription(i.name,i.name.name,r));continue}default:Ie(i)}}catch(s){ye(s)}}exportDeployments(e,n,r){const i=e?.flatMap(s=>s.elements);if(!(yt(i)||i.length===0))for(const s of i)try{$n(s)&&ae(s.name)&&n.push(this.descriptions.createDescription(s,s.name,r))}catch(o){ye(o)}}computeLocalScopes(e,n){return new Promise(r=>{const i=e.parseResult.value,s=[],o=new Pn;for(const a of i.models)try{s.push(...this.processContainer(a,o,e))}catch(c){ye(c)}for(const a of i.deployments)try{s.push(...this.processDeployments(a,o,e))}catch(c){ye(c)}q5(s).forEach(a=>{o.add(i,a)}),r(o)})}processContainer(e,n,r){const i=new Pn,s=[];for(const a of e.elements){if($r(a))continue;let c;if(Fn(a)?(ae(a.name)&&i.add(a.name,this.descriptions.createDescription(a,a.name,r)),c=a.body):ko(a)&&(c=a.body),c&&c.elements.length>0)try{s.push(...this.processContainer(c,n,r))}catch(u){ye(u)}}s.length&&Ye(s,je(a=>!i.has(a.name)),gs(a=>a.name),Xf((a,c)=>{a.length===1&&i.add(c,a[0])}));const o=[...i.values()];return n.addAll(e,o),o}processDeployments(e,n,r){const i=new Set,s=[];for(const o of e.elements){if(Ns(o))continue;let a=this.nameProvider.getName(o);if(ae(a)){const c=this.descriptions.createDescription(o,a,r);n.add(e,c),i.add(c.name)}if($n(o)&&o.body)try{s.push(...this.processDeployments(o.body,n,r))}catch(c){ye(c)}}return s.length>0&&Ye(s,je(o=>!i.has(o.name)),gs(o=>o.name),Xf((o,a)=>{o.length===1&&n.add(e,o[0])})),[...n.get(e).values()]}}const{getDocument:U5}=Ba;class G5 extends gT{deploymentsIndex;fqnIndex;constructor(e){super(e),this.fqnIndex=e.likec4.FqnIndex,this.deploymentsIndex=e.likec4.DeploymentsIndex}directChildrenOf(e){return this.fqnIndex.directChildrenOf(e)}uniqueDescedants(e){return new Pt(()=>{const n=e(),r=n&&this.fqnIndex.getFqn(n);return r?this.fqnIndex.uniqueDescedants(r).iterator():null},n=>n?n.next():Kt)}scopeElementRef(e){return this.uniqueDescedants(()=>e.el.ref)}scopeExtendElement({element:e}){return et([e.el.$nodeDescription]).nonNullable().concat(this.uniqueDescedants(()=>mn(e)))}scopeElementView({viewOf:e,extends:n}){return e?et([e.el.$nodeDescription]).nonNullable().concat(this.uniqueDescedants(()=>mn(e))):n?et([n]).flatMap(r=>{const i=r.view.ref;return i?this.scopeElementView(i):Js}):Js}getScope(e){try{const n=this.reflection.getReferenceType(e);try{const r=e.container;if(zk(r))return this.getScopeForFqnRef(r,e);if(n!==Hn)return this.getGlobalScope(n,e);if(Bk(r)&&e.property==="el"){const i=r.parent;return i?new ps(this.directChildrenOf(vh(i))):this.getGlobalScope(n,e)}if(Wu(r)&&e.property==="el"){const i=r.parent;if(i)return new ps(this.scopeElementRef(i));if(e.reference.$refText==="this"||e.reference.$refText==="it"){const s=Xt(r,Fn);return s?new fT([this.descriptions.createDescription(s,e.reference.$refText)]):Gf}}return this.computeScope(e)}catch(r){return xe.warn(r),this.getGlobalScope(n,e)}}catch(n){return xe.warn(n),Gf}}getScopeForFqnRef(e,n){const r=e.parent;if(!r)return this.createScope(this.computeScope(n,Pi).getAllElements(),this.createScope(this.computeScope(n,_i).getAllElements(),pi(e,Ik)?this.computeScope(n,Hn):Gf));const i=r.value.ref;return i?$n(i)?new ps(this.deploymentsIndex.nested(i)):Rr(i)?new ps(this.scopeElementRef(i.element)):Fn(i)?new ps(this.uniqueDescedants(()=>i)):Ie(i):Gf}computeScope(e,n=this.reflection.getReferenceType(e)){const r=this.reflection.isSubtype(n,Hn),i=[],s=U5(e.container).precomputedScopes;if(!s)return this.getGlobalScope(n,e);const o=c=>this.reflection.isSubtype(c.type,n);let a=e.container;for(;a;){const c=s.get(a).filter(o);c.length>0&&i.push(et(c)),r&&Mk(a)&&i.push(this.scopeExtendElement(a.$container)),r&&Fk(a)&&i.push(this.scopeElementView(a.$container)),a=a.$container}return i.reduceRight((c,u)=>this.createScope(u,c),this.getGlobalScope(n,e))}}const W5=`likec4lib { icons {
|
|
254
|
+
aws:activate
|
|
255
|
+
aws:alexa-for-business
|
|
256
|
+
aws:amplify
|
|
257
|
+
aws:apache-mxnet-on-aws
|
|
258
|
+
aws:api-gateway
|
|
259
|
+
aws:app-config
|
|
260
|
+
aws:app-flow
|
|
261
|
+
aws:app-mesh
|
|
262
|
+
aws:app-runner
|
|
263
|
+
aws:app-stream
|
|
264
|
+
aws:app-sync
|
|
265
|
+
aws:application-auto-scaling
|
|
266
|
+
aws:application-composer
|
|
267
|
+
aws:application-cost-profiler
|
|
268
|
+
aws:application-discovery-service
|
|
269
|
+
aws:application-migration-service
|
|
270
|
+
aws:artifact
|
|
271
|
+
aws:athena
|
|
272
|
+
aws:audit-manager
|
|
273
|
+
aws:augmented-ai-a2i
|
|
274
|
+
aws:aurora
|
|
275
|
+
aws:auto-scaling
|
|
276
|
+
aws:backint-agent
|
|
277
|
+
aws:backup
|
|
278
|
+
aws:batch
|
|
279
|
+
aws:billing-conductor
|
|
280
|
+
aws:bottlerocket
|
|
281
|
+
aws:braket
|
|
282
|
+
aws:budgets
|
|
283
|
+
aws:certificate-manager
|
|
284
|
+
aws:chatbot
|
|
285
|
+
aws:chime
|
|
286
|
+
aws:chime-sdk
|
|
287
|
+
aws:chime-voice-connector
|
|
288
|
+
aws:clean-rooms
|
|
289
|
+
aws:client-vpn
|
|
290
|
+
aws:cloud-control-api
|
|
291
|
+
aws:cloud-development-kit
|
|
292
|
+
aws:cloud-directory
|
|
293
|
+
aws:cloud-formation
|
|
294
|
+
aws:cloud-front
|
|
295
|
+
aws:cloud-hsm
|
|
296
|
+
aws:cloud-map
|
|
297
|
+
aws:cloud-search
|
|
298
|
+
aws:cloud-shell
|
|
299
|
+
aws:cloud-trail
|
|
300
|
+
aws:cloud-wan
|
|
301
|
+
aws:cloud-watch
|
|
302
|
+
aws:cloud9
|
|
303
|
+
aws:code-artifact
|
|
304
|
+
aws:code-build
|
|
305
|
+
aws:code-catalyst
|
|
306
|
+
aws:code-commit
|
|
307
|
+
aws:code-deploy
|
|
308
|
+
aws:code-guru
|
|
309
|
+
aws:code-pipeline
|
|
310
|
+
aws:code-star
|
|
311
|
+
aws:code-whisperer
|
|
312
|
+
aws:cognito
|
|
313
|
+
aws:command-line-interface
|
|
314
|
+
aws:comprehend
|
|
315
|
+
aws:comprehend-medical
|
|
316
|
+
aws:compute-optimizer
|
|
317
|
+
aws:config
|
|
318
|
+
aws:connect
|
|
319
|
+
aws:console-mobile-application
|
|
320
|
+
aws:control-tower
|
|
321
|
+
aws:corretto
|
|
322
|
+
aws:cost-and-usage-report
|
|
323
|
+
aws:cost-explorer
|
|
324
|
+
aws:data-exchange
|
|
325
|
+
aws:data-pipeline
|
|
326
|
+
aws:data-sync
|
|
327
|
+
aws:data-zone
|
|
328
|
+
aws:database-migration-service
|
|
329
|
+
aws:deep-composer
|
|
330
|
+
aws:deep-learning-amis
|
|
331
|
+
aws:deep-learning-containers
|
|
332
|
+
aws:deep-lens
|
|
333
|
+
aws:deep-racer
|
|
334
|
+
aws:detective
|
|
335
|
+
aws:dev-ops-guru
|
|
336
|
+
aws:device-farm
|
|
337
|
+
aws:direct-connect
|
|
338
|
+
aws:directory-service
|
|
339
|
+
aws:distro-for-open-telemetry
|
|
340
|
+
aws:document-db
|
|
341
|
+
aws:dynamo-db
|
|
342
|
+
aws:ec2
|
|
343
|
+
aws:ec2-auto-scaling
|
|
344
|
+
aws:ec2-image-builder
|
|
345
|
+
aws:ecs-anywhere
|
|
346
|
+
aws:efs
|
|
347
|
+
aws:eks-anywhere
|
|
348
|
+
aws:eks-cloud
|
|
349
|
+
aws:eks-distro
|
|
350
|
+
aws:elasti-cache
|
|
351
|
+
aws:elastic-beanstalk
|
|
352
|
+
aws:elastic-block-store
|
|
353
|
+
aws:elastic-container-registry
|
|
354
|
+
aws:elastic-container-service
|
|
355
|
+
aws:elastic-disaster-recovery
|
|
356
|
+
aws:elastic-fabric-adapter
|
|
357
|
+
aws:elastic-inference
|
|
358
|
+
aws:elastic-kubernetes-service
|
|
359
|
+
aws:elastic-load-balancing
|
|
360
|
+
aws:elastic-transcoder
|
|
361
|
+
aws:elemental-appliances-software
|
|
362
|
+
aws:elemental-conductor
|
|
363
|
+
aws:elemental-delta
|
|
364
|
+
aws:elemental-link
|
|
365
|
+
aws:elemental-live
|
|
366
|
+
aws:elemental-media-connect
|
|
367
|
+
aws:elemental-media-convert
|
|
368
|
+
aws:elemental-media-live
|
|
369
|
+
aws:elemental-media-package
|
|
370
|
+
aws:elemental-media-store
|
|
371
|
+
aws:elemental-media-tailor
|
|
372
|
+
aws:elemental-server
|
|
373
|
+
aws:emr
|
|
374
|
+
aws:event-bridge
|
|
375
|
+
aws:express-workflows
|
|
376
|
+
aws:fargate
|
|
377
|
+
aws:fault-injection-simulator
|
|
378
|
+
aws:file-cache
|
|
379
|
+
aws:fin-space
|
|
380
|
+
aws:firewall-manager
|
|
381
|
+
aws:forecast
|
|
382
|
+
aws:fraud-detector
|
|
383
|
+
aws:free-rtos
|
|
384
|
+
aws:fsx
|
|
385
|
+
aws:fsx-for-lustre
|
|
386
|
+
aws:fsx-for-net-app-ontap
|
|
387
|
+
aws:fsx-for-open-zfs
|
|
388
|
+
aws:fsx-for-wfs
|
|
389
|
+
aws:game-kit
|
|
390
|
+
aws:game-lift
|
|
391
|
+
aws:game-sparks
|
|
392
|
+
aws:genomics-cli
|
|
393
|
+
aws:global-accelerator
|
|
394
|
+
aws:glue
|
|
395
|
+
aws:glue-data-brew
|
|
396
|
+
aws:glue-elastic-views
|
|
397
|
+
aws:ground-station
|
|
398
|
+
aws:guard-duty
|
|
399
|
+
aws:health-lake
|
|
400
|
+
aws:honeycode
|
|
401
|
+
aws:iam-identity-center
|
|
402
|
+
aws:identity-and-access-management
|
|
403
|
+
aws:inspector
|
|
404
|
+
aws:interactive-video-service
|
|
405
|
+
aws:io-t-1-click
|
|
406
|
+
aws:io-t-analytics
|
|
407
|
+
aws:io-t-button
|
|
408
|
+
aws:io-t-core
|
|
409
|
+
aws:io-t-device-defender
|
|
410
|
+
aws:io-t-device-management
|
|
411
|
+
aws:io-t-edu-kit
|
|
412
|
+
aws:io-t-events
|
|
413
|
+
aws:io-t-express-link
|
|
414
|
+
aws:io-t-fleet-wise
|
|
415
|
+
aws:io-t-greengrass
|
|
416
|
+
aws:io-t-robo-runner
|
|
417
|
+
aws:io-t-site-wise
|
|
418
|
+
aws:io-t-things-graph
|
|
419
|
+
aws:io-t-twin-maker
|
|
420
|
+
aws:iq
|
|
421
|
+
aws:kendra
|
|
422
|
+
aws:key-management-service
|
|
423
|
+
aws:keyspaces
|
|
424
|
+
aws:kinesis
|
|
425
|
+
aws:kinesis-data-analytics
|
|
426
|
+
aws:kinesis-data-streams
|
|
427
|
+
aws:kinesis-firehose
|
|
428
|
+
aws:kinesis-video-streams
|
|
429
|
+
aws:lake-formation
|
|
430
|
+
aws:lambda
|
|
431
|
+
aws:launch-wizard
|
|
432
|
+
aws:lex
|
|
433
|
+
aws:license-manager
|
|
434
|
+
aws:lightsail
|
|
435
|
+
aws:local-zones
|
|
436
|
+
aws:location-service
|
|
437
|
+
aws:lookout-for-equipment
|
|
438
|
+
aws:lookout-for-metrics
|
|
439
|
+
aws:lookout-for-vision
|
|
440
|
+
aws:lumberyard
|
|
441
|
+
aws:macie
|
|
442
|
+
aws:mainframe-modernization
|
|
443
|
+
aws:managed-blockchain
|
|
444
|
+
aws:managed-grafana
|
|
445
|
+
aws:managed-service-for-prometheus
|
|
446
|
+
aws:managed-services
|
|
447
|
+
aws:managed-streaming-for-apache-kafka
|
|
448
|
+
aws:managed-workflows-for-apache-airflow
|
|
449
|
+
aws:management-console
|
|
450
|
+
aws:marketplace-dark
|
|
451
|
+
aws:marketplace-light
|
|
452
|
+
aws:memory-db-for-redis
|
|
453
|
+
aws:migration-evaluator
|
|
454
|
+
aws:migration-hub
|
|
455
|
+
aws:monitron
|
|
456
|
+
aws:mq
|
|
457
|
+
aws:neptune
|
|
458
|
+
aws:network-firewall
|
|
459
|
+
aws:neuron
|
|
460
|
+
aws:nice-dcv
|
|
461
|
+
aws:nice-engin-frame
|
|
462
|
+
aws:nimble-studio
|
|
463
|
+
aws:nitro-enclaves
|
|
464
|
+
aws:omics
|
|
465
|
+
aws:open-3d-engine
|
|
466
|
+
aws:open-search-service
|
|
467
|
+
aws:ops-works
|
|
468
|
+
aws:organizations
|
|
469
|
+
aws:outposts-family
|
|
470
|
+
aws:outposts-rack
|
|
471
|
+
aws:outposts-servers
|
|
472
|
+
aws:panorama
|
|
473
|
+
aws:parallel-cluster
|
|
474
|
+
aws:personal-health-dashboard
|
|
475
|
+
aws:personalize
|
|
476
|
+
aws:pinpoint
|
|
477
|
+
aws:pinpoint-apis
|
|
478
|
+
aws:polly
|
|
479
|
+
aws:private-5g
|
|
480
|
+
aws:private-certificate-authority
|
|
481
|
+
aws:private-link
|
|
482
|
+
aws:professional-services
|
|
483
|
+
aws:proton
|
|
484
|
+
aws:quantum-ledger-database
|
|
485
|
+
aws:quick-sight
|
|
486
|
+
aws:rds
|
|
487
|
+
aws:rds-on-vmware
|
|
488
|
+
aws:re-post
|
|
489
|
+
aws:red-hat-open-shift-service-on-aws
|
|
490
|
+
aws:redshift
|
|
491
|
+
aws:rekognition
|
|
492
|
+
aws:reserved-instance-reporting
|
|
493
|
+
aws:resilience-hub
|
|
494
|
+
aws:resource-access-manager
|
|
495
|
+
aws:resource-explorer
|
|
496
|
+
aws:robo-maker
|
|
497
|
+
aws:route-53
|
|
498
|
+
aws:s3-on-outposts
|
|
499
|
+
aws:sage-maker
|
|
500
|
+
aws:sage-maker-ground-truth
|
|
501
|
+
aws:sage-maker-studio-lab
|
|
502
|
+
aws:savings-plans
|
|
503
|
+
aws:secrets-manager
|
|
504
|
+
aws:security-hub
|
|
505
|
+
aws:security-lake
|
|
506
|
+
aws:server-migration-service
|
|
507
|
+
aws:serverless-application-repository
|
|
508
|
+
aws:service-catalog
|
|
509
|
+
aws:service-management-connector
|
|
510
|
+
aws:shield
|
|
511
|
+
aws:signer
|
|
512
|
+
aws:sim-space-weaver
|
|
513
|
+
aws:simple-email-service
|
|
514
|
+
aws:simple-notification-service
|
|
515
|
+
aws:simple-queue-service
|
|
516
|
+
aws:simple-storage-service
|
|
517
|
+
aws:simple-storage-service-glacier
|
|
518
|
+
aws:site-to-site-vpn
|
|
519
|
+
aws:snowball
|
|
520
|
+
aws:snowball-edge
|
|
521
|
+
aws:snowcone
|
|
522
|
+
aws:snowmobile
|
|
523
|
+
aws:step-functions
|
|
524
|
+
aws:storage-gateway
|
|
525
|
+
aws:sumerian
|
|
526
|
+
aws:supply-chain
|
|
527
|
+
aws:support
|
|
528
|
+
aws:systems-manager
|
|
529
|
+
aws:tensor-flow-on-aws
|
|
530
|
+
aws:textract
|
|
531
|
+
aws:thinkbox-deadline
|
|
532
|
+
aws:thinkbox-frost
|
|
533
|
+
aws:thinkbox-krakatoa
|
|
534
|
+
aws:thinkbox-sequoia
|
|
535
|
+
aws:thinkbox-stoke
|
|
536
|
+
aws:thinkbox-xmesh
|
|
537
|
+
aws:timestream
|
|
538
|
+
aws:tools-and-sdks
|
|
539
|
+
aws:torch-serve
|
|
540
|
+
aws:training-certification
|
|
541
|
+
aws:transcribe
|
|
542
|
+
aws:transfer-family
|
|
543
|
+
aws:transit-gateway
|
|
544
|
+
aws:translate
|
|
545
|
+
aws:trusted-advisor
|
|
546
|
+
aws:verified-access
|
|
547
|
+
aws:verified-permissions
|
|
548
|
+
aws:virtual-private-cloud
|
|
549
|
+
aws:vmware-cloud-on-aws
|
|
550
|
+
aws:vpc-lattice
|
|
551
|
+
aws:waf
|
|
552
|
+
aws:wavelength
|
|
553
|
+
aws:well-architected-tool
|
|
554
|
+
aws:wickr
|
|
555
|
+
aws:work-docs
|
|
556
|
+
aws:work-docs-sdk
|
|
557
|
+
aws:work-link
|
|
558
|
+
aws:work-mail
|
|
559
|
+
aws:work-spaces-family
|
|
560
|
+
aws:x-ray
|
|
561
|
+
azure:abs-member
|
|
562
|
+
azure:active-directory-connect-health
|
|
563
|
+
azure:activity-log
|
|
564
|
+
azure:administrative-units
|
|
565
|
+
azure:advisor
|
|
566
|
+
azure:ai-studio
|
|
567
|
+
azure:aks-automatic
|
|
568
|
+
azure:aks-istio
|
|
569
|
+
azure:alerts
|
|
570
|
+
azure:all-resources
|
|
571
|
+
azure:analysis-services
|
|
572
|
+
azure:anomaly-detector
|
|
573
|
+
azure:api-center
|
|
574
|
+
azure:api-connections
|
|
575
|
+
azure:api-management-services
|
|
576
|
+
azure:api-proxy
|
|
577
|
+
azure:app-compliance-automation
|
|
578
|
+
azure:app-configuration
|
|
579
|
+
azure:app-registrations
|
|
580
|
+
azure:app-service-certificates
|
|
581
|
+
azure:app-service-domains
|
|
582
|
+
azure:app-service-environments
|
|
583
|
+
azure:app-service-plans
|
|
584
|
+
azure:app-services
|
|
585
|
+
azure:app-space
|
|
586
|
+
azure:app-space-component
|
|
587
|
+
azure:applens
|
|
588
|
+
azure:application-gateway-containers
|
|
589
|
+
azure:application-gateways
|
|
590
|
+
azure:application-group
|
|
591
|
+
azure:application-insights
|
|
592
|
+
azure:application-security-groups
|
|
593
|
+
azure:aquila
|
|
594
|
+
azure:arc-data-services
|
|
595
|
+
azure:arc-kubernetes
|
|
596
|
+
azure:arc-machines
|
|
597
|
+
azure:arc-sql-managed-instance
|
|
598
|
+
azure:arc-sql-server
|
|
599
|
+
azure:atm-multistack
|
|
600
|
+
azure:auto-scale
|
|
601
|
+
azure:automanaged-vm
|
|
602
|
+
azure:automation-accounts
|
|
603
|
+
azure:availability-sets
|
|
604
|
+
azure:avs-vm
|
|
605
|
+
azure:azure-a
|
|
606
|
+
azure:azure-ad-b2c
|
|
607
|
+
azure:azure-api-for-fhir
|
|
608
|
+
azure:azure-applied-ai-services
|
|
609
|
+
azure:azure-arc
|
|
610
|
+
azure:azure-attestation
|
|
611
|
+
azure:azure-backup-center
|
|
612
|
+
azure:azure-blockchain-service
|
|
613
|
+
azure:azure-center-for-sap
|
|
614
|
+
azure:azure-chaos-studio
|
|
615
|
+
azure:azure-cloud-shell
|
|
616
|
+
azure:azure-communication-services
|
|
617
|
+
azure:azure-communications-gateway
|
|
618
|
+
azure:azure-compute-galleries
|
|
619
|
+
azure:azure-cosmos-db
|
|
620
|
+
azure:azure-data-catalog
|
|
621
|
+
azure:azure-data-explorer-clusters
|
|
622
|
+
azure:azure-database-maria-db-server
|
|
623
|
+
azure:azure-database-migration-services
|
|
624
|
+
azure:azure-database-my-sql-server
|
|
625
|
+
azure:azure-database-postgre-sql-server
|
|
626
|
+
azure:azure-database-postgre-sql-server-group
|
|
627
|
+
azure:azure-databox-gateway
|
|
628
|
+
azure:azure-databricks
|
|
629
|
+
azure:azure-deployment-environments
|
|
630
|
+
azure:azure-dev-ops
|
|
631
|
+
azure:azure-dev-tunnels
|
|
632
|
+
azure:azure-edge-hardware-center
|
|
633
|
+
azure:azure-experimentation-studio
|
|
634
|
+
azure:azure-fileshares
|
|
635
|
+
azure:azure-firewall-manager
|
|
636
|
+
azure:azure-firewall-policy
|
|
637
|
+
azure:azure-hcp-cache
|
|
638
|
+
azure:azure-hpc-workbenches
|
|
639
|
+
azure:azure-hybrid-center
|
|
640
|
+
azure:azure-information-protection
|
|
641
|
+
azure:azure-io-t-operations
|
|
642
|
+
azure:azure-lighthouse
|
|
643
|
+
azure:azure-load-testing
|
|
644
|
+
azure:azure-managed-grafana
|
|
645
|
+
azure:azure-maps-accounts
|
|
646
|
+
azure:azure-media-service
|
|
647
|
+
azure:azure-migrate
|
|
648
|
+
azure:azure-monitor-dashboard
|
|
649
|
+
azure:azure-monitor-pipeline
|
|
650
|
+
azure:azure-monitors-for-sap-solutions
|
|
651
|
+
azure:azure-net-app-files
|
|
652
|
+
azure:azure-network-function-manager
|
|
653
|
+
azure:azure-network-function-manager-functions
|
|
654
|
+
azure:azure-object-understanding
|
|
655
|
+
azure:azure-open-ai
|
|
656
|
+
azure:azure-operator-5g-core
|
|
657
|
+
azure:azure-operator-insights
|
|
658
|
+
azure:azure-operator-nexus
|
|
659
|
+
azure:azure-operator-service-manager
|
|
660
|
+
azure:azure-orbital
|
|
661
|
+
azure:azure-programmable-connectivity
|
|
662
|
+
azure:azure-purview-accounts
|
|
663
|
+
azure:azure-quotas
|
|
664
|
+
azure:azure-red-hat-open-shift
|
|
665
|
+
azure:azure-sentinel
|
|
666
|
+
azure:azure-service-bus
|
|
667
|
+
azure:azure-sphere
|
|
668
|
+
azure:azure-spring-apps
|
|
669
|
+
azure:azure-sql
|
|
670
|
+
azure:azure-sql-edge
|
|
671
|
+
azure:azure-sql-server-stretch-databases
|
|
672
|
+
azure:azure-sql-vm
|
|
673
|
+
azure:azure-stack
|
|
674
|
+
azure:azure-stack-edge
|
|
675
|
+
azure:azure-stack-hci-sizer
|
|
676
|
+
azure:azure-storage-mover
|
|
677
|
+
azure:azure-support-center-blue
|
|
678
|
+
azure:azure-sustainability
|
|
679
|
+
azure:azure-synapse-analytics
|
|
680
|
+
azure:azure-token-service
|
|
681
|
+
azure:azure-video-indexer
|
|
682
|
+
azure:azure-virtual-desktop
|
|
683
|
+
azure:azure-vmware-solution
|
|
684
|
+
azure:azure-workbooks
|
|
685
|
+
azure:azurite
|
|
686
|
+
azure:backlog
|
|
687
|
+
azure:backup-vault
|
|
688
|
+
azure:bare-metal-infrastructure
|
|
689
|
+
azure:bastions
|
|
690
|
+
azure:batch-accounts
|
|
691
|
+
azure:batch-ai
|
|
692
|
+
azure:biz-talk
|
|
693
|
+
azure:blob-block
|
|
694
|
+
azure:blob-page
|
|
695
|
+
azure:blockchain-applications
|
|
696
|
+
azure:blueprints
|
|
697
|
+
azure:bonsai
|
|
698
|
+
azure:bot-services
|
|
699
|
+
azure:branch
|
|
700
|
+
azure:browser
|
|
701
|
+
azure:bug
|
|
702
|
+
azure:builds
|
|
703
|
+
azure:business-process-tracking
|
|
704
|
+
azure:cache
|
|
705
|
+
azure:cache-redis
|
|
706
|
+
azure:capacity
|
|
707
|
+
azure:capacity-reservation-groups
|
|
708
|
+
azure:cdn-profiles
|
|
709
|
+
azure:central-service-instance-for-sap
|
|
710
|
+
azure:ceres
|
|
711
|
+
azure:change-analysis
|
|
712
|
+
azure:client-apps
|
|
713
|
+
azure:cloud-services-classic
|
|
714
|
+
azure:cloud-services-extended-support
|
|
715
|
+
azure:cloud-test
|
|
716
|
+
azure:code
|
|
717
|
+
azure:code-optimization
|
|
718
|
+
azure:cognitive-search
|
|
719
|
+
azure:cognitive-services
|
|
720
|
+
azure:cognitive-services-decisions
|
|
721
|
+
azure:collaborative-service
|
|
722
|
+
azure:commit
|
|
723
|
+
azure:community-images
|
|
724
|
+
azure:compliance
|
|
725
|
+
azure:compliance-center
|
|
726
|
+
azure:compute-fleet
|
|
727
|
+
azure:computer-vision
|
|
728
|
+
azure:conditional-access
|
|
729
|
+
azure:confidential-ledgers
|
|
730
|
+
azure:connected-cache
|
|
731
|
+
azure:connected-vehicle-platform
|
|
732
|
+
azure:connections
|
|
733
|
+
azure:consortium
|
|
734
|
+
azure:container-apps-environments
|
|
735
|
+
azure:container-instances
|
|
736
|
+
azure:container-registries
|
|
737
|
+
azure:container-services-deprecated
|
|
738
|
+
azure:content-moderators
|
|
739
|
+
azure:content-safety
|
|
740
|
+
azure:controls
|
|
741
|
+
azure:controls-horizontal
|
|
742
|
+
azure:cost-alerts
|
|
743
|
+
azure:cost-analysis
|
|
744
|
+
azure:cost-budgets
|
|
745
|
+
azure:cost-export
|
|
746
|
+
azure:cost-management
|
|
747
|
+
azure:cost-management-and-billing
|
|
748
|
+
azure:counter
|
|
749
|
+
azure:cubes
|
|
750
|
+
azure:custom-ip-prefix
|
|
751
|
+
azure:custom-vision
|
|
752
|
+
azure:customer-lockbox-for-microsoft-azure
|
|
753
|
+
azure:dashboard
|
|
754
|
+
azure:dashboard-hub
|
|
755
|
+
azure:data-box
|
|
756
|
+
azure:data-collection-rules
|
|
757
|
+
azure:data-factories
|
|
758
|
+
azure:data-lake-analytics
|
|
759
|
+
azure:data-lake-storage-gen1
|
|
760
|
+
azure:data-lake-store-gen1
|
|
761
|
+
azure:data-share-invitations
|
|
762
|
+
azure:data-shares
|
|
763
|
+
azure:database-instance-for-sap
|
|
764
|
+
azure:ddo-s-protection-plans
|
|
765
|
+
azure:dedicated-hsm
|
|
766
|
+
azure:defender-cm-local-manager
|
|
767
|
+
azure:defender-dcs-controller
|
|
768
|
+
azure:defender-distributer-control-system
|
|
769
|
+
azure:defender-engineering-station
|
|
770
|
+
azure:defender-external-management
|
|
771
|
+
azure:defender-freezer-monitor
|
|
772
|
+
azure:defender-historian
|
|
773
|
+
azure:defender-hmi
|
|
774
|
+
azure:defender-industrial-packaging-system
|
|
775
|
+
azure:defender-industrial-printer
|
|
776
|
+
azure:defender-industrial-robot
|
|
777
|
+
azure:defender-industrial-scale-system
|
|
778
|
+
azure:defender-marquee
|
|
779
|
+
azure:defender-meter
|
|
780
|
+
azure:defender-plc
|
|
781
|
+
azure:defender-pneumatic-device
|
|
782
|
+
azure:defender-programable-board
|
|
783
|
+
azure:defender-relay
|
|
784
|
+
azure:defender-robot-controller
|
|
785
|
+
azure:defender-rtu
|
|
786
|
+
azure:defender-sensor
|
|
787
|
+
azure:defender-slot
|
|
788
|
+
azure:defender-web-guiding-system
|
|
789
|
+
azure:detonation
|
|
790
|
+
azure:dev-console
|
|
791
|
+
azure:dev-ops-starter
|
|
792
|
+
azure:dev-test-labs
|
|
793
|
+
azure:device-compliance
|
|
794
|
+
azure:device-configuration
|
|
795
|
+
azure:device-enrollment
|
|
796
|
+
azure:device-provisioning-services
|
|
797
|
+
azure:device-security-apple
|
|
798
|
+
azure:device-security-google
|
|
799
|
+
azure:device-security-windows
|
|
800
|
+
azure:device-update-io-t-hub
|
|
801
|
+
azure:devices
|
|
802
|
+
azure:diagnostics-settings
|
|
803
|
+
azure:digital-twins
|
|
804
|
+
azure:disk-encryption-sets
|
|
805
|
+
azure:disk-pool
|
|
806
|
+
azure:disks
|
|
807
|
+
azure:disks-classic
|
|
808
|
+
azure:disks-snapshots
|
|
809
|
+
azure:dns-multistack
|
|
810
|
+
azure:dns-private-resolver
|
|
811
|
+
azure:dns-security-policy
|
|
812
|
+
azure:dns-zones
|
|
813
|
+
azure:download
|
|
814
|
+
azure:e-books
|
|
815
|
+
azure:edge-management
|
|
816
|
+
azure:education
|
|
817
|
+
azure:elastic-job-agents
|
|
818
|
+
azure:elastic-san
|
|
819
|
+
azure:endpoint-analytics
|
|
820
|
+
azure:enterprise-applications
|
|
821
|
+
azure:entra-connect
|
|
822
|
+
azure:entra-connect-health
|
|
823
|
+
azure:entra-connect-sync
|
|
824
|
+
azure:entra-domain-services
|
|
825
|
+
azure:entra-global-secure-access
|
|
826
|
+
azure:entra-id-protection
|
|
827
|
+
azure:entra-identity-custom-roles
|
|
828
|
+
azure:entra-identity-licenses
|
|
829
|
+
azure:entra-identity-risky-signins
|
|
830
|
+
azure:entra-identity-risky-users
|
|
831
|
+
azure:entra-identity-roles-and-administrators
|
|
832
|
+
azure:entra-internet-access
|
|
833
|
+
azure:entra-managed-identities
|
|
834
|
+
azure:entra-private-access
|
|
835
|
+
azure:entra-privleged-identity-management
|
|
836
|
+
azure:entra-verified-id
|
|
837
|
+
azure:error
|
|
838
|
+
azure:event-grid-domains
|
|
839
|
+
azure:event-grid-subscriptions
|
|
840
|
+
azure:event-grid-topics
|
|
841
|
+
azure:event-hub-clusters
|
|
842
|
+
azure:event-hubs
|
|
843
|
+
azure:exchange-access
|
|
844
|
+
azure:exchange-on-premises-access
|
|
845
|
+
azure:express-route-circuits
|
|
846
|
+
azure:express-route-direct
|
|
847
|
+
azure:express-route-traffic-collector
|
|
848
|
+
azure:extended-security-updates
|
|
849
|
+
azure:extensions
|
|
850
|
+
azure:external-identities
|
|
851
|
+
azure:face-apis
|
|
852
|
+
azure:feature-previews
|
|
853
|
+
azure:fhir-service
|
|
854
|
+
azure:fiji
|
|
855
|
+
azure:file
|
|
856
|
+
azure:files
|
|
857
|
+
azure:firewalls
|
|
858
|
+
azure:folder-blank
|
|
859
|
+
azure:folder-website
|
|
860
|
+
azure:form-recognizers
|
|
861
|
+
azure:free-services
|
|
862
|
+
azure:front-door-and-cdn-profiles
|
|
863
|
+
azure:ftp
|
|
864
|
+
azure:function-apps
|
|
865
|
+
azure:gear
|
|
866
|
+
azure:genomics
|
|
867
|
+
azure:genomics-accounts
|
|
868
|
+
azure:globe-error
|
|
869
|
+
azure:globe-success
|
|
870
|
+
azure:globe-warning
|
|
871
|
+
azure:groups
|
|
872
|
+
azure:guide
|
|
873
|
+
azure:hd-insight-clusters
|
|
874
|
+
azure:hdi-aks-cluster
|
|
875
|
+
azure:heart
|
|
876
|
+
azure:help-and-support
|
|
877
|
+
azure:host-groups
|
|
878
|
+
azure:host-pools
|
|
879
|
+
azure:hosts
|
|
880
|
+
azure:ic-m-troubleshooting
|
|
881
|
+
azure:identity-governance
|
|
882
|
+
azure:identity-multi-factor-authentication
|
|
883
|
+
azure:identity-secure-score
|
|
884
|
+
azure:image
|
|
885
|
+
azure:image-definitions
|
|
886
|
+
azure:image-templates
|
|
887
|
+
azure:image-versions
|
|
888
|
+
azure:images
|
|
889
|
+
azure:immersive-readers
|
|
890
|
+
azure:import-export-jobs
|
|
891
|
+
azure:industrial-io-t
|
|
892
|
+
azure:information
|
|
893
|
+
azure:infrastructure-backup
|
|
894
|
+
azure:input-output
|
|
895
|
+
azure:instance-pools
|
|
896
|
+
azure:integration-accounts
|
|
897
|
+
azure:integration-environments
|
|
898
|
+
azure:integration-service-environments
|
|
899
|
+
azure:internet-analyzer-profiles
|
|
900
|
+
azure:intune
|
|
901
|
+
azure:intune-app-protection
|
|
902
|
+
azure:intune-for-education
|
|
903
|
+
azure:intune-trends
|
|
904
|
+
azure:io-t-central-applications
|
|
905
|
+
azure:io-t-edge
|
|
906
|
+
azure:io-t-hub
|
|
907
|
+
azure:ip-address-manager
|
|
908
|
+
azure:ip-groups
|
|
909
|
+
azure:journey-hub
|
|
910
|
+
azure:key-vaults
|
|
911
|
+
azure:keys
|
|
912
|
+
azure:kubernetes-fleet-manager
|
|
913
|
+
azure:kubernetes-services
|
|
914
|
+
azure:lab-accounts
|
|
915
|
+
azure:lab-services
|
|
916
|
+
azure:language
|
|
917
|
+
azure:language-understanding
|
|
918
|
+
azure:launch-portal
|
|
919
|
+
azure:learn
|
|
920
|
+
azure:load-balancer-hub
|
|
921
|
+
azure:load-balancers
|
|
922
|
+
azure:load-test
|
|
923
|
+
azure:load-testing
|
|
924
|
+
azure:local-network-gateways
|
|
925
|
+
azure:location
|
|
926
|
+
azure:log-analytics-query-pack
|
|
927
|
+
azure:log-analytics-workspaces
|
|
928
|
+
azure:log-streaming
|
|
929
|
+
azure:logic-apps
|
|
930
|
+
azure:logic-apps-custom-connector
|
|
931
|
+
azure:machine-learning
|
|
932
|
+
azure:machine-learning-studio-classic-web-services
|
|
933
|
+
azure:machine-learning-studio-web-service-plans
|
|
934
|
+
azure:machine-learning-studio-workspaces
|
|
935
|
+
azure:machines-azure-arc
|
|
936
|
+
azure:maintenance-configuration
|
|
937
|
+
azure:managed-applications-center
|
|
938
|
+
azure:managed-database
|
|
939
|
+
azure:managed-desktop
|
|
940
|
+
azure:managed-dev-ops-pools
|
|
941
|
+
azure:managed-file-shares
|
|
942
|
+
azure:managed-identities
|
|
943
|
+
azure:managed-instance-apache-cassandra
|
|
944
|
+
azure:managed-service-fabric
|
|
945
|
+
azure:management-groups
|
|
946
|
+
azure:management-portal
|
|
947
|
+
azure:marketplace
|
|
948
|
+
azure:marketplace-management
|
|
949
|
+
azure:med-tech-service
|
|
950
|
+
azure:media
|
|
951
|
+
azure:media-file
|
|
952
|
+
azure:mesh-applications
|
|
953
|
+
azure:metrics
|
|
954
|
+
azure:metrics-advisor
|
|
955
|
+
azure:microsoft-defender-easm
|
|
956
|
+
azure:microsoft-defender-for-cloud
|
|
957
|
+
azure:microsoft-defender-for-io-t
|
|
958
|
+
azure:microsoft-dev-box
|
|
959
|
+
azure:mindaro
|
|
960
|
+
azure:mission-landing-zone
|
|
961
|
+
azure:mobile
|
|
962
|
+
azure:mobile-engagement
|
|
963
|
+
azure:mobile-networks
|
|
964
|
+
azure:modular-data-center
|
|
965
|
+
azure:module
|
|
966
|
+
azure:monitor
|
|
967
|
+
azure:monitor-health-models
|
|
968
|
+
azure:multi-tenancy
|
|
969
|
+
azure:multifactor-authentication
|
|
970
|
+
azure:my-customers
|
|
971
|
+
azure:nat
|
|
972
|
+
azure:network-interfaces
|
|
973
|
+
azure:network-managers
|
|
974
|
+
azure:network-security-groups
|
|
975
|
+
azure:network-security-perimeters
|
|
976
|
+
azure:network-watcher
|
|
977
|
+
azure:notification-hub-namespaces
|
|
978
|
+
azure:notification-hubs
|
|
979
|
+
azure:offers
|
|
980
|
+
azure:on-premises-data-gateways
|
|
981
|
+
azure:open-supply-chain-platform
|
|
982
|
+
azure:operation-log-classic
|
|
983
|
+
azure:oracle-database
|
|
984
|
+
azure:os-images-classic
|
|
985
|
+
azure:osconfig
|
|
986
|
+
azure:outbound-connection
|
|
987
|
+
azure:partner-namespace
|
|
988
|
+
azure:partner-registration
|
|
989
|
+
azure:partner-topic
|
|
990
|
+
azure:peering-service
|
|
991
|
+
azure:peerings
|
|
992
|
+
azure:personalizers
|
|
993
|
+
azure:plans
|
|
994
|
+
azure:policy
|
|
995
|
+
azure:power
|
|
996
|
+
azure:power-bi-embedded
|
|
997
|
+
azure:power-platform
|
|
998
|
+
azure:power-up
|
|
999
|
+
azure:powershell
|
|
1000
|
+
azure:preview-features
|
|
1001
|
+
azure:private-endpoints
|
|
1002
|
+
azure:private-link
|
|
1003
|
+
azure:private-link-service
|
|
1004
|
+
azure:private-link-services
|
|
1005
|
+
azure:process-explorer
|
|
1006
|
+
azure:production-ready-database
|
|
1007
|
+
azure:proximity-placement-groups
|
|
1008
|
+
azure:public-ip-addresses
|
|
1009
|
+
azure:public-ip-addresses-classic
|
|
1010
|
+
azure:public-ip-prefixes
|
|
1011
|
+
azure:qn-a-makers
|
|
1012
|
+
azure:quickstart-center
|
|
1013
|
+
azure:recent
|
|
1014
|
+
azure:recovery-services-vaults
|
|
1015
|
+
azure:region-management
|
|
1016
|
+
azure:relays
|
|
1017
|
+
azure:remote-rendering
|
|
1018
|
+
azure:reservations
|
|
1019
|
+
azure:reserved-capacity
|
|
1020
|
+
azure:reserved-ip-addresses-classic
|
|
1021
|
+
azure:resource-explorer
|
|
1022
|
+
azure:resource-graph-explorer
|
|
1023
|
+
azure:resource-group-list
|
|
1024
|
+
azure:resource-groups
|
|
1025
|
+
azure:resource-guard
|
|
1026
|
+
azure:resource-linked
|
|
1027
|
+
azure:resource-management-private-link
|
|
1028
|
+
azure:resource-mover
|
|
1029
|
+
azure:resources-provider
|
|
1030
|
+
azure:restore-points
|
|
1031
|
+
azure:restore-points-collections
|
|
1032
|
+
azure:route-filters
|
|
1033
|
+
azure:route-tables
|
|
1034
|
+
azure:rtos
|
|
1035
|
+
azure:savings-plans
|
|
1036
|
+
azure:scheduler
|
|
1037
|
+
azure:scheduler-job-collections
|
|
1038
|
+
azure:scvmm-management-servers
|
|
1039
|
+
azure:search
|
|
1040
|
+
azure:search-grid
|
|
1041
|
+
azure:security
|
|
1042
|
+
azure:security-baselines
|
|
1043
|
+
azure:send-grid-accounts
|
|
1044
|
+
azure:server-farm
|
|
1045
|
+
azure:serverless-search
|
|
1046
|
+
azure:service-catalog-mad
|
|
1047
|
+
azure:service-endpoint-policies
|
|
1048
|
+
azure:service-fabric-clusters
|
|
1049
|
+
azure:service-health
|
|
1050
|
+
azure:service-providers
|
|
1051
|
+
azure:shared-image-galleries
|
|
1052
|
+
azure:signal-r
|
|
1053
|
+
azure:software-as-a-service
|
|
1054
|
+
azure:software-updates
|
|
1055
|
+
azure:solutions
|
|
1056
|
+
azure:sonic-dash
|
|
1057
|
+
azure:spatial-anchor-accounts
|
|
1058
|
+
azure:speech-services
|
|
1059
|
+
azure:spot-vm
|
|
1060
|
+
azure:spot-vmss
|
|
1061
|
+
azure:sql-data-warehouses
|
|
1062
|
+
azure:sql-database
|
|
1063
|
+
azure:sql-elastic-pools
|
|
1064
|
+
azure:sql-managed-instance
|
|
1065
|
+
azure:sql-server
|
|
1066
|
+
azure:sql-server-registries
|
|
1067
|
+
azure:ssd
|
|
1068
|
+
azure:ssh-keys
|
|
1069
|
+
azure:ssis-lift-and-shift-ir
|
|
1070
|
+
azure:stack-hci-premium
|
|
1071
|
+
azure:static-apps
|
|
1072
|
+
azure:stor-simple-data-managers
|
|
1073
|
+
azure:stor-simple-device-managers
|
|
1074
|
+
azure:storage-accounts
|
|
1075
|
+
azure:storage-accounts-classic
|
|
1076
|
+
azure:storage-actions
|
|
1077
|
+
azure:storage-azure-files
|
|
1078
|
+
azure:storage-container
|
|
1079
|
+
azure:storage-explorer
|
|
1080
|
+
azure:storage-functions
|
|
1081
|
+
azure:storage-queue
|
|
1082
|
+
azure:storage-sync-services
|
|
1083
|
+
azure:stream-analytics-jobs
|
|
1084
|
+
azure:subnet
|
|
1085
|
+
azure:subscriptions
|
|
1086
|
+
azure:system-topic
|
|
1087
|
+
azure:table
|
|
1088
|
+
azure:tag
|
|
1089
|
+
azure:tags
|
|
1090
|
+
azure:targets-management
|
|
1091
|
+
azure:template-specs
|
|
1092
|
+
azure:templates
|
|
1093
|
+
azure:tenant-properties
|
|
1094
|
+
azure:tenant-status
|
|
1095
|
+
azure:test-base
|
|
1096
|
+
azure:tfs-vc-repository
|
|
1097
|
+
azure:time-series-data-sets
|
|
1098
|
+
azure:time-series-insights-access-policies
|
|
1099
|
+
azure:time-series-insights-environments
|
|
1100
|
+
azure:time-series-insights-event-sources
|
|
1101
|
+
azure:toolbox
|
|
1102
|
+
azure:traffic-manager-profiles
|
|
1103
|
+
azure:translator-text
|
|
1104
|
+
azure:troubleshoot
|
|
1105
|
+
azure:universal-print
|
|
1106
|
+
azure:update-management-center
|
|
1107
|
+
azure:updates
|
|
1108
|
+
azure:user-privacy
|
|
1109
|
+
azure:user-settings
|
|
1110
|
+
azure:user-subscriptions
|
|
1111
|
+
azure:users
|
|
1112
|
+
azure:verifiable-credentials
|
|
1113
|
+
azure:verification-as-a-service
|
|
1114
|
+
azure:versions
|
|
1115
|
+
azure:video-analyzers
|
|
1116
|
+
azure:virtual-clusters
|
|
1117
|
+
azure:virtual-enclaves
|
|
1118
|
+
azure:virtual-instance-for-sap
|
|
1119
|
+
azure:virtual-machine
|
|
1120
|
+
azure:virtual-machines-classic
|
|
1121
|
+
azure:virtual-network-gateways
|
|
1122
|
+
azure:virtual-networks
|
|
1123
|
+
azure:virtual-networks-classic
|
|
1124
|
+
azure:virtual-router
|
|
1125
|
+
azure:virtual-visits-builder
|
|
1126
|
+
azure:virtual-wan-hub
|
|
1127
|
+
azure:virtual-wans
|
|
1128
|
+
azure:vm-app-definitions
|
|
1129
|
+
azure:vm-app-versions
|
|
1130
|
+
azure:vm-image-version
|
|
1131
|
+
azure:vm-images-classic
|
|
1132
|
+
azure:vm-scale-sets
|
|
1133
|
+
azure:wac
|
|
1134
|
+
azure:wac-installer
|
|
1135
|
+
azure:web-app-database
|
|
1136
|
+
azure:web-application-firewall-policies-waf
|
|
1137
|
+
azure:web-jobs
|
|
1138
|
+
azure:web-slots
|
|
1139
|
+
azure:web-test
|
|
1140
|
+
azure:website-power
|
|
1141
|
+
azure:website-staging
|
|
1142
|
+
azure:windows-notification-services
|
|
1143
|
+
azure:windows10-core-services
|
|
1144
|
+
azure:workbooks
|
|
1145
|
+
azure:worker-container-app
|
|
1146
|
+
azure:workflow
|
|
1147
|
+
azure:workspace-gateway
|
|
1148
|
+
azure:workspaces
|
|
1149
|
+
gcp:access-context-manager
|
|
1150
|
+
gcp:administration
|
|
1151
|
+
gcp:advanced-agent-modeling
|
|
1152
|
+
gcp:advanced-solutions-lab
|
|
1153
|
+
gcp:agent-assist
|
|
1154
|
+
gcp:ai-hub
|
|
1155
|
+
gcp:ai-platform
|
|
1156
|
+
gcp:ai-platform-unified
|
|
1157
|
+
gcp:analytics-hub
|
|
1158
|
+
gcp:anthos
|
|
1159
|
+
gcp:anthos-config-management
|
|
1160
|
+
gcp:anthos-service-mesh
|
|
1161
|
+
gcp:api
|
|
1162
|
+
gcp:api-analytics
|
|
1163
|
+
gcp:api-monetization
|
|
1164
|
+
gcp:apigee-api-platform
|
|
1165
|
+
gcp:apigee-sense
|
|
1166
|
+
gcp:app-engine
|
|
1167
|
+
gcp:artifact-registry
|
|
1168
|
+
gcp:asset-inventory
|
|
1169
|
+
gcp:assured-workloads
|
|
1170
|
+
gcp:auto-ml
|
|
1171
|
+
gcp:auto-ml-natural-language
|
|
1172
|
+
gcp:auto-ml-tables
|
|
1173
|
+
gcp:auto-ml-translation
|
|
1174
|
+
gcp:auto-ml-video-intelligence
|
|
1175
|
+
gcp:auto-ml-vision
|
|
1176
|
+
gcp:bare-metal-solutions
|
|
1177
|
+
gcp:batch
|
|
1178
|
+
gcp:beyondcorp
|
|
1179
|
+
gcp:big-query
|
|
1180
|
+
gcp:bigtable
|
|
1181
|
+
gcp:billing
|
|
1182
|
+
gcp:binary-authorization
|
|
1183
|
+
gcp:catalog
|
|
1184
|
+
gcp:certificate-authority-service
|
|
1185
|
+
gcp:certificate-manager
|
|
1186
|
+
gcp:cloud-api-gateway
|
|
1187
|
+
gcp:cloud-apis
|
|
1188
|
+
gcp:cloud-armor
|
|
1189
|
+
gcp:cloud-asset-inventory
|
|
1190
|
+
gcp:cloud-audit-logs
|
|
1191
|
+
gcp:cloud-build
|
|
1192
|
+
gcp:cloud-cdn
|
|
1193
|
+
gcp:cloud-code
|
|
1194
|
+
gcp:cloud-composer
|
|
1195
|
+
gcp:cloud-data-fusion
|
|
1196
|
+
gcp:cloud-deploy
|
|
1197
|
+
gcp:cloud-deployment-manager
|
|
1198
|
+
gcp:cloud-dns
|
|
1199
|
+
gcp:cloud-domains
|
|
1200
|
+
gcp:cloud-ekm
|
|
1201
|
+
gcp:cloud-endpoints
|
|
1202
|
+
gcp:cloud-external-ip-addresses
|
|
1203
|
+
gcp:cloud-firewall-rules
|
|
1204
|
+
gcp:cloud-for-marketing
|
|
1205
|
+
gcp:cloud-functions
|
|
1206
|
+
gcp:cloud-generic
|
|
1207
|
+
gcp:cloud-gpu
|
|
1208
|
+
gcp:cloud-healthcare-api
|
|
1209
|
+
gcp:cloud-healthcare-marketplace
|
|
1210
|
+
gcp:cloud-hsm
|
|
1211
|
+
gcp:cloud-ids
|
|
1212
|
+
gcp:cloud-inference-api
|
|
1213
|
+
gcp:cloud-interconnect
|
|
1214
|
+
gcp:cloud-jobs-api
|
|
1215
|
+
gcp:cloud-load-balancing
|
|
1216
|
+
gcp:cloud-logging
|
|
1217
|
+
gcp:cloud-media-edge
|
|
1218
|
+
gcp:cloud-monitoring
|
|
1219
|
+
gcp:cloud-nat
|
|
1220
|
+
gcp:cloud-natural-language-api
|
|
1221
|
+
gcp:cloud-network
|
|
1222
|
+
gcp:cloud-ops
|
|
1223
|
+
gcp:cloud-optimization-ai
|
|
1224
|
+
gcp:cloud-optimization-ai-fleet-routing-api
|
|
1225
|
+
gcp:cloud-router
|
|
1226
|
+
gcp:cloud-routes
|
|
1227
|
+
gcp:cloud-run
|
|
1228
|
+
gcp:cloud-run-for-anthos
|
|
1229
|
+
gcp:cloud-scheduler
|
|
1230
|
+
gcp:cloud-security-scanner
|
|
1231
|
+
gcp:cloud-shell
|
|
1232
|
+
gcp:cloud-spanner
|
|
1233
|
+
gcp:cloud-sql
|
|
1234
|
+
gcp:cloud-storage
|
|
1235
|
+
gcp:cloud-tasks
|
|
1236
|
+
gcp:cloud-test-lab
|
|
1237
|
+
gcp:cloud-tpu
|
|
1238
|
+
gcp:cloud-translation-api
|
|
1239
|
+
gcp:cloud-vision-api
|
|
1240
|
+
gcp:cloud-vpn
|
|
1241
|
+
gcp:compute-engine
|
|
1242
|
+
gcp:configuration-management
|
|
1243
|
+
gcp:connectivity-test
|
|
1244
|
+
gcp:connectors
|
|
1245
|
+
gcp:contact-center-ai
|
|
1246
|
+
gcp:container-optimized-os
|
|
1247
|
+
gcp:container-registry
|
|
1248
|
+
gcp:data-catalog
|
|
1249
|
+
gcp:data-labeling
|
|
1250
|
+
gcp:data-layers
|
|
1251
|
+
gcp:data-loss-prevention-api
|
|
1252
|
+
gcp:data-qn-a
|
|
1253
|
+
gcp:data-studio
|
|
1254
|
+
gcp:data-transfer
|
|
1255
|
+
gcp:database-migration-service
|
|
1256
|
+
gcp:dataflow
|
|
1257
|
+
gcp:datalab
|
|
1258
|
+
gcp:dataplex
|
|
1259
|
+
gcp:datapol
|
|
1260
|
+
gcp:dataprep
|
|
1261
|
+
gcp:dataproc
|
|
1262
|
+
gcp:dataproc-metastore
|
|
1263
|
+
gcp:datashare
|
|
1264
|
+
gcp:datastore
|
|
1265
|
+
gcp:datastream
|
|
1266
|
+
gcp:debugger
|
|
1267
|
+
gcp:developer-portal
|
|
1268
|
+
gcp:dialogflow
|
|
1269
|
+
gcp:dialogflow-cx
|
|
1270
|
+
gcp:dialogflow-insights
|
|
1271
|
+
gcp:document-ai
|
|
1272
|
+
gcp:early-access-center
|
|
1273
|
+
gcp:error-reporting
|
|
1274
|
+
gcp:eventarc
|
|
1275
|
+
gcp:filestore
|
|
1276
|
+
gcp:financial-services-marketplace
|
|
1277
|
+
gcp:firestore
|
|
1278
|
+
gcp:fleet-engine
|
|
1279
|
+
gcp:free-trial
|
|
1280
|
+
gcp:game-servers
|
|
1281
|
+
gcp:gce-systems-management
|
|
1282
|
+
gcp:genomics
|
|
1283
|
+
gcp:gke-on-prem
|
|
1284
|
+
gcp:google-cloud-marketplace
|
|
1285
|
+
gcp:google-kubernetes-engine
|
|
1286
|
+
gcp:google-maps-platform
|
|
1287
|
+
gcp:healthcare-nlp-api
|
|
1288
|
+
gcp:home
|
|
1289
|
+
gcp:identity-and-access-management
|
|
1290
|
+
gcp:identity-aware-proxy
|
|
1291
|
+
gcp:identity-platform
|
|
1292
|
+
gcp:iot-core
|
|
1293
|
+
gcp:iot-edge
|
|
1294
|
+
gcp:key-access-justifications
|
|
1295
|
+
gcp:key-management-service
|
|
1296
|
+
gcp:kuberun
|
|
1297
|
+
gcp:launcher
|
|
1298
|
+
gcp:local-ssd
|
|
1299
|
+
gcp:looker
|
|
1300
|
+
gcp:managed-service-for-microsoft-active-directory
|
|
1301
|
+
gcp:media-translation-api
|
|
1302
|
+
gcp:memorystore
|
|
1303
|
+
gcp:migrate-for-anthos
|
|
1304
|
+
gcp:migrate-for-compute-engine
|
|
1305
|
+
gcp:my-cloud
|
|
1306
|
+
gcp:network-connectivity-center
|
|
1307
|
+
gcp:network-intelligence-center
|
|
1308
|
+
gcp:network-security
|
|
1309
|
+
gcp:network-tiers
|
|
1310
|
+
gcp:network-topology
|
|
1311
|
+
gcp:onboarding
|
|
1312
|
+
gcp:os-configuration-management
|
|
1313
|
+
gcp:os-inventory-management
|
|
1314
|
+
gcp:os-patch-management
|
|
1315
|
+
gcp:partner-interconnect
|
|
1316
|
+
gcp:partner-portal
|
|
1317
|
+
gcp:performance-dashboard
|
|
1318
|
+
gcp:permissions
|
|
1319
|
+
gcp:persistent-disk
|
|
1320
|
+
gcp:phishing-protection
|
|
1321
|
+
gcp:policy-analyzer
|
|
1322
|
+
gcp:premium-network-tier
|
|
1323
|
+
gcp:private-connectivity
|
|
1324
|
+
gcp:private-service-connect
|
|
1325
|
+
gcp:producer-portal
|
|
1326
|
+
gcp:profiler
|
|
1327
|
+
gcp:project
|
|
1328
|
+
gcp:pub-sub
|
|
1329
|
+
gcp:quantum-engine
|
|
1330
|
+
gcp:quotas
|
|
1331
|
+
gcp:real-world-insights
|
|
1332
|
+
gcp:recommendations-ai
|
|
1333
|
+
gcp:release-notes
|
|
1334
|
+
gcp:retail-api
|
|
1335
|
+
gcp:risk-manager
|
|
1336
|
+
gcp:runtime-config
|
|
1337
|
+
gcp:secret-manager
|
|
1338
|
+
gcp:security
|
|
1339
|
+
gcp:security-command-center
|
|
1340
|
+
gcp:security-health-advisor
|
|
1341
|
+
gcp:security-key-enforcement
|
|
1342
|
+
gcp:service-discovery
|
|
1343
|
+
gcp:speech-to-text
|
|
1344
|
+
gcp:stackdriver
|
|
1345
|
+
gcp:standard-network-tier
|
|
1346
|
+
gcp:stream-suite
|
|
1347
|
+
gcp:support
|
|
1348
|
+
gcp:tensorflow-enterprise
|
|
1349
|
+
gcp:text-to-speech
|
|
1350
|
+
gcp:tools-for-powershell
|
|
1351
|
+
gcp:trace
|
|
1352
|
+
gcp:traffic-director
|
|
1353
|
+
gcp:transfer
|
|
1354
|
+
gcp:transfer-appliance
|
|
1355
|
+
gcp:user-preferences
|
|
1356
|
+
gcp:vertex-ai
|
|
1357
|
+
gcp:video-intelligence-api
|
|
1358
|
+
gcp:virtual-private-cloud
|
|
1359
|
+
gcp:visual-inspection
|
|
1360
|
+
gcp:vmware-engine
|
|
1361
|
+
gcp:web-risk
|
|
1362
|
+
gcp:web-security-scanner
|
|
1363
|
+
gcp:workflows
|
|
1364
|
+
gcp:workload-identity-pool
|
|
1365
|
+
tech:aarch64
|
|
1366
|
+
tech:adobe-illustrator
|
|
1367
|
+
tech:adobe-photoshop
|
|
1368
|
+
tech:adobe-premiere-pro
|
|
1369
|
+
tech:adobe-xd
|
|
1370
|
+
tech:adonis-js
|
|
1371
|
+
tech:after-effects
|
|
1372
|
+
tech:airflow
|
|
1373
|
+
tech:akka
|
|
1374
|
+
tech:algolia
|
|
1375
|
+
tech:alpine-js
|
|
1376
|
+
tech:amazon-web-services
|
|
1377
|
+
tech:anaconda
|
|
1378
|
+
tech:android
|
|
1379
|
+
tech:android-studio
|
|
1380
|
+
tech:angular
|
|
1381
|
+
tech:angular-js
|
|
1382
|
+
tech:ansible
|
|
1383
|
+
tech:ant-design
|
|
1384
|
+
tech:apache
|
|
1385
|
+
tech:apl
|
|
1386
|
+
tech:appcelerator
|
|
1387
|
+
tech:apple
|
|
1388
|
+
tech:apple-safari
|
|
1389
|
+
tech:appwrite
|
|
1390
|
+
tech:arch-linux
|
|
1391
|
+
tech:arduino
|
|
1392
|
+
tech:argo-cd
|
|
1393
|
+
tech:astro
|
|
1394
|
+
tech:atom
|
|
1395
|
+
tech:autodesk-maya
|
|
1396
|
+
tech:autodesk-shot-grid
|
|
1397
|
+
tech:awk
|
|
1398
|
+
tech:azios
|
|
1399
|
+
tech:azure
|
|
1400
|
+
tech:azure-devops
|
|
1401
|
+
tech:azure-sql-database
|
|
1402
|
+
tech:babel
|
|
1403
|
+
tech:backbone-js
|
|
1404
|
+
tech:ballerina
|
|
1405
|
+
tech:bamboo
|
|
1406
|
+
tech:bash
|
|
1407
|
+
tech:behance
|
|
1408
|
+
tech:bitbucket
|
|
1409
|
+
tech:blender
|
|
1410
|
+
tech:bootstrap
|
|
1411
|
+
tech:bower
|
|
1412
|
+
tech:browserstack
|
|
1413
|
+
tech:bulma
|
|
1414
|
+
tech:bun
|
|
1415
|
+
tech:c
|
|
1416
|
+
tech:cairo-graphics
|
|
1417
|
+
tech:cake-php
|
|
1418
|
+
tech:canva
|
|
1419
|
+
tech:capacitor
|
|
1420
|
+
tech:cassandra
|
|
1421
|
+
tech:cent-os
|
|
1422
|
+
tech:chrome
|
|
1423
|
+
tech:circle-ci
|
|
1424
|
+
tech:clarity
|
|
1425
|
+
tech:clion
|
|
1426
|
+
tech:clojure
|
|
1427
|
+
tech:clojure-script
|
|
1428
|
+
tech:cloudflare
|
|
1429
|
+
tech:cloudflare-workers
|
|
1430
|
+
tech:cmake
|
|
1431
|
+
tech:code-igniter
|
|
1432
|
+
tech:code-pen
|
|
1433
|
+
tech:codeac
|
|
1434
|
+
tech:codecov
|
|
1435
|
+
tech:coffee-script
|
|
1436
|
+
tech:composer
|
|
1437
|
+
tech:confluence
|
|
1438
|
+
tech:consul
|
|
1439
|
+
tech:contao
|
|
1440
|
+
tech:corejs
|
|
1441
|
+
tech:cosmosdb
|
|
1442
|
+
tech:couchdb
|
|
1443
|
+
tech:cplusplus
|
|
1444
|
+
tech:crystal
|
|
1445
|
+
tech:csharp
|
|
1446
|
+
tech:css3
|
|
1447
|
+
tech:cucumber
|
|
1448
|
+
tech:cypress
|
|
1449
|
+
tech:d3js
|
|
1450
|
+
tech:dart
|
|
1451
|
+
tech:data-grip
|
|
1452
|
+
tech:data-spell
|
|
1453
|
+
tech:dbeaver
|
|
1454
|
+
tech:debian
|
|
1455
|
+
tech:deno
|
|
1456
|
+
tech:devicon
|
|
1457
|
+
tech:digital-ocean
|
|
1458
|
+
tech:discord-js
|
|
1459
|
+
tech:django
|
|
1460
|
+
tech:django-rest
|
|
1461
|
+
tech:docker
|
|
1462
|
+
tech:doctrine
|
|
1463
|
+
tech:dropwizard
|
|
1464
|
+
tech:drupal
|
|
1465
|
+
tech:eclipse-ceylon
|
|
1466
|
+
tech:eclipse-ide
|
|
1467
|
+
tech:eclipse-vert-x
|
|
1468
|
+
tech:elasticbeats
|
|
1469
|
+
tech:elasticsearch
|
|
1470
|
+
tech:electron
|
|
1471
|
+
tech:eleventy-11ty
|
|
1472
|
+
tech:elixir
|
|
1473
|
+
tech:elm
|
|
1474
|
+
tech:embedded-c
|
|
1475
|
+
tech:ember-js
|
|
1476
|
+
tech:envoy
|
|
1477
|
+
tech:erlang
|
|
1478
|
+
tech:eslint
|
|
1479
|
+
tech:express
|
|
1480
|
+
tech:facebook
|
|
1481
|
+
tech:fast-api
|
|
1482
|
+
tech:fastify
|
|
1483
|
+
tech:fauna
|
|
1484
|
+
tech:feathers
|
|
1485
|
+
tech:fedora
|
|
1486
|
+
tech:figma
|
|
1487
|
+
tech:file-zilla
|
|
1488
|
+
tech:firebase
|
|
1489
|
+
tech:firefox
|
|
1490
|
+
tech:flask
|
|
1491
|
+
tech:flutter
|
|
1492
|
+
tech:fortran
|
|
1493
|
+
tech:foundation
|
|
1494
|
+
tech:fsharp
|
|
1495
|
+
tech:gatling
|
|
1496
|
+
tech:gatsby
|
|
1497
|
+
tech:gazebo
|
|
1498
|
+
tech:gcc
|
|
1499
|
+
tech:gentoo
|
|
1500
|
+
tech:ghost
|
|
1501
|
+
tech:gimp
|
|
1502
|
+
tech:git
|
|
1503
|
+
tech:gitbook
|
|
1504
|
+
tech:github
|
|
1505
|
+
tech:github-actions
|
|
1506
|
+
tech:github-codespaces
|
|
1507
|
+
tech:gitlab
|
|
1508
|
+
tech:gitpod
|
|
1509
|
+
tech:gitter
|
|
1510
|
+
tech:gnu-emacs
|
|
1511
|
+
tech:go
|
|
1512
|
+
tech:go-land
|
|
1513
|
+
tech:godot-engine
|
|
1514
|
+
tech:google
|
|
1515
|
+
tech:google-cloud
|
|
1516
|
+
tech:gradle
|
|
1517
|
+
tech:grafana
|
|
1518
|
+
tech:grails
|
|
1519
|
+
tech:graphql
|
|
1520
|
+
tech:groovy
|
|
1521
|
+
tech:grunt-js
|
|
1522
|
+
tech:gulp-js
|
|
1523
|
+
tech:hadoop
|
|
1524
|
+
tech:handlebars
|
|
1525
|
+
tech:hardhat
|
|
1526
|
+
tech:harvester
|
|
1527
|
+
tech:hashicorp-vault
|
|
1528
|
+
tech:haskell
|
|
1529
|
+
tech:haxe
|
|
1530
|
+
tech:helm
|
|
1531
|
+
tech:heroku
|
|
1532
|
+
tech:hibernate
|
|
1533
|
+
tech:homebrew
|
|
1534
|
+
tech:html5
|
|
1535
|
+
tech:hugo
|
|
1536
|
+
tech:ibm-spss-statistics
|
|
1537
|
+
tech:ie10
|
|
1538
|
+
tech:ifttt
|
|
1539
|
+
tech:influxdb
|
|
1540
|
+
tech:inkscape
|
|
1541
|
+
tech:insomnia
|
|
1542
|
+
tech:intellij-idea
|
|
1543
|
+
tech:ionic
|
|
1544
|
+
tech:jaeger
|
|
1545
|
+
tech:jamstack
|
|
1546
|
+
tech:jasmine
|
|
1547
|
+
tech:java
|
|
1548
|
+
tech:javascript
|
|
1549
|
+
tech:jeet
|
|
1550
|
+
tech:jekyll
|
|
1551
|
+
tech:jenkins
|
|
1552
|
+
tech:jest
|
|
1553
|
+
tech:jetbrains
|
|
1554
|
+
tech:jira
|
|
1555
|
+
tech:jira-align
|
|
1556
|
+
tech:jquery
|
|
1557
|
+
tech:json
|
|
1558
|
+
tech:jule
|
|
1559
|
+
tech:julia
|
|
1560
|
+
tech:junit
|
|
1561
|
+
tech:jupyter
|
|
1562
|
+
tech:k3os
|
|
1563
|
+
tech:k3s
|
|
1564
|
+
tech:kafka
|
|
1565
|
+
tech:kaggle
|
|
1566
|
+
tech:karate
|
|
1567
|
+
tech:karma
|
|
1568
|
+
tech:keras
|
|
1569
|
+
tech:kibana
|
|
1570
|
+
tech:knex-js
|
|
1571
|
+
tech:knockout
|
|
1572
|
+
tech:kotlin
|
|
1573
|
+
tech:krakenjs
|
|
1574
|
+
tech:ktor
|
|
1575
|
+
tech:kubernetes
|
|
1576
|
+
tech:labview
|
|
1577
|
+
tech:laravel
|
|
1578
|
+
tech:latex
|
|
1579
|
+
tech:less-js
|
|
1580
|
+
tech:linkedin
|
|
1581
|
+
tech:linux
|
|
1582
|
+
tech:liquibase
|
|
1583
|
+
tech:livewire
|
|
1584
|
+
tech:llvm
|
|
1585
|
+
tech:logstash
|
|
1586
|
+
tech:lua
|
|
1587
|
+
tech:lumen
|
|
1588
|
+
tech:magento
|
|
1589
|
+
tech:markdown
|
|
1590
|
+
tech:material-ui
|
|
1591
|
+
tech:materialize
|
|
1592
|
+
tech:matlab
|
|
1593
|
+
tech:matplotlib
|
|
1594
|
+
tech:maven
|
|
1595
|
+
tech:meteor-js
|
|
1596
|
+
tech:microsoft-sql-server
|
|
1597
|
+
tech:minitab
|
|
1598
|
+
tech:mob-x
|
|
1599
|
+
tech:mocha
|
|
1600
|
+
tech:modx
|
|
1601
|
+
tech:moleculer
|
|
1602
|
+
tech:mongodb
|
|
1603
|
+
tech:mongoose-js
|
|
1604
|
+
tech:moodle
|
|
1605
|
+
tech:ms-dos
|
|
1606
|
+
tech:mysql
|
|
1607
|
+
tech:nano
|
|
1608
|
+
tech:nerog
|
|
1609
|
+
tech:nestjs
|
|
1610
|
+
tech:net
|
|
1611
|
+
tech:net-core
|
|
1612
|
+
tech:network-x
|
|
1613
|
+
tech:new4j
|
|
1614
|
+
tech:nextjs
|
|
1615
|
+
tech:nginx
|
|
1616
|
+
tech:nhibernate
|
|
1617
|
+
tech:nim
|
|
1618
|
+
tech:nimble
|
|
1619
|
+
tech:nix
|
|
1620
|
+
tech:nodejs
|
|
1621
|
+
tech:nodemon
|
|
1622
|
+
tech:nodewebkit
|
|
1623
|
+
tech:npm
|
|
1624
|
+
tech:nuget
|
|
1625
|
+
tech:num-py
|
|
1626
|
+
tech:nuxt-js
|
|
1627
|
+
tech:objective-c
|
|
1628
|
+
tech:ocaml
|
|
1629
|
+
tech:oh-my-zsh
|
|
1630
|
+
tech:okta
|
|
1631
|
+
tech:open-al
|
|
1632
|
+
tech:open-api
|
|
1633
|
+
tech:open-cl
|
|
1634
|
+
tech:open-cv
|
|
1635
|
+
tech:open-gl
|
|
1636
|
+
tech:open-stack
|
|
1637
|
+
tech:open-suse
|
|
1638
|
+
tech:open-telemetry
|
|
1639
|
+
tech:opera
|
|
1640
|
+
tech:oracle
|
|
1641
|
+
tech:p5js
|
|
1642
|
+
tech:packer
|
|
1643
|
+
tech:pandas
|
|
1644
|
+
tech:perl
|
|
1645
|
+
tech:pf-sense
|
|
1646
|
+
tech:phalcon
|
|
1647
|
+
tech:phoenix-framework
|
|
1648
|
+
tech:photon-engine
|
|
1649
|
+
tech:php
|
|
1650
|
+
tech:php-storm
|
|
1651
|
+
tech:playwrite
|
|
1652
|
+
tech:ploty
|
|
1653
|
+
tech:podman
|
|
1654
|
+
tech:polygon
|
|
1655
|
+
tech:portainer
|
|
1656
|
+
tech:postcss
|
|
1657
|
+
tech:postgresql
|
|
1658
|
+
tech:postman
|
|
1659
|
+
tech:powershell
|
|
1660
|
+
tech:processing
|
|
1661
|
+
tech:prometheus
|
|
1662
|
+
tech:protractor
|
|
1663
|
+
tech:purescript
|
|
1664
|
+
tech:putty
|
|
1665
|
+
tech:pycharm
|
|
1666
|
+
tech:pyscript
|
|
1667
|
+
tech:pytest
|
|
1668
|
+
tech:python
|
|
1669
|
+
tech:python-poetry
|
|
1670
|
+
tech:pytorch
|
|
1671
|
+
tech:qodana
|
|
1672
|
+
tech:qt
|
|
1673
|
+
tech:quarkus
|
|
1674
|
+
tech:quasar
|
|
1675
|
+
tech:qwik
|
|
1676
|
+
tech:r
|
|
1677
|
+
tech:rabbitmq
|
|
1678
|
+
tech:rancher
|
|
1679
|
+
tech:raspberrypi
|
|
1680
|
+
tech:reach
|
|
1681
|
+
tech:react
|
|
1682
|
+
tech:react-bootstrap
|
|
1683
|
+
tech:realm
|
|
1684
|
+
tech:red-cube-s-epic-compiler-thingy-programming-re-ct
|
|
1685
|
+
tech:redhat
|
|
1686
|
+
tech:redis
|
|
1687
|
+
tech:redux
|
|
1688
|
+
tech:ren-py
|
|
1689
|
+
tech:rider
|
|
1690
|
+
tech:robot-operating-system-ros
|
|
1691
|
+
tech:rocksdb
|
|
1692
|
+
tech:rollup-js
|
|
1693
|
+
tech:rspec
|
|
1694
|
+
tech:rstudio
|
|
1695
|
+
tech:ruby
|
|
1696
|
+
tech:ruby-mine
|
|
1697
|
+
tech:ruby-on-rails
|
|
1698
|
+
tech:rust
|
|
1699
|
+
tech:salesforce
|
|
1700
|
+
tech:sanity
|
|
1701
|
+
tech:sass
|
|
1702
|
+
tech:scala
|
|
1703
|
+
tech:scalingo
|
|
1704
|
+
tech:sdl
|
|
1705
|
+
tech:selenium
|
|
1706
|
+
tech:sema-software
|
|
1707
|
+
tech:sequelize
|
|
1708
|
+
tech:shopware
|
|
1709
|
+
tech:sketch
|
|
1710
|
+
tech:slack
|
|
1711
|
+
tech:socket-io
|
|
1712
|
+
tech:solid-js
|
|
1713
|
+
tech:solidity
|
|
1714
|
+
tech:sonarqube
|
|
1715
|
+
tech:sourcetree
|
|
1716
|
+
tech:spark
|
|
1717
|
+
tech:splunk
|
|
1718
|
+
tech:spring
|
|
1719
|
+
tech:sql-developer
|
|
1720
|
+
tech:sqlalchemy
|
|
1721
|
+
tech:sqlite
|
|
1722
|
+
tech:ssh
|
|
1723
|
+
tech:stackoverflow
|
|
1724
|
+
tech:stata
|
|
1725
|
+
tech:storybook
|
|
1726
|
+
tech:streamlit
|
|
1727
|
+
tech:stylus
|
|
1728
|
+
tech:subversion
|
|
1729
|
+
tech:svelte
|
|
1730
|
+
tech:swagger
|
|
1731
|
+
tech:swift
|
|
1732
|
+
tech:symfony
|
|
1733
|
+
tech:tailwind-css
|
|
1734
|
+
tech:tauri
|
|
1735
|
+
tech:tensorflow
|
|
1736
|
+
tech:terraform
|
|
1737
|
+
tech:tex
|
|
1738
|
+
tech:the-algorithms
|
|
1739
|
+
tech:three-js
|
|
1740
|
+
tech:titanium-sdk
|
|
1741
|
+
tech:tomcat
|
|
1742
|
+
tech:tortoise-git
|
|
1743
|
+
tech:tower
|
|
1744
|
+
tech:traefik-mesh
|
|
1745
|
+
tech:traefik-proxy
|
|
1746
|
+
tech:travis-ci
|
|
1747
|
+
tech:trello
|
|
1748
|
+
tech:twitter
|
|
1749
|
+
tech:typescript
|
|
1750
|
+
tech:typo3
|
|
1751
|
+
tech:ubuntu
|
|
1752
|
+
tech:uml
|
|
1753
|
+
tech:unity
|
|
1754
|
+
tech:unix
|
|
1755
|
+
tech:unreal-engine
|
|
1756
|
+
tech:uwsgi
|
|
1757
|
+
tech:v8
|
|
1758
|
+
tech:vagrant
|
|
1759
|
+
tech:vala
|
|
1760
|
+
tech:vercel
|
|
1761
|
+
tech:veutify
|
|
1762
|
+
tech:vim
|
|
1763
|
+
tech:visualstudio
|
|
1764
|
+
tech:vite
|
|
1765
|
+
tech:vitejs
|
|
1766
|
+
tech:vscode
|
|
1767
|
+
tech:vsphere
|
|
1768
|
+
tech:vue
|
|
1769
|
+
tech:vue-storefront
|
|
1770
|
+
tech:vyper
|
|
1771
|
+
tech:webassembly
|
|
1772
|
+
tech:webflow
|
|
1773
|
+
tech:weblate
|
|
1774
|
+
tech:webpack
|
|
1775
|
+
tech:webstorm
|
|
1776
|
+
tech:windows8
|
|
1777
|
+
tech:windows11
|
|
1778
|
+
tech:woo-commerce
|
|
1779
|
+
tech:wordpress
|
|
1780
|
+
tech:xamarin
|
|
1781
|
+
tech:xcode
|
|
1782
|
+
tech:xml
|
|
1783
|
+
tech:yaml
|
|
1784
|
+
tech:yarn
|
|
1785
|
+
tech:yii-framework
|
|
1786
|
+
tech:yuno-host
|
|
1787
|
+
tech:zend-framework
|
|
1788
|
+
tech:zig
|
|
1789
|
+
}}`,UA="likec4builtin",H5=`${UA}:///likec4/lib/icons.c4`;var Li=vs();const V5=new Li.NotificationType("likec4/onDidChangeModel"),K5=new Li.RequestType0("likec4/fetchModel"),Y5=new Li.RequestType("likec4/fetchComputedModel"),X5=new Li.RequestType("likec4/computeView"),J5=new Li.RequestType("likec4/layout-view"),Q5=new Li.RequestType("likec4/build"),Z5=new Li.RequestType("likec4/locate"),eK=new Li.RequestType("likec4/change-view");class tK{constructor(e){this.services=e}disposables=[];init(){const e=this.services.likec4.ModelBuilder,n=this.services.likec4.ModelLocator,r=this.services.likec4.ModelChanges,i=this.services.likec4.Views,s=this.services.shared.lsp.Connection;if(!s){xe.info("[ServerRpc] no connection, not initializing");return}xe.info("[ServerRpc] init");const o=this.services.shared.workspace.LangiumDocuments,a=this.services.shared.workspace.DocumentBuilder,c=q8(()=>{s.sendNotification(V5,"").catch(l=>(xe.error(`[ServerRpc] error sending onDidChangeModel: ${l}`),Promise.resolve()))},{timing:"trailing",waitMs:300,maxWaitMs:1e3});let u=!0;this.disposables.push(hs.create(()=>{c.cancel()}),e.onModelParsed(()=>c.call()),s.onRequest(Y5,async({cleanCaches:l},d)=>(l&&this.services.WorkspaceCache.clear(),{model:await e.buildComputedModel(d)})),s.onRequest(K5,async l=>({model:await e.buildModel(l)})),s.onRequest(X5,async({viewId:l},d)=>({view:await e.computeView(l,d)})),s.onRequest(J5,async({viewId:l},d)=>({result:await i.layoutView(l,d)})),s.onRequest(Q5,async({docs:l},d)=>{const f=l.map(w=>Wt.parse(w)),p=w=>f.every(E=>!Rt.equals(E,w)),m=o.all.filter(w=>Jl(w)&&p(w.uri)&&w.uri.scheme!==UA).map(w=>w.uri).toArray();xe.debug(`[ServerRpc] received request to build:
|
|
1790
|
+
changed (total ${f.length}):${l.map(w=>`
|
|
1791
|
+
- `+w).join("")}
|
|
1792
|
+
deleted (total ${m.length}):${m.map(w=>`
|
|
1793
|
+
- `+w.toString()).join(`
|
|
1794
|
+
`)}`),!u&&f.length+m.length>0&&(await Promise.allSettled([...f,...m].map(async w=>{const E=w.toString();xe.debug(`clear diagnostics for ${E}`);try{await s.sendDiagnostics({uri:E,diagnostics:[]})}catch(y){xe.warn(`error clearing diagnostics for ${E}: ${y}`)}})),await Nt(d)),u=!1,await a.update(f,m,d)}),s.onRequest(Z5,l=>{if("element"in l)return n.locateElement(l.element,l.property??"name");if("relation"in l)return n.locateRelation(l.relation);if("view"in l)return n.locateView(l.view);if("deployment"in l)return n.locateDeploymentElement(l.deployment,l.property??"name");Ie(l)}),s.onRequest(eK,async(l,d)=>await r.applyChange(l)))}dispose(){let e;for(;e=this.disposables.pop();)try{e.dispose()}catch(n){BC(n)}}}class nK{constructor(e){this.services=e}getSymbolKind(e){const n=bt(e)?e.$type:e.type,r=(...i)=>i.some(s=>this.services.AstReflection.isSubtype(n,s));switch(!0){case r(Hn,Fs,Pi,_i):return er.Constructor;case r(Io,xo,pl,Po,zo):return er.Namespace;case r(Ps):return er.Class;case r(Oi,Ls,xs,qo):return er.EnumMember;case r(xi,Mo):return er.Event;case r(si,Os,Fo,No):return er.TypeParameter}return er.Field}getCompletionItemKind(e){const n=bt(e)?e.$type:e.type,r=(...i)=>i.some(s=>this.services.AstReflection.isSubtype(n,s));switch(!0){case r(xs):return At.Color;case r(Hn,Pi,_i,Fs):return At.Constructor;case r(Io,xo,pl,Po,zo):return At.Module;case r(Ps):return At.Class;case r(Oi,Ls,xs,qo):return At.EnumMember;case r(xi,Mo):return At.Event;case r(si,Fo,Os,No):return At.TypeParameter;default:return At.Reference}}}class rK extends vT{documentFactory;constructor(e){super(e),this.documentFactory=e.workspace.LangiumDocumentFactory}async loadAdditionalDocuments(e,n){n(this.documentFactory.fromString(W5,Wt.parse(H5))),await super.loadAdditionalDocuments(e,n)}workspace(){return this.folders&&ix(this.folders,1)?this.folders[0]:null}get workspaceUri(){const e=this.workspace();return $e(e,"Workspace not initialized"),Wt.parse(e.uri)}get workspaceURL(){const e=this.workspace();return $e(e,"Workspace not initialized"),new URL(e.uri)}}class iK extends TS{}class sK{constructor(e){this.services=e}cache=new WeakMap;viewsWithReportedErrors=new Set;get layouter(){return this.services.likec4.Layouter}async computedViews(e){const n=await this.services.likec4.ModelBuilder.buildComputedModel(e);return n?mc(n.views):[]}async layoutAllViews(e){const n=await this.computedViews(e);if(n.length===0)return[];const r=[],i=[];for(const s of n)this.viewsWithReportedErrors.delete(s.id),i.push(this.layouter.layout(s).then(o=>(this.cache.set(s,o),o)).catch(o=>(this.cache.delete(s),ye(o),Promise.reject(o))));for(const s of await Promise.allSettled(i))s.status==="fulfilled"&&r.push(s.value);return r}async layoutView(e,n){const r=await this.services.likec4.ModelBuilder.buildComputedModel(n);if(!r)return null;const i=r.views[e];if(!i)return null;let s=this.cache.get(i);if(s)return s;try{const o=await this.layouter.layout(i);return this.viewsWithReportedErrors.delete(e),this.cache.set(i,o),o}catch(o){if(!this.viewsWithReportedErrors.has(e)){const a=o instanceof Error?o.message:""+o;this.services.shared.lsp.Connection?.window.showErrorMessage(`LikeC4: ${a}`),this.viewsWithReportedErrors.add(e)}return xe.error(o),Promise.reject(o)}}async diagrams(){return(await this.layoutAllViews()).map(e=>e.diagram)}async viewsAsGraphvizOut(){const e="All-LayoutedViews-DotWithSvg",n=this.services.WorkspaceCache;if(n.has(e))return await Promise.resolve(n.get(e));const r=(await this.computedViews()).map(async o=>{const{dot:a,svg:c}=await this.layouter.svg(o);return{id:o.id,dot:a,svg:c}}),i=[],s=await Promise.allSettled(r);for(const o of s)o.status==="fulfilled"?i.push(o.value):ye(o.reason);return n.set(e,i),i}async overviewGraph(){const e="OverviewGraph",n=this.services.WorkspaceCache;if(n.has(e))return await Promise.resolve(n.get(e));const r=await this.computedViews(),i=await this.layouter.layoutOverviewGraph(r);return n.set(e,i),i}}const oK={lsp:{NodeKindProvider:t=>new nK(t),WorkspaceSymbolProvider:t=>new iK(t)},workspace:{WorkspaceManager:t=>new rK(t)}};function _t(t){return e=>new t(e)}const aK={documentation:{DocumentationProvider:_t(OH)},WorkspaceCache:t=>new mT(t.shared),DocumentCache:t=>new c3(t.shared),Rpc:_t(tK),likec4:{Layouter:t=>(xe.debug("Creating GraphvizLayouter with GraphvizWasmAdapter"),new Rk(new Tk)),Views:_t(sK),DeploymentsIndex:_t(r7),ModelChanges:_t(B5),FqnIndex:_t(a7),ModelParser:_t(_5),ModelBuilder:_t(F7),ModelLocator:_t(B7)},lsp:{CompletionProvider:_t(BH),DocumentHighlightProvider:_t(zH),DocumentSymbolProvider:_t(JH),SemanticTokenProvider:_t(n7),HoverProvider:_t(t7),CodeLensProvider:_t(MH),DocumentLinkProvider:_t(XH),Formatter:_t(LH)},references:{NameProvider:_t(z5),ScopeComputation:_t(j5),ScopeProvider:_t(G5)}};function cK(t,e,n,r){const i=uK(t),s=[y4({shared:i}),kH,aK,e,n,r].reduce(GA,{}),o=Vf(s);return i.ServiceRegistry.register(o),DV(o),t.connection?o.Rpc.init():i.workspace.ConfigurationProvider.initialized({}),{shared:i,likec4:o}}function uK(t={}){const e={...NT,...t};return t.connection&&nW(t.connection),Vf(w4(e),CH,oK)}function GA(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]=GA(i,r):t[n]=r}}return t}function en(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 rw=(t,e)=>{const n=WA(t);if(typeof n!="string")throw new TypeError(`${e} must be a string or a file URL: ${n}.`);return n},WA=t=>t instanceof URL?nm(t):t,HA=(t,e=[],n={})=>{const r=rw(t,"First argument"),[i,s]=en(e)?[[],e]:[e,n];if(!Array.isArray(i))throw new TypeError(`Second argument must be either an array of arguments or an options object: ${i}`);if(i.some(c=>typeof c=="object"&&c!==null))throw new TypeError(`Second argument must be an array of strings: ${i}`);const o=i.map(String),a=o.find(c=>c.includes("\0"));if(a!==void 0)throw new TypeError(`Arguments cannot contain null bytes ("\\0"): ${a}`);if(!en(s))throw new TypeError(`Last argument must be an options object: ${s}`);return[r,o,s]},{toString:VA}=Object.prototype,lK=t=>VA.call(t)==="[object ArrayBuffer]",sr=t=>VA.call(t)==="[object Uint8Array]",rd=t=>new Uint8Array(t.buffer,t.byteOffset,t.byteLength),dK=new TextEncoder,KA=t=>dK.encode(t),fK=new TextDecoder,YA=t=>fK.decode(t),pK=(t,e)=>hK(t,e).join(""),hK=(t,e)=>{if(e==="utf8"&&t.every(s=>typeof s=="string"))return t;const n=new zb(e),r=t.map(s=>typeof s=="string"?KA(s):s).map(s=>n.write(s)),i=n.end();return i===""?r:[...r,i]},iw=t=>t.length===1&&sr(t[0])?t[0]:XA(mK(t)),mK=t=>t.map(e=>typeof e=="string"?KA(e):e),XA=t=>{const e=new Uint8Array(gK(t));let n=0;for(const r of t)e.set(r,n),n+=r.length;return e},gK=t=>{let e=0;for(const n of t)e+=n.length;return e},yK=t=>Array.isArray(t)&&Array.isArray(t.raw),vK=(t,e)=>{let n=[];for(const[s,o]of t.entries())n=wK({templates:t,expressions:e,tokens:n,index:s,template:o});if(n.length===0)throw new TypeError("Template script must not be empty");const[r,...i]=n;return[r,i,{}]},wK=({templates:t,expressions:e,tokens:n,index:r,template:i})=>{if(i===void 0)throw new TypeError(`Invalid backslash sequence: ${t.raw[r]}`);const{nextTokens:s,leadingWhitespaces:o,trailingWhitespaces:a}=bK(i,t.raw[r]),c=QA(n,s,o);if(r===e.length)return c;const u=e[r],l=Array.isArray(u)?u.map(d=>ZA(d)):[ZA(u)];return QA(c,l,a)},bK=(t,e)=>{if(e.length===0)return{nextTokens:[],leadingWhitespaces:!1,trailingWhitespaces:!1};const n=[];let r=0;const i=JA.has(e[0]);for(let o=0,a=0;o<t.length;o+=1,a+=1){const c=e[a];if(JA.has(c))r!==o&&n.push(t.slice(r,o)),r=o+1;else if(c==="\\"){const u=e[a+1];u==="u"&&e[a+2]==="{"?a=e.indexOf("}",a+3):a+=DK[u]??1}}const s=r===t.length;return s||n.push(t.slice(r)),{nextTokens:n,leadingWhitespaces:i,trailingWhitespaces:s}},JA=new Set([" "," ","\r",`
|
|
1795
|
+
`]),DK={x:3,u:5},QA=(t,e,n)=>n||t.length===0||e.length===0?[...t,...e]:[...t.slice(0,-1),`${t.at(-1)}${e[0]}`,...e.slice(1)],ZA=t=>{const e=typeof t;if(e==="string")return t;if(e==="number")return String(t);if(en(t)&&("stdout"in t||"isMaxBuffer"in t))return EK(t);throw t instanceof Bb||Object.prototype.toString.call(t)==="[object Promise]"?new TypeError("Unexpected subprocess in template expression. Please use ${await subprocess} instead of ${subprocess}."):new TypeError(`Unexpected "${e}" in template expression`)},EK=({stdout:t})=>{if(typeof t=="string")return t;if(sr(t))return YA(t);throw t===void 0?new TypeError(`Missing result.stdout in template expression. This is probably due to the previous subprocess' "stdout" option.`):new TypeError(`Unexpected "${typeof t}" stdout in template expression`)},Bs=t=>sw.includes(t),sw=[tt.stdin,tt.stdout,tt.stderr],kr=["stdin","stdout","stderr"],e_=t=>kr[t]??`stdio[${t}]`,RK=t=>{const e={...t};for(const n of i_)e[n]=t_(t,n);return e},t_=(t,e)=>{const n=Array.from({length:TK(t)+1}),r=$K(t[e],n,e);return _K(r,e)},TK=({stdio:t})=>Array.isArray(t)?Math.max(t.length,kr.length):kr.length,$K=(t,e,n)=>en(t)?SK(t,e,n):e.fill(t),SK=(t,e,n)=>{for(const r of Object.keys(t).sort(CK))for(const i of kK(r,n,e))e[i]=t[r];return e},CK=(t,e)=>n_(t)<n_(e)?1:-1,n_=t=>t==="stdout"||t==="stderr"?0:t==="all"?2:1,kK=(t,e,n)=>{if(t==="ipc")return[n.length-1];const r=r_(t);if(r===void 0||r===0)throw new TypeError(`"${e}.${t}" is invalid.
|
|
1796
|
+
It must be "${e}.stdout", "${e}.stderr", "${e}.all", "${e}.ipc", or "${e}.fd3", "${e}.fd4" (and so on).`);if(r>=n.length)throw new TypeError(`"${e}.${t}" is invalid: that file descriptor does not exist.
|
|
1797
|
+
Please set the "stdio" option to ensure that file descriptor exists.`);return r==="all"?[1,2]:[r]},r_=t=>{if(t==="all")return t;if(kr.includes(t))return kr.indexOf(t);const e=AK.exec(t);if(e!==null)return Number(e[1])},AK=/^fd(\d+)$/,_K=(t,e)=>t.map(n=>n===void 0?IK[e]:n),PK=FI("execa").enabled?"full":"none",IK={lines:!1,buffer:!0,maxBuffer:1e3*1e3*100,verbose:PK,stripFinalNewline:!0},i_=["lines","buffer","maxBuffer","verbose","stripFinalNewline"],id=(t,e)=>e==="ipc"?t.at(-1):t[e],ow=({verbose:t},e)=>cw(t,e)!=="none",aw=({verbose:t},e)=>!["none","short"].includes(cw(t,e)),xK=({verbose:t},e)=>{const n=cw(t,e);return uw(n)?n:void 0},cw=(t,e)=>e===void 0?OK(t):id(t,e),OK=t=>t.find(e=>uw(e))??lw.findLast(e=>t.includes(e)),uw=t=>typeof t=="function",lw=["none","short","full"],NK=(t,e)=>{const n=[t,...e],r=n.join(" "),i=n.map(s=>qK(s_(s))).join(" ");return{command:r,escapedCommand:i}},dw=t=>LI(t).split(`
|
|
1798
|
+
`).map(e=>s_(e)).join(`
|
|
1799
|
+
`),s_=t=>t.replaceAll(MK,e=>FK(e)),FK=t=>{const e=BK[t];if(e!==void 0)return e;const n=t.codePointAt(0),r=n.toString(16);return n<=zK?`\\u${r.padStart(4,"0")}`:`\\U${r}`},LK=()=>{try{return new RegExp("\\p{Separator}|\\p{Other}","gu")}catch{return/[\s\u0000-\u001F\u007F-\u009F\u00AD]/g}},MK=LK(),BK={" ":" ","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t"},zK=65535,qK=t=>jK.test(t)?t:ox==="win32"?`"${t.replaceAll('"','""')}"`:`'${t.replaceAll("'","'\\''")}'`,jK=/^[\w./-]+$/;function UK(){return tt.platform!=="win32"?tt.env.TERM!=="linux":!!tt.env.WT_SESSION||!!tt.env.TERMINUS_SUBLIME||tt.env.ConEmuTask==="{cmd::Cmder}"||tt.env.TERM_PROGRAM==="Terminus-Sublime"||tt.env.TERM_PROGRAM==="vscode"||tt.env.TERM==="xterm-256color"||tt.env.TERM==="alacritty"||tt.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}const o_={circleQuestionMark:"(?)",questionMarkPrefix:"(?)",square:"\u2588",squareDarkShade:"\u2593",squareMediumShade:"\u2592",squareLightShade:"\u2591",squareTop:"\u2580",squareBottom:"\u2584",squareLeft:"\u258C",squareRight:"\u2590",squareCenter:"\u25A0",bullet:"\u25CF",dot:"\u2024",ellipsis:"\u2026",pointerSmall:"\u203A",triangleUp:"\u25B2",triangleUpSmall:"\u25B4",triangleDown:"\u25BC",triangleDownSmall:"\u25BE",triangleLeftSmall:"\u25C2",triangleRightSmall:"\u25B8",home:"\u2302",heart:"\u2665",musicNote:"\u266A",musicNoteBeamed:"\u266B",arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",arrowLeftRight:"\u2194",arrowUpDown:"\u2195",almostEqual:"\u2248",notEqual:"\u2260",lessOrEqual:"\u2264",greaterOrEqual:"\u2265",identical:"\u2261",infinity:"\u221E",subscriptZero:"\u2080",subscriptOne:"\u2081",subscriptTwo:"\u2082",subscriptThree:"\u2083",subscriptFour:"\u2084",subscriptFive:"\u2085",subscriptSix:"\u2086",subscriptSeven:"\u2087",subscriptEight:"\u2088",subscriptNine:"\u2089",oneHalf:"\xBD",oneThird:"\u2153",oneQuarter:"\xBC",oneFifth:"\u2155",oneSixth:"\u2159",oneEighth:"\u215B",twoThirds:"\u2154",twoFifths:"\u2156",threeQuarters:"\xBE",threeFifths:"\u2157",threeEighths:"\u215C",fourFifths:"\u2158",fiveSixths:"\u215A",fiveEighths:"\u215D",sevenEighths:"\u215E",line:"\u2500",lineBold:"\u2501",lineDouble:"\u2550",lineDashed0:"\u2504",lineDashed1:"\u2505",lineDashed2:"\u2508",lineDashed3:"\u2509",lineDashed4:"\u254C",lineDashed5:"\u254D",lineDashed6:"\u2574",lineDashed7:"\u2576",lineDashed8:"\u2578",lineDashed9:"\u257A",lineDashed10:"\u257C",lineDashed11:"\u257E",lineDashed12:"\u2212",lineDashed13:"\u2013",lineDashed14:"\u2010",lineDashed15:"\u2043",lineVertical:"\u2502",lineVerticalBold:"\u2503",lineVerticalDouble:"\u2551",lineVerticalDashed0:"\u2506",lineVerticalDashed1:"\u2507",lineVerticalDashed2:"\u250A",lineVerticalDashed3:"\u250B",lineVerticalDashed4:"\u254E",lineVerticalDashed5:"\u254F",lineVerticalDashed6:"\u2575",lineVerticalDashed7:"\u2577",lineVerticalDashed8:"\u2579",lineVerticalDashed9:"\u257B",lineVerticalDashed10:"\u257D",lineVerticalDashed11:"\u257F",lineDownLeft:"\u2510",lineDownLeftArc:"\u256E",lineDownBoldLeftBold:"\u2513",lineDownBoldLeft:"\u2512",lineDownLeftBold:"\u2511",lineDownDoubleLeftDouble:"\u2557",lineDownDoubleLeft:"\u2556",lineDownLeftDouble:"\u2555",lineDownRight:"\u250C",lineDownRightArc:"\u256D",lineDownBoldRightBold:"\u250F",lineDownBoldRight:"\u250E",lineDownRightBold:"\u250D",lineDownDoubleRightDouble:"\u2554",lineDownDoubleRight:"\u2553",lineDownRightDouble:"\u2552",lineUpLeft:"\u2518",lineUpLeftArc:"\u256F",lineUpBoldLeftBold:"\u251B",lineUpBoldLeft:"\u251A",lineUpLeftBold:"\u2519",lineUpDoubleLeftDouble:"\u255D",lineUpDoubleLeft:"\u255C",lineUpLeftDouble:"\u255B",lineUpRight:"\u2514",lineUpRightArc:"\u2570",lineUpBoldRightBold:"\u2517",lineUpBoldRight:"\u2516",lineUpRightBold:"\u2515",lineUpDoubleRightDouble:"\u255A",lineUpDoubleRight:"\u2559",lineUpRightDouble:"\u2558",lineUpDownLeft:"\u2524",lineUpBoldDownBoldLeftBold:"\u252B",lineUpBoldDownBoldLeft:"\u2528",lineUpDownLeftBold:"\u2525",lineUpBoldDownLeftBold:"\u2529",lineUpDownBoldLeftBold:"\u252A",lineUpDownBoldLeft:"\u2527",lineUpBoldDownLeft:"\u2526",lineUpDoubleDownDoubleLeftDouble:"\u2563",lineUpDoubleDownDoubleLeft:"\u2562",lineUpDownLeftDouble:"\u2561",lineUpDownRight:"\u251C",lineUpBoldDownBoldRightBold:"\u2523",lineUpBoldDownBoldRight:"\u2520",lineUpDownRightBold:"\u251D",lineUpBoldDownRightBold:"\u2521",lineUpDownBoldRightBold:"\u2522",lineUpDownBoldRight:"\u251F",lineUpBoldDownRight:"\u251E",lineUpDoubleDownDoubleRightDouble:"\u2560",lineUpDoubleDownDoubleRight:"\u255F",lineUpDownRightDouble:"\u255E",lineDownLeftRight:"\u252C",lineDownBoldLeftBoldRightBold:"\u2533",lineDownLeftBoldRightBold:"\u252F",lineDownBoldLeftRight:"\u2530",lineDownBoldLeftBoldRight:"\u2531",lineDownBoldLeftRightBold:"\u2532",lineDownLeftRightBold:"\u252E",lineDownLeftBoldRight:"\u252D",lineDownDoubleLeftDoubleRightDouble:"\u2566",lineDownDoubleLeftRight:"\u2565",lineDownLeftDoubleRightDouble:"\u2564",lineUpLeftRight:"\u2534",lineUpBoldLeftBoldRightBold:"\u253B",lineUpLeftBoldRightBold:"\u2537",lineUpBoldLeftRight:"\u2538",lineUpBoldLeftBoldRight:"\u2539",lineUpBoldLeftRightBold:"\u253A",lineUpLeftRightBold:"\u2536",lineUpLeftBoldRight:"\u2535",lineUpDoubleLeftDoubleRightDouble:"\u2569",lineUpDoubleLeftRight:"\u2568",lineUpLeftDoubleRightDouble:"\u2567",lineUpDownLeftRight:"\u253C",lineUpBoldDownBoldLeftBoldRightBold:"\u254B",lineUpDownBoldLeftBoldRightBold:"\u2548",lineUpBoldDownLeftBoldRightBold:"\u2547",lineUpBoldDownBoldLeftRightBold:"\u254A",lineUpBoldDownBoldLeftBoldRight:"\u2549",lineUpBoldDownLeftRight:"\u2540",lineUpDownBoldLeftRight:"\u2541",lineUpDownLeftBoldRight:"\u253D",lineUpDownLeftRightBold:"\u253E",lineUpBoldDownBoldLeftRight:"\u2542",lineUpDownLeftBoldRightBold:"\u253F",lineUpBoldDownLeftBoldRight:"\u2543",lineUpBoldDownLeftRightBold:"\u2544",lineUpDownBoldLeftBoldRight:"\u2545",lineUpDownBoldLeftRightBold:"\u2546",lineUpDoubleDownDoubleLeftDoubleRightDouble:"\u256C",lineUpDoubleDownDoubleLeftRight:"\u256B",lineUpDownLeftDoubleRightDouble:"\u256A",lineCross:"\u2573",lineBackslash:"\u2572",lineSlash:"\u2571"},GK={tick:"\u2714",info:"\u2139",warning:"\u26A0",cross:"\u2718",squareSmall:"\u25FB",squareSmallFilled:"\u25FC",circle:"\u25EF",circleFilled:"\u25C9",circleDotted:"\u25CC",circleDouble:"\u25CE",circleCircle:"\u24DE",circleCross:"\u24E7",circlePipe:"\u24BE",radioOn:"\u25C9",radioOff:"\u25EF",checkboxOn:"\u2612",checkboxOff:"\u2610",checkboxCircleOn:"\u24E7",checkboxCircleOff:"\u24BE",pointer:"\u276F",triangleUpOutline:"\u25B3",triangleLeft:"\u25C0",triangleRight:"\u25B6",lozenge:"\u25C6",lozengeOutline:"\u25C7",hamburger:"\u2630",smiley:"\u32E1",mustache:"\u0DF4",star:"\u2605",play:"\u25B6",nodejs:"\u2B22",oneSeventh:"\u2150",oneNinth:"\u2151",oneTenth:"\u2152"},WK={tick:"\u221A",info:"i",warning:"\u203C",cross:"\xD7",squareSmall:"\u25A1",squareSmallFilled:"\u25A0",circle:"( )",circleFilled:"(*)",circleDotted:"( )",circleDouble:"( )",circleCircle:"(\u25CB)",circleCross:"(\xD7)",circlePipe:"(\u2502)",radioOn:"(*)",radioOff:"( )",checkboxOn:"[\xD7]",checkboxOff:"[ ]",checkboxCircleOn:"(\xD7)",checkboxCircleOff:"( )",pointer:">",triangleUpOutline:"\u2206",triangleLeft:"\u25C4",triangleRight:"\u25BA",lozenge:"\u2666",lozengeOutline:"\u25CA",hamburger:"\u2261",smiley:"\u263A",mustache:"\u250C\u2500\u2510",star:"\u2736",play:"\u25BA",nodejs:"\u2666",oneSeventh:"1/7",oneNinth:"1/9",oneTenth:"1/10"},HK={...o_,...GK},VK={...o_,...WK},KK=UK(),fw=KK?HK:VK,YK=Mb.WriteStream.prototype.hasColors(),Ch=(t,e)=>{if(!YK)return i=>i;const n=`\x1B[${t}m`,r=`\x1B[${e}m`;return i=>{const s=i+"";let o=s.indexOf(r);if(o===-1)return n+s+r;let a=n,c=0;for(;o!==-1;)a+=s.slice(c,o)+n,c=o+r.length,o=s.indexOf(r,c);return a+=s.slice(c)+r,a}},XK=Ch(1,22),pw=Ch(90,39),JK=Ch(91,39),QK=Ch(93,39),ZK=({type:t,message:e,timestamp:n,piped:r,commandId:i,result:{failed:s=!1}={},options:{reject:o=!0}})=>{const a=eY(n),c=tY[t]({failed:s,reject:o,piped:r}),u=nY[t]({reject:o});return`${pw(`[${a}]`)} ${pw(`[${i}]`)} ${u(c)} ${u(e)}`},eY=t=>`${kh(t.getHours(),2)}:${kh(t.getMinutes(),2)}:${kh(t.getSeconds(),2)}.${kh(t.getMilliseconds(),3)}`,kh=(t,e)=>String(t).padStart(e,"0"),a_=({failed:t,reject:e})=>t?e?fw.cross:fw.warning:fw.tick,tY={command:({piped:t})=>t?"|":"$",output:()=>" ",ipc:()=>"*",error:a_,duration:a_},c_=t=>t,nY={command:()=>XK,output:()=>c_,ipc:()=>c_,error:({reject:t})=>t?JK:QK,duration:()=>pw},rY=(t,e,n)=>{const r=xK(e,n);return t.map(({verboseLine:i,verboseObject:s})=>iY(i,s,r)).filter(i=>i!==void 0).map(i=>sY(i)).join("")},iY=(t,e,n)=>{if(n===void 0)return t;const r=n(t,e);if(typeof r=="string")return r},sY=t=>t.endsWith(`
|
|
1800
|
+
`)?t:`${t}
|
|
1801
|
+
`,sd=({type:t,verboseMessage:e,fdNumber:n,verboseInfo:r,result:i})=>{const s=oY({type:t,result:i,verboseInfo:r}),o=aY(e,s),a=rY(o,r,n);Rb(uY,a)},oY=({type:t,result:e,verboseInfo:{escapedCommand:n,commandId:r,rawOptions:{piped:i=!1,...s}}})=>({type:t,escapedCommand:n,commandId:`${r}`,timestamp:new Date,piped:i,result:e,options:s}),aY=(t,e)=>t.split(`
|
|
1802
|
+
`).map(n=>cY({...e,message:n})),cY=t=>({verboseLine:ZK(t),verboseObject:t}),uY=2,u_=t=>{const e=typeof t=="string"?t:yd(t);return dw(e).replaceAll(" "," ".repeat(lY))},lY=2,dY=(t,e)=>{ow(e)&&sd({type:"command",verboseMessage:t,verboseInfo:e})},fY=(t,e,n)=>{mY(t);const r=pY(t);return{verbose:t,escapedCommand:e,commandId:r,rawOptions:n}},pY=t=>ow({verbose:t})?hY++:void 0;let hY=0n;const mY=t=>{for(const e of t){if(e===!1)throw new TypeError(`The "verbose: false" option was renamed to "verbose: 'none'".`);if(e===!0)throw new TypeError(`The "verbose: true" option was renamed to "verbose: 'short'".`);if(!lw.includes(e)&&!uw(e)){const n=lw.map(r=>`'${r}'`).join(", ");throw new TypeError(`The "verbose" option must not be ${e}. Allowed values are: ${n} or a function.`)}}},l_=()=>wd.bigint(),d_=t=>Number(wd.bigint()-t)/1e6,f_=(t,e,n)=>{const r=l_(),{command:i,escapedCommand:s}=NK(t,e),o=t_(n,"verbose"),a=fY(o,s,{...n});return dY(s,a),{command:i,escapedCommand:s,startTime:r,verboseInfo:a}};var zs={exports:{}},hw,p_;function gY(){if(p_)return hw;p_=1,hw=r,r.sync=i;var t=Xs;function e(s,o){var a=o.pathExt!==void 0?o.pathExt:process.env.PATHEXT;if(!a||(a=a.split(";"),a.indexOf("")!==-1))return!0;for(var c=0;c<a.length;c++){var u=a[c].toLowerCase();if(u&&s.substr(-u.length).toLowerCase()===u)return!0}return!1}function n(s,o,a){return!s.isSymbolicLink()&&!s.isFile()?!1:e(o,a)}function r(s,o,a){t.stat(s,function(c,u){a(c,c?!1:n(u,s,o))})}function i(s,o){return n(t.statSync(s),s,o)}return hw}var mw,h_;function yY(){if(h_)return mw;h_=1,mw=e,e.sync=n;var t=Xs;function e(s,o,a){t.stat(s,function(c,u){a(c,c?!1:r(u,o))})}function n(s,o){return r(t.statSync(s),o)}function r(s,o){return s.isFile()&&i(s,o)}function i(s,o){var a=s.mode,c=s.uid,u=s.gid,l=o.uid!==void 0?o.uid:process.getuid&&process.getuid(),d=o.gid!==void 0?o.gid:process.getgid&&process.getgid(),f=parseInt("100",8),p=parseInt("010",8),m=parseInt("001",8),w=f|p,E=a&m||a&p&&u===d||a&f&&c===l||a&w&&l===0;return E}return mw}var gw,m_;function vY(){if(m_)return gw;m_=1;var t;process.platform==="win32"||Qq.TESTING_WINDOWS?t=gY():t=yY(),gw=e,e.sync=n;function e(r,i,s){if(typeof i=="function"&&(s=i,i={}),!s){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(o,a){e(r,i||{},function(c,u){c?a(c):o(u)})})}t(r,i||{},function(o,a){o&&(o.code==="EACCES"||i&&i.ignoreErrors)&&(o=null,a=!1),s(o,a)})}function n(r,i){try{return t.sync(r,i||{})}catch(s){if(i&&i.ignoreErrors||s.code==="EACCES")return!1;throw s}}return gw}var yw,g_;function wY(){if(g_)return yw;g_=1;const t=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",e=dr,n=t?";":":",r=vY(),i=c=>Object.assign(new Error(`not found: ${c}`),{code:"ENOENT"}),s=(c,u)=>{const l=u.colon||n,d=c.match(/\//)||t&&c.match(/\\/)?[""]:[...t?[process.cwd()]:[],...(u.path||process.env.PATH||"").split(l)],f=t?u.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",p=t?f.split(l):[""];return t&&c.indexOf(".")!==-1&&p[0]!==""&&p.unshift(""),{pathEnv:d,pathExt:p,pathExtExe:f}},o=(c,u,l)=>{typeof u=="function"&&(l=u,u={}),u||(u={});const{pathEnv:d,pathExt:f,pathExtExe:p}=s(c,u),m=[],w=y=>new Promise((b,R)=>{if(y===d.length)return u.all&&m.length?b(m):R(i(c));const C=d[y],A=/^".*"$/.test(C)?C.slice(1,-1):C,q=e.join(A,c),G=!A&&/^\.[\\\/]/.test(c)?c.slice(0,2)+q:q;b(E(G,y,0))}),E=(y,b,R)=>new Promise((C,A)=>{if(R===f.length)return C(w(b+1));const q=f[R];r(y+q,{pathExt:p},(G,Q)=>{if(!G&&Q)if(u.all)m.push(y+q);else return C(y+q);return C(E(y,b,R+1))})});return l?w(0).then(y=>l(null,y),l):w(0)},a=(c,u)=>{u=u||{};const{pathEnv:l,pathExt:d,pathExtExe:f}=s(c,u),p=[];for(let m=0;m<l.length;m++){const w=l[m],E=/^".*"$/.test(w)?w.slice(1,-1):w,y=e.join(E,c),b=!E&&/^\.[\\\/]/.test(c)?c.slice(0,2)+y:y;for(let R=0;R<d.length;R++){const C=b+d[R];try{if(r.sync(C,{pathExt:f}))if(u.all)p.push(C);else return C}catch{}}}if(u.all&&p.length)return p;if(u.nothrow)return null;throw i(c)};return yw=o,o.sync=a,yw}var Ah={exports:{}},y_;function bY(){if(y_)return Ah.exports;y_=1;const t=(e={})=>{const n=e.env||process.env;return(e.platform||process.platform)!=="win32"?"PATH":Object.keys(n).reverse().find(i=>i.toUpperCase()==="PATH")||"Path"};return Ah.exports=t,Ah.exports.default=t,Ah.exports}var vw,v_;function DY(){if(v_)return vw;v_=1;const t=dr,e=wY(),n=bY();function r(s,o){const a=s.options.env||process.env,c=process.cwd(),u=s.options.cwd!=null,l=u&&process.chdir!==void 0&&!process.chdir.disabled;if(l)try{process.chdir(s.options.cwd)}catch{}let d;try{d=e.sync(s.command,{path:a[n({env:a})],pathExt:o?t.delimiter:void 0})}catch{}finally{l&&process.chdir(c)}return d&&(d=t.resolve(u?s.options.cwd:"",d)),d}function i(s){return r(s)||r(s,!0)}return vw=i,vw}var _h={},w_;function EY(){if(w_)return _h;w_=1;const t=/([()\][%!^"`<>&|;, *?])/g;function e(r){return r=r.replace(t,"^$1"),r}function n(r,i){return r=`${r}`,r=r.replace(/(\\*)"/g,'$1$1\\"'),r=r.replace(/(\\*)$/,"$1$1"),r=`"${r}"`,r=r.replace(t,"^$1"),i&&(r=r.replace(t,"^$1")),r}return _h.command=e,_h.argument=n,_h}var ww,b_;function RY(){return b_||(b_=1,ww=/^#!(.*)/),ww}var bw,D_;function TY(){if(D_)return bw;D_=1;const t=RY();return bw=(e="")=>{const n=e.match(t);if(!n)return null;const[r,i]=n[0].replace(/#! ?/,"").split(" "),s=r.split("/").pop();return s==="env"?i:i?`${s} ${i}`:s},bw}var Dw,E_;function $Y(){if(E_)return Dw;E_=1;const t=Xs,e=TY();function n(r){const s=Buffer.alloc(150);let o;try{o=t.openSync(r,"r"),t.readSync(o,s,0,150,0),t.closeSync(o)}catch{}return e(s.toString())}return Dw=n,Dw}var Ew,R_;function SY(){if(R_)return Ew;R_=1;const t=dr,e=DY(),n=EY(),r=$Y(),i=process.platform==="win32",s=/\.(?:com|exe)$/i,o=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function a(l){l.file=e(l);const d=l.file&&r(l.file);return d?(l.args.unshift(l.file),l.command=d,e(l)):l.file}function c(l){if(!i)return l;const d=a(l),f=!s.test(d);if(l.options.forceShell||f){const p=o.test(d);l.command=t.normalize(l.command),l.command=n.command(l.command),l.args=l.args.map(w=>n.argument(w,p));const m=[l.command].concat(l.args).join(" ");l.args=["/d","/s","/c",`"${m}"`],l.command=process.env.comspec||"cmd.exe",l.options.windowsVerbatimArguments=!0}return l}function u(l,d,f){d&&!Array.isArray(d)&&(f=d,d=null),d=d?d.slice(0):[],f=Object.assign({},f);const p={command:l,args:d,options:f,file:void 0,original:{command:l,args:d}};return f.shell?p:c(p)}return Ew=u,Ew}var Rw,T_;function CY(){if(T_)return Rw;T_=1;const t=process.platform==="win32";function e(s,o){return Object.assign(new Error(`${o} ${s.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${o} ${s.command}`,path:s.command,spawnargs:s.args})}function n(s,o){if(!t)return;const a=s.emit;s.emit=function(c,u){if(c==="exit"){const l=r(u,o);if(l)return a.call(s,"error",l)}return a.apply(s,arguments)}}function r(s,o){return t&&s===1&&!o.file?e(o.original,"spawn"):null}function i(s,o){return t&&s===1&&!o.file?e(o.original,"spawnSync"):null}return Rw={hookChildProcess:n,verifyENOENT:r,verifyENOENTSync:i,notFoundError:e},Rw}var $_;function kY(){if($_)return zs.exports;$_=1;const t=kb,e=SY(),n=CY();function r(s,o,a){const c=e(s,o,a),u=t.spawn(c.command,c.args,c.options);return n.hookChildProcess(u,c),u}function i(s,o,a){const c=e(s,o,a),u=t.spawnSync(c.command,c.args,c.options);return u.error=u.error||n.verifyENOENTSync(u.status,c),u}return zs.exports=r,zs.exports.spawn=r,zs.exports.sync=i,zs.exports._parse=e,zs.exports._enoent=n,zs.exports}var AY=kY();const _Y=Lf(AY);function S_(t={}){const{env:e=process.env,platform:n=process.platform}=t;return n!=="win32"?"PATH":Object.keys(e).reverse().find(r=>r.toUpperCase()==="PATH")||"Path"}const PY=({cwd:t=tt.cwd(),path:e=tt.env[S_()],preferLocal:n=!0,execPath:r=tt.execPath,addExecPath:i=!0}={})=>{const s=t instanceof URL?nm(t):t,o=Pr.resolve(s),a=[];return n&&IY(a,o),i&&xY(a,r,o),[...a,e].join(Pr.delimiter)},IY=(t,e)=>{let n;for(;n!==e;)t.push(Pr.join(e,"node_modules/.bin")),n=e,e=Pr.resolve(e,"..")},xY=(t,e,n)=>{const r=e instanceof URL?nm(e):e;t.push(Pr.resolve(n,r,".."))},OY=({env:t=tt.env,...e}={})=>{t={...t};const n=S_({env:t});return e.path=t[n],t[n]=PY(e),t},NY=(t,e,n)=>{const r=n?Sw:$w,i=t instanceof od?{}:{cause:t};return new r(e,i)};class od extends Error{}const C_=(t,e)=>{Object.defineProperty(t.prototype,"name",{value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,k_,{value:!0,writable:!1,enumerable:!1,configurable:!1})},FY=t=>Tw(t)&&k_ in t,k_=Symbol("isExecaError"),Tw=t=>Object.prototype.toString.call(t)==="[object Error]";class $w extends Error{}C_($w,$w.name);class Sw extends Error{}C_(Sw,Sw.name);const LY=()=>{const t=__-A_+1;return Array.from({length:t},MY)},MY=(t,e)=>({name:`SIGRT${e+1}`,number:A_+e,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}),A_=34,__=64,BY=[{name:"SIGHUP",number:1,action:"terminate",description:"Terminal closed",standard:"posix"},{name:"SIGINT",number:2,action:"terminate",description:"User interruption with CTRL-C",standard:"ansi"},{name:"SIGQUIT",number:3,action:"core",description:"User interruption with CTRL-\\",standard:"posix"},{name:"SIGILL",number:4,action:"core",description:"Invalid machine instruction",standard:"ansi"},{name:"SIGTRAP",number:5,action:"core",description:"Debugger breakpoint",standard:"posix"},{name:"SIGABRT",number:6,action:"core",description:"Aborted",standard:"ansi"},{name:"SIGIOT",number:6,action:"core",description:"Aborted",standard:"bsd"},{name:"SIGBUS",number:7,action:"core",description:"Bus error due to misaligned, non-existing address or paging error",standard:"bsd"},{name:"SIGEMT",number:7,action:"terminate",description:"Command should be emulated but is not implemented",standard:"other"},{name:"SIGFPE",number:8,action:"core",description:"Floating point arithmetic error",standard:"ansi"},{name:"SIGKILL",number:9,action:"terminate",description:"Forced termination",standard:"posix",forced:!0},{name:"SIGUSR1",number:10,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGSEGV",number:11,action:"core",description:"Segmentation fault",standard:"ansi"},{name:"SIGUSR2",number:12,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGPIPE",number:13,action:"terminate",description:"Broken pipe or socket",standard:"posix"},{name:"SIGALRM",number:14,action:"terminate",description:"Timeout or timer",standard:"posix"},{name:"SIGTERM",number:15,action:"terminate",description:"Termination",standard:"ansi"},{name:"SIGSTKFLT",number:16,action:"terminate",description:"Stack is empty or overflowed",standard:"other"},{name:"SIGCHLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"posix"},{name:"SIGCLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"other"},{name:"SIGCONT",number:18,action:"unpause",description:"Unpaused",standard:"posix",forced:!0},{name:"SIGSTOP",number:19,action:"pause",description:"Paused",standard:"posix",forced:!0},{name:"SIGTSTP",number:20,action:"pause",description:'Paused using CTRL-Z or "suspend"',standard:"posix"},{name:"SIGTTIN",number:21,action:"pause",description:"Background process cannot read terminal input",standard:"posix"},{name:"SIGBREAK",number:21,action:"terminate",description:"User interruption with CTRL-BREAK",standard:"other"},{name:"SIGTTOU",number:22,action:"pause",description:"Background process cannot write to terminal output",standard:"posix"},{name:"SIGURG",number:23,action:"ignore",description:"Socket received out-of-band data",standard:"bsd"},{name:"SIGXCPU",number:24,action:"core",description:"Process timed out",standard:"bsd"},{name:"SIGXFSZ",number:25,action:"core",description:"File too big",standard:"bsd"},{name:"SIGVTALRM",number:26,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGPROF",number:27,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGWINCH",number:28,action:"ignore",description:"Terminal window size changed",standard:"bsd"},{name:"SIGIO",number:29,action:"terminate",description:"I/O is available",standard:"other"},{name:"SIGPOLL",number:29,action:"terminate",description:"Watched event",standard:"other"},{name:"SIGINFO",number:29,action:"ignore",description:"Request for process information",standard:"other"},{name:"SIGPWR",number:30,action:"terminate",description:"Device running out of power",standard:"systemv"},{name:"SIGSYS",number:31,action:"core",description:"Invalid system call",standard:"other"},{name:"SIGUNUSED",number:31,action:"terminate",description:"Invalid system call",standard:"other"}],P_=()=>{const t=LY();return[...BY,...t].map(zY)},zY=({name:t,number:e,description:n,action:r,forced:i=!1,standard:s})=>{const{signals:{[t]:o}}=Xi,a=o!==void 0;return{name:t,number:a?o:e,description:n,supported:a,action:r,forced:i,standard:s}},qY=()=>{const t=P_();return Object.fromEntries(t.map(jY))},jY=({name:t,number:e,description:n,supported:r,action:i,forced:s,standard:o})=>[t,{name:t,number:e,description:n,supported:r,action:i,forced:s,standard:o}],UY=qY(),GY=()=>{const t=P_(),e=__+1,n=Array.from({length:e},(r,i)=>WY(i,t));return Object.assign({},...n)},WY=(t,e)=>{const n=HY(t,e);if(n===void 0)return{};const{name:r,description:i,supported:s,action:o,forced:a,standard:c}=n;return{[t]:{name:r,number:t,description:i,supported:s,action:o,forced:a,standard:c}}},HY=(t,e)=>{const n=e.find(({name:r})=>Xi.signals[r]===t);return n!==void 0?n:e.find(r=>r.number===t)};GY();const VY=t=>{const e="option `killSignal`";if(t===0)throw new TypeError(`Invalid ${e}: 0 cannot be used.`);return I_(t,e)},KY=t=>t===0?t:I_(t,"`subprocess.kill()`'s argument"),I_=(t,e)=>{if(Number.isInteger(t))return YY(t,e);if(typeof t=="string")return JY(t,e);throw new TypeError(`Invalid ${e} ${String(t)}: it must be a string or an integer.
|
|
1803
|
+
${Cw()}`)},YY=(t,e)=>{if(x_.has(t))return x_.get(t);throw new TypeError(`Invalid ${e} ${t}: this signal integer does not exist.
|
|
1804
|
+
${Cw()}`)},XY=()=>new Map(Object.entries(Xi.signals).reverse().map(([t,e])=>[e,t])),x_=XY(),JY=(t,e)=>{if(t in Xi.signals)return t;throw t.toUpperCase()in Xi.signals?new TypeError(`Invalid ${e} '${t}': please rename it to '${t.toUpperCase()}'.`):new TypeError(`Invalid ${e} '${t}': this signal name does not exist.
|
|
1805
|
+
${Cw()}`)},Cw=()=>`Available signal names: ${QY()}.
|
|
1806
|
+
Available signal numbers: ${ZY()}.`,QY=()=>Object.keys(Xi.signals).sort().map(t=>`'${t}'`).join(", "),ZY=()=>[...new Set(Object.values(Xi.signals).sort((t,e)=>t-e))].join(", "),O_=t=>UY[t].description,eX=t=>{if(t===!1)return t;if(t===!0)return tX;if(!Number.isFinite(t)||t<0)throw new TypeError(`Expected the \`forceKillAfterDelay\` option to be a non-negative integer, got \`${t}\` (${typeof t})`);return t},tX=1e3*5,nX=({kill:t,options:{forceKillAfterDelay:e,killSignal:n},onInternalError:r,context:i,controller:s},o,a)=>{const{signal:c,error:u}=rX(o,a,n);iX(u,r);const l=t(c);return sX({kill:t,signal:c,forceKillAfterDelay:e,killSignal:n,killResult:l,context:i,controller:s}),l},rX=(t,e,n)=>{const[r=n,i]=Tw(t)?[void 0,t]:[t,e];if(typeof r!="string"&&!Number.isInteger(r))throw new TypeError(`The first argument must be an error instance or a signal name string/integer: ${String(r)}`);if(i!==void 0&&!Tw(i))throw new TypeError(`The second argument is optional. If specified, it must be an error instance: ${i}`);return{signal:KY(r),error:i}},iX=(t,e)=>{t!==void 0&&e.reject(t)},sX=async({kill:t,signal:e,forceKillAfterDelay:n,killSignal:r,killResult:i,context:s,controller:o})=>{e===r&&i&&N_({kill:t,forceKillAfterDelay:n,context:s,controllerSignal:o.signal})},N_=async({kill:t,forceKillAfterDelay:e,context:n,controllerSignal:r})=>{if(e!==!1)try{await qb(e,void 0,{signal:r}),t("SIGKILL")&&(n.isForcefullyTerminated??=!0)}catch{}},F_=async(t,e)=>{t.aborted||await yn(t,"abort",{signal:e})},oX=({cancelSignal:t})=>{if(t!==void 0&&Object.prototype.toString.call(t)!=="[object AbortSignal]")throw new Error(`The \`cancelSignal\` option must be an AbortSignal: ${String(t)}`)},aX=({subprocess:t,cancelSignal:e,gracefulCancel:n,context:r,controller:i})=>e===void 0||n?[]:[cX(t,e,r,i)],cX=async(t,e,n,{signal:r})=>{throw await F_(e,r),n.terminationReason??="cancel",t.kill(),e.reason},kw=({methodName:t,isSubprocess:e,ipc:n,isConnected:r})=>{uX(t,e,n),L_(t,e,r)},uX=(t,e,n)=>{if(!n)throw new Error(`${or(t,e)} can only be used if the \`ipc\` option is \`true\`.`)},L_=(t,e,n)=>{if(!n)throw new Error(`${or(t,e)} cannot be used: the ${Mi(e)} has already exited or disconnected.`)},lX=t=>{throw new Error(`${or("getOneMessage",t)} could not complete: the ${Mi(t)} exited or disconnected.`)},dX=t=>{throw new Error(`${or("sendMessage",t)} failed: the ${Mi(t)} is sending a message too, instead of listening to incoming messages.
|
|
1807
|
+
This can be fixed by both sending a message and listening to incoming messages at the same time:
|
|
1808
|
+
|
|
1809
|
+
const [receivedMessage] = await Promise.all([
|
|
1810
|
+
${or("getOneMessage",t)},
|
|
1811
|
+
${or("sendMessage",t,"message, {strict: true}")},
|
|
1812
|
+
]);`)},M_=(t,e)=>new Error(`${or("sendMessage",e)} failed when sending an acknowledgment response to the ${Mi(e)}.`,{cause:t}),fX=t=>{throw new Error(`${or("sendMessage",t)} failed: the ${Mi(t)} is not listening to incoming messages.`)},pX=t=>{throw new Error(`${or("sendMessage",t)} failed: the ${Mi(t)} exited without listening to incoming messages.`)},hX=()=>new Error(`\`cancelSignal\` aborted: the ${Mi(!0)} disconnected.`),mX=()=>{throw new Error("`getCancelSignal()` cannot be used without setting the `cancelSignal` subprocess option.")},gX=({error:t,methodName:e,isSubprocess:n})=>{if(t.code==="EPIPE")throw new Error(`${or(e,n)} cannot be used: the ${Mi(n)} is disconnecting.`,{cause:t})},yX=({error:t,methodName:e,isSubprocess:n,message:r})=>{if(vX(t))throw new Error(`${or(e,n)}'s argument type is invalid: the message cannot be serialized: ${String(r)}.`,{cause:t})},vX=({code:t,message:e})=>wX.has(t)||bX.some(n=>e.includes(n)),wX=new Set(["ERR_MISSING_ARGS","ERR_INVALID_ARG_TYPE"]),bX=["could not be cloned","circular structure","call stack size exceeded"],or=(t,e,n="")=>t==="cancelSignal"?"`cancelSignal`'s `controller.abort()`":`${DX(e)}${t}(${n})`,DX=t=>t?"":"subprocess.",Mi=t=>t?"parent process":"subprocess",Aw=t=>{t.connected&&t.disconnect()},ad=()=>{const t={},e=new Promise((n,r)=>{Object.assign(t,{resolve:n,reject:r})});return Object.assign(e,t)},B_=(t,e="stdin")=>{const{options:r,fileDescriptors:i}=qs.get(t),s=z_(i,e,!0),o=t.stdio[s];if(o===null)throw new TypeError(q_(s,e,r,!0));return o},_w=(t,e="stdout")=>{const{options:r,fileDescriptors:i}=qs.get(t),s=z_(i,e,!1),o=s==="all"?t.all:t.stdio[s];if(o==null)throw new TypeError(q_(s,e,r,!1));return o},qs=new WeakMap,z_=(t,e,n)=>{const r=EX(e,n);return RX(r,e,n,t),r},EX=(t,e)=>{const n=r_(t);if(n!==void 0)return n;const{validOptions:r,defaultValue:i}=e?{validOptions:'"stdin"',defaultValue:"stdin"}:{validOptions:'"stdout", "stderr", "all"',defaultValue:"stdout"};throw new TypeError(`"${cd(e)}" must not be "${t}".
|
|
1813
|
+
It must be ${r} or "fd3", "fd4" (and so on).
|
|
1814
|
+
It is optional and defaults to "${i}".`)},RX=(t,e,n,r)=>{const i=r[j_(t)];if(i===void 0)throw new TypeError(`"${cd(n)}" must not be ${e}. That file descriptor does not exist.
|
|
1815
|
+
Please set the "stdio" option to ensure that file descriptor exists.`);if(i.direction==="input"&&!n)throw new TypeError(`"${cd(n)}" must not be ${e}. It must be a readable stream, not writable.`);if(i.direction!=="input"&&n)throw new TypeError(`"${cd(n)}" must not be ${e}. It must be a writable stream, not readable.`)},q_=(t,e,n,r)=>{if(t==="all"&&!n.all)return`The "all" option must be true to use "from: 'all'".`;const{optionName:i,optionValue:s}=TX(t,n);return`The "${i}: ${Pw(s)}" option is incompatible with using "${cd(r)}: ${Pw(e)}".
|
|
1816
|
+
Please set this option with "pipe" instead.`},TX=(t,{stdin:e,stdout:n,stderr:r,stdio:i})=>{const s=j_(t);return s===0&&e!==void 0?{optionName:"stdin",optionValue:e}:s===1&&n!==void 0?{optionName:"stdout",optionValue:n}:s===2&&r!==void 0?{optionName:"stderr",optionValue:r}:{optionName:`stdio[${s}]`,optionValue:i[s]}},j_=t=>t==="all"?1:t,cd=t=>t?"to":"from",Pw=t=>typeof t=="string"?`'${t}'`:typeof t=="number"?`${t}`:"Stream",Ph=(t,e,n)=>{const r=t.getMaxListeners();r===0||r===Number.POSITIVE_INFINITY||(t.setMaxListeners(r+e),Ub(n,()=>{t.setMaxListeners(t.getMaxListeners()-e)}))},U_=(t,e)=>{e&&Iw(t)},Iw=t=>{t.refCounted()},G_=(t,e)=>{e&&xw(t)},xw=t=>{t.unrefCounted()},$X=(t,e)=>{e&&(xw(t),xw(t))},SX=(t,e)=>{e&&(Iw(t),Iw(t))},CX=async({anyProcess:t,channel:e,isSubprocess:n,ipcEmitter:r},i)=>{if(OX(i)||HX(i))return;Ih.has(t)||Ih.set(t,[]);const s=Ih.get(t);if(s.push(i),!(s.length>1))for(;s.length>0;){await BX(t,r,i),await jb.yield();const o=await xX({wrappedMessage:s[0],anyProcess:t,channel:e,isSubprocess:n,ipcEmitter:r});s.shift(),r.emit("message",o),r.emit("message:done")}},kX=async({anyProcess:t,channel:e,isSubprocess:n,ipcEmitter:r,boundOnMessage:i})=>{J_();const s=Ih.get(t);for(;s?.length>0;)await yn(r,"message:done");t.removeListener("message",i),SX(e,n),r.connected=!1,r.emit("disconnect")},Ih=new WeakMap,xh=(t,e,n)=>{if(Oh.has(t))return Oh.get(t);const r=new px;return r.connected=!0,Oh.set(t,r),AX({ipcEmitter:r,anyProcess:t,channel:e,isSubprocess:n}),r},Oh=new WeakMap,AX=({ipcEmitter:t,anyProcess:e,channel:n,isSubprocess:r})=>{const i=CX.bind(void 0,{anyProcess:e,channel:n,isSubprocess:r,ipcEmitter:t});e.on("message",i),e.once("disconnect",kX.bind(void 0,{anyProcess:e,channel:n,isSubprocess:r,ipcEmitter:t,boundOnMessage:i})),$X(n,r)},W_=t=>{const e=Oh.get(t);return e===void 0?t.channel!==null:e.connected},_X=({anyProcess:t,channel:e,isSubprocess:n,message:r,strict:i})=>{if(!i)return r;const s=xh(t,e,n),o=Ow(t,s);return{id:PX++,type:Fh,message:r,hasListeners:o}};let PX=0n;const IX=(t,e)=>{if(!(e?.type!==Fh||e.hasListeners))for(const{id:n}of t)n!==void 0&&Nh[n].resolve({isDeadlock:!0,hasListeners:!1})},xX=async({wrappedMessage:t,anyProcess:e,channel:n,isSubprocess:r,ipcEmitter:i})=>{if(t?.type!==Fh||!e.connected)return t;const{id:s,message:o}=t,a={id:s,type:H_,message:Ow(e,i)};try{await V_({anyProcess:e,channel:n,isSubprocess:r,ipc:!0},a)}catch(c){i.emit("strict:error",c)}return o},OX=t=>{if(t?.type!==H_)return!1;const{id:e,message:n}=t;return Nh[e]?.resolve({isDeadlock:!1,hasListeners:n}),!0},NX=async(t,e,n)=>{if(t?.type!==Fh)return;const r=ad();Nh[t.id]=r;const i=new AbortController;try{const{isDeadlock:s,hasListeners:o}=await Promise.race([r,FX(e,n,i)]);s&&dX(n),o||fX(n)}finally{i.abort(),delete Nh[t.id]}},Nh={},FX=async(t,e,{signal:n})=>{Ph(t,1,n),await yn(t,"disconnect",{signal:n}),pX(e)},Fh="execa:ipc:request",H_="execa:ipc:response",LX=(t,e,n)=>{ud.has(t)||ud.set(t,new Set);const r=ud.get(t),i=ad(),s=n?e.id:void 0,o={onMessageSent:i,id:s};return r.add(o),{outgoingMessages:r,outgoingMessage:o}},MX=({outgoingMessages:t,outgoingMessage:e})=>{t.delete(e),e.onMessageSent.resolve()},BX=async(t,e,n)=>{for(;!Ow(t,e)&&ud.get(t)?.size>0;){const r=[...ud.get(t)];IX(r,n),await Promise.all(r.map(({onMessageSent:i})=>i))}},ud=new WeakMap,Ow=(t,e)=>e.listenerCount("message")>zX(t),zX=t=>qs.has(t)&&!id(qs.get(t).options.buffer,"ipc")?1:0,V_=({anyProcess:t,channel:e,isSubprocess:n,ipc:r},i,{strict:s=!1}={})=>{const o="sendMessage";return kw({methodName:o,isSubprocess:n,ipc:r,isConnected:t.connected}),qX({anyProcess:t,channel:e,methodName:o,isSubprocess:n,message:i,strict:s})},qX=async({anyProcess:t,channel:e,methodName:n,isSubprocess:r,message:i,strict:s})=>{const o=_X({anyProcess:t,channel:e,isSubprocess:r,message:i,strict:s}),a=LX(t,o,s);try{await K_({anyProcess:t,methodName:n,isSubprocess:r,wrappedMessage:o,message:i})}catch(c){throw Aw(t),c}finally{MX(a)}},K_=async({anyProcess:t,methodName:e,isSubprocess:n,wrappedMessage:r,message:i})=>{const s=jX(t);try{await Promise.all([NX(r,t,n),s(r)])}catch(o){throw gX({error:o,methodName:e,isSubprocess:n}),yX({error:o,methodName:e,isSubprocess:n,message:i}),o}},jX=t=>{if(Nw.has(t))return Nw.get(t);const e=MI(t.send.bind(t));return Nw.set(t,e),e},Nw=new WeakMap,UX=(t,e)=>{const n="cancelSignal";return L_(n,!1,t.connected),K_({anyProcess:t,methodName:n,isSubprocess:!1,wrappedMessage:{type:X_,message:e},message:e})},GX=async({anyProcess:t,channel:e,isSubprocess:n,ipc:r})=>(await WX({anyProcess:t,channel:e,isSubprocess:n,ipc:r}),Fw.signal),WX=async({anyProcess:t,channel:e,isSubprocess:n,ipc:r})=>{if(!Y_){if(Y_=!0,!r){mX();return}if(e===null){J_();return}xh(t,e,n),await jb.yield()}};let Y_=!1;const HX=t=>t?.type!==X_?!1:(Fw.abort(t.message),!0),X_="execa:ipc:cancel",J_=()=>{Fw.abort(hX())},Fw=new AbortController,VX=({gracefulCancel:t,cancelSignal:e,ipc:n,serialization:r})=>{if(t){if(e===void 0)throw new Error("The `cancelSignal` option must be defined when setting the `gracefulCancel` option.");if(!n)throw new Error("The `ipc` option cannot be false when setting the `gracefulCancel` option.");if(r==="json")throw new Error("The `serialization` option cannot be 'json' when setting the `gracefulCancel` option.")}},KX=({subprocess:t,cancelSignal:e,gracefulCancel:n,forceKillAfterDelay:r,context:i,controller:s})=>n?[YX({subprocess:t,cancelSignal:e,forceKillAfterDelay:r,context:i,controller:s})]:[],YX=async({subprocess:t,cancelSignal:e,forceKillAfterDelay:n,context:r,controller:{signal:i}})=>{await F_(e,i);const s=XX(e);throw await UX(t,s),N_({kill:t.kill,forceKillAfterDelay:n,context:r,controllerSignal:i}),r.terminationReason??="gracefulCancel",e.reason},XX=({reason:t})=>{if(!(t instanceof DOMException))return t;const e=new Error(t.message);return Object.defineProperty(e,"stack",{value:t.stack,enumerable:!1,configurable:!0,writable:!0}),e},JX=({timeout:t})=>{if(t!==void 0&&(!Number.isFinite(t)||t<0))throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${t}\` (${typeof t})`)},QX=(t,e,n,r)=>e===0||e===void 0?[]:[ZX(t,e,n,r)],ZX=async(t,e,n,{signal:r})=>{throw await qb(e,void 0,{signal:r}),n.terminationReason??="timeout",t.kill(),new od},eJ=({options:t})=>{if(t.node===!1)throw new TypeError('The "node" option cannot be false with `execaNode()`.');return{options:{...t,node:!0}}},tJ=(t,e,{node:n=!1,nodePath:r=ax,nodeOptions:i=cx.filter(c=>!c.startsWith("--inspect")),cwd:s,execPath:o,...a})=>{if(o!==void 0)throw new TypeError('The "execPath" option has been removed. Please use the "nodePath" option instead.');const c=rw(r,'The "nodePath" option'),u=Pr.resolve(s,c),l={...a,nodePath:u,node:n,cwd:s};if(!n)return[t,e,l];if(Pr.basename(t,".exe")==="node")throw new TypeError('When the "node" option is true, the first argument does not need to be "node".');return[u,[...i,t,...e],{ipc:!0,...l,shell:!1}]},nJ=({ipcInput:t,ipc:e,serialization:n})=>{if(t!==void 0){if(!e)throw new Error("The `ipcInput` option cannot be set unless the `ipc` option is `true`.");sJ[n](t)}},rJ=t=>{try{mx(t)}catch(e){throw new Error("The `ipcInput` option is not serializable with a structured clone.",{cause:e})}},iJ=t=>{try{JSON.stringify(t)}catch(e){throw new Error("The `ipcInput` option is not serializable with JSON.",{cause:e})}},sJ={advanced:rJ,json:iJ},oJ=async(t,e)=>{e!==void 0&&await t.sendMessage(e)},aJ=({encoding:t})=>{if(Lw.has(t))return;const e=uJ(t);if(e!==void 0)throw new TypeError(`Invalid option \`encoding: ${Lh(t)}\`.
|
|
1817
|
+
Please rename it to ${Lh(e)}.`);const n=[...Lw].map(r=>Lh(r)).join(", ");throw new TypeError(`Invalid option \`encoding: ${Lh(t)}\`.
|
|
1818
|
+
Please rename it to one of: ${n}.`)},cJ=new Set(["utf8","utf16le"]),js=new Set(["buffer","hex","base64","base64url","latin1","ascii"]),Lw=new Set([...cJ,...js]),uJ=t=>{if(t===null)return"buffer";if(typeof t!="string")return;const e=t.toLowerCase();if(e in Q_)return Q_[e];if(Lw.has(e))return e},Q_={"utf-8":"utf8","utf-16le":"utf16le","ucs-2":"utf16le",ucs2:"utf16le",binary:"latin1"},Lh=t=>typeof t=="string"?`"${t}"`:String(t),lJ=(t=Z_())=>{const e=rw(t,'The "cwd" option');return Pr.resolve(e)},Z_=()=>{try{return tt.cwd()}catch(t){throw t.message=`The current directory does not exist.
|
|
1819
|
+
${t.message}`,t}},dJ=(t,e)=>{if(e===Z_())return t;let n;try{n=kI(e)}catch(r){return`The "cwd" option is invalid: ${e}.
|
|
1820
|
+
${r.message}
|
|
1821
|
+
${t}`}return n.isDirectory()?t:`The "cwd" option is not a directory: ${e}.
|
|
1822
|
+
${t}`},eP=(t,e,n)=>{n.cwd=lJ(n.cwd);const[r,i,s]=tJ(t,e,n),{command:o,args:a,options:c}=_Y._parse(r,i,s),u=RK(c),l=fJ(u);return JX(l),aJ(l),nJ(l),oX(l),VX(l),l.shell=WA(l.shell),l.env=pJ(l),l.killSignal=VY(l.killSignal),l.forceKillAfterDelay=eX(l.forceKillAfterDelay),l.lines=l.lines.map((d,f)=>d&&!js.has(l.encoding)&&l.buffer[f]),tt.platform==="win32"&&Pr.basename(o,".exe")==="cmd"&&a.unshift("/q"),{file:o,commandArguments:a,options:l}},fJ=({extendEnv:t=!0,preferLocal:e=!1,cwd:n,localDir:r=n,encoding:i="utf8",reject:s=!0,cleanup:o=!0,all:a=!1,windowsHide:c=!0,killSignal:u="SIGTERM",forceKillAfterDelay:l=!0,gracefulCancel:d=!1,ipcInput:f,ipc:p=f!==void 0||d,serialization:m="advanced",...w})=>({...w,extendEnv:t,preferLocal:e,cwd:n,localDirectory:r,encoding:i,reject:s,cleanup:o,all:a,windowsHide:c,killSignal:u,forceKillAfterDelay:l,gracefulCancel:d,ipcInput:f,ipc:p,serialization:m}),pJ=({env:t,extendEnv:e,preferLocal:n,node:r,localDirectory:i,nodePath:s})=>{const o=e?{...tt.env,...t}:t;return n||r?OY({env:o,cwd:i,execPath:s,preferLocal:n,addExecPath:r}):o};function Mw(t){if(typeof t=="string")return hJ(t);if(!(ArrayBuffer.isView(t)&&t.BYTES_PER_ELEMENT===1))throw new Error("Input must be a string or a Uint8Array");return mJ(t)}const hJ=t=>t.at(-1)===tP?t.slice(0,t.at(-2)===nP?-2:-1):t,mJ=t=>t.at(-1)===gJ?t.subarray(0,t.at(-2)===yJ?-2:-1):t,tP=`
|
|
1823
|
+
`,gJ=tP.codePointAt(0),nP="\r",yJ=nP.codePointAt(0);function Us(t,{checkOpen:e=!0}={}){return t!==null&&typeof t=="object"&&(t.writable||t.readable||!e||t.writable===void 0&&t.readable===void 0)&&typeof t.pipe=="function"}function rP(t,{checkOpen:e=!0}={}){return Us(t,{checkOpen:e})&&(t.writable||!e)&&typeof t.write=="function"&&typeof t.end=="function"&&typeof t.writable=="boolean"&&typeof t.writableObjectMode=="boolean"&&typeof t.destroy=="function"&&typeof t.destroyed=="boolean"}function Mh(t,{checkOpen:e=!0}={}){return Us(t,{checkOpen:e})&&(t.readable||!e)&&typeof t.read=="function"&&typeof t.readable=="boolean"&&typeof t.readableObjectMode=="boolean"&&typeof t.destroy=="function"&&typeof t.destroyed=="boolean"}function iP(t,e){return rP(t,e)&&Mh(t,e)}const vJ=Object.getPrototypeOf(Object.getPrototypeOf(async function*(){}).prototype);let wJ=class{#e;#t;#n=!1;#r=void 0;constructor(e,n){this.#e=e,this.#t=n}next(){const e=()=>this.#s();return this.#r=this.#r?this.#r.then(e,e):e(),this.#r}return(e){const n=()=>this.#i(e);return this.#r?this.#r.then(n,n):n()}async#s(){if(this.#n)return{done:!0,value:void 0};let e;try{e=await this.#e.read()}catch(n){throw this.#r=void 0,this.#n=!0,this.#e.releaseLock(),n}return e.done&&(this.#r=void 0,this.#n=!0,this.#e.releaseLock()),e}async#i(e){if(this.#n)return{done:!0,value:e};if(this.#n=!0,!this.#t){const n=this.#e.cancel(e);return this.#e.releaseLock(),await n,{done:!0,value:e}}return this.#e.releaseLock(),{done:!0,value:e}}};const Bw=Symbol();function sP(){return this[Bw].next()}Object.defineProperty(sP,"name",{value:"next"});function oP(t){return this[Bw].return(t)}Object.defineProperty(oP,"name",{value:"return"});const bJ=Object.create(vJ,{next:{enumerable:!0,configurable:!0,writable:!0,value:sP},return:{enumerable:!0,configurable:!0,writable:!0,value:oP}});function DJ({preventCancel:t=!1}={}){const e=this.getReader(),n=new wJ(e,t),r=Object.create(bJ);return r[Bw]=n,r}const EJ=t=>{if(Mh(t,{checkOpen:!1})&&zw.on!==void 0)return TJ(t);if(typeof t?.[Symbol.asyncIterator]=="function")return t;if(RJ.call(t)==="[object ReadableStream]")return DJ.call(t);throw new TypeError("The first argument must be a Readable, a ReadableStream, or an async iterable.")},{toString:RJ}=Object.prototype,TJ=async function*(t){const e=new AbortController,n={};$J(t,e,n);try{for await(const[r]of zw.on(t,"data",{signal:e.signal}))yield r}catch(r){if(n.error!==void 0)throw n.error;if(!e.signal.aborted)throw r}finally{t.destroy()}},$J=async(t,e,n)=>{try{await zw.finished(t,{cleanup:!0,readable:!0,writable:!1,error:!1})}catch(r){n.error=r}finally{e.abort()}},zw={},qw=async(t,{init:e,convertChunk:n,getSize:r,truncateChunk:i,addChunk:s,getFinalChunk:o,finalize:a},{maxBuffer:c=Number.POSITIVE_INFINITY}={})=>{const u=EJ(t),l=e();l.length=0;try{for await(const d of u){const f=CJ(d),p=n[f](d,l);aP({convertedChunk:p,state:l,getSize:r,truncateChunk:i,addChunk:s,maxBuffer:c})}return SJ({state:l,convertChunk:n,getSize:r,truncateChunk:i,addChunk:s,getFinalChunk:o,maxBuffer:c}),a(l)}catch(d){const f=typeof d=="object"&&d!==null?d:new Error(d);throw f.bufferedData=a(l),f}},SJ=({state:t,getSize:e,truncateChunk:n,addChunk:r,getFinalChunk:i,maxBuffer:s})=>{const o=i(t);o!==void 0&&aP({convertedChunk:o,state:t,getSize:e,truncateChunk:n,addChunk:r,maxBuffer:s})},aP=({convertedChunk:t,state:e,getSize:n,truncateChunk:r,addChunk:i,maxBuffer:s})=>{const o=n(t),a=e.length+o;if(a<=s){cP(t,e,i,a);return}const c=r(t,s-e.length);throw c!==void 0&&cP(c,e,i,s),new Bh},cP=(t,e,n,r)=>{e.contents=n(t,e,r),e.length=r},CJ=t=>{const e=typeof t;if(e==="string")return"string";if(e!=="object"||t===null)return"others";if(globalThis.Buffer?.isBuffer(t))return"buffer";const n=uP.call(t);return n==="[object ArrayBuffer]"?"arrayBuffer":n==="[object DataView]"?"dataView":Number.isInteger(t.byteLength)&&Number.isInteger(t.byteOffset)&&uP.call(t.buffer)==="[object ArrayBuffer]"?"typedArray":"others"},{toString:uP}=Object.prototype;class Bh extends Error{name="MaxBufferError";constructor(){super("maxBuffer exceeded")}}const Gs=t=>t,jw=()=>{},lP=({contents:t})=>t,dP=t=>{throw new Error(`Streams in object mode are not supported: ${String(t)}`)},fP=t=>t.length;async function kJ(t,e){return qw(t,IJ,e)}const AJ=()=>({contents:[]}),_J=()=>1,PJ=(t,{contents:e})=>(e.push(t),e),IJ={init:AJ,convertChunk:{string:Gs,buffer:Gs,arrayBuffer:Gs,dataView:Gs,typedArray:Gs,others:Gs},getSize:_J,truncateChunk:jw,addChunk:PJ,getFinalChunk:jw,finalize:lP};async function xJ(t,e){return qw(t,jJ,e)}const OJ=()=>({contents:new ArrayBuffer(0)}),NJ=t=>FJ.encode(t),FJ=new TextEncoder,pP=t=>new Uint8Array(t),hP=t=>new Uint8Array(t.buffer,t.byteOffset,t.byteLength),LJ=(t,e)=>t.slice(0,e),MJ=(t,{contents:e,length:n},r)=>{const i=yP()?zJ(e,r):BJ(e,r);return new Uint8Array(i).set(t,n),i},BJ=(t,e)=>{if(e<=t.byteLength)return t;const n=new ArrayBuffer(mP(e));return new Uint8Array(n).set(new Uint8Array(t),0),n},zJ=(t,e)=>{if(e<=t.maxByteLength)return t.resize(e),t;const n=new ArrayBuffer(e,{maxByteLength:mP(e)});return new Uint8Array(n).set(new Uint8Array(t),0),n},mP=t=>gP**Math.ceil(Math.log(t)/Math.log(gP)),gP=2,qJ=({contents:t,length:e})=>yP()?t:t.slice(0,e),yP=()=>"resize"in ArrayBuffer.prototype,jJ={init:OJ,convertChunk:{string:NJ,buffer:pP,arrayBuffer:pP,dataView:hP,typedArray:hP,others:dP},getSize:fP,truncateChunk:LJ,addChunk:MJ,getFinalChunk:jw,finalize:qJ};async function UJ(t,e){return qw(t,KJ,e)}const GJ=()=>({contents:"",textDecoder:new TextDecoder}),zh=(t,{textDecoder:e})=>e.decode(t,{stream:!0}),WJ=(t,{contents:e})=>e+t,HJ=(t,e)=>t.slice(0,e),VJ=({textDecoder:t})=>{const e=t.decode();return e===""?void 0:e},KJ={init:GJ,convertChunk:{string:Gs,buffer:zh,arrayBuffer:zh,dataView:zh,typedArray:zh,others:dP},getSize:fP,truncateChunk:HJ,addChunk:WJ,getFinalChunk:VJ,finalize:lP},YJ=({error:t,stream:e,readableObjectMode:n,lines:r,encoding:i,fdNumber:s})=>{if(!(t instanceof Bh))throw t;if(s==="all")return t;const o=XJ(n,r,i);throw t.maxBufferInfo={fdNumber:s,unit:o},e.destroy(),t},XJ=(t,e,n)=>t?"objects":e?"lines":n==="buffer"?"bytes":"characters",JJ=(t,e,n)=>{if(e.length!==n)return;const r=new Bh;throw r.maxBufferInfo={fdNumber:"ipc"},r},QJ=(t,e)=>{const{streamName:n,threshold:r,unit:i}=ZJ(t,e);return`Command's ${n} was larger than ${r} ${i}`},ZJ=(t,e)=>{if(t?.maxBufferInfo===void 0)return{streamName:"output",threshold:e[1],unit:"bytes"};const{maxBufferInfo:{fdNumber:n,unit:r}}=t;delete t.maxBufferInfo;const i=id(e,n);return n==="ipc"?{streamName:"IPC output",threshold:i,unit:"messages"}:{streamName:e_(n),threshold:i,unit:r}},eQ=(t,e,n)=>t?.code==="ENOBUFS"&&e!==null&&e.some(r=>r!==null&&r.length>Uw(n)),tQ=(t,e,n)=>{if(!e)return t;const r=Uw(n);return t.length>r?t.slice(0,r):t},Uw=([,t])=>t,nQ=({stdio:t,all:e,ipcOutput:n,originalError:r,signal:i,signalDescription:s,exitCode:o,escapedCommand:a,timedOut:c,isCanceled:u,isGracefullyCanceled:l,isMaxBuffer:d,isForcefullyTerminated:f,forceKillAfterDelay:p,killSignal:m,maxBuffer:w,timeout:E,cwd:y})=>{const b=r?.code,R=rQ({originalError:r,timedOut:c,timeout:E,isMaxBuffer:d,maxBuffer:w,errorCode:b,signal:i,signalDescription:s,exitCode:o,isCanceled:u,isGracefullyCanceled:l,isForcefullyTerminated:f,forceKillAfterDelay:p,killSignal:m}),C=sQ(r,y),A=C===void 0?"":`
|
|
1824
|
+
${C}`,q=`${R}: ${a}${A}`,G=e===void 0?[t[2],t[1]]:[e],Q=[q,...G,...t.slice(3),n.map(J=>oQ(J)).join(`
|
|
1825
|
+
`)].map(J=>dw(Mw(aQ(J)))).filter(Boolean).join(`
|
|
1826
|
+
|
|
1827
|
+
`);return{originalMessage:C,shortMessage:q,message:Q}},rQ=({originalError:t,timedOut:e,timeout:n,isMaxBuffer:r,maxBuffer:i,errorCode:s,signal:o,signalDescription:a,exitCode:c,isCanceled:u,isGracefullyCanceled:l,isForcefullyTerminated:d,forceKillAfterDelay:f,killSignal:p})=>{const m=iQ(d,f);return e?`Command timed out after ${n} milliseconds${m}`:l?o===void 0?`Command was gracefully canceled with exit code ${c}`:d?`Command was gracefully canceled${m}`:`Command was gracefully canceled with ${o} (${a})`:u?`Command was canceled${m}`:r?`${QJ(t,i)}${m}`:s!==void 0?`Command failed with ${s}${m}`:d?`Command was killed with ${p} (${O_(p)})${m}`:o!==void 0?`Command was killed with ${o} (${a})`:c!==void 0?`Command failed with exit code ${c}`:"Command failed"},iQ=(t,e)=>t?` and was forcefully terminated after ${e} milliseconds`:"",sQ=(t,e)=>{if(t instanceof od)return;const n=FY(t)?t.originalMessage:String(t?.message??t),r=dw(dJ(n,e));return r===""?void 0:r},oQ=t=>typeof t=="string"?t:yd(t),aQ=t=>Array.isArray(t)?t.map(e=>Mw(vP(e))).filter(Boolean).join(`
|
|
1828
|
+
`):vP(t),vP=t=>typeof t=="string"?t:sr(t)?YA(t):"",wP=({command:t,escapedCommand:e,stdio:n,all:r,ipcOutput:i,options:{cwd:s},startTime:o})=>bP({command:t,escapedCommand:e,cwd:s,durationMs:d_(o),failed:!1,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isTerminated:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,exitCode:0,stdout:n[1],stderr:n[2],all:r,stdio:n,ipcOutput:i,pipedFrom:[]}),Gw=({error:t,command:e,escapedCommand:n,fileDescriptors:r,options:i,startTime:s,isSync:o})=>Ww({error:t,command:e,escapedCommand:n,startTime:s,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,stdio:Array.from({length:r.length}),ipcOutput:[],options:i,isSync:o}),Ww=({error:t,command:e,escapedCommand:n,startTime:r,timedOut:i,isCanceled:s,isGracefullyCanceled:o,isMaxBuffer:a,isForcefullyTerminated:c,exitCode:u,signal:l,stdio:d,all:f,ipcOutput:p,options:{timeoutDuration:m,timeout:w=m,forceKillAfterDelay:E,killSignal:y,cwd:b,maxBuffer:R},isSync:C})=>{const{exitCode:A,signal:q,signalDescription:G}=uQ(u,l),{originalMessage:Q,shortMessage:J,message:le}=nQ({stdio:d,all:f,ipcOutput:p,originalError:t,signal:q,signalDescription:G,exitCode:A,escapedCommand:n,timedOut:i,isCanceled:s,isGracefullyCanceled:o,isMaxBuffer:a,isForcefullyTerminated:c,forceKillAfterDelay:E,killSignal:y,maxBuffer:R,timeout:w,cwd:b}),N=NY(t,le,C);return Object.assign(N,cQ({error:N,command:e,escapedCommand:n,startTime:r,timedOut:i,isCanceled:s,isGracefullyCanceled:o,isMaxBuffer:a,isForcefullyTerminated:c,exitCode:A,signal:q,signalDescription:G,stdio:d,all:f,ipcOutput:p,cwd:b,originalMessage:Q,shortMessage:J})),N},cQ=({error:t,command:e,escapedCommand:n,startTime:r,timedOut:i,isCanceled:s,isGracefullyCanceled:o,isMaxBuffer:a,isForcefullyTerminated:c,exitCode:u,signal:l,signalDescription:d,stdio:f,all:p,ipcOutput:m,cwd:w,originalMessage:E,shortMessage:y})=>bP({shortMessage:y,originalMessage:E,command:e,escapedCommand:n,cwd:w,durationMs:d_(r),failed:!0,timedOut:i,isCanceled:s,isGracefullyCanceled:o,isTerminated:l!==void 0,isMaxBuffer:a,isForcefullyTerminated:c,exitCode:u,signal:l,signalDescription:d,code:t.cause?.code,stdout:f[1],stderr:f[2],all:p,stdio:f,ipcOutput:m,pipedFrom:[]}),bP=t=>Object.fromEntries(Object.entries(t).filter(([,e])=>e!==void 0)),uQ=(t,e)=>{const n=t===null?void 0:t,r=e===null?void 0:e,i=r===void 0?void 0:O_(e);return{exitCode:n,signal:r,signalDescription:i}},DP=t=>Number.isFinite(t)?t:0;function lQ(t){return{days:Math.trunc(t/864e5),hours:Math.trunc(t/36e5%24),minutes:Math.trunc(t/6e4%60),seconds:Math.trunc(t/1e3%60),milliseconds:Math.trunc(t%1e3),microseconds:Math.trunc(DP(t*1e3)%1e3),nanoseconds:Math.trunc(DP(t*1e6)%1e3)}}function dQ(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 fQ(t){switch(typeof t){case"number":{if(Number.isFinite(t))return lQ(t);break}case"bigint":return dQ(t)}throw new TypeError("Expected a finite number or bigint")}const pQ=t=>t===0||t===0n,hQ=(t,e)=>e===1||e===1n?t:`${t}s`,mQ=1e-7,gQ=24n*60n*60n*1000n;function EP(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,d)=>{const f=Math.floor(l*10**d+mQ);return(Math.round(f)/10**d).toFixed(d)},o=(l,d,f,p)=>{if(!((i.length===0||!e.colonNotation)&&pQ(l)&&!(e.colonNotation&&f==="m"))){if(p??=String(l),e.colonNotation){const m=p.includes(".")?p.split(".")[0].length:p.length,w=i.length>0?2:1;p="0".repeat(Math.max(0,w-m))+p}else p+=e.verbose?" "+hQ(d,l):f;i.push(p)}},a=fQ(t),c=BigInt(a.days);if(e.hideYearAndDays?o(BigInt(c)*24n+BigInt(a.hours),"hour","h"):(e.hideYear?o(c,"day","d"):(o(c/365n,"year","y"),o(c%365n,"day","d")),o(Number(a.hours),"hour","h")),o(Number(a.minutes),"minute","m"),!e.hideSeconds)if(e.separateMilliseconds||e.formatSubMilliseconds||!e.colonNotation&&t<1e3){const l=Number(a.seconds),d=Number(a.milliseconds),f=Number(a.microseconds),p=Number(a.nanoseconds);if(o(l,"second","s"),e.formatSubMilliseconds)o(d,"millisecond","ms"),o(f,"microsecond","\xB5s"),o(p,"nanosecond","ns");else{const m=d+f/1e3+p/1e6,w=typeof e.millisecondsDecimalDigits=="number"?e.millisecondsDecimalDigits:0,E=m>=1?Math.round(m):Math.ceil(m),y=w?m.toFixed(w):E;o(Number.parseFloat(y),"millisecond","ms",y)}}else{const l=(n?Number(t%gQ):t)/1e3%60,d=typeof e.secondsDecimalDigits=="number"?e.secondsDecimalDigits:1,f=s(l,d),p=e.keepDecimalsOnWholeSeconds?f:f.replace(/\.0+$/,"");o(Number.parseFloat(p),"second","s",p)}if(i.length===0)return r+"0"+(e.verbose?" milliseconds":"ms");const u=e.colonNotation?":":" ";return typeof e.unitCount=="number"&&(i=i.slice(0,Math.max(e.unitCount,1))),r+i.join(u)}const yQ=(t,e)=>{t.failed&&sd({type:"error",verboseMessage:t.shortMessage,verboseInfo:e,result:t})},vQ=(t,e)=>{ow(e)&&(yQ(t,e),wQ(t,e))},wQ=(t,e)=>{const n=`(done in ${EP(t.durationMs)})`;sd({type:"duration",verboseMessage:n,verboseInfo:e,result:t})},Hw=(t,e,{reject:n})=>{if(vQ(t,e),t.failed&&n)throw t;return t},bQ=(t,e)=>Vo(t)?"asyncGenerator":CP(t)?"generator":Kw(t)?"fileUrl":SQ(t)?"filePath":AQ(t)?"webStream":Us(t,{checkOpen:!1})?"native":sr(t)?"uint8Array":_Q(t)?"asyncIterable":PQ(t)?"iterable":Xw(t)?RP({transform:t},e):TQ(t)?DQ(t,e):"native",DQ=(t,e)=>iP(t.transform,{checkOpen:!1})?EQ(t,e):Xw(t.transform)?RP(t,e):RQ(t,e),EQ=(t,e)=>(TP(t,e,"Duplex stream"),"duplex"),RP=(t,e)=>(TP(t,e,"web TransformStream"),"webTransform"),TP=({final:t,binary:e,objectMode:n},r,i)=>{$P(t,`${r}.final`,i),$P(e,`${r}.binary`,i),Vw(n,`${r}.objectMode`)},$P=(t,e,n)=>{if(t!==void 0)throw new TypeError(`The \`${e}\` option can only be defined when using a generator, not a ${n}.`)},RQ=({transform:t,final:e,binary:n,objectMode:r},i)=>{if(t!==void 0&&!SP(t))throw new TypeError(`The \`${i}.transform\` option must be a generator, a Duplex stream or a web TransformStream.`);if(iP(e,{checkOpen:!1}))throw new TypeError(`The \`${i}.final\` option must not be a Duplex stream.`);if(Xw(e))throw new TypeError(`The \`${i}.final\` option must not be a web TransformStream.`);if(e!==void 0&&!SP(e))throw new TypeError(`The \`${i}.final\` option must be a generator.`);return Vw(n,`${i}.binary`),Vw(r,`${i}.objectMode`),Vo(t)||Vo(e)?"asyncGenerator":"generator"},Vw=(t,e)=>{if(t!==void 0&&typeof t!="boolean")throw new TypeError(`The \`${e}\` option must use a boolean.`)},SP=t=>Vo(t)||CP(t),Vo=t=>Object.prototype.toString.call(t)==="[object AsyncGeneratorFunction]",CP=t=>Object.prototype.toString.call(t)==="[object GeneratorFunction]",TQ=t=>en(t)&&(t.transform!==void 0||t.final!==void 0),Kw=t=>Object.prototype.toString.call(t)==="[object URL]",$Q=t=>Kw(t)&&t.protocol!=="file:",SQ=t=>en(t)&&Object.keys(t).length===1&&kP(t.file),kP=t=>typeof t=="string",CQ=(t,e)=>t==="native"&&typeof e=="string"&&!kQ.has(e),kQ=new Set(["ipc","ignore","inherit","overlapped","pipe"]),AP=t=>Object.prototype.toString.call(t)==="[object ReadableStream]",Yw=t=>Object.prototype.toString.call(t)==="[object WritableStream]",AQ=t=>AP(t)||Yw(t),Xw=t=>AP(t?.readable)&&Yw(t?.writable),_Q=t=>_P(t)&&typeof t[Symbol.asyncIterator]=="function",PQ=t=>_P(t)&&typeof t[Symbol.iterator]=="function",_P=t=>typeof t=="object"&&t!==null,Ws=new Set(["generator","asyncGenerator","duplex","webTransform"]),PP=new Set(["fileUrl","filePath","fileNumber"]),IP=new Set(["fileUrl","filePath"]),IQ=new Set([...IP,"webStream","nodeStream"]),xQ=new Set(["webTransform","duplex"]),qh={generator:"a generator",asyncGenerator:"an async generator",fileUrl:"a file URL",filePath:"a file path string",fileNumber:"a file descriptor number",webStream:"a web stream",nodeStream:"a Node.js stream",webTransform:"a web TransformStream",duplex:"a Duplex stream",native:"any value",iterable:"an iterable",asyncIterable:"an async iterable",string:"a string",uint8Array:"a Uint8Array"},xP=(t,e,n,r)=>r==="output"?OQ(t,e,n):NQ(t,e,n),OQ=(t,e,n)=>{const r=e!==0&&n[e-1].value.readableObjectMode;return{writableObjectMode:r,readableObjectMode:t??r}},NQ=(t,e,n)=>{const r=e===0?t===!0:n[e-1].value.readableObjectMode,i=e!==n.length-1&&(t??r);return{writableObjectMode:r,readableObjectMode:i}},FQ=(t,e)=>{const n=t.findLast(({type:r})=>Ws.has(r));return n===void 0?!1:e==="input"?n.value.writableObjectMode:n.value.readableObjectMode},LQ=(t,e,n,r)=>[...t.filter(({type:i})=>!Ws.has(i)),...MQ(t,e,n,r)],MQ=(t,e,n,{encoding:r})=>{const i=t.filter(({type:o})=>Ws.has(o)),s=Array.from({length:i.length});for(const[o,a]of Object.entries(i))s[o]=BQ({stdioItem:a,index:Number(o),newTransforms:s,optionName:e,direction:n,encoding:r});return UQ(s,n)},BQ=({stdioItem:t,stdioItem:{type:e},index:n,newTransforms:r,optionName:i,direction:s,encoding:o})=>e==="duplex"?zQ({stdioItem:t,optionName:i}):e==="webTransform"?qQ({stdioItem:t,index:n,newTransforms:r,direction:s}):jQ({stdioItem:t,index:n,newTransforms:r,direction:s,encoding:o}),zQ=({stdioItem:t,stdioItem:{value:{transform:e,transform:{writableObjectMode:n,readableObjectMode:r},objectMode:i=r}},optionName:s})=>{if(i&&!r)throw new TypeError(`The \`${s}.objectMode\` option can only be \`true\` if \`new Duplex({objectMode: true})\` is used.`);if(!i&&r)throw new TypeError(`The \`${s}.objectMode\` option cannot be \`false\` if \`new Duplex({objectMode: true})\` is used.`);return{...t,value:{transform:e,writableObjectMode:n,readableObjectMode:r}}},qQ=({stdioItem:t,stdioItem:{value:e},index:n,newTransforms:r,direction:i})=>{const{transform:s,objectMode:o}=en(e)?e:{transform:e},{writableObjectMode:a,readableObjectMode:c}=xP(o,n,r,i);return{...t,value:{transform:s,writableObjectMode:a,readableObjectMode:c}}},jQ=({stdioItem:t,stdioItem:{value:e},index:n,newTransforms:r,direction:i,encoding:s})=>{const{transform:o,final:a,binary:c=!1,preserveNewlines:u=!1,objectMode:l}=en(e)?e:{transform:e},d=c||js.has(s),{writableObjectMode:f,readableObjectMode:p}=xP(l,n,r,i);return{...t,value:{transform:o,final:a,binary:d,preserveNewlines:u,writableObjectMode:f,readableObjectMode:p}}},UQ=(t,e)=>e==="input"?t.reverse():t,GQ=(t,e,n)=>{const r=t.map(i=>WQ(i,e));if(r.includes("input")&&r.includes("output"))throw new TypeError(`The \`${n}\` option must not be an array of both readable and writable values.`);return r.find(Boolean)??KQ},WQ=({type:t,value:e},n)=>HQ[n]??OP[t](e),HQ=["input","output","output"],Ko=()=>{},Jw=()=>"input",OP={generator:Ko,asyncGenerator:Ko,fileUrl:Ko,filePath:Ko,iterable:Jw,asyncIterable:Jw,uint8Array:Jw,webStream:t=>Yw(t)?"output":"input",nodeStream(t){return Mh(t,{checkOpen:!1})?rP(t,{checkOpen:!1})?void 0:"input":"output"},webTransform:Ko,duplex:Ko,native(t){const e=VQ(t);if(e!==void 0)return e;if(Us(t,{checkOpen:!1}))return OP.nodeStream(t)}},VQ=t=>{if([0,tt.stdin].includes(t))return"input";if([1,2,tt.stdout,tt.stderr].includes(t))return"output"},KQ="output",YQ=(t,e)=>e&&!t.includes("ipc")?[...t,"ipc"]:t,XQ=({stdio:t,ipc:e,buffer:n,...r},i,s)=>{const o=JQ(t,r).map((a,c)=>NP(a,c));return s?ZQ(o,n,i):YQ(o,e)},JQ=(t,e)=>{if(t===void 0)return kr.map(r=>e[r]);if(QQ(e))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${kr.map(r=>`\`${r}\``).join(", ")}`);if(typeof t=="string")return[t,t,t];if(!Array.isArray(t))throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof t}\``);const n=Math.max(t.length,kr.length);return Array.from({length:n},(r,i)=>t[i])},QQ=t=>kr.some(e=>t[e]!==void 0),NP=(t,e)=>Array.isArray(t)?t.map(n=>NP(n,e)):t??(e>=kr.length?"ignore":"pipe"),ZQ=(t,e,n)=>t.map((r,i)=>!e[i]&&i!==0&&!aw(n,i)&&eZ(r)?"ignore":r),eZ=t=>t==="pipe"||Array.isArray(t)&&t.every(e=>e==="pipe"),tZ=({stdioItem:t,stdioItem:{type:e},isStdioArray:n,fdNumber:r,direction:i,isSync:s})=>!n||e!=="native"?t:s?nZ({stdioItem:t,fdNumber:r,direction:i}):sZ({stdioItem:t,fdNumber:r}),nZ=({stdioItem:t,stdioItem:{value:e,optionName:n},fdNumber:r,direction:i})=>{const s=rZ({value:e,optionName:n,fdNumber:r,direction:i});if(s!==void 0)return s;if(Us(e,{checkOpen:!1}))throw new TypeError(`The \`${n}: Stream\` option cannot both be an array and include a stream with synchronous methods.`);return t},rZ=({value:t,optionName:e,fdNumber:n,direction:r})=>{const i=iZ(t,n);if(i!==void 0){if(r==="output")return{type:"fileNumber",value:i,optionName:e};if(Mb.isatty(i))throw new TypeError(`The \`${e}: ${Pw(t)}\` option is invalid: it cannot be a TTY with synchronous methods.`);return{type:"uint8Array",value:rd(tm(i)),optionName:e}}},iZ=(t,e)=>{if(t==="inherit")return e;if(typeof t=="number")return t;const n=sw.indexOf(t);if(n!==-1)return n},sZ=({stdioItem:t,stdioItem:{value:e,optionName:n},fdNumber:r})=>e==="inherit"?{type:"nodeStream",value:FP(r,e,n),optionName:n}:typeof e=="number"?{type:"nodeStream",value:FP(e,e,n),optionName:n}:Us(e,{checkOpen:!1})?{type:"nodeStream",value:e,optionName:n}:t,FP=(t,e,n)=>{const r=sw[t];if(r===void 0)throw new TypeError(`The \`${n}: ${e}\` option is invalid: no such standard stream.`);return r},oZ=({input:t,inputFile:e},n)=>n===0?[...aZ(t),...uZ(e)]:[],aZ=t=>t===void 0?[]:[{type:cZ(t),value:t,optionName:"input"}],cZ=t=>{if(Mh(t,{checkOpen:!1}))return"nodeStream";if(typeof t=="string")return"string";if(sr(t))return"uint8Array";throw new Error("The `input` option must be a string, a Uint8Array or a Node.js Readable stream.")},uZ=t=>t===void 0?[]:[{...lZ(t),optionName:"inputFile"}],lZ=t=>{if(Kw(t))return{type:"fileUrl",value:t};if(kP(t))return{type:"filePath",value:{file:t}};throw new Error("The `inputFile` option must be a file path string or a file URL.")},dZ=t=>t.filter((e,n)=>t.every((r,i)=>e.value!==r.value||n>=i||e.type==="generator"||e.type==="asyncGenerator")),fZ=({stdioItem:{type:t,value:e,optionName:n},direction:r,fileDescriptors:i,isSync:s})=>{const o=pZ(i,t);if(o.length!==0){if(s){hZ({otherStdioItems:o,type:t,value:e,optionName:n,direction:r});return}if(IQ.has(t))return LP({otherStdioItems:o,type:t,value:e,optionName:n,direction:r});xQ.has(t)&&gZ({otherStdioItems:o,type:t,value:e,optionName:n})}},pZ=(t,e)=>t.flatMap(({direction:n,stdioItems:r})=>r.filter(i=>i.type===e).map(i=>({...i,direction:n}))),hZ=({otherStdioItems:t,type:e,value:n,optionName:r,direction:i})=>{IP.has(e)&&LP({otherStdioItems:t,type:e,value:n,optionName:r,direction:i})},LP=({otherStdioItems:t,type:e,value:n,optionName:r,direction:i})=>{const s=t.filter(a=>mZ(a,n));if(s.length===0)return;const o=s.find(a=>a.direction!==i);return MP(o,r,e),i==="output"?s[0].stream:void 0},mZ=({type:t,value:e},n)=>t==="filePath"?e.file===n.file:t==="fileUrl"?e.href===n.href:e===n,gZ=({otherStdioItems:t,type:e,value:n,optionName:r})=>{const i=t.find(({value:{transform:s}})=>s===n.transform);MP(i,r,e)},MP=(t,e,n)=>{if(t!==void 0)throw new TypeError(`The \`${t.optionName}\` and \`${e}\` options must not target ${qh[n]} that is the same.`)},BP=(t,e,n,r)=>{const s=XQ(e,n,r).map((a,c)=>yZ({stdioOption:a,fdNumber:c,options:e,isSync:r})),o=$Z({initialFileDescriptors:s,addProperties:t,options:e,isSync:r});return e.stdio=o.map(({stdioItems:a})=>kZ(a)),o},yZ=({stdioOption:t,fdNumber:e,options:n,isSync:r})=>{const i=e_(e),{stdioItems:s,isStdioArray:o}=vZ({stdioOption:t,fdNumber:e,options:n,optionName:i}),a=GQ(s,e,i),c=s.map(d=>tZ({stdioItem:d,isStdioArray:o,fdNumber:e,direction:a,isSync:r})),u=LQ(c,i,a,n),l=FQ(u,a);return TZ(u,l),{direction:a,objectMode:l,stdioItems:u}},vZ=({stdioOption:t,fdNumber:e,options:n,optionName:r})=>{const s=[...(Array.isArray(t)?t:[t]).map(c=>wZ(c,r)),...oZ(n,e)],o=dZ(s),a=o.length>1;return bZ(o,a,r),EZ(o),{stdioItems:o,isStdioArray:a}},wZ=(t,e)=>({type:bQ(t,e),value:t,optionName:e}),bZ=(t,e,n)=>{if(t.length===0)throw new TypeError(`The \`${n}\` option must not be an empty array.`);if(e){for(const{value:r,optionName:i}of t)if(DZ.has(r))throw new Error(`The \`${i}\` option must not include \`${r}\`.`)}},DZ=new Set(["ignore","ipc"]),EZ=t=>{for(const e of t)RZ(e)},RZ=({type:t,value:e,optionName:n})=>{if($Q(e))throw new TypeError(`The \`${n}: URL\` option must use the \`file:\` scheme.
|
|
1829
|
+
For example, you can use the \`pathToFileURL()\` method of the \`url\` core module.`);if(CQ(t,e))throw new TypeError(`The \`${n}: { file: '...' }\` option must be used instead of \`${n}: '...'\`.`)},TZ=(t,e)=>{if(!e)return;const n=t.find(({type:r})=>PP.has(r));if(n!==void 0)throw new TypeError(`The \`${n.optionName}\` option cannot use both files and transforms in objectMode.`)},$Z=({initialFileDescriptors:t,addProperties:e,options:n,isSync:r})=>{const i=[];try{for(const s of t)i.push(SZ({fileDescriptor:s,fileDescriptors:i,addProperties:e,options:n,isSync:r}));return i}catch(s){throw zP(i),s}},SZ=({fileDescriptor:{direction:t,objectMode:e,stdioItems:n},fileDescriptors:r,addProperties:i,options:s,isSync:o})=>{const a=n.map(c=>CZ({stdioItem:c,addProperties:i,direction:t,options:s,fileDescriptors:r,isSync:o}));return{direction:t,objectMode:e,stdioItems:a}},CZ=({stdioItem:t,addProperties:e,direction:n,options:r,fileDescriptors:i,isSync:s})=>{const o=fZ({stdioItem:t,direction:n,fileDescriptors:i,isSync:s});return o!==void 0?{...t,stream:o}:{...t,...e[n][t.type](t,r)}},zP=t=>{for(const{stdioItems:e}of t)for(const{stream:n}of e)n!==void 0&&!Bs(n)&&n.destroy()},kZ=t=>{if(t.length>1)return t.some(({value:r})=>r==="overlapped")?"overlapped":"pipe";const[{type:e,value:n}]=t;return e==="native"?n:"pipe"},AZ=(t,e)=>BP(PZ,t,e,!0),Ar=({type:t,optionName:e})=>{qP(e,qh[t])},_Z=({optionName:t,value:e})=>((e==="ipc"||e==="overlapped")&&qP(t,`"${e}"`),{}),qP=(t,e)=>{throw new TypeError(`The \`${t}\` option cannot be ${e} with synchronous methods.`)},jP={generator(){},asyncGenerator:Ar,webStream:Ar,nodeStream:Ar,webTransform:Ar,duplex:Ar,asyncIterable:Ar,native:_Z},PZ={input:{...jP,fileUrl:({value:t})=>({contents:[rd(tm(t))]}),filePath:({value:{file:t}})=>({contents:[rd(tm(t))]}),fileNumber:Ar,iterable:({value:t})=>({contents:[...t]}),string:({value:t})=>({contents:[t]}),uint8Array:({value:t})=>({contents:[t]})},output:{...jP,fileUrl:({value:t})=>({path:t}),filePath:({value:{file:t}})=>({path:t}),fileNumber:({value:t})=>({path:t}),iterable:Ar,string:Ar,uint8Array:Ar}},Yo=(t,{stripFinalNewline:e},n)=>UP(e,n)&&t!==void 0&&!Array.isArray(t)?Mw(t):t,UP=(t,e)=>e==="all"?t[1]||t[2]:t[e],GP=(t,e,n,r)=>t||n?void 0:VP(e,r),WP=(t,e,n)=>n?t.flatMap(r=>HP(r,e)):HP(t,e),HP=(t,e)=>{const{transform:n,final:r}=VP(e,{});return[...n(t),...r()]},VP=(t,e)=>(e.previousChunks="",{transform:IZ.bind(void 0,e,t),final:OZ.bind(void 0,e)}),IZ=function*(t,e,n){if(typeof n!="string"){yield n;return}let{previousChunks:r}=t,i=-1;for(let s=0;s<n.length;s+=1)if(n[s]===`
|
|
1830
|
+
`){const o=xZ(n,s,e,t);let a=n.slice(i+1,s+1-o);r.length>0&&(a=Qw(r,a),r=""),yield a,i=s}i!==n.length-1&&(r=Qw(r,n.slice(i+1))),t.previousChunks=r},xZ=(t,e,n,r)=>n?0:(r.isWindowsNewline=e!==0&&t[e-1]==="\r",r.isWindowsNewline?2:1),OZ=function*({previousChunks:t}){t.length>0&&(yield t)},NZ=({binary:t,preserveNewlines:e,readableObjectMode:n,state:r})=>t||e||n?void 0:{transform:FZ.bind(void 0,r)},FZ=function*({isWindowsNewline:t=!1},e){const{unixNewline:n,windowsNewline:r,LF:i,concatBytes:s}=typeof e=="string"?LZ:BZ;if(e.at(-1)===i){yield e;return}yield s(e,t?r:n)},Qw=(t,e)=>`${t}${e}`,LZ={windowsNewline:`\r
|
|
1831
|
+
`,unixNewline:`
|
|
1832
|
+
`,LF:`
|
|
1833
|
+
`,concatBytes:Qw},MZ=(t,e)=>{const n=new Uint8Array(t.length+e.length);return n.set(t,0),n.set(e,t.length),n},BZ={windowsNewline:new Uint8Array([13,10]),unixNewline:new Uint8Array([10]),LF:10,concatBytes:MZ},zZ=(t,e)=>t?void 0:qZ.bind(void 0,e),qZ=function*(t,e){if(typeof e!="string"&&!sr(e)&&!lm.isBuffer(e))throw new TypeError(`The \`${t}\` option's transform must use "objectMode: true" to receive as input: ${typeof e}.`);yield e},jZ=(t,e)=>t?UZ.bind(void 0,e):GZ.bind(void 0,e),UZ=function*(t,e){KP(t,e),yield e},GZ=function*(t,e){if(KP(t,e),typeof e!="string"&&!sr(e))throw new TypeError(`The \`${t}\` option's function must yield a string or an Uint8Array, not ${typeof e}.`);yield e},KP=(t,e)=>{if(e==null)throw new TypeError(`The \`${t}\` option's function must not call \`yield ${e}\`.
|
|
1834
|
+
Instead, \`yield\` should either be called with a value, or not be called at all. For example:
|
|
1835
|
+
if (condition) { yield value; }`)},YP=(t,e,n)=>{if(n)return;if(t)return{transform:WZ.bind(void 0,new TextEncoder)};const r=new zb(e);return{transform:HZ.bind(void 0,r),final:VZ.bind(void 0,r)}},WZ=function*(t,e){lm.isBuffer(e)?yield rd(e):typeof e=="string"?yield t.encode(e):yield e},HZ=function*(t,e){yield sr(e)?t.write(e):e},VZ=function*(t){const e=t.end();e!==""&&(yield e)},XP=Ys(async(t,e,n,r)=>{e.currentIterable=t(...n);try{for await(const i of e.currentIterable)r.push(i)}finally{delete e.currentIterable}}),Zw=async function*(t,e,n){if(n===e.length){yield t;return}const{transform:r=JZ}=e[n];for await(const i of r(t))yield*Zw(i,e,n+1)},KZ=async function*(t){for(const[e,{final:n}]of Object.entries(t))yield*YZ(n,Number(e),t)},YZ=async function*(t,e,n){if(t!==void 0)for await(const r of t())yield*Zw(r,n,e+1)},XZ=Ys(async({currentIterable:t},e)=>{if(t!==void 0){await(e?t.throw(e):t.return());return}if(e)throw e}),JZ=function*(t){yield t},JP=(t,e,n,r)=>{try{for(const i of t(...e))n.push(i);r()}catch(i){r(i)}},QZ=(t,e)=>[...e.flatMap(n=>[...ld(n,t,0)]),...eb(t)],ld=function*(t,e,n){if(n===e.length){yield t;return}const{transform:r=eee}=e[n];for(const i of r(t))yield*ld(i,e,n+1)},eb=function*(t){for(const[e,{final:n}]of Object.entries(t))yield*ZZ(n,Number(e),t)},ZZ=function*(t,e,n){if(t!==void 0)for(const r of t())yield*ld(r,n,e+1)},eee=function*(t){yield t},QP=({value:t,value:{transform:e,final:n,writableObjectMode:r,readableObjectMode:i},optionName:s},{encoding:o})=>{const a={},c=e1(t,o,s),u=Vo(e),l=Vo(n),d=u?XP.bind(void 0,Zw,a):JP.bind(void 0,ld),f=u||l?XP.bind(void 0,KZ,a):JP.bind(void 0,eb),p=u||l?XZ.bind(void 0,a):void 0;return{stream:new gx({writableObjectMode:r,writableHighWaterMark:Dd(r),readableObjectMode:i,readableHighWaterMark:Dd(i),transform(w,E,y){d([w,c,0],this,y)},flush(w){f([c],this,w)},destroy:p})}},ZP=(t,e,n,r)=>{const i=e.filter(({type:o})=>o==="generator"),s=r?i.reverse():i;for(const{value:o,optionName:a}of s){const c=e1(o,n,a);t=QZ(c,t)}return t},e1=({transform:t,final:e,binary:n,writableObjectMode:r,readableObjectMode:i,preserveNewlines:s},o,a)=>{const c={};return[{transform:zZ(r,a)},YP(n,o,r),GP(n,s,r,c),{transform:t,final:e},{transform:jZ(i,a)},NZ({binary:n,preserveNewlines:s,readableObjectMode:i,state:c})].filter(Boolean)},tee=(t,e)=>{for(const n of nee(t))ree(t,n,e)},nee=t=>new Set(Object.entries(t).filter(([,{direction:e}])=>e==="input").map(([e])=>Number(e))),ree=(t,e,n)=>{const{stdioItems:r}=t[e],i=r.filter(({contents:a})=>a!==void 0);if(i.length===0)return;if(e!==0){const[{type:a,optionName:c}]=i;throw new TypeError(`Only the \`stdin\` option, not \`${c}\`, can be ${qh[a]} with synchronous methods.`)}const o=i.map(({contents:a})=>a).map(a=>iee(a,r));n.input=iw(o)},iee=(t,e)=>{const n=ZP(t,e,"utf8",!0);return see(n),iw(n)},see=t=>{const e=t.find(n=>typeof n!="string"&&!sr(n));if(e!==void 0)throw new TypeError(`The \`stdin\` option is invalid: when passing objects as input, a transform must be used to serialize them to strings or Uint8Arrays: ${e}.`)},t1=({stdioItems:t,encoding:e,verboseInfo:n,fdNumber:r})=>r!=="all"&&aw(n,r)&&!js.has(e)&&oee(r)&&(t.some(({type:i,value:s})=>i==="native"&&aee.has(s))||t.every(({type:i})=>Ws.has(i))),oee=t=>t===1||t===2,aee=new Set(["pipe","overlapped"]),cee=async(t,e,n,r)=>{for await(const i of t)lee(e)||n1(i,n,r)},uee=(t,e,n)=>{for(const r of t)n1(r,e,n)},lee=t=>t._readableState.pipes.length>0,n1=(t,e,n)=>{const r=u_(t);sd({type:"output",verboseMessage:r,fdNumber:e,verboseInfo:n})},dee=({fileDescriptors:t,syncResult:{output:e},options:n,isMaxBuffer:r,verboseInfo:i})=>{if(e===null)return{output:Array.from({length:3})};const s={},o=new Set([]);return{output:e.map((c,u)=>fee({result:c,fileDescriptors:t,fdNumber:u,state:s,outputFiles:o,isMaxBuffer:r,verboseInfo:i},n)),...s}},fee=({result:t,fileDescriptors:e,fdNumber:n,state:r,outputFiles:i,isMaxBuffer:s,verboseInfo:o},{buffer:a,encoding:c,lines:u,stripFinalNewline:l,maxBuffer:d})=>{if(t===null)return;const f=tQ(t,s,d),p=rd(f),{stdioItems:m,objectMode:w}=e[n],E=pee([p],m,c,r),{serializedResult:y,finalResult:b=y}=hee({chunks:E,objectMode:w,encoding:c,lines:u,stripFinalNewline:l,fdNumber:n});mee({serializedResult:y,fdNumber:n,state:r,verboseInfo:o,encoding:c,stdioItems:m,objectMode:w});const R=a[n]?b:void 0;try{return r.error===void 0&&gee(y,m,i),R}catch(C){return r.error=C,R}},pee=(t,e,n,r)=>{try{return ZP(t,e,n,!1)}catch(i){return r.error=i,t}},hee=({chunks:t,objectMode:e,encoding:n,lines:r,stripFinalNewline:i,fdNumber:s})=>{if(e)return{serializedResult:t};if(n==="buffer")return{serializedResult:iw(t)};const o=pK(t,n);return r[s]?{serializedResult:o,finalResult:WP(o,!i[s],e)}:{serializedResult:o}},mee=({serializedResult:t,fdNumber:e,state:n,verboseInfo:r,encoding:i,stdioItems:s,objectMode:o})=>{if(!t1({stdioItems:s,encoding:i,verboseInfo:r,fdNumber:e}))return;const a=WP(t,!1,o);try{uee(a,e,r)}catch(c){n.error??=c}},gee=(t,e,n)=>{for(const{path:r}of e.filter(({type:i})=>PP.has(i))){const i=typeof r=="string"?r:r.toString();n.has(i)?AI(r,t):(n.add(i),Rb(r,t))}},yee=([,t,e],n)=>{if(n.all)return t===void 0?e:e===void 0?t:Array.isArray(t)?Array.isArray(e)?[...t,...e]:[...t,Yo(e,n,"all")]:Array.isArray(e)?[Yo(t,n,"all"),...e]:sr(t)&&sr(e)?XA([t,e]):`${t}${e}`},vee=async(t,e)=>{const[n,r]=await wee(t);return e.isForcefullyTerminated??=!1,[n,r]},wee=async t=>{const[e,n]=await Promise.allSettled([yn(t,"spawn"),yn(t,"exit")]);return e.status==="rejected"?[]:n.status==="rejected"?r1(t):n.value},r1=async t=>{try{return await yn(t,"exit")}catch{return r1(t)}},bee=async t=>{const[e,n]=await t;if(!Dee(e,n)&&i1(e,n))throw new od;return[e,n]},Dee=(t,e)=>t===void 0&&e===void 0,i1=(t,e)=>t!==0||e!==null,Eee=({error:t,status:e,signal:n,output:r},{maxBuffer:i})=>{const s=Ree(t,e,n),o=s?.code==="ETIMEDOUT",a=eQ(s,r,i);return{resultError:s,exitCode:e,signal:n,timedOut:o,isMaxBuffer:a}},Ree=(t,e,n)=>t!==void 0?t:i1(e,n)?new od:void 0,Tee=(t,e,n)=>{const{file:r,commandArguments:i,command:s,escapedCommand:o,startTime:a,verboseInfo:c,options:u,fileDescriptors:l}=$ee(t,e,n),d=kee({file:r,commandArguments:i,options:u,command:s,escapedCommand:o,verboseInfo:c,fileDescriptors:l,startTime:a});return Hw(d,c,u)},$ee=(t,e,n)=>{const{command:r,escapedCommand:i,startTime:s,verboseInfo:o}=f_(t,e,n),a=See(n),{file:c,commandArguments:u,options:l}=eP(t,e,a);Cee(l);const d=AZ(l,o);return{file:c,commandArguments:u,command:r,escapedCommand:i,startTime:s,verboseInfo:o,options:l,fileDescriptors:d}},See=t=>t.node&&!t.ipc?{...t,ipc:!1}:t,Cee=({ipc:t,ipcInput:e,detached:n,cancelSignal:r})=>{e&&jh("ipcInput"),t&&jh("ipc: true"),n&&jh("detached: true"),r&&jh("cancelSignal")},jh=t=>{throw new TypeError(`The "${t}" option cannot be used with synchronous methods.`)},kee=({file:t,commandArguments:e,options:n,command:r,escapedCommand:i,verboseInfo:s,fileDescriptors:o,startTime:a})=>{const c=Aee({file:t,commandArguments:e,options:n,command:r,escapedCommand:i,fileDescriptors:o,startTime:a});if(c.failed)return c;const{resultError:u,exitCode:l,signal:d,timedOut:f,isMaxBuffer:p}=Eee(c,n),{output:m,error:w=u}=dee({fileDescriptors:o,syncResult:c,options:n,isMaxBuffer:p,verboseInfo:s}),E=m.map((b,R)=>Yo(b,n,R)),y=Yo(yee(m,n),n,"all");return Pee({error:w,exitCode:l,signal:d,timedOut:f,isMaxBuffer:p,stdio:E,all:y,options:n,command:r,escapedCommand:i,startTime:a})},Aee=({file:t,commandArguments:e,options:n,command:r,escapedCommand:i,fileDescriptors:s,startTime:o})=>{try{tee(s,n);const a=_ee(n);return lx(t,e,a)}catch(a){return Gw({error:a,command:r,escapedCommand:i,fileDescriptors:s,options:n,startTime:o,isSync:!0})}},_ee=({encoding:t,maxBuffer:e,...n})=>({...n,encoding:"buffer",maxBuffer:Uw(e)}),Pee=({error:t,exitCode:e,signal:n,timedOut:r,isMaxBuffer:i,stdio:s,all:o,options:a,command:c,escapedCommand:u,startTime:l})=>t===void 0?wP({command:c,escapedCommand:u,stdio:s,all:o,ipcOutput:[],options:a,startTime:l}):Ww({error:t,command:c,escapedCommand:u,timedOut:r,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:i,isForcefullyTerminated:!1,exitCode:e,signal:n,stdio:s,all:o,ipcOutput:[],options:a,startTime:l,isSync:!0}),Iee=({anyProcess:t,channel:e,isSubprocess:n,ipc:r},{reference:i=!0,filter:s}={})=>(kw({methodName:"getOneMessage",isSubprocess:n,ipc:r,isConnected:W_(t)}),xee({anyProcess:t,channel:e,isSubprocess:n,filter:s,reference:i})),xee=async({anyProcess:t,channel:e,isSubprocess:n,filter:r,reference:i})=>{U_(e,i);const s=xh(t,e,n),o=new AbortController;try{return await Promise.race([Oee(s,r,o),Nee(s,n,o),Fee(s,n,o)])}catch(a){throw Aw(t),a}finally{o.abort(),G_(e,i)}},Oee=async(t,e,{signal:n})=>{if(e===void 0){const[r]=await yn(t,"message",{signal:n});return r}for await(const[r]of bd(t,"message",{signal:n}))if(e(r))return r},Nee=async(t,e,{signal:n})=>{await yn(t,"disconnect",{signal:n}),lX(e)},Fee=async(t,e,{signal:n})=>{const[r]=await yn(t,"strict:error",{signal:n});throw M_(r,e)},Lee=({anyProcess:t,channel:e,isSubprocess:n,ipc:r},{reference:i=!0}={})=>s1({anyProcess:t,channel:e,isSubprocess:n,ipc:r,shouldAwait:!n,reference:i}),s1=({anyProcess:t,channel:e,isSubprocess:n,ipc:r,shouldAwait:i,reference:s})=>{kw({methodName:"getEachMessage",isSubprocess:n,ipc:r,isConnected:W_(t)}),U_(e,s);const o=xh(t,e,n),a=new AbortController,c={};return Mee(t,o,a),Bee({ipcEmitter:o,isSubprocess:n,controller:a,state:c}),zee({anyProcess:t,channel:e,ipcEmitter:o,isSubprocess:n,shouldAwait:i,controller:a,state:c,reference:s})},Mee=async(t,e,n)=>{try{await yn(e,"disconnect",{signal:n.signal}),n.abort()}catch{}},Bee=async({ipcEmitter:t,isSubprocess:e,controller:n,state:r})=>{try{const[i]=await yn(t,"strict:error",{signal:n.signal});r.error=M_(i,e),n.abort()}catch{}},zee=async function*({anyProcess:t,channel:e,ipcEmitter:n,isSubprocess:r,shouldAwait:i,controller:s,state:o,reference:a}){try{for await(const[c]of bd(n,"message",{signal:s.signal}))o1(o),yield c}catch{o1(o)}finally{s.abort(),G_(e,a),r||Aw(t),i&&await t}},o1=({error:t})=>{if(t)throw t},qee=(t,{ipc:e})=>{Object.assign(t,a1(t,!1,e))},jee=()=>{const t=tt,e=!0,n=tt.channel!==void 0;return{...a1(t,e,n),getCancelSignal:GX.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:n})}},a1=(t,e,n)=>({sendMessage:V_.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:n}),getOneMessage:Iee.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:n}),getEachMessage:Lee.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:n})}),Uee=({error:t,command:e,escapedCommand:n,fileDescriptors:r,options:i,startTime:s,verboseInfo:o})=>{zP(r);const a=new Bb;Gee(a,r),Object.assign(a,{readable:Wee,writable:Hee,duplex:Vee});const c=Gw({error:t,command:e,escapedCommand:n,fileDescriptors:r,options:i,startTime:s,isSync:!1}),u=Kee(c,o,i);return{subprocess:a,promise:u}},Gee=(t,e)=>{const n=dd(),r=dd(),i=dd(),s=Array.from({length:e.length-3},dd),o=dd(),a=[n,r,i,...s];Object.assign(t,{stdin:n,stdout:r,stderr:i,all:o,stdio:a})},dd=()=>{const t=new Gb;return t.end(),t},Wee=()=>new Ji({read(){}}),Hee=()=>new cm({write(){}}),Vee=()=>new um({read(){},write(){}}),Kee=async(t,e,n)=>Hw(t,e,n),Yee=(t,e)=>BP(Xee,t,e,!1),fd=({type:t,optionName:e})=>{throw new TypeError(`The \`${e}\` option cannot be ${qh[t]}.`)},c1={fileNumber:fd,generator:QP,asyncGenerator:QP,nodeStream:({value:t})=>({stream:t}),webTransform({value:{transform:t,writableObjectMode:e,readableObjectMode:n}}){const r=e||n;return{stream:um.fromWeb(t,{objectMode:r})}},duplex:({value:{transform:t}})=>({stream:t}),native(){}},Xee={input:{...c1,fileUrl:({value:t})=>({stream:Tb(t)}),filePath:({value:{file:t}})=>({stream:Tb(t)}),webStream:({value:t})=>({stream:Ji.fromWeb(t)}),iterable:({value:t})=>({stream:Ji.from(t)}),asyncIterable:({value:t})=>({stream:Ji.from(t)}),string:({value:t})=>({stream:Ji.from(t)}),uint8Array:({value:t})=>({stream:Ji.from(lm.from(t))})},output:{...c1,fileUrl:({value:t})=>({stream:$b(t)}),filePath:({value:{file:t}})=>({stream:$b(t)}),webStream:({value:t})=>({stream:cm.fromWeb(t)}),iterable:fd,asyncIterable:fd,string:fd,uint8Array:fd}};function tb(t){if(!Array.isArray(t))throw new TypeError(`Expected an array, got \`${typeof t}\`.`);for(const i of t)nb(i);const e=t.some(({readableObjectMode:i})=>i),n=Jee(t,e),r=new Qee({objectMode:e,writableHighWaterMark:n,readableHighWaterMark:n});for(const i of t)r.add(i);return r}const Jee=(t,e)=>{if(t.length===0)return Dd(e);const n=t.filter(({readableObjectMode:r})=>r===e).map(({readableHighWaterMark:r})=>r);return Math.max(...n)};class Qee extends Gb{#e=new Set([]);#t=new Set([]);#n=new Set([]);#r;#s=Symbol("unpipe");#i=new WeakMap;add(e){if(nb(e),this.#e.has(e))return;this.#e.add(e),this.#r??=Zee(this,this.#e,this.#s);const n=nte({passThroughStream:this,stream:e,streams:this.#e,ended:this.#t,aborted:this.#n,onFinished:this.#r,unpipeEvent:this.#s});this.#i.set(e,n),e.pipe(this,{end:!1})}async remove(e){if(nb(e),!this.#e.has(e))return!1;const n=this.#i.get(e);return n===void 0?!1:(this.#i.delete(e),e.unpipe(this),await n,!0)}}const Zee=async(t,e,n)=>{Uh(t,f1);const r=new AbortController;try{await Promise.race([ete(t,r),tte(t,e,n,r)])}finally{r.abort(),Uh(t,-f1)}},ete=async(t,{signal:e})=>{try{await li(t,{signal:e,cleanup:!0})}catch(n){throw u1(t,n),n}},tte=async(t,e,n,{signal:r})=>{for await(const[i]of bd(t,"unpipe",{signal:r}))e.has(i)&&i.emit(n)},nb=t=>{if(typeof t?.pipe!="function")throw new TypeError(`Expected a readable stream, got: \`${typeof t}\`.`)},nte=async({passThroughStream:t,stream:e,streams:n,ended:r,aborted:i,onFinished:s,unpipeEvent:o})=>{Uh(t,p1);const a=new AbortController;try{await Promise.race([rte(s,e,a),ite({passThroughStream:t,stream:e,streams:n,ended:r,aborted:i,controller:a}),ste({stream:e,streams:n,ended:r,aborted:i,unpipeEvent:o,controller:a})])}finally{a.abort(),Uh(t,-p1)}n.size>0&&n.size===r.size+i.size&&(r.size===0&&i.size>0?rb(t):ote(t))},rte=async(t,e,{signal:n})=>{try{await t,n.aborted||rb(e)}catch(r){n.aborted||u1(e,r)}},ite=async({passThroughStream:t,stream:e,streams:n,ended:r,aborted:i,controller:{signal:s}})=>{try{await li(e,{signal:s,cleanup:!0,readable:!0,writable:!1}),n.has(e)&&r.add(e)}catch(o){if(s.aborted||!n.has(e))return;l1(o)?i.add(e):d1(t,o)}},ste=async({stream:t,streams:e,ended:n,aborted:r,unpipeEvent:i,controller:{signal:s}})=>{if(await yn(t,i,{signal:s}),!t.readable)return yn(s,"abort",{signal:s});e.delete(t),n.delete(t),r.delete(t)},ote=t=>{t.writable&&t.end()},u1=(t,e)=>{l1(e)?rb(t):d1(t,e)},l1=t=>t?.code==="ERR_STREAM_PREMATURE_CLOSE",rb=t=>{(t.readable||t.writable)&&t.destroy()},d1=(t,e)=>{t.destroyed||(t.once("error",ate),t.destroy(e))},ate=()=>{},Uh=(t,e)=>{const n=t.getMaxListeners();n!==0&&n!==Number.POSITIVE_INFINITY&&t.setMaxListeners(n+e)},f1=2,p1=1,Gh=(t,e)=>{t.pipe(e),cte(t,e),ute(t,e)},cte=async(t,e)=>{if(!(Bs(t)||Bs(e))){try{await li(t,{cleanup:!0,readable:!0,writable:!1})}catch{}h1(e)}},h1=t=>{t.writable&&t.end()},ute=async(t,e)=>{if(!(Bs(t)||Bs(e))){try{await li(e,{cleanup:!0,readable:!1,writable:!0})}catch{}m1(t)}},m1=t=>{t.readable&&t.destroy()},lte=(t,e,n)=>{const r=new Map;for(const[i,{stdioItems:s,direction:o}]of Object.entries(e)){for(const{stream:a}of s.filter(({type:c})=>Ws.has(c)))dte(t,a,o,i);for(const{stream:a}of s.filter(({type:c})=>!Ws.has(c)))pte({subprocess:t,stream:a,direction:o,fdNumber:i,pipeGroups:r,controller:n})}for(const[i,s]of r.entries()){const o=s.length===1?s[0]:tb(s);Gh(o,i)}},dte=(t,e,n,r)=>{n==="output"?Gh(t.stdio[r],e):Gh(e,t.stdio[r]);const i=fte[r];i!==void 0&&(t[i]=e),t.stdio[r]=e},fte=["stdin","stdout","stderr"],pte=({subprocess:t,stream:e,direction:n,fdNumber:r,pipeGroups:i,controller:s})=>{if(e===void 0)return;hte(e,s);const[o,a]=n==="output"?[e,t.stdio[r]]:[t.stdio[r],e],c=i.get(o)??[];i.set(o,[...c,a])},hte=(t,{signal:e})=>{Bs(t)&&Ph(t,mte,e)},mte=2,Xo=[];Xo.push("SIGHUP","SIGINT","SIGTERM"),process.platform!=="win32"&&Xo.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT"),process.platform==="linux"&&Xo.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");const Wh=t=>!!t&&typeof t=="object"&&typeof t.removeListener=="function"&&typeof t.emit=="function"&&typeof t.reallyExit=="function"&&typeof t.listeners=="function"&&typeof t.kill=="function"&&typeof t.pid=="number"&&typeof t.on=="function",ib=Symbol.for("signal-exit emitter"),sb=globalThis,gte=Object.defineProperty.bind(Object);class yte{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(sb[ib])return sb[ib];gte(sb,ib,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(e,n){this.listeners[e].push(n)}removeListener(e,n){const r=this.listeners[e],i=r.indexOf(n);i!==-1&&(i===0&&r.length===1?r.length=0:r.splice(i,1))}emit(e,n,r){if(this.emitted[e])return!1;this.emitted[e]=!0;let i=!1;for(const s of this.listeners[e])i=s(n,r)===!0||i;return e==="exit"&&(i=this.emit("afterExit",n,r)||i),i}}class g1{}const vte=t=>({onExit(e,n){return t.onExit(e,n)},load(){return t.load()},unload(){return t.unload()}});class wte extends g1{onExit(){return()=>{}}load(){}unload(){}}class bte extends g1{#e=ob.platform==="win32"?"SIGINT":"SIGHUP";#t=new yte;#n;#r;#s;#i={};#o=!1;constructor(e){super(),this.#n=e,this.#i={};for(const n of Xo)this.#i[n]=()=>{const r=this.#n.listeners(n);let{count:i}=this.#t;const s=e;if(typeof s.__signal_exit_emitter__=="object"&&typeof s.__signal_exit_emitter__.count=="number"&&(i+=s.__signal_exit_emitter__.count),r.length===i){this.unload();const o=this.#t.emit("exit",null,n),a=n==="SIGHUP"?this.#e:n;o||e.kill(e.pid,a)}};this.#s=e.reallyExit,this.#r=e.emit}onExit(e,n){if(!Wh(this.#n))return()=>{};this.#o===!1&&this.load();const r=n?.alwaysLast?"afterExit":"exit";return this.#t.on(r,e),()=>{this.#t.removeListener(r,e),this.#t.listeners.exit.length===0&&this.#t.listeners.afterExit.length===0&&this.unload()}}load(){if(!this.#o){this.#o=!0,this.#t.count+=1;for(const e of Xo)try{const n=this.#i[e];n&&this.#n.on(e,n)}catch{}this.#n.emit=(e,...n)=>this.#c(e,...n),this.#n.reallyExit=e=>this.#a(e)}}unload(){this.#o&&(this.#o=!1,Xo.forEach(e=>{const n=this.#i[e];if(!n)throw new Error("Listener not defined for signal: "+e);try{this.#n.removeListener(e,n)}catch{}}),this.#n.emit=this.#r,this.#n.reallyExit=this.#s,this.#t.count-=1)}#a(e){return Wh(this.#n)?(this.#n.exitCode=e||0,this.#t.emit("exit",this.#n.exitCode,null),this.#s.call(this.#n,this.#n.exitCode)):0}#c(e,...n){const r=this.#r;if(e==="exit"&&Wh(this.#n)){typeof n[0]=="number"&&(this.#n.exitCode=n[0]);const i=r.call(this.#n,e,...n);return this.#t.emit("exit",this.#n.exitCode,null),i}else return r.call(this.#n,e,...n)}}const ob=globalThis.process,{onExit:Dte,load:toe,unload:noe}=vte(Wh(ob)?new bte(ob):new wte),Ete=(t,{cleanup:e,detached:n},{signal:r})=>{if(!e||n)return;const i=Dte(()=>{t.kill()});Ub(r,()=>{i()})},Rte=({source:t,sourcePromise:e,boundOptions:n,createNested:r},...i)=>{const s=l_(),{destination:o,destinationStream:a,destinationError:c,from:u,unpipeSignal:l}=Tte(n,r,i),{sourceStream:d,sourceError:f}=Ste(t,u),{options:p,fileDescriptors:m}=qs.get(t);return{sourcePromise:e,sourceStream:d,sourceOptions:p,sourceError:f,destination:o,destinationStream:a,destinationError:c,unpipeSignal:l,fileDescriptors:m,startTime:s}},Tte=(t,e,n)=>{try{const{destination:r,pipeOptions:{from:i,to:s,unpipeSignal:o}={}}=$te(t,e,...n),a=B_(r,s);return{destination:r,destinationStream:a,from:i,unpipeSignal:o}}catch(r){return{destinationError:r}}},$te=(t,e,n,...r)=>{if(Array.isArray(n))return{destination:e(y1,t)(n,...r),pipeOptions:t};if(typeof n=="string"||n instanceof URL){if(Object.keys(t).length>0)throw new TypeError('Please use .pipe("file", ..., options) or .pipe(execa("file", ..., options)) instead of .pipe(options)("file", ...).');const[i,s,o]=HA(n,...r);return{destination:e(y1)(i,s,o),pipeOptions:o}}if(qs.has(n)){if(Object.keys(t).length>0)throw new TypeError("Please use .pipe(options)`command` or .pipe($(options)`command`) instead of .pipe(options)($`command`).");return{destination:n,pipeOptions:r[0]}}throw new TypeError(`The first argument must be a template string, an options object, or an Execa subprocess: ${n}`)},y1=({options:t})=>({options:{...t,stdin:"pipe",piped:!0}}),Ste=(t,e)=>{try{return{sourceStream:_w(t,e)}}catch(n){return{sourceError:n}}},Cte=({sourceStream:t,sourceError:e,destinationStream:n,destinationError:r,fileDescriptors:i,sourceOptions:s,startTime:o})=>{const a=kte({sourceStream:t,sourceError:e,destinationStream:n,destinationError:r});if(a!==void 0)throw v1({error:a,fileDescriptors:i,sourceOptions:s,startTime:o})},kte=({sourceStream:t,sourceError:e,destinationStream:n,destinationError:r})=>{if(e!==void 0&&r!==void 0)return r;if(r!==void 0)return m1(t),r;if(e!==void 0)return h1(n),e},v1=({error:t,fileDescriptors:e,sourceOptions:n,startTime:r})=>Gw({error:t,command:w1,escapedCommand:w1,fileDescriptors:e,options:n,startTime:r,isSync:!1}),w1="source.pipe(destination)",Ate=async t=>{const[{status:e,reason:n,value:r=n},{status:i,reason:s,value:o=s}]=await t;if(o.pipedFrom.includes(r)||o.pipedFrom.push(r),i==="rejected")throw o;if(e==="rejected")throw r;return o},_te=(t,e,n)=>{const r=Hh.has(e)?Ite(t,e):Pte(t,e);return Ph(t,Ote,n.signal),Ph(e,Nte,n.signal),xte(e),r},Pte=(t,e)=>{const n=tb([t]);return Gh(n,e),Hh.set(e,n),n},Ite=(t,e)=>{const n=Hh.get(e);return n.add(t),n},xte=async t=>{try{await li(t,{cleanup:!0,readable:!1,writable:!0})}catch{}Hh.delete(t)},Hh=new WeakMap,Ote=2,Nte=1,Fte=(t,e)=>t===void 0?[]:[Lte(t,e)],Lte=async(t,{sourceStream:e,mergedStream:n,fileDescriptors:r,sourceOptions:i,startTime:s})=>{await BI(t,e),await n.remove(e);const o=new Error("Pipe canceled by `unpipeSignal` option.");throw v1({error:o,fileDescriptors:r,sourceOptions:i,startTime:s})},ab=(t,...e)=>{if(en(e[0]))return ab.bind(void 0,{...t,boundOptions:{...t.boundOptions,...e[0]}});const{destination:n,...r}=Rte(t,...e),i=Mte({...r,destination:n});return i.pipe=ab.bind(void 0,{...t,source:n,sourcePromise:i,boundOptions:{}}),i},Mte=async({sourcePromise:t,sourceStream:e,sourceOptions:n,sourceError:r,destination:i,destinationStream:s,destinationError:o,unpipeSignal:a,fileDescriptors:c,startTime:u})=>{const l=Bte(t,i);Cte({sourceStream:e,sourceError:r,destinationStream:s,destinationError:o,fileDescriptors:c,sourceOptions:n,startTime:u});const d=new AbortController;try{const f=_te(e,s,d);return await Promise.race([Ate(l),...Fte(a,{sourceStream:e,mergedStream:f,sourceOptions:n,fileDescriptors:c,startTime:u})])}finally{d.abort()}},Bte=(t,e)=>Promise.allSettled([t,e]),b1=({subprocessStdout:t,subprocess:e,binary:n,shouldEncode:r,encoding:i,preserveNewlines:s})=>{const o=new AbortController;return zte(e,o),E1({stream:t,controller:o,binary:n,shouldEncode:!t.readableObjectMode&&r,encoding:i,shouldSplit:!t.readableObjectMode,preserveNewlines:s})},zte=async(t,e)=>{try{await t}catch{}finally{e.abort()}},D1=({stream:t,onStreamEnd:e,lines:n,encoding:r,stripFinalNewline:i,allMixed:s})=>{const o=new AbortController;qte(e,o,t);const a=t.readableObjectMode&&!s;return E1({stream:t,controller:o,binary:r==="buffer",shouldEncode:!a,encoding:r,shouldSplit:!a&&n,preserveNewlines:!i})},qte=async(t,e,n)=>{try{await t}catch{n.destroy()}finally{e.abort()}},E1=({stream:t,controller:e,binary:n,shouldEncode:r,encoding:i,shouldSplit:s,preserveNewlines:o})=>{const a=bd(t,"data",{signal:e.signal,highWaterMark:T1,highWatermark:T1});return jte({onStdoutChunk:a,controller:e,binary:n,shouldEncode:r,encoding:i,shouldSplit:s,preserveNewlines:o})},R1=Dd(!0),T1=R1,jte=async function*({onStdoutChunk:t,controller:e,binary:n,shouldEncode:r,encoding:i,shouldSplit:s,preserveNewlines:o}){const a=Ute({binary:n,shouldEncode:r,encoding:i,shouldSplit:s,preserveNewlines:o});try{for await(const[c]of t)yield*ld(c,a,0)}catch(c){if(!e.signal.aborted)throw c}finally{yield*eb(a)}},Ute=({binary:t,shouldEncode:e,encoding:n,shouldSplit:r,preserveNewlines:i})=>[YP(t,n,!e),GP(t,i,!r,{})].filter(Boolean),Gte=async({stream:t,onStreamEnd:e,fdNumber:n,encoding:r,buffer:i,maxBuffer:s,lines:o,allMixed:a,stripFinalNewline:c,verboseInfo:u,streamInfo:l})=>{const d=Wte({stream:t,onStreamEnd:e,fdNumber:n,encoding:r,allMixed:a,verboseInfo:u,streamInfo:l});if(!i){await Promise.all([Hte(t),d]);return}const f=UP(c,n),p=D1({stream:t,onStreamEnd:e,lines:o,encoding:r,stripFinalNewline:f,allMixed:a}),[m]=await Promise.all([Vte({stream:t,iterable:p,fdNumber:n,encoding:r,maxBuffer:s,lines:o}),d]);return m},Wte=async({stream:t,onStreamEnd:e,fdNumber:n,encoding:r,allMixed:i,verboseInfo:s,streamInfo:{fileDescriptors:o}})=>{if(!t1({stdioItems:o[n]?.stdioItems,encoding:r,verboseInfo:s,fdNumber:n}))return;const a=D1({stream:t,onStreamEnd:e,lines:!0,encoding:r,stripFinalNewline:!0,allMixed:i});await cee(a,t,n,s)},Hte=async t=>{await fx(),t.readableFlowing===null&&t.resume()},Vte=async({stream:t,stream:{readableObjectMode:e},iterable:n,fdNumber:r,encoding:i,maxBuffer:s,lines:o})=>{try{return e||o?await kJ(n,{maxBuffer:s}):i==="buffer"?new Uint8Array(await xJ(n,{maxBuffer:s})):await UJ(n,{maxBuffer:s})}catch(a){return S1(YJ({error:a,stream:t,readableObjectMode:e,lines:o,encoding:i,fdNumber:r}))}},$1=async t=>{try{return await t}catch(e){return S1(e)}},S1=({bufferedData:t})=>lK(t)?new Uint8Array(t):t,cb=async(t,e,n,{isSameDirection:r,stopOnExit:i=!1}={})=>{const s=Kte(t,n),o=new AbortController;try{await Promise.race([...i?[n.exitPromise]:[],li(t,{cleanup:!0,signal:o.signal})])}catch(a){s.stdinCleanedUp||Jte(a,e,n,r)}finally{o.abort()}},Kte=(t,{originalStreams:[e],subprocess:n})=>{const r={stdinCleanedUp:!1};return t===e&&Yte(t,n,r),r},Yte=(t,e,n)=>{const{_destroy:r}=t;t._destroy=(...i)=>{Xte(e,n),r.call(t,...i)}},Xte=({exitCode:t,signalCode:e},n)=>{(t!==null||e!==null)&&(n.stdinCleanedUp=!0)},Jte=(t,e,n,r)=>{if(!Qte(t,e,n,r))throw t},Qte=(t,e,n,r=!0)=>n.propagating?k1(t)||ub(t):(n.propagating=!0,C1(n,e)===r?k1(t):ub(t)),C1=({fileDescriptors:t},e)=>e!=="all"&&t[e].direction==="input",ub=t=>t?.code==="ERR_STREAM_PREMATURE_CLOSE",k1=t=>t?.code==="EPIPE",Zte=({subprocess:t,encoding:e,buffer:n,maxBuffer:r,lines:i,stripFinalNewline:s,verboseInfo:o,streamInfo:a})=>t.stdio.map((c,u)=>A1({stream:c,fdNumber:u,encoding:e,buffer:n[u],maxBuffer:r[u],lines:i[u],allMixed:!1,stripFinalNewline:s,verboseInfo:o,streamInfo:a})),A1=async({stream:t,fdNumber:e,encoding:n,buffer:r,maxBuffer:i,lines:s,allMixed:o,stripFinalNewline:a,verboseInfo:c,streamInfo:u})=>{if(!t)return;const l=cb(t,e,u);if(C1(u,e)){await l;return}const[d]=await Promise.all([Gte({stream:t,onStreamEnd:l,fdNumber:e,encoding:n,buffer:r,maxBuffer:i,lines:s,allMixed:o,stripFinalNewline:a,verboseInfo:c,streamInfo:u}),l]);return d},ene=({stdout:t,stderr:e},{all:n})=>n&&(t||e)?tb([t,e].filter(Boolean)):void 0,tne=({subprocess:t,encoding:e,buffer:n,maxBuffer:r,lines:i,stripFinalNewline:s,verboseInfo:o,streamInfo:a})=>A1({...nne(t,n),fdNumber:"all",encoding:e,maxBuffer:r[1]+r[2],lines:i[1]||i[2],allMixed:rne(t),stripFinalNewline:s,verboseInfo:o,streamInfo:a}),nne=({stdout:t,stderr:e,all:n},[,r,i])=>{const s=r||i;return s?r?i?{stream:n,buffer:s}:{stream:t,buffer:s}:{stream:e,buffer:s}:{stream:n,buffer:s}},rne=({all:t,stdout:e,stderr:n})=>t&&e&&n&&e.readableObjectMode!==n.readableObjectMode,ine=t=>aw(t,"ipc"),sne=(t,e)=>{const n=u_(t);sd({type:"ipc",verboseMessage:n,fdNumber:"ipc",verboseInfo:e})},one=async({subprocess:t,buffer:e,maxBuffer:n,ipc:r,ipcOutput:i,verboseInfo:s})=>{if(!r)return i;const o=ine(s),a=id(e,"ipc"),c=id(n,"ipc");for await(const u of s1({anyProcess:t,channel:t.channel,isSubprocess:!1,ipc:r,shouldAwait:!1,reference:!0}))a&&(JJ(t,i,c),i.push(u)),o&&sne(u,s);return i},ane=async(t,e)=>(await Promise.allSettled([t]),e),cne=async({subprocess:t,options:{encoding:e,buffer:n,maxBuffer:r,lines:i,timeoutDuration:s,cancelSignal:o,gracefulCancel:a,forceKillAfterDelay:c,stripFinalNewline:u,ipc:l,ipcInput:d},context:f,verboseInfo:p,fileDescriptors:m,originalStreams:w,onInternalError:E,controller:y})=>{const b=vee(t,f),R={originalStreams:w,fileDescriptors:m,subprocess:t,exitPromise:b,propagating:!1},C=Zte({subprocess:t,encoding:e,buffer:n,maxBuffer:r,lines:i,stripFinalNewline:u,verboseInfo:p,streamInfo:R}),A=tne({subprocess:t,encoding:e,buffer:n,maxBuffer:r,lines:i,stripFinalNewline:u,verboseInfo:p,streamInfo:R}),q=[],G=one({subprocess:t,buffer:n,maxBuffer:r,ipc:l,ipcOutput:q,verboseInfo:p}),Q=une(w,t,R),J=lne(m,R);try{return await Promise.race([Promise.all([{},bee(b),Promise.all(C),A,G,oJ(t,d),...Q,...J]),E,dne(t,y),...QX(t,s,f,y),...aX({subprocess:t,cancelSignal:o,gracefulCancel:a,context:f,controller:y}),...KX({subprocess:t,cancelSignal:o,gracefulCancel:a,forceKillAfterDelay:c,context:f,controller:y})])}catch(le){return f.terminationReason??="other",Promise.all([{error:le},b,Promise.all(C.map(N=>$1(N))),$1(A),ane(G,q),Promise.allSettled(Q),Promise.allSettled(J)])}},une=(t,e,n)=>t.map((r,i)=>r===e.stdio[i]?void 0:cb(r,i,n)),lne=(t,e)=>t.flatMap(({stdioItems:n},r)=>n.filter(({value:i,stream:s=i})=>Us(s,{checkOpen:!1})&&!Bs(s)).map(({type:i,value:s,stream:o=s})=>cb(o,r,e,{isSameDirection:Ws.has(i),stopOnExit:i==="native"}))),dne=async(t,{signal:e})=>{const[n]=await yn(t,"error",{signal:e});throw n},fne=()=>({readableDestroy:new WeakMap,writableFinal:new WeakMap,writableDestroy:new WeakMap}),lb=(t,e,n)=>{const r=t[n];r.has(e)||r.set(e,[]);const i=r.get(e),s=ad();return i.push(s),{resolve:s.resolve.bind(s),promises:i}},Vh=async({resolve:t,promises:e},n)=>{t();const[r]=await Promise.race([Promise.allSettled([!0,n]),Promise.all([!1,...e])]);return!r},_1=async t=>{if(t!==void 0)try{await P1(t)}catch{}},pne=async t=>{if(t!==void 0)try{await I1(t)}catch{}},P1=async t=>{await li(t,{cleanup:!0,readable:!1,writable:!0})},I1=async t=>{await li(t,{cleanup:!0,readable:!0,writable:!1})},x1=async(t,e)=>{if(await t,e)throw e},O1=(t,e,n)=>{n&&!ub(n)?t.destroy(n):e&&t.destroy()},hne=({subprocess:t,concurrentStreams:e,encoding:n},{from:r,binary:i=!0,preserveNewlines:s=!0}={})=>{const o=i||js.has(n),{subprocessStdout:a,waitReadableDestroy:c}=N1(t,r,e),{readableEncoding:u,readableObjectMode:l,readableHighWaterMark:d}=F1(a,o),{read:f,onStdoutDataDone:p}=L1({subprocessStdout:a,subprocess:t,binary:o,encoding:n,preserveNewlines:s}),m=new Ji({read:f,destroy:Ys(B1.bind(void 0,{subprocessStdout:a,subprocess:t,waitReadableDestroy:c})),highWaterMark:d,objectMode:l,encoding:u});return M1({subprocessStdout:a,onStdoutDataDone:p,readable:m,subprocess:t}),m},N1=(t,e,n)=>{const r=_w(t,e),i=lb(n,r,"readableDestroy");return{subprocessStdout:r,waitReadableDestroy:i}},F1=({readableEncoding:t,readableObjectMode:e,readableHighWaterMark:n},r)=>r?{readableEncoding:t,readableObjectMode:e,readableHighWaterMark:n}:{readableEncoding:t,readableObjectMode:!0,readableHighWaterMark:R1},L1=({subprocessStdout:t,subprocess:e,binary:n,encoding:r,preserveNewlines:i})=>{const s=ad(),o=b1({subprocessStdout:t,subprocess:e,binary:n,shouldEncode:!n,encoding:r,preserveNewlines:i});return{read(){mne(this,o,s)},onStdoutDataDone:s}},mne=async(t,e,n)=>{try{const{value:r,done:i}=await e.next();i?n.resolve():t.push(r)}catch{}},M1=async({subprocessStdout:t,onStdoutDataDone:e,readable:n,subprocess:r,subprocessStdin:i})=>{try{await I1(t),await r,await _1(i),await e,n.readable&&n.push(null)}catch(s){await _1(i),z1(n,s)}},B1=async({subprocessStdout:t,subprocess:e,waitReadableDestroy:n},r)=>{await Vh(n,e)&&(z1(t,r),await x1(e,r))},z1=(t,e)=>{O1(t,t.readable,e)},gne=({subprocess:t,concurrentStreams:e},{to:n}={})=>{const{subprocessStdin:r,waitWritableFinal:i,waitWritableDestroy:s}=q1(t,n,e),o=new cm({...j1(r,t,i),destroy:Ys(G1.bind(void 0,{subprocessStdin:r,subprocess:t,waitWritableFinal:i,waitWritableDestroy:s})),highWaterMark:r.writableHighWaterMark,objectMode:r.writableObjectMode});return U1(r,o),o},q1=(t,e,n)=>{const r=B_(t,e),i=lb(n,r,"writableFinal"),s=lb(n,r,"writableDestroy");return{subprocessStdin:r,waitWritableFinal:i,waitWritableDestroy:s}},j1=(t,e,n)=>({write:yne.bind(void 0,t),final:Ys(vne.bind(void 0,t,e,n))}),yne=(t,e,n,r)=>{t.write(e,n)?r():t.once("drain",r)},vne=async(t,e,n)=>{await Vh(n,e)&&(t.writable&&t.end(),await e)},U1=async(t,e,n)=>{try{await P1(t),e.writable&&e.end()}catch(r){await pne(n),W1(e,r)}},G1=async({subprocessStdin:t,subprocess:e,waitWritableFinal:n,waitWritableDestroy:r},i)=>{await Vh(n,e),await Vh(r,e)&&(W1(t,i),await x1(e,i))},W1=(t,e)=>{O1(t,t.writable,e)},wne=({subprocess:t,concurrentStreams:e,encoding:n},{from:r,to:i,binary:s=!0,preserveNewlines:o=!0}={})=>{const a=s||js.has(n),{subprocessStdout:c,waitReadableDestroy:u}=N1(t,r,e),{subprocessStdin:l,waitWritableFinal:d,waitWritableDestroy:f}=q1(t,i,e),{readableEncoding:p,readableObjectMode:m,readableHighWaterMark:w}=F1(c,a),{read:E,onStdoutDataDone:y}=L1({subprocessStdout:c,subprocess:t,binary:a,encoding:n,preserveNewlines:o}),b=new um({read:E,...j1(l,t,d),destroy:Ys(bne.bind(void 0,{subprocessStdout:c,subprocessStdin:l,subprocess:t,waitReadableDestroy:u,waitWritableFinal:d,waitWritableDestroy:f})),readableHighWaterMark:w,writableHighWaterMark:l.writableHighWaterMark,readableObjectMode:m,writableObjectMode:l.writableObjectMode,encoding:p});return M1({subprocessStdout:c,onStdoutDataDone:y,readable:b,subprocess:t,subprocessStdin:l}),U1(l,b,c),b},bne=async({subprocessStdout:t,subprocessStdin:e,subprocess:n,waitReadableDestroy:r,waitWritableFinal:i,waitWritableDestroy:s},o)=>{await Promise.all([B1({subprocessStdout:t,subprocess:n,waitReadableDestroy:r},o),G1({subprocessStdin:e,subprocess:n,waitWritableFinal:i,waitWritableDestroy:s},o)])},H1=(t,e,{from:n,binary:r=!1,preserveNewlines:i=!1}={})=>{const s=r||js.has(e),o=_w(t,n),a=b1({subprocessStdout:o,subprocess:t,binary:s,shouldEncode:!0,encoding:e,preserveNewlines:i});return Dne(a,o,t)},Dne=async function*(t,e,n){try{yield*t}finally{e.readable&&e.destroy(),await n}},Ene=(t,{encoding:e})=>{const n=fne();t.readable=hne.bind(void 0,{subprocess:t,concurrentStreams:n,encoding:e}),t.writable=gne.bind(void 0,{subprocess:t,concurrentStreams:n}),t.duplex=wne.bind(void 0,{subprocess:t,concurrentStreams:n,encoding:e}),t.iterable=H1.bind(void 0,t,e),t[Symbol.asyncIterator]=H1.bind(void 0,t,e,{})},Rne=(t,e)=>{for(const[n,r]of $ne){const i=r.value.bind(e);Reflect.defineProperty(t,n,{...r,value:i})}},Tne=(async()=>{})().constructor.prototype,$ne=["then","catch","finally"].map(t=>[t,Reflect.getOwnPropertyDescriptor(Tne,t)]),Sne=(t,e,n,r)=>{const{file:i,commandArguments:s,command:o,escapedCommand:a,startTime:c,verboseInfo:u,options:l,fileDescriptors:d}=Cne(t,e,n),{subprocess:f,promise:p}=Ane({file:i,commandArguments:s,options:l,startTime:c,verboseInfo:u,command:o,escapedCommand:a,fileDescriptors:d});return f.pipe=ab.bind(void 0,{source:f,sourcePromise:p,boundOptions:{},createNested:r}),Rne(f,p),qs.set(f,{options:l,fileDescriptors:d}),f},Cne=(t,e,n)=>{const{command:r,escapedCommand:i,startTime:s,verboseInfo:o}=f_(t,e,n),{file:a,commandArguments:c,options:u}=eP(t,e,n),l=kne(u),d=Yee(l,o);return{file:a,commandArguments:c,command:r,escapedCommand:i,startTime:s,verboseInfo:o,options:l,fileDescriptors:d}},kne=({timeout:t,signal:e,...n})=>{if(e!==void 0)throw new TypeError('The "signal" option has been renamed to "cancelSignal" instead.');return{...n,timeoutDuration:t}},Ane=({file:t,commandArguments:e,options:n,startTime:r,verboseInfo:i,command:s,escapedCommand:o,fileDescriptors:a})=>{let c;try{c=dx(t,e,n)}catch(m){return Uee({error:m,command:s,escapedCommand:o,fileDescriptors:a,options:n,startTime:r,verboseInfo:i})}const u=new AbortController;hx(Number.POSITIVE_INFINITY,u.signal);const l=[...c.stdio];lte(c,a,u),Ete(c,n,u);const d={},f=ad();c.kill=nX.bind(void 0,{kill:c.kill.bind(c),options:n,onInternalError:f,context:d,controller:u}),c.all=ene(c,n),Ene(c,n),qee(c,n);const p=_ne({subprocess:c,options:n,startTime:r,verboseInfo:i,fileDescriptors:a,originalStreams:l,command:s,escapedCommand:o,context:d,onInternalError:f,controller:u});return{subprocess:c,promise:p}},_ne=async({subprocess:t,options:e,startTime:n,verboseInfo:r,fileDescriptors:i,originalStreams:s,command:o,escapedCommand:a,context:c,onInternalError:u,controller:l})=>{const[d,[f,p],m,w,E]=await cne({subprocess:t,options:e,context:c,verboseInfo:r,fileDescriptors:i,originalStreams:s,onInternalError:u,controller:l});l.abort(),u.resolve();const y=m.map((C,A)=>Yo(C,e,A)),b=Yo(w,e,"all"),R=Pne({errorInfo:d,exitCode:f,signal:p,stdio:y,all:b,ipcOutput:E,context:c,options:e,command:o,escapedCommand:a,startTime:n});return Hw(R,r,e)},Pne=({errorInfo:t,exitCode:e,signal:n,stdio:r,all:i,ipcOutput:s,context:o,options:a,command:c,escapedCommand:u,startTime:l})=>"error"in t?Ww({error:t.error,command:c,escapedCommand:u,timedOut:o.terminationReason==="timeout",isCanceled:o.terminationReason==="cancel"||o.terminationReason==="gracefulCancel",isGracefullyCanceled:o.terminationReason==="gracefulCancel",isMaxBuffer:t.error instanceof Bh,isForcefullyTerminated:o.isForcefullyTerminated,exitCode:e,signal:n,stdio:r,all:i,ipcOutput:s,options:a,startTime:l,isSync:!1}):wP({command:c,escapedCommand:u,stdio:r,all:i,ipcOutput:s,options:a,startTime:l}),db=(t,e)=>{const n=Object.fromEntries(Object.entries(e).map(([r,i])=>[r,Ine(r,t[r],i)]));return{...t,...n}},Ine=(t,e,n)=>xne.has(t)&&en(e)&&en(n)?{...e,...n}:n,xne=new Set(["env",...i_]),Hs=(t,e,n,r)=>{const i=(o,a,c)=>Hs(o,a,n,c),s=(...o)=>One({mapArguments:t,deepOptions:n,boundOptions:e,setBoundExeca:r,createNested:i},...o);return r!==void 0&&r(s,i,e),s},One=({mapArguments:t,deepOptions:e={},boundOptions:n={},setBoundExeca:r,createNested:i},s,...o)=>{if(en(s))return i(t,db(n,s),r);const{file:a,commandArguments:c,options:u,isSync:l}=Nne({mapArguments:t,firstArgument:s,nextArguments:o,deepOptions:e,boundOptions:n});return l?Tee(a,c,u):Sne(a,c,u,i)},Nne=({mapArguments:t,firstArgument:e,nextArguments:n,deepOptions:r,boundOptions:i})=>{const s=yK(e)?vK(e,n):[e,...n],[o,a,c]=HA(...s),u=db(db(r,i),c),{file:l=o,commandArguments:d=a,options:f=u,isSync:p=!1}=t({file:o,commandArguments:a,options:u});return{file:l,commandArguments:d,options:f,isSync:p}},Fne=({file:t,commandArguments:e})=>V1(t,e),Lne=({file:t,commandArguments:e})=>({...V1(t,e),isSync:!0}),V1=(t,e)=>{if(e.length>0)throw new TypeError(`The command and its arguments must be passed as a single string: ${t} ${e}.`);const[n,...r]=Mne(t);return{file:n,commandArguments:r}},Mne=t=>{if(typeof t!="string")throw new TypeError(`The command must be a string: ${String(t)}.`);const e=t.trim();if(e==="")return[];const n=[];for(const r of e.split(Bne)){const i=n.at(-1);i&&i.endsWith("\\")?n[n.length-1]=`${i.slice(0,-1)} ${r}`:n.push(r)}return n},Bne=/ +/g,zne=(t,e,n)=>{t.sync=e(jne,n),t.s=t.sync},qne=({options:t})=>K1(t),jne=({options:t})=>({...K1(t),isSync:!0}),K1=t=>({options:{...Une(t),...t}}),Une=({input:t,inputFile:e,stdio:n})=>t===void 0&&e===void 0&&n===void 0?{stdin:"inherit"}:{},Gne={preferLocal:!0},fb=Hs(()=>({}));Hs(()=>({isSync:!0})),Hs(Fne),Hs(Lne),Hs(eJ),Hs(qne,{},Gne,zne),jee();const pb=tv(2);let Wne=class{constructor(e="dot"){this.path=e}async unflatten(e){return await pb(async()=>{const n=await fb("unflatten",["-l 1","-c 3"],{reject:!1,timeout:1e4,input:e,stdin:"pipe",encoding:"utf8"});return n instanceof Error&&(n.stdout?Ct.warn(`[BinaryGraphvizLayouter.layout] '${n.command}' failed: ${n.stderr}
|
|
1836
|
+
|
|
1837
|
+
but returned
|
|
1838
|
+
${n.stdout}`):Ct.error(`[BinaryGraphvizLayouter.layout] '${n.command}' failed: ${n.stderr}
|
|
1839
|
+
|
|
1840
|
+
nothing returned, ignoring...`)),n.stdout&&(e=n.stdout.replaceAll(/\t\[/g," [").replaceAll(/\t/g," ")),e})}async layoutJson(e){return await pb(async()=>{const n=await fb(this.path,["-Tjson","-y"],{reject:!1,timeout:1e4,input:e,stdin:"pipe",encoding:"utf8"});if(n instanceof Error){if(!n.stdout)throw Ct.error(`[BinaryGraphvizLayouter.layout] '${n.command}' nothing returned and failed: "${n.stderr}"`),n;Ct.warn(`[BinaryGraphvizLayouter.layout] '${n.command}' returned result but also failed "${n.stderr}"`)}return n.stdout})}async acyclic(e){return Promise.reject(new Error("Method not implemented."))}async svg(e){return await pb(async()=>{const n=await fb(this.path,["-Tsvg","-y"],{reject:!1,timeout:1e4,input:e,stdin:"pipe",encoding:"utf8"});if(n instanceof Error){if(!n.stdout)throw Ct.error(`[BinaryGraphvizLayouter.layout] '${n.command}' nothing returned and failed: ${n.stderr}`),n;Ct.warn(`[BinaryGraphvizLayouter.layout] '${n.command}' returned result but also failed ${n.stderr}`)}return n.stdout})}};const Y1="1.20.1",Hne=t=>{hb.forEach(e=>{Vne(t,e)})},hb=["name","message","stack","cause","errors"],Vne=(t,e)=>{const n=mb(t,e);if(n!==void 0){if(Kne(n)){oi(t,e,t[e]);return}Yne(n)&&X1(t,e,n)}},mb=(t,e)=>{const n=Object.getOwnPropertyDescriptor(t,e);if(n!==void 0)return n;const r=Object.getPrototypeOf(t);return r===null?void 0:mb(r,e)},Kne=({get:t,set:e})=>t!==void 0&&e===void 0,Yne=({enumerable:t,writable:e})=>t||!e,oi=(t,e,n)=>{X1(t,e,{value:n})},X1=(t,e,n)=>{Object.defineProperty(t,e,{...n,..."get"in n||"set"in n?{}:{writable:!0},enumerable:!1,configurable:!0})},Xne=(t,e)=>{if(Array.isArray(t.errors)){const n=t.errors.filter(Jne).map(e).filter(Boolean);oi(t,"errors",n)}else Qne(t)?oi(t,"errors",[]):t.errors!==void 0&&Zne(t)},Jne=t=>t!==void 0,Qne=t=>"AggregateError"in globalThis&&(t.name==="AggregateError"||t instanceof AggregateError),Zne=t=>{delete t.errors,t.errors!==void 0&&oi(t,"errors",[])},ere=(t,e)=>{if(!("cause"in t))return;const n=t.cause===void 0?t.cause:e(t.cause);n===void 0?delete t.cause:oi(t,"cause",n)},tre=t=>nre(t)||rre(t),nre=t=>{try{return t instanceof Error}catch{return!1}},rre=t=>{try{return ire.has(Object.prototype.toString.call(t))}catch{return!1}},ire=new Set(["[object Error]","[object DOMException]","[object DOMError]","[object Exception]"]),sre=t=>!Object.isExtensible(t)||hb.some(e=>ore(t,e)||are(t,e)),ore=(t,e)=>{const n=Object.getOwnPropertyDescriptor(t,e);return n!==void 0&&!n.configurable},are=(t,e)=>{try{return t[e],!1}catch{return!0}},gb=t=>{const e=cre(t.message,t.name);oi(t,"stack",e)},cre=(t="",e="Error")=>{const n=ure(e),{stack:r}=new n(t);return typeof r=="string"&&r!==""?r:`${e}: ${t}`},ure=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},lre=t=>{const e={};for(const n of dre(t))try{const r=t[n],{enumerable:i,configurable:s,writable:o=!0}=mb(t,n);Object.defineProperty(e,n,{value:r,enumerable:i,configurable:s,writable:o})}catch{}return e},dre=t=>{const e=fre(t);for(const n of hb)pre(t,n)&&e.push(n);return e},fre=t=>{try{return Reflect.ownKeys(t)}catch{return[]}},pre=(t,e)=>{try{return e in t&&!Object.hasOwn(t,e)}catch{return!1}},J1=t=>{const{name:e,message:n,stack:r,cause:i,errors:s,...o}=lre(t),a=hre(n,o),c=vre(e,a);return n===a&&wre(c,o),Object.entries({name:e,stack:r,cause:i,errors:s}).forEach(([u,l])=>{bre(c,u,l)}),r===void 0&&gb(c),c},hre=(t,e)=>typeof t=="string"&&t!==""?t:yre(mre(e)),mre=t=>{try{return JSON.stringify(t)}catch{return gre(t)}},gre=t=>{try{return String(t)}catch{return"Invalid error"}},yre=t=>t.length<Q1?t:`${t.slice(0,Q1)}...`,Q1=1e3,vre=(t,e)=>t==="AggregateError"&&"AggregateError"in globalThis?new AggregateError([],e):t in Z1?new Z1[t](e):new Error(e),Z1={Error,ReferenceError,TypeError,SyntaxError,RangeError,URIError,EvalError},wre=(t,e)=>{for(const n in e)n in t||(t[n]=e[n])},bre=(t,e,n)=>{n!==void 0&&oi(t,e,n)},Dre=t=>{try{const e=new Error(String(t));return gb(e),e}catch(e){return e}},{toString:Ere}=Object.prototype,Rre=t=>Tre(t)?J1(t):tre(t)?$re(t)?J1(t):t:Dre(t),Tre=t=>{try{return en(t)}catch{return!1}},$re=t=>Sre(t)||sre(t)||Cre(t),Sre=t=>{try{return Ere.call(t)==="[object Object]"}catch{return!0}},Cre=t=>typeof t.constructor!="function"||typeof t.constructor.name!="string"||t.constructor.name===""||t.constructor.prototype!==Object.getPrototypeOf(t),Kh=(t,{shallow:e=!1}={})=>eI(t,[],e),eI=(t,e,n)=>{if(e.includes(t))return;const r=n?kre:s=>eI(s,[...e,t],n),i=Rre(t);return Are(i,r),i},kre=t=>t,Are=(t,e)=>{_re(t),Pre(t),Ire(t),ere(t,e),Xne(t,e),Hne(t)},_re=t=>{if(Yh(t.name))return;const e=Object.getPrototypeOf(t).name,n=Yh(e)?e:t.constructor.name;oi(t,"name",n)},Pre=t=>{Yh(t.message)||oi(t,"message","")},Ire=t=>{Yh(t.stack)||gb(t)},Yh=t=>typeof t=="string"&&t!=="",xre=(t,e,n=t.name)=>{if(Ore(e),typeof n!="string")throw new TypeError(`currentName must be a string: ${n}`);return n},Ore=t=>{if(!Nre(t))throw new TypeError(`ErrorClass must be a class: ${t}`);if(!tI(t.prototype))throw new TypeError(`ErrorClass must inherit from Error: ${t}`);if(!Fre(t))throw new TypeError(`ErrorClass must be have a valid constructor: ${t}`)},Nre=t=>typeof t=="function"&&typeof t.prototype=="object"&&t.prototype!==null,tI=t=>t!==null&&(t.name==="Error"||tI(Object.getPrototypeOf(t))),Fre=t=>typeof t.prototype.constructor=="function",nI=(t,e,n)=>{Object.defineProperty(t,e,{value:n,enumerable:!1,writable:!0,configurable:!0})},Lre=(t,e)=>{Object.getPrototypeOf(t)!==e.prototype&&(Mre(t,e),sI(t,"constructor"),Bre(t,e))},Mre=(t,e)=>{Object.setPrototypeOf(t,e.prototype)},Bre=(t,e)=>{sI(t,"name");const n=rI(e.prototype);t.name!==n&&nI(t,"name",n)},rI=t=>zre(t)??qre(t)??rI(Object.getPrototypeOf(t)),zre=t=>Object.hasOwn(t,"name")&&iI(t.name)?t.name:void 0,qre=t=>typeof t.constructor=="function"&&iI(t.constructor.name)?t.constructor.name:void 0,iI=t=>typeof t=="string"&&t!=="",sI=(t,e)=>{Object.hasOwn(t,e)&&delete t[e]},jre=(t,e)=>{if(!Ure(t,e))return;const n=Wre(t,e);nI(t,"stack",n)},Ure=(t,e)=>e!==t.name&&e!==""&&t.stack.includes(e)&&Gre(),Gre=()=>{class t extends Error{}const e={value:oI,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(oI)},oI="SetErrorClassError",Wre=({name:t,stack:e},n)=>{if(e.startsWith(`${n}: `))return e.replace(n,t);const r=Hre(n,t),[i,s]=r.find(([o])=>e.includes(o));return e.replace(i,s)},Hre=(t,e)=>[[`
|
|
1841
|
+
${t}: `,`
|
|
1842
|
+
${e}: `],[`${t}: `,`${e}: `],[`${t} `,`${e} `],[t,e]],Vre=(t,e,n)=>{const r=Kh(t),i=xre(r,e,n);return Lre(r,e),jre(r,i),r},Kre=(t,e)=>e.configurable===!1?Yre(t,e):Qre(t,e),Yre=(t,e)=>({...e,...Xre(t,e),...Jre(t,e)}),Xre=(t,e)=>e.writable===!0&&t.writable===!1?{writable:!1}:{},Jre=(t,e)=>t.hasValue&&"value"in e&&e.writable===!0?{value:t.value}:{},Qre=(t,e)=>{const n=pd(t.enumerable,e.enumerable,!0),r=pd(t.writable,e.writable,!0),i=pd(t.configurable,e.configurable,!0);return{...Zre(t,e,r),enumerable:n,configurable:i}},Zre=(t,e,n)=>t.hasValue?{value:t.value,writable:n}:!aI(t)&&!aI(e)?{value:e.value,writable:n}:{get:pd(t.get,e.get),set:pd(t.set,e.set)},aI=({get:t,set:e})=>t!==void 0||e!==void 0,pd=(t,e,n)=>t??e??n,eie=(t,e,n)=>{if(!tie(t))throw new TypeError(`Argument must be an object: ${t}`);if(!nie(e))throw new TypeError(`Property key must be a string, a symbol or an integer: ${e}`);return rie(n)},tie=t=>typeof t=="object"&&t!==null,nie=t=>{const e=typeof t;return e==="string"||e==="symbol"||e==="number"},rie=t=>{if(!en(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,c="value"in t;return iie({enumerable:e,writable:n,configurable:r,get:s,set:o,unknownProps:a,hasValue:c}),{enumerable:e,writable:n,configurable:r,value:i,get:s,set:o,hasValue:c}},iie=({enumerable:t,writable:e,configurable:n,get:r,set:i,unknownProps:s,hasValue:o})=>{cI(o,r,"get"),cI(o,i,"set"),yb(t,"enumerable"),yb(e,"writable"),yb(n,"configurable"),oie(s)},cI=(t,e,n)=>{if(sie(e,n),t&&e!==void 0)throw new TypeError(`Descriptor property "value" and "${n}" must not both be defined: ${e}`)},sie=(t,e)=>{if(t!==void 0&&typeof t!="function")throw new TypeError(`Descriptor property "${e}" must be a function: ${t}`)},yb=(t,e)=>{if(t!==void 0&&typeof t!="boolean")throw new TypeError(`Descriptor property "${e}" must be a boolean: ${t}`)},oie=t=>{const[e]=Object.keys(t);if(e!==void 0)throw new TypeError(`Unknown descriptor property "${e}": ${t[e]}`)},aie=(t,e,n)=>{const r=eie(t,e,n),i=uI(t,e),s=Kre(r,i);return cie(t,e,s),t},uI=(t,e)=>{const n=Object.getOwnPropertyDescriptor(t,e);if(n!==void 0)return n;const r=Object.getPrototypeOf(t);return r===null?{}:uI(r,e)},cie=(t,e,n)=>{try{Object.defineProperty(t,e,n)}catch{}},uie=(t,e,n)=>{if(n!==void 0)return lI(t,e,n);try{delete t[e]}catch{}if(t[e]!==void 0)return lI(t,e)},lI=(t,e,n)=>{const r=lie(e);aie(t,e,{value:n,...r})},lie=t=>typeof t=="string"&&t.startsWith("_")?{enumerable:!1}:{},die=t=>fie(t)||pie(t),fie=t=>{try{return t instanceof Error}catch{return!1}},pie=t=>{try{return hie.has(Object.prototype.toString.call(t))}catch{return!1}},hie=new Set(["[object Error]","[object DOMException]","[object DOMError]","[object Exception]"]),mie=(t,e,n={})=>{if(dI(t,"First argument"),dI(e,"Second argument"),!en(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}},dI=(t,e)=>{if(t===void 0)throw new TypeError(`${e} is required.`);if(!gie(t))throw new TypeError(`${e} must be a plain object or an error: ${t}`)},gie=t=>en(t)||die(t),yie=({error:t,props:e,propName:n,soft:r})=>vie(n)||!Die.call(e,n)||r&&t[n]!==void 0,vie=t=>t in wie||bie.has(t),wie=new Error("check"),bie=new Set(["prototype","errors","cause"]),{propertyIsEnumerable:Die}=Object.prototype,Eie=(t,e,n)=>{const{soft:r}=mie(t,e,n);for(const i of Reflect.ownKeys(e))Rie({error:t,props:e,propName:i,soft:r});return t},Rie=({error:t,props:e,propName:n,soft:r})=>{yie({error:t,props:e,propName:n,soft:r})||uie(t,n,e[n])},Xh=(t,e,n)=>{Object.defineProperty(t,e,{value:n,writable:!0,enumerable:!1,configurable:!0})},Tie=(t,e)=>{if(t.errors===void 0)return;const n=t.errors.map(r=>e(r).error).filter(Boolean);Xh(t,"errors",n)},$ie=({target:t,source:e,parent:n,child:r})=>{if(!fI(t)){Sie(t,e);return}fI(e)&&Xh(t,"errors",[...r.errors,...n.errors])},Sie=(t,e)=>{e.errors!==void 0&&Xh(t,"errors",e.errors)},fI=t=>t.errors!==void 0&&t.errors.length!==0,Cie=(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},kie=({name:t,stack:e},n,r)=>r!==""&&e.includes(r)?Aie({name:t,stack:e,newMessage:n,currentMessage:r}):Pie(t,e,n),Aie=({name:t,stack:e,newMessage:n,currentMessage:r})=>{const i=_ie(t,n,r),[s,o]=i.find(([a])=>e.includes(a));return e.replace(s,o)},_ie=(t,e,n)=>[[`${t}: ${n}`,`${t}: ${e}`],[`: ${n}`,`: ${e}`],[`
|
|
1843
|
+
${n}`,`
|
|
1844
|
+
${e}`],[` ${n}`,` ${e}`],[n,e]],Pie=(t,e,n)=>{const r=`${t}: `,i=n.trimEnd();return e===t||e.startsWith(`${t}
|
|
1845
|
+
`)?e.replace(t,`${r}${i}`):e.startsWith(r)?e.replace(r,`${r}${i}
|
|
1846
|
+
`):`${r}${i}
|
|
1847
|
+
${e}`},Iie=(t,e,n)=>{const r=Kh(t),i=Cie(r,e,n);return hI(r,"message",e),xie(r,e,i),r},xie=(t,e,n)=>{if(e===n||!Oie())return;const r=kie(t,e,n);hI(t,"stack",r)},Oie=()=>{const{stack:t}=new Error(pI);return typeof t=="string"&&t.includes(pI)},pI="set-error-message test message",hI=(t,e,n)=>{Object.defineProperty(t,e,{value:n,enumerable:!1,writable:!0,configurable:!0})},Nie=(t,e,n)=>{if(typeof e!="string")throw new TypeError(`Second argument must be a message string: ${e}`);const r=Kh(t),i=Fie(e,r.message);return Iie(r,i,n)},Fie=(t,e)=>{const n=t.trim(),r=e.trim();return n===""?r:r===""?n:Lie(n,r,t)},Lie=(t,e,n)=>t.endsWith(Mie)?n.endsWith(Bie)?`${t}
|
|
1848
|
+
${e}`:`${t} ${e}`:`${e}
|
|
1849
|
+
${t}`,Mie=":",Bie=`
|
|
1850
|
+
`,zie=({parent:t,child:e,target:n,stackError:r})=>{const i=t.message;return n.message=e.message,Nie(n,i,r.message)},qie=(t,e)=>mI(t)===e,mI=t=>typeof t=="object"&&t!==null?t.stack:void 0,jie=({wrap:t,target:e,source:n,childHasStack:r})=>t===r?e:(Xh(e,"stack",n.stack),n),Uie=t=>{const{wrap:e,name:n}=t;return typeof e!="boolean"?n==="Error":(Object.hasOwn(t,"wrap")&&delete t.wrap,e)},Gie=t=>gI(t,[]).error,gI=(t,e)=>{if(e.includes(t))return{};const n=u=>gI(u,[...e,t]),r=mI(t),i=Kh(t,{shallow:!0}),s=qie(i,r);Tie(i,n);const{parent:o,childHasStack:a}=Wie(i,n);return{error:o,errorHasStack:s||a}},Wie=(t,e)=>{const n=Uie(t);if(t.cause===void 0)return{parent:t,childHasStack:!1};const{error:r,errorHasStack:i}=e(t.cause);return delete t.cause,{parent:Hie({parent:t,child:r,childHasStack:i,wrap:n}),childHasStack:i}},Hie=({parent:t,child:e,childHasStack:n,wrap:r})=>{if(e===void 0)return t;const[i,s]=r?[e,t]:[t,e],o=jie({wrap:r,target:i,source:s,childHasStack:n}),a=Vre(i,i.constructor,o.name),c=zie({parent:t,child:e,target:a,stackError:o});return $ie({target:c,source:s,parent:t,child:e}),Eie(c,s,{soft:!r})},Jh=Object.create(null),hd=t=>globalThis.process?.env||import.meta.env||globalThis.Deno?.env.toObject()||globalThis.__env__||(t?Jh:globalThis),Bi=new Proxy(Jh,{get(t,e){return hd()[e]??Jh[e]},has(t,e){const n=hd();return e in n||e in Jh},set(t,e,n){const r=hd(!0);return r[e]=n,!0},deleteProperty(t,e){if(!e)return!1;const n=hd(!0);return delete n[e],!0},ownKeys(){const t=hd(!0);return Object.keys(t)}}),Vie=typeof process<"u"&&process.env&&process.env.NODE_ENV||"",Kie=[["APPVEYOR"],["AWS_AMPLIFY","AWS_APP_ID",{ci:!0}],["AZURE_PIPELINES","SYSTEM_TEAMFOUNDATIONCOLLECTIONURI"],["AZURE_STATIC","INPUT_AZURE_STATIC_WEB_APPS_API_TOKEN"],["APPCIRCLE","AC_APPCIRCLE"],["BAMBOO","bamboo_planKey"],["BITBUCKET","BITBUCKET_COMMIT"],["BITRISE","BITRISE_IO"],["BUDDY","BUDDY_WORKSPACE_ID"],["BUILDKITE"],["CIRCLE","CIRCLECI"],["CIRRUS","CIRRUS_CI"],["CLOUDFLARE_PAGES","CF_PAGES",{ci:!0}],["CODEBUILD","CODEBUILD_BUILD_ARN"],["CODEFRESH","CF_BUILD_ID"],["DRONE"],["DRONE","DRONE_BUILD_EVENT"],["DSARI"],["GITHUB_ACTIONS"],["GITLAB","GITLAB_CI"],["GITLAB","CI_MERGE_REQUEST_ID"],["GOCD","GO_PIPELINE_LABEL"],["LAYERCI"],["HUDSON","HUDSON_URL"],["JENKINS","JENKINS_URL"],["MAGNUM"],["NETLIFY"],["NETLIFY","NETLIFY_LOCAL",{ci:!1}],["NEVERCODE"],["RENDER"],["SAIL","SAILCI"],["SEMAPHORE"],["SCREWDRIVER"],["SHIPPABLE"],["SOLANO","TDDIUM"],["STRIDER"],["TEAMCITY","TEAMCITY_VERSION"],["TRAVIS"],["VERCEL","NOW_BUILDER"],["VERCEL","VERCEL",{ci:!1}],["VERCEL","VERCEL_ENV",{ci:!1}],["APPCENTER","APPCENTER_BUILD_ID"],["CODESANDBOX","CODESANDBOX_SSE",{ci:!1}],["STACKBLITZ"],["STORMKIT"],["CLEAVR"],["ZEABUR"],["CODESPHERE","CODESPHERE_APP_ID",{ci:!0}],["RAILWAY","RAILWAY_PROJECT_ID"],["RAILWAY","RAILWAY_SERVICE_ID"],["DENO-DEPLOY","DENO_DEPLOYMENT_ID"],["FIREBASE_APP_HOSTING","FIREBASE_APP_HOSTING",{ci:!0}]];function Yie(){if(globalThis.process?.env)for(const t of Kie){const e=t[1]||t[0];if(globalThis.process?.env[e])return{name:t[0].toLowerCase(),...t[2]}}return globalThis.process?.env?.SHELL==="/bin/jsh"&&globalThis.process?.versions?.webcontainer?{name:"stackblitz",ci:!1}:{name:"",ci:!1}}const yI=Yie();yI.name;function Vs(t){return t?t!=="false":!1}const Xie=globalThis.process?.platform||"",Qh=Vs(Bi.CI)||yI.ci!==!1,vI=Vs(globalThis.process?.stdout&&globalThis.process?.stdout.isTTY);Vs(Bi.DEBUG);const Jie=Vie==="test"||Vs(Bi.TEST);Vs(Bi.MINIMAL);const Qie=/^win/i.test(Xie);!Vs(Bi.NO_COLOR)&&(Vs(Bi.FORCE_COLOR)||(vI||Qie)&&Bi.TERM);const Zie=(globalThis.process?.versions?.node||"").replace(/^v/,"")||null;Number(Zie?.split(".")[0]);const ese=globalThis.process||Object.create(null),wI={versions:{}};new Proxy(ese,{get(t,e){if(e==="env")return Bi;if(e in t)return t[e];if(e in wI)return wI[e]}});const tse=globalThis.process?.release?.name==="node",nse=!!globalThis.Bun||!!globalThis.process?.versions?.bun,rse=!!globalThis.Deno,ise=!!globalThis.fastly,sse=!!globalThis.Netlify,ose=!!globalThis.EdgeRuntime,ase=globalThis.navigator?.userAgent==="Cloudflare-Workers",cse=[[sse,"netlify"],[ose,"edge-light"],[ase,"workerd"],[ise,"fastly"],[rse,"deno"],[nse,"bun"],[tse,"node"]];function use(){const t=cse.find(e=>e[0]);if(t)return{name:t[1]}}const lse=use();lse?.name;const bI=ft.bold(ft.bgRed(ft.white("ERROR"))),DI=ft.bold(ft.yellow("WARN")),dse=ft.bold(ft.green("INFO"));function EI(t){const e=yx("info",{prefix:t,allowClearScreen:!Qh}),n=!Qh;return{...e,info(r,i){e.info(`${dse} ${r}`,{timestamp:n,...i})},warn(r,i){if(r instanceof Error){e.warn(`${DI} ${ft.red(r.name+" "+r.message)}
|
|
1851
|
+
${yd(r,{colors:!0})}`,{timestamp:n,...i});return}e.warn(`${DI} ${r}`,{timestamp:n,...i})},error(r,i){if(r instanceof Error){const s=Gie(r);e.error(`${bI} ${ft.red(s.message)}
|
|
1852
|
+
${yd(s,{colors:!0})}`,{timestamp:n,error:r,...i});return}e.error(`${bI} ${r}`,{timestamp:n,...i})}}}const vb=()=>{},fse={info:vb,warn:vb,error:vb},pse=1e6;function RI(t){const[e,n]=wd(t),r=e*1e3+n/pse;return{ms:r,pretty:EP(r)}}function hse(t){const e=wd();return{stopAndLog(n="done in "){n=ft.green(`${n}${RI(e).pretty}`),t?t.info(n):Ct.success(n)}}}class mse{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(`${ft.dim("workspace:")} ${e.uri}`),r.initialize({capabilities:{},processId:null,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,n=this.services.likec4.ModelBuilder,r=this.services.shared.workspace.LangiumDocuments,i=this.services.shared.workspace.DocumentBuilder,s=r.all.toArray();if(s.length===0)throw e.error("no LikeC4 sources found"),new Error("no LikeC4 sources found");e.info(`${ft.dim("workspace:")} found ${s.length} source files`),await i.build(s,{validation:!0});const o=await n.buildComputedModel(),a=mc(o?.views??{}).length;if(a===0){e.warn(`${ft.dim("workspace:")} no views found`);return}e.info(`${ft.dim("workspace:")} ${ft.green(`\u2713 computed ${a} views`)}`);const c=await this.services.likec4.Views.diagrams();c.length===a?e.info(`${ft.dim("workspace:")} ${ft.green("\u2713 all views layouted")}`):e.warn(`${ft.dim("workspace:")} ${ft.yellow(`\u2717 layouted ${c.length} views`)}`)}}function gse(t){return e=>new t(e)}const yse={logger:()=>{throw new Error("Logger must be provided")},likec4:{Layouter:()=>{throw new Error("Layouter must be provided")}},cli:{Workspace:gse(mse)}};function TI(t){const e=pm(t,{useFileSystem:!0,logger:"default",graphviz:"wasm"});let n;switch(e.logger){case!1:n=fse;break;case"vite":n=EI("c4:lsp ");break;case"default":n=Ct.withTag("lsp");break;default:n=e.logger}const r=e.graphviz==="binary";n.info(`${ft.dim("version")} ${Y1}`),n.info(`${ft.dim("layout")} ${r?"binary":"wasm"}`);const i={logger:()=>n,likec4:{Layouter:()=>new Rk(r===!0?new Wne:new Tk)}};return tW(e.logger===!1?"silent":"info"),e.logger!==!1&&e.logger!=="default"&&xe.setReporters([{log:({level:s,...o},a)=>{const c=o.tag||"",u=o.args.map(d=>E8(d)?d.stack??d.message:typeof d=="string"?d:String(d));c&&u.unshift(`[${c}]`);const l=u.join(" ");switch(!0){case s>=ht.debug:break;case s>=ht.info:{n.info(l);break}case s>=ht.log:{n.info(l);break}case s>=ht.warn:{n.warn(l);break}case s>=ht.fatal:{n.error(l);break}}}}]),cK(e.useFileSystem?rW:{},yse,i).likec4}const $I=t=>new Error(`Invalid model:
|
|
1853
|
+
${t.getErrors().map(e=>` ${e.sourceFsPath}:${e.line} ${e.message.slice(0,200)}`).join(`
|
|
1854
|
+
`)}`);class zi{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=TI(pm(n,{useFileSystem:!1,logger:!1,graphviz:"wasm"})),i=Wt.from({scheme:"virtual",path:"/workspace"});await r.cli.Workspace.initWorkspace({uri:i.toString(),name:"virtual"});const s=Rt.joinPath(i,"source.likec4");r.shared.workspace.LangiumDocuments.createDocument(s,e),await r.cli.Workspace.init();const o=new zi(i.path,r,n?.printErrors??!0);return n?.throwIfInvalid===!0&&o.hasErrors()?(o.dispose(),Promise.reject($I(o))):o}static likec4Instances=new Map;static async fromWorkspace(e="",n){const r=PI(e);if(!_I(r))throw new Error(`Workspace not found: ${r}`);let i=zi.likec4Instances.get(r);if(!i){const s=TI(pm(n,{useFileSystem:!0,logger:"default",graphviz:"wasm"}));await s.cli.Workspace.initWorkspace({uri:xI(r).toString(),name:II(r)}),await s.cli.Workspace.init(),i=new zi(r,s,n?.printErrors??!0),zi.likec4Instances.set(r,i)}return n?.throwIfInvalid===!0&&i.hasErrors()?(i.dispose(),Promise.reject($I(i))):i}modelComputedRef;modelLayoutedRef;logger;get viewsService(){return this.langium.likec4.Views}get LangiumDocuments(){return this.langium.shared.workspace.LangiumDocuments}async diagrams(){return await this.langium.likec4.Views.diagrams()}computedModel(){let e=this.modelComputedRef?.deref();if(!e){const n=this.langium.likec4.ModelBuilder.unsafeSyncBuildModel();if(!n)throw new Error("Failed to build model");const r=this.langium.likec4.ModelBuilder.unsafeSyncBuildComputedModel(n);e=Wb.create(r),this.modelComputedRef=new WeakRef(e)}return e}async layoutedModel(){let e=this.modelLayoutedRef?.deref();if(!e){const n=await this.langium.likec4.ModelBuilder.buildComputedModel();if(!n)throw new Error("Failed to build model");const r=await this.viewsService.diagrams();e=Wb.create({...n,__:"layouted",views:vy(r,yc("id"))}),this.modelLayoutedRef=new WeakRef(e)}return e}getErrors(){return this.LangiumDocuments.all.toArray().flatMap(e=>(e.diagnostics??[]).filter(n=>n.severity===uc.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===uc.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(`
|
|
1855
|
+
`);return a.length>10&&(a.length=10,a.push("...")),a.map((c,u)=>u===0?" "+ft.dim(`Line ${o}: `)+ft.red(c):" ".repeat(10)+ft.red(c))}).join(`
|
|
1856
|
+
`);this.logger.error(`Invalid ${n.uri.fsPath}
|
|
1857
|
+
${i}`)}}return e}async notifyUpdate({changed:e,removed:n}){this.modelLayoutedRef=void 0,this.modelComputedRef=void 0;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?[Wt.file(e)]:[],n?[Wt.file(n)]:[],s),i=!s.isCancellationRequested}),i}catch(i){return this.logger.error(i),!1}}onModelUpdate(e){const n=this.langium.likec4.ModelBuilder.onModelParsed(()=>e());return()=>{n.dispose()}}dispose(){for(const[e,n]of zi.likec4Instances)n===this&&zi.likec4Instances.delete(e)}}export{lC as F,zi as L,pD as N,Qs as T,Ct as Y,to as a,gy as b,je as c,ae as d,tv as e,jT as f,mt as g,nr as h,bt as i,EI as j,Vv as k,hn as l,VH as m,yt as n,vo as o,ft as p,RI as q,Yv as r,hse as s,zT as t,WT as u,gc as v,HH as w,Ye as x,ht as y,Y1 as z};
|