@milaboratories/pl-middle-layer 1.38.0 → 1.38.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1,14 +1,14 @@
1
- var no = Object.defineProperty;
2
- var Vr = (s, e) => (e = Symbol[s]) ? e : Symbol.for("Symbol." + s), Ur = (s) => {
1
+ var io = Object.defineProperty;
2
+ var Jr = (s, e) => (e = Symbol[s]) ? e : Symbol.for("Symbol." + s), Mr = (s) => {
3
3
  throw TypeError(s);
4
4
  };
5
- var oo = (s, e, t) => e in s ? no(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t;
6
- var R = (s, e, t) => oo(s, typeof e != "symbol" ? e + "" : e, t);
7
- var Jr = (s, e, t) => {
5
+ var ao = (s, e, t) => e in s ? io(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t;
6
+ var b = (s, e, t) => ao(s, typeof e != "symbol" ? e + "" : e, t);
7
+ var Gr = (s, e, t) => {
8
8
  if (e != null) {
9
- typeof e != "object" && typeof e != "function" && Ur("Object expected");
9
+ typeof e != "object" && typeof e != "function" && Mr("Object expected");
10
10
  var r, n;
11
- t && (r = e[Vr("asyncDispose")]), r === void 0 && (r = e[Vr("dispose")], t && (n = r)), typeof r != "function" && Ur("Object not disposable"), n && (r = function() {
11
+ t && (r = e[Jr("asyncDispose")]), r === void 0 && (r = e[Jr("dispose")], t && (n = r)), typeof r != "function" && Mr("Object not disposable"), n && (r = function() {
12
12
  try {
13
13
  n.call(this);
14
14
  } catch (o) {
@@ -17,7 +17,7 @@ var Jr = (s, e, t) => {
17
17
  }), s.push([t, r, e]);
18
18
  } else t && s.push([t]);
19
19
  return e;
20
- }, Mr = (s, e, t) => {
20
+ }, _r = (s, e, t) => {
21
21
  var r = typeof SuppressedError == "function" ? SuppressedError : function(i, a, c, l) {
22
22
  return l = Error(c), l.name = "SuppressedError", l.error = i, l.suppressed = a, l;
23
23
  }, n = (i) => e = t ? new r(i, e, "An error was suppressed during disposal") : (t = !0, i), o = (i) => {
@@ -32,79 +32,79 @@ var Jr = (s, e, t) => {
32
32
  };
33
33
  return o();
34
34
  };
35
- import { extractConfig as ke, UiError as Gr, mapValueInVOE as cn, executePSpecPredicate as io, mapPObjectData as he, mapPTableDef as fr, isDataInfo as ln, mapDataInfo as un, checkBlockFlag as ao, JsRenderInternal as co, isConfigLambda as dn, extractCodeWithInfo as lt, DefaultNavigationState as lo, extractAllColumns as uo, RuntimeCapabilities as po } from "@platforma-sdk/model";
35
+ import { extractConfig as ke, UiError as qr, mapValueInVOE as dn, executePSpecPredicate as co, mapPObjectData as ge, mapPTableDef as hr, isDataInfo as pn, mapDataInfo as fn, checkBlockFlag as lo, JsRenderInternal as uo, isConfigLambda as hn, extractCodeWithInfo as ut, DefaultNavigationState as po, extractAllColumns as fo, ensureError as ho, RuntimeCapabilities as go } from "@platforma-sdk/model";
36
36
  export * from "@platforma-sdk/model";
37
- import { StableChannel as Le, AnyChannel as De, InitialBlockSettings as _r, blockPackIdToString as fo } from "@milaboratories/pl-model-middle-layer";
37
+ import { StableChannel as De, AnyChannel as Ne, InitialBlockSettings as Kr, blockPackIdToString as mo } from "@milaboratories/pl-model-middle-layer";
38
38
  export * from "@milaboratories/pl-model-middle-layer";
39
39
  export * from "@milaboratories/pl-deployments";
40
- import { request as kr, RetryAgent as go } from "undici";
41
- import { RegistryV1 as me, tryLoadPackDescription as gr, BlockPackMetaEmbedAbsoluteBytes as ho, RegistryV2Reader as mo, folderReaderByUrl as vo, loadPackDescription as qr } from "@platforma-sdk/block-tools";
40
+ import { request as Rr, RetryAgent as vo } from "undici";
41
+ import { RegistryV1 as me, tryLoadPackDescription as gr, BlockPackMetaEmbedAbsoluteBytes as yo, RegistryV2Reader as wo, folderReaderByUrl as So, loadPackDescription as Hr } from "@platforma-sdk/block-tools";
42
42
  import se from "node:fs";
43
- import * as yo from "node:path";
43
+ import * as bo from "node:path";
44
44
  import _ from "node:path";
45
- import wo from "yaml";
46
- import { assertNever as Y, notEmpty as D, canonicalJsonBytes as So, canonicalJsonGzBytes as bo, cachedDeserialize as Ve, cachedDecode as yt, deepFreeze as Kr, ConsoleLoggerAdapter as pn, ConcurrencyLimitingExecutor as Hr, emptyDir as ko, HmacSha256Signer as Rr, BlockEventDispatcher as Ro } from "@milaboratories/ts-helpers";
47
- import * as fn from "node:fs/promises";
48
- import nt from "node:fs/promises";
49
- import { tryResolve as Co } from "@milaboratories/resolve-helper";
50
- import { resourceTypesEqual as pe, field as M, Pl as L, PlClient as gn, isResourceId as Wr, isNullResourceId as Ue, isResource as Eo, isResourceRef as Po, isNotNullResourceId as hr, ensureResourceIdNotNull as ot, resourceType as He, resourceTypeToString as Oo, stringifyWithResourceId as Xe, resourceIdToString as Ce, isNotFoundError as Io, isTimeoutOrCancelError as Fo, toGlobalResourceId as To, UnauthenticatedPlClient as hn, toGlobalFieldId as $o, poll as Ao, ContinuePolling as Lo, plAddressToConfig as Do } from "@milaboratories/pl-client";
45
+ import ko from "yaml";
46
+ import { assertNever as Y, notEmpty as D, canonicalJsonBytes as Ro, canonicalJsonGzBytes as Co, cachedDeserialize as Ve, cachedDecode as wt, deepFreeze as Wr, ConsoleLoggerAdapter as gn, ConcurrencyLimitingExecutor as zr, emptyDir as Eo, HmacSha256Signer as Cr, BlockEventDispatcher as Po } from "@milaboratories/ts-helpers";
47
+ import * as mn from "node:fs/promises";
48
+ import ot from "node:fs/promises";
49
+ import { tryResolve as Oo } from "@milaboratories/resolve-helper";
50
+ import { resourceTypesEqual as pe, field as M, Pl as L, PlClient as vn, isResourceId as Xr, isNullResourceId as Ue, isResource as Io, isResourceRef as Fo, isNotNullResourceId as mr, ensureResourceIdNotNull as it, resourceType as He, resourceTypeToString as To, stringifyWithResourceId as Xe, resourceIdToString as Ce, isNotFoundError as $o, isTimeoutOrCancelError as Ao, toGlobalResourceId as Lo, UnauthenticatedPlClient as yn, toGlobalFieldId as Do, poll as No, ContinuePolling as Bo, plAddressToConfig as jo } from "@milaboratories/pl-client";
51
51
  export * from "@milaboratories/pl-client";
52
- import { SynchronizedTreeState as mn, treeDumpStats as No, isPlTreeNodeAccessor as Bo } from "@milaboratories/pl-tree";
53
- import { Computable as K, ChangeSource as zr, PollComputablePool as jo, WatchableValue as xo } from "@milaboratories/computable";
54
- import { randomUUID as ve, createHash as Pe, randomBytes as Vo } from "node:crypto";
55
- import { PlTemplateV1 as X, PlTemplateOverrideV1 as Re, PlTemplateLibV1 as fe, PlTemplateSoftwareV1 as le, parseTemplate as Uo } from "@milaboratories/pl-model-backend";
56
- import { LRUCache as vn } from "lru-cache";
57
- import { Worker as Jo } from "node:worker_threads";
58
- import yn from "denque";
52
+ import { SynchronizedTreeState as wn, treeDumpStats as xo, isPlTreeNodeAccessor as Vo } from "@milaboratories/pl-tree";
53
+ import { Computable as K, ChangeSource as Yr, PollComputablePool as Uo, WatchableValue as Jo } from "@milaboratories/computable";
54
+ import { randomUUID as ve, createHash as Pe, randomBytes as Mo } from "node:crypto";
55
+ import { PlTemplateV1 as X, PlTemplateOverrideV1 as Re, PlTemplateLibV1 as fe, PlTemplateSoftwareV1 as le, parseTemplate as Go } from "@milaboratories/pl-model-backend";
56
+ import { LRUCache as Er } from "lru-cache";
57
+ import { Worker as _o } from "node:worker_threads";
58
+ import Sn from "denque";
59
59
  import { Templates as ye } from "@platforma-sdk/workflow-tengo";
60
60
  import te from "canonicalize";
61
- import Mo from "node:assert";
62
- import { Scope as Je, errors as Go, getQuickJS as _o } from "quickjs-emscripten";
63
- import { PlQuickJSError as qo } from "@milaboratories/pl-errors";
64
- import * as Xr from "remeda";
65
- import { setTimeout as wn } from "node:timers/promises";
66
- import { createDownloadClient as Sn, createLogsClient as Ko, createUploadBlobClient as bn, createUploadProgressClient as Ho, DownloadDriver as Wo, DownloadBlobToURLDriver as zo, UploadDriver as Xo, LogsStreamDriver as Yo, LogsDriver as Qo, LsDriver as kn, DownloadUrlDriver as Zo, uploadBlob as Rn, ImportFileHandleUploadData as Cn, isUpload as ei, isSignMatch as ti } from "@milaboratories/pl-drivers";
67
- import { PFrame as En } from "@milaboratories/pframes-rs-node";
68
- import { channel as ri } from "node:diagnostics_channel";
69
- import { text as si } from "node:stream/consumers";
70
- import Pn from "node:os";
71
- async function Yr(s) {
61
+ import qo from "node:assert";
62
+ import { Scope as Je, errors as Ko, getQuickJS as Ho } from "quickjs-emscripten";
63
+ import { PlQuickJSError as Wo } from "@milaboratories/pl-errors";
64
+ import * as Qr from "remeda";
65
+ import { setTimeout as bn } from "node:timers/promises";
66
+ import { createDownloadClient as kn, createLogsClient as zo, createUploadBlobClient as Rn, createUploadProgressClient as Xo, DownloadDriver as Yo, DownloadBlobToURLDriver as Qo, UploadDriver as Zo, LogsStreamDriver as ei, LogsDriver as ti, LsDriver as Cn, DownloadUrlDriver as ri, uploadBlob as En, ImportFileHandleUploadData as Pn, isUpload as si, isSignMatch as ni } from "@milaboratories/pl-drivers";
67
+ import { PFrame as On } from "@milaboratories/pframes-rs-node";
68
+ import { channel as oi } from "node:diagnostics_channel";
69
+ import { text as ii } from "node:stream/consumers";
70
+ import In from "node:os";
71
+ async function Zr(s) {
72
72
  try {
73
- return await fn.stat(s, { bigint: !0 });
73
+ return await mn.stat(s, { bigint: !0 });
74
74
  } catch (e) {
75
75
  if (e.code === "ENOENT")
76
76
  return;
77
77
  throw e;
78
78
  }
79
79
  }
80
- const ni = [me.PlPackageYamlConfigFile], oi = [me.PlPackageJsonConfigFile], Cr = ["backend", "dist", "tengo", "tpl", "main.plj.gz"], Er = ["config", "dist", "config.json"], On = ["frontend", "dist"], Qr = "block-model/dist/config.json", ii = "block-ui/package.json", ai = [
81
- Cr,
82
- Er,
83
- ni,
84
- oi,
85
- On
80
+ const ai = [me.PlPackageYamlConfigFile], ci = [me.PlPackageJsonConfigFile], Pr = ["backend", "dist", "tengo", "tpl", "main.plj.gz"], Or = ["config", "dist", "config.json"], Fn = ["frontend", "dist"], es = "block-model/dist/config.json", li = "block-ui/package.json", ui = [
81
+ Pr,
82
+ Or,
83
+ ai,
84
+ ci,
85
+ Fn
86
86
  ];
87
- async function ci(s) {
88
- return await Yr(_.join(s, ...Er)) !== void 0 || await Yr(_.join(s, ...Cr)) !== void 0;
87
+ async function di(s) {
88
+ return await Zr(_.join(s, ...Or)) !== void 0 || await Zr(_.join(s, ...Pr)) !== void 0;
89
89
  }
90
- function wt(s, e) {
91
- const t = Co(s, e);
90
+ function St(s, e) {
91
+ const t = Oo(s, e);
92
92
  if (t === void 0) throw new Error(`Can't resolve ${e} against ${s}`);
93
93
  return t;
94
94
  }
95
- async function Zr(s, e) {
96
- if (_.isAbsolute(s) || (s = _.resolve(s)), await ci(s))
95
+ async function ts(s, e) {
96
+ if (_.isAbsolute(s) || (s = _.resolve(s)), await di(s))
97
97
  return {
98
- workflow: _.join(s, ...Cr),
99
- config: _.join(s, ...Er),
100
- ui: _.join(s, ...On)
98
+ workflow: _.join(s, ...Pr),
99
+ config: _.join(s, ...Or),
100
+ ui: _.join(s, ...Fn)
101
101
  };
102
102
  {
103
- const t = wt(s, Qr), r = wt(s, Qr), n = wt(s, ii);
103
+ const t = St(s, es), r = St(s, es), n = St(s, li);
104
104
  return { workflow: t, config: r, ui: _.resolve(n, "..", "dist") };
105
105
  }
106
106
  }
107
- async function li(s) {
107
+ async function pi(s) {
108
108
  try {
109
109
  return await se.promises.readFile(s, "utf8");
110
110
  } catch (e) {
@@ -113,7 +113,7 @@ async function li(s) {
113
113
  throw e;
114
114
  }
115
115
  }
116
- async function ui(s) {
116
+ async function fi(s) {
117
117
  try {
118
118
  return await se.promises.stat(s, { bigint: !0 });
119
119
  } catch (e) {
@@ -122,21 +122,21 @@ async function ui(s) {
122
122
  throw e;
123
123
  }
124
124
  }
125
- async function In(s) {
125
+ async function Tn(s) {
126
126
  let e = 0n;
127
- for (const t of ai) {
128
- const r = _.join(s, ...t), n = await ui(r);
127
+ for (const t of ui) {
128
+ const r = _.join(s, ...t), n = await fi(r);
129
129
  n !== void 0 && e < n.mtimeNs && (e = n.mtimeNs);
130
130
  }
131
131
  return e.toString();
132
132
  }
133
- async function Pr(s) {
133
+ async function Ir(s) {
134
134
  const e = await se.promises.stat(s.components.workflow.main.file, {
135
135
  bigint: !0
136
136
  }), t = await se.promises.stat(s.components.model.file, { bigint: !0 });
137
137
  return (e.mtimeNs > t.mtimeNs ? e.mtimeNs : t.mtimeNs).toString();
138
138
  }
139
- class Ql {
139
+ class Zl {
140
140
  constructor(e, t, r) {
141
141
  this.v2Provider = e, this.registries = t, this.http = r;
142
142
  }
@@ -144,7 +144,7 @@ class Ql {
144
144
  const t = [], r = e.spec;
145
145
  switch (r.type) {
146
146
  case "remote-v1": {
147
- const n = this.http !== void 0 ? { dispatcher: this.http } : {}, i = await (await kr(
147
+ const n = this.http !== void 0 ? { dispatcher: this.http } : {}, i = await (await Rr(
148
148
  `${r.url}/${me.GlobalOverviewPath}`,
149
149
  n
150
150
  )).body.json();
@@ -173,8 +173,8 @@ class Ql {
173
173
  registryId: e.id,
174
174
  id: p,
175
175
  latestByChannel: {
176
- [De]: f,
177
- [Le]: f
176
+ [Ne]: f,
177
+ [De]: f
178
178
  },
179
179
  allVersions: a.allVersions.map((v) => ({ version: v, channels: [] }))
180
180
  });
@@ -204,11 +204,11 @@ class Ql {
204
204
  case "local-dev":
205
205
  for (const n of await se.promises.readdir(r.path, { withFileTypes: !0 })) {
206
206
  if (!n.isDirectory()) continue;
207
- const o = _.join(r.path, n.name), i = await li(
207
+ const o = _.join(r.path, n.name), i = await pi(
208
208
  _.join(o, me.PlPackageYamlConfigFile)
209
209
  );
210
210
  if (i !== void 0) {
211
- const a = me.PlPackageConfigData.parse(wo.parse(i)), c = await In(o), l = {
211
+ const a = me.PlPackageConfigData.parse(ko.parse(i)), c = await Tn(o), l = {
212
212
  organization: a.organization,
213
213
  name: a.package,
214
214
  version: "DEV"
@@ -232,8 +232,8 @@ class Ql {
232
232
  registryId: e.id,
233
233
  id: l,
234
234
  latestByChannel: {
235
- [De]: u,
236
- [Le]: u
235
+ [Ne]: u,
236
+ [De]: u
237
237
  },
238
238
  allVersions: []
239
239
  });
@@ -244,9 +244,9 @@ class Ql {
244
244
  if (a = _.join(o, l), c = await gr(a), c !== void 0) break;
245
245
  }
246
246
  if (c !== void 0) {
247
- const l = await Pr(c), u = {
247
+ const l = await Ir(c), u = {
248
248
  id: c.id,
249
- meta: await ho.parseAsync(c.meta),
249
+ meta: await yo.parseAsync(c.meta),
250
250
  featureFlags: c.featureFlags,
251
251
  spec: {
252
252
  type: "dev-v2",
@@ -258,8 +258,8 @@ class Ql {
258
258
  registryId: e.id,
259
259
  id: c.id,
260
260
  latestByChannel: {
261
- [De]: u,
262
- [Le]: u
261
+ [Ne]: u,
262
+ [De]: u
263
263
  },
264
264
  allVersions: []
265
265
  });
@@ -288,60 +288,60 @@ class Ql {
288
288
  return await this.v2Provider.getRegistry(n.url).getSpecificOverview(t, r);
289
289
  }
290
290
  }
291
- class di {
291
+ class hi {
292
292
  constructor(e) {
293
- R(this, "registries", /* @__PURE__ */ new Map());
293
+ b(this, "registries", /* @__PURE__ */ new Map());
294
294
  this.http = e;
295
295
  }
296
296
  getRegistry(e) {
297
297
  const t = this.registries.get(e);
298
298
  if (t) return t;
299
- const r = new mo(vo(e, this.http));
299
+ const r = new wo(So(e, this.http));
300
300
  return this.registries.set(e, r), r;
301
301
  }
302
302
  }
303
- const Zl = {
303
+ const eu = {
304
304
  type: "remote-v2",
305
305
  url: "https://blocks.pl-open.science/"
306
- }, eu = {
306
+ }, tu = {
307
307
  type: "remote-v1",
308
308
  url: "https://block.registry.platforma.bio/releases"
309
- }, tu = {
309
+ }, ru = {
310
310
  type: "remote-v1",
311
311
  url: "https://block.registry.platforma.bio/dev"
312
- }, pi = {
312
+ }, gi = {
313
313
  groups: [{ id: "default", label: "Default", blocks: [] }]
314
- }, fi = {
314
+ }, mi = {
315
315
  stagingRefreshTimestamp: 0,
316
316
  blocksInLimbo: []
317
- }, gi = {
317
+ }, vi = {
318
318
  label: "New Project"
319
- }, hi = { name: "UserProject", version: "2" }, it = "SchemaVersion", Me = "2", Or = "ProjectCreated", Ge = "ProjectLastModified", _e = "ProjectMeta", de = "ProjectStructure", at = "BlockRenderingState", mi = "BlockArgsAuthor/";
320
- function mr(s) {
321
- return `${mi}${s}`;
319
+ }, yi = { name: "UserProject", version: "2" }, at = "SchemaVersion", Me = "2", Fr = "ProjectCreated", Ge = "ProjectLastModified", _e = "ProjectMeta", de = "ProjectStructure", ct = "BlockRenderingState", wi = "BlockArgsAuthor/";
320
+ function vr(s) {
321
+ return `${wi}${s}`;
322
322
  }
323
- const vr = "ProjectStructureAuthor", vi = "__serviceTemplate_";
324
- function yr(s) {
325
- return `${vi}${s}`;
323
+ const yr = "ProjectStructureAuthor", Si = "__serviceTemplate_";
324
+ function wr(s) {
325
+ return `${Si}${s}`;
326
326
  }
327
327
  function q(s, e) {
328
328
  return `${s}-${e}`;
329
329
  }
330
- const yi = /^(?<blockId>.*)-(?<fieldName>blockPack|blockSettings|uiState|prodArgs|currentArgs|prodCtx|prodUiCtx|prodOutput|prodCtxPrevious|prodUiCtxPrevious|prodOutputPrevious|stagingCtx|stagingUiCtx|stagingOutput|stagingCtxPrevious|stagingUiCtxPrevious|stagingOutputPrevious)$/;
331
- function wi(s) {
332
- const e = s.match(yi);
330
+ const bi = /^(?<blockId>.*)-(?<fieldName>blockPack|blockSettings|uiState|prodArgs|currentArgs|prodCtx|prodUiCtx|prodOutput|prodCtxPrevious|prodUiCtxPrevious|prodOutputPrevious|stagingCtx|stagingUiCtx|stagingOutput|stagingCtxPrevious|stagingUiCtxPrevious|stagingOutputPrevious)$/;
331
+ function ki(s) {
332
+ const e = s.match(bi);
333
333
  if (e === null) return;
334
334
  const { blockId: t, fieldName: r } = e.groups;
335
335
  return { blockId: t, fieldName: r };
336
336
  }
337
- const Si = "projects", Fn = { name: "Projects", version: "1" }, bi = (s) => pe(s.type, Fn) ? s.fields : [];
338
- async function ki(s, e, t, r) {
339
- const n = await mn.init(
337
+ const Ri = "projects", $n = { name: "Projects", version: "1" }, Ci = (s) => pe(s.type, $n) ? s.fields : [];
338
+ async function Ei(s, e, t, r) {
339
+ const n = await wn.init(
340
340
  s,
341
341
  e,
342
342
  {
343
343
  ...r.ops.defaultTreeOptions,
344
- pruning: bi
344
+ pruning: Ci
345
345
  },
346
346
  r.logger
347
347
  );
@@ -352,7 +352,7 @@ async function ki(s, e, t, r) {
352
352
  for (const u of a.listDynamicFields()) {
353
353
  const d = a.traverse(u);
354
354
  if (d === void 0) continue;
355
- const p = D(d.getKeyValueAsJson(_e)), f = D(d.getKeyValueAsJson(Or)), v = D(d.getKeyValueAsJson(Ge));
355
+ const p = D(d.getKeyValueAsJson(_e)), f = D(d.getKeyValueAsJson(Fr)), v = D(d.getKeyValueAsJson(Ge));
356
356
  l.push({
357
357
  id: u,
358
358
  rid: d.id,
@@ -365,36 +365,36 @@ async function ki(s, e, t, r) {
365
365
  return l.sort((u) => -u.lastModified.valueOf()), l;
366
366
  }).withStableType(), tree: n };
367
367
  }
368
- const Ri = {
368
+ const Pi = {
369
369
  name: "EphRenderTemplate",
370
370
  version: "1"
371
- }, Ci = {
371
+ }, Oi = {
372
372
  name: "RenderTemplate",
373
373
  version: "1"
374
374
  };
375
- function Ir(s, e, t, r, n) {
375
+ function Tr(s, e, t, r, n) {
376
376
  if (n.length === 0) throw new Error("Zero output names provided");
377
- const o = t ? s.createEphemeral(Ri) : s.createStruct(Ci), i = M(o, "template"), a = M(o, "inputs");
377
+ const o = t ? s.createEphemeral(Pi) : s.createStruct(Oi), i = M(o, "template"), a = M(o, "inputs");
378
378
  return s.createField(i, "Input", e), s.createField(a, "Input", L.createPlMap(s, r, t)), s.lockInputs(o), L.futureRecord(s, o, n, "Output", "outputs/");
379
379
  }
380
- const Ei = { name: "BContextEnd", version: "1" }, Pi = { name: "BContext", version: "1" }, Oi = "id", Ii = "parent/", Fi = ["context", "result"];
381
- function es(s, e, t) {
382
- return Ir(s, e, !0, t, Fi);
380
+ const Ii = { name: "BContextEnd", version: "1" }, Fi = { name: "BContext", version: "1" }, Ti = "id", $i = "parent/", Ai = ["context", "result"];
381
+ function rs(s, e, t) {
382
+ return Tr(s, e, !0, t, Ai);
383
383
  }
384
- function Ti(s) {
385
- const e = s.createEphemeral(Ei);
384
+ function Li(s) {
385
+ const e = s.createEphemeral(Ii);
386
386
  return s.lock(e), e;
387
387
  }
388
- function ts(s, e) {
389
- if (e.length === 0) return Ti(s);
388
+ function ss(s, e) {
389
+ if (e.length === 0) return Li(s);
390
390
  if (e.length === 1) return e[0];
391
- const t = s.createEphemeral(Pi);
392
- s.createField(M(t, Oi), "Input", L.createPlString(s, ve()));
391
+ const t = s.createEphemeral(Fi);
392
+ s.createField(M(t, Ti), "Input", L.createPlString(s, ve()));
393
393
  for (let r = 0; r < e.length; r++)
394
- s.createField(M(t, `${Ii}${r}`), "Input", e[r]);
394
+ s.createField(M(t, `${$i}${r}`), "Input", e[r]);
395
395
  return s.lock(t), t;
396
396
  }
397
- function Tn(s, e) {
397
+ function An(s, e) {
398
398
  const t = /* @__PURE__ */ new Map(), r = (n, o, i) => {
399
399
  const a = Pe("sha256");
400
400
  o.updateCacheKey(n, a, i);
@@ -405,9 +405,9 @@ function Tn(s, e) {
405
405
  }
406
406
  return t.get(c);
407
407
  };
408
- return r(e.template, $n, e.hashToSource);
408
+ return r(e.template, Ln, e.hashToSource);
409
409
  }
410
- const rs = {
410
+ const ns = {
411
411
  updateCacheKey(s, e, t) {
412
412
  e.update(fe.type.name).update(fe.type.version).update(s.name).update(s.version).update(Ee(s.name, t, s.sourceHash));
413
413
  },
@@ -425,12 +425,12 @@ const rs = {
425
425
  const n = le.fromV3Data(s, Ee(s.name, r, s.sourceHash)), o = e.createStruct(le.type, n.data);
426
426
  return e.setKValue(o, le.metaNameKey, JSON.stringify(n.name)), e.lock(o), o;
427
427
  }
428
- }, $n = {
428
+ }, Ln = {
429
429
  updateCacheKey(s, e, t) {
430
430
  e.update(X.type.name).update(X.type.version).update(s.hashOverride ?? "no-override").update(s.name).update(s.version).update(Ee(s.name, t, s.sourceHash));
431
431
  const r = (n) => (n.sort((o, i) => o[0] === i[0] ? 0 : o[0] < i[0] ? -1 : 1), n);
432
432
  for (const [n, o] of r(Object.entries(s.libs ?? {})))
433
- e.update("lib:" + n), rs.updateCacheKey(o, e, t);
433
+ e.update("lib:" + n), ns.updateCacheKey(o, e, t);
434
434
  for (const [n, o] of r(Object.entries(s.software ?? {})))
435
435
  e.update("soft:" + n), Ye.updateCacheKey(o, e, t);
436
436
  for (const [n, o] of r(Object.entries(s.assets ?? {})))
@@ -445,7 +445,7 @@ const rs = {
445
445
  );
446
446
  for (const [a, c] of Object.entries(s.libs ?? {})) {
447
447
  const l = X.libField(n, a);
448
- e.createField(l, "Input"), e.setField(l, t(c, rs, r));
448
+ e.createField(l, "Input"), e.setField(l, t(c, ns, r));
449
449
  }
450
450
  for (const [a, c] of Object.entries(s.software ?? {})) {
451
451
  const l = X.swField(n, a);
@@ -457,7 +457,7 @@ const rs = {
457
457
  }
458
458
  for (const [a, c] of Object.entries(s.templates ?? {})) {
459
459
  const l = X.tplField(n, a);
460
- e.createField(l, "Input"), e.setField(l, t(c, $n, r));
460
+ e.createField(l, "Input"), e.setField(l, t(c, Ln, r));
461
461
  }
462
462
  if (e.lock(n), !s.hashOverride) return n;
463
463
  const o = e.createStruct(
@@ -473,29 +473,29 @@ function Ee(s, e, t) {
473
473
  `trying to get "${s}" source: sources map doesn't contain source hash ${t}`
474
474
  );
475
475
  }
476
- function $i(s, e) {
477
- const t = Uo(e.content), r = t.type;
476
+ function Di(s, e) {
477
+ const t = Go(e.content), r = t.type;
478
478
  switch (r) {
479
479
  case "pl.tengo-template.v2":
480
- return Ln(s, t);
480
+ return Nn(s, t);
481
481
  case "pl.tengo-template.v3":
482
- return Tn(s, t);
482
+ return An(s, t);
483
483
  default:
484
484
  Y(r);
485
485
  }
486
486
  }
487
- function Ai(s, e) {
487
+ function Ni(s, e) {
488
488
  const t = e.data, r = t.type;
489
489
  switch (r) {
490
490
  case "pl.tengo-template.v2":
491
- return Ln(s, t);
491
+ return Nn(s, t);
492
492
  case "pl.tengo-template.v3":
493
- return Tn(s, t);
493
+ return An(s, t);
494
494
  default:
495
495
  Y(r);
496
496
  }
497
497
  }
498
- const ss = {
498
+ const os = {
499
499
  hash(s, e) {
500
500
  e.update(fe.type.name).update(fe.type.version).update(s.name).update(s.version).update(s.src);
501
501
  },
@@ -513,12 +513,12 @@ const ss = {
513
513
  const r = le.fromV2Data(s), n = e.createStruct(le.type, r.data);
514
514
  return e.setKValue(n, le.metaNameKey, JSON.stringify(r.name)), e.lock(n), n;
515
515
  }
516
- }, An = {
516
+ }, Dn = {
517
517
  hash(s, e) {
518
518
  e.update(X.type.name).update(X.type.version).update(s.hashOverride ?? "no-override").update(s.name).update(s.version).update(s.src);
519
519
  const t = (r) => (r.sort((n, o) => n[0] === o[0] ? 0 : n[0] < o[0] ? -1 : 1), r);
520
520
  for (const [r, n] of t(Object.entries(s.libs ?? {})))
521
- e.update("lib:" + r), ss.hash(n, e);
521
+ e.update("lib:" + r), os.hash(n, e);
522
522
  for (const [r, n] of t(Object.entries(s.software ?? {})))
523
523
  e.update("soft:" + r), Qe.hash(n, e);
524
524
  for (const [r, n] of t(Object.entries(s.assets ?? {})))
@@ -533,7 +533,7 @@ const ss = {
533
533
  );
534
534
  for (const [i, a] of Object.entries(s.libs ?? {})) {
535
535
  const c = X.libField(r, i);
536
- e.createField(c, "Input"), e.setField(c, t(a, ss));
536
+ e.createField(c, "Input"), e.setField(c, t(a, os));
537
537
  }
538
538
  for (const [i, a] of Object.entries(s.software ?? {})) {
539
539
  const c = X.swField(r, i);
@@ -545,7 +545,7 @@ const ss = {
545
545
  }
546
546
  for (const [i, a] of Object.entries(s.templates ?? {})) {
547
547
  const c = X.tplField(r, i);
548
- e.createField(c, "Input"), e.setField(c, t(a, An));
548
+ e.createField(c, "Input"), e.setField(c, t(a, Dn));
549
549
  }
550
550
  if (e.lock(r), !s.hashOverride) return r;
551
551
  const n = e.createStruct(
@@ -555,7 +555,7 @@ const ss = {
555
555
  return e.createField(o, "Service"), e.setField(o, r), e.lock(n), n;
556
556
  }
557
557
  };
558
- function Ln(s, e) {
558
+ function Nn(s, e) {
559
559
  const t = /* @__PURE__ */ new Map(), r = (n, o) => {
560
560
  const i = Pe("sha256");
561
561
  o.hash(n, i);
@@ -566,13 +566,13 @@ function Ln(s, e) {
566
566
  }
567
567
  return t.get(a);
568
568
  };
569
- return r(e, An);
569
+ return r(e, Dn);
570
570
  }
571
- const Li = { name: "TengoTemplateGet", version: "1" }, Di = "registry", Ni = "templateURI", Bi = "template", ru = { name: "TengoTemplatePack", version: "1" }, su = {
571
+ const Bi = { name: "TengoTemplateGet", version: "1" }, ji = "registry", xi = "templateURI", Vi = "template", su = { name: "TengoTemplatePack", version: "1" }, nu = {
572
572
  name: "TengoTemplatePackConvert",
573
573
  version: "1"
574
- }, nu = "templatePack", ou = "template";
575
- async function Dn(s) {
574
+ }, ou = "templatePack", iu = "template";
575
+ async function Bn(s) {
576
576
  switch (s.type) {
577
577
  case "from-file":
578
578
  return {
@@ -588,36 +588,36 @@ async function Dn(s) {
588
588
  return Y(s);
589
589
  }
590
590
  }
591
- function ji(s, e) {
592
- const t = s.createStruct(Li), r = M(t, Di), n = M(t, Ni), o = M(t, Bi);
591
+ function Ui(s, e) {
592
+ const t = s.createStruct(Bi), r = M(t, ji), n = M(t, xi), o = M(t, Vi);
593
593
  return s.setField(r, s.createValue(L.JsonString, Buffer.from(JSON.stringify(e.registry)))), s.setField(n, s.createValue(L.JsonString, Buffer.from(JSON.stringify(e.path)))), o;
594
594
  }
595
- function ut(s, e) {
595
+ function dt(s, e) {
596
596
  switch (e.type) {
597
597
  case "from-registry":
598
- return ji(s, e);
598
+ return Ui(s, e);
599
599
  case "explicit":
600
- return $i(s, e);
600
+ return Di(s, e);
601
601
  case "prepared":
602
- return Ai(s, e);
602
+ return Ni(s, e);
603
603
  default:
604
604
  return Y(e);
605
605
  }
606
606
  }
607
- const Nn = { name: "Frontend/FromUrl", version: "1" }, Bn = {
607
+ const jn = { name: "Frontend/FromUrl", version: "1" }, xn = {
608
608
  name: "Frontend/FromFolder",
609
609
  version: "1"
610
610
  };
611
- function xi(s, e) {
611
+ function Ji(s, e) {
612
612
  switch (e.type) {
613
613
  case "url":
614
614
  return s.createValue(
615
- Nn,
615
+ jn,
616
616
  JSON.stringify({ url: e.url })
617
617
  );
618
618
  case "local":
619
619
  return s.createValue(
620
- Bn,
620
+ xn,
621
621
  JSON.stringify({
622
622
  path: e.path,
623
623
  signature: e.signature
@@ -627,12 +627,12 @@ function xi(s, e) {
627
627
  return Y(e);
628
628
  }
629
629
  }
630
- class Vi {
630
+ class Mi {
631
631
  constructor() {
632
- R(this, "nextMessageId", 0);
633
- R(this, "worker");
634
- R(this, "pendingRequests", /* @__PURE__ */ new Map());
635
- const e = typeof global < "u" && "__WORKER_PATH__" in global ? global.__WORKER_PATH__ : _.resolve(import.meta.dirname, "worker.js"), t = this.worker = new Jo(
632
+ b(this, "nextMessageId", 0);
633
+ b(this, "worker");
634
+ b(this, "pendingRequests", /* @__PURE__ */ new Map());
635
+ const e = typeof global < "u" && "__WORKER_PATH__" in global ? global.__WORKER_PATH__ : _.resolve(import.meta.dirname, "worker.js"), t = this.worker = new _o(
636
636
  e,
637
637
  {
638
638
  workerData: {}
@@ -663,24 +663,24 @@ class Vi {
663
663
  return this.terminate();
664
664
  }
665
665
  }
666
- const Ui = { name: "BlockPackCustom", version: "1" }, jn = "template", xn = "frontend";
667
- function ns(s) {
666
+ const Gi = { name: "BlockPackCustom", version: "1" }, Vn = "template", Un = "frontend";
667
+ function is(s) {
668
668
  return s.endsWith("/") ? s : `${s}/`;
669
669
  }
670
- function Ji(s) {
670
+ function _i(s) {
671
671
  return Buffer.from(s).toString("utf8");
672
672
  }
673
673
  function Ze(s) {
674
- return JSON.parse(Ji(s));
674
+ return JSON.parse(_i(s));
675
675
  }
676
- class Mi {
676
+ class qi {
677
677
  constructor(e, t, r) {
678
- R(this, "remoteContentCache", new vn({
678
+ b(this, "remoteContentCache", new Er({
679
679
  max: 500,
680
680
  maxSize: 128 * 1024 * 1024,
681
681
  fetchMethod: async (e) => {
682
682
  const t = this.http !== void 0 ? { dispatcher: this.http } : {};
683
- return await (await kr(e, t)).body.arrayBuffer();
683
+ return await (await Rr(e, t)).body.arrayBuffer();
684
684
  },
685
685
  sizeCalculation: (e) => e.byteLength
686
686
  }));
@@ -693,17 +693,17 @@ class Mi {
693
693
  case "prepared":
694
694
  return e.config;
695
695
  case "dev-v1": {
696
- const t = await Zr(e.folder), r = await se.promises.readFile(t.config, { encoding: "utf-8" });
696
+ const t = await ts(e.folder), r = await se.promises.readFile(t.config, { encoding: "utf-8" });
697
697
  return JSON.parse(r);
698
698
  }
699
699
  case "dev-v2": {
700
- const t = await qr(e.folder), r = await se.promises.readFile(t.components.model.file, {
700
+ const t = await Hr(e.folder), r = await se.promises.readFile(t.components.model.file, {
701
701
  encoding: "utf-8"
702
702
  });
703
703
  return JSON.parse(r);
704
704
  }
705
705
  case "from-registry-v1": {
706
- const t = `${ns(e.registryUrl)}${me.packageContentPrefix({ organization: e.id.organization, package: e.id.name, version: e.id.version })}`, r = await this.remoteContentCache.forceFetch(`${t}/config.json`);
706
+ const t = `${is(e.registryUrl)}${me.packageContentPrefix({ organization: e.id.organization, package: e.id.name, version: e.id.version })}`, r = await this.remoteContentCache.forceFetch(`${t}/config.json`);
707
707
  return Ze(r);
708
708
  }
709
709
  case "from-registry-v2": {
@@ -720,7 +720,7 @@ class Mi {
720
720
  if (e.type === "prepared")
721
721
  return e;
722
722
  const t = await this.prepareWithoutUnpacking(e);
723
- const r = Jr(n, new Vi(), !0);
723
+ const r = Gr(n, new Mi(), !0);
724
724
  return {
725
725
  ...t,
726
726
  type: "prepared",
@@ -732,7 +732,7 @@ class Mi {
732
732
  } catch (o) {
733
733
  var i = o, a = !0;
734
734
  } finally {
735
- var c = Mr(n, i, a);
735
+ var c = _r(n, i, a);
736
736
  c && await c;
737
737
  }
738
738
  }
@@ -741,7 +741,7 @@ class Mi {
741
741
  case "explicit":
742
742
  return e;
743
743
  case "dev-v1": {
744
- const t = await Zr(e.folder), r = await se.promises.readFile(t.workflow), n = JSON.parse(
744
+ const t = await ts(e.folder), r = await se.promises.readFile(t.workflow), n = JSON.parse(
745
745
  await se.promises.readFile(t.config, "utf-8")
746
746
  ), o = t.ui;
747
747
  return {
@@ -760,14 +760,14 @@ class Mi {
760
760
  };
761
761
  }
762
762
  case "dev-v2": {
763
- const t = await qr(e.folder), r = JSON.parse(
763
+ const t = await Hr(e.folder), r = JSON.parse(
764
764
  await se.promises.readFile(t.components.model.file, {
765
765
  encoding: "utf-8"
766
766
  })
767
767
  ), n = await se.promises.readFile(
768
768
  t.components.workflow.main.file
769
769
  ), o = t.components.ui.folder, i = { ...e };
770
- return e.mtime === void 0 && (i.mtime = await Pr(t)), {
770
+ return e.mtime === void 0 && (i.mtime = await Ir(t)), {
771
771
  type: "explicit",
772
772
  template: {
773
773
  type: "explicit",
@@ -783,7 +783,7 @@ class Mi {
783
783
  };
784
784
  }
785
785
  case "from-registry-v1": {
786
- const t = `${ns(e.registryUrl)}${me.packageContentPrefix({ organization: e.id.organization, package: e.id.name, version: e.id.version })}`, r = `${t}/template.plj.gz`, n = await this.remoteContentCache.forceFetch(r), o = new Uint8Array(n), i = await this.remoteContentCache.forceFetch(`${t}/config.json`), a = Ze(i);
786
+ const t = `${is(e.registryUrl)}${me.packageContentPrefix({ organization: e.id.organization, package: e.id.name, version: e.id.version })}`, r = `${t}/template.plj.gz`, n = await this.remoteContentCache.forceFetch(r), o = new Uint8Array(n), i = await this.remoteContentCache.forceFetch(`${t}/config.json`), a = Ze(i);
787
787
  return {
788
788
  type: "explicit",
789
789
  template: {
@@ -819,14 +819,14 @@ class Mi {
819
819
  }
820
820
  }
821
821
  }
822
- function Gi(s, e) {
823
- const t = { config: e.config, source: e.source }, r = s.createStruct(Ui, JSON.stringify(t));
824
- return s.createField(M(r, jn), "Input", ut(s, e.template)), s.createField(M(r, xn), "Input", xi(s, e.frontend)), s.lock(r), r;
822
+ function Ki(s, e) {
823
+ const t = { config: e.config, source: e.source }, r = s.createStruct(Gi, JSON.stringify(t));
824
+ return s.createField(M(r, Vn), "Input", dt(s, e.template)), s.createField(M(r, Un), "Input", Ji(s, e.frontend)), s.lock(r), r;
825
825
  }
826
- function os(s, e) {
826
+ function as(s, e) {
827
827
  switch (e.type) {
828
828
  case "prepared":
829
- return Gi(s, e);
829
+ return Ki(s, e);
830
830
  default:
831
831
  return Y(e.type);
832
832
  }
@@ -834,10 +834,10 @@ function os(s, e) {
834
834
  function et(s, e, t) {
835
835
  return { __isRef: !0, blockId: s, name: e };
836
836
  }
837
- function _i(s) {
837
+ function Hi(s) {
838
838
  return typeof s == "object" && s !== null && "__isRef" in s && s.__isRef === !0 && "blockId" in s && "name" in s;
839
839
  }
840
- function wr(s, e, t) {
840
+ function Sr(s, e, t) {
841
841
  const r = typeof e;
842
842
  switch (r) {
843
843
  case "function":
@@ -850,21 +850,21 @@ function wr(s, e, t) {
850
850
  return;
851
851
  case "object":
852
852
  if (e === null) return;
853
- if (_i(e))
853
+ if (Hi(e))
854
854
  t === void 0 || t.has(e.blockId) ? (s.upstreams.add(e.blockId), e.requireEnrichments && s.upstreamsRequiringEnrichments.add(e.blockId)) : s.missingReferences = !0;
855
855
  else if (Array.isArray(e))
856
- for (const n of e) wr(s, n, t);
856
+ for (const n of e) Sr(s, n, t);
857
857
  else
858
858
  for (const [, n] of Object.entries(e))
859
- wr(s, n, t);
859
+ Sr(s, n, t);
860
860
  return;
861
861
  default:
862
862
  Y(r);
863
863
  }
864
864
  }
865
- function qi(s, e) {
865
+ function Wi(s, e) {
866
866
  const t = { upstreams: /* @__PURE__ */ new Set(), upstreamsRequiringEnrichments: /* @__PURE__ */ new Set(), missingReferences: !1 };
867
- return wr(t, s, e), t;
867
+ return Sr(t, s, e), t;
868
868
  }
869
869
  function re(s) {
870
870
  return {
@@ -873,10 +873,10 @@ function re(s) {
873
873
  }
874
874
  };
875
875
  }
876
- class Vn {
876
+ class Jn {
877
877
  constructor(e) {
878
878
  /** Nodes are stored in the map in topological order */
879
- R(this, "nodes");
879
+ b(this, "nodes");
880
880
  this.nodes = e;
881
881
  }
882
882
  traverseIds(e, ...t) {
@@ -903,7 +903,7 @@ class Vn {
903
903
  }
904
904
  }
905
905
  }
906
- function Sr(s) {
906
+ function br(s) {
907
907
  const e = /* @__PURE__ */ new Map();
908
908
  let t;
909
909
  for (const { id: r } of re(s)) {
@@ -913,14 +913,14 @@ function Sr(s) {
913
913
  };
914
914
  e.set(r, n), t === void 0 ? (n.directUpstream = n.upstream = /* @__PURE__ */ new Set(), n.enrichments = n.enrichmentTargets = /* @__PURE__ */ new Set()) : (n.directUpstream = n.upstream = /* @__PURE__ */ new Set([t.id]), t.directDownstream = t.downstream = /* @__PURE__ */ new Set([n.id]), t.enrichments = t.enrichmentTargets = /* @__PURE__ */ new Set()), t = n;
915
915
  }
916
- return t !== void 0 && (t.directDownstream = t.downstream = /* @__PURE__ */ new Set()), new Vn(e);
916
+ return t !== void 0 && (t.directDownstream = t.downstream = /* @__PURE__ */ new Set()), new Jn(e);
917
917
  }
918
918
  function st(s, e) {
919
- const t = /* @__PURE__ */ new Map(), r = new Vn(t), n = /* @__PURE__ */ new Set();
919
+ const t = /* @__PURE__ */ new Map(), r = new Jn(t), n = /* @__PURE__ */ new Set();
920
920
  for (const { id: o } of re(s)) {
921
921
  const i = e(o);
922
922
  if (i === void 0) continue;
923
- const a = qi(i.args, n), c = /* @__PURE__ */ new Set([
923
+ const a = Wi(i.args, n), c = /* @__PURE__ */ new Set([
924
924
  ...a.upstreams,
925
925
  ...r.traverseIds("enrichments", ...a.upstreamsRequiringEnrichments)
926
926
  ]), l = /* @__PURE__ */ new Set();
@@ -952,37 +952,37 @@ function st(s, e) {
952
952
  }
953
953
  return r;
954
954
  }
955
- function Ki(s, e) {
955
+ function zi(s, e) {
956
956
  if (s.size !== e.size) return !1;
957
957
  for (const t of s) if (!e.has(t)) return !1;
958
958
  return !0;
959
959
  }
960
- function br(s, e) {
961
- if (s.size > e.size) return br(e, s);
960
+ function kr(s, e) {
961
+ if (s.size > e.size) return kr(e, s);
962
962
  for (const t of s) if (e.has(t)) return !0;
963
963
  return !1;
964
964
  }
965
- function is(s, e) {
965
+ function cs(s, e) {
966
966
  const t = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Set();
967
967
  return s.nodes.forEach((o) => {
968
968
  const i = e.nodes.get(o.id);
969
- i === void 0 ? t.add(o.id) : (!Ki(o.upstream, i.upstream) || br(o.upstream, n)) && n.add(o.id);
969
+ i === void 0 ? t.add(o.id) : (!zi(o.upstream, i.upstream) || kr(o.upstream, n)) && n.add(o.id);
970
970
  }), e.nodes.forEach((o) => {
971
- s.nodes.has(o.id) ? br(o.upstream, n) && n.add(o.id) : r.add(o.id);
971
+ s.nodes.has(o.id) ? kr(o.upstream, n) && n.add(o.id) : r.add(o.id);
972
972
  }), { onlyInA: t, onlyInB: r, different: n };
973
973
  }
974
- let St;
975
- async function Un() {
976
- if (St === void 0) {
977
- const s = await Dn(ye["pframes.export-pframe-for-ui"]);
974
+ let bt;
975
+ async function Mn() {
976
+ if (bt === void 0) {
977
+ const s = await Bn(ye["pframes.export-pframe-for-ui"]);
978
978
  if (s.type !== "explicit") throw new Error("Unexpected prepared template type.");
979
979
  const e = Pe("sha256").update(s.content).digest("hex");
980
- St = { spec: s, hash: e };
980
+ bt = { spec: s, hash: e };
981
981
  }
982
- return St;
982
+ return bt;
983
983
  }
984
- function Hi(s, e, t) {
985
- return Ir(s, e, !0, { pf: t }, ["result"]).result;
984
+ function Xi(s, e, t) {
985
+ return Tr(s, e, !0, { pf: t }, ["result"]).result;
986
986
  }
987
987
  let Se;
988
988
  function ee() {
@@ -993,7 +993,7 @@ function ee() {
993
993
  logOutputRecalculations: process.env.MI_LOG_OUTPUT_RECALCULATIONS !== void 0
994
994
  }, process.env.MI_LOG_OUTPUT_STATUS && (Se.logOutputStatus = process.env.MI_LOG_OUTPUT_STATUS === "unstable-only" ? "unstable-only" : "any"), process.env.MI_LOG_TREE_STAT && (Se.logTreeStats = process.env.MI_LOG_TREE_STAT === "cumulative" ? "cumulative" : "per-request"), Se);
995
995
  }
996
- function bt(s, e) {
996
+ function kt(s, e) {
997
997
  let t = !1, r, n;
998
998
  return () => {
999
999
  if (!t)
@@ -1002,13 +1002,13 @@ function bt(s, e) {
1002
1002
  return r !== o && (r = o, n = e()), e();
1003
1003
  };
1004
1004
  }
1005
- class as {
1005
+ class ls {
1006
1006
  constructor(e, t, r, n) {
1007
- R(this, "currentArgsC", bt(
1007
+ b(this, "currentArgsC", kt(
1008
1008
  () => this.fields.currentArgs.modCount,
1009
1009
  () => Ve(this.fields.currentArgs.value)
1010
1010
  ));
1011
- R(this, "prodArgsC", bt(
1011
+ b(this, "prodArgsC", kt(
1012
1012
  () => {
1013
1013
  var e;
1014
1014
  return (e = this.fields.prodArgs) == null ? void 0 : e.modCount;
@@ -1020,7 +1020,7 @@ class as {
1020
1020
  return Ve(e);
1021
1021
  }
1022
1022
  ));
1023
- R(this, "productionStaleC", bt(
1023
+ b(this, "productionStaleC", kt(
1024
1024
  () => {
1025
1025
  var e;
1026
1026
  return `${this.fields.currentArgs.modCount}_${(e = this.fields.prodArgs) == null ? void 0 : e.modCount}`;
@@ -1066,33 +1066,33 @@ class as {
1066
1066
  getTemplate(e) {
1067
1067
  return e.getFutureFieldValue(
1068
1068
  L.unwrapHolder(e, this.fields.blockPack.ref),
1069
- jn,
1069
+ Vn,
1070
1070
  "Input"
1071
1071
  );
1072
1072
  }
1073
1073
  }
1074
- const Wi = (s) => {
1074
+ const Yi = (s) => {
1075
1075
  throw new Error(`No new block info for ${s}`);
1076
1076
  };
1077
- class ct {
1077
+ class lt {
1078
1078
  constructor(e, t, r, n, o, i, a, c, l, u, d, p) {
1079
- R(this, "globalModCount", 0);
1080
- R(this, "fieldsChanged", !1);
1079
+ b(this, "globalModCount", 0);
1080
+ b(this, "fieldsChanged", !1);
1081
1081
  //
1082
1082
  // Change trackers
1083
1083
  //
1084
- R(this, "lastModifiedChanged", !1);
1085
- R(this, "structureChanged", !1);
1086
- R(this, "metaChanged", !1);
1087
- R(this, "renderingStateChanged", !1);
1084
+ b(this, "lastModifiedChanged", !1);
1085
+ b(this, "structureChanged", !1);
1086
+ b(this, "metaChanged", !1);
1087
+ b(this, "renderingStateChanged", !1);
1088
1088
  /** Set blocks will be assigned current mutator author marker on save */
1089
- R(this, "blocksWithChangedInputs", /* @__PURE__ */ new Set());
1089
+ b(this, "blocksWithChangedInputs", /* @__PURE__ */ new Set());
1090
1090
  //
1091
1091
  // Graph calculation
1092
1092
  //
1093
- R(this, "stagingGraph");
1094
- R(this, "pendingProductionGraph");
1095
- R(this, "actualProductionGraph");
1093
+ b(this, "stagingGraph");
1094
+ b(this, "pendingProductionGraph");
1095
+ b(this, "actualProductionGraph");
1096
1096
  this.rid = e, this.tx = t, this.author = r, this.schema = n, this.lastModified = o, this.meta = i, this.struct = a, this.renderingState = c, this.blocksInLimbo = l, this.blockInfos = u, this.ctxExportTplHolder = d, this.projectHelper = p;
1097
1097
  }
1098
1098
  fixProblemsAndMigrate() {
@@ -1101,7 +1101,7 @@ class ct {
1101
1101
  });
1102
1102
  let e;
1103
1103
  this.blockInfos.forEach((t) => {
1104
- t.fields.blockSettings === void 0 && (e === void 0 && (e = this.createJsonFieldValue(_r)), this.setBlockFieldObj(t.id, "blockSettings", e));
1104
+ t.fields.blockSettings === void 0 && (e === void 0 && (e = this.createJsonFieldValue(Kr)), this.setBlockFieldObj(t.id, "blockSettings", e));
1105
1105
  });
1106
1106
  }
1107
1107
  get wasModified() {
@@ -1111,7 +1111,7 @@ class ct {
1111
1111
  return JSON.parse(JSON.stringify(this.struct));
1112
1112
  }
1113
1113
  getStagingGraph() {
1114
- return this.stagingGraph === void 0 && (this.stagingGraph = Sr(this.struct)), this.stagingGraph;
1114
+ return this.stagingGraph === void 0 && (this.stagingGraph = br(this.struct)), this.stagingGraph;
1115
1115
  }
1116
1116
  getProductionGraphBlockInfo(e, t) {
1117
1117
  const r = this.getBlockInfo(e);
@@ -1122,7 +1122,7 @@ class ct {
1122
1122
  } else
1123
1123
  n = D(r.fields.currentArgs), o = r.currentArgs;
1124
1124
  const i = D(r.fields.blockPack);
1125
- return Wr(n.ref) && Wr(i.ref) ? {
1125
+ return Xr(n.ref) && Xr(i.ref) ? {
1126
1126
  args: o,
1127
1127
  enrichmentTargets: this.projectHelper.getEnrichmentTargets(
1128
1128
  () => r.config,
@@ -1228,9 +1228,9 @@ class ct {
1228
1228
  const l = a === "args" ? "currentArgs" : "uiState";
1229
1229
  let u, d = !1;
1230
1230
  if (a === "args")
1231
- u = So(c);
1231
+ u = Ro(c);
1232
1232
  else {
1233
- const { data: f, isGzipped: v } = bo(c);
1233
+ const { data: f, isGzipped: v } = Co(c);
1234
1234
  u = f, d = v;
1235
1235
  }
1236
1236
  if (Buffer.compare(o.fields[l].value, u) === 0) continue;
@@ -1253,7 +1253,7 @@ class ct {
1253
1253
  if (((o = n.fields.prodCtx) == null ? void 0 : o.ref) === void 0)
1254
1254
  throw new Error("One of the upstreams staging is not rendered.");
1255
1255
  t.push(L.unwrapHolder(this.tx, n.fields.prodCtx.ref));
1256
- }), ts(this.tx, t);
1256
+ }), ss(this.tx, t);
1257
1257
  }
1258
1258
  createStagingCtx(e) {
1259
1259
  const t = [];
@@ -1263,16 +1263,16 @@ class ct {
1263
1263
  if (((o = n.fields.stagingCtx) == null ? void 0 : o.ref) === void 0)
1264
1264
  throw new Error("One of the upstreams staging is not rendered.");
1265
1265
  t.push(L.unwrapHolder(this.tx, n.fields.stagingCtx.ref)), ((i = n.fields.prodCtx) == null ? void 0 : i.ref) !== void 0 && t.push(L.unwrapHolder(this.tx, n.fields.prodCtx.ref));
1266
- }), ts(this.tx, t);
1266
+ }), ss(this.tx, t);
1267
1267
  }
1268
1268
  exportCtx(e) {
1269
- return Hi(this.tx, L.unwrapHolder(this.tx, this.ctxExportTplHolder), e);
1269
+ return Xi(this.tx, L.unwrapHolder(this.tx, this.ctxExportTplHolder), e);
1270
1270
  }
1271
1271
  renderStagingFor(e) {
1272
1272
  this.resetStaging(e);
1273
1273
  const t = this.getBlockInfo(e), r = this.createStagingCtx(this.getStagingGraph().nodes.get(e).upstream);
1274
1274
  if (this.getBlock(e).renderingMode !== "Heavy") throw new Error("not supported yet");
1275
- const n = t.getTemplate(this.tx), o = es(this.tx, n, {
1275
+ const n = t.getTemplate(this.tx), o = rs(this.tx, n, {
1276
1276
  args: t.fields.currentArgs.ref,
1277
1277
  blockId: this.tx.createValue(L.JsonString, JSON.stringify(e)),
1278
1278
  isProduction: this.tx.createValue(L.JsonBool, JSON.stringify(!1)),
@@ -1290,7 +1290,7 @@ class ct {
1290
1290
  const t = this.getBlockInfo(e), r = this.createProdCtx(this.getPendingProductionGraph().nodes.get(e).upstream);
1291
1291
  if (this.getBlock(e).renderingMode === "Light")
1292
1292
  throw new Error("Can't render production for light block.");
1293
- const n = t.getTemplate(this.tx), o = es(this.tx, n, {
1293
+ const n = t.getTemplate(this.tx), o = rs(this.tx, n, {
1294
1294
  args: t.fields.currentArgs.ref,
1295
1295
  blockId: this.tx.createValue(L.JsonString, JSON.stringify(e)),
1296
1296
  isProduction: this.tx.createValue(L.JsonBool, JSON.stringify(!0)),
@@ -1307,27 +1307,27 @@ class ct {
1307
1307
  // Structure changes
1308
1308
  //
1309
1309
  /** Very generic method, better check for more specialized case-specific methods first. */
1310
- updateStructure(e, t = Wi) {
1311
- const r = this.getStagingGraph(), n = this.getActualProductionGraph(), o = Sr(e), i = is(r, o);
1310
+ updateStructure(e, t = Yi) {
1311
+ const r = this.getStagingGraph(), n = this.getActualProductionGraph(), o = br(e), i = cs(r, o);
1312
1312
  for (const l of i.onlyInA) {
1313
1313
  const { fields: u } = this.getBlockInfo(l);
1314
1314
  this.deleteBlockFields(l, ...Object.keys(u)), this.blockInfos.delete(l), this.blocksInLimbo.delete(l) && (this.renderingStateChanged = !0);
1315
1315
  }
1316
1316
  for (const l of i.onlyInB) {
1317
- const u = t(l), d = new as(l, {}, ke(u.blockPack.config), u.blockPack.source);
1317
+ const u = t(l), d = new ls(l, {}, ke(u.blockPack.config), u.blockPack.source);
1318
1318
  this.blockInfos.set(l, d);
1319
- const p = os(this.tx, u.blockPack);
1319
+ const p = as(this.tx, u.blockPack);
1320
1320
  this.setBlockField(l, "blockPack", L.wrapInHolder(this.tx, p), "NotReady"), this.setBlockFieldObj(
1321
1321
  l,
1322
1322
  "blockSettings",
1323
- this.createJsonFieldValue(_r)
1323
+ this.createJsonFieldValue(Kr)
1324
1324
  ), this.setBlockFieldObj(l, "currentArgs", this.createJsonFieldValueByContent(u.args)), this.setBlockFieldObj(l, "uiState", this.createJsonFieldValueByContent(u.uiState ?? "{}")), d.check();
1325
1325
  }
1326
1326
  for (const l of i.different) this.resetStaging(l);
1327
1327
  const a = st(
1328
1328
  e,
1329
1329
  (l) => this.getProductionGraphBlockInfo(l, !0)
1330
- ), c = is(n, a);
1330
+ ), c = cs(n, a);
1331
1331
  n.traverse("downstream", [...c.different], (l) => {
1332
1332
  this.resetOrLimboProduction(l.id);
1333
1333
  }), (i.onlyInB.size > 0 || i.onlyInA.size > 0 || i.different.size > 0) && this.resetStagingRefreshTimestamp(), this.struct = e, this.structureChanged = !0, this.stagingGraph = void 0, this.pendingProductionGraph = void 0, this.actualProductionGraph = void 0, this.updateLastModified();
@@ -1376,7 +1376,7 @@ class ct {
1376
1376
  this.setBlockField(
1377
1377
  e,
1378
1378
  "blockPack",
1379
- L.wrapInHolder(this.tx, os(this.tx, t)),
1379
+ L.wrapInHolder(this.tx, as(this.tx, t)),
1380
1380
  "NotReady"
1381
1381
  ), r !== void 0 ? this.setStates([{ blockId: e, args: r.args, uiState: r.uiState }]) : this.getStagingGraph().traverse("downstream", [e], ({ id: o }) => this.resetStaging(o)), n.productionRendered && this.getActualProductionGraph().traverse(
1382
1382
  "downstream",
@@ -1425,7 +1425,7 @@ class ct {
1425
1425
  * accordingly */
1426
1426
  stopProduction(...e) {
1427
1427
  var i, a;
1428
- const t = this.getActualProductionGraph(), r = new yn(e), n = new Set(e), o = [];
1428
+ const t = this.getActualProductionGraph(), r = new Sn(e), n = new Set(e), o = [];
1429
1429
  for (; !r.isEmpty(); ) {
1430
1430
  const c = r.shift(), l = this.getBlockInfo(c).fields;
1431
1431
  if (!(((i = l.prodOutput) == null ? void 0 : i.status) === "Ready" && ((a = l.prodCtx) == null ? void 0 : a.status) === "Ready") && this.deleteBlockFields(c, "prodOutput", "prodCtx", "prodUiCtx", "prodArgs")) {
@@ -1485,13 +1485,13 @@ class ct {
1485
1485
  assignAuthorMarkers() {
1486
1486
  const e = this.author ? JSON.stringify(this.author) : void 0;
1487
1487
  for (const t of this.blocksWithChangedInputs)
1488
- e === void 0 ? this.tx.deleteKValue(this.rid, mr(t)) : this.tx.setKValue(this.rid, mr(t), e);
1489
- (this.metaChanged || this.structureChanged) && (e === void 0 ? this.tx.deleteKValue(this.rid, vr) : this.tx.setKValue(this.rid, vr, e));
1488
+ e === void 0 ? this.tx.deleteKValue(this.rid, vr(t)) : this.tx.setKValue(this.rid, vr(t), e);
1489
+ (this.metaChanged || this.structureChanged) && (e === void 0 ? this.tx.deleteKValue(this.rid, yr) : this.tx.setKValue(this.rid, yr, e));
1490
1490
  }
1491
1491
  save() {
1492
1492
  this.wasModified && (this.lastModifiedChanged && this.tx.setKValue(this.rid, Ge, JSON.stringify(this.lastModified)), this.structureChanged && this.tx.setKValue(this.rid, de, JSON.stringify(this.struct)), this.renderingStateChanged && this.tx.setKValue(
1493
1493
  this.rid,
1494
- at,
1494
+ ct,
1495
1495
  JSON.stringify({
1496
1496
  ...this.renderingState,
1497
1497
  blocksInLimbo: [...this.blocksInLimbo]
@@ -1499,35 +1499,35 @@ class ct {
1499
1499
  ), this.metaChanged && this.tx.setKValue(this.rid, _e, JSON.stringify(this.meta)), this.assignAuthorMarkers());
1500
1500
  }
1501
1501
  static async load(e, t, r, n) {
1502
- const o = t.getResourceData(r, !0), i = t.getKValueJson(r, it), a = t.getKValueJson(r, Ge), c = t.getKValueJson(r, _e), l = t.getKValueJson(r, de), u = t.getKValueJson(r, at), d = await o, p = /* @__PURE__ */ new Map();
1503
- for (const h of d.fields) {
1504
- const m = wi(h.name);
1502
+ const o = t.getResourceData(r, !0), i = t.getKValueJson(r, at), a = t.getKValueJson(r, Ge), c = t.getKValueJson(r, _e), l = t.getKValueJson(r, de), u = t.getKValueJson(r, ct), d = await o, p = /* @__PURE__ */ new Map();
1503
+ for (const g of d.fields) {
1504
+ const m = ki(g.name);
1505
1505
  if (m === void 0) continue;
1506
1506
  let w = p.get(m.blockId);
1507
1507
  w === void 0 && (w = {
1508
1508
  id: m.blockId,
1509
1509
  fields: {}
1510
- }, p.set(m.blockId, w)), w.fields[m.fieldName] = Ue(h.value) ? { modCount: 0 } : { modCount: 0, ref: h.value };
1510
+ }, p.set(m.blockId, w)), w.fields[m.fieldName] = Ue(g.value) ? { modCount: 0 } : { modCount: 0, ref: g.value };
1511
1511
  }
1512
1512
  const f = [];
1513
- p.forEach((h) => {
1514
- const m = h.fields;
1513
+ p.forEach((g) => {
1514
+ const m = g.fields;
1515
1515
  for (const [w, y] of Object.entries(m)) {
1516
1516
  if (y.ref === void 0) continue;
1517
- if (!Eo(y.ref) || Po(y.ref))
1517
+ if (!Io(y.ref) || Fo(y.ref))
1518
1518
  throw new Error("unexpected behaviour");
1519
- const k = w;
1519
+ const R = w;
1520
1520
  f.push([
1521
- h,
1522
- k,
1521
+ g,
1522
+ R,
1523
1523
  y,
1524
- t.getResourceData(y.ref, k == "blockPack")
1524
+ t.getResourceData(y.ref, R == "blockPack")
1525
1525
  ]);
1526
1526
  }
1527
1527
  });
1528
1528
  const [
1529
1529
  v,
1530
- g,
1530
+ h,
1531
1531
  S,
1532
1532
  E,
1533
1533
  { stagingRefreshTimestamp: j, blocksInLimbo: F }
@@ -1539,52 +1539,52 @@ class ct {
1539
1539
  u
1540
1540
  ]);
1541
1541
  if (v !== Me)
1542
- throw Number(v) < Number(Me) ? new Gr("Can't perform this action on this project because it has older schema. Try (re)loading the project to update it.") : new Gr("Can't perform this action on this project because it has newer schema. Upgrade your desktop app to the latest version.");
1542
+ throw Number(v) < Number(Me) ? new qr("Can't perform this action on this project because it has older schema. Try (re)loading the project to update it.") : new qr("Can't perform this action on this project because it has newer schema. Upgrade your desktop app to the latest version.");
1543
1543
  const B = [];
1544
- for (const [h, m, w, y] of f) {
1545
- const k = await y;
1546
- if (w.value = k.data, hr(k.error) ? w.status = "Error" : k.resourceReady || hr(k.originalResourceId) ? w.status = "Ready" : w.status = "NotReady", m === "blockPack") {
1547
- const b = k.fields.find((O) => O.name === L.HolderRefField);
1548
- if (b === void 0)
1544
+ for (const [g, m, w, y] of f) {
1545
+ const R = await y;
1546
+ if (w.value = R.data, mr(R.error) ? w.status = "Error" : R.resourceReady || mr(R.originalResourceId) ? w.status = "Ready" : w.status = "NotReady", m === "blockPack") {
1547
+ const k = R.fields.find((O) => O.name === L.HolderRefField);
1548
+ if (k === void 0)
1549
1549
  throw new Error("Block pack ref field is missing");
1550
- B.push([h, t.getResourceData(ot(b.value), !1)]);
1550
+ B.push([g, t.getResourceData(it(k.value), !1)]);
1551
1551
  }
1552
1552
  }
1553
- for (const [h, m] of B) {
1553
+ for (const [g, m] of B) {
1554
1554
  const w = await m, y = Ve(D(w.data));
1555
- h.blockConfig = ke(y.config), h.blockPack = y.source;
1555
+ g.blockConfig = ke(y.config), g.blockPack = y.source;
1556
1556
  }
1557
- const V = await Un(), P = yr(V.hash), N = d.fields.find(
1558
- (h) => h.name === P
1557
+ const V = await Mn(), P = wr(V.hash), N = d.fields.find(
1558
+ (g) => g.name === P
1559
1559
  );
1560
1560
  let C;
1561
- N !== void 0 ? C = ot(N.value) : (C = L.wrapInHolder(t, ut(t, V.spec)), t.createField(
1562
- M(r, yr(V.hash)),
1561
+ N !== void 0 ? C = it(N.value) : (C = L.wrapInHolder(t, dt(t, V.spec)), t.createField(
1562
+ M(r, wr(V.hash)),
1563
1563
  "Dynamic",
1564
1564
  C
1565
1565
  ));
1566
1566
  const G = { stagingRefreshTimestamp: j }, ce = new Set(F), z = /* @__PURE__ */ new Map();
1567
- p.forEach(({ id: h, fields: m, blockConfig: w, blockPack: y }) => z.set(
1568
- h,
1569
- new as(h, m, D(w), D(y))
1567
+ p.forEach(({ id: g, fields: m, blockConfig: w, blockPack: y }) => z.set(
1568
+ g,
1569
+ new ls(g, m, D(w), D(y))
1570
1570
  ));
1571
1571
  const J = /* @__PURE__ */ new Set();
1572
- for (const h of re(E)) {
1573
- if (!z.has(h.id))
1574
- throw new Error(`Inconsistent project structure: no inputs for ${h.id}`);
1575
- J.add(h.id);
1572
+ for (const g of re(E)) {
1573
+ if (!z.has(g.id))
1574
+ throw new Error(`Inconsistent project structure: no inputs for ${g.id}`);
1575
+ J.add(g.id);
1576
1576
  }
1577
- z.forEach((h) => {
1578
- if (!J.has(h.id))
1579
- throw new Error(`Inconsistent project structure: no structure entry for ${h.id}`);
1580
- h.check();
1577
+ z.forEach((g) => {
1578
+ if (!J.has(g.id))
1579
+ throw new Error(`Inconsistent project structure: no structure entry for ${g.id}`);
1580
+ g.check();
1581
1581
  });
1582
- const W = new ct(
1582
+ const W = new lt(
1583
1583
  r,
1584
1584
  t,
1585
1585
  n,
1586
1586
  v,
1587
- g,
1587
+ h,
1588
1588
  S,
1589
1589
  E,
1590
1590
  G,
@@ -1596,33 +1596,33 @@ class ct {
1596
1596
  return W.fixProblemsAndMigrate(), W;
1597
1597
  }
1598
1598
  }
1599
- async function zi(s, e = gi) {
1600
- const t = s.createEphemeral(hi);
1599
+ async function Qi(s, e = vi) {
1600
+ const t = s.createEphemeral(yi);
1601
1601
  s.lock(t);
1602
1602
  const r = String(Date.now());
1603
- s.setKValue(t, it, JSON.stringify(Me)), s.setKValue(t, Or, r), s.setKValue(t, Ge, r), s.setKValue(t, _e, JSON.stringify(e)), s.setKValue(t, de, JSON.stringify(pi)), s.setKValue(t, at, JSON.stringify(fi));
1604
- const n = await Un();
1603
+ s.setKValue(t, at, JSON.stringify(Me)), s.setKValue(t, Fr, r), s.setKValue(t, Ge, r), s.setKValue(t, _e, JSON.stringify(e)), s.setKValue(t, de, JSON.stringify(gi)), s.setKValue(t, ct, JSON.stringify(mi));
1604
+ const n = await Mn();
1605
1605
  return s.createField(
1606
- M(t, yr(n.hash)),
1606
+ M(t, wr(n.hash)),
1607
1607
  "Dynamic",
1608
- L.wrapInHolder(s, ut(s, n.spec))
1608
+ L.wrapInHolder(s, dt(s, n.spec))
1609
1609
  ), t;
1610
1610
  }
1611
1611
  async function tt(s, e, t, r) {
1612
1612
  return oe(s, e, t, void 0, r);
1613
1613
  }
1614
1614
  async function oe(s, e, t, r, n) {
1615
- if (e instanceof gn)
1615
+ if (e instanceof vn)
1616
1616
  return await e.withWriteTx("ProjectAction", async (o) => {
1617
- const i = await ct.load(s, o, t, r), a = await n(i);
1617
+ const i = await lt.load(s, o, t, r), a = await n(i);
1618
1618
  return i.wasModified && (i.save(), await o.commit(), ee().logProjectMutationStat && console.log(JSON.stringify(o.stat))), a;
1619
1619
  });
1620
1620
  {
1621
- const o = await ct.load(s, e, t, r), i = await n(o);
1621
+ const o = await lt.load(s, e, t, r), i = await n(o);
1622
1622
  return o.save(), i;
1623
1623
  }
1624
1624
  }
1625
- function* Xi(s) {
1625
+ function* Zi(s) {
1626
1626
  switch (s.type) {
1627
1627
  case "Json":
1628
1628
  return;
@@ -1637,21 +1637,21 @@ function* Xi(s) {
1637
1637
  Y(s);
1638
1638
  }
1639
1639
  }
1640
- function cs(s, e) {
1640
+ function us(s, e) {
1641
1641
  return Object.fromEntries(
1642
1642
  Object.entries(s).map(([t, r]) => [t, e(r, t)])
1643
1643
  );
1644
1644
  }
1645
- function Yi(s, e) {
1645
+ function ea(s, e) {
1646
1646
  switch (s.type) {
1647
1647
  case "Json":
1648
1648
  return { ...s };
1649
1649
  case "JsonPartitioned":
1650
- return { ...s, parts: cs(s.parts, e) };
1650
+ return { ...s, parts: us(s.parts, e) };
1651
1651
  case "BinaryPartitioned":
1652
1652
  return {
1653
1653
  ...s,
1654
- parts: cs(s.parts, (t) => ({
1654
+ parts: us(s.parts, (t) => ({
1655
1655
  index: e(t.index),
1656
1656
  values: e(t.values)
1657
1657
  }))
@@ -1660,26 +1660,26 @@ function Yi(s, e) {
1660
1660
  Y(s);
1661
1661
  }
1662
1662
  }
1663
- const Qi = He("PColumnData/JsonPartitioned", "1"), Zi = He(
1663
+ const ta = He("PColumnData/JsonPartitioned", "1"), ra = He(
1664
1664
  "PColumnData/Partitioned/JsonPartitioned",
1665
1665
  "1"
1666
- ), ea = He("PColumnData/BinaryPartitioned", "1"), ta = He(
1666
+ ), sa = He("PColumnData/BinaryPartitioned", "1"), na = He(
1667
1667
  "PColumnData/Partitioned/BinaryPartitioned",
1668
1668
  "1"
1669
- ), ra = He("PColumnData/Json", "1");
1670
- function sa(s) {
1669
+ ), oa = He("PColumnData/Json", "1");
1670
+ function ia(s) {
1671
1671
  if (!s.getIsReadyOrError()) throw new Error("Data not ready.");
1672
1672
  const e = s.getDataAsJson();
1673
1673
  if (e === void 0)
1674
1674
  throw new Error("unexpected data info structure, no resource data");
1675
- if (pe(s.resourceType, ra)) {
1675
+ if (pe(s.resourceType, oa)) {
1676
1676
  const t = e;
1677
1677
  return {
1678
1678
  type: "Json",
1679
1679
  keyLength: t.keyLength,
1680
1680
  data: t.data
1681
1681
  };
1682
- } else if (pe(s.resourceType, Qi)) {
1682
+ } else if (pe(s.resourceType, ta)) {
1683
1683
  const t = e, r = Object.fromEntries(
1684
1684
  s.listInputFields().map((n) => [n, s.traverse({ field: n, errorIfFieldNotSet: !0 }).resourceInfo])
1685
1685
  );
@@ -1688,7 +1688,7 @@ function sa(s) {
1688
1688
  partitionKeyLength: t.partitionKeyLength,
1689
1689
  parts: r
1690
1690
  };
1691
- } else if (pe(s.resourceType, Zi)) {
1691
+ } else if (pe(s.resourceType, ra)) {
1692
1692
  const t = e, r = {};
1693
1693
  for (const n of s.listInputFields()) {
1694
1694
  const o = s.traverse({ field: n, errorIfFieldNotSet: !0 }), i = o.listInputFields();
@@ -1706,7 +1706,7 @@ function sa(s) {
1706
1706
  partitionKeyLength: t.superPartitionKeyLength + t.partitionKeyLength,
1707
1707
  parts: r
1708
1708
  };
1709
- } else if (pe(s.resourceType, ea)) {
1709
+ } else if (pe(s.resourceType, sa)) {
1710
1710
  const t = e, r = {};
1711
1711
  for (const n of s.listInputFields())
1712
1712
  if (n.endsWith(".index")) {
@@ -1727,7 +1727,7 @@ function sa(s) {
1727
1727
  partitionKeyLength: t.partitionKeyLength,
1728
1728
  parts: r
1729
1729
  };
1730
- } else if (pe(s.resourceType, ta)) {
1730
+ } else if (pe(s.resourceType, na)) {
1731
1731
  const t = e, r = {};
1732
1732
  for (const n of s.listInputFields()) {
1733
1733
  const o = s.traverse({ field: n, errorIfFieldNotSet: !0 }), i = o.listInputFields();
@@ -1761,9 +1761,9 @@ function sa(s) {
1761
1761
  parts: r
1762
1762
  };
1763
1763
  }
1764
- throw new Error(`unsupported resource type: ${Oo(s.resourceType)}`);
1764
+ throw new Error(`unsupported resource type: ${To(s.resourceType)}`);
1765
1765
  }
1766
- function na(s, e) {
1766
+ function aa(s, e) {
1767
1767
  const t = s.axesSpec.length, r = {};
1768
1768
  for (const { key: n, val: o } of e) {
1769
1769
  if (n.length !== t)
@@ -1776,17 +1776,17 @@ function na(s, e) {
1776
1776
  data: r
1777
1777
  };
1778
1778
  }
1779
- function oa(s, e) {
1779
+ function ca(s, e) {
1780
1780
  const t = Pe("sha256");
1781
1781
  return t.update(te(s)), t.update(String(Ue(e.originalId) ? e.id : e.originalId)), t.digest().toString("hex");
1782
1782
  }
1783
- function ls(s, e) {
1783
+ function ds(s, e) {
1784
1784
  return te({ __isRef: !0, blockId: s, name: e });
1785
1785
  }
1786
- function ia(s, e) {
1786
+ function la(s, e) {
1787
1787
  return te({ resolvePath: s, name: e });
1788
1788
  }
1789
- function Jn(s, e = !0, t = !1, r = "") {
1789
+ function Gn(s, e = !0, t = !1, r = "") {
1790
1790
  var a, c, l;
1791
1791
  const n = /^(?<name>.*)\.(?<type>spec|data)$/, o = /* @__PURE__ */ new Map();
1792
1792
  for (const u of s.listInputFields()) {
@@ -1824,10 +1824,10 @@ function Jn(s, e = !0, t = !1, r = "") {
1824
1824
  for (const [, u] of o) u.data === void 0 && (u.hasData = !1);
1825
1825
  return { locked: i, results: o };
1826
1826
  }
1827
- function aa(s, e = !0, t = "", r) {
1827
+ function ua(s, e = !0, t = "", r) {
1828
1828
  if (!s.getIsReadyOrError()) throw new Error("resource is not ready");
1829
- const n = Jn(s, e, !1, t);
1830
- Mo(n.locked);
1829
+ const n = Gn(s, e, !1, t);
1830
+ qo(n.locked);
1831
1831
  const o = {};
1832
1832
  for (const [i, a] of n.results) {
1833
1833
  if (a.spec === void 0) throw new Error(`no spec for key ${i}`);
@@ -1837,16 +1837,16 @@ function aa(s, e = !0, t = "", r) {
1837
1837
  if (c === void 0) throw new Error(`no data for key ${i}`);
1838
1838
  if (!c.ok) throw c.error;
1839
1839
  o[i] = {
1840
- id: r.length === 0 ? oa(a.spec, c.value) : ia(r, i),
1840
+ id: r.length === 0 ? ca(a.spec, c.value) : la(r, i),
1841
1841
  spec: a.spec,
1842
1842
  data: c.value
1843
1843
  };
1844
1844
  }
1845
1845
  return o;
1846
1846
  }
1847
- class Fr {
1847
+ class $r {
1848
1848
  constructor(e, t) {
1849
- R(this, "allSpecsAvailable");
1849
+ b(this, "allSpecsAvailable");
1850
1850
  this.ctx = e, this.blocks = t;
1851
1851
  let r = !0;
1852
1852
  e: for (const n of t.values())
@@ -1878,8 +1878,8 @@ class Fr {
1878
1878
  if (r === void 0) return;
1879
1879
  const n = (a = (i = r.prod) == null ? void 0 : i.results) == null ? void 0 : a.get(t), o = (c = n == null ? void 0 : n.data) == null ? void 0 : c.call(n);
1880
1880
  if (n !== void 0 && n.spec !== void 0 && o !== void 0)
1881
- return cn(o, (l) => ({
1882
- id: ls(e, t),
1881
+ return dn(o, (l) => ({
1882
+ id: ds(e, t),
1883
1883
  spec: n.spec,
1884
1884
  data: l
1885
1885
  }));
@@ -1918,7 +1918,7 @@ class Fr {
1918
1918
  l !== void 0 ? e.push({
1919
1919
  ref: et(i, a),
1920
1920
  obj: {
1921
- id: l.ok ? ls(i, a) : void 0,
1921
+ id: l.ok ? ds(i, a) : void 0,
1922
1922
  spec: c.spec,
1923
1923
  data: l
1924
1924
  }
@@ -1972,7 +1972,7 @@ class Fr {
1972
1972
  for (const r of this.blocks.values()) {
1973
1973
  const n = /* @__PURE__ */ new Set(), o = (i) => {
1974
1974
  for (const [a, c] of i.results)
1975
- n.has(a) || c.spec === void 0 || (n.add(a), io(e, c.spec) && t.push({
1975
+ n.has(a) || c.spec === void 0 || (n.add(a), co(e, c.spec) && t.push({
1976
1976
  label: r.info.label + " / " + a,
1977
1977
  ref: et(r.info.id, a),
1978
1978
  spec: c.spec
@@ -1983,10 +1983,10 @@ class Fr {
1983
1983
  return t;
1984
1984
  }
1985
1985
  static create(e, t, r) {
1986
- const n = e.accessor(t).node(), o = D(n.getKeyValueAsJson(de)), a = Sr(o).traverseIds("upstream", r), c = /* @__PURE__ */ new Map();
1986
+ const n = e.accessor(t).node(), o = D(n.getKeyValueAsJson(de)), a = br(o).traverseIds("upstream", r), c = /* @__PURE__ */ new Map();
1987
1987
  for (const l of re(o)) {
1988
1988
  if (!a.has(l.id)) continue;
1989
- const u = us(
1989
+ const u = ps(
1990
1990
  n.traverse({
1991
1991
  field: q(l.id, "prodCtx"),
1992
1992
  ignoreError: !0,
@@ -1997,7 +1997,7 @@ class Fr {
1997
1997
  field: q(l.id, "prodUiCtx"),
1998
1998
  stableIfNotFound: !0
1999
1999
  })
2000
- ), d = us(
2000
+ ), d = ps(
2001
2001
  n.traverse({
2002
2002
  field: q(l.id, "stagingCtx"),
2003
2003
  ignoreError: !0,
@@ -2009,18 +2009,18 @@ class Fr {
2009
2009
  );
2010
2010
  c.set(l.id, { info: l, prod: u, staging: d });
2011
2011
  }
2012
- return new Fr(e, c);
2012
+ return new $r(e, c);
2013
2013
  }
2014
2014
  }
2015
- function us(s, e) {
2015
+ function ps(s, e) {
2016
2016
  if (e === void 0)
2017
2017
  return s ? { locked: !1, results: /* @__PURE__ */ new Map() } : void 0;
2018
- if (e.ok) return Jn(e.value, !1, !0);
2018
+ if (e.ok) return Gn(e.value, !1, !0);
2019
2019
  }
2020
- function Tr(s, e) {
2020
+ function Ar(s, e) {
2021
2021
  return {
2022
2022
  blockId: e,
2023
- args: (o) => yt(D(
2023
+ args: (o) => wt(D(
2024
2024
  o.accessor(s).node().traverse({
2025
2025
  field: q(e, "currentArgs"),
2026
2026
  errorIfFieldNotSet: !0
@@ -2032,7 +2032,7 @@ function Tr(s, e) {
2032
2032
  field: q(e, "prodArgs"),
2033
2033
  stableIfNotFound: !0
2034
2034
  })) == null ? void 0 : a.getData();
2035
- return i ? yt(i) : void 0;
2035
+ return i ? wt(i) : void 0;
2036
2036
  },
2037
2037
  uiState: (o) => {
2038
2038
  var a;
@@ -2040,7 +2040,7 @@ function Tr(s, e) {
2040
2040
  field: q(e, "uiState"),
2041
2041
  stableIfNotFound: !0
2042
2042
  })) == null ? void 0 : a.getData();
2043
- return i ? yt(i) : void 0;
2043
+ return i ? wt(i) : void 0;
2044
2044
  },
2045
2045
  blockMeta: (o) => {
2046
2046
  const i = o.accessor(s).node(), a = D(i.getKeyValueAsJson(de)), c = /* @__PURE__ */ new Map();
@@ -2049,9 +2049,9 @@ function Tr(s, e) {
2049
2049
  }
2050
2050
  };
2051
2051
  }
2052
- function Mn(s, e) {
2052
+ function _n(s, e) {
2053
2053
  return {
2054
- ...Tr(s, e),
2054
+ ...Ar(s, e),
2055
2055
  prod: (t) => {
2056
2056
  var r;
2057
2057
  return (r = t.accessor(s).node({ ignoreError: !0 }).traverse({
@@ -2068,7 +2068,7 @@ function Mn(s, e) {
2068
2068
  })) == null ? void 0 : n.persist();
2069
2069
  return r === void 0 && t.markUnstable("staging_not_rendered"), r;
2070
2070
  },
2071
- getResultsPool: (t) => Fr.create(t, s, e)
2071
+ getResultsPool: (t) => $r.create(t, s, e)
2072
2072
  };
2073
2073
  }
2074
2074
  function* Z(s, e) {
@@ -2123,15 +2123,15 @@ function* Z(s, e) {
2123
2123
  Y(s);
2124
2124
  }
2125
2125
  }
2126
- function ca(s, e) {
2126
+ function da(s, e) {
2127
2127
  const t = {};
2128
2128
  for (const [r, n] of Object.entries(s)) t[r] = e(n);
2129
2129
  return t;
2130
2130
  }
2131
- function Ne(s, e) {
2131
+ function Be(s, e) {
2132
2132
  return s === void 0 ? void 0 : e(s);
2133
2133
  }
2134
- function la(s) {
2134
+ function pa(s) {
2135
2135
  switch (s.type) {
2136
2136
  case "GetImportProgress":
2137
2137
  return !0;
@@ -2139,60 +2139,60 @@ function la(s) {
2139
2139
  return !1;
2140
2140
  }
2141
2141
  }
2142
- function ua(s) {
2143
- for (const e of Z(s)) if (la(e)) return !0;
2142
+ function fa(s) {
2143
+ for (const e of Z(s)) if (pa(e)) return !0;
2144
2144
  return !1;
2145
2145
  }
2146
- function dt(s) {
2146
+ function pt(s) {
2147
2147
  return {
2148
2148
  type: "ReturnResult",
2149
2149
  result: s
2150
2150
  };
2151
2151
  }
2152
2152
  function T(s) {
2153
- return () => dt(s);
2153
+ return () => pt(s);
2154
2154
  }
2155
- const da = (s) => {
2155
+ const ha = (s) => {
2156
2156
  const e = {};
2157
2157
  for (const [t, r] of Object.entries(s)) e[t] = r;
2158
2158
  return T(e);
2159
- }, pa = (s) => {
2159
+ }, ga = (s) => {
2160
2160
  const e = s.source;
2161
2161
  if (e === void 0) return T(void 0);
2162
2162
  const t = [];
2163
2163
  for (const r of e)
2164
2164
  r instanceof Array ? t.push(...r) : t.push(r);
2165
2165
  return T(t);
2166
- }, fa = (s) => {
2166
+ }, ma = (s) => {
2167
2167
  const e = s.source, t = s.field;
2168
2168
  return e === void 0 || t === void 0 ? T(void 0) : ({ cCtx: r }) => {
2169
2169
  var n;
2170
- return dt((n = r.accessor(e).node().traverse(t)) == null ? void 0 : n.persist());
2170
+ return pt((n = r.accessor(e).node().traverse(t)) == null ? void 0 : n.persist());
2171
2171
  };
2172
2172
  };
2173
- function Gn(s, e) {
2173
+ function qn(s, e) {
2174
2174
  const t = {}, r = s.length;
2175
2175
  for (let n = 0; n < r; n++) t[String(n)] = e(s[n]);
2176
2176
  return t;
2177
2177
  }
2178
- function ga(s, e) {
2178
+ function va(s, e) {
2179
2179
  return (t) => {
2180
2180
  const r = t.source;
2181
2181
  return r === void 0 ? T(void 0) : () => ({
2182
2182
  type: "ScheduleSubroutine",
2183
- subroutine: _n(r.length),
2184
- args: Gn(r, (n) => A({ ...s, [e.itVar]: n }, e.mapping))
2183
+ subroutine: Kn(r.length),
2184
+ args: qn(r, (n) => A({ ...s, [e.itVar]: n }, e.mapping))
2185
2185
  });
2186
2186
  };
2187
2187
  }
2188
- function _n(s) {
2188
+ function Kn(s) {
2189
2189
  return (e) => {
2190
2190
  const t = [];
2191
2191
  for (let r = 0; r < s; r++) t.push(e[String(r)]);
2192
2192
  return T(t);
2193
2193
  };
2194
2194
  }
2195
- function ha(s, e) {
2195
+ function ya(s, e) {
2196
2196
  return (t) => {
2197
2197
  const r = t.source;
2198
2198
  if (r === void 0) return T(void 0);
@@ -2203,34 +2203,34 @@ function ha(s, e) {
2203
2203
  }
2204
2204
  return () => ({
2205
2205
  type: "ScheduleSubroutine",
2206
- subroutine: ma,
2206
+ subroutine: wa,
2207
2207
  args: n
2208
2208
  });
2209
2209
  };
2210
2210
  }
2211
- const ma = (s) => T(s), va = (s) => {
2211
+ const wa = (s) => T(s), Sa = (s) => {
2212
2212
  const e = s.arg;
2213
2213
  return T(e === void 0 ? void 0 : e.length === 0);
2214
- }, ya = (s) => {
2214
+ }, ba = (s) => {
2215
2215
  const e = s.operand;
2216
2216
  return T(e === void 0 ? void 0 : !e);
2217
- }, wa = (s) => {
2217
+ }, ka = (s) => {
2218
2218
  const e = s.operand1, t = s.operand2;
2219
2219
  return T(e === void 0 || t === void 0 ? void 0 : e && t);
2220
- }, Sa = (s) => {
2220
+ }, Ra = (s) => {
2221
2221
  const e = s.operand1, t = s.operand2;
2222
2222
  return T(e === void 0 || t === void 0 ? void 0 : e || t);
2223
- }, ba = (s) => {
2223
+ }, Ca = (s) => {
2224
2224
  const e = s.source;
2225
2225
  return e === void 0 ? T(void 0) : ({ cCtx: t }) => {
2226
2226
  var r;
2227
- return dt((r = t.accessor(e).node()) == null ? void 0 : r.getDataAsJson());
2227
+ return pt((r = t.accessor(e).node()) == null ? void 0 : r.getDataAsJson());
2228
2228
  };
2229
- }, ka = (s) => {
2229
+ }, Ea = (s) => {
2230
2230
  const e = s.source, t = s.field;
2231
2231
  return T(e === void 0 || t === void 0 ? void 0 : e[t]);
2232
2232
  };
2233
- function Ra(s, e) {
2233
+ function Pa(s, e) {
2234
2234
  return (t) => {
2235
2235
  const r = t.source;
2236
2236
  return r === void 0 ? T(void 0) : ({ cCtx: n }) => {
@@ -2245,13 +2245,13 @@ function Ra(s, e) {
2245
2245
  }
2246
2246
  return {
2247
2247
  type: "ScheduleSubroutine",
2248
- subroutine: Ca,
2248
+ subroutine: Oa,
2249
2249
  args: i
2250
2250
  };
2251
2251
  };
2252
2252
  };
2253
2253
  }
2254
- const Ca = (s) => T(s), Ea = (s) => (e) => {
2254
+ const Oa = (s) => T(s), Ia = (s) => (e) => {
2255
2255
  const t = e.source;
2256
2256
  return t === void 0 ? T(void 0) : ({ drivers: r }) => ({
2257
2257
  type: "ScheduleComputable",
@@ -2265,7 +2265,7 @@ const Ca = (s) => T(s), Ea = (s) => (e) => {
2265
2265
  }
2266
2266
  )
2267
2267
  });
2268
- }, Pa = (s) => (e) => {
2268
+ }, Fa = (s) => (e) => {
2269
2269
  const t = e.source;
2270
2270
  return t === void 0 ? T(void 0) : ({ cCtx: r, drivers: n }) => {
2271
2271
  const o = r.accessor(t).node().resourceInfo;
@@ -2276,7 +2276,7 @@ const Ca = (s) => T(s), Ea = (s) => (e) => {
2276
2276
  })
2277
2277
  };
2278
2278
  };
2279
- }, Oa = (s) => (e) => {
2279
+ }, Ta = (s) => (e) => {
2280
2280
  const t = e.source;
2281
2281
  return t === void 0 ? T(void 0) : ({ drivers: r }) => ({
2282
2282
  type: "ScheduleComputable",
@@ -2292,49 +2292,49 @@ const Ca = (s) => T(s), Ea = (s) => (e) => {
2292
2292
  }
2293
2293
  )
2294
2294
  });
2295
- }, Ia = (s) => {
2295
+ }, $a = (s) => {
2296
2296
  const e = s.source;
2297
2297
  return e === void 0 ? T(void 0) : (t) => ({
2298
2298
  type: "ScheduleComputable",
2299
2299
  computable: t.drivers.blobDriver.getDownloadedBlob(e)
2300
2300
  });
2301
- }, Fa = (s) => {
2301
+ }, Aa = (s) => {
2302
2302
  const e = s.source;
2303
2303
  return e === void 0 ? T(void 0) : ({ drivers: t }) => ({
2304
2304
  type: "ScheduleComputable",
2305
2305
  computable: t.blobDriver.getOnDemandBlob(e)
2306
2306
  });
2307
- }, Ta = (s) => (e) => {
2307
+ }, La = (s) => (e) => {
2308
2308
  const t = e.source;
2309
2309
  return t === void 0 ? T(void 0) : ({ drivers: r }) => ({
2310
2310
  type: "ScheduleComputable",
2311
2311
  computable: r.blobToURLDriver.extractArchiveAndGetURL(t, s)
2312
2312
  });
2313
- }, $a = (s) => {
2313
+ }, Da = (s) => {
2314
2314
  const e = s.source;
2315
2315
  return e === void 0 ? T(void 0) : ({ drivers: t }) => ({
2316
2316
  type: "ScheduleComputable",
2317
2317
  computable: t.uploadDriver.getProgressId(e)
2318
2318
  });
2319
- }, Aa = (s) => (e) => {
2319
+ }, Na = (s) => (e) => {
2320
2320
  const t = e.source;
2321
2321
  return t === void 0 ? T(void 0) : ({ drivers: r }) => ({
2322
2322
  type: "ScheduleComputable",
2323
2323
  computable: r.logDriver.getLastLogs(t, s)
2324
2324
  });
2325
- }, La = (s) => (e) => {
2325
+ }, Ba = (s) => (e) => {
2326
2326
  const t = e.source;
2327
2327
  return t === void 0 ? T(void 0) : ({ drivers: r }) => ({
2328
2328
  type: "ScheduleComputable",
2329
2329
  computable: r.logDriver.getProgressLog(t, s)
2330
2330
  });
2331
- }, Da = (s) => (e) => {
2331
+ }, ja = (s) => (e) => {
2332
2332
  const t = e.source;
2333
2333
  return t === void 0 ? T(void 0) : ({ drivers: r }) => ({
2334
2334
  type: "ScheduleComputable",
2335
2335
  computable: r.logDriver.getProgressLogWithInfo(t, s)
2336
2336
  });
2337
- }, Na = (s) => {
2337
+ }, xa = (s) => {
2338
2338
  const e = s.source;
2339
2339
  return e === void 0 ? T(void 0) : ({ drivers: t }) => ({
2340
2340
  type: "ScheduleComputable",
@@ -2345,19 +2345,19 @@ function A(s, e) {
2345
2345
  switch (e.type) {
2346
2346
  case "GetFromCtx": {
2347
2347
  const t = s[e.variable];
2348
- return typeof t == "function" ? (r) => dt(t(r.cCtx)) : T(t);
2348
+ return typeof t == "function" ? (r) => pt(t(r.cCtx)) : T(t);
2349
2349
  }
2350
2350
  case "Isolate":
2351
2351
  return ({ drivers: t }) => ({
2352
2352
  type: "ScheduleComputable",
2353
- computable: Hn(t, s, e.cfg)
2353
+ computable: zn(t, s, e.cfg)
2354
2354
  });
2355
2355
  case "Immediate":
2356
2356
  return T(e.value);
2357
2357
  case "GetJsonField":
2358
2358
  return () => ({
2359
2359
  type: "ScheduleSubroutine",
2360
- subroutine: ka,
2360
+ subroutine: Ea,
2361
2361
  args: {
2362
2362
  source: A(s, e.source),
2363
2363
  field: A(s, e.field)
@@ -2366,7 +2366,7 @@ function A(s, e) {
2366
2366
  case "MapArrayValues":
2367
2367
  return () => ({
2368
2368
  type: "ScheduleSubroutine",
2369
- subroutine: ga(s, e),
2369
+ subroutine: va(s, e),
2370
2370
  args: {
2371
2371
  source: A(s, e.source)
2372
2372
  }
@@ -2374,7 +2374,7 @@ function A(s, e) {
2374
2374
  case "MapRecordValues":
2375
2375
  return () => ({
2376
2376
  type: "ScheduleSubroutine",
2377
- subroutine: ha(s, e),
2377
+ subroutine: ya(s, e),
2378
2378
  args: {
2379
2379
  source: A(s, e.source)
2380
2380
  }
@@ -2382,19 +2382,19 @@ function A(s, e) {
2382
2382
  case "MakeObject":
2383
2383
  return () => ({
2384
2384
  type: "ScheduleSubroutine",
2385
- subroutine: da,
2386
- args: ca(e.template, (t) => A(s, t))
2385
+ subroutine: ha,
2386
+ args: da(e.template, (t) => A(s, t))
2387
2387
  });
2388
2388
  case "MakeArray":
2389
2389
  return () => ({
2390
2390
  type: "ScheduleSubroutine",
2391
- subroutine: _n(e.template.length),
2392
- args: Gn(e.template, (t) => A(s, t))
2391
+ subroutine: Kn(e.template.length),
2392
+ args: qn(e.template, (t) => A(s, t))
2393
2393
  });
2394
2394
  case "Flatten":
2395
2395
  return () => ({
2396
2396
  type: "ScheduleSubroutine",
2397
- subroutine: pa,
2397
+ subroutine: ga,
2398
2398
  args: {
2399
2399
  source: A(s, e.source)
2400
2400
  }
@@ -2402,7 +2402,7 @@ function A(s, e) {
2402
2402
  case "IsEmpty":
2403
2403
  return () => ({
2404
2404
  type: "ScheduleSubroutine",
2405
- subroutine: va,
2405
+ subroutine: Sa,
2406
2406
  args: {
2407
2407
  arg: A(s, e.arg)
2408
2408
  }
@@ -2410,7 +2410,7 @@ function A(s, e) {
2410
2410
  case "Not":
2411
2411
  return () => ({
2412
2412
  type: "ScheduleSubroutine",
2413
- subroutine: ya,
2413
+ subroutine: ba,
2414
2414
  args: {
2415
2415
  operand: A(s, e.operand)
2416
2416
  }
@@ -2418,7 +2418,7 @@ function A(s, e) {
2418
2418
  case "And":
2419
2419
  return () => ({
2420
2420
  type: "ScheduleSubroutine",
2421
- subroutine: wa,
2421
+ subroutine: ka,
2422
2422
  args: {
2423
2423
  operand1: A(s, e.operand1),
2424
2424
  operand2: A(s, e.operand2)
@@ -2427,7 +2427,7 @@ function A(s, e) {
2427
2427
  case "Or":
2428
2428
  return () => ({
2429
2429
  type: "ScheduleSubroutine",
2430
- subroutine: Sa,
2430
+ subroutine: Ra,
2431
2431
  args: {
2432
2432
  operand1: A(s, e.operand1),
2433
2433
  operand2: A(s, e.operand2)
@@ -2436,7 +2436,7 @@ function A(s, e) {
2436
2436
  case "MapResourceFields":
2437
2437
  return () => ({
2438
2438
  type: "ScheduleSubroutine",
2439
- subroutine: Ra(s, e),
2439
+ subroutine: Pa(s, e),
2440
2440
  args: {
2441
2441
  source: A(s, e.source)
2442
2442
  }
@@ -2444,7 +2444,7 @@ function A(s, e) {
2444
2444
  case "GetResourceField":
2445
2445
  return () => ({
2446
2446
  type: "ScheduleSubroutine",
2447
- subroutine: fa,
2447
+ subroutine: ma,
2448
2448
  args: {
2449
2449
  source: A(s, e.source),
2450
2450
  field: A(s, e.field)
@@ -2453,7 +2453,7 @@ function A(s, e) {
2453
2453
  case "GetResourceValueAsJson":
2454
2454
  return () => ({
2455
2455
  type: "ScheduleSubroutine",
2456
- subroutine: ba,
2456
+ subroutine: Ca,
2457
2457
  args: {
2458
2458
  source: A(s, e.source)
2459
2459
  }
@@ -2461,7 +2461,7 @@ function A(s, e) {
2461
2461
  case "GetBlobContent":
2462
2462
  return () => ({
2463
2463
  type: "ScheduleSubroutine",
2464
- subroutine: Ea(e.range),
2464
+ subroutine: Ia(e.range),
2465
2465
  args: {
2466
2466
  source: A(s, e.source)
2467
2467
  }
@@ -2469,7 +2469,7 @@ function A(s, e) {
2469
2469
  case "GetBlobContentAsString":
2470
2470
  return () => ({
2471
2471
  type: "ScheduleSubroutine",
2472
- subroutine: Pa(e.range),
2472
+ subroutine: Fa(e.range),
2473
2473
  args: {
2474
2474
  source: A(s, e.source)
2475
2475
  }
@@ -2477,7 +2477,7 @@ function A(s, e) {
2477
2477
  case "GetBlobContentAsJson":
2478
2478
  return () => ({
2479
2479
  type: "ScheduleSubroutine",
2480
- subroutine: Oa(e.range),
2480
+ subroutine: Ta(e.range),
2481
2481
  args: {
2482
2482
  source: A(s, e.source)
2483
2483
  }
@@ -2485,7 +2485,7 @@ function A(s, e) {
2485
2485
  case "GetDownloadedBlobContent":
2486
2486
  return () => ({
2487
2487
  type: "ScheduleSubroutine",
2488
- subroutine: Ia,
2488
+ subroutine: $a,
2489
2489
  args: {
2490
2490
  source: A(s, e.source)
2491
2491
  }
@@ -2493,7 +2493,7 @@ function A(s, e) {
2493
2493
  case "GetOnDemandBlobContent":
2494
2494
  return () => ({
2495
2495
  type: "ScheduleSubroutine",
2496
- subroutine: Fa,
2496
+ subroutine: Aa,
2497
2497
  args: {
2498
2498
  source: A(s, e.source)
2499
2499
  }
@@ -2501,7 +2501,7 @@ function A(s, e) {
2501
2501
  case "ExtractArchiveAndGetURL":
2502
2502
  return () => ({
2503
2503
  type: "ScheduleSubroutine",
2504
- subroutine: Ta(e.format),
2504
+ subroutine: La(e.format),
2505
2505
  args: {
2506
2506
  source: A(s, e.source)
2507
2507
  }
@@ -2509,7 +2509,7 @@ function A(s, e) {
2509
2509
  case "GetImportProgress":
2510
2510
  return () => ({
2511
2511
  type: "ScheduleSubroutine",
2512
- subroutine: $a,
2512
+ subroutine: Da,
2513
2513
  args: {
2514
2514
  source: A(s, e.source)
2515
2515
  }
@@ -2517,7 +2517,7 @@ function A(s, e) {
2517
2517
  case "GetLastLogs":
2518
2518
  return () => ({
2519
2519
  type: "ScheduleSubroutine",
2520
- subroutine: Aa(e.lines),
2520
+ subroutine: Na(e.lines),
2521
2521
  args: {
2522
2522
  source: A(s, e.source)
2523
2523
  }
@@ -2525,7 +2525,7 @@ function A(s, e) {
2525
2525
  case "GetProgressLog":
2526
2526
  return () => ({
2527
2527
  type: "ScheduleSubroutine",
2528
- subroutine: La(e.patternToSearch),
2528
+ subroutine: Ba(e.patternToSearch),
2529
2529
  args: {
2530
2530
  source: A(s, e.source)
2531
2531
  }
@@ -2533,7 +2533,7 @@ function A(s, e) {
2533
2533
  case "GetProgressLogWithInfo":
2534
2534
  return () => ({
2535
2535
  type: "ScheduleSubroutine",
2536
- subroutine: Da(e.patternToSearch),
2536
+ subroutine: ja(e.patternToSearch),
2537
2537
  args: {
2538
2538
  source: A(s, e.source)
2539
2539
  }
@@ -2541,7 +2541,7 @@ function A(s, e) {
2541
2541
  case "GetLogHandle":
2542
2542
  return () => ({
2543
2543
  type: "ScheduleSubroutine",
2544
- subroutine: Na,
2544
+ subroutine: xa,
2545
2545
  args: {
2546
2546
  source: A(s, e.source)
2547
2547
  }
@@ -2550,8 +2550,8 @@ function A(s, e) {
2550
2550
  return Y(e);
2551
2551
  }
2552
2552
  }
2553
- const Ba = ["$prod", "$staging"];
2554
- function ja(s) {
2553
+ const Va = ["$prod", "$staging"];
2554
+ function Ua(s) {
2555
2555
  return {
2556
2556
  $blockId: s.blockId,
2557
2557
  $args: (e) => JSON.parse(s.args(e)),
@@ -2563,16 +2563,16 @@ function ja(s) {
2563
2563
  $staging: s.staging
2564
2564
  };
2565
2565
  }
2566
- const qn = Symbol(), Kn = "return", xa = { op: qn, arg: Kn };
2567
- function Va(s) {
2568
- return s.op == qn && s.arg == Kn;
2566
+ const Hn = Symbol(), Wn = "return", Ja = { op: Hn, arg: Wn };
2567
+ function Ma(s) {
2568
+ return s.op == Hn && s.arg == Wn;
2569
2569
  }
2570
- function Ua() {
2570
+ function Ga() {
2571
2571
  return { pendingSubroutines: /* @__PURE__ */ new Map() };
2572
2572
  }
2573
- function ds(s, e, t, r) {
2574
- const n = new yn(t), o = (a, c) => {
2575
- if (Va(a))
2573
+ function fs(s, e, t, r) {
2574
+ const n = new Sn(t), o = (a, c) => {
2575
+ if (Ma(a))
2576
2576
  return e.result = c, !1;
2577
2577
  const l = D(e.pendingSubroutines.get(a.op));
2578
2578
  if (a.arg in l.args) throw new Error("argument already set");
@@ -2625,26 +2625,26 @@ function ds(s, e, t, r) {
2625
2625
  }
2626
2626
  return i;
2627
2627
  }
2628
- function Ja(s, e, t, r = {}) {
2629
- return Hn(s, ja(e), t, r);
2628
+ function _a(s, e, t, r = {}) {
2629
+ return zn(s, Ua(e), t, r);
2630
2630
  }
2631
- function Hn(s, e, t, r = {}) {
2631
+ function zn(s, e, t, r = {}) {
2632
2632
  const n = `${e.blockId}#` + te({
2633
2633
  ctx: Object.fromEntries(
2634
- Object.entries(e).filter(([o]) => Ba.indexOf(o) === -1)
2634
+ Object.entries(e).filter(([o]) => Va.indexOf(o) === -1)
2635
2635
  ),
2636
2636
  cfg: t
2637
2637
  });
2638
2638
  return K.makeRaw(
2639
2639
  (o) => {
2640
- const i = { drivers: s, cCtx: o }, a = Ua();
2640
+ const i = { drivers: s, cCtx: o }, a = Ga();
2641
2641
  return {
2642
- ir: ds(
2642
+ ir: fs(
2643
2643
  i,
2644
2644
  a,
2645
2645
  [
2646
2646
  {
2647
- destination: xa,
2647
+ destination: Ja,
2648
2648
  operation: A(e, t)
2649
2649
  }
2650
2650
  ],
@@ -2660,13 +2660,13 @@ function Hn(s, e, t, r = {}) {
2660
2660
  throw new Error("asynchronous operations are forbidden in this context");
2661
2661
  }
2662
2662
  }, p = /* @__PURE__ */ new Map();
2663
- for (const [v, g] of a.pendingSubroutines)
2664
- p.set(v, { ...g, args: { ...g.args } });
2663
+ for (const [v, h] of a.pendingSubroutines)
2664
+ p.set(v, { ...h, args: { ...h.args } });
2665
2665
  const f = {
2666
2666
  result: a.result,
2667
2667
  pendingSubroutines: p
2668
2668
  };
2669
- if (ds(d, f, u, !1), !("result" in f))
2669
+ if (fs(d, f, u, !1), !("result" in f))
2670
2670
  throw new Error("illegal cfg rendering stack state, no result");
2671
2671
  return f.result;
2672
2672
  }
@@ -2675,19 +2675,19 @@ function Hn(s, e, t, r = {}) {
2675
2675
  { ...r, key: n }
2676
2676
  );
2677
2677
  }
2678
- function ps(s) {
2678
+ function hs(s) {
2679
2679
  return s !== void 0 ? Buffer.from(s).toString("base64") : void 0;
2680
2680
  }
2681
- class Ma {
2681
+ class qa {
2682
2682
  constructor(e, t, r, n, o) {
2683
- R(this, "computablesToResolve", {});
2684
- R(this, "computableCtx");
2685
- R(this, "accessors", /* @__PURE__ */ new Map());
2686
- R(this, "meta");
2683
+ b(this, "computablesToResolve", {});
2684
+ b(this, "computableCtx");
2685
+ b(this, "accessors", /* @__PURE__ */ new Map());
2686
+ b(this, "meta");
2687
2687
  //
2688
2688
  // Result Pool
2689
2689
  //
2690
- R(this, "_resultPool");
2690
+ b(this, "_resultPool");
2691
2691
  this.parent = e, this.blockCtx = t, this.env = r, this.featureFlags = n, this.computableCtx = o, this.meta = t.blockMeta(o);
2692
2692
  }
2693
2693
  resetComputableCtx() {
@@ -2745,13 +2745,13 @@ class Ma {
2745
2745
  return this.getAccessor(e).listDynamicFields();
2746
2746
  }
2747
2747
  getKeyValueBase64(e, t) {
2748
- return ps(this.getAccessor(e).getKeyValue(t));
2748
+ return hs(this.getAccessor(e).getKeyValue(t));
2749
2749
  }
2750
2750
  getKeyValueAsString(e, t) {
2751
2751
  return this.getAccessor(e).getKeyValueAsString(t);
2752
2752
  }
2753
2753
  getDataBase64(e) {
2754
- return ps(this.getAccessor(e).getData());
2754
+ return hs(this.getAccessor(e).getData());
2755
2755
  }
2756
2756
  getDataAsString(e) {
2757
2757
  return this.getAccessor(e).getDataAsString();
@@ -2762,9 +2762,9 @@ class Ma {
2762
2762
  parsePObjectCollection(e, t, r, ...n) {
2763
2763
  const o = this.getAccessor(e);
2764
2764
  if (!o.getIsReadyOrError()) return;
2765
- const i = aa(o, t, r, n), a = {};
2765
+ const i = ua(o, t, r, n), a = {};
2766
2766
  for (const [c, l] of Object.entries(i))
2767
- a[c] = he(l, (u) => this.wrapAccessor(u));
2767
+ a[c] = ge(l, (u) => this.wrapAccessor(u));
2768
2768
  return a;
2769
2769
  }
2770
2770
  //
@@ -2897,7 +2897,7 @@ class Ma {
2897
2897
  isComplete: e.isComplete,
2898
2898
  entries: e.entries.map((t) => ({
2899
2899
  ref: t.ref,
2900
- obj: he(t.obj, (r) => this.wrapAccessor(r))
2900
+ obj: ge(t.obj, (r) => this.wrapAccessor(r))
2901
2901
  }))
2902
2902
  };
2903
2903
  }
@@ -2910,7 +2910,7 @@ class Ma {
2910
2910
  obj: {
2911
2911
  id: t.obj.id,
2912
2912
  spec: t.obj.spec,
2913
- data: cn(t.obj.data, (r) => this.wrapAccessor(r))
2913
+ data: dn(t.obj.data, (r) => this.wrapAccessor(r))
2914
2914
  }
2915
2915
  }))
2916
2916
  };
@@ -2923,7 +2923,7 @@ class Ma {
2923
2923
  return this.resultPool.getSpecByRef(e, t);
2924
2924
  }
2925
2925
  getDataFromResultPoolByRef(e, t) {
2926
- return he(
2926
+ return ge(
2927
2927
  this.resultPool.getDataByRef(e, t),
2928
2928
  (r) => this.wrapAccessor(r)
2929
2929
  );
@@ -2937,7 +2937,7 @@ class Ma {
2937
2937
  "can't instantiate PFrames from this context (most porbably called from the future mapper)"
2938
2938
  );
2939
2939
  return this.env.driverKit.pFrameDriver.createPFrame(
2940
- e.map((t) => he(t, (r) => this.transformInputPData(r))),
2940
+ e.map((t) => ge(t, (r) => this.transformInputPData(r))),
2941
2941
  this.computableCtx
2942
2942
  );
2943
2943
  }
@@ -2947,9 +2947,9 @@ class Ma {
2947
2947
  "can't instantiate PTable from this context (most porbably called from the future mapper)"
2948
2948
  );
2949
2949
  return this.env.driverKit.pFrameDriver.createPTable(
2950
- fr(
2950
+ hr(
2951
2951
  e,
2952
- (t) => he(t, (r) => this.transformInputPData(r))
2952
+ (t) => ge(t, (r) => this.transformInputPData(r))
2953
2953
  ),
2954
2954
  this.computableCtx
2955
2955
  );
@@ -2961,7 +2961,7 @@ class Ma {
2961
2961
  * - Passes through other values
2962
2962
  */
2963
2963
  transformInputPData(e) {
2964
- return typeof e == "string" ? this.getAccessor(e) : ln(e) ? un(e, (t) => this.getAccessor(t)) : e;
2964
+ return typeof e == "string" ? this.getAccessor(e) : pn(e) ? fn(e, (t) => this.getAccessor(t)) : e;
2965
2965
  }
2966
2966
  //
2967
2967
  // Computable
@@ -3010,7 +3010,7 @@ class Ma {
3010
3010
  };
3011
3011
  r.newFunction(i, c).consume((l) => r.setProp(e, i, l)), r.newFunction(i, a).consume((l) => r.setProp(e, i + "__internal__", l));
3012
3012
  };
3013
- if (ao(this.featureFlags, "supportsLazyState"))
3013
+ if (lo(this.featureFlags, "supportsLazyState"))
3014
3014
  o("args", () => {
3015
3015
  if (this.computableCtx === void 0)
3016
3016
  throw new Error("Add dummy call to ctx.args outside the future lambda. Can't be directly used in this context.");
@@ -3115,16 +3115,16 @@ class Ma {
3115
3115
  });
3116
3116
  }
3117
3117
  }
3118
- function Ga(s) {
3118
+ function Ka(s) {
3119
3119
  return s instanceof ArrayBuffer || ArrayBuffer.isView(s);
3120
3120
  }
3121
3121
  class qe {
3122
3122
  constructor(e, t, r, n, o) {
3123
- R(this, "callbackRegistry");
3124
- R(this, "fnJSONStringify");
3125
- R(this, "fnJSONParse");
3126
- R(this, "errorRepo", new _a());
3127
- R(this, "computableHelper");
3123
+ b(this, "callbackRegistry");
3124
+ b(this, "fnJSONStringify");
3125
+ b(this, "fnJSONParse");
3126
+ b(this, "errorRepo", new Ha());
3127
+ b(this, "computableHelper");
3128
3128
  if (this.scope = e, this.vm = t, this.deadlineSetter = r, this.callbackRegistry = this.scope.manage(this.vm.newObject()), this.fnJSONStringify = e.manage(
3129
3129
  t.getProp(t.global, "JSON").consume((i) => t.getProp(i, "stringify"))
3130
3130
  ), t.typeof(this.fnJSONStringify) !== "function")
@@ -3132,7 +3132,7 @@ class qe {
3132
3132
  if (this.fnJSONParse = e.manage(
3133
3133
  t.getProp(t.global, "JSON").consume((i) => t.getProp(i, "parse"))
3134
3134
  ), t.typeof(this.fnJSONParse) !== "function") throw new Error("JSON.parse() not found.");
3135
- o !== void 0 && (this.computableHelper = new Ma(this, o.blockCtx, o.mlEnv, n, o.computableCtx)), this.injectCtx();
3135
+ o !== void 0 && (this.computableHelper = new qa(this, o.blockCtx, o.mlEnv, n, o.computableCtx)), this.injectCtx();
3136
3136
  }
3137
3137
  resetComputableCtx() {
3138
3138
  D(this.computableHelper, "Computable context helper is not initialized").resetComputableCtx();
@@ -3209,7 +3209,7 @@ class qe {
3209
3209
  r = this.vm.null;
3210
3210
  break;
3211
3211
  }
3212
- if (Ga(e)) {
3212
+ if (Ka(e)) {
3213
3213
  r = this.vm.newArrayBuffer(e), n = !0;
3214
3214
  break;
3215
3215
  }
@@ -3251,14 +3251,14 @@ class qe {
3251
3251
  this.vm.setProp(t, "callbackRegistry", this.callbackRegistry), this.vm.setProp(
3252
3252
  t,
3253
3253
  "featureFlags",
3254
- this.exportObjectUniversal(co.GlobalCfgRenderCtxFeatureFlags, e)
3254
+ this.exportObjectUniversal(uo.GlobalCfgRenderCtxFeatureFlags, e)
3255
3255
  ), this.computableHelper !== void 0 && this.computableHelper.injectCtx(t), this.vm.setProp(this.vm.global, "cfgRenderCtx", t);
3256
3256
  });
3257
3257
  }
3258
3258
  }
3259
- class _a {
3259
+ class Ha {
3260
3260
  constructor() {
3261
- R(this, "errorIdToError", /* @__PURE__ */ new Map());
3261
+ b(this, "errorIdToError", /* @__PURE__ */ new Map());
3262
3262
  }
3263
3263
  /** Sets the error to the repository and returns a mimicrated error that also has uuid key of the original error. */
3264
3264
  setAndRecreateForQuickJS(e) {
@@ -3273,7 +3273,7 @@ class _a {
3273
3273
  }
3274
3274
  /** Returns the original error that was stored by parsing uuid of mimicrated error. */
3275
3275
  getOriginal(e) {
3276
- if (!(e instanceof Go.QuickJSUnwrapError))
3276
+ if (!(e instanceof Ko.QuickJSUnwrapError))
3277
3277
  return console.warn("ErrorRepo: quickJSError is not a QuickJSUnwrapError", Xe(e)), e;
3278
3278
  if (!("name" in e.cause))
3279
3279
  return console.warn("ErrorRepo: quickJSError.cause is not an Error", Xe(e)), e;
@@ -3283,10 +3283,10 @@ class _a {
3283
3283
  const n = this.errorIdToError.get(r);
3284
3284
  if (n === void 0)
3285
3285
  throw new Error(`ErrorRepo: errorId not found: ${r}, ${Xe(e)}`);
3286
- return new qo(e, n);
3286
+ return new Wo(e, n);
3287
3287
  }
3288
3288
  }
3289
- function qa(s, e, t, r, n, o = {}) {
3289
+ function Wa(s, e, t, r, n, o = {}) {
3290
3290
  const { code: i, featureFlags: a } = r, c = `${e.blockId}#lambda#${n}#${t.handle}`;
3291
3291
  return o = { ...o, key: c }, o.mode === void 0 && t.retentive === !0 && (o.mode = "StableOnlyRetentive"), K.makeRaw((l) => {
3292
3292
  ee().logOutputRecalculations && console.log(`Block lambda recalculation : ${c} (${l.changeSourceMarker}; ${l.bodyInvocations} invocations)`);
@@ -3306,14 +3306,14 @@ function qa(s, e, t, r, n, o = {}) {
3306
3306
  { computableCtx: l, blockCtx: e, mlEnv: s }
3307
3307
  );
3308
3308
  v.evaluateBundle(i.content);
3309
- const g = v.runCallback(t.handle);
3309
+ const h = v.runCallback(t.handle);
3310
3310
  v.resetComputableCtx();
3311
3311
  let S = 0;
3312
3312
  return ee().logOutputStatus === "any" && console.log(`Output ${t.handle} scaffold calculated.`), {
3313
3313
  ir: v.computableHelper.computablesToResolve,
3314
3314
  postprocessValue: (E, { unstableMarker: j, stable: F }) => {
3315
3315
  for (const [V, P] of Object.entries(E)) v.runCallback(V, P);
3316
- const B = v.importObjectUniversal(g);
3316
+ const B = v.importObjectUniversal(h);
3317
3317
  return S++, ee().logOutputStatus && (ee().logOutputStatus === "any" || !F) && console.log(
3318
3318
  F ? `Stable output ${t.handle} calculated ${B !== void 0 ? "defined" : "undefined"}; (#${S})` : `Unstable output ${t.handle}; marker = ${j}; ${B !== void 0 ? "defined" : "undefined"} (#${S})`
3319
3319
  ), B;
@@ -3321,7 +3321,7 @@ function qa(s, e, t, r, n, o = {}) {
3321
3321
  };
3322
3322
  }, o);
3323
3323
  }
3324
- function Ka(s, e, t, ...r) {
3324
+ function za(s, e, t, ...r) {
3325
3325
  const { code: n, featureFlags: o } = t, i = new Je();
3326
3326
  try {
3327
3327
  const a = i.manage(s.newRuntime());
@@ -3341,17 +3341,17 @@ function Ka(s, e, t, ...r) {
3341
3341
  i.dispose();
3342
3342
  }
3343
3343
  }
3344
- function Ha(s) {
3345
- return dn(s) ? s.isActive === !0 : ua(s);
3344
+ function Xa(s) {
3345
+ return hn(s) ? s.isActive === !0 : fa(s);
3346
3346
  }
3347
- function Be(s, e, t, r, n, o = {}) {
3348
- if (dn(t)) {
3347
+ function je(s, e, t, r, n, o = {}) {
3348
+ if (hn(t)) {
3349
3349
  if (r === void 0) throw new Error("No code bundle.");
3350
- return qa(s, e, t, r, n, o);
3351
- } else return Ja(s.driverKit, e, t, o);
3350
+ return Wa(s, e, t, r, n, o);
3351
+ } else return _a(s.driverKit, e, t, o);
3352
3352
  }
3353
3353
  function Ke(s, e) {
3354
- return Ne(
3354
+ return Be(
3355
3355
  s.traverse(
3356
3356
  {
3357
3357
  field: q(e, "blockPack"),
@@ -3366,18 +3366,18 @@ function Ke(s, e) {
3366
3366
  }
3367
3367
  );
3368
3368
  }
3369
- function Wa(s, e) {
3369
+ function Ya(s, e) {
3370
3370
  if (s === e) return !0;
3371
3371
  if (s === void 0 || e === void 0) return !1;
3372
- const t = Xr.omitBy((r, n) => n.startsWith("__"));
3373
- return Xr.isDeepEqual(t(s), t(e));
3372
+ const t = Qr.omitBy((r, n) => n.startsWith("__"));
3373
+ return Qr.isDeepEqual(t(s), t(e));
3374
3374
  }
3375
- function za(s, e, t) {
3375
+ function Qa(s, e, t) {
3376
3376
  return K.make(
3377
3377
  (r) => {
3378
- var v, g, S, E, j, F, B, V;
3379
- const n = r.accessor(s).node(), o = D(n.getKeyValueAsJson(Or)), i = D(n.getKeyValueAsJson(Ge)), a = D(n.getKeyValueAsJson(_e)), c = D(n.getKeyValueAsJson(de)), l = D(
3380
- n.getKeyValueAsJson(at)
3378
+ var v, h, S, E, j, F, B, V;
3379
+ const n = r.accessor(s).node(), o = D(n.getKeyValueAsJson(Fr)), i = D(n.getKeyValueAsJson(Ge)), a = D(n.getKeyValueAsJson(_e)), c = D(n.getKeyValueAsJson(de)), l = D(
3380
+ n.getKeyValueAsJson(ct)
3381
3381
  ), u = /* @__PURE__ */ new Map();
3382
3382
  for (const { id: P } of re(c)) {
3383
3383
  const N = n.traverse({
@@ -3403,8 +3403,8 @@ function za(s, e, t) {
3403
3403
  });
3404
3404
  G = {
3405
3405
  arguments: z,
3406
- stale: !Wa(C, z),
3407
- outputError: J.error !== void 0 || W.error !== void 0 || ((v = J.value) == null ? void 0 : v.getError()) !== void 0 || ((g = W.value) == null ? void 0 : g.getError()) !== void 0,
3406
+ stale: !Ya(C, z),
3407
+ outputError: J.error !== void 0 || W.error !== void 0 || ((v = J.value) == null ? void 0 : v.getError()) !== void 0 || ((h = W.value) == null ? void 0 : h.getError()) !== void 0,
3408
3408
  outputsError: ((S = J.error) == null ? void 0 : S.getDataAsString()) ?? ((j = (E = J.value) == null ? void 0 : E.getError()) == null ? void 0 : j.getDataAsString()),
3409
3409
  exportsError: ((F = W.error) == null ? void 0 : F.getDataAsString()) ?? ((V = (B = W.value) == null ? void 0 : B.getError()) == null ? void 0 : V.getDataAsString()),
3410
3410
  finished: (J.value !== void 0 && J.value.getIsReadyOrError() || J.error !== void 0 && J.error.getIsReadyOrError()) && (W.value !== void 0 && W.value.getIsReadyOrError() || W.error !== void 0 && W.error.getIsReadyOrError())
@@ -3423,38 +3423,38 @@ function za(s, e, t) {
3423
3423
  const G = D(u.get(P)), ce = D(d.nodes.get(P));
3424
3424
  let z = "NotCalculated";
3425
3425
  G.prod !== void 0 && (p.has(P) ? z = "Limbo" : z = G.prod.finished ? "Done" : "Running");
3426
- const J = Ke(n, P), { sections: W, title: h, inputsValid: m, sdkVersion: w, featureFlags: y, isIncompatibleWithRuntime: k } = Ne(J, ({ bpId: ne, cfg: we }) => {
3426
+ const J = Ke(n, P), { sections: W, title: g, inputsValid: m, sdkVersion: w, featureFlags: y, isIncompatibleWithRuntime: R } = Be(J, ({ bpId: ne, cfg: we }) => {
3427
3427
  if (!t.runtimeCapabilities.checkCompatibility(we.featureFlags))
3428
3428
  return {
3429
3429
  isIncompatibleWithRuntime: !0,
3430
3430
  featureFlags: we.featureFlags
3431
3431
  };
3432
- const vt = Tr(s, P), ue = lt(we);
3432
+ const yt = Ar(s, P), ue = ut(we);
3433
3433
  return {
3434
- sections: Be(
3434
+ sections: je(
3435
3435
  t,
3436
- vt,
3436
+ yt,
3437
3437
  we.sections,
3438
3438
  ue,
3439
3439
  ne
3440
3440
  ).wrap({
3441
3441
  recover: ($e) => (t.logger.error("Error in block model sections"), t.logger.error($e), [])
3442
3442
  }),
3443
- title: Ne(
3443
+ title: Be(
3444
3444
  we.title,
3445
- ($e) => Be(
3445
+ ($e) => je(
3446
3446
  t,
3447
- vt,
3447
+ yt,
3448
3448
  $e,
3449
3449
  ue,
3450
3450
  ne
3451
3451
  ).wrap({
3452
- recover: (so) => (t.logger.error("Error in block model title"), t.logger.error(so), "Invalid title")
3452
+ recover: (oo) => (t.logger.error("Error in block model title"), t.logger.error(oo), "Invalid title")
3453
3453
  })
3454
3454
  ),
3455
- inputsValid: Be(
3455
+ inputsValid: je(
3456
3456
  t,
3457
- vt,
3457
+ yt,
3458
3458
  we.inputsValid,
3459
3459
  ue,
3460
3460
  ne
@@ -3465,19 +3465,19 @@ function za(s, e, t) {
3465
3465
  featureFlags: (ue == null ? void 0 : ue.featureFlags) ?? {},
3466
3466
  isIncompatibleWithRuntime: !1
3467
3467
  };
3468
- }) || {}, b = n.traverse({
3468
+ }) || {}, k = n.traverse({
3469
3469
  field: q(P, "blockSettings"),
3470
3470
  assertFieldType: "Dynamic",
3471
3471
  errorIfFieldNotSet: !0
3472
- }).getDataAsJson(), O = Ne(
3472
+ }).getDataAsJson(), O = Be(
3473
3473
  J,
3474
- ({ info: ne }) => t.blockUpdateWatcher.get({ currentSpec: ne.source, settings: b })
3474
+ ({ info: ne }) => t.blockUpdateWatcher.get({ currentSpec: ne.source, settings: k })
3475
3475
  );
3476
3476
  return {
3477
3477
  projectResourceId: Ce(s.rid),
3478
3478
  id: P,
3479
- label: h ?? N,
3480
- title: h ?? N,
3479
+ label: g ?? N,
3480
+ title: g ?? N,
3481
3481
  renderingMode: C,
3482
3482
  stale: (($ = G.prod) == null ? void 0 : $.stale) !== !1 || z === "Limbo",
3483
3483
  missingReference: ce.missingReferences,
@@ -3487,7 +3487,7 @@ function za(s, e, t) {
3487
3487
  outputErrors: ((I = G.prod) == null ? void 0 : I.outputError) === !0,
3488
3488
  outputsError: (x = G.prod) == null ? void 0 : x.outputsError,
3489
3489
  exportsError: (H = G.prod) == null ? void 0 : H.exportsError,
3490
- settings: b,
3490
+ settings: k,
3491
3491
  sections: W,
3492
3492
  inputsValid: m,
3493
3493
  updateInfo: {},
@@ -3495,7 +3495,7 @@ function za(s, e, t) {
3495
3495
  updates: O,
3496
3496
  sdkVersion: w,
3497
3497
  featureFlags: y,
3498
- isIncompatibleWithRuntime: k,
3498
+ isIncompatibleWithRuntime: R,
3499
3499
  navigationState: e.getState(P)
3500
3500
  };
3501
3501
  });
@@ -3503,7 +3503,7 @@ function za(s, e, t) {
3503
3503
  meta: a,
3504
3504
  created: new Date(o),
3505
3505
  lastModified: new Date(i),
3506
- authorMarker: n.getKeyValueAsJson(vr),
3506
+ authorMarker: n.getKeyValueAsJson(yr),
3507
3507
  blocks: f
3508
3508
  };
3509
3509
  },
@@ -3529,13 +3529,13 @@ function za(s, e, t) {
3529
3529
  }
3530
3530
  ).withStableType();
3531
3531
  }
3532
- function Xa(s, e) {
3532
+ function Za(s, e) {
3533
3533
  const t = s.node();
3534
- if (pe(t.resourceType, Nn)) {
3534
+ if (pe(t.resourceType, jn)) {
3535
3535
  const r = t.getDataAsJson();
3536
3536
  if (r === void 0) throw new Error("No resource data.");
3537
3537
  return e.frontendDownloadDriver.getPath(new URL(r.url)).withStableType();
3538
- } else if (pe(t.resourceType, Bn)) {
3538
+ } else if (pe(t.resourceType, xn)) {
3539
3539
  const r = t.getDataAsJson();
3540
3540
  if (r === void 0) throw new Error("No resource data.");
3541
3541
  return e.signer.verify(
@@ -3546,10 +3546,10 @@ function Xa(s, e) {
3546
3546
  } else
3547
3547
  throw new Error(`Unsupported resource type: ${JSON.stringify(t.resourceType)}`);
3548
3548
  }
3549
- function Ya(s, e) {
3549
+ function ec(s, e) {
3550
3550
  if (s !== void 0)
3551
3551
  return K.make(
3552
- (t) => Xa(t.accessor(s), e),
3552
+ (t) => Za(t.accessor(s), e),
3553
3553
  {
3554
3554
  postprocessValue: (t) => {
3555
3555
  if (t !== void 0) {
@@ -3561,7 +3561,7 @@ function Ya(s, e) {
3561
3561
  }
3562
3562
  ).withStableType();
3563
3563
  }
3564
- function Qa(s, e, t) {
3564
+ function tc(s, e, t) {
3565
3565
  return K.make(
3566
3566
  (r) => {
3567
3567
  var a;
@@ -3571,40 +3571,40 @@ function Qa(s, e, t) {
3571
3571
  assertFieldType: "Dynamic"
3572
3572
  },
3573
3573
  { field: L.HolderRefField, assertFieldType: "Input", errorIfFieldNotFound: !0 },
3574
- { field: xn, assertFieldType: "Input" }
3574
+ { field: Un, assertFieldType: "Input" }
3575
3575
  )) == null ? void 0 : a.persist();
3576
3576
  return {
3577
- path: Ya(i, t),
3577
+ path: ec(i, t),
3578
3578
  sdkVersion: o == null ? void 0 : o.cfg.sdkVersion
3579
3579
  };
3580
3580
  },
3581
3581
  { mode: "StableOnlyLive" }
3582
3582
  );
3583
3583
  }
3584
- function Wn(s, e, t) {
3584
+ function Xn(s, e, t) {
3585
3585
  if (t === void 0)
3586
- return K.make((i) => Wn(s, e, i), {
3586
+ return K.make((i) => Xn(s, e, i), {
3587
3587
  key: `inputs#${Ce(s.rid)}#${e}`
3588
3588
  });
3589
- const r = t.accessor(s).node(), n = Tr(s, e), o = n.uiState(t);
3589
+ const r = t.accessor(s).node(), n = Ar(s, e), o = n.uiState(t);
3590
3590
  return {
3591
- author: r.getKeyValueAsJson(mr(e)),
3591
+ author: r.getKeyValueAsJson(vr(e)),
3592
3592
  // @TODO add deserialization caching
3593
- args: Kr(JSON.parse(n.args(t))),
3593
+ args: Wr(JSON.parse(n.args(t))),
3594
3594
  // @TODO add deserialization caching
3595
- ui: o !== void 0 ? Kr(JSON.parse(o)) : void 0
3595
+ ui: o !== void 0 ? Wr(JSON.parse(o)) : void 0
3596
3596
  };
3597
3597
  }
3598
- function Za(s, e, t) {
3598
+ function rc(s, e, t) {
3599
3599
  const r = "outputs#" + Ce(s.rid) + "#" + e;
3600
3600
  return K.make(
3601
3601
  (n) => {
3602
3602
  ee().logOutputRecalculations && console.log(`blockOutput recalculation : ${r} (${n.changeSourceMarker}; ${n.bodyInvocations} invocations)`);
3603
- const o = n.accessor(s).node(), i = Mn(s, e);
3604
- return Ne(Ke(o, e), ({ cfg: a, bpId: c }) => {
3603
+ const o = n.accessor(s).node(), i = _n(s, e);
3604
+ return Be(Ke(o, e), ({ cfg: a, bpId: c }) => {
3605
3605
  const l = {};
3606
3606
  for (const [u, d] of Object.entries(a.outputs)) {
3607
- const p = Be(t, i, d, lt(a), c);
3607
+ const p = je(t, i, d, ut(a), c);
3608
3608
  l[u] = K.wrapError(p, 1);
3609
3609
  }
3610
3610
  return l;
@@ -3613,38 +3613,38 @@ function Za(s, e, t) {
3613
3613
  { key: r }
3614
3614
  ).withStableType();
3615
3615
  }
3616
- function ec(s, e) {
3616
+ function sc(s, e) {
3617
3617
  return K.make((t) => {
3618
3618
  const r = t.accessor(s).node(), n = D(r.getKeyValueAsJson(de)), o = [];
3619
3619
  for (const { id: i } of re(n)) {
3620
3620
  const a = Ke(r, i);
3621
3621
  if (a === void 0) continue;
3622
- const c = Object.entries(a.cfg.outputs).map(([, u]) => u).filter((u) => Ha(u)).map((u) => u);
3622
+ const c = Object.entries(a.cfg.outputs).map(([, u]) => u).filter((u) => Xa(u)).map((u) => u);
3623
3623
  if (c.length === 0) continue;
3624
- const l = Mn(r.persist(), i);
3624
+ const l = _n(r.persist(), i);
3625
3625
  for (const u of c)
3626
3626
  o.push(
3627
- K.wrapError(Be(e, l, u, lt(a.cfg), a.bpId))
3627
+ K.wrapError(je(e, l, u, ut(a.cfg), a.bpId))
3628
3628
  );
3629
3629
  }
3630
3630
  return o;
3631
3631
  });
3632
3632
  }
3633
- class tc {
3633
+ class nc {
3634
3634
  constructor() {
3635
- R(this, "states", /* @__PURE__ */ new Map());
3635
+ b(this, "states", /* @__PURE__ */ new Map());
3636
3636
  }
3637
3637
  setState(e, t) {
3638
3638
  const r = this.states.get(e);
3639
3639
  if (r === void 0) {
3640
- this.states.set(e, { state: t, change: new zr() });
3640
+ this.states.set(e, { state: t, change: new Yr() });
3641
3641
  return;
3642
3642
  }
3643
3643
  r.state = { ...t }, r.change.markChanged("navigation state changed");
3644
3644
  }
3645
3645
  readState(e, t) {
3646
3646
  let r = this.states.get(t);
3647
- return r === void 0 && (r = { state: { ...lo }, change: new zr() }, this.states.set(t, r)), r.change.attachWatcher(e.watcher), r.state;
3647
+ return r === void 0 && (r = { state: { ...po }, change: new Yr() }, this.states.set(t, r)), r.change.attachWatcher(e.watcher), r.state;
3648
3648
  }
3649
3649
  getState(e) {
3650
3650
  return K.make(
@@ -3657,7 +3657,7 @@ class tc {
3657
3657
  t !== void 0 && (this.states.delete(e), t.change.markChanged("block deleted"));
3658
3658
  }
3659
3659
  }
3660
- function rc(s) {
3660
+ function oc(s) {
3661
3661
  return K.make((e) => {
3662
3662
  const t = e.accessor(s).node(), r = D(t.getKeyValueAsJson(de));
3663
3663
  return {
@@ -3665,59 +3665,59 @@ function rc(s) {
3665
3665
  };
3666
3666
  });
3667
3667
  }
3668
- const sc = "1", nc = "BlockFrontendState/";
3669
- async function oc(s, e) {
3668
+ const ic = "1", ac = "BlockFrontendState/";
3669
+ async function cc(s, e) {
3670
3670
  await s.withWriteTx("ProjectMigration", async (t) => {
3671
- const r = await t.getKValueJson(e, it);
3671
+ const r = await t.getKValueJson(e, at);
3672
3672
  if (r !== Me) {
3673
- if (r === sc)
3674
- await ic(t, e);
3673
+ if (r === ic)
3674
+ await lc(t, e);
3675
3675
  else
3676
3676
  throw new Error(`Unknown project schema version: ${r}`);
3677
- t.setKValue(e, it, JSON.stringify(Me)), await t.commit();
3677
+ t.setKValue(e, at, JSON.stringify(Me)), await t.commit();
3678
3678
  }
3679
3679
  });
3680
3680
  }
3681
- async function ic(s, e) {
3681
+ async function lc(s, e) {
3682
3682
  const [t, r] = await Promise.all([
3683
3683
  s.getKValueJson(e, de),
3684
3684
  s.listKeyValues(e)
3685
3685
  ]), n = new Map(r.map((o) => [o.key, o.value]));
3686
3686
  for (const o of re(t)) {
3687
- const i = nc + o.id, a = n.get(i), c = a ? Ve(a) : {}, l = s.createJsonGzValue(c), u = M(e, q(o.id, "uiState"));
3687
+ const i = ac + o.id, a = n.get(i), c = a ? Ve(a) : {}, l = s.createJsonGzValue(c), u = M(e, q(o.id, "uiState"));
3688
3688
  s.createField(u, "Dynamic", l), s.deleteKValue(e, i);
3689
3689
  }
3690
3690
  }
3691
- function fs(s) {
3691
+ function gs(s) {
3692
3692
  return JSON.stringify(s, (e, t) => typeof t == "bigint" ? Ce(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);
3693
3693
  }
3694
- class $r {
3694
+ class Lr {
3695
3695
  constructor(e, t, r) {
3696
3696
  /** Underlying pl resource id */
3697
- R(this, "rid");
3697
+ b(this, "rid");
3698
3698
  /** Data for the left panel, contain basic information about block status. */
3699
- R(this, "overview");
3700
- R(this, "overviewLight");
3701
- R(this, "navigationStates", new tc());
3699
+ b(this, "overview");
3700
+ b(this, "overviewLight");
3701
+ b(this, "navigationStates", new nc());
3702
3702
  // null is set for deleted blocks
3703
- R(this, "blockComputables", /* @__PURE__ */ new Map());
3704
- R(this, "blockFrontends", /* @__PURE__ */ new Map());
3705
- R(this, "activeConfigs");
3706
- R(this, "refreshLoopResult");
3707
- R(this, "abortController", new AbortController());
3708
- R(this, "destroyed", !1);
3709
- this.env = e, this.projectTree = r, this.overview = za(
3703
+ b(this, "blockComputables", /* @__PURE__ */ new Map());
3704
+ b(this, "blockFrontends", /* @__PURE__ */ new Map());
3705
+ b(this, "activeConfigs");
3706
+ b(this, "refreshLoopResult");
3707
+ b(this, "abortController", new AbortController());
3708
+ b(this, "destroyed", !1);
3709
+ this.env = e, this.projectTree = r, this.overview = Qa(
3710
3710
  r.entry(),
3711
3711
  this.navigationStates,
3712
3712
  e
3713
- ).withPreCalculatedValueTree(), this.overviewLight = rc(r.entry()).withPreCalculatedValueTree(), this.rid = t, this.refreshLoopResult = this.refreshLoop(), this.activeConfigs = ec(r.entry(), e);
3713
+ ).withPreCalculatedValueTree(), this.overviewLight = oc(r.entry()).withPreCalculatedValueTree(), this.rid = t, this.refreshLoopResult = this.refreshLoop(), this.activeConfigs = sc(r.entry(), e);
3714
3714
  }
3715
3715
  async refreshLoop() {
3716
3716
  for (; !this.destroyed; )
3717
3717
  try {
3718
3718
  await tt(this.env.projectHelper, this.env.pl, this.rid, (r) => {
3719
3719
  r.doRefresh(this.env.ops.stagingRenderingRate);
3720
- }), await this.activeConfigs.getValue(), await wn(this.env.ops.projectRefreshInterval, this.abortController.signal);
3720
+ }), await this.activeConfigs.getValue(), await bn(this.env.ops.projectRefreshInterval, this.abortController.signal);
3721
3721
  const e = await this.overviewLight.getValue(), t = new Set(e.listOfBlocks);
3722
3722
  for (const r of this.blockComputables.keys())
3723
3723
  if (!t.has(r)) {
@@ -3725,12 +3725,12 @@ class $r {
3725
3725
  n != null && n.fullState.resetState(), this.blockComputables.set(r, null);
3726
3726
  }
3727
3727
  } catch (e) {
3728
- if (Io(e)) {
3728
+ if ($o(e)) {
3729
3729
  console.warn(
3730
3730
  "project refresh routine terminated, because project was externally deleted"
3731
3731
  );
3732
3732
  break;
3733
- } else if (!Fo(e))
3733
+ } else if (!Ao(e))
3734
3734
  throw new Error("Unexpected exception", { cause: e });
3735
3735
  }
3736
3736
  }
@@ -3900,9 +3900,9 @@ class $r {
3900
3900
  /** Resets arguments and ui state of the block to initial state */
3901
3901
  async resetBlockArgsAndUiState(e, t) {
3902
3902
  await this.env.pl.withWriteTx("BlockInputsReset", async (r) => {
3903
- const n = ot(
3903
+ const n = it(
3904
3904
  (await r.getField(M(this.rid, q(e, "blockPack")))).value
3905
- ), o = ot(
3905
+ ), o = it(
3906
3906
  (await r.getField(M(n, L.HolderRefField))).value
3907
3907
  ), i = await r.getResourceData(o, !1), a = ke(Ve(D(i.data)).config);
3908
3908
  await oe(this.env.projectHelper, r, this.rid, t, (c) => {
@@ -3914,10 +3914,10 @@ class $r {
3914
3914
  const t = this.blockComputables.get(e);
3915
3915
  if (t === null) throw new Error(`Block ${e} is deleted`);
3916
3916
  if (t === void 0) {
3917
- const r = Za(this.projectTree.entry(), e, this.env), o = {
3917
+ const r = rc(this.projectTree.entry(), e, this.env), o = {
3918
3918
  fullState: K.make(
3919
3919
  (i) => ({
3920
- argsAndUiState: Wn(this.projectTree.entry(), e, i),
3920
+ argsAndUiState: Xn(this.projectTree.entry(), e, i),
3921
3921
  outputs: r,
3922
3922
  navigationState: this.navigationStates.getState(e),
3923
3923
  overview: this.overview
@@ -3925,7 +3925,7 @@ class $r {
3925
3925
  {
3926
3926
  postprocessValue: (i) => {
3927
3927
  var u, d, p;
3928
- const a = (p = (d = (u = i.overview) == null ? void 0 : u.blocks) == null ? void 0 : d.find((f) => f.id == e)) == null ? void 0 : p.sdkVersion, l = a && cc(a) && i.outputs !== void 0 ? uc(i.outputs) : i.outputs;
3928
+ const a = (p = (d = (u = i.overview) == null ? void 0 : u.blocks) == null ? void 0 : d.find((f) => f.id == e)) == null ? void 0 : p.sdkVersion, l = a && dc(a) && i.outputs !== void 0 ? fc(i.outputs) : i.outputs;
3929
3929
  return {
3930
3930
  ...i.argsAndUiState,
3931
3931
  outputs: l,
@@ -3953,7 +3953,7 @@ class $r {
3953
3953
  getBlockFrontend(e) {
3954
3954
  const t = this.blockFrontends.get(e);
3955
3955
  if (t === void 0) {
3956
- const r = Qa(
3956
+ const r = tc(
3957
3957
  this.projectTree.entry(),
3958
3958
  e,
3959
3959
  this.env
@@ -3973,14 +3973,14 @@ class $r {
3973
3973
  await this.destroy();
3974
3974
  }
3975
3975
  static async init(e, t) {
3976
- await oc(e.pl, t), await tt(e.projectHelper, e.pl, t, (n) => {
3976
+ await cc(e.pl, t), await tt(e.projectHelper, e.pl, t, (n) => {
3977
3977
  });
3978
- const r = await mn.init(
3978
+ const r = await wn.init(
3979
3979
  e.pl,
3980
3980
  t,
3981
3981
  {
3982
3982
  ...e.ops.defaultTreeOptions,
3983
- pruning: ac
3983
+ pruning: uc
3984
3984
  },
3985
3985
  e.logger
3986
3986
  );
@@ -3990,13 +3990,13 @@ class $r {
3990
3990
  var c, l;
3991
3991
  return (((c = a.data) == null ? void 0 : c.byteLength) ?? 0) - (((l = i.data) == null ? void 0 : l.byteLength) ?? 0);
3992
3992
  });
3993
- const o = No(n);
3994
- await nt.writeFile(`${Ce(t)}.json`, fs(n)), await nt.writeFile(`${Ce(t)}.stats.json`, fs(o));
3993
+ const o = xo(n);
3994
+ await ot.writeFile(`${Ce(t)}.json`, gs(n)), await ot.writeFile(`${Ce(t)}.stats.json`, gs(o));
3995
3995
  }
3996
- return new $r(e, t, r);
3996
+ return new Lr(e, t, r);
3997
3997
  }
3998
3998
  }
3999
- function ac(s) {
3999
+ function uc(s) {
4000
4000
  if (s.type.name.startsWith("StreamWorkdir/"))
4001
4001
  return [];
4002
4002
  switch (s.type.name) {
@@ -4010,14 +4010,14 @@ function ac(s) {
4010
4010
  return s.fields;
4011
4011
  }
4012
4012
  }
4013
- function cc(s) {
4014
- return !lc(s, "1.26.0");
4013
+ function dc(s) {
4014
+ return !pc(s, "1.26.0");
4015
4015
  }
4016
- function lc(s, e) {
4016
+ function pc(s, e) {
4017
4017
  const t = s.split(".").map(Number), r = e.split(".").map(Number);
4018
4018
  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];
4019
4019
  }
4020
- function uc(s) {
4020
+ function fc(s) {
4021
4021
  const e = {};
4022
4022
  for (const [t, r] of Object.entries(s)) {
4023
4023
  if (r.ok) {
@@ -4032,8 +4032,8 @@ function uc(s) {
4032
4032
  }
4033
4033
  return e;
4034
4034
  }
4035
- const zn = {
4036
- logger: new pn(),
4035
+ const Yn = {
4036
+ logger: new gn(),
4037
4037
  blobDriverOps: {
4038
4038
  cacheSoftSizeBytes: 8 * 1024 * 1024 * 1024,
4039
4039
  // 8 GB
@@ -4058,7 +4058,7 @@ const zn = {
4058
4058
  stopPollingDelay: 1e3
4059
4059
  }
4060
4060
  };
4061
- function Xn(s) {
4061
+ function Qn(s) {
4062
4062
  return {
4063
4063
  blobDownloadPath: _.join(s, "download"),
4064
4064
  blobDownloadRangesCachePath: _.join(s, "downloadRangesCache"),
@@ -4066,8 +4066,8 @@ function Xn(s) {
4066
4066
  pframesSpillPath: _.join(s, "pframes")
4067
4067
  };
4068
4068
  }
4069
- const dc = {
4070
- ...zn,
4069
+ const hc = {
4070
+ ...Yn,
4071
4071
  defaultTreeOptions: {
4072
4072
  pollingInterval: 350,
4073
4073
  stopPollingDelay: 2500,
@@ -4081,22 +4081,22 @@ const dc = {
4081
4081
  projectRefreshInterval: 700,
4082
4082
  stagingRenderingRate: 5
4083
4083
  };
4084
- function pc(s) {
4084
+ function gc(s) {
4085
4085
  return {
4086
- ...Xn(s),
4086
+ ...Qn(s),
4087
4087
  frontendDownloadPath: _.join(s, "frontend")
4088
4088
  };
4089
4089
  }
4090
- function fc(s) {
4090
+ function mc(s) {
4091
4091
  return s && s.__esModule && Object.prototype.hasOwnProperty.call(s, "default") ? s.default : s;
4092
4092
  }
4093
- var rt = { exports: {} }, kt, gs;
4094
- function pt() {
4095
- if (gs) return kt;
4096
- gs = 1;
4093
+ var rt = { exports: {} }, Rt, ms;
4094
+ function ft() {
4095
+ if (ms) return Rt;
4096
+ ms = 1;
4097
4097
  const s = "2.0.0", e = 256, t = Number.MAX_SAFE_INTEGER || /* istanbul ignore next */
4098
4098
  9007199254740991, r = 16, n = e - 6;
4099
- return kt = {
4099
+ return Rt = {
4100
4100
  MAX_LENGTH: e,
4101
4101
  MAX_SAFE_COMPONENT_LENGTH: r,
4102
4102
  MAX_SAFE_BUILD_LENGTH: n,
@@ -4113,21 +4113,21 @@ function pt() {
4113
4113
  SEMVER_SPEC_VERSION: s,
4114
4114
  FLAG_INCLUDE_PRERELEASE: 1,
4115
4115
  FLAG_LOOSE: 2
4116
- }, kt;
4116
+ }, Rt;
4117
4117
  }
4118
- var Rt, hs;
4119
- function ft() {
4120
- return hs || (hs = 1, Rt = typeof process == "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...e) => console.error("SEMVER", ...e) : () => {
4121
- }), Rt;
4118
+ var Ct, vs;
4119
+ function ht() {
4120
+ return vs || (vs = 1, Ct = typeof process == "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...e) => console.error("SEMVER", ...e) : () => {
4121
+ }), Ct;
4122
4122
  }
4123
- var ms;
4123
+ var ys;
4124
4124
  function We() {
4125
- return ms || (ms = 1, function(s, e) {
4125
+ return ys || (ys = 1, function(s, e) {
4126
4126
  const {
4127
4127
  MAX_SAFE_COMPONENT_LENGTH: t,
4128
4128
  MAX_SAFE_BUILD_LENGTH: r,
4129
4129
  MAX_LENGTH: n
4130
- } = pt(), o = ft();
4130
+ } = ft(), o = ht();
4131
4131
  e = s.exports = {};
4132
4132
  const i = e.re = [], a = e.safeRe = [], c = e.src = [], l = e.safeSrc = [], u = e.t = {};
4133
4133
  let d = 0;
@@ -4139,38 +4139,38 @@ function We() {
4139
4139
  for (const [E, j] of f)
4140
4140
  S = S.split(`${E}*`).join(`${E}{0,${j}}`).split(`${E}+`).join(`${E}{1,${j}}`);
4141
4141
  return S;
4142
- }, g = (S, E, j) => {
4142
+ }, h = (S, E, j) => {
4143
4143
  const F = v(E), B = d++;
4144
4144
  o(S, B, E), u[S] = B, c[B] = E, l[B] = F, i[B] = new RegExp(E, j ? "g" : void 0), a[B] = new RegExp(F, j ? "g" : void 0);
4145
4145
  };
4146
- g("NUMERICIDENTIFIER", "0|[1-9]\\d*"), g("NUMERICIDENTIFIERLOOSE", "\\d+"), g("NONNUMERICIDENTIFIER", `\\d*[a-zA-Z-]${p}*`), g("MAINVERSION", `(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})`), g("MAINVERSIONLOOSE", `(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})`), g("PRERELEASEIDENTIFIER", `(?:${c[u.NONNUMERICIDENTIFIER]}|${c[u.NUMERICIDENTIFIER]})`), g("PRERELEASEIDENTIFIERLOOSE", `(?:${c[u.NONNUMERICIDENTIFIER]}|${c[u.NUMERICIDENTIFIERLOOSE]})`), g("PRERELEASE", `(?:-(${c[u.PRERELEASEIDENTIFIER]}(?:\\.${c[u.PRERELEASEIDENTIFIER]})*))`), g("PRERELEASELOOSE", `(?:-?(${c[u.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${c[u.PRERELEASEIDENTIFIERLOOSE]})*))`), g("BUILDIDENTIFIER", `${p}+`), g("BUILD", `(?:\\+(${c[u.BUILDIDENTIFIER]}(?:\\.${c[u.BUILDIDENTIFIER]})*))`), g("FULLPLAIN", `v?${c[u.MAINVERSION]}${c[u.PRERELEASE]}?${c[u.BUILD]}?`), g("FULL", `^${c[u.FULLPLAIN]}$`), g("LOOSEPLAIN", `[v=\\s]*${c[u.MAINVERSIONLOOSE]}${c[u.PRERELEASELOOSE]}?${c[u.BUILD]}?`), g("LOOSE", `^${c[u.LOOSEPLAIN]}$`), g("GTLT", "((?:<|>)?=?)"), g("XRANGEIDENTIFIERLOOSE", `${c[u.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`), g("XRANGEIDENTIFIER", `${c[u.NUMERICIDENTIFIER]}|x|X|\\*`), g("XRANGEPLAIN", `[v=\\s]*(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:${c[u.PRERELEASE]})?${c[u.BUILD]}?)?)?`), g("XRANGEPLAINLOOSE", `[v=\\s]*(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:${c[u.PRERELEASELOOSE]})?${c[u.BUILD]}?)?)?`), g("XRANGE", `^${c[u.GTLT]}\\s*${c[u.XRANGEPLAIN]}$`), g("XRANGELOOSE", `^${c[u.GTLT]}\\s*${c[u.XRANGEPLAINLOOSE]}$`), g("COERCEPLAIN", `(^|[^\\d])(\\d{1,${t}})(?:\\.(\\d{1,${t}}))?(?:\\.(\\d{1,${t}}))?`), g("COERCE", `${c[u.COERCEPLAIN]}(?:$|[^\\d])`), g("COERCEFULL", c[u.COERCEPLAIN] + `(?:${c[u.PRERELEASE]})?(?:${c[u.BUILD]})?(?:$|[^\\d])`), g("COERCERTL", c[u.COERCE], !0), g("COERCERTLFULL", c[u.COERCEFULL], !0), g("LONETILDE", "(?:~>?)"), g("TILDETRIM", `(\\s*)${c[u.LONETILDE]}\\s+`, !0), e.tildeTrimReplace = "$1~", g("TILDE", `^${c[u.LONETILDE]}${c[u.XRANGEPLAIN]}$`), g("TILDELOOSE", `^${c[u.LONETILDE]}${c[u.XRANGEPLAINLOOSE]}$`), g("LONECARET", "(?:\\^)"), g("CARETTRIM", `(\\s*)${c[u.LONECARET]}\\s+`, !0), e.caretTrimReplace = "$1^", g("CARET", `^${c[u.LONECARET]}${c[u.XRANGEPLAIN]}$`), g("CARETLOOSE", `^${c[u.LONECARET]}${c[u.XRANGEPLAINLOOSE]}$`), g("COMPARATORLOOSE", `^${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]})$|^$`), g("COMPARATOR", `^${c[u.GTLT]}\\s*(${c[u.FULLPLAIN]})$|^$`), g("COMPARATORTRIM", `(\\s*)${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]}|${c[u.XRANGEPLAIN]})`, !0), e.comparatorTrimReplace = "$1$2$3", g("HYPHENRANGE", `^\\s*(${c[u.XRANGEPLAIN]})\\s+-\\s+(${c[u.XRANGEPLAIN]})\\s*$`), g("HYPHENRANGELOOSE", `^\\s*(${c[u.XRANGEPLAINLOOSE]})\\s+-\\s+(${c[u.XRANGEPLAINLOOSE]})\\s*$`), g("STAR", "(<|>)?=?\\s*\\*"), g("GTE0", "^\\s*>=\\s*0\\.0\\.0\\s*$"), g("GTE0PRE", "^\\s*>=\\s*0\\.0\\.0-0\\s*$");
4146
+ h("NUMERICIDENTIFIER", "0|[1-9]\\d*"), h("NUMERICIDENTIFIERLOOSE", "\\d+"), h("NONNUMERICIDENTIFIER", `\\d*[a-zA-Z-]${p}*`), h("MAINVERSION", `(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})`), h("MAINVERSIONLOOSE", `(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})`), h("PRERELEASEIDENTIFIER", `(?:${c[u.NONNUMERICIDENTIFIER]}|${c[u.NUMERICIDENTIFIER]})`), h("PRERELEASEIDENTIFIERLOOSE", `(?:${c[u.NONNUMERICIDENTIFIER]}|${c[u.NUMERICIDENTIFIERLOOSE]})`), h("PRERELEASE", `(?:-(${c[u.PRERELEASEIDENTIFIER]}(?:\\.${c[u.PRERELEASEIDENTIFIER]})*))`), h("PRERELEASELOOSE", `(?:-?(${c[u.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${c[u.PRERELEASEIDENTIFIERLOOSE]})*))`), h("BUILDIDENTIFIER", `${p}+`), h("BUILD", `(?:\\+(${c[u.BUILDIDENTIFIER]}(?:\\.${c[u.BUILDIDENTIFIER]})*))`), h("FULLPLAIN", `v?${c[u.MAINVERSION]}${c[u.PRERELEASE]}?${c[u.BUILD]}?`), h("FULL", `^${c[u.FULLPLAIN]}$`), h("LOOSEPLAIN", `[v=\\s]*${c[u.MAINVERSIONLOOSE]}${c[u.PRERELEASELOOSE]}?${c[u.BUILD]}?`), h("LOOSE", `^${c[u.LOOSEPLAIN]}$`), h("GTLT", "((?:<|>)?=?)"), h("XRANGEIDENTIFIERLOOSE", `${c[u.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`), h("XRANGEIDENTIFIER", `${c[u.NUMERICIDENTIFIER]}|x|X|\\*`), h("XRANGEPLAIN", `[v=\\s]*(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:${c[u.PRERELEASE]})?${c[u.BUILD]}?)?)?`), h("XRANGEPLAINLOOSE", `[v=\\s]*(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:${c[u.PRERELEASELOOSE]})?${c[u.BUILD]}?)?)?`), h("XRANGE", `^${c[u.GTLT]}\\s*${c[u.XRANGEPLAIN]}$`), h("XRANGELOOSE", `^${c[u.GTLT]}\\s*${c[u.XRANGEPLAINLOOSE]}$`), h("COERCEPLAIN", `(^|[^\\d])(\\d{1,${t}})(?:\\.(\\d{1,${t}}))?(?:\\.(\\d{1,${t}}))?`), h("COERCE", `${c[u.COERCEPLAIN]}(?:$|[^\\d])`), h("COERCEFULL", c[u.COERCEPLAIN] + `(?:${c[u.PRERELEASE]})?(?:${c[u.BUILD]})?(?:$|[^\\d])`), h("COERCERTL", c[u.COERCE], !0), h("COERCERTLFULL", c[u.COERCEFULL], !0), h("LONETILDE", "(?:~>?)"), h("TILDETRIM", `(\\s*)${c[u.LONETILDE]}\\s+`, !0), e.tildeTrimReplace = "$1~", h("TILDE", `^${c[u.LONETILDE]}${c[u.XRANGEPLAIN]}$`), h("TILDELOOSE", `^${c[u.LONETILDE]}${c[u.XRANGEPLAINLOOSE]}$`), h("LONECARET", "(?:\\^)"), h("CARETTRIM", `(\\s*)${c[u.LONECARET]}\\s+`, !0), e.caretTrimReplace = "$1^", h("CARET", `^${c[u.LONECARET]}${c[u.XRANGEPLAIN]}$`), h("CARETLOOSE", `^${c[u.LONECARET]}${c[u.XRANGEPLAINLOOSE]}$`), h("COMPARATORLOOSE", `^${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]})$|^$`), h("COMPARATOR", `^${c[u.GTLT]}\\s*(${c[u.FULLPLAIN]})$|^$`), h("COMPARATORTRIM", `(\\s*)${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]}|${c[u.XRANGEPLAIN]})`, !0), e.comparatorTrimReplace = "$1$2$3", h("HYPHENRANGE", `^\\s*(${c[u.XRANGEPLAIN]})\\s+-\\s+(${c[u.XRANGEPLAIN]})\\s*$`), h("HYPHENRANGELOOSE", `^\\s*(${c[u.XRANGEPLAINLOOSE]})\\s+-\\s+(${c[u.XRANGEPLAINLOOSE]})\\s*$`), h("STAR", "(<|>)?=?\\s*\\*"), h("GTE0", "^\\s*>=\\s*0\\.0\\.0\\s*$"), h("GTE0PRE", "^\\s*>=\\s*0\\.0\\.0-0\\s*$");
4147
4147
  }(rt, rt.exports)), rt.exports;
4148
4148
  }
4149
- var Ct, vs;
4150
- function Ar() {
4151
- if (vs) return Ct;
4152
- vs = 1;
4149
+ var Et, ws;
4150
+ function Dr() {
4151
+ if (ws) return Et;
4152
+ ws = 1;
4153
4153
  const s = Object.freeze({ loose: !0 }), e = Object.freeze({});
4154
- return Ct = (r) => r ? typeof r != "object" ? s : r : e, Ct;
4154
+ return Et = (r) => r ? typeof r != "object" ? s : r : e, Et;
4155
4155
  }
4156
- var Et, ys;
4157
- function Yn() {
4158
- if (ys) return Et;
4159
- ys = 1;
4156
+ var Pt, Ss;
4157
+ function Zn() {
4158
+ if (Ss) return Pt;
4159
+ Ss = 1;
4160
4160
  const s = /^[0-9]+$/, e = (r, n) => {
4161
4161
  const o = s.test(r), i = s.test(n);
4162
4162
  return o && i && (r = +r, n = +n), r === n ? 0 : o && !i ? -1 : i && !o ? 1 : r < n ? -1 : 1;
4163
4163
  };
4164
- return Et = {
4164
+ return Pt = {
4165
4165
  compareIdentifiers: e,
4166
4166
  rcompareIdentifiers: (r, n) => e(n, r)
4167
- }, Et;
4167
+ }, Pt;
4168
4168
  }
4169
- var Pt, ws;
4169
+ var Ot, bs;
4170
4170
  function Q() {
4171
- if (ws) return Pt;
4172
- ws = 1;
4173
- const s = ft(), { MAX_LENGTH: e, MAX_SAFE_INTEGER: t } = pt(), { safeRe: r, t: n } = We(), o = Ar(), { compareIdentifiers: i } = Yn();
4171
+ if (bs) return Ot;
4172
+ bs = 1;
4173
+ const s = ht(), { MAX_LENGTH: e, MAX_SAFE_INTEGER: t } = ft(), { safeRe: r, t: n } = We(), o = Dr(), { compareIdentifiers: i } = Zn();
4174
4174
  class a {
4175
4175
  constructor(l, u) {
4176
4176
  if (u = o(u), l instanceof a) {
@@ -4325,14 +4325,14 @@ function Q() {
4325
4325
  return this.raw = this.format(), this.build.length && (this.raw += `+${this.build.join(".")}`), this;
4326
4326
  }
4327
4327
  }
4328
- return Pt = a, Pt;
4328
+ return Ot = a, Ot;
4329
4329
  }
4330
- var Ot, Ss;
4330
+ var It, ks;
4331
4331
  function Oe() {
4332
- if (Ss) return Ot;
4333
- Ss = 1;
4332
+ if (ks) return It;
4333
+ ks = 1;
4334
4334
  const s = Q();
4335
- return Ot = (t, r, n = !1) => {
4335
+ return It = (t, r, n = !1) => {
4336
4336
  if (t instanceof s)
4337
4337
  return t;
4338
4338
  try {
@@ -4342,34 +4342,34 @@ function Oe() {
4342
4342
  return null;
4343
4343
  throw o;
4344
4344
  }
4345
- }, Ot;
4345
+ }, It;
4346
4346
  }
4347
- var It, bs;
4348
- function gc() {
4349
- if (bs) return It;
4350
- bs = 1;
4347
+ var Ft, Rs;
4348
+ function vc() {
4349
+ if (Rs) return Ft;
4350
+ Rs = 1;
4351
4351
  const s = Oe();
4352
- return It = (t, r) => {
4352
+ return Ft = (t, r) => {
4353
4353
  const n = s(t, r);
4354
4354
  return n ? n.version : null;
4355
- }, It;
4355
+ }, Ft;
4356
4356
  }
4357
- var Ft, ks;
4358
- function hc() {
4359
- if (ks) return Ft;
4360
- ks = 1;
4357
+ var Tt, Cs;
4358
+ function yc() {
4359
+ if (Cs) return Tt;
4360
+ Cs = 1;
4361
4361
  const s = Oe();
4362
- return Ft = (t, r) => {
4362
+ return Tt = (t, r) => {
4363
4363
  const n = s(t.trim().replace(/^[=v]+/, ""), r);
4364
4364
  return n ? n.version : null;
4365
- }, Ft;
4365
+ }, Tt;
4366
4366
  }
4367
- var Tt, Rs;
4368
- function mc() {
4369
- if (Rs) return Tt;
4370
- Rs = 1;
4367
+ var $t, Es;
4368
+ function wc() {
4369
+ if (Es) return $t;
4370
+ Es = 1;
4371
4371
  const s = Q();
4372
- return Tt = (t, r, n, o, i) => {
4372
+ return $t = (t, r, n, o, i) => {
4373
4373
  typeof n == "string" && (i = o, o = n, n = void 0);
4374
4374
  try {
4375
4375
  return new s(
@@ -4379,14 +4379,14 @@ function mc() {
4379
4379
  } catch {
4380
4380
  return null;
4381
4381
  }
4382
- }, Tt;
4382
+ }, $t;
4383
4383
  }
4384
- var $t, Cs;
4385
- function vc() {
4386
- if (Cs) return $t;
4387
- Cs = 1;
4384
+ var At, Ps;
4385
+ function Sc() {
4386
+ if (Ps) return At;
4387
+ Ps = 1;
4388
4388
  const s = Oe();
4389
- return $t = (t, r) => {
4389
+ return At = (t, r) => {
4390
4390
  const n = s(t, null, !0), o = s(r, null, !0), i = n.compare(o);
4391
4391
  if (i === 0)
4392
4392
  return null;
@@ -4399,132 +4399,132 @@ function vc() {
4399
4399
  }
4400
4400
  const p = u ? "pre" : "";
4401
4401
  return n.major !== o.major ? p + "major" : n.minor !== o.minor ? p + "minor" : n.patch !== o.patch ? p + "patch" : "prerelease";
4402
- }, $t;
4402
+ }, At;
4403
4403
  }
4404
- var At, Es;
4405
- function yc() {
4406
- if (Es) return At;
4407
- Es = 1;
4404
+ var Lt, Os;
4405
+ function bc() {
4406
+ if (Os) return Lt;
4407
+ Os = 1;
4408
4408
  const s = Q();
4409
- return At = (t, r) => new s(t, r).major, At;
4409
+ return Lt = (t, r) => new s(t, r).major, Lt;
4410
4410
  }
4411
- var Lt, Ps;
4412
- function wc() {
4413
- if (Ps) return Lt;
4414
- Ps = 1;
4411
+ var Dt, Is;
4412
+ function kc() {
4413
+ if (Is) return Dt;
4414
+ Is = 1;
4415
4415
  const s = Q();
4416
- return Lt = (t, r) => new s(t, r).minor, Lt;
4416
+ return Dt = (t, r) => new s(t, r).minor, Dt;
4417
4417
  }
4418
- var Dt, Os;
4419
- function Sc() {
4420
- if (Os) return Dt;
4421
- Os = 1;
4418
+ var Nt, Fs;
4419
+ function Rc() {
4420
+ if (Fs) return Nt;
4421
+ Fs = 1;
4422
4422
  const s = Q();
4423
- return Dt = (t, r) => new s(t, r).patch, Dt;
4423
+ return Nt = (t, r) => new s(t, r).patch, Nt;
4424
4424
  }
4425
- var Nt, Is;
4426
- function bc() {
4427
- if (Is) return Nt;
4428
- Is = 1;
4425
+ var Bt, Ts;
4426
+ function Cc() {
4427
+ if (Ts) return Bt;
4428
+ Ts = 1;
4429
4429
  const s = Oe();
4430
- return Nt = (t, r) => {
4430
+ return Bt = (t, r) => {
4431
4431
  const n = s(t, r);
4432
4432
  return n && n.prerelease.length ? n.prerelease : null;
4433
- }, Nt;
4433
+ }, Bt;
4434
4434
  }
4435
- var Bt, Fs;
4435
+ var jt, $s;
4436
4436
  function ie() {
4437
- if (Fs) return Bt;
4438
- Fs = 1;
4437
+ if ($s) return jt;
4438
+ $s = 1;
4439
4439
  const s = Q();
4440
- return Bt = (t, r, n) => new s(t, n).compare(new s(r, n)), Bt;
4440
+ return jt = (t, r, n) => new s(t, n).compare(new s(r, n)), jt;
4441
4441
  }
4442
- var jt, Ts;
4443
- function kc() {
4444
- if (Ts) return jt;
4445
- Ts = 1;
4442
+ var xt, As;
4443
+ function Ec() {
4444
+ if (As) return xt;
4445
+ As = 1;
4446
4446
  const s = ie();
4447
- return jt = (t, r, n) => s(r, t, n), jt;
4447
+ return xt = (t, r, n) => s(r, t, n), xt;
4448
4448
  }
4449
- var xt, $s;
4450
- function Rc() {
4451
- if ($s) return xt;
4452
- $s = 1;
4449
+ var Vt, Ls;
4450
+ function Pc() {
4451
+ if (Ls) return Vt;
4452
+ Ls = 1;
4453
4453
  const s = ie();
4454
- return xt = (t, r) => s(t, r, !0), xt;
4454
+ return Vt = (t, r) => s(t, r, !0), Vt;
4455
4455
  }
4456
- var Vt, As;
4457
- function Lr() {
4458
- if (As) return Vt;
4459
- As = 1;
4456
+ var Ut, Ds;
4457
+ function Nr() {
4458
+ if (Ds) return Ut;
4459
+ Ds = 1;
4460
4460
  const s = Q();
4461
- return Vt = (t, r, n) => {
4461
+ return Ut = (t, r, n) => {
4462
4462
  const o = new s(t, n), i = new s(r, n);
4463
4463
  return o.compare(i) || o.compareBuild(i);
4464
- }, Vt;
4465
- }
4466
- var Ut, Ls;
4467
- function Cc() {
4468
- if (Ls) return Ut;
4469
- Ls = 1;
4470
- const s = Lr();
4471
- return Ut = (t, r) => t.sort((n, o) => s(n, o, r)), Ut;
4472
- }
4473
- var Jt, Ds;
4474
- function Ec() {
4475
- if (Ds) return Jt;
4476
- Ds = 1;
4477
- const s = Lr();
4478
- return Jt = (t, r) => t.sort((n, o) => s(o, n, r)), Jt;
4464
+ }, Ut;
4479
4465
  }
4480
- var Mt, Ns;
4481
- function gt() {
4482
- if (Ns) return Mt;
4466
+ var Jt, Ns;
4467
+ function Oc() {
4468
+ if (Ns) return Jt;
4483
4469
  Ns = 1;
4484
- const s = ie();
4485
- return Mt = (t, r, n) => s(t, r, n) > 0, Mt;
4470
+ const s = Nr();
4471
+ return Jt = (t, r) => t.sort((n, o) => s(n, o, r)), Jt;
4486
4472
  }
4487
- var Gt, Bs;
4488
- function Dr() {
4489
- if (Bs) return Gt;
4473
+ var Mt, Bs;
4474
+ function Ic() {
4475
+ if (Bs) return Mt;
4490
4476
  Bs = 1;
4491
- const s = ie();
4492
- return Gt = (t, r, n) => s(t, r, n) < 0, Gt;
4477
+ const s = Nr();
4478
+ return Mt = (t, r) => t.sort((n, o) => s(o, n, r)), Mt;
4493
4479
  }
4494
- var _t, js;
4495
- function Qn() {
4496
- if (js) return _t;
4480
+ var Gt, js;
4481
+ function gt() {
4482
+ if (js) return Gt;
4497
4483
  js = 1;
4498
4484
  const s = ie();
4499
- return _t = (t, r, n) => s(t, r, n) === 0, _t;
4485
+ return Gt = (t, r, n) => s(t, r, n) > 0, Gt;
4500
4486
  }
4501
- var qt, xs;
4502
- function Zn() {
4503
- if (xs) return qt;
4487
+ var _t, xs;
4488
+ function Br() {
4489
+ if (xs) return _t;
4504
4490
  xs = 1;
4505
4491
  const s = ie();
4506
- return qt = (t, r, n) => s(t, r, n) !== 0, qt;
4492
+ return _t = (t, r, n) => s(t, r, n) < 0, _t;
4507
4493
  }
4508
- var Kt, Vs;
4509
- function Nr() {
4510
- if (Vs) return Kt;
4494
+ var qt, Vs;
4495
+ function eo() {
4496
+ if (Vs) return qt;
4511
4497
  Vs = 1;
4512
4498
  const s = ie();
4513
- return Kt = (t, r, n) => s(t, r, n) >= 0, Kt;
4499
+ return qt = (t, r, n) => s(t, r, n) === 0, qt;
4514
4500
  }
4515
- var Ht, Us;
4516
- function Br() {
4517
- if (Us) return Ht;
4501
+ var Kt, Us;
4502
+ function to() {
4503
+ if (Us) return Kt;
4518
4504
  Us = 1;
4519
4505
  const s = ie();
4520
- return Ht = (t, r, n) => s(t, r, n) <= 0, Ht;
4506
+ return Kt = (t, r, n) => s(t, r, n) !== 0, Kt;
4521
4507
  }
4522
- var Wt, Js;
4523
- function eo() {
4524
- if (Js) return Wt;
4508
+ var Ht, Js;
4509
+ function jr() {
4510
+ if (Js) return Ht;
4525
4511
  Js = 1;
4526
- const s = Qn(), e = Zn(), t = gt(), r = Nr(), n = Dr(), o = Br();
4527
- return Wt = (a, c, l, u) => {
4512
+ const s = ie();
4513
+ return Ht = (t, r, n) => s(t, r, n) >= 0, Ht;
4514
+ }
4515
+ var Wt, Ms;
4516
+ function xr() {
4517
+ if (Ms) return Wt;
4518
+ Ms = 1;
4519
+ const s = ie();
4520
+ return Wt = (t, r, n) => s(t, r, n) <= 0, Wt;
4521
+ }
4522
+ var zt, Gs;
4523
+ function ro() {
4524
+ if (Gs) return zt;
4525
+ Gs = 1;
4526
+ const s = eo(), e = to(), t = gt(), r = jr(), n = Br(), o = xr();
4527
+ return zt = (a, c, l, u) => {
4528
4528
  switch (c) {
4529
4529
  case "===":
4530
4530
  return typeof a == "object" && (a = a.version), typeof l == "object" && (l = l.version), a === l;
@@ -4547,14 +4547,14 @@ function eo() {
4547
4547
  default:
4548
4548
  throw new TypeError(`Invalid operator: ${c}`);
4549
4549
  }
4550
- }, Wt;
4550
+ }, zt;
4551
4551
  }
4552
- var zt, Ms;
4553
- function Pc() {
4554
- if (Ms) return zt;
4555
- Ms = 1;
4552
+ var Xt, _s;
4553
+ function Fc() {
4554
+ if (_s) return Xt;
4555
+ _s = 1;
4556
4556
  const s = Q(), e = Oe(), { safeRe: t, t: r } = We();
4557
- return zt = (o, i) => {
4557
+ return Xt = (o, i) => {
4558
4558
  if (o instanceof s)
4559
4559
  return o;
4560
4560
  if (typeof o == "number" && (o = String(o)), typeof o != "string")
@@ -4574,12 +4574,12 @@ function Pc() {
4574
4574
  return null;
4575
4575
  const c = a[2], l = a[3] || "0", u = a[4] || "0", d = i.includePrerelease && a[5] ? `-${a[5]}` : "", p = i.includePrerelease && a[6] ? `+${a[6]}` : "";
4576
4576
  return e(`${c}.${l}.${u}${d}${p}`, i);
4577
- }, zt;
4577
+ }, Xt;
4578
4578
  }
4579
- var Xt, Gs;
4580
- function Oc() {
4581
- if (Gs) return Xt;
4582
- Gs = 1;
4579
+ var Yt, qs;
4580
+ function Tc() {
4581
+ if (qs) return Yt;
4582
+ qs = 1;
4583
4583
  class s {
4584
4584
  constructor() {
4585
4585
  this.max = 1e3, this.map = /* @__PURE__ */ new Map();
@@ -4603,12 +4603,12 @@ function Oc() {
4603
4603
  return this;
4604
4604
  }
4605
4605
  }
4606
- return Xt = s, Xt;
4606
+ return Yt = s, Yt;
4607
4607
  }
4608
- var Yt, _s;
4608
+ var Qt, Ks;
4609
4609
  function ae() {
4610
- if (_s) return Yt;
4611
- _s = 1;
4610
+ if (Ks) return Qt;
4611
+ Ks = 1;
4612
4612
  const s = /\s+/g;
4613
4613
  class e {
4614
4614
  constructor(m, w) {
@@ -4620,12 +4620,12 @@ function ae() {
4620
4620
  throw new TypeError(`Invalid SemVer Range: ${this.raw}`);
4621
4621
  if (this.set.length > 1) {
4622
4622
  const y = this.set[0];
4623
- if (this.set = this.set.filter((k) => !g(k[0])), this.set.length === 0)
4623
+ if (this.set = this.set.filter((R) => !h(R[0])), this.set.length === 0)
4624
4624
  this.set = [y];
4625
4625
  else if (this.set.length > 1) {
4626
- for (const k of this.set)
4627
- if (k.length === 1 && S(k[0])) {
4628
- this.set = [k];
4626
+ for (const R of this.set)
4627
+ if (R.length === 1 && S(R[0])) {
4628
+ this.set = [R];
4629
4629
  break;
4630
4630
  }
4631
4631
  }
@@ -4651,16 +4651,16 @@ function ae() {
4651
4651
  return this.range;
4652
4652
  }
4653
4653
  parseRange(m) {
4654
- const y = ((this.options.includePrerelease && f) | (this.options.loose && v)) + ":" + m, k = r.get(y);
4655
- if (k)
4656
- return k;
4657
- const b = this.options.loose, O = b ? c[l.HYPHENRANGELOOSE] : c[l.HYPHENRANGE];
4654
+ const y = ((this.options.includePrerelease && f) | (this.options.loose && v)) + ":" + m, R = r.get(y);
4655
+ if (R)
4656
+ return R;
4657
+ const k = this.options.loose, O = k ? c[l.HYPHENRANGELOOSE] : c[l.HYPHENRANGE];
4658
4658
  m = m.replace(O, J(this.options.includePrerelease)), i("hyphen replace", m), m = m.replace(c[l.COMPARATORTRIM], u), i("comparator trim", m), m = m.replace(c[l.TILDETRIM], d), i("tilde trim", m), m = m.replace(c[l.CARETTRIM], p), i("caret trim", m);
4659
4659
  let $ = m.split(" ").map((U) => j(U, this.options)).join(" ").split(/\s+/).map((U) => z(U, this.options));
4660
- b && ($ = $.filter((U) => (i("loose invalid filter", U, this.options), !!U.match(c[l.COMPARATORLOOSE])))), i("range list", $);
4660
+ k && ($ = $.filter((U) => (i("loose invalid filter", U, this.options), !!U.match(c[l.COMPARATORLOOSE])))), i("range list", $);
4661
4661
  const I = /* @__PURE__ */ new Map(), x = $.map((U) => new o(U, this.options));
4662
4662
  for (const U of x) {
4663
- if (g(U))
4663
+ if (h(U))
4664
4664
  return [U];
4665
4665
  I.set(U.value, U);
4666
4666
  }
@@ -4671,7 +4671,7 @@ function ae() {
4671
4671
  intersects(m, w) {
4672
4672
  if (!(m instanceof e))
4673
4673
  throw new TypeError("a Range is required");
4674
- return this.set.some((y) => E(y, w) && m.set.some((k) => E(k, w) && y.every((b) => k.every((O) => b.intersects(O, w)))));
4674
+ return this.set.some((y) => E(y, w) && m.set.some((R) => E(R, w) && y.every((k) => R.every((O) => k.intersects(O, w)))));
4675
4675
  }
4676
4676
  // if ANY of the sets match ALL of its comparators, then pass
4677
4677
  test(m) {
@@ -4689,64 +4689,64 @@ function ae() {
4689
4689
  return !1;
4690
4690
  }
4691
4691
  }
4692
- Yt = e;
4693
- const t = Oc(), r = new t(), n = Ar(), o = ht(), i = ft(), a = Q(), {
4692
+ Qt = e;
4693
+ const t = Tc(), r = new t(), n = Dr(), o = mt(), i = ht(), a = Q(), {
4694
4694
  safeRe: c,
4695
4695
  t: l,
4696
4696
  comparatorTrimReplace: u,
4697
4697
  tildeTrimReplace: d,
4698
4698
  caretTrimReplace: p
4699
- } = We(), { FLAG_INCLUDE_PRERELEASE: f, FLAG_LOOSE: v } = pt(), g = (h) => h.value === "<0.0.0-0", S = (h) => h.value === "", E = (h, m) => {
4699
+ } = We(), { FLAG_INCLUDE_PRERELEASE: f, FLAG_LOOSE: v } = ft(), h = (g) => g.value === "<0.0.0-0", S = (g) => g.value === "", E = (g, m) => {
4700
4700
  let w = !0;
4701
- const y = h.slice();
4702
- let k = y.pop();
4701
+ const y = g.slice();
4702
+ let R = y.pop();
4703
4703
  for (; w && y.length; )
4704
- w = y.every((b) => k.intersects(b, m)), k = y.pop();
4704
+ w = y.every((k) => R.intersects(k, m)), R = y.pop();
4705
4705
  return w;
4706
- }, j = (h, m) => (i("comp", h, m), h = P(h, m), i("caret", h), h = B(h, m), i("tildes", h), h = C(h, m), i("xrange", h), h = ce(h, m), i("stars", h), h), F = (h) => !h || h.toLowerCase() === "x" || h === "*", B = (h, m) => h.trim().split(/\s+/).map((w) => V(w, m)).join(" "), V = (h, m) => {
4706
+ }, j = (g, m) => (i("comp", g, m), g = P(g, m), i("caret", g), g = B(g, m), i("tildes", g), g = C(g, m), i("xrange", g), g = ce(g, m), i("stars", g), g), F = (g) => !g || g.toLowerCase() === "x" || g === "*", B = (g, m) => g.trim().split(/\s+/).map((w) => V(w, m)).join(" "), V = (g, m) => {
4707
4707
  const w = m.loose ? c[l.TILDELOOSE] : c[l.TILDE];
4708
- return h.replace(w, (y, k, b, O, $) => {
4709
- i("tilde", h, y, k, b, O, $);
4708
+ return g.replace(w, (y, R, k, O, $) => {
4709
+ i("tilde", g, y, R, k, O, $);
4710
4710
  let I;
4711
- return F(k) ? I = "" : F(b) ? I = `>=${k}.0.0 <${+k + 1}.0.0-0` : F(O) ? I = `>=${k}.${b}.0 <${k}.${+b + 1}.0-0` : $ ? (i("replaceTilde pr", $), I = `>=${k}.${b}.${O}-${$} <${k}.${+b + 1}.0-0`) : I = `>=${k}.${b}.${O} <${k}.${+b + 1}.0-0`, i("tilde return", I), I;
4711
+ return F(R) ? I = "" : F(k) ? I = `>=${R}.0.0 <${+R + 1}.0.0-0` : F(O) ? I = `>=${R}.${k}.0 <${R}.${+k + 1}.0-0` : $ ? (i("replaceTilde pr", $), I = `>=${R}.${k}.${O}-${$} <${R}.${+k + 1}.0-0`) : I = `>=${R}.${k}.${O} <${R}.${+k + 1}.0-0`, i("tilde return", I), I;
4712
4712
  });
4713
- }, P = (h, m) => h.trim().split(/\s+/).map((w) => N(w, m)).join(" "), N = (h, m) => {
4714
- i("caret", h, m);
4713
+ }, P = (g, m) => g.trim().split(/\s+/).map((w) => N(w, m)).join(" "), N = (g, m) => {
4714
+ i("caret", g, m);
4715
4715
  const w = m.loose ? c[l.CARETLOOSE] : c[l.CARET], y = m.includePrerelease ? "-0" : "";
4716
- return h.replace(w, (k, b, O, $, I) => {
4717
- i("caret", h, k, b, O, $, I);
4716
+ return g.replace(w, (R, k, O, $, I) => {
4717
+ i("caret", g, R, k, O, $, I);
4718
4718
  let x;
4719
- return F(b) ? x = "" : F(O) ? x = `>=${b}.0.0${y} <${+b + 1}.0.0-0` : F($) ? b === "0" ? x = `>=${b}.${O}.0${y} <${b}.${+O + 1}.0-0` : x = `>=${b}.${O}.0${y} <${+b + 1}.0.0-0` : I ? (i("replaceCaret pr", I), b === "0" ? O === "0" ? x = `>=${b}.${O}.${$}-${I} <${b}.${O}.${+$ + 1}-0` : x = `>=${b}.${O}.${$}-${I} <${b}.${+O + 1}.0-0` : x = `>=${b}.${O}.${$}-${I} <${+b + 1}.0.0-0`) : (i("no pr"), b === "0" ? O === "0" ? x = `>=${b}.${O}.${$}${y} <${b}.${O}.${+$ + 1}-0` : x = `>=${b}.${O}.${$}${y} <${b}.${+O + 1}.0-0` : x = `>=${b}.${O}.${$} <${+b + 1}.0.0-0`), i("caret return", x), x;
4719
+ return F(k) ? x = "" : F(O) ? x = `>=${k}.0.0${y} <${+k + 1}.0.0-0` : F($) ? k === "0" ? x = `>=${k}.${O}.0${y} <${k}.${+O + 1}.0-0` : x = `>=${k}.${O}.0${y} <${+k + 1}.0.0-0` : I ? (i("replaceCaret pr", I), k === "0" ? O === "0" ? x = `>=${k}.${O}.${$}-${I} <${k}.${O}.${+$ + 1}-0` : x = `>=${k}.${O}.${$}-${I} <${k}.${+O + 1}.0-0` : x = `>=${k}.${O}.${$}-${I} <${+k + 1}.0.0-0`) : (i("no pr"), k === "0" ? O === "0" ? x = `>=${k}.${O}.${$}${y} <${k}.${O}.${+$ + 1}-0` : x = `>=${k}.${O}.${$}${y} <${k}.${+O + 1}.0-0` : x = `>=${k}.${O}.${$} <${+k + 1}.0.0-0`), i("caret return", x), x;
4720
4720
  });
4721
- }, C = (h, m) => (i("replaceXRanges", h, m), h.split(/\s+/).map((w) => G(w, m)).join(" ")), G = (h, m) => {
4722
- h = h.trim();
4721
+ }, C = (g, m) => (i("replaceXRanges", g, m), g.split(/\s+/).map((w) => G(w, m)).join(" ")), G = (g, m) => {
4722
+ g = g.trim();
4723
4723
  const w = m.loose ? c[l.XRANGELOOSE] : c[l.XRANGE];
4724
- return h.replace(w, (y, k, b, O, $, I) => {
4725
- i("xRange", h, y, k, b, O, $, I);
4726
- const x = F(b), H = x || F(O), U = H || F($), ne = U;
4727
- return k === "=" && ne && (k = ""), I = m.includePrerelease ? "-0" : "", x ? k === ">" || k === "<" ? y = "<0.0.0-0" : y = "*" : k && ne ? (H && (O = 0), $ = 0, k === ">" ? (k = ">=", H ? (b = +b + 1, O = 0, $ = 0) : (O = +O + 1, $ = 0)) : k === "<=" && (k = "<", H ? b = +b + 1 : O = +O + 1), k === "<" && (I = "-0"), y = `${k + b}.${O}.${$}${I}`) : H ? y = `>=${b}.0.0${I} <${+b + 1}.0.0-0` : U && (y = `>=${b}.${O}.0${I} <${b}.${+O + 1}.0-0`), i("xRange return", y), y;
4724
+ return g.replace(w, (y, R, k, O, $, I) => {
4725
+ i("xRange", g, y, R, k, O, $, I);
4726
+ const x = F(k), H = x || F(O), U = H || F($), ne = U;
4727
+ return R === "=" && ne && (R = ""), I = m.includePrerelease ? "-0" : "", x ? R === ">" || R === "<" ? y = "<0.0.0-0" : y = "*" : R && ne ? (H && (O = 0), $ = 0, R === ">" ? (R = ">=", H ? (k = +k + 1, O = 0, $ = 0) : (O = +O + 1, $ = 0)) : R === "<=" && (R = "<", H ? k = +k + 1 : O = +O + 1), R === "<" && (I = "-0"), y = `${R + k}.${O}.${$}${I}`) : H ? y = `>=${k}.0.0${I} <${+k + 1}.0.0-0` : U && (y = `>=${k}.${O}.0${I} <${k}.${+O + 1}.0-0`), i("xRange return", y), y;
4728
4728
  });
4729
- }, ce = (h, m) => (i("replaceStars", h, m), h.trim().replace(c[l.STAR], "")), z = (h, m) => (i("replaceGTE0", h, m), h.trim().replace(c[m.includePrerelease ? l.GTE0PRE : l.GTE0], "")), J = (h) => (m, w, y, k, b, O, $, I, x, H, U, ne) => (F(y) ? w = "" : F(k) ? w = `>=${y}.0.0${h ? "-0" : ""}` : F(b) ? w = `>=${y}.${k}.0${h ? "-0" : ""}` : O ? w = `>=${w}` : w = `>=${w}${h ? "-0" : ""}`, F(x) ? I = "" : F(H) ? I = `<${+x + 1}.0.0-0` : F(U) ? I = `<${x}.${+H + 1}.0-0` : ne ? I = `<=${x}.${H}.${U}-${ne}` : h ? I = `<${x}.${H}.${+U + 1}-0` : I = `<=${I}`, `${w} ${I}`.trim()), W = (h, m, w) => {
4730
- for (let y = 0; y < h.length; y++)
4731
- if (!h[y].test(m))
4729
+ }, ce = (g, m) => (i("replaceStars", g, m), g.trim().replace(c[l.STAR], "")), z = (g, m) => (i("replaceGTE0", g, m), g.trim().replace(c[m.includePrerelease ? l.GTE0PRE : l.GTE0], "")), J = (g) => (m, w, y, R, k, O, $, I, x, H, U, ne) => (F(y) ? w = "" : F(R) ? w = `>=${y}.0.0${g ? "-0" : ""}` : F(k) ? w = `>=${y}.${R}.0${g ? "-0" : ""}` : O ? w = `>=${w}` : w = `>=${w}${g ? "-0" : ""}`, F(x) ? I = "" : F(H) ? I = `<${+x + 1}.0.0-0` : F(U) ? I = `<${x}.${+H + 1}.0-0` : ne ? I = `<=${x}.${H}.${U}-${ne}` : g ? I = `<${x}.${H}.${+U + 1}-0` : I = `<=${I}`, `${w} ${I}`.trim()), W = (g, m, w) => {
4730
+ for (let y = 0; y < g.length; y++)
4731
+ if (!g[y].test(m))
4732
4732
  return !1;
4733
4733
  if (m.prerelease.length && !w.includePrerelease) {
4734
- for (let y = 0; y < h.length; y++)
4735
- if (i(h[y].semver), h[y].semver !== o.ANY && h[y].semver.prerelease.length > 0) {
4736
- const k = h[y].semver;
4737
- if (k.major === m.major && k.minor === m.minor && k.patch === m.patch)
4734
+ for (let y = 0; y < g.length; y++)
4735
+ if (i(g[y].semver), g[y].semver !== o.ANY && g[y].semver.prerelease.length > 0) {
4736
+ const R = g[y].semver;
4737
+ if (R.major === m.major && R.minor === m.minor && R.patch === m.patch)
4738
4738
  return !0;
4739
4739
  }
4740
4740
  return !1;
4741
4741
  }
4742
4742
  return !0;
4743
4743
  };
4744
- return Yt;
4744
+ return Qt;
4745
4745
  }
4746
- var Qt, qs;
4747
- function ht() {
4748
- if (qs) return Qt;
4749
- qs = 1;
4746
+ var Zt, Hs;
4747
+ function mt() {
4748
+ if (Hs) return Zt;
4749
+ Hs = 1;
4750
4750
  const s = Symbol("SemVer ANY");
4751
4751
  class e {
4752
4752
  static get ANY() {
@@ -4786,37 +4786,37 @@ function ht() {
4786
4786
  return this.operator === "" ? this.value === "" ? !0 : new c(u.value, d).test(this.value) : u.operator === "" ? u.value === "" ? !0 : new c(this.value, d).test(u.semver) : (d = t(d), d.includePrerelease && (this.value === "<0.0.0-0" || u.value === "<0.0.0-0") || !d.includePrerelease && (this.value.startsWith("<0.0.0") || u.value.startsWith("<0.0.0")) ? !1 : !!(this.operator.startsWith(">") && u.operator.startsWith(">") || this.operator.startsWith("<") && u.operator.startsWith("<") || this.semver.version === u.semver.version && this.operator.includes("=") && u.operator.includes("=") || o(this.semver, "<", u.semver, d) && this.operator.startsWith(">") && u.operator.startsWith("<") || o(this.semver, ">", u.semver, d) && this.operator.startsWith("<") && u.operator.startsWith(">")));
4787
4787
  }
4788
4788
  }
4789
- Qt = e;
4790
- const t = Ar(), { safeRe: r, t: n } = We(), o = eo(), i = ft(), a = Q(), c = ae();
4791
- return Qt;
4789
+ Zt = e;
4790
+ const t = Dr(), { safeRe: r, t: n } = We(), o = ro(), i = ht(), a = Q(), c = ae();
4791
+ return Zt;
4792
4792
  }
4793
- var Zt, Ks;
4794
- function mt() {
4795
- if (Ks) return Zt;
4796
- Ks = 1;
4793
+ var er, Ws;
4794
+ function vt() {
4795
+ if (Ws) return er;
4796
+ Ws = 1;
4797
4797
  const s = ae();
4798
- return Zt = (t, r, n) => {
4798
+ return er = (t, r, n) => {
4799
4799
  try {
4800
4800
  r = new s(r, n);
4801
4801
  } catch {
4802
4802
  return !1;
4803
4803
  }
4804
4804
  return r.test(t);
4805
- }, Zt;
4805
+ }, er;
4806
4806
  }
4807
- var er, Hs;
4808
- function Ic() {
4809
- if (Hs) return er;
4810
- Hs = 1;
4807
+ var tr, zs;
4808
+ function $c() {
4809
+ if (zs) return tr;
4810
+ zs = 1;
4811
4811
  const s = ae();
4812
- return er = (t, r) => new s(t, r).set.map((n) => n.map((o) => o.value).join(" ").trim().split(" ")), er;
4812
+ return tr = (t, r) => new s(t, r).set.map((n) => n.map((o) => o.value).join(" ").trim().split(" ")), tr;
4813
4813
  }
4814
- var tr, Ws;
4815
- function Fc() {
4816
- if (Ws) return tr;
4817
- Ws = 1;
4814
+ var rr, Xs;
4815
+ function Ac() {
4816
+ if (Xs) return rr;
4817
+ Xs = 1;
4818
4818
  const s = Q(), e = ae();
4819
- return tr = (r, n, o) => {
4819
+ return rr = (r, n, o) => {
4820
4820
  let i = null, a = null, c = null;
4821
4821
  try {
4822
4822
  c = new e(n, o);
@@ -4826,14 +4826,14 @@ function Fc() {
4826
4826
  return r.forEach((l) => {
4827
4827
  c.test(l) && (!i || a.compare(l) === -1) && (i = l, a = new s(i, o));
4828
4828
  }), i;
4829
- }, tr;
4829
+ }, rr;
4830
4830
  }
4831
- var rr, zs;
4832
- function Tc() {
4833
- if (zs) return rr;
4834
- zs = 1;
4831
+ var sr, Ys;
4832
+ function Lc() {
4833
+ if (Ys) return sr;
4834
+ Ys = 1;
4835
4835
  const s = Q(), e = ae();
4836
- return rr = (r, n, o) => {
4836
+ return sr = (r, n, o) => {
4837
4837
  let i = null, a = null, c = null;
4838
4838
  try {
4839
4839
  c = new e(n, o);
@@ -4843,14 +4843,14 @@ function Tc() {
4843
4843
  return r.forEach((l) => {
4844
4844
  c.test(l) && (!i || a.compare(l) === 1) && (i = l, a = new s(i, o));
4845
4845
  }), i;
4846
- }, rr;
4846
+ }, sr;
4847
4847
  }
4848
- var sr, Xs;
4849
- function $c() {
4850
- if (Xs) return sr;
4851
- Xs = 1;
4848
+ var nr, Qs;
4849
+ function Dc() {
4850
+ if (Qs) return nr;
4851
+ Qs = 1;
4852
4852
  const s = Q(), e = ae(), t = gt();
4853
- return sr = (n, o) => {
4853
+ return nr = (n, o) => {
4854
4854
  n = new e(n, o);
4855
4855
  let i = new s("0.0.0");
4856
4856
  if (n.test(i) || (i = new s("0.0.0-0"), n.test(i)))
@@ -4879,35 +4879,35 @@ function $c() {
4879
4879
  }), l && (!i || t(i, l)) && (i = l);
4880
4880
  }
4881
4881
  return i && n.test(i) ? i : null;
4882
- }, sr;
4882
+ }, nr;
4883
4883
  }
4884
- var nr, Ys;
4885
- function Ac() {
4886
- if (Ys) return nr;
4887
- Ys = 1;
4884
+ var or, Zs;
4885
+ function Nc() {
4886
+ if (Zs) return or;
4887
+ Zs = 1;
4888
4888
  const s = ae();
4889
- return nr = (t, r) => {
4889
+ return or = (t, r) => {
4890
4890
  try {
4891
4891
  return new s(t, r).range || "*";
4892
4892
  } catch {
4893
4893
  return null;
4894
4894
  }
4895
- }, nr;
4895
+ }, or;
4896
4896
  }
4897
- var or, Qs;
4898
- function jr() {
4899
- if (Qs) return or;
4900
- Qs = 1;
4901
- const s = Q(), e = ht(), { ANY: t } = e, r = ae(), n = mt(), o = gt(), i = Dr(), a = Br(), c = Nr();
4902
- return or = (u, d, p, f) => {
4897
+ var ir, en;
4898
+ function Vr() {
4899
+ if (en) return ir;
4900
+ en = 1;
4901
+ const s = Q(), e = mt(), { ANY: t } = e, r = ae(), n = vt(), o = gt(), i = Br(), a = xr(), c = jr();
4902
+ return ir = (u, d, p, f) => {
4903
4903
  u = new s(u, f), d = new r(d, f);
4904
- let v, g, S, E, j;
4904
+ let v, h, S, E, j;
4905
4905
  switch (p) {
4906
4906
  case ">":
4907
- v = o, g = a, S = i, E = ">", j = ">=";
4907
+ v = o, h = a, S = i, E = ">", j = ">=";
4908
4908
  break;
4909
4909
  case "<":
4910
- v = i, g = c, S = o, E = "<", j = "<=";
4910
+ v = i, h = c, S = o, E = "<", j = "<=";
4911
4911
  break;
4912
4912
  default:
4913
4913
  throw new TypeError('Must provide a hilo val of "<" or ">"');
@@ -4919,41 +4919,41 @@ function jr() {
4919
4919
  let V = null, P = null;
4920
4920
  if (B.forEach((N) => {
4921
4921
  N.semver === t && (N = new e(">=0.0.0")), V = V || N, P = P || N, v(N.semver, V.semver, f) ? V = N : S(N.semver, P.semver, f) && (P = N);
4922
- }), V.operator === E || V.operator === j || (!P.operator || P.operator === E) && g(u, P.semver))
4922
+ }), V.operator === E || V.operator === j || (!P.operator || P.operator === E) && h(u, P.semver))
4923
4923
  return !1;
4924
4924
  if (P.operator === j && S(u, P.semver))
4925
4925
  return !1;
4926
4926
  }
4927
4927
  return !0;
4928
- }, or;
4928
+ }, ir;
4929
4929
  }
4930
- var ir, Zs;
4931
- function Lc() {
4932
- if (Zs) return ir;
4933
- Zs = 1;
4934
- const s = jr();
4935
- return ir = (t, r, n) => s(t, r, ">", n), ir;
4930
+ var ar, tn;
4931
+ function Bc() {
4932
+ if (tn) return ar;
4933
+ tn = 1;
4934
+ const s = Vr();
4935
+ return ar = (t, r, n) => s(t, r, ">", n), ar;
4936
4936
  }
4937
- var ar, en;
4938
- function Dc() {
4939
- if (en) return ar;
4940
- en = 1;
4941
- const s = jr();
4942
- return ar = (t, r, n) => s(t, r, "<", n), ar;
4937
+ var cr, rn;
4938
+ function jc() {
4939
+ if (rn) return cr;
4940
+ rn = 1;
4941
+ const s = Vr();
4942
+ return cr = (t, r, n) => s(t, r, "<", n), cr;
4943
4943
  }
4944
- var cr, tn;
4945
- function Nc() {
4946
- if (tn) return cr;
4947
- tn = 1;
4944
+ var lr, sn;
4945
+ function xc() {
4946
+ if (sn) return lr;
4947
+ sn = 1;
4948
4948
  const s = ae();
4949
- return cr = (t, r, n) => (t = new s(t, n), r = new s(r, n), t.intersects(r, n)), cr;
4949
+ return lr = (t, r, n) => (t = new s(t, n), r = new s(r, n), t.intersects(r, n)), lr;
4950
4950
  }
4951
- var lr, rn;
4952
- function Bc() {
4953
- if (rn) return lr;
4954
- rn = 1;
4955
- const s = mt(), e = ie();
4956
- return lr = (t, r, n) => {
4951
+ var ur, nn;
4952
+ function Vc() {
4953
+ if (nn) return ur;
4954
+ nn = 1;
4955
+ const s = vt(), e = ie();
4956
+ return ur = (t, r, n) => {
4957
4957
  const o = [];
4958
4958
  let i = null, a = null;
4959
4959
  const c = t.sort((p, f) => e(p, f, n));
@@ -4965,20 +4965,20 @@ function Bc() {
4965
4965
  p === f ? l.push(p) : !f && p === c[0] ? l.push("*") : f ? p === c[0] ? l.push(`<=${f}`) : l.push(`${p} - ${f}`) : l.push(`>=${p}`);
4966
4966
  const u = l.join(" || "), d = typeof r.raw == "string" ? r.raw : String(r);
4967
4967
  return u.length < d.length ? u : r;
4968
- }, lr;
4968
+ }, ur;
4969
4969
  }
4970
- var ur, sn;
4971
- function jc() {
4972
- if (sn) return ur;
4973
- sn = 1;
4974
- const s = ae(), e = ht(), { ANY: t } = e, r = mt(), n = ie(), o = (d, p, f = {}) => {
4970
+ var dr, on;
4971
+ function Uc() {
4972
+ if (on) return dr;
4973
+ on = 1;
4974
+ const s = ae(), e = mt(), { ANY: t } = e, r = vt(), n = ie(), o = (d, p, f = {}) => {
4975
4975
  if (d === p)
4976
4976
  return !0;
4977
4977
  d = new s(d, f), p = new s(p, f);
4978
4978
  let v = !1;
4979
- e: for (const g of d.set) {
4979
+ e: for (const h of d.set) {
4980
4980
  for (const S of p.set) {
4981
- const E = c(g, S, f);
4981
+ const E = c(h, S, f);
4982
4982
  if (v = v || E !== null, E)
4983
4983
  continue e;
4984
4984
  }
@@ -5000,34 +5000,34 @@ function jc() {
5000
5000
  p = a;
5001
5001
  }
5002
5002
  const v = /* @__PURE__ */ new Set();
5003
- let g, S;
5003
+ let h, S;
5004
5004
  for (const C of d)
5005
- C.operator === ">" || C.operator === ">=" ? g = l(g, C, f) : C.operator === "<" || C.operator === "<=" ? S = u(S, C, f) : v.add(C.semver);
5005
+ C.operator === ">" || C.operator === ">=" ? h = l(h, C, f) : C.operator === "<" || C.operator === "<=" ? S = u(S, C, f) : v.add(C.semver);
5006
5006
  if (v.size > 1)
5007
5007
  return null;
5008
5008
  let E;
5009
- if (g && S) {
5010
- if (E = n(g.semver, S.semver, f), E > 0)
5009
+ if (h && S) {
5010
+ if (E = n(h.semver, S.semver, f), E > 0)
5011
5011
  return null;
5012
- if (E === 0 && (g.operator !== ">=" || S.operator !== "<="))
5012
+ if (E === 0 && (h.operator !== ">=" || S.operator !== "<="))
5013
5013
  return null;
5014
5014
  }
5015
5015
  for (const C of v) {
5016
- if (g && !r(C, String(g), f) || S && !r(C, String(S), f))
5016
+ if (h && !r(C, String(h), f) || S && !r(C, String(S), f))
5017
5017
  return null;
5018
5018
  for (const G of p)
5019
5019
  if (!r(C, String(G), f))
5020
5020
  return !1;
5021
5021
  return !0;
5022
5022
  }
5023
- let j, F, B, V, P = S && !f.includePrerelease && S.semver.prerelease.length ? S.semver : !1, N = g && !f.includePrerelease && g.semver.prerelease.length ? g.semver : !1;
5023
+ let j, F, B, V, P = S && !f.includePrerelease && S.semver.prerelease.length ? S.semver : !1, N = h && !f.includePrerelease && h.semver.prerelease.length ? h.semver : !1;
5024
5024
  P && P.prerelease.length === 1 && S.operator === "<" && P.prerelease[0] === 0 && (P = !1);
5025
5025
  for (const C of p) {
5026
- if (V = V || C.operator === ">" || C.operator === ">=", B = B || C.operator === "<" || C.operator === "<=", g) {
5026
+ if (V = V || C.operator === ">" || C.operator === ">=", B = B || C.operator === "<" || C.operator === "<=", h) {
5027
5027
  if (N && C.semver.prerelease && C.semver.prerelease.length && C.semver.major === N.major && C.semver.minor === N.minor && C.semver.patch === N.patch && (N = !1), C.operator === ">" || C.operator === ">=") {
5028
- if (j = l(g, C, f), j === C && j !== g)
5028
+ if (j = l(h, C, f), j === C && j !== h)
5029
5029
  return !1;
5030
- } else if (g.operator === ">=" && !r(g.semver, String(C), f))
5030
+ } else if (h.operator === ">=" && !r(h.semver, String(C), f))
5031
5031
  return !1;
5032
5032
  }
5033
5033
  if (S) {
@@ -5037,10 +5037,10 @@ function jc() {
5037
5037
  } else if (S.operator === "<=" && !r(S.semver, String(C), f))
5038
5038
  return !1;
5039
5039
  }
5040
- if (!C.operator && (S || g) && E !== 0)
5040
+ if (!C.operator && (S || h) && E !== 0)
5041
5041
  return !1;
5042
5042
  }
5043
- return !(g && B && !S && E !== 0 || S && V && !g && E !== 0 || N || P);
5043
+ return !(h && B && !S && E !== 0 || S && V && !h && E !== 0 || N || P);
5044
5044
  }, l = (d, p, f) => {
5045
5045
  if (!d)
5046
5046
  return p;
@@ -5052,14 +5052,14 @@ function jc() {
5052
5052
  const v = n(d.semver, p.semver, f);
5053
5053
  return v < 0 ? d : v > 0 || p.operator === "<" && d.operator === "<=" ? p : d;
5054
5054
  };
5055
- return ur = o, ur;
5056
- }
5057
- var dr, nn;
5058
- function xc() {
5059
- if (nn) return dr;
5060
- nn = 1;
5061
- const s = We(), e = pt(), t = Q(), r = Yn(), n = Oe(), o = gc(), i = hc(), a = mc(), c = vc(), l = yc(), u = wc(), d = Sc(), p = bc(), f = ie(), v = kc(), g = Rc(), S = Lr(), E = Cc(), j = Ec(), F = gt(), B = Dr(), V = Qn(), P = Zn(), N = Nr(), C = Br(), G = eo(), ce = Pc(), z = ht(), J = ae(), W = mt(), h = Ic(), m = Fc(), w = Tc(), y = $c(), k = Ac(), b = jr(), O = Lc(), $ = Dc(), I = Nc(), x = Bc(), H = jc();
5062
- return dr = {
5055
+ return dr = o, dr;
5056
+ }
5057
+ var pr, an;
5058
+ function Jc() {
5059
+ if (an) return pr;
5060
+ an = 1;
5061
+ const s = We(), e = ft(), t = Q(), r = Zn(), n = Oe(), o = vc(), i = yc(), a = wc(), c = Sc(), l = bc(), u = kc(), d = Rc(), p = Cc(), f = ie(), v = Ec(), h = Pc(), S = Nr(), E = Oc(), j = Ic(), F = gt(), B = Br(), V = eo(), P = to(), N = jr(), C = xr(), G = ro(), ce = Fc(), z = mt(), J = ae(), W = vt(), g = $c(), m = Ac(), w = Lc(), y = Dc(), R = Nc(), k = Vr(), O = Bc(), $ = jc(), I = xc(), x = Vc(), H = Uc();
5062
+ return pr = {
5063
5063
  parse: n,
5064
5064
  valid: o,
5065
5065
  clean: i,
@@ -5071,7 +5071,7 @@ function xc() {
5071
5071
  prerelease: p,
5072
5072
  compare: f,
5073
5073
  rcompare: v,
5074
- compareLoose: g,
5074
+ compareLoose: h,
5075
5075
  compareBuild: S,
5076
5076
  sort: E,
5077
5077
  rsort: j,
@@ -5086,12 +5086,12 @@ function xc() {
5086
5086
  Comparator: z,
5087
5087
  Range: J,
5088
5088
  satisfies: W,
5089
- toComparators: h,
5089
+ toComparators: g,
5090
5090
  maxSatisfying: m,
5091
5091
  minSatisfying: w,
5092
5092
  minVersion: y,
5093
- validRange: k,
5094
- outside: b,
5093
+ validRange: R,
5094
+ outside: k,
5095
5095
  gtr: O,
5096
5096
  ltr: $,
5097
5097
  intersects: I,
@@ -5105,17 +5105,17 @@ function xc() {
5105
5105
  RELEASE_TYPES: e.RELEASE_TYPES,
5106
5106
  compareIdentifiers: r.compareIdentifiers,
5107
5107
  rcompareIdentifiers: r.rcompareIdentifiers
5108
- }, dr;
5108
+ }, pr;
5109
5109
  }
5110
- var Vc = xc();
5111
- const Uc = /* @__PURE__ */ fc(Vc), Jc = {
5110
+ var Mc = Jc();
5111
+ const Gc = /* @__PURE__ */ mc(Mc), _c = {
5112
5112
  minDelay: 1500
5113
- }, Mc = "__no_updates__";
5114
- class Gc extends jo {
5113
+ }, qc = "__no_updates__";
5114
+ class Kc extends Uo {
5115
5115
  constructor(t, r, n = {}) {
5116
- super({ ...n, ...Jc }, r);
5117
- R(this, "http");
5118
- R(this, "preferredUpdateChannel");
5116
+ super({ ...n, ..._c }, r);
5117
+ b(this, "http");
5118
+ b(this, "preferredUpdateChannel");
5119
5119
  this.registryProvider = t, this.http = n.http, this.preferredUpdateChannel = n.preferredUpdateChannel;
5120
5120
  }
5121
5121
  getKey(t) {
@@ -5127,7 +5127,7 @@ class Gc extends jo {
5127
5127
  case "from-registry-v2":
5128
5128
  return `from_registry_v2_${te(t)}`;
5129
5129
  default:
5130
- return Mc;
5130
+ return qc;
5131
5131
  }
5132
5132
  }
5133
5133
  async readValue(t) {
@@ -5137,7 +5137,7 @@ class Gc extends jo {
5137
5137
  switch (o.type) {
5138
5138
  case "dev-v1":
5139
5139
  try {
5140
- const i = await In(o.folder);
5140
+ const i = await Tn(o.folder);
5141
5141
  return i === o.mtime ? { suggestions: [] } : { mainSuggestion: { ...o, mtime: i }, suggestions: [] };
5142
5142
  } catch (i) {
5143
5143
  return this.logger.warn(i), { suggestions: [] };
@@ -5146,7 +5146,7 @@ class Gc extends jo {
5146
5146
  try {
5147
5147
  const i = await gr(o.folder, this.logger);
5148
5148
  if (i === void 0) return { suggestions: [] };
5149
- const a = await Pr(i);
5149
+ const a = await Ir(i);
5150
5150
  return a === o.mtime ? { suggestions: [] } : { mainSuggestion: { ...o, mtime: a }, suggestions: [] };
5151
5151
  } catch (i) {
5152
5152
  return this.logger.warn(i), { suggestions: [] };
@@ -5159,13 +5159,13 @@ class Gc extends jo {
5159
5159
  let l = this.preferredUpdateChannel;
5160
5160
  if (l === void 0)
5161
5161
  if (o.channel === void 0)
5162
- if (await c.getLatestOverview(o.id, Le)) l = Le;
5162
+ if (await c.getLatestOverview(o.id, De)) l = De;
5163
5163
  else {
5164
- if (await c.getLatestOverview(o.id, De) === void 0)
5164
+ if (await c.getLatestOverview(o.id, Ne) === void 0)
5165
5165
  return this.logger.error(
5166
- `No "any" channel record for ${fo(o.id)}`
5166
+ `No "any" channel record for ${mo(o.id)}`
5167
5167
  ), { suggestions: [] };
5168
- l = De;
5168
+ l = Ne;
5169
5169
  }
5170
5170
  else l = o.channel;
5171
5171
  const u = await c.getUpdateSuggestions(o.id, l);
@@ -5183,12 +5183,12 @@ class Gc extends jo {
5183
5183
  d = (n = u.find((v) => v.type === "patch")) == null ? void 0 : n.update;
5184
5184
  break;
5185
5185
  }
5186
- const p = u.map(({ type: v, update: g }) => ({
5186
+ const p = u.map(({ type: v, update: h }) => ({
5187
5187
  type: v,
5188
- update: { ...o, id: { ...o.id, version: g } }
5188
+ update: { ...o, id: { ...o.id, version: h } }
5189
5189
  }));
5190
5190
  if (d === void 0) return { suggestions: p };
5191
- if (a !== void 0 && Uc.lte(d, a))
5191
+ if (a !== void 0 && Gc.lte(d, a))
5192
5192
  return { suggestions: p };
5193
5193
  const f = {
5194
5194
  ...o,
@@ -5215,9 +5215,9 @@ class Gc extends jo {
5215
5215
  return te(t) === te(r);
5216
5216
  }
5217
5217
  }
5218
- class on {
5218
+ class cn {
5219
5219
  constructor() {
5220
- R(this, "resources", /* @__PURE__ */ new Map());
5220
+ b(this, "resources", /* @__PURE__ */ new Map());
5221
5221
  }
5222
5222
  check(e) {
5223
5223
  const t = this.resources.get(e);
@@ -5246,11 +5246,11 @@ class on {
5246
5246
  return (t = this.resources.get(e)) == null ? void 0 : t.resource;
5247
5247
  }
5248
5248
  }
5249
- function je(s) {
5249
+ function xe(s) {
5250
5250
  return String(s.id);
5251
5251
  }
5252
- const _c = ["Int", "Long", "Float", "Double", "String", "Bytes"];
5253
- function pr(s) {
5252
+ const Hc = ["Int", "Long", "Float", "Double", "String", "Bytes"];
5253
+ function Le(s) {
5254
5254
  const e = [], t = [];
5255
5255
  for (const r of s)
5256
5256
  r.type === "bySingleColumn" ? (e.push(r), t.push({
@@ -5265,43 +5265,48 @@ function pr(s) {
5265
5265
  }
5266
5266
  return t;
5267
5267
  }
5268
- function qc(s) {
5269
- return "partitionFilters" in s ? s : {
5268
+ function ln(s) {
5269
+ return "partitionFilters" in s ? {
5270
+ ...s,
5271
+ partitionFilters: Le(s.partitionFilters),
5272
+ filters: Le(s.filters)
5273
+ } : {
5270
5274
  ...s,
5271
- partitionFilters: s.filters,
5272
- filters: []
5275
+ partitionFilters: Le(s.filters.filter((e) => e.column.type === "axis")),
5276
+ filters: Le(s.filters.filter((e) => e.column.type === "column"))
5273
5277
  };
5274
5278
  }
5275
5279
  const Ae = (s, e) => typeof e == "bigint" ? e.toString() : e;
5276
- class Kc {
5280
+ class Wc {
5277
5281
  constructor(e, t, r, n) {
5278
- R(this, "pFrame");
5279
- R(this, "abortController", new AbortController());
5280
- R(this, "blobIdToResource", /* @__PURE__ */ new Map());
5281
- R(this, "blobHandleComputables", /* @__PURE__ */ new Map());
5282
- R(this, "preloadBlob", async (e) => {
5282
+ b(this, "pFrame");
5283
+ b(this, "abortController", new AbortController());
5284
+ b(this, "pTableCache");
5285
+ b(this, "blobIdToResource", /* @__PURE__ */ new Map());
5286
+ b(this, "blobHandleComputables", /* @__PURE__ */ new Map());
5287
+ b(this, "preloadBlob", async (e) => {
5283
5288
  const t = e.map((r) => this.getOrCreateComputableForBlob(r));
5284
5289
  for (const r of t) await r.awaitStableFullValue(this.disposeSignal);
5285
5290
  });
5286
- R(this, "resolveBlobContent", async (e) => {
5291
+ b(this, "resolveBlobContent", async (e) => {
5287
5292
  const t = this.getOrCreateComputableForBlob(e), r = this.blobDriver.getLocalPath((await t.awaitStableValue(this.disposeSignal)).handle);
5288
- return await fn.readFile(r);
5293
+ return await mn.readFile(r);
5289
5294
  });
5290
5295
  this.blobDriver = e, this.logger = t, this.spillPath = r;
5291
5296
  const o = (a, c) => this.logger[a](c);
5292
5297
  for (const a of n)
5293
- for (const c of Xi(a.data))
5294
- this.blobIdToResource.set(je(c), c);
5298
+ for (const c of Zi(a.data))
5299
+ this.blobIdToResource.set(xe(c), c);
5295
5300
  const i = [
5296
5301
  ...new Map(n.map((a) => ({
5297
5302
  ...a,
5298
- data: Yi(a.data, je)
5303
+ data: ea(a.data, xe)
5299
5304
  })).map(
5300
5305
  (a) => [te(a), a]
5301
5306
  )).values()
5302
5307
  ];
5303
5308
  try {
5304
- const a = new En(this.spillPath, o);
5309
+ const a = new On(this.spillPath, o);
5305
5310
  a.setDataSource(this);
5306
5311
  for (const c of i)
5307
5312
  a.addColumnSpec(c.id, c.spec), a.setColumnData(c.id, c.data);
@@ -5311,6 +5316,11 @@ class Kc {
5311
5316
  `Rust PFrame creation failed, columns: ${JSON.stringify(i)}, error: ${a}`
5312
5317
  );
5313
5318
  }
5319
+ this.pTableCache = new Er({
5320
+ max: 5,
5321
+ // TODO: calculate size on disk, not number of PTables
5322
+ dispose: (a) => a()
5323
+ });
5314
5324
  }
5315
5325
  getOrCreateComputableForBlob(e) {
5316
5326
  let t = this.blobHandleComputables.get(e);
@@ -5322,94 +5332,113 @@ class Kc {
5322
5332
  get disposeSignal() {
5323
5333
  return this.abortController.signal;
5324
5334
  }
5335
+ cache(e, t) {
5336
+ this.pTableCache.set(e, t);
5337
+ }
5325
5338
  [Symbol.dispose]() {
5326
- this.abortController.abort();
5339
+ this.abortController.abort(), this.pTableCache.clear();
5327
5340
  for (const e of this.blobHandleComputables.values()) e.resetState();
5328
5341
  this.pFrame.dispose();
5329
5342
  }
5330
5343
  }
5331
- class Hc {
5332
- constructor(e, t) {
5333
- this.pTable = e, this.abortController = t;
5344
+ class fr {
5345
+ constructor(e, t, r) {
5346
+ b(this, "abortController", new AbortController());
5347
+ b(this, "combinedDisposeSignal");
5348
+ this.pTable = t, this.unrefPredecessor = r, this.combinedDisposeSignal = AbortSignal.any([e, this.abortController.signal]);
5334
5349
  }
5335
5350
  get disposeSignal() {
5336
- return this.abortController.signal;
5351
+ return this.combinedDisposeSignal;
5337
5352
  }
5338
5353
  [Symbol.dispose]() {
5339
- this.abortController.abort(), this.pTable.dispose();
5354
+ var e;
5355
+ this.abortController.abort(), this.pTable.dispose(), (e = this.unrefPredecessor) == null || e.call(this);
5340
5356
  }
5341
5357
  }
5342
- class xr {
5358
+ class Ur {
5343
5359
  constructor(e, t, r) {
5344
- R(this, "pFrames");
5345
- R(this, "pTables");
5346
- R(this, "frameConcurrencyLimiter");
5347
- R(this, "tableConcurrencyLimiter");
5360
+ b(this, "pFrames");
5361
+ b(this, "pTables");
5362
+ b(this, "frameConcurrencyLimiter");
5363
+ b(this, "tableConcurrencyLimiter");
5348
5364
  this.blobDriver = e, this.logger = t, this.spillPath = r;
5349
- const n = new Hr(1);
5350
- this.frameConcurrencyLimiter = n, this.tableConcurrencyLimiter = new Hr(1), this.pFrames = new class extends on {
5365
+ const n = new zr(1);
5366
+ this.frameConcurrencyLimiter = n, this.tableConcurrencyLimiter = new zr(1), this.pFrames = new class extends cn {
5351
5367
  constructor(o, i, a) {
5352
5368
  super(), this.blobDriver = o, this.logger = i, this.spillPath = a;
5353
5369
  }
5354
5370
  createNewResource(o) {
5355
5371
  return ee().logPFrameRequests && t.info(
5356
5372
  `PFrame creation (pFrameHandle = ${this.calculateParamsKey(o)}): ${JSON.stringify(o, Ae)}`
5357
- ), new Kc(this.blobDriver, this.logger, this.spillPath, o);
5373
+ ), new Wc(this.blobDriver, this.logger, this.spillPath, o);
5358
5374
  }
5359
5375
  calculateParamsKey(o) {
5360
- return zc(o);
5376
+ return Xc(o);
5361
5377
  }
5362
- }(this.blobDriver, this.logger, this.spillPath), this.pTables = new class extends on {
5378
+ }(this.blobDriver, this.logger, this.spillPath), this.pTables = new class extends cn {
5363
5379
  constructor(o) {
5364
5380
  super(), this.pFrames = o;
5365
5381
  }
5366
5382
  createNewResource(o) {
5367
- const i = o.pFrameHandle;
5368
5383
  ee().logPFrameRequests && t.info(
5369
5384
  `PTable creation (pTableHandle = ${this.calculateParamsKey(o)}): ${JSON.stringify(o, Ae)}`
5370
5385
  );
5371
- const a = this.pFrames.getByKey(i), c = new AbortController(), l = a.pFrame.createTable({
5372
- src: xe(o.def.src),
5373
- filters: pr([...o.def.partitionFilters, ...o.def.filters])
5386
+ const i = o.pFrameHandle, { pFrame: a, disposeSignal: c } = this.pFrames.getByKey(i);
5387
+ if (o.def.sorting.length > 0) {
5388
+ const { resource: { pTable: u }, unref: d } = this.acquire({
5389
+ ...o,
5390
+ def: {
5391
+ ...o.def,
5392
+ sorting: []
5393
+ }
5394
+ }), p = u.sort(o.def.sorting);
5395
+ return new fr(c, p, d);
5396
+ }
5397
+ if (o.def.filters.length > 0) {
5398
+ const { resource: { pTable: u }, unref: d } = this.acquire({
5399
+ ...o,
5400
+ def: {
5401
+ ...o.def,
5402
+ filters: []
5403
+ }
5404
+ }), p = u.filter(o.def.filters);
5405
+ return new fr(c, p, d);
5406
+ }
5407
+ const l = a.createTable({
5408
+ src: nt(o.def.src),
5409
+ filters: o.def.partitionFilters
5374
5410
  });
5375
- let u = l;
5376
- if (o.def.sorting.length > 0)
5377
- try {
5378
- u = l.sort(o.def.sorting);
5379
- } finally {
5380
- l.dispose();
5381
- }
5382
- return new Hc(u, c);
5411
+ return new fr(c, l);
5383
5412
  }
5384
5413
  calculateParamsKey(o) {
5385
- return Wc(o);
5414
+ return zc(o);
5386
5415
  }
5387
5416
  }(this.pFrames);
5388
5417
  }
5389
5418
  async pprofDump() {
5390
- return await En.pprofDump();
5419
+ return await On.pprofDump();
5391
5420
  }
5392
5421
  static async init(e, t, r) {
5393
- const n = yo.resolve(r);
5394
- return await ko(n), new xr(e, t, n);
5422
+ const n = bo.resolve(r);
5423
+ return await Eo(n), new Ur(e, t, n);
5395
5424
  }
5396
5425
  //
5397
5426
  // Internal / Config API Methods
5398
5427
  //
5399
5428
  createPFrame(e, t) {
5400
- const r = e.filter((o) => _c.find((i) => i === o.spec.valueType)).map(
5401
- (o) => he(
5429
+ const r = e.filter((o) => Hc.find((i) => i === o.spec.valueType)).map(
5430
+ (o) => ge(
5402
5431
  o,
5403
- (i) => Bo(i) ? sa(i) : ln(i) ? un(i, (a) => a.resourceInfo) : na(o.spec, i)
5432
+ (i) => Vo(i) ? ia(i) : pn(i) ? fn(i, (a) => a.resourceInfo) : aa(o.spec, i)
5404
5433
  )
5405
5434
  ), n = this.pFrames.acquire(r);
5406
5435
  return t.addOnDestroy(n.unref), n.key;
5407
5436
  }
5408
5437
  createPTable(e, t) {
5409
- const r = qc(e), n = this.createPFrame(uo(r.src), t), o = fr(r, (a) => a.id), i = this.pTables.acquire({ def: o, pFrameHandle: n });
5438
+ const r = ln(e), n = this.createPFrame(fo(r.src), t), o = hr(r, (a) => a.id), i = this.pTables.acquire({ def: o, pFrameHandle: n });
5410
5439
  return ee().logPFrameRequests && this.logger.info(
5411
5440
  `Create PTable call (pFrameHandle = ${n}; pTableHandle = ${JSON.stringify(i)}): ${JSON.stringify(
5412
- fr(r, (a) => a.spec),
5441
+ hr(r, (a) => a.spec),
5413
5442
  Ae
5414
5443
  )}`
5415
5444
  ), t.addOnDestroy(i.unref), i.key;
@@ -5423,93 +5452,85 @@ class xr {
5423
5452
  compatibleWith: t.compatibleWith.length !== 0 ? [{
5424
5453
  axesSpec: [
5425
5454
  ...new Map(t.compatibleWith.map(
5426
- (o) => [te(o), o]
5455
+ (i) => [te(i), i]
5427
5456
  )).values()
5428
5457
  ],
5429
5458
  qualifications: []
5430
5459
  }] : []
5431
- };
5460
+ }, { pFrame: n } = this.pFrames.getByKey(e);
5432
5461
  return {
5433
- hits: (await this.pFrames.getByKey(e).pFrame.findColumns(r)).hits.filter((o) => (
5462
+ hits: (await n.findColumns(r)).hits.filter((i) => (
5434
5463
  // only exactly matching columns
5435
- o.mappingVariants.length === 0 || o.mappingVariants.some((i) => i.qualifications.forHit.length === 0 && i.qualifications.forQueries.every((a) => a.length === 0))
5436
- )).map((o) => o.hit)
5464
+ i.mappingVariants.length === 0 || i.mappingVariants.some((a) => a.qualifications.forHit.length === 0 && a.qualifications.forQueries.every((c) => c.length === 0))
5465
+ )).map((i) => i.hit)
5437
5466
  };
5438
5467
  }
5439
5468
  async getColumnSpec(e, t) {
5440
- return await this.pFrames.getByKey(e).pFrame.getColumnSpec(t);
5469
+ const { pFrame: r } = this.pFrames.getByKey(e);
5470
+ return await r.getColumnSpec(t);
5441
5471
  }
5442
5472
  async listColumns(e) {
5443
- return await this.pFrames.getByKey(e).pFrame.listColumns();
5473
+ const { pFrame: t } = this.pFrames.getByKey(e);
5474
+ return await t.listColumns();
5444
5475
  }
5445
5476
  async calculateTableData(e, t, r, n) {
5446
- return ee().logPFrameRequests && this.logger.info(
5477
+ ee().logPFrameRequests && this.logger.info(
5447
5478
  `Call calculateTableData, handle = ${e}, request = ${JSON.stringify(t, Ae)}`
5448
- ), await this.frameConcurrencyLimiter.run(async () => {
5449
- const o = this.pFrames.getByKey(e), i = AbortSignal.any([n, o.disposeSignal].filter((l) => !!l)), a = o.pFrame.createTable({
5450
- src: xe(t.src),
5451
- filters: pr(t.filters)
5479
+ );
5480
+ const { key: o, resource: { pTable: i, disposeSignal: a }, unref: c } = this.pTables.acquire({
5481
+ pFrameHandle: e,
5482
+ def: ln(t)
5483
+ }), l = AbortSignal.any([n, a].filter((u) => !!u));
5484
+ return await this.frameConcurrencyLimiter.run(async () => {
5485
+ this.pFrames.getByKey(e).cache(o, c);
5486
+ const u = i.getSpec(), d = await i.getData([...u.keys()], {
5487
+ range: r,
5488
+ signal: l
5452
5489
  });
5453
- let c = a;
5454
- if (t.sorting.length > 0)
5455
- try {
5456
- c = a.sort(t.sorting);
5457
- } finally {
5458
- a.dispose();
5459
- }
5460
- try {
5461
- const l = c.getSpec(), u = await c.getData([...l.keys()], {
5462
- range: r,
5463
- signal: i
5464
- });
5465
- return l.map((d, p) => ({
5466
- spec: d,
5467
- data: u[p]
5468
- }));
5469
- } finally {
5470
- c.dispose();
5471
- }
5490
+ return u.map((p, f) => ({
5491
+ spec: p,
5492
+ data: d[f]
5493
+ }));
5472
5494
  });
5473
5495
  }
5474
5496
  async getUniqueValues(e, t, r) {
5475
- return ee().logPFrameRequests && this.logger.info(
5497
+ ee().logPFrameRequests && this.logger.info(
5476
5498
  `Call getUniqueValues, handle = ${e}, request = ${JSON.stringify(t, Ae)}`
5477
- ), await this.frameConcurrencyLimiter.run(async () => {
5478
- const n = this.pFrames.getByKey(e), o = AbortSignal.any([r, n.disposeSignal].filter((i) => !!i));
5479
- return await n.pFrame.getUniqueValues({
5480
- ...t,
5481
- filters: pr(t.filters)
5482
- }, {
5483
- signal: o
5484
- });
5485
- });
5499
+ );
5500
+ const { pFrame: n, disposeSignal: o } = this.pFrames.getByKey(e), i = AbortSignal.any([r, o].filter((a) => !!a));
5501
+ return await this.frameConcurrencyLimiter.run(async () => await n.getUniqueValues({
5502
+ ...t,
5503
+ filters: Le(t.filters)
5504
+ }, {
5505
+ signal: i
5506
+ }));
5486
5507
  }
5487
5508
  //
5488
5509
  // PTable istance methods
5489
5510
  //
5490
5511
  getSpec(e) {
5491
- const t = this.pTables.getByKey(e).pTable;
5492
- return Promise.resolve(t.getSpec());
5512
+ const { pTable: t } = this.pTables.getByKey(e);
5513
+ try {
5514
+ return Promise.resolve(t.getSpec());
5515
+ } catch (r) {
5516
+ return Promise.reject(ho(r));
5517
+ }
5493
5518
  }
5494
5519
  async getShape(e, t) {
5495
- return await this.tableConcurrencyLimiter.run(async () => {
5496
- const r = this.pTables.getByKey(e), n = AbortSignal.any([t, r.disposeSignal].filter((o) => !!o));
5497
- return await r.pTable.getShape({
5498
- signal: n
5499
- });
5500
- });
5520
+ const { pTable: r, disposeSignal: n } = this.pTables.getByKey(e), o = AbortSignal.any([t, n].filter((i) => !!i));
5521
+ return await this.tableConcurrencyLimiter.run(async () => await r.getShape({
5522
+ signal: o
5523
+ }));
5501
5524
  }
5502
5525
  async getData(e, t, r, n) {
5503
- return await this.tableConcurrencyLimiter.run(async () => {
5504
- const o = this.pTables.getByKey(e), i = AbortSignal.any([n, o.disposeSignal].filter((a) => !!a));
5505
- return await o.pTable.getData(t, {
5506
- range: r,
5507
- signal: i
5508
- });
5509
- });
5526
+ const { pTable: o, disposeSignal: i } = this.pTables.getByKey(e), a = AbortSignal.any([n, i].filter((c) => !!c));
5527
+ return await this.tableConcurrencyLimiter.run(async () => await o.getData(t, {
5528
+ range: r,
5529
+ signal: a
5530
+ }));
5510
5531
  }
5511
5532
  }
5512
- function xe(s) {
5533
+ function nt(s) {
5513
5534
  switch (s.type) {
5514
5535
  case "column":
5515
5536
  return {
@@ -5538,25 +5559,25 @@ function xe(s) {
5538
5559
  case "full":
5539
5560
  return {
5540
5561
  type: s.type,
5541
- entries: s.entries.map((e) => xe(e))
5562
+ entries: s.entries.map((e) => nt(e))
5542
5563
  };
5543
5564
  case "outer":
5544
5565
  return {
5545
5566
  type: "outer",
5546
- primary: xe(s.primary),
5547
- secondary: s.secondary.map((e) => xe(e))
5567
+ primary: nt(s.primary),
5568
+ secondary: s.secondary.map((e) => nt(e))
5548
5569
  };
5549
5570
  default:
5550
5571
  Y(s);
5551
5572
  }
5552
5573
  }
5553
- function Wc(s) {
5574
+ function zc(s) {
5554
5575
  const e = Pe("sha256");
5555
5576
  return e.update(te(s)), e.digest().toString("hex");
5556
5577
  }
5557
- function zc(s) {
5578
+ function Xc(s) {
5558
5579
  const e = [...s].map(
5559
- (r) => he(r, (n) => {
5580
+ (r) => ge(r, (n) => {
5560
5581
  let o;
5561
5582
  const i = n.type;
5562
5583
  switch (i) {
@@ -5576,7 +5597,7 @@ function zc(s) {
5576
5597
  keyLength: n.partitionKeyLength,
5577
5598
  payload: Object.entries(n.parts).map(([a, c]) => ({
5578
5599
  key: a,
5579
- value: je(c)
5600
+ value: xe(c)
5580
5601
  }))
5581
5602
  };
5582
5603
  break;
@@ -5586,7 +5607,7 @@ function zc(s) {
5586
5607
  keyLength: n.partitionKeyLength,
5587
5608
  payload: Object.entries(n.parts).map(([a, c]) => ({
5588
5609
  key: a,
5589
- value: [je(c.index), je(c.values)]
5610
+ value: [xe(c.index), xe(c.values)]
5590
5611
  }))
5591
5612
  };
5592
5613
  break;
@@ -5600,12 +5621,12 @@ function zc(s) {
5600
5621
  const t = Pe("sha256");
5601
5622
  return t.update(te(e)), t.digest().toString("hex");
5602
5623
  }
5603
- async function Xc(s, e, t) {
5624
+ async function Yc(s, e, t) {
5604
5625
  const r = {
5605
- ...zn,
5606
- ...Xn(e),
5626
+ ...Yn,
5627
+ ...Qn(e),
5607
5628
  ...t
5608
- }, n = new Rr(r.localSecret), o = Sn(r.logger, s, r.localProjections), i = Ko(s, r.logger), a = bn(s, r.logger), c = Ho(s, r.logger), l = await Wo.init(
5629
+ }, n = new Cr(r.localSecret), o = kn(r.logger, s, r.localProjections), i = zo(s, r.logger), a = Rn(s, r.logger), c = Xo(s, r.logger), l = await Yo.init(
5609
5630
  r.logger,
5610
5631
  o,
5611
5632
  i,
@@ -5613,26 +5634,26 @@ async function Xc(s, e, t) {
5613
5634
  r.blobDownloadRangesCachePath,
5614
5635
  n,
5615
5636
  r.blobDriverOps
5616
- ), u = new zo(
5637
+ ), u = new Qo(
5617
5638
  r.logger,
5618
5639
  n,
5619
5640
  o,
5620
5641
  r.downloadBlobToURLPath,
5621
5642
  r.downloadBlobToURLDriverOps
5622
- ), d = new Xo(
5643
+ ), d = new Zo(
5623
5644
  r.logger,
5624
5645
  n,
5625
5646
  a,
5626
5647
  c,
5627
5648
  r.uploadDriverOps
5628
- ), p = new Yo(r.logger, i, r.logStreamDriverOps), f = new Qo(r.logger, p, l), v = await kn.init(
5649
+ ), p = new ei(r.logger, i, r.logStreamDriverOps), f = new ti(r.logger, p, l), v = await Cn.init(
5629
5650
  r.logger,
5630
5651
  s,
5631
5652
  n,
5632
5653
  r.localProjections,
5633
5654
  r.openFileDialogCallback,
5634
5655
  r.virtualLocalStoragesOverride
5635
- ), g = await xr.init(
5656
+ ), h = await Ur.init(
5636
5657
  l,
5637
5658
  r.logger,
5638
5659
  r.pframesSpillPath
@@ -5644,12 +5665,12 @@ async function Xc(s, e, t) {
5644
5665
  lsDriver: v,
5645
5666
  signer: n,
5646
5667
  uploadDriver: d,
5647
- pFrameDriver: g
5668
+ pFrameDriver: h
5648
5669
  };
5649
5670
  }
5650
- class Yc {
5671
+ class Qc {
5651
5672
  constructor(e) {
5652
- R(this, "enrichmentTargetsCache", new vn({
5673
+ b(this, "enrichmentTargetsCache", new Er({
5653
5674
  max: 256,
5654
5675
  memoMethod: (e, t, { context: r }) => ({ value: this.calculateEnrichmentTargets(r) })
5655
5676
  }));
@@ -5659,7 +5680,7 @@ class Yc {
5659
5680
  const t = e.blockConfig();
5660
5681
  if (t.enrichmentTargets === void 0) return;
5661
5682
  const r = e.args();
5662
- return Ka(this.quickJs, t.enrichmentTargets, lt(t), r);
5683
+ return za(this.quickJs, t.enrichmentTargets, ut(t), r);
5663
5684
  }
5664
5685
  getEnrichmentTargets(e, t, r) {
5665
5686
  const n = { blockConfig: e, args: t };
@@ -5669,15 +5690,15 @@ class Yc {
5669
5690
  return this.enrichmentTargetsCache.memo(o, { context: n }).value;
5670
5691
  }
5671
5692
  }
5672
- class to {
5693
+ class so {
5673
5694
  constructor(e, t, r, n, o, i, a, c) {
5674
- R(this, "pl");
5695
+ b(this, "pl");
5675
5696
  /** Contains a reactive list of projects along with their meta information. */
5676
- R(this, "projectList");
5697
+ b(this, "projectList");
5677
5698
  //
5678
5699
  // Projects
5679
5700
  //
5680
- R(this, "openedProjectsByRid", /* @__PURE__ */ new Map());
5701
+ b(this, "openedProjectsByRid", /* @__PURE__ */ new Map());
5681
5702
  this.env = e, this.driverKit = t, this.signer = r, this.projectListResourceId = n, this.openedProjectsList = o, this.projectListTree = i, this.blockRegistryProvider = a, this.projectList = c, this.pl = this.env.pl;
5682
5703
  }
5683
5704
  /** Adds a runtime capability to the middle layer. */
@@ -5694,8 +5715,8 @@ class to {
5694
5715
  /** Creates a project with initial state and adds it to project list. */
5695
5716
  async createProject(e, t = ve()) {
5696
5717
  const r = await this.pl.withWriteTx("MLCreateProject", async (n) => {
5697
- const o = await zi(n, e);
5698
- return n.createField(M(this.projectListResourceId, t), "Dynamic", o), await n.commit(), await To(o);
5718
+ const o = await Qi(n, e);
5719
+ return n.createField(M(this.projectListResourceId, t), "Dynamic", o), await n.commit(), await Lo(o);
5699
5720
  });
5700
5721
  return await this.projectListTree.refreshState(), r;
5701
5722
  }
@@ -5726,7 +5747,7 @@ class to {
5726
5747
  async openProject(e) {
5727
5748
  const t = await this.ensureProjectRid(e);
5728
5749
  if (this.openedProjectsByRid.has(t)) throw new Error(`Project ${t} already opened`);
5729
- this.openedProjectsByRid.set(t, await $r.init(this.env, t)), this.openedProjectsList.setValue([...this.openedProjectsByRid.keys()]);
5750
+ this.openedProjectsByRid.set(t, await Lr.init(this.env, t)), this.openedProjectsList.setValue([...this.openedProjectsByRid.keys()]);
5730
5751
  }
5731
5752
  /** Closes the project, and deallocate all corresponding resources. */
5732
5753
  async closeProject(e) {
@@ -5754,7 +5775,7 @@ class to {
5754
5775
  /** Generates sufficiently random string to be used as local secret for the
5755
5776
  * middle layer */
5756
5777
  static generateLocalSecret() {
5757
- return Rr.generateSecret();
5778
+ return Cr.generateSecret();
5758
5779
  }
5759
5780
  /** Returns a block event dispatcher, which can be used to listen to block events. */
5760
5781
  get blockEventDispatcher() {
@@ -5763,33 +5784,33 @@ class to {
5763
5784
  /** Initialize middle layer */
5764
5785
  static async init(e, t, r) {
5765
5786
  const n = {
5766
- ...dc,
5767
- ...pc(t),
5787
+ ...hc,
5788
+ ...gc(t),
5768
5789
  ...r
5769
5790
  };
5770
5791
  n.defaultTreeOptions.logStat = ee().logTreeStats, n.debugOps.dumpInitialTreeState = ee().dumpInitialTreeState;
5771
5792
  const o = await e.withWriteTx("MLInitialization", async (E) => {
5772
- const j = M(E.clientRoot, Si);
5793
+ const j = M(E.clientRoot, Ri);
5773
5794
  E.createField(j, "Dynamic");
5774
5795
  const F = await E.getField(j);
5775
5796
  if (Ue(F.value)) {
5776
- const B = E.createEphemeral(Fn);
5797
+ const B = E.createEphemeral($n);
5777
5798
  return E.lock(B), E.setField(j, B), await E.commit(), await B.globalId;
5778
5799
  } else
5779
5800
  return F.value;
5780
- }), i = n.logger, a = await Xc(e, t, n), c = new go(e.httpDispatcher), l = new di(c), u = new Mi(
5801
+ }), i = n.logger, a = await Yc(e, t, n), c = new vo(e.httpDispatcher), l = new hi(c), u = new qi(
5781
5802
  l,
5782
5803
  a.signer,
5783
5804
  c
5784
- ), d = new Zo(
5805
+ ), d = new ri(
5785
5806
  i,
5786
5807
  e.httpDispatcher,
5787
5808
  n.frontendDownloadPath
5788
- ), p = await _o(), f = new po();
5809
+ ), p = await Ho(), f = new go();
5789
5810
  f.addSupportedRequirement("requiresModelAPIVersion", 1);
5790
5811
  const v = {
5791
5812
  pl: e,
5792
- blockEventDispatcher: new Ro(),
5813
+ blockEventDispatcher: new Po(),
5793
5814
  signer: a.signer,
5794
5815
  logger: i,
5795
5816
  httpDispatcher: e.httpDispatcher,
@@ -5798,62 +5819,62 @@ class to {
5798
5819
  bpPreparer: u,
5799
5820
  frontendDownloadDriver: d,
5800
5821
  driverKit: a,
5801
- blockUpdateWatcher: new Gc(l, i, {
5822
+ blockUpdateWatcher: new Kc(l, i, {
5802
5823
  minDelay: n.devBlockUpdateRecheckInterval,
5803
5824
  http: c,
5804
5825
  preferredUpdateChannel: n.preferredUpdateChannel
5805
5826
  }),
5806
5827
  runtimeCapabilities: f,
5807
5828
  quickJs: p,
5808
- projectHelper: new Yc(p)
5809
- }, g = new xo([]), S = await ki(e, o, g, v);
5810
- return new to(
5829
+ projectHelper: new Qc(p)
5830
+ }, h = new Jo([]), S = await Ei(e, o, h, v);
5831
+ return new so(
5811
5832
  v,
5812
5833
  a,
5813
5834
  a.signer,
5814
5835
  o,
5815
- g,
5836
+ h,
5816
5837
  S.tree,
5817
5838
  l,
5818
5839
  S.computable
5819
5840
  );
5820
5841
  }
5821
5842
  }
5822
- async function Qc(s, e) {
5843
+ async function Zc(s, e) {
5823
5844
  return await Ie(s.pingCheckDurationMs, s.maxPingsPerSecond, async () => {
5824
- const r = await new hn(e).ping();
5845
+ const r = await new yn(e).ping();
5825
5846
  return JSON.stringify(r).slice(0, s.bodyLimit) + "...";
5826
5847
  });
5827
5848
  }
5828
- async function Zc(s, e) {
5849
+ async function el(s, e) {
5829
5850
  return await Ie(
5830
5851
  s.blockRegistryDurationMs,
5831
5852
  s.maxRegistryChecksPerSecond,
5832
5853
  async () => await ze(new URL(s.blockOverviewPath, s.blockRegistryUrl), s, e)
5833
5854
  );
5834
5855
  }
5835
- async function el(s, e) {
5856
+ async function tl(s, e) {
5836
5857
  return await Ie(
5837
5858
  s.blockRegistryDurationMs,
5838
5859
  s.maxRegistryChecksPerSecond,
5839
5860
  async () => await ze(new URL(s.blockOverviewPath, s.blockGARegistryUrl), s, e)
5840
5861
  );
5841
5862
  }
5842
- async function tl(s, e) {
5863
+ async function rl(s, e) {
5843
5864
  return await Ie(
5844
5865
  s.blockRegistryDurationMs,
5845
5866
  s.maxRegistryChecksPerSecond,
5846
5867
  async () => await ze(new URL(s.blockUiPath, s.blockRegistryUrl), s, e)
5847
5868
  );
5848
5869
  }
5849
- async function rl(s, e) {
5870
+ async function sl(s, e) {
5850
5871
  return await Ie(
5851
5872
  s.blockRegistryDurationMs,
5852
5873
  s.maxRegistryChecksPerSecond,
5853
5874
  async () => await ze(new URL(s.blockUiPath, s.blockGARegistryUrl), s, e)
5854
5875
  );
5855
5876
  }
5856
- async function sl(s, e) {
5877
+ async function nl(s, e) {
5857
5878
  return await Ie(
5858
5879
  s.autoUpdateCdnDurationMs,
5859
5880
  s.maxAutoUpdateCdnChecksPerSecond,
@@ -5862,7 +5883,7 @@ async function sl(s, e) {
5862
5883
  }
5863
5884
  async function Ie(s, e, t) {
5864
5885
  const r = Date.now(), n = [];
5865
- for (; an(r) < s; ) {
5886
+ for (; un(r) < s; ) {
5866
5887
  const o = Date.now();
5867
5888
  let i;
5868
5889
  try {
@@ -5870,18 +5891,18 @@ async function Ie(s, e, t) {
5870
5891
  } catch (l) {
5871
5892
  i = { ok: !1, error: l };
5872
5893
  }
5873
- const a = an(o);
5894
+ const a = un(o);
5874
5895
  n.push({
5875
5896
  elapsedMs: a,
5876
5897
  response: i
5877
5898
  });
5878
5899
  const c = 1e3 / e - a;
5879
- c > 0 && await wn(c);
5900
+ c > 0 && await bn(c);
5880
5901
  }
5881
5902
  return n;
5882
5903
  }
5883
5904
  async function ze(s, e, t) {
5884
- const { body: r, statusCode: n } = await kr(s, {
5905
+ const { body: r, statusCode: n } = await Rr(s, {
5885
5906
  dispatcher: t,
5886
5907
  headersTimeout: e.httpTimeoutMs,
5887
5908
  bodyTimeout: e.httpTimeoutMs
@@ -5891,11 +5912,11 @@ async function ze(s, e, t) {
5891
5912
  beginningOfBody: o.slice(0, e.bodyLimit) + "..."
5892
5913
  };
5893
5914
  }
5894
- function an(s) {
5915
+ function un(s) {
5895
5916
  return Date.now() - s;
5896
5917
  }
5897
5918
  function be(s) {
5898
- const e = s.filter((i) => i.response.ok), t = s.length - e.length, { mean: r, median: n } = nl(s), o = `
5919
+ const e = s.filter((i) => i.response.ok), t = s.length - e.length, { mean: r, median: n } = ol(s), o = `
5899
5920
  total: ${s.length};
5900
5921
  successes: ${e.length};
5901
5922
  errors: ${t};
@@ -5907,7 +5928,7 @@ function be(s) {
5907
5928
  details: o
5908
5929
  };
5909
5930
  }
5910
- function nl(s) {
5931
+ function ol(s) {
5911
5932
  const e = s.map((n) => n.elapsedMs).sort(), t = e.reduce((n, o) => n + o) / e.length;
5912
5933
  let r;
5913
5934
  if (e.length > 0) {
@@ -5916,15 +5937,15 @@ function nl(s) {
5916
5937
  }
5917
5938
  return { mean: t, median: r };
5918
5939
  }
5919
- async function ol(s, e, t) {
5940
+ async function il(s, e, t) {
5920
5941
  try {
5921
- const r = await il(s, e, t);
5942
+ const r = await al(s, e, t);
5922
5943
  return r !== `Hello, ${t}` ? { status: "failed", message: `Template uploading failed: expected: ${t}, got: ${r}` } : { status: "ok", message: `Template uploading succeeded: ${r}` };
5923
5944
  } catch (r) {
5924
5945
  return { status: "failed", message: `Template uploading failed: error occurred: ${r}` };
5925
5946
  }
5926
5947
  }
5927
- async function il(s, e, t) {
5948
+ async function al(s, e, t) {
5928
5949
  var n;
5929
5950
  const r = await Fe(
5930
5951
  e,
@@ -5936,20 +5957,20 @@ async function il(s, e, t) {
5936
5957
  ["greeting"]
5937
5958
  );
5938
5959
  try {
5939
- return JSON.parse(D((n = (await ge(e, r.greeting)).data) == null ? void 0 : n.toString()));
5960
+ return JSON.parse(D((n = (await he(e, r.greeting)).data) == null ? void 0 : n.toString()));
5940
5961
  } finally {
5941
5962
  r != null && await Te(e, Object.values(r));
5942
5963
  }
5943
5964
  }
5944
- async function al(s, e, t, r, n, o) {
5965
+ async function cl(s, e, t, r, n, o) {
5945
5966
  try {
5946
- const i = await cl(s, e, t, r, n, o);
5967
+ const i = await ll(s, e, t, r, n, o);
5947
5968
  return i.type.name !== "Blob" ? { status: "failed", message: `File uploading failed: ${i.type.name}` } : { status: "ok", message: `File uploading succeeded: ${i.type.name}` };
5948
5969
  } catch (i) {
5949
5970
  return { status: "failed", message: `File uploading failed: error occurred: ${i}` };
5950
5971
  }
5951
5972
  }
5952
- async function cl(s, e, t, r, n, o) {
5973
+ async function ll(s, e, t, r, n, o) {
5953
5974
  var c;
5954
5975
  const i = await t.getLocalFileHandle(o), a = await Fe(
5955
5976
  n,
@@ -5961,10 +5982,10 @@ async function cl(s, e, t, r, n, o) {
5961
5982
  ["progress", "file"]
5962
5983
  );
5963
5984
  try {
5964
- const l = await ge(n, a.progress);
5965
- if (ei(l)) {
5966
- const u = Cn.parse(JSON.parse(D((c = l.data) == null ? void 0 : c.toString())));
5967
- ti(e, u.localPath, u.pathSignature) && await Rn(
5985
+ const l = await he(n, a.progress);
5986
+ if (si(l)) {
5987
+ const u = Pn.parse(JSON.parse(D((c = l.data) == null ? void 0 : c.toString())));
5988
+ ni(e, u.localPath, u.pathSignature) && await En(
5968
5989
  s,
5969
5990
  r,
5970
5991
  l,
@@ -5978,20 +5999,20 @@ async function cl(s, e, t, r, n, o) {
5978
5999
  }
5979
6000
  );
5980
6001
  }
5981
- return await ge(n, a.file);
6002
+ return await he(n, a.file);
5982
6003
  } finally {
5983
6004
  await Te(n, Object.values(a));
5984
6005
  }
5985
6006
  }
5986
- async function ll(s, e, t, r, n, o, i) {
6007
+ async function ul(s, e, t, r, n, o, i) {
5987
6008
  try {
5988
- const a = await ul(s, e, t, r, n, o);
6009
+ const a = await dl(s, e, t, r, n, o);
5989
6010
  return a !== i ? { status: "failed", message: `File downloading failed: expected: ${i}, got: ${a}` } : { status: "ok", message: `File downloading succeeded: ${a}` };
5990
6011
  } catch (a) {
5991
6012
  return { status: "failed", message: `File downloading failed: error occurred: ${a}` };
5992
6013
  }
5993
6014
  }
5994
- async function ul(s, e, t, r, n, o) {
6015
+ async function dl(s, e, t, r, n, o) {
5995
6016
  var c;
5996
6017
  const i = await t.getLocalFileHandle(o), a = await Fe(
5997
6018
  e,
@@ -6001,12 +6022,12 @@ async function ul(s, e, t, r, n, o) {
6001
6022
  ["progress", "file"]
6002
6023
  );
6003
6024
  try {
6004
- const l = await ge(e, a.progress);
6005
- await Rn(
6025
+ const l = await he(e, a.progress);
6026
+ await En(
6006
6027
  s,
6007
6028
  r,
6008
6029
  l,
6009
- Cn.parse(JSON.parse(D((c = l.data) == null ? void 0 : c.toString()))),
6030
+ Pn.parse(JSON.parse(D((c = l.data) == null ? void 0 : c.toString()))),
6010
6031
  () => !1,
6011
6032
  {
6012
6033
  nPartsWithThisUploadSpeed: 1,
@@ -6015,22 +6036,22 @@ async function ul(s, e, t, r, n, o) {
6015
6036
  maxSpeed: 1
6016
6037
  }
6017
6038
  );
6018
- const u = await ge(e, a.file), { content: d } = await n.downloadBlob(u);
6019
- return await si(d);
6039
+ const u = await he(e, a.file), { content: d } = await n.downloadBlob(u);
6040
+ return await ii(d);
6020
6041
  } finally {
6021
6042
  await Te(e, Object.values(a));
6022
6043
  }
6023
6044
  }
6024
- async function dl(s) {
6045
+ async function pl(s) {
6025
6046
  try {
6026
- const e = await pl(s);
6047
+ const e = await fl(s);
6027
6048
  return e !== `Hello from go binary
6028
6049
  ` ? { status: "failed", message: `Software check failed: got: ${e}` } : { status: "ok", message: `Software check succeeded: ${e}` };
6029
6050
  } catch (e) {
6030
6051
  return { status: "failed", message: `Software check failed: error occurred: ${e}` };
6031
6052
  }
6032
6053
  }
6033
- async function pl(s) {
6054
+ async function fl(s) {
6034
6055
  var t;
6035
6056
  const e = await Fe(
6036
6057
  s,
@@ -6040,12 +6061,12 @@ async function pl(s) {
6040
6061
  ["greeting"]
6041
6062
  );
6042
6063
  try {
6043
- return D((t = (await ge(s, e.greeting)).data) == null ? void 0 : t.toString());
6064
+ return D((t = (await he(s, e.greeting)).data) == null ? void 0 : t.toString());
6044
6065
  } finally {
6045
6066
  await Te(s, Object.values(e));
6046
6067
  }
6047
6068
  }
6048
- async function fl(s, e) {
6069
+ async function hl(s, e) {
6049
6070
  try {
6050
6071
  const t = await gl(s, e);
6051
6072
  return t !== `Hello, ${e}!
@@ -6064,17 +6085,17 @@ async function gl(s, e) {
6064
6085
  ["greeting"]
6065
6086
  );
6066
6087
  try {
6067
- return D((r = (await ge(s, t.greeting)).data) == null ? void 0 : r.toString());
6088
+ return D((r = (await he(s, t.greeting)).data) == null ? void 0 : r.toString());
6068
6089
  } finally {
6069
6090
  await Te(s, Object.values(t));
6070
6091
  }
6071
6092
  }
6072
- async function hl(s, e, t, r) {
6093
+ async function ml(s, e, t, r) {
6073
6094
  var n, o;
6074
6095
  try {
6075
6096
  const i = await t.getStorageList(), a = {};
6076
6097
  for (const c of i) {
6077
- const l = await ml(t, c, r.nFilesToCheck, r.minFileSize, r.maxFileSize, r.minLsRequests);
6098
+ const l = await vl(t, c, r.nFilesToCheck, r.minFileSize, r.maxFileSize, r.minLsRequests);
6078
6099
  if (l.file === void 0) {
6079
6100
  a[c.name] = {
6080
6101
  status: "warn",
@@ -6091,7 +6112,7 @@ async function hl(s, e, t, r) {
6091
6112
  ["workdirTypeName"]
6092
6113
  );
6093
6114
  try {
6094
- const d = JSON.parse(Buffer.from((await ge(e, u.workdirTypeName)).data).toString());
6115
+ const d = JSON.parse(Buffer.from((await he(e, u.workdirTypeName)).data).toString());
6095
6116
  d != null && d.startsWith("WorkingDirectory") ? a[c.name] = {
6096
6117
  status: "ok",
6097
6118
  message: `Workdir creation succeeded, size of file: ${(n = l.file) == null ? void 0 : n.size}, checked ${l.nCheckedFiles} files, did ${l.nLsRequests} ls requests`
@@ -6108,8 +6129,8 @@ async function hl(s, e, t, r) {
6108
6129
  return { unknown: { status: "failed", message: `Download from every storage failed: error occurred: ${i}` } };
6109
6130
  }
6110
6131
  }
6111
- async function ml(s, e, t, r, n, o) {
6112
- const i = ro(s, e, "", 0);
6132
+ async function vl(s, e, t, r, n, o) {
6133
+ const i = no(s, e, "", 0);
6113
6134
  let a, c = 0, l = 0;
6114
6135
  for await (const { file: u, nLsRequests: d } of i) {
6115
6136
  if (l = Math.max(l, d), c >= t && l > o)
@@ -6120,7 +6141,7 @@ async function ml(s, e, t, r, n, o) {
6120
6141
  }
6121
6142
  return { file: a, nLsRequests: l, nCheckedFiles: c };
6122
6143
  }
6123
- async function* ro(s, e, t, r) {
6144
+ async function* no(s, e, t, r) {
6124
6145
  r++;
6125
6146
  const n = await s.listRemoteFilesWithAdditionalInfo(e.handle, t);
6126
6147
  for (const o of n.entries)
@@ -6130,20 +6151,20 @@ async function* ro(s, e, t, r) {
6130
6151
  nLsRequests: r
6131
6152
  };
6132
6153
  else if (o.type === "dir")
6133
- for await (const i of ro(s, e, o.fullPath, r))
6154
+ for await (const i of no(s, e, o.fullPath, r))
6134
6155
  r = Math.max(i.nLsRequests, r), yield i;
6135
6156
  }
6136
- async function vl() {
6137
- const s = _.join(Pn.tmpdir(), `check-network-big-temp-${Date.now()}.bin`), e = 20 * 1024 * 1024, t = Vo(e);
6138
- return await nt.appendFile(s, t), { filePath: s };
6139
- }
6140
6157
  async function yl() {
6141
- const s = _.join(Pn.tmpdir(), `check-network-temp-${Date.now()}.txt`), e = "Hello, world! " + (/* @__PURE__ */ new Date()).toISOString();
6142
- return await nt.writeFile(s, e), { filePath: s, fileContent: e };
6158
+ const s = _.join(In.tmpdir(), `check-network-big-temp-${Date.now()}.bin`), e = 20 * 1024 * 1024, t = Mo(e);
6159
+ return await ot.appendFile(s, t), { filePath: s };
6160
+ }
6161
+ async function wl() {
6162
+ const s = _.join(In.tmpdir(), `check-network-temp-${Date.now()}.txt`), e = "Hello, world! " + (/* @__PURE__ */ new Date()).toISOString();
6163
+ return await ot.writeFile(s, e), { filePath: s, fileContent: e };
6143
6164
  }
6144
6165
  async function Fe(s, e, t, r, n) {
6145
6166
  return await s.withWriteTx("TemplateRender", async (o) => {
6146
- const i = await Dn(e), a = ut(o, i), c = Ir(
6167
+ const i = await Bn(e), a = dt(o, i), c = Tr(
6147
6168
  o,
6148
6169
  a,
6149
6170
  t,
@@ -6152,20 +6173,20 @@ async function Fe(s, e, t, r, n) {
6152
6173
  ), l = {};
6153
6174
  for (const u of n) {
6154
6175
  const d = M(s.clientRoot, u);
6155
- o.createField(d, "Dynamic", c[u]), l[u] = await $o(d);
6176
+ o.createField(d, "Dynamic", c[u]), l[u] = await Do(d);
6156
6177
  }
6157
6178
  return await o.commit(), l;
6158
6179
  });
6159
6180
  }
6160
- async function ge(s, e) {
6161
- return await Ao(s, async (t) => {
6181
+ async function he(s, e) {
6182
+ return await No(s, async (t) => {
6162
6183
  const r = await t.tx.getField(e);
6163
- if (hr(r.error)) {
6184
+ if (mr(r.error)) {
6164
6185
  const n = await t.tx.getResourceData(r.error, !0);
6165
6186
  throw new Error(`getFieldValue of "${e.fieldName}" field failed: ${n.data}`);
6166
6187
  }
6167
6188
  if (Ue(r.value))
6168
- throw new Lo();
6189
+ throw new Bo();
6169
6190
  return await t.tx.getResourceData(r.value, !0);
6170
6191
  });
6171
6192
  }
@@ -6176,10 +6197,10 @@ async function Te(s, e) {
6176
6197
  await t.commit();
6177
6198
  });
6178
6199
  }
6179
- async function iu(s, e, t, r = {}) {
6200
+ async function au(s, e, t, r = {}) {
6180
6201
  const n = [];
6181
- bl.forEach((o) => {
6182
- ri(o).subscribe((a) => {
6202
+ kl.forEach((o) => {
6203
+ oi(o).subscribe((a) => {
6183
6204
  var u, d;
6184
6205
  const c = (/* @__PURE__ */ new Date()).toISOString(), l = { ...a };
6185
6206
  (u = l == null ? void 0 : l.response) != null && u.headers && (l.response = { ...l.response }, l.response.headers = l.response.headers.slice(), l.response.headers = l.response.headers.map((p) => p.toString())), (d = l == null ? void 0 : l.request) != null && d.body && (l.request = { ...l.request }, l.request.body = "too big"), n.push(
@@ -6202,19 +6223,19 @@ async function iu(s, e, t, r = {}) {
6202
6223
  lsDriver: d,
6203
6224
  httpClient: p,
6204
6225
  ops: f
6205
- } = await wl(s, e, t, r), { filePath: v, fileContent: g } = await yl(), { filePath: S } = await vl(), E = {
6206
- plPings: await Qc(f, i),
6207
- blockRegistryOverviewChecks: await Zc(f, p),
6208
- blockGARegistryOverviewChecks: await el(f, p),
6209
- blockRegistryUiChecks: await tl(f, p),
6210
- blockGARegistryUiChecks: await rl(f, p),
6211
- autoUpdateCdnChecks: await sl(f, p),
6212
- uploadTemplateCheck: await ol(o, a, "Jack"),
6213
- uploadFileCheck: await al(o, c, d, u, a, S),
6214
- downloadFileCheck: await ll(o, a, d, u, l, v, g),
6215
- softwareCheck: await dl(a),
6216
- pythonSoftwareCheck: await fl(a, "Jack"),
6217
- storageToDownloadReport: await hl(
6226
+ } = await Sl(s, e, t, r), { filePath: v, fileContent: h } = await wl(), { filePath: S } = await yl(), E = {
6227
+ plPings: await Zc(f, i),
6228
+ blockRegistryOverviewChecks: await el(f, p),
6229
+ blockGARegistryOverviewChecks: await tl(f, p),
6230
+ blockRegistryUiChecks: await rl(f, p),
6231
+ blockGARegistryUiChecks: await sl(f, p),
6232
+ autoUpdateCdnChecks: await nl(f, p),
6233
+ uploadTemplateCheck: await il(o, a, "Jack"),
6234
+ uploadFileCheck: await cl(o, c, d, u, a, S),
6235
+ downloadFileCheck: await ul(o, a, d, u, l, v, h),
6236
+ softwareCheck: await pl(a),
6237
+ pythonSoftwareCheck: await hl(a, "Jack"),
6238
+ storageToDownloadReport: await ml(
6218
6239
  o,
6219
6240
  a,
6220
6241
  d,
@@ -6227,12 +6248,12 @@ async function iu(s, e, t, r = {}) {
6227
6248
  }
6228
6249
  )
6229
6250
  };
6230
- return Sl(E, s, f, n);
6251
+ return bl(E, s, f, n);
6231
6252
  } catch (o) {
6232
6253
  return `Unhandled error while checking the network: ${o}`;
6233
6254
  }
6234
6255
  }
6235
- async function wl(s, e, t, r = {}) {
6256
+ async function Sl(s, e, t, r = {}) {
6236
6257
  const n = {
6237
6258
  pingCheckDurationMs: 1e4,
6238
6259
  pingTimeoutMs: 3e3,
@@ -6255,14 +6276,14 @@ async function wl(s, e, t, r = {}) {
6255
6276
  everyStorageNFilesToCheck: 300,
6256
6277
  everyStorageMinLsRequests: 50,
6257
6278
  ...r
6258
- }, o = Do(s, {
6279
+ }, o = jo(s, {
6259
6280
  defaultRequestTimeout: n.pingTimeoutMs
6260
6281
  });
6261
6282
  o.alternativeRoot = `check_network_${ve()}`;
6262
- const i = new hn(o);
6283
+ const i = new yn(o);
6263
6284
  let a = {};
6264
6285
  e && t && (a = await i.login(e, t));
6265
- const c = await gn.init(s, { authInformation: a }), l = i.ll.httpDispatcher, u = new pn(), d = new Rr("localSecret"), p = Sn(u, c, []), f = bn(c, u), v = await kn.init(
6286
+ const c = await vn.init(s, { authInformation: a }), l = i.ll.httpDispatcher, u = new gn(), d = new Cr("localSecret"), p = kn(u, c, []), f = Rn(c, u), v = await Cn.init(
6266
6287
  u,
6267
6288
  c,
6268
6289
  d,
@@ -6285,10 +6306,10 @@ async function wl(s, e, t, r = {}) {
6285
6306
  }
6286
6307
  };
6287
6308
  }
6288
- function Sl(s, e, t, r) {
6309
+ function bl(s, e, t, r) {
6289
6310
  const n = s.plPings.filter((S) => S.response.ok), o = s.plPings.filter((S) => !S.response.ok), i = [
6290
6311
  ...new Set(n.map((S) => JSON.stringify(S.response.value)))
6291
- ], a = (S) => S ? "OK" : "FAILED", c = (S) => S.status === "ok" ? "OK" : S.status === "warn" ? "WARN" : "FAILED", l = be(s.plPings), u = be(s.blockRegistryOverviewChecks), d = be(s.blockGARegistryOverviewChecks), p = be(s.blockRegistryUiChecks), f = be(s.blockGARegistryUiChecks), v = be(s.autoUpdateCdnChecks), g = Object.entries(s.storageToDownloadReport).map(([S, E]) => `${c(E)} ${S} storage check`).join(`
6312
+ ], a = (S) => S ? "OK" : "FAILED", c = (S) => S.status === "ok" ? "OK" : S.status === "warn" ? "WARN" : "FAILED", l = be(s.plPings), u = be(s.blockRegistryOverviewChecks), d = be(s.blockGARegistryOverviewChecks), p = be(s.blockRegistryUiChecks), f = be(s.blockGARegistryUiChecks), v = be(s.autoUpdateCdnChecks), h = Object.entries(s.storageToDownloadReport).map(([S, E]) => `${c(E)} ${S} storage check`).join(`
6292
6313
  `);
6293
6314
  return `
6294
6315
  ${a(l.ok)} pings to Platforma Backend
@@ -6302,7 +6323,7 @@ ${c(s.uploadFileCheck)} upload file
6302
6323
  ${c(s.downloadFileCheck)} download file
6303
6324
  ${c(s.softwareCheck)} software check
6304
6325
  ${c(s.pythonSoftwareCheck)} python software check
6305
- ${g}
6326
+ ${h}
6306
6327
 
6307
6328
  details:
6308
6329
  pl endpoint: ${e};
@@ -6357,7 +6378,7 @@ ${r.join(`
6357
6378
  `)}
6358
6379
  `;
6359
6380
  }
6360
- const bl = [
6381
+ const kl = [
6361
6382
  "undici:request:create",
6362
6383
  // When a new request is created
6363
6384
  "undici:request:bodySent",
@@ -6396,34 +6417,34 @@ const bl = [
6396
6417
  // When a dispatcher retries a request
6397
6418
  ];
6398
6419
  export {
6399
- Ql as BlockPackRegistry,
6400
- Zl as CentralBlockRegistry,
6401
- Xn as DefaultDriverKitOpsPaths,
6402
- zn as DefaultDriverKitOpsSettings,
6403
- pc as DefaultMiddleLayerOpsPaths,
6404
- dc as DefaultMiddleLayerOpsSettings,
6405
- Bn as FrontendFromFolderResourceType,
6406
- Nn as FrontendFromUrlResourceType,
6407
- to as MiddleLayer,
6408
- $r as Project,
6409
- Li as TengoTemplateGet,
6410
- Di as TengoTemplateGetRegistry,
6411
- Bi as TengoTemplateGetTemplate,
6412
- Ni as TengoTemplateGetTemplateURI,
6413
- ru as TengoTemplatePack,
6414
- su as TengoTemplatePackConvert,
6415
- ou as TengoTemplatePackConvertTemplate,
6416
- nu as TengoTemplatePackConvertTemplatePack,
6417
- tu as V1CentralDevSnapshotRegistry,
6418
- eu as V1CentralRegistry,
6419
- di as V2RegistryProvider,
6420
- iu as checkNetwork,
6421
- Ir as createRenderTemplate,
6422
- In as getDevV1PacketMtime,
6423
- Pr as getDevV2PacketMtime,
6424
- Xc as initDriverKit,
6425
- wl as initNetworkCheck,
6426
- ut as loadTemplate,
6427
- Dn as prepareTemplateSpec
6420
+ Zl as BlockPackRegistry,
6421
+ eu as CentralBlockRegistry,
6422
+ Qn as DefaultDriverKitOpsPaths,
6423
+ Yn as DefaultDriverKitOpsSettings,
6424
+ gc as DefaultMiddleLayerOpsPaths,
6425
+ hc as DefaultMiddleLayerOpsSettings,
6426
+ xn as FrontendFromFolderResourceType,
6427
+ jn as FrontendFromUrlResourceType,
6428
+ so as MiddleLayer,
6429
+ Lr as Project,
6430
+ Bi as TengoTemplateGet,
6431
+ ji as TengoTemplateGetRegistry,
6432
+ Vi as TengoTemplateGetTemplate,
6433
+ xi as TengoTemplateGetTemplateURI,
6434
+ su as TengoTemplatePack,
6435
+ nu as TengoTemplatePackConvert,
6436
+ iu as TengoTemplatePackConvertTemplate,
6437
+ ou as TengoTemplatePackConvertTemplatePack,
6438
+ ru as V1CentralDevSnapshotRegistry,
6439
+ tu as V1CentralRegistry,
6440
+ hi as V2RegistryProvider,
6441
+ au as checkNetwork,
6442
+ Tr as createRenderTemplate,
6443
+ Tn as getDevV1PacketMtime,
6444
+ Ir as getDevV2PacketMtime,
6445
+ Yc as initDriverKit,
6446
+ Sl as initNetworkCheck,
6447
+ dt as loadTemplate,
6448
+ Bn as prepareTemplateSpec
6428
6449
  };
6429
6450
  //# sourceMappingURL=index.mjs.map