@milaboratories/pl-middle-layer 1.27.0 → 1.27.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +760 -734
- package/dist/index.mjs.map +1 -1
- package/dist/pool/data.d.ts.map +1 -1
- package/dist/pool/driver.d.ts.map +1 -1
- package/package.json +8 -8
- package/src/pool/data.ts +38 -31
- package/src/pool/driver.ts +48 -30
package/dist/index.mjs
CHANGED
|
@@ -1,62 +1,62 @@
|
|
|
1
1
|
var Cs = Object.defineProperty;
|
|
2
|
-
var
|
|
2
|
+
var Ht = (s, e) => (e = Symbol[s]) ? e : Symbol.for("Symbol." + s), Wt = (s) => {
|
|
3
3
|
throw TypeError(s);
|
|
4
4
|
};
|
|
5
5
|
var Es = (s, e, t) => e in s ? Cs(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t;
|
|
6
6
|
var S = (s, e, t) => Es(s, typeof e != "symbol" ? e + "" : e, t);
|
|
7
|
-
var
|
|
7
|
+
var je = (s, e, t) => {
|
|
8
8
|
if (e != null) {
|
|
9
|
-
typeof e != "object" && typeof e != "function" &&
|
|
9
|
+
typeof e != "object" && typeof e != "function" && Wt("Object expected");
|
|
10
10
|
var r;
|
|
11
|
-
t && (r = e[
|
|
11
|
+
t && (r = e[Ht("asyncDispose")]), r === void 0 && (r = e[Ht("dispose")]), typeof r != "function" && Wt("Object not disposable"), s.push([t, r, e]);
|
|
12
12
|
} else t && s.push([t]);
|
|
13
13
|
return e;
|
|
14
|
-
},
|
|
15
|
-
var r = typeof SuppressedError == "function" ? SuppressedError : function(i,
|
|
16
|
-
return l = Error(
|
|
14
|
+
}, xe = (s, e, t) => {
|
|
15
|
+
var r = typeof SuppressedError == "function" ? SuppressedError : function(i, a, c, l) {
|
|
16
|
+
return l = Error(c), l.name = "SuppressedError", l.error = i, l.suppressed = a, l;
|
|
17
17
|
}, o = (i) => e = t ? new r(i, e, "An error was suppressed during disposal") : (t = !0, i), n = (i) => {
|
|
18
18
|
for (; i = s.pop(); )
|
|
19
19
|
try {
|
|
20
|
-
var
|
|
21
|
-
if (i[0]) return Promise.resolve(
|
|
22
|
-
} catch (
|
|
23
|
-
o(
|
|
20
|
+
var a = i[1] && i[1].call(i[2]);
|
|
21
|
+
if (i[0]) return Promise.resolve(a).then(n, (c) => (o(c), n()));
|
|
22
|
+
} catch (c) {
|
|
23
|
+
o(c);
|
|
24
24
|
}
|
|
25
25
|
if (t) throw e;
|
|
26
26
|
};
|
|
27
27
|
return n();
|
|
28
28
|
};
|
|
29
|
-
import { mapValueInVOE as Br, executePSpecPredicate as Ps, mapPObjectData as ue, mapPTableDef as
|
|
29
|
+
import { mapValueInVOE as Br, executePSpecPredicate as Ps, mapPObjectData as ue, mapPTableDef as vt, JsRenderInternal as ks, extractConfig as jr, isConfigLambda as xr, DefaultNavigationState as Os, extractAllColumns as $s } from "@platforma-sdk/model";
|
|
30
30
|
export * from "@platforma-sdk/model";
|
|
31
|
-
import { AnyChannel as we, StableChannel as ae, InitialBlockSettings as
|
|
31
|
+
import { AnyChannel as we, StableChannel as ae, InitialBlockSettings as qt, blockPackIdToString as Fs } from "@milaboratories/pl-model-middle-layer";
|
|
32
32
|
export * from "@milaboratories/pl-model-middle-layer";
|
|
33
33
|
export * from "@milaboratories/pl-deployments";
|
|
34
34
|
import { request as ce, RetryAgent as Is } from "undici";
|
|
35
|
-
import { RegistryV1 as de, tryLoadPackDescription as
|
|
35
|
+
import { RegistryV1 as de, tryLoadPackDescription as yt, BlockPackMetaEmbedAbsoluteBytes as As, RegistryV2Reader as Ts, folderReaderByUrl as Ls, loadPackDescription as zt } from "@platforma-sdk/block-tools";
|
|
36
36
|
import X from "node:fs";
|
|
37
37
|
import G from "node:path";
|
|
38
38
|
import Ns from "yaml";
|
|
39
39
|
import { assertNever as M, notEmpty as B, ConsoleLoggerAdapter as Ds, ConcurrencyLimitingExecutor as Bs, HmacSha256Signer as Vr } from "@milaboratories/ts-helpers";
|
|
40
40
|
import * as Ur from "node:fs/promises";
|
|
41
41
|
import { tryResolve as js } from "@milaboratories/resolve-helper";
|
|
42
|
-
import { resourceTypesEqual as le, field as j, Pl as L, PlClient as xs, isNullResourceId as
|
|
42
|
+
import { resourceTypesEqual as le, field as j, Pl as L, PlClient as xs, isNullResourceId as Xe, ensureResourceIdNotNull as wt, isResource as Vs, isResourceRef as Us, isNotNullResourceId as Xt, resourceType as Ne, resourceTypeToString as Js, resourceIdToString as Jr, isNotFoundError as Gs, isTimeoutOrCancelError as Ms, toGlobalResourceId as _s, plAddressToConfig as Ks, UnauthenticatedPlClient as Yt } from "@milaboratories/pl-client";
|
|
43
43
|
export * from "@milaboratories/pl-client";
|
|
44
44
|
import { SynchronizedTreeState as Gr, PlError as Hs, isPlTreeNodeAccessor as Ws } from "@milaboratories/pl-tree";
|
|
45
|
-
import { Computable as U, ChangeSource as
|
|
46
|
-
import { randomUUID as
|
|
47
|
-
import { parseTemplate as Xs, PlTemplateV1 as ie, PlTemplateOverrideV1 as ke, PlTemplateLibV1 as
|
|
45
|
+
import { Computable as U, ChangeSource as Qt, PollComputablePool as qs, WatchableValue as zs } from "@milaboratories/computable";
|
|
46
|
+
import { randomUUID as Ae, createHash as De } from "node:crypto";
|
|
47
|
+
import { parseTemplate as Xs, PlTemplateV1 as ie, PlTemplateOverrideV1 as ke, PlTemplateLibV1 as Ve, PlTemplateSoftwareV1 as be } from "@milaboratories/pl-model-backend";
|
|
48
48
|
import Mr from "denque";
|
|
49
49
|
import { Templates as Ys } from "@platforma-sdk/workflow-tengo";
|
|
50
|
-
import
|
|
50
|
+
import Q from "canonicalize";
|
|
51
51
|
import Qs from "node:assert";
|
|
52
|
-
import { Scope as
|
|
52
|
+
import { Scope as St, getQuickJS as Zs } from "quickjs-emscripten";
|
|
53
53
|
import { setTimeout as _r } from "node:timers/promises";
|
|
54
54
|
import { createDownloadClient as eo, createLogsClient as to, createUploadBlobClient as ro, createUploadProgressClient as so, DownloadDriver as oo, DownloadBlobToURLDriver as no, UploadDriver as io, LogsStreamDriver as ao, LogsDriver as co, LsDriver as lo, DownloadUrlDriver as uo } from "@milaboratories/pl-drivers";
|
|
55
|
-
import { PFrame as
|
|
55
|
+
import { PFrame as Ue } from "@milaboratories/pframes-node";
|
|
56
56
|
import { PFrame as po } from "@milaboratories/pframes-rs-node";
|
|
57
57
|
import { LRUCache as ho } from "lru-cache";
|
|
58
58
|
import { channel as fo } from "node:diagnostics_channel";
|
|
59
|
-
async function
|
|
59
|
+
async function Zt(s) {
|
|
60
60
|
try {
|
|
61
61
|
return await Ur.stat(s, { bigint: !0 });
|
|
62
62
|
} catch (e) {
|
|
@@ -65,30 +65,30 @@ async function Qt(s) {
|
|
|
65
65
|
throw e;
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
|
-
const go = [de.PlPackageYamlConfigFile], mo = [de.PlPackageJsonConfigFile],
|
|
69
|
-
Ft,
|
|
68
|
+
const go = [de.PlPackageYamlConfigFile], mo = [de.PlPackageJsonConfigFile], It = ["backend", "dist", "tengo", "tpl", "main.plj.gz"], At = ["config", "dist", "config.json"], Kr = ["frontend", "dist"], er = "block-model/dist/config.json", vo = "block-ui/package.json", yo = [
|
|
70
69
|
It,
|
|
70
|
+
At,
|
|
71
71
|
go,
|
|
72
72
|
mo,
|
|
73
73
|
Kr
|
|
74
74
|
];
|
|
75
75
|
async function wo(s) {
|
|
76
|
-
return await
|
|
76
|
+
return await Zt(G.join(s, ...At)) !== void 0 || await Zt(G.join(s, ...It)) !== void 0;
|
|
77
77
|
}
|
|
78
|
-
function
|
|
78
|
+
function ct(s, e) {
|
|
79
79
|
const t = js(s, e);
|
|
80
80
|
if (t === void 0) throw new Error(`Can't resolve ${e} against ${s}`);
|
|
81
81
|
return t;
|
|
82
82
|
}
|
|
83
|
-
async function
|
|
83
|
+
async function tr(s, e) {
|
|
84
84
|
if (G.isAbsolute(s) || (s = G.resolve(s)), await wo(s))
|
|
85
85
|
return {
|
|
86
|
-
workflow: G.join(s, ...
|
|
87
|
-
config: G.join(s, ...
|
|
86
|
+
workflow: G.join(s, ...It),
|
|
87
|
+
config: G.join(s, ...At),
|
|
88
88
|
ui: G.join(s, ...Kr)
|
|
89
89
|
};
|
|
90
90
|
{
|
|
91
|
-
const t =
|
|
91
|
+
const t = ct(s, er), r = ct(s, er), o = ct(s, vo);
|
|
92
92
|
return { workflow: t, config: r, ui: G.resolve(o, "..", "dist") };
|
|
93
93
|
}
|
|
94
94
|
}
|
|
@@ -118,7 +118,7 @@ async function Hr(s) {
|
|
|
118
118
|
}
|
|
119
119
|
return e.toString();
|
|
120
120
|
}
|
|
121
|
-
async function
|
|
121
|
+
async function Tt(s) {
|
|
122
122
|
const e = await X.promises.stat(s.components.workflow.main.file, {
|
|
123
123
|
bigint: !0
|
|
124
124
|
}), t = await X.promises.stat(s.components.model.file, { bigint: !0 });
|
|
@@ -136,9 +136,9 @@ class ql {
|
|
|
136
136
|
`${r.url}/${de.GlobalOverviewPath}`,
|
|
137
137
|
o
|
|
138
138
|
)).body.json();
|
|
139
|
-
for (const
|
|
140
|
-
const { organization:
|
|
141
|
-
organization:
|
|
139
|
+
for (const a of i) {
|
|
140
|
+
const { organization: c, package: l, latestMeta: u, latestVersion: d } = a, f = {
|
|
141
|
+
organization: c,
|
|
142
142
|
name: l,
|
|
143
143
|
version: d
|
|
144
144
|
}, h = {
|
|
@@ -147,7 +147,7 @@ class ql {
|
|
|
147
147
|
title: u.title ?? "No title",
|
|
148
148
|
description: u.description ?? "No Description",
|
|
149
149
|
organization: {
|
|
150
|
-
name:
|
|
150
|
+
name: c,
|
|
151
151
|
url: "https://unknown.com"
|
|
152
152
|
}
|
|
153
153
|
},
|
|
@@ -164,32 +164,32 @@ class ql {
|
|
|
164
164
|
[we]: h,
|
|
165
165
|
[ae]: h
|
|
166
166
|
},
|
|
167
|
-
allVersions:
|
|
167
|
+
allVersions: a.allVersions.map((g) => ({ version: g, channels: [] }))
|
|
168
168
|
});
|
|
169
169
|
}
|
|
170
170
|
return t;
|
|
171
171
|
case "remote-v2":
|
|
172
172
|
return (await this.v2Provider.getRegistry(r.url).listBlockPacks()).map(
|
|
173
|
-
(
|
|
174
|
-
...
|
|
173
|
+
(a) => a.latestByChannel[ae] ? {
|
|
174
|
+
...a,
|
|
175
175
|
registryId: e.id
|
|
176
176
|
} : {
|
|
177
|
-
...
|
|
177
|
+
...a,
|
|
178
178
|
latestByChannel: {
|
|
179
|
-
...
|
|
180
|
-
[ae]: ((
|
|
179
|
+
...a.latestByChannel,
|
|
180
|
+
[ae]: ((c) => c.spec.type === "from-registry-v2" ? { ...c, spec: { ...c.spec, channel: ae } } : c)(a.latestByChannel[we])
|
|
181
181
|
},
|
|
182
182
|
registryId: e.id
|
|
183
183
|
}
|
|
184
184
|
);
|
|
185
185
|
case "local-dev":
|
|
186
|
-
for (const
|
|
187
|
-
if (!
|
|
188
|
-
const
|
|
189
|
-
G.join(
|
|
186
|
+
for (const a of await X.promises.readdir(r.path, { withFileTypes: !0 })) {
|
|
187
|
+
if (!a.isDirectory()) continue;
|
|
188
|
+
const c = G.join(r.path, a.name), l = await So(
|
|
189
|
+
G.join(c, de.PlPackageYamlConfigFile)
|
|
190
190
|
);
|
|
191
191
|
if (l !== void 0) {
|
|
192
|
-
const u = de.PlPackageConfigData.parse(Ns.parse(l)), d = await Hr(
|
|
192
|
+
const u = de.PlPackageConfigData.parse(Ns.parse(l)), d = await Hr(c), f = {
|
|
193
193
|
organization: u.organization,
|
|
194
194
|
name: u.package,
|
|
195
195
|
version: "DEV"
|
|
@@ -205,7 +205,7 @@ class ql {
|
|
|
205
205
|
},
|
|
206
206
|
spec: {
|
|
207
207
|
type: "dev-v2",
|
|
208
|
-
folder:
|
|
208
|
+
folder: c,
|
|
209
209
|
mtime: d
|
|
210
210
|
}
|
|
211
211
|
};
|
|
@@ -219,13 +219,13 @@ class ql {
|
|
|
219
219
|
allVersions: []
|
|
220
220
|
});
|
|
221
221
|
} else {
|
|
222
|
-
let u =
|
|
222
|
+
let u = c, d = await yt(u);
|
|
223
223
|
if (d === void 0) {
|
|
224
224
|
for (const f of ["block", "meta"])
|
|
225
|
-
if (u = G.join(
|
|
225
|
+
if (u = G.join(c, f), d = await yt(u), d !== void 0) break;
|
|
226
226
|
}
|
|
227
227
|
if (d !== void 0) {
|
|
228
|
-
const f = await
|
|
228
|
+
const f = await Tt(d), h = {
|
|
229
229
|
id: d.id,
|
|
230
230
|
meta: await As.parseAsync(d.meta),
|
|
231
231
|
spec: {
|
|
@@ -259,7 +259,7 @@ class ql {
|
|
|
259
259
|
}
|
|
260
260
|
async getOverview(e, t, r) {
|
|
261
261
|
var i;
|
|
262
|
-
const o = (i = this.registries.find((
|
|
262
|
+
const o = (i = this.registries.find((a) => a.id === e)) == null ? void 0 : i.spec;
|
|
263
263
|
if (!o) throw new Error(`Registry with id "${e}" not found`);
|
|
264
264
|
if (o.type !== "remote-v2")
|
|
265
265
|
throw new Error(
|
|
@@ -296,22 +296,22 @@ const zl = {
|
|
|
296
296
|
blocksInLimbo: []
|
|
297
297
|
}, Po = {
|
|
298
298
|
label: "New Project"
|
|
299
|
-
}, ko = { name: "UserProject", version: "2" }, Wr = "SchemaVersion", qr = "1",
|
|
300
|
-
function
|
|
299
|
+
}, ko = { name: "UserProject", version: "2" }, Wr = "SchemaVersion", qr = "1", Lt = "ProjectCreated", Te = "ProjectLastModified", Le = "ProjectMeta", pe = "ProjectStructure", Ye = "BlockRenderingState", Oo = "BlockFrontendState/", $o = /^BlockFrontendState\/(?<blockid>.*)$/;
|
|
300
|
+
function bt(s) {
|
|
301
301
|
return `${Oo}${s}`;
|
|
302
302
|
}
|
|
303
303
|
const Fo = "BlockArgsAuthor/";
|
|
304
|
-
function
|
|
304
|
+
function Rt(s) {
|
|
305
305
|
return `${Fo}${s}`;
|
|
306
306
|
}
|
|
307
|
-
const
|
|
307
|
+
const Ct = "ProjectStructureAuthor";
|
|
308
308
|
function Io(s) {
|
|
309
309
|
const e = s.match($o);
|
|
310
310
|
if (e !== null)
|
|
311
311
|
return e.groups.blockid;
|
|
312
312
|
}
|
|
313
313
|
const Ao = "__serviceTemplate_";
|
|
314
|
-
function
|
|
314
|
+
function Et(s) {
|
|
315
315
|
return `${Ao}${s}`;
|
|
316
316
|
}
|
|
317
317
|
function V(s, e) {
|
|
@@ -336,19 +336,19 @@ async function Bo(s, e, t, r) {
|
|
|
336
336
|
r.logger
|
|
337
337
|
);
|
|
338
338
|
return { computable: U.make((i) => {
|
|
339
|
-
const
|
|
340
|
-
if (
|
|
339
|
+
const a = i.accessor(o.entry()).node(), c = t.getValue(i);
|
|
340
|
+
if (a === void 0) return;
|
|
341
341
|
const l = [];
|
|
342
|
-
for (const u of
|
|
343
|
-
const d =
|
|
342
|
+
for (const u of a.listDynamicFields()) {
|
|
343
|
+
const d = a.traverse(u);
|
|
344
344
|
if (d === void 0) continue;
|
|
345
|
-
const f = B(d.getKeyValueAsJson(
|
|
345
|
+
const f = B(d.getKeyValueAsJson(Le)), h = B(d.getKeyValueAsJson(Lt)), g = B(d.getKeyValueAsJson(Te));
|
|
346
346
|
l.push({
|
|
347
347
|
id: u,
|
|
348
348
|
rid: d.id,
|
|
349
349
|
created: new Date(h),
|
|
350
350
|
lastModified: new Date(g),
|
|
351
|
-
opened:
|
|
351
|
+
opened: c.indexOf(d.id) >= 0,
|
|
352
352
|
meta: f
|
|
353
353
|
});
|
|
354
354
|
}
|
|
@@ -364,11 +364,11 @@ const jo = {
|
|
|
364
364
|
};
|
|
365
365
|
function Xr(s, e, t, r, o) {
|
|
366
366
|
if (o.length === 0) throw new Error("Zero output names provided");
|
|
367
|
-
const n = t ? s.createEphemeral(jo) : s.createStruct(xo), i = j(n, "template"),
|
|
368
|
-
return s.createField(i, "Input", e), s.createField(
|
|
367
|
+
const n = t ? s.createEphemeral(jo) : s.createStruct(xo), i = j(n, "template"), a = j(n, "inputs");
|
|
368
|
+
return s.createField(i, "Input", e), s.createField(a, "Input", L.createPlMap(s, r, t)), s.lockInputs(n), L.futureRecord(s, n, o, "Output", "outputs/");
|
|
369
369
|
}
|
|
370
370
|
const Vo = { name: "BContextEnd", version: "1" }, Uo = { name: "BContext", version: "1" }, Jo = "id", Go = "parent/", Mo = ["context", "result"];
|
|
371
|
-
function
|
|
371
|
+
function rr(s, e, t) {
|
|
372
372
|
return Xr(s, e, !0, t, Mo);
|
|
373
373
|
}
|
|
374
374
|
function _o(s) {
|
|
@@ -379,7 +379,7 @@ function Ko(s, e) {
|
|
|
379
379
|
if (e.length === 0) return _o(s);
|
|
380
380
|
if (e.length === 1) return e[0];
|
|
381
381
|
const t = s.createEphemeral(Uo);
|
|
382
|
-
s.createField(j(t, Jo), "Input", L.createPlString(s,
|
|
382
|
+
s.createField(j(t, Jo), "Input", L.createPlString(s, Ae()));
|
|
383
383
|
for (let r = 0; r < e.length; r++)
|
|
384
384
|
s.createField(j(t, `${Go}${r}`), "Input", e[r]);
|
|
385
385
|
return s.lock(t), t;
|
|
@@ -393,17 +393,17 @@ function Ho(s, e) {
|
|
|
393
393
|
M(r);
|
|
394
394
|
}
|
|
395
395
|
}
|
|
396
|
-
const
|
|
396
|
+
const sr = {
|
|
397
397
|
hash(s, e) {
|
|
398
|
-
e.update(
|
|
398
|
+
e.update(Ve.type.name).update(Ve.type.version).update(s.name).update(s.version).update(s.src);
|
|
399
399
|
},
|
|
400
400
|
render(s, e, t) {
|
|
401
401
|
return e.createValue(
|
|
402
|
-
|
|
403
|
-
JSON.stringify(
|
|
402
|
+
Ve.type,
|
|
403
|
+
JSON.stringify(Ve.fromV2Data(s).data)
|
|
404
404
|
);
|
|
405
405
|
}
|
|
406
|
-
},
|
|
406
|
+
}, Je = {
|
|
407
407
|
hash(s, e) {
|
|
408
408
|
e.update(be.type.name).update(be.type.version).update(s.name).update(s.version).update(s.src);
|
|
409
409
|
},
|
|
@@ -426,11 +426,11 @@ const rr = {
|
|
|
426
426
|
e.update(ie.type.name).update(ie.type.version).update(s.hashOverride ?? "").update(s.name).update(s.version).update(s.src);
|
|
427
427
|
const t = (r) => (r.sort((o, n) => o[0] === n[0] ? 0 : o[0] < n[0] ? -1 : 1), r);
|
|
428
428
|
for (const [r, o] of t(Object.entries(s.libs ?? {})))
|
|
429
|
-
e.update("lib:" + r),
|
|
429
|
+
e.update("lib:" + r), sr.hash(o, e);
|
|
430
430
|
for (const [r, o] of t(Object.entries(s.software ?? {})))
|
|
431
|
-
e.update("soft:" + r),
|
|
431
|
+
e.update("soft:" + r), Je.hash(o, e);
|
|
432
432
|
for (const [r, o] of t(Object.entries(s.assets ?? {})))
|
|
433
|
-
e.update("asset:" + r),
|
|
433
|
+
e.update("asset:" + r), Je.hash(o, e);
|
|
434
434
|
for (const [r, o] of t(Object.entries(s.templates ?? {})))
|
|
435
435
|
e.update("tpl:" + r), this.hash(o, e);
|
|
436
436
|
},
|
|
@@ -439,21 +439,21 @@ const rr = {
|
|
|
439
439
|
ie.type,
|
|
440
440
|
JSON.stringify(ie.fromV2Data(s).data)
|
|
441
441
|
);
|
|
442
|
-
for (const [i,
|
|
443
|
-
const
|
|
444
|
-
e.createField(
|
|
442
|
+
for (const [i, a] of Object.entries(s.libs ?? {})) {
|
|
443
|
+
const c = ie.libField(r, i);
|
|
444
|
+
e.createField(c, "Input"), e.setField(c, t(a, sr));
|
|
445
445
|
}
|
|
446
|
-
for (const [i,
|
|
447
|
-
const
|
|
448
|
-
e.createField(
|
|
446
|
+
for (const [i, a] of Object.entries(s.software ?? {})) {
|
|
447
|
+
const c = ie.swField(r, i);
|
|
448
|
+
e.createField(c, "Input"), e.setField(c, t(a, Je));
|
|
449
449
|
}
|
|
450
|
-
for (const [i,
|
|
451
|
-
const
|
|
452
|
-
e.createField(
|
|
450
|
+
for (const [i, a] of Object.entries(s.assets ?? {})) {
|
|
451
|
+
const c = ie.swField(r, i);
|
|
452
|
+
e.createField(c, "Input"), e.setField(c, t(a, Je));
|
|
453
453
|
}
|
|
454
|
-
for (const [i,
|
|
455
|
-
const
|
|
456
|
-
e.createField(
|
|
454
|
+
for (const [i, a] of Object.entries(s.templates ?? {})) {
|
|
455
|
+
const c = ie.tplField(r, i);
|
|
456
|
+
e.createField(c, "Input"), e.setField(c, t(a, Yr));
|
|
457
457
|
}
|
|
458
458
|
if (e.lock(r), !s.hashOverride) return r;
|
|
459
459
|
const o = t(s, Wo), n = ke.tplField(o);
|
|
@@ -462,14 +462,14 @@ const rr = {
|
|
|
462
462
|
};
|
|
463
463
|
function qo(s, e) {
|
|
464
464
|
const t = /* @__PURE__ */ new Map(), r = (o, n) => {
|
|
465
|
-
const i =
|
|
465
|
+
const i = De("sha256");
|
|
466
466
|
n.hash(o, i);
|
|
467
|
-
const
|
|
468
|
-
if (!t.has(
|
|
469
|
-
const
|
|
470
|
-
t.set(
|
|
467
|
+
const a = i.digest("hex");
|
|
468
|
+
if (!t.has(a)) {
|
|
469
|
+
const c = n.render(o, s, r);
|
|
470
|
+
t.set(a, c);
|
|
471
471
|
}
|
|
472
|
-
return t.get(
|
|
472
|
+
return t.get(a);
|
|
473
473
|
};
|
|
474
474
|
return r(e, Yr);
|
|
475
475
|
}
|
|
@@ -495,7 +495,7 @@ function en(s, e) {
|
|
|
495
495
|
const t = s.createStruct(zo), r = j(t, Xo), o = j(t, Yo), n = j(t, Qo);
|
|
496
496
|
return s.setField(r, s.createValue(L.JsonString, Buffer.from(JSON.stringify(e.registry)))), s.setField(o, s.createValue(L.JsonString, Buffer.from(JSON.stringify(e.path)))), n;
|
|
497
497
|
}
|
|
498
|
-
function
|
|
498
|
+
function Nt(s, e) {
|
|
499
499
|
switch (e.type) {
|
|
500
500
|
case "from-registry":
|
|
501
501
|
return en(s, e);
|
|
@@ -529,7 +529,7 @@ function tn(s, e) {
|
|
|
529
529
|
}
|
|
530
530
|
}
|
|
531
531
|
const rn = { name: "BlockPackCustom", version: "1" }, es = "template", ts = "frontend";
|
|
532
|
-
function
|
|
532
|
+
function or(s) {
|
|
533
533
|
return s.endsWith("/") ? s : `${s}/`;
|
|
534
534
|
}
|
|
535
535
|
class sn {
|
|
@@ -541,17 +541,17 @@ class sn {
|
|
|
541
541
|
case "explicit":
|
|
542
542
|
return e.config;
|
|
543
543
|
case "dev-v1": {
|
|
544
|
-
const t = await
|
|
544
|
+
const t = await tr(e.folder), r = await X.promises.readFile(t.config, { encoding: "utf-8" });
|
|
545
545
|
return JSON.parse(r);
|
|
546
546
|
}
|
|
547
547
|
case "dev-v2": {
|
|
548
|
-
const t = await
|
|
548
|
+
const t = await zt(e.folder), r = await X.promises.readFile(t.components.model.file, {
|
|
549
549
|
encoding: "utf-8"
|
|
550
550
|
});
|
|
551
551
|
return JSON.parse(r);
|
|
552
552
|
}
|
|
553
553
|
case "from-registry-v1": {
|
|
554
|
-
const t = this.http !== void 0 ? { dispatcher: this.http } : {}, r = `${
|
|
554
|
+
const t = this.http !== void 0 ? { dispatcher: this.http } : {}, r = `${or(e.registryUrl)}${de.packageContentPrefix({ organization: e.id.organization, package: e.id.name, version: e.id.version })}`;
|
|
555
555
|
return await (await ce(`${r}/config.json`, t)).body.json();
|
|
556
556
|
}
|
|
557
557
|
case "from-registry-v2": {
|
|
@@ -567,7 +567,7 @@ class sn {
|
|
|
567
567
|
case "explicit":
|
|
568
568
|
return e;
|
|
569
569
|
case "dev-v1": {
|
|
570
|
-
const t = await
|
|
570
|
+
const t = await tr(e.folder), r = await X.promises.readFile(t.workflow), o = JSON.parse(
|
|
571
571
|
await X.promises.readFile(t.config, "utf-8")
|
|
572
572
|
), n = t.ui;
|
|
573
573
|
return {
|
|
@@ -586,14 +586,14 @@ class sn {
|
|
|
586
586
|
};
|
|
587
587
|
}
|
|
588
588
|
case "dev-v2": {
|
|
589
|
-
const t = await
|
|
589
|
+
const t = await zt(e.folder), r = JSON.parse(
|
|
590
590
|
await X.promises.readFile(t.components.model.file, {
|
|
591
591
|
encoding: "utf-8"
|
|
592
592
|
})
|
|
593
593
|
), o = await X.promises.readFile(
|
|
594
594
|
t.components.workflow.main.file
|
|
595
595
|
), n = t.components.ui.folder, i = { ...e };
|
|
596
|
-
return e.mtime === void 0 && (i.mtime = await
|
|
596
|
+
return e.mtime === void 0 && (i.mtime = await Tt(t)), {
|
|
597
597
|
type: "explicit",
|
|
598
598
|
template: {
|
|
599
599
|
type: "explicit",
|
|
@@ -609,19 +609,19 @@ class sn {
|
|
|
609
609
|
};
|
|
610
610
|
}
|
|
611
611
|
case "from-registry-v1": {
|
|
612
|
-
const t = this.http !== void 0 ? { dispatcher: this.http } : {}, r = `${
|
|
612
|
+
const t = this.http !== void 0 ? { dispatcher: this.http } : {}, r = `${or(e.registryUrl)}${de.packageContentPrefix({ organization: e.id.organization, package: e.id.name, version: e.id.version })}`, o = `${r}/template.plj.gz`, n = await ce(o, t);
|
|
613
613
|
if (n.statusCode !== 200)
|
|
614
614
|
throw new Error(
|
|
615
615
|
`Block not found in registry (url = ${o} ; code = ${n.statusCode}): ` + JSON.stringify(e)
|
|
616
616
|
);
|
|
617
|
-
const i = new Uint8Array(await n.body.arrayBuffer()),
|
|
617
|
+
const i = new Uint8Array(await n.body.arrayBuffer()), c = await (await ce(`${r}/config.json`, t)).body.json();
|
|
618
618
|
return {
|
|
619
619
|
type: "explicit",
|
|
620
620
|
template: {
|
|
621
621
|
type: "explicit",
|
|
622
622
|
content: i
|
|
623
623
|
},
|
|
624
|
-
config:
|
|
624
|
+
config: c,
|
|
625
625
|
frontend: {
|
|
626
626
|
type: "url",
|
|
627
627
|
url: `${r}/frontend.tgz`
|
|
@@ -630,14 +630,14 @@ class sn {
|
|
|
630
630
|
};
|
|
631
631
|
}
|
|
632
632
|
case "from-registry-v2": {
|
|
633
|
-
const t = this.http !== void 0 ? { dispatcher: this.http } : {}, o = await this.v2RegistryProvider.getRegistry(e.registryUrl).getComponents(e.id), n = async () => await (await ce(o.model.url, t)).body.json(), i = async () => await (await ce(o.workflow.main.url, t)).body.arrayBuffer(), [
|
|
633
|
+
const t = this.http !== void 0 ? { dispatcher: this.http } : {}, o = await this.v2RegistryProvider.getRegistry(e.registryUrl).getComponents(e.id), n = async () => await (await ce(o.model.url, t)).body.json(), i = async () => await (await ce(o.workflow.main.url, t)).body.arrayBuffer(), [a, c] = await Promise.all([n(), i()]);
|
|
634
634
|
return {
|
|
635
635
|
type: "explicit",
|
|
636
636
|
template: {
|
|
637
637
|
type: "explicit",
|
|
638
|
-
content: Buffer.from(
|
|
638
|
+
content: Buffer.from(c)
|
|
639
639
|
},
|
|
640
|
-
config:
|
|
640
|
+
config: a,
|
|
641
641
|
frontend: {
|
|
642
642
|
type: "url",
|
|
643
643
|
url: o.ui.url
|
|
@@ -652,9 +652,9 @@ class sn {
|
|
|
652
652
|
}
|
|
653
653
|
function on(s, e) {
|
|
654
654
|
const t = { config: e.config, source: e.source }, r = s.createStruct(rn, JSON.stringify(t));
|
|
655
|
-
return s.createField(j(r, es), "Input",
|
|
655
|
+
return s.createField(j(r, es), "Input", Nt(s, e.template)), s.createField(j(r, ts), "Input", tn(s, e.frontend)), s.lock(r), r;
|
|
656
656
|
}
|
|
657
|
-
function
|
|
657
|
+
function nr(s, e) {
|
|
658
658
|
switch (e.type) {
|
|
659
659
|
case "explicit":
|
|
660
660
|
return on(s, e);
|
|
@@ -662,13 +662,13 @@ function or(s, e) {
|
|
|
662
662
|
return M(e.type);
|
|
663
663
|
}
|
|
664
664
|
}
|
|
665
|
-
function
|
|
665
|
+
function Ge(s, e) {
|
|
666
666
|
return { __isRef: !0, blockId: s, name: e };
|
|
667
667
|
}
|
|
668
668
|
function nn(s) {
|
|
669
669
|
return typeof s == "object" && s !== null && s.__isRef === !0 && "blockId" in s && "name" in s;
|
|
670
670
|
}
|
|
671
|
-
function
|
|
671
|
+
function Pt(s, e, t) {
|
|
672
672
|
const r = typeof e;
|
|
673
673
|
switch (r) {
|
|
674
674
|
case "function":
|
|
@@ -684,10 +684,10 @@ function Et(s, e, t) {
|
|
|
684
684
|
if (nn(e))
|
|
685
685
|
t === void 0 || t.has(e.blockId) ? s.upstreams.add(e.blockId) : s.missingReferences = !0;
|
|
686
686
|
else if (Array.isArray(e))
|
|
687
|
-
for (const o of e)
|
|
687
|
+
for (const o of e) Pt(s, o, t);
|
|
688
688
|
else
|
|
689
689
|
for (const [, o] of Object.entries(e))
|
|
690
|
-
|
|
690
|
+
Pt(s, o, t);
|
|
691
691
|
return;
|
|
692
692
|
default:
|
|
693
693
|
M(r);
|
|
@@ -695,7 +695,7 @@ function Et(s, e, t) {
|
|
|
695
695
|
}
|
|
696
696
|
function an(s, e) {
|
|
697
697
|
const t = { upstreams: /* @__PURE__ */ new Set(), missingReferences: !1 };
|
|
698
|
-
return
|
|
698
|
+
return Pt(t, s, e), t;
|
|
699
699
|
}
|
|
700
700
|
function se(s) {
|
|
701
701
|
return {
|
|
@@ -724,9 +724,9 @@ class rs {
|
|
|
724
724
|
const n = new Set(o);
|
|
725
725
|
for (; o.length > 0; ) {
|
|
726
726
|
let i = [];
|
|
727
|
-
for (const
|
|
728
|
-
const
|
|
729
|
-
r(
|
|
727
|
+
for (const a of o) {
|
|
728
|
+
const c = this.nodes.get(a);
|
|
729
|
+
r(c), c[e].forEach((l) => {
|
|
730
730
|
n.has(l) || (n.add(l), i.push(l));
|
|
731
731
|
});
|
|
732
732
|
}
|
|
@@ -734,7 +734,7 @@ class rs {
|
|
|
734
734
|
}
|
|
735
735
|
}
|
|
736
736
|
}
|
|
737
|
-
function
|
|
737
|
+
function kt(s) {
|
|
738
738
|
const e = /* @__PURE__ */ new Map();
|
|
739
739
|
let t;
|
|
740
740
|
for (const { id: r } of se(s)) {
|
|
@@ -746,19 +746,19 @@ function Pt(s) {
|
|
|
746
746
|
}
|
|
747
747
|
return t !== void 0 && (t.downstream = /* @__PURE__ */ new Set()), new rs(e);
|
|
748
748
|
}
|
|
749
|
-
function
|
|
749
|
+
function ze(s, e) {
|
|
750
750
|
const t = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Set();
|
|
751
751
|
for (const { id: o } of se(s)) {
|
|
752
752
|
const n = e(o);
|
|
753
753
|
if (n === void 0) continue;
|
|
754
|
-
const i = an(n, r),
|
|
754
|
+
const i = an(n, r), a = {
|
|
755
755
|
id: o,
|
|
756
756
|
missingReferences: i.missingReferences,
|
|
757
757
|
upstream: i.upstreams,
|
|
758
758
|
downstream: /* @__PURE__ */ new Set()
|
|
759
759
|
// will be populated from downstream blocks
|
|
760
760
|
};
|
|
761
|
-
t.set(o,
|
|
761
|
+
t.set(o, a), i.upstreams.forEach((c) => t.get(c).downstream.add(o)), r.add(o);
|
|
762
762
|
}
|
|
763
763
|
return new rs(t);
|
|
764
764
|
}
|
|
@@ -767,34 +767,34 @@ function cn(s, e) {
|
|
|
767
767
|
for (const t of s) if (!e.has(t)) return !1;
|
|
768
768
|
return !0;
|
|
769
769
|
}
|
|
770
|
-
function
|
|
771
|
-
if (s.size > e.size) return
|
|
770
|
+
function Ot(s, e) {
|
|
771
|
+
if (s.size > e.size) return Ot(e, s);
|
|
772
772
|
for (const t of s) if (e.has(t)) return !0;
|
|
773
773
|
return !1;
|
|
774
774
|
}
|
|
775
|
-
function
|
|
775
|
+
function ir(s, e) {
|
|
776
776
|
const t = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new Set();
|
|
777
777
|
return s.nodes.forEach((n) => {
|
|
778
778
|
const i = e.nodes.get(n.id);
|
|
779
|
-
i === void 0 ? t.add(n.id) : (!cn(n.upstream, i.upstream) ||
|
|
779
|
+
i === void 0 ? t.add(n.id) : (!cn(n.upstream, i.upstream) || Ot(n.upstream, o)) && o.add(n.id);
|
|
780
780
|
}), e.nodes.forEach((n) => {
|
|
781
|
-
s.nodes.has(n.id) ?
|
|
781
|
+
s.nodes.has(n.id) ? Ot(n.upstream, o) && o.add(n.id) : r.add(n.id);
|
|
782
782
|
}), { onlyInA: t, onlyInB: r, different: o };
|
|
783
783
|
}
|
|
784
|
-
let
|
|
784
|
+
let lt;
|
|
785
785
|
async function ss() {
|
|
786
|
-
if (
|
|
786
|
+
if (lt === void 0) {
|
|
787
787
|
const s = await Zo(Ys["pframes.export-pframe"]);
|
|
788
788
|
if (s.type !== "explicit") throw new Error("Unexpected prepared template type.");
|
|
789
|
-
const e =
|
|
790
|
-
|
|
789
|
+
const e = De("sha256").update(s.content).digest("hex");
|
|
790
|
+
lt = { spec: s, hash: e };
|
|
791
791
|
}
|
|
792
|
-
return
|
|
792
|
+
return lt;
|
|
793
793
|
}
|
|
794
794
|
function ln(s, e, t) {
|
|
795
795
|
return Xr(s, e, !0, { pf: t }, ["result"]).result;
|
|
796
796
|
}
|
|
797
|
-
function
|
|
797
|
+
function ut(s, e) {
|
|
798
798
|
let t = !1, r, o;
|
|
799
799
|
return () => {
|
|
800
800
|
if (!t)
|
|
@@ -803,13 +803,13 @@ function lt(s, e) {
|
|
|
803
803
|
return r !== n && (r = n, o = e()), e();
|
|
804
804
|
};
|
|
805
805
|
}
|
|
806
|
-
class
|
|
806
|
+
class ar {
|
|
807
807
|
constructor(e, t) {
|
|
808
|
-
S(this, "currentInputsC",
|
|
808
|
+
S(this, "currentInputsC", ut(
|
|
809
809
|
() => this.fields.currentArgs.modCount,
|
|
810
810
|
() => JSON.parse(Buffer.from(this.fields.currentArgs.value).toString())
|
|
811
811
|
));
|
|
812
|
-
S(this, "actualProductionInputsC",
|
|
812
|
+
S(this, "actualProductionInputsC", ut(
|
|
813
813
|
() => {
|
|
814
814
|
var e;
|
|
815
815
|
return (e = this.fields.prodArgs) == null ? void 0 : e.modCount;
|
|
@@ -821,7 +821,7 @@ class ir {
|
|
|
821
821
|
return JSON.parse(Buffer.from(e).toString());
|
|
822
822
|
}
|
|
823
823
|
));
|
|
824
|
-
S(this, "productionStaleC",
|
|
824
|
+
S(this, "productionStaleC", ut(
|
|
825
825
|
() => {
|
|
826
826
|
var e;
|
|
827
827
|
return `${this.fields.currentArgs.modCount}_${(e = this.fields.prodArgs) == null ? void 0 : e.modCount}`;
|
|
@@ -875,8 +875,8 @@ class ir {
|
|
|
875
875
|
const un = (s) => {
|
|
876
876
|
throw new Error(`No new block info for ${s}`);
|
|
877
877
|
};
|
|
878
|
-
class
|
|
879
|
-
constructor(e, t, r, o, n, i,
|
|
878
|
+
class Qe {
|
|
879
|
+
constructor(e, t, r, o, n, i, a, c, l, u, d, f) {
|
|
880
880
|
S(this, "globalModCount", 0);
|
|
881
881
|
S(this, "fieldsChanged", !1);
|
|
882
882
|
//
|
|
@@ -895,7 +895,7 @@ class Ye {
|
|
|
895
895
|
S(this, "stagingGraph");
|
|
896
896
|
S(this, "pendingProductionGraph");
|
|
897
897
|
S(this, "actualProductionGraph");
|
|
898
|
-
this.rid = e, this.tx = t, this.author = r, this.schema = o, this.lastModified = n, this.meta = i, this.struct =
|
|
898
|
+
this.rid = e, this.tx = t, this.author = r, this.schema = o, this.lastModified = n, this.meta = i, this.struct = a, this.renderingState = c, this.blocksInLimbo = l, this.blockInfos = u, this.blockFrontendStates = d, this.ctxExportTplHolder = f;
|
|
899
899
|
}
|
|
900
900
|
fixProblemsAndMigrate() {
|
|
901
901
|
this.blockInfos.forEach((t) => {
|
|
@@ -903,7 +903,7 @@ class Ye {
|
|
|
903
903
|
});
|
|
904
904
|
let e;
|
|
905
905
|
this.blockInfos.forEach((t) => {
|
|
906
|
-
t.fields.blockSettings === void 0 && (e === void 0 && (e = this.createJsonFieldValue(
|
|
906
|
+
t.fields.blockSettings === void 0 && (e === void 0 && (e = this.createJsonFieldValue(qt)), this.setBlockFieldObj(t.id, "blockSettings", e));
|
|
907
907
|
});
|
|
908
908
|
}
|
|
909
909
|
get wasModified() {
|
|
@@ -913,16 +913,16 @@ class Ye {
|
|
|
913
913
|
return JSON.parse(JSON.stringify(this.struct));
|
|
914
914
|
}
|
|
915
915
|
getStagingGraph() {
|
|
916
|
-
return this.stagingGraph === void 0 && (this.stagingGraph =
|
|
916
|
+
return this.stagingGraph === void 0 && (this.stagingGraph = kt(this.struct)), this.stagingGraph;
|
|
917
917
|
}
|
|
918
918
|
getPendingProductionGraph() {
|
|
919
|
-
return this.pendingProductionGraph === void 0 && (this.pendingProductionGraph =
|
|
919
|
+
return this.pendingProductionGraph === void 0 && (this.pendingProductionGraph = ze(
|
|
920
920
|
this.struct,
|
|
921
921
|
(e) => this.getBlockInfo(e).currentInputs
|
|
922
922
|
)), this.pendingProductionGraph;
|
|
923
923
|
}
|
|
924
924
|
getActualProductionGraph() {
|
|
925
|
-
return this.actualProductionGraph === void 0 && (this.actualProductionGraph =
|
|
925
|
+
return this.actualProductionGraph === void 0 && (this.actualProductionGraph = ze(
|
|
926
926
|
this.struct,
|
|
927
927
|
(e) => this.getBlockInfo(e).actualProductionInputs
|
|
928
928
|
)), this.actualProductionGraph;
|
|
@@ -1000,8 +1000,8 @@ class Ye {
|
|
|
1000
1000
|
JSON.parse(o);
|
|
1001
1001
|
const i = Buffer.from(o);
|
|
1002
1002
|
if (Buffer.compare(n.fields.currentArgs.value, i) === 0) continue;
|
|
1003
|
-
const
|
|
1004
|
-
this.setBlockField(r, "currentArgs",
|
|
1003
|
+
const a = this.tx.createValue(L.JsonObject, i);
|
|
1004
|
+
this.setBlockField(r, "currentArgs", a, "Ready", i), this.blocksWithChangedInputs.add(r), t.push(r);
|
|
1005
1005
|
}
|
|
1006
1006
|
this.getStagingGraph().traverse("downstream", t, ({ id: r }) => this.resetStaging(r)), t.length > 0 && this.updateLastModified();
|
|
1007
1007
|
}
|
|
@@ -1042,7 +1042,7 @@ class Ye {
|
|
|
1042
1042
|
this.resetStaging(e);
|
|
1043
1043
|
const t = this.getBlockInfo(e), r = this.createCtx(this.getStagingGraph().nodes.get(e).upstream, "stagingCtx");
|
|
1044
1044
|
if (this.getBlock(e).renderingMode !== "Heavy") throw new Error("not supported yet");
|
|
1045
|
-
const o = t.getTemplate(this.tx), n =
|
|
1045
|
+
const o = t.getTemplate(this.tx), n = rr(this.tx, o, {
|
|
1046
1046
|
args: t.fields.currentArgs.ref,
|
|
1047
1047
|
blockId: this.tx.createValue(L.JsonString, JSON.stringify(e)),
|
|
1048
1048
|
isProduction: this.tx.createValue(L.JsonBool, JSON.stringify(!1)),
|
|
@@ -1063,7 +1063,7 @@ class Ye {
|
|
|
1063
1063
|
);
|
|
1064
1064
|
if (this.getBlock(e).renderingMode === "Light")
|
|
1065
1065
|
throw new Error("Can't render production for light block.");
|
|
1066
|
-
const o = t.getTemplate(this.tx), n =
|
|
1066
|
+
const o = t.getTemplate(this.tx), n = rr(this.tx, o, {
|
|
1067
1067
|
args: t.fields.currentArgs.ref,
|
|
1068
1068
|
blockId: this.tx.createValue(L.JsonString, JSON.stringify(e)),
|
|
1069
1069
|
isProduction: this.tx.createValue(L.JsonBool, JSON.stringify(!0)),
|
|
@@ -1081,31 +1081,31 @@ class Ye {
|
|
|
1081
1081
|
//
|
|
1082
1082
|
/** Very generic method, better check for more specialized case-specific methods first. */
|
|
1083
1083
|
updateStructure(e, t = un) {
|
|
1084
|
-
const r = this.getStagingGraph(), o = this.getActualProductionGraph(), n =
|
|
1084
|
+
const r = this.getStagingGraph(), o = this.getActualProductionGraph(), n = kt(e), i = ze(
|
|
1085
1085
|
e,
|
|
1086
1086
|
(l) => {
|
|
1087
1087
|
var u;
|
|
1088
1088
|
return (u = this.blockInfos.get(l)) == null ? void 0 : u.actualProductionInputs;
|
|
1089
1089
|
}
|
|
1090
|
-
),
|
|
1091
|
-
for (const l of
|
|
1090
|
+
), a = ir(r, n), c = ir(o, i);
|
|
1091
|
+
for (const l of a.onlyInA) {
|
|
1092
1092
|
const { fields: u } = this.getBlockInfo(l);
|
|
1093
1093
|
this.deleteBlockFields(l, ...Object.keys(u)), this.blockInfos.delete(l), this.blocksInLimbo.delete(l) && (this.renderingStateChanged = !0), this.blockFrontendStates.delete(l) && this.changedBlockFrontendStates.add(l);
|
|
1094
1094
|
}
|
|
1095
|
-
for (const l of
|
|
1096
|
-
const u = new
|
|
1095
|
+
for (const l of a.onlyInB) {
|
|
1096
|
+
const u = new ar(l, {});
|
|
1097
1097
|
this.blockInfos.set(l, u);
|
|
1098
|
-
const d = t(l), f =
|
|
1098
|
+
const d = t(l), f = nr(this.tx, d.blockPack);
|
|
1099
1099
|
this.setBlockField(l, "blockPack", L.wrapInHolder(this.tx, f), "NotReady"), this.setBlockFieldObj(
|
|
1100
1100
|
l,
|
|
1101
1101
|
"blockSettings",
|
|
1102
|
-
this.createJsonFieldValue(
|
|
1102
|
+
this.createJsonFieldValue(qt)
|
|
1103
1103
|
), this.setBlockFieldObj(l, "currentArgs", this.createJsonFieldValueByContent(d.args)), d.uiState && (this.blockFrontendStates.set(l, d.uiState), this.changedBlockFrontendStates.add(l)), u.check();
|
|
1104
1104
|
}
|
|
1105
|
-
for (const l of
|
|
1106
|
-
o.traverse("downstream", [...
|
|
1105
|
+
for (const l of a.different) this.resetStaging(l);
|
|
1106
|
+
o.traverse("downstream", [...c.different], (l) => {
|
|
1107
1107
|
this.resetOrLimboProduction(l.id);
|
|
1108
|
-
}), (
|
|
1108
|
+
}), (a.onlyInB.size > 0 || a.onlyInA.size > 0 || a.different.size > 0) && this.resetStagingRefreshTimestamp(), this.struct = e, this.structureChanged = !0, this.stagingGraph = void 0, this.pendingProductionGraph = void 0, this.actualProductionGraph = void 0, this.updateLastModified();
|
|
1109
1109
|
}
|
|
1110
1110
|
//
|
|
1111
1111
|
// Structure change helpers
|
|
@@ -1117,9 +1117,9 @@ class Ye {
|
|
|
1117
1117
|
else {
|
|
1118
1118
|
let n = !1;
|
|
1119
1119
|
for (const i of o.groups) {
|
|
1120
|
-
const
|
|
1121
|
-
if (!(
|
|
1122
|
-
i.blocks.splice(
|
|
1120
|
+
const a = i.blocks.findIndex((c) => c.id === r);
|
|
1121
|
+
if (!(a < 0)) {
|
|
1122
|
+
i.blocks.splice(a, 0, e), n = !0;
|
|
1123
1123
|
break;
|
|
1124
1124
|
}
|
|
1125
1125
|
}
|
|
@@ -1151,7 +1151,7 @@ class Ye {
|
|
|
1151
1151
|
this.setBlockField(
|
|
1152
1152
|
e,
|
|
1153
1153
|
"blockPack",
|
|
1154
|
-
L.wrapInHolder(this.tx,
|
|
1154
|
+
L.wrapInHolder(this.tx, nr(this.tx, t)),
|
|
1155
1155
|
"NotReady"
|
|
1156
1156
|
), r !== void 0 ? (this.setArgs([{ blockId: e, args: r }]), this.setUiState(e, void 0)) : this.getStagingGraph().traverse("downstream", [e], ({ id: n }) => this.resetStaging(n)), o.productionRendered && this.getActualProductionGraph().traverse(
|
|
1157
1157
|
"downstream",
|
|
@@ -1170,24 +1170,24 @@ class Ye {
|
|
|
1170
1170
|
});
|
|
1171
1171
|
else
|
|
1172
1172
|
for (const i of r) {
|
|
1173
|
-
const
|
|
1174
|
-
if (
|
|
1175
|
-
for (const
|
|
1176
|
-
if (!r.has(
|
|
1173
|
+
const a = o.nodes.get(i);
|
|
1174
|
+
if (a === void 0) throw new Error(`Can't find block with id: ${i}`);
|
|
1175
|
+
for (const c of a.upstream)
|
|
1176
|
+
if (!r.has(c))
|
|
1177
1177
|
throw new Error("Can't render blocks not including all upstreams.");
|
|
1178
1178
|
}
|
|
1179
1179
|
const n = /* @__PURE__ */ new Set();
|
|
1180
1180
|
for (const i of se(this.structure)) {
|
|
1181
1181
|
if (!r.has(i.id)) continue;
|
|
1182
|
-
let
|
|
1183
|
-
if (!
|
|
1184
|
-
for (const
|
|
1185
|
-
if (n.has(
|
|
1186
|
-
|
|
1182
|
+
let a = this.getBlockInfo(i.id).requireProductionRendering || this.blocksInLimbo.has(i.id);
|
|
1183
|
+
if (!a) {
|
|
1184
|
+
for (const c of o.nodes.get(i.id).upstream)
|
|
1185
|
+
if (n.has(c)) {
|
|
1186
|
+
a = !0;
|
|
1187
1187
|
break;
|
|
1188
1188
|
}
|
|
1189
1189
|
}
|
|
1190
|
-
|
|
1190
|
+
a && (this.renderProductionFor(i.id), n.add(i.id));
|
|
1191
1191
|
}
|
|
1192
1192
|
return o.traverse("downstream", [...n], (i) => {
|
|
1193
1193
|
n.has(i.id) || this.resetOrLimboProduction(i.id);
|
|
@@ -1196,26 +1196,26 @@ class Ye {
|
|
|
1196
1196
|
/** Stops running blocks from the list and modify states of other blocks
|
|
1197
1197
|
* accordingly */
|
|
1198
1198
|
stopProduction(...e) {
|
|
1199
|
-
var i,
|
|
1199
|
+
var i, a;
|
|
1200
1200
|
const t = this.getActualProductionGraph(), r = new Mr(e), o = new Set(e), n = [];
|
|
1201
1201
|
for (; !r.isEmpty(); ) {
|
|
1202
|
-
const
|
|
1203
|
-
if (!(((i = l.prodOutput) == null ? void 0 : i.status) === "Ready" && ((
|
|
1204
|
-
n.push(
|
|
1205
|
-
for (const u of t.traverseIdsExcludingRoots("downstream",
|
|
1202
|
+
const c = r.shift(), l = this.getBlockInfo(c).fields;
|
|
1203
|
+
if (!(((i = l.prodOutput) == null ? void 0 : i.status) === "Ready" && ((a = l.prodCtx) == null ? void 0 : a.status) === "Ready") && this.deleteBlockFields(c, "prodOutput", "prodCtx", "prodUiCtx", "prodArgs")) {
|
|
1204
|
+
n.push(c);
|
|
1205
|
+
for (const u of t.traverseIdsExcludingRoots("downstream", c))
|
|
1206
1206
|
o.has(u) || (r.push(u), o.add(u));
|
|
1207
1207
|
}
|
|
1208
1208
|
}
|
|
1209
|
-
for (const
|
|
1210
|
-
this.resetOrLimboProduction(
|
|
1209
|
+
for (const c of t.traverseIdsExcludingRoots("downstream", ...n))
|
|
1210
|
+
this.resetOrLimboProduction(c);
|
|
1211
1211
|
}
|
|
1212
1212
|
traverseWithStagingLag(e) {
|
|
1213
1213
|
const t = /* @__PURE__ */ new Map();
|
|
1214
1214
|
this.getStagingGraph().nodes.forEach((o) => {
|
|
1215
1215
|
let i = this.getBlockInfo(o.id).stagingRendered ? 0 : 1;
|
|
1216
|
-
o.upstream.forEach((
|
|
1217
|
-
const
|
|
1218
|
-
|
|
1216
|
+
o.upstream.forEach((a) => {
|
|
1217
|
+
const c = t.get(a);
|
|
1218
|
+
c !== 0 && (i = Math.max(c + 1, i));
|
|
1219
1219
|
}), e(o.id, i), t.set(o.id, i);
|
|
1220
1220
|
});
|
|
1221
1221
|
}
|
|
@@ -1257,28 +1257,28 @@ class Ye {
|
|
|
1257
1257
|
assignAuthorMarkers() {
|
|
1258
1258
|
const e = this.author ? JSON.stringify(this.author) : void 0;
|
|
1259
1259
|
for (const t of this.blocksWithChangedInputs)
|
|
1260
|
-
e === void 0 ? this.tx.deleteKValue(this.rid,
|
|
1261
|
-
(this.metaChanged || this.structureChanged) && (e === void 0 ? this.tx.deleteKValue(this.rid,
|
|
1260
|
+
e === void 0 ? this.tx.deleteKValue(this.rid, Rt(t)) : this.tx.setKValue(this.rid, Rt(t), e);
|
|
1261
|
+
(this.metaChanged || this.structureChanged) && (e === void 0 ? this.tx.deleteKValue(this.rid, Ct) : this.tx.setKValue(this.rid, Ct, e));
|
|
1262
1262
|
}
|
|
1263
1263
|
save() {
|
|
1264
1264
|
if (this.wasModified) {
|
|
1265
|
-
this.lastModifiedChanged && this.tx.setKValue(this.rid,
|
|
1265
|
+
this.lastModifiedChanged && this.tx.setKValue(this.rid, Te, JSON.stringify(this.lastModified)), this.structureChanged && this.tx.setKValue(this.rid, pe, JSON.stringify(this.struct)), this.renderingStateChanged && this.tx.setKValue(
|
|
1266
1266
|
this.rid,
|
|
1267
|
-
|
|
1267
|
+
Ye,
|
|
1268
1268
|
JSON.stringify({
|
|
1269
1269
|
...this.renderingState,
|
|
1270
1270
|
blocksInLimbo: [...this.blocksInLimbo]
|
|
1271
1271
|
})
|
|
1272
|
-
), this.metaChanged && this.tx.setKValue(this.rid,
|
|
1272
|
+
), this.metaChanged && this.tx.setKValue(this.rid, Le, JSON.stringify(this.meta));
|
|
1273
1273
|
for (const e of this.changedBlockFrontendStates) {
|
|
1274
1274
|
const t = this.blockFrontendStates.get(e);
|
|
1275
|
-
t === void 0 ? this.tx.deleteKValue(this.rid,
|
|
1275
|
+
t === void 0 ? this.tx.deleteKValue(this.rid, bt(e)) : this.tx.setKValue(this.rid, bt(e), t);
|
|
1276
1276
|
}
|
|
1277
1277
|
this.assignAuthorMarkers();
|
|
1278
1278
|
}
|
|
1279
1279
|
}
|
|
1280
1280
|
static async load(e, t, r) {
|
|
1281
|
-
const o = e.getResourceData(t, !0), n = e.getKValueJson(t, Wr), i = e.getKValueJson(t,
|
|
1281
|
+
const o = e.getResourceData(t, !0), n = e.getKValueJson(t, Wr), i = e.getKValueJson(t, Te), a = e.getKValueJson(t, Le), c = e.getKValueJson(t, pe), l = e.getKValueJson(t, Ye), u = e.listKeyValuesString(t), [
|
|
1282
1282
|
d,
|
|
1283
1283
|
f,
|
|
1284
1284
|
h,
|
|
@@ -1290,8 +1290,8 @@ class Ye {
|
|
|
1290
1290
|
o,
|
|
1291
1291
|
n,
|
|
1292
1292
|
i,
|
|
1293
|
-
c,
|
|
1294
1293
|
a,
|
|
1294
|
+
c,
|
|
1295
1295
|
l,
|
|
1296
1296
|
u
|
|
1297
1297
|
]);
|
|
@@ -1307,14 +1307,14 @@ class Ye {
|
|
|
1307
1307
|
m === void 0 && (m = {
|
|
1308
1308
|
id: y.blockId,
|
|
1309
1309
|
fields: {}
|
|
1310
|
-
}, k.set(y.blockId, m)), m.fields[y.fieldName] =
|
|
1310
|
+
}, k.set(y.blockId, m)), m.fields[y.fieldName] = Xe(p.value) ? { modCount: 0 } : { modCount: 0, ref: p.value };
|
|
1311
1311
|
}
|
|
1312
|
-
const oe = await ss(), he =
|
|
1312
|
+
const oe = await ss(), he = Et(oe.hash), T = d.fields.find(
|
|
1313
1313
|
(p) => p.name === he
|
|
1314
1314
|
);
|
|
1315
1315
|
let q;
|
|
1316
|
-
T !== void 0 ? q =
|
|
1317
|
-
j(t,
|
|
1316
|
+
T !== void 0 ? q = wt(T.value) : (q = L.wrapInHolder(e, Nt(e, oe.spec)), e.createField(
|
|
1317
|
+
j(t, Et(oe.hash)),
|
|
1318
1318
|
"Dynamic",
|
|
1319
1319
|
q
|
|
1320
1320
|
));
|
|
@@ -1334,10 +1334,10 @@ class Ye {
|
|
|
1334
1334
|
});
|
|
1335
1335
|
for (const [p, y] of x) {
|
|
1336
1336
|
const m = await y;
|
|
1337
|
-
p.value = m.data,
|
|
1337
|
+
p.value = m.data, Xt(m.error) ? p.status = "Error" : m.resourceReady || Xt(m.originalResourceId) ? p.status = "Ready" : p.status = "NotReady";
|
|
1338
1338
|
}
|
|
1339
1339
|
const z = /* @__PURE__ */ new Map();
|
|
1340
|
-
k.forEach(({ id: p, fields: y }) => z.set(p, new
|
|
1340
|
+
k.forEach(({ id: p, fields: y }) => z.set(p, new ar(p, y)));
|
|
1341
1341
|
const fe = /* @__PURE__ */ new Set();
|
|
1342
1342
|
for (const p of se(C)) {
|
|
1343
1343
|
if (!z.has(p.id))
|
|
@@ -1349,7 +1349,7 @@ class Ye {
|
|
|
1349
1349
|
throw new Error(`Inconsistent project structure: no structure entry for ${p.id}`);
|
|
1350
1350
|
p.check();
|
|
1351
1351
|
});
|
|
1352
|
-
const v = new
|
|
1352
|
+
const v = new Qe(
|
|
1353
1353
|
t,
|
|
1354
1354
|
e,
|
|
1355
1355
|
r,
|
|
@@ -1370,25 +1370,25 @@ async function dn(s, e = Po) {
|
|
|
1370
1370
|
const t = s.createEphemeral(ko);
|
|
1371
1371
|
s.lock(t);
|
|
1372
1372
|
const r = String(Date.now());
|
|
1373
|
-
s.setKValue(t, Wr, JSON.stringify(qr)), s.setKValue(t,
|
|
1373
|
+
s.setKValue(t, Wr, JSON.stringify(qr)), s.setKValue(t, Lt, r), s.setKValue(t, Te, r), s.setKValue(t, Le, JSON.stringify(e)), s.setKValue(t, pe, JSON.stringify(Co)), s.setKValue(t, Ye, JSON.stringify(Eo));
|
|
1374
1374
|
const o = await ss();
|
|
1375
1375
|
return s.createField(
|
|
1376
|
-
j(t,
|
|
1376
|
+
j(t, Et(o.hash)),
|
|
1377
1377
|
"Dynamic",
|
|
1378
|
-
L.wrapInHolder(s,
|
|
1378
|
+
L.wrapInHolder(s, Nt(s, o.spec))
|
|
1379
1379
|
), t;
|
|
1380
1380
|
}
|
|
1381
|
-
async function
|
|
1381
|
+
async function Me(s, e, t) {
|
|
1382
1382
|
return Y(s, e, void 0, t);
|
|
1383
1383
|
}
|
|
1384
1384
|
async function Y(s, e, t, r) {
|
|
1385
1385
|
if (s instanceof xs)
|
|
1386
1386
|
return await s.withWriteTx("ProjectAction", async (o) => {
|
|
1387
|
-
const n = await
|
|
1387
|
+
const n = await Qe.load(o, e, t), i = await r(n);
|
|
1388
1388
|
return n.wasModified && (n.save(), await o.commit()), i;
|
|
1389
1389
|
});
|
|
1390
1390
|
{
|
|
1391
|
-
const o = await
|
|
1391
|
+
const o = await Qe.load(s, e, t), n = await r(o);
|
|
1392
1392
|
return o.save(), n;
|
|
1393
1393
|
}
|
|
1394
1394
|
}
|
|
@@ -1407,7 +1407,7 @@ function* pn(s) {
|
|
|
1407
1407
|
M(s);
|
|
1408
1408
|
}
|
|
1409
1409
|
}
|
|
1410
|
-
function
|
|
1410
|
+
function cr(s, e) {
|
|
1411
1411
|
return Object.fromEntries(
|
|
1412
1412
|
Object.entries(s).map(([t, r]) => [t, e(r, t)])
|
|
1413
1413
|
);
|
|
@@ -1417,11 +1417,11 @@ function hn(s, e) {
|
|
|
1417
1417
|
case "Json":
|
|
1418
1418
|
return { ...s };
|
|
1419
1419
|
case "JsonPartitioned":
|
|
1420
|
-
return { ...s, parts:
|
|
1420
|
+
return { ...s, parts: cr(s.parts, e) };
|
|
1421
1421
|
case "BinaryPartitioned":
|
|
1422
1422
|
return {
|
|
1423
1423
|
...s,
|
|
1424
|
-
parts:
|
|
1424
|
+
parts: cr(s.parts, (t) => ({
|
|
1425
1425
|
index: e(t.index),
|
|
1426
1426
|
values: e(t.values)
|
|
1427
1427
|
}))
|
|
@@ -1430,13 +1430,13 @@ function hn(s, e) {
|
|
|
1430
1430
|
M(s);
|
|
1431
1431
|
}
|
|
1432
1432
|
}
|
|
1433
|
-
const fn =
|
|
1433
|
+
const fn = Ne("PColumnData/JsonPartitioned", "1"), gn = Ne(
|
|
1434
1434
|
"PColumnData/Partitioned/JsonPartitioned",
|
|
1435
1435
|
"1"
|
|
1436
|
-
), mn =
|
|
1436
|
+
), mn = Ne("PColumnData/BinaryPartitioned", "1"), vn = Ne(
|
|
1437
1437
|
"PColumnData/Partitioned/BinaryPartitioned",
|
|
1438
1438
|
"1"
|
|
1439
|
-
), yn =
|
|
1439
|
+
), yn = Ne("PColumnData/Json", "1");
|
|
1440
1440
|
function wn(s) {
|
|
1441
1441
|
if (!s.getIsReadyOrError()) throw new Error("Data not ready.");
|
|
1442
1442
|
const e = s.getDataAsJson();
|
|
@@ -1463,9 +1463,12 @@ function wn(s) {
|
|
|
1463
1463
|
for (const o of s.listInputFields()) {
|
|
1464
1464
|
const n = s.traverse({ field: o, errorIfFieldNotSet: !0 }), i = n.listInputFields();
|
|
1465
1465
|
if (i === void 0) throw new Error(`no partition keys for super key ${o}`);
|
|
1466
|
-
for (const
|
|
1467
|
-
const
|
|
1468
|
-
|
|
1466
|
+
for (const a of i) {
|
|
1467
|
+
const c = JSON.stringify([
|
|
1468
|
+
...JSON.parse(o),
|
|
1469
|
+
...JSON.parse(a)
|
|
1470
|
+
]);
|
|
1471
|
+
r[c] = n.traverse({ field: a, errorIfFieldNotSet: !0 }).resourceInfo;
|
|
1469
1472
|
}
|
|
1470
1473
|
}
|
|
1471
1474
|
return {
|
|
@@ -1499,22 +1502,28 @@ function wn(s) {
|
|
|
1499
1502
|
for (const o of s.listInputFields()) {
|
|
1500
1503
|
const n = s.traverse({ field: o, errorIfFieldNotSet: !0 }), i = n.listInputFields();
|
|
1501
1504
|
if (i === void 0) throw new Error(`no partition keys for super key ${o}`);
|
|
1502
|
-
for (const
|
|
1503
|
-
if (
|
|
1504
|
-
const
|
|
1505
|
+
for (const a of i)
|
|
1506
|
+
if (a.endsWith(".index")) {
|
|
1507
|
+
const c = a.slice(0, a.length - 6), l = JSON.stringify([
|
|
1508
|
+
...JSON.parse(o),
|
|
1509
|
+
...JSON.parse(c)
|
|
1510
|
+
]);
|
|
1505
1511
|
let u = r[l];
|
|
1506
1512
|
u === void 0 && (u = {}, r[l] = u), r[l].index = n.traverse({
|
|
1507
|
-
field:
|
|
1513
|
+
field: a,
|
|
1508
1514
|
errorIfFieldNotSet: !0
|
|
1509
1515
|
}).resourceInfo;
|
|
1510
|
-
} else if (
|
|
1511
|
-
const
|
|
1516
|
+
} else if (a.endsWith(".values")) {
|
|
1517
|
+
const c = a.slice(0, a.length - 7), l = JSON.stringify([
|
|
1518
|
+
...JSON.parse(o),
|
|
1519
|
+
...JSON.parse(c)
|
|
1520
|
+
]);
|
|
1512
1521
|
let u = r[l];
|
|
1513
1522
|
u === void 0 && (u = {}, r[l] = u), r[l].values = n.traverse({
|
|
1514
|
-
field:
|
|
1523
|
+
field: a,
|
|
1515
1524
|
errorIfFieldNotSet: !0
|
|
1516
1525
|
}).resourceInfo;
|
|
1517
|
-
} else throw new Error(`unrecognized part field name: ${
|
|
1526
|
+
} else throw new Error(`unrecognized part field name: ${a}`);
|
|
1518
1527
|
}
|
|
1519
1528
|
return {
|
|
1520
1529
|
type: "BinaryPartitioned",
|
|
@@ -1538,17 +1547,17 @@ function Sn(s, e) {
|
|
|
1538
1547
|
};
|
|
1539
1548
|
}
|
|
1540
1549
|
function bn(s, e) {
|
|
1541
|
-
const t =
|
|
1542
|
-
return t.update(
|
|
1550
|
+
const t = De("sha256");
|
|
1551
|
+
return t.update(Q(s)), t.update(String(Xe(e.originalId) ? e.id : e.originalId)), t.digest().toString("hex");
|
|
1543
1552
|
}
|
|
1544
|
-
function
|
|
1545
|
-
return
|
|
1553
|
+
function lr(s, e) {
|
|
1554
|
+
return Q({ __isRef: !0, blockId: s, name: e });
|
|
1546
1555
|
}
|
|
1547
1556
|
function Rn(s, e) {
|
|
1548
|
-
return
|
|
1557
|
+
return Q({ resolvePath: s, name: e });
|
|
1549
1558
|
}
|
|
1550
1559
|
function os(s, e = !0, t = !1, r = "") {
|
|
1551
|
-
var
|
|
1560
|
+
var a, c, l;
|
|
1552
1561
|
const o = /^(?<name>.*)\.(?<type>spec|data)$/, n = /* @__PURE__ */ new Map();
|
|
1553
1562
|
for (const u of s.listInputFields()) {
|
|
1554
1563
|
const d = u.match(o);
|
|
@@ -1556,13 +1565,13 @@ function os(s, e = !0, t = !1, r = "") {
|
|
|
1556
1565
|
if (e) throw new Error(`unexpected field name ${u}`);
|
|
1557
1566
|
continue;
|
|
1558
1567
|
}
|
|
1559
|
-
let f = B((
|
|
1568
|
+
let f = B((a = d.groups) == null ? void 0 : a.name);
|
|
1560
1569
|
if (!f.startsWith(r)) {
|
|
1561
1570
|
if (e) throw new Error(`unexpected field name ${u}`);
|
|
1562
1571
|
continue;
|
|
1563
1572
|
}
|
|
1564
1573
|
f = f.slice(r.length);
|
|
1565
|
-
const h = B((
|
|
1574
|
+
const h = B((c = d.groups) == null ? void 0 : c.type);
|
|
1566
1575
|
let g = n.get(f);
|
|
1567
1576
|
switch (g === void 0 && (g = {}, n.set(f, g)), h) {
|
|
1568
1577
|
case "spec":
|
|
@@ -1591,22 +1600,22 @@ function Cn(s, e = !0, t = "", r) {
|
|
|
1591
1600
|
const o = os(s, e, !1, t);
|
|
1592
1601
|
Qs(o.locked);
|
|
1593
1602
|
const n = {};
|
|
1594
|
-
for (const [i,
|
|
1595
|
-
if (
|
|
1596
|
-
if (
|
|
1603
|
+
for (const [i, a] of o.results) {
|
|
1604
|
+
if (a.spec === void 0) throw new Error(`no spec for key ${i}`);
|
|
1605
|
+
if (a.hasData !== !0 || a.data === void 0)
|
|
1597
1606
|
throw new Error(`no data for key ${i}`);
|
|
1598
|
-
const
|
|
1599
|
-
if (
|
|
1600
|
-
if (!
|
|
1607
|
+
const c = a.data();
|
|
1608
|
+
if (c === void 0) throw new Error(`no data for key ${i}`);
|
|
1609
|
+
if (!c.ok) throw new Hs(c.error);
|
|
1601
1610
|
n[i] = {
|
|
1602
|
-
id: r.length === 0 ? bn(
|
|
1603
|
-
spec:
|
|
1604
|
-
data:
|
|
1611
|
+
id: r.length === 0 ? bn(a.spec, c.value) : Rn(r, i),
|
|
1612
|
+
spec: a.spec,
|
|
1613
|
+
data: c.value
|
|
1605
1614
|
};
|
|
1606
1615
|
}
|
|
1607
1616
|
return n;
|
|
1608
1617
|
}
|
|
1609
|
-
class
|
|
1618
|
+
class Dt {
|
|
1610
1619
|
constructor(e, t) {
|
|
1611
1620
|
S(this, "allSpecsAvailable");
|
|
1612
1621
|
this.ctx = e, this.blocks = t;
|
|
@@ -1627,21 +1636,21 @@ class Nt {
|
|
|
1627
1636
|
this.allSpecsAvailable = r;
|
|
1628
1637
|
}
|
|
1629
1638
|
getSpecByRef(e, t) {
|
|
1630
|
-
var n, i,
|
|
1639
|
+
var n, i, a, c, l, u;
|
|
1631
1640
|
const r = this.blocks.get(e);
|
|
1632
1641
|
if (r === void 0) return;
|
|
1633
|
-
let o = (
|
|
1634
|
-
if (o !== void 0 || (o = (u = (l = (
|
|
1642
|
+
let o = (a = (i = (n = r.prod) == null ? void 0 : n.results) == null ? void 0 : i.get(t)) == null ? void 0 : a.spec;
|
|
1643
|
+
if (o !== void 0 || (o = (u = (l = (c = r.staging) == null ? void 0 : c.results) == null ? void 0 : l.get(t)) == null ? void 0 : u.spec, o !== void 0)) return o;
|
|
1635
1644
|
r.staging === void 0 ? this.ctx.markUnstable(`staging_not_rendered:${e}`) : r.staging.locked ? r.prod !== void 0 && !r.prod.locked && this.ctx.markUnstable(`prod_not_locked:${e}`) : this.ctx.markUnstable(`staging_not_locked:${e}`);
|
|
1636
1645
|
}
|
|
1637
1646
|
getDataOrErrorByRef(e, t) {
|
|
1638
|
-
var i,
|
|
1647
|
+
var i, a, c;
|
|
1639
1648
|
const r = this.blocks.get(e);
|
|
1640
1649
|
if (r === void 0) return;
|
|
1641
|
-
let o = (
|
|
1650
|
+
let o = (a = (i = r.prod) == null ? void 0 : i.results) == null ? void 0 : a.get(t), n = (c = o == null ? void 0 : o.data) == null ? void 0 : c.call(o);
|
|
1642
1651
|
if (o !== void 0 && o.spec !== void 0 && n !== void 0)
|
|
1643
1652
|
return Br(n, (l) => ({
|
|
1644
|
-
id:
|
|
1653
|
+
id: lr(e, t),
|
|
1645
1654
|
spec: o.spec,
|
|
1646
1655
|
data: l
|
|
1647
1656
|
}));
|
|
@@ -1674,30 +1683,30 @@ class Nt {
|
|
|
1674
1683
|
let t = !0, r;
|
|
1675
1684
|
const o = (i) => {
|
|
1676
1685
|
r === void 0 && (r = i), t = !1;
|
|
1677
|
-
}, n = (i,
|
|
1678
|
-
if (
|
|
1679
|
-
const l =
|
|
1686
|
+
}, n = (i, a, c) => {
|
|
1687
|
+
if (c.spec !== void 0 && c.hasData === !0 && c.data !== void 0) {
|
|
1688
|
+
const l = c.data();
|
|
1680
1689
|
l !== void 0 ? e.push({
|
|
1681
|
-
ref:
|
|
1690
|
+
ref: Ge(i, a),
|
|
1682
1691
|
obj: {
|
|
1683
|
-
id: l.ok ?
|
|
1684
|
-
spec:
|
|
1692
|
+
id: l.ok ? lr(i, a) : void 0,
|
|
1693
|
+
spec: c.spec,
|
|
1685
1694
|
data: l
|
|
1686
1695
|
}
|
|
1687
|
-
}) : o(`no_data:${i}:${
|
|
1696
|
+
}) : o(`no_data:${i}:${a}`);
|
|
1688
1697
|
}
|
|
1689
1698
|
};
|
|
1690
|
-
for (const [i,
|
|
1691
|
-
const
|
|
1692
|
-
if (
|
|
1693
|
-
|
|
1694
|
-
for (const [l, u] of
|
|
1695
|
-
|
|
1699
|
+
for (const [i, a] of this.blocks) {
|
|
1700
|
+
const c = /* @__PURE__ */ new Set();
|
|
1701
|
+
if (a.prod !== void 0) {
|
|
1702
|
+
a.prod.locked || o(`prod_not_locked:${i}`);
|
|
1703
|
+
for (const [l, u] of a.prod.results)
|
|
1704
|
+
c.add(l), n(i, l, u);
|
|
1696
1705
|
}
|
|
1697
|
-
if (
|
|
1698
|
-
|
|
1699
|
-
for (const [l, u] of
|
|
1700
|
-
|
|
1706
|
+
if (a.staging !== void 0) {
|
|
1707
|
+
a.staging.locked || o(`staging_not_locked:${i}`);
|
|
1708
|
+
for (const [l, u] of a.staging.results)
|
|
1709
|
+
c.has(l) || n(i, l, u);
|
|
1701
1710
|
}
|
|
1702
1711
|
}
|
|
1703
1712
|
return { entries: e, isComplete: t, instabilityMarker: r };
|
|
@@ -1709,20 +1718,20 @@ class Nt {
|
|
|
1709
1718
|
r === void 0 && (r = n), t = !1;
|
|
1710
1719
|
};
|
|
1711
1720
|
for (const [n, i] of this.blocks) {
|
|
1712
|
-
const
|
|
1721
|
+
const a = /* @__PURE__ */ new Set();
|
|
1713
1722
|
if (i.staging !== void 0) {
|
|
1714
1723
|
i.staging.locked || o(`staging_not_locked:${n}`);
|
|
1715
|
-
for (const [
|
|
1724
|
+
for (const [c, l] of i.staging.results)
|
|
1716
1725
|
l.spec !== void 0 && (e.push({
|
|
1717
|
-
ref:
|
|
1726
|
+
ref: Ge(n, c),
|
|
1718
1727
|
obj: l.spec
|
|
1719
|
-
}),
|
|
1728
|
+
}), a.add(c));
|
|
1720
1729
|
} else o(`staging_not_rendered:${n}`);
|
|
1721
1730
|
if (i.prod !== void 0) {
|
|
1722
1731
|
i.prod.locked || o(`prod_not_locked:${n}`);
|
|
1723
|
-
for (const [
|
|
1724
|
-
|
|
1725
|
-
ref:
|
|
1732
|
+
for (const [c, l] of i.prod.results)
|
|
1733
|
+
a.has(c) || l.spec !== void 0 && e.push({
|
|
1734
|
+
ref: Ge(n, c),
|
|
1726
1735
|
obj: l.spec
|
|
1727
1736
|
});
|
|
1728
1737
|
}
|
|
@@ -1733,11 +1742,11 @@ class Nt {
|
|
|
1733
1742
|
const t = [];
|
|
1734
1743
|
for (const r of this.blocks.values()) {
|
|
1735
1744
|
const o = /* @__PURE__ */ new Set(), n = (i) => {
|
|
1736
|
-
for (const [
|
|
1737
|
-
o.has(
|
|
1738
|
-
label: r.info.label + " / " +
|
|
1739
|
-
ref:
|
|
1740
|
-
spec:
|
|
1745
|
+
for (const [a, c] of i.results)
|
|
1746
|
+
o.has(a) || c.spec === void 0 || (o.add(a), Ps(e, c.spec) && t.push({
|
|
1747
|
+
label: r.info.label + " / " + a,
|
|
1748
|
+
ref: Ge(r.info.id, a),
|
|
1749
|
+
spec: c.spec
|
|
1741
1750
|
}));
|
|
1742
1751
|
};
|
|
1743
1752
|
r.staging !== void 0 && n(r.staging), r.prod !== void 0 && n(r.prod);
|
|
@@ -1745,10 +1754,10 @@ class Nt {
|
|
|
1745
1754
|
return t;
|
|
1746
1755
|
}
|
|
1747
1756
|
static create(e, t, r) {
|
|
1748
|
-
const o = e.accessor(t).node(), n = B(o.getKeyValueAsJson(pe)),
|
|
1757
|
+
const o = e.accessor(t).node(), n = B(o.getKeyValueAsJson(pe)), a = kt(n).traverseIds("upstream", r), c = /* @__PURE__ */ new Map();
|
|
1749
1758
|
for (const l of se(n)) {
|
|
1750
|
-
if (!
|
|
1751
|
-
const u =
|
|
1759
|
+
if (!a.has(l.id)) continue;
|
|
1760
|
+
const u = ur(
|
|
1752
1761
|
o.traverse({
|
|
1753
1762
|
field: V(l.id, "prodCtx"),
|
|
1754
1763
|
ignoreError: !0,
|
|
@@ -1759,7 +1768,7 @@ class Nt {
|
|
|
1759
1768
|
field: V(l.id, "prodUiCtx"),
|
|
1760
1769
|
stableIfNotFound: !0
|
|
1761
1770
|
})
|
|
1762
|
-
), d =
|
|
1771
|
+
), d = ur(
|
|
1763
1772
|
o.traverse({
|
|
1764
1773
|
field: V(l.id, "stagingCtx"),
|
|
1765
1774
|
ignoreError: !0,
|
|
@@ -1769,17 +1778,17 @@ class Nt {
|
|
|
1769
1778
|
field: V(l.id, "stagingUiCtx")
|
|
1770
1779
|
})
|
|
1771
1780
|
);
|
|
1772
|
-
|
|
1781
|
+
c.set(l.id, { info: l, prod: u, staging: d });
|
|
1773
1782
|
}
|
|
1774
|
-
return new
|
|
1783
|
+
return new Dt(e, c);
|
|
1775
1784
|
}
|
|
1776
1785
|
}
|
|
1777
|
-
function
|
|
1786
|
+
function ur(s, e) {
|
|
1778
1787
|
if (e === void 0)
|
|
1779
1788
|
return s ? { locked: !1, results: /* @__PURE__ */ new Map() } : void 0;
|
|
1780
1789
|
if (e.ok) return os(e.value, !1, !0);
|
|
1781
1790
|
}
|
|
1782
|
-
function
|
|
1791
|
+
function Bt(s, e) {
|
|
1783
1792
|
return {
|
|
1784
1793
|
blockId: e,
|
|
1785
1794
|
args: (n) => B(
|
|
@@ -1795,17 +1804,17 @@ function Dt(s, e) {
|
|
|
1795
1804
|
stableIfNotFound: !0
|
|
1796
1805
|
})) == null ? void 0 : i.getDataAsString();
|
|
1797
1806
|
},
|
|
1798
|
-
uiState: (n) => n.accessor(s).node().getKeyValueAsString(
|
|
1807
|
+
uiState: (n) => n.accessor(s).node().getKeyValueAsString(bt(e)),
|
|
1799
1808
|
blockMeta: (n) => {
|
|
1800
|
-
const i = n.accessor(s).node(),
|
|
1801
|
-
for (const l of se(
|
|
1802
|
-
return
|
|
1809
|
+
const i = n.accessor(s).node(), a = B(i.getKeyValueAsJson(pe)), c = /* @__PURE__ */ new Map();
|
|
1810
|
+
for (const l of se(a)) c.set(l.id, l);
|
|
1811
|
+
return c;
|
|
1803
1812
|
}
|
|
1804
1813
|
};
|
|
1805
1814
|
}
|
|
1806
1815
|
function ns(s, e) {
|
|
1807
1816
|
return {
|
|
1808
|
-
...
|
|
1817
|
+
...Bt(s, e),
|
|
1809
1818
|
prod: (t) => {
|
|
1810
1819
|
var r;
|
|
1811
1820
|
return (r = t.accessor(s).node({ ignoreError: !0 }).traverse({
|
|
@@ -1822,7 +1831,7 @@ function ns(s, e) {
|
|
|
1822
1831
|
})) == null ? void 0 : o.persist();
|
|
1823
1832
|
return r === void 0 && t.markUnstable("staging_not_rendered"), r;
|
|
1824
1833
|
},
|
|
1825
|
-
getResultsPool: (t) =>
|
|
1834
|
+
getResultsPool: (t) => Dt.create(t, s, e)
|
|
1826
1835
|
};
|
|
1827
1836
|
}
|
|
1828
1837
|
function* W(s, e) {
|
|
@@ -1896,14 +1905,14 @@ function kn(s) {
|
|
|
1896
1905
|
for (const e of W(s)) if (Pn(e)) return !0;
|
|
1897
1906
|
return !1;
|
|
1898
1907
|
}
|
|
1899
|
-
function
|
|
1908
|
+
function et(s) {
|
|
1900
1909
|
return {
|
|
1901
1910
|
type: "ReturnResult",
|
|
1902
1911
|
result: s
|
|
1903
1912
|
};
|
|
1904
1913
|
}
|
|
1905
1914
|
function P(s) {
|
|
1906
|
-
return () =>
|
|
1915
|
+
return () => et(s);
|
|
1907
1916
|
}
|
|
1908
1917
|
const On = (s) => {
|
|
1909
1918
|
const e = {};
|
|
@@ -1920,7 +1929,7 @@ const On = (s) => {
|
|
|
1920
1929
|
const e = s.source, t = s.field;
|
|
1921
1930
|
return e === void 0 || t === void 0 ? P(void 0) : ({ cCtx: r }) => {
|
|
1922
1931
|
var o;
|
|
1923
|
-
return
|
|
1932
|
+
return et((o = r.accessor(e).node().traverse(t)) == null ? void 0 : o.persist());
|
|
1924
1933
|
};
|
|
1925
1934
|
};
|
|
1926
1935
|
function is(s, e) {
|
|
@@ -1951,8 +1960,8 @@ function An(s, e) {
|
|
|
1951
1960
|
if (r === void 0) return P(void 0);
|
|
1952
1961
|
const o = {};
|
|
1953
1962
|
for (const [n, i] of Object.entries(r)) {
|
|
1954
|
-
const
|
|
1955
|
-
o[n] = $(
|
|
1963
|
+
const a = { ...s, [e.itVar]: i };
|
|
1964
|
+
o[n] = $(a, e.mapping);
|
|
1956
1965
|
}
|
|
1957
1966
|
return () => ({
|
|
1958
1967
|
type: "ScheduleSubroutine",
|
|
@@ -1977,7 +1986,7 @@ const Tn = (s) => P(s), Ln = (s) => {
|
|
|
1977
1986
|
const e = s.source;
|
|
1978
1987
|
return e === void 0 ? P(void 0) : ({ cCtx: t }) => {
|
|
1979
1988
|
var r;
|
|
1980
|
-
return
|
|
1989
|
+
return et((r = t.accessor(e).node()) == null ? void 0 : r.getDataAsJson());
|
|
1981
1990
|
};
|
|
1982
1991
|
}, xn = (s) => {
|
|
1983
1992
|
const e = s.source, t = s.field;
|
|
@@ -1988,12 +1997,12 @@ function Vn(s, e) {
|
|
|
1988
1997
|
const r = t.source;
|
|
1989
1998
|
return r === void 0 ? P(void 0) : ({ cCtx: o }) => {
|
|
1990
1999
|
const n = o.accessor(r).node(), i = {};
|
|
1991
|
-
for (const
|
|
1992
|
-
const
|
|
1993
|
-
if (
|
|
2000
|
+
for (const a of n.listInputFields()) {
|
|
2001
|
+
const c = n.traverse(a);
|
|
2002
|
+
if (c === void 0) i[a] = P(void 0);
|
|
1994
2003
|
else {
|
|
1995
|
-
const l = { ...s, [e.itVar]:
|
|
1996
|
-
i[
|
|
2004
|
+
const l = { ...s, [e.itVar]: c.persist() };
|
|
2005
|
+
i[a] = $(l, e.mapping);
|
|
1997
2006
|
}
|
|
1998
2007
|
}
|
|
1999
2008
|
return {
|
|
@@ -2092,7 +2101,7 @@ function $(s, e) {
|
|
|
2092
2101
|
switch (e.type) {
|
|
2093
2102
|
case "GetFromCtx":
|
|
2094
2103
|
const t = s[e.variable];
|
|
2095
|
-
return typeof t == "function" ? (r) =>
|
|
2104
|
+
return typeof t == "function" ? (r) => et(t(r.cCtx)) : P(t);
|
|
2096
2105
|
case "Isolate":
|
|
2097
2106
|
return ({ drivers: r }) => ({
|
|
2098
2107
|
type: "ScheduleComputable",
|
|
@@ -2308,29 +2317,29 @@ function ei(s) {
|
|
|
2308
2317
|
function ti() {
|
|
2309
2318
|
return { pendingSubroutines: /* @__PURE__ */ new Map() };
|
|
2310
2319
|
}
|
|
2311
|
-
function
|
|
2312
|
-
const o = new Mr(t), n = (
|
|
2313
|
-
if (ei(
|
|
2314
|
-
return e.result =
|
|
2315
|
-
const l = B(e.pendingSubroutines.get(
|
|
2316
|
-
if (
|
|
2317
|
-
return l.args[
|
|
2320
|
+
function dr(s, e, t, r) {
|
|
2321
|
+
const o = new Mr(t), n = (a, c) => {
|
|
2322
|
+
if (ei(a))
|
|
2323
|
+
return e.result = c, !1;
|
|
2324
|
+
const l = B(e.pendingSubroutines.get(a.op));
|
|
2325
|
+
if (a.arg in l.args) throw new Error("argument already set");
|
|
2326
|
+
return l.args[a.arg] = c, l.argCounter--, l.argCounter === 0 && (e.pendingSubroutines.delete(a.op), o.push({
|
|
2318
2327
|
destination: l.destination,
|
|
2319
2328
|
operation: l.subroutine(l.args)
|
|
2320
2329
|
})), !0;
|
|
2321
2330
|
}, i = [];
|
|
2322
2331
|
e: for (; o.length > 0; ) {
|
|
2323
|
-
const
|
|
2324
|
-
switch (
|
|
2332
|
+
const a = o.shift(), c = a.operation(s);
|
|
2333
|
+
switch (c.type) {
|
|
2325
2334
|
case "ReturnResult":
|
|
2326
|
-
if (!n(
|
|
2335
|
+
if (!n(a.destination, c.result)) break e;
|
|
2327
2336
|
break;
|
|
2328
2337
|
case "ScheduleSubroutine":
|
|
2329
|
-
const l = Symbol(), u = Object.entries(
|
|
2338
|
+
const l = Symbol(), u = Object.entries(c.args), d = u.length;
|
|
2330
2339
|
if (d === 0)
|
|
2331
2340
|
o.push({
|
|
2332
|
-
destination:
|
|
2333
|
-
operation:
|
|
2341
|
+
destination: a.destination,
|
|
2342
|
+
operation: c.subroutine({})
|
|
2334
2343
|
});
|
|
2335
2344
|
else {
|
|
2336
2345
|
for (const [f, h] of u)
|
|
@@ -2341,8 +2350,8 @@ function ur(s, e, t, r) {
|
|
|
2341
2350
|
e.pendingSubroutines.set(l, {
|
|
2342
2351
|
argCounter: d,
|
|
2343
2352
|
args: {},
|
|
2344
|
-
subroutine:
|
|
2345
|
-
destination:
|
|
2353
|
+
subroutine: c.subroutine,
|
|
2354
|
+
destination: a.destination
|
|
2346
2355
|
});
|
|
2347
2356
|
}
|
|
2348
2357
|
break;
|
|
@@ -2350,12 +2359,12 @@ function ur(s, e, t, r) {
|
|
|
2350
2359
|
if (!r)
|
|
2351
2360
|
throw new Error("asynchronous operations are forbidden in this context");
|
|
2352
2361
|
i.push({
|
|
2353
|
-
destination:
|
|
2354
|
-
computable:
|
|
2362
|
+
destination: a.destination,
|
|
2363
|
+
computable: c.computable
|
|
2355
2364
|
});
|
|
2356
2365
|
break;
|
|
2357
2366
|
default:
|
|
2358
|
-
M(
|
|
2367
|
+
M(c);
|
|
2359
2368
|
}
|
|
2360
2369
|
}
|
|
2361
2370
|
return i;
|
|
@@ -2364,7 +2373,7 @@ function ri(s, e, t, r = {}) {
|
|
|
2364
2373
|
return us(s, Qn(e), t, r);
|
|
2365
2374
|
}
|
|
2366
2375
|
function us(s, e, t, r = {}) {
|
|
2367
|
-
const o = `${e.blockId}#` +
|
|
2376
|
+
const o = `${e.blockId}#` + Q({
|
|
2368
2377
|
ctx: Object.fromEntries(
|
|
2369
2378
|
Object.entries(e).filter(([n]) => Yn.indexOf(n) === -1)
|
|
2370
2379
|
),
|
|
@@ -2372,11 +2381,11 @@ function us(s, e, t, r = {}) {
|
|
|
2372
2381
|
});
|
|
2373
2382
|
return U.makeRaw(
|
|
2374
2383
|
(n) => {
|
|
2375
|
-
const i = { drivers: s, cCtx: n },
|
|
2384
|
+
const i = { drivers: s, cCtx: n }, a = ti();
|
|
2376
2385
|
return {
|
|
2377
|
-
ir:
|
|
2386
|
+
ir: dr(
|
|
2378
2387
|
i,
|
|
2379
|
-
|
|
2388
|
+
a,
|
|
2380
2389
|
[
|
|
2381
2390
|
{
|
|
2382
2391
|
destination: Zn,
|
|
@@ -2395,13 +2404,13 @@ function us(s, e, t, r = {}) {
|
|
|
2395
2404
|
throw new Error("asynchronous operations are forbidden in this context");
|
|
2396
2405
|
}
|
|
2397
2406
|
}, f = /* @__PURE__ */ new Map();
|
|
2398
|
-
for (const [g, C] of
|
|
2407
|
+
for (const [g, C] of a.pendingSubroutines)
|
|
2399
2408
|
f.set(g, { ...C, args: { ...C.args } });
|
|
2400
2409
|
const h = {
|
|
2401
|
-
result:
|
|
2410
|
+
result: a.result,
|
|
2402
2411
|
pendingSubroutines: f
|
|
2403
2412
|
};
|
|
2404
|
-
if (
|
|
2413
|
+
if (dr(d, h, u, !1), !("result" in h))
|
|
2405
2414
|
throw new Error("illegal cfg rendering stack state, no result");
|
|
2406
2415
|
return h.result;
|
|
2407
2416
|
}
|
|
@@ -2413,10 +2422,10 @@ function us(s, e, t, r = {}) {
|
|
|
2413
2422
|
function si(s) {
|
|
2414
2423
|
return s instanceof ArrayBuffer || ArrayBuffer.isView(s);
|
|
2415
2424
|
}
|
|
2416
|
-
function
|
|
2425
|
+
function pr(s) {
|
|
2417
2426
|
return s !== void 0 ? Buffer.from(s).toString("base64") : void 0;
|
|
2418
2427
|
}
|
|
2419
|
-
class
|
|
2428
|
+
class Ze {
|
|
2420
2429
|
constructor(e, t, r, o, n) {
|
|
2421
2430
|
S(this, "callbackRegistry");
|
|
2422
2431
|
S(this, "fnJSONStringify");
|
|
@@ -2448,12 +2457,12 @@ class Qe {
|
|
|
2448
2457
|
try {
|
|
2449
2458
|
this.vm.unwrapResult(this.vm.evalCode(e, "bundle.js", { type: "global" })).dispose();
|
|
2450
2459
|
} catch (t) {
|
|
2451
|
-
throw
|
|
2460
|
+
throw Ze.cleanErrorContext(t), t;
|
|
2452
2461
|
}
|
|
2453
2462
|
}
|
|
2454
2463
|
runCallback(e, ...t) {
|
|
2455
2464
|
try {
|
|
2456
|
-
return
|
|
2465
|
+
return St.withScope((r) => {
|
|
2457
2466
|
const o = r.manage(this.vm.getProp(this.callbackRegistry, e));
|
|
2458
2467
|
if (this.vm.typeof(o) !== "function")
|
|
2459
2468
|
throw new Error(`No such callback: ${e}`);
|
|
@@ -2468,7 +2477,7 @@ class Qe {
|
|
|
2468
2477
|
);
|
|
2469
2478
|
});
|
|
2470
2479
|
} catch (r) {
|
|
2471
|
-
throw
|
|
2480
|
+
throw Ze.cleanErrorContext(r), r;
|
|
2472
2481
|
}
|
|
2473
2482
|
}
|
|
2474
2483
|
//
|
|
@@ -2523,13 +2532,13 @@ class Qe {
|
|
|
2523
2532
|
return this.getAccessor(e).listDynamicFields();
|
|
2524
2533
|
}
|
|
2525
2534
|
getKeyValueBase64(e, t) {
|
|
2526
|
-
return
|
|
2535
|
+
return pr(this.getAccessor(e).getKeyValue(t));
|
|
2527
2536
|
}
|
|
2528
2537
|
getKeyValueAsString(e, t) {
|
|
2529
2538
|
return this.getAccessor(e).getKeyValueAsString(t);
|
|
2530
2539
|
}
|
|
2531
2540
|
getDataBase64(e) {
|
|
2532
|
-
return
|
|
2541
|
+
return pr(this.getAccessor(e).getData());
|
|
2533
2542
|
}
|
|
2534
2543
|
getDataAsString(e) {
|
|
2535
2544
|
return this.getAccessor(e).getDataAsString();
|
|
@@ -2540,16 +2549,16 @@ class Qe {
|
|
|
2540
2549
|
parsePObjectCollection(e, t, r, ...o) {
|
|
2541
2550
|
const n = this.getAccessor(e);
|
|
2542
2551
|
if (!n.getIsReadyOrError()) return;
|
|
2543
|
-
const i = Cn(n, t, r, o),
|
|
2544
|
-
for (const [
|
|
2545
|
-
c
|
|
2546
|
-
return
|
|
2552
|
+
const i = Cn(n, t, r, o), a = {};
|
|
2553
|
+
for (const [c, l] of Object.entries(i))
|
|
2554
|
+
a[c] = ue(l, (u) => this.wrapAccessor(u));
|
|
2555
|
+
return a;
|
|
2547
2556
|
}
|
|
2548
2557
|
//
|
|
2549
2558
|
// Blobs
|
|
2550
2559
|
//
|
|
2551
2560
|
registerComputable(e, t) {
|
|
2552
|
-
const r = `${e}_${
|
|
2561
|
+
const r = `${e}_${Ae()}`;
|
|
2553
2562
|
return this.computablesToResolve[r] = t, r;
|
|
2554
2563
|
}
|
|
2555
2564
|
getBlobContentAsString(e) {
|
|
@@ -2718,7 +2727,7 @@ class Qe {
|
|
|
2718
2727
|
"can't instantiate PTable from this context (most porbably called from the future mapper)"
|
|
2719
2728
|
);
|
|
2720
2729
|
return this.env.driverKit.pFrameDriver.createPTable(
|
|
2721
|
-
|
|
2730
|
+
vt(
|
|
2722
2731
|
e,
|
|
2723
2732
|
(t) => ue(t, (r) => typeof r == "string" ? this.getAccessor(r) : r)
|
|
2724
2733
|
),
|
|
@@ -2742,7 +2751,7 @@ class Qe {
|
|
|
2742
2751
|
}
|
|
2743
2752
|
wrapAccessor(e) {
|
|
2744
2753
|
if (e !== void 0) {
|
|
2745
|
-
const t =
|
|
2754
|
+
const t = Ae();
|
|
2746
2755
|
return this.accessors.set(t, e), t;
|
|
2747
2756
|
}
|
|
2748
2757
|
}
|
|
@@ -2810,94 +2819,94 @@ class Qe {
|
|
|
2810
2819
|
return JSON.parse(t);
|
|
2811
2820
|
}
|
|
2812
2821
|
injectCtx() {
|
|
2813
|
-
|
|
2822
|
+
St.withScope((e) => {
|
|
2814
2823
|
const t = e.manage(this.vm.newObject()), r = this.blockCtx.args(this.computableCtx), o = this.blockCtx.activeArgs(this.computableCtx), n = this.blockCtx.uiState(this.computableCtx);
|
|
2815
2824
|
this.vm.setProp(t, "args", e.manage(this.vm.newString(r))), n !== void 0 && this.vm.setProp(t, "uiState", e.manage(this.vm.newString(n))), o !== void 0 && this.vm.setProp(t, "activeArgs", e.manage(this.vm.newString(o))), this.vm.setProp(t, "callbackRegistry", this.callbackRegistry), this.vm.setProp(
|
|
2816
2825
|
t,
|
|
2817
2826
|
"featureFlags",
|
|
2818
2827
|
this.exportObjectUniversal(ks.GlobalCfgRenderCtxFeatureFlags, e)
|
|
2819
2828
|
);
|
|
2820
|
-
const i = (
|
|
2821
|
-
this.vm.newFunction(
|
|
2829
|
+
const i = (a, c) => {
|
|
2830
|
+
this.vm.newFunction(a, c).consume((l) => this.vm.setProp(t, a, l));
|
|
2822
2831
|
};
|
|
2823
|
-
i("getAccessorHandleByName", (
|
|
2824
|
-
this.getAccessorHandleByName(this.vm.getString(
|
|
2832
|
+
i("getAccessorHandleByName", (a) => this.exportSingleValue(
|
|
2833
|
+
this.getAccessorHandleByName(this.vm.getString(a)),
|
|
2825
2834
|
void 0
|
|
2826
|
-
)), i("resolveWithCommon", (
|
|
2835
|
+
)), i("resolveWithCommon", (a, c, ...l) => this.exportSingleValue(
|
|
2827
2836
|
this.resolveWithCommon(
|
|
2828
|
-
this.vm.getString(
|
|
2829
|
-
this.importObjectViaJson(
|
|
2837
|
+
this.vm.getString(a),
|
|
2838
|
+
this.importObjectViaJson(c),
|
|
2830
2839
|
...l.map(
|
|
2831
2840
|
(u) => this.importObjectViaJson(u)
|
|
2832
2841
|
)
|
|
2833
2842
|
),
|
|
2834
2843
|
void 0
|
|
2835
|
-
)), i("getResourceType", (
|
|
2836
|
-
this.getKeyValueBase64(this.vm.getString(
|
|
2844
|
+
)), i("getResourceType", (a) => this.exportObjectViaJson(this.getResourceType(this.vm.getString(a)), void 0)), i("getInputsLocked", (a) => this.exportSingleValue(this.getInputsLocked(this.vm.getString(a)), void 0)), i("getOutputsLocked", (a) => this.exportSingleValue(this.getOutputsLocked(this.vm.getString(a)), void 0)), i("getIsReadyOrError", (a) => this.exportSingleValue(this.getIsReadyOrError(this.vm.getString(a)), void 0)), i("getIsFinal", (a) => this.exportSingleValue(this.getIsFinal(this.vm.getString(a)), void 0)), i("getError", (a) => this.exportSingleValue(this.getError(this.vm.getString(a)), void 0)), i("listInputFields", (a) => this.exportObjectViaJson(this.listInputFields(this.vm.getString(a)), void 0)), i("listOutputFields", (a) => this.exportObjectViaJson(this.listInputFields(this.vm.getString(a)), void 0)), i("listDynamicFields", (a) => this.exportObjectViaJson(this.listInputFields(this.vm.getString(a)), void 0)), i("getKeyValueBase64", (a, c) => this.exportSingleValue(
|
|
2845
|
+
this.getKeyValueBase64(this.vm.getString(a), this.vm.getString(c)),
|
|
2837
2846
|
void 0
|
|
2838
|
-
)), i("getKeyValueAsString", (
|
|
2839
|
-
this.getKeyValueAsString(this.vm.getString(
|
|
2847
|
+
)), i("getKeyValueAsString", (a, c) => this.exportSingleValue(
|
|
2848
|
+
this.getKeyValueAsString(this.vm.getString(a), this.vm.getString(c)),
|
|
2840
2849
|
void 0
|
|
2841
|
-
)), i("getDataBase64", (
|
|
2850
|
+
)), i("getDataBase64", (a) => this.exportSingleValue(this.getDataBase64(this.vm.getString(a)), void 0)), i("getDataAsString", (a) => this.exportSingleValue(this.getDataAsString(this.vm.getString(a)), void 0)), i(
|
|
2842
2851
|
"parsePObjectCollection",
|
|
2843
|
-
(
|
|
2852
|
+
(a, c, l, ...u) => this.exportObjectUniversal(
|
|
2844
2853
|
this.parsePObjectCollection(
|
|
2845
|
-
this.vm.getString(
|
|
2846
|
-
this.vm.dump(
|
|
2854
|
+
this.vm.getString(a),
|
|
2855
|
+
this.vm.dump(c),
|
|
2847
2856
|
this.vm.getString(l),
|
|
2848
2857
|
...u.map(this.vm.getString)
|
|
2849
2858
|
),
|
|
2850
2859
|
void 0
|
|
2851
2860
|
)
|
|
2852
|
-
), i("getBlobContentAsBase64", (
|
|
2853
|
-
this.getBlobContentAsBase64(this.vm.getString(
|
|
2861
|
+
), i("getBlobContentAsBase64", (a) => this.exportSingleValue(
|
|
2862
|
+
this.getBlobContentAsBase64(this.vm.getString(a)),
|
|
2854
2863
|
void 0
|
|
2855
|
-
)), i("getBlobContentAsString", (
|
|
2856
|
-
this.getBlobContentAsString(this.vm.getString(
|
|
2864
|
+
)), i("getBlobContentAsString", (a) => this.exportSingleValue(
|
|
2865
|
+
this.getBlobContentAsString(this.vm.getString(a)),
|
|
2857
2866
|
void 0
|
|
2858
|
-
)), i("getDownloadedBlobContentHandle", (
|
|
2859
|
-
this.getDownloadedBlobContentHandle(this.vm.getString(
|
|
2867
|
+
)), i("getDownloadedBlobContentHandle", (a) => this.exportSingleValue(
|
|
2868
|
+
this.getDownloadedBlobContentHandle(this.vm.getString(a)),
|
|
2860
2869
|
void 0
|
|
2861
|
-
)), i("getOnDemandBlobContentHandle", (
|
|
2862
|
-
this.getOnDemandBlobContentHandle(this.vm.getString(
|
|
2870
|
+
)), i("getOnDemandBlobContentHandle", (a) => this.exportSingleValue(
|
|
2871
|
+
this.getOnDemandBlobContentHandle(this.vm.getString(a)),
|
|
2863
2872
|
void 0
|
|
2864
|
-
)), i("extractArchiveAndGetURL", (
|
|
2865
|
-
this.extractArchiveAndGetURL(this.vm.getString(
|
|
2873
|
+
)), i("extractArchiveAndGetURL", (a, c) => this.exportSingleValue(
|
|
2874
|
+
this.extractArchiveAndGetURL(this.vm.getString(a), this.vm.getString(c)),
|
|
2866
2875
|
void 0
|
|
2867
|
-
)), i("getImportProgress", (
|
|
2868
|
-
this.getLastLogs(this.vm.getString(
|
|
2876
|
+
)), i("getImportProgress", (a) => this.exportSingleValue(this.getImportProgress(this.vm.getString(a)), void 0)), i("getLastLogs", (a, c) => this.exportSingleValue(
|
|
2877
|
+
this.getLastLogs(this.vm.getString(a), this.vm.getNumber(c)),
|
|
2869
2878
|
void 0
|
|
2870
|
-
)), i("getProgressLog", (
|
|
2871
|
-
this.getProgressLog(this.vm.getString(
|
|
2879
|
+
)), i("getProgressLog", (a, c) => this.exportSingleValue(
|
|
2880
|
+
this.getProgressLog(this.vm.getString(a), this.vm.getString(c)),
|
|
2872
2881
|
void 0
|
|
2873
|
-
)), i("getLogHandle", (
|
|
2874
|
-
this.calculateOptions(this.importObjectViaJson(
|
|
2882
|
+
)), i("getLogHandle", (a) => this.exportSingleValue(this.getLogHandle(this.vm.getString(a)), void 0)), i("getBlockLabel", (a) => this.exportSingleValue(this.getBlockLabel(this.vm.getString(a)), void 0)), i("getDataFromResultPool", (a) => this.exportObjectUniversal(this.getDataFromResultPool(), void 0)), i("getDataWithErrorsFromResultPool", (a) => this.exportObjectUniversal(this.getDataWithErrorsFromResultPool(), void 0)), i("getSpecsFromResultPool", (a) => this.exportObjectUniversal(this.getSpecsFromResultPool(), void 0)), i("calculateOptions", (a) => this.exportObjectUniversal(
|
|
2883
|
+
this.calculateOptions(this.importObjectViaJson(a)),
|
|
2875
2884
|
void 0
|
|
2876
|
-
)), i("getSpecFromResultPoolByRef", (
|
|
2885
|
+
)), i("getSpecFromResultPoolByRef", (a, c) => this.exportObjectUniversal(
|
|
2877
2886
|
this.getSpecFromResultPoolByRef(
|
|
2878
|
-
this.vm.getString(
|
|
2879
|
-
this.vm.getString(
|
|
2887
|
+
this.vm.getString(a),
|
|
2888
|
+
this.vm.getString(c)
|
|
2880
2889
|
),
|
|
2881
2890
|
void 0
|
|
2882
|
-
)), i("getDataFromResultPoolByRef", (
|
|
2891
|
+
)), i("getDataFromResultPoolByRef", (a, c) => this.exportObjectUniversal(
|
|
2883
2892
|
this.getDataFromResultPoolByRef(
|
|
2884
|
-
this.vm.getString(
|
|
2885
|
-
this.vm.getString(
|
|
2893
|
+
this.vm.getString(a),
|
|
2894
|
+
this.vm.getString(c)
|
|
2886
2895
|
),
|
|
2887
2896
|
void 0
|
|
2888
|
-
)), i("createPFrame", (
|
|
2889
|
-
this.createPFrame(this.importObjectViaJson(
|
|
2897
|
+
)), i("createPFrame", (a) => this.exportSingleValue(
|
|
2898
|
+
this.createPFrame(this.importObjectViaJson(a)),
|
|
2890
2899
|
void 0
|
|
2891
|
-
)), i("createPTable", (
|
|
2900
|
+
)), i("createPTable", (a) => this.exportSingleValue(
|
|
2892
2901
|
this.createPTable(
|
|
2893
|
-
this.importObjectViaJson(
|
|
2902
|
+
this.importObjectViaJson(a)
|
|
2894
2903
|
),
|
|
2895
2904
|
void 0
|
|
2896
2905
|
)), i("getCurrentUnstableMarker", () => this.exportSingleValue(this.getCurrentUnstableMarker(), void 0)), this.vm.setProp(this.vm.global, "cfgRenderCtx", t);
|
|
2897
2906
|
});
|
|
2898
2907
|
}
|
|
2899
2908
|
}
|
|
2900
|
-
function
|
|
2909
|
+
function tt(s, e) {
|
|
2901
2910
|
return Oe(
|
|
2902
2911
|
s.traverse(
|
|
2903
2912
|
{
|
|
@@ -2913,25 +2922,25 @@ function et(s, e) {
|
|
|
2913
2922
|
}
|
|
2914
2923
|
);
|
|
2915
2924
|
}
|
|
2916
|
-
const
|
|
2925
|
+
const _e = process.env.MI_LOG_OUTPUT_STATUS;
|
|
2917
2926
|
function oi(s, e, t, r, o, n = {}) {
|
|
2918
2927
|
const i = `${e.blockId}#lambda#${o}#${t.handle}`;
|
|
2919
|
-
return n = { ...n, key: i }, n.mode === void 0 && t.retentive === !0 && (n.mode = "StableOnlyRetentive"), U.makeRaw((
|
|
2920
|
-
const
|
|
2921
|
-
|
|
2922
|
-
const l =
|
|
2928
|
+
return n = { ...n, key: i }, n.mode === void 0 && t.retentive === !0 && (n.mode = "StableOnlyRetentive"), U.makeRaw((a) => {
|
|
2929
|
+
const c = new St();
|
|
2930
|
+
a.addOnDestroy(() => c.dispose());
|
|
2931
|
+
const l = c.manage(s.quickJs.newRuntime());
|
|
2923
2932
|
l.setMemoryLimit(1024 * 640), l.setMaxStackSize(1024 * 320);
|
|
2924
|
-
const u =
|
|
2933
|
+
const u = c.manage(l.newContext()), d = new Ze(c, u, e, s, a);
|
|
2925
2934
|
d.evaluateBundle(r.content);
|
|
2926
2935
|
const f = d.runCallback(t.handle);
|
|
2927
2936
|
d.resetComputableCtx();
|
|
2928
2937
|
let h = 0;
|
|
2929
|
-
return
|
|
2938
|
+
return _e && _e !== "unstable-only" && console.log(`Output ${t.handle} scaffold calculated.`), {
|
|
2930
2939
|
ir: d.computablesToResolve,
|
|
2931
2940
|
postprocessValue: async (g, { unstableMarker: C, stable: I }) => {
|
|
2932
2941
|
for (const [K, k] of Object.entries(g)) d.runCallback(K, k);
|
|
2933
2942
|
const N = d.importObjectUniversal(f);
|
|
2934
|
-
return h++,
|
|
2943
|
+
return h++, _e && (_e !== "unstable-only" || !I) && console.log(
|
|
2935
2944
|
I ? `Stable output ${t.handle} calculated ${N !== void 0 ? "defined" : "undefined"}; (#${h})` : `Unstable output ${t.handle}; marker = ${C}; ${N !== void 0 ? "defined" : "undefined"} (#${h})`
|
|
2936
2945
|
), N;
|
|
2937
2946
|
}
|
|
@@ -2951,10 +2960,10 @@ function ii(s, e, t) {
|
|
|
2951
2960
|
return U.make(
|
|
2952
2961
|
(r) => {
|
|
2953
2962
|
var g, C, I, N, K, k, oe, he;
|
|
2954
|
-
const o = r.accessor(s).node(), n = B(o.getKeyValueAsJson(
|
|
2955
|
-
o.getKeyValueAsJson(
|
|
2963
|
+
const o = r.accessor(s).node(), n = B(o.getKeyValueAsJson(Lt)), i = B(o.getKeyValueAsJson(Te)), a = B(o.getKeyValueAsJson(Le)), c = B(o.getKeyValueAsJson(pe)), l = B(
|
|
2964
|
+
o.getKeyValueAsJson(Ye)
|
|
2956
2965
|
), u = /* @__PURE__ */ new Map();
|
|
2957
|
-
for (const { id: T } of se(
|
|
2966
|
+
for (const { id: T } of se(c)) {
|
|
2958
2967
|
const q = o.traverse({
|
|
2959
2968
|
field: V(T, "currentArgs"),
|
|
2960
2969
|
assertFieldType: "Dynamic",
|
|
@@ -2987,17 +2996,17 @@ function ii(s, e, t) {
|
|
|
2987
2996
|
}
|
|
2988
2997
|
u.set(T, { currentArguments: q.getDataAsJson(), prod: ne });
|
|
2989
2998
|
}
|
|
2990
|
-
const d =
|
|
2999
|
+
const d = ze(c, (T) => u.get(T).currentArguments), f = new Set(l.blocksInLimbo), h = [...se(c)].map(({ id: T, label: q, renderingMode: ne }) => {
|
|
2991
3000
|
var w, R, O, E, A;
|
|
2992
3001
|
const H = B(u.get(T)), J = B(d.nodes.get(T));
|
|
2993
3002
|
let x = "NotCalculated";
|
|
2994
3003
|
H.prod !== void 0 && (f.has(T) ? x = "Limbo" : x = H.prod.finished ? "Done" : "Running");
|
|
2995
|
-
const z =
|
|
2996
|
-
const
|
|
3004
|
+
const z = tt(o, T), { sections: fe, title: v, inputsValid: p, sdkVersion: y } = Oe(z, ({ bpId: D, cfg: F, info: ge }) => {
|
|
3005
|
+
const at = Bt(s, T);
|
|
2997
3006
|
return {
|
|
2998
3007
|
sections: $e(
|
|
2999
3008
|
t,
|
|
3000
|
-
|
|
3009
|
+
at,
|
|
3001
3010
|
F.sections,
|
|
3002
3011
|
F.code,
|
|
3003
3012
|
D
|
|
@@ -3006,7 +3015,7 @@ function ii(s, e, t) {
|
|
|
3006
3015
|
F.title,
|
|
3007
3016
|
(Rs) => $e(
|
|
3008
3017
|
t,
|
|
3009
|
-
|
|
3018
|
+
at,
|
|
3010
3019
|
Rs,
|
|
3011
3020
|
F.code,
|
|
3012
3021
|
D
|
|
@@ -3014,7 +3023,7 @@ function ii(s, e, t) {
|
|
|
3014
3023
|
),
|
|
3015
3024
|
inputsValid: $e(
|
|
3016
3025
|
t,
|
|
3017
|
-
|
|
3026
|
+
at,
|
|
3018
3027
|
F.inputsValid,
|
|
3019
3028
|
F.code,
|
|
3020
3029
|
D
|
|
@@ -3053,10 +3062,10 @@ function ii(s, e, t) {
|
|
|
3053
3062
|
};
|
|
3054
3063
|
});
|
|
3055
3064
|
return {
|
|
3056
|
-
meta:
|
|
3065
|
+
meta: a,
|
|
3057
3066
|
created: new Date(n),
|
|
3058
3067
|
lastModified: new Date(i),
|
|
3059
|
-
authorMarker: o.getKeyValueAsJson(
|
|
3068
|
+
authorMarker: o.getKeyValueAsJson(Ct),
|
|
3060
3069
|
blocks: h
|
|
3061
3070
|
};
|
|
3062
3071
|
},
|
|
@@ -3068,10 +3077,10 @@ function ii(s, e, t) {
|
|
|
3068
3077
|
blocks: r.blocks.map((i) => {
|
|
3069
3078
|
var u, d;
|
|
3070
3079
|
i.inputsValid || o.add(i.id), i.stale && n.add(i.id);
|
|
3071
|
-
const
|
|
3080
|
+
const a = i.stale || i.upstreams.findIndex((f) => n.has(f)) !== -1, c = (a || i.outputErrors) && !!i.inputsValid && !i.missingReference && i.upstreams.findIndex((f) => o.has(f)) === -1, l = {
|
|
3072
3081
|
...i,
|
|
3073
|
-
canRun:
|
|
3074
|
-
stale:
|
|
3082
|
+
canRun: c,
|
|
3083
|
+
stale: a,
|
|
3075
3084
|
updateSuggestions: ((u = i.updates) == null ? void 0 : u.suggestions) ?? [],
|
|
3076
3085
|
updatedBlockPack: (d = i.updates) == null ? void 0 : d.mainSuggestion
|
|
3077
3086
|
};
|
|
@@ -3117,15 +3126,15 @@ function ci(s, e) {
|
|
|
3117
3126
|
function li(s, e, t) {
|
|
3118
3127
|
return U.make(
|
|
3119
3128
|
(r) => {
|
|
3120
|
-
var
|
|
3121
|
-
const o = r.accessor(s).node(), n =
|
|
3129
|
+
var a;
|
|
3130
|
+
const o = r.accessor(s).node(), n = tt(o, e), i = (a = o.traverse(
|
|
3122
3131
|
{
|
|
3123
3132
|
field: V(e, "blockPack"),
|
|
3124
3133
|
assertFieldType: "Dynamic"
|
|
3125
3134
|
},
|
|
3126
3135
|
{ field: L.HolderRefField, assertFieldType: "Input", errorIfFieldNotFound: !0 },
|
|
3127
3136
|
{ field: ts, assertFieldType: "Input" }
|
|
3128
|
-
)) == null ? void 0 :
|
|
3137
|
+
)) == null ? void 0 : a.persist();
|
|
3129
3138
|
return {
|
|
3130
3139
|
path: ci(i, t),
|
|
3131
3140
|
sdkVersion: n == null ? void 0 : n.cfg.sdkVersion
|
|
@@ -3139,9 +3148,9 @@ function ds(s, e, t) {
|
|
|
3139
3148
|
return U.make((i) => ds(s, e, i), {
|
|
3140
3149
|
key: `inputs#${Jr(s.rid)}#${e}`
|
|
3141
3150
|
});
|
|
3142
|
-
const r = t.accessor(s).node(), o =
|
|
3151
|
+
const r = t.accessor(s).node(), o = Bt(s, e), n = o.uiState(t);
|
|
3143
3152
|
return {
|
|
3144
|
-
author: r.getKeyValueAsJson(
|
|
3153
|
+
author: r.getKeyValueAsJson(Rt(e)),
|
|
3145
3154
|
args: JSON.parse(o.args(t)),
|
|
3146
3155
|
ui: n !== void 0 ? JSON.parse(n) : void 0
|
|
3147
3156
|
};
|
|
@@ -3150,13 +3159,13 @@ function ui(s, e, t) {
|
|
|
3150
3159
|
return U.make(
|
|
3151
3160
|
(r) => {
|
|
3152
3161
|
const o = r.accessor(s).node(), n = ns(s, e);
|
|
3153
|
-
return Oe(
|
|
3154
|
-
const
|
|
3162
|
+
return Oe(tt(o, e), ({ cfg: i, bpId: a }) => {
|
|
3163
|
+
const c = {};
|
|
3155
3164
|
for (const [l, u] of Object.entries(i.outputs)) {
|
|
3156
|
-
const d = $e(t, n, u, i.code,
|
|
3157
|
-
|
|
3165
|
+
const d = $e(t, n, u, i.code, a);
|
|
3166
|
+
c[l] = U.wrapError(d);
|
|
3158
3167
|
}
|
|
3159
|
-
return
|
|
3168
|
+
return c;
|
|
3160
3169
|
});
|
|
3161
3170
|
},
|
|
3162
3171
|
{ key: "outputs#" + Jr(s.rid) + "#" + e }
|
|
@@ -3165,15 +3174,15 @@ function ui(s, e, t) {
|
|
|
3165
3174
|
function di(s, e) {
|
|
3166
3175
|
return U.make((t) => {
|
|
3167
3176
|
const r = t.accessor(s).node(), o = B(r.getKeyValueAsJson(pe)), n = [];
|
|
3168
|
-
for (const { id: i, renderingMode:
|
|
3169
|
-
const
|
|
3170
|
-
if (
|
|
3171
|
-
const l = Object.entries(
|
|
3177
|
+
for (const { id: i, renderingMode: a } of se(o)) {
|
|
3178
|
+
const c = tt(r, i);
|
|
3179
|
+
if (c === void 0) continue;
|
|
3180
|
+
const l = Object.entries(c.cfg.outputs).map(([, d]) => d).filter((d) => ni(d)).map((d) => d);
|
|
3172
3181
|
if (l.length === 0) continue;
|
|
3173
3182
|
const u = ns(r.persist(), i);
|
|
3174
3183
|
for (const d of l)
|
|
3175
3184
|
n.push(
|
|
3176
|
-
U.wrapError($e(e, u, d,
|
|
3185
|
+
U.wrapError($e(e, u, d, c.cfg.code, c.bpId))
|
|
3177
3186
|
);
|
|
3178
3187
|
}
|
|
3179
3188
|
return n;
|
|
@@ -3186,14 +3195,14 @@ class pi {
|
|
|
3186
3195
|
setState(e, t) {
|
|
3187
3196
|
const r = this.states.get(e);
|
|
3188
3197
|
if (r === void 0) {
|
|
3189
|
-
this.states.set(e, { state: t, change: new
|
|
3198
|
+
this.states.set(e, { state: t, change: new Qt() });
|
|
3190
3199
|
return;
|
|
3191
3200
|
}
|
|
3192
3201
|
r.state = { ...t }, r.change.markChanged();
|
|
3193
3202
|
}
|
|
3194
3203
|
readState(e, t) {
|
|
3195
3204
|
let r = this.states.get(t);
|
|
3196
|
-
return r === void 0 && (r = { state: { ...Os }, change: new
|
|
3205
|
+
return r === void 0 && (r = { state: { ...Os }, change: new Qt() }, this.states.set(t, r)), r.change.attachWatcher(e.watcher), r.state;
|
|
3197
3206
|
}
|
|
3198
3207
|
getState(e) {
|
|
3199
3208
|
return U.make(
|
|
@@ -3206,7 +3215,7 @@ class pi {
|
|
|
3206
3215
|
t !== void 0 && (this.states.delete(e), t.change.markChanged());
|
|
3207
3216
|
}
|
|
3208
3217
|
}
|
|
3209
|
-
class
|
|
3218
|
+
class jt {
|
|
3210
3219
|
constructor(e, t, r) {
|
|
3211
3220
|
/** Underlying pl resource id */
|
|
3212
3221
|
S(this, "rid");
|
|
@@ -3228,7 +3237,7 @@ class Bt {
|
|
|
3228
3237
|
async refreshLoop() {
|
|
3229
3238
|
for (; !this.destroyed; )
|
|
3230
3239
|
try {
|
|
3231
|
-
await
|
|
3240
|
+
await Me(this.env.pl, this.rid, (e) => {
|
|
3232
3241
|
e.doRefresh(this.env.ops.stagingRenderingRate);
|
|
3233
3242
|
}), await this.activeConfigs.getValue(), await _r(this.env.ops.projectRefreshInterval, this.abortController.signal);
|
|
3234
3243
|
} catch (e) {
|
|
@@ -3252,8 +3261,8 @@ class Bt {
|
|
|
3252
3261
|
*
|
|
3253
3262
|
* @return returns newly created block id
|
|
3254
3263
|
* */
|
|
3255
|
-
async addBlock(e, t, r, o = void 0, n =
|
|
3256
|
-
const i = await this.env.bpPreparer.prepare(t),
|
|
3264
|
+
async addBlock(e, t, r, o = void 0, n = Ae()) {
|
|
3265
|
+
const i = await this.env.bpPreparer.prepare(t), a = await this.env.bpPreparer.getBlockConfigContainer(t), c = jr(a);
|
|
3257
3266
|
return await Y(
|
|
3258
3267
|
this.env.pl,
|
|
3259
3268
|
this.rid,
|
|
@@ -3262,11 +3271,11 @@ class Bt {
|
|
|
3262
3271
|
{
|
|
3263
3272
|
id: n,
|
|
3264
3273
|
label: e,
|
|
3265
|
-
renderingMode:
|
|
3274
|
+
renderingMode: c.renderingMode
|
|
3266
3275
|
},
|
|
3267
3276
|
{
|
|
3268
|
-
args: JSON.stringify(
|
|
3269
|
-
uiState: JSON.stringify(
|
|
3277
|
+
args: JSON.stringify(c.initialArgs),
|
|
3278
|
+
uiState: JSON.stringify(c.initialUiState),
|
|
3270
3279
|
blockPack: i
|
|
3271
3280
|
},
|
|
3272
3281
|
r
|
|
@@ -3283,7 +3292,7 @@ class Bt {
|
|
|
3283
3292
|
this.env.pl,
|
|
3284
3293
|
this.rid,
|
|
3285
3294
|
o,
|
|
3286
|
-
(
|
|
3295
|
+
(a) => a.migrateBlockPack(
|
|
3287
3296
|
e,
|
|
3288
3297
|
n,
|
|
3289
3298
|
r ? JSON.stringify(i.initialArgs) : void 0
|
|
@@ -3314,10 +3323,10 @@ class Bt {
|
|
|
3314
3323
|
{
|
|
3315
3324
|
id: n.id,
|
|
3316
3325
|
label: n.label,
|
|
3317
|
-
blocks: e.map((
|
|
3318
|
-
const
|
|
3319
|
-
if (
|
|
3320
|
-
return
|
|
3326
|
+
blocks: e.map((a) => {
|
|
3327
|
+
const c = n.blocks.find((l) => l.id === a);
|
|
3328
|
+
if (c === void 0) throw new Error(`Can't find block: ${a}`);
|
|
3329
|
+
return c;
|
|
3321
3330
|
})
|
|
3322
3331
|
}
|
|
3323
3332
|
]
|
|
@@ -3331,7 +3340,7 @@ class Bt {
|
|
|
3331
3340
|
* stale state.
|
|
3332
3341
|
* */
|
|
3333
3342
|
async runBlock(e) {
|
|
3334
|
-
await
|
|
3343
|
+
await Me(this.env.pl, this.rid, (t) => t.renderProduction([e], !0)), await this.projectTree.refreshState();
|
|
3335
3344
|
}
|
|
3336
3345
|
/**
|
|
3337
3346
|
* Stops the block if it is running by destroying its production state. All
|
|
@@ -3339,7 +3348,7 @@ class Bt {
|
|
|
3339
3348
|
* calculated.
|
|
3340
3349
|
* */
|
|
3341
3350
|
async stopBlock(e) {
|
|
3342
|
-
await
|
|
3351
|
+
await Me(this.env.pl, this.rid, (t) => t.stopProduction(e)), await this.projectTree.refreshState();
|
|
3343
3352
|
}
|
|
3344
3353
|
// /** Update block label. */
|
|
3345
3354
|
// public async setBlockLabel(blockId: string, label: string, author?: AuthorMarker) {
|
|
@@ -3402,15 +3411,15 @@ class Bt {
|
|
|
3402
3411
|
/** Resets arguments and ui state of the block to initial state */
|
|
3403
3412
|
async resetBlockArgsAndUiState(e, t) {
|
|
3404
3413
|
await this.env.pl.withWriteTx("BlockInputsReset", async (r) => {
|
|
3405
|
-
const o =
|
|
3414
|
+
const o = wt(
|
|
3406
3415
|
(await r.getField(j(this.rid, V(e, "blockPack")))).value
|
|
3407
|
-
), n =
|
|
3416
|
+
), n = wt(
|
|
3408
3417
|
(await r.getField(j(o, L.HolderRefField))).value
|
|
3409
|
-
), i = await r.getResourceData(n, !1),
|
|
3418
|
+
), i = await r.getResourceData(n, !1), a = JSON.parse(
|
|
3410
3419
|
Buffer.from(B(i.data)).toString("utf-8")
|
|
3411
3420
|
);
|
|
3412
|
-
await Y(r, this.rid, t, (
|
|
3413
|
-
|
|
3421
|
+
await Y(r, this.rid, t, (c) => {
|
|
3422
|
+
c.setArgs([{ blockId: e, args: JSON.stringify(a.config.initialArgs) }]), c.setUiState(e, void 0);
|
|
3414
3423
|
}), await r.commit();
|
|
3415
3424
|
}), await this.projectTree.refreshState();
|
|
3416
3425
|
}
|
|
@@ -3471,7 +3480,7 @@ class Bt {
|
|
|
3471
3480
|
await this.destroy();
|
|
3472
3481
|
}
|
|
3473
3482
|
static async init(e, t) {
|
|
3474
|
-
await
|
|
3483
|
+
await Me(e.pl, t, (o) => {
|
|
3475
3484
|
});
|
|
3476
3485
|
const r = await Gr.init(
|
|
3477
3486
|
e.pl,
|
|
@@ -3482,7 +3491,7 @@ class Bt {
|
|
|
3482
3491
|
},
|
|
3483
3492
|
e.logger
|
|
3484
3493
|
);
|
|
3485
|
-
return new
|
|
3494
|
+
return new jt(e, t, r);
|
|
3486
3495
|
}
|
|
3487
3496
|
}
|
|
3488
3497
|
function hi(s) {
|
|
@@ -3546,7 +3555,7 @@ function gi(s) {
|
|
|
3546
3555
|
function mi(s) {
|
|
3547
3556
|
return s && s.__esModule && Object.prototype.hasOwnProperty.call(s, "default") ? s.default : s;
|
|
3548
3557
|
}
|
|
3549
|
-
var
|
|
3558
|
+
var $t = { exports: {} };
|
|
3550
3559
|
const vi = "2.0.0", fs = 256, yi = Number.MAX_SAFE_INTEGER || /* istanbul ignore next */
|
|
3551
3560
|
9007199254740991, wi = 16, Si = fs - 6, bi = [
|
|
3552
3561
|
"major",
|
|
@@ -3557,7 +3566,7 @@ const vi = "2.0.0", fs = 256, yi = Number.MAX_SAFE_INTEGER || /* istanbul ignore
|
|
|
3557
3566
|
"prepatch",
|
|
3558
3567
|
"prerelease"
|
|
3559
3568
|
];
|
|
3560
|
-
var
|
|
3569
|
+
var rt = {
|
|
3561
3570
|
MAX_LENGTH: fs,
|
|
3562
3571
|
MAX_SAFE_COMPONENT_LENGTH: wi,
|
|
3563
3572
|
MAX_SAFE_BUILD_LENGTH: Si,
|
|
@@ -3569,15 +3578,15 @@ var tt = {
|
|
|
3569
3578
|
};
|
|
3570
3579
|
const Ri = typeof process == "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...s) => console.error("SEMVER", ...s) : () => {
|
|
3571
3580
|
};
|
|
3572
|
-
var
|
|
3581
|
+
var st = Ri;
|
|
3573
3582
|
(function(s, e) {
|
|
3574
3583
|
const {
|
|
3575
3584
|
MAX_SAFE_COMPONENT_LENGTH: t,
|
|
3576
3585
|
MAX_SAFE_BUILD_LENGTH: r,
|
|
3577
3586
|
MAX_LENGTH: o
|
|
3578
|
-
} =
|
|
3587
|
+
} = rt, n = st;
|
|
3579
3588
|
e = s.exports = {};
|
|
3580
|
-
const i = e.re = [],
|
|
3589
|
+
const i = e.re = [], a = e.safeRe = [], c = e.src = [], l = e.t = {};
|
|
3581
3590
|
let u = 0;
|
|
3582
3591
|
const d = "[a-zA-Z0-9-]", f = [
|
|
3583
3592
|
["\\s", 1],
|
|
@@ -3589,48 +3598,48 @@ var rt = Ri;
|
|
|
3589
3598
|
return C;
|
|
3590
3599
|
}, g = (C, I, N) => {
|
|
3591
3600
|
const K = h(I), k = u++;
|
|
3592
|
-
n(C, k, I), l[C] = k,
|
|
3601
|
+
n(C, k, I), l[C] = k, c[k] = I, i[k] = new RegExp(I, N ? "g" : void 0), a[k] = new RegExp(K, N ? "g" : void 0);
|
|
3593
3602
|
};
|
|
3594
|
-
g("NUMERICIDENTIFIER", "0|[1-9]\\d*"), g("NUMERICIDENTIFIERLOOSE", "\\d+"), g("NONNUMERICIDENTIFIER", `\\d*[a-zA-Z-]${d}*`), g("MAINVERSION", `(${
|
|
3595
|
-
})(
|
|
3596
|
-
var
|
|
3603
|
+
g("NUMERICIDENTIFIER", "0|[1-9]\\d*"), g("NUMERICIDENTIFIERLOOSE", "\\d+"), g("NONNUMERICIDENTIFIER", `\\d*[a-zA-Z-]${d}*`), g("MAINVERSION", `(${c[l.NUMERICIDENTIFIER]})\\.(${c[l.NUMERICIDENTIFIER]})\\.(${c[l.NUMERICIDENTIFIER]})`), g("MAINVERSIONLOOSE", `(${c[l.NUMERICIDENTIFIERLOOSE]})\\.(${c[l.NUMERICIDENTIFIERLOOSE]})\\.(${c[l.NUMERICIDENTIFIERLOOSE]})`), g("PRERELEASEIDENTIFIER", `(?:${c[l.NUMERICIDENTIFIER]}|${c[l.NONNUMERICIDENTIFIER]})`), g("PRERELEASEIDENTIFIERLOOSE", `(?:${c[l.NUMERICIDENTIFIERLOOSE]}|${c[l.NONNUMERICIDENTIFIER]})`), g("PRERELEASE", `(?:-(${c[l.PRERELEASEIDENTIFIER]}(?:\\.${c[l.PRERELEASEIDENTIFIER]})*))`), g("PRERELEASELOOSE", `(?:-?(${c[l.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${c[l.PRERELEASEIDENTIFIERLOOSE]})*))`), g("BUILDIDENTIFIER", `${d}+`), g("BUILD", `(?:\\+(${c[l.BUILDIDENTIFIER]}(?:\\.${c[l.BUILDIDENTIFIER]})*))`), g("FULLPLAIN", `v?${c[l.MAINVERSION]}${c[l.PRERELEASE]}?${c[l.BUILD]}?`), g("FULL", `^${c[l.FULLPLAIN]}$`), g("LOOSEPLAIN", `[v=\\s]*${c[l.MAINVERSIONLOOSE]}${c[l.PRERELEASELOOSE]}?${c[l.BUILD]}?`), g("LOOSE", `^${c[l.LOOSEPLAIN]}$`), g("GTLT", "((?:<|>)?=?)"), g("XRANGEIDENTIFIERLOOSE", `${c[l.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`), g("XRANGEIDENTIFIER", `${c[l.NUMERICIDENTIFIER]}|x|X|\\*`), g("XRANGEPLAIN", `[v=\\s]*(${c[l.XRANGEIDENTIFIER]})(?:\\.(${c[l.XRANGEIDENTIFIER]})(?:\\.(${c[l.XRANGEIDENTIFIER]})(?:${c[l.PRERELEASE]})?${c[l.BUILD]}?)?)?`), g("XRANGEPLAINLOOSE", `[v=\\s]*(${c[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[l.XRANGEIDENTIFIERLOOSE]})(?:${c[l.PRERELEASELOOSE]})?${c[l.BUILD]}?)?)?`), g("XRANGE", `^${c[l.GTLT]}\\s*${c[l.XRANGEPLAIN]}$`), g("XRANGELOOSE", `^${c[l.GTLT]}\\s*${c[l.XRANGEPLAINLOOSE]}$`), g("COERCEPLAIN", `(^|[^\\d])(\\d{1,${t}})(?:\\.(\\d{1,${t}}))?(?:\\.(\\d{1,${t}}))?`), g("COERCE", `${c[l.COERCEPLAIN]}(?:$|[^\\d])`), g("COERCEFULL", c[l.COERCEPLAIN] + `(?:${c[l.PRERELEASE]})?(?:${c[l.BUILD]})?(?:$|[^\\d])`), g("COERCERTL", c[l.COERCE], !0), g("COERCERTLFULL", c[l.COERCEFULL], !0), g("LONETILDE", "(?:~>?)"), g("TILDETRIM", `(\\s*)${c[l.LONETILDE]}\\s+`, !0), e.tildeTrimReplace = "$1~", g("TILDE", `^${c[l.LONETILDE]}${c[l.XRANGEPLAIN]}$`), g("TILDELOOSE", `^${c[l.LONETILDE]}${c[l.XRANGEPLAINLOOSE]}$`), g("LONECARET", "(?:\\^)"), g("CARETTRIM", `(\\s*)${c[l.LONECARET]}\\s+`, !0), e.caretTrimReplace = "$1^", g("CARET", `^${c[l.LONECARET]}${c[l.XRANGEPLAIN]}$`), g("CARETLOOSE", `^${c[l.LONECARET]}${c[l.XRANGEPLAINLOOSE]}$`), g("COMPARATORLOOSE", `^${c[l.GTLT]}\\s*(${c[l.LOOSEPLAIN]})$|^$`), g("COMPARATOR", `^${c[l.GTLT]}\\s*(${c[l.FULLPLAIN]})$|^$`), g("COMPARATORTRIM", `(\\s*)${c[l.GTLT]}\\s*(${c[l.LOOSEPLAIN]}|${c[l.XRANGEPLAIN]})`, !0), e.comparatorTrimReplace = "$1$2$3", g("HYPHENRANGE", `^\\s*(${c[l.XRANGEPLAIN]})\\s+-\\s+(${c[l.XRANGEPLAIN]})\\s*$`), g("HYPHENRANGELOOSE", `^\\s*(${c[l.XRANGEPLAINLOOSE]})\\s+-\\s+(${c[l.XRANGEPLAINLOOSE]})\\s*$`), g("STAR", "(<|>)?=?\\s*\\*"), g("GTE0", "^\\s*>=\\s*0\\.0\\.0\\s*$"), g("GTE0PRE", "^\\s*>=\\s*0\\.0\\.0-0\\s*$");
|
|
3604
|
+
})($t, $t.exports);
|
|
3605
|
+
var Be = $t.exports;
|
|
3597
3606
|
const Ci = Object.freeze({ loose: !0 }), Ei = Object.freeze({}), Pi = (s) => s ? typeof s != "object" ? Ci : s : Ei;
|
|
3598
|
-
var
|
|
3599
|
-
const
|
|
3600
|
-
const t =
|
|
3607
|
+
var xt = Pi;
|
|
3608
|
+
const hr = /^[0-9]+$/, gs = (s, e) => {
|
|
3609
|
+
const t = hr.test(s), r = hr.test(e);
|
|
3601
3610
|
return t && r && (s = +s, e = +e), s === e ? 0 : t && !r ? -1 : r && !t ? 1 : s < e ? -1 : 1;
|
|
3602
3611
|
}, ki = (s, e) => gs(e, s);
|
|
3603
3612
|
var ms = {
|
|
3604
3613
|
compareIdentifiers: gs,
|
|
3605
3614
|
rcompareIdentifiers: ki
|
|
3606
3615
|
};
|
|
3607
|
-
const
|
|
3608
|
-
let $i = class
|
|
3616
|
+
const Ke = st, { MAX_LENGTH: fr, MAX_SAFE_INTEGER: He } = rt, { safeRe: gr, t: mr } = Be, Oi = xt, { compareIdentifiers: me } = ms;
|
|
3617
|
+
let $i = class te {
|
|
3609
3618
|
constructor(e, t) {
|
|
3610
|
-
if (t = Oi(t), e instanceof
|
|
3619
|
+
if (t = Oi(t), e instanceof te) {
|
|
3611
3620
|
if (e.loose === !!t.loose && e.includePrerelease === !!t.includePrerelease)
|
|
3612
3621
|
return e;
|
|
3613
3622
|
e = e.version;
|
|
3614
3623
|
} else if (typeof e != "string")
|
|
3615
3624
|
throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);
|
|
3616
|
-
if (e.length >
|
|
3625
|
+
if (e.length > fr)
|
|
3617
3626
|
throw new TypeError(
|
|
3618
|
-
`version is longer than ${
|
|
3627
|
+
`version is longer than ${fr} characters`
|
|
3619
3628
|
);
|
|
3620
|
-
|
|
3621
|
-
const r = e.trim().match(t.loose ?
|
|
3629
|
+
Ke("SemVer", e, t), this.options = t, this.loose = !!t.loose, this.includePrerelease = !!t.includePrerelease;
|
|
3630
|
+
const r = e.trim().match(t.loose ? gr[mr.LOOSE] : gr[mr.FULL]);
|
|
3622
3631
|
if (!r)
|
|
3623
3632
|
throw new TypeError(`Invalid Version: ${e}`);
|
|
3624
|
-
if (this.raw = e, this.major = +r[1], this.minor = +r[2], this.patch = +r[3], this.major >
|
|
3633
|
+
if (this.raw = e, this.major = +r[1], this.minor = +r[2], this.patch = +r[3], this.major > He || this.major < 0)
|
|
3625
3634
|
throw new TypeError("Invalid major version");
|
|
3626
|
-
if (this.minor >
|
|
3635
|
+
if (this.minor > He || this.minor < 0)
|
|
3627
3636
|
throw new TypeError("Invalid minor version");
|
|
3628
|
-
if (this.patch >
|
|
3637
|
+
if (this.patch > He || this.patch < 0)
|
|
3629
3638
|
throw new TypeError("Invalid patch version");
|
|
3630
3639
|
r[4] ? this.prerelease = r[4].split(".").map((o) => {
|
|
3631
3640
|
if (/^[0-9]+$/.test(o)) {
|
|
3632
3641
|
const n = +o;
|
|
3633
|
-
if (n >= 0 && n <
|
|
3642
|
+
if (n >= 0 && n < He)
|
|
3634
3643
|
return n;
|
|
3635
3644
|
}
|
|
3636
3645
|
return o;
|
|
@@ -3643,18 +3652,18 @@ let $i = class ee {
|
|
|
3643
3652
|
return this.version;
|
|
3644
3653
|
}
|
|
3645
3654
|
compare(e) {
|
|
3646
|
-
if (
|
|
3655
|
+
if (Ke("SemVer.compare", this.version, this.options, e), !(e instanceof te)) {
|
|
3647
3656
|
if (typeof e == "string" && e === this.version)
|
|
3648
3657
|
return 0;
|
|
3649
|
-
e = new
|
|
3658
|
+
e = new te(e, this.options);
|
|
3650
3659
|
}
|
|
3651
3660
|
return e.version === this.version ? 0 : this.compareMain(e) || this.comparePre(e);
|
|
3652
3661
|
}
|
|
3653
3662
|
compareMain(e) {
|
|
3654
|
-
return e instanceof
|
|
3663
|
+
return e instanceof te || (e = new te(e, this.options)), me(this.major, e.major) || me(this.minor, e.minor) || me(this.patch, e.patch);
|
|
3655
3664
|
}
|
|
3656
3665
|
comparePre(e) {
|
|
3657
|
-
if (e instanceof
|
|
3666
|
+
if (e instanceof te || (e = new te(e, this.options)), this.prerelease.length && !e.prerelease.length)
|
|
3658
3667
|
return -1;
|
|
3659
3668
|
if (!this.prerelease.length && e.prerelease.length)
|
|
3660
3669
|
return 1;
|
|
@@ -3663,7 +3672,7 @@ let $i = class ee {
|
|
|
3663
3672
|
let t = 0;
|
|
3664
3673
|
do {
|
|
3665
3674
|
const r = this.prerelease[t], o = e.prerelease[t];
|
|
3666
|
-
if (
|
|
3675
|
+
if (Ke("prerelease compare", t, r, o), r === void 0 && o === void 0)
|
|
3667
3676
|
return 0;
|
|
3668
3677
|
if (o === void 0)
|
|
3669
3678
|
return 1;
|
|
@@ -3675,11 +3684,11 @@ let $i = class ee {
|
|
|
3675
3684
|
} while (++t);
|
|
3676
3685
|
}
|
|
3677
3686
|
compareBuild(e) {
|
|
3678
|
-
e instanceof
|
|
3687
|
+
e instanceof te || (e = new te(e, this.options));
|
|
3679
3688
|
let t = 0;
|
|
3680
3689
|
do {
|
|
3681
3690
|
const r = this.build[t], o = e.build[t];
|
|
3682
|
-
if (
|
|
3691
|
+
if (Ke("build compare", t, r, o), r === void 0 && o === void 0)
|
|
3683
3692
|
return 0;
|
|
3684
3693
|
if (o === void 0)
|
|
3685
3694
|
return 1;
|
|
@@ -3744,11 +3753,11 @@ let $i = class ee {
|
|
|
3744
3753
|
}
|
|
3745
3754
|
};
|
|
3746
3755
|
var _ = $i;
|
|
3747
|
-
const
|
|
3748
|
-
if (s instanceof
|
|
3756
|
+
const vr = _, Fi = (s, e, t = !1) => {
|
|
3757
|
+
if (s instanceof vr)
|
|
3749
3758
|
return s;
|
|
3750
3759
|
try {
|
|
3751
|
-
return new
|
|
3760
|
+
return new vr(s, e);
|
|
3752
3761
|
} catch (r) {
|
|
3753
3762
|
if (!t)
|
|
3754
3763
|
return null;
|
|
@@ -3766,11 +3775,11 @@ const Li = Se, Ni = (s, e) => {
|
|
|
3766
3775
|
return t ? t.version : null;
|
|
3767
3776
|
};
|
|
3768
3777
|
var Di = Ni;
|
|
3769
|
-
const
|
|
3778
|
+
const yr = _, Bi = (s, e, t, r, o) => {
|
|
3770
3779
|
typeof t == "string" && (o = r, r = t, t = void 0);
|
|
3771
3780
|
try {
|
|
3772
|
-
return new
|
|
3773
|
-
s instanceof
|
|
3781
|
+
return new yr(
|
|
3782
|
+
s instanceof yr ? s.version : s,
|
|
3774
3783
|
t
|
|
3775
3784
|
).inc(e, r, o).version;
|
|
3776
3785
|
} catch {
|
|
@@ -3778,14 +3787,14 @@ const vr = _, Bi = (s, e, t, r, o) => {
|
|
|
3778
3787
|
}
|
|
3779
3788
|
};
|
|
3780
3789
|
var ji = Bi;
|
|
3781
|
-
const
|
|
3782
|
-
const t =
|
|
3790
|
+
const wr = Se, xi = (s, e) => {
|
|
3791
|
+
const t = wr(s, null, !0), r = wr(e, null, !0), o = t.compare(r);
|
|
3783
3792
|
if (o === 0)
|
|
3784
3793
|
return null;
|
|
3785
|
-
const n = o > 0, i = n ? t : r,
|
|
3786
|
-
if (!!
|
|
3787
|
-
return !
|
|
3788
|
-
const u =
|
|
3794
|
+
const n = o > 0, i = n ? t : r, a = n ? r : t, c = !!i.prerelease.length;
|
|
3795
|
+
if (!!a.prerelease.length && !c)
|
|
3796
|
+
return !a.patch && !a.minor ? "major" : i.patch ? "patch" : i.minor ? "minor" : "major";
|
|
3797
|
+
const u = c ? "pre" : "";
|
|
3789
3798
|
return t.major !== r.major ? u + "major" : t.minor !== r.minor ? u + "minor" : t.patch !== r.patch ? u + "patch" : "prerelease";
|
|
3790
3799
|
};
|
|
3791
3800
|
var Vi = xi;
|
|
@@ -3800,34 +3809,34 @@ const zi = Se, Xi = (s, e) => {
|
|
|
3800
3809
|
return t && t.prerelease.length ? t.prerelease : null;
|
|
3801
3810
|
};
|
|
3802
3811
|
var Yi = Xi;
|
|
3803
|
-
const
|
|
3804
|
-
var
|
|
3805
|
-
const Zi =
|
|
3812
|
+
const Sr = _, Qi = (s, e, t) => new Sr(s, t).compare(new Sr(e, t));
|
|
3813
|
+
var Z = Qi;
|
|
3814
|
+
const Zi = Z, ea = (s, e, t) => Zi(e, s, t);
|
|
3806
3815
|
var ta = ea;
|
|
3807
|
-
const ra =
|
|
3816
|
+
const ra = Z, sa = (s, e) => ra(s, e, !0);
|
|
3808
3817
|
var oa = sa;
|
|
3809
|
-
const
|
|
3810
|
-
const r = new
|
|
3818
|
+
const br = _, na = (s, e, t) => {
|
|
3819
|
+
const r = new br(s, t), o = new br(e, t);
|
|
3811
3820
|
return r.compare(o) || r.compareBuild(o);
|
|
3812
3821
|
};
|
|
3813
|
-
var
|
|
3814
|
-
const ia =
|
|
3822
|
+
var Vt = na;
|
|
3823
|
+
const ia = Vt, aa = (s, e) => s.sort((t, r) => ia(t, r, e));
|
|
3815
3824
|
var ca = aa;
|
|
3816
|
-
const la =
|
|
3825
|
+
const la = Vt, ua = (s, e) => s.sort((t, r) => la(r, t, e));
|
|
3817
3826
|
var da = ua;
|
|
3818
|
-
const pa =
|
|
3819
|
-
var
|
|
3820
|
-
const fa =
|
|
3821
|
-
var
|
|
3822
|
-
const ma =
|
|
3827
|
+
const pa = Z, ha = (s, e, t) => pa(s, e, t) > 0;
|
|
3828
|
+
var ot = ha;
|
|
3829
|
+
const fa = Z, ga = (s, e, t) => fa(s, e, t) < 0;
|
|
3830
|
+
var Ut = ga;
|
|
3831
|
+
const ma = Z, va = (s, e, t) => ma(s, e, t) === 0;
|
|
3823
3832
|
var vs = va;
|
|
3824
|
-
const ya =
|
|
3833
|
+
const ya = Z, wa = (s, e, t) => ya(s, e, t) !== 0;
|
|
3825
3834
|
var ys = wa;
|
|
3826
|
-
const Sa =
|
|
3827
|
-
var
|
|
3828
|
-
const Ra =
|
|
3829
|
-
var
|
|
3830
|
-
const Ea = vs, Pa = ys, ka =
|
|
3835
|
+
const Sa = Z, ba = (s, e, t) => Sa(s, e, t) >= 0;
|
|
3836
|
+
var Jt = ba;
|
|
3837
|
+
const Ra = Z, Ca = (s, e, t) => Ra(s, e, t) <= 0;
|
|
3838
|
+
var Gt = Ca;
|
|
3839
|
+
const Ea = vs, Pa = ys, ka = ot, Oa = Jt, $a = Ut, Fa = Gt, Ia = (s, e, t, r) => {
|
|
3831
3840
|
switch (e) {
|
|
3832
3841
|
case "===":
|
|
3833
3842
|
return typeof s == "object" && (s = s.version), typeof t == "object" && (t = t.version), s === t;
|
|
@@ -3852,7 +3861,7 @@ const Ea = vs, Pa = ys, ka = st, Oa = Ut, $a = Vt, Fa = Jt, Ia = (s, e, t, r) =>
|
|
|
3852
3861
|
}
|
|
3853
3862
|
};
|
|
3854
3863
|
var ws = Ia;
|
|
3855
|
-
const Aa = _, Ta = Se, { safeRe:
|
|
3864
|
+
const Aa = _, Ta = Se, { safeRe: We, t: qe } = Be, La = (s, e) => {
|
|
3856
3865
|
if (s instanceof Aa)
|
|
3857
3866
|
return s;
|
|
3858
3867
|
if (typeof s == "number" && (s = String(s)), typeof s != "string")
|
|
@@ -3860,18 +3869,18 @@ const Aa = _, Ta = Se, { safeRe: He, t: We } = De, La = (s, e) => {
|
|
|
3860
3869
|
e = e || {};
|
|
3861
3870
|
let t = null;
|
|
3862
3871
|
if (!e.rtl)
|
|
3863
|
-
t = s.match(e.includePrerelease ?
|
|
3872
|
+
t = s.match(e.includePrerelease ? We[qe.COERCEFULL] : We[qe.COERCE]);
|
|
3864
3873
|
else {
|
|
3865
|
-
const
|
|
3874
|
+
const c = e.includePrerelease ? We[qe.COERCERTLFULL] : We[qe.COERCERTL];
|
|
3866
3875
|
let l;
|
|
3867
|
-
for (; (l =
|
|
3868
|
-
(!t || l.index + l[0].length !== t.index + t[0].length) && (t = l),
|
|
3869
|
-
|
|
3876
|
+
for (; (l = c.exec(s)) && (!t || t.index + t[0].length !== s.length); )
|
|
3877
|
+
(!t || l.index + l[0].length !== t.index + t[0].length) && (t = l), c.lastIndex = l.index + l[1].length + l[2].length;
|
|
3878
|
+
c.lastIndex = -1;
|
|
3870
3879
|
}
|
|
3871
3880
|
if (t === null)
|
|
3872
3881
|
return null;
|
|
3873
|
-
const r = t[2], o = t[3] || "0", n = t[4] || "0", i = e.includePrerelease && t[5] ? `-${t[5]}` : "",
|
|
3874
|
-
return Ta(`${r}.${o}.${n}${i}${
|
|
3882
|
+
const r = t[2], o = t[3] || "0", n = t[4] || "0", i = e.includePrerelease && t[5] ? `-${t[5]}` : "", a = e.includePrerelease && t[6] ? `+${t[6]}` : "";
|
|
3883
|
+
return Ta(`${r}.${o}.${n}${i}${a}`, e);
|
|
3875
3884
|
};
|
|
3876
3885
|
var Na = La;
|
|
3877
3886
|
class Da {
|
|
@@ -3897,10 +3906,10 @@ class Da {
|
|
|
3897
3906
|
return this;
|
|
3898
3907
|
}
|
|
3899
3908
|
}
|
|
3900
|
-
var Ba = Da,
|
|
3901
|
-
function
|
|
3902
|
-
if (
|
|
3903
|
-
|
|
3909
|
+
var Ba = Da, dt, Rr;
|
|
3910
|
+
function ee() {
|
|
3911
|
+
if (Rr) return dt;
|
|
3912
|
+
Rr = 1;
|
|
3904
3913
|
const s = /\s+/g;
|
|
3905
3914
|
class e {
|
|
3906
3915
|
constructor(p, y) {
|
|
@@ -3946,10 +3955,10 @@ function Z() {
|
|
|
3946
3955
|
const m = ((this.options.includePrerelease && h) | (this.options.loose && g)) + ":" + p, b = r.get(m);
|
|
3947
3956
|
if (b)
|
|
3948
3957
|
return b;
|
|
3949
|
-
const w = this.options.loose, R = w ?
|
|
3950
|
-
p = p.replace(R, z(this.options.includePrerelease)), i("hyphen replace", p), p = p.replace(
|
|
3958
|
+
const w = this.options.loose, R = w ? c[l.HYPHENRANGELOOSE] : c[l.HYPHENRANGE];
|
|
3959
|
+
p = p.replace(R, z(this.options.includePrerelease)), i("hyphen replace", p), p = p.replace(c[l.COMPARATORTRIM], u), i("comparator trim", p), p = p.replace(c[l.TILDETRIM], d), i("tilde trim", p), p = p.replace(c[l.CARETTRIM], f), i("caret trim", p);
|
|
3951
3960
|
let O = p.split(" ").map((F) => K(F, this.options)).join(" ").split(/\s+/).map((F) => x(F, this.options));
|
|
3952
|
-
w && (O = O.filter((F) => (i("loose invalid filter", F, this.options), !!F.match(
|
|
3961
|
+
w && (O = O.filter((F) => (i("loose invalid filter", F, this.options), !!F.match(c[l.COMPARATORLOOSE])))), i("range list", O);
|
|
3953
3962
|
const E = /* @__PURE__ */ new Map(), A = O.map((F) => new n(F, this.options));
|
|
3954
3963
|
for (const F of A) {
|
|
3955
3964
|
if (C(F))
|
|
@@ -3971,7 +3980,7 @@ function Z() {
|
|
|
3971
3980
|
return !1;
|
|
3972
3981
|
if (typeof p == "string")
|
|
3973
3982
|
try {
|
|
3974
|
-
p = new
|
|
3983
|
+
p = new a(p, this.options);
|
|
3975
3984
|
} catch {
|
|
3976
3985
|
return !1;
|
|
3977
3986
|
}
|
|
@@ -3981,14 +3990,14 @@ function Z() {
|
|
|
3981
3990
|
return !1;
|
|
3982
3991
|
}
|
|
3983
3992
|
}
|
|
3984
|
-
|
|
3985
|
-
const t = Ba, r = new t(), o =
|
|
3986
|
-
safeRe:
|
|
3993
|
+
dt = e;
|
|
3994
|
+
const t = Ba, r = new t(), o = xt, n = nt(), i = st, a = _, {
|
|
3995
|
+
safeRe: c,
|
|
3987
3996
|
t: l,
|
|
3988
3997
|
comparatorTrimReplace: u,
|
|
3989
3998
|
tildeTrimReplace: d,
|
|
3990
3999
|
caretTrimReplace: f
|
|
3991
|
-
} =
|
|
4000
|
+
} = Be, { FLAG_INCLUDE_PRERELEASE: h, FLAG_LOOSE: g } = rt, C = (v) => v.value === "<0.0.0-0", I = (v) => v.value === "", N = (v, p) => {
|
|
3992
4001
|
let y = !0;
|
|
3993
4002
|
const m = v.slice();
|
|
3994
4003
|
let b = m.pop();
|
|
@@ -3996,7 +4005,7 @@ function Z() {
|
|
|
3996
4005
|
y = m.every((w) => b.intersects(w, p)), b = m.pop();
|
|
3997
4006
|
return y;
|
|
3998
4007
|
}, K = (v, p) => (i("comp", v, p), v = T(v, p), i("caret", v), v = oe(v, p), i("tildes", v), v = ne(v, p), i("xrange", v), v = J(v, p), i("stars", v), v), k = (v) => !v || v.toLowerCase() === "x" || v === "*", oe = (v, p) => v.trim().split(/\s+/).map((y) => he(y, p)).join(" "), he = (v, p) => {
|
|
3999
|
-
const y = p.loose ?
|
|
4008
|
+
const y = p.loose ? c[l.TILDELOOSE] : c[l.TILDE];
|
|
4000
4009
|
return v.replace(y, (m, b, w, R, O) => {
|
|
4001
4010
|
i("tilde", v, m, b, w, R, O);
|
|
4002
4011
|
let E;
|
|
@@ -4004,7 +4013,7 @@ function Z() {
|
|
|
4004
4013
|
});
|
|
4005
4014
|
}, T = (v, p) => v.trim().split(/\s+/).map((y) => q(y, p)).join(" "), q = (v, p) => {
|
|
4006
4015
|
i("caret", v, p);
|
|
4007
|
-
const y = p.loose ?
|
|
4016
|
+
const y = p.loose ? c[l.CARETLOOSE] : c[l.CARET], m = p.includePrerelease ? "-0" : "";
|
|
4008
4017
|
return v.replace(y, (b, w, R, O, E) => {
|
|
4009
4018
|
i("caret", v, b, w, R, O, E);
|
|
4010
4019
|
let A;
|
|
@@ -4012,13 +4021,13 @@ function Z() {
|
|
|
4012
4021
|
});
|
|
4013
4022
|
}, ne = (v, p) => (i("replaceXRanges", v, p), v.split(/\s+/).map((y) => H(y, p)).join(" ")), H = (v, p) => {
|
|
4014
4023
|
v = v.trim();
|
|
4015
|
-
const y = p.loose ?
|
|
4024
|
+
const y = p.loose ? c[l.XRANGELOOSE] : c[l.XRANGE];
|
|
4016
4025
|
return v.replace(y, (m, b, w, R, O, E) => {
|
|
4017
4026
|
i("xRange", v, m, b, w, R, O, E);
|
|
4018
4027
|
const A = k(w), D = A || k(R), F = D || k(O), ge = F;
|
|
4019
4028
|
return b === "=" && ge && (b = ""), E = p.includePrerelease ? "-0" : "", A ? b === ">" || b === "<" ? m = "<0.0.0-0" : m = "*" : b && ge ? (D && (R = 0), O = 0, b === ">" ? (b = ">=", D ? (w = +w + 1, R = 0, O = 0) : (R = +R + 1, O = 0)) : b === "<=" && (b = "<", D ? w = +w + 1 : R = +R + 1), b === "<" && (E = "-0"), m = `${b + w}.${R}.${O}${E}`) : D ? m = `>=${w}.0.0${E} <${+w + 1}.0.0-0` : F && (m = `>=${w}.${R}.0${E} <${w}.${+R + 1}.0-0`), i("xRange return", m), m;
|
|
4020
4029
|
});
|
|
4021
|
-
}, J = (v, p) => (i("replaceStars", v, p), v.trim().replace(
|
|
4030
|
+
}, J = (v, p) => (i("replaceStars", v, p), v.trim().replace(c[l.STAR], "")), x = (v, p) => (i("replaceGTE0", v, p), v.trim().replace(c[p.includePrerelease ? l.GTE0PRE : l.GTE0], "")), z = (v) => (p, y, m, b, w, R, O, E, A, D, F, ge) => (k(m) ? y = "" : k(b) ? y = `>=${m}.0.0${v ? "-0" : ""}` : k(w) ? y = `>=${m}.${b}.0${v ? "-0" : ""}` : R ? y = `>=${y}` : y = `>=${y}${v ? "-0" : ""}`, k(A) ? E = "" : k(D) ? E = `<${+A + 1}.0.0-0` : k(F) ? E = `<${A}.${+D + 1}.0-0` : ge ? E = `<=${A}.${D}.${F}-${ge}` : v ? E = `<${A}.${D}.${+F + 1}-0` : E = `<=${E}`, `${y} ${E}`.trim()), fe = (v, p, y) => {
|
|
4022
4031
|
for (let m = 0; m < v.length; m++)
|
|
4023
4032
|
if (!v[m].test(p))
|
|
4024
4033
|
return !1;
|
|
@@ -4033,12 +4042,12 @@ function Z() {
|
|
|
4033
4042
|
}
|
|
4034
4043
|
return !0;
|
|
4035
4044
|
};
|
|
4036
|
-
return
|
|
4045
|
+
return dt;
|
|
4037
4046
|
}
|
|
4038
|
-
var
|
|
4039
|
-
function
|
|
4040
|
-
if (
|
|
4041
|
-
|
|
4047
|
+
var pt, Cr;
|
|
4048
|
+
function nt() {
|
|
4049
|
+
if (Cr) return pt;
|
|
4050
|
+
Cr = 1;
|
|
4042
4051
|
const s = Symbol("SemVer ANY");
|
|
4043
4052
|
class e {
|
|
4044
4053
|
static get ANY() {
|
|
@@ -4056,7 +4065,7 @@ function ot() {
|
|
|
4056
4065
|
const d = this.options.loose ? r[o.COMPARATORLOOSE] : r[o.COMPARATOR], f = u.match(d);
|
|
4057
4066
|
if (!f)
|
|
4058
4067
|
throw new TypeError(`Invalid comparator: ${u}`);
|
|
4059
|
-
this.operator = f[1] !== void 0 ? f[1] : "", this.operator === "=" && (this.operator = ""), f[2] ? this.semver = new
|
|
4068
|
+
this.operator = f[1] !== void 0 ? f[1] : "", this.operator === "=" && (this.operator = ""), f[2] ? this.semver = new a(f[2], this.options.loose) : this.semver = s;
|
|
4060
4069
|
}
|
|
4061
4070
|
toString() {
|
|
4062
4071
|
return this.value;
|
|
@@ -4066,7 +4075,7 @@ function ot() {
|
|
|
4066
4075
|
return !0;
|
|
4067
4076
|
if (typeof u == "string")
|
|
4068
4077
|
try {
|
|
4069
|
-
u = new
|
|
4078
|
+
u = new a(u, this.options);
|
|
4070
4079
|
} catch {
|
|
4071
4080
|
return !1;
|
|
4072
4081
|
}
|
|
@@ -4075,14 +4084,14 @@ function ot() {
|
|
|
4075
4084
|
intersects(u, d) {
|
|
4076
4085
|
if (!(u instanceof e))
|
|
4077
4086
|
throw new TypeError("a Comparator is required");
|
|
4078
|
-
return this.operator === "" ? this.value === "" ? !0 : new
|
|
4087
|
+
return this.operator === "" ? this.value === "" ? !0 : new c(u.value, d).test(this.value) : u.operator === "" ? u.value === "" ? !0 : new c(this.value, d).test(u.semver) : (d = t(d), d.includePrerelease && (this.value === "<0.0.0-0" || u.value === "<0.0.0-0") || !d.includePrerelease && (this.value.startsWith("<0.0.0") || u.value.startsWith("<0.0.0")) ? !1 : !!(this.operator.startsWith(">") && u.operator.startsWith(">") || this.operator.startsWith("<") && u.operator.startsWith("<") || this.semver.version === u.semver.version && this.operator.includes("=") && u.operator.includes("=") || n(this.semver, "<", u.semver, d) && this.operator.startsWith(">") && u.operator.startsWith("<") || n(this.semver, ">", u.semver, d) && this.operator.startsWith("<") && u.operator.startsWith(">")));
|
|
4079
4088
|
}
|
|
4080
4089
|
}
|
|
4081
|
-
|
|
4082
|
-
const t =
|
|
4083
|
-
return
|
|
4090
|
+
pt = e;
|
|
4091
|
+
const t = xt, { safeRe: r, t: o } = Be, n = ws, i = st, a = _, c = ee();
|
|
4092
|
+
return pt;
|
|
4084
4093
|
}
|
|
4085
|
-
const ja =
|
|
4094
|
+
const ja = ee(), xa = (s, e, t) => {
|
|
4086
4095
|
try {
|
|
4087
4096
|
e = new ja(e, t);
|
|
4088
4097
|
} catch {
|
|
@@ -4090,10 +4099,10 @@ const ja = Z(), xa = (s, e, t) => {
|
|
|
4090
4099
|
}
|
|
4091
4100
|
return e.test(s);
|
|
4092
4101
|
};
|
|
4093
|
-
var
|
|
4094
|
-
const Va =
|
|
4102
|
+
var it = xa;
|
|
4103
|
+
const Va = ee(), Ua = (s, e) => new Va(s, e).set.map((t) => t.map((r) => r.value).join(" ").trim().split(" "));
|
|
4095
4104
|
var Ja = Ua;
|
|
4096
|
-
const Ga = _, Ma =
|
|
4105
|
+
const Ga = _, Ma = ee(), _a = (s, e, t) => {
|
|
4097
4106
|
let r = null, o = null, n = null;
|
|
4098
4107
|
try {
|
|
4099
4108
|
n = new Ma(e, t);
|
|
@@ -4105,7 +4114,7 @@ const Ga = _, Ma = Z(), _a = (s, e, t) => {
|
|
|
4105
4114
|
}), r;
|
|
4106
4115
|
};
|
|
4107
4116
|
var Ka = _a;
|
|
4108
|
-
const Ha = _, Wa =
|
|
4117
|
+
const Ha = _, Wa = ee(), qa = (s, e, t) => {
|
|
4109
4118
|
let r = null, o = null, n = null;
|
|
4110
4119
|
try {
|
|
4111
4120
|
n = new Wa(e, t);
|
|
@@ -4117,23 +4126,23 @@ const Ha = _, Wa = Z(), qa = (s, e, t) => {
|
|
|
4117
4126
|
}), r;
|
|
4118
4127
|
};
|
|
4119
4128
|
var za = qa;
|
|
4120
|
-
const
|
|
4129
|
+
const ht = _, Xa = ee(), Er = ot, Ya = (s, e) => {
|
|
4121
4130
|
s = new Xa(s, e);
|
|
4122
|
-
let t = new
|
|
4123
|
-
if (s.test(t) || (t = new
|
|
4131
|
+
let t = new ht("0.0.0");
|
|
4132
|
+
if (s.test(t) || (t = new ht("0.0.0-0"), s.test(t)))
|
|
4124
4133
|
return t;
|
|
4125
4134
|
t = null;
|
|
4126
4135
|
for (let r = 0; r < s.set.length; ++r) {
|
|
4127
4136
|
const o = s.set[r];
|
|
4128
4137
|
let n = null;
|
|
4129
4138
|
o.forEach((i) => {
|
|
4130
|
-
const
|
|
4139
|
+
const a = new ht(i.semver.version);
|
|
4131
4140
|
switch (i.operator) {
|
|
4132
4141
|
case ">":
|
|
4133
|
-
|
|
4142
|
+
a.prerelease.length === 0 ? a.patch++ : a.prerelease.push(0), a.raw = a.format();
|
|
4134
4143
|
case "":
|
|
4135
4144
|
case ">=":
|
|
4136
|
-
(!n ||
|
|
4145
|
+
(!n || Er(a, n)) && (n = a);
|
|
4137
4146
|
break;
|
|
4138
4147
|
case "<":
|
|
4139
4148
|
case "<=":
|
|
@@ -4141,12 +4150,12 @@ const pt = _, Xa = Z(), Cr = st, Ya = (s, e) => {
|
|
|
4141
4150
|
default:
|
|
4142
4151
|
throw new Error(`Unexpected operation: ${i.operator}`);
|
|
4143
4152
|
}
|
|
4144
|
-
}), n && (!t ||
|
|
4153
|
+
}), n && (!t || Er(t, n)) && (t = n);
|
|
4145
4154
|
}
|
|
4146
4155
|
return t && s.test(t) ? t : null;
|
|
4147
4156
|
};
|
|
4148
4157
|
var Qa = Ya;
|
|
4149
|
-
const Za =
|
|
4158
|
+
const Za = ee(), ec = (s, e) => {
|
|
4150
4159
|
try {
|
|
4151
4160
|
return new Za(s, e).range || "*";
|
|
4152
4161
|
} catch {
|
|
@@ -4154,15 +4163,15 @@ const Za = Z(), ec = (s, e) => {
|
|
|
4154
4163
|
}
|
|
4155
4164
|
};
|
|
4156
4165
|
var tc = ec;
|
|
4157
|
-
const rc = _, Ss =
|
|
4166
|
+
const rc = _, Ss = nt(), { ANY: sc } = Ss, oc = ee(), nc = it, Pr = ot, kr = Ut, ic = Gt, ac = Jt, cc = (s, e, t, r) => {
|
|
4158
4167
|
s = new rc(s, r), e = new oc(e, r);
|
|
4159
|
-
let o, n, i,
|
|
4168
|
+
let o, n, i, a, c;
|
|
4160
4169
|
switch (t) {
|
|
4161
4170
|
case ">":
|
|
4162
|
-
o =
|
|
4171
|
+
o = Pr, n = ic, i = kr, a = ">", c = ">=";
|
|
4163
4172
|
break;
|
|
4164
4173
|
case "<":
|
|
4165
|
-
o =
|
|
4174
|
+
o = kr, n = ac, i = Pr, a = "<", c = "<=";
|
|
4166
4175
|
break;
|
|
4167
4176
|
default:
|
|
4168
4177
|
throw new TypeError('Must provide a hilo val of "<" or ">"');
|
|
@@ -4174,21 +4183,21 @@ const rc = _, Ss = ot(), { ANY: sc } = Ss, oc = Z(), nc = nt, Er = st, Pr = Vt,
|
|
|
4174
4183
|
let d = null, f = null;
|
|
4175
4184
|
if (u.forEach((h) => {
|
|
4176
4185
|
h.semver === sc && (h = new Ss(">=0.0.0")), d = d || h, f = f || h, o(h.semver, d.semver, r) ? d = h : i(h.semver, f.semver, r) && (f = h);
|
|
4177
|
-
}), d.operator ===
|
|
4186
|
+
}), d.operator === a || d.operator === c || (!f.operator || f.operator === a) && n(s, f.semver))
|
|
4178
4187
|
return !1;
|
|
4179
|
-
if (f.operator ===
|
|
4188
|
+
if (f.operator === c && i(s, f.semver))
|
|
4180
4189
|
return !1;
|
|
4181
4190
|
}
|
|
4182
4191
|
return !0;
|
|
4183
4192
|
};
|
|
4184
|
-
var
|
|
4185
|
-
const lc =
|
|
4193
|
+
var Mt = cc;
|
|
4194
|
+
const lc = Mt, uc = (s, e, t) => lc(s, e, ">", t);
|
|
4186
4195
|
var dc = uc;
|
|
4187
|
-
const pc =
|
|
4196
|
+
const pc = Mt, hc = (s, e, t) => pc(s, e, "<", t);
|
|
4188
4197
|
var fc = hc;
|
|
4189
|
-
const
|
|
4198
|
+
const Or = ee(), gc = (s, e, t) => (s = new Or(s, t), e = new Or(e, t), s.intersects(e, t));
|
|
4190
4199
|
var mc = gc;
|
|
4191
|
-
const vc =
|
|
4200
|
+
const vc = it, yc = Z;
|
|
4192
4201
|
var wc = (s, e, t) => {
|
|
4193
4202
|
const r = [];
|
|
4194
4203
|
let o = null, n = null;
|
|
@@ -4196,16 +4205,16 @@ var wc = (s, e, t) => {
|
|
|
4196
4205
|
for (const u of i)
|
|
4197
4206
|
vc(u, e, t) ? (n = u, o || (o = u)) : (n && r.push([o, n]), n = null, o = null);
|
|
4198
4207
|
o && r.push([o, null]);
|
|
4199
|
-
const
|
|
4208
|
+
const a = [];
|
|
4200
4209
|
for (const [u, d] of r)
|
|
4201
|
-
u === d ?
|
|
4202
|
-
const
|
|
4203
|
-
return
|
|
4210
|
+
u === d ? a.push(u) : !d && u === i[0] ? a.push("*") : d ? u === i[0] ? a.push(`<=${d}`) : a.push(`${u} - ${d}`) : a.push(`>=${u}`);
|
|
4211
|
+
const c = a.join(" || "), l = typeof e.raw == "string" ? e.raw : String(e);
|
|
4212
|
+
return c.length < l.length ? c : e;
|
|
4204
4213
|
};
|
|
4205
|
-
const
|
|
4214
|
+
const $r = ee(), _t = nt(), { ANY: ft } = _t, Re = it, Kt = Z, Sc = (s, e, t = {}) => {
|
|
4206
4215
|
if (s === e)
|
|
4207
4216
|
return !0;
|
|
4208
|
-
s = new
|
|
4217
|
+
s = new $r(s, t), e = new $r(e, t);
|
|
4209
4218
|
let r = !1;
|
|
4210
4219
|
e: for (const o of s.set) {
|
|
4211
4220
|
for (const n of e.set) {
|
|
@@ -4217,28 +4226,28 @@ const Or = Z(), Mt = ot(), { ANY: ht } = Mt, Re = nt, _t = Q, Sc = (s, e, t = {}
|
|
|
4217
4226
|
return !1;
|
|
4218
4227
|
}
|
|
4219
4228
|
return !0;
|
|
4220
|
-
}, bc = [new
|
|
4229
|
+
}, bc = [new _t(">=0.0.0-0")], Fr = [new _t(">=0.0.0")], Rc = (s, e, t) => {
|
|
4221
4230
|
if (s === e)
|
|
4222
4231
|
return !0;
|
|
4223
|
-
if (s.length === 1 && s[0].semver ===
|
|
4224
|
-
if (e.length === 1 && e[0].semver ===
|
|
4232
|
+
if (s.length === 1 && s[0].semver === ft) {
|
|
4233
|
+
if (e.length === 1 && e[0].semver === ft)
|
|
4225
4234
|
return !0;
|
|
4226
|
-
t.includePrerelease ? s = bc : s =
|
|
4235
|
+
t.includePrerelease ? s = bc : s = Fr;
|
|
4227
4236
|
}
|
|
4228
|
-
if (e.length === 1 && e[0].semver ===
|
|
4237
|
+
if (e.length === 1 && e[0].semver === ft) {
|
|
4229
4238
|
if (t.includePrerelease)
|
|
4230
4239
|
return !0;
|
|
4231
|
-
e =
|
|
4240
|
+
e = Fr;
|
|
4232
4241
|
}
|
|
4233
4242
|
const r = /* @__PURE__ */ new Set();
|
|
4234
4243
|
let o, n;
|
|
4235
4244
|
for (const h of s)
|
|
4236
|
-
h.operator === ">" || h.operator === ">=" ? o =
|
|
4245
|
+
h.operator === ">" || h.operator === ">=" ? o = Ir(o, h, t) : h.operator === "<" || h.operator === "<=" ? n = Ar(n, h, t) : r.add(h.semver);
|
|
4237
4246
|
if (r.size > 1)
|
|
4238
4247
|
return null;
|
|
4239
4248
|
let i;
|
|
4240
4249
|
if (o && n) {
|
|
4241
|
-
if (i =
|
|
4250
|
+
if (i = Kt(o.semver, n.semver, t), i > 0)
|
|
4242
4251
|
return null;
|
|
4243
4252
|
if (i === 0 && (o.operator !== ">=" || n.operator !== "<="))
|
|
4244
4253
|
return null;
|
|
@@ -4251,19 +4260,19 @@ const Or = Z(), Mt = ot(), { ANY: ht } = Mt, Re = nt, _t = Q, Sc = (s, e, t = {}
|
|
|
4251
4260
|
return !1;
|
|
4252
4261
|
return !0;
|
|
4253
4262
|
}
|
|
4254
|
-
let
|
|
4263
|
+
let a, c, l, u, d = n && !t.includePrerelease && n.semver.prerelease.length ? n.semver : !1, f = o && !t.includePrerelease && o.semver.prerelease.length ? o.semver : !1;
|
|
4255
4264
|
d && d.prerelease.length === 1 && n.operator === "<" && d.prerelease[0] === 0 && (d = !1);
|
|
4256
4265
|
for (const h of e) {
|
|
4257
4266
|
if (u = u || h.operator === ">" || h.operator === ">=", l = l || h.operator === "<" || h.operator === "<=", o) {
|
|
4258
4267
|
if (f && h.semver.prerelease && h.semver.prerelease.length && h.semver.major === f.major && h.semver.minor === f.minor && h.semver.patch === f.patch && (f = !1), h.operator === ">" || h.operator === ">=") {
|
|
4259
|
-
if (
|
|
4268
|
+
if (a = Ir(o, h, t), a === h && a !== o)
|
|
4260
4269
|
return !1;
|
|
4261
4270
|
} else if (o.operator === ">=" && !Re(o.semver, String(h), t))
|
|
4262
4271
|
return !1;
|
|
4263
4272
|
}
|
|
4264
4273
|
if (n) {
|
|
4265
4274
|
if (d && h.semver.prerelease && h.semver.prerelease.length && h.semver.major === d.major && h.semver.minor === d.minor && h.semver.patch === d.patch && (d = !1), h.operator === "<" || h.operator === "<=") {
|
|
4266
|
-
if (
|
|
4275
|
+
if (c = Ar(n, h, t), c === h && c !== n)
|
|
4267
4276
|
return !1;
|
|
4268
4277
|
} else if (n.operator === "<=" && !Re(n.semver, String(h), t))
|
|
4269
4278
|
return !1;
|
|
@@ -4272,19 +4281,19 @@ const Or = Z(), Mt = ot(), { ANY: ht } = Mt, Re = nt, _t = Q, Sc = (s, e, t = {}
|
|
|
4272
4281
|
return !1;
|
|
4273
4282
|
}
|
|
4274
4283
|
return !(o && l && !n && i !== 0 || n && u && !o && i !== 0 || f || d);
|
|
4275
|
-
},
|
|
4284
|
+
}, Ir = (s, e, t) => {
|
|
4276
4285
|
if (!s)
|
|
4277
4286
|
return e;
|
|
4278
|
-
const r =
|
|
4287
|
+
const r = Kt(s.semver, e.semver, t);
|
|
4279
4288
|
return r > 0 ? s : r < 0 || e.operator === ">" && s.operator === ">=" ? e : s;
|
|
4280
|
-
},
|
|
4289
|
+
}, Ar = (s, e, t) => {
|
|
4281
4290
|
if (!s)
|
|
4282
4291
|
return e;
|
|
4283
|
-
const r =
|
|
4292
|
+
const r = Kt(s.semver, e.semver, t);
|
|
4284
4293
|
return r < 0 ? s : r > 0 || e.operator === "<" && s.operator === "<=" ? e : s;
|
|
4285
4294
|
};
|
|
4286
4295
|
var Cc = Sc;
|
|
4287
|
-
const
|
|
4296
|
+
const gt = Be, Tr = rt, Ec = _, Lr = ms, Pc = Se, kc = Ti, Oc = Di, $c = ji, Fc = Vi, Ic = Gi, Ac = Ki, Tc = qi, Lc = Yi, Nc = Z, Dc = ta, Bc = oa, jc = Vt, xc = ca, Vc = da, Uc = ot, Jc = Ut, Gc = vs, Mc = ys, _c = Jt, Kc = Gt, Hc = ws, Wc = Na, qc = nt(), zc = ee(), Xc = it, Yc = Ja, Qc = Ka, Zc = za, el = Qa, tl = tc, rl = Mt, sl = dc, ol = fc, nl = mc, il = wc, al = Cc;
|
|
4288
4297
|
var cl = {
|
|
4289
4298
|
parse: Pc,
|
|
4290
4299
|
valid: kc,
|
|
@@ -4324,13 +4333,13 @@ var cl = {
|
|
|
4324
4333
|
simplifyRange: il,
|
|
4325
4334
|
subset: al,
|
|
4326
4335
|
SemVer: Ec,
|
|
4327
|
-
re:
|
|
4328
|
-
src:
|
|
4329
|
-
tokens:
|
|
4330
|
-
SEMVER_SPEC_VERSION:
|
|
4331
|
-
RELEASE_TYPES:
|
|
4332
|
-
compareIdentifiers:
|
|
4333
|
-
rcompareIdentifiers:
|
|
4336
|
+
re: gt.re,
|
|
4337
|
+
src: gt.src,
|
|
4338
|
+
tokens: gt.t,
|
|
4339
|
+
SEMVER_SPEC_VERSION: Tr.SEMVER_SPEC_VERSION,
|
|
4340
|
+
RELEASE_TYPES: Tr.RELEASE_TYPES,
|
|
4341
|
+
compareIdentifiers: Lr.compareIdentifiers,
|
|
4342
|
+
rcompareIdentifiers: Lr.rcompareIdentifiers
|
|
4334
4343
|
};
|
|
4335
4344
|
const ll = /* @__PURE__ */ mi(cl), ul = {
|
|
4336
4345
|
minDelay: 1500
|
|
@@ -4349,7 +4358,7 @@ class pl extends qs {
|
|
|
4349
4358
|
case "dev-v2":
|
|
4350
4359
|
return `dev_2_${t.currentSpec.folder}_${t.currentSpec.mtime}`;
|
|
4351
4360
|
case "from-registry-v2":
|
|
4352
|
-
return `from_registry_v2_${
|
|
4361
|
+
return `from_registry_v2_${Q(t)}`;
|
|
4353
4362
|
default:
|
|
4354
4363
|
return dl;
|
|
4355
4364
|
}
|
|
@@ -4368,31 +4377,31 @@ class pl extends qs {
|
|
|
4368
4377
|
}
|
|
4369
4378
|
case "dev-v2":
|
|
4370
4379
|
try {
|
|
4371
|
-
const i = await
|
|
4380
|
+
const i = await yt(n.folder, this.logger);
|
|
4372
4381
|
if (i === void 0) return { suggestions: [] };
|
|
4373
|
-
const
|
|
4374
|
-
return
|
|
4382
|
+
const a = await Tt(i);
|
|
4383
|
+
return a === n.mtime ? { suggestions: [] } : { mainSuggestion: { ...n, mtime: a }, suggestions: [] };
|
|
4375
4384
|
} catch (i) {
|
|
4376
4385
|
return this.logger.warn(i), { suggestions: [] };
|
|
4377
4386
|
}
|
|
4378
4387
|
case "from-registry-v2":
|
|
4379
4388
|
try {
|
|
4380
|
-
const { versionLock: i, skipVersion:
|
|
4389
|
+
const { versionLock: i, skipVersion: a } = t.settings;
|
|
4381
4390
|
if (i === "patch") return { suggestions: [] };
|
|
4382
|
-
const
|
|
4391
|
+
const c = this.registryProvider.getRegistry(n.registryUrl);
|
|
4383
4392
|
let l, u = this.preferredUpdateChannel;
|
|
4384
4393
|
if (u === void 0)
|
|
4385
4394
|
if (n.channel === void 0)
|
|
4386
|
-
if (await
|
|
4395
|
+
if (await c.getLatestOverview(n.id, ae)) u = ae;
|
|
4387
4396
|
else {
|
|
4388
|
-
if (await
|
|
4397
|
+
if (await c.getLatestOverview(n.id, we) === void 0)
|
|
4389
4398
|
return this.logger.error(
|
|
4390
4399
|
`No "any" channel record for ${Fs(n.id)}`
|
|
4391
4400
|
), { suggestions: [] };
|
|
4392
4401
|
u = we;
|
|
4393
4402
|
}
|
|
4394
4403
|
else u = n.channel;
|
|
4395
|
-
const d = await
|
|
4404
|
+
const d = await c.getUpdateSuggestions(n.id, u);
|
|
4396
4405
|
if (d === void 0 || d.length === 0) return { suggestions: [] };
|
|
4397
4406
|
d.reverse();
|
|
4398
4407
|
let f;
|
|
@@ -4412,7 +4421,7 @@ class pl extends qs {
|
|
|
4412
4421
|
update: { ...n, id: { ...n.id, version: I } }
|
|
4413
4422
|
}));
|
|
4414
4423
|
if (f === void 0) return { suggestions: h };
|
|
4415
|
-
if (
|
|
4424
|
+
if (a !== void 0 && ll.lte(f, a))
|
|
4416
4425
|
return { suggestions: h };
|
|
4417
4426
|
const g = {
|
|
4418
4427
|
...n,
|
|
@@ -4420,7 +4429,7 @@ class pl extends qs {
|
|
|
4420
4429
|
};
|
|
4421
4430
|
return (async () => {
|
|
4422
4431
|
try {
|
|
4423
|
-
await
|
|
4432
|
+
await c.getComponents(g.id);
|
|
4424
4433
|
} catch (C) {
|
|
4425
4434
|
this.logger.warn(C);
|
|
4426
4435
|
}
|
|
@@ -4436,10 +4445,10 @@ class pl extends qs {
|
|
|
4436
4445
|
}
|
|
4437
4446
|
}
|
|
4438
4447
|
resultsEqual(t, r) {
|
|
4439
|
-
return
|
|
4448
|
+
return Q(t) === Q(r);
|
|
4440
4449
|
}
|
|
4441
4450
|
}
|
|
4442
|
-
class
|
|
4451
|
+
class Nr {
|
|
4443
4452
|
constructor() {
|
|
4444
4453
|
S(this, "resources", /* @__PURE__ */ new Map());
|
|
4445
4454
|
}
|
|
@@ -4475,17 +4484,17 @@ class Lr {
|
|
|
4475
4484
|
}
|
|
4476
4485
|
}
|
|
4477
4486
|
let Ce;
|
|
4478
|
-
function
|
|
4487
|
+
function re() {
|
|
4479
4488
|
return Ce || (Ce = {
|
|
4480
4489
|
logPFrameRequests: process.env.MI_LOG_PFRAMES !== void 0,
|
|
4481
4490
|
usePFrameRs: process.env.MI_USE_PFRAMES_RS !== void 0
|
|
4482
4491
|
}, process.env.MI_LOG_TREE_STAT && (Ce.logTreeStats = process.env.MI_LOG_TREE_STAT === "cumulative" ? "cumulative" : "per-request"), Ce);
|
|
4483
4492
|
}
|
|
4484
|
-
function
|
|
4493
|
+
function Fe(s) {
|
|
4485
4494
|
return String(s.id);
|
|
4486
4495
|
}
|
|
4487
4496
|
const hl = ["Int", "Long", "Float", "Double", "String", "Bytes"];
|
|
4488
|
-
function
|
|
4497
|
+
function mt(s) {
|
|
4489
4498
|
const e = [], t = [];
|
|
4490
4499
|
for (const r of s)
|
|
4491
4500
|
r.type === "bySingleColumn" ? (e.push(r), t.push({
|
|
@@ -4524,55 +4533,72 @@ class fl {
|
|
|
4524
4533
|
throw console.log(`resolveBlobContent catched error: ${r}`), t;
|
|
4525
4534
|
}
|
|
4526
4535
|
});
|
|
4527
|
-
this.blobDriver = e, this.logger = t, this.blobContentCache = r
|
|
4528
|
-
const n = (
|
|
4529
|
-
switch (
|
|
4536
|
+
this.blobDriver = e, this.logger = t, this.blobContentCache = r;
|
|
4537
|
+
const n = (l, u) => {
|
|
4538
|
+
switch (l) {
|
|
4530
4539
|
default:
|
|
4531
4540
|
case "info":
|
|
4532
|
-
return this.logger.info(
|
|
4541
|
+
return this.logger.info(u);
|
|
4533
4542
|
case "warn":
|
|
4534
|
-
return this.logger.warn(
|
|
4543
|
+
return this.logger.warn(u);
|
|
4535
4544
|
case "error":
|
|
4536
|
-
return this.logger.error(
|
|
4545
|
+
return this.logger.error(u);
|
|
4537
4546
|
}
|
|
4538
4547
|
};
|
|
4539
|
-
for (const
|
|
4540
|
-
for (const
|
|
4541
|
-
this.blobIdToResource.set(
|
|
4542
|
-
const i =
|
|
4543
|
-
|
|
4544
|
-
|
|
4545
|
-
|
|
4546
|
-
|
|
4547
|
-
|
|
4548
|
-
|
|
4549
|
-
|
|
4550
|
-
|
|
4548
|
+
for (const l of o)
|
|
4549
|
+
for (const u of pn(l.data))
|
|
4550
|
+
this.blobIdToResource.set(Fe(u), u);
|
|
4551
|
+
const i = [
|
|
4552
|
+
...new Map(o.map((l) => ({
|
|
4553
|
+
...l,
|
|
4554
|
+
data: hn(l.data, Fe)
|
|
4555
|
+
})).map(
|
|
4556
|
+
(l) => [Q(l), l]
|
|
4557
|
+
)).values()
|
|
4558
|
+
], a = () => {
|
|
4559
|
+
try {
|
|
4560
|
+
if (re().usePFrameRs) {
|
|
4561
|
+
const l = new po(re().logPFrameRequests ? n : void 0);
|
|
4562
|
+
for (const u of i)
|
|
4563
|
+
l.addColumnSpec(u.id, u.spec);
|
|
4564
|
+
return l;
|
|
4565
|
+
} else {
|
|
4566
|
+
const l = re().logPFrameRequests ? new Ue(n) : new Ue();
|
|
4567
|
+
for (const u of i)
|
|
4568
|
+
try {
|
|
4569
|
+
l.addColumnSpec(u.id, u.spec);
|
|
4570
|
+
} catch (d) {
|
|
4571
|
+
throw new Error(
|
|
4572
|
+
`Adding column ${u.id} to PFrame failed: ${d}; Spec: ${JSON.stringify(u.spec)}.`
|
|
4573
|
+
);
|
|
4574
|
+
}
|
|
4575
|
+
return l;
|
|
4576
|
+
}
|
|
4577
|
+
} catch (l) {
|
|
4578
|
+
throw new Error(
|
|
4579
|
+
`Spec PFrame creation failed, columns: ${JSON.stringify(i)}, error: ${l}`
|
|
4580
|
+
);
|
|
4581
|
+
}
|
|
4582
|
+
}, c = () => {
|
|
4583
|
+
try {
|
|
4584
|
+
const l = re().logPFrameRequests ? new Ue(n) : new Ue();
|
|
4585
|
+
l.setDataSource(this);
|
|
4586
|
+
for (const u of i)
|
|
4551
4587
|
try {
|
|
4552
|
-
|
|
4553
|
-
} catch (
|
|
4588
|
+
l.addColumnSpec(u.id, u.spec), l.setColumnData(u.id, u.data);
|
|
4589
|
+
} catch (d) {
|
|
4554
4590
|
throw new Error(
|
|
4555
|
-
`Adding column ${
|
|
4591
|
+
`Adding column ${u.id} to PFrame failed: ${d}; Spec: ${JSON.stringify(u.spec)}, DataInfo: ${JSON.stringify(u.data)}.`
|
|
4556
4592
|
);
|
|
4557
4593
|
}
|
|
4558
|
-
return
|
|
4559
|
-
}
|
|
4560
|
-
|
|
4561
|
-
|
|
4562
|
-
|
|
4563
|
-
for (const l of o) {
|
|
4564
|
-
const u = hn(l.data, Nr);
|
|
4565
|
-
try {
|
|
4566
|
-
a.addColumnSpec(l.id, l.spec), a.setColumnData(l.id, u);
|
|
4567
|
-
} catch (d) {
|
|
4568
|
-
throw new Error(
|
|
4569
|
-
`Adding column ${l.id} to PFrame failed: ${d}; Spec: ${JSON.stringify(l.spec)}, DataInfo: ${JSON.stringify(u)}.`
|
|
4570
|
-
);
|
|
4571
|
-
}
|
|
4594
|
+
return l;
|
|
4595
|
+
} catch (l) {
|
|
4596
|
+
throw new Error(
|
|
4597
|
+
`Data PFrame creation failed, columns: ${JSON.stringify(i)}, error: ${l}`
|
|
4598
|
+
);
|
|
4572
4599
|
}
|
|
4573
|
-
return a;
|
|
4574
4600
|
};
|
|
4575
|
-
this.specPFrame =
|
|
4601
|
+
this.specPFrame = a(), this.createDataPFrame = c;
|
|
4576
4602
|
}
|
|
4577
4603
|
get disposableDataPFrame() {
|
|
4578
4604
|
const e = this.createDataPFrame();
|
|
@@ -4609,41 +4635,41 @@ class gl {
|
|
|
4609
4635
|
fetchMethod: async (n) => await Ur.readFile(n),
|
|
4610
4636
|
sizeCalculation: (n) => n.length
|
|
4611
4637
|
}), o = new Bs(1);
|
|
4612
|
-
this.blobContentCache = r, this.concurrencyLimiter = o, this.pFrames = new class extends
|
|
4638
|
+
this.blobContentCache = r, this.concurrencyLimiter = o, this.pFrames = new class extends Nr {
|
|
4613
4639
|
constructor(n, i) {
|
|
4614
4640
|
super(), this.blobDriver = n, this.logger = i;
|
|
4615
4641
|
}
|
|
4616
4642
|
createNewResource(n) {
|
|
4617
|
-
return
|
|
4643
|
+
return re().logPFrameRequests && t.info(
|
|
4618
4644
|
`PFrame creation (pFrameHandle = ${this.calculateParamsKey(n)}): ${JSON.stringify(n, Ee)}`
|
|
4619
4645
|
), new fl(this.blobDriver, this.logger, r, n);
|
|
4620
4646
|
}
|
|
4621
4647
|
calculateParamsKey(n) {
|
|
4622
4648
|
return vl(n);
|
|
4623
4649
|
}
|
|
4624
|
-
}(this.blobDriver, this.logger), this.pTables = new class extends
|
|
4650
|
+
}(this.blobDriver, this.logger), this.pTables = new class extends Nr {
|
|
4625
4651
|
constructor(n) {
|
|
4626
4652
|
super(), this.pFrames = n;
|
|
4627
4653
|
}
|
|
4628
4654
|
async createNewResource(n) {
|
|
4629
|
-
const i = n.pFrameHandle,
|
|
4655
|
+
const i = n.pFrameHandle, a = await o.run(async () => {
|
|
4630
4656
|
var l = [];
|
|
4631
4657
|
try {
|
|
4632
|
-
|
|
4658
|
+
re().logPFrameRequests && t.info(
|
|
4633
4659
|
`PTable creation (pTableHandle = ${this.calculateParamsKey(n)}): ${JSON.stringify(n, Ee)}`
|
|
4634
4660
|
);
|
|
4635
|
-
const
|
|
4636
|
-
return await
|
|
4637
|
-
src:
|
|
4638
|
-
filters:
|
|
4661
|
+
const c = je(l, this.pFrames.getByKey(i).disposableDataPFrame);
|
|
4662
|
+
return await c.dataPFrame.createTable({
|
|
4663
|
+
src: Ie(n.def.src),
|
|
4664
|
+
filters: mt(n.def.filters)
|
|
4639
4665
|
});
|
|
4640
4666
|
} catch (u) {
|
|
4641
4667
|
var d = u, f = !0;
|
|
4642
4668
|
} finally {
|
|
4643
|
-
|
|
4669
|
+
xe(l, d, f);
|
|
4644
4670
|
}
|
|
4645
4671
|
});
|
|
4646
|
-
return n.def.sorting.length !== 0 ?
|
|
4672
|
+
return n.def.sorting.length !== 0 ? a.sort(n.def.sorting) : a;
|
|
4647
4673
|
}
|
|
4648
4674
|
calculateParamsKey(n) {
|
|
4649
4675
|
return ml(n);
|
|
@@ -4663,10 +4689,10 @@ class gl {
|
|
|
4663
4689
|
return t.addOnDestroy(o.unref), o.key;
|
|
4664
4690
|
}
|
|
4665
4691
|
createPTable(e, t) {
|
|
4666
|
-
const r = this.createPFrame($s(e.src), t), o =
|
|
4667
|
-
return
|
|
4692
|
+
const r = this.createPFrame($s(e.src), t), o = vt(e, (i) => i.id), n = this.pTables.acquire({ def: o, pFrameHandle: r });
|
|
4693
|
+
return re().logPFrameRequests && this.logger.info(
|
|
4668
4694
|
`Create PTable call (pFrameHandle = ${r}; pTableHandle = ${JSON.stringify(n)}): ${JSON.stringify(
|
|
4669
|
-
|
|
4695
|
+
vt(e, (i) => i.spec),
|
|
4670
4696
|
Ee
|
|
4671
4697
|
)}`
|
|
4672
4698
|
), t.addOnDestroy(n.unref), n.key;
|
|
@@ -4680,7 +4706,7 @@ class gl {
|
|
|
4680
4706
|
compatibleWith: t.compatibleWith.length !== 0 ? [{
|
|
4681
4707
|
axesSpec: [
|
|
4682
4708
|
...new Map(t.compatibleWith.map(
|
|
4683
|
-
(n) => [
|
|
4709
|
+
(n) => [Q(n), n]
|
|
4684
4710
|
)).values()
|
|
4685
4711
|
],
|
|
4686
4712
|
qualifications: []
|
|
@@ -4691,7 +4717,7 @@ class gl {
|
|
|
4691
4717
|
async () => await this.pFrames.getByKey(e).specPFrame.findColumns(r)
|
|
4692
4718
|
)).hits.filter((n) => (
|
|
4693
4719
|
// only exactly matching columns
|
|
4694
|
-
n.mappingVariants.length === 0 || n.mappingVariants.some((i) => i.qualifications.forHit.length === 0 && i.qualifications.forQueries.every((
|
|
4720
|
+
n.mappingVariants.length === 0 || n.mappingVariants.some((i) => i.qualifications.forHit.length === 0 && i.qualifications.forQueries.every((a) => a.length === 0))
|
|
4695
4721
|
)).map((n) => n.hit)
|
|
4696
4722
|
};
|
|
4697
4723
|
}
|
|
@@ -4707,20 +4733,20 @@ class gl {
|
|
|
4707
4733
|
}
|
|
4708
4734
|
async calculateTableData(e, t) {
|
|
4709
4735
|
let r = await this.concurrencyLimiter.run(async () => {
|
|
4710
|
-
var
|
|
4736
|
+
var a = [];
|
|
4711
4737
|
try {
|
|
4712
|
-
|
|
4738
|
+
re().logPFrameRequests && this.logger.info(
|
|
4713
4739
|
`Call calculateTableData, handle = ${e}, request = ${JSON.stringify(t, Ee)}`
|
|
4714
4740
|
);
|
|
4715
|
-
const i =
|
|
4741
|
+
const i = je(a, this.pFrames.getByKey(e).disposableDataPFrame);
|
|
4716
4742
|
return await i.dataPFrame.createTable({
|
|
4717
|
-
src:
|
|
4718
|
-
filters:
|
|
4743
|
+
src: Ie(t.src),
|
|
4744
|
+
filters: mt(t.filters)
|
|
4719
4745
|
});
|
|
4720
|
-
} catch (
|
|
4721
|
-
var l =
|
|
4746
|
+
} catch (c) {
|
|
4747
|
+
var l = c, u = !0;
|
|
4722
4748
|
} finally {
|
|
4723
|
-
|
|
4749
|
+
xe(a, l, u);
|
|
4724
4750
|
}
|
|
4725
4751
|
});
|
|
4726
4752
|
if (t.sorting.length > 0) {
|
|
@@ -4732,27 +4758,27 @@ class gl {
|
|
|
4732
4758
|
const o = r.getSpec(), n = await this.concurrencyLimiter.run(
|
|
4733
4759
|
async () => await r.getData([...o.keys()])
|
|
4734
4760
|
);
|
|
4735
|
-
return r.dispose(), o.map((i,
|
|
4761
|
+
return r.dispose(), o.map((i, a) => ({
|
|
4736
4762
|
spec: i,
|
|
4737
|
-
data: n[
|
|
4763
|
+
data: n[a]
|
|
4738
4764
|
}));
|
|
4739
4765
|
}
|
|
4740
4766
|
async getUniqueValues(e, t) {
|
|
4741
4767
|
return await this.concurrencyLimiter.run(async () => {
|
|
4742
4768
|
var o = [];
|
|
4743
4769
|
try {
|
|
4744
|
-
|
|
4770
|
+
re().logPFrameRequests && this.logger.info(
|
|
4745
4771
|
`Call getUniqueValues, handle = ${e}, request = ${JSON.stringify(t, Ee)}`
|
|
4746
4772
|
);
|
|
4747
|
-
const r =
|
|
4773
|
+
const r = je(o, this.pFrames.getByKey(e).disposableDataPFrame);
|
|
4748
4774
|
return await r.dataPFrame.getUniqueValues({
|
|
4749
4775
|
...t,
|
|
4750
|
-
filters:
|
|
4776
|
+
filters: mt(t.filters)
|
|
4751
4777
|
});
|
|
4752
4778
|
} catch (n) {
|
|
4753
|
-
var i = n,
|
|
4779
|
+
var i = n, a = !0;
|
|
4754
4780
|
} finally {
|
|
4755
|
-
|
|
4781
|
+
xe(o, i, a);
|
|
4756
4782
|
}
|
|
4757
4783
|
});
|
|
4758
4784
|
}
|
|
@@ -4772,7 +4798,7 @@ class gl {
|
|
|
4772
4798
|
);
|
|
4773
4799
|
}
|
|
4774
4800
|
}
|
|
4775
|
-
function
|
|
4801
|
+
function Ie(s) {
|
|
4776
4802
|
switch (s.type) {
|
|
4777
4803
|
case "column":
|
|
4778
4804
|
return {
|
|
@@ -4784,21 +4810,21 @@ function Fe(s) {
|
|
|
4784
4810
|
case "full":
|
|
4785
4811
|
return {
|
|
4786
4812
|
type: s.type,
|
|
4787
|
-
entries: s.entries.map((e) =>
|
|
4813
|
+
entries: s.entries.map((e) => Ie(e))
|
|
4788
4814
|
};
|
|
4789
4815
|
case "outer":
|
|
4790
4816
|
return {
|
|
4791
4817
|
type: "outer",
|
|
4792
|
-
primary:
|
|
4793
|
-
secondary: s.secondary.map((e) =>
|
|
4818
|
+
primary: Ie(s.primary),
|
|
4819
|
+
secondary: s.secondary.map((e) => Ie(e))
|
|
4794
4820
|
};
|
|
4795
4821
|
default:
|
|
4796
4822
|
M(s);
|
|
4797
4823
|
}
|
|
4798
4824
|
}
|
|
4799
4825
|
function ml(s) {
|
|
4800
|
-
const e =
|
|
4801
|
-
return e.update(
|
|
4826
|
+
const e = De("sha256");
|
|
4827
|
+
return e.update(Q(s)), e.digest().toString("hex");
|
|
4802
4828
|
}
|
|
4803
4829
|
function vl(s) {
|
|
4804
4830
|
const e = [...s].map(
|
|
@@ -4810,9 +4836,9 @@ function vl(s) {
|
|
|
4810
4836
|
n = {
|
|
4811
4837
|
type: o.type,
|
|
4812
4838
|
keyLength: o.keyLength,
|
|
4813
|
-
payload: Object.entries(o.data).map(([
|
|
4814
|
-
key:
|
|
4815
|
-
value:
|
|
4839
|
+
payload: Object.entries(o.data).map(([a, c]) => ({
|
|
4840
|
+
key: a,
|
|
4841
|
+
value: c
|
|
4816
4842
|
}))
|
|
4817
4843
|
};
|
|
4818
4844
|
break;
|
|
@@ -4820,9 +4846,9 @@ function vl(s) {
|
|
|
4820
4846
|
n = {
|
|
4821
4847
|
type: o.type,
|
|
4822
4848
|
keyLength: o.partitionKeyLength,
|
|
4823
|
-
payload: Object.entries(o.parts).map(([
|
|
4824
|
-
key:
|
|
4825
|
-
value:
|
|
4849
|
+
payload: Object.entries(o.parts).map(([a, c]) => ({
|
|
4850
|
+
key: a,
|
|
4851
|
+
value: Fe(c)
|
|
4826
4852
|
}))
|
|
4827
4853
|
};
|
|
4828
4854
|
break;
|
|
@@ -4830,28 +4856,28 @@ function vl(s) {
|
|
|
4830
4856
|
n = {
|
|
4831
4857
|
type: o.type,
|
|
4832
4858
|
keyLength: o.partitionKeyLength,
|
|
4833
|
-
payload: Object.entries(o.parts).map(([
|
|
4834
|
-
key:
|
|
4835
|
-
value: [
|
|
4859
|
+
payload: Object.entries(o.parts).map(([a, c]) => ({
|
|
4860
|
+
key: a,
|
|
4861
|
+
value: [Fe(c.index), Fe(c.values)]
|
|
4836
4862
|
}))
|
|
4837
4863
|
};
|
|
4838
4864
|
break;
|
|
4839
4865
|
default:
|
|
4840
|
-
throw Error(`unsupported resource type: ${i}`);
|
|
4866
|
+
throw Error(`unsupported resource type: ${JSON.stringify(i)}`);
|
|
4841
4867
|
}
|
|
4842
|
-
return n.payload.sort((
|
|
4868
|
+
return n.payload.sort((a, c) => a.key.localeCompare(c.key)), n;
|
|
4843
4869
|
})
|
|
4844
4870
|
);
|
|
4845
4871
|
e.sort((r, o) => r.id.localeCompare(o.id));
|
|
4846
|
-
const t =
|
|
4847
|
-
return t.update(
|
|
4872
|
+
const t = De("sha256");
|
|
4873
|
+
return t.update(Q(e)), t.digest().toString("hex");
|
|
4848
4874
|
}
|
|
4849
4875
|
async function yl(s, e, t) {
|
|
4850
4876
|
const r = {
|
|
4851
4877
|
...ps,
|
|
4852
4878
|
...hs(e),
|
|
4853
4879
|
...t
|
|
4854
|
-
}, o = new Vr(r.localSecret), n = eo(r.logger, s, r.localProjections), i = to(s, r.logger),
|
|
4880
|
+
}, o = new Vr(r.localSecret), n = eo(r.logger, s, r.localProjections), i = to(s, r.logger), a = ro(s, r.logger), c = so(s, r.logger), l = new oo(
|
|
4855
4881
|
r.logger,
|
|
4856
4882
|
n,
|
|
4857
4883
|
i,
|
|
@@ -4867,8 +4893,8 @@ async function yl(s, e, t) {
|
|
|
4867
4893
|
), d = new io(
|
|
4868
4894
|
r.logger,
|
|
4869
4895
|
o,
|
|
4870
|
-
c,
|
|
4871
4896
|
a,
|
|
4897
|
+
c,
|
|
4872
4898
|
r.uploadDriverOps
|
|
4873
4899
|
), f = new ao(r.logger, i, r.logStreamDriverOps), h = new co(r.logger, f, l), g = await lo.init(
|
|
4874
4900
|
r.logger,
|
|
@@ -4889,7 +4915,7 @@ async function yl(s, e, t) {
|
|
|
4889
4915
|
};
|
|
4890
4916
|
}
|
|
4891
4917
|
class bs {
|
|
4892
|
-
constructor(e, t, r, o, n, i,
|
|
4918
|
+
constructor(e, t, r, o, n, i, a, c) {
|
|
4893
4919
|
S(this, "pl");
|
|
4894
4920
|
/** Contains a reactive list of projects along with their meta information. */
|
|
4895
4921
|
S(this, "projectList");
|
|
@@ -4897,7 +4923,7 @@ class bs {
|
|
|
4897
4923
|
// Projects
|
|
4898
4924
|
//
|
|
4899
4925
|
S(this, "openedProjectsByRid", /* @__PURE__ */ new Map());
|
|
4900
|
-
this.env = e, this.driverKit = t, this.signer = r, this.projectListResourceId = o, this.openedProjectsList = n, this.projectListTree = i, this.blockRegistryProvider =
|
|
4926
|
+
this.env = e, this.driverKit = t, this.signer = r, this.projectListResourceId = o, this.openedProjectsList = n, this.projectListTree = i, this.blockRegistryProvider = a, this.projectList = c, this.pl = this.env.pl;
|
|
4901
4927
|
}
|
|
4902
4928
|
/** Returns extended API driver kit used internally by middle layer. */
|
|
4903
4929
|
get internalDriverKit() {
|
|
@@ -4907,7 +4933,7 @@ class bs {
|
|
|
4907
4933
|
// Project List Manipulation
|
|
4908
4934
|
//
|
|
4909
4935
|
/** Creates a project with initial state and adds it to project list. */
|
|
4910
|
-
async createProject(e, t =
|
|
4936
|
+
async createProject(e, t = Ae()) {
|
|
4911
4937
|
const r = await this.pl.withWriteTx("MLCreateProject", async (o) => {
|
|
4912
4938
|
const n = await dn(o, e);
|
|
4913
4939
|
return o.createField(j(this.projectListResourceId, t), "Dynamic", n), await o.commit(), await _s(n);
|
|
@@ -4930,7 +4956,7 @@ class bs {
|
|
|
4930
4956
|
async projectIdToResourceId(e) {
|
|
4931
4957
|
return await this.pl.withReadTx("Project id to resource id", async (t) => {
|
|
4932
4958
|
const r = (await t.getField(j(this.projectListResourceId, e))).value;
|
|
4933
|
-
if (
|
|
4959
|
+
if (Xe(r)) throw new Error("Unexpected project list structure.");
|
|
4934
4960
|
return r;
|
|
4935
4961
|
});
|
|
4936
4962
|
}
|
|
@@ -4941,7 +4967,7 @@ class bs {
|
|
|
4941
4967
|
async openProject(e) {
|
|
4942
4968
|
const t = await this.ensureProjectRid(e);
|
|
4943
4969
|
if (this.openedProjectsByRid.has(t)) throw new Error(`Project ${t} already opened`);
|
|
4944
|
-
this.openedProjectsByRid.set(t, await
|
|
4970
|
+
this.openedProjectsByRid.set(t, await jt.init(this.env, t)), this.openedProjectsList.setValue([...this.openedProjectsByRid.keys()]);
|
|
4945
4971
|
}
|
|
4946
4972
|
/** Closes the project, and deallocate all corresponding resources. */
|
|
4947
4973
|
async closeProject(e) {
|
|
@@ -4978,48 +5004,48 @@ class bs {
|
|
|
4978
5004
|
...gi(t),
|
|
4979
5005
|
...r
|
|
4980
5006
|
};
|
|
4981
|
-
o.defaultTreeOptions.logStat =
|
|
5007
|
+
o.defaultTreeOptions.logStat = re().logTreeStats;
|
|
4982
5008
|
const n = await e.withWriteTx("MLInitialization", async (C) => {
|
|
4983
5009
|
const I = j(C.clientRoot, No);
|
|
4984
5010
|
C.createField(I, "Dynamic");
|
|
4985
5011
|
const N = await C.getField(I);
|
|
4986
|
-
if (
|
|
5012
|
+
if (Xe(N.value)) {
|
|
4987
5013
|
const K = C.createEphemeral(zr);
|
|
4988
5014
|
return C.lock(K), C.setField(I, K), await C.commit(), await K.globalId;
|
|
4989
5015
|
} else
|
|
4990
5016
|
return N.value;
|
|
4991
|
-
}), i = o.logger,
|
|
5017
|
+
}), i = o.logger, a = await yl(e, t, o), c = new Is(e.httpDispatcher, {
|
|
4992
5018
|
minTimeout: 250,
|
|
4993
5019
|
maxRetries: 4
|
|
4994
|
-
}), l = new Ro(
|
|
5020
|
+
}), l = new Ro(c), u = new sn(
|
|
4995
5021
|
l,
|
|
4996
|
-
|
|
4997
|
-
|
|
5022
|
+
a.signer,
|
|
5023
|
+
c
|
|
4998
5024
|
), d = new uo(
|
|
4999
5025
|
i,
|
|
5000
5026
|
e.httpDispatcher,
|
|
5001
5027
|
o.frontendDownloadPath
|
|
5002
5028
|
), f = {
|
|
5003
5029
|
pl: e,
|
|
5004
|
-
signer:
|
|
5030
|
+
signer: a.signer,
|
|
5005
5031
|
logger: i,
|
|
5006
5032
|
httpDispatcher: e.httpDispatcher,
|
|
5007
|
-
retryHttpDispatcher:
|
|
5033
|
+
retryHttpDispatcher: c,
|
|
5008
5034
|
ops: o,
|
|
5009
5035
|
bpPreparer: u,
|
|
5010
5036
|
frontendDownloadDriver: d,
|
|
5011
|
-
driverKit:
|
|
5037
|
+
driverKit: a,
|
|
5012
5038
|
blockUpdateWatcher: new pl(l, i, {
|
|
5013
5039
|
minDelay: o.devBlockUpdateRecheckInterval,
|
|
5014
|
-
http:
|
|
5040
|
+
http: c,
|
|
5015
5041
|
preferredUpdateChannel: o.preferredUpdateChannel
|
|
5016
5042
|
}),
|
|
5017
5043
|
quickJs: await Zs()
|
|
5018
5044
|
}, h = new zs([]), g = await Bo(e, n, h, f);
|
|
5019
5045
|
return new bs(
|
|
5020
5046
|
f,
|
|
5021
|
-
|
|
5022
|
-
|
|
5047
|
+
a,
|
|
5048
|
+
a.signer,
|
|
5023
5049
|
n,
|
|
5024
5050
|
h,
|
|
5025
5051
|
g.tree,
|
|
@@ -5084,14 +5110,14 @@ async function ru(s, e = {}) {
|
|
|
5084
5110
|
bodyLimit: 300,
|
|
5085
5111
|
...e
|
|
5086
5112
|
}, r = [];
|
|
5087
|
-
wl.forEach((
|
|
5088
|
-
fo(
|
|
5113
|
+
wl.forEach((c) => {
|
|
5114
|
+
fo(c).subscribe((u) => {
|
|
5089
5115
|
var f;
|
|
5090
5116
|
const d = (/* @__PURE__ */ new Date()).toISOString();
|
|
5091
5117
|
(f = u == null ? void 0 : u.response) != null && f.headers && (u.response.headers = u.response.headers.map((h) => h.toString())), r.push(
|
|
5092
5118
|
JSON.stringify({
|
|
5093
5119
|
timestamp: d,
|
|
5094
|
-
event:
|
|
5120
|
+
event: c,
|
|
5095
5121
|
data: u
|
|
5096
5122
|
})
|
|
5097
5123
|
);
|
|
@@ -5106,49 +5132,49 @@ async function ru(s, e = {}) {
|
|
|
5106
5132
|
autoUpdateCdnChecks: []
|
|
5107
5133
|
}, n = Ks(s, { defaultRequestTimeout: t.pingTimeoutMs });
|
|
5108
5134
|
o.plPings = await ve(t.pingCheckDurationMs, t.maxPingsPerSecond, async () => {
|
|
5109
|
-
const l = await new
|
|
5135
|
+
const l = await new Yt(n).ping();
|
|
5110
5136
|
return JSON.stringify(l).slice(0, t.bodyLimit) + "...";
|
|
5111
5137
|
});
|
|
5112
|
-
const
|
|
5138
|
+
const a = new Yt(n).ll.httpDispatcher;
|
|
5113
5139
|
return o.blockRegistryOverviewChecks = await ve(
|
|
5114
5140
|
t.blockRegistryDurationMs,
|
|
5115
5141
|
t.maxRegistryChecksPerSecond,
|
|
5116
|
-
async () => await Pe(new URL(t.blockOverviewPath, t.blockRegistryUrl), t,
|
|
5142
|
+
async () => await Pe(new URL(t.blockOverviewPath, t.blockRegistryUrl), t, a)
|
|
5117
5143
|
), o.blockGARegistryOverviewChecks = await ve(
|
|
5118
5144
|
t.blockRegistryDurationMs,
|
|
5119
5145
|
t.maxRegistryChecksPerSecond,
|
|
5120
|
-
async () => await Pe(new URL(t.blockOverviewPath, t.blockGARegistryUrl), t,
|
|
5146
|
+
async () => await Pe(new URL(t.blockOverviewPath, t.blockGARegistryUrl), t, a)
|
|
5121
5147
|
), o.blockRegistryUiChecks = await ve(
|
|
5122
5148
|
t.blockRegistryDurationMs,
|
|
5123
5149
|
t.maxRegistryChecksPerSecond,
|
|
5124
|
-
async () => await Pe(new URL(t.blockUiPath, t.blockRegistryUrl), t,
|
|
5150
|
+
async () => await Pe(new URL(t.blockUiPath, t.blockRegistryUrl), t, a)
|
|
5125
5151
|
), o.blockGARegistryUiChecks = await ve(
|
|
5126
5152
|
t.blockRegistryDurationMs,
|
|
5127
5153
|
t.maxRegistryChecksPerSecond,
|
|
5128
|
-
async () => await Pe(new URL(t.blockUiPath, t.blockGARegistryUrl), t,
|
|
5154
|
+
async () => await Pe(new URL(t.blockUiPath, t.blockGARegistryUrl), t, a)
|
|
5129
5155
|
), o.autoUpdateCdnChecks = await ve(
|
|
5130
5156
|
t.autoUpdateCdnDurationMs,
|
|
5131
5157
|
t.maxAutoUpdateCdnChecksPerSecond,
|
|
5132
|
-
async () => await Pe(t.autoUpdateCdnUrl, t,
|
|
5158
|
+
async () => await Pe(t.autoUpdateCdnUrl, t, a)
|
|
5133
5159
|
), Sl(o, s, t, r);
|
|
5134
5160
|
}
|
|
5135
5161
|
async function ve(s, e, t) {
|
|
5136
|
-
const r =
|
|
5162
|
+
const r = Ft(), o = [];
|
|
5137
5163
|
for (; Dr(r) < s; ) {
|
|
5138
|
-
const n =
|
|
5164
|
+
const n = Ft();
|
|
5139
5165
|
let i;
|
|
5140
5166
|
try {
|
|
5141
5167
|
i = { ok: !0, value: await t() };
|
|
5142
5168
|
} catch (l) {
|
|
5143
5169
|
i = { ok: !1, error: l };
|
|
5144
5170
|
}
|
|
5145
|
-
const
|
|
5171
|
+
const a = Dr(n);
|
|
5146
5172
|
o.push({
|
|
5147
|
-
elapsedMs:
|
|
5173
|
+
elapsedMs: a,
|
|
5148
5174
|
response: i
|
|
5149
5175
|
});
|
|
5150
|
-
const
|
|
5151
|
-
|
|
5176
|
+
const c = 1e3 / e - a;
|
|
5177
|
+
c > 0 && await _r(c);
|
|
5152
5178
|
}
|
|
5153
5179
|
return o;
|
|
5154
5180
|
}
|
|
@@ -5164,8 +5190,8 @@ async function Pe(s, e, t) {
|
|
|
5164
5190
|
};
|
|
5165
5191
|
}
|
|
5166
5192
|
function Sl(s, e, t, r) {
|
|
5167
|
-
const o = s.plPings.filter((
|
|
5168
|
-
...new Set(o.map((
|
|
5193
|
+
const o = s.plPings.filter((a) => a.response.ok), n = s.plPings.filter((a) => !a.response.ok), i = [
|
|
5194
|
+
...new Set(o.map((a) => JSON.stringify(a.response.value)))
|
|
5169
5195
|
];
|
|
5170
5196
|
return `
|
|
5171
5197
|
Network report:
|
|
@@ -5229,11 +5255,11 @@ function bl(s) {
|
|
|
5229
5255
|
}
|
|
5230
5256
|
return { mean: t, median: r };
|
|
5231
5257
|
}
|
|
5232
|
-
function
|
|
5258
|
+
function Ft() {
|
|
5233
5259
|
return Date.now();
|
|
5234
5260
|
}
|
|
5235
5261
|
function Dr(s) {
|
|
5236
|
-
return
|
|
5262
|
+
return Ft() - s;
|
|
5237
5263
|
}
|
|
5238
5264
|
export {
|
|
5239
5265
|
ql as BlockPackRegistry,
|
|
@@ -5245,7 +5271,7 @@ export {
|
|
|
5245
5271
|
Zr as FrontendFromFolderResourceType,
|
|
5246
5272
|
Qr as FrontendFromUrlResourceType,
|
|
5247
5273
|
bs as MiddleLayer,
|
|
5248
|
-
|
|
5274
|
+
jt as Project,
|
|
5249
5275
|
zo as TengoTemplateGet,
|
|
5250
5276
|
Xo as TengoTemplateGetRegistry,
|
|
5251
5277
|
Qo as TengoTemplateGetTemplate,
|
|
@@ -5260,9 +5286,9 @@ export {
|
|
|
5260
5286
|
ru as checkNetwork,
|
|
5261
5287
|
Xr as createRenderTemplate,
|
|
5262
5288
|
Hr as getDevV1PacketMtime,
|
|
5263
|
-
|
|
5289
|
+
Tt as getDevV2PacketMtime,
|
|
5264
5290
|
yl as initDriverKit,
|
|
5265
|
-
|
|
5291
|
+
Nt as loadTemplate,
|
|
5266
5292
|
Zo as prepareTemplateSpec
|
|
5267
5293
|
};
|
|
5268
5294
|
//# sourceMappingURL=index.mjs.map
|