@milaboratories/pl-middle-layer 1.34.22 → 1.35.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +938 -931
- package/dist/index.mjs.map +1 -1
- package/dist/middle_layer/block.d.ts.map +1 -1
- package/dist/middle_layer/project_overview.d.ts.map +1 -1
- package/package.json +13 -12
- package/src/middle_layer/block.ts +3 -2
- package/src/middle_layer/project_overview.ts +15 -5
- package/src/mutator/project.ts +3 -3
package/dist/index.mjs
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
1
|
+
var Vs = Object.defineProperty;
|
|
2
|
+
var Yt = (s, e) => (e = Symbol[s]) ? e : Symbol.for("Symbol." + s), Qt = (s) => {
|
|
3
3
|
throw TypeError(s);
|
|
4
4
|
};
|
|
5
|
-
var
|
|
6
|
-
var w = (s, e, t) =>
|
|
7
|
-
var
|
|
5
|
+
var Us = (s, e, t) => e in s ? Vs(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t;
|
|
6
|
+
var w = (s, e, t) => Us(s, typeof e != "symbol" ? e + "" : e, t);
|
|
7
|
+
var Zt = (s, e, t) => {
|
|
8
8
|
if (e != null) {
|
|
9
|
-
typeof e != "object" && typeof e != "function" &&
|
|
9
|
+
typeof e != "object" && typeof e != "function" && Qt("Object expected");
|
|
10
10
|
var r;
|
|
11
|
-
t && (r = e[
|
|
11
|
+
t && (r = e[Yt("asyncDispose")]), r === void 0 && (r = e[Yt("dispose")]), typeof r != "function" && Qt("Object not disposable"), s.push([t, r, e]);
|
|
12
12
|
} else t && s.push([t]);
|
|
13
13
|
return e;
|
|
14
|
-
},
|
|
14
|
+
}, er = (s, e, t) => {
|
|
15
15
|
var r = typeof SuppressedError == "function" ? SuppressedError : function(i, a, c, u) {
|
|
16
16
|
return u = Error(c), u.name = "SuppressedError", u.error = i, u.suppressed = a, u;
|
|
17
17
|
}, o = (i) => e = t ? new r(i, e, "An error was suppressed during disposal") : (t = !0, i), n = (i) => {
|
|
@@ -26,107 +26,108 @@ var Qt = (s, e, t) => {
|
|
|
26
26
|
};
|
|
27
27
|
return n();
|
|
28
28
|
};
|
|
29
|
-
import { mapValueInVOE as
|
|
29
|
+
import { mapValueInVOE as qr, executePSpecPredicate as Gs, mapPObjectData as pe, mapPTableDef as bt, isDataInfo as zr, mapDataInfo as Xr, JsRenderInternal as Js, extractConfig as Qe, isConfigLambda as Yr, DefaultNavigationState as Ms, extractAllColumns as _s } from "@platforma-sdk/model";
|
|
30
30
|
export * from "@platforma-sdk/model";
|
|
31
|
-
import { AnyChannel as Fe, StableChannel as Ae, InitialBlockSettings as
|
|
31
|
+
import { AnyChannel as Fe, StableChannel as Ae, InitialBlockSettings as tr, blockPackIdToString as Ks } from "@milaboratories/pl-model-middle-layer";
|
|
32
32
|
export * from "@milaboratories/pl-model-middle-layer";
|
|
33
33
|
export * from "@milaboratories/pl-deployments";
|
|
34
|
-
import { request as
|
|
35
|
-
import { RegistryV1 as
|
|
36
|
-
import
|
|
34
|
+
import { request as Dt, RetryAgent as Hs } from "undici";
|
|
35
|
+
import { RegistryV1 as fe, tryLoadPackDescription as Rt, BlockPackMetaEmbedAbsoluteBytes as Ws, RegistryV2Reader as qs, folderReaderByUrl as zs, loadPackDescription as rr } from "@platforma-sdk/block-tools";
|
|
36
|
+
import Q from "node:fs";
|
|
37
37
|
import K from "node:path";
|
|
38
|
-
import
|
|
39
|
-
import { assertNever as H, notEmpty as
|
|
40
|
-
import * as
|
|
41
|
-
import
|
|
42
|
-
import { tryResolve as
|
|
43
|
-
import { resourceTypesEqual as
|
|
38
|
+
import Xs from "yaml";
|
|
39
|
+
import { assertNever as H, notEmpty as j, deepFreeze as et, ConsoleLoggerAdapter as Ys, HmacSha256Signer as Qr } from "@milaboratories/ts-helpers";
|
|
40
|
+
import * as Zr from "node:fs/promises";
|
|
41
|
+
import sr from "node:fs/promises";
|
|
42
|
+
import { tryResolve as Qs } from "@milaboratories/resolve-helper";
|
|
43
|
+
import { resourceTypesEqual as le, field as U, Pl as A, PlClient as Zs, isNullResourceId as tt, ensureResourceIdNotNull as Et, isResource as eo, isResourceRef as to, isNotNullResourceId as or, resourceType as xe, resourceTypeToString as ro, stringifyWithResourceId as Ue, resourceIdToString as Se, isNotFoundError as so, isTimeoutOrCancelError as oo, toGlobalResourceId as no, plAddressToConfig as io, UnauthenticatedPlClient as nr } from "@milaboratories/pl-client";
|
|
44
44
|
export * from "@milaboratories/pl-client";
|
|
45
|
-
import { SynchronizedTreeState as
|
|
46
|
-
import { Computable as J, ChangeSource as
|
|
45
|
+
import { SynchronizedTreeState as es, treeDumpStats as ao, isPlTreeNodeAccessor as co } from "@milaboratories/pl-tree";
|
|
46
|
+
import { Computable as J, ChangeSource as ir, PollComputablePool as lo, WatchableValue as uo } from "@milaboratories/computable";
|
|
47
47
|
import { randomUUID as be, createHash as Ee } from "node:crypto";
|
|
48
|
-
import { PlTemplateV1 as _, PlTemplateOverrideV1 as we, PlTemplateLibV1 as
|
|
49
|
-
import { LRUCache as
|
|
50
|
-
import { Worker as
|
|
51
|
-
import
|
|
52
|
-
import { Templates as
|
|
53
|
-
import
|
|
54
|
-
import
|
|
55
|
-
import { Scope as
|
|
56
|
-
import { PlQuickJSError as
|
|
57
|
-
import
|
|
58
|
-
import {
|
|
59
|
-
import {
|
|
60
|
-
import {
|
|
61
|
-
|
|
48
|
+
import { PlTemplateV1 as _, PlTemplateOverrideV1 as we, PlTemplateLibV1 as de, PlTemplateSoftwareV1 as oe, parseTemplate as po } from "@milaboratories/pl-model-backend";
|
|
49
|
+
import { LRUCache as ts } from "lru-cache";
|
|
50
|
+
import { Worker as fo } from "node:worker_threads";
|
|
51
|
+
import rs from "denque";
|
|
52
|
+
import { Templates as ho } from "@platforma-sdk/workflow-tengo";
|
|
53
|
+
import N from "canonicalize";
|
|
54
|
+
import go from "node:assert";
|
|
55
|
+
import { Scope as Ct, errors as mo, getQuickJS as vo } from "quickjs-emscripten";
|
|
56
|
+
import { PlQuickJSError as yo } from "@milaboratories/pl-errors";
|
|
57
|
+
import * as ar from "remeda";
|
|
58
|
+
import { setTimeout as ss } from "node:timers/promises";
|
|
59
|
+
import { createDownloadClient as wo, createLogsClient as So, createUploadBlobClient as bo, createUploadProgressClient as Ro, DownloadDriver as Eo, DownloadBlobToURLDriver as Co, UploadDriver as ko, LogsStreamDriver as Po, LogsDriver as Oo, LsDriver as $o, DownloadUrlDriver as Io } from "@milaboratories/pl-drivers";
|
|
60
|
+
import { PFrame as Fo } from "@milaboratories/pframes-rs-node";
|
|
61
|
+
import { channel as Ao } from "node:diagnostics_channel";
|
|
62
|
+
async function cr(s) {
|
|
62
63
|
try {
|
|
63
|
-
return await
|
|
64
|
+
return await Zr.stat(s, { bigint: !0 });
|
|
64
65
|
} catch (e) {
|
|
65
66
|
if (e.code === "ENOENT")
|
|
66
67
|
return;
|
|
67
68
|
throw e;
|
|
68
69
|
}
|
|
69
70
|
}
|
|
70
|
-
const
|
|
71
|
-
Dt,
|
|
71
|
+
const To = [fe.PlPackageYamlConfigFile], Lo = [fe.PlPackageJsonConfigFile], Nt = ["backend", "dist", "tengo", "tpl", "main.plj.gz"], Bt = ["config", "dist", "config.json"], os = ["frontend", "dist"], lr = "block-model/dist/config.json", Do = "block-ui/package.json", No = [
|
|
72
72
|
Nt,
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
73
|
+
Bt,
|
|
74
|
+
To,
|
|
75
|
+
Lo,
|
|
76
|
+
os
|
|
76
77
|
];
|
|
77
|
-
async function
|
|
78
|
-
return await
|
|
78
|
+
async function Bo(s) {
|
|
79
|
+
return await cr(K.join(s, ...Bt)) !== void 0 || await cr(K.join(s, ...Nt)) !== void 0;
|
|
79
80
|
}
|
|
80
|
-
function
|
|
81
|
-
const t =
|
|
81
|
+
function pt(s, e) {
|
|
82
|
+
const t = Qs(s, e);
|
|
82
83
|
if (t === void 0) throw new Error(`Can't resolve ${e} against ${s}`);
|
|
83
84
|
return t;
|
|
84
85
|
}
|
|
85
|
-
async function
|
|
86
|
-
if (K.isAbsolute(s) || (s = K.resolve(s)), await
|
|
86
|
+
async function ur(s, e) {
|
|
87
|
+
if (K.isAbsolute(s) || (s = K.resolve(s)), await Bo(s))
|
|
87
88
|
return {
|
|
88
|
-
workflow: K.join(s, ...
|
|
89
|
-
config: K.join(s, ...
|
|
90
|
-
ui: K.join(s, ...
|
|
89
|
+
workflow: K.join(s, ...Nt),
|
|
90
|
+
config: K.join(s, ...Bt),
|
|
91
|
+
ui: K.join(s, ...os)
|
|
91
92
|
};
|
|
92
93
|
{
|
|
93
|
-
const t =
|
|
94
|
+
const t = pt(s, lr), r = pt(s, lr), o = pt(s, Do);
|
|
94
95
|
return { workflow: t, config: r, ui: K.resolve(o, "..", "dist") };
|
|
95
96
|
}
|
|
96
97
|
}
|
|
97
|
-
async function
|
|
98
|
+
async function jo(s) {
|
|
98
99
|
try {
|
|
99
|
-
return await
|
|
100
|
+
return await Q.promises.readFile(s, "utf8");
|
|
100
101
|
} catch (e) {
|
|
101
102
|
if (e instanceof Error && "code" in e && e.code === "ENOENT")
|
|
102
103
|
return;
|
|
103
104
|
throw e;
|
|
104
105
|
}
|
|
105
106
|
}
|
|
106
|
-
async function
|
|
107
|
+
async function xo(s) {
|
|
107
108
|
try {
|
|
108
|
-
return await
|
|
109
|
+
return await Q.promises.stat(s, { bigint: !0 });
|
|
109
110
|
} catch (e) {
|
|
110
111
|
if (e instanceof Error && "code" in e && e.code === "ENOENT")
|
|
111
112
|
return;
|
|
112
113
|
throw e;
|
|
113
114
|
}
|
|
114
115
|
}
|
|
115
|
-
async function
|
|
116
|
+
async function ns(s) {
|
|
116
117
|
let e = 0n;
|
|
117
|
-
for (const t of
|
|
118
|
-
const r = K.join(s, ...t), o = await
|
|
118
|
+
for (const t of No) {
|
|
119
|
+
const r = K.join(s, ...t), o = await xo(r);
|
|
119
120
|
o !== void 0 && e < o.mtimeNs && (e = o.mtimeNs);
|
|
120
121
|
}
|
|
121
122
|
return e.toString();
|
|
122
123
|
}
|
|
123
|
-
async function
|
|
124
|
-
const e = await
|
|
124
|
+
async function jt(s) {
|
|
125
|
+
const e = await Q.promises.stat(s.components.workflow.main.file, {
|
|
125
126
|
bigint: !0
|
|
126
|
-
}), t = await
|
|
127
|
+
}), t = await Q.promises.stat(s.components.model.file, { bigint: !0 });
|
|
127
128
|
return (e.mtimeNs > t.mtimeNs ? e.mtimeNs : t.mtimeNs).toString();
|
|
128
129
|
}
|
|
129
|
-
class
|
|
130
|
+
class Su {
|
|
130
131
|
constructor(e, t, r) {
|
|
131
132
|
this.v2Provider = e, this.registries = t, this.http = r;
|
|
132
133
|
}
|
|
@@ -134,8 +135,8 @@ class vu {
|
|
|
134
135
|
const t = [], r = e.spec;
|
|
135
136
|
switch (r.type) {
|
|
136
137
|
case "remote-v1": {
|
|
137
|
-
const o = this.http !== void 0 ? { dispatcher: this.http } : {}, i = await (await
|
|
138
|
-
`${r.url}/${
|
|
138
|
+
const o = this.http !== void 0 ? { dispatcher: this.http } : {}, i = await (await Dt(
|
|
139
|
+
`${r.url}/${fe.GlobalOverviewPath}`,
|
|
139
140
|
o
|
|
140
141
|
)).body.json();
|
|
141
142
|
for (const a of i) {
|
|
@@ -174,13 +175,13 @@ class vu {
|
|
|
174
175
|
case "remote-v2":
|
|
175
176
|
return (await this.v2Provider.getRegistry(r.url).listBlockPacks()).map((o) => ({ ...o, registryId: e.id }));
|
|
176
177
|
case "local-dev":
|
|
177
|
-
for (const o of await
|
|
178
|
+
for (const o of await Q.promises.readdir(r.path, { withFileTypes: !0 })) {
|
|
178
179
|
if (!o.isDirectory()) continue;
|
|
179
|
-
const n = K.join(r.path, o.name), i = await
|
|
180
|
-
K.join(n,
|
|
180
|
+
const n = K.join(r.path, o.name), i = await jo(
|
|
181
|
+
K.join(n, fe.PlPackageYamlConfigFile)
|
|
181
182
|
);
|
|
182
183
|
if (i !== void 0) {
|
|
183
|
-
const a =
|
|
184
|
+
const a = fe.PlPackageConfigData.parse(Xs.parse(i)), c = await ns(n), u = {
|
|
184
185
|
organization: a.organization,
|
|
185
186
|
name: a.package,
|
|
186
187
|
version: "DEV"
|
|
@@ -210,15 +211,15 @@ class vu {
|
|
|
210
211
|
allVersions: []
|
|
211
212
|
});
|
|
212
213
|
} else {
|
|
213
|
-
let a = n, c = await
|
|
214
|
+
let a = n, c = await Rt(a);
|
|
214
215
|
if (c === void 0) {
|
|
215
216
|
for (const u of ["block", "meta"])
|
|
216
|
-
if (a = K.join(n, u), c = await
|
|
217
|
+
if (a = K.join(n, u), c = await Rt(a), c !== void 0) break;
|
|
217
218
|
}
|
|
218
219
|
if (c !== void 0) {
|
|
219
|
-
const u = await
|
|
220
|
+
const u = await jt(c), l = {
|
|
220
221
|
id: c.id,
|
|
221
|
-
meta: await
|
|
222
|
+
meta: await Ws.parseAsync(c.meta),
|
|
222
223
|
spec: {
|
|
223
224
|
type: "dev-v2",
|
|
224
225
|
folder: a,
|
|
@@ -259,7 +260,7 @@ class vu {
|
|
|
259
260
|
return await this.v2Provider.getRegistry(o.url).getSpecificOverview(t, r);
|
|
260
261
|
}
|
|
261
262
|
}
|
|
262
|
-
class
|
|
263
|
+
class Vo {
|
|
263
264
|
constructor(e) {
|
|
264
265
|
w(this, "registries", /* @__PURE__ */ new Map());
|
|
265
266
|
this.http = e;
|
|
@@ -267,62 +268,62 @@ class jo {
|
|
|
267
268
|
getRegistry(e) {
|
|
268
269
|
const t = this.registries.get(e);
|
|
269
270
|
if (t) return t;
|
|
270
|
-
const r = new
|
|
271
|
+
const r = new qs(zs(e, this.http));
|
|
271
272
|
return this.registries.set(e, r), r;
|
|
272
273
|
}
|
|
273
274
|
}
|
|
274
|
-
const
|
|
275
|
+
const bu = {
|
|
275
276
|
type: "remote-v2",
|
|
276
277
|
url: "https://blocks.pl-open.science/"
|
|
277
|
-
},
|
|
278
|
+
}, Ru = {
|
|
278
279
|
type: "remote-v1",
|
|
279
280
|
url: "https://block.registry.platforma.bio/releases"
|
|
280
|
-
},
|
|
281
|
+
}, Eu = {
|
|
281
282
|
type: "remote-v1",
|
|
282
283
|
url: "https://block.registry.platforma.bio/dev"
|
|
283
|
-
},
|
|
284
|
+
}, Uo = {
|
|
284
285
|
groups: [{ id: "default", label: "Default", blocks: [] }]
|
|
285
|
-
},
|
|
286
|
+
}, Go = {
|
|
286
287
|
stagingRefreshTimestamp: 0,
|
|
287
288
|
blocksInLimbo: []
|
|
288
|
-
},
|
|
289
|
+
}, Jo = {
|
|
289
290
|
label: "New Project"
|
|
290
|
-
},
|
|
291
|
-
function Ct(s) {
|
|
292
|
-
return `${Jo}${s}`;
|
|
293
|
-
}
|
|
294
|
-
const _o = "BlockArgsAuthor/";
|
|
291
|
+
}, Mo = { name: "UserProject", version: "2" }, is = "SchemaVersion", as = "1", xt = "ProjectCreated", Be = "ProjectLastModified", je = "ProjectMeta", he = "ProjectStructure", rt = "BlockRenderingState", _o = "BlockFrontendState/", Ko = /^BlockFrontendState\/(?<blockid>.*)$/;
|
|
295
292
|
function kt(s) {
|
|
296
293
|
return `${_o}${s}`;
|
|
297
294
|
}
|
|
298
|
-
const
|
|
299
|
-
function
|
|
300
|
-
|
|
295
|
+
const Ho = "BlockArgsAuthor/";
|
|
296
|
+
function Pt(s) {
|
|
297
|
+
return `${Ho}${s}`;
|
|
298
|
+
}
|
|
299
|
+
const Ot = "ProjectStructureAuthor";
|
|
300
|
+
function Wo(s) {
|
|
301
|
+
const e = s.match(Ko);
|
|
301
302
|
if (e !== null)
|
|
302
303
|
return e.groups.blockid;
|
|
303
304
|
}
|
|
304
|
-
const
|
|
305
|
-
function
|
|
306
|
-
return `${
|
|
305
|
+
const qo = "__serviceTemplate_";
|
|
306
|
+
function $t(s) {
|
|
307
|
+
return `${qo}${s}`;
|
|
307
308
|
}
|
|
308
309
|
function G(s, e) {
|
|
309
310
|
return `${s}-${e}`;
|
|
310
311
|
}
|
|
311
|
-
const
|
|
312
|
-
function
|
|
313
|
-
const e = s.match(
|
|
312
|
+
const zo = /^(?<blockId>.*)-(?<fieldName>blockPack|blockSettings|prodArgs|currentArgs|prodCtx|prodUiCtx|prodOutput|prodCtxPrevious|prodUiCtxPrevious|prodOutputPrevious|stagingCtx|stagingUiCtx|stagingOutput|stagingCtxPrevious|stagingUiCtxPrevious|stagingOutputPrevious)$/;
|
|
313
|
+
function Xo(s) {
|
|
314
|
+
const e = s.match(zo);
|
|
314
315
|
if (e === null) return;
|
|
315
316
|
const { blockId: t, fieldName: r } = e.groups;
|
|
316
317
|
return { blockId: t, fieldName: r };
|
|
317
318
|
}
|
|
318
|
-
const
|
|
319
|
-
async function
|
|
320
|
-
const o = await
|
|
319
|
+
const Yo = "projects", cs = { name: "Projects", version: "1" }, Qo = (s) => le(s.type, cs) ? s.fields : [];
|
|
320
|
+
async function Zo(s, e, t, r) {
|
|
321
|
+
const o = await es.init(
|
|
321
322
|
s,
|
|
322
323
|
e,
|
|
323
324
|
{
|
|
324
325
|
...r.ops.defaultTreeOptions,
|
|
325
|
-
pruning:
|
|
326
|
+
pruning: Qo
|
|
326
327
|
},
|
|
327
328
|
r.logger
|
|
328
329
|
);
|
|
@@ -333,7 +334,7 @@ async function Yo(s, e, t, r) {
|
|
|
333
334
|
for (const l of a.listDynamicFields()) {
|
|
334
335
|
const d = a.traverse(l);
|
|
335
336
|
if (d === void 0) continue;
|
|
336
|
-
const f =
|
|
337
|
+
const f = j(d.getKeyValueAsJson(je)), h = j(d.getKeyValueAsJson(xt)), R = j(d.getKeyValueAsJson(Be));
|
|
337
338
|
u.push({
|
|
338
339
|
id: l,
|
|
339
340
|
rid: d.id,
|
|
@@ -346,36 +347,36 @@ async function Yo(s, e, t, r) {
|
|
|
346
347
|
return u.sort((l) => -l.lastModified.valueOf()), u;
|
|
347
348
|
}).withStableType(), tree: o };
|
|
348
349
|
}
|
|
349
|
-
const
|
|
350
|
+
const en = {
|
|
350
351
|
name: "EphRenderTemplate",
|
|
351
352
|
version: "1"
|
|
352
|
-
},
|
|
353
|
+
}, tn = {
|
|
353
354
|
name: "RenderTemplate",
|
|
354
355
|
version: "1"
|
|
355
356
|
};
|
|
356
|
-
function
|
|
357
|
+
function ls(s, e, t, r, o) {
|
|
357
358
|
if (o.length === 0) throw new Error("Zero output names provided");
|
|
358
|
-
const n = t ? s.createEphemeral(
|
|
359
|
+
const n = t ? s.createEphemeral(en) : s.createStruct(tn), i = U(n, "template"), a = U(n, "inputs");
|
|
359
360
|
return s.createField(i, "Input", e), s.createField(a, "Input", A.createPlMap(s, r, t)), s.lockInputs(n), A.futureRecord(s, n, o, "Output", "outputs/");
|
|
360
361
|
}
|
|
361
|
-
const
|
|
362
|
-
function
|
|
363
|
-
return
|
|
362
|
+
const rn = { name: "BContextEnd", version: "1" }, sn = { name: "BContext", version: "1" }, on = "id", nn = "parent/", an = ["context", "result"];
|
|
363
|
+
function dr(s, e, t) {
|
|
364
|
+
return ls(s, e, !0, t, an);
|
|
364
365
|
}
|
|
365
|
-
function
|
|
366
|
-
const e = s.createEphemeral(
|
|
366
|
+
function cn(s) {
|
|
367
|
+
const e = s.createEphemeral(rn);
|
|
367
368
|
return s.lock(e), e;
|
|
368
369
|
}
|
|
369
|
-
function
|
|
370
|
-
if (e.length === 0) return
|
|
370
|
+
function pr(s, e) {
|
|
371
|
+
if (e.length === 0) return cn(s);
|
|
371
372
|
if (e.length === 1) return e[0];
|
|
372
|
-
const t = s.createEphemeral(
|
|
373
|
-
s.createField(
|
|
373
|
+
const t = s.createEphemeral(sn);
|
|
374
|
+
s.createField(U(t, on), "Input", A.createPlString(s, be()));
|
|
374
375
|
for (let r = 0; r < e.length; r++)
|
|
375
|
-
s.createField(
|
|
376
|
+
s.createField(U(t, `${nn}${r}`), "Input", e[r]);
|
|
376
377
|
return s.lock(t), t;
|
|
377
378
|
}
|
|
378
|
-
function
|
|
379
|
+
function us(s, e) {
|
|
379
380
|
const t = /* @__PURE__ */ new Map(), r = (o, n, i) => {
|
|
380
381
|
const a = Ee("sha256");
|
|
381
382
|
n.updateCacheKey(o, a, i);
|
|
@@ -386,16 +387,16 @@ function cs(s, e) {
|
|
|
386
387
|
}
|
|
387
388
|
return t.get(c);
|
|
388
389
|
};
|
|
389
|
-
return r(e.template,
|
|
390
|
+
return r(e.template, ds, e.hashToSource);
|
|
390
391
|
}
|
|
391
|
-
const
|
|
392
|
+
const fr = {
|
|
392
393
|
updateCacheKey(s, e, t) {
|
|
393
|
-
e.update(
|
|
394
|
+
e.update(de.type.name).update(de.type.version).update(s.name).update(s.version).update(Re(s.name, t, s.sourceHash));
|
|
394
395
|
},
|
|
395
396
|
render(s, e, t, r) {
|
|
396
397
|
return e.createValue(
|
|
397
|
-
|
|
398
|
-
JSON.stringify(
|
|
398
|
+
de.type,
|
|
399
|
+
JSON.stringify(de.fromV3Data(s, Re(s.name, r, s.sourceHash)).data)
|
|
399
400
|
);
|
|
400
401
|
}
|
|
401
402
|
}, Ge = {
|
|
@@ -406,12 +407,12 @@ const dr = {
|
|
|
406
407
|
const o = oe.fromV3Data(s, Re(s.name, r, s.sourceHash)), n = e.createStruct(oe.type, o.data);
|
|
407
408
|
return e.setKValue(n, oe.metaNameKey, JSON.stringify(o.name)), e.lock(n), n;
|
|
408
409
|
}
|
|
409
|
-
},
|
|
410
|
+
}, ds = {
|
|
410
411
|
updateCacheKey(s, e, t) {
|
|
411
412
|
e.update(_.type.name).update(_.type.version).update(s.hashOverride ?? "no-override").update(s.name).update(s.version).update(Re(s.name, t, s.sourceHash));
|
|
412
413
|
const r = (o) => (o.sort((n, i) => n[0] === i[0] ? 0 : n[0] < i[0] ? -1 : 1), o);
|
|
413
414
|
for (const [o, n] of r(Object.entries(s.libs ?? {})))
|
|
414
|
-
e.update("lib:" + o),
|
|
415
|
+
e.update("lib:" + o), fr.updateCacheKey(n, e, t);
|
|
415
416
|
for (const [o, n] of r(Object.entries(s.software ?? {})))
|
|
416
417
|
e.update("soft:" + o), Ge.updateCacheKey(n, e, t);
|
|
417
418
|
for (const [o, n] of r(Object.entries(s.assets ?? {})))
|
|
@@ -426,7 +427,7 @@ const dr = {
|
|
|
426
427
|
);
|
|
427
428
|
for (const [a, c] of Object.entries(s.libs ?? {})) {
|
|
428
429
|
const u = _.libField(o, a);
|
|
429
|
-
e.createField(u, "Input"), e.setField(u, t(c,
|
|
430
|
+
e.createField(u, "Input"), e.setField(u, t(c, fr, r));
|
|
430
431
|
}
|
|
431
432
|
for (const [a, c] of Object.entries(s.software ?? {})) {
|
|
432
433
|
const u = _.swField(o, a);
|
|
@@ -438,7 +439,7 @@ const dr = {
|
|
|
438
439
|
}
|
|
439
440
|
for (const [a, c] of Object.entries(s.templates ?? {})) {
|
|
440
441
|
const u = _.tplField(o, a);
|
|
441
|
-
e.createField(u, "Input"), e.setField(u, t(c,
|
|
442
|
+
e.createField(u, "Input"), e.setField(u, t(c, ds, r));
|
|
442
443
|
}
|
|
443
444
|
if (e.lock(o), !s.hashOverride) return o;
|
|
444
445
|
const n = e.createStruct(
|
|
@@ -449,41 +450,41 @@ const dr = {
|
|
|
449
450
|
}
|
|
450
451
|
};
|
|
451
452
|
function Re(s, e, t) {
|
|
452
|
-
return
|
|
453
|
+
return j(
|
|
453
454
|
e[t],
|
|
454
455
|
`trying to get "${s}" source: sources map doesn't contain source hash ${t}`
|
|
455
456
|
);
|
|
456
457
|
}
|
|
457
|
-
function
|
|
458
|
-
const t =
|
|
458
|
+
function ln(s, e) {
|
|
459
|
+
const t = po(e.content), r = t.type;
|
|
459
460
|
switch (r) {
|
|
460
461
|
case "pl.tengo-template.v2":
|
|
461
|
-
return
|
|
462
|
+
return fs(s, t);
|
|
462
463
|
case "pl.tengo-template.v3":
|
|
463
|
-
return
|
|
464
|
+
return us(s, t);
|
|
464
465
|
default:
|
|
465
466
|
H(r);
|
|
466
467
|
}
|
|
467
468
|
}
|
|
468
|
-
function
|
|
469
|
+
function un(s, e) {
|
|
469
470
|
const t = e.data, r = t.type;
|
|
470
471
|
switch (r) {
|
|
471
472
|
case "pl.tengo-template.v2":
|
|
472
|
-
return
|
|
473
|
+
return fs(s, t);
|
|
473
474
|
case "pl.tengo-template.v3":
|
|
474
|
-
return
|
|
475
|
+
return us(s, t);
|
|
475
476
|
default:
|
|
476
477
|
H(r);
|
|
477
478
|
}
|
|
478
479
|
}
|
|
479
|
-
const
|
|
480
|
+
const hr = {
|
|
480
481
|
hash(s, e) {
|
|
481
|
-
e.update(
|
|
482
|
+
e.update(de.type.name).update(de.type.version).update(s.name).update(s.version).update(s.src);
|
|
482
483
|
},
|
|
483
484
|
render(s, e, t) {
|
|
484
485
|
return e.createValue(
|
|
485
|
-
|
|
486
|
-
JSON.stringify(
|
|
486
|
+
de.type,
|
|
487
|
+
JSON.stringify(de.fromV2Data(s).data)
|
|
487
488
|
);
|
|
488
489
|
}
|
|
489
490
|
}, Je = {
|
|
@@ -494,12 +495,12 @@ const pr = {
|
|
|
494
495
|
const r = oe.fromV2Data(s), o = e.createStruct(oe.type, r.data);
|
|
495
496
|
return e.setKValue(o, oe.metaNameKey, JSON.stringify(r.name)), e.lock(o), o;
|
|
496
497
|
}
|
|
497
|
-
},
|
|
498
|
+
}, ps = {
|
|
498
499
|
hash(s, e) {
|
|
499
500
|
e.update(_.type.name).update(_.type.version).update(s.hashOverride ?? "no-override").update(s.name).update(s.version).update(s.src);
|
|
500
501
|
const t = (r) => (r.sort((o, n) => o[0] === n[0] ? 0 : o[0] < n[0] ? -1 : 1), r);
|
|
501
502
|
for (const [r, o] of t(Object.entries(s.libs ?? {})))
|
|
502
|
-
e.update("lib:" + r),
|
|
503
|
+
e.update("lib:" + r), hr.hash(o, e);
|
|
503
504
|
for (const [r, o] of t(Object.entries(s.software ?? {})))
|
|
504
505
|
e.update("soft:" + r), Je.hash(o, e);
|
|
505
506
|
for (const [r, o] of t(Object.entries(s.assets ?? {})))
|
|
@@ -514,7 +515,7 @@ const pr = {
|
|
|
514
515
|
);
|
|
515
516
|
for (const [i, a] of Object.entries(s.libs ?? {})) {
|
|
516
517
|
const c = _.libField(r, i);
|
|
517
|
-
e.createField(c, "Input"), e.setField(c, t(a,
|
|
518
|
+
e.createField(c, "Input"), e.setField(c, t(a, hr));
|
|
518
519
|
}
|
|
519
520
|
for (const [i, a] of Object.entries(s.software ?? {})) {
|
|
520
521
|
const c = _.swField(r, i);
|
|
@@ -526,7 +527,7 @@ const pr = {
|
|
|
526
527
|
}
|
|
527
528
|
for (const [i, a] of Object.entries(s.templates ?? {})) {
|
|
528
529
|
const c = _.tplField(r, i);
|
|
529
|
-
e.createField(c, "Input"), e.setField(c, t(a,
|
|
530
|
+
e.createField(c, "Input"), e.setField(c, t(a, ps));
|
|
530
531
|
}
|
|
531
532
|
if (e.lock(r), !s.hashOverride) return r;
|
|
532
533
|
const o = e.createStruct(
|
|
@@ -536,7 +537,7 @@ const pr = {
|
|
|
536
537
|
return e.createField(n, "Service"), e.setField(n, r), e.lock(o), o;
|
|
537
538
|
}
|
|
538
539
|
};
|
|
539
|
-
function
|
|
540
|
+
function fs(s, e) {
|
|
540
541
|
const t = /* @__PURE__ */ new Map(), r = (o, n) => {
|
|
541
542
|
const i = Ee("sha256");
|
|
542
543
|
n.hash(o, i);
|
|
@@ -547,18 +548,18 @@ function ds(s, e) {
|
|
|
547
548
|
}
|
|
548
549
|
return t.get(a);
|
|
549
550
|
};
|
|
550
|
-
return r(e,
|
|
551
|
+
return r(e, ps);
|
|
551
552
|
}
|
|
552
|
-
const
|
|
553
|
+
const dn = { name: "TengoTemplateGet", version: "1" }, pn = "registry", fn = "templateURI", hn = "template", Cu = { name: "TengoTemplatePack", version: "1" }, ku = {
|
|
553
554
|
name: "TengoTemplatePackConvert",
|
|
554
555
|
version: "1"
|
|
555
|
-
},
|
|
556
|
-
async function
|
|
556
|
+
}, Pu = "templatePack", Ou = "template";
|
|
557
|
+
async function gn(s) {
|
|
557
558
|
switch (s.type) {
|
|
558
559
|
case "from-file":
|
|
559
560
|
return {
|
|
560
561
|
type: "explicit",
|
|
561
|
-
content: await
|
|
562
|
+
content: await Q.promises.readFile(s.path)
|
|
562
563
|
};
|
|
563
564
|
case "from-registry":
|
|
564
565
|
case "explicit":
|
|
@@ -569,36 +570,36 @@ async function fn(s) {
|
|
|
569
570
|
return H(s);
|
|
570
571
|
}
|
|
571
572
|
}
|
|
572
|
-
function
|
|
573
|
-
const t = s.createStruct(
|
|
573
|
+
function mn(s, e) {
|
|
574
|
+
const t = s.createStruct(dn), r = U(t, pn), o = U(t, fn), n = U(t, hn);
|
|
574
575
|
return s.setField(r, s.createValue(A.JsonString, Buffer.from(JSON.stringify(e.registry)))), s.setField(o, s.createValue(A.JsonString, Buffer.from(JSON.stringify(e.path)))), n;
|
|
575
576
|
}
|
|
576
|
-
function
|
|
577
|
+
function Vt(s, e) {
|
|
577
578
|
switch (e.type) {
|
|
578
579
|
case "from-registry":
|
|
579
|
-
return
|
|
580
|
+
return mn(s, e);
|
|
580
581
|
case "explicit":
|
|
581
|
-
return
|
|
582
|
+
return ln(s, e);
|
|
582
583
|
case "prepared":
|
|
583
|
-
return
|
|
584
|
+
return un(s, e);
|
|
584
585
|
default:
|
|
585
586
|
return H(e);
|
|
586
587
|
}
|
|
587
588
|
}
|
|
588
|
-
const
|
|
589
|
+
const hs = { name: "Frontend/FromUrl", version: "1" }, gs = {
|
|
589
590
|
name: "Frontend/FromFolder",
|
|
590
591
|
version: "1"
|
|
591
592
|
};
|
|
592
|
-
function
|
|
593
|
+
function vn(s, e) {
|
|
593
594
|
switch (e.type) {
|
|
594
595
|
case "url":
|
|
595
596
|
return s.createValue(
|
|
596
|
-
|
|
597
|
+
hs,
|
|
597
598
|
JSON.stringify({ url: e.url })
|
|
598
599
|
);
|
|
599
600
|
case "local":
|
|
600
601
|
return s.createValue(
|
|
601
|
-
|
|
602
|
+
gs,
|
|
602
603
|
JSON.stringify({
|
|
603
604
|
path: e.path,
|
|
604
605
|
signature: e.signature
|
|
@@ -608,12 +609,12 @@ function gn(s, e) {
|
|
|
608
609
|
return H(e);
|
|
609
610
|
}
|
|
610
611
|
}
|
|
611
|
-
class
|
|
612
|
+
class yn {
|
|
612
613
|
constructor() {
|
|
613
614
|
w(this, "nextMessageId", 0);
|
|
614
615
|
w(this, "worker");
|
|
615
616
|
w(this, "pendingRequests", /* @__PURE__ */ new Map());
|
|
616
|
-
const e = typeof global < "u" && "__WORKER_PATH__" in global ? global.__WORKER_PATH__ : K.resolve(import.meta.dirname, "worker.js"), t = this.worker = new
|
|
617
|
+
const e = typeof global < "u" && "__WORKER_PATH__" in global ? global.__WORKER_PATH__ : K.resolve(import.meta.dirname, "worker.js"), t = this.worker = new fo(
|
|
617
618
|
e,
|
|
618
619
|
{
|
|
619
620
|
workerData: {}
|
|
@@ -644,24 +645,24 @@ class mn {
|
|
|
644
645
|
return this.terminate();
|
|
645
646
|
}
|
|
646
647
|
}
|
|
647
|
-
const
|
|
648
|
-
function
|
|
648
|
+
const wn = { name: "BlockPackCustom", version: "1" }, ms = "template", vs = "frontend";
|
|
649
|
+
function gr(s) {
|
|
649
650
|
return s.endsWith("/") ? s : `${s}/`;
|
|
650
651
|
}
|
|
651
|
-
function
|
|
652
|
+
function Sn(s) {
|
|
652
653
|
return Buffer.from(s).toString("utf8");
|
|
653
654
|
}
|
|
654
655
|
function Me(s) {
|
|
655
|
-
return JSON.parse(
|
|
656
|
+
return JSON.parse(Sn(s));
|
|
656
657
|
}
|
|
657
|
-
class
|
|
658
|
+
class bn {
|
|
658
659
|
constructor(e, t, r) {
|
|
659
|
-
w(this, "remoteContentCache", new
|
|
660
|
+
w(this, "remoteContentCache", new ts({
|
|
660
661
|
max: 500,
|
|
661
662
|
maxSize: 128 * 1024 * 1024,
|
|
662
663
|
fetchMethod: async (e) => {
|
|
663
664
|
const t = this.http !== void 0 ? { dispatcher: this.http } : {};
|
|
664
|
-
return await (await
|
|
665
|
+
return await (await Dt(e, t)).body.arrayBuffer();
|
|
665
666
|
},
|
|
666
667
|
sizeCalculation: (e) => e.byteLength
|
|
667
668
|
}));
|
|
@@ -674,17 +675,17 @@ class wn {
|
|
|
674
675
|
case "prepared":
|
|
675
676
|
return e.config;
|
|
676
677
|
case "dev-v1": {
|
|
677
|
-
const t = await
|
|
678
|
+
const t = await ur(e.folder), r = await Q.promises.readFile(t.config, { encoding: "utf-8" });
|
|
678
679
|
return JSON.parse(r);
|
|
679
680
|
}
|
|
680
681
|
case "dev-v2": {
|
|
681
|
-
const t = await
|
|
682
|
+
const t = await rr(e.folder), r = await Q.promises.readFile(t.components.model.file, {
|
|
682
683
|
encoding: "utf-8"
|
|
683
684
|
});
|
|
684
685
|
return JSON.parse(r);
|
|
685
686
|
}
|
|
686
687
|
case "from-registry-v1": {
|
|
687
|
-
const t = `${
|
|
688
|
+
const t = `${gr(e.registryUrl)}${fe.packageContentPrefix({ organization: e.id.organization, package: e.id.name, version: e.id.version })}`, r = await this.remoteContentCache.forceFetch(`${t}/config.json`);
|
|
688
689
|
return Me(r);
|
|
689
690
|
}
|
|
690
691
|
case "from-registry-v2": {
|
|
@@ -701,7 +702,7 @@ class wn {
|
|
|
701
702
|
if (e.type === "prepared")
|
|
702
703
|
return e;
|
|
703
704
|
const t = await this.prepareWithoutUnpacking(e);
|
|
704
|
-
const r =
|
|
705
|
+
const r = Zt(o, new yn(), !0);
|
|
705
706
|
return {
|
|
706
707
|
...t,
|
|
707
708
|
type: "prepared",
|
|
@@ -713,7 +714,7 @@ class wn {
|
|
|
713
714
|
} catch (n) {
|
|
714
715
|
var i = n, a = !0;
|
|
715
716
|
} finally {
|
|
716
|
-
var c =
|
|
717
|
+
var c = er(o, i, a);
|
|
717
718
|
c && await c;
|
|
718
719
|
}
|
|
719
720
|
}
|
|
@@ -722,8 +723,8 @@ class wn {
|
|
|
722
723
|
case "explicit":
|
|
723
724
|
return e;
|
|
724
725
|
case "dev-v1": {
|
|
725
|
-
const t = await
|
|
726
|
-
await
|
|
726
|
+
const t = await ur(e.folder), r = await Q.promises.readFile(t.workflow), o = JSON.parse(
|
|
727
|
+
await Q.promises.readFile(t.config, "utf-8")
|
|
727
728
|
), n = t.ui;
|
|
728
729
|
return {
|
|
729
730
|
type: "explicit",
|
|
@@ -741,14 +742,14 @@ class wn {
|
|
|
741
742
|
};
|
|
742
743
|
}
|
|
743
744
|
case "dev-v2": {
|
|
744
|
-
const t = await
|
|
745
|
-
await
|
|
745
|
+
const t = await rr(e.folder), r = JSON.parse(
|
|
746
|
+
await Q.promises.readFile(t.components.model.file, {
|
|
746
747
|
encoding: "utf-8"
|
|
747
748
|
})
|
|
748
|
-
), o = await
|
|
749
|
+
), o = await Q.promises.readFile(
|
|
749
750
|
t.components.workflow.main.file
|
|
750
751
|
), n = t.components.ui.folder, i = { ...e };
|
|
751
|
-
return e.mtime === void 0 && (i.mtime = await
|
|
752
|
+
return e.mtime === void 0 && (i.mtime = await jt(t)), {
|
|
752
753
|
type: "explicit",
|
|
753
754
|
template: {
|
|
754
755
|
type: "explicit",
|
|
@@ -764,7 +765,7 @@ class wn {
|
|
|
764
765
|
};
|
|
765
766
|
}
|
|
766
767
|
case "from-registry-v1": {
|
|
767
|
-
const t = `${
|
|
768
|
+
const t = `${gr(e.registryUrl)}${fe.packageContentPrefix({ organization: e.id.organization, package: e.id.name, version: e.id.version })}`, r = `${t}/template.plj.gz`, o = await this.remoteContentCache.forceFetch(r), n = new Uint8Array(o), i = await this.remoteContentCache.forceFetch(`${t}/config.json`), a = Me(i);
|
|
768
769
|
return {
|
|
769
770
|
type: "explicit",
|
|
770
771
|
template: {
|
|
@@ -800,14 +801,14 @@ class wn {
|
|
|
800
801
|
}
|
|
801
802
|
}
|
|
802
803
|
}
|
|
803
|
-
function
|
|
804
|
-
const t = { config: e.config, source: e.source }, r = s.createStruct(
|
|
805
|
-
return s.createField(
|
|
804
|
+
function Rn(s, e) {
|
|
805
|
+
const t = { config: e.config, source: e.source }, r = s.createStruct(wn, JSON.stringify(t));
|
|
806
|
+
return s.createField(U(r, ms), "Input", Vt(s, e.template)), s.createField(U(r, vs), "Input", vn(s, e.frontend)), s.lock(r), r;
|
|
806
807
|
}
|
|
807
|
-
function
|
|
808
|
+
function mr(s, e) {
|
|
808
809
|
switch (e.type) {
|
|
809
810
|
case "prepared":
|
|
810
|
-
return
|
|
811
|
+
return Rn(s, e);
|
|
811
812
|
default:
|
|
812
813
|
return H(e.type);
|
|
813
814
|
}
|
|
@@ -815,10 +816,10 @@ function hr(s, e) {
|
|
|
815
816
|
function _e(s, e) {
|
|
816
817
|
return { __isRef: !0, blockId: s, name: e };
|
|
817
818
|
}
|
|
818
|
-
function
|
|
819
|
+
function En(s) {
|
|
819
820
|
return typeof s == "object" && s !== null && "__isRef" in s && s.__isRef === !0 && "blockId" in s && "name" in s;
|
|
820
821
|
}
|
|
821
|
-
function
|
|
822
|
+
function It(s, e, t) {
|
|
822
823
|
const r = typeof e;
|
|
823
824
|
switch (r) {
|
|
824
825
|
case "function":
|
|
@@ -831,21 +832,21 @@ function $t(s, e, t) {
|
|
|
831
832
|
return;
|
|
832
833
|
case "object":
|
|
833
834
|
if (e === null) return;
|
|
834
|
-
if (
|
|
835
|
+
if (En(e))
|
|
835
836
|
t === void 0 || t.has(e.blockId) ? s.upstreams.add(e.blockId) : s.missingReferences = !0;
|
|
836
837
|
else if (Array.isArray(e))
|
|
837
|
-
for (const o of e)
|
|
838
|
+
for (const o of e) It(s, o, t);
|
|
838
839
|
else
|
|
839
840
|
for (const [, o] of Object.entries(e))
|
|
840
|
-
|
|
841
|
+
It(s, o, t);
|
|
841
842
|
return;
|
|
842
843
|
default:
|
|
843
844
|
H(r);
|
|
844
845
|
}
|
|
845
846
|
}
|
|
846
|
-
function
|
|
847
|
+
function Cn(s, e) {
|
|
847
848
|
const t = { upstreams: /* @__PURE__ */ new Set(), missingReferences: !1 };
|
|
848
|
-
return
|
|
849
|
+
return It(t, s, e), t;
|
|
849
850
|
}
|
|
850
851
|
function ne(s) {
|
|
851
852
|
return {
|
|
@@ -854,7 +855,7 @@ function ne(s) {
|
|
|
854
855
|
}
|
|
855
856
|
};
|
|
856
857
|
}
|
|
857
|
-
class
|
|
858
|
+
class ys {
|
|
858
859
|
constructor(e) {
|
|
859
860
|
/** Nodes are stored in the map in topological order */
|
|
860
861
|
w(this, "nodes");
|
|
@@ -884,7 +885,7 @@ class ms {
|
|
|
884
885
|
}
|
|
885
886
|
}
|
|
886
887
|
}
|
|
887
|
-
function
|
|
888
|
+
function Ft(s) {
|
|
888
889
|
const e = /* @__PURE__ */ new Map();
|
|
889
890
|
let t;
|
|
890
891
|
for (const { id: r } of ne(s)) {
|
|
@@ -894,14 +895,14 @@ function It(s) {
|
|
|
894
895
|
};
|
|
895
896
|
e.set(r, o), t === void 0 ? o.upstream = /* @__PURE__ */ new Set() : (o.upstream = /* @__PURE__ */ new Set([t.id]), t.downstream = /* @__PURE__ */ new Set([o.id])), t = o;
|
|
896
897
|
}
|
|
897
|
-
return t !== void 0 && (t.downstream = /* @__PURE__ */ new Set()), new
|
|
898
|
+
return t !== void 0 && (t.downstream = /* @__PURE__ */ new Set()), new ys(e);
|
|
898
899
|
}
|
|
899
900
|
function Ze(s, e) {
|
|
900
901
|
const t = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Set();
|
|
901
902
|
for (const { id: o } of ne(s)) {
|
|
902
903
|
const n = e(o);
|
|
903
904
|
if (n === void 0) continue;
|
|
904
|
-
const i =
|
|
905
|
+
const i = Cn(n, r), a = {
|
|
905
906
|
id: o,
|
|
906
907
|
missingReferences: i.missingReferences,
|
|
907
908
|
upstream: i.upstreams,
|
|
@@ -910,41 +911,41 @@ function Ze(s, e) {
|
|
|
910
911
|
};
|
|
911
912
|
t.set(o, a), i.upstreams.forEach((c) => t.get(c).downstream.add(o)), r.add(o);
|
|
912
913
|
}
|
|
913
|
-
return new
|
|
914
|
+
return new ys(t);
|
|
914
915
|
}
|
|
915
|
-
function
|
|
916
|
+
function kn(s, e) {
|
|
916
917
|
if (s.size !== e.size) return !1;
|
|
917
918
|
for (const t of s) if (!e.has(t)) return !1;
|
|
918
919
|
return !0;
|
|
919
920
|
}
|
|
920
|
-
function
|
|
921
|
-
if (s.size > e.size) return
|
|
921
|
+
function At(s, e) {
|
|
922
|
+
if (s.size > e.size) return At(e, s);
|
|
922
923
|
for (const t of s) if (e.has(t)) return !0;
|
|
923
924
|
return !1;
|
|
924
925
|
}
|
|
925
|
-
function
|
|
926
|
+
function vr(s, e) {
|
|
926
927
|
const t = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new Set();
|
|
927
928
|
return s.nodes.forEach((n) => {
|
|
928
929
|
const i = e.nodes.get(n.id);
|
|
929
|
-
i === void 0 ? t.add(n.id) : (!
|
|
930
|
+
i === void 0 ? t.add(n.id) : (!kn(n.upstream, i.upstream) || At(n.upstream, o)) && o.add(n.id);
|
|
930
931
|
}), e.nodes.forEach((n) => {
|
|
931
|
-
s.nodes.has(n.id) ?
|
|
932
|
+
s.nodes.has(n.id) ? At(n.upstream, o) && o.add(n.id) : r.add(n.id);
|
|
932
933
|
}), { onlyInA: t, onlyInB: r, different: o };
|
|
933
934
|
}
|
|
934
|
-
let
|
|
935
|
-
async function
|
|
936
|
-
if (
|
|
937
|
-
const s = await
|
|
935
|
+
let ft;
|
|
936
|
+
async function ws() {
|
|
937
|
+
if (ft === void 0) {
|
|
938
|
+
const s = await gn(ho["pframes.export-pframe-for-ui"]);
|
|
938
939
|
if (s.type !== "explicit") throw new Error("Unexpected prepared template type.");
|
|
939
940
|
const e = Ee("sha256").update(s.content).digest("hex");
|
|
940
|
-
|
|
941
|
+
ft = { spec: s, hash: e };
|
|
941
942
|
}
|
|
942
|
-
return
|
|
943
|
+
return ft;
|
|
943
944
|
}
|
|
944
|
-
function
|
|
945
|
-
return
|
|
945
|
+
function Pn(s, e, t) {
|
|
946
|
+
return ls(s, e, !0, { pf: t }, ["result"]).result;
|
|
946
947
|
}
|
|
947
|
-
function
|
|
948
|
+
function ht(s, e) {
|
|
948
949
|
let t = !1, r, o;
|
|
949
950
|
return () => {
|
|
950
951
|
if (!t)
|
|
@@ -953,13 +954,13 @@ function ft(s, e) {
|
|
|
953
954
|
return r !== n && (r = n, o = e()), e();
|
|
954
955
|
};
|
|
955
956
|
}
|
|
956
|
-
class
|
|
957
|
+
class yr {
|
|
957
958
|
constructor(e, t) {
|
|
958
|
-
w(this, "currentInputsC",
|
|
959
|
+
w(this, "currentInputsC", ht(
|
|
959
960
|
() => this.fields.currentArgs.modCount,
|
|
960
|
-
() => JSON.parse(Buffer.from(this.fields.currentArgs.value).toString())
|
|
961
|
+
() => et(JSON.parse(Buffer.from(this.fields.currentArgs.value).toString()))
|
|
961
962
|
));
|
|
962
|
-
w(this, "actualProductionInputsC",
|
|
963
|
+
w(this, "actualProductionInputsC", ht(
|
|
963
964
|
() => {
|
|
964
965
|
var e;
|
|
965
966
|
return (e = this.fields.prodArgs) == null ? void 0 : e.modCount;
|
|
@@ -968,10 +969,10 @@ class mr {
|
|
|
968
969
|
var t;
|
|
969
970
|
const e = (t = this.fields.prodArgs) == null ? void 0 : t.value;
|
|
970
971
|
if (e !== void 0)
|
|
971
|
-
return JSON.parse(Buffer.from(e).toString());
|
|
972
|
+
return et(JSON.parse(Buffer.from(e).toString()));
|
|
972
973
|
}
|
|
973
974
|
));
|
|
974
|
-
w(this, "productionStaleC",
|
|
975
|
+
w(this, "productionStaleC", ht(
|
|
975
976
|
() => {
|
|
976
977
|
var e;
|
|
977
978
|
return `${this.fields.currentArgs.modCount}_${(e = this.fields.prodArgs) == null ? void 0 : e.modCount}`;
|
|
@@ -1017,15 +1018,15 @@ class mr {
|
|
|
1017
1018
|
getTemplate(e) {
|
|
1018
1019
|
return e.getFutureFieldValue(
|
|
1019
1020
|
A.unwrapHolder(e, this.fields.blockPack.ref),
|
|
1020
|
-
|
|
1021
|
+
ms,
|
|
1021
1022
|
"Input"
|
|
1022
1023
|
);
|
|
1023
1024
|
}
|
|
1024
1025
|
}
|
|
1025
|
-
const
|
|
1026
|
+
const On = (s) => {
|
|
1026
1027
|
throw new Error(`No new block info for ${s}`);
|
|
1027
1028
|
};
|
|
1028
|
-
class
|
|
1029
|
+
class st {
|
|
1029
1030
|
constructor(e, t, r, o, n, i, a, c, u, l, d, f) {
|
|
1030
1031
|
w(this, "globalModCount", 0);
|
|
1031
1032
|
w(this, "fieldsChanged", !1);
|
|
@@ -1053,7 +1054,7 @@ class rt {
|
|
|
1053
1054
|
});
|
|
1054
1055
|
let e;
|
|
1055
1056
|
this.blockInfos.forEach((t) => {
|
|
1056
|
-
t.fields.blockSettings === void 0 && (e === void 0 && (e = this.createJsonFieldValue(
|
|
1057
|
+
t.fields.blockSettings === void 0 && (e === void 0 && (e = this.createJsonFieldValue(tr)), this.setBlockFieldObj(t.id, "blockSettings", e));
|
|
1057
1058
|
});
|
|
1058
1059
|
}
|
|
1059
1060
|
get wasModified() {
|
|
@@ -1063,7 +1064,7 @@ class rt {
|
|
|
1063
1064
|
return JSON.parse(JSON.stringify(this.struct));
|
|
1064
1065
|
}
|
|
1065
1066
|
getStagingGraph() {
|
|
1066
|
-
return this.stagingGraph === void 0 && (this.stagingGraph =
|
|
1067
|
+
return this.stagingGraph === void 0 && (this.stagingGraph = Ft(this.struct)), this.stagingGraph;
|
|
1067
1068
|
}
|
|
1068
1069
|
getPendingProductionGraph() {
|
|
1069
1070
|
return this.pendingProductionGraph === void 0 && (this.pendingProductionGraph = Ze(
|
|
@@ -1097,7 +1098,7 @@ class rt {
|
|
|
1097
1098
|
throw new Error("block not found");
|
|
1098
1099
|
}
|
|
1099
1100
|
setBlockFieldObj(e, t, r) {
|
|
1100
|
-
const o =
|
|
1101
|
+
const o = U(this.rid, G(e, t));
|
|
1101
1102
|
if (r.ref === void 0) throw new Error("Can't set value with empty ref");
|
|
1102
1103
|
this.getBlockInfo(e).fields[t] === void 0 ? this.tx.createField(o, "Dynamic", r.ref) : this.tx.setField(o, r.ref), this.getBlockInfo(e).fields[t] = {
|
|
1103
1104
|
modCount: this.globalModCount++,
|
|
@@ -1112,7 +1113,7 @@ class rt {
|
|
|
1112
1113
|
const o = this.getBlockInfo(e);
|
|
1113
1114
|
for (const n of t) {
|
|
1114
1115
|
const i = o.fields;
|
|
1115
|
-
n in i && (this.tx.removeField(
|
|
1116
|
+
n in i && (this.tx.removeField(U(this.rid, G(e, n))), delete i[n], this.fieldsChanged = !0, r = !0);
|
|
1116
1117
|
}
|
|
1117
1118
|
return r;
|
|
1118
1119
|
}
|
|
@@ -1170,7 +1171,7 @@ class rt {
|
|
|
1170
1171
|
if (((n = o.fields.prodCtx) == null ? void 0 : n.ref) === void 0)
|
|
1171
1172
|
throw new Error("One of the upstreams staging is not rendered.");
|
|
1172
1173
|
t.push(A.unwrapHolder(this.tx, o.fields.prodCtx.ref));
|
|
1173
|
-
}),
|
|
1174
|
+
}), pr(this.tx, t);
|
|
1174
1175
|
}
|
|
1175
1176
|
createStagingCtx(e) {
|
|
1176
1177
|
const t = [];
|
|
@@ -1180,16 +1181,16 @@ class rt {
|
|
|
1180
1181
|
if (((n = o.fields.stagingCtx) == null ? void 0 : n.ref) === void 0)
|
|
1181
1182
|
throw new Error("One of the upstreams staging is not rendered.");
|
|
1182
1183
|
t.push(A.unwrapHolder(this.tx, o.fields.stagingCtx.ref)), ((i = o.fields.prodCtx) == null ? void 0 : i.ref) !== void 0 && t.push(A.unwrapHolder(this.tx, o.fields.prodCtx.ref));
|
|
1183
|
-
}),
|
|
1184
|
+
}), pr(this.tx, t);
|
|
1184
1185
|
}
|
|
1185
1186
|
exportCtx(e) {
|
|
1186
|
-
return
|
|
1187
|
+
return Pn(this.tx, A.unwrapHolder(this.tx, this.ctxExportTplHolder), e);
|
|
1187
1188
|
}
|
|
1188
1189
|
renderStagingFor(e) {
|
|
1189
1190
|
this.resetStaging(e);
|
|
1190
1191
|
const t = this.getBlockInfo(e), r = this.createStagingCtx(this.getStagingGraph().nodes.get(e).upstream);
|
|
1191
1192
|
if (this.getBlock(e).renderingMode !== "Heavy") throw new Error("not supported yet");
|
|
1192
|
-
const o = t.getTemplate(this.tx), n =
|
|
1193
|
+
const o = t.getTemplate(this.tx), n = dr(this.tx, o, {
|
|
1193
1194
|
args: t.fields.currentArgs.ref,
|
|
1194
1195
|
blockId: this.tx.createValue(A.JsonString, JSON.stringify(e)),
|
|
1195
1196
|
isProduction: this.tx.createValue(A.JsonBool, JSON.stringify(!1)),
|
|
@@ -1207,7 +1208,7 @@ class rt {
|
|
|
1207
1208
|
const t = this.getBlockInfo(e), r = this.createProdCtx(this.getPendingProductionGraph().nodes.get(e).upstream);
|
|
1208
1209
|
if (this.getBlock(e).renderingMode === "Light")
|
|
1209
1210
|
throw new Error("Can't render production for light block.");
|
|
1210
|
-
const o = t.getTemplate(this.tx), n =
|
|
1211
|
+
const o = t.getTemplate(this.tx), n = dr(this.tx, o, {
|
|
1211
1212
|
args: t.fields.currentArgs.ref,
|
|
1212
1213
|
blockId: this.tx.createValue(A.JsonString, JSON.stringify(e)),
|
|
1213
1214
|
isProduction: this.tx.createValue(A.JsonBool, JSON.stringify(!0)),
|
|
@@ -1224,26 +1225,26 @@ class rt {
|
|
|
1224
1225
|
// Structure changes
|
|
1225
1226
|
//
|
|
1226
1227
|
/** Very generic method, better check for more specialized case-specific methods first. */
|
|
1227
|
-
updateStructure(e, t =
|
|
1228
|
-
const r = this.getStagingGraph(), o = this.getActualProductionGraph(), n =
|
|
1228
|
+
updateStructure(e, t = On) {
|
|
1229
|
+
const r = this.getStagingGraph(), o = this.getActualProductionGraph(), n = Ft(e), i = Ze(
|
|
1229
1230
|
e,
|
|
1230
1231
|
(u) => {
|
|
1231
1232
|
var l;
|
|
1232
1233
|
return (l = this.blockInfos.get(u)) == null ? void 0 : l.actualProductionInputs;
|
|
1233
1234
|
}
|
|
1234
|
-
), a =
|
|
1235
|
+
), a = vr(r, n), c = vr(o, i);
|
|
1235
1236
|
for (const u of a.onlyInA) {
|
|
1236
1237
|
const { fields: l } = this.getBlockInfo(u);
|
|
1237
1238
|
this.deleteBlockFields(u, ...Object.keys(l)), this.blockInfos.delete(u), this.blocksInLimbo.delete(u) && (this.renderingStateChanged = !0), this.blockFrontendStates.delete(u) && this.changedBlockFrontendStates.add(u);
|
|
1238
1239
|
}
|
|
1239
1240
|
for (const u of a.onlyInB) {
|
|
1240
|
-
const l = new
|
|
1241
|
+
const l = new yr(u, {});
|
|
1241
1242
|
this.blockInfos.set(u, l);
|
|
1242
|
-
const d = t(u), f =
|
|
1243
|
+
const d = t(u), f = mr(this.tx, d.blockPack);
|
|
1243
1244
|
this.setBlockField(u, "blockPack", A.wrapInHolder(this.tx, f), "NotReady"), this.setBlockFieldObj(
|
|
1244
1245
|
u,
|
|
1245
1246
|
"blockSettings",
|
|
1246
|
-
this.createJsonFieldValue(
|
|
1247
|
+
this.createJsonFieldValue(tr)
|
|
1247
1248
|
), this.setBlockFieldObj(u, "currentArgs", this.createJsonFieldValueByContent(d.args)), d.uiState && (this.blockFrontendStates.set(u, d.uiState), this.changedBlockFrontendStates.add(u)), l.check();
|
|
1248
1249
|
}
|
|
1249
1250
|
for (const u of a.different) this.resetStaging(u);
|
|
@@ -1295,7 +1296,7 @@ class rt {
|
|
|
1295
1296
|
this.setBlockField(
|
|
1296
1297
|
e,
|
|
1297
1298
|
"blockPack",
|
|
1298
|
-
A.wrapInHolder(this.tx,
|
|
1299
|
+
A.wrapInHolder(this.tx, mr(this.tx, t)),
|
|
1299
1300
|
"NotReady"
|
|
1300
1301
|
), r !== void 0 ? (this.setArgs([{ blockId: e, args: r.args }]), this.setUiState(e, r.uiState)) : this.getStagingGraph().traverse("downstream", [e], ({ id: n }) => this.resetStaging(n)), o.productionRendered && this.getActualProductionGraph().traverse(
|
|
1301
1302
|
"downstream",
|
|
@@ -1344,7 +1345,7 @@ class rt {
|
|
|
1344
1345
|
* accordingly */
|
|
1345
1346
|
stopProduction(...e) {
|
|
1346
1347
|
var i, a;
|
|
1347
|
-
const t = this.getActualProductionGraph(), r = new
|
|
1348
|
+
const t = this.getActualProductionGraph(), r = new rs(e), o = new Set(e), n = [];
|
|
1348
1349
|
for (; !r.isEmpty(); ) {
|
|
1349
1350
|
const c = r.shift(), u = this.getBlockInfo(c).fields;
|
|
1350
1351
|
if (!(((i = u.prodOutput) == null ? void 0 : i.status) === "Ready" && ((a = u.prodCtx) == null ? void 0 : a.status) === "Ready") && this.deleteBlockFields(c, "prodOutput", "prodCtx", "prodUiCtx", "prodArgs")) {
|
|
@@ -1404,14 +1405,14 @@ class rt {
|
|
|
1404
1405
|
assignAuthorMarkers() {
|
|
1405
1406
|
const e = this.author ? JSON.stringify(this.author) : void 0;
|
|
1406
1407
|
for (const t of this.blocksWithChangedInputs)
|
|
1407
|
-
e === void 0 ? this.tx.deleteKValue(this.rid,
|
|
1408
|
-
(this.metaChanged || this.structureChanged) && (e === void 0 ? this.tx.deleteKValue(this.rid,
|
|
1408
|
+
e === void 0 ? this.tx.deleteKValue(this.rid, Pt(t)) : this.tx.setKValue(this.rid, Pt(t), e);
|
|
1409
|
+
(this.metaChanged || this.structureChanged) && (e === void 0 ? this.tx.deleteKValue(this.rid, Ot) : this.tx.setKValue(this.rid, Ot, e));
|
|
1409
1410
|
}
|
|
1410
1411
|
save() {
|
|
1411
1412
|
if (this.wasModified) {
|
|
1412
|
-
this.lastModifiedChanged && this.tx.setKValue(this.rid, Be, JSON.stringify(this.lastModified)), this.structureChanged && this.tx.setKValue(this.rid,
|
|
1413
|
+
this.lastModifiedChanged && this.tx.setKValue(this.rid, Be, JSON.stringify(this.lastModified)), this.structureChanged && this.tx.setKValue(this.rid, he, JSON.stringify(this.struct)), this.renderingStateChanged && this.tx.setKValue(
|
|
1413
1414
|
this.rid,
|
|
1414
|
-
|
|
1415
|
+
rt,
|
|
1415
1416
|
JSON.stringify({
|
|
1416
1417
|
...this.renderingState,
|
|
1417
1418
|
blocksInLimbo: [...this.blocksInLimbo]
|
|
@@ -1419,20 +1420,20 @@ class rt {
|
|
|
1419
1420
|
), this.metaChanged && this.tx.setKValue(this.rid, je, JSON.stringify(this.meta));
|
|
1420
1421
|
for (const e of this.changedBlockFrontendStates) {
|
|
1421
1422
|
const t = this.blockFrontendStates.get(e);
|
|
1422
|
-
t === void 0 ? this.tx.deleteKValue(this.rid,
|
|
1423
|
+
t === void 0 ? this.tx.deleteKValue(this.rid, kt(e)) : this.tx.setKValue(this.rid, kt(e), t);
|
|
1423
1424
|
}
|
|
1424
1425
|
this.assignAuthorMarkers();
|
|
1425
1426
|
}
|
|
1426
1427
|
}
|
|
1427
1428
|
static async load(e, t, r) {
|
|
1428
|
-
const o = e.getResourceData(t, !0), n = e.getKValueJson(t,
|
|
1429
|
+
const o = e.getResourceData(t, !0), n = e.getKValueJson(t, is), i = e.getKValueJson(t, Be), a = e.getKValueJson(t, je), c = e.getKValueJson(t, he), u = e.getKValueJson(t, rt), l = e.listKeyValuesString(t), [
|
|
1429
1430
|
d,
|
|
1430
1431
|
f,
|
|
1431
1432
|
h,
|
|
1432
1433
|
R,
|
|
1433
1434
|
g,
|
|
1434
|
-
{ stagingRefreshTimestamp:
|
|
1435
|
-
|
|
1435
|
+
{ stagingRefreshTimestamp: x, blocksInLimbo: T },
|
|
1436
|
+
B
|
|
1436
1437
|
] = await Promise.all([
|
|
1437
1438
|
o,
|
|
1438
1439
|
n,
|
|
@@ -1442,61 +1443,61 @@ class rt {
|
|
|
1442
1443
|
u,
|
|
1443
1444
|
l
|
|
1444
1445
|
]);
|
|
1445
|
-
if (f !==
|
|
1446
|
+
if (f !== as)
|
|
1446
1447
|
throw new Error(
|
|
1447
1448
|
`Can't act on this project resource because it has a wrong schema version: ${f}`
|
|
1448
1449
|
);
|
|
1449
1450
|
const $ = /* @__PURE__ */ new Map();
|
|
1450
1451
|
for (const p of d.fields) {
|
|
1451
|
-
const m =
|
|
1452
|
+
const m = Xo(p.name);
|
|
1452
1453
|
if (m === void 0) continue;
|
|
1453
1454
|
let y = $.get(m.blockId);
|
|
1454
1455
|
y === void 0 && (y = {
|
|
1455
1456
|
id: m.blockId,
|
|
1456
1457
|
fields: {}
|
|
1457
|
-
}, $.set(m.blockId, y)), y.fields[m.fieldName] =
|
|
1458
|
+
}, $.set(m.blockId, y)), y.fields[m.fieldName] = tt(p.value) ? { modCount: 0 } : { modCount: 0, ref: p.value };
|
|
1458
1459
|
}
|
|
1459
|
-
const M = await
|
|
1460
|
-
(p) => p.name ===
|
|
1460
|
+
const M = await ws(), ge = $t(M.hash), L = d.fields.find(
|
|
1461
|
+
(p) => p.name === ge
|
|
1461
1462
|
);
|
|
1462
|
-
let
|
|
1463
|
-
L !== void 0 ?
|
|
1464
|
-
|
|
1463
|
+
let re;
|
|
1464
|
+
L !== void 0 ? re = Et(L.value) : (re = A.wrapInHolder(e, Vt(e, M.spec)), e.createField(
|
|
1465
|
+
U(t, $t(M.hash)),
|
|
1465
1466
|
"Dynamic",
|
|
1466
|
-
|
|
1467
|
+
re
|
|
1467
1468
|
));
|
|
1468
|
-
const
|
|
1469
|
-
for (const p of
|
|
1470
|
-
const m =
|
|
1471
|
-
m !== void 0 &&
|
|
1469
|
+
const ce = { stagingRefreshTimestamp: x }, z = new Set(T), ie = /* @__PURE__ */ new Map();
|
|
1470
|
+
for (const p of B) {
|
|
1471
|
+
const m = Wo(p.key);
|
|
1472
|
+
m !== void 0 && ie.set(m, p.value);
|
|
1472
1473
|
}
|
|
1473
|
-
const
|
|
1474
|
+
const Y = [];
|
|
1474
1475
|
$.forEach(({ fields: p }) => {
|
|
1475
1476
|
for (const [, m] of Object.entries(p))
|
|
1476
1477
|
if (m.ref !== void 0) {
|
|
1477
|
-
if (!
|
|
1478
|
+
if (!eo(m.ref) || to(m.ref))
|
|
1478
1479
|
throw new Error("unexpected behaviour");
|
|
1479
|
-
|
|
1480
|
+
Y.push([m, e.getResourceData(m.ref, !1)]);
|
|
1480
1481
|
}
|
|
1481
1482
|
});
|
|
1482
|
-
for (const [p, m] of
|
|
1483
|
+
for (const [p, m] of Y) {
|
|
1483
1484
|
const y = await m;
|
|
1484
|
-
p.value = y.data,
|
|
1485
|
+
p.value = y.data, or(y.error) ? p.status = "Error" : y.resourceReady || or(y.originalResourceId) ? p.status = "Ready" : p.status = "NotReady";
|
|
1485
1486
|
}
|
|
1486
|
-
const
|
|
1487
|
-
$.forEach(({ id: p, fields: m }) =>
|
|
1488
|
-
const
|
|
1487
|
+
const D = /* @__PURE__ */ new Map();
|
|
1488
|
+
$.forEach(({ id: p, fields: m }) => D.set(p, new yr(p, m)));
|
|
1489
|
+
const W = /* @__PURE__ */ new Set();
|
|
1489
1490
|
for (const p of ne(g)) {
|
|
1490
|
-
if (!
|
|
1491
|
+
if (!D.has(p.id))
|
|
1491
1492
|
throw new Error(`Inconsistent project structure: no inputs for ${p.id}`);
|
|
1492
|
-
|
|
1493
|
+
W.add(p.id);
|
|
1493
1494
|
}
|
|
1494
|
-
|
|
1495
|
-
if (!
|
|
1495
|
+
D.forEach((p) => {
|
|
1496
|
+
if (!W.has(p.id))
|
|
1496
1497
|
throw new Error(`Inconsistent project structure: no structure entry for ${p.id}`);
|
|
1497
1498
|
p.check();
|
|
1498
1499
|
});
|
|
1499
|
-
const v = new
|
|
1500
|
+
const v = new st(
|
|
1500
1501
|
t,
|
|
1501
1502
|
e,
|
|
1502
1503
|
r,
|
|
@@ -1504,42 +1505,42 @@ class rt {
|
|
|
1504
1505
|
h,
|
|
1505
1506
|
R,
|
|
1506
1507
|
g,
|
|
1507
|
-
|
|
1508
|
+
ce,
|
|
1508
1509
|
z,
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1510
|
+
D,
|
|
1511
|
+
ie,
|
|
1512
|
+
re
|
|
1512
1513
|
);
|
|
1513
1514
|
return v.fixProblemsAndMigrate(), v;
|
|
1514
1515
|
}
|
|
1515
1516
|
}
|
|
1516
|
-
async function
|
|
1517
|
-
const t = s.createEphemeral(
|
|
1517
|
+
async function $n(s, e = Jo) {
|
|
1518
|
+
const t = s.createEphemeral(Mo);
|
|
1518
1519
|
s.lock(t);
|
|
1519
1520
|
const r = String(Date.now());
|
|
1520
|
-
s.setKValue(t,
|
|
1521
|
-
const o = await
|
|
1521
|
+
s.setKValue(t, is, JSON.stringify(as)), s.setKValue(t, xt, r), s.setKValue(t, Be, r), s.setKValue(t, je, JSON.stringify(e)), s.setKValue(t, he, JSON.stringify(Uo)), s.setKValue(t, rt, JSON.stringify(Go));
|
|
1522
|
+
const o = await ws();
|
|
1522
1523
|
return s.createField(
|
|
1523
|
-
|
|
1524
|
+
U(t, $t(o.hash)),
|
|
1524
1525
|
"Dynamic",
|
|
1525
|
-
A.wrapInHolder(s,
|
|
1526
|
+
A.wrapInHolder(s, Vt(s, o.spec))
|
|
1526
1527
|
), t;
|
|
1527
1528
|
}
|
|
1528
1529
|
async function Ke(s, e, t) {
|
|
1529
|
-
return
|
|
1530
|
+
return Z(s, e, void 0, t);
|
|
1530
1531
|
}
|
|
1531
|
-
async function
|
|
1532
|
-
if (s instanceof
|
|
1532
|
+
async function Z(s, e, t, r) {
|
|
1533
|
+
if (s instanceof Zs)
|
|
1533
1534
|
return await s.withWriteTx("ProjectAction", async (o) => {
|
|
1534
|
-
const n = await
|
|
1535
|
+
const n = await st.load(o, e, t), i = await r(n);
|
|
1535
1536
|
return n.wasModified && (n.save(), await o.commit()), i;
|
|
1536
1537
|
});
|
|
1537
1538
|
{
|
|
1538
|
-
const o = await
|
|
1539
|
+
const o = await st.load(s, e, t), n = await r(o);
|
|
1539
1540
|
return o.save(), n;
|
|
1540
1541
|
}
|
|
1541
1542
|
}
|
|
1542
|
-
function*
|
|
1543
|
+
function* In(s) {
|
|
1543
1544
|
switch (s.type) {
|
|
1544
1545
|
case "Json":
|
|
1545
1546
|
return;
|
|
@@ -1554,21 +1555,21 @@ function* On(s) {
|
|
|
1554
1555
|
H(s);
|
|
1555
1556
|
}
|
|
1556
1557
|
}
|
|
1557
|
-
function
|
|
1558
|
+
function wr(s, e) {
|
|
1558
1559
|
return Object.fromEntries(
|
|
1559
1560
|
Object.entries(s).map(([t, r]) => [t, e(r, t)])
|
|
1560
1561
|
);
|
|
1561
1562
|
}
|
|
1562
|
-
function
|
|
1563
|
+
function Fn(s, e) {
|
|
1563
1564
|
switch (s.type) {
|
|
1564
1565
|
case "Json":
|
|
1565
1566
|
return { ...s };
|
|
1566
1567
|
case "JsonPartitioned":
|
|
1567
|
-
return { ...s, parts:
|
|
1568
|
+
return { ...s, parts: wr(s.parts, e) };
|
|
1568
1569
|
case "BinaryPartitioned":
|
|
1569
1570
|
return {
|
|
1570
1571
|
...s,
|
|
1571
|
-
parts:
|
|
1572
|
+
parts: wr(s.parts, (t) => ({
|
|
1572
1573
|
index: e(t.index),
|
|
1573
1574
|
values: e(t.values)
|
|
1574
1575
|
}))
|
|
@@ -1577,26 +1578,26 @@ function $n(s, e) {
|
|
|
1577
1578
|
H(s);
|
|
1578
1579
|
}
|
|
1579
1580
|
}
|
|
1580
|
-
const
|
|
1581
|
+
const An = xe("PColumnData/JsonPartitioned", "1"), Tn = xe(
|
|
1581
1582
|
"PColumnData/Partitioned/JsonPartitioned",
|
|
1582
1583
|
"1"
|
|
1583
|
-
),
|
|
1584
|
+
), Ln = xe("PColumnData/BinaryPartitioned", "1"), Dn = xe(
|
|
1584
1585
|
"PColumnData/Partitioned/BinaryPartitioned",
|
|
1585
1586
|
"1"
|
|
1586
|
-
),
|
|
1587
|
-
function
|
|
1587
|
+
), Nn = xe("PColumnData/Json", "1");
|
|
1588
|
+
function Bn(s) {
|
|
1588
1589
|
if (!s.getIsReadyOrError()) throw new Error("Data not ready.");
|
|
1589
1590
|
const e = s.getDataAsJson();
|
|
1590
1591
|
if (e === void 0)
|
|
1591
1592
|
throw new Error("unexpected data info structure, no resource data");
|
|
1592
|
-
if (
|
|
1593
|
+
if (le(s.resourceType, Nn)) {
|
|
1593
1594
|
const t = e;
|
|
1594
1595
|
return {
|
|
1595
1596
|
type: "Json",
|
|
1596
1597
|
keyLength: t.keyLength,
|
|
1597
1598
|
data: t.data
|
|
1598
1599
|
};
|
|
1599
|
-
} else if (
|
|
1600
|
+
} else if (le(s.resourceType, An)) {
|
|
1600
1601
|
const t = e, r = Object.fromEntries(
|
|
1601
1602
|
s.listInputFields().map((o) => [o, s.traverse({ field: o, errorIfFieldNotSet: !0 }).resourceInfo])
|
|
1602
1603
|
);
|
|
@@ -1605,7 +1606,7 @@ function Dn(s) {
|
|
|
1605
1606
|
partitionKeyLength: t.partitionKeyLength,
|
|
1606
1607
|
parts: r
|
|
1607
1608
|
};
|
|
1608
|
-
} else if (
|
|
1609
|
+
} else if (le(s.resourceType, Tn)) {
|
|
1609
1610
|
const t = e, r = {};
|
|
1610
1611
|
for (const o of s.listInputFields()) {
|
|
1611
1612
|
const n = s.traverse({ field: o, errorIfFieldNotSet: !0 }), i = n.listInputFields();
|
|
@@ -1623,7 +1624,7 @@ function Dn(s) {
|
|
|
1623
1624
|
partitionKeyLength: t.superPartitionKeyLength + t.partitionKeyLength,
|
|
1624
1625
|
parts: r
|
|
1625
1626
|
};
|
|
1626
|
-
} else if (
|
|
1627
|
+
} else if (le(s.resourceType, Ln)) {
|
|
1627
1628
|
const t = e, r = {};
|
|
1628
1629
|
for (const o of s.listInputFields())
|
|
1629
1630
|
if (o.endsWith(".index")) {
|
|
@@ -1644,7 +1645,7 @@ function Dn(s) {
|
|
|
1644
1645
|
partitionKeyLength: t.partitionKeyLength,
|
|
1645
1646
|
parts: r
|
|
1646
1647
|
};
|
|
1647
|
-
} else if (
|
|
1648
|
+
} else if (le(s.resourceType, Dn)) {
|
|
1648
1649
|
const t = e, r = {};
|
|
1649
1650
|
for (const o of s.listInputFields()) {
|
|
1650
1651
|
const n = s.traverse({ field: o, errorIfFieldNotSet: !0 }), i = n.listInputFields();
|
|
@@ -1678,9 +1679,9 @@ function Dn(s) {
|
|
|
1678
1679
|
parts: r
|
|
1679
1680
|
};
|
|
1680
1681
|
}
|
|
1681
|
-
throw new Error(`unsupported resource type: ${
|
|
1682
|
+
throw new Error(`unsupported resource type: ${ro(s.resourceType)}`);
|
|
1682
1683
|
}
|
|
1683
|
-
function
|
|
1684
|
+
function jn(s, e) {
|
|
1684
1685
|
const t = s.axesSpec.length, r = {};
|
|
1685
1686
|
for (const { key: o, val: n } of e) {
|
|
1686
1687
|
if (o.length !== t)
|
|
@@ -1693,17 +1694,17 @@ function Nn(s, e) {
|
|
|
1693
1694
|
data: r
|
|
1694
1695
|
};
|
|
1695
1696
|
}
|
|
1696
|
-
function
|
|
1697
|
+
function xn(s, e) {
|
|
1697
1698
|
const t = Ee("sha256");
|
|
1698
|
-
return t.update(
|
|
1699
|
+
return t.update(N(s)), t.update(String(tt(e.originalId) ? e.id : e.originalId)), t.digest().toString("hex");
|
|
1699
1700
|
}
|
|
1700
|
-
function
|
|
1701
|
-
return
|
|
1701
|
+
function Sr(s, e) {
|
|
1702
|
+
return N({ __isRef: !0, blockId: s, name: e });
|
|
1702
1703
|
}
|
|
1703
|
-
function
|
|
1704
|
-
return
|
|
1704
|
+
function Vn(s, e) {
|
|
1705
|
+
return N({ resolvePath: s, name: e });
|
|
1705
1706
|
}
|
|
1706
|
-
function
|
|
1707
|
+
function Ss(s, e = !0, t = !1, r = "") {
|
|
1707
1708
|
var a, c, u;
|
|
1708
1709
|
const o = /^(?<name>.*)\.(?<type>spec|data)$/, n = /* @__PURE__ */ new Map();
|
|
1709
1710
|
for (const l of s.listInputFields()) {
|
|
@@ -1712,13 +1713,13 @@ function ys(s, e = !0, t = !1, r = "") {
|
|
|
1712
1713
|
if (e) throw new Error(`unexpected field name ${l}`);
|
|
1713
1714
|
continue;
|
|
1714
1715
|
}
|
|
1715
|
-
let f =
|
|
1716
|
+
let f = j((a = d.groups) == null ? void 0 : a.name);
|
|
1716
1717
|
if (!f.startsWith(r)) {
|
|
1717
1718
|
if (e) throw new Error(`unexpected field name ${l}`);
|
|
1718
1719
|
continue;
|
|
1719
1720
|
}
|
|
1720
1721
|
f = f.slice(r.length);
|
|
1721
|
-
const h =
|
|
1722
|
+
const h = j((c = d.groups) == null ? void 0 : c.type);
|
|
1722
1723
|
let R = n.get(f);
|
|
1723
1724
|
switch (R === void 0 && (R = {}, n.set(f, R)), h) {
|
|
1724
1725
|
case "spec":
|
|
@@ -1741,10 +1742,10 @@ function ys(s, e = !0, t = !1, r = "") {
|
|
|
1741
1742
|
for (const [, l] of n) l.data === void 0 && (l.hasData = !1);
|
|
1742
1743
|
return { locked: i, results: n };
|
|
1743
1744
|
}
|
|
1744
|
-
function
|
|
1745
|
+
function Un(s, e = !0, t = "", r) {
|
|
1745
1746
|
if (!s.getIsReadyOrError()) throw new Error("resource is not ready");
|
|
1746
|
-
const o =
|
|
1747
|
-
|
|
1747
|
+
const o = Ss(s, e, !1, t);
|
|
1748
|
+
go(o.locked);
|
|
1748
1749
|
const n = {};
|
|
1749
1750
|
for (const [i, a] of o.results) {
|
|
1750
1751
|
if (a.spec === void 0) throw new Error(`no spec for key ${i}`);
|
|
@@ -1754,14 +1755,14 @@ function xn(s, e = !0, t = "", r) {
|
|
|
1754
1755
|
if (c === void 0) throw new Error(`no data for key ${i}`);
|
|
1755
1756
|
if (!c.ok) throw c.error;
|
|
1756
1757
|
n[i] = {
|
|
1757
|
-
id: r.length === 0 ?
|
|
1758
|
+
id: r.length === 0 ? xn(a.spec, c.value) : Vn(r, i),
|
|
1758
1759
|
spec: a.spec,
|
|
1759
1760
|
data: c.value
|
|
1760
1761
|
};
|
|
1761
1762
|
}
|
|
1762
1763
|
return n;
|
|
1763
1764
|
}
|
|
1764
|
-
class
|
|
1765
|
+
class Ut {
|
|
1765
1766
|
constructor(e, t) {
|
|
1766
1767
|
w(this, "allSpecsAvailable");
|
|
1767
1768
|
this.ctx = e, this.blocks = t;
|
|
@@ -1795,8 +1796,8 @@ class Vt {
|
|
|
1795
1796
|
if (r === void 0) return;
|
|
1796
1797
|
const 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);
|
|
1797
1798
|
if (o !== void 0 && o.spec !== void 0 && n !== void 0)
|
|
1798
|
-
return
|
|
1799
|
-
id:
|
|
1799
|
+
return qr(n, (u) => ({
|
|
1800
|
+
id: Sr(e, t),
|
|
1800
1801
|
spec: o.spec,
|
|
1801
1802
|
data: u
|
|
1802
1803
|
}));
|
|
@@ -1835,7 +1836,7 @@ class Vt {
|
|
|
1835
1836
|
u !== void 0 ? e.push({
|
|
1836
1837
|
ref: _e(i, a),
|
|
1837
1838
|
obj: {
|
|
1838
|
-
id: u.ok ?
|
|
1839
|
+
id: u.ok ? Sr(i, a) : void 0,
|
|
1839
1840
|
spec: c.spec,
|
|
1840
1841
|
data: u
|
|
1841
1842
|
}
|
|
@@ -1889,7 +1890,7 @@ class Vt {
|
|
|
1889
1890
|
for (const r of this.blocks.values()) {
|
|
1890
1891
|
const o = /* @__PURE__ */ new Set(), n = (i) => {
|
|
1891
1892
|
for (const [a, c] of i.results)
|
|
1892
|
-
o.has(a) || c.spec === void 0 || (o.add(a),
|
|
1893
|
+
o.has(a) || c.spec === void 0 || (o.add(a), Gs(e, c.spec) && t.push({
|
|
1893
1894
|
label: r.info.label + " / " + a,
|
|
1894
1895
|
ref: _e(r.info.id, a),
|
|
1895
1896
|
spec: c.spec
|
|
@@ -1900,10 +1901,10 @@ class Vt {
|
|
|
1900
1901
|
return t;
|
|
1901
1902
|
}
|
|
1902
1903
|
static create(e, t, r) {
|
|
1903
|
-
const o = e.accessor(t).node(), n =
|
|
1904
|
+
const o = e.accessor(t).node(), n = j(o.getKeyValueAsJson(he)), a = Ft(n).traverseIds("upstream", r), c = /* @__PURE__ */ new Map();
|
|
1904
1905
|
for (const u of ne(n)) {
|
|
1905
1906
|
if (!a.has(u.id)) continue;
|
|
1906
|
-
const l =
|
|
1907
|
+
const l = br(
|
|
1907
1908
|
o.traverse({
|
|
1908
1909
|
field: G(u.id, "prodCtx"),
|
|
1909
1910
|
ignoreError: !0,
|
|
@@ -1914,7 +1915,7 @@ class Vt {
|
|
|
1914
1915
|
field: G(u.id, "prodUiCtx"),
|
|
1915
1916
|
stableIfNotFound: !0
|
|
1916
1917
|
})
|
|
1917
|
-
), d =
|
|
1918
|
+
), d = br(
|
|
1918
1919
|
o.traverse({
|
|
1919
1920
|
field: G(u.id, "stagingCtx"),
|
|
1920
1921
|
ignoreError: !0,
|
|
@@ -1926,18 +1927,18 @@ class Vt {
|
|
|
1926
1927
|
);
|
|
1927
1928
|
c.set(u.id, { info: u, prod: l, staging: d });
|
|
1928
1929
|
}
|
|
1929
|
-
return new
|
|
1930
|
+
return new Ut(e, c);
|
|
1930
1931
|
}
|
|
1931
1932
|
}
|
|
1932
|
-
function
|
|
1933
|
+
function br(s, e) {
|
|
1933
1934
|
if (e === void 0)
|
|
1934
1935
|
return s ? { locked: !1, results: /* @__PURE__ */ new Map() } : void 0;
|
|
1935
|
-
if (e.ok) return
|
|
1936
|
+
if (e.ok) return Ss(e.value, !1, !0);
|
|
1936
1937
|
}
|
|
1937
|
-
function
|
|
1938
|
+
function Gt(s, e) {
|
|
1938
1939
|
return {
|
|
1939
1940
|
blockId: e,
|
|
1940
|
-
args: (n) =>
|
|
1941
|
+
args: (n) => j(
|
|
1941
1942
|
n.accessor(s).node().traverse({
|
|
1942
1943
|
field: G(e, "currentArgs"),
|
|
1943
1944
|
errorIfFieldNotSet: !0
|
|
@@ -1950,17 +1951,17 @@ function Ut(s, e) {
|
|
|
1950
1951
|
stableIfNotFound: !0
|
|
1951
1952
|
})) == null ? void 0 : i.getDataAsString();
|
|
1952
1953
|
},
|
|
1953
|
-
uiState: (n) => n.accessor(s).node().getKeyValueAsString(
|
|
1954
|
+
uiState: (n) => n.accessor(s).node().getKeyValueAsString(kt(e)),
|
|
1954
1955
|
blockMeta: (n) => {
|
|
1955
|
-
const i = n.accessor(s).node(), a =
|
|
1956
|
+
const i = n.accessor(s).node(), a = j(i.getKeyValueAsJson(he)), c = /* @__PURE__ */ new Map();
|
|
1956
1957
|
for (const u of ne(a)) c.set(u.id, u);
|
|
1957
1958
|
return c;
|
|
1958
1959
|
}
|
|
1959
1960
|
};
|
|
1960
1961
|
}
|
|
1961
|
-
function
|
|
1962
|
+
function bs(s, e) {
|
|
1962
1963
|
return {
|
|
1963
|
-
...
|
|
1964
|
+
...Gt(s, e),
|
|
1964
1965
|
prod: (t) => {
|
|
1965
1966
|
var r;
|
|
1966
1967
|
return (r = t.accessor(s).node({ ignoreError: !0 }).traverse({
|
|
@@ -1977,7 +1978,7 @@ function ws(s, e) {
|
|
|
1977
1978
|
})) == null ? void 0 : o.persist();
|
|
1978
1979
|
return r === void 0 && t.markUnstable("staging_not_rendered"), r;
|
|
1979
1980
|
},
|
|
1980
|
-
getResultsPool: (t) =>
|
|
1981
|
+
getResultsPool: (t) => Ut.create(t, s, e)
|
|
1981
1982
|
};
|
|
1982
1983
|
}
|
|
1983
1984
|
function* X(s, e) {
|
|
@@ -2032,7 +2033,7 @@ function* X(s, e) {
|
|
|
2032
2033
|
H(s);
|
|
2033
2034
|
}
|
|
2034
2035
|
}
|
|
2035
|
-
function
|
|
2036
|
+
function Gn(s, e) {
|
|
2036
2037
|
const t = {};
|
|
2037
2038
|
for (const [r, o] of Object.entries(s)) t[r] = e(o);
|
|
2038
2039
|
return t;
|
|
@@ -2040,7 +2041,7 @@ function Vn(s, e) {
|
|
|
2040
2041
|
function Te(s, e) {
|
|
2041
2042
|
return s === void 0 ? void 0 : e(s);
|
|
2042
2043
|
}
|
|
2043
|
-
function
|
|
2044
|
+
function Jn(s) {
|
|
2044
2045
|
switch (s.type) {
|
|
2045
2046
|
case "GetImportProgress":
|
|
2046
2047
|
return !0;
|
|
@@ -2048,60 +2049,60 @@ function Un(s) {
|
|
|
2048
2049
|
return !1;
|
|
2049
2050
|
}
|
|
2050
2051
|
}
|
|
2051
|
-
function
|
|
2052
|
-
for (const e of X(s)) if (
|
|
2052
|
+
function Mn(s) {
|
|
2053
|
+
for (const e of X(s)) if (Jn(e)) return !0;
|
|
2053
2054
|
return !1;
|
|
2054
2055
|
}
|
|
2055
|
-
function
|
|
2056
|
+
function nt(s) {
|
|
2056
2057
|
return {
|
|
2057
2058
|
type: "ReturnResult",
|
|
2058
2059
|
result: s
|
|
2059
2060
|
};
|
|
2060
2061
|
}
|
|
2061
2062
|
function k(s) {
|
|
2062
|
-
return () =>
|
|
2063
|
+
return () => nt(s);
|
|
2063
2064
|
}
|
|
2064
|
-
const
|
|
2065
|
+
const _n = (s) => {
|
|
2065
2066
|
const e = {};
|
|
2066
2067
|
for (const [t, r] of Object.entries(s)) e[t] = r;
|
|
2067
2068
|
return k(e);
|
|
2068
|
-
},
|
|
2069
|
+
}, Kn = (s) => {
|
|
2069
2070
|
const e = s.source;
|
|
2070
2071
|
if (e === void 0) return k(void 0);
|
|
2071
2072
|
const t = [];
|
|
2072
2073
|
for (const r of e)
|
|
2073
2074
|
r instanceof Array ? t.push(...r) : t.push(r);
|
|
2074
2075
|
return k(t);
|
|
2075
|
-
},
|
|
2076
|
+
}, Hn = (s) => {
|
|
2076
2077
|
const e = s.source, t = s.field;
|
|
2077
2078
|
return e === void 0 || t === void 0 ? k(void 0) : ({ cCtx: r }) => {
|
|
2078
2079
|
var o;
|
|
2079
|
-
return
|
|
2080
|
+
return nt((o = r.accessor(e).node().traverse(t)) == null ? void 0 : o.persist());
|
|
2080
2081
|
};
|
|
2081
2082
|
};
|
|
2082
|
-
function
|
|
2083
|
+
function Rs(s, e) {
|
|
2083
2084
|
const t = {}, r = s.length;
|
|
2084
2085
|
for (let o = 0; o < r; o++) t[String(o)] = e(s[o]);
|
|
2085
2086
|
return t;
|
|
2086
2087
|
}
|
|
2087
|
-
function
|
|
2088
|
+
function Wn(s, e) {
|
|
2088
2089
|
return (t) => {
|
|
2089
2090
|
const r = t.source;
|
|
2090
2091
|
return r === void 0 ? k(void 0) : () => ({
|
|
2091
2092
|
type: "ScheduleSubroutine",
|
|
2092
|
-
subroutine:
|
|
2093
|
-
args:
|
|
2093
|
+
subroutine: Es(r.length),
|
|
2094
|
+
args: Rs(r, (o) => P({ ...s, [e.itVar]: o }, e.mapping))
|
|
2094
2095
|
});
|
|
2095
2096
|
};
|
|
2096
2097
|
}
|
|
2097
|
-
function
|
|
2098
|
+
function Es(s) {
|
|
2098
2099
|
return (e) => {
|
|
2099
2100
|
const t = [];
|
|
2100
2101
|
for (let r = 0; r < s; r++) t.push(e[String(r)]);
|
|
2101
2102
|
return k(t);
|
|
2102
2103
|
};
|
|
2103
2104
|
}
|
|
2104
|
-
function
|
|
2105
|
+
function qn(s, e) {
|
|
2105
2106
|
return (t) => {
|
|
2106
2107
|
const r = t.source;
|
|
2107
2108
|
if (r === void 0) return k(void 0);
|
|
@@ -2112,34 +2113,34 @@ function Hn(s, e) {
|
|
|
2112
2113
|
}
|
|
2113
2114
|
return () => ({
|
|
2114
2115
|
type: "ScheduleSubroutine",
|
|
2115
|
-
subroutine:
|
|
2116
|
+
subroutine: zn,
|
|
2116
2117
|
args: o
|
|
2117
2118
|
});
|
|
2118
2119
|
};
|
|
2119
2120
|
}
|
|
2120
|
-
const
|
|
2121
|
+
const zn = (s) => k(s), Xn = (s) => {
|
|
2121
2122
|
const e = s.arg;
|
|
2122
2123
|
return k(e === void 0 ? void 0 : e.length === 0);
|
|
2123
|
-
},
|
|
2124
|
+
}, Yn = (s) => {
|
|
2124
2125
|
const e = s.operand;
|
|
2125
2126
|
return k(e === void 0 ? void 0 : !e);
|
|
2126
|
-
},
|
|
2127
|
+
}, Qn = (s) => {
|
|
2127
2128
|
const e = s.operand1, t = s.operand2;
|
|
2128
2129
|
return k(e === void 0 || t === void 0 ? void 0 : e && t);
|
|
2129
|
-
},
|
|
2130
|
+
}, Zn = (s) => {
|
|
2130
2131
|
const e = s.operand1, t = s.operand2;
|
|
2131
2132
|
return k(e === void 0 || t === void 0 ? void 0 : e || t);
|
|
2132
|
-
},
|
|
2133
|
+
}, ei = (s) => {
|
|
2133
2134
|
const e = s.source;
|
|
2134
2135
|
return e === void 0 ? k(void 0) : ({ cCtx: t }) => {
|
|
2135
2136
|
var r;
|
|
2136
|
-
return
|
|
2137
|
+
return nt((r = t.accessor(e).node()) == null ? void 0 : r.getDataAsJson());
|
|
2137
2138
|
};
|
|
2138
|
-
},
|
|
2139
|
+
}, ti = (s) => {
|
|
2139
2140
|
const e = s.source, t = s.field;
|
|
2140
2141
|
return k(e === void 0 || t === void 0 ? void 0 : e[t]);
|
|
2141
2142
|
};
|
|
2142
|
-
function
|
|
2143
|
+
function ri(s, e) {
|
|
2143
2144
|
return (t) => {
|
|
2144
2145
|
const r = t.source;
|
|
2145
2146
|
return r === void 0 ? k(void 0) : ({ cCtx: o }) => {
|
|
@@ -2154,13 +2155,13 @@ function ei(s, e) {
|
|
|
2154
2155
|
}
|
|
2155
2156
|
return {
|
|
2156
2157
|
type: "ScheduleSubroutine",
|
|
2157
|
-
subroutine:
|
|
2158
|
+
subroutine: si,
|
|
2158
2159
|
args: i
|
|
2159
2160
|
};
|
|
2160
2161
|
};
|
|
2161
2162
|
};
|
|
2162
2163
|
}
|
|
2163
|
-
const
|
|
2164
|
+
const si = (s) => k(s), oi = (s) => {
|
|
2164
2165
|
const e = s.source;
|
|
2165
2166
|
return e === void 0 ? k(void 0) : ({ drivers: t }) => ({
|
|
2166
2167
|
type: "ScheduleComputable",
|
|
@@ -2174,7 +2175,7 @@ const ti = (s) => k(s), ri = (s) => {
|
|
|
2174
2175
|
}
|
|
2175
2176
|
)
|
|
2176
2177
|
});
|
|
2177
|
-
},
|
|
2178
|
+
}, ni = (s) => {
|
|
2178
2179
|
const e = s.source;
|
|
2179
2180
|
return e === void 0 ? k(void 0) : ({ cCtx: t, drivers: r }) => {
|
|
2180
2181
|
const o = t.accessor(e).node().resourceInfo;
|
|
@@ -2185,7 +2186,7 @@ const ti = (s) => k(s), ri = (s) => {
|
|
|
2185
2186
|
})
|
|
2186
2187
|
};
|
|
2187
2188
|
};
|
|
2188
|
-
},
|
|
2189
|
+
}, ii = (s) => {
|
|
2189
2190
|
const e = s.source;
|
|
2190
2191
|
return e === void 0 ? k(void 0) : ({ drivers: t }) => ({
|
|
2191
2192
|
type: "ScheduleComputable",
|
|
@@ -2201,49 +2202,49 @@ const ti = (s) => k(s), ri = (s) => {
|
|
|
2201
2202
|
}
|
|
2202
2203
|
)
|
|
2203
2204
|
});
|
|
2204
|
-
},
|
|
2205
|
+
}, ai = (s) => {
|
|
2205
2206
|
const e = s.source;
|
|
2206
2207
|
return e === void 0 ? k(void 0) : ({ drivers: t }) => ({
|
|
2207
2208
|
type: "ScheduleComputable",
|
|
2208
2209
|
computable: t.blobDriver.getDownloadedBlob(e)
|
|
2209
2210
|
});
|
|
2210
|
-
},
|
|
2211
|
+
}, ci = (s) => {
|
|
2211
2212
|
const e = s.source;
|
|
2212
2213
|
return e === void 0 ? k(void 0) : ({ drivers: t }) => ({
|
|
2213
2214
|
type: "ScheduleComputable",
|
|
2214
2215
|
computable: t.blobDriver.getOnDemandBlob(e)
|
|
2215
2216
|
});
|
|
2216
|
-
},
|
|
2217
|
+
}, li = (s) => (e) => {
|
|
2217
2218
|
const t = e.source;
|
|
2218
2219
|
return t === void 0 ? k(void 0) : ({ drivers: r }) => ({
|
|
2219
2220
|
type: "ScheduleComputable",
|
|
2220
2221
|
computable: r.blobToURLDriver.extractArchiveAndGetURL(t, s)
|
|
2221
2222
|
});
|
|
2222
|
-
},
|
|
2223
|
+
}, ui = (s) => {
|
|
2223
2224
|
const e = s.source;
|
|
2224
2225
|
return e === void 0 ? k(void 0) : ({ drivers: t }) => ({
|
|
2225
2226
|
type: "ScheduleComputable",
|
|
2226
2227
|
computable: t.uploadDriver.getProgressId(e)
|
|
2227
2228
|
});
|
|
2228
|
-
},
|
|
2229
|
+
}, di = (s) => (e) => {
|
|
2229
2230
|
const t = e.source;
|
|
2230
2231
|
return t === void 0 ? k(void 0) : ({ drivers: r }) => ({
|
|
2231
2232
|
type: "ScheduleComputable",
|
|
2232
2233
|
computable: r.logDriver.getLastLogs(t, s)
|
|
2233
2234
|
});
|
|
2234
|
-
},
|
|
2235
|
+
}, pi = (s) => (e) => {
|
|
2235
2236
|
const t = e.source;
|
|
2236
2237
|
return t === void 0 ? k(void 0) : ({ drivers: r }) => ({
|
|
2237
2238
|
type: "ScheduleComputable",
|
|
2238
2239
|
computable: r.logDriver.getProgressLog(t, s)
|
|
2239
2240
|
});
|
|
2240
|
-
},
|
|
2241
|
+
}, fi = (s) => (e) => {
|
|
2241
2242
|
const t = e.source;
|
|
2242
2243
|
return t === void 0 ? k(void 0) : ({ drivers: r }) => ({
|
|
2243
2244
|
type: "ScheduleComputable",
|
|
2244
2245
|
computable: r.logDriver.getProgressLogWithInfo(t, s)
|
|
2245
2246
|
});
|
|
2246
|
-
},
|
|
2247
|
+
}, hi = (s) => {
|
|
2247
2248
|
const e = s.source;
|
|
2248
2249
|
return e === void 0 ? k(void 0) : ({ drivers: t }) => ({
|
|
2249
2250
|
type: "ScheduleComputable",
|
|
@@ -2254,19 +2255,19 @@ function P(s, e) {
|
|
|
2254
2255
|
switch (e.type) {
|
|
2255
2256
|
case "GetFromCtx": {
|
|
2256
2257
|
const t = s[e.variable];
|
|
2257
|
-
return typeof t == "function" ? (r) =>
|
|
2258
|
+
return typeof t == "function" ? (r) => nt(t(r.cCtx)) : k(t);
|
|
2258
2259
|
}
|
|
2259
2260
|
case "Isolate":
|
|
2260
2261
|
return ({ drivers: t }) => ({
|
|
2261
2262
|
type: "ScheduleComputable",
|
|
2262
|
-
computable:
|
|
2263
|
+
computable: Ps(t, s, e.cfg)
|
|
2263
2264
|
});
|
|
2264
2265
|
case "Immediate":
|
|
2265
2266
|
return k(e.value);
|
|
2266
2267
|
case "GetJsonField":
|
|
2267
2268
|
return () => ({
|
|
2268
2269
|
type: "ScheduleSubroutine",
|
|
2269
|
-
subroutine:
|
|
2270
|
+
subroutine: ti,
|
|
2270
2271
|
args: {
|
|
2271
2272
|
source: P(s, e.source),
|
|
2272
2273
|
field: P(s, e.field)
|
|
@@ -2275,7 +2276,7 @@ function P(s, e) {
|
|
|
2275
2276
|
case "MapArrayValues":
|
|
2276
2277
|
return () => ({
|
|
2277
2278
|
type: "ScheduleSubroutine",
|
|
2278
|
-
subroutine:
|
|
2279
|
+
subroutine: Wn(s, e),
|
|
2279
2280
|
args: {
|
|
2280
2281
|
source: P(s, e.source)
|
|
2281
2282
|
}
|
|
@@ -2283,7 +2284,7 @@ function P(s, e) {
|
|
|
2283
2284
|
case "MapRecordValues":
|
|
2284
2285
|
return () => ({
|
|
2285
2286
|
type: "ScheduleSubroutine",
|
|
2286
|
-
subroutine:
|
|
2287
|
+
subroutine: qn(s, e),
|
|
2287
2288
|
args: {
|
|
2288
2289
|
source: P(s, e.source)
|
|
2289
2290
|
}
|
|
@@ -2291,19 +2292,19 @@ function P(s, e) {
|
|
|
2291
2292
|
case "MakeObject":
|
|
2292
2293
|
return () => ({
|
|
2293
2294
|
type: "ScheduleSubroutine",
|
|
2294
|
-
subroutine:
|
|
2295
|
-
args:
|
|
2295
|
+
subroutine: _n,
|
|
2296
|
+
args: Gn(e.template, (t) => P(s, t))
|
|
2296
2297
|
});
|
|
2297
2298
|
case "MakeArray":
|
|
2298
2299
|
return () => ({
|
|
2299
2300
|
type: "ScheduleSubroutine",
|
|
2300
|
-
subroutine:
|
|
2301
|
-
args:
|
|
2301
|
+
subroutine: Es(e.template.length),
|
|
2302
|
+
args: Rs(e.template, (t) => P(s, t))
|
|
2302
2303
|
});
|
|
2303
2304
|
case "Flatten":
|
|
2304
2305
|
return () => ({
|
|
2305
2306
|
type: "ScheduleSubroutine",
|
|
2306
|
-
subroutine:
|
|
2307
|
+
subroutine: Kn,
|
|
2307
2308
|
args: {
|
|
2308
2309
|
source: P(s, e.source)
|
|
2309
2310
|
}
|
|
@@ -2311,7 +2312,7 @@ function P(s, e) {
|
|
|
2311
2312
|
case "IsEmpty":
|
|
2312
2313
|
return () => ({
|
|
2313
2314
|
type: "ScheduleSubroutine",
|
|
2314
|
-
subroutine:
|
|
2315
|
+
subroutine: Xn,
|
|
2315
2316
|
args: {
|
|
2316
2317
|
arg: P(s, e.arg)
|
|
2317
2318
|
}
|
|
@@ -2319,7 +2320,7 @@ function P(s, e) {
|
|
|
2319
2320
|
case "Not":
|
|
2320
2321
|
return () => ({
|
|
2321
2322
|
type: "ScheduleSubroutine",
|
|
2322
|
-
subroutine:
|
|
2323
|
+
subroutine: Yn,
|
|
2323
2324
|
args: {
|
|
2324
2325
|
operand: P(s, e.operand)
|
|
2325
2326
|
}
|
|
@@ -2327,7 +2328,7 @@ function P(s, e) {
|
|
|
2327
2328
|
case "And":
|
|
2328
2329
|
return () => ({
|
|
2329
2330
|
type: "ScheduleSubroutine",
|
|
2330
|
-
subroutine:
|
|
2331
|
+
subroutine: Qn,
|
|
2331
2332
|
args: {
|
|
2332
2333
|
operand1: P(s, e.operand1),
|
|
2333
2334
|
operand2: P(s, e.operand2)
|
|
@@ -2336,7 +2337,7 @@ function P(s, e) {
|
|
|
2336
2337
|
case "Or":
|
|
2337
2338
|
return () => ({
|
|
2338
2339
|
type: "ScheduleSubroutine",
|
|
2339
|
-
subroutine:
|
|
2340
|
+
subroutine: Zn,
|
|
2340
2341
|
args: {
|
|
2341
2342
|
operand1: P(s, e.operand1),
|
|
2342
2343
|
operand2: P(s, e.operand2)
|
|
@@ -2345,7 +2346,7 @@ function P(s, e) {
|
|
|
2345
2346
|
case "MapResourceFields":
|
|
2346
2347
|
return () => ({
|
|
2347
2348
|
type: "ScheduleSubroutine",
|
|
2348
|
-
subroutine:
|
|
2349
|
+
subroutine: ri(s, e),
|
|
2349
2350
|
args: {
|
|
2350
2351
|
source: P(s, e.source)
|
|
2351
2352
|
}
|
|
@@ -2353,7 +2354,7 @@ function P(s, e) {
|
|
|
2353
2354
|
case "GetResourceField":
|
|
2354
2355
|
return () => ({
|
|
2355
2356
|
type: "ScheduleSubroutine",
|
|
2356
|
-
subroutine:
|
|
2357
|
+
subroutine: Hn,
|
|
2357
2358
|
args: {
|
|
2358
2359
|
source: P(s, e.source),
|
|
2359
2360
|
field: P(s, e.field)
|
|
@@ -2362,7 +2363,7 @@ function P(s, e) {
|
|
|
2362
2363
|
case "GetResourceValueAsJson":
|
|
2363
2364
|
return () => ({
|
|
2364
2365
|
type: "ScheduleSubroutine",
|
|
2365
|
-
subroutine:
|
|
2366
|
+
subroutine: ei,
|
|
2366
2367
|
args: {
|
|
2367
2368
|
source: P(s, e.source)
|
|
2368
2369
|
}
|
|
@@ -2370,7 +2371,7 @@ function P(s, e) {
|
|
|
2370
2371
|
case "GetBlobContent":
|
|
2371
2372
|
return () => ({
|
|
2372
2373
|
type: "ScheduleSubroutine",
|
|
2373
|
-
subroutine:
|
|
2374
|
+
subroutine: oi,
|
|
2374
2375
|
args: {
|
|
2375
2376
|
source: P(s, e.source)
|
|
2376
2377
|
}
|
|
@@ -2378,7 +2379,7 @@ function P(s, e) {
|
|
|
2378
2379
|
case "GetBlobContentAsString":
|
|
2379
2380
|
return () => ({
|
|
2380
2381
|
type: "ScheduleSubroutine",
|
|
2381
|
-
subroutine:
|
|
2382
|
+
subroutine: ni,
|
|
2382
2383
|
args: {
|
|
2383
2384
|
source: P(s, e.source)
|
|
2384
2385
|
}
|
|
@@ -2386,7 +2387,7 @@ function P(s, e) {
|
|
|
2386
2387
|
case "GetBlobContentAsJson":
|
|
2387
2388
|
return () => ({
|
|
2388
2389
|
type: "ScheduleSubroutine",
|
|
2389
|
-
subroutine:
|
|
2390
|
+
subroutine: ii,
|
|
2390
2391
|
args: {
|
|
2391
2392
|
source: P(s, e.source)
|
|
2392
2393
|
}
|
|
@@ -2394,7 +2395,7 @@ function P(s, e) {
|
|
|
2394
2395
|
case "GetDownloadedBlobContent":
|
|
2395
2396
|
return () => ({
|
|
2396
2397
|
type: "ScheduleSubroutine",
|
|
2397
|
-
subroutine:
|
|
2398
|
+
subroutine: ai,
|
|
2398
2399
|
args: {
|
|
2399
2400
|
source: P(s, e.source)
|
|
2400
2401
|
}
|
|
@@ -2402,7 +2403,7 @@ function P(s, e) {
|
|
|
2402
2403
|
case "GetOnDemandBlobContent":
|
|
2403
2404
|
return () => ({
|
|
2404
2405
|
type: "ScheduleSubroutine",
|
|
2405
|
-
subroutine:
|
|
2406
|
+
subroutine: ci,
|
|
2406
2407
|
args: {
|
|
2407
2408
|
source: P(s, e.source)
|
|
2408
2409
|
}
|
|
@@ -2410,7 +2411,7 @@ function P(s, e) {
|
|
|
2410
2411
|
case "ExtractArchiveAndGetURL":
|
|
2411
2412
|
return () => ({
|
|
2412
2413
|
type: "ScheduleSubroutine",
|
|
2413
|
-
subroutine:
|
|
2414
|
+
subroutine: li(e.format),
|
|
2414
2415
|
args: {
|
|
2415
2416
|
source: P(s, e.source)
|
|
2416
2417
|
}
|
|
@@ -2418,7 +2419,7 @@ function P(s, e) {
|
|
|
2418
2419
|
case "GetImportProgress":
|
|
2419
2420
|
return () => ({
|
|
2420
2421
|
type: "ScheduleSubroutine",
|
|
2421
|
-
subroutine:
|
|
2422
|
+
subroutine: ui,
|
|
2422
2423
|
args: {
|
|
2423
2424
|
source: P(s, e.source)
|
|
2424
2425
|
}
|
|
@@ -2426,7 +2427,7 @@ function P(s, e) {
|
|
|
2426
2427
|
case "GetLastLogs":
|
|
2427
2428
|
return () => ({
|
|
2428
2429
|
type: "ScheduleSubroutine",
|
|
2429
|
-
subroutine:
|
|
2430
|
+
subroutine: di(e.lines),
|
|
2430
2431
|
args: {
|
|
2431
2432
|
source: P(s, e.source)
|
|
2432
2433
|
}
|
|
@@ -2434,7 +2435,7 @@ function P(s, e) {
|
|
|
2434
2435
|
case "GetProgressLog":
|
|
2435
2436
|
return () => ({
|
|
2436
2437
|
type: "ScheduleSubroutine",
|
|
2437
|
-
subroutine:
|
|
2438
|
+
subroutine: pi(e.patternToSearch),
|
|
2438
2439
|
args: {
|
|
2439
2440
|
source: P(s, e.source)
|
|
2440
2441
|
}
|
|
@@ -2442,7 +2443,7 @@ function P(s, e) {
|
|
|
2442
2443
|
case "GetProgressLogWithInfo":
|
|
2443
2444
|
return () => ({
|
|
2444
2445
|
type: "ScheduleSubroutine",
|
|
2445
|
-
subroutine:
|
|
2446
|
+
subroutine: fi(e.patternToSearch),
|
|
2446
2447
|
args: {
|
|
2447
2448
|
source: P(s, e.source)
|
|
2448
2449
|
}
|
|
@@ -2450,7 +2451,7 @@ function P(s, e) {
|
|
|
2450
2451
|
case "GetLogHandle":
|
|
2451
2452
|
return () => ({
|
|
2452
2453
|
type: "ScheduleSubroutine",
|
|
2453
|
-
subroutine:
|
|
2454
|
+
subroutine: hi,
|
|
2454
2455
|
args: {
|
|
2455
2456
|
source: P(s, e.source)
|
|
2456
2457
|
}
|
|
@@ -2459,8 +2460,8 @@ function P(s, e) {
|
|
|
2459
2460
|
return H(e);
|
|
2460
2461
|
}
|
|
2461
2462
|
}
|
|
2462
|
-
const
|
|
2463
|
-
function
|
|
2463
|
+
const gi = ["$prod", "$staging"];
|
|
2464
|
+
function mi(s) {
|
|
2464
2465
|
return {
|
|
2465
2466
|
$blockId: s.blockId,
|
|
2466
2467
|
$args: (e) => JSON.parse(s.args(e)),
|
|
@@ -2472,18 +2473,18 @@ function hi(s) {
|
|
|
2472
2473
|
$staging: s.staging
|
|
2473
2474
|
};
|
|
2474
2475
|
}
|
|
2475
|
-
const
|
|
2476
|
-
function
|
|
2477
|
-
return s.op ==
|
|
2476
|
+
const Cs = Symbol(), ks = "return", vi = { op: Cs, arg: ks };
|
|
2477
|
+
function yi(s) {
|
|
2478
|
+
return s.op == Cs && s.arg == ks;
|
|
2478
2479
|
}
|
|
2479
|
-
function
|
|
2480
|
+
function wi() {
|
|
2480
2481
|
return { pendingSubroutines: /* @__PURE__ */ new Map() };
|
|
2481
2482
|
}
|
|
2482
|
-
function
|
|
2483
|
-
const o = new
|
|
2484
|
-
if (
|
|
2483
|
+
function Rr(s, e, t, r) {
|
|
2484
|
+
const o = new rs(t), n = (a, c) => {
|
|
2485
|
+
if (yi(a))
|
|
2485
2486
|
return e.result = c, !1;
|
|
2486
|
-
const u =
|
|
2487
|
+
const u = j(e.pendingSubroutines.get(a.op));
|
|
2487
2488
|
if (a.arg in u.args) throw new Error("argument already set");
|
|
2488
2489
|
return u.args[a.arg] = c, u.argCounter--, u.argCounter === 0 && (e.pendingSubroutines.delete(a.op), o.push({
|
|
2489
2490
|
destination: u.destination,
|
|
@@ -2533,26 +2534,26 @@ function Sr(s, e, t, r) {
|
|
|
2533
2534
|
}
|
|
2534
2535
|
return i;
|
|
2535
2536
|
}
|
|
2536
|
-
function
|
|
2537
|
-
return
|
|
2537
|
+
function Si(s, e, t, r = {}) {
|
|
2538
|
+
return Ps(s, mi(e), t, r);
|
|
2538
2539
|
}
|
|
2539
|
-
function
|
|
2540
|
-
const o = `${e.blockId}#` +
|
|
2540
|
+
function Ps(s, e, t, r = {}) {
|
|
2541
|
+
const o = `${e.blockId}#` + N({
|
|
2541
2542
|
ctx: Object.fromEntries(
|
|
2542
|
-
Object.entries(e).filter(([n]) =>
|
|
2543
|
+
Object.entries(e).filter(([n]) => gi.indexOf(n) === -1)
|
|
2543
2544
|
),
|
|
2544
2545
|
cfg: t
|
|
2545
2546
|
});
|
|
2546
2547
|
return J.makeRaw(
|
|
2547
2548
|
(n) => {
|
|
2548
|
-
const i = { drivers: s, cCtx: n }, a =
|
|
2549
|
+
const i = { drivers: s, cCtx: n }, a = wi();
|
|
2549
2550
|
return {
|
|
2550
|
-
ir:
|
|
2551
|
+
ir: Rr(
|
|
2551
2552
|
i,
|
|
2552
2553
|
a,
|
|
2553
2554
|
[
|
|
2554
2555
|
{
|
|
2555
|
-
destination:
|
|
2556
|
+
destination: vi,
|
|
2556
2557
|
operation: P(e, t)
|
|
2557
2558
|
}
|
|
2558
2559
|
],
|
|
@@ -2574,7 +2575,7 @@ function Cs(s, e, t, r = {}) {
|
|
|
2574
2575
|
result: a.result,
|
|
2575
2576
|
pendingSubroutines: f
|
|
2576
2577
|
};
|
|
2577
|
-
if (
|
|
2578
|
+
if (Rr(d, h, l, !1), !("result" in h))
|
|
2578
2579
|
throw new Error("illegal cfg rendering stack state, no result");
|
|
2579
2580
|
return h.result;
|
|
2580
2581
|
}
|
|
@@ -2583,13 +2584,13 @@ function Cs(s, e, t, r = {}) {
|
|
|
2583
2584
|
{ ...r, key: o }
|
|
2584
2585
|
);
|
|
2585
2586
|
}
|
|
2586
|
-
function
|
|
2587
|
+
function bi(s) {
|
|
2587
2588
|
return s instanceof ArrayBuffer || ArrayBuffer.isView(s);
|
|
2588
2589
|
}
|
|
2589
|
-
function
|
|
2590
|
+
function Er(s) {
|
|
2590
2591
|
return s !== void 0 ? Buffer.from(s).toString("base64") : void 0;
|
|
2591
2592
|
}
|
|
2592
|
-
class
|
|
2593
|
+
class ot {
|
|
2593
2594
|
constructor(e, t, r, o, n, i) {
|
|
2594
2595
|
w(this, "callbackRegistry");
|
|
2595
2596
|
w(this, "fnJSONStringify");
|
|
@@ -2598,7 +2599,7 @@ class st {
|
|
|
2598
2599
|
w(this, "computableCtx");
|
|
2599
2600
|
w(this, "accessors", /* @__PURE__ */ new Map());
|
|
2600
2601
|
w(this, "meta");
|
|
2601
|
-
w(this, "errorRepo", new
|
|
2602
|
+
w(this, "errorRepo", new Ri());
|
|
2602
2603
|
//
|
|
2603
2604
|
// Result Pool
|
|
2604
2605
|
//
|
|
@@ -2622,14 +2623,14 @@ class st {
|
|
|
2622
2623
|
try {
|
|
2623
2624
|
this.deadlineSetter({ currentExecutionTarget: "evaluateBundle", deadline: Date.now() + 1e4 }), this.vm.unwrapResult(this.vm.evalCode(e, "bundle.js", { type: "global" })).dispose();
|
|
2624
2625
|
} catch (t) {
|
|
2625
|
-
throw
|
|
2626
|
+
throw ot.cleanErrorContext(t), t;
|
|
2626
2627
|
} finally {
|
|
2627
2628
|
this.deadlineSetter(void 0);
|
|
2628
2629
|
}
|
|
2629
2630
|
}
|
|
2630
2631
|
runCallback(e, ...t) {
|
|
2631
2632
|
try {
|
|
2632
|
-
return this.deadlineSetter({ currentExecutionTarget: e, deadline: Date.now() + 1e4 }),
|
|
2633
|
+
return this.deadlineSetter({ currentExecutionTarget: e, deadline: Date.now() + 1e4 }), Ct.withScope((r) => {
|
|
2633
2634
|
const o = r.manage(this.vm.getProp(this.callbackRegistry, e));
|
|
2634
2635
|
if (this.vm.typeof(o) !== "function")
|
|
2635
2636
|
throw new Error(`No such callback: ${e}`);
|
|
@@ -2644,7 +2645,7 @@ class st {
|
|
|
2644
2645
|
);
|
|
2645
2646
|
});
|
|
2646
2647
|
} catch (r) {
|
|
2647
|
-
throw
|
|
2648
|
+
throw ot.cleanErrorContext(r), this.errorRepo.getOriginal(r);
|
|
2648
2649
|
} finally {
|
|
2649
2650
|
this.deadlineSetter(void 0);
|
|
2650
2651
|
}
|
|
@@ -2701,13 +2702,13 @@ class st {
|
|
|
2701
2702
|
return this.getAccessor(e).listDynamicFields();
|
|
2702
2703
|
}
|
|
2703
2704
|
getKeyValueBase64(e, t) {
|
|
2704
|
-
return
|
|
2705
|
+
return Er(this.getAccessor(e).getKeyValue(t));
|
|
2705
2706
|
}
|
|
2706
2707
|
getKeyValueAsString(e, t) {
|
|
2707
2708
|
return this.getAccessor(e).getKeyValueAsString(t);
|
|
2708
2709
|
}
|
|
2709
2710
|
getDataBase64(e) {
|
|
2710
|
-
return
|
|
2711
|
+
return Er(this.getAccessor(e).getData());
|
|
2711
2712
|
}
|
|
2712
2713
|
getDataAsString(e) {
|
|
2713
2714
|
return this.getAccessor(e).getDataAsString();
|
|
@@ -2718,9 +2719,9 @@ class st {
|
|
|
2718
2719
|
parsePObjectCollection(e, t, r, ...o) {
|
|
2719
2720
|
const n = this.getAccessor(e);
|
|
2720
2721
|
if (!n.getIsReadyOrError()) return;
|
|
2721
|
-
const i =
|
|
2722
|
+
const i = Un(n, t, r, o), a = {};
|
|
2722
2723
|
for (const [c, u] of Object.entries(i))
|
|
2723
|
-
a[c] =
|
|
2724
|
+
a[c] = pe(u, (l) => this.wrapAccessor(l));
|
|
2724
2725
|
return a;
|
|
2725
2726
|
}
|
|
2726
2727
|
//
|
|
@@ -2837,7 +2838,7 @@ class st {
|
|
|
2837
2838
|
throw new Error(
|
|
2838
2839
|
"can't use result pool in this context (most porbably called from the future mapper)"
|
|
2839
2840
|
);
|
|
2840
|
-
this._resultPool =
|
|
2841
|
+
this._resultPool = j(
|
|
2841
2842
|
this.blockCtx.getResultsPool,
|
|
2842
2843
|
"getResultsPool"
|
|
2843
2844
|
)(this.computableCtx);
|
|
@@ -2853,7 +2854,7 @@ class st {
|
|
|
2853
2854
|
isComplete: e.isComplete,
|
|
2854
2855
|
entries: e.entries.map((t) => ({
|
|
2855
2856
|
ref: t.ref,
|
|
2856
|
-
obj:
|
|
2857
|
+
obj: pe(t.obj, (r) => this.wrapAccessor(r))
|
|
2857
2858
|
}))
|
|
2858
2859
|
};
|
|
2859
2860
|
}
|
|
@@ -2866,7 +2867,7 @@ class st {
|
|
|
2866
2867
|
obj: {
|
|
2867
2868
|
id: t.obj.id,
|
|
2868
2869
|
spec: t.obj.spec,
|
|
2869
|
-
data:
|
|
2870
|
+
data: qr(t.obj.data, (r) => this.wrapAccessor(r))
|
|
2870
2871
|
}
|
|
2871
2872
|
}))
|
|
2872
2873
|
};
|
|
@@ -2879,7 +2880,7 @@ class st {
|
|
|
2879
2880
|
return this.resultPool.getSpecByRef(e, t);
|
|
2880
2881
|
}
|
|
2881
2882
|
getDataFromResultPoolByRef(e, t) {
|
|
2882
|
-
return
|
|
2883
|
+
return pe(
|
|
2883
2884
|
this.resultPool.getDataByRef(e, t),
|
|
2884
2885
|
(r) => this.wrapAccessor(r)
|
|
2885
2886
|
);
|
|
@@ -2893,7 +2894,7 @@ class st {
|
|
|
2893
2894
|
"can't instantiate PFrames from this context (most porbably called from the future mapper)"
|
|
2894
2895
|
);
|
|
2895
2896
|
return this.env.driverKit.pFrameDriver.createPFrame(
|
|
2896
|
-
e.map((t) =>
|
|
2897
|
+
e.map((t) => pe(t, (r) => this.transformInputPData(r))),
|
|
2897
2898
|
this.computableCtx
|
|
2898
2899
|
);
|
|
2899
2900
|
}
|
|
@@ -2903,9 +2904,9 @@ class st {
|
|
|
2903
2904
|
"can't instantiate PTable from this context (most porbably called from the future mapper)"
|
|
2904
2905
|
);
|
|
2905
2906
|
return this.env.driverKit.pFrameDriver.createPTable(
|
|
2906
|
-
|
|
2907
|
+
bt(
|
|
2907
2908
|
e,
|
|
2908
|
-
(t) =>
|
|
2909
|
+
(t) => pe(t, (r) => this.transformInputPData(r))
|
|
2909
2910
|
),
|
|
2910
2911
|
this.computableCtx
|
|
2911
2912
|
);
|
|
@@ -2917,7 +2918,7 @@ class st {
|
|
|
2917
2918
|
* - Passes through other values
|
|
2918
2919
|
*/
|
|
2919
2920
|
transformInputPData(e) {
|
|
2920
|
-
return typeof e == "string" ? this.getAccessor(e) :
|
|
2921
|
+
return typeof e == "string" ? this.getAccessor(e) : zr(e) ? Xr(e, (t) => this.getAccessor(t)) : e;
|
|
2921
2922
|
}
|
|
2922
2923
|
//
|
|
2923
2924
|
// Computable
|
|
@@ -2969,7 +2970,7 @@ class st {
|
|
|
2969
2970
|
r = this.vm.null;
|
|
2970
2971
|
break;
|
|
2971
2972
|
}
|
|
2972
|
-
if (
|
|
2973
|
+
if (bi(e)) {
|
|
2973
2974
|
r = this.vm.newArrayBuffer(e), o = !0;
|
|
2974
2975
|
break;
|
|
2975
2976
|
}
|
|
@@ -3005,12 +3006,12 @@ class st {
|
|
|
3005
3006
|
return JSON.parse(t);
|
|
3006
3007
|
}
|
|
3007
3008
|
injectCtx() {
|
|
3008
|
-
|
|
3009
|
+
Ct.withScope((e) => {
|
|
3009
3010
|
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);
|
|
3010
3011
|
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(
|
|
3011
3012
|
t,
|
|
3012
3013
|
"featureFlags",
|
|
3013
|
-
this.exportObjectUniversal(
|
|
3014
|
+
this.exportObjectUniversal(Js.GlobalCfgRenderCtxFeatureFlags, e)
|
|
3014
3015
|
);
|
|
3015
3016
|
const i = (a, c) => {
|
|
3016
3017
|
const u = (...l) => {
|
|
@@ -3103,7 +3104,7 @@ class st {
|
|
|
3103
3104
|
});
|
|
3104
3105
|
}
|
|
3105
3106
|
}
|
|
3106
|
-
class
|
|
3107
|
+
class Ri {
|
|
3107
3108
|
constructor() {
|
|
3108
3109
|
w(this, "errorIdToError", /* @__PURE__ */ new Map());
|
|
3109
3110
|
}
|
|
@@ -3120,7 +3121,7 @@ class Si {
|
|
|
3120
3121
|
}
|
|
3121
3122
|
/** Returns the original error that was stored by parsing uuid of mimicrated error. */
|
|
3122
3123
|
getOriginal(e) {
|
|
3123
|
-
if (!(e instanceof
|
|
3124
|
+
if (!(e instanceof mo.QuickJSUnwrapError))
|
|
3124
3125
|
return console.warn("ErrorRepo: quickJSError is not a QuickJSUnwrapError", Ue(e)), e;
|
|
3125
3126
|
if (!("name" in e.cause))
|
|
3126
3127
|
return console.warn("ErrorRepo: quickJSError.cause is not an Error", Ue(e)), e;
|
|
@@ -3130,10 +3131,10 @@ class Si {
|
|
|
3130
3131
|
const o = this.errorIdToError.get(r);
|
|
3131
3132
|
if (o === void 0)
|
|
3132
3133
|
throw new Error(`ErrorRepo: errorId not found: ${r}, ${Ue(e)}`);
|
|
3133
|
-
return new
|
|
3134
|
+
return new yo(e, o);
|
|
3134
3135
|
}
|
|
3135
3136
|
}
|
|
3136
|
-
function
|
|
3137
|
+
function it(s, e) {
|
|
3137
3138
|
return Te(
|
|
3138
3139
|
s.traverse(
|
|
3139
3140
|
{
|
|
@@ -3150,16 +3151,16 @@ function nt(s, e) {
|
|
|
3150
3151
|
);
|
|
3151
3152
|
}
|
|
3152
3153
|
const He = process.env.MI_LOG_OUTPUT_STATUS;
|
|
3153
|
-
function
|
|
3154
|
+
function Ei(s, e, t, r, o, n = {}) {
|
|
3154
3155
|
const i = `${e.blockId}#lambda#${o}#${t.handle}`;
|
|
3155
3156
|
return n = { ...n, key: i }, n.mode === void 0 && t.retentive === !0 && (n.mode = "StableOnlyRetentive"), J.makeRaw((a) => {
|
|
3156
|
-
const c = new
|
|
3157
|
+
const c = new Ct();
|
|
3157
3158
|
a.addOnDestroy(() => c.dispose());
|
|
3158
3159
|
const u = c.manage(s.quickJs.newRuntime());
|
|
3159
3160
|
u.setMemoryLimit(1024 * 1024 * 8), u.setMaxStackSize(1024 * 320);
|
|
3160
3161
|
let l;
|
|
3161
3162
|
u.setInterruptHandler(() => l === void 0 ? !1 : Date.now() > l.deadline);
|
|
3162
|
-
const d = c.manage(u.newContext()), f = new
|
|
3163
|
+
const d = c.manage(u.newContext()), f = new ot(
|
|
3163
3164
|
c,
|
|
3164
3165
|
d,
|
|
3165
3166
|
e,
|
|
@@ -3175,79 +3176,85 @@ function bi(s, e, t, r, o, n = {}) {
|
|
|
3175
3176
|
let R = 0;
|
|
3176
3177
|
return He && He !== "unstable-only" && console.log(`Output ${t.handle} scaffold calculated.`), {
|
|
3177
3178
|
ir: f.computablesToResolve,
|
|
3178
|
-
postprocessValue: (g, { unstableMarker:
|
|
3179
|
+
postprocessValue: (g, { unstableMarker: x, stable: T }) => {
|
|
3179
3180
|
for (const [$, M] of Object.entries(g)) f.runCallback($, M);
|
|
3180
|
-
const
|
|
3181
|
+
const B = f.importObjectUniversal(h);
|
|
3181
3182
|
return R++, He && (He !== "unstable-only" || !T) && console.log(
|
|
3182
|
-
T ? `Stable output ${t.handle} calculated ${
|
|
3183
|
-
),
|
|
3183
|
+
T ? `Stable output ${t.handle} calculated ${B !== void 0 ? "defined" : "undefined"}; (#${R})` : `Unstable output ${t.handle}; marker = ${x}; ${B !== void 0 ? "defined" : "undefined"} (#${R})`
|
|
3184
|
+
), B;
|
|
3184
3185
|
}
|
|
3185
3186
|
};
|
|
3186
3187
|
}, n);
|
|
3187
3188
|
}
|
|
3188
|
-
function
|
|
3189
|
-
return
|
|
3189
|
+
function Ci(s) {
|
|
3190
|
+
return Yr(s) ? s.isActive === !0 : Mn(s);
|
|
3190
3191
|
}
|
|
3191
3192
|
function Le(s, e, t, r, o, n = {}) {
|
|
3192
|
-
if (
|
|
3193
|
+
if (Yr(t)) {
|
|
3193
3194
|
if (r === void 0) throw new Error("No code bundle.");
|
|
3194
|
-
return
|
|
3195
|
-
} else return
|
|
3195
|
+
return Ei(s, e, t, r, o, n);
|
|
3196
|
+
} else return Si(s.driverKit, e, t, n);
|
|
3197
|
+
}
|
|
3198
|
+
function ki(s, e) {
|
|
3199
|
+
if (s === e) return !0;
|
|
3200
|
+
if (s === void 0 || e === void 0) return !1;
|
|
3201
|
+
const t = ar.omitBy((r, o) => o.startsWith("__"));
|
|
3202
|
+
return ar.isDeepEqual(t(s), t(e));
|
|
3196
3203
|
}
|
|
3197
|
-
function
|
|
3204
|
+
function Pi(s, e, t) {
|
|
3198
3205
|
return J.make(
|
|
3199
3206
|
(r) => {
|
|
3200
|
-
var R, g,
|
|
3201
|
-
const o = r.accessor(s).node(), n =
|
|
3202
|
-
o.getKeyValueAsJson(
|
|
3207
|
+
var R, g, x, T, B, $, M, ge;
|
|
3208
|
+
const o = r.accessor(s).node(), n = j(o.getKeyValueAsJson(xt)), i = j(o.getKeyValueAsJson(Be)), a = j(o.getKeyValueAsJson(je)), c = j(o.getKeyValueAsJson(he)), u = j(
|
|
3209
|
+
o.getKeyValueAsJson(rt)
|
|
3203
3210
|
), l = /* @__PURE__ */ new Map();
|
|
3204
3211
|
for (const { id: L } of ne(c)) {
|
|
3205
|
-
const
|
|
3212
|
+
const ce = o.traverse({
|
|
3206
3213
|
field: G(L, "currentArgs"),
|
|
3207
3214
|
assertFieldType: "Dynamic",
|
|
3208
3215
|
errorIfFieldNotSet: !0
|
|
3209
|
-
});
|
|
3210
|
-
let
|
|
3211
|
-
const
|
|
3216
|
+
}).getDataAsJson();
|
|
3217
|
+
let z;
|
|
3218
|
+
const ie = o.traverse({
|
|
3212
3219
|
field: G(L, "prodArgs"),
|
|
3213
3220
|
assertFieldType: "Dynamic",
|
|
3214
3221
|
stableIfNotFound: !0
|
|
3215
3222
|
});
|
|
3216
|
-
if (
|
|
3217
|
-
const
|
|
3223
|
+
if (ie !== void 0) {
|
|
3224
|
+
const Y = ie.getDataAsJson(), D = o.getField({
|
|
3218
3225
|
field: G(L, "prodOutput"),
|
|
3219
3226
|
assertFieldType: "Dynamic",
|
|
3220
3227
|
errorIfFieldNotFound: !0
|
|
3221
|
-
}),
|
|
3228
|
+
}), W = o.getField({
|
|
3222
3229
|
field: G(L, "prodUiCtx"),
|
|
3223
3230
|
assertFieldType: "Dynamic",
|
|
3224
3231
|
errorIfFieldNotFound: !0
|
|
3225
3232
|
});
|
|
3226
|
-
|
|
3227
|
-
arguments:
|
|
3228
|
-
stale: Y
|
|
3229
|
-
outputError:
|
|
3230
|
-
outputsError: ((
|
|
3231
|
-
exportsError: (($ =
|
|
3232
|
-
finished: (
|
|
3233
|
+
z = {
|
|
3234
|
+
arguments: Y,
|
|
3235
|
+
stale: !ki(ce, Y),
|
|
3236
|
+
outputError: D.error !== void 0 || W.error !== void 0 || ((R = D.value) == null ? void 0 : R.getError()) !== void 0 || ((g = W.value) == null ? void 0 : g.getError()) !== void 0,
|
|
3237
|
+
outputsError: ((x = D.error) == null ? void 0 : x.getDataAsString()) ?? ((B = (T = D.value) == null ? void 0 : T.getError()) == null ? void 0 : B.getDataAsString()),
|
|
3238
|
+
exportsError: (($ = W.error) == null ? void 0 : $.getDataAsString()) ?? ((ge = (M = W.value) == null ? void 0 : M.getError()) == null ? void 0 : ge.getDataAsString()),
|
|
3239
|
+
finished: (D.value !== void 0 && D.value.getIsReadyOrError() || D.error !== void 0 && D.error.getIsReadyOrError()) && (W.value !== void 0 && W.value.getIsReadyOrError() || W.error !== void 0 && W.error.getIsReadyOrError())
|
|
3233
3240
|
};
|
|
3234
3241
|
}
|
|
3235
|
-
l.set(L, { currentArguments:
|
|
3242
|
+
l.set(L, { currentArguments: ce, prod: z });
|
|
3236
3243
|
}
|
|
3237
|
-
const d = Ze(c, (L) => l.get(L).currentArguments), f = new Set(u.blocksInLimbo), h = [...ne(c)].map(({ id: L, label:
|
|
3244
|
+
const d = Ze(c, (L) => l.get(L).currentArguments), f = new Set(u.blocksInLimbo), h = [...ne(c)].map(({ id: L, label: re, renderingMode: ce }) => {
|
|
3238
3245
|
var S, E, O, C, F;
|
|
3239
|
-
const z =
|
|
3240
|
-
let
|
|
3241
|
-
z.prod !== void 0 && (f.has(L) ?
|
|
3242
|
-
const
|
|
3243
|
-
const
|
|
3246
|
+
const z = j(l.get(L)), ie = j(d.nodes.get(L));
|
|
3247
|
+
let Y = "NotCalculated";
|
|
3248
|
+
z.prod !== void 0 && (f.has(L) ? Y = "Limbo" : Y = z.prod.finished ? "Done" : "Running");
|
|
3249
|
+
const D = it(o, L), { sections: W, title: v, inputsValid: p, sdkVersion: m } = Te(D, ({ bpId: V, cfg: I }) => {
|
|
3250
|
+
const ae = Gt(s, L);
|
|
3244
3251
|
return {
|
|
3245
3252
|
sections: Le(
|
|
3246
3253
|
t,
|
|
3247
|
-
|
|
3254
|
+
ae,
|
|
3248
3255
|
I.sections,
|
|
3249
3256
|
I.code,
|
|
3250
|
-
|
|
3257
|
+
V
|
|
3251
3258
|
).wrap({
|
|
3252
3259
|
recover: (ke) => (t.logger.error("Error in block model sections"), t.logger.error(ke), [])
|
|
3253
3260
|
}),
|
|
@@ -3255,20 +3262,20 @@ function Ei(s, e, t) {
|
|
|
3255
3262
|
I.title,
|
|
3256
3263
|
(ke) => Le(
|
|
3257
3264
|
t,
|
|
3258
|
-
|
|
3265
|
+
ae,
|
|
3259
3266
|
ke,
|
|
3260
3267
|
I.code,
|
|
3261
|
-
|
|
3268
|
+
V
|
|
3262
3269
|
).wrap({
|
|
3263
|
-
recover: (
|
|
3270
|
+
recover: (xs) => (t.logger.error("Error in block model title"), t.logger.error(xs), "Invalid title")
|
|
3264
3271
|
})
|
|
3265
3272
|
),
|
|
3266
3273
|
inputsValid: Le(
|
|
3267
3274
|
t,
|
|
3268
|
-
|
|
3275
|
+
ae,
|
|
3269
3276
|
I.inputsValid,
|
|
3270
3277
|
I.code,
|
|
3271
|
-
|
|
3278
|
+
V
|
|
3272
3279
|
).wrap({
|
|
3273
3280
|
recover: (ke) => (t.logger.error("Error in block model argsValid"), t.logger.error(ke), !1)
|
|
3274
3281
|
}),
|
|
@@ -3279,28 +3286,28 @@ function Ei(s, e, t) {
|
|
|
3279
3286
|
assertFieldType: "Dynamic",
|
|
3280
3287
|
errorIfFieldNotSet: !0
|
|
3281
3288
|
}).getDataAsJson(), b = Te(
|
|
3282
|
-
|
|
3283
|
-
({ info:
|
|
3289
|
+
D,
|
|
3290
|
+
({ info: V }) => t.blockUpdateWatcher.get({ currentSpec: V.source, settings: y })
|
|
3284
3291
|
);
|
|
3285
3292
|
return {
|
|
3286
3293
|
projectResourceId: Se(s.rid),
|
|
3287
3294
|
id: L,
|
|
3288
|
-
label: v ??
|
|
3289
|
-
title: v ??
|
|
3290
|
-
renderingMode:
|
|
3291
|
-
stale: ((S = z.prod) == null ? void 0 : S.stale) !== !1 ||
|
|
3292
|
-
missingReference:
|
|
3295
|
+
label: v ?? re,
|
|
3296
|
+
title: v ?? re,
|
|
3297
|
+
renderingMode: ce,
|
|
3298
|
+
stale: ((S = z.prod) == null ? void 0 : S.stale) !== !1 || Y === "Limbo",
|
|
3299
|
+
missingReference: ie.missingReferences,
|
|
3293
3300
|
upstreams: [...d.traverseIdsExcludingRoots("upstream", L)],
|
|
3294
3301
|
downstreams: [...d.traverseIdsExcludingRoots("downstream", L)],
|
|
3295
|
-
calculationStatus:
|
|
3302
|
+
calculationStatus: Y,
|
|
3296
3303
|
outputErrors: ((E = z.prod) == null ? void 0 : E.outputError) === !0,
|
|
3297
3304
|
outputsError: (O = z.prod) == null ? void 0 : O.outputsError,
|
|
3298
3305
|
exportsError: (C = z.prod) == null ? void 0 : C.exportsError,
|
|
3299
3306
|
settings: y,
|
|
3300
|
-
sections:
|
|
3307
|
+
sections: W,
|
|
3301
3308
|
inputsValid: p,
|
|
3302
3309
|
updateInfo: {},
|
|
3303
|
-
currentBlockPack: (F =
|
|
3310
|
+
currentBlockPack: (F = D == null ? void 0 : D.info) == null ? void 0 : F.source,
|
|
3304
3311
|
updates: b,
|
|
3305
3312
|
sdkVersion: m,
|
|
3306
3313
|
navigationState: e.getState(L)
|
|
@@ -3310,7 +3317,7 @@ function Ei(s, e, t) {
|
|
|
3310
3317
|
meta: a,
|
|
3311
3318
|
created: new Date(n),
|
|
3312
3319
|
lastModified: new Date(i),
|
|
3313
|
-
authorMarker: o.getKeyValueAsJson(
|
|
3320
|
+
authorMarker: o.getKeyValueAsJson(Ot),
|
|
3314
3321
|
blocks: h
|
|
3315
3322
|
};
|
|
3316
3323
|
},
|
|
@@ -3336,13 +3343,13 @@ function Ei(s, e, t) {
|
|
|
3336
3343
|
}
|
|
3337
3344
|
).withStableType();
|
|
3338
3345
|
}
|
|
3339
|
-
function
|
|
3346
|
+
function Oi(s, e) {
|
|
3340
3347
|
const t = s.node();
|
|
3341
|
-
if (
|
|
3348
|
+
if (le(t.resourceType, hs)) {
|
|
3342
3349
|
const r = t.getDataAsJson();
|
|
3343
3350
|
if (r === void 0) throw new Error("No resource data.");
|
|
3344
3351
|
return e.frontendDownloadDriver.getPath(new URL(r.url)).withStableType();
|
|
3345
|
-
} else if (
|
|
3352
|
+
} else if (le(t.resourceType, gs)) {
|
|
3346
3353
|
const r = t.getDataAsJson();
|
|
3347
3354
|
if (r === void 0) throw new Error("No resource data.");
|
|
3348
3355
|
return e.signer.verify(
|
|
@@ -3353,10 +3360,10 @@ function Ci(s, e) {
|
|
|
3353
3360
|
} else
|
|
3354
3361
|
throw new Error(`Unsupported resource type: ${JSON.stringify(t.resourceType)}`);
|
|
3355
3362
|
}
|
|
3356
|
-
function
|
|
3363
|
+
function $i(s, e) {
|
|
3357
3364
|
if (s !== void 0)
|
|
3358
3365
|
return J.make(
|
|
3359
|
-
(t) =>
|
|
3366
|
+
(t) => Oi(t.accessor(s), e),
|
|
3360
3367
|
{
|
|
3361
3368
|
postprocessValue: (t) => {
|
|
3362
3369
|
if (t !== void 0) {
|
|
@@ -3368,43 +3375,43 @@ function ki(s, e) {
|
|
|
3368
3375
|
}
|
|
3369
3376
|
).withStableType();
|
|
3370
3377
|
}
|
|
3371
|
-
function
|
|
3378
|
+
function Ii(s, e, t) {
|
|
3372
3379
|
return J.make(
|
|
3373
3380
|
(r) => {
|
|
3374
3381
|
var a;
|
|
3375
|
-
const o = r.accessor(s).node(), n =
|
|
3382
|
+
const o = r.accessor(s).node(), n = it(o, e), i = (a = o.traverse(
|
|
3376
3383
|
{
|
|
3377
3384
|
field: G(e, "blockPack"),
|
|
3378
3385
|
assertFieldType: "Dynamic"
|
|
3379
3386
|
},
|
|
3380
3387
|
{ field: A.HolderRefField, assertFieldType: "Input", errorIfFieldNotFound: !0 },
|
|
3381
|
-
{ field:
|
|
3388
|
+
{ field: vs, assertFieldType: "Input" }
|
|
3382
3389
|
)) == null ? void 0 : a.persist();
|
|
3383
3390
|
return {
|
|
3384
|
-
path:
|
|
3391
|
+
path: $i(i, t),
|
|
3385
3392
|
sdkVersion: n == null ? void 0 : n.cfg.sdkVersion
|
|
3386
3393
|
};
|
|
3387
3394
|
},
|
|
3388
3395
|
{ mode: "StableOnlyLive" }
|
|
3389
3396
|
);
|
|
3390
3397
|
}
|
|
3391
|
-
function
|
|
3398
|
+
function Os(s, e, t) {
|
|
3392
3399
|
if (t === void 0)
|
|
3393
|
-
return J.make((i) =>
|
|
3400
|
+
return J.make((i) => Os(s, e, i), {
|
|
3394
3401
|
key: `inputs#${Se(s.rid)}#${e}`
|
|
3395
3402
|
});
|
|
3396
|
-
const r = t.accessor(s).node(), o =
|
|
3403
|
+
const r = t.accessor(s).node(), o = Gt(s, e), n = o.uiState(t);
|
|
3397
3404
|
return {
|
|
3398
|
-
author: r.getKeyValueAsJson(
|
|
3399
|
-
args: JSON.parse(o.args(t)),
|
|
3400
|
-
ui: n !== void 0 ? JSON.parse(n) : void 0
|
|
3405
|
+
author: r.getKeyValueAsJson(Pt(e)),
|
|
3406
|
+
args: et(JSON.parse(o.args(t))),
|
|
3407
|
+
ui: n !== void 0 ? et(JSON.parse(n)) : void 0
|
|
3401
3408
|
};
|
|
3402
3409
|
}
|
|
3403
|
-
function
|
|
3410
|
+
function Fi(s, e, t) {
|
|
3404
3411
|
return J.make(
|
|
3405
3412
|
(r) => {
|
|
3406
|
-
const o = r.accessor(s).node(), n =
|
|
3407
|
-
return Te(
|
|
3413
|
+
const o = r.accessor(s).node(), n = bs(s, e);
|
|
3414
|
+
return Te(it(o, e), ({ cfg: i, bpId: a }) => {
|
|
3408
3415
|
const c = {};
|
|
3409
3416
|
for (const [u, l] of Object.entries(i.outputs)) {
|
|
3410
3417
|
const d = Le(t, n, l, i.code, a);
|
|
@@ -3416,15 +3423,15 @@ function Oi(s, e, t) {
|
|
|
3416
3423
|
{ key: "outputs#" + Se(s.rid) + "#" + e }
|
|
3417
3424
|
).withStableType();
|
|
3418
3425
|
}
|
|
3419
|
-
function
|
|
3426
|
+
function Ai(s, e) {
|
|
3420
3427
|
return J.make((t) => {
|
|
3421
|
-
const r = t.accessor(s).node(), o =
|
|
3428
|
+
const r = t.accessor(s).node(), o = j(r.getKeyValueAsJson(he)), n = [];
|
|
3422
3429
|
for (const { id: i } of ne(o)) {
|
|
3423
|
-
const a =
|
|
3430
|
+
const a = it(r, i);
|
|
3424
3431
|
if (a === void 0) continue;
|
|
3425
|
-
const c = Object.entries(a.cfg.outputs).map(([, l]) => l).filter((l) =>
|
|
3432
|
+
const c = Object.entries(a.cfg.outputs).map(([, l]) => l).filter((l) => Ci(l)).map((l) => l);
|
|
3426
3433
|
if (c.length === 0) continue;
|
|
3427
|
-
const u =
|
|
3434
|
+
const u = bs(r.persist(), i);
|
|
3428
3435
|
for (const l of c)
|
|
3429
3436
|
n.push(
|
|
3430
3437
|
J.wrapError(Le(e, u, l, a.cfg.code, a.bpId))
|
|
@@ -3433,21 +3440,21 @@ function $i(s, e) {
|
|
|
3433
3440
|
return n;
|
|
3434
3441
|
});
|
|
3435
3442
|
}
|
|
3436
|
-
class
|
|
3443
|
+
class Ti {
|
|
3437
3444
|
constructor() {
|
|
3438
3445
|
w(this, "states", /* @__PURE__ */ new Map());
|
|
3439
3446
|
}
|
|
3440
3447
|
setState(e, t) {
|
|
3441
3448
|
const r = this.states.get(e);
|
|
3442
3449
|
if (r === void 0) {
|
|
3443
|
-
this.states.set(e, { state: t, change: new
|
|
3450
|
+
this.states.set(e, { state: t, change: new ir() });
|
|
3444
3451
|
return;
|
|
3445
3452
|
}
|
|
3446
3453
|
r.state = { ...t }, r.change.markChanged();
|
|
3447
3454
|
}
|
|
3448
3455
|
readState(e, t) {
|
|
3449
3456
|
let r = this.states.get(t);
|
|
3450
|
-
return r === void 0 && (r = { state: { ...
|
|
3457
|
+
return r === void 0 && (r = { state: { ...Ms }, change: new ir() }, this.states.set(t, r)), r.change.attachWatcher(e.watcher), r.state;
|
|
3451
3458
|
}
|
|
3452
3459
|
getState(e) {
|
|
3453
3460
|
return J.make(
|
|
@@ -3460,41 +3467,41 @@ class Ii {
|
|
|
3460
3467
|
t !== void 0 && (this.states.delete(e), t.change.markChanged());
|
|
3461
3468
|
}
|
|
3462
3469
|
}
|
|
3463
|
-
function
|
|
3470
|
+
function Cr(s) {
|
|
3464
3471
|
return JSON.stringify(s, (e, t) => typeof t == "bigint" ? Se(t) : ArrayBuffer.isView(t) || t instanceof Int8Array || t instanceof Uint8Array || t instanceof Uint8ClampedArray || t instanceof Int16Array || t instanceof Uint16Array || t instanceof Int32Array || t instanceof Uint32Array || t instanceof Float32Array || t instanceof Float64Array || t instanceof BigInt64Array || t instanceof BigUint64Array ? Buffer.from(t.buffer, t.byteOffset, t.byteLength).toString("base64") : Buffer.isBuffer(t) ? t.toString("base64") : t);
|
|
3465
3472
|
}
|
|
3466
|
-
class
|
|
3473
|
+
class Jt {
|
|
3467
3474
|
constructor(e, t, r) {
|
|
3468
3475
|
/** Underlying pl resource id */
|
|
3469
3476
|
w(this, "rid");
|
|
3470
3477
|
/** Data for the left panel, contain basic information about block status. */
|
|
3471
3478
|
w(this, "overview");
|
|
3472
|
-
w(this, "navigationStates", new
|
|
3479
|
+
w(this, "navigationStates", new Ti());
|
|
3473
3480
|
w(this, "blockComputables", /* @__PURE__ */ new Map());
|
|
3474
3481
|
w(this, "blockFrontends", /* @__PURE__ */ new Map());
|
|
3475
3482
|
w(this, "activeConfigs");
|
|
3476
3483
|
w(this, "refreshLoopResult");
|
|
3477
3484
|
w(this, "abortController", new AbortController());
|
|
3478
3485
|
w(this, "destroyed", !1);
|
|
3479
|
-
this.env = e, this.projectTree = r, this.overview =
|
|
3486
|
+
this.env = e, this.projectTree = r, this.overview = Pi(
|
|
3480
3487
|
r.entry(),
|
|
3481
3488
|
this.navigationStates,
|
|
3482
3489
|
e
|
|
3483
|
-
).withPreCalculatedValueTree(), this.rid = t, this.refreshLoopResult = this.refreshLoop(), this.activeConfigs =
|
|
3490
|
+
).withPreCalculatedValueTree(), this.rid = t, this.refreshLoopResult = this.refreshLoop(), this.activeConfigs = Ai(r.entry(), e);
|
|
3484
3491
|
}
|
|
3485
3492
|
async refreshLoop() {
|
|
3486
3493
|
for (; !this.destroyed; )
|
|
3487
3494
|
try {
|
|
3488
3495
|
await Ke(this.env.pl, this.rid, (e) => {
|
|
3489
3496
|
e.doRefresh(this.env.ops.stagingRenderingRate);
|
|
3490
|
-
}), await this.activeConfigs.getValue(), await
|
|
3497
|
+
}), await this.activeConfigs.getValue(), await ss(this.env.ops.projectRefreshInterval, this.abortController.signal);
|
|
3491
3498
|
} catch (e) {
|
|
3492
|
-
if (
|
|
3499
|
+
if (so(e)) {
|
|
3493
3500
|
console.warn(
|
|
3494
3501
|
"project refresh routine terminated, because project was externally deleted"
|
|
3495
3502
|
);
|
|
3496
3503
|
break;
|
|
3497
|
-
} else if (!
|
|
3504
|
+
} else if (!oo(e))
|
|
3498
3505
|
throw new Error("Unexpected exception", { cause: e });
|
|
3499
3506
|
}
|
|
3500
3507
|
}
|
|
@@ -3511,7 +3518,7 @@ class Gt {
|
|
|
3511
3518
|
* */
|
|
3512
3519
|
async addBlock(e, t, r, o = void 0, n = be()) {
|
|
3513
3520
|
const i = await this.env.bpPreparer.prepare(t), a = await this.env.bpPreparer.getBlockConfigContainer(t), c = Qe(a);
|
|
3514
|
-
return await
|
|
3521
|
+
return await Z(
|
|
3515
3522
|
this.env.pl,
|
|
3516
3523
|
this.rid,
|
|
3517
3524
|
o,
|
|
@@ -3522,8 +3529,8 @@ class Gt {
|
|
|
3522
3529
|
renderingMode: c.renderingMode
|
|
3523
3530
|
},
|
|
3524
3531
|
{
|
|
3525
|
-
args:
|
|
3526
|
-
uiState:
|
|
3532
|
+
args: N(c.initialArgs),
|
|
3533
|
+
uiState: N(c.initialUiState),
|
|
3527
3534
|
blockPack: i
|
|
3528
3535
|
},
|
|
3529
3536
|
r
|
|
@@ -3536,20 +3543,20 @@ class Gt {
|
|
|
3536
3543
|
* */
|
|
3537
3544
|
async updateBlockPack(e, t, r = !1, o) {
|
|
3538
3545
|
const n = await this.env.bpPreparer.prepare(t), i = Qe(await this.env.bpPreparer.getBlockConfigContainer(t));
|
|
3539
|
-
await
|
|
3546
|
+
await Z(
|
|
3540
3547
|
this.env.pl,
|
|
3541
3548
|
this.rid,
|
|
3542
3549
|
o,
|
|
3543
3550
|
(a) => a.migrateBlockPack(
|
|
3544
3551
|
e,
|
|
3545
3552
|
n,
|
|
3546
|
-
r ? { args:
|
|
3553
|
+
r ? { args: N(i.initialArgs), uiState: N(i.initialUiState) } : void 0
|
|
3547
3554
|
)
|
|
3548
3555
|
), await this.projectTree.refreshState();
|
|
3549
3556
|
}
|
|
3550
3557
|
/** Deletes a block with all associated data. */
|
|
3551
3558
|
async deleteBlock(e, t) {
|
|
3552
|
-
await
|
|
3559
|
+
await Z(this.env.pl, this.rid, t, (r) => r.deleteBlock(e)), this.navigationStates.deleteBlock(e), await this.projectTree.refreshState();
|
|
3553
3560
|
}
|
|
3554
3561
|
/**
|
|
3555
3562
|
* Updates block order according to the given array of block ids.
|
|
@@ -3558,7 +3565,7 @@ class Gt {
|
|
|
3558
3565
|
* an error will be thrown instead.
|
|
3559
3566
|
*/
|
|
3560
3567
|
async reorderBlocks(e, t) {
|
|
3561
|
-
await
|
|
3568
|
+
await Z(this.env.pl, this.rid, t, (r) => {
|
|
3562
3569
|
const o = r.structure;
|
|
3563
3570
|
if (o.groups.length !== 1)
|
|
3564
3571
|
throw new Error("Unexpected project structure, non-sinular block group");
|
|
@@ -3612,11 +3619,11 @@ class Gt {
|
|
|
3612
3619
|
* in collaborative editing scenario.
|
|
3613
3620
|
* */
|
|
3614
3621
|
async setBlockArgs(e, t, r) {
|
|
3615
|
-
await
|
|
3622
|
+
await Z(
|
|
3616
3623
|
this.env.pl,
|
|
3617
3624
|
this.rid,
|
|
3618
3625
|
r,
|
|
3619
|
-
(o) => o.setArgs([{ blockId: e, args:
|
|
3626
|
+
(o) => o.setArgs([{ blockId: e, args: N(t) }])
|
|
3620
3627
|
), await this.projectTree.refreshState();
|
|
3621
3628
|
}
|
|
3622
3629
|
/**
|
|
@@ -3626,11 +3633,11 @@ class Gt {
|
|
|
3626
3633
|
* in collaborative editing scenario.
|
|
3627
3634
|
* */
|
|
3628
3635
|
async setUiState(e, t, r) {
|
|
3629
|
-
await
|
|
3636
|
+
await Z(
|
|
3630
3637
|
this.env.pl,
|
|
3631
3638
|
this.rid,
|
|
3632
3639
|
r,
|
|
3633
|
-
(o) => o.setUiState(e, t === void 0 ? void 0 :
|
|
3640
|
+
(o) => o.setUiState(e, t === void 0 ? void 0 : N(t))
|
|
3634
3641
|
), await this.projectTree.refreshState();
|
|
3635
3642
|
}
|
|
3636
3643
|
/**
|
|
@@ -3647,38 +3654,38 @@ class Gt {
|
|
|
3647
3654
|
* in collaborative editing scenario.
|
|
3648
3655
|
* */
|
|
3649
3656
|
async setBlockArgsAndUiState(e, t, r, o) {
|
|
3650
|
-
await
|
|
3651
|
-
n.setArgs([{ blockId: e, args:
|
|
3657
|
+
await Z(this.env.pl, this.rid, o, (n) => {
|
|
3658
|
+
n.setArgs([{ blockId: e, args: N(t) }]), n.setUiState(e, N(r));
|
|
3652
3659
|
}), await this.projectTree.refreshState();
|
|
3653
3660
|
}
|
|
3654
3661
|
/** Update block settings */
|
|
3655
3662
|
async setBlockSettings(e, t) {
|
|
3656
|
-
await
|
|
3663
|
+
await Z(this.env.pl, this.rid, void 0, (r) => {
|
|
3657
3664
|
r.setBlockSettings(e, t);
|
|
3658
3665
|
}), await this.projectTree.refreshState();
|
|
3659
3666
|
}
|
|
3660
3667
|
/** Resets arguments and ui state of the block to initial state */
|
|
3661
3668
|
async resetBlockArgsAndUiState(e, t) {
|
|
3662
3669
|
await this.env.pl.withWriteTx("BlockInputsReset", async (r) => {
|
|
3663
|
-
const o =
|
|
3664
|
-
(await r.getField(
|
|
3665
|
-
), n =
|
|
3666
|
-
(await r.getField(
|
|
3670
|
+
const o = Et(
|
|
3671
|
+
(await r.getField(U(this.rid, G(e, "blockPack")))).value
|
|
3672
|
+
), n = Et(
|
|
3673
|
+
(await r.getField(U(o, A.HolderRefField))).value
|
|
3667
3674
|
), i = await r.getResourceData(n, !1), a = Qe(JSON.parse(
|
|
3668
|
-
Buffer.from(
|
|
3675
|
+
Buffer.from(j(i.data)).toString("utf-8")
|
|
3669
3676
|
).config);
|
|
3670
|
-
await
|
|
3671
|
-
c.setArgs([{ blockId: e, args:
|
|
3677
|
+
await Z(r, this.rid, t, (c) => {
|
|
3678
|
+
c.setArgs([{ blockId: e, args: N(a.initialArgs) }]), c.setUiState(e, N(a.initialUiState));
|
|
3672
3679
|
}), await r.commit();
|
|
3673
3680
|
}), await this.projectTree.refreshState();
|
|
3674
3681
|
}
|
|
3675
3682
|
getBlockComputables(e) {
|
|
3676
3683
|
const t = this.blockComputables.get(e);
|
|
3677
3684
|
if (t === void 0) {
|
|
3678
|
-
const r =
|
|
3685
|
+
const r = Fi(this.projectTree.entry(), e, this.env), n = {
|
|
3679
3686
|
fullState: J.make(
|
|
3680
3687
|
(i) => ({
|
|
3681
|
-
argsAndUiState:
|
|
3688
|
+
argsAndUiState: Os(this.projectTree.entry(), e, i),
|
|
3682
3689
|
outputs: r,
|
|
3683
3690
|
navigationState: this.navigationStates.getState(e),
|
|
3684
3691
|
overview: this.overview
|
|
@@ -3686,7 +3693,7 @@ class Gt {
|
|
|
3686
3693
|
{
|
|
3687
3694
|
postprocessValue: (i) => {
|
|
3688
3695
|
var l, d, f;
|
|
3689
|
-
const a = (f = (d = (l = i.overview) == null ? void 0 : l.blocks) == null ? void 0 : d.find((h) => h.id == e)) == null ? void 0 : f.sdkVersion, u = a &&
|
|
3696
|
+
const a = (f = (d = (l = i.overview) == null ? void 0 : l.blocks) == null ? void 0 : d.find((h) => h.id == e)) == null ? void 0 : f.sdkVersion, u = a && Di(a) && i.outputs !== void 0 ? Bi(i.outputs) : i.outputs;
|
|
3690
3697
|
return {
|
|
3691
3698
|
...i.argsAndUiState,
|
|
3692
3699
|
outputs: u,
|
|
@@ -3714,7 +3721,7 @@ class Gt {
|
|
|
3714
3721
|
getBlockFrontend(e) {
|
|
3715
3722
|
const t = this.blockFrontends.get(e);
|
|
3716
3723
|
if (t === void 0) {
|
|
3717
|
-
const r =
|
|
3724
|
+
const r = Ii(
|
|
3718
3725
|
this.projectTree.entry(),
|
|
3719
3726
|
e,
|
|
3720
3727
|
this.env
|
|
@@ -3736,12 +3743,12 @@ class Gt {
|
|
|
3736
3743
|
static async init(e, t) {
|
|
3737
3744
|
await Ke(e.pl, t, (o) => {
|
|
3738
3745
|
});
|
|
3739
|
-
const r = await
|
|
3746
|
+
const r = await es.init(
|
|
3740
3747
|
e.pl,
|
|
3741
3748
|
t,
|
|
3742
3749
|
{
|
|
3743
3750
|
...e.ops.defaultTreeOptions,
|
|
3744
|
-
pruning:
|
|
3751
|
+
pruning: Li
|
|
3745
3752
|
},
|
|
3746
3753
|
e.logger
|
|
3747
3754
|
);
|
|
@@ -3751,13 +3758,13 @@ class Gt {
|
|
|
3751
3758
|
var c, u;
|
|
3752
3759
|
return (((c = a.data) == null ? void 0 : c.byteLength) ?? 0) - (((u = i.data) == null ? void 0 : u.byteLength) ?? 0);
|
|
3753
3760
|
});
|
|
3754
|
-
const n =
|
|
3755
|
-
await
|
|
3761
|
+
const n = ao(o);
|
|
3762
|
+
await sr.writeFile(`${Se(t)}.json`, Cr(o)), await sr.writeFile(`${Se(t)}.stats.json`, Cr(n));
|
|
3756
3763
|
}
|
|
3757
|
-
return new
|
|
3764
|
+
return new Jt(e, t, r);
|
|
3758
3765
|
}
|
|
3759
3766
|
}
|
|
3760
|
-
function
|
|
3767
|
+
function Li(s) {
|
|
3761
3768
|
switch (s.type.name) {
|
|
3762
3769
|
case "BlockPackCustom":
|
|
3763
3770
|
return s.fields.filter((e) => e.name !== "template");
|
|
@@ -3769,14 +3776,14 @@ function Fi(s) {
|
|
|
3769
3776
|
return s.fields;
|
|
3770
3777
|
}
|
|
3771
3778
|
}
|
|
3772
|
-
function
|
|
3773
|
-
return !
|
|
3779
|
+
function Di(s) {
|
|
3780
|
+
return !Ni(s, "1.26.0");
|
|
3774
3781
|
}
|
|
3775
|
-
function
|
|
3782
|
+
function Ni(s, e) {
|
|
3776
3783
|
const t = s.split(".").map(Number), r = e.split(".").map(Number);
|
|
3777
3784
|
return t[0] > r[0] || t[0] === r[0] && t[1] > r[1] || t[0] === r[0] && t[1] === r[1] && t[2] > r[2];
|
|
3778
3785
|
}
|
|
3779
|
-
function
|
|
3786
|
+
function Bi(s) {
|
|
3780
3787
|
const e = {};
|
|
3781
3788
|
for (const [t, r] of Object.entries(s)) {
|
|
3782
3789
|
if (r.ok) {
|
|
@@ -3791,8 +3798,8 @@ function Li(s) {
|
|
|
3791
3798
|
}
|
|
3792
3799
|
return e;
|
|
3793
3800
|
}
|
|
3794
|
-
const
|
|
3795
|
-
logger: new
|
|
3801
|
+
const $s = {
|
|
3802
|
+
logger: new Ys(),
|
|
3796
3803
|
blobDriverOps: {
|
|
3797
3804
|
cacheSoftSizeBytes: 8 * 1024 * 1024 * 1024,
|
|
3798
3805
|
// 8 GB
|
|
@@ -3815,14 +3822,14 @@ const Ps = {
|
|
|
3815
3822
|
stopPollingDelay: 1e3
|
|
3816
3823
|
}
|
|
3817
3824
|
};
|
|
3818
|
-
function
|
|
3825
|
+
function Is(s) {
|
|
3819
3826
|
return {
|
|
3820
3827
|
blobDownloadPath: K.join(s, "download"),
|
|
3821
3828
|
downloadBlobToURLPath: K.join(s, "downloadToURL")
|
|
3822
3829
|
};
|
|
3823
3830
|
}
|
|
3824
|
-
const
|
|
3825
|
-
|
|
3831
|
+
const ji = {
|
|
3832
|
+
...$s,
|
|
3826
3833
|
defaultTreeOptions: {
|
|
3827
3834
|
pollingInterval: 350,
|
|
3828
3835
|
stopPollingDelay: 2500,
|
|
@@ -3836,18 +3843,18 @@ const Di = {
|
|
|
3836
3843
|
projectRefreshInterval: 700,
|
|
3837
3844
|
stagingRenderingRate: 5
|
|
3838
3845
|
};
|
|
3839
|
-
function
|
|
3846
|
+
function xi(s) {
|
|
3840
3847
|
return {
|
|
3841
|
-
...
|
|
3848
|
+
...Is(s),
|
|
3842
3849
|
frontendDownloadPath: K.join(s, "frontend")
|
|
3843
3850
|
};
|
|
3844
3851
|
}
|
|
3845
|
-
function
|
|
3852
|
+
function Vi(s) {
|
|
3846
3853
|
return s && s.__esModule && Object.prototype.hasOwnProperty.call(s, "default") ? s.default : s;
|
|
3847
3854
|
}
|
|
3848
|
-
var
|
|
3849
|
-
const
|
|
3850
|
-
9007199254740991,
|
|
3855
|
+
var Tt = { exports: {} };
|
|
3856
|
+
const Ui = "2.0.0", Fs = 256, Gi = Number.MAX_SAFE_INTEGER || /* istanbul ignore next */
|
|
3857
|
+
9007199254740991, Ji = 16, Mi = Fs - 6, _i = [
|
|
3851
3858
|
"major",
|
|
3852
3859
|
"premajor",
|
|
3853
3860
|
"minor",
|
|
@@ -3856,25 +3863,25 @@ const ji = "2.0.0", $s = 256, xi = Number.MAX_SAFE_INTEGER || /* istanbul ignore
|
|
|
3856
3863
|
"prepatch",
|
|
3857
3864
|
"prerelease"
|
|
3858
3865
|
];
|
|
3859
|
-
var
|
|
3860
|
-
MAX_LENGTH:
|
|
3861
|
-
MAX_SAFE_COMPONENT_LENGTH:
|
|
3862
|
-
MAX_SAFE_BUILD_LENGTH:
|
|
3863
|
-
MAX_SAFE_INTEGER:
|
|
3864
|
-
RELEASE_TYPES:
|
|
3865
|
-
SEMVER_SPEC_VERSION:
|
|
3866
|
+
var at = {
|
|
3867
|
+
MAX_LENGTH: Fs,
|
|
3868
|
+
MAX_SAFE_COMPONENT_LENGTH: Ji,
|
|
3869
|
+
MAX_SAFE_BUILD_LENGTH: Mi,
|
|
3870
|
+
MAX_SAFE_INTEGER: Gi,
|
|
3871
|
+
RELEASE_TYPES: _i,
|
|
3872
|
+
SEMVER_SPEC_VERSION: Ui,
|
|
3866
3873
|
FLAG_INCLUDE_PRERELEASE: 1,
|
|
3867
3874
|
FLAG_LOOSE: 2
|
|
3868
3875
|
};
|
|
3869
|
-
const
|
|
3876
|
+
const Ki = typeof process == "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...s) => console.error("SEMVER", ...s) : () => {
|
|
3870
3877
|
};
|
|
3871
|
-
var
|
|
3878
|
+
var ct = Ki;
|
|
3872
3879
|
(function(s, e) {
|
|
3873
3880
|
const {
|
|
3874
3881
|
MAX_SAFE_COMPONENT_LENGTH: t,
|
|
3875
3882
|
MAX_SAFE_BUILD_LENGTH: r,
|
|
3876
3883
|
MAX_LENGTH: o
|
|
3877
|
-
} =
|
|
3884
|
+
} = at, n = ct;
|
|
3878
3885
|
e = s.exports = {};
|
|
3879
3886
|
const i = e.re = [], a = e.safeRe = [], c = e.src = [], u = e.safeSrc = [], l = e.t = {};
|
|
3880
3887
|
let d = 0;
|
|
@@ -3882,42 +3889,42 @@ var at = Ji;
|
|
|
3882
3889
|
["\\s", 1],
|
|
3883
3890
|
["\\d", o],
|
|
3884
3891
|
[f, r]
|
|
3885
|
-
], R = (
|
|
3886
|
-
for (const [T,
|
|
3887
|
-
|
|
3888
|
-
return
|
|
3889
|
-
}, g = (
|
|
3892
|
+
], R = (x) => {
|
|
3893
|
+
for (const [T, B] of h)
|
|
3894
|
+
x = x.split(`${T}*`).join(`${T}{0,${B}}`).split(`${T}+`).join(`${T}{1,${B}}`);
|
|
3895
|
+
return x;
|
|
3896
|
+
}, g = (x, T, B) => {
|
|
3890
3897
|
const $ = R(T), M = d++;
|
|
3891
|
-
n(
|
|
3898
|
+
n(x, M, T), l[x] = M, c[M] = T, u[M] = $, i[M] = new RegExp(T, B ? "g" : void 0), a[M] = new RegExp($, B ? "g" : void 0);
|
|
3892
3899
|
};
|
|
3893
3900
|
g("NUMERICIDENTIFIER", "0|[1-9]\\d*"), g("NUMERICIDENTIFIERLOOSE", "\\d+"), g("NONNUMERICIDENTIFIER", `\\d*[a-zA-Z-]${f}*`), 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", `${f}+`), 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*$");
|
|
3894
|
-
})(
|
|
3895
|
-
var Ve =
|
|
3896
|
-
const
|
|
3897
|
-
var
|
|
3898
|
-
const
|
|
3899
|
-
const t =
|
|
3901
|
+
})(Tt, Tt.exports);
|
|
3902
|
+
var Ve = Tt.exports;
|
|
3903
|
+
const Hi = Object.freeze({ loose: !0 }), Wi = Object.freeze({}), qi = (s) => s ? typeof s != "object" ? Hi : s : Wi;
|
|
3904
|
+
var Mt = qi;
|
|
3905
|
+
const kr = /^[0-9]+$/, As = (s, e) => {
|
|
3906
|
+
const t = kr.test(s), r = kr.test(e);
|
|
3900
3907
|
return t && r && (s = +s, e = +e), s === e ? 0 : t && !r ? -1 : r && !t ? 1 : s < e ? -1 : 1;
|
|
3901
|
-
},
|
|
3902
|
-
var
|
|
3903
|
-
compareIdentifiers:
|
|
3904
|
-
rcompareIdentifiers:
|
|
3908
|
+
}, zi = (s, e) => As(e, s);
|
|
3909
|
+
var Ts = {
|
|
3910
|
+
compareIdentifiers: As,
|
|
3911
|
+
rcompareIdentifiers: zi
|
|
3905
3912
|
};
|
|
3906
|
-
const We =
|
|
3907
|
-
let
|
|
3913
|
+
const We = ct, { MAX_LENGTH: Pr, MAX_SAFE_INTEGER: qe } = at, { safeRe: Or, safeSrc: $r, t: ze } = Ve, Xi = Mt, { compareIdentifiers: me } = Ts;
|
|
3914
|
+
let Yi = class se {
|
|
3908
3915
|
constructor(e, t) {
|
|
3909
|
-
if (t =
|
|
3916
|
+
if (t = Xi(t), e instanceof se) {
|
|
3910
3917
|
if (e.loose === !!t.loose && e.includePrerelease === !!t.includePrerelease)
|
|
3911
3918
|
return e;
|
|
3912
3919
|
e = e.version;
|
|
3913
3920
|
} else if (typeof e != "string")
|
|
3914
3921
|
throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);
|
|
3915
|
-
if (e.length >
|
|
3922
|
+
if (e.length > Pr)
|
|
3916
3923
|
throw new TypeError(
|
|
3917
|
-
`version is longer than ${
|
|
3924
|
+
`version is longer than ${Pr} characters`
|
|
3918
3925
|
);
|
|
3919
3926
|
We("SemVer", e, t), this.options = t, this.loose = !!t.loose, this.includePrerelease = !!t.includePrerelease;
|
|
3920
|
-
const r = e.trim().match(t.loose ?
|
|
3927
|
+
const r = e.trim().match(t.loose ? Or[ze.LOOSE] : Or[ze.FULL]);
|
|
3921
3928
|
if (!r)
|
|
3922
3929
|
throw new TypeError(`Invalid Version: ${e}`);
|
|
3923
3930
|
if (this.raw = e, this.major = +r[1], this.minor = +r[2], this.patch = +r[3], this.major > qe || this.major < 0)
|
|
@@ -3996,7 +4003,7 @@ let qi = class se {
|
|
|
3996
4003
|
if (!t && r === !1)
|
|
3997
4004
|
throw new Error("invalid increment argument: identifier is empty");
|
|
3998
4005
|
if (t) {
|
|
3999
|
-
const o = new RegExp(`^${this.options.loose ?
|
|
4006
|
+
const o = new RegExp(`^${this.options.loose ? $r[ze.PRERELEASELOOSE] : $r[ze.PRERELEASE]}$`), n = `-${t}`.match(o);
|
|
4000
4007
|
if (!n || n[1] !== t)
|
|
4001
4008
|
throw new Error(`invalid identifier: ${t}`);
|
|
4002
4009
|
}
|
|
@@ -4054,43 +4061,43 @@ let qi = class se {
|
|
|
4054
4061
|
return this.raw = this.format(), this.build.length && (this.raw += `+${this.build.join(".")}`), this;
|
|
4055
4062
|
}
|
|
4056
4063
|
};
|
|
4057
|
-
var q =
|
|
4058
|
-
const
|
|
4059
|
-
if (s instanceof
|
|
4064
|
+
var q = Yi;
|
|
4065
|
+
const Ir = q, Qi = (s, e, t = !1) => {
|
|
4066
|
+
if (s instanceof Ir)
|
|
4060
4067
|
return s;
|
|
4061
4068
|
try {
|
|
4062
|
-
return new
|
|
4069
|
+
return new Ir(s, e);
|
|
4063
4070
|
} catch (r) {
|
|
4064
4071
|
if (!t)
|
|
4065
4072
|
return null;
|
|
4066
4073
|
throw r;
|
|
4067
4074
|
}
|
|
4068
4075
|
};
|
|
4069
|
-
var Ce =
|
|
4070
|
-
const Xi = Ce, Yi = (s, e) => {
|
|
4071
|
-
const t = Xi(s, e);
|
|
4072
|
-
return t ? t.version : null;
|
|
4073
|
-
};
|
|
4074
|
-
var Qi = Yi;
|
|
4076
|
+
var Ce = Qi;
|
|
4075
4077
|
const Zi = Ce, ea = (s, e) => {
|
|
4076
|
-
const t = Zi(s
|
|
4078
|
+
const t = Zi(s, e);
|
|
4077
4079
|
return t ? t.version : null;
|
|
4078
4080
|
};
|
|
4079
4081
|
var ta = ea;
|
|
4080
|
-
const
|
|
4082
|
+
const ra = Ce, sa = (s, e) => {
|
|
4083
|
+
const t = ra(s.trim().replace(/^[=v]+/, ""), e);
|
|
4084
|
+
return t ? t.version : null;
|
|
4085
|
+
};
|
|
4086
|
+
var oa = sa;
|
|
4087
|
+
const Fr = q, na = (s, e, t, r, o) => {
|
|
4081
4088
|
typeof t == "string" && (o = r, r = t, t = void 0);
|
|
4082
4089
|
try {
|
|
4083
|
-
return new
|
|
4084
|
-
s instanceof
|
|
4090
|
+
return new Fr(
|
|
4091
|
+
s instanceof Fr ? s.version : s,
|
|
4085
4092
|
t
|
|
4086
4093
|
).inc(e, r, o).version;
|
|
4087
4094
|
} catch {
|
|
4088
4095
|
return null;
|
|
4089
4096
|
}
|
|
4090
4097
|
};
|
|
4091
|
-
var
|
|
4092
|
-
const
|
|
4093
|
-
const t =
|
|
4098
|
+
var ia = na;
|
|
4099
|
+
const Ar = Ce, aa = (s, e) => {
|
|
4100
|
+
const t = Ar(s, null, !0), r = Ar(e, null, !0), o = t.compare(r);
|
|
4094
4101
|
if (o === 0)
|
|
4095
4102
|
return null;
|
|
4096
4103
|
const n = o > 0, i = n ? t : r, a = n ? r : t, c = !!i.prerelease.length;
|
|
@@ -4103,46 +4110,46 @@ const Ir = Ce, oa = (s, e) => {
|
|
|
4103
4110
|
const l = c ? "pre" : "";
|
|
4104
4111
|
return t.major !== r.major ? l + "major" : t.minor !== r.minor ? l + "minor" : t.patch !== r.patch ? l + "patch" : "prerelease";
|
|
4105
4112
|
};
|
|
4106
|
-
var na = oa;
|
|
4107
|
-
const ia = q, aa = (s, e) => new ia(s, e).major;
|
|
4108
4113
|
var ca = aa;
|
|
4109
|
-
const la = q, ua = (s, e) => new la(s, e).
|
|
4114
|
+
const la = q, ua = (s, e) => new la(s, e).major;
|
|
4110
4115
|
var da = ua;
|
|
4111
|
-
const pa = q, fa = (s, e) => new pa(s, e).
|
|
4116
|
+
const pa = q, fa = (s, e) => new pa(s, e).minor;
|
|
4112
4117
|
var ha = fa;
|
|
4113
|
-
const ga =
|
|
4114
|
-
|
|
4118
|
+
const ga = q, ma = (s, e) => new ga(s, e).patch;
|
|
4119
|
+
var va = ma;
|
|
4120
|
+
const ya = Ce, wa = (s, e) => {
|
|
4121
|
+
const t = ya(s, e);
|
|
4115
4122
|
return t && t.prerelease.length ? t.prerelease : null;
|
|
4116
4123
|
};
|
|
4117
|
-
var
|
|
4118
|
-
const
|
|
4119
|
-
var
|
|
4120
|
-
const
|
|
4121
|
-
var ba = Sa;
|
|
4122
|
-
const Ra = te, Ea = (s, e) => Ra(s, e, !0);
|
|
4124
|
+
var Sa = wa;
|
|
4125
|
+
const Tr = q, ba = (s, e, t) => new Tr(s, t).compare(new Tr(e, t));
|
|
4126
|
+
var ee = ba;
|
|
4127
|
+
const Ra = ee, Ea = (s, e, t) => Ra(e, s, t);
|
|
4123
4128
|
var Ca = Ea;
|
|
4124
|
-
const
|
|
4125
|
-
|
|
4129
|
+
const ka = ee, Pa = (s, e) => ka(s, e, !0);
|
|
4130
|
+
var Oa = Pa;
|
|
4131
|
+
const Lr = q, $a = (s, e, t) => {
|
|
4132
|
+
const r = new Lr(s, t), o = new Lr(e, t);
|
|
4126
4133
|
return r.compare(o) || r.compareBuild(o);
|
|
4127
4134
|
};
|
|
4128
|
-
var
|
|
4129
|
-
const
|
|
4130
|
-
var $a = Oa;
|
|
4131
|
-
const Ia = Mt, Fa = (s, e) => s.sort((t, r) => Ia(r, t, e));
|
|
4135
|
+
var _t = $a;
|
|
4136
|
+
const Ia = _t, Fa = (s, e) => s.sort((t, r) => Ia(t, r, e));
|
|
4132
4137
|
var Aa = Fa;
|
|
4133
|
-
const Ta =
|
|
4134
|
-
var
|
|
4135
|
-
const
|
|
4136
|
-
var
|
|
4137
|
-
const
|
|
4138
|
-
var
|
|
4139
|
-
const
|
|
4140
|
-
var
|
|
4141
|
-
const
|
|
4142
|
-
var
|
|
4143
|
-
const
|
|
4144
|
-
var Ht =
|
|
4145
|
-
const
|
|
4138
|
+
const Ta = _t, La = (s, e) => s.sort((t, r) => Ta(r, t, e));
|
|
4139
|
+
var Da = La;
|
|
4140
|
+
const Na = ee, Ba = (s, e, t) => Na(s, e, t) > 0;
|
|
4141
|
+
var lt = Ba;
|
|
4142
|
+
const ja = ee, xa = (s, e, t) => ja(s, e, t) < 0;
|
|
4143
|
+
var Kt = xa;
|
|
4144
|
+
const Va = ee, Ua = (s, e, t) => Va(s, e, t) === 0;
|
|
4145
|
+
var Ls = Ua;
|
|
4146
|
+
const Ga = ee, Ja = (s, e, t) => Ga(s, e, t) !== 0;
|
|
4147
|
+
var Ds = Ja;
|
|
4148
|
+
const Ma = ee, _a = (s, e, t) => Ma(s, e, t) >= 0;
|
|
4149
|
+
var Ht = _a;
|
|
4150
|
+
const Ka = ee, Ha = (s, e, t) => Ka(s, e, t) <= 0;
|
|
4151
|
+
var Wt = Ha;
|
|
4152
|
+
const Wa = Ls, qa = Ds, za = lt, Xa = Ht, Ya = Kt, Qa = Wt, Za = (s, e, t, r) => {
|
|
4146
4153
|
switch (e) {
|
|
4147
4154
|
case "===":
|
|
4148
4155
|
return typeof s == "object" && (s = s.version), typeof t == "object" && (t = t.version), s === t;
|
|
@@ -4151,24 +4158,24 @@ const _a = As, Ka = Ts, Ha = ct, Wa = Kt, qa = _t, za = Ht, Xa = (s, e, t, r) =>
|
|
|
4151
4158
|
case "":
|
|
4152
4159
|
case "=":
|
|
4153
4160
|
case "==":
|
|
4154
|
-
return
|
|
4161
|
+
return Wa(s, t, r);
|
|
4155
4162
|
case "!=":
|
|
4156
|
-
return
|
|
4163
|
+
return qa(s, t, r);
|
|
4157
4164
|
case ">":
|
|
4158
|
-
return
|
|
4165
|
+
return za(s, t, r);
|
|
4159
4166
|
case ">=":
|
|
4160
|
-
return
|
|
4167
|
+
return Xa(s, t, r);
|
|
4161
4168
|
case "<":
|
|
4162
|
-
return
|
|
4169
|
+
return Ya(s, t, r);
|
|
4163
4170
|
case "<=":
|
|
4164
|
-
return
|
|
4171
|
+
return Qa(s, t, r);
|
|
4165
4172
|
default:
|
|
4166
4173
|
throw new TypeError(`Invalid operator: ${e}`);
|
|
4167
4174
|
}
|
|
4168
4175
|
};
|
|
4169
|
-
var
|
|
4170
|
-
const
|
|
4171
|
-
if (s instanceof
|
|
4176
|
+
var Ns = Za;
|
|
4177
|
+
const ec = q, tc = Ce, { safeRe: Xe, t: Ye } = Ve, rc = (s, e) => {
|
|
4178
|
+
if (s instanceof ec)
|
|
4172
4179
|
return s;
|
|
4173
4180
|
if (typeof s == "number" && (s = String(s)), typeof s != "string")
|
|
4174
4181
|
return null;
|
|
@@ -4186,10 +4193,10 @@ const Ya = q, Qa = Ce, { safeRe: Xe, t: Ye } = Ve, Za = (s, e) => {
|
|
|
4186
4193
|
if (t === null)
|
|
4187
4194
|
return null;
|
|
4188
4195
|
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]}` : "";
|
|
4189
|
-
return
|
|
4196
|
+
return tc(`${r}.${o}.${n}${i}${a}`, e);
|
|
4190
4197
|
};
|
|
4191
|
-
var
|
|
4192
|
-
class
|
|
4198
|
+
var sc = rc;
|
|
4199
|
+
class oc {
|
|
4193
4200
|
constructor() {
|
|
4194
4201
|
this.max = 1e3, this.map = /* @__PURE__ */ new Map();
|
|
4195
4202
|
}
|
|
@@ -4212,10 +4219,10 @@ class tc {
|
|
|
4212
4219
|
return this;
|
|
4213
4220
|
}
|
|
4214
4221
|
}
|
|
4215
|
-
var
|
|
4216
|
-
function
|
|
4217
|
-
if (
|
|
4218
|
-
|
|
4222
|
+
var nc = oc, gt, Dr;
|
|
4223
|
+
function te() {
|
|
4224
|
+
if (Dr) return gt;
|
|
4225
|
+
Dr = 1;
|
|
4219
4226
|
const s = /\s+/g;
|
|
4220
4227
|
class e {
|
|
4221
4228
|
constructor(p, m) {
|
|
@@ -4231,7 +4238,7 @@ function re() {
|
|
|
4231
4238
|
this.set = [y];
|
|
4232
4239
|
else if (this.set.length > 1) {
|
|
4233
4240
|
for (const b of this.set)
|
|
4234
|
-
if (b.length === 1 &&
|
|
4241
|
+
if (b.length === 1 && x(b[0])) {
|
|
4235
4242
|
this.set = [b];
|
|
4236
4243
|
break;
|
|
4237
4244
|
}
|
|
@@ -4262,8 +4269,8 @@ function re() {
|
|
|
4262
4269
|
if (b)
|
|
4263
4270
|
return b;
|
|
4264
4271
|
const S = this.options.loose, E = S ? c[u.HYPHENRANGELOOSE] : c[u.HYPHENRANGE];
|
|
4265
|
-
p = p.replace(E,
|
|
4266
|
-
let O = p.split(" ").map((I) =>
|
|
4272
|
+
p = p.replace(E, D(this.options.includePrerelease)), i("hyphen replace", p), p = p.replace(c[u.COMPARATORTRIM], l), i("comparator trim", p), p = p.replace(c[u.TILDETRIM], d), i("tilde trim", p), p = p.replace(c[u.CARETTRIM], f), i("caret trim", p);
|
|
4273
|
+
let O = p.split(" ").map((I) => B(I, this.options)).join(" ").split(/\s+/).map((I) => Y(I, this.options));
|
|
4267
4274
|
S && (O = O.filter((I) => (i("loose invalid filter", I, this.options), !!I.match(c[u.COMPARATORLOOSE])))), i("range list", O);
|
|
4268
4275
|
const C = /* @__PURE__ */ new Map(), F = O.map((I) => new n(I, this.options));
|
|
4269
4276
|
for (const I of F) {
|
|
@@ -4272,8 +4279,8 @@ function re() {
|
|
|
4272
4279
|
C.set(I.value, I);
|
|
4273
4280
|
}
|
|
4274
4281
|
C.size > 1 && C.has("") && C.delete("");
|
|
4275
|
-
const
|
|
4276
|
-
return r.set(y,
|
|
4282
|
+
const V = [...C.values()];
|
|
4283
|
+
return r.set(y, V), V;
|
|
4277
4284
|
}
|
|
4278
4285
|
intersects(p, m) {
|
|
4279
4286
|
if (!(p instanceof e))
|
|
@@ -4291,33 +4298,33 @@ function re() {
|
|
|
4291
4298
|
return !1;
|
|
4292
4299
|
}
|
|
4293
4300
|
for (let m = 0; m < this.set.length; m++)
|
|
4294
|
-
if (
|
|
4301
|
+
if (W(this.set[m], p, this.options))
|
|
4295
4302
|
return !0;
|
|
4296
4303
|
return !1;
|
|
4297
4304
|
}
|
|
4298
4305
|
}
|
|
4299
|
-
|
|
4300
|
-
const t =
|
|
4306
|
+
gt = e;
|
|
4307
|
+
const t = nc, r = new t(), o = Mt, n = ut(), i = ct, a = q, {
|
|
4301
4308
|
safeRe: c,
|
|
4302
4309
|
t: u,
|
|
4303
4310
|
comparatorTrimReplace: l,
|
|
4304
4311
|
tildeTrimReplace: d,
|
|
4305
4312
|
caretTrimReplace: f
|
|
4306
|
-
} = Ve, { FLAG_INCLUDE_PRERELEASE: h, FLAG_LOOSE: R } =
|
|
4313
|
+
} = Ve, { FLAG_INCLUDE_PRERELEASE: h, FLAG_LOOSE: R } = at, g = (v) => v.value === "<0.0.0-0", x = (v) => v.value === "", T = (v, p) => {
|
|
4307
4314
|
let m = !0;
|
|
4308
4315
|
const y = v.slice();
|
|
4309
4316
|
let b = y.pop();
|
|
4310
4317
|
for (; m && y.length; )
|
|
4311
4318
|
m = y.every((S) => b.intersects(S, p)), b = y.pop();
|
|
4312
4319
|
return m;
|
|
4313
|
-
},
|
|
4320
|
+
}, B = (v, p) => (i("comp", v, p), v = L(v, p), i("caret", v), v = M(v, p), i("tildes", v), v = ce(v, p), i("xrange", v), v = ie(v, p), i("stars", v), v), $ = (v) => !v || v.toLowerCase() === "x" || v === "*", M = (v, p) => v.trim().split(/\s+/).map((m) => ge(m, p)).join(" "), ge = (v, p) => {
|
|
4314
4321
|
const m = p.loose ? c[u.TILDELOOSE] : c[u.TILDE];
|
|
4315
4322
|
return v.replace(m, (y, b, S, E, O) => {
|
|
4316
4323
|
i("tilde", v, y, b, S, E, O);
|
|
4317
4324
|
let C;
|
|
4318
4325
|
return $(b) ? C = "" : $(S) ? C = `>=${b}.0.0 <${+b + 1}.0.0-0` : $(E) ? C = `>=${b}.${S}.0 <${b}.${+S + 1}.0-0` : O ? (i("replaceTilde pr", O), C = `>=${b}.${S}.${E}-${O} <${b}.${+S + 1}.0-0`) : C = `>=${b}.${S}.${E} <${b}.${+S + 1}.0-0`, i("tilde return", C), C;
|
|
4319
4326
|
});
|
|
4320
|
-
}, L = (v, p) => v.trim().split(/\s+/).map((m) =>
|
|
4327
|
+
}, L = (v, p) => v.trim().split(/\s+/).map((m) => re(m, p)).join(" "), re = (v, p) => {
|
|
4321
4328
|
i("caret", v, p);
|
|
4322
4329
|
const m = p.loose ? c[u.CARETLOOSE] : c[u.CARET], y = p.includePrerelease ? "-0" : "";
|
|
4323
4330
|
return v.replace(m, (b, S, E, O, C) => {
|
|
@@ -4325,15 +4332,15 @@ function re() {
|
|
|
4325
4332
|
let F;
|
|
4326
4333
|
return $(S) ? F = "" : $(E) ? F = `>=${S}.0.0${y} <${+S + 1}.0.0-0` : $(O) ? S === "0" ? F = `>=${S}.${E}.0${y} <${S}.${+E + 1}.0-0` : F = `>=${S}.${E}.0${y} <${+S + 1}.0.0-0` : C ? (i("replaceCaret pr", C), S === "0" ? E === "0" ? F = `>=${S}.${E}.${O}-${C} <${S}.${E}.${+O + 1}-0` : F = `>=${S}.${E}.${O}-${C} <${S}.${+E + 1}.0-0` : F = `>=${S}.${E}.${O}-${C} <${+S + 1}.0.0-0`) : (i("no pr"), S === "0" ? E === "0" ? F = `>=${S}.${E}.${O}${y} <${S}.${E}.${+O + 1}-0` : F = `>=${S}.${E}.${O}${y} <${S}.${+E + 1}.0-0` : F = `>=${S}.${E}.${O} <${+S + 1}.0.0-0`), i("caret return", F), F;
|
|
4327
4334
|
});
|
|
4328
|
-
},
|
|
4335
|
+
}, ce = (v, p) => (i("replaceXRanges", v, p), v.split(/\s+/).map((m) => z(m, p)).join(" ")), z = (v, p) => {
|
|
4329
4336
|
v = v.trim();
|
|
4330
4337
|
const m = p.loose ? c[u.XRANGELOOSE] : c[u.XRANGE];
|
|
4331
4338
|
return v.replace(m, (y, b, S, E, O, C) => {
|
|
4332
4339
|
i("xRange", v, y, b, S, E, O, C);
|
|
4333
|
-
const F = $(S),
|
|
4334
|
-
return b === "=" &&
|
|
4340
|
+
const F = $(S), V = F || $(E), I = V || $(O), ae = I;
|
|
4341
|
+
return b === "=" && ae && (b = ""), C = p.includePrerelease ? "-0" : "", F ? b === ">" || b === "<" ? y = "<0.0.0-0" : y = "*" : b && ae ? (V && (E = 0), O = 0, b === ">" ? (b = ">=", V ? (S = +S + 1, E = 0, O = 0) : (E = +E + 1, O = 0)) : b === "<=" && (b = "<", V ? S = +S + 1 : E = +E + 1), b === "<" && (C = "-0"), y = `${b + S}.${E}.${O}${C}`) : V ? y = `>=${S}.0.0${C} <${+S + 1}.0.0-0` : I && (y = `>=${S}.${E}.0${C} <${S}.${+E + 1}.0-0`), i("xRange return", y), y;
|
|
4335
4342
|
});
|
|
4336
|
-
},
|
|
4343
|
+
}, ie = (v, p) => (i("replaceStars", v, p), v.trim().replace(c[u.STAR], "")), Y = (v, p) => (i("replaceGTE0", v, p), v.trim().replace(c[p.includePrerelease ? u.GTE0PRE : u.GTE0], "")), D = (v) => (p, m, y, b, S, E, O, C, F, V, I, ae) => ($(y) ? m = "" : $(b) ? m = `>=${y}.0.0${v ? "-0" : ""}` : $(S) ? m = `>=${y}.${b}.0${v ? "-0" : ""}` : E ? m = `>=${m}` : m = `>=${m}${v ? "-0" : ""}`, $(F) ? C = "" : $(V) ? C = `<${+F + 1}.0.0-0` : $(I) ? C = `<${F}.${+V + 1}.0-0` : ae ? C = `<=${F}.${V}.${I}-${ae}` : v ? C = `<${F}.${V}.${+I + 1}-0` : C = `<=${C}`, `${m} ${C}`.trim()), W = (v, p, m) => {
|
|
4337
4344
|
for (let y = 0; y < v.length; y++)
|
|
4338
4345
|
if (!v[y].test(p))
|
|
4339
4346
|
return !1;
|
|
@@ -4348,12 +4355,12 @@ function re() {
|
|
|
4348
4355
|
}
|
|
4349
4356
|
return !0;
|
|
4350
4357
|
};
|
|
4351
|
-
return
|
|
4358
|
+
return gt;
|
|
4352
4359
|
}
|
|
4353
|
-
var
|
|
4354
|
-
function
|
|
4355
|
-
if (
|
|
4356
|
-
|
|
4360
|
+
var mt, Nr;
|
|
4361
|
+
function ut() {
|
|
4362
|
+
if (Nr) return mt;
|
|
4363
|
+
Nr = 1;
|
|
4357
4364
|
const s = Symbol("SemVer ANY");
|
|
4358
4365
|
class e {
|
|
4359
4366
|
static get ANY() {
|
|
@@ -4393,62 +4400,62 @@ function lt() {
|
|
|
4393
4400
|
return this.operator === "" ? this.value === "" ? !0 : new c(l.value, d).test(this.value) : l.operator === "" ? l.value === "" ? !0 : new c(this.value, d).test(l.semver) : (d = t(d), d.includePrerelease && (this.value === "<0.0.0-0" || l.value === "<0.0.0-0") || !d.includePrerelease && (this.value.startsWith("<0.0.0") || l.value.startsWith("<0.0.0")) ? !1 : !!(this.operator.startsWith(">") && l.operator.startsWith(">") || this.operator.startsWith("<") && l.operator.startsWith("<") || this.semver.version === l.semver.version && this.operator.includes("=") && l.operator.includes("=") || n(this.semver, "<", l.semver, d) && this.operator.startsWith(">") && l.operator.startsWith("<") || n(this.semver, ">", l.semver, d) && this.operator.startsWith("<") && l.operator.startsWith(">")));
|
|
4394
4401
|
}
|
|
4395
4402
|
}
|
|
4396
|
-
|
|
4397
|
-
const t =
|
|
4398
|
-
return
|
|
4403
|
+
mt = e;
|
|
4404
|
+
const t = Mt, { safeRe: r, t: o } = Ve, n = Ns, i = ct, a = q, c = te();
|
|
4405
|
+
return mt;
|
|
4399
4406
|
}
|
|
4400
|
-
const
|
|
4407
|
+
const ic = te(), ac = (s, e, t) => {
|
|
4401
4408
|
try {
|
|
4402
|
-
e = new
|
|
4409
|
+
e = new ic(e, t);
|
|
4403
4410
|
} catch {
|
|
4404
4411
|
return !1;
|
|
4405
4412
|
}
|
|
4406
4413
|
return e.test(s);
|
|
4407
4414
|
};
|
|
4408
|
-
var
|
|
4409
|
-
const
|
|
4410
|
-
var
|
|
4411
|
-
const
|
|
4415
|
+
var dt = ac;
|
|
4416
|
+
const cc = te(), lc = (s, e) => new cc(s, e).set.map((t) => t.map((r) => r.value).join(" ").trim().split(" "));
|
|
4417
|
+
var uc = lc;
|
|
4418
|
+
const dc = q, pc = te(), fc = (s, e, t) => {
|
|
4412
4419
|
let r = null, o = null, n = null;
|
|
4413
4420
|
try {
|
|
4414
|
-
n = new
|
|
4421
|
+
n = new pc(e, t);
|
|
4415
4422
|
} catch {
|
|
4416
4423
|
return null;
|
|
4417
4424
|
}
|
|
4418
4425
|
return s.forEach((i) => {
|
|
4419
|
-
n.test(i) && (!r || o.compare(i) === -1) && (r = i, o = new
|
|
4426
|
+
n.test(i) && (!r || o.compare(i) === -1) && (r = i, o = new dc(r, t));
|
|
4420
4427
|
}), r;
|
|
4421
4428
|
};
|
|
4422
|
-
var
|
|
4423
|
-
const
|
|
4429
|
+
var hc = fc;
|
|
4430
|
+
const gc = q, mc = te(), vc = (s, e, t) => {
|
|
4424
4431
|
let r = null, o = null, n = null;
|
|
4425
4432
|
try {
|
|
4426
|
-
n = new
|
|
4433
|
+
n = new mc(e, t);
|
|
4427
4434
|
} catch {
|
|
4428
4435
|
return null;
|
|
4429
4436
|
}
|
|
4430
4437
|
return s.forEach((i) => {
|
|
4431
|
-
n.test(i) && (!r || o.compare(i) === 1) && (r = i, o = new
|
|
4438
|
+
n.test(i) && (!r || o.compare(i) === 1) && (r = i, o = new gc(r, t));
|
|
4432
4439
|
}), r;
|
|
4433
4440
|
};
|
|
4434
|
-
var
|
|
4435
|
-
const
|
|
4436
|
-
s = new
|
|
4437
|
-
let t = new
|
|
4438
|
-
if (s.test(t) || (t = new
|
|
4441
|
+
var yc = vc;
|
|
4442
|
+
const vt = q, wc = te(), Br = lt, Sc = (s, e) => {
|
|
4443
|
+
s = new wc(s, e);
|
|
4444
|
+
let t = new vt("0.0.0");
|
|
4445
|
+
if (s.test(t) || (t = new vt("0.0.0-0"), s.test(t)))
|
|
4439
4446
|
return t;
|
|
4440
4447
|
t = null;
|
|
4441
4448
|
for (let r = 0; r < s.set.length; ++r) {
|
|
4442
4449
|
const o = s.set[r];
|
|
4443
4450
|
let n = null;
|
|
4444
4451
|
o.forEach((i) => {
|
|
4445
|
-
const a = new
|
|
4452
|
+
const a = new vt(i.semver.version);
|
|
4446
4453
|
switch (i.operator) {
|
|
4447
4454
|
case ">":
|
|
4448
4455
|
a.prerelease.length === 0 ? a.patch++ : a.prerelease.push(0), a.raw = a.format();
|
|
4449
4456
|
case "":
|
|
4450
4457
|
case ">=":
|
|
4451
|
-
(!n ||
|
|
4458
|
+
(!n || Br(a, n)) && (n = a);
|
|
4452
4459
|
break;
|
|
4453
4460
|
case "<":
|
|
4454
4461
|
case "<=":
|
|
@@ -4456,39 +4463,39 @@ const mt = q, mc = re(), Dr = ct, vc = (s, e) => {
|
|
|
4456
4463
|
default:
|
|
4457
4464
|
throw new Error(`Unexpected operation: ${i.operator}`);
|
|
4458
4465
|
}
|
|
4459
|
-
}), n && (!t ||
|
|
4466
|
+
}), n && (!t || Br(t, n)) && (t = n);
|
|
4460
4467
|
}
|
|
4461
4468
|
return t && s.test(t) ? t : null;
|
|
4462
4469
|
};
|
|
4463
|
-
var
|
|
4464
|
-
const
|
|
4470
|
+
var bc = Sc;
|
|
4471
|
+
const Rc = te(), Ec = (s, e) => {
|
|
4465
4472
|
try {
|
|
4466
|
-
return new
|
|
4473
|
+
return new Rc(s, e).range || "*";
|
|
4467
4474
|
} catch {
|
|
4468
4475
|
return null;
|
|
4469
4476
|
}
|
|
4470
4477
|
};
|
|
4471
|
-
var
|
|
4472
|
-
const
|
|
4473
|
-
s = new
|
|
4478
|
+
var Cc = Ec;
|
|
4479
|
+
const kc = q, Bs = ut(), { ANY: Pc } = Bs, Oc = te(), $c = dt, jr = lt, xr = Kt, Ic = Wt, Fc = Ht, Ac = (s, e, t, r) => {
|
|
4480
|
+
s = new kc(s, r), e = new Oc(e, r);
|
|
4474
4481
|
let o, n, i, a, c;
|
|
4475
4482
|
switch (t) {
|
|
4476
4483
|
case ">":
|
|
4477
|
-
o =
|
|
4484
|
+
o = jr, n = Ic, i = xr, a = ">", c = ">=";
|
|
4478
4485
|
break;
|
|
4479
4486
|
case "<":
|
|
4480
|
-
o =
|
|
4487
|
+
o = xr, n = Fc, i = jr, a = "<", c = "<=";
|
|
4481
4488
|
break;
|
|
4482
4489
|
default:
|
|
4483
4490
|
throw new TypeError('Must provide a hilo val of "<" or ">"');
|
|
4484
4491
|
}
|
|
4485
|
-
if (
|
|
4492
|
+
if ($c(s, e, r))
|
|
4486
4493
|
return !1;
|
|
4487
4494
|
for (let u = 0; u < e.set.length; ++u) {
|
|
4488
4495
|
const l = e.set[u];
|
|
4489
4496
|
let d = null, f = null;
|
|
4490
4497
|
if (l.forEach((h) => {
|
|
4491
|
-
h.semver ===
|
|
4498
|
+
h.semver === Pc && (h = new Bs(">=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);
|
|
4492
4499
|
}), d.operator === a || d.operator === c || (!f.operator || f.operator === a) && n(s, f.semver))
|
|
4493
4500
|
return !1;
|
|
4494
4501
|
if (f.operator === c && i(s, f.semver))
|
|
@@ -4496,20 +4503,20 @@ const Rc = q, Ds = lt(), { ANY: Ec } = Ds, Cc = re(), kc = ut, Nr = ct, Br = _t,
|
|
|
4496
4503
|
}
|
|
4497
4504
|
return !0;
|
|
4498
4505
|
};
|
|
4499
|
-
var
|
|
4500
|
-
const
|
|
4501
|
-
var Ac = Fc;
|
|
4502
|
-
const Tc = Wt, Lc = (s, e, t) => Tc(s, e, "<", t);
|
|
4506
|
+
var qt = Ac;
|
|
4507
|
+
const Tc = qt, Lc = (s, e, t) => Tc(s, e, ">", t);
|
|
4503
4508
|
var Dc = Lc;
|
|
4504
|
-
const
|
|
4505
|
-
var
|
|
4506
|
-
const
|
|
4507
|
-
var Vc =
|
|
4509
|
+
const Nc = qt, Bc = (s, e, t) => Nc(s, e, "<", t);
|
|
4510
|
+
var jc = Bc;
|
|
4511
|
+
const Vr = te(), xc = (s, e, t) => (s = new Vr(s, t), e = new Vr(e, t), s.intersects(e, t));
|
|
4512
|
+
var Vc = xc;
|
|
4513
|
+
const Uc = dt, Gc = ee;
|
|
4514
|
+
var Jc = (s, e, t) => {
|
|
4508
4515
|
const r = [];
|
|
4509
4516
|
let o = null, n = null;
|
|
4510
|
-
const i = s.sort((l, d) =>
|
|
4517
|
+
const i = s.sort((l, d) => Gc(l, d, t));
|
|
4511
4518
|
for (const l of i)
|
|
4512
|
-
|
|
4519
|
+
Uc(l, e, t) ? (n = l, o || (o = l)) : (n && r.push([o, n]), n = null, o = null);
|
|
4513
4520
|
o && r.push([o, null]);
|
|
4514
4521
|
const a = [];
|
|
4515
4522
|
for (const [l, d] of r)
|
|
@@ -4517,14 +4524,14 @@ var Vc = (s, e, t) => {
|
|
|
4517
4524
|
const c = a.join(" || "), u = typeof e.raw == "string" ? e.raw : String(e);
|
|
4518
4525
|
return c.length < u.length ? c : e;
|
|
4519
4526
|
};
|
|
4520
|
-
const
|
|
4527
|
+
const Ur = te(), zt = ut(), { ANY: yt } = zt, Pe = dt, Xt = ee, Mc = (s, e, t = {}) => {
|
|
4521
4528
|
if (s === e)
|
|
4522
4529
|
return !0;
|
|
4523
|
-
s = new
|
|
4530
|
+
s = new Ur(s, t), e = new Ur(e, t);
|
|
4524
4531
|
let r = !1;
|
|
4525
4532
|
e: for (const o of s.set) {
|
|
4526
4533
|
for (const n of e.set) {
|
|
4527
|
-
const i =
|
|
4534
|
+
const i = Kc(o, n, t);
|
|
4528
4535
|
if (r = r || i !== null, i)
|
|
4529
4536
|
continue e;
|
|
4530
4537
|
}
|
|
@@ -4532,28 +4539,28 @@ const xr = re(), qt = lt(), { ANY: vt } = qt, Pe = ut, zt = te, Uc = (s, e, t =
|
|
|
4532
4539
|
return !1;
|
|
4533
4540
|
}
|
|
4534
4541
|
return !0;
|
|
4535
|
-
},
|
|
4542
|
+
}, _c = [new zt(">=0.0.0-0")], Gr = [new zt(">=0.0.0")], Kc = (s, e, t) => {
|
|
4536
4543
|
if (s === e)
|
|
4537
4544
|
return !0;
|
|
4538
|
-
if (s.length === 1 && s[0].semver ===
|
|
4539
|
-
if (e.length === 1 && e[0].semver ===
|
|
4545
|
+
if (s.length === 1 && s[0].semver === yt) {
|
|
4546
|
+
if (e.length === 1 && e[0].semver === yt)
|
|
4540
4547
|
return !0;
|
|
4541
|
-
t.includePrerelease ? s =
|
|
4548
|
+
t.includePrerelease ? s = _c : s = Gr;
|
|
4542
4549
|
}
|
|
4543
|
-
if (e.length === 1 && e[0].semver ===
|
|
4550
|
+
if (e.length === 1 && e[0].semver === yt) {
|
|
4544
4551
|
if (t.includePrerelease)
|
|
4545
4552
|
return !0;
|
|
4546
|
-
e =
|
|
4553
|
+
e = Gr;
|
|
4547
4554
|
}
|
|
4548
4555
|
const r = /* @__PURE__ */ new Set();
|
|
4549
4556
|
let o, n;
|
|
4550
4557
|
for (const h of s)
|
|
4551
|
-
h.operator === ">" || h.operator === ">=" ? o =
|
|
4558
|
+
h.operator === ">" || h.operator === ">=" ? o = Jr(o, h, t) : h.operator === "<" || h.operator === "<=" ? n = Mr(n, h, t) : r.add(h.semver);
|
|
4552
4559
|
if (r.size > 1)
|
|
4553
4560
|
return null;
|
|
4554
4561
|
let i;
|
|
4555
4562
|
if (o && n) {
|
|
4556
|
-
if (i =
|
|
4563
|
+
if (i = Xt(o.semver, n.semver, t), i > 0)
|
|
4557
4564
|
return null;
|
|
4558
4565
|
if (i === 0 && (o.operator !== ">=" || n.operator !== "<="))
|
|
4559
4566
|
return null;
|
|
@@ -4571,14 +4578,14 @@ const xr = re(), qt = lt(), { ANY: vt } = qt, Pe = ut, zt = te, Uc = (s, e, t =
|
|
|
4571
4578
|
for (const h of e) {
|
|
4572
4579
|
if (l = l || h.operator === ">" || h.operator === ">=", u = u || h.operator === "<" || h.operator === "<=", o) {
|
|
4573
4580
|
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 === ">=") {
|
|
4574
|
-
if (a =
|
|
4581
|
+
if (a = Jr(o, h, t), a === h && a !== o)
|
|
4575
4582
|
return !1;
|
|
4576
4583
|
} else if (o.operator === ">=" && !Pe(o.semver, String(h), t))
|
|
4577
4584
|
return !1;
|
|
4578
4585
|
}
|
|
4579
4586
|
if (n) {
|
|
4580
4587
|
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 === "<=") {
|
|
4581
|
-
if (c =
|
|
4588
|
+
if (c = Mr(n, h, t), c === h && c !== n)
|
|
4582
4589
|
return !1;
|
|
4583
4590
|
} else if (n.operator === "<=" && !Pe(n.semver, String(h), t))
|
|
4584
4591
|
return !1;
|
|
@@ -4587,72 +4594,72 @@ const xr = re(), qt = lt(), { ANY: vt } = qt, Pe = ut, zt = te, Uc = (s, e, t =
|
|
|
4587
4594
|
return !1;
|
|
4588
4595
|
}
|
|
4589
4596
|
return !(o && u && !n && i !== 0 || n && l && !o && i !== 0 || f || d);
|
|
4590
|
-
},
|
|
4597
|
+
}, Jr = (s, e, t) => {
|
|
4591
4598
|
if (!s)
|
|
4592
4599
|
return e;
|
|
4593
|
-
const r =
|
|
4600
|
+
const r = Xt(s.semver, e.semver, t);
|
|
4594
4601
|
return r > 0 ? s : r < 0 || e.operator === ">" && s.operator === ">=" ? e : s;
|
|
4595
|
-
},
|
|
4602
|
+
}, Mr = (s, e, t) => {
|
|
4596
4603
|
if (!s)
|
|
4597
4604
|
return e;
|
|
4598
|
-
const r =
|
|
4605
|
+
const r = Xt(s.semver, e.semver, t);
|
|
4599
4606
|
return r < 0 ? s : r > 0 || e.operator === "<" && s.operator === "<=" ? e : s;
|
|
4600
4607
|
};
|
|
4601
|
-
var
|
|
4602
|
-
const
|
|
4603
|
-
var
|
|
4604
|
-
parse:
|
|
4605
|
-
valid:
|
|
4606
|
-
clean:
|
|
4607
|
-
inc:
|
|
4608
|
-
diff:
|
|
4609
|
-
major:
|
|
4610
|
-
minor:
|
|
4611
|
-
patch:
|
|
4612
|
-
prerelease:
|
|
4613
|
-
compare:
|
|
4614
|
-
rcompare:
|
|
4615
|
-
compareLoose:
|
|
4616
|
-
compareBuild:
|
|
4617
|
-
sort:
|
|
4618
|
-
rsort:
|
|
4619
|
-
gt:
|
|
4620
|
-
lt:
|
|
4621
|
-
eq:
|
|
4622
|
-
neq:
|
|
4623
|
-
gte:
|
|
4624
|
-
lte:
|
|
4625
|
-
cmp:
|
|
4626
|
-
coerce:
|
|
4627
|
-
Comparator:
|
|
4628
|
-
Range:
|
|
4629
|
-
satisfies:
|
|
4630
|
-
toComparators:
|
|
4631
|
-
maxSatisfying:
|
|
4632
|
-
minSatisfying:
|
|
4633
|
-
minVersion:
|
|
4634
|
-
validRange:
|
|
4635
|
-
outside:
|
|
4636
|
-
gtr:
|
|
4637
|
-
ltr:
|
|
4638
|
-
intersects:
|
|
4639
|
-
simplifyRange:
|
|
4640
|
-
subset:
|
|
4641
|
-
SemVer:
|
|
4642
|
-
re:
|
|
4643
|
-
src:
|
|
4644
|
-
tokens:
|
|
4645
|
-
SEMVER_SPEC_VERSION:
|
|
4646
|
-
RELEASE_TYPES:
|
|
4647
|
-
compareIdentifiers:
|
|
4648
|
-
rcompareIdentifiers:
|
|
4608
|
+
var Hc = Mc;
|
|
4609
|
+
const wt = Ve, _r = at, Wc = q, Kr = Ts, qc = Ce, zc = ta, Xc = oa, Yc = ia, Qc = ca, Zc = da, el = ha, tl = va, rl = Sa, sl = ee, ol = Ca, nl = Oa, il = _t, al = Aa, cl = Da, ll = lt, ul = Kt, dl = Ls, pl = Ds, fl = Ht, hl = Wt, gl = Ns, ml = sc, vl = ut(), yl = te(), wl = dt, Sl = uc, bl = hc, Rl = yc, El = bc, Cl = Cc, kl = qt, Pl = Dc, Ol = jc, $l = Vc, Il = Jc, Fl = Hc;
|
|
4610
|
+
var Al = {
|
|
4611
|
+
parse: qc,
|
|
4612
|
+
valid: zc,
|
|
4613
|
+
clean: Xc,
|
|
4614
|
+
inc: Yc,
|
|
4615
|
+
diff: Qc,
|
|
4616
|
+
major: Zc,
|
|
4617
|
+
minor: el,
|
|
4618
|
+
patch: tl,
|
|
4619
|
+
prerelease: rl,
|
|
4620
|
+
compare: sl,
|
|
4621
|
+
rcompare: ol,
|
|
4622
|
+
compareLoose: nl,
|
|
4623
|
+
compareBuild: il,
|
|
4624
|
+
sort: al,
|
|
4625
|
+
rsort: cl,
|
|
4626
|
+
gt: ll,
|
|
4627
|
+
lt: ul,
|
|
4628
|
+
eq: dl,
|
|
4629
|
+
neq: pl,
|
|
4630
|
+
gte: fl,
|
|
4631
|
+
lte: hl,
|
|
4632
|
+
cmp: gl,
|
|
4633
|
+
coerce: ml,
|
|
4634
|
+
Comparator: vl,
|
|
4635
|
+
Range: yl,
|
|
4636
|
+
satisfies: wl,
|
|
4637
|
+
toComparators: Sl,
|
|
4638
|
+
maxSatisfying: bl,
|
|
4639
|
+
minSatisfying: Rl,
|
|
4640
|
+
minVersion: El,
|
|
4641
|
+
validRange: Cl,
|
|
4642
|
+
outside: kl,
|
|
4643
|
+
gtr: Pl,
|
|
4644
|
+
ltr: Ol,
|
|
4645
|
+
intersects: $l,
|
|
4646
|
+
simplifyRange: Il,
|
|
4647
|
+
subset: Fl,
|
|
4648
|
+
SemVer: Wc,
|
|
4649
|
+
re: wt.re,
|
|
4650
|
+
src: wt.src,
|
|
4651
|
+
tokens: wt.t,
|
|
4652
|
+
SEMVER_SPEC_VERSION: _r.SEMVER_SPEC_VERSION,
|
|
4653
|
+
RELEASE_TYPES: _r.RELEASE_TYPES,
|
|
4654
|
+
compareIdentifiers: Kr.compareIdentifiers,
|
|
4655
|
+
rcompareIdentifiers: Kr.rcompareIdentifiers
|
|
4649
4656
|
};
|
|
4650
|
-
const
|
|
4657
|
+
const Tl = /* @__PURE__ */ Vi(Al), Ll = {
|
|
4651
4658
|
minDelay: 1500
|
|
4652
|
-
},
|
|
4653
|
-
class
|
|
4659
|
+
}, Dl = "__no_updates__";
|
|
4660
|
+
class Nl extends lo {
|
|
4654
4661
|
constructor(t, r, o = {}) {
|
|
4655
|
-
super({ ...o, ...
|
|
4662
|
+
super({ ...o, ...Ll }, r);
|
|
4656
4663
|
w(this, "http");
|
|
4657
4664
|
w(this, "preferredUpdateChannel");
|
|
4658
4665
|
this.registryProvider = t, this.http = o.http, this.preferredUpdateChannel = o.preferredUpdateChannel;
|
|
@@ -4664,9 +4671,9 @@ class Tl extends ao {
|
|
|
4664
4671
|
case "dev-v2":
|
|
4665
4672
|
return `dev_2_${t.currentSpec.folder}_${t.currentSpec.mtime}`;
|
|
4666
4673
|
case "from-registry-v2":
|
|
4667
|
-
return `from_registry_v2_${
|
|
4674
|
+
return `from_registry_v2_${N(t)}`;
|
|
4668
4675
|
default:
|
|
4669
|
-
return
|
|
4676
|
+
return Dl;
|
|
4670
4677
|
}
|
|
4671
4678
|
}
|
|
4672
4679
|
async readValue(t) {
|
|
@@ -4676,16 +4683,16 @@ class Tl extends ao {
|
|
|
4676
4683
|
switch (n.type) {
|
|
4677
4684
|
case "dev-v1":
|
|
4678
4685
|
try {
|
|
4679
|
-
const i = await
|
|
4686
|
+
const i = await ns(n.folder);
|
|
4680
4687
|
return i === n.mtime ? { suggestions: [] } : { mainSuggestion: { ...n, mtime: i }, suggestions: [] };
|
|
4681
4688
|
} catch (i) {
|
|
4682
4689
|
return this.logger.warn(i), { suggestions: [] };
|
|
4683
4690
|
}
|
|
4684
4691
|
case "dev-v2":
|
|
4685
4692
|
try {
|
|
4686
|
-
const i = await
|
|
4693
|
+
const i = await Rt(n.folder, this.logger);
|
|
4687
4694
|
if (i === void 0) return { suggestions: [] };
|
|
4688
|
-
const a = await
|
|
4695
|
+
const a = await jt(i);
|
|
4689
4696
|
return a === n.mtime ? { suggestions: [] } : { mainSuggestion: { ...n, mtime: a }, suggestions: [] };
|
|
4690
4697
|
} catch (i) {
|
|
4691
4698
|
return this.logger.warn(i), { suggestions: [] };
|
|
@@ -4702,7 +4709,7 @@ class Tl extends ao {
|
|
|
4702
4709
|
else {
|
|
4703
4710
|
if (await c.getLatestOverview(n.id, Fe) === void 0)
|
|
4704
4711
|
return this.logger.error(
|
|
4705
|
-
`No "any" channel record for ${
|
|
4712
|
+
`No "any" channel record for ${Ks(n.id)}`
|
|
4706
4713
|
), { suggestions: [] };
|
|
4707
4714
|
u = Fe;
|
|
4708
4715
|
}
|
|
@@ -4727,7 +4734,7 @@ class Tl extends ao {
|
|
|
4727
4734
|
update: { ...n, id: { ...n.id, version: g } }
|
|
4728
4735
|
}));
|
|
4729
4736
|
if (d === void 0) return { suggestions: f };
|
|
4730
|
-
if (a !== void 0 &&
|
|
4737
|
+
if (a !== void 0 && Tl.lte(d, a))
|
|
4731
4738
|
return { suggestions: f };
|
|
4732
4739
|
const h = {
|
|
4733
4740
|
...n,
|
|
@@ -4751,10 +4758,10 @@ class Tl extends ao {
|
|
|
4751
4758
|
}
|
|
4752
4759
|
}
|
|
4753
4760
|
resultsEqual(t, r) {
|
|
4754
|
-
return
|
|
4761
|
+
return N(t) === N(r);
|
|
4755
4762
|
}
|
|
4756
4763
|
}
|
|
4757
|
-
class
|
|
4764
|
+
class Hr {
|
|
4758
4765
|
constructor() {
|
|
4759
4766
|
w(this, "resources", /* @__PURE__ */ new Map());
|
|
4760
4767
|
}
|
|
@@ -4786,7 +4793,7 @@ class _r {
|
|
|
4786
4793
|
}
|
|
4787
4794
|
}
|
|
4788
4795
|
let Oe;
|
|
4789
|
-
function
|
|
4796
|
+
function ue() {
|
|
4790
4797
|
return Oe || (Oe = {
|
|
4791
4798
|
logPFrameRequests: process.env.MI_LOG_PFRAMES !== void 0,
|
|
4792
4799
|
dumpInitialTreeState: process.env.MI_DUMP_INITIAL_TREE_STATE !== void 0
|
|
@@ -4795,8 +4802,8 @@ function le() {
|
|
|
4795
4802
|
function De(s) {
|
|
4796
4803
|
return String(s.id);
|
|
4797
4804
|
}
|
|
4798
|
-
const
|
|
4799
|
-
function
|
|
4805
|
+
const Bl = ["Int", "Long", "Float", "Double", "String", "Bytes"];
|
|
4806
|
+
function St(s) {
|
|
4800
4807
|
const e = [], t = [];
|
|
4801
4808
|
for (const r of s)
|
|
4802
4809
|
r.type === "bySingleColumn" ? (e.push(r), t.push({
|
|
@@ -4812,7 +4819,7 @@ function wt(s) {
|
|
|
4812
4819
|
return t;
|
|
4813
4820
|
}
|
|
4814
4821
|
const $e = (s, e) => typeof e == "bigint" ? e.toString() : e;
|
|
4815
|
-
class
|
|
4822
|
+
class jl {
|
|
4816
4823
|
constructor(e, t, r, o) {
|
|
4817
4824
|
w(this, "rustPFrame");
|
|
4818
4825
|
w(this, "blobIdToResource", /* @__PURE__ */ new Map());
|
|
@@ -4847,18 +4854,18 @@ class Dl {
|
|
|
4847
4854
|
}
|
|
4848
4855
|
};
|
|
4849
4856
|
for (const a of o)
|
|
4850
|
-
for (const c of
|
|
4857
|
+
for (const c of In(a.data))
|
|
4851
4858
|
this.blobIdToResource.set(De(c), c);
|
|
4852
4859
|
const i = [
|
|
4853
4860
|
...new Map(o.map((a) => ({
|
|
4854
4861
|
...a,
|
|
4855
|
-
data:
|
|
4862
|
+
data: Fn(a.data, De)
|
|
4856
4863
|
})).map(
|
|
4857
|
-
(a) => [
|
|
4864
|
+
(a) => [N(a), a]
|
|
4858
4865
|
)).values()
|
|
4859
4866
|
];
|
|
4860
4867
|
try {
|
|
4861
|
-
const a = new
|
|
4868
|
+
const a = new Fo(ue().logPFrameRequests ? n : void 0);
|
|
4862
4869
|
a.setDataSource(this);
|
|
4863
4870
|
for (const c of i)
|
|
4864
4871
|
a.addColumnSpec(c.id, c.spec), a.setColumnData(c.id, c.data);
|
|
@@ -4881,7 +4888,7 @@ class Dl {
|
|
|
4881
4888
|
this.rustPFrame.dispose();
|
|
4882
4889
|
}
|
|
4883
4890
|
}
|
|
4884
|
-
class
|
|
4891
|
+
class xl {
|
|
4885
4892
|
constructor(e) {
|
|
4886
4893
|
this.table = e;
|
|
4887
4894
|
}
|
|
@@ -4889,42 +4896,42 @@ class Nl {
|
|
|
4889
4896
|
this.table.then((e) => e.dispose());
|
|
4890
4897
|
}
|
|
4891
4898
|
}
|
|
4892
|
-
class
|
|
4899
|
+
class Vl {
|
|
4893
4900
|
constructor(e, t) {
|
|
4894
4901
|
w(this, "pFrames");
|
|
4895
4902
|
w(this, "pTables");
|
|
4896
4903
|
w(this, "blobContentCache");
|
|
4897
4904
|
this.blobDriver = e, this.logger = t;
|
|
4898
|
-
const r = new
|
|
4905
|
+
const r = new ts({
|
|
4899
4906
|
maxSize: 1e9,
|
|
4900
4907
|
// 1Gb
|
|
4901
|
-
fetchMethod: async (o) => await
|
|
4908
|
+
fetchMethod: async (o) => await Zr.readFile(o),
|
|
4902
4909
|
sizeCalculation: (o) => o.length
|
|
4903
4910
|
});
|
|
4904
|
-
this.blobContentCache = r, this.pFrames = new class extends
|
|
4911
|
+
this.blobContentCache = r, this.pFrames = new class extends Hr {
|
|
4905
4912
|
constructor(o, n) {
|
|
4906
4913
|
super(), this.blobDriver = o, this.logger = n;
|
|
4907
4914
|
}
|
|
4908
4915
|
createNewResource(o) {
|
|
4909
|
-
return
|
|
4916
|
+
return ue().logPFrameRequests && t.info(
|
|
4910
4917
|
`PFrame creation (pFrameHandle = ${this.calculateParamsKey(o)}): ${JSON.stringify(o, $e)}`
|
|
4911
|
-
), new
|
|
4918
|
+
), new jl(this.blobDriver, this.logger, r, o);
|
|
4912
4919
|
}
|
|
4913
4920
|
calculateParamsKey(o) {
|
|
4914
|
-
return
|
|
4921
|
+
return Gl(o);
|
|
4915
4922
|
}
|
|
4916
|
-
}(this.blobDriver, this.logger), this.pTables = new class extends
|
|
4923
|
+
}(this.blobDriver, this.logger), this.pTables = new class extends Hr {
|
|
4917
4924
|
constructor(o) {
|
|
4918
4925
|
super(), this.pFrames = o;
|
|
4919
4926
|
}
|
|
4920
4927
|
createNewResource(o) {
|
|
4921
4928
|
const n = o.pFrameHandle;
|
|
4922
|
-
|
|
4929
|
+
ue().logPFrameRequests && t.info(
|
|
4923
4930
|
`PTable creation (pTableHandle = ${this.calculateParamsKey(o)}): ${JSON.stringify(o, $e)}`
|
|
4924
4931
|
);
|
|
4925
4932
|
const i = this.pFrames.getByKey(n).rustPFrame.createTable({
|
|
4926
4933
|
src: Ne(o.def.src),
|
|
4927
|
-
filters:
|
|
4934
|
+
filters: St(o.def.filters)
|
|
4928
4935
|
}, o.signal).then(async (a) => {
|
|
4929
4936
|
if (o.def.sorting.length === 0) return a;
|
|
4930
4937
|
try {
|
|
@@ -4933,10 +4940,10 @@ class Bl {
|
|
|
4933
4940
|
a.dispose();
|
|
4934
4941
|
}
|
|
4935
4942
|
});
|
|
4936
|
-
return new
|
|
4943
|
+
return new xl(i);
|
|
4937
4944
|
}
|
|
4938
4945
|
calculateParamsKey(o) {
|
|
4939
|
-
return
|
|
4946
|
+
return Ul(o);
|
|
4940
4947
|
}
|
|
4941
4948
|
}(this.pFrames);
|
|
4942
4949
|
}
|
|
@@ -4944,19 +4951,19 @@ class Bl {
|
|
|
4944
4951
|
// Internal / Config API Methods
|
|
4945
4952
|
//
|
|
4946
4953
|
createPFrame(e, t) {
|
|
4947
|
-
const r = e.filter((n) =>
|
|
4948
|
-
(n) =>
|
|
4954
|
+
const r = e.filter((n) => Bl.find((i) => i === n.spec.valueType)).map(
|
|
4955
|
+
(n) => pe(
|
|
4949
4956
|
n,
|
|
4950
|
-
(i) =>
|
|
4957
|
+
(i) => co(i) ? Bn(i) : zr(i) ? Xr(i, (a) => a.resourceInfo) : jn(n.spec, i)
|
|
4951
4958
|
)
|
|
4952
4959
|
), o = this.pFrames.acquire(r);
|
|
4953
4960
|
return t.addOnDestroy(o.unref), o.key;
|
|
4954
4961
|
}
|
|
4955
4962
|
createPTable(e, t, r) {
|
|
4956
|
-
const o = this.createPFrame(
|
|
4957
|
-
return
|
|
4963
|
+
const o = this.createPFrame(_s(e.src), t), n = bt(e, (a) => a.id), i = this.pTables.acquire({ def: n, pFrameHandle: o, signal: r });
|
|
4964
|
+
return ue().logPFrameRequests && this.logger.info(
|
|
4958
4965
|
`Create PTable call (pFrameHandle = ${o}; pTableHandle = ${JSON.stringify(i)}): ${JSON.stringify(
|
|
4959
|
-
|
|
4966
|
+
bt(e, (a) => a.spec),
|
|
4960
4967
|
$e
|
|
4961
4968
|
)}`
|
|
4962
4969
|
), t.addOnDestroy(i.unref), i.key;
|
|
@@ -4970,7 +4977,7 @@ class Bl {
|
|
|
4970
4977
|
compatibleWith: t.compatibleWith.length !== 0 ? [{
|
|
4971
4978
|
axesSpec: [
|
|
4972
4979
|
...new Map(t.compatibleWith.map(
|
|
4973
|
-
(n) => [
|
|
4980
|
+
(n) => [N(n), n]
|
|
4974
4981
|
)).values()
|
|
4975
4982
|
],
|
|
4976
4983
|
qualifications: []
|
|
@@ -4990,11 +4997,11 @@ class Bl {
|
|
|
4990
4997
|
return await this.pFrames.getByKey(e).rustPFrame.listColumns();
|
|
4991
4998
|
}
|
|
4992
4999
|
async calculateTableData(e, t, r) {
|
|
4993
|
-
return
|
|
5000
|
+
return ue().logPFrameRequests && this.logger.info(
|
|
4994
5001
|
`Call calculateTableData, handle = ${e}, request = ${JSON.stringify(t, $e)}`
|
|
4995
5002
|
), await this.pFrames.getByKey(e).rustPFrame.createTable({
|
|
4996
5003
|
src: Ne(t.src),
|
|
4997
|
-
filters:
|
|
5004
|
+
filters: St(t.filters)
|
|
4998
5005
|
}, r).then(async (o) => {
|
|
4999
5006
|
if (t.sorting.length === 0) return o;
|
|
5000
5007
|
try {
|
|
@@ -5015,11 +5022,11 @@ class Bl {
|
|
|
5015
5022
|
});
|
|
5016
5023
|
}
|
|
5017
5024
|
async getUniqueValues(e, t, r) {
|
|
5018
|
-
return
|
|
5025
|
+
return ue().logPFrameRequests && this.logger.info(
|
|
5019
5026
|
`Call getUniqueValues, handle = ${e}, request = ${JSON.stringify(t, $e)}`
|
|
5020
5027
|
), await this.pFrames.getByKey(e).rustPFrame.getUniqueValues({
|
|
5021
5028
|
...t,
|
|
5022
|
-
filters:
|
|
5029
|
+
filters: St(t.filters)
|
|
5023
5030
|
}, r);
|
|
5024
5031
|
}
|
|
5025
5032
|
//
|
|
@@ -5065,13 +5072,13 @@ function Ne(s) {
|
|
|
5065
5072
|
H(s);
|
|
5066
5073
|
}
|
|
5067
5074
|
}
|
|
5068
|
-
function
|
|
5075
|
+
function Ul(s) {
|
|
5069
5076
|
const e = Ee("sha256");
|
|
5070
|
-
return e.update(
|
|
5077
|
+
return e.update(N(s)), e.digest().toString("hex");
|
|
5071
5078
|
}
|
|
5072
|
-
function
|
|
5079
|
+
function Gl(s) {
|
|
5073
5080
|
const e = [...s].map(
|
|
5074
|
-
(r) =>
|
|
5081
|
+
(r) => pe(r, (o) => {
|
|
5075
5082
|
let n;
|
|
5076
5083
|
const i = o.type;
|
|
5077
5084
|
switch (i) {
|
|
@@ -5113,40 +5120,40 @@ function xl(s) {
|
|
|
5113
5120
|
);
|
|
5114
5121
|
e.sort((r, o) => r.id.localeCompare(o.id));
|
|
5115
5122
|
const t = Ee("sha256");
|
|
5116
|
-
return t.update(
|
|
5123
|
+
return t.update(N(e)), t.digest().toString("hex");
|
|
5117
5124
|
}
|
|
5118
|
-
async function
|
|
5125
|
+
async function Jl(s, e, t) {
|
|
5119
5126
|
const r = {
|
|
5120
|
-
|
|
5121
|
-
...
|
|
5127
|
+
...$s,
|
|
5128
|
+
...Is(e),
|
|
5122
5129
|
...t
|
|
5123
|
-
}, o = new
|
|
5130
|
+
}, o = new Qr(r.localSecret), n = wo(r.logger, s, r.localProjections), i = So(s, r.logger), a = bo(s, r.logger), c = Ro(s, r.logger), u = new Eo(
|
|
5124
5131
|
r.logger,
|
|
5125
5132
|
n,
|
|
5126
5133
|
i,
|
|
5127
5134
|
r.blobDownloadPath,
|
|
5128
5135
|
o,
|
|
5129
5136
|
r.blobDriverOps
|
|
5130
|
-
), l = new
|
|
5137
|
+
), l = new Co(
|
|
5131
5138
|
r.logger,
|
|
5132
5139
|
o,
|
|
5133
5140
|
n,
|
|
5134
5141
|
r.downloadBlobToURLPath,
|
|
5135
5142
|
r.downloadBlobToURLDriverOps
|
|
5136
|
-
), d = new
|
|
5143
|
+
), d = new ko(
|
|
5137
5144
|
r.logger,
|
|
5138
5145
|
o,
|
|
5139
5146
|
a,
|
|
5140
5147
|
c,
|
|
5141
5148
|
r.uploadDriverOps
|
|
5142
|
-
), f = new
|
|
5149
|
+
), f = new Po(r.logger, i, r.logStreamDriverOps), h = new Oo(r.logger, f, u), R = await $o.init(
|
|
5143
5150
|
r.logger,
|
|
5144
5151
|
s,
|
|
5145
5152
|
o,
|
|
5146
5153
|
r.localProjections,
|
|
5147
5154
|
r.openFileDialogCallback,
|
|
5148
5155
|
r.virtualLocalStoragesOverride
|
|
5149
|
-
), g = new
|
|
5156
|
+
), g = new Vl(u, r.logger);
|
|
5150
5157
|
return {
|
|
5151
5158
|
blobDriver: u,
|
|
5152
5159
|
blobToURLDriver: l,
|
|
@@ -5157,7 +5164,7 @@ async function Vl(s, e, t) {
|
|
|
5157
5164
|
pFrameDriver: g
|
|
5158
5165
|
};
|
|
5159
5166
|
}
|
|
5160
|
-
class
|
|
5167
|
+
class js {
|
|
5161
5168
|
constructor(e, t, r, o, n, i, a, c) {
|
|
5162
5169
|
w(this, "pl");
|
|
5163
5170
|
/** Contains a reactive list of projects along with their meta information. */
|
|
@@ -5178,14 +5185,14 @@ class Ns {
|
|
|
5178
5185
|
/** Creates a project with initial state and adds it to project list. */
|
|
5179
5186
|
async createProject(e, t = be()) {
|
|
5180
5187
|
const r = await this.pl.withWriteTx("MLCreateProject", async (o) => {
|
|
5181
|
-
const n = await
|
|
5182
|
-
return o.createField(
|
|
5188
|
+
const n = await $n(o, e);
|
|
5189
|
+
return o.createField(U(this.projectListResourceId, t), "Dynamic", n), await o.commit(), await no(n);
|
|
5183
5190
|
});
|
|
5184
5191
|
return await this.projectListTree.refreshState(), r;
|
|
5185
5192
|
}
|
|
5186
5193
|
/** Updates project metadata */
|
|
5187
5194
|
async setProjectMeta(e, t, r) {
|
|
5188
|
-
await
|
|
5195
|
+
await Z(this.pl, e, r, (o) => {
|
|
5189
5196
|
o.setMeta(t);
|
|
5190
5197
|
}), await this.projectListTree.refreshState();
|
|
5191
5198
|
}
|
|
@@ -5193,13 +5200,13 @@ class Ns {
|
|
|
5193
5200
|
* destruction of all attached objects, like files, analysis results etc. */
|
|
5194
5201
|
async deleteProject(e) {
|
|
5195
5202
|
await this.pl.withWriteTx("MLRemoveProject", async (t) => {
|
|
5196
|
-
t.removeField(
|
|
5203
|
+
t.removeField(U(this.projectListResourceId, e)), await t.commit();
|
|
5197
5204
|
}), await this.projectListTree.refreshState();
|
|
5198
5205
|
}
|
|
5199
5206
|
async projectIdToResourceId(e) {
|
|
5200
5207
|
return await this.pl.withReadTx("Project id to resource id", async (t) => {
|
|
5201
|
-
const r = (await t.getField(
|
|
5202
|
-
if (
|
|
5208
|
+
const r = (await t.getField(U(this.projectListResourceId, e))).value;
|
|
5209
|
+
if (tt(r)) throw new Error("Unexpected project list structure.");
|
|
5203
5210
|
return r;
|
|
5204
5211
|
});
|
|
5205
5212
|
}
|
|
@@ -5210,7 +5217,7 @@ class Ns {
|
|
|
5210
5217
|
async openProject(e) {
|
|
5211
5218
|
const t = await this.ensureProjectRid(e);
|
|
5212
5219
|
if (this.openedProjectsByRid.has(t)) throw new Error(`Project ${t} already opened`);
|
|
5213
|
-
this.openedProjectsByRid.set(t, await
|
|
5220
|
+
this.openedProjectsByRid.set(t, await Jt.init(this.env, t)), this.openedProjectsList.setValue([...this.openedProjectsByRid.keys()]);
|
|
5214
5221
|
}
|
|
5215
5222
|
/** Closes the project, and deallocate all corresponding resources. */
|
|
5216
5223
|
async closeProject(e) {
|
|
@@ -5238,33 +5245,33 @@ class Ns {
|
|
|
5238
5245
|
/** Generates sufficiently random string to be used as local secret for the
|
|
5239
5246
|
* middle layer */
|
|
5240
5247
|
static generateLocalSecret() {
|
|
5241
|
-
return
|
|
5248
|
+
return Qr.generateSecret();
|
|
5242
5249
|
}
|
|
5243
5250
|
/** Initialize middle layer */
|
|
5244
5251
|
static async init(e, t, r) {
|
|
5245
5252
|
const o = {
|
|
5246
|
-
...
|
|
5247
|
-
...
|
|
5253
|
+
...ji,
|
|
5254
|
+
...xi(t),
|
|
5248
5255
|
...r
|
|
5249
5256
|
};
|
|
5250
|
-
o.defaultTreeOptions.logStat =
|
|
5257
|
+
o.defaultTreeOptions.logStat = ue().logTreeStats, o.debugOps.dumpInitialTreeState = ue().dumpInitialTreeState;
|
|
5251
5258
|
const n = await e.withWriteTx("MLInitialization", async (g) => {
|
|
5252
|
-
const
|
|
5253
|
-
g.createField(
|
|
5254
|
-
const T = await g.getField(
|
|
5255
|
-
if (
|
|
5256
|
-
const
|
|
5257
|
-
return g.lock(
|
|
5259
|
+
const x = U(g.clientRoot, Yo);
|
|
5260
|
+
g.createField(x, "Dynamic");
|
|
5261
|
+
const T = await g.getField(x);
|
|
5262
|
+
if (tt(T.value)) {
|
|
5263
|
+
const B = g.createEphemeral(cs);
|
|
5264
|
+
return g.lock(B), g.setField(x, B), await g.commit(), await B.globalId;
|
|
5258
5265
|
} else
|
|
5259
5266
|
return T.value;
|
|
5260
|
-
}), i = o.logger, a = await
|
|
5267
|
+
}), i = o.logger, a = await Jl(e, t, o), c = new Hs(e.httpDispatcher, {
|
|
5261
5268
|
minTimeout: 250,
|
|
5262
5269
|
maxRetries: 4
|
|
5263
|
-
}), u = new
|
|
5270
|
+
}), u = new Vo(c), l = new bn(
|
|
5264
5271
|
u,
|
|
5265
5272
|
a.signer,
|
|
5266
5273
|
c
|
|
5267
|
-
), d = new
|
|
5274
|
+
), d = new Io(
|
|
5268
5275
|
i,
|
|
5269
5276
|
e.httpDispatcher,
|
|
5270
5277
|
o.frontendDownloadPath
|
|
@@ -5278,14 +5285,14 @@ class Ns {
|
|
|
5278
5285
|
bpPreparer: l,
|
|
5279
5286
|
frontendDownloadDriver: d,
|
|
5280
5287
|
driverKit: a,
|
|
5281
|
-
blockUpdateWatcher: new
|
|
5288
|
+
blockUpdateWatcher: new Nl(u, i, {
|
|
5282
5289
|
minDelay: o.devBlockUpdateRecheckInterval,
|
|
5283
5290
|
http: c,
|
|
5284
5291
|
preferredUpdateChannel: o.preferredUpdateChannel
|
|
5285
5292
|
}),
|
|
5286
|
-
quickJs: await
|
|
5287
|
-
}, h = new
|
|
5288
|
-
return new
|
|
5293
|
+
quickJs: await vo()
|
|
5294
|
+
}, h = new uo([]), R = await Zo(e, n, h, f);
|
|
5295
|
+
return new js(
|
|
5289
5296
|
f,
|
|
5290
5297
|
a,
|
|
5291
5298
|
a.signer,
|
|
@@ -5297,7 +5304,7 @@ class Ns {
|
|
|
5297
5304
|
);
|
|
5298
5305
|
}
|
|
5299
5306
|
}
|
|
5300
|
-
const
|
|
5307
|
+
const Ml = [
|
|
5301
5308
|
"undici:request:create",
|
|
5302
5309
|
// When a new request is created
|
|
5303
5310
|
"undici:request:bodySent",
|
|
@@ -5335,7 +5342,7 @@ const Ul = [
|
|
|
5335
5342
|
"undici:dispatcher:retry"
|
|
5336
5343
|
// When a dispatcher retries a request
|
|
5337
5344
|
];
|
|
5338
|
-
async function
|
|
5345
|
+
async function $u(s, e = {}) {
|
|
5339
5346
|
const t = {
|
|
5340
5347
|
pingCheckDurationMs: 1e4,
|
|
5341
5348
|
pingTimeoutMs: 3e3,
|
|
@@ -5353,8 +5360,8 @@ async function ku(s, e = {}) {
|
|
|
5353
5360
|
bodyLimit: 300,
|
|
5354
5361
|
...e
|
|
5355
5362
|
}, r = [];
|
|
5356
|
-
|
|
5357
|
-
|
|
5363
|
+
Ml.forEach((c) => {
|
|
5364
|
+
Ao(c).subscribe((l) => {
|
|
5358
5365
|
var f;
|
|
5359
5366
|
const d = (/* @__PURE__ */ new Date()).toISOString();
|
|
5360
5367
|
(f = l == null ? void 0 : l.response) != null && f.headers && (l.response.headers = l.response.headers.map((h) => h.toString())), r.push(
|
|
@@ -5373,12 +5380,12 @@ async function ku(s, e = {}) {
|
|
|
5373
5380
|
blockRegistryUiChecks: [],
|
|
5374
5381
|
blockGARegistryUiChecks: [],
|
|
5375
5382
|
autoUpdateCdnChecks: []
|
|
5376
|
-
}, n =
|
|
5383
|
+
}, n = io(s, { defaultRequestTimeout: t.pingTimeoutMs });
|
|
5377
5384
|
o.plPings = await ve(t.pingCheckDurationMs, t.maxPingsPerSecond, async () => {
|
|
5378
|
-
const u = await new
|
|
5385
|
+
const u = await new nr(n).ping();
|
|
5379
5386
|
return JSON.stringify(u).slice(0, t.bodyLimit) + "...";
|
|
5380
5387
|
});
|
|
5381
|
-
const a = new
|
|
5388
|
+
const a = new nr(n).ll.httpDispatcher;
|
|
5382
5389
|
return o.blockRegistryOverviewChecks = await ve(
|
|
5383
5390
|
t.blockRegistryDurationMs,
|
|
5384
5391
|
t.maxRegistryChecksPerSecond,
|
|
@@ -5399,30 +5406,30 @@ async function ku(s, e = {}) {
|
|
|
5399
5406
|
t.autoUpdateCdnDurationMs,
|
|
5400
5407
|
t.maxAutoUpdateCdnChecksPerSecond,
|
|
5401
5408
|
async () => await Ie(t.autoUpdateCdnUrl, t, a)
|
|
5402
|
-
),
|
|
5409
|
+
), _l(o, s, t, r);
|
|
5403
5410
|
}
|
|
5404
5411
|
async function ve(s, e, t) {
|
|
5405
|
-
const r =
|
|
5406
|
-
for (;
|
|
5407
|
-
const n =
|
|
5412
|
+
const r = Lt(), o = [];
|
|
5413
|
+
for (; Wr(r) < s; ) {
|
|
5414
|
+
const n = Lt();
|
|
5408
5415
|
let i;
|
|
5409
5416
|
try {
|
|
5410
5417
|
i = { ok: !0, value: await t() };
|
|
5411
5418
|
} catch (u) {
|
|
5412
5419
|
i = { ok: !1, error: u };
|
|
5413
5420
|
}
|
|
5414
|
-
const a =
|
|
5421
|
+
const a = Wr(n);
|
|
5415
5422
|
o.push({
|
|
5416
5423
|
elapsedMs: a,
|
|
5417
5424
|
response: i
|
|
5418
5425
|
});
|
|
5419
5426
|
const c = 1e3 / e - a;
|
|
5420
|
-
c > 0 && await
|
|
5427
|
+
c > 0 && await ss(c);
|
|
5421
5428
|
}
|
|
5422
5429
|
return o;
|
|
5423
5430
|
}
|
|
5424
5431
|
async function Ie(s, e, t) {
|
|
5425
|
-
const { body: r, statusCode: o } = await
|
|
5432
|
+
const { body: r, statusCode: o } = await Dt(s, {
|
|
5426
5433
|
dispatcher: t,
|
|
5427
5434
|
headersTimeout: e.httpTimeoutMs,
|
|
5428
5435
|
bodyTimeout: e.httpTimeoutMs
|
|
@@ -5432,7 +5439,7 @@ async function Ie(s, e, t) {
|
|
|
5432
5439
|
beginningOfBody: n.slice(0, e.bodyLimit) + "..."
|
|
5433
5440
|
};
|
|
5434
5441
|
}
|
|
5435
|
-
function
|
|
5442
|
+
function _l(s, e, t, r) {
|
|
5436
5443
|
const o = s.plPings.filter((a) => a.response.ok), n = s.plPings.filter((a) => !a.response.ok), i = [
|
|
5437
5444
|
...new Set(o.map((a) => JSON.stringify(a.response.value)))
|
|
5438
5445
|
];
|
|
@@ -5480,7 +5487,7 @@ ${r.join(`
|
|
|
5480
5487
|
`;
|
|
5481
5488
|
}
|
|
5482
5489
|
function ye(s) {
|
|
5483
|
-
const e = s.filter((o) => o.response.ok), { mean: t, median: r } =
|
|
5490
|
+
const e = s.filter((o) => o.response.ok), { mean: t, median: r } = Kl(s);
|
|
5484
5491
|
return `
|
|
5485
5492
|
total: ${s.length};
|
|
5486
5493
|
successes: ${e.length};
|
|
@@ -5489,7 +5496,7 @@ mean in ms: ${t};
|
|
|
5489
5496
|
median in ms: ${r};
|
|
5490
5497
|
`;
|
|
5491
5498
|
}
|
|
5492
|
-
function
|
|
5499
|
+
function Kl(s) {
|
|
5493
5500
|
const e = s.map((o) => o.elapsedMs), t = e.reduce((o, n) => o + n) / e.length;
|
|
5494
5501
|
let r;
|
|
5495
5502
|
if (e.length > 0) {
|
|
@@ -5498,40 +5505,40 @@ function Jl(s) {
|
|
|
5498
5505
|
}
|
|
5499
5506
|
return { mean: t, median: r };
|
|
5500
5507
|
}
|
|
5501
|
-
function
|
|
5508
|
+
function Lt() {
|
|
5502
5509
|
return Date.now();
|
|
5503
5510
|
}
|
|
5504
|
-
function
|
|
5505
|
-
return
|
|
5511
|
+
function Wr(s) {
|
|
5512
|
+
return Lt() - s;
|
|
5506
5513
|
}
|
|
5507
5514
|
export {
|
|
5508
|
-
|
|
5509
|
-
|
|
5510
|
-
|
|
5511
|
-
|
|
5512
|
-
|
|
5513
|
-
|
|
5514
|
-
|
|
5515
|
-
|
|
5516
|
-
|
|
5517
|
-
|
|
5518
|
-
|
|
5519
|
-
|
|
5520
|
-
|
|
5521
|
-
|
|
5522
|
-
|
|
5523
|
-
|
|
5524
|
-
|
|
5525
|
-
|
|
5526
|
-
|
|
5527
|
-
|
|
5528
|
-
|
|
5529
|
-
|
|
5530
|
-
|
|
5531
|
-
|
|
5532
|
-
|
|
5533
|
-
|
|
5534
|
-
|
|
5535
|
-
|
|
5515
|
+
Su as BlockPackRegistry,
|
|
5516
|
+
bu as CentralBlockRegistry,
|
|
5517
|
+
Is as DefaultDriverKitOpsPaths,
|
|
5518
|
+
$s as DefaultDriverKitOpsSettings,
|
|
5519
|
+
xi as DefaultMiddleLayerOpsPaths,
|
|
5520
|
+
ji as DefaultMiddleLayerOpsSettings,
|
|
5521
|
+
gs as FrontendFromFolderResourceType,
|
|
5522
|
+
hs as FrontendFromUrlResourceType,
|
|
5523
|
+
js as MiddleLayer,
|
|
5524
|
+
Jt as Project,
|
|
5525
|
+
dn as TengoTemplateGet,
|
|
5526
|
+
pn as TengoTemplateGetRegistry,
|
|
5527
|
+
hn as TengoTemplateGetTemplate,
|
|
5528
|
+
fn as TengoTemplateGetTemplateURI,
|
|
5529
|
+
Cu as TengoTemplatePack,
|
|
5530
|
+
ku as TengoTemplatePackConvert,
|
|
5531
|
+
Ou as TengoTemplatePackConvertTemplate,
|
|
5532
|
+
Pu as TengoTemplatePackConvertTemplatePack,
|
|
5533
|
+
Eu as V1CentralDevSnapshotRegistry,
|
|
5534
|
+
Ru as V1CentralRegistry,
|
|
5535
|
+
Vo as V2RegistryProvider,
|
|
5536
|
+
$u as checkNetwork,
|
|
5537
|
+
ls as createRenderTemplate,
|
|
5538
|
+
ns as getDevV1PacketMtime,
|
|
5539
|
+
jt as getDevV2PacketMtime,
|
|
5540
|
+
Jl as initDriverKit,
|
|
5541
|
+
Vt as loadTemplate,
|
|
5542
|
+
gn as prepareTemplateSpec
|
|
5536
5543
|
};
|
|
5537
5544
|
//# sourceMappingURL=index.mjs.map
|