@floegence/floe-webapp-core 0.101.43 → 0.101.44
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.
|
@@ -11,25 +11,25 @@ function Kr() {
|
|
|
11
11
|
a.exports = b();
|
|
12
12
|
})(function() {
|
|
13
13
|
return (/* @__PURE__ */ (function() {
|
|
14
|
-
function b(o, u,
|
|
15
|
-
function _(
|
|
16
|
-
if (!u[
|
|
17
|
-
if (!o[
|
|
18
|
-
var
|
|
19
|
-
if (!l &&
|
|
20
|
-
if (
|
|
21
|
-
var w = new Error("Cannot find module '" +
|
|
14
|
+
function b(o, u, C) {
|
|
15
|
+
function _(N, l) {
|
|
16
|
+
if (!u[N]) {
|
|
17
|
+
if (!o[N]) {
|
|
18
|
+
var S = typeof Ke == "function" && Ke;
|
|
19
|
+
if (!l && S) return S(N, !0);
|
|
20
|
+
if (R) return R(N, !0);
|
|
21
|
+
var w = new Error("Cannot find module '" + N + "'");
|
|
22
22
|
throw w.code = "MODULE_NOT_FOUND", w;
|
|
23
23
|
}
|
|
24
|
-
var
|
|
25
|
-
o[
|
|
26
|
-
var
|
|
27
|
-
return _(
|
|
28
|
-
},
|
|
24
|
+
var M = u[N] = { exports: {} };
|
|
25
|
+
o[N][0].call(M.exports, function(v) {
|
|
26
|
+
var I = o[N][1][v];
|
|
27
|
+
return _(I || v);
|
|
28
|
+
}, M, M.exports, b, o, u, C);
|
|
29
29
|
}
|
|
30
|
-
return u[
|
|
30
|
+
return u[N].exports;
|
|
31
31
|
}
|
|
32
|
-
for (var
|
|
32
|
+
for (var R = typeof Ke == "function" && Ke, F = 0; F < C.length; F++) _(C[F]);
|
|
33
33
|
return _;
|
|
34
34
|
}
|
|
35
35
|
return b;
|
|
@@ -37,70 +37,70 @@ function Kr() {
|
|
|
37
37
|
Object.defineProperty(u, "__esModule", {
|
|
38
38
|
value: !0
|
|
39
39
|
}), u.default = void 0;
|
|
40
|
-
function
|
|
40
|
+
function C(w) {
|
|
41
41
|
"@babel/helpers - typeof";
|
|
42
|
-
return
|
|
43
|
-
return typeof
|
|
44
|
-
} : function(
|
|
45
|
-
return
|
|
46
|
-
},
|
|
42
|
+
return C = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(M) {
|
|
43
|
+
return typeof M;
|
|
44
|
+
} : function(M) {
|
|
45
|
+
return M && typeof Symbol == "function" && M.constructor === Symbol && M !== Symbol.prototype ? "symbol" : typeof M;
|
|
46
|
+
}, C(w);
|
|
47
47
|
}
|
|
48
|
-
function _(w,
|
|
49
|
-
if (!(w instanceof
|
|
48
|
+
function _(w, M) {
|
|
49
|
+
if (!(w instanceof M)) throw new TypeError("Cannot call a class as a function");
|
|
50
50
|
}
|
|
51
|
-
function
|
|
52
|
-
for (var v = 0; v <
|
|
53
|
-
var
|
|
54
|
-
|
|
51
|
+
function R(w, M) {
|
|
52
|
+
for (var v = 0; v < M.length; v++) {
|
|
53
|
+
var I = M[v];
|
|
54
|
+
I.enumerable = I.enumerable || !1, I.configurable = !0, "value" in I && (I.writable = !0), Object.defineProperty(w, N(I.key), I);
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
|
-
function
|
|
58
|
-
return
|
|
57
|
+
function F(w, M, v) {
|
|
58
|
+
return M && R(w.prototype, M), Object.defineProperty(w, "prototype", { writable: !1 }), w;
|
|
59
59
|
}
|
|
60
|
-
function
|
|
61
|
-
var
|
|
62
|
-
return
|
|
60
|
+
function N(w) {
|
|
61
|
+
var M = l(w, "string");
|
|
62
|
+
return C(M) == "symbol" ? M : M + "";
|
|
63
63
|
}
|
|
64
|
-
function l(w,
|
|
65
|
-
if (
|
|
64
|
+
function l(w, M) {
|
|
65
|
+
if (C(w) != "object" || !w) return w;
|
|
66
66
|
var v = w[Symbol.toPrimitive];
|
|
67
67
|
if (v !== void 0) {
|
|
68
|
-
var
|
|
69
|
-
if (I
|
|
68
|
+
var I = v.call(w, M);
|
|
69
|
+
if (C(I) != "object") return I;
|
|
70
70
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
71
71
|
}
|
|
72
72
|
return String(w);
|
|
73
73
|
}
|
|
74
74
|
u.default = /* @__PURE__ */ (function() {
|
|
75
75
|
function w() {
|
|
76
|
-
var
|
|
77
|
-
if (_(this, w), this.defaultLayoutOptions =
|
|
76
|
+
var M = this, v = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, I = v.defaultLayoutOptions, f = I === void 0 ? {} : I, y = v.algorithms, d = y === void 0 ? ["layered", "stress", "mrtree", "radial", "force", "disco", "sporeOverlap", "sporeCompaction", "rectpacking"] : y, x = v.workerFactory, P = v.workerUrl;
|
|
77
|
+
if (_(this, w), this.defaultLayoutOptions = f, this.initialized = !1, typeof P > "u" && typeof x > "u")
|
|
78
78
|
throw new Error("Cannot construct an ELK without both 'workerUrl' and 'workerFactory'.");
|
|
79
|
-
var
|
|
80
|
-
typeof
|
|
81
|
-
return new Worker(
|
|
79
|
+
var j = x;
|
|
80
|
+
typeof P < "u" && typeof x > "u" && (j = function(k) {
|
|
81
|
+
return new Worker(k);
|
|
82
82
|
});
|
|
83
|
-
var
|
|
84
|
-
if (typeof
|
|
83
|
+
var m = j(P);
|
|
84
|
+
if (typeof m.postMessage != "function")
|
|
85
85
|
throw new TypeError("Created worker does not provide the required 'postMessage' function.");
|
|
86
|
-
this.worker = new
|
|
86
|
+
this.worker = new S(m), this.worker.postMessage({
|
|
87
87
|
cmd: "register",
|
|
88
|
-
algorithms:
|
|
88
|
+
algorithms: d
|
|
89
89
|
}).then(function(c) {
|
|
90
|
-
return
|
|
90
|
+
return M.initialized = !0;
|
|
91
91
|
}).catch(console.err);
|
|
92
92
|
}
|
|
93
|
-
return
|
|
93
|
+
return F(w, [{
|
|
94
94
|
key: "layout",
|
|
95
95
|
value: function(v) {
|
|
96
|
-
var
|
|
96
|
+
var I = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, f = I.layoutOptions, y = f === void 0 ? this.defaultLayoutOptions : f, d = I.logging, x = d === void 0 ? !1 : d, P = I.measureExecutionTime, j = P === void 0 ? !1 : P;
|
|
97
97
|
return v ? this.worker.postMessage({
|
|
98
98
|
cmd: "layout",
|
|
99
99
|
graph: v,
|
|
100
|
-
layoutOptions:
|
|
100
|
+
layoutOptions: y,
|
|
101
101
|
options: {
|
|
102
|
-
logging:
|
|
103
|
-
measureExecutionTime:
|
|
102
|
+
logging: x,
|
|
103
|
+
measureExecutionTime: j
|
|
104
104
|
}
|
|
105
105
|
}) : Promise.reject(new Error("Missing mandatory parameter 'graph'."));
|
|
106
106
|
}
|
|
@@ -132,34 +132,34 @@ function Kr() {
|
|
|
132
132
|
}
|
|
133
133
|
}]);
|
|
134
134
|
})();
|
|
135
|
-
var
|
|
136
|
-
function w(
|
|
135
|
+
var S = /* @__PURE__ */ (function() {
|
|
136
|
+
function w(M) {
|
|
137
137
|
var v = this;
|
|
138
|
-
if (_(this, w),
|
|
138
|
+
if (_(this, w), M === void 0)
|
|
139
139
|
throw new Error("Missing mandatory parameter 'worker'.");
|
|
140
|
-
this.resolvers = {}, this.worker =
|
|
140
|
+
this.resolvers = {}, this.worker = M, this.worker.onmessage = function(I) {
|
|
141
141
|
setTimeout(function() {
|
|
142
|
-
v.receive(v,
|
|
142
|
+
v.receive(v, I);
|
|
143
143
|
}, 0);
|
|
144
144
|
};
|
|
145
145
|
}
|
|
146
|
-
return
|
|
146
|
+
return F(w, [{
|
|
147
147
|
key: "postMessage",
|
|
148
148
|
value: function(v) {
|
|
149
|
-
var
|
|
150
|
-
this.id =
|
|
151
|
-
var
|
|
152
|
-
return new Promise(function(
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
},
|
|
149
|
+
var I = this.id || 0;
|
|
150
|
+
this.id = I + 1, v.id = I;
|
|
151
|
+
var f = this;
|
|
152
|
+
return new Promise(function(y, d) {
|
|
153
|
+
f.resolvers[I] = function(x, P) {
|
|
154
|
+
x ? (f.convertGwtStyleError(x), d(x)) : y(P);
|
|
155
|
+
}, f.worker.postMessage(v);
|
|
156
156
|
});
|
|
157
157
|
}
|
|
158
158
|
}, {
|
|
159
159
|
key: "receive",
|
|
160
|
-
value: function(v,
|
|
161
|
-
var
|
|
162
|
-
|
|
160
|
+
value: function(v, I) {
|
|
161
|
+
var f = I.data, y = v.resolvers[f.id];
|
|
162
|
+
y && (delete v.resolvers[f.id], f.error ? y(f.error) : y(null, f.data));
|
|
163
163
|
}
|
|
164
164
|
}, {
|
|
165
165
|
key: "terminate",
|
|
@@ -170,17 +170,17 @@ function Kr() {
|
|
|
170
170
|
key: "convertGwtStyleError",
|
|
171
171
|
value: function(v) {
|
|
172
172
|
if (v) {
|
|
173
|
-
var
|
|
174
|
-
|
|
173
|
+
var I = v.__java$exception;
|
|
174
|
+
I && (I.cause && I.cause.backingJsObject && (v.cause = I.cause.backingJsObject, this.convertGwtStyleError(v.cause)), delete v.__java$exception);
|
|
175
175
|
}
|
|
176
176
|
}
|
|
177
177
|
}]);
|
|
178
178
|
})();
|
|
179
179
|
}, {}], 2: [function(b, o, u) {
|
|
180
|
-
var
|
|
180
|
+
var C = b("./elk-api.js").default;
|
|
181
181
|
Object.defineProperty(o.exports, "__esModule", {
|
|
182
182
|
value: !0
|
|
183
|
-
}), o.exports =
|
|
183
|
+
}), o.exports = C, C.default = C;
|
|
184
184
|
}, { "./elk-api.js": 1 }] }, {}, [2])(2);
|
|
185
185
|
});
|
|
186
186
|
})(pt)), pt.exports;
|
|
@@ -199,33 +199,33 @@ var Xr = Kr(), Zr = /* @__PURE__ */ qr(Xr), Qr = (a) => ({ avoidLib: void 0, asy
|
|
|
199
199
|
} }), en = (() => {
|
|
200
200
|
var a = import.meta.url;
|
|
201
201
|
return async function(s = {}) {
|
|
202
|
-
var b, o = s, u,
|
|
203
|
-
u = e,
|
|
204
|
-
}),
|
|
205
|
-
if (typeof document < "u" && document.currentScript && (
|
|
206
|
-
|
|
207
|
-
if (
|
|
202
|
+
var b, o = s, u, C, _ = new Promise((e, t) => {
|
|
203
|
+
u = e, C = t;
|
|
204
|
+
}), R = "./this.program", F = "", N;
|
|
205
|
+
if (typeof document < "u" && document.currentScript && (F = document.currentScript.src), a && (F = a), F.startsWith("blob:") ? F = "" : F = F.slice(0, F.replace(/[?#].*/, "").lastIndexOf("/") + 1), typeof window != "object" && typeof WorkerGlobalScope > "u") throw Error("not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)");
|
|
206
|
+
N = async (e) => {
|
|
207
|
+
if (f(!U(e), "readAsync does not work with file:// URLs"), e = await fetch(e, { credentials: "same-origin" }), e.ok) return e.arrayBuffer();
|
|
208
208
|
throw Error(e.status + " : " + e.url);
|
|
209
209
|
};
|
|
210
|
-
var l = console.log.bind(console),
|
|
211
|
-
|
|
210
|
+
var l = console.log.bind(console), S = console.error.bind(console);
|
|
211
|
+
f(!0, "worker environment detected but not enabled at build time. Add `worker` to `-sENVIRONMENT` to enable."), f(!0, "node environment detected but not enabled at build time. Add `node` to `-sENVIRONMENT` to enable."), f(!0, "shell environment detected but not enabled at build time. Add `shell` to `-sENVIRONMENT` to enable.");
|
|
212
212
|
var w;
|
|
213
|
-
typeof WebAssembly != "object" &&
|
|
214
|
-
var
|
|
215
|
-
function
|
|
213
|
+
typeof WebAssembly != "object" && S("no native wasm support detected");
|
|
214
|
+
var M, v = !1, I;
|
|
215
|
+
function f(e, t) {
|
|
216
216
|
e || X("Assertion failed" + (t ? ": " + t : ""));
|
|
217
217
|
}
|
|
218
|
-
var
|
|
218
|
+
var y, d, x, P, j, m, c, k, G, T, A = !1, L = !1, U = (e) => e.startsWith("file://");
|
|
219
219
|
function H() {
|
|
220
220
|
var e = Jt();
|
|
221
|
-
|
|
221
|
+
f((e & 3) == 0), e == 0 && (e += 4), m[e >> 2] = 34821223, m[e + 4 >> 2] = 2310721022, m[0] = 1668509029;
|
|
222
222
|
}
|
|
223
223
|
function D() {
|
|
224
224
|
if (!v) {
|
|
225
225
|
var e = Jt();
|
|
226
226
|
e == 0 && (e += 4);
|
|
227
|
-
var t =
|
|
228
|
-
t == 34821223 && r == 2310721022 || X(`Stack overflow! Stack cookie has been overwritten at ${ke(e)}, expected hex dwords 0x89BACDFE and 0x2135467, but received ${ke(r)} ${ke(t)}`),
|
|
227
|
+
var t = m[e >> 2], r = m[e + 4 >> 2];
|
|
228
|
+
t == 34821223 && r == 2310721022 || X(`Stack overflow! Stack cookie has been overwritten at ${ke(e)}, expected hex dwords 0x89BACDFE and 0x2135467, but received ${ke(r)} ${ke(t)}`), m[0] != 1668509029 && X("Runtime error: The application has corrupted its heap memory area (address zero)!");
|
|
229
229
|
}
|
|
230
230
|
}
|
|
231
231
|
var z = new Int16Array(1), Z = new Int8Array(z.buffer);
|
|
@@ -256,32 +256,32 @@ var Xr = Kr(), Zr = /* @__PURE__ */ qr(Xr), Qr = (a) => ({ avoidLib: void 0, asy
|
|
|
256
256
|
} });
|
|
257
257
|
}
|
|
258
258
|
function he() {
|
|
259
|
-
var e =
|
|
260
|
-
|
|
259
|
+
var e = M.buffer;
|
|
260
|
+
y = new Int8Array(e), x = new Int16Array(e), d = new Uint8Array(e), P = new Uint16Array(e), j = new Int32Array(e), m = new Uint32Array(e), c = new Float32Array(e), T = new Float64Array(e), k = new BigInt64Array(e), G = new BigUint64Array(e);
|
|
261
261
|
}
|
|
262
|
-
|
|
262
|
+
f(typeof Int32Array < "u" && typeof Float64Array < "u" && Int32Array.prototype.subarray != null && Int32Array.prototype.set != null, "JS engine does not provide full typed array support");
|
|
263
263
|
var K = 0, se = null, Q = {}, ee = null;
|
|
264
264
|
function ve() {
|
|
265
|
-
K++, o.monitorRunDependencies?.(K),
|
|
265
|
+
K++, o.monitorRunDependencies?.(K), f(!Q["wasm-instantiate"]), Q["wasm-instantiate"] = 1, ee === null && typeof setInterval < "u" && (ee = setInterval(() => {
|
|
266
266
|
if (v) clearInterval(ee), ee = null;
|
|
267
267
|
else {
|
|
268
268
|
var e = !1, t;
|
|
269
|
-
for (t in Q) e || (e = !0,
|
|
270
|
-
e &&
|
|
269
|
+
for (t in Q) e || (e = !0, S("still waiting on run dependencies:")), S(`dependency: ${t}`);
|
|
270
|
+
e && S("(end of list)");
|
|
271
271
|
}
|
|
272
272
|
}, 1e4));
|
|
273
273
|
}
|
|
274
274
|
function X(e) {
|
|
275
|
-
throw o.onAbort?.(e), e = "Aborted(" + e + ")",
|
|
275
|
+
throw o.onAbort?.(e), e = "Aborted(" + e + ")", S(e), v = !0, A && Gr(), e = new WebAssembly.RuntimeError(e), C(e), e;
|
|
276
276
|
}
|
|
277
277
|
function re() {
|
|
278
278
|
X("Filesystem support (FS) was not included. The problem is that you are using files from JS, but files were not used from C/C++, so filesystem support was not auto-included. You can force-include filesystem support with -sFORCE_FILESYSTEM");
|
|
279
279
|
}
|
|
280
280
|
function te(e, t) {
|
|
281
281
|
return (...r) => {
|
|
282
|
-
|
|
282
|
+
f(A, `native function \`${e}\` called before runtime initialization`), f(!L, `native function \`${e}\` called after runtime exit (use NO_EXIT_RUNTIME to keep it alive after main() exits)`);
|
|
283
283
|
var n = ie[e];
|
|
284
|
-
return
|
|
284
|
+
return f(n, `exported native function \`${e}\` not found`), f(r.length <= t, `native function \`${e}\` called with ${r.length} args but expects ${t}`), n(...r);
|
|
285
285
|
};
|
|
286
286
|
}
|
|
287
287
|
var Me = 0;
|
|
@@ -309,7 +309,7 @@ var Xr = Kr(), Zr = /* @__PURE__ */ qr(Xr), Qr = (a) => ({ avoidLib: void 0, asy
|
|
|
309
309
|
var Le;
|
|
310
310
|
async function ur(e) {
|
|
311
311
|
if (!w) try {
|
|
312
|
-
var t = await
|
|
312
|
+
var t = await N(e);
|
|
313
313
|
return new Uint8Array(t);
|
|
314
314
|
} catch {
|
|
315
315
|
}
|
|
@@ -322,7 +322,7 @@ var Xr = Kr(), Zr = /* @__PURE__ */ qr(Xr), Qr = (a) => ({ avoidLib: void 0, asy
|
|
|
322
322
|
var r = await ur(e);
|
|
323
323
|
return await WebAssembly.instantiate(r, t);
|
|
324
324
|
} catch (n) {
|
|
325
|
-
|
|
325
|
+
S(`failed to asynchronously prepare wasm: ${n}`), U(Le) && S(`warning: Loading from a file URI (${Le}) is not supported in most browsers. See https://emscripten.org/docs/getting_started/FAQ.html#how-do-i-run-a-local-webserver-for-testing-why-does-my-program-stall-in-downloading-or-preparing`), X(n);
|
|
326
326
|
}
|
|
327
327
|
}
|
|
328
328
|
async function dr(e) {
|
|
@@ -331,7 +331,7 @@ var Xr = Kr(), Zr = /* @__PURE__ */ qr(Xr), Qr = (a) => ({ avoidLib: void 0, asy
|
|
|
331
331
|
var r = fetch(t, { credentials: "same-origin" });
|
|
332
332
|
return await WebAssembly.instantiateStreaming(r, e);
|
|
333
333
|
} catch (n) {
|
|
334
|
-
|
|
334
|
+
S(`wasm streaming compile failed: ${n}`), S("falling back to ArrayBuffer instantiation");
|
|
335
335
|
}
|
|
336
336
|
return lr(t, e);
|
|
337
337
|
}
|
|
@@ -346,8 +346,8 @@ var Xr = Kr(), Zr = /* @__PURE__ */ qr(Xr), Qr = (a) => ({ avoidLib: void 0, asy
|
|
|
346
346
|
}, _t = [], xt = [], hr = () => {
|
|
347
347
|
var e = o.preRun.shift();
|
|
348
348
|
xt.push(e);
|
|
349
|
-
}, Se = !1, ke = (e) => (
|
|
350
|
-
me.M || (me.M = {}), me.M[e] || (me.M[e] = 1,
|
|
349
|
+
}, Se = !1, ke = (e) => (f(typeof e == "number"), "0x" + (e >>> 0).toString(16).padStart(8, "0")), me = (e) => {
|
|
350
|
+
me.M || (me.M = {}), me.M[e] || (me.M[e] = 1, S(e));
|
|
351
351
|
}, be, Tt = typeof TextDecoder < "u" ? new TextDecoder() : void 0, Et = (e, t = 0, r = NaN) => {
|
|
352
352
|
var n = t + r;
|
|
353
353
|
for (r = t; e[r] && !(r >= n); ) ++r;
|
|
@@ -355,20 +355,20 @@ var Xr = Kr(), Zr = /* @__PURE__ */ qr(Xr), Qr = (a) => ({ avoidLib: void 0, asy
|
|
|
355
355
|
for (n = ""; t < r; ) {
|
|
356
356
|
var i = e[t++];
|
|
357
357
|
if (i & 128) {
|
|
358
|
-
var
|
|
359
|
-
if ((i & 224) == 192) n += String.fromCharCode((i & 31) << 6 |
|
|
358
|
+
var h = e[t++] & 63;
|
|
359
|
+
if ((i & 224) == 192) n += String.fromCharCode((i & 31) << 6 | h);
|
|
360
360
|
else {
|
|
361
|
-
var
|
|
362
|
-
(i & 240) == 224 ? i = (i & 15) << 12 |
|
|
361
|
+
var g = e[t++] & 63;
|
|
362
|
+
(i & 240) == 224 ? i = (i & 15) << 12 | h << 6 | g : ((i & 248) != 240 && me("Invalid UTF-8 leading byte " + ke(i) + " encountered when deserializing a UTF-8 string in wasm memory to a JS string!"), i = (i & 7) << 18 | h << 12 | g << 6 | e[t++] & 63), 65536 > i ? n += String.fromCharCode(i) : (i -= 65536, n += String.fromCharCode(55296 | i >> 10, 56320 | i & 1023));
|
|
363
363
|
}
|
|
364
364
|
} else n += String.fromCharCode(i);
|
|
365
365
|
}
|
|
366
366
|
return n;
|
|
367
|
-
}, Ie = (e, t) => (
|
|
367
|
+
}, Ie = (e, t) => (f(typeof e == "number", `UTF8ToString expects a number (got ${typeof e})`), e ? Et(d, e, t) : ""), Ze = (e) => (e = e.getArg(ie.__cpp_exception, 0), Jr(e)), Mt = (e) => {
|
|
368
368
|
var t = Ze(e);
|
|
369
369
|
e = qt();
|
|
370
370
|
var r = Yt(4), n = Yt(4);
|
|
371
|
-
if (Yr(t, r, n), t =
|
|
371
|
+
if (Yr(t, r, n), t = m[r >> 2], n = m[n >> 2], r = Ie(t), pe(t), n) {
|
|
372
372
|
var i = Ie(n);
|
|
373
373
|
pe(n);
|
|
374
374
|
}
|
|
@@ -378,7 +378,7 @@ var Xr = Kr(), Zr = /* @__PURE__ */ qr(Xr), Qr = (a) => ({ avoidLib: void 0, asy
|
|
|
378
378
|
var t = typeof e;
|
|
379
379
|
return t === "object" || t === "array" || t === "function" ? e.toString() : "" + e;
|
|
380
380
|
}, St, ne = (e) => {
|
|
381
|
-
for (var t = "";
|
|
381
|
+
for (var t = ""; d[e]; ) t += St[d[e++]];
|
|
382
382
|
return t;
|
|
383
383
|
}, Ce = {}, _e = {}, je = {}, W = o.BindingError = class extends Error {
|
|
384
384
|
constructor(e) {
|
|
@@ -403,13 +403,13 @@ var Xr = Kr(), Zr = /* @__PURE__ */ qr(Xr), Qr = (a) => ({ avoidLib: void 0, asy
|
|
|
403
403
|
var kt = (e, t, r) => {
|
|
404
404
|
switch (t) {
|
|
405
405
|
case 1:
|
|
406
|
-
return r ? (n) =>
|
|
406
|
+
return r ? (n) => y[n] : (n) => d[n];
|
|
407
407
|
case 2:
|
|
408
|
-
return r ? (n) =>
|
|
408
|
+
return r ? (n) => x[n >> 1] : (n) => P[n >> 1];
|
|
409
409
|
case 4:
|
|
410
|
-
return r ? (n) =>
|
|
410
|
+
return r ? (n) => j[n >> 2] : (n) => m[n >> 2];
|
|
411
411
|
case 8:
|
|
412
|
-
return r ? (n) =>
|
|
412
|
+
return r ? (n) => k[n >> 3] : (n) => G[n >> 3];
|
|
413
413
|
default:
|
|
414
414
|
throw new TypeError(`invalid integer width (${t}): ${e}`);
|
|
415
415
|
}
|
|
@@ -471,12 +471,12 @@ Originally allocated`), "captureStackTrace" in Error && Error.captureStackTrace(
|
|
|
471
471
|
if (o.hasOwnProperty(e)) throw new W(`Cannot register public name '${e}' twice`);
|
|
472
472
|
o[e] = t, o[e].C = void 0;
|
|
473
473
|
}, yr = (e) => {
|
|
474
|
-
|
|
474
|
+
f(typeof e == "string"), e = e.replace(/[^a-zA-Z0-9_]/g, "$");
|
|
475
475
|
var t = e.charCodeAt(0);
|
|
476
476
|
return 48 <= t && 57 >= t ? `_${e}` : e;
|
|
477
477
|
};
|
|
478
|
-
function wr(e, t, r, n, i,
|
|
479
|
-
this.name = e, this.constructor = t, this.A = r, this.B = n, this.m = i, this.T =
|
|
478
|
+
function wr(e, t, r, n, i, h, g, p) {
|
|
479
|
+
this.name = e, this.constructor = t, this.A = r, this.B = n, this.m = i, this.T = h, this.H = g, this.R = p, this.Z = [];
|
|
480
480
|
}
|
|
481
481
|
var Be = (e, t, r) => {
|
|
482
482
|
for (; t !== r; ) {
|
|
@@ -540,16 +540,16 @@ Originally allocated`), "captureStackTrace" in Error && Error.captureStackTrace(
|
|
|
540
540
|
return Be(t.g.i, t.g.j.h, this.h);
|
|
541
541
|
}
|
|
542
542
|
function ze(e) {
|
|
543
|
-
return this.fromWireType(
|
|
543
|
+
return this.fromWireType(m[e >> 2]);
|
|
544
544
|
}
|
|
545
|
-
function Ve(e, t, r, n, i,
|
|
546
|
-
this.name = e, this.h = t, this.L = r, this.J = n, this.K = i, this.Y =
|
|
545
|
+
function Ve(e, t, r, n, i, h, g, p, O, $, E) {
|
|
546
|
+
this.name = e, this.h = t, this.L = r, this.J = n, this.K = i, this.Y = h, this.ba = g, this.O = p, this.$ = O, this.aa = $, this.B = E, i || t.m !== void 0 ? this.toWireType = br : (this.toWireType = n ? vr : _r, this.s = null);
|
|
547
547
|
}
|
|
548
548
|
var xr = (e, t) => {
|
|
549
549
|
if (!o.hasOwnProperty(e)) throw new We("Replacing nonexistent public symbol");
|
|
550
550
|
o[e] = t, o[e].C = void 0;
|
|
551
551
|
}, $t = [], fe = (e, t, r = !1) => {
|
|
552
|
-
if (
|
|
552
|
+
if (f(!r, "Async bindings are only supported with JSPI."), e = ne(e), (r = $t[t]) || ($t[t] = r = be.get(t)), f(be.get(t) == r, "JavaScript-side Wasm function table mirror is out of date!"), typeof r != "function") throw new W(`unknown function pointer with signature ${e}: ${t}`);
|
|
553
553
|
return r;
|
|
554
554
|
};
|
|
555
555
|
class Tr extends Error {
|
|
@@ -559,23 +559,23 @@ Originally allocated`), "captureStackTrace" in Error && Error.captureStackTrace(
|
|
|
559
559
|
var t = ne(e);
|
|
560
560
|
return pe(e), t;
|
|
561
561
|
}, Ae = (e, t) => {
|
|
562
|
-
function r(
|
|
563
|
-
i[
|
|
562
|
+
function r(h) {
|
|
563
|
+
i[h] || _e[h] || (je[h] ? je[h].forEach(r) : (n.push(h), i[h] = !0));
|
|
564
564
|
}
|
|
565
565
|
var n = [], i = {};
|
|
566
566
|
throw t.forEach(r), new Tr(`${e}: ` + n.map(Ft).join([", "]));
|
|
567
567
|
}, ge = (e, t, r) => {
|
|
568
568
|
function n(p) {
|
|
569
569
|
if (p = r(p), p.length !== e.length) throw new We("Mismatched type converter count");
|
|
570
|
-
for (var
|
|
570
|
+
for (var O = 0; O < e.length; ++O) ce(e[O], p[O]);
|
|
571
571
|
}
|
|
572
572
|
e.forEach((p) => je[p] = t);
|
|
573
|
-
var i = Array(t.length),
|
|
574
|
-
t.forEach((p,
|
|
575
|
-
_e.hasOwnProperty(p) ? i[
|
|
576
|
-
i[
|
|
573
|
+
var i = Array(t.length), h = [], g = 0;
|
|
574
|
+
t.forEach((p, O) => {
|
|
575
|
+
_e.hasOwnProperty(p) ? i[O] = _e[p] : (h.push(p), Ce.hasOwnProperty(p) || (Ce[p] = []), Ce[p].push(() => {
|
|
576
|
+
i[O] = _e[p], ++g, g === h.length && n(i);
|
|
577
577
|
}));
|
|
578
|
-
}),
|
|
578
|
+
}), h.length === 0 && n(i);
|
|
579
579
|
}, tt = (e) => {
|
|
580
580
|
for (; e.length; ) {
|
|
581
581
|
var t = e.pop();
|
|
@@ -589,29 +589,29 @@ Originally allocated`), "captureStackTrace" in Error && Error.captureStackTrace(
|
|
|
589
589
|
function Er(e, t, r, n, i) {
|
|
590
590
|
(e < t || e > r) && i(`function ${n} called with ${e} arguments, expected ${t == r ? t : `${t} to ${r}`}`);
|
|
591
591
|
}
|
|
592
|
-
function rt(e, t, r, n, i,
|
|
593
|
-
var
|
|
594
|
-
if (2 >
|
|
595
|
-
|
|
596
|
-
var p = t[1] !== null && r !== null,
|
|
592
|
+
function rt(e, t, r, n, i, h) {
|
|
593
|
+
var g = t.length;
|
|
594
|
+
if (2 > g) throw new W("argTypes array size mismatch! Must at least get return value and 'this' types!");
|
|
595
|
+
f(!h, "Async bindings are only supported with JSPI.");
|
|
596
|
+
var p = t[1] !== null && r !== null, O = Lt(t);
|
|
597
597
|
r = t[0].name !== "void";
|
|
598
|
-
for (var
|
|
599
|
-
for (n = [e, fr, n, i, tt, t[0], t[1]], i = 0; i <
|
|
600
|
-
if (!
|
|
601
|
-
for (n.push(Er, E,
|
|
598
|
+
for (var $ = g - 2, E = t.length - 2, B = t.length - 1; 2 <= B && t[B].optional; --B) E--;
|
|
599
|
+
for (n = [e, fr, n, i, tt, t[0], t[1]], i = 0; i < g - 2; ++i) n.push(t[i + 2]);
|
|
600
|
+
if (!O) for (i = p ? 1 : 2; i < t.length; ++i) t[i].s !== null && n.push(t[i].s);
|
|
601
|
+
for (n.push(Er, E, $), O = Lt(t), $ = t.length - 2, E = [], i = ["fn"], p && i.push("thisWired"), g = 0; g < $; ++g) E.push(`arg${g}`), i.push(`arg${g}Wired`);
|
|
602
602
|
E = E.join(","), i = i.join(","), E = `return function (${E}) {
|
|
603
603
|
checkArgCount(arguments.length, minArgs, maxArgs, humanName, throwBindingError);
|
|
604
|
-
`,
|
|
604
|
+
`, O && (E += `var destructors = [];
|
|
605
605
|
`);
|
|
606
|
-
var J =
|
|
606
|
+
var J = O ? "destructors" : "null";
|
|
607
607
|
for (B = "humanName throwBindingError invoker fn runDestructors retType classParam".split(" "), p && (E += `var thisWired = classParam['toWireType'](${J}, this);
|
|
608
|
-
`),
|
|
609
|
-
`, B.push(`argType${
|
|
610
|
-
if (E += (r ||
|
|
611
|
-
`,
|
|
608
|
+
`), g = 0; g < $; ++g) E += `var arg${g}Wired = argType${g}['toWireType'](${J}, arg${g});
|
|
609
|
+
`, B.push(`argType${g}`);
|
|
610
|
+
if (E += (r || h ? "var rv = " : "") + `invoker(${i});
|
|
611
|
+
`, O) E += `runDestructors(destructors);
|
|
612
612
|
`;
|
|
613
|
-
else for (
|
|
614
|
-
`, B.push(`${
|
|
613
|
+
else for (g = p ? 1 : 2; g < t.length; ++g) h = g === 1 ? "thisWired" : "arg" + (g - 2) + "Wired", t[g].s !== null && (E += `${h}_dtor(${h});
|
|
614
|
+
`, B.push(`${h}_dtor`));
|
|
615
615
|
r && (E += `var ret = retType['fromWireType'](rv);
|
|
616
616
|
return ret;
|
|
617
617
|
`), E += `}
|
|
@@ -621,22 +621,22 @@ ${E}`;
|
|
|
621
621
|
return t = new Function(...Y, q)(...n), He(e, t);
|
|
622
622
|
}
|
|
623
623
|
for (var nt = (e, t) => {
|
|
624
|
-
for (var r = [], n = 0; n < e; n++) r.push(
|
|
624
|
+
for (var r = [], n = 0; n < e; n++) r.push(m[t + 4 * n >> 2]);
|
|
625
625
|
return r;
|
|
626
626
|
}, Nt = (e) => {
|
|
627
627
|
e = e.trim();
|
|
628
628
|
let t = e.indexOf("(");
|
|
629
|
-
return t === -1 ? e : (
|
|
629
|
+
return t === -1 ? e : (f(e.endsWith(")"), "Parentheses for argument names should match."), e.slice(0, t));
|
|
630
630
|
}, Ut = (e, t, r) => {
|
|
631
631
|
if (!(e instanceof Object)) throw new W(`${r} with invalid "this": ${e}`);
|
|
632
632
|
if (!(e instanceof t.h.constructor)) throw new W(`${r} incompatible with "this" of type ${e.constructor.name}`);
|
|
633
633
|
if (!e.g.i) throw new W(`cannot call emscripten binding method ${r} on deleted object`);
|
|
634
634
|
return Be(e.g.i, e.g.j.h, t.h);
|
|
635
635
|
}, it = [], ue = [], ot = (e) => {
|
|
636
|
-
9 < e && --ue[e + 1] === 0 && (
|
|
636
|
+
9 < e && --ue[e + 1] === 0 && (f(ue[e] !== void 0, "Decref for unallocated handle."), ue[e] = void 0, it.push(e));
|
|
637
637
|
}, at = (e) => {
|
|
638
638
|
if (!e) throw new W(`Cannot use deleted val. handle = ${e}`);
|
|
639
|
-
return
|
|
639
|
+
return f(e === 2 || ue[e] !== void 0 && e % 2 === 0, `invalid handle: ${e}`), ue[e];
|
|
640
640
|
}, Je = (e) => {
|
|
641
641
|
switch (e) {
|
|
642
642
|
case void 0:
|
|
@@ -658,21 +658,21 @@ ${E}`;
|
|
|
658
658
|
switch (t) {
|
|
659
659
|
case 1:
|
|
660
660
|
return r ? function(n) {
|
|
661
|
-
return this.fromWireType(
|
|
661
|
+
return this.fromWireType(y[n]);
|
|
662
662
|
} : function(n) {
|
|
663
|
-
return this.fromWireType(
|
|
663
|
+
return this.fromWireType(d[n]);
|
|
664
664
|
};
|
|
665
665
|
case 2:
|
|
666
666
|
return r ? function(n) {
|
|
667
|
-
return this.fromWireType(
|
|
667
|
+
return this.fromWireType(x[n >> 1]);
|
|
668
668
|
} : function(n) {
|
|
669
|
-
return this.fromWireType(
|
|
669
|
+
return this.fromWireType(P[n >> 1]);
|
|
670
670
|
};
|
|
671
671
|
case 4:
|
|
672
672
|
return r ? function(n) {
|
|
673
|
-
return this.fromWireType(
|
|
673
|
+
return this.fromWireType(j[n >> 2]);
|
|
674
674
|
} : function(n) {
|
|
675
|
-
return this.fromWireType(
|
|
675
|
+
return this.fromWireType(m[n >> 2]);
|
|
676
676
|
};
|
|
677
677
|
default:
|
|
678
678
|
throw new TypeError(`invalid integer width (${t}): ${e}`);
|
|
@@ -689,41 +689,41 @@ ${E}`;
|
|
|
689
689
|
};
|
|
690
690
|
case 8:
|
|
691
691
|
return function(r) {
|
|
692
|
-
return this.fromWireType(
|
|
692
|
+
return this.fromWireType(T[r >> 3]);
|
|
693
693
|
};
|
|
694
694
|
default:
|
|
695
695
|
throw new TypeError(`invalid float width (${t}): ${e}`);
|
|
696
696
|
}
|
|
697
697
|
}, kr = Object.assign({ optional: !0 }, jt), Pe = (e, t, r) => {
|
|
698
|
-
|
|
699
|
-
var n =
|
|
700
|
-
if (
|
|
698
|
+
f(typeof r == "number", "stringToUTF8(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!");
|
|
699
|
+
var n = d;
|
|
700
|
+
if (f(typeof e == "string", `stringToUTF8Array expects a string (got ${typeof e})`), 0 < r) {
|
|
701
701
|
var i = t;
|
|
702
702
|
r = t + r - 1;
|
|
703
|
-
for (var
|
|
704
|
-
var
|
|
705
|
-
if (55296 <=
|
|
706
|
-
var p = e.charCodeAt(++
|
|
707
|
-
|
|
703
|
+
for (var h = 0; h < e.length; ++h) {
|
|
704
|
+
var g = e.charCodeAt(h);
|
|
705
|
+
if (55296 <= g && 57343 >= g) {
|
|
706
|
+
var p = e.charCodeAt(++h);
|
|
707
|
+
g = 65536 + ((g & 1023) << 10) | p & 1023;
|
|
708
708
|
}
|
|
709
|
-
if (127 >=
|
|
709
|
+
if (127 >= g) {
|
|
710
710
|
if (t >= r) break;
|
|
711
|
-
n[t++] =
|
|
711
|
+
n[t++] = g;
|
|
712
712
|
} else {
|
|
713
|
-
if (2047 >=
|
|
713
|
+
if (2047 >= g) {
|
|
714
714
|
if (t + 1 >= r) break;
|
|
715
|
-
n[t++] = 192 |
|
|
715
|
+
n[t++] = 192 | g >> 6;
|
|
716
716
|
} else {
|
|
717
|
-
if (65535 >=
|
|
717
|
+
if (65535 >= g) {
|
|
718
718
|
if (t + 2 >= r) break;
|
|
719
|
-
n[t++] = 224 |
|
|
719
|
+
n[t++] = 224 | g >> 12;
|
|
720
720
|
} else {
|
|
721
721
|
if (t + 3 >= r) break;
|
|
722
|
-
1114111 <
|
|
722
|
+
1114111 < g && me("Invalid Unicode code point " + ke(g) + " encountered when serializing a JS string to a UTF-8 string in wasm memory! (Valid unicode code points should be in range 0-0x10FFFF)."), n[t++] = 240 | g >> 18, n[t++] = 128 | g >> 12 & 63;
|
|
723
723
|
}
|
|
724
|
-
n[t++] = 128 |
|
|
724
|
+
n[t++] = 128 | g >> 6 & 63;
|
|
725
725
|
}
|
|
726
|
-
n[t++] = 128 |
|
|
726
|
+
n[t++] = 128 | g & 63;
|
|
727
727
|
}
|
|
728
728
|
}
|
|
729
729
|
n[t] = 0, e = t - i;
|
|
@@ -736,43 +736,43 @@ ${E}`;
|
|
|
736
736
|
}
|
|
737
737
|
return t;
|
|
738
738
|
}, Wt = typeof TextDecoder < "u" ? new TextDecoder("utf-16le") : void 0, Ir = (e, t) => {
|
|
739
|
-
|
|
740
|
-
for (var r = e >> 1, n = r + t / 2; !(r >= n) &&
|
|
741
|
-
if (r <<= 1, 32 < r - e && Wt) return Wt.decode(
|
|
739
|
+
f(e % 2 == 0, "Pointer passed to UTF16ToString must be aligned to two bytes!");
|
|
740
|
+
for (var r = e >> 1, n = r + t / 2; !(r >= n) && P[r]; ) ++r;
|
|
741
|
+
if (r <<= 1, 32 < r - e && Wt) return Wt.decode(d.subarray(e, r));
|
|
742
742
|
for (r = "", n = 0; !(n >= t / 2); ++n) {
|
|
743
|
-
var i =
|
|
743
|
+
var i = x[e + 2 * n >> 1];
|
|
744
744
|
if (i == 0) break;
|
|
745
745
|
r += String.fromCharCode(i);
|
|
746
746
|
}
|
|
747
747
|
return r;
|
|
748
748
|
}, Cr = (e, t, r) => {
|
|
749
|
-
if (
|
|
749
|
+
if (f(t % 2 == 0, "Pointer passed to stringToUTF16 must be aligned to two bytes!"), f(typeof r == "number", "stringToUTF16(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"), r ??= 2147483647, 2 > r) return 0;
|
|
750
750
|
r -= 2;
|
|
751
751
|
var n = t;
|
|
752
752
|
r = r < 2 * e.length ? r / 2 : e.length;
|
|
753
|
-
for (var i = 0; i < r; ++i)
|
|
754
|
-
return
|
|
753
|
+
for (var i = 0; i < r; ++i) x[t >> 1] = e.charCodeAt(i), t += 2;
|
|
754
|
+
return x[t >> 1] = 0, t - n;
|
|
755
755
|
}, Ar = (e) => 2 * e.length, Pr = (e, t) => {
|
|
756
|
-
|
|
756
|
+
f(e % 4 == 0, "Pointer passed to UTF32ToString must be aligned to four bytes!");
|
|
757
757
|
for (var r = 0, n = ""; !(r >= t / 4); ) {
|
|
758
|
-
var i =
|
|
758
|
+
var i = j[e + 4 * r >> 2];
|
|
759
759
|
if (i == 0) break;
|
|
760
760
|
++r, 65536 <= i ? (i -= 65536, n += String.fromCharCode(55296 | i >> 10, 56320 | i & 1023)) : n += String.fromCharCode(i);
|
|
761
761
|
}
|
|
762
762
|
return n;
|
|
763
763
|
}, Or = (e, t, r) => {
|
|
764
|
-
if (
|
|
764
|
+
if (f(t % 4 == 0, "Pointer passed to stringToUTF32 must be aligned to four bytes!"), f(typeof r == "number", "stringToUTF32(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"), r ??= 2147483647, 4 > r) return 0;
|
|
765
765
|
var n = t;
|
|
766
766
|
r = n + r - 4;
|
|
767
767
|
for (var i = 0; i < e.length; ++i) {
|
|
768
|
-
var
|
|
769
|
-
if (55296 <=
|
|
770
|
-
var
|
|
771
|
-
|
|
768
|
+
var h = e.charCodeAt(i);
|
|
769
|
+
if (55296 <= h && 57343 >= h) {
|
|
770
|
+
var g = e.charCodeAt(++i);
|
|
771
|
+
h = 65536 + ((h & 1023) << 10) | g & 1023;
|
|
772
772
|
}
|
|
773
|
-
if (
|
|
773
|
+
if (j[t >> 2] = h, t += 4, t + 4 > r) break;
|
|
774
774
|
}
|
|
775
|
-
return
|
|
775
|
+
return j[t >> 2] = 0, t - n;
|
|
776
776
|
}, Rr = (e) => {
|
|
777
777
|
for (var t = 0, r = 0; r < e.length; ++r) {
|
|
778
778
|
var n = e.charCodeAt(r);
|
|
@@ -783,22 +783,22 @@ ${E}`;
|
|
|
783
783
|
var t = ct.length;
|
|
784
784
|
return ct.push(e), t;
|
|
785
785
|
}, Fr = (e, t) => {
|
|
786
|
-
for (var r = Array(e), n = 0; n < e; ++n) r[n] = st(
|
|
786
|
+
for (var r = Array(e), n = 0; n < e; ++n) r[n] = st(m[t + 4 * n >> 2], `parameter ${n}`);
|
|
787
787
|
return r;
|
|
788
788
|
}, Lr = (e, t, r) => {
|
|
789
789
|
var n = [];
|
|
790
|
-
return e = e.toWireType(n, r), n.length && (
|
|
790
|
+
return e = e.toWireType(n, r), n.length && (m[t >> 2] = Je(n)), e;
|
|
791
791
|
}, Re = {}, Dt = (e) => {
|
|
792
|
-
if (!(e instanceof vt || e == "unwind")) throw D(), e instanceof WebAssembly.RuntimeError && 0 >= qt() &&
|
|
792
|
+
if (!(e instanceof vt || e == "unwind")) throw D(), e instanceof WebAssembly.RuntimeError && 0 >= qt() && S("Stack overflow detected. You can try increasing -sSTACK_SIZE (currently set to 65536)"), e;
|
|
793
793
|
}, Gt = (e) => {
|
|
794
|
-
throw
|
|
794
|
+
throw I = e, Se || 0 < Oe || (o.onExit?.(e), v = !0), new vt(e);
|
|
795
795
|
}, Nr = (e) => {
|
|
796
|
-
if (
|
|
796
|
+
if (L || v) S("user callback triggered after runtime exited or application aborted. Ignoring.");
|
|
797
797
|
else try {
|
|
798
|
-
if (e(), !(
|
|
799
|
-
if (
|
|
798
|
+
if (e(), !(L || Se || 0 < Oe)) try {
|
|
799
|
+
if (I = e = I, Se || 0 < Oe || (f(!L), D(), Wr(), jr(0), dt[1].length && ht(1, 10), dt[2].length && ht(2, 10), L = !0), Se || 0 < Oe) {
|
|
800
800
|
var t = `program exited (with status: ${e}), but keepRuntimeAlive() is set (counter=${Oe}) due to an async operation, so halting execution but not exiting the runtime or preventing further async execution (you can use emscripten_force_exit, if you want to force a true shutdown)`;
|
|
801
|
-
|
|
801
|
+
C(t), S(t);
|
|
802
802
|
}
|
|
803
803
|
Gt(e);
|
|
804
804
|
} catch (r) {
|
|
@@ -809,7 +809,7 @@ ${E}`;
|
|
|
809
809
|
}
|
|
810
810
|
}, ut = {}, Ht = () => {
|
|
811
811
|
if (!lt) {
|
|
812
|
-
var e = { USER: "web_user", LOGNAME: "web_user", PATH: "/", PWD: "/", HOME: "/home/web_user", LANG: (typeof navigator == "object" && navigator.languages && navigator.languages[0] || "C").replace("-", "_") + ".UTF-8", _:
|
|
812
|
+
var e = { USER: "web_user", LOGNAME: "web_user", PATH: "/", PWD: "/", HOME: "/home/web_user", LANG: (typeof navigator == "object" && navigator.languages && navigator.languages[0] || "C").replace("-", "_") + ".UTF-8", _: R || "./this.program" }, t;
|
|
813
813
|
for (t in ut) ut[t] === void 0 ? delete e[t] : e[t] = ut[t];
|
|
814
814
|
var r = [];
|
|
815
815
|
for (t in e) r.push(`${t}=${e[t]}`);
|
|
@@ -818,7 +818,7 @@ ${E}`;
|
|
|
818
818
|
return lt;
|
|
819
819
|
}, lt, dt = [null, [], []], ht = (e, t) => {
|
|
820
820
|
var r = dt[e];
|
|
821
|
-
|
|
821
|
+
f(r), t === 0 || t === 10 ? ((e === 1 ? l : S)(Et(r)), r.length = 0) : r.push(t);
|
|
822
822
|
}, Bt = Array(256), qe = 0; 256 > qe; ++qe) Bt[qe] = String.fromCharCode(qe);
|
|
823
823
|
St = Bt, (() => {
|
|
824
824
|
let e = Ge.prototype;
|
|
@@ -826,14 +826,14 @@ ${E}`;
|
|
|
826
826
|
if (!(this instanceof Ge && r instanceof Ge)) return !1;
|
|
827
827
|
var n = this.g.j.h, i = this.g.i;
|
|
828
828
|
r.g = r.g;
|
|
829
|
-
var
|
|
829
|
+
var h = r.g.j.h;
|
|
830
830
|
for (r = r.g.i; n.m; ) i = n.H(i), n = n.m;
|
|
831
|
-
for (;
|
|
832
|
-
return n ===
|
|
831
|
+
for (; h.m; ) r = h.H(r), h = h.m;
|
|
832
|
+
return n === h && i === r;
|
|
833
833
|
}, clone: function() {
|
|
834
834
|
if (this.g.i || Qe(this), this.g.G) return this.g.count.value += 1, this;
|
|
835
|
-
var r = Ne, n = Object, i = n.create,
|
|
836
|
-
return r = r(i.call(n,
|
|
835
|
+
var r = Ne, n = Object, i = n.create, h = Object.getPrototypeOf(this), g = this.g;
|
|
836
|
+
return r = r(i.call(n, h, { g: { value: { count: g.count, F: g.F, G: g.G, i: g.i, j: g.j, l: g.l, v: g.v } } })), r.g.count.value += 1, r.g.F = !1, r;
|
|
837
837
|
}, delete() {
|
|
838
838
|
if (this.g.i || Qe(this), this.g.F && !this.g.G) throw new W("Object already scheduled for deletion");
|
|
839
839
|
It(this);
|
|
@@ -851,11 +851,11 @@ ${E}`;
|
|
|
851
851
|
return this.O && (e = this.O(e)), e;
|
|
852
852
|
}, N(e) {
|
|
853
853
|
this.B?.(e);
|
|
854
|
-
}, o: 8, readValueFromPointer: ze, fromWireType: Pt }), ue.push(0, 1, void 0, 1, null, 1, !0, 1, !1, 1),
|
|
854
|
+
}, o: 8, readValueFromPointer: ze, fromWireType: Pt }), ue.push(0, 1, void 0, 1, null, 1, !0, 1, !1, 1), f(ue.length === 10), o.count_emval_handles = () => ue.length / 2 - 5 - it.length, o.noExitRuntime && (Se = o.noExitRuntime), o.print && (l = o.print), o.printErr && (S = o.printErr), o.wasmBinary && (w = o.wasmBinary), o.FS_createDataFile = function() {
|
|
855
855
|
re();
|
|
856
856
|
}, o.FS_createPreloadedFile = function() {
|
|
857
857
|
re();
|
|
858
|
-
}, Object.getOwnPropertyDescriptor(o, "fetchSettings") && X("`Module.fetchSettings` was supplied but `fetchSettings` not included in INCOMING_MODULE_JS_API"), o.thisProgram && (
|
|
858
|
+
}, Object.getOwnPropertyDescriptor(o, "fetchSettings") && X("`Module.fetchSettings` was supplied but `fetchSettings` not included in INCOMING_MODULE_JS_API"), o.thisProgram && (R = o.thisProgram), f(typeof o.memoryInitializerPrefixURL > "u", "Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead"), f(typeof o.pthreadMainPrefixURL > "u", "Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead"), f(typeof o.cdInitializerPrefixURL > "u", "Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead"), f(typeof o.filePackagePrefixURL > "u", "Module.filePackagePrefixURL option was removed, use Module.locateFile instead"), f(typeof o.read > "u", "Module.read option was removed"), f(typeof o.readAsync > "u", "Module.readAsync option was removed (modify readAsync in JS)"), f(typeof o.readBinary > "u", "Module.readBinary option was removed (modify readBinary in JS)"), f(typeof o.setWindowTitle > "u", "Module.setWindowTitle option was removed (modify emscripten_set_window_title in JS)"), f(typeof o.TOTAL_MEMORY > "u", "Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY"), f(typeof o.ENVIRONMENT > "u", "Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -sENVIRONMENT=web or -sENVIRONMENT=node)"), f(typeof o.STACK_SIZE > "u", "STACK_SIZE can no longer be set at runtime. Use -sSTACK_SIZE at link time"), f(typeof o.wasmMemory > "u", "Use of `wasmMemory` detected. Use -sIMPORTED_MEMORY to define wasmMemory externally"), f(typeof o.INITIAL_MEMORY > "u", "Detected runtime INITIAL_MEMORY setting. Use -sIMPORTED_MEMORY to define wasmMemory dynamically"), "writeI53ToI64 writeI53ToI64Clamped writeI53ToI64Signaling writeI53ToU64Clamped writeI53ToU64Signaling readI53FromI64 readI53FromU64 convertI32PairToI53 convertI32PairToI53Checked convertU32PairToI53 getTempRet0 setTempRet0 zeroMemory strError inetPton4 inetNtop4 inetPton6 inetNtop6 readSockaddr writeSockaddr emscriptenLog readEmAsmArgs jstoi_q listenOnce autoResumeAudioContext getDynCaller dynCall runtimeKeepalivePush runtimeKeepalivePop asmjsMangle asyncLoad mmapAlloc HandleAllocator getNativeTypeSize addOnInit addOnPostCtor addOnPreMain addOnExit STACK_SIZE STACK_ALIGN POINTER_SIZE ASSERTIONS getCFunc ccall cwrap uleb128Encode sigToWasmTypes generateFuncType convertJsFunctionToWasm getEmptyTableSlot updateTableMap getFunctionAddress addFunction removeFunction reallyNegative unSign strLen reSign formatString intArrayFromString intArrayToString AsciiToString stringToAscii stringToNewUTF8 stringToUTF8OnStack writeArrayToMemory registerKeyEventCallback maybeCStringToJsString findEventTarget getBoundingClientRect fillMouseEventData registerMouseEventCallback registerWheelEventCallback registerUiEventCallback registerFocusEventCallback fillDeviceOrientationEventData registerDeviceOrientationEventCallback fillDeviceMotionEventData registerDeviceMotionEventCallback screenOrientation fillOrientationChangeEventData registerOrientationChangeEventCallback fillFullscreenChangeEventData registerFullscreenChangeEventCallback JSEvents_requestFullscreen JSEvents_resizeCanvasForFullscreen registerRestoreOldStyle hideEverythingExceptGivenElement restoreHiddenElements setLetterbox softFullscreenResizeWebGLRenderTarget doRequestFullscreen fillPointerlockChangeEventData registerPointerlockChangeEventCallback registerPointerlockErrorEventCallback requestPointerLock fillVisibilityChangeEventData registerVisibilityChangeEventCallback registerTouchEventCallback fillGamepadEventData registerGamepadEventCallback registerBeforeUnloadEventCallback fillBatteryEventData battery registerBatteryEventCallback setCanvasElementSize getCanvasElementSize jsStackTrace getCallstack convertPCtoSourceLocation wasiRightsToMuslOFlags wasiOFlagsToMuslOFlags initRandomFill randomFill safeSetTimeout setImmediateWrapped safeRequestAnimationFrame clearImmediateWrapped registerPostMainLoop registerPreMainLoop getPromise makePromise idsToPromises makePromiseCallback Browser_asyncPrepareDataCounter isLeapYear ydayFromDate arraySum addDays getSocketFromFD getSocketAddress heapObjectForWebGLType toTypedArrayIndex webgl_enable_ANGLE_instanced_arrays webgl_enable_OES_vertex_array_object webgl_enable_WEBGL_draw_buffers webgl_enable_WEBGL_multi_draw webgl_enable_EXT_polygon_offset_clamp webgl_enable_EXT_clip_control webgl_enable_WEBGL_polygon_mode emscriptenWebGLGet computeUnpackAlignedImageSize colorChannelsInGlTextureFormat emscriptenWebGLGetTexPixelData emscriptenWebGLGetUniform webglGetUniformLocation webglPrepareUniformLocationsBeforeFirstUse webglGetLeftBracePos emscriptenWebGLGetVertexAttrib __glGetActiveAttribOrUniform writeGLArray registerWebGlEventCallback runAndAbortIfError ALLOC_NORMAL ALLOC_STACK allocate writeStringToMemory writeAsciiToMemory demangle stackTrace getFunctionArgsName createJsInvokerSignature PureVirtualError registerInheritedInstance unregisterInheritedInstance getInheritedInstanceCount getLiveInheritedInstances setDelayFunction getStringOrSymbol emval_get_global".split(" ").forEach(function(e) {
|
|
859
859
|
Fe(e, () => {
|
|
860
860
|
var t = `\`${e}\` is a library symbol and not included by default; add it to your library.js __deps or to DEFAULT_LIBRARY_FUNCS_TO_INCLUDE on the command line`, r = e;
|
|
861
861
|
r.startsWith("_") || (r = "$" + e), t += ` (e.g. -sDEFAULT_LIBRARY_FUNCS_TO_INCLUDE='${r}')`, $e(e) && (t += ". Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you"), me(t);
|
|
@@ -869,22 +869,22 @@ ${E}`;
|
|
|
869
869
|
throw e = new WebAssembly.Exception(ie.__cpp_exception, [e], { traceStack: !0 }), e.message = Mt(e), e;
|
|
870
870
|
}, _abort_js: () => X("native code called abort()"), _embind_register_bigint: (e, t, r, n, i) => {
|
|
871
871
|
t = ne(t);
|
|
872
|
-
var
|
|
873
|
-
|
|
872
|
+
var h = t.indexOf("u") != -1;
|
|
873
|
+
h && (i = (1n << 64n) - 1n), ce(e, { name: t, fromWireType: (g) => g, toWireType: function(g, p) {
|
|
874
874
|
if (typeof p != "bigint" && typeof p != "number") throw new TypeError(`Cannot convert "${ye(p)}" to ${this.name}`);
|
|
875
875
|
if (typeof p == "number" && (p = BigInt(p)), p < n || p > i) throw new TypeError(`Passing a number "${ye(p)}" from JS side to C/C++ side to an argument of type "${t}", which is outside the valid range [${n}, ${i}]!`);
|
|
876
876
|
return p;
|
|
877
|
-
}, o: 8, readValueFromPointer: kt(t, r, !
|
|
877
|
+
}, o: 8, readValueFromPointer: kt(t, r, !h), s: null });
|
|
878
878
|
}, _embind_register_bool: (e, t, r, n) => {
|
|
879
879
|
t = ne(t), ce(e, { name: t, fromWireType: function(i) {
|
|
880
880
|
return !!i;
|
|
881
|
-
}, toWireType: function(i,
|
|
882
|
-
return
|
|
881
|
+
}, toWireType: function(i, h) {
|
|
882
|
+
return h ? r : n;
|
|
883
883
|
}, o: 8, readValueFromPointer: function(i) {
|
|
884
|
-
return this.fromWireType(
|
|
884
|
+
return this.fromWireType(d[i]);
|
|
885
885
|
}, s: null });
|
|
886
|
-
}, _embind_register_class: (e, t, r, n, i,
|
|
887
|
-
E = ne(E),
|
|
886
|
+
}, _embind_register_class: (e, t, r, n, i, h, g, p, O, $, E, B, J) => {
|
|
887
|
+
E = ne(E), h = fe(i, h), p &&= fe(g, p), $ &&= fe(O, $), J = fe(B, J);
|
|
888
888
|
var Y = yr(E);
|
|
889
889
|
Rt(Y, function() {
|
|
890
890
|
Ae(`Cannot construct ${E} due to unbound types`, [n]);
|
|
@@ -900,70 +900,70 @@ ${E}`;
|
|
|
900
900
|
});
|
|
901
901
|
var Te = Object.create(xe, { constructor: { value: q } });
|
|
902
902
|
q.prototype = Te;
|
|
903
|
-
var le = new wr(E, q, Te, J, ae,
|
|
903
|
+
var le = new wr(E, q, Te, J, ae, h, p, $);
|
|
904
904
|
if (le.m) {
|
|
905
905
|
var we;
|
|
906
906
|
(we = le.m).I ?? (we.I = []), le.m.I.push(le);
|
|
907
907
|
}
|
|
908
908
|
return ae = new Ve(E, le, !0, !1, !1), we = new Ve(E + "*", le, !1, !1, !1), xe = new Ve(E + " const*", le, !1, !0, !1), At[e] = { pointerType: we, P: xe }, xr(Y, q), [ae, we, xe];
|
|
909
909
|
});
|
|
910
|
-
}, _embind_register_class_class_function: (e, t, r, n, i,
|
|
911
|
-
var
|
|
912
|
-
t = ne(t), t = Nt(t),
|
|
910
|
+
}, _embind_register_class_class_function: (e, t, r, n, i, h, g, p) => {
|
|
911
|
+
var O = nt(r, n);
|
|
912
|
+
t = ne(t), t = Nt(t), h = fe(i, h, p), ge([], [e], ($) => {
|
|
913
913
|
function E() {
|
|
914
|
-
Ae(`Cannot call ${B} due to unbound types`,
|
|
914
|
+
Ae(`Cannot call ${B} due to unbound types`, O);
|
|
915
915
|
}
|
|
916
|
-
|
|
917
|
-
var B = `${
|
|
916
|
+
$ = $[0];
|
|
917
|
+
var B = `${$.name}.${t}`;
|
|
918
918
|
t.startsWith("@@") && (t = Symbol[t.substring(2)]);
|
|
919
|
-
var J =
|
|
920
|
-
return J[t] === void 0 ? (E.C = r - 1, J[t] = E) : (Ot(J, t, B), J[t].u[r - 1] = E), ge([],
|
|
921
|
-
if (Y = rt(B, [Y[0], null].concat(Y.slice(1)), null,
|
|
919
|
+
var J = $.h.constructor;
|
|
920
|
+
return J[t] === void 0 ? (E.C = r - 1, J[t] = E) : (Ot(J, t, B), J[t].u[r - 1] = E), ge([], O, (Y) => {
|
|
921
|
+
if (Y = rt(B, [Y[0], null].concat(Y.slice(1)), null, h, g, p), J[t].u === void 0 ? (Y.C = r - 1, J[t] = Y) : J[t].u[r - 1] = Y, $.h.I) for (let q of $.h.I) q.constructor.hasOwnProperty(t) || (q.constructor[t] = Y);
|
|
922
922
|
return [];
|
|
923
923
|
}), [];
|
|
924
924
|
});
|
|
925
|
-
}, _embind_register_class_constructor: (e, t, r, n, i,
|
|
926
|
-
|
|
927
|
-
var
|
|
925
|
+
}, _embind_register_class_constructor: (e, t, r, n, i, h) => {
|
|
926
|
+
f(0 < t);
|
|
927
|
+
var g = nt(t, r);
|
|
928
928
|
i = fe(n, i), ge([], [e], (p) => {
|
|
929
929
|
p = p[0];
|
|
930
|
-
var
|
|
930
|
+
var O = `constructor ${p.name}`;
|
|
931
931
|
if (p.h.D === void 0 && (p.h.D = []), p.h.D[t - 1] !== void 0) throw new W(`Cannot register multiple constructors with identical number of parameters (${t - 1}) for class '${p.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);
|
|
932
932
|
return p.h.D[t - 1] = () => {
|
|
933
|
-
Ae(`Cannot construct ${p.name} due to unbound types`,
|
|
934
|
-
}, ge([],
|
|
933
|
+
Ae(`Cannot construct ${p.name} due to unbound types`, g);
|
|
934
|
+
}, ge([], g, ($) => ($.splice(1, 0, null), p.h.D[t - 1] = rt(O, $, null, i, h), [])), [];
|
|
935
935
|
});
|
|
936
|
-
}, _embind_register_class_function: (e, t, r, n, i,
|
|
937
|
-
var
|
|
938
|
-
t = ne(t), t = Nt(t),
|
|
936
|
+
}, _embind_register_class_function: (e, t, r, n, i, h, g, p, O) => {
|
|
937
|
+
var $ = nt(r, n);
|
|
938
|
+
t = ne(t), t = Nt(t), h = fe(i, h, O), ge([], [e], (E) => {
|
|
939
939
|
function B() {
|
|
940
|
-
Ae(`Cannot call ${J} due to unbound types`,
|
|
940
|
+
Ae(`Cannot call ${J} due to unbound types`, $);
|
|
941
941
|
}
|
|
942
942
|
E = E[0];
|
|
943
943
|
var J = `${E.name}.${t}`;
|
|
944
944
|
t.startsWith("@@") && (t = Symbol[t.substring(2)]), p && E.h.Z.push(t);
|
|
945
945
|
var Y = E.h.A, q = Y[t];
|
|
946
|
-
return q === void 0 || q.u === void 0 && q.className !== E.name && q.C === r - 2 ? (B.C = r - 2, B.className = E.name, Y[t] = B) : (Ot(Y, t, J), Y[t].u[r - 2] = B), ge([],
|
|
946
|
+
return q === void 0 || q.u === void 0 && q.className !== E.name && q.C === r - 2 ? (B.C = r - 2, B.className = E.name, Y[t] = B) : (Ot(Y, t, J), Y[t].u[r - 2] = B), ge([], $, (ae) => (ae = rt(J, ae, E, h, g, O), Y[t].u === void 0 ? (ae.C = r - 2, Y[t] = ae) : Y[t].u[r - 2] = ae, [])), [];
|
|
947
947
|
});
|
|
948
|
-
}, _embind_register_class_property: (e, t, r, n, i,
|
|
948
|
+
}, _embind_register_class_property: (e, t, r, n, i, h, g, p, O, $) => {
|
|
949
949
|
t = ne(t), i = fe(n, i), ge([], [e], (E) => {
|
|
950
950
|
E = E[0];
|
|
951
951
|
var B = `${E.name}.${t}`, J = { get() {
|
|
952
|
-
Ae(`Cannot access ${B} due to unbound types`, [r,
|
|
952
|
+
Ae(`Cannot access ${B} due to unbound types`, [r, g]);
|
|
953
953
|
}, enumerable: !0, configurable: !0 };
|
|
954
|
-
return J.set =
|
|
954
|
+
return J.set = O ? () => Ae(`Cannot access ${B} due to unbound types`, [r, g]) : () => {
|
|
955
955
|
throw new W(B + " is a read-only property");
|
|
956
|
-
}, Object.defineProperty(E.h.A, t, J), ge([],
|
|
956
|
+
}, Object.defineProperty(E.h.A, t, J), ge([], O ? [r, g] : [r], (Y) => {
|
|
957
957
|
var q = Y[0], ae = { get() {
|
|
958
958
|
var Te = Ut(this, E, B + " getter");
|
|
959
|
-
return q.fromWireType(i(
|
|
959
|
+
return q.fromWireType(i(h, Te));
|
|
960
960
|
}, enumerable: !0 };
|
|
961
|
-
if (
|
|
962
|
-
|
|
961
|
+
if (O) {
|
|
962
|
+
O = fe(p, O);
|
|
963
963
|
var xe = Y[1];
|
|
964
964
|
ae.set = function(Te) {
|
|
965
965
|
var le = Ut(this, E, B + " setter"), we = [];
|
|
966
|
-
|
|
966
|
+
O($, le, xe.toWireType(we, Te)), tt(we);
|
|
967
967
|
};
|
|
968
968
|
}
|
|
969
969
|
return Object.defineProperty(E.h.A, t, ae), [];
|
|
@@ -972,9 +972,9 @@ ${E}`;
|
|
|
972
972
|
}, _embind_register_emval: (e) => ce(e, jt), _embind_register_enum: (e, t, r, n) => {
|
|
973
973
|
function i() {
|
|
974
974
|
}
|
|
975
|
-
t = ne(t), i.values = {}, ce(e, { name: t, constructor: i, fromWireType: function(
|
|
976
|
-
return this.constructor.values[
|
|
977
|
-
}, toWireType: (
|
|
975
|
+
t = ne(t), i.values = {}, ce(e, { name: t, constructor: i, fromWireType: function(h) {
|
|
976
|
+
return this.constructor.values[h];
|
|
977
|
+
}, toWireType: (h, g) => g.value, o: 8, readValueFromPointer: Mr(t, r, n), s: null }), Rt(t, i);
|
|
978
978
|
}, _embind_register_enum_value: (e, t, r) => {
|
|
979
979
|
var n = st(e, "enum");
|
|
980
980
|
t = ne(t), e = n.constructor, n = Object.create(n.constructor.prototype, { value: { value: r }, constructor: { value: He(`${n.name}_${t}`, function() {
|
|
@@ -986,23 +986,23 @@ ${E}`;
|
|
|
986
986
|
}, o: 8, readValueFromPointer: Sr(t, r), s: null });
|
|
987
987
|
}, _embind_register_integer: (e, t, r, n, i) => {
|
|
988
988
|
t = ne(t), i === -1 && (i = 4294967295);
|
|
989
|
-
var
|
|
989
|
+
var h = ($) => $;
|
|
990
990
|
if (n === 0) {
|
|
991
|
-
var
|
|
992
|
-
|
|
991
|
+
var g = 32 - 8 * r;
|
|
992
|
+
h = ($) => $ << g >>> g;
|
|
993
993
|
}
|
|
994
|
-
var p = (
|
|
995
|
-
if (typeof
|
|
996
|
-
if (
|
|
997
|
-
},
|
|
994
|
+
var p = ($, E) => {
|
|
995
|
+
if (typeof $ != "number" && typeof $ != "boolean") throw new TypeError(`Cannot convert "${ye($)}" to ${E}`);
|
|
996
|
+
if ($ < n || $ > i) throw new TypeError(`Passing a number "${ye($)}" from JS side to C/C++ side to an argument of type "${t}", which is outside the valid range [${n}, ${i}]!`);
|
|
997
|
+
}, O = t.includes("unsigned") ? function($, E) {
|
|
998
998
|
return p(E, this.name), E >>> 0;
|
|
999
|
-
} : function(
|
|
999
|
+
} : function($, E) {
|
|
1000
1000
|
return p(E, this.name), E;
|
|
1001
1001
|
};
|
|
1002
|
-
ce(e, { name: t, fromWireType:
|
|
1002
|
+
ce(e, { name: t, fromWireType: h, toWireType: O, o: 8, readValueFromPointer: kt(t, r, n !== 0), s: null });
|
|
1003
1003
|
}, _embind_register_memory_view: (e, t, r) => {
|
|
1004
|
-
function n(
|
|
1005
|
-
return new i(
|
|
1004
|
+
function n(h) {
|
|
1005
|
+
return new i(y.buffer, m[h + 4 >> 2], m[h >> 2]);
|
|
1006
1006
|
}
|
|
1007
1007
|
var i = [Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array, Float32Array, Float64Array, BigInt64Array, BigUint64Array][t];
|
|
1008
1008
|
r = ne(r), ce(e, { name: r, fromWireType: n, o: 8, readValueFromPointer: n }, { V: !0 });
|
|
@@ -1010,33 +1010,33 @@ ${E}`;
|
|
|
1010
1010
|
ce(e, kr);
|
|
1011
1011
|
}, _embind_register_std_string: (e, t) => {
|
|
1012
1012
|
t = ne(t), ce(e, { name: t, fromWireType: function(r) {
|
|
1013
|
-
for (var n =
|
|
1014
|
-
var
|
|
1015
|
-
(p == n ||
|
|
1013
|
+
for (var n = m[r >> 2], i = r + 4, h, g = i, p = 0; p <= n; ++p) {
|
|
1014
|
+
var O = i + p;
|
|
1015
|
+
(p == n || d[O] == 0) && (g = Ie(g, O - g), h === void 0 ? h = g : (h += "\0", h += g), g = O + 1);
|
|
1016
1016
|
}
|
|
1017
|
-
return pe(r),
|
|
1017
|
+
return pe(r), h;
|
|
1018
1018
|
}, toWireType: function(r, n) {
|
|
1019
1019
|
n instanceof ArrayBuffer && (n = new Uint8Array(n));
|
|
1020
1020
|
var i = typeof n == "string";
|
|
1021
1021
|
if (!(i || ArrayBuffer.isView(n) && n.BYTES_PER_ELEMENT == 1)) throw new W("Cannot pass non-string to std::string");
|
|
1022
|
-
var
|
|
1023
|
-
return
|
|
1022
|
+
var h = i ? Ye(n) : n.length, g = Vt(4 + h + 1), p = g + 4;
|
|
1023
|
+
return m[g >> 2] = h, i ? Pe(n, p, h + 1) : d.set(n, p), r !== null && r.push(pe, g), g;
|
|
1024
1024
|
}, o: 8, readValueFromPointer: ze, s(r) {
|
|
1025
1025
|
pe(r);
|
|
1026
1026
|
} });
|
|
1027
1027
|
}, _embind_register_std_wstring: (e, t, r) => {
|
|
1028
|
-
if (r = ne(r), t === 2) var n = Ir, i = Cr,
|
|
1029
|
-
else t === 4 && (n = Pr, i = Or,
|
|
1028
|
+
if (r = ne(r), t === 2) var n = Ir, i = Cr, h = Ar, g = (p) => P[p >> 1];
|
|
1029
|
+
else t === 4 && (n = Pr, i = Or, h = Rr, g = (p) => m[p >> 2]);
|
|
1030
1030
|
ce(e, { name: r, fromWireType: (p) => {
|
|
1031
|
-
for (var
|
|
1031
|
+
for (var O = m[p >> 2], $, E = p + 4, B = 0; B <= O; ++B) {
|
|
1032
1032
|
var J = p + 4 + B * t;
|
|
1033
|
-
(B ==
|
|
1033
|
+
(B == O || g(J) == 0) && (E = n(E, J - E), $ === void 0 ? $ = E : ($ += "\0", $ += E), E = J + t);
|
|
1034
1034
|
}
|
|
1035
|
-
return pe(p),
|
|
1036
|
-
}, toWireType: (p,
|
|
1037
|
-
if (typeof
|
|
1038
|
-
var
|
|
1039
|
-
return
|
|
1035
|
+
return pe(p), $;
|
|
1036
|
+
}, toWireType: (p, O) => {
|
|
1037
|
+
if (typeof O != "string") throw new W(`Cannot pass non-string to C++ string type ${r}`);
|
|
1038
|
+
var $ = h(O), E = Vt(4 + $ + t);
|
|
1039
|
+
return m[E >> 2] = $ / t, i(O, E + 4, $ + t), p !== null && p.push(pe, E), E;
|
|
1040
1040
|
}, o: 8, readValueFromPointer: ze, s(p) {
|
|
1041
1041
|
pe(p);
|
|
1042
1042
|
} });
|
|
@@ -1051,14 +1051,14 @@ ${E}`;
|
|
|
1051
1051
|
var n = t.shift();
|
|
1052
1052
|
e--;
|
|
1053
1053
|
var i = `return function (obj, func, destructorsRef, args) {
|
|
1054
|
-
`,
|
|
1055
|
-
r === 0 &&
|
|
1056
|
-
for (var p = ["retType"],
|
|
1057
|
-
`,
|
|
1058
|
-
return i += ` var rv = ${r === 1 ? "new func" : "func.call"}(${
|
|
1059
|
-
`, n.W || (p.push("emval_returnValue"),
|
|
1054
|
+
`, h = 0, g = [];
|
|
1055
|
+
r === 0 && g.push("obj");
|
|
1056
|
+
for (var p = ["retType"], O = [n], $ = 0; $ < e; ++$) g.push(`arg${$}`), p.push(`argType${$}`), O.push(t[$]), i += ` var arg${$} = argType${$}.readValueFromPointer(args${h ? "+" + h : ""});
|
|
1057
|
+
`, h += t[$].o;
|
|
1058
|
+
return i += ` var rv = ${r === 1 ? "new func" : "func.call"}(${g.join(", ")});
|
|
1059
|
+
`, n.W || (p.push("emval_returnValue"), O.push(Lr), i += ` return emval_returnValue(retType, destructorsRef, rv);
|
|
1060
1060
|
`), e = new Function(...p, i + `};
|
|
1061
|
-
`)(...
|
|
1061
|
+
`)(...O), r = `methodCaller<(${t.map((E) => E.name).join(", ")}) => ${n.name}>`, $r(He(r, e));
|
|
1062
1062
|
}, _emval_incref: (e) => {
|
|
1063
1063
|
9 < e && (ue[e + 1] += 1);
|
|
1064
1064
|
}, _emval_run_destructors: (e) => {
|
|
@@ -1067,104 +1067,104 @@ ${E}`;
|
|
|
1067
1067
|
}, _emval_take_value: (e, t) => (e = st(e, "_emval_take_value"), e = e.readValueFromPointer(t), Je(e)), _setitimer_js: (e, t) => {
|
|
1068
1068
|
if (Re[e] && (clearTimeout(Re[e].id), delete Re[e]), !t) return 0;
|
|
1069
1069
|
var r = setTimeout(() => {
|
|
1070
|
-
|
|
1070
|
+
f(e in Re), delete Re[e], Nr(() => Dr(e, performance.now()));
|
|
1071
1071
|
}, t);
|
|
1072
1072
|
return Re[e] = { id: r, da: t }, 0;
|
|
1073
1073
|
}, _tzset_js: (e, t, r, n) => {
|
|
1074
|
-
var i = (/* @__PURE__ */ new Date()).getFullYear(),
|
|
1075
|
-
i = new Date(i, 6, 1).getTimezoneOffset(),
|
|
1076
|
-
var p = Math.abs(
|
|
1077
|
-
return `UTC${0 <=
|
|
1078
|
-
}, e = t(
|
|
1074
|
+
var i = (/* @__PURE__ */ new Date()).getFullYear(), h = new Date(i, 0, 1).getTimezoneOffset();
|
|
1075
|
+
i = new Date(i, 6, 1).getTimezoneOffset(), m[e >> 2] = 60 * Math.max(h, i), j[t >> 2] = +(h != i), t = (g) => {
|
|
1076
|
+
var p = Math.abs(g);
|
|
1077
|
+
return `UTC${0 <= g ? "-" : "+"}${String(Math.floor(p / 60)).padStart(2, "0")}${String(p % 60).padStart(2, "0")}`;
|
|
1078
|
+
}, e = t(h), t = t(i), f(e), f(t), f(16 >= Ye(e), `timezone name truncated to fit in TZNAME_MAX (${e})`), f(16 >= Ye(t), `timezone name truncated to fit in TZNAME_MAX (${t})`), i < h ? (Pe(e, r, 17), Pe(t, n, 17)) : (Pe(e, n, 17), Pe(t, r, 17));
|
|
1079
1079
|
}, clock_time_get: function(e, t, r) {
|
|
1080
|
-
return 0 <= e && 3 >= e ? (
|
|
1080
|
+
return 0 <= e && 3 >= e ? (k[r >> 3] = BigInt(Math.round(1e6 * (e === 0 ? Date.now() : performance.now()))), 0) : 28;
|
|
1081
1081
|
}, emscripten_resize_heap: (e) => {
|
|
1082
|
-
var t =
|
|
1083
|
-
if (e >>>= 0,
|
|
1082
|
+
var t = d.length;
|
|
1083
|
+
if (e >>>= 0, f(e > t), 2147483648 < e) return S(`Cannot enlarge memory, requested ${e} bytes, but the limit is ${2147483648} bytes!`), !1;
|
|
1084
1084
|
for (var r = 1; 4 >= r; r *= 2) {
|
|
1085
1085
|
var n = t * (1 + 0.2 / r);
|
|
1086
1086
|
n = Math.min(n, e + 100663296);
|
|
1087
|
-
var i = Math,
|
|
1088
|
-
n = Math.max(e, n),
|
|
1087
|
+
var i = Math, h = i.min;
|
|
1088
|
+
n = Math.max(e, n), f(65536, "alignment argument is required"), i = h.call(i, 2147483648, 65536 * Math.ceil(n / 65536));
|
|
1089
1089
|
e: {
|
|
1090
|
-
|
|
1091
|
-
var
|
|
1090
|
+
h = i, n = M.buffer;
|
|
1091
|
+
var g = (h - n.byteLength + 65535) / 65536 | 0;
|
|
1092
1092
|
try {
|
|
1093
|
-
|
|
1093
|
+
M.grow(g), he();
|
|
1094
1094
|
var p = 1;
|
|
1095
1095
|
break e;
|
|
1096
|
-
} catch (
|
|
1097
|
-
|
|
1096
|
+
} catch (O) {
|
|
1097
|
+
S(`growMemory: Attempted to grow heap from ${n.byteLength} bytes to ${h} bytes, but got error: ${O}`);
|
|
1098
1098
|
}
|
|
1099
1099
|
p = void 0;
|
|
1100
1100
|
}
|
|
1101
1101
|
if (p) return !0;
|
|
1102
1102
|
}
|
|
1103
|
-
return
|
|
1103
|
+
return S(`Failed to grow the heap from ${t} bytes to ${i} bytes, not enough memory!`), !1;
|
|
1104
1104
|
}, environ_get: (e, t) => {
|
|
1105
1105
|
var r = 0, n = 0, i;
|
|
1106
1106
|
for (i of Ht()) {
|
|
1107
|
-
var
|
|
1108
|
-
|
|
1107
|
+
var h = t + r;
|
|
1108
|
+
m[e + n >> 2] = h, r += Pe(i, h, 1 / 0) + 1, n += 4;
|
|
1109
1109
|
}
|
|
1110
1110
|
return 0;
|
|
1111
1111
|
}, environ_sizes_get: (e, t) => {
|
|
1112
1112
|
var r = Ht();
|
|
1113
|
-
|
|
1113
|
+
m[e >> 2] = r.length, e = 0;
|
|
1114
1114
|
for (var n of r) e += Ye(n) + 1;
|
|
1115
|
-
return
|
|
1115
|
+
return m[t >> 2] = e, 0;
|
|
1116
1116
|
}, fd_close: () => {
|
|
1117
1117
|
X("fd_close called without SYSCALLS_REQUIRE_FILESYSTEM");
|
|
1118
1118
|
}, fd_seek: function() {
|
|
1119
1119
|
return 70;
|
|
1120
1120
|
}, fd_write: (e, t, r, n) => {
|
|
1121
|
-
for (var i = 0,
|
|
1122
|
-
var
|
|
1121
|
+
for (var i = 0, h = 0; h < r; h++) {
|
|
1122
|
+
var g = m[t >> 2], p = m[t + 4 >> 2];
|
|
1123
1123
|
t += 8;
|
|
1124
|
-
for (var
|
|
1124
|
+
for (var O = 0; O < p; O++) ht(e, d[g + O]);
|
|
1125
1125
|
i += p;
|
|
1126
1126
|
}
|
|
1127
|
-
return
|
|
1127
|
+
return m[n >> 2] = i, 0;
|
|
1128
1128
|
}, proc_exit: Gt }, ie = await (async function() {
|
|
1129
|
-
function e(
|
|
1130
|
-
|
|
1131
|
-
var
|
|
1132
|
-
for (
|
|
1133
|
-
var p =
|
|
1134
|
-
|
|
1129
|
+
function e(h) {
|
|
1130
|
+
h = ie = h.exports;
|
|
1131
|
+
var g = {};
|
|
1132
|
+
for (O in h) {
|
|
1133
|
+
var p = h[O];
|
|
1134
|
+
g[O] = typeof p == "function" ? wt(p) : p;
|
|
1135
1135
|
}
|
|
1136
|
-
if (ie =
|
|
1137
|
-
var
|
|
1138
|
-
se = null,
|
|
1136
|
+
if (ie = g, M = ie.memory, f(M, "memory not found in wasm exports"), he(), be = ie.__indirect_function_table, f(be, "table not found in wasm exports"), cr(), K--, o.monitorRunDependencies?.(K), f(Q["wasm-instantiate"]), delete Q["wasm-instantiate"], K == 0 && (ee !== null && (clearInterval(ee), ee = null), se)) {
|
|
1137
|
+
var O = se;
|
|
1138
|
+
se = null, O();
|
|
1139
1139
|
}
|
|
1140
1140
|
return ie;
|
|
1141
1141
|
}
|
|
1142
|
-
function t(
|
|
1143
|
-
return
|
|
1142
|
+
function t(h) {
|
|
1143
|
+
return f(o === r, "the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?"), r = null, e(h.instance);
|
|
1144
1144
|
}
|
|
1145
1145
|
ve();
|
|
1146
1146
|
var r = o, n = { env: zt, wasi_snapshot_preview1: zt };
|
|
1147
|
-
if (o.instantiateWasm) return new Promise((
|
|
1147
|
+
if (o.instantiateWasm) return new Promise((h, g) => {
|
|
1148
1148
|
try {
|
|
1149
|
-
o.instantiateWasm(n, (p,
|
|
1150
|
-
|
|
1149
|
+
o.instantiateWasm(n, (p, O) => {
|
|
1150
|
+
h(e(p, O));
|
|
1151
1151
|
});
|
|
1152
1152
|
} catch (p) {
|
|
1153
|
-
|
|
1153
|
+
S(`Module.instantiateWasm callback failed with error: ${p}`), g(p);
|
|
1154
1154
|
}
|
|
1155
1155
|
});
|
|
1156
|
-
Le ??= o.locateFile ? o.locateFile ? o.locateFile("libavoid.wasm",
|
|
1156
|
+
Le ??= o.locateFile ? o.locateFile ? o.locateFile("libavoid.wasm", F) : F + "libavoid.wasm" : new URL("" + new URL("../libavoid.wasm?no-inline", import.meta.url).href, import.meta.url).href;
|
|
1157
1157
|
try {
|
|
1158
1158
|
var i = await dr(n);
|
|
1159
1159
|
return t(i);
|
|
1160
|
-
} catch (
|
|
1161
|
-
return
|
|
1160
|
+
} catch (h) {
|
|
1161
|
+
return C(h), Promise.reject(h);
|
|
1162
1162
|
}
|
|
1163
1163
|
})(), Ur = te("__getTypeName", 1), Vt = te("malloc", 1), pe = te("free", 1), jr = te("fflush", 1), Wr = te("__funcs_on_exit", 0), Jt = ie.emscripten_stack_get_end, Dr = te("_emscripten_timeout", 2), Gr = ie.__trap, Hr = ie.emscripten_stack_init, Br = ie._emscripten_stack_restore, Yt = ie._emscripten_stack_alloc, qt = ie.emscripten_stack_get_current, zr = te("__cxa_decrement_exception_refcount", 1), Vr = te("__cxa_increment_exception_refcount", 1), Jr = te("__thrown_object_from_unwind_exception", 1), Yr = te("__get_exception_message", 3), Kt;
|
|
1164
1164
|
function ft() {
|
|
1165
1165
|
function e() {
|
|
1166
|
-
if (
|
|
1167
|
-
if (
|
|
1166
|
+
if (f(!Kt), Kt = !0, o.calledRun = !0, !v) {
|
|
1167
|
+
if (f(!A), A = !0, D(), ie.__wasm_call_ctors(), u(o), o.onRuntimeInitialized?.(), oe("onRuntimeInitialized"), f(!o._main, 'compiled without a main, but one is present. if you added it from JS, use Module["onRuntimeInitialized"]'), D(), o.postRun) for (typeof o.postRun == "function" && (o.postRun = [o.postRun]); o.postRun.length; ) {
|
|
1168
1168
|
var t = o.postRun.shift();
|
|
1169
1169
|
_t.push(t);
|
|
1170
1170
|
}
|
|
@@ -1205,75 +1205,75 @@ async function Xe(a, s = {}) {
|
|
|
1205
1205
|
await (er ??= Qt.load(rn).catch((l) => {
|
|
1206
1206
|
throw er = void 0, l;
|
|
1207
1207
|
}));
|
|
1208
|
-
const u = Qt.getInstance(),
|
|
1209
|
-
const
|
|
1210
|
-
for (let w =
|
|
1211
|
-
|
|
1212
|
-
return
|
|
1213
|
-
},
|
|
1208
|
+
const u = Qt.getInstance(), C = new Map(a.nodes.map((l) => [l.id, l])), _ = (l) => {
|
|
1209
|
+
const S = [];
|
|
1210
|
+
for (let w = C.get(l).parentId; w; w = C.get(w).parentId)
|
|
1211
|
+
S.push(w);
|
|
1212
|
+
return S;
|
|
1213
|
+
}, R = /* @__PURE__ */ new Map();
|
|
1214
1214
|
for (const l of a.edges) {
|
|
1215
|
-
const
|
|
1216
|
-
|
|
1215
|
+
const S = /* @__PURE__ */ new Set([..._(l.source), ..._(l.target)]), w = JSON.stringify([...S].sort()), M = R.get(w) ?? { open: S, edges: [] };
|
|
1216
|
+
M.edges.push(l), R.set(w, M);
|
|
1217
1217
|
}
|
|
1218
|
-
const
|
|
1219
|
-
for (const { open: l, edges:
|
|
1218
|
+
const F = /* @__PURE__ */ new Map();
|
|
1219
|
+
for (const { open: l, edges: S } of R.values()) {
|
|
1220
1220
|
const w = new u.Router(2);
|
|
1221
1221
|
try {
|
|
1222
1222
|
w.setRoutingParameter(u.RoutingParameter.shapeBufferDistance, b), w.setRoutingParameter(u.RoutingParameter.idealNudgingDistance, 8), w.setRoutingParameter(u.RoutingParameter.crossingPenalty, 80), w.setRoutingParameter(u.RoutingParameter.fixedSharedPathPenalty, 120), w.setRoutingParameter(u.RoutingParameter.portDirectionPenalty, 0), w.setRoutingOption(
|
|
1223
1223
|
u.RoutingOption.nudgeOrthogonalSegmentsConnectedToShapes,
|
|
1224
|
-
s.edgeAnchorInset === void 0 && !
|
|
1224
|
+
s.edgeAnchorInset === void 0 && !S.some((c) => c.sourcePort || c.targetPort || c.source === c.target)
|
|
1225
1225
|
), w.setRoutingOption(u.RoutingOption.nudgeSharedPathsWithCommonEndPoint, !0);
|
|
1226
|
-
const
|
|
1227
|
-
a.nodes.filter((c) => !l.has(c.id) && _(c.id).every((
|
|
1228
|
-
const
|
|
1229
|
-
return de(
|
|
1226
|
+
const M = new Map(
|
|
1227
|
+
a.nodes.filter((c) => !l.has(c.id) && _(c.id).every((k) => l.has(k))).map((c) => {
|
|
1228
|
+
const k = new u.Point(c.x, c.y), G = new u.Point(c.x + c.width, c.y + c.height), T = new u.Rectangle(k, G), A = new u.ShapeRef(w, T);
|
|
1229
|
+
return de(k), de(G), de(T), [c.id, A];
|
|
1230
1230
|
})
|
|
1231
|
-
), v = /* @__PURE__ */ new Map(),
|
|
1232
|
-
for (const c of
|
|
1233
|
-
const
|
|
1234
|
-
v.set(
|
|
1231
|
+
), v = /* @__PURE__ */ new Map(), I = /* @__PURE__ */ new Map();
|
|
1232
|
+
for (const c of S) {
|
|
1233
|
+
const k = [c.source, c.target].sort().join("\0"), G = v.get(k) ?? 0;
|
|
1234
|
+
v.set(k, G + 1), I.set(c.id, G % 2 === 0 ? -6 : 6);
|
|
1235
1235
|
}
|
|
1236
|
-
let
|
|
1237
|
-
const
|
|
1236
|
+
let f = Ee.length + 2;
|
|
1237
|
+
const y = /* @__PURE__ */ new Map(), d = (c, k) => Math.max(0, Math.min(1, c / k));
|
|
1238
1238
|
for (const c of a.nodes) {
|
|
1239
|
-
const
|
|
1240
|
-
if (
|
|
1241
|
-
const G = (
|
|
1239
|
+
const k = M.get(c.id);
|
|
1240
|
+
if (!k) continue;
|
|
1241
|
+
const G = (T, A, L, U, H) => {
|
|
1242
1242
|
const D = new u.ShapeConnectionPin(
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1243
|
+
k,
|
|
1244
|
+
T,
|
|
1245
|
+
d(A, c.width),
|
|
1246
|
+
d(L, c.height),
|
|
1247
1247
|
!0,
|
|
1248
1248
|
0,
|
|
1249
|
-
|
|
1249
|
+
U
|
|
1250
1250
|
);
|
|
1251
1251
|
D.setExclusive(H), D.setConnectionCost(
|
|
1252
|
-
c.width / 2 + c.height / 2 - Math.abs(
|
|
1252
|
+
c.width / 2 + c.height / 2 - Math.abs(A - c.width / 2) - Math.abs(L - c.height / 2)
|
|
1253
1253
|
);
|
|
1254
1254
|
};
|
|
1255
|
-
for (const
|
|
1256
|
-
const { x:
|
|
1257
|
-
G(
|
|
1255
|
+
for (const T of new Set(c.ports?.map((A) => A.side))) {
|
|
1256
|
+
const { x: A, y: L } = rr(c, T), U = Ee.indexOf(T) + 2;
|
|
1257
|
+
G(U, A - c.x, L - c.y, tr[T], !1), y.set(
|
|
1258
1258
|
JSON.stringify([
|
|
1259
1259
|
c.id,
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1260
|
+
d(A - c.x, c.width),
|
|
1261
|
+
d(L - c.y, c.height),
|
|
1262
|
+
T
|
|
1263
1263
|
]),
|
|
1264
|
-
|
|
1264
|
+
U
|
|
1265
1265
|
);
|
|
1266
1266
|
}
|
|
1267
1267
|
}
|
|
1268
|
-
const
|
|
1269
|
-
const
|
|
1270
|
-
left: Math.min(c.x,
|
|
1271
|
-
right: Math.max(c.x + c.width,
|
|
1272
|
-
top: Math.min(c.y,
|
|
1273
|
-
bottom: Math.max(c.y + c.height,
|
|
1274
|
-
}, D =
|
|
1268
|
+
const x = a.nodes.filter((c) => M.has(c.id)), P = (c, k, G, T, A, L = !1) => {
|
|
1269
|
+
const U = b + 8, H = {
|
|
1270
|
+
left: Math.min(c.x, k.x) - U,
|
|
1271
|
+
right: Math.max(c.x + c.width, k.x + k.width) + U,
|
|
1272
|
+
top: Math.min(c.y, k.y) - U,
|
|
1273
|
+
bottom: Math.max(c.y + c.height, k.y + k.height) + U
|
|
1274
|
+
}, D = x.filter(
|
|
1275
1275
|
(V) => V.x <= H.right && V.x + V.width >= H.left && V.y <= H.bottom && V.y + V.height >= H.top
|
|
1276
|
-
), z =
|
|
1276
|
+
), z = M.get(c.id);
|
|
1277
1277
|
if (z && G)
|
|
1278
1278
|
return new u.ConnEnd(
|
|
1279
1279
|
z,
|
|
@@ -1284,9 +1284,9 @@ async function Xe(a, s = {}) {
|
|
|
1284
1284
|
side: c.ports.find((V) => V.id === G).side,
|
|
1285
1285
|
position: rr(c, c.ports.find((V) => V.id === G).side)
|
|
1286
1286
|
}
|
|
1287
|
-
] :
|
|
1288
|
-
const he = nn(c, V,
|
|
1289
|
-
if (
|
|
1287
|
+
] : A ? [{ side: "EAST", position: A }] : (L ? [nr(c, k).source] : Ee).flatMap((V) => {
|
|
1288
|
+
const he = nn(c, V, k, T, o);
|
|
1289
|
+
if (L) return [{ side: V, position: he }];
|
|
1290
1290
|
const K = V === "NORTH" || V === "SOUTH", se = K ? c.x : c.y, Q = K ? c.width : c.height, ee = se + Math.min(o, Q / 4), ve = se + Q - Math.min(o, Q / 4), X = [
|
|
1291
1291
|
K ? he.x : he.y,
|
|
1292
1292
|
ee,
|
|
@@ -1304,23 +1304,23 @@ async function Xe(a, s = {}) {
|
|
|
1304
1304
|
if (z) {
|
|
1305
1305
|
const V = (Q, ee) => JSON.stringify([
|
|
1306
1306
|
c.id,
|
|
1307
|
-
|
|
1308
|
-
|
|
1307
|
+
d(ee.x - c.x, c.width),
|
|
1308
|
+
d(ee.y - c.y, c.height),
|
|
1309
1309
|
Q
|
|
1310
|
-
]), K = !!(G ||
|
|
1311
|
-
(Q) =>
|
|
1312
|
-
) ?
|
|
1310
|
+
]), K = !!(G || A || L) || Z.every(
|
|
1311
|
+
(Q) => y.has(V(Q.side, Q.position))
|
|
1312
|
+
) ? y.get(V(Z[0].side, Z[0].position)) : void 0;
|
|
1313
1313
|
if (K !== void 0) return new u.ConnEnd(z, K);
|
|
1314
|
-
const se = K ??
|
|
1314
|
+
const se = K ?? f++;
|
|
1315
1315
|
for (const { side: Q, position: ee } of Z) {
|
|
1316
1316
|
const ve = V(Q, ee);
|
|
1317
|
-
if (
|
|
1318
|
-
|
|
1317
|
+
if (y.has(ve)) continue;
|
|
1318
|
+
y.set(ve, se);
|
|
1319
1319
|
const X = ee.x - c.x, re = ee.y - c.y, te = new u.ShapeConnectionPin(
|
|
1320
1320
|
z,
|
|
1321
1321
|
se,
|
|
1322
|
-
|
|
1323
|
-
|
|
1322
|
+
d(X, c.width),
|
|
1323
|
+
d(re, c.height),
|
|
1324
1324
|
!0,
|
|
1325
1325
|
0,
|
|
1326
1326
|
tr[Q]
|
|
@@ -1331,35 +1331,35 @@ async function Xe(a, s = {}) {
|
|
|
1331
1331
|
}
|
|
1332
1332
|
return new u.ConnEnd(z, se);
|
|
1333
1333
|
}
|
|
1334
|
-
const oe = nr(c,
|
|
1334
|
+
const oe = nr(c, k).source, $e = Z.find((V) => V.side === oe)?.position ?? Z[0].position, Fe = new u.Point($e.x, $e.y), Ue = new u.ConnEnd(Fe);
|
|
1335
1335
|
return de(Fe), Ue;
|
|
1336
|
-
},
|
|
1337
|
-
const
|
|
1338
|
-
|
|
1336
|
+
}, j = (c) => +!!(c.sourcePort || c.targetPort || c.source === c.target || v.get([c.source, c.target].sort().join("\0")) > 1), m = [...S].sort((c, k) => j(k) - j(c)).map((c) => {
|
|
1337
|
+
const k = C.get(c.source), G = C.get(c.target), T = c.source === c.target, A = v.get([c.source, c.target].sort().join("\0")) > 1, L = P(
|
|
1338
|
+
k,
|
|
1339
1339
|
G,
|
|
1340
1340
|
c.sourcePort,
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
),
|
|
1341
|
+
I.get(c.id),
|
|
1342
|
+
T ? { x: k.x + k.width, y: k.y + k.height / 3 } : void 0,
|
|
1343
|
+
A
|
|
1344
|
+
), U = P(
|
|
1345
1345
|
G,
|
|
1346
|
-
|
|
1346
|
+
k,
|
|
1347
1347
|
c.targetPort,
|
|
1348
|
-
|
|
1349
|
-
|
|
1348
|
+
I.get(c.id),
|
|
1349
|
+
T ? {
|
|
1350
1350
|
x: G.x + G.width,
|
|
1351
1351
|
y: G.y + G.height * 2 / 3
|
|
1352
1352
|
} : void 0,
|
|
1353
|
-
|
|
1354
|
-
), H = new u.ConnRef(w,
|
|
1355
|
-
if (de(
|
|
1353
|
+
A
|
|
1354
|
+
), H = new u.ConnRef(w, L, U);
|
|
1355
|
+
if (de(L), de(U), T) {
|
|
1356
1356
|
const D = new u.CheckpointVector();
|
|
1357
1357
|
for (const z of [
|
|
1358
|
-
|
|
1359
|
-
|
|
1358
|
+
k.y + k.height / 3,
|
|
1359
|
+
k.y + k.height * 2 / 3
|
|
1360
1360
|
]) {
|
|
1361
1361
|
const Z = new u.Point(
|
|
1362
|
-
|
|
1362
|
+
k.x + k.width + Math.max(24, b + 4),
|
|
1363
1363
|
z
|
|
1364
1364
|
), oe = new u.Checkpoint(Z);
|
|
1365
1365
|
D.push_back(oe), de(Z), de(oe);
|
|
@@ -1369,23 +1369,23 @@ async function Xe(a, s = {}) {
|
|
|
1369
1369
|
return { edge: c, connection: H };
|
|
1370
1370
|
});
|
|
1371
1371
|
w.processTransaction();
|
|
1372
|
-
for (const { edge: c, connection:
|
|
1373
|
-
const G =
|
|
1374
|
-
const
|
|
1375
|
-
return de(
|
|
1372
|
+
for (const { edge: c, connection: k } of m) {
|
|
1373
|
+
const G = k.displayRoute(), T = Array.from({ length: G.size() }, (A, L) => {
|
|
1374
|
+
const U = G.at(L), H = { x: U.x, y: U.y };
|
|
1375
|
+
return de(U), H;
|
|
1376
1376
|
});
|
|
1377
|
-
if (de(G),
|
|
1377
|
+
if (de(G), !k.hasValidRoute() || T.length < 2 || T.some((A) => !Number.isFinite(A.x) || !Number.isFinite(A.y)) || T.some((A, L) => L > 0 && A.x !== T[L - 1].x && A.y !== T[L - 1].y))
|
|
1378
1378
|
throw new Error(`Graph edge cannot be routed: ${c.id}`);
|
|
1379
|
-
|
|
1379
|
+
F.set(c.id, T);
|
|
1380
1380
|
}
|
|
1381
1381
|
} finally {
|
|
1382
1382
|
w.delete();
|
|
1383
1383
|
}
|
|
1384
1384
|
}
|
|
1385
|
-
const
|
|
1385
|
+
const N = a.edges.map((l) => ({ ...l, sections: [F.get(l.id)] }));
|
|
1386
1386
|
return mt({
|
|
1387
1387
|
nodes: a.nodes,
|
|
1388
|
-
edges:
|
|
1388
|
+
edges: N,
|
|
1389
1389
|
bounds: a.bounds
|
|
1390
1390
|
});
|
|
1391
1391
|
}
|
|
@@ -1417,33 +1417,33 @@ function rr(a, s) {
|
|
|
1417
1417
|
};
|
|
1418
1418
|
}
|
|
1419
1419
|
function nr(a, s) {
|
|
1420
|
-
const b = (l,
|
|
1420
|
+
const b = (l, S) => S.x >= l.x && S.y >= l.y && S.x + S.width <= l.x + l.width && S.y + S.height <= l.y + l.height, o = b(a, s) ? a : b(s, a) ? s : void 0;
|
|
1421
1421
|
if (o) {
|
|
1422
|
-
const l = o === a ? s : a,
|
|
1422
|
+
const l = o === a ? s : a, S = {
|
|
1423
1423
|
NORTH: l.y - o.y,
|
|
1424
1424
|
EAST: o.x + o.width - l.x - l.width,
|
|
1425
1425
|
SOUTH: o.y + o.height - l.y - l.height,
|
|
1426
1426
|
WEST: l.x - o.x
|
|
1427
|
-
}, w = [...Ee].sort((
|
|
1427
|
+
}, w = [...Ee].sort((M, v) => S[M] - S[v])[0];
|
|
1428
1428
|
return { source: w, target: w };
|
|
1429
1429
|
}
|
|
1430
|
-
const u = s.x + s.width / 2 - (a.x + a.width / 2),
|
|
1430
|
+
const u = s.x + s.width / 2 - (a.x + a.width / 2), C = s.y + s.height / 2 - (a.y + a.height / 2), _ = Math.max(a.x - (s.x + s.width), s.x - (a.x + a.width), 0), R = Math.max(
|
|
1431
1431
|
a.y - (s.y + s.height),
|
|
1432
1432
|
s.y - (a.y + a.height),
|
|
1433
1433
|
0
|
|
1434
|
-
),
|
|
1435
|
-
return { source:
|
|
1434
|
+
), N = (R === 0 && _ > 0 ? !0 : _ === 0 && R > 0 ? !1 : _ === 0 && R === 0 ? Math.abs(u) >= Math.abs(C) : _ <= R) ? u >= 0 ? "EAST" : "WEST" : C >= 0 ? "SOUTH" : "NORTH";
|
|
1435
|
+
return { source: N, target: Ee[(Ee.indexOf(N) + 2) % 4] };
|
|
1436
1436
|
}
|
|
1437
1437
|
function nn(a, s, b, o = 0, u = 8) {
|
|
1438
|
-
const
|
|
1439
|
-
const v = Math.max(l, w),
|
|
1440
|
-
return v <
|
|
1441
|
-
},
|
|
1438
|
+
const C = (l) => Math.min(u, l / 4), _ = (l, S, w) => Math.max(S + C(w), Math.min(S + w - C(w), l)), R = (l, S, w, M) => {
|
|
1439
|
+
const v = Math.max(l, w), I = Math.min(l + S, w + M);
|
|
1440
|
+
return v < I ? (v + I) / 2 + o : void 0;
|
|
1441
|
+
}, F = b.x + b.width / 2, N = b.y + b.height / 2;
|
|
1442
1442
|
switch (s) {
|
|
1443
1443
|
case "NORTH":
|
|
1444
1444
|
return {
|
|
1445
1445
|
x: _(
|
|
1446
|
-
|
|
1446
|
+
R(a.x, a.width, b.x, b.width) ?? F + o,
|
|
1447
1447
|
a.x,
|
|
1448
1448
|
a.width
|
|
1449
1449
|
),
|
|
@@ -1453,7 +1453,7 @@ function nn(a, s, b, o = 0, u = 8) {
|
|
|
1453
1453
|
return {
|
|
1454
1454
|
x: a.x + a.width,
|
|
1455
1455
|
y: _(
|
|
1456
|
-
|
|
1456
|
+
R(a.y, a.height, b.y, b.height) ?? N + o,
|
|
1457
1457
|
a.y,
|
|
1458
1458
|
a.height
|
|
1459
1459
|
)
|
|
@@ -1461,7 +1461,7 @@ function nn(a, s, b, o = 0, u = 8) {
|
|
|
1461
1461
|
case "SOUTH":
|
|
1462
1462
|
return {
|
|
1463
1463
|
x: _(
|
|
1464
|
-
|
|
1464
|
+
R(a.x, a.width, b.x, b.width) ?? F + o,
|
|
1465
1465
|
a.x,
|
|
1466
1466
|
a.width
|
|
1467
1467
|
),
|
|
@@ -1471,30 +1471,30 @@ function nn(a, s, b, o = 0, u = 8) {
|
|
|
1471
1471
|
return {
|
|
1472
1472
|
x: a.x,
|
|
1473
1473
|
y: _(
|
|
1474
|
-
|
|
1474
|
+
R(a.y, a.height, b.y, b.height) ?? N + o,
|
|
1475
1475
|
a.y,
|
|
1476
1476
|
a.height
|
|
1477
1477
|
)
|
|
1478
1478
|
};
|
|
1479
1479
|
}
|
|
1480
1480
|
}
|
|
1481
|
-
function or(a, s, b, o, u,
|
|
1482
|
-
const _ = s.flow === "row",
|
|
1483
|
-
let
|
|
1484
|
-
for (let l = 0; l < a.length; l +=
|
|
1485
|
-
const
|
|
1486
|
-
let w = 0,
|
|
1487
|
-
for (const v of
|
|
1481
|
+
function or(a, s, b, o, u, C = { x: 0, y: 0 }) {
|
|
1482
|
+
const _ = s.flow === "row", R = s.maxPerLine ?? Math.max(1, a.length);
|
|
1483
|
+
let F = 0, N = 0;
|
|
1484
|
+
for (let l = 0; l < a.length; l += R) {
|
|
1485
|
+
const S = a.slice(l, l + R);
|
|
1486
|
+
let w = 0, M = 0;
|
|
1487
|
+
for (const v of S)
|
|
1488
1488
|
u(
|
|
1489
1489
|
v,
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
), w += (_ ? v.width : v.height) + o,
|
|
1493
|
-
|
|
1490
|
+
C.x + b.left + (_ ? w : F) - v.x,
|
|
1491
|
+
C.y + b.top + (_ ? F : w) - v.y
|
|
1492
|
+
), w += (_ ? v.width : v.height) + o, M = Math.max(M, _ ? v.height : v.width);
|
|
1493
|
+
N = Math.max(N, w - o), F += M + o;
|
|
1494
1494
|
}
|
|
1495
|
-
return
|
|
1496
|
-
width: b.left + (_ ?
|
|
1497
|
-
height: b.top + (_ ?
|
|
1495
|
+
return F = Math.max(0, F - o), {
|
|
1496
|
+
width: b.left + (_ ? N : F) + b.right,
|
|
1497
|
+
height: b.top + (_ ? F : N) + b.bottom
|
|
1498
1498
|
};
|
|
1499
1499
|
}
|
|
1500
1500
|
function ar(a, s, b) {
|
|
@@ -1506,134 +1506,144 @@ function ar(a, s, b) {
|
|
|
1506
1506
|
throw new Error(`Invalid graph position: ${l.nodeId}`);
|
|
1507
1507
|
u.set(l.nodeId, l);
|
|
1508
1508
|
}
|
|
1509
|
-
const
|
|
1509
|
+
const C = /* @__PURE__ */ new Map();
|
|
1510
1510
|
for (const l of o.values())
|
|
1511
1511
|
if (l.parentId) {
|
|
1512
|
-
const
|
|
1513
|
-
|
|
1512
|
+
const S = C.get(l.parentId) ?? [];
|
|
1513
|
+
S.push(l), C.set(l.parentId, S);
|
|
1514
1514
|
}
|
|
1515
|
-
const _ = s.groupPadding ?? { top: 64, left: 28, right: 28, bottom: 28 },
|
|
1516
|
-
const
|
|
1517
|
-
l.x = v?.x ?? l.x +
|
|
1518
|
-
const
|
|
1519
|
-
for (const
|
|
1520
|
-
if (!
|
|
1521
|
-
const
|
|
1522
|
-
if (v && (
|
|
1515
|
+
const _ = s.groupPadding ?? { top: 64, left: 28, right: 28, bottom: 28 }, R = s.positionMode === "preferred" || s.positionMode === "compressed", F = new Map(b.map((l) => [l.id, l])), N = (l, S, w) => {
|
|
1516
|
+
const M = { x: l.x, y: l.y }, v = u.get(l.id);
|
|
1517
|
+
l.x = v?.x ?? l.x + S, l.y = v?.y ?? l.y + w;
|
|
1518
|
+
const I = C.get(l.id) ?? [];
|
|
1519
|
+
for (const P of I) N(P, l.x - M.x, l.y - M.y);
|
|
1520
|
+
if (!I.length || R) return;
|
|
1521
|
+
const f = Math.min(...I.map((P) => P.x)) - _.left, y = Math.min(...I.map((P) => P.y)) - _.top;
|
|
1522
|
+
if (v && (f < l.x || y < l.y))
|
|
1523
1523
|
throw new Error(`Pinned child lies outside group content: ${l.id}`);
|
|
1524
|
-
const
|
|
1524
|
+
const d = Math.max(
|
|
1525
1525
|
l.x + l.width,
|
|
1526
|
-
...
|
|
1527
|
-
),
|
|
1526
|
+
...I.map((P) => P.x + P.width + _.right)
|
|
1527
|
+
), x = Math.max(
|
|
1528
1528
|
l.y + l.height,
|
|
1529
|
-
...
|
|
1529
|
+
...I.map((P) => P.y + P.height + _.bottom)
|
|
1530
1530
|
);
|
|
1531
|
-
v || (l.x = Math.min(l.x,
|
|
1531
|
+
v || (l.x = Math.min(l.x, f), l.y = Math.min(l.y, y)), l.width = d - l.x, l.height = x - l.y;
|
|
1532
1532
|
};
|
|
1533
|
-
for (const l of o.values()) l.parentId ||
|
|
1534
|
-
if (
|
|
1535
|
-
const l = Math.max(16, s.spacing ?? 64),
|
|
1536
|
-
|
|
1537
|
-
for (const
|
|
1538
|
-
}, w = (
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1533
|
+
for (const l of o.values()) l.parentId || N(l, 0, 0);
|
|
1534
|
+
if (R) {
|
|
1535
|
+
const l = Math.max(16, s.spacing ?? 64), S = (f, y, d) => {
|
|
1536
|
+
f.x += y, f.y += d;
|
|
1537
|
+
for (const x of C.get(f.id) ?? []) S(x, y, d);
|
|
1538
|
+
}, w = (f) => {
|
|
1539
|
+
if (s.positionMode === "compressed")
|
|
1540
|
+
for (const y of ["x", "y"]) {
|
|
1541
|
+
const d = y === "x" ? "width" : "height";
|
|
1542
|
+
let x = -1 / 0, P = 0;
|
|
1543
|
+
for (const j of [...f].sort((m, c) => m[y] - c[y])) {
|
|
1544
|
+
const m = j[y];
|
|
1545
|
+
Number.isFinite(x) && (P += Math.max(0, m - x - l)), x = Math.max(x, m + j[d]), S(j, y === "x" ? -P : 0, y === "y" ? -P : 0);
|
|
1546
|
+
}
|
|
1547
|
+
}
|
|
1548
|
+
}, M = (f) => {
|
|
1549
|
+
const y = [];
|
|
1550
|
+
for (const d of [...f].sort(
|
|
1551
|
+
(x, P) => x.y - P.y || x.x - P.x || x.id.localeCompare(P.id)
|
|
1542
1552
|
)) {
|
|
1543
|
-
const
|
|
1544
|
-
for (const
|
|
1545
|
-
|
|
1546
|
-
const
|
|
1547
|
-
for (const
|
|
1548
|
-
|
|
1549
|
-
const
|
|
1550
|
-
|
|
1553
|
+
const x = { x: d.x, y: d.y };
|
|
1554
|
+
for (const m of [...y].sort((c, k) => c.x - k.x))
|
|
1555
|
+
d.y < m.y + m.height + l && d.y + d.height + l > m.y && x.x < m.x + m.width + l && x.x + d.width + l > m.x && (x.x = m.x + m.width + l);
|
|
1556
|
+
const P = { x: d.x, y: d.y };
|
|
1557
|
+
for (const m of [...y].sort((c, k) => c.y - k.y))
|
|
1558
|
+
d.x < m.x + m.width + l && d.x + d.width + l > m.x && P.y < m.y + m.height + l && P.y + d.height + l > m.y && (P.y = m.y + m.height + l);
|
|
1559
|
+
const j = x.x - d.x < P.y - d.y ? x : P;
|
|
1560
|
+
S(d, j.x - d.x, j.y - d.y), y.push(d);
|
|
1551
1561
|
}
|
|
1552
|
-
},
|
|
1553
|
-
const
|
|
1554
|
-
if (!
|
|
1555
|
-
for (const
|
|
1556
|
-
const
|
|
1557
|
-
if (
|
|
1558
|
-
const
|
|
1559
|
-
|
|
1560
|
-
|
|
1562
|
+
}, v = (f) => {
|
|
1563
|
+
const y = C.get(f.id) ?? [];
|
|
1564
|
+
if (!y.length) return;
|
|
1565
|
+
for (const k of y) v(k);
|
|
1566
|
+
const d = s.groupLayouts?.[f.id];
|
|
1567
|
+
if (d) {
|
|
1568
|
+
const k = or(
|
|
1569
|
+
y,
|
|
1570
|
+
d,
|
|
1561
1571
|
_,
|
|
1562
1572
|
s.spacing ?? 64,
|
|
1563
|
-
|
|
1564
|
-
|
|
1573
|
+
S,
|
|
1574
|
+
f
|
|
1565
1575
|
);
|
|
1566
|
-
|
|
1576
|
+
f.width = Math.max(F.get(f.id).width, k.width), f.height = Math.max(F.get(f.id).height, k.height);
|
|
1567
1577
|
return;
|
|
1568
1578
|
}
|
|
1569
|
-
w(
|
|
1570
|
-
const
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
Math.max(...
|
|
1574
|
-
),
|
|
1575
|
-
|
|
1576
|
-
Math.max(...
|
|
1579
|
+
M(y), w(y);
|
|
1580
|
+
const x = Math.max(12, _.left), P = Math.max(12, _.top), j = Math.max(12, _.right), m = Math.max(12, _.bottom), c = u.get(f.id);
|
|
1581
|
+
f.x = Math.min(c?.x ?? 1 / 0, Math.min(...y.map((k) => k.x)) - x), f.y = Math.min(c?.y ?? 1 / 0, Math.min(...y.map((k) => k.y)) - P), f.width = Math.max(
|
|
1582
|
+
F.get(f.id).width,
|
|
1583
|
+
Math.max(...y.map((k) => k.x + k.width)) + j - f.x
|
|
1584
|
+
), f.height = Math.max(
|
|
1585
|
+
F.get(f.id).height,
|
|
1586
|
+
Math.max(...y.map((k) => k.y + k.height)) + m - f.y
|
|
1577
1587
|
);
|
|
1578
|
-
},
|
|
1579
|
-
for (const
|
|
1580
|
-
w(
|
|
1588
|
+
}, I = [...o.values()].filter((f) => !f.parentId);
|
|
1589
|
+
for (const f of I) v(f);
|
|
1590
|
+
M(I), w(I);
|
|
1581
1591
|
}
|
|
1582
1592
|
return Xe({ ...a, nodes: [...o.values()] }, s);
|
|
1583
1593
|
}
|
|
1584
1594
|
async function on(a, s, b) {
|
|
1585
|
-
const o = new Map(a.nodes.map((
|
|
1586
|
-
for (const
|
|
1587
|
-
const
|
|
1588
|
-
|
|
1595
|
+
const o = new Map(a.nodes.map((y) => [y.id, { ...y, x: 0, y: 0 }])), u = new Map(a.nodes.map((y, d) => [y.id, d])), C = /* @__PURE__ */ new Map();
|
|
1596
|
+
for (const y of o.values()) {
|
|
1597
|
+
const d = C.get(y.parentId) ?? [];
|
|
1598
|
+
d.push(y), C.set(y.parentId, d);
|
|
1589
1599
|
}
|
|
1590
1600
|
const _ = /* @__PURE__ */ new Set([
|
|
1591
|
-
...a.nodes.flatMap((
|
|
1592
|
-
...a.edges.map((
|
|
1601
|
+
...a.nodes.flatMap((y) => [y.id, ...(y.ports ?? []).map((d) => d.id)]),
|
|
1602
|
+
...a.edges.map((y) => y.id)
|
|
1593
1603
|
]);
|
|
1594
|
-
let
|
|
1595
|
-
for (; _.has(
|
|
1596
|
-
const
|
|
1597
|
-
(s.positions ?? []).map((
|
|
1598
|
-
|
|
1599
|
-
|
|
1604
|
+
let R = "$packed";
|
|
1605
|
+
for (; _.has(R); ) R += "$";
|
|
1606
|
+
const F = s.groupPadding ?? { top: 64, right: 28, bottom: 28, left: 28 }, N = s.direction ?? "RIGHT", l = new Map(
|
|
1607
|
+
(s.positions ?? []).map((y) => [
|
|
1608
|
+
y.nodeId,
|
|
1609
|
+
N === "RIGHT" || N === "LEFT" ? y.y : y.x
|
|
1600
1610
|
])
|
|
1601
|
-
),
|
|
1602
|
-
|
|
1603
|
-
for (const
|
|
1604
|
-
}, w = (
|
|
1605
|
-
let
|
|
1606
|
-
for (;
|
|
1607
|
-
|
|
1608
|
-
return
|
|
1609
|
-
},
|
|
1610
|
-
const
|
|
1611
|
-
!
|
|
1612
|
-
(
|
|
1611
|
+
), S = (y, d, x) => {
|
|
1612
|
+
y.x += d, y.y += x;
|
|
1613
|
+
for (const P of C.get(y.id) ?? []) S(P, d, x);
|
|
1614
|
+
}, w = (y, d) => {
|
|
1615
|
+
let x = o.get(y);
|
|
1616
|
+
for (; x && x.parentId !== d; )
|
|
1617
|
+
x = x.parentId ? o.get(x.parentId) : void 0;
|
|
1618
|
+
return x;
|
|
1619
|
+
}, M = async (y) => {
|
|
1620
|
+
const d = [...C.get(y) ?? []], x = y === void 0 ? void 0 : s.groupLayouts?.[y];
|
|
1621
|
+
!x && (y !== void 0 || !s.layers) && d.sort(
|
|
1622
|
+
(m, c) => (l.get(m.id) ?? 1 / 0) - (l.get(c.id) ?? 1 / 0) || u.get(m.id) - u.get(c.id)
|
|
1613
1623
|
);
|
|
1614
|
-
for (const
|
|
1615
|
-
if (!
|
|
1616
|
-
const c = await
|
|
1617
|
-
|
|
1624
|
+
for (const m of d) {
|
|
1625
|
+
if (!C.has(m.id)) continue;
|
|
1626
|
+
const c = await M(m.id);
|
|
1627
|
+
m.width = Math.max(m.width, c.width), m.height = Math.max(m.height, c.height);
|
|
1618
1628
|
}
|
|
1619
|
-
if (!
|
|
1620
|
-
if (
|
|
1621
|
-
if (
|
|
1622
|
-
return an(
|
|
1623
|
-
const
|
|
1624
|
-
for (const
|
|
1625
|
-
const c = w(
|
|
1626
|
-
if (!c ||
|
|
1627
|
-
const G = JSON.stringify([c.id,
|
|
1628
|
-
|
|
1629
|
+
if (!d.length) return { width: 0, height: 0 };
|
|
1630
|
+
if (x) return or(d, x, F, s.spacing ?? 64, S);
|
|
1631
|
+
if (y === void 0 && s.layers)
|
|
1632
|
+
return an(d, a, s, w, S);
|
|
1633
|
+
const P = /* @__PURE__ */ new Map();
|
|
1634
|
+
for (const m of a.edges) {
|
|
1635
|
+
const c = w(m.source, y), k = w(m.target, y);
|
|
1636
|
+
if (!c || !k || c.id === k.id) continue;
|
|
1637
|
+
const G = JSON.stringify([c.id, k.id]);
|
|
1638
|
+
P.has(G) || P.set(G, { id: m.id, sources: [c.id], targets: [k.id] });
|
|
1629
1639
|
}
|
|
1630
|
-
const
|
|
1631
|
-
id:
|
|
1632
|
-
children:
|
|
1633
|
-
edges: [...
|
|
1640
|
+
const j = await b.layout({
|
|
1641
|
+
id: y ?? R,
|
|
1642
|
+
children: d.map((m) => ({ id: m.id, width: m.width, height: m.height })),
|
|
1643
|
+
edges: [...P.values()],
|
|
1634
1644
|
layoutOptions: {
|
|
1635
|
-
"elk.algorithm":
|
|
1636
|
-
"elk.direction":
|
|
1645
|
+
"elk.algorithm": P.size ? "layered" : "rectpacking",
|
|
1646
|
+
"elk.direction": N,
|
|
1637
1647
|
"elk.edgeRouting": "ORTHOGONAL",
|
|
1638
1648
|
"elk.separateConnectedComponents": "true",
|
|
1639
1649
|
...s.aspectRatio !== void 0 ? { "elk.aspectRatio": String(s.aspectRatio) } : {},
|
|
@@ -1641,99 +1651,99 @@ async function on(a, s, b) {
|
|
|
1641
1651
|
"elk.spacing.nodeNode": String(s.spacing ?? 64),
|
|
1642
1652
|
"elk.layered.spacing.nodeNodeBetweenLayers": String(s.spacing ?? 64),
|
|
1643
1653
|
"elk.layered.considerModelOrder.strategy": "NODES",
|
|
1644
|
-
"elk.padding":
|
|
1654
|
+
"elk.padding": y ? `[top=${F.top},left=${F.left},bottom=${F.bottom},right=${F.right}]` : "[top=12,left=12,bottom=12,right=12]",
|
|
1645
1655
|
"elk.randomSeed": "1"
|
|
1646
1656
|
}
|
|
1647
1657
|
});
|
|
1648
|
-
for (const
|
|
1649
|
-
const c = o.get(
|
|
1650
|
-
|
|
1658
|
+
for (const m of j.children ?? []) {
|
|
1659
|
+
const c = o.get(m.id);
|
|
1660
|
+
S(c, (m.x ?? 0) - c.x, (m.y ?? 0) - c.y);
|
|
1651
1661
|
}
|
|
1652
|
-
return { width:
|
|
1653
|
-
}, v = await
|
|
1654
|
-
if (
|
|
1655
|
-
const
|
|
1656
|
-
for (const
|
|
1662
|
+
return { width: j.width ?? 0, height: j.height ?? 0 };
|
|
1663
|
+
}, v = await M(), I = (!s.positions?.length || s.positionMode === "compact" || s.layers) && s.anchor && o.get(s.anchor.nodeId);
|
|
1664
|
+
if (I) {
|
|
1665
|
+
const y = s.anchor.position.x - I.x, d = s.anchor.position.y - I.y;
|
|
1666
|
+
for (const x of C.get(void 0) ?? []) S(x, y, d);
|
|
1657
1667
|
}
|
|
1658
|
-
const
|
|
1668
|
+
const f = {
|
|
1659
1669
|
nodes: [...o.values()],
|
|
1660
|
-
edges: a.edges.map((
|
|
1670
|
+
edges: a.edges.map((y) => ({ ...y, sections: [] })),
|
|
1661
1671
|
bounds: { x: 0, y: 0, ...v }
|
|
1662
1672
|
};
|
|
1663
|
-
return s.positions?.length && s.positionMode !== "compact" && !s.layers ? ar(
|
|
1673
|
+
return s.positions?.length && s.positionMode !== "compact" && !s.layers ? ar(f, s, a.nodes) : Xe(f, s);
|
|
1664
1674
|
}
|
|
1665
1675
|
function an(a, s, b, o, u) {
|
|
1666
|
-
const
|
|
1667
|
-
(b.positions ?? []).filter((
|
|
1668
|
-
), l = (
|
|
1669
|
-
for (const
|
|
1670
|
-
const
|
|
1671
|
-
|
|
1676
|
+
const C = b.direction ?? "RIGHT", _ = C === "RIGHT" || C === "LEFT", R = C === "RIGHT" || C === "DOWN", F = new Map(a.map((T, A) => [T.id, A])), N = new Map(
|
|
1677
|
+
(b.positions ?? []).filter((T) => F.has(T.nodeId)).map((T) => [T.nodeId, _ ? T.y : T.x])
|
|
1678
|
+
), l = (T, A) => F.get(T) - F.get(A) || T.localeCompare(A), S = (T, A) => (N.get(T) ?? 1 / 0) - (N.get(A) ?? 1 / 0) || l(T, A), w = new Map(a.map((T) => [T.id, /* @__PURE__ */ new Set()]));
|
|
1679
|
+
for (const T of s.edges) {
|
|
1680
|
+
const A = o(T.source, void 0)?.id, L = o(T.target, void 0)?.id;
|
|
1681
|
+
A && L && A !== L && (w.get(A)?.add(L), w.get(L)?.add(A));
|
|
1672
1682
|
}
|
|
1673
|
-
const
|
|
1674
|
-
|
|
1675
|
-
const
|
|
1676
|
-
for (const
|
|
1677
|
-
if (!
|
|
1678
|
-
const
|
|
1679
|
-
|
|
1680
|
-
for (let
|
|
1681
|
-
const H =
|
|
1682
|
-
|
|
1683
|
+
const M = b.layers ?? [], v = /* @__PURE__ */ new Map();
|
|
1684
|
+
M.forEach((T, A) => T.forEach((L) => v.set(L, A)));
|
|
1685
|
+
const I = new Set(a.map((T) => T.id)), f = [];
|
|
1686
|
+
for (const T of [...I].sort(l)) {
|
|
1687
|
+
if (!I.has(T)) continue;
|
|
1688
|
+
const A = [], L = [T];
|
|
1689
|
+
I.delete(T);
|
|
1690
|
+
for (let U = 0; U < L.length; U++) {
|
|
1691
|
+
const H = L[U];
|
|
1692
|
+
A.push(H);
|
|
1683
1693
|
for (const D of [...w.get(H)].sort(l))
|
|
1684
|
-
|
|
1694
|
+
I.delete(D) && L.push(D);
|
|
1685
1695
|
}
|
|
1686
|
-
|
|
1696
|
+
f.push(A);
|
|
1687
1697
|
}
|
|
1688
|
-
let
|
|
1689
|
-
for (const
|
|
1690
|
-
const
|
|
1691
|
-
if (!
|
|
1692
|
-
|
|
1698
|
+
let y = M.length;
|
|
1699
|
+
for (const T of f) {
|
|
1700
|
+
const A = T.filter((H) => v.has(H));
|
|
1701
|
+
if (!A.length) {
|
|
1702
|
+
T.sort(l).forEach((H) => v.set(H, y)), y++;
|
|
1693
1703
|
continue;
|
|
1694
1704
|
}
|
|
1695
|
-
const
|
|
1696
|
-
for (const H of
|
|
1697
|
-
for (let H = 0; H <
|
|
1698
|
-
const D =
|
|
1705
|
+
const L = /* @__PURE__ */ new Map(), U = [...A].sort((H, D) => v.get(H) - v.get(D) || l(H, D));
|
|
1706
|
+
for (const H of U) L.set(H, 0);
|
|
1707
|
+
for (let H = 0; H < U.length; H++) {
|
|
1708
|
+
const D = U[H];
|
|
1699
1709
|
for (const z of [...w.get(D)].sort(l))
|
|
1700
|
-
|
|
1710
|
+
L.has(z) || (L.set(z, L.get(D) + 1), v.set(z, v.get(D)), U.push(z));
|
|
1701
1711
|
}
|
|
1702
1712
|
}
|
|
1703
|
-
const
|
|
1704
|
-
for (const
|
|
1705
|
-
for (const
|
|
1706
|
-
const
|
|
1707
|
-
const
|
|
1713
|
+
const d = Math.max(M.length, y), x = Array.from({ length: d }, () => []);
|
|
1714
|
+
for (const T of a) x[v.get(T.id)].push(T);
|
|
1715
|
+
for (const T of x) T.sort((A, L) => S(A.id, L.id));
|
|
1716
|
+
const P = (T, A) => {
|
|
1717
|
+
const L = new Map(x[A].map((D, z) => [D.id, z])), U = new Map(x[T].map((D, z) => [D.id, z])), H = (D) => {
|
|
1708
1718
|
const z = [...w.get(D) ?? []].flatMap((Z) => {
|
|
1709
|
-
const oe =
|
|
1710
|
-
return v.get(Z) ===
|
|
1719
|
+
const oe = L.get(Z);
|
|
1720
|
+
return v.get(Z) === A && oe !== void 0 ? [oe] : [];
|
|
1711
1721
|
});
|
|
1712
|
-
return z.length ? z.reduce((Z, oe) => Z + oe, 0) / z.length :
|
|
1722
|
+
return z.length ? z.reduce((Z, oe) => Z + oe, 0) / z.length : U.get(D);
|
|
1713
1723
|
};
|
|
1714
|
-
|
|
1724
|
+
x[T].sort((D, z) => H(D.id) - H(z.id) || S(D.id, z.id));
|
|
1715
1725
|
};
|
|
1716
|
-
for (let
|
|
1717
|
-
for (let
|
|
1718
|
-
const
|
|
1719
|
-
let
|
|
1720
|
-
const
|
|
1721
|
-
for (const
|
|
1722
|
-
let
|
|
1723
|
-
const
|
|
1724
|
-
|
|
1725
|
-
for (const
|
|
1726
|
-
const H =
|
|
1727
|
-
u(
|
|
1726
|
+
for (let T = 1; T < x.length; T++) P(T, T - 1);
|
|
1727
|
+
for (let T = x.length - 2; T >= 0; T--) P(T, T + 1);
|
|
1728
|
+
const j = b.spacing ?? 64;
|
|
1729
|
+
let m = 0, c = 0;
|
|
1730
|
+
const k = [], G = [];
|
|
1731
|
+
for (const T of x) {
|
|
1732
|
+
let A = 0;
|
|
1733
|
+
const L = Math.max(0, ...T.map((U) => _ ? U.width : U.height));
|
|
1734
|
+
k.push(m), G.push(L);
|
|
1735
|
+
for (const U of T) {
|
|
1736
|
+
const H = m + (L - (_ ? U.width : U.height)) / 2, D = _ ? H : A, z = _ ? A : H;
|
|
1737
|
+
u(U, D - U.x, z - U.y), A += (_ ? U.height : U.width) + j;
|
|
1728
1738
|
}
|
|
1729
|
-
c = Math.max(c, Math.max(0,
|
|
1739
|
+
c = Math.max(c, Math.max(0, A - j)), m += L + j;
|
|
1730
1740
|
}
|
|
1731
|
-
if (
|
|
1732
|
-
for (const
|
|
1733
|
-
const
|
|
1734
|
-
u(
|
|
1741
|
+
if (m = Math.max(0, m - j), !R)
|
|
1742
|
+
for (const T of a) {
|
|
1743
|
+
const A = v.get(T.id), U = m - k[A] - G[A] + (G[A] - (_ ? T.width : T.height)) / 2;
|
|
1744
|
+
u(T, _ ? U - T.x : 0, _ ? 0 : U - T.y);
|
|
1735
1745
|
}
|
|
1736
|
-
return _ ? { width:
|
|
1746
|
+
return _ ? { width: m, height: c } : { width: c, height: m };
|
|
1737
1747
|
}
|
|
1738
1748
|
function sr(a) {
|
|
1739
1749
|
const s = /* @__PURE__ */ new Set(), b = (u) => {
|
|
@@ -1741,27 +1751,27 @@ function sr(a) {
|
|
|
1741
1751
|
s.add(u);
|
|
1742
1752
|
}, o = new Map(a.nodes.map((u) => [u.id, u]));
|
|
1743
1753
|
for (const u of a.nodes) {
|
|
1744
|
-
if (b(u.id), ![u.width, u.height].every((
|
|
1754
|
+
if (b(u.id), ![u.width, u.height].every((R) => Number.isFinite(R) && R > 0))
|
|
1745
1755
|
throw new Error(`Invalid dimensions for graph node: ${u.id}`);
|
|
1746
|
-
for (const
|
|
1747
|
-
const
|
|
1756
|
+
for (const R of u.ports ?? []) b(R.id);
|
|
1757
|
+
const C = /* @__PURE__ */ new Set([u.id]);
|
|
1748
1758
|
let _ = u.parentId;
|
|
1749
1759
|
for (; _ !== void 0; ) {
|
|
1750
|
-
const
|
|
1751
|
-
if (!
|
|
1760
|
+
const R = o.get(_);
|
|
1761
|
+
if (!R || R.kind !== "group")
|
|
1752
1762
|
throw new Error(`Invalid parent for graph node: ${u.id}`);
|
|
1753
|
-
if (
|
|
1754
|
-
|
|
1763
|
+
if (C.has(_)) throw new Error(`Cyclic graph containment: ${u.id}`);
|
|
1764
|
+
C.add(_), _ = R.parentId;
|
|
1755
1765
|
}
|
|
1756
1766
|
}
|
|
1757
1767
|
for (const u of a.edges) {
|
|
1758
1768
|
b(u.id);
|
|
1759
|
-
for (const [
|
|
1769
|
+
for (const [C, _] of [
|
|
1760
1770
|
[u.source, u.sourcePort],
|
|
1761
1771
|
[u.target, u.targetPort]
|
|
1762
1772
|
]) {
|
|
1763
|
-
const
|
|
1764
|
-
if (!
|
|
1773
|
+
const R = o.get(C);
|
|
1774
|
+
if (!R || _ !== void 0 && !R.ports?.some((F) => F.id === _))
|
|
1765
1775
|
throw new Error(`Invalid endpoint for graph edge: ${u.id}`);
|
|
1766
1776
|
}
|
|
1767
1777
|
}
|
|
@@ -1777,24 +1787,24 @@ async function sn(a, s, b) {
|
|
|
1777
1787
|
if (s.aspectRatio !== void 0 && (!Number.isFinite(s.aspectRatio) || s.aspectRatio <= 0))
|
|
1778
1788
|
throw new Error("Graph layout aspect ratio must be finite and positive");
|
|
1779
1789
|
const u = s.groupPadding ?? { top: 64, right: 28, bottom: 28, left: 28 };
|
|
1780
|
-
if (![...Object.values(u), s.spacing ?? 64].every((
|
|
1790
|
+
if (![...Object.values(u), s.spacing ?? 64].every((d) => Number.isFinite(d) && d >= 0))
|
|
1781
1791
|
throw new Error("Graph layout spacing must be finite and nonnegative");
|
|
1782
1792
|
if (s.layers && (dn(a, s.layers), s.positionMode === "fixed" && s.positions?.length))
|
|
1783
1793
|
throw new Error("Fixed positions cannot be combined with graph layers");
|
|
1784
1794
|
if (s.aspectRatio !== void 0 || s.layers || Object.keys(s.groupLayouts ?? {}).length)
|
|
1785
1795
|
return on(o, s, b);
|
|
1786
|
-
const
|
|
1787
|
-
for (const
|
|
1788
|
-
|
|
1789
|
-
id:
|
|
1790
|
-
width:
|
|
1791
|
-
height:
|
|
1792
|
-
...
|
|
1793
|
-
ports:
|
|
1794
|
-
id:
|
|
1796
|
+
const C = /* @__PURE__ */ new Map();
|
|
1797
|
+
for (const d of o.nodes)
|
|
1798
|
+
C.set(d.id, {
|
|
1799
|
+
id: d.id,
|
|
1800
|
+
width: d.width,
|
|
1801
|
+
height: d.height,
|
|
1802
|
+
...d.kind === "group" ? { children: [] } : {},
|
|
1803
|
+
ports: d.ports?.map((x) => ({
|
|
1804
|
+
id: x.id,
|
|
1795
1805
|
width: 1,
|
|
1796
1806
|
height: 1,
|
|
1797
|
-
layoutOptions: { "elk.port.side":
|
|
1807
|
+
layoutOptions: { "elk.port.side": x.side }
|
|
1798
1808
|
})),
|
|
1799
1809
|
layoutOptions: {
|
|
1800
1810
|
"elk.portConstraints": "FIXED_ORDER",
|
|
@@ -1802,21 +1812,21 @@ async function sn(a, s, b) {
|
|
|
1802
1812
|
}
|
|
1803
1813
|
});
|
|
1804
1814
|
const _ = [];
|
|
1805
|
-
for (const
|
|
1806
|
-
(
|
|
1807
|
-
const
|
|
1808
|
-
...o.nodes.flatMap((
|
|
1809
|
-
...o.edges.map((
|
|
1815
|
+
for (const d of o.nodes)
|
|
1816
|
+
(d.parentId ? C.get(d.parentId).children : _).push(C.get(d.id));
|
|
1817
|
+
const R = /* @__PURE__ */ new Set([
|
|
1818
|
+
...o.nodes.flatMap((d) => [d.id, ...(d.ports ?? []).map((x) => x.id)]),
|
|
1819
|
+
...o.edges.map((d) => d.id)
|
|
1810
1820
|
]);
|
|
1811
|
-
let
|
|
1812
|
-
for (;
|
|
1813
|
-
const
|
|
1814
|
-
id:
|
|
1821
|
+
let F = "$graph";
|
|
1822
|
+
for (; R.has(F); ) F += "$";
|
|
1823
|
+
const N = await b.layout({
|
|
1824
|
+
id: F,
|
|
1815
1825
|
children: _,
|
|
1816
|
-
edges: o.edges.map((
|
|
1817
|
-
id:
|
|
1818
|
-
sources: [
|
|
1819
|
-
targets: [
|
|
1826
|
+
edges: o.edges.map((d) => ({
|
|
1827
|
+
id: d.id,
|
|
1828
|
+
sources: [d.sourcePort ?? d.source],
|
|
1829
|
+
targets: [d.targetPort ?? d.target]
|
|
1820
1830
|
})),
|
|
1821
1831
|
layoutOptions: {
|
|
1822
1832
|
"elk.algorithm": "layered",
|
|
@@ -1828,41 +1838,41 @@ async function sn(a, s, b) {
|
|
|
1828
1838
|
"elk.layered.considerModelOrder.strategy": "NODES",
|
|
1829
1839
|
"elk.randomSeed": "1"
|
|
1830
1840
|
}
|
|
1831
|
-
}), l = /* @__PURE__ */ new Map(),
|
|
1832
|
-
for (const
|
|
1833
|
-
const
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
(
|
|
1837
|
-
(
|
|
1838
|
-
x: c.x +
|
|
1839
|
-
y: c.y +
|
|
1841
|
+
}), l = /* @__PURE__ */ new Map(), S = /* @__PURE__ */ new Map(), w = (d) => {
|
|
1842
|
+
for (const x of d.edges ?? []) {
|
|
1843
|
+
const P = x.container ?? d.id, j = l.get(P) ?? { x: 0, y: 0 };
|
|
1844
|
+
S.set(
|
|
1845
|
+
x.id,
|
|
1846
|
+
(x.sections ?? []).map(
|
|
1847
|
+
(m) => [m.startPoint, ...m.bendPoints ?? [], m.endPoint].map((c) => ({
|
|
1848
|
+
x: c.x + j.x,
|
|
1849
|
+
y: c.y + j.y
|
|
1840
1850
|
}))
|
|
1841
1851
|
)
|
|
1842
1852
|
);
|
|
1843
1853
|
}
|
|
1844
|
-
for (const
|
|
1845
|
-
},
|
|
1846
|
-
const
|
|
1847
|
-
l.set(
|
|
1848
|
-
for (const c of
|
|
1854
|
+
for (const x of d.children ?? []) w(x);
|
|
1855
|
+
}, M = (d, x, P) => {
|
|
1856
|
+
const j = x + (d.x ?? 0), m = P + (d.y ?? 0);
|
|
1857
|
+
l.set(d.id, { x: j, y: m, width: d.width ?? 0, height: d.height ?? 0 });
|
|
1858
|
+
for (const c of d.children ?? []) M(c, j, m);
|
|
1849
1859
|
};
|
|
1850
|
-
for (const
|
|
1851
|
-
w(
|
|
1852
|
-
const v = (!s.positions?.length || s.positionMode === "compact") && s.anchor && l.get(s.anchor.nodeId),
|
|
1853
|
-
const
|
|
1854
|
-
return { ...
|
|
1860
|
+
for (const d of N.children ?? []) M(d, 0, 0);
|
|
1861
|
+
w(N);
|
|
1862
|
+
const v = (!s.positions?.length || s.positionMode === "compact") && s.anchor && l.get(s.anchor.nodeId), I = v ? s.anchor.position.x - v.x : 0, f = v ? s.anchor.position.y - v.y : 0, y = o.nodes.map((d) => {
|
|
1863
|
+
const x = l.get(d.id);
|
|
1864
|
+
return { ...d, ...x, x: x.x + I, y: x.y + f };
|
|
1855
1865
|
});
|
|
1856
1866
|
return ar(
|
|
1857
1867
|
{
|
|
1858
|
-
nodes:
|
|
1859
|
-
edges: o.edges.map((
|
|
1860
|
-
...
|
|
1861
|
-
sections: (
|
|
1862
|
-
(
|
|
1868
|
+
nodes: y,
|
|
1869
|
+
edges: o.edges.map((d) => ({
|
|
1870
|
+
...d,
|
|
1871
|
+
sections: (S.get(d.id) ?? []).map(
|
|
1872
|
+
(x) => x.map((P) => ({ x: P.x + I, y: P.y + f }))
|
|
1863
1873
|
)
|
|
1864
1874
|
})),
|
|
1865
|
-
bounds: { x:
|
|
1875
|
+
bounds: { x: I, y: f, width: N.width ?? 0, height: N.height ?? 0 }
|
|
1866
1876
|
},
|
|
1867
1877
|
s,
|
|
1868
1878
|
o.nodes
|
|
@@ -1888,10 +1898,10 @@ function un(a, s) {
|
|
|
1888
1898
|
_.nodeId,
|
|
1889
1899
|
b === "RIGHT" || b === "LEFT" ? _.y : _.x
|
|
1890
1900
|
])
|
|
1891
|
-
), u = new Map(a.nodes.map((_,
|
|
1892
|
-
return { nodes: [...a.nodes].sort((_,
|
|
1893
|
-
const
|
|
1894
|
-
return
|
|
1901
|
+
), u = new Map(a.nodes.map((_, R) => [_.id, R]));
|
|
1902
|
+
return { nodes: [...a.nodes].sort((_, R) => {
|
|
1903
|
+
const F = (_.parentId ?? "").localeCompare(R.parentId ?? ""), N = s.layers && !_.parentId && !R.parentId || _.parentId === R.parentId && _.parentId && s.groupLayouts?.[_.parentId] ? 0 : (o.get(_.id) ?? 1 / 0) - (o.get(R.id) ?? 1 / 0);
|
|
1904
|
+
return F || N || u.get(_.id) - u.get(R.id);
|
|
1895
1905
|
}), edges: a.edges };
|
|
1896
1906
|
}
|
|
1897
1907
|
function ln(a, s) {
|
|
@@ -1910,11 +1920,11 @@ function ln(a, s) {
|
|
|
1910
1920
|
}
|
|
1911
1921
|
function dn(a, s) {
|
|
1912
1922
|
const b = new Map(a.nodes.map((u) => [u.id, u])), o = /* @__PURE__ */ new Set();
|
|
1913
|
-
for (const [u,
|
|
1914
|
-
if (!
|
|
1915
|
-
for (const _ of
|
|
1916
|
-
const
|
|
1917
|
-
if (!
|
|
1923
|
+
for (const [u, C] of s.entries()) {
|
|
1924
|
+
if (!C.length) throw new Error(`Graph layer must not be empty: ${u}`);
|
|
1925
|
+
for (const _ of C) {
|
|
1926
|
+
const R = b.get(_);
|
|
1927
|
+
if (!R || R.parentId) throw new Error(`Graph layer object must be a root node: ${_}`);
|
|
1918
1928
|
if (o.has(_)) throw new Error(`Graph object appears in multiple layers: ${_}`);
|
|
1919
1929
|
o.add(_);
|
|
1920
1930
|
}
|