likec4 1.29.1 → 1.30.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/__app__/src/main.js +1 -1
- package/dist/cli/index.mjs +423 -422
- package/dist/index.mjs +1 -1
- package/dist/shared/{likec4.KsxCQmkB.mjs → likec4.bAyyEO3Z.mjs} +36 -36
- package/dist/shared/{likec4.CLg3BMaP.mjs → likec4.wnruN9MH.mjs} +106 -105
- package/dist/vite-plugin/index.mjs +1 -1
- package/package.json +11 -11
|
@@ -1256,23 +1256,23 @@ return this.globFunction?this.globWithOptions(s):this.globWithOptions(s,{dot:!0}
|
|
|
1256
1256
|
void 0;const r=Gz();Object.defineProperty(t,"fdir",{enumerable:!0,get:function(){return r.Builder}}),n(Uz(),t)}(ja)),ja}var Wz=zz();class Hz{constructor(){this.encoding="utf-8"}readFile(e){return _0.promises.readFile(e.fsPath,this.encoding)}async readDirectory(e){return(await _0.promises.readdir(e.fsPath,{withFileTypes:!0})).map(r=>({dirent:r,isFile:r.isFile(),isDirectory:r.isDirectory(),uri:Tt.joinPath(e,r.name)}))}}const xp="DeploymentElement";function Pp(t){return K.isInstance(t,xp)}const yw="\
|
|
1257
1257
|
DeploymentNodeOrElementKind",Np="DeploymentViewRule";function Vz(t){return K.isInstance(t,Np)}const Il="DynamicViewRule";function vw(t){return K.isInstance(t,Il)}const Ua="ElementProperty";function Kz(t){return K.isInstance(t,Ua)}const ww="ExpressionV2";function Zz(t){return K.isInstance(t,ww)}const bw="ExtendElementProperty",Ip="FqnExpr";function BC(t){return K.isInstance(t,Ip)}const Op="FqnExprOrWhere";function qC(t){return K.isInstance(t,Op)}const Lp="FqnExprOrWith";function GC(t){return K.isInstance(
|
|
1258
1258
|
t,Lp)}const Ew="FqnReferenceable",za="LikeC4View";function kw(t){return K.isInstance(t,za)}const Fp="MetadataProperty";function Ps(t){return K.isInstance(t,Fp)}const Rw="ModelReferenceable",zo="Referenceable",Mp="RelationExpr";function jp(t){return K.isInstance(t,Mp)}const Bp="RelationExprOrWhere";function Xz(t){return K.isInstance(t,Bp)}const qp="RelationExprOrWith";function Yz(t){return K.isInstance(t,qp)}const Ol="RelationProperty",Gp="RelationshipStyleProperty";function UC(t){return K.isInstance(
|
|
1259
|
-
t,Gp)}const $w="SizeProperty";function Jz(t){return K.isInstance(t,$w)}const Wo="StringProperty";function zC(t){return K.isInstance(t,Wo)}const Ho="StyleProperty";function Dw(t){return K.isInstance(t,Ho)}const Up="ViewProperty";function Qz(t){return K.isInstance(t,Up)}const Ll="ViewRule";function
|
|
1260
|
-
sion";function
|
|
1261
|
-
function Wa(t){return K.isInstance(t,zl)}const Ha="CustomColor",Kp="CustomElementProperties";function
|
|
1262
|
-
DeploymentNodeKind";function
|
|
1263
|
-
const Zl="DirectedRelationExpr";function
|
|
1259
|
+
t,Gp)}const $w="SizeProperty";function Jz(t){return K.isInstance(t,$w)}const Wo="StringProperty";function zC(t){return K.isInstance(t,Wo)}const Ho="StyleProperty";function Dw(t){return K.isInstance(t,Ho)}const Up="ViewProperty";function Qz(t){return K.isInstance(t,Up)}const Ll="ViewRule";function eW(t){return K.isInstance(t,Ll)}const zp="ViewRuleStyleOrGlobalRef";function Tw(t){return K.isInstance(t,zp)}const Fl="WhereElement";function WC(t){return K.isInstance(t,Fl)}const Ml="WhereElementExpres\
|
|
1260
|
+
sion";function tW(t){return K.isInstance(t,Ml)}const HC="WhereExpression",Wp="WhereKindEqual";function nW(t){return K.isInstance(t,Wp)}const jl="WhereRelation";function VC(t){return K.isInstance(t,jl)}const Bl="WhereRelationExpression";function rW(t){return K.isInstance(t,Bl)}const Hp="WhereTagEqual";function iW(t){return K.isInstance(t,Hp)}const ql="ArrowProperty";function Gl(t){return K.isInstance(t,ql)}const Ul="BorderProperty";function Vp(t){return K.isInstance(t,Ul)}const zl="ColorProperty";
|
|
1261
|
+
function Wa(t){return K.isInstance(t,zl)}const Ha="CustomColor",Kp="CustomElementProperties";function sW(t){return K.isInstance(t,Kp)}const Zp="CustomRelationProperties";function aW(t){return K.isInstance(t,Zp)}const ns="DeployedInstance";function yr(t){return K.isInstance(t,ns)}const Xp="DeployedInstanceBody";function KC(t){return K.isInstance(t,Xp)}const Vr="DeploymentNode";function ar(t){return K.isInstance(t,Vr)}const Yp="DeploymentNodeBody";function ZC(t){return K.isInstance(t,Yp)}const rs="\
|
|
1262
|
+
DeploymentNodeKind";function oW(t){return K.isInstance(t,rs)}const Jp="DeploymentRelation";function Ri(t){return K.isInstance(t,Jp)}const Qp="DeploymentRelationBody";function uW(t){return K.isInstance(t,Qp)}const Wl="DeploymentView";function XC(t){return K.isInstance(t,Wl)}const em="DeploymentViewBody";function Sw(t){return K.isInstance(t,em)}const Hl="DeploymentViewRulePredicate";function Vo(t){return K.isInstance(t,Hl)}const Vl="DeploymentViewRuleStyle";function Kl(t){return K.isInstance(t,Vl)}
|
|
1263
|
+
const Zl="DirectedRelationExpr";function cW(t){return K.isInstance(t,Zl)}const Ko="DynamicView";function YC(t){return K.isInstance(t,Ko)}const tm="DynamicViewBody";function JC(t){return K.isInstance(t,tm)}const Xl="DynamicViewGlobalPredicateRef";function QC(t){return K.isInstance(t,Xl)}const Yl="DynamicViewIncludePredicate";function e_(t){return K.isInstance(t,Yl)}const nm="DynamicViewParallelSteps";function Cw(t){return K.isInstance(t,nm)}const _w="DynamicViewRef",rm="DynamicViewStep";function Aw(t){
|
|
1264
1264
|
return K.isInstance(t,rm)}const vr="Element";function _n(t){return K.isInstance(t,vr)}const im="ElementBody";function sm(t){return K.isInstance(t,im)}const is="ElementKind";function t_(t){return K.isInstance(t,is)}const Jl="ElementKindExpression";function n_(t){return K.isInstance(t,Jl)}const am="ElementRef";function xw(t){return K.isInstance(t,am)}const Ql="ElementStringProperty";function ed(t){return K.isInstance(t,Ql)}const td="ElementStyleProperty";function Zo(t){return K.isInstance(t,td)}const nd="\
|
|
1265
1265
|
ElementTagExpression";function r_(t){return K.isInstance(t,nd)}const Xo="ElementView";function om(t){return K.isInstance(t,Xo)}const um="ElementViewBody";function Pw(t){return K.isInstance(t,um)}const Nw="ElementViewRef",cm="Expressions";function i_(t){return K.isInstance(t,cm)}const rd="ExtendDeployment";function Va(t){return K.isInstance(t,rd)}const lm="ExtendDeploymentBody";function s_(t){return K.isInstance(t,lm)}const Ka="ExtendElement";function Yo(t){return K.isInstance(t,Ka)}const dm="Ext\
|
|
1266
|
-
endElementBody";function Iw(t){return K.isInstance(t,dm)}const fm="FqnExpressions";function
|
|
1267
|
-
return K.isInstance(t,Qo)}const eu="Globals";function Fw(t){return K.isInstance(t,eu)}const mm="GlobalStyle";function tu(t){return K.isInstance(t,mm)}const gm="GlobalStyleGroup";function Za(t){return K.isInstance(t,gm)}const cd="GlobalStyleId",ld="IconProperty";function Ns(t){return K.isInstance(t,ld)}const Is="Imported";function ss(t){return K.isInstance(t,Is)}const ym="ImportsFromPoject";function Mw(t){return K.isInstance(t,ym)}const dd="IncomingRelationExpr";function
|
|
1268
|
-
t,dd)}const fd="InOutRelationExpr";function o_(t){return K.isInstance(t,fd)}const as="LibIcon";function
|
|
1266
|
+
endElementBody";function Iw(t){return K.isInstance(t,dm)}const fm="FqnExpressions";function lW(t){return K.isInstance(t,fm)}const id="FqnExprWhere";function Ow(t){return K.isInstance(t,id)}const sd="FqnExprWith";function hm(t){return K.isInstance(t,sd)}const pm="FqnRef";function a_(t){return K.isInstance(t,pm)}const ad="FqnRefExpr";function Lw(t){return K.isInstance(t,ad)}const Jo="GlobalDynamicPredicateGroup";function od(t){return K.isInstance(t,Jo)}const Qo="GlobalPredicateGroup";function ud(t){
|
|
1267
|
+
return K.isInstance(t,Qo)}const eu="Globals";function Fw(t){return K.isInstance(t,eu)}const mm="GlobalStyle";function tu(t){return K.isInstance(t,mm)}const gm="GlobalStyleGroup";function Za(t){return K.isInstance(t,gm)}const cd="GlobalStyleId",ld="IconProperty";function Ns(t){return K.isInstance(t,ld)}const Is="Imported";function ss(t){return K.isInstance(t,Is)}const ym="ImportsFromPoject";function Mw(t){return K.isInstance(t,ym)}const dd="IncomingRelationExpr";function dW(t){return K.isInstance(
|
|
1268
|
+
t,dd)}const fd="InOutRelationExpr";function o_(t){return K.isInstance(t,fd)}const as="LibIcon";function fW(t){return K.isInstance(t,as)}const vm="LikeC4Grammar";function u_(t){return K.isInstance(t,vm)}const wm="LikeC4Lib";function hW(t){return K.isInstance(t,wm)}const hd="LineProperty";function pd(t){return K.isInstance(t,hd)}const md="LinkProperty";function bm(t){return K.isInstance(t,md)}const gd="MetadataAttribute";function pW(t){return K.isInstance(t,gd)}const yd="MetadataBody";function mW(t){
|
|
1269
1269
|
return K.isInstance(t,yd)}const nu="Model";function c_(t){return K.isInstance(t,nu)}const ru="ModelDeployments";function l_(t){return K.isInstance(t,ru)}const iu="ModelViews";function vd(t){return K.isInstance(t,iu)}const wd="MultipleProperty";function jw(t){return K.isInstance(t,wd)}const Em="NavigateToProperty";function km(t){return K.isInstance(t,Em)}const bd="NotationProperty";function su(t){return K.isInstance(t,bd)}const Ed="NotesProperty";function d_(t){return K.isInstance(t,Ed)}const kd="\
|
|
1270
|
-
OpacityProperty";function Rm(t){return K.isInstance(t,kd)}const Rd="OutgoingRelationExpr";function f_(t){return K.isInstance(t,Rd)}const $d="PaddingSizeProperty";function Bw(t){return K.isInstance(t,$d)}const $m="Relation";function os(t){return K.isInstance(t,$m)}const Dm="RelationBody";function
|
|
1271
|
-
erty";function Cd(t){return K.isInstance(t,Sd)}const Os="RelationshipKind";function
|
|
1270
|
+
OpacityProperty";function Rm(t){return K.isInstance(t,kd)}const Rd="OutgoingRelationExpr";function f_(t){return K.isInstance(t,Rd)}const $d="PaddingSizeProperty";function Bw(t){return K.isInstance(t,$d)}const $m="Relation";function os(t){return K.isInstance(t,$m)}const Dm="RelationBody";function gW(t){return K.isInstance(t,Dm)}const Dd="RelationExprWhere";function qw(t){return K.isInstance(t,Dd)}const Td="RelationExprWith";function Gw(t){return K.isInstance(t,Td)}const Sd="RelationNavigateToProp\
|
|
1271
|
+
erty";function Cd(t){return K.isInstance(t,Sd)}const Os="RelationshipKind";function yW(t){return K.isInstance(t,Os)}const _d="RelationStringProperty";function Ad(t){return K.isInstance(t,_d)}const xd="RelationStyleProperty";function Tm(t){return K.isInstance(t,xd)}const Pd="ShapeProperty";function Sm(t){return K.isInstance(t,Pd)}const Nd="ShapeSizeProperty";function Uw(t){return K.isInstance(t,Nd)}const Cm="SpecificationColor";function _m(t){return K.isInstance(t,Cm)}const au="SpecificationDeplo\
|
|
1272
1272
|
ymentNodeKind";function ou(t){return K.isInstance(t,au)}const uu="SpecificationElementKind";function cu(t){return K.isInstance(t,uu)}const Id="SpecificationElementStringProperty";function zw(t){return K.isInstance(t,Id)}const lu="SpecificationRelationshipKind";function du(t){return K.isInstance(t,lu)}const Od="SpecificationRelationshipStringProperty";function h_(t){return K.isInstance(t,Od)}const fu="SpecificationRule";function p_(t){return K.isInstance(t,fu)}const hu="SpecificationTag";function Am(t){
|
|
1273
1273
|
return K.isInstance(t,hu)}const xm="StrictFqnElementRef";function Ww(t){return K.isInstance(t,xm)}const Pm="StrictFqnRef";function m_(t){return K.isInstance(t,Pm)}const Ls="Tag";function g_(t){return K.isInstance(t,Ls)}const Nm="Tags";function Hw(t){return K.isInstance(t,Nm)}const Ld="TextSizeProperty";function Vw(t){return K.isInstance(t,Ld)}const Kw="ViewRef",Fd="ViewRuleAutoLayout";function Md(t){return K.isInstance(t,Fd)}const jd="ViewRuleGlobalPredicateRef";function Zw(t){return K.isInstance(
|
|
1274
|
-
t,jd)}const Bd="ViewRuleGlobalStyle";function Xw(t){return K.isInstance(t,Bd)}const qd="ViewRuleGroup";function Im(t){return K.isInstance(t,qd)}const Gd="ViewRulePredicate";function Ud(t){return K.isInstance(t,Gd)}const zd="ViewRuleStyle";function pu(t){return K.isInstance(t,zd)}const Wd="ViewStringProperty";function
|
|
1275
|
-
WhereElementNegation";function y_(t){return K.isInstance(t,Kd)}const Zd="WhereElementTag";function
|
|
1274
|
+
t,jd)}const Bd="ViewRuleGlobalStyle";function Xw(t){return K.isInstance(t,Bd)}const qd="ViewRuleGroup";function Im(t){return K.isInstance(t,qd)}const Gd="ViewRulePredicate";function Ud(t){return K.isInstance(t,Gd)}const zd="ViewRuleStyle";function pu(t){return K.isInstance(t,zd)}const Wd="ViewStringProperty";function vW(t){return K.isInstance(t,Wd)}const Hd="WhereBinaryExpression";function wW(t){return K.isInstance(t,Hd)}const Vd="WhereElementKind";function bW(t){return K.isInstance(t,Vd)}const Kd="\
|
|
1275
|
+
WhereElementNegation";function y_(t){return K.isInstance(t,Kd)}const Zd="WhereElementTag";function EW(t){return K.isInstance(t,Zd)}const Xd="WhereRelationKind";function v_(t){return K.isInstance(t,Xd)}const Yd="WhereRelationNegation";function w_(t){return K.isInstance(t,Yd)}const Jd="WhereRelationParticipantKind";function b_(t){return K.isInstance(t,Jd)}const Qd="WhereRelationParticipantTag";function E_(t){return K.isInstance(t,Qd)}const ef="WhereRelationTag";function kW(t){return K.isInstance(t,
|
|
1276
1276
|
ef)}const tf="WildcardExpression";function k_(t){return K.isInstance(t,tf)}class R_ extends AE{getAllTypes(){return[ql,Ul,zl,Ha,Kp,Zp,ns,Xp,xp,Vr,Yp,rs,yw,Jp,Qp,Wl,em,Np,Hl,Vl,Zl,Ko,tm,Xl,Yl,nm,_w,Il,rm,vr,im,is,Jl,Ua,am,Ql,td,nd,Xo,um,Nw,ww,cm,rd,lm,Ka,dm,bw,Ip,Op,Lp,id,sd,fm,pm,ad,Ew,Jo,Qo,mm,gm,cd,eu,ld,Is,ym,fd,dd,as,vm,wm,za,hd,md,gd,yd,Fp,nu,ru,Rw,iu,wd,Em,bd,Ed,kd,Rd,$d,zo,$m,Dm,Mp,Bp,qp,Dd,Td,Sd,Ol,_d,xd,Os,Gp,Pd,Nd,$w,Cm,au,uu,Id,lu,Od,fu,hu,xm,Pm,Wo,Ho,Ls,Nm,Ld,Up,Kw,Ll,Fd,jd,Bd,qd,Gd,
|
|
1277
1277
|
zd,zp,Wd,Hd,Fl,Ml,Vd,Kd,Zd,HC,Wp,jl,Bl,Xd,Yd,Jd,Qd,ef,Hp,tf]}computeIsSubtype(e,n){switch(e){case ql:case hd:return this.isSubtype(Gp,n);case Ul:case wd:case kd:case Pd:return this.isSubtype(Ho,n);case zl:return this.isSubtype(Gp,n)||this.isSubtype(Ho,n);case ns:case Vr:return this.isSubtype(xp,n)||this.isSubtype(zo,n);case rs:case is:return this.isSubtype(yw,n);case Wl:case Ko:case Xo:return this.isSubtype(za,n);case Hl:case Vl:return this.isSubtype(Np,n);case Zl:case dd:case fd:case Rd:return this.
|
|
1278
1278
|
isSubtype(Mp,n);case Xl:case Yl:return this.isSubtype(Il,n);case vr:return this.isSubtype(Ew,n)||this.isSubtype(Rw,n)||this.isSubtype(zo,n);case Jl:case nd:case ad:case tf:return this.isSubtype(Ip,n);case Ql:return this.isSubtype(Ua,n)||this.isSubtype(Wo,n);case td:return this.isSubtype(Ua,n);case rd:case Ka:case zo:return this.isSubtype(Ew,n);case Ip:case id:return this.isSubtype(Op,n);case Op:case sd:return this.isSubtype(Lp,n);case Lp:case qp:return this.isSubtype(ww,n);case ld:return this.isSubtype(
|
|
@@ -1299,7 +1299,7 @@ return{name:Id,properties:[{name:"key"},{name:"value"}]};case lu:return{name:lu,
|
|
|
1299
1299
|
properties:[{name:"el"},{name:"parent"}]};case Pm:return{name:Pm,properties:[{name:"parent"},{name:"value"}]};case Ls:return{name:Ls,properties:[{name:"name"}]};case Nm:return{name:Nm,properties:[{name:"prev"},{name:"values",defaultValue:[]}]};case Ld:return{name:Ld,properties:[{name:"key"},{name:"value"}]};case Kw:return{name:Kw,properties:[{name:"view"}]};case Fd:return{name:Fd,properties:[{name:"direction"},{name:"nodeSep"},{name:"rankSep"}]};case jd:return{name:jd,properties:[{name:"predicat\
|
|
1300
1300
|
e"}]};case Bd:return{name:Bd,properties:[{name:"style"}]};case qd:return{name:qd,properties:[{name:"groupRules",defaultValue:[]},{name:"props",defaultValue:[]},{name:"title"}]};case Gd:return{name:Gd,properties:[{name:"exprs"},{name:"isInclude",defaultValue:!1}]};case zd:return{name:zd,properties:[{name:"props",defaultValue:[]},{name:"targets"}]};case Wd:return{name:Wd,properties:[{name:"key"},{name:"value"}]};case Hd:return{name:Hd,properties:[{name:"left"},{name:"operator"},{name:"right"}]};case Vd:
|
|
1301
1301
|
return{name:Vd,properties:[{name:"not",defaultValue:!1},{name:"operator"},{name:"value"}]};case Kd:return{name:Kd,properties:[{name:"value"}]};case Zd:return{name:Zd,properties:[{name:"not",defaultValue:!1},{name:"operator"},{name:"value"}]};case Xd:return{name:Xd,properties:[{name:"not",defaultValue:!1},{name:"operator"},{name:"value"}]};case Yd:return{name:Yd,properties:[{name:"value"}]};case Jd:return{name:Jd,properties:[{name:"not",defaultValue:!1},{name:"operator"},{name:"participant"},{name:"\
|
|
1302
|
-
value"}]};case Qd:return{name:Qd,properties:[{name:"not",defaultValue:!1},{name:"operator"},{name:"participant"},{name:"value"}]};case ef:return{name:ef,properties:[{name:"not",defaultValue:!1},{name:"operator"},{name:"value"}]};case tf:return{name:tf,properties:[{name:"isWildcard",defaultValue:!1}]};default:return{name:e,properties:[]}}}}const K=new R_;let $_;const
|
|
1302
|
+
value"}]};case Qd:return{name:Qd,properties:[{name:"not",defaultValue:!1},{name:"operator"},{name:"participant"},{name:"value"}]};case ef:return{name:ef,properties:[{name:"not",defaultValue:!1},{name:"operator"},{name:"value"}]};case tf:return{name:tf,properties:[{name:"isWildcard",defaultValue:!1}]};default:return{name:e,properties:[]}}}}const K=new R_;let $_;const RW=()=>$_??($_=VG(`{"$type":"Grammar","isDeclared":true,"name":"LikeC4","rules":[{"$type":"ParserRule","entry":true,"name":"LikeC4G\
|
|
1303
1303
|
rammar","definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"imports","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Assignment","feature":"specifications","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}},{"$type":"Assignment","feature":"models","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]}},{"$type":"Assignment","feature":"\
|
|
1304
1304
|
views","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}},{"$type":"Assignment","feature":"globals","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@110"},"arguments":[]}},{"$type":"Assignment","feature":"deployments","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@96"},"arguments":[]}},{"$type":"Assignment","feature":"likec4lib","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"argum\
|
|
1305
1305
|
ents":[]}}],"cardinality":"*"},"definesHiddenTokens":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"LikeC4Lib","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"likec4lib"},{"$type":"Keyword","value":"{"},{"$type":"Keyword","value":"icons"},{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"icons","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]},"cardinality":"+"}\
|
|
@@ -1503,7 +1503,7 @@ $type":"Type","name":"StringProperty","type":{"$type":"UnionType","types":[{"$ty
|
|
|
1503
1503
|
type":"SimpleType","typeRef":{"$ref":"#/rules@95/definition/elements@2/elements@0/inferredType"}}]}},{"$type":"Type","name":"WhereKindEqual","type":{"$type":"UnionType","types":[{"$type":"SimpleType","typeRef":{"$ref":"#/rules@89/definition/elements@1/elements@0/inferredType"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@95/definition/elements@1/elements@0/inferredType"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@95/definition/elements@3/elements@0/inferredType"}}]}},{"$type":"Type",\
|
|
1504
1504
|
"name":"WhereExpression","type":{"$type":"UnionType","types":[{"$type":"SimpleType","typeRef":{"$ref":"#/rules@84"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@90"}}]}},{"$type":"Type","name":"DeploymentElement","type":{"$type":"UnionType","types":[{"$type":"SimpleType","typeRef":{"$ref":"#/rules@97"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@99"}}]}},{"$type":"Type","name":"FqnReferenceable","type":{"$type":"UnionType","types":[{"$type":"SimpleType","typeRef":{"$ref":"#/types@1"}}\
|
|
1505
1505
|
,{"$type":"SimpleType","typeRef":{"$ref":"#/rules@20"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@24"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@101"}}]}},{"$type":"Type","name":"SizeProperty","type":{"$type":"UnionType","types":[{"$type":"SimpleType","typeRef":{"$ref":"#/rules@125"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@126"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@127"}}]}}],"definesHiddenTokens":false,"hiddenTokens":[],"imports":[],"interfaces":[],"usedGra\
|
|
1506
|
-
mmars":[]}`)),Yw={languageId:"likec4",fileExtensions:[".c4",".likec4",".like-c4"],caseInsensitive:!1,mode:"production"},$
|
|
1506
|
+
mmars":[]}`)),Yw={languageId:"likec4",fileExtensions:[".c4",".likec4",".like-c4"],caseInsensitive:!1,mode:"production"},$W={skipValidations:!0,recoveryEnabled:!0,nodeLocationTracking:"full"},DW={AstReflection:()=>new R_},TW={Grammar:()=>RW(),LanguageMetaData:()=>Yw,parser:{ParserConfig:()=>$W}},SW=[...Object.entries({aws:["activate","alexa-for-business","amplify","apache-mxnet-on-aws","api-gateway","app-config","app-flow","app-mesh","app-runner","app-stream","app-sync","application-auto-scaling",
|
|
1507
1507
|
"application-composer","application-cost-profiler","application-discovery-service","application-migration-service","artifact","athena","audit-manager","augmented-ai-a2i","aurora","auto-scaling","backint-agent","backup","batch","billing-conductor","bottlerocket","braket","budgets","certificate-manager","chatbot","chime","chime-sdk","chime-voice-connector","clean-rooms","client-vpn","cloud-control-api","cloud-development-kit","cloud-directory","cloud-formation","cloud-front","cloud-hsm","cloud-map",
|
|
1508
1508
|
"cloud-search","cloud-shell","cloud-trail","cloud-wan","cloud-watch","cloud9","code-artifact","code-build","code-catalyst","code-commit","code-deploy","code-guru","code-pipeline","code-star","code-whisperer","cognito","command-line-interface","comprehend","comprehend-medical","compute-optimizer","config","connect","console-mobile-application","control-tower","corretto","cost-and-usage-report","cost-explorer","data-exchange","data-pipeline","data-sync","data-zone","database-migration-service","de\
|
|
1509
1509
|
ep-composer","deep-learning-amis","deep-learning-containers","deep-lens","deep-racer","detective","dev-ops-guru","device-farm","direct-connect","directory-service","distro-for-open-telemetry","document-db","dynamo-db","ec2","ec2-auto-scaling","ec2-image-builder","ecs-anywhere","efs","eks-anywhere","eks-cloud","eks-distro","elasti-cache","elastic-beanstalk","elastic-block-store","elastic-container-registry","elastic-container-service","elastic-disaster-recovery","elastic-fabric-adapter","elastic-\
|
|
@@ -1554,17 +1554,17 @@ tlin","krakenjs","ktor","kubernetes","labview","laravel","latex","less-js","link
|
|
|
1554
1554
|
"npm","nuget","num-py","nuxt-js","objective-c","ocaml","oh-my-zsh","okta","open-al","open-api","open-cl","open-cv","open-gl","open-stack","open-suse","open-telemetry","opera","oracle","p5js","packer","pandas","perl","pf-sense","phalcon","phoenix-framework","photon-engine","php","php-storm","playwrite","ploty","podman","polygon","portainer","postcss","postgresql","postman","powershell","processing","prometheus","protractor","purescript","putty","pycharm","pyscript","pytest","python","python-poetr\
|
|
1555
1555
|
y","pytorch","qodana","qt","quarkus","quasar","qwik","r","rabbitmq","rancher","raspberrypi","reach","react","react-bootstrap","realm","red-cube-s-epic-compiler-thingy-programming-re-ct","redhat","redis","redux","ren-py","rider","robot-operating-system-ros","rocksdb","rollup-js","rspec","rstudio","ruby","ruby-mine","ruby-on-rails","rust","salesforce","sanity","sass","scala","scalingo","sdl","selenium","sema-software","sequelize","shopware","sketch","slack","socket-io","solid-js","solidity","sonar\
|
|
1556
1556
|
qube","sourcetree","spark","splunk","spring","sql-developer","sqlalchemy","sqlite","ssh","stackoverflow","stata","storybook","streamlit","stylus","subversion","svelte","swagger","swift","symfony","tailwind-css","tauri","tensorflow","terraform","tex","the-algorithms","three-js","titanium-sdk","tomcat","tortoise-git","tower","traefik-mesh","traefik-proxy","travis-ci","trello","twitter","typescript","typo3","ubuntu","uml","unity","unix","unreal-engine","uwsgi","v8","vagrant","vala","vercel","veutif\
|
|
1557
|
-
y","vim","visualstudio","vite","vitejs","vscode","vsphere","vue","vue-storefront","vyper","webassembly","webflow","weblate","webpack","webstorm","windows8","windows11","woo-commerce","wordpress","xamarin","xcode","xml","yaml","yarn","yii-framework","yuno-host","zend-framework","zig"]})].flatMap(([t,e])=>e.map(n=>t+":"+n)),D_=["likec4lib {"," icons {",...
|
|
1558
|
-
`),T_="likec4builtin",
|
|
1559
|
-
e.strict?
|
|
1560
|
-
t==="/"}function
|
|
1561
|
-
return i>=0?n[0]?.startsWith("/")&&!s.startsWith("/")?s="/"+s:n[0]?.startsWith("./")&&!s.startsWith("./")&&(s="./"+s):s="../".repeat(-1*i)+s,n[n.length-1]?.endsWith("/")&&!s.endsWith("/")&&(s+="/"),s}function N_(t){return eb(t,"")}function eb(t,e){let n=t.match(__);return n||(n=t.match(/^\/{2,}/)),n?e+t.slice(n[0].length):e+t}const
|
|
1562
|
-
toLowerCase(),pathname:d,href:f+d,auth:"",host:"",search:"",hash:""}}if(!Fs(t,{acceptRelative:!0}))return mu(t);const[,r="",i,s=""]=t.replace(/\\/g,"/").match(/^[\s\0]*([\w+.-]{2,}:)?\/\/([^/@]+@)?(.*)/)||[];let[,a="",o=""]=s.match(/([^#/?]*)(.*)?/)||[];r==="file:"&&(o=o.replace(/\/(?=[A-Za-z]:)/,""));const{pathname:u,search:c,hash:l}=mu(o);return{protocol:r.toLowerCase(),auth:i?i.slice(0,Math.max(0,i.length-1)):"",host:a,pathname:u,search:c,hash:l,[
|
|
1563
|
-
match(/([^#?]*)(\?[^#]*)?(#.*)?/)||[]).splice(1);return{pathname:e,search:n,hash:r}}const
|
|
1564
|
-
|
|
1565
|
-
tb={Space_Separator:
|
|
1566
|
-
"string"&&/[0-9A-Fa-f]/.test(t)}};let nb,Vn,us,Lm,Ms,Kr,pn,rb,af;var
|
|
1567
|
-
for(const i in r){const s=ib(r,i,n);s===void 0?delete r[i]:Object.defineProperty(r,i,{value:s,writable:!0,enumerable:!0,configurable:!0})}return n.call(t,e,r)}let We,Me,of,cs,tt;function
|
|
1557
|
+
y","vim","visualstudio","vite","vitejs","vscode","vsphere","vue","vue-storefront","vyper","webassembly","webflow","weblate","webpack","webstorm","windows8","windows11","woo-commerce","wordpress","xamarin","xcode","xml","yaml","yarn","yii-framework","yuno-host","zend-framework","zig"]})].flatMap(([t,e])=>e.map(n=>t+":"+n)),D_=["likec4lib {"," icons {",...SW.map(t=>" "+t)," }","}"].join(`
|
|
1558
|
+
`),T_="likec4builtin",CW=`${T_}:///likec4/lib/icons.c4`;function nf(t){return t.scheme===T_}const lt=Fn.getChild("server");function rf(t){lt.error(Jn(t))}function Ae(t){lt.warn(Jn(t))}var Jw,S_;function _W(){return S_||(S_=1,Jw=IC()),Jw}var AW=_W();const C_=fi(AW),xW=/^[\s\w\0+.-]{2,}:([/\\]{1,2})/,__=/^[\s\w\0+.-]{2,}:([/\\]{2})?/,PW=/^([/\\]\s*){2,}[^/\\]/,NW=/^\.?\//;function Qw(t){return["./","../"].some(e=>t.startsWith(e))}function Fs(t,e={}){return typeof e=="boolean"&&(e={acceptRelative:e}),
|
|
1559
|
+
e.strict?xW.test(t):__.test(t)||(e.acceptRelative?PW.test(t):!1)}function IW(t="",e){return t.endsWith("/")}function OW(t="",e){return(IW(t)?t.slice(0,-1):t)||"/"}function A_(t="",e){return t.endsWith("/")?t:t+"/"}function sf(t=""){return t.startsWith("/")}function x_(t=""){return(sf(t)?t.slice(1):t)||"/"}function LW(t=""){return sf(t)?t:"/"+t}function FW(t,e){if(MW(e))return t;const n=OW(e);if(!t.startsWith(n))return t;const r=t.slice(n.length);return r[0]==="/"?r:"/"+r}function MW(t){return!t||
|
|
1560
|
+
t==="/"}function jW(t){return t&&t!=="/"}function P_(t,...e){let n=t||"";for(const r of e.filter(i=>jW(i)))if(n){const i=r.replace(NW,"");n=A_(n)+i}else n=r;return n}function Om(...t){const e=/\/(?!\/)/,n=t.filter(Boolean),r=[];let i=0;for(const a of n)if(!(!a||a==="/")){for(const[o,u]of a.split(e).entries())if(!(!u||u===".")){if(u===".."){if(r.length===1&&Fs(r[0]))continue;r.pop(),i--;continue}if(o===1&&r[r.length-1]?.endsWith(":/")){r[r.length-1]+="/"+u;continue}r.push(u),i++}}let s=r.join("/");
|
|
1561
|
+
return i>=0?n[0]?.startsWith("/")&&!s.startsWith("/")?s="/"+s:n[0]?.startsWith("./")&&!s.startsWith("./")&&(s="./"+s):s="../".repeat(-1*i)+s,n[n.length-1]?.endsWith("/")&&!s.endsWith("/")&&(s+="/"),s}function N_(t){return eb(t,"")}function eb(t,e){let n=t.match(__);return n||(n=t.match(/^\/{2,}/)),n?e+t.slice(n[0].length):e+t}const BW=Symbol.for("ufo:protocolRelative");function qW(t="",e){const n=t.match(/^[\s\0]*(blob:|data:|javascript:|vbscript:)(.*)/i);if(n){const[,f,d=""]=n;return{protocol:f.
|
|
1562
|
+
toLowerCase(),pathname:d,href:f+d,auth:"",host:"",search:"",hash:""}}if(!Fs(t,{acceptRelative:!0}))return mu(t);const[,r="",i,s=""]=t.replace(/\\/g,"/").match(/^[\s\0]*([\w+.-]{2,}:)?\/\/([^/@]+@)?(.*)/)||[];let[,a="",o=""]=s.match(/([^#/?]*)(.*)?/)||[];r==="file:"&&(o=o.replace(/\/(?=[A-Za-z]:)/,""));const{pathname:u,search:c,hash:l}=mu(o);return{protocol:r.toLowerCase(),auth:i?i.slice(0,Math.max(0,i.length-1)):"",host:a,pathname:u,search:c,hash:l,[BW]:!r}}function mu(t=""){const[e="",n="",r=""]=(t.
|
|
1563
|
+
match(/([^#?]*)(\?[^#]*)?(#.*)?/)||[]).splice(1);return{pathname:e,search:n,hash:r}}const GW=/\/([^/]+)$/;function UW(t="",e){const{pathname:n}=qW(t),r=n.match(GW);return r?r[1]:void 0}var zW=/[\u1680\u2000-\u200A\u202F\u205F\u3000]/,WW=/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]/,
|
|
1564
|
+
HW=/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09FC\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF9\u1D00-\u1DF9\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDE00-\uDE3E\uDE47\uDE50-\uDE83\uDE86-\uDE99\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4A\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/,
|
|
1565
|
+
tb={Space_Separator:zW,ID_Start:WW,ID_Continue:HW},Yt={isSpaceSeparator(t){return typeof t=="string"&&tb.Space_Separator.test(t)},isIdStartChar(t){return typeof t=="string"&&(t>="a"&&t<="z"||t>="A"&&t<="Z"||t==="$"||t==="_"||tb.ID_Start.test(t))},isIdContinueChar(t){return typeof t=="string"&&(t>="a"&&t<="z"||t>="A"&&t<="Z"||t>="0"&&t<="9"||t==="$"||t==="_"||t==="\u200C"||t==="\u200D"||tb.ID_Continue.test(t))},isDigit(t){return typeof t=="string"&&/[0-9]/.test(t)},isHexDigit(t){return typeof t==
|
|
1566
|
+
"string"&&/[0-9A-Fa-f]/.test(t)}};let nb,Vn,us,Lm,Ms,Kr,pn,rb,af;var VW=function(e,n){nb=String(e),Vn="start",us=[],Lm=0,Ms=1,Kr=0,pn=void 0,rb=void 0,af=void 0;do pn=KW(),YW[Vn]();while(pn.type!=="eof");return typeof n=="function"?ib({"":af},"",n):af};function ib(t,e,n){const r=t[e];if(r!=null&&typeof r=="object")if(Array.isArray(r))for(let i=0;i<r.length;i++){const s=String(i),a=ib(r,s,n);a===void 0?delete r[s]:Object.defineProperty(r,s,{value:a,writable:!0,enumerable:!0,configurable:!0})}else
|
|
1567
|
+
for(const i in r){const s=ib(r,i,n);s===void 0?delete r[i]:Object.defineProperty(r,i,{value:s,writable:!0,enumerable:!0,configurable:!0})}return n.call(t,e,r)}let We,Me,of,cs,tt;function KW(){for(We="default",Me="",of=!1,cs=1;;){tt=ls();const t=I_[We]();if(t)return t}}function ls(){if(nb[Lm])return String.fromCodePoint(nb.codePointAt(Lm))}function ee(){const t=ls();return t===`
|
|
1568
1568
|
`?(Ms++,Kr=0):t?Kr+=t.length:Kr++,t&&(Lm+=t.length),t}const I_={default(){switch(tt){case" ":case"\v":case"\f":case" ":case"\xA0":case"\uFEFF":case`
|
|
1569
1569
|
`:case"\r":case"\u2028":case"\u2029":ee();return;case"/":ee(),We="comment";return;case void 0:return ee(),It("eof")}if(Yt.isSpaceSeparator(tt)){ee();return}return I_[Vn]()},comment(){switch(tt){case"*":ee(),We="multiLineComment";return;case"/":ee(),We="singleLineComment";return}throw Ot(ee())},multiLineComment(){switch(tt){case"*":ee(),We="multiLineCommentAsterisk";return;case void 0:throw Ot(ee())}ee()},multiLineCommentAsterisk(){switch(tt){case"*":ee();return;case"/":ee(),We="default";return;case void 0:
|
|
1570
1570
|
throw Ot(ee())}ee(),We="multiLineComment"},singleLineComment(){switch(tt){case`
|
|
@@ -1574,18 +1574,18 @@ throw Ot(ee())}ee(),We="multiLineComment"},singleLineComment(){switch(tt){case`
|
|
|
1574
1574
|
eger";return;case"I":return ee(),Xa("nfinity"),It("numeric",cs*(1/0));case"N":return ee(),Xa("aN"),It("numeric",NaN)}throw Ot(ee())},zero(){switch(tt){case".":Me+=ee(),We="decimalPoint";return;case"e":case"E":Me+=ee(),We="decimalExponent";return;case"x":case"X":Me+=ee(),We="hexadecimal";return}return It("numeric",cs*0)},decimalInteger(){switch(tt){case".":Me+=ee(),We="decimalPoint";return;case"e":case"E":Me+=ee(),We="decimalExponent";return}if(Yt.isDigit(tt)){Me+=ee();return}return It("numeric",
|
|
1575
1575
|
cs*Number(Me))},decimalPointLeading(){if(Yt.isDigit(tt)){Me+=ee(),We="decimalFraction";return}throw Ot(ee())},decimalPoint(){switch(tt){case"e":case"E":Me+=ee(),We="decimalExponent";return}if(Yt.isDigit(tt)){Me+=ee(),We="decimalFraction";return}return It("numeric",cs*Number(Me))},decimalFraction(){switch(tt){case"e":case"E":Me+=ee(),We="decimalExponent";return}if(Yt.isDigit(tt)){Me+=ee();return}return It("numeric",cs*Number(Me))},decimalExponent(){switch(tt){case"+":case"-":Me+=ee(),We="decimalE\
|
|
1576
1576
|
xponentSign";return}if(Yt.isDigit(tt)){Me+=ee(),We="decimalExponentInteger";return}throw Ot(ee())},decimalExponentSign(){if(Yt.isDigit(tt)){Me+=ee(),We="decimalExponentInteger";return}throw Ot(ee())},decimalExponentInteger(){if(Yt.isDigit(tt)){Me+=ee();return}return It("numeric",cs*Number(Me))},hexadecimal(){if(Yt.isHexDigit(tt)){Me+=ee(),We="hexadecimalInteger";return}throw Ot(ee())},hexadecimalInteger(){if(Yt.isHexDigit(tt)){Me+=ee();return}return It("numeric",cs*Number(Me))},string(){switch(tt){case"\
|
|
1577
|
-
\\":ee(),Me+=
|
|
1578
|
-
`:case"\r":throw Ot(ee());case"\u2028":case"\u2029":
|
|
1579
|
-
":")return It("punctuator",ee());throw Ot(ee())},beforePropertyValue(){We="value"},afterPropertyValue(){switch(tt){case",":case"}":return It("punctuator",ee())}throw Ot(ee())},beforeArrayValue(){if(tt==="]")return It("punctuator",ee());We="value"},afterArrayValue(){switch(tt){case",":case"]":return It("punctuator",ee())}throw Ot(ee())},end(){throw Ot(ee())}};function It(t,e){return{type:t,value:e,line:Ms,column:Kr}}function Xa(t){for(const e of t){if(ls()!==e)throw Ot(ee());ee()}}function
|
|
1577
|
+
\\":ee(),Me+=ZW();return;case'"':if(of)return ee(),It("string",Me);Me+=ee();return;case"'":if(!of)return ee(),It("string",Me);Me+=ee();return;case`
|
|
1578
|
+
`:case"\r":throw Ot(ee());case"\u2028":case"\u2029":JW(tt);break;case void 0:throw Ot(ee())}Me+=ee()},start(){switch(tt){case"{":case"[":return It("punctuator",ee())}We="value"},beforePropertyName(){switch(tt){case"$":case"_":Me=ee(),We="identifierName";return;case"\\":ee(),We="identifierNameStartEscape";return;case"}":return It("punctuator",ee());case'"':case"'":of=ee()==='"',We="string";return}if(Yt.isIdStartChar(tt)){Me+=ee(),We="identifierName";return}throw Ot(ee())},afterPropertyName(){if(tt===
|
|
1579
|
+
":")return It("punctuator",ee());throw Ot(ee())},beforePropertyValue(){We="value"},afterPropertyValue(){switch(tt){case",":case"}":return It("punctuator",ee())}throw Ot(ee())},beforeArrayValue(){if(tt==="]")return It("punctuator",ee());We="value"},afterArrayValue(){switch(tt){case",":case"]":return It("punctuator",ee())}throw Ot(ee())},end(){throw Ot(ee())}};function It(t,e){return{type:t,value:e,line:Ms,column:Kr}}function Xa(t){for(const e of t){if(ls()!==e)throw Ot(ee());ee()}}function ZW(){switch(ls()){case"\
|
|
1580
1580
|
b":return ee(),"\b";case"f":return ee(),"\f";case"n":return ee(),`
|
|
1581
|
-
`;case"r":return ee(),"\r";case"t":return ee()," ";case"v":return ee(),"\v";case"0":if(ee(),Yt.isDigit(ls()))throw Ot(ee());return"\0";case"x":return ee(),
|
|
1581
|
+
`;case"r":return ee(),"\r";case"t":return ee()," ";case"v":return ee(),"\v";case"0":if(ee(),Yt.isDigit(ls()))throw Ot(ee());return"\0";case"x":return ee(),XW();case"u":return ee(),sb();case`
|
|
1582
1582
|
`:case"\u2028":case"\u2029":return ee(),"";case"\r":return ee(),ls()===`
|
|
1583
|
-
`&&ee(),"";case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":throw Ot(ee());case void 0:throw Ot(ee())}return ee()}function
|
|
1583
|
+
`&&ee(),"";case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":throw Ot(ee());case void 0:throw Ot(ee())}return ee()}function XW(){let t="",e=ls();if(!Yt.isHexDigit(e)||(t+=ee(),e=ls(),!Yt.isHexDigit(e)))throw Ot(ee());return t+=ee(),String.fromCodePoint(parseInt(t,16))}function sb(){let t="",e=4;for(;e-- >0;){const n=ls();if(!Yt.isHexDigit(n))throw Ot(ee());t+=ee()}return String.fromCodePoint(parseInt(t,16))}const YW={start(){if(pn.type==="eof")throw Ya();ab()},beforePropertyName(){
|
|
1584
1584
|
switch(pn.type){case"identifier":case"string":rb=pn.value,Vn="afterPropertyName";return;case"punctuator":Fm();return;case"eof":throw Ya()}},afterPropertyName(){if(pn.type==="eof")throw Ya();Vn="beforePropertyValue"},beforePropertyValue(){if(pn.type==="eof")throw Ya();ab()},beforeArrayValue(){if(pn.type==="eof")throw Ya();if(pn.type==="punctuator"&&pn.value==="]"){Fm();return}ab()},afterPropertyValue(){if(pn.type==="eof")throw Ya();switch(pn.value){case",":Vn="beforePropertyName";return;case"}":Fm()}},
|
|
1585
1585
|
afterArrayValue(){if(pn.type==="eof")throw Ya();switch(pn.value){case",":Vn="beforeArrayValue";return;case"]":Fm()}},end(){}};function ab(){let t;switch(pn.type){case"punctuator":switch(pn.value){case"{":t={};break;case"[":t=[];break}break;case"null":case"boolean":case"numeric":case"string":t=pn.value;break}if(af===void 0)af=t;else{const e=us[us.length-1];Array.isArray(e)?e.push(t):Object.defineProperty(e,rb,{value:t,writable:!0,enumerable:!0,configurable:!0})}if(t!==null&&typeof t=="object")us.
|
|
1586
1586
|
push(t),Array.isArray(t)?Vn="beforeArrayValue":Vn="beforePropertyName";else{const e=us[us.length-1];e==null?Vn="end":Array.isArray(e)?Vn="afterArrayValue":Vn="afterPropertyValue"}}function Fm(){us.pop();const t=us[us.length-1];t==null?Vn="end":Array.isArray(t)?Vn="afterArrayValue":Vn="afterPropertyValue"}function Ot(t){return Mm(t===void 0?`JSON5: invalid end of input at ${Ms}:${Kr}`:`JSON5: invalid character '${L_(t)}' at ${Ms}:${Kr}`)}function Ya(){return Mm(`JSON5: invalid end of input at ${Ms}\
|
|
1587
|
-
:${Kr}`)}function O_(){return Kr-=5,Mm(`JSON5: invalid identifier character at ${Ms}:${Kr}`)}function
|
|
1588
|
-
t);return e.lineNumber=Ms,e.columnNumber=Kr,e}var
|
|
1587
|
+
:${Kr}`)}function O_(){return Kr-=5,Mm(`JSON5: invalid identifier character at ${Ms}:${Kr}`)}function JW(t){console.warn(`JSON5: '${L_(t)}' in strings is not valid ECMAScript; consider escaping`)}function L_(t){const e={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};if(e[t])return e[t];if(t<" "){const n=t.charCodeAt(0).toString(16);return"\\x"+("00"+n).substring(n.length)}return t}function Mm(t){const e=new SyntaxError(
|
|
1588
|
+
t);return e.lineNumber=Ms,e.columnNumber=Kr,e}var QW=function(e,n,r){const i=[];let s="",a,o,u="",c;if(n!=null&&typeof n=="object"&&!Array.isArray(n)&&(r=n.space,c=n.quote,n=n.replacer),typeof n=="function")o=n;else if(Array.isArray(n)){a=[];for(const w of n){let v;typeof w=="string"?v=w:(typeof w=="number"||w instanceof String||w instanceof Number)&&(v=String(w)),v!==void 0&&a.indexOf(v)<0&&a.push(v)}}return r instanceof Number?r=Number(r):r instanceof String&&(r=String(r)),typeof r=="number"?r>
|
|
1589
1589
|
0&&(r=Math.min(10,Math.floor(r)),u=" ".substr(0,r)):typeof r=="string"&&(u=r.substr(0,10)),l("",{"":e});function l(w,v){let g=v[w];switch(g!=null&&(typeof g.toJSON5=="function"?g=g.toJSON5(w):typeof g.toJSON=="function"&&(g=g.toJSON(w))),o&&(g=o.call(v,w,g)),g instanceof Number?g=Number(g):g instanceof String?g=String(g):g instanceof Boolean&&(g=g.valueOf()),g){case null:return"null";case!0:return"true";case!1:return"false"}if(typeof g=="string")return f(g);if(typeof g=="number")return String(
|
|
1590
1590
|
g);if(typeof g=="object")return Array.isArray(g)?p(g):d(g)}function f(w){const v={"'":.1,'"':.2},g={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};let b="";for(let _=0;_<w.length;_++){const I=w[_];switch(I){case"'":case'"':v[I]++,b+=I;continue;case"\0":if(Yt.isDigit(w[_+1])){b+="\\x00";continue}}if(g[I]){b+=g[I];continue}if(I<" "){let Z=I.charCodeAt(0).toString(16);b+="\\x"+("00"+Z).substring(Z.length);
|
|
1591
1591
|
continue}b+=I}const k=c||Object.keys(v).reduce((_,I)=>v[_]<v[I]?_:I);return b=b.replace(new RegExp(k,"g"),g[k]),k+b+k}function d(w){if(i.indexOf(w)>=0)throw TypeError("Converting circular structure to JSON5");i.push(w);let v=s;s=s+u;let g=a||Object.keys(w),b=[];for(const _ of g){const I=l(_,w);if(I!==void 0){let Z=h(_)+":";u!==""&&(Z+=" "),Z+=I,b.push(Z)}}let k;if(b.length===0)k="{}";else{let _;if(u==="")_=b.join(","),k="{"+_+"}";else{let I=`,
|
|
@@ -1595,26 +1595,26 @@ continue}b+=I}const k=c||Object.keys(v).reduce((_,I)=>v[_]<v[I]?_:I);return b=b.
|
|
|
1595
1595
|
"[]";else if(u==="")b="["+g.join(",")+"]";else{let k=`,
|
|
1596
1596
|
`+s,_=g.join(k);b=`[
|
|
1597
1597
|
`+s+_+`,
|
|
1598
|
-
`+v+"]"}return i.pop(),s=v,b}};const
|
|
1599
|
-
ion"?(t&&Object.getPrototypeOf(t)?.constructor?.name)??"null":e}function uf(t,e,n,r,i){const s=i&&"input"in i?i.input:n.value,a=i?.expected??t.expects??null,o=i?.received??
|
|
1600
|
-
u.lang):null)??r.message??
|
|
1601
|
-
expects:"!0",message:t,"~run"(e,n){return e.typed&&e.value.length===0&&uf(this,"length",e,n,{received:"0"}),e}}}function
|
|
1598
|
+
`+v+"]"}return i.pop(),s=v,b}};const e9={parse:VW,stringify:QW};var F_=e9,ob;function M_(t){return{lang:t?.lang??ob?.lang,message:t?.message,abortEarly:t?.abortEarly??ob?.abortEarly,abortPipeEarly:t?.abortPipeEarly??ob?.abortPipeEarly}}var t9;function n9(t){return t9?.get(t)}var r9;function i9(t){return r9?.get(t)}var s9;function a9(t,e){return s9?.get(t)?.get(e)}function o9(t){const e=typeof t;return e==="string"?`"${t}"`:e==="number"||e==="bigint"||e==="boolean"?`${t}`:e==="object"||e==="funct\
|
|
1599
|
+
ion"?(t&&Object.getPrototypeOf(t)?.constructor?.name)??"null":e}function uf(t,e,n,r,i){const s=i&&"input"in i?i.input:n.value,a=i?.expected??t.expects??null,o=i?.received??o9(s),u={kind:t.kind,type:t.type,input:s,expected:a,received:o,message:`Invalid ${e}: ${a?`Expected ${a} but r`:"R"}eceived ${o}`,requirement:t.requirement,path:i?.path,issues:i?.issues,lang:r.lang,abortEarly:r.abortEarly,abortPipeEarly:r.abortPipeEarly},c=t.kind==="schema",l=i?.message??t.message??a9(t.reference,u.lang)??(c?i9(
|
|
1600
|
+
u.lang):null)??r.message??n9(u.lang);l!==void 0&&(u.message=typeof l=="function"?l(u):l),c&&(n.typed=!1),n.issues?n.issues.push(u):n.issues=[u]}function cf(t){return{version:1,vendor:"valibot",validate(e){return t["~run"]({value:e},M_())}}}var u9=class extends Error{constructor(t){super(t[0].message),this.name="ValiError",this.issues=t}};function jm(t){return{kind:"metadata",type:"description",reference:jm,description:t}}function j_(t){return{kind:"validation",type:"non_empty",reference:j_,async:!1,
|
|
1601
|
+
expects:"!0",message:t,"~run"(e,n){return e.typed&&e.value.length===0&&uf(this,"length",e,n,{received:"0"}),e}}}function c9(t,e,n){return typeof t.fallback=="function"?t.fallback(e,n):t.fallback}function B_(t,e,n){return typeof t.default=="function"?t.default(e,n):t.default}function q_(t,e){return{kind:"schema",type:"array",reference:q_,expects:"Array",async:!1,item:t,message:e,get"~standard"(){return cf(this)},"~run"(n,r){const i=n.value;if(Array.isArray(i)){n.typed=!0,n.value=[];for(let s=0;s<
|
|
1602
1602
|
i.length;s++){const a=i[s],o=this.item["~run"]({value:a},r);if(o.issues){const u={type:"array",origin:"value",input:i,key:s,value:a};for(const c of o.issues)c.path?c.path.unshift(u):c.path=[u],n.issues?.push(c);if(n.issues||(n.issues=o.issues),r.abortEarly){n.typed=!1;break}}o.typed||(n.typed=!1),n.value.push(o.value)}}else uf(this,"type",n,r);return n}}}function G_(t,e){return{kind:"schema",type:"object",reference:G_,expects:"Object",async:!1,entries:t,message:e,get"~standard"(){return cf(this)},
|
|
1603
1603
|
"~run"(n,r){const i=n.value;if(i&&typeof i=="object"){n.typed=!0,n.value={};for(const s in this.entries){const a=this.entries[s];if(s in i||(a.type==="exact_optional"||a.type==="optional"||a.type==="nullish")&&a.default!==void 0){const o=s in i?i[s]:B_(a),u=a["~run"]({value:o},r);if(u.issues){const c={type:"object",origin:"value",input:i,key:s,value:o};for(const l of u.issues)l.path?l.path.unshift(c):l.path=[c],n.issues?.push(l);if(n.issues||(n.issues=u.issues),r.abortEarly){n.typed=!1;break}}u.
|
|
1604
|
-
typed||(n.typed=!1),n.value[s]=u.value}else if(a.fallback!==void 0)n.value[s]=
|
|
1605
|
-
run"(n,r){return n.value===void 0&&(this.default!==void 0&&(n.value=B_(this,n,r)),n.value===void 0)?(n.typed=!0,n):this.wrapped["~run"](n,r)}}}function cb(t){return{kind:"schema",type:"string",reference:cb,expects:"string",async:!1,message:t,get"~standard"(){return cf(this)},"~run"(e,n){return typeof e.value=="string"?e.typed=!0:uf(this,"type",e,n),e}}}function
|
|
1606
|
-
~standard"(){return cf(this)},"~run"(e,n){for(const r of t)if(r.kind!=="metadata"){if(e.issues&&(r.kind==="schema"||r.kind==="transformation")){e.typed=!1;break}(!e.issues||!n.abortEarly&&!n.abortPipeEarly)&&(e=r["~run"](e,n))}return e}}}const U_=Bm(cb(),j_()),
|
|
1607
|
-
he project, default is ["**/node_modules/**/*"]')))});function
|
|
1604
|
+
typed||(n.typed=!1),n.value[s]=u.value}else if(a.fallback!==void 0)n.value[s]=c9(a);else if(a.type!=="exact_optional"&&a.type!=="optional"&&a.type!=="nullish"&&(uf(this,"key",n,r,{input:void 0,expected:`"${s}"`,path:[{type:"object",origin:"key",input:i,key:s,value:i[s]}]}),r.abortEarly))break}}else uf(this,"type",n,r);return n}}}function ub(t,e){return{kind:"schema",type:"optional",reference:ub,expects:`(${t.expects} | undefined)`,async:!1,wrapped:t,default:e,get"~standard"(){return cf(this)},"~\
|
|
1605
|
+
run"(n,r){return n.value===void 0&&(this.default!==void 0&&(n.value=B_(this,n,r)),n.value===void 0)?(n.typed=!0,n):this.wrapped["~run"](n,r)}}}function cb(t){return{kind:"schema",type:"string",reference:cb,expects:"string",async:!1,message:t,get"~standard"(){return cf(this)},"~run"(e,n){return typeof e.value=="string"?e.typed=!0:uf(this,"type",e,n),e}}}function l9(t,e,n){const r=t["~run"]({value:e},M_(n));if(r.issues)throw new u9(r.issues);return r.value}function Bm(...t){return{...t[0],pipe:t,get"\
|
|
1606
|
+
~standard"(){return cf(this)},"~run"(e,n){for(const r of t)if(r.kind!=="metadata"){if(e.issues&&(r.kind==="schema"||r.kind==="transformation")){e.typed=!1;break}(!e.issues||!n.abortEarly&&!n.abortPipeEarly)&&(e=r["~run"](e,n))}return e}}}const U_=Bm(cb(),j_()),d9=G_({name:Bm(U_,jm("Project name, must be unique in the workspace")),contactPerson:ub(Bm(U_,jm("A person who has been involved in creating or maintaining this project"))),exclude:ub(Bm(q_(cb()),jm('List of file patterns to exclude from t\
|
|
1607
|
+
he project, default is ["**/node_modules/**/*"]')))});function f9(t){return h9(F_.parse(t))}function h9(t){return l9(d9,t)}const z_=lt.getChild("ProjectsManager");class Tn{constructor(e){this.services=e,z_.debug`created`}static DefaultProjectId="default";static ConfigFileNames=[".likec4rc",".likec4.config.json","likec4.config.json"];projectIdToFolder=new f1;_projects=[];defaultGlobalProject={id:Tn.DefaultProjectId,config:{name:Tn.DefaultProjectId,exclude:["**/node_modules/**/*"]},exclude:C_("**/\
|
|
1608
1608
|
node_modules/**/*")};get defaultProjectId(){if(!(this._projects.length>1))return this._projects[0]?.id??Tn.DefaultProjectId}get all(){return Ar(this._projects,1)?[...Ht(this._projects,Ui("id")),Tn.DefaultProjectId]:[Tn.DefaultProjectId]}getProject(e){const n=typeof e=="string"?e:e.likec4ProjectId||this.belongsTo(e);if(n===Tn.DefaultProjectId){const s=this.services.workspace.WorkspaceManager.workspaceUri;return{id:n,folder:s,config:this.defaultGlobalProject.config}}const{config:r,folder:i}=Vt(this.
|
|
1609
1609
|
_projects.find(s=>s.id===n),`Project "${n}" not found`);return{id:n,folder:_t.parse(i),config:r}}ensureProjectId(e){return e===Tn.DefaultProjectId?e:e?(Fe(this.projectIdToFolder.has(e),`Project ID ${e} is not registered`),e):Vt(this.defaultProjectId,()=>`Specify exact project, known: [${[...this.projectIdToFolder.keys()].join(", ")}]`)}hasMultipleProjects(){return this._projects.length>1}checkIfExcluded(e){let n=e.toString();const r=this.findProjectForDocument(n);return r.exclude?r.exclude(N_(n)):
|
|
1610
|
-
!1}isConfigFile(e){const n=
|
|
1610
|
+
!1}isConfigFile(e){const n=UW(e.uri.toString())?.toLowerCase();return!!n&&Tn.ConfigFileNames.includes(n)}async loadConfigFile(e){if(!e.isDirectory&&this.isConfigFile(e))return await this.registerProject(e.uri)}async registerProject(e){if(_t.isUri(e)){const u=e,c=await this.services.workspace.FileSystemProvider.readFile(u),l=f9(c),f=Om(u.path,".."),d=u.with({path:f});return this.registerProject({config:l,folderUri:d})}const{config:n,folderUri:r}=e;let i=n.name,s=1;for(;this.projectIdToFolder.has(
|
|
1611
1611
|
i);)i=`${n.name}-${s++}`;let a;_t.isUri(r)?a=r.toString():a=Fs(r)?r:eb(r,"file://");const o={id:i,config:n,folder:a};return Ft(n.exclude)?o.exclude=this.defaultGlobalProject.exclude:Ar(n.exclude,1)&&(o.exclude=C_(n.exclude)),this._projects=et([...this._projects,o],lU([({folder:u})=>N_(u).split("/").length,"desc"])),this.projectIdToFolder.set(i,a),z_.info`register project ${i} folder: ${a}`,o}belongsTo(e){let n;return typeof e=="string"?n=Fs(e)?e:eb(e,"file://"):_t.isUri(e)?n=e.toString():n=e.uri.
|
|
1612
|
-
toString(),this.findProjectForDocument(n).id}findProjectForDocument(e){return this.mappingsToProject.get(e,()=>this._projects.find(({folder:n})=>e.startsWith(n))??this.defaultGlobalProject)}_mappingsToProject;get mappingsToProject(){return this._mappingsToProject??=new vp(this.services),this._mappingsToProject}}const
|
|
1613
|
-
D_):await super.readFile(e)}async readDirectory(e){const n=[];try{const r=await new Wz.fdir().withSymlinks({resolvePaths:!1}).withFullPaths().filter(
|
|
1612
|
+
toString(),this.findProjectForDocument(n).id}findProjectForDocument(e){return this.mappingsToProject.get(e,()=>this._projects.find(({folder:n})=>e.startsWith(n))??this.defaultGlobalProject)}_mappingsToProject;get mappingsToProject(){return this._mappingsToProject??=new vp(this.services),this._mappingsToProject}}const p9={fileSystemProvider:()=>new y9},m9=[...Yw.fileExtensions,...Tn.ConfigFileNames],g9=t=>m9.some(e=>t.endsWith(e));let y9=class extends Hz{async readFile(e){return nf(e)?Promise.resolve(
|
|
1613
|
+
D_):await super.readFile(e)}async readDirectory(e){const n=[];try{const r=await new Wz.fdir().withSymlinks({resolvePaths:!1}).withFullPaths().filter(g9).crawl(e.fsPath).withPromise();for(const i of r)n.push({isFile:!0,isDirectory:!1,uri:_t.file(i)})}catch(r){rf(r)}return n}};var st;(function(t){t.assertEqual=i=>i;function e(i){}t.assertIs=e;function n(i){throw new Error}t.assertNever=n,t.arrayToEnum=i=>{const s={};for(const a of i)s[a]=a;return s},t.getValidEnumValues=i=>{const s=t.objectKeys(i).
|
|
1614
1614
|
filter(o=>typeof i[i[o]]!="number"),a={};for(const o of s)a[o]=i[o];return t.objectValues(a)},t.objectValues=i=>t.objectKeys(i).map(function(s){return i[s]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const s=[];for(const a in i)Object.prototype.hasOwnProperty.call(i,a)&&s.push(a);return s},t.find=(i,s)=>{for(const a of i)if(s(a))return a},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function r(i,s="\
|
|
1615
1615
|
| "){return i.map(a=>typeof a=="string"?`'${a}'`:a).join(s)}t.joinValues=r,t.jsonStringifyReplacer=(i,s)=>typeof s=="bigint"?s.toString():s})(st||(st={}));var lb;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(lb||(lb={}));const be=st.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),ds=t=>{switch(typeof t){case"undefined":return be.undefined;case"string":return be.
|
|
1616
1616
|
string;case"number":return isNaN(t)?be.nan:be.number;case"boolean":return be.boolean;case"function":return be.function;case"bigint":return be.bigint;case"symbol":return be.symbol;case"object":return Array.isArray(t)?be.array:t===null?be.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?be.promise:typeof Map<"u"&&t instanceof Map?be.map:typeof Set<"u"&&t instanceof Set?be.set:typeof Date<"u"&&t instanceof Date?be.date:be.object;default:return be.unknown}},ie=st.arrayToEnum(
|
|
1617
|
-
["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),
|
|
1617
|
+
["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),v9=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:");class Er extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=
|
|
1618
1618
|
(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}format(e){const n=e||function(s){return s.message},r={_errors:[]},i=s=>{for(const a of s.issues)if(a.code==="invalid_union")a.unionErrors.map(i);else if(a.code==="invalid_return_type")i(a.returnTypeError);else if(a.code==="invalid_arguments")i(a.argumentsError);else if(a.path.length===0)r._errors.push(n(a));else{let o=r,u=0;
|
|
1619
1619
|
for(;u<a.path.length;){const c=a.path[u];u===a.path.length-1?(o[c]=o[c]||{_errors:[]},o[c]._errors.push(n(a))):o[c]=o[c]||{_errors:[]},o=o[c],u++}}};return i(this),r}static assert(e){if(!(e instanceof Er))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,st.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){const n={},r=[];for(const i of this.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||
|
|
1620
1620
|
[],n[i.path[0]].push(e(i))):r.push(e(i));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}Er.create=t=>new Er(t);const gu=(t,e)=>{let n;switch(t.code){case ie.invalid_type:t.received===be.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case ie.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,st.jsonStringifyReplacer)}`;break;case ie.unrecognized_keys:n=`Unrecognized key(s) in object: ${st.joinValues(t.keys,",\
|
|
@@ -1623,7 +1623,7 @@ for(;u<a.path.length;){const c=a.path[u];u===a.path.length-1?(o[c]=o[c]||{_error
|
|
|
1623
1623
|
too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than\
|
|
1624
1624
|
"}${new Date(Number(t.minimum))}`:n="Invalid input";break;case ie.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?
|
|
1625
1625
|
"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case ie.custom:n="Invalid input";break;case ie.invalid_intersection_types:n="Intersection results could not be merged";break;case ie.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case ie.not_finite:n="Number must be finite";break;default:n=e.defaultError,st.assertNever(
|
|
1626
|
-
t)}return{message:n}};let W_=gu;function
|
|
1626
|
+
t)}return{message:n}};let W_=gu;function w9(t){W_=t}function qm(){return W_}const Gm=t=>{const{data:e,path:n,errorMaps:r,issueData:i}=t,s=[...n,...i.path||[]],a={...i,path:s};if(i.message!==void 0)return{...i,path:s,message:i.message};let o="";const u=r.filter(c=>!!c).slice().reverse();for(const c of u)o=c(a,{data:e,defaultError:o}).message;return{...i,path:s,message:o}},b9=[];function ye(t,e){const n=qm(),r=Gm({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,
|
|
1627
1627
|
n,n===gu?void 0:gu].filter(i=>!!i)});t.common.issues.push(r)}class Nn{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){const r=[];for(const i of n){if(i.status==="aborted")return Oe;i.status==="dirty"&&e.dirty(),r.push(i.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,n){const r=[];for(const i of n){const s=await i.key,a=await i.value;r.push({key:s,value:a})}return Nn.
|
|
1628
1628
|
mergeObjectSync(e,r)}static mergeObjectSync(e,n){const r={};for(const i of n){const{key:s,value:a}=i;if(s.status==="aborted"||a.status==="aborted")return Oe;s.status==="dirty"&&e.dirty(),a.status==="dirty"&&e.dirty(),s.value!=="__proto__"&&(typeof a.value<"u"||i.alwaysSet)&&(r[s.value]=a.value)}return{status:e.value,value:r}}}const Oe=Object.freeze({status:"aborted"}),yu=t=>({status:"dirty",value:t}),Kn=t=>({status:"valid",value:t}),db=t=>t.status==="aborted",fb=t=>t.status==="dirty",Ja=t=>t.status===
|
|
1629
1629
|
"valid",lf=t=>typeof Promise<"u"&&t instanceof Promise;function Um(t,e,n,r){if(typeof e=="function"?t!==e||!0:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e.get(t)}function H_(t,e,n,r,i){if(typeof e=="function"?t!==e||!0:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return e.set(t,n),n}typeof SuppressedError=="function"&&SuppressedError;var De;(function(t){t.errToObj=e=>typeof e==
|
|
@@ -1638,20 +1638,20 @@ e)},i=this._parse({data:e,path:r.path,parent:r}),s=await(lf(i)?i:Promise.resolve
|
|
|
1638
1638
|
optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=
|
|
1639
1639
|
this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return Xr.create(this,this._def)}nullable(){return js.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return oi.create(this)}promise(){return bu.create(this,this._def)}or(e){return gf.create([this,e],this._def)}and(e){return yf.create(this,e,this._def)}transform(e){return new Zr({...qe(this._def),schema:this,typeName:oe.
|
|
1640
1640
|
ZodEffects,effect:{type:"transform",transform:e}})}default(e){const n=typeof e=="function"?e:()=>e;return new Ef({...qe(this._def),innerType:this,defaultValue:n,typeName:oe.ZodDefault})}brand(){return new mb({typeName:oe.ZodBranded,type:this,...qe(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new kf({...qe(this._def),innerType:this,catchValue:n,typeName:oe.ZodCatch})}describe(e){const n=this.constructor;return new n({...this._def,description:e})}pipe(e){return Gf.create(this,
|
|
1641
|
-
e)}readonly(){return Rf.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
`${e}(\\.\\d+)?`),e}function
|
|
1646
|
-
"object"||i===null||!i.typ||!i.alg||e&&i.alg!==e)}catch{return!1}}function
|
|
1641
|
+
e)}readonly(){return Rf.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const E9=/^c[^\s-]{8,}$/i,k9=/^[0-9a-z]+$/,R9=/^[0-9A-HJKMNP-TV-Z]{26}$/i,$9=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,D9=/^[a-z0-9_-]{21}$/i,T9=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,S9=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,
|
|
1642
|
+
C9=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,_9="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let hb;const A9=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,x9=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,P9=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,
|
|
1643
|
+
N9=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,
|
|
1644
|
+
I9=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,O9=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,K_="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",L9=new RegExp(`^${K_}$`);function Z_(t){let e="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=
|
|
1645
|
+
`${e}(\\.\\d+)?`),e}function F9(t){return new RegExp(`^${Z_(t)}$`)}function X_(t){let e=`${K_}T${Z_(t)}`;const n=[];return n.push(t.local?"Z?":"Z"),t.offset&&n.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${n.join("|")})`,new RegExp(`^${e}$`)}function M9(t,e){return!!((e==="v4"||!e)&&A9.test(t)||(e==="v6"||!e)&&P9.test(t))}function j9(t,e){if(!T9.test(t))return!1;try{const[n]=t.split("."),r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),i=JSON.parse(atob(r));return!(typeof i!=
|
|
1646
|
+
"object"||i===null||!i.typ||!i.alg||e&&i.alg!==e)}catch{return!1}}function B9(t,e){return!!((e==="v4"||!e)&&x9.test(t)||(e==="v6"||!e)&&N9.test(t))}class ui extends Ge{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==be.string){const s=this._getOrReturnCtx(e);return ye(s,{code:ie.invalid_type,expected:be.string,received:s.parsedType}),Oe}const r=new Nn;let i;for(const s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(i=this._getOrReturnCtx(e,i),ye(i,{code:ie.
|
|
1647
1647
|
too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty());else if(s.kind==="max")e.data.length>s.value&&(i=this._getOrReturnCtx(e,i),ye(i,{code:ie.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty());else if(s.kind==="length"){const a=e.data.length>s.value,o=e.data.length<s.value;(a||o)&&(i=this._getOrReturnCtx(e,i),a?ye(i,{code:ie.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):o&&ye(i,{code:ie.
|
|
1648
|
-
too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),r.dirty())}else if(s.kind==="email")
|
|
1649
|
-
uuid",code:ie.invalid_string,message:s.message}),r.dirty());else if(s.kind==="nanoid")
|
|
1650
|
-
dirty());else if(s.kind==="ulid")
|
|
1648
|
+
too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),r.dirty())}else if(s.kind==="email")C9.test(e.data)||(i=this._getOrReturnCtx(e,i),ye(i,{validation:"email",code:ie.invalid_string,message:s.message}),r.dirty());else if(s.kind==="emoji")hb||(hb=new RegExp(_9,"u")),hb.test(e.data)||(i=this._getOrReturnCtx(e,i),ye(i,{validation:"emoji",code:ie.invalid_string,message:s.message}),r.dirty());else if(s.kind==="uuid")$9.test(e.data)||(i=this._getOrReturnCtx(e,i),ye(i,{validation:"\
|
|
1649
|
+
uuid",code:ie.invalid_string,message:s.message}),r.dirty());else if(s.kind==="nanoid")D9.test(e.data)||(i=this._getOrReturnCtx(e,i),ye(i,{validation:"nanoid",code:ie.invalid_string,message:s.message}),r.dirty());else if(s.kind==="cuid")E9.test(e.data)||(i=this._getOrReturnCtx(e,i),ye(i,{validation:"cuid",code:ie.invalid_string,message:s.message}),r.dirty());else if(s.kind==="cuid2")k9.test(e.data)||(i=this._getOrReturnCtx(e,i),ye(i,{validation:"cuid2",code:ie.invalid_string,message:s.message}),r.
|
|
1650
|
+
dirty());else if(s.kind==="ulid")R9.test(e.data)||(i=this._getOrReturnCtx(e,i),ye(i,{validation:"ulid",code:ie.invalid_string,message:s.message}),r.dirty());else if(s.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),ye(i,{validation:"url",code:ie.invalid_string,message:s.message}),r.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),ye(i,{validation:"regex",code:ie.invalid_string,message:s.message}),r.dirty())):s.kind==="trim"?
|
|
1651
1651
|
e.data=e.data.trim():s.kind==="includes"?e.data.includes(s.value,s.position)||(i=this._getOrReturnCtx(e,i),ye(i,{code:ie.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),r.dirty()):s.kind==="toLowerCase"?e.data=e.data.toLowerCase():s.kind==="toUpperCase"?e.data=e.data.toUpperCase():s.kind==="startsWith"?e.data.startsWith(s.value)||(i=this._getOrReturnCtx(e,i),ye(i,{code:ie.invalid_string,validation:{startsWith:s.value},message:s.message}),r.dirty()):s.kind==="\
|
|
1652
|
-
endsWith"?e.data.endsWith(s.value)||(i=this._getOrReturnCtx(e,i),ye(i,{code:ie.invalid_string,validation:{endsWith:s.value},message:s.message}),r.dirty()):s.kind==="datetime"?X_(s).test(e.data)||(i=this._getOrReturnCtx(e,i),ye(i,{code:ie.invalid_string,validation:"datetime",message:s.message}),r.dirty()):s.kind==="date"?
|
|
1653
|
-
e,i),ye(i,{code:ie.invalid_string,validation:"time",message:s.message}),r.dirty()):s.kind==="duration"?
|
|
1654
|
-
r.dirty()):s.kind==="cidr"?
|
|
1652
|
+
endsWith"?e.data.endsWith(s.value)||(i=this._getOrReturnCtx(e,i),ye(i,{code:ie.invalid_string,validation:{endsWith:s.value},message:s.message}),r.dirty()):s.kind==="datetime"?X_(s).test(e.data)||(i=this._getOrReturnCtx(e,i),ye(i,{code:ie.invalid_string,validation:"datetime",message:s.message}),r.dirty()):s.kind==="date"?L9.test(e.data)||(i=this._getOrReturnCtx(e,i),ye(i,{code:ie.invalid_string,validation:"date",message:s.message}),r.dirty()):s.kind==="time"?F9(s).test(e.data)||(i=this._getOrReturnCtx(
|
|
1653
|
+
e,i),ye(i,{code:ie.invalid_string,validation:"time",message:s.message}),r.dirty()):s.kind==="duration"?S9.test(e.data)||(i=this._getOrReturnCtx(e,i),ye(i,{validation:"duration",code:ie.invalid_string,message:s.message}),r.dirty()):s.kind==="ip"?M9(e.data,s.version)||(i=this._getOrReturnCtx(e,i),ye(i,{validation:"ip",code:ie.invalid_string,message:s.message}),r.dirty()):s.kind==="jwt"?j9(e.data,s.alg)||(i=this._getOrReturnCtx(e,i),ye(i,{validation:"jwt",code:ie.invalid_string,message:s.message}),
|
|
1654
|
+
r.dirty()):s.kind==="cidr"?B9(e.data,s.version)||(i=this._getOrReturnCtx(e,i),ye(i,{validation:"cidr",code:ie.invalid_string,message:s.message}),r.dirty()):s.kind==="base64"?I9.test(e.data)||(i=this._getOrReturnCtx(e,i),ye(i,{validation:"base64",code:ie.invalid_string,message:s.message}),r.dirty()):s.kind==="base64url"?O9.test(e.data)||(i=this._getOrReturnCtx(e,i),ye(i,{validation:"base64url",code:ie.invalid_string,message:s.message}),r.dirty()):st.assertNever(s);return{status:r.value,value:e.data}}_regex(e,n,r){
|
|
1655
1655
|
return this.refinement(i=>e.test(i),{validation:n,code:ie.invalid_string,...De.errToObj(r)})}_addCheck(e){return new ui({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...De.errToObj(e)})}url(e){return this._addCheck({kind:"url",...De.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...De.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...De.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...De.errToObj(e)})}cuid(e){return this.
|
|
1656
1656
|
_addCheck({kind:"cuid",...De.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...De.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...De.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...De.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...De.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...De.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...De.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...De.errToObj(e)})}datetime(e){
|
|
1657
1657
|
var n,r;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:(n=e?.offset)!==null&&n!==void 0?n:!1,local:(r=e?.local)!==null&&r!==void 0?r:!1,...De.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.
|
|
@@ -1659,10 +1659,10 @@ precision>"u"?null:e?.precision,...De.errToObj(e?.message)})}duration(e){return
|
|
|
1659
1659
|
_addCheck({kind:"min",value:e,...De.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...De.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...De.errToObj(n)})}nonempty(e){return this.min(1,De.errToObj(e))}trim(){return new ui({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new ui({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new ui({...this._def,checks:[...this._def.checks,{kind:"toUpp\
|
|
1660
1660
|
erCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.
|
|
1661
1661
|
checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this.
|
|
1662
|
-
_def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}ui.create=t=>{var e;return new ui({checks:[],typeName:oe.ZodString,coerce:(e=t?.coerce)!==null&&e!==void 0?e:!1,...qe(t)})};function
|
|
1662
|
+
_def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}ui.create=t=>{var e;return new ui({checks:[],typeName:oe.ZodString,coerce:(e=t?.coerce)!==null&&e!==void 0?e:!1,...qe(t)})};function q9(t,e){const n=(t.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||
|
|
1663
1663
|
"").length,i=n>r?n:r,s=parseInt(t.toFixed(i).replace(".","")),a=parseInt(e.toFixed(i).replace(".",""));return s%a/Math.pow(10,i)}class Hs extends Ge{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==be.number){const s=this._getOrReturnCtx(e);return ye(s,{code:ie.invalid_type,expected:be.number,received:s.parsedType}),Oe}let r;const i=new Nn;for(const s of this._def.checks)s.kind===
|
|
1664
1664
|
"int"?st.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),ye(r,{code:ie.invalid_type,expected:"integer",received:"float",message:s.message}),i.dirty()):s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(r=this._getOrReturnCtx(e,r),ye(r,{code:ie.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(r=this._getOrReturnCtx(e,r),ye(r,{code:ie.too_big,maximum:s.value,type:"number",inclusive:s.
|
|
1665
|
-
inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="multipleOf"?
|
|
1665
|
+
inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="multipleOf"?q9(e.data,s.value)!==0&&(r=this._getOrReturnCtx(e,r),ye(r,{code:ie.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),ye(r,{code:ie.not_finite,message:s.message}),i.dirty()):st.assertNever(s);return{status:i.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,De.toString(n))}gt(e,n){return this.setLimit("min",e,!1,De.toString(n))}lte(e,n){
|
|
1666
1666
|
return this.setLimit("max",e,!0,De.toString(n))}lt(e,n){return this.setLimit("max",e,!1,De.toString(n))}setLimit(e,n,r,i){return new Hs({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:De.toString(i)}]})}_addCheck(e){return new Hs({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:De.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:De.toString(e)})}negative(e){return this._addCheck({
|
|
1667
1667
|
kind:"max",value:0,inclusive:!1,message:De.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:De.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:De.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:De.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:De.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:De.
|
|
1668
1668
|
toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:De.toString(e)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&st.isInteger(e.value))}get isFinite(){let e=null,n=null;for(const r of this.
|
|
@@ -1719,17 +1719,17 @@ u);if(u instanceof Promise)throw new Error("Async refinement encountered during
|
|
|
1719
1719
|
value,s)).then(o=>({status:n.value,value:o})):a);st.assertNever(i)}}Zr.create=(t,e,n)=>new Zr({schema:t,typeName:oe.ZodEffects,effect:e,...qe(n)}),Zr.createWithPreprocess=(t,e,n)=>new Zr({schema:e,effect:{type:"preprocess",transform:t},typeName:oe.ZodEffects,...qe(n)});class Xr extends Ge{_parse(e){return this._getType(e)===be.undefined?Kn(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Xr.create=(t,e)=>new Xr({innerType:t,typeName:oe.ZodOptional,...qe(e)});class js extends Ge{_parse(e){
|
|
1720
1720
|
return this._getType(e)===be.null?Kn(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}js.create=(t,e)=>new js({innerType:t,typeName:oe.ZodNullable,...qe(e)});class Ef extends Ge{_parse(e){const{ctx:n}=this._processInputParams(e);let r=n.data;return n.parsedType===be.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}Ef.create=(t,e)=>new Ef({innerType:t,typeName:oe.ZodDefault,defaultValue:typeof e.
|
|
1721
1721
|
default=="function"?e.default:()=>e.default,...qe(e)});class kf extends Ge{_parse(e){const{ctx:n}=this._processInputParams(e),r={...n,common:{...n.common,issues:[]}},i=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return lf(i)?i.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Er(r.common.issues)},input:r.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Er(r.common.issues)},
|
|
1722
|
-
input:r.data})}}removeCatch(){return this._def.innerType}}kf.create=(t,e)=>new kf({innerType:t,typeName:oe.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...qe(e)});class Vm extends Ge{_parse(e){if(this._getType(e)!==be.nan){const r=this._getOrReturnCtx(e);return ye(r,{code:ie.invalid_type,expected:be.nan,received:r.parsedType}),Oe}return{status:"valid",value:e.data}}}Vm.create=t=>new Vm({typeName:oe.ZodNaN,...qe(t)});const
|
|
1722
|
+
input:r.data})}}removeCatch(){return this._def.innerType}}kf.create=(t,e)=>new kf({innerType:t,typeName:oe.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...qe(e)});class Vm extends Ge{_parse(e){if(this._getType(e)!==be.nan){const r=this._getOrReturnCtx(e);return ye(r,{code:ie.invalid_type,expected:be.nan,received:r.parsedType}),Oe}return{status:"valid",value:e.data}}}Vm.create=t=>new Vm({typeName:oe.ZodNaN,...qe(t)});const G9=Symbol("zod_brand");class mb extends Ge{_parse(e){
|
|
1723
1723
|
const{ctx:n}=this._processInputParams(e),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class Gf extends Ge{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{const s=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?Oe:s.status==="dirty"?(n.dirty(),yu(s.value)):this._def.out._parseAsync({data:s.value,path:r.path,parent:r})})();{const i=this._def.in._parseSync(
|
|
1724
1724
|
{data:r.data,path:r.path,parent:r});return i.status==="aborted"?Oe:i.status==="dirty"?(n.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:r.path,parent:r})}}static create(e,n){return new Gf({in:e,out:n,typeName:oe.ZodPipeline})}}class Rf extends Ge{_parse(e){const n=this._def.innerType._parse(e),r=i=>(Ja(i)&&(i.value=Object.freeze(i.value)),i);return lf(n)?n.then(i=>r(i)):r(n)}unwrap(){return this._def.innerType}}Rf.create=(t,e)=>new Rf({innerType:t,typeName:oe.
|
|
1725
1725
|
ZodReadonly,...qe(e)});function J_(t,e){const n=typeof t=="function"?t(e):typeof t=="string"?{message:t}:t;return typeof n=="string"?{message:n}:n}function Q_(t,e={},n){return t?vu.create().superRefine((r,i)=>{var s,a;const o=t(r);if(o instanceof Promise)return o.then(u=>{var c,l;if(!u){const f=J_(e,r),d=(l=(c=f.fatal)!==null&&c!==void 0?c:n)!==null&&l!==void 0?l:!0;i.addIssue({code:"custom",...f,fatal:d})}});if(!o){const u=J_(e,r),c=(a=(s=u.fatal)!==null&&s!==void 0?s:n)!==null&&a!==void 0?a:!0;
|
|
1726
|
-
i.addIssue({code:"custom",...u,fatal:c})}}):vu.create()}const
|
|
1726
|
+
i.addIssue({code:"custom",...u,fatal:c})}}):vu.create()}const U9={object:Ut.lazycreate};var oe;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="Zod\
|
|
1727
1727
|
DiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(
|
|
1728
|
-
oe||(oe={}));const
|
|
1729
|
-
v6=js.create,w6=Zr.createWithPreprocess,b6=Gf.create,E6=()=>eA().optional(),k6=()=>tA().optional(),R6=()=>nA().optional(),$6={string:t=>ui.create({...t,coerce:!0}),number:t=>Hs.create({...t,coerce:!0}),boolean:t=>hf.create({...t,coerce:!0}),bigint:t=>Vs.create({...t,coerce:!0}),date:t=>po.create({...t,coerce:!0})},D6=Oe;var C=Object.freeze({__proto__:null,defaultErrorMap:gu,setErrorMap:
|
|
1728
|
+
oe||(oe={}));const z9=(t,e={message:`Input not instance of ${t.name}`})=>Q_(n=>n instanceof t,e),eA=ui.create,tA=Hs.create,W9=Vm.create,H9=Vs.create,nA=hf.create,V9=po.create,K9=zm.create,Z9=pf.create,X9=mf.create,Y9=vu.create,J9=Qa.create,Q9=fs.create,e6=Wm.create,t6=oi.create,n6=Ut.create,r6=Ut.strictCreate,i6=gf.create,s6=Rg.create,a6=yf.create,o6=Si.create,u6=zf.create,c6=Hm.create,l6=mo.create,d6=Au.create,f6=vf.create,h6=wf.create,p6=Ks.create,m6=bf.create,g6=bu.create,rA=Zr.create,y6=Xr.create,
|
|
1729
|
+
v6=js.create,w6=Zr.createWithPreprocess,b6=Gf.create,E6=()=>eA().optional(),k6=()=>tA().optional(),R6=()=>nA().optional(),$6={string:t=>ui.create({...t,coerce:!0}),number:t=>Hs.create({...t,coerce:!0}),boolean:t=>hf.create({...t,coerce:!0}),bigint:t=>Vs.create({...t,coerce:!0}),date:t=>po.create({...t,coerce:!0})},D6=Oe;var C=Object.freeze({__proto__:null,defaultErrorMap:gu,setErrorMap:w9,getErrorMap:qm,makeIssue:Gm,EMPTY_PATH:b9,addIssueToContext:ye,ParseStatus:Nn,INVALID:Oe,DIRTY:yu,OK:Kn,isAborted:db,
|
|
1730
1730
|
isDirty:fb,isValid:Ja,isAsync:lf,get util(){return st},get objectUtil(){return lb},ZodParsedType:be,getParsedType:ds,ZodType:Ge,datetimeRegex:X_,ZodString:ui,ZodNumber:Hs,ZodBigInt:Vs,ZodBoolean:hf,ZodDate:po,ZodSymbol:zm,ZodUndefined:pf,ZodNull:mf,ZodAny:vu,ZodUnknown:Qa,ZodNever:fs,ZodVoid:Wm,ZodArray:oi,ZodObject:Ut,ZodUnion:gf,ZodDiscriminatedUnion:Rg,ZodIntersection:yf,ZodTuple:Si,ZodRecord:zf,ZodMap:Hm,ZodSet:mo,ZodFunction:Au,ZodLazy:vf,ZodLiteral:wf,ZodEnum:Ks,ZodNativeEnum:bf,ZodPromise:bu,
|
|
1731
|
-
ZodEffects:Zr,ZodTransformer:Zr,ZodOptional:Xr,ZodNullable:js,ZodDefault:Ef,ZodCatch:kf,ZodNaN:Vm,BRAND:
|
|
1732
|
-
pipeline:b6,preprocess:w6,promise:g6,record:u6,set:l6,strictObject:r6,string:eA,symbol:
|
|
1731
|
+
ZodEffects:Zr,ZodTransformer:Zr,ZodOptional:Xr,ZodNullable:js,ZodDefault:Ef,ZodCatch:kf,ZodNaN:Vm,BRAND:G9,ZodBranded:mb,ZodPipeline:Gf,ZodReadonly:Rf,custom:Q_,Schema:Ge,ZodSchema:Ge,late:U9,get ZodFirstPartyTypeKind(){return oe},coerce:$6,any:Y9,array:t6,bigint:H9,boolean:nA,date:V9,discriminatedUnion:s6,effect:rA,enum:p6,function:d6,instanceof:z9,intersection:a6,lazy:f6,literal:h6,map:c6,nan:W9,nativeEnum:m6,never:Q9,null:X9,nullable:v6,number:tA,object:n6,oboolean:R6,onumber:k6,optional:y6,ostring:E6,
|
|
1732
|
+
pipeline:b6,preprocess:w6,promise:g6,record:u6,set:l6,strictObject:r6,string:eA,symbol:K9,transformer:rA,tuple:o6,undefined:Z9,union:i6,unknown:J9,void:e6,NEVER:D6,ZodIssueCode:ie,quotelessJson:v9,ZodError:Er});const iA="2024-11-05",T6=[iA,"2024-10-07"],Km="2.0",sA=C.union([C.string(),C.number().int()]),aA=C.string(),Yr=C.object({_meta:C.optional(C.object({progressToken:C.optional(sA)}).passthrough())}).passthrough(),wr=C.object({method:C.string(),params:C.optional(Yr)}),$f=C.object({_meta:C.optional(
|
|
1733
1733
|
C.object({}).passthrough())}).passthrough(),Di=C.object({method:C.string(),params:C.optional($f)}),Jr=C.object({_meta:C.optional(C.object({}).passthrough())}).passthrough(),Zm=C.union([C.string(),C.number().int()]),oA=C.object({jsonrpc:C.literal(Km),id:Zm}).merge(wr).strict(),S6=t=>oA.safeParse(t).success,uA=C.object({jsonrpc:C.literal(Km)}).merge(Di).strict(),C6=t=>uA.safeParse(t).success,cA=C.object({jsonrpc:C.literal(Km),id:Zm,result:Jr}).strict(),lA=t=>cA.safeParse(t).success;var un;(function(t){
|
|
1734
1734
|
t[t.ConnectionClosed=-32e3]="ConnectionClosed",t[t.RequestTimeout=-32001]="RequestTimeout",t[t.ParseError=-32700]="ParseError",t[t.InvalidRequest=-32600]="InvalidRequest",t[t.MethodNotFound=-32601]="MethodNotFound",t[t.InvalidParams=-32602]="InvalidParams",t[t.InternalError=-32603]="InternalError"})(un||(un={}));const dA=C.object({jsonrpc:C.literal(Km),id:Zm,error:C.object({code:C.number().int(),message:C.string(),data:C.optional(C.unknown())})}).strict(),_6=t=>dA.safeParse(t).success;C.union([oA,
|
|
1735
1735
|
uA,cA,dA]);const gb=Jr.strict(),yb=Di.extend({method:C.literal("notifications/cancelled"),params:$f.extend({requestId:Zm,reason:C.string().optional()})}),fA=C.object({name:C.string(),version:C.string()}).passthrough(),A6=C.object({experimental:C.optional(C.object({}).passthrough()),sampling:C.optional(C.object({}).passthrough()),roots:C.optional(C.object({listChanged:C.optional(C.boolean())}).passthrough())}).passthrough(),hA=wr.extend({method:C.literal("initialize"),params:Yr.extend({protocolVersion:C.
|
|
@@ -2004,22 +2004,22 @@ oneSpace:xs.oneSpace(),noSpace:xs.noSpace(),indent:xs.indent({allowMore:!0}),noI
|
|
|
2004
2004
|
formatViewRuleGlobalStyle(e),this.formatViewRuleGlobalPredicate(e),this.formatIncludeExcludeExpressions(e),this.formatWhereExpression(e),this.formatWhereRelationExpression(e),this.formatWhereElementExpression(e),this.formatRelationExpression(e),this.formatAutolayoutProperty(e),this.formatWithPredicate(e),this.formatViewRuleStyle(e),this.formatLeafProperty(e),this.formatLinkProperty(e),this.formatNavigateToProperty(e),this.formatTags(e)}formatTags(e){this.on(e,Hw,(n,r)=>{r.cst(Ro(n.$cstNode,"valu\
|
|
2005
2005
|
es").slice(1)).prepend(te.oneSpace),r.keywords(",").prepend(te.noSpace).append(te.oneSpace)})}formatDeploymentRelation(e){this.on(e,Ri,(n,r)=>{const i=n?.source?.$cstNode?[n?.source?.$cstNode]:[];r.cst(i).append(te.oneSpace),r.keywords("]->").prepend(te.noSpace),r.keywords("-[").append(te.noSpace),r.nodes(...Qe([n.target,n.tags],fe)).prepend(te.oneSpace),r.properties("title","technology").prepend(te.oneSpace)})}formatRelation(e){this.on(e,n=>os(n)||Ri(n),(n,r)=>{const i=n?.source?.$cstNode?[n?.source?.
|
|
2006
2006
|
$cstNode]:[];r.cst(i).append(te.oneSpace),r.keywords("]->").prepend(te.noSpace),r.keywords("-[").append(te.noSpace),r.nodes(...Qe([n.target,n.tags],fe)).prepend(te.oneSpace),r.properties("title","technology").prepend(te.oneSpace)}),this.on(e,Aw,(n,r)=>{r.keywords("->","<-").surround(te.oneSpace);const i=r.property("kind");i.nodes[0]?.text.startsWith(".")&&i.surround(te.oneSpace),r.keywords("]->").prepend(te.noSpace).append(te.oneSpace),r.keywords("-[").prepend(te.oneSpace).append(te.noSpace),r.properties(
|
|
2007
|
-
"title").prepend(te.oneSpace)})}removeIndentFromTopLevelStatements(e){u_(e.$container)&&this.getNodeFormatter(e).keywords("specification","model","views","likec4lib","global","deployments","import").prepend(te.noIndent)}indentContentInBraces(e){if(
|
|
2007
|
+
"title").prepend(te.oneSpace)})}removeIndentFromTopLevelStatements(e){u_(e.$container)&&this.getNodeFormatter(e).keywords("specification","model","views","likec4lib","global","deployments","import").prepend(te.noIndent)}indentContentInBraces(e){if(hW(e)||p_(e)||cu(e)||du(e)||ou(e)||Fw(e)||tu(e)||Za(e)||ud(e)||od(e)||Za(e)||c_(e)||sm(e)||Iw(e)||gW(e)||Tm(e)||mW(e)||vd(e)||Pw(e)||JC(e)||Sw(e)||pu(e)||Im(e)||sW(e)||aW(e)||Zo(e)||Cw(e)||l_(e)||ZC(e)||uW(e)||KC(e)){const n=this.getNodeFormatter(e),r=n.
|
|
2008
2008
|
keywords("{"),i=n.keywords("}"),s=n.interior(r,i);let a=null;for(const o of s.nodes)(!a||!bK(a,o))&&n.cst([o]).prepend(te.indent),a=o;r.prepend(te.noIndent).prepend(te.oneSpace),i.prepend(te.noIndent).prepend(xs.newLine({allowMore:!0}))}}appendKeywordsWithSpace(e){this.on(e,t_)?.keywords("element").append(te.oneSpace)}formatView(e){this.on(e,om,(n,r)=>{(n.extends||n.viewOf||n.name)&&r.keywords("view").append(te.oneSpace),r.keywords("of","extends").surround(te.oneSpace)}),this.on(e,YC)?.keywords(
|
|
2009
|
-
"dynamic","view").append(te.oneSpace),this.on(e,XC)?.keywords("deployment","view").append(te.oneSpace)}formatLeafProperty(e){if(ed(e)||Ad(e)||
|
|
2009
|
+
"dynamic","view").append(te.oneSpace),this.on(e,XC)?.keywords("deployment","view").append(te.oneSpace)}formatLeafProperty(e){if(ed(e)||Ad(e)||vW(e)||su(e)||zw(e)||h_(e)||Wa(e)||pd(e)||Gl(e)||Ns(e)||Sm(e)||Vp(e)||Rm(e)||jw(e)||Uw(e)||Bw(e)||Vw(e)){const n=this.getNodeFormatter(e),r=n.keyword(":"),i=n.keywords("title","description","technology","notation","color","line","head","tail","icon","shape","border","opacity","multiple","size","padding","textSize");r.nodes.length===0?i.append(te.oneSpace):
|
|
2010
2010
|
r.prepend(te.noSpace).append(te.oneSpace),n.keyword(";").prepend(te.noSpace).append(te.newLine)}}formatLinkProperty(e){this.on(e,bm,(n,r)=>{r.keyword("link").append(te.oneSpace),r.property("value").append(te.oneSpace),r.keyword(":").prepend(te.noSpace).append(te.oneSpace),r.keyword(";").prepend(te.noSpace).append(te.newLine)})}formatNavigateToProperty(e){this.on(e,km)?.property("key").append(te.oneSpace)}formatAutolayoutProperty(e){this.on(e,Md,(n,r)=>{r.keyword("autoLayout").append(te.oneSpace),
|
|
2011
|
-
r.property("rankSep").prepend(te.oneSpace),r.property("nodeSep").prepend(te.oneSpace)})}formatMetadataProperty(e){this.on(e,
|
|
2011
|
+
r.property("rankSep").prepend(te.oneSpace),r.property("nodeSep").prepend(te.oneSpace)})}formatMetadataProperty(e){this.on(e,pW,(n,r)=>{r.property("key").append(te.oneSpace),r.keyword(":").prepend(te.noSpace).append(te.oneSpace),r.keyword(";").prepend(te.noSpace).append(te.newLine)})}formatElementDeclaration(e){this.on(e,_n,(n,r)=>{const i=Cn(n.$cstNode,"kind"),s=Cn(n.$cstNode,"name");s&&i&&(t0(s,i)>0?r.cst([i]).append(te.oneSpace):(r.cst([s]).append(te.oneSpace),r.cst([i]).prepend(te.oneSpace))),
|
|
2012
2012
|
r.properties("props").prepend(te.oneSpace)})}formatGlobals(e){this.on(e,tu,(n,r)=>{r.keyword("style").append(te.oneSpace),r.property("id").append(te.oneSpace)}),this.on(e,Za,(n,r)=>{r.keyword("styleGroup").append(te.oneSpace)}),this.on(e,ud,(n,r)=>{r.keyword("predicateGroup").append(te.oneSpace)}),this.on(e,od,(n,r)=>{r.keyword("dynamicPredicateGroup").append(te.oneSpace)})}formatSpecificationRule(e){if((cu(e)||du(e)||Am(e)||ou(e))&&this.getNodeFormatter(e).keywords("element","relationship","tag",
|
|
2013
2013
|
"deploymentNode").append(te.oneSpace),_m(e)){const n=this.getNodeFormatter(e);n.keyword("color").append(te.oneSpace),n.property("name").append(te.oneSpace)}}formatWithPredicate(e){(hm(e)||Gw(e))&&this.getNodeFormatter(e).keyword("with").prepend(te.oneSpace)}formatDeploymentNodeDeclaration(e){this.on(e,ar,(n,r)=>{const i=Cn(n.$cstNode,"kind"),s=Cn(n.$cstNode,"name");s&&i&&(t0(s,i)>0?r.cst([i]).append(te.oneSpace):(r.cst([s]).append(te.oneSpace),r.cst([i]).prepend(te.oneSpace))),r.properties("titl\
|
|
2014
2014
|
e").prepend(te.oneSpace)})}formatDeployedInstance(e){this.on(e,yr,(n,r)=>{const i=n.$cstNode?.content.find(s=>s.text==="=");i&&r.cst([i]).surround(te.oneSpace),r.keyword("instanceOf").append(te.oneSpace),r.property("title").prepend(te.oneSpace)})}formatViewRuleGlobalStyle(e){this.on(e,Xw,(n,r)=>{r.keywords("global","style").append(te.oneSpace)})}formatViewRuleGlobalPredicate(e){const n=this.getNodeFormatter(e);(Zw(e)||QC(e))&&n.keywords("global","predicate").append(te.oneSpace)}formatViewRuleGroup(e){
|
|
2015
|
-
this.on(e,Im,(n,r)=>{r.keyword("group").append(te.oneSpace)})}formatViewRuleStyle(e){this.on(e,pu)?.keyword("style").append(te.oneSpace),this.on(e,Kl)?.keyword("style").append(te.oneSpace),this.on(e,i_)?.keyword(",").prepend(te.noSpace).append(te.oneSpace),this.on(e,
|
|
2016
|
-
rator").surround(te.oneSpace)}),this.on(e,w_,(n,r)=>{r.keyword("not").append(te.oneSpace)}),VC(e)||
|
|
2017
|
-
"not").surround(te.oneSpace)}}formatIncludeExcludeExpressions(e){if(vw(e)||Ud(e)||Vo(e)){const n=this.getNodeFormatter(e);(!e.$cstNode||!Ox(e.$cstNode))&&n.keywords("include","exclude").append(te.oneSpace)}if(i_(e)){const n=this.getNodeFormatter(e),r=this.findPredicateExpressionRoot(e),i=r?.$cstNode&&Ox(r?.$cstNode);i&&n.property("value").prepend(te.indent),n.keyword(",").prepend(te.noSpace).append(i?te.newLine:te.oneSpace)}}formatRelationExpression(e){this.on(e,
|
|
2018
|
-
te.oneSpace)}),this.on(e,o_,(n,r)=>{r.keyword("->").prepend(te.oneSpace)}),this.on(e,f_,(n,r)=>{r.keywords("->","<->").prepend(te.oneSpace),r.keywords("-[").prepend(te.oneSpace).append(te.noSpace),r.keywords("]->").prepend(te.noSpace).append(te.oneSpace);const i=r.property("kind");i.nodes[0]?.text.startsWith(".")&&i.surround(te.oneSpace)}),this.on(e,
|
|
2015
|
+
this.on(e,Im,(n,r)=>{r.keyword("group").append(te.oneSpace)})}formatViewRuleStyle(e){this.on(e,pu)?.keyword("style").append(te.oneSpace),this.on(e,Kl)?.keyword("style").append(te.oneSpace),this.on(e,i_)?.keyword(",").prepend(te.noSpace).append(te.oneSpace),this.on(e,lW)?.keyword(",").prepend(te.noSpace).append(te.oneSpace)}formatWhereExpression(e){(qw(e)||Ow(e))&&this.getNodeFormatter(e).keyword("where").append(te.oneSpace)}formatWhereRelationExpression(e){if(this.on(e,rW,(n,r)=>{r.property("ope\
|
|
2016
|
+
rator").surround(te.oneSpace)}),this.on(e,w_,(n,r)=>{r.keyword("not").append(te.oneSpace)}),VC(e)||kW(e)||v_(e)){const n=this.getNodeFormatter(e);n.property("operator").surround(te.oneSpace),n.property("not").surround(te.oneSpace)}}formatWhereElementExpression(e){if(this.on(e,tW,(n,r)=>{r.property("operator").surround(te.oneSpace)}),this.on(e,y_,(n,r)=>{r.keyword("not").append(te.oneSpace)}),WC(e)||EW(e)||bW(e)){const n=this.getNodeFormatter(e);n.property("operator").surround(te.oneSpace),n.property(
|
|
2017
|
+
"not").surround(te.oneSpace)}}formatIncludeExcludeExpressions(e){if(vw(e)||Ud(e)||Vo(e)){const n=this.getNodeFormatter(e);(!e.$cstNode||!Ox(e.$cstNode))&&n.keywords("include","exclude").append(te.oneSpace)}if(i_(e)){const n=this.getNodeFormatter(e),r=this.findPredicateExpressionRoot(e),i=r?.$cstNode&&Ox(r?.$cstNode);i&&n.property("value").prepend(te.indent),n.keyword(",").prepend(te.noSpace).append(i?te.newLine:te.oneSpace)}}formatRelationExpression(e){this.on(e,dW,(n,r)=>{r.keyword("->").append(
|
|
2018
|
+
te.oneSpace)}),this.on(e,o_,(n,r)=>{r.keyword("->").prepend(te.oneSpace)}),this.on(e,f_,(n,r)=>{r.keywords("->","<->").prepend(te.oneSpace),r.keywords("-[").prepend(te.oneSpace).append(te.noSpace),r.keywords("]->").prepend(te.noSpace).append(te.oneSpace);const i=r.property("kind");i.nodes[0]?.text.startsWith(".")&&i.surround(te.oneSpace)}),this.on(e,cW,(n,r)=>{r.property("target").prepend(te.oneSpace)})}findPredicateExpressionRoot(e){let n=e.$container;for(;;){if(!n||vw(n)||Ud(n)||Vo(n))return n;
|
|
2019
2019
|
n=n.$container}}on(e,n,r){const i=n(e)?this.getNodeFormatter(e):void 0;return r&&i&&r(e,i),i}}class RK extends QD{constructor(e){super(e),this.services=e}createDescription(e,n,r){const i=r??vt(e),s=super.createDescription(e,n,r);return i.likec4ProjectId??=this.services.shared.workspace.ProjectsManager.belongsTo(i.uri),s.likec4ProjectId=i.likec4ProjectId,s}}var Jt=xa();class $K extends eT{constructor(e){super(e),this.services=e}async updateContent(e,n=Jt.CancellationToken.None){const r=this.services.
|
|
2020
2020
|
workspace.ProjectsManager;e.likec4ProjectId=r.belongsTo(e.uri),await super.updateContent(e,n)}projectElements(e,n,r){const i=this.services.workspace.ProjectsManager;return rt(this.symbolIndex.keys()).filter(s=>i.belongsTo(s)===e&&(!r||r.has(s))).flatMap(s=>this.getFileDescriptions(s,n))}}class DK extends WD{constructor(e){super(e),this.services=e}get allExcludingBuiltin(){const e=this.services.workspace.ProjectsManager;return super.all.filter(n=>!so(n)||nf(n.uri)?!1:(n.likec4ProjectId??=e.belongsTo(
|
|
2021
2021
|
n.uri),!0))}projectDocuments(e){return this.allExcludingBuiltin.filter(n=>n.likec4ProjectId===e)}groupedByProject(){return qo(this.allExcludingBuiltin.toArray(),Ui("likec4ProjectId"))}}class TK extends tT{constructor(e){super(e),this.services=e,this.documentFactory=e.workspace.LangiumDocumentFactory}documentFactory;async loadAdditionalDocuments(e,n){const r=this.services.workspace.ProjectsManager;for(const i of e)try{const s=await this.fileSystemProvider.readDirectory(_t.parse(i.uri));for(const a of s)
|
|
2022
|
-
try{await r.loadConfigFile(a)}catch(o){rf(o)}}catch(s){rf(s)}n(this.documentFactory.fromString(D_,_t.parse(
|
|
2022
|
+
try{await r.loadConfigFile(a)}catch(o){rf(o)}}catch(s){rf(s)}n(this.documentFactory.fromString(D_,_t.parse(CW))),await super.loadAdditionalDocuments(e,n)}includeEntry(e,n,r){return this.services.workspace.ProjectsManager.isConfigFile(n)?!1:n.isFile?!this.services.workspace.ProjectsManager.checkIfExcluded(n.uri):super.includeEntry(e,n,r)}workspace(){return this.folders&&v1(this.folders,1)?this.folders[0]:null}get workspaceUri(){const e=this.workspace();return Fe(e,"Workspace not initialized"),_t.
|
|
2023
2023
|
parse(e.uri)}get workspaceURL(){const e=this.workspace();return Fe(e,"Workspace not initialized"),new URL(e.uri)}}const SK=lt.getChild("LikeC4LanguageServices");class CK{constructor(e){this.services=e,this.views=e.likec4.Views,this.builder=e.likec4.ModelBuilder,this.projectsManager=e.shared.workspace.ProjectsManager}views;builder;projectsManager;get workspaceUri(){return this.services.shared.workspace.WorkspaceManager.workspaceUri}projects(){const e=this.services.shared.workspace.ProjectsManager,
|
|
2024
2024
|
n=et(this.services.shared.workspace.LangiumDocuments.groupedByProject(),Yc(),Ht(([s,a])=>{const o=s,{folder:u,config:c}=e.getProject(o);return{id:o,folder:u,config:c,documents:Ht(a,Ui("uri"))}}));if(Ar(n,1))return n;const{folder:r,config:i}=e.getProject(Tn.DefaultProjectId);return[{id:Tn.DefaultProjectId,folder:r,config:i,documents:null}]}async diagrams(){return await this.views.diagrams()}async computedModel(e){const n=this.projectsManager.ensureProjectId(e);return await this.builder.buildLikeC4Model(
|
|
2025
2025
|
n)}async layoutedModel(e){const n=this.projectsManager.ensureProjectId(e),r=await this.builder.parseModel(n);if(!r)throw new Error("Failed to parse model");const i=await this.views.diagrams(n);return ia.create({...r,__:"layouted",views:Xc(i,Ui("id"))})}getErrors(){return this.services.shared.workspace.LangiumDocuments.allExcludingBuiltin.toArray().flatMap(e=>(e.diagnostics??[]).filter(n=>n.severity===wa.Error).map(({message:n,range:r})=>({message:n,line:r.start.line,range:r,sourceFsPath:e.uri.fsPath})))}async notifyUpdate({
|
|
@@ -2045,7 +2045,7 @@ range;if(!a||!s)return[];const o=rn(i);return{range:{start:a.start,end:{line:a.s
|
|
|
2045
2045
|
$0
|
|
2046
2046
|
}`});break;case n.value==="autoLayout":r(e,{label:n.value,kind:Bt.Class,insertTextFormat:Gn.Snippet,insertText:"autoLayout ${1|TopBottom,BottomTop,LeftRight,RightLeft|}$0"});break;default:r(e,{label:n.value,kind:this.getKeywordCompletionItemKind(n),detail:"Keyword",sortText:"1"})}}}class OK extends rC{createDocumentHighlight(e){return Ee.DocumentHighlight.create(e.segment.range,Ee.DocumentHighlightKind.Read)}}class LK{constructor(e){this.services=e}async getDocumentLinks(e,n,r){return so(e)?gi(e.
|
|
2047
2047
|
parseResult.value).filter(bm).map(i=>{try{const s=Cn(i.$cstNode,"value")?.range,a=s&&this.resolveLink(e,i.value);if(a&&Fs(a))return{range:s,target:a}}catch(s){Ae(s)}return null}).nonNullable().toArray():[]}resolveLink(e,n){if(Fs(n)||sf(n))return n;if(Qw(n))return Om(e.uri.toString(),"../",n);const r=this.services.shared.workspace.ProjectsManager.getProject(e).folder;return Om(r.toString(),n)}relativeLink(e,n){if(sf(n))return x_(n);if(Qw(n)){const r=new URL(e.uri.toString(!0)),i=new URL(n,r).toString();
|
|
2048
|
-
return x_(
|
|
2048
|
+
return x_(FW(i,this.services.shared.workspace.WorkspaceManager.workspaceURL.toString()))}return null}}const Fx=lt.getChild("DocumentSymbolProvider");class FK{constructor(e){this.services=e,this.nodeKindProvider=e.shared.lsp.NodeKindProvider,this.parser=e.likec4.ModelParser,this.locator=e.likec4.ModelLocator,this.nameProvider=e.references.NameProvider}nodeKindProvider;nameProvider;parser;locator;async getSymbols(e,n,r){if(!so(e))return[];e.state<=Ze.Linked&&(Fx.debug(`Waiting for document ${e.uri.
|
|
2049
2049
|
path} to be Linked`),await this.services.shared.workspace.DocumentBuilder.waitUntil(Ze.Linked,e.uri,r),Fx.debug("document is Linked"));const{parseResult:{value:{specifications:i,models:s,deployments:a,views:o,likec4lib:u}}}=e;return[...u.map(c=>()=>this.getLikec4LibSymbol(c)),...i.map(c=>()=>this.getSpecSymbol(c)),...s.map(c=>()=>this.getModelSymbol(c)),...a.map(c=>()=>this.getDeploymentModelSymbol(c)),...o.map(c=>()=>this.getModelViewsSymbol(c))].flatMap(c=>{try{return c()??[]}catch(l){return Ae(
|
|
2050
2050
|
l),[]}})}getLikec4LibSymbol(e){const n=e?.$cstNode;if(!n)return[];const r=e.icons.map(i=>this.getLibIconSymbol(i)).filter(fe);return r.length===0?[]:[{kind:Ur.Namespace,name:"icons",range:n.range,selectionRange:bc(n,"icons")?.range??n.range,children:r}]}getSpecSymbol(e){const n=e?.$cstNode;if(!n)return[];const r=Cn(n,"name");if(!r)return[];const i=et([...e.elements,...e.tags,...e.relationships],Ht(s=>{try{if(cu(s)||du(s)||ou(s))return this.getKindSymbol(s);if(Am(s))return this.getTagSymbol(s)}catch(a){
|
|
2051
2051
|
return Ae(a),null}Ke(s)}),Qe(fe));return i.length===0?[]:[{kind:Ur.Namespace,name:e.name,range:n.range,selectionRange:r.range,children:i}]}getModelSymbol(e){const n=e.$cstNode;if(!n)return[];const r=Cn(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=Cn(n,"name");return r?[{kind:this.symbolKind(e),name:e.name,range:n.range,
|
|
@@ -2056,8 +2056,8 @@ return r?[{kind:this.symbolKind(e),name:r.text,range:n.range,selectionRange:r.ra
|
|
|
2056
2056
|
range,detail:s,children:e.body?.elements.flatMap(a=>this.getDeploymentElementSymbol(a))??[]}]}getDeployedInstanceSymbol(e){const n=e.$cstNode,r=this.nameProvider.getNameNode(e);if(!r||!n)return[];const i=vt(e),s=this.parser.forDocument(i).parseDeployedInstance(e),a=this.nameProvider.getNameStrict(e),o="instance of "+s.element;return[{kind:this.symbolKind(e),name:a,range:n.range,selectionRange:r.range,detail:o,children:[]}]}symbolKind(e){return this.nodeKindProvider.getSymbolKind(e)}}class MK extends oC{parser;locator;constructor(e){
|
|
2057
2057
|
super(e),this.parser=e.likec4.ModelParser,this.locator=e.likec4.ModelLocator}getAstNodeHoverContent(e){if(g_(e))return{contents:{kind:"markdown",value:"tag `"+e.name+"`"}};if(ar(e)){const n=vt(e),r=this.parser.forDocument(n).parseDeploymentNode(e),i=[r.id+" "];return r.title!==e.name&&i.push(`### ${r.title}`),i.push("deployment node `"+r.kind+"` "),{contents:{kind:"markdown",value:i.join(`
|
|
2058
2058
|
`)}}}if(yr(e)){const n=vt(e),r=this.parser.forDocument(n).parseDeployedInstance(e),[i,s]=Ln.isImportRef(r.element)?[r.element.project,r.element.model]:[n.likec4ProjectId,r.element.model],a=i?this.locator.getParsedElement(s,i):this.locator.getParsedElement(s),o=[r.id+" ",`instance of \`${r.element}\``];return a&&o.push(`### ${a.title}`,"element kind `"+a.kind+"` "),{contents:{kind:"markdown",value:o.join(`
|
|
2059
|
-
`)}}}if(t_(e))return{contents:{kind:"markdown",value:"element kind `"+e.name+"`"}};if(
|
|
2060
|
-
`)}}:void 0}}}class jK extends hz{highlightElement(e,n){if(_n(e)||ar(e)||yr(e))return this.highlightNameAndKind(e,n);if(kw(e))return this.highlightView(e,n);if(
|
|
2059
|
+
`)}}}if(t_(e))return{contents:{kind:"markdown",value:"element kind `"+e.name+"`"}};if(oW(e))return{contents:{kind:"markdown",value:"deployment node `"+e.name+"`"}};if(_n(e)){const n=this.locator.getParsedElement(e);return n?{contents:{kind:"markdown",value:[n.id,`### ${n.title}`,"element kind `"+n.kind+"` "].join(`
|
|
2060
|
+
`)}}:void 0}}}class jK extends hz{highlightElement(e,n){if(_n(e)||ar(e)||yr(e))return this.highlightNameAndKind(e,n);if(kw(e))return this.highlightView(e,n);if(yW(e))return n({node:e,property:"name",type:Je.function});if(fW(e))return n({node:e,property:"name",type:Je.type,modifier:[ut.definition]}),"prune";if((os(e)||f_(e)||Ri(e))&&"kind"in e&&n({node:e,property:"kind",type:Je.function}),km(e)||Cd(e))return n({node:e,property:"key",type:Je.property}),n({node:e,property:"value",type:Je.interface,
|
|
2061
2061
|
modifier:[ut.definition,ut.readonly]}),"prune";if(Lw(e)||k_(e))return n({cst:e.$cstNode,type:Je.variable,modifier:[ut.definition,ut.readonly]}),"prune";if(v_(e)&&fe(e.value)){n({node:e,property:"value",type:Je.function});return}if((WC(e)||VC(e))&&fe(e.value)){n({node:e,property:"value",type:Je.type,modifier:[ut.definition,ut.readonly]});return}if((b_(e)||E_(e))&&n({node:e,property:"participant",type:Je.keyword}),n_(e)&&fe(e.kind)){n({node:e,property:"kind",type:Je.type,modifier:[ut.definition]});
|
|
2062
2062
|
return}if(Za(e)||tu(e)){n({node:e,property:"id",type:Je.variable,modifier:[ut.definition,ut.readonly]});return}if(Xw(e)){n({node:e,property:"style",type:Je.variable,modifier:[ut.definition,ut.readonly]});return}if(ud(e)||od(e)){n({node:e,property:"name",type:Je.variable,modifier:[ut.definition,ut.readonly]});return}if(Zw(e)){n({node:e,property:"predicate",type:Je.variable,modifier:[ut.definition,ut.readonly]});return}if(r_(e)&&fe(e.tag)){n({node:e,property:"tag",type:Je.type,modifier:[ut.definition]});
|
|
2063
2063
|
return}if(a_(e)||m_(e))return n({node:e,property:"value",type:Je.variable,modifier:[ut.definition,ut.readonly]}),e.parent?void 0:"prune";if(Ww(e))return n({node:e,property:"el",type:Je.variable,modifier:[ut.definition,ut.readonly]}),e.parent?void 0:"prune";if(_m(e)){n({node:e,keyword:"color",type:Je.keyword}),n({node:e,property:"name",type:Je.type,modifier:[ut.declaration,ut.readonly]});return}if((cu(e)||du(e)||ou(e))&&n({node:e,property:"kind",type:Je.type,modifier:[ut.declaration,ut.readonly]}),
|
|
@@ -2144,7 +2144,7 @@ setResourceRequestHandlers(),this.sendResourceListChanged(),a}}tool(e,...n){if(t
|
|
|
2144
2144
|
o.name&&(this._registeredTools[o.name]=a)),typeof o.description<"u"&&(a.description=o.description),typeof o.paramsSchema<"u"&&(a.inputSchema=C.object(o.paramsSchema)),typeof o.callback<"u"&&(a.callback=o.callback),typeof o.enabled<"u"&&(a.enabled=o.enabled),this.sendToolListChanged()}};return this._registeredTools[e]=a,this.setToolRequestHandlers(),this.sendToolListChanged(),a}prompt(e,...n){if(this._registeredPrompts[e])throw new Error(`Prompt ${e} is already registered`);let r;typeof n[0]=="st\
|
|
2145
2145
|
ring"&&(r=n.shift());let i;n.length>1&&(i=n.shift());const s=n[0],a={description:r,argsSchema:i===void 0?void 0:C.object(i),callback:s,enabled:!0,disable:()=>a.update({enabled:!1}),enable:()=>a.update({enabled:!0}),remove:()=>a.update({name:null}),update:o=>{typeof o.name<"u"&&o.name!==e&&(delete this._registeredPrompts[e],o.name&&(this._registeredPrompts[o.name]=a)),typeof o.description<"u"&&(a.description=o.description),typeof o.argsSchema<"u"&&(a.argsSchema=C.object(o.argsSchema)),typeof o.callback<
|
|
2146
2146
|
"u"&&(a.callback=o.callback),typeof o.enabled<"u"&&(a.enabled=o.enabled),this.sendPromptListChanged()}};return this._registeredPrompts[e]=a,this.setPromptRequestHandlers(),this.sendPromptListChanged(),a}isConnected(){return this.server.transport!==void 0}sendResourceListChanged(){this.isConnected()&&this.server.sendResourceListChanged()}sendToolListChanged(){this.isConnected()&&this.server.sendToolListChanged()}sendPromptListChanged(){this.isConnected()&&this.server.sendPromptListChanged()}}const P7={
|
|
2147
|
-
type:"object"};function N7(t){return Object.entries(t.shape).map(([e,n])=>({name:e,description:n.description,required:!n.isOptional()}))}function Hx(t){return{completion:{values:t.slice(0,100),total:t.length,hasMore:t.length>100}}}const vg={completion:{values:[],hasMore:!1}},I7="1.
|
|
2147
|
+
type:"object"};function N7(t){return Object.entries(t.shape).map(([e,n])=>({name:e,description:n.description,required:!n.isOptional()}))}function Hx(t){return{completion:{values:t.slice(0,100),total:t.length,hasMore:t.length>100}}}const vg={completion:{values:[],hasMore:!1}},I7="1.30.0",O7={version:I7};var u0,Vx;function L7(){return Vx||(Vx=1,u0=t=>{const e=t.match(/^[ \t]*(?=\S)/gm);return e?e.reduce((n,r)=>Math.min(n,r.length),1/0):0}),u0}var F7=L7();const M7=fi(F7);function Su(t){const e=M7(t);
|
|
2148
2148
|
if(e===0)return t;const n=new RegExp(`^[ \\t]{${e}}`,"gm");return t.replace(n,"")}const uo=["this","it","self","super","likec4lib","global"];function kt(t){return async function(e,n,r){try{const i=t(e,n,r);EU(i)&&await i;return}catch(i){const s=i instanceof Error?i.message:String(i);n("error",`Validation failed: ${s}`,{node:e}),lt.debug(`Validation failed: ${s}`,{error:i})}}}const{getDocument:j7}=Eo,B7=t=>{const e=t.likec4.DeploymentsIndex,n=t.references.NameProvider;return kt((r,i)=>{const s=n.
|
|
2149
2149
|
getName(r);if(!s){i("error","DeploymentNode must be named",{node:r});return}const a=Vt(n.getNameNode(r),"name CstNode not found").range;uo.includes(s)&&i("error",`Reserved word: ${s}`,{node:r,range:a});const o=rn(r),u=e.getFqn(r);e.byFqn(o,u).limit(2).toArray().length>1&&i("error",`Duplicate node name "${u}"`,{node:r,range:a})})},q7=t=>{const e=t.likec4.DeploymentsIndex,n=t.references.NameProvider;return kt((r,i)=>{const s=n.getName(r);if(!s){i("error","Deployed instance must be named, unique in\
|
|
2150
2150
|
side node",{node:r});return}const a=Vt(n.getNameNode(r),"name CstNode not found").range;uo.includes(s)&&i("error",`Reserved word: ${s}`,{node:r,range:a});const o=rn(r),u=e.getFqn(r);e.byFqn(o,u).limit(2).toArray().length>1&&i("error",`Duplicate instance name "${u}"`,{node:r,range:a})})},G7=t=>{const e=t.likec4.ModelParser;return kt((n,r)=>{if(!n.target?.value?.ref){let u=n.target?.$cstNode?.text??"";r("error",`DeploymentRelation target '${u}' not resolved`,{node:n,property:"target"});return}const i=j7(
|
|
@@ -2153,31 +2153,32 @@ on cannot refer imported model (not implemented yet)",{node:n,property:"target"}
|
|
|
2153
2153
|
const i=ao(n.source),s=i&&e.getFqn(i);s||r("error","Source not found (not parsed/indexed yet)",{node:n,property:"source"});const a=ao(n.target),o=a&&e.getFqn(a);o||r("error","Target not found (not parsed/indexed yet)",{node:n,property:"target"}),s&&o&&(Dg(s,o)||Dg(o,s))&&r("error","Invalid parent-child relationship",{node:n})})},{getDocument:W7}=Eo,H7=t=>{const e=t.likec4.FqnIndex,n=t.workspace.AstNodeLocator;return kt((r,i)=>{const s=e.getFqn(r);if(!s){i("error","Not indexed element",{node:r,property:"\
|
|
2154
2154
|
name"});return}uo.includes(r.name)&&i("error",`Reserved word: ${r.name}`,{node:r,property:"name"});const a=W7(r),o=a.uri,u=n.getAstNodePath(r),c=e.byFqn(rn(a),s).filter(l=>l.documentUri!==o||l.path!==u).head();if(c){const l=c.documentUri!==o;i("error",`Duplicate element name ${r.name!==s?r.name+" ("+s+")":r.name}`,{node:r,property:"name",...l&&{relatedInformation:[{location:{range:c.nameSegment?.range??c.selectionSegment?.range,uri:c.documentUri.toString()},message:"conflicting element"}]}})}})},
|
|
2155
2155
|
V7=t=>kt((e,n)=>{PK(e.modelElement)&&n("error","Only model elements allowed here",{node:e,property:"modelElement"})}),{getDocument:K7}=Eo,Z7=t=>{const e=t.shared.workspace.ProjectsManager;return kt((n,r)=>{const i=K7(n),s=rn(i);if(n.project===s){r("error","Imported project cannot be the same as the current project",{node:n,property:"project"});return}if(!e.all.includes(n.project)){r("error","Imported project not found",{node:n,property:"project"});return}})},X7=t=>(t.likec4.FqnIndex,kt((e,n)=>{})),
|
|
2156
|
-
Y7=t=>kt((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"})}),J7=t=>(e,n)=>{const r=e.$container;r.props.some(i=>Ns(i)&&i!==e)&&n("error","Icon must be defined once",{node:e}),Zo(r)&&sm(r.$container)&&r.$container.props.some(i=>Ns(i))&&n("warning","Redundant as icon defined on element",{node:e})
|
|
2157
|
-
likec4.ModelParser;return kt((n,r)=>{const i=e.forDocument(vt(n)),s=Lx(()=>i._resolveRelationSource(n));if(!s){r("error","Source not resolved",{node:n,property:"source"});return}const a=Lx(()=>i.parseFqnRef(n.target));if(!a){r("error","Target not resolved",{node:n,property:"target"});return}Ln.isImportRef(s)&&(Ln.isImportRef(a)?r("warning","Relationship between imported elements may not be visible in
|
|
2158
|
-
not be visible in origin project",{node:n,property:"source"})),x0(Ln.toModelFqn(s),Ln.toModelFqn(a))&&r("error","Invalid parent-child relationship",{node:n})})},tZ=t=>kt((e,n)=>{e.$container.tags?.values&&e.tags?.values&&n("error","Relation cannot have tags in both header and body",{node:e.tags})}),nZ=t=>kt((e,n)=>{e.$containerIndex&&e.$containerIndex>0&&n("warning","Prefer one specification per
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
'${n.name}'`,{node:n,property:"name",...a&&{relatedInformation:[{location:{range:s.nameSegment.range,uri:s.documentUri.toString()},message:"conflicting definition"}]}})}})},oZ=t=>{const e=t.shared.workspace.IndexManager;return kt((n,r)=>{const i="#"+n.name,s=rn(n),a=e.projectElements(s,Ls).filter(o=>o.name===i&&o.node!==n).head();if(a){const o=a.documentUri!==vt(n).uri;r("error",`Duplicate tag '${n.name}'`,{node:n,
|
|
2162
|
-
documentUri.toString()},message:"conflicting definition"}]}})}})},uZ=t=>{const e=t.shared.workspace.IndexManager;return kt((n,r)=>{uo.includes(n.name)&&r("error",`Reserved word: ${n.name}`,{node:n,property:"name"});const i=rn(n);e.projectElements(i,Os).filter(s=>s.name===n.name).limit(2).count()>1&&r("error",`Duplicate RelationshipKind '${n.name}'`,{node:n,property:"name"})})},Kx=t=>{const e=t.shared.workspace.
|
|
2163
|
-
i,Jo);s.concat(a).filter(o=>o.name===n.name).limit(2).count()>1&&r("error",`Duplicate GlobalPredicateGroup or GlobalDynamicPredicateGroup name '${n.name}'`,{node:n,property:"name"})})},cZ=t=>{const e=t.shared.workspace.IndexManager;return kt((n,r)=>{const i=rn(n);e.projectElements(i,cd).filter(s=>s.name===n.name).limit(2).count()>1&&r("error",`Duplicate GlobalStyleId name '${n.name}'`,{node:n,property:"
|
|
2164
|
-
uo.includes(n.name)&&r("error",`Reserved word: ${n.name}`,{node:n,property:"name"});const i=rn(n);e.projectElements(i,za).filter(s=>s.name===n.name).limit(2).count()>1&&r("error",`Duplicate view '${n.name}'`,{node:n,property:"name"})})},dZ=t=>{const e=t.likec4.ModelParser;return kt((n,r)=>{const i=gg(n);if(i?.$type!=="DynamicViewIncludePredicate"&&i?.isInclude!==!0){r("error",'Invalid usage inside "exclude
|
|
2165
|
-
let o=vn.unwrap(a.parseFqnExprWith(n).custom.expr);switch(!0){case(vn.isWildcard(o)&&s):case(vn.isElementKindExpr(o)&&s):case(vn.isElementTagExpr(o)&&s):{r("warning","Predicate is ignored, as not supported in dynamic views",{node:n});return}case vn.isWildcard(o):case vn.isModelRef(o):case vn.isDeploymentRef(o):return;case vn.isElementKindExpr(o):case vn.isElementTagExpr(o):r("error","Invalid target (expect
|
|
2166
|
-
const e=t.likec4.ModelParser;return kt((n,r)=>{const i=e.forDocument(vt(n)).parseFqnRefExpr(n),s=gg(n),a=vK(n)&&!mi(n,o=>Kl(o)||pu(o));if(s?.$type==="DeploymentViewRulePredicate"||a){if(!mi(n,jp)){if(vn.isModelRef(i)){r("error","Deployment view predicate must reference deployment model",{node:n});return}if(vn.isDeploymentRef(i)&&Ln.isInsideInstanceRef(i.ref)){r("error","Must reference deployment nodes
|
|
2167
|
-
|
|
2168
|
-
all relationships",{node:e})}}),pZ=t=>kt((e,n)=>{if(gg(e)?.$type==="ViewRulePredicate"&&e.$container.$type!=="DirectedRelationExpr"&&e.from.$type==="WildcardExpression"){const r=cr(e,om);r&&Ft(r.viewOf)&&n("warning","Predicate is ignored as it concerns all relationships",{node:e})}}),mZ=t=>{const e=t.likec4.ModelParser;return kt((n,r)=>{const i=cr(n,Vo);if(!i||i.isInclude!==!0)return;const s=vt(n),a=e.forDocument(
|
|
2169
|
-
|
|
2170
|
-
Aw,Vz,Vo,Zz,jp,Lw,Qz,Dw,Hw,
|
|
2171
|
-
{DeployedInstance:q7(t),DeploymentNodeKind:aZ(t),DeploymentNode:B7(t),DeploymentRelation:G7(t),ExtendDeployment:U7(),FqnRefExpr:fZ(t),RelationExpr:mZ(t),NotesProperty:Q7(),OpacityProperty:Y7(),IconProperty:J7(),SpecificationRule:nZ(),Model:rZ(),Globals:iZ(),GlobalPredicateGroup:Kx(t),GlobalDynamicPredicateGroup:Kx(t),GlobalStyleId:cZ(t),DynamicViewStep:z7(t),LikeC4View:lZ(t),Element:H7(t),ElementRef:V7(),ElementKind:sZ(t),
|
|
2172
|
-
RelationshipKind:uZ(t),IncomingRelationExpr:hZ(),OutgoingRelationExpr:pZ(),ImportsFromPoject:Z7(t),Imported:X7(t)});const e=t.shared.lsp.Connection;e&&t.shared.workspace.DocumentBuilder.onUpdate((n,r)=>{for(const i of r)lt.debug(`clear diagnostics for deleted ${i.path}`),e.sendDiagnostics({uri:i.toString(),diagnostics:[]})})}function ii(t){return Un(t)?St(t).split(`
|
|
2156
|
+
Y7=t=>kt((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"})}),J7=t=>(e,n)=>{const r=e.$container;r.props.some(i=>Ns(i)&&i!==e)&&n("error","Icon must be defined once",{node:e}),Zo(r)&&sm(r.$container)&&r.$container.props.some(i=>Ns(i))&&n("warning","Redundant as icon defined on element",{node:e}),e.value?.startsWith("file://")&&n("error","Icon URI must not start with file://",{node:e,property:"value"})},Q7=t=>(e,n)=>{
|
|
2157
|
+
mi(e,Aw)||n("error","Notes can be defined only inside dynamic view",{node:e})},eZ=t=>{const e=t.likec4.ModelParser;return kt((n,r)=>{const i=e.forDocument(vt(n)),s=Lx(()=>i._resolveRelationSource(n));if(!s){r("error","Source not resolved",{node:n,property:"source"});return}const a=Lx(()=>i.parseFqnRef(n.target));if(!a){r("error","Target not resolved",{node:n,property:"target"});return}Ln.isImportRef(s)&&(Ln.isImportRef(a)?r("warning","Relationship between imported elements may not be visible in \
|
|
2158
|
+
origin projects",{node:n}):r("warning","Relationship from imported element to local element may not be visible in origin project",{node:n,property:"source"})),x0(Ln.toModelFqn(s),Ln.toModelFqn(a))&&r("error","Invalid parent-child relationship",{node:n})})},tZ=t=>kt((e,n)=>{e.$container.tags?.values&&e.tags?.values&&n("error","Relation cannot have tags in both header and body",{node:e.tags})}),nZ=t=>kt((e,n)=>{e.$containerIndex&&e.$containerIndex>0&&n("warning","Prefer one specification per docum\
|
|
2159
|
+
ent",{node:e,property:"name"})}),rZ=t=>kt((e,n)=>{e.$containerIndex&&e.$containerIndex>0&&n("warning","Prefer one model per document",{node:e,property:"name"})}),iZ=t=>kt((e,n)=>{e.$containerIndex&&e.$containerIndex>0&&n("warning","Prefer one global block per document",{node:e,property:"name"})}),sZ=t=>{const e=t.shared.workspace.IndexManager;return kt((n,r)=>{uo.includes(n.name)&&r("error",`Reserved word: ${n.name}`,{node:n,property:"name"});const i=rn(n),s=e.projectElements(i,is).filter(a=>a.name===
|
|
2160
|
+
n.name&&a.node!==n).head();if(s){const a=s.documentUri!==vt(n).uri;r("error",`Duplicate element kind '${n.name}'`,{node:n,property:"name",...a&&{relatedInformation:[{location:{range:s.nameSegment.range,uri:s.documentUri.toString()},message:"conflicting definition"}]}})}})},aZ=t=>{const e=t.shared.workspace.IndexManager;return kt((n,r)=>{uo.includes(n.name)&&r("error",`Reserved word: ${n.name}`,{node:n,property:"name"});const i=rn(n),s=e.projectElements(i,rs).filter(a=>a.name===n.name&&a.node!==n).
|
|
2161
|
+
head();if(s){const a=s.documentUri!==vt(n).uri;r("error",`Duplicate deploymentNode kind '${n.name}'`,{node:n,property:"name",...a&&{relatedInformation:[{location:{range:s.nameSegment.range,uri:s.documentUri.toString()},message:"conflicting definition"}]}})}})},oZ=t=>{const e=t.shared.workspace.IndexManager;return kt((n,r)=>{const i="#"+n.name,s=rn(n),a=e.projectElements(s,Ls).filter(o=>o.name===i&&o.node!==n).head();if(a){const o=a.documentUri!==vt(n).uri;r("error",`Duplicate tag '${n.name}'`,{node:n,
|
|
2162
|
+
property:"name",...o&&{relatedInformation:[{location:{range:a.nameSegment.range,uri:a.documentUri.toString()},message:"conflicting definition"}]}})}})},uZ=t=>{const e=t.shared.workspace.IndexManager;return kt((n,r)=>{uo.includes(n.name)&&r("error",`Reserved word: ${n.name}`,{node:n,property:"name"});const i=rn(n);e.projectElements(i,Os).filter(s=>s.name===n.name).limit(2).count()>1&&r("error",`Duplicate RelationshipKind '${n.name}'`,{node:n,property:"name"})})},Kx=t=>{const e=t.shared.workspace.
|
|
2163
|
+
IndexManager;return kt((n,r)=>{const i=rn(n),s=e.projectElements(i,Qo),a=e.projectElements(i,Jo);s.concat(a).filter(o=>o.name===n.name).limit(2).count()>1&&r("error",`Duplicate GlobalPredicateGroup or GlobalDynamicPredicateGroup name '${n.name}'`,{node:n,property:"name"})})},cZ=t=>{const e=t.shared.workspace.IndexManager;return kt((n,r)=>{const i=rn(n);e.projectElements(i,cd).filter(s=>s.name===n.name).limit(2).count()>1&&r("error",`Duplicate GlobalStyleId name '${n.name}'`,{node:n,property:"nam\
|
|
2164
|
+
e"})})},lZ=t=>{const e=t.shared.workspace.IndexManager;return kt((n,r)=>{if(!n.name)return;uo.includes(n.name)&&r("error",`Reserved word: ${n.name}`,{node:n,property:"name"});const i=rn(n);e.projectElements(i,za).filter(s=>s.name===n.name).limit(2).count()>1&&r("error",`Duplicate view '${n.name}'`,{node:n,property:"name"})})},dZ=t=>{const e=t.likec4.ModelParser;return kt((n,r)=>{const i=gg(n);if(i?.$type!=="DynamicViewIncludePredicate"&&i?.isInclude!==!0){r("error",'Invalid usage inside "exclude\
|
|
2165
|
+
"',{node:n});return}const s=i.$type==="DynamicViewIncludePredicate",a=e.forDocument(vt(i));let o=vn.unwrap(a.parseFqnExprWith(n).custom.expr);switch(!0){case(vn.isWildcard(o)&&s):case(vn.isElementKindExpr(o)&&s):case(vn.isElementTagExpr(o)&&s):{r("warning","Predicate is ignored, as not supported in dynamic views",{node:n});return}case vn.isWildcard(o):case vn.isModelRef(o):case vn.isDeploymentRef(o):return;case vn.isElementKindExpr(o):case vn.isElementTagExpr(o):r("error","Invalid target (expect\
|
|
2166
|
+
reference to specific element)",{node:n,property:"subject"});return;default:Ke(o)}})},fZ=t=>{const e=t.likec4.ModelParser;return kt((n,r)=>{const i=e.forDocument(vt(n)).parseFqnRefExpr(n),s=gg(n),a=vK(n)&&!mi(n,o=>Kl(o)||pu(o));if(s?.$type==="DeploymentViewRulePredicate"||a){if(!mi(n,jp)){if(vn.isModelRef(i)){r("error","Deployment view predicate must reference deployment model",{node:n});return}if(vn.isDeploymentRef(i)&&Ln.isInsideInstanceRef(i.ref)){r("error","Must reference deployment nodes o\
|
|
2167
|
+
r instances, but not internals",{node:n});return}}fe(n.selector)&&!ar(n.ref.value?.ref)&&r("warning",`Selector '${n.selector}' applies to deployment nodes only, ignored here`,{node:n,property:"selector"});return}if(s?.$type==="DynamicViewIncludePredicate")switch(!0){case vn.isElementKindExpr(i):case vn.isElementTagExpr(i):case vn.isWildcard(i):{r("warning","Predicate is ignored, as not supported in dynamic views",{node:n});return}}})},hZ=t=>kt((e,n)=>{if(e.to.$type==="WildcardExpression"&&!o_(e.
|
|
2168
|
+
$container)){const r=cr(e,om);Ft(r?.viewOf)&&n("warning","Predicate is ignored as it concerns all relationships",{node:e})}}),pZ=t=>kt((e,n)=>{if(gg(e)?.$type==="ViewRulePredicate"&&e.$container.$type!=="DirectedRelationExpr"&&e.from.$type==="WildcardExpression"){const r=cr(e,om);r&&Ft(r.viewOf)&&n("warning","Predicate is ignored as it concerns all relationships",{node:e})}}),mZ=t=>{const e=t.likec4.ModelParser;return kt((n,r)=>{const i=cr(n,Vo);if(!i||i.isInclude!==!0)return;const s=vt(n),a=e.forDocument(
|
|
2169
|
+
s);let o=Hf.unwrap(a.parseRelationExpr(n));const u="Model reference is allowed in exclude predicate only";if(Hf.isDirect(o)){(vn.isModelRef(o.source)||vn.isModelRef(o.target))&&r("error",u,{node:n});return}let c;if(Hf.isIncoming(o)?c=o.incoming:Hf.isOutgoing(o)?c=o.outgoing:c=o.inout,vn.isModelRef(c)){r("error",u,{node:n});return}})},gZ=t=>kt((e,n)=>{const r=gg(e);if(!(!r||r.$type=="DynamicViewIncludePredicate")&&!r.isInclude){n("error",'Invalid usage inside "exclude"',{node:e});return}});function yZ(t){
|
|
2170
|
+
return e=>t.some(n=>n(e))}const vZ=yZ([Mw,ss,Fw,ud,od,tu,Za,hm,Gw,BC,jp,Cw,Aw,Vz,Vo,Zz,jp,Lw,Qz,Dw,Hw,eW,vw,kw,Tw,yr,ar,Ri,UC,Ps,os,Kz,zC,km,_n,xw,Yo,Va,cu,du,ou,Am,_m,p_]),wZ=t=>{let e=t;for(;e&&!u_(e);){if(vZ(e))return e;e=e.$container}};function bZ(t){const e=t.state>=Ze.Validated?t.diagnostics?.filter(r=>r.severity===wa.Error)??[]:[],n=new WeakSet;for(const{node:r}of e){if(Ft(r)||n.has(r))continue;n.add(r);const i=wZ(r);i&&n.add(i)}return{isValid:r=>!n.has(r),invalidNodes:n}}function EZ(t){lt.
|
|
2171
|
+
debug("registerValidationChecks"),t.validation.ValidationRegistry.register({DeployedInstance:q7(t),DeploymentNodeKind:aZ(t),DeploymentNode:B7(t),DeploymentRelation:G7(t),ExtendDeployment:U7(),FqnRefExpr:fZ(t),RelationExpr:mZ(t),NotesProperty:Q7(),OpacityProperty:Y7(),IconProperty:J7(),SpecificationRule:nZ(),Model:rZ(),Globals:iZ(),GlobalPredicateGroup:Kx(t),GlobalDynamicPredicateGroup:Kx(t),GlobalStyleId:cZ(t),DynamicViewStep:z7(t),LikeC4View:lZ(t),Element:H7(t),ElementRef:V7(),ElementKind:sZ(t),
|
|
2172
|
+
Relation:eZ(t),RelationBody:tZ(),Tag:oZ(t),FqnExprWith:dZ(t),RelationExprWith:gZ(),RelationshipKind:uZ(t),IncomingRelationExpr:hZ(),OutgoingRelationExpr:pZ(),ImportsFromPoject:Z7(t),Imported:X7(t)});const e=t.shared.lsp.Connection;e&&t.shared.workspace.DocumentBuilder.onUpdate((n,r)=>{for(const i of r)lt.debug(`clear diagnostics for deleted ${i.path}`),e.sendDiagnostics({uri:i.toString(),diagnostics:[]})})}function ii(t){return Un(t)?St(t).split(`
|
|
2173
2173
|
`).join(" "):void 0}function St(t){return Un(t)?Su(t).trim():void 0}class kZ{constructor(e,n){this.services=e,this.doc=n,this.isValid=bZ(n).isValid}isValid;get project(){return this.services.shared.workspace.ProjectsManager.getProject(this.doc)}resolveFqn(e){if(ss(e)){const n=rn(e),r=this.resolveFqn(Vt(e.imported.ref,`FqnRef is empty of imported: ${e.$cstNode?.text}`));return this.doc.c4Imports.set(n,r),E1(n,r)}return Yo(e)?oo(e.element):Va(e)?oo(e.deploymentNode):Pp(e)?this.services.likec4.DeploymentsIndex.
|
|
2174
2174
|
getFqn(e):this.services.likec4.FqnIndex.getFqn(e)}getAstNodePath(e){return this.services.workspace.AstNodeLocator.getAstNodePath(e)}getMetadata(e){if(!e||!this.isValid(e)||tn(e.props))return;const n=et(e.props,Ht(r=>[r.key,St(r.value)]),Qe(([r,i])=>fe(i)),OU());return tn(n)?void 0:n}convertTags(e){return this.parseTags(e)}parseTags(e){let n=e?.tags;if(!n)return null;let r=[];for(;n;){try{if(this.isValid(n)){const i=n.values.map(s=>s.ref?.name).filter(fe);i.length>0&&r.push(...i)}}catch{}n=n.prev}
|
|
2175
2175
|
return r=jo(r.reverse()),ur(r)?r:null}convertLinks(e){return this.parseLinks(e)}parseLinks(e){if(!(!e?.props||e.props.length===0))return et(e.props,Qe(bm),Wr(n=>{if(!this.isValid(n))return[];const r=n.value;if(fe(r)){const i=fe(n.title)?ii(n.title):void 0,s=this.services.lsp.DocumentLinkProvider.relativeLink(this.doc,r);return{url:r,...i&&{title:i},...s&&s!==r&&{relative:s}}}return[]}))}parseIconProperty(e){if(!e||!this.isValid(e))return;const{libicon:n,value:r}=e;switch(!0){case!!n:return n.ref?.
|
|
2176
|
-
name;case(r&&r==="none"):return r;case(r&&Fs(r)):return r;case(r&&Qw(r)):return Om(this.doc.uri.toString(),"../",r);case(r&&sf(r)):return P_(this.project.folder.toString(),r);default:return}}parseElementStyle(e){if(!e)return{};if($T(e)){const n=this.parseStyleProps(e?.find(Zo)?.props),r=this.parseIconProperty(e?.find(Ns));return r&&(n.icon=r),n}return this.parseStyleProps(e.props)}parseStyleProps(e){const n={};if(!e||e.length===0)return n;for(const r of e)if(this.isValid(
|
|
2177
|
-
fe(r.value)&&(n.border=r.value);break}case Wa(r):{const i=Nf(r);fe(i)&&(n.color=i);break}case Sm(r):{fe(r.value)&&(n.shape=r.value);break}case Ns(r):{const i=this.parseIconProperty(r);fe(i)&&(n.icon=i);break}case Rm(r):{n.opacity=Ix(r);break}case jw(r):{n.multiple=Zv(r.value)?r.value:!1;break}case Uw(r):{fe(r.value)&&(n.size=Tu(r));break}case Bw(r):{fe(r.value)&&(n.padding=Tu(r));break}case Vw(r):{fe(r.value)&&(n.textSize=Tu(r));break}default:Ke(r)}return n}}function RZ(t,e,n){
|
|
2178
|
-
parent?{id:e.parent.id,title:e.parent.title,kind:e.parent.kind}:null,projectId:n,title:e.title,kind:e.kind,shape:e.shape,technology:e.technology,description:e.description,tags:e.tags,children:Ou(Lu(e.children(),r=>({id:r.id,title:r.title,kind:e.kind}))),relations:{incoming:Ou(Lu(e.incoming(),r=>({id:r.id,title:r.title,description:r.description,technology:r.technology,source:{id:r.source.id,title:r.source.title,kind:r.source.kind},...r.target.id===e.id?{type:"direct"}:{type:"
|
|
2179
|
-
target:{id:r.target.id,title:r.target.title,kind:r.target.kind}}}))),outgoing:Ou(Lu(e.outgoing(),r=>({id:r.id,title:r.title,description:r.description,technology:r.technology,target:{id:r.target.id,title:r.target.title,kind:r.target.kind},...r.source.id===e.id?{type:"direct"}:{type:"implicit, from nested",source:{id:r.source.id,title:r.source.title,kind:r.source.kind}}})))},views:Ou(Lu(e.views(),r=>({id:r.id,title:r.title}))),sourceFile:t.locate({element:e.id,projectId:n})}}function $Z(t,e,n){
|
|
2180
|
-
id:e.id,title:e.title,projectId:n,viewType:e.__,description:e.$view.description??"",tags:e.tags,nodes:Ou(Lu(e.nodes(),r=>({id:r.id,title:r.title,represents:r.element?{element:r.element.id}:{}}))),sourceFile:t.locate({view:e.id,projectId:n})}}const Zx=lt.getChild("LikeC4MCPServices");function co(t){const e=ii(t)?.replaceAll('"',"'");return e?`"${e}"`:"null"}function Xx(t,e,n){const r=[...t];return r.length===0?[e]:Wr(r,n)}var Yx;(t=>(t.instructions=`This server provides access to LikeC4
|
|
2176
|
+
name;case(r&&r==="none"):return r;case(r&&Fs(r)):return r.startsWith("file:")?void 0:r;case(r&&Qw(r)):return Om(this.doc.uri.toString(),"../",r);case(r&&sf(r)):return P_(this.project.folder.toString(),r);default:return}}parseElementStyle(e){if(!e)return{};if($T(e)){const n=this.parseStyleProps(e?.find(Zo)?.props),r=this.parseIconProperty(e?.find(Ns));return r&&(n.icon=r),n}return this.parseStyleProps(e.props)}parseStyleProps(e){const n={};if(!e||e.length===0)return n;for(const r of e)if(this.isValid(
|
|
2177
|
+
r))switch(!0){case Vp(r):{fe(r.value)&&(n.border=r.value);break}case Wa(r):{const i=Nf(r);fe(i)&&(n.color=i);break}case Sm(r):{fe(r.value)&&(n.shape=r.value);break}case Ns(r):{const i=this.parseIconProperty(r);fe(i)&&(n.icon=i);break}case Rm(r):{n.opacity=Ix(r);break}case jw(r):{n.multiple=Zv(r.value)?r.value:!1;break}case Uw(r):{fe(r.value)&&(n.size=Tu(r));break}case Bw(r):{fe(r.value)&&(n.padding=Tu(r));break}case Vw(r):{fe(r.value)&&(n.textSize=Tu(r));break}default:Ke(r)}return n}}function RZ(t,e,n){
|
|
2178
|
+
return{id:e.id,parent:e.parent?{id:e.parent.id,title:e.parent.title,kind:e.parent.kind}:null,projectId:n,title:e.title,kind:e.kind,shape:e.shape,technology:e.technology,description:e.description,tags:e.tags,children:Ou(Lu(e.children(),r=>({id:r.id,title:r.title,kind:e.kind}))),relations:{incoming:Ou(Lu(e.incoming(),r=>({id:r.id,title:r.title,description:r.description,technology:r.technology,source:{id:r.source.id,title:r.source.title,kind:r.source.kind},...r.target.id===e.id?{type:"direct"}:{type:"\
|
|
2179
|
+
implicit, to nested",target:{id:r.target.id,title:r.target.title,kind:r.target.kind}}}))),outgoing:Ou(Lu(e.outgoing(),r=>({id:r.id,title:r.title,description:r.description,technology:r.technology,target:{id:r.target.id,title:r.target.title,kind:r.target.kind},...r.source.id===e.id?{type:"direct"}:{type:"implicit, from nested",source:{id:r.source.id,title:r.source.title,kind:r.source.kind}}})))},views:Ou(Lu(e.views(),r=>({id:r.id,title:r.title}))),sourceFile:t.locate({element:e.id,projectId:n})}}function $Z(t,e,n){
|
|
2180
|
+
return{id:e.id,title:e.title,projectId:n,viewType:e.__,description:e.$view.description??"",tags:e.tags,nodes:Ou(Lu(e.nodes(),r=>({id:r.id,title:r.title,represents:r.element?{element:r.element.id}:{}}))),sourceFile:t.locate({view:e.id,projectId:n})}}const Zx=lt.getChild("LikeC4MCPServices");function co(t){const e=ii(t)?.replaceAll('"',"'");return e?`"${e}"`:"null"}function Xx(t,e,n){const r=[...t];return r.length===0?[e]:Wr(r,n)}var Yx;(t=>(t.instructions=`This server provides access to LikeC4 mo\
|
|
2181
|
+
del.
|
|
2181
2182
|
|
|
2182
2183
|
Key capabilities:
|
|
2183
2184
|
- List all available LikeC4 projects in the workspace
|
|
@@ -2316,8 +2317,8 @@ this.pos);return this.pos+=4,e}readF64(){const e=this.view.getFloat64(this.pos);
|
|
|
2316
2317
|
`).filter(r=>!r.includes("**")&&!r.includes("@likec4-")&&!r.includes("*/")).map(r=>r.replaceAll("*","").trim()).join(""),n=xX(e);return LX(SX(n))}function p0(t){const e=Vg(t.$cstNode,["BLOCK_COMMENT"]);if(!(!e||!dP(e.text)))try{return MX(e.text)}catch(n){const r=IX(t);Ae(n),lt.warn(`Ignoring manual layout of "${t.name??"unnamed"}" at ${r.uri.fsPath}:${1+(e.range.start.line||0)}`);return}}function jX(t){return class extends t{parseDeploymentView(e){const n=e.body;Fe(n,"DynamicElementView body is \
|
|
2317
2318
|
not defined");const r=n.props.filter(this.isValid),i=this.getAstNodePath(e);let s=e.name;s||(s="deployment_"+If(this.doc.uri.toString(),i));const a=ii(r.find(f=>f.key==="title")?.value)??null,o=St(r.find(f=>f.key==="description")?.value)??null,u=this.convertTags(n),c=this.convertLinks(n);pg.writeId(e,s);const l=p0(e);return{__:"deployment",id:s,astPath:i,title:a,description:o,tags:u,links:ur(c)?c:null,rules:n.rules.flatMap(f=>{try{return this.isValid(f)?this.parseDeploymentViewRule(f):[]}catch(d){
|
|
2318
2319
|
return Ae(d),[]}}),...l&&{manualLayout:l}}}parseDeploymentViewRule(e){if(Vo(e))return this.parseDeploymentViewRulePredicate(e);if(Md(e))return Jb(e);if(Kl(e))return this.parseDeploymentViewRuleStyle(e);Ke(e)}parseDeploymentViewRulePredicate(e){const n=[];let r=e.expr;for(;r;){try{const i=r.value;Un(i)&&this.isValid(i)&&n.unshift(this.parseExpressionV2(i))}catch(i){Ae(i)}r=r.prev}return e.isInclude?{include:n}:{exclude:n}}parseDeploymentViewRuleStyle(e){const n=this.parseStyleProps(e.props.filter(
|
|
2319
|
-
Dw)),r=St(e.props.find(su)?.value);return{targets:this.parseFqnExpressions(e.targets),style:n,...r&&{notation:r}}}}}const fP=({operator:t,not:e},n)=>t.startsWith("!=")?{neq:n}:t.startsWith("=")?{eq:n}:e?{neq:n}:{eq:n};function hP(t){return!b_(t)&&!E_(t)?null:t.participant}function jf(t){switch(!0){case
|
|
2320
|
-
ame");const r={kind:fP(t,e)};return n?{participant:n,operator:r}:r}case(y_(t)||w_(t)):return{not:jf(t.value)};case
|
|
2320
|
+
Dw)),r=St(e.props.find(su)?.value);return{targets:this.parseFqnExpressions(e.targets),style:n,...r&&{notation:r}}}}}const fP=({operator:t,not:e},n)=>t.startsWith("!=")?{neq:n}:t.startsWith("=")?{eq:n}:e?{neq:n}:{eq:n};function hP(t){return!b_(t)&&!E_(t)?null:t.participant}function jf(t){switch(!0){case iW(t):{const e=t.value?.ref?.name,n=hP(t);Fe(e,"Expected tag name");const r={tag:fP(t,e)};return n?{participant:n,operator:r}:r}case nW(t):{const e=t.value?.ref?.name,n=hP(t);Fe(e,"Expected kind n\
|
|
2321
|
+
ame");const r={kind:fP(t,e)};return n?{participant:n,operator:r}:r}case(y_(t)||w_(t)):return{not:jf(t.value)};case wW(t):{const e=jf(t.left),n=jf(t.right),r=t.operator.toLowerCase();switch(r){case"and":{const i=[j0(e)?e.and:e,j0(n)?n.and:n].flat();return Fe(ur(i),"Expected non-empty array"),{and:i}}case"or":{const i=[M0(e)?e.or:e,M0(n)?n.or:n].flat();return Fe(ur(i),"Expected non-empty array"),{or:i}}default:Ke(r)}}default:Ke(t)}}function BX(t){return class extends t{parseFqnRef(e){const n=Vt(e.
|
|
2321
2322
|
value?.ref,`FqnRef is empty ${e.$cstNode?.range.start.line}:${e.$cstNode?.range.start.character}`);if(ss(n)){const r={project:rn(n),model:this.resolveFqn(Vt(n.imported.ref,`FqnRef is empty of imported: ${n.$cstNode?.text}`))};return this.doc.c4Imports.set(r.project,r.model),r}if(_n(n)){const r=xK(e);if(r){const o={project:rn(r),model:this.resolveFqn(n)};return this.doc.c4Imports.set(o.project,o.model),o}const i=AK(e);if(!i)return{model:this.resolveFqn(n)};const s=this.resolveFqn(i),a=this.resolveFqn(
|
|
2322
2323
|
n);return{deployment:s,element:a}}if(Pp(n))return{deployment:this.resolveFqn(n)};Ke(n)}parseExpressionV2(e){if(GC(e))return this.parseFqnExprOrWith(e);if(Yz(e))return this.parseRelationExprOrWith(e);Ke(e)}parseFqnExprOrWith(e){if(hm(e))return this.parseFqnExprWith(e);if(qC(e))return this.parseFqnExprOrWhere(e);Ke(e)}parseFqnExprWith(e){const n=this.parseFqnExprOrWhere(e.subject);return(e.custom?.props??[]).reduce((r,i)=>{if(!this.isValid(i))return r;if(km(i)){const s=i.value.view.$refText;return fe(
|
|
2323
2324
|
s)&&(r.custom.navigateTo=s),r}if(ed(i))return Rn(i.value)&&(r.custom[i.key]=St(i.value)||""),r;if(Ns(i)){const s=this.parseIconProperty(i);return Rn(s)&&(r.custom[i.key]=s),r}if(Wa(i)){const s=Nf(i);return Rn(s)&&(r.custom[i.key]=s),r}if(Sm(i)||Vp(i))return Rn(i.value)&&(r.custom[i.key]=i.value),r;if(Rm(i))return Rn(i.value)&&(r.custom[i.key]=Ix(i)),r;if(su(i))return fe(i.value)&&(r.custom[i.key]=St(i.value)),r;if(jw(i))return Zv(i.value)&&(r.custom[i.key]=i.value),r;if(Uw(i)||Vw(i)||Bw(i))return fe(
|
|
@@ -2422,7 +2423,7 @@ performance.now()-o)}`,{viewId:e}),u}catch(o){if(!this.viewsWithReportedErrors.h
|
|
|
2422
2423
|
resolve(i.get(r));const s=(await this.computedViews(e,n)).map(async u=>{const{dot:c,svg:l}=await this.layouter.svg(u);return{id:u.id,dot:c,svg:l}}),a=[],o=await Promise.allSettled(s);for(const u of o)u.status==="fulfilled"?a.push(u.value):Ae(u.reason);return i.set(r,a),a}async overviewGraph(){const e="OverviewGraph",n=this.services.ValidatedWorkspaceCache;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(
|
|
2423
2424
|
e,i),i}}const RY={lsp:{NodeKindProvider:t=>new fY(t),WorkspaceSymbolProvider:t=>new hY(t)},workspace:{IndexManager:t=>new $K(t),LangiumDocuments:t=>new DK(t),ProjectsManager:t=>new Tn(t),WorkspaceManager:t=>new TK(t)}};function Lt(t){return e=>new t(e)}const $Y={documentation:{DocumentationProvider:Lt(wK)},ValidatedWorkspaceCache:t=>new vp(t.shared,Ze.Validated),Rpc:Lt(dY),mcp:{Tools:Lt(DZ),Server:Lt(TZ),ServerFactory:Lt(SZ)},likec4:{LanguageServices:Lt(CK),Layouter:t=>(lt.debug("Creating Graphv\
|
|
2424
2425
|
izLayouter with GraphvizWasmAdapter"),new xx(new xu)),Views:Lt(kY),DeploymentsIndex:Lt(CZ),ModelChanges:Lt(aY),FqnIndex:Lt(Jx),ModelParser:Lt(YX),ModelBuilder:Lt(GZ),ModelLocator:Lt(WZ)},lsp:{CompletionProvider:Lt(IK),DocumentHighlightProvider:Lt(OK),DocumentSymbolProvider:Lt(FK),SemanticTokenProvider:Lt(jK),HoverProvider:Lt(MK),CodeLensProvider:Lt(NK),DocumentLinkProvider:Lt(LK),Formatter:Lt(kK)},workspace:{AstNodeDescriptionProvider:Lt(RK)},references:{NameProvider:Lt(oY),ScopeComputation:Lt(cY),
|
|
2425
|
-
ScopeProvider:Lt(lY)}};function DY(t,e,n,r){const i=TY(t),s=[bz({shared:i}),
|
|
2426
|
+
ScopeProvider:Lt(lY)}};function DY(t,e,n,r){const i=TY(t),s=[bz({shared:i}),TW,$Y,e,n,r].reduce(PP,{}),a=Ep(s);return i.ServiceRegistry.register(a),EZ(a),t.connection?a.Rpc.init():i.workspace.ConfigurationProvider.initialized({}),{shared:i,likec4:a}}function TY(t={}){const e={...vT,...t};return Ep(kz(e),DW,RY)}function PP(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]=PP(i,r):t[n]=r}}return t}const SY=t=>({
|
|
2426
2427
|
start:Es.hrtime.bigint(),command:t.map(e=>CY(s1(e))).join(" "),state:{stdout:"",stderr:"",output:""}}),CY=t=>/[^\w./-]/.test(t)?`'${t.replaceAll("'","'\\''")}'`:t,_Y=({stdin:t,stdout:e,stderr:n,stdio:r=[t,e,n],env:i,preferLocal:s,cwd:a=".",...o})=>{const u=a instanceof URL?t1(a):ws.resolve(a),c=i?{...Es.env,...i}:void 0,l=r[0]?.string;return{...o,input:l,stdio:l===void 0?r:["pipe",...r.slice(1)],env:s?AY(c??Es.env,u):c,cwd:u}},AY=({Path:t="",PATH:e=t,...n},r)=>{const i=e.split(ws.delimiter),s=NP(
|
|
2427
2428
|
[],ws.resolve(r)).map(a=>ws.join(a,"node_modules/.bin")).filter(a=>!i.includes(a));return{...n,PATH:[...s,e].filter(Boolean).join(ws.delimiter)}},NP=(t,e)=>t.at(-1)===e?t:NP([...t,e],ws.resolve(e,"..")),xY=async(t,e,n)=>await PY(t,n)?[g0(t),e.map(r=>LY(r)),{...n,shell:!0}]:[t,e,n],PY=async(t,{shell:e,cwd:n,env:r=Es.env})=>Es.platform==="win32"&&!e&&!await NY(t,n,r),NY=async(t,e,{Path:n="",PATH:r=n})=>IP.some(i=>t.toLowerCase().endsWith(i))||(IY[`${t}\0${e}\0${r}`]??=await OY(t,e,r)),IY={},OY=async(t,e,n)=>{
|
|
2428
2429
|
const r=n.split(ws.delimiter).filter(Boolean).map(i=>i.replace(/^"(.*)"$/,"$1"));try{await Promise.all(IP.flatMap(i=>[e,...r].map(s=>`${ws.resolve(s,t)}${i}`)).map(async i=>{try{await q1(i)}catch{return}throw 0}))}catch{return!0}return!1},IP=[".exe",".com"],LY=t=>g0(g0(`"${t.replaceAll(/(\\*)"/g,'$1$1\\"').replace(/(\\*)$/,"$1$1")}"`)),g0=t=>t.replaceAll(/([()\][%!^"`<>&|;, *?])/g,"^$1"),FY=async(t,{input:e},n)=>{const r=await t;e!==void 0&&r.stdin.end(e);const i=U0(r,"close");try{return await Promise.
|
|
@@ -2445,12 +2446,12 @@ class QY{dotpath;unflattenpath;constructor(e){this.dotpath=e||WP.sync("dot"),thi
|
|
|
2445
2446
|
exitCode}): "${i.stderr}"`,r=i.stdout)}return r&&(e=r.replaceAll(/\t\[/g," [").replaceAll(/\t/g," ")),e})}async layoutJson(e){return await b0(async()=>{const n=Fn.getChild("graphviz-binary");let r;try{const i=await Bf(this.dotpath,["-Tjson","-y"],{timeout:1e4,stdin:{string:e}});r=i.stdout,tn(i.stderr)||n.warn`Command ${i.command} has stderr:\n${i.stderr}`}catch(i){if(n.error("FAILED GraphvizBinaryAdapter.layoutJson",{error:i}),n.warn(`FAILED DOT:
|
|
2446
2447
|
${e}`),i instanceof lo&&!tn(i.stdout))n.warn(`Command: '${i.command}' returned result but also failed (exitcode ${i.exitCode}): "${i.stderr}"`),r=i.stdout;else throw i}return r})}async acyclic(e){return Promise.reject(new Error("Method not implemented."))}async svg(e){return await b0(async()=>{const n=Fn.getChild("graphviz-binary");let r;try{const i=await Bf(this.dotpath,["-Tsvg","-y"],{timeout:1e4,stdin:{string:e}});r=i.stdout,tn(i.stderr)||n.warn`Command ${i.command} has stderr:\n${i.stderr}`}catch(i){
|
|
2447
2448
|
if(n.error("FAILED GraphvizBinaryAdapter.svg",{error:i}),n.warn(`FAILED DOT:
|
|
2448
|
-
${e}`),i instanceof lo&&!tn(i.stdout))n.warn`Command: '${i.command}' returned result but also failed (exitcode ${i.exitCode}): "${i.stderr}"`,r=i.stdout;else throw i}return r})}}const eJ="likec4",HP="1.
|
|
2449
|
+
${e}`),i instanceof lo&&!tn(i.stdout))n.warn`Command: '${i.command}' returned result but also failed (exitcode ${i.exitCode}): "${i.stderr}"`,r=i.stdout;else throw i}return r})}}const eJ="likec4",HP="1.30.0",E0=Fn.getChild("cli");nn.bold(nn.bgRed(nn.white("ERROR"))),nn.bold(nn.yellow("WARN")),nn.bold(nn.green("INFO"));function VP(t){const e=Fn.getChild(t);return{info(n){e.info(n)},warn(n){if(n instanceof Error){e.warn(`${nn.red(n.name+" "+n.message)}`,{msg:n});return}if(typeof n=="string"){e.warn(
|
|
2449
2450
|
n);return}e.warn`${n}`},warnOnce(n){e.warn(n)},error(n,r){let i=r?.error??n;if(i instanceof Error){if(n===i){e.error(`${nn.red(i.name+" "+i.message)}`,{error:i});return}e.error(`${n}`,{error:i});return}if(typeof n=="string"){e.error(`${nn.red(n)}`);return}e.error`${n}`},clearScreen:function(n){},hasErrorLogged:function(n){throw new Error("Function not implemented.")},hasWarned:!1}}const k0=()=>{},tJ={info:k0,warn:k0,error:k0},nJ=1e6;function KP(t){const[e,n]=G0(t),r=e*1e3+n/nJ;return{ms:r,pretty:wg(
|
|
2450
2451
|
r)}}function rJ(t){const e=G0();return{stopAndLog(n="done in "){n=nn.green(`${n}${KP(e).pretty}`),(t||E0).info(n)}}}function iJ(t,e){console.log(M1(t,{padding:1,margin:1,dimBorder:!0,...e}))}class sJ{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(`${nn.dim("workspace:")} ${e.uri}`),r.initialize({capabilities:{},processId:null,
|
|
2451
2452
|
rootUri:null,workspaceFolders:[e]}),await r.initializeWorkspace([e])}async init(){if(this.isInitialized)throw new Error("Workspace already initialized");this.isInitialized=!0;const e=this.services.logger;this.services.likec4.ModelBuilder;const n=this.services.shared.workspace.LangiumDocuments,r=this.services.shared.workspace.DocumentBuilder,i=n.all.toArray(),s=i.filter(a=>!nf(a.uri));if(s.length===0)throw e.error("no LikeC4 sources found"),new Error("no LikeC4 sources found");e.info(`${nn.dim("w\
|
|
2452
2453
|
orkspace:")} found ${s.length} source files`),s.length>1?await r.update(s.map(a=>a.uri),[],void 0):await r.build(i,{validation:!0})}}function aJ(t){return e=>new t(e)}const oJ={logger:()=>{throw new Error("Logger must be provided")},likec4:{Layouter:()=>{throw new Error("Layouter must be provided")}},cli:{Workspace:aJ(sJ)}};function ZP(t){const e=zg(t,{useFileSystem:!0,logger:"default",graphviz:"wasm"});let n;switch(e.logger){case!1:n=tJ;break;case"vite":n=VP("lang");break;case"default":n=E0.getChild(
|
|
2453
|
-
"lang");break;default:n=e.logger;break}const r=e.graphviz==="binary";n.info(`${nn.dim("version")} ${HP}`),n.info(`${nn.dim("layout")} ${r?"binary":"wasm"}`);const i={logger:()=>n,likec4:{Layouter:()=>new xx(r===!0?new QY:new xu)}};return DY(e.useFileSystem?
|
|
2454
|
+
"lang");break;default:n=e.logger;break}const r=e.graphviz==="binary";n.info(`${nn.dim("version")} ${HP}`),n.info(`${nn.dim("layout")} ${r?"binary":"wasm"}`);const i={logger:()=>n,likec4:{Layouter:()=>new xx(r===!0?new QY:new xu)}};return DY(e.useFileSystem?p9:{},oJ,i).likec4}const XP=t=>new Error(`Invalid model:
|
|
2454
2455
|
${t.getErrors().map(e=>` ${e.sourceFsPath}:${e.line} ${e.message.slice(0,200)}`).join(`
|
|
2455
2456
|
`)}`);class Ws{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=ZP(zg(n,{useFileSystem:!1,logger:!1,graphviz:"wasm"})),i=_t.from({scheme:"virtual",path:"/workspace"});await r.cli.Workspace.initWorkspace({uri:i.toString(),name:"virtual"});const s=Tt.joinPath(i,"source.likec4");r.shared.workspace.LangiumDocuments.createDocument(s,e),await r.cli.Workspace.init();const a=new Ws(
|
|
2456
2457
|
i.path,r,n?.printErrors??!0);return n?.throwIfInvalid===!0&&a.hasErrors()?(a.dispose(),Promise.reject(XP(a))):a}static likec4Instances=new Map;static async fromWorkspace(e="",n){const r=QP(e);if(!JP(r))throw new Error(`Workspace not found: ${r}`);let i=Ws.likec4Instances.get(r);if(!i){const s=ZP(zg(n,{useFileSystem:!0,logger:"default",graphviz:"wasm"}));await s.cli.Workspace.initWorkspace({uri:n1(r).toString(),name:e1(r)}),await s.cli.Workspace.init(),i=new Ws(r,s,n?.printErrors??!0),Ws.likec4Instances.
|
|
@@ -2465,4 +2466,4 @@ filter(n=>n.severity===wa.Error).map(({message:n,range:r})=>({message:n,line:r.s
|
|
|
2465
2466
|
`);return o.length>10&&(o.length=10,o.push("...")),o.map((u,c)=>c===0?" "+nn.dim(`Line ${a}: `)+nn.red(u):" ".repeat(10)+nn.red(u))}).join(`
|
|
2466
2467
|
`);this.logger.error(`Invalid ${n.uri.fsPath}
|
|
2467
2468
|
${i}`)}}return e}async notifyUpdate({changed:e,removed:n}){const r=this.langium.shared.workspace.WorkspaceLock;try{let i=!1;return await r.write(async s=>{await this.langium.shared.workspace.DocumentBuilder.update(e?[_t.file(e)]:[],n?[_t.file(n)]:[],s),i=!s.isCancellationRequested}),i}catch(i){return this.logger.error(Jn(i)),!1}}onModelUpdate(e){const n=this.langium.likec4.ModelBuilder.onModelParsed(()=>e());return()=>{n.dispose()}}dispose(){for(const[e,n]of Ws.likec4Instances)n===this&&Ws.likec4Instances.
|
|
2468
|
-
delete(e)}}export{iJ as A,AT as B,et as C,KP as D,X1 as E,eJ as F,tn as G,HP as H,rJ as I,Su as J,Ar as K,Ws as L,fO as M,ZE as N,_E as O,wo as T,jo as a,Qe as b,fe as c,F_ as d,Go as e,Ro as f,vt as g,VP as h,Mt as i,P_ as j,ST as k,ki as l,Ht as m,Ft as n,Fn as o,Ui as p,fi as q,Fs as r,
|
|
2469
|
+
delete(e)}}export{iJ as A,AT as B,et as C,KP as D,X1 as E,eJ as F,tn as G,HP as H,rJ as I,Su as J,Ar as K,Ws as L,fO as M,ZE as N,_E as O,wo as T,jo as a,Qe as b,fe as c,F_ as d,Go as e,Ro as f,vt as g,VP as h,Mt as i,P_ as j,ST as k,ki as l,Ht as m,Ft as n,Fn as o,Ui as p,fi as q,Fs as r,LW as s,Kv as t,nn as u,E0 as v,A_ as w,Bf as x,Jn as y,LC as z};
|