@synergenius/flow-weaver 0.21.6 → 0.21.7

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.
@@ -3127,13 +3127,39 @@ var init_unescape = __esm({
3127
3127
  });
3128
3128
 
3129
3129
  // node_modules/minimatch/dist/esm/ast.js
3130
- var types, isExtglobType, startNoTraversal, startNoDot, addPatternStart, justDots, reSpecials, regExpEscape, qmark, star, starNoEmpty, AST;
3130
+ var _a, types, isExtglobType, isExtglobAST, adoptionMap, adoptionWithSpaceMap, adoptionAnyMap, usurpMap, startNoTraversal, startNoDot, addPatternStart, justDots, reSpecials, regExpEscape, qmark, star, starNoEmpty, AST;
3131
3131
  var init_ast = __esm({
3132
3132
  "node_modules/minimatch/dist/esm/ast.js"() {
3133
3133
  init_brace_expressions();
3134
3134
  init_unescape();
3135
3135
  types = /* @__PURE__ */ new Set(["!", "?", "+", "*", "@"]);
3136
3136
  isExtglobType = (c) => types.has(c);
3137
+ isExtglobAST = (c) => isExtglobType(c.type);
3138
+ adoptionMap = /* @__PURE__ */ new Map([
3139
+ ["!", ["@"]],
3140
+ ["?", ["?", "@"]],
3141
+ ["@", ["@"]],
3142
+ ["*", ["*", "+", "?", "@"]],
3143
+ ["+", ["+", "@"]]
3144
+ ]);
3145
+ adoptionWithSpaceMap = /* @__PURE__ */ new Map([
3146
+ ["!", ["?"]],
3147
+ ["@", ["?"]],
3148
+ ["+", ["?", "*"]]
3149
+ ]);
3150
+ adoptionAnyMap = /* @__PURE__ */ new Map([
3151
+ ["!", ["?", "@"]],
3152
+ ["?", ["?", "@"]],
3153
+ ["@", ["?", "@"]],
3154
+ ["*", ["*", "+", "?", "@"]],
3155
+ ["+", ["+", "@", "?", "*"]]
3156
+ ]);
3157
+ usurpMap = /* @__PURE__ */ new Map([
3158
+ ["!", /* @__PURE__ */ new Map([["!", "@"]])],
3159
+ ["?", /* @__PURE__ */ new Map([["*", "*"], ["+", "*"]])],
3160
+ ["@", /* @__PURE__ */ new Map([["!", "!"], ["?", "?"], ["@", "@"], ["*", "*"], ["+", "+"]])],
3161
+ ["+", /* @__PURE__ */ new Map([["?", "*"], ["*", "*"]])]
3162
+ ]);
3137
3163
  startNoTraversal = "(?!(?:^|/)\\.\\.?(?:$|/))";
3138
3164
  startNoDot = "(?!\\.)";
3139
3165
  addPatternStart = /* @__PURE__ */ new Set(["[", "."]);
@@ -3143,7 +3169,7 @@ var init_ast = __esm({
3143
3169
  qmark = "[^/]";
3144
3170
  star = qmark + "*?";
3145
3171
  starNoEmpty = qmark + "+?";
3146
- AST = class _AST {
3172
+ AST = class {
3147
3173
  type;
3148
3174
  #root;
3149
3175
  #hasMagic;
@@ -3223,7 +3249,7 @@ var init_ast = __esm({
3223
3249
  for (const p of parts) {
3224
3250
  if (p === "")
3225
3251
  continue;
3226
- if (typeof p !== "string" && !(p instanceof _AST && p.#parent === this)) {
3252
+ if (typeof p !== "string" && !(p instanceof _a && p.#parent === this)) {
3227
3253
  throw new Error("invalid part: " + p);
3228
3254
  }
3229
3255
  this.#parts.push(p);
@@ -3248,7 +3274,7 @@ var init_ast = __esm({
3248
3274
  const p = this.#parent;
3249
3275
  for (let i = 0; i < this.#parentIndex; i++) {
3250
3276
  const pp = p.#parts[i];
3251
- if (!(pp instanceof _AST && pp.type === "!")) {
3277
+ if (!(pp instanceof _a && pp.type === "!")) {
3252
3278
  return false;
3253
3279
  }
3254
3280
  }
@@ -3273,13 +3299,14 @@ var init_ast = __esm({
3273
3299
  this.push(part.clone(this));
3274
3300
  }
3275
3301
  clone(parent) {
3276
- const c = new _AST(this.type, parent);
3302
+ const c = new _a(this.type, parent);
3277
3303
  for (const p of this.#parts) {
3278
3304
  c.copyIn(p);
3279
3305
  }
3280
3306
  return c;
3281
3307
  }
3282
- static #parseAST(str2, ast, pos, opt) {
3308
+ static #parseAST(str2, ast, pos, opt, extDepth) {
3309
+ const maxDepth = opt.maxExtglobRecursion ?? 2;
3283
3310
  let escaping = false;
3284
3311
  let inBrace = false;
3285
3312
  let braceStart = -1;
@@ -3311,11 +3338,12 @@ var init_ast = __esm({
3311
3338
  acc2 += c;
3312
3339
  continue;
3313
3340
  }
3314
- if (!opt.noext && isExtglobType(c) && str2.charAt(i2) === "(") {
3341
+ const doRecurse = !opt.noext && isExtglobType(c) && str2.charAt(i2) === "(" && extDepth <= maxDepth;
3342
+ if (doRecurse) {
3315
3343
  ast.push(acc2);
3316
3344
  acc2 = "";
3317
- const ext2 = new _AST(c, ast);
3318
- i2 = _AST.#parseAST(str2, ext2, i2, opt);
3345
+ const ext2 = new _a(c, ast);
3346
+ i2 = _a.#parseAST(str2, ext2, i2, opt, extDepth + 1);
3319
3347
  ast.push(ext2);
3320
3348
  continue;
3321
3349
  }
@@ -3325,7 +3353,7 @@ var init_ast = __esm({
3325
3353
  return i2;
3326
3354
  }
3327
3355
  let i = pos + 1;
3328
- let part = new _AST(null, ast);
3356
+ let part = new _a(null, ast);
3329
3357
  const parts = [];
3330
3358
  let acc = "";
3331
3359
  while (i < str2.length) {
@@ -3352,19 +3380,22 @@ var init_ast = __esm({
3352
3380
  acc += c;
3353
3381
  continue;
3354
3382
  }
3355
- if (isExtglobType(c) && str2.charAt(i) === "(") {
3383
+ const doRecurse = isExtglobType(c) && str2.charAt(i) === "(" && /* c8 ignore start - the maxDepth is sufficient here */
3384
+ (extDepth <= maxDepth || ast && ast.#canAdoptType(c));
3385
+ if (doRecurse) {
3386
+ const depthAdd = ast && ast.#canAdoptType(c) ? 0 : 1;
3356
3387
  part.push(acc);
3357
3388
  acc = "";
3358
- const ext2 = new _AST(c, part);
3389
+ const ext2 = new _a(c, part);
3359
3390
  part.push(ext2);
3360
- i = _AST.#parseAST(str2, ext2, i, opt);
3391
+ i = _a.#parseAST(str2, ext2, i, opt, extDepth + depthAdd);
3361
3392
  continue;
3362
3393
  }
3363
3394
  if (c === "|") {
3364
3395
  part.push(acc);
3365
3396
  acc = "";
3366
3397
  parts.push(part);
3367
- part = new _AST(null, ast);
3398
+ part = new _a(null, ast);
3368
3399
  continue;
3369
3400
  }
3370
3401
  if (c === ")") {
@@ -3383,9 +3414,101 @@ var init_ast = __esm({
3383
3414
  ast.#parts = [str2.substring(pos - 1)];
3384
3415
  return i;
3385
3416
  }
3417
+ #canAdoptWithSpace(child) {
3418
+ return this.#canAdopt(child, adoptionWithSpaceMap);
3419
+ }
3420
+ #canAdopt(child, map3 = adoptionMap) {
3421
+ if (!child || typeof child !== "object" || child.type !== null || child.#parts.length !== 1 || this.type === null) {
3422
+ return false;
3423
+ }
3424
+ const gc = child.#parts[0];
3425
+ if (!gc || typeof gc !== "object" || gc.type === null) {
3426
+ return false;
3427
+ }
3428
+ return this.#canAdoptType(gc.type, map3);
3429
+ }
3430
+ #canAdoptType(c, map3 = adoptionAnyMap) {
3431
+ return !!map3.get(this.type)?.includes(c);
3432
+ }
3433
+ #adoptWithSpace(child, index) {
3434
+ const gc = child.#parts[0];
3435
+ const blank = new _a(null, gc, this.options);
3436
+ blank.#parts.push("");
3437
+ gc.push(blank);
3438
+ this.#adopt(child, index);
3439
+ }
3440
+ #adopt(child, index) {
3441
+ const gc = child.#parts[0];
3442
+ this.#parts.splice(index, 1, ...gc.#parts);
3443
+ for (const p of gc.#parts) {
3444
+ if (typeof p === "object")
3445
+ p.#parent = this;
3446
+ }
3447
+ this.#toString = void 0;
3448
+ }
3449
+ #canUsurpType(c) {
3450
+ const m = usurpMap.get(this.type);
3451
+ return !!m?.has(c);
3452
+ }
3453
+ #canUsurp(child) {
3454
+ if (!child || typeof child !== "object" || child.type !== null || child.#parts.length !== 1 || this.type === null || this.#parts.length !== 1) {
3455
+ return false;
3456
+ }
3457
+ const gc = child.#parts[0];
3458
+ if (!gc || typeof gc !== "object" || gc.type === null) {
3459
+ return false;
3460
+ }
3461
+ return this.#canUsurpType(gc.type);
3462
+ }
3463
+ #usurp(child) {
3464
+ const m = usurpMap.get(this.type);
3465
+ const gc = child.#parts[0];
3466
+ const nt = m?.get(gc.type);
3467
+ if (!nt)
3468
+ return false;
3469
+ this.#parts = gc.#parts;
3470
+ for (const p of this.#parts) {
3471
+ if (typeof p === "object")
3472
+ p.#parent = this;
3473
+ }
3474
+ this.type = nt;
3475
+ this.#toString = void 0;
3476
+ this.#emptyExt = false;
3477
+ }
3478
+ #flatten() {
3479
+ if (!isExtglobAST(this)) {
3480
+ for (const p of this.#parts) {
3481
+ if (typeof p === "object")
3482
+ p.#flatten();
3483
+ }
3484
+ } else {
3485
+ let iterations = 0;
3486
+ let done = false;
3487
+ do {
3488
+ done = true;
3489
+ for (let i = 0; i < this.#parts.length; i++) {
3490
+ const c = this.#parts[i];
3491
+ if (typeof c === "object") {
3492
+ c.#flatten();
3493
+ if (this.#canAdopt(c)) {
3494
+ done = false;
3495
+ this.#adopt(c, i);
3496
+ } else if (this.#canAdoptWithSpace(c)) {
3497
+ done = false;
3498
+ this.#adoptWithSpace(c, i);
3499
+ } else if (this.#canUsurp(c)) {
3500
+ done = false;
3501
+ this.#usurp(c);
3502
+ }
3503
+ }
3504
+ }
3505
+ } while (!done && ++iterations < 10);
3506
+ }
3507
+ this.#toString = void 0;
3508
+ }
3386
3509
  static fromGlob(pattern, options = {}) {
3387
- const ast = new _AST(null, void 0, options);
3388
- _AST.#parseAST(pattern, ast, 0, options);
3510
+ const ast = new _a(null, void 0, options);
3511
+ _a.#parseAST(pattern, ast, 0, options, 0);
3389
3512
  return ast;
3390
3513
  }
3391
3514
  // returns the regular expression if there's magic, or the unescaped
@@ -3479,12 +3602,14 @@ var init_ast = __esm({
3479
3602
  // or start or whatever) and prepend ^ or / at the Regexp construction.
3480
3603
  toRegExpSource(allowDot) {
3481
3604
  const dot = allowDot ?? !!this.#options.dot;
3482
- if (this.#root === this)
3605
+ if (this.#root === this) {
3606
+ this.#flatten();
3483
3607
  this.#fillNegs();
3484
- if (!this.type) {
3608
+ }
3609
+ if (!isExtglobAST(this)) {
3485
3610
  const noEmpty = this.isStart() && this.isEnd();
3486
3611
  const src = this.#parts.map((p) => {
3487
- const [re, _, hasMagic2, uflag] = typeof p === "string" ? _AST.#parseGlob(p, this.#hasMagic, noEmpty) : p.toRegExpSource(allowDot);
3612
+ const [re, _, hasMagic2, uflag] = typeof p === "string" ? _a.#parseGlob(p, this.#hasMagic, noEmpty) : p.toRegExpSource(allowDot);
3488
3613
  this.#hasMagic = this.#hasMagic || hasMagic2;
3489
3614
  this.#uflag = this.#uflag || uflag;
3490
3615
  return re;
@@ -3523,9 +3648,10 @@ var init_ast = __esm({
3523
3648
  let body = this.#partsToRegExp(dot);
3524
3649
  if (this.isStart() && this.isEnd() && !body && this.type !== "!") {
3525
3650
  const s = this.toString();
3526
- this.#parts = [s];
3527
- this.type = null;
3528
- this.#hasMagic = void 0;
3651
+ const me = this;
3652
+ me.#parts = [s];
3653
+ me.type = null;
3654
+ me.#hasMagic = void 0;
3529
3655
  return [s, unescape2(this.toString()), false, false];
3530
3656
  }
3531
3657
  let bodyDotAllowed = !repeated || allowDot || dot || !startNoDot ? "" : this.#partsToRegExp(true);
@@ -3566,11 +3692,13 @@ var init_ast = __esm({
3566
3692
  let escaping = false;
3567
3693
  let re = "";
3568
3694
  let uflag = false;
3695
+ let inStar = false;
3569
3696
  for (let i = 0; i < glob2.length; i++) {
3570
3697
  const c = glob2.charAt(i);
3571
3698
  if (escaping) {
3572
3699
  escaping = false;
3573
3700
  re += (reSpecials.has(c) ? "\\" : "") + c;
3701
+ inStar = false;
3574
3702
  continue;
3575
3703
  }
3576
3704
  if (c === "\\") {
@@ -3588,16 +3716,19 @@ var init_ast = __esm({
3588
3716
  uflag = uflag || needUflag;
3589
3717
  i += consumed - 1;
3590
3718
  hasMagic2 = hasMagic2 || magic;
3719
+ inStar = false;
3591
3720
  continue;
3592
3721
  }
3593
3722
  }
3594
3723
  if (c === "*") {
3595
- if (noEmpty && glob2 === "*")
3596
- re += starNoEmpty;
3597
- else
3598
- re += star;
3724
+ if (inStar)
3725
+ continue;
3726
+ inStar = true;
3727
+ re += noEmpty && /^[*]+$/.test(glob2) ? starNoEmpty : star;
3599
3728
  hasMagic2 = true;
3600
3729
  continue;
3730
+ } else {
3731
+ inStar = false;
3601
3732
  }
3602
3733
  if (c === "?") {
3603
3734
  re += qmark;
@@ -3609,6 +3740,7 @@ var init_ast = __esm({
3609
3740
  return [re, unescape2(glob2), !!hasMagic2, uflag];
3610
3741
  }
3611
3742
  };
3743
+ _a = AST;
3612
3744
  }
3613
3745
  });
3614
3746
 
@@ -3782,11 +3914,13 @@ var init_esm = __esm({
3782
3914
  isWindows;
3783
3915
  platform;
3784
3916
  windowsNoMagicRoot;
3917
+ maxGlobstarRecursion;
3785
3918
  regexp;
3786
3919
  constructor(pattern, options = {}) {
3787
3920
  assertValidPattern(pattern);
3788
3921
  options = options || {};
3789
3922
  this.options = options;
3923
+ this.maxGlobstarRecursion = options.maxGlobstarRecursion ?? 200;
3790
3924
  this.pattern = pattern;
3791
3925
  this.platform = options.platform || defaultPlatform;
3792
3926
  this.isWindows = this.platform === "win32";
@@ -4119,7 +4253,8 @@ var init_esm = __esm({
4119
4253
  // out of pattern, then that's fine, as long as all
4120
4254
  // the parts match.
4121
4255
  matchOne(file, pattern, partial2 = false) {
4122
- const options = this.options;
4256
+ let fileStartIndex = 0;
4257
+ let patternStartIndex = 0;
4123
4258
  if (this.isWindows) {
4124
4259
  const fileDrive = typeof file[0] === "string" && /^[a-z]:$/i.test(file[0]);
4125
4260
  const fileUNC = !fileDrive && file[0] === "" && file[1] === "" && file[2] === "?" && /^[a-z]:$/i.test(file[3]);
@@ -4128,14 +4263,14 @@ var init_esm = __esm({
4128
4263
  const fdi = fileUNC ? 3 : fileDrive ? 0 : void 0;
4129
4264
  const pdi = patternUNC ? 3 : patternDrive ? 0 : void 0;
4130
4265
  if (typeof fdi === "number" && typeof pdi === "number") {
4131
- const [fd, pd] = [file[fdi], pattern[pdi]];
4266
+ const [fd, pd] = [
4267
+ file[fdi],
4268
+ pattern[pdi]
4269
+ ];
4132
4270
  if (fd.toLowerCase() === pd.toLowerCase()) {
4133
4271
  pattern[pdi] = fd;
4134
- if (pdi > fdi) {
4135
- pattern = pattern.slice(pdi);
4136
- } else if (fdi > pdi) {
4137
- file = file.slice(fdi);
4138
- }
4272
+ patternStartIndex = pdi;
4273
+ fileStartIndex = fdi;
4139
4274
  }
4140
4275
  }
4141
4276
  }
@@ -4143,51 +4278,118 @@ var init_esm = __esm({
4143
4278
  if (optimizationLevel >= 2) {
4144
4279
  file = this.levelTwoFileOptimize(file);
4145
4280
  }
4146
- this.debug("matchOne", this, { file, pattern });
4147
- this.debug("matchOne", file.length, pattern.length);
4148
- for (var fi = 0, pi = 0, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) {
4149
- this.debug("matchOne loop");
4150
- var p = pattern[pi];
4151
- var f = file[fi];
4152
- this.debug(pattern, p, f);
4153
- if (p === false) {
4281
+ if (pattern.includes(GLOBSTAR)) {
4282
+ return this.#matchGlobstar(file, pattern, partial2, fileStartIndex, patternStartIndex);
4283
+ }
4284
+ return this.#matchOne(file, pattern, partial2, fileStartIndex, patternStartIndex);
4285
+ }
4286
+ #matchGlobstar(file, pattern, partial2, fileIndex, patternIndex) {
4287
+ const firstgs = pattern.indexOf(GLOBSTAR, patternIndex);
4288
+ const lastgs = pattern.lastIndexOf(GLOBSTAR);
4289
+ const [head2, body, tail] = partial2 ? [
4290
+ pattern.slice(patternIndex, firstgs),
4291
+ pattern.slice(firstgs + 1),
4292
+ []
4293
+ ] : [
4294
+ pattern.slice(patternIndex, firstgs),
4295
+ pattern.slice(firstgs + 1, lastgs),
4296
+ pattern.slice(lastgs + 1)
4297
+ ];
4298
+ if (head2.length) {
4299
+ const fileHead = file.slice(fileIndex, fileIndex + head2.length);
4300
+ if (!this.#matchOne(fileHead, head2, partial2, 0, 0))
4154
4301
  return false;
4155
- }
4156
- if (p === GLOBSTAR) {
4157
- this.debug("GLOBSTAR", [pattern, p, f]);
4158
- var fr = fi;
4159
- var pr = pi + 1;
4160
- if (pr === pl) {
4161
- this.debug("** at the end");
4162
- for (; fi < fl; fi++) {
4163
- if (file[fi] === "." || file[fi] === ".." || !options.dot && file[fi].charAt(0) === ".")
4164
- return false;
4165
- }
4166
- return true;
4302
+ fileIndex += head2.length;
4303
+ }
4304
+ let fileTailMatch = 0;
4305
+ if (tail.length) {
4306
+ if (tail.length + fileIndex > file.length)
4307
+ return false;
4308
+ let tailStart = file.length - tail.length;
4309
+ if (this.#matchOne(file, tail, partial2, tailStart, 0)) {
4310
+ fileTailMatch = tail.length;
4311
+ } else {
4312
+ if (file[file.length - 1] !== "" || fileIndex + tail.length === file.length) {
4313
+ return false;
4167
4314
  }
4168
- while (fr < fl) {
4169
- var swallowee = file[fr];
4170
- this.debug("\nglobstar while", file, fr, pattern, pr, swallowee);
4171
- if (this.matchOne(file.slice(fr), pattern.slice(pr), partial2)) {
4172
- this.debug("globstar found match!", fr, fl, swallowee);
4173
- return true;
4174
- } else {
4175
- if (swallowee === "." || swallowee === ".." || !options.dot && swallowee.charAt(0) === ".") {
4176
- this.debug("dot detected!", file, fr, pattern, pr);
4177
- break;
4178
- }
4179
- this.debug("globstar swallow a segment, and continue");
4180
- fr++;
4181
- }
4315
+ tailStart--;
4316
+ if (!this.#matchOne(file, tail, partial2, tailStart, 0))
4317
+ return false;
4318
+ fileTailMatch = tail.length + 1;
4319
+ }
4320
+ }
4321
+ if (!body.length) {
4322
+ let sawSome = !!fileTailMatch;
4323
+ for (let i2 = fileIndex; i2 < file.length - fileTailMatch; i2++) {
4324
+ const f = String(file[i2]);
4325
+ sawSome = true;
4326
+ if (f === "." || f === ".." || !this.options.dot && f.startsWith(".")) {
4327
+ return false;
4182
4328
  }
4183
- if (partial2) {
4184
- this.debug("\n>>> no match, partial?", file, fr, pattern, pr);
4185
- if (fr === fl) {
4186
- return true;
4187
- }
4329
+ }
4330
+ return partial2 || sawSome;
4331
+ }
4332
+ const bodySegments = [[[], 0]];
4333
+ let currentBody = bodySegments[0];
4334
+ let nonGsParts = 0;
4335
+ const nonGsPartsSums = [0];
4336
+ for (const b of body) {
4337
+ if (b === GLOBSTAR) {
4338
+ nonGsPartsSums.push(nonGsParts);
4339
+ currentBody = [[], 0];
4340
+ bodySegments.push(currentBody);
4341
+ } else {
4342
+ currentBody[0].push(b);
4343
+ nonGsParts++;
4344
+ }
4345
+ }
4346
+ let i = bodySegments.length - 1;
4347
+ const fileLength = file.length - fileTailMatch;
4348
+ for (const b of bodySegments) {
4349
+ b[1] = fileLength - (nonGsPartsSums[i--] + b[0].length);
4350
+ }
4351
+ return !!this.#matchGlobStarBodySections(file, bodySegments, fileIndex, 0, partial2, 0, !!fileTailMatch);
4352
+ }
4353
+ #matchGlobStarBodySections(file, bodySegments, fileIndex, bodyIndex, partial2, globStarDepth, sawTail) {
4354
+ const bs = bodySegments[bodyIndex];
4355
+ if (!bs) {
4356
+ for (let i = fileIndex; i < file.length; i++) {
4357
+ sawTail = true;
4358
+ const f = file[i];
4359
+ if (f === "." || f === ".." || !this.options.dot && f.startsWith(".")) {
4360
+ return false;
4188
4361
  }
4362
+ }
4363
+ return sawTail;
4364
+ }
4365
+ const [body, after] = bs;
4366
+ while (fileIndex <= after) {
4367
+ const m = this.#matchOne(file.slice(0, fileIndex + body.length), body, partial2, fileIndex, 0);
4368
+ if (m && globStarDepth < this.maxGlobstarRecursion) {
4369
+ const sub = this.#matchGlobStarBodySections(file, bodySegments, fileIndex + body.length, bodyIndex + 1, partial2, globStarDepth + 1, sawTail);
4370
+ if (sub !== false)
4371
+ return sub;
4372
+ }
4373
+ const f = file[fileIndex];
4374
+ if (f === "." || f === ".." || !this.options.dot && f.startsWith(".")) {
4189
4375
  return false;
4190
4376
  }
4377
+ fileIndex++;
4378
+ }
4379
+ return partial2 || null;
4380
+ }
4381
+ #matchOne(file, pattern, partial2, fileIndex, patternIndex) {
4382
+ let fi;
4383
+ let pi;
4384
+ let pl;
4385
+ let fl;
4386
+ for (fi = fileIndex, pi = patternIndex, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) {
4387
+ this.debug("matchOne loop");
4388
+ let p = pattern[pi];
4389
+ let f = file[fi];
4390
+ this.debug(pattern, p, f);
4391
+ if (p === false || p === GLOBSTAR)
4392
+ return false;
4191
4393
  let hit;
4192
4394
  if (typeof p === "string") {
4193
4395
  hit = f === p;
@@ -9469,7 +9671,7 @@ var VERSION;
9469
9671
  var init_generated_version = __esm({
9470
9672
  "src/generated-version.ts"() {
9471
9673
  "use strict";
9472
- VERSION = "0.21.6";
9674
+ VERSION = "0.21.7";
9473
9675
  }
9474
9676
  });
9475
9677
 
@@ -14901,7 +15103,7 @@ is not a problem with esbuild. You need to fix your environment instead.
14901
15103
  if (keepNames) flags.push(`--keep-names`);
14902
15104
  }
14903
15105
  function flagsForBuildOptions(callName, options, isTTY22, logLevelDefault, writeDefault) {
14904
- var _a2;
15106
+ var _a22;
14905
15107
  let flags = [];
14906
15108
  let entries = [];
14907
15109
  let keys2 = /* @__PURE__ */ Object.create(null);
@@ -14937,7 +15139,7 @@ is not a problem with esbuild. You need to fix your environment instead.
14937
15139
  let entryPoints = getFlag(options, keys2, "entryPoints", mustBeEntryPoints);
14938
15140
  let absWorkingDir = getFlag(options, keys2, "absWorkingDir", mustBeString);
14939
15141
  let stdin = getFlag(options, keys2, "stdin", mustBeObject);
14940
- let write = (_a2 = getFlag(options, keys2, "write", mustBeBoolean)) != null ? _a2 : writeDefault;
15142
+ let write = (_a22 = getFlag(options, keys2, "write", mustBeBoolean)) != null ? _a22 : writeDefault;
14941
15143
  let allowOverwrite = getFlag(options, keys2, "allowOverwrite", mustBeBoolean);
14942
15144
  let mangleCache = getFlag(options, keys2, "mangleCache", mustBeObject);
14943
15145
  keys2.plugins = true;
@@ -16313,8 +16515,8 @@ for your current platform.`);
16313
16515
  worker_threads = void 0;
16314
16516
  }
16315
16517
  }
16316
- var _a;
16317
- var isInternalWorkerThread = ((_a = worker_threads == null ? void 0 : worker_threads.workerData) == null ? void 0 : _a.esbuildVersion) === "0.27.3";
16518
+ var _a2;
16519
+ var isInternalWorkerThread = ((_a2 = worker_threads == null ? void 0 : worker_threads.workerData) == null ? void 0 : _a2.esbuildVersion) === "0.27.3";
16318
16520
  var esbuildCommandAndArgs = () => {
16319
16521
  if ((!ESBUILD_BINARY_PATH || false) && (path210.basename(__filename) !== "main.js" || path210.basename(__dirname) !== "lib")) {
16320
16522
  throw new Error(
@@ -29198,8 +29400,8 @@ var init_llk_lookahead = __esm({
29198
29400
  init_lookahead();
29199
29401
  LLkLookaheadStrategy = class {
29200
29402
  constructor(options) {
29201
- var _a;
29202
- this.maxLookahead = (_a = options === null || options === void 0 ? void 0 : options.maxLookahead) !== null && _a !== void 0 ? _a : DEFAULT_PARSER_CONFIG.maxLookahead;
29403
+ var _a2;
29404
+ this.maxLookahead = (_a2 = options === null || options === void 0 ? void 0 : options.maxLookahead) !== null && _a2 !== void 0 ? _a2 : DEFAULT_PARSER_CONFIG.maxLookahead;
29203
29405
  }
29204
29406
  validate(options) {
29205
29407
  const leftRecursionErrors = this.validateNoLeftRecursion(options.rules);
@@ -31068,8 +31270,8 @@ var init_parser = __esm({
31068
31270
  });
31069
31271
  }
31070
31272
  this.TRACE_INIT("ComputeLookaheadFunctions", () => {
31071
- var _a, _b;
31072
- (_b = (_a = this.lookaheadStrategy).initialize) === null || _b === void 0 ? void 0 : _b.call(_a, {
31273
+ var _a2, _b;
31274
+ (_b = (_a2 = this.lookaheadStrategy).initialize) === null || _b === void 0 ? void 0 : _b.call(_a2, {
31073
31275
  rules: values_default(this.gastProductionsCache)
31074
31276
  });
31075
31277
  this.preComputeLookaheadFunctions(values_default(this.gastProductionsCache));
@@ -54930,8 +55132,32 @@ function buildDiagramGraph(ast, options = {}) {
54930
55132
  const dy = ty - sy;
54931
55133
  const distance = Math.sqrt(dx * dx + dy * dy);
54932
55134
  const useCurve = forceCurveSet.has(pc2);
55135
+ const sourceColor = getPortColor(pc2.sourcePort.dataType, pc2.sourcePort.isFailure, themeName);
55136
+ const targetColor = getPortColor(pc2.targetPort.dataType, pc2.targetPort.isFailure, themeName);
55137
+ const xDistance = Math.abs(tx - sx);
55138
+ const dashed = pc2.sourcePort.dataType !== "STEP";
55139
+ const srcLabelEnd = portLabelExtent(pc2.sourcePort);
55140
+ const tgtLabelEnd = portLabelExtent(pc2.targetPort);
55141
+ const sourceStub = {
55142
+ x: sx + srcLabelEnd,
55143
+ y: sy,
55144
+ endX: sx + srcLabelEnd + STUB_LENGTH,
55145
+ labelOffset: srcLabelEnd,
55146
+ color: sourceColor,
55147
+ dashed
55148
+ };
55149
+ const targetStub = {
55150
+ x: tx - tgtLabelEnd,
55151
+ y: ty,
55152
+ endX: tx - tgtLabelEnd - STUB_LENGTH,
55153
+ labelOffset: tgtLabelEnd,
55154
+ color: targetColor,
55155
+ dashed
55156
+ };
54933
55157
  let path50;
54934
- if (!useCurve && distance > ORTHOGONAL_DISTANCE_THRESHOLD) {
55158
+ if (xDistance > STUB_DISTANCE_THRESHOLD) {
55159
+ path50 = "";
55160
+ } else if (!useCurve && distance > ORTHOGONAL_DISTANCE_THRESHOLD) {
54935
55161
  const orthoPath = calculateOrthogonalPathSafe(
54936
55162
  [sx, sy],
54937
55163
  [tx, ty],
@@ -54945,8 +55171,6 @@ function buildDiagramGraph(ast, options = {}) {
54945
55171
  } else {
54946
55172
  path50 = computeConnectionPath(sx, sy, tx, ty);
54947
55173
  }
54948
- const sourceColor = getPortColor(pc2.sourcePort.dataType, pc2.sourcePort.isFailure, themeName);
54949
- const targetColor = getPortColor(pc2.targetPort.dataType, pc2.targetPort.isFailure, themeName);
54950
55174
  connections.push({
54951
55175
  fromNode: pc2.fromNodeId,
54952
55176
  fromPort: pc2.fromPortName,
@@ -54955,7 +55179,9 @@ function buildDiagramGraph(ast, options = {}) {
54955
55179
  sourceColor,
54956
55180
  targetColor,
54957
55181
  isStepConnection: pc2.sourcePort.dataType === "STEP",
54958
- path: path50
55182
+ path: path50,
55183
+ sourceStub,
55184
+ targetStub
54959
55185
  });
54960
55186
  }
54961
55187
  for (const node of nodes) {
@@ -55139,7 +55365,7 @@ function maxPortLabelExtent(ports) {
55139
55365
  }
55140
55366
  return max;
55141
55367
  }
55142
- var PORT_RADIUS, PORT_SIZE, PORT_GAP, PORT_PADDING_Y, NODE_MIN_WIDTH, NODE_MIN_HEIGHT, BORDER_RADIUS, LAYER_GAP_X, LABEL_CLEARANCE, MIN_EDGE_GAP, NODE_GAP_Y, LABEL_HEIGHT, LABEL_GAP, SCOPE_PADDING_X, SCOPE_PADDING_Y, SCOPE_PORT_COLUMN, SCOPE_INNER_GAP_X, ORTHOGONAL_DISTANCE_THRESHOLD, CHAR_WIDTHS, DEFAULT_CHAR_WIDTH;
55368
+ var PORT_RADIUS, PORT_SIZE, PORT_GAP, PORT_PADDING_Y, NODE_MIN_WIDTH, NODE_MIN_HEIGHT, BORDER_RADIUS, LAYER_GAP_X, LABEL_CLEARANCE, MIN_EDGE_GAP, NODE_GAP_Y, LABEL_HEIGHT, LABEL_GAP, SCOPE_PADDING_X, SCOPE_PADDING_Y, SCOPE_PORT_COLUMN, SCOPE_INNER_GAP_X, ORTHOGONAL_DISTANCE_THRESHOLD, STUB_DISTANCE_THRESHOLD, STUB_LENGTH, CHAR_WIDTHS, DEFAULT_CHAR_WIDTH;
55143
55369
  var init_geometry = __esm({
55144
55370
  "src/diagram/geometry.ts"() {
55145
55371
  "use strict";
@@ -55166,6 +55392,8 @@ var init_geometry = __esm({
55166
55392
  SCOPE_PORT_COLUMN = 50;
55167
55393
  SCOPE_INNER_GAP_X = 240;
55168
55394
  ORTHOGONAL_DISTANCE_THRESHOLD = 300;
55395
+ STUB_DISTANCE_THRESHOLD = 500;
55396
+ STUB_LENGTH = 30;
55169
55397
  CHAR_WIDTHS = {
55170
55398
  " ": 2.78,
55171
55399
  "!": 3.34,
@@ -56103,8 +56331,15 @@ function renderSVG(graph, options = {}) {
56103
56331
  parts.push(`<rect x="${vbX}" y="${vbY}" width="${vbWidth}" height="${vbHeight}" fill="url(#dot-grid)"/>`);
56104
56332
  parts.push(`<g class="connections">`);
56105
56333
  for (let i = 0; i < graph.connections.length; i++) {
56106
- renderConnection(parts, graph.connections[i], i);
56334
+ renderConnection(parts, graph.connections[i], i, !graph.connections[i].path);
56107
56335
  }
56336
+ parts.push(` <g class="stubs">`);
56337
+ for (const conn of graph.connections) {
56338
+ const hideStubs = !!conn.path;
56339
+ if (conn.sourceStub) renderStub(parts, conn.sourceStub, conn, hideStubs);
56340
+ if (conn.targetStub) renderStub(parts, conn.targetStub, conn, hideStubs);
56341
+ }
56342
+ parts.push(` </g>`);
56108
56343
  parts.push(`</g>`);
56109
56344
  parts.push(`<g class="nodes">`);
56110
56345
  for (const node of graph.nodes) {
@@ -56138,12 +56373,26 @@ function renderSVG(graph, options = {}) {
56138
56373
  parts.push(`</svg>`);
56139
56374
  return parts.join("\n");
56140
56375
  }
56141
- function renderConnection(parts, conn, gradIndex) {
56376
+ function renderConnection(parts, conn, gradIndex, hidden = false) {
56142
56377
  const dashAttr = conn.isStepConnection ? "" : ' stroke-dasharray="8 4"';
56378
+ const displayAttr = hidden ? ' display="none"' : "";
56379
+ const pathD = conn.path || "M0,0";
56143
56380
  parts.push(
56144
- ` <path d="${conn.path}" fill="none" stroke="url(#conn-grad-${gradIndex})" stroke-width="3"${dashAttr} stroke-linecap="round" data-source="${escapeXml(conn.fromNode)}.${escapeXml(conn.fromPort)}:output" data-target="${escapeXml(conn.toNode)}.${escapeXml(conn.toPort)}:input"/>`
56381
+ ` <path d="${pathD}" fill="none" stroke="url(#conn-grad-${gradIndex})" stroke-width="3"${dashAttr} stroke-linecap="round" data-source="${escapeXml(conn.fromNode)}.${escapeXml(conn.fromPort)}:output" data-target="${escapeXml(conn.toNode)}.${escapeXml(conn.toPort)}:input"${displayAttr}/>`
56145
56382
  );
56146
56383
  }
56384
+ function renderStub(parts, stub, conn, hidden = false) {
56385
+ const dashAttr = stub.dashed ? ' stroke-dasharray="6 3"' : "";
56386
+ const displayAttr = hidden ? ' display="none"' : "";
56387
+ const dataAttrs = `data-source="${escapeXml(conn.fromNode)}.${escapeXml(conn.fromPort)}:output" data-target="${escapeXml(conn.toNode)}.${escapeXml(conn.toPort)}:input"`;
56388
+ const isSource = stub.endX > stub.x;
56389
+ const stubDir = isSource ? "source" : "target";
56390
+ parts.push(` <g class="stub" data-stub="${stubDir}" ${dataAttrs}${displayAttr}>`);
56391
+ const linecap = stub.dashed ? "butt" : "round";
56392
+ parts.push(` <line x1="${stub.x}" y1="${stub.y}" x2="${stub.endX}" y2="${stub.y}" stroke="${stub.color}" stroke-width="2"${dashAttr} stroke-linecap="${linecap}"/>`);
56393
+ parts.push(` <circle cx="${stub.endX}" cy="${stub.y}" r="3" fill="${stub.color}"/>`);
56394
+ parts.push(` </g>`);
56395
+ }
56147
56396
  function renderScopeConnection(parts, conn, allConnections, parentNodeId) {
56148
56397
  const gradIndex = allConnections.indexOf(conn);
56149
56398
  if (gradIndex < 0) return;
@@ -56216,7 +56465,7 @@ function renderNodeLabel(parts, node, theme) {
56216
56465
  const labelTextX = isScoped ? node.x + 8 : node.x + node.width / 2;
56217
56466
  const labelAnchor = isScoped ? "start" : "middle";
56218
56467
  parts.push(` <g data-label-for="${escapeXml(node.id)}">`);
56219
- parts.push(` <rect x="${labelBgX}" y="${labelBgY}" width="${labelBgWidth}" height="${labelBgHeight}" rx="6" fill="${theme.labelBadgeFill}" opacity="0.8"/>`);
56468
+ parts.push(` <rect x="${labelBgX}" y="${labelBgY}" width="${labelBgWidth}" height="${labelBgHeight}" rx="6" fill="${theme.labelBadgeFill}" opacity="0.95"/>`);
56220
56469
  parts.push(` <text class="node-label" x="${labelTextX}" y="${labelBgY + labelBgHeight / 2 + 6}" text-anchor="${labelAnchor}" fill="${node.color !== NODE_DEFAULT_COLOR ? node.color : theme.labelColor}">${labelText}</text>`);
56221
56470
  parts.push(` </g>`);
56222
56471
  }
@@ -56334,19 +56583,19 @@ body {
56334
56583
  transition: opacity 0.15s ease-in-out;
56335
56584
  }
56336
56585
 
56337
- /* Connection hover & dimming (attribute selector covers both main and scope connections) */
56338
- path[data-source] { transition: opacity 0.2s ease, stroke-width 0.15s ease; }
56339
- path[data-source]:hover { stroke-width: 4; cursor: pointer; }
56340
- body.node-active path[data-source].dimmed,
56341
- body.port-active path[data-source].dimmed { opacity: 0.1; }
56342
- body.port-hovered path[data-source].dimmed { opacity: 0.25; }
56586
+ /* Connection hover & dimming (covers paths + stub lines) */
56587
+ [data-source] { transition: opacity 0.2s ease, stroke-width 0.15s ease; }
56588
+ [data-source]:hover { stroke-width: 4; cursor: pointer; }
56589
+ body.node-active [data-source].dimmed,
56590
+ body.port-active [data-source].dimmed { opacity: 0.1; }
56591
+ body.port-hovered [data-source].dimmed { opacity: 0.25; }
56343
56592
 
56344
56593
  /* Port circles are interactive */
56345
56594
  circle[data-port-id] { cursor: pointer; }
56346
56595
  circle[data-port-id]:hover { stroke-width: 3; filter: brightness(1.3); }
56347
56596
 
56348
56597
  /* Port-click highlighting */
56349
- path[data-source].highlighted { opacity: 1; }
56598
+ [data-source].highlighted { opacity: 1; }
56350
56599
  circle[data-port-id].port-selected { filter: drop-shadow(0 0 6px currentColor); stroke-width: 4; }
56351
56600
 
56352
56601
  /* Node selection glow */
@@ -56358,7 +56607,7 @@ circle[data-port-id].port-selected { filter: drop-shadow(0 0 6px currentColor);
56358
56607
  .node-glow { fill: none; pointer-events: none; animation: select-pop 0.3s ease-out forwards; }
56359
56608
 
56360
56609
  /* Port hover path highlight */
56361
- path[data-source].port-hover { opacity: 1; }
56610
+ [data-source].port-hover { opacity: 1; }
56362
56611
 
56363
56612
  /* Node hover glow + draggable cursor */
56364
56613
  .nodes g[data-node-id] { cursor: grab; }
@@ -56808,12 +57057,16 @@ path[data-source].port-hover { opacity: 1; }
56808
57057
  labelMap[lbl.getAttribute('data-port-label')] = lbl;
56809
57058
  });
56810
57059
 
56811
- // Build adjacency: portId -> array of connected portIds
57060
+ // Build adjacency: portId -> array of connected portIds (covers paths + stubs)
56812
57061
  var portConnections = {};
56813
- content.querySelectorAll('path[data-source]').forEach(function(p) {
57062
+ var seenEdges = {};
57063
+ content.querySelectorAll('[data-source]').forEach(function(p) {
56814
57064
  var src = p.getAttribute('data-source');
56815
57065
  var tgt = p.getAttribute('data-target');
56816
57066
  if (!src || !tgt) return;
57067
+ var key = src + '|' + tgt;
57068
+ if (seenEdges[key]) return; // avoid duplicates from path+stub pairs
57069
+ seenEdges[key] = true;
56817
57070
  if (!portConnections[src]) portConnections[src] = [];
56818
57071
  if (!portConnections[tgt]) portConnections[tgt] = [];
56819
57072
  portConnections[src].push(tgt);
@@ -56823,6 +57076,7 @@ path[data-source].port-hover { opacity: 1; }
56823
57076
  // ---- Connection path computation (bezier from geometry.ts + orthogonal router) ----
56824
57077
  var TRACK_SPACING = 15, EDGE_OFFSET = 5, MAX_CANDIDATES = 5;
56825
57078
  var MIN_SEG_LEN = 3, JOG_THRESHOLD = 10, ORTHO_THRESHOLD = 300;
57079
+ var STUB_THRESHOLD = 500, STUB_LEN = 30;
56826
57080
 
56827
57081
  function quadCurveControl(ax, ay, bx, by, ux, uy) {
56828
57082
  var dn = Math.abs(ay - by);
@@ -57172,8 +57426,66 @@ path[data-source].port-hover { opacity: 1; }
57172
57426
  var srcIdx = portIndexMap[srcNode] ? portIndexMap[srcNode].output.indexOf(src) : 0;
57173
57427
  var tgtIdx = portIndexMap[tgtNode] ? portIndexMap[tgtNode].input.indexOf(tgt) : 0;
57174
57428
  connIndex.push({ el: p, src: src, tgt: tgt, srcNode: srcNode, tgtNode: tgtNode,
57175
- scopeOf: p.getAttribute('data-scope') || null, srcIdx: Math.max(0, srcIdx), tgtIdx: Math.max(0, tgtIdx) });
57429
+ scopeOf: p.getAttribute('data-scope') || null, srcIdx: Math.max(0, srcIdx), tgtIdx: Math.max(0, tgtIdx),
57430
+ stubs: null });
57431
+ });
57432
+
57433
+ // Build stub index and link to connIndex entries.
57434
+ // Compute labelOffset per stub (distance from port center to SVG stub start).
57435
+ // In HTML, stubs start from port center; on label hover they push out past the badge.
57436
+ var stubMap = {};
57437
+ content.querySelectorAll('.stubs g.stub[data-source]').forEach(function(el) {
57438
+ var src = el.getAttribute('data-source');
57439
+ var tgt = el.getAttribute('data-target');
57440
+ var key = src + '|' + tgt;
57441
+ if (!stubMap[key]) stubMap[key] = { src: null, tgt: null, srcOff: 0, tgtOff: 0 };
57442
+ var dir = el.getAttribute('data-stub');
57443
+ var line = el.querySelector('line');
57444
+ if (dir === 'source') {
57445
+ stubMap[key].src = el;
57446
+ if (line) {
57447
+ var pp = portPositions[src];
57448
+ if (pp) stubMap[key].srcOff = parseFloat(line.getAttribute('x1')) - pp.cx;
57449
+ }
57450
+ } else {
57451
+ stubMap[key].tgt = el;
57452
+ if (line) {
57453
+ var pp = portPositions[tgt];
57454
+ if (pp) stubMap[key].tgtOff = parseFloat(line.getAttribute('x1')) - pp.cx;
57455
+ }
57456
+ }
57176
57457
  });
57458
+ for (var ci = 0; ci < connIndex.length; ci++) {
57459
+ var entry = connIndex[ci];
57460
+ var stubKey = entry.src + '|' + entry.tgt;
57461
+ if (stubMap[stubKey]) entry.stubs = stubMap[stubKey];
57462
+ }
57463
+
57464
+ // Pull all visible stubs to port center on init (labels are hidden in HTML)
57465
+ for (var si = 0; si < connIndex.length; si++) {
57466
+ var sc = connIndex[si];
57467
+ if (!sc.stubs) continue;
57468
+ if (sc.stubs.src) {
57469
+ var sLine = sc.stubs.src.querySelector('line');
57470
+ var sCirc = sc.stubs.src.querySelector('circle');
57471
+ var spp = portPositions[sc.src];
57472
+ if (sLine && spp) {
57473
+ sLine.setAttribute('x1', spp.cx); sLine.setAttribute('y1', spp.cy);
57474
+ sLine.setAttribute('x2', spp.cx + STUB_LEN); sLine.setAttribute('y2', spp.cy);
57475
+ if (sCirc) { sCirc.setAttribute('cx', spp.cx + STUB_LEN); sCirc.setAttribute('cy', spp.cy); }
57476
+ }
57477
+ }
57478
+ if (sc.stubs.tgt) {
57479
+ var tLine = sc.stubs.tgt.querySelector('line');
57480
+ var tCirc = sc.stubs.tgt.querySelector('circle');
57481
+ var tpp = portPositions[sc.tgt];
57482
+ if (tLine && tpp) {
57483
+ tLine.setAttribute('x1', tpp.cx); tLine.setAttribute('y1', tpp.cy);
57484
+ tLine.setAttribute('x2', tpp.cx - STUB_LEN); tLine.setAttribute('y2', tpp.cy);
57485
+ if (tCirc) { tCirc.setAttribute('cx', tpp.cx - STUB_LEN); tCirc.setAttribute('cy', tpp.cy); }
57486
+ }
57487
+ }
57488
+ }
57177
57489
 
57178
57490
  // Snapshot of original port positions for reset
57179
57491
  var origPortPositions = {};
@@ -57186,8 +57498,10 @@ path[data-source].port-hover { opacity: 1; }
57186
57498
  origNodeBoxMap[nid] = { id: b.id, x: b.x, y: b.y, w: b.w, h: b.h };
57187
57499
  }
57188
57500
 
57189
- // ---- Recalculate all connection paths using orthogonal + bezier routing ----
57501
+ // ---- Recalculate all connection paths + stubs using orthogonal + bezier routing ----
57190
57502
  function recalcAllPaths() {
57503
+ // Cancel all running stub animations since we're hard-repositioning
57504
+ for (var ak in activeAnims) { cancelAnimationFrame(activeAnims[ak]); delete activeAnims[ak]; }
57191
57505
  var boxes = [];
57192
57506
  for (var nid in nodeBoxMap) boxes.push(nodeBoxMap[nid]);
57193
57507
  var sorted = connIndex.slice().sort(function(a, b) {
@@ -57210,15 +57524,46 @@ path[data-source].port-hover { opacity: 1; }
57210
57524
  var pOff = nodeOffsets[c.scopeOf] || { dx: 0, dy: 0 };
57211
57525
  sx -= pOff.dx; sy -= pOff.dy; tx -= pOff.dx; ty -= pOff.dy;
57212
57526
  }
57213
- var ddx = tx - sx, ddy = ty - sy, dist = Math.sqrt(ddx * ddx + ddy * ddy);
57214
- var path;
57215
- if (dist > ORTHO_THRESHOLD) {
57216
- path = calcOrthogonalPath([sx, sy], [tx, ty], boxes, c.srcNode, c.tgtNode, c.srcIdx, c.tgtIdx, alloc);
57217
- if (!path) path = computeConnectionPath(sx, sy, tx, ty);
57527
+ var xDist = Math.abs(tx - sx);
57528
+
57529
+ if (xDist > STUB_THRESHOLD) {
57530
+ // Stub mode: hide path, show and reposition stubs
57531
+ c.el.setAttribute('display', 'none');
57532
+ if (c.stubs) {
57533
+ if (c.stubs.src) {
57534
+ var sLen = isLabelVisible(c.src) ? c.stubs.srcOff + STUB_LEN : STUB_LEN;
57535
+ var sLine = c.stubs.src.querySelector('line');
57536
+ var sCirc = c.stubs.src.querySelector('circle');
57537
+ if (sLine) { sLine.setAttribute('x1', sx); sLine.setAttribute('y1', sy); sLine.setAttribute('x2', sx + sLen); sLine.setAttribute('y2', sy); }
57538
+ if (sCirc) { sCirc.setAttribute('cx', sx + sLen); sCirc.setAttribute('cy', sy); }
57539
+ c.stubs.src.removeAttribute('display');
57540
+ }
57541
+ if (c.stubs.tgt) {
57542
+ var tLen = isLabelVisible(c.tgt) ? c.stubs.tgtOff - STUB_LEN : -STUB_LEN;
57543
+ var tLine = c.stubs.tgt.querySelector('line');
57544
+ var tCirc = c.stubs.tgt.querySelector('circle');
57545
+ if (tLine) { tLine.setAttribute('x1', tx); tLine.setAttribute('y1', ty); tLine.setAttribute('x2', tx + tLen); tLine.setAttribute('y2', ty); }
57546
+ if (tCirc) { tCirc.setAttribute('cx', tx + tLen); tCirc.setAttribute('cy', ty); }
57547
+ c.stubs.tgt.removeAttribute('display');
57548
+ }
57549
+ }
57218
57550
  } else {
57219
- path = computeConnectionPath(sx, sy, tx, ty);
57551
+ // Path mode: show path, hide stubs
57552
+ var ddx = tx - sx, ddy = ty - sy, dist = Math.sqrt(ddx * ddx + ddy * ddy);
57553
+ var path;
57554
+ if (dist > ORTHO_THRESHOLD) {
57555
+ path = calcOrthogonalPath([sx, sy], [tx, ty], boxes, c.srcNode, c.tgtNode, c.srcIdx, c.tgtIdx, alloc);
57556
+ if (!path) path = computeConnectionPath(sx, sy, tx, ty);
57557
+ } else {
57558
+ path = computeConnectionPath(sx, sy, tx, ty);
57559
+ }
57560
+ c.el.setAttribute('d', path);
57561
+ c.el.removeAttribute('display');
57562
+ if (c.stubs) {
57563
+ if (c.stubs.src) c.stubs.src.setAttribute('display', 'none');
57564
+ if (c.stubs.tgt) c.stubs.tgt.setAttribute('display', 'none');
57565
+ }
57220
57566
  }
57221
- c.el.setAttribute('d', path);
57222
57567
  }
57223
57568
  }
57224
57569
 
@@ -57336,9 +57681,75 @@ path[data-source].port-hover { opacity: 1; }
57336
57681
 
57337
57682
  var allLabelIds = Object.keys(labelMap);
57338
57683
  var hoveredPort = null;
57684
+ var hoveredNode = null;
57685
+ var activeAnims = {};
57686
+
57687
+ // Build reverse map: portId -> array of { connEntry, isSource }
57688
+ var portStubMap = {};
57689
+ for (var psi = 0; psi < connIndex.length; psi++) {
57690
+ var psc = connIndex[psi];
57691
+ if (!psc.stubs) continue;
57692
+ if (psc.stubs.src) {
57693
+ if (!portStubMap[psc.src]) portStubMap[psc.src] = [];
57694
+ portStubMap[psc.src].push({ c: psc, isSource: true });
57695
+ }
57696
+ if (psc.stubs.tgt) {
57697
+ if (!portStubMap[psc.tgt]) portStubMap[psc.tgt] = [];
57698
+ portStubMap[psc.tgt].push({ c: psc, isSource: false });
57699
+ }
57700
+ }
57701
+
57702
+ function isLabelVisible(id) {
57703
+ var l = labelMap[id];
57704
+ return l && l.style.opacity === '1';
57705
+ }
57706
+
57707
+ // Batch mode: defer stub sync until all label changes are done
57708
+ var stubSyncDeferred = false;
57709
+ var stubSyncPorts = {};
57710
+
57711
+ function showLabel(id) {
57712
+ var l = labelMap[id];
57713
+ if (l) { l.style.opacity = '1'; l.style.pointerEvents = 'auto'; }
57714
+ if (stubSyncDeferred) { stubSyncPorts[id] = true; }
57715
+ else { syncStubsForPort(id); }
57716
+ }
57717
+ function hideLabel(id) {
57718
+ var l = labelMap[id];
57719
+ if (l) { l.style.opacity = '0'; l.style.pointerEvents = 'none'; }
57720
+ if (stubSyncDeferred) { stubSyncPorts[id] = true; }
57721
+ else { syncStubsForPort(id); }
57722
+ }
57339
57723
 
57340
- function showLabel(id) { var l = labelMap[id]; if (l) { l.style.opacity = '1'; l.style.pointerEvents = 'auto'; } }
57341
- function hideLabel(id) { var l = labelMap[id]; if (l) { l.style.opacity = '0'; l.style.pointerEvents = 'none'; } }
57724
+ // Batch label changes: do all shows/hides, then sync stubs once
57725
+ function batchLabelChanges(fn) {
57726
+ stubSyncDeferred = true;
57727
+ stubSyncPorts = {};
57728
+ fn();
57729
+ stubSyncDeferred = false;
57730
+ for (var pid in stubSyncPorts) syncStubsForPort(pid);
57731
+ }
57732
+
57733
+ function syncStubsForPort(portId) {
57734
+ var entries = portStubMap[portId];
57735
+ if (!entries) return;
57736
+ var visible = isLabelVisible(portId);
57737
+ for (var ei = 0; ei < entries.length; ei++) {
57738
+ growStub(entries[ei].c.stubs, entries[ei].c, entries[ei].isSource, visible);
57739
+ }
57740
+ }
57741
+
57742
+ // Safety net: verify all stubs match their port label visibility.
57743
+ // Runs as a rAF so it fires after all events and microtasks settle.
57744
+ var stubVerifyScheduled = false;
57745
+ function scheduleStubVerify() {
57746
+ if (stubVerifyScheduled) return;
57747
+ stubVerifyScheduled = true;
57748
+ requestAnimationFrame(function() {
57749
+ stubVerifyScheduled = false;
57750
+ for (var pid in portStubMap) syncStubsForPort(pid);
57751
+ });
57752
+ }
57342
57753
 
57343
57754
  function showLabelsFor(nodeId) {
57344
57755
  allLabelIds.forEach(function(id) {
@@ -57351,6 +57762,52 @@ path[data-source].port-hover { opacity: 1; }
57351
57762
  });
57352
57763
  }
57353
57764
 
57765
+ // Animate a stub growing/shrinking. The line x1 stays at port center,
57766
+ // x2 and circle cx extend to targetLen from port center (signed: positive=right, negative=left).
57767
+ function animateStub(stubG, targetLen, key) {
57768
+ if (!stubG) return;
57769
+ var line = stubG.querySelector('line');
57770
+ var circ = stubG.querySelector('circle');
57771
+ if (!line) return;
57772
+ var x1 = parseFloat(line.getAttribute('x1'));
57773
+ var curX2 = parseFloat(line.getAttribute('x2'));
57774
+ var curLen = curX2 - x1;
57775
+ var goalX2 = x1 + targetLen;
57776
+ if (Math.abs(curLen - targetLen) < 0.5) {
57777
+ line.setAttribute('x2', goalX2);
57778
+ if (circ) circ.setAttribute('cx', goalX2);
57779
+ return;
57780
+ }
57781
+ if (activeAnims[key]) cancelAnimationFrame(activeAnims[key]);
57782
+ var start = null, duration = 150, startLen = curLen;
57783
+ function step(ts) {
57784
+ if (!start) start = ts;
57785
+ var t = Math.min((ts - start) / duration, 1);
57786
+ t = t * (2 - t); // ease-out quad
57787
+ var len = startLen + (targetLen - startLen) * t;
57788
+ var x2 = x1 + len;
57789
+ line.setAttribute('x2', x2);
57790
+ if (circ) circ.setAttribute('cx', x2);
57791
+ if (t < 1) activeAnims[key] = requestAnimationFrame(step);
57792
+ else delete activeAnims[key];
57793
+ }
57794
+ activeAnims[key] = requestAnimationFrame(step);
57795
+ }
57796
+
57797
+ function growStub(stubs, connEntry, isSource, grow) {
57798
+ if (!stubs) return;
57799
+ var stubG = isSource ? stubs.src : stubs.tgt;
57800
+ if (!stubG) return;
57801
+ var off = isSource ? stubs.srcOff : stubs.tgtOff;
57802
+ // Source stubs grow right (+), target stubs grow left (-).
57803
+ // off is already signed (positive for source, negative for target).
57804
+ var shortLen = isSource ? STUB_LEN : -STUB_LEN;
57805
+ var fullLen = off + shortLen;
57806
+ var targetLen = grow ? fullLen : shortLen;
57807
+ var key = connEntry.src + '|' + connEntry.tgt + (isSource ? ':s' : ':t');
57808
+ animateStub(stubG, targetLen, key);
57809
+ }
57810
+
57354
57811
  // Node hover: show all port labels for the hovered node
57355
57812
  var nodeEls = content.querySelectorAll('.nodes g[data-node-id]');
57356
57813
  nodeEls.forEach(function(nodeG) {
@@ -57358,14 +57815,27 @@ path[data-source].port-hover { opacity: 1; }
57358
57815
  var parentNodeG = nodeG.parentElement ? nodeG.parentElement.closest('g[data-node-id]') : null;
57359
57816
  var parentId = parentNodeG ? parentNodeG.getAttribute('data-node-id') : null;
57360
57817
  nodeG.addEventListener('mouseenter', function() {
57818
+ hoveredNode = nodeId;
57361
57819
  if (hoveredPort) return;
57362
- if (parentId) hideLabelsFor(parentId);
57363
- showLabelsFor(nodeId);
57820
+ batchLabelChanges(function() {
57821
+ if (parentId) hideLabelsFor(parentId);
57822
+ showLabelsFor(nodeId);
57823
+ });
57824
+ scheduleStubVerify();
57364
57825
  });
57365
57826
  nodeG.addEventListener('mouseleave', function() {
57366
- if (hoveredPort) return;
57367
- hideLabelsFor(nodeId);
57368
- if (parentId) showLabelsFor(parentId);
57827
+ // Defer so port mouseenter can set hoveredPort first
57828
+ var nid = nodeId, pid = parentId;
57829
+ if (hoveredNode === nodeId) hoveredNode = null;
57830
+ Promise.resolve().then(function() {
57831
+ if (hoveredPort) return;
57832
+ if (hoveredNode === nid) return; // re-entered the node
57833
+ batchLabelChanges(function() {
57834
+ hideLabelsFor(nid);
57835
+ if (pid) showLabelsFor(pid);
57836
+ });
57837
+ scheduleStubVerify();
57838
+ });
57369
57839
  });
57370
57840
  });
57371
57841
 
@@ -57377,10 +57847,13 @@ path[data-source].port-hover { opacity: 1; }
57377
57847
 
57378
57848
  portEl.addEventListener('mouseenter', function() {
57379
57849
  hoveredPort = portId;
57380
- hideLabelsFor(nodeId);
57381
- peers.forEach(showLabel);
57850
+ batchLabelChanges(function() {
57851
+ hideLabelsFor(nodeId);
57852
+ peers.forEach(showLabel);
57853
+ });
57854
+ scheduleStubVerify();
57382
57855
  document.body.classList.add('port-hovered');
57383
- content.querySelectorAll('path[data-source]').forEach(function(p) {
57856
+ content.querySelectorAll('[data-source]').forEach(function(p) {
57384
57857
  if (p.getAttribute('data-source') === portId || p.getAttribute('data-target') === portId) {
57385
57858
  p.classList.remove('dimmed');
57386
57859
  } else {
@@ -57390,11 +57863,19 @@ path[data-source].port-hover { opacity: 1; }
57390
57863
  });
57391
57864
  portEl.addEventListener('mouseleave', function() {
57392
57865
  hoveredPort = null;
57393
- peers.forEach(hideLabel);
57394
- showLabelsFor(nodeId);
57395
- document.body.classList.remove('port-hovered');
57396
- content.querySelectorAll('path[data-source].dimmed').forEach(function(p) {
57397
- p.classList.remove('dimmed');
57866
+ // Defer so if entering another port, its mouseenter sets hoveredPort first
57867
+ var myPeers = peers, myNodeId = nodeId;
57868
+ Promise.resolve().then(function() {
57869
+ if (hoveredPort) return; // moved to another port
57870
+ batchLabelChanges(function() {
57871
+ myPeers.forEach(hideLabel);
57872
+ showLabelsFor(myNodeId);
57873
+ });
57874
+ document.body.classList.remove('port-hovered');
57875
+ content.querySelectorAll('[data-source].dimmed').forEach(function(p) {
57876
+ p.classList.remove('dimmed');
57877
+ });
57878
+ scheduleStubVerify();
57398
57879
  });
57399
57880
  });
57400
57881
  });
@@ -57429,7 +57910,7 @@ path[data-source].port-hover { opacity: 1; }
57429
57910
  content.querySelectorAll('circle.port-selected').forEach(function(c) {
57430
57911
  c.classList.remove('port-selected');
57431
57912
  });
57432
- content.querySelectorAll('path[data-source].dimmed, path[data-source].highlighted').forEach(function(p) {
57913
+ content.querySelectorAll('[data-source].dimmed, [data-source].highlighted').forEach(function(p) {
57433
57914
  p.classList.remove('dimmed');
57434
57915
  p.classList.remove('highlighted');
57435
57916
  });
@@ -57445,7 +57926,7 @@ path[data-source].port-hover { opacity: 1; }
57445
57926
  var portEl = content.querySelector('[data-port-id="' + CSS.escape(portId) + '"]');
57446
57927
  if (portEl) portEl.classList.add('port-selected');
57447
57928
 
57448
- content.querySelectorAll('path[data-source]').forEach(function(p) {
57929
+ content.querySelectorAll('[data-source]').forEach(function(p) {
57449
57930
  if (p.getAttribute('data-source') === portId || p.getAttribute('data-target') === portId) {
57450
57931
  p.classList.add('highlighted');
57451
57932
  } else {
@@ -57465,7 +57946,7 @@ path[data-source].port-hover { opacity: 1; }
57465
57946
  infoPanel.classList.remove('fullscreen');
57466
57947
  btnExpand.innerHTML = expandIcon;
57467
57948
  removeNodeGlow();
57468
- content.querySelectorAll('path[data-source].dimmed').forEach(function(p) {
57949
+ content.querySelectorAll('[data-source].dimmed').forEach(function(p) {
57469
57950
  p.classList.remove('dimmed');
57470
57951
  });
57471
57952
  }
@@ -57493,7 +57974,7 @@ path[data-source].port-hover { opacity: 1; }
57493
57974
  });
57494
57975
 
57495
57976
  // Connected paths
57496
- var allPaths = content.querySelectorAll('path[data-source]');
57977
+ var allPaths = content.querySelectorAll('[data-source]');
57497
57978
  var connectedNodes = new Set();
57498
57979
  allPaths.forEach(function(p) {
57499
57980
  var src = p.getAttribute('data-source') || '';
@@ -60984,12 +61465,12 @@ var require_code = __commonJS({
60984
61465
  return item === "" || item === '""';
60985
61466
  }
60986
61467
  get str() {
60987
- var _a;
60988
- return (_a = this._str) !== null && _a !== void 0 ? _a : this._str = this._items.reduce((s, c) => `${s}${c}`, "");
61468
+ var _a2;
61469
+ return (_a2 = this._str) !== null && _a2 !== void 0 ? _a2 : this._str = this._items.reduce((s, c) => `${s}${c}`, "");
60989
61470
  }
60990
61471
  get names() {
60991
- var _a;
60992
- return (_a = this._names) !== null && _a !== void 0 ? _a : this._names = this._items.reduce((names, c) => {
61472
+ var _a2;
61473
+ return (_a2 = this._names) !== null && _a2 !== void 0 ? _a2 : this._names = this._items.reduce((names, c) => {
60993
61474
  if (c instanceof Name)
60994
61475
  names[c.str] = (names[c.str] || 0) + 1;
60995
61476
  return names;
@@ -61135,8 +61616,8 @@ var require_scope = __commonJS({
61135
61616
  return `${prefix}${ng.index++}`;
61136
61617
  }
61137
61618
  _nameGroup(prefix) {
61138
- var _a, _b;
61139
- if (((_b = (_a = this._parent) === null || _a === void 0 ? void 0 : _a._prefixes) === null || _b === void 0 ? void 0 : _b.has(prefix)) || this._prefixes && !this._prefixes.has(prefix)) {
61619
+ var _a2, _b;
61620
+ if (((_b = (_a2 = this._parent) === null || _a2 === void 0 ? void 0 : _a2._prefixes) === null || _b === void 0 ? void 0 : _b.has(prefix)) || this._prefixes && !this._prefixes.has(prefix)) {
61140
61621
  throw new Error(`CodeGen: prefix "${prefix}" is not allowed in this scope`);
61141
61622
  }
61142
61623
  return this._names[prefix] = { prefix, index: 0 };
@@ -61169,12 +61650,12 @@ var require_scope = __commonJS({
61169
61650
  return new ValueScopeName(prefix, this._newName(prefix));
61170
61651
  }
61171
61652
  value(nameOrPrefix, value) {
61172
- var _a;
61653
+ var _a2;
61173
61654
  if (value.ref === void 0)
61174
61655
  throw new Error("CodeGen: ref must be passed in value");
61175
61656
  const name = this.toName(nameOrPrefix);
61176
61657
  const { prefix } = name;
61177
- const valueKey = (_a = value.key) !== null && _a !== void 0 ? _a : value.ref;
61658
+ const valueKey = (_a2 = value.key) !== null && _a2 !== void 0 ? _a2 : value.ref;
61178
61659
  let vs = this._values[prefix];
61179
61660
  if (vs) {
61180
61661
  const _name = vs.get(valueKey);
@@ -61492,8 +61973,8 @@ var require_codegen = __commonJS({
61492
61973
  return this;
61493
61974
  }
61494
61975
  optimizeNames(names, constants) {
61495
- var _a;
61496
- this.else = (_a = this.else) === null || _a === void 0 ? void 0 : _a.optimizeNames(names, constants);
61976
+ var _a2;
61977
+ this.else = (_a2 = this.else) === null || _a2 === void 0 ? void 0 : _a2.optimizeNames(names, constants);
61497
61978
  if (!(super.optimizeNames(names, constants) || this.else))
61498
61979
  return;
61499
61980
  this.condition = optimizeExpr(this.condition, names, constants);
@@ -61597,16 +62078,16 @@ var require_codegen = __commonJS({
61597
62078
  return code;
61598
62079
  }
61599
62080
  optimizeNodes() {
61600
- var _a, _b;
62081
+ var _a2, _b;
61601
62082
  super.optimizeNodes();
61602
- (_a = this.catch) === null || _a === void 0 ? void 0 : _a.optimizeNodes();
62083
+ (_a2 = this.catch) === null || _a2 === void 0 ? void 0 : _a2.optimizeNodes();
61603
62084
  (_b = this.finally) === null || _b === void 0 ? void 0 : _b.optimizeNodes();
61604
62085
  return this;
61605
62086
  }
61606
62087
  optimizeNames(names, constants) {
61607
- var _a, _b;
62088
+ var _a2, _b;
61608
62089
  super.optimizeNames(names, constants);
61609
- (_a = this.catch) === null || _a === void 0 ? void 0 : _a.optimizeNames(names, constants);
62090
+ (_a2 = this.catch) === null || _a2 === void 0 ? void 0 : _a2.optimizeNames(names, constants);
61610
62091
  (_b = this.finally) === null || _b === void 0 ? void 0 : _b.optimizeNames(names, constants);
61611
62092
  return this;
61612
62093
  }
@@ -62386,8 +62867,8 @@ var require_applicability = __commonJS({
62386
62867
  }
62387
62868
  exports2.shouldUseGroup = shouldUseGroup;
62388
62869
  function shouldUseRule(schema2, rule) {
62389
- var _a;
62390
- return schema2[rule.keyword] !== void 0 || ((_a = rule.definition.implements) === null || _a === void 0 ? void 0 : _a.some((kwd) => schema2[kwd] !== void 0));
62870
+ var _a2;
62871
+ return schema2[rule.keyword] !== void 0 || ((_a2 = rule.definition.implements) === null || _a2 === void 0 ? void 0 : _a2.some((kwd) => schema2[kwd] !== void 0));
62391
62872
  }
62392
62873
  exports2.shouldUseRule = shouldUseRule;
62393
62874
  }
@@ -62775,14 +63256,14 @@ var require_keyword = __commonJS({
62775
63256
  }
62776
63257
  exports2.macroKeywordCode = macroKeywordCode;
62777
63258
  function funcKeywordCode(cxt, def) {
62778
- var _a;
63259
+ var _a2;
62779
63260
  const { gen, keyword, schema: schema2, parentSchema, $data, it } = cxt;
62780
63261
  checkAsyncKeyword(it, def);
62781
63262
  const validate = !$data && def.compile ? def.compile.call(it.self, schema2, parentSchema, it) : def.validate;
62782
63263
  const validateRef = useKeyword(gen, keyword, validate);
62783
63264
  const valid = gen.let("valid");
62784
63265
  cxt.block$data(valid, validateKeyword);
62785
- cxt.ok((_a = def.valid) !== null && _a !== void 0 ? _a : valid);
63266
+ cxt.ok((_a2 = def.valid) !== null && _a2 !== void 0 ? _a2 : valid);
62786
63267
  function validateKeyword() {
62787
63268
  if (def.errors === false) {
62788
63269
  assignValid();
@@ -62813,8 +63294,8 @@ var require_keyword = __commonJS({
62813
63294
  gen.assign(valid, (0, codegen_1._)`${_await}${(0, code_1.callValidateCode)(cxt, validateRef, passCxt, passSchema)}`, def.modifying);
62814
63295
  }
62815
63296
  function reportErrs(errors2) {
62816
- var _a2;
62817
- gen.if((0, codegen_1.not)((_a2 = def.valid) !== null && _a2 !== void 0 ? _a2 : valid), errors2);
63297
+ var _a3;
63298
+ gen.if((0, codegen_1.not)((_a3 = def.valid) !== null && _a3 !== void 0 ? _a3 : valid), errors2);
62818
63299
  }
62819
63300
  }
62820
63301
  exports2.funcKeywordCode = funcKeywordCode;
@@ -63782,7 +64263,7 @@ var require_compile = __commonJS({
63782
64263
  var validate_1 = require_validate();
63783
64264
  var SchemaEnv = class {
63784
64265
  constructor(env) {
63785
- var _a;
64266
+ var _a2;
63786
64267
  this.refs = {};
63787
64268
  this.dynamicAnchors = {};
63788
64269
  let schema2;
@@ -63791,7 +64272,7 @@ var require_compile = __commonJS({
63791
64272
  this.schema = env.schema;
63792
64273
  this.schemaId = env.schemaId;
63793
64274
  this.root = env.root || this;
63794
- this.baseId = (_a = env.baseId) !== null && _a !== void 0 ? _a : (0, resolve_1.normalizeId)(schema2 === null || schema2 === void 0 ? void 0 : schema2[env.schemaId || "$id"]);
64275
+ this.baseId = (_a2 = env.baseId) !== null && _a2 !== void 0 ? _a2 : (0, resolve_1.normalizeId)(schema2 === null || schema2 === void 0 ? void 0 : schema2[env.schemaId || "$id"]);
63795
64276
  this.schemaPath = env.schemaPath;
63796
64277
  this.localRefs = env.localRefs;
63797
64278
  this.meta = env.meta;
@@ -63887,14 +64368,14 @@ var require_compile = __commonJS({
63887
64368
  }
63888
64369
  exports2.compileSchema = compileSchema;
63889
64370
  function resolveRef(root2, baseId, ref) {
63890
- var _a;
64371
+ var _a2;
63891
64372
  ref = (0, resolve_1.resolveUrl)(this.opts.uriResolver, baseId, ref);
63892
64373
  const schOrFunc = root2.refs[ref];
63893
64374
  if (schOrFunc)
63894
64375
  return schOrFunc;
63895
64376
  let _sch = resolve35.call(this, root2, ref);
63896
64377
  if (_sch === void 0) {
63897
- const schema2 = (_a = root2.localRefs) === null || _a === void 0 ? void 0 : _a[ref];
64378
+ const schema2 = (_a2 = root2.localRefs) === null || _a2 === void 0 ? void 0 : _a2[ref];
63898
64379
  const { schemaId } = this.opts;
63899
64380
  if (schema2)
63900
64381
  _sch = new SchemaEnv({ schema: schema2, schemaId, root: root2, baseId });
@@ -63963,8 +64444,8 @@ var require_compile = __commonJS({
63963
64444
  "definitions"
63964
64445
  ]);
63965
64446
  function getJsonPointer(parsedRef, { baseId, schema: schema2, root: root2 }) {
63966
- var _a;
63967
- if (((_a = parsedRef.fragment) === null || _a === void 0 ? void 0 : _a[0]) !== "/")
64447
+ var _a2;
64448
+ if (((_a2 = parsedRef.fragment) === null || _a2 === void 0 ? void 0 : _a2[0]) !== "/")
63968
64449
  return;
63969
64450
  for (const part of parsedRef.fragment.slice(1).split("/")) {
63970
64451
  if (typeof schema2 === "boolean")
@@ -64825,9 +65306,9 @@ var require_core = __commonJS({
64825
65306
  };
64826
65307
  var MAX_EXPRESSION = 200;
64827
65308
  function requiredOptions(o) {
64828
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0;
65309
+ var _a2, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0;
64829
65310
  const s = o.strict;
64830
- const _optz = (_a = o.code) === null || _a === void 0 ? void 0 : _a.optimize;
65311
+ const _optz = (_a2 = o.code) === null || _a2 === void 0 ? void 0 : _a2.optimize;
64831
65312
  const optimize = _optz === true || _optz === void 0 ? 1 : _optz || 0;
64832
65313
  const regExp = (_c = (_b = o.code) === null || _b === void 0 ? void 0 : _b.regExp) !== null && _c !== void 0 ? _c : defaultRegExp;
64833
65314
  const uriResolver = (_d = o.uriResolver) !== null && _d !== void 0 ? _d : uri_1.default;
@@ -65301,7 +65782,7 @@ var require_core = __commonJS({
65301
65782
  }
65302
65783
  }
65303
65784
  function addRule(keyword, definition, dataType) {
65304
- var _a;
65785
+ var _a2;
65305
65786
  const post = definition === null || definition === void 0 ? void 0 : definition.post;
65306
65787
  if (dataType && post)
65307
65788
  throw new Error('keyword with "post" flag cannot have "type"');
@@ -65327,7 +65808,7 @@ var require_core = __commonJS({
65327
65808
  else
65328
65809
  ruleGroup.rules.push(rule);
65329
65810
  RULES.all[keyword] = rule;
65330
- (_a = definition.implements) === null || _a === void 0 ? void 0 : _a.forEach((kwd) => this.addKeyword(kwd));
65811
+ (_a2 = definition.implements) === null || _a2 === void 0 ? void 0 : _a2.forEach((kwd) => this.addKeyword(kwd));
65331
65812
  }
65332
65813
  function addBeforeRule(ruleGroup, rule, before) {
65333
65814
  const i = ruleGroup.rules.findIndex((_rule) => _rule.keyword === before);
@@ -65461,10 +65942,10 @@ var require_ref = __commonJS({
65461
65942
  gen.assign(names_1.default.errors, (0, codegen_1._)`${names_1.default.vErrors}.length`);
65462
65943
  }
65463
65944
  function addEvaluatedFrom(source) {
65464
- var _a;
65945
+ var _a2;
65465
65946
  if (!it.opts.unevaluated)
65466
65947
  return;
65467
- const schEvaluated = (_a = sch === null || sch === void 0 ? void 0 : sch.validate) === null || _a === void 0 ? void 0 : _a.evaluated;
65948
+ const schEvaluated = (_a2 = sch === null || sch === void 0 ? void 0 : sch.validate) === null || _a2 === void 0 ? void 0 : _a2.evaluated;
65468
65949
  if (it.props !== true) {
65469
65950
  if (schEvaluated && !schEvaluated.dynamicProps) {
65470
65951
  if (schEvaluated.props !== void 0) {
@@ -67115,7 +67596,7 @@ var require_discriminator = __commonJS({
67115
67596
  return _valid;
67116
67597
  }
67117
67598
  function getMapping() {
67118
- var _a;
67599
+ var _a2;
67119
67600
  const oneOfMapping = {};
67120
67601
  const topRequired = hasRequired(parentSchema);
67121
67602
  let tagRequired = true;
@@ -67129,7 +67610,7 @@ var require_discriminator = __commonJS({
67129
67610
  if (sch === void 0)
67130
67611
  throw new ref_error_1.default(it.opts.uriResolver, it.baseId, ref);
67131
67612
  }
67132
- const propSch = (_a = sch === null || sch === void 0 ? void 0 : sch.properties) === null || _a === void 0 ? void 0 : _a[tagName];
67613
+ const propSch = (_a2 = sch === null || sch === void 0 ? void 0 : sch.properties) === null || _a2 === void 0 ? void 0 : _a2[tagName];
67133
67614
  if (typeof propSch != "object") {
67134
67615
  throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${tagName}"`);
67135
67616
  }
@@ -67698,9 +68179,9 @@ var require_dist = __commonJS({
67698
68179
  return f;
67699
68180
  };
67700
68181
  function addFormats(ajv, list, fs47, exportName) {
67701
- var _a;
68182
+ var _a2;
67702
68183
  var _b;
67703
- (_a = (_b = ajv.opts.code).formats) !== null && _a !== void 0 ? _a : _b.formats = (0, codegen_1._)`require("ajv-formats/dist/formats").${exportName}`;
68184
+ (_a2 = (_b = ajv.opts.code).formats) !== null && _a2 !== void 0 ? _a2 : _b.formats = (0, codegen_1._)`require("ajv-formats/dist/formats").${exportName}`;
67704
68185
  for (const f of list)
67705
68186
  ajv.addFormat(f, fs47[f]);
67706
68187
  }
@@ -76497,12 +76978,12 @@ var NEVER2 = Object.freeze({
76497
76978
  // @__NO_SIDE_EFFECTS__
76498
76979
  function $constructor(name, initializer3, params) {
76499
76980
  function init(inst, def) {
76500
- var _a;
76981
+ var _a2;
76501
76982
  Object.defineProperty(inst, "_zod", {
76502
76983
  value: inst._zod ?? {},
76503
76984
  enumerable: false
76504
76985
  });
76505
- (_a = inst._zod).traits ?? (_a.traits = /* @__PURE__ */ new Set());
76986
+ (_a2 = inst._zod).traits ?? (_a2.traits = /* @__PURE__ */ new Set());
76506
76987
  inst._zod.traits.add(name);
76507
76988
  initializer3(inst, def);
76508
76989
  for (const k in _.prototype) {
@@ -76517,10 +76998,10 @@ function $constructor(name, initializer3, params) {
76517
76998
  }
76518
76999
  Object.defineProperty(Definition, "name", { value: name });
76519
77000
  function _(def) {
76520
- var _a;
77001
+ var _a2;
76521
77002
  const inst = params?.Parent ? new Definition() : this;
76522
77003
  init(inst, def);
76523
- (_a = inst._zod).deferred ?? (_a.deferred = []);
77004
+ (_a2 = inst._zod).deferred ?? (_a2.deferred = []);
76524
77005
  for (const fn of inst._zod.deferred) {
76525
77006
  fn();
76526
77007
  }
@@ -77010,8 +77491,8 @@ function aborted(x, startIndex = 0) {
77010
77491
  }
77011
77492
  function prefixIssues(path50, issues) {
77012
77493
  return issues.map((iss) => {
77013
- var _a;
77014
- (_a = iss).path ?? (_a.path = []);
77494
+ var _a2;
77495
+ (_a2 = iss).path ?? (_a2.path = []);
77015
77496
  iss.path.unshift(path50);
77016
77497
  return iss;
77017
77498
  });
@@ -77257,10 +77738,10 @@ var uppercase = /^[^a-z]*$/;
77257
77738
 
77258
77739
  // node_modules/zod/v4/core/checks.js
77259
77740
  var $ZodCheck = /* @__PURE__ */ $constructor("$ZodCheck", (inst, def) => {
77260
- var _a;
77741
+ var _a2;
77261
77742
  inst._zod ?? (inst._zod = {});
77262
77743
  inst._zod.def = def;
77263
- (_a = inst._zod).onattach ?? (_a.onattach = []);
77744
+ (_a2 = inst._zod).onattach ?? (_a2.onattach = []);
77264
77745
  });
77265
77746
  var numericOriginMap = {
77266
77747
  number: "number",
@@ -77326,8 +77807,8 @@ var $ZodCheckGreaterThan = /* @__PURE__ */ $constructor("$ZodCheckGreaterThan",
77326
77807
  var $ZodCheckMultipleOf = /* @__PURE__ */ $constructor("$ZodCheckMultipleOf", (inst, def) => {
77327
77808
  $ZodCheck.init(inst, def);
77328
77809
  inst._zod.onattach.push((inst2) => {
77329
- var _a;
77330
- (_a = inst2._zod.bag).multipleOf ?? (_a.multipleOf = def.value);
77810
+ var _a2;
77811
+ (_a2 = inst2._zod.bag).multipleOf ?? (_a2.multipleOf = def.value);
77331
77812
  });
77332
77813
  inst._zod.check = (payload) => {
77333
77814
  if (typeof payload.value !== typeof def.value)
@@ -77420,9 +77901,9 @@ var $ZodCheckNumberFormat = /* @__PURE__ */ $constructor("$ZodCheckNumberFormat"
77420
77901
  };
77421
77902
  });
77422
77903
  var $ZodCheckMaxLength = /* @__PURE__ */ $constructor("$ZodCheckMaxLength", (inst, def) => {
77423
- var _a;
77904
+ var _a2;
77424
77905
  $ZodCheck.init(inst, def);
77425
- (_a = inst._zod.def).when ?? (_a.when = (payload) => {
77906
+ (_a2 = inst._zod.def).when ?? (_a2.when = (payload) => {
77426
77907
  const val = payload.value;
77427
77908
  return !nullish(val) && val.length !== void 0;
77428
77909
  });
@@ -77449,9 +77930,9 @@ var $ZodCheckMaxLength = /* @__PURE__ */ $constructor("$ZodCheckMaxLength", (ins
77449
77930
  };
77450
77931
  });
77451
77932
  var $ZodCheckMinLength = /* @__PURE__ */ $constructor("$ZodCheckMinLength", (inst, def) => {
77452
- var _a;
77933
+ var _a2;
77453
77934
  $ZodCheck.init(inst, def);
77454
- (_a = inst._zod.def).when ?? (_a.when = (payload) => {
77935
+ (_a2 = inst._zod.def).when ?? (_a2.when = (payload) => {
77455
77936
  const val = payload.value;
77456
77937
  return !nullish(val) && val.length !== void 0;
77457
77938
  });
@@ -77478,9 +77959,9 @@ var $ZodCheckMinLength = /* @__PURE__ */ $constructor("$ZodCheckMinLength", (ins
77478
77959
  };
77479
77960
  });
77480
77961
  var $ZodCheckLengthEquals = /* @__PURE__ */ $constructor("$ZodCheckLengthEquals", (inst, def) => {
77481
- var _a;
77962
+ var _a2;
77482
77963
  $ZodCheck.init(inst, def);
77483
- (_a = inst._zod.def).when ?? (_a.when = (payload) => {
77964
+ (_a2 = inst._zod.def).when ?? (_a2.when = (payload) => {
77484
77965
  const val = payload.value;
77485
77966
  return !nullish(val) && val.length !== void 0;
77486
77967
  });
@@ -77509,7 +77990,7 @@ var $ZodCheckLengthEquals = /* @__PURE__ */ $constructor("$ZodCheckLengthEquals"
77509
77990
  };
77510
77991
  });
77511
77992
  var $ZodCheckStringFormat = /* @__PURE__ */ $constructor("$ZodCheckStringFormat", (inst, def) => {
77512
- var _a, _b;
77993
+ var _a2, _b;
77513
77994
  $ZodCheck.init(inst, def);
77514
77995
  inst._zod.onattach.push((inst2) => {
77515
77996
  const bag = inst2._zod.bag;
@@ -77520,7 +78001,7 @@ var $ZodCheckStringFormat = /* @__PURE__ */ $constructor("$ZodCheckStringFormat"
77520
78001
  }
77521
78002
  });
77522
78003
  if (def.pattern)
77523
- (_a = inst._zod).check ?? (_a.check = (payload) => {
78004
+ (_a2 = inst._zod).check ?? (_a2.check = (payload) => {
77524
78005
  def.pattern.lastIndex = 0;
77525
78006
  if (def.pattern.test(payload.value))
77526
78007
  return;
@@ -77685,7 +78166,7 @@ var version = {
77685
78166
 
77686
78167
  // node_modules/zod/v4/core/schemas.js
77687
78168
  var $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
77688
- var _a;
78169
+ var _a2;
77689
78170
  inst ?? (inst = {});
77690
78171
  inst._zod.def = def;
77691
78172
  inst._zod.bag = inst._zod.bag || {};
@@ -77700,7 +78181,7 @@ var $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
77700
78181
  }
77701
78182
  }
77702
78183
  if (checks.length === 0) {
77703
- (_a = inst._zod).deferred ?? (_a.deferred = []);
78184
+ (_a2 = inst._zod).deferred ?? (_a2.deferred = []);
77704
78185
  inst._zod.deferred?.push(() => {
77705
78186
  inst._zod.run = inst._zod.parse;
77706
78187
  });
@@ -79539,7 +80020,7 @@ var JSONSchemaGenerator = class {
79539
80020
  this.seen = /* @__PURE__ */ new Map();
79540
80021
  }
79541
80022
  process(schema2, _params = { path: [], schemaPath: [] }) {
79542
- var _a;
80023
+ var _a2;
79543
80024
  const def = schema2._zod.def;
79544
80025
  const formatMap = {
79545
80026
  guid: "uuid",
@@ -80001,7 +80482,7 @@ var JSONSchemaGenerator = class {
80001
80482
  delete result.schema.default;
80002
80483
  }
80003
80484
  if (this.io === "input" && result.schema._prefault)
80004
- (_a = result.schema).default ?? (_a.default = result.schema._prefault);
80485
+ (_a2 = result.schema).default ?? (_a2.default = result.schema._prefault);
80005
80486
  delete result.schema._prefault;
80006
80487
  const _result = this.seen.get(schema2);
80007
80488
  return _result.schema;
@@ -92634,7 +93115,7 @@ function displayInstalledPackage(pkg) {
92634
93115
  // src/cli/index.ts
92635
93116
  init_logger();
92636
93117
  init_error_utils();
92637
- var version2 = true ? "0.21.6" : "0.0.0-dev";
93118
+ var version2 = true ? "0.21.7" : "0.0.0-dev";
92638
93119
  var program2 = new Command();
92639
93120
  program2.name("flow-weaver").description("Flow Weaver Annotations - Compile and validate workflow files").option("-v, --version", "Output the current version").option("--no-color", "Disable colors").option("--color", "Force colors").on("option:version", () => {
92640
93121
  logger.banner(version2);