@base44-preview/cli 0.0.36-pr.355.fd88cd2 → 0.0.37-pr.246.26b1479

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
@@ -9314,10 +9314,10 @@ var require_ejs = __commonJS((exports) => {
9314
9314
  };
9315
9315
  if (opts.filename && typeof Object.defineProperty === "function") {
9316
9316
  var filename = opts.filename;
9317
- var basename3 = path11.basename(filename, path11.extname(filename));
9317
+ var basename4 = path11.basename(filename, path11.extname(filename));
9318
9318
  try {
9319
9319
  Object.defineProperty(returnedFn, "name", {
9320
- value: basename3,
9320
+ value: basename4,
9321
9321
  writable: false,
9322
9322
  enumerable: false,
9323
9323
  configurable: true
@@ -13211,58 +13211,34 @@ var require_cross_spawn = __commonJS((exports, module) => {
13211
13211
  module.exports._enoent = enoent;
13212
13212
  });
13213
13213
 
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 ]/;
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();
13266
13242
  var deburredLetters = {
13267
13243
  "À": "A",
13268
13244
  "Á": "A",
@@ -13453,72 +13429,256 @@ var require_lodash = __commonJS((exports, module) => {
13453
13429
  "Œ": "Oe",
13454
13430
  "œ": "oe",
13455
13431
  "ʼn": "'n",
13456
- "ſ": "ss"
13432
+ "ſ": "s"
13457
13433
  };
13434
+ var deburrLetter = basePropertyOf(deburredLetters);
13435
+ module.exports = deburrLetter;
13436
+ });
13437
+
13438
+ // node_modules/lodash/_freeGlobal.js
13439
+ var require__freeGlobal = __commonJS((exports, module) => {
13458
13440
  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();
13459
13447
  var freeSelf = typeof self == "object" && self && self.Object === Object && self;
13460
13448
  var root = freeGlobal || freeSelf || Function("return this")();
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
- }
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);
13466
13463
  while (++index < length) {
13467
- accumulator = iteratee(accumulator, array2[index], index, array2);
13464
+ result[index] = iteratee(array2[index], index, array2);
13468
13465
  }
13469
- return accumulator;
13466
+ return result;
13470
13467
  }
13471
- function asciiWords(string4) {
13472
- return string4.match(reAsciiWord) || [];
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
+ }
13497
+ }
13498
+ return result;
13473
13499
  }
13474
- function basePropertyOf(object2) {
13475
- return function(key) {
13476
- return object2 == null ? undefined : object2[key];
13477
- };
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);
13478
13509
  }
13479
- var deburrLetter = basePropertyOf(deburredLetters);
13480
- function hasUnicodeWord(string4) {
13481
- return reHasUnicodeWord.test(string4);
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);
13482
13526
  }
13483
- function unicodeWords(string4) {
13484
- return string4.match(reUnicodeWord) || [];
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";
13485
13534
  }
13486
- var objectProto = Object.prototype;
13487
- var objectToString3 = objectProto.toString;
13488
- var Symbol2 = root.Symbol;
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;
13545
+ }
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;
13489
13556
  var symbolProto = Symbol2 ? Symbol2.prototype : undefined;
13490
13557
  var symbolToString = symbolProto ? symbolProto.toString : undefined;
13491
13558
  function baseToString(value) {
13492
13559
  if (typeof value == "string") {
13493
13560
  return value;
13494
13561
  }
13562
+ if (isArray(value)) {
13563
+ return arrayMap(value, baseToString) + "";
13564
+ }
13495
13565
  if (isSymbol(value)) {
13496
13566
  return symbolToString ? symbolToString.call(value) : "";
13497
13567
  }
13498
13568
  var result = value + "";
13499
13569
  return result == "0" && 1 / value == -INFINITY ? "-0" : result;
13500
13570
  }
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
- }
13571
+ module.exports = baseToString;
13572
+ });
13573
+
13574
+ // node_modules/lodash/toString.js
13575
+ var require_toString = __commonJS((exports, module) => {
13576
+ var baseToString = require__baseToString();
13512
13577
  function toString2(value) {
13513
13578
  return value == null ? "" : baseToString(value);
13514
13579
  }
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");
13515
13594
  function deburr(string4) {
13516
13595
  string4 = toString2(string4);
13517
13596
  return string4 && string4.replace(reLatin, deburrLetter).replace(reComboMark, "");
13518
13597
  }
13519
- var kebabCase = createCompounder(function(result, word, index) {
13520
- return result + (index ? "-" : "") + word.toLowerCase();
13521
- });
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();
13522
13682
  function words(string4, pattern, guard) {
13523
13683
  string4 = toString2(string4);
13524
13684
  pattern = guard ? undefined : pattern;
@@ -13527,6 +13687,30 @@ var require_lodash = __commonJS((exports, module) => {
13527
13687
  }
13528
13688
  return string4.match(pattern) || [];
13529
13689
  }
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
+ });
13530
13714
  module.exports = kebabCase;
13531
13715
  });
13532
13716
 
@@ -14609,7 +14793,7 @@ var require_lib2 = __commonJS((exports) => {
14609
14793
  });
14610
14794
 
14611
14795
  // node_modules/lodash/lodash.js
14612
- var require_lodash2 = __commonJS((exports, module) => {
14796
+ var require_lodash = __commonJS((exports, module) => {
14613
14797
  (function() {
14614
14798
  var undefined2;
14615
14799
  var VERSION = "4.17.23";
@@ -111977,12 +112161,12 @@ function getLanguageByFileName(languages2, file2) {
111977
112161
  if (!file2) {
111978
112162
  return;
111979
112163
  }
111980
- const basename4 = getFileBasename(file2).toLowerCase();
112164
+ const basename5 = getFileBasename(file2).toLowerCase();
111981
112165
  return languages2.find(({
111982
112166
  filenames
111983
- }) => filenames?.some((name2) => name2.toLowerCase() === basename4)) ?? languages2.find(({
112167
+ }) => filenames?.some((name2) => name2.toLowerCase() === basename5)) ?? languages2.find(({
111984
112168
  extensions
111985
- }) => extensions?.some((extension) => basename4.endsWith(extension)));
112169
+ }) => extensions?.some((extension) => basename5.endsWith(extension)));
111986
112170
  }
111987
112171
  function getLanguageByLanguageName(languages2, languageName) {
111988
112172
  if (!languageName) {
@@ -117204,8 +117388,8 @@ var init_prettier = __esm(() => {
117204
117388
  }
117205
117389
  exports.endsWithSlashGlobStar = endsWithSlashGlobStar;
117206
117390
  function isAffectDepthOfReadingPattern(pattern) {
117207
- const basename4 = path152.basename(pattern);
117208
- return endsWithSlashGlobStar(pattern) || isStaticPattern(basename4);
117391
+ const basename5 = path152.basename(pattern);
117392
+ return endsWithSlashGlobStar(pattern) || isStaticPattern(basename5);
117209
117393
  }
117210
117394
  exports.isAffectDepthOfReadingPattern = isAffectDepthOfReadingPattern;
117211
117395
  function expandPatternsWithBraceExpansion(patterns) {
@@ -127599,7 +127783,7 @@ var require_AST = __commonJS((exports) => {
127599
127783
  var require_JSONSchema = __commonJS((exports) => {
127600
127784
  Object.defineProperty(exports, "__esModule", { value: true });
127601
127785
  exports.isCompound = exports.isPrimitive = exports.isBoolean = exports.getRootSchema = exports.Intersection = exports.Types = exports.Parent = undefined;
127602
- var lodash_1 = require_lodash2();
127786
+ var lodash_1 = require_lodash();
127603
127787
  exports.Parent = Symbol("Parent");
127604
127788
  exports.Types = Symbol("Types");
127605
127789
  exports.Intersection = Symbol("Intersection");
@@ -130406,7 +130590,7 @@ var require_utils7 = __commonJS((exports) => {
130406
130590
  };
130407
130591
  Object.defineProperty(exports, "__esModule", { value: true });
130408
130592
  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;
130409
- var lodash_1 = require_lodash2();
130593
+ var lodash_1 = require_lodash();
130410
130594
  var path_1 = __require("path");
130411
130595
  var JSONSchema_1 = require_JSONSchema();
130412
130596
  var js_yaml_1 = __importDefault(require_js_yaml3());
@@ -130737,7 +130921,7 @@ ${values.join(`
130737
130921
  var require_generator = __commonJS((exports) => {
130738
130922
  Object.defineProperty(exports, "__esModule", { value: true });
130739
130923
  exports.generateType = exports.generate = undefined;
130740
- var lodash_1 = require_lodash2();
130924
+ var lodash_1 = require_lodash();
130741
130925
  var index_1 = require_src3();
130742
130926
  var AST_1 = require_AST();
130743
130927
  var utils_1 = require_utils7();
@@ -131000,7 +131184,7 @@ var require_generator = __commonJS((exports) => {
131000
131184
  var require_typesOfSchema = __commonJS((exports) => {
131001
131185
  Object.defineProperty(exports, "__esModule", { value: true });
131002
131186
  exports.typesOfSchema = undefined;
131003
- var lodash_1 = require_lodash2();
131187
+ var lodash_1 = require_lodash();
131004
131188
  var JSONSchema_1 = require_JSONSchema();
131005
131189
  function typesOfSchema(schema9) {
131006
131190
  if (schema9.tsType) {
@@ -131359,7 +131543,7 @@ var require_normalizer = __commonJS((exports) => {
131359
131543
  var require_optimizer = __commonJS((exports) => {
131360
131544
  Object.defineProperty(exports, "__esModule", { value: true });
131361
131545
  exports.optimize = undefined;
131362
- var lodash_1 = require_lodash2();
131546
+ var lodash_1 = require_lodash();
131363
131547
  var generator_1 = require_generator();
131364
131548
  var AST_1 = require_AST();
131365
131549
  var utils_1 = require_utils7();
@@ -131425,7 +131609,7 @@ var require_optimizer = __commonJS((exports) => {
131425
131609
  var require_parser = __commonJS((exports) => {
131426
131610
  Object.defineProperty(exports, "__esModule", { value: true });
131427
131611
  exports.parse = undefined;
131428
- var lodash_1 = require_lodash2();
131612
+ var lodash_1 = require_lodash();
131429
131613
  var util_1 = __require("util");
131430
131614
  var applySchemaTyping_1 = require_applySchemaTyping();
131431
131615
  var AST_1 = require_AST();
@@ -137278,7 +137462,7 @@ var require_linker = __commonJS((exports) => {
137278
137462
  Object.defineProperty(exports, "__esModule", { value: true });
137279
137463
  exports.link = undefined;
137280
137464
  var JSONSchema_1 = require_JSONSchema();
137281
- var lodash_1 = require_lodash2();
137465
+ var lodash_1 = require_lodash();
137282
137466
  function link2(schema9, parent = null) {
137283
137467
  if (!Array.isArray(schema9) && !(0, lodash_1.isPlainObject)(schema9)) {
137284
137468
  return schema9;
@@ -137346,7 +137530,7 @@ var require_src3 = __commonJS((exports) => {
137346
137530
  Object.defineProperty(exports, "__esModule", { value: true });
137347
137531
  exports.ValidationError = exports.compile = exports.compileFromFile = exports.DEFAULT_OPTIONS = undefined;
137348
137532
  var fs_1 = __require("fs");
137349
- var lodash_1 = require_lodash2();
137533
+ var lodash_1 = require_lodash();
137350
137534
  var path_1 = __require("path");
137351
137535
  var formatter_1 = require_formatter();
137352
137536
  var generator_1 = require_generator();
@@ -156089,7 +156273,7 @@ var require_view = __commonJS((exports, module) => {
156089
156273
  var path18 = __require("node:path");
156090
156274
  var fs28 = __require("node:fs");
156091
156275
  var dirname11 = path18.dirname;
156092
- var basename4 = path18.basename;
156276
+ var basename5 = path18.basename;
156093
156277
  var extname2 = path18.extname;
156094
156278
  var join15 = path18.join;
156095
156279
  var resolve6 = path18.resolve;
@@ -156128,7 +156312,7 @@ var require_view = __commonJS((exports, module) => {
156128
156312
  var root2 = roots[i5];
156129
156313
  var loc = resolve6(root2, name2);
156130
156314
  var dir = dirname11(loc);
156131
- var file2 = basename4(loc);
156315
+ var file2 = basename5(loc);
156132
156316
  path19 = this.resolve(dir, file2);
156133
156317
  }
156134
156318
  return path19;
@@ -156158,7 +156342,7 @@ var require_view = __commonJS((exports, module) => {
156158
156342
  if (stat2 && stat2.isFile()) {
156159
156343
  return path19;
156160
156344
  }
156161
- path19 = join15(dir, basename4(file2, ext), "index" + ext);
156345
+ path19 = join15(dir, basename5(file2, ext), "index" + ext);
156162
156346
  stat2 = tryStat(path19);
156163
156347
  if (stat2 && stat2.isFile()) {
156164
156348
  return path19;
@@ -159479,7 +159663,7 @@ var require_content_disposition = __commonJS((exports, module) => {
159479
159663
  */
159480
159664
  module.exports = contentDisposition;
159481
159665
  module.exports.parse = parse11;
159482
- var basename4 = __require("path").basename;
159666
+ var basename5 = __require("path").basename;
159483
159667
  var ENCODE_URL_ATTR_CHAR_REGEXP = /[\x00-\x20"'()*,/:;<=>?@[\\\]{}\x7f]/g;
159484
159668
  var HEX_ESCAPE_REGEXP = /%[0-9A-Fa-f]{2}/;
159485
159669
  var HEX_ESCAPE_REPLACE_REGEXP = /%([0-9A-Fa-f]{2})/g;
@@ -159514,9 +159698,9 @@ var require_content_disposition = __commonJS((exports, module) => {
159514
159698
  if (typeof fallback === "string" && NON_LATIN1_REGEXP.test(fallback)) {
159515
159699
  throw new TypeError("fallback must be ISO-8859-1 string");
159516
159700
  }
159517
- var name2 = basename4(filename);
159701
+ var name2 = basename5(filename);
159518
159702
  var isQuotedString = TEXT_REGEXP.test(name2);
159519
- var fallbackName = typeof fallback !== "string" ? fallback && getlatin1(name2) : basename4(fallback);
159703
+ var fallbackName = typeof fallback !== "string" ? fallback && getlatin1(name2) : basename5(fallback);
159520
159704
  var hasFallback = typeof fallbackName === "string" && fallbackName !== name2;
159521
159705
  if (hasFallback || !isQuotedString || HEX_ESCAPE_REGEXP.test(name2)) {
159522
159706
  params["filename*"] = name2;
@@ -163413,8 +163597,8 @@ var require_tmp = __commonJS((exports, module) => {
163413
163597
  const name2 = options8.name;
163414
163598
  if (path18.isAbsolute(name2))
163415
163599
  throw new Error(`name option must not contain an absolute path, found "${name2}".`);
163416
- const basename4 = path18.basename(name2);
163417
- if (basename4 === ".." || basename4 === "." || basename4 !== name2)
163600
+ const basename5 = path18.basename(name2);
163601
+ if (basename5 === ".." || basename5 === "." || basename5 !== name2)
163418
163602
  throw new Error(`name option must not contain a path, found "${name2}".`);
163419
163603
  }
163420
163604
  if (!_isUndefined(options8.template) && !options8.template.match(TEMPLATE_PATTERN)) {
@@ -202694,7 +202878,7 @@ var require_utils12 = __commonJS((exports, module) => {
202694
202878
  if (decode4)
202695
202879
  return decode4(data, hint);
202696
202880
  }
202697
- function basename4(path18) {
202881
+ function basename5(path18) {
202698
202882
  if (typeof path18 !== "string")
202699
202883
  return "";
202700
202884
  for (let i5 = path18.length - 1;i5 >= 0; --i5) {
@@ -203998,7 +204182,7 @@ var require_utils12 = __commonJS((exports, module) => {
203998
204182
  -1
203999
204183
  ];
204000
204184
  module.exports = {
204001
- basename: basename4,
204185
+ basename: basename5,
204002
204186
  convertToUTF8,
204003
204187
  getDecoder,
204004
204188
  parseContentType,
@@ -204406,7 +204590,7 @@ var require_multipart = __commonJS((exports, module) => {
204406
204590
  var { Readable: Readable6, Writable: Writable4 } = __require("stream");
204407
204591
  var StreamSearch = require_sbmh();
204408
204592
  var {
204409
- basename: basename4,
204593
+ basename: basename5,
204410
204594
  convertToUTF8,
204411
204595
  getDecoder,
204412
204596
  parseContentType,
@@ -204668,7 +204852,7 @@ var require_multipart = __commonJS((exports, module) => {
204668
204852
  else if (disp.params.filename)
204669
204853
  filename = disp.params.filename;
204670
204854
  if (filename !== undefined && !preservePath)
204671
- filename = basename4(filename);
204855
+ filename = basename5(filename);
204672
204856
  }
204673
204857
  if (header2["content-type"]) {
204674
204858
  const conType = parseContentType(header2["content-type"][0]);
@@ -210218,6 +210402,168 @@ var require_multer = __commonJS((exports, module) => {
210218
210402
  module.exports.MulterError = MulterError;
210219
210403
  });
210220
210404
 
210405
+ // node_modules/lodash/isObject.js
210406
+ var require_isObject = __commonJS((exports, module) => {
210407
+ function isObject5(value) {
210408
+ var type = typeof value;
210409
+ return value != null && (type == "object" || type == "function");
210410
+ }
210411
+ module.exports = isObject5;
210412
+ });
210413
+
210414
+ // node_modules/lodash/now.js
210415
+ var require_now = __commonJS((exports, module) => {
210416
+ var root2 = require__root();
210417
+ var now = function() {
210418
+ return root2.Date.now();
210419
+ };
210420
+ module.exports = now;
210421
+ });
210422
+
210423
+ // node_modules/lodash/_trimmedEndIndex.js
210424
+ var require__trimmedEndIndex = __commonJS((exports, module) => {
210425
+ var reWhitespace = /\s/;
210426
+ function trimmedEndIndex(string4) {
210427
+ var index = string4.length;
210428
+ while (index-- && reWhitespace.test(string4.charAt(index))) {}
210429
+ return index;
210430
+ }
210431
+ module.exports = trimmedEndIndex;
210432
+ });
210433
+
210434
+ // node_modules/lodash/_baseTrim.js
210435
+ var require__baseTrim = __commonJS((exports, module) => {
210436
+ var trimmedEndIndex = require__trimmedEndIndex();
210437
+ var reTrimStart = /^\s+/;
210438
+ function baseTrim(string4) {
210439
+ return string4 ? string4.slice(0, trimmedEndIndex(string4) + 1).replace(reTrimStart, "") : string4;
210440
+ }
210441
+ module.exports = baseTrim;
210442
+ });
210443
+
210444
+ // node_modules/lodash/toNumber.js
210445
+ var require_toNumber = __commonJS((exports, module) => {
210446
+ var baseTrim = require__baseTrim();
210447
+ var isObject5 = require_isObject();
210448
+ var isSymbol = require_isSymbol();
210449
+ var NAN = 0 / 0;
210450
+ var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
210451
+ var reIsBinary = /^0b[01]+$/i;
210452
+ var reIsOctal = /^0o[0-7]+$/i;
210453
+ var freeParseInt = parseInt;
210454
+ function toNumber(value) {
210455
+ if (typeof value == "number") {
210456
+ return value;
210457
+ }
210458
+ if (isSymbol(value)) {
210459
+ return NAN;
210460
+ }
210461
+ if (isObject5(value)) {
210462
+ var other = typeof value.valueOf == "function" ? value.valueOf() : value;
210463
+ value = isObject5(other) ? other + "" : other;
210464
+ }
210465
+ if (typeof value != "string") {
210466
+ return value === 0 ? value : +value;
210467
+ }
210468
+ value = baseTrim(value);
210469
+ var isBinary = reIsBinary.test(value);
210470
+ return isBinary || reIsOctal.test(value) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : reIsBadHex.test(value) ? NAN : +value;
210471
+ }
210472
+ module.exports = toNumber;
210473
+ });
210474
+
210475
+ // node_modules/lodash/debounce.js
210476
+ var require_debounce = __commonJS((exports, module) => {
210477
+ var isObject5 = require_isObject();
210478
+ var now = require_now();
210479
+ var toNumber = require_toNumber();
210480
+ var FUNC_ERROR_TEXT = "Expected a function";
210481
+ var nativeMax = Math.max;
210482
+ var nativeMin = Math.min;
210483
+ function debounce(func, wait, options8) {
210484
+ var lastArgs, lastThis, maxWait, result, timerId, lastCallTime, lastInvokeTime = 0, leading = false, maxing = false, trailing = true;
210485
+ if (typeof func != "function") {
210486
+ throw new TypeError(FUNC_ERROR_TEXT);
210487
+ }
210488
+ wait = toNumber(wait) || 0;
210489
+ if (isObject5(options8)) {
210490
+ leading = !!options8.leading;
210491
+ maxing = "maxWait" in options8;
210492
+ maxWait = maxing ? nativeMax(toNumber(options8.maxWait) || 0, wait) : maxWait;
210493
+ trailing = "trailing" in options8 ? !!options8.trailing : trailing;
210494
+ }
210495
+ function invokeFunc(time3) {
210496
+ var args = lastArgs, thisArg = lastThis;
210497
+ lastArgs = lastThis = undefined;
210498
+ lastInvokeTime = time3;
210499
+ result = func.apply(thisArg, args);
210500
+ return result;
210501
+ }
210502
+ function leadingEdge(time3) {
210503
+ lastInvokeTime = time3;
210504
+ timerId = setTimeout(timerExpired, wait);
210505
+ return leading ? invokeFunc(time3) : result;
210506
+ }
210507
+ function remainingWait(time3) {
210508
+ var timeSinceLastCall = time3 - lastCallTime, timeSinceLastInvoke = time3 - lastInvokeTime, timeWaiting = wait - timeSinceLastCall;
210509
+ return maxing ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke) : timeWaiting;
210510
+ }
210511
+ function shouldInvoke(time3) {
210512
+ var timeSinceLastCall = time3 - lastCallTime, timeSinceLastInvoke = time3 - lastInvokeTime;
210513
+ return lastCallTime === undefined || timeSinceLastCall >= wait || timeSinceLastCall < 0 || maxing && timeSinceLastInvoke >= maxWait;
210514
+ }
210515
+ function timerExpired() {
210516
+ var time3 = now();
210517
+ if (shouldInvoke(time3)) {
210518
+ return trailingEdge(time3);
210519
+ }
210520
+ timerId = setTimeout(timerExpired, remainingWait(time3));
210521
+ }
210522
+ function trailingEdge(time3) {
210523
+ timerId = undefined;
210524
+ if (trailing && lastArgs) {
210525
+ return invokeFunc(time3);
210526
+ }
210527
+ lastArgs = lastThis = undefined;
210528
+ return result;
210529
+ }
210530
+ function cancel() {
210531
+ if (timerId !== undefined) {
210532
+ clearTimeout(timerId);
210533
+ }
210534
+ lastInvokeTime = 0;
210535
+ lastArgs = lastCallTime = lastThis = timerId = undefined;
210536
+ }
210537
+ function flush() {
210538
+ return timerId === undefined ? result : trailingEdge(now());
210539
+ }
210540
+ function debounced() {
210541
+ var time3 = now(), isInvoking = shouldInvoke(time3);
210542
+ lastArgs = arguments;
210543
+ lastThis = this;
210544
+ lastCallTime = time3;
210545
+ if (isInvoking) {
210546
+ if (timerId === undefined) {
210547
+ return leadingEdge(lastCallTime);
210548
+ }
210549
+ if (maxing) {
210550
+ clearTimeout(timerId);
210551
+ timerId = setTimeout(timerExpired, wait);
210552
+ return invokeFunc(lastCallTime);
210553
+ }
210554
+ }
210555
+ if (timerId === undefined) {
210556
+ timerId = setTimeout(timerExpired, wait);
210557
+ }
210558
+ return result;
210559
+ }
210560
+ debounced.cancel = cancel;
210561
+ debounced.flush = flush;
210562
+ return debounced;
210563
+ }
210564
+ module.exports = debounce;
210565
+ });
210566
+
210221
210567
  // node_modules/@vercel/detect-agent/dist/index.js
210222
210568
  var require_dist5 = __commonJS((exports, module) => {
210223
210569
  var __defProp4 = Object.defineProperty;
@@ -210243,8 +210589,8 @@ var require_dist5 = __commonJS((exports, module) => {
210243
210589
  determineAgent: () => determineAgent
210244
210590
  });
210245
210591
  module.exports = __toCommonJS(src_exports);
210246
- var import_promises19 = __require("node:fs/promises");
210247
- var import_node_fs19 = __require("node:fs");
210592
+ var import_promises22 = __require("node:fs/promises");
210593
+ var import_node_fs21 = __require("node:fs");
210248
210594
  var DEVIN_LOCAL_PATH = "/opt/.devin";
210249
210595
  var CURSOR2 = "cursor";
210250
210596
  var CURSOR_CLI = "cursor-cli";
@@ -210301,7 +210647,7 @@ var require_dist5 = __commonJS((exports, module) => {
210301
210647
  return { isAgent: true, agent: { name: REPLIT } };
210302
210648
  }
210303
210649
  try {
210304
- await (0, import_promises19.access)(DEVIN_LOCAL_PATH, import_node_fs19.constants.F_OK);
210650
+ await (0, import_promises22.access)(DEVIN_LOCAL_PATH, import_node_fs21.constants.F_OK);
210305
210651
  return { isAgent: true, agent: { name: DEVIN } };
210306
210652
  } catch (error48) {}
210307
210653
  return { isAgent: false, agent: undefined };
@@ -225896,47 +226242,34 @@ function getTestOverrides() {
225896
226242
  }
225897
226243
 
225898
226244
  // src/core/clients/schemas.ts
225899
- var ApiErrorResponseSchema = exports_external.object({
225900
- error_type: exports_external.string().optional(),
225901
- message: exports_external.union([exports_external.string(), exports_external.record(exports_external.string(), exports_external.unknown())]).nullable().optional(),
225902
- detail: exports_external.union([
225903
- exports_external.string(),
225904
- exports_external.record(exports_external.string(), exports_external.unknown()),
225905
- exports_external.array(exports_external.unknown())
225906
- ]).nullable().optional(),
225907
- traceback: exports_external.string().nullable().optional(),
226245
+ var ApiErrorResponseSchema = exports_external.looseObject({
226246
+ message: exports_external.unknown().optional(),
226247
+ detail: exports_external.unknown().optional(),
225908
226248
  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()
226249
+ reason: exports_external.string().optional().catch(undefined),
226250
+ errors: exports_external.array(exports_external.looseObject({ name: exports_external.string(), message: exports_external.string() })).optional().catch(undefined)
226251
+ }).optional().nullable().catch(undefined)
225915
226252
  });
225916
226253
 
225917
226254
  // src/core/errors.ts
225918
- function formatApiError(errorBody) {
225919
- const result = ApiErrorResponseSchema.safeParse(errorBody);
225920
- if (result.success) {
225921
- const { message, detail } = result.data;
225922
- const content = message ?? detail;
225923
- if (typeof content === "string") {
226255
+ function formatApiError(errorBody, parsed) {
226256
+ const data = parsed ?? ApiErrorResponseSchema.safeParse(errorBody).data;
226257
+ if (data) {
226258
+ const content = data.message ?? data.detail;
226259
+ if (typeof content === "string")
225924
226260
  return content;
225925
- }
225926
- if (content !== undefined) {
226261
+ if (content !== undefined)
225927
226262
  return JSON.stringify(content, null, 2);
225928
- }
225929
226263
  }
225930
- if (typeof errorBody === "string") {
226264
+ if (typeof errorBody === "string")
225931
226265
  return errorBody;
225932
- }
225933
226266
  return JSON.stringify(errorBody, null, 2);
225934
226267
  }
225935
226268
  function parseErrorDetails(extraData) {
225936
226269
  const errors3 = extraData?.errors;
225937
226270
  if (!errors3 || errors3.length === 0)
225938
226271
  return;
225939
- return errors3.map((item) => typeof item === "string" ? item : item.name ? `${item.name}: ${item.message}` : item.message);
226272
+ return errors3.map((e2) => `${e2.name}: ${e2.message}`);
225940
226273
  }
225941
226274
 
225942
226275
  class CLIError extends Error {
@@ -226057,11 +226390,12 @@ class ApiError extends SystemError {
226057
226390
  let details;
226058
226391
  try {
226059
226392
  responseBody = await error48.response.clone().json();
226060
- message = formatApiError(responseBody);
226061
226393
  const parsed = ApiErrorResponseSchema.safeParse(responseBody);
226062
- if (parsed.success) {
226063
- hints = ApiError.getReasonHints(parsed.data);
226064
- details = parseErrorDetails(parsed.data.extra_data);
226394
+ const parsedData = parsed.success ? parsed.data : undefined;
226395
+ message = formatApiError(responseBody, parsedData);
226396
+ if (parsedData) {
226397
+ hints = ApiError.getReasonHints(parsedData);
226398
+ details = parseErrorDetails(parsedData.extra_data);
226065
226399
  }
226066
226400
  } catch {
226067
226401
  message = error48.message;
@@ -226132,7 +226466,7 @@ class ApiError extends SystemError {
226132
226466
  }
226133
226467
  ]
226134
226468
  };
226135
- const reason = parsedResponse?.extra_data?.reason;
226469
+ const reason = parsedResponse.extra_data?.reason;
226136
226470
  if (typeof reason !== "string")
226137
226471
  return;
226138
226472
  return REASON_HINTS[reason];
@@ -233646,7 +233980,7 @@ async function fetchFunctionLogs(functionName, filters = {}) {
233646
233980
  return result.data;
233647
233981
  }
233648
233982
  // src/core/resources/function/config.ts
233649
- import { dirname as dirname4, join as join5 } from "node:path";
233983
+ import { basename as basename2, dirname as dirname4, join as join5 } from "node:path";
233650
233984
  async function readFunctionConfig(configPath) {
233651
233985
  const parsed = await readJsonFile(configPath);
233652
233986
  const result = FunctionConfigSchema.safeParse(parsed);
@@ -233661,9 +233995,7 @@ async function readFunction(configPath) {
233661
233995
  const entryPath = join5(functionDir, config5.entry);
233662
233996
  if (!await pathExists(entryPath)) {
233663
233997
  throw new InvalidInputError(`Function entry file not found: ${entryPath} (referenced in ${configPath})`, {
233664
- hints: [
233665
- { message: "Check the 'entry' field in your function config" }
233666
- ]
233998
+ hints: [{ message: "Check the 'entry' field in your function config" }]
233667
233999
  });
233668
234000
  }
233669
234001
  const filePaths = await globby("*.{js,ts,json}", {
@@ -233681,7 +234013,24 @@ async function readAllFunctions(functionsDir) {
233681
234013
  cwd: functionsDir,
233682
234014
  absolute: true
233683
234015
  });
233684
- const functions = await Promise.all(configFiles.map((configPath) => readFunction(configPath)));
234016
+ const indexFiles = await globby(`*/index.{js,ts}`, {
234017
+ cwd: functionsDir,
234018
+ absolute: true
234019
+ });
234020
+ const configFilesDirs = new Set(configFiles.map((f) => dirname4(f)));
234021
+ const indexFilesDirs = indexFiles.filter((indexFile) => !configFilesDirs.has(dirname4(indexFile)));
234022
+ const functionsFromConfig = await Promise.all(configFiles.map((configPath) => readFunction(configPath)));
234023
+ const functionsWithoutConfig = await Promise.all(indexFilesDirs.map(async (functionFile) => {
234024
+ const functionDir = dirname4(functionFile);
234025
+ const filePaths = await globby("*.{js,ts,json}", {
234026
+ cwd: functionDir,
234027
+ absolute: true
234028
+ });
234029
+ const name2 = basename2(functionDir);
234030
+ const entry = basename2(functionFile);
234031
+ return { name: name2, entry, entryPath: functionFile, filePaths };
234032
+ }));
234033
+ const functions = [...functionsFromConfig, ...functionsWithoutConfig];
233685
234034
  const names = new Set;
233686
234035
  for (const fn of functions) {
233687
234036
  if (names.has(fn.name)) {
@@ -233692,11 +234041,11 @@ async function readAllFunctions(functionsDir) {
233692
234041
  return functions;
233693
234042
  }
233694
234043
  // src/core/resources/function/deploy.ts
233695
- import { basename as basename2 } from "node:path";
234044
+ import { basename as basename3 } from "node:path";
233696
234045
  async function loadFunctionCode(fn) {
233697
234046
  const loadedFiles = await Promise.all(fn.filePaths.map(async (filePath) => {
233698
234047
  const content = await readTextFile(filePath);
233699
- return { path: basename2(filePath), content };
234048
+ return { path: basename3(filePath), content };
233700
234049
  }));
233701
234050
  return { ...fn, files: loadedFiles };
233702
234051
  }
@@ -234226,7 +234575,8 @@ async function setSecrets(secrets) {
234226
234575
  let response;
234227
234576
  try {
234228
234577
  response = await appClient.post("secrets", {
234229
- json: secrets
234578
+ json: secrets,
234579
+ timeout: false
234230
234580
  });
234231
234581
  } catch (error48) {
234232
234582
  throw await ApiError.fromHttpError(error48, "setting secrets");
@@ -241548,7 +241898,7 @@ var {
241548
241898
  // package.json
241549
241899
  var package_default = {
241550
241900
  name: "base44",
241551
- version: "0.0.36",
241901
+ version: "0.0.37",
241552
241902
  description: "Base44 CLI - Unified interface for managing Base44 applications",
241553
241903
  type: "module",
241554
241904
  bin: {
@@ -241594,11 +241944,12 @@ var package_default = {
241594
241944
  "@types/ejs": "^3.1.5",
241595
241945
  "@types/express": "^5.0.6",
241596
241946
  "@types/json-schema": "^7.0.15",
241597
- "@types/lodash.kebabcase": "^4.1.9",
241598
- "@types/node": "^22.10.5",
241947
+ "@types/lodash": "^4.17.24",
241599
241948
  "@types/multer": "^2.0.0",
241949
+ "@types/node": "^22.10.5",
241600
241950
  "@vercel/detect-agent": "^1.1.0",
241601
241951
  chalk: "^5.6.2",
241952
+ chokidar: "^5.0.0",
241602
241953
  commander: "^12.1.0",
241603
241954
  "common-tags": "^1.8.2",
241604
241955
  cors: "^2.8.5",
@@ -241614,9 +241965,9 @@ var package_default = {
241614
241965
  json5: "^2.2.3",
241615
241966
  knip: "^5.83.1",
241616
241967
  ky: "^1.14.2",
241617
- "lodash.kebabcase": "^4.1.1",
241618
- multer: "^2.0.0",
241968
+ lodash: "^4.17.23",
241619
241969
  msw: "^2.12.10",
241970
+ multer: "^2.0.0",
241620
241971
  nanoid: "^5.1.6",
241621
241972
  open: "^11.0.0",
241622
241973
  "p-wait-for": "^6.0.0",
@@ -241723,7 +242074,7 @@ function displayError(error48) {
241723
242074
  R2.error(errorMessage);
241724
242075
  if (isCLIError(error48)) {
241725
242076
  if (error48.details.length > 0) {
241726
- R2.error(theme.format.details(error48.details));
242077
+ R2.info(theme.format.details(error48.details));
241727
242078
  }
241728
242079
  const hints = theme.format.agentHints(error48.hints);
241729
242080
  if (hints) {
@@ -242742,8 +243093,8 @@ function getFunctionsDeployCommand(context) {
242742
243093
  }
242743
243094
 
242744
243095
  // src/cli/commands/project/create.ts
242745
- import { basename as basename3, join as join11, resolve as resolve2 } from "node:path";
242746
- var import_lodash = __toESM(require_lodash(), 1);
243096
+ import { basename as basename4, join as join11, resolve as resolve2 } from "node:path";
243097
+ var import_kebabCase = __toESM(require_kebabCase(), 1);
242747
243098
  var DEFAULT_TEMPLATE_ID = "backend-only";
242748
243099
  async function getTemplateById(templateId) {
242749
243100
  const templates = await listTemplates();
@@ -242777,8 +243128,8 @@ async function createInteractive(options) {
242777
243128
  name: () => {
242778
243129
  return options.name ? Promise.resolve(options.name) : Ze({
242779
243130
  message: "What is the name of your project?",
242780
- placeholder: basename3(process.cwd()),
242781
- initialValue: basename3(process.cwd()),
243131
+ placeholder: basename4(process.cwd()),
243132
+ initialValue: basename4(process.cwd()),
242782
243133
  validate: (value) => {
242783
243134
  if (!value || value.trim().length === 0) {
242784
243135
  return "Every project deserves a name";
@@ -242787,7 +243138,7 @@ async function createInteractive(options) {
242787
243138
  });
242788
243139
  },
242789
243140
  projectPath: async ({ results }) => {
242790
- const suggestedPath = await isDirEmpty() ? "./" : `./${import_lodash.default(results.name)}`;
243141
+ const suggestedPath = await isDirEmpty() ? "./" : `./${import_kebabCase.default(results.name)}`;
242791
243142
  return Ze({
242792
243143
  message: "Where should we create your project?",
242793
243144
  placeholder: suggestedPath,
@@ -243550,6 +243901,7 @@ function getTypesCommand(context) {
243550
243901
  }
243551
243902
 
243552
243903
  // src/cli/dev/dev-server/main.ts
243904
+ import { dirname as dirname14, join as join18 } from "node:path";
243553
243905
  var import_cors = __toESM(require_lib4(), 1);
243554
243906
  var import_express4 = __toESM(require_express(), 1);
243555
243907
 
@@ -243757,6 +244109,10 @@ class FunctionManager {
243757
244109
  try {
243758
244110
  return await promise2;
243759
244111
  } finally {
244112
+ if (!this.starting.has(name2) && this.running.has(name2)) {
244113
+ this.running.get(name2)?.process.kill();
244114
+ this.running.delete(name2);
244115
+ }
243760
244116
  this.starting.delete(name2);
243761
244117
  }
243762
244118
  }
@@ -243772,9 +244128,13 @@ class FunctionManager {
243772
244128
  this.setupProcessHandlers(name2, process21);
243773
244129
  return this.waitForReady(name2, runningFunc);
243774
244130
  }
244131
+ reload(functions) {
244132
+ this.stopAll();
244133
+ this.functions = new Map(functions.map((f7) => [f7.name, f7]));
244134
+ }
243775
244135
  stopAll() {
243776
244136
  for (const [name2, { process: process21 }] of this.running) {
243777
- this.logger.log(`[dev-server] Stopping function: ${name2}`);
244137
+ this.logger.log(`Stopping function: ${name2}`);
243778
244138
  process21.kill();
243779
244139
  }
243780
244140
  this.running.clear();
@@ -243785,7 +244145,7 @@ class FunctionManager {
243785
244145
  return getPorts({ exclude: usedPorts });
243786
244146
  }
243787
244147
  spawnFunction(func, port) {
243788
- this.logger.log(`[dev-server] Spawning function "${func.name}" on port ${port}`);
244148
+ this.logger.log(`Spawning function "${func.name}" on port ${port}`);
243789
244149
  const process21 = spawn2("deno", ["run", "--allow-all", WRAPPER_PATH], {
243790
244150
  env: {
243791
244151
  ...globalThis.process.env,
@@ -243813,11 +244173,13 @@ class FunctionManager {
243813
244173
  }
243814
244174
  });
243815
244175
  process21.on("exit", (code2) => {
243816
- this.logger.log(`[dev-server] Function "${name2}" exited with code ${code2}`);
244176
+ if (code2 !== null) {
244177
+ this.logger.log(`Function "${name2}" exited with code ${code2}`);
244178
+ }
243817
244179
  this.running.delete(name2);
243818
244180
  });
243819
244181
  process21.on("error", (error48) => {
243820
- this.logger.error(`[dev-server] Function "${name2}" error:`, error48);
244182
+ this.logger.error(`Function "${name2}" error:`, error48);
243821
244183
  this.running.delete(name2);
243822
244184
  });
243823
244185
  }
@@ -244268,6 +244630,1707 @@ function createCustomIntegrationRoutes(remoteProxy, logger) {
244268
244630
  return router;
244269
244631
  }
244270
244632
 
244633
+ // src/cli/dev/dev-server/watcher.ts
244634
+ import { EventEmitter as EventEmitter4 } from "node:events";
244635
+ import { relative as relative4 } from "node:path";
244636
+
244637
+ // node_modules/chokidar/index.js
244638
+ import { EventEmitter as EventEmitter3 } from "node:events";
244639
+ import { stat as statcb, Stats } from "node:fs";
244640
+ import { readdir as readdir3, stat as stat4 } from "node:fs/promises";
244641
+ import * as sp3 from "node:path";
244642
+
244643
+ // node_modules/readdirp/index.js
244644
+ import { lstat as lstat2, readdir as readdir2, realpath, stat as stat2 } from "node:fs/promises";
244645
+ import { join as pjoin, relative as prelative, resolve as presolve, sep as psep } from "node:path";
244646
+ import { Readable as Readable6 } from "node:stream";
244647
+ var EntryTypes = {
244648
+ FILE_TYPE: "files",
244649
+ DIR_TYPE: "directories",
244650
+ FILE_DIR_TYPE: "files_directories",
244651
+ EVERYTHING_TYPE: "all"
244652
+ };
244653
+ var defaultOptions = {
244654
+ root: ".",
244655
+ fileFilter: (_entryInfo) => true,
244656
+ directoryFilter: (_entryInfo) => true,
244657
+ type: EntryTypes.FILE_TYPE,
244658
+ lstat: false,
244659
+ depth: 2147483648,
244660
+ alwaysStat: false,
244661
+ highWaterMark: 4096
244662
+ };
244663
+ Object.freeze(defaultOptions);
244664
+ var RECURSIVE_ERROR_CODE = "READDIRP_RECURSIVE_ERROR";
244665
+ var NORMAL_FLOW_ERRORS = new Set(["ENOENT", "EPERM", "EACCES", "ELOOP", RECURSIVE_ERROR_CODE]);
244666
+ var ALL_TYPES = [
244667
+ EntryTypes.DIR_TYPE,
244668
+ EntryTypes.EVERYTHING_TYPE,
244669
+ EntryTypes.FILE_DIR_TYPE,
244670
+ EntryTypes.FILE_TYPE
244671
+ ];
244672
+ var DIR_TYPES = new Set([
244673
+ EntryTypes.DIR_TYPE,
244674
+ EntryTypes.EVERYTHING_TYPE,
244675
+ EntryTypes.FILE_DIR_TYPE
244676
+ ]);
244677
+ var FILE_TYPES2 = new Set([
244678
+ EntryTypes.EVERYTHING_TYPE,
244679
+ EntryTypes.FILE_DIR_TYPE,
244680
+ EntryTypes.FILE_TYPE
244681
+ ]);
244682
+ var isNormalFlowError = (error48) => NORMAL_FLOW_ERRORS.has(error48.code);
244683
+ var wantBigintFsStats = process.platform === "win32";
244684
+ var emptyFn = (_entryInfo) => true;
244685
+ var normalizeFilter = (filter2) => {
244686
+ if (filter2 === undefined)
244687
+ return emptyFn;
244688
+ if (typeof filter2 === "function")
244689
+ return filter2;
244690
+ if (typeof filter2 === "string") {
244691
+ const fl6 = filter2.trim();
244692
+ return (entry) => entry.basename === fl6;
244693
+ }
244694
+ if (Array.isArray(filter2)) {
244695
+ const trItems = filter2.map((item) => item.trim());
244696
+ return (entry) => trItems.some((f7) => entry.basename === f7);
244697
+ }
244698
+ return emptyFn;
244699
+ };
244700
+
244701
+ class ReaddirpStream extends Readable6 {
244702
+ parents;
244703
+ reading;
244704
+ parent;
244705
+ _stat;
244706
+ _maxDepth;
244707
+ _wantsDir;
244708
+ _wantsFile;
244709
+ _wantsEverything;
244710
+ _root;
244711
+ _isDirent;
244712
+ _statsProp;
244713
+ _rdOptions;
244714
+ _fileFilter;
244715
+ _directoryFilter;
244716
+ constructor(options8 = {}) {
244717
+ super({
244718
+ objectMode: true,
244719
+ autoDestroy: true,
244720
+ highWaterMark: options8.highWaterMark
244721
+ });
244722
+ const opts = { ...defaultOptions, ...options8 };
244723
+ const { root: root2, type } = opts;
244724
+ this._fileFilter = normalizeFilter(opts.fileFilter);
244725
+ this._directoryFilter = normalizeFilter(opts.directoryFilter);
244726
+ const statMethod = opts.lstat ? lstat2 : stat2;
244727
+ if (wantBigintFsStats) {
244728
+ this._stat = (path19) => statMethod(path19, { bigint: true });
244729
+ } else {
244730
+ this._stat = statMethod;
244731
+ }
244732
+ this._maxDepth = opts.depth != null && Number.isSafeInteger(opts.depth) ? opts.depth : defaultOptions.depth;
244733
+ this._wantsDir = type ? DIR_TYPES.has(type) : false;
244734
+ this._wantsFile = type ? FILE_TYPES2.has(type) : false;
244735
+ this._wantsEverything = type === EntryTypes.EVERYTHING_TYPE;
244736
+ this._root = presolve(root2);
244737
+ this._isDirent = !opts.alwaysStat;
244738
+ this._statsProp = this._isDirent ? "dirent" : "stats";
244739
+ this._rdOptions = { encoding: "utf8", withFileTypes: this._isDirent };
244740
+ this.parents = [this._exploreDir(root2, 1)];
244741
+ this.reading = false;
244742
+ this.parent = undefined;
244743
+ }
244744
+ async _read(batch) {
244745
+ if (this.reading)
244746
+ return;
244747
+ this.reading = true;
244748
+ try {
244749
+ while (!this.destroyed && batch > 0) {
244750
+ const par = this.parent;
244751
+ const fil = par && par.files;
244752
+ if (fil && fil.length > 0) {
244753
+ const { path: path19, depth } = par;
244754
+ const slice = fil.splice(0, batch).map((dirent) => this._formatEntry(dirent, path19));
244755
+ const awaited = await Promise.all(slice);
244756
+ for (const entry of awaited) {
244757
+ if (!entry)
244758
+ continue;
244759
+ if (this.destroyed)
244760
+ return;
244761
+ const entryType = await this._getEntryType(entry);
244762
+ if (entryType === "directory" && this._directoryFilter(entry)) {
244763
+ if (depth <= this._maxDepth) {
244764
+ this.parents.push(this._exploreDir(entry.fullPath, depth + 1));
244765
+ }
244766
+ if (this._wantsDir) {
244767
+ this.push(entry);
244768
+ batch--;
244769
+ }
244770
+ } else if ((entryType === "file" || this._includeAsFile(entry)) && this._fileFilter(entry)) {
244771
+ if (this._wantsFile) {
244772
+ this.push(entry);
244773
+ batch--;
244774
+ }
244775
+ }
244776
+ }
244777
+ } else {
244778
+ const parent = this.parents.pop();
244779
+ if (!parent) {
244780
+ this.push(null);
244781
+ break;
244782
+ }
244783
+ this.parent = await parent;
244784
+ if (this.destroyed)
244785
+ return;
244786
+ }
244787
+ }
244788
+ } catch (error48) {
244789
+ this.destroy(error48);
244790
+ } finally {
244791
+ this.reading = false;
244792
+ }
244793
+ }
244794
+ async _exploreDir(path19, depth) {
244795
+ let files;
244796
+ try {
244797
+ files = await readdir2(path19, this._rdOptions);
244798
+ } catch (error48) {
244799
+ this._onError(error48);
244800
+ }
244801
+ return { files, depth, path: path19 };
244802
+ }
244803
+ async _formatEntry(dirent, path19) {
244804
+ let entry;
244805
+ const basename5 = this._isDirent ? dirent.name : dirent;
244806
+ try {
244807
+ const fullPath = presolve(pjoin(path19, basename5));
244808
+ entry = { path: prelative(this._root, fullPath), fullPath, basename: basename5 };
244809
+ entry[this._statsProp] = this._isDirent ? dirent : await this._stat(fullPath);
244810
+ } catch (err) {
244811
+ this._onError(err);
244812
+ return;
244813
+ }
244814
+ return entry;
244815
+ }
244816
+ _onError(err) {
244817
+ if (isNormalFlowError(err) && !this.destroyed) {
244818
+ this.emit("warn", err);
244819
+ } else {
244820
+ this.destroy(err);
244821
+ }
244822
+ }
244823
+ async _getEntryType(entry) {
244824
+ if (!entry && this._statsProp in entry) {
244825
+ return "";
244826
+ }
244827
+ const stats = entry[this._statsProp];
244828
+ if (stats.isFile())
244829
+ return "file";
244830
+ if (stats.isDirectory())
244831
+ return "directory";
244832
+ if (stats && stats.isSymbolicLink()) {
244833
+ const full = entry.fullPath;
244834
+ try {
244835
+ const entryRealPath = await realpath(full);
244836
+ const entryRealPathStats = await lstat2(entryRealPath);
244837
+ if (entryRealPathStats.isFile()) {
244838
+ return "file";
244839
+ }
244840
+ if (entryRealPathStats.isDirectory()) {
244841
+ const len = entryRealPath.length;
244842
+ if (full.startsWith(entryRealPath) && full.substr(len, 1) === psep) {
244843
+ const recursiveError = new Error(`Circular symlink detected: "${full}" points to "${entryRealPath}"`);
244844
+ recursiveError.code = RECURSIVE_ERROR_CODE;
244845
+ return this._onError(recursiveError);
244846
+ }
244847
+ return "directory";
244848
+ }
244849
+ } catch (error48) {
244850
+ this._onError(error48);
244851
+ return "";
244852
+ }
244853
+ }
244854
+ }
244855
+ _includeAsFile(entry) {
244856
+ const stats = entry && entry[this._statsProp];
244857
+ return stats && this._wantsEverything && !stats.isDirectory();
244858
+ }
244859
+ }
244860
+ function readdirp(root2, options8 = {}) {
244861
+ let type = options8.entryType || options8.type;
244862
+ if (type === "both")
244863
+ type = EntryTypes.FILE_DIR_TYPE;
244864
+ if (type)
244865
+ options8.type = type;
244866
+ if (!root2) {
244867
+ throw new Error("readdirp: root argument is required. Usage: readdirp(root, options)");
244868
+ } else if (typeof root2 !== "string") {
244869
+ throw new TypeError("readdirp: root argument must be a string. Usage: readdirp(root, options)");
244870
+ } else if (type && !ALL_TYPES.includes(type)) {
244871
+ throw new Error(`readdirp: Invalid type passed. Use one of ${ALL_TYPES.join(", ")}`);
244872
+ }
244873
+ options8.root = root2;
244874
+ return new ReaddirpStream(options8);
244875
+ }
244876
+
244877
+ // node_modules/chokidar/handler.js
244878
+ import { watch as fs_watch, unwatchFile, watchFile } from "node:fs";
244879
+ import { realpath as fsrealpath, lstat as lstat3, open as open2, stat as stat3 } from "node:fs/promises";
244880
+ import { type as osType } from "node:os";
244881
+ import * as sp2 from "node:path";
244882
+ var STR_DATA = "data";
244883
+ var STR_END = "end";
244884
+ var STR_CLOSE = "close";
244885
+ var EMPTY_FN = () => {};
244886
+ var pl6 = process.platform;
244887
+ var isWindows4 = pl6 === "win32";
244888
+ var isMacos = pl6 === "darwin";
244889
+ var isLinux = pl6 === "linux";
244890
+ var isFreeBSD = pl6 === "freebsd";
244891
+ var isIBMi = osType() === "OS400";
244892
+ var EVENTS = {
244893
+ ALL: "all",
244894
+ READY: "ready",
244895
+ ADD: "add",
244896
+ CHANGE: "change",
244897
+ ADD_DIR: "addDir",
244898
+ UNLINK: "unlink",
244899
+ UNLINK_DIR: "unlinkDir",
244900
+ RAW: "raw",
244901
+ ERROR: "error"
244902
+ };
244903
+ var EV = EVENTS;
244904
+ var THROTTLE_MODE_WATCH = "watch";
244905
+ var statMethods = { lstat: lstat3, stat: stat3 };
244906
+ var KEY_LISTENERS = "listeners";
244907
+ var KEY_ERR = "errHandlers";
244908
+ var KEY_RAW = "rawEmitters";
244909
+ var HANDLER_KEYS2 = [KEY_LISTENERS, KEY_ERR, KEY_RAW];
244910
+ var binaryExtensions = new Set([
244911
+ "3dm",
244912
+ "3ds",
244913
+ "3g2",
244914
+ "3gp",
244915
+ "7z",
244916
+ "a",
244917
+ "aac",
244918
+ "adp",
244919
+ "afdesign",
244920
+ "afphoto",
244921
+ "afpub",
244922
+ "ai",
244923
+ "aif",
244924
+ "aiff",
244925
+ "alz",
244926
+ "ape",
244927
+ "apk",
244928
+ "appimage",
244929
+ "ar",
244930
+ "arj",
244931
+ "asf",
244932
+ "au",
244933
+ "avi",
244934
+ "bak",
244935
+ "baml",
244936
+ "bh",
244937
+ "bin",
244938
+ "bk",
244939
+ "bmp",
244940
+ "btif",
244941
+ "bz2",
244942
+ "bzip2",
244943
+ "cab",
244944
+ "caf",
244945
+ "cgm",
244946
+ "class",
244947
+ "cmx",
244948
+ "cpio",
244949
+ "cr2",
244950
+ "cur",
244951
+ "dat",
244952
+ "dcm",
244953
+ "deb",
244954
+ "dex",
244955
+ "djvu",
244956
+ "dll",
244957
+ "dmg",
244958
+ "dng",
244959
+ "doc",
244960
+ "docm",
244961
+ "docx",
244962
+ "dot",
244963
+ "dotm",
244964
+ "dra",
244965
+ "DS_Store",
244966
+ "dsk",
244967
+ "dts",
244968
+ "dtshd",
244969
+ "dvb",
244970
+ "dwg",
244971
+ "dxf",
244972
+ "ecelp4800",
244973
+ "ecelp7470",
244974
+ "ecelp9600",
244975
+ "egg",
244976
+ "eol",
244977
+ "eot",
244978
+ "epub",
244979
+ "exe",
244980
+ "f4v",
244981
+ "fbs",
244982
+ "fh",
244983
+ "fla",
244984
+ "flac",
244985
+ "flatpak",
244986
+ "fli",
244987
+ "flv",
244988
+ "fpx",
244989
+ "fst",
244990
+ "fvt",
244991
+ "g3",
244992
+ "gh",
244993
+ "gif",
244994
+ "graffle",
244995
+ "gz",
244996
+ "gzip",
244997
+ "h261",
244998
+ "h263",
244999
+ "h264",
245000
+ "icns",
245001
+ "ico",
245002
+ "ief",
245003
+ "img",
245004
+ "ipa",
245005
+ "iso",
245006
+ "jar",
245007
+ "jpeg",
245008
+ "jpg",
245009
+ "jpgv",
245010
+ "jpm",
245011
+ "jxr",
245012
+ "key",
245013
+ "ktx",
245014
+ "lha",
245015
+ "lib",
245016
+ "lvp",
245017
+ "lz",
245018
+ "lzh",
245019
+ "lzma",
245020
+ "lzo",
245021
+ "m3u",
245022
+ "m4a",
245023
+ "m4v",
245024
+ "mar",
245025
+ "mdi",
245026
+ "mht",
245027
+ "mid",
245028
+ "midi",
245029
+ "mj2",
245030
+ "mka",
245031
+ "mkv",
245032
+ "mmr",
245033
+ "mng",
245034
+ "mobi",
245035
+ "mov",
245036
+ "movie",
245037
+ "mp3",
245038
+ "mp4",
245039
+ "mp4a",
245040
+ "mpeg",
245041
+ "mpg",
245042
+ "mpga",
245043
+ "mxu",
245044
+ "nef",
245045
+ "npx",
245046
+ "numbers",
245047
+ "nupkg",
245048
+ "o",
245049
+ "odp",
245050
+ "ods",
245051
+ "odt",
245052
+ "oga",
245053
+ "ogg",
245054
+ "ogv",
245055
+ "otf",
245056
+ "ott",
245057
+ "pages",
245058
+ "pbm",
245059
+ "pcx",
245060
+ "pdb",
245061
+ "pdf",
245062
+ "pea",
245063
+ "pgm",
245064
+ "pic",
245065
+ "png",
245066
+ "pnm",
245067
+ "pot",
245068
+ "potm",
245069
+ "potx",
245070
+ "ppa",
245071
+ "ppam",
245072
+ "ppm",
245073
+ "pps",
245074
+ "ppsm",
245075
+ "ppsx",
245076
+ "ppt",
245077
+ "pptm",
245078
+ "pptx",
245079
+ "psd",
245080
+ "pya",
245081
+ "pyc",
245082
+ "pyo",
245083
+ "pyv",
245084
+ "qt",
245085
+ "rar",
245086
+ "ras",
245087
+ "raw",
245088
+ "resources",
245089
+ "rgb",
245090
+ "rip",
245091
+ "rlc",
245092
+ "rmf",
245093
+ "rmvb",
245094
+ "rpm",
245095
+ "rtf",
245096
+ "rz",
245097
+ "s3m",
245098
+ "s7z",
245099
+ "scpt",
245100
+ "sgi",
245101
+ "shar",
245102
+ "snap",
245103
+ "sil",
245104
+ "sketch",
245105
+ "slk",
245106
+ "smv",
245107
+ "snk",
245108
+ "so",
245109
+ "stl",
245110
+ "suo",
245111
+ "sub",
245112
+ "swf",
245113
+ "tar",
245114
+ "tbz",
245115
+ "tbz2",
245116
+ "tga",
245117
+ "tgz",
245118
+ "thmx",
245119
+ "tif",
245120
+ "tiff",
245121
+ "tlz",
245122
+ "ttc",
245123
+ "ttf",
245124
+ "txz",
245125
+ "udf",
245126
+ "uvh",
245127
+ "uvi",
245128
+ "uvm",
245129
+ "uvp",
245130
+ "uvs",
245131
+ "uvu",
245132
+ "viv",
245133
+ "vob",
245134
+ "war",
245135
+ "wav",
245136
+ "wax",
245137
+ "wbmp",
245138
+ "wdp",
245139
+ "weba",
245140
+ "webm",
245141
+ "webp",
245142
+ "whl",
245143
+ "wim",
245144
+ "wm",
245145
+ "wma",
245146
+ "wmv",
245147
+ "wmx",
245148
+ "woff",
245149
+ "woff2",
245150
+ "wrm",
245151
+ "wvx",
245152
+ "xbm",
245153
+ "xif",
245154
+ "xla",
245155
+ "xlam",
245156
+ "xls",
245157
+ "xlsb",
245158
+ "xlsm",
245159
+ "xlsx",
245160
+ "xlt",
245161
+ "xltm",
245162
+ "xltx",
245163
+ "xm",
245164
+ "xmind",
245165
+ "xpi",
245166
+ "xpm",
245167
+ "xwd",
245168
+ "xz",
245169
+ "z",
245170
+ "zip",
245171
+ "zipx"
245172
+ ]);
245173
+ var isBinaryPath = (filePath) => binaryExtensions.has(sp2.extname(filePath).slice(1).toLowerCase());
245174
+ var foreach = (val, fn9) => {
245175
+ if (val instanceof Set) {
245176
+ val.forEach(fn9);
245177
+ } else {
245178
+ fn9(val);
245179
+ }
245180
+ };
245181
+ var addAndConvert = (main, prop, item) => {
245182
+ let container = main[prop];
245183
+ if (!(container instanceof Set)) {
245184
+ main[prop] = container = new Set([container]);
245185
+ }
245186
+ container.add(item);
245187
+ };
245188
+ var clearItem = (cont) => (key2) => {
245189
+ const set2 = cont[key2];
245190
+ if (set2 instanceof Set) {
245191
+ set2.clear();
245192
+ } else {
245193
+ delete cont[key2];
245194
+ }
245195
+ };
245196
+ var delFromSet = (main, prop, item) => {
245197
+ const container = main[prop];
245198
+ if (container instanceof Set) {
245199
+ container.delete(item);
245200
+ } else if (container === item) {
245201
+ delete main[prop];
245202
+ }
245203
+ };
245204
+ var isEmptySet = (val) => val instanceof Set ? val.size === 0 : !val;
245205
+ var FsWatchInstances = new Map;
245206
+ function createFsWatchInstance(path19, options8, listener, errHandler, emitRaw) {
245207
+ const handleEvent = (rawEvent, evPath) => {
245208
+ listener(path19);
245209
+ emitRaw(rawEvent, evPath, { watchedPath: path19 });
245210
+ if (evPath && path19 !== evPath) {
245211
+ fsWatchBroadcast(sp2.resolve(path19, evPath), KEY_LISTENERS, sp2.join(path19, evPath));
245212
+ }
245213
+ };
245214
+ try {
245215
+ return fs_watch(path19, {
245216
+ persistent: options8.persistent
245217
+ }, handleEvent);
245218
+ } catch (error48) {
245219
+ errHandler(error48);
245220
+ return;
245221
+ }
245222
+ }
245223
+ var fsWatchBroadcast = (fullPath, listenerType, val1, val2, val3) => {
245224
+ const cont = FsWatchInstances.get(fullPath);
245225
+ if (!cont)
245226
+ return;
245227
+ foreach(cont[listenerType], (listener) => {
245228
+ listener(val1, val2, val3);
245229
+ });
245230
+ };
245231
+ var setFsWatchListener = (path19, fullPath, options8, handlers) => {
245232
+ const { listener, errHandler, rawEmitter } = handlers;
245233
+ let cont = FsWatchInstances.get(fullPath);
245234
+ let watcher;
245235
+ if (!options8.persistent) {
245236
+ watcher = createFsWatchInstance(path19, options8, listener, errHandler, rawEmitter);
245237
+ if (!watcher)
245238
+ return;
245239
+ return watcher.close.bind(watcher);
245240
+ }
245241
+ if (cont) {
245242
+ addAndConvert(cont, KEY_LISTENERS, listener);
245243
+ addAndConvert(cont, KEY_ERR, errHandler);
245244
+ addAndConvert(cont, KEY_RAW, rawEmitter);
245245
+ } else {
245246
+ watcher = createFsWatchInstance(path19, options8, fsWatchBroadcast.bind(null, fullPath, KEY_LISTENERS), errHandler, fsWatchBroadcast.bind(null, fullPath, KEY_RAW));
245247
+ if (!watcher)
245248
+ return;
245249
+ watcher.on(EV.ERROR, async (error48) => {
245250
+ const broadcastErr = fsWatchBroadcast.bind(null, fullPath, KEY_ERR);
245251
+ if (cont)
245252
+ cont.watcherUnusable = true;
245253
+ if (isWindows4 && error48.code === "EPERM") {
245254
+ try {
245255
+ const fd = await open2(path19, "r");
245256
+ await fd.close();
245257
+ broadcastErr(error48);
245258
+ } catch (err) {}
245259
+ } else {
245260
+ broadcastErr(error48);
245261
+ }
245262
+ });
245263
+ cont = {
245264
+ listeners: listener,
245265
+ errHandlers: errHandler,
245266
+ rawEmitters: rawEmitter,
245267
+ watcher
245268
+ };
245269
+ FsWatchInstances.set(fullPath, cont);
245270
+ }
245271
+ return () => {
245272
+ delFromSet(cont, KEY_LISTENERS, listener);
245273
+ delFromSet(cont, KEY_ERR, errHandler);
245274
+ delFromSet(cont, KEY_RAW, rawEmitter);
245275
+ if (isEmptySet(cont.listeners)) {
245276
+ cont.watcher.close();
245277
+ FsWatchInstances.delete(fullPath);
245278
+ HANDLER_KEYS2.forEach(clearItem(cont));
245279
+ cont.watcher = undefined;
245280
+ Object.freeze(cont);
245281
+ }
245282
+ };
245283
+ };
245284
+ var FsWatchFileInstances = new Map;
245285
+ var setFsWatchFileListener = (path19, fullPath, options8, handlers) => {
245286
+ const { listener, rawEmitter } = handlers;
245287
+ let cont = FsWatchFileInstances.get(fullPath);
245288
+ const copts = cont && cont.options;
245289
+ if (copts && (copts.persistent < options8.persistent || copts.interval > options8.interval)) {
245290
+ unwatchFile(fullPath);
245291
+ cont = undefined;
245292
+ }
245293
+ if (cont) {
245294
+ addAndConvert(cont, KEY_LISTENERS, listener);
245295
+ addAndConvert(cont, KEY_RAW, rawEmitter);
245296
+ } else {
245297
+ cont = {
245298
+ listeners: listener,
245299
+ rawEmitters: rawEmitter,
245300
+ options: options8,
245301
+ watcher: watchFile(fullPath, options8, (curr, prev) => {
245302
+ foreach(cont.rawEmitters, (rawEmitter2) => {
245303
+ rawEmitter2(EV.CHANGE, fullPath, { curr, prev });
245304
+ });
245305
+ const currmtime = curr.mtimeMs;
245306
+ if (curr.size !== prev.size || currmtime > prev.mtimeMs || currmtime === 0) {
245307
+ foreach(cont.listeners, (listener2) => listener2(path19, curr));
245308
+ }
245309
+ })
245310
+ };
245311
+ FsWatchFileInstances.set(fullPath, cont);
245312
+ }
245313
+ return () => {
245314
+ delFromSet(cont, KEY_LISTENERS, listener);
245315
+ delFromSet(cont, KEY_RAW, rawEmitter);
245316
+ if (isEmptySet(cont.listeners)) {
245317
+ FsWatchFileInstances.delete(fullPath);
245318
+ unwatchFile(fullPath);
245319
+ cont.options = cont.watcher = undefined;
245320
+ Object.freeze(cont);
245321
+ }
245322
+ };
245323
+ };
245324
+
245325
+ class NodeFsHandler {
245326
+ fsw;
245327
+ _boundHandleError;
245328
+ constructor(fsW) {
245329
+ this.fsw = fsW;
245330
+ this._boundHandleError = (error48) => fsW._handleError(error48);
245331
+ }
245332
+ _watchWithNodeFs(path19, listener) {
245333
+ const opts = this.fsw.options;
245334
+ const directory = sp2.dirname(path19);
245335
+ const basename6 = sp2.basename(path19);
245336
+ const parent = this.fsw._getWatchedDir(directory);
245337
+ parent.add(basename6);
245338
+ const absolutePath = sp2.resolve(path19);
245339
+ const options8 = {
245340
+ persistent: opts.persistent
245341
+ };
245342
+ if (!listener)
245343
+ listener = EMPTY_FN;
245344
+ let closer;
245345
+ if (opts.usePolling) {
245346
+ const enableBin = opts.interval !== opts.binaryInterval;
245347
+ options8.interval = enableBin && isBinaryPath(basename6) ? opts.binaryInterval : opts.interval;
245348
+ closer = setFsWatchFileListener(path19, absolutePath, options8, {
245349
+ listener,
245350
+ rawEmitter: this.fsw._emitRaw
245351
+ });
245352
+ } else {
245353
+ closer = setFsWatchListener(path19, absolutePath, options8, {
245354
+ listener,
245355
+ errHandler: this._boundHandleError,
245356
+ rawEmitter: this.fsw._emitRaw
245357
+ });
245358
+ }
245359
+ return closer;
245360
+ }
245361
+ _handleFile(file2, stats, initialAdd) {
245362
+ if (this.fsw.closed) {
245363
+ return;
245364
+ }
245365
+ const dirname13 = sp2.dirname(file2);
245366
+ const basename6 = sp2.basename(file2);
245367
+ const parent = this.fsw._getWatchedDir(dirname13);
245368
+ let prevStats = stats;
245369
+ if (parent.has(basename6))
245370
+ return;
245371
+ const listener = async (path19, newStats) => {
245372
+ if (!this.fsw._throttle(THROTTLE_MODE_WATCH, file2, 5))
245373
+ return;
245374
+ if (!newStats || newStats.mtimeMs === 0) {
245375
+ try {
245376
+ const newStats2 = await stat3(file2);
245377
+ if (this.fsw.closed)
245378
+ return;
245379
+ const at13 = newStats2.atimeMs;
245380
+ const mt12 = newStats2.mtimeMs;
245381
+ if (!at13 || at13 <= mt12 || mt12 !== prevStats.mtimeMs) {
245382
+ this.fsw._emit(EV.CHANGE, file2, newStats2);
245383
+ }
245384
+ if ((isMacos || isLinux || isFreeBSD) && prevStats.ino !== newStats2.ino) {
245385
+ this.fsw._closeFile(path19);
245386
+ prevStats = newStats2;
245387
+ const closer2 = this._watchWithNodeFs(file2, listener);
245388
+ if (closer2)
245389
+ this.fsw._addPathCloser(path19, closer2);
245390
+ } else {
245391
+ prevStats = newStats2;
245392
+ }
245393
+ } catch (error48) {
245394
+ this.fsw._remove(dirname13, basename6);
245395
+ }
245396
+ } else if (parent.has(basename6)) {
245397
+ const at13 = newStats.atimeMs;
245398
+ const mt12 = newStats.mtimeMs;
245399
+ if (!at13 || at13 <= mt12 || mt12 !== prevStats.mtimeMs) {
245400
+ this.fsw._emit(EV.CHANGE, file2, newStats);
245401
+ }
245402
+ prevStats = newStats;
245403
+ }
245404
+ };
245405
+ const closer = this._watchWithNodeFs(file2, listener);
245406
+ if (!(initialAdd && this.fsw.options.ignoreInitial) && this.fsw._isntIgnored(file2)) {
245407
+ if (!this.fsw._throttle(EV.ADD, file2, 0))
245408
+ return;
245409
+ this.fsw._emit(EV.ADD, file2, stats);
245410
+ }
245411
+ return closer;
245412
+ }
245413
+ async _handleSymlink(entry, directory, path19, item) {
245414
+ if (this.fsw.closed) {
245415
+ return;
245416
+ }
245417
+ const full = entry.fullPath;
245418
+ const dir = this.fsw._getWatchedDir(directory);
245419
+ if (!this.fsw.options.followSymlinks) {
245420
+ this.fsw._incrReadyCount();
245421
+ let linkPath;
245422
+ try {
245423
+ linkPath = await fsrealpath(path19);
245424
+ } catch (e8) {
245425
+ this.fsw._emitReady();
245426
+ return true;
245427
+ }
245428
+ if (this.fsw.closed)
245429
+ return;
245430
+ if (dir.has(item)) {
245431
+ if (this.fsw._symlinkPaths.get(full) !== linkPath) {
245432
+ this.fsw._symlinkPaths.set(full, linkPath);
245433
+ this.fsw._emit(EV.CHANGE, path19, entry.stats);
245434
+ }
245435
+ } else {
245436
+ dir.add(item);
245437
+ this.fsw._symlinkPaths.set(full, linkPath);
245438
+ this.fsw._emit(EV.ADD, path19, entry.stats);
245439
+ }
245440
+ this.fsw._emitReady();
245441
+ return true;
245442
+ }
245443
+ if (this.fsw._symlinkPaths.has(full)) {
245444
+ return true;
245445
+ }
245446
+ this.fsw._symlinkPaths.set(full, true);
245447
+ }
245448
+ _handleRead(directory, initialAdd, wh2, target, dir, depth, throttler) {
245449
+ directory = sp2.join(directory, "");
245450
+ const throttleKey = target ? `${directory}:${target}` : directory;
245451
+ throttler = this.fsw._throttle("readdir", throttleKey, 1000);
245452
+ if (!throttler)
245453
+ return;
245454
+ const previous = this.fsw._getWatchedDir(wh2.path);
245455
+ const current = new Set;
245456
+ let stream = this.fsw._readdirp(directory, {
245457
+ fileFilter: (entry) => wh2.filterPath(entry),
245458
+ directoryFilter: (entry) => wh2.filterDir(entry)
245459
+ });
245460
+ if (!stream)
245461
+ return;
245462
+ stream.on(STR_DATA, async (entry) => {
245463
+ if (this.fsw.closed) {
245464
+ stream = undefined;
245465
+ return;
245466
+ }
245467
+ const item = entry.path;
245468
+ let path19 = sp2.join(directory, item);
245469
+ current.add(item);
245470
+ if (entry.stats.isSymbolicLink() && await this._handleSymlink(entry, directory, path19, item)) {
245471
+ return;
245472
+ }
245473
+ if (this.fsw.closed) {
245474
+ stream = undefined;
245475
+ return;
245476
+ }
245477
+ if (item === target || !target && !previous.has(item)) {
245478
+ this.fsw._incrReadyCount();
245479
+ path19 = sp2.join(dir, sp2.relative(dir, path19));
245480
+ this._addToNodeFs(path19, initialAdd, wh2, depth + 1);
245481
+ }
245482
+ }).on(EV.ERROR, this._boundHandleError);
245483
+ return new Promise((resolve7, reject) => {
245484
+ if (!stream)
245485
+ return reject();
245486
+ stream.once(STR_END, () => {
245487
+ if (this.fsw.closed) {
245488
+ stream = undefined;
245489
+ return;
245490
+ }
245491
+ const wasThrottled = throttler ? throttler.clear() : false;
245492
+ resolve7(undefined);
245493
+ previous.getChildren().filter((item) => {
245494
+ return item !== directory && !current.has(item);
245495
+ }).forEach((item) => {
245496
+ this.fsw._remove(directory, item);
245497
+ });
245498
+ stream = undefined;
245499
+ if (wasThrottled)
245500
+ this._handleRead(directory, false, wh2, target, dir, depth, throttler);
245501
+ });
245502
+ });
245503
+ }
245504
+ async _handleDir(dir, stats, initialAdd, depth, target, wh2, realpath2) {
245505
+ const parentDir = this.fsw._getWatchedDir(sp2.dirname(dir));
245506
+ const tracked = parentDir.has(sp2.basename(dir));
245507
+ if (!(initialAdd && this.fsw.options.ignoreInitial) && !target && !tracked) {
245508
+ this.fsw._emit(EV.ADD_DIR, dir, stats);
245509
+ }
245510
+ parentDir.add(sp2.basename(dir));
245511
+ this.fsw._getWatchedDir(dir);
245512
+ let throttler;
245513
+ let closer;
245514
+ const oDepth = this.fsw.options.depth;
245515
+ if ((oDepth == null || depth <= oDepth) && !this.fsw._symlinkPaths.has(realpath2)) {
245516
+ if (!target) {
245517
+ await this._handleRead(dir, initialAdd, wh2, target, dir, depth, throttler);
245518
+ if (this.fsw.closed)
245519
+ return;
245520
+ }
245521
+ closer = this._watchWithNodeFs(dir, (dirPath, stats2) => {
245522
+ if (stats2 && stats2.mtimeMs === 0)
245523
+ return;
245524
+ this._handleRead(dirPath, false, wh2, target, dir, depth, throttler);
245525
+ });
245526
+ }
245527
+ return closer;
245528
+ }
245529
+ async _addToNodeFs(path19, initialAdd, priorWh, depth, target) {
245530
+ const ready = this.fsw._emitReady;
245531
+ if (this.fsw._isIgnored(path19) || this.fsw.closed) {
245532
+ ready();
245533
+ return false;
245534
+ }
245535
+ const wh2 = this.fsw._getWatchHelpers(path19);
245536
+ if (priorWh) {
245537
+ wh2.filterPath = (entry) => priorWh.filterPath(entry);
245538
+ wh2.filterDir = (entry) => priorWh.filterDir(entry);
245539
+ }
245540
+ try {
245541
+ const stats = await statMethods[wh2.statMethod](wh2.watchPath);
245542
+ if (this.fsw.closed)
245543
+ return;
245544
+ if (this.fsw._isIgnored(wh2.watchPath, stats)) {
245545
+ ready();
245546
+ return false;
245547
+ }
245548
+ const follow = this.fsw.options.followSymlinks;
245549
+ let closer;
245550
+ if (stats.isDirectory()) {
245551
+ const absPath = sp2.resolve(path19);
245552
+ const targetPath = follow ? await fsrealpath(path19) : path19;
245553
+ if (this.fsw.closed)
245554
+ return;
245555
+ closer = await this._handleDir(wh2.watchPath, stats, initialAdd, depth, target, wh2, targetPath);
245556
+ if (this.fsw.closed)
245557
+ return;
245558
+ if (absPath !== targetPath && targetPath !== undefined) {
245559
+ this.fsw._symlinkPaths.set(absPath, targetPath);
245560
+ }
245561
+ } else if (stats.isSymbolicLink()) {
245562
+ const targetPath = follow ? await fsrealpath(path19) : path19;
245563
+ if (this.fsw.closed)
245564
+ return;
245565
+ const parent = sp2.dirname(wh2.watchPath);
245566
+ this.fsw._getWatchedDir(parent).add(wh2.watchPath);
245567
+ this.fsw._emit(EV.ADD, wh2.watchPath, stats);
245568
+ closer = await this._handleDir(parent, stats, initialAdd, depth, path19, wh2, targetPath);
245569
+ if (this.fsw.closed)
245570
+ return;
245571
+ if (targetPath !== undefined) {
245572
+ this.fsw._symlinkPaths.set(sp2.resolve(path19), targetPath);
245573
+ }
245574
+ } else {
245575
+ closer = this._handleFile(wh2.watchPath, stats, initialAdd);
245576
+ }
245577
+ ready();
245578
+ if (closer)
245579
+ this.fsw._addPathCloser(path19, closer);
245580
+ return false;
245581
+ } catch (error48) {
245582
+ if (this.fsw._handleError(error48)) {
245583
+ ready();
245584
+ return path19;
245585
+ }
245586
+ }
245587
+ }
245588
+ }
245589
+
245590
+ // node_modules/chokidar/index.js
245591
+ /*! chokidar - MIT License (c) 2012 Paul Miller (paulmillr.com) */
245592
+ var SLASH = "/";
245593
+ var SLASH_SLASH = "//";
245594
+ var ONE_DOT = ".";
245595
+ var TWO_DOTS = "..";
245596
+ var STRING_TYPE = "string";
245597
+ var BACK_SLASH_RE = /\\/g;
245598
+ var DOUBLE_SLASH_RE = /\/\//g;
245599
+ var DOT_RE = /\..*\.(sw[px])$|~$|\.subl.*\.tmp/;
245600
+ var REPLACER_RE = /^\.[/\\]/;
245601
+ function arrify(item) {
245602
+ return Array.isArray(item) ? item : [item];
245603
+ }
245604
+ var isMatcherObject = (matcher) => typeof matcher === "object" && matcher !== null && !(matcher instanceof RegExp);
245605
+ function createPattern(matcher) {
245606
+ if (typeof matcher === "function")
245607
+ return matcher;
245608
+ if (typeof matcher === "string")
245609
+ return (string4) => matcher === string4;
245610
+ if (matcher instanceof RegExp)
245611
+ return (string4) => matcher.test(string4);
245612
+ if (typeof matcher === "object" && matcher !== null) {
245613
+ return (string4) => {
245614
+ if (matcher.path === string4)
245615
+ return true;
245616
+ if (matcher.recursive) {
245617
+ const relative4 = sp3.relative(matcher.path, string4);
245618
+ if (!relative4) {
245619
+ return false;
245620
+ }
245621
+ return !relative4.startsWith("..") && !sp3.isAbsolute(relative4);
245622
+ }
245623
+ return false;
245624
+ };
245625
+ }
245626
+ return () => false;
245627
+ }
245628
+ function normalizePath(path19) {
245629
+ if (typeof path19 !== "string")
245630
+ throw new Error("string expected");
245631
+ path19 = sp3.normalize(path19);
245632
+ path19 = path19.replace(/\\/g, "/");
245633
+ let prepend = false;
245634
+ if (path19.startsWith("//"))
245635
+ prepend = true;
245636
+ path19 = path19.replace(DOUBLE_SLASH_RE, "/");
245637
+ if (prepend)
245638
+ path19 = "/" + path19;
245639
+ return path19;
245640
+ }
245641
+ function matchPatterns(patterns, testString, stats) {
245642
+ const path19 = normalizePath(testString);
245643
+ for (let index = 0;index < patterns.length; index++) {
245644
+ const pattern = patterns[index];
245645
+ if (pattern(path19, stats)) {
245646
+ return true;
245647
+ }
245648
+ }
245649
+ return false;
245650
+ }
245651
+ function anymatch(matchers, testString) {
245652
+ if (matchers == null) {
245653
+ throw new TypeError("anymatch: specify first argument");
245654
+ }
245655
+ const matchersArray = arrify(matchers);
245656
+ const patterns = matchersArray.map((matcher) => createPattern(matcher));
245657
+ if (testString == null) {
245658
+ return (testString2, stats) => {
245659
+ return matchPatterns(patterns, testString2, stats);
245660
+ };
245661
+ }
245662
+ return matchPatterns(patterns, testString);
245663
+ }
245664
+ var unifyPaths = (paths_) => {
245665
+ const paths = arrify(paths_).flat();
245666
+ if (!paths.every((p4) => typeof p4 === STRING_TYPE)) {
245667
+ throw new TypeError(`Non-string provided as watch path: ${paths}`);
245668
+ }
245669
+ return paths.map(normalizePathToUnix);
245670
+ };
245671
+ var toUnix = (string4) => {
245672
+ let str = string4.replace(BACK_SLASH_RE, SLASH);
245673
+ let prepend = false;
245674
+ if (str.startsWith(SLASH_SLASH)) {
245675
+ prepend = true;
245676
+ }
245677
+ str = str.replace(DOUBLE_SLASH_RE, SLASH);
245678
+ if (prepend) {
245679
+ str = SLASH + str;
245680
+ }
245681
+ return str;
245682
+ };
245683
+ var normalizePathToUnix = (path19) => toUnix(sp3.normalize(toUnix(path19)));
245684
+ var normalizeIgnored = (cwd = "") => (path19) => {
245685
+ if (typeof path19 === "string") {
245686
+ return normalizePathToUnix(sp3.isAbsolute(path19) ? path19 : sp3.join(cwd, path19));
245687
+ } else {
245688
+ return path19;
245689
+ }
245690
+ };
245691
+ var getAbsolutePath = (path19, cwd) => {
245692
+ if (sp3.isAbsolute(path19)) {
245693
+ return path19;
245694
+ }
245695
+ return sp3.join(cwd, path19);
245696
+ };
245697
+ var EMPTY_SET = Object.freeze(new Set);
245698
+
245699
+ class DirEntry {
245700
+ path;
245701
+ _removeWatcher;
245702
+ items;
245703
+ constructor(dir, removeWatcher) {
245704
+ this.path = dir;
245705
+ this._removeWatcher = removeWatcher;
245706
+ this.items = new Set;
245707
+ }
245708
+ add(item) {
245709
+ const { items } = this;
245710
+ if (!items)
245711
+ return;
245712
+ if (item !== ONE_DOT && item !== TWO_DOTS)
245713
+ items.add(item);
245714
+ }
245715
+ async remove(item) {
245716
+ const { items } = this;
245717
+ if (!items)
245718
+ return;
245719
+ items.delete(item);
245720
+ if (items.size > 0)
245721
+ return;
245722
+ const dir = this.path;
245723
+ try {
245724
+ await readdir3(dir);
245725
+ } catch (err) {
245726
+ if (this._removeWatcher) {
245727
+ this._removeWatcher(sp3.dirname(dir), sp3.basename(dir));
245728
+ }
245729
+ }
245730
+ }
245731
+ has(item) {
245732
+ const { items } = this;
245733
+ if (!items)
245734
+ return;
245735
+ return items.has(item);
245736
+ }
245737
+ getChildren() {
245738
+ const { items } = this;
245739
+ if (!items)
245740
+ return [];
245741
+ return [...items.values()];
245742
+ }
245743
+ dispose() {
245744
+ this.items.clear();
245745
+ this.path = "";
245746
+ this._removeWatcher = EMPTY_FN;
245747
+ this.items = EMPTY_SET;
245748
+ Object.freeze(this);
245749
+ }
245750
+ }
245751
+ var STAT_METHOD_F = "stat";
245752
+ var STAT_METHOD_L = "lstat";
245753
+
245754
+ class WatchHelper {
245755
+ fsw;
245756
+ path;
245757
+ watchPath;
245758
+ fullWatchPath;
245759
+ dirParts;
245760
+ followSymlinks;
245761
+ statMethod;
245762
+ constructor(path19, follow, fsw) {
245763
+ this.fsw = fsw;
245764
+ const watchPath = path19;
245765
+ this.path = path19 = path19.replace(REPLACER_RE, "");
245766
+ this.watchPath = watchPath;
245767
+ this.fullWatchPath = sp3.resolve(watchPath);
245768
+ this.dirParts = [];
245769
+ this.dirParts.forEach((parts) => {
245770
+ if (parts.length > 1)
245771
+ parts.pop();
245772
+ });
245773
+ this.followSymlinks = follow;
245774
+ this.statMethod = follow ? STAT_METHOD_F : STAT_METHOD_L;
245775
+ }
245776
+ entryPath(entry) {
245777
+ return sp3.join(this.watchPath, sp3.relative(this.watchPath, entry.fullPath));
245778
+ }
245779
+ filterPath(entry) {
245780
+ const { stats } = entry;
245781
+ if (stats && stats.isSymbolicLink())
245782
+ return this.filterDir(entry);
245783
+ const resolvedPath = this.entryPath(entry);
245784
+ return this.fsw._isntIgnored(resolvedPath, stats) && this.fsw._hasReadPermissions(stats);
245785
+ }
245786
+ filterDir(entry) {
245787
+ return this.fsw._isntIgnored(this.entryPath(entry), entry.stats);
245788
+ }
245789
+ }
245790
+
245791
+ class FSWatcher extends EventEmitter3 {
245792
+ closed;
245793
+ options;
245794
+ _closers;
245795
+ _ignoredPaths;
245796
+ _throttled;
245797
+ _streams;
245798
+ _symlinkPaths;
245799
+ _watched;
245800
+ _pendingWrites;
245801
+ _pendingUnlinks;
245802
+ _readyCount;
245803
+ _emitReady;
245804
+ _closePromise;
245805
+ _userIgnored;
245806
+ _readyEmitted;
245807
+ _emitRaw;
245808
+ _boundRemove;
245809
+ _nodeFsHandler;
245810
+ constructor(_opts = {}) {
245811
+ super();
245812
+ this.closed = false;
245813
+ this._closers = new Map;
245814
+ this._ignoredPaths = new Set;
245815
+ this._throttled = new Map;
245816
+ this._streams = new Set;
245817
+ this._symlinkPaths = new Map;
245818
+ this._watched = new Map;
245819
+ this._pendingWrites = new Map;
245820
+ this._pendingUnlinks = new Map;
245821
+ this._readyCount = 0;
245822
+ this._readyEmitted = false;
245823
+ const awf = _opts.awaitWriteFinish;
245824
+ const DEF_AWF = { stabilityThreshold: 2000, pollInterval: 100 };
245825
+ const opts = {
245826
+ persistent: true,
245827
+ ignoreInitial: false,
245828
+ ignorePermissionErrors: false,
245829
+ interval: 100,
245830
+ binaryInterval: 300,
245831
+ followSymlinks: true,
245832
+ usePolling: false,
245833
+ atomic: true,
245834
+ ..._opts,
245835
+ ignored: _opts.ignored ? arrify(_opts.ignored) : arrify([]),
245836
+ awaitWriteFinish: awf === true ? DEF_AWF : typeof awf === "object" ? { ...DEF_AWF, ...awf } : false
245837
+ };
245838
+ if (isIBMi)
245839
+ opts.usePolling = true;
245840
+ if (opts.atomic === undefined)
245841
+ opts.atomic = !opts.usePolling;
245842
+ const envPoll = process.env.CHOKIDAR_USEPOLLING;
245843
+ if (envPoll !== undefined) {
245844
+ const envLower = envPoll.toLowerCase();
245845
+ if (envLower === "false" || envLower === "0")
245846
+ opts.usePolling = false;
245847
+ else if (envLower === "true" || envLower === "1")
245848
+ opts.usePolling = true;
245849
+ else
245850
+ opts.usePolling = !!envLower;
245851
+ }
245852
+ const envInterval = process.env.CHOKIDAR_INTERVAL;
245853
+ if (envInterval)
245854
+ opts.interval = Number.parseInt(envInterval, 10);
245855
+ let readyCalls = 0;
245856
+ this._emitReady = () => {
245857
+ readyCalls++;
245858
+ if (readyCalls >= this._readyCount) {
245859
+ this._emitReady = EMPTY_FN;
245860
+ this._readyEmitted = true;
245861
+ process.nextTick(() => this.emit(EVENTS.READY));
245862
+ }
245863
+ };
245864
+ this._emitRaw = (...args) => this.emit(EVENTS.RAW, ...args);
245865
+ this._boundRemove = this._remove.bind(this);
245866
+ this.options = opts;
245867
+ this._nodeFsHandler = new NodeFsHandler(this);
245868
+ Object.freeze(opts);
245869
+ }
245870
+ _addIgnoredPath(matcher) {
245871
+ if (isMatcherObject(matcher)) {
245872
+ for (const ignored of this._ignoredPaths) {
245873
+ if (isMatcherObject(ignored) && ignored.path === matcher.path && ignored.recursive === matcher.recursive) {
245874
+ return;
245875
+ }
245876
+ }
245877
+ }
245878
+ this._ignoredPaths.add(matcher);
245879
+ }
245880
+ _removeIgnoredPath(matcher) {
245881
+ this._ignoredPaths.delete(matcher);
245882
+ if (typeof matcher === "string") {
245883
+ for (const ignored of this._ignoredPaths) {
245884
+ if (isMatcherObject(ignored) && ignored.path === matcher) {
245885
+ this._ignoredPaths.delete(ignored);
245886
+ }
245887
+ }
245888
+ }
245889
+ }
245890
+ add(paths_, _origAdd, _internal) {
245891
+ const { cwd } = this.options;
245892
+ this.closed = false;
245893
+ this._closePromise = undefined;
245894
+ let paths = unifyPaths(paths_);
245895
+ if (cwd) {
245896
+ paths = paths.map((path19) => {
245897
+ const absPath = getAbsolutePath(path19, cwd);
245898
+ return absPath;
245899
+ });
245900
+ }
245901
+ paths.forEach((path19) => {
245902
+ this._removeIgnoredPath(path19);
245903
+ });
245904
+ this._userIgnored = undefined;
245905
+ if (!this._readyCount)
245906
+ this._readyCount = 0;
245907
+ this._readyCount += paths.length;
245908
+ Promise.all(paths.map(async (path19) => {
245909
+ const res = await this._nodeFsHandler._addToNodeFs(path19, !_internal, undefined, 0, _origAdd);
245910
+ if (res)
245911
+ this._emitReady();
245912
+ return res;
245913
+ })).then((results) => {
245914
+ if (this.closed)
245915
+ return;
245916
+ results.forEach((item) => {
245917
+ if (item)
245918
+ this.add(sp3.dirname(item), sp3.basename(_origAdd || item));
245919
+ });
245920
+ });
245921
+ return this;
245922
+ }
245923
+ unwatch(paths_) {
245924
+ if (this.closed)
245925
+ return this;
245926
+ const paths = unifyPaths(paths_);
245927
+ const { cwd } = this.options;
245928
+ paths.forEach((path19) => {
245929
+ if (!sp3.isAbsolute(path19) && !this._closers.has(path19)) {
245930
+ if (cwd)
245931
+ path19 = sp3.join(cwd, path19);
245932
+ path19 = sp3.resolve(path19);
245933
+ }
245934
+ this._closePath(path19);
245935
+ this._addIgnoredPath(path19);
245936
+ if (this._watched.has(path19)) {
245937
+ this._addIgnoredPath({
245938
+ path: path19,
245939
+ recursive: true
245940
+ });
245941
+ }
245942
+ this._userIgnored = undefined;
245943
+ });
245944
+ return this;
245945
+ }
245946
+ close() {
245947
+ if (this._closePromise) {
245948
+ return this._closePromise;
245949
+ }
245950
+ this.closed = true;
245951
+ this.removeAllListeners();
245952
+ const closers = [];
245953
+ this._closers.forEach((closerList) => closerList.forEach((closer) => {
245954
+ const promise2 = closer();
245955
+ if (promise2 instanceof Promise)
245956
+ closers.push(promise2);
245957
+ }));
245958
+ this._streams.forEach((stream) => stream.destroy());
245959
+ this._userIgnored = undefined;
245960
+ this._readyCount = 0;
245961
+ this._readyEmitted = false;
245962
+ this._watched.forEach((dirent) => dirent.dispose());
245963
+ this._closers.clear();
245964
+ this._watched.clear();
245965
+ this._streams.clear();
245966
+ this._symlinkPaths.clear();
245967
+ this._throttled.clear();
245968
+ this._closePromise = closers.length ? Promise.all(closers).then(() => {
245969
+ return;
245970
+ }) : Promise.resolve();
245971
+ return this._closePromise;
245972
+ }
245973
+ getWatched() {
245974
+ const watchList = {};
245975
+ this._watched.forEach((entry, dir) => {
245976
+ const key2 = this.options.cwd ? sp3.relative(this.options.cwd, dir) : dir;
245977
+ const index = key2 || ONE_DOT;
245978
+ watchList[index] = entry.getChildren().sort();
245979
+ });
245980
+ return watchList;
245981
+ }
245982
+ emitWithAll(event, args) {
245983
+ this.emit(event, ...args);
245984
+ if (event !== EVENTS.ERROR)
245985
+ this.emit(EVENTS.ALL, event, ...args);
245986
+ }
245987
+ async _emit(event, path19, stats) {
245988
+ if (this.closed)
245989
+ return;
245990
+ const opts = this.options;
245991
+ if (isWindows4)
245992
+ path19 = sp3.normalize(path19);
245993
+ if (opts.cwd)
245994
+ path19 = sp3.relative(opts.cwd, path19);
245995
+ const args = [path19];
245996
+ if (stats != null)
245997
+ args.push(stats);
245998
+ const awf = opts.awaitWriteFinish;
245999
+ let pw;
246000
+ if (awf && (pw = this._pendingWrites.get(path19))) {
246001
+ pw.lastChange = new Date;
246002
+ return this;
246003
+ }
246004
+ if (opts.atomic) {
246005
+ if (event === EVENTS.UNLINK) {
246006
+ this._pendingUnlinks.set(path19, [event, ...args]);
246007
+ setTimeout(() => {
246008
+ this._pendingUnlinks.forEach((entry, path20) => {
246009
+ this.emit(...entry);
246010
+ this.emit(EVENTS.ALL, ...entry);
246011
+ this._pendingUnlinks.delete(path20);
246012
+ });
246013
+ }, typeof opts.atomic === "number" ? opts.atomic : 100);
246014
+ return this;
246015
+ }
246016
+ if (event === EVENTS.ADD && this._pendingUnlinks.has(path19)) {
246017
+ event = EVENTS.CHANGE;
246018
+ this._pendingUnlinks.delete(path19);
246019
+ }
246020
+ }
246021
+ if (awf && (event === EVENTS.ADD || event === EVENTS.CHANGE) && this._readyEmitted) {
246022
+ const awfEmit = (err, stats2) => {
246023
+ if (err) {
246024
+ event = EVENTS.ERROR;
246025
+ args[0] = err;
246026
+ this.emitWithAll(event, args);
246027
+ } else if (stats2) {
246028
+ if (args.length > 1) {
246029
+ args[1] = stats2;
246030
+ } else {
246031
+ args.push(stats2);
246032
+ }
246033
+ this.emitWithAll(event, args);
246034
+ }
246035
+ };
246036
+ this._awaitWriteFinish(path19, awf.stabilityThreshold, event, awfEmit);
246037
+ return this;
246038
+ }
246039
+ if (event === EVENTS.CHANGE) {
246040
+ const isThrottled = !this._throttle(EVENTS.CHANGE, path19, 50);
246041
+ if (isThrottled)
246042
+ return this;
246043
+ }
246044
+ if (opts.alwaysStat && stats === undefined && (event === EVENTS.ADD || event === EVENTS.ADD_DIR || event === EVENTS.CHANGE)) {
246045
+ const fullPath = opts.cwd ? sp3.join(opts.cwd, path19) : path19;
246046
+ let stats2;
246047
+ try {
246048
+ stats2 = await stat4(fullPath);
246049
+ } catch (err) {}
246050
+ if (!stats2 || this.closed)
246051
+ return;
246052
+ args.push(stats2);
246053
+ }
246054
+ this.emitWithAll(event, args);
246055
+ return this;
246056
+ }
246057
+ _handleError(error48) {
246058
+ const code2 = error48 && error48.code;
246059
+ if (error48 && code2 !== "ENOENT" && code2 !== "ENOTDIR" && (!this.options.ignorePermissionErrors || code2 !== "EPERM" && code2 !== "EACCES")) {
246060
+ this.emit(EVENTS.ERROR, error48);
246061
+ }
246062
+ return error48 || this.closed;
246063
+ }
246064
+ _throttle(actionType, path19, timeout3) {
246065
+ if (!this._throttled.has(actionType)) {
246066
+ this._throttled.set(actionType, new Map);
246067
+ }
246068
+ const action = this._throttled.get(actionType);
246069
+ if (!action)
246070
+ throw new Error("invalid throttle");
246071
+ const actionPath = action.get(path19);
246072
+ if (actionPath) {
246073
+ actionPath.count++;
246074
+ return false;
246075
+ }
246076
+ let timeoutObject;
246077
+ const clear = () => {
246078
+ const item = action.get(path19);
246079
+ const count2 = item ? item.count : 0;
246080
+ action.delete(path19);
246081
+ clearTimeout(timeoutObject);
246082
+ if (item)
246083
+ clearTimeout(item.timeoutObject);
246084
+ return count2;
246085
+ };
246086
+ timeoutObject = setTimeout(clear, timeout3);
246087
+ const thr = { timeoutObject, clear, count: 0 };
246088
+ action.set(path19, thr);
246089
+ return thr;
246090
+ }
246091
+ _incrReadyCount() {
246092
+ return this._readyCount++;
246093
+ }
246094
+ _awaitWriteFinish(path19, threshold, event, awfEmit) {
246095
+ const awf = this.options.awaitWriteFinish;
246096
+ if (typeof awf !== "object")
246097
+ return;
246098
+ const pollInterval = awf.pollInterval;
246099
+ let timeoutHandler;
246100
+ let fullPath = path19;
246101
+ if (this.options.cwd && !sp3.isAbsolute(path19)) {
246102
+ fullPath = sp3.join(this.options.cwd, path19);
246103
+ }
246104
+ const now = new Date;
246105
+ const writes = this._pendingWrites;
246106
+ function awaitWriteFinishFn(prevStat) {
246107
+ statcb(fullPath, (err, curStat) => {
246108
+ if (err || !writes.has(path19)) {
246109
+ if (err && err.code !== "ENOENT")
246110
+ awfEmit(err);
246111
+ return;
246112
+ }
246113
+ const now2 = Number(new Date);
246114
+ if (prevStat && curStat.size !== prevStat.size) {
246115
+ writes.get(path19).lastChange = now2;
246116
+ }
246117
+ const pw = writes.get(path19);
246118
+ const df3 = now2 - pw.lastChange;
246119
+ if (df3 >= threshold) {
246120
+ writes.delete(path19);
246121
+ awfEmit(undefined, curStat);
246122
+ } else {
246123
+ timeoutHandler = setTimeout(awaitWriteFinishFn, pollInterval, curStat);
246124
+ }
246125
+ });
246126
+ }
246127
+ if (!writes.has(path19)) {
246128
+ writes.set(path19, {
246129
+ lastChange: now,
246130
+ cancelWait: () => {
246131
+ writes.delete(path19);
246132
+ clearTimeout(timeoutHandler);
246133
+ return event;
246134
+ }
246135
+ });
246136
+ timeoutHandler = setTimeout(awaitWriteFinishFn, pollInterval);
246137
+ }
246138
+ }
246139
+ _isIgnored(path19, stats) {
246140
+ if (this.options.atomic && DOT_RE.test(path19))
246141
+ return true;
246142
+ if (!this._userIgnored) {
246143
+ const { cwd } = this.options;
246144
+ const ign = this.options.ignored;
246145
+ const ignored = (ign || []).map(normalizeIgnored(cwd));
246146
+ const ignoredPaths = [...this._ignoredPaths];
246147
+ const list3 = [...ignoredPaths.map(normalizeIgnored(cwd)), ...ignored];
246148
+ this._userIgnored = anymatch(list3, undefined);
246149
+ }
246150
+ return this._userIgnored(path19, stats);
246151
+ }
246152
+ _isntIgnored(path19, stat5) {
246153
+ return !this._isIgnored(path19, stat5);
246154
+ }
246155
+ _getWatchHelpers(path19) {
246156
+ return new WatchHelper(path19, this.options.followSymlinks, this);
246157
+ }
246158
+ _getWatchedDir(directory) {
246159
+ const dir = sp3.resolve(directory);
246160
+ if (!this._watched.has(dir))
246161
+ this._watched.set(dir, new DirEntry(dir, this._boundRemove));
246162
+ return this._watched.get(dir);
246163
+ }
246164
+ _hasReadPermissions(stats) {
246165
+ if (this.options.ignorePermissionErrors)
246166
+ return true;
246167
+ return Boolean(Number(stats.mode) & 256);
246168
+ }
246169
+ _remove(directory, item, isDirectory3) {
246170
+ const path19 = sp3.join(directory, item);
246171
+ const fullPath = sp3.resolve(path19);
246172
+ isDirectory3 = isDirectory3 != null ? isDirectory3 : this._watched.has(path19) || this._watched.has(fullPath);
246173
+ if (!this._throttle("remove", path19, 100))
246174
+ return;
246175
+ if (!isDirectory3 && this._watched.size === 1) {
246176
+ this.add(directory, item, true);
246177
+ }
246178
+ const wp5 = this._getWatchedDir(path19);
246179
+ const nestedDirectoryChildren = wp5.getChildren();
246180
+ nestedDirectoryChildren.forEach((nested) => this._remove(path19, nested));
246181
+ const parent = this._getWatchedDir(directory);
246182
+ const wasTracked = parent.has(item);
246183
+ parent.remove(item);
246184
+ if (this._symlinkPaths.has(fullPath)) {
246185
+ this._symlinkPaths.delete(fullPath);
246186
+ }
246187
+ let relPath = path19;
246188
+ if (this.options.cwd)
246189
+ relPath = sp3.relative(this.options.cwd, path19);
246190
+ if (this.options.awaitWriteFinish && this._pendingWrites.has(relPath)) {
246191
+ const event = this._pendingWrites.get(relPath).cancelWait();
246192
+ if (event === EVENTS.ADD)
246193
+ return;
246194
+ }
246195
+ this._watched.delete(path19);
246196
+ this._watched.delete(fullPath);
246197
+ const eventName = isDirectory3 ? EVENTS.UNLINK_DIR : EVENTS.UNLINK;
246198
+ if (wasTracked && !this._isIgnored(path19))
246199
+ this._emit(eventName, path19);
246200
+ this._closePath(path19);
246201
+ }
246202
+ _closePath(path19) {
246203
+ this._closeFile(path19);
246204
+ const dir = sp3.dirname(path19);
246205
+ this._getWatchedDir(dir).remove(sp3.basename(path19));
246206
+ }
246207
+ _closeFile(path19) {
246208
+ const closers = this._closers.get(path19);
246209
+ if (!closers)
246210
+ return;
246211
+ closers.forEach((closer) => closer());
246212
+ this._closers.delete(path19);
246213
+ }
246214
+ _addPathCloser(path19, closer) {
246215
+ if (!closer)
246216
+ return;
246217
+ let list3 = this._closers.get(path19);
246218
+ if (!list3) {
246219
+ list3 = [];
246220
+ this._closers.set(path19, list3);
246221
+ }
246222
+ list3.push(closer);
246223
+ }
246224
+ _readdirp(root2, opts) {
246225
+ if (this.closed)
246226
+ return;
246227
+ const options8 = { type: EVENTS.ALL, alwaysStat: true, lstat: true, ...opts, depth: 0 };
246228
+ let stream = readdirp(root2, options8);
246229
+ this._streams.add(stream);
246230
+ stream.once(STR_CLOSE, () => {
246231
+ stream = undefined;
246232
+ });
246233
+ stream.once(STR_END, () => {
246234
+ if (stream) {
246235
+ this._streams.delete(stream);
246236
+ stream = undefined;
246237
+ }
246238
+ });
246239
+ return stream;
246240
+ }
246241
+ }
246242
+ function watch(paths, options8 = {}) {
246243
+ const watcher = new FSWatcher(options8);
246244
+ watcher.add(paths);
246245
+ return watcher;
246246
+ }
246247
+
246248
+ // src/cli/dev/dev-server/watcher.ts
246249
+ var import_debounce = __toESM(require_debounce(), 1);
246250
+ var WATCH_DEBOUNCE_MS = 300;
246251
+ var WATCH_QUEUE_DELAY_MS = 500;
246252
+
246253
+ class WatchBase44 extends EventEmitter4 {
246254
+ itemsToWatch;
246255
+ logger;
246256
+ watchers = [];
246257
+ queueWaitForCreation = [];
246258
+ queueWaitForCreationTimeout = null;
246259
+ constructor(itemsToWatch, logger) {
246260
+ super();
246261
+ this.itemsToWatch = itemsToWatch;
246262
+ this.logger = logger;
246263
+ }
246264
+ async start() {
246265
+ if (this.watchers.length > 0 || this.queueWaitForCreation.length > 0) {
246266
+ return;
246267
+ }
246268
+ for (const item of this.itemsToWatch) {
246269
+ if (await pathExists(item.path)) {
246270
+ this.watchers.push(this.watchTarget(item));
246271
+ } else {
246272
+ this.queueWaitForCreation.push(item);
246273
+ }
246274
+ }
246275
+ this.watchCreationQueue();
246276
+ }
246277
+ async close() {
246278
+ if (this.queueWaitForCreationTimeout) {
246279
+ clearTimeout(this.queueWaitForCreationTimeout);
246280
+ this.queueWaitForCreationTimeout = null;
246281
+ }
246282
+ for (const watcher of this.watchers) {
246283
+ await watcher.close();
246284
+ }
246285
+ this.watchers = [];
246286
+ this.queueWaitForCreation = [];
246287
+ }
246288
+ watchCreationQueue() {
246289
+ if (this.queueWaitForCreationTimeout) {
246290
+ clearTimeout(this.queueWaitForCreationTimeout);
246291
+ }
246292
+ this.queueWaitForCreationTimeout = setTimeout(async () => {
246293
+ const toRemove = [];
246294
+ for (const entry of this.queueWaitForCreation) {
246295
+ if (await pathExists(entry.path)) {
246296
+ this.watchers.push(this.watchTarget(entry));
246297
+ toRemove.push(entry);
246298
+ }
246299
+ }
246300
+ this.queueWaitForCreation = this.queueWaitForCreation.filter((entry) => !toRemove.includes(entry));
246301
+ if (this.queueWaitForCreation.length > 0) {
246302
+ this.watchCreationQueue();
246303
+ } else {
246304
+ this.queueWaitForCreationTimeout = null;
246305
+ }
246306
+ }, WATCH_QUEUE_DELAY_MS);
246307
+ }
246308
+ watchTarget(item) {
246309
+ const handler = import_debounce.default(async (_event, path19) => {
246310
+ this.emit("change", item.name, relative4(item.path, path19));
246311
+ }, WATCH_DEBOUNCE_MS);
246312
+ const watcher = watch(item.path, {
246313
+ ignoreInitial: true
246314
+ });
246315
+ watcher.on("all", handler);
246316
+ watcher.on("unlinkDir", async (deletedPath) => {
246317
+ if (deletedPath !== item.path) {
246318
+ return;
246319
+ }
246320
+ await watcher.close();
246321
+ this.queueWaitForCreation.push(item);
246322
+ this.watchCreationQueue();
246323
+ setTimeout(() => {
246324
+ this.watchers = this.watchers.filter((watcher2) => !watcher2.closed);
246325
+ });
246326
+ });
246327
+ watcher.on("error", (err) => {
246328
+ this.logger.error(`Watch handler failed for ${item.path}`, err instanceof Error ? err : undefined);
246329
+ });
246330
+ return watcher;
246331
+ }
246332
+ }
246333
+
244271
246334
  // src/cli/dev/dev-server/main.ts
244272
246335
  var DEFAULT_PORT = 4400;
244273
246336
  var BASE44_APP_URL = "https://base44.app";
@@ -244275,7 +246338,7 @@ async function createDevServer(options8) {
244275
246338
  const { port: userPort } = options8;
244276
246339
  const port = userPort ?? await getPorts({ port: DEFAULT_PORT });
244277
246340
  const baseUrl = `http://localhost:${port}`;
244278
- const { functions, entities } = await options8.loadResources();
246341
+ const { functions, entities, project: project2 } = await options8.loadResources();
244279
246342
  const app = import_express4.default();
244280
246343
  const remoteProxy = import_http_proxy_middleware2.createProxyMiddleware({
244281
246344
  target: BASE44_APP_URL,
@@ -244295,10 +246358,10 @@ async function createDevServer(options8) {
244295
246358
  });
244296
246359
  const devLogger = createDevLogger();
244297
246360
  const functionManager = new FunctionManager(functions, devLogger);
246361
+ const functionRoutes = createFunctionRouter(functionManager, devLogger);
246362
+ app.use("/api/apps/:appId/functions", functionRoutes);
244298
246363
  if (functionManager.getFunctionNames().length > 0) {
244299
246364
  R2.info(`Loaded functions: ${functionManager.getFunctionNames().join(", ")}`);
244300
- const functionRoutes = createFunctionRouter(functionManager, devLogger);
244301
- app.use("/api/apps/:appId/functions", functionRoutes);
244302
246365
  }
244303
246366
  const db2 = new Database(entities);
244304
246367
  if (db2.getCollectionNames().length > 0) {
@@ -244317,8 +246380,8 @@ async function createDevServer(options8) {
244317
246380
  devLogger.warn(`"${req.originalUrl}" is not supported in local development, passing call to production`);
244318
246381
  remoteProxy(req, res, next);
244319
246382
  });
244320
- return new Promise((resolve6, reject) => {
244321
- const server = app.listen(port, "127.0.0.1", (err) => {
246383
+ const server = await new Promise((resolve8, reject) => {
246384
+ const s5 = app.listen(port, "127.0.0.1", (err) => {
244322
246385
  if (err) {
244323
246386
  if ("code" in err && err.code === "EADDRINUSE") {
244324
246387
  reject(new Error(`Port ${port} is already in use. Stop the other process and try again.`));
@@ -244326,24 +246389,48 @@ async function createDevServer(options8) {
244326
246389
  reject(err);
244327
246390
  }
244328
246391
  } else {
244329
- const io6 = createRealtimeServer(server);
244330
- emitEntityEvent = (appId, entityName, event) => {
244331
- broadcastEntityEvent(io6, appId, entityName, event);
244332
- };
244333
- const shutdown = () => {
244334
- io6.close();
244335
- functionManager.stopAll();
244336
- server.close();
244337
- };
244338
- process.on("SIGINT", shutdown);
244339
- process.on("SIGTERM", shutdown);
244340
- resolve6({
244341
- port,
244342
- server
244343
- });
246392
+ resolve8(s5);
244344
246393
  }
244345
246394
  });
244346
246395
  });
246396
+ const io6 = createRealtimeServer(server);
246397
+ emitEntityEvent = (appId, entityName, event) => {
246398
+ broadcastEntityEvent(io6, appId, entityName, event);
246399
+ };
246400
+ const base44ConfigWatcher = new WatchBase44([
246401
+ {
246402
+ name: "functions",
246403
+ path: join18(dirname14(project2.configPath), project2.functionsDir)
246404
+ }
246405
+ ], devLogger);
246406
+ base44ConfigWatcher.on("change", async (name2) => {
246407
+ try {
246408
+ if (name2 === "functions") {
246409
+ const { functions: functions2 } = await options8.loadResources();
246410
+ const previousFunctionCount = functionManager.getFunctionNames().length;
246411
+ functionManager.reload(functions2);
246412
+ const names = functionManager.getFunctionNames();
246413
+ if (names.length > 0) {
246414
+ devLogger.log(`Reloaded functions: ${names.sort().join(", ")}`);
246415
+ } else if (previousFunctionCount > 0) {
246416
+ devLogger.log("All functions removed");
246417
+ }
246418
+ }
246419
+ } catch (error48) {
246420
+ const errorMessage = error48 instanceof Error ? error48.message : String(error48);
246421
+ devLogger.error(errorMessage);
246422
+ }
246423
+ });
246424
+ await base44ConfigWatcher.start();
246425
+ const shutdown = () => {
246426
+ base44ConfigWatcher.close();
246427
+ io6.close();
246428
+ functionManager.stopAll();
246429
+ server.close();
246430
+ };
246431
+ process.on("SIGINT", shutdown);
246432
+ process.on("SIGTERM", shutdown);
246433
+ return { port, server };
244347
246434
  }
244348
246435
 
244349
246436
  // src/cli/commands/dev.ts
@@ -244367,8 +246454,8 @@ function getDevCommand(context) {
244367
246454
  }
244368
246455
 
244369
246456
  // src/cli/commands/project/eject.ts
244370
- import { resolve as resolve6 } from "node:path";
244371
- var import_lodash2 = __toESM(require_lodash(), 1);
246457
+ import { resolve as resolve8 } from "node:path";
246458
+ var import_kebabCase2 = __toESM(require_kebabCase(), 1);
244372
246459
  async function eject(options8) {
244373
246460
  const projects = await listProjects();
244374
246461
  const ejectableProjects = projects.filter((p4) => p4.isManagedSourceCode !== false);
@@ -244406,7 +246493,7 @@ async function eject(options8) {
244406
246493
  selectedProject = selected;
244407
246494
  }
244408
246495
  const projectId = selectedProject.id;
244409
- const suggestedPath = await isDirEmpty() ? `./` : `./${import_lodash2.default(selectedProject.name)}`;
246496
+ const suggestedPath = await isDirEmpty() ? `./` : `./${import_kebabCase2.default(selectedProject.name)}`;
244410
246497
  const selectedPath = options8.path ?? await Ze({
244411
246498
  message: "Where should we create your project?",
244412
246499
  placeholder: suggestedPath,
@@ -244416,7 +246503,7 @@ async function eject(options8) {
244416
246503
  Ne("Operation cancelled.");
244417
246504
  throw new CLIExitError(0);
244418
246505
  }
244419
- const resolvedPath = resolve6(selectedPath);
246506
+ const resolvedPath = resolve8(selectedPath);
244420
246507
  await runTask("Downloading your project's code...", async (updateMessage) => {
244421
246508
  await createProjectFilesForExistingProject({
244422
246509
  projectId,
@@ -244479,7 +246566,7 @@ function createProgram(context) {
244479
246566
  program2.addCommand(getAgentsCommand(context));
244480
246567
  program2.addCommand(getConnectorsCommand(context));
244481
246568
  program2.addCommand(getFunctionsDeployCommand(context));
244482
- program2.addCommand(getSecretsCommand(context), { hidden: true });
246569
+ program2.addCommand(getSecretsCommand(context));
244483
246570
  program2.addCommand(getSiteCommand(context));
244484
246571
  program2.addCommand(getTypesCommand(context));
244485
246572
  program2.addCommand(getDevCommand(context), { hidden: true });
@@ -244492,7 +246579,7 @@ var import_detect_agent = __toESM(require_dist5(), 1);
244492
246579
  import { release, type } from "node:os";
244493
246580
 
244494
246581
  // node_modules/posthog-node/dist/extensions/error-tracking/modifiers/module.node.mjs
244495
- import { dirname as dirname12, posix, sep } from "path";
246582
+ import { dirname as dirname15, posix, sep } from "path";
244496
246583
  function createModulerModifier() {
244497
246584
  const getModuleFromFileName = createGetModuleFromFilename();
244498
246585
  return async (frames) => {
@@ -244501,12 +246588,12 @@ function createModulerModifier() {
244501
246588
  return frames;
244502
246589
  };
244503
246590
  }
244504
- function createGetModuleFromFilename(basePath = process.argv[1] ? dirname12(process.argv[1]) : process.cwd(), isWindows4 = sep === "\\") {
244505
- const normalizedBase = isWindows4 ? normalizeWindowsPath2(basePath) : basePath;
246591
+ function createGetModuleFromFilename(basePath = process.argv[1] ? dirname15(process.argv[1]) : process.cwd(), isWindows5 = sep === "\\") {
246592
+ const normalizedBase = isWindows5 ? normalizeWindowsPath2(basePath) : basePath;
244506
246593
  return (filename) => {
244507
246594
  if (!filename)
244508
246595
  return;
244509
- const normalizedFilename = isWindows4 ? normalizeWindowsPath2(filename) : filename;
246596
+ const normalizedFilename = isWindows5 ? normalizeWindowsPath2(filename) : filename;
244510
246597
  let { dir, base: file2, ext } = posix.parse(normalizedFilename);
244511
246598
  if (ext === ".js" || ext === ".mjs" || ext === ".cjs")
244512
246599
  file2 = file2.slice(0, -1 * ext.length);
@@ -246779,14 +248866,14 @@ async function addSourceContext(frames) {
246779
248866
  return frames;
246780
248867
  }
246781
248868
  function getContextLinesFromFile(path19, ranges, output) {
246782
- return new Promise((resolve7) => {
248869
+ return new Promise((resolve9) => {
246783
248870
  const stream = createReadStream2(path19);
246784
248871
  const lineReaded = createInterface2({
246785
248872
  input: stream
246786
248873
  });
246787
248874
  function destroyStreamAndResolve() {
246788
248875
  stream.destroy();
246789
- resolve7();
248876
+ resolve9();
246790
248877
  }
246791
248878
  let lineNumber = 0;
246792
248879
  let currentRangeIndex = 0;
@@ -247898,15 +249985,15 @@ class PostHogBackendClient extends PostHogCoreStateless {
247898
249985
  return true;
247899
249986
  if (this.featureFlagsPoller === undefined)
247900
249987
  return false;
247901
- return new Promise((resolve7) => {
249988
+ return new Promise((resolve9) => {
247902
249989
  const timeout3 = setTimeout(() => {
247903
249990
  cleanup();
247904
- resolve7(false);
249991
+ resolve9(false);
247905
249992
  }, timeoutMs);
247906
249993
  const cleanup = this._events.on("localEvaluationFlagsLoaded", (count2) => {
247907
249994
  clearTimeout(timeout3);
247908
249995
  cleanup();
247909
- resolve7(count2 > 0);
249996
+ resolve9(count2 > 0);
247910
249997
  });
247911
249998
  });
247912
249999
  }
@@ -248719,4 +250806,4 @@ export {
248719
250806
  CLIExitError
248720
250807
  };
248721
250808
 
248722
- //# debugId=F8960F6C5439500F64756E2164756E21
250809
+ //# debugId=CF0F55B99A93F97864756E2164756E21