@likec4/core 1.48.0 → 1.49.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/THIRD-PARTY-LICENSES.md +1012 -0
- package/dist/_chunks/Builder.view-element.mjs +2 -3284
- package/dist/_chunks/LikeC4Model.d.mts +21 -25
- package/dist/_chunks/RichText.mjs +1 -148
- package/dist/_chunks/_types.d.mts +1 -5
- package/dist/_chunks/_types2.d.mts +2 -4
- package/dist/_chunks/assignTagColors.mjs +1 -24
- package/dist/_chunks/calcDriftsFromSnapshot.mjs +1 -379
- package/dist/_chunks/guards.d.mts +2026 -0
- package/dist/_chunks/guards.mjs +4 -0
- package/dist/_chunks/index.d.mts +255 -136
- package/dist/_chunks/libs/@mantine/colors-generator.mjs +2 -3403
- package/dist/_chunks/libs/@radix-ui/colors.mjs +1 -0
- package/dist/_chunks/libs/@ungap/structured-clone.mjs +1 -213
- package/dist/_chunks/libs/bail.mjs +1 -14
- package/dist/_chunks/libs/ccount.mjs +1 -25
- package/dist/_chunks/libs/character-entities-html4.mjs +1 -263
- package/dist/_chunks/libs/character-entities-legacy.mjs +1 -117
- package/dist/_chunks/libs/character-entities.mjs +2 -2136
- package/dist/_chunks/libs/comma-separated-tokens.mjs +1 -18
- package/dist/_chunks/libs/decode-named-character-reference.mjs +1 -21
- package/dist/_chunks/libs/defu.mjs +1 -42
- package/dist/_chunks/libs/devlop.mjs +1 -5
- package/dist/_chunks/libs/escape-string-regexp.mjs +1 -8
- package/dist/_chunks/libs/extend.mjs +1 -77
- package/dist/_chunks/libs/graphology-dag.mjs +1 -703
- package/dist/_chunks/libs/graphology.mjs +1 -4565
- package/dist/_chunks/libs/hast-util-sanitize.mjs +1 -863
- package/dist/_chunks/libs/hast-util-to-html.mjs +9 -2696
- package/dist/_chunks/libs/is-plain-obj.mjs +1 -9
- package/dist/_chunks/libs/longest-streak.mjs +1 -30
- package/dist/_chunks/libs/markdown-table.mjs +2 -290
- package/dist/_chunks/libs/mdast-util-find-and-replace.mjs +1 -653
- package/dist/_chunks/libs/mdast-util-from-markdown.mjs +3 -8522
- package/dist/_chunks/libs/mdast-util-gfm.mjs +15 -2393
- package/dist/_chunks/libs/mdast-util-to-hast.mjs +11 -1803
- package/dist/_chunks/libs/micromark-extension-gfm.mjs +1 -2243
- package/dist/_chunks/libs/mnemonist.d.mts +1 -91
- package/dist/_chunks/libs/mnemonist.mjs +1 -1978
- package/dist/_chunks/libs/natural-compare-lite.mjs +9 -42
- package/dist/_chunks/libs/ohash.mjs +1 -0
- package/dist/_chunks/libs/rehype-sanitize.mjs +1 -29
- package/dist/_chunks/libs/rehype-stringify.mjs +1 -34
- package/dist/_chunks/libs/remark-gfm.mjs +1 -36
- package/dist/_chunks/libs/remark-github-blockquote-alert.mjs +3 -100
- package/dist/_chunks/libs/remark-parse.mjs +1 -39
- package/dist/_chunks/libs/remark-rehype.mjs +1 -171
- package/dist/_chunks/libs/remeda.mjs +1 -702
- package/dist/_chunks/libs/trough.mjs +1 -158
- package/dist/_chunks/libs/unified.mjs +1 -2212
- package/dist/_chunks/rolldown-runtime.mjs +1 -42
- package/dist/_chunks/{index3.d.mts → theme.d.mts} +15 -13
- package/dist/_chunks/{index7.d.mts → to-text.d.mts} +165 -29
- package/dist/_chunks/to-text.mjs +1 -0
- package/dist/_chunks/vector.d.mts +198 -0
- package/dist/_chunks/vector.mjs +1 -0
- package/dist/builder/index.d.mts +2 -8
- package/dist/builder/index.mjs +1 -662
- package/dist/compute-view/index.d.mts +86 -15
- package/dist/compute-view/index.mjs +2 -262
- package/dist/geometry/index.d.mts +2 -2
- package/dist/geometry/index.mjs +1 -3
- package/dist/index.d.mts +9 -13
- package/dist/index.mjs +1 -27
- package/dist/model/index.d.mts +4 -14
- package/dist/model/index.mjs +1 -11
- package/dist/styles/index.d.mts +2 -8
- package/dist/styles/index.mjs +1 -30
- package/dist/types/index.d.mts +3 -9
- package/dist/types/index.mjs +1 -15
- package/dist/utils/graphology/index.d.mts +1 -1
- package/dist/utils/graphology/index.mjs +1 -3
- package/dist/utils/index.d.mts +4 -11
- package/dist/utils/index.mjs +1 -17
- package/package.json +13 -12
- package/dist/_chunks/LikeC4Styles.mjs +0 -691
- package/dist/_chunks/RichText.d.mts +0 -84
- package/dist/_chunks/_aux.d.mts +0 -289
- package/dist/_chunks/_aux.mjs +0 -18
- package/dist/_chunks/connection.mjs +0 -0
- package/dist/_chunks/const.d.mts +0 -43
- package/dist/_chunks/const.mjs +0 -33
- package/dist/_chunks/expression-model.d.mts +0 -192
- package/dist/_chunks/expression-model.mjs +0 -103
- package/dist/_chunks/expression.d.mts +0 -347
- package/dist/_chunks/expression.mjs +0 -107
- package/dist/_chunks/find.d.mts +0 -82
- package/dist/_chunks/find.mjs +0 -646
- package/dist/_chunks/find2.d.mts +0 -78
- package/dist/_chunks/find2.mjs +0 -287
- package/dist/_chunks/fqnRef.d.mts +0 -58
- package/dist/_chunks/fqnRef.mjs +0 -41
- package/dist/_chunks/geometry.mjs +0 -335
- package/dist/_chunks/index2.d.mts +0 -937
- package/dist/_chunks/index4.d.mts +0 -62
- package/dist/_chunks/index5.d.mts +0 -42
- package/dist/_chunks/index6.d.mts +0 -43
- package/dist/_chunks/index8.d.mts +0 -144
- package/dist/_chunks/invariant.mjs +0 -18
- package/dist/_chunks/iterable.mjs +0 -146
- package/dist/_chunks/libs/graphology-types.d.mts +0 -601
- package/dist/_chunks/libs/graphology.d.mts +0 -6
- package/dist/_chunks/mnemonist.d.mts +0 -1
- package/dist/_chunks/mnemonist.mjs +0 -0
- package/dist/_chunks/model.mjs +0 -1898
- package/dist/_chunks/model2.mjs +0 -0
- package/dist/_chunks/relationships-view.mjs +0 -132
- package/dist/_chunks/scalar.d.mts +0 -109
- package/dist/_chunks/scalar.mjs +0 -84
- package/dist/_chunks/utils.mjs +0 -483
- package/dist/compute-view/relationships-view/index.d.mts +0 -16
- package/dist/compute-view/relationships-view/index.mjs +0 -7
- package/dist/model/connection/deployment/index.d.mts +0 -12
- package/dist/model/connection/deployment/index.mjs +0 -9
- package/dist/model/connection/index.d.mts +0 -14
- package/dist/model/connection/index.mjs +0 -10
- package/dist/model/connection/model/index.d.mts +0 -12
- package/dist/model/connection/model/index.mjs +0 -8
- package/dist/types/RichText.d.mts +0 -3
- package/dist/types/RichText.mjs +0 -7
- package/dist/types/_aux.d.mts +0 -3
- package/dist/types/_aux.mjs +0 -3
- package/dist/types/expression-model.d.mts +0 -6
- package/dist/types/expression-model.mjs +0 -7
- package/dist/types/expression.d.mts +0 -5
- package/dist/types/expression.mjs +0 -7
- package/dist/types/fqnRef.d.mts +0 -4
- package/dist/types/fqnRef.mjs +0 -7
- package/dist/types/scalar.d.mts +0 -2
- package/dist/types/scalar.mjs +0 -7
- package/dist/utils/iterable/index.d.mts +0 -9
- package/dist/utils/iterable/index.mjs +0 -3
- package/dist/utils/mnemonist.d.mts +0 -2
- package/dist/utils/mnemonist.mjs +0 -12
|
@@ -1,703 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
//#region ../../node_modules/.pnpm/obliterator@2.0.5/node_modules/obliterator/support.js
|
|
4
|
-
var require_support = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
5
|
-
exports.ARRAY_BUFFER_SUPPORT = typeof ArrayBuffer !== "undefined";
|
|
6
|
-
exports.SYMBOL_SUPPORT = typeof Symbol !== "undefined";
|
|
7
|
-
}));
|
|
8
|
-
|
|
9
|
-
//#endregion
|
|
10
|
-
//#region ../../node_modules/.pnpm/obliterator@2.0.5/node_modules/obliterator/foreach.js
|
|
11
|
-
var require_foreach = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
12
|
-
/**
|
|
13
|
-
* Obliterator ForEach Function
|
|
14
|
-
* =============================
|
|
15
|
-
*
|
|
16
|
-
* Helper function used to easily iterate over mixed values.
|
|
17
|
-
*/
|
|
18
|
-
var support = require_support();
|
|
19
|
-
var ARRAY_BUFFER_SUPPORT = support.ARRAY_BUFFER_SUPPORT;
|
|
20
|
-
var SYMBOL_SUPPORT = support.SYMBOL_SUPPORT;
|
|
21
|
-
/**
|
|
22
|
-
* Function able to iterate over almost any iterable JS value.
|
|
23
|
-
*
|
|
24
|
-
* @param {any} iterable - Iterable value.
|
|
25
|
-
* @param {function} callback - Callback function.
|
|
26
|
-
*/
|
|
27
|
-
module.exports = function forEach(iterable, callback) {
|
|
28
|
-
var iterator, k, i, l, s;
|
|
29
|
-
if (!iterable) throw new Error("obliterator/forEach: invalid iterable.");
|
|
30
|
-
if (typeof callback !== "function") throw new Error("obliterator/forEach: expecting a callback.");
|
|
31
|
-
if (Array.isArray(iterable) || ARRAY_BUFFER_SUPPORT && ArrayBuffer.isView(iterable) || typeof iterable === "string" || iterable.toString() === "[object Arguments]") {
|
|
32
|
-
for (i = 0, l = iterable.length; i < l; i++) callback(iterable[i], i);
|
|
33
|
-
return;
|
|
34
|
-
}
|
|
35
|
-
if (typeof iterable.forEach === "function") {
|
|
36
|
-
iterable.forEach(callback);
|
|
37
|
-
return;
|
|
38
|
-
}
|
|
39
|
-
if (SYMBOL_SUPPORT && Symbol.iterator in iterable && typeof iterable.next !== "function") iterable = iterable[Symbol.iterator]();
|
|
40
|
-
if (typeof iterable.next === "function") {
|
|
41
|
-
iterator = iterable;
|
|
42
|
-
i = 0;
|
|
43
|
-
while (s = iterator.next(), s.done !== true) {
|
|
44
|
-
callback(s.value, i);
|
|
45
|
-
i++;
|
|
46
|
-
}
|
|
47
|
-
return;
|
|
48
|
-
}
|
|
49
|
-
for (k in iterable) if (iterable.hasOwnProperty(k)) callback(iterable[k], k);
|
|
50
|
-
};
|
|
51
|
-
}));
|
|
52
|
-
|
|
53
|
-
//#endregion
|
|
54
|
-
//#region ../../node_modules/.pnpm/obliterator@2.0.5/node_modules/obliterator/iterator.js
|
|
55
|
-
var require_iterator = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
56
|
-
/**
|
|
57
|
-
* Obliterator Iterator Class
|
|
58
|
-
* ===========================
|
|
59
|
-
*
|
|
60
|
-
* Simple class representing the library's iterators.
|
|
61
|
-
*/
|
|
62
|
-
/**
|
|
63
|
-
* Iterator class.
|
|
64
|
-
*
|
|
65
|
-
* @constructor
|
|
66
|
-
* @param {function} next - Next function.
|
|
67
|
-
*/
|
|
68
|
-
function Iterator(next) {
|
|
69
|
-
if (typeof next !== "function") throw new Error("obliterator/iterator: expecting a function!");
|
|
70
|
-
this.next = next;
|
|
71
|
-
}
|
|
72
|
-
/**
|
|
73
|
-
* If symbols are supported, we add `next` to `Symbol.iterator`.
|
|
74
|
-
*/
|
|
75
|
-
if (typeof Symbol !== "undefined") Iterator.prototype[Symbol.iterator] = function() {
|
|
76
|
-
return this;
|
|
77
|
-
};
|
|
78
|
-
/**
|
|
79
|
-
* Returning an iterator of the given values.
|
|
80
|
-
*
|
|
81
|
-
* @param {any...} values - Values.
|
|
82
|
-
* @return {Iterator}
|
|
83
|
-
*/
|
|
84
|
-
Iterator.of = function() {
|
|
85
|
-
var args = arguments, l = args.length, i = 0;
|
|
86
|
-
return new Iterator(function() {
|
|
87
|
-
if (i >= l) return { done: true };
|
|
88
|
-
return {
|
|
89
|
-
done: false,
|
|
90
|
-
value: args[i++]
|
|
91
|
-
};
|
|
92
|
-
});
|
|
93
|
-
};
|
|
94
|
-
/**
|
|
95
|
-
* Returning an empty iterator.
|
|
96
|
-
*
|
|
97
|
-
* @return {Iterator}
|
|
98
|
-
*/
|
|
99
|
-
Iterator.empty = function() {
|
|
100
|
-
return new Iterator(function() {
|
|
101
|
-
return { done: true };
|
|
102
|
-
});
|
|
103
|
-
};
|
|
104
|
-
/**
|
|
105
|
-
* Returning an iterator over the given indexed sequence.
|
|
106
|
-
*
|
|
107
|
-
* @param {string|Array} sequence - Target sequence.
|
|
108
|
-
* @return {Iterator}
|
|
109
|
-
*/
|
|
110
|
-
Iterator.fromSequence = function(sequence) {
|
|
111
|
-
var i = 0, l = sequence.length;
|
|
112
|
-
return new Iterator(function() {
|
|
113
|
-
if (i >= l) return { done: true };
|
|
114
|
-
return {
|
|
115
|
-
done: false,
|
|
116
|
-
value: sequence[i++]
|
|
117
|
-
};
|
|
118
|
-
});
|
|
119
|
-
};
|
|
120
|
-
/**
|
|
121
|
-
* Returning whether the given value is an iterator.
|
|
122
|
-
*
|
|
123
|
-
* @param {any} value - Value.
|
|
124
|
-
* @return {boolean}
|
|
125
|
-
*/
|
|
126
|
-
Iterator.is = function(value) {
|
|
127
|
-
if (value instanceof Iterator) return true;
|
|
128
|
-
return typeof value === "object" && value !== null && typeof value.next === "function";
|
|
129
|
-
};
|
|
130
|
-
/**
|
|
131
|
-
* Exporting.
|
|
132
|
-
*/
|
|
133
|
-
module.exports = Iterator;
|
|
134
|
-
}));
|
|
135
|
-
|
|
136
|
-
//#endregion
|
|
137
|
-
//#region ../../node_modules/.pnpm/mnemonist@0.40.3_patch_hash=70301b9c235e13bc146bb9528b7979c278952196d5dac8048ab3850adac8f4cf/node_modules/mnemonist/utils/typed-arrays.js
|
|
138
|
-
var require_typed_arrays = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
139
|
-
/**
|
|
140
|
-
* Mnemonist Typed Array Helpers
|
|
141
|
-
* ==============================
|
|
142
|
-
*
|
|
143
|
-
* Miscellaneous helpers related to typed arrays.
|
|
144
|
-
*/
|
|
145
|
-
/**
|
|
146
|
-
* When using an unsigned integer array to store pointers, one might want to
|
|
147
|
-
* choose the optimal word size in regards to the actual numbers of pointers
|
|
148
|
-
* to store.
|
|
149
|
-
*
|
|
150
|
-
* This helpers does just that.
|
|
151
|
-
*
|
|
152
|
-
* @param {number} size - Expected size of the array to map.
|
|
153
|
-
* @return {TypedArray}
|
|
154
|
-
*/
|
|
155
|
-
var MAX_8BIT_INTEGER = Math.pow(2, 8) - 1, MAX_16BIT_INTEGER = Math.pow(2, 16) - 1, MAX_32BIT_INTEGER = Math.pow(2, 32) - 1;
|
|
156
|
-
var MAX_SIGNED_8BIT_INTEGER = Math.pow(2, 7) - 1, MAX_SIGNED_16BIT_INTEGER = Math.pow(2, 15) - 1, MAX_SIGNED_32BIT_INTEGER = Math.pow(2, 31) - 1;
|
|
157
|
-
exports.getPointerArray = function(size) {
|
|
158
|
-
var maxIndex = size - 1;
|
|
159
|
-
if (maxIndex <= MAX_8BIT_INTEGER) return Uint8Array;
|
|
160
|
-
if (maxIndex <= MAX_16BIT_INTEGER) return Uint16Array;
|
|
161
|
-
if (maxIndex <= MAX_32BIT_INTEGER) return Uint32Array;
|
|
162
|
-
throw new Error("mnemonist: Pointer Array of size > 4294967295 is not supported.");
|
|
163
|
-
};
|
|
164
|
-
exports.getSignedPointerArray = function(size) {
|
|
165
|
-
var maxIndex = size - 1;
|
|
166
|
-
if (maxIndex <= MAX_SIGNED_8BIT_INTEGER) return Int8Array;
|
|
167
|
-
if (maxIndex <= MAX_SIGNED_16BIT_INTEGER) return Int16Array;
|
|
168
|
-
if (maxIndex <= MAX_SIGNED_32BIT_INTEGER) return Int32Array;
|
|
169
|
-
return Float64Array;
|
|
170
|
-
};
|
|
171
|
-
/**
|
|
172
|
-
* Function returning the minimal type able to represent the given number.
|
|
173
|
-
*
|
|
174
|
-
* @param {number} value - Value to test.
|
|
175
|
-
* @return {TypedArrayClass}
|
|
176
|
-
*/
|
|
177
|
-
exports.getNumberType = function(value) {
|
|
178
|
-
if (value === (value | 0)) if (Math.sign(value) === -1) {
|
|
179
|
-
if (value <= 127 && value >= -128) return Int8Array;
|
|
180
|
-
if (value <= 32767 && value >= -32768) return Int16Array;
|
|
181
|
-
return Int32Array;
|
|
182
|
-
} else {
|
|
183
|
-
if (value <= 255) return Uint8Array;
|
|
184
|
-
if (value <= 65535) return Uint16Array;
|
|
185
|
-
return Uint32Array;
|
|
186
|
-
}
|
|
187
|
-
return Float64Array;
|
|
188
|
-
};
|
|
189
|
-
/**
|
|
190
|
-
* Function returning the minimal type able to represent the given array
|
|
191
|
-
* of JavaScript numbers.
|
|
192
|
-
*
|
|
193
|
-
* @param {array} array - Array to represent.
|
|
194
|
-
* @param {function} getter - Optional getter.
|
|
195
|
-
* @return {TypedArrayClass}
|
|
196
|
-
*/
|
|
197
|
-
var TYPE_PRIORITY = {
|
|
198
|
-
Uint8Array: 1,
|
|
199
|
-
Int8Array: 2,
|
|
200
|
-
Uint16Array: 3,
|
|
201
|
-
Int16Array: 4,
|
|
202
|
-
Uint32Array: 5,
|
|
203
|
-
Int32Array: 6,
|
|
204
|
-
Float32Array: 7,
|
|
205
|
-
Float64Array: 8
|
|
206
|
-
};
|
|
207
|
-
exports.getMinimalRepresentation = function(array, getter) {
|
|
208
|
-
var maxType = null, maxPriority = 0, p, t, v, i, l;
|
|
209
|
-
for (i = 0, l = array.length; i < l; i++) {
|
|
210
|
-
v = getter ? getter(array[i]) : array[i];
|
|
211
|
-
t = exports.getNumberType(v);
|
|
212
|
-
p = TYPE_PRIORITY[t.name];
|
|
213
|
-
if (p > maxPriority) {
|
|
214
|
-
maxPriority = p;
|
|
215
|
-
maxType = t;
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
|
-
return maxType;
|
|
219
|
-
};
|
|
220
|
-
/**
|
|
221
|
-
* Function returning whether the given value is a typed array.
|
|
222
|
-
*
|
|
223
|
-
* @param {any} value - Value to test.
|
|
224
|
-
* @return {boolean}
|
|
225
|
-
*/
|
|
226
|
-
exports.isTypedArray = function(value) {
|
|
227
|
-
return typeof ArrayBuffer !== "undefined" && ArrayBuffer.isView(value);
|
|
228
|
-
};
|
|
229
|
-
/**
|
|
230
|
-
* Function used to concat byte arrays.
|
|
231
|
-
*
|
|
232
|
-
* @param {...ByteArray}
|
|
233
|
-
* @return {ByteArray}
|
|
234
|
-
*/
|
|
235
|
-
exports.concat = function() {
|
|
236
|
-
var length = 0, i, o, l;
|
|
237
|
-
for (i = 0, l = arguments.length; i < l; i++) length += arguments[i].length;
|
|
238
|
-
var array = new arguments[0].constructor(length);
|
|
239
|
-
for (i = 0, o = 0; i < l; i++) {
|
|
240
|
-
array.set(arguments[i], o);
|
|
241
|
-
o += arguments[i].length;
|
|
242
|
-
}
|
|
243
|
-
return array;
|
|
244
|
-
};
|
|
245
|
-
/**
|
|
246
|
-
* Function used to initialize a byte array of indices.
|
|
247
|
-
*
|
|
248
|
-
* @param {number} length - Length of target.
|
|
249
|
-
* @return {ByteArray}
|
|
250
|
-
*/
|
|
251
|
-
exports.indices = function(length) {
|
|
252
|
-
var array = new (exports.getPointerArray(length))(length);
|
|
253
|
-
for (var i = 0; i < length; i++) array[i] = i;
|
|
254
|
-
return array;
|
|
255
|
-
};
|
|
256
|
-
}));
|
|
257
|
-
|
|
258
|
-
//#endregion
|
|
259
|
-
//#region ../../node_modules/.pnpm/mnemonist@0.40.3_patch_hash=70301b9c235e13bc146bb9528b7979c278952196d5dac8048ab3850adac8f4cf/node_modules/mnemonist/utils/iterables.js
|
|
260
|
-
var require_iterables = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
261
|
-
/**
|
|
262
|
-
* Mnemonist Iterable Function
|
|
263
|
-
* ============================
|
|
264
|
-
*
|
|
265
|
-
* Harmonized iteration helpers over mixed iterable targets.
|
|
266
|
-
*/
|
|
267
|
-
var forEach = require_foreach();
|
|
268
|
-
var typed = require_typed_arrays();
|
|
269
|
-
/**
|
|
270
|
-
* Function used to determine whether the given object supports array-like
|
|
271
|
-
* random access.
|
|
272
|
-
*
|
|
273
|
-
* @param {any} target - Target object.
|
|
274
|
-
* @return {boolean}
|
|
275
|
-
*/
|
|
276
|
-
function isArrayLike(target) {
|
|
277
|
-
return Array.isArray(target) || typed.isTypedArray(target);
|
|
278
|
-
}
|
|
279
|
-
/**
|
|
280
|
-
* Function used to guess the length of the structure over which we are going
|
|
281
|
-
* to iterate.
|
|
282
|
-
*
|
|
283
|
-
* @param {any} target - Target object.
|
|
284
|
-
* @return {number|undefined}
|
|
285
|
-
*/
|
|
286
|
-
function guessLength(target) {
|
|
287
|
-
if (typeof target.length === "number") return target.length;
|
|
288
|
-
if (typeof target.size === "number") return target.size;
|
|
289
|
-
}
|
|
290
|
-
/**
|
|
291
|
-
* Function used to convert an iterable to an array.
|
|
292
|
-
*
|
|
293
|
-
* @param {any} target - Iteration target.
|
|
294
|
-
* @return {array}
|
|
295
|
-
*/
|
|
296
|
-
function toArray(target) {
|
|
297
|
-
var l = guessLength(target);
|
|
298
|
-
var array = typeof l === "number" ? new Array(l) : [];
|
|
299
|
-
var i = 0;
|
|
300
|
-
forEach(target, function(value) {
|
|
301
|
-
array[i++] = value;
|
|
302
|
-
});
|
|
303
|
-
return array;
|
|
304
|
-
}
|
|
305
|
-
/**
|
|
306
|
-
* Same as above but returns a supplementary indices array.
|
|
307
|
-
*
|
|
308
|
-
* @param {any} target - Iteration target.
|
|
309
|
-
* @return {array}
|
|
310
|
-
*/
|
|
311
|
-
function toArrayWithIndices(target) {
|
|
312
|
-
var l = guessLength(target);
|
|
313
|
-
var IndexArray = typeof l === "number" ? typed.getPointerArray(l) : Array;
|
|
314
|
-
var array = typeof l === "number" ? new Array(l) : [];
|
|
315
|
-
var indices = typeof l === "number" ? new IndexArray(l) : [];
|
|
316
|
-
var i = 0;
|
|
317
|
-
forEach(target, function(value) {
|
|
318
|
-
array[i] = value;
|
|
319
|
-
indices[i] = i++;
|
|
320
|
-
});
|
|
321
|
-
return [array, indices];
|
|
322
|
-
}
|
|
323
|
-
/**
|
|
324
|
-
* Exporting.
|
|
325
|
-
*/
|
|
326
|
-
exports.isArrayLike = isArrayLike;
|
|
327
|
-
exports.guessLength = guessLength;
|
|
328
|
-
exports.toArray = toArray;
|
|
329
|
-
exports.toArrayWithIndices = toArrayWithIndices;
|
|
330
|
-
}));
|
|
331
|
-
|
|
332
|
-
//#endregion
|
|
333
|
-
//#region ../../node_modules/.pnpm/graphology-utils@2.5.2_graphology-types@0.24.8/node_modules/graphology-utils/is-graph.js
|
|
334
|
-
var require_is_graph = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
335
|
-
/**
|
|
336
|
-
* Graphology isGraph
|
|
337
|
-
* ===================
|
|
338
|
-
*
|
|
339
|
-
* Very simple function aiming at ensuring the given variable is a
|
|
340
|
-
* graphology instance.
|
|
341
|
-
*/
|
|
342
|
-
/**
|
|
343
|
-
* Checking the value is a graphology instance.
|
|
344
|
-
*
|
|
345
|
-
* @param {any} value - Target value.
|
|
346
|
-
* @return {boolean}
|
|
347
|
-
*/
|
|
348
|
-
module.exports = function isGraph(value) {
|
|
349
|
-
return value !== null && typeof value === "object" && typeof value.addUndirectedEdgeWithKey === "function" && typeof value.dropNode === "function" && typeof value.multi === "boolean";
|
|
350
|
-
};
|
|
351
|
-
}));
|
|
352
|
-
|
|
353
|
-
//#endregion
|
|
354
|
-
//#region ../../node_modules/.pnpm/mnemonist@0.40.3_patch_hash=70301b9c235e13bc146bb9528b7979c278952196d5dac8048ab3850adac8f4cf/node_modules/mnemonist/fixed-deque.js
|
|
355
|
-
var require_fixed_deque = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
356
|
-
/**
|
|
357
|
-
* Mnemonist FixedDeque
|
|
358
|
-
* =====================
|
|
359
|
-
*
|
|
360
|
-
* Fixed capacity double-ended queue implemented as ring deque.
|
|
361
|
-
*/
|
|
362
|
-
var iterables = require_iterables(), Iterator = require_iterator();
|
|
363
|
-
/**
|
|
364
|
-
* FixedDeque.
|
|
365
|
-
*
|
|
366
|
-
* @constructor
|
|
367
|
-
*/
|
|
368
|
-
function FixedDeque(ArrayClass, capacity) {
|
|
369
|
-
if (arguments.length < 2) throw new Error("mnemonist/fixed-deque: expecting an Array class and a capacity.");
|
|
370
|
-
if (typeof capacity !== "number" || capacity <= 0) throw new Error("mnemonist/fixed-deque: `capacity` should be a positive number.");
|
|
371
|
-
this.ArrayClass = ArrayClass;
|
|
372
|
-
this.capacity = capacity;
|
|
373
|
-
this.items = new ArrayClass(this.capacity);
|
|
374
|
-
this.clear();
|
|
375
|
-
}
|
|
376
|
-
/**
|
|
377
|
-
* Method used to clear the structure.
|
|
378
|
-
*
|
|
379
|
-
* @return {undefined}
|
|
380
|
-
*/
|
|
381
|
-
FixedDeque.prototype.clear = function() {
|
|
382
|
-
this.start = 0;
|
|
383
|
-
this.size = 0;
|
|
384
|
-
};
|
|
385
|
-
/**
|
|
386
|
-
* Method used to append a value to the deque.
|
|
387
|
-
*
|
|
388
|
-
* @param {any} item - Item to append.
|
|
389
|
-
* @return {number} - Returns the new size of the deque.
|
|
390
|
-
*/
|
|
391
|
-
FixedDeque.prototype.push = function(item) {
|
|
392
|
-
if (this.size === this.capacity) throw new Error("mnemonist/fixed-deque.push: deque capacity (" + this.capacity + ") exceeded!");
|
|
393
|
-
var index = this.start + this.size;
|
|
394
|
-
if (index >= this.capacity) index -= this.capacity;
|
|
395
|
-
this.items[index] = item;
|
|
396
|
-
return ++this.size;
|
|
397
|
-
};
|
|
398
|
-
/**
|
|
399
|
-
* Method used to prepend a value to the deque.
|
|
400
|
-
*
|
|
401
|
-
* @param {any} item - Item to prepend.
|
|
402
|
-
* @return {number} - Returns the new size of the deque.
|
|
403
|
-
*/
|
|
404
|
-
FixedDeque.prototype.unshift = function(item) {
|
|
405
|
-
if (this.size === this.capacity) throw new Error("mnemonist/fixed-deque.unshift: deque capacity (" + this.capacity + ") exceeded!");
|
|
406
|
-
var index = this.start - 1;
|
|
407
|
-
if (this.start === 0) index = this.capacity - 1;
|
|
408
|
-
this.items[index] = item;
|
|
409
|
-
this.start = index;
|
|
410
|
-
return ++this.size;
|
|
411
|
-
};
|
|
412
|
-
/**
|
|
413
|
-
* Method used to pop the deque.
|
|
414
|
-
*
|
|
415
|
-
* @return {any} - Returns the popped item.
|
|
416
|
-
*/
|
|
417
|
-
FixedDeque.prototype.pop = function() {
|
|
418
|
-
if (this.size === 0) return;
|
|
419
|
-
this.size--;
|
|
420
|
-
var index = this.start + this.size;
|
|
421
|
-
if (index >= this.capacity) index -= this.capacity;
|
|
422
|
-
return this.items[index];
|
|
423
|
-
};
|
|
424
|
-
/**
|
|
425
|
-
* Method used to shift the deque.
|
|
426
|
-
*
|
|
427
|
-
* @return {any} - Returns the shifted item.
|
|
428
|
-
*/
|
|
429
|
-
FixedDeque.prototype.shift = function() {
|
|
430
|
-
if (this.size === 0) return;
|
|
431
|
-
var index = this.start;
|
|
432
|
-
this.size--;
|
|
433
|
-
this.start++;
|
|
434
|
-
if (this.start === this.capacity) this.start = 0;
|
|
435
|
-
return this.items[index];
|
|
436
|
-
};
|
|
437
|
-
/**
|
|
438
|
-
* Method used to peek the first value of the deque.
|
|
439
|
-
*
|
|
440
|
-
* @return {any}
|
|
441
|
-
*/
|
|
442
|
-
FixedDeque.prototype.peekFirst = function() {
|
|
443
|
-
if (this.size === 0) return;
|
|
444
|
-
return this.items[this.start];
|
|
445
|
-
};
|
|
446
|
-
/**
|
|
447
|
-
* Method used to peek the last value of the deque.
|
|
448
|
-
*
|
|
449
|
-
* @return {any}
|
|
450
|
-
*/
|
|
451
|
-
FixedDeque.prototype.peekLast = function() {
|
|
452
|
-
if (this.size === 0) return;
|
|
453
|
-
var index = this.start + this.size - 1;
|
|
454
|
-
if (index >= this.capacity) index -= this.capacity;
|
|
455
|
-
return this.items[index];
|
|
456
|
-
};
|
|
457
|
-
/**
|
|
458
|
-
* Method used to get the desired value of the deque.
|
|
459
|
-
*
|
|
460
|
-
* @param {number} index
|
|
461
|
-
* @return {any}
|
|
462
|
-
*/
|
|
463
|
-
FixedDeque.prototype.get = function(index) {
|
|
464
|
-
if (this.size === 0 || index >= this.capacity) return;
|
|
465
|
-
index = this.start + index;
|
|
466
|
-
if (index >= this.capacity) index -= this.capacity;
|
|
467
|
-
return this.items[index];
|
|
468
|
-
};
|
|
469
|
-
/**
|
|
470
|
-
* Method used to iterate over the deque.
|
|
471
|
-
*
|
|
472
|
-
* @param {function} callback - Function to call for each item.
|
|
473
|
-
* @param {object} scope - Optional scope.
|
|
474
|
-
* @return {undefined}
|
|
475
|
-
*/
|
|
476
|
-
FixedDeque.prototype.forEach = function(callback, scope) {
|
|
477
|
-
scope = arguments.length > 1 ? scope : this;
|
|
478
|
-
var c = this.capacity, l = this.size, i = this.start, j = 0;
|
|
479
|
-
while (j < l) {
|
|
480
|
-
callback.call(scope, this.items[i], j, this);
|
|
481
|
-
i++;
|
|
482
|
-
j++;
|
|
483
|
-
if (i === c) i = 0;
|
|
484
|
-
}
|
|
485
|
-
};
|
|
486
|
-
/**
|
|
487
|
-
* Method used to convert the deque to a JavaScript array.
|
|
488
|
-
*
|
|
489
|
-
* @return {array}
|
|
490
|
-
*/
|
|
491
|
-
FixedDeque.prototype.toArray = function() {
|
|
492
|
-
var offset = this.start + this.size;
|
|
493
|
-
if (offset < this.capacity) return this.items.slice(this.start, offset);
|
|
494
|
-
var array = new this.ArrayClass(this.size), c = this.capacity, l = this.size, i = this.start, j = 0;
|
|
495
|
-
while (j < l) {
|
|
496
|
-
array[j] = this.items[i];
|
|
497
|
-
i++;
|
|
498
|
-
j++;
|
|
499
|
-
if (i === c) i = 0;
|
|
500
|
-
}
|
|
501
|
-
return array;
|
|
502
|
-
};
|
|
503
|
-
/**
|
|
504
|
-
* Method used to create an iterator over the deque's values.
|
|
505
|
-
*
|
|
506
|
-
* @return {Iterator}
|
|
507
|
-
*/
|
|
508
|
-
FixedDeque.prototype.values = function() {
|
|
509
|
-
var items = this.items, c = this.capacity, l = this.size, i = this.start, j = 0;
|
|
510
|
-
return new Iterator(function() {
|
|
511
|
-
if (j >= l) return { done: true };
|
|
512
|
-
var value = items[i];
|
|
513
|
-
i++;
|
|
514
|
-
j++;
|
|
515
|
-
if (i === c) i = 0;
|
|
516
|
-
return {
|
|
517
|
-
value,
|
|
518
|
-
done: false
|
|
519
|
-
};
|
|
520
|
-
});
|
|
521
|
-
};
|
|
522
|
-
/**
|
|
523
|
-
* Method used to create an iterator over the deque's entries.
|
|
524
|
-
*
|
|
525
|
-
* @return {Iterator}
|
|
526
|
-
*/
|
|
527
|
-
FixedDeque.prototype.entries = function() {
|
|
528
|
-
var items = this.items, c = this.capacity, l = this.size, i = this.start, j = 0;
|
|
529
|
-
return new Iterator(function() {
|
|
530
|
-
if (j >= l) return { done: true };
|
|
531
|
-
var value = items[i];
|
|
532
|
-
i++;
|
|
533
|
-
if (i === c) i = 0;
|
|
534
|
-
return {
|
|
535
|
-
value: [j++, value],
|
|
536
|
-
done: false
|
|
537
|
-
};
|
|
538
|
-
});
|
|
539
|
-
};
|
|
540
|
-
/**
|
|
541
|
-
* Attaching the #.values method to Symbol.iterator if possible.
|
|
542
|
-
*/
|
|
543
|
-
if (typeof Symbol !== "undefined") FixedDeque.prototype[Symbol.iterator] = FixedDeque.prototype.values;
|
|
544
|
-
/**
|
|
545
|
-
* Convenience known methods.
|
|
546
|
-
*/
|
|
547
|
-
FixedDeque.prototype.inspect = function() {
|
|
548
|
-
var array = this.toArray();
|
|
549
|
-
array.type = this.ArrayClass.name;
|
|
550
|
-
array.capacity = this.capacity;
|
|
551
|
-
Object.defineProperty(array, "constructor", {
|
|
552
|
-
value: FixedDeque,
|
|
553
|
-
enumerable: false
|
|
554
|
-
});
|
|
555
|
-
return array;
|
|
556
|
-
};
|
|
557
|
-
if (typeof Symbol !== "undefined") FixedDeque.prototype[Symbol.for("nodejs.util.inspect.custom")] = FixedDeque.prototype.inspect;
|
|
558
|
-
/**
|
|
559
|
-
* Static @.from function taking an arbitrary iterable & converting it into
|
|
560
|
-
* a deque.
|
|
561
|
-
*
|
|
562
|
-
* @param {Iterable} iterable - Target iterable.
|
|
563
|
-
* @param {function} ArrayClass - Array class to use.
|
|
564
|
-
* @param {number} capacity - Desired capacity.
|
|
565
|
-
* @return {FiniteStack}
|
|
566
|
-
*/
|
|
567
|
-
FixedDeque.from = function(iterable, ArrayClass, capacity) {
|
|
568
|
-
if (arguments.length < 3) {
|
|
569
|
-
capacity = iterables.guessLength(iterable);
|
|
570
|
-
if (typeof capacity !== "number") throw new Error("mnemonist/fixed-deque.from: could not guess iterable length. Please provide desired capacity as last argument.");
|
|
571
|
-
}
|
|
572
|
-
var deque = new FixedDeque(ArrayClass, capacity);
|
|
573
|
-
if (iterables.isArrayLike(iterable)) {
|
|
574
|
-
var i, l;
|
|
575
|
-
for (i = 0, l = iterable.length; i < l; i++) deque.items[i] = iterable[i];
|
|
576
|
-
deque.size = l;
|
|
577
|
-
return deque;
|
|
578
|
-
}
|
|
579
|
-
iterables.forEach(iterable, function(value) {
|
|
580
|
-
deque.push(value);
|
|
581
|
-
});
|
|
582
|
-
return deque;
|
|
583
|
-
};
|
|
584
|
-
/**
|
|
585
|
-
* Exporting.
|
|
586
|
-
*/
|
|
587
|
-
module.exports = FixedDeque;
|
|
588
|
-
}));
|
|
589
|
-
|
|
590
|
-
//#endregion
|
|
591
|
-
//#region ../../node_modules/.pnpm/graphology-dag@0.4.1_graphology-types@0.24.8/node_modules/graphology-dag/topological-sort.js
|
|
592
|
-
var require_topological_sort = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
593
|
-
/**
|
|
594
|
-
* Graphology Topological Sort
|
|
595
|
-
* ============================
|
|
596
|
-
*
|
|
597
|
-
* Function performing topological sort over the given DAG using Kahn's
|
|
598
|
-
* algorithm.
|
|
599
|
-
*
|
|
600
|
-
* This function also works on disconnected graphs.
|
|
601
|
-
*
|
|
602
|
-
* [Reference]:
|
|
603
|
-
* https://en.wikipedia.org/wiki/Topological_sorting
|
|
604
|
-
*/
|
|
605
|
-
const isGraph = require_is_graph();
|
|
606
|
-
const FixedDeque = require_fixed_deque();
|
|
607
|
-
function simpleInDegree(graph, node) {
|
|
608
|
-
let degree = 0;
|
|
609
|
-
graph.forEachInNeighbor(node, () => {
|
|
610
|
-
degree++;
|
|
611
|
-
});
|
|
612
|
-
return degree;
|
|
613
|
-
}
|
|
614
|
-
function forEachNodeInTopologicalOrder(graph, callback) {
|
|
615
|
-
if (!isGraph(graph)) throw new Error("graphology-dag/topological-sort: the given graph is not a valid graphology instance.");
|
|
616
|
-
if (graph.type === "undirected" || graph.undirectedSize !== 0) throw new Error("graphology-dag/topological-sort: cannot work if graph is not directed.");
|
|
617
|
-
if (graph.order === 0) return;
|
|
618
|
-
const queue = new FixedDeque(Array, graph.order);
|
|
619
|
-
const inDegrees = {};
|
|
620
|
-
let total = 0;
|
|
621
|
-
graph.forEachNode((node, attr) => {
|
|
622
|
-
const inDegree = graph.multi ? simpleInDegree(graph, node) : graph.inDegree(node);
|
|
623
|
-
if (inDegree === 0) queue.push([
|
|
624
|
-
node,
|
|
625
|
-
attr,
|
|
626
|
-
0
|
|
627
|
-
]);
|
|
628
|
-
else {
|
|
629
|
-
inDegrees[node] = inDegree;
|
|
630
|
-
total += inDegree;
|
|
631
|
-
}
|
|
632
|
-
});
|
|
633
|
-
let currentGeneration = 0;
|
|
634
|
-
function neighborCallback(neighbor, attr) {
|
|
635
|
-
const neighborInDegree = --inDegrees[neighbor];
|
|
636
|
-
total--;
|
|
637
|
-
if (neighborInDegree === 0) queue.push([
|
|
638
|
-
neighbor,
|
|
639
|
-
attr,
|
|
640
|
-
currentGeneration + 1
|
|
641
|
-
]);
|
|
642
|
-
inDegrees[neighbor] = neighborInDegree;
|
|
643
|
-
}
|
|
644
|
-
while (queue.size !== 0) {
|
|
645
|
-
const [node, attr, gen] = queue.shift();
|
|
646
|
-
currentGeneration = gen;
|
|
647
|
-
callback(node, attr, gen);
|
|
648
|
-
graph.forEachOutNeighbor(node, neighborCallback);
|
|
649
|
-
}
|
|
650
|
-
if (total !== 0) throw new Error("graphology-dag/topological-sort: given graph is not acyclic.");
|
|
651
|
-
}
|
|
652
|
-
function topologicalSort(graph) {
|
|
653
|
-
if (!isGraph(graph)) throw new Error("graphology-dag/topological-sort: the given graph is not a valid graphology instance.");
|
|
654
|
-
const sortedNodes = new Array(graph.order);
|
|
655
|
-
let i = 0;
|
|
656
|
-
forEachNodeInTopologicalOrder(graph, (node) => {
|
|
657
|
-
sortedNodes[i++] = node;
|
|
658
|
-
});
|
|
659
|
-
return sortedNodes;
|
|
660
|
-
}
|
|
661
|
-
/**
|
|
662
|
-
* Exporting.
|
|
663
|
-
*/
|
|
664
|
-
exports.topologicalSort = topologicalSort;
|
|
665
|
-
}));
|
|
666
|
-
|
|
667
|
-
//#endregion
|
|
668
|
-
//#region ../../node_modules/.pnpm/graphology-dag@0.4.1_graphology-types@0.24.8/node_modules/graphology-dag/will-create-cycle.js
|
|
669
|
-
var require_will_create_cycle = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
670
|
-
/**
|
|
671
|
-
* Graphology Cycle Creation Checker
|
|
672
|
-
* ==================================
|
|
673
|
-
*
|
|
674
|
-
* Function returning whether adding the given directed edge to a DAG will
|
|
675
|
-
* create a cycle.
|
|
676
|
-
*
|
|
677
|
-
* Note that this function requires the given graph to be a valid DAG forest
|
|
678
|
-
* and will not check it beforehand for performance reasons.
|
|
679
|
-
*/
|
|
680
|
-
const isGraph = require_is_graph();
|
|
681
|
-
module.exports = function willCreateCycle(graph, source, target) {
|
|
682
|
-
if (!isGraph(graph)) throw new Error("graphology-dag/will-create-cycle: the given graph is not a valid graphology instance.");
|
|
683
|
-
source = "" + source;
|
|
684
|
-
target = "" + target;
|
|
685
|
-
if (source === target) return true;
|
|
686
|
-
if (!graph.hasNode(source) || !graph.hasNode(target)) return false;
|
|
687
|
-
if (graph.hasDirectedEdge(source, target)) return false;
|
|
688
|
-
if (graph.hasDirectedEdge(target, source)) return true;
|
|
689
|
-
const stack = graph.outNeighbors(target);
|
|
690
|
-
function push(neighbor) {
|
|
691
|
-
stack.push(neighbor);
|
|
692
|
-
}
|
|
693
|
-
while (stack.length !== 0) {
|
|
694
|
-
const node = stack.pop();
|
|
695
|
-
if (node === source) return true;
|
|
696
|
-
graph.forEachOutNeighbor(node, push);
|
|
697
|
-
}
|
|
698
|
-
return false;
|
|
699
|
-
};
|
|
700
|
-
}));
|
|
701
|
-
|
|
702
|
-
//#endregion
|
|
703
|
-
export { require_iterator as a, require_typed_arrays as i, require_topological_sort as n, require_foreach as o, require_iterables as r, require_will_create_cycle as t };
|
|
1
|
+
import{t as __commonJSMin}from"../rolldown-runtime.mjs";var require_support=__commonJSMin((e=>{e.ARRAY_BUFFER_SUPPORT=typeof ArrayBuffer<`u`,e.SYMBOL_SUPPORT=typeof Symbol<`u`})),require_foreach=__commonJSMin(((e,n)=>{var r=require_support(),i=r.ARRAY_BUFFER_SUPPORT,a=r.SYMBOL_SUPPORT;n.exports=function e(t,n){var r,o,s,c,l;if(!t)throw Error(`obliterator/forEach: invalid iterable.`);if(typeof n!=`function`)throw Error(`obliterator/forEach: expecting a callback.`);if(Array.isArray(t)||i&&ArrayBuffer.isView(t)||typeof t==`string`||t.toString()===`[object Arguments]`){for(s=0,c=t.length;s<c;s++)n(t[s],s);return}if(typeof t.forEach==`function`){t.forEach(n);return}if(a&&Symbol.iterator in t&&typeof t.next!=`function`&&(t=t[Symbol.iterator]()),typeof t.next==`function`){for(r=t,s=0;l=r.next(),l.done!==!0;)n(l.value,s),s++;return}for(o in t)t.hasOwnProperty(o)&&n(t[o],o)}})),require_iterator=__commonJSMin(((e,t)=>{function n(e){if(typeof e!=`function`)throw Error(`obliterator/iterator: expecting a function!`);this.next=e}typeof Symbol<`u`&&(n.prototype[Symbol.iterator]=function(){return this}),n.of=function(){var e=arguments,t=e.length,r=0;return new n(function(){return r>=t?{done:!0}:{done:!1,value:e[r++]}})},n.empty=function(){return new n(function(){return{done:!0}})},n.fromSequence=function(e){var t=0,r=e.length;return new n(function(){return t>=r?{done:!0}:{done:!1,value:e[t++]}})},n.is=function(e){return e instanceof n?!0:typeof e==`object`&&!!e&&typeof e.next==`function`},t.exports=n})),require_typed_arrays=__commonJSMin((e=>{var t=2**8-1,n=2**16-1,r=2**32-1,i=2**7-1,a=2**15-1,o=2**31-1;e.getPointerArray=function(e){var i=e-1;if(i<=t)return Uint8Array;if(i<=n)return Uint16Array;if(i<=r)return Uint32Array;throw Error(`mnemonist: Pointer Array of size > 4294967295 is not supported.`)},e.getSignedPointerArray=function(e){var t=e-1;return t<=i?Int8Array:t<=a?Int16Array:t<=o?Int32Array:Float64Array},e.getNumberType=function(e){return e===(e|0)?Math.sign(e)===-1?e<=127&&e>=-128?Int8Array:e<=32767&&e>=-32768?Int16Array:Int32Array:e<=255?Uint8Array:e<=65535?Uint16Array:Uint32Array:Float64Array};var s={Uint8Array:1,Int8Array:2,Uint16Array:3,Int16Array:4,Uint32Array:5,Int32Array:6,Float32Array:7,Float64Array:8};e.getMinimalRepresentation=function(t,n){var r=null,i=0,a,o,c,l,u;for(l=0,u=t.length;l<u;l++)c=n?n(t[l]):t[l],o=e.getNumberType(c),a=s[o.name],a>i&&(i=a,r=o);return r},e.isTypedArray=function(e){return typeof ArrayBuffer<`u`&&ArrayBuffer.isView(e)},e.concat=function(){var e=0,t,n,r;for(t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;var i=new arguments[0].constructor(e);for(t=0,n=0;t<r;t++)i.set(arguments[t],n),n+=arguments[t].length;return i},e.indices=function(t){for(var n=new(e.getPointerArray(t))(t),r=0;r<t;r++)n[r]=r;return n}})),require_iterables=__commonJSMin((e=>{var t=require_foreach(),r=require_typed_arrays();function a(e){return Array.isArray(e)||r.isTypedArray(e)}function o(e){if(typeof e.length==`number`)return e.length;if(typeof e.size==`number`)return e.size}function s(e){var n=o(e),r=typeof n==`number`?Array(n):[],i=0;return t(e,function(e){r[i++]=e}),r}function c(e){var n=o(e),i=typeof n==`number`?r.getPointerArray(n):Array,a=typeof n==`number`?Array(n):[],s=typeof n==`number`?new i(n):[],c=0;return t(e,function(e){a[c]=e,s[c]=c++}),[a,s]}e.isArrayLike=a,e.guessLength=o,e.toArray=s,e.toArrayWithIndices=c})),require_is_graph=__commonJSMin(((e,t)=>{t.exports=function e(t){return typeof t==`object`&&!!t&&typeof t.addUndirectedEdgeWithKey==`function`&&typeof t.dropNode==`function`&&typeof t.multi==`boolean`}})),require_fixed_deque=__commonJSMin(((e,t)=>{var n=require_iterables(),i=require_iterator();function o(e,t){if(arguments.length<2)throw Error(`mnemonist/fixed-deque: expecting an Array class and a capacity.`);if(typeof t!=`number`||t<=0)throw Error("mnemonist/fixed-deque: `capacity` should be a positive number.");this.ArrayClass=e,this.capacity=t,this.items=new e(this.capacity),this.clear()}o.prototype.clear=function(){this.start=0,this.size=0},o.prototype.push=function(e){if(this.size===this.capacity)throw Error(`mnemonist/fixed-deque.push: deque capacity (`+this.capacity+`) exceeded!`);var t=this.start+this.size;return t>=this.capacity&&(t-=this.capacity),this.items[t]=e,++this.size},o.prototype.unshift=function(e){if(this.size===this.capacity)throw Error(`mnemonist/fixed-deque.unshift: deque capacity (`+this.capacity+`) exceeded!`);var t=this.start-1;return this.start===0&&(t=this.capacity-1),this.items[t]=e,this.start=t,++this.size},o.prototype.pop=function(){if(this.size!==0){this.size--;var e=this.start+this.size;return e>=this.capacity&&(e-=this.capacity),this.items[e]}},o.prototype.shift=function(){if(this.size!==0){var e=this.start;return this.size--,this.start++,this.start===this.capacity&&(this.start=0),this.items[e]}},o.prototype.peekFirst=function(){if(this.size!==0)return this.items[this.start]},o.prototype.peekLast=function(){if(this.size!==0){var e=this.start+this.size-1;return e>=this.capacity&&(e-=this.capacity),this.items[e]}},o.prototype.get=function(e){if(!(this.size===0||e>=this.capacity))return e=this.start+e,e>=this.capacity&&(e-=this.capacity),this.items[e]},o.prototype.forEach=function(e,t){t=arguments.length>1?t:this;for(var n=this.capacity,r=this.size,i=this.start,a=0;a<r;)e.call(t,this.items[i],a,this),i++,a++,i===n&&(i=0)},o.prototype.toArray=function(){var e=this.start+this.size;if(e<this.capacity)return this.items.slice(this.start,e);for(var t=new this.ArrayClass(this.size),n=this.capacity,r=this.size,i=this.start,a=0;a<r;)t[a]=this.items[i],i++,a++,i===n&&(i=0);return t},o.prototype.values=function(){var e=this.items,t=this.capacity,n=this.size,r=this.start,a=0;return new i(function(){if(a>=n)return{done:!0};var i=e[r];return r++,a++,r===t&&(r=0),{value:i,done:!1}})},o.prototype.entries=function(){var e=this.items,t=this.capacity,n=this.size,r=this.start,a=0;return new i(function(){if(a>=n)return{done:!0};var i=e[r];return r++,r===t&&(r=0),{value:[a++,i],done:!1}})},typeof Symbol<`u`&&(o.prototype[Symbol.iterator]=o.prototype.values),o.prototype.inspect=function(){var e=this.toArray();return e.type=this.ArrayClass.name,e.capacity=this.capacity,Object.defineProperty(e,`constructor`,{value:o,enumerable:!1}),e},typeof Symbol<`u`&&(o.prototype[Symbol.for(`nodejs.util.inspect.custom`)]=o.prototype.inspect),o.from=function(e,t,r){if(arguments.length<3&&(r=n.guessLength(e),typeof r!=`number`))throw Error(`mnemonist/fixed-deque.from: could not guess iterable length. Please provide desired capacity as last argument.`);var i=new o(t,r);if(n.isArrayLike(e)){var a,s;for(a=0,s=e.length;a<s;a++)i.items[a]=e[a];return i.size=s,i}return n.forEach(e,function(e){i.push(e)}),i},t.exports=o})),require_topological_sort=__commonJSMin((e=>{let t=require_is_graph(),n=require_fixed_deque();function r(e,t){let n=0;return e.forEachInNeighbor(t,()=>{n++}),n}function i(e,i){if(!t(e))throw Error(`graphology-dag/topological-sort: the given graph is not a valid graphology instance.`);if(e.type===`undirected`||e.undirectedSize!==0)throw Error(`graphology-dag/topological-sort: cannot work if graph is not directed.`);if(e.order===0)return;let a=new n(Array,e.order),o={},s=0;e.forEachNode((t,n)=>{let i=e.multi?r(e,t):e.inDegree(t);i===0?a.push([t,n,0]):(o[t]=i,s+=i)});let c=0;function l(e,t){let n=--o[e];s--,n===0&&a.push([e,t,c+1]),o[e]=n}for(;a.size!==0;){let[t,n,r]=a.shift();c=r,i(t,n,r),e.forEachOutNeighbor(t,l)}if(s!==0)throw Error(`graphology-dag/topological-sort: given graph is not acyclic.`)}function a(e){if(!t(e))throw Error(`graphology-dag/topological-sort: the given graph is not a valid graphology instance.`);let n=Array(e.order),r=0;return i(e,e=>{n[r++]=e}),n}e.topologicalSort=a})),require_will_create_cycle=__commonJSMin(((e,t)=>{let n=require_is_graph();t.exports=function e(t,r,i){if(!n(t))throw Error(`graphology-dag/will-create-cycle: the given graph is not a valid graphology instance.`);if(r=``+r,i=``+i,r===i)return!0;if(!t.hasNode(r)||!t.hasNode(i)||t.hasDirectedEdge(r,i))return!1;if(t.hasDirectedEdge(i,r))return!0;let a=t.outNeighbors(i);function o(e){a.push(e)}for(;a.length!==0;){let e=a.pop();if(e===r)return!0;t.forEachOutNeighbor(e,o)}return!1}}));export{require_iterator as a,require_typed_arrays as i,require_topological_sort as n,require_foreach as o,require_iterables as r,require_will_create_cycle as t};
|