@kubb/core 2.0.6 → 2.1.1

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.
Files changed (71) hide show
  1. package/dist/chunk-5P7ZNIXW.js +15 -0
  2. package/dist/chunk-5P7ZNIXW.js.map +1 -0
  3. package/dist/chunk-65JU7D5L.cjs +29 -0
  4. package/dist/chunk-65JU7D5L.cjs.map +1 -0
  5. package/dist/chunk-6CLGRKHL.js +1859 -0
  6. package/dist/chunk-6CLGRKHL.js.map +1 -0
  7. package/dist/chunk-6TTDLGHW.cjs +2548 -0
  8. package/dist/chunk-6TTDLGHW.cjs.map +1 -0
  9. package/dist/{chunk-XDHI63G7.cjs → chunk-BOAROBF4.cjs} +4 -4
  10. package/dist/chunk-BYGMREPJ.cjs +15 -0
  11. package/dist/chunk-BYGMREPJ.cjs.map +1 -0
  12. package/dist/{chunk-WZQO3EPM.cjs → chunk-CDC7AOGD.cjs} +3 -3
  13. package/dist/{chunk-WZQO3EPM.cjs.map → chunk-CDC7AOGD.cjs.map} +1 -1
  14. package/dist/{chunk-PLVKILIY.cjs → chunk-DQ3TMDDK.cjs} +7 -7
  15. package/dist/{chunk-5TK7TMV6.cjs → chunk-DU6UHGVD.cjs} +5 -5
  16. package/dist/{chunk-K2H7BYQB.js → chunk-EOUT5FJT.js} +3 -3
  17. package/dist/chunk-GPCFICX2.js +29 -0
  18. package/dist/chunk-GPCFICX2.js.map +1 -0
  19. package/dist/{chunk-4A7WG6IA.js → chunk-GQGYHVNX.js} +4 -25
  20. package/dist/chunk-GQGYHVNX.js.map +1 -0
  21. package/dist/{chunk-54P4AWHI.js → chunk-GUCIIN3Z.js} +3 -3
  22. package/dist/{chunk-54P4AWHI.js.map → chunk-GUCIIN3Z.js.map} +1 -1
  23. package/dist/{chunk-H47IKRXJ.cjs → chunk-IZOYUU2C.cjs} +6 -29
  24. package/dist/chunk-IZOYUU2C.cjs.map +1 -0
  25. package/dist/{chunk-NAWI7UXW.js → chunk-JSVMBHJE.js} +6 -12
  26. package/dist/chunk-JSVMBHJE.js.map +1 -0
  27. package/dist/{chunk-HIE46T3F.js → chunk-LIEJUR4C.js} +2 -2
  28. package/dist/{chunk-W2FP7ZWW.cjs → chunk-PTGWQCIU.cjs} +7 -15
  29. package/dist/chunk-PTGWQCIU.cjs.map +1 -0
  30. package/dist/{chunk-7S67BJXQ.js → chunk-QJQ3GMYY.js} +2 -2
  31. package/dist/{chunk-E3ANGQ5N.cjs → chunk-WHFBT7CJ.cjs} +90 -90
  32. package/dist/{chunk-XPOF4D5N.js → chunk-ZXH2OPE4.js} +2 -2
  33. package/dist/fs.cjs +10 -9
  34. package/dist/fs.cjs.map +1 -1
  35. package/dist/fs.js +4 -3
  36. package/dist/fs.js.map +1 -1
  37. package/dist/index.cjs +171 -2637
  38. package/dist/index.cjs.map +1 -1
  39. package/dist/index.d.cts +2 -2
  40. package/dist/index.d.ts +2 -2
  41. package/dist/index.js +36 -1847
  42. package/dist/index.js.map +1 -1
  43. package/dist/logger.cjs +7 -7
  44. package/dist/logger.js +3 -3
  45. package/dist/mocks.cjs +40 -0
  46. package/dist/mocks.cjs.map +1 -0
  47. package/dist/mocks.d.cts +11 -0
  48. package/dist/mocks.d.ts +11 -0
  49. package/dist/mocks.js +41 -0
  50. package/dist/mocks.js.map +1 -0
  51. package/dist/transformers.cjs +21 -21
  52. package/dist/transformers.js +5 -5
  53. package/dist/utils.cjs +13 -12
  54. package/dist/utils.cjs.map +1 -1
  55. package/dist/utils.js +4 -3
  56. package/dist/utils.js.map +1 -1
  57. package/package.json +10 -5
  58. package/src/BarrelManager.ts +43 -17
  59. package/src/FileManager.ts +33 -26
  60. package/dist/chunk-4A7WG6IA.js.map +0 -1
  61. package/dist/chunk-H47IKRXJ.cjs.map +0 -1
  62. package/dist/chunk-NAWI7UXW.js.map +0 -1
  63. package/dist/chunk-W2FP7ZWW.cjs.map +0 -1
  64. /package/dist/{chunk-XDHI63G7.cjs.map → chunk-BOAROBF4.cjs.map} +0 -0
  65. /package/dist/{chunk-PLVKILIY.cjs.map → chunk-DQ3TMDDK.cjs.map} +0 -0
  66. /package/dist/{chunk-5TK7TMV6.cjs.map → chunk-DU6UHGVD.cjs.map} +0 -0
  67. /package/dist/{chunk-K2H7BYQB.js.map → chunk-EOUT5FJT.js.map} +0 -0
  68. /package/dist/{chunk-HIE46T3F.js.map → chunk-LIEJUR4C.js.map} +0 -0
  69. /package/dist/{chunk-7S67BJXQ.js.map → chunk-QJQ3GMYY.js.map} +0 -0
  70. /package/dist/{chunk-E3ANGQ5N.cjs.map → chunk-WHFBT7CJ.cjs.map} +0 -0
  71. /package/dist/{chunk-XPOF4D5N.js.map → chunk-ZXH2OPE4.js.map} +0 -0
@@ -0,0 +1,2548 @@
1
+ 'use strict';
2
+
3
+ var chunkDU6UHGVD_cjs = require('./chunk-DU6UHGVD.cjs');
4
+ var chunk65JU7D5L_cjs = require('./chunk-65JU7D5L.cjs');
5
+ var chunkDQ3TMDDK_cjs = require('./chunk-DQ3TMDDK.cjs');
6
+ var chunkPTGWQCIU_cjs = require('./chunk-PTGWQCIU.cjs');
7
+ var chunkWHFBT7CJ_cjs = require('./chunk-WHFBT7CJ.cjs');
8
+ var chunkCDC7AOGD_cjs = require('./chunk-CDC7AOGD.cjs');
9
+ var crypto = require('crypto');
10
+ var path = require('path');
11
+ var parser = require('@kubb/parser');
12
+ var factory = require('@kubb/parser/factory');
13
+ var naturalOrderby = require('natural-orderby');
14
+ var dirTree = require('directory-tree');
15
+ var events = require('events');
16
+
17
+ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
18
+
19
+ function _interopNamespace(e) {
20
+ if (e && e.__esModule) return e;
21
+ var n = Object.create(null);
22
+ if (e) {
23
+ Object.keys(e).forEach(function (k) {
24
+ if (k !== 'default') {
25
+ var d = Object.getOwnPropertyDescriptor(e, k);
26
+ Object.defineProperty(n, k, d.get ? d : {
27
+ enumerable: true,
28
+ get: function () { return e[k]; }
29
+ });
30
+ }
31
+ });
32
+ }
33
+ n.default = e;
34
+ return Object.freeze(n);
35
+ }
36
+
37
+ var crypto__default = /*#__PURE__*/_interopDefault(crypto);
38
+ var path__default = /*#__PURE__*/_interopDefault(path);
39
+ var factory__namespace = /*#__PURE__*/_interopNamespace(factory);
40
+ var dirTree__default = /*#__PURE__*/_interopDefault(dirTree);
41
+
42
+ // ../../node_modules/.pnpm/lodash.isequal@4.5.0/node_modules/lodash.isequal/index.js
43
+ var require_lodash = chunkCDC7AOGD_cjs.__commonJS({
44
+ "../../node_modules/.pnpm/lodash.isequal@4.5.0/node_modules/lodash.isequal/index.js"(exports, module) {
45
+ chunkCDC7AOGD_cjs.init_cjs_shims();
46
+ var LARGE_ARRAY_SIZE = 200;
47
+ var HASH_UNDEFINED = "__lodash_hash_undefined__";
48
+ var COMPARE_PARTIAL_FLAG = 1;
49
+ var COMPARE_UNORDERED_FLAG = 2;
50
+ var MAX_SAFE_INTEGER = 9007199254740991;
51
+ var argsTag = "[object Arguments]";
52
+ var arrayTag = "[object Array]";
53
+ var asyncTag = "[object AsyncFunction]";
54
+ var boolTag = "[object Boolean]";
55
+ var dateTag = "[object Date]";
56
+ var errorTag = "[object Error]";
57
+ var funcTag = "[object Function]";
58
+ var genTag = "[object GeneratorFunction]";
59
+ var mapTag = "[object Map]";
60
+ var numberTag = "[object Number]";
61
+ var nullTag = "[object Null]";
62
+ var objectTag = "[object Object]";
63
+ var promiseTag = "[object Promise]";
64
+ var proxyTag = "[object Proxy]";
65
+ var regexpTag = "[object RegExp]";
66
+ var setTag = "[object Set]";
67
+ var stringTag = "[object String]";
68
+ var symbolTag = "[object Symbol]";
69
+ var undefinedTag = "[object Undefined]";
70
+ var weakMapTag = "[object WeakMap]";
71
+ var arrayBufferTag = "[object ArrayBuffer]";
72
+ var dataViewTag = "[object DataView]";
73
+ var float32Tag = "[object Float32Array]";
74
+ var float64Tag = "[object Float64Array]";
75
+ var int8Tag = "[object Int8Array]";
76
+ var int16Tag = "[object Int16Array]";
77
+ var int32Tag = "[object Int32Array]";
78
+ var uint8Tag = "[object Uint8Array]";
79
+ var uint8ClampedTag = "[object Uint8ClampedArray]";
80
+ var uint16Tag = "[object Uint16Array]";
81
+ var uint32Tag = "[object Uint32Array]";
82
+ var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
83
+ var reIsHostCtor = /^\[object .+?Constructor\]$/;
84
+ var reIsUint = /^(?:0|[1-9]\d*)$/;
85
+ var typedArrayTags = {};
86
+ typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true;
87
+ typedArrayTags[argsTag] = typedArrayTags[arrayTag] = typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = typedArrayTags[errorTag] = typedArrayTags[funcTag] = typedArrayTags[mapTag] = typedArrayTags[numberTag] = typedArrayTags[objectTag] = typedArrayTags[regexpTag] = typedArrayTags[setTag] = typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false;
88
+ var freeGlobal = typeof global == "object" && global && global.Object === Object && global;
89
+ var freeSelf = typeof self == "object" && self && self.Object === Object && self;
90
+ var root = freeGlobal || freeSelf || Function("return this")();
91
+ var freeExports = typeof exports == "object" && exports && !exports.nodeType && exports;
92
+ var freeModule = freeExports && typeof module == "object" && module && !module.nodeType && module;
93
+ var moduleExports = freeModule && freeModule.exports === freeExports;
94
+ var freeProcess = moduleExports && freeGlobal.process;
95
+ var nodeUtil = function() {
96
+ try {
97
+ return freeProcess && freeProcess.binding && freeProcess.binding("util");
98
+ } catch (e) {
99
+ }
100
+ }();
101
+ var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
102
+ function arrayFilter(array, predicate) {
103
+ var index = -1, length = array == null ? 0 : array.length, resIndex = 0, result = [];
104
+ while (++index < length) {
105
+ var value = array[index];
106
+ if (predicate(value, index, array)) {
107
+ result[resIndex++] = value;
108
+ }
109
+ }
110
+ return result;
111
+ }
112
+ function arrayPush(array, values) {
113
+ var index = -1, length = values.length, offset = array.length;
114
+ while (++index < length) {
115
+ array[offset + index] = values[index];
116
+ }
117
+ return array;
118
+ }
119
+ function arraySome(array, predicate) {
120
+ var index = -1, length = array == null ? 0 : array.length;
121
+ while (++index < length) {
122
+ if (predicate(array[index], index, array)) {
123
+ return true;
124
+ }
125
+ }
126
+ return false;
127
+ }
128
+ function baseTimes(n, iteratee) {
129
+ var index = -1, result = Array(n);
130
+ while (++index < n) {
131
+ result[index] = iteratee(index);
132
+ }
133
+ return result;
134
+ }
135
+ function baseUnary(func) {
136
+ return function(value) {
137
+ return func(value);
138
+ };
139
+ }
140
+ function cacheHas(cache, key) {
141
+ return cache.has(key);
142
+ }
143
+ function getValue(object, key) {
144
+ return object == null ? void 0 : object[key];
145
+ }
146
+ function mapToArray(map) {
147
+ var index = -1, result = Array(map.size);
148
+ map.forEach(function(value, key) {
149
+ result[++index] = [key, value];
150
+ });
151
+ return result;
152
+ }
153
+ function overArg(func, transform) {
154
+ return function(arg) {
155
+ return func(transform(arg));
156
+ };
157
+ }
158
+ function setToArray(set) {
159
+ var index = -1, result = Array(set.size);
160
+ set.forEach(function(value) {
161
+ result[++index] = value;
162
+ });
163
+ return result;
164
+ }
165
+ var arrayProto = Array.prototype;
166
+ var funcProto = Function.prototype;
167
+ var objectProto = Object.prototype;
168
+ var coreJsData = root["__core-js_shared__"];
169
+ var funcToString = funcProto.toString;
170
+ var hasOwnProperty = objectProto.hasOwnProperty;
171
+ var maskSrcKey = function() {
172
+ var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || "");
173
+ return uid ? "Symbol(src)_1." + uid : "";
174
+ }();
175
+ var nativeObjectToString = objectProto.toString;
176
+ var reIsNative = RegExp(
177
+ "^" + funcToString.call(hasOwnProperty).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
178
+ );
179
+ var Buffer = moduleExports ? root.Buffer : void 0;
180
+ var Symbol = root.Symbol;
181
+ var Uint8Array = root.Uint8Array;
182
+ var propertyIsEnumerable = objectProto.propertyIsEnumerable;
183
+ var splice = arrayProto.splice;
184
+ var symToStringTag = Symbol ? Symbol.toStringTag : void 0;
185
+ var nativeGetSymbols = Object.getOwnPropertySymbols;
186
+ var nativeIsBuffer = Buffer ? Buffer.isBuffer : void 0;
187
+ var nativeKeys = overArg(Object.keys, Object);
188
+ var DataView = getNative(root, "DataView");
189
+ var Map2 = getNative(root, "Map");
190
+ var Promise2 = getNative(root, "Promise");
191
+ var Set2 = getNative(root, "Set");
192
+ var WeakMap2 = getNative(root, "WeakMap");
193
+ var nativeCreate = getNative(Object, "create");
194
+ var dataViewCtorString = toSource(DataView);
195
+ var mapCtorString = toSource(Map2);
196
+ var promiseCtorString = toSource(Promise2);
197
+ var setCtorString = toSource(Set2);
198
+ var weakMapCtorString = toSource(WeakMap2);
199
+ var symbolProto = Symbol ? Symbol.prototype : void 0;
200
+ var symbolValueOf = symbolProto ? symbolProto.valueOf : void 0;
201
+ function Hash(entries) {
202
+ var index = -1, length = entries == null ? 0 : entries.length;
203
+ this.clear();
204
+ while (++index < length) {
205
+ var entry = entries[index];
206
+ this.set(entry[0], entry[1]);
207
+ }
208
+ }
209
+ function hashClear() {
210
+ this.__data__ = nativeCreate ? nativeCreate(null) : {};
211
+ this.size = 0;
212
+ }
213
+ function hashDelete(key) {
214
+ var result = this.has(key) && delete this.__data__[key];
215
+ this.size -= result ? 1 : 0;
216
+ return result;
217
+ }
218
+ function hashGet(key) {
219
+ var data = this.__data__;
220
+ if (nativeCreate) {
221
+ var result = data[key];
222
+ return result === HASH_UNDEFINED ? void 0 : result;
223
+ }
224
+ return hasOwnProperty.call(data, key) ? data[key] : void 0;
225
+ }
226
+ function hashHas(key) {
227
+ var data = this.__data__;
228
+ return nativeCreate ? data[key] !== void 0 : hasOwnProperty.call(data, key);
229
+ }
230
+ function hashSet(key, value) {
231
+ var data = this.__data__;
232
+ this.size += this.has(key) ? 0 : 1;
233
+ data[key] = nativeCreate && value === void 0 ? HASH_UNDEFINED : value;
234
+ return this;
235
+ }
236
+ Hash.prototype.clear = hashClear;
237
+ Hash.prototype["delete"] = hashDelete;
238
+ Hash.prototype.get = hashGet;
239
+ Hash.prototype.has = hashHas;
240
+ Hash.prototype.set = hashSet;
241
+ function ListCache(entries) {
242
+ var index = -1, length = entries == null ? 0 : entries.length;
243
+ this.clear();
244
+ while (++index < length) {
245
+ var entry = entries[index];
246
+ this.set(entry[0], entry[1]);
247
+ }
248
+ }
249
+ function listCacheClear() {
250
+ this.__data__ = [];
251
+ this.size = 0;
252
+ }
253
+ function listCacheDelete(key) {
254
+ var data = this.__data__, index = assocIndexOf(data, key);
255
+ if (index < 0) {
256
+ return false;
257
+ }
258
+ var lastIndex = data.length - 1;
259
+ if (index == lastIndex) {
260
+ data.pop();
261
+ } else {
262
+ splice.call(data, index, 1);
263
+ }
264
+ --this.size;
265
+ return true;
266
+ }
267
+ function listCacheGet(key) {
268
+ var data = this.__data__, index = assocIndexOf(data, key);
269
+ return index < 0 ? void 0 : data[index][1];
270
+ }
271
+ function listCacheHas(key) {
272
+ return assocIndexOf(this.__data__, key) > -1;
273
+ }
274
+ function listCacheSet(key, value) {
275
+ var data = this.__data__, index = assocIndexOf(data, key);
276
+ if (index < 0) {
277
+ ++this.size;
278
+ data.push([key, value]);
279
+ } else {
280
+ data[index][1] = value;
281
+ }
282
+ return this;
283
+ }
284
+ ListCache.prototype.clear = listCacheClear;
285
+ ListCache.prototype["delete"] = listCacheDelete;
286
+ ListCache.prototype.get = listCacheGet;
287
+ ListCache.prototype.has = listCacheHas;
288
+ ListCache.prototype.set = listCacheSet;
289
+ function MapCache(entries) {
290
+ var index = -1, length = entries == null ? 0 : entries.length;
291
+ this.clear();
292
+ while (++index < length) {
293
+ var entry = entries[index];
294
+ this.set(entry[0], entry[1]);
295
+ }
296
+ }
297
+ function mapCacheClear() {
298
+ this.size = 0;
299
+ this.__data__ = {
300
+ "hash": new Hash(),
301
+ "map": new (Map2 || ListCache)(),
302
+ "string": new Hash()
303
+ };
304
+ }
305
+ function mapCacheDelete(key) {
306
+ var result = getMapData(this, key)["delete"](key);
307
+ this.size -= result ? 1 : 0;
308
+ return result;
309
+ }
310
+ function mapCacheGet(key) {
311
+ return getMapData(this, key).get(key);
312
+ }
313
+ function mapCacheHas(key) {
314
+ return getMapData(this, key).has(key);
315
+ }
316
+ function mapCacheSet(key, value) {
317
+ var data = getMapData(this, key), size = data.size;
318
+ data.set(key, value);
319
+ this.size += data.size == size ? 0 : 1;
320
+ return this;
321
+ }
322
+ MapCache.prototype.clear = mapCacheClear;
323
+ MapCache.prototype["delete"] = mapCacheDelete;
324
+ MapCache.prototype.get = mapCacheGet;
325
+ MapCache.prototype.has = mapCacheHas;
326
+ MapCache.prototype.set = mapCacheSet;
327
+ function SetCache(values) {
328
+ var index = -1, length = values == null ? 0 : values.length;
329
+ this.__data__ = new MapCache();
330
+ while (++index < length) {
331
+ this.add(values[index]);
332
+ }
333
+ }
334
+ function setCacheAdd(value) {
335
+ this.__data__.set(value, HASH_UNDEFINED);
336
+ return this;
337
+ }
338
+ function setCacheHas(value) {
339
+ return this.__data__.has(value);
340
+ }
341
+ SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
342
+ SetCache.prototype.has = setCacheHas;
343
+ function Stack(entries) {
344
+ var data = this.__data__ = new ListCache(entries);
345
+ this.size = data.size;
346
+ }
347
+ function stackClear() {
348
+ this.__data__ = new ListCache();
349
+ this.size = 0;
350
+ }
351
+ function stackDelete(key) {
352
+ var data = this.__data__, result = data["delete"](key);
353
+ this.size = data.size;
354
+ return result;
355
+ }
356
+ function stackGet(key) {
357
+ return this.__data__.get(key);
358
+ }
359
+ function stackHas(key) {
360
+ return this.__data__.has(key);
361
+ }
362
+ function stackSet(key, value) {
363
+ var data = this.__data__;
364
+ if (data instanceof ListCache) {
365
+ var pairs = data.__data__;
366
+ if (!Map2 || pairs.length < LARGE_ARRAY_SIZE - 1) {
367
+ pairs.push([key, value]);
368
+ this.size = ++data.size;
369
+ return this;
370
+ }
371
+ data = this.__data__ = new MapCache(pairs);
372
+ }
373
+ data.set(key, value);
374
+ this.size = data.size;
375
+ return this;
376
+ }
377
+ Stack.prototype.clear = stackClear;
378
+ Stack.prototype["delete"] = stackDelete;
379
+ Stack.prototype.get = stackGet;
380
+ Stack.prototype.has = stackHas;
381
+ Stack.prototype.set = stackSet;
382
+ function arrayLikeKeys(value, inherited) {
383
+ var isArr = isArray(value), isArg = !isArr && isArguments(value), isBuff = !isArr && !isArg && isBuffer(value), isType = !isArr && !isArg && !isBuff && isTypedArray(value), skipIndexes = isArr || isArg || isBuff || isType, result = skipIndexes ? baseTimes(value.length, String) : [], length = result.length;
384
+ for (var key in value) {
385
+ if ((inherited || hasOwnProperty.call(value, key)) && !(skipIndexes && // Safari 9 has enumerable `arguments.length` in strict mode.
386
+ (key == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
387
+ isBuff && (key == "offset" || key == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
388
+ isType && (key == "buffer" || key == "byteLength" || key == "byteOffset") || // Skip index properties.
389
+ isIndex(key, length)))) {
390
+ result.push(key);
391
+ }
392
+ }
393
+ return result;
394
+ }
395
+ function assocIndexOf(array, key) {
396
+ var length = array.length;
397
+ while (length--) {
398
+ if (eq(array[length][0], key)) {
399
+ return length;
400
+ }
401
+ }
402
+ return -1;
403
+ }
404
+ function baseGetAllKeys(object, keysFunc, symbolsFunc) {
405
+ var result = keysFunc(object);
406
+ return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
407
+ }
408
+ function baseGetTag(value) {
409
+ if (value == null) {
410
+ return value === void 0 ? undefinedTag : nullTag;
411
+ }
412
+ return symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString(value);
413
+ }
414
+ function baseIsArguments(value) {
415
+ return isObjectLike(value) && baseGetTag(value) == argsTag;
416
+ }
417
+ function baseIsEqual(value, other, bitmask, customizer, stack) {
418
+ if (value === other) {
419
+ return true;
420
+ }
421
+ if (value == null || other == null || !isObjectLike(value) && !isObjectLike(other)) {
422
+ return value !== value && other !== other;
423
+ }
424
+ return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
425
+ }
426
+ function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
427
+ var objIsArr = isArray(object), othIsArr = isArray(other), objTag = objIsArr ? arrayTag : getTag(object), othTag = othIsArr ? arrayTag : getTag(other);
428
+ objTag = objTag == argsTag ? objectTag : objTag;
429
+ othTag = othTag == argsTag ? objectTag : othTag;
430
+ var objIsObj = objTag == objectTag, othIsObj = othTag == objectTag, isSameTag = objTag == othTag;
431
+ if (isSameTag && isBuffer(object)) {
432
+ if (!isBuffer(other)) {
433
+ return false;
434
+ }
435
+ objIsArr = true;
436
+ objIsObj = false;
437
+ }
438
+ if (isSameTag && !objIsObj) {
439
+ stack || (stack = new Stack());
440
+ return objIsArr || isTypedArray(object) ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
441
+ }
442
+ if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
443
+ var objIsWrapped = objIsObj && hasOwnProperty.call(object, "__wrapped__"), othIsWrapped = othIsObj && hasOwnProperty.call(other, "__wrapped__");
444
+ if (objIsWrapped || othIsWrapped) {
445
+ var objUnwrapped = objIsWrapped ? object.value() : object, othUnwrapped = othIsWrapped ? other.value() : other;
446
+ stack || (stack = new Stack());
447
+ return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
448
+ }
449
+ }
450
+ if (!isSameTag) {
451
+ return false;
452
+ }
453
+ stack || (stack = new Stack());
454
+ return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
455
+ }
456
+ function baseIsNative(value) {
457
+ if (!isObject(value) || isMasked(value)) {
458
+ return false;
459
+ }
460
+ var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
461
+ return pattern.test(toSource(value));
462
+ }
463
+ function baseIsTypedArray(value) {
464
+ return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
465
+ }
466
+ function baseKeys(object) {
467
+ if (!isPrototype(object)) {
468
+ return nativeKeys(object);
469
+ }
470
+ var result = [];
471
+ for (var key in Object(object)) {
472
+ if (hasOwnProperty.call(object, key) && key != "constructor") {
473
+ result.push(key);
474
+ }
475
+ }
476
+ return result;
477
+ }
478
+ function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
479
+ var isPartial = bitmask & COMPARE_PARTIAL_FLAG, arrLength = array.length, othLength = other.length;
480
+ if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
481
+ return false;
482
+ }
483
+ var stacked = stack.get(array);
484
+ if (stacked && stack.get(other)) {
485
+ return stacked == other;
486
+ }
487
+ var index = -1, result = true, seen = bitmask & COMPARE_UNORDERED_FLAG ? new SetCache() : void 0;
488
+ stack.set(array, other);
489
+ stack.set(other, array);
490
+ while (++index < arrLength) {
491
+ var arrValue = array[index], othValue = other[index];
492
+ if (customizer) {
493
+ var compared = isPartial ? customizer(othValue, arrValue, index, other, array, stack) : customizer(arrValue, othValue, index, array, other, stack);
494
+ }
495
+ if (compared !== void 0) {
496
+ if (compared) {
497
+ continue;
498
+ }
499
+ result = false;
500
+ break;
501
+ }
502
+ if (seen) {
503
+ if (!arraySome(other, function(othValue2, othIndex) {
504
+ if (!cacheHas(seen, othIndex) && (arrValue === othValue2 || equalFunc(arrValue, othValue2, bitmask, customizer, stack))) {
505
+ return seen.push(othIndex);
506
+ }
507
+ })) {
508
+ result = false;
509
+ break;
510
+ }
511
+ } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
512
+ result = false;
513
+ break;
514
+ }
515
+ }
516
+ stack["delete"](array);
517
+ stack["delete"](other);
518
+ return result;
519
+ }
520
+ function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
521
+ switch (tag) {
522
+ case dataViewTag:
523
+ if (object.byteLength != other.byteLength || object.byteOffset != other.byteOffset) {
524
+ return false;
525
+ }
526
+ object = object.buffer;
527
+ other = other.buffer;
528
+ case arrayBufferTag:
529
+ if (object.byteLength != other.byteLength || !equalFunc(new Uint8Array(object), new Uint8Array(other))) {
530
+ return false;
531
+ }
532
+ return true;
533
+ case boolTag:
534
+ case dateTag:
535
+ case numberTag:
536
+ return eq(+object, +other);
537
+ case errorTag:
538
+ return object.name == other.name && object.message == other.message;
539
+ case regexpTag:
540
+ case stringTag:
541
+ return object == other + "";
542
+ case mapTag:
543
+ var convert = mapToArray;
544
+ case setTag:
545
+ var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
546
+ convert || (convert = setToArray);
547
+ if (object.size != other.size && !isPartial) {
548
+ return false;
549
+ }
550
+ var stacked = stack.get(object);
551
+ if (stacked) {
552
+ return stacked == other;
553
+ }
554
+ bitmask |= COMPARE_UNORDERED_FLAG;
555
+ stack.set(object, other);
556
+ var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
557
+ stack["delete"](object);
558
+ return result;
559
+ case symbolTag:
560
+ if (symbolValueOf) {
561
+ return symbolValueOf.call(object) == symbolValueOf.call(other);
562
+ }
563
+ }
564
+ return false;
565
+ }
566
+ function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
567
+ var isPartial = bitmask & COMPARE_PARTIAL_FLAG, objProps = getAllKeys(object), objLength = objProps.length, othProps = getAllKeys(other), othLength = othProps.length;
568
+ if (objLength != othLength && !isPartial) {
569
+ return false;
570
+ }
571
+ var index = objLength;
572
+ while (index--) {
573
+ var key = objProps[index];
574
+ if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
575
+ return false;
576
+ }
577
+ }
578
+ var stacked = stack.get(object);
579
+ if (stacked && stack.get(other)) {
580
+ return stacked == other;
581
+ }
582
+ var result = true;
583
+ stack.set(object, other);
584
+ stack.set(other, object);
585
+ var skipCtor = isPartial;
586
+ while (++index < objLength) {
587
+ key = objProps[index];
588
+ var objValue = object[key], othValue = other[key];
589
+ if (customizer) {
590
+ var compared = isPartial ? customizer(othValue, objValue, key, other, object, stack) : customizer(objValue, othValue, key, object, other, stack);
591
+ }
592
+ if (!(compared === void 0 ? objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack) : compared)) {
593
+ result = false;
594
+ break;
595
+ }
596
+ skipCtor || (skipCtor = key == "constructor");
597
+ }
598
+ if (result && !skipCtor) {
599
+ var objCtor = object.constructor, othCtor = other.constructor;
600
+ if (objCtor != othCtor && ("constructor" in object && "constructor" in other) && !(typeof objCtor == "function" && objCtor instanceof objCtor && typeof othCtor == "function" && othCtor instanceof othCtor)) {
601
+ result = false;
602
+ }
603
+ }
604
+ stack["delete"](object);
605
+ stack["delete"](other);
606
+ return result;
607
+ }
608
+ function getAllKeys(object) {
609
+ return baseGetAllKeys(object, keys, getSymbols);
610
+ }
611
+ function getMapData(map, key) {
612
+ var data = map.__data__;
613
+ return isKeyable(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map;
614
+ }
615
+ function getNative(object, key) {
616
+ var value = getValue(object, key);
617
+ return baseIsNative(value) ? value : void 0;
618
+ }
619
+ function getRawTag(value) {
620
+ var isOwn = hasOwnProperty.call(value, symToStringTag), tag = value[symToStringTag];
621
+ try {
622
+ value[symToStringTag] = void 0;
623
+ var unmasked = true;
624
+ } catch (e) {
625
+ }
626
+ var result = nativeObjectToString.call(value);
627
+ if (unmasked) {
628
+ if (isOwn) {
629
+ value[symToStringTag] = tag;
630
+ } else {
631
+ delete value[symToStringTag];
632
+ }
633
+ }
634
+ return result;
635
+ }
636
+ var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
637
+ if (object == null) {
638
+ return [];
639
+ }
640
+ object = Object(object);
641
+ return arrayFilter(nativeGetSymbols(object), function(symbol) {
642
+ return propertyIsEnumerable.call(object, symbol);
643
+ });
644
+ };
645
+ var getTag = baseGetTag;
646
+ if (DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag || Map2 && getTag(new Map2()) != mapTag || Promise2 && getTag(Promise2.resolve()) != promiseTag || Set2 && getTag(new Set2()) != setTag || WeakMap2 && getTag(new WeakMap2()) != weakMapTag) {
647
+ getTag = function(value) {
648
+ var result = baseGetTag(value), Ctor = result == objectTag ? value.constructor : void 0, ctorString = Ctor ? toSource(Ctor) : "";
649
+ if (ctorString) {
650
+ switch (ctorString) {
651
+ case dataViewCtorString:
652
+ return dataViewTag;
653
+ case mapCtorString:
654
+ return mapTag;
655
+ case promiseCtorString:
656
+ return promiseTag;
657
+ case setCtorString:
658
+ return setTag;
659
+ case weakMapCtorString:
660
+ return weakMapTag;
661
+ }
662
+ }
663
+ return result;
664
+ };
665
+ }
666
+ function isIndex(value, length) {
667
+ length = length == null ? MAX_SAFE_INTEGER : length;
668
+ return !!length && (typeof value == "number" || reIsUint.test(value)) && (value > -1 && value % 1 == 0 && value < length);
669
+ }
670
+ function isKeyable(value) {
671
+ var type = typeof value;
672
+ return type == "string" || type == "number" || type == "symbol" || type == "boolean" ? value !== "__proto__" : value === null;
673
+ }
674
+ function isMasked(func) {
675
+ return !!maskSrcKey && maskSrcKey in func;
676
+ }
677
+ function isPrototype(value) {
678
+ var Ctor = value && value.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto;
679
+ return value === proto;
680
+ }
681
+ function objectToString(value) {
682
+ return nativeObjectToString.call(value);
683
+ }
684
+ function toSource(func) {
685
+ if (func != null) {
686
+ try {
687
+ return funcToString.call(func);
688
+ } catch (e) {
689
+ }
690
+ try {
691
+ return func + "";
692
+ } catch (e) {
693
+ }
694
+ }
695
+ return "";
696
+ }
697
+ function eq(value, other) {
698
+ return value === other || value !== value && other !== other;
699
+ }
700
+ var isArguments = baseIsArguments(/* @__PURE__ */ function() {
701
+ return arguments;
702
+ }()) ? baseIsArguments : function(value) {
703
+ return isObjectLike(value) && hasOwnProperty.call(value, "callee") && !propertyIsEnumerable.call(value, "callee");
704
+ };
705
+ var isArray = Array.isArray;
706
+ function isArrayLike(value) {
707
+ return value != null && isLength(value.length) && !isFunction(value);
708
+ }
709
+ var isBuffer = nativeIsBuffer || stubFalse;
710
+ function isEqual2(value, other) {
711
+ return baseIsEqual(value, other);
712
+ }
713
+ function isFunction(value) {
714
+ if (!isObject(value)) {
715
+ return false;
716
+ }
717
+ var tag = baseGetTag(value);
718
+ return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
719
+ }
720
+ function isLength(value) {
721
+ return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
722
+ }
723
+ function isObject(value) {
724
+ var type = typeof value;
725
+ return value != null && (type == "object" || type == "function");
726
+ }
727
+ function isObjectLike(value) {
728
+ return value != null && typeof value == "object";
729
+ }
730
+ var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
731
+ function keys(object) {
732
+ return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
733
+ }
734
+ function stubArray() {
735
+ return [];
736
+ }
737
+ function stubFalse() {
738
+ return false;
739
+ }
740
+ module.exports = isEqual2;
741
+ }
742
+ });
743
+
744
+ // ../../node_modules/.pnpm/eventemitter3@5.0.1/node_modules/eventemitter3/index.js
745
+ var require_eventemitter3 = chunkCDC7AOGD_cjs.__commonJS({
746
+ "../../node_modules/.pnpm/eventemitter3@5.0.1/node_modules/eventemitter3/index.js"(exports, module) {
747
+ chunkCDC7AOGD_cjs.init_cjs_shims();
748
+ var has = Object.prototype.hasOwnProperty;
749
+ var prefix = "~";
750
+ function Events() {
751
+ }
752
+ if (Object.create) {
753
+ Events.prototype = /* @__PURE__ */ Object.create(null);
754
+ if (!new Events().__proto__)
755
+ prefix = false;
756
+ }
757
+ function EE(fn, context, once) {
758
+ this.fn = fn;
759
+ this.context = context;
760
+ this.once = once || false;
761
+ }
762
+ function addListener(emitter, event, fn, context, once) {
763
+ if (typeof fn !== "function") {
764
+ throw new TypeError("The listener must be a function");
765
+ }
766
+ var listener = new EE(fn, context || emitter, once), evt = prefix ? prefix + event : event;
767
+ if (!emitter._events[evt])
768
+ emitter._events[evt] = listener, emitter._eventsCount++;
769
+ else if (!emitter._events[evt].fn)
770
+ emitter._events[evt].push(listener);
771
+ else
772
+ emitter._events[evt] = [emitter._events[evt], listener];
773
+ return emitter;
774
+ }
775
+ function clearEvent(emitter, evt) {
776
+ if (--emitter._eventsCount === 0)
777
+ emitter._events = new Events();
778
+ else
779
+ delete emitter._events[evt];
780
+ }
781
+ function EventEmitter3() {
782
+ this._events = new Events();
783
+ this._eventsCount = 0;
784
+ }
785
+ EventEmitter3.prototype.eventNames = function eventNames() {
786
+ var names = [], events, name;
787
+ if (this._eventsCount === 0)
788
+ return names;
789
+ for (name in events = this._events) {
790
+ if (has.call(events, name))
791
+ names.push(prefix ? name.slice(1) : name);
792
+ }
793
+ if (Object.getOwnPropertySymbols) {
794
+ return names.concat(Object.getOwnPropertySymbols(events));
795
+ }
796
+ return names;
797
+ };
798
+ EventEmitter3.prototype.listeners = function listeners(event) {
799
+ var evt = prefix ? prefix + event : event, handlers = this._events[evt];
800
+ if (!handlers)
801
+ return [];
802
+ if (handlers.fn)
803
+ return [handlers.fn];
804
+ for (var i = 0, l = handlers.length, ee = new Array(l); i < l; i++) {
805
+ ee[i] = handlers[i].fn;
806
+ }
807
+ return ee;
808
+ };
809
+ EventEmitter3.prototype.listenerCount = function listenerCount(event) {
810
+ var evt = prefix ? prefix + event : event, listeners = this._events[evt];
811
+ if (!listeners)
812
+ return 0;
813
+ if (listeners.fn)
814
+ return 1;
815
+ return listeners.length;
816
+ };
817
+ EventEmitter3.prototype.emit = function emit(event, a1, a2, a3, a4, a5) {
818
+ var evt = prefix ? prefix + event : event;
819
+ if (!this._events[evt])
820
+ return false;
821
+ var listeners = this._events[evt], len = arguments.length, args, i;
822
+ if (listeners.fn) {
823
+ if (listeners.once)
824
+ this.removeListener(event, listeners.fn, void 0, true);
825
+ switch (len) {
826
+ case 1:
827
+ return listeners.fn.call(listeners.context), true;
828
+ case 2:
829
+ return listeners.fn.call(listeners.context, a1), true;
830
+ case 3:
831
+ return listeners.fn.call(listeners.context, a1, a2), true;
832
+ case 4:
833
+ return listeners.fn.call(listeners.context, a1, a2, a3), true;
834
+ case 5:
835
+ return listeners.fn.call(listeners.context, a1, a2, a3, a4), true;
836
+ case 6:
837
+ return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true;
838
+ }
839
+ for (i = 1, args = new Array(len - 1); i < len; i++) {
840
+ args[i - 1] = arguments[i];
841
+ }
842
+ listeners.fn.apply(listeners.context, args);
843
+ } else {
844
+ var length = listeners.length, j;
845
+ for (i = 0; i < length; i++) {
846
+ if (listeners[i].once)
847
+ this.removeListener(event, listeners[i].fn, void 0, true);
848
+ switch (len) {
849
+ case 1:
850
+ listeners[i].fn.call(listeners[i].context);
851
+ break;
852
+ case 2:
853
+ listeners[i].fn.call(listeners[i].context, a1);
854
+ break;
855
+ case 3:
856
+ listeners[i].fn.call(listeners[i].context, a1, a2);
857
+ break;
858
+ case 4:
859
+ listeners[i].fn.call(listeners[i].context, a1, a2, a3);
860
+ break;
861
+ default:
862
+ if (!args)
863
+ for (j = 1, args = new Array(len - 1); j < len; j++) {
864
+ args[j - 1] = arguments[j];
865
+ }
866
+ listeners[i].fn.apply(listeners[i].context, args);
867
+ }
868
+ }
869
+ }
870
+ return true;
871
+ };
872
+ EventEmitter3.prototype.on = function on(event, fn, context) {
873
+ return addListener(this, event, fn, context, false);
874
+ };
875
+ EventEmitter3.prototype.once = function once(event, fn, context) {
876
+ return addListener(this, event, fn, context, true);
877
+ };
878
+ EventEmitter3.prototype.removeListener = function removeListener(event, fn, context, once) {
879
+ var evt = prefix ? prefix + event : event;
880
+ if (!this._events[evt])
881
+ return this;
882
+ if (!fn) {
883
+ clearEvent(this, evt);
884
+ return this;
885
+ }
886
+ var listeners = this._events[evt];
887
+ if (listeners.fn) {
888
+ if (listeners.fn === fn && (!once || listeners.once) && (!context || listeners.context === context)) {
889
+ clearEvent(this, evt);
890
+ }
891
+ } else {
892
+ for (var i = 0, events = [], length = listeners.length; i < length; i++) {
893
+ if (listeners[i].fn !== fn || once && !listeners[i].once || context && listeners[i].context !== context) {
894
+ events.push(listeners[i]);
895
+ }
896
+ }
897
+ if (events.length)
898
+ this._events[evt] = events.length === 1 ? events[0] : events;
899
+ else
900
+ clearEvent(this, evt);
901
+ }
902
+ return this;
903
+ };
904
+ EventEmitter3.prototype.removeAllListeners = function removeAllListeners(event) {
905
+ var evt;
906
+ if (event) {
907
+ evt = prefix ? prefix + event : event;
908
+ if (this._events[evt])
909
+ clearEvent(this, evt);
910
+ } else {
911
+ this._events = new Events();
912
+ this._eventsCount = 0;
913
+ }
914
+ return this;
915
+ };
916
+ EventEmitter3.prototype.off = EventEmitter3.prototype.removeListener;
917
+ EventEmitter3.prototype.addListener = EventEmitter3.prototype.on;
918
+ EventEmitter3.prefixed = prefix;
919
+ EventEmitter3.EventEmitter = EventEmitter3;
920
+ if ("undefined" !== typeof module) {
921
+ module.exports = EventEmitter3;
922
+ }
923
+ }
924
+ });
925
+
926
+ // src/FileManager.ts
927
+ chunkCDC7AOGD_cjs.init_cjs_shims();
928
+ var import_lodash = chunkCDC7AOGD_cjs.__toESM(require_lodash(), 1);
929
+
930
+ // ../../node_modules/.pnpm/p-queue@8.0.1/node_modules/p-queue/dist/index.js
931
+ chunkCDC7AOGD_cjs.init_cjs_shims();
932
+
933
+ // ../../node_modules/.pnpm/eventemitter3@5.0.1/node_modules/eventemitter3/index.mjs
934
+ chunkCDC7AOGD_cjs.init_cjs_shims();
935
+ var import_index = chunkCDC7AOGD_cjs.__toESM(require_eventemitter3(), 1);
936
+
937
+ // ../../node_modules/.pnpm/p-timeout@6.1.2/node_modules/p-timeout/index.js
938
+ chunkCDC7AOGD_cjs.init_cjs_shims();
939
+ var TimeoutError = class extends Error {
940
+ constructor(message) {
941
+ super(message);
942
+ this.name = "TimeoutError";
943
+ }
944
+ };
945
+ var AbortError = class extends Error {
946
+ constructor(message) {
947
+ super();
948
+ this.name = "AbortError";
949
+ this.message = message;
950
+ }
951
+ };
952
+ var getDOMException = (errorMessage) => globalThis.DOMException === void 0 ? new AbortError(errorMessage) : new DOMException(errorMessage);
953
+ var getAbortedReason = (signal) => {
954
+ const reason = signal.reason === void 0 ? getDOMException("This operation was aborted.") : signal.reason;
955
+ return reason instanceof Error ? reason : getDOMException(reason);
956
+ };
957
+ function pTimeout(promise, options) {
958
+ const {
959
+ milliseconds,
960
+ fallback,
961
+ message,
962
+ customTimers = { setTimeout, clearTimeout }
963
+ } = options;
964
+ let timer;
965
+ const wrappedPromise = new Promise((resolve2, reject) => {
966
+ if (typeof milliseconds !== "number" || Math.sign(milliseconds) !== 1) {
967
+ throw new TypeError(`Expected \`milliseconds\` to be a positive number, got \`${milliseconds}\``);
968
+ }
969
+ if (options.signal) {
970
+ const { signal } = options;
971
+ if (signal.aborted) {
972
+ reject(getAbortedReason(signal));
973
+ }
974
+ signal.addEventListener("abort", () => {
975
+ reject(getAbortedReason(signal));
976
+ });
977
+ }
978
+ if (milliseconds === Number.POSITIVE_INFINITY) {
979
+ promise.then(resolve2, reject);
980
+ return;
981
+ }
982
+ const timeoutError = new TimeoutError();
983
+ timer = customTimers.setTimeout.call(void 0, () => {
984
+ if (fallback) {
985
+ try {
986
+ resolve2(fallback());
987
+ } catch (error) {
988
+ reject(error);
989
+ }
990
+ return;
991
+ }
992
+ if (typeof promise.cancel === "function") {
993
+ promise.cancel();
994
+ }
995
+ if (message === false) {
996
+ resolve2();
997
+ } else if (message instanceof Error) {
998
+ reject(message);
999
+ } else {
1000
+ timeoutError.message = message ?? `Promise timed out after ${milliseconds} milliseconds`;
1001
+ reject(timeoutError);
1002
+ }
1003
+ }, milliseconds);
1004
+ (async () => {
1005
+ try {
1006
+ resolve2(await promise);
1007
+ } catch (error) {
1008
+ reject(error);
1009
+ }
1010
+ })();
1011
+ });
1012
+ const cancelablePromise = wrappedPromise.finally(() => {
1013
+ cancelablePromise.clear();
1014
+ });
1015
+ cancelablePromise.clear = () => {
1016
+ customTimers.clearTimeout.call(void 0, timer);
1017
+ timer = void 0;
1018
+ };
1019
+ return cancelablePromise;
1020
+ }
1021
+
1022
+ // ../../node_modules/.pnpm/p-queue@8.0.1/node_modules/p-queue/dist/priority-queue.js
1023
+ chunkCDC7AOGD_cjs.init_cjs_shims();
1024
+
1025
+ // ../../node_modules/.pnpm/p-queue@8.0.1/node_modules/p-queue/dist/lower-bound.js
1026
+ chunkCDC7AOGD_cjs.init_cjs_shims();
1027
+ function lowerBound(array, value, comparator) {
1028
+ let first = 0;
1029
+ let count = array.length;
1030
+ while (count > 0) {
1031
+ const step = Math.trunc(count / 2);
1032
+ let it = first + step;
1033
+ if (comparator(array[it], value) <= 0) {
1034
+ first = ++it;
1035
+ count -= step + 1;
1036
+ } else {
1037
+ count = step;
1038
+ }
1039
+ }
1040
+ return first;
1041
+ }
1042
+
1043
+ // ../../node_modules/.pnpm/p-queue@8.0.1/node_modules/p-queue/dist/priority-queue.js
1044
+ var _queue;
1045
+ var PriorityQueue = class {
1046
+ constructor() {
1047
+ chunkCDC7AOGD_cjs.__privateAdd(this, _queue, []);
1048
+ }
1049
+ enqueue(run, options) {
1050
+ options = {
1051
+ priority: 0,
1052
+ ...options
1053
+ };
1054
+ const element = {
1055
+ priority: options.priority,
1056
+ run
1057
+ };
1058
+ if (this.size && chunkCDC7AOGD_cjs.__privateGet(this, _queue)[this.size - 1].priority >= options.priority) {
1059
+ chunkCDC7AOGD_cjs.__privateGet(this, _queue).push(element);
1060
+ return;
1061
+ }
1062
+ const index = lowerBound(chunkCDC7AOGD_cjs.__privateGet(this, _queue), element, (a, b) => b.priority - a.priority);
1063
+ chunkCDC7AOGD_cjs.__privateGet(this, _queue).splice(index, 0, element);
1064
+ }
1065
+ dequeue() {
1066
+ const item = chunkCDC7AOGD_cjs.__privateGet(this, _queue).shift();
1067
+ return item?.run;
1068
+ }
1069
+ filter(options) {
1070
+ return chunkCDC7AOGD_cjs.__privateGet(this, _queue).filter((element) => element.priority === options.priority).map((element) => element.run);
1071
+ }
1072
+ get size() {
1073
+ return chunkCDC7AOGD_cjs.__privateGet(this, _queue).length;
1074
+ }
1075
+ };
1076
+ _queue = new WeakMap();
1077
+
1078
+ // ../../node_modules/.pnpm/p-queue@8.0.1/node_modules/p-queue/dist/index.js
1079
+ var _carryoverConcurrencyCount, _isIntervalIgnored, _intervalCount, _intervalCap, _interval, _intervalEnd, _intervalId, _timeoutId, _queue2, _queueClass, _pending, _concurrency, _isPaused, _throwOnTimeout, _doesIntervalAllowAnother, doesIntervalAllowAnother_get, _doesConcurrentAllowAnother, doesConcurrentAllowAnother_get, _next, next_fn, _onResumeInterval, onResumeInterval_fn, _isIntervalPaused, isIntervalPaused_get, _tryToStartAnother, tryToStartAnother_fn, _initializeIntervalIfNeeded, initializeIntervalIfNeeded_fn, _onInterval, onInterval_fn, _processQueue, processQueue_fn, _throwOnAbort, throwOnAbort_fn, _onEvent, onEvent_fn;
1080
+ var PQueue = class extends import_index.default {
1081
+ // TODO: The `throwOnTimeout` option should affect the return types of `add()` and `addAll()`
1082
+ constructor(options) {
1083
+ super();
1084
+ chunkCDC7AOGD_cjs.__privateAdd(this, _doesIntervalAllowAnother);
1085
+ chunkCDC7AOGD_cjs.__privateAdd(this, _doesConcurrentAllowAnother);
1086
+ chunkCDC7AOGD_cjs.__privateAdd(this, _next);
1087
+ chunkCDC7AOGD_cjs.__privateAdd(this, _onResumeInterval);
1088
+ chunkCDC7AOGD_cjs.__privateAdd(this, _isIntervalPaused);
1089
+ chunkCDC7AOGD_cjs.__privateAdd(this, _tryToStartAnother);
1090
+ chunkCDC7AOGD_cjs.__privateAdd(this, _initializeIntervalIfNeeded);
1091
+ chunkCDC7AOGD_cjs.__privateAdd(this, _onInterval);
1092
+ /**
1093
+ Executes all queued functions until it reaches the limit.
1094
+ */
1095
+ chunkCDC7AOGD_cjs.__privateAdd(this, _processQueue);
1096
+ chunkCDC7AOGD_cjs.__privateAdd(this, _throwOnAbort);
1097
+ chunkCDC7AOGD_cjs.__privateAdd(this, _onEvent);
1098
+ chunkCDC7AOGD_cjs.__privateAdd(this, _carryoverConcurrencyCount, void 0);
1099
+ chunkCDC7AOGD_cjs.__privateAdd(this, _isIntervalIgnored, void 0);
1100
+ chunkCDC7AOGD_cjs.__privateAdd(this, _intervalCount, 0);
1101
+ chunkCDC7AOGD_cjs.__privateAdd(this, _intervalCap, void 0);
1102
+ chunkCDC7AOGD_cjs.__privateAdd(this, _interval, void 0);
1103
+ chunkCDC7AOGD_cjs.__privateAdd(this, _intervalEnd, 0);
1104
+ chunkCDC7AOGD_cjs.__privateAdd(this, _intervalId, void 0);
1105
+ chunkCDC7AOGD_cjs.__privateAdd(this, _timeoutId, void 0);
1106
+ chunkCDC7AOGD_cjs.__privateAdd(this, _queue2, void 0);
1107
+ chunkCDC7AOGD_cjs.__privateAdd(this, _queueClass, void 0);
1108
+ chunkCDC7AOGD_cjs.__privateAdd(this, _pending, 0);
1109
+ // The `!` is needed because of https://github.com/microsoft/TypeScript/issues/32194
1110
+ chunkCDC7AOGD_cjs.__privateAdd(this, _concurrency, void 0);
1111
+ chunkCDC7AOGD_cjs.__privateAdd(this, _isPaused, void 0);
1112
+ chunkCDC7AOGD_cjs.__privateAdd(this, _throwOnTimeout, void 0);
1113
+ /**
1114
+ Per-operation timeout in milliseconds. Operations fulfill once `timeout` elapses if they haven't already.
1115
+
1116
+ Applies to each future operation.
1117
+ */
1118
+ chunkCDC7AOGD_cjs.__publicField(this, "timeout");
1119
+ options = {
1120
+ carryoverConcurrencyCount: false,
1121
+ intervalCap: Number.POSITIVE_INFINITY,
1122
+ interval: 0,
1123
+ concurrency: Number.POSITIVE_INFINITY,
1124
+ autoStart: true,
1125
+ queueClass: PriorityQueue,
1126
+ ...options
1127
+ };
1128
+ if (!(typeof options.intervalCap === "number" && options.intervalCap >= 1)) {
1129
+ throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${options.intervalCap?.toString() ?? ""}\` (${typeof options.intervalCap})`);
1130
+ }
1131
+ if (options.interval === void 0 || !(Number.isFinite(options.interval) && options.interval >= 0)) {
1132
+ throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${options.interval?.toString() ?? ""}\` (${typeof options.interval})`);
1133
+ }
1134
+ chunkCDC7AOGD_cjs.__privateSet(this, _carryoverConcurrencyCount, options.carryoverConcurrencyCount);
1135
+ chunkCDC7AOGD_cjs.__privateSet(this, _isIntervalIgnored, options.intervalCap === Number.POSITIVE_INFINITY || options.interval === 0);
1136
+ chunkCDC7AOGD_cjs.__privateSet(this, _intervalCap, options.intervalCap);
1137
+ chunkCDC7AOGD_cjs.__privateSet(this, _interval, options.interval);
1138
+ chunkCDC7AOGD_cjs.__privateSet(this, _queue2, new options.queueClass());
1139
+ chunkCDC7AOGD_cjs.__privateSet(this, _queueClass, options.queueClass);
1140
+ this.concurrency = options.concurrency;
1141
+ this.timeout = options.timeout;
1142
+ chunkCDC7AOGD_cjs.__privateSet(this, _throwOnTimeout, options.throwOnTimeout === true);
1143
+ chunkCDC7AOGD_cjs.__privateSet(this, _isPaused, options.autoStart === false);
1144
+ }
1145
+ get concurrency() {
1146
+ return chunkCDC7AOGD_cjs.__privateGet(this, _concurrency);
1147
+ }
1148
+ set concurrency(newConcurrency) {
1149
+ if (!(typeof newConcurrency === "number" && newConcurrency >= 1)) {
1150
+ throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${newConcurrency}\` (${typeof newConcurrency})`);
1151
+ }
1152
+ chunkCDC7AOGD_cjs.__privateSet(this, _concurrency, newConcurrency);
1153
+ chunkCDC7AOGD_cjs.__privateMethod(this, _processQueue, processQueue_fn).call(this);
1154
+ }
1155
+ async add(function_, options = {}) {
1156
+ options = {
1157
+ timeout: this.timeout,
1158
+ throwOnTimeout: chunkCDC7AOGD_cjs.__privateGet(this, _throwOnTimeout),
1159
+ ...options
1160
+ };
1161
+ return new Promise((resolve2, reject) => {
1162
+ chunkCDC7AOGD_cjs.__privateGet(this, _queue2).enqueue(async () => {
1163
+ chunkCDC7AOGD_cjs.__privateWrapper(this, _pending)._++;
1164
+ chunkCDC7AOGD_cjs.__privateWrapper(this, _intervalCount)._++;
1165
+ try {
1166
+ options.signal?.throwIfAborted();
1167
+ let operation = function_({ signal: options.signal });
1168
+ if (options.timeout) {
1169
+ operation = pTimeout(Promise.resolve(operation), { milliseconds: options.timeout });
1170
+ }
1171
+ if (options.signal) {
1172
+ operation = Promise.race([operation, chunkCDC7AOGD_cjs.__privateMethod(this, _throwOnAbort, throwOnAbort_fn).call(this, options.signal)]);
1173
+ }
1174
+ const result = await operation;
1175
+ resolve2(result);
1176
+ this.emit("completed", result);
1177
+ } catch (error) {
1178
+ if (error instanceof TimeoutError && !options.throwOnTimeout) {
1179
+ resolve2();
1180
+ return;
1181
+ }
1182
+ reject(error);
1183
+ this.emit("error", error);
1184
+ } finally {
1185
+ chunkCDC7AOGD_cjs.__privateMethod(this, _next, next_fn).call(this);
1186
+ }
1187
+ }, options);
1188
+ this.emit("add");
1189
+ chunkCDC7AOGD_cjs.__privateMethod(this, _tryToStartAnother, tryToStartAnother_fn).call(this);
1190
+ });
1191
+ }
1192
+ async addAll(functions, options) {
1193
+ return Promise.all(functions.map(async (function_) => this.add(function_, options)));
1194
+ }
1195
+ /**
1196
+ Start (or resume) executing enqueued tasks within concurrency limit. No need to call this if queue is not paused (via `options.autoStart = false` or by `.pause()` method.)
1197
+ */
1198
+ start() {
1199
+ if (!chunkCDC7AOGD_cjs.__privateGet(this, _isPaused)) {
1200
+ return this;
1201
+ }
1202
+ chunkCDC7AOGD_cjs.__privateSet(this, _isPaused, false);
1203
+ chunkCDC7AOGD_cjs.__privateMethod(this, _processQueue, processQueue_fn).call(this);
1204
+ return this;
1205
+ }
1206
+ /**
1207
+ Put queue execution on hold.
1208
+ */
1209
+ pause() {
1210
+ chunkCDC7AOGD_cjs.__privateSet(this, _isPaused, true);
1211
+ }
1212
+ /**
1213
+ Clear the queue.
1214
+ */
1215
+ clear() {
1216
+ chunkCDC7AOGD_cjs.__privateSet(this, _queue2, new (chunkCDC7AOGD_cjs.__privateGet(this, _queueClass))());
1217
+ }
1218
+ /**
1219
+ Can be called multiple times. Useful if you for example add additional items at a later time.
1220
+
1221
+ @returns A promise that settles when the queue becomes empty.
1222
+ */
1223
+ async onEmpty() {
1224
+ if (chunkCDC7AOGD_cjs.__privateGet(this, _queue2).size === 0) {
1225
+ return;
1226
+ }
1227
+ await chunkCDC7AOGD_cjs.__privateMethod(this, _onEvent, onEvent_fn).call(this, "empty");
1228
+ }
1229
+ /**
1230
+ @returns A promise that settles when the queue size is less than the given limit: `queue.size < limit`.
1231
+
1232
+ If you want to avoid having the queue grow beyond a certain size you can `await queue.onSizeLessThan()` before adding a new item.
1233
+
1234
+ Note that this only limits the number of items waiting to start. There could still be up to `concurrency` jobs already running that this call does not include in its calculation.
1235
+ */
1236
+ async onSizeLessThan(limit) {
1237
+ if (chunkCDC7AOGD_cjs.__privateGet(this, _queue2).size < limit) {
1238
+ return;
1239
+ }
1240
+ await chunkCDC7AOGD_cjs.__privateMethod(this, _onEvent, onEvent_fn).call(this, "next", () => chunkCDC7AOGD_cjs.__privateGet(this, _queue2).size < limit);
1241
+ }
1242
+ /**
1243
+ The difference with `.onEmpty` is that `.onIdle` guarantees that all work from the queue has finished. `.onEmpty` merely signals that the queue is empty, but it could mean that some promises haven't completed yet.
1244
+
1245
+ @returns A promise that settles when the queue becomes empty, and all promises have completed; `queue.size === 0 && queue.pending === 0`.
1246
+ */
1247
+ async onIdle() {
1248
+ if (chunkCDC7AOGD_cjs.__privateGet(this, _pending) === 0 && chunkCDC7AOGD_cjs.__privateGet(this, _queue2).size === 0) {
1249
+ return;
1250
+ }
1251
+ await chunkCDC7AOGD_cjs.__privateMethod(this, _onEvent, onEvent_fn).call(this, "idle");
1252
+ }
1253
+ /**
1254
+ Size of the queue, the number of queued items waiting to run.
1255
+ */
1256
+ get size() {
1257
+ return chunkCDC7AOGD_cjs.__privateGet(this, _queue2).size;
1258
+ }
1259
+ /**
1260
+ Size of the queue, filtered by the given options.
1261
+
1262
+ For example, this can be used to find the number of items remaining in the queue with a specific priority level.
1263
+ */
1264
+ sizeBy(options) {
1265
+ return chunkCDC7AOGD_cjs.__privateGet(this, _queue2).filter(options).length;
1266
+ }
1267
+ /**
1268
+ Number of running items (no longer in the queue).
1269
+ */
1270
+ get pending() {
1271
+ return chunkCDC7AOGD_cjs.__privateGet(this, _pending);
1272
+ }
1273
+ /**
1274
+ Whether the queue is currently paused.
1275
+ */
1276
+ get isPaused() {
1277
+ return chunkCDC7AOGD_cjs.__privateGet(this, _isPaused);
1278
+ }
1279
+ };
1280
+ _carryoverConcurrencyCount = new WeakMap();
1281
+ _isIntervalIgnored = new WeakMap();
1282
+ _intervalCount = new WeakMap();
1283
+ _intervalCap = new WeakMap();
1284
+ _interval = new WeakMap();
1285
+ _intervalEnd = new WeakMap();
1286
+ _intervalId = new WeakMap();
1287
+ _timeoutId = new WeakMap();
1288
+ _queue2 = new WeakMap();
1289
+ _queueClass = new WeakMap();
1290
+ _pending = new WeakMap();
1291
+ _concurrency = new WeakMap();
1292
+ _isPaused = new WeakMap();
1293
+ _throwOnTimeout = new WeakMap();
1294
+ _doesIntervalAllowAnother = new WeakSet();
1295
+ doesIntervalAllowAnother_get = function() {
1296
+ return chunkCDC7AOGD_cjs.__privateGet(this, _isIntervalIgnored) || chunkCDC7AOGD_cjs.__privateGet(this, _intervalCount) < chunkCDC7AOGD_cjs.__privateGet(this, _intervalCap);
1297
+ };
1298
+ _doesConcurrentAllowAnother = new WeakSet();
1299
+ doesConcurrentAllowAnother_get = function() {
1300
+ return chunkCDC7AOGD_cjs.__privateGet(this, _pending) < chunkCDC7AOGD_cjs.__privateGet(this, _concurrency);
1301
+ };
1302
+ _next = new WeakSet();
1303
+ next_fn = function() {
1304
+ chunkCDC7AOGD_cjs.__privateWrapper(this, _pending)._--;
1305
+ chunkCDC7AOGD_cjs.__privateMethod(this, _tryToStartAnother, tryToStartAnother_fn).call(this);
1306
+ this.emit("next");
1307
+ };
1308
+ _onResumeInterval = new WeakSet();
1309
+ onResumeInterval_fn = function() {
1310
+ chunkCDC7AOGD_cjs.__privateMethod(this, _onInterval, onInterval_fn).call(this);
1311
+ chunkCDC7AOGD_cjs.__privateMethod(this, _initializeIntervalIfNeeded, initializeIntervalIfNeeded_fn).call(this);
1312
+ chunkCDC7AOGD_cjs.__privateSet(this, _timeoutId, void 0);
1313
+ };
1314
+ _isIntervalPaused = new WeakSet();
1315
+ isIntervalPaused_get = function() {
1316
+ const now = Date.now();
1317
+ if (chunkCDC7AOGD_cjs.__privateGet(this, _intervalId) === void 0) {
1318
+ const delay = chunkCDC7AOGD_cjs.__privateGet(this, _intervalEnd) - now;
1319
+ if (delay < 0) {
1320
+ chunkCDC7AOGD_cjs.__privateSet(this, _intervalCount, chunkCDC7AOGD_cjs.__privateGet(this, _carryoverConcurrencyCount) ? chunkCDC7AOGD_cjs.__privateGet(this, _pending) : 0);
1321
+ } else {
1322
+ if (chunkCDC7AOGD_cjs.__privateGet(this, _timeoutId) === void 0) {
1323
+ chunkCDC7AOGD_cjs.__privateSet(this, _timeoutId, setTimeout(() => {
1324
+ chunkCDC7AOGD_cjs.__privateMethod(this, _onResumeInterval, onResumeInterval_fn).call(this);
1325
+ }, delay));
1326
+ }
1327
+ return true;
1328
+ }
1329
+ }
1330
+ return false;
1331
+ };
1332
+ _tryToStartAnother = new WeakSet();
1333
+ tryToStartAnother_fn = function() {
1334
+ if (chunkCDC7AOGD_cjs.__privateGet(this, _queue2).size === 0) {
1335
+ if (chunkCDC7AOGD_cjs.__privateGet(this, _intervalId)) {
1336
+ clearInterval(chunkCDC7AOGD_cjs.__privateGet(this, _intervalId));
1337
+ }
1338
+ chunkCDC7AOGD_cjs.__privateSet(this, _intervalId, void 0);
1339
+ this.emit("empty");
1340
+ if (chunkCDC7AOGD_cjs.__privateGet(this, _pending) === 0) {
1341
+ this.emit("idle");
1342
+ }
1343
+ return false;
1344
+ }
1345
+ if (!chunkCDC7AOGD_cjs.__privateGet(this, _isPaused)) {
1346
+ const canInitializeInterval = !chunkCDC7AOGD_cjs.__privateGet(this, _isIntervalPaused, isIntervalPaused_get);
1347
+ if (chunkCDC7AOGD_cjs.__privateGet(this, _doesIntervalAllowAnother, doesIntervalAllowAnother_get) && chunkCDC7AOGD_cjs.__privateGet(this, _doesConcurrentAllowAnother, doesConcurrentAllowAnother_get)) {
1348
+ const job = chunkCDC7AOGD_cjs.__privateGet(this, _queue2).dequeue();
1349
+ if (!job) {
1350
+ return false;
1351
+ }
1352
+ this.emit("active");
1353
+ job();
1354
+ if (canInitializeInterval) {
1355
+ chunkCDC7AOGD_cjs.__privateMethod(this, _initializeIntervalIfNeeded, initializeIntervalIfNeeded_fn).call(this);
1356
+ }
1357
+ return true;
1358
+ }
1359
+ }
1360
+ return false;
1361
+ };
1362
+ _initializeIntervalIfNeeded = new WeakSet();
1363
+ initializeIntervalIfNeeded_fn = function() {
1364
+ if (chunkCDC7AOGD_cjs.__privateGet(this, _isIntervalIgnored) || chunkCDC7AOGD_cjs.__privateGet(this, _intervalId) !== void 0) {
1365
+ return;
1366
+ }
1367
+ chunkCDC7AOGD_cjs.__privateSet(this, _intervalId, setInterval(() => {
1368
+ chunkCDC7AOGD_cjs.__privateMethod(this, _onInterval, onInterval_fn).call(this);
1369
+ }, chunkCDC7AOGD_cjs.__privateGet(this, _interval)));
1370
+ chunkCDC7AOGD_cjs.__privateSet(this, _intervalEnd, Date.now() + chunkCDC7AOGD_cjs.__privateGet(this, _interval));
1371
+ };
1372
+ _onInterval = new WeakSet();
1373
+ onInterval_fn = function() {
1374
+ if (chunkCDC7AOGD_cjs.__privateGet(this, _intervalCount) === 0 && chunkCDC7AOGD_cjs.__privateGet(this, _pending) === 0 && chunkCDC7AOGD_cjs.__privateGet(this, _intervalId)) {
1375
+ clearInterval(chunkCDC7AOGD_cjs.__privateGet(this, _intervalId));
1376
+ chunkCDC7AOGD_cjs.__privateSet(this, _intervalId, void 0);
1377
+ }
1378
+ chunkCDC7AOGD_cjs.__privateSet(this, _intervalCount, chunkCDC7AOGD_cjs.__privateGet(this, _carryoverConcurrencyCount) ? chunkCDC7AOGD_cjs.__privateGet(this, _pending) : 0);
1379
+ chunkCDC7AOGD_cjs.__privateMethod(this, _processQueue, processQueue_fn).call(this);
1380
+ };
1381
+ _processQueue = new WeakSet();
1382
+ processQueue_fn = function() {
1383
+ while (chunkCDC7AOGD_cjs.__privateMethod(this, _tryToStartAnother, tryToStartAnother_fn).call(this)) {
1384
+ }
1385
+ };
1386
+ _throwOnAbort = new WeakSet();
1387
+ throwOnAbort_fn = async function(signal) {
1388
+ return new Promise((_resolve, reject) => {
1389
+ signal.addEventListener("abort", () => {
1390
+ reject(signal.reason);
1391
+ }, { once: true });
1392
+ });
1393
+ };
1394
+ _onEvent = new WeakSet();
1395
+ onEvent_fn = async function(event, filter) {
1396
+ return new Promise((resolve2) => {
1397
+ const listener = () => {
1398
+ if (filter && !filter()) {
1399
+ return;
1400
+ }
1401
+ this.off(event, listener);
1402
+ resolve2();
1403
+ };
1404
+ this.on(event, listener);
1405
+ });
1406
+ };
1407
+
1408
+ // src/BarrelManager.ts
1409
+ chunkCDC7AOGD_cjs.init_cjs_shims();
1410
+
1411
+ // src/utils/TreeNode.ts
1412
+ chunkCDC7AOGD_cjs.init_cjs_shims();
1413
+ var TreeNode = class _TreeNode {
1414
+ constructor(data, parent) {
1415
+ this.children = [];
1416
+ this.data = data;
1417
+ this.parent = parent;
1418
+ return this;
1419
+ }
1420
+ addChild(data) {
1421
+ const child = new _TreeNode(data, this);
1422
+ if (!this.children) {
1423
+ this.children = [];
1424
+ }
1425
+ this.children.push(child);
1426
+ return child;
1427
+ }
1428
+ find(data) {
1429
+ if (!data) {
1430
+ return null;
1431
+ }
1432
+ if (data === this.data) {
1433
+ return this;
1434
+ }
1435
+ if (this.children?.length) {
1436
+ for (let i = 0, { length } = this.children, target = null; i < length; i++) {
1437
+ target = this.children[i].find(data);
1438
+ if (target) {
1439
+ return target;
1440
+ }
1441
+ }
1442
+ }
1443
+ return null;
1444
+ }
1445
+ get leaves() {
1446
+ if (!this.children || this.children.length === 0) {
1447
+ return [this];
1448
+ }
1449
+ const leaves = [];
1450
+ if (this.children) {
1451
+ for (let i = 0, { length } = this.children; i < length; i++) {
1452
+ leaves.push.apply(leaves, this.children[i].leaves);
1453
+ }
1454
+ }
1455
+ return leaves;
1456
+ }
1457
+ get root() {
1458
+ if (!this.parent) {
1459
+ return this;
1460
+ }
1461
+ return this.parent.root;
1462
+ }
1463
+ forEach(callback) {
1464
+ if (typeof callback !== "function") {
1465
+ throw new TypeError("forEach() callback must be a function");
1466
+ }
1467
+ callback(this);
1468
+ if (this.children) {
1469
+ for (let i = 0, { length } = this.children; i < length; i++) {
1470
+ this.children[i].forEach(callback);
1471
+ }
1472
+ }
1473
+ return this;
1474
+ }
1475
+ static build(path3, options = {}) {
1476
+ try {
1477
+ const exclude = Array.isArray(options.exclude) ? options.exclude : [options.exclude].filter(Boolean);
1478
+ const filteredTree = dirTree__default.default(path3, { extensions: options.extensions, exclude: [/node_modules/, ...exclude] });
1479
+ if (!filteredTree) {
1480
+ return null;
1481
+ }
1482
+ const treeNode = new _TreeNode({ name: filteredTree.name, path: filteredTree.path, type: filteredTree.type || FileManager.getMode(filteredTree.path) });
1483
+ const recurse = (node, item) => {
1484
+ const subNode = node.addChild({ name: item.name, path: item.path, type: item.type || FileManager.getMode(item.path) });
1485
+ if (item.children?.length) {
1486
+ item.children?.forEach((child) => {
1487
+ recurse(subNode, child);
1488
+ });
1489
+ }
1490
+ };
1491
+ filteredTree.children?.forEach((child) => recurse(treeNode, child));
1492
+ return treeNode;
1493
+ } catch (e) {
1494
+ throw new Error("Something went wrong with creating index files with the TreehNode class", { cause: e });
1495
+ }
1496
+ }
1497
+ };
1498
+
1499
+ // src/BarrelManager.ts
1500
+ var _options;
1501
+ var BarrelManager = class {
1502
+ constructor(options = {}) {
1503
+ chunkCDC7AOGD_cjs.__privateAdd(this, _options, void 0);
1504
+ chunkCDC7AOGD_cjs.__privateSet(this, _options, options);
1505
+ return this;
1506
+ }
1507
+ getNamedExport(root, item) {
1508
+ const exportedNames = parser.getExports(path__default.default.resolve(root, item.path));
1509
+ if (!exportedNames) {
1510
+ return [item];
1511
+ }
1512
+ return exportedNames.reduce((prev, curr) => {
1513
+ if (!prev[0]?.name || !prev[1]?.name) {
1514
+ return prev;
1515
+ }
1516
+ if (curr.isTypeOnly) {
1517
+ prev[1] = { ...prev[1], name: [...prev[1].name, curr.name] };
1518
+ } else {
1519
+ prev[0] = { ...prev[0], name: [...prev[0].name, curr.name] };
1520
+ }
1521
+ return prev;
1522
+ }, [{
1523
+ ...item,
1524
+ name: [],
1525
+ isTypeOnly: false
1526
+ }, {
1527
+ ...item,
1528
+ name: [],
1529
+ isTypeOnly: true
1530
+ }]);
1531
+ }
1532
+ getNamedExports(root, exports) {
1533
+ return exports?.map((item) => {
1534
+ return this.getNamedExport(root, item);
1535
+ }).flat();
1536
+ }
1537
+ getIndexes(root) {
1538
+ const { treeNode = {}, isTypeOnly, extName } = chunkCDC7AOGD_cjs.__privateGet(this, _options);
1539
+ const tree = TreeNode.build(root, treeNode);
1540
+ if (!tree) {
1541
+ return null;
1542
+ }
1543
+ const fileReducer = (files, treeNode2) => {
1544
+ if (!treeNode2.children) {
1545
+ return [];
1546
+ }
1547
+ if (treeNode2.children.length > 1) {
1548
+ const indexPath = path__default.default.resolve(treeNode2.data.path, "index.ts");
1549
+ const exports = treeNode2.children.filter(Boolean).map((file) => {
1550
+ const importPath = file.data.type === "directory" ? `./${file.data.name}/index` : `./${chunkDU6UHGVD_cjs.trimExtName(file.data.name)}`;
1551
+ if (importPath.endsWith("index") && file.data.type === "file") {
1552
+ return void 0;
1553
+ }
1554
+ return {
1555
+ path: extName ? `${importPath}${extName}` : importPath,
1556
+ isTypeOnly
1557
+ };
1558
+ }).filter(Boolean);
1559
+ files.push({
1560
+ path: indexPath,
1561
+ baseName: "index.ts",
1562
+ source: "",
1563
+ exports
1564
+ });
1565
+ } else if (treeNode2.children.length === 1) {
1566
+ const [treeNodeChild] = treeNode2.children;
1567
+ const indexPath = path__default.default.resolve(treeNode2.data.path, "index.ts");
1568
+ const importPath = treeNodeChild.data.type === "directory" ? `./${treeNodeChild.data.name}/index` : `./${chunkDU6UHGVD_cjs.trimExtName(treeNodeChild.data.name)}`;
1569
+ const exports = [
1570
+ {
1571
+ path: extName ? `${importPath}${extName}` : importPath,
1572
+ isTypeOnly
1573
+ }
1574
+ ];
1575
+ files.push({
1576
+ path: indexPath,
1577
+ baseName: "index.ts",
1578
+ source: "",
1579
+ exports
1580
+ });
1581
+ }
1582
+ treeNode2.children.forEach((childItem) => {
1583
+ fileReducer(files, childItem);
1584
+ });
1585
+ return files;
1586
+ };
1587
+ return fileReducer([], tree).reverse();
1588
+ }
1589
+ };
1590
+ _options = new WeakMap();
1591
+
1592
+ // src/FileManager.ts
1593
+ exports.KubbFile = void 0;
1594
+ ((KubbFile2) => {
1595
+ })(exports.KubbFile || (exports.KubbFile = {}));
1596
+ var _cache, _task, _queue3, _add, add_fn, _addOrAppend, addOrAppend_fn;
1597
+ var _FileManager = class _FileManager {
1598
+ constructor({ task = async (file) => file, queue = new PQueue() } = {}) {
1599
+ chunkCDC7AOGD_cjs.__privateAdd(this, _add);
1600
+ chunkCDC7AOGD_cjs.__privateAdd(this, _addOrAppend);
1601
+ chunkCDC7AOGD_cjs.__privateAdd(this, _cache, /* @__PURE__ */ new Map());
1602
+ chunkCDC7AOGD_cjs.__privateAdd(this, _task, void 0);
1603
+ chunkCDC7AOGD_cjs.__privateAdd(this, _queue3, void 0);
1604
+ chunkCDC7AOGD_cjs.__privateSet(this, _task, task);
1605
+ chunkCDC7AOGD_cjs.__privateSet(this, _queue3, queue);
1606
+ return this;
1607
+ }
1608
+ get files() {
1609
+ const files = [];
1610
+ chunkCDC7AOGD_cjs.__privateGet(this, _cache).forEach((item) => {
1611
+ files.push(...item.flat(1));
1612
+ });
1613
+ return files;
1614
+ }
1615
+ get isExecuting() {
1616
+ return chunkCDC7AOGD_cjs.__privateGet(this, _queue3).size !== 0 && chunkCDC7AOGD_cjs.__privateGet(this, _queue3).pending !== 0;
1617
+ }
1618
+ async add(...files) {
1619
+ const promises = combineFiles(files).map((file) => {
1620
+ if (file.override) {
1621
+ return chunkCDC7AOGD_cjs.__privateMethod(this, _add, add_fn).call(this, file);
1622
+ }
1623
+ return chunkCDC7AOGD_cjs.__privateMethod(this, _addOrAppend, addOrAppend_fn).call(this, file);
1624
+ });
1625
+ const resolvedFiles = await Promise.all(promises);
1626
+ if (files.length > 1) {
1627
+ return resolvedFiles;
1628
+ }
1629
+ return resolvedFiles[0];
1630
+ }
1631
+ async addIndexes({ root, output, meta, options = {} }) {
1632
+ const { exportType = "barrel" } = output;
1633
+ if (exportType === false) {
1634
+ return void 0;
1635
+ }
1636
+ const pathToBuildFrom = path.resolve(root, output.path);
1637
+ const exportPath = output.path.startsWith("./") ? chunkDU6UHGVD_cjs.trimExtName(output.path) : `./${chunkDU6UHGVD_cjs.trimExtName(output.path)}`;
1638
+ const mode = _FileManager.getMode(output.path);
1639
+ const barrelManager = new BarrelManager({ extName: output.extName, ...options });
1640
+ let files = barrelManager.getIndexes(pathToBuildFrom);
1641
+ if (!files) {
1642
+ return void 0;
1643
+ }
1644
+ if (exportType === "barrelNamed") {
1645
+ files = files.map((file) => {
1646
+ if (file.exports) {
1647
+ return {
1648
+ ...file,
1649
+ exports: barrelManager.getNamedExports(pathToBuildFrom, file.exports)
1650
+ };
1651
+ }
1652
+ return file;
1653
+ });
1654
+ }
1655
+ await Promise.all(
1656
+ files.map((file) => {
1657
+ return chunkCDC7AOGD_cjs.__privateMethod(this, _addOrAppend, addOrAppend_fn).call(this, {
1658
+ ...file,
1659
+ meta: meta ? meta : file.meta
1660
+ });
1661
+ })
1662
+ );
1663
+ const rootPath = mode === "directory" ? `${exportPath}/index${output.extName || ""}` : `${exportPath}${output.extName || ""}`;
1664
+ const rootFile = {
1665
+ path: path.resolve(root, "index.ts"),
1666
+ baseName: "index.ts",
1667
+ source: "",
1668
+ exports: [
1669
+ output.exportAs ? {
1670
+ name: output.exportAs,
1671
+ asAlias: true,
1672
+ path: rootPath,
1673
+ isTypeOnly: options.isTypeOnly
1674
+ } : {
1675
+ path: rootPath,
1676
+ isTypeOnly: options.isTypeOnly
1677
+ }
1678
+ ]
1679
+ };
1680
+ if (exportType === "barrelNamed" && !output.exportAs && rootFile.exports?.[0]) {
1681
+ rootFile.exports = barrelManager.getNamedExport(root, rootFile.exports[0]);
1682
+ }
1683
+ await chunkCDC7AOGD_cjs.__privateMethod(this, _addOrAppend, addOrAppend_fn).call(this, {
1684
+ ...rootFile,
1685
+ meta: meta ? meta : rootFile.meta
1686
+ });
1687
+ }
1688
+ getCacheByUUID(UUID) {
1689
+ let cache;
1690
+ chunkCDC7AOGD_cjs.__privateGet(this, _cache).forEach((files) => {
1691
+ cache = files.find((item) => item.id === UUID);
1692
+ });
1693
+ return cache;
1694
+ }
1695
+ get(path3) {
1696
+ return chunkCDC7AOGD_cjs.__privateGet(this, _cache).get(path3);
1697
+ }
1698
+ remove(path3) {
1699
+ const cacheItem = this.get(path3);
1700
+ if (!cacheItem) {
1701
+ return;
1702
+ }
1703
+ chunkCDC7AOGD_cjs.__privateGet(this, _cache).delete(path3);
1704
+ }
1705
+ async write(...params) {
1706
+ return chunkWHFBT7CJ_cjs.write(...params);
1707
+ }
1708
+ async read(...params) {
1709
+ return chunkPTGWQCIU_cjs.read(...params);
1710
+ }
1711
+ // statics
1712
+ static getSource(file) {
1713
+ return getSource(file);
1714
+ }
1715
+ static combineFiles(files) {
1716
+ return combineFiles(files);
1717
+ }
1718
+ static getMode(path3) {
1719
+ if (!path3) {
1720
+ return "directory";
1721
+ }
1722
+ return path.extname(path3) ? "file" : "directory";
1723
+ }
1724
+ static get extensions() {
1725
+ return [".js", ".ts", ".tsx"];
1726
+ }
1727
+ static isExtensionAllowed(baseName) {
1728
+ return _FileManager.extensions.some((extension) => baseName.endsWith(extension));
1729
+ }
1730
+ };
1731
+ _cache = new WeakMap();
1732
+ _task = new WeakMap();
1733
+ _queue3 = new WeakMap();
1734
+ _add = new WeakSet();
1735
+ add_fn = async function(file) {
1736
+ const controller = new AbortController();
1737
+ const resolvedFile = { id: crypto__default.default.randomUUID(), name: chunkDU6UHGVD_cjs.trimExtName(file.baseName), ...file };
1738
+ chunkCDC7AOGD_cjs.__privateGet(this, _cache).set(resolvedFile.path, [{ cancel: () => controller.abort(), ...resolvedFile }]);
1739
+ return chunkCDC7AOGD_cjs.__privateGet(this, _queue3).add(
1740
+ async () => {
1741
+ var _a;
1742
+ return (_a = chunkCDC7AOGD_cjs.__privateGet(this, _task)) == null ? void 0 : _a.call(this, resolvedFile);
1743
+ },
1744
+ { signal: controller.signal }
1745
+ );
1746
+ };
1747
+ _addOrAppend = new WeakSet();
1748
+ addOrAppend_fn = async function(file) {
1749
+ const previousCaches = chunkCDC7AOGD_cjs.__privateGet(this, _cache).get(file.path);
1750
+ const previousCache = previousCaches ? previousCaches.at(previousCaches.length - 1) : void 0;
1751
+ if (previousCache) {
1752
+ chunkCDC7AOGD_cjs.__privateGet(this, _cache).delete(previousCache.path);
1753
+ return chunkCDC7AOGD_cjs.__privateMethod(this, _add, add_fn).call(this, {
1754
+ ...file,
1755
+ source: previousCache.source && file.source ? `${previousCache.source}
1756
+ ${file.source}` : "",
1757
+ imports: [...previousCache.imports || [], ...file.imports || []],
1758
+ exports: [...previousCache.exports || [], ...file.exports || []],
1759
+ env: { ...previousCache.env || {}, ...file.env || {} }
1760
+ });
1761
+ }
1762
+ return chunkCDC7AOGD_cjs.__privateMethod(this, _add, add_fn).call(this, file);
1763
+ };
1764
+ var FileManager = _FileManager;
1765
+ function combineFiles(files) {
1766
+ return files.filter(Boolean).reduce((acc, file) => {
1767
+ const prevIndex = acc.findIndex((item) => item.path === file.path);
1768
+ if (prevIndex === -1) {
1769
+ return [...acc, file];
1770
+ }
1771
+ const prev = acc[prevIndex];
1772
+ if (prev && file.override) {
1773
+ acc[prevIndex] = {
1774
+ imports: [],
1775
+ exports: [],
1776
+ ...file
1777
+ };
1778
+ return acc;
1779
+ }
1780
+ if (prev) {
1781
+ acc[prevIndex] = {
1782
+ ...file,
1783
+ source: prev.source && file.source ? `${prev.source}
1784
+ ${file.source}` : "",
1785
+ imports: [...prev.imports || [], ...file.imports || []],
1786
+ exports: [...prev.exports || [], ...file.exports || []],
1787
+ env: { ...prev.env || {}, ...file.env || {} }
1788
+ };
1789
+ }
1790
+ return acc;
1791
+ }, []);
1792
+ }
1793
+ function getSource(file) {
1794
+ if (!FileManager.isExtensionAllowed(file.baseName)) {
1795
+ return file.source;
1796
+ }
1797
+ const exports = file.exports ? combineExports(file.exports) : [];
1798
+ const imports = file.imports ? combineImports(file.imports, exports, file.source) : [];
1799
+ const importNodes = imports.filter((item) => {
1800
+ return item.path !== chunkDU6UHGVD_cjs.trimExtName(file.path);
1801
+ }).map((item) => {
1802
+ return factory__namespace.createImportDeclaration({
1803
+ name: item.name,
1804
+ path: item.root ? chunkPTGWQCIU_cjs.getRelativePath(item.root, item.path) : item.path,
1805
+ isTypeOnly: item.isTypeOnly
1806
+ });
1807
+ });
1808
+ const exportNodes = exports.map(
1809
+ (item) => factory__namespace.createExportDeclaration({
1810
+ name: item.name,
1811
+ path: item.path,
1812
+ isTypeOnly: item.isTypeOnly,
1813
+ asAlias: item.asAlias
1814
+ })
1815
+ );
1816
+ return [parser.print([...importNodes, ...exportNodes]), getEnvSource(file.source, file.env)].join("\n");
1817
+ }
1818
+ function combineExports(exports) {
1819
+ const combinedExports = naturalOrderby.orderBy(exports, [(v) => !v.isTypeOnly], ["asc"]).reduce((prev, curr) => {
1820
+ const name = curr.name;
1821
+ const prevByPath = prev.findLast((imp) => imp.path === curr.path);
1822
+ const prevByPathAndIsTypeOnly = prev.findLast((imp) => imp.path === curr.path && (0, import_lodash.default)(imp.name, name) && imp.isTypeOnly);
1823
+ if (prevByPathAndIsTypeOnly) {
1824
+ return prev;
1825
+ }
1826
+ const uniquePrev = prev.findLast(
1827
+ (imp) => imp.path === curr.path && (0, import_lodash.default)(imp.name, name) && imp.isTypeOnly === curr.isTypeOnly && imp.asAlias === curr.asAlias
1828
+ );
1829
+ if (uniquePrev || Array.isArray(name) && !name.length || prevByPath?.asAlias && !curr.asAlias) {
1830
+ return prev;
1831
+ }
1832
+ if (!prevByPath) {
1833
+ return [
1834
+ ...prev,
1835
+ {
1836
+ ...curr,
1837
+ name: Array.isArray(name) ? [...new Set(name)] : name
1838
+ }
1839
+ ];
1840
+ }
1841
+ if (prevByPath && Array.isArray(prevByPath.name) && Array.isArray(curr.name) && prevByPath.isTypeOnly === curr.isTypeOnly) {
1842
+ prevByPath.name = [.../* @__PURE__ */ new Set([...prevByPath.name, ...curr.name])];
1843
+ return prev;
1844
+ }
1845
+ return [...prev, curr];
1846
+ }, []);
1847
+ return naturalOrderby.orderBy(combinedExports, [(v) => !v.isTypeOnly, (v) => v.asAlias], ["desc", "desc"]);
1848
+ }
1849
+ function combineImports(imports, exports, source) {
1850
+ const combinedImports = naturalOrderby.orderBy(imports, [(v) => !v.isTypeOnly], ["asc"]).reduce((prev, curr) => {
1851
+ let name = Array.isArray(curr.name) ? [...new Set(curr.name)] : curr.name;
1852
+ const hasImportInSource = (importName) => {
1853
+ if (!source) {
1854
+ return true;
1855
+ }
1856
+ const checker = (name2) => name2 && !!source.includes(name2);
1857
+ return checker(importName) || exports.some(({ name: name2 }) => Array.isArray(name2) ? name2.some(checker) : checker(name2));
1858
+ };
1859
+ if (Array.isArray(name)) {
1860
+ name = name.filter((item) => typeof item === "string" ? hasImportInSource(item) : hasImportInSource(item.propertyName));
1861
+ }
1862
+ const prevByPath = prev.findLast((imp) => imp.path === curr.path && imp.isTypeOnly === curr.isTypeOnly);
1863
+ const uniquePrev = prev.findLast((imp) => imp.path === curr.path && (0, import_lodash.default)(imp.name, name) && imp.isTypeOnly === curr.isTypeOnly);
1864
+ const prevByPathNameAndIsTypeOnly = prev.findLast((imp) => imp.path === curr.path && (0, import_lodash.default)(imp.name, name) && imp.isTypeOnly);
1865
+ if (prevByPathNameAndIsTypeOnly) {
1866
+ return prev;
1867
+ }
1868
+ if (uniquePrev || Array.isArray(name) && !name.length) {
1869
+ return prev;
1870
+ }
1871
+ if (!prevByPath) {
1872
+ return [
1873
+ ...prev,
1874
+ {
1875
+ ...curr,
1876
+ name
1877
+ }
1878
+ ];
1879
+ }
1880
+ if (prevByPath && Array.isArray(prevByPath.name) && Array.isArray(name) && prevByPath.isTypeOnly === curr.isTypeOnly) {
1881
+ prevByPath.name = [.../* @__PURE__ */ new Set([...prevByPath.name, ...name])];
1882
+ return prev;
1883
+ }
1884
+ if (!Array.isArray(name) && name && !hasImportInSource(name)) {
1885
+ return prev;
1886
+ }
1887
+ return [...prev, curr];
1888
+ }, []);
1889
+ return naturalOrderby.orderBy(combinedImports, [(v) => !v.isTypeOnly], ["desc"]);
1890
+ }
1891
+ function getEnvSource(source, env) {
1892
+ if (!env) {
1893
+ return source;
1894
+ }
1895
+ const keys = Object.keys(env);
1896
+ if (!keys.length) {
1897
+ return source;
1898
+ }
1899
+ return keys.reduce((prev, key) => {
1900
+ const environmentValue = env[key];
1901
+ const replaceBy = environmentValue ? `'${environmentValue.replaceAll('"', "")?.replaceAll("'", "")}'` : "undefined";
1902
+ if (key.toUpperCase() !== key) {
1903
+ throw new TypeError(`Environment should be in upperCase for ${key}`);
1904
+ }
1905
+ if (typeof replaceBy === "string") {
1906
+ prev = chunkDU6UHGVD_cjs.searchAndReplace({ text: prev.replaceAll(`process.env.${key}`, replaceBy), replaceBy, prefix: "process.env", key });
1907
+ prev = chunkDU6UHGVD_cjs.searchAndReplace({ text: prev.replaceAll(new RegExp(`(declare const).*
1908
+ `, "ig"), ""), replaceBy, key });
1909
+ }
1910
+ return prev;
1911
+ }, source);
1912
+ }
1913
+
1914
+ // src/errors.ts
1915
+ chunkCDC7AOGD_cjs.init_cjs_shims();
1916
+ var Warning = class extends Error {
1917
+ constructor(message, options) {
1918
+ super(message, { cause: options?.cause });
1919
+ this.name = "Warning";
1920
+ }
1921
+ };
1922
+ var ValidationPluginError = class extends Error {
1923
+ };
1924
+
1925
+ // src/plugin.ts
1926
+ chunkCDC7AOGD_cjs.init_cjs_shims();
1927
+
1928
+ // src/utils/cache.ts
1929
+ chunkCDC7AOGD_cjs.init_cjs_shims();
1930
+ function createPluginCache(Store = /* @__PURE__ */ Object.create(null)) {
1931
+ return {
1932
+ set(id, value) {
1933
+ Store[id] = [0, value];
1934
+ },
1935
+ get(id) {
1936
+ const item = Store[id];
1937
+ if (!item) {
1938
+ return null;
1939
+ }
1940
+ item[0] = 0;
1941
+ return item[1];
1942
+ },
1943
+ has(id) {
1944
+ const item = Store[id];
1945
+ if (!item) {
1946
+ return false;
1947
+ }
1948
+ item[0] = 0;
1949
+ return true;
1950
+ },
1951
+ delete(id) {
1952
+ return delete Store[id];
1953
+ }
1954
+ };
1955
+ }
1956
+
1957
+ // src/plugin.ts
1958
+ function createPlugin(factory2) {
1959
+ return (options) => {
1960
+ return factory2(options);
1961
+ };
1962
+ }
1963
+ var pluginName = "core";
1964
+ var definePlugin = createPlugin((options) => {
1965
+ const { fileManager, pluginManager, resolvePath, resolveName, logger } = options;
1966
+ return {
1967
+ name: pluginName,
1968
+ options,
1969
+ key: ["core"],
1970
+ api() {
1971
+ return {
1972
+ get config() {
1973
+ return options.config;
1974
+ },
1975
+ get plugins() {
1976
+ return options.getPlugins();
1977
+ },
1978
+ get plugin() {
1979
+ return options.plugin;
1980
+ },
1981
+ logger,
1982
+ fileManager,
1983
+ pluginManager,
1984
+ async addFile(...files) {
1985
+ const resolvedFiles = await fileManager.add(...files);
1986
+ if (!Array.isArray(resolvedFiles)) {
1987
+ return [resolvedFiles];
1988
+ }
1989
+ return resolvedFiles;
1990
+ },
1991
+ resolvePath,
1992
+ resolveName,
1993
+ cache: createPluginCache()
1994
+ };
1995
+ },
1996
+ resolvePath(baseName) {
1997
+ const root = path__default.default.resolve(this.config.root, this.config.output.path);
1998
+ return path__default.default.resolve(root, baseName);
1999
+ },
2000
+ resolveName(name) {
2001
+ return name;
2002
+ }
2003
+ };
2004
+ });
2005
+
2006
+ // src/PromiseManager.ts
2007
+ chunkCDC7AOGD_cjs.init_cjs_shims();
2008
+
2009
+ // src/utils/executeStrategies.ts
2010
+ chunkCDC7AOGD_cjs.init_cjs_shims();
2011
+ function hookSeq(promises) {
2012
+ return promises.filter(Boolean).reduce(
2013
+ (promise, func) => {
2014
+ if (typeof func !== "function") {
2015
+ throw new Error("HookSeq needs a function that returns a promise `() => Promise<unknown>`");
2016
+ }
2017
+ return promise.then((state) => {
2018
+ const calledFunc = func(state);
2019
+ if (calledFunc) {
2020
+ return calledFunc.then(Array.prototype.concat.bind(state));
2021
+ }
2022
+ });
2023
+ },
2024
+ Promise.resolve([])
2025
+ );
2026
+ }
2027
+ function hookFirst(promises, nullCheck = (state) => state !== null) {
2028
+ let promise = Promise.resolve(null);
2029
+ for (const func of promises.filter(Boolean)) {
2030
+ promise = promise.then((state) => {
2031
+ if (nullCheck(state)) {
2032
+ return state;
2033
+ }
2034
+ const calledFunc = func(state);
2035
+ return calledFunc;
2036
+ });
2037
+ }
2038
+ return promise;
2039
+ }
2040
+ function hookParallel(promises) {
2041
+ return Promise.allSettled(promises.filter(Boolean).map((promise) => promise()));
2042
+ }
2043
+
2044
+ // src/PromiseManager.ts
2045
+ var _options2;
2046
+ var PromiseManager = class {
2047
+ constructor(options = {}) {
2048
+ chunkCDC7AOGD_cjs.__privateAdd(this, _options2, {});
2049
+ chunkCDC7AOGD_cjs.__privateSet(this, _options2, options);
2050
+ return this;
2051
+ }
2052
+ run(strategy, promises) {
2053
+ if (strategy === "seq") {
2054
+ return hookSeq(promises);
2055
+ }
2056
+ if (strategy === "first") {
2057
+ return hookFirst(promises, chunkCDC7AOGD_cjs.__privateGet(this, _options2).nullCheck);
2058
+ }
2059
+ if (strategy === "parallel") {
2060
+ return hookParallel(promises);
2061
+ }
2062
+ throw new Error(`${strategy} not implemented`);
2063
+ }
2064
+ };
2065
+ _options2 = new WeakMap();
2066
+ function isPromise(result) {
2067
+ return !!result && typeof result?.then === "function";
2068
+ }
2069
+ function isPromiseRejectedResult(result) {
2070
+ return result.status === "rejected";
2071
+ }
2072
+
2073
+ // src/PluginManager.ts
2074
+ chunkCDC7AOGD_cjs.init_cjs_shims();
2075
+
2076
+ // src/utils/EventEmitter.ts
2077
+ chunkCDC7AOGD_cjs.init_cjs_shims();
2078
+ var _emitter;
2079
+ var EventEmitter2 = class {
2080
+ constructor() {
2081
+ chunkCDC7AOGD_cjs.__privateAdd(this, _emitter, new events.EventEmitter());
2082
+ chunkCDC7AOGD_cjs.__privateGet(this, _emitter).setMaxListeners(100);
2083
+ }
2084
+ emit(eventName, ...eventArg) {
2085
+ chunkCDC7AOGD_cjs.__privateGet(this, _emitter).emit(eventName, ...eventArg);
2086
+ }
2087
+ on(eventName, handler) {
2088
+ chunkCDC7AOGD_cjs.__privateGet(this, _emitter).on(eventName, handler);
2089
+ }
2090
+ off(eventName, handler) {
2091
+ chunkCDC7AOGD_cjs.__privateGet(this, _emitter).off(eventName, handler);
2092
+ }
2093
+ removeAll() {
2094
+ chunkCDC7AOGD_cjs.__privateGet(this, _emitter).removeAllListeners();
2095
+ }
2096
+ };
2097
+ _emitter = new WeakMap();
2098
+
2099
+ // src/PluginManager.ts
2100
+ var _core, _usedPluginNames, _promiseManager, _getSortedPlugins, getSortedPlugins_fn, _addExecutedToCallStack, addExecutedToCallStack_fn, _execute, execute_fn, _executeSync, executeSync_fn, _catcher, catcher_fn, _parse, parse_fn;
2101
+ var PluginManager = class {
2102
+ constructor(config, options) {
2103
+ chunkCDC7AOGD_cjs.__privateAdd(this, _getSortedPlugins);
2104
+ chunkCDC7AOGD_cjs.__privateAdd(this, _addExecutedToCallStack);
2105
+ /**
2106
+ * Run an async plugin hook and return the result.
2107
+ * @param hookName Name of the plugin hook. Must be either in `PluginHooks` or `OutputPluginValueHooks`.
2108
+ * @param args Arguments passed to the plugin hook.
2109
+ * @param plugin The actual pluginObject to run.
2110
+ */
2111
+ // Implementation signature
2112
+ chunkCDC7AOGD_cjs.__privateAdd(this, _execute);
2113
+ /**
2114
+ * Run a sync plugin hook and return the result.
2115
+ * @param hookName Name of the plugin hook. Must be in `PluginHooks`.
2116
+ * @param args Arguments passed to the plugin hook.
2117
+ * @param plugin The acutal plugin
2118
+ * @param replaceContext When passed, the plugin context can be overridden.
2119
+ */
2120
+ chunkCDC7AOGD_cjs.__privateAdd(this, _executeSync);
2121
+ chunkCDC7AOGD_cjs.__privateAdd(this, _catcher);
2122
+ chunkCDC7AOGD_cjs.__privateAdd(this, _parse);
2123
+ this.events = new EventEmitter2();
2124
+ this.executed = [];
2125
+ chunkCDC7AOGD_cjs.__privateAdd(this, _core, void 0);
2126
+ chunkCDC7AOGD_cjs.__privateAdd(this, _usedPluginNames, {});
2127
+ chunkCDC7AOGD_cjs.__privateAdd(this, _promiseManager, void 0);
2128
+ this.resolvePath = (params) => {
2129
+ if (params.pluginKey) {
2130
+ const paths = this.hookForPluginSync({
2131
+ pluginKey: params.pluginKey,
2132
+ hookName: "resolvePath",
2133
+ parameters: [params.baseName, params.directory, params.options]
2134
+ });
2135
+ if (paths && paths?.length > 1 && this.logger.logLevel === chunkDQ3TMDDK_cjs.LogLevel.debug) {
2136
+ this.logger.debug(
2137
+ `Cannot return a path where the 'pluginKey' ${params.pluginKey ? JSON.stringify(params.pluginKey) : '"'} is not unique enough
2138
+
2139
+ Paths: ${JSON.stringify(paths, void 0, 2)}
2140
+
2141
+ Falling back on the first item.
2142
+ `
2143
+ );
2144
+ }
2145
+ return paths?.at(0);
2146
+ }
2147
+ return this.hookFirstSync({
2148
+ hookName: "resolvePath",
2149
+ parameters: [params.baseName, params.directory, params.options]
2150
+ }).result;
2151
+ };
2152
+ this.resolveName = (params) => {
2153
+ if (params.pluginKey) {
2154
+ const names = this.hookForPluginSync({
2155
+ pluginKey: params.pluginKey,
2156
+ hookName: "resolveName",
2157
+ parameters: [params.name, params.type]
2158
+ });
2159
+ if (names && names?.length > 1 && this.logger.logLevel === chunkDQ3TMDDK_cjs.LogLevel.debug) {
2160
+ this.logger.debug(
2161
+ `Cannot return a name where the 'pluginKey' ${params.pluginKey ? JSON.stringify(params.pluginKey) : '"'} is not unique enough
2162
+
2163
+ Names: ${JSON.stringify(names, void 0, 2)}
2164
+
2165
+ Falling back on the first item.
2166
+ `
2167
+ );
2168
+ }
2169
+ return chunkDU6UHGVD_cjs.transformReservedWord(names?.at(0) || params.name);
2170
+ }
2171
+ const name = this.hookFirstSync({
2172
+ hookName: "resolveName",
2173
+ parameters: [params.name, params.type]
2174
+ }).result;
2175
+ return chunkDU6UHGVD_cjs.transformReservedWord(name);
2176
+ };
2177
+ this.config = config;
2178
+ this.logger = options.logger;
2179
+ this.queue = new PQueue({ concurrency: 1 });
2180
+ this.fileManager = new FileManager({ task: options.task, queue: this.queue });
2181
+ chunkCDC7AOGD_cjs.__privateSet(this, _promiseManager, new PromiseManager({ nullCheck: (state) => !!state?.result }));
2182
+ const plugins = config.plugins || [];
2183
+ const core = definePlugin({
2184
+ config,
2185
+ logger: this.logger,
2186
+ pluginManager: this,
2187
+ fileManager: this.fileManager,
2188
+ resolvePath: this.resolvePath.bind(this),
2189
+ resolveName: this.resolveName.bind(this),
2190
+ getPlugins: chunkCDC7AOGD_cjs.__privateMethod(this, _getSortedPlugins, getSortedPlugins_fn).bind(this)
2191
+ });
2192
+ chunkCDC7AOGD_cjs.__privateSet(this, _core, chunkCDC7AOGD_cjs.__privateMethod(this, _parse, parse_fn).call(this, core, this, core.api.call(null)));
2193
+ this.plugins = [chunkCDC7AOGD_cjs.__privateGet(this, _core), ...plugins].map((plugin) => {
2194
+ return chunkCDC7AOGD_cjs.__privateMethod(this, _parse, parse_fn).call(this, plugin, this, chunkCDC7AOGD_cjs.__privateGet(this, _core).api);
2195
+ });
2196
+ return this;
2197
+ }
2198
+ /**
2199
+ * Instead of calling `pluginManager.events.on` you can use `pluginManager.on`. This one also has better types.
2200
+ */
2201
+ on(eventName, handler) {
2202
+ this.events.on(eventName, handler);
2203
+ }
2204
+ /**
2205
+ * Run a specific hookName for plugin x.
2206
+ */
2207
+ hookForPlugin({
2208
+ pluginKey,
2209
+ hookName,
2210
+ parameters
2211
+ }) {
2212
+ const plugins = this.getPluginsByKey(hookName, pluginKey);
2213
+ const promises = plugins.map((plugin) => {
2214
+ return chunkCDC7AOGD_cjs.__privateMethod(this, _execute, execute_fn).call(this, {
2215
+ strategy: "hookFirst",
2216
+ hookName,
2217
+ parameters,
2218
+ plugin
2219
+ });
2220
+ }).filter(Boolean);
2221
+ return Promise.all(promises);
2222
+ }
2223
+ /**
2224
+ * Run a specific hookName for plugin x.
2225
+ */
2226
+ hookForPluginSync({
2227
+ pluginKey,
2228
+ hookName,
2229
+ parameters
2230
+ }) {
2231
+ const plugins = this.getPluginsByKey(hookName, pluginKey);
2232
+ return plugins.map((plugin) => {
2233
+ return chunkCDC7AOGD_cjs.__privateMethod(this, _executeSync, executeSync_fn).call(this, {
2234
+ strategy: "hookFirst",
2235
+ hookName,
2236
+ parameters,
2237
+ plugin
2238
+ });
2239
+ }).filter(Boolean);
2240
+ }
2241
+ /**
2242
+ * First non-null result stops and will return it's value.
2243
+ */
2244
+ async hookFirst({
2245
+ hookName,
2246
+ parameters,
2247
+ skipped
2248
+ }) {
2249
+ const promises = chunkCDC7AOGD_cjs.__privateMethod(this, _getSortedPlugins, getSortedPlugins_fn).call(this).filter((plugin) => {
2250
+ return skipped ? skipped.has(plugin) : true;
2251
+ }).map((plugin) => {
2252
+ return async () => {
2253
+ const value = await chunkCDC7AOGD_cjs.__privateMethod(this, _execute, execute_fn).call(this, {
2254
+ strategy: "hookFirst",
2255
+ hookName,
2256
+ parameters,
2257
+ plugin
2258
+ });
2259
+ return Promise.resolve(
2260
+ {
2261
+ plugin,
2262
+ result: value
2263
+ }
2264
+ );
2265
+ };
2266
+ });
2267
+ return chunkCDC7AOGD_cjs.__privateGet(this, _promiseManager).run("first", promises);
2268
+ }
2269
+ /**
2270
+ * First non-null result stops and will return it's value.
2271
+ */
2272
+ hookFirstSync({
2273
+ hookName,
2274
+ parameters,
2275
+ skipped
2276
+ }) {
2277
+ let parseResult = null;
2278
+ for (const plugin of chunkCDC7AOGD_cjs.__privateMethod(this, _getSortedPlugins, getSortedPlugins_fn).call(this)) {
2279
+ if (skipped && skipped.has(plugin)) {
2280
+ continue;
2281
+ }
2282
+ parseResult = {
2283
+ result: chunkCDC7AOGD_cjs.__privateMethod(this, _executeSync, executeSync_fn).call(this, {
2284
+ strategy: "hookFirst",
2285
+ hookName,
2286
+ parameters,
2287
+ plugin
2288
+ }),
2289
+ plugin
2290
+ };
2291
+ if (parseResult?.result != null) {
2292
+ break;
2293
+ }
2294
+ }
2295
+ return parseResult;
2296
+ }
2297
+ /**
2298
+ * Run all plugins in parallel(order will be based on `this.plugin` and if `pre` or `post` is set).
2299
+ */
2300
+ async hookParallel({
2301
+ hookName,
2302
+ parameters
2303
+ }) {
2304
+ const promises = chunkCDC7AOGD_cjs.__privateMethod(this, _getSortedPlugins, getSortedPlugins_fn).call(this).map((plugin) => {
2305
+ return () => chunkCDC7AOGD_cjs.__privateMethod(this, _execute, execute_fn).call(this, { strategy: "hookParallel", hookName, parameters, plugin });
2306
+ });
2307
+ const results = await chunkCDC7AOGD_cjs.__privateGet(this, _promiseManager).run("parallel", promises);
2308
+ results.forEach((result, index) => {
2309
+ if (isPromiseRejectedResult(result)) {
2310
+ const plugin = chunkCDC7AOGD_cjs.__privateMethod(this, _getSortedPlugins, getSortedPlugins_fn).call(this)[index];
2311
+ chunkCDC7AOGD_cjs.__privateMethod(this, _catcher, catcher_fn).call(this, result.reason, plugin, hookName);
2312
+ }
2313
+ });
2314
+ return results.filter((result) => result.status === "fulfilled").map((result) => result.value);
2315
+ }
2316
+ /**
2317
+ * Chain all plugins, `reduce` can be passed through to handle every returned value. The return value of the first plugin will be used as the first parameter for the plugin after that.
2318
+ */
2319
+ hookReduceArg0({
2320
+ hookName,
2321
+ parameters,
2322
+ reduce
2323
+ }) {
2324
+ const [argument0, ...rest] = parameters;
2325
+ let promise = Promise.resolve(argument0);
2326
+ for (const plugin of chunkCDC7AOGD_cjs.__privateMethod(this, _getSortedPlugins, getSortedPlugins_fn).call(this)) {
2327
+ promise = promise.then((arg0) => {
2328
+ const value = chunkCDC7AOGD_cjs.__privateMethod(this, _execute, execute_fn).call(this, {
2329
+ strategy: "hookReduceArg0",
2330
+ hookName,
2331
+ parameters: [arg0, ...rest],
2332
+ plugin
2333
+ });
2334
+ return value;
2335
+ }).then((result) => reduce.call(chunkCDC7AOGD_cjs.__privateGet(this, _core).api, argument0, result, plugin));
2336
+ }
2337
+ return promise;
2338
+ }
2339
+ /**
2340
+ * Chains plugins
2341
+ */
2342
+ async hookSeq({ hookName, parameters }) {
2343
+ const promises = chunkCDC7AOGD_cjs.__privateMethod(this, _getSortedPlugins, getSortedPlugins_fn).call(this).map((plugin) => {
2344
+ return () => chunkCDC7AOGD_cjs.__privateMethod(this, _execute, execute_fn).call(this, {
2345
+ strategy: "hookSeq",
2346
+ hookName,
2347
+ parameters,
2348
+ plugin
2349
+ });
2350
+ });
2351
+ return chunkCDC7AOGD_cjs.__privateGet(this, _promiseManager).run("seq", promises);
2352
+ }
2353
+ getPluginsByKey(hookName, pluginKey) {
2354
+ const plugins = [...this.plugins];
2355
+ const [searchPluginName, searchIdentifier] = pluginKey;
2356
+ const pluginByPluginName = plugins.filter((plugin) => plugin[hookName]).filter((item) => {
2357
+ const [name, identifier] = item.key;
2358
+ const identifierCheck = identifier?.toString() === searchIdentifier?.toString();
2359
+ const nameCheck = name === searchPluginName;
2360
+ if (searchIdentifier) {
2361
+ return identifierCheck && nameCheck;
2362
+ }
2363
+ return nameCheck;
2364
+ });
2365
+ if (!pluginByPluginName?.length) {
2366
+ const corePlugin = plugins.find((plugin) => plugin.name === "core" && plugin[hookName]);
2367
+ if (this.logger.logLevel === chunkDQ3TMDDK_cjs.LogLevel.debug) {
2368
+ if (corePlugin) {
2369
+ this.logger.debug(`No hook '${hookName}' for pluginKey '${JSON.stringify(pluginKey)}' found, falling back on the '@kubb/core' plugin`);
2370
+ } else {
2371
+ this.logger.debug(`No hook '${hookName}' for pluginKey '${JSON.stringify(pluginKey)}' found, no fallback found in the '@kubb/core' plugin`);
2372
+ }
2373
+ }
2374
+ return corePlugin ? [corePlugin] : [];
2375
+ }
2376
+ return pluginByPluginName;
2377
+ }
2378
+ static getDependedPlugins(plugins, dependedPluginNames) {
2379
+ let pluginNames = [];
2380
+ if (typeof dependedPluginNames === "string") {
2381
+ pluginNames = [dependedPluginNames];
2382
+ } else {
2383
+ pluginNames = dependedPluginNames;
2384
+ }
2385
+ return pluginNames.map((pluginName2) => {
2386
+ const plugin = plugins.find((plugin2) => plugin2.name === pluginName2);
2387
+ if (!plugin) {
2388
+ throw new ValidationPluginError(`This plugin depends on the ${pluginName2} plugin.`);
2389
+ }
2390
+ return plugin;
2391
+ });
2392
+ }
2393
+ // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
2394
+ static get hooks() {
2395
+ return ["buildStart", "resolvePath", "resolveName", "load", "transform", "writeFile", "buildEnd"];
2396
+ }
2397
+ };
2398
+ _core = new WeakMap();
2399
+ _usedPluginNames = new WeakMap();
2400
+ _promiseManager = new WeakMap();
2401
+ _getSortedPlugins = new WeakSet();
2402
+ getSortedPlugins_fn = function(hookName) {
2403
+ const plugins = [...this.plugins].filter((plugin) => plugin.name !== "core");
2404
+ if (hookName) {
2405
+ if (this.logger.logLevel === chunkDQ3TMDDK_cjs.LogLevel.info) {
2406
+ const containsHookName = plugins.some((item) => item[hookName]);
2407
+ if (!containsHookName) {
2408
+ this.logger.warn(`No hook ${hookName} found`);
2409
+ }
2410
+ }
2411
+ return plugins.filter((item) => item[hookName]);
2412
+ }
2413
+ return plugins.map((plugin) => {
2414
+ if (plugin.pre) {
2415
+ const isValid = plugin.pre.every((pluginName2) => plugins.find((pluginToFind) => pluginToFind.name === pluginName2));
2416
+ if (!isValid) {
2417
+ throw new ValidationPluginError(`This plugin has a pre set that is not valid(${JSON.stringify(plugin.pre, void 0, 2)})`);
2418
+ }
2419
+ }
2420
+ return plugin;
2421
+ }).sort((a, b) => {
2422
+ if (b.pre?.includes(a.name)) {
2423
+ return 1;
2424
+ }
2425
+ if (b.post?.includes(a.name)) {
2426
+ return -1;
2427
+ }
2428
+ return 0;
2429
+ });
2430
+ };
2431
+ _addExecutedToCallStack = new WeakSet();
2432
+ addExecutedToCallStack_fn = function(executer) {
2433
+ if (executer) {
2434
+ this.events.emit("executed", executer);
2435
+ this.executed.push(executer);
2436
+ }
2437
+ };
2438
+ _execute = new WeakSet();
2439
+ execute_fn = function({
2440
+ strategy,
2441
+ hookName,
2442
+ parameters,
2443
+ plugin
2444
+ }) {
2445
+ const hook = plugin[hookName];
2446
+ let output;
2447
+ if (!hook) {
2448
+ return null;
2449
+ }
2450
+ this.events.emit("execute", { strategy, hookName, parameters, plugin });
2451
+ const task = Promise.resolve().then(() => {
2452
+ if (typeof hook === "function") {
2453
+ const possiblePromiseResult = hook.apply({ ...chunkCDC7AOGD_cjs.__privateGet(this, _core).api, plugin }, parameters);
2454
+ if (isPromise(possiblePromiseResult)) {
2455
+ return Promise.resolve(possiblePromiseResult);
2456
+ }
2457
+ return possiblePromiseResult;
2458
+ }
2459
+ return hook;
2460
+ }).then((result) => {
2461
+ output = result;
2462
+ chunkCDC7AOGD_cjs.__privateMethod(this, _addExecutedToCallStack, addExecutedToCallStack_fn).call(this, {
2463
+ parameters,
2464
+ output,
2465
+ strategy,
2466
+ hookName,
2467
+ plugin
2468
+ });
2469
+ return result;
2470
+ }).catch((e) => {
2471
+ chunkCDC7AOGD_cjs.__privateMethod(this, _catcher, catcher_fn).call(this, e, plugin, hookName);
2472
+ return null;
2473
+ });
2474
+ return task;
2475
+ };
2476
+ _executeSync = new WeakSet();
2477
+ executeSync_fn = function({
2478
+ strategy,
2479
+ hookName,
2480
+ parameters,
2481
+ plugin
2482
+ }) {
2483
+ const hook = plugin[hookName];
2484
+ let output;
2485
+ if (!hook) {
2486
+ return null;
2487
+ }
2488
+ this.events.emit("execute", { strategy, hookName, parameters, plugin });
2489
+ try {
2490
+ if (typeof hook === "function") {
2491
+ const fn = hook.apply({ ...chunkCDC7AOGD_cjs.__privateGet(this, _core).api, plugin }, parameters);
2492
+ output = fn;
2493
+ return fn;
2494
+ }
2495
+ output = hook;
2496
+ chunkCDC7AOGD_cjs.__privateMethod(this, _addExecutedToCallStack, addExecutedToCallStack_fn).call(this, {
2497
+ parameters,
2498
+ output,
2499
+ strategy,
2500
+ hookName,
2501
+ plugin
2502
+ });
2503
+ return hook;
2504
+ } catch (e) {
2505
+ chunkCDC7AOGD_cjs.__privateMethod(this, _catcher, catcher_fn).call(this, e, plugin, hookName);
2506
+ return null;
2507
+ }
2508
+ };
2509
+ _catcher = new WeakSet();
2510
+ catcher_fn = function(e, plugin, hookName) {
2511
+ const text = `${e.message} (plugin: ${plugin?.name || "unknown"}, hook: ${hookName || "unknown"})
2512
+ `;
2513
+ this.logger.error(text);
2514
+ this.events.emit("error", e);
2515
+ };
2516
+ _parse = new WeakSet();
2517
+ parse_fn = function(plugin, pluginManager, context) {
2518
+ const usedPluginNames = chunkCDC7AOGD_cjs.__privateGet(pluginManager, _usedPluginNames);
2519
+ chunk65JU7D5L_cjs.setUniqueName(plugin.name, usedPluginNames);
2520
+ const key = [plugin.name, usedPluginNames[plugin.name]].filter(Boolean);
2521
+ if (!plugin.transform) {
2522
+ plugin.transform = function transform(code) {
2523
+ return code;
2524
+ };
2525
+ }
2526
+ if (plugin.api && typeof plugin.api === "function") {
2527
+ const api = plugin.api.call(context);
2528
+ return {
2529
+ ...plugin,
2530
+ key,
2531
+ api
2532
+ };
2533
+ }
2534
+ return {
2535
+ ...plugin,
2536
+ key
2537
+ };
2538
+ };
2539
+
2540
+ exports.FileManager = FileManager;
2541
+ exports.PluginManager = PluginManager;
2542
+ exports.PromiseManager = PromiseManager;
2543
+ exports.Warning = Warning;
2544
+ exports.createPlugin = createPlugin;
2545
+ exports.isPromise = isPromise;
2546
+ exports.pluginName = pluginName;
2547
+ //# sourceMappingURL=out.js.map
2548
+ //# sourceMappingURL=chunk-6TTDLGHW.cjs.map