@base44-preview/cli 0.0.36-pr.353.f5250a0 → 0.0.36-pr.355.6973e5e

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli/index.js CHANGED
@@ -13211,34 +13211,58 @@ var require_cross_spawn = __commonJS((exports, module) => {
13211
13211
  module.exports._enoent = enoent;
13212
13212
  });
13213
13213
 
13214
- // node_modules/lodash/_arrayReduce.js
13215
- var require__arrayReduce = __commonJS((exports, module) => {
13216
- function arrayReduce(array2, iteratee, accumulator, initAccum) {
13217
- var index = -1, length = array2 == null ? 0 : array2.length;
13218
- if (initAccum && length) {
13219
- accumulator = array2[++index];
13220
- }
13221
- while (++index < length) {
13222
- accumulator = iteratee(accumulator, array2[index], index, array2);
13223
- }
13224
- return accumulator;
13225
- }
13226
- module.exports = arrayReduce;
13227
- });
13228
-
13229
- // node_modules/lodash/_basePropertyOf.js
13230
- var require__basePropertyOf = __commonJS((exports, module) => {
13231
- function basePropertyOf(object2) {
13232
- return function(key) {
13233
- return object2 == null ? undefined : object2[key];
13234
- };
13235
- }
13236
- module.exports = basePropertyOf;
13237
- });
13238
-
13239
- // node_modules/lodash/_deburrLetter.js
13240
- var require__deburrLetter = __commonJS((exports, module) => {
13241
- var basePropertyOf = require__basePropertyOf();
13214
+ // node_modules/lodash.kebabcase/index.js
13215
+ var require_lodash = __commonJS((exports, module) => {
13216
+ var INFINITY = 1 / 0;
13217
+ var symbolTag = "[object Symbol]";
13218
+ var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
13219
+ var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;
13220
+ var rsAstralRange = "\\ud800-\\udfff";
13221
+ var rsComboMarksRange = "\\u0300-\\u036f\\ufe20-\\ufe23";
13222
+ var rsComboSymbolsRange = "\\u20d0-\\u20f0";
13223
+ var rsDingbatRange = "\\u2700-\\u27bf";
13224
+ var rsLowerRange = "a-z\\xdf-\\xf6\\xf8-\\xff";
13225
+ var rsMathOpRange = "\\xac\\xb1\\xd7\\xf7";
13226
+ var rsNonCharRange = "\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf";
13227
+ var rsPunctuationRange = "\\u2000-\\u206f";
13228
+ var rsSpaceRange = " \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000";
13229
+ var rsUpperRange = "A-Z\\xc0-\\xd6\\xd8-\\xde";
13230
+ var rsVarRange = "\\ufe0e\\ufe0f";
13231
+ var rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;
13232
+ var rsApos = "['’]";
13233
+ var rsBreak = "[" + rsBreakRange + "]";
13234
+ var rsCombo = "[" + rsComboMarksRange + rsComboSymbolsRange + "]";
13235
+ var rsDigits = "\\d+";
13236
+ var rsDingbat = "[" + rsDingbatRange + "]";
13237
+ var rsLower = "[" + rsLowerRange + "]";
13238
+ var rsMisc = "[^" + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + "]";
13239
+ var rsFitz = "\\ud83c[\\udffb-\\udfff]";
13240
+ var rsModifier = "(?:" + rsCombo + "|" + rsFitz + ")";
13241
+ var rsNonAstral = "[^" + rsAstralRange + "]";
13242
+ var rsRegional = "(?:\\ud83c[\\udde6-\\uddff]){2}";
13243
+ var rsSurrPair = "[\\ud800-\\udbff][\\udc00-\\udfff]";
13244
+ var rsUpper = "[" + rsUpperRange + "]";
13245
+ var rsZWJ = "\\u200d";
13246
+ var rsLowerMisc = "(?:" + rsLower + "|" + rsMisc + ")";
13247
+ var rsUpperMisc = "(?:" + rsUpper + "|" + rsMisc + ")";
13248
+ var rsOptLowerContr = "(?:" + rsApos + "(?:d|ll|m|re|s|t|ve))?";
13249
+ var rsOptUpperContr = "(?:" + rsApos + "(?:D|LL|M|RE|S|T|VE))?";
13250
+ var reOptMod = rsModifier + "?";
13251
+ var rsOptVar = "[" + rsVarRange + "]?";
13252
+ var rsOptJoin = "(?:" + rsZWJ + "(?:" + [rsNonAstral, rsRegional, rsSurrPair].join("|") + ")" + rsOptVar + reOptMod + ")*";
13253
+ var rsSeq = rsOptVar + reOptMod + rsOptJoin;
13254
+ var rsEmoji = "(?:" + [rsDingbat, rsRegional, rsSurrPair].join("|") + ")" + rsSeq;
13255
+ var reApos = RegExp(rsApos, "g");
13256
+ var reComboMark = RegExp(rsCombo, "g");
13257
+ var reUnicodeWord = RegExp([
13258
+ rsUpper + "?" + rsLower + "+" + rsOptLowerContr + "(?=" + [rsBreak, rsUpper, "$"].join("|") + ")",
13259
+ rsUpperMisc + "+" + rsOptUpperContr + "(?=" + [rsBreak, rsUpper + rsLowerMisc, "$"].join("|") + ")",
13260
+ rsUpper + "?" + rsLowerMisc + "+" + rsOptLowerContr,
13261
+ rsUpper + "+" + rsOptUpperContr,
13262
+ rsDigits,
13263
+ rsEmoji
13264
+ ].join("|"), "g");
13265
+ var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;
13242
13266
  var deburredLetters = {
13243
13267
  "À": "A",
13244
13268
  "Á": "A",
@@ -13429,256 +13453,72 @@ var require__deburrLetter = __commonJS((exports, module) => {
13429
13453
  "Œ": "Oe",
13430
13454
  "œ": "oe",
13431
13455
  "ʼn": "'n",
13432
- "ſ": "s"
13456
+ "ſ": "ss"
13433
13457
  };
13434
- var deburrLetter = basePropertyOf(deburredLetters);
13435
- module.exports = deburrLetter;
13436
- });
13437
-
13438
- // node_modules/lodash/_freeGlobal.js
13439
- var require__freeGlobal = __commonJS((exports, module) => {
13440
13458
  var freeGlobal = typeof global == "object" && global && global.Object === Object && global;
13441
- module.exports = freeGlobal;
13442
- });
13443
-
13444
- // node_modules/lodash/_root.js
13445
- var require__root = __commonJS((exports, module) => {
13446
- var freeGlobal = require__freeGlobal();
13447
13459
  var freeSelf = typeof self == "object" && self && self.Object === Object && self;
13448
13460
  var root = freeGlobal || freeSelf || Function("return this")();
13449
- module.exports = root;
13450
- });
13451
-
13452
- // node_modules/lodash/_Symbol.js
13453
- var require__Symbol = __commonJS((exports, module) => {
13454
- var root = require__root();
13455
- var Symbol2 = root.Symbol;
13456
- module.exports = Symbol2;
13457
- });
13458
-
13459
- // node_modules/lodash/_arrayMap.js
13460
- var require__arrayMap = __commonJS((exports, module) => {
13461
- function arrayMap(array2, iteratee) {
13462
- var index = -1, length = array2 == null ? 0 : array2.length, result = Array(length);
13463
- while (++index < length) {
13464
- result[index] = iteratee(array2[index], index, array2);
13461
+ function arrayReduce(array2, iteratee, accumulator, initAccum) {
13462
+ var index = -1, length = array2 ? array2.length : 0;
13463
+ if (initAccum && length) {
13464
+ accumulator = array2[++index];
13465
13465
  }
13466
- return result;
13467
- }
13468
- module.exports = arrayMap;
13469
- });
13470
-
13471
- // node_modules/lodash/isArray.js
13472
- var require_isArray = __commonJS((exports, module) => {
13473
- var isArray = Array.isArray;
13474
- module.exports = isArray;
13475
- });
13476
-
13477
- // node_modules/lodash/_getRawTag.js
13478
- var require__getRawTag = __commonJS((exports, module) => {
13479
- var Symbol2 = require__Symbol();
13480
- var objectProto = Object.prototype;
13481
- var hasOwnProperty = objectProto.hasOwnProperty;
13482
- var nativeObjectToString = objectProto.toString;
13483
- var symToStringTag = Symbol2 ? Symbol2.toStringTag : undefined;
13484
- function getRawTag(value) {
13485
- var isOwn = hasOwnProperty.call(value, symToStringTag), tag = value[symToStringTag];
13486
- try {
13487
- value[symToStringTag] = undefined;
13488
- var unmasked = true;
13489
- } catch (e2) {}
13490
- var result = nativeObjectToString.call(value);
13491
- if (unmasked) {
13492
- if (isOwn) {
13493
- value[symToStringTag] = tag;
13494
- } else {
13495
- delete value[symToStringTag];
13496
- }
13466
+ while (++index < length) {
13467
+ accumulator = iteratee(accumulator, array2[index], index, array2);
13497
13468
  }
13498
- return result;
13469
+ return accumulator;
13499
13470
  }
13500
- module.exports = getRawTag;
13501
- });
13502
-
13503
- // node_modules/lodash/_objectToString.js
13504
- var require__objectToString = __commonJS((exports, module) => {
13505
- var objectProto = Object.prototype;
13506
- var nativeObjectToString = objectProto.toString;
13507
- function objectToString3(value) {
13508
- return nativeObjectToString.call(value);
13471
+ function asciiWords(string4) {
13472
+ return string4.match(reAsciiWord) || [];
13509
13473
  }
13510
- module.exports = objectToString3;
13511
- });
13512
-
13513
- // node_modules/lodash/_baseGetTag.js
13514
- var require__baseGetTag = __commonJS((exports, module) => {
13515
- var Symbol2 = require__Symbol();
13516
- var getRawTag = require__getRawTag();
13517
- var objectToString3 = require__objectToString();
13518
- var nullTag = "[object Null]";
13519
- var undefinedTag = "[object Undefined]";
13520
- var symToStringTag = Symbol2 ? Symbol2.toStringTag : undefined;
13521
- function baseGetTag(value) {
13522
- if (value == null) {
13523
- return value === undefined ? undefinedTag : nullTag;
13524
- }
13525
- return symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString3(value);
13474
+ function basePropertyOf(object2) {
13475
+ return function(key) {
13476
+ return object2 == null ? undefined : object2[key];
13477
+ };
13526
13478
  }
13527
- module.exports = baseGetTag;
13528
- });
13529
-
13530
- // node_modules/lodash/isObjectLike.js
13531
- var require_isObjectLike = __commonJS((exports, module) => {
13532
- function isObjectLike(value) {
13533
- return value != null && typeof value == "object";
13479
+ var deburrLetter = basePropertyOf(deburredLetters);
13480
+ function hasUnicodeWord(string4) {
13481
+ return reHasUnicodeWord.test(string4);
13534
13482
  }
13535
- module.exports = isObjectLike;
13536
- });
13537
-
13538
- // node_modules/lodash/isSymbol.js
13539
- var require_isSymbol = __commonJS((exports, module) => {
13540
- var baseGetTag = require__baseGetTag();
13541
- var isObjectLike = require_isObjectLike();
13542
- var symbolTag = "[object Symbol]";
13543
- function isSymbol(value) {
13544
- return typeof value == "symbol" || isObjectLike(value) && baseGetTag(value) == symbolTag;
13483
+ function unicodeWords(string4) {
13484
+ return string4.match(reUnicodeWord) || [];
13545
13485
  }
13546
- module.exports = isSymbol;
13547
- });
13548
-
13549
- // node_modules/lodash/_baseToString.js
13550
- var require__baseToString = __commonJS((exports, module) => {
13551
- var Symbol2 = require__Symbol();
13552
- var arrayMap = require__arrayMap();
13553
- var isArray = require_isArray();
13554
- var isSymbol = require_isSymbol();
13555
- var INFINITY = 1 / 0;
13486
+ var objectProto = Object.prototype;
13487
+ var objectToString3 = objectProto.toString;
13488
+ var Symbol2 = root.Symbol;
13556
13489
  var symbolProto = Symbol2 ? Symbol2.prototype : undefined;
13557
13490
  var symbolToString = symbolProto ? symbolProto.toString : undefined;
13558
13491
  function baseToString(value) {
13559
13492
  if (typeof value == "string") {
13560
13493
  return value;
13561
13494
  }
13562
- if (isArray(value)) {
13563
- return arrayMap(value, baseToString) + "";
13564
- }
13565
13495
  if (isSymbol(value)) {
13566
13496
  return symbolToString ? symbolToString.call(value) : "";
13567
13497
  }
13568
13498
  var result = value + "";
13569
13499
  return result == "0" && 1 / value == -INFINITY ? "-0" : result;
13570
13500
  }
13571
- module.exports = baseToString;
13572
- });
13573
-
13574
- // node_modules/lodash/toString.js
13575
- var require_toString = __commonJS((exports, module) => {
13576
- var baseToString = require__baseToString();
13501
+ function createCompounder(callback) {
13502
+ return function(string4) {
13503
+ return arrayReduce(words(deburr(string4).replace(reApos, "")), callback, "");
13504
+ };
13505
+ }
13506
+ function isObjectLike(value) {
13507
+ return !!value && typeof value == "object";
13508
+ }
13509
+ function isSymbol(value) {
13510
+ return typeof value == "symbol" || isObjectLike(value) && objectToString3.call(value) == symbolTag;
13511
+ }
13577
13512
  function toString2(value) {
13578
13513
  return value == null ? "" : baseToString(value);
13579
13514
  }
13580
- module.exports = toString2;
13581
- });
13582
-
13583
- // node_modules/lodash/deburr.js
13584
- var require_deburr = __commonJS((exports, module) => {
13585
- var deburrLetter = require__deburrLetter();
13586
- var toString2 = require_toString();
13587
- var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;
13588
- var rsComboMarksRange = "\\u0300-\\u036f";
13589
- var reComboHalfMarksRange = "\\ufe20-\\ufe2f";
13590
- var rsComboSymbolsRange = "\\u20d0-\\u20ff";
13591
- var rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange;
13592
- var rsCombo = "[" + rsComboRange + "]";
13593
- var reComboMark = RegExp(rsCombo, "g");
13594
13515
  function deburr(string4) {
13595
13516
  string4 = toString2(string4);
13596
13517
  return string4 && string4.replace(reLatin, deburrLetter).replace(reComboMark, "");
13597
13518
  }
13598
- module.exports = deburr;
13599
- });
13600
-
13601
- // node_modules/lodash/_asciiWords.js
13602
- var require__asciiWords = __commonJS((exports, module) => {
13603
- var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
13604
- function asciiWords(string4) {
13605
- return string4.match(reAsciiWord) || [];
13606
- }
13607
- module.exports = asciiWords;
13608
- });
13609
-
13610
- // node_modules/lodash/_hasUnicodeWord.js
13611
- var require__hasUnicodeWord = __commonJS((exports, module) => {
13612
- var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;
13613
- function hasUnicodeWord(string4) {
13614
- return reHasUnicodeWord.test(string4);
13615
- }
13616
- module.exports = hasUnicodeWord;
13617
- });
13618
-
13619
- // node_modules/lodash/_unicodeWords.js
13620
- var require__unicodeWords = __commonJS((exports, module) => {
13621
- var rsAstralRange = "\\ud800-\\udfff";
13622
- var rsComboMarksRange = "\\u0300-\\u036f";
13623
- var reComboHalfMarksRange = "\\ufe20-\\ufe2f";
13624
- var rsComboSymbolsRange = "\\u20d0-\\u20ff";
13625
- var rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange;
13626
- var rsDingbatRange = "\\u2700-\\u27bf";
13627
- var rsLowerRange = "a-z\\xdf-\\xf6\\xf8-\\xff";
13628
- var rsMathOpRange = "\\xac\\xb1\\xd7\\xf7";
13629
- var rsNonCharRange = "\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf";
13630
- var rsPunctuationRange = "\\u2000-\\u206f";
13631
- var rsSpaceRange = " \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000";
13632
- var rsUpperRange = "A-Z\\xc0-\\xd6\\xd8-\\xde";
13633
- var rsVarRange = "\\ufe0e\\ufe0f";
13634
- var rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;
13635
- var rsApos = "['’]";
13636
- var rsBreak = "[" + rsBreakRange + "]";
13637
- var rsCombo = "[" + rsComboRange + "]";
13638
- var rsDigits = "\\d+";
13639
- var rsDingbat = "[" + rsDingbatRange + "]";
13640
- var rsLower = "[" + rsLowerRange + "]";
13641
- var rsMisc = "[^" + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + "]";
13642
- var rsFitz = "\\ud83c[\\udffb-\\udfff]";
13643
- var rsModifier = "(?:" + rsCombo + "|" + rsFitz + ")";
13644
- var rsNonAstral = "[^" + rsAstralRange + "]";
13645
- var rsRegional = "(?:\\ud83c[\\udde6-\\uddff]){2}";
13646
- var rsSurrPair = "[\\ud800-\\udbff][\\udc00-\\udfff]";
13647
- var rsUpper = "[" + rsUpperRange + "]";
13648
- var rsZWJ = "\\u200d";
13649
- var rsMiscLower = "(?:" + rsLower + "|" + rsMisc + ")";
13650
- var rsMiscUpper = "(?:" + rsUpper + "|" + rsMisc + ")";
13651
- var rsOptContrLower = "(?:" + rsApos + "(?:d|ll|m|re|s|t|ve))?";
13652
- var rsOptContrUpper = "(?:" + rsApos + "(?:D|LL|M|RE|S|T|VE))?";
13653
- var reOptMod = rsModifier + "?";
13654
- var rsOptVar = "[" + rsVarRange + "]?";
13655
- var rsOptJoin = "(?:" + rsZWJ + "(?:" + [rsNonAstral, rsRegional, rsSurrPair].join("|") + ")" + rsOptVar + reOptMod + ")*";
13656
- var rsOrdLower = "\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])";
13657
- var rsOrdUpper = "\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])";
13658
- var rsSeq = rsOptVar + reOptMod + rsOptJoin;
13659
- var rsEmoji = "(?:" + [rsDingbat, rsRegional, rsSurrPair].join("|") + ")" + rsSeq;
13660
- var reUnicodeWord = RegExp([
13661
- rsUpper + "?" + rsLower + "+" + rsOptContrLower + "(?=" + [rsBreak, rsUpper, "$"].join("|") + ")",
13662
- rsMiscUpper + "+" + rsOptContrUpper + "(?=" + [rsBreak, rsUpper + rsMiscLower, "$"].join("|") + ")",
13663
- rsUpper + "?" + rsMiscLower + "+" + rsOptContrLower,
13664
- rsUpper + "+" + rsOptContrUpper,
13665
- rsOrdUpper,
13666
- rsOrdLower,
13667
- rsDigits,
13668
- rsEmoji
13669
- ].join("|"), "g");
13670
- function unicodeWords(string4) {
13671
- return string4.match(reUnicodeWord) || [];
13672
- }
13673
- module.exports = unicodeWords;
13674
- });
13675
-
13676
- // node_modules/lodash/words.js
13677
- var require_words = __commonJS((exports, module) => {
13678
- var asciiWords = require__asciiWords();
13679
- var hasUnicodeWord = require__hasUnicodeWord();
13680
- var toString2 = require_toString();
13681
- var unicodeWords = require__unicodeWords();
13519
+ var kebabCase = createCompounder(function(result, word, index) {
13520
+ return result + (index ? "-" : "") + word.toLowerCase();
13521
+ });
13682
13522
  function words(string4, pattern, guard) {
13683
13523
  string4 = toString2(string4);
13684
13524
  pattern = guard ? undefined : pattern;
@@ -13687,30 +13527,6 @@ var require_words = __commonJS((exports, module) => {
13687
13527
  }
13688
13528
  return string4.match(pattern) || [];
13689
13529
  }
13690
- module.exports = words;
13691
- });
13692
-
13693
- // node_modules/lodash/_createCompounder.js
13694
- var require__createCompounder = __commonJS((exports, module) => {
13695
- var arrayReduce = require__arrayReduce();
13696
- var deburr = require_deburr();
13697
- var words = require_words();
13698
- var rsApos = "['’]";
13699
- var reApos = RegExp(rsApos, "g");
13700
- function createCompounder(callback) {
13701
- return function(string4) {
13702
- return arrayReduce(words(deburr(string4).replace(reApos, "")), callback, "");
13703
- };
13704
- }
13705
- module.exports = createCompounder;
13706
- });
13707
-
13708
- // node_modules/lodash/kebabCase.js
13709
- var require_kebabCase = __commonJS((exports, module) => {
13710
- var createCompounder = require__createCompounder();
13711
- var kebabCase = createCompounder(function(result, word, index) {
13712
- return result + (index ? "-" : "") + word.toLowerCase();
13713
- });
13714
13530
  module.exports = kebabCase;
13715
13531
  });
13716
13532
 
@@ -14793,7 +14609,7 @@ var require_lib2 = __commonJS((exports) => {
14793
14609
  });
14794
14610
 
14795
14611
  // node_modules/lodash/lodash.js
14796
- var require_lodash = __commonJS((exports, module) => {
14612
+ var require_lodash2 = __commonJS((exports, module) => {
14797
14613
  (function() {
14798
14614
  var undefined2;
14799
14615
  var VERSION = "4.17.23";
@@ -127783,7 +127599,7 @@ var require_AST = __commonJS((exports) => {
127783
127599
  var require_JSONSchema = __commonJS((exports) => {
127784
127600
  Object.defineProperty(exports, "__esModule", { value: true });
127785
127601
  exports.isCompound = exports.isPrimitive = exports.isBoolean = exports.getRootSchema = exports.Intersection = exports.Types = exports.Parent = undefined;
127786
- var lodash_1 = require_lodash();
127602
+ var lodash_1 = require_lodash2();
127787
127603
  exports.Parent = Symbol("Parent");
127788
127604
  exports.Types = Symbol("Types");
127789
127605
  exports.Intersection = Symbol("Intersection");
@@ -130590,7 +130406,7 @@ var require_utils7 = __commonJS((exports) => {
130590
130406
  };
130591
130407
  Object.defineProperty(exports, "__esModule", { value: true });
130592
130408
  exports.parseFileAsJSONSchema = exports.isSchemaLike = exports.appendToDescription = exports.maybeStripDefault = exports.pathTransform = exports.escapeBlockComment = exports.log = exports.error = exports.generateName = exports.toSafeString = exports.stripExtension = exports.justName = exports.traverse = exports.Try = undefined;
130593
- var lodash_1 = require_lodash();
130409
+ var lodash_1 = require_lodash2();
130594
130410
  var path_1 = __require("path");
130595
130411
  var JSONSchema_1 = require_JSONSchema();
130596
130412
  var js_yaml_1 = __importDefault(require_js_yaml3());
@@ -130921,7 +130737,7 @@ ${values.join(`
130921
130737
  var require_generator = __commonJS((exports) => {
130922
130738
  Object.defineProperty(exports, "__esModule", { value: true });
130923
130739
  exports.generateType = exports.generate = undefined;
130924
- var lodash_1 = require_lodash();
130740
+ var lodash_1 = require_lodash2();
130925
130741
  var index_1 = require_src3();
130926
130742
  var AST_1 = require_AST();
130927
130743
  var utils_1 = require_utils7();
@@ -131184,7 +131000,7 @@ var require_generator = __commonJS((exports) => {
131184
131000
  var require_typesOfSchema = __commonJS((exports) => {
131185
131001
  Object.defineProperty(exports, "__esModule", { value: true });
131186
131002
  exports.typesOfSchema = undefined;
131187
- var lodash_1 = require_lodash();
131003
+ var lodash_1 = require_lodash2();
131188
131004
  var JSONSchema_1 = require_JSONSchema();
131189
131005
  function typesOfSchema(schema9) {
131190
131006
  if (schema9.tsType) {
@@ -131543,7 +131359,7 @@ var require_normalizer = __commonJS((exports) => {
131543
131359
  var require_optimizer = __commonJS((exports) => {
131544
131360
  Object.defineProperty(exports, "__esModule", { value: true });
131545
131361
  exports.optimize = undefined;
131546
- var lodash_1 = require_lodash();
131362
+ var lodash_1 = require_lodash2();
131547
131363
  var generator_1 = require_generator();
131548
131364
  var AST_1 = require_AST();
131549
131365
  var utils_1 = require_utils7();
@@ -131609,7 +131425,7 @@ var require_optimizer = __commonJS((exports) => {
131609
131425
  var require_parser = __commonJS((exports) => {
131610
131426
  Object.defineProperty(exports, "__esModule", { value: true });
131611
131427
  exports.parse = undefined;
131612
- var lodash_1 = require_lodash();
131428
+ var lodash_1 = require_lodash2();
131613
131429
  var util_1 = __require("util");
131614
131430
  var applySchemaTyping_1 = require_applySchemaTyping();
131615
131431
  var AST_1 = require_AST();
@@ -137462,7 +137278,7 @@ var require_linker = __commonJS((exports) => {
137462
137278
  Object.defineProperty(exports, "__esModule", { value: true });
137463
137279
  exports.link = undefined;
137464
137280
  var JSONSchema_1 = require_JSONSchema();
137465
- var lodash_1 = require_lodash();
137281
+ var lodash_1 = require_lodash2();
137466
137282
  function link2(schema9, parent = null) {
137467
137283
  if (!Array.isArray(schema9) && !(0, lodash_1.isPlainObject)(schema9)) {
137468
137284
  return schema9;
@@ -137530,7 +137346,7 @@ var require_src3 = __commonJS((exports) => {
137530
137346
  Object.defineProperty(exports, "__esModule", { value: true });
137531
137347
  exports.ValidationError = exports.compile = exports.compileFromFile = exports.DEFAULT_OPTIONS = undefined;
137532
137348
  var fs_1 = __require("fs");
137533
- var lodash_1 = require_lodash();
137349
+ var lodash_1 = require_lodash2();
137534
137350
  var path_1 = __require("path");
137535
137351
  var formatter_1 = require_formatter();
137536
137352
  var generator_1 = require_generator();
@@ -166165,168 +165981,6 @@ var require_nedb = __commonJS((exports, module) => {
166165
165981
  module.exports = Datastore;
166166
165982
  });
166167
165983
 
166168
- // node_modules/lodash/isObject.js
166169
- var require_isObject = __commonJS((exports, module) => {
166170
- function isObject5(value) {
166171
- var type = typeof value;
166172
- return value != null && (type == "object" || type == "function");
166173
- }
166174
- module.exports = isObject5;
166175
- });
166176
-
166177
- // node_modules/lodash/now.js
166178
- var require_now = __commonJS((exports, module) => {
166179
- var root2 = require__root();
166180
- var now = function() {
166181
- return root2.Date.now();
166182
- };
166183
- module.exports = now;
166184
- });
166185
-
166186
- // node_modules/lodash/_trimmedEndIndex.js
166187
- var require__trimmedEndIndex = __commonJS((exports, module) => {
166188
- var reWhitespace = /\s/;
166189
- function trimmedEndIndex(string4) {
166190
- var index = string4.length;
166191
- while (index-- && reWhitespace.test(string4.charAt(index))) {}
166192
- return index;
166193
- }
166194
- module.exports = trimmedEndIndex;
166195
- });
166196
-
166197
- // node_modules/lodash/_baseTrim.js
166198
- var require__baseTrim = __commonJS((exports, module) => {
166199
- var trimmedEndIndex = require__trimmedEndIndex();
166200
- var reTrimStart = /^\s+/;
166201
- function baseTrim(string4) {
166202
- return string4 ? string4.slice(0, trimmedEndIndex(string4) + 1).replace(reTrimStart, "") : string4;
166203
- }
166204
- module.exports = baseTrim;
166205
- });
166206
-
166207
- // node_modules/lodash/toNumber.js
166208
- var require_toNumber = __commonJS((exports, module) => {
166209
- var baseTrim = require__baseTrim();
166210
- var isObject5 = require_isObject();
166211
- var isSymbol = require_isSymbol();
166212
- var NAN = 0 / 0;
166213
- var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
166214
- var reIsBinary = /^0b[01]+$/i;
166215
- var reIsOctal = /^0o[0-7]+$/i;
166216
- var freeParseInt = parseInt;
166217
- function toNumber(value) {
166218
- if (typeof value == "number") {
166219
- return value;
166220
- }
166221
- if (isSymbol(value)) {
166222
- return NAN;
166223
- }
166224
- if (isObject5(value)) {
166225
- var other = typeof value.valueOf == "function" ? value.valueOf() : value;
166226
- value = isObject5(other) ? other + "" : other;
166227
- }
166228
- if (typeof value != "string") {
166229
- return value === 0 ? value : +value;
166230
- }
166231
- value = baseTrim(value);
166232
- var isBinary = reIsBinary.test(value);
166233
- return isBinary || reIsOctal.test(value) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : reIsBadHex.test(value) ? NAN : +value;
166234
- }
166235
- module.exports = toNumber;
166236
- });
166237
-
166238
- // node_modules/lodash/debounce.js
166239
- var require_debounce = __commonJS((exports, module) => {
166240
- var isObject5 = require_isObject();
166241
- var now = require_now();
166242
- var toNumber = require_toNumber();
166243
- var FUNC_ERROR_TEXT = "Expected a function";
166244
- var nativeMax = Math.max;
166245
- var nativeMin = Math.min;
166246
- function debounce(func, wait, options8) {
166247
- var lastArgs, lastThis, maxWait, result, timerId, lastCallTime, lastInvokeTime = 0, leading = false, maxing = false, trailing = true;
166248
- if (typeof func != "function") {
166249
- throw new TypeError(FUNC_ERROR_TEXT);
166250
- }
166251
- wait = toNumber(wait) || 0;
166252
- if (isObject5(options8)) {
166253
- leading = !!options8.leading;
166254
- maxing = "maxWait" in options8;
166255
- maxWait = maxing ? nativeMax(toNumber(options8.maxWait) || 0, wait) : maxWait;
166256
- trailing = "trailing" in options8 ? !!options8.trailing : trailing;
166257
- }
166258
- function invokeFunc(time3) {
166259
- var args = lastArgs, thisArg = lastThis;
166260
- lastArgs = lastThis = undefined;
166261
- lastInvokeTime = time3;
166262
- result = func.apply(thisArg, args);
166263
- return result;
166264
- }
166265
- function leadingEdge(time3) {
166266
- lastInvokeTime = time3;
166267
- timerId = setTimeout(timerExpired, wait);
166268
- return leading ? invokeFunc(time3) : result;
166269
- }
166270
- function remainingWait(time3) {
166271
- var timeSinceLastCall = time3 - lastCallTime, timeSinceLastInvoke = time3 - lastInvokeTime, timeWaiting = wait - timeSinceLastCall;
166272
- return maxing ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke) : timeWaiting;
166273
- }
166274
- function shouldInvoke(time3) {
166275
- var timeSinceLastCall = time3 - lastCallTime, timeSinceLastInvoke = time3 - lastInvokeTime;
166276
- return lastCallTime === undefined || timeSinceLastCall >= wait || timeSinceLastCall < 0 || maxing && timeSinceLastInvoke >= maxWait;
166277
- }
166278
- function timerExpired() {
166279
- var time3 = now();
166280
- if (shouldInvoke(time3)) {
166281
- return trailingEdge(time3);
166282
- }
166283
- timerId = setTimeout(timerExpired, remainingWait(time3));
166284
- }
166285
- function trailingEdge(time3) {
166286
- timerId = undefined;
166287
- if (trailing && lastArgs) {
166288
- return invokeFunc(time3);
166289
- }
166290
- lastArgs = lastThis = undefined;
166291
- return result;
166292
- }
166293
- function cancel() {
166294
- if (timerId !== undefined) {
166295
- clearTimeout(timerId);
166296
- }
166297
- lastInvokeTime = 0;
166298
- lastArgs = lastCallTime = lastThis = timerId = undefined;
166299
- }
166300
- function flush() {
166301
- return timerId === undefined ? result : trailingEdge(now());
166302
- }
166303
- function debounced() {
166304
- var time3 = now(), isInvoking = shouldInvoke(time3);
166305
- lastArgs = arguments;
166306
- lastThis = this;
166307
- lastCallTime = time3;
166308
- if (isInvoking) {
166309
- if (timerId === undefined) {
166310
- return leadingEdge(lastCallTime);
166311
- }
166312
- if (maxing) {
166313
- clearTimeout(timerId);
166314
- timerId = setTimeout(timerExpired, wait);
166315
- return invokeFunc(lastCallTime);
166316
- }
166317
- }
166318
- if (timerId === undefined) {
166319
- timerId = setTimeout(timerExpired, wait);
166320
- }
166321
- return result;
166322
- }
166323
- debounced.cancel = cancel;
166324
- debounced.flush = flush;
166325
- return debounced;
166326
- }
166327
- module.exports = debounce;
166328
- });
166329
-
166330
165984
  // node_modules/socket.io/node_modules/accepts/node_modules/negotiator/lib/charset.js
166331
165985
  var require_charset2 = __commonJS((exports, module) => {
166332
165986
  module.exports = preferredCharsets;
@@ -175355,7 +175009,7 @@ var require_mime_types2 = __commonJS((exports) => {
175355
175009
  * MIT Licensed
175356
175010
  */
175357
175011
  var db2 = require_db2();
175358
- var extname3 = __require("path").extname;
175012
+ var extname2 = __require("path").extname;
175359
175013
  var EXTRACT_TYPE_REGEXP = /^\s*([^;\s]*)(?:;|\s|$)/;
175360
175014
  var TEXT_TYPE_REGEXP = /^text\//i;
175361
175015
  exports.charset = charset;
@@ -175410,7 +175064,7 @@ var require_mime_types2 = __commonJS((exports) => {
175410
175064
  if (!path18 || typeof path18 !== "string") {
175411
175065
  return false;
175412
175066
  }
175413
- var extension2 = extname3("x." + path18).toLowerCase().substr(1);
175067
+ var extension2 = extname2("x." + path18).toLowerCase().substr(1);
175414
175068
  if (!extension2) {
175415
175069
  return false;
175416
175070
  }
@@ -185402,7 +185056,7 @@ var require_mime_types3 = __commonJS((exports) => {
185402
185056
  * MIT Licensed
185403
185057
  */
185404
185058
  var db2 = require_db3();
185405
- var extname3 = __require("path").extname;
185059
+ var extname2 = __require("path").extname;
185406
185060
  var EXTRACT_TYPE_REGEXP = /^\s*([^;\s]*)(?:;|\s|$)/;
185407
185061
  var TEXT_TYPE_REGEXP = /^text\//i;
185408
185062
  exports.charset = charset;
@@ -185457,7 +185111,7 @@ var require_mime_types3 = __commonJS((exports) => {
185457
185111
  if (!path18 || typeof path18 !== "string") {
185458
185112
  return false;
185459
185113
  }
185460
- var extension2 = extname3("x." + path18).toLowerCase().substr(1);
185114
+ var extension2 = extname2("x." + path18).toLowerCase().substr(1);
185461
185115
  if (!extension2) {
185462
185116
  return false;
185463
185117
  }
@@ -187975,13 +187629,13 @@ var require_extension = __commonJS((exports, module) => {
187975
187629
 
187976
187630
  // node_modules/ws/lib/websocket.js
187977
187631
  var require_websocket2 = __commonJS((exports, module) => {
187978
- var EventEmitter4 = __require("events");
187632
+ var EventEmitter3 = __require("events");
187979
187633
  var https = __require("https");
187980
187634
  var http = __require("http");
187981
187635
  var net2 = __require("net");
187982
187636
  var tls = __require("tls");
187983
187637
  var { randomBytes: randomBytes2, createHash } = __require("crypto");
187984
- var { Duplex: Duplex4, Readable: Readable7 } = __require("stream");
187638
+ var { Duplex: Duplex4, Readable: Readable6 } = __require("stream");
187985
187639
  var { URL: URL2 } = __require("url");
187986
187640
  var PerMessageDeflate = require_permessage_deflate();
187987
187641
  var Receiver = require_receiver();
@@ -188008,7 +187662,7 @@ var require_websocket2 = __commonJS((exports, module) => {
188008
187662
  var readyStates = ["CONNECTING", "OPEN", "CLOSING", "CLOSED"];
188009
187663
  var subprotocolRegex = /^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/;
188010
187664
 
188011
- class WebSocket extends EventEmitter4 {
187665
+ class WebSocket extends EventEmitter3 {
188012
187666
  constructor(address, protocols, options8) {
188013
187667
  super();
188014
187668
  this._binaryType = BINARY_TYPES[0];
@@ -188797,7 +188451,7 @@ var require_stream6 = __commonJS((exports, module) => {
188797
188451
  };
188798
188452
  duplex2._final = function(callback) {
188799
188453
  if (ws8.readyState === ws8.CONNECTING) {
188800
- ws8.once("open", function open3() {
188454
+ ws8.once("open", function open2() {
188801
188455
  duplex2._final(callback);
188802
188456
  });
188803
188457
  return;
@@ -188821,7 +188475,7 @@ var require_stream6 = __commonJS((exports, module) => {
188821
188475
  };
188822
188476
  duplex2._write = function(chunk, encoding, callback) {
188823
188477
  if (ws8.readyState === ws8.CONNECTING) {
188824
- ws8.once("open", function open3() {
188478
+ ws8.once("open", function open2() {
188825
188479
  duplex2._write(chunk, encoding, callback);
188826
188480
  });
188827
188481
  return;
@@ -188882,7 +188536,7 @@ var require_subprotocol = __commonJS((exports, module) => {
188882
188536
 
188883
188537
  // node_modules/ws/lib/websocket-server.js
188884
188538
  var require_websocket_server = __commonJS((exports, module) => {
188885
- var EventEmitter4 = __require("events");
188539
+ var EventEmitter3 = __require("events");
188886
188540
  var http = __require("http");
188887
188541
  var { Duplex: Duplex4 } = __require("stream");
188888
188542
  var { createHash } = __require("crypto");
@@ -188896,7 +188550,7 @@ var require_websocket_server = __commonJS((exports, module) => {
188896
188550
  var CLOSING = 1;
188897
188551
  var CLOSED2 = 2;
188898
188552
 
188899
- class WebSocketServer extends EventEmitter4 {
188553
+ class WebSocketServer extends EventEmitter3 {
188900
188554
  constructor(options8, callback) {
188901
188555
  super();
188902
188556
  options8 = {
@@ -191433,13 +191087,13 @@ var require_broadcast_operator = __commonJS((exports) => {
191433
191087
  return true;
191434
191088
  }
191435
191089
  emitWithAck(ev2, ...args) {
191436
- return new Promise((resolve8, reject) => {
191090
+ return new Promise((resolve6, reject) => {
191437
191091
  args.push((err, responses) => {
191438
191092
  if (err) {
191439
191093
  err.responses = responses;
191440
191094
  return reject(err);
191441
191095
  } else {
191442
- return resolve8(responses);
191096
+ return resolve6(responses);
191443
191097
  }
191444
191098
  });
191445
191099
  this.emit(ev2, ...args);
@@ -191627,12 +191281,12 @@ var require_socket2 = __commonJS((exports) => {
191627
191281
  }
191628
191282
  emitWithAck(ev2, ...args) {
191629
191283
  const withErr = this.flags.timeout !== undefined;
191630
- return new Promise((resolve8, reject) => {
191284
+ return new Promise((resolve6, reject) => {
191631
191285
  args.push((arg1, arg2) => {
191632
191286
  if (withErr) {
191633
- return arg1 ? reject(arg1) : resolve8(arg2);
191287
+ return arg1 ? reject(arg1) : resolve6(arg2);
191634
191288
  } else {
191635
- return resolve8(arg1);
191289
+ return resolve6(arg1);
191636
191290
  }
191637
191291
  });
191638
191292
  this.emit(ev2, ...args);
@@ -192087,13 +191741,13 @@ var require_namespace = __commonJS((exports) => {
192087
191741
  return true;
192088
191742
  }
192089
191743
  serverSideEmitWithAck(ev2, ...args) {
192090
- return new Promise((resolve8, reject) => {
191744
+ return new Promise((resolve6, reject) => {
192091
191745
  args.push((err, responses) => {
192092
191746
  if (err) {
192093
191747
  err.responses = responses;
192094
191748
  return reject(err);
192095
191749
  } else {
192096
- return resolve8(responses);
191750
+ return resolve6(responses);
192097
191751
  }
192098
191752
  });
192099
191753
  this.serverSideEmit(ev2, ...args);
@@ -192777,7 +192431,7 @@ var require_cluster_adapter = __commonJS((exports) => {
192777
192431
  return localSockets;
192778
192432
  }
192779
192433
  const requestId = randomId();
192780
- return new Promise((resolve8, reject) => {
192434
+ return new Promise((resolve6, reject) => {
192781
192435
  const timeout3 = setTimeout(() => {
192782
192436
  const storedRequest2 = this.requests.get(requestId);
192783
192437
  if (storedRequest2) {
@@ -192787,7 +192441,7 @@ var require_cluster_adapter = __commonJS((exports) => {
192787
192441
  }, opts.flags.timeout || DEFAULT_TIMEOUT);
192788
192442
  const storedRequest = {
192789
192443
  type: MessageType.FETCH_SOCKETS,
192790
- resolve: resolve8,
192444
+ resolve: resolve6,
192791
192445
  timeout: timeout3,
192792
192446
  current: 0,
192793
192447
  expected: expectedResponseCount,
@@ -192997,7 +192651,7 @@ var require_cluster_adapter = __commonJS((exports) => {
192997
192651
  return localSockets;
192998
192652
  }
192999
192653
  const requestId = randomId();
193000
- return new Promise((resolve8, reject) => {
192654
+ return new Promise((resolve6, reject) => {
193001
192655
  const timeout3 = setTimeout(() => {
193002
192656
  const storedRequest2 = this.customRequests.get(requestId);
193003
192657
  if (storedRequest2) {
@@ -193007,7 +192661,7 @@ var require_cluster_adapter = __commonJS((exports) => {
193007
192661
  }, opts.flags.timeout || DEFAULT_TIMEOUT);
193008
192662
  const storedRequest = {
193009
192663
  type: MessageType.FETCH_SOCKETS,
193010
- resolve: resolve8,
192664
+ resolve: resolve6,
193011
192665
  timeout: timeout3,
193012
192666
  missingUids: new Set([...this.nodesMap.keys()]),
193013
192667
  responses: localSockets
@@ -193736,13 +193390,13 @@ var require_dist4 = __commonJS((exports, module) => {
193736
193390
  this.engine.close();
193737
193391
  (0, uws_1.restoreAdapter)();
193738
193392
  if (this.httpServer) {
193739
- return new Promise((resolve8) => {
193393
+ return new Promise((resolve6) => {
193740
193394
  this.httpServer.close((err) => {
193741
193395
  fn9 && fn9(err);
193742
193396
  if (err) {
193743
193397
  debug("server was not running");
193744
193398
  }
193745
- resolve8();
193399
+ resolve6();
193746
193400
  });
193747
193401
  });
193748
193402
  } else {
@@ -202478,7 +202132,7 @@ var require_mime_types4 = __commonJS((exports) => {
202478
202132
  * MIT Licensed
202479
202133
  */
202480
202134
  var db2 = require_db4();
202481
- var extname3 = __require("path").extname;
202135
+ var extname2 = __require("path").extname;
202482
202136
  var EXTRACT_TYPE_REGEXP = /^\s*([^;\s]*)(?:;|\s|$)/;
202483
202137
  var TEXT_TYPE_REGEXP = /^text\//i;
202484
202138
  exports.charset = charset;
@@ -202533,7 +202187,7 @@ var require_mime_types4 = __commonJS((exports) => {
202533
202187
  if (!path18 || typeof path18 !== "string") {
202534
202188
  return false;
202535
202189
  }
202536
- var extension2 = extname3("x." + path18).toLowerCase().substr(1);
202190
+ var extension2 = extname2("x." + path18).toLowerCase().substr(1);
202537
202191
  if (!extension2) {
202538
202192
  return false;
202539
202193
  }
@@ -202576,7 +202230,7 @@ var require_type_is2 = __commonJS((exports, module) => {
202576
202230
  module.exports = typeofrequest;
202577
202231
  module.exports.is = typeis;
202578
202232
  module.exports.hasBody = hasbody;
202579
- module.exports.normalize = normalize2;
202233
+ module.exports.normalize = normalize;
202580
202234
  module.exports.match = mimeMatch;
202581
202235
  function typeis(value, types_) {
202582
202236
  var i5;
@@ -202596,7 +202250,7 @@ var require_type_is2 = __commonJS((exports, module) => {
202596
202250
  }
202597
202251
  var type;
202598
202252
  for (i5 = 0;i5 < types.length; i5++) {
202599
- if (mimeMatch(normalize2(type = types[i5]), val)) {
202253
+ if (mimeMatch(normalize(type = types[i5]), val)) {
202600
202254
  return type[0] === "+" || type.indexOf("*") !== -1 ? val : type;
202601
202255
  }
202602
202256
  }
@@ -202619,7 +202273,7 @@ var require_type_is2 = __commonJS((exports, module) => {
202619
202273
  var value = req.headers["content-type"];
202620
202274
  return typeis(value, types);
202621
202275
  }
202622
- function normalize2(type) {
202276
+ function normalize(type) {
202623
202277
  if (typeof type !== "string") {
202624
202278
  return false;
202625
202279
  }
@@ -203040,7 +202694,7 @@ var require_utils12 = __commonJS((exports, module) => {
203040
202694
  if (decode4)
203041
202695
  return decode4(data, hint);
203042
202696
  }
203043
- function basename6(path18) {
202697
+ function basename4(path18) {
203044
202698
  if (typeof path18 !== "string")
203045
202699
  return "";
203046
202700
  for (let i5 = path18.length - 1;i5 >= 0; --i5) {
@@ -204344,7 +203998,7 @@ var require_utils12 = __commonJS((exports, module) => {
204344
203998
  -1
204345
203999
  ];
204346
204000
  module.exports = {
204347
- basename: basename6,
204001
+ basename: basename4,
204348
204002
  convertToUTF8,
204349
204003
  getDecoder,
204350
204004
  parseContentType,
@@ -204749,10 +204403,10 @@ var require_sbmh = __commonJS((exports, module) => {
204749
204403
 
204750
204404
  // node_modules/busboy/lib/types/multipart.js
204751
204405
  var require_multipart = __commonJS((exports, module) => {
204752
- var { Readable: Readable7, Writable: Writable4 } = __require("stream");
204406
+ var { Readable: Readable6, Writable: Writable4 } = __require("stream");
204753
204407
  var StreamSearch = require_sbmh();
204754
204408
  var {
204755
- basename: basename6,
204409
+ basename: basename4,
204756
204410
  convertToUTF8,
204757
204411
  getDecoder,
204758
204412
  parseContentType,
@@ -204907,7 +204561,7 @@ var require_multipart = __commonJS((exports, module) => {
204907
204561
  }
204908
204562
  }
204909
204563
 
204910
- class FileStream extends Readable7 {
204564
+ class FileStream extends Readable6 {
204911
204565
  constructor(opts, owner) {
204912
204566
  super(opts);
204913
204567
  this.truncated = false;
@@ -205014,7 +204668,7 @@ var require_multipart = __commonJS((exports, module) => {
205014
204668
  else if (disp.params.filename)
205015
204669
  filename = disp.params.filename;
205016
204670
  if (filename !== undefined && !preservePath)
205017
- filename = basename6(filename);
204671
+ filename = basename4(filename);
205018
204672
  }
205019
204673
  if (header2["content-type"]) {
205020
204674
  const conType = parseContentType(header2["content-type"][0]);
@@ -206499,12 +206153,12 @@ var require_append_field = __commonJS((exports, module) => {
206499
206153
 
206500
206154
  // node_modules/multer/lib/counter.js
206501
206155
  var require_counter = __commonJS((exports, module) => {
206502
- var EventEmitter4 = __require("events").EventEmitter;
206156
+ var EventEmitter3 = __require("events").EventEmitter;
206503
206157
  function Counter() {
206504
- EventEmitter4.call(this);
206158
+ EventEmitter3.call(this);
206505
206159
  this.value = 0;
206506
206160
  }
206507
- Counter.prototype = Object.create(EventEmitter4.prototype);
206161
+ Counter.prototype = Object.create(EventEmitter3.prototype);
206508
206162
  Counter.prototype.increment = function increment2() {
206509
206163
  this.value++;
206510
206164
  };
@@ -206865,8 +206519,8 @@ var require_mkdirp = __commonJS((exports, module) => {
206865
206519
  });
206866
206520
  break;
206867
206521
  default:
206868
- xfs.stat(p4, function(er22, stat5) {
206869
- if (er22 || !stat5.isDirectory())
206522
+ xfs.stat(p4, function(er22, stat2) {
206523
+ if (er22 || !stat2.isDirectory())
206870
206524
  cb2(er10, made);
206871
206525
  else
206872
206526
  cb2(null, made);
@@ -206897,13 +206551,13 @@ var require_mkdirp = __commonJS((exports, module) => {
206897
206551
  sync(p4, opts, made);
206898
206552
  break;
206899
206553
  default:
206900
- var stat5;
206554
+ var stat2;
206901
206555
  try {
206902
- stat5 = xfs.statSync(p4);
206556
+ stat2 = xfs.statSync(p4);
206903
206557
  } catch (err1) {
206904
206558
  throw err0;
206905
206559
  }
206906
- if (!stat5.isDirectory())
206560
+ if (!stat2.isDirectory())
206907
206561
  throw err0;
206908
206562
  break;
206909
206563
  }
@@ -207106,7 +206760,7 @@ var require_buffer_list = __commonJS((exports, module) => {
207106
206760
  }
207107
206761
  }, {
207108
206762
  key: "join",
207109
- value: function join18(s5) {
206763
+ value: function join16(s5) {
207110
206764
  if (this.length === 0)
207111
206765
  return "";
207112
206766
  var p4 = this.head;
@@ -207932,9 +207586,9 @@ var require__stream_duplex = __commonJS((exports, module) => {
207932
207586
  return keys2;
207933
207587
  };
207934
207588
  module.exports = Duplex4;
207935
- var Readable7 = require__stream_readable();
207589
+ var Readable6 = require__stream_readable();
207936
207590
  var Writable4 = require__stream_writable();
207937
- require_inherits()(Duplex4, Readable7);
207591
+ require_inherits()(Duplex4, Readable6);
207938
207592
  {
207939
207593
  keys = objectKeys(Writable4.prototype);
207940
207594
  for (v10 = 0;v10 < keys.length; v10++) {
@@ -207949,7 +207603,7 @@ var require__stream_duplex = __commonJS((exports, module) => {
207949
207603
  function Duplex4(options8) {
207950
207604
  if (!(this instanceof Duplex4))
207951
207605
  return new Duplex4(options8);
207952
- Readable7.call(this, options8);
207606
+ Readable6.call(this, options8);
207953
207607
  Writable4.call(this, options8);
207954
207608
  this.allowHalfOpen = true;
207955
207609
  if (options8) {
@@ -208461,14 +208115,14 @@ var require_async_iterator = __commonJS((exports, module) => {
208461
208115
  };
208462
208116
  }
208463
208117
  function readAndResolve(iter) {
208464
- var resolve8 = iter[kLastResolve];
208465
- if (resolve8 !== null) {
208118
+ var resolve6 = iter[kLastResolve];
208119
+ if (resolve6 !== null) {
208466
208120
  var data = iter[kStream].read();
208467
208121
  if (data !== null) {
208468
208122
  iter[kLastPromise] = null;
208469
208123
  iter[kLastResolve] = null;
208470
208124
  iter[kLastReject] = null;
208471
- resolve8(createIterResult(data, false));
208125
+ resolve6(createIterResult(data, false));
208472
208126
  }
208473
208127
  }
208474
208128
  }
@@ -208476,13 +208130,13 @@ var require_async_iterator = __commonJS((exports, module) => {
208476
208130
  process.nextTick(readAndResolve, iter);
208477
208131
  }
208478
208132
  function wrapForNext(lastPromise, iter) {
208479
- return function(resolve8, reject) {
208133
+ return function(resolve6, reject) {
208480
208134
  lastPromise.then(function() {
208481
208135
  if (iter[kEnded]) {
208482
- resolve8(createIterResult(undefined, true));
208136
+ resolve6(createIterResult(undefined, true));
208483
208137
  return;
208484
208138
  }
208485
- iter[kHandlePromise](resolve8, reject);
208139
+ iter[kHandlePromise](resolve6, reject);
208486
208140
  }, reject);
208487
208141
  };
208488
208142
  }
@@ -208501,12 +208155,12 @@ var require_async_iterator = __commonJS((exports, module) => {
208501
208155
  return Promise.resolve(createIterResult(undefined, true));
208502
208156
  }
208503
208157
  if (this[kStream].destroyed) {
208504
- return new Promise(function(resolve8, reject) {
208158
+ return new Promise(function(resolve6, reject) {
208505
208159
  process.nextTick(function() {
208506
208160
  if (_this[kError]) {
208507
208161
  reject(_this[kError]);
208508
208162
  } else {
208509
- resolve8(createIterResult(undefined, true));
208163
+ resolve6(createIterResult(undefined, true));
208510
208164
  }
208511
208165
  });
208512
208166
  });
@@ -208529,13 +208183,13 @@ var require_async_iterator = __commonJS((exports, module) => {
208529
208183
  return this;
208530
208184
  }), _defineProperty(_Object$setPrototypeO, "return", function _return() {
208531
208185
  var _this2 = this;
208532
- return new Promise(function(resolve8, reject) {
208186
+ return new Promise(function(resolve6, reject) {
208533
208187
  _this2[kStream].destroy(null, function(err) {
208534
208188
  if (err) {
208535
208189
  reject(err);
208536
208190
  return;
208537
208191
  }
208538
- resolve8(createIterResult(undefined, true));
208192
+ resolve6(createIterResult(undefined, true));
208539
208193
  });
208540
208194
  });
208541
208195
  }), _Object$setPrototypeO), AsyncIteratorPrototype);
@@ -208557,15 +208211,15 @@ var require_async_iterator = __commonJS((exports, module) => {
208557
208211
  value: stream._readableState.endEmitted,
208558
208212
  writable: true
208559
208213
  }), _defineProperty(_Object$create, kHandlePromise, {
208560
- value: function value(resolve8, reject) {
208214
+ value: function value(resolve6, reject) {
208561
208215
  var data = iterator[kStream].read();
208562
208216
  if (data) {
208563
208217
  iterator[kLastPromise] = null;
208564
208218
  iterator[kLastResolve] = null;
208565
208219
  iterator[kLastReject] = null;
208566
- resolve8(createIterResult(data, false));
208220
+ resolve6(createIterResult(data, false));
208567
208221
  } else {
208568
- iterator[kLastResolve] = resolve8;
208222
+ iterator[kLastResolve] = resolve6;
208569
208223
  iterator[kLastReject] = reject;
208570
208224
  }
208571
208225
  },
@@ -208584,12 +208238,12 @@ var require_async_iterator = __commonJS((exports, module) => {
208584
208238
  iterator[kError] = err;
208585
208239
  return;
208586
208240
  }
208587
- var resolve8 = iterator[kLastResolve];
208588
- if (resolve8 !== null) {
208241
+ var resolve6 = iterator[kLastResolve];
208242
+ if (resolve6 !== null) {
208589
208243
  iterator[kLastPromise] = null;
208590
208244
  iterator[kLastResolve] = null;
208591
208245
  iterator[kLastReject] = null;
208592
- resolve8(createIterResult(undefined, true));
208246
+ resolve6(createIterResult(undefined, true));
208593
208247
  }
208594
208248
  iterator[kEnded] = true;
208595
208249
  });
@@ -208601,7 +208255,7 @@ var require_async_iterator = __commonJS((exports, module) => {
208601
208255
 
208602
208256
  // node_modules/readable-stream/lib/internal/streams/from.js
208603
208257
  var require_from = __commonJS((exports, module) => {
208604
- function asyncGeneratorStep(gen, resolve8, reject, _next, _throw, key2, arg) {
208258
+ function asyncGeneratorStep(gen, resolve6, reject, _next, _throw, key2, arg) {
208605
208259
  try {
208606
208260
  var info = gen[key2](arg);
208607
208261
  var value = info.value;
@@ -208610,7 +208264,7 @@ var require_from = __commonJS((exports, module) => {
208610
208264
  return;
208611
208265
  }
208612
208266
  if (info.done) {
208613
- resolve8(value);
208267
+ resolve6(value);
208614
208268
  } else {
208615
208269
  Promise.resolve(value).then(_next, _throw);
208616
208270
  }
@@ -208618,13 +208272,13 @@ var require_from = __commonJS((exports, module) => {
208618
208272
  function _asyncToGenerator(fn9) {
208619
208273
  return function() {
208620
208274
  var self2 = this, args = arguments;
208621
- return new Promise(function(resolve8, reject) {
208275
+ return new Promise(function(resolve6, reject) {
208622
208276
  var gen = fn9.apply(self2, args);
208623
208277
  function _next(value) {
208624
- asyncGeneratorStep(gen, resolve8, reject, _next, _throw, "next", value);
208278
+ asyncGeneratorStep(gen, resolve6, reject, _next, _throw, "next", value);
208625
208279
  }
208626
208280
  function _throw(err) {
208627
- asyncGeneratorStep(gen, resolve8, reject, _next, _throw, "throw", err);
208281
+ asyncGeneratorStep(gen, resolve6, reject, _next, _throw, "throw", err);
208628
208282
  }
208629
208283
  _next(undefined);
208630
208284
  });
@@ -208677,7 +208331,7 @@ var require_from = __commonJS((exports, module) => {
208677
208331
  return (hint === "string" ? String : Number)(input);
208678
208332
  }
208679
208333
  var ERR_INVALID_ARG_TYPE = require_errors3().codes.ERR_INVALID_ARG_TYPE;
208680
- function from(Readable7, iterable, opts) {
208334
+ function from(Readable6, iterable, opts) {
208681
208335
  var iterator;
208682
208336
  if (iterable && typeof iterable.next === "function") {
208683
208337
  iterator = iterable;
@@ -208687,7 +208341,7 @@ var require_from = __commonJS((exports, module) => {
208687
208341
  iterator = iterable[Symbol.iterator]();
208688
208342
  else
208689
208343
  throw new ERR_INVALID_ARG_TYPE("iterable", ["Iterable"], iterable);
208690
- var readable2 = new Readable7(_objectSpread({
208344
+ var readable2 = new Readable6(_objectSpread({
208691
208345
  objectMode: true
208692
208346
  }, opts));
208693
208347
  var reading = false;
@@ -208724,9 +208378,9 @@ var require_from = __commonJS((exports, module) => {
208724
208378
 
208725
208379
  // node_modules/readable-stream/lib/_stream_readable.js
208726
208380
  var require__stream_readable = __commonJS((exports, module) => {
208727
- module.exports = Readable7;
208381
+ module.exports = Readable6;
208728
208382
  var Duplex4;
208729
- Readable7.ReadableState = ReadableState;
208383
+ Readable6.ReadableState = ReadableState;
208730
208384
  var EE3 = __require("events").EventEmitter;
208731
208385
  var EElistenerCount = function EElistenerCount2(emitter, type) {
208732
208386
  return emitter.listeners(type).length;
@@ -208759,7 +208413,7 @@ var require__stream_readable = __commonJS((exports, module) => {
208759
208413
  var StringDecoder4;
208760
208414
  var createReadableStreamAsyncIterator;
208761
208415
  var from;
208762
- require_inherits()(Readable7, Stream2);
208416
+ require_inherits()(Readable6, Stream2);
208763
208417
  var errorOrDestroy = destroyImpl.errorOrDestroy;
208764
208418
  var kProxyEvents = ["error", "close", "destroy", "pause", "resume"];
208765
208419
  function prependListener(emitter, event, fn9) {
@@ -208810,10 +208464,10 @@ var require__stream_readable = __commonJS((exports, module) => {
208810
208464
  this.encoding = options8.encoding;
208811
208465
  }
208812
208466
  }
208813
- function Readable7(options8) {
208467
+ function Readable6(options8) {
208814
208468
  Duplex4 = Duplex4 || require__stream_duplex();
208815
- if (!(this instanceof Readable7))
208816
- return new Readable7(options8);
208469
+ if (!(this instanceof Readable6))
208470
+ return new Readable6(options8);
208817
208471
  var isDuplex = this instanceof Duplex4;
208818
208472
  this._readableState = new ReadableState(options8, this, isDuplex);
208819
208473
  this.readable = true;
@@ -208825,7 +208479,7 @@ var require__stream_readable = __commonJS((exports, module) => {
208825
208479
  }
208826
208480
  Stream2.call(this);
208827
208481
  }
208828
- Object.defineProperty(Readable7.prototype, "destroyed", {
208482
+ Object.defineProperty(Readable6.prototype, "destroyed", {
208829
208483
  enumerable: false,
208830
208484
  get: function get() {
208831
208485
  if (this._readableState === undefined) {
@@ -208840,12 +208494,12 @@ var require__stream_readable = __commonJS((exports, module) => {
208840
208494
  this._readableState.destroyed = value;
208841
208495
  }
208842
208496
  });
208843
- Readable7.prototype.destroy = destroyImpl.destroy;
208844
- Readable7.prototype._undestroy = destroyImpl.undestroy;
208845
- Readable7.prototype._destroy = function(err, cb2) {
208497
+ Readable6.prototype.destroy = destroyImpl.destroy;
208498
+ Readable6.prototype._undestroy = destroyImpl.undestroy;
208499
+ Readable6.prototype._destroy = function(err, cb2) {
208846
208500
  cb2(err);
208847
208501
  };
208848
- Readable7.prototype.push = function(chunk, encoding) {
208502
+ Readable6.prototype.push = function(chunk, encoding) {
208849
208503
  var state = this._readableState;
208850
208504
  var skipChunkCheck;
208851
208505
  if (!state.objectMode) {
@@ -208862,7 +208516,7 @@ var require__stream_readable = __commonJS((exports, module) => {
208862
208516
  }
208863
208517
  return readableAddChunk(this, chunk, encoding, false, skipChunkCheck);
208864
208518
  };
208865
- Readable7.prototype.unshift = function(chunk) {
208519
+ Readable6.prototype.unshift = function(chunk) {
208866
208520
  return readableAddChunk(this, chunk, null, true, false);
208867
208521
  };
208868
208522
  function readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) {
@@ -208931,10 +208585,10 @@ var require__stream_readable = __commonJS((exports, module) => {
208931
208585
  }
208932
208586
  return er10;
208933
208587
  }
208934
- Readable7.prototype.isPaused = function() {
208588
+ Readable6.prototype.isPaused = function() {
208935
208589
  return this._readableState.flowing === false;
208936
208590
  };
208937
- Readable7.prototype.setEncoding = function(enc) {
208591
+ Readable6.prototype.setEncoding = function(enc) {
208938
208592
  if (!StringDecoder4)
208939
208593
  StringDecoder4 = require_string_decoder().StringDecoder;
208940
208594
  var decoder = new StringDecoder4(enc);
@@ -208988,7 +208642,7 @@ var require__stream_readable = __commonJS((exports, module) => {
208988
208642
  }
208989
208643
  return state.length;
208990
208644
  }
208991
- Readable7.prototype.read = function(n5) {
208645
+ Readable6.prototype.read = function(n5) {
208992
208646
  debug("read", n5);
208993
208647
  n5 = parseInt(n5, 10);
208994
208648
  var state = this._readableState;
@@ -209109,10 +208763,10 @@ var require__stream_readable = __commonJS((exports, module) => {
209109
208763
  }
209110
208764
  state.readingMore = false;
209111
208765
  }
209112
- Readable7.prototype._read = function(n5) {
208766
+ Readable6.prototype._read = function(n5) {
209113
208767
  errorOrDestroy(this, new ERR_METHOD_NOT_IMPLEMENTED("_read()"));
209114
208768
  };
209115
- Readable7.prototype.pipe = function(dest, pipeOpts) {
208769
+ Readable6.prototype.pipe = function(dest, pipeOpts) {
209116
208770
  var src = this;
209117
208771
  var state = this._readableState;
209118
208772
  switch (state.pipesCount) {
@@ -209220,7 +208874,7 @@ var require__stream_readable = __commonJS((exports, module) => {
209220
208874
  }
209221
208875
  };
209222
208876
  }
209223
- Readable7.prototype.unpipe = function(dest) {
208877
+ Readable6.prototype.unpipe = function(dest) {
209224
208878
  var state = this._readableState;
209225
208879
  var unpipeInfo = {
209226
208880
  hasUnpiped: false
@@ -209261,7 +208915,7 @@ var require__stream_readable = __commonJS((exports, module) => {
209261
208915
  dest.emit("unpipe", this, unpipeInfo);
209262
208916
  return this;
209263
208917
  };
209264
- Readable7.prototype.on = function(ev2, fn9) {
208918
+ Readable6.prototype.on = function(ev2, fn9) {
209265
208919
  var res = Stream2.prototype.on.call(this, ev2, fn9);
209266
208920
  var state = this._readableState;
209267
208921
  if (ev2 === "data") {
@@ -209283,15 +208937,15 @@ var require__stream_readable = __commonJS((exports, module) => {
209283
208937
  }
209284
208938
  return res;
209285
208939
  };
209286
- Readable7.prototype.addListener = Readable7.prototype.on;
209287
- Readable7.prototype.removeListener = function(ev2, fn9) {
208940
+ Readable6.prototype.addListener = Readable6.prototype.on;
208941
+ Readable6.prototype.removeListener = function(ev2, fn9) {
209288
208942
  var res = Stream2.prototype.removeListener.call(this, ev2, fn9);
209289
208943
  if (ev2 === "readable") {
209290
208944
  process.nextTick(updateReadableListening, this);
209291
208945
  }
209292
208946
  return res;
209293
208947
  };
209294
- Readable7.prototype.removeAllListeners = function(ev2) {
208948
+ Readable6.prototype.removeAllListeners = function(ev2) {
209295
208949
  var res = Stream2.prototype.removeAllListeners.apply(this, arguments);
209296
208950
  if (ev2 === "readable" || ev2 === undefined) {
209297
208951
  process.nextTick(updateReadableListening, this);
@@ -209311,7 +208965,7 @@ var require__stream_readable = __commonJS((exports, module) => {
209311
208965
  debug("readable nexttick read 0");
209312
208966
  self2.read(0);
209313
208967
  }
209314
- Readable7.prototype.resume = function() {
208968
+ Readable6.prototype.resume = function() {
209315
208969
  var state = this._readableState;
209316
208970
  if (!state.flowing) {
209317
208971
  debug("resume");
@@ -209338,7 +208992,7 @@ var require__stream_readable = __commonJS((exports, module) => {
209338
208992
  if (state.flowing && !state.reading)
209339
208993
  stream.read(0);
209340
208994
  }
209341
- Readable7.prototype.pause = function() {
208995
+ Readable6.prototype.pause = function() {
209342
208996
  debug("call pause flowing=%j", this._readableState.flowing);
209343
208997
  if (this._readableState.flowing !== false) {
209344
208998
  debug("pause");
@@ -209354,7 +209008,7 @@ var require__stream_readable = __commonJS((exports, module) => {
209354
209008
  while (state.flowing && stream.read() !== null)
209355
209009
  ;
209356
209010
  }
209357
- Readable7.prototype.wrap = function(stream) {
209011
+ Readable6.prototype.wrap = function(stream) {
209358
209012
  var _this = this;
209359
209013
  var state = this._readableState;
209360
209014
  var paused = false;
@@ -209403,26 +209057,26 @@ var require__stream_readable = __commonJS((exports, module) => {
209403
209057
  return this;
209404
209058
  };
209405
209059
  if (typeof Symbol === "function") {
209406
- Readable7.prototype[Symbol.asyncIterator] = function() {
209060
+ Readable6.prototype[Symbol.asyncIterator] = function() {
209407
209061
  if (createReadableStreamAsyncIterator === undefined) {
209408
209062
  createReadableStreamAsyncIterator = require_async_iterator();
209409
209063
  }
209410
209064
  return createReadableStreamAsyncIterator(this);
209411
209065
  };
209412
209066
  }
209413
- Object.defineProperty(Readable7.prototype, "readableHighWaterMark", {
209067
+ Object.defineProperty(Readable6.prototype, "readableHighWaterMark", {
209414
209068
  enumerable: false,
209415
209069
  get: function get() {
209416
209070
  return this._readableState.highWaterMark;
209417
209071
  }
209418
209072
  });
209419
- Object.defineProperty(Readable7.prototype, "readableBuffer", {
209073
+ Object.defineProperty(Readable6.prototype, "readableBuffer", {
209420
209074
  enumerable: false,
209421
209075
  get: function get() {
209422
209076
  return this._readableState && this._readableState.buffer;
209423
209077
  }
209424
209078
  });
209425
- Object.defineProperty(Readable7.prototype, "readableFlowing", {
209079
+ Object.defineProperty(Readable6.prototype, "readableFlowing", {
209426
209080
  enumerable: false,
209427
209081
  get: function get() {
209428
209082
  return this._readableState.flowing;
@@ -209433,8 +209087,8 @@ var require__stream_readable = __commonJS((exports, module) => {
209433
209087
  }
209434
209088
  }
209435
209089
  });
209436
- Readable7._fromList = fromList;
209437
- Object.defineProperty(Readable7.prototype, "readableLength", {
209090
+ Readable6._fromList = fromList;
209091
+ Object.defineProperty(Readable6.prototype, "readableLength", {
209438
209092
  enumerable: false,
209439
209093
  get: function get() {
209440
209094
  return this._readableState.length;
@@ -209482,11 +209136,11 @@ var require__stream_readable = __commonJS((exports, module) => {
209482
209136
  }
209483
209137
  }
209484
209138
  if (typeof Symbol === "function") {
209485
- Readable7.from = function(iterable, opts) {
209139
+ Readable6.from = function(iterable, opts) {
209486
209140
  if (from === undefined) {
209487
209141
  from = require_from();
209488
209142
  }
209489
- return from(Readable7, iterable, opts);
209143
+ return from(Readable6, iterable, opts);
209490
209144
  };
209491
209145
  }
209492
209146
  function indexOf(xs8, x10) {
@@ -210589,8 +210243,8 @@ var require_dist5 = __commonJS((exports, module) => {
210589
210243
  determineAgent: () => determineAgent
210590
210244
  });
210591
210245
  module.exports = __toCommonJS(src_exports);
210592
- var import_promises22 = __require("node:fs/promises");
210593
- var import_node_fs21 = __require("node:fs");
210246
+ var import_promises19 = __require("node:fs/promises");
210247
+ var import_node_fs19 = __require("node:fs");
210594
210248
  var DEVIN_LOCAL_PATH = "/opt/.devin";
210595
210249
  var CURSOR2 = "cursor";
210596
210250
  var CURSOR_CLI = "cursor-cli";
@@ -210647,7 +210301,7 @@ var require_dist5 = __commonJS((exports, module) => {
210647
210301
  return { isAgent: true, agent: { name: REPLIT } };
210648
210302
  }
210649
210303
  try {
210650
- await (0, import_promises22.access)(DEVIN_LOCAL_PATH, import_node_fs21.constants.F_OK);
210304
+ await (0, import_promises19.access)(DEVIN_LOCAL_PATH, import_node_fs19.constants.F_OK);
210651
210305
  return { isAgent: true, agent: { name: DEVIN } };
210652
210306
  } catch (error48) {}
210653
210307
  return { isAgent: false, agent: undefined };
@@ -226244,14 +225898,20 @@ function getTestOverrides() {
226244
225898
  // src/core/clients/schemas.ts
226245
225899
  var ApiErrorResponseSchema = exports_external.object({
226246
225900
  error_type: exports_external.string().optional(),
226247
- message: exports_external.union([exports_external.string(), exports_external.record(exports_external.string(), exports_external.unknown())]).optional(),
225901
+ message: exports_external.union([exports_external.string(), exports_external.record(exports_external.string(), exports_external.unknown())]).nullable().optional(),
226248
225902
  detail: exports_external.union([
226249
225903
  exports_external.string(),
226250
225904
  exports_external.record(exports_external.string(), exports_external.unknown()),
226251
225905
  exports_external.array(exports_external.unknown())
226252
225906
  ]).nullable().optional(),
226253
225907
  traceback: exports_external.string().nullable().optional(),
226254
- extra_data: exports_external.record(exports_external.string(), exports_external.unknown()).optional().nullable()
225908
+ extra_data: exports_external.looseObject({
225909
+ reason: exports_external.string().optional(),
225910
+ errors: exports_external.array(exports_external.union([
225911
+ exports_external.object({ name: exports_external.string(), message: exports_external.string() }),
225912
+ exports_external.string()
225913
+ ])).optional()
225914
+ }).optional().nullable()
226255
225915
  });
226256
225916
 
226257
225917
  // src/core/errors.ts
@@ -226272,14 +225932,22 @@ function formatApiError(errorBody) {
226272
225932
  }
226273
225933
  return JSON.stringify(errorBody, null, 2);
226274
225934
  }
225935
+ function parseErrorDetails(extraData) {
225936
+ const errors3 = extraData?.errors;
225937
+ if (!errors3 || errors3.length === 0)
225938
+ return;
225939
+ return errors3.map((item) => typeof item === "string" ? item : item.name ? `${item.name}: ${item.message}` : item.message);
225940
+ }
226275
225941
 
226276
225942
  class CLIError extends Error {
226277
225943
  hints;
225944
+ details;
226278
225945
  cause;
226279
225946
  constructor(message, options) {
226280
225947
  super(message);
226281
225948
  this.name = this.constructor.name;
226282
225949
  this.hints = options?.hints ?? [];
225950
+ this.details = options?.details ?? [];
226283
225951
  this.cause = options?.cause;
226284
225952
  Error.captureStackTrace(this, this.constructor);
226285
225953
  }
@@ -226371,9 +226039,9 @@ class ApiError extends SystemError {
226371
226039
  requestBody;
226372
226040
  responseBody;
226373
226041
  requestId;
226374
- constructor(message, options, parsedResponse) {
226375
- const hints = options?.hints ?? ApiError.getReasonHints(parsedResponse) ?? ApiError.getDefaultHints(options?.statusCode);
226376
- super(message, { hints, cause: options?.cause });
226042
+ constructor(message, options) {
226043
+ const hints = options?.hints ?? ApiError.getDefaultHints(options?.statusCode);
226044
+ super(message, { hints, details: options?.details, cause: options?.cause });
226377
226045
  this.statusCode = options?.statusCode;
226378
226046
  this.requestUrl = options?.requestUrl;
226379
226047
  this.requestMethod = options?.requestMethod;
@@ -226385,13 +226053,15 @@ class ApiError extends SystemError {
226385
226053
  if (error48 instanceof HTTPError) {
226386
226054
  let message;
226387
226055
  let responseBody;
226388
- let parsedErrorResponse;
226056
+ let hints;
226057
+ let details;
226389
226058
  try {
226390
226059
  responseBody = await error48.response.clone().json();
226391
226060
  message = formatApiError(responseBody);
226392
226061
  const parsed = ApiErrorResponseSchema.safeParse(responseBody);
226393
226062
  if (parsed.success) {
226394
- parsedErrorResponse = parsed.data;
226063
+ hints = ApiError.getReasonHints(parsed.data);
226064
+ details = parseErrorDetails(parsed.data.extra_data);
226395
226065
  }
226396
226066
  } catch {
226397
226067
  message = error48.message;
@@ -226406,8 +226076,10 @@ class ApiError extends SystemError {
226406
226076
  requestBody,
226407
226077
  responseBody,
226408
226078
  requestId,
226079
+ hints,
226080
+ details,
226409
226081
  cause: error48
226410
- }, parsedErrorResponse);
226082
+ });
226411
226083
  }
226412
226084
  if (error48 instanceof Error) {
226413
226085
  return new ApiError(`Error ${context}: ${error48.message}`, {
@@ -226433,6 +226105,13 @@ class ApiError extends SystemError {
226433
226105
  if (statusCode === 404) {
226434
226106
  return [{ message: "The requested resource was not found" }];
226435
226107
  }
226108
+ if (statusCode === 422) {
226109
+ return [
226110
+ {
226111
+ message: "The request was rejected due to a validation error. Check the error message above for details."
226112
+ }
226113
+ ];
226114
+ }
226436
226115
  if (statusCode === 428) {
226437
226116
  return [
226438
226117
  {
@@ -233981,7 +233660,9 @@ async function readFunction(configPath) {
233981
233660
  const functionDir = dirname4(configPath);
233982
233661
  const entryPath = join5(functionDir, config5.entry);
233983
233662
  if (!await pathExists(entryPath)) {
233984
- throw new FileNotFoundError(`Function entry file not found: ${entryPath} (referenced in ${configPath})`);
233663
+ throw new InvalidInputError(`Function entry file not found: ${entryPath} (referenced in ${configPath})`, {
233664
+ hints: [{ message: "Check the 'entry' field in your function config" }]
233665
+ });
233985
233666
  }
233986
233667
  const filePaths = await globby("*.{js,ts,json}", {
233987
233668
  cwd: functionDir,
@@ -234300,7 +233981,7 @@ import { tmpdir } from "node:os";
234300
233981
  import { join as join8 } from "node:path";
234301
233982
  async function deploySite(siteOutputDir) {
234302
233983
  if (!await pathExists(siteOutputDir)) {
234303
- throw new FileNotFoundError(`Output directory does not exist: ${siteOutputDir}. Make sure to build your project first.`, {
233984
+ throw new InvalidInputError(`Output directory does not exist: ${siteOutputDir}. Make sure to build your project first.`, {
234304
233985
  hints: [
234305
233986
  { message: "Run your build command (e.g., 'npm run build') first" }
234306
233987
  ]
@@ -235090,6 +234771,10 @@ var theme = {
235090
234771
  ].filter(Boolean);
235091
234772
  return source_default.dim(parts.join(" | "));
235092
234773
  },
234774
+ details(lines) {
234775
+ return lines.map((line) => ` • ${line}`).join(`
234776
+ `);
234777
+ },
235093
234778
  agentHints(hints) {
235094
234779
  if (hints.length === 0) {
235095
234780
  return null;
@@ -241907,12 +241592,11 @@ var package_default = {
241907
241592
  "@types/ejs": "^3.1.5",
241908
241593
  "@types/express": "^5.0.6",
241909
241594
  "@types/json-schema": "^7.0.15",
241910
- "@types/lodash": "^4.17.24",
241911
- "@types/multer": "^2.0.0",
241595
+ "@types/lodash.kebabcase": "^4.1.9",
241912
241596
  "@types/node": "^22.10.5",
241597
+ "@types/multer": "^2.0.0",
241913
241598
  "@vercel/detect-agent": "^1.1.0",
241914
241599
  chalk: "^5.6.2",
241915
- chokidar: "^5.0.0",
241916
241600
  commander: "^12.1.0",
241917
241601
  "common-tags": "^1.8.2",
241918
241602
  cors: "^2.8.5",
@@ -241928,9 +241612,9 @@ var package_default = {
241928
241612
  json5: "^2.2.3",
241929
241613
  knip: "^5.83.1",
241930
241614
  ky: "^1.14.2",
241931
- lodash: "^4.17.23",
241932
- msw: "^2.12.10",
241615
+ "lodash.kebabcase": "^4.1.1",
241933
241616
  multer: "^2.0.0",
241617
+ msw: "^2.12.10",
241934
241618
  nanoid: "^5.1.6",
241935
241619
  open: "^11.0.0",
241936
241620
  "p-wait-for": "^6.0.0",
@@ -242026,22 +241710,28 @@ async function runCommand(commandFn, options, context) {
242026
241710
  process.stdout.write(result.stdout);
242027
241711
  }
242028
241712
  } catch (error48) {
242029
- const errorMessage = error48 instanceof Error ? error48.message : String(error48);
242030
- R2.error(errorMessage);
242031
- if (process.env.DEBUG === "1" && error48 instanceof Error && error48.stack) {
242032
- R2.error(theme.styles.dim(error48.stack));
242033
- }
242034
- if (isCLIError(error48)) {
242035
- const hints = theme.format.agentHints(error48.hints);
242036
- if (hints) {
242037
- R2.error(hints);
242038
- }
242039
- }
241713
+ displayError(error48);
242040
241714
  const errorContext = context.errorReporter.getErrorContext();
242041
241715
  Le(theme.format.errorContext(errorContext));
242042
241716
  throw error48;
242043
241717
  }
242044
241718
  }
241719
+ function displayError(error48) {
241720
+ const errorMessage = error48 instanceof Error ? error48.message : String(error48);
241721
+ R2.error(errorMessage);
241722
+ if (isCLIError(error48)) {
241723
+ if (error48.details.length > 0) {
241724
+ R2.error(theme.format.details(error48.details));
241725
+ }
241726
+ const hints = theme.format.agentHints(error48.hints);
241727
+ if (hints) {
241728
+ R2.error(hints);
241729
+ }
241730
+ }
241731
+ if (process.env.DEBUG === "1" && error48 instanceof Error && error48.stack) {
241732
+ R2.error(theme.styles.dim(error48.stack));
241733
+ }
241734
+ }
242045
241735
  // src/cli/utils/runTask.ts
242046
241736
  async function runTask(startMessage, operation, options) {
242047
241737
  const s = bt2();
@@ -243033,10 +242723,8 @@ async function deployFunctionsAction() {
243033
242723
  R2.warn(`Deleted: ${result.deleted.join(", ")}`);
243034
242724
  }
243035
242725
  if (result.errors && result.errors.length > 0) {
243036
- const errorMessages = result.errors.map((e2) => `'${e2.name}' function: ${e2.message}`).join(`
243037
- `);
243038
- throw new ApiError(`Function deployment errors:
243039
- ${errorMessages}`, {
242726
+ throw new ApiError("Function deployment errors", {
242727
+ details: result.errors.map((e2) => `'${e2.name}': ${e2.message}`),
243040
242728
  hints: [
243041
242729
  { message: "Check the function code for syntax errors" },
243042
242730
  { message: "Ensure all imports are valid" }
@@ -243053,7 +242741,7 @@ function getFunctionsDeployCommand(context) {
243053
242741
 
243054
242742
  // src/cli/commands/project/create.ts
243055
242743
  import { basename as basename3, join as join11, resolve as resolve2 } from "node:path";
243056
- var import_kebabCase = __toESM(require_kebabCase(), 1);
242744
+ var import_lodash = __toESM(require_lodash(), 1);
243057
242745
  var DEFAULT_TEMPLATE_ID = "backend-only";
243058
242746
  async function getTemplateById(templateId) {
243059
242747
  const templates = await listTemplates();
@@ -243097,7 +242785,7 @@ async function createInteractive(options) {
243097
242785
  });
243098
242786
  },
243099
242787
  projectPath: async ({ results }) => {
243100
- const suggestedPath = await isDirEmpty() ? "./" : `./${import_kebabCase.default(results.name)}`;
242788
+ const suggestedPath = await isDirEmpty() ? "./" : `./${import_lodash.default(results.name)}`;
243101
242789
  return Ze({
243102
242790
  message: "Where should we create your project?",
243103
242791
  placeholder: suggestedPath,
@@ -243860,7 +243548,6 @@ function getTypesCommand(context) {
243860
243548
  }
243861
243549
 
243862
243550
  // src/cli/dev/dev-server/main.ts
243863
- import { dirname as dirname14 } from "node:path";
243864
243551
  var import_cors = __toESM(require_lib4(), 1);
243865
243552
  var import_express4 = __toESM(require_express(), 1);
243866
243553
 
@@ -244068,10 +243755,6 @@ class FunctionManager {
244068
243755
  try {
244069
243756
  return await promise2;
244070
243757
  } finally {
244071
- if (!this.starting.has(name2) && this.running.has(name2)) {
244072
- this.running.get(name2)?.process.kill();
244073
- this.running.delete(name2);
244074
- }
244075
243758
  this.starting.delete(name2);
244076
243759
  }
244077
243760
  }
@@ -244087,10 +243770,6 @@ class FunctionManager {
244087
243770
  this.setupProcessHandlers(name2, process21);
244088
243771
  return this.waitForReady(name2, runningFunc);
244089
243772
  }
244090
- reload(functions) {
244091
- this.stopAll();
244092
- this.functions = new Map(functions.map((f7) => [f7.name, f7]));
244093
- }
244094
243773
  stopAll() {
244095
243774
  for (const [name2, { process: process21 }] of this.running) {
244096
243775
  this.logger.log(`[dev-server] Stopping function: ${name2}`);
@@ -244132,9 +243811,7 @@ class FunctionManager {
244132
243811
  }
244133
243812
  });
244134
243813
  process21.on("exit", (code2) => {
244135
- if (code2 !== null) {
244136
- this.logger.log(`[dev-server] Function "${name2}" exited with code ${code2}`);
244137
- }
243814
+ this.logger.log(`[dev-server] Function "${name2}" exited with code ${code2}`);
244138
243815
  this.running.delete(name2);
244139
243816
  });
244140
243817
  process21.on("error", (error48) => {
@@ -244238,1674 +243915,6 @@ class Database {
244238
243915
  }
244239
243916
  }
244240
243917
 
244241
- // src/cli/dev/dev-server/dir-watcher.ts
244242
- import { relative as relative4, sep } from "node:path";
244243
-
244244
- // node_modules/chokidar/index.js
244245
- import { EventEmitter as EventEmitter3 } from "node:events";
244246
- import { stat as statcb, Stats } from "node:fs";
244247
- import { readdir as readdir3, stat as stat4 } from "node:fs/promises";
244248
- import * as sp3 from "node:path";
244249
-
244250
- // node_modules/readdirp/index.js
244251
- import { lstat as lstat2, readdir as readdir2, realpath, stat as stat2 } from "node:fs/promises";
244252
- import { join as pjoin, relative as prelative, resolve as presolve, sep as psep } from "node:path";
244253
- import { Readable as Readable6 } from "node:stream";
244254
- var EntryTypes = {
244255
- FILE_TYPE: "files",
244256
- DIR_TYPE: "directories",
244257
- FILE_DIR_TYPE: "files_directories",
244258
- EVERYTHING_TYPE: "all"
244259
- };
244260
- var defaultOptions = {
244261
- root: ".",
244262
- fileFilter: (_entryInfo) => true,
244263
- directoryFilter: (_entryInfo) => true,
244264
- type: EntryTypes.FILE_TYPE,
244265
- lstat: false,
244266
- depth: 2147483648,
244267
- alwaysStat: false,
244268
- highWaterMark: 4096
244269
- };
244270
- Object.freeze(defaultOptions);
244271
- var RECURSIVE_ERROR_CODE = "READDIRP_RECURSIVE_ERROR";
244272
- var NORMAL_FLOW_ERRORS = new Set(["ENOENT", "EPERM", "EACCES", "ELOOP", RECURSIVE_ERROR_CODE]);
244273
- var ALL_TYPES = [
244274
- EntryTypes.DIR_TYPE,
244275
- EntryTypes.EVERYTHING_TYPE,
244276
- EntryTypes.FILE_DIR_TYPE,
244277
- EntryTypes.FILE_TYPE
244278
- ];
244279
- var DIR_TYPES = new Set([
244280
- EntryTypes.DIR_TYPE,
244281
- EntryTypes.EVERYTHING_TYPE,
244282
- EntryTypes.FILE_DIR_TYPE
244283
- ]);
244284
- var FILE_TYPES2 = new Set([
244285
- EntryTypes.EVERYTHING_TYPE,
244286
- EntryTypes.FILE_DIR_TYPE,
244287
- EntryTypes.FILE_TYPE
244288
- ]);
244289
- var isNormalFlowError = (error48) => NORMAL_FLOW_ERRORS.has(error48.code);
244290
- var wantBigintFsStats = process.platform === "win32";
244291
- var emptyFn = (_entryInfo) => true;
244292
- var normalizeFilter = (filter2) => {
244293
- if (filter2 === undefined)
244294
- return emptyFn;
244295
- if (typeof filter2 === "function")
244296
- return filter2;
244297
- if (typeof filter2 === "string") {
244298
- const fl6 = filter2.trim();
244299
- return (entry) => entry.basename === fl6;
244300
- }
244301
- if (Array.isArray(filter2)) {
244302
- const trItems = filter2.map((item) => item.trim());
244303
- return (entry) => trItems.some((f7) => entry.basename === f7);
244304
- }
244305
- return emptyFn;
244306
- };
244307
-
244308
- class ReaddirpStream extends Readable6 {
244309
- parents;
244310
- reading;
244311
- parent;
244312
- _stat;
244313
- _maxDepth;
244314
- _wantsDir;
244315
- _wantsFile;
244316
- _wantsEverything;
244317
- _root;
244318
- _isDirent;
244319
- _statsProp;
244320
- _rdOptions;
244321
- _fileFilter;
244322
- _directoryFilter;
244323
- constructor(options8 = {}) {
244324
- super({
244325
- objectMode: true,
244326
- autoDestroy: true,
244327
- highWaterMark: options8.highWaterMark
244328
- });
244329
- const opts = { ...defaultOptions, ...options8 };
244330
- const { root: root2, type } = opts;
244331
- this._fileFilter = normalizeFilter(opts.fileFilter);
244332
- this._directoryFilter = normalizeFilter(opts.directoryFilter);
244333
- const statMethod = opts.lstat ? lstat2 : stat2;
244334
- if (wantBigintFsStats) {
244335
- this._stat = (path18) => statMethod(path18, { bigint: true });
244336
- } else {
244337
- this._stat = statMethod;
244338
- }
244339
- this._maxDepth = opts.depth != null && Number.isSafeInteger(opts.depth) ? opts.depth : defaultOptions.depth;
244340
- this._wantsDir = type ? DIR_TYPES.has(type) : false;
244341
- this._wantsFile = type ? FILE_TYPES2.has(type) : false;
244342
- this._wantsEverything = type === EntryTypes.EVERYTHING_TYPE;
244343
- this._root = presolve(root2);
244344
- this._isDirent = !opts.alwaysStat;
244345
- this._statsProp = this._isDirent ? "dirent" : "stats";
244346
- this._rdOptions = { encoding: "utf8", withFileTypes: this._isDirent };
244347
- this.parents = [this._exploreDir(root2, 1)];
244348
- this.reading = false;
244349
- this.parent = undefined;
244350
- }
244351
- async _read(batch) {
244352
- if (this.reading)
244353
- return;
244354
- this.reading = true;
244355
- try {
244356
- while (!this.destroyed && batch > 0) {
244357
- const par = this.parent;
244358
- const fil = par && par.files;
244359
- if (fil && fil.length > 0) {
244360
- const { path: path18, depth } = par;
244361
- const slice = fil.splice(0, batch).map((dirent) => this._formatEntry(dirent, path18));
244362
- const awaited = await Promise.all(slice);
244363
- for (const entry of awaited) {
244364
- if (!entry)
244365
- continue;
244366
- if (this.destroyed)
244367
- return;
244368
- const entryType = await this._getEntryType(entry);
244369
- if (entryType === "directory" && this._directoryFilter(entry)) {
244370
- if (depth <= this._maxDepth) {
244371
- this.parents.push(this._exploreDir(entry.fullPath, depth + 1));
244372
- }
244373
- if (this._wantsDir) {
244374
- this.push(entry);
244375
- batch--;
244376
- }
244377
- } else if ((entryType === "file" || this._includeAsFile(entry)) && this._fileFilter(entry)) {
244378
- if (this._wantsFile) {
244379
- this.push(entry);
244380
- batch--;
244381
- }
244382
- }
244383
- }
244384
- } else {
244385
- const parent = this.parents.pop();
244386
- if (!parent) {
244387
- this.push(null);
244388
- break;
244389
- }
244390
- this.parent = await parent;
244391
- if (this.destroyed)
244392
- return;
244393
- }
244394
- }
244395
- } catch (error48) {
244396
- this.destroy(error48);
244397
- } finally {
244398
- this.reading = false;
244399
- }
244400
- }
244401
- async _exploreDir(path18, depth) {
244402
- let files;
244403
- try {
244404
- files = await readdir2(path18, this._rdOptions);
244405
- } catch (error48) {
244406
- this._onError(error48);
244407
- }
244408
- return { files, depth, path: path18 };
244409
- }
244410
- async _formatEntry(dirent, path18) {
244411
- let entry;
244412
- const basename4 = this._isDirent ? dirent.name : dirent;
244413
- try {
244414
- const fullPath = presolve(pjoin(path18, basename4));
244415
- entry = { path: prelative(this._root, fullPath), fullPath, basename: basename4 };
244416
- entry[this._statsProp] = this._isDirent ? dirent : await this._stat(fullPath);
244417
- } catch (err) {
244418
- this._onError(err);
244419
- return;
244420
- }
244421
- return entry;
244422
- }
244423
- _onError(err) {
244424
- if (isNormalFlowError(err) && !this.destroyed) {
244425
- this.emit("warn", err);
244426
- } else {
244427
- this.destroy(err);
244428
- }
244429
- }
244430
- async _getEntryType(entry) {
244431
- if (!entry && this._statsProp in entry) {
244432
- return "";
244433
- }
244434
- const stats = entry[this._statsProp];
244435
- if (stats.isFile())
244436
- return "file";
244437
- if (stats.isDirectory())
244438
- return "directory";
244439
- if (stats && stats.isSymbolicLink()) {
244440
- const full = entry.fullPath;
244441
- try {
244442
- const entryRealPath = await realpath(full);
244443
- const entryRealPathStats = await lstat2(entryRealPath);
244444
- if (entryRealPathStats.isFile()) {
244445
- return "file";
244446
- }
244447
- if (entryRealPathStats.isDirectory()) {
244448
- const len = entryRealPath.length;
244449
- if (full.startsWith(entryRealPath) && full.substr(len, 1) === psep) {
244450
- const recursiveError = new Error(`Circular symlink detected: "${full}" points to "${entryRealPath}"`);
244451
- recursiveError.code = RECURSIVE_ERROR_CODE;
244452
- return this._onError(recursiveError);
244453
- }
244454
- return "directory";
244455
- }
244456
- } catch (error48) {
244457
- this._onError(error48);
244458
- return "";
244459
- }
244460
- }
244461
- }
244462
- _includeAsFile(entry) {
244463
- const stats = entry && entry[this._statsProp];
244464
- return stats && this._wantsEverything && !stats.isDirectory();
244465
- }
244466
- }
244467
- function readdirp(root2, options8 = {}) {
244468
- let type = options8.entryType || options8.type;
244469
- if (type === "both")
244470
- type = EntryTypes.FILE_DIR_TYPE;
244471
- if (type)
244472
- options8.type = type;
244473
- if (!root2) {
244474
- throw new Error("readdirp: root argument is required. Usage: readdirp(root, options)");
244475
- } else if (typeof root2 !== "string") {
244476
- throw new TypeError("readdirp: root argument must be a string. Usage: readdirp(root, options)");
244477
- } else if (type && !ALL_TYPES.includes(type)) {
244478
- throw new Error(`readdirp: Invalid type passed. Use one of ${ALL_TYPES.join(", ")}`);
244479
- }
244480
- options8.root = root2;
244481
- return new ReaddirpStream(options8);
244482
- }
244483
-
244484
- // node_modules/chokidar/handler.js
244485
- import { watch as fs_watch, unwatchFile, watchFile } from "node:fs";
244486
- import { realpath as fsrealpath, lstat as lstat3, open as open2, stat as stat3 } from "node:fs/promises";
244487
- import { type as osType } from "node:os";
244488
- import * as sp2 from "node:path";
244489
- var STR_DATA = "data";
244490
- var STR_END = "end";
244491
- var STR_CLOSE = "close";
244492
- var EMPTY_FN = () => {};
244493
- var pl6 = process.platform;
244494
- var isWindows4 = pl6 === "win32";
244495
- var isMacos = pl6 === "darwin";
244496
- var isLinux = pl6 === "linux";
244497
- var isFreeBSD = pl6 === "freebsd";
244498
- var isIBMi = osType() === "OS400";
244499
- var EVENTS = {
244500
- ALL: "all",
244501
- READY: "ready",
244502
- ADD: "add",
244503
- CHANGE: "change",
244504
- ADD_DIR: "addDir",
244505
- UNLINK: "unlink",
244506
- UNLINK_DIR: "unlinkDir",
244507
- RAW: "raw",
244508
- ERROR: "error"
244509
- };
244510
- var EV = EVENTS;
244511
- var THROTTLE_MODE_WATCH = "watch";
244512
- var statMethods = { lstat: lstat3, stat: stat3 };
244513
- var KEY_LISTENERS = "listeners";
244514
- var KEY_ERR = "errHandlers";
244515
- var KEY_RAW = "rawEmitters";
244516
- var HANDLER_KEYS2 = [KEY_LISTENERS, KEY_ERR, KEY_RAW];
244517
- var binaryExtensions = new Set([
244518
- "3dm",
244519
- "3ds",
244520
- "3g2",
244521
- "3gp",
244522
- "7z",
244523
- "a",
244524
- "aac",
244525
- "adp",
244526
- "afdesign",
244527
- "afphoto",
244528
- "afpub",
244529
- "ai",
244530
- "aif",
244531
- "aiff",
244532
- "alz",
244533
- "ape",
244534
- "apk",
244535
- "appimage",
244536
- "ar",
244537
- "arj",
244538
- "asf",
244539
- "au",
244540
- "avi",
244541
- "bak",
244542
- "baml",
244543
- "bh",
244544
- "bin",
244545
- "bk",
244546
- "bmp",
244547
- "btif",
244548
- "bz2",
244549
- "bzip2",
244550
- "cab",
244551
- "caf",
244552
- "cgm",
244553
- "class",
244554
- "cmx",
244555
- "cpio",
244556
- "cr2",
244557
- "cur",
244558
- "dat",
244559
- "dcm",
244560
- "deb",
244561
- "dex",
244562
- "djvu",
244563
- "dll",
244564
- "dmg",
244565
- "dng",
244566
- "doc",
244567
- "docm",
244568
- "docx",
244569
- "dot",
244570
- "dotm",
244571
- "dra",
244572
- "DS_Store",
244573
- "dsk",
244574
- "dts",
244575
- "dtshd",
244576
- "dvb",
244577
- "dwg",
244578
- "dxf",
244579
- "ecelp4800",
244580
- "ecelp7470",
244581
- "ecelp9600",
244582
- "egg",
244583
- "eol",
244584
- "eot",
244585
- "epub",
244586
- "exe",
244587
- "f4v",
244588
- "fbs",
244589
- "fh",
244590
- "fla",
244591
- "flac",
244592
- "flatpak",
244593
- "fli",
244594
- "flv",
244595
- "fpx",
244596
- "fst",
244597
- "fvt",
244598
- "g3",
244599
- "gh",
244600
- "gif",
244601
- "graffle",
244602
- "gz",
244603
- "gzip",
244604
- "h261",
244605
- "h263",
244606
- "h264",
244607
- "icns",
244608
- "ico",
244609
- "ief",
244610
- "img",
244611
- "ipa",
244612
- "iso",
244613
- "jar",
244614
- "jpeg",
244615
- "jpg",
244616
- "jpgv",
244617
- "jpm",
244618
- "jxr",
244619
- "key",
244620
- "ktx",
244621
- "lha",
244622
- "lib",
244623
- "lvp",
244624
- "lz",
244625
- "lzh",
244626
- "lzma",
244627
- "lzo",
244628
- "m3u",
244629
- "m4a",
244630
- "m4v",
244631
- "mar",
244632
- "mdi",
244633
- "mht",
244634
- "mid",
244635
- "midi",
244636
- "mj2",
244637
- "mka",
244638
- "mkv",
244639
- "mmr",
244640
- "mng",
244641
- "mobi",
244642
- "mov",
244643
- "movie",
244644
- "mp3",
244645
- "mp4",
244646
- "mp4a",
244647
- "mpeg",
244648
- "mpg",
244649
- "mpga",
244650
- "mxu",
244651
- "nef",
244652
- "npx",
244653
- "numbers",
244654
- "nupkg",
244655
- "o",
244656
- "odp",
244657
- "ods",
244658
- "odt",
244659
- "oga",
244660
- "ogg",
244661
- "ogv",
244662
- "otf",
244663
- "ott",
244664
- "pages",
244665
- "pbm",
244666
- "pcx",
244667
- "pdb",
244668
- "pdf",
244669
- "pea",
244670
- "pgm",
244671
- "pic",
244672
- "png",
244673
- "pnm",
244674
- "pot",
244675
- "potm",
244676
- "potx",
244677
- "ppa",
244678
- "ppam",
244679
- "ppm",
244680
- "pps",
244681
- "ppsm",
244682
- "ppsx",
244683
- "ppt",
244684
- "pptm",
244685
- "pptx",
244686
- "psd",
244687
- "pya",
244688
- "pyc",
244689
- "pyo",
244690
- "pyv",
244691
- "qt",
244692
- "rar",
244693
- "ras",
244694
- "raw",
244695
- "resources",
244696
- "rgb",
244697
- "rip",
244698
- "rlc",
244699
- "rmf",
244700
- "rmvb",
244701
- "rpm",
244702
- "rtf",
244703
- "rz",
244704
- "s3m",
244705
- "s7z",
244706
- "scpt",
244707
- "sgi",
244708
- "shar",
244709
- "snap",
244710
- "sil",
244711
- "sketch",
244712
- "slk",
244713
- "smv",
244714
- "snk",
244715
- "so",
244716
- "stl",
244717
- "suo",
244718
- "sub",
244719
- "swf",
244720
- "tar",
244721
- "tbz",
244722
- "tbz2",
244723
- "tga",
244724
- "tgz",
244725
- "thmx",
244726
- "tif",
244727
- "tiff",
244728
- "tlz",
244729
- "ttc",
244730
- "ttf",
244731
- "txz",
244732
- "udf",
244733
- "uvh",
244734
- "uvi",
244735
- "uvm",
244736
- "uvp",
244737
- "uvs",
244738
- "uvu",
244739
- "viv",
244740
- "vob",
244741
- "war",
244742
- "wav",
244743
- "wax",
244744
- "wbmp",
244745
- "wdp",
244746
- "weba",
244747
- "webm",
244748
- "webp",
244749
- "whl",
244750
- "wim",
244751
- "wm",
244752
- "wma",
244753
- "wmv",
244754
- "wmx",
244755
- "woff",
244756
- "woff2",
244757
- "wrm",
244758
- "wvx",
244759
- "xbm",
244760
- "xif",
244761
- "xla",
244762
- "xlam",
244763
- "xls",
244764
- "xlsb",
244765
- "xlsm",
244766
- "xlsx",
244767
- "xlt",
244768
- "xltm",
244769
- "xltx",
244770
- "xm",
244771
- "xmind",
244772
- "xpi",
244773
- "xpm",
244774
- "xwd",
244775
- "xz",
244776
- "z",
244777
- "zip",
244778
- "zipx"
244779
- ]);
244780
- var isBinaryPath = (filePath) => binaryExtensions.has(sp2.extname(filePath).slice(1).toLowerCase());
244781
- var foreach = (val, fn9) => {
244782
- if (val instanceof Set) {
244783
- val.forEach(fn9);
244784
- } else {
244785
- fn9(val);
244786
- }
244787
- };
244788
- var addAndConvert = (main, prop, item) => {
244789
- let container = main[prop];
244790
- if (!(container instanceof Set)) {
244791
- main[prop] = container = new Set([container]);
244792
- }
244793
- container.add(item);
244794
- };
244795
- var clearItem = (cont) => (key2) => {
244796
- const set2 = cont[key2];
244797
- if (set2 instanceof Set) {
244798
- set2.clear();
244799
- } else {
244800
- delete cont[key2];
244801
- }
244802
- };
244803
- var delFromSet = (main, prop, item) => {
244804
- const container = main[prop];
244805
- if (container instanceof Set) {
244806
- container.delete(item);
244807
- } else if (container === item) {
244808
- delete main[prop];
244809
- }
244810
- };
244811
- var isEmptySet = (val) => val instanceof Set ? val.size === 0 : !val;
244812
- var FsWatchInstances = new Map;
244813
- function createFsWatchInstance(path18, options8, listener, errHandler, emitRaw) {
244814
- const handleEvent = (rawEvent, evPath) => {
244815
- listener(path18);
244816
- emitRaw(rawEvent, evPath, { watchedPath: path18 });
244817
- if (evPath && path18 !== evPath) {
244818
- fsWatchBroadcast(sp2.resolve(path18, evPath), KEY_LISTENERS, sp2.join(path18, evPath));
244819
- }
244820
- };
244821
- try {
244822
- return fs_watch(path18, {
244823
- persistent: options8.persistent
244824
- }, handleEvent);
244825
- } catch (error48) {
244826
- errHandler(error48);
244827
- return;
244828
- }
244829
- }
244830
- var fsWatchBroadcast = (fullPath, listenerType, val1, val2, val3) => {
244831
- const cont = FsWatchInstances.get(fullPath);
244832
- if (!cont)
244833
- return;
244834
- foreach(cont[listenerType], (listener) => {
244835
- listener(val1, val2, val3);
244836
- });
244837
- };
244838
- var setFsWatchListener = (path18, fullPath, options8, handlers) => {
244839
- const { listener, errHandler, rawEmitter } = handlers;
244840
- let cont = FsWatchInstances.get(fullPath);
244841
- let watcher;
244842
- if (!options8.persistent) {
244843
- watcher = createFsWatchInstance(path18, options8, listener, errHandler, rawEmitter);
244844
- if (!watcher)
244845
- return;
244846
- return watcher.close.bind(watcher);
244847
- }
244848
- if (cont) {
244849
- addAndConvert(cont, KEY_LISTENERS, listener);
244850
- addAndConvert(cont, KEY_ERR, errHandler);
244851
- addAndConvert(cont, KEY_RAW, rawEmitter);
244852
- } else {
244853
- watcher = createFsWatchInstance(path18, options8, fsWatchBroadcast.bind(null, fullPath, KEY_LISTENERS), errHandler, fsWatchBroadcast.bind(null, fullPath, KEY_RAW));
244854
- if (!watcher)
244855
- return;
244856
- watcher.on(EV.ERROR, async (error48) => {
244857
- const broadcastErr = fsWatchBroadcast.bind(null, fullPath, KEY_ERR);
244858
- if (cont)
244859
- cont.watcherUnusable = true;
244860
- if (isWindows4 && error48.code === "EPERM") {
244861
- try {
244862
- const fd = await open2(path18, "r");
244863
- await fd.close();
244864
- broadcastErr(error48);
244865
- } catch (err) {}
244866
- } else {
244867
- broadcastErr(error48);
244868
- }
244869
- });
244870
- cont = {
244871
- listeners: listener,
244872
- errHandlers: errHandler,
244873
- rawEmitters: rawEmitter,
244874
- watcher
244875
- };
244876
- FsWatchInstances.set(fullPath, cont);
244877
- }
244878
- return () => {
244879
- delFromSet(cont, KEY_LISTENERS, listener);
244880
- delFromSet(cont, KEY_ERR, errHandler);
244881
- delFromSet(cont, KEY_RAW, rawEmitter);
244882
- if (isEmptySet(cont.listeners)) {
244883
- cont.watcher.close();
244884
- FsWatchInstances.delete(fullPath);
244885
- HANDLER_KEYS2.forEach(clearItem(cont));
244886
- cont.watcher = undefined;
244887
- Object.freeze(cont);
244888
- }
244889
- };
244890
- };
244891
- var FsWatchFileInstances = new Map;
244892
- var setFsWatchFileListener = (path18, fullPath, options8, handlers) => {
244893
- const { listener, rawEmitter } = handlers;
244894
- let cont = FsWatchFileInstances.get(fullPath);
244895
- const copts = cont && cont.options;
244896
- if (copts && (copts.persistent < options8.persistent || copts.interval > options8.interval)) {
244897
- unwatchFile(fullPath);
244898
- cont = undefined;
244899
- }
244900
- if (cont) {
244901
- addAndConvert(cont, KEY_LISTENERS, listener);
244902
- addAndConvert(cont, KEY_RAW, rawEmitter);
244903
- } else {
244904
- cont = {
244905
- listeners: listener,
244906
- rawEmitters: rawEmitter,
244907
- options: options8,
244908
- watcher: watchFile(fullPath, options8, (curr, prev) => {
244909
- foreach(cont.rawEmitters, (rawEmitter2) => {
244910
- rawEmitter2(EV.CHANGE, fullPath, { curr, prev });
244911
- });
244912
- const currmtime = curr.mtimeMs;
244913
- if (curr.size !== prev.size || currmtime > prev.mtimeMs || currmtime === 0) {
244914
- foreach(cont.listeners, (listener2) => listener2(path18, curr));
244915
- }
244916
- })
244917
- };
244918
- FsWatchFileInstances.set(fullPath, cont);
244919
- }
244920
- return () => {
244921
- delFromSet(cont, KEY_LISTENERS, listener);
244922
- delFromSet(cont, KEY_RAW, rawEmitter);
244923
- if (isEmptySet(cont.listeners)) {
244924
- FsWatchFileInstances.delete(fullPath);
244925
- unwatchFile(fullPath);
244926
- cont.options = cont.watcher = undefined;
244927
- Object.freeze(cont);
244928
- }
244929
- };
244930
- };
244931
-
244932
- class NodeFsHandler {
244933
- fsw;
244934
- _boundHandleError;
244935
- constructor(fsW) {
244936
- this.fsw = fsW;
244937
- this._boundHandleError = (error48) => fsW._handleError(error48);
244938
- }
244939
- _watchWithNodeFs(path18, listener) {
244940
- const opts = this.fsw.options;
244941
- const directory = sp2.dirname(path18);
244942
- const basename5 = sp2.basename(path18);
244943
- const parent = this.fsw._getWatchedDir(directory);
244944
- parent.add(basename5);
244945
- const absolutePath = sp2.resolve(path18);
244946
- const options8 = {
244947
- persistent: opts.persistent
244948
- };
244949
- if (!listener)
244950
- listener = EMPTY_FN;
244951
- let closer;
244952
- if (opts.usePolling) {
244953
- const enableBin = opts.interval !== opts.binaryInterval;
244954
- options8.interval = enableBin && isBinaryPath(basename5) ? opts.binaryInterval : opts.interval;
244955
- closer = setFsWatchFileListener(path18, absolutePath, options8, {
244956
- listener,
244957
- rawEmitter: this.fsw._emitRaw
244958
- });
244959
- } else {
244960
- closer = setFsWatchListener(path18, absolutePath, options8, {
244961
- listener,
244962
- errHandler: this._boundHandleError,
244963
- rawEmitter: this.fsw._emitRaw
244964
- });
244965
- }
244966
- return closer;
244967
- }
244968
- _handleFile(file2, stats, initialAdd) {
244969
- if (this.fsw.closed) {
244970
- return;
244971
- }
244972
- const dirname13 = sp2.dirname(file2);
244973
- const basename5 = sp2.basename(file2);
244974
- const parent = this.fsw._getWatchedDir(dirname13);
244975
- let prevStats = stats;
244976
- if (parent.has(basename5))
244977
- return;
244978
- const listener = async (path18, newStats) => {
244979
- if (!this.fsw._throttle(THROTTLE_MODE_WATCH, file2, 5))
244980
- return;
244981
- if (!newStats || newStats.mtimeMs === 0) {
244982
- try {
244983
- const newStats2 = await stat3(file2);
244984
- if (this.fsw.closed)
244985
- return;
244986
- const at13 = newStats2.atimeMs;
244987
- const mt12 = newStats2.mtimeMs;
244988
- if (!at13 || at13 <= mt12 || mt12 !== prevStats.mtimeMs) {
244989
- this.fsw._emit(EV.CHANGE, file2, newStats2);
244990
- }
244991
- if ((isMacos || isLinux || isFreeBSD) && prevStats.ino !== newStats2.ino) {
244992
- this.fsw._closeFile(path18);
244993
- prevStats = newStats2;
244994
- const closer2 = this._watchWithNodeFs(file2, listener);
244995
- if (closer2)
244996
- this.fsw._addPathCloser(path18, closer2);
244997
- } else {
244998
- prevStats = newStats2;
244999
- }
245000
- } catch (error48) {
245001
- this.fsw._remove(dirname13, basename5);
245002
- }
245003
- } else if (parent.has(basename5)) {
245004
- const at13 = newStats.atimeMs;
245005
- const mt12 = newStats.mtimeMs;
245006
- if (!at13 || at13 <= mt12 || mt12 !== prevStats.mtimeMs) {
245007
- this.fsw._emit(EV.CHANGE, file2, newStats);
245008
- }
245009
- prevStats = newStats;
245010
- }
245011
- };
245012
- const closer = this._watchWithNodeFs(file2, listener);
245013
- if (!(initialAdd && this.fsw.options.ignoreInitial) && this.fsw._isntIgnored(file2)) {
245014
- if (!this.fsw._throttle(EV.ADD, file2, 0))
245015
- return;
245016
- this.fsw._emit(EV.ADD, file2, stats);
245017
- }
245018
- return closer;
245019
- }
245020
- async _handleSymlink(entry, directory, path18, item) {
245021
- if (this.fsw.closed) {
245022
- return;
245023
- }
245024
- const full = entry.fullPath;
245025
- const dir = this.fsw._getWatchedDir(directory);
245026
- if (!this.fsw.options.followSymlinks) {
245027
- this.fsw._incrReadyCount();
245028
- let linkPath;
245029
- try {
245030
- linkPath = await fsrealpath(path18);
245031
- } catch (e8) {
245032
- this.fsw._emitReady();
245033
- return true;
245034
- }
245035
- if (this.fsw.closed)
245036
- return;
245037
- if (dir.has(item)) {
245038
- if (this.fsw._symlinkPaths.get(full) !== linkPath) {
245039
- this.fsw._symlinkPaths.set(full, linkPath);
245040
- this.fsw._emit(EV.CHANGE, path18, entry.stats);
245041
- }
245042
- } else {
245043
- dir.add(item);
245044
- this.fsw._symlinkPaths.set(full, linkPath);
245045
- this.fsw._emit(EV.ADD, path18, entry.stats);
245046
- }
245047
- this.fsw._emitReady();
245048
- return true;
245049
- }
245050
- if (this.fsw._symlinkPaths.has(full)) {
245051
- return true;
245052
- }
245053
- this.fsw._symlinkPaths.set(full, true);
245054
- }
245055
- _handleRead(directory, initialAdd, wh2, target, dir, depth, throttler) {
245056
- directory = sp2.join(directory, "");
245057
- const throttleKey = target ? `${directory}:${target}` : directory;
245058
- throttler = this.fsw._throttle("readdir", throttleKey, 1000);
245059
- if (!throttler)
245060
- return;
245061
- const previous = this.fsw._getWatchedDir(wh2.path);
245062
- const current = new Set;
245063
- let stream = this.fsw._readdirp(directory, {
245064
- fileFilter: (entry) => wh2.filterPath(entry),
245065
- directoryFilter: (entry) => wh2.filterDir(entry)
245066
- });
245067
- if (!stream)
245068
- return;
245069
- stream.on(STR_DATA, async (entry) => {
245070
- if (this.fsw.closed) {
245071
- stream = undefined;
245072
- return;
245073
- }
245074
- const item = entry.path;
245075
- let path18 = sp2.join(directory, item);
245076
- current.add(item);
245077
- if (entry.stats.isSymbolicLink() && await this._handleSymlink(entry, directory, path18, item)) {
245078
- return;
245079
- }
245080
- if (this.fsw.closed) {
245081
- stream = undefined;
245082
- return;
245083
- }
245084
- if (item === target || !target && !previous.has(item)) {
245085
- this.fsw._incrReadyCount();
245086
- path18 = sp2.join(dir, sp2.relative(dir, path18));
245087
- this._addToNodeFs(path18, initialAdd, wh2, depth + 1);
245088
- }
245089
- }).on(EV.ERROR, this._boundHandleError);
245090
- return new Promise((resolve7, reject) => {
245091
- if (!stream)
245092
- return reject();
245093
- stream.once(STR_END, () => {
245094
- if (this.fsw.closed) {
245095
- stream = undefined;
245096
- return;
245097
- }
245098
- const wasThrottled = throttler ? throttler.clear() : false;
245099
- resolve7(undefined);
245100
- previous.getChildren().filter((item) => {
245101
- return item !== directory && !current.has(item);
245102
- }).forEach((item) => {
245103
- this.fsw._remove(directory, item);
245104
- });
245105
- stream = undefined;
245106
- if (wasThrottled)
245107
- this._handleRead(directory, false, wh2, target, dir, depth, throttler);
245108
- });
245109
- });
245110
- }
245111
- async _handleDir(dir, stats, initialAdd, depth, target, wh2, realpath2) {
245112
- const parentDir = this.fsw._getWatchedDir(sp2.dirname(dir));
245113
- const tracked = parentDir.has(sp2.basename(dir));
245114
- if (!(initialAdd && this.fsw.options.ignoreInitial) && !target && !tracked) {
245115
- this.fsw._emit(EV.ADD_DIR, dir, stats);
245116
- }
245117
- parentDir.add(sp2.basename(dir));
245118
- this.fsw._getWatchedDir(dir);
245119
- let throttler;
245120
- let closer;
245121
- const oDepth = this.fsw.options.depth;
245122
- if ((oDepth == null || depth <= oDepth) && !this.fsw._symlinkPaths.has(realpath2)) {
245123
- if (!target) {
245124
- await this._handleRead(dir, initialAdd, wh2, target, dir, depth, throttler);
245125
- if (this.fsw.closed)
245126
- return;
245127
- }
245128
- closer = this._watchWithNodeFs(dir, (dirPath, stats2) => {
245129
- if (stats2 && stats2.mtimeMs === 0)
245130
- return;
245131
- this._handleRead(dirPath, false, wh2, target, dir, depth, throttler);
245132
- });
245133
- }
245134
- return closer;
245135
- }
245136
- async _addToNodeFs(path18, initialAdd, priorWh, depth, target) {
245137
- const ready = this.fsw._emitReady;
245138
- if (this.fsw._isIgnored(path18) || this.fsw.closed) {
245139
- ready();
245140
- return false;
245141
- }
245142
- const wh2 = this.fsw._getWatchHelpers(path18);
245143
- if (priorWh) {
245144
- wh2.filterPath = (entry) => priorWh.filterPath(entry);
245145
- wh2.filterDir = (entry) => priorWh.filterDir(entry);
245146
- }
245147
- try {
245148
- const stats = await statMethods[wh2.statMethod](wh2.watchPath);
245149
- if (this.fsw.closed)
245150
- return;
245151
- if (this.fsw._isIgnored(wh2.watchPath, stats)) {
245152
- ready();
245153
- return false;
245154
- }
245155
- const follow = this.fsw.options.followSymlinks;
245156
- let closer;
245157
- if (stats.isDirectory()) {
245158
- const absPath = sp2.resolve(path18);
245159
- const targetPath = follow ? await fsrealpath(path18) : path18;
245160
- if (this.fsw.closed)
245161
- return;
245162
- closer = await this._handleDir(wh2.watchPath, stats, initialAdd, depth, target, wh2, targetPath);
245163
- if (this.fsw.closed)
245164
- return;
245165
- if (absPath !== targetPath && targetPath !== undefined) {
245166
- this.fsw._symlinkPaths.set(absPath, targetPath);
245167
- }
245168
- } else if (stats.isSymbolicLink()) {
245169
- const targetPath = follow ? await fsrealpath(path18) : path18;
245170
- if (this.fsw.closed)
245171
- return;
245172
- const parent = sp2.dirname(wh2.watchPath);
245173
- this.fsw._getWatchedDir(parent).add(wh2.watchPath);
245174
- this.fsw._emit(EV.ADD, wh2.watchPath, stats);
245175
- closer = await this._handleDir(parent, stats, initialAdd, depth, path18, wh2, targetPath);
245176
- if (this.fsw.closed)
245177
- return;
245178
- if (targetPath !== undefined) {
245179
- this.fsw._symlinkPaths.set(sp2.resolve(path18), targetPath);
245180
- }
245181
- } else {
245182
- closer = this._handleFile(wh2.watchPath, stats, initialAdd);
245183
- }
245184
- ready();
245185
- if (closer)
245186
- this.fsw._addPathCloser(path18, closer);
245187
- return false;
245188
- } catch (error48) {
245189
- if (this.fsw._handleError(error48)) {
245190
- ready();
245191
- return path18;
245192
- }
245193
- }
245194
- }
245195
- }
245196
-
245197
- // node_modules/chokidar/index.js
245198
- /*! chokidar - MIT License (c) 2012 Paul Miller (paulmillr.com) */
245199
- var SLASH = "/";
245200
- var SLASH_SLASH = "//";
245201
- var ONE_DOT = ".";
245202
- var TWO_DOTS = "..";
245203
- var STRING_TYPE = "string";
245204
- var BACK_SLASH_RE = /\\/g;
245205
- var DOUBLE_SLASH_RE = /\/\//g;
245206
- var DOT_RE = /\..*\.(sw[px])$|~$|\.subl.*\.tmp/;
245207
- var REPLACER_RE = /^\.[/\\]/;
245208
- function arrify(item) {
245209
- return Array.isArray(item) ? item : [item];
245210
- }
245211
- var isMatcherObject = (matcher) => typeof matcher === "object" && matcher !== null && !(matcher instanceof RegExp);
245212
- function createPattern(matcher) {
245213
- if (typeof matcher === "function")
245214
- return matcher;
245215
- if (typeof matcher === "string")
245216
- return (string4) => matcher === string4;
245217
- if (matcher instanceof RegExp)
245218
- return (string4) => matcher.test(string4);
245219
- if (typeof matcher === "object" && matcher !== null) {
245220
- return (string4) => {
245221
- if (matcher.path === string4)
245222
- return true;
245223
- if (matcher.recursive) {
245224
- const relative4 = sp3.relative(matcher.path, string4);
245225
- if (!relative4) {
245226
- return false;
245227
- }
245228
- return !relative4.startsWith("..") && !sp3.isAbsolute(relative4);
245229
- }
245230
- return false;
245231
- };
245232
- }
245233
- return () => false;
245234
- }
245235
- function normalizePath(path18) {
245236
- if (typeof path18 !== "string")
245237
- throw new Error("string expected");
245238
- path18 = sp3.normalize(path18);
245239
- path18 = path18.replace(/\\/g, "/");
245240
- let prepend = false;
245241
- if (path18.startsWith("//"))
245242
- prepend = true;
245243
- path18 = path18.replace(DOUBLE_SLASH_RE, "/");
245244
- if (prepend)
245245
- path18 = "/" + path18;
245246
- return path18;
245247
- }
245248
- function matchPatterns(patterns, testString, stats) {
245249
- const path18 = normalizePath(testString);
245250
- for (let index = 0;index < patterns.length; index++) {
245251
- const pattern = patterns[index];
245252
- if (pattern(path18, stats)) {
245253
- return true;
245254
- }
245255
- }
245256
- return false;
245257
- }
245258
- function anymatch(matchers, testString) {
245259
- if (matchers == null) {
245260
- throw new TypeError("anymatch: specify first argument");
245261
- }
245262
- const matchersArray = arrify(matchers);
245263
- const patterns = matchersArray.map((matcher) => createPattern(matcher));
245264
- if (testString == null) {
245265
- return (testString2, stats) => {
245266
- return matchPatterns(patterns, testString2, stats);
245267
- };
245268
- }
245269
- return matchPatterns(patterns, testString);
245270
- }
245271
- var unifyPaths = (paths_) => {
245272
- const paths = arrify(paths_).flat();
245273
- if (!paths.every((p4) => typeof p4 === STRING_TYPE)) {
245274
- throw new TypeError(`Non-string provided as watch path: ${paths}`);
245275
- }
245276
- return paths.map(normalizePathToUnix);
245277
- };
245278
- var toUnix = (string4) => {
245279
- let str = string4.replace(BACK_SLASH_RE, SLASH);
245280
- let prepend = false;
245281
- if (str.startsWith(SLASH_SLASH)) {
245282
- prepend = true;
245283
- }
245284
- str = str.replace(DOUBLE_SLASH_RE, SLASH);
245285
- if (prepend) {
245286
- str = SLASH + str;
245287
- }
245288
- return str;
245289
- };
245290
- var normalizePathToUnix = (path18) => toUnix(sp3.normalize(toUnix(path18)));
245291
- var normalizeIgnored = (cwd = "") => (path18) => {
245292
- if (typeof path18 === "string") {
245293
- return normalizePathToUnix(sp3.isAbsolute(path18) ? path18 : sp3.join(cwd, path18));
245294
- } else {
245295
- return path18;
245296
- }
245297
- };
245298
- var getAbsolutePath = (path18, cwd) => {
245299
- if (sp3.isAbsolute(path18)) {
245300
- return path18;
245301
- }
245302
- return sp3.join(cwd, path18);
245303
- };
245304
- var EMPTY_SET = Object.freeze(new Set);
245305
-
245306
- class DirEntry {
245307
- path;
245308
- _removeWatcher;
245309
- items;
245310
- constructor(dir, removeWatcher) {
245311
- this.path = dir;
245312
- this._removeWatcher = removeWatcher;
245313
- this.items = new Set;
245314
- }
245315
- add(item) {
245316
- const { items } = this;
245317
- if (!items)
245318
- return;
245319
- if (item !== ONE_DOT && item !== TWO_DOTS)
245320
- items.add(item);
245321
- }
245322
- async remove(item) {
245323
- const { items } = this;
245324
- if (!items)
245325
- return;
245326
- items.delete(item);
245327
- if (items.size > 0)
245328
- return;
245329
- const dir = this.path;
245330
- try {
245331
- await readdir3(dir);
245332
- } catch (err) {
245333
- if (this._removeWatcher) {
245334
- this._removeWatcher(sp3.dirname(dir), sp3.basename(dir));
245335
- }
245336
- }
245337
- }
245338
- has(item) {
245339
- const { items } = this;
245340
- if (!items)
245341
- return;
245342
- return items.has(item);
245343
- }
245344
- getChildren() {
245345
- const { items } = this;
245346
- if (!items)
245347
- return [];
245348
- return [...items.values()];
245349
- }
245350
- dispose() {
245351
- this.items.clear();
245352
- this.path = "";
245353
- this._removeWatcher = EMPTY_FN;
245354
- this.items = EMPTY_SET;
245355
- Object.freeze(this);
245356
- }
245357
- }
245358
- var STAT_METHOD_F = "stat";
245359
- var STAT_METHOD_L = "lstat";
245360
-
245361
- class WatchHelper {
245362
- fsw;
245363
- path;
245364
- watchPath;
245365
- fullWatchPath;
245366
- dirParts;
245367
- followSymlinks;
245368
- statMethod;
245369
- constructor(path18, follow, fsw) {
245370
- this.fsw = fsw;
245371
- const watchPath = path18;
245372
- this.path = path18 = path18.replace(REPLACER_RE, "");
245373
- this.watchPath = watchPath;
245374
- this.fullWatchPath = sp3.resolve(watchPath);
245375
- this.dirParts = [];
245376
- this.dirParts.forEach((parts) => {
245377
- if (parts.length > 1)
245378
- parts.pop();
245379
- });
245380
- this.followSymlinks = follow;
245381
- this.statMethod = follow ? STAT_METHOD_F : STAT_METHOD_L;
245382
- }
245383
- entryPath(entry) {
245384
- return sp3.join(this.watchPath, sp3.relative(this.watchPath, entry.fullPath));
245385
- }
245386
- filterPath(entry) {
245387
- const { stats } = entry;
245388
- if (stats && stats.isSymbolicLink())
245389
- return this.filterDir(entry);
245390
- const resolvedPath = this.entryPath(entry);
245391
- return this.fsw._isntIgnored(resolvedPath, stats) && this.fsw._hasReadPermissions(stats);
245392
- }
245393
- filterDir(entry) {
245394
- return this.fsw._isntIgnored(this.entryPath(entry), entry.stats);
245395
- }
245396
- }
245397
-
245398
- class FSWatcher extends EventEmitter3 {
245399
- closed;
245400
- options;
245401
- _closers;
245402
- _ignoredPaths;
245403
- _throttled;
245404
- _streams;
245405
- _symlinkPaths;
245406
- _watched;
245407
- _pendingWrites;
245408
- _pendingUnlinks;
245409
- _readyCount;
245410
- _emitReady;
245411
- _closePromise;
245412
- _userIgnored;
245413
- _readyEmitted;
245414
- _emitRaw;
245415
- _boundRemove;
245416
- _nodeFsHandler;
245417
- constructor(_opts = {}) {
245418
- super();
245419
- this.closed = false;
245420
- this._closers = new Map;
245421
- this._ignoredPaths = new Set;
245422
- this._throttled = new Map;
245423
- this._streams = new Set;
245424
- this._symlinkPaths = new Map;
245425
- this._watched = new Map;
245426
- this._pendingWrites = new Map;
245427
- this._pendingUnlinks = new Map;
245428
- this._readyCount = 0;
245429
- this._readyEmitted = false;
245430
- const awf = _opts.awaitWriteFinish;
245431
- const DEF_AWF = { stabilityThreshold: 2000, pollInterval: 100 };
245432
- const opts = {
245433
- persistent: true,
245434
- ignoreInitial: false,
245435
- ignorePermissionErrors: false,
245436
- interval: 100,
245437
- binaryInterval: 300,
245438
- followSymlinks: true,
245439
- usePolling: false,
245440
- atomic: true,
245441
- ..._opts,
245442
- ignored: _opts.ignored ? arrify(_opts.ignored) : arrify([]),
245443
- awaitWriteFinish: awf === true ? DEF_AWF : typeof awf === "object" ? { ...DEF_AWF, ...awf } : false
245444
- };
245445
- if (isIBMi)
245446
- opts.usePolling = true;
245447
- if (opts.atomic === undefined)
245448
- opts.atomic = !opts.usePolling;
245449
- const envPoll = process.env.CHOKIDAR_USEPOLLING;
245450
- if (envPoll !== undefined) {
245451
- const envLower = envPoll.toLowerCase();
245452
- if (envLower === "false" || envLower === "0")
245453
- opts.usePolling = false;
245454
- else if (envLower === "true" || envLower === "1")
245455
- opts.usePolling = true;
245456
- else
245457
- opts.usePolling = !!envLower;
245458
- }
245459
- const envInterval = process.env.CHOKIDAR_INTERVAL;
245460
- if (envInterval)
245461
- opts.interval = Number.parseInt(envInterval, 10);
245462
- let readyCalls = 0;
245463
- this._emitReady = () => {
245464
- readyCalls++;
245465
- if (readyCalls >= this._readyCount) {
245466
- this._emitReady = EMPTY_FN;
245467
- this._readyEmitted = true;
245468
- process.nextTick(() => this.emit(EVENTS.READY));
245469
- }
245470
- };
245471
- this._emitRaw = (...args) => this.emit(EVENTS.RAW, ...args);
245472
- this._boundRemove = this._remove.bind(this);
245473
- this.options = opts;
245474
- this._nodeFsHandler = new NodeFsHandler(this);
245475
- Object.freeze(opts);
245476
- }
245477
- _addIgnoredPath(matcher) {
245478
- if (isMatcherObject(matcher)) {
245479
- for (const ignored of this._ignoredPaths) {
245480
- if (isMatcherObject(ignored) && ignored.path === matcher.path && ignored.recursive === matcher.recursive) {
245481
- return;
245482
- }
245483
- }
245484
- }
245485
- this._ignoredPaths.add(matcher);
245486
- }
245487
- _removeIgnoredPath(matcher) {
245488
- this._ignoredPaths.delete(matcher);
245489
- if (typeof matcher === "string") {
245490
- for (const ignored of this._ignoredPaths) {
245491
- if (isMatcherObject(ignored) && ignored.path === matcher) {
245492
- this._ignoredPaths.delete(ignored);
245493
- }
245494
- }
245495
- }
245496
- }
245497
- add(paths_, _origAdd, _internal) {
245498
- const { cwd } = this.options;
245499
- this.closed = false;
245500
- this._closePromise = undefined;
245501
- let paths = unifyPaths(paths_);
245502
- if (cwd) {
245503
- paths = paths.map((path18) => {
245504
- const absPath = getAbsolutePath(path18, cwd);
245505
- return absPath;
245506
- });
245507
- }
245508
- paths.forEach((path18) => {
245509
- this._removeIgnoredPath(path18);
245510
- });
245511
- this._userIgnored = undefined;
245512
- if (!this._readyCount)
245513
- this._readyCount = 0;
245514
- this._readyCount += paths.length;
245515
- Promise.all(paths.map(async (path18) => {
245516
- const res = await this._nodeFsHandler._addToNodeFs(path18, !_internal, undefined, 0, _origAdd);
245517
- if (res)
245518
- this._emitReady();
245519
- return res;
245520
- })).then((results) => {
245521
- if (this.closed)
245522
- return;
245523
- results.forEach((item) => {
245524
- if (item)
245525
- this.add(sp3.dirname(item), sp3.basename(_origAdd || item));
245526
- });
245527
- });
245528
- return this;
245529
- }
245530
- unwatch(paths_) {
245531
- if (this.closed)
245532
- return this;
245533
- const paths = unifyPaths(paths_);
245534
- const { cwd } = this.options;
245535
- paths.forEach((path18) => {
245536
- if (!sp3.isAbsolute(path18) && !this._closers.has(path18)) {
245537
- if (cwd)
245538
- path18 = sp3.join(cwd, path18);
245539
- path18 = sp3.resolve(path18);
245540
- }
245541
- this._closePath(path18);
245542
- this._addIgnoredPath(path18);
245543
- if (this._watched.has(path18)) {
245544
- this._addIgnoredPath({
245545
- path: path18,
245546
- recursive: true
245547
- });
245548
- }
245549
- this._userIgnored = undefined;
245550
- });
245551
- return this;
245552
- }
245553
- close() {
245554
- if (this._closePromise) {
245555
- return this._closePromise;
245556
- }
245557
- this.closed = true;
245558
- this.removeAllListeners();
245559
- const closers = [];
245560
- this._closers.forEach((closerList) => closerList.forEach((closer) => {
245561
- const promise2 = closer();
245562
- if (promise2 instanceof Promise)
245563
- closers.push(promise2);
245564
- }));
245565
- this._streams.forEach((stream) => stream.destroy());
245566
- this._userIgnored = undefined;
245567
- this._readyCount = 0;
245568
- this._readyEmitted = false;
245569
- this._watched.forEach((dirent) => dirent.dispose());
245570
- this._closers.clear();
245571
- this._watched.clear();
245572
- this._streams.clear();
245573
- this._symlinkPaths.clear();
245574
- this._throttled.clear();
245575
- this._closePromise = closers.length ? Promise.all(closers).then(() => {
245576
- return;
245577
- }) : Promise.resolve();
245578
- return this._closePromise;
245579
- }
245580
- getWatched() {
245581
- const watchList = {};
245582
- this._watched.forEach((entry, dir) => {
245583
- const key2 = this.options.cwd ? sp3.relative(this.options.cwd, dir) : dir;
245584
- const index = key2 || ONE_DOT;
245585
- watchList[index] = entry.getChildren().sort();
245586
- });
245587
- return watchList;
245588
- }
245589
- emitWithAll(event, args) {
245590
- this.emit(event, ...args);
245591
- if (event !== EVENTS.ERROR)
245592
- this.emit(EVENTS.ALL, event, ...args);
245593
- }
245594
- async _emit(event, path18, stats) {
245595
- if (this.closed)
245596
- return;
245597
- const opts = this.options;
245598
- if (isWindows4)
245599
- path18 = sp3.normalize(path18);
245600
- if (opts.cwd)
245601
- path18 = sp3.relative(opts.cwd, path18);
245602
- const args = [path18];
245603
- if (stats != null)
245604
- args.push(stats);
245605
- const awf = opts.awaitWriteFinish;
245606
- let pw;
245607
- if (awf && (pw = this._pendingWrites.get(path18))) {
245608
- pw.lastChange = new Date;
245609
- return this;
245610
- }
245611
- if (opts.atomic) {
245612
- if (event === EVENTS.UNLINK) {
245613
- this._pendingUnlinks.set(path18, [event, ...args]);
245614
- setTimeout(() => {
245615
- this._pendingUnlinks.forEach((entry, path19) => {
245616
- this.emit(...entry);
245617
- this.emit(EVENTS.ALL, ...entry);
245618
- this._pendingUnlinks.delete(path19);
245619
- });
245620
- }, typeof opts.atomic === "number" ? opts.atomic : 100);
245621
- return this;
245622
- }
245623
- if (event === EVENTS.ADD && this._pendingUnlinks.has(path18)) {
245624
- event = EVENTS.CHANGE;
245625
- this._pendingUnlinks.delete(path18);
245626
- }
245627
- }
245628
- if (awf && (event === EVENTS.ADD || event === EVENTS.CHANGE) && this._readyEmitted) {
245629
- const awfEmit = (err, stats2) => {
245630
- if (err) {
245631
- event = EVENTS.ERROR;
245632
- args[0] = err;
245633
- this.emitWithAll(event, args);
245634
- } else if (stats2) {
245635
- if (args.length > 1) {
245636
- args[1] = stats2;
245637
- } else {
245638
- args.push(stats2);
245639
- }
245640
- this.emitWithAll(event, args);
245641
- }
245642
- };
245643
- this._awaitWriteFinish(path18, awf.stabilityThreshold, event, awfEmit);
245644
- return this;
245645
- }
245646
- if (event === EVENTS.CHANGE) {
245647
- const isThrottled = !this._throttle(EVENTS.CHANGE, path18, 50);
245648
- if (isThrottled)
245649
- return this;
245650
- }
245651
- if (opts.alwaysStat && stats === undefined && (event === EVENTS.ADD || event === EVENTS.ADD_DIR || event === EVENTS.CHANGE)) {
245652
- const fullPath = opts.cwd ? sp3.join(opts.cwd, path18) : path18;
245653
- let stats2;
245654
- try {
245655
- stats2 = await stat4(fullPath);
245656
- } catch (err) {}
245657
- if (!stats2 || this.closed)
245658
- return;
245659
- args.push(stats2);
245660
- }
245661
- this.emitWithAll(event, args);
245662
- return this;
245663
- }
245664
- _handleError(error48) {
245665
- const code2 = error48 && error48.code;
245666
- if (error48 && code2 !== "ENOENT" && code2 !== "ENOTDIR" && (!this.options.ignorePermissionErrors || code2 !== "EPERM" && code2 !== "EACCES")) {
245667
- this.emit(EVENTS.ERROR, error48);
245668
- }
245669
- return error48 || this.closed;
245670
- }
245671
- _throttle(actionType, path18, timeout3) {
245672
- if (!this._throttled.has(actionType)) {
245673
- this._throttled.set(actionType, new Map);
245674
- }
245675
- const action = this._throttled.get(actionType);
245676
- if (!action)
245677
- throw new Error("invalid throttle");
245678
- const actionPath = action.get(path18);
245679
- if (actionPath) {
245680
- actionPath.count++;
245681
- return false;
245682
- }
245683
- let timeoutObject;
245684
- const clear = () => {
245685
- const item = action.get(path18);
245686
- const count2 = item ? item.count : 0;
245687
- action.delete(path18);
245688
- clearTimeout(timeoutObject);
245689
- if (item)
245690
- clearTimeout(item.timeoutObject);
245691
- return count2;
245692
- };
245693
- timeoutObject = setTimeout(clear, timeout3);
245694
- const thr = { timeoutObject, clear, count: 0 };
245695
- action.set(path18, thr);
245696
- return thr;
245697
- }
245698
- _incrReadyCount() {
245699
- return this._readyCount++;
245700
- }
245701
- _awaitWriteFinish(path18, threshold, event, awfEmit) {
245702
- const awf = this.options.awaitWriteFinish;
245703
- if (typeof awf !== "object")
245704
- return;
245705
- const pollInterval = awf.pollInterval;
245706
- let timeoutHandler;
245707
- let fullPath = path18;
245708
- if (this.options.cwd && !sp3.isAbsolute(path18)) {
245709
- fullPath = sp3.join(this.options.cwd, path18);
245710
- }
245711
- const now = new Date;
245712
- const writes = this._pendingWrites;
245713
- function awaitWriteFinishFn(prevStat) {
245714
- statcb(fullPath, (err, curStat) => {
245715
- if (err || !writes.has(path18)) {
245716
- if (err && err.code !== "ENOENT")
245717
- awfEmit(err);
245718
- return;
245719
- }
245720
- const now2 = Number(new Date);
245721
- if (prevStat && curStat.size !== prevStat.size) {
245722
- writes.get(path18).lastChange = now2;
245723
- }
245724
- const pw = writes.get(path18);
245725
- const df3 = now2 - pw.lastChange;
245726
- if (df3 >= threshold) {
245727
- writes.delete(path18);
245728
- awfEmit(undefined, curStat);
245729
- } else {
245730
- timeoutHandler = setTimeout(awaitWriteFinishFn, pollInterval, curStat);
245731
- }
245732
- });
245733
- }
245734
- if (!writes.has(path18)) {
245735
- writes.set(path18, {
245736
- lastChange: now,
245737
- cancelWait: () => {
245738
- writes.delete(path18);
245739
- clearTimeout(timeoutHandler);
245740
- return event;
245741
- }
245742
- });
245743
- timeoutHandler = setTimeout(awaitWriteFinishFn, pollInterval);
245744
- }
245745
- }
245746
- _isIgnored(path18, stats) {
245747
- if (this.options.atomic && DOT_RE.test(path18))
245748
- return true;
245749
- if (!this._userIgnored) {
245750
- const { cwd } = this.options;
245751
- const ign = this.options.ignored;
245752
- const ignored = (ign || []).map(normalizeIgnored(cwd));
245753
- const ignoredPaths = [...this._ignoredPaths];
245754
- const list3 = [...ignoredPaths.map(normalizeIgnored(cwd)), ...ignored];
245755
- this._userIgnored = anymatch(list3, undefined);
245756
- }
245757
- return this._userIgnored(path18, stats);
245758
- }
245759
- _isntIgnored(path18, stat5) {
245760
- return !this._isIgnored(path18, stat5);
245761
- }
245762
- _getWatchHelpers(path18) {
245763
- return new WatchHelper(path18, this.options.followSymlinks, this);
245764
- }
245765
- _getWatchedDir(directory) {
245766
- const dir = sp3.resolve(directory);
245767
- if (!this._watched.has(dir))
245768
- this._watched.set(dir, new DirEntry(dir, this._boundRemove));
245769
- return this._watched.get(dir);
245770
- }
245771
- _hasReadPermissions(stats) {
245772
- if (this.options.ignorePermissionErrors)
245773
- return true;
245774
- return Boolean(Number(stats.mode) & 256);
245775
- }
245776
- _remove(directory, item, isDirectory3) {
245777
- const path18 = sp3.join(directory, item);
245778
- const fullPath = sp3.resolve(path18);
245779
- isDirectory3 = isDirectory3 != null ? isDirectory3 : this._watched.has(path18) || this._watched.has(fullPath);
245780
- if (!this._throttle("remove", path18, 100))
245781
- return;
245782
- if (!isDirectory3 && this._watched.size === 1) {
245783
- this.add(directory, item, true);
245784
- }
245785
- const wp5 = this._getWatchedDir(path18);
245786
- const nestedDirectoryChildren = wp5.getChildren();
245787
- nestedDirectoryChildren.forEach((nested) => this._remove(path18, nested));
245788
- const parent = this._getWatchedDir(directory);
245789
- const wasTracked = parent.has(item);
245790
- parent.remove(item);
245791
- if (this._symlinkPaths.has(fullPath)) {
245792
- this._symlinkPaths.delete(fullPath);
245793
- }
245794
- let relPath = path18;
245795
- if (this.options.cwd)
245796
- relPath = sp3.relative(this.options.cwd, path18);
245797
- if (this.options.awaitWriteFinish && this._pendingWrites.has(relPath)) {
245798
- const event = this._pendingWrites.get(relPath).cancelWait();
245799
- if (event === EVENTS.ADD)
245800
- return;
245801
- }
245802
- this._watched.delete(path18);
245803
- this._watched.delete(fullPath);
245804
- const eventName = isDirectory3 ? EVENTS.UNLINK_DIR : EVENTS.UNLINK;
245805
- if (wasTracked && !this._isIgnored(path18))
245806
- this._emit(eventName, path18);
245807
- this._closePath(path18);
245808
- }
245809
- _closePath(path18) {
245810
- this._closeFile(path18);
245811
- const dir = sp3.dirname(path18);
245812
- this._getWatchedDir(dir).remove(sp3.basename(path18));
245813
- }
245814
- _closeFile(path18) {
245815
- const closers = this._closers.get(path18);
245816
- if (!closers)
245817
- return;
245818
- closers.forEach((closer) => closer());
245819
- this._closers.delete(path18);
245820
- }
245821
- _addPathCloser(path18, closer) {
245822
- if (!closer)
245823
- return;
245824
- let list3 = this._closers.get(path18);
245825
- if (!list3) {
245826
- list3 = [];
245827
- this._closers.set(path18, list3);
245828
- }
245829
- list3.push(closer);
245830
- }
245831
- _readdirp(root2, opts) {
245832
- if (this.closed)
245833
- return;
245834
- const options8 = { type: EVENTS.ALL, alwaysStat: true, lstat: true, ...opts, depth: 0 };
245835
- let stream = readdirp(root2, options8);
245836
- this._streams.add(stream);
245837
- stream.once(STR_CLOSE, () => {
245838
- stream = undefined;
245839
- });
245840
- stream.once(STR_END, () => {
245841
- if (stream) {
245842
- this._streams.delete(stream);
245843
- stream = undefined;
245844
- }
245845
- });
245846
- return stream;
245847
- }
245848
- }
245849
- function watch(paths, options8 = {}) {
245850
- const watcher = new FSWatcher(options8);
245851
- watcher.add(paths);
245852
- return watcher;
245853
- }
245854
-
245855
- // src/cli/dev/dev-server/dir-watcher.ts
245856
- var import_debounce = __toESM(require_debounce(), 1);
245857
- var WATCH_DEBOUNCE_MS = 300;
245858
-
245859
- class WatchBase44Directory {
245860
- configDir;
245861
- onChange;
245862
- logger;
245863
- watcher = null;
245864
- constructor(configDir, onChange, logger) {
245865
- this.configDir = configDir;
245866
- this.onChange = onChange;
245867
- this.logger = logger;
245868
- }
245869
- async start() {
245870
- if (this.watcher) {
245871
- return;
245872
- }
245873
- if (await pathExists(this.configDir)) {
245874
- this.watchTarget();
245875
- }
245876
- }
245877
- async close() {
245878
- await this.watcher?.close();
245879
- this.watcher = null;
245880
- }
245881
- getSubfolder(path18) {
245882
- const rel = relative4(this.configDir, path18);
245883
- if (!rel || rel === ".")
245884
- return;
245885
- return rel.split(sep)[0];
245886
- }
245887
- watchTarget() {
245888
- const handler = import_debounce.default(async (_event, path18) => {
245889
- const subfolder = this.getSubfolder(path18);
245890
- await this.onChange(subfolder);
245891
- }, WATCH_DEBOUNCE_MS);
245892
- this.watcher = watch(this.configDir, {
245893
- ignoreInitial: true,
245894
- ignored: (filePath) => {
245895
- if (this.configDir === filePath) {
245896
- return false;
245897
- }
245898
- const subfolder = this.getSubfolder(filePath);
245899
- return subfolder !== "functions";
245900
- }
245901
- });
245902
- this.watcher.on("all", handler);
245903
- this.watcher.on("error", (err) => {
245904
- this.logger.error(`[dev-server] Watch handler failed for ${this.configDir}`, err instanceof Error ? err : undefined);
245905
- });
245906
- }
245907
- }
245908
-
245909
243918
  // node_modules/socket.io/wrapper.mjs
245910
243919
  var import_dist = __toESM(require_dist4(), 1);
245911
243920
  var { Server, Namespace, Socket } = import_dist.default;
@@ -246264,7 +244273,7 @@ async function createDevServer(options8) {
246264
244273
  const { port: userPort } = options8;
246265
244274
  const port = userPort ?? await getPorts({ port: DEFAULT_PORT });
246266
244275
  const baseUrl = `http://localhost:${port}`;
246267
- const { functions, entities, project: project2 } = await options8.loadResources();
244276
+ const { functions, entities } = await options8.loadResources();
246268
244277
  const app = import_express4.default();
246269
244278
  const remoteProxy = import_http_proxy_middleware2.createProxyMiddleware({
246270
244279
  target: BASE44_APP_URL,
@@ -246284,10 +244293,10 @@ async function createDevServer(options8) {
246284
244293
  });
246285
244294
  const devLogger = createDevLogger();
246286
244295
  const functionManager = new FunctionManager(functions, devLogger);
246287
- const functionRoutes = createFunctionRouter(functionManager, devLogger);
246288
- app.use("/api/apps/:appId/functions", functionRoutes);
246289
244296
  if (functionManager.getFunctionNames().length > 0) {
246290
244297
  R2.info(`Loaded functions: ${functionManager.getFunctionNames().join(", ")}`);
244298
+ const functionRoutes = createFunctionRouter(functionManager, devLogger);
244299
+ app.use("/api/apps/:appId/functions", functionRoutes);
246291
244300
  }
246292
244301
  const db2 = new Database(entities);
246293
244302
  if (db2.getCollectionNames().length > 0) {
@@ -246306,8 +244315,8 @@ async function createDevServer(options8) {
246306
244315
  devLogger.warn(`"${req.originalUrl}" is not supported in local development, passing call to production`);
246307
244316
  remoteProxy(req, res, next);
246308
244317
  });
246309
- const server = await new Promise((resolve8, reject) => {
246310
- const s5 = app.listen(port, "127.0.0.1", (err) => {
244318
+ return new Promise((resolve6, reject) => {
244319
+ const server = app.listen(port, "127.0.0.1", (err) => {
246311
244320
  if (err) {
246312
244321
  if ("code" in err && err.code === "EADDRINUSE") {
246313
244322
  reject(new Error(`Port ${port} is already in use. Stop the other process and try again.`));
@@ -246315,38 +244324,24 @@ async function createDevServer(options8) {
246315
244324
  reject(err);
246316
244325
  }
246317
244326
  } else {
246318
- resolve8(s5);
244327
+ const io6 = createRealtimeServer(server);
244328
+ emitEntityEvent = (appId, entityName, event) => {
244329
+ broadcastEntityEvent(io6, appId, entityName, event);
244330
+ };
244331
+ const shutdown = () => {
244332
+ io6.close();
244333
+ functionManager.stopAll();
244334
+ server.close();
244335
+ };
244336
+ process.on("SIGINT", shutdown);
244337
+ process.on("SIGTERM", shutdown);
244338
+ resolve6({
244339
+ port,
244340
+ server
244341
+ });
246319
244342
  }
246320
244343
  });
246321
244344
  });
246322
- const io6 = createRealtimeServer(server);
246323
- emitEntityEvent = (appId, entityName, event) => {
246324
- broadcastEntityEvent(io6, appId, entityName, event);
246325
- };
246326
- const configDir = dirname14(project2.configPath);
246327
- const base44ConfigWatcher = new WatchBase44Directory(configDir, async (subfolder) => {
246328
- if (subfolder === "functions") {
246329
- const { functions: functions2 } = await options8.loadResources();
246330
- const previousFunctionCount = functionManager.getFunctionNames().length;
246331
- functionManager.reload(functions2);
246332
- const names = functionManager.getFunctionNames();
246333
- if (names.length > 0) {
246334
- devLogger.log(`Reloaded functions: ${names.sort().join(", ")}`);
246335
- } else if (previousFunctionCount > 0) {
246336
- devLogger.log("All functions removed");
246337
- }
246338
- }
246339
- }, devLogger);
246340
- await base44ConfigWatcher.start();
246341
- const shutdown = () => {
246342
- base44ConfigWatcher.close();
246343
- io6.close();
246344
- functionManager.stopAll();
246345
- server.close();
246346
- };
246347
- process.on("SIGINT", shutdown);
246348
- process.on("SIGTERM", shutdown);
246349
- return { port, server };
246350
244345
  }
246351
244346
 
246352
244347
  // src/cli/commands/dev.ts
@@ -246370,8 +244365,8 @@ function getDevCommand(context) {
246370
244365
  }
246371
244366
 
246372
244367
  // src/cli/commands/project/eject.ts
246373
- import { resolve as resolve8 } from "node:path";
246374
- var import_kebabCase2 = __toESM(require_kebabCase(), 1);
244368
+ import { resolve as resolve6 } from "node:path";
244369
+ var import_lodash2 = __toESM(require_lodash(), 1);
246375
244370
  async function eject(options8) {
246376
244371
  const projects = await listProjects();
246377
244372
  const ejectableProjects = projects.filter((p4) => p4.isManagedSourceCode !== false);
@@ -246409,7 +244404,7 @@ async function eject(options8) {
246409
244404
  selectedProject = selected;
246410
244405
  }
246411
244406
  const projectId = selectedProject.id;
246412
- const suggestedPath = await isDirEmpty() ? `./` : `./${import_kebabCase2.default(selectedProject.name)}`;
244407
+ const suggestedPath = await isDirEmpty() ? `./` : `./${import_lodash2.default(selectedProject.name)}`;
246413
244408
  const selectedPath = options8.path ?? await Ze({
246414
244409
  message: "Where should we create your project?",
246415
244410
  placeholder: suggestedPath,
@@ -246419,7 +244414,7 @@ async function eject(options8) {
246419
244414
  Ne("Operation cancelled.");
246420
244415
  throw new CLIExitError(0);
246421
244416
  }
246422
- const resolvedPath = resolve8(selectedPath);
244417
+ const resolvedPath = resolve6(selectedPath);
246423
244418
  await runTask("Downloading your project's code...", async (updateMessage) => {
246424
244419
  await createProjectFilesForExistingProject({
246425
244420
  projectId,
@@ -246495,7 +244490,7 @@ var import_detect_agent = __toESM(require_dist5(), 1);
246495
244490
  import { release, type } from "node:os";
246496
244491
 
246497
244492
  // node_modules/posthog-node/dist/extensions/error-tracking/modifiers/module.node.mjs
246498
- import { dirname as dirname15, posix, sep as sep2 } from "path";
244493
+ import { dirname as dirname12, posix, sep } from "path";
246499
244494
  function createModulerModifier() {
246500
244495
  const getModuleFromFileName = createGetModuleFromFilename();
246501
244496
  return async (frames) => {
@@ -246504,12 +244499,12 @@ function createModulerModifier() {
246504
244499
  return frames;
246505
244500
  };
246506
244501
  }
246507
- function createGetModuleFromFilename(basePath = process.argv[1] ? dirname15(process.argv[1]) : process.cwd(), isWindows5 = sep2 === "\\") {
246508
- const normalizedBase = isWindows5 ? normalizeWindowsPath2(basePath) : basePath;
244502
+ function createGetModuleFromFilename(basePath = process.argv[1] ? dirname12(process.argv[1]) : process.cwd(), isWindows4 = sep === "\\") {
244503
+ const normalizedBase = isWindows4 ? normalizeWindowsPath2(basePath) : basePath;
246509
244504
  return (filename) => {
246510
244505
  if (!filename)
246511
244506
  return;
246512
- const normalizedFilename = isWindows5 ? normalizeWindowsPath2(filename) : filename;
244507
+ const normalizedFilename = isWindows4 ? normalizeWindowsPath2(filename) : filename;
246513
244508
  let { dir, base: file2, ext } = posix.parse(normalizedFilename);
246514
244509
  if (ext === ".js" || ext === ".mjs" || ext === ".cjs")
246515
244510
  file2 = file2.slice(0, -1 * ext.length);
@@ -248782,14 +246777,14 @@ async function addSourceContext(frames) {
248782
246777
  return frames;
248783
246778
  }
248784
246779
  function getContextLinesFromFile(path19, ranges, output) {
248785
- return new Promise((resolve9) => {
246780
+ return new Promise((resolve7) => {
248786
246781
  const stream = createReadStream2(path19);
248787
246782
  const lineReaded = createInterface2({
248788
246783
  input: stream
248789
246784
  });
248790
246785
  function destroyStreamAndResolve() {
248791
246786
  stream.destroy();
248792
- resolve9();
246787
+ resolve7();
248793
246788
  }
248794
246789
  let lineNumber = 0;
248795
246790
  let currentRangeIndex = 0;
@@ -249901,15 +247896,15 @@ class PostHogBackendClient extends PostHogCoreStateless {
249901
247896
  return true;
249902
247897
  if (this.featureFlagsPoller === undefined)
249903
247898
  return false;
249904
- return new Promise((resolve9) => {
247899
+ return new Promise((resolve7) => {
249905
247900
  const timeout3 = setTimeout(() => {
249906
247901
  cleanup();
249907
- resolve9(false);
247902
+ resolve7(false);
249908
247903
  }, timeoutMs);
249909
247904
  const cleanup = this._events.on("localEvaluationFlagsLoaded", (count2) => {
249910
247905
  clearTimeout(timeout3);
249911
247906
  cleanup();
249912
- resolve9(count2 > 0);
247907
+ resolve7(count2 > 0);
249913
247908
  });
249914
247909
  });
249915
247910
  }
@@ -250722,4 +248717,4 @@ export {
250722
248717
  CLIExitError
250723
248718
  };
250724
248719
 
250725
- //# debugId=0FDE3E45A7228AE164756E2164756E21
248720
+ //# debugId=8F6EC7A541FD9CD264756E2164756E21