@milaboratories/pl-middle-layer 1.30.28 → 1.30.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1,14 +1,14 @@
1
- var $s = Object.defineProperty;
2
- var Xt = (s, e) => (e = Symbol[s]) ? e : Symbol.for("Symbol." + s), qt = (s) => {
1
+ var Fs = Object.defineProperty;
2
+ var qt = (s, e) => (e = Symbol[s]) ? e : Symbol.for("Symbol." + s), Yt = (s) => {
3
3
  throw TypeError(s);
4
4
  };
5
- var Fs = (s, e, t) => e in s ? $s(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t;
6
- var S = (s, e, t) => Fs(s, typeof e != "symbol" ? e + "" : e, t);
5
+ var Is = (s, e, t) => e in s ? Fs(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t;
6
+ var w = (s, e, t) => Is(s, typeof e != "symbol" ? e + "" : e, t);
7
7
  var xe = (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" && Yt("Object expected");
10
10
  var r;
11
- t && (r = e[Xt("asyncDispose")]), r === void 0 && (r = e[Xt("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" && Yt("Object not disposable"), s.push([t, r, e]);
12
12
  } else t && s.push([t]);
13
13
  return e;
14
14
  }, je = (s, e, t) => {
@@ -26,73 +26,74 @@ var xe = (s, e, t) => {
26
26
  };
27
27
  return n();
28
28
  };
29
- import { mapValueInVOE as Jr, executePSpecPredicate as Is, mapPObjectData as le, mapPTableDef as yt, JsRenderInternal as As, extractConfig as Gr, isConfigLambda as Mr, DefaultNavigationState as Ts, extractAllColumns as Ls } from "@platforma-sdk/model";
29
+ import { mapValueInVOE as Gr, executePSpecPredicate as As, mapPObjectData as le, mapPTableDef as wt, JsRenderInternal as Ts, extractConfig as Mr, isConfigLambda as _r, DefaultNavigationState as Ls, extractAllColumns as Ds } from "@platforma-sdk/model";
30
30
  export * from "@platforma-sdk/model";
31
- import { AnyChannel as ke, StableChannel as Oe, InitialBlockSettings as Yt, blockPackIdToString as Ds } from "@milaboratories/pl-model-middle-layer";
31
+ import { AnyChannel as $e, StableChannel as Oe, InitialBlockSettings as Qt, blockPackIdToString as Ns } 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 At, RetryAgent as Ns } from "undici";
35
- import { RegistryV1 as de, tryLoadPackDescription as wt, BlockPackMetaEmbedAbsoluteBytes as Bs, RegistryV2Reader as xs, folderReaderByUrl as js, loadPackDescription as Qt } from "@platforma-sdk/block-tools";
34
+ import { request as Tt, RetryAgent as Bs } from "undici";
35
+ import { RegistryV1 as de, tryLoadPackDescription as St, BlockPackMetaEmbedAbsoluteBytes as xs, RegistryV2Reader as js, folderReaderByUrl as Vs, loadPackDescription as Zt } from "@platforma-sdk/block-tools";
36
36
  import Y from "node:fs";
37
37
  import _ from "node:path";
38
- import Vs from "yaml";
39
- import { assertNever as K, notEmpty as B, ConsoleLoggerAdapter as Us, ConcurrencyLimitingExecutor as Js, HmacSha256Signer as _r } from "@milaboratories/ts-helpers";
40
- import * as Kr from "node:fs/promises";
41
- import { tryResolve as Gs } from "@milaboratories/resolve-helper";
42
- import { resourceTypesEqual as ce, field as x, Pl as A, PlClient as Ms, isNullResourceId as Ye, ensureResourceIdNotNull as St, isResource as _s, isResourceRef as Ks, isNotNullResourceId as Zt, resourceType as De, resourceTypeToString as Hs, resourceIdToString as Tt, isNotFoundError as Ws, isTimeoutOrCancelError as zs, toGlobalResourceId as Xs, plAddressToConfig as qs, UnauthenticatedPlClient as er } from "@milaboratories/pl-client";
38
+ import Us from "yaml";
39
+ import { assertNever as K, notEmpty as B, ConsoleLoggerAdapter as Js, ConcurrencyLimitingExecutor as Gs, HmacSha256Signer as Kr } from "@milaboratories/ts-helpers";
40
+ import * as Hr from "node:fs/promises";
41
+ import { tryResolve as Ms } from "@milaboratories/resolve-helper";
42
+ import { resourceTypesEqual as ce, field as x, Pl as A, PlClient as _s, isNullResourceId as Qe, ensureResourceIdNotNull as bt, isResource as Ks, isResourceRef as Hs, isNotNullResourceId as er, resourceType as De, resourceTypeToString as Ws, stringifyWithResourceId as Ve, resourceIdToString as Lt, isNotFoundError as zs, isTimeoutOrCancelError as Xs, toGlobalResourceId as qs, plAddressToConfig as Ys, UnauthenticatedPlClient as tr } from "@milaboratories/pl-client";
43
43
  export * from "@milaboratories/pl-client";
44
- import { SynchronizedTreeState as Hr, PlError as Ys, isPlTreeNodeAccessor as Qs } from "@milaboratories/pl-tree";
45
- import { Computable as J, ChangeSource as tr, PollComputablePool as Zs, WatchableValue as eo } from "@milaboratories/computable";
46
- import { randomUUID as Ae, createHash as Ne } from "node:crypto";
47
- import { parseTemplate as to, PlTemplateV1 as ae, PlTemplateOverrideV1 as ct, PlTemplateLibV1 as Ve, PlTemplateSoftwareV1 as be } from "@milaboratories/pl-model-backend";
48
- import { LRUCache as Wr } from "lru-cache";
49
- import zr from "denque";
44
+ import { SynchronizedTreeState as Wr, isPlTreeNodeAccessor as Qs } from "@milaboratories/pl-tree";
45
+ import { Computable as J, ChangeSource as rr, PollComputablePool as Zs, WatchableValue as eo } from "@milaboratories/computable";
46
+ import { randomUUID as we, createHash as Ne } from "node:crypto";
47
+ import { parseTemplate as to, PlTemplateV1 as ae, PlTemplateOverrideV1 as lt, PlTemplateLibV1 as Ue, PlTemplateSoftwareV1 as Re } from "@milaboratories/pl-model-backend";
48
+ import { LRUCache as zr } from "lru-cache";
49
+ import Xr from "denque";
50
50
  import { Templates as ro } from "@platforma-sdk/workflow-tengo";
51
51
  import Z from "canonicalize";
52
- import so from "node:assert";
53
- import { Scope as bt, getQuickJS as oo } from "quickjs-emscripten";
54
- import { setTimeout as Xr } from "node:timers/promises";
55
- import { createDownloadClient as no, createLogsClient as io, createUploadBlobClient as ao, createUploadProgressClient as co, DownloadDriver as lo, DownloadBlobToURLDriver as uo, UploadDriver as po, LogsStreamDriver as ho, LogsDriver as fo, LsDriver as go, DownloadUrlDriver as mo } from "@milaboratories/pl-drivers";
56
- import { PFrame as rr } from "@milaboratories/pframes-node";
57
- import { PFrame as vo } from "@milaboratories/pframes-rs-node";
58
- import { channel as yo } from "node:diagnostics_channel";
59
- async function sr(s) {
52
+ import { parsePlError as so } from "@milaboratories/pl-errors";
53
+ import oo from "node:assert";
54
+ import { Scope as Rt, errors as no, getQuickJS as io } from "quickjs-emscripten";
55
+ import { setTimeout as qr } from "node:timers/promises";
56
+ import { createDownloadClient as ao, createLogsClient as co, createUploadBlobClient as lo, createUploadProgressClient as uo, DownloadDriver as po, DownloadBlobToURLDriver as ho, UploadDriver as fo, LogsStreamDriver as go, LogsDriver as mo, LsDriver as vo, DownloadUrlDriver as yo } from "@milaboratories/pl-drivers";
57
+ import { PFrame as sr } from "@milaboratories/pframes-node";
58
+ import { PFrame as wo } from "@milaboratories/pframes-rs-node";
59
+ import { channel as So } from "node:diagnostics_channel";
60
+ async function or(s) {
60
61
  try {
61
- return await Kr.stat(s, { bigint: !0 });
62
+ return await Hr.stat(s, { bigint: !0 });
62
63
  } catch (e) {
63
64
  if (e.code === "ENOENT")
64
65
  return;
65
66
  throw e;
66
67
  }
67
68
  }
68
- const wo = [de.PlPackageYamlConfigFile], So = [de.PlPackageJsonConfigFile], Lt = ["backend", "dist", "tengo", "tpl", "main.plj.gz"], Dt = ["config", "dist", "config.json"], qr = ["frontend", "dist"], or = "block-model/dist/config.json", bo = "block-ui/package.json", Co = [
69
- Lt,
69
+ const bo = [de.PlPackageYamlConfigFile], Ro = [de.PlPackageJsonConfigFile], Dt = ["backend", "dist", "tengo", "tpl", "main.plj.gz"], Nt = ["config", "dist", "config.json"], Yr = ["frontend", "dist"], nr = "block-model/dist/config.json", Eo = "block-ui/package.json", Co = [
70
70
  Dt,
71
- wo,
72
- So,
73
- qr
71
+ Nt,
72
+ bo,
73
+ Ro,
74
+ Yr
74
75
  ];
75
- async function Ro(s) {
76
- return await sr(_.join(s, ...Dt)) !== void 0 || await sr(_.join(s, ...Lt)) !== void 0;
76
+ async function Po(s) {
77
+ return await or(_.join(s, ...Nt)) !== void 0 || await or(_.join(s, ...Dt)) !== void 0;
77
78
  }
78
- function lt(s, e) {
79
- const t = Gs(s, e);
79
+ function ut(s, e) {
80
+ const t = Ms(s, e);
80
81
  if (t === void 0) throw new Error(`Can't resolve ${e} against ${s}`);
81
82
  return t;
82
83
  }
83
- async function nr(s, e) {
84
- if (_.isAbsolute(s) || (s = _.resolve(s)), await Ro(s))
84
+ async function ir(s, e) {
85
+ if (_.isAbsolute(s) || (s = _.resolve(s)), await Po(s))
85
86
  return {
86
- workflow: _.join(s, ...Lt),
87
- config: _.join(s, ...Dt),
88
- ui: _.join(s, ...qr)
87
+ workflow: _.join(s, ...Dt),
88
+ config: _.join(s, ...Nt),
89
+ ui: _.join(s, ...Yr)
89
90
  };
90
91
  {
91
- const t = lt(s, or), r = lt(s, or), o = lt(s, bo);
92
+ const t = ut(s, nr), r = ut(s, nr), o = ut(s, Eo);
92
93
  return { workflow: t, config: r, ui: _.resolve(o, "..", "dist") };
93
94
  }
94
95
  }
95
- async function Eo(s) {
96
+ async function ko(s) {
96
97
  try {
97
98
  return await Y.promises.readFile(s, "utf8");
98
99
  } catch (e) {
@@ -101,7 +102,7 @@ async function Eo(s) {
101
102
  throw e;
102
103
  }
103
104
  }
104
- async function Po(s) {
105
+ async function $o(s) {
105
106
  try {
106
107
  return await Y.promises.stat(s, { bigint: !0 });
107
108
  } catch (e) {
@@ -110,21 +111,21 @@ async function Po(s) {
110
111
  throw e;
111
112
  }
112
113
  }
113
- async function Yr(s) {
114
+ async function Qr(s) {
114
115
  let e = 0n;
115
116
  for (const t of Co) {
116
- const r = _.join(s, ...t), o = await Po(r);
117
+ const r = _.join(s, ...t), o = await $o(r);
117
118
  o !== void 0 && e < o.mtimeNs && (e = o.mtimeNs);
118
119
  }
119
120
  return e.toString();
120
121
  }
121
- async function Nt(s) {
122
+ async function Bt(s) {
122
123
  const e = await Y.promises.stat(s.components.workflow.main.file, {
123
124
  bigint: !0
124
125
  }), t = await Y.promises.stat(s.components.model.file, { bigint: !0 });
125
126
  return (e.mtimeNs > t.mtimeNs ? e.mtimeNs : t.mtimeNs).toString();
126
127
  }
127
- class Zl {
128
+ class ou {
128
129
  constructor(e, t, r) {
129
130
  this.v2Provider = e, this.registries = t, this.http = r;
130
131
  }
@@ -132,7 +133,7 @@ class Zl {
132
133
  const t = [], r = e.spec;
133
134
  switch (r.type) {
134
135
  case "remote-v1": {
135
- const o = this.http !== void 0 ? { dispatcher: this.http } : {}, i = await (await At(
136
+ const o = this.http !== void 0 ? { dispatcher: this.http } : {}, i = await (await Tt(
136
137
  `${r.url}/${de.GlobalOverviewPath}`,
137
138
  o
138
139
  )).body.json();
@@ -161,10 +162,10 @@ class Zl {
161
162
  registryId: e.id,
162
163
  id: f,
163
164
  latestByChannel: {
164
- [ke]: h,
165
+ [$e]: h,
165
166
  [Oe]: h
166
167
  },
167
- allVersions: a.allVersions.map((R) => ({ version: R, channels: [] }))
168
+ allVersions: a.allVersions.map((E) => ({ version: E, channels: [] }))
168
169
  });
169
170
  }
170
171
  return t;
@@ -174,11 +175,11 @@ class Zl {
174
175
  case "local-dev":
175
176
  for (const o of await Y.promises.readdir(r.path, { withFileTypes: !0 })) {
176
177
  if (!o.isDirectory()) continue;
177
- const n = _.join(r.path, o.name), i = await Eo(
178
+ const n = _.join(r.path, o.name), i = await ko(
178
179
  _.join(n, de.PlPackageYamlConfigFile)
179
180
  );
180
181
  if (i !== void 0) {
181
- const a = de.PlPackageConfigData.parse(Vs.parse(i)), c = await Yr(n), u = {
182
+ const a = de.PlPackageConfigData.parse(Us.parse(i)), c = await Qr(n), u = {
182
183
  organization: a.organization,
183
184
  name: a.package,
184
185
  version: "DEV"
@@ -202,21 +203,21 @@ class Zl {
202
203
  registryId: e.id,
203
204
  id: u,
204
205
  latestByChannel: {
205
- [ke]: l,
206
+ [$e]: l,
206
207
  [Oe]: l
207
208
  },
208
209
  allVersions: []
209
210
  });
210
211
  } else {
211
- let a = n, c = await wt(a);
212
+ let a = n, c = await St(a);
212
213
  if (c === void 0) {
213
214
  for (const u of ["block", "meta"])
214
- if (a = _.join(n, u), c = await wt(a), c !== void 0) break;
215
+ if (a = _.join(n, u), c = await St(a), c !== void 0) break;
215
216
  }
216
217
  if (c !== void 0) {
217
- const u = await Nt(c), l = {
218
+ const u = await Bt(c), l = {
218
219
  id: c.id,
219
- meta: await Bs.parseAsync(c.meta),
220
+ meta: await xs.parseAsync(c.meta),
220
221
  spec: {
221
222
  type: "dev-v2",
222
223
  folder: a,
@@ -227,7 +228,7 @@ class Zl {
227
228
  registryId: e.id,
228
229
  id: c.id,
229
230
  latestByChannel: {
230
- [ke]: l,
231
+ [$e]: l,
231
232
  [Oe]: l
232
233
  },
233
234
  allVersions: []
@@ -257,70 +258,70 @@ class Zl {
257
258
  return await this.v2Provider.getRegistry(o.url).getSpecificOverview(t, r);
258
259
  }
259
260
  }
260
- class ko {
261
+ class Oo {
261
262
  constructor(e) {
262
- S(this, "registries", /* @__PURE__ */ new Map());
263
+ w(this, "registries", /* @__PURE__ */ new Map());
263
264
  this.http = e;
264
265
  }
265
266
  getRegistry(e) {
266
267
  const t = this.registries.get(e);
267
268
  if (t) return t;
268
- const r = new xs(js(e, this.http));
269
+ const r = new js(Vs(e, this.http));
269
270
  return this.registries.set(e, r), r;
270
271
  }
271
272
  }
272
- const eu = {
273
+ const nu = {
273
274
  type: "remote-v2",
274
275
  url: "https://blocks.pl-open.science/"
275
- }, tu = {
276
+ }, iu = {
276
277
  type: "remote-v1",
277
278
  url: "https://block.registry.platforma.bio/releases"
278
- }, ru = {
279
+ }, au = {
279
280
  type: "remote-v1",
280
281
  url: "https://block.registry.platforma.bio/dev"
281
- }, Oo = {
282
+ }, Fo = {
282
283
  groups: [{ id: "default", label: "Default", blocks: [] }]
283
- }, $o = {
284
+ }, Io = {
284
285
  stagingRefreshTimestamp: 0,
285
286
  blocksInLimbo: []
286
- }, Fo = {
287
+ }, Ao = {
287
288
  label: "New Project"
288
- }, Io = { name: "UserProject", version: "2" }, Qr = "SchemaVersion", Zr = "1", Bt = "ProjectCreated", Te = "ProjectLastModified", Le = "ProjectMeta", pe = "ProjectStructure", Qe = "BlockRenderingState", Ao = "BlockFrontendState/", To = /^BlockFrontendState\/(?<blockid>.*)$/;
289
- function Ct(s) {
290
- return `${Ao}${s}`;
291
- }
292
- const Lo = "BlockArgsAuthor/";
293
- function Rt(s) {
289
+ }, To = { name: "UserProject", version: "2" }, Zr = "SchemaVersion", es = "1", xt = "ProjectCreated", Te = "ProjectLastModified", Le = "ProjectMeta", pe = "ProjectStructure", Ze = "BlockRenderingState", Lo = "BlockFrontendState/", Do = /^BlockFrontendState\/(?<blockid>.*)$/;
290
+ function Et(s) {
294
291
  return `${Lo}${s}`;
295
292
  }
296
- const Et = "ProjectStructureAuthor";
297
- function Do(s) {
298
- const e = s.match(To);
293
+ const No = "BlockArgsAuthor/";
294
+ function Ct(s) {
295
+ return `${No}${s}`;
296
+ }
297
+ const Pt = "ProjectStructureAuthor";
298
+ function Bo(s) {
299
+ const e = s.match(Do);
299
300
  if (e !== null)
300
301
  return e.groups.blockid;
301
302
  }
302
- const No = "__serviceTemplate_";
303
- function Pt(s) {
304
- return `${No}${s}`;
303
+ const xo = "__serviceTemplate_";
304
+ function kt(s) {
305
+ return `${xo}${s}`;
305
306
  }
306
307
  function U(s, e) {
307
308
  return `${s}-${e}`;
308
309
  }
309
- const Bo = /^(?<blockId>.*)-(?<fieldName>blockPack|blockSettings|prodArgs|currentArgs|prodCtx|prodUiCtx|prodOutput|prodCtxPrevious|prodUiCtxPrevious|prodOutputPrevious|stagingCtx|stagingUiCtx|stagingOutput|stagingCtxPrevious|stagingUiCtxPrevious|stagingOutputPrevious)$/;
310
- function xo(s) {
311
- const e = s.match(Bo);
310
+ const jo = /^(?<blockId>.*)-(?<fieldName>blockPack|blockSettings|prodArgs|currentArgs|prodCtx|prodUiCtx|prodOutput|prodCtxPrevious|prodUiCtxPrevious|prodOutputPrevious|stagingCtx|stagingUiCtx|stagingOutput|stagingCtxPrevious|stagingUiCtxPrevious|stagingOutputPrevious)$/;
311
+ function Vo(s) {
312
+ const e = s.match(jo);
312
313
  if (e === null) return;
313
314
  const { blockId: t, fieldName: r } = e.groups;
314
315
  return { blockId: t, fieldName: r };
315
316
  }
316
- const jo = "projects", es = { name: "Projects", version: "1" }, Vo = (s) => ce(s.type, es) ? s.fields : [];
317
- async function Uo(s, e, t, r) {
318
- const o = await Hr.init(
317
+ const Uo = "projects", ts = { name: "Projects", version: "1" }, Jo = (s) => ce(s.type, ts) ? s.fields : [];
318
+ async function Go(s, e, t, r) {
319
+ const o = await Wr.init(
319
320
  s,
320
321
  e,
321
322
  {
322
323
  ...r.ops.defaultTreeOptions,
323
- pruning: Vo
324
+ pruning: Jo
324
325
  },
325
326
  r.logger
326
327
  );
@@ -331,12 +332,12 @@ async function Uo(s, e, t, r) {
331
332
  for (const l of a.listDynamicFields()) {
332
333
  const d = a.traverse(l);
333
334
  if (d === void 0) continue;
334
- const f = B(d.getKeyValueAsJson(Le)), h = B(d.getKeyValueAsJson(Bt)), R = B(d.getKeyValueAsJson(Te));
335
+ const f = B(d.getKeyValueAsJson(Le)), h = B(d.getKeyValueAsJson(xt)), E = B(d.getKeyValueAsJson(Te));
335
336
  u.push({
336
337
  id: l,
337
338
  rid: d.id,
338
339
  created: new Date(h),
339
- lastModified: new Date(R),
340
+ lastModified: new Date(E),
340
341
  opened: c.indexOf(d.id) >= 0,
341
342
  meta: f
342
343
  });
@@ -344,72 +345,72 @@ async function Uo(s, e, t, r) {
344
345
  return u.sort((l) => -l.lastModified.valueOf()), u;
345
346
  }).withStableType(), tree: o };
346
347
  }
347
- const Jo = {
348
+ const Mo = {
348
349
  name: "EphRenderTemplate",
349
350
  version: "1"
350
- }, Go = {
351
+ }, _o = {
351
352
  name: "RenderTemplate",
352
353
  version: "1"
353
354
  };
354
- function ts(s, e, t, r, o) {
355
+ function rs(s, e, t, r, o) {
355
356
  if (o.length === 0) throw new Error("Zero output names provided");
356
- const n = t ? s.createEphemeral(Jo) : s.createStruct(Go), i = x(n, "template"), a = x(n, "inputs");
357
+ const n = t ? s.createEphemeral(Mo) : s.createStruct(_o), i = x(n, "template"), a = x(n, "inputs");
357
358
  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/");
358
359
  }
359
- const Mo = { name: "BContextEnd", version: "1" }, _o = { name: "BContext", version: "1" }, Ko = "id", Ho = "parent/", Wo = ["context", "result"];
360
- function ir(s, e, t) {
361
- return ts(s, e, !0, t, Wo);
360
+ const Ko = { name: "BContextEnd", version: "1" }, Ho = { name: "BContext", version: "1" }, Wo = "id", zo = "parent/", Xo = ["context", "result"];
361
+ function ar(s, e, t) {
362
+ return rs(s, e, !0, t, Xo);
362
363
  }
363
- function zo(s) {
364
- const e = s.createEphemeral(Mo);
364
+ function qo(s) {
365
+ const e = s.createEphemeral(Ko);
365
366
  return s.lock(e), e;
366
367
  }
367
- function ar(s, e) {
368
- if (e.length === 0) return zo(s);
368
+ function cr(s, e) {
369
+ if (e.length === 0) return qo(s);
369
370
  if (e.length === 1) return e[0];
370
- const t = s.createEphemeral(_o);
371
- s.createField(x(t, Ko), "Input", A.createPlString(s, Ae()));
371
+ const t = s.createEphemeral(Ho);
372
+ s.createField(x(t, Wo), "Input", A.createPlString(s, we()));
372
373
  for (let r = 0; r < e.length; r++)
373
- s.createField(x(t, `${Ho}${r}`), "Input", e[r]);
374
+ s.createField(x(t, `${zo}${r}`), "Input", e[r]);
374
375
  return s.lock(t), t;
375
376
  }
376
- function Xo(s, e) {
377
+ function Yo(s, e) {
377
378
  const t = to(e.content), r = t.type;
378
379
  switch (r) {
379
380
  case "pl.tengo-template.v2":
380
- return qo(s, t);
381
+ return Qo(s, t);
381
382
  default:
382
383
  K(r);
383
384
  }
384
385
  }
385
- const cr = {
386
+ const lr = {
386
387
  hash(s, e) {
387
- e.update(Ve.type.name).update(Ve.type.version).update(s.name).update(s.version).update(s.src);
388
+ e.update(Ue.type.name).update(Ue.type.version).update(s.name).update(s.version).update(s.src);
388
389
  },
389
390
  render(s, e, t) {
390
391
  return e.createValue(
391
- Ve.type,
392
- JSON.stringify(Ve.fromV2Data(s).data)
392
+ Ue.type,
393
+ JSON.stringify(Ue.fromV2Data(s).data)
393
394
  );
394
395
  }
395
- }, Ue = {
396
+ }, Je = {
396
397
  hash(s, e) {
397
- e.update(be.type.name).update(be.type.version).update(s.name).update(s.version).update(s.src);
398
+ e.update(Re.type.name).update(Re.type.version).update(s.name).update(s.version).update(s.src);
398
399
  },
399
400
  render(s, e, t) {
400
- const r = be.fromV2Data(s), o = e.createStruct(be.type, r.data);
401
- return e.setKValue(o, be.metaNameKey, JSON.stringify(r.name)), e.lock(o), o;
401
+ const r = Re.fromV2Data(s), o = e.createStruct(Re.type, r.data);
402
+ return e.setKValue(o, Re.metaNameKey, JSON.stringify(r.name)), e.lock(o), o;
402
403
  }
403
- }, rs = {
404
+ }, ss = {
404
405
  hash(s, e) {
405
406
  e.update(ae.type.name).update(ae.type.version).update(s.hashOverride ?? "no-override").update(s.name).update(s.version).update(s.src);
406
407
  const t = (r) => (r.sort((o, n) => o[0] === n[0] ? 0 : o[0] < n[0] ? -1 : 1), r);
407
408
  for (const [r, o] of t(Object.entries(s.libs ?? {})))
408
- e.update("lib:" + r), cr.hash(o, e);
409
+ e.update("lib:" + r), lr.hash(o, e);
409
410
  for (const [r, o] of t(Object.entries(s.software ?? {})))
410
- e.update("soft:" + r), Ue.hash(o, e);
411
+ e.update("soft:" + r), Je.hash(o, e);
411
412
  for (const [r, o] of t(Object.entries(s.assets ?? {})))
412
- e.update("asset:" + r), Ue.hash(o, e);
413
+ e.update("asset:" + r), Je.hash(o, e);
413
414
  for (const [r, o] of t(Object.entries(s.templates ?? {})))
414
415
  e.update("tpl:" + r), this.hash(o, e);
415
416
  },
@@ -420,29 +421,29 @@ const cr = {
420
421
  );
421
422
  for (const [i, a] of Object.entries(s.libs ?? {})) {
422
423
  const c = ae.libField(r, i);
423
- e.createField(c, "Input"), e.setField(c, t(a, cr));
424
+ e.createField(c, "Input"), e.setField(c, t(a, lr));
424
425
  }
425
426
  for (const [i, a] of Object.entries(s.software ?? {})) {
426
427
  const c = ae.swField(r, i);
427
- e.createField(c, "Input"), e.setField(c, t(a, Ue));
428
+ e.createField(c, "Input"), e.setField(c, t(a, Je));
428
429
  }
429
430
  for (const [i, a] of Object.entries(s.assets ?? {})) {
430
431
  const c = ae.swField(r, i);
431
- e.createField(c, "Input"), e.setField(c, t(a, Ue));
432
+ e.createField(c, "Input"), e.setField(c, t(a, Je));
432
433
  }
433
434
  for (const [i, a] of Object.entries(s.templates ?? {})) {
434
435
  const c = ae.tplField(r, i);
435
- e.createField(c, "Input"), e.setField(c, t(a, rs));
436
+ e.createField(c, "Input"), e.setField(c, t(a, ss));
436
437
  }
437
438
  if (e.lock(r), !s.hashOverride) return r;
438
439
  const o = e.createStruct(
439
- ct.type,
440
- JSON.stringify(ct.fromV2Data(s))
441
- ), n = ct.tplField(o);
440
+ lt.type,
441
+ JSON.stringify(lt.fromV2Data(s))
442
+ ), n = lt.tplField(o);
442
443
  return e.createField(n, "Service"), e.setField(n, r), e.lock(o), o;
443
444
  }
444
445
  };
445
- function qo(s, e) {
446
+ function Qo(s, e) {
446
447
  const t = /* @__PURE__ */ new Map(), r = (o, n) => {
447
448
  const i = Ne("sha256");
448
449
  n.hash(o, i);
@@ -453,13 +454,13 @@ function qo(s, e) {
453
454
  }
454
455
  return t.get(a);
455
456
  };
456
- return r(e, rs);
457
+ return r(e, ss);
457
458
  }
458
- const Yo = { name: "TengoTemplateGet", version: "1" }, Qo = "registry", Zo = "templateURI", en = "template", su = { name: "TengoTemplatePack", version: "1" }, ou = {
459
+ const Zo = { name: "TengoTemplateGet", version: "1" }, en = "registry", tn = "templateURI", rn = "template", cu = { name: "TengoTemplatePack", version: "1" }, lu = {
459
460
  name: "TengoTemplatePackConvert",
460
461
  version: "1"
461
- }, nu = "templatePack", iu = "template";
462
- async function tn(s) {
462
+ }, uu = "templatePack", du = "template";
463
+ async function sn(s) {
463
464
  switch (s.type) {
464
465
  case "from-file":
465
466
  return {
@@ -473,34 +474,34 @@ async function tn(s) {
473
474
  return K(s);
474
475
  }
475
476
  }
476
- function rn(s, e) {
477
- const t = s.createStruct(Yo), r = x(t, Qo), o = x(t, Zo), n = x(t, en);
477
+ function on(s, e) {
478
+ const t = s.createStruct(Zo), r = x(t, en), o = x(t, tn), n = x(t, rn);
478
479
  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;
479
480
  }
480
- function xt(s, e) {
481
+ function jt(s, e) {
481
482
  switch (e.type) {
482
483
  case "from-registry":
483
- return rn(s, e);
484
+ return on(s, e);
484
485
  case "explicit":
485
- return Xo(s, e);
486
+ return Yo(s, e);
486
487
  default:
487
488
  return K(e);
488
489
  }
489
490
  }
490
- const ss = { name: "Frontend/FromUrl", version: "1" }, os = {
491
+ const os = { name: "Frontend/FromUrl", version: "1" }, ns = {
491
492
  name: "Frontend/FromFolder",
492
493
  version: "1"
493
494
  };
494
- function sn(s, e) {
495
+ function nn(s, e) {
495
496
  switch (e.type) {
496
497
  case "url":
497
498
  return s.createValue(
498
- ss,
499
+ os,
499
500
  JSON.stringify({ url: e.url })
500
501
  );
501
502
  case "local":
502
503
  return s.createValue(
503
- os,
504
+ ns,
504
505
  JSON.stringify({
505
506
  path: e.path,
506
507
  signature: e.signature
@@ -510,24 +511,24 @@ function sn(s, e) {
510
511
  return K(e);
511
512
  }
512
513
  }
513
- const on = { name: "BlockPackCustom", version: "1" }, ns = "template", is = "frontend";
514
- function lr(s) {
514
+ const an = { name: "BlockPackCustom", version: "1" }, is = "template", as = "frontend";
515
+ function ur(s) {
515
516
  return s.endsWith("/") ? s : `${s}/`;
516
517
  }
517
- function nn(s) {
518
+ function cn(s) {
518
519
  return Buffer.from(s).toString("utf8");
519
520
  }
520
- function Je(s) {
521
- return JSON.parse(nn(s));
521
+ function Ge(s) {
522
+ return JSON.parse(cn(s));
522
523
  }
523
- class an {
524
+ class ln {
524
525
  constructor(e, t, r) {
525
- S(this, "remoteContentCache", new Wr({
526
+ w(this, "remoteContentCache", new zr({
526
527
  max: 500,
527
528
  maxSize: 128 * 1024 * 1024,
528
529
  fetchMethod: async (e) => {
529
530
  const t = this.http !== void 0 ? { dispatcher: this.http } : {};
530
- return await (await At(e, t)).body.arrayBuffer();
531
+ return await (await Tt(e, t)).body.arrayBuffer();
531
532
  },
532
533
  sizeCalculation: (e) => e.byteLength
533
534
  }));
@@ -538,22 +539,22 @@ class an {
538
539
  case "explicit":
539
540
  return e.config;
540
541
  case "dev-v1": {
541
- const t = await nr(e.folder), r = await Y.promises.readFile(t.config, { encoding: "utf-8" });
542
+ const t = await ir(e.folder), r = await Y.promises.readFile(t.config, { encoding: "utf-8" });
542
543
  return JSON.parse(r);
543
544
  }
544
545
  case "dev-v2": {
545
- const t = await Qt(e.folder), r = await Y.promises.readFile(t.components.model.file, {
546
+ const t = await Zt(e.folder), r = await Y.promises.readFile(t.components.model.file, {
546
547
  encoding: "utf-8"
547
548
  });
548
549
  return JSON.parse(r);
549
550
  }
550
551
  case "from-registry-v1": {
551
- const t = `${lr(e.registryUrl)}${de.packageContentPrefix({ organization: e.id.organization, package: e.id.name, version: e.id.version })}`, r = await this.remoteContentCache.forceFetch(`${t}/config.json`);
552
- return Je(r);
552
+ const t = `${ur(e.registryUrl)}${de.packageContentPrefix({ organization: e.id.organization, package: e.id.name, version: e.id.version })}`, r = await this.remoteContentCache.forceFetch(`${t}/config.json`);
553
+ return Ge(r);
553
554
  }
554
555
  case "from-registry-v2": {
555
556
  const r = await this.v2RegistryProvider.getRegistry(e.registryUrl).getComponents(e.id), o = await this.remoteContentCache.forceFetch(r.model.url);
556
- return Je(o);
557
+ return Ge(o);
557
558
  }
558
559
  default:
559
560
  return K(e);
@@ -564,7 +565,7 @@ class an {
564
565
  case "explicit":
565
566
  return e;
566
567
  case "dev-v1": {
567
- const t = await nr(e.folder), r = await Y.promises.readFile(t.workflow), o = JSON.parse(
568
+ const t = await ir(e.folder), r = await Y.promises.readFile(t.workflow), o = JSON.parse(
568
569
  await Y.promises.readFile(t.config, "utf-8")
569
570
  ), n = t.ui;
570
571
  return {
@@ -583,14 +584,14 @@ class an {
583
584
  };
584
585
  }
585
586
  case "dev-v2": {
586
- const t = await Qt(e.folder), r = JSON.parse(
587
+ const t = await Zt(e.folder), r = JSON.parse(
587
588
  await Y.promises.readFile(t.components.model.file, {
588
589
  encoding: "utf-8"
589
590
  })
590
591
  ), o = await Y.promises.readFile(
591
592
  t.components.workflow.main.file
592
593
  ), n = t.components.ui.folder, i = { ...e };
593
- return e.mtime === void 0 && (i.mtime = await Nt(t)), {
594
+ return e.mtime === void 0 && (i.mtime = await Bt(t)), {
594
595
  type: "explicit",
595
596
  template: {
596
597
  type: "explicit",
@@ -606,7 +607,7 @@ class an {
606
607
  };
607
608
  }
608
609
  case "from-registry-v1": {
609
- const t = `${lr(e.registryUrl)}${de.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 = Je(i);
610
+ const t = `${ur(e.registryUrl)}${de.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 = Ge(i);
610
611
  return {
611
612
  type: "explicit",
612
613
  template: {
@@ -622,7 +623,7 @@ class an {
622
623
  };
623
624
  }
624
625
  case "from-registry-v2": {
625
- const r = await this.v2RegistryProvider.getRegistry(e.registryUrl).getComponents(e.id), o = async () => Je(await this.remoteContentCache.forceFetch(r.model.url)), n = async () => await this.remoteContentCache.forceFetch(r.workflow.main.url), [i, a] = await Promise.all([o(), n()]);
626
+ const r = await this.v2RegistryProvider.getRegistry(e.registryUrl).getComponents(e.id), o = async () => Ge(await this.remoteContentCache.forceFetch(r.model.url)), n = async () => await this.remoteContentCache.forceFetch(r.workflow.main.url), [i, a] = await Promise.all([o(), n()]);
626
627
  return {
627
628
  type: "explicit",
628
629
  template: {
@@ -642,25 +643,25 @@ class an {
642
643
  }
643
644
  }
644
645
  }
645
- function cn(s, e) {
646
- const t = { config: e.config, source: e.source }, r = s.createStruct(on, JSON.stringify(t));
647
- return s.createField(x(r, ns), "Input", xt(s, e.template)), s.createField(x(r, is), "Input", sn(s, e.frontend)), s.lock(r), r;
646
+ function un(s, e) {
647
+ const t = { config: e.config, source: e.source }, r = s.createStruct(an, JSON.stringify(t));
648
+ return s.createField(x(r, is), "Input", jt(s, e.template)), s.createField(x(r, as), "Input", nn(s, e.frontend)), s.lock(r), r;
648
649
  }
649
- function ur(s, e) {
650
+ function dr(s, e) {
650
651
  switch (e.type) {
651
652
  case "explicit":
652
- return cn(s, e);
653
+ return un(s, e);
653
654
  default:
654
655
  return K(e.type);
655
656
  }
656
657
  }
657
- function Ge(s, e) {
658
+ function Me(s, e) {
658
659
  return { __isRef: !0, blockId: s, name: e };
659
660
  }
660
- function ln(s) {
661
+ function dn(s) {
661
662
  return typeof s == "object" && s !== null && "__isRef" in s && s.__isRef === !0 && "blockId" in s && "name" in s;
662
663
  }
663
- function kt(s, e, t) {
664
+ function $t(s, e, t) {
664
665
  const r = typeof e;
665
666
  switch (r) {
666
667
  case "function":
@@ -673,21 +674,21 @@ function kt(s, e, t) {
673
674
  return;
674
675
  case "object":
675
676
  if (e === null) return;
676
- if (ln(e))
677
+ if (dn(e))
677
678
  t === void 0 || t.has(e.blockId) ? s.upstreams.add(e.blockId) : s.missingReferences = !0;
678
679
  else if (Array.isArray(e))
679
- for (const o of e) kt(s, o, t);
680
+ for (const o of e) $t(s, o, t);
680
681
  else
681
682
  for (const [, o] of Object.entries(e))
682
- kt(s, o, t);
683
+ $t(s, o, t);
683
684
  return;
684
685
  default:
685
686
  K(r);
686
687
  }
687
688
  }
688
- function un(s, e) {
689
+ function pn(s, e) {
689
690
  const t = { upstreams: /* @__PURE__ */ new Set(), missingReferences: !1 };
690
- return kt(t, s, e), t;
691
+ return $t(t, s, e), t;
691
692
  }
692
693
  function se(s) {
693
694
  return {
@@ -696,10 +697,10 @@ function se(s) {
696
697
  }
697
698
  };
698
699
  }
699
- class as {
700
+ class cs {
700
701
  constructor(e) {
701
702
  /** Nodes are stored in the map in topological order */
702
- S(this, "nodes");
703
+ w(this, "nodes");
703
704
  this.nodes = e;
704
705
  }
705
706
  traverseIds(e, ...t) {
@@ -736,14 +737,14 @@ function Ot(s) {
736
737
  };
737
738
  e.set(r, o), t === void 0 ? o.upstream = /* @__PURE__ */ new Set() : (o.upstream = /* @__PURE__ */ new Set([t.id]), t.downstream = /* @__PURE__ */ new Set([o.id])), t = o;
738
739
  }
739
- return t !== void 0 && (t.downstream = /* @__PURE__ */ new Set()), new as(e);
740
+ return t !== void 0 && (t.downstream = /* @__PURE__ */ new Set()), new cs(e);
740
741
  }
741
- function qe(s, e) {
742
+ function Ye(s, e) {
742
743
  const t = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Set();
743
744
  for (const { id: o } of se(s)) {
744
745
  const n = e(o);
745
746
  if (n === void 0) continue;
746
- const i = un(n, r), a = {
747
+ const i = pn(n, r), a = {
747
748
  id: o,
748
749
  missingReferences: i.missingReferences,
749
750
  upstream: i.upstreams,
@@ -752,41 +753,41 @@ function qe(s, e) {
752
753
  };
753
754
  t.set(o, a), i.upstreams.forEach((c) => t.get(c).downstream.add(o)), r.add(o);
754
755
  }
755
- return new as(t);
756
+ return new cs(t);
756
757
  }
757
- function dn(s, e) {
758
+ function hn(s, e) {
758
759
  if (s.size !== e.size) return !1;
759
760
  for (const t of s) if (!e.has(t)) return !1;
760
761
  return !0;
761
762
  }
762
- function $t(s, e) {
763
- if (s.size > e.size) return $t(e, s);
763
+ function Ft(s, e) {
764
+ if (s.size > e.size) return Ft(e, s);
764
765
  for (const t of s) if (e.has(t)) return !0;
765
766
  return !1;
766
767
  }
767
- function dr(s, e) {
768
+ function pr(s, e) {
768
769
  const t = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new Set();
769
770
  return s.nodes.forEach((n) => {
770
771
  const i = e.nodes.get(n.id);
771
- i === void 0 ? t.add(n.id) : (!dn(n.upstream, i.upstream) || $t(n.upstream, o)) && o.add(n.id);
772
+ i === void 0 ? t.add(n.id) : (!hn(n.upstream, i.upstream) || Ft(n.upstream, o)) && o.add(n.id);
772
773
  }), e.nodes.forEach((n) => {
773
- s.nodes.has(n.id) ? $t(n.upstream, o) && o.add(n.id) : r.add(n.id);
774
+ s.nodes.has(n.id) ? Ft(n.upstream, o) && o.add(n.id) : r.add(n.id);
774
775
  }), { onlyInA: t, onlyInB: r, different: o };
775
776
  }
776
- let ut;
777
- async function cs() {
778
- if (ut === void 0) {
779
- const s = await tn(ro["pframes.export-pframe"]);
777
+ let dt;
778
+ async function ls() {
779
+ if (dt === void 0) {
780
+ const s = await sn(ro["pframes.export-pframe"]);
780
781
  if (s.type !== "explicit") throw new Error("Unexpected prepared template type.");
781
782
  const e = Ne("sha256").update(s.content).digest("hex");
782
- ut = { spec: s, hash: e };
783
+ dt = { spec: s, hash: e };
783
784
  }
784
- return ut;
785
+ return dt;
785
786
  }
786
- function pn(s, e, t) {
787
- return ts(s, e, !0, { pf: t }, ["result"]).result;
787
+ function fn(s, e, t) {
788
+ return rs(s, e, !0, { pf: t }, ["result"]).result;
788
789
  }
789
- function dt(s, e) {
790
+ function pt(s, e) {
790
791
  let t = !1, r, o;
791
792
  return () => {
792
793
  if (!t)
@@ -795,13 +796,13 @@ function dt(s, e) {
795
796
  return r !== n && (r = n, o = e()), e();
796
797
  };
797
798
  }
798
- class pr {
799
+ class hr {
799
800
  constructor(e, t) {
800
- S(this, "currentInputsC", dt(
801
+ w(this, "currentInputsC", pt(
801
802
  () => this.fields.currentArgs.modCount,
802
803
  () => JSON.parse(Buffer.from(this.fields.currentArgs.value).toString())
803
804
  ));
804
- S(this, "actualProductionInputsC", dt(
805
+ w(this, "actualProductionInputsC", pt(
805
806
  () => {
806
807
  var e;
807
808
  return (e = this.fields.prodArgs) == null ? void 0 : e.modCount;
@@ -813,7 +814,7 @@ class pr {
813
814
  return JSON.parse(Buffer.from(e).toString());
814
815
  }
815
816
  ));
816
- S(this, "productionStaleC", dt(
817
+ w(this, "productionStaleC", pt(
817
818
  () => {
818
819
  var e;
819
820
  return `${this.fields.currentArgs.modCount}_${(e = this.fields.prodArgs) == null ? void 0 : e.modCount}`;
@@ -859,34 +860,34 @@ class pr {
859
860
  getTemplate(e) {
860
861
  return e.getFutureFieldValue(
861
862
  A.unwrapHolder(e, this.fields.blockPack.ref),
862
- ns,
863
+ is,
863
864
  "Input"
864
865
  );
865
866
  }
866
867
  }
867
- const hn = (s) => {
868
+ const gn = (s) => {
868
869
  throw new Error(`No new block info for ${s}`);
869
870
  };
870
- class Ze {
871
+ class et {
871
872
  constructor(e, t, r, o, n, i, a, c, u, l, d, f) {
872
- S(this, "globalModCount", 0);
873
- S(this, "fieldsChanged", !1);
873
+ w(this, "globalModCount", 0);
874
+ w(this, "fieldsChanged", !1);
874
875
  //
875
876
  // Change trackers
876
877
  //
877
- S(this, "lastModifiedChanged", !1);
878
- S(this, "structureChanged", !1);
879
- S(this, "metaChanged", !1);
880
- S(this, "renderingStateChanged", !1);
881
- S(this, "changedBlockFrontendStates", /* @__PURE__ */ new Set());
878
+ w(this, "lastModifiedChanged", !1);
879
+ w(this, "structureChanged", !1);
880
+ w(this, "metaChanged", !1);
881
+ w(this, "renderingStateChanged", !1);
882
+ w(this, "changedBlockFrontendStates", /* @__PURE__ */ new Set());
882
883
  /** Set blocks will be assigned current mutator author marker on save */
883
- S(this, "blocksWithChangedInputs", /* @__PURE__ */ new Set());
884
+ w(this, "blocksWithChangedInputs", /* @__PURE__ */ new Set());
884
885
  //
885
886
  // Graph calculation
886
887
  //
887
- S(this, "stagingGraph");
888
- S(this, "pendingProductionGraph");
889
- S(this, "actualProductionGraph");
888
+ w(this, "stagingGraph");
889
+ w(this, "pendingProductionGraph");
890
+ w(this, "actualProductionGraph");
890
891
  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;
891
892
  }
892
893
  fixProblemsAndMigrate() {
@@ -895,7 +896,7 @@ class Ze {
895
896
  });
896
897
  let e;
897
898
  this.blockInfos.forEach((t) => {
898
- t.fields.blockSettings === void 0 && (e === void 0 && (e = this.createJsonFieldValue(Yt)), this.setBlockFieldObj(t.id, "blockSettings", e));
899
+ t.fields.blockSettings === void 0 && (e === void 0 && (e = this.createJsonFieldValue(Qt)), this.setBlockFieldObj(t.id, "blockSettings", e));
899
900
  });
900
901
  }
901
902
  get wasModified() {
@@ -908,13 +909,13 @@ class Ze {
908
909
  return this.stagingGraph === void 0 && (this.stagingGraph = Ot(this.struct)), this.stagingGraph;
909
910
  }
910
911
  getPendingProductionGraph() {
911
- return this.pendingProductionGraph === void 0 && (this.pendingProductionGraph = qe(
912
+ return this.pendingProductionGraph === void 0 && (this.pendingProductionGraph = Ye(
912
913
  this.struct,
913
914
  (e) => this.getBlockInfo(e).currentInputs
914
915
  )), this.pendingProductionGraph;
915
916
  }
916
917
  getActualProductionGraph() {
917
- return this.actualProductionGraph === void 0 && (this.actualProductionGraph = qe(
918
+ return this.actualProductionGraph === void 0 && (this.actualProductionGraph = Ye(
918
919
  this.struct,
919
920
  (e) => this.getBlockInfo(e).actualProductionInputs
920
921
  )), this.actualProductionGraph;
@@ -1012,7 +1013,7 @@ class Ze {
1012
1013
  if (((n = o.fields.prodCtx) == null ? void 0 : n.ref) === void 0)
1013
1014
  throw new Error("One of the upstreams staging is not rendered.");
1014
1015
  t.push(A.unwrapHolder(this.tx, o.fields.prodCtx.ref));
1015
- }), ar(this.tx, t);
1016
+ }), cr(this.tx, t);
1016
1017
  }
1017
1018
  createStagingCtx(e) {
1018
1019
  const t = [];
@@ -1022,16 +1023,16 @@ class Ze {
1022
1023
  if (((n = o.fields.stagingCtx) == null ? void 0 : n.ref) === void 0)
1023
1024
  throw new Error("One of the upstreams staging is not rendered.");
1024
1025
  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));
1025
- }), ar(this.tx, t);
1026
+ }), cr(this.tx, t);
1026
1027
  }
1027
1028
  exportCtx(e) {
1028
- return pn(this.tx, A.unwrapHolder(this.tx, this.ctxExportTplHolder), e);
1029
+ return fn(this.tx, A.unwrapHolder(this.tx, this.ctxExportTplHolder), e);
1029
1030
  }
1030
1031
  renderStagingFor(e) {
1031
1032
  this.resetStaging(e);
1032
1033
  const t = this.getBlockInfo(e), r = this.createStagingCtx(this.getStagingGraph().nodes.get(e).upstream);
1033
1034
  if (this.getBlock(e).renderingMode !== "Heavy") throw new Error("not supported yet");
1034
- const o = t.getTemplate(this.tx), n = ir(this.tx, o, {
1035
+ const o = t.getTemplate(this.tx), n = ar(this.tx, o, {
1035
1036
  args: t.fields.currentArgs.ref,
1036
1037
  blockId: this.tx.createValue(A.JsonString, JSON.stringify(e)),
1037
1038
  isProduction: this.tx.createValue(A.JsonBool, JSON.stringify(!1)),
@@ -1049,7 +1050,7 @@ class Ze {
1049
1050
  const t = this.getBlockInfo(e), r = this.createProdCtx(this.getPendingProductionGraph().nodes.get(e).upstream);
1050
1051
  if (this.getBlock(e).renderingMode === "Light")
1051
1052
  throw new Error("Can't render production for light block.");
1052
- const o = t.getTemplate(this.tx), n = ir(this.tx, o, {
1053
+ const o = t.getTemplate(this.tx), n = ar(this.tx, o, {
1053
1054
  args: t.fields.currentArgs.ref,
1054
1055
  blockId: this.tx.createValue(A.JsonString, JSON.stringify(e)),
1055
1056
  isProduction: this.tx.createValue(A.JsonBool, JSON.stringify(!0)),
@@ -1066,26 +1067,26 @@ class Ze {
1066
1067
  // Structure changes
1067
1068
  //
1068
1069
  /** Very generic method, better check for more specialized case-specific methods first. */
1069
- updateStructure(e, t = hn) {
1070
- const r = this.getStagingGraph(), o = this.getActualProductionGraph(), n = Ot(e), i = qe(
1070
+ updateStructure(e, t = gn) {
1071
+ const r = this.getStagingGraph(), o = this.getActualProductionGraph(), n = Ot(e), i = Ye(
1071
1072
  e,
1072
1073
  (u) => {
1073
1074
  var l;
1074
1075
  return (l = this.blockInfos.get(u)) == null ? void 0 : l.actualProductionInputs;
1075
1076
  }
1076
- ), a = dr(r, n), c = dr(o, i);
1077
+ ), a = pr(r, n), c = pr(o, i);
1077
1078
  for (const u of a.onlyInA) {
1078
1079
  const { fields: l } = this.getBlockInfo(u);
1079
1080
  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);
1080
1081
  }
1081
1082
  for (const u of a.onlyInB) {
1082
- const l = new pr(u, {});
1083
+ const l = new hr(u, {});
1083
1084
  this.blockInfos.set(u, l);
1084
- const d = t(u), f = ur(this.tx, d.blockPack);
1085
+ const d = t(u), f = dr(this.tx, d.blockPack);
1085
1086
  this.setBlockField(u, "blockPack", A.wrapInHolder(this.tx, f), "NotReady"), this.setBlockFieldObj(
1086
1087
  u,
1087
1088
  "blockSettings",
1088
- this.createJsonFieldValue(Yt)
1089
+ this.createJsonFieldValue(Qt)
1089
1090
  ), this.setBlockFieldObj(u, "currentArgs", this.createJsonFieldValueByContent(d.args)), d.uiState && (this.blockFrontendStates.set(u, d.uiState), this.changedBlockFrontendStates.add(u)), l.check();
1090
1091
  }
1091
1092
  for (const u of a.different) this.resetStaging(u);
@@ -1137,7 +1138,7 @@ class Ze {
1137
1138
  this.setBlockField(
1138
1139
  e,
1139
1140
  "blockPack",
1140
- A.wrapInHolder(this.tx, ur(this.tx, t)),
1141
+ A.wrapInHolder(this.tx, dr(this.tx, t)),
1141
1142
  "NotReady"
1142
1143
  ), r !== void 0 ? (this.setArgs([{ blockId: e, args: r }]), this.setUiState(e, void 0)) : this.getStagingGraph().traverse("downstream", [e], ({ id: n }) => this.resetStaging(n)), o.productionRendered && this.getActualProductionGraph().traverse(
1143
1144
  "downstream",
@@ -1186,7 +1187,7 @@ class Ze {
1186
1187
  * accordingly */
1187
1188
  stopProduction(...e) {
1188
1189
  var i, a;
1189
- const t = this.getActualProductionGraph(), r = new zr(e), o = new Set(e), n = [];
1190
+ const t = this.getActualProductionGraph(), r = new Xr(e), o = new Set(e), n = [];
1190
1191
  for (; !r.isEmpty(); ) {
1191
1192
  const c = r.shift(), u = this.getBlockInfo(c).fields;
1192
1193
  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")) {
@@ -1246,14 +1247,14 @@ class Ze {
1246
1247
  assignAuthorMarkers() {
1247
1248
  const e = this.author ? JSON.stringify(this.author) : void 0;
1248
1249
  for (const t of this.blocksWithChangedInputs)
1249
- e === void 0 ? this.tx.deleteKValue(this.rid, Rt(t)) : this.tx.setKValue(this.rid, Rt(t), e);
1250
- (this.metaChanged || this.structureChanged) && (e === void 0 ? this.tx.deleteKValue(this.rid, Et) : this.tx.setKValue(this.rid, Et, e));
1250
+ e === void 0 ? this.tx.deleteKValue(this.rid, Ct(t)) : this.tx.setKValue(this.rid, Ct(t), e);
1251
+ (this.metaChanged || this.structureChanged) && (e === void 0 ? this.tx.deleteKValue(this.rid, Pt) : this.tx.setKValue(this.rid, Pt, e));
1251
1252
  }
1252
1253
  save() {
1253
1254
  if (this.wasModified) {
1254
1255
  this.lastModifiedChanged && this.tx.setKValue(this.rid, Te, JSON.stringify(this.lastModified)), this.structureChanged && this.tx.setKValue(this.rid, pe, JSON.stringify(this.struct)), this.renderingStateChanged && this.tx.setKValue(
1255
1256
  this.rid,
1256
- Qe,
1257
+ Ze,
1257
1258
  JSON.stringify({
1258
1259
  ...this.renderingState,
1259
1260
  blocksInLimbo: [...this.blocksInLimbo]
@@ -1261,17 +1262,17 @@ class Ze {
1261
1262
  ), this.metaChanged && this.tx.setKValue(this.rid, Le, JSON.stringify(this.meta));
1262
1263
  for (const e of this.changedBlockFrontendStates) {
1263
1264
  const t = this.blockFrontendStates.get(e);
1264
- t === void 0 ? this.tx.deleteKValue(this.rid, Ct(e)) : this.tx.setKValue(this.rid, Ct(e), t);
1265
+ t === void 0 ? this.tx.deleteKValue(this.rid, Et(e)) : this.tx.setKValue(this.rid, Et(e), t);
1265
1266
  }
1266
1267
  this.assignAuthorMarkers();
1267
1268
  }
1268
1269
  }
1269
1270
  static async load(e, t, r) {
1270
- const o = e.getResourceData(t, !0), n = e.getKValueJson(t, Qr), i = e.getKValueJson(t, Te), a = e.getKValueJson(t, Le), c = e.getKValueJson(t, pe), u = e.getKValueJson(t, Qe), l = e.listKeyValuesString(t), [
1271
+ const o = e.getResourceData(t, !0), n = e.getKValueJson(t, Zr), i = e.getKValueJson(t, Te), a = e.getKValueJson(t, Le), c = e.getKValueJson(t, pe), u = e.getKValueJson(t, Ze), l = e.listKeyValuesString(t), [
1271
1272
  d,
1272
1273
  f,
1273
1274
  h,
1274
- R,
1275
+ E,
1275
1276
  g,
1276
1277
  { stagingRefreshTimestamp: D, blocksInLimbo: T },
1277
1278
  j
@@ -1284,49 +1285,49 @@ class Ze {
1284
1285
  u,
1285
1286
  l
1286
1287
  ]);
1287
- if (f !== Zr)
1288
+ if (f !== es)
1288
1289
  throw new Error(
1289
1290
  `Can't act on this project resource because it has a wrong schema version: ${f}`
1290
1291
  );
1291
- const $ = /* @__PURE__ */ new Map();
1292
+ const O = /* @__PURE__ */ new Map();
1292
1293
  for (const p of d.fields) {
1293
- const m = xo(p.name);
1294
+ const m = Vo(p.name);
1294
1295
  if (m === void 0) continue;
1295
- let y = $.get(m.blockId);
1296
+ let y = O.get(m.blockId);
1296
1297
  y === void 0 && (y = {
1297
1298
  id: m.blockId,
1298
1299
  fields: {}
1299
- }, $.set(m.blockId, y)), y.fields[m.fieldName] = Ye(p.value) ? { modCount: 0 } : { modCount: 0, ref: p.value };
1300
+ }, O.set(m.blockId, y)), y.fields[m.fieldName] = Qe(p.value) ? { modCount: 0 } : { modCount: 0, ref: p.value };
1300
1301
  }
1301
- const G = await cs(), he = Pt(G.hash), L = d.fields.find(
1302
+ const G = await ls(), he = kt(G.hash), L = d.fields.find(
1302
1303
  (p) => p.name === he
1303
1304
  );
1304
1305
  let X;
1305
- L !== void 0 ? X = St(L.value) : (X = A.wrapInHolder(e, xt(e, G.spec)), e.createField(
1306
- x(t, Pt(G.hash)),
1306
+ L !== void 0 ? X = bt(L.value) : (X = A.wrapInHolder(e, jt(e, G.spec)), e.createField(
1307
+ x(t, kt(G.hash)),
1307
1308
  "Dynamic",
1308
1309
  X
1309
1310
  ));
1310
1311
  const ie = { stagingRefreshTimestamp: D }, W = new Set(T), M = /* @__PURE__ */ new Map();
1311
1312
  for (const p of j) {
1312
- const m = Do(p.key);
1313
+ const m = Bo(p.key);
1313
1314
  m !== void 0 && M.set(m, p.value);
1314
1315
  }
1315
1316
  const V = [];
1316
- $.forEach(({ fields: p }) => {
1317
+ O.forEach(({ fields: p }) => {
1317
1318
  for (const [, m] of Object.entries(p))
1318
1319
  if (m.ref !== void 0) {
1319
- if (!_s(m.ref) || Ks(m.ref))
1320
+ if (!Ks(m.ref) || Hs(m.ref))
1320
1321
  throw new Error("unexpected behaviour");
1321
1322
  V.push([m, e.getResourceData(m.ref, !1)]);
1322
1323
  }
1323
1324
  });
1324
1325
  for (const [p, m] of V) {
1325
1326
  const y = await m;
1326
- p.value = y.data, Zt(y.error) ? p.status = "Error" : y.resourceReady || Zt(y.originalResourceId) ? p.status = "Ready" : p.status = "NotReady";
1327
+ p.value = y.data, er(y.error) ? p.status = "Error" : y.resourceReady || er(y.originalResourceId) ? p.status = "Ready" : p.status = "NotReady";
1327
1328
  }
1328
1329
  const q = /* @__PURE__ */ new Map();
1329
- $.forEach(({ id: p, fields: m }) => q.set(p, new pr(p, m)));
1330
+ O.forEach(({ id: p, fields: m }) => q.set(p, new hr(p, m)));
1330
1331
  const fe = /* @__PURE__ */ new Set();
1331
1332
  for (const p of se(g)) {
1332
1333
  if (!q.has(p.id))
@@ -1338,13 +1339,13 @@ class Ze {
1338
1339
  throw new Error(`Inconsistent project structure: no structure entry for ${p.id}`);
1339
1340
  p.check();
1340
1341
  });
1341
- const v = new Ze(
1342
+ const v = new et(
1342
1343
  t,
1343
1344
  e,
1344
1345
  r,
1345
1346
  f,
1346
1347
  h,
1347
- R,
1348
+ E,
1348
1349
  g,
1349
1350
  ie,
1350
1351
  W,
@@ -1355,33 +1356,33 @@ class Ze {
1355
1356
  return v.fixProblemsAndMigrate(), v;
1356
1357
  }
1357
1358
  }
1358
- async function fn(s, e = Fo) {
1359
- const t = s.createEphemeral(Io);
1359
+ async function mn(s, e = Ao) {
1360
+ const t = s.createEphemeral(To);
1360
1361
  s.lock(t);
1361
1362
  const r = String(Date.now());
1362
- s.setKValue(t, Qr, JSON.stringify(Zr)), s.setKValue(t, Bt, r), s.setKValue(t, Te, r), s.setKValue(t, Le, JSON.stringify(e)), s.setKValue(t, pe, JSON.stringify(Oo)), s.setKValue(t, Qe, JSON.stringify($o));
1363
- const o = await cs();
1363
+ s.setKValue(t, Zr, JSON.stringify(es)), s.setKValue(t, xt, r), s.setKValue(t, Te, r), s.setKValue(t, Le, JSON.stringify(e)), s.setKValue(t, pe, JSON.stringify(Fo)), s.setKValue(t, Ze, JSON.stringify(Io));
1364
+ const o = await ls();
1364
1365
  return s.createField(
1365
- x(t, Pt(o.hash)),
1366
+ x(t, kt(o.hash)),
1366
1367
  "Dynamic",
1367
- A.wrapInHolder(s, xt(s, o.spec))
1368
+ A.wrapInHolder(s, jt(s, o.spec))
1368
1369
  ), t;
1369
1370
  }
1370
- async function Me(s, e, t) {
1371
+ async function _e(s, e, t) {
1371
1372
  return Q(s, e, void 0, t);
1372
1373
  }
1373
1374
  async function Q(s, e, t, r) {
1374
- if (s instanceof Ms)
1375
+ if (s instanceof _s)
1375
1376
  return await s.withWriteTx("ProjectAction", async (o) => {
1376
- const n = await Ze.load(o, e, t), i = await r(n);
1377
+ const n = await et.load(o, e, t), i = await r(n);
1377
1378
  return n.wasModified && (n.save(), await o.commit()), i;
1378
1379
  });
1379
1380
  {
1380
- const o = await Ze.load(s, e, t), n = await r(o);
1381
+ const o = await et.load(s, e, t), n = await r(o);
1381
1382
  return o.save(), n;
1382
1383
  }
1383
1384
  }
1384
- function* gn(s) {
1385
+ function* vn(s) {
1385
1386
  switch (s.type) {
1386
1387
  case "Json":
1387
1388
  return;
@@ -1396,21 +1397,21 @@ function* gn(s) {
1396
1397
  K(s);
1397
1398
  }
1398
1399
  }
1399
- function hr(s, e) {
1400
+ function fr(s, e) {
1400
1401
  return Object.fromEntries(
1401
1402
  Object.entries(s).map(([t, r]) => [t, e(r, t)])
1402
1403
  );
1403
1404
  }
1404
- function mn(s, e) {
1405
+ function yn(s, e) {
1405
1406
  switch (s.type) {
1406
1407
  case "Json":
1407
1408
  return { ...s };
1408
1409
  case "JsonPartitioned":
1409
- return { ...s, parts: hr(s.parts, e) };
1410
+ return { ...s, parts: fr(s.parts, e) };
1410
1411
  case "BinaryPartitioned":
1411
1412
  return {
1412
1413
  ...s,
1413
- parts: hr(s.parts, (t) => ({
1414
+ parts: fr(s.parts, (t) => ({
1414
1415
  index: e(t.index),
1415
1416
  values: e(t.values)
1416
1417
  }))
@@ -1419,26 +1420,26 @@ function mn(s, e) {
1419
1420
  K(s);
1420
1421
  }
1421
1422
  }
1422
- const vn = De("PColumnData/JsonPartitioned", "1"), yn = De(
1423
+ const wn = De("PColumnData/JsonPartitioned", "1"), Sn = De(
1423
1424
  "PColumnData/Partitioned/JsonPartitioned",
1424
1425
  "1"
1425
- ), wn = De("PColumnData/BinaryPartitioned", "1"), Sn = De(
1426
+ ), bn = De("PColumnData/BinaryPartitioned", "1"), Rn = De(
1426
1427
  "PColumnData/Partitioned/BinaryPartitioned",
1427
1428
  "1"
1428
- ), bn = De("PColumnData/Json", "1");
1429
+ ), En = De("PColumnData/Json", "1");
1429
1430
  function Cn(s) {
1430
1431
  if (!s.getIsReadyOrError()) throw new Error("Data not ready.");
1431
1432
  const e = s.getDataAsJson();
1432
1433
  if (e === void 0)
1433
1434
  throw new Error("unexpected data info structure, no resource data");
1434
- if (ce(s.resourceType, bn)) {
1435
+ if (ce(s.resourceType, En)) {
1435
1436
  const t = e;
1436
1437
  return {
1437
1438
  type: "Json",
1438
1439
  keyLength: t.keyLength,
1439
1440
  data: t.data
1440
1441
  };
1441
- } else if (ce(s.resourceType, vn)) {
1442
+ } else if (ce(s.resourceType, wn)) {
1442
1443
  const t = e, r = Object.fromEntries(
1443
1444
  s.listInputFields().map((o) => [o, s.traverse({ field: o, errorIfFieldNotSet: !0 }).resourceInfo])
1444
1445
  );
@@ -1447,7 +1448,7 @@ function Cn(s) {
1447
1448
  partitionKeyLength: t.partitionKeyLength,
1448
1449
  parts: r
1449
1450
  };
1450
- } else if (ce(s.resourceType, yn)) {
1451
+ } else if (ce(s.resourceType, Sn)) {
1451
1452
  const t = e, r = {};
1452
1453
  for (const o of s.listInputFields()) {
1453
1454
  const n = s.traverse({ field: o, errorIfFieldNotSet: !0 }), i = n.listInputFields();
@@ -1465,7 +1466,7 @@ function Cn(s) {
1465
1466
  partitionKeyLength: t.superPartitionKeyLength + t.partitionKeyLength,
1466
1467
  parts: r
1467
1468
  };
1468
- } else if (ce(s.resourceType, wn)) {
1469
+ } else if (ce(s.resourceType, bn)) {
1469
1470
  const t = e, r = {};
1470
1471
  for (const o of s.listInputFields())
1471
1472
  if (o.endsWith(".index")) {
@@ -1486,7 +1487,7 @@ function Cn(s) {
1486
1487
  partitionKeyLength: t.partitionKeyLength,
1487
1488
  parts: r
1488
1489
  };
1489
- } else if (ce(s.resourceType, Sn)) {
1490
+ } else if (ce(s.resourceType, Rn)) {
1490
1491
  const t = e, r = {};
1491
1492
  for (const o of s.listInputFields()) {
1492
1493
  const n = s.traverse({ field: o, errorIfFieldNotSet: !0 }), i = n.listInputFields();
@@ -1520,9 +1521,9 @@ function Cn(s) {
1520
1521
  parts: r
1521
1522
  };
1522
1523
  }
1523
- throw new Error(`unsupported resource type: ${Hs(s.resourceType)}`);
1524
+ throw new Error(`unsupported resource type: ${Ws(s.resourceType)}`);
1524
1525
  }
1525
- function Rn(s, e) {
1526
+ function Pn(s, e) {
1526
1527
  const t = s.axesSpec.length, r = {};
1527
1528
  for (const { key: o, val: n } of e) {
1528
1529
  if (o.length !== t)
@@ -1535,17 +1536,17 @@ function Rn(s, e) {
1535
1536
  data: r
1536
1537
  };
1537
1538
  }
1538
- function En(s, e) {
1539
+ function kn(s, e) {
1539
1540
  const t = Ne("sha256");
1540
- return t.update(Z(s)), t.update(String(Ye(e.originalId) ? e.id : e.originalId)), t.digest().toString("hex");
1541
+ return t.update(Z(s)), t.update(String(Qe(e.originalId) ? e.id : e.originalId)), t.digest().toString("hex");
1541
1542
  }
1542
- function fr(s, e) {
1543
+ function gr(s, e) {
1543
1544
  return Z({ __isRef: !0, blockId: s, name: e });
1544
1545
  }
1545
- function Pn(s, e) {
1546
+ function $n(s, e) {
1546
1547
  return Z({ resolvePath: s, name: e });
1547
1548
  }
1548
- function ls(s, e = !0, t = !1, r = "") {
1549
+ function us(s, e = !0, t = !1, r = "") {
1549
1550
  var a, c, u;
1550
1551
  const o = /^(?<name>.*)\.(?<type>spec|data)$/, n = /* @__PURE__ */ new Map();
1551
1552
  for (const l of s.listInputFields()) {
@@ -1561,17 +1562,17 @@ function ls(s, e = !0, t = !1, r = "") {
1561
1562
  }
1562
1563
  f = f.slice(r.length);
1563
1564
  const h = B((c = d.groups) == null ? void 0 : c.type);
1564
- let R = n.get(f);
1565
- switch (R === void 0 && (R = {}, n.set(f, R)), h) {
1565
+ let E = n.get(f);
1566
+ switch (E === void 0 && (E = {}, n.set(f, E)), h) {
1566
1567
  case "spec":
1567
- R.spec = (u = s.traverse({
1568
+ E.spec = (u = s.traverse({
1568
1569
  field: l,
1569
1570
  ignoreError: t,
1570
1571
  pureFieldErrorToUndefined: t
1571
1572
  })) == null ? void 0 : u.getDataAsJson();
1572
1573
  break;
1573
1574
  case "data":
1574
- R.hasData = !0, R.data = () => s.traverseOrError({
1575
+ E.hasData = !0, E.data = () => s.traverseOrError({
1575
1576
  field: l,
1576
1577
  ignoreError: t
1577
1578
  });
@@ -1583,10 +1584,10 @@ function ls(s, e = !0, t = !1, r = "") {
1583
1584
  for (const [, l] of n) l.data === void 0 && (l.hasData = !1);
1584
1585
  return { locked: i, results: n };
1585
1586
  }
1586
- function kn(s, e = !0, t = "", r) {
1587
+ function On(s, e = !0, t = "", r) {
1587
1588
  if (!s.getIsReadyOrError()) throw new Error("resource is not ready");
1588
- const o = ls(s, e, !1, t);
1589
- so(o.locked);
1589
+ const o = us(s, e, !1, t);
1590
+ oo(o.locked);
1590
1591
  const n = {};
1591
1592
  for (const [i, a] of o.results) {
1592
1593
  if (a.spec === void 0) throw new Error(`no spec for key ${i}`);
@@ -1594,18 +1595,18 @@ function kn(s, e = !0, t = "", r) {
1594
1595
  throw new Error(`no data for key ${i}`);
1595
1596
  const c = a.data();
1596
1597
  if (c === void 0) throw new Error(`no data for key ${i}`);
1597
- if (!c.ok) throw new Ys(c.error);
1598
+ if (!c.ok) throw so(c.error);
1598
1599
  n[i] = {
1599
- id: r.length === 0 ? En(a.spec, c.value) : Pn(r, i),
1600
+ id: r.length === 0 ? kn(a.spec, c.value) : $n(r, i),
1600
1601
  spec: a.spec,
1601
1602
  data: c.value
1602
1603
  };
1603
1604
  }
1604
1605
  return n;
1605
1606
  }
1606
- class jt {
1607
+ class Vt {
1607
1608
  constructor(e, t) {
1608
- S(this, "allSpecsAvailable");
1609
+ w(this, "allSpecsAvailable");
1609
1610
  this.ctx = e, this.blocks = t;
1610
1611
  let r = !0;
1611
1612
  e: for (const o of t.values())
@@ -1637,8 +1638,8 @@ class jt {
1637
1638
  if (r === void 0) return;
1638
1639
  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);
1639
1640
  if (o !== void 0 && o.spec !== void 0 && n !== void 0)
1640
- return Jr(n, (u) => ({
1641
- id: fr(e, t),
1641
+ return Gr(n, (u) => ({
1642
+ id: gr(e, t),
1642
1643
  spec: o.spec,
1643
1644
  data: u
1644
1645
  }));
@@ -1675,9 +1676,9 @@ class jt {
1675
1676
  if (c.spec !== void 0 && c.hasData === !0 && c.data !== void 0) {
1676
1677
  const u = c.data();
1677
1678
  u !== void 0 ? e.push({
1678
- ref: Ge(i, a),
1679
+ ref: Me(i, a),
1679
1680
  obj: {
1680
- id: u.ok ? fr(i, a) : void 0,
1681
+ id: u.ok ? gr(i, a) : void 0,
1681
1682
  spec: c.spec,
1682
1683
  data: u
1683
1684
  }
@@ -1711,7 +1712,7 @@ class jt {
1711
1712
  i.staging.locked || o(`staging_not_locked:${n}`);
1712
1713
  for (const [c, u] of i.staging.results)
1713
1714
  u.spec !== void 0 && (e.push({
1714
- ref: Ge(n, c),
1715
+ ref: Me(n, c),
1715
1716
  obj: u.spec
1716
1717
  }), a.add(c));
1717
1718
  } else o(`staging_not_rendered:${n}`);
@@ -1719,7 +1720,7 @@ class jt {
1719
1720
  i.prod.locked || o(`prod_not_locked:${n}`);
1720
1721
  for (const [c, u] of i.prod.results)
1721
1722
  a.has(c) || u.spec !== void 0 && e.push({
1722
- ref: Ge(n, c),
1723
+ ref: Me(n, c),
1723
1724
  obj: u.spec
1724
1725
  });
1725
1726
  }
@@ -1731,9 +1732,9 @@ class jt {
1731
1732
  for (const r of this.blocks.values()) {
1732
1733
  const o = /* @__PURE__ */ new Set(), n = (i) => {
1733
1734
  for (const [a, c] of i.results)
1734
- o.has(a) || c.spec === void 0 || (o.add(a), Is(e, c.spec) && t.push({
1735
+ o.has(a) || c.spec === void 0 || (o.add(a), As(e, c.spec) && t.push({
1735
1736
  label: r.info.label + " / " + a,
1736
- ref: Ge(r.info.id, a),
1737
+ ref: Me(r.info.id, a),
1737
1738
  spec: c.spec
1738
1739
  }));
1739
1740
  };
@@ -1745,7 +1746,7 @@ class jt {
1745
1746
  const o = e.accessor(t).node(), n = B(o.getKeyValueAsJson(pe)), a = Ot(n).traverseIds("upstream", r), c = /* @__PURE__ */ new Map();
1746
1747
  for (const u of se(n)) {
1747
1748
  if (!a.has(u.id)) continue;
1748
- const l = gr(
1749
+ const l = mr(
1749
1750
  o.traverse({
1750
1751
  field: U(u.id, "prodCtx"),
1751
1752
  ignoreError: !0,
@@ -1756,7 +1757,7 @@ class jt {
1756
1757
  field: U(u.id, "prodUiCtx"),
1757
1758
  stableIfNotFound: !0
1758
1759
  })
1759
- ), d = gr(
1760
+ ), d = mr(
1760
1761
  o.traverse({
1761
1762
  field: U(u.id, "stagingCtx"),
1762
1763
  ignoreError: !0,
@@ -1768,15 +1769,15 @@ class jt {
1768
1769
  );
1769
1770
  c.set(u.id, { info: u, prod: l, staging: d });
1770
1771
  }
1771
- return new jt(e, c);
1772
+ return new Vt(e, c);
1772
1773
  }
1773
1774
  }
1774
- function gr(s, e) {
1775
+ function mr(s, e) {
1775
1776
  if (e === void 0)
1776
1777
  return s ? { locked: !1, results: /* @__PURE__ */ new Map() } : void 0;
1777
- if (e.ok) return ls(e.value, !1, !0);
1778
+ if (e.ok) return us(e.value, !1, !0);
1778
1779
  }
1779
- function Vt(s, e) {
1780
+ function Ut(s, e) {
1780
1781
  return {
1781
1782
  blockId: e,
1782
1783
  args: (n) => B(
@@ -1792,7 +1793,7 @@ function Vt(s, e) {
1792
1793
  stableIfNotFound: !0
1793
1794
  })) == null ? void 0 : i.getDataAsString();
1794
1795
  },
1795
- uiState: (n) => n.accessor(s).node().getKeyValueAsString(Ct(e)),
1796
+ uiState: (n) => n.accessor(s).node().getKeyValueAsString(Et(e)),
1796
1797
  blockMeta: (n) => {
1797
1798
  const i = n.accessor(s).node(), a = B(i.getKeyValueAsJson(pe)), c = /* @__PURE__ */ new Map();
1798
1799
  for (const u of se(a)) c.set(u.id, u);
@@ -1800,9 +1801,9 @@ function Vt(s, e) {
1800
1801
  }
1801
1802
  };
1802
1803
  }
1803
- function us(s, e) {
1804
+ function ds(s, e) {
1804
1805
  return {
1805
- ...Vt(s, e),
1806
+ ...Ut(s, e),
1806
1807
  prod: (t) => {
1807
1808
  var r;
1808
1809
  return (r = t.accessor(s).node({ ignoreError: !0 }).traverse({
@@ -1819,7 +1820,7 @@ function us(s, e) {
1819
1820
  })) == null ? void 0 : o.persist();
1820
1821
  return r === void 0 && t.markUnstable("staging_not_rendered"), r;
1821
1822
  },
1822
- getResultsPool: (t) => jt.create(t, s, e)
1823
+ getResultsPool: (t) => Vt.create(t, s, e)
1823
1824
  };
1824
1825
  }
1825
1826
  function* z(s, e) {
@@ -1874,15 +1875,15 @@ function* z(s, e) {
1874
1875
  K(s);
1875
1876
  }
1876
1877
  }
1877
- function On(s, e) {
1878
+ function Fn(s, e) {
1878
1879
  const t = {};
1879
1880
  for (const [r, o] of Object.entries(s)) t[r] = e(o);
1880
1881
  return t;
1881
1882
  }
1882
- function $e(s, e) {
1883
+ function Fe(s, e) {
1883
1884
  return s === void 0 ? void 0 : e(s);
1884
1885
  }
1885
- function $n(s) {
1886
+ function In(s) {
1886
1887
  switch (s.type) {
1887
1888
  case "GetImportProgress":
1888
1889
  return !0;
@@ -1890,60 +1891,60 @@ function $n(s) {
1890
1891
  return !1;
1891
1892
  }
1892
1893
  }
1893
- function Fn(s) {
1894
- for (const e of z(s)) if ($n(e)) return !0;
1894
+ function An(s) {
1895
+ for (const e of z(s)) if (In(e)) return !0;
1895
1896
  return !1;
1896
1897
  }
1897
- function tt(s) {
1898
+ function rt(s) {
1898
1899
  return {
1899
1900
  type: "ReturnResult",
1900
1901
  result: s
1901
1902
  };
1902
1903
  }
1903
1904
  function P(s) {
1904
- return () => tt(s);
1905
+ return () => rt(s);
1905
1906
  }
1906
- const In = (s) => {
1907
+ const Tn = (s) => {
1907
1908
  const e = {};
1908
1909
  for (const [t, r] of Object.entries(s)) e[t] = r;
1909
1910
  return P(e);
1910
- }, An = (s) => {
1911
+ }, Ln = (s) => {
1911
1912
  const e = s.source;
1912
1913
  if (e === void 0) return P(void 0);
1913
1914
  const t = [];
1914
1915
  for (const r of e)
1915
1916
  r instanceof Array ? t.push(...r) : t.push(r);
1916
1917
  return P(t);
1917
- }, Tn = (s) => {
1918
+ }, Dn = (s) => {
1918
1919
  const e = s.source, t = s.field;
1919
1920
  return e === void 0 || t === void 0 ? P(void 0) : ({ cCtx: r }) => {
1920
1921
  var o;
1921
- return tt((o = r.accessor(e).node().traverse(t)) == null ? void 0 : o.persist());
1922
+ return rt((o = r.accessor(e).node().traverse(t)) == null ? void 0 : o.persist());
1922
1923
  };
1923
1924
  };
1924
- function ds(s, e) {
1925
+ function ps(s, e) {
1925
1926
  const t = {}, r = s.length;
1926
1927
  for (let o = 0; o < r; o++) t[String(o)] = e(s[o]);
1927
1928
  return t;
1928
1929
  }
1929
- function Ln(s, e) {
1930
+ function Nn(s, e) {
1930
1931
  return (t) => {
1931
1932
  const r = t.source;
1932
1933
  return r === void 0 ? P(void 0) : () => ({
1933
1934
  type: "ScheduleSubroutine",
1934
- subroutine: ps(r.length),
1935
- args: ds(r, (o) => k({ ...s, [e.itVar]: o }, e.mapping))
1935
+ subroutine: hs(r.length),
1936
+ args: ps(r, (o) => k({ ...s, [e.itVar]: o }, e.mapping))
1936
1937
  });
1937
1938
  };
1938
1939
  }
1939
- function ps(s) {
1940
+ function hs(s) {
1940
1941
  return (e) => {
1941
1942
  const t = [];
1942
1943
  for (let r = 0; r < s; r++) t.push(e[String(r)]);
1943
1944
  return P(t);
1944
1945
  };
1945
1946
  }
1946
- function Dn(s, e) {
1947
+ function Bn(s, e) {
1947
1948
  return (t) => {
1948
1949
  const r = t.source;
1949
1950
  if (r === void 0) return P(void 0);
@@ -1954,34 +1955,34 @@ function Dn(s, e) {
1954
1955
  }
1955
1956
  return () => ({
1956
1957
  type: "ScheduleSubroutine",
1957
- subroutine: Nn,
1958
+ subroutine: xn,
1958
1959
  args: o
1959
1960
  });
1960
1961
  };
1961
1962
  }
1962
- const Nn = (s) => P(s), Bn = (s) => {
1963
+ const xn = (s) => P(s), jn = (s) => {
1963
1964
  const e = s.arg;
1964
1965
  return P(e === void 0 ? void 0 : e.length === 0);
1965
- }, xn = (s) => {
1966
+ }, Vn = (s) => {
1966
1967
  const e = s.operand;
1967
1968
  return P(e === void 0 ? void 0 : !e);
1968
- }, jn = (s) => {
1969
+ }, Un = (s) => {
1969
1970
  const e = s.operand1, t = s.operand2;
1970
1971
  return P(e === void 0 || t === void 0 ? void 0 : e && t);
1971
- }, Vn = (s) => {
1972
+ }, Jn = (s) => {
1972
1973
  const e = s.operand1, t = s.operand2;
1973
1974
  return P(e === void 0 || t === void 0 ? void 0 : e || t);
1974
- }, Un = (s) => {
1975
+ }, Gn = (s) => {
1975
1976
  const e = s.source;
1976
1977
  return e === void 0 ? P(void 0) : ({ cCtx: t }) => {
1977
1978
  var r;
1978
- return tt((r = t.accessor(e).node()) == null ? void 0 : r.getDataAsJson());
1979
+ return rt((r = t.accessor(e).node()) == null ? void 0 : r.getDataAsJson());
1979
1980
  };
1980
- }, Jn = (s) => {
1981
+ }, Mn = (s) => {
1981
1982
  const e = s.source, t = s.field;
1982
1983
  return P(e === void 0 || t === void 0 ? void 0 : e[t]);
1983
1984
  };
1984
- function Gn(s, e) {
1985
+ function _n(s, e) {
1985
1986
  return (t) => {
1986
1987
  const r = t.source;
1987
1988
  return r === void 0 ? P(void 0) : ({ cCtx: o }) => {
@@ -1996,13 +1997,13 @@ function Gn(s, e) {
1996
1997
  }
1997
1998
  return {
1998
1999
  type: "ScheduleSubroutine",
1999
- subroutine: Mn,
2000
+ subroutine: Kn,
2000
2001
  args: i
2001
2002
  };
2002
2003
  };
2003
2004
  };
2004
2005
  }
2005
- const Mn = (s) => P(s), _n = (s) => {
2006
+ const Kn = (s) => P(s), Hn = (s) => {
2006
2007
  const e = s.source;
2007
2008
  return e === void 0 ? P(void 0) : ({ drivers: t }) => ({
2008
2009
  type: "ScheduleComputable",
@@ -2016,7 +2017,7 @@ const Mn = (s) => P(s), _n = (s) => {
2016
2017
  }
2017
2018
  )
2018
2019
  });
2019
- }, Kn = (s) => {
2020
+ }, Wn = (s) => {
2020
2021
  const e = s.source;
2021
2022
  return e === void 0 ? P(void 0) : ({ cCtx: t, drivers: r }) => {
2022
2023
  const o = t.accessor(e).node().resourceInfo;
@@ -2027,7 +2028,7 @@ const Mn = (s) => P(s), _n = (s) => {
2027
2028
  })
2028
2029
  };
2029
2030
  };
2030
- }, Hn = (s) => {
2031
+ }, zn = (s) => {
2031
2032
  const e = s.source;
2032
2033
  return e === void 0 ? P(void 0) : ({ drivers: t }) => ({
2033
2034
  type: "ScheduleComputable",
@@ -2043,49 +2044,49 @@ const Mn = (s) => P(s), _n = (s) => {
2043
2044
  }
2044
2045
  )
2045
2046
  });
2046
- }, Wn = (s) => {
2047
+ }, Xn = (s) => {
2047
2048
  const e = s.source;
2048
2049
  return e === void 0 ? P(void 0) : ({ drivers: t }) => ({
2049
2050
  type: "ScheduleComputable",
2050
2051
  computable: t.blobDriver.getDownloadedBlob(e)
2051
2052
  });
2052
- }, zn = (s) => {
2053
+ }, qn = (s) => {
2053
2054
  const e = s.source;
2054
2055
  return e === void 0 ? P(void 0) : ({ drivers: t }) => ({
2055
2056
  type: "ScheduleComputable",
2056
2057
  computable: t.blobDriver.getOnDemandBlob(e)
2057
2058
  });
2058
- }, Xn = (s) => (e) => {
2059
+ }, Yn = (s) => (e) => {
2059
2060
  const t = e.source;
2060
2061
  return t === void 0 ? P(void 0) : ({ drivers: r }) => ({
2061
2062
  type: "ScheduleComputable",
2062
2063
  computable: r.blobToURLDriver.extractArchiveAndGetURL(t, s)
2063
2064
  });
2064
- }, qn = (s) => {
2065
+ }, Qn = (s) => {
2065
2066
  const e = s.source;
2066
2067
  return e === void 0 ? P(void 0) : ({ drivers: t }) => ({
2067
2068
  type: "ScheduleComputable",
2068
2069
  computable: t.uploadDriver.getProgressId(e)
2069
2070
  });
2070
- }, Yn = (s) => (e) => {
2071
+ }, Zn = (s) => (e) => {
2071
2072
  const t = e.source;
2072
2073
  return t === void 0 ? P(void 0) : ({ drivers: r }) => ({
2073
2074
  type: "ScheduleComputable",
2074
2075
  computable: r.logDriver.getLastLogs(t, s)
2075
2076
  });
2076
- }, Qn = (s) => (e) => {
2077
+ }, ei = (s) => (e) => {
2077
2078
  const t = e.source;
2078
2079
  return t === void 0 ? P(void 0) : ({ drivers: r }) => ({
2079
2080
  type: "ScheduleComputable",
2080
2081
  computable: r.logDriver.getProgressLog(t, s)
2081
2082
  });
2082
- }, Zn = (s) => (e) => {
2083
+ }, ti = (s) => (e) => {
2083
2084
  const t = e.source;
2084
2085
  return t === void 0 ? P(void 0) : ({ drivers: r }) => ({
2085
2086
  type: "ScheduleComputable",
2086
2087
  computable: r.logDriver.getProgressLogWithInfo(t, s)
2087
2088
  });
2088
- }, ei = (s) => {
2089
+ }, ri = (s) => {
2089
2090
  const e = s.source;
2090
2091
  return e === void 0 ? P(void 0) : ({ drivers: t }) => ({
2091
2092
  type: "ScheduleComputable",
@@ -2096,19 +2097,19 @@ function k(s, e) {
2096
2097
  switch (e.type) {
2097
2098
  case "GetFromCtx": {
2098
2099
  const t = s[e.variable];
2099
- return typeof t == "function" ? (r) => tt(t(r.cCtx)) : P(t);
2100
+ return typeof t == "function" ? (r) => rt(t(r.cCtx)) : P(t);
2100
2101
  }
2101
2102
  case "Isolate":
2102
2103
  return ({ drivers: t }) => ({
2103
2104
  type: "ScheduleComputable",
2104
- computable: gs(t, s, e.cfg)
2105
+ computable: ms(t, s, e.cfg)
2105
2106
  });
2106
2107
  case "Immediate":
2107
2108
  return P(e.value);
2108
2109
  case "GetJsonField":
2109
2110
  return () => ({
2110
2111
  type: "ScheduleSubroutine",
2111
- subroutine: Jn,
2112
+ subroutine: Mn,
2112
2113
  args: {
2113
2114
  source: k(s, e.source),
2114
2115
  field: k(s, e.field)
@@ -2117,7 +2118,7 @@ function k(s, e) {
2117
2118
  case "MapArrayValues":
2118
2119
  return () => ({
2119
2120
  type: "ScheduleSubroutine",
2120
- subroutine: Ln(s, e),
2121
+ subroutine: Nn(s, e),
2121
2122
  args: {
2122
2123
  source: k(s, e.source)
2123
2124
  }
@@ -2125,7 +2126,7 @@ function k(s, e) {
2125
2126
  case "MapRecordValues":
2126
2127
  return () => ({
2127
2128
  type: "ScheduleSubroutine",
2128
- subroutine: Dn(s, e),
2129
+ subroutine: Bn(s, e),
2129
2130
  args: {
2130
2131
  source: k(s, e.source)
2131
2132
  }
@@ -2133,19 +2134,19 @@ function k(s, e) {
2133
2134
  case "MakeObject":
2134
2135
  return () => ({
2135
2136
  type: "ScheduleSubroutine",
2136
- subroutine: In,
2137
- args: On(e.template, (t) => k(s, t))
2137
+ subroutine: Tn,
2138
+ args: Fn(e.template, (t) => k(s, t))
2138
2139
  });
2139
2140
  case "MakeArray":
2140
2141
  return () => ({
2141
2142
  type: "ScheduleSubroutine",
2142
- subroutine: ps(e.template.length),
2143
- args: ds(e.template, (t) => k(s, t))
2143
+ subroutine: hs(e.template.length),
2144
+ args: ps(e.template, (t) => k(s, t))
2144
2145
  });
2145
2146
  case "Flatten":
2146
2147
  return () => ({
2147
2148
  type: "ScheduleSubroutine",
2148
- subroutine: An,
2149
+ subroutine: Ln,
2149
2150
  args: {
2150
2151
  source: k(s, e.source)
2151
2152
  }
@@ -2153,7 +2154,7 @@ function k(s, e) {
2153
2154
  case "IsEmpty":
2154
2155
  return () => ({
2155
2156
  type: "ScheduleSubroutine",
2156
- subroutine: Bn,
2157
+ subroutine: jn,
2157
2158
  args: {
2158
2159
  arg: k(s, e.arg)
2159
2160
  }
@@ -2161,7 +2162,7 @@ function k(s, e) {
2161
2162
  case "Not":
2162
2163
  return () => ({
2163
2164
  type: "ScheduleSubroutine",
2164
- subroutine: xn,
2165
+ subroutine: Vn,
2165
2166
  args: {
2166
2167
  operand: k(s, e.operand)
2167
2168
  }
@@ -2169,7 +2170,7 @@ function k(s, e) {
2169
2170
  case "And":
2170
2171
  return () => ({
2171
2172
  type: "ScheduleSubroutine",
2172
- subroutine: jn,
2173
+ subroutine: Un,
2173
2174
  args: {
2174
2175
  operand1: k(s, e.operand1),
2175
2176
  operand2: k(s, e.operand2)
@@ -2178,7 +2179,7 @@ function k(s, e) {
2178
2179
  case "Or":
2179
2180
  return () => ({
2180
2181
  type: "ScheduleSubroutine",
2181
- subroutine: Vn,
2182
+ subroutine: Jn,
2182
2183
  args: {
2183
2184
  operand1: k(s, e.operand1),
2184
2185
  operand2: k(s, e.operand2)
@@ -2187,7 +2188,7 @@ function k(s, e) {
2187
2188
  case "MapResourceFields":
2188
2189
  return () => ({
2189
2190
  type: "ScheduleSubroutine",
2190
- subroutine: Gn(s, e),
2191
+ subroutine: _n(s, e),
2191
2192
  args: {
2192
2193
  source: k(s, e.source)
2193
2194
  }
@@ -2195,7 +2196,7 @@ function k(s, e) {
2195
2196
  case "GetResourceField":
2196
2197
  return () => ({
2197
2198
  type: "ScheduleSubroutine",
2198
- subroutine: Tn,
2199
+ subroutine: Dn,
2199
2200
  args: {
2200
2201
  source: k(s, e.source),
2201
2202
  field: k(s, e.field)
@@ -2204,7 +2205,7 @@ function k(s, e) {
2204
2205
  case "GetResourceValueAsJson":
2205
2206
  return () => ({
2206
2207
  type: "ScheduleSubroutine",
2207
- subroutine: Un,
2208
+ subroutine: Gn,
2208
2209
  args: {
2209
2210
  source: k(s, e.source)
2210
2211
  }
@@ -2212,7 +2213,7 @@ function k(s, e) {
2212
2213
  case "GetBlobContent":
2213
2214
  return () => ({
2214
2215
  type: "ScheduleSubroutine",
2215
- subroutine: _n,
2216
+ subroutine: Hn,
2216
2217
  args: {
2217
2218
  source: k(s, e.source)
2218
2219
  }
@@ -2220,7 +2221,7 @@ function k(s, e) {
2220
2221
  case "GetBlobContentAsString":
2221
2222
  return () => ({
2222
2223
  type: "ScheduleSubroutine",
2223
- subroutine: Kn,
2224
+ subroutine: Wn,
2224
2225
  args: {
2225
2226
  source: k(s, e.source)
2226
2227
  }
@@ -2228,7 +2229,7 @@ function k(s, e) {
2228
2229
  case "GetBlobContentAsJson":
2229
2230
  return () => ({
2230
2231
  type: "ScheduleSubroutine",
2231
- subroutine: Hn,
2232
+ subroutine: zn,
2232
2233
  args: {
2233
2234
  source: k(s, e.source)
2234
2235
  }
@@ -2236,7 +2237,7 @@ function k(s, e) {
2236
2237
  case "GetDownloadedBlobContent":
2237
2238
  return () => ({
2238
2239
  type: "ScheduleSubroutine",
2239
- subroutine: Wn,
2240
+ subroutine: Xn,
2240
2241
  args: {
2241
2242
  source: k(s, e.source)
2242
2243
  }
@@ -2244,7 +2245,7 @@ function k(s, e) {
2244
2245
  case "GetOnDemandBlobContent":
2245
2246
  return () => ({
2246
2247
  type: "ScheduleSubroutine",
2247
- subroutine: zn,
2248
+ subroutine: qn,
2248
2249
  args: {
2249
2250
  source: k(s, e.source)
2250
2251
  }
@@ -2252,7 +2253,7 @@ function k(s, e) {
2252
2253
  case "ExtractArchiveAndGetURL":
2253
2254
  return () => ({
2254
2255
  type: "ScheduleSubroutine",
2255
- subroutine: Xn(e.format),
2256
+ subroutine: Yn(e.format),
2256
2257
  args: {
2257
2258
  source: k(s, e.source)
2258
2259
  }
@@ -2260,7 +2261,7 @@ function k(s, e) {
2260
2261
  case "GetImportProgress":
2261
2262
  return () => ({
2262
2263
  type: "ScheduleSubroutine",
2263
- subroutine: qn,
2264
+ subroutine: Qn,
2264
2265
  args: {
2265
2266
  source: k(s, e.source)
2266
2267
  }
@@ -2268,7 +2269,7 @@ function k(s, e) {
2268
2269
  case "GetLastLogs":
2269
2270
  return () => ({
2270
2271
  type: "ScheduleSubroutine",
2271
- subroutine: Yn(e.lines),
2272
+ subroutine: Zn(e.lines),
2272
2273
  args: {
2273
2274
  source: k(s, e.source)
2274
2275
  }
@@ -2276,7 +2277,7 @@ function k(s, e) {
2276
2277
  case "GetProgressLog":
2277
2278
  return () => ({
2278
2279
  type: "ScheduleSubroutine",
2279
- subroutine: Qn(e.patternToSearch),
2280
+ subroutine: ei(e.patternToSearch),
2280
2281
  args: {
2281
2282
  source: k(s, e.source)
2282
2283
  }
@@ -2284,7 +2285,7 @@ function k(s, e) {
2284
2285
  case "GetProgressLogWithInfo":
2285
2286
  return () => ({
2286
2287
  type: "ScheduleSubroutine",
2287
- subroutine: Zn(e.patternToSearch),
2288
+ subroutine: ti(e.patternToSearch),
2288
2289
  args: {
2289
2290
  source: k(s, e.source)
2290
2291
  }
@@ -2292,7 +2293,7 @@ function k(s, e) {
2292
2293
  case "GetLogHandle":
2293
2294
  return () => ({
2294
2295
  type: "ScheduleSubroutine",
2295
- subroutine: ei,
2296
+ subroutine: ri,
2296
2297
  args: {
2297
2298
  source: k(s, e.source)
2298
2299
  }
@@ -2301,8 +2302,8 @@ function k(s, e) {
2301
2302
  return K(e);
2302
2303
  }
2303
2304
  }
2304
- const ti = ["$prod", "$staging"];
2305
- function ri(s) {
2305
+ const si = ["$prod", "$staging"];
2306
+ function oi(s) {
2306
2307
  return {
2307
2308
  $blockId: s.blockId,
2308
2309
  $args: (e) => JSON.parse(s.args(e)),
@@ -2314,16 +2315,16 @@ function ri(s) {
2314
2315
  $staging: s.staging
2315
2316
  };
2316
2317
  }
2317
- const hs = Symbol(), fs = "return", si = { op: hs, arg: fs };
2318
- function oi(s) {
2319
- return s.op == hs && s.arg == fs;
2318
+ const fs = Symbol(), gs = "return", ni = { op: fs, arg: gs };
2319
+ function ii(s) {
2320
+ return s.op == fs && s.arg == gs;
2320
2321
  }
2321
- function ni() {
2322
+ function ai() {
2322
2323
  return { pendingSubroutines: /* @__PURE__ */ new Map() };
2323
2324
  }
2324
- function mr(s, e, t, r) {
2325
- const o = new zr(t), n = (a, c) => {
2326
- if (oi(a))
2325
+ function vr(s, e, t, r) {
2326
+ const o = new Xr(t), n = (a, c) => {
2327
+ if (ii(a))
2327
2328
  return e.result = c, !1;
2328
2329
  const u = B(e.pendingSubroutines.get(a.op));
2329
2330
  if (a.arg in u.args) throw new Error("argument already set");
@@ -2375,26 +2376,26 @@ function mr(s, e, t, r) {
2375
2376
  }
2376
2377
  return i;
2377
2378
  }
2378
- function ii(s, e, t, r = {}) {
2379
- return gs(s, ri(e), t, r);
2379
+ function ci(s, e, t, r = {}) {
2380
+ return ms(s, oi(e), t, r);
2380
2381
  }
2381
- function gs(s, e, t, r = {}) {
2382
+ function ms(s, e, t, r = {}) {
2382
2383
  const o = `${e.blockId}#` + Z({
2383
2384
  ctx: Object.fromEntries(
2384
- Object.entries(e).filter(([n]) => ti.indexOf(n) === -1)
2385
+ Object.entries(e).filter(([n]) => si.indexOf(n) === -1)
2385
2386
  ),
2386
2387
  cfg: t
2387
2388
  });
2388
2389
  return J.makeRaw(
2389
2390
  (n) => {
2390
- const i = { drivers: s, cCtx: n }, a = ni();
2391
+ const i = { drivers: s, cCtx: n }, a = ai();
2391
2392
  return {
2392
- ir: mr(
2393
+ ir: vr(
2393
2394
  i,
2394
2395
  a,
2395
2396
  [
2396
2397
  {
2397
- destination: si,
2398
+ destination: ni,
2398
2399
  operation: k(e, t)
2399
2400
  }
2400
2401
  ],
@@ -2402,21 +2403,21 @@ function gs(s, e, t, r = {}) {
2402
2403
  ),
2403
2404
  postprocessValue(u) {
2404
2405
  const l = [];
2405
- for (const R of u)
2406
- l.push({ destination: R.destination, operation: P(R.computable) });
2406
+ for (const E of u)
2407
+ l.push({ destination: E.destination, operation: P(E.computable) });
2407
2408
  const d = {
2408
2409
  drivers: s,
2409
2410
  get cCtx() {
2410
2411
  throw new Error("asynchronous operations are forbidden in this context");
2411
2412
  }
2412
2413
  }, f = /* @__PURE__ */ new Map();
2413
- for (const [R, g] of a.pendingSubroutines)
2414
- f.set(R, { ...g, args: { ...g.args } });
2414
+ for (const [E, g] of a.pendingSubroutines)
2415
+ f.set(E, { ...g, args: { ...g.args } });
2415
2416
  const h = {
2416
2417
  result: a.result,
2417
2418
  pendingSubroutines: f
2418
2419
  };
2419
- if (mr(d, h, l, !1), !("result" in h))
2420
+ if (vr(d, h, l, !1), !("result" in h))
2420
2421
  throw new Error("illegal cfg rendering stack state, no result");
2421
2422
  return h.result;
2422
2423
  }
@@ -2425,25 +2426,26 @@ function gs(s, e, t, r = {}) {
2425
2426
  { ...r, key: o }
2426
2427
  );
2427
2428
  }
2428
- function ai(s) {
2429
+ function li(s) {
2429
2430
  return s instanceof ArrayBuffer || ArrayBuffer.isView(s);
2430
2431
  }
2431
- function vr(s) {
2432
+ function yr(s) {
2432
2433
  return s !== void 0 ? Buffer.from(s).toString("base64") : void 0;
2433
2434
  }
2434
- class et {
2435
+ class tt {
2435
2436
  constructor(e, t, r, o, n) {
2436
- S(this, "callbackRegistry");
2437
- S(this, "fnJSONStringify");
2438
- S(this, "fnJSONParse");
2439
- S(this, "computablesToResolve", {});
2440
- S(this, "computableCtx");
2441
- S(this, "accessors", /* @__PURE__ */ new Map());
2442
- S(this, "meta");
2437
+ w(this, "callbackRegistry");
2438
+ w(this, "fnJSONStringify");
2439
+ w(this, "fnJSONParse");
2440
+ w(this, "computablesToResolve", {});
2441
+ w(this, "computableCtx");
2442
+ w(this, "accessors", /* @__PURE__ */ new Map());
2443
+ w(this, "meta");
2444
+ w(this, "errorRepo", new ui());
2443
2445
  //
2444
2446
  // Result Pool
2445
2447
  //
2446
- S(this, "_resultPool");
2448
+ w(this, "_resultPool");
2447
2449
  if (this.scope = e, this.vm = t, this.blockCtx = r, this.env = o, this.computableCtx = n, this.callbackRegistry = this.scope.manage(this.vm.newObject()), this.fnJSONStringify = e.manage(
2448
2450
  t.getProp(t.global, "JSON").consume((i) => t.getProp(i, "stringify"))
2449
2451
  ), t.typeof(this.fnJSONStringify) !== "function")
@@ -2463,12 +2465,12 @@ class et {
2463
2465
  try {
2464
2466
  this.vm.unwrapResult(this.vm.evalCode(e, "bundle.js", { type: "global" })).dispose();
2465
2467
  } catch (t) {
2466
- throw et.cleanErrorContext(t), t;
2468
+ throw tt.cleanErrorContext(t), t;
2467
2469
  }
2468
2470
  }
2469
2471
  runCallback(e, ...t) {
2470
2472
  try {
2471
- return bt.withScope((r) => {
2473
+ return Rt.withScope((r) => {
2472
2474
  const o = r.manage(this.vm.getProp(this.callbackRegistry, e));
2473
2475
  if (this.vm.typeof(o) !== "function")
2474
2476
  throw new Error(`No such callback: ${e}`);
@@ -2483,7 +2485,7 @@ class et {
2483
2485
  );
2484
2486
  });
2485
2487
  } catch (r) {
2486
- throw et.cleanErrorContext(r), r;
2488
+ throw tt.cleanErrorContext(r), this.errorRepo.getOriginal(r);
2487
2489
  }
2488
2490
  }
2489
2491
  //
@@ -2538,13 +2540,13 @@ class et {
2538
2540
  return this.getAccessor(e).listDynamicFields();
2539
2541
  }
2540
2542
  getKeyValueBase64(e, t) {
2541
- return vr(this.getAccessor(e).getKeyValue(t));
2543
+ return yr(this.getAccessor(e).getKeyValue(t));
2542
2544
  }
2543
2545
  getKeyValueAsString(e, t) {
2544
2546
  return this.getAccessor(e).getKeyValueAsString(t);
2545
2547
  }
2546
2548
  getDataBase64(e) {
2547
- return vr(this.getAccessor(e).getData());
2549
+ return yr(this.getAccessor(e).getData());
2548
2550
  }
2549
2551
  getDataAsString(e) {
2550
2552
  return this.getAccessor(e).getDataAsString();
@@ -2555,7 +2557,7 @@ class et {
2555
2557
  parsePObjectCollection(e, t, r, ...o) {
2556
2558
  const n = this.getAccessor(e);
2557
2559
  if (!n.getIsReadyOrError()) return;
2558
- const i = kn(n, t, r, o), a = {};
2560
+ const i = On(n, t, r, o), a = {};
2559
2561
  for (const [c, u] of Object.entries(i))
2560
2562
  a[c] = le(u, (l) => this.wrapAccessor(l));
2561
2563
  return a;
@@ -2564,7 +2566,7 @@ class et {
2564
2566
  // Blobs
2565
2567
  //
2566
2568
  registerComputable(e, t) {
2567
- const r = `${e}_${Ae()}`;
2569
+ const r = `${e}_${we()}`;
2568
2570
  return this.computablesToResolve[r] = t, r;
2569
2571
  }
2570
2572
  getBlobContentAsString(e) {
@@ -2703,7 +2705,7 @@ class et {
2703
2705
  obj: {
2704
2706
  id: t.obj.id,
2705
2707
  spec: t.obj.spec,
2706
- data: Jr(t.obj.data, (r) => this.wrapAccessor(r))
2708
+ data: Gr(t.obj.data, (r) => this.wrapAccessor(r))
2707
2709
  }
2708
2710
  }))
2709
2711
  };
@@ -2740,7 +2742,7 @@ class et {
2740
2742
  "can't instantiate PTable from this context (most porbably called from the future mapper)"
2741
2743
  );
2742
2744
  return this.env.driverKit.pFrameDriver.createPTable(
2743
- yt(
2745
+ wt(
2744
2746
  e,
2745
2747
  (t) => le(t, (r) => typeof r == "string" ? this.getAccessor(r) : r)
2746
2748
  ),
@@ -2764,7 +2766,7 @@ class et {
2764
2766
  }
2765
2767
  wrapAccessor(e) {
2766
2768
  if (e !== void 0) {
2767
- const t = Ae();
2769
+ const t = we();
2768
2770
  return this.accessors.set(t, e), t;
2769
2771
  }
2770
2772
  }
@@ -2797,7 +2799,7 @@ class et {
2797
2799
  r = this.vm.null;
2798
2800
  break;
2799
2801
  }
2800
- if (ai(e)) {
2802
+ if (li(e)) {
2801
2803
  r = this.vm.newArrayBuffer(e), o = !0;
2802
2804
  break;
2803
2805
  }
@@ -2833,15 +2835,23 @@ class et {
2833
2835
  return JSON.parse(t);
2834
2836
  }
2835
2837
  injectCtx() {
2836
- bt.withScope((e) => {
2838
+ Rt.withScope((e) => {
2837
2839
  const t = e.manage(this.vm.newObject()), r = this.blockCtx.args(this.computableCtx), o = this.blockCtx.activeArgs(this.computableCtx), n = this.blockCtx.uiState(this.computableCtx);
2838
2840
  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(
2839
2841
  t,
2840
2842
  "featureFlags",
2841
- this.exportObjectUniversal(As.GlobalCfgRenderCtxFeatureFlags, e)
2843
+ this.exportObjectUniversal(Ts.GlobalCfgRenderCtxFeatureFlags, e)
2842
2844
  );
2843
2845
  const i = (a, c) => {
2844
- this.vm.newFunction(a, c).consume((u) => this.vm.setProp(t, a, u));
2846
+ const u = (...l) => {
2847
+ try {
2848
+ return c(...l);
2849
+ } catch (d) {
2850
+ const f = this.errorRepo.setAndRecreateForQuickJS(d);
2851
+ throw this.vm.newError(f);
2852
+ }
2853
+ };
2854
+ this.vm.newFunction(a, u).consume((l) => this.vm.setProp(t, a, l)), this.vm.newFunction(a, c).consume((l) => this.vm.setProp(t, a + "__internal__", l));
2845
2855
  };
2846
2856
  i("getAccessorHandleByName", (a) => this.exportSingleValue(
2847
2857
  this.getAccessorHandleByName(this.vm.getString(a)),
@@ -2923,8 +2933,53 @@ class et {
2923
2933
  });
2924
2934
  }
2925
2935
  }
2926
- function rt(s, e) {
2927
- return $e(
2936
+ class ui {
2937
+ constructor() {
2938
+ w(this, "errorIdToError", /* @__PURE__ */ new Map());
2939
+ }
2940
+ /** Sets the error to the repository and returns a mimicrated error that also has uuid key of the original error. */
2941
+ setAndRecreateForQuickJS(e) {
2942
+ const t = we();
2943
+ return this.errorIdToError.set(t, e), e instanceof Error ? {
2944
+ name: `${e.name}/uuid:${t}`,
2945
+ message: e.message
2946
+ } : {
2947
+ name: `UnknownErrorQuickJS/uuid:${t}`,
2948
+ message: `${e}`
2949
+ };
2950
+ }
2951
+ /** Returns the original error that was stored by parsing uuid of mimicrated error. */
2952
+ getOriginal(e) {
2953
+ if (!(e instanceof no.QuickJSUnwrapError))
2954
+ return console.warn("ErrorRepo: quickJSError is not a QuickJSUnwrapError", Ve(e)), e;
2955
+ if (!("name" in e.cause))
2956
+ return console.warn("ErrorRepo: quickJSError.cause is not an Error", Ve(e)), e;
2957
+ const t = e.cause.name, r = t.slice(t.indexOf("/uuid:") + 6);
2958
+ if (!r)
2959
+ throw new Error(`ErrorRepo: quickJSError.cause.name does not contain errorId: ${t}, ${Ve(e)}`);
2960
+ const o = this.errorIdToError.get(r);
2961
+ if (o === void 0)
2962
+ throw new Error(`ErrorRepo: errorId not found: ${r}, ${Ve(e)}`);
2963
+ return new di(e, o);
2964
+ }
2965
+ }
2966
+ class di extends Error {
2967
+ constructor(t, r) {
2968
+ var o;
2969
+ super("", { cause: r });
2970
+ w(this, "stack");
2971
+ this.name = "ModelError", this.stack = ((o = t.stack) == null ? void 0 : o.replace(t.message, "")) ?? "", this.stack = this.stack.replace(r.message, ""), this.message = this.toString();
2972
+ }
2973
+ toString() {
2974
+ var r;
2975
+ return `ModelError: ${(r = this.cause) == null ? void 0 : r.message}
2976
+ QuickJS stacktrace:
2977
+ ${this.stack}
2978
+ `;
2979
+ }
2980
+ }
2981
+ function st(s, e) {
2982
+ return Fe(
2928
2983
  s.traverse(
2929
2984
  {
2930
2985
  field: U(e, "blockPack"),
@@ -2934,51 +2989,51 @@ function rt(s, e) {
2934
2989
  { field: A.HolderRefField, assertFieldType: "Input", errorIfFieldNotFound: !0 }
2935
2990
  ),
2936
2991
  (t) => {
2937
- const r = t.getDataAsJson(), o = Gr(r.config);
2992
+ const r = t.getDataAsJson(), o = Mr(r.config);
2938
2993
  return { bpId: t.resourceInfo.id.toString(), info: r, cfg: o };
2939
2994
  }
2940
2995
  );
2941
2996
  }
2942
- const _e = process.env.MI_LOG_OUTPUT_STATUS;
2943
- function ci(s, e, t, r, o, n = {}) {
2997
+ const Ke = process.env.MI_LOG_OUTPUT_STATUS;
2998
+ function pi(s, e, t, r, o, n = {}) {
2944
2999
  const i = `${e.blockId}#lambda#${o}#${t.handle}`;
2945
3000
  return n = { ...n, key: i }, n.mode === void 0 && t.retentive === !0 && (n.mode = "StableOnlyRetentive"), J.makeRaw((a) => {
2946
- const c = new bt();
3001
+ const c = new Rt();
2947
3002
  a.addOnDestroy(() => c.dispose());
2948
3003
  const u = c.manage(s.quickJs.newRuntime());
2949
3004
  u.setMemoryLimit(1024 * 1024 * 8), u.setMaxStackSize(1024 * 320);
2950
- const l = c.manage(u.newContext()), d = new et(c, l, e, s, a);
3005
+ const l = c.manage(u.newContext()), d = new tt(c, l, e, s, a);
2951
3006
  d.evaluateBundle(r.content);
2952
3007
  const f = d.runCallback(t.handle);
2953
3008
  d.resetComputableCtx();
2954
3009
  let h = 0;
2955
- return _e && _e !== "unstable-only" && console.log(`Output ${t.handle} scaffold calculated.`), {
3010
+ return Ke && Ke !== "unstable-only" && console.log(`Output ${t.handle} scaffold calculated.`), {
2956
3011
  ir: d.computablesToResolve,
2957
- postprocessValue: (R, { unstableMarker: g, stable: D }) => {
2958
- for (const [j, $] of Object.entries(R)) d.runCallback(j, $);
3012
+ postprocessValue: (E, { unstableMarker: g, stable: D }) => {
3013
+ for (const [j, O] of Object.entries(E)) d.runCallback(j, O);
2959
3014
  const T = d.importObjectUniversal(f);
2960
- return h++, _e && (_e !== "unstable-only" || !D) && console.log(
3015
+ return h++, Ke && (Ke !== "unstable-only" || !D) && console.log(
2961
3016
  D ? `Stable output ${t.handle} calculated ${T !== void 0 ? "defined" : "undefined"}; (#${h})` : `Unstable output ${t.handle}; marker = ${g}; ${T !== void 0 ? "defined" : "undefined"} (#${h})`
2962
3017
  ), T;
2963
3018
  }
2964
3019
  };
2965
3020
  }, n);
2966
3021
  }
2967
- function li(s) {
2968
- return Mr(s) ? s.isActive === !0 : Fn(s);
3022
+ function hi(s) {
3023
+ return _r(s) ? s.isActive === !0 : An(s);
2969
3024
  }
2970
- function Fe(s, e, t, r, o, n = {}) {
2971
- if (Mr(t)) {
3025
+ function Ie(s, e, t, r, o, n = {}) {
3026
+ if (_r(t)) {
2972
3027
  if (r === void 0) throw new Error("No code bundle.");
2973
- return ci(s, e, t, r, o, n);
2974
- } else return ii(s.driverKit, e, t, n);
3028
+ return pi(s, e, t, r, o, n);
3029
+ } else return ci(s.driverKit, e, t, n);
2975
3030
  }
2976
- function ui(s, e, t) {
3031
+ function fi(s, e, t) {
2977
3032
  return J.make(
2978
3033
  (r) => {
2979
- var R, g, D, T, j, $, G, he;
2980
- const o = r.accessor(s).node(), n = B(o.getKeyValueAsJson(Bt)), i = B(o.getKeyValueAsJson(Te)), a = B(o.getKeyValueAsJson(Le)), c = B(o.getKeyValueAsJson(pe)), u = B(
2981
- o.getKeyValueAsJson(Qe)
3034
+ var E, g, D, T, j, O, G, he;
3035
+ const o = r.accessor(s).node(), n = B(o.getKeyValueAsJson(xt)), i = B(o.getKeyValueAsJson(Te)), a = B(o.getKeyValueAsJson(Le)), c = B(o.getKeyValueAsJson(pe)), u = B(
3036
+ o.getKeyValueAsJson(Ze)
2982
3037
  ), l = /* @__PURE__ */ new Map();
2983
3038
  for (const { id: L } of se(c)) {
2984
3039
  const X = o.traverse({
@@ -3005,51 +3060,51 @@ function ui(s, e, t) {
3005
3060
  ie = {
3006
3061
  arguments: W.getDataAsJson(),
3007
3062
  stale: X.id !== W.id,
3008
- outputError: M.error !== void 0 || V.error !== void 0 || ((R = M.value) == null ? void 0 : R.getError()) !== void 0 || ((g = V.value) == null ? void 0 : g.getError()) !== void 0,
3063
+ outputError: M.error !== void 0 || V.error !== void 0 || ((E = M.value) == null ? void 0 : E.getError()) !== void 0 || ((g = V.value) == null ? void 0 : g.getError()) !== void 0,
3009
3064
  outputsError: ((D = M.error) == null ? void 0 : D.getDataAsString()) ?? ((j = (T = M.value) == null ? void 0 : T.getError()) == null ? void 0 : j.getDataAsString()),
3010
- exportsError: (($ = V.error) == null ? void 0 : $.getDataAsString()) ?? ((he = (G = V.value) == null ? void 0 : G.getError()) == null ? void 0 : he.getDataAsString()),
3065
+ exportsError: ((O = V.error) == null ? void 0 : O.getDataAsString()) ?? ((he = (G = V.value) == null ? void 0 : G.getError()) == null ? void 0 : he.getDataAsString()),
3011
3066
  finished: (M.value !== void 0 && M.value.getIsReadyOrError() || M.error !== void 0 && M.error.getIsReadyOrError()) && (V.value !== void 0 && V.value.getIsReadyOrError() || V.error !== void 0 && V.error.getIsReadyOrError())
3012
3067
  };
3013
3068
  }
3014
3069
  l.set(L, { currentArguments: X.getDataAsJson(), prod: ie });
3015
3070
  }
3016
- const d = qe(c, (L) => l.get(L).currentArguments), f = new Set(u.blocksInLimbo), h = [...se(c)].map(({ id: L, label: X, renderingMode: ie }) => {
3017
- var w, C, O, E, I;
3071
+ const d = Ye(c, (L) => l.get(L).currentArguments), f = new Set(u.blocksInLimbo), h = [...se(c)].map(({ id: L, label: X, renderingMode: ie }) => {
3072
+ var S, R, $, C, I;
3018
3073
  const W = B(l.get(L)), M = B(d.nodes.get(L));
3019
3074
  let V = "NotCalculated";
3020
3075
  W.prod !== void 0 && (f.has(L) ? V = "Limbo" : V = W.prod.finished ? "Done" : "Running");
3021
- const q = rt(o, L), { sections: fe, title: v, inputsValid: p, sdkVersion: m } = $e(q, ({ bpId: N, cfg: F }) => {
3022
- const oe = Vt(s, L);
3076
+ const q = st(o, L), { sections: fe, title: v, inputsValid: p, sdkVersion: m } = Fe(q, ({ bpId: N, cfg: F }) => {
3077
+ const oe = Ut(s, L);
3023
3078
  return {
3024
- sections: Fe(
3079
+ sections: Ie(
3025
3080
  t,
3026
3081
  oe,
3027
3082
  F.sections,
3028
3083
  F.code,
3029
3084
  N
3030
3085
  ).wrap({
3031
- recover: (Se) => (t.logger.error("Error in block model sections"), t.logger.error(Se), [])
3086
+ recover: (be) => (t.logger.error("Error in block model sections"), t.logger.error(be), [])
3032
3087
  }),
3033
- title: $e(
3088
+ title: Fe(
3034
3089
  F.title,
3035
- (Se) => Fe(
3090
+ (be) => Ie(
3036
3091
  t,
3037
3092
  oe,
3038
- Se,
3093
+ be,
3039
3094
  F.code,
3040
3095
  N
3041
3096
  ).wrap({
3042
3097
  recover: (Os) => (t.logger.error("Error in block model title"), t.logger.error(Os), "Invalid title")
3043
3098
  })
3044
3099
  ),
3045
- inputsValid: Fe(
3100
+ inputsValid: Ie(
3046
3101
  t,
3047
3102
  oe,
3048
3103
  F.inputsValid,
3049
3104
  F.code,
3050
3105
  N
3051
3106
  ).wrap({
3052
- recover: (Se) => (t.logger.error("Error in block model argsValid"), t.logger.error(Se), !1)
3107
+ recover: (be) => (t.logger.error("Error in block model argsValid"), t.logger.error(be), !1)
3053
3108
  }),
3054
3109
  sdkVersion: F.sdkVersion
3055
3110
  };
@@ -3057,24 +3112,24 @@ function ui(s, e, t) {
3057
3112
  field: U(L, "blockSettings"),
3058
3113
  assertFieldType: "Dynamic",
3059
3114
  errorIfFieldNotSet: !0
3060
- }).getDataAsJson(), b = $e(
3115
+ }).getDataAsJson(), b = Fe(
3061
3116
  q,
3062
3117
  ({ info: N }) => t.blockUpdateWatcher.get({ currentSpec: N.source, settings: y })
3063
3118
  );
3064
3119
  return {
3065
- projectResourceId: Tt(s.rid),
3120
+ projectResourceId: Lt(s.rid),
3066
3121
  id: L,
3067
3122
  label: v ?? X,
3068
3123
  title: v ?? X,
3069
3124
  renderingMode: ie,
3070
- stale: ((w = W.prod) == null ? void 0 : w.stale) !== !1 || V === "Limbo",
3125
+ stale: ((S = W.prod) == null ? void 0 : S.stale) !== !1 || V === "Limbo",
3071
3126
  missingReference: M.missingReferences,
3072
3127
  upstreams: [...d.traverseIdsExcludingRoots("upstream", L)],
3073
3128
  downstreams: [...d.traverseIdsExcludingRoots("downstream", L)],
3074
3129
  calculationStatus: V,
3075
- outputErrors: ((C = W.prod) == null ? void 0 : C.outputError) === !0,
3076
- outputsError: (O = W.prod) == null ? void 0 : O.outputsError,
3077
- exportsError: (E = W.prod) == null ? void 0 : E.exportsError,
3130
+ outputErrors: ((R = W.prod) == null ? void 0 : R.outputError) === !0,
3131
+ outputsError: ($ = W.prod) == null ? void 0 : $.outputsError,
3132
+ exportsError: (C = W.prod) == null ? void 0 : C.exportsError,
3078
3133
  settings: y,
3079
3134
  sections: fe,
3080
3135
  inputsValid: p,
@@ -3089,7 +3144,7 @@ function ui(s, e, t) {
3089
3144
  meta: a,
3090
3145
  created: new Date(n),
3091
3146
  lastModified: new Date(i),
3092
- authorMarker: o.getKeyValueAsJson(Et),
3147
+ authorMarker: o.getKeyValueAsJson(Pt),
3093
3148
  blocks: h
3094
3149
  };
3095
3150
  },
@@ -3115,13 +3170,13 @@ function ui(s, e, t) {
3115
3170
  }
3116
3171
  ).withStableType();
3117
3172
  }
3118
- function di(s, e) {
3173
+ function gi(s, e) {
3119
3174
  const t = s.node();
3120
- if (ce(t.resourceType, ss)) {
3175
+ if (ce(t.resourceType, os)) {
3121
3176
  const r = t.getDataAsJson();
3122
3177
  if (r === void 0) throw new Error("No resource data.");
3123
3178
  return e.frontendDownloadDriver.getPath(new URL(r.url)).withStableType();
3124
- } else if (ce(t.resourceType, os)) {
3179
+ } else if (ce(t.resourceType, ns)) {
3125
3180
  const r = t.getDataAsJson();
3126
3181
  if (r === void 0) throw new Error("No resource data.");
3127
3182
  return e.signer.verify(
@@ -3132,10 +3187,10 @@ function di(s, e) {
3132
3187
  } else
3133
3188
  throw new Error(`Unsupported resource type: ${JSON.stringify(t.resourceType)}`);
3134
3189
  }
3135
- function pi(s, e) {
3190
+ function mi(s, e) {
3136
3191
  if (s !== void 0)
3137
3192
  return J.make(
3138
- (t) => di(t.accessor(s), e),
3193
+ (t) => gi(t.accessor(s), e),
3139
3194
  {
3140
3195
  postprocessValue: (t) => {
3141
3196
  if (t !== void 0) {
@@ -3147,86 +3202,86 @@ function pi(s, e) {
3147
3202
  }
3148
3203
  ).withStableType();
3149
3204
  }
3150
- function hi(s, e, t) {
3205
+ function vi(s, e, t) {
3151
3206
  return J.make(
3152
3207
  (r) => {
3153
3208
  var a;
3154
- const o = r.accessor(s).node(), n = rt(o, e), i = (a = o.traverse(
3209
+ const o = r.accessor(s).node(), n = st(o, e), i = (a = o.traverse(
3155
3210
  {
3156
3211
  field: U(e, "blockPack"),
3157
3212
  assertFieldType: "Dynamic"
3158
3213
  },
3159
3214
  { field: A.HolderRefField, assertFieldType: "Input", errorIfFieldNotFound: !0 },
3160
- { field: is, assertFieldType: "Input" }
3215
+ { field: as, assertFieldType: "Input" }
3161
3216
  )) == null ? void 0 : a.persist();
3162
3217
  return {
3163
- path: pi(i, t),
3218
+ path: mi(i, t),
3164
3219
  sdkVersion: n == null ? void 0 : n.cfg.sdkVersion
3165
3220
  };
3166
3221
  },
3167
3222
  { mode: "StableOnlyLive" }
3168
3223
  );
3169
3224
  }
3170
- function ms(s, e, t) {
3225
+ function vs(s, e, t) {
3171
3226
  if (t === void 0)
3172
- return J.make((i) => ms(s, e, i), {
3173
- key: `inputs#${Tt(s.rid)}#${e}`
3227
+ return J.make((i) => vs(s, e, i), {
3228
+ key: `inputs#${Lt(s.rid)}#${e}`
3174
3229
  });
3175
- const r = t.accessor(s).node(), o = Vt(s, e), n = o.uiState(t);
3230
+ const r = t.accessor(s).node(), o = Ut(s, e), n = o.uiState(t);
3176
3231
  return {
3177
- author: r.getKeyValueAsJson(Rt(e)),
3232
+ author: r.getKeyValueAsJson(Ct(e)),
3178
3233
  args: JSON.parse(o.args(t)),
3179
3234
  ui: n !== void 0 ? JSON.parse(n) : void 0
3180
3235
  };
3181
3236
  }
3182
- function fi(s, e, t) {
3237
+ function yi(s, e, t) {
3183
3238
  return J.make(
3184
3239
  (r) => {
3185
- const o = r.accessor(s).node(), n = us(s, e);
3186
- return $e(rt(o, e), ({ cfg: i, bpId: a }) => {
3240
+ const o = r.accessor(s).node(), n = ds(s, e);
3241
+ return Fe(st(o, e), ({ cfg: i, bpId: a }) => {
3187
3242
  const c = {};
3188
3243
  for (const [u, l] of Object.entries(i.outputs)) {
3189
- const d = Fe(t, n, l, i.code, a);
3244
+ const d = Ie(t, n, l, i.code, a);
3190
3245
  c[u] = J.wrapError(d);
3191
3246
  }
3192
3247
  return c;
3193
3248
  });
3194
3249
  },
3195
- { key: "outputs#" + Tt(s.rid) + "#" + e }
3250
+ { key: "outputs#" + Lt(s.rid) + "#" + e }
3196
3251
  ).withStableType();
3197
3252
  }
3198
- function gi(s, e) {
3253
+ function wi(s, e) {
3199
3254
  return J.make((t) => {
3200
3255
  const r = t.accessor(s).node(), o = B(r.getKeyValueAsJson(pe)), n = [];
3201
3256
  for (const { id: i } of se(o)) {
3202
- const a = rt(r, i);
3257
+ const a = st(r, i);
3203
3258
  if (a === void 0) continue;
3204
- const c = Object.entries(a.cfg.outputs).map(([, l]) => l).filter((l) => li(l)).map((l) => l);
3259
+ const c = Object.entries(a.cfg.outputs).map(([, l]) => l).filter((l) => hi(l)).map((l) => l);
3205
3260
  if (c.length === 0) continue;
3206
- const u = us(r.persist(), i);
3261
+ const u = ds(r.persist(), i);
3207
3262
  for (const l of c)
3208
3263
  n.push(
3209
- J.wrapError(Fe(e, u, l, a.cfg.code, a.bpId))
3264
+ J.wrapError(Ie(e, u, l, a.cfg.code, a.bpId))
3210
3265
  );
3211
3266
  }
3212
3267
  return n;
3213
3268
  });
3214
3269
  }
3215
- class mi {
3270
+ class Si {
3216
3271
  constructor() {
3217
- S(this, "states", /* @__PURE__ */ new Map());
3272
+ w(this, "states", /* @__PURE__ */ new Map());
3218
3273
  }
3219
3274
  setState(e, t) {
3220
3275
  const r = this.states.get(e);
3221
3276
  if (r === void 0) {
3222
- this.states.set(e, { state: t, change: new tr() });
3277
+ this.states.set(e, { state: t, change: new rr() });
3223
3278
  return;
3224
3279
  }
3225
3280
  r.state = { ...t }, r.change.markChanged();
3226
3281
  }
3227
3282
  readState(e, t) {
3228
3283
  let r = this.states.get(t);
3229
- return r === void 0 && (r = { state: { ...Ts }, change: new tr() }, this.states.set(t, r)), r.change.attachWatcher(e.watcher), r.state;
3284
+ return r === void 0 && (r = { state: { ...Ls }, change: new rr() }, this.states.set(t, r)), r.change.attachWatcher(e.watcher), r.state;
3230
3285
  }
3231
3286
  getState(e) {
3232
3287
  return J.make(
@@ -3239,38 +3294,38 @@ class mi {
3239
3294
  t !== void 0 && (this.states.delete(e), t.change.markChanged());
3240
3295
  }
3241
3296
  }
3242
- class Ut {
3297
+ class Jt {
3243
3298
  constructor(e, t, r) {
3244
3299
  /** Underlying pl resource id */
3245
- S(this, "rid");
3300
+ w(this, "rid");
3246
3301
  /** Data for the left panel, contain basic information about block status. */
3247
- S(this, "overview");
3248
- S(this, "navigationStates", new mi());
3249
- S(this, "blockComputables", /* @__PURE__ */ new Map());
3250
- S(this, "blockFrontends", /* @__PURE__ */ new Map());
3251
- S(this, "activeConfigs");
3252
- S(this, "refreshLoopResult");
3253
- S(this, "abortController", new AbortController());
3254
- S(this, "destroyed", !1);
3255
- this.env = e, this.projectTree = r, this.overview = ui(
3302
+ w(this, "overview");
3303
+ w(this, "navigationStates", new Si());
3304
+ w(this, "blockComputables", /* @__PURE__ */ new Map());
3305
+ w(this, "blockFrontends", /* @__PURE__ */ new Map());
3306
+ w(this, "activeConfigs");
3307
+ w(this, "refreshLoopResult");
3308
+ w(this, "abortController", new AbortController());
3309
+ w(this, "destroyed", !1);
3310
+ this.env = e, this.projectTree = r, this.overview = fi(
3256
3311
  r.entry(),
3257
3312
  this.navigationStates,
3258
3313
  e
3259
- ).withPreCalculatedValueTree(), this.rid = t, this.refreshLoopResult = this.refreshLoop(), this.activeConfigs = gi(r.entry(), e);
3314
+ ).withPreCalculatedValueTree(), this.rid = t, this.refreshLoopResult = this.refreshLoop(), this.activeConfigs = wi(r.entry(), e);
3260
3315
  }
3261
3316
  async refreshLoop() {
3262
3317
  for (; !this.destroyed; )
3263
3318
  try {
3264
- await Me(this.env.pl, this.rid, (e) => {
3319
+ await _e(this.env.pl, this.rid, (e) => {
3265
3320
  e.doRefresh(this.env.ops.stagingRenderingRate);
3266
- }), await this.activeConfigs.getValue(), await Xr(this.env.ops.projectRefreshInterval, this.abortController.signal);
3321
+ }), await this.activeConfigs.getValue(), await qr(this.env.ops.projectRefreshInterval, this.abortController.signal);
3267
3322
  } catch (e) {
3268
- if (Ws(e)) {
3323
+ if (zs(e)) {
3269
3324
  console.warn(
3270
3325
  "project refresh routine terminated, because project was externally deleted"
3271
3326
  );
3272
3327
  break;
3273
- } else if (!zs(e))
3328
+ } else if (!Xs(e))
3274
3329
  throw new Error("Unexpected exception", { cause: e });
3275
3330
  }
3276
3331
  }
@@ -3285,8 +3340,8 @@ class Ut {
3285
3340
  *
3286
3341
  * @return returns newly created block id
3287
3342
  * */
3288
- async addBlock(e, t, r, o = void 0, n = Ae()) {
3289
- const i = await this.env.bpPreparer.prepare(t), a = await this.env.bpPreparer.getBlockConfigContainer(t), c = Gr(a);
3343
+ async addBlock(e, t, r, o = void 0, n = we()) {
3344
+ const i = await this.env.bpPreparer.prepare(t), a = await this.env.bpPreparer.getBlockConfigContainer(t), c = Mr(a);
3290
3345
  return await Q(
3291
3346
  this.env.pl,
3292
3347
  this.rid,
@@ -3364,7 +3419,7 @@ class Ut {
3364
3419
  * stale state.
3365
3420
  * */
3366
3421
  async runBlock(e) {
3367
- await Me(this.env.pl, this.rid, (t) => t.renderProduction([e], !0)), await this.projectTree.refreshState();
3422
+ await _e(this.env.pl, this.rid, (t) => t.renderProduction([e], !0)), await this.projectTree.refreshState();
3368
3423
  }
3369
3424
  /**
3370
3425
  * Stops the block if it is running by destroying its production state. All
@@ -3372,7 +3427,7 @@ class Ut {
3372
3427
  * calculated.
3373
3428
  * */
3374
3429
  async stopBlock(e) {
3375
- await Me(this.env.pl, this.rid, (t) => t.stopProduction(e)), await this.projectTree.refreshState();
3430
+ await _e(this.env.pl, this.rid, (t) => t.stopProduction(e)), await this.projectTree.refreshState();
3376
3431
  }
3377
3432
  // /** Update block label. */
3378
3433
  // public async setBlockLabel(blockId: string, label: string, author?: AuthorMarker) {
@@ -3435,9 +3490,9 @@ class Ut {
3435
3490
  /** Resets arguments and ui state of the block to initial state */
3436
3491
  async resetBlockArgsAndUiState(e, t) {
3437
3492
  await this.env.pl.withWriteTx("BlockInputsReset", async (r) => {
3438
- const o = St(
3493
+ const o = bt(
3439
3494
  (await r.getField(x(this.rid, U(e, "blockPack")))).value
3440
- ), n = St(
3495
+ ), n = bt(
3441
3496
  (await r.getField(x(o, A.HolderRefField))).value
3442
3497
  ), i = await r.getResourceData(n, !1), a = JSON.parse(
3443
3498
  Buffer.from(B(i.data)).toString("utf-8")
@@ -3450,10 +3505,10 @@ class Ut {
3450
3505
  getBlockComputables(e) {
3451
3506
  const t = this.blockComputables.get(e);
3452
3507
  if (t === void 0) {
3453
- const r = fi(this.projectTree.entry(), e, this.env), n = {
3508
+ const r = yi(this.projectTree.entry(), e, this.env), n = {
3454
3509
  fullState: J.make(
3455
3510
  (i) => ({
3456
- argsAndUiState: ms(this.projectTree.entry(), e, i),
3511
+ argsAndUiState: vs(this.projectTree.entry(), e, i),
3457
3512
  outputs: r,
3458
3513
  navigationState: this.navigationStates.getState(e)
3459
3514
  }),
@@ -3484,7 +3539,7 @@ class Ut {
3484
3539
  getBlockFrontend(e) {
3485
3540
  const t = this.blockFrontends.get(e);
3486
3541
  if (t === void 0) {
3487
- const r = hi(
3542
+ const r = vi(
3488
3543
  this.projectTree.entry(),
3489
3544
  e,
3490
3545
  this.env
@@ -3504,21 +3559,21 @@ class Ut {
3504
3559
  await this.destroy();
3505
3560
  }
3506
3561
  static async init(e, t) {
3507
- await Me(e.pl, t, (o) => {
3562
+ await _e(e.pl, t, (o) => {
3508
3563
  });
3509
- const r = await Hr.init(
3564
+ const r = await Wr.init(
3510
3565
  e.pl,
3511
3566
  t,
3512
3567
  {
3513
3568
  ...e.ops.defaultTreeOptions,
3514
- pruning: vi
3569
+ pruning: bi
3515
3570
  },
3516
3571
  e.logger
3517
3572
  );
3518
- return new Ut(e, t, r);
3573
+ return new Jt(e, t, r);
3519
3574
  }
3520
3575
  }
3521
- function vi(s) {
3576
+ function bi(s) {
3522
3577
  switch (s.type.name) {
3523
3578
  case "BlockPackCustom":
3524
3579
  return s.fields.filter((e) => e.name !== "template");
@@ -3530,8 +3585,8 @@ function vi(s) {
3530
3585
  return s.fields;
3531
3586
  }
3532
3587
  }
3533
- const vs = {
3534
- logger: new Us(),
3588
+ const ys = {
3589
+ logger: new Js(),
3535
3590
  blobDriverOps: {
3536
3591
  cacheSoftSizeBytes: 8 * 1024 * 1024 * 1024,
3537
3592
  // 8 GB
@@ -3554,14 +3609,14 @@ const vs = {
3554
3609
  stopPollingDelay: 1e3
3555
3610
  }
3556
3611
  };
3557
- function ys(s) {
3612
+ function ws(s) {
3558
3613
  return {
3559
3614
  blobDownloadPath: _.join(s, "download"),
3560
3615
  downloadBlobToURLPath: _.join(s, "downloadToURL")
3561
3616
  };
3562
3617
  }
3563
- const yi = {
3564
- ...vs,
3618
+ const Ri = {
3619
+ ...ys,
3565
3620
  defaultTreeOptions: {
3566
3621
  pollingInterval: 350,
3567
3622
  stopPollingDelay: 2500
@@ -3570,18 +3625,18 @@ const yi = {
3570
3625
  projectRefreshInterval: 700,
3571
3626
  stagingRenderingRate: 5
3572
3627
  };
3573
- function wi(s) {
3628
+ function Ei(s) {
3574
3629
  return {
3575
- ...ys(s),
3630
+ ...ws(s),
3576
3631
  frontendDownloadPath: _.join(s, "frontend")
3577
3632
  };
3578
3633
  }
3579
- function Si(s) {
3634
+ function Ci(s) {
3580
3635
  return s && s.__esModule && Object.prototype.hasOwnProperty.call(s, "default") ? s.default : s;
3581
3636
  }
3582
- var Ft = { exports: {} };
3583
- const bi = "2.0.0", ws = 256, Ci = Number.MAX_SAFE_INTEGER || /* istanbul ignore next */
3584
- 9007199254740991, Ri = 16, Ei = ws - 6, Pi = [
3637
+ var It = { exports: {} };
3638
+ const Pi = "2.0.0", Ss = 256, ki = Number.MAX_SAFE_INTEGER || /* istanbul ignore next */
3639
+ 9007199254740991, $i = 16, Oi = Ss - 6, Fi = [
3585
3640
  "major",
3586
3641
  "premajor",
3587
3642
  "minor",
@@ -3590,25 +3645,25 @@ const bi = "2.0.0", ws = 256, Ci = Number.MAX_SAFE_INTEGER || /* istanbul ignore
3590
3645
  "prepatch",
3591
3646
  "prerelease"
3592
3647
  ];
3593
- var st = {
3594
- MAX_LENGTH: ws,
3595
- MAX_SAFE_COMPONENT_LENGTH: Ri,
3596
- MAX_SAFE_BUILD_LENGTH: Ei,
3597
- MAX_SAFE_INTEGER: Ci,
3598
- RELEASE_TYPES: Pi,
3599
- SEMVER_SPEC_VERSION: bi,
3648
+ var ot = {
3649
+ MAX_LENGTH: Ss,
3650
+ MAX_SAFE_COMPONENT_LENGTH: $i,
3651
+ MAX_SAFE_BUILD_LENGTH: Oi,
3652
+ MAX_SAFE_INTEGER: ki,
3653
+ RELEASE_TYPES: Fi,
3654
+ SEMVER_SPEC_VERSION: Pi,
3600
3655
  FLAG_INCLUDE_PRERELEASE: 1,
3601
3656
  FLAG_LOOSE: 2
3602
3657
  };
3603
- const ki = typeof process == "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...s) => console.error("SEMVER", ...s) : () => {
3658
+ const Ii = typeof process == "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...s) => console.error("SEMVER", ...s) : () => {
3604
3659
  };
3605
- var ot = ki;
3660
+ var nt = Ii;
3606
3661
  (function(s, e) {
3607
3662
  const {
3608
3663
  MAX_SAFE_COMPONENT_LENGTH: t,
3609
3664
  MAX_SAFE_BUILD_LENGTH: r,
3610
3665
  MAX_LENGTH: o
3611
- } = st, n = ot;
3666
+ } = ot, n = nt;
3612
3667
  e = s.exports = {};
3613
3668
  const i = e.re = [], a = e.safeRe = [], c = e.src = [], u = e.safeSrc = [], l = e.t = {};
3614
3669
  let d = 0;
@@ -3616,54 +3671,54 @@ var ot = ki;
3616
3671
  ["\\s", 1],
3617
3672
  ["\\d", o],
3618
3673
  [f, r]
3619
- ], R = (D) => {
3674
+ ], E = (D) => {
3620
3675
  for (const [T, j] of h)
3621
3676
  D = D.split(`${T}*`).join(`${T}{0,${j}}`).split(`${T}+`).join(`${T}{1,${j}}`);
3622
3677
  return D;
3623
3678
  }, g = (D, T, j) => {
3624
- const $ = R(T), G = d++;
3625
- n(D, G, T), l[D] = G, c[G] = T, u[G] = $, i[G] = new RegExp(T, j ? "g" : void 0), a[G] = new RegExp($, j ? "g" : void 0);
3679
+ const O = E(T), G = d++;
3680
+ n(D, G, T), l[D] = G, c[G] = T, u[G] = O, i[G] = new RegExp(T, j ? "g" : void 0), a[G] = new RegExp(O, j ? "g" : void 0);
3626
3681
  };
3627
3682
  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*$");
3628
- })(Ft, Ft.exports);
3629
- var Be = Ft.exports;
3630
- const Oi = Object.freeze({ loose: !0 }), $i = Object.freeze({}), Fi = (s) => s ? typeof s != "object" ? Oi : s : $i;
3631
- var Jt = Fi;
3632
- const yr = /^[0-9]+$/, Ss = (s, e) => {
3633
- const t = yr.test(s), r = yr.test(e);
3683
+ })(It, It.exports);
3684
+ var Be = It.exports;
3685
+ const Ai = Object.freeze({ loose: !0 }), Ti = Object.freeze({}), Li = (s) => s ? typeof s != "object" ? Ai : s : Ti;
3686
+ var Gt = Li;
3687
+ const wr = /^[0-9]+$/, bs = (s, e) => {
3688
+ const t = wr.test(s), r = wr.test(e);
3634
3689
  return t && r && (s = +s, e = +e), s === e ? 0 : t && !r ? -1 : r && !t ? 1 : s < e ? -1 : 1;
3635
- }, Ii = (s, e) => Ss(e, s);
3636
- var bs = {
3637
- compareIdentifiers: Ss,
3638
- rcompareIdentifiers: Ii
3690
+ }, Di = (s, e) => bs(e, s);
3691
+ var Rs = {
3692
+ compareIdentifiers: bs,
3693
+ rcompareIdentifiers: Di
3639
3694
  };
3640
- const Ke = ot, { MAX_LENGTH: wr, MAX_SAFE_INTEGER: He } = st, { safeRe: Sr, safeSrc: br, t: We } = Be, Ai = Jt, { compareIdentifiers: ge } = bs;
3641
- let Ti = class re {
3695
+ const He = nt, { MAX_LENGTH: Sr, MAX_SAFE_INTEGER: We } = ot, { safeRe: br, safeSrc: Rr, t: ze } = Be, Ni = Gt, { compareIdentifiers: ge } = Rs;
3696
+ let Bi = class re {
3642
3697
  constructor(e, t) {
3643
- if (t = Ai(t), e instanceof re) {
3698
+ if (t = Ni(t), e instanceof re) {
3644
3699
  if (e.loose === !!t.loose && e.includePrerelease === !!t.includePrerelease)
3645
3700
  return e;
3646
3701
  e = e.version;
3647
3702
  } else if (typeof e != "string")
3648
3703
  throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);
3649
- if (e.length > wr)
3704
+ if (e.length > Sr)
3650
3705
  throw new TypeError(
3651
- `version is longer than ${wr} characters`
3706
+ `version is longer than ${Sr} characters`
3652
3707
  );
3653
- Ke("SemVer", e, t), this.options = t, this.loose = !!t.loose, this.includePrerelease = !!t.includePrerelease;
3654
- const r = e.trim().match(t.loose ? Sr[We.LOOSE] : Sr[We.FULL]);
3708
+ He("SemVer", e, t), this.options = t, this.loose = !!t.loose, this.includePrerelease = !!t.includePrerelease;
3709
+ const r = e.trim().match(t.loose ? br[ze.LOOSE] : br[ze.FULL]);
3655
3710
  if (!r)
3656
3711
  throw new TypeError(`Invalid Version: ${e}`);
3657
- if (this.raw = e, this.major = +r[1], this.minor = +r[2], this.patch = +r[3], this.major > He || this.major < 0)
3712
+ if (this.raw = e, this.major = +r[1], this.minor = +r[2], this.patch = +r[3], this.major > We || this.major < 0)
3658
3713
  throw new TypeError("Invalid major version");
3659
- if (this.minor > He || this.minor < 0)
3714
+ if (this.minor > We || this.minor < 0)
3660
3715
  throw new TypeError("Invalid minor version");
3661
- if (this.patch > He || this.patch < 0)
3716
+ if (this.patch > We || this.patch < 0)
3662
3717
  throw new TypeError("Invalid patch version");
3663
3718
  r[4] ? this.prerelease = r[4].split(".").map((o) => {
3664
3719
  if (/^[0-9]+$/.test(o)) {
3665
3720
  const n = +o;
3666
- if (n >= 0 && n < He)
3721
+ if (n >= 0 && n < We)
3667
3722
  return n;
3668
3723
  }
3669
3724
  return o;
@@ -3676,7 +3731,7 @@ let Ti = class re {
3676
3731
  return this.version;
3677
3732
  }
3678
3733
  compare(e) {
3679
- if (Ke("SemVer.compare", this.version, this.options, e), !(e instanceof re)) {
3734
+ if (He("SemVer.compare", this.version, this.options, e), !(e instanceof re)) {
3680
3735
  if (typeof e == "string" && e === this.version)
3681
3736
  return 0;
3682
3737
  e = new re(e, this.options);
@@ -3696,7 +3751,7 @@ let Ti = class re {
3696
3751
  let t = 0;
3697
3752
  do {
3698
3753
  const r = this.prerelease[t], o = e.prerelease[t];
3699
- if (Ke("prerelease compare", t, r, o), r === void 0 && o === void 0)
3754
+ if (He("prerelease compare", t, r, o), r === void 0 && o === void 0)
3700
3755
  return 0;
3701
3756
  if (o === void 0)
3702
3757
  return 1;
@@ -3712,7 +3767,7 @@ let Ti = class re {
3712
3767
  let t = 0;
3713
3768
  do {
3714
3769
  const r = this.build[t], o = e.build[t];
3715
- if (Ke("build compare", t, r, o), r === void 0 && o === void 0)
3770
+ if (He("build compare", t, r, o), r === void 0 && o === void 0)
3716
3771
  return 0;
3717
3772
  if (o === void 0)
3718
3773
  return 1;
@@ -3730,7 +3785,7 @@ let Ti = class re {
3730
3785
  if (!t && r === !1)
3731
3786
  throw new Error("invalid increment argument: identifier is empty");
3732
3787
  if (t) {
3733
- const o = new RegExp(`^${this.options.loose ? br[We.PRERELEASELOOSE] : br[We.PRERELEASE]}$`), n = `-${t}`.match(o);
3788
+ const o = new RegExp(`^${this.options.loose ? Rr[ze.PRERELEASELOOSE] : Rr[ze.PRERELEASE]}$`), n = `-${t}`.match(o);
3734
3789
  if (!n || n[1] !== t)
3735
3790
  throw new Error(`invalid identifier: ${t}`);
3736
3791
  }
@@ -3788,43 +3843,43 @@ let Ti = class re {
3788
3843
  return this.raw = this.format(), this.build.length && (this.raw += `+${this.build.join(".")}`), this;
3789
3844
  }
3790
3845
  };
3791
- var H = Ti;
3792
- const Cr = H, Li = (s, e, t = !1) => {
3793
- if (s instanceof Cr)
3846
+ var H = Bi;
3847
+ const Er = H, xi = (s, e, t = !1) => {
3848
+ if (s instanceof Er)
3794
3849
  return s;
3795
3850
  try {
3796
- return new Cr(s, e);
3851
+ return new Er(s, e);
3797
3852
  } catch (r) {
3798
3853
  if (!t)
3799
3854
  return null;
3800
3855
  throw r;
3801
3856
  }
3802
3857
  };
3803
- var we = Li;
3804
- const Di = we, Ni = (s, e) => {
3805
- const t = Di(s, e);
3858
+ var Se = xi;
3859
+ const ji = Se, Vi = (s, e) => {
3860
+ const t = ji(s, e);
3806
3861
  return t ? t.version : null;
3807
3862
  };
3808
- var Bi = Ni;
3809
- const xi = we, ji = (s, e) => {
3810
- const t = xi(s.trim().replace(/^[=v]+/, ""), e);
3863
+ var Ui = Vi;
3864
+ const Ji = Se, Gi = (s, e) => {
3865
+ const t = Ji(s.trim().replace(/^[=v]+/, ""), e);
3811
3866
  return t ? t.version : null;
3812
3867
  };
3813
- var Vi = ji;
3814
- const Rr = H, Ui = (s, e, t, r, o) => {
3868
+ var Mi = Gi;
3869
+ const Cr = H, _i = (s, e, t, r, o) => {
3815
3870
  typeof t == "string" && (o = r, r = t, t = void 0);
3816
3871
  try {
3817
- return new Rr(
3818
- s instanceof Rr ? s.version : s,
3872
+ return new Cr(
3873
+ s instanceof Cr ? s.version : s,
3819
3874
  t
3820
3875
  ).inc(e, r, o).version;
3821
3876
  } catch {
3822
3877
  return null;
3823
3878
  }
3824
3879
  };
3825
- var Ji = Ui;
3826
- const Er = we, Gi = (s, e) => {
3827
- const t = Er(s, null, !0), r = Er(e, null, !0), o = t.compare(r);
3880
+ var Ki = _i;
3881
+ const Pr = Se, Hi = (s, e) => {
3882
+ const t = Pr(s, null, !0), r = Pr(e, null, !0), o = t.compare(r);
3828
3883
  if (o === 0)
3829
3884
  return null;
3830
3885
  const n = o > 0, i = n ? t : r, a = n ? r : t, c = !!i.prerelease.length;
@@ -3837,46 +3892,46 @@ const Er = we, Gi = (s, e) => {
3837
3892
  const l = c ? "pre" : "";
3838
3893
  return t.major !== r.major ? l + "major" : t.minor !== r.minor ? l + "minor" : t.patch !== r.patch ? l + "patch" : "prerelease";
3839
3894
  };
3840
- var Mi = Gi;
3841
- const _i = H, Ki = (s, e) => new _i(s, e).major;
3842
- var Hi = Ki;
3843
- const Wi = H, zi = (s, e) => new Wi(s, e).minor;
3844
- var Xi = zi;
3845
- const qi = H, Yi = (s, e) => new qi(s, e).patch;
3846
- var Qi = Yi;
3847
- const Zi = we, ea = (s, e) => {
3848
- const t = Zi(s, e);
3895
+ var Wi = Hi;
3896
+ const zi = H, Xi = (s, e) => new zi(s, e).major;
3897
+ var qi = Xi;
3898
+ const Yi = H, Qi = (s, e) => new Yi(s, e).minor;
3899
+ var Zi = Qi;
3900
+ const ea = H, ta = (s, e) => new ea(s, e).patch;
3901
+ var ra = ta;
3902
+ const sa = Se, oa = (s, e) => {
3903
+ const t = sa(s, e);
3849
3904
  return t && t.prerelease.length ? t.prerelease : null;
3850
3905
  };
3851
- var ta = ea;
3852
- const Pr = H, ra = (s, e, t) => new Pr(s, t).compare(new Pr(e, t));
3853
- var ee = ra;
3854
- const sa = ee, oa = (s, e, t) => sa(e, s, t);
3855
3906
  var na = oa;
3856
- const ia = ee, aa = (s, e) => ia(s, e, !0);
3857
- var ca = aa;
3858
- const kr = H, la = (s, e, t) => {
3859
- const r = new kr(s, t), o = new kr(e, t);
3907
+ const kr = H, ia = (s, e, t) => new kr(s, t).compare(new kr(e, t));
3908
+ var ee = ia;
3909
+ const aa = ee, ca = (s, e, t) => aa(e, s, t);
3910
+ var la = ca;
3911
+ const ua = ee, da = (s, e) => ua(s, e, !0);
3912
+ var pa = da;
3913
+ const $r = H, ha = (s, e, t) => {
3914
+ const r = new $r(s, t), o = new $r(e, t);
3860
3915
  return r.compare(o) || r.compareBuild(o);
3861
3916
  };
3862
- var Gt = la;
3863
- const ua = Gt, da = (s, e) => s.sort((t, r) => ua(t, r, e));
3864
- var pa = da;
3865
- const ha = Gt, fa = (s, e) => s.sort((t, r) => ha(r, t, e));
3866
- var ga = fa;
3867
- const ma = ee, va = (s, e, t) => ma(s, e, t) > 0;
3868
- var nt = va;
3869
- const ya = ee, wa = (s, e, t) => ya(s, e, t) < 0;
3870
- var Mt = wa;
3871
- const Sa = ee, ba = (s, e, t) => Sa(s, e, t) === 0;
3872
- var Cs = ba;
3873
- const Ca = ee, Ra = (s, e, t) => Ca(s, e, t) !== 0;
3874
- var Rs = Ra;
3875
- const Ea = ee, Pa = (s, e, t) => Ea(s, e, t) >= 0;
3876
- var _t = Pa;
3877
- const ka = ee, Oa = (s, e, t) => ka(s, e, t) <= 0;
3878
- var Kt = Oa;
3879
- const $a = Cs, Fa = Rs, Ia = nt, Aa = _t, Ta = Mt, La = Kt, Da = (s, e, t, r) => {
3917
+ var Mt = ha;
3918
+ const fa = Mt, ga = (s, e) => s.sort((t, r) => fa(t, r, e));
3919
+ var ma = ga;
3920
+ const va = Mt, ya = (s, e) => s.sort((t, r) => va(r, t, e));
3921
+ var wa = ya;
3922
+ const Sa = ee, ba = (s, e, t) => Sa(s, e, t) > 0;
3923
+ var it = ba;
3924
+ const Ra = ee, Ea = (s, e, t) => Ra(s, e, t) < 0;
3925
+ var _t = Ea;
3926
+ const Ca = ee, Pa = (s, e, t) => Ca(s, e, t) === 0;
3927
+ var Es = Pa;
3928
+ const ka = ee, $a = (s, e, t) => ka(s, e, t) !== 0;
3929
+ var Cs = $a;
3930
+ const Oa = ee, Fa = (s, e, t) => Oa(s, e, t) >= 0;
3931
+ var Kt = Fa;
3932
+ const Ia = ee, Aa = (s, e, t) => Ia(s, e, t) <= 0;
3933
+ var Ht = Aa;
3934
+ const Ta = Es, La = Cs, Da = it, Na = Kt, Ba = _t, xa = Ht, ja = (s, e, t, r) => {
3880
3935
  switch (e) {
3881
3936
  case "===":
3882
3937
  return typeof s == "object" && (s = s.version), typeof t == "object" && (t = t.version), s === t;
@@ -3885,33 +3940,33 @@ const $a = Cs, Fa = Rs, Ia = nt, Aa = _t, Ta = Mt, La = Kt, Da = (s, e, t, r) =>
3885
3940
  case "":
3886
3941
  case "=":
3887
3942
  case "==":
3888
- return $a(s, t, r);
3943
+ return Ta(s, t, r);
3889
3944
  case "!=":
3890
- return Fa(s, t, r);
3945
+ return La(s, t, r);
3891
3946
  case ">":
3892
- return Ia(s, t, r);
3947
+ return Da(s, t, r);
3893
3948
  case ">=":
3894
- return Aa(s, t, r);
3949
+ return Na(s, t, r);
3895
3950
  case "<":
3896
- return Ta(s, t, r);
3951
+ return Ba(s, t, r);
3897
3952
  case "<=":
3898
- return La(s, t, r);
3953
+ return xa(s, t, r);
3899
3954
  default:
3900
3955
  throw new TypeError(`Invalid operator: ${e}`);
3901
3956
  }
3902
3957
  };
3903
- var Es = Da;
3904
- const Na = H, Ba = we, { safeRe: ze, t: Xe } = Be, xa = (s, e) => {
3905
- if (s instanceof Na)
3958
+ var Ps = ja;
3959
+ const Va = H, Ua = Se, { safeRe: Xe, t: qe } = Be, Ja = (s, e) => {
3960
+ if (s instanceof Va)
3906
3961
  return s;
3907
3962
  if (typeof s == "number" && (s = String(s)), typeof s != "string")
3908
3963
  return null;
3909
3964
  e = e || {};
3910
3965
  let t = null;
3911
3966
  if (!e.rtl)
3912
- t = s.match(e.includePrerelease ? ze[Xe.COERCEFULL] : ze[Xe.COERCE]);
3967
+ t = s.match(e.includePrerelease ? Xe[qe.COERCEFULL] : Xe[qe.COERCE]);
3913
3968
  else {
3914
- const c = e.includePrerelease ? ze[Xe.COERCERTLFULL] : ze[Xe.COERCERTL];
3969
+ const c = e.includePrerelease ? Xe[qe.COERCERTLFULL] : Xe[qe.COERCERTL];
3915
3970
  let u;
3916
3971
  for (; (u = c.exec(s)) && (!t || t.index + t[0].length !== s.length); )
3917
3972
  (!t || u.index + u[0].length !== t.index + t[0].length) && (t = u), c.lastIndex = u.index + u[1].length + u[2].length;
@@ -3920,10 +3975,10 @@ const Na = H, Ba = we, { safeRe: ze, t: Xe } = Be, xa = (s, e) => {
3920
3975
  if (t === null)
3921
3976
  return null;
3922
3977
  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]}` : "";
3923
- return Ba(`${r}.${o}.${n}${i}${a}`, e);
3978
+ return Ua(`${r}.${o}.${n}${i}${a}`, e);
3924
3979
  };
3925
- var ja = xa;
3926
- class Va {
3980
+ var Ga = Ja;
3981
+ class Ma {
3927
3982
  constructor() {
3928
3983
  this.max = 1e3, this.map = /* @__PURE__ */ new Map();
3929
3984
  }
@@ -3946,9 +4001,9 @@ class Va {
3946
4001
  return this;
3947
4002
  }
3948
4003
  }
3949
- var Ua = Va, pt, Or;
4004
+ var _a = Ma, ht, Or;
3950
4005
  function te() {
3951
- if (Or) return pt;
4006
+ if (Or) return ht;
3952
4007
  Or = 1;
3953
4008
  const s = /\s+/g;
3954
4009
  class e {
@@ -3992,27 +4047,27 @@ function te() {
3992
4047
  return this.range;
3993
4048
  }
3994
4049
  parseRange(p) {
3995
- const y = ((this.options.includePrerelease && h) | (this.options.loose && R)) + ":" + p, b = r.get(y);
4050
+ const y = ((this.options.includePrerelease && h) | (this.options.loose && E)) + ":" + p, b = r.get(y);
3996
4051
  if (b)
3997
4052
  return b;
3998
- const w = this.options.loose, C = w ? c[u.HYPHENRANGELOOSE] : c[u.HYPHENRANGE];
3999
- p = p.replace(C, q(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);
4000
- let O = p.split(" ").map((F) => j(F, this.options)).join(" ").split(/\s+/).map((F) => V(F, this.options));
4001
- w && (O = O.filter((F) => (i("loose invalid filter", F, this.options), !!F.match(c[u.COMPARATORLOOSE])))), i("range list", O);
4002
- const E = /* @__PURE__ */ new Map(), I = O.map((F) => new n(F, this.options));
4053
+ const S = this.options.loose, R = S ? c[u.HYPHENRANGELOOSE] : c[u.HYPHENRANGE];
4054
+ p = p.replace(R, q(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);
4055
+ let $ = p.split(" ").map((F) => j(F, this.options)).join(" ").split(/\s+/).map((F) => V(F, this.options));
4056
+ S && ($ = $.filter((F) => (i("loose invalid filter", F, this.options), !!F.match(c[u.COMPARATORLOOSE])))), i("range list", $);
4057
+ const C = /* @__PURE__ */ new Map(), I = $.map((F) => new n(F, this.options));
4003
4058
  for (const F of I) {
4004
4059
  if (g(F))
4005
4060
  return [F];
4006
- E.set(F.value, F);
4061
+ C.set(F.value, F);
4007
4062
  }
4008
- E.size > 1 && E.has("") && E.delete("");
4009
- const N = [...E.values()];
4063
+ C.size > 1 && C.has("") && C.delete("");
4064
+ const N = [...C.values()];
4010
4065
  return r.set(y, N), N;
4011
4066
  }
4012
4067
  intersects(p, m) {
4013
4068
  if (!(p instanceof e))
4014
4069
  throw new TypeError("a Range is required");
4015
- return this.set.some((y) => T(y, m) && p.set.some((b) => T(b, m) && y.every((w) => b.every((C) => w.intersects(C, m)))));
4070
+ return this.set.some((y) => T(y, m) && p.set.some((b) => T(b, m) && y.every((S) => b.every((R) => S.intersects(R, m)))));
4016
4071
  }
4017
4072
  // if ANY of the sets match ALL of its comparators, then pass
4018
4073
  test(p) {
@@ -4030,44 +4085,44 @@ function te() {
4030
4085
  return !1;
4031
4086
  }
4032
4087
  }
4033
- pt = e;
4034
- const t = Ua, r = new t(), o = Jt, n = it(), i = ot, a = H, {
4088
+ ht = e;
4089
+ const t = _a, r = new t(), o = Gt, n = at(), i = nt, a = H, {
4035
4090
  safeRe: c,
4036
4091
  t: u,
4037
4092
  comparatorTrimReplace: l,
4038
4093
  tildeTrimReplace: d,
4039
4094
  caretTrimReplace: f
4040
- } = Be, { FLAG_INCLUDE_PRERELEASE: h, FLAG_LOOSE: R } = st, g = (v) => v.value === "<0.0.0-0", D = (v) => v.value === "", T = (v, p) => {
4095
+ } = Be, { FLAG_INCLUDE_PRERELEASE: h, FLAG_LOOSE: E } = ot, g = (v) => v.value === "<0.0.0-0", D = (v) => v.value === "", T = (v, p) => {
4041
4096
  let m = !0;
4042
4097
  const y = v.slice();
4043
4098
  let b = y.pop();
4044
4099
  for (; m && y.length; )
4045
- m = y.every((w) => b.intersects(w, p)), b = y.pop();
4100
+ m = y.every((S) => b.intersects(S, p)), b = y.pop();
4046
4101
  return m;
4047
- }, j = (v, p) => (i("comp", v, p), v = L(v, p), i("caret", v), v = G(v, p), i("tildes", v), v = ie(v, p), i("xrange", v), v = M(v, p), i("stars", v), v), $ = (v) => !v || v.toLowerCase() === "x" || v === "*", G = (v, p) => v.trim().split(/\s+/).map((m) => he(m, p)).join(" "), he = (v, p) => {
4102
+ }, j = (v, p) => (i("comp", v, p), v = L(v, p), i("caret", v), v = G(v, p), i("tildes", v), v = ie(v, p), i("xrange", v), v = M(v, p), i("stars", v), v), O = (v) => !v || v.toLowerCase() === "x" || v === "*", G = (v, p) => v.trim().split(/\s+/).map((m) => he(m, p)).join(" "), he = (v, p) => {
4048
4103
  const m = p.loose ? c[u.TILDELOOSE] : c[u.TILDE];
4049
- return v.replace(m, (y, b, w, C, O) => {
4050
- i("tilde", v, y, b, w, C, O);
4051
- let E;
4052
- return $(b) ? E = "" : $(w) ? E = `>=${b}.0.0 <${+b + 1}.0.0-0` : $(C) ? E = `>=${b}.${w}.0 <${b}.${+w + 1}.0-0` : O ? (i("replaceTilde pr", O), E = `>=${b}.${w}.${C}-${O} <${b}.${+w + 1}.0-0`) : E = `>=${b}.${w}.${C} <${b}.${+w + 1}.0-0`, i("tilde return", E), E;
4104
+ return v.replace(m, (y, b, S, R, $) => {
4105
+ i("tilde", v, y, b, S, R, $);
4106
+ let C;
4107
+ return O(b) ? C = "" : O(S) ? C = `>=${b}.0.0 <${+b + 1}.0.0-0` : O(R) ? C = `>=${b}.${S}.0 <${b}.${+S + 1}.0-0` : $ ? (i("replaceTilde pr", $), C = `>=${b}.${S}.${R}-${$} <${b}.${+S + 1}.0-0`) : C = `>=${b}.${S}.${R} <${b}.${+S + 1}.0-0`, i("tilde return", C), C;
4053
4108
  });
4054
4109
  }, L = (v, p) => v.trim().split(/\s+/).map((m) => X(m, p)).join(" "), X = (v, p) => {
4055
4110
  i("caret", v, p);
4056
4111
  const m = p.loose ? c[u.CARETLOOSE] : c[u.CARET], y = p.includePrerelease ? "-0" : "";
4057
- return v.replace(m, (b, w, C, O, E) => {
4058
- i("caret", v, b, w, C, O, E);
4112
+ return v.replace(m, (b, S, R, $, C) => {
4113
+ i("caret", v, b, S, R, $, C);
4059
4114
  let I;
4060
- return $(w) ? I = "" : $(C) ? I = `>=${w}.0.0${y} <${+w + 1}.0.0-0` : $(O) ? w === "0" ? I = `>=${w}.${C}.0${y} <${w}.${+C + 1}.0-0` : I = `>=${w}.${C}.0${y} <${+w + 1}.0.0-0` : E ? (i("replaceCaret pr", E), w === "0" ? C === "0" ? I = `>=${w}.${C}.${O}-${E} <${w}.${C}.${+O + 1}-0` : I = `>=${w}.${C}.${O}-${E} <${w}.${+C + 1}.0-0` : I = `>=${w}.${C}.${O}-${E} <${+w + 1}.0.0-0`) : (i("no pr"), w === "0" ? C === "0" ? I = `>=${w}.${C}.${O}${y} <${w}.${C}.${+O + 1}-0` : I = `>=${w}.${C}.${O}${y} <${w}.${+C + 1}.0-0` : I = `>=${w}.${C}.${O} <${+w + 1}.0.0-0`), i("caret return", I), I;
4115
+ return O(S) ? I = "" : O(R) ? I = `>=${S}.0.0${y} <${+S + 1}.0.0-0` : O($) ? S === "0" ? I = `>=${S}.${R}.0${y} <${S}.${+R + 1}.0-0` : I = `>=${S}.${R}.0${y} <${+S + 1}.0.0-0` : C ? (i("replaceCaret pr", C), S === "0" ? R === "0" ? I = `>=${S}.${R}.${$}-${C} <${S}.${R}.${+$ + 1}-0` : I = `>=${S}.${R}.${$}-${C} <${S}.${+R + 1}.0-0` : I = `>=${S}.${R}.${$}-${C} <${+S + 1}.0.0-0`) : (i("no pr"), S === "0" ? R === "0" ? I = `>=${S}.${R}.${$}${y} <${S}.${R}.${+$ + 1}-0` : I = `>=${S}.${R}.${$}${y} <${S}.${+R + 1}.0-0` : I = `>=${S}.${R}.${$} <${+S + 1}.0.0-0`), i("caret return", I), I;
4061
4116
  });
4062
4117
  }, ie = (v, p) => (i("replaceXRanges", v, p), v.split(/\s+/).map((m) => W(m, p)).join(" ")), W = (v, p) => {
4063
4118
  v = v.trim();
4064
4119
  const m = p.loose ? c[u.XRANGELOOSE] : c[u.XRANGE];
4065
- return v.replace(m, (y, b, w, C, O, E) => {
4066
- i("xRange", v, y, b, w, C, O, E);
4067
- const I = $(w), N = I || $(C), F = N || $(O), oe = F;
4068
- return b === "=" && oe && (b = ""), E = p.includePrerelease ? "-0" : "", I ? b === ">" || b === "<" ? y = "<0.0.0-0" : y = "*" : b && oe ? (N && (C = 0), O = 0, b === ">" ? (b = ">=", N ? (w = +w + 1, C = 0, O = 0) : (C = +C + 1, O = 0)) : b === "<=" && (b = "<", N ? w = +w + 1 : C = +C + 1), b === "<" && (E = "-0"), y = `${b + w}.${C}.${O}${E}`) : N ? y = `>=${w}.0.0${E} <${+w + 1}.0.0-0` : F && (y = `>=${w}.${C}.0${E} <${w}.${+C + 1}.0-0`), i("xRange return", y), y;
4120
+ return v.replace(m, (y, b, S, R, $, C) => {
4121
+ i("xRange", v, y, b, S, R, $, C);
4122
+ const I = O(S), N = I || O(R), F = N || O($), oe = F;
4123
+ return b === "=" && oe && (b = ""), C = p.includePrerelease ? "-0" : "", I ? b === ">" || b === "<" ? y = "<0.0.0-0" : y = "*" : b && oe ? (N && (R = 0), $ = 0, b === ">" ? (b = ">=", N ? (S = +S + 1, R = 0, $ = 0) : (R = +R + 1, $ = 0)) : b === "<=" && (b = "<", N ? S = +S + 1 : R = +R + 1), b === "<" && (C = "-0"), y = `${b + S}.${R}.${$}${C}`) : N ? y = `>=${S}.0.0${C} <${+S + 1}.0.0-0` : F && (y = `>=${S}.${R}.0${C} <${S}.${+R + 1}.0-0`), i("xRange return", y), y;
4069
4124
  });
4070
- }, M = (v, p) => (i("replaceStars", v, p), v.trim().replace(c[u.STAR], "")), V = (v, p) => (i("replaceGTE0", v, p), v.trim().replace(c[p.includePrerelease ? u.GTE0PRE : u.GTE0], "")), q = (v) => (p, m, y, b, w, C, O, E, I, N, F, oe) => ($(y) ? m = "" : $(b) ? m = `>=${y}.0.0${v ? "-0" : ""}` : $(w) ? m = `>=${y}.${b}.0${v ? "-0" : ""}` : C ? m = `>=${m}` : m = `>=${m}${v ? "-0" : ""}`, $(I) ? E = "" : $(N) ? E = `<${+I + 1}.0.0-0` : $(F) ? E = `<${I}.${+N + 1}.0-0` : oe ? E = `<=${I}.${N}.${F}-${oe}` : v ? E = `<${I}.${N}.${+F + 1}-0` : E = `<=${E}`, `${m} ${E}`.trim()), fe = (v, p, m) => {
4125
+ }, M = (v, p) => (i("replaceStars", v, p), v.trim().replace(c[u.STAR], "")), V = (v, p) => (i("replaceGTE0", v, p), v.trim().replace(c[p.includePrerelease ? u.GTE0PRE : u.GTE0], "")), q = (v) => (p, m, y, b, S, R, $, C, I, N, F, oe) => (O(y) ? m = "" : O(b) ? m = `>=${y}.0.0${v ? "-0" : ""}` : O(S) ? m = `>=${y}.${b}.0${v ? "-0" : ""}` : R ? m = `>=${m}` : m = `>=${m}${v ? "-0" : ""}`, O(I) ? C = "" : O(N) ? C = `<${+I + 1}.0.0-0` : O(F) ? C = `<${I}.${+N + 1}.0-0` : oe ? C = `<=${I}.${N}.${F}-${oe}` : v ? C = `<${I}.${N}.${+F + 1}-0` : C = `<=${C}`, `${m} ${C}`.trim()), fe = (v, p, m) => {
4071
4126
  for (let y = 0; y < v.length; y++)
4072
4127
  if (!v[y].test(p))
4073
4128
  return !1;
@@ -4082,12 +4137,12 @@ function te() {
4082
4137
  }
4083
4138
  return !0;
4084
4139
  };
4085
- return pt;
4140
+ return ht;
4086
4141
  }
4087
- var ht, $r;
4088
- function it() {
4089
- if ($r) return ht;
4090
- $r = 1;
4142
+ var ft, Fr;
4143
+ function at() {
4144
+ if (Fr) return ft;
4145
+ Fr = 1;
4091
4146
  const s = Symbol("SemVer ANY");
4092
4147
  class e {
4093
4148
  static get ANY() {
@@ -4127,62 +4182,62 @@ function it() {
4127
4182
  return this.operator === "" ? this.value === "" ? !0 : new c(l.value, d).test(this.value) : l.operator === "" ? l.value === "" ? !0 : new c(this.value, d).test(l.semver) : (d = t(d), d.includePrerelease && (this.value === "<0.0.0-0" || l.value === "<0.0.0-0") || !d.includePrerelease && (this.value.startsWith("<0.0.0") || l.value.startsWith("<0.0.0")) ? !1 : !!(this.operator.startsWith(">") && l.operator.startsWith(">") || this.operator.startsWith("<") && l.operator.startsWith("<") || this.semver.version === l.semver.version && this.operator.includes("=") && l.operator.includes("=") || n(this.semver, "<", l.semver, d) && this.operator.startsWith(">") && l.operator.startsWith("<") || n(this.semver, ">", l.semver, d) && this.operator.startsWith("<") && l.operator.startsWith(">")));
4128
4183
  }
4129
4184
  }
4130
- ht = e;
4131
- const t = Jt, { safeRe: r, t: o } = Be, n = Es, i = ot, a = H, c = te();
4132
- return ht;
4185
+ ft = e;
4186
+ const t = Gt, { safeRe: r, t: o } = Be, n = Ps, i = nt, a = H, c = te();
4187
+ return ft;
4133
4188
  }
4134
- const Ja = te(), Ga = (s, e, t) => {
4189
+ const Ka = te(), Ha = (s, e, t) => {
4135
4190
  try {
4136
- e = new Ja(e, t);
4191
+ e = new Ka(e, t);
4137
4192
  } catch {
4138
4193
  return !1;
4139
4194
  }
4140
4195
  return e.test(s);
4141
4196
  };
4142
- var at = Ga;
4143
- const Ma = te(), _a = (s, e) => new Ma(s, e).set.map((t) => t.map((r) => r.value).join(" ").trim().split(" "));
4144
- var Ka = _a;
4145
- const Ha = H, Wa = te(), za = (s, e, t) => {
4197
+ var ct = Ha;
4198
+ const Wa = te(), za = (s, e) => new Wa(s, e).set.map((t) => t.map((r) => r.value).join(" ").trim().split(" "));
4199
+ var Xa = za;
4200
+ const qa = H, Ya = te(), Qa = (s, e, t) => {
4146
4201
  let r = null, o = null, n = null;
4147
4202
  try {
4148
- n = new Wa(e, t);
4203
+ n = new Ya(e, t);
4149
4204
  } catch {
4150
4205
  return null;
4151
4206
  }
4152
4207
  return s.forEach((i) => {
4153
- n.test(i) && (!r || o.compare(i) === -1) && (r = i, o = new Ha(r, t));
4208
+ n.test(i) && (!r || o.compare(i) === -1) && (r = i, o = new qa(r, t));
4154
4209
  }), r;
4155
4210
  };
4156
- var Xa = za;
4157
- const qa = H, Ya = te(), Qa = (s, e, t) => {
4211
+ var Za = Qa;
4212
+ const ec = H, tc = te(), rc = (s, e, t) => {
4158
4213
  let r = null, o = null, n = null;
4159
4214
  try {
4160
- n = new Ya(e, t);
4215
+ n = new tc(e, t);
4161
4216
  } catch {
4162
4217
  return null;
4163
4218
  }
4164
4219
  return s.forEach((i) => {
4165
- n.test(i) && (!r || o.compare(i) === 1) && (r = i, o = new qa(r, t));
4220
+ n.test(i) && (!r || o.compare(i) === 1) && (r = i, o = new ec(r, t));
4166
4221
  }), r;
4167
4222
  };
4168
- var Za = Qa;
4169
- const ft = H, ec = te(), Fr = nt, tc = (s, e) => {
4170
- s = new ec(s, e);
4171
- let t = new ft("0.0.0");
4172
- if (s.test(t) || (t = new ft("0.0.0-0"), s.test(t)))
4223
+ var sc = rc;
4224
+ const gt = H, oc = te(), Ir = it, nc = (s, e) => {
4225
+ s = new oc(s, e);
4226
+ let t = new gt("0.0.0");
4227
+ if (s.test(t) || (t = new gt("0.0.0-0"), s.test(t)))
4173
4228
  return t;
4174
4229
  t = null;
4175
4230
  for (let r = 0; r < s.set.length; ++r) {
4176
4231
  const o = s.set[r];
4177
4232
  let n = null;
4178
4233
  o.forEach((i) => {
4179
- const a = new ft(i.semver.version);
4234
+ const a = new gt(i.semver.version);
4180
4235
  switch (i.operator) {
4181
4236
  case ">":
4182
4237
  a.prerelease.length === 0 ? a.patch++ : a.prerelease.push(0), a.raw = a.format();
4183
4238
  case "":
4184
4239
  case ">=":
4185
- (!n || Fr(a, n)) && (n = a);
4240
+ (!n || Ir(a, n)) && (n = a);
4186
4241
  break;
4187
4242
  case "<":
4188
4243
  case "<=":
@@ -4190,39 +4245,39 @@ const ft = H, ec = te(), Fr = nt, tc = (s, e) => {
4190
4245
  default:
4191
4246
  throw new Error(`Unexpected operation: ${i.operator}`);
4192
4247
  }
4193
- }), n && (!t || Fr(t, n)) && (t = n);
4248
+ }), n && (!t || Ir(t, n)) && (t = n);
4194
4249
  }
4195
4250
  return t && s.test(t) ? t : null;
4196
4251
  };
4197
- var rc = tc;
4198
- const sc = te(), oc = (s, e) => {
4252
+ var ic = nc;
4253
+ const ac = te(), cc = (s, e) => {
4199
4254
  try {
4200
- return new sc(s, e).range || "*";
4255
+ return new ac(s, e).range || "*";
4201
4256
  } catch {
4202
4257
  return null;
4203
4258
  }
4204
4259
  };
4205
- var nc = oc;
4206
- const ic = H, Ps = it(), { ANY: ac } = Ps, cc = te(), lc = at, Ir = nt, Ar = Mt, uc = Kt, dc = _t, pc = (s, e, t, r) => {
4207
- s = new ic(s, r), e = new cc(e, r);
4260
+ var lc = cc;
4261
+ const uc = H, ks = at(), { ANY: dc } = ks, pc = te(), hc = ct, Ar = it, Tr = _t, fc = Ht, gc = Kt, mc = (s, e, t, r) => {
4262
+ s = new uc(s, r), e = new pc(e, r);
4208
4263
  let o, n, i, a, c;
4209
4264
  switch (t) {
4210
4265
  case ">":
4211
- o = Ir, n = uc, i = Ar, a = ">", c = ">=";
4266
+ o = Ar, n = fc, i = Tr, a = ">", c = ">=";
4212
4267
  break;
4213
4268
  case "<":
4214
- o = Ar, n = dc, i = Ir, a = "<", c = "<=";
4269
+ o = Tr, n = gc, i = Ar, a = "<", c = "<=";
4215
4270
  break;
4216
4271
  default:
4217
4272
  throw new TypeError('Must provide a hilo val of "<" or ">"');
4218
4273
  }
4219
- if (lc(s, e, r))
4274
+ if (hc(s, e, r))
4220
4275
  return !1;
4221
4276
  for (let u = 0; u < e.set.length; ++u) {
4222
4277
  const l = e.set[u];
4223
4278
  let d = null, f = null;
4224
4279
  if (l.forEach((h) => {
4225
- h.semver === ac && (h = new Ps(">=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);
4280
+ h.semver === dc && (h = new ks(">=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);
4226
4281
  }), d.operator === a || d.operator === c || (!f.operator || f.operator === a) && n(s, f.semver))
4227
4282
  return !1;
4228
4283
  if (f.operator === c && i(s, f.semver))
@@ -4230,20 +4285,20 @@ const ic = H, Ps = it(), { ANY: ac } = Ps, cc = te(), lc = at, Ir = nt, Ar = Mt,
4230
4285
  }
4231
4286
  return !0;
4232
4287
  };
4233
- var Ht = pc;
4234
- const hc = Ht, fc = (s, e, t) => hc(s, e, ">", t);
4235
- var gc = fc;
4236
- const mc = Ht, vc = (s, e, t) => mc(s, e, "<", t);
4237
- var yc = vc;
4238
- const Tr = te(), wc = (s, e, t) => (s = new Tr(s, t), e = new Tr(e, t), s.intersects(e, t));
4239
- var Sc = wc;
4240
- const bc = at, Cc = ee;
4241
- var Rc = (s, e, t) => {
4288
+ var Wt = mc;
4289
+ const vc = Wt, yc = (s, e, t) => vc(s, e, ">", t);
4290
+ var wc = yc;
4291
+ const Sc = Wt, bc = (s, e, t) => Sc(s, e, "<", t);
4292
+ var Rc = bc;
4293
+ const Lr = te(), Ec = (s, e, t) => (s = new Lr(s, t), e = new Lr(e, t), s.intersects(e, t));
4294
+ var Cc = Ec;
4295
+ const Pc = ct, kc = ee;
4296
+ var $c = (s, e, t) => {
4242
4297
  const r = [];
4243
4298
  let o = null, n = null;
4244
- const i = s.sort((l, d) => Cc(l, d, t));
4299
+ const i = s.sort((l, d) => kc(l, d, t));
4245
4300
  for (const l of i)
4246
- bc(l, e, t) ? (n = l, o || (o = l)) : (n && r.push([o, n]), n = null, o = null);
4301
+ Pc(l, e, t) ? (n = l, o || (o = l)) : (n && r.push([o, n]), n = null, o = null);
4247
4302
  o && r.push([o, null]);
4248
4303
  const a = [];
4249
4304
  for (const [l, d] of r)
@@ -4251,14 +4306,14 @@ var Rc = (s, e, t) => {
4251
4306
  const c = a.join(" || "), u = typeof e.raw == "string" ? e.raw : String(e);
4252
4307
  return c.length < u.length ? c : e;
4253
4308
  };
4254
- const Lr = te(), Wt = it(), { ANY: gt } = Wt, Ce = at, zt = ee, Ec = (s, e, t = {}) => {
4309
+ const Dr = te(), zt = at(), { ANY: mt } = zt, Ee = ct, Xt = ee, Oc = (s, e, t = {}) => {
4255
4310
  if (s === e)
4256
4311
  return !0;
4257
- s = new Lr(s, t), e = new Lr(e, t);
4312
+ s = new Dr(s, t), e = new Dr(e, t);
4258
4313
  let r = !1;
4259
4314
  e: for (const o of s.set) {
4260
4315
  for (const n of e.set) {
4261
- const i = kc(o, n, t);
4316
+ const i = Ic(o, n, t);
4262
4317
  if (r = r || i !== null, i)
4263
4318
  continue e;
4264
4319
  }
@@ -4266,37 +4321,37 @@ const Lr = te(), Wt = it(), { ANY: gt } = Wt, Ce = at, zt = ee, Ec = (s, e, t =
4266
4321
  return !1;
4267
4322
  }
4268
4323
  return !0;
4269
- }, Pc = [new Wt(">=0.0.0-0")], Dr = [new Wt(">=0.0.0")], kc = (s, e, t) => {
4324
+ }, Fc = [new zt(">=0.0.0-0")], Nr = [new zt(">=0.0.0")], Ic = (s, e, t) => {
4270
4325
  if (s === e)
4271
4326
  return !0;
4272
- if (s.length === 1 && s[0].semver === gt) {
4273
- if (e.length === 1 && e[0].semver === gt)
4327
+ if (s.length === 1 && s[0].semver === mt) {
4328
+ if (e.length === 1 && e[0].semver === mt)
4274
4329
  return !0;
4275
- t.includePrerelease ? s = Pc : s = Dr;
4330
+ t.includePrerelease ? s = Fc : s = Nr;
4276
4331
  }
4277
- if (e.length === 1 && e[0].semver === gt) {
4332
+ if (e.length === 1 && e[0].semver === mt) {
4278
4333
  if (t.includePrerelease)
4279
4334
  return !0;
4280
- e = Dr;
4335
+ e = Nr;
4281
4336
  }
4282
4337
  const r = /* @__PURE__ */ new Set();
4283
4338
  let o, n;
4284
4339
  for (const h of s)
4285
- h.operator === ">" || h.operator === ">=" ? o = Nr(o, h, t) : h.operator === "<" || h.operator === "<=" ? n = Br(n, h, t) : r.add(h.semver);
4340
+ h.operator === ">" || h.operator === ">=" ? o = Br(o, h, t) : h.operator === "<" || h.operator === "<=" ? n = xr(n, h, t) : r.add(h.semver);
4286
4341
  if (r.size > 1)
4287
4342
  return null;
4288
4343
  let i;
4289
4344
  if (o && n) {
4290
- if (i = zt(o.semver, n.semver, t), i > 0)
4345
+ if (i = Xt(o.semver, n.semver, t), i > 0)
4291
4346
  return null;
4292
4347
  if (i === 0 && (o.operator !== ">=" || n.operator !== "<="))
4293
4348
  return null;
4294
4349
  }
4295
4350
  for (const h of r) {
4296
- if (o && !Ce(h, String(o), t) || n && !Ce(h, String(n), t))
4351
+ if (o && !Ee(h, String(o), t) || n && !Ee(h, String(n), t))
4297
4352
  return null;
4298
- for (const R of e)
4299
- if (!Ce(h, String(R), t))
4353
+ for (const E of e)
4354
+ if (!Ee(h, String(E), t))
4300
4355
  return !1;
4301
4356
  return !0;
4302
4357
  }
@@ -4305,90 +4360,90 @@ const Lr = te(), Wt = it(), { ANY: gt } = Wt, Ce = at, zt = ee, Ec = (s, e, t =
4305
4360
  for (const h of e) {
4306
4361
  if (l = l || h.operator === ">" || h.operator === ">=", u = u || h.operator === "<" || h.operator === "<=", o) {
4307
4362
  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 === ">=") {
4308
- if (a = Nr(o, h, t), a === h && a !== o)
4363
+ if (a = Br(o, h, t), a === h && a !== o)
4309
4364
  return !1;
4310
- } else if (o.operator === ">=" && !Ce(o.semver, String(h), t))
4365
+ } else if (o.operator === ">=" && !Ee(o.semver, String(h), t))
4311
4366
  return !1;
4312
4367
  }
4313
4368
  if (n) {
4314
4369
  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 === "<=") {
4315
- if (c = Br(n, h, t), c === h && c !== n)
4370
+ if (c = xr(n, h, t), c === h && c !== n)
4316
4371
  return !1;
4317
- } else if (n.operator === "<=" && !Ce(n.semver, String(h), t))
4372
+ } else if (n.operator === "<=" && !Ee(n.semver, String(h), t))
4318
4373
  return !1;
4319
4374
  }
4320
4375
  if (!h.operator && (n || o) && i !== 0)
4321
4376
  return !1;
4322
4377
  }
4323
4378
  return !(o && u && !n && i !== 0 || n && l && !o && i !== 0 || f || d);
4324
- }, Nr = (s, e, t) => {
4379
+ }, Br = (s, e, t) => {
4325
4380
  if (!s)
4326
4381
  return e;
4327
- const r = zt(s.semver, e.semver, t);
4382
+ const r = Xt(s.semver, e.semver, t);
4328
4383
  return r > 0 ? s : r < 0 || e.operator === ">" && s.operator === ">=" ? e : s;
4329
- }, Br = (s, e, t) => {
4384
+ }, xr = (s, e, t) => {
4330
4385
  if (!s)
4331
4386
  return e;
4332
- const r = zt(s.semver, e.semver, t);
4387
+ const r = Xt(s.semver, e.semver, t);
4333
4388
  return r < 0 ? s : r > 0 || e.operator === "<" && s.operator === "<=" ? e : s;
4334
4389
  };
4335
- var Oc = Ec;
4336
- const mt = Be, xr = st, $c = H, jr = bs, Fc = we, Ic = Bi, Ac = Vi, Tc = Ji, Lc = Mi, Dc = Hi, Nc = Xi, Bc = Qi, xc = ta, jc = ee, Vc = na, Uc = ca, Jc = Gt, Gc = pa, Mc = ga, _c = nt, Kc = Mt, Hc = Cs, Wc = Rs, zc = _t, Xc = Kt, qc = Es, Yc = ja, Qc = it(), Zc = te(), el = at, tl = Ka, rl = Xa, sl = Za, ol = rc, nl = nc, il = Ht, al = gc, cl = yc, ll = Sc, ul = Rc, dl = Oc;
4337
- var pl = {
4338
- parse: Fc,
4339
- valid: Ic,
4340
- clean: Ac,
4341
- inc: Tc,
4342
- diff: Lc,
4343
- major: Dc,
4344
- minor: Nc,
4345
- patch: Bc,
4346
- prerelease: xc,
4347
- compare: jc,
4348
- rcompare: Vc,
4349
- compareLoose: Uc,
4350
- compareBuild: Jc,
4351
- sort: Gc,
4352
- rsort: Mc,
4353
- gt: _c,
4354
- lt: Kc,
4355
- eq: Hc,
4356
- neq: Wc,
4357
- gte: zc,
4358
- lte: Xc,
4359
- cmp: qc,
4360
- coerce: Yc,
4361
- Comparator: Qc,
4362
- Range: Zc,
4363
- satisfies: el,
4364
- toComparators: tl,
4365
- maxSatisfying: rl,
4366
- minSatisfying: sl,
4367
- minVersion: ol,
4368
- validRange: nl,
4369
- outside: il,
4370
- gtr: al,
4371
- ltr: cl,
4372
- intersects: ll,
4373
- simplifyRange: ul,
4374
- subset: dl,
4375
- SemVer: $c,
4376
- re: mt.re,
4377
- src: mt.src,
4378
- tokens: mt.t,
4379
- SEMVER_SPEC_VERSION: xr.SEMVER_SPEC_VERSION,
4380
- RELEASE_TYPES: xr.RELEASE_TYPES,
4381
- compareIdentifiers: jr.compareIdentifiers,
4382
- rcompareIdentifiers: jr.rcompareIdentifiers
4390
+ var Ac = Oc;
4391
+ const vt = Be, jr = ot, Tc = H, Vr = Rs, Lc = Se, Dc = Ui, Nc = Mi, Bc = Ki, xc = Wi, jc = qi, Vc = Zi, Uc = ra, Jc = na, Gc = ee, Mc = la, _c = pa, Kc = Mt, Hc = ma, Wc = wa, zc = it, Xc = _t, qc = Es, Yc = Cs, Qc = Kt, Zc = Ht, el = Ps, tl = Ga, rl = at(), sl = te(), ol = ct, nl = Xa, il = Za, al = sc, cl = ic, ll = lc, ul = Wt, dl = wc, pl = Rc, hl = Cc, fl = $c, gl = Ac;
4392
+ var ml = {
4393
+ parse: Lc,
4394
+ valid: Dc,
4395
+ clean: Nc,
4396
+ inc: Bc,
4397
+ diff: xc,
4398
+ major: jc,
4399
+ minor: Vc,
4400
+ patch: Uc,
4401
+ prerelease: Jc,
4402
+ compare: Gc,
4403
+ rcompare: Mc,
4404
+ compareLoose: _c,
4405
+ compareBuild: Kc,
4406
+ sort: Hc,
4407
+ rsort: Wc,
4408
+ gt: zc,
4409
+ lt: Xc,
4410
+ eq: qc,
4411
+ neq: Yc,
4412
+ gte: Qc,
4413
+ lte: Zc,
4414
+ cmp: el,
4415
+ coerce: tl,
4416
+ Comparator: rl,
4417
+ Range: sl,
4418
+ satisfies: ol,
4419
+ toComparators: nl,
4420
+ maxSatisfying: il,
4421
+ minSatisfying: al,
4422
+ minVersion: cl,
4423
+ validRange: ll,
4424
+ outside: ul,
4425
+ gtr: dl,
4426
+ ltr: pl,
4427
+ intersects: hl,
4428
+ simplifyRange: fl,
4429
+ subset: gl,
4430
+ SemVer: Tc,
4431
+ re: vt.re,
4432
+ src: vt.src,
4433
+ tokens: vt.t,
4434
+ SEMVER_SPEC_VERSION: jr.SEMVER_SPEC_VERSION,
4435
+ RELEASE_TYPES: jr.RELEASE_TYPES,
4436
+ compareIdentifiers: Vr.compareIdentifiers,
4437
+ rcompareIdentifiers: Vr.rcompareIdentifiers
4383
4438
  };
4384
- const hl = /* @__PURE__ */ Si(pl), fl = {
4439
+ const vl = /* @__PURE__ */ Ci(ml), yl = {
4385
4440
  minDelay: 1500
4386
- }, gl = "__no_updates__";
4387
- class ml extends Zs {
4441
+ }, wl = "__no_updates__";
4442
+ class Sl extends Zs {
4388
4443
  constructor(t, r, o = {}) {
4389
- super({ ...o, ...fl }, r);
4390
- S(this, "http");
4391
- S(this, "preferredUpdateChannel");
4444
+ super({ ...o, ...yl }, r);
4445
+ w(this, "http");
4446
+ w(this, "preferredUpdateChannel");
4392
4447
  this.registryProvider = t, this.http = o.http, this.preferredUpdateChannel = o.preferredUpdateChannel;
4393
4448
  }
4394
4449
  getKey(t) {
@@ -4400,7 +4455,7 @@ class ml extends Zs {
4400
4455
  case "from-registry-v2":
4401
4456
  return `from_registry_v2_${Z(t)}`;
4402
4457
  default:
4403
- return gl;
4458
+ return wl;
4404
4459
  }
4405
4460
  }
4406
4461
  async readValue(t) {
@@ -4410,16 +4465,16 @@ class ml extends Zs {
4410
4465
  switch (n.type) {
4411
4466
  case "dev-v1":
4412
4467
  try {
4413
- const i = await Yr(n.folder);
4468
+ const i = await Qr(n.folder);
4414
4469
  return i === n.mtime ? { suggestions: [] } : { mainSuggestion: { ...n, mtime: i }, suggestions: [] };
4415
4470
  } catch (i) {
4416
4471
  return this.logger.warn(i), { suggestions: [] };
4417
4472
  }
4418
4473
  case "dev-v2":
4419
4474
  try {
4420
- const i = await wt(n.folder, this.logger);
4475
+ const i = await St(n.folder, this.logger);
4421
4476
  if (i === void 0) return { suggestions: [] };
4422
- const a = await Nt(i);
4477
+ const a = await Bt(i);
4423
4478
  return a === n.mtime ? { suggestions: [] } : { mainSuggestion: { ...n, mtime: a }, suggestions: [] };
4424
4479
  } catch (i) {
4425
4480
  return this.logger.warn(i), { suggestions: [] };
@@ -4434,11 +4489,11 @@ class ml extends Zs {
4434
4489
  if (n.channel === void 0)
4435
4490
  if (await c.getLatestOverview(n.id, Oe)) u = Oe;
4436
4491
  else {
4437
- if (await c.getLatestOverview(n.id, ke) === void 0)
4492
+ if (await c.getLatestOverview(n.id, $e) === void 0)
4438
4493
  return this.logger.error(
4439
- `No "any" channel record for ${Ds(n.id)}`
4494
+ `No "any" channel record for ${Ns(n.id)}`
4440
4495
  ), { suggestions: [] };
4441
- u = ke;
4496
+ u = $e;
4442
4497
  }
4443
4498
  else u = n.channel;
4444
4499
  const l = await c.getUpdateSuggestions(n.id, u);
@@ -4450,18 +4505,18 @@ class ml extends Zs {
4450
4505
  d = l[0].update;
4451
4506
  break;
4452
4507
  case "major":
4453
- d = (r = l.find((R) => R.type !== "major")) == null ? void 0 : r.update;
4508
+ d = (r = l.find((E) => E.type !== "major")) == null ? void 0 : r.update;
4454
4509
  break;
4455
4510
  case "minor":
4456
- d = (o = l.find((R) => R.type === "patch")) == null ? void 0 : o.update;
4511
+ d = (o = l.find((E) => E.type === "patch")) == null ? void 0 : o.update;
4457
4512
  break;
4458
4513
  }
4459
- const f = l.map(({ type: R, update: g }) => ({
4460
- type: R,
4514
+ const f = l.map(({ type: E, update: g }) => ({
4515
+ type: E,
4461
4516
  update: { ...n, id: { ...n.id, version: g } }
4462
4517
  }));
4463
4518
  if (d === void 0) return { suggestions: f };
4464
- if (a !== void 0 && hl.lte(d, a))
4519
+ if (a !== void 0 && vl.lte(d, a))
4465
4520
  return { suggestions: f };
4466
4521
  const h = {
4467
4522
  ...n,
@@ -4470,8 +4525,8 @@ class ml extends Zs {
4470
4525
  return (async () => {
4471
4526
  try {
4472
4527
  await c.getComponents(h.id);
4473
- } catch (R) {
4474
- this.logger.warn(R);
4528
+ } catch (E) {
4529
+ this.logger.warn(E);
4475
4530
  }
4476
4531
  })(), { suggestions: f, mainSuggestion: h };
4477
4532
  } catch (i) {
@@ -4488,9 +4543,9 @@ class ml extends Zs {
4488
4543
  return Z(t) === Z(r);
4489
4544
  }
4490
4545
  }
4491
- class Vr {
4546
+ class Ur {
4492
4547
  constructor() {
4493
- S(this, "resources", /* @__PURE__ */ new Map());
4548
+ w(this, "resources", /* @__PURE__ */ new Map());
4494
4549
  }
4495
4550
  check(e) {
4496
4551
  const t = this.resources.get(e);
@@ -4519,17 +4574,17 @@ class Vr {
4519
4574
  return (t = this.resources.get(e)) == null ? void 0 : t.resource;
4520
4575
  }
4521
4576
  }
4522
- let Re;
4577
+ let Ce;
4523
4578
  function ne() {
4524
- return Re || (Re = {
4579
+ return Ce || (Ce = {
4525
4580
  logPFrameRequests: process.env.MI_LOG_PFRAMES !== void 0,
4526
4581
  usePFrameRs: process.env.MI_USE_PFRAMES_RS !== void 0
4527
- }, process.env.MI_LOG_TREE_STAT && (Re.logTreeStats = process.env.MI_LOG_TREE_STAT === "cumulative" ? "cumulative" : "per-request"), Re);
4582
+ }, process.env.MI_LOG_TREE_STAT && (Ce.logTreeStats = process.env.MI_LOG_TREE_STAT === "cumulative" ? "cumulative" : "per-request"), Ce);
4528
4583
  }
4529
- function Ie(s) {
4584
+ function Ae(s) {
4530
4585
  return String(s.id);
4531
4586
  }
4532
- const vl = ["Int", "Long", "Float", "Double", "String", "Bytes"];
4587
+ const bl = ["Int", "Long", "Float", "Double", "String", "Bytes"];
4533
4588
  function me(s) {
4534
4589
  const e = [], t = [];
4535
4590
  for (const r of s)
@@ -4545,7 +4600,7 @@ function me(s) {
4545
4600
  }
4546
4601
  return t;
4547
4602
  }
4548
- function vt(s) {
4603
+ function yt(s) {
4549
4604
  return ne().usePFrameRs ? s.rustCallback() : s.rustCallback().catch((e) => {
4550
4605
  var t;
4551
4606
  if (((t = s.signal) == null ? void 0 : t.aborted) === !1)
@@ -4553,22 +4608,22 @@ function vt(s) {
4553
4608
  throw e;
4554
4609
  });
4555
4610
  }
4556
- const Ee = (s, e) => typeof e == "bigint" ? e.toString() : e;
4557
- class yl {
4611
+ const Pe = (s, e) => typeof e == "bigint" ? e.toString() : e;
4612
+ class Rl {
4558
4613
  constructor(e, t, r, o) {
4559
- S(this, "rustPFrame");
4560
- S(this, "blobIdToResource", /* @__PURE__ */ new Map());
4561
- S(this, "blobHandleComputables", /* @__PURE__ */ new Map());
4562
- S(this, "createDataPFrame");
4563
- S(this, "preloadBlob", async (e) => {
4614
+ w(this, "rustPFrame");
4615
+ w(this, "blobIdToResource", /* @__PURE__ */ new Map());
4616
+ w(this, "blobHandleComputables", /* @__PURE__ */ new Map());
4617
+ w(this, "createDataPFrame");
4618
+ w(this, "preloadBlob", async (e) => {
4564
4619
  const t = e.map((r) => this.getOrCreateComputableForBlob(r));
4565
4620
  for (const r of t) await r.awaitStableFullValue();
4566
4621
  });
4567
- S(this, "resolveBlob", async (e) => {
4622
+ w(this, "resolveBlob", async (e) => {
4568
4623
  const t = this.getOrCreateComputableForBlob(e);
4569
4624
  return this.blobDriver.getLocalPath((await t.awaitStableValue()).handle);
4570
4625
  });
4571
- S(this, "resolveBlobContent", async (e) => {
4626
+ w(this, "resolveBlobContent", async (e) => {
4572
4627
  try {
4573
4628
  const t = this.getOrCreateComputableForBlob(e), r = this.blobDriver.getLocalPath((await t.awaitStableValue()).handle);
4574
4629
  return await this.blobContentCache.forceFetch(r);
@@ -4590,19 +4645,19 @@ class yl {
4590
4645
  }
4591
4646
  };
4592
4647
  for (const a of o)
4593
- for (const c of gn(a.data))
4594
- this.blobIdToResource.set(Ie(c), c);
4648
+ for (const c of vn(a.data))
4649
+ this.blobIdToResource.set(Ae(c), c);
4595
4650
  const i = [
4596
4651
  ...new Map(o.map((a) => ({
4597
4652
  ...a,
4598
- data: mn(a.data, Ie)
4653
+ data: yn(a.data, Ae)
4599
4654
  })).map(
4600
4655
  (a) => [Z(a), a]
4601
4656
  )).values()
4602
4657
  ];
4603
4658
  this.rustPFrame = (() => {
4604
4659
  try {
4605
- const a = new vo(ne().logPFrameRequests ? n : void 0);
4660
+ const a = new wo(ne().logPFrameRequests ? n : void 0);
4606
4661
  a.setDataSource(this);
4607
4662
  for (const c of i)
4608
4663
  a.addColumnSpec(c.id, c.spec), a.setColumnData(c.id, c.data);
@@ -4614,7 +4669,7 @@ class yl {
4614
4669
  }
4615
4670
  })(), this.createDataPFrame = () => {
4616
4671
  try {
4617
- const a = ne().logPFrameRequests ? new rr(n) : new rr();
4672
+ const a = ne().logPFrameRequests ? new sr(n) : new sr();
4618
4673
  a.setDataSource(this);
4619
4674
  for (const c of i)
4620
4675
  try {
@@ -4653,7 +4708,7 @@ class yl {
4653
4708
  this.rustPFrame.dispose();
4654
4709
  }
4655
4710
  }
4656
- class wl {
4711
+ class El {
4657
4712
  constructor(e) {
4658
4713
  this.table = e;
4659
4714
  }
@@ -4661,44 +4716,44 @@ class wl {
4661
4716
  this.table.then((e) => e.dispose());
4662
4717
  }
4663
4718
  }
4664
- class Sl {
4719
+ class Cl {
4665
4720
  constructor(e, t) {
4666
- S(this, "pFrames");
4667
- S(this, "pTables");
4668
- S(this, "blobContentCache");
4721
+ w(this, "pFrames");
4722
+ w(this, "pTables");
4723
+ w(this, "blobContentCache");
4669
4724
  /** Limits concurrent requests to PFrame API to prevent deadlock with Node's IO threads */
4670
- S(this, "concurrencyLimiter");
4725
+ w(this, "concurrencyLimiter");
4671
4726
  this.blobDriver = e, this.logger = t;
4672
- const r = new Wr({
4727
+ const r = new zr({
4673
4728
  maxSize: 1e9,
4674
4729
  // 1Gb
4675
- fetchMethod: async (n) => await Kr.readFile(n),
4730
+ fetchMethod: async (n) => await Hr.readFile(n),
4676
4731
  sizeCalculation: (n) => n.length
4677
4732
  });
4678
4733
  this.blobContentCache = r;
4679
- const o = new Js(1);
4680
- this.concurrencyLimiter = o, this.pFrames = new class extends Vr {
4734
+ const o = new Gs(1);
4735
+ this.concurrencyLimiter = o, this.pFrames = new class extends Ur {
4681
4736
  constructor(n, i) {
4682
4737
  super(), this.blobDriver = n, this.logger = i;
4683
4738
  }
4684
4739
  createNewResource(n) {
4685
4740
  return ne().logPFrameRequests && t.info(
4686
- `PFrame creation (pFrameHandle = ${this.calculateParamsKey(n)}): ${JSON.stringify(n, Ee)}`
4687
- ), new yl(this.blobDriver, this.logger, r, n);
4741
+ `PFrame creation (pFrameHandle = ${this.calculateParamsKey(n)}): ${JSON.stringify(n, Pe)}`
4742
+ ), new Rl(this.blobDriver, this.logger, r, n);
4688
4743
  }
4689
4744
  calculateParamsKey(n) {
4690
- return Cl(n);
4745
+ return kl(n);
4691
4746
  }
4692
- }(this.blobDriver, this.logger), this.pTables = new class extends Vr {
4747
+ }(this.blobDriver, this.logger), this.pTables = new class extends Ur {
4693
4748
  constructor(n) {
4694
4749
  super(), this.pFrames = n;
4695
4750
  }
4696
4751
  createNewResource(n) {
4697
4752
  const i = n.pFrameHandle;
4698
4753
  ne().logPFrameRequests && t.info(
4699
- `PTable creation (pTableHandle = ${this.calculateParamsKey(n)}): ${JSON.stringify(n, Ee)}`
4754
+ `PTable creation (pTableHandle = ${this.calculateParamsKey(n)}): ${JSON.stringify(n, Pe)}`
4700
4755
  );
4701
- const a = vt({
4756
+ const a = yt({
4702
4757
  cppCallback: () => o.run(async () => {
4703
4758
  var u = [];
4704
4759
  try {
@@ -4735,10 +4790,10 @@ class Sl {
4735
4790
  filters: n.def.filters,
4736
4791
  signal: n.signal
4737
4792
  });
4738
- return new wl(a);
4793
+ return new El(a);
4739
4794
  }
4740
4795
  calculateParamsKey(n) {
4741
- return bl(n);
4796
+ return Pl(n);
4742
4797
  }
4743
4798
  }(this.pFrames);
4744
4799
  }
@@ -4746,20 +4801,20 @@ class Sl {
4746
4801
  // Internal / Config API Methods
4747
4802
  //
4748
4803
  createPFrame(e, t) {
4749
- const r = e.filter((n) => vl.find((i) => i === n.spec.valueType)).map(
4804
+ const r = e.filter((n) => bl.find((i) => i === n.spec.valueType)).map(
4750
4805
  (n) => le(
4751
4806
  n,
4752
- (i) => Qs(i) ? Cn(i) : Rn(n.spec, i)
4807
+ (i) => Qs(i) ? Cn(i) : Pn(n.spec, i)
4753
4808
  )
4754
4809
  ), o = this.pFrames.acquire(r);
4755
4810
  return t.addOnDestroy(o.unref), o.key;
4756
4811
  }
4757
4812
  createPTable(e, t, r) {
4758
- const o = this.createPFrame(Ls(e.src), t), n = yt(e, (a) => a.id), i = this.pTables.acquire({ def: n, pFrameHandle: o, signal: r });
4813
+ const o = this.createPFrame(Ds(e.src), t), n = wt(e, (a) => a.id), i = this.pTables.acquire({ def: n, pFrameHandle: o, signal: r });
4759
4814
  return ne().logPFrameRequests && this.logger.info(
4760
4815
  `Create PTable call (pFrameHandle = ${o}; pTableHandle = ${JSON.stringify(i)}): ${JSON.stringify(
4761
- yt(e, (a) => a.spec),
4762
- Ee
4816
+ wt(e, (a) => a.spec),
4817
+ Pe
4763
4818
  )}`
4764
4819
  ), t.addOnDestroy(i.unref), i.key;
4765
4820
  }
@@ -4793,8 +4848,8 @@ class Sl {
4793
4848
  }
4794
4849
  async calculateTableData(e, t, r) {
4795
4850
  return ne().logPFrameRequests && this.logger.info(
4796
- `Call calculateTableData, handle = ${e}, request = ${JSON.stringify(t, Ee)}`
4797
- ), await vt({
4851
+ `Call calculateTableData, handle = ${e}, request = ${JSON.stringify(t, Pe)}`
4852
+ ), await yt({
4798
4853
  cppCallback: async () => await this.concurrencyLimiter.run(async () => {
4799
4854
  var n = [];
4800
4855
  try {
@@ -4856,8 +4911,8 @@ class Sl {
4856
4911
  }
4857
4912
  async getUniqueValues(e, t, r) {
4858
4913
  return ne().logPFrameRequests && this.logger.info(
4859
- `Call getUniqueValues, handle = ${e}, request = ${JSON.stringify(t, Ee)}`
4860
- ), await vt({
4914
+ `Call getUniqueValues, handle = ${e}, request = ${JSON.stringify(t, Pe)}`
4915
+ ), await yt({
4861
4916
  cppCallback: async () => await this.concurrencyLimiter.run(async () => {
4862
4917
  var n = [];
4863
4918
  try {
@@ -4921,11 +4976,11 @@ function ue(s) {
4921
4976
  K(s);
4922
4977
  }
4923
4978
  }
4924
- function bl(s) {
4979
+ function Pl(s) {
4925
4980
  const e = Ne("sha256");
4926
4981
  return e.update(Z(s)), e.digest().toString("hex");
4927
4982
  }
4928
- function Cl(s) {
4983
+ function kl(s) {
4929
4984
  const e = [...s].map(
4930
4985
  (r) => le(r, (o) => {
4931
4986
  let n;
@@ -4947,7 +5002,7 @@ function Cl(s) {
4947
5002
  keyLength: o.partitionKeyLength,
4948
5003
  payload: Object.entries(o.parts).map(([a, c]) => ({
4949
5004
  key: a,
4950
- value: Ie(c)
5005
+ value: Ae(c)
4951
5006
  }))
4952
5007
  };
4953
5008
  break;
@@ -4957,7 +5012,7 @@ function Cl(s) {
4957
5012
  keyLength: o.partitionKeyLength,
4958
5013
  payload: Object.entries(o.parts).map(([a, c]) => ({
4959
5014
  key: a,
4960
- value: [Ie(c.index), Ie(c.values)]
5015
+ value: [Ae(c.index), Ae(c.values)]
4961
5016
  }))
4962
5017
  };
4963
5018
  break;
@@ -4971,57 +5026,57 @@ function Cl(s) {
4971
5026
  const t = Ne("sha256");
4972
5027
  return t.update(Z(e)), t.digest().toString("hex");
4973
5028
  }
4974
- async function Rl(s, e, t) {
5029
+ async function $l(s, e, t) {
4975
5030
  const r = {
4976
- ...vs,
4977
- ...ys(e),
5031
+ ...ys,
5032
+ ...ws(e),
4978
5033
  ...t
4979
- }, o = new _r(r.localSecret), n = no(r.logger, s, r.localProjections), i = io(s, r.logger), a = ao(s, r.logger), c = co(s, r.logger), u = new lo(
5034
+ }, o = new Kr(r.localSecret), n = ao(r.logger, s, r.localProjections), i = co(s, r.logger), a = lo(s, r.logger), c = uo(s, r.logger), u = new po(
4980
5035
  r.logger,
4981
5036
  n,
4982
5037
  i,
4983
5038
  r.blobDownloadPath,
4984
5039
  o,
4985
5040
  r.blobDriverOps
4986
- ), l = new uo(
5041
+ ), l = new ho(
4987
5042
  r.logger,
4988
5043
  o,
4989
5044
  n,
4990
5045
  r.downloadBlobToURLPath,
4991
5046
  r.downloadBlobToURLDriverOps
4992
- ), d = new po(
5047
+ ), d = new fo(
4993
5048
  r.logger,
4994
5049
  o,
4995
5050
  a,
4996
5051
  c,
4997
5052
  r.uploadDriverOps
4998
- ), f = new ho(r.logger, i, r.logStreamDriverOps), h = new fo(r.logger, f, u), R = await go.init(
5053
+ ), f = new go(r.logger, i, r.logStreamDriverOps), h = new mo(r.logger, f, u), E = await vo.init(
4999
5054
  r.logger,
5000
5055
  s,
5001
5056
  o,
5002
5057
  r.localProjections,
5003
5058
  r.openFileDialogCallback,
5004
5059
  r.virtualLocalStoragesOverride
5005
- ), g = new Sl(u, r.logger);
5060
+ ), g = new Cl(u, r.logger);
5006
5061
  return {
5007
5062
  blobDriver: u,
5008
5063
  blobToURLDriver: l,
5009
5064
  logDriver: h,
5010
- lsDriver: R,
5065
+ lsDriver: E,
5011
5066
  signer: o,
5012
5067
  uploadDriver: d,
5013
5068
  pFrameDriver: g
5014
5069
  };
5015
5070
  }
5016
- class ks {
5071
+ class $s {
5017
5072
  constructor(e, t, r, o, n, i, a, c) {
5018
- S(this, "pl");
5073
+ w(this, "pl");
5019
5074
  /** Contains a reactive list of projects along with their meta information. */
5020
- S(this, "projectList");
5075
+ w(this, "projectList");
5021
5076
  //
5022
5077
  // Projects
5023
5078
  //
5024
- S(this, "openedProjectsByRid", /* @__PURE__ */ new Map());
5079
+ w(this, "openedProjectsByRid", /* @__PURE__ */ new Map());
5025
5080
  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;
5026
5081
  }
5027
5082
  /** Returns extended API driver kit used internally by middle layer. */
@@ -5032,10 +5087,10 @@ class ks {
5032
5087
  // Project List Manipulation
5033
5088
  //
5034
5089
  /** Creates a project with initial state and adds it to project list. */
5035
- async createProject(e, t = Ae()) {
5090
+ async createProject(e, t = we()) {
5036
5091
  const r = await this.pl.withWriteTx("MLCreateProject", async (o) => {
5037
- const n = await fn(o, e);
5038
- return o.createField(x(this.projectListResourceId, t), "Dynamic", n), await o.commit(), await Xs(n);
5092
+ const n = await mn(o, e);
5093
+ return o.createField(x(this.projectListResourceId, t), "Dynamic", n), await o.commit(), await qs(n);
5039
5094
  });
5040
5095
  return await this.projectListTree.refreshState(), r;
5041
5096
  }
@@ -5055,7 +5110,7 @@ class ks {
5055
5110
  async projectIdToResourceId(e) {
5056
5111
  return await this.pl.withReadTx("Project id to resource id", async (t) => {
5057
5112
  const r = (await t.getField(x(this.projectListResourceId, e))).value;
5058
- if (Ye(r)) throw new Error("Unexpected project list structure.");
5113
+ if (Qe(r)) throw new Error("Unexpected project list structure.");
5059
5114
  return r;
5060
5115
  });
5061
5116
  }
@@ -5066,7 +5121,7 @@ class ks {
5066
5121
  async openProject(e) {
5067
5122
  const t = await this.ensureProjectRid(e);
5068
5123
  if (this.openedProjectsByRid.has(t)) throw new Error(`Project ${t} already opened`);
5069
- this.openedProjectsByRid.set(t, await Ut.init(this.env, t)), this.openedProjectsList.setValue([...this.openedProjectsByRid.keys()]);
5124
+ this.openedProjectsByRid.set(t, await Jt.init(this.env, t)), this.openedProjectsList.setValue([...this.openedProjectsByRid.keys()]);
5070
5125
  }
5071
5126
  /** Closes the project, and deallocate all corresponding resources. */
5072
5127
  async closeProject(e) {
@@ -5094,33 +5149,33 @@ class ks {
5094
5149
  /** Generates sufficiently random string to be used as local secret for the
5095
5150
  * middle layer */
5096
5151
  static generateLocalSecret() {
5097
- return _r.generateSecret();
5152
+ return Kr.generateSecret();
5098
5153
  }
5099
5154
  /** Initialize middle layer */
5100
5155
  static async init(e, t, r) {
5101
5156
  const o = {
5102
- ...yi,
5103
- ...wi(t),
5157
+ ...Ri,
5158
+ ...Ei(t),
5104
5159
  ...r
5105
5160
  };
5106
5161
  o.defaultTreeOptions.logStat = ne().logTreeStats;
5107
5162
  const n = await e.withWriteTx("MLInitialization", async (g) => {
5108
- const D = x(g.clientRoot, jo);
5163
+ const D = x(g.clientRoot, Uo);
5109
5164
  g.createField(D, "Dynamic");
5110
5165
  const T = await g.getField(D);
5111
- if (Ye(T.value)) {
5112
- const j = g.createEphemeral(es);
5166
+ if (Qe(T.value)) {
5167
+ const j = g.createEphemeral(ts);
5113
5168
  return g.lock(j), g.setField(D, j), await g.commit(), await j.globalId;
5114
5169
  } else
5115
5170
  return T.value;
5116
- }), i = o.logger, a = await Rl(e, t, o), c = new Ns(e.httpDispatcher, {
5171
+ }), i = o.logger, a = await $l(e, t, o), c = new Bs(e.httpDispatcher, {
5117
5172
  minTimeout: 250,
5118
5173
  maxRetries: 4
5119
- }), u = new ko(c), l = new an(
5174
+ }), u = new Oo(c), l = new ln(
5120
5175
  u,
5121
5176
  a.signer,
5122
5177
  c
5123
- ), d = new mo(
5178
+ ), d = new yo(
5124
5179
  i,
5125
5180
  e.httpDispatcher,
5126
5181
  o.frontendDownloadPath
@@ -5134,26 +5189,26 @@ class ks {
5134
5189
  bpPreparer: l,
5135
5190
  frontendDownloadDriver: d,
5136
5191
  driverKit: a,
5137
- blockUpdateWatcher: new ml(u, i, {
5192
+ blockUpdateWatcher: new Sl(u, i, {
5138
5193
  minDelay: o.devBlockUpdateRecheckInterval,
5139
5194
  http: c,
5140
5195
  preferredUpdateChannel: o.preferredUpdateChannel
5141
5196
  }),
5142
- quickJs: await oo()
5143
- }, h = new eo([]), R = await Uo(e, n, h, f);
5144
- return new ks(
5197
+ quickJs: await io()
5198
+ }, h = new eo([]), E = await Go(e, n, h, f);
5199
+ return new $s(
5145
5200
  f,
5146
5201
  a,
5147
5202
  a.signer,
5148
5203
  n,
5149
5204
  h,
5150
- R.tree,
5205
+ E.tree,
5151
5206
  u,
5152
- R.computable
5207
+ E.computable
5153
5208
  );
5154
5209
  }
5155
5210
  }
5156
- const El = [
5211
+ const Ol = [
5157
5212
  "undici:request:create",
5158
5213
  // When a new request is created
5159
5214
  "undici:request:bodySent",
@@ -5191,7 +5246,7 @@ const El = [
5191
5246
  "undici:dispatcher:retry"
5192
5247
  // When a dispatcher retries a request
5193
5248
  ];
5194
- async function au(s, e = {}) {
5249
+ async function pu(s, e = {}) {
5195
5250
  const t = {
5196
5251
  pingCheckDurationMs: 1e4,
5197
5252
  pingTimeoutMs: 3e3,
@@ -5209,8 +5264,8 @@ async function au(s, e = {}) {
5209
5264
  bodyLimit: 300,
5210
5265
  ...e
5211
5266
  }, r = [];
5212
- El.forEach((c) => {
5213
- yo(c).subscribe((l) => {
5267
+ Ol.forEach((c) => {
5268
+ So(c).subscribe((l) => {
5214
5269
  var f;
5215
5270
  const d = (/* @__PURE__ */ new Date()).toISOString();
5216
5271
  (f = l == null ? void 0 : l.response) != null && f.headers && (l.response.headers = l.response.headers.map((h) => h.toString())), r.push(
@@ -5229,56 +5284,56 @@ async function au(s, e = {}) {
5229
5284
  blockRegistryUiChecks: [],
5230
5285
  blockGARegistryUiChecks: [],
5231
5286
  autoUpdateCdnChecks: []
5232
- }, n = qs(s, { defaultRequestTimeout: t.pingTimeoutMs });
5287
+ }, n = Ys(s, { defaultRequestTimeout: t.pingTimeoutMs });
5233
5288
  o.plPings = await ve(t.pingCheckDurationMs, t.maxPingsPerSecond, async () => {
5234
- const u = await new er(n).ping();
5289
+ const u = await new tr(n).ping();
5235
5290
  return JSON.stringify(u).slice(0, t.bodyLimit) + "...";
5236
5291
  });
5237
- const a = new er(n).ll.httpDispatcher;
5292
+ const a = new tr(n).ll.httpDispatcher;
5238
5293
  return o.blockRegistryOverviewChecks = await ve(
5239
5294
  t.blockRegistryDurationMs,
5240
5295
  t.maxRegistryChecksPerSecond,
5241
- async () => await Pe(new URL(t.blockOverviewPath, t.blockRegistryUrl), t, a)
5296
+ async () => await ke(new URL(t.blockOverviewPath, t.blockRegistryUrl), t, a)
5242
5297
  ), o.blockGARegistryOverviewChecks = await ve(
5243
5298
  t.blockRegistryDurationMs,
5244
5299
  t.maxRegistryChecksPerSecond,
5245
- async () => await Pe(new URL(t.blockOverviewPath, t.blockGARegistryUrl), t, a)
5300
+ async () => await ke(new URL(t.blockOverviewPath, t.blockGARegistryUrl), t, a)
5246
5301
  ), o.blockRegistryUiChecks = await ve(
5247
5302
  t.blockRegistryDurationMs,
5248
5303
  t.maxRegistryChecksPerSecond,
5249
- async () => await Pe(new URL(t.blockUiPath, t.blockRegistryUrl), t, a)
5304
+ async () => await ke(new URL(t.blockUiPath, t.blockRegistryUrl), t, a)
5250
5305
  ), o.blockGARegistryUiChecks = await ve(
5251
5306
  t.blockRegistryDurationMs,
5252
5307
  t.maxRegistryChecksPerSecond,
5253
- async () => await Pe(new URL(t.blockUiPath, t.blockGARegistryUrl), t, a)
5308
+ async () => await ke(new URL(t.blockUiPath, t.blockGARegistryUrl), t, a)
5254
5309
  ), o.autoUpdateCdnChecks = await ve(
5255
5310
  t.autoUpdateCdnDurationMs,
5256
5311
  t.maxAutoUpdateCdnChecksPerSecond,
5257
- async () => await Pe(t.autoUpdateCdnUrl, t, a)
5258
- ), Pl(o, s, t, r);
5312
+ async () => await ke(t.autoUpdateCdnUrl, t, a)
5313
+ ), Fl(o, s, t, r);
5259
5314
  }
5260
5315
  async function ve(s, e, t) {
5261
- const r = It(), o = [];
5262
- for (; Ur(r) < s; ) {
5263
- const n = It();
5316
+ const r = At(), o = [];
5317
+ for (; Jr(r) < s; ) {
5318
+ const n = At();
5264
5319
  let i;
5265
5320
  try {
5266
5321
  i = { ok: !0, value: await t() };
5267
5322
  } catch (u) {
5268
5323
  i = { ok: !1, error: u };
5269
5324
  }
5270
- const a = Ur(n);
5325
+ const a = Jr(n);
5271
5326
  o.push({
5272
5327
  elapsedMs: a,
5273
5328
  response: i
5274
5329
  });
5275
5330
  const c = 1e3 / e - a;
5276
- c > 0 && await Xr(c);
5331
+ c > 0 && await qr(c);
5277
5332
  }
5278
5333
  return o;
5279
5334
  }
5280
- async function Pe(s, e, t) {
5281
- const { body: r, statusCode: o } = await At(s, {
5335
+ async function ke(s, e, t) {
5336
+ const { body: r, statusCode: o } = await Tt(s, {
5282
5337
  dispatcher: t,
5283
5338
  headersTimeout: e.httpTimeoutMs,
5284
5339
  bodyTimeout: e.httpTimeoutMs
@@ -5288,7 +5343,7 @@ async function Pe(s, e, t) {
5288
5343
  beginningOfBody: n.slice(0, e.bodyLimit) + "..."
5289
5344
  };
5290
5345
  }
5291
- function Pl(s, e, t, r) {
5346
+ function Fl(s, e, t, r) {
5292
5347
  const o = s.plPings.filter((a) => a.response.ok), n = s.plPings.filter((a) => !a.response.ok), i = [
5293
5348
  ...new Set(o.map((a) => JSON.stringify(a.response.value)))
5294
5349
  ];
@@ -5336,7 +5391,7 @@ ${r.join(`
5336
5391
  `;
5337
5392
  }
5338
5393
  function ye(s) {
5339
- const e = s.filter((o) => o.response.ok), { mean: t, median: r } = kl(s);
5394
+ const e = s.filter((o) => o.response.ok), { mean: t, median: r } = Il(s);
5340
5395
  return `
5341
5396
  total: ${s.length};
5342
5397
  successes: ${e.length};
@@ -5345,7 +5400,7 @@ mean in ms: ${t};
5345
5400
  median in ms: ${r};
5346
5401
  `;
5347
5402
  }
5348
- function kl(s) {
5403
+ function Il(s) {
5349
5404
  const e = s.map((o) => o.elapsedMs), t = e.reduce((o, n) => o + n) / e.length;
5350
5405
  let r;
5351
5406
  if (e.length > 0) {
@@ -5354,40 +5409,40 @@ function kl(s) {
5354
5409
  }
5355
5410
  return { mean: t, median: r };
5356
5411
  }
5357
- function It() {
5412
+ function At() {
5358
5413
  return Date.now();
5359
5414
  }
5360
- function Ur(s) {
5361
- return It() - s;
5415
+ function Jr(s) {
5416
+ return At() - s;
5362
5417
  }
5363
5418
  export {
5364
- Zl as BlockPackRegistry,
5365
- eu as CentralBlockRegistry,
5366
- ys as DefaultDriverKitOpsPaths,
5367
- vs as DefaultDriverKitOpsSettings,
5368
- wi as DefaultMiddleLayerOpsPaths,
5369
- yi as DefaultMiddleLayerOpsSettings,
5370
- os as FrontendFromFolderResourceType,
5371
- ss as FrontendFromUrlResourceType,
5372
- ks as MiddleLayer,
5373
- Ut as Project,
5374
- Yo as TengoTemplateGet,
5375
- Qo as TengoTemplateGetRegistry,
5376
- en as TengoTemplateGetTemplate,
5377
- Zo as TengoTemplateGetTemplateURI,
5378
- su as TengoTemplatePack,
5379
- ou as TengoTemplatePackConvert,
5380
- iu as TengoTemplatePackConvertTemplate,
5381
- nu as TengoTemplatePackConvertTemplatePack,
5382
- ru as V1CentralDevSnapshotRegistry,
5383
- tu as V1CentralRegistry,
5384
- ko as V2RegistryProvider,
5385
- au as checkNetwork,
5386
- ts as createRenderTemplate,
5387
- Yr as getDevV1PacketMtime,
5388
- Nt as getDevV2PacketMtime,
5389
- Rl as initDriverKit,
5390
- xt as loadTemplate,
5391
- tn as prepareTemplateSpec
5419
+ ou as BlockPackRegistry,
5420
+ nu as CentralBlockRegistry,
5421
+ ws as DefaultDriverKitOpsPaths,
5422
+ ys as DefaultDriverKitOpsSettings,
5423
+ Ei as DefaultMiddleLayerOpsPaths,
5424
+ Ri as DefaultMiddleLayerOpsSettings,
5425
+ ns as FrontendFromFolderResourceType,
5426
+ os as FrontendFromUrlResourceType,
5427
+ $s as MiddleLayer,
5428
+ Jt as Project,
5429
+ Zo as TengoTemplateGet,
5430
+ en as TengoTemplateGetRegistry,
5431
+ rn as TengoTemplateGetTemplate,
5432
+ tn as TengoTemplateGetTemplateURI,
5433
+ cu as TengoTemplatePack,
5434
+ lu as TengoTemplatePackConvert,
5435
+ du as TengoTemplatePackConvertTemplate,
5436
+ uu as TengoTemplatePackConvertTemplatePack,
5437
+ au as V1CentralDevSnapshotRegistry,
5438
+ iu as V1CentralRegistry,
5439
+ Oo as V2RegistryProvider,
5440
+ pu as checkNetwork,
5441
+ rs as createRenderTemplate,
5442
+ Qr as getDevV1PacketMtime,
5443
+ Bt as getDevV2PacketMtime,
5444
+ $l as initDriverKit,
5445
+ jt as loadTemplate,
5446
+ sn as prepareTemplateSpec
5392
5447
  };
5393
5448
  //# sourceMappingURL=index.mjs.map