@base44-preview/cli 0.0.36-pr.353.e1b512d → 0.0.36-pr.353.ee448e6

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
@@ -175355,7 +175355,7 @@ var require_mime_types2 = __commonJS((exports) => {
175355
175355
  * MIT Licensed
175356
175356
  */
175357
175357
  var db2 = require_db2();
175358
- var extname2 = __require("path").extname;
175358
+ var extname3 = __require("path").extname;
175359
175359
  var EXTRACT_TYPE_REGEXP = /^\s*([^;\s]*)(?:;|\s|$)/;
175360
175360
  var TEXT_TYPE_REGEXP = /^text\//i;
175361
175361
  exports.charset = charset;
@@ -175410,7 +175410,7 @@ var require_mime_types2 = __commonJS((exports) => {
175410
175410
  if (!path18 || typeof path18 !== "string") {
175411
175411
  return false;
175412
175412
  }
175413
- var extension2 = extname2("x." + path18).toLowerCase().substr(1);
175413
+ var extension2 = extname3("x." + path18).toLowerCase().substr(1);
175414
175414
  if (!extension2) {
175415
175415
  return false;
175416
175416
  }
@@ -185402,7 +185402,7 @@ var require_mime_types3 = __commonJS((exports) => {
185402
185402
  * MIT Licensed
185403
185403
  */
185404
185404
  var db2 = require_db3();
185405
- var extname2 = __require("path").extname;
185405
+ var extname3 = __require("path").extname;
185406
185406
  var EXTRACT_TYPE_REGEXP = /^\s*([^;\s]*)(?:;|\s|$)/;
185407
185407
  var TEXT_TYPE_REGEXP = /^text\//i;
185408
185408
  exports.charset = charset;
@@ -185457,7 +185457,7 @@ var require_mime_types3 = __commonJS((exports) => {
185457
185457
  if (!path18 || typeof path18 !== "string") {
185458
185458
  return false;
185459
185459
  }
185460
- var extension2 = extname2("x." + path18).toLowerCase().substr(1);
185460
+ var extension2 = extname3("x." + path18).toLowerCase().substr(1);
185461
185461
  if (!extension2) {
185462
185462
  return false;
185463
185463
  }
@@ -187975,13 +187975,13 @@ var require_extension = __commonJS((exports, module) => {
187975
187975
 
187976
187976
  // node_modules/ws/lib/websocket.js
187977
187977
  var require_websocket2 = __commonJS((exports, module) => {
187978
- var EventEmitter3 = __require("events");
187978
+ var EventEmitter4 = __require("events");
187979
187979
  var https = __require("https");
187980
187980
  var http = __require("http");
187981
187981
  var net2 = __require("net");
187982
187982
  var tls = __require("tls");
187983
187983
  var { randomBytes: randomBytes2, createHash } = __require("crypto");
187984
- var { Duplex: Duplex4, Readable: Readable6 } = __require("stream");
187984
+ var { Duplex: Duplex4, Readable: Readable7 } = __require("stream");
187985
187985
  var { URL: URL2 } = __require("url");
187986
187986
  var PerMessageDeflate = require_permessage_deflate();
187987
187987
  var Receiver = require_receiver();
@@ -188008,7 +188008,7 @@ var require_websocket2 = __commonJS((exports, module) => {
188008
188008
  var readyStates = ["CONNECTING", "OPEN", "CLOSING", "CLOSED"];
188009
188009
  var subprotocolRegex = /^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/;
188010
188010
 
188011
- class WebSocket extends EventEmitter3 {
188011
+ class WebSocket extends EventEmitter4 {
188012
188012
  constructor(address, protocols, options8) {
188013
188013
  super();
188014
188014
  this._binaryType = BINARY_TYPES[0];
@@ -188797,7 +188797,7 @@ var require_stream6 = __commonJS((exports, module) => {
188797
188797
  };
188798
188798
  duplex2._final = function(callback) {
188799
188799
  if (ws8.readyState === ws8.CONNECTING) {
188800
- ws8.once("open", function open2() {
188800
+ ws8.once("open", function open3() {
188801
188801
  duplex2._final(callback);
188802
188802
  });
188803
188803
  return;
@@ -188821,7 +188821,7 @@ var require_stream6 = __commonJS((exports, module) => {
188821
188821
  };
188822
188822
  duplex2._write = function(chunk, encoding, callback) {
188823
188823
  if (ws8.readyState === ws8.CONNECTING) {
188824
- ws8.once("open", function open2() {
188824
+ ws8.once("open", function open3() {
188825
188825
  duplex2._write(chunk, encoding, callback);
188826
188826
  });
188827
188827
  return;
@@ -188882,7 +188882,7 @@ var require_subprotocol = __commonJS((exports, module) => {
188882
188882
 
188883
188883
  // node_modules/ws/lib/websocket-server.js
188884
188884
  var require_websocket_server = __commonJS((exports, module) => {
188885
- var EventEmitter3 = __require("events");
188885
+ var EventEmitter4 = __require("events");
188886
188886
  var http = __require("http");
188887
188887
  var { Duplex: Duplex4 } = __require("stream");
188888
188888
  var { createHash } = __require("crypto");
@@ -188896,7 +188896,7 @@ var require_websocket_server = __commonJS((exports, module) => {
188896
188896
  var CLOSING = 1;
188897
188897
  var CLOSED2 = 2;
188898
188898
 
188899
- class WebSocketServer extends EventEmitter3 {
188899
+ class WebSocketServer extends EventEmitter4 {
188900
188900
  constructor(options8, callback) {
188901
188901
  super();
188902
188902
  options8 = {
@@ -191433,13 +191433,13 @@ var require_broadcast_operator = __commonJS((exports) => {
191433
191433
  return true;
191434
191434
  }
191435
191435
  emitWithAck(ev2, ...args) {
191436
- return new Promise((resolve6, reject) => {
191436
+ return new Promise((resolve8, reject) => {
191437
191437
  args.push((err, responses) => {
191438
191438
  if (err) {
191439
191439
  err.responses = responses;
191440
191440
  return reject(err);
191441
191441
  } else {
191442
- return resolve6(responses);
191442
+ return resolve8(responses);
191443
191443
  }
191444
191444
  });
191445
191445
  this.emit(ev2, ...args);
@@ -191627,12 +191627,12 @@ var require_socket2 = __commonJS((exports) => {
191627
191627
  }
191628
191628
  emitWithAck(ev2, ...args) {
191629
191629
  const withErr = this.flags.timeout !== undefined;
191630
- return new Promise((resolve6, reject) => {
191630
+ return new Promise((resolve8, reject) => {
191631
191631
  args.push((arg1, arg2) => {
191632
191632
  if (withErr) {
191633
- return arg1 ? reject(arg1) : resolve6(arg2);
191633
+ return arg1 ? reject(arg1) : resolve8(arg2);
191634
191634
  } else {
191635
- return resolve6(arg1);
191635
+ return resolve8(arg1);
191636
191636
  }
191637
191637
  });
191638
191638
  this.emit(ev2, ...args);
@@ -192087,13 +192087,13 @@ var require_namespace = __commonJS((exports) => {
192087
192087
  return true;
192088
192088
  }
192089
192089
  serverSideEmitWithAck(ev2, ...args) {
192090
- return new Promise((resolve6, reject) => {
192090
+ return new Promise((resolve8, reject) => {
192091
192091
  args.push((err, responses) => {
192092
192092
  if (err) {
192093
192093
  err.responses = responses;
192094
192094
  return reject(err);
192095
192095
  } else {
192096
- return resolve6(responses);
192096
+ return resolve8(responses);
192097
192097
  }
192098
192098
  });
192099
192099
  this.serverSideEmit(ev2, ...args);
@@ -192777,7 +192777,7 @@ var require_cluster_adapter = __commonJS((exports) => {
192777
192777
  return localSockets;
192778
192778
  }
192779
192779
  const requestId = randomId();
192780
- return new Promise((resolve6, reject) => {
192780
+ return new Promise((resolve8, reject) => {
192781
192781
  const timeout3 = setTimeout(() => {
192782
192782
  const storedRequest2 = this.requests.get(requestId);
192783
192783
  if (storedRequest2) {
@@ -192787,7 +192787,7 @@ var require_cluster_adapter = __commonJS((exports) => {
192787
192787
  }, opts.flags.timeout || DEFAULT_TIMEOUT);
192788
192788
  const storedRequest = {
192789
192789
  type: MessageType.FETCH_SOCKETS,
192790
- resolve: resolve6,
192790
+ resolve: resolve8,
192791
192791
  timeout: timeout3,
192792
192792
  current: 0,
192793
192793
  expected: expectedResponseCount,
@@ -192997,7 +192997,7 @@ var require_cluster_adapter = __commonJS((exports) => {
192997
192997
  return localSockets;
192998
192998
  }
192999
192999
  const requestId = randomId();
193000
- return new Promise((resolve6, reject) => {
193000
+ return new Promise((resolve8, reject) => {
193001
193001
  const timeout3 = setTimeout(() => {
193002
193002
  const storedRequest2 = this.customRequests.get(requestId);
193003
193003
  if (storedRequest2) {
@@ -193007,7 +193007,7 @@ var require_cluster_adapter = __commonJS((exports) => {
193007
193007
  }, opts.flags.timeout || DEFAULT_TIMEOUT);
193008
193008
  const storedRequest = {
193009
193009
  type: MessageType.FETCH_SOCKETS,
193010
- resolve: resolve6,
193010
+ resolve: resolve8,
193011
193011
  timeout: timeout3,
193012
193012
  missingUids: new Set([...this.nodesMap.keys()]),
193013
193013
  responses: localSockets
@@ -193736,13 +193736,13 @@ var require_dist4 = __commonJS((exports, module) => {
193736
193736
  this.engine.close();
193737
193737
  (0, uws_1.restoreAdapter)();
193738
193738
  if (this.httpServer) {
193739
- return new Promise((resolve6) => {
193739
+ return new Promise((resolve8) => {
193740
193740
  this.httpServer.close((err) => {
193741
193741
  fn9 && fn9(err);
193742
193742
  if (err) {
193743
193743
  debug("server was not running");
193744
193744
  }
193745
- resolve6();
193745
+ resolve8();
193746
193746
  });
193747
193747
  });
193748
193748
  } else {
@@ -202478,7 +202478,7 @@ var require_mime_types4 = __commonJS((exports) => {
202478
202478
  * MIT Licensed
202479
202479
  */
202480
202480
  var db2 = require_db4();
202481
- var extname2 = __require("path").extname;
202481
+ var extname3 = __require("path").extname;
202482
202482
  var EXTRACT_TYPE_REGEXP = /^\s*([^;\s]*)(?:;|\s|$)/;
202483
202483
  var TEXT_TYPE_REGEXP = /^text\//i;
202484
202484
  exports.charset = charset;
@@ -202533,7 +202533,7 @@ var require_mime_types4 = __commonJS((exports) => {
202533
202533
  if (!path18 || typeof path18 !== "string") {
202534
202534
  return false;
202535
202535
  }
202536
- var extension2 = extname2("x." + path18).toLowerCase().substr(1);
202536
+ var extension2 = extname3("x." + path18).toLowerCase().substr(1);
202537
202537
  if (!extension2) {
202538
202538
  return false;
202539
202539
  }
@@ -202576,7 +202576,7 @@ var require_type_is2 = __commonJS((exports, module) => {
202576
202576
  module.exports = typeofrequest;
202577
202577
  module.exports.is = typeis;
202578
202578
  module.exports.hasBody = hasbody;
202579
- module.exports.normalize = normalize;
202579
+ module.exports.normalize = normalize2;
202580
202580
  module.exports.match = mimeMatch;
202581
202581
  function typeis(value, types_) {
202582
202582
  var i5;
@@ -202596,7 +202596,7 @@ var require_type_is2 = __commonJS((exports, module) => {
202596
202596
  }
202597
202597
  var type;
202598
202598
  for (i5 = 0;i5 < types.length; i5++) {
202599
- if (mimeMatch(normalize(type = types[i5]), val)) {
202599
+ if (mimeMatch(normalize2(type = types[i5]), val)) {
202600
202600
  return type[0] === "+" || type.indexOf("*") !== -1 ? val : type;
202601
202601
  }
202602
202602
  }
@@ -202619,7 +202619,7 @@ var require_type_is2 = __commonJS((exports, module) => {
202619
202619
  var value = req.headers["content-type"];
202620
202620
  return typeis(value, types);
202621
202621
  }
202622
- function normalize(type) {
202622
+ function normalize2(type) {
202623
202623
  if (typeof type !== "string") {
202624
202624
  return false;
202625
202625
  }
@@ -203040,7 +203040,7 @@ var require_utils12 = __commonJS((exports, module) => {
203040
203040
  if (decode4)
203041
203041
  return decode4(data, hint);
203042
203042
  }
203043
- function basename4(path18) {
203043
+ function basename6(path18) {
203044
203044
  if (typeof path18 !== "string")
203045
203045
  return "";
203046
203046
  for (let i5 = path18.length - 1;i5 >= 0; --i5) {
@@ -204344,7 +204344,7 @@ var require_utils12 = __commonJS((exports, module) => {
204344
204344
  -1
204345
204345
  ];
204346
204346
  module.exports = {
204347
- basename: basename4,
204347
+ basename: basename6,
204348
204348
  convertToUTF8,
204349
204349
  getDecoder,
204350
204350
  parseContentType,
@@ -204749,10 +204749,10 @@ var require_sbmh = __commonJS((exports, module) => {
204749
204749
 
204750
204750
  // node_modules/busboy/lib/types/multipart.js
204751
204751
  var require_multipart = __commonJS((exports, module) => {
204752
- var { Readable: Readable6, Writable: Writable4 } = __require("stream");
204752
+ var { Readable: Readable7, Writable: Writable4 } = __require("stream");
204753
204753
  var StreamSearch = require_sbmh();
204754
204754
  var {
204755
- basename: basename4,
204755
+ basename: basename6,
204756
204756
  convertToUTF8,
204757
204757
  getDecoder,
204758
204758
  parseContentType,
@@ -204907,7 +204907,7 @@ var require_multipart = __commonJS((exports, module) => {
204907
204907
  }
204908
204908
  }
204909
204909
 
204910
- class FileStream extends Readable6 {
204910
+ class FileStream extends Readable7 {
204911
204911
  constructor(opts, owner) {
204912
204912
  super(opts);
204913
204913
  this.truncated = false;
@@ -205014,7 +205014,7 @@ var require_multipart = __commonJS((exports, module) => {
205014
205014
  else if (disp.params.filename)
205015
205015
  filename = disp.params.filename;
205016
205016
  if (filename !== undefined && !preservePath)
205017
- filename = basename4(filename);
205017
+ filename = basename6(filename);
205018
205018
  }
205019
205019
  if (header2["content-type"]) {
205020
205020
  const conType = parseContentType(header2["content-type"][0]);
@@ -206499,12 +206499,12 @@ var require_append_field = __commonJS((exports, module) => {
206499
206499
 
206500
206500
  // node_modules/multer/lib/counter.js
206501
206501
  var require_counter = __commonJS((exports, module) => {
206502
- var EventEmitter3 = __require("events").EventEmitter;
206502
+ var EventEmitter4 = __require("events").EventEmitter;
206503
206503
  function Counter() {
206504
- EventEmitter3.call(this);
206504
+ EventEmitter4.call(this);
206505
206505
  this.value = 0;
206506
206506
  }
206507
- Counter.prototype = Object.create(EventEmitter3.prototype);
206507
+ Counter.prototype = Object.create(EventEmitter4.prototype);
206508
206508
  Counter.prototype.increment = function increment2() {
206509
206509
  this.value++;
206510
206510
  };
@@ -206865,8 +206865,8 @@ var require_mkdirp = __commonJS((exports, module) => {
206865
206865
  });
206866
206866
  break;
206867
206867
  default:
206868
- xfs.stat(p4, function(er22, stat2) {
206869
- if (er22 || !stat2.isDirectory())
206868
+ xfs.stat(p4, function(er22, stat5) {
206869
+ if (er22 || !stat5.isDirectory())
206870
206870
  cb2(er10, made);
206871
206871
  else
206872
206872
  cb2(null, made);
@@ -206897,13 +206897,13 @@ var require_mkdirp = __commonJS((exports, module) => {
206897
206897
  sync(p4, opts, made);
206898
206898
  break;
206899
206899
  default:
206900
- var stat2;
206900
+ var stat5;
206901
206901
  try {
206902
- stat2 = xfs.statSync(p4);
206902
+ stat5 = xfs.statSync(p4);
206903
206903
  } catch (err1) {
206904
206904
  throw err0;
206905
206905
  }
206906
- if (!stat2.isDirectory())
206906
+ if (!stat5.isDirectory())
206907
206907
  throw err0;
206908
206908
  break;
206909
206909
  }
@@ -207106,7 +207106,7 @@ var require_buffer_list = __commonJS((exports, module) => {
207106
207106
  }
207107
207107
  }, {
207108
207108
  key: "join",
207109
- value: function join16(s5) {
207109
+ value: function join18(s5) {
207110
207110
  if (this.length === 0)
207111
207111
  return "";
207112
207112
  var p4 = this.head;
@@ -207932,9 +207932,9 @@ var require__stream_duplex = __commonJS((exports, module) => {
207932
207932
  return keys2;
207933
207933
  };
207934
207934
  module.exports = Duplex4;
207935
- var Readable6 = require__stream_readable();
207935
+ var Readable7 = require__stream_readable();
207936
207936
  var Writable4 = require__stream_writable();
207937
- require_inherits()(Duplex4, Readable6);
207937
+ require_inherits()(Duplex4, Readable7);
207938
207938
  {
207939
207939
  keys = objectKeys(Writable4.prototype);
207940
207940
  for (v10 = 0;v10 < keys.length; v10++) {
@@ -207949,7 +207949,7 @@ var require__stream_duplex = __commonJS((exports, module) => {
207949
207949
  function Duplex4(options8) {
207950
207950
  if (!(this instanceof Duplex4))
207951
207951
  return new Duplex4(options8);
207952
- Readable6.call(this, options8);
207952
+ Readable7.call(this, options8);
207953
207953
  Writable4.call(this, options8);
207954
207954
  this.allowHalfOpen = true;
207955
207955
  if (options8) {
@@ -208461,14 +208461,14 @@ var require_async_iterator = __commonJS((exports, module) => {
208461
208461
  };
208462
208462
  }
208463
208463
  function readAndResolve(iter) {
208464
- var resolve6 = iter[kLastResolve];
208465
- if (resolve6 !== null) {
208464
+ var resolve8 = iter[kLastResolve];
208465
+ if (resolve8 !== null) {
208466
208466
  var data = iter[kStream].read();
208467
208467
  if (data !== null) {
208468
208468
  iter[kLastPromise] = null;
208469
208469
  iter[kLastResolve] = null;
208470
208470
  iter[kLastReject] = null;
208471
- resolve6(createIterResult(data, false));
208471
+ resolve8(createIterResult(data, false));
208472
208472
  }
208473
208473
  }
208474
208474
  }
@@ -208476,13 +208476,13 @@ var require_async_iterator = __commonJS((exports, module) => {
208476
208476
  process.nextTick(readAndResolve, iter);
208477
208477
  }
208478
208478
  function wrapForNext(lastPromise, iter) {
208479
- return function(resolve6, reject) {
208479
+ return function(resolve8, reject) {
208480
208480
  lastPromise.then(function() {
208481
208481
  if (iter[kEnded]) {
208482
- resolve6(createIterResult(undefined, true));
208482
+ resolve8(createIterResult(undefined, true));
208483
208483
  return;
208484
208484
  }
208485
- iter[kHandlePromise](resolve6, reject);
208485
+ iter[kHandlePromise](resolve8, reject);
208486
208486
  }, reject);
208487
208487
  };
208488
208488
  }
@@ -208501,12 +208501,12 @@ var require_async_iterator = __commonJS((exports, module) => {
208501
208501
  return Promise.resolve(createIterResult(undefined, true));
208502
208502
  }
208503
208503
  if (this[kStream].destroyed) {
208504
- return new Promise(function(resolve6, reject) {
208504
+ return new Promise(function(resolve8, reject) {
208505
208505
  process.nextTick(function() {
208506
208506
  if (_this[kError]) {
208507
208507
  reject(_this[kError]);
208508
208508
  } else {
208509
- resolve6(createIterResult(undefined, true));
208509
+ resolve8(createIterResult(undefined, true));
208510
208510
  }
208511
208511
  });
208512
208512
  });
@@ -208529,13 +208529,13 @@ var require_async_iterator = __commonJS((exports, module) => {
208529
208529
  return this;
208530
208530
  }), _defineProperty(_Object$setPrototypeO, "return", function _return() {
208531
208531
  var _this2 = this;
208532
- return new Promise(function(resolve6, reject) {
208532
+ return new Promise(function(resolve8, reject) {
208533
208533
  _this2[kStream].destroy(null, function(err) {
208534
208534
  if (err) {
208535
208535
  reject(err);
208536
208536
  return;
208537
208537
  }
208538
- resolve6(createIterResult(undefined, true));
208538
+ resolve8(createIterResult(undefined, true));
208539
208539
  });
208540
208540
  });
208541
208541
  }), _Object$setPrototypeO), AsyncIteratorPrototype);
@@ -208557,15 +208557,15 @@ var require_async_iterator = __commonJS((exports, module) => {
208557
208557
  value: stream._readableState.endEmitted,
208558
208558
  writable: true
208559
208559
  }), _defineProperty(_Object$create, kHandlePromise, {
208560
- value: function value(resolve6, reject) {
208560
+ value: function value(resolve8, reject) {
208561
208561
  var data = iterator[kStream].read();
208562
208562
  if (data) {
208563
208563
  iterator[kLastPromise] = null;
208564
208564
  iterator[kLastResolve] = null;
208565
208565
  iterator[kLastReject] = null;
208566
- resolve6(createIterResult(data, false));
208566
+ resolve8(createIterResult(data, false));
208567
208567
  } else {
208568
- iterator[kLastResolve] = resolve6;
208568
+ iterator[kLastResolve] = resolve8;
208569
208569
  iterator[kLastReject] = reject;
208570
208570
  }
208571
208571
  },
@@ -208584,12 +208584,12 @@ var require_async_iterator = __commonJS((exports, module) => {
208584
208584
  iterator[kError] = err;
208585
208585
  return;
208586
208586
  }
208587
- var resolve6 = iterator[kLastResolve];
208588
- if (resolve6 !== null) {
208587
+ var resolve8 = iterator[kLastResolve];
208588
+ if (resolve8 !== null) {
208589
208589
  iterator[kLastPromise] = null;
208590
208590
  iterator[kLastResolve] = null;
208591
208591
  iterator[kLastReject] = null;
208592
- resolve6(createIterResult(undefined, true));
208592
+ resolve8(createIterResult(undefined, true));
208593
208593
  }
208594
208594
  iterator[kEnded] = true;
208595
208595
  });
@@ -208601,7 +208601,7 @@ var require_async_iterator = __commonJS((exports, module) => {
208601
208601
 
208602
208602
  // node_modules/readable-stream/lib/internal/streams/from.js
208603
208603
  var require_from = __commonJS((exports, module) => {
208604
- function asyncGeneratorStep(gen, resolve6, reject, _next, _throw, key2, arg) {
208604
+ function asyncGeneratorStep(gen, resolve8, reject, _next, _throw, key2, arg) {
208605
208605
  try {
208606
208606
  var info = gen[key2](arg);
208607
208607
  var value = info.value;
@@ -208610,7 +208610,7 @@ var require_from = __commonJS((exports, module) => {
208610
208610
  return;
208611
208611
  }
208612
208612
  if (info.done) {
208613
- resolve6(value);
208613
+ resolve8(value);
208614
208614
  } else {
208615
208615
  Promise.resolve(value).then(_next, _throw);
208616
208616
  }
@@ -208618,13 +208618,13 @@ var require_from = __commonJS((exports, module) => {
208618
208618
  function _asyncToGenerator(fn9) {
208619
208619
  return function() {
208620
208620
  var self2 = this, args = arguments;
208621
- return new Promise(function(resolve6, reject) {
208621
+ return new Promise(function(resolve8, reject) {
208622
208622
  var gen = fn9.apply(self2, args);
208623
208623
  function _next(value) {
208624
- asyncGeneratorStep(gen, resolve6, reject, _next, _throw, "next", value);
208624
+ asyncGeneratorStep(gen, resolve8, reject, _next, _throw, "next", value);
208625
208625
  }
208626
208626
  function _throw(err) {
208627
- asyncGeneratorStep(gen, resolve6, reject, _next, _throw, "throw", err);
208627
+ asyncGeneratorStep(gen, resolve8, reject, _next, _throw, "throw", err);
208628
208628
  }
208629
208629
  _next(undefined);
208630
208630
  });
@@ -208677,7 +208677,7 @@ var require_from = __commonJS((exports, module) => {
208677
208677
  return (hint === "string" ? String : Number)(input);
208678
208678
  }
208679
208679
  var ERR_INVALID_ARG_TYPE = require_errors3().codes.ERR_INVALID_ARG_TYPE;
208680
- function from(Readable6, iterable, opts) {
208680
+ function from(Readable7, iterable, opts) {
208681
208681
  var iterator;
208682
208682
  if (iterable && typeof iterable.next === "function") {
208683
208683
  iterator = iterable;
@@ -208687,7 +208687,7 @@ var require_from = __commonJS((exports, module) => {
208687
208687
  iterator = iterable[Symbol.iterator]();
208688
208688
  else
208689
208689
  throw new ERR_INVALID_ARG_TYPE("iterable", ["Iterable"], iterable);
208690
- var readable2 = new Readable6(_objectSpread({
208690
+ var readable2 = new Readable7(_objectSpread({
208691
208691
  objectMode: true
208692
208692
  }, opts));
208693
208693
  var reading = false;
@@ -208724,9 +208724,9 @@ var require_from = __commonJS((exports, module) => {
208724
208724
 
208725
208725
  // node_modules/readable-stream/lib/_stream_readable.js
208726
208726
  var require__stream_readable = __commonJS((exports, module) => {
208727
- module.exports = Readable6;
208727
+ module.exports = Readable7;
208728
208728
  var Duplex4;
208729
- Readable6.ReadableState = ReadableState;
208729
+ Readable7.ReadableState = ReadableState;
208730
208730
  var EE3 = __require("events").EventEmitter;
208731
208731
  var EElistenerCount = function EElistenerCount2(emitter, type) {
208732
208732
  return emitter.listeners(type).length;
@@ -208759,7 +208759,7 @@ var require__stream_readable = __commonJS((exports, module) => {
208759
208759
  var StringDecoder4;
208760
208760
  var createReadableStreamAsyncIterator;
208761
208761
  var from;
208762
- require_inherits()(Readable6, Stream2);
208762
+ require_inherits()(Readable7, Stream2);
208763
208763
  var errorOrDestroy = destroyImpl.errorOrDestroy;
208764
208764
  var kProxyEvents = ["error", "close", "destroy", "pause", "resume"];
208765
208765
  function prependListener(emitter, event, fn9) {
@@ -208810,10 +208810,10 @@ var require__stream_readable = __commonJS((exports, module) => {
208810
208810
  this.encoding = options8.encoding;
208811
208811
  }
208812
208812
  }
208813
- function Readable6(options8) {
208813
+ function Readable7(options8) {
208814
208814
  Duplex4 = Duplex4 || require__stream_duplex();
208815
- if (!(this instanceof Readable6))
208816
- return new Readable6(options8);
208815
+ if (!(this instanceof Readable7))
208816
+ return new Readable7(options8);
208817
208817
  var isDuplex = this instanceof Duplex4;
208818
208818
  this._readableState = new ReadableState(options8, this, isDuplex);
208819
208819
  this.readable = true;
@@ -208825,7 +208825,7 @@ var require__stream_readable = __commonJS((exports, module) => {
208825
208825
  }
208826
208826
  Stream2.call(this);
208827
208827
  }
208828
- Object.defineProperty(Readable6.prototype, "destroyed", {
208828
+ Object.defineProperty(Readable7.prototype, "destroyed", {
208829
208829
  enumerable: false,
208830
208830
  get: function get() {
208831
208831
  if (this._readableState === undefined) {
@@ -208840,12 +208840,12 @@ var require__stream_readable = __commonJS((exports, module) => {
208840
208840
  this._readableState.destroyed = value;
208841
208841
  }
208842
208842
  });
208843
- Readable6.prototype.destroy = destroyImpl.destroy;
208844
- Readable6.prototype._undestroy = destroyImpl.undestroy;
208845
- Readable6.prototype._destroy = function(err, cb2) {
208843
+ Readable7.prototype.destroy = destroyImpl.destroy;
208844
+ Readable7.prototype._undestroy = destroyImpl.undestroy;
208845
+ Readable7.prototype._destroy = function(err, cb2) {
208846
208846
  cb2(err);
208847
208847
  };
208848
- Readable6.prototype.push = function(chunk, encoding) {
208848
+ Readable7.prototype.push = function(chunk, encoding) {
208849
208849
  var state = this._readableState;
208850
208850
  var skipChunkCheck;
208851
208851
  if (!state.objectMode) {
@@ -208862,7 +208862,7 @@ var require__stream_readable = __commonJS((exports, module) => {
208862
208862
  }
208863
208863
  return readableAddChunk(this, chunk, encoding, false, skipChunkCheck);
208864
208864
  };
208865
- Readable6.prototype.unshift = function(chunk) {
208865
+ Readable7.prototype.unshift = function(chunk) {
208866
208866
  return readableAddChunk(this, chunk, null, true, false);
208867
208867
  };
208868
208868
  function readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) {
@@ -208931,10 +208931,10 @@ var require__stream_readable = __commonJS((exports, module) => {
208931
208931
  }
208932
208932
  return er10;
208933
208933
  }
208934
- Readable6.prototype.isPaused = function() {
208934
+ Readable7.prototype.isPaused = function() {
208935
208935
  return this._readableState.flowing === false;
208936
208936
  };
208937
- Readable6.prototype.setEncoding = function(enc) {
208937
+ Readable7.prototype.setEncoding = function(enc) {
208938
208938
  if (!StringDecoder4)
208939
208939
  StringDecoder4 = require_string_decoder().StringDecoder;
208940
208940
  var decoder = new StringDecoder4(enc);
@@ -208988,7 +208988,7 @@ var require__stream_readable = __commonJS((exports, module) => {
208988
208988
  }
208989
208989
  return state.length;
208990
208990
  }
208991
- Readable6.prototype.read = function(n5) {
208991
+ Readable7.prototype.read = function(n5) {
208992
208992
  debug("read", n5);
208993
208993
  n5 = parseInt(n5, 10);
208994
208994
  var state = this._readableState;
@@ -209109,10 +209109,10 @@ var require__stream_readable = __commonJS((exports, module) => {
209109
209109
  }
209110
209110
  state.readingMore = false;
209111
209111
  }
209112
- Readable6.prototype._read = function(n5) {
209112
+ Readable7.prototype._read = function(n5) {
209113
209113
  errorOrDestroy(this, new ERR_METHOD_NOT_IMPLEMENTED("_read()"));
209114
209114
  };
209115
- Readable6.prototype.pipe = function(dest, pipeOpts) {
209115
+ Readable7.prototype.pipe = function(dest, pipeOpts) {
209116
209116
  var src = this;
209117
209117
  var state = this._readableState;
209118
209118
  switch (state.pipesCount) {
@@ -209220,7 +209220,7 @@ var require__stream_readable = __commonJS((exports, module) => {
209220
209220
  }
209221
209221
  };
209222
209222
  }
209223
- Readable6.prototype.unpipe = function(dest) {
209223
+ Readable7.prototype.unpipe = function(dest) {
209224
209224
  var state = this._readableState;
209225
209225
  var unpipeInfo = {
209226
209226
  hasUnpiped: false
@@ -209261,7 +209261,7 @@ var require__stream_readable = __commonJS((exports, module) => {
209261
209261
  dest.emit("unpipe", this, unpipeInfo);
209262
209262
  return this;
209263
209263
  };
209264
- Readable6.prototype.on = function(ev2, fn9) {
209264
+ Readable7.prototype.on = function(ev2, fn9) {
209265
209265
  var res = Stream2.prototype.on.call(this, ev2, fn9);
209266
209266
  var state = this._readableState;
209267
209267
  if (ev2 === "data") {
@@ -209283,15 +209283,15 @@ var require__stream_readable = __commonJS((exports, module) => {
209283
209283
  }
209284
209284
  return res;
209285
209285
  };
209286
- Readable6.prototype.addListener = Readable6.prototype.on;
209287
- Readable6.prototype.removeListener = function(ev2, fn9) {
209286
+ Readable7.prototype.addListener = Readable7.prototype.on;
209287
+ Readable7.prototype.removeListener = function(ev2, fn9) {
209288
209288
  var res = Stream2.prototype.removeListener.call(this, ev2, fn9);
209289
209289
  if (ev2 === "readable") {
209290
209290
  process.nextTick(updateReadableListening, this);
209291
209291
  }
209292
209292
  return res;
209293
209293
  };
209294
- Readable6.prototype.removeAllListeners = function(ev2) {
209294
+ Readable7.prototype.removeAllListeners = function(ev2) {
209295
209295
  var res = Stream2.prototype.removeAllListeners.apply(this, arguments);
209296
209296
  if (ev2 === "readable" || ev2 === undefined) {
209297
209297
  process.nextTick(updateReadableListening, this);
@@ -209311,7 +209311,7 @@ var require__stream_readable = __commonJS((exports, module) => {
209311
209311
  debug("readable nexttick read 0");
209312
209312
  self2.read(0);
209313
209313
  }
209314
- Readable6.prototype.resume = function() {
209314
+ Readable7.prototype.resume = function() {
209315
209315
  var state = this._readableState;
209316
209316
  if (!state.flowing) {
209317
209317
  debug("resume");
@@ -209338,7 +209338,7 @@ var require__stream_readable = __commonJS((exports, module) => {
209338
209338
  if (state.flowing && !state.reading)
209339
209339
  stream.read(0);
209340
209340
  }
209341
- Readable6.prototype.pause = function() {
209341
+ Readable7.prototype.pause = function() {
209342
209342
  debug("call pause flowing=%j", this._readableState.flowing);
209343
209343
  if (this._readableState.flowing !== false) {
209344
209344
  debug("pause");
@@ -209354,7 +209354,7 @@ var require__stream_readable = __commonJS((exports, module) => {
209354
209354
  while (state.flowing && stream.read() !== null)
209355
209355
  ;
209356
209356
  }
209357
- Readable6.prototype.wrap = function(stream) {
209357
+ Readable7.prototype.wrap = function(stream) {
209358
209358
  var _this = this;
209359
209359
  var state = this._readableState;
209360
209360
  var paused = false;
@@ -209403,26 +209403,26 @@ var require__stream_readable = __commonJS((exports, module) => {
209403
209403
  return this;
209404
209404
  };
209405
209405
  if (typeof Symbol === "function") {
209406
- Readable6.prototype[Symbol.asyncIterator] = function() {
209406
+ Readable7.prototype[Symbol.asyncIterator] = function() {
209407
209407
  if (createReadableStreamAsyncIterator === undefined) {
209408
209408
  createReadableStreamAsyncIterator = require_async_iterator();
209409
209409
  }
209410
209410
  return createReadableStreamAsyncIterator(this);
209411
209411
  };
209412
209412
  }
209413
- Object.defineProperty(Readable6.prototype, "readableHighWaterMark", {
209413
+ Object.defineProperty(Readable7.prototype, "readableHighWaterMark", {
209414
209414
  enumerable: false,
209415
209415
  get: function get() {
209416
209416
  return this._readableState.highWaterMark;
209417
209417
  }
209418
209418
  });
209419
- Object.defineProperty(Readable6.prototype, "readableBuffer", {
209419
+ Object.defineProperty(Readable7.prototype, "readableBuffer", {
209420
209420
  enumerable: false,
209421
209421
  get: function get() {
209422
209422
  return this._readableState && this._readableState.buffer;
209423
209423
  }
209424
209424
  });
209425
- Object.defineProperty(Readable6.prototype, "readableFlowing", {
209425
+ Object.defineProperty(Readable7.prototype, "readableFlowing", {
209426
209426
  enumerable: false,
209427
209427
  get: function get() {
209428
209428
  return this._readableState.flowing;
@@ -209433,8 +209433,8 @@ var require__stream_readable = __commonJS((exports, module) => {
209433
209433
  }
209434
209434
  }
209435
209435
  });
209436
- Readable6._fromList = fromList;
209437
- Object.defineProperty(Readable6.prototype, "readableLength", {
209436
+ Readable7._fromList = fromList;
209437
+ Object.defineProperty(Readable7.prototype, "readableLength", {
209438
209438
  enumerable: false,
209439
209439
  get: function get() {
209440
209440
  return this._readableState.length;
@@ -209482,11 +209482,11 @@ var require__stream_readable = __commonJS((exports, module) => {
209482
209482
  }
209483
209483
  }
209484
209484
  if (typeof Symbol === "function") {
209485
- Readable6.from = function(iterable, opts) {
209485
+ Readable7.from = function(iterable, opts) {
209486
209486
  if (from === undefined) {
209487
209487
  from = require_from();
209488
209488
  }
209489
- return from(Readable6, iterable, opts);
209489
+ return from(Readable7, iterable, opts);
209490
209490
  };
209491
209491
  }
209492
209492
  function indexOf(xs8, x10) {
@@ -210589,8 +210589,8 @@ var require_dist5 = __commonJS((exports, module) => {
210589
210589
  determineAgent: () => determineAgent
210590
210590
  });
210591
210591
  module.exports = __toCommonJS(src_exports);
210592
- var import_promises19 = __require("node:fs/promises");
210593
- var import_node_fs20 = __require("node:fs");
210592
+ var import_promises22 = __require("node:fs/promises");
210593
+ var import_node_fs21 = __require("node:fs");
210594
210594
  var DEVIN_LOCAL_PATH = "/opt/.devin";
210595
210595
  var CURSOR2 = "cursor";
210596
210596
  var CURSOR_CLI = "cursor-cli";
@@ -210647,7 +210647,7 @@ var require_dist5 = __commonJS((exports, module) => {
210647
210647
  return { isAgent: true, agent: { name: REPLIT } };
210648
210648
  }
210649
210649
  try {
210650
- await (0, import_promises19.access)(DEVIN_LOCAL_PATH, import_node_fs20.constants.F_OK);
210650
+ await (0, import_promises22.access)(DEVIN_LOCAL_PATH, import_node_fs21.constants.F_OK);
210651
210651
  return { isAgent: true, agent: { name: DEVIN } };
210652
210652
  } catch (error48) {}
210653
210653
  return { isAgent: false, agent: undefined };
@@ -241908,10 +241908,11 @@ var package_default = {
241908
241908
  "@types/express": "^5.0.6",
241909
241909
  "@types/json-schema": "^7.0.15",
241910
241910
  "@types/lodash": "^4.17.24",
241911
- "@types/node": "^22.10.5",
241912
241911
  "@types/multer": "^2.0.0",
241912
+ "@types/node": "^22.10.5",
241913
241913
  "@vercel/detect-agent": "^1.1.0",
241914
241914
  chalk: "^5.6.2",
241915
+ chokidar: "^5.0.0",
241915
241916
  commander: "^12.1.0",
241916
241917
  "common-tags": "^1.8.2",
241917
241918
  cors: "^2.8.5",
@@ -241928,8 +241929,8 @@ var package_default = {
241928
241929
  knip: "^5.83.1",
241929
241930
  ky: "^1.14.2",
241930
241931
  lodash: "^4.17.23",
241931
- multer: "^2.0.0",
241932
241932
  msw: "^2.12.10",
241933
+ multer: "^2.0.0",
241933
241934
  nanoid: "^5.1.6",
241934
241935
  open: "^11.0.0",
241935
241936
  "p-wait-for": "^6.0.0",
@@ -243859,7 +243860,7 @@ function getTypesCommand(context) {
243859
243860
  }
243860
243861
 
243861
243862
  // src/cli/dev/dev-server/main.ts
243862
- import { dirname as dirname13, join as join16 } from "node:path";
243863
+ import { dirname as dirname15, join as join18 } from "node:path";
243863
243864
  var import_cors = __toESM(require_lib4(), 1);
243864
243865
  var import_express4 = __toESM(require_express(), 1);
243865
243866
 
@@ -244127,7 +244128,9 @@ class FunctionManager {
244127
244128
  }
244128
244129
  });
244129
244130
  process21.on("exit", (code2) => {
244130
- this.logger.log(`[dev-server] Function "${name2}" exited with code ${code2}`);
244131
+ if (code2 !== null) {
244132
+ this.logger.log(`[dev-server] Function "${name2}" exited with code ${code2}`);
244133
+ }
244131
244134
  this.running.delete(name2);
244132
244135
  });
244133
244136
  process21.on("error", (error48) => {
@@ -244231,10 +244234,1622 @@ class Database {
244231
244234
  }
244232
244235
  }
244233
244236
 
244237
+ // src/cli/dev/dev-server/dir-watcher.ts
244238
+ import { dirname as dirname14 } from "node:path";
244239
+
244240
+ // node_modules/chokidar/index.js
244241
+ import { EventEmitter as EventEmitter3 } from "node:events";
244242
+ import { stat as statcb, Stats } from "node:fs";
244243
+ import { readdir as readdir3, stat as stat4 } from "node:fs/promises";
244244
+ import * as sp3 from "node:path";
244245
+
244246
+ // node_modules/readdirp/index.js
244247
+ import { lstat as lstat2, readdir as readdir2, realpath, stat as stat2 } from "node:fs/promises";
244248
+ import { join as pjoin, relative as prelative, resolve as presolve, sep as psep } from "node:path";
244249
+ import { Readable as Readable6 } from "node:stream";
244250
+ var EntryTypes = {
244251
+ FILE_TYPE: "files",
244252
+ DIR_TYPE: "directories",
244253
+ FILE_DIR_TYPE: "files_directories",
244254
+ EVERYTHING_TYPE: "all"
244255
+ };
244256
+ var defaultOptions = {
244257
+ root: ".",
244258
+ fileFilter: (_entryInfo) => true,
244259
+ directoryFilter: (_entryInfo) => true,
244260
+ type: EntryTypes.FILE_TYPE,
244261
+ lstat: false,
244262
+ depth: 2147483648,
244263
+ alwaysStat: false,
244264
+ highWaterMark: 4096
244265
+ };
244266
+ Object.freeze(defaultOptions);
244267
+ var RECURSIVE_ERROR_CODE = "READDIRP_RECURSIVE_ERROR";
244268
+ var NORMAL_FLOW_ERRORS = new Set(["ENOENT", "EPERM", "EACCES", "ELOOP", RECURSIVE_ERROR_CODE]);
244269
+ var ALL_TYPES = [
244270
+ EntryTypes.DIR_TYPE,
244271
+ EntryTypes.EVERYTHING_TYPE,
244272
+ EntryTypes.FILE_DIR_TYPE,
244273
+ EntryTypes.FILE_TYPE
244274
+ ];
244275
+ var DIR_TYPES = new Set([
244276
+ EntryTypes.DIR_TYPE,
244277
+ EntryTypes.EVERYTHING_TYPE,
244278
+ EntryTypes.FILE_DIR_TYPE
244279
+ ]);
244280
+ var FILE_TYPES2 = new Set([
244281
+ EntryTypes.EVERYTHING_TYPE,
244282
+ EntryTypes.FILE_DIR_TYPE,
244283
+ EntryTypes.FILE_TYPE
244284
+ ]);
244285
+ var isNormalFlowError = (error48) => NORMAL_FLOW_ERRORS.has(error48.code);
244286
+ var wantBigintFsStats = process.platform === "win32";
244287
+ var emptyFn = (_entryInfo) => true;
244288
+ var normalizeFilter = (filter2) => {
244289
+ if (filter2 === undefined)
244290
+ return emptyFn;
244291
+ if (typeof filter2 === "function")
244292
+ return filter2;
244293
+ if (typeof filter2 === "string") {
244294
+ const fl6 = filter2.trim();
244295
+ return (entry) => entry.basename === fl6;
244296
+ }
244297
+ if (Array.isArray(filter2)) {
244298
+ const trItems = filter2.map((item) => item.trim());
244299
+ return (entry) => trItems.some((f7) => entry.basename === f7);
244300
+ }
244301
+ return emptyFn;
244302
+ };
244303
+
244304
+ class ReaddirpStream extends Readable6 {
244305
+ parents;
244306
+ reading;
244307
+ parent;
244308
+ _stat;
244309
+ _maxDepth;
244310
+ _wantsDir;
244311
+ _wantsFile;
244312
+ _wantsEverything;
244313
+ _root;
244314
+ _isDirent;
244315
+ _statsProp;
244316
+ _rdOptions;
244317
+ _fileFilter;
244318
+ _directoryFilter;
244319
+ constructor(options8 = {}) {
244320
+ super({
244321
+ objectMode: true,
244322
+ autoDestroy: true,
244323
+ highWaterMark: options8.highWaterMark
244324
+ });
244325
+ const opts = { ...defaultOptions, ...options8 };
244326
+ const { root: root2, type } = opts;
244327
+ this._fileFilter = normalizeFilter(opts.fileFilter);
244328
+ this._directoryFilter = normalizeFilter(opts.directoryFilter);
244329
+ const statMethod = opts.lstat ? lstat2 : stat2;
244330
+ if (wantBigintFsStats) {
244331
+ this._stat = (path18) => statMethod(path18, { bigint: true });
244332
+ } else {
244333
+ this._stat = statMethod;
244334
+ }
244335
+ this._maxDepth = opts.depth != null && Number.isSafeInteger(opts.depth) ? opts.depth : defaultOptions.depth;
244336
+ this._wantsDir = type ? DIR_TYPES.has(type) : false;
244337
+ this._wantsFile = type ? FILE_TYPES2.has(type) : false;
244338
+ this._wantsEverything = type === EntryTypes.EVERYTHING_TYPE;
244339
+ this._root = presolve(root2);
244340
+ this._isDirent = !opts.alwaysStat;
244341
+ this._statsProp = this._isDirent ? "dirent" : "stats";
244342
+ this._rdOptions = { encoding: "utf8", withFileTypes: this._isDirent };
244343
+ this.parents = [this._exploreDir(root2, 1)];
244344
+ this.reading = false;
244345
+ this.parent = undefined;
244346
+ }
244347
+ async _read(batch) {
244348
+ if (this.reading)
244349
+ return;
244350
+ this.reading = true;
244351
+ try {
244352
+ while (!this.destroyed && batch > 0) {
244353
+ const par = this.parent;
244354
+ const fil = par && par.files;
244355
+ if (fil && fil.length > 0) {
244356
+ const { path: path18, depth } = par;
244357
+ const slice = fil.splice(0, batch).map((dirent) => this._formatEntry(dirent, path18));
244358
+ const awaited = await Promise.all(slice);
244359
+ for (const entry of awaited) {
244360
+ if (!entry)
244361
+ continue;
244362
+ if (this.destroyed)
244363
+ return;
244364
+ const entryType = await this._getEntryType(entry);
244365
+ if (entryType === "directory" && this._directoryFilter(entry)) {
244366
+ if (depth <= this._maxDepth) {
244367
+ this.parents.push(this._exploreDir(entry.fullPath, depth + 1));
244368
+ }
244369
+ if (this._wantsDir) {
244370
+ this.push(entry);
244371
+ batch--;
244372
+ }
244373
+ } else if ((entryType === "file" || this._includeAsFile(entry)) && this._fileFilter(entry)) {
244374
+ if (this._wantsFile) {
244375
+ this.push(entry);
244376
+ batch--;
244377
+ }
244378
+ }
244379
+ }
244380
+ } else {
244381
+ const parent = this.parents.pop();
244382
+ if (!parent) {
244383
+ this.push(null);
244384
+ break;
244385
+ }
244386
+ this.parent = await parent;
244387
+ if (this.destroyed)
244388
+ return;
244389
+ }
244390
+ }
244391
+ } catch (error48) {
244392
+ this.destroy(error48);
244393
+ } finally {
244394
+ this.reading = false;
244395
+ }
244396
+ }
244397
+ async _exploreDir(path18, depth) {
244398
+ let files;
244399
+ try {
244400
+ files = await readdir2(path18, this._rdOptions);
244401
+ } catch (error48) {
244402
+ this._onError(error48);
244403
+ }
244404
+ return { files, depth, path: path18 };
244405
+ }
244406
+ async _formatEntry(dirent, path18) {
244407
+ let entry;
244408
+ const basename4 = this._isDirent ? dirent.name : dirent;
244409
+ try {
244410
+ const fullPath = presolve(pjoin(path18, basename4));
244411
+ entry = { path: prelative(this._root, fullPath), fullPath, basename: basename4 };
244412
+ entry[this._statsProp] = this._isDirent ? dirent : await this._stat(fullPath);
244413
+ } catch (err) {
244414
+ this._onError(err);
244415
+ return;
244416
+ }
244417
+ return entry;
244418
+ }
244419
+ _onError(err) {
244420
+ if (isNormalFlowError(err) && !this.destroyed) {
244421
+ this.emit("warn", err);
244422
+ } else {
244423
+ this.destroy(err);
244424
+ }
244425
+ }
244426
+ async _getEntryType(entry) {
244427
+ if (!entry && this._statsProp in entry) {
244428
+ return "";
244429
+ }
244430
+ const stats = entry[this._statsProp];
244431
+ if (stats.isFile())
244432
+ return "file";
244433
+ if (stats.isDirectory())
244434
+ return "directory";
244435
+ if (stats && stats.isSymbolicLink()) {
244436
+ const full = entry.fullPath;
244437
+ try {
244438
+ const entryRealPath = await realpath(full);
244439
+ const entryRealPathStats = await lstat2(entryRealPath);
244440
+ if (entryRealPathStats.isFile()) {
244441
+ return "file";
244442
+ }
244443
+ if (entryRealPathStats.isDirectory()) {
244444
+ const len = entryRealPath.length;
244445
+ if (full.startsWith(entryRealPath) && full.substr(len, 1) === psep) {
244446
+ const recursiveError = new Error(`Circular symlink detected: "${full}" points to "${entryRealPath}"`);
244447
+ recursiveError.code = RECURSIVE_ERROR_CODE;
244448
+ return this._onError(recursiveError);
244449
+ }
244450
+ return "directory";
244451
+ }
244452
+ } catch (error48) {
244453
+ this._onError(error48);
244454
+ return "";
244455
+ }
244456
+ }
244457
+ }
244458
+ _includeAsFile(entry) {
244459
+ const stats = entry && entry[this._statsProp];
244460
+ return stats && this._wantsEverything && !stats.isDirectory();
244461
+ }
244462
+ }
244463
+ function readdirp(root2, options8 = {}) {
244464
+ let type = options8.entryType || options8.type;
244465
+ if (type === "both")
244466
+ type = EntryTypes.FILE_DIR_TYPE;
244467
+ if (type)
244468
+ options8.type = type;
244469
+ if (!root2) {
244470
+ throw new Error("readdirp: root argument is required. Usage: readdirp(root, options)");
244471
+ } else if (typeof root2 !== "string") {
244472
+ throw new TypeError("readdirp: root argument must be a string. Usage: readdirp(root, options)");
244473
+ } else if (type && !ALL_TYPES.includes(type)) {
244474
+ throw new Error(`readdirp: Invalid type passed. Use one of ${ALL_TYPES.join(", ")}`);
244475
+ }
244476
+ options8.root = root2;
244477
+ return new ReaddirpStream(options8);
244478
+ }
244479
+
244480
+ // node_modules/chokidar/handler.js
244481
+ import { watch as fs_watch, unwatchFile, watchFile } from "node:fs";
244482
+ import { realpath as fsrealpath, lstat as lstat3, open as open2, stat as stat3 } from "node:fs/promises";
244483
+ import { type as osType } from "node:os";
244484
+ import * as sp2 from "node:path";
244485
+ var STR_DATA = "data";
244486
+ var STR_END = "end";
244487
+ var STR_CLOSE = "close";
244488
+ var EMPTY_FN = () => {};
244489
+ var pl6 = process.platform;
244490
+ var isWindows4 = pl6 === "win32";
244491
+ var isMacos = pl6 === "darwin";
244492
+ var isLinux = pl6 === "linux";
244493
+ var isFreeBSD = pl6 === "freebsd";
244494
+ var isIBMi = osType() === "OS400";
244495
+ var EVENTS = {
244496
+ ALL: "all",
244497
+ READY: "ready",
244498
+ ADD: "add",
244499
+ CHANGE: "change",
244500
+ ADD_DIR: "addDir",
244501
+ UNLINK: "unlink",
244502
+ UNLINK_DIR: "unlinkDir",
244503
+ RAW: "raw",
244504
+ ERROR: "error"
244505
+ };
244506
+ var EV = EVENTS;
244507
+ var THROTTLE_MODE_WATCH = "watch";
244508
+ var statMethods = { lstat: lstat3, stat: stat3 };
244509
+ var KEY_LISTENERS = "listeners";
244510
+ var KEY_ERR = "errHandlers";
244511
+ var KEY_RAW = "rawEmitters";
244512
+ var HANDLER_KEYS2 = [KEY_LISTENERS, KEY_ERR, KEY_RAW];
244513
+ var binaryExtensions = new Set([
244514
+ "3dm",
244515
+ "3ds",
244516
+ "3g2",
244517
+ "3gp",
244518
+ "7z",
244519
+ "a",
244520
+ "aac",
244521
+ "adp",
244522
+ "afdesign",
244523
+ "afphoto",
244524
+ "afpub",
244525
+ "ai",
244526
+ "aif",
244527
+ "aiff",
244528
+ "alz",
244529
+ "ape",
244530
+ "apk",
244531
+ "appimage",
244532
+ "ar",
244533
+ "arj",
244534
+ "asf",
244535
+ "au",
244536
+ "avi",
244537
+ "bak",
244538
+ "baml",
244539
+ "bh",
244540
+ "bin",
244541
+ "bk",
244542
+ "bmp",
244543
+ "btif",
244544
+ "bz2",
244545
+ "bzip2",
244546
+ "cab",
244547
+ "caf",
244548
+ "cgm",
244549
+ "class",
244550
+ "cmx",
244551
+ "cpio",
244552
+ "cr2",
244553
+ "cur",
244554
+ "dat",
244555
+ "dcm",
244556
+ "deb",
244557
+ "dex",
244558
+ "djvu",
244559
+ "dll",
244560
+ "dmg",
244561
+ "dng",
244562
+ "doc",
244563
+ "docm",
244564
+ "docx",
244565
+ "dot",
244566
+ "dotm",
244567
+ "dra",
244568
+ "DS_Store",
244569
+ "dsk",
244570
+ "dts",
244571
+ "dtshd",
244572
+ "dvb",
244573
+ "dwg",
244574
+ "dxf",
244575
+ "ecelp4800",
244576
+ "ecelp7470",
244577
+ "ecelp9600",
244578
+ "egg",
244579
+ "eol",
244580
+ "eot",
244581
+ "epub",
244582
+ "exe",
244583
+ "f4v",
244584
+ "fbs",
244585
+ "fh",
244586
+ "fla",
244587
+ "flac",
244588
+ "flatpak",
244589
+ "fli",
244590
+ "flv",
244591
+ "fpx",
244592
+ "fst",
244593
+ "fvt",
244594
+ "g3",
244595
+ "gh",
244596
+ "gif",
244597
+ "graffle",
244598
+ "gz",
244599
+ "gzip",
244600
+ "h261",
244601
+ "h263",
244602
+ "h264",
244603
+ "icns",
244604
+ "ico",
244605
+ "ief",
244606
+ "img",
244607
+ "ipa",
244608
+ "iso",
244609
+ "jar",
244610
+ "jpeg",
244611
+ "jpg",
244612
+ "jpgv",
244613
+ "jpm",
244614
+ "jxr",
244615
+ "key",
244616
+ "ktx",
244617
+ "lha",
244618
+ "lib",
244619
+ "lvp",
244620
+ "lz",
244621
+ "lzh",
244622
+ "lzma",
244623
+ "lzo",
244624
+ "m3u",
244625
+ "m4a",
244626
+ "m4v",
244627
+ "mar",
244628
+ "mdi",
244629
+ "mht",
244630
+ "mid",
244631
+ "midi",
244632
+ "mj2",
244633
+ "mka",
244634
+ "mkv",
244635
+ "mmr",
244636
+ "mng",
244637
+ "mobi",
244638
+ "mov",
244639
+ "movie",
244640
+ "mp3",
244641
+ "mp4",
244642
+ "mp4a",
244643
+ "mpeg",
244644
+ "mpg",
244645
+ "mpga",
244646
+ "mxu",
244647
+ "nef",
244648
+ "npx",
244649
+ "numbers",
244650
+ "nupkg",
244651
+ "o",
244652
+ "odp",
244653
+ "ods",
244654
+ "odt",
244655
+ "oga",
244656
+ "ogg",
244657
+ "ogv",
244658
+ "otf",
244659
+ "ott",
244660
+ "pages",
244661
+ "pbm",
244662
+ "pcx",
244663
+ "pdb",
244664
+ "pdf",
244665
+ "pea",
244666
+ "pgm",
244667
+ "pic",
244668
+ "png",
244669
+ "pnm",
244670
+ "pot",
244671
+ "potm",
244672
+ "potx",
244673
+ "ppa",
244674
+ "ppam",
244675
+ "ppm",
244676
+ "pps",
244677
+ "ppsm",
244678
+ "ppsx",
244679
+ "ppt",
244680
+ "pptm",
244681
+ "pptx",
244682
+ "psd",
244683
+ "pya",
244684
+ "pyc",
244685
+ "pyo",
244686
+ "pyv",
244687
+ "qt",
244688
+ "rar",
244689
+ "ras",
244690
+ "raw",
244691
+ "resources",
244692
+ "rgb",
244693
+ "rip",
244694
+ "rlc",
244695
+ "rmf",
244696
+ "rmvb",
244697
+ "rpm",
244698
+ "rtf",
244699
+ "rz",
244700
+ "s3m",
244701
+ "s7z",
244702
+ "scpt",
244703
+ "sgi",
244704
+ "shar",
244705
+ "snap",
244706
+ "sil",
244707
+ "sketch",
244708
+ "slk",
244709
+ "smv",
244710
+ "snk",
244711
+ "so",
244712
+ "stl",
244713
+ "suo",
244714
+ "sub",
244715
+ "swf",
244716
+ "tar",
244717
+ "tbz",
244718
+ "tbz2",
244719
+ "tga",
244720
+ "tgz",
244721
+ "thmx",
244722
+ "tif",
244723
+ "tiff",
244724
+ "tlz",
244725
+ "ttc",
244726
+ "ttf",
244727
+ "txz",
244728
+ "udf",
244729
+ "uvh",
244730
+ "uvi",
244731
+ "uvm",
244732
+ "uvp",
244733
+ "uvs",
244734
+ "uvu",
244735
+ "viv",
244736
+ "vob",
244737
+ "war",
244738
+ "wav",
244739
+ "wax",
244740
+ "wbmp",
244741
+ "wdp",
244742
+ "weba",
244743
+ "webm",
244744
+ "webp",
244745
+ "whl",
244746
+ "wim",
244747
+ "wm",
244748
+ "wma",
244749
+ "wmv",
244750
+ "wmx",
244751
+ "woff",
244752
+ "woff2",
244753
+ "wrm",
244754
+ "wvx",
244755
+ "xbm",
244756
+ "xif",
244757
+ "xla",
244758
+ "xlam",
244759
+ "xls",
244760
+ "xlsb",
244761
+ "xlsm",
244762
+ "xlsx",
244763
+ "xlt",
244764
+ "xltm",
244765
+ "xltx",
244766
+ "xm",
244767
+ "xmind",
244768
+ "xpi",
244769
+ "xpm",
244770
+ "xwd",
244771
+ "xz",
244772
+ "z",
244773
+ "zip",
244774
+ "zipx"
244775
+ ]);
244776
+ var isBinaryPath = (filePath) => binaryExtensions.has(sp2.extname(filePath).slice(1).toLowerCase());
244777
+ var foreach = (val, fn9) => {
244778
+ if (val instanceof Set) {
244779
+ val.forEach(fn9);
244780
+ } else {
244781
+ fn9(val);
244782
+ }
244783
+ };
244784
+ var addAndConvert = (main, prop, item) => {
244785
+ let container = main[prop];
244786
+ if (!(container instanceof Set)) {
244787
+ main[prop] = container = new Set([container]);
244788
+ }
244789
+ container.add(item);
244790
+ };
244791
+ var clearItem = (cont) => (key2) => {
244792
+ const set2 = cont[key2];
244793
+ if (set2 instanceof Set) {
244794
+ set2.clear();
244795
+ } else {
244796
+ delete cont[key2];
244797
+ }
244798
+ };
244799
+ var delFromSet = (main, prop, item) => {
244800
+ const container = main[prop];
244801
+ if (container instanceof Set) {
244802
+ container.delete(item);
244803
+ } else if (container === item) {
244804
+ delete main[prop];
244805
+ }
244806
+ };
244807
+ var isEmptySet = (val) => val instanceof Set ? val.size === 0 : !val;
244808
+ var FsWatchInstances = new Map;
244809
+ function createFsWatchInstance(path18, options8, listener, errHandler, emitRaw) {
244810
+ const handleEvent = (rawEvent, evPath) => {
244811
+ listener(path18);
244812
+ emitRaw(rawEvent, evPath, { watchedPath: path18 });
244813
+ if (evPath && path18 !== evPath) {
244814
+ fsWatchBroadcast(sp2.resolve(path18, evPath), KEY_LISTENERS, sp2.join(path18, evPath));
244815
+ }
244816
+ };
244817
+ try {
244818
+ return fs_watch(path18, {
244819
+ persistent: options8.persistent
244820
+ }, handleEvent);
244821
+ } catch (error48) {
244822
+ errHandler(error48);
244823
+ return;
244824
+ }
244825
+ }
244826
+ var fsWatchBroadcast = (fullPath, listenerType, val1, val2, val3) => {
244827
+ const cont = FsWatchInstances.get(fullPath);
244828
+ if (!cont)
244829
+ return;
244830
+ foreach(cont[listenerType], (listener) => {
244831
+ listener(val1, val2, val3);
244832
+ });
244833
+ };
244834
+ var setFsWatchListener = (path18, fullPath, options8, handlers) => {
244835
+ const { listener, errHandler, rawEmitter } = handlers;
244836
+ let cont = FsWatchInstances.get(fullPath);
244837
+ let watcher;
244838
+ if (!options8.persistent) {
244839
+ watcher = createFsWatchInstance(path18, options8, listener, errHandler, rawEmitter);
244840
+ if (!watcher)
244841
+ return;
244842
+ return watcher.close.bind(watcher);
244843
+ }
244844
+ if (cont) {
244845
+ addAndConvert(cont, KEY_LISTENERS, listener);
244846
+ addAndConvert(cont, KEY_ERR, errHandler);
244847
+ addAndConvert(cont, KEY_RAW, rawEmitter);
244848
+ } else {
244849
+ watcher = createFsWatchInstance(path18, options8, fsWatchBroadcast.bind(null, fullPath, KEY_LISTENERS), errHandler, fsWatchBroadcast.bind(null, fullPath, KEY_RAW));
244850
+ if (!watcher)
244851
+ return;
244852
+ watcher.on(EV.ERROR, async (error48) => {
244853
+ const broadcastErr = fsWatchBroadcast.bind(null, fullPath, KEY_ERR);
244854
+ if (cont)
244855
+ cont.watcherUnusable = true;
244856
+ if (isWindows4 && error48.code === "EPERM") {
244857
+ try {
244858
+ const fd = await open2(path18, "r");
244859
+ await fd.close();
244860
+ broadcastErr(error48);
244861
+ } catch (err) {}
244862
+ } else {
244863
+ broadcastErr(error48);
244864
+ }
244865
+ });
244866
+ cont = {
244867
+ listeners: listener,
244868
+ errHandlers: errHandler,
244869
+ rawEmitters: rawEmitter,
244870
+ watcher
244871
+ };
244872
+ FsWatchInstances.set(fullPath, cont);
244873
+ }
244874
+ return () => {
244875
+ delFromSet(cont, KEY_LISTENERS, listener);
244876
+ delFromSet(cont, KEY_ERR, errHandler);
244877
+ delFromSet(cont, KEY_RAW, rawEmitter);
244878
+ if (isEmptySet(cont.listeners)) {
244879
+ cont.watcher.close();
244880
+ FsWatchInstances.delete(fullPath);
244881
+ HANDLER_KEYS2.forEach(clearItem(cont));
244882
+ cont.watcher = undefined;
244883
+ Object.freeze(cont);
244884
+ }
244885
+ };
244886
+ };
244887
+ var FsWatchFileInstances = new Map;
244888
+ var setFsWatchFileListener = (path18, fullPath, options8, handlers) => {
244889
+ const { listener, rawEmitter } = handlers;
244890
+ let cont = FsWatchFileInstances.get(fullPath);
244891
+ const copts = cont && cont.options;
244892
+ if (copts && (copts.persistent < options8.persistent || copts.interval > options8.interval)) {
244893
+ unwatchFile(fullPath);
244894
+ cont = undefined;
244895
+ }
244896
+ if (cont) {
244897
+ addAndConvert(cont, KEY_LISTENERS, listener);
244898
+ addAndConvert(cont, KEY_RAW, rawEmitter);
244899
+ } else {
244900
+ cont = {
244901
+ listeners: listener,
244902
+ rawEmitters: rawEmitter,
244903
+ options: options8,
244904
+ watcher: watchFile(fullPath, options8, (curr, prev) => {
244905
+ foreach(cont.rawEmitters, (rawEmitter2) => {
244906
+ rawEmitter2(EV.CHANGE, fullPath, { curr, prev });
244907
+ });
244908
+ const currmtime = curr.mtimeMs;
244909
+ if (curr.size !== prev.size || currmtime > prev.mtimeMs || currmtime === 0) {
244910
+ foreach(cont.listeners, (listener2) => listener2(path18, curr));
244911
+ }
244912
+ })
244913
+ };
244914
+ FsWatchFileInstances.set(fullPath, cont);
244915
+ }
244916
+ return () => {
244917
+ delFromSet(cont, KEY_LISTENERS, listener);
244918
+ delFromSet(cont, KEY_RAW, rawEmitter);
244919
+ if (isEmptySet(cont.listeners)) {
244920
+ FsWatchFileInstances.delete(fullPath);
244921
+ unwatchFile(fullPath);
244922
+ cont.options = cont.watcher = undefined;
244923
+ Object.freeze(cont);
244924
+ }
244925
+ };
244926
+ };
244927
+
244928
+ class NodeFsHandler {
244929
+ fsw;
244930
+ _boundHandleError;
244931
+ constructor(fsW) {
244932
+ this.fsw = fsW;
244933
+ this._boundHandleError = (error48) => fsW._handleError(error48);
244934
+ }
244935
+ _watchWithNodeFs(path18, listener) {
244936
+ const opts = this.fsw.options;
244937
+ const directory = sp2.dirname(path18);
244938
+ const basename5 = sp2.basename(path18);
244939
+ const parent = this.fsw._getWatchedDir(directory);
244940
+ parent.add(basename5);
244941
+ const absolutePath = sp2.resolve(path18);
244942
+ const options8 = {
244943
+ persistent: opts.persistent
244944
+ };
244945
+ if (!listener)
244946
+ listener = EMPTY_FN;
244947
+ let closer;
244948
+ if (opts.usePolling) {
244949
+ const enableBin = opts.interval !== opts.binaryInterval;
244950
+ options8.interval = enableBin && isBinaryPath(basename5) ? opts.binaryInterval : opts.interval;
244951
+ closer = setFsWatchFileListener(path18, absolutePath, options8, {
244952
+ listener,
244953
+ rawEmitter: this.fsw._emitRaw
244954
+ });
244955
+ } else {
244956
+ closer = setFsWatchListener(path18, absolutePath, options8, {
244957
+ listener,
244958
+ errHandler: this._boundHandleError,
244959
+ rawEmitter: this.fsw._emitRaw
244960
+ });
244961
+ }
244962
+ return closer;
244963
+ }
244964
+ _handleFile(file2, stats, initialAdd) {
244965
+ if (this.fsw.closed) {
244966
+ return;
244967
+ }
244968
+ const dirname13 = sp2.dirname(file2);
244969
+ const basename5 = sp2.basename(file2);
244970
+ const parent = this.fsw._getWatchedDir(dirname13);
244971
+ let prevStats = stats;
244972
+ if (parent.has(basename5))
244973
+ return;
244974
+ const listener = async (path18, newStats) => {
244975
+ if (!this.fsw._throttle(THROTTLE_MODE_WATCH, file2, 5))
244976
+ return;
244977
+ if (!newStats || newStats.mtimeMs === 0) {
244978
+ try {
244979
+ const newStats2 = await stat3(file2);
244980
+ if (this.fsw.closed)
244981
+ return;
244982
+ const at13 = newStats2.atimeMs;
244983
+ const mt12 = newStats2.mtimeMs;
244984
+ if (!at13 || at13 <= mt12 || mt12 !== prevStats.mtimeMs) {
244985
+ this.fsw._emit(EV.CHANGE, file2, newStats2);
244986
+ }
244987
+ if ((isMacos || isLinux || isFreeBSD) && prevStats.ino !== newStats2.ino) {
244988
+ this.fsw._closeFile(path18);
244989
+ prevStats = newStats2;
244990
+ const closer2 = this._watchWithNodeFs(file2, listener);
244991
+ if (closer2)
244992
+ this.fsw._addPathCloser(path18, closer2);
244993
+ } else {
244994
+ prevStats = newStats2;
244995
+ }
244996
+ } catch (error48) {
244997
+ this.fsw._remove(dirname13, basename5);
244998
+ }
244999
+ } else if (parent.has(basename5)) {
245000
+ const at13 = newStats.atimeMs;
245001
+ const mt12 = newStats.mtimeMs;
245002
+ if (!at13 || at13 <= mt12 || mt12 !== prevStats.mtimeMs) {
245003
+ this.fsw._emit(EV.CHANGE, file2, newStats);
245004
+ }
245005
+ prevStats = newStats;
245006
+ }
245007
+ };
245008
+ const closer = this._watchWithNodeFs(file2, listener);
245009
+ if (!(initialAdd && this.fsw.options.ignoreInitial) && this.fsw._isntIgnored(file2)) {
245010
+ if (!this.fsw._throttle(EV.ADD, file2, 0))
245011
+ return;
245012
+ this.fsw._emit(EV.ADD, file2, stats);
245013
+ }
245014
+ return closer;
245015
+ }
245016
+ async _handleSymlink(entry, directory, path18, item) {
245017
+ if (this.fsw.closed) {
245018
+ return;
245019
+ }
245020
+ const full = entry.fullPath;
245021
+ const dir = this.fsw._getWatchedDir(directory);
245022
+ if (!this.fsw.options.followSymlinks) {
245023
+ this.fsw._incrReadyCount();
245024
+ let linkPath;
245025
+ try {
245026
+ linkPath = await fsrealpath(path18);
245027
+ } catch (e8) {
245028
+ this.fsw._emitReady();
245029
+ return true;
245030
+ }
245031
+ if (this.fsw.closed)
245032
+ return;
245033
+ if (dir.has(item)) {
245034
+ if (this.fsw._symlinkPaths.get(full) !== linkPath) {
245035
+ this.fsw._symlinkPaths.set(full, linkPath);
245036
+ this.fsw._emit(EV.CHANGE, path18, entry.stats);
245037
+ }
245038
+ } else {
245039
+ dir.add(item);
245040
+ this.fsw._symlinkPaths.set(full, linkPath);
245041
+ this.fsw._emit(EV.ADD, path18, entry.stats);
245042
+ }
245043
+ this.fsw._emitReady();
245044
+ return true;
245045
+ }
245046
+ if (this.fsw._symlinkPaths.has(full)) {
245047
+ return true;
245048
+ }
245049
+ this.fsw._symlinkPaths.set(full, true);
245050
+ }
245051
+ _handleRead(directory, initialAdd, wh2, target, dir, depth, throttler) {
245052
+ directory = sp2.join(directory, "");
245053
+ const throttleKey = target ? `${directory}:${target}` : directory;
245054
+ throttler = this.fsw._throttle("readdir", throttleKey, 1000);
245055
+ if (!throttler)
245056
+ return;
245057
+ const previous = this.fsw._getWatchedDir(wh2.path);
245058
+ const current = new Set;
245059
+ let stream = this.fsw._readdirp(directory, {
245060
+ fileFilter: (entry) => wh2.filterPath(entry),
245061
+ directoryFilter: (entry) => wh2.filterDir(entry)
245062
+ });
245063
+ if (!stream)
245064
+ return;
245065
+ stream.on(STR_DATA, async (entry) => {
245066
+ if (this.fsw.closed) {
245067
+ stream = undefined;
245068
+ return;
245069
+ }
245070
+ const item = entry.path;
245071
+ let path18 = sp2.join(directory, item);
245072
+ current.add(item);
245073
+ if (entry.stats.isSymbolicLink() && await this._handleSymlink(entry, directory, path18, item)) {
245074
+ return;
245075
+ }
245076
+ if (this.fsw.closed) {
245077
+ stream = undefined;
245078
+ return;
245079
+ }
245080
+ if (item === target || !target && !previous.has(item)) {
245081
+ this.fsw._incrReadyCount();
245082
+ path18 = sp2.join(dir, sp2.relative(dir, path18));
245083
+ this._addToNodeFs(path18, initialAdd, wh2, depth + 1);
245084
+ }
245085
+ }).on(EV.ERROR, this._boundHandleError);
245086
+ return new Promise((resolve7, reject) => {
245087
+ if (!stream)
245088
+ return reject();
245089
+ stream.once(STR_END, () => {
245090
+ if (this.fsw.closed) {
245091
+ stream = undefined;
245092
+ return;
245093
+ }
245094
+ const wasThrottled = throttler ? throttler.clear() : false;
245095
+ resolve7(undefined);
245096
+ previous.getChildren().filter((item) => {
245097
+ return item !== directory && !current.has(item);
245098
+ }).forEach((item) => {
245099
+ this.fsw._remove(directory, item);
245100
+ });
245101
+ stream = undefined;
245102
+ if (wasThrottled)
245103
+ this._handleRead(directory, false, wh2, target, dir, depth, throttler);
245104
+ });
245105
+ });
245106
+ }
245107
+ async _handleDir(dir, stats, initialAdd, depth, target, wh2, realpath2) {
245108
+ const parentDir = this.fsw._getWatchedDir(sp2.dirname(dir));
245109
+ const tracked = parentDir.has(sp2.basename(dir));
245110
+ if (!(initialAdd && this.fsw.options.ignoreInitial) && !target && !tracked) {
245111
+ this.fsw._emit(EV.ADD_DIR, dir, stats);
245112
+ }
245113
+ parentDir.add(sp2.basename(dir));
245114
+ this.fsw._getWatchedDir(dir);
245115
+ let throttler;
245116
+ let closer;
245117
+ const oDepth = this.fsw.options.depth;
245118
+ if ((oDepth == null || depth <= oDepth) && !this.fsw._symlinkPaths.has(realpath2)) {
245119
+ if (!target) {
245120
+ await this._handleRead(dir, initialAdd, wh2, target, dir, depth, throttler);
245121
+ if (this.fsw.closed)
245122
+ return;
245123
+ }
245124
+ closer = this._watchWithNodeFs(dir, (dirPath, stats2) => {
245125
+ if (stats2 && stats2.mtimeMs === 0)
245126
+ return;
245127
+ this._handleRead(dirPath, false, wh2, target, dir, depth, throttler);
245128
+ });
245129
+ }
245130
+ return closer;
245131
+ }
245132
+ async _addToNodeFs(path18, initialAdd, priorWh, depth, target) {
245133
+ const ready = this.fsw._emitReady;
245134
+ if (this.fsw._isIgnored(path18) || this.fsw.closed) {
245135
+ ready();
245136
+ return false;
245137
+ }
245138
+ const wh2 = this.fsw._getWatchHelpers(path18);
245139
+ if (priorWh) {
245140
+ wh2.filterPath = (entry) => priorWh.filterPath(entry);
245141
+ wh2.filterDir = (entry) => priorWh.filterDir(entry);
245142
+ }
245143
+ try {
245144
+ const stats = await statMethods[wh2.statMethod](wh2.watchPath);
245145
+ if (this.fsw.closed)
245146
+ return;
245147
+ if (this.fsw._isIgnored(wh2.watchPath, stats)) {
245148
+ ready();
245149
+ return false;
245150
+ }
245151
+ const follow = this.fsw.options.followSymlinks;
245152
+ let closer;
245153
+ if (stats.isDirectory()) {
245154
+ const absPath = sp2.resolve(path18);
245155
+ const targetPath = follow ? await fsrealpath(path18) : path18;
245156
+ if (this.fsw.closed)
245157
+ return;
245158
+ closer = await this._handleDir(wh2.watchPath, stats, initialAdd, depth, target, wh2, targetPath);
245159
+ if (this.fsw.closed)
245160
+ return;
245161
+ if (absPath !== targetPath && targetPath !== undefined) {
245162
+ this.fsw._symlinkPaths.set(absPath, targetPath);
245163
+ }
245164
+ } else if (stats.isSymbolicLink()) {
245165
+ const targetPath = follow ? await fsrealpath(path18) : path18;
245166
+ if (this.fsw.closed)
245167
+ return;
245168
+ const parent = sp2.dirname(wh2.watchPath);
245169
+ this.fsw._getWatchedDir(parent).add(wh2.watchPath);
245170
+ this.fsw._emit(EV.ADD, wh2.watchPath, stats);
245171
+ closer = await this._handleDir(parent, stats, initialAdd, depth, path18, wh2, targetPath);
245172
+ if (this.fsw.closed)
245173
+ return;
245174
+ if (targetPath !== undefined) {
245175
+ this.fsw._symlinkPaths.set(sp2.resolve(path18), targetPath);
245176
+ }
245177
+ } else {
245178
+ closer = this._handleFile(wh2.watchPath, stats, initialAdd);
245179
+ }
245180
+ ready();
245181
+ if (closer)
245182
+ this.fsw._addPathCloser(path18, closer);
245183
+ return false;
245184
+ } catch (error48) {
245185
+ if (this.fsw._handleError(error48)) {
245186
+ ready();
245187
+ return path18;
245188
+ }
245189
+ }
245190
+ }
245191
+ }
245192
+
245193
+ // node_modules/chokidar/index.js
245194
+ /*! chokidar - MIT License (c) 2012 Paul Miller (paulmillr.com) */
245195
+ var SLASH = "/";
245196
+ var SLASH_SLASH = "//";
245197
+ var ONE_DOT = ".";
245198
+ var TWO_DOTS = "..";
245199
+ var STRING_TYPE = "string";
245200
+ var BACK_SLASH_RE = /\\/g;
245201
+ var DOUBLE_SLASH_RE = /\/\//g;
245202
+ var DOT_RE = /\..*\.(sw[px])$|~$|\.subl.*\.tmp/;
245203
+ var REPLACER_RE = /^\.[/\\]/;
245204
+ function arrify(item) {
245205
+ return Array.isArray(item) ? item : [item];
245206
+ }
245207
+ var isMatcherObject = (matcher) => typeof matcher === "object" && matcher !== null && !(matcher instanceof RegExp);
245208
+ function createPattern(matcher) {
245209
+ if (typeof matcher === "function")
245210
+ return matcher;
245211
+ if (typeof matcher === "string")
245212
+ return (string4) => matcher === string4;
245213
+ if (matcher instanceof RegExp)
245214
+ return (string4) => matcher.test(string4);
245215
+ if (typeof matcher === "object" && matcher !== null) {
245216
+ return (string4) => {
245217
+ if (matcher.path === string4)
245218
+ return true;
245219
+ if (matcher.recursive) {
245220
+ const relative4 = sp3.relative(matcher.path, string4);
245221
+ if (!relative4) {
245222
+ return false;
245223
+ }
245224
+ return !relative4.startsWith("..") && !sp3.isAbsolute(relative4);
245225
+ }
245226
+ return false;
245227
+ };
245228
+ }
245229
+ return () => false;
245230
+ }
245231
+ function normalizePath(path18) {
245232
+ if (typeof path18 !== "string")
245233
+ throw new Error("string expected");
245234
+ path18 = sp3.normalize(path18);
245235
+ path18 = path18.replace(/\\/g, "/");
245236
+ let prepend = false;
245237
+ if (path18.startsWith("//"))
245238
+ prepend = true;
245239
+ path18 = path18.replace(DOUBLE_SLASH_RE, "/");
245240
+ if (prepend)
245241
+ path18 = "/" + path18;
245242
+ return path18;
245243
+ }
245244
+ function matchPatterns(patterns, testString, stats) {
245245
+ const path18 = normalizePath(testString);
245246
+ for (let index = 0;index < patterns.length; index++) {
245247
+ const pattern = patterns[index];
245248
+ if (pattern(path18, stats)) {
245249
+ return true;
245250
+ }
245251
+ }
245252
+ return false;
245253
+ }
245254
+ function anymatch(matchers, testString) {
245255
+ if (matchers == null) {
245256
+ throw new TypeError("anymatch: specify first argument");
245257
+ }
245258
+ const matchersArray = arrify(matchers);
245259
+ const patterns = matchersArray.map((matcher) => createPattern(matcher));
245260
+ if (testString == null) {
245261
+ return (testString2, stats) => {
245262
+ return matchPatterns(patterns, testString2, stats);
245263
+ };
245264
+ }
245265
+ return matchPatterns(patterns, testString);
245266
+ }
245267
+ var unifyPaths = (paths_) => {
245268
+ const paths = arrify(paths_).flat();
245269
+ if (!paths.every((p4) => typeof p4 === STRING_TYPE)) {
245270
+ throw new TypeError(`Non-string provided as watch path: ${paths}`);
245271
+ }
245272
+ return paths.map(normalizePathToUnix);
245273
+ };
245274
+ var toUnix = (string4) => {
245275
+ let str = string4.replace(BACK_SLASH_RE, SLASH);
245276
+ let prepend = false;
245277
+ if (str.startsWith(SLASH_SLASH)) {
245278
+ prepend = true;
245279
+ }
245280
+ str = str.replace(DOUBLE_SLASH_RE, SLASH);
245281
+ if (prepend) {
245282
+ str = SLASH + str;
245283
+ }
245284
+ return str;
245285
+ };
245286
+ var normalizePathToUnix = (path18) => toUnix(sp3.normalize(toUnix(path18)));
245287
+ var normalizeIgnored = (cwd = "") => (path18) => {
245288
+ if (typeof path18 === "string") {
245289
+ return normalizePathToUnix(sp3.isAbsolute(path18) ? path18 : sp3.join(cwd, path18));
245290
+ } else {
245291
+ return path18;
245292
+ }
245293
+ };
245294
+ var getAbsolutePath = (path18, cwd) => {
245295
+ if (sp3.isAbsolute(path18)) {
245296
+ return path18;
245297
+ }
245298
+ return sp3.join(cwd, path18);
245299
+ };
245300
+ var EMPTY_SET = Object.freeze(new Set);
245301
+
245302
+ class DirEntry {
245303
+ path;
245304
+ _removeWatcher;
245305
+ items;
245306
+ constructor(dir, removeWatcher) {
245307
+ this.path = dir;
245308
+ this._removeWatcher = removeWatcher;
245309
+ this.items = new Set;
245310
+ }
245311
+ add(item) {
245312
+ const { items } = this;
245313
+ if (!items)
245314
+ return;
245315
+ if (item !== ONE_DOT && item !== TWO_DOTS)
245316
+ items.add(item);
245317
+ }
245318
+ async remove(item) {
245319
+ const { items } = this;
245320
+ if (!items)
245321
+ return;
245322
+ items.delete(item);
245323
+ if (items.size > 0)
245324
+ return;
245325
+ const dir = this.path;
245326
+ try {
245327
+ await readdir3(dir);
245328
+ } catch (err) {
245329
+ if (this._removeWatcher) {
245330
+ this._removeWatcher(sp3.dirname(dir), sp3.basename(dir));
245331
+ }
245332
+ }
245333
+ }
245334
+ has(item) {
245335
+ const { items } = this;
245336
+ if (!items)
245337
+ return;
245338
+ return items.has(item);
245339
+ }
245340
+ getChildren() {
245341
+ const { items } = this;
245342
+ if (!items)
245343
+ return [];
245344
+ return [...items.values()];
245345
+ }
245346
+ dispose() {
245347
+ this.items.clear();
245348
+ this.path = "";
245349
+ this._removeWatcher = EMPTY_FN;
245350
+ this.items = EMPTY_SET;
245351
+ Object.freeze(this);
245352
+ }
245353
+ }
245354
+ var STAT_METHOD_F = "stat";
245355
+ var STAT_METHOD_L = "lstat";
245356
+
245357
+ class WatchHelper {
245358
+ fsw;
245359
+ path;
245360
+ watchPath;
245361
+ fullWatchPath;
245362
+ dirParts;
245363
+ followSymlinks;
245364
+ statMethod;
245365
+ constructor(path18, follow, fsw) {
245366
+ this.fsw = fsw;
245367
+ const watchPath = path18;
245368
+ this.path = path18 = path18.replace(REPLACER_RE, "");
245369
+ this.watchPath = watchPath;
245370
+ this.fullWatchPath = sp3.resolve(watchPath);
245371
+ this.dirParts = [];
245372
+ this.dirParts.forEach((parts) => {
245373
+ if (parts.length > 1)
245374
+ parts.pop();
245375
+ });
245376
+ this.followSymlinks = follow;
245377
+ this.statMethod = follow ? STAT_METHOD_F : STAT_METHOD_L;
245378
+ }
245379
+ entryPath(entry) {
245380
+ return sp3.join(this.watchPath, sp3.relative(this.watchPath, entry.fullPath));
245381
+ }
245382
+ filterPath(entry) {
245383
+ const { stats } = entry;
245384
+ if (stats && stats.isSymbolicLink())
245385
+ return this.filterDir(entry);
245386
+ const resolvedPath = this.entryPath(entry);
245387
+ return this.fsw._isntIgnored(resolvedPath, stats) && this.fsw._hasReadPermissions(stats);
245388
+ }
245389
+ filterDir(entry) {
245390
+ return this.fsw._isntIgnored(this.entryPath(entry), entry.stats);
245391
+ }
245392
+ }
245393
+
245394
+ class FSWatcher extends EventEmitter3 {
245395
+ closed;
245396
+ options;
245397
+ _closers;
245398
+ _ignoredPaths;
245399
+ _throttled;
245400
+ _streams;
245401
+ _symlinkPaths;
245402
+ _watched;
245403
+ _pendingWrites;
245404
+ _pendingUnlinks;
245405
+ _readyCount;
245406
+ _emitReady;
245407
+ _closePromise;
245408
+ _userIgnored;
245409
+ _readyEmitted;
245410
+ _emitRaw;
245411
+ _boundRemove;
245412
+ _nodeFsHandler;
245413
+ constructor(_opts = {}) {
245414
+ super();
245415
+ this.closed = false;
245416
+ this._closers = new Map;
245417
+ this._ignoredPaths = new Set;
245418
+ this._throttled = new Map;
245419
+ this._streams = new Set;
245420
+ this._symlinkPaths = new Map;
245421
+ this._watched = new Map;
245422
+ this._pendingWrites = new Map;
245423
+ this._pendingUnlinks = new Map;
245424
+ this._readyCount = 0;
245425
+ this._readyEmitted = false;
245426
+ const awf = _opts.awaitWriteFinish;
245427
+ const DEF_AWF = { stabilityThreshold: 2000, pollInterval: 100 };
245428
+ const opts = {
245429
+ persistent: true,
245430
+ ignoreInitial: false,
245431
+ ignorePermissionErrors: false,
245432
+ interval: 100,
245433
+ binaryInterval: 300,
245434
+ followSymlinks: true,
245435
+ usePolling: false,
245436
+ atomic: true,
245437
+ ..._opts,
245438
+ ignored: _opts.ignored ? arrify(_opts.ignored) : arrify([]),
245439
+ awaitWriteFinish: awf === true ? DEF_AWF : typeof awf === "object" ? { ...DEF_AWF, ...awf } : false
245440
+ };
245441
+ if (isIBMi)
245442
+ opts.usePolling = true;
245443
+ if (opts.atomic === undefined)
245444
+ opts.atomic = !opts.usePolling;
245445
+ const envPoll = process.env.CHOKIDAR_USEPOLLING;
245446
+ if (envPoll !== undefined) {
245447
+ const envLower = envPoll.toLowerCase();
245448
+ if (envLower === "false" || envLower === "0")
245449
+ opts.usePolling = false;
245450
+ else if (envLower === "true" || envLower === "1")
245451
+ opts.usePolling = true;
245452
+ else
245453
+ opts.usePolling = !!envLower;
245454
+ }
245455
+ const envInterval = process.env.CHOKIDAR_INTERVAL;
245456
+ if (envInterval)
245457
+ opts.interval = Number.parseInt(envInterval, 10);
245458
+ let readyCalls = 0;
245459
+ this._emitReady = () => {
245460
+ readyCalls++;
245461
+ if (readyCalls >= this._readyCount) {
245462
+ this._emitReady = EMPTY_FN;
245463
+ this._readyEmitted = true;
245464
+ process.nextTick(() => this.emit(EVENTS.READY));
245465
+ }
245466
+ };
245467
+ this._emitRaw = (...args) => this.emit(EVENTS.RAW, ...args);
245468
+ this._boundRemove = this._remove.bind(this);
245469
+ this.options = opts;
245470
+ this._nodeFsHandler = new NodeFsHandler(this);
245471
+ Object.freeze(opts);
245472
+ }
245473
+ _addIgnoredPath(matcher) {
245474
+ if (isMatcherObject(matcher)) {
245475
+ for (const ignored of this._ignoredPaths) {
245476
+ if (isMatcherObject(ignored) && ignored.path === matcher.path && ignored.recursive === matcher.recursive) {
245477
+ return;
245478
+ }
245479
+ }
245480
+ }
245481
+ this._ignoredPaths.add(matcher);
245482
+ }
245483
+ _removeIgnoredPath(matcher) {
245484
+ this._ignoredPaths.delete(matcher);
245485
+ if (typeof matcher === "string") {
245486
+ for (const ignored of this._ignoredPaths) {
245487
+ if (isMatcherObject(ignored) && ignored.path === matcher) {
245488
+ this._ignoredPaths.delete(ignored);
245489
+ }
245490
+ }
245491
+ }
245492
+ }
245493
+ add(paths_, _origAdd, _internal) {
245494
+ const { cwd } = this.options;
245495
+ this.closed = false;
245496
+ this._closePromise = undefined;
245497
+ let paths = unifyPaths(paths_);
245498
+ if (cwd) {
245499
+ paths = paths.map((path18) => {
245500
+ const absPath = getAbsolutePath(path18, cwd);
245501
+ return absPath;
245502
+ });
245503
+ }
245504
+ paths.forEach((path18) => {
245505
+ this._removeIgnoredPath(path18);
245506
+ });
245507
+ this._userIgnored = undefined;
245508
+ if (!this._readyCount)
245509
+ this._readyCount = 0;
245510
+ this._readyCount += paths.length;
245511
+ Promise.all(paths.map(async (path18) => {
245512
+ const res = await this._nodeFsHandler._addToNodeFs(path18, !_internal, undefined, 0, _origAdd);
245513
+ if (res)
245514
+ this._emitReady();
245515
+ return res;
245516
+ })).then((results) => {
245517
+ if (this.closed)
245518
+ return;
245519
+ results.forEach((item) => {
245520
+ if (item)
245521
+ this.add(sp3.dirname(item), sp3.basename(_origAdd || item));
245522
+ });
245523
+ });
245524
+ return this;
245525
+ }
245526
+ unwatch(paths_) {
245527
+ if (this.closed)
245528
+ return this;
245529
+ const paths = unifyPaths(paths_);
245530
+ const { cwd } = this.options;
245531
+ paths.forEach((path18) => {
245532
+ if (!sp3.isAbsolute(path18) && !this._closers.has(path18)) {
245533
+ if (cwd)
245534
+ path18 = sp3.join(cwd, path18);
245535
+ path18 = sp3.resolve(path18);
245536
+ }
245537
+ this._closePath(path18);
245538
+ this._addIgnoredPath(path18);
245539
+ if (this._watched.has(path18)) {
245540
+ this._addIgnoredPath({
245541
+ path: path18,
245542
+ recursive: true
245543
+ });
245544
+ }
245545
+ this._userIgnored = undefined;
245546
+ });
245547
+ return this;
245548
+ }
245549
+ close() {
245550
+ if (this._closePromise) {
245551
+ return this._closePromise;
245552
+ }
245553
+ this.closed = true;
245554
+ this.removeAllListeners();
245555
+ const closers = [];
245556
+ this._closers.forEach((closerList) => closerList.forEach((closer) => {
245557
+ const promise2 = closer();
245558
+ if (promise2 instanceof Promise)
245559
+ closers.push(promise2);
245560
+ }));
245561
+ this._streams.forEach((stream) => stream.destroy());
245562
+ this._userIgnored = undefined;
245563
+ this._readyCount = 0;
245564
+ this._readyEmitted = false;
245565
+ this._watched.forEach((dirent) => dirent.dispose());
245566
+ this._closers.clear();
245567
+ this._watched.clear();
245568
+ this._streams.clear();
245569
+ this._symlinkPaths.clear();
245570
+ this._throttled.clear();
245571
+ this._closePromise = closers.length ? Promise.all(closers).then(() => {
245572
+ return;
245573
+ }) : Promise.resolve();
245574
+ return this._closePromise;
245575
+ }
245576
+ getWatched() {
245577
+ const watchList = {};
245578
+ this._watched.forEach((entry, dir) => {
245579
+ const key2 = this.options.cwd ? sp3.relative(this.options.cwd, dir) : dir;
245580
+ const index = key2 || ONE_DOT;
245581
+ watchList[index] = entry.getChildren().sort();
245582
+ });
245583
+ return watchList;
245584
+ }
245585
+ emitWithAll(event, args) {
245586
+ this.emit(event, ...args);
245587
+ if (event !== EVENTS.ERROR)
245588
+ this.emit(EVENTS.ALL, event, ...args);
245589
+ }
245590
+ async _emit(event, path18, stats) {
245591
+ if (this.closed)
245592
+ return;
245593
+ const opts = this.options;
245594
+ if (isWindows4)
245595
+ path18 = sp3.normalize(path18);
245596
+ if (opts.cwd)
245597
+ path18 = sp3.relative(opts.cwd, path18);
245598
+ const args = [path18];
245599
+ if (stats != null)
245600
+ args.push(stats);
245601
+ const awf = opts.awaitWriteFinish;
245602
+ let pw;
245603
+ if (awf && (pw = this._pendingWrites.get(path18))) {
245604
+ pw.lastChange = new Date;
245605
+ return this;
245606
+ }
245607
+ if (opts.atomic) {
245608
+ if (event === EVENTS.UNLINK) {
245609
+ this._pendingUnlinks.set(path18, [event, ...args]);
245610
+ setTimeout(() => {
245611
+ this._pendingUnlinks.forEach((entry, path19) => {
245612
+ this.emit(...entry);
245613
+ this.emit(EVENTS.ALL, ...entry);
245614
+ this._pendingUnlinks.delete(path19);
245615
+ });
245616
+ }, typeof opts.atomic === "number" ? opts.atomic : 100);
245617
+ return this;
245618
+ }
245619
+ if (event === EVENTS.ADD && this._pendingUnlinks.has(path18)) {
245620
+ event = EVENTS.CHANGE;
245621
+ this._pendingUnlinks.delete(path18);
245622
+ }
245623
+ }
245624
+ if (awf && (event === EVENTS.ADD || event === EVENTS.CHANGE) && this._readyEmitted) {
245625
+ const awfEmit = (err, stats2) => {
245626
+ if (err) {
245627
+ event = EVENTS.ERROR;
245628
+ args[0] = err;
245629
+ this.emitWithAll(event, args);
245630
+ } else if (stats2) {
245631
+ if (args.length > 1) {
245632
+ args[1] = stats2;
245633
+ } else {
245634
+ args.push(stats2);
245635
+ }
245636
+ this.emitWithAll(event, args);
245637
+ }
245638
+ };
245639
+ this._awaitWriteFinish(path18, awf.stabilityThreshold, event, awfEmit);
245640
+ return this;
245641
+ }
245642
+ if (event === EVENTS.CHANGE) {
245643
+ const isThrottled = !this._throttle(EVENTS.CHANGE, path18, 50);
245644
+ if (isThrottled)
245645
+ return this;
245646
+ }
245647
+ if (opts.alwaysStat && stats === undefined && (event === EVENTS.ADD || event === EVENTS.ADD_DIR || event === EVENTS.CHANGE)) {
245648
+ const fullPath = opts.cwd ? sp3.join(opts.cwd, path18) : path18;
245649
+ let stats2;
245650
+ try {
245651
+ stats2 = await stat4(fullPath);
245652
+ } catch (err) {}
245653
+ if (!stats2 || this.closed)
245654
+ return;
245655
+ args.push(stats2);
245656
+ }
245657
+ this.emitWithAll(event, args);
245658
+ return this;
245659
+ }
245660
+ _handleError(error48) {
245661
+ const code2 = error48 && error48.code;
245662
+ if (error48 && code2 !== "ENOENT" && code2 !== "ENOTDIR" && (!this.options.ignorePermissionErrors || code2 !== "EPERM" && code2 !== "EACCES")) {
245663
+ this.emit(EVENTS.ERROR, error48);
245664
+ }
245665
+ return error48 || this.closed;
245666
+ }
245667
+ _throttle(actionType, path18, timeout3) {
245668
+ if (!this._throttled.has(actionType)) {
245669
+ this._throttled.set(actionType, new Map);
245670
+ }
245671
+ const action = this._throttled.get(actionType);
245672
+ if (!action)
245673
+ throw new Error("invalid throttle");
245674
+ const actionPath = action.get(path18);
245675
+ if (actionPath) {
245676
+ actionPath.count++;
245677
+ return false;
245678
+ }
245679
+ let timeoutObject;
245680
+ const clear = () => {
245681
+ const item = action.get(path18);
245682
+ const count2 = item ? item.count : 0;
245683
+ action.delete(path18);
245684
+ clearTimeout(timeoutObject);
245685
+ if (item)
245686
+ clearTimeout(item.timeoutObject);
245687
+ return count2;
245688
+ };
245689
+ timeoutObject = setTimeout(clear, timeout3);
245690
+ const thr = { timeoutObject, clear, count: 0 };
245691
+ action.set(path18, thr);
245692
+ return thr;
245693
+ }
245694
+ _incrReadyCount() {
245695
+ return this._readyCount++;
245696
+ }
245697
+ _awaitWriteFinish(path18, threshold, event, awfEmit) {
245698
+ const awf = this.options.awaitWriteFinish;
245699
+ if (typeof awf !== "object")
245700
+ return;
245701
+ const pollInterval = awf.pollInterval;
245702
+ let timeoutHandler;
245703
+ let fullPath = path18;
245704
+ if (this.options.cwd && !sp3.isAbsolute(path18)) {
245705
+ fullPath = sp3.join(this.options.cwd, path18);
245706
+ }
245707
+ const now = new Date;
245708
+ const writes = this._pendingWrites;
245709
+ function awaitWriteFinishFn(prevStat) {
245710
+ statcb(fullPath, (err, curStat) => {
245711
+ if (err || !writes.has(path18)) {
245712
+ if (err && err.code !== "ENOENT")
245713
+ awfEmit(err);
245714
+ return;
245715
+ }
245716
+ const now2 = Number(new Date);
245717
+ if (prevStat && curStat.size !== prevStat.size) {
245718
+ writes.get(path18).lastChange = now2;
245719
+ }
245720
+ const pw = writes.get(path18);
245721
+ const df3 = now2 - pw.lastChange;
245722
+ if (df3 >= threshold) {
245723
+ writes.delete(path18);
245724
+ awfEmit(undefined, curStat);
245725
+ } else {
245726
+ timeoutHandler = setTimeout(awaitWriteFinishFn, pollInterval, curStat);
245727
+ }
245728
+ });
245729
+ }
245730
+ if (!writes.has(path18)) {
245731
+ writes.set(path18, {
245732
+ lastChange: now,
245733
+ cancelWait: () => {
245734
+ writes.delete(path18);
245735
+ clearTimeout(timeoutHandler);
245736
+ return event;
245737
+ }
245738
+ });
245739
+ timeoutHandler = setTimeout(awaitWriteFinishFn, pollInterval);
245740
+ }
245741
+ }
245742
+ _isIgnored(path18, stats) {
245743
+ if (this.options.atomic && DOT_RE.test(path18))
245744
+ return true;
245745
+ if (!this._userIgnored) {
245746
+ const { cwd } = this.options;
245747
+ const ign = this.options.ignored;
245748
+ const ignored = (ign || []).map(normalizeIgnored(cwd));
245749
+ const ignoredPaths = [...this._ignoredPaths];
245750
+ const list3 = [...ignoredPaths.map(normalizeIgnored(cwd)), ...ignored];
245751
+ this._userIgnored = anymatch(list3, undefined);
245752
+ }
245753
+ return this._userIgnored(path18, stats);
245754
+ }
245755
+ _isntIgnored(path18, stat5) {
245756
+ return !this._isIgnored(path18, stat5);
245757
+ }
245758
+ _getWatchHelpers(path18) {
245759
+ return new WatchHelper(path18, this.options.followSymlinks, this);
245760
+ }
245761
+ _getWatchedDir(directory) {
245762
+ const dir = sp3.resolve(directory);
245763
+ if (!this._watched.has(dir))
245764
+ this._watched.set(dir, new DirEntry(dir, this._boundRemove));
245765
+ return this._watched.get(dir);
245766
+ }
245767
+ _hasReadPermissions(stats) {
245768
+ if (this.options.ignorePermissionErrors)
245769
+ return true;
245770
+ return Boolean(Number(stats.mode) & 256);
245771
+ }
245772
+ _remove(directory, item, isDirectory3) {
245773
+ const path18 = sp3.join(directory, item);
245774
+ const fullPath = sp3.resolve(path18);
245775
+ isDirectory3 = isDirectory3 != null ? isDirectory3 : this._watched.has(path18) || this._watched.has(fullPath);
245776
+ if (!this._throttle("remove", path18, 100))
245777
+ return;
245778
+ if (!isDirectory3 && this._watched.size === 1) {
245779
+ this.add(directory, item, true);
245780
+ }
245781
+ const wp5 = this._getWatchedDir(path18);
245782
+ const nestedDirectoryChildren = wp5.getChildren();
245783
+ nestedDirectoryChildren.forEach((nested) => this._remove(path18, nested));
245784
+ const parent = this._getWatchedDir(directory);
245785
+ const wasTracked = parent.has(item);
245786
+ parent.remove(item);
245787
+ if (this._symlinkPaths.has(fullPath)) {
245788
+ this._symlinkPaths.delete(fullPath);
245789
+ }
245790
+ let relPath = path18;
245791
+ if (this.options.cwd)
245792
+ relPath = sp3.relative(this.options.cwd, path18);
245793
+ if (this.options.awaitWriteFinish && this._pendingWrites.has(relPath)) {
245794
+ const event = this._pendingWrites.get(relPath).cancelWait();
245795
+ if (event === EVENTS.ADD)
245796
+ return;
245797
+ }
245798
+ this._watched.delete(path18);
245799
+ this._watched.delete(fullPath);
245800
+ const eventName = isDirectory3 ? EVENTS.UNLINK_DIR : EVENTS.UNLINK;
245801
+ if (wasTracked && !this._isIgnored(path18))
245802
+ this._emit(eventName, path18);
245803
+ this._closePath(path18);
245804
+ }
245805
+ _closePath(path18) {
245806
+ this._closeFile(path18);
245807
+ const dir = sp3.dirname(path18);
245808
+ this._getWatchedDir(dir).remove(sp3.basename(path18));
245809
+ }
245810
+ _closeFile(path18) {
245811
+ const closers = this._closers.get(path18);
245812
+ if (!closers)
245813
+ return;
245814
+ closers.forEach((closer) => closer());
245815
+ this._closers.delete(path18);
245816
+ }
245817
+ _addPathCloser(path18, closer) {
245818
+ if (!closer)
245819
+ return;
245820
+ let list3 = this._closers.get(path18);
245821
+ if (!list3) {
245822
+ list3 = [];
245823
+ this._closers.set(path18, list3);
245824
+ }
245825
+ list3.push(closer);
245826
+ }
245827
+ _readdirp(root2, opts) {
245828
+ if (this.closed)
245829
+ return;
245830
+ const options8 = { type: EVENTS.ALL, alwaysStat: true, lstat: true, ...opts, depth: 0 };
245831
+ let stream = readdirp(root2, options8);
245832
+ this._streams.add(stream);
245833
+ stream.once(STR_CLOSE, () => {
245834
+ stream = undefined;
245835
+ });
245836
+ stream.once(STR_END, () => {
245837
+ if (stream) {
245838
+ this._streams.delete(stream);
245839
+ stream = undefined;
245840
+ }
245841
+ });
245842
+ return stream;
245843
+ }
245844
+ }
245845
+ function watch(paths, options8 = {}) {
245846
+ const watcher = new FSWatcher(options8);
245847
+ watcher.add(paths);
245848
+ return watcher;
245849
+ }
245850
+
244234
245851
  // src/cli/dev/dev-server/dir-watcher.ts
244235
245852
  var import_debounce = __toESM(require_debounce(), 1);
244236
- import { watch } from "node:fs";
244237
- import { dirname as dirname12 } from "node:path";
244238
245853
  var WATCH_DEBOUNCE_MS = 300;
244239
245854
 
244240
245855
  class DirWatcher {
@@ -244249,6 +245864,9 @@ class DirWatcher {
244249
245864
  this.logger = logger;
244250
245865
  }
244251
245866
  async start() {
245867
+ if (this.watcher) {
245868
+ return;
245869
+ }
244252
245870
  if (await pathExists(this.targetDir)) {
244253
245871
  this.watchTarget();
244254
245872
  } else {
@@ -244271,18 +245889,22 @@ class DirWatcher {
244271
245889
  this.handleError(error48);
244272
245890
  }
244273
245891
  }, WATCH_DEBOUNCE_MS);
244274
- this.watcher = watch(this.targetDir, { recursive: true }, handler);
245892
+ this.watcher = watch(this.targetDir, { ignoreInitial: true });
245893
+ this.watcher.on("all", handler);
245894
+ this.watcher.on("error", (err) => this.handleError(err));
244275
245895
  }
244276
245896
  watchParentForCreation() {
244277
245897
  if (this.closed) {
244278
245898
  return;
244279
245899
  }
244280
- const parentDir = dirname12(this.targetDir);
245900
+ const parentDir = dirname14(this.targetDir);
244281
245901
  const handler = import_debounce.default(async () => {
244282
- if (this.closed)
245902
+ if (this.closed) {
244283
245903
  return;
245904
+ }
244284
245905
  if (await pathExists(this.targetDir)) {
244285
- this.watcher?.close();
245906
+ handler.cancel();
245907
+ await this.watcher?.close();
244286
245908
  this.watcher = null;
244287
245909
  this.watchTarget();
244288
245910
  try {
@@ -244292,7 +245914,9 @@ class DirWatcher {
244292
245914
  }
244293
245915
  }
244294
245916
  }, WATCH_DEBOUNCE_MS);
244295
- this.watcher = watch(parentDir, handler);
245917
+ this.watcher = watch(parentDir, { ignoreInitial: true, depth: 0 });
245918
+ this.watcher.on("all", handler);
245919
+ this.watcher.on("error", (err) => this.handleError(err));
244296
245920
  }
244297
245921
  handleError(error48) {
244298
245922
  this.logger.error(`[dev-server] Watch handler failed for ${this.targetDir}`, error48 instanceof Error ? error48 : undefined);
@@ -244699,7 +246323,7 @@ async function createDevServer(options8) {
244699
246323
  devLogger.warn(`"${req.originalUrl}" is not supported in local development, passing call to production`);
244700
246324
  remoteProxy(req, res, next);
244701
246325
  });
244702
- const server = await new Promise((resolve6, reject) => {
246326
+ const server = await new Promise((resolve8, reject) => {
244703
246327
  const s5 = app.listen(port, "127.0.0.1", (err) => {
244704
246328
  if (err) {
244705
246329
  if ("code" in err && err.code === "EADDRINUSE") {
@@ -244708,7 +246332,7 @@ async function createDevServer(options8) {
244708
246332
  reject(err);
244709
246333
  }
244710
246334
  } else {
244711
- resolve6(s5);
246335
+ resolve8(s5);
244712
246336
  }
244713
246337
  });
244714
246338
  });
@@ -244716,16 +246340,16 @@ async function createDevServer(options8) {
244716
246340
  emitEntityEvent = (appId, entityName, event) => {
244717
246341
  broadcastEntityEvent(io6, appId, entityName, event);
244718
246342
  };
244719
- const configDir = dirname13(project2.configPath);
244720
- const functionsDir = join16(configDir, project2.functionsDir);
246343
+ const configDir = dirname15(project2.configPath);
246344
+ const functionsDir = join18(configDir, project2.functionsDir);
244721
246345
  const functionsWatcher = new DirWatcher(functionsDir, async () => {
244722
246346
  const { functions: functions2 } = await options8.loadResources();
244723
- const previousNamesLength = functionManager.getFunctionNames().length;
246347
+ const previousFunctionCount = functionManager.getFunctionNames().length;
244724
246348
  functionManager.reload(functions2);
244725
246349
  const names = functionManager.getFunctionNames();
244726
246350
  if (names.length > 0) {
244727
246351
  devLogger.log(`Reloaded functions: ${names.sort().join(", ")}`);
244728
- } else if (previousNamesLength > 0) {
246352
+ } else if (previousFunctionCount > 0) {
244729
246353
  devLogger.log("All functions removed");
244730
246354
  }
244731
246355
  }, devLogger);
@@ -244762,7 +246386,7 @@ function getDevCommand(context) {
244762
246386
  }
244763
246387
 
244764
246388
  // src/cli/commands/project/eject.ts
244765
- import { resolve as resolve6 } from "node:path";
246389
+ import { resolve as resolve8 } from "node:path";
244766
246390
  var import_kebabCase2 = __toESM(require_kebabCase(), 1);
244767
246391
  async function eject(options8) {
244768
246392
  const projects = await listProjects();
@@ -244811,7 +246435,7 @@ async function eject(options8) {
244811
246435
  Ne("Operation cancelled.");
244812
246436
  throw new CLIExitError(0);
244813
246437
  }
244814
- const resolvedPath = resolve6(selectedPath);
246438
+ const resolvedPath = resolve8(selectedPath);
244815
246439
  await runTask("Downloading your project's code...", async (updateMessage) => {
244816
246440
  await createProjectFilesForExistingProject({
244817
246441
  projectId,
@@ -244887,7 +246511,7 @@ var import_detect_agent = __toESM(require_dist5(), 1);
244887
246511
  import { release, type } from "node:os";
244888
246512
 
244889
246513
  // node_modules/posthog-node/dist/extensions/error-tracking/modifiers/module.node.mjs
244890
- import { dirname as dirname14, posix, sep } from "path";
246514
+ import { dirname as dirname16, posix, sep } from "path";
244891
246515
  function createModulerModifier() {
244892
246516
  const getModuleFromFileName = createGetModuleFromFilename();
244893
246517
  return async (frames) => {
@@ -244896,12 +246520,12 @@ function createModulerModifier() {
244896
246520
  return frames;
244897
246521
  };
244898
246522
  }
244899
- function createGetModuleFromFilename(basePath = process.argv[1] ? dirname14(process.argv[1]) : process.cwd(), isWindows4 = sep === "\\") {
244900
- const normalizedBase = isWindows4 ? normalizeWindowsPath2(basePath) : basePath;
246523
+ function createGetModuleFromFilename(basePath = process.argv[1] ? dirname16(process.argv[1]) : process.cwd(), isWindows5 = sep === "\\") {
246524
+ const normalizedBase = isWindows5 ? normalizeWindowsPath2(basePath) : basePath;
244901
246525
  return (filename) => {
244902
246526
  if (!filename)
244903
246527
  return;
244904
- const normalizedFilename = isWindows4 ? normalizeWindowsPath2(filename) : filename;
246528
+ const normalizedFilename = isWindows5 ? normalizeWindowsPath2(filename) : filename;
244905
246529
  let { dir, base: file2, ext } = posix.parse(normalizedFilename);
244906
246530
  if (ext === ".js" || ext === ".mjs" || ext === ".cjs")
244907
246531
  file2 = file2.slice(0, -1 * ext.length);
@@ -247174,14 +248798,14 @@ async function addSourceContext(frames) {
247174
248798
  return frames;
247175
248799
  }
247176
248800
  function getContextLinesFromFile(path19, ranges, output) {
247177
- return new Promise((resolve7) => {
248801
+ return new Promise((resolve9) => {
247178
248802
  const stream = createReadStream2(path19);
247179
248803
  const lineReaded = createInterface2({
247180
248804
  input: stream
247181
248805
  });
247182
248806
  function destroyStreamAndResolve() {
247183
248807
  stream.destroy();
247184
- resolve7();
248808
+ resolve9();
247185
248809
  }
247186
248810
  let lineNumber = 0;
247187
248811
  let currentRangeIndex = 0;
@@ -248293,15 +249917,15 @@ class PostHogBackendClient extends PostHogCoreStateless {
248293
249917
  return true;
248294
249918
  if (this.featureFlagsPoller === undefined)
248295
249919
  return false;
248296
- return new Promise((resolve7) => {
249920
+ return new Promise((resolve9) => {
248297
249921
  const timeout3 = setTimeout(() => {
248298
249922
  cleanup();
248299
- resolve7(false);
249923
+ resolve9(false);
248300
249924
  }, timeoutMs);
248301
249925
  const cleanup = this._events.on("localEvaluationFlagsLoaded", (count2) => {
248302
249926
  clearTimeout(timeout3);
248303
249927
  cleanup();
248304
- resolve7(count2 > 0);
249928
+ resolve9(count2 > 0);
248305
249929
  });
248306
249930
  });
248307
249931
  }
@@ -249114,4 +250738,4 @@ export {
249114
250738
  CLIExitError
249115
250739
  };
249116
250740
 
249117
- //# debugId=ADA50D6B6C58BDA764756E2164756E21
250741
+ //# debugId=AFD2B8CB8876F48464756E2164756E21