@milaboratories/pl-middle-layer 1.36.1 → 1.36.3

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,17 +1,17 @@
1
- var Vs = Object.defineProperty;
2
- var Yt = (s, e) => (e = Symbol[s]) ? e : Symbol.for("Symbol." + s), Qt = (s) => {
1
+ var Us = Object.defineProperty;
2
+ var Qt = (s, e) => (e = Symbol[s]) ? e : Symbol.for("Symbol." + s), Zt = (s) => {
3
3
  throw TypeError(s);
4
4
  };
5
- var Us = (s, e, t) => e in s ? Vs(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t;
6
- var w = (s, e, t) => Us(s, typeof e != "symbol" ? e + "" : e, t);
7
- var Zt = (s, e, t) => {
5
+ var Gs = (s, e, t) => e in s ? Us(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t;
6
+ var S = (s, e, t) => Gs(s, typeof e != "symbol" ? e + "" : e, t);
7
+ var er = (s, e, t) => {
8
8
  if (e != null) {
9
- typeof e != "object" && typeof e != "function" && Qt("Object expected");
9
+ typeof e != "object" && typeof e != "function" && Zt("Object expected");
10
10
  var r;
11
- t && (r = e[Yt("asyncDispose")]), r === void 0 && (r = e[Yt("dispose")]), typeof r != "function" && Qt("Object not disposable"), s.push([t, r, e]);
11
+ t && (r = e[Qt("asyncDispose")]), r === void 0 && (r = e[Qt("dispose")]), typeof r != "function" && Zt("Object not disposable"), s.push([t, r, e]);
12
12
  } else t && s.push([t]);
13
13
  return e;
14
- }, er = (s, e, t) => {
14
+ }, tr = (s, e, t) => {
15
15
  var r = typeof SuppressedError == "function" ? SuppressedError : function(i, a, c, u) {
16
16
  return u = Error(c), u.name = "SuppressedError", u.error = i, u.suppressed = a, u;
17
17
  }, o = (i) => e = t ? new r(i, e, "An error was suppressed during disposal") : (t = !0, i), n = (i) => {
@@ -26,76 +26,77 @@ var Zt = (s, e, t) => {
26
26
  };
27
27
  return n();
28
28
  };
29
- import { mapValueInVOE as qr, executePSpecPredicate as Gs, mapPObjectData as pe, mapPTableDef as bt, isDataInfo as zr, mapDataInfo as Xr, JsRenderInternal as Js, extractConfig as Qe, isConfigLambda as Yr, DefaultNavigationState as Ms, extractAllColumns as _s } from "@platforma-sdk/model";
29
+ import { mapValueInVOE as zr, executePSpecPredicate as Js, mapPObjectData as pe, mapPTableDef as bt, isDataInfo as Xr, mapDataInfo as Yr, JsRenderInternal as Ms, extractConfig as Qe, isConfigLambda as Qr, DefaultNavigationState as _s, extractAllColumns as Ks } from "@platforma-sdk/model";
30
30
  export * from "@platforma-sdk/model";
31
- import { AnyChannel as Fe, StableChannel as Ae, InitialBlockSettings as tr, blockPackIdToString as Ks } from "@milaboratories/pl-model-middle-layer";
31
+ import { AnyChannel as Fe, StableChannel as Ae, InitialBlockSettings as rr, blockPackIdToString as Hs } from "@milaboratories/pl-model-middle-layer";
32
32
  export * from "@milaboratories/pl-model-middle-layer";
33
33
  export * from "@milaboratories/pl-deployments";
34
- import { request as Dt, RetryAgent as Hs } from "undici";
35
- import { RegistryV1 as fe, tryLoadPackDescription as Rt, BlockPackMetaEmbedAbsoluteBytes as Ws, RegistryV2Reader as qs, folderReaderByUrl as zs, loadPackDescription as rr } from "@platforma-sdk/block-tools";
34
+ import { request as Dt, RetryAgent as Ws } from "undici";
35
+ import { RegistryV1 as fe, tryLoadPackDescription as Rt, BlockPackMetaEmbedAbsoluteBytes as qs, RegistryV2Reader as zs, folderReaderByUrl as Xs, loadPackDescription as sr } from "@platforma-sdk/block-tools";
36
36
  import Q from "node:fs";
37
- import K from "node:path";
38
- import Xs from "yaml";
39
- import { assertNever as H, notEmpty as j, deepFreeze as et, ConsoleLoggerAdapter as Ys, HmacSha256Signer as Qr } from "@milaboratories/ts-helpers";
40
- import * as Zr from "node:fs/promises";
41
- import sr from "node:fs/promises";
42
- import { tryResolve as Qs } from "@milaboratories/resolve-helper";
43
- import { resourceTypesEqual as le, field as U, Pl as A, PlClient as Zs, isNullResourceId as tt, ensureResourceIdNotNull as Et, isResource as eo, isResourceRef as to, isNotNullResourceId as or, resourceType as xe, resourceTypeToString as ro, stringifyWithResourceId as Ue, resourceIdToString as Se, isNotFoundError as so, isTimeoutOrCancelError as oo, toGlobalResourceId as no, plAddressToConfig as io, UnauthenticatedPlClient as nr } from "@milaboratories/pl-client";
37
+ import * as Ys from "node:path";
38
+ import _ from "node:path";
39
+ import Qs from "yaml";
40
+ import { assertNever as H, notEmpty as j, deepFreeze as et, ConsoleLoggerAdapter as Zs, emptyDir as eo, HmacSha256Signer as Zr } from "@milaboratories/ts-helpers";
41
+ import * as es from "node:fs/promises";
42
+ import or from "node:fs/promises";
43
+ import { tryResolve as to } from "@milaboratories/resolve-helper";
44
+ import { resourceTypesEqual as le, field as U, Pl as A, PlClient as ro, isNullResourceId as tt, ensureResourceIdNotNull as Et, isResource as so, isResourceRef as oo, isNotNullResourceId as nr, resourceType as xe, resourceTypeToString as no, stringifyWithResourceId as Ue, resourceIdToString as Se, isNotFoundError as io, isTimeoutOrCancelError as ao, toGlobalResourceId as co, plAddressToConfig as lo, UnauthenticatedPlClient as ir } from "@milaboratories/pl-client";
44
45
  export * from "@milaboratories/pl-client";
45
- import { SynchronizedTreeState as es, treeDumpStats as ao, isPlTreeNodeAccessor as co } from "@milaboratories/pl-tree";
46
- import { Computable as J, ChangeSource as ir, PollComputablePool as lo, WatchableValue as uo } from "@milaboratories/computable";
46
+ import { SynchronizedTreeState as ts, treeDumpStats as uo, isPlTreeNodeAccessor as po } from "@milaboratories/pl-tree";
47
+ import { Computable as J, ChangeSource as ar, PollComputablePool as fo, WatchableValue as ho } from "@milaboratories/computable";
47
48
  import { randomUUID as be, createHash as Ee } from "node:crypto";
48
- import { PlTemplateV1 as _, PlTemplateOverrideV1 as we, PlTemplateLibV1 as de, PlTemplateSoftwareV1 as ne, parseTemplate as po } from "@milaboratories/pl-model-backend";
49
- import { LRUCache as ts } from "lru-cache";
50
- import { Worker as fo } from "node:worker_threads";
51
- import rs from "denque";
52
- import { Templates as ho } from "@platforma-sdk/workflow-tengo";
49
+ import { PlTemplateV1 as K, PlTemplateOverrideV1 as we, PlTemplateLibV1 as de, PlTemplateSoftwareV1 as ne, parseTemplate as go } from "@milaboratories/pl-model-backend";
50
+ import { LRUCache as rs } from "lru-cache";
51
+ import { Worker as mo } from "node:worker_threads";
52
+ import ss from "denque";
53
+ import { Templates as vo } from "@platforma-sdk/workflow-tengo";
53
54
  import N from "canonicalize";
54
- import go from "node:assert";
55
- import { Scope as Ct, errors as mo, getQuickJS as vo } from "quickjs-emscripten";
56
- import { PlQuickJSError as yo } from "@milaboratories/pl-errors";
57
- import * as ar from "remeda";
58
- import { setTimeout as ss } from "node:timers/promises";
59
- import { createDownloadClient as wo, createLogsClient as So, createUploadBlobClient as bo, createUploadProgressClient as Ro, DownloadDriver as Eo, DownloadBlobToURLDriver as Co, UploadDriver as ko, LogsStreamDriver as Po, LogsDriver as Oo, LsDriver as $o, DownloadUrlDriver as Io } from "@milaboratories/pl-drivers";
60
- import { PFrame as Fo } from "@milaboratories/pframes-rs-node";
61
- import { channel as Ao } from "node:diagnostics_channel";
62
- async function cr(s) {
55
+ import yo from "node:assert";
56
+ import { Scope as Ct, errors as wo, getQuickJS as So } from "quickjs-emscripten";
57
+ import { PlQuickJSError as bo } from "@milaboratories/pl-errors";
58
+ import * as cr from "remeda";
59
+ import { setTimeout as os } from "node:timers/promises";
60
+ import { createDownloadClient as Ro, createLogsClient as Eo, createUploadBlobClient as Co, createUploadProgressClient as ko, DownloadDriver as Po, DownloadBlobToURLDriver as Oo, UploadDriver as $o, LogsStreamDriver as Io, LogsDriver as Fo, LsDriver as Ao, DownloadUrlDriver as To } from "@milaboratories/pl-drivers";
61
+ import { PFrame as Lo } from "@milaboratories/pframes-rs-node";
62
+ import { channel as Do } from "node:diagnostics_channel";
63
+ async function lr(s) {
63
64
  try {
64
- return await Zr.stat(s, { bigint: !0 });
65
+ return await es.stat(s, { bigint: !0 });
65
66
  } catch (e) {
66
67
  if (e.code === "ENOENT")
67
68
  return;
68
69
  throw e;
69
70
  }
70
71
  }
71
- const To = [fe.PlPackageYamlConfigFile], Lo = [fe.PlPackageJsonConfigFile], Nt = ["backend", "dist", "tengo", "tpl", "main.plj.gz"], Bt = ["config", "dist", "config.json"], os = ["frontend", "dist"], lr = "block-model/dist/config.json", Do = "block-ui/package.json", No = [
72
+ const No = [fe.PlPackageYamlConfigFile], Bo = [fe.PlPackageJsonConfigFile], Nt = ["backend", "dist", "tengo", "tpl", "main.plj.gz"], Bt = ["config", "dist", "config.json"], ns = ["frontend", "dist"], ur = "block-model/dist/config.json", jo = "block-ui/package.json", xo = [
72
73
  Nt,
73
74
  Bt,
74
- To,
75
- Lo,
76
- os
75
+ No,
76
+ Bo,
77
+ ns
77
78
  ];
78
- async function Bo(s) {
79
- return await cr(K.join(s, ...Bt)) !== void 0 || await cr(K.join(s, ...Nt)) !== void 0;
79
+ async function Vo(s) {
80
+ return await lr(_.join(s, ...Bt)) !== void 0 || await lr(_.join(s, ...Nt)) !== void 0;
80
81
  }
81
82
  function pt(s, e) {
82
- const t = Qs(s, e);
83
+ const t = to(s, e);
83
84
  if (t === void 0) throw new Error(`Can't resolve ${e} against ${s}`);
84
85
  return t;
85
86
  }
86
- async function ur(s, e) {
87
- if (K.isAbsolute(s) || (s = K.resolve(s)), await Bo(s))
87
+ async function dr(s, e) {
88
+ if (_.isAbsolute(s) || (s = _.resolve(s)), await Vo(s))
88
89
  return {
89
- workflow: K.join(s, ...Nt),
90
- config: K.join(s, ...Bt),
91
- ui: K.join(s, ...os)
90
+ workflow: _.join(s, ...Nt),
91
+ config: _.join(s, ...Bt),
92
+ ui: _.join(s, ...ns)
92
93
  };
93
94
  {
94
- const t = pt(s, lr), r = pt(s, lr), o = pt(s, Do);
95
- return { workflow: t, config: r, ui: K.resolve(o, "..", "dist") };
95
+ const t = pt(s, ur), r = pt(s, ur), o = pt(s, jo);
96
+ return { workflow: t, config: r, ui: _.resolve(o, "..", "dist") };
96
97
  }
97
98
  }
98
- async function jo(s) {
99
+ async function Uo(s) {
99
100
  try {
100
101
  return await Q.promises.readFile(s, "utf8");
101
102
  } catch (e) {
@@ -104,7 +105,7 @@ async function jo(s) {
104
105
  throw e;
105
106
  }
106
107
  }
107
- async function xo(s) {
108
+ async function Go(s) {
108
109
  try {
109
110
  return await Q.promises.stat(s, { bigint: !0 });
110
111
  } catch (e) {
@@ -113,10 +114,10 @@ async function xo(s) {
113
114
  throw e;
114
115
  }
115
116
  }
116
- async function ns(s) {
117
+ async function is(s) {
117
118
  let e = 0n;
118
- for (const t of No) {
119
- const r = K.join(s, ...t), o = await xo(r);
119
+ for (const t of xo) {
120
+ const r = _.join(s, ...t), o = await Go(r);
120
121
  o !== void 0 && e < o.mtimeNs && (e = o.mtimeNs);
121
122
  }
122
123
  return e.toString();
@@ -127,7 +128,7 @@ async function jt(s) {
127
128
  }), t = await Q.promises.stat(s.components.model.file, { bigint: !0 });
128
129
  return (e.mtimeNs > t.mtimeNs ? e.mtimeNs : t.mtimeNs).toString();
129
130
  }
130
- class Su {
131
+ class Ru {
131
132
  constructor(e, t, r) {
132
133
  this.v2Provider = e, this.registries = t, this.http = r;
133
134
  }
@@ -177,11 +178,11 @@ class Su {
177
178
  case "local-dev":
178
179
  for (const o of await Q.promises.readdir(r.path, { withFileTypes: !0 })) {
179
180
  if (!o.isDirectory()) continue;
180
- const n = K.join(r.path, o.name), i = await jo(
181
- K.join(n, fe.PlPackageYamlConfigFile)
181
+ const n = _.join(r.path, o.name), i = await Uo(
182
+ _.join(n, fe.PlPackageYamlConfigFile)
182
183
  );
183
184
  if (i !== void 0) {
184
- const a = fe.PlPackageConfigData.parse(Xs.parse(i)), c = await ns(n), u = {
185
+ const a = fe.PlPackageConfigData.parse(Qs.parse(i)), c = await is(n), u = {
185
186
  organization: a.organization,
186
187
  name: a.package,
187
188
  version: "DEV"
@@ -214,12 +215,12 @@ class Su {
214
215
  let a = n, c = await Rt(a);
215
216
  if (c === void 0) {
216
217
  for (const u of ["block", "meta"])
217
- if (a = K.join(n, u), c = await Rt(a), c !== void 0) break;
218
+ if (a = _.join(n, u), c = await Rt(a), c !== void 0) break;
218
219
  }
219
220
  if (c !== void 0) {
220
221
  const u = await jt(c), l = {
221
222
  id: c.id,
222
- meta: await Ws.parseAsync(c.meta),
223
+ meta: await qs.parseAsync(c.meta),
223
224
  spec: {
224
225
  type: "dev-v2",
225
226
  folder: a,
@@ -260,70 +261,70 @@ class Su {
260
261
  return await this.v2Provider.getRegistry(o.url).getSpecificOverview(t, r);
261
262
  }
262
263
  }
263
- class Vo {
264
+ class Jo {
264
265
  constructor(e) {
265
- w(this, "registries", /* @__PURE__ */ new Map());
266
+ S(this, "registries", /* @__PURE__ */ new Map());
266
267
  this.http = e;
267
268
  }
268
269
  getRegistry(e) {
269
270
  const t = this.registries.get(e);
270
271
  if (t) return t;
271
- const r = new qs(zs(e, this.http));
272
+ const r = new zs(Xs(e, this.http));
272
273
  return this.registries.set(e, r), r;
273
274
  }
274
275
  }
275
- const bu = {
276
+ const Eu = {
276
277
  type: "remote-v2",
277
278
  url: "https://blocks.pl-open.science/"
278
- }, Ru = {
279
+ }, Cu = {
279
280
  type: "remote-v1",
280
281
  url: "https://block.registry.platforma.bio/releases"
281
- }, Eu = {
282
+ }, ku = {
282
283
  type: "remote-v1",
283
284
  url: "https://block.registry.platforma.bio/dev"
284
- }, Uo = {
285
+ }, Mo = {
285
286
  groups: [{ id: "default", label: "Default", blocks: [] }]
286
- }, Go = {
287
+ }, _o = {
287
288
  stagingRefreshTimestamp: 0,
288
289
  blocksInLimbo: []
289
- }, Jo = {
290
+ }, Ko = {
290
291
  label: "New Project"
291
- }, Mo = { name: "UserProject", version: "2" }, is = "SchemaVersion", as = "1", xt = "ProjectCreated", Be = "ProjectLastModified", je = "ProjectMeta", he = "ProjectStructure", rt = "BlockRenderingState", _o = "BlockFrontendState/", Ko = /^BlockFrontendState\/(?<blockid>.*)$/;
292
+ }, Ho = { name: "UserProject", version: "2" }, as = "SchemaVersion", cs = "1", xt = "ProjectCreated", Be = "ProjectLastModified", je = "ProjectMeta", he = "ProjectStructure", rt = "BlockRenderingState", Wo = "BlockFrontendState/", qo = /^BlockFrontendState\/(?<blockid>.*)$/;
292
293
  function kt(s) {
293
- return `${_o}${s}`;
294
+ return `${Wo}${s}`;
294
295
  }
295
- const Ho = "BlockArgsAuthor/";
296
+ const zo = "BlockArgsAuthor/";
296
297
  function Pt(s) {
297
- return `${Ho}${s}`;
298
+ return `${zo}${s}`;
298
299
  }
299
300
  const Ot = "ProjectStructureAuthor";
300
- function Wo(s) {
301
- const e = s.match(Ko);
301
+ function Xo(s) {
302
+ const e = s.match(qo);
302
303
  if (e !== null)
303
304
  return e.groups.blockid;
304
305
  }
305
- const qo = "__serviceTemplate_";
306
+ const Yo = "__serviceTemplate_";
306
307
  function $t(s) {
307
- return `${qo}${s}`;
308
+ return `${Yo}${s}`;
308
309
  }
309
310
  function G(s, e) {
310
311
  return `${s}-${e}`;
311
312
  }
312
- const zo = /^(?<blockId>.*)-(?<fieldName>blockPack|blockSettings|prodArgs|currentArgs|prodCtx|prodUiCtx|prodOutput|prodCtxPrevious|prodUiCtxPrevious|prodOutputPrevious|stagingCtx|stagingUiCtx|stagingOutput|stagingCtxPrevious|stagingUiCtxPrevious|stagingOutputPrevious)$/;
313
- function Xo(s) {
314
- const e = s.match(zo);
313
+ const Qo = /^(?<blockId>.*)-(?<fieldName>blockPack|blockSettings|prodArgs|currentArgs|prodCtx|prodUiCtx|prodOutput|prodCtxPrevious|prodUiCtxPrevious|prodOutputPrevious|stagingCtx|stagingUiCtx|stagingOutput|stagingCtxPrevious|stagingUiCtxPrevious|stagingOutputPrevious)$/;
314
+ function Zo(s) {
315
+ const e = s.match(Qo);
315
316
  if (e === null) return;
316
317
  const { blockId: t, fieldName: r } = e.groups;
317
318
  return { blockId: t, fieldName: r };
318
319
  }
319
- const Yo = "projects", cs = { name: "Projects", version: "1" }, Qo = (s) => le(s.type, cs) ? s.fields : [];
320
- async function Zo(s, e, t, r) {
321
- const o = await es.init(
320
+ const en = "projects", ls = { name: "Projects", version: "1" }, tn = (s) => le(s.type, ls) ? s.fields : [];
321
+ async function rn(s, e, t, r) {
322
+ const o = await ts.init(
322
323
  s,
323
324
  e,
324
325
  {
325
326
  ...r.ops.defaultTreeOptions,
326
- pruning: Qo
327
+ pruning: tn
327
328
  },
328
329
  r.logger
329
330
  );
@@ -347,36 +348,36 @@ async function Zo(s, e, t, r) {
347
348
  return u.sort((l) => -l.lastModified.valueOf()), u;
348
349
  }).withStableType(), tree: o };
349
350
  }
350
- const en = {
351
+ const sn = {
351
352
  name: "EphRenderTemplate",
352
353
  version: "1"
353
- }, tn = {
354
+ }, on = {
354
355
  name: "RenderTemplate",
355
356
  version: "1"
356
357
  };
357
- function ls(s, e, t, r, o) {
358
+ function us(s, e, t, r, o) {
358
359
  if (o.length === 0) throw new Error("Zero output names provided");
359
- const n = t ? s.createEphemeral(en) : s.createStruct(tn), i = U(n, "template"), a = U(n, "inputs");
360
+ const n = t ? s.createEphemeral(sn) : s.createStruct(on), i = U(n, "template"), a = U(n, "inputs");
360
361
  return s.createField(i, "Input", e), s.createField(a, "Input", A.createPlMap(s, r, t)), s.lockInputs(n), A.futureRecord(s, n, o, "Output", "outputs/");
361
362
  }
362
- const rn = { name: "BContextEnd", version: "1" }, sn = { name: "BContext", version: "1" }, on = "id", nn = "parent/", an = ["context", "result"];
363
- function dr(s, e, t) {
364
- return ls(s, e, !0, t, an);
363
+ const nn = { name: "BContextEnd", version: "1" }, an = { name: "BContext", version: "1" }, cn = "id", ln = "parent/", un = ["context", "result"];
364
+ function pr(s, e, t) {
365
+ return us(s, e, !0, t, un);
365
366
  }
366
- function cn(s) {
367
- const e = s.createEphemeral(rn);
367
+ function dn(s) {
368
+ const e = s.createEphemeral(nn);
368
369
  return s.lock(e), e;
369
370
  }
370
- function pr(s, e) {
371
- if (e.length === 0) return cn(s);
371
+ function fr(s, e) {
372
+ if (e.length === 0) return dn(s);
372
373
  if (e.length === 1) return e[0];
373
- const t = s.createEphemeral(sn);
374
- s.createField(U(t, on), "Input", A.createPlString(s, be()));
374
+ const t = s.createEphemeral(an);
375
+ s.createField(U(t, cn), "Input", A.createPlString(s, be()));
375
376
  for (let r = 0; r < e.length; r++)
376
- s.createField(U(t, `${nn}${r}`), "Input", e[r]);
377
+ s.createField(U(t, `${ln}${r}`), "Input", e[r]);
377
378
  return s.lock(t), t;
378
379
  }
379
- function us(s, e) {
380
+ function ds(s, e) {
380
381
  const t = /* @__PURE__ */ new Map(), r = (o, n, i) => {
381
382
  const a = Ee("sha256");
382
383
  n.updateCacheKey(o, a, i);
@@ -387,9 +388,9 @@ function us(s, e) {
387
388
  }
388
389
  return t.get(c);
389
390
  };
390
- return r(e.template, ds, e.hashToSource);
391
+ return r(e.template, ps, e.hashToSource);
391
392
  }
392
- const fr = {
393
+ const hr = {
393
394
  updateCacheKey(s, e, t) {
394
395
  e.update(de.type.name).update(de.type.version).update(s.name).update(s.version).update(Re(s.name, t, s.sourceHash));
395
396
  },
@@ -407,12 +408,12 @@ const fr = {
407
408
  const o = ne.fromV3Data(s, Re(s.name, r, s.sourceHash)), n = e.createStruct(ne.type, o.data);
408
409
  return e.setKValue(n, ne.metaNameKey, JSON.stringify(o.name)), e.lock(n), n;
409
410
  }
410
- }, ds = {
411
+ }, ps = {
411
412
  updateCacheKey(s, e, t) {
412
- e.update(_.type.name).update(_.type.version).update(s.hashOverride ?? "no-override").update(s.name).update(s.version).update(Re(s.name, t, s.sourceHash));
413
+ e.update(K.type.name).update(K.type.version).update(s.hashOverride ?? "no-override").update(s.name).update(s.version).update(Re(s.name, t, s.sourceHash));
413
414
  const r = (o) => (o.sort((n, i) => n[0] === i[0] ? 0 : n[0] < i[0] ? -1 : 1), o);
414
415
  for (const [o, n] of r(Object.entries(s.libs ?? {})))
415
- e.update("lib:" + o), fr.updateCacheKey(n, e, t);
416
+ e.update("lib:" + o), hr.updateCacheKey(n, e, t);
416
417
  for (const [o, n] of r(Object.entries(s.software ?? {})))
417
418
  e.update("soft:" + o), Ge.updateCacheKey(n, e, t);
418
419
  for (const [o, n] of r(Object.entries(s.assets ?? {})))
@@ -422,24 +423,24 @@ const fr = {
422
423
  },
423
424
  render(s, e, t, r) {
424
425
  const o = e.createStruct(
425
- _.type,
426
- JSON.stringify(_.fromV3Data(s, Re(s.name, r, s.sourceHash)).data)
426
+ K.type,
427
+ JSON.stringify(K.fromV3Data(s, Re(s.name, r, s.sourceHash)).data)
427
428
  );
428
429
  for (const [a, c] of Object.entries(s.libs ?? {})) {
429
- const u = _.libField(o, a);
430
- e.createField(u, "Input"), e.setField(u, t(c, fr, r));
430
+ const u = K.libField(o, a);
431
+ e.createField(u, "Input"), e.setField(u, t(c, hr, r));
431
432
  }
432
433
  for (const [a, c] of Object.entries(s.software ?? {})) {
433
- const u = _.swField(o, a);
434
+ const u = K.swField(o, a);
434
435
  e.createField(u, "Input"), e.setField(u, t(c, Ge, r));
435
436
  }
436
437
  for (const [a, c] of Object.entries(s.assets ?? {})) {
437
- const u = _.swField(o, a);
438
+ const u = K.swField(o, a);
438
439
  e.createField(u, "Input"), e.setField(u, t(c, Ge, r));
439
440
  }
440
441
  for (const [a, c] of Object.entries(s.templates ?? {})) {
441
- const u = _.tplField(o, a);
442
- e.createField(u, "Input"), e.setField(u, t(c, ds, r));
442
+ const u = K.tplField(o, a);
443
+ e.createField(u, "Input"), e.setField(u, t(c, ps, r));
443
444
  }
444
445
  if (e.lock(o), !s.hashOverride) return o;
445
446
  const n = e.createStruct(
@@ -455,29 +456,29 @@ function Re(s, e, t) {
455
456
  `trying to get "${s}" source: sources map doesn't contain source hash ${t}`
456
457
  );
457
458
  }
458
- function ln(s, e) {
459
- const t = po(e.content), r = t.type;
459
+ function pn(s, e) {
460
+ const t = go(e.content), r = t.type;
460
461
  switch (r) {
461
462
  case "pl.tengo-template.v2":
462
- return fs(s, t);
463
+ return hs(s, t);
463
464
  case "pl.tengo-template.v3":
464
- return us(s, t);
465
+ return ds(s, t);
465
466
  default:
466
467
  H(r);
467
468
  }
468
469
  }
469
- function un(s, e) {
470
+ function fn(s, e) {
470
471
  const t = e.data, r = t.type;
471
472
  switch (r) {
472
473
  case "pl.tengo-template.v2":
473
- return fs(s, t);
474
+ return hs(s, t);
474
475
  case "pl.tengo-template.v3":
475
- return us(s, t);
476
+ return ds(s, t);
476
477
  default:
477
478
  H(r);
478
479
  }
479
480
  }
480
- const hr = {
481
+ const gr = {
481
482
  hash(s, e) {
482
483
  e.update(de.type.name).update(de.type.version).update(s.name).update(s.version).update(s.src);
483
484
  },
@@ -495,12 +496,12 @@ const hr = {
495
496
  const r = ne.fromV2Data(s), o = e.createStruct(ne.type, r.data);
496
497
  return e.setKValue(o, ne.metaNameKey, JSON.stringify(r.name)), e.lock(o), o;
497
498
  }
498
- }, ps = {
499
+ }, fs = {
499
500
  hash(s, e) {
500
- e.update(_.type.name).update(_.type.version).update(s.hashOverride ?? "no-override").update(s.name).update(s.version).update(s.src);
501
+ e.update(K.type.name).update(K.type.version).update(s.hashOverride ?? "no-override").update(s.name).update(s.version).update(s.src);
501
502
  const t = (r) => (r.sort((o, n) => o[0] === n[0] ? 0 : o[0] < n[0] ? -1 : 1), r);
502
503
  for (const [r, o] of t(Object.entries(s.libs ?? {})))
503
- e.update("lib:" + r), hr.hash(o, e);
504
+ e.update("lib:" + r), gr.hash(o, e);
504
505
  for (const [r, o] of t(Object.entries(s.software ?? {})))
505
506
  e.update("soft:" + r), Je.hash(o, e);
506
507
  for (const [r, o] of t(Object.entries(s.assets ?? {})))
@@ -510,24 +511,24 @@ const hr = {
510
511
  },
511
512
  render(s, e, t) {
512
513
  const r = e.createStruct(
513
- _.type,
514
- JSON.stringify(_.fromV2Data(s).data)
514
+ K.type,
515
+ JSON.stringify(K.fromV2Data(s).data)
515
516
  );
516
517
  for (const [i, a] of Object.entries(s.libs ?? {})) {
517
- const c = _.libField(r, i);
518
- e.createField(c, "Input"), e.setField(c, t(a, hr));
518
+ const c = K.libField(r, i);
519
+ e.createField(c, "Input"), e.setField(c, t(a, gr));
519
520
  }
520
521
  for (const [i, a] of Object.entries(s.software ?? {})) {
521
- const c = _.swField(r, i);
522
+ const c = K.swField(r, i);
522
523
  e.createField(c, "Input"), e.setField(c, t(a, Je));
523
524
  }
524
525
  for (const [i, a] of Object.entries(s.assets ?? {})) {
525
- const c = _.swField(r, i);
526
+ const c = K.swField(r, i);
526
527
  e.createField(c, "Input"), e.setField(c, t(a, Je));
527
528
  }
528
529
  for (const [i, a] of Object.entries(s.templates ?? {})) {
529
- const c = _.tplField(r, i);
530
- e.createField(c, "Input"), e.setField(c, t(a, ps));
530
+ const c = K.tplField(r, i);
531
+ e.createField(c, "Input"), e.setField(c, t(a, fs));
531
532
  }
532
533
  if (e.lock(r), !s.hashOverride) return r;
533
534
  const o = e.createStruct(
@@ -537,7 +538,7 @@ const hr = {
537
538
  return e.createField(n, "Service"), e.setField(n, r), e.lock(o), o;
538
539
  }
539
540
  };
540
- function fs(s, e) {
541
+ function hs(s, e) {
541
542
  const t = /* @__PURE__ */ new Map(), r = (o, n) => {
542
543
  const i = Ee("sha256");
543
544
  n.hash(o, i);
@@ -548,13 +549,13 @@ function fs(s, e) {
548
549
  }
549
550
  return t.get(a);
550
551
  };
551
- return r(e, ps);
552
+ return r(e, fs);
552
553
  }
553
- const dn = { name: "TengoTemplateGet", version: "1" }, pn = "registry", fn = "templateURI", hn = "template", Cu = { name: "TengoTemplatePack", version: "1" }, ku = {
554
+ const hn = { name: "TengoTemplateGet", version: "1" }, gn = "registry", mn = "templateURI", vn = "template", Pu = { name: "TengoTemplatePack", version: "1" }, Ou = {
554
555
  name: "TengoTemplatePackConvert",
555
556
  version: "1"
556
- }, Pu = "templatePack", Ou = "template";
557
- async function gn(s) {
557
+ }, $u = "templatePack", Iu = "template";
558
+ async function yn(s) {
558
559
  switch (s.type) {
559
560
  case "from-file":
560
561
  return {
@@ -570,36 +571,36 @@ async function gn(s) {
570
571
  return H(s);
571
572
  }
572
573
  }
573
- function mn(s, e) {
574
- const t = s.createStruct(dn), r = U(t, pn), o = U(t, fn), n = U(t, hn);
574
+ function wn(s, e) {
575
+ const t = s.createStruct(hn), r = U(t, gn), o = U(t, mn), n = U(t, vn);
575
576
  return s.setField(r, s.createValue(A.JsonString, Buffer.from(JSON.stringify(e.registry)))), s.setField(o, s.createValue(A.JsonString, Buffer.from(JSON.stringify(e.path)))), n;
576
577
  }
577
578
  function Vt(s, e) {
578
579
  switch (e.type) {
579
580
  case "from-registry":
580
- return mn(s, e);
581
+ return wn(s, e);
581
582
  case "explicit":
582
- return ln(s, e);
583
+ return pn(s, e);
583
584
  case "prepared":
584
- return un(s, e);
585
+ return fn(s, e);
585
586
  default:
586
587
  return H(e);
587
588
  }
588
589
  }
589
- const hs = { name: "Frontend/FromUrl", version: "1" }, gs = {
590
+ const gs = { name: "Frontend/FromUrl", version: "1" }, ms = {
590
591
  name: "Frontend/FromFolder",
591
592
  version: "1"
592
593
  };
593
- function vn(s, e) {
594
+ function Sn(s, e) {
594
595
  switch (e.type) {
595
596
  case "url":
596
597
  return s.createValue(
597
- hs,
598
+ gs,
598
599
  JSON.stringify({ url: e.url })
599
600
  );
600
601
  case "local":
601
602
  return s.createValue(
602
- gs,
603
+ ms,
603
604
  JSON.stringify({
604
605
  path: e.path,
605
606
  signature: e.signature
@@ -609,12 +610,12 @@ function vn(s, e) {
609
610
  return H(e);
610
611
  }
611
612
  }
612
- class yn {
613
+ class bn {
613
614
  constructor() {
614
- w(this, "nextMessageId", 0);
615
- w(this, "worker");
616
- w(this, "pendingRequests", /* @__PURE__ */ new Map());
617
- const e = typeof global < "u" && "__WORKER_PATH__" in global ? global.__WORKER_PATH__ : K.resolve(import.meta.dirname, "worker.js"), t = this.worker = new fo(
615
+ S(this, "nextMessageId", 0);
616
+ S(this, "worker");
617
+ S(this, "pendingRequests", /* @__PURE__ */ new Map());
618
+ const e = typeof global < "u" && "__WORKER_PATH__" in global ? global.__WORKER_PATH__ : _.resolve(import.meta.dirname, "worker.js"), t = this.worker = new mo(
618
619
  e,
619
620
  {
620
621
  workerData: {}
@@ -645,19 +646,19 @@ class yn {
645
646
  return this.terminate();
646
647
  }
647
648
  }
648
- const wn = { name: "BlockPackCustom", version: "1" }, ms = "template", vs = "frontend";
649
- function gr(s) {
649
+ const Rn = { name: "BlockPackCustom", version: "1" }, vs = "template", ys = "frontend";
650
+ function mr(s) {
650
651
  return s.endsWith("/") ? s : `${s}/`;
651
652
  }
652
- function Sn(s) {
653
+ function En(s) {
653
654
  return Buffer.from(s).toString("utf8");
654
655
  }
655
656
  function Me(s) {
656
- return JSON.parse(Sn(s));
657
+ return JSON.parse(En(s));
657
658
  }
658
- class bn {
659
+ class Cn {
659
660
  constructor(e, t, r) {
660
- w(this, "remoteContentCache", new ts({
661
+ S(this, "remoteContentCache", new rs({
661
662
  max: 500,
662
663
  maxSize: 128 * 1024 * 1024,
663
664
  fetchMethod: async (e) => {
@@ -675,17 +676,17 @@ class bn {
675
676
  case "prepared":
676
677
  return e.config;
677
678
  case "dev-v1": {
678
- const t = await ur(e.folder), r = await Q.promises.readFile(t.config, { encoding: "utf-8" });
679
+ const t = await dr(e.folder), r = await Q.promises.readFile(t.config, { encoding: "utf-8" });
679
680
  return JSON.parse(r);
680
681
  }
681
682
  case "dev-v2": {
682
- const t = await rr(e.folder), r = await Q.promises.readFile(t.components.model.file, {
683
+ const t = await sr(e.folder), r = await Q.promises.readFile(t.components.model.file, {
683
684
  encoding: "utf-8"
684
685
  });
685
686
  return JSON.parse(r);
686
687
  }
687
688
  case "from-registry-v1": {
688
- const t = `${gr(e.registryUrl)}${fe.packageContentPrefix({ organization: e.id.organization, package: e.id.name, version: e.id.version })}`, r = await this.remoteContentCache.forceFetch(`${t}/config.json`);
689
+ const t = `${mr(e.registryUrl)}${fe.packageContentPrefix({ organization: e.id.organization, package: e.id.name, version: e.id.version })}`, r = await this.remoteContentCache.forceFetch(`${t}/config.json`);
689
690
  return Me(r);
690
691
  }
691
692
  case "from-registry-v2": {
@@ -702,7 +703,7 @@ class bn {
702
703
  if (e.type === "prepared")
703
704
  return e;
704
705
  const t = await this.prepareWithoutUnpacking(e);
705
- const r = Zt(o, new yn(), !0);
706
+ const r = er(o, new bn(), !0);
706
707
  return {
707
708
  ...t,
708
709
  type: "prepared",
@@ -714,7 +715,7 @@ class bn {
714
715
  } catch (n) {
715
716
  var i = n, a = !0;
716
717
  } finally {
717
- var c = er(o, i, a);
718
+ var c = tr(o, i, a);
718
719
  c && await c;
719
720
  }
720
721
  }
@@ -723,7 +724,7 @@ class bn {
723
724
  case "explicit":
724
725
  return e;
725
726
  case "dev-v1": {
726
- const t = await ur(e.folder), r = await Q.promises.readFile(t.workflow), o = JSON.parse(
727
+ const t = await dr(e.folder), r = await Q.promises.readFile(t.workflow), o = JSON.parse(
727
728
  await Q.promises.readFile(t.config, "utf-8")
728
729
  ), n = t.ui;
729
730
  return {
@@ -742,7 +743,7 @@ class bn {
742
743
  };
743
744
  }
744
745
  case "dev-v2": {
745
- const t = await rr(e.folder), r = JSON.parse(
746
+ const t = await sr(e.folder), r = JSON.parse(
746
747
  await Q.promises.readFile(t.components.model.file, {
747
748
  encoding: "utf-8"
748
749
  })
@@ -765,7 +766,7 @@ class bn {
765
766
  };
766
767
  }
767
768
  case "from-registry-v1": {
768
- const t = `${gr(e.registryUrl)}${fe.packageContentPrefix({ organization: e.id.organization, package: e.id.name, version: e.id.version })}`, r = `${t}/template.plj.gz`, o = await this.remoteContentCache.forceFetch(r), n = new Uint8Array(o), i = await this.remoteContentCache.forceFetch(`${t}/config.json`), a = Me(i);
769
+ const t = `${mr(e.registryUrl)}${fe.packageContentPrefix({ organization: e.id.organization, package: e.id.name, version: e.id.version })}`, r = `${t}/template.plj.gz`, o = await this.remoteContentCache.forceFetch(r), n = new Uint8Array(o), i = await this.remoteContentCache.forceFetch(`${t}/config.json`), a = Me(i);
769
770
  return {
770
771
  type: "explicit",
771
772
  template: {
@@ -801,14 +802,14 @@ class bn {
801
802
  }
802
803
  }
803
804
  }
804
- function Rn(s, e) {
805
- const t = { config: e.config, source: e.source }, r = s.createStruct(wn, JSON.stringify(t));
806
- return s.createField(U(r, ms), "Input", Vt(s, e.template)), s.createField(U(r, vs), "Input", vn(s, e.frontend)), s.lock(r), r;
805
+ function kn(s, e) {
806
+ const t = { config: e.config, source: e.source }, r = s.createStruct(Rn, JSON.stringify(t));
807
+ return s.createField(U(r, vs), "Input", Vt(s, e.template)), s.createField(U(r, ys), "Input", Sn(s, e.frontend)), s.lock(r), r;
807
808
  }
808
- function mr(s, e) {
809
+ function vr(s, e) {
809
810
  switch (e.type) {
810
811
  case "prepared":
811
- return Rn(s, e);
812
+ return kn(s, e);
812
813
  default:
813
814
  return H(e.type);
814
815
  }
@@ -816,7 +817,7 @@ function mr(s, e) {
816
817
  function _e(s, e) {
817
818
  return { __isRef: !0, blockId: s, name: e };
818
819
  }
819
- function En(s) {
820
+ function Pn(s) {
820
821
  return typeof s == "object" && s !== null && "__isRef" in s && s.__isRef === !0 && "blockId" in s && "name" in s;
821
822
  }
822
823
  function It(s, e, t) {
@@ -832,7 +833,7 @@ function It(s, e, t) {
832
833
  return;
833
834
  case "object":
834
835
  if (e === null) return;
835
- if (En(e))
836
+ if (Pn(e))
836
837
  t === void 0 || t.has(e.blockId) ? s.upstreams.add(e.blockId) : s.missingReferences = !0;
837
838
  else if (Array.isArray(e))
838
839
  for (const o of e) It(s, o, t);
@@ -844,7 +845,7 @@ function It(s, e, t) {
844
845
  H(r);
845
846
  }
846
847
  }
847
- function Cn(s, e) {
848
+ function On(s, e) {
848
849
  const t = { upstreams: /* @__PURE__ */ new Set(), missingReferences: !1 };
849
850
  return It(t, s, e), t;
850
851
  }
@@ -855,10 +856,10 @@ function ee(s) {
855
856
  }
856
857
  };
857
858
  }
858
- class ys {
859
+ class ws {
859
860
  constructor(e) {
860
861
  /** Nodes are stored in the map in topological order */
861
- w(this, "nodes");
862
+ S(this, "nodes");
862
863
  this.nodes = e;
863
864
  }
864
865
  traverseIds(e, ...t) {
@@ -895,14 +896,14 @@ function Ft(s) {
895
896
  };
896
897
  e.set(r, o), t === void 0 ? o.directUpstream = o.upstream = /* @__PURE__ */ new Set() : (o.directUpstream = o.upstream = /* @__PURE__ */ new Set([t.id]), t.directDownstream = t.downstream = /* @__PURE__ */ new Set([o.id])), t = o;
897
898
  }
898
- return t !== void 0 && (t.directDownstream = t.downstream = /* @__PURE__ */ new Set()), new ys(e);
899
+ return t !== void 0 && (t.directDownstream = t.downstream = /* @__PURE__ */ new Set()), new ws(e);
899
900
  }
900
901
  function Ze(s, e) {
901
- const t = /* @__PURE__ */ new Map(), r = new ys(t), o = /* @__PURE__ */ new Set();
902
+ const t = /* @__PURE__ */ new Map(), r = new ws(t), o = /* @__PURE__ */ new Set();
902
903
  for (const { id: n } of ee(s)) {
903
904
  const i = e(n);
904
905
  if (i === void 0) continue;
905
- const a = Cn(i, o), c = r.traverseIds("directDownstream", ...a.upstreams), u = /* @__PURE__ */ new Set();
906
+ const a = On(i, o), c = r.traverseIds("directDownstream", ...a.upstreams), u = /* @__PURE__ */ new Set();
906
907
  for (const { id: d } of ee(s)) {
907
908
  if (d === n) break;
908
909
  if (c.has(d)) {
@@ -925,7 +926,7 @@ function Ze(s, e) {
925
926
  }
926
927
  return r;
927
928
  }
928
- function kn(s, e) {
929
+ function $n(s, e) {
929
930
  if (s.size !== e.size) return !1;
930
931
  for (const t of s) if (!e.has(t)) return !1;
931
932
  return !0;
@@ -935,27 +936,27 @@ function At(s, e) {
935
936
  for (const t of s) if (e.has(t)) return !0;
936
937
  return !1;
937
938
  }
938
- function vr(s, e) {
939
+ function yr(s, e) {
939
940
  const t = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new Set();
940
941
  return s.nodes.forEach((n) => {
941
942
  const i = e.nodes.get(n.id);
942
- i === void 0 ? t.add(n.id) : (!kn(n.upstream, i.upstream) || At(n.upstream, o)) && o.add(n.id);
943
+ i === void 0 ? t.add(n.id) : (!$n(n.upstream, i.upstream) || At(n.upstream, o)) && o.add(n.id);
943
944
  }), e.nodes.forEach((n) => {
944
945
  s.nodes.has(n.id) ? At(n.upstream, o) && o.add(n.id) : r.add(n.id);
945
946
  }), { onlyInA: t, onlyInB: r, different: o };
946
947
  }
947
948
  let ft;
948
- async function ws() {
949
+ async function Ss() {
949
950
  if (ft === void 0) {
950
- const s = await gn(ho["pframes.export-pframe-for-ui"]);
951
+ const s = await yn(vo["pframes.export-pframe-for-ui"]);
951
952
  if (s.type !== "explicit") throw new Error("Unexpected prepared template type.");
952
953
  const e = Ee("sha256").update(s.content).digest("hex");
953
954
  ft = { spec: s, hash: e };
954
955
  }
955
956
  return ft;
956
957
  }
957
- function Pn(s, e, t) {
958
- return ls(s, e, !0, { pf: t }, ["result"]).result;
958
+ function In(s, e, t) {
959
+ return us(s, e, !0, { pf: t }, ["result"]).result;
959
960
  }
960
961
  function ht(s, e) {
961
962
  let t = !1, r, o;
@@ -966,13 +967,13 @@ function ht(s, e) {
966
967
  return r !== n && (r = n, o = e()), e();
967
968
  };
968
969
  }
969
- class yr {
970
+ class wr {
970
971
  constructor(e, t) {
971
- w(this, "currentInputsC", ht(
972
+ S(this, "currentInputsC", ht(
972
973
  () => this.fields.currentArgs.modCount,
973
974
  () => et(JSON.parse(Buffer.from(this.fields.currentArgs.value).toString()))
974
975
  ));
975
- w(this, "actualProductionInputsC", ht(
976
+ S(this, "actualProductionInputsC", ht(
976
977
  () => {
977
978
  var e;
978
979
  return (e = this.fields.prodArgs) == null ? void 0 : e.modCount;
@@ -984,7 +985,7 @@ class yr {
984
985
  return et(JSON.parse(Buffer.from(e).toString()));
985
986
  }
986
987
  ));
987
- w(this, "productionStaleC", ht(
988
+ S(this, "productionStaleC", ht(
988
989
  () => {
989
990
  var e;
990
991
  return `${this.fields.currentArgs.modCount}_${(e = this.fields.prodArgs) == null ? void 0 : e.modCount}`;
@@ -1030,34 +1031,34 @@ class yr {
1030
1031
  getTemplate(e) {
1031
1032
  return e.getFutureFieldValue(
1032
1033
  A.unwrapHolder(e, this.fields.blockPack.ref),
1033
- ms,
1034
+ vs,
1034
1035
  "Input"
1035
1036
  );
1036
1037
  }
1037
1038
  }
1038
- const On = (s) => {
1039
+ const Fn = (s) => {
1039
1040
  throw new Error(`No new block info for ${s}`);
1040
1041
  };
1041
1042
  class st {
1042
1043
  constructor(e, t, r, o, n, i, a, c, u, l, d, f) {
1043
- w(this, "globalModCount", 0);
1044
- w(this, "fieldsChanged", !1);
1044
+ S(this, "globalModCount", 0);
1045
+ S(this, "fieldsChanged", !1);
1045
1046
  //
1046
1047
  // Change trackers
1047
1048
  //
1048
- w(this, "lastModifiedChanged", !1);
1049
- w(this, "structureChanged", !1);
1050
- w(this, "metaChanged", !1);
1051
- w(this, "renderingStateChanged", !1);
1052
- w(this, "changedBlockFrontendStates", /* @__PURE__ */ new Set());
1049
+ S(this, "lastModifiedChanged", !1);
1050
+ S(this, "structureChanged", !1);
1051
+ S(this, "metaChanged", !1);
1052
+ S(this, "renderingStateChanged", !1);
1053
+ S(this, "changedBlockFrontendStates", /* @__PURE__ */ new Set());
1053
1054
  /** Set blocks will be assigned current mutator author marker on save */
1054
- w(this, "blocksWithChangedInputs", /* @__PURE__ */ new Set());
1055
+ S(this, "blocksWithChangedInputs", /* @__PURE__ */ new Set());
1055
1056
  //
1056
1057
  // Graph calculation
1057
1058
  //
1058
- w(this, "stagingGraph");
1059
- w(this, "pendingProductionGraph");
1060
- w(this, "actualProductionGraph");
1059
+ S(this, "stagingGraph");
1060
+ S(this, "pendingProductionGraph");
1061
+ S(this, "actualProductionGraph");
1061
1062
  this.rid = e, this.tx = t, this.author = r, this.schema = o, this.lastModified = n, this.meta = i, this.struct = a, this.renderingState = c, this.blocksInLimbo = u, this.blockInfos = l, this.blockFrontendStates = d, this.ctxExportTplHolder = f;
1062
1063
  }
1063
1064
  fixProblemsAndMigrate() {
@@ -1066,7 +1067,7 @@ class st {
1066
1067
  });
1067
1068
  let e;
1068
1069
  this.blockInfos.forEach((t) => {
1069
- t.fields.blockSettings === void 0 && (e === void 0 && (e = this.createJsonFieldValue(tr)), this.setBlockFieldObj(t.id, "blockSettings", e));
1070
+ t.fields.blockSettings === void 0 && (e === void 0 && (e = this.createJsonFieldValue(rr)), this.setBlockFieldObj(t.id, "blockSettings", e));
1070
1071
  });
1071
1072
  }
1072
1073
  get wasModified() {
@@ -1183,7 +1184,7 @@ class st {
1183
1184
  if (((n = o.fields.prodCtx) == null ? void 0 : n.ref) === void 0)
1184
1185
  throw new Error("One of the upstreams staging is not rendered.");
1185
1186
  t.push(A.unwrapHolder(this.tx, o.fields.prodCtx.ref));
1186
- }), pr(this.tx, t);
1187
+ }), fr(this.tx, t);
1187
1188
  }
1188
1189
  createStagingCtx(e) {
1189
1190
  const t = [];
@@ -1193,16 +1194,16 @@ class st {
1193
1194
  if (((n = o.fields.stagingCtx) == null ? void 0 : n.ref) === void 0)
1194
1195
  throw new Error("One of the upstreams staging is not rendered.");
1195
1196
  t.push(A.unwrapHolder(this.tx, o.fields.stagingCtx.ref)), ((i = o.fields.prodCtx) == null ? void 0 : i.ref) !== void 0 && t.push(A.unwrapHolder(this.tx, o.fields.prodCtx.ref));
1196
- }), pr(this.tx, t);
1197
+ }), fr(this.tx, t);
1197
1198
  }
1198
1199
  exportCtx(e) {
1199
- return Pn(this.tx, A.unwrapHolder(this.tx, this.ctxExportTplHolder), e);
1200
+ return In(this.tx, A.unwrapHolder(this.tx, this.ctxExportTplHolder), e);
1200
1201
  }
1201
1202
  renderStagingFor(e) {
1202
1203
  this.resetStaging(e);
1203
1204
  const t = this.getBlockInfo(e), r = this.createStagingCtx(this.getStagingGraph().nodes.get(e).upstream);
1204
1205
  if (this.getBlock(e).renderingMode !== "Heavy") throw new Error("not supported yet");
1205
- const o = t.getTemplate(this.tx), n = dr(this.tx, o, {
1206
+ const o = t.getTemplate(this.tx), n = pr(this.tx, o, {
1206
1207
  args: t.fields.currentArgs.ref,
1207
1208
  blockId: this.tx.createValue(A.JsonString, JSON.stringify(e)),
1208
1209
  isProduction: this.tx.createValue(A.JsonBool, JSON.stringify(!1)),
@@ -1220,7 +1221,7 @@ class st {
1220
1221
  const t = this.getBlockInfo(e), r = this.createProdCtx(this.getPendingProductionGraph().nodes.get(e).upstream);
1221
1222
  if (this.getBlock(e).renderingMode === "Light")
1222
1223
  throw new Error("Can't render production for light block.");
1223
- const o = t.getTemplate(this.tx), n = dr(this.tx, o, {
1224
+ const o = t.getTemplate(this.tx), n = pr(this.tx, o, {
1224
1225
  args: t.fields.currentArgs.ref,
1225
1226
  blockId: this.tx.createValue(A.JsonString, JSON.stringify(e)),
1226
1227
  isProduction: this.tx.createValue(A.JsonBool, JSON.stringify(!0)),
@@ -1237,26 +1238,26 @@ class st {
1237
1238
  // Structure changes
1238
1239
  //
1239
1240
  /** Very generic method, better check for more specialized case-specific methods first. */
1240
- updateStructure(e, t = On) {
1241
+ updateStructure(e, t = Fn) {
1241
1242
  const r = this.getStagingGraph(), o = this.getActualProductionGraph(), n = Ft(e), i = Ze(
1242
1243
  e,
1243
1244
  (u) => {
1244
1245
  var l;
1245
1246
  return (l = this.blockInfos.get(u)) == null ? void 0 : l.actualProductionInputs;
1246
1247
  }
1247
- ), a = vr(r, n), c = vr(o, i);
1248
+ ), a = yr(r, n), c = yr(o, i);
1248
1249
  for (const u of a.onlyInA) {
1249
1250
  const { fields: l } = this.getBlockInfo(u);
1250
1251
  this.deleteBlockFields(u, ...Object.keys(l)), this.blockInfos.delete(u), this.blocksInLimbo.delete(u) && (this.renderingStateChanged = !0), this.blockFrontendStates.delete(u) && this.changedBlockFrontendStates.add(u);
1251
1252
  }
1252
1253
  for (const u of a.onlyInB) {
1253
- const l = new yr(u, {});
1254
+ const l = new wr(u, {});
1254
1255
  this.blockInfos.set(u, l);
1255
- const d = t(u), f = mr(this.tx, d.blockPack);
1256
+ const d = t(u), f = vr(this.tx, d.blockPack);
1256
1257
  this.setBlockField(u, "blockPack", A.wrapInHolder(this.tx, f), "NotReady"), this.setBlockFieldObj(
1257
1258
  u,
1258
1259
  "blockSettings",
1259
- this.createJsonFieldValue(tr)
1260
+ this.createJsonFieldValue(rr)
1260
1261
  ), this.setBlockFieldObj(u, "currentArgs", this.createJsonFieldValueByContent(d.args)), d.uiState && (this.blockFrontendStates.set(u, d.uiState), this.changedBlockFrontendStates.add(u)), l.check();
1261
1262
  }
1262
1263
  for (const u of a.different) this.resetStaging(u);
@@ -1308,7 +1309,7 @@ class st {
1308
1309
  this.setBlockField(
1309
1310
  e,
1310
1311
  "blockPack",
1311
- A.wrapInHolder(this.tx, mr(this.tx, t)),
1312
+ A.wrapInHolder(this.tx, vr(this.tx, t)),
1312
1313
  "NotReady"
1313
1314
  ), r !== void 0 ? (this.setArgs([{ blockId: e, args: r.args }]), this.setUiState(e, r.uiState)) : this.getStagingGraph().traverse("downstream", [e], ({ id: n }) => this.resetStaging(n)), o.productionRendered && this.getActualProductionGraph().traverse(
1314
1315
  "downstream",
@@ -1357,7 +1358,7 @@ class st {
1357
1358
  * accordingly */
1358
1359
  stopProduction(...e) {
1359
1360
  var i, a;
1360
- const t = this.getActualProductionGraph(), r = new rs(e), o = new Set(e), n = [];
1361
+ const t = this.getActualProductionGraph(), r = new ss(e), o = new Set(e), n = [];
1361
1362
  for (; !r.isEmpty(); ) {
1362
1363
  const c = r.shift(), u = this.getBlockInfo(c).fields;
1363
1364
  if (!(((i = u.prodOutput) == null ? void 0 : i.status) === "Ready" && ((a = u.prodCtx) == null ? void 0 : a.status) === "Ready") && this.deleteBlockFields(c, "prodOutput", "prodCtx", "prodUiCtx", "prodArgs")) {
@@ -1438,7 +1439,7 @@ class st {
1438
1439
  }
1439
1440
  }
1440
1441
  static async load(e, t, r) {
1441
- const o = e.getResourceData(t, !0), n = e.getKValueJson(t, is), i = e.getKValueJson(t, Be), a = e.getKValueJson(t, je), c = e.getKValueJson(t, he), u = e.getKValueJson(t, rt), l = e.listKeyValuesString(t), [
1442
+ const o = e.getResourceData(t, !0), n = e.getKValueJson(t, as), i = e.getKValueJson(t, Be), a = e.getKValueJson(t, je), c = e.getKValueJson(t, he), u = e.getKValueJson(t, rt), l = e.listKeyValuesString(t), [
1442
1443
  d,
1443
1444
  f,
1444
1445
  h,
@@ -1455,13 +1456,13 @@ class st {
1455
1456
  u,
1456
1457
  l
1457
1458
  ]);
1458
- if (f !== as)
1459
+ if (f !== cs)
1459
1460
  throw new Error(
1460
1461
  `Can't act on this project resource because it has a wrong schema version: ${f}`
1461
1462
  );
1462
1463
  const $ = /* @__PURE__ */ new Map();
1463
1464
  for (const p of d.fields) {
1464
- const m = Xo(p.name);
1465
+ const m = Zo(p.name);
1465
1466
  if (m === void 0) continue;
1466
1467
  let y = $.get(m.blockId);
1467
1468
  y === void 0 && (y = {
@@ -1469,7 +1470,7 @@ class st {
1469
1470
  fields: {}
1470
1471
  }, $.set(m.blockId, y)), y.fields[m.fieldName] = tt(p.value) ? { modCount: 0 } : { modCount: 0, ref: p.value };
1471
1472
  }
1472
- const M = await ws(), ge = $t(M.hash), L = d.fields.find(
1473
+ const M = await Ss(), ge = $t(M.hash), L = d.fields.find(
1473
1474
  (p) => p.name === ge
1474
1475
  );
1475
1476
  let se;
@@ -1480,24 +1481,24 @@ class st {
1480
1481
  ));
1481
1482
  const ce = { stagingRefreshTimestamp: x }, z = new Set(T), ie = /* @__PURE__ */ new Map();
1482
1483
  for (const p of B) {
1483
- const m = Wo(p.key);
1484
+ const m = Xo(p.key);
1484
1485
  m !== void 0 && ie.set(m, p.value);
1485
1486
  }
1486
1487
  const Y = [];
1487
1488
  $.forEach(({ fields: p }) => {
1488
1489
  for (const [, m] of Object.entries(p))
1489
1490
  if (m.ref !== void 0) {
1490
- if (!eo(m.ref) || to(m.ref))
1491
+ if (!so(m.ref) || oo(m.ref))
1491
1492
  throw new Error("unexpected behaviour");
1492
1493
  Y.push([m, e.getResourceData(m.ref, !1)]);
1493
1494
  }
1494
1495
  });
1495
1496
  for (const [p, m] of Y) {
1496
1497
  const y = await m;
1497
- p.value = y.data, or(y.error) ? p.status = "Error" : y.resourceReady || or(y.originalResourceId) ? p.status = "Ready" : p.status = "NotReady";
1498
+ p.value = y.data, nr(y.error) ? p.status = "Error" : y.resourceReady || nr(y.originalResourceId) ? p.status = "Ready" : p.status = "NotReady";
1498
1499
  }
1499
1500
  const D = /* @__PURE__ */ new Map();
1500
- $.forEach(({ id: p, fields: m }) => D.set(p, new yr(p, m)));
1501
+ $.forEach(({ id: p, fields: m }) => D.set(p, new wr(p, m)));
1501
1502
  const W = /* @__PURE__ */ new Set();
1502
1503
  for (const p of ee(g)) {
1503
1504
  if (!D.has(p.id))
@@ -1526,12 +1527,12 @@ class st {
1526
1527
  return v.fixProblemsAndMigrate(), v;
1527
1528
  }
1528
1529
  }
1529
- async function $n(s, e = Jo) {
1530
- const t = s.createEphemeral(Mo);
1530
+ async function An(s, e = Ko) {
1531
+ const t = s.createEphemeral(Ho);
1531
1532
  s.lock(t);
1532
1533
  const r = String(Date.now());
1533
- s.setKValue(t, is, JSON.stringify(as)), s.setKValue(t, xt, r), s.setKValue(t, Be, r), s.setKValue(t, je, JSON.stringify(e)), s.setKValue(t, he, JSON.stringify(Uo)), s.setKValue(t, rt, JSON.stringify(Go));
1534
- const o = await ws();
1534
+ s.setKValue(t, as, JSON.stringify(cs)), s.setKValue(t, xt, r), s.setKValue(t, Be, r), s.setKValue(t, je, JSON.stringify(e)), s.setKValue(t, he, JSON.stringify(Mo)), s.setKValue(t, rt, JSON.stringify(_o));
1535
+ const o = await Ss();
1535
1536
  return s.createField(
1536
1537
  U(t, $t(o.hash)),
1537
1538
  "Dynamic",
@@ -1542,7 +1543,7 @@ async function Ke(s, e, t) {
1542
1543
  return Z(s, e, void 0, t);
1543
1544
  }
1544
1545
  async function Z(s, e, t, r) {
1545
- if (s instanceof Zs)
1546
+ if (s instanceof ro)
1546
1547
  return await s.withWriteTx("ProjectAction", async (o) => {
1547
1548
  const n = await st.load(o, e, t), i = await r(n);
1548
1549
  return n.wasModified && (n.save(), await o.commit()), i;
@@ -1552,7 +1553,7 @@ async function Z(s, e, t, r) {
1552
1553
  return o.save(), n;
1553
1554
  }
1554
1555
  }
1555
- function* In(s) {
1556
+ function* Tn(s) {
1556
1557
  switch (s.type) {
1557
1558
  case "Json":
1558
1559
  return;
@@ -1567,21 +1568,21 @@ function* In(s) {
1567
1568
  H(s);
1568
1569
  }
1569
1570
  }
1570
- function wr(s, e) {
1571
+ function Sr(s, e) {
1571
1572
  return Object.fromEntries(
1572
1573
  Object.entries(s).map(([t, r]) => [t, e(r, t)])
1573
1574
  );
1574
1575
  }
1575
- function Fn(s, e) {
1576
+ function Ln(s, e) {
1576
1577
  switch (s.type) {
1577
1578
  case "Json":
1578
1579
  return { ...s };
1579
1580
  case "JsonPartitioned":
1580
- return { ...s, parts: wr(s.parts, e) };
1581
+ return { ...s, parts: Sr(s.parts, e) };
1581
1582
  case "BinaryPartitioned":
1582
1583
  return {
1583
1584
  ...s,
1584
- parts: wr(s.parts, (t) => ({
1585
+ parts: Sr(s.parts, (t) => ({
1585
1586
  index: e(t.index),
1586
1587
  values: e(t.values)
1587
1588
  }))
@@ -1590,26 +1591,26 @@ function Fn(s, e) {
1590
1591
  H(s);
1591
1592
  }
1592
1593
  }
1593
- const An = xe("PColumnData/JsonPartitioned", "1"), Tn = xe(
1594
+ const Dn = xe("PColumnData/JsonPartitioned", "1"), Nn = xe(
1594
1595
  "PColumnData/Partitioned/JsonPartitioned",
1595
1596
  "1"
1596
- ), Ln = xe("PColumnData/BinaryPartitioned", "1"), Dn = xe(
1597
+ ), Bn = xe("PColumnData/BinaryPartitioned", "1"), jn = xe(
1597
1598
  "PColumnData/Partitioned/BinaryPartitioned",
1598
1599
  "1"
1599
- ), Nn = xe("PColumnData/Json", "1");
1600
- function Bn(s) {
1600
+ ), xn = xe("PColumnData/Json", "1");
1601
+ function Vn(s) {
1601
1602
  if (!s.getIsReadyOrError()) throw new Error("Data not ready.");
1602
1603
  const e = s.getDataAsJson();
1603
1604
  if (e === void 0)
1604
1605
  throw new Error("unexpected data info structure, no resource data");
1605
- if (le(s.resourceType, Nn)) {
1606
+ if (le(s.resourceType, xn)) {
1606
1607
  const t = e;
1607
1608
  return {
1608
1609
  type: "Json",
1609
1610
  keyLength: t.keyLength,
1610
1611
  data: t.data
1611
1612
  };
1612
- } else if (le(s.resourceType, An)) {
1613
+ } else if (le(s.resourceType, Dn)) {
1613
1614
  const t = e, r = Object.fromEntries(
1614
1615
  s.listInputFields().map((o) => [o, s.traverse({ field: o, errorIfFieldNotSet: !0 }).resourceInfo])
1615
1616
  );
@@ -1618,7 +1619,7 @@ function Bn(s) {
1618
1619
  partitionKeyLength: t.partitionKeyLength,
1619
1620
  parts: r
1620
1621
  };
1621
- } else if (le(s.resourceType, Tn)) {
1622
+ } else if (le(s.resourceType, Nn)) {
1622
1623
  const t = e, r = {};
1623
1624
  for (const o of s.listInputFields()) {
1624
1625
  const n = s.traverse({ field: o, errorIfFieldNotSet: !0 }), i = n.listInputFields();
@@ -1636,7 +1637,7 @@ function Bn(s) {
1636
1637
  partitionKeyLength: t.superPartitionKeyLength + t.partitionKeyLength,
1637
1638
  parts: r
1638
1639
  };
1639
- } else if (le(s.resourceType, Ln)) {
1640
+ } else if (le(s.resourceType, Bn)) {
1640
1641
  const t = e, r = {};
1641
1642
  for (const o of s.listInputFields())
1642
1643
  if (o.endsWith(".index")) {
@@ -1657,7 +1658,7 @@ function Bn(s) {
1657
1658
  partitionKeyLength: t.partitionKeyLength,
1658
1659
  parts: r
1659
1660
  };
1660
- } else if (le(s.resourceType, Dn)) {
1661
+ } else if (le(s.resourceType, jn)) {
1661
1662
  const t = e, r = {};
1662
1663
  for (const o of s.listInputFields()) {
1663
1664
  const n = s.traverse({ field: o, errorIfFieldNotSet: !0 }), i = n.listInputFields();
@@ -1691,9 +1692,9 @@ function Bn(s) {
1691
1692
  parts: r
1692
1693
  };
1693
1694
  }
1694
- throw new Error(`unsupported resource type: ${ro(s.resourceType)}`);
1695
+ throw new Error(`unsupported resource type: ${no(s.resourceType)}`);
1695
1696
  }
1696
- function jn(s, e) {
1697
+ function Un(s, e) {
1697
1698
  const t = s.axesSpec.length, r = {};
1698
1699
  for (const { key: o, val: n } of e) {
1699
1700
  if (o.length !== t)
@@ -1706,17 +1707,17 @@ function jn(s, e) {
1706
1707
  data: r
1707
1708
  };
1708
1709
  }
1709
- function xn(s, e) {
1710
+ function Gn(s, e) {
1710
1711
  const t = Ee("sha256");
1711
1712
  return t.update(N(s)), t.update(String(tt(e.originalId) ? e.id : e.originalId)), t.digest().toString("hex");
1712
1713
  }
1713
- function Sr(s, e) {
1714
+ function br(s, e) {
1714
1715
  return N({ __isRef: !0, blockId: s, name: e });
1715
1716
  }
1716
- function Vn(s, e) {
1717
+ function Jn(s, e) {
1717
1718
  return N({ resolvePath: s, name: e });
1718
1719
  }
1719
- function Ss(s, e = !0, t = !1, r = "") {
1720
+ function bs(s, e = !0, t = !1, r = "") {
1720
1721
  var a, c, u;
1721
1722
  const o = /^(?<name>.*)\.(?<type>spec|data)$/, n = /* @__PURE__ */ new Map();
1722
1723
  for (const l of s.listInputFields()) {
@@ -1754,10 +1755,10 @@ function Ss(s, e = !0, t = !1, r = "") {
1754
1755
  for (const [, l] of n) l.data === void 0 && (l.hasData = !1);
1755
1756
  return { locked: i, results: n };
1756
1757
  }
1757
- function Un(s, e = !0, t = "", r) {
1758
+ function Mn(s, e = !0, t = "", r) {
1758
1759
  if (!s.getIsReadyOrError()) throw new Error("resource is not ready");
1759
- const o = Ss(s, e, !1, t);
1760
- go(o.locked);
1760
+ const o = bs(s, e, !1, t);
1761
+ yo(o.locked);
1761
1762
  const n = {};
1762
1763
  for (const [i, a] of o.results) {
1763
1764
  if (a.spec === void 0) throw new Error(`no spec for key ${i}`);
@@ -1767,7 +1768,7 @@ function Un(s, e = !0, t = "", r) {
1767
1768
  if (c === void 0) throw new Error(`no data for key ${i}`);
1768
1769
  if (!c.ok) throw c.error;
1769
1770
  n[i] = {
1770
- id: r.length === 0 ? xn(a.spec, c.value) : Vn(r, i),
1771
+ id: r.length === 0 ? Gn(a.spec, c.value) : Jn(r, i),
1771
1772
  spec: a.spec,
1772
1773
  data: c.value
1773
1774
  };
@@ -1776,7 +1777,7 @@ function Un(s, e = !0, t = "", r) {
1776
1777
  }
1777
1778
  class Ut {
1778
1779
  constructor(e, t) {
1779
- w(this, "allSpecsAvailable");
1780
+ S(this, "allSpecsAvailable");
1780
1781
  this.ctx = e, this.blocks = t;
1781
1782
  let r = !0;
1782
1783
  e: for (const o of t.values())
@@ -1808,8 +1809,8 @@ class Ut {
1808
1809
  if (r === void 0) return;
1809
1810
  const o = (a = (i = r.prod) == null ? void 0 : i.results) == null ? void 0 : a.get(t), n = (c = o == null ? void 0 : o.data) == null ? void 0 : c.call(o);
1810
1811
  if (o !== void 0 && o.spec !== void 0 && n !== void 0)
1811
- return qr(n, (u) => ({
1812
- id: Sr(e, t),
1812
+ return zr(n, (u) => ({
1813
+ id: br(e, t),
1813
1814
  spec: o.spec,
1814
1815
  data: u
1815
1816
  }));
@@ -1848,7 +1849,7 @@ class Ut {
1848
1849
  u !== void 0 ? e.push({
1849
1850
  ref: _e(i, a),
1850
1851
  obj: {
1851
- id: u.ok ? Sr(i, a) : void 0,
1852
+ id: u.ok ? br(i, a) : void 0,
1852
1853
  spec: c.spec,
1853
1854
  data: u
1854
1855
  }
@@ -1902,7 +1903,7 @@ class Ut {
1902
1903
  for (const r of this.blocks.values()) {
1903
1904
  const o = /* @__PURE__ */ new Set(), n = (i) => {
1904
1905
  for (const [a, c] of i.results)
1905
- o.has(a) || c.spec === void 0 || (o.add(a), Gs(e, c.spec) && t.push({
1906
+ o.has(a) || c.spec === void 0 || (o.add(a), Js(e, c.spec) && t.push({
1906
1907
  label: r.info.label + " / " + a,
1907
1908
  ref: _e(r.info.id, a),
1908
1909
  spec: c.spec
@@ -1916,7 +1917,7 @@ class Ut {
1916
1917
  const o = e.accessor(t).node(), n = j(o.getKeyValueAsJson(he)), a = Ft(n).traverseIds("upstream", r), c = /* @__PURE__ */ new Map();
1917
1918
  for (const u of ee(n)) {
1918
1919
  if (!a.has(u.id)) continue;
1919
- const l = br(
1920
+ const l = Rr(
1920
1921
  o.traverse({
1921
1922
  field: G(u.id, "prodCtx"),
1922
1923
  ignoreError: !0,
@@ -1927,7 +1928,7 @@ class Ut {
1927
1928
  field: G(u.id, "prodUiCtx"),
1928
1929
  stableIfNotFound: !0
1929
1930
  })
1930
- ), d = br(
1931
+ ), d = Rr(
1931
1932
  o.traverse({
1932
1933
  field: G(u.id, "stagingCtx"),
1933
1934
  ignoreError: !0,
@@ -1942,10 +1943,10 @@ class Ut {
1942
1943
  return new Ut(e, c);
1943
1944
  }
1944
1945
  }
1945
- function br(s, e) {
1946
+ function Rr(s, e) {
1946
1947
  if (e === void 0)
1947
1948
  return s ? { locked: !1, results: /* @__PURE__ */ new Map() } : void 0;
1948
- if (e.ok) return Ss(e.value, !1, !0);
1949
+ if (e.ok) return bs(e.value, !1, !0);
1949
1950
  }
1950
1951
  function Gt(s, e) {
1951
1952
  return {
@@ -1971,7 +1972,7 @@ function Gt(s, e) {
1971
1972
  }
1972
1973
  };
1973
1974
  }
1974
- function bs(s, e) {
1975
+ function Rs(s, e) {
1975
1976
  return {
1976
1977
  ...Gt(s, e),
1977
1978
  prod: (t) => {
@@ -2045,7 +2046,7 @@ function* X(s, e) {
2045
2046
  H(s);
2046
2047
  }
2047
2048
  }
2048
- function Gn(s, e) {
2049
+ function _n(s, e) {
2049
2050
  const t = {};
2050
2051
  for (const [r, o] of Object.entries(s)) t[r] = e(o);
2051
2052
  return t;
@@ -2053,7 +2054,7 @@ function Gn(s, e) {
2053
2054
  function Te(s, e) {
2054
2055
  return s === void 0 ? void 0 : e(s);
2055
2056
  }
2056
- function Jn(s) {
2057
+ function Kn(s) {
2057
2058
  switch (s.type) {
2058
2059
  case "GetImportProgress":
2059
2060
  return !0;
@@ -2061,8 +2062,8 @@ function Jn(s) {
2061
2062
  return !1;
2062
2063
  }
2063
2064
  }
2064
- function Mn(s) {
2065
- for (const e of X(s)) if (Jn(e)) return !0;
2065
+ function Hn(s) {
2066
+ for (const e of X(s)) if (Kn(e)) return !0;
2066
2067
  return !1;
2067
2068
  }
2068
2069
  function nt(s) {
@@ -2074,47 +2075,47 @@ function nt(s) {
2074
2075
  function k(s) {
2075
2076
  return () => nt(s);
2076
2077
  }
2077
- const _n = (s) => {
2078
+ const Wn = (s) => {
2078
2079
  const e = {};
2079
2080
  for (const [t, r] of Object.entries(s)) e[t] = r;
2080
2081
  return k(e);
2081
- }, Kn = (s) => {
2082
+ }, qn = (s) => {
2082
2083
  const e = s.source;
2083
2084
  if (e === void 0) return k(void 0);
2084
2085
  const t = [];
2085
2086
  for (const r of e)
2086
2087
  r instanceof Array ? t.push(...r) : t.push(r);
2087
2088
  return k(t);
2088
- }, Hn = (s) => {
2089
+ }, zn = (s) => {
2089
2090
  const e = s.source, t = s.field;
2090
2091
  return e === void 0 || t === void 0 ? k(void 0) : ({ cCtx: r }) => {
2091
2092
  var o;
2092
2093
  return nt((o = r.accessor(e).node().traverse(t)) == null ? void 0 : o.persist());
2093
2094
  };
2094
2095
  };
2095
- function Rs(s, e) {
2096
+ function Es(s, e) {
2096
2097
  const t = {}, r = s.length;
2097
2098
  for (let o = 0; o < r; o++) t[String(o)] = e(s[o]);
2098
2099
  return t;
2099
2100
  }
2100
- function Wn(s, e) {
2101
+ function Xn(s, e) {
2101
2102
  return (t) => {
2102
2103
  const r = t.source;
2103
2104
  return r === void 0 ? k(void 0) : () => ({
2104
2105
  type: "ScheduleSubroutine",
2105
- subroutine: Es(r.length),
2106
- args: Rs(r, (o) => P({ ...s, [e.itVar]: o }, e.mapping))
2106
+ subroutine: Cs(r.length),
2107
+ args: Es(r, (o) => P({ ...s, [e.itVar]: o }, e.mapping))
2107
2108
  });
2108
2109
  };
2109
2110
  }
2110
- function Es(s) {
2111
+ function Cs(s) {
2111
2112
  return (e) => {
2112
2113
  const t = [];
2113
2114
  for (let r = 0; r < s; r++) t.push(e[String(r)]);
2114
2115
  return k(t);
2115
2116
  };
2116
2117
  }
2117
- function qn(s, e) {
2118
+ function Yn(s, e) {
2118
2119
  return (t) => {
2119
2120
  const r = t.source;
2120
2121
  if (r === void 0) return k(void 0);
@@ -2125,34 +2126,34 @@ function qn(s, e) {
2125
2126
  }
2126
2127
  return () => ({
2127
2128
  type: "ScheduleSubroutine",
2128
- subroutine: zn,
2129
+ subroutine: Qn,
2129
2130
  args: o
2130
2131
  });
2131
2132
  };
2132
2133
  }
2133
- const zn = (s) => k(s), Xn = (s) => {
2134
+ const Qn = (s) => k(s), Zn = (s) => {
2134
2135
  const e = s.arg;
2135
2136
  return k(e === void 0 ? void 0 : e.length === 0);
2136
- }, Yn = (s) => {
2137
+ }, ei = (s) => {
2137
2138
  const e = s.operand;
2138
2139
  return k(e === void 0 ? void 0 : !e);
2139
- }, Qn = (s) => {
2140
+ }, ti = (s) => {
2140
2141
  const e = s.operand1, t = s.operand2;
2141
2142
  return k(e === void 0 || t === void 0 ? void 0 : e && t);
2142
- }, Zn = (s) => {
2143
+ }, ri = (s) => {
2143
2144
  const e = s.operand1, t = s.operand2;
2144
2145
  return k(e === void 0 || t === void 0 ? void 0 : e || t);
2145
- }, ei = (s) => {
2146
+ }, si = (s) => {
2146
2147
  const e = s.source;
2147
2148
  return e === void 0 ? k(void 0) : ({ cCtx: t }) => {
2148
2149
  var r;
2149
2150
  return nt((r = t.accessor(e).node()) == null ? void 0 : r.getDataAsJson());
2150
2151
  };
2151
- }, ti = (s) => {
2152
+ }, oi = (s) => {
2152
2153
  const e = s.source, t = s.field;
2153
2154
  return k(e === void 0 || t === void 0 ? void 0 : e[t]);
2154
2155
  };
2155
- function ri(s, e) {
2156
+ function ni(s, e) {
2156
2157
  return (t) => {
2157
2158
  const r = t.source;
2158
2159
  return r === void 0 ? k(void 0) : ({ cCtx: o }) => {
@@ -2167,13 +2168,13 @@ function ri(s, e) {
2167
2168
  }
2168
2169
  return {
2169
2170
  type: "ScheduleSubroutine",
2170
- subroutine: si,
2171
+ subroutine: ii,
2171
2172
  args: i
2172
2173
  };
2173
2174
  };
2174
2175
  };
2175
2176
  }
2176
- const si = (s) => k(s), oi = (s) => {
2177
+ const ii = (s) => k(s), ai = (s) => {
2177
2178
  const e = s.source;
2178
2179
  return e === void 0 ? k(void 0) : ({ drivers: t }) => ({
2179
2180
  type: "ScheduleComputable",
@@ -2187,7 +2188,7 @@ const si = (s) => k(s), oi = (s) => {
2187
2188
  }
2188
2189
  )
2189
2190
  });
2190
- }, ni = (s) => {
2191
+ }, ci = (s) => {
2191
2192
  const e = s.source;
2192
2193
  return e === void 0 ? k(void 0) : ({ cCtx: t, drivers: r }) => {
2193
2194
  const o = t.accessor(e).node().resourceInfo;
@@ -2198,7 +2199,7 @@ const si = (s) => k(s), oi = (s) => {
2198
2199
  })
2199
2200
  };
2200
2201
  };
2201
- }, ii = (s) => {
2202
+ }, li = (s) => {
2202
2203
  const e = s.source;
2203
2204
  return e === void 0 ? k(void 0) : ({ drivers: t }) => ({
2204
2205
  type: "ScheduleComputable",
@@ -2214,49 +2215,49 @@ const si = (s) => k(s), oi = (s) => {
2214
2215
  }
2215
2216
  )
2216
2217
  });
2217
- }, ai = (s) => {
2218
+ }, ui = (s) => {
2218
2219
  const e = s.source;
2219
2220
  return e === void 0 ? k(void 0) : ({ drivers: t }) => ({
2220
2221
  type: "ScheduleComputable",
2221
2222
  computable: t.blobDriver.getDownloadedBlob(e)
2222
2223
  });
2223
- }, ci = (s) => {
2224
+ }, di = (s) => {
2224
2225
  const e = s.source;
2225
2226
  return e === void 0 ? k(void 0) : ({ drivers: t }) => ({
2226
2227
  type: "ScheduleComputable",
2227
2228
  computable: t.blobDriver.getOnDemandBlob(e)
2228
2229
  });
2229
- }, li = (s) => (e) => {
2230
+ }, pi = (s) => (e) => {
2230
2231
  const t = e.source;
2231
2232
  return t === void 0 ? k(void 0) : ({ drivers: r }) => ({
2232
2233
  type: "ScheduleComputable",
2233
2234
  computable: r.blobToURLDriver.extractArchiveAndGetURL(t, s)
2234
2235
  });
2235
- }, ui = (s) => {
2236
+ }, fi = (s) => {
2236
2237
  const e = s.source;
2237
2238
  return e === void 0 ? k(void 0) : ({ drivers: t }) => ({
2238
2239
  type: "ScheduleComputable",
2239
2240
  computable: t.uploadDriver.getProgressId(e)
2240
2241
  });
2241
- }, di = (s) => (e) => {
2242
+ }, hi = (s) => (e) => {
2242
2243
  const t = e.source;
2243
2244
  return t === void 0 ? k(void 0) : ({ drivers: r }) => ({
2244
2245
  type: "ScheduleComputable",
2245
2246
  computable: r.logDriver.getLastLogs(t, s)
2246
2247
  });
2247
- }, pi = (s) => (e) => {
2248
+ }, gi = (s) => (e) => {
2248
2249
  const t = e.source;
2249
2250
  return t === void 0 ? k(void 0) : ({ drivers: r }) => ({
2250
2251
  type: "ScheduleComputable",
2251
2252
  computable: r.logDriver.getProgressLog(t, s)
2252
2253
  });
2253
- }, fi = (s) => (e) => {
2254
+ }, mi = (s) => (e) => {
2254
2255
  const t = e.source;
2255
2256
  return t === void 0 ? k(void 0) : ({ drivers: r }) => ({
2256
2257
  type: "ScheduleComputable",
2257
2258
  computable: r.logDriver.getProgressLogWithInfo(t, s)
2258
2259
  });
2259
- }, hi = (s) => {
2260
+ }, vi = (s) => {
2260
2261
  const e = s.source;
2261
2262
  return e === void 0 ? k(void 0) : ({ drivers: t }) => ({
2262
2263
  type: "ScheduleComputable",
@@ -2272,14 +2273,14 @@ function P(s, e) {
2272
2273
  case "Isolate":
2273
2274
  return ({ drivers: t }) => ({
2274
2275
  type: "ScheduleComputable",
2275
- computable: Ps(t, s, e.cfg)
2276
+ computable: Os(t, s, e.cfg)
2276
2277
  });
2277
2278
  case "Immediate":
2278
2279
  return k(e.value);
2279
2280
  case "GetJsonField":
2280
2281
  return () => ({
2281
2282
  type: "ScheduleSubroutine",
2282
- subroutine: ti,
2283
+ subroutine: oi,
2283
2284
  args: {
2284
2285
  source: P(s, e.source),
2285
2286
  field: P(s, e.field)
@@ -2288,7 +2289,7 @@ function P(s, e) {
2288
2289
  case "MapArrayValues":
2289
2290
  return () => ({
2290
2291
  type: "ScheduleSubroutine",
2291
- subroutine: Wn(s, e),
2292
+ subroutine: Xn(s, e),
2292
2293
  args: {
2293
2294
  source: P(s, e.source)
2294
2295
  }
@@ -2296,7 +2297,7 @@ function P(s, e) {
2296
2297
  case "MapRecordValues":
2297
2298
  return () => ({
2298
2299
  type: "ScheduleSubroutine",
2299
- subroutine: qn(s, e),
2300
+ subroutine: Yn(s, e),
2300
2301
  args: {
2301
2302
  source: P(s, e.source)
2302
2303
  }
@@ -2304,19 +2305,19 @@ function P(s, e) {
2304
2305
  case "MakeObject":
2305
2306
  return () => ({
2306
2307
  type: "ScheduleSubroutine",
2307
- subroutine: _n,
2308
- args: Gn(e.template, (t) => P(s, t))
2308
+ subroutine: Wn,
2309
+ args: _n(e.template, (t) => P(s, t))
2309
2310
  });
2310
2311
  case "MakeArray":
2311
2312
  return () => ({
2312
2313
  type: "ScheduleSubroutine",
2313
- subroutine: Es(e.template.length),
2314
- args: Rs(e.template, (t) => P(s, t))
2314
+ subroutine: Cs(e.template.length),
2315
+ args: Es(e.template, (t) => P(s, t))
2315
2316
  });
2316
2317
  case "Flatten":
2317
2318
  return () => ({
2318
2319
  type: "ScheduleSubroutine",
2319
- subroutine: Kn,
2320
+ subroutine: qn,
2320
2321
  args: {
2321
2322
  source: P(s, e.source)
2322
2323
  }
@@ -2324,7 +2325,7 @@ function P(s, e) {
2324
2325
  case "IsEmpty":
2325
2326
  return () => ({
2326
2327
  type: "ScheduleSubroutine",
2327
- subroutine: Xn,
2328
+ subroutine: Zn,
2328
2329
  args: {
2329
2330
  arg: P(s, e.arg)
2330
2331
  }
@@ -2332,7 +2333,7 @@ function P(s, e) {
2332
2333
  case "Not":
2333
2334
  return () => ({
2334
2335
  type: "ScheduleSubroutine",
2335
- subroutine: Yn,
2336
+ subroutine: ei,
2336
2337
  args: {
2337
2338
  operand: P(s, e.operand)
2338
2339
  }
@@ -2340,7 +2341,7 @@ function P(s, e) {
2340
2341
  case "And":
2341
2342
  return () => ({
2342
2343
  type: "ScheduleSubroutine",
2343
- subroutine: Qn,
2344
+ subroutine: ti,
2344
2345
  args: {
2345
2346
  operand1: P(s, e.operand1),
2346
2347
  operand2: P(s, e.operand2)
@@ -2349,7 +2350,7 @@ function P(s, e) {
2349
2350
  case "Or":
2350
2351
  return () => ({
2351
2352
  type: "ScheduleSubroutine",
2352
- subroutine: Zn,
2353
+ subroutine: ri,
2353
2354
  args: {
2354
2355
  operand1: P(s, e.operand1),
2355
2356
  operand2: P(s, e.operand2)
@@ -2358,7 +2359,7 @@ function P(s, e) {
2358
2359
  case "MapResourceFields":
2359
2360
  return () => ({
2360
2361
  type: "ScheduleSubroutine",
2361
- subroutine: ri(s, e),
2362
+ subroutine: ni(s, e),
2362
2363
  args: {
2363
2364
  source: P(s, e.source)
2364
2365
  }
@@ -2366,7 +2367,7 @@ function P(s, e) {
2366
2367
  case "GetResourceField":
2367
2368
  return () => ({
2368
2369
  type: "ScheduleSubroutine",
2369
- subroutine: Hn,
2370
+ subroutine: zn,
2370
2371
  args: {
2371
2372
  source: P(s, e.source),
2372
2373
  field: P(s, e.field)
@@ -2375,7 +2376,7 @@ function P(s, e) {
2375
2376
  case "GetResourceValueAsJson":
2376
2377
  return () => ({
2377
2378
  type: "ScheduleSubroutine",
2378
- subroutine: ei,
2379
+ subroutine: si,
2379
2380
  args: {
2380
2381
  source: P(s, e.source)
2381
2382
  }
@@ -2383,7 +2384,7 @@ function P(s, e) {
2383
2384
  case "GetBlobContent":
2384
2385
  return () => ({
2385
2386
  type: "ScheduleSubroutine",
2386
- subroutine: oi,
2387
+ subroutine: ai,
2387
2388
  args: {
2388
2389
  source: P(s, e.source)
2389
2390
  }
@@ -2391,7 +2392,7 @@ function P(s, e) {
2391
2392
  case "GetBlobContentAsString":
2392
2393
  return () => ({
2393
2394
  type: "ScheduleSubroutine",
2394
- subroutine: ni,
2395
+ subroutine: ci,
2395
2396
  args: {
2396
2397
  source: P(s, e.source)
2397
2398
  }
@@ -2399,7 +2400,7 @@ function P(s, e) {
2399
2400
  case "GetBlobContentAsJson":
2400
2401
  return () => ({
2401
2402
  type: "ScheduleSubroutine",
2402
- subroutine: ii,
2403
+ subroutine: li,
2403
2404
  args: {
2404
2405
  source: P(s, e.source)
2405
2406
  }
@@ -2407,7 +2408,7 @@ function P(s, e) {
2407
2408
  case "GetDownloadedBlobContent":
2408
2409
  return () => ({
2409
2410
  type: "ScheduleSubroutine",
2410
- subroutine: ai,
2411
+ subroutine: ui,
2411
2412
  args: {
2412
2413
  source: P(s, e.source)
2413
2414
  }
@@ -2415,7 +2416,7 @@ function P(s, e) {
2415
2416
  case "GetOnDemandBlobContent":
2416
2417
  return () => ({
2417
2418
  type: "ScheduleSubroutine",
2418
- subroutine: ci,
2419
+ subroutine: di,
2419
2420
  args: {
2420
2421
  source: P(s, e.source)
2421
2422
  }
@@ -2423,7 +2424,7 @@ function P(s, e) {
2423
2424
  case "ExtractArchiveAndGetURL":
2424
2425
  return () => ({
2425
2426
  type: "ScheduleSubroutine",
2426
- subroutine: li(e.format),
2427
+ subroutine: pi(e.format),
2427
2428
  args: {
2428
2429
  source: P(s, e.source)
2429
2430
  }
@@ -2431,7 +2432,7 @@ function P(s, e) {
2431
2432
  case "GetImportProgress":
2432
2433
  return () => ({
2433
2434
  type: "ScheduleSubroutine",
2434
- subroutine: ui,
2435
+ subroutine: fi,
2435
2436
  args: {
2436
2437
  source: P(s, e.source)
2437
2438
  }
@@ -2439,7 +2440,7 @@ function P(s, e) {
2439
2440
  case "GetLastLogs":
2440
2441
  return () => ({
2441
2442
  type: "ScheduleSubroutine",
2442
- subroutine: di(e.lines),
2443
+ subroutine: hi(e.lines),
2443
2444
  args: {
2444
2445
  source: P(s, e.source)
2445
2446
  }
@@ -2447,7 +2448,7 @@ function P(s, e) {
2447
2448
  case "GetProgressLog":
2448
2449
  return () => ({
2449
2450
  type: "ScheduleSubroutine",
2450
- subroutine: pi(e.patternToSearch),
2451
+ subroutine: gi(e.patternToSearch),
2451
2452
  args: {
2452
2453
  source: P(s, e.source)
2453
2454
  }
@@ -2455,7 +2456,7 @@ function P(s, e) {
2455
2456
  case "GetProgressLogWithInfo":
2456
2457
  return () => ({
2457
2458
  type: "ScheduleSubroutine",
2458
- subroutine: fi(e.patternToSearch),
2459
+ subroutine: mi(e.patternToSearch),
2459
2460
  args: {
2460
2461
  source: P(s, e.source)
2461
2462
  }
@@ -2463,7 +2464,7 @@ function P(s, e) {
2463
2464
  case "GetLogHandle":
2464
2465
  return () => ({
2465
2466
  type: "ScheduleSubroutine",
2466
- subroutine: hi,
2467
+ subroutine: vi,
2467
2468
  args: {
2468
2469
  source: P(s, e.source)
2469
2470
  }
@@ -2472,8 +2473,8 @@ function P(s, e) {
2472
2473
  return H(e);
2473
2474
  }
2474
2475
  }
2475
- const gi = ["$prod", "$staging"];
2476
- function mi(s) {
2476
+ const yi = ["$prod", "$staging"];
2477
+ function wi(s) {
2477
2478
  return {
2478
2479
  $blockId: s.blockId,
2479
2480
  $args: (e) => JSON.parse(s.args(e)),
@@ -2485,16 +2486,16 @@ function mi(s) {
2485
2486
  $staging: s.staging
2486
2487
  };
2487
2488
  }
2488
- const Cs = Symbol(), ks = "return", vi = { op: Cs, arg: ks };
2489
- function yi(s) {
2490
- return s.op == Cs && s.arg == ks;
2489
+ const ks = Symbol(), Ps = "return", Si = { op: ks, arg: Ps };
2490
+ function bi(s) {
2491
+ return s.op == ks && s.arg == Ps;
2491
2492
  }
2492
- function wi() {
2493
+ function Ri() {
2493
2494
  return { pendingSubroutines: /* @__PURE__ */ new Map() };
2494
2495
  }
2495
- function Rr(s, e, t, r) {
2496
- const o = new rs(t), n = (a, c) => {
2497
- if (yi(a))
2496
+ function Er(s, e, t, r) {
2497
+ const o = new ss(t), n = (a, c) => {
2498
+ if (bi(a))
2498
2499
  return e.result = c, !1;
2499
2500
  const u = j(e.pendingSubroutines.get(a.op));
2500
2501
  if (a.arg in u.args) throw new Error("argument already set");
@@ -2546,26 +2547,26 @@ function Rr(s, e, t, r) {
2546
2547
  }
2547
2548
  return i;
2548
2549
  }
2549
- function Si(s, e, t, r = {}) {
2550
- return Ps(s, mi(e), t, r);
2550
+ function Ei(s, e, t, r = {}) {
2551
+ return Os(s, wi(e), t, r);
2551
2552
  }
2552
- function Ps(s, e, t, r = {}) {
2553
+ function Os(s, e, t, r = {}) {
2553
2554
  const o = `${e.blockId}#` + N({
2554
2555
  ctx: Object.fromEntries(
2555
- Object.entries(e).filter(([n]) => gi.indexOf(n) === -1)
2556
+ Object.entries(e).filter(([n]) => yi.indexOf(n) === -1)
2556
2557
  ),
2557
2558
  cfg: t
2558
2559
  });
2559
2560
  return J.makeRaw(
2560
2561
  (n) => {
2561
- const i = { drivers: s, cCtx: n }, a = wi();
2562
+ const i = { drivers: s, cCtx: n }, a = Ri();
2562
2563
  return {
2563
- ir: Rr(
2564
+ ir: Er(
2564
2565
  i,
2565
2566
  a,
2566
2567
  [
2567
2568
  {
2568
- destination: vi,
2569
+ destination: Si,
2569
2570
  operation: P(e, t)
2570
2571
  }
2571
2572
  ],
@@ -2587,7 +2588,7 @@ function Ps(s, e, t, r = {}) {
2587
2588
  result: a.result,
2588
2589
  pendingSubroutines: f
2589
2590
  };
2590
- if (Rr(d, h, l, !1), !("result" in h))
2591
+ if (Er(d, h, l, !1), !("result" in h))
2591
2592
  throw new Error("illegal cfg rendering stack state, no result");
2592
2593
  return h.result;
2593
2594
  }
@@ -2596,26 +2597,26 @@ function Ps(s, e, t, r = {}) {
2596
2597
  { ...r, key: o }
2597
2598
  );
2598
2599
  }
2599
- function bi(s) {
2600
+ function Ci(s) {
2600
2601
  return s instanceof ArrayBuffer || ArrayBuffer.isView(s);
2601
2602
  }
2602
- function Er(s) {
2603
+ function Cr(s) {
2603
2604
  return s !== void 0 ? Buffer.from(s).toString("base64") : void 0;
2604
2605
  }
2605
2606
  class ot {
2606
2607
  constructor(e, t, r, o, n, i) {
2607
- w(this, "callbackRegistry");
2608
- w(this, "fnJSONStringify");
2609
- w(this, "fnJSONParse");
2610
- w(this, "computablesToResolve", {});
2611
- w(this, "computableCtx");
2612
- w(this, "accessors", /* @__PURE__ */ new Map());
2613
- w(this, "meta");
2614
- w(this, "errorRepo", new Ri());
2608
+ S(this, "callbackRegistry");
2609
+ S(this, "fnJSONStringify");
2610
+ S(this, "fnJSONParse");
2611
+ S(this, "computablesToResolve", {});
2612
+ S(this, "computableCtx");
2613
+ S(this, "accessors", /* @__PURE__ */ new Map());
2614
+ S(this, "meta");
2615
+ S(this, "errorRepo", new ki());
2615
2616
  //
2616
2617
  // Result Pool
2617
2618
  //
2618
- w(this, "_resultPool");
2619
+ S(this, "_resultPool");
2619
2620
  if (this.scope = e, this.vm = t, this.blockCtx = r, this.env = o, this.deadlineSetter = n, this.computableCtx = i, this.callbackRegistry = this.scope.manage(this.vm.newObject()), this.fnJSONStringify = e.manage(
2620
2621
  t.getProp(t.global, "JSON").consume((a) => t.getProp(a, "stringify"))
2621
2622
  ), t.typeof(this.fnJSONStringify) !== "function")
@@ -2714,13 +2715,13 @@ class ot {
2714
2715
  return this.getAccessor(e).listDynamicFields();
2715
2716
  }
2716
2717
  getKeyValueBase64(e, t) {
2717
- return Er(this.getAccessor(e).getKeyValue(t));
2718
+ return Cr(this.getAccessor(e).getKeyValue(t));
2718
2719
  }
2719
2720
  getKeyValueAsString(e, t) {
2720
2721
  return this.getAccessor(e).getKeyValueAsString(t);
2721
2722
  }
2722
2723
  getDataBase64(e) {
2723
- return Er(this.getAccessor(e).getData());
2724
+ return Cr(this.getAccessor(e).getData());
2724
2725
  }
2725
2726
  getDataAsString(e) {
2726
2727
  return this.getAccessor(e).getDataAsString();
@@ -2731,7 +2732,7 @@ class ot {
2731
2732
  parsePObjectCollection(e, t, r, ...o) {
2732
2733
  const n = this.getAccessor(e);
2733
2734
  if (!n.getIsReadyOrError()) return;
2734
- const i = Un(n, t, r, o), a = {};
2735
+ const i = Mn(n, t, r, o), a = {};
2735
2736
  for (const [c, u] of Object.entries(i))
2736
2737
  a[c] = pe(u, (l) => this.wrapAccessor(l));
2737
2738
  return a;
@@ -2879,7 +2880,7 @@ class ot {
2879
2880
  obj: {
2880
2881
  id: t.obj.id,
2881
2882
  spec: t.obj.spec,
2882
- data: qr(t.obj.data, (r) => this.wrapAccessor(r))
2883
+ data: zr(t.obj.data, (r) => this.wrapAccessor(r))
2883
2884
  }
2884
2885
  }))
2885
2886
  };
@@ -2930,7 +2931,7 @@ class ot {
2930
2931
  * - Passes through other values
2931
2932
  */
2932
2933
  transformInputPData(e) {
2933
- return typeof e == "string" ? this.getAccessor(e) : zr(e) ? Xr(e, (t) => this.getAccessor(t)) : e;
2934
+ return typeof e == "string" ? this.getAccessor(e) : Xr(e) ? Yr(e, (t) => this.getAccessor(t)) : e;
2934
2935
  }
2935
2936
  //
2936
2937
  // Computable
@@ -2982,7 +2983,7 @@ class ot {
2982
2983
  r = this.vm.null;
2983
2984
  break;
2984
2985
  }
2985
- if (bi(e)) {
2986
+ if (Ci(e)) {
2986
2987
  r = this.vm.newArrayBuffer(e), o = !0;
2987
2988
  break;
2988
2989
  }
@@ -3023,7 +3024,7 @@ class ot {
3023
3024
  this.vm.setProp(t, "args", e.manage(this.vm.newString(r))), n !== void 0 && this.vm.setProp(t, "uiState", e.manage(this.vm.newString(n))), o !== void 0 && this.vm.setProp(t, "activeArgs", e.manage(this.vm.newString(o))), this.vm.setProp(t, "callbackRegistry", this.callbackRegistry), this.vm.setProp(
3024
3025
  t,
3025
3026
  "featureFlags",
3026
- this.exportObjectUniversal(Js.GlobalCfgRenderCtxFeatureFlags, e)
3027
+ this.exportObjectUniversal(Ms.GlobalCfgRenderCtxFeatureFlags, e)
3027
3028
  );
3028
3029
  const i = (a, c) => {
3029
3030
  const u = (...l) => {
@@ -3116,9 +3117,9 @@ class ot {
3116
3117
  });
3117
3118
  }
3118
3119
  }
3119
- class Ri {
3120
+ class ki {
3120
3121
  constructor() {
3121
- w(this, "errorIdToError", /* @__PURE__ */ new Map());
3122
+ S(this, "errorIdToError", /* @__PURE__ */ new Map());
3122
3123
  }
3123
3124
  /** Sets the error to the repository and returns a mimicrated error that also has uuid key of the original error. */
3124
3125
  setAndRecreateForQuickJS(e) {
@@ -3133,7 +3134,7 @@ class Ri {
3133
3134
  }
3134
3135
  /** Returns the original error that was stored by parsing uuid of mimicrated error. */
3135
3136
  getOriginal(e) {
3136
- if (!(e instanceof mo.QuickJSUnwrapError))
3137
+ if (!(e instanceof wo.QuickJSUnwrapError))
3137
3138
  return console.warn("ErrorRepo: quickJSError is not a QuickJSUnwrapError", Ue(e)), e;
3138
3139
  if (!("name" in e.cause))
3139
3140
  return console.warn("ErrorRepo: quickJSError.cause is not an Error", Ue(e)), e;
@@ -3143,7 +3144,7 @@ class Ri {
3143
3144
  const o = this.errorIdToError.get(r);
3144
3145
  if (o === void 0)
3145
3146
  throw new Error(`ErrorRepo: errorId not found: ${r}, ${Ue(e)}`);
3146
- return new yo(e, o);
3147
+ return new bo(e, o);
3147
3148
  }
3148
3149
  }
3149
3150
  function it(s, e) {
@@ -3163,7 +3164,7 @@ function it(s, e) {
3163
3164
  );
3164
3165
  }
3165
3166
  const He = process.env.MI_LOG_OUTPUT_STATUS;
3166
- function Ei(s, e, t, r, o, n = {}) {
3167
+ function Pi(s, e, t, r, o, n = {}) {
3167
3168
  const i = `${e.blockId}#lambda#${o}#${t.handle}`;
3168
3169
  return n = { ...n, key: i }, n.mode === void 0 && t.retentive === !0 && (n.mode = "StableOnlyRetentive"), J.makeRaw((a) => {
3169
3170
  const c = new Ct();
@@ -3198,22 +3199,22 @@ function Ei(s, e, t, r, o, n = {}) {
3198
3199
  };
3199
3200
  }, n);
3200
3201
  }
3201
- function Ci(s) {
3202
- return Yr(s) ? s.isActive === !0 : Mn(s);
3202
+ function Oi(s) {
3203
+ return Qr(s) ? s.isActive === !0 : Hn(s);
3203
3204
  }
3204
3205
  function Le(s, e, t, r, o, n = {}) {
3205
- if (Yr(t)) {
3206
+ if (Qr(t)) {
3206
3207
  if (r === void 0) throw new Error("No code bundle.");
3207
- return Ei(s, e, t, r, o, n);
3208
- } else return Si(s.driverKit, e, t, n);
3208
+ return Pi(s, e, t, r, o, n);
3209
+ } else return Ei(s.driverKit, e, t, n);
3209
3210
  }
3210
- function ki(s, e) {
3211
+ function $i(s, e) {
3211
3212
  if (s === e) return !0;
3212
3213
  if (s === void 0 || e === void 0) return !1;
3213
- const t = ar.omitBy((r, o) => o.startsWith("__"));
3214
- return ar.isDeepEqual(t(s), t(e));
3214
+ const t = cr.omitBy((r, o) => o.startsWith("__"));
3215
+ return cr.isDeepEqual(t(s), t(e));
3215
3216
  }
3216
- function Pi(s, e, t) {
3217
+ function Ii(s, e, t) {
3217
3218
  return J.make(
3218
3219
  (r) => {
3219
3220
  var R, g, x, T, B, $, M, ge;
@@ -3244,7 +3245,7 @@ function Pi(s, e, t) {
3244
3245
  });
3245
3246
  z = {
3246
3247
  arguments: Y,
3247
- stale: !ki(ce, Y),
3248
+ stale: !$i(ce, Y),
3248
3249
  outputError: D.error !== void 0 || W.error !== void 0 || ((R = D.value) == null ? void 0 : R.getError()) !== void 0 || ((g = W.value) == null ? void 0 : g.getError()) !== void 0,
3249
3250
  outputsError: ((x = D.error) == null ? void 0 : x.getDataAsString()) ?? ((B = (T = D.value) == null ? void 0 : T.getError()) == null ? void 0 : B.getDataAsString()),
3250
3251
  exportsError: (($ = W.error) == null ? void 0 : $.getDataAsString()) ?? ((ge = (M = W.value) == null ? void 0 : M.getError()) == null ? void 0 : ge.getDataAsString()),
@@ -3254,7 +3255,7 @@ function Pi(s, e, t) {
3254
3255
  l.set(L, { currentArguments: ce, prod: z });
3255
3256
  }
3256
3257
  const d = Ze(c, (L) => l.get(L).currentArguments), f = new Set(u.blocksInLimbo), h = [...ee(c)].map(({ id: L, label: se, renderingMode: ce }) => {
3257
- var S, E, O, C, F;
3258
+ var w, E, O, C, F;
3258
3259
  const z = j(l.get(L)), ie = j(d.nodes.get(L));
3259
3260
  let Y = "NotCalculated";
3260
3261
  z.prod !== void 0 && (f.has(L) ? Y = "Limbo" : Y = z.prod.finished ? "Done" : "Running");
@@ -3279,7 +3280,7 @@ function Pi(s, e, t) {
3279
3280
  I.code,
3280
3281
  V
3281
3282
  ).wrap({
3282
- recover: (xs) => (t.logger.error("Error in block model title"), t.logger.error(xs), "Invalid title")
3283
+ recover: (Vs) => (t.logger.error("Error in block model title"), t.logger.error(Vs), "Invalid title")
3283
3284
  })
3284
3285
  ),
3285
3286
  inputsValid: Le(
@@ -3307,7 +3308,7 @@ function Pi(s, e, t) {
3307
3308
  label: v ?? se,
3308
3309
  title: v ?? se,
3309
3310
  renderingMode: ce,
3310
- stale: ((S = z.prod) == null ? void 0 : S.stale) !== !1 || Y === "Limbo",
3311
+ stale: ((w = z.prod) == null ? void 0 : w.stale) !== !1 || Y === "Limbo",
3311
3312
  missingReference: ie.missingReferences,
3312
3313
  upstreams: [...d.traverseIdsExcludingRoots("upstream", L)],
3313
3314
  downstreams: [...d.traverseIdsExcludingRoots("downstream", L)],
@@ -3355,13 +3356,13 @@ function Pi(s, e, t) {
3355
3356
  }
3356
3357
  ).withStableType();
3357
3358
  }
3358
- function Oi(s, e) {
3359
+ function Fi(s, e) {
3359
3360
  const t = s.node();
3360
- if (le(t.resourceType, hs)) {
3361
+ if (le(t.resourceType, gs)) {
3361
3362
  const r = t.getDataAsJson();
3362
3363
  if (r === void 0) throw new Error("No resource data.");
3363
3364
  return e.frontendDownloadDriver.getPath(new URL(r.url)).withStableType();
3364
- } else if (le(t.resourceType, gs)) {
3365
+ } else if (le(t.resourceType, ms)) {
3365
3366
  const r = t.getDataAsJson();
3366
3367
  if (r === void 0) throw new Error("No resource data.");
3367
3368
  return e.signer.verify(
@@ -3372,10 +3373,10 @@ function Oi(s, e) {
3372
3373
  } else
3373
3374
  throw new Error(`Unsupported resource type: ${JSON.stringify(t.resourceType)}`);
3374
3375
  }
3375
- function $i(s, e) {
3376
+ function Ai(s, e) {
3376
3377
  if (s !== void 0)
3377
3378
  return J.make(
3378
- (t) => Oi(t.accessor(s), e),
3379
+ (t) => Fi(t.accessor(s), e),
3379
3380
  {
3380
3381
  postprocessValue: (t) => {
3381
3382
  if (t !== void 0) {
@@ -3387,7 +3388,7 @@ function $i(s, e) {
3387
3388
  }
3388
3389
  ).withStableType();
3389
3390
  }
3390
- function Ii(s, e, t) {
3391
+ function Ti(s, e, t) {
3391
3392
  return J.make(
3392
3393
  (r) => {
3393
3394
  var a;
@@ -3397,19 +3398,19 @@ function Ii(s, e, t) {
3397
3398
  assertFieldType: "Dynamic"
3398
3399
  },
3399
3400
  { field: A.HolderRefField, assertFieldType: "Input", errorIfFieldNotFound: !0 },
3400
- { field: vs, assertFieldType: "Input" }
3401
+ { field: ys, assertFieldType: "Input" }
3401
3402
  )) == null ? void 0 : a.persist();
3402
3403
  return {
3403
- path: $i(i, t),
3404
+ path: Ai(i, t),
3404
3405
  sdkVersion: n == null ? void 0 : n.cfg.sdkVersion
3405
3406
  };
3406
3407
  },
3407
3408
  { mode: "StableOnlyLive" }
3408
3409
  );
3409
3410
  }
3410
- function Os(s, e, t) {
3411
+ function $s(s, e, t) {
3411
3412
  if (t === void 0)
3412
- return J.make((i) => Os(s, e, i), {
3413
+ return J.make((i) => $s(s, e, i), {
3413
3414
  key: `inputs#${Se(s.rid)}#${e}`
3414
3415
  });
3415
3416
  const r = t.accessor(s).node(), o = Gt(s, e), n = o.uiState(t);
@@ -3419,10 +3420,10 @@ function Os(s, e, t) {
3419
3420
  ui: n !== void 0 ? et(JSON.parse(n)) : void 0
3420
3421
  };
3421
3422
  }
3422
- function Fi(s, e, t) {
3423
+ function Li(s, e, t) {
3423
3424
  return J.make(
3424
3425
  (r) => {
3425
- const o = r.accessor(s).node(), n = bs(s, e);
3426
+ const o = r.accessor(s).node(), n = Rs(s, e);
3426
3427
  return Te(it(o, e), ({ cfg: i, bpId: a }) => {
3427
3428
  const c = {};
3428
3429
  for (const [u, l] of Object.entries(i.outputs)) {
@@ -3435,15 +3436,15 @@ function Fi(s, e, t) {
3435
3436
  { key: "outputs#" + Se(s.rid) + "#" + e }
3436
3437
  ).withStableType();
3437
3438
  }
3438
- function Ai(s, e) {
3439
+ function Di(s, e) {
3439
3440
  return J.make((t) => {
3440
3441
  const r = t.accessor(s).node(), o = j(r.getKeyValueAsJson(he)), n = [];
3441
3442
  for (const { id: i } of ee(o)) {
3442
3443
  const a = it(r, i);
3443
3444
  if (a === void 0) continue;
3444
- const c = Object.entries(a.cfg.outputs).map(([, l]) => l).filter((l) => Ci(l)).map((l) => l);
3445
+ const c = Object.entries(a.cfg.outputs).map(([, l]) => l).filter((l) => Oi(l)).map((l) => l);
3445
3446
  if (c.length === 0) continue;
3446
- const u = bs(r.persist(), i);
3447
+ const u = Rs(r.persist(), i);
3447
3448
  for (const l of c)
3448
3449
  n.push(
3449
3450
  J.wrapError(Le(e, u, l, a.cfg.code, a.bpId))
@@ -3452,21 +3453,21 @@ function Ai(s, e) {
3452
3453
  return n;
3453
3454
  });
3454
3455
  }
3455
- class Ti {
3456
+ class Ni {
3456
3457
  constructor() {
3457
- w(this, "states", /* @__PURE__ */ new Map());
3458
+ S(this, "states", /* @__PURE__ */ new Map());
3458
3459
  }
3459
3460
  setState(e, t) {
3460
3461
  const r = this.states.get(e);
3461
3462
  if (r === void 0) {
3462
- this.states.set(e, { state: t, change: new ir() });
3463
+ this.states.set(e, { state: t, change: new ar() });
3463
3464
  return;
3464
3465
  }
3465
3466
  r.state = { ...t }, r.change.markChanged();
3466
3467
  }
3467
3468
  readState(e, t) {
3468
3469
  let r = this.states.get(t);
3469
- return r === void 0 && (r = { state: { ...Ms }, change: new ir() }, this.states.set(t, r)), r.change.attachWatcher(e.watcher), r.state;
3470
+ return r === void 0 && (r = { state: { ..._s }, change: new ar() }, this.states.set(t, r)), r.change.attachWatcher(e.watcher), r.state;
3470
3471
  }
3471
3472
  getState(e) {
3472
3473
  return J.make(
@@ -3479,41 +3480,41 @@ class Ti {
3479
3480
  t !== void 0 && (this.states.delete(e), t.change.markChanged());
3480
3481
  }
3481
3482
  }
3482
- function Cr(s) {
3483
+ function kr(s) {
3483
3484
  return JSON.stringify(s, (e, t) => typeof t == "bigint" ? Se(t) : ArrayBuffer.isView(t) || t instanceof Int8Array || t instanceof Uint8Array || t instanceof Uint8ClampedArray || t instanceof Int16Array || t instanceof Uint16Array || t instanceof Int32Array || t instanceof Uint32Array || t instanceof Float32Array || t instanceof Float64Array || t instanceof BigInt64Array || t instanceof BigUint64Array ? Buffer.from(t.buffer, t.byteOffset, t.byteLength).toString("base64") : Buffer.isBuffer(t) ? t.toString("base64") : t);
3484
3485
  }
3485
3486
  class Jt {
3486
3487
  constructor(e, t, r) {
3487
3488
  /** Underlying pl resource id */
3488
- w(this, "rid");
3489
+ S(this, "rid");
3489
3490
  /** Data for the left panel, contain basic information about block status. */
3490
- w(this, "overview");
3491
- w(this, "navigationStates", new Ti());
3492
- w(this, "blockComputables", /* @__PURE__ */ new Map());
3493
- w(this, "blockFrontends", /* @__PURE__ */ new Map());
3494
- w(this, "activeConfigs");
3495
- w(this, "refreshLoopResult");
3496
- w(this, "abortController", new AbortController());
3497
- w(this, "destroyed", !1);
3498
- this.env = e, this.projectTree = r, this.overview = Pi(
3491
+ S(this, "overview");
3492
+ S(this, "navigationStates", new Ni());
3493
+ S(this, "blockComputables", /* @__PURE__ */ new Map());
3494
+ S(this, "blockFrontends", /* @__PURE__ */ new Map());
3495
+ S(this, "activeConfigs");
3496
+ S(this, "refreshLoopResult");
3497
+ S(this, "abortController", new AbortController());
3498
+ S(this, "destroyed", !1);
3499
+ this.env = e, this.projectTree = r, this.overview = Ii(
3499
3500
  r.entry(),
3500
3501
  this.navigationStates,
3501
3502
  e
3502
- ).withPreCalculatedValueTree(), this.rid = t, this.refreshLoopResult = this.refreshLoop(), this.activeConfigs = Ai(r.entry(), e);
3503
+ ).withPreCalculatedValueTree(), this.rid = t, this.refreshLoopResult = this.refreshLoop(), this.activeConfigs = Di(r.entry(), e);
3503
3504
  }
3504
3505
  async refreshLoop() {
3505
3506
  for (; !this.destroyed; )
3506
3507
  try {
3507
3508
  await Ke(this.env.pl, this.rid, (e) => {
3508
3509
  e.doRefresh(this.env.ops.stagingRenderingRate);
3509
- }), await this.activeConfigs.getValue(), await ss(this.env.ops.projectRefreshInterval, this.abortController.signal);
3510
+ }), await this.activeConfigs.getValue(), await os(this.env.ops.projectRefreshInterval, this.abortController.signal);
3510
3511
  } catch (e) {
3511
- if (so(e)) {
3512
+ if (io(e)) {
3512
3513
  console.warn(
3513
3514
  "project refresh routine terminated, because project was externally deleted"
3514
3515
  );
3515
3516
  break;
3516
- } else if (!oo(e))
3517
+ } else if (!ao(e))
3517
3518
  throw new Error("Unexpected exception", { cause: e });
3518
3519
  }
3519
3520
  }
@@ -3694,10 +3695,10 @@ class Jt {
3694
3695
  getBlockComputables(e) {
3695
3696
  const t = this.blockComputables.get(e);
3696
3697
  if (t === void 0) {
3697
- const r = Fi(this.projectTree.entry(), e, this.env), n = {
3698
+ const r = Li(this.projectTree.entry(), e, this.env), n = {
3698
3699
  fullState: J.make(
3699
3700
  (i) => ({
3700
- argsAndUiState: Os(this.projectTree.entry(), e, i),
3701
+ argsAndUiState: $s(this.projectTree.entry(), e, i),
3701
3702
  outputs: r,
3702
3703
  navigationState: this.navigationStates.getState(e),
3703
3704
  overview: this.overview
@@ -3705,7 +3706,7 @@ class Jt {
3705
3706
  {
3706
3707
  postprocessValue: (i) => {
3707
3708
  var l, d, f;
3708
- const a = (f = (d = (l = i.overview) == null ? void 0 : l.blocks) == null ? void 0 : d.find((h) => h.id == e)) == null ? void 0 : f.sdkVersion, u = a && Di(a) && i.outputs !== void 0 ? Bi(i.outputs) : i.outputs;
3709
+ const a = (f = (d = (l = i.overview) == null ? void 0 : l.blocks) == null ? void 0 : d.find((h) => h.id == e)) == null ? void 0 : f.sdkVersion, u = a && ji(a) && i.outputs !== void 0 ? Vi(i.outputs) : i.outputs;
3709
3710
  return {
3710
3711
  ...i.argsAndUiState,
3711
3712
  outputs: u,
@@ -3733,7 +3734,7 @@ class Jt {
3733
3734
  getBlockFrontend(e) {
3734
3735
  const t = this.blockFrontends.get(e);
3735
3736
  if (t === void 0) {
3736
- const r = Ii(
3737
+ const r = Ti(
3737
3738
  this.projectTree.entry(),
3738
3739
  e,
3739
3740
  this.env
@@ -3755,12 +3756,12 @@ class Jt {
3755
3756
  static async init(e, t) {
3756
3757
  await Ke(e.pl, t, (o) => {
3757
3758
  });
3758
- const r = await es.init(
3759
+ const r = await ts.init(
3759
3760
  e.pl,
3760
3761
  t,
3761
3762
  {
3762
3763
  ...e.ops.defaultTreeOptions,
3763
- pruning: Li
3764
+ pruning: Bi
3764
3765
  },
3765
3766
  e.logger
3766
3767
  );
@@ -3770,13 +3771,13 @@ class Jt {
3770
3771
  var c, u;
3771
3772
  return (((c = a.data) == null ? void 0 : c.byteLength) ?? 0) - (((u = i.data) == null ? void 0 : u.byteLength) ?? 0);
3772
3773
  });
3773
- const n = ao(o);
3774
- await sr.writeFile(`${Se(t)}.json`, Cr(o)), await sr.writeFile(`${Se(t)}.stats.json`, Cr(n));
3774
+ const n = uo(o);
3775
+ await or.writeFile(`${Se(t)}.json`, kr(o)), await or.writeFile(`${Se(t)}.stats.json`, kr(n));
3775
3776
  }
3776
3777
  return new Jt(e, t, r);
3777
3778
  }
3778
3779
  }
3779
- function Li(s) {
3780
+ function Bi(s) {
3780
3781
  switch (s.type.name) {
3781
3782
  case "BlockPackCustom":
3782
3783
  return s.fields.filter((e) => e.name !== "template");
@@ -3788,14 +3789,14 @@ function Li(s) {
3788
3789
  return s.fields;
3789
3790
  }
3790
3791
  }
3791
- function Di(s) {
3792
- return !Ni(s, "1.26.0");
3792
+ function ji(s) {
3793
+ return !xi(s, "1.26.0");
3793
3794
  }
3794
- function Ni(s, e) {
3795
+ function xi(s, e) {
3795
3796
  const t = s.split(".").map(Number), r = e.split(".").map(Number);
3796
3797
  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];
3797
3798
  }
3798
- function Bi(s) {
3799
+ function Vi(s) {
3799
3800
  const e = {};
3800
3801
  for (const [t, r] of Object.entries(s)) {
3801
3802
  if (r.ok) {
@@ -3810,8 +3811,8 @@ function Bi(s) {
3810
3811
  }
3811
3812
  return e;
3812
3813
  }
3813
- const $s = {
3814
- logger: new Ys(),
3814
+ const Is = {
3815
+ logger: new Zs(),
3815
3816
  blobDriverOps: {
3816
3817
  cacheSoftSizeBytes: 8 * 1024 * 1024 * 1024,
3817
3818
  // 8 GB
@@ -3834,14 +3835,15 @@ const $s = {
3834
3835
  stopPollingDelay: 1e3
3835
3836
  }
3836
3837
  };
3837
- function Is(s) {
3838
+ function Fs(s) {
3838
3839
  return {
3839
- blobDownloadPath: K.join(s, "download"),
3840
- downloadBlobToURLPath: K.join(s, "downloadToURL")
3840
+ blobDownloadPath: _.join(s, "download"),
3841
+ downloadBlobToURLPath: _.join(s, "downloadToURL"),
3842
+ pframesSpillPath: _.join(s, "pframes")
3841
3843
  };
3842
3844
  }
3843
- const ji = {
3844
- ...$s,
3845
+ const Ui = {
3846
+ ...Is,
3845
3847
  defaultTreeOptions: {
3846
3848
  pollingInterval: 350,
3847
3849
  stopPollingDelay: 2500,
@@ -3855,18 +3857,18 @@ const ji = {
3855
3857
  projectRefreshInterval: 700,
3856
3858
  stagingRenderingRate: 5
3857
3859
  };
3858
- function xi(s) {
3860
+ function Gi(s) {
3859
3861
  return {
3860
- ...Is(s),
3861
- frontendDownloadPath: K.join(s, "frontend")
3862
+ ...Fs(s),
3863
+ frontendDownloadPath: _.join(s, "frontend")
3862
3864
  };
3863
3865
  }
3864
- function Vi(s) {
3866
+ function Ji(s) {
3865
3867
  return s && s.__esModule && Object.prototype.hasOwnProperty.call(s, "default") ? s.default : s;
3866
3868
  }
3867
3869
  var Tt = { exports: {} };
3868
- const Ui = "2.0.0", Fs = 256, Gi = Number.MAX_SAFE_INTEGER || /* istanbul ignore next */
3869
- 9007199254740991, Ji = 16, Mi = Fs - 6, _i = [
3870
+ const Mi = "2.0.0", As = 256, _i = Number.MAX_SAFE_INTEGER || /* istanbul ignore next */
3871
+ 9007199254740991, Ki = 16, Hi = As - 6, Wi = [
3870
3872
  "major",
3871
3873
  "premajor",
3872
3874
  "minor",
@@ -3876,18 +3878,18 @@ const Ui = "2.0.0", Fs = 256, Gi = Number.MAX_SAFE_INTEGER || /* istanbul ignore
3876
3878
  "prerelease"
3877
3879
  ];
3878
3880
  var at = {
3879
- MAX_LENGTH: Fs,
3880
- MAX_SAFE_COMPONENT_LENGTH: Ji,
3881
- MAX_SAFE_BUILD_LENGTH: Mi,
3882
- MAX_SAFE_INTEGER: Gi,
3883
- RELEASE_TYPES: _i,
3884
- SEMVER_SPEC_VERSION: Ui,
3881
+ MAX_LENGTH: As,
3882
+ MAX_SAFE_COMPONENT_LENGTH: Ki,
3883
+ MAX_SAFE_BUILD_LENGTH: Hi,
3884
+ MAX_SAFE_INTEGER: _i,
3885
+ RELEASE_TYPES: Wi,
3886
+ SEMVER_SPEC_VERSION: Mi,
3885
3887
  FLAG_INCLUDE_PRERELEASE: 1,
3886
3888
  FLAG_LOOSE: 2
3887
3889
  };
3888
- const Ki = typeof process == "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...s) => console.error("SEMVER", ...s) : () => {
3890
+ const qi = typeof process == "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...s) => console.error("SEMVER", ...s) : () => {
3889
3891
  };
3890
- var ct = Ki;
3892
+ var ct = qi;
3891
3893
  (function(s, e) {
3892
3894
  const {
3893
3895
  MAX_SAFE_COMPONENT_LENGTH: t,
@@ -3912,31 +3914,31 @@ var ct = Ki;
3912
3914
  g("NUMERICIDENTIFIER", "0|[1-9]\\d*"), g("NUMERICIDENTIFIERLOOSE", "\\d+"), g("NONNUMERICIDENTIFIER", `\\d*[a-zA-Z-]${f}*`), g("MAINVERSION", `(${c[l.NUMERICIDENTIFIER]})\\.(${c[l.NUMERICIDENTIFIER]})\\.(${c[l.NUMERICIDENTIFIER]})`), g("MAINVERSIONLOOSE", `(${c[l.NUMERICIDENTIFIERLOOSE]})\\.(${c[l.NUMERICIDENTIFIERLOOSE]})\\.(${c[l.NUMERICIDENTIFIERLOOSE]})`), g("PRERELEASEIDENTIFIER", `(?:${c[l.NUMERICIDENTIFIER]}|${c[l.NONNUMERICIDENTIFIER]})`), g("PRERELEASEIDENTIFIERLOOSE", `(?:${c[l.NUMERICIDENTIFIERLOOSE]}|${c[l.NONNUMERICIDENTIFIER]})`), g("PRERELEASE", `(?:-(${c[l.PRERELEASEIDENTIFIER]}(?:\\.${c[l.PRERELEASEIDENTIFIER]})*))`), g("PRERELEASELOOSE", `(?:-?(${c[l.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${c[l.PRERELEASEIDENTIFIERLOOSE]})*))`), g("BUILDIDENTIFIER", `${f}+`), g("BUILD", `(?:\\+(${c[l.BUILDIDENTIFIER]}(?:\\.${c[l.BUILDIDENTIFIER]})*))`), g("FULLPLAIN", `v?${c[l.MAINVERSION]}${c[l.PRERELEASE]}?${c[l.BUILD]}?`), g("FULL", `^${c[l.FULLPLAIN]}$`), g("LOOSEPLAIN", `[v=\\s]*${c[l.MAINVERSIONLOOSE]}${c[l.PRERELEASELOOSE]}?${c[l.BUILD]}?`), g("LOOSE", `^${c[l.LOOSEPLAIN]}$`), g("GTLT", "((?:<|>)?=?)"), g("XRANGEIDENTIFIERLOOSE", `${c[l.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`), g("XRANGEIDENTIFIER", `${c[l.NUMERICIDENTIFIER]}|x|X|\\*`), g("XRANGEPLAIN", `[v=\\s]*(${c[l.XRANGEIDENTIFIER]})(?:\\.(${c[l.XRANGEIDENTIFIER]})(?:\\.(${c[l.XRANGEIDENTIFIER]})(?:${c[l.PRERELEASE]})?${c[l.BUILD]}?)?)?`), g("XRANGEPLAINLOOSE", `[v=\\s]*(${c[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[l.XRANGEIDENTIFIERLOOSE]})(?:${c[l.PRERELEASELOOSE]})?${c[l.BUILD]}?)?)?`), g("XRANGE", `^${c[l.GTLT]}\\s*${c[l.XRANGEPLAIN]}$`), g("XRANGELOOSE", `^${c[l.GTLT]}\\s*${c[l.XRANGEPLAINLOOSE]}$`), g("COERCEPLAIN", `(^|[^\\d])(\\d{1,${t}})(?:\\.(\\d{1,${t}}))?(?:\\.(\\d{1,${t}}))?`), g("COERCE", `${c[l.COERCEPLAIN]}(?:$|[^\\d])`), g("COERCEFULL", c[l.COERCEPLAIN] + `(?:${c[l.PRERELEASE]})?(?:${c[l.BUILD]})?(?:$|[^\\d])`), g("COERCERTL", c[l.COERCE], !0), g("COERCERTLFULL", c[l.COERCEFULL], !0), g("LONETILDE", "(?:~>?)"), g("TILDETRIM", `(\\s*)${c[l.LONETILDE]}\\s+`, !0), e.tildeTrimReplace = "$1~", g("TILDE", `^${c[l.LONETILDE]}${c[l.XRANGEPLAIN]}$`), g("TILDELOOSE", `^${c[l.LONETILDE]}${c[l.XRANGEPLAINLOOSE]}$`), g("LONECARET", "(?:\\^)"), g("CARETTRIM", `(\\s*)${c[l.LONECARET]}\\s+`, !0), e.caretTrimReplace = "$1^", g("CARET", `^${c[l.LONECARET]}${c[l.XRANGEPLAIN]}$`), g("CARETLOOSE", `^${c[l.LONECARET]}${c[l.XRANGEPLAINLOOSE]}$`), g("COMPARATORLOOSE", `^${c[l.GTLT]}\\s*(${c[l.LOOSEPLAIN]})$|^$`), g("COMPARATOR", `^${c[l.GTLT]}\\s*(${c[l.FULLPLAIN]})$|^$`), g("COMPARATORTRIM", `(\\s*)${c[l.GTLT]}\\s*(${c[l.LOOSEPLAIN]}|${c[l.XRANGEPLAIN]})`, !0), e.comparatorTrimReplace = "$1$2$3", g("HYPHENRANGE", `^\\s*(${c[l.XRANGEPLAIN]})\\s+-\\s+(${c[l.XRANGEPLAIN]})\\s*$`), g("HYPHENRANGELOOSE", `^\\s*(${c[l.XRANGEPLAINLOOSE]})\\s+-\\s+(${c[l.XRANGEPLAINLOOSE]})\\s*$`), g("STAR", "(<|>)?=?\\s*\\*"), g("GTE0", "^\\s*>=\\s*0\\.0\\.0\\s*$"), g("GTE0PRE", "^\\s*>=\\s*0\\.0\\.0-0\\s*$");
3913
3915
  })(Tt, Tt.exports);
3914
3916
  var Ve = Tt.exports;
3915
- const Hi = Object.freeze({ loose: !0 }), Wi = Object.freeze({}), qi = (s) => s ? typeof s != "object" ? Hi : s : Wi;
3916
- var Mt = qi;
3917
- const kr = /^[0-9]+$/, As = (s, e) => {
3918
- const t = kr.test(s), r = kr.test(e);
3917
+ const zi = Object.freeze({ loose: !0 }), Xi = Object.freeze({}), Yi = (s) => s ? typeof s != "object" ? zi : s : Xi;
3918
+ var Mt = Yi;
3919
+ const Pr = /^[0-9]+$/, Ts = (s, e) => {
3920
+ const t = Pr.test(s), r = Pr.test(e);
3919
3921
  return t && r && (s = +s, e = +e), s === e ? 0 : t && !r ? -1 : r && !t ? 1 : s < e ? -1 : 1;
3920
- }, zi = (s, e) => As(e, s);
3921
- var Ts = {
3922
- compareIdentifiers: As,
3923
- rcompareIdentifiers: zi
3922
+ }, Qi = (s, e) => Ts(e, s);
3923
+ var Ls = {
3924
+ compareIdentifiers: Ts,
3925
+ rcompareIdentifiers: Qi
3924
3926
  };
3925
- const We = ct, { MAX_LENGTH: Pr, MAX_SAFE_INTEGER: qe } = at, { safeRe: Or, safeSrc: $r, t: ze } = Ve, Xi = Mt, { compareIdentifiers: me } = Ts;
3926
- let Yi = class oe {
3927
+ const We = ct, { MAX_LENGTH: Or, MAX_SAFE_INTEGER: qe } = at, { safeRe: $r, safeSrc: Ir, t: ze } = Ve, Zi = Mt, { compareIdentifiers: me } = Ls;
3928
+ let ea = class oe {
3927
3929
  constructor(e, t) {
3928
- if (t = Xi(t), e instanceof oe) {
3930
+ if (t = Zi(t), e instanceof oe) {
3929
3931
  if (e.loose === !!t.loose && e.includePrerelease === !!t.includePrerelease)
3930
3932
  return e;
3931
3933
  e = e.version;
3932
3934
  } else if (typeof e != "string")
3933
3935
  throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);
3934
- if (e.length > Pr)
3936
+ if (e.length > Or)
3935
3937
  throw new TypeError(
3936
- `version is longer than ${Pr} characters`
3938
+ `version is longer than ${Or} characters`
3937
3939
  );
3938
3940
  We("SemVer", e, t), this.options = t, this.loose = !!t.loose, this.includePrerelease = !!t.includePrerelease;
3939
- const r = e.trim().match(t.loose ? Or[ze.LOOSE] : Or[ze.FULL]);
3941
+ const r = e.trim().match(t.loose ? $r[ze.LOOSE] : $r[ze.FULL]);
3940
3942
  if (!r)
3941
3943
  throw new TypeError(`Invalid Version: ${e}`);
3942
3944
  if (this.raw = e, this.major = +r[1], this.minor = +r[2], this.patch = +r[3], this.major > qe || this.major < 0)
@@ -4015,7 +4017,7 @@ let Yi = class oe {
4015
4017
  if (!t && r === !1)
4016
4018
  throw new Error("invalid increment argument: identifier is empty");
4017
4019
  if (t) {
4018
- const o = new RegExp(`^${this.options.loose ? $r[ze.PRERELEASELOOSE] : $r[ze.PRERELEASE]}$`), n = `-${t}`.match(o);
4020
+ const o = new RegExp(`^${this.options.loose ? Ir[ze.PRERELEASELOOSE] : Ir[ze.PRERELEASE]}$`), n = `-${t}`.match(o);
4019
4021
  if (!n || n[1] !== t)
4020
4022
  throw new Error(`invalid identifier: ${t}`);
4021
4023
  }
@@ -4073,43 +4075,43 @@ let Yi = class oe {
4073
4075
  return this.raw = this.format(), this.build.length && (this.raw += `+${this.build.join(".")}`), this;
4074
4076
  }
4075
4077
  };
4076
- var q = Yi;
4077
- const Ir = q, Qi = (s, e, t = !1) => {
4078
- if (s instanceof Ir)
4078
+ var q = ea;
4079
+ const Fr = q, ta = (s, e, t = !1) => {
4080
+ if (s instanceof Fr)
4079
4081
  return s;
4080
4082
  try {
4081
- return new Ir(s, e);
4083
+ return new Fr(s, e);
4082
4084
  } catch (r) {
4083
4085
  if (!t)
4084
4086
  return null;
4085
4087
  throw r;
4086
4088
  }
4087
4089
  };
4088
- var Ce = Qi;
4089
- const Zi = Ce, ea = (s, e) => {
4090
- const t = Zi(s, e);
4091
- return t ? t.version : null;
4092
- };
4093
- var ta = ea;
4090
+ var Ce = ta;
4094
4091
  const ra = Ce, sa = (s, e) => {
4095
- const t = ra(s.trim().replace(/^[=v]+/, ""), e);
4092
+ const t = ra(s, e);
4096
4093
  return t ? t.version : null;
4097
4094
  };
4098
4095
  var oa = sa;
4099
- const Fr = q, na = (s, e, t, r, o) => {
4096
+ const na = Ce, ia = (s, e) => {
4097
+ const t = na(s.trim().replace(/^[=v]+/, ""), e);
4098
+ return t ? t.version : null;
4099
+ };
4100
+ var aa = ia;
4101
+ const Ar = q, ca = (s, e, t, r, o) => {
4100
4102
  typeof t == "string" && (o = r, r = t, t = void 0);
4101
4103
  try {
4102
- return new Fr(
4103
- s instanceof Fr ? s.version : s,
4104
+ return new Ar(
4105
+ s instanceof Ar ? s.version : s,
4104
4106
  t
4105
4107
  ).inc(e, r, o).version;
4106
4108
  } catch {
4107
4109
  return null;
4108
4110
  }
4109
4111
  };
4110
- var ia = na;
4111
- const Ar = Ce, aa = (s, e) => {
4112
- const t = Ar(s, null, !0), r = Ar(e, null, !0), o = t.compare(r);
4112
+ var la = ca;
4113
+ const Tr = Ce, ua = (s, e) => {
4114
+ const t = Tr(s, null, !0), r = Tr(e, null, !0), o = t.compare(r);
4113
4115
  if (o === 0)
4114
4116
  return null;
4115
4117
  const n = o > 0, i = n ? t : r, a = n ? r : t, c = !!i.prerelease.length;
@@ -4122,46 +4124,46 @@ const Ar = Ce, aa = (s, e) => {
4122
4124
  const l = c ? "pre" : "";
4123
4125
  return t.major !== r.major ? l + "major" : t.minor !== r.minor ? l + "minor" : t.patch !== r.patch ? l + "patch" : "prerelease";
4124
4126
  };
4125
- var ca = aa;
4126
- const la = q, ua = (s, e) => new la(s, e).major;
4127
4127
  var da = ua;
4128
- const pa = q, fa = (s, e) => new pa(s, e).minor;
4128
+ const pa = q, fa = (s, e) => new pa(s, e).major;
4129
4129
  var ha = fa;
4130
- const ga = q, ma = (s, e) => new ga(s, e).patch;
4130
+ const ga = q, ma = (s, e) => new ga(s, e).minor;
4131
4131
  var va = ma;
4132
- const ya = Ce, wa = (s, e) => {
4133
- const t = ya(s, e);
4132
+ const ya = q, wa = (s, e) => new ya(s, e).patch;
4133
+ var Sa = wa;
4134
+ const ba = Ce, Ra = (s, e) => {
4135
+ const t = ba(s, e);
4134
4136
  return t && t.prerelease.length ? t.prerelease : null;
4135
4137
  };
4136
- var Sa = wa;
4137
- const Tr = q, ba = (s, e, t) => new Tr(s, t).compare(new Tr(e, t));
4138
- var te = ba;
4139
- const Ra = te, Ea = (s, e, t) => Ra(e, s, t);
4140
- var Ca = Ea;
4141
- const ka = te, Pa = (s, e) => ka(s, e, !0);
4138
+ var Ea = Ra;
4139
+ const Lr = q, Ca = (s, e, t) => new Lr(s, t).compare(new Lr(e, t));
4140
+ var te = Ca;
4141
+ const ka = te, Pa = (s, e, t) => ka(e, s, t);
4142
4142
  var Oa = Pa;
4143
- const Lr = q, $a = (s, e, t) => {
4144
- const r = new Lr(s, t), o = new Lr(e, t);
4143
+ const $a = te, Ia = (s, e) => $a(s, e, !0);
4144
+ var Fa = Ia;
4145
+ const Dr = q, Aa = (s, e, t) => {
4146
+ const r = new Dr(s, t), o = new Dr(e, t);
4145
4147
  return r.compare(o) || r.compareBuild(o);
4146
4148
  };
4147
- var _t = $a;
4148
- const Ia = _t, Fa = (s, e) => s.sort((t, r) => Ia(t, r, e));
4149
- var Aa = Fa;
4150
- const Ta = _t, La = (s, e) => s.sort((t, r) => Ta(r, t, e));
4149
+ var _t = Aa;
4150
+ const Ta = _t, La = (s, e) => s.sort((t, r) => Ta(t, r, e));
4151
4151
  var Da = La;
4152
- const Na = te, Ba = (s, e, t) => Na(s, e, t) > 0;
4153
- var lt = Ba;
4154
- const ja = te, xa = (s, e, t) => ja(s, e, t) < 0;
4155
- var Kt = xa;
4156
- const Va = te, Ua = (s, e, t) => Va(s, e, t) === 0;
4157
- var Ls = Ua;
4158
- const Ga = te, Ja = (s, e, t) => Ga(s, e, t) !== 0;
4159
- var Ds = Ja;
4160
- const Ma = te, _a = (s, e, t) => Ma(s, e, t) >= 0;
4161
- var Ht = _a;
4162
- const Ka = te, Ha = (s, e, t) => Ka(s, e, t) <= 0;
4163
- var Wt = Ha;
4164
- const Wa = Ls, qa = Ds, za = lt, Xa = Ht, Ya = Kt, Qa = Wt, Za = (s, e, t, r) => {
4152
+ const Na = _t, Ba = (s, e) => s.sort((t, r) => Na(r, t, e));
4153
+ var ja = Ba;
4154
+ const xa = te, Va = (s, e, t) => xa(s, e, t) > 0;
4155
+ var lt = Va;
4156
+ const Ua = te, Ga = (s, e, t) => Ua(s, e, t) < 0;
4157
+ var Kt = Ga;
4158
+ const Ja = te, Ma = (s, e, t) => Ja(s, e, t) === 0;
4159
+ var Ds = Ma;
4160
+ const _a = te, Ka = (s, e, t) => _a(s, e, t) !== 0;
4161
+ var Ns = Ka;
4162
+ const Ha = te, Wa = (s, e, t) => Ha(s, e, t) >= 0;
4163
+ var Ht = Wa;
4164
+ const qa = te, za = (s, e, t) => qa(s, e, t) <= 0;
4165
+ var Wt = za;
4166
+ const Xa = Ds, Ya = Ns, Qa = lt, Za = Ht, ec = Kt, tc = Wt, rc = (s, e, t, r) => {
4165
4167
  switch (e) {
4166
4168
  case "===":
4167
4169
  return typeof s == "object" && (s = s.version), typeof t == "object" && (t = t.version), s === t;
@@ -4170,24 +4172,24 @@ const Wa = Ls, qa = Ds, za = lt, Xa = Ht, Ya = Kt, Qa = Wt, Za = (s, e, t, r) =>
4170
4172
  case "":
4171
4173
  case "=":
4172
4174
  case "==":
4173
- return Wa(s, t, r);
4175
+ return Xa(s, t, r);
4174
4176
  case "!=":
4175
- return qa(s, t, r);
4177
+ return Ya(s, t, r);
4176
4178
  case ">":
4177
- return za(s, t, r);
4179
+ return Qa(s, t, r);
4178
4180
  case ">=":
4179
- return Xa(s, t, r);
4181
+ return Za(s, t, r);
4180
4182
  case "<":
4181
- return Ya(s, t, r);
4183
+ return ec(s, t, r);
4182
4184
  case "<=":
4183
- return Qa(s, t, r);
4185
+ return tc(s, t, r);
4184
4186
  default:
4185
4187
  throw new TypeError(`Invalid operator: ${e}`);
4186
4188
  }
4187
4189
  };
4188
- var Ns = Za;
4189
- const ec = q, tc = Ce, { safeRe: Xe, t: Ye } = Ve, rc = (s, e) => {
4190
- if (s instanceof ec)
4190
+ var Bs = rc;
4191
+ const sc = q, oc = Ce, { safeRe: Xe, t: Ye } = Ve, nc = (s, e) => {
4192
+ if (s instanceof sc)
4191
4193
  return s;
4192
4194
  if (typeof s == "number" && (s = String(s)), typeof s != "string")
4193
4195
  return null;
@@ -4205,10 +4207,10 @@ const ec = q, tc = Ce, { safeRe: Xe, t: Ye } = Ve, rc = (s, e) => {
4205
4207
  if (t === null)
4206
4208
  return null;
4207
4209
  const r = t[2], o = t[3] || "0", n = t[4] || "0", i = e.includePrerelease && t[5] ? `-${t[5]}` : "", a = e.includePrerelease && t[6] ? `+${t[6]}` : "";
4208
- return tc(`${r}.${o}.${n}${i}${a}`, e);
4210
+ return oc(`${r}.${o}.${n}${i}${a}`, e);
4209
4211
  };
4210
- var sc = rc;
4211
- class oc {
4212
+ var ic = nc;
4213
+ class ac {
4212
4214
  constructor() {
4213
4215
  this.max = 1e3, this.map = /* @__PURE__ */ new Map();
4214
4216
  }
@@ -4231,10 +4233,10 @@ class oc {
4231
4233
  return this;
4232
4234
  }
4233
4235
  }
4234
- var nc = oc, gt, Dr;
4236
+ var cc = ac, gt, Nr;
4235
4237
  function re() {
4236
- if (Dr) return gt;
4237
- Dr = 1;
4238
+ if (Nr) return gt;
4239
+ Nr = 1;
4238
4240
  const s = /\s+/g;
4239
4241
  class e {
4240
4242
  constructor(p, m) {
@@ -4280,10 +4282,10 @@ function re() {
4280
4282
  const y = ((this.options.includePrerelease && h) | (this.options.loose && R)) + ":" + p, b = r.get(y);
4281
4283
  if (b)
4282
4284
  return b;
4283
- const S = this.options.loose, E = S ? c[u.HYPHENRANGELOOSE] : c[u.HYPHENRANGE];
4285
+ const w = this.options.loose, E = w ? c[u.HYPHENRANGELOOSE] : c[u.HYPHENRANGE];
4284
4286
  p = p.replace(E, D(this.options.includePrerelease)), i("hyphen replace", p), p = p.replace(c[u.COMPARATORTRIM], l), i("comparator trim", p), p = p.replace(c[u.TILDETRIM], d), i("tilde trim", p), p = p.replace(c[u.CARETTRIM], f), i("caret trim", p);
4285
4287
  let O = p.split(" ").map((I) => B(I, this.options)).join(" ").split(/\s+/).map((I) => Y(I, this.options));
4286
- S && (O = O.filter((I) => (i("loose invalid filter", I, this.options), !!I.match(c[u.COMPARATORLOOSE])))), i("range list", O);
4288
+ w && (O = O.filter((I) => (i("loose invalid filter", I, this.options), !!I.match(c[u.COMPARATORLOOSE])))), i("range list", O);
4287
4289
  const C = /* @__PURE__ */ new Map(), F = O.map((I) => new n(I, this.options));
4288
4290
  for (const I of F) {
4289
4291
  if (g(I))
@@ -4297,7 +4299,7 @@ function re() {
4297
4299
  intersects(p, m) {
4298
4300
  if (!(p instanceof e))
4299
4301
  throw new TypeError("a Range is required");
4300
- return this.set.some((y) => T(y, m) && p.set.some((b) => T(b, m) && y.every((S) => b.every((E) => S.intersects(E, m)))));
4302
+ return this.set.some((y) => T(y, m) && p.set.some((b) => T(b, m) && y.every((w) => b.every((E) => w.intersects(E, m)))));
4301
4303
  }
4302
4304
  // if ANY of the sets match ALL of its comparators, then pass
4303
4305
  test(p) {
@@ -4316,7 +4318,7 @@ function re() {
4316
4318
  }
4317
4319
  }
4318
4320
  gt = e;
4319
- const t = nc, r = new t(), o = Mt, n = ut(), i = ct, a = q, {
4321
+ const t = cc, r = new t(), o = Mt, n = ut(), i = ct, a = q, {
4320
4322
  safeRe: c,
4321
4323
  t: u,
4322
4324
  comparatorTrimReplace: l,
@@ -4327,32 +4329,32 @@ function re() {
4327
4329
  const y = v.slice();
4328
4330
  let b = y.pop();
4329
4331
  for (; m && y.length; )
4330
- m = y.every((S) => b.intersects(S, p)), b = y.pop();
4332
+ m = y.every((w) => b.intersects(w, p)), b = y.pop();
4331
4333
  return m;
4332
4334
  }, B = (v, p) => (i("comp", v, p), v = L(v, p), i("caret", v), v = M(v, p), i("tildes", v), v = ce(v, p), i("xrange", v), v = ie(v, p), i("stars", v), v), $ = (v) => !v || v.toLowerCase() === "x" || v === "*", M = (v, p) => v.trim().split(/\s+/).map((m) => ge(m, p)).join(" "), ge = (v, p) => {
4333
4335
  const m = p.loose ? c[u.TILDELOOSE] : c[u.TILDE];
4334
- return v.replace(m, (y, b, S, E, O) => {
4335
- i("tilde", v, y, b, S, E, O);
4336
+ return v.replace(m, (y, b, w, E, O) => {
4337
+ i("tilde", v, y, b, w, E, O);
4336
4338
  let C;
4337
- return $(b) ? C = "" : $(S) ? C = `>=${b}.0.0 <${+b + 1}.0.0-0` : $(E) ? C = `>=${b}.${S}.0 <${b}.${+S + 1}.0-0` : O ? (i("replaceTilde pr", O), C = `>=${b}.${S}.${E}-${O} <${b}.${+S + 1}.0-0`) : C = `>=${b}.${S}.${E} <${b}.${+S + 1}.0-0`, i("tilde return", C), C;
4339
+ return $(b) ? C = "" : $(w) ? C = `>=${b}.0.0 <${+b + 1}.0.0-0` : $(E) ? C = `>=${b}.${w}.0 <${b}.${+w + 1}.0-0` : O ? (i("replaceTilde pr", O), C = `>=${b}.${w}.${E}-${O} <${b}.${+w + 1}.0-0`) : C = `>=${b}.${w}.${E} <${b}.${+w + 1}.0-0`, i("tilde return", C), C;
4338
4340
  });
4339
4341
  }, L = (v, p) => v.trim().split(/\s+/).map((m) => se(m, p)).join(" "), se = (v, p) => {
4340
4342
  i("caret", v, p);
4341
4343
  const m = p.loose ? c[u.CARETLOOSE] : c[u.CARET], y = p.includePrerelease ? "-0" : "";
4342
- return v.replace(m, (b, S, E, O, C) => {
4343
- i("caret", v, b, S, E, O, C);
4344
+ return v.replace(m, (b, w, E, O, C) => {
4345
+ i("caret", v, b, w, E, O, C);
4344
4346
  let F;
4345
- return $(S) ? F = "" : $(E) ? F = `>=${S}.0.0${y} <${+S + 1}.0.0-0` : $(O) ? S === "0" ? F = `>=${S}.${E}.0${y} <${S}.${+E + 1}.0-0` : F = `>=${S}.${E}.0${y} <${+S + 1}.0.0-0` : C ? (i("replaceCaret pr", C), S === "0" ? E === "0" ? F = `>=${S}.${E}.${O}-${C} <${S}.${E}.${+O + 1}-0` : F = `>=${S}.${E}.${O}-${C} <${S}.${+E + 1}.0-0` : F = `>=${S}.${E}.${O}-${C} <${+S + 1}.0.0-0`) : (i("no pr"), S === "0" ? E === "0" ? F = `>=${S}.${E}.${O}${y} <${S}.${E}.${+O + 1}-0` : F = `>=${S}.${E}.${O}${y} <${S}.${+E + 1}.0-0` : F = `>=${S}.${E}.${O} <${+S + 1}.0.0-0`), i("caret return", F), F;
4347
+ return $(w) ? F = "" : $(E) ? F = `>=${w}.0.0${y} <${+w + 1}.0.0-0` : $(O) ? w === "0" ? F = `>=${w}.${E}.0${y} <${w}.${+E + 1}.0-0` : F = `>=${w}.${E}.0${y} <${+w + 1}.0.0-0` : C ? (i("replaceCaret pr", C), w === "0" ? E === "0" ? F = `>=${w}.${E}.${O}-${C} <${w}.${E}.${+O + 1}-0` : F = `>=${w}.${E}.${O}-${C} <${w}.${+E + 1}.0-0` : F = `>=${w}.${E}.${O}-${C} <${+w + 1}.0.0-0`) : (i("no pr"), w === "0" ? E === "0" ? F = `>=${w}.${E}.${O}${y} <${w}.${E}.${+O + 1}-0` : F = `>=${w}.${E}.${O}${y} <${w}.${+E + 1}.0-0` : F = `>=${w}.${E}.${O} <${+w + 1}.0.0-0`), i("caret return", F), F;
4346
4348
  });
4347
4349
  }, ce = (v, p) => (i("replaceXRanges", v, p), v.split(/\s+/).map((m) => z(m, p)).join(" ")), z = (v, p) => {
4348
4350
  v = v.trim();
4349
4351
  const m = p.loose ? c[u.XRANGELOOSE] : c[u.XRANGE];
4350
- return v.replace(m, (y, b, S, E, O, C) => {
4351
- i("xRange", v, y, b, S, E, O, C);
4352
- const F = $(S), V = F || $(E), I = V || $(O), ae = I;
4353
- return b === "=" && ae && (b = ""), C = p.includePrerelease ? "-0" : "", F ? b === ">" || b === "<" ? y = "<0.0.0-0" : y = "*" : b && ae ? (V && (E = 0), O = 0, b === ">" ? (b = ">=", V ? (S = +S + 1, E = 0, O = 0) : (E = +E + 1, O = 0)) : b === "<=" && (b = "<", V ? S = +S + 1 : E = +E + 1), b === "<" && (C = "-0"), y = `${b + S}.${E}.${O}${C}`) : V ? y = `>=${S}.0.0${C} <${+S + 1}.0.0-0` : I && (y = `>=${S}.${E}.0${C} <${S}.${+E + 1}.0-0`), i("xRange return", y), y;
4352
+ return v.replace(m, (y, b, w, E, O, C) => {
4353
+ i("xRange", v, y, b, w, E, O, C);
4354
+ const F = $(w), V = F || $(E), I = V || $(O), ae = I;
4355
+ return b === "=" && ae && (b = ""), C = p.includePrerelease ? "-0" : "", F ? b === ">" || b === "<" ? y = "<0.0.0-0" : y = "*" : b && ae ? (V && (E = 0), O = 0, b === ">" ? (b = ">=", V ? (w = +w + 1, E = 0, O = 0) : (E = +E + 1, O = 0)) : b === "<=" && (b = "<", V ? w = +w + 1 : E = +E + 1), b === "<" && (C = "-0"), y = `${b + w}.${E}.${O}${C}`) : V ? y = `>=${w}.0.0${C} <${+w + 1}.0.0-0` : I && (y = `>=${w}.${E}.0${C} <${w}.${+E + 1}.0-0`), i("xRange return", y), y;
4354
4356
  });
4355
- }, ie = (v, p) => (i("replaceStars", v, p), v.trim().replace(c[u.STAR], "")), Y = (v, p) => (i("replaceGTE0", v, p), v.trim().replace(c[p.includePrerelease ? u.GTE0PRE : u.GTE0], "")), D = (v) => (p, m, y, b, S, E, O, C, F, V, I, ae) => ($(y) ? m = "" : $(b) ? m = `>=${y}.0.0${v ? "-0" : ""}` : $(S) ? m = `>=${y}.${b}.0${v ? "-0" : ""}` : E ? m = `>=${m}` : m = `>=${m}${v ? "-0" : ""}`, $(F) ? C = "" : $(V) ? C = `<${+F + 1}.0.0-0` : $(I) ? C = `<${F}.${+V + 1}.0-0` : ae ? C = `<=${F}.${V}.${I}-${ae}` : v ? C = `<${F}.${V}.${+I + 1}-0` : C = `<=${C}`, `${m} ${C}`.trim()), W = (v, p, m) => {
4357
+ }, ie = (v, p) => (i("replaceStars", v, p), v.trim().replace(c[u.STAR], "")), Y = (v, p) => (i("replaceGTE0", v, p), v.trim().replace(c[p.includePrerelease ? u.GTE0PRE : u.GTE0], "")), D = (v) => (p, m, y, b, w, E, O, C, F, V, I, ae) => ($(y) ? m = "" : $(b) ? m = `>=${y}.0.0${v ? "-0" : ""}` : $(w) ? m = `>=${y}.${b}.0${v ? "-0" : ""}` : E ? m = `>=${m}` : m = `>=${m}${v ? "-0" : ""}`, $(F) ? C = "" : $(V) ? C = `<${+F + 1}.0.0-0` : $(I) ? C = `<${F}.${+V + 1}.0-0` : ae ? C = `<=${F}.${V}.${I}-${ae}` : v ? C = `<${F}.${V}.${+I + 1}-0` : C = `<=${C}`, `${m} ${C}`.trim()), W = (v, p, m) => {
4356
4358
  for (let y = 0; y < v.length; y++)
4357
4359
  if (!v[y].test(p))
4358
4360
  return !1;
@@ -4369,10 +4371,10 @@ function re() {
4369
4371
  };
4370
4372
  return gt;
4371
4373
  }
4372
- var mt, Nr;
4374
+ var mt, Br;
4373
4375
  function ut() {
4374
- if (Nr) return mt;
4375
- Nr = 1;
4376
+ if (Br) return mt;
4377
+ Br = 1;
4376
4378
  const s = Symbol("SemVer ANY");
4377
4379
  class e {
4378
4380
  static get ANY() {
@@ -4413,46 +4415,46 @@ function ut() {
4413
4415
  }
4414
4416
  }
4415
4417
  mt = e;
4416
- const t = Mt, { safeRe: r, t: o } = Ve, n = Ns, i = ct, a = q, c = re();
4418
+ const t = Mt, { safeRe: r, t: o } = Ve, n = Bs, i = ct, a = q, c = re();
4417
4419
  return mt;
4418
4420
  }
4419
- const ic = re(), ac = (s, e, t) => {
4421
+ const lc = re(), uc = (s, e, t) => {
4420
4422
  try {
4421
- e = new ic(e, t);
4423
+ e = new lc(e, t);
4422
4424
  } catch {
4423
4425
  return !1;
4424
4426
  }
4425
4427
  return e.test(s);
4426
4428
  };
4427
- var dt = ac;
4428
- const cc = re(), lc = (s, e) => new cc(s, e).set.map((t) => t.map((r) => r.value).join(" ").trim().split(" "));
4429
- var uc = lc;
4430
- const dc = q, pc = re(), fc = (s, e, t) => {
4429
+ var dt = uc;
4430
+ const dc = re(), pc = (s, e) => new dc(s, e).set.map((t) => t.map((r) => r.value).join(" ").trim().split(" "));
4431
+ var fc = pc;
4432
+ const hc = q, gc = re(), mc = (s, e, t) => {
4431
4433
  let r = null, o = null, n = null;
4432
4434
  try {
4433
- n = new pc(e, t);
4435
+ n = new gc(e, t);
4434
4436
  } catch {
4435
4437
  return null;
4436
4438
  }
4437
4439
  return s.forEach((i) => {
4438
- n.test(i) && (!r || o.compare(i) === -1) && (r = i, o = new dc(r, t));
4440
+ n.test(i) && (!r || o.compare(i) === -1) && (r = i, o = new hc(r, t));
4439
4441
  }), r;
4440
4442
  };
4441
- var hc = fc;
4442
- const gc = q, mc = re(), vc = (s, e, t) => {
4443
+ var vc = mc;
4444
+ const yc = q, wc = re(), Sc = (s, e, t) => {
4443
4445
  let r = null, o = null, n = null;
4444
4446
  try {
4445
- n = new mc(e, t);
4447
+ n = new wc(e, t);
4446
4448
  } catch {
4447
4449
  return null;
4448
4450
  }
4449
4451
  return s.forEach((i) => {
4450
- n.test(i) && (!r || o.compare(i) === 1) && (r = i, o = new gc(r, t));
4452
+ n.test(i) && (!r || o.compare(i) === 1) && (r = i, o = new yc(r, t));
4451
4453
  }), r;
4452
4454
  };
4453
- var yc = vc;
4454
- const vt = q, wc = re(), Br = lt, Sc = (s, e) => {
4455
- s = new wc(s, e);
4455
+ var bc = Sc;
4456
+ const vt = q, Rc = re(), jr = lt, Ec = (s, e) => {
4457
+ s = new Rc(s, e);
4456
4458
  let t = new vt("0.0.0");
4457
4459
  if (s.test(t) || (t = new vt("0.0.0-0"), s.test(t)))
4458
4460
  return t;
@@ -4467,7 +4469,7 @@ const vt = q, wc = re(), Br = lt, Sc = (s, e) => {
4467
4469
  a.prerelease.length === 0 ? a.patch++ : a.prerelease.push(0), a.raw = a.format();
4468
4470
  case "":
4469
4471
  case ">=":
4470
- (!n || Br(a, n)) && (n = a);
4472
+ (!n || jr(a, n)) && (n = a);
4471
4473
  break;
4472
4474
  case "<":
4473
4475
  case "<=":
@@ -4475,39 +4477,39 @@ const vt = q, wc = re(), Br = lt, Sc = (s, e) => {
4475
4477
  default:
4476
4478
  throw new Error(`Unexpected operation: ${i.operator}`);
4477
4479
  }
4478
- }), n && (!t || Br(t, n)) && (t = n);
4480
+ }), n && (!t || jr(t, n)) && (t = n);
4479
4481
  }
4480
4482
  return t && s.test(t) ? t : null;
4481
4483
  };
4482
- var bc = Sc;
4483
- const Rc = re(), Ec = (s, e) => {
4484
+ var Cc = Ec;
4485
+ const kc = re(), Pc = (s, e) => {
4484
4486
  try {
4485
- return new Rc(s, e).range || "*";
4487
+ return new kc(s, e).range || "*";
4486
4488
  } catch {
4487
4489
  return null;
4488
4490
  }
4489
4491
  };
4490
- var Cc = Ec;
4491
- const kc = q, Bs = ut(), { ANY: Pc } = Bs, Oc = re(), $c = dt, jr = lt, xr = Kt, Ic = Wt, Fc = Ht, Ac = (s, e, t, r) => {
4492
- s = new kc(s, r), e = new Oc(e, r);
4492
+ var Oc = Pc;
4493
+ const $c = q, js = ut(), { ANY: Ic } = js, Fc = re(), Ac = dt, xr = lt, Vr = Kt, Tc = Wt, Lc = Ht, Dc = (s, e, t, r) => {
4494
+ s = new $c(s, r), e = new Fc(e, r);
4493
4495
  let o, n, i, a, c;
4494
4496
  switch (t) {
4495
4497
  case ">":
4496
- o = jr, n = Ic, i = xr, a = ">", c = ">=";
4498
+ o = xr, n = Tc, i = Vr, a = ">", c = ">=";
4497
4499
  break;
4498
4500
  case "<":
4499
- o = xr, n = Fc, i = jr, a = "<", c = "<=";
4501
+ o = Vr, n = Lc, i = xr, a = "<", c = "<=";
4500
4502
  break;
4501
4503
  default:
4502
4504
  throw new TypeError('Must provide a hilo val of "<" or ">"');
4503
4505
  }
4504
- if ($c(s, e, r))
4506
+ if (Ac(s, e, r))
4505
4507
  return !1;
4506
4508
  for (let u = 0; u < e.set.length; ++u) {
4507
4509
  const l = e.set[u];
4508
4510
  let d = null, f = null;
4509
4511
  if (l.forEach((h) => {
4510
- h.semver === Pc && (h = new Bs(">=0.0.0")), d = d || h, f = f || h, o(h.semver, d.semver, r) ? d = h : i(h.semver, f.semver, r) && (f = h);
4512
+ h.semver === Ic && (h = new js(">=0.0.0")), d = d || h, f = f || h, o(h.semver, d.semver, r) ? d = h : i(h.semver, f.semver, r) && (f = h);
4511
4513
  }), d.operator === a || d.operator === c || (!f.operator || f.operator === a) && n(s, f.semver))
4512
4514
  return !1;
4513
4515
  if (f.operator === c && i(s, f.semver))
@@ -4515,20 +4517,20 @@ const kc = q, Bs = ut(), { ANY: Pc } = Bs, Oc = re(), $c = dt, jr = lt, xr = Kt,
4515
4517
  }
4516
4518
  return !0;
4517
4519
  };
4518
- var qt = Ac;
4519
- const Tc = qt, Lc = (s, e, t) => Tc(s, e, ">", t);
4520
- var Dc = Lc;
4521
- const Nc = qt, Bc = (s, e, t) => Nc(s, e, "<", t);
4520
+ var qt = Dc;
4521
+ const Nc = qt, Bc = (s, e, t) => Nc(s, e, ">", t);
4522
4522
  var jc = Bc;
4523
- const Vr = re(), xc = (s, e, t) => (s = new Vr(s, t), e = new Vr(e, t), s.intersects(e, t));
4524
- var Vc = xc;
4525
- const Uc = dt, Gc = te;
4526
- var Jc = (s, e, t) => {
4523
+ const xc = qt, Vc = (s, e, t) => xc(s, e, "<", t);
4524
+ var Uc = Vc;
4525
+ const Ur = re(), Gc = (s, e, t) => (s = new Ur(s, t), e = new Ur(e, t), s.intersects(e, t));
4526
+ var Jc = Gc;
4527
+ const Mc = dt, _c = te;
4528
+ var Kc = (s, e, t) => {
4527
4529
  const r = [];
4528
4530
  let o = null, n = null;
4529
- const i = s.sort((l, d) => Gc(l, d, t));
4531
+ const i = s.sort((l, d) => _c(l, d, t));
4530
4532
  for (const l of i)
4531
- Uc(l, e, t) ? (n = l, o || (o = l)) : (n && r.push([o, n]), n = null, o = null);
4533
+ Mc(l, e, t) ? (n = l, o || (o = l)) : (n && r.push([o, n]), n = null, o = null);
4532
4534
  o && r.push([o, null]);
4533
4535
  const a = [];
4534
4536
  for (const [l, d] of r)
@@ -4536,14 +4538,14 @@ var Jc = (s, e, t) => {
4536
4538
  const c = a.join(" || "), u = typeof e.raw == "string" ? e.raw : String(e);
4537
4539
  return c.length < u.length ? c : e;
4538
4540
  };
4539
- const Ur = re(), zt = ut(), { ANY: yt } = zt, Pe = dt, Xt = te, Mc = (s, e, t = {}) => {
4541
+ const Gr = re(), zt = ut(), { ANY: yt } = zt, Pe = dt, Xt = te, Hc = (s, e, t = {}) => {
4540
4542
  if (s === e)
4541
4543
  return !0;
4542
- s = new Ur(s, t), e = new Ur(e, t);
4544
+ s = new Gr(s, t), e = new Gr(e, t);
4543
4545
  let r = !1;
4544
4546
  e: for (const o of s.set) {
4545
4547
  for (const n of e.set) {
4546
- const i = Kc(o, n, t);
4548
+ const i = qc(o, n, t);
4547
4549
  if (r = r || i !== null, i)
4548
4550
  continue e;
4549
4551
  }
@@ -4551,23 +4553,23 @@ const Ur = re(), zt = ut(), { ANY: yt } = zt, Pe = dt, Xt = te, Mc = (s, e, t =
4551
4553
  return !1;
4552
4554
  }
4553
4555
  return !0;
4554
- }, _c = [new zt(">=0.0.0-0")], Gr = [new zt(">=0.0.0")], Kc = (s, e, t) => {
4556
+ }, Wc = [new zt(">=0.0.0-0")], Jr = [new zt(">=0.0.0")], qc = (s, e, t) => {
4555
4557
  if (s === e)
4556
4558
  return !0;
4557
4559
  if (s.length === 1 && s[0].semver === yt) {
4558
4560
  if (e.length === 1 && e[0].semver === yt)
4559
4561
  return !0;
4560
- t.includePrerelease ? s = _c : s = Gr;
4562
+ t.includePrerelease ? s = Wc : s = Jr;
4561
4563
  }
4562
4564
  if (e.length === 1 && e[0].semver === yt) {
4563
4565
  if (t.includePrerelease)
4564
4566
  return !0;
4565
- e = Gr;
4567
+ e = Jr;
4566
4568
  }
4567
4569
  const r = /* @__PURE__ */ new Set();
4568
4570
  let o, n;
4569
4571
  for (const h of s)
4570
- h.operator === ">" || h.operator === ">=" ? o = Jr(o, h, t) : h.operator === "<" || h.operator === "<=" ? n = Mr(n, h, t) : r.add(h.semver);
4572
+ h.operator === ">" || h.operator === ">=" ? o = Mr(o, h, t) : h.operator === "<" || h.operator === "<=" ? n = _r(n, h, t) : r.add(h.semver);
4571
4573
  if (r.size > 1)
4572
4574
  return null;
4573
4575
  let i;
@@ -4590,14 +4592,14 @@ const Ur = re(), zt = ut(), { ANY: yt } = zt, Pe = dt, Xt = te, Mc = (s, e, t =
4590
4592
  for (const h of e) {
4591
4593
  if (l = l || h.operator === ">" || h.operator === ">=", u = u || h.operator === "<" || h.operator === "<=", o) {
4592
4594
  if (f && h.semver.prerelease && h.semver.prerelease.length && h.semver.major === f.major && h.semver.minor === f.minor && h.semver.patch === f.patch && (f = !1), h.operator === ">" || h.operator === ">=") {
4593
- if (a = Jr(o, h, t), a === h && a !== o)
4595
+ if (a = Mr(o, h, t), a === h && a !== o)
4594
4596
  return !1;
4595
4597
  } else if (o.operator === ">=" && !Pe(o.semver, String(h), t))
4596
4598
  return !1;
4597
4599
  }
4598
4600
  if (n) {
4599
4601
  if (d && h.semver.prerelease && h.semver.prerelease.length && h.semver.major === d.major && h.semver.minor === d.minor && h.semver.patch === d.patch && (d = !1), h.operator === "<" || h.operator === "<=") {
4600
- if (c = Mr(n, h, t), c === h && c !== n)
4602
+ if (c = _r(n, h, t), c === h && c !== n)
4601
4603
  return !1;
4602
4604
  } else if (n.operator === "<=" && !Pe(n.semver, String(h), t))
4603
4605
  return !1;
@@ -4606,74 +4608,74 @@ const Ur = re(), zt = ut(), { ANY: yt } = zt, Pe = dt, Xt = te, Mc = (s, e, t =
4606
4608
  return !1;
4607
4609
  }
4608
4610
  return !(o && u && !n && i !== 0 || n && l && !o && i !== 0 || f || d);
4609
- }, Jr = (s, e, t) => {
4611
+ }, Mr = (s, e, t) => {
4610
4612
  if (!s)
4611
4613
  return e;
4612
4614
  const r = Xt(s.semver, e.semver, t);
4613
4615
  return r > 0 ? s : r < 0 || e.operator === ">" && s.operator === ">=" ? e : s;
4614
- }, Mr = (s, e, t) => {
4616
+ }, _r = (s, e, t) => {
4615
4617
  if (!s)
4616
4618
  return e;
4617
4619
  const r = Xt(s.semver, e.semver, t);
4618
4620
  return r < 0 ? s : r > 0 || e.operator === "<" && s.operator === "<=" ? e : s;
4619
4621
  };
4620
- var Hc = Mc;
4621
- const wt = Ve, _r = at, Wc = q, Kr = Ts, qc = Ce, zc = ta, Xc = oa, Yc = ia, Qc = ca, Zc = da, el = ha, tl = va, rl = Sa, sl = te, ol = Ca, nl = Oa, il = _t, al = Aa, cl = Da, ll = lt, ul = Kt, dl = Ls, pl = Ds, fl = Ht, hl = Wt, gl = Ns, ml = sc, vl = ut(), yl = re(), wl = dt, Sl = uc, bl = hc, Rl = yc, El = bc, Cl = Cc, kl = qt, Pl = Dc, Ol = jc, $l = Vc, Il = Jc, Fl = Hc;
4622
- var Al = {
4623
- parse: qc,
4624
- valid: zc,
4625
- clean: Xc,
4626
- inc: Yc,
4627
- diff: Qc,
4628
- major: Zc,
4629
- minor: el,
4630
- patch: tl,
4631
- prerelease: rl,
4632
- compare: sl,
4633
- rcompare: ol,
4634
- compareLoose: nl,
4635
- compareBuild: il,
4636
- sort: al,
4637
- rsort: cl,
4638
- gt: ll,
4639
- lt: ul,
4640
- eq: dl,
4641
- neq: pl,
4642
- gte: fl,
4643
- lte: hl,
4644
- cmp: gl,
4645
- coerce: ml,
4646
- Comparator: vl,
4647
- Range: yl,
4648
- satisfies: wl,
4649
- toComparators: Sl,
4650
- maxSatisfying: bl,
4651
- minSatisfying: Rl,
4652
- minVersion: El,
4653
- validRange: Cl,
4654
- outside: kl,
4655
- gtr: Pl,
4656
- ltr: Ol,
4657
- intersects: $l,
4658
- simplifyRange: Il,
4659
- subset: Fl,
4660
- SemVer: Wc,
4622
+ var zc = Hc;
4623
+ const wt = Ve, Kr = at, Xc = q, Hr = Ls, Yc = Ce, Qc = oa, Zc = aa, el = la, tl = da, rl = ha, sl = va, ol = Sa, nl = Ea, il = te, al = Oa, cl = Fa, ll = _t, ul = Da, dl = ja, pl = lt, fl = Kt, hl = Ds, gl = Ns, ml = Ht, vl = Wt, yl = Bs, wl = ic, Sl = ut(), bl = re(), Rl = dt, El = fc, Cl = vc, kl = bc, Pl = Cc, Ol = Oc, $l = qt, Il = jc, Fl = Uc, Al = Jc, Tl = Kc, Ll = zc;
4624
+ var Dl = {
4625
+ parse: Yc,
4626
+ valid: Qc,
4627
+ clean: Zc,
4628
+ inc: el,
4629
+ diff: tl,
4630
+ major: rl,
4631
+ minor: sl,
4632
+ patch: ol,
4633
+ prerelease: nl,
4634
+ compare: il,
4635
+ rcompare: al,
4636
+ compareLoose: cl,
4637
+ compareBuild: ll,
4638
+ sort: ul,
4639
+ rsort: dl,
4640
+ gt: pl,
4641
+ lt: fl,
4642
+ eq: hl,
4643
+ neq: gl,
4644
+ gte: ml,
4645
+ lte: vl,
4646
+ cmp: yl,
4647
+ coerce: wl,
4648
+ Comparator: Sl,
4649
+ Range: bl,
4650
+ satisfies: Rl,
4651
+ toComparators: El,
4652
+ maxSatisfying: Cl,
4653
+ minSatisfying: kl,
4654
+ minVersion: Pl,
4655
+ validRange: Ol,
4656
+ outside: $l,
4657
+ gtr: Il,
4658
+ ltr: Fl,
4659
+ intersects: Al,
4660
+ simplifyRange: Tl,
4661
+ subset: Ll,
4662
+ SemVer: Xc,
4661
4663
  re: wt.re,
4662
4664
  src: wt.src,
4663
4665
  tokens: wt.t,
4664
- SEMVER_SPEC_VERSION: _r.SEMVER_SPEC_VERSION,
4665
- RELEASE_TYPES: _r.RELEASE_TYPES,
4666
- compareIdentifiers: Kr.compareIdentifiers,
4667
- rcompareIdentifiers: Kr.rcompareIdentifiers
4666
+ SEMVER_SPEC_VERSION: Kr.SEMVER_SPEC_VERSION,
4667
+ RELEASE_TYPES: Kr.RELEASE_TYPES,
4668
+ compareIdentifiers: Hr.compareIdentifiers,
4669
+ rcompareIdentifiers: Hr.rcompareIdentifiers
4668
4670
  };
4669
- const Tl = /* @__PURE__ */ Vi(Al), Ll = {
4671
+ const Nl = /* @__PURE__ */ Ji(Dl), Bl = {
4670
4672
  minDelay: 1500
4671
- }, Dl = "__no_updates__";
4672
- class Nl extends lo {
4673
+ }, jl = "__no_updates__";
4674
+ class xl extends fo {
4673
4675
  constructor(t, r, o = {}) {
4674
- super({ ...o, ...Ll }, r);
4675
- w(this, "http");
4676
- w(this, "preferredUpdateChannel");
4676
+ super({ ...o, ...Bl }, r);
4677
+ S(this, "http");
4678
+ S(this, "preferredUpdateChannel");
4677
4679
  this.registryProvider = t, this.http = o.http, this.preferredUpdateChannel = o.preferredUpdateChannel;
4678
4680
  }
4679
4681
  getKey(t) {
@@ -4685,7 +4687,7 @@ class Nl extends lo {
4685
4687
  case "from-registry-v2":
4686
4688
  return `from_registry_v2_${N(t)}`;
4687
4689
  default:
4688
- return Dl;
4690
+ return jl;
4689
4691
  }
4690
4692
  }
4691
4693
  async readValue(t) {
@@ -4695,7 +4697,7 @@ class Nl extends lo {
4695
4697
  switch (n.type) {
4696
4698
  case "dev-v1":
4697
4699
  try {
4698
- const i = await ns(n.folder);
4700
+ const i = await is(n.folder);
4699
4701
  return i === n.mtime ? { suggestions: [] } : { mainSuggestion: { ...n, mtime: i }, suggestions: [] };
4700
4702
  } catch (i) {
4701
4703
  return this.logger.warn(i), { suggestions: [] };
@@ -4721,7 +4723,7 @@ class Nl extends lo {
4721
4723
  else {
4722
4724
  if (await c.getLatestOverview(n.id, Fe) === void 0)
4723
4725
  return this.logger.error(
4724
- `No "any" channel record for ${Ks(n.id)}`
4726
+ `No "any" channel record for ${Hs(n.id)}`
4725
4727
  ), { suggestions: [] };
4726
4728
  u = Fe;
4727
4729
  }
@@ -4746,7 +4748,7 @@ class Nl extends lo {
4746
4748
  update: { ...n, id: { ...n.id, version: g } }
4747
4749
  }));
4748
4750
  if (d === void 0) return { suggestions: f };
4749
- if (a !== void 0 && Tl.lte(d, a))
4751
+ if (a !== void 0 && Nl.lte(d, a))
4750
4752
  return { suggestions: f };
4751
4753
  const h = {
4752
4754
  ...n,
@@ -4773,9 +4775,9 @@ class Nl extends lo {
4773
4775
  return N(t) === N(r);
4774
4776
  }
4775
4777
  }
4776
- class Hr {
4778
+ class Wr {
4777
4779
  constructor() {
4778
- w(this, "resources", /* @__PURE__ */ new Map());
4780
+ S(this, "resources", /* @__PURE__ */ new Map());
4779
4781
  }
4780
4782
  check(e) {
4781
4783
  const t = this.resources.get(e);
@@ -4814,7 +4816,7 @@ function ue() {
4814
4816
  function De(s) {
4815
4817
  return String(s.id);
4816
4818
  }
4817
- const Bl = ["Int", "Long", "Float", "Double", "String", "Bytes"];
4819
+ const Vl = ["Int", "Long", "Float", "Double", "String", "Bytes"];
4818
4820
  function St(s) {
4819
4821
  const e = [], t = [];
4820
4822
  for (const r of s)
@@ -4831,20 +4833,20 @@ function St(s) {
4831
4833
  return t;
4832
4834
  }
4833
4835
  const $e = (s, e) => typeof e == "bigint" ? e.toString() : e;
4834
- class jl {
4835
- constructor(e, t, r, o) {
4836
- w(this, "rustPFrame");
4837
- w(this, "blobIdToResource", /* @__PURE__ */ new Map());
4838
- w(this, "blobHandleComputables", /* @__PURE__ */ new Map());
4839
- w(this, "preloadBlob", async (e) => {
4836
+ class Ul {
4837
+ constructor(e, t, r, o, n) {
4838
+ S(this, "pFrame");
4839
+ S(this, "blobIdToResource", /* @__PURE__ */ new Map());
4840
+ S(this, "blobHandleComputables", /* @__PURE__ */ new Map());
4841
+ S(this, "preloadBlob", async (e) => {
4840
4842
  const t = e.map((r) => this.getOrCreateComputableForBlob(r));
4841
4843
  for (const r of t) await r.awaitStableFullValue();
4842
4844
  });
4843
- w(this, "resolveBlob", async (e) => {
4845
+ S(this, "resolveBlob", async (e) => {
4844
4846
  const t = this.getOrCreateComputableForBlob(e);
4845
4847
  return this.blobDriver.getLocalPath((await t.awaitStableValue()).handle);
4846
4848
  });
4847
- w(this, "resolveBlobContent", async (e) => {
4849
+ S(this, "resolveBlobContent", async (e) => {
4848
4850
  try {
4849
4851
  const t = this.getOrCreateComputableForBlob(e), r = this.blobDriver.getLocalPath((await t.awaitStableValue()).handle);
4850
4852
  return await this.blobContentCache.forceFetch(r);
@@ -4853,38 +4855,28 @@ class jl {
4853
4855
  throw console.log(`resolveBlobContent catched error: ${r}`), t;
4854
4856
  }
4855
4857
  });
4856
- this.blobDriver = e, this.logger = t, this.blobContentCache = r;
4857
- const n = (a, c) => {
4858
- switch (a) {
4859
- default:
4860
- case "info":
4861
- return this.logger.info(c);
4862
- case "warn":
4863
- return this.logger.warn(c);
4864
- case "error":
4865
- return this.logger.error(c);
4866
- }
4867
- };
4868
- for (const a of o)
4869
- for (const c of In(a.data))
4870
- this.blobIdToResource.set(De(c), c);
4871
- const i = [
4872
- ...new Map(o.map((a) => ({
4873
- ...a,
4874
- data: Fn(a.data, De)
4858
+ this.blobDriver = e, this.logger = t, this.spillPath = r, this.blobContentCache = o;
4859
+ const i = (c, u) => this.logger[c](u);
4860
+ for (const c of n)
4861
+ for (const u of Tn(c.data))
4862
+ this.blobIdToResource.set(De(u), u);
4863
+ const a = [
4864
+ ...new Map(n.map((c) => ({
4865
+ ...c,
4866
+ data: Ln(c.data, De)
4875
4867
  })).map(
4876
- (a) => [N(a), a]
4868
+ (c) => [N(c), c]
4877
4869
  )).values()
4878
4870
  ];
4879
4871
  try {
4880
- const a = new Fo(ue().logPFrameRequests ? n : void 0);
4881
- a.setDataSource(this);
4882
- for (const c of i)
4883
- a.addColumnSpec(c.id, c.spec), a.setColumnData(c.id, c.data);
4884
- this.rustPFrame = a;
4885
- } catch (a) {
4872
+ const c = new Lo(this.spillPath, ue().logPFrameRequests ? i : void 0);
4873
+ c.setDataSource(this);
4874
+ for (const u of a)
4875
+ c.addColumnSpec(u.id, u.spec), c.setColumnData(u.id, u.data);
4876
+ this.pFrame = c;
4877
+ } catch (c) {
4886
4878
  throw new Error(
4887
- `Rust PFrame creation failed, columns: ${JSON.stringify(i)}, error: ${a}`
4879
+ `Rust PFrame creation failed, columns: ${JSON.stringify(a)}, error: ${c}`
4888
4880
  );
4889
4881
  }
4890
4882
  }
@@ -4897,10 +4889,10 @@ class jl {
4897
4889
  }
4898
4890
  [Symbol.dispose]() {
4899
4891
  for (const e of this.blobHandleComputables.values()) e.resetState();
4900
- this.rustPFrame.dispose();
4892
+ this.pFrame.dispose();
4901
4893
  }
4902
4894
  }
4903
- class xl {
4895
+ class Gl {
4904
4896
  constructor(e) {
4905
4897
  this.table = e;
4906
4898
  }
@@ -4908,71 +4900,74 @@ class xl {
4908
4900
  this.table.then((e) => e.dispose());
4909
4901
  }
4910
4902
  }
4911
- class Vl {
4912
- constructor(e, t) {
4913
- w(this, "pFrames");
4914
- w(this, "pTables");
4915
- w(this, "blobContentCache");
4916
- this.blobDriver = e, this.logger = t;
4917
- const r = new ts({
4903
+ class Yt {
4904
+ constructor(e, t, r) {
4905
+ S(this, "pFrames");
4906
+ S(this, "pTables");
4907
+ this.blobDriver = e, this.logger = t, this.spillPath = r;
4908
+ const o = new rs({
4918
4909
  maxSize: 1e9,
4919
4910
  // 1Gb
4920
- fetchMethod: async (o) => await Zr.readFile(o),
4921
- sizeCalculation: (o) => o.length
4911
+ fetchMethod: async (n) => await es.readFile(n),
4912
+ sizeCalculation: (n) => n.length
4922
4913
  });
4923
- this.blobContentCache = r, this.pFrames = new class extends Hr {
4924
- constructor(o, n) {
4925
- super(), this.blobDriver = o, this.logger = n;
4914
+ this.pFrames = new class extends Wr {
4915
+ constructor(n, i, a) {
4916
+ super(), this.blobDriver = n, this.logger = i, this.spillPath = a;
4926
4917
  }
4927
- createNewResource(o) {
4918
+ createNewResource(n) {
4928
4919
  return ue().logPFrameRequests && t.info(
4929
- `PFrame creation (pFrameHandle = ${this.calculateParamsKey(o)}): ${JSON.stringify(o, $e)}`
4930
- ), new jl(this.blobDriver, this.logger, r, o);
4920
+ `PFrame creation (pFrameHandle = ${this.calculateParamsKey(n)}): ${JSON.stringify(n, $e)}`
4921
+ ), new Ul(this.blobDriver, this.logger, this.spillPath, o, n);
4931
4922
  }
4932
- calculateParamsKey(o) {
4933
- return Gl(o);
4923
+ calculateParamsKey(n) {
4924
+ return Ml(n);
4934
4925
  }
4935
- }(this.blobDriver, this.logger), this.pTables = new class extends Hr {
4936
- constructor(o) {
4937
- super(), this.pFrames = o;
4926
+ }(this.blobDriver, this.logger, this.spillPath), this.pTables = new class extends Wr {
4927
+ constructor(n) {
4928
+ super(), this.pFrames = n;
4938
4929
  }
4939
- createNewResource(o) {
4940
- const n = o.pFrameHandle;
4930
+ createNewResource(n) {
4931
+ const i = n.pFrameHandle;
4941
4932
  ue().logPFrameRequests && t.info(
4942
- `PTable creation (pTableHandle = ${this.calculateParamsKey(o)}): ${JSON.stringify(o, $e)}`
4933
+ `PTable creation (pTableHandle = ${this.calculateParamsKey(n)}): ${JSON.stringify(n, $e)}`
4943
4934
  );
4944
- const i = this.pFrames.getByKey(n).rustPFrame.createTable({
4945
- src: Ne(o.def.src),
4946
- filters: St(o.def.filters)
4947
- }, o.signal).then(async (a) => {
4948
- if (o.def.sorting.length === 0) return a;
4935
+ const a = this.pFrames.getByKey(i).pFrame.createTable({
4936
+ src: Ne(n.def.src),
4937
+ filters: St(n.def.filters)
4938
+ }, n.signal).then(async (c) => {
4939
+ if (n.def.sorting.length === 0) return c;
4949
4940
  try {
4950
- return await a.sort(o.def.sorting, o.signal);
4941
+ return await c.sort(n.def.sorting, n.signal);
4951
4942
  } finally {
4952
- a.dispose();
4943
+ c.dispose();
4953
4944
  }
4954
4945
  });
4955
- return new xl(i);
4946
+ return new Gl(a);
4956
4947
  }
4957
- calculateParamsKey(o) {
4958
- return Ul(o);
4948
+ calculateParamsKey(n) {
4949
+ return Jl(n);
4959
4950
  }
4960
4951
  }(this.pFrames);
4961
4952
  }
4953
+ static async init(e, t, r) {
4954
+ const o = Ys.resolve(r);
4955
+ return await eo(o), new Yt(e, t, o);
4956
+ }
4962
4957
  //
4963
4958
  // Internal / Config API Methods
4964
4959
  //
4965
4960
  createPFrame(e, t) {
4966
- const r = e.filter((n) => Bl.find((i) => i === n.spec.valueType)).map(
4961
+ const r = e.filter((n) => Vl.find((i) => i === n.spec.valueType)).map(
4967
4962
  (n) => pe(
4968
4963
  n,
4969
- (i) => co(i) ? Bn(i) : zr(i) ? Xr(i, (a) => a.resourceInfo) : jn(n.spec, i)
4964
+ (i) => po(i) ? Vn(i) : Xr(i) ? Yr(i, (a) => a.resourceInfo) : Un(n.spec, i)
4970
4965
  )
4971
4966
  ), o = this.pFrames.acquire(r);
4972
4967
  return t.addOnDestroy(o.unref), o.key;
4973
4968
  }
4974
4969
  createPTable(e, t, r) {
4975
- const o = this.createPFrame(_s(e.src), t), n = bt(e, (a) => a.id), i = this.pTables.acquire({ def: n, pFrameHandle: o, signal: r });
4970
+ const o = this.createPFrame(Ks(e.src), t), n = bt(e, (a) => a.id), i = this.pTables.acquire({ def: n, pFrameHandle: o, signal: r });
4976
4971
  return ue().logPFrameRequests && this.logger.info(
4977
4972
  `Create PTable call (pFrameHandle = ${o}; pTableHandle = ${JSON.stringify(i)}): ${JSON.stringify(
4978
4973
  bt(e, (a) => a.spec),
@@ -4996,22 +4991,22 @@ class Vl {
4996
4991
  }] : []
4997
4992
  };
4998
4993
  return {
4999
- hits: (await this.pFrames.getByKey(e).rustPFrame.findColumns(r)).hits.filter((n) => (
4994
+ hits: (await this.pFrames.getByKey(e).pFrame.findColumns(r)).hits.filter((n) => (
5000
4995
  // only exactly matching columns
5001
4996
  n.mappingVariants.length === 0 || n.mappingVariants.some((i) => i.qualifications.forHit.length === 0 && i.qualifications.forQueries.every((a) => a.length === 0))
5002
4997
  )).map((n) => n.hit)
5003
4998
  };
5004
4999
  }
5005
5000
  async getColumnSpec(e, t) {
5006
- return await this.pFrames.getByKey(e).rustPFrame.getColumnSpec(t);
5001
+ return await this.pFrames.getByKey(e).pFrame.getColumnSpec(t);
5007
5002
  }
5008
5003
  async listColumns(e) {
5009
- return await this.pFrames.getByKey(e).rustPFrame.listColumns();
5004
+ return await this.pFrames.getByKey(e).pFrame.listColumns();
5010
5005
  }
5011
5006
  async calculateTableData(e, t, r) {
5012
5007
  return ue().logPFrameRequests && this.logger.info(
5013
5008
  `Call calculateTableData, handle = ${e}, request = ${JSON.stringify(t, $e)}`
5014
- ), await this.pFrames.getByKey(e).rustPFrame.createTable({
5009
+ ), await this.pFrames.getByKey(e).pFrame.createTable({
5015
5010
  src: Ne(t.src),
5016
5011
  filters: St(t.filters)
5017
5012
  }, r).then(async (o) => {
@@ -5036,7 +5031,7 @@ class Vl {
5036
5031
  async getUniqueValues(e, t, r) {
5037
5032
  return ue().logPFrameRequests && this.logger.info(
5038
5033
  `Call getUniqueValues, handle = ${e}, request = ${JSON.stringify(t, $e)}`
5039
- ), await this.pFrames.getByKey(e).rustPFrame.getUniqueValues({
5034
+ ), await this.pFrames.getByKey(e).pFrame.getUniqueValues({
5040
5035
  ...t,
5041
5036
  filters: St(t.filters)
5042
5037
  }, r);
@@ -5084,11 +5079,11 @@ function Ne(s) {
5084
5079
  H(s);
5085
5080
  }
5086
5081
  }
5087
- function Ul(s) {
5082
+ function Jl(s) {
5088
5083
  const e = Ee("sha256");
5089
5084
  return e.update(N(s)), e.digest().toString("hex");
5090
5085
  }
5091
- function Gl(s) {
5086
+ function Ml(s) {
5092
5087
  const e = [...s].map(
5093
5088
  (r) => pe(r, (o) => {
5094
5089
  let n;
@@ -5134,38 +5129,42 @@ function Gl(s) {
5134
5129
  const t = Ee("sha256");
5135
5130
  return t.update(N(e)), t.digest().toString("hex");
5136
5131
  }
5137
- async function Jl(s, e, t) {
5132
+ async function _l(s, e, t) {
5138
5133
  const r = {
5139
- ...$s,
5140
- ...Is(e),
5134
+ ...Is,
5135
+ ...Fs(e),
5141
5136
  ...t
5142
- }, o = new Qr(r.localSecret), n = wo(r.logger, s, r.localProjections), i = So(s, r.logger), a = bo(s, r.logger), c = Ro(s, r.logger), u = new Eo(
5137
+ }, o = new Zr(r.localSecret), n = Ro(r.logger, s, r.localProjections), i = Eo(s, r.logger), a = Co(s, r.logger), c = ko(s, r.logger), u = new Po(
5143
5138
  r.logger,
5144
5139
  n,
5145
5140
  i,
5146
5141
  r.blobDownloadPath,
5147
5142
  o,
5148
5143
  r.blobDriverOps
5149
- ), l = new Co(
5144
+ ), l = new Oo(
5150
5145
  r.logger,
5151
5146
  o,
5152
5147
  n,
5153
5148
  r.downloadBlobToURLPath,
5154
5149
  r.downloadBlobToURLDriverOps
5155
- ), d = new ko(
5150
+ ), d = new $o(
5156
5151
  r.logger,
5157
5152
  o,
5158
5153
  a,
5159
5154
  c,
5160
5155
  r.uploadDriverOps
5161
- ), f = new Po(r.logger, i, r.logStreamDriverOps), h = new Oo(r.logger, f, u), R = await $o.init(
5156
+ ), f = new Io(r.logger, i, r.logStreamDriverOps), h = new Fo(r.logger, f, u), R = await Ao.init(
5162
5157
  r.logger,
5163
5158
  s,
5164
5159
  o,
5165
5160
  r.localProjections,
5166
5161
  r.openFileDialogCallback,
5167
5162
  r.virtualLocalStoragesOverride
5168
- ), g = new Vl(u, r.logger);
5163
+ ), g = await Yt.init(
5164
+ u,
5165
+ r.logger,
5166
+ r.pframesSpillPath
5167
+ );
5169
5168
  return {
5170
5169
  blobDriver: u,
5171
5170
  blobToURLDriver: l,
@@ -5176,15 +5175,15 @@ async function Jl(s, e, t) {
5176
5175
  pFrameDriver: g
5177
5176
  };
5178
5177
  }
5179
- class js {
5178
+ class xs {
5180
5179
  constructor(e, t, r, o, n, i, a, c) {
5181
- w(this, "pl");
5180
+ S(this, "pl");
5182
5181
  /** Contains a reactive list of projects along with their meta information. */
5183
- w(this, "projectList");
5182
+ S(this, "projectList");
5184
5183
  //
5185
5184
  // Projects
5186
5185
  //
5187
- w(this, "openedProjectsByRid", /* @__PURE__ */ new Map());
5186
+ S(this, "openedProjectsByRid", /* @__PURE__ */ new Map());
5188
5187
  this.env = e, this.driverKit = t, this.signer = r, this.projectListResourceId = o, this.openedProjectsList = n, this.projectListTree = i, this.blockRegistryProvider = a, this.projectList = c, this.pl = this.env.pl;
5189
5188
  }
5190
5189
  /** Returns extended API driver kit used internally by middle layer. */
@@ -5197,8 +5196,8 @@ class js {
5197
5196
  /** Creates a project with initial state and adds it to project list. */
5198
5197
  async createProject(e, t = be()) {
5199
5198
  const r = await this.pl.withWriteTx("MLCreateProject", async (o) => {
5200
- const n = await $n(o, e);
5201
- return o.createField(U(this.projectListResourceId, t), "Dynamic", n), await o.commit(), await no(n);
5199
+ const n = await An(o, e);
5200
+ return o.createField(U(this.projectListResourceId, t), "Dynamic", n), await o.commit(), await co(n);
5202
5201
  });
5203
5202
  return await this.projectListTree.refreshState(), r;
5204
5203
  }
@@ -5257,33 +5256,33 @@ class js {
5257
5256
  /** Generates sufficiently random string to be used as local secret for the
5258
5257
  * middle layer */
5259
5258
  static generateLocalSecret() {
5260
- return Qr.generateSecret();
5259
+ return Zr.generateSecret();
5261
5260
  }
5262
5261
  /** Initialize middle layer */
5263
5262
  static async init(e, t, r) {
5264
5263
  const o = {
5265
- ...ji,
5266
- ...xi(t),
5264
+ ...Ui,
5265
+ ...Gi(t),
5267
5266
  ...r
5268
5267
  };
5269
5268
  o.defaultTreeOptions.logStat = ue().logTreeStats, o.debugOps.dumpInitialTreeState = ue().dumpInitialTreeState;
5270
5269
  const n = await e.withWriteTx("MLInitialization", async (g) => {
5271
- const x = U(g.clientRoot, Yo);
5270
+ const x = U(g.clientRoot, en);
5272
5271
  g.createField(x, "Dynamic");
5273
5272
  const T = await g.getField(x);
5274
5273
  if (tt(T.value)) {
5275
- const B = g.createEphemeral(cs);
5274
+ const B = g.createEphemeral(ls);
5276
5275
  return g.lock(B), g.setField(x, B), await g.commit(), await B.globalId;
5277
5276
  } else
5278
5277
  return T.value;
5279
- }), i = o.logger, a = await Jl(e, t, o), c = new Hs(e.httpDispatcher, {
5278
+ }), i = o.logger, a = await _l(e, t, o), c = new Ws(e.httpDispatcher, {
5280
5279
  minTimeout: 250,
5281
5280
  maxRetries: 4
5282
- }), u = new Vo(c), l = new bn(
5281
+ }), u = new Jo(c), l = new Cn(
5283
5282
  u,
5284
5283
  a.signer,
5285
5284
  c
5286
- ), d = new Io(
5285
+ ), d = new To(
5287
5286
  i,
5288
5287
  e.httpDispatcher,
5289
5288
  o.frontendDownloadPath
@@ -5297,14 +5296,14 @@ class js {
5297
5296
  bpPreparer: l,
5298
5297
  frontendDownloadDriver: d,
5299
5298
  driverKit: a,
5300
- blockUpdateWatcher: new Nl(u, i, {
5299
+ blockUpdateWatcher: new xl(u, i, {
5301
5300
  minDelay: o.devBlockUpdateRecheckInterval,
5302
5301
  http: c,
5303
5302
  preferredUpdateChannel: o.preferredUpdateChannel
5304
5303
  }),
5305
- quickJs: await vo()
5306
- }, h = new uo([]), R = await Zo(e, n, h, f);
5307
- return new js(
5304
+ quickJs: await So()
5305
+ }, h = new ho([]), R = await rn(e, n, h, f);
5306
+ return new xs(
5308
5307
  f,
5309
5308
  a,
5310
5309
  a.signer,
@@ -5316,7 +5315,7 @@ class js {
5316
5315
  );
5317
5316
  }
5318
5317
  }
5319
- const Ml = [
5318
+ const Kl = [
5320
5319
  "undici:request:create",
5321
5320
  // When a new request is created
5322
5321
  "undici:request:bodySent",
@@ -5354,7 +5353,7 @@ const Ml = [
5354
5353
  "undici:dispatcher:retry"
5355
5354
  // When a dispatcher retries a request
5356
5355
  ];
5357
- async function $u(s, e = {}) {
5356
+ async function Fu(s, e = {}) {
5358
5357
  const t = {
5359
5358
  pingCheckDurationMs: 1e4,
5360
5359
  pingTimeoutMs: 3e3,
@@ -5372,8 +5371,8 @@ async function $u(s, e = {}) {
5372
5371
  bodyLimit: 300,
5373
5372
  ...e
5374
5373
  }, r = [];
5375
- Ml.forEach((c) => {
5376
- Ao(c).subscribe((l) => {
5374
+ Kl.forEach((c) => {
5375
+ Do(c).subscribe((l) => {
5377
5376
  var f;
5378
5377
  const d = (/* @__PURE__ */ new Date()).toISOString();
5379
5378
  (f = l == null ? void 0 : l.response) != null && f.headers && (l.response.headers = l.response.headers.map((h) => h.toString())), r.push(
@@ -5392,12 +5391,12 @@ async function $u(s, e = {}) {
5392
5391
  blockRegistryUiChecks: [],
5393
5392
  blockGARegistryUiChecks: [],
5394
5393
  autoUpdateCdnChecks: []
5395
- }, n = io(s, { defaultRequestTimeout: t.pingTimeoutMs });
5394
+ }, n = lo(s, { defaultRequestTimeout: t.pingTimeoutMs });
5396
5395
  o.plPings = await ve(t.pingCheckDurationMs, t.maxPingsPerSecond, async () => {
5397
- const u = await new nr(n).ping();
5396
+ const u = await new ir(n).ping();
5398
5397
  return JSON.stringify(u).slice(0, t.bodyLimit) + "...";
5399
5398
  });
5400
- const a = new nr(n).ll.httpDispatcher;
5399
+ const a = new ir(n).ll.httpDispatcher;
5401
5400
  return o.blockRegistryOverviewChecks = await ve(
5402
5401
  t.blockRegistryDurationMs,
5403
5402
  t.maxRegistryChecksPerSecond,
@@ -5418,11 +5417,11 @@ async function $u(s, e = {}) {
5418
5417
  t.autoUpdateCdnDurationMs,
5419
5418
  t.maxAutoUpdateCdnChecksPerSecond,
5420
5419
  async () => await Ie(t.autoUpdateCdnUrl, t, a)
5421
- ), _l(o, s, t, r);
5420
+ ), Hl(o, s, t, r);
5422
5421
  }
5423
5422
  async function ve(s, e, t) {
5424
5423
  const r = Lt(), o = [];
5425
- for (; Wr(r) < s; ) {
5424
+ for (; qr(r) < s; ) {
5426
5425
  const n = Lt();
5427
5426
  let i;
5428
5427
  try {
@@ -5430,13 +5429,13 @@ async function ve(s, e, t) {
5430
5429
  } catch (u) {
5431
5430
  i = { ok: !1, error: u };
5432
5431
  }
5433
- const a = Wr(n);
5432
+ const a = qr(n);
5434
5433
  o.push({
5435
5434
  elapsedMs: a,
5436
5435
  response: i
5437
5436
  });
5438
5437
  const c = 1e3 / e - a;
5439
- c > 0 && await ss(c);
5438
+ c > 0 && await os(c);
5440
5439
  }
5441
5440
  return o;
5442
5441
  }
@@ -5451,7 +5450,7 @@ async function Ie(s, e, t) {
5451
5450
  beginningOfBody: n.slice(0, e.bodyLimit) + "..."
5452
5451
  };
5453
5452
  }
5454
- function _l(s, e, t, r) {
5453
+ function Hl(s, e, t, r) {
5455
5454
  const o = s.plPings.filter((a) => a.response.ok), n = s.plPings.filter((a) => !a.response.ok), i = [
5456
5455
  ...new Set(o.map((a) => JSON.stringify(a.response.value)))
5457
5456
  ];
@@ -5499,7 +5498,7 @@ ${r.join(`
5499
5498
  `;
5500
5499
  }
5501
5500
  function ye(s) {
5502
- const e = s.filter((o) => o.response.ok), { mean: t, median: r } = Kl(s);
5501
+ const e = s.filter((o) => o.response.ok), { mean: t, median: r } = Wl(s);
5503
5502
  return `
5504
5503
  total: ${s.length};
5505
5504
  successes: ${e.length};
@@ -5508,7 +5507,7 @@ mean in ms: ${t};
5508
5507
  median in ms: ${r};
5509
5508
  `;
5510
5509
  }
5511
- function Kl(s) {
5510
+ function Wl(s) {
5512
5511
  const e = s.map((o) => o.elapsedMs), t = e.reduce((o, n) => o + n) / e.length;
5513
5512
  let r;
5514
5513
  if (e.length > 0) {
@@ -5520,37 +5519,37 @@ function Kl(s) {
5520
5519
  function Lt() {
5521
5520
  return Date.now();
5522
5521
  }
5523
- function Wr(s) {
5522
+ function qr(s) {
5524
5523
  return Lt() - s;
5525
5524
  }
5526
5525
  export {
5527
- Su as BlockPackRegistry,
5528
- bu as CentralBlockRegistry,
5529
- Is as DefaultDriverKitOpsPaths,
5530
- $s as DefaultDriverKitOpsSettings,
5531
- xi as DefaultMiddleLayerOpsPaths,
5532
- ji as DefaultMiddleLayerOpsSettings,
5533
- gs as FrontendFromFolderResourceType,
5534
- hs as FrontendFromUrlResourceType,
5535
- js as MiddleLayer,
5526
+ Ru as BlockPackRegistry,
5527
+ Eu as CentralBlockRegistry,
5528
+ Fs as DefaultDriverKitOpsPaths,
5529
+ Is as DefaultDriverKitOpsSettings,
5530
+ Gi as DefaultMiddleLayerOpsPaths,
5531
+ Ui as DefaultMiddleLayerOpsSettings,
5532
+ ms as FrontendFromFolderResourceType,
5533
+ gs as FrontendFromUrlResourceType,
5534
+ xs as MiddleLayer,
5536
5535
  Jt as Project,
5537
- dn as TengoTemplateGet,
5538
- pn as TengoTemplateGetRegistry,
5539
- hn as TengoTemplateGetTemplate,
5540
- fn as TengoTemplateGetTemplateURI,
5541
- Cu as TengoTemplatePack,
5542
- ku as TengoTemplatePackConvert,
5543
- Ou as TengoTemplatePackConvertTemplate,
5544
- Pu as TengoTemplatePackConvertTemplatePack,
5545
- Eu as V1CentralDevSnapshotRegistry,
5546
- Ru as V1CentralRegistry,
5547
- Vo as V2RegistryProvider,
5548
- $u as checkNetwork,
5549
- ls as createRenderTemplate,
5550
- ns as getDevV1PacketMtime,
5536
+ hn as TengoTemplateGet,
5537
+ gn as TengoTemplateGetRegistry,
5538
+ vn as TengoTemplateGetTemplate,
5539
+ mn as TengoTemplateGetTemplateURI,
5540
+ Pu as TengoTemplatePack,
5541
+ Ou as TengoTemplatePackConvert,
5542
+ Iu as TengoTemplatePackConvertTemplate,
5543
+ $u as TengoTemplatePackConvertTemplatePack,
5544
+ ku as V1CentralDevSnapshotRegistry,
5545
+ Cu as V1CentralRegistry,
5546
+ Jo as V2RegistryProvider,
5547
+ Fu as checkNetwork,
5548
+ us as createRenderTemplate,
5549
+ is as getDevV1PacketMtime,
5551
5550
  jt as getDevV2PacketMtime,
5552
- Jl as initDriverKit,
5551
+ _l as initDriverKit,
5553
5552
  Vt as loadTemplate,
5554
- gn as prepareTemplateSpec
5553
+ yn as prepareTemplateSpec
5555
5554
  };
5556
5555
  //# sourceMappingURL=index.mjs.map