interaqt 0.8.2 → 0.8.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,26 +1,25 @@
1
- import { parse as Se } from "acorn";
2
- import { AsyncLocalStorage as le } from "async_hooks";
3
- function ue(u) {
1
+ import { AsyncLocalStorage as ce } from "async_hooks";
2
+ function le(u) {
4
3
  return u !== null && typeof u == "object";
5
4
  }
6
- function de(u) {
7
- if (!ue(u)) return !1;
5
+ function ue(u) {
6
+ if (!le(u)) return !1;
8
7
  const t = Object.getPrototypeOf(u);
9
8
  return t === null ? !0 : t === Object.prototype || t === null;
10
9
  }
11
- function Ee(u, t) {
10
+ function Zi(u, t) {
12
11
  const e = {};
13
12
  for (const i of u)
14
13
  i && i[t] !== void 0 && (e[String(i[t])] = i);
15
14
  return e;
16
15
  }
17
16
  function w(u) {
18
- return typeof u == "function" ? `func::${u.toString()}` : Array.isArray(u) ? u : ue(u) && !de(u) ? `uuid::${u.uuid}` : u;
17
+ return typeof u == "function" ? `func::${u.toString()}` : Array.isArray(u) ? u : le(u) && !ue(u) ? `uuid::${u.uuid}` : u;
19
18
  }
20
19
  function mt(u, t) {
21
20
  if (u == null || typeof u != "object") return u;
22
21
  if (Array.isArray(u)) return u.map((i) => mt(i, t));
23
- if (de(u))
22
+ if (ue(u))
24
23
  return Object.fromEntries(Object.entries(u).map(([i, r]) => [i, mt(r, t)]));
25
24
  if (u instanceof Set)
26
25
  return new Set(Array.from(u.values()).map((i) => mt(i, t)));
@@ -29,30 +28,30 @@ function mt(u, t) {
29
28
  const e = u;
30
29
  return t && e._type && e.constructor?.clone ? e.constructor.clone(u, t) : u;
31
30
  }
32
- function ar(...u) {
31
+ function tr(...u) {
33
32
  for (const t of u)
34
33
  t.instances.length = 0;
35
34
  }
36
- function or() {
35
+ function er() {
37
36
  }
38
- const Dt = /* @__PURE__ */ new Map();
39
- function Ie(u, t) {
40
- t && t.isKlass && t.displayName && Dt.set(u, t);
37
+ const Ot = /* @__PURE__ */ new Map();
38
+ function Ae(u, t) {
39
+ t && t.isKlass && t.displayName && Ot.set(u, t);
41
40
  }
42
- function nr() {
41
+ function ir() {
43
42
  const u = [];
44
- return Array.from(Dt.entries()).forEach(([, t]) => {
43
+ return Array.from(Ot.entries()).forEach(([, t]) => {
45
44
  t.instances && Array.isArray(t.instances) && t.stringify && u.push(...t.instances.map((e) => t.stringify(e)));
46
45
  }), `[${u.join(",")}]`;
47
46
  }
48
- function cr(u) {
47
+ function rr(u) {
49
48
  const t = JSON.parse(u);
50
- return Ce(t);
49
+ return Se(t);
51
50
  }
52
- function Ce(u) {
51
+ function Se(u) {
53
52
  const t = /* @__PURE__ */ new Map();
54
53
  return u.forEach(({ type: e, options: i = {}, uuid: r, public: s }) => {
55
- const a = Dt.get(e);
54
+ const a = Ot.get(e);
56
55
  if (!a) {
57
56
  console.warn(`Class ${e} not found in KlassByName`);
58
57
  return;
@@ -61,10 +60,10 @@ function Ce(u) {
61
60
  t.set(r, o);
62
61
  }), t;
63
62
  }
64
- function lr(u) {
63
+ function sr(u) {
65
64
  return console.warn("createClass is deprecated in refactored code"), null;
66
65
  }
67
- class ur {
66
+ class ar {
68
67
  static {
69
68
  this.isKlass = !0;
70
69
  }
@@ -86,11 +85,11 @@ class ur {
86
85
  return t !== null && typeof t == "object" && typeof t.uuid == "string";
87
86
  }
88
87
  }
89
- let xe = 0;
88
+ let Ee = 0;
90
89
  function k(u) {
91
- return u?.uuid || `id_${++xe}`;
90
+ return u?.uuid || `id_${++Ee}`;
92
91
  }
93
- const Me = /^[a-zA-Z0-9_]+$/;
92
+ const Ie = /^[a-zA-Z0-9_]+$/;
94
93
  class I {
95
94
  // for Merged Entity
96
95
  constructor(t, e) {
@@ -111,7 +110,7 @@ class I {
111
110
  type: "string",
112
111
  required: !0,
113
112
  constraints: {
114
- nameFormat: ({ name: t }) => Me.test(t)
113
+ nameFormat: ({ name: t }) => Ie.test(t)
115
114
  }
116
115
  },
117
116
  properties: {
@@ -192,9 +191,9 @@ class I {
192
191
  return this.create(e.public, e.options);
193
192
  }
194
193
  }
195
- var Vt = /* @__PURE__ */ ((u) => (u.String = "string", u.Number = "number", u.Boolean = "boolean", u.Timestamp = "timestamp", u))(Vt || {});
196
- const Pe = /^[a-zA-Z0-9_]+$/;
197
- class Qt {
194
+ var Dt = /* @__PURE__ */ ((u) => (u.String = "string", u.Number = "number", u.Boolean = "boolean", u.Timestamp = "timestamp", u))(Dt || {});
195
+ const Ce = /^[a-zA-Z0-9_]+$/;
196
+ class Vt {
198
197
  constructor(t, e) {
199
198
  this._type = "Dictionary", this._options = e, this.uuid = k(e), this.name = t.name, this.type = t.type, this.collection = t.collection ?? !1, this.args = t.args, this.defaultValue = t.defaultValue, this.computation = t.computation;
200
199
  }
@@ -214,7 +213,7 @@ class Qt {
214
213
  required: !0,
215
214
  collection: !1,
216
215
  constraints: {
217
- format: ({ name: t }) => Pe.test(t),
216
+ format: ({ name: t }) => Ce.test(t),
218
217
  length: ({ name: t }) => t.length > 1 && t.length < 5
219
218
  }
220
219
  },
@@ -222,7 +221,7 @@ class Qt {
222
221
  type: "string",
223
222
  required: !0,
224
223
  collection: !1,
225
- options: Array.from(Object.values(Vt))
224
+ options: Array.from(Object.values(Dt))
226
225
  },
227
226
  collection: {
228
227
  type: "boolean",
@@ -248,7 +247,7 @@ class Qt {
248
247
  };
249
248
  }
250
249
  static create(t, e) {
251
- const i = new Qt(t, e);
250
+ const i = new Vt(t, e);
252
251
  if (this.instances.find((s) => s.uuid === i.uuid))
253
252
  throw new Error(`duplicate uuid in options ${i.uuid}, Dictionary`);
254
253
  return this.instances.push(i), i;
@@ -287,7 +286,7 @@ class Qt {
287
286
  return this.create(e.public, e.options);
288
287
  }
289
288
  }
290
- const $e = /^[a-zA-Z0-9_]+$/;
289
+ const xe = /^[a-zA-Z0-9_]+$/;
291
290
  class v {
292
291
  constructor(t, e) {
293
292
  this._type = "Property", this._options = e, this.uuid = k(e), this.name = t.name, this.type = t.type, this.collection = t.collection, this.defaultValue = t.defaultValue, this.computed = t.computed, this.computation = t.computation;
@@ -307,14 +306,14 @@ class v {
307
306
  type: "string",
308
307
  required: !0,
309
308
  constraints: {
310
- format: ({ name: t }) => $e.test(t),
309
+ format: ({ name: t }) => xe.test(t),
311
310
  length: ({ name: t }) => t.length > 1 && t.length < 5
312
311
  }
313
312
  },
314
313
  type: {
315
314
  type: "string",
316
315
  required: !0,
317
- options: () => Object.values(Vt)
316
+ options: () => Object.values(Dt)
318
317
  },
319
318
  collection: {
320
319
  type: "boolean",
@@ -553,7 +552,7 @@ class P {
553
552
  return this.create(e.public, e.options);
554
553
  }
555
554
  }
556
- class Lt {
555
+ class Qt {
557
556
  constructor(t, e) {
558
557
  this._type = "Interaction", this._options = e, this.uuid = k(e), this.name = t.name, this.conditions = t.conditions, this.userAttributives = t.userAttributives, this.userRef = t.userRef, this.action = t.action, this.payload = t.payload, this.sideEffects = t.sideEffects || [], this.data = t.data, this.dataPolicy = t.dataPolicy;
559
558
  }
@@ -614,7 +613,7 @@ class Lt {
614
613
  };
615
614
  }
616
615
  static create(t, e) {
617
- const i = new Lt(t, e);
616
+ const i = new Qt(t, e);
618
617
  if (this.instances.find((s) => s.uuid === i.uuid))
619
618
  throw new Error(`duplicate uuid in options ${i.uuid}, Interaction`);
620
619
  return this.instances.push(i), i;
@@ -651,7 +650,7 @@ class Lt {
651
650
  return this.create(e.public, e.options);
652
651
  }
653
652
  }
654
- class qt {
653
+ class Lt {
655
654
  constructor(t, e) {
656
655
  this._type = "Activity", this._options = e, this.uuid = k(e), this.name = t.name, this.interactions = t.interactions || [], this.gateways = t.gateways || [], this.transfers = t.transfers || [], this.groups = t.groups || [], this.events = t.events || [];
657
656
  }
@@ -699,7 +698,7 @@ class qt {
699
698
  };
700
699
  }
701
700
  static create(t, e) {
702
- const i = new qt(t, e);
701
+ const i = new Lt(t, e);
703
702
  if (this.instances.find((s) => s.uuid === i.uuid))
704
703
  throw new Error(`duplicate uuid in options ${i.uuid}, Activity`);
705
704
  return this.instances.push(i), i;
@@ -800,7 +799,7 @@ class Z {
800
799
  return this.create(e.public, e.options);
801
800
  }
802
801
  }
803
- class he {
802
+ class de {
804
803
  constructor(t, e) {
805
804
  this._type = "Transfer", this._options = e, this.uuid = k(e), this.name = t.name, this.source = t.source, this.target = t.target;
806
805
  }
@@ -833,7 +832,7 @@ class he {
833
832
  };
834
833
  }
835
834
  static create(t, e) {
836
- const i = new he(t, e);
835
+ const i = new de(t, e);
837
836
  if (this.instances.find((s) => s.uuid === i.uuid))
838
837
  throw new Error(`duplicate uuid in options ${i.uuid}, Transfer`);
839
838
  return this.instances.push(i), i;
@@ -869,16 +868,16 @@ class he {
869
868
  return this.create(e.public, e.options);
870
869
  }
871
870
  }
872
- function pe(u, t, e) {
871
+ function he(u, t, e) {
873
872
  u.interactions.forEach((i) => t(i, e)), u.groups.forEach((i) => {
874
- i.activities?.forEach((r) => pe(r, t, i));
873
+ i.activities?.forEach((r) => he(r, t, i));
875
874
  });
876
875
  }
877
- function dr(u) {
876
+ function or(u) {
878
877
  const t = [];
879
- return pe(u, (e) => t.push(e)), t;
878
+ return he(u, (e) => t.push(e)), t;
880
879
  }
881
- function hr(u) {
880
+ function nr(u) {
882
881
  return null;
883
882
  }
884
883
  class it {
@@ -915,18 +914,6 @@ class it {
915
914
  throw new Error(`duplicate uuid in options ${i.uuid}, BoolAtomData`);
916
915
  return this.instances.push(i), i;
917
916
  }
918
- static stringify(t) {
919
- const e = {
920
- type: t.type,
921
- data: w(t.data)
922
- }, i = {
923
- type: "BoolAtomData",
924
- options: t._options,
925
- uuid: t.uuid,
926
- public: e
927
- };
928
- return JSON.stringify(i);
929
- }
930
917
  static clone(t, e) {
931
918
  const i = {
932
919
  data: t.data
@@ -939,10 +926,6 @@ class it {
939
926
  static check(t) {
940
927
  return t !== null && typeof t == "object" && typeof t.uuid == "string";
941
928
  }
942
- static parse(t) {
943
- const e = JSON.parse(t);
944
- return this.create(e.public, e.options);
945
- }
946
929
  }
947
930
  class rt {
948
931
  constructor(t, e) {
@@ -1036,7 +1019,7 @@ class R {
1036
1019
  if (e.length === 0)
1037
1020
  return;
1038
1021
  const [i, ...r] = e;
1039
- return r.reduce((s, a) => s.and(a), i instanceof R ? i : R.atom(i));
1022
+ return r.reduce((s, a) => s.and(a), i instanceof R ? i : new R(R.standardizeData(i)));
1040
1023
  }
1041
1024
  static or(...t) {
1042
1025
  const e = t.filter((s) => !!s);
@@ -1076,12 +1059,15 @@ class R {
1076
1059
  isExpression() {
1077
1060
  return this.raw.type === "expression";
1078
1061
  }
1062
+ static standardizeData(t) {
1063
+ return t instanceof R ? t.raw : t && typeof t == "object" && t.type === "atom" || t.type === "expression" ? t : { type: "atom", data: t };
1064
+ }
1079
1065
  and(t) {
1080
1066
  return new R({
1081
1067
  type: "expression",
1082
1068
  operator: "and",
1083
1069
  left: this.raw,
1084
- right: t instanceof R ? t.raw : t && typeof t == "object" && t.type === "atom" || t.type === "expression" ? t : { type: "atom", data: t }
1070
+ right: R.standardizeData(t)
1085
1071
  });
1086
1072
  }
1087
1073
  isAnd() {
@@ -1171,41 +1157,6 @@ class R {
1171
1157
  throw new Error(`invalid bool expression type: ${JSON.stringify(this.raw)}`);
1172
1158
  }
1173
1159
  }
1174
- const Fe = {
1175
- "&&": "and",
1176
- "||": "or",
1177
- "!": "not"
1178
- };
1179
- function Oe(u) {
1180
- return { key: u };
1181
- }
1182
- function yt(u, t, e) {
1183
- if (u.type === "LogicalExpression")
1184
- return {
1185
- type: "expression",
1186
- operator: Fe[u.operator],
1187
- left: yt(u.left, t, e),
1188
- right: yt(u.right, t, e)
1189
- };
1190
- if (u.type === "Identifier")
1191
- return {
1192
- type: "atom",
1193
- data: e(u.name)
1194
- };
1195
- if (u.type === "UnaryExpression")
1196
- return {
1197
- type: "expression",
1198
- operator: "not",
1199
- left: yt(u.argument, t, e)
1200
- };
1201
- throw new Error("unknown ast node type");
1202
- }
1203
- function pr(u, t = [], e = Oe) {
1204
- const i = Ee(t, "name"), r = Se(u, { ecmaVersion: 2020 });
1205
- return new R(
1206
- yt(r.body[0].expression, i, e)
1207
- );
1208
- }
1209
1160
  class U {
1210
1161
  constructor(t, e) {
1211
1162
  this._type = "Attributive", this._options = e, this.uuid = k(e), this.stringContent = t.stringContent, this.content = t.content, this.name = t.name, this.isRef = t.isRef;
@@ -1274,7 +1225,7 @@ class U {
1274
1225
  return i.content && typeof i.content == "string" && i.content.startsWith("func::") && (i.content = new Function("return " + i.content.substring(6))()), this.create(i, e.options);
1275
1226
  }
1276
1227
  }
1277
- class vt {
1228
+ class Nt {
1278
1229
  constructor(t, e) {
1279
1230
  this._type = "Attributives", this._options = e, this.uuid = k(e), this.content = t.content;
1280
1231
  }
@@ -1297,7 +1248,7 @@ class vt {
1297
1248
  };
1298
1249
  }
1299
1250
  static create(t, e) {
1300
- const i = new vt(t, e);
1251
+ const i = new Nt(t, e);
1301
1252
  if (this.instances.find((s) => s.uuid === i.uuid))
1302
1253
  throw new Error(`duplicate uuid in options ${i.uuid}, Attributives`);
1303
1254
  return this.instances.push(i), i;
@@ -1328,7 +1279,7 @@ class vt {
1328
1279
  return this.create(e.public, e.options);
1329
1280
  }
1330
1281
  }
1331
- function Mt(u) {
1282
+ function xt(u) {
1332
1283
  if (!u) return;
1333
1284
  if (u.raw.type === "atom")
1334
1285
  return it.create({
@@ -1339,16 +1290,16 @@ function Mt(u) {
1339
1290
  return rt.create({
1340
1291
  type: "expression",
1341
1292
  operator: t.operator,
1342
- left: Mt(u.left),
1343
- right: Mt(u.right)
1293
+ left: xt(u.left),
1294
+ right: xt(u.right)
1344
1295
  });
1345
1296
  }
1346
- function fr(u) {
1347
- return vt.create({
1348
- content: Mt(u)
1297
+ function cr(u) {
1298
+ return Nt.create({
1299
+ content: xt(u)
1349
1300
  });
1350
1301
  }
1351
- class Bt {
1302
+ class qt {
1352
1303
  constructor(t, e) {
1353
1304
  this._type = "Condition", this._options = e, this.uuid = k(e), this.content = t.content, this.name = t.name;
1354
1305
  }
@@ -1374,7 +1325,7 @@ class Bt {
1374
1325
  };
1375
1326
  }
1376
1327
  static create(t, e) {
1377
- const i = new Bt(t, e);
1328
+ const i = new qt(t, e);
1378
1329
  if (this.instances.find((s) => s.uuid === i.uuid))
1379
1330
  throw new Error(`duplicate uuid in options ${i.uuid}, Condition`);
1380
1331
  return this.instances.push(i), i;
@@ -1408,7 +1359,7 @@ class Bt {
1408
1359
  return i.content && typeof i.content == "string" && i.content.startsWith("func::") && (i.content = new Function("return " + i.content.substring(6))()), this.create(i, e.options);
1409
1360
  }
1410
1361
  }
1411
- class _t {
1362
+ class Bt {
1412
1363
  constructor(t, e) {
1413
1364
  this._type = "DataAttributive", this._options = e, this.uuid = k(e), this.content = t.content, this.name = t.name;
1414
1365
  }
@@ -1434,7 +1385,7 @@ class _t {
1434
1385
  };
1435
1386
  }
1436
1387
  static create(t, e) {
1437
- const i = new _t(t, e);
1388
+ const i = new Bt(t, e);
1438
1389
  if (this.instances.find((s) => s.uuid === i.uuid))
1439
1390
  throw new Error(`duplicate uuid in options ${i.uuid}, DataAttributive`);
1440
1391
  return this.instances.push(i), i;
@@ -1468,7 +1419,7 @@ class _t {
1468
1419
  return i.content && typeof i.content == "string" && i.content.startsWith("func::") && (i.content = new Function("return " + i.content.substring(6))()), this.create(i, e.options);
1469
1420
  }
1470
1421
  }
1471
- class fe {
1422
+ class pe {
1472
1423
  constructor(t, e) {
1473
1424
  this._type = "DataPolicy", this._options = e, this.uuid = k(e), this.match = t.match, this.modifier = t.modifier, this.attributeQuery = t.attributeQuery;
1474
1425
  }
@@ -1501,7 +1452,7 @@ class fe {
1501
1452
  };
1502
1453
  }
1503
1454
  static create(t, e) {
1504
- const i = new fe(t, e);
1455
+ const i = new pe(t, e);
1505
1456
  if (this.instances.find((s) => s.uuid === i.uuid))
1506
1457
  throw new Error(`duplicate uuid in options ${i.uuid}, DataPolicy`);
1507
1458
  return this.instances.push(i), i;
@@ -1532,7 +1483,7 @@ class fe {
1532
1483
  return this.create(e.public, e.options);
1533
1484
  }
1534
1485
  }
1535
- class kt {
1486
+ class vt {
1536
1487
  constructor(t, e) {
1537
1488
  this._type = "Action", this._options = e, this.uuid = k(e), this.name = t.name;
1538
1489
  }
@@ -1554,7 +1505,7 @@ class kt {
1554
1505
  };
1555
1506
  }
1556
1507
  static create(t, e) {
1557
- const i = new kt(t, e);
1508
+ const i = new vt(t, e);
1558
1509
  if (this.instances.find((s) => s.uuid === i.uuid))
1559
1510
  throw new Error(`duplicate uuid in options ${i.uuid}, Action`);
1560
1511
  return this.instances.push(i), i;
@@ -1586,7 +1537,7 @@ class kt {
1586
1537
  return this.create(e.public, e.options);
1587
1538
  }
1588
1539
  }
1589
- const De = kt.create({ name: "get" });
1540
+ const Me = vt.create({ name: "get" });
1590
1541
  class tt {
1591
1542
  constructor(t, e) {
1592
1543
  this._type = "Gateway", this._options = e, this.uuid = k(e), this.name = t.name;
@@ -1641,7 +1592,7 @@ class tt {
1641
1592
  return this.create(e.public, e.options);
1642
1593
  }
1643
1594
  }
1644
- class Wt {
1595
+ class _t {
1645
1596
  constructor(t, e) {
1646
1597
  this._type = "Event", this._options = e, this.uuid = k(e), this.name = t.name;
1647
1598
  }
@@ -1663,7 +1614,7 @@ class Wt {
1663
1614
  };
1664
1615
  }
1665
1616
  static create(t, e) {
1666
- const i = new Wt(t, e);
1617
+ const i = new _t(t, e);
1667
1618
  if (this.instances.find((s) => s.uuid === i.uuid))
1668
1619
  throw new Error(`duplicate uuid in options ${i.uuid}, Event`);
1669
1620
  return this.instances.push(i), i;
@@ -1758,7 +1709,7 @@ class K {
1758
1709
  return this.create(e.public, e.options);
1759
1710
  }
1760
1711
  }
1761
- class Jt {
1712
+ class Wt {
1762
1713
  constructor(t, e) {
1763
1714
  this._type = "StateTransfer", this._options = e, this.uuid = k(e), this.trigger = t.trigger, this.current = t.current, this.next = t.next, this.computeTarget = t.computeTarget;
1764
1715
  }
@@ -1796,7 +1747,7 @@ class Jt {
1796
1747
  };
1797
1748
  }
1798
1749
  static create(t, e) {
1799
- const i = new Jt(t, e);
1750
+ const i = new Wt(t, e);
1800
1751
  if (this.instances.find((s) => s.uuid === i.uuid))
1801
1752
  throw new Error(`duplicate uuid in options ${i.uuid}, StateTransfer`);
1802
1753
  return this.instances.push(i), i;
@@ -2389,7 +2340,7 @@ class ut {
2389
2340
  return i.callback && typeof i.callback == "string" && i.callback.startsWith("func::") && (i.callback = new Function("return " + i.callback.substring(6))()), this.create(i, e.options);
2390
2341
  }
2391
2342
  }
2392
- class Tt {
2343
+ class kt {
2393
2344
  constructor(t, e) {
2394
2345
  this._type = "Transform", this._options = e, this.uuid = k(e), this.record = t.record, this.eventDeps = t.eventDeps, this.attributeQuery = t.attributeQuery, this.callback = t.callback;
2395
2346
  }
@@ -2422,7 +2373,7 @@ class Tt {
2422
2373
  };
2423
2374
  }
2424
2375
  static create(t, e) {
2425
- const i = new Tt(t, e);
2376
+ const i = new kt(t, e);
2426
2377
  if (this.instances.find((s) => s.uuid === i.uuid))
2427
2378
  throw new Error(`duplicate uuid in options ${i.uuid}, Transform`);
2428
2379
  return this.instances.push(i), i;
@@ -2532,7 +2483,7 @@ class dt {
2532
2483
  return typeof i.callback == "string" && i.callback.startsWith("func::") && (i.callback = new Function("return " + i.callback.substring(6))()), typeof i.nextRecomputeTime == "string" && i.nextRecomputeTime.startsWith("func::") && (i.nextRecomputeTime = new Function("return " + i.nextRecomputeTime.substring(6))()), this.create(i, e.options);
2533
2484
  }
2534
2485
  }
2535
- class Ht {
2486
+ class Jt {
2536
2487
  constructor(t, e) {
2537
2488
  this._type = "PayloadItem", this._options = e, this.uuid = k(e), this.name = t.name, this.base = t.base, this.type = t.type, this.isRef = t.isRef ?? !1, this.required = t.required ?? !1, this.isCollection = t.isCollection ?? !1, this.itemRef = t.itemRef;
2538
2489
  }
@@ -2583,7 +2534,7 @@ class Ht {
2583
2534
  };
2584
2535
  }
2585
2536
  static create(t, e) {
2586
- const i = new Ht(t, e);
2537
+ const i = new Jt(t, e);
2587
2538
  if (this.instances.find((s) => s.uuid === i.uuid))
2588
2539
  throw new Error(`duplicate uuid in options ${i.uuid}, PayloadItem`);
2589
2540
  return this.instances.push(i), i;
@@ -2622,7 +2573,7 @@ class Ht {
2622
2573
  return this.create(e.public, e.options);
2623
2574
  }
2624
2575
  }
2625
- class jt {
2576
+ class Ht {
2626
2577
  constructor(t, e) {
2627
2578
  this._type = "Payload", this._options = e, this.uuid = k(e), this.items = t.items || [];
2628
2579
  }
@@ -2646,7 +2597,7 @@ class jt {
2646
2597
  };
2647
2598
  }
2648
2599
  static create(t, e) {
2649
- const i = new jt(t, e);
2600
+ const i = new Ht(t, e);
2650
2601
  if (this.instances.find((s) => s.uuid === i.uuid))
2651
2602
  throw new Error(`duplicate uuid in options ${i.uuid}, Payload`);
2652
2603
  return this.instances.push(i), i;
@@ -2678,7 +2629,7 @@ class jt {
2678
2629
  return this.create(e.public, e.options);
2679
2630
  }
2680
2631
  }
2681
- class Ut {
2632
+ class jt {
2682
2633
  constructor(t, e) {
2683
2634
  this._type = "SideEffect", this._options = e, this.uuid = k(e), this.name = t.name, this.handle = t.handle;
2684
2635
  }
@@ -2706,7 +2657,7 @@ class Ut {
2706
2657
  };
2707
2658
  }
2708
2659
  static create(t, e) {
2709
- const i = new Ut(t, e);
2660
+ const i = new jt(t, e);
2710
2661
  if (this.instances.find((s) => s.uuid === i.uuid))
2711
2662
  throw new Error(`duplicate uuid in options ${i.uuid}, SideEffect`);
2712
2663
  return this.instances.push(i), i;
@@ -2740,7 +2691,7 @@ class Ut {
2740
2691
  return i.handle && typeof i.handle == "string" && i.handle.startsWith("func::") && (i.handle = new Function("return " + i.handle.substring(6))()), this.create(i, e.options);
2741
2692
  }
2742
2693
  }
2743
- function Pt(u) {
2694
+ function Mt(u) {
2744
2695
  if (!u) return;
2745
2696
  if (u.raw.type === "atom")
2746
2697
  return it.create({
@@ -2751,13 +2702,13 @@ function Pt(u) {
2751
2702
  return rt.create({
2752
2703
  type: "expression",
2753
2704
  operator: t.operator,
2754
- left: Pt(u.left),
2755
- right: Pt(u.right)
2705
+ left: Mt(u.left),
2706
+ right: Mt(u.right)
2756
2707
  });
2757
2708
  }
2758
- class At {
2709
+ class Tt {
2759
2710
  constructor(t, e) {
2760
- this._type = "Conditions", this._options = e, this.uuid = k(e), t.content && t.content instanceof R ? this.content = Pt(t.content) : this.content = t.content;
2711
+ this._type = "Conditions", this._options = e, this.uuid = k(e), t.content && t.content instanceof R ? this.content = Mt(t.content) : this.content = t.content;
2761
2712
  }
2762
2713
  static {
2763
2714
  this.isKlass = !0;
@@ -2778,7 +2729,7 @@ class At {
2778
2729
  };
2779
2730
  }
2780
2731
  static create(t, e) {
2781
- const i = new At(t, e);
2732
+ const i = new Tt(t, e);
2782
2733
  if (this.instances.find((s) => s.uuid === i.uuid))
2783
2734
  throw new Error(`duplicate uuid in options ${i.uuid}, Conditions`);
2784
2735
  return this.instances.push(i), i;
@@ -2809,7 +2760,7 @@ class At {
2809
2760
  return this.create(e.public, e.options);
2810
2761
  }
2811
2762
  }
2812
- class Kt {
2763
+ class Ut {
2813
2764
  constructor(t, e) {
2814
2765
  this._type = "DataAttributives", this._options = e, this.uuid = k(e), this.content = t.content;
2815
2766
  }
@@ -2832,7 +2783,7 @@ class Kt {
2832
2783
  };
2833
2784
  }
2834
2785
  static create(t, e) {
2835
- const i = new Kt(t, e);
2786
+ const i = new Ut(t, e);
2836
2787
  if (this.instances.find((s) => s.uuid === i.uuid))
2837
2788
  throw new Error(`duplicate uuid in options ${i.uuid}, DataAttributives`);
2838
2789
  return this.instances.push(i), i;
@@ -2863,20 +2814,20 @@ class Kt {
2863
2814
  return this.create(e.public, e.options);
2864
2815
  }
2865
2816
  }
2866
- const Ve = [
2817
+ const Pe = [
2867
2818
  I,
2868
2819
  P,
2869
2820
  v,
2821
+ Qt,
2870
2822
  Lt,
2871
- qt,
2872
2823
  U,
2824
+ qt,
2873
2825
  Bt,
2874
- _t,
2875
- kt,
2826
+ vt,
2876
2827
  tt,
2877
- Wt,
2828
+ _t,
2878
2829
  K,
2879
- Jt,
2830
+ Wt,
2880
2831
  st,
2881
2832
  at,
2882
2833
  ot,
@@ -2884,21 +2835,21 @@ const Ve = [
2884
2835
  ct,
2885
2836
  lt,
2886
2837
  ut,
2887
- Tt,
2838
+ kt,
2888
2839
  dt,
2840
+ Jt,
2889
2841
  Ht,
2890
2842
  jt,
2891
- Ut,
2892
- Qt,
2843
+ Vt,
2893
2844
  it,
2894
2845
  rt,
2895
- At,
2896
- Kt
2846
+ Tt,
2847
+ Ut
2897
2848
  ];
2898
- Ve.forEach((u) => {
2899
- u && u.displayName && Ie(u.displayName, u);
2849
+ Pe.forEach((u) => {
2850
+ u && u.displayName && Ae(u.displayName, u);
2900
2851
  });
2901
- class Gt {
2852
+ class Kt {
2902
2853
  constructor(t, e) {
2903
2854
  this._type = "Custom", this._options = e, this.uuid = k(e), this.name = t.name, this.dataDeps = t.dataDeps, this.compute = t.compute, this.incrementalCompute = t.incrementalCompute, this.incrementalPatchCompute = t.incrementalPatchCompute, this.createState = t.createState, this.getInitialValue = t.getInitialValue, this.asyncReturn = t.asyncReturn, this.useLastValue = t.useLastValue;
2904
2855
  }
@@ -2961,7 +2912,7 @@ class Gt {
2961
2912
  };
2962
2913
  }
2963
2914
  static create(t, e) {
2964
- const i = new Gt(t, e);
2915
+ const i = new Kt(t, e);
2965
2916
  if (this.instances.find((s) => s.uuid === i.uuid))
2966
2917
  throw new Error(`duplicate uuid in options ${i.uuid}, Custom`);
2967
2918
  return this.instances.push(i), i;
@@ -3005,7 +2956,7 @@ class Gt {
3005
2956
  }), this.create(i, e.options);
3006
2957
  }
3007
2958
  }
3008
- class me {
2959
+ class fe {
3009
2960
  constructor(t = [], e = []) {
3010
2961
  this.clonedEntities = /* @__PURE__ */ new Map(), this.clonedRelations = /* @__PURE__ */ new Map(), this.reverseEntityMap = /* @__PURE__ */ new Map(), this.reverseRelationMap = /* @__PURE__ */ new Map(), this.originalEntities = [...t], this.originalRelations = [...e], (t.length > 0 || e.length > 0) && this.initializeClones();
3011
2962
  }
@@ -3216,7 +3167,7 @@ class me {
3216
3167
  return null;
3217
3168
  }
3218
3169
  }
3219
- function mr({ name: u, isRef: t = !1 }, e) {
3170
+ function lr({ name: u, isRef: t = !1 }, e) {
3220
3171
  return U.create({
3221
3172
  name: u,
3222
3173
  content: u ? new Function("user", `return user.roles.includes('${u}')`) : function() {
@@ -3229,7 +3180,7 @@ function g(u, t) {
3229
3180
  if (!u)
3230
3181
  throw new Error(t);
3231
3182
  }
3232
- function Et(u, t, e) {
3183
+ function St(u, t, e) {
3233
3184
  const i = [...t];
3234
3185
  let r = u, s;
3235
3186
  const a = i.pop();
@@ -3589,7 +3540,7 @@ class m {
3589
3540
  );
3590
3541
  }
3591
3542
  }
3592
- class Qe {
3543
+ class $e {
3593
3544
  constructor(t, e, i, r) {
3594
3545
  this.recordName = t, this.map = e, this.data = i, this.fromRelation = r;
3595
3546
  }
@@ -3625,7 +3576,7 @@ class x {
3625
3576
  e,
3626
3577
  N,
3627
3578
  new C(h, e, i.attributeQuery || [], s, a),
3628
- new Qe(h, e, i.modifier),
3579
+ new $e(h, e, i.modifier),
3629
3580
  r,
3630
3581
  s,
3631
3582
  a,
@@ -3719,7 +3670,7 @@ class L {
3719
3670
  }), this.parentLinkQueryTree && (t[f] = this.parentLinkQueryTree.getData()), t;
3720
3671
  }
3721
3672
  }
3722
- const f = "&", Le = "*";
3673
+ const f = "&", Fe = "*";
3723
3674
  class C {
3724
3675
  constructor(t, e, i = [], r, s, a) {
3725
3676
  this.recordName = t, this.map = e, this.data = i, this.parentRecord = r, this.attributeName = s, this.shouldQueryParentLinkData = a, this.relatedRecords = [], this.xToManyRecords = [], this.xToOneRecords = [], this.valueAttributes = [], this.id = Math.random();
@@ -3732,7 +3683,7 @@ class C {
3732
3683
  this.parentLinkRecordQuery = x.create(y.linkName, this.map, d, void 0);
3733
3684
  return;
3734
3685
  }
3735
- if (l === Le) {
3686
+ if (l === Fe) {
3736
3687
  o = new Set(this.map.getRecordInfo(this.recordName).valueAttributes.map((y) => y.attributeName));
3737
3688
  return;
3738
3689
  }
@@ -3741,10 +3692,10 @@ class C {
3741
3692
  let y = l, N = d;
3742
3693
  if (p.isLinkFiltered()) {
3743
3694
  y = p.getBaseAttributeInfo().attributeName;
3744
- const A = d.matchExpression, D = p.getLinkInfo().getBaseLinkInfo(), te = new m(D.name, this.map, p.getMatchExpression()).rebase(p.isRecordSource() ? "target" : "source"), Ae = A ? te.and(A.data) : te;
3695
+ const A = d.matchExpression, D = p.getLinkInfo().getBaseLinkInfo(), Zt = new m(D.name, this.map, p.getMatchExpression()).rebase(p.isRecordSource() ? "target" : "source"), Te = A ? Zt.and(A.data) : Zt;
3745
3696
  N = {
3746
3697
  ...d,
3747
- matchExpression: Ae.data
3698
+ matchExpression: Te.data
3748
3699
  };
3749
3700
  }
3750
3701
  const b = x.create(p.recordName, this.map, N, void 0, this.recordName, y, h, !1, l);
@@ -3862,7 +3813,7 @@ class C {
3862
3813
  return this.parentLinkRecordQuery ? new C(this.recordName, this.map, this.data, this.parentRecord, this.attributeName, !0) : this;
3863
3814
  }
3864
3815
  }
3865
- function qe(u) {
3816
+ function Oe(u) {
3866
3817
  const t = [];
3867
3818
  return u.forEach((e) => t.push(...Array.isArray(e) ? e : [e])), t;
3868
3819
  }
@@ -3872,7 +3823,7 @@ class Q {
3872
3823
  const s = this.map.getRecordInfo(e);
3873
3824
  this.recordName = s.isFilteredEntity || s.isFilteredRelation ? s.resolvedBaseRecordName : e;
3874
3825
  const [a, o, n] = this.map.groupAttributes(this.recordName, i ? Object.keys(i) : []);
3875
- this.relatedEntitiesData = qe(o.map(
3826
+ this.relatedEntitiesData = Oe(o.map(
3876
3827
  (l) => Array.isArray(i[l.attributeName]) ? i[l.attributeName].map((d) => new Q(this.map, l.recordName, d, l)) : new Q(this.map, l.recordName, i[l.attributeName], l)
3877
3828
  )), this.valueAttributes = a, this.entityIdAttributes = n;
3878
3829
  const c = this.map.getRecordInfo(this.recordName);
@@ -3949,7 +3900,7 @@ class Q {
3949
3900
  }), i;
3950
3901
  }
3951
3902
  }
3952
- class Be {
3903
+ class De {
3953
3904
  constructor(t, e) {
3954
3905
  this.map = t, this.queryAgent = e, this.dependencies = /* @__PURE__ */ new Map();
3955
3906
  }
@@ -4175,7 +4126,7 @@ class Be {
4175
4126
  }
4176
4127
  }
4177
4128
  }
4178
- class _e {
4129
+ class Ve {
4179
4130
  constructor() {
4180
4131
  this.aliasToPath = /* @__PURE__ */ new Map(), this.pathStrToAlias = /* @__PURE__ */ new Map(), this.aliasPlaceholder = 0;
4181
4132
  }
@@ -4189,24 +4140,24 @@ class _e {
4189
4140
  return this.aliasToPath.get(t);
4190
4141
  }
4191
4142
  }
4192
- const ye = ":root";
4193
- class bt {
4143
+ const me = ":root";
4144
+ class gt {
4194
4145
  constructor(t, e, i = []) {
4195
4146
  this.label = t, this.parent = e, this.stack = i;
4196
4147
  }
4197
4148
  concat(t) {
4198
- return new bt(this.label, this.parent, [...this.stack, t]);
4149
+ return new gt(this.label, this.parent, [...this.stack, t]);
4199
4150
  }
4200
4151
  getStack(t) {
4201
4152
  return [...this.stack];
4202
4153
  }
4203
4154
  spawn(t) {
4204
- return new bt(t, this);
4155
+ return new gt(t, this);
4205
4156
  }
4206
4157
  }
4207
- class We {
4158
+ class Qe {
4208
4159
  constructor(t) {
4209
- this.recordQuery = t, this.recordQueryByName = /* @__PURE__ */ new Map(), this.set(ye, t), this.recursiveSaveLabelledRecordQuery(t);
4160
+ this.recordQuery = t, this.recordQueryByName = /* @__PURE__ */ new Map(), this.set(me, t), this.recursiveSaveLabelledRecordQuery(t);
4210
4161
  }
4211
4162
  recursiveSaveLabelledRecordQuery(t) {
4212
4163
  t.attributeQuery?.relatedRecords.forEach((e) => {
@@ -4220,9 +4171,9 @@ class We {
4220
4171
  return this.recordQueryByName.get(t);
4221
4172
  }
4222
4173
  }
4223
- class Je {
4174
+ class Le {
4224
4175
  constructor(t, e) {
4225
- this.map = t, this.database = e, this.getPlaceholder = e.getPlaceholder || (() => (i) => "?"), this.filteredEntityManager = new Be(t, this), this.initializeFilteredEntityDependencies();
4176
+ this.map = t, this.database = e, this.getPlaceholder = e.getPlaceholder || (() => (i) => "?"), this.filteredEntityManager = new De(t, this), this.initializeFilteredEntityDependencies();
4226
4177
  }
4227
4178
  /**
4228
4179
  * 初始化所有 filtered entity 的依赖关系
@@ -4274,15 +4225,15 @@ ${b}
4274
4225
  const s = {};
4275
4226
  return Object.entries(r).forEach(([a, o]) => {
4276
4227
  const n = i.getPath(a).slice(1, 1 / 0);
4277
- n.length === 1 && e.includes(n[0]) && typeof o == "string" && (o = JSON.parse(o)), o !== null && Et(s, n, o);
4228
+ n.length === 1 && e.includes(n[0]) && typeof o == "string" && (o = JSON.parse(o)), o !== null && St(s, n, o);
4278
4229
  }), s;
4279
4230
  });
4280
4231
  }
4281
4232
  // 查 entity 和 查 relation 都是一样的。具体在 entityQuery 里面区别。
4282
4233
  // TODO 为了性能,也可以把信息丢到客户端,然客户端去结构化???
4283
4234
  // CAUTION findRelatedRecords 中的递归调用会使得 includeRelationData 变为 true
4284
- async findRecords(t, e = "", i, r = new bt(ye)) {
4285
- if (i || (i = new We(t)), t.goto) {
4235
+ async findRecords(t, e = "", i, r = new gt(me)) {
4236
+ if (i || (i = new Qe(t)), t.goto) {
4286
4237
  if (t.exit && await t.exit(r))
4287
4238
  return [];
4288
4239
  const d = i.get(t.goto);
@@ -4321,7 +4272,7 @@ ${b}
4321
4272
  value: ["=", A]
4322
4273
  })
4323
4274
  }), ft = t.label ? l.concat(b) : l;
4324
- Et(
4275
+ St(
4325
4276
  b,
4326
4277
  [d.alias || d.attributeName, f, p.attributeName],
4327
4278
  await this.findRecords(
@@ -4411,7 +4362,7 @@ ${b}
4411
4362
  for (let b of N.attributeQuery.xToManyRecords)
4412
4363
  for (let A of p) {
4413
4364
  const D = A[f].id, ft = d.label ? y.concat(A) : y;
4414
- Et(
4365
+ St(
4415
4366
  A,
4416
4367
  [f, b.attributeName],
4417
4368
  await this.findXToManyRelatedRecords(
@@ -4493,7 +4444,7 @@ ${b}
4493
4444
  return t ? `${t}___` : "";
4494
4445
  }
4495
4446
  buildSelectClause(t, e = "") {
4496
- const i = new _e();
4447
+ const i = new Ve();
4497
4448
  return t.length ? [t.map(({ tableAliasAndField: s, attribute: a, nameContext: o }) => {
4498
4449
  const n = [
4499
4450
  `${this.withPrefix(e)}${o[0]}`,
@@ -5065,9 +5016,9 @@ WHERE "${s.idField}" = ${l()}
5065
5016
  return p ? [N, ...p] : void 0;
5066
5017
  }
5067
5018
  }
5068
- class He {
5019
+ class qe {
5069
5020
  constructor(t, e) {
5070
- this.map = t, this.database = e, this.agent = new Je(t, e);
5021
+ this.map = t, this.database = e, this.agent = new Le(t, e);
5071
5022
  }
5072
5023
  async findOne(t, e, i = {}, r) {
5073
5024
  const s = {
@@ -5225,7 +5176,7 @@ class et {
5225
5176
  return this.data?.resolvedMatchExpression;
5226
5177
  }
5227
5178
  }
5228
- class Rt {
5179
+ class bt {
5229
5180
  constructor(t, e, i, r = !0) {
5230
5181
  this.name = t, this.data = e, this.map = i, this.isFromSource = r;
5231
5182
  }
@@ -5313,7 +5264,7 @@ class Rt {
5313
5264
  getBaseLinkInfo() {
5314
5265
  g(this.isFilteredRelation(), "only filtered relation can get base link info");
5315
5266
  const t = this.data.baseLinkName;
5316
- return new Rt(t, this.map.data.links[t], this.map);
5267
+ return new bt(t, this.map.data.links[t], this.map);
5317
5268
  }
5318
5269
  getMatchExpression() {
5319
5270
  if (this.isFilteredRelation())
@@ -5327,7 +5278,7 @@ class Rt {
5327
5278
  return g(this.isFilteredRelation(), "only filtered relation can get resolved record name"), this.data.resolvedBaseRecordName;
5328
5279
  }
5329
5280
  }
5330
- class je {
5281
+ class Be {
5331
5282
  constructor(t) {
5332
5283
  this.data = t;
5333
5284
  }
@@ -5352,10 +5303,10 @@ class je {
5352
5303
  }
5353
5304
  getLinkInfo(t, e) {
5354
5305
  const i = this.getAttributeAndSymmetricDirection(e)[0], { linkName: r, isSource: s } = this.data.records[t].attributes[i];
5355
- return g(!!r, `cannot find relation ${t} ${i}`), new Rt(r, this.data.links[r], this, !!s);
5306
+ return g(!!r, `cannot find relation ${t} ${i}`), new bt(r, this.data.links[r], this, !!s);
5356
5307
  }
5357
5308
  getLinkInfoByName(t) {
5358
- return g(!!this.data.links[t], `cannot find link ${t}`), new Rt(t, this.data.links[t], this);
5309
+ return g(!!this.data.links[t], `cannot find link ${t}`), new bt(t, this.data.links[t], this);
5359
5310
  }
5360
5311
  getInfoByPath(t) {
5361
5312
  const [e, ...i] = t;
@@ -5523,7 +5474,7 @@ class je {
5523
5474
  return r.join(".");
5524
5475
  }
5525
5476
  }
5526
- function Ue(u) {
5477
+ function _e(u) {
5527
5478
  const t = /* @__PURE__ */ new Map();
5528
5479
  for (const e of u)
5529
5480
  if (e.inputEntities)
@@ -5534,7 +5485,7 @@ function Ue(u) {
5534
5485
  }
5535
5486
  return t;
5536
5487
  }
5537
- function Ke(u) {
5488
+ function We(u) {
5538
5489
  const t = /* @__PURE__ */ new Map();
5539
5490
  for (const e of u) {
5540
5491
  const i = e.name || `${e.source.name}_${e.sourceProperty}_${e.targetProperty}_${e.target.name}`;
@@ -5548,36 +5499,36 @@ function Ke(u) {
5548
5499
  }
5549
5500
  return t;
5550
5501
  }
5551
- function Ge(u, t) {
5552
- const e = new me(u, t), i = Ue(u), r = Ke(t);
5553
- return ee(
5502
+ function Je(u, t) {
5503
+ const e = new fe(u, t), i = _e(u), r = We(t);
5504
+ return te(
5554
5505
  u,
5555
5506
  e,
5556
5507
  i,
5557
5508
  "entity"
5558
- ), ee(
5509
+ ), te(
5559
5510
  t,
5560
5511
  e,
5561
5512
  r,
5562
5513
  "relation"
5563
5514
  ), e.getAll();
5564
5515
  }
5565
- function ee(u, t, e, i) {
5516
+ function te(u, t, e, i) {
5566
5517
  const r = u.filter((s) => {
5567
5518
  const a = pt(s);
5568
5519
  return a && a.length > 0;
5569
5520
  });
5570
5521
  if (r.length !== 0)
5571
5522
  for (const s of r)
5572
- Xe(
5523
+ He(
5573
5524
  s,
5574
5525
  t,
5575
5526
  i,
5576
5527
  e
5577
5528
  );
5578
5529
  }
5579
- function Xe(u, t, e, i) {
5580
- const r = e === "entity", a = `__${G(u)}_input_${e}`, o = r ? t.getEntityByName(u.name) : t.getRelationByName(u.name), [n, c] = ei(
5530
+ function He(u, t, e, i) {
5531
+ const r = e === "entity", a = `__${G(u)}_input_${e}`, o = r ? t.getEntityByName(u.name) : t.getRelationByName(u.name), [n, c] = Xe(
5581
5532
  o,
5582
5533
  a,
5583
5534
  i,
@@ -5587,7 +5538,7 @@ function Xe(u, t, e, i) {
5587
5538
  const l = pt(u);
5588
5539
  if (l)
5589
5540
  for (const d of l)
5590
- ze(
5541
+ je(
5591
5542
  d,
5592
5543
  c,
5593
5544
  a,
@@ -5595,8 +5546,8 @@ function Xe(u, t, e, i) {
5595
5546
  r
5596
5547
  );
5597
5548
  }
5598
- function ze(u, t, e, i, r) {
5599
- const [s, a] = ii(
5549
+ function je(u, t, e, i, r) {
5550
+ const [s, a] = ze(
5600
5551
  u,
5601
5552
  t,
5602
5553
  e
@@ -5606,7 +5557,7 @@ function ze(u, t, e, i, r) {
5606
5557
  const o = G(a), n = r ? i.getEntityByName(o) : i.getRelationByName(o);
5607
5558
  n && i.replace(s, n);
5608
5559
  }
5609
- function Ye(u, t) {
5560
+ function Ue(u, t) {
5610
5561
  const e = /* @__PURE__ */ new Map(), i = pt(u);
5611
5562
  if (i && i.length > 0)
5612
5563
  for (const r of i) {
@@ -5620,8 +5571,8 @@ function Ye(u, t) {
5620
5571
  }
5621
5572
  return e;
5622
5573
  }
5623
- function Ze(u, t, e) {
5624
- const i = Ye(t, e);
5574
+ function Ke(u, t, e) {
5575
+ const i = Ue(t, e);
5625
5576
  return v.create({
5626
5577
  name: u,
5627
5578
  type: "json",
@@ -5633,14 +5584,14 @@ function Ze(u, t, e) {
5633
5584
  }
5634
5585
  });
5635
5586
  }
5636
- function ti(u, t, e) {
5587
+ function Ge(u, t, e) {
5637
5588
  const i = pt(u), r = [], s = /* @__PURE__ */ new Map(), a = {};
5638
5589
  for (const o of i) {
5639
5590
  let n = o;
5640
5591
  if (ht(n))
5641
5592
  for (; n.baseEntity && n.properties.length === 0; )
5642
5593
  n = n.baseEntity;
5643
- else if (si(n))
5594
+ else if (Ze(n))
5644
5595
  for (; n.baseRelation && n.properties.length === 0; )
5645
5596
  n = n.baseRelation;
5646
5597
  const c = Object.fromEntries(n.properties.map((h) => [h.name, h]));
@@ -5670,13 +5621,13 @@ function ti(u, t, e) {
5670
5621
  }
5671
5622
  return r;
5672
5623
  }
5673
- function ei(u, t, e, i) {
5674
- const r = Ze(
5624
+ function Xe(u, t, e, i) {
5625
+ const r = Ke(
5675
5626
  t,
5676
5627
  u,
5677
5628
  e
5678
5629
  ), s = [
5679
- ...ti(
5630
+ ...Ge(
5680
5631
  u,
5681
5632
  e,
5682
5633
  i
@@ -5734,7 +5685,7 @@ function ei(u, t, e, i) {
5734
5685
  return [o, n || o];
5735
5686
  }
5736
5687
  }
5737
- function ii(u, t, e) {
5688
+ function ze(u, t, e) {
5738
5689
  if (ht(u)) {
5739
5690
  const i = u, r = t;
5740
5691
  let s = i;
@@ -5748,7 +5699,7 @@ function ii(u, t, e) {
5748
5699
  }), [a, s];
5749
5700
  } else {
5750
5701
  const i = u, r = t, s = G(i);
5751
- return i.baseRelation ? [i, ri(i)] : [P.create({
5702
+ return i.baseRelation ? [i, Ye(i)] : [P.create({
5752
5703
  name: s,
5753
5704
  baseRelation: r,
5754
5705
  sourceProperty: i.sourceProperty,
@@ -5760,7 +5711,7 @@ function ii(u, t, e) {
5760
5711
  }), i];
5761
5712
  }
5762
5713
  }
5763
- function ri(u) {
5714
+ function Ye(u) {
5764
5715
  let t = u;
5765
5716
  for (; t.baseRelation; )
5766
5717
  t = t.baseRelation;
@@ -5769,7 +5720,7 @@ function ri(u) {
5769
5720
  function ht(u) {
5770
5721
  return "inputEntities" in u || !("sourceProperty" in u);
5771
5722
  }
5772
- function si(u) {
5723
+ function Ze(u) {
5773
5724
  return "sourceProperty" in u;
5774
5725
  }
5775
5726
  function pt(u) {
@@ -5778,7 +5729,7 @@ function pt(u) {
5778
5729
  function G(u) {
5779
5730
  return ht(u), u.name;
5780
5731
  }
5781
- class ai {
5732
+ class ti {
5782
5733
  constructor(t, e, i, r = []) {
5783
5734
  this.entities = t, this.relations = e, this.database = i, this.mergeLinks = r, this.fieldNameMap = /* @__PURE__ */ new Map(), this.usedFieldNames = /* @__PURE__ */ new Set(), this.fieldCounter = 1, this.recordToTableMap = /* @__PURE__ */ new Map(), this.tableToRecordsMap = /* @__PURE__ */ new Map(), this.mergeLog = [], this.tables = {}, this.map = { links: {}, records: {} }, this.buildMap(), this.buildTables();
5784
5735
  }
@@ -5873,8 +5824,8 @@ class ai {
5873
5824
  }
5874
5825
  ];
5875
5826
  }));
5876
- e && g(!i.source && !i.target, "source and target is reserved name for relation attributes"), i[ie] = {
5877
- name: ie,
5827
+ e && g(!i.source && !i.target, "source and target is reserved name for relation attributes"), i[ee] = {
5828
+ name: ee,
5878
5829
  type: "id",
5879
5830
  fieldType: this.database.mapToDBFieldType("pk")
5880
5831
  };
@@ -6057,7 +6008,7 @@ class ai {
6057
6008
  * 统一处理 merged entities 和 merged relations
6058
6009
  */
6059
6010
  processMergedItems() {
6060
- const t = Ge(
6011
+ const t = Je(
6061
6012
  this.entities,
6062
6013
  this.relations
6063
6014
  );
@@ -6126,8 +6077,8 @@ class ai {
6126
6077
  buildTables() {
6127
6078
  Object.entries(this.map.records).forEach(([t, e]) => {
6128
6079
  this.tables[e.table] || (this.tables[e.table] = { columns: {
6129
- [re]: {
6130
- name: re,
6080
+ [ie]: {
6081
+ name: ie,
6131
6082
  type: "pk",
6132
6083
  fieldType: this.database.mapToDBFieldType("pk")
6133
6084
  }
@@ -6171,7 +6122,7 @@ ${Object.values(this.tables[t].columns).map((i) => ` "${i.name}" ${i.fieldTyp
6171
6122
  return this.fieldCounter++, this.fieldNameMap.set(t, r), this.usedFieldNames.add(r), r;
6172
6123
  }
6173
6124
  }
6174
- const X = "_System_", q = "_Dictionary_", ie = "id", re = "_rowId", oi = I.create({
6125
+ const X = "_System_", q = "_Dictionary_", ee = "id", ie = "_rowId", ei = I.create({
6175
6126
  name: X,
6176
6127
  properties: [
6177
6128
  v.create({
@@ -6190,7 +6141,7 @@ const X = "_System_", q = "_Dictionary_", ie = "id", re = "_rowId", oi = I.creat
6190
6141
  collection: !1
6191
6142
  })
6192
6143
  ]
6193
- }), ni = I.create({
6144
+ }), ii = I.create({
6194
6145
  name: q,
6195
6146
  properties: [
6196
6147
  v.create({
@@ -6204,8 +6155,8 @@ const X = "_System_", q = "_Dictionary_", ie = "id", re = "_rowId", oi = I.creat
6204
6155
  collection: !1
6205
6156
  })
6206
6157
  ]
6207
- }), yr = 0, It = 1, gr = 2;
6208
- class ci {
6158
+ }), ur = 0, Et = 1, dr = 2;
6159
+ class ri {
6209
6160
  constructor(t, e) {
6210
6161
  this.controller = t, this.scheduler = e, this.sourceMaps = [], this.sourceMapTree = {};
6211
6162
  }
@@ -6219,18 +6170,18 @@ class ci {
6219
6170
  if (this.scheduler.isDataBasedComputation(i)) {
6220
6171
  if (Object.entries(i.dataDeps).forEach(([r, s]) => {
6221
6172
  const a = this.convertDataDepToERMutationEventsSourceMap(r, s, i);
6222
- e[s.phase || It].push(...a);
6173
+ e[s.phase || Et].push(...a);
6223
6174
  }), i.dataContext.type === "property" && Object.values(i.dataDeps).some((r) => r.type === "global")) {
6224
6175
  const r = {
6225
6176
  type: "records",
6226
6177
  source: i.dataContext.host
6227
6178
  };
6228
- e[It].push(...this.convertDataDepToERMutationEventsSourceMap("_self", r, i, "create"));
6179
+ e[Et].push(...this.convertDataDepToERMutationEventsSourceMap("_self", r, i, "create"));
6229
6180
  }
6230
6181
  } else {
6231
6182
  const { eventDeps: r } = i;
6232
6183
  for (const s of Object.values(r))
6233
- e[s.phase || It].push({
6184
+ e[s.phase || Et].push({
6234
6185
  type: s.type,
6235
6186
  recordName: s.recordName,
6236
6187
  record: s.record,
@@ -6432,31 +6383,31 @@ class ci {
6432
6383
  }
6433
6384
  class S {
6434
6385
  static {
6435
- this.skip = () => new wt();
6386
+ this.skip = () => new Rt();
6436
6387
  }
6437
6388
  static {
6438
- this.resolved = (t, e) => new Re(t, e);
6389
+ this.resolved = (t, e) => new be(t, e);
6439
6390
  }
6440
6391
  static {
6441
- this.async = (t) => new be(t);
6392
+ this.async = (t) => new ge(t);
6442
6393
  }
6443
6394
  static {
6444
- this.fullRecompute = (t) => new ge(t);
6395
+ this.fullRecompute = (t) => new ye(t);
6445
6396
  }
6446
6397
  }
6447
- class wt extends S {
6398
+ class Rt extends S {
6448
6399
  }
6449
- class ge extends S {
6400
+ class ye extends S {
6450
6401
  constructor(t) {
6451
6402
  super(), this.reason = t;
6452
6403
  }
6453
6404
  }
6454
- class be extends S {
6405
+ class ge extends S {
6455
6406
  constructor(t) {
6456
6407
  super(), this.args = t;
6457
6408
  }
6458
6409
  }
6459
- class Re extends S {
6410
+ class be extends S {
6460
6411
  constructor(t, e) {
6461
6412
  super(), this.result = t, this.args = e;
6462
6413
  }
@@ -6487,18 +6438,18 @@ class B {
6487
6438
  return await this.controller.system.storage.dict.get(this.key);
6488
6439
  }
6489
6440
  }
6490
- function $t(u, t) {
6441
+ function Pt(u, t) {
6491
6442
  if (t == null || u === t) return !0;
6492
6443
  if (typeof t != "object" || t === null)
6493
6444
  return u === t;
6494
6445
  if (typeof u != "object" || u === null)
6495
6446
  return !1;
6496
6447
  for (const e in t)
6497
- if (!(e in u) || !$t(u[e], t[e]))
6448
+ if (!(e in u) || !Pt(u[e], t[e]))
6498
6449
  return !1;
6499
6450
  return !0;
6500
6451
  }
6501
- class we {
6452
+ class Re {
6502
6453
  constructor(t) {
6503
6454
  this.data = t, this.map = {};
6504
6455
  for (const e of t.transfers)
@@ -6511,45 +6462,45 @@ class we {
6511
6462
  const i = this.map[t];
6512
6463
  if (i) {
6513
6464
  for (const r of i)
6514
- if ($t(e, r.trigger))
6465
+ if (Pt(e, r.trigger))
6515
6466
  return r.next;
6516
6467
  }
6517
6468
  return null;
6518
6469
  }
6519
6470
  findTransfers(t) {
6520
- return this.data.transfers.filter((e) => $t(t, e.trigger));
6471
+ return this.data.transfers.filter((e) => Pt(t, e.trigger));
6521
6472
  }
6522
6473
  }
6523
6474
  function T(u, t) {
6524
6475
  if (!u)
6525
6476
  throw new Error(t);
6526
6477
  }
6527
- function br(u, t) {
6478
+ function hr(u, t) {
6528
6479
  return new Map(Array.from(u.entries()).map(([e, i]) => [e, t(e, i)]));
6529
6480
  }
6530
- function Rr(u, t) {
6481
+ function pr(u, t) {
6531
6482
  return Object.fromEntries(Object.entries(u).map(([e, i]) => [e, t(e, i)]));
6532
6483
  }
6533
- async function wr(u, t) {
6484
+ async function fr(u, t) {
6534
6485
  for (let e of u)
6535
6486
  if (!await t(e)) return !1;
6536
6487
  return !0;
6537
6488
  }
6538
- async function li(u, t) {
6489
+ async function si(u, t) {
6539
6490
  for (let e of u)
6540
6491
  if (await t(e)) return !0;
6541
6492
  return !1;
6542
6493
  }
6543
- async function ui(u, t) {
6494
+ async function ai(u, t) {
6544
6495
  for (let e of u) {
6545
6496
  const i = await t(e);
6546
6497
  if (i !== !0) return i;
6547
6498
  }
6548
6499
  return !0;
6549
6500
  }
6550
- class di {
6501
+ class oi {
6551
6502
  constructor(t, e, i) {
6552
- this.controller = t, this.args = e, this.dataContext = i, this.useLastValue = !0, this.eventDeps = {}, this.useMutationEvent = !0, this.transitionFinder = new we(this.args), this.initialState = this.args.initialState;
6503
+ this.controller = t, this.args = e, this.dataContext = i, this.useLastValue = !0, this.eventDeps = {}, this.useMutationEvent = !0, this.transitionFinder = new Re(this.args), this.initialState = this.args.initialState;
6553
6504
  for (const r of this.args.transfers) {
6554
6505
  const s = `${r.trigger.recordName}_${r.trigger.type}`;
6555
6506
  this.eventDeps[s] = {
@@ -6577,9 +6528,9 @@ class di {
6577
6528
  return s ? (await this.state.currentState.set(s.name), s.computeValue ? await s.computeValue.call(this.controller, t, e) : s.name) : S.skip();
6578
6529
  }
6579
6530
  }
6580
- class hi {
6531
+ class ni {
6581
6532
  constructor(t, e, i) {
6582
- this.controller = t, this.args = e, this.useLastValue = !0, this.eventDeps = {}, this.useMutationEvent = !0, this.transitionFinder = new we(this.args), this.initialState = this.args.initialState, this.dataContext = i;
6533
+ this.controller = t, this.args = e, this.useLastValue = !0, this.eventDeps = {}, this.useMutationEvent = !0, this.transitionFinder = new Re(this.args), this.initialState = this.args.initialState, this.dataContext = i;
6583
6534
  for (const r of this.args.transfers) {
6584
6535
  const s = `${r.trigger.recordName}_${r.trigger.type}`;
6585
6536
  this.eventDeps[s] = {
@@ -6624,17 +6575,17 @@ Or if you want to use state name as value, you should not set ${this.dataContext
6624
6575
  };
6625
6576
  }
6626
6577
  }
6627
- const Nr = K.create({
6578
+ const mr = K.create({
6628
6579
  name: "nonExistent",
6629
6580
  computeValue: () => null
6630
- }), vr = K.create({
6581
+ }), yr = K.create({
6631
6582
  name: "nonDeleted",
6632
6583
  computeValue: () => !1
6633
- }), kr = K.create({
6584
+ }), gr = K.create({
6634
6585
  name: "deleted",
6635
6586
  computeValue: () => !0
6636
- }), pi = [di, hi];
6637
- class fi {
6587
+ }), ci = [oi, ni];
6588
+ class li {
6638
6589
  constructor(t, e, i) {
6639
6590
  this.controller = t, this.args = e, this.dataContext = i, this.useLastValue = !0, this.dataDeps = {}, this.matchRecordToWeight = this.args.callback.bind(this.controller), this.record = this.args.record, this.dataDeps = {
6640
6591
  main: {
@@ -6687,7 +6638,7 @@ class fi {
6687
6638
  return i;
6688
6639
  }
6689
6640
  }
6690
- class mi {
6641
+ class ui {
6691
6642
  constructor(t, e, i) {
6692
6643
  this.controller = t, this.args = e, this.dataContext = i, this.useLastValue = !0, this.dataDeps = {}, this.matchRecordToWeight = this.args.callback.bind(this.controller), this.relation = this.controller.relations.find((a) => a.source === i.host && a.sourceProperty === this.args.property || a.target === i.host && a.targetProperty === this.args.property), T(this.relation, "weighted summation computation must specify property"), this.isSource = this.args.direction ? this.args.direction === "source" : this.relation.source.name === i.host.name, T(this.isSource ? this.relation.source === i.host : this.relation.target === i.host, "weighted summation computation relation direction error"), this.relationAttr = this.isSource ? this.relation.sourceProperty : this.relation.targetProperty, this.relatedRecordName = this.isSource ? this.relation.target.name : this.relation.source.name, this.property = this.args.property || this.relationAttr, this.reverseProperty = this.isSource ? this.relation.targetProperty : this.relation.sourceProperty;
6693
6644
  const r = this.args.attributeQuery || [];
@@ -6763,8 +6714,8 @@ class mi {
6763
6714
  return s;
6764
6715
  }
6765
6716
  }
6766
- const yi = [fi, mi];
6767
- class gi {
6717
+ const di = [li, ui];
6718
+ class hi {
6768
6719
  constructor(t, e, i) {
6769
6720
  this.controller = t, this.args = e, this.dataContext = i, this.useLastValue = !0, this.dataDeps = {}, this.callback = this.args.callback.bind(this.controller), this.dataDeps = {
6770
6721
  main: {
@@ -6817,7 +6768,7 @@ class gi {
6817
6768
  return a === s;
6818
6769
  }
6819
6770
  }
6820
- class bi {
6771
+ class pi {
6821
6772
  constructor(t, e, i) {
6822
6773
  this.controller = t, this.args = e, this.dataContext = i, this.useLastValue = !0, this.dataDeps = {}, this.callback = this.args.callback.bind(this.controller), this.relation = this.controller.relations.find((a) => a.source === i.host && a.sourceProperty === this.args.property || a.target === i.host && a.targetProperty === this.args.property), this.isSource = this.args.direction ? this.args.direction === "source" : this.relation.source.name === i.host.name, T(this.isSource ? this.relation.source === i.host : this.relation.target === i.host, "every computation relation direction error"), this.relationAttr = this.isSource ? this.relation.sourceProperty : this.relation.targetProperty, this.relatedRecordName = this.isSource ? this.relation.target.name : this.relation.source.name, this.property = this.args.property, this.reverseProperty = this.isSource ? this.relation.targetProperty : this.relation.sourceProperty;
6823
6774
  const r = this.args.attributeQuery || [];
@@ -6891,8 +6842,8 @@ class bi {
6891
6842
  return a === o;
6892
6843
  }
6893
6844
  }
6894
- const Ri = [gi, bi];
6895
- class wi {
6845
+ const fi = [hi, pi];
6846
+ class mi {
6896
6847
  constructor(t, e, i) {
6897
6848
  this.controller = t, this.args = e, this.dataContext = i, this.useLastValue = !0, this.dataDeps = {}, this.callback = this.args.callback.bind(this.controller), this.dataDeps = {
6898
6849
  main: {
@@ -6945,7 +6896,7 @@ class wi {
6945
6896
  return s > 0;
6946
6897
  }
6947
6898
  }
6948
- class Ni {
6899
+ class yi {
6949
6900
  constructor(t, e, i) {
6950
6901
  this.controller = t, this.args = e, this.dataContext = i, this.useLastValue = !0, this.dataDeps = {}, this.callback = this.args.callback.bind(this.controller), this.relation = this.controller.relations.find((n) => n.source === i.host && n.sourceProperty === this.args.property || n.target === i.host && n.targetProperty === this.args.property), T(this.relation, `cannot find relation for property ${this.args.property} in "Any" computation`), this.isSource = this.args.direction ? this.args.direction === "source" : this.relation.source.name === i.host.name, T(this.isSource ? this.relation.source === i.host : this.relation.target === i.host, "any computation relation direction error");
6951
6902
  let r = this.relation.baseRelation || this.relation;
@@ -7021,8 +6972,8 @@ class Ni {
7021
6972
  return s > 0;
7022
6973
  }
7023
6974
  }
7024
- const vi = [wi, Ni];
7025
- class ki {
6975
+ const gi = [mi, yi];
6976
+ class bi {
7026
6977
  constructor(t, e, i) {
7027
6978
  this.controller = t, this.args = e, this.dataContext = i, this.useLastValue = !0, this.dataDeps = {}, this.record = this.args.record, this.callback = this.args.callback?.bind(this) || (() => !0), this.dataDeps = {
7028
6979
  main: {
@@ -7072,7 +7023,7 @@ class ki {
7072
7023
  return s = Math.max(0, s), await this.state.count.set(s), s;
7073
7024
  }
7074
7025
  }
7075
- class Ti {
7026
+ class Ri {
7076
7027
  constructor(t, e, i) {
7077
7028
  this.controller = t, this.args = e, this.dataContext = i, this.useLastValue = !0, this.dataDeps = {}, this.callback = this.args.callback?.bind(this.controller), this.args.property ? this.relation = this.controller.relations.find((a) => a.source === i.host && a.sourceProperty === this.args.property || a.target === i.host && a.targetProperty === this.args.property) : this.relation = this.args.record, this.isSource = this.args.direction ? this.args.direction === "source" : this.relation.source.name === i.host.name, T(this.isSource ? this.relation.source === i.host : this.relation.target === i.host, "count computation relation direction error"), this.relationAttr = this.isSource ? this.relation.sourceProperty : this.relation.targetProperty, this.relatedRecordName = this.isSource ? this.relation.target.name : this.relation.source.name, this.property = this.args.property || this.relationAttr, this.reverseProperty = this.isSource ? this.relation.targetProperty : this.relation.sourceProperty;
7078
7029
  const r = this.args.attributeQuery || [];
@@ -7154,8 +7105,8 @@ class Ti {
7154
7105
  return a;
7155
7106
  }
7156
7107
  }
7157
- const Ai = [ki, Ti];
7158
- class Si {
7108
+ const wi = [bi, Ri];
7109
+ class Ni {
7159
7110
  constructor(t, e, i) {
7160
7111
  this.controller = t, this.args = e, this.dataContext = i, this.useLastValue = !0, this.dataDeps = {}, T(!(this.args.record && this.args.eventDeps), "Transform must have either record or eventDep"), T(!(this.args.dataDeps && this.args.eventDeps), "Transform must have either dataDeps or eventDeps"), this.transformCallback = this.args.callback.bind(this.controller), this.args.eventDeps ? this.eventDeps = this.args.eventDeps : (T(this.args.dataDeps?._source === void 0, "dataDep name `_source` is reserved for Transform"), this.dataDeps = {
7161
7112
  ...this.args.dataDeps || {},
@@ -7167,7 +7118,7 @@ class Si {
7167
7118
  });
7168
7119
  }
7169
7120
  static {
7170
- this.computationType = Tt;
7121
+ this.computationType = kt;
7171
7122
  }
7172
7123
  static {
7173
7124
  this.contextType = ["entity", "relation"];
@@ -7263,7 +7214,7 @@ class Si {
7263
7214
  return r;
7264
7215
  }
7265
7216
  }
7266
- const Ei = [Si];
7217
+ const vi = [Ni];
7267
7218
  class M {
7268
7219
  constructor(t) {
7269
7220
  this.node = t;
@@ -7362,13 +7313,13 @@ class M {
7362
7313
  }
7363
7314
  }
7364
7315
  gt(t) {
7365
- return new Nt(this, ">", t);
7316
+ return new wt(this, ">", t);
7366
7317
  }
7367
7318
  lt(t) {
7368
- return new Nt(this, "<", t);
7319
+ return new wt(this, "<", t);
7369
7320
  }
7370
7321
  eq(t) {
7371
- return new Xt(this, t);
7322
+ return new Gt(this, t);
7372
7323
  }
7373
7324
  getVariables() {
7374
7325
  const t = /* @__PURE__ */ new Set();
@@ -7465,7 +7416,7 @@ class M {
7465
7416
  }
7466
7417
  }
7467
7418
  }
7468
- class Nt {
7419
+ class wt {
7469
7420
  constructor(t, e, i) {
7470
7421
  this.left = t, this.operator = e, this.right = i;
7471
7422
  }
@@ -7500,7 +7451,7 @@ class Nt {
7500
7451
  }
7501
7452
  }
7502
7453
  }
7503
- class Xt {
7454
+ class Gt {
7504
7455
  constructor(t, e) {
7505
7456
  this.left = t, this.right = e;
7506
7457
  }
@@ -7535,7 +7486,7 @@ class Xt {
7535
7486
  }
7536
7487
  }
7537
7488
  }
7538
- class Ii {
7489
+ class ki {
7539
7490
  constructor(t, e, i) {
7540
7491
  this.controller = t, this.args = e, this.dataContext = i, this.useLastValue = !1, this.dataDeps = this.args.dataDeps ?? {}, this.callback = (r, s) => this.args.callback.call(this.controller, r, s), this.nextRecomputeTime = this.args.nextRecomputeTime ? (r, s) => this.args.nextRecomputeTime.call(this.controller, r, s) : void 0;
7541
7492
  }
@@ -7560,14 +7511,14 @@ class Ii {
7560
7511
  let r, s;
7561
7512
  if (e instanceof M)
7562
7513
  r = e.evaluate({ now: i }), s = i + this.nextRecomputeTime(i, t);
7563
- else if (e instanceof Nt || e instanceof Xt)
7514
+ else if (e instanceof wt || e instanceof Gt)
7564
7515
  r = e.evaluate({ now: i }), s = e.solve();
7565
7516
  else
7566
7517
  throw new Error("Invalid result type");
7567
7518
  return await this.state.lastRecomputeTime.set(i), await this.state.nextRecomputeTime.set(s), r;
7568
7519
  }
7569
7520
  }
7570
- class Ci {
7521
+ class Ti {
7571
7522
  constructor(t, e, i) {
7572
7523
  this.controller = t, this.args = e, this.dataContext = i, this.useLastValue = !1, this.dataDeps = {
7573
7524
  _current: {
@@ -7598,15 +7549,15 @@ class Ci {
7598
7549
  let s, a;
7599
7550
  if (i instanceof M)
7600
7551
  s = i.evaluate({ now: r }), a = r + this.nextRecomputeTime(r, t);
7601
- else if (i instanceof Nt || i instanceof Xt)
7552
+ else if (i instanceof wt || i instanceof Gt)
7602
7553
  s = i.evaluate({ now: r }), a = i.solve();
7603
7554
  else
7604
7555
  throw new Error("Invalid result type");
7605
7556
  return await this.state.lastRecomputeTime.set(e, r), await this.state.nextRecomputeTime.set(e, a), s;
7606
7557
  }
7607
7558
  }
7608
- const xi = [Ii, Ci];
7609
- class Mi {
7559
+ const Ai = [ki, Ti];
7560
+ class Si {
7610
7561
  constructor(t, e, i) {
7611
7562
  if (this.controller = t, this.args = e, this.dataContext = i, this.useLastValue = !0, this.dataDeps = {}, this.record = this.args.record, !this.args.attributeQuery || this.args.attributeQuery.length === 0)
7612
7563
  throw new Error("Sum computation requires attributeQuery with at least one field");
@@ -7667,7 +7618,7 @@ class Mi {
7667
7618
  return s;
7668
7619
  }
7669
7620
  }
7670
- class Pi {
7621
+ class Ei {
7671
7622
  constructor(t, e, i) {
7672
7623
  this.controller = t, this.args = e, this.dataContext = i, this.useLastValue = !0, this.dataDeps = {}, this.relation = this.controller.relations.find((o) => o.source === i.host && o.sourceProperty === this.args.property || o.target === i.host && o.targetProperty === this.args.property), T(this.relation, "summation computation must specify either property or record"), this.isSource = this.args.direction ? this.args.direction === "source" : this.relation.source.name === i.host.name, T(this.isSource ? this.relation.source === i.host : this.relation.target === i.host, "summation computation relation direction error"), this.relationAttr = this.isSource ? this.relation.sourceProperty : this.relation.targetProperty, this.relatedRecordName = this.isSource ? this.relation.target.name : this.relation.source.name, this.property = this.args.property, this.reverseProperty = this.isSource ? this.relation.targetProperty : this.relation.sourceProperty;
7673
7624
  const r = this.args.attributeQuery || [];
@@ -7756,8 +7707,8 @@ class Pi {
7756
7707
  return a;
7757
7708
  }
7758
7709
  }
7759
- const $i = [Mi, Pi];
7760
- class Fi {
7710
+ const Ii = [Si, Ei];
7711
+ class Ci {
7761
7712
  constructor(t, e, i) {
7762
7713
  if (this.controller = t, this.args = e, this.dataContext = i, this.useLastValue = !0, this.dataDeps = {}, this.record = this.args.record, !this.args.attributeQuery || this.args.attributeQuery.length === 0)
7763
7714
  throw new Error("Average computation requires attributeQuery with at least one field");
@@ -7830,7 +7781,7 @@ class Fi {
7830
7781
  return await this.state.sum.set(a), await this.state.count.set(s), s > 0 ? a / s : 0;
7831
7782
  }
7832
7783
  }
7833
- class Oi {
7784
+ class xi {
7834
7785
  constructor(t, e, i) {
7835
7786
  this.controller = t, this.args = e, this.dataContext = i, this.useLastValue = !0, this.dataDeps = {}, this.relation = this.controller.relations.find((o) => o.source === i.host && o.sourceProperty === this.args.property || o.target === i.host && o.targetProperty === this.args.property), this.isSource = this.args.direction ? this.args.direction === "source" : this.relation.source.name === i.host.name, T(this.isSource ? this.relation.source === i.host : this.relation.target === i.host, "average computation relation direction error"), this.relationAttr = this.isSource ? this.relation.sourceProperty : this.relation.targetProperty, this.relatedRecordName = this.isSource ? this.relation.target.name : this.relation.source.name, this.property = this.args.property || this.relationAttr, this.reverseProperty = this.isSource ? this.relation.targetProperty : this.relation.sourceProperty;
7836
7787
  const r = this.args.attributeQuery || [];
@@ -7914,8 +7865,8 @@ class Oi {
7914
7865
  return await this.state.count.set(e.record, a), a > 0 ? o / a : 0;
7915
7866
  }
7916
7867
  }
7917
- const Di = [Fi, Oi];
7918
- class St {
7868
+ const Mi = [Ci, xi];
7869
+ class At {
7919
7870
  constructor(t, e, i) {
7920
7871
  this.controller = t, this.args = e, this.dataContext = i, this.state = {}, this.dataDeps = {}, this.useLastValue = e.useLastValue !== void 0 ? e.useLastValue : !0, e.dataDeps && (this.dataDeps = e.dataDeps), e.compute && (this.computeCallback = e.compute, this.compute = async (...r) => {
7921
7872
  if (this.computeCallback) {
@@ -7959,7 +7910,7 @@ class St {
7959
7910
  }));
7960
7911
  }
7961
7912
  static {
7962
- this.computationType = Gt;
7913
+ this.computationType = Kt;
7963
7914
  }
7964
7915
  createState() {
7965
7916
  if (this.createStateCallback) {
@@ -7986,22 +7937,22 @@ class St {
7986
7937
  return S.skip();
7987
7938
  }
7988
7939
  }
7989
- class Vi extends St {
7940
+ class Pi extends At {
7990
7941
  static {
7991
7942
  this.contextType = "global";
7992
7943
  }
7993
7944
  }
7994
- class Qi extends St {
7945
+ class $i extends At {
7995
7946
  static {
7996
7947
  this.contextType = "entity";
7997
7948
  }
7998
7949
  }
7999
- class Li extends St {
7950
+ class Fi extends At {
8000
7951
  static {
8001
7952
  this.contextType = "relation";
8002
7953
  }
8003
7954
  }
8004
- class qi extends St {
7955
+ class Oi extends At {
8005
7956
  static {
8006
7957
  this.contextType = "property";
8007
7958
  }
@@ -8016,11 +7967,11 @@ If you want to use aggregated data from all records in the entity/relation, you
8016
7967
  super(t, e, i);
8017
7968
  }
8018
7969
  }
8019
- const Bi = [
8020
- Vi,
8021
- Qi,
8022
- Li,
8023
- qi
7970
+ const Di = [
7971
+ Pi,
7972
+ $i,
7973
+ Fi,
7974
+ Oi
8024
7975
  ];
8025
7976
  class W extends Error {
8026
7977
  constructor(t, e = {}) {
@@ -8156,7 +8107,7 @@ class z extends W {
8156
8107
  }), this.interactionName = e.interactionName, this.userId = e.userId, this.payload = e.payload, this.executionPhase = e.executionPhase, this.severity = e.severity || O.HIGH;
8157
8108
  }
8158
8109
  }
8159
- class se extends W {
8110
+ class re extends W {
8160
8111
  constructor(t, e = {}) {
8161
8112
  super(t, {
8162
8113
  errorType: e.context?.errorType || "ActivityError",
@@ -8188,7 +8139,7 @@ class V extends W {
8188
8139
  }), this.handleName = e.handleName, this.computationName = e.computationName, this.dataContext = e.dataContext, this.computationPhase = e.computationPhase, this.severity = e.severity || O.MEDIUM;
8189
8140
  }
8190
8141
  }
8191
- class ae extends V {
8142
+ class se extends V {
8192
8143
  constructor(t, e = {}) {
8193
8144
  super(t, {
8194
8145
  ...e,
@@ -8218,7 +8169,7 @@ class J extends V {
8218
8169
  }), this.depName = e.depName, this.depType = e.depType, this.missingData = e.missingData, this.invalidData = e.invalidData;
8219
8170
  }
8220
8171
  }
8221
- class Ct extends W {
8172
+ class It extends W {
8222
8173
  constructor(t, e = {}) {
8223
8174
  super(t, {
8224
8175
  errorType: e.context?.errorType || "SchedulerError",
@@ -8232,7 +8183,7 @@ class Ct extends W {
8232
8183
  }), this.schedulingPhase = e.schedulingPhase, this.failedComputations = e.failedComputations, this.severity = O.HIGH;
8233
8184
  }
8234
8185
  }
8235
- class _i extends W {
8186
+ class Vi extends W {
8236
8187
  constructor(t, e) {
8237
8188
  super(t, {
8238
8189
  errorType: "SideEffectError",
@@ -8321,10 +8272,10 @@ class F extends W {
8321
8272
  });
8322
8273
  }
8323
8274
  }
8324
- const xt = "_ASYNC_TASK_";
8325
- class Wi {
8275
+ const Ct = "_ASYNC_TASK_";
8276
+ class Qi {
8326
8277
  constructor(t, e, i, r, s) {
8327
- this.controller = t, this.computationsHandles = /* @__PURE__ */ new Map(), this.computationHandleMap = /* @__PURE__ */ new Map(), this.erMutationEventSources = [], this.dataSourceMapTree = {}, this.sourceMapManager = new ci(this.controller, this), this.buildComputationHandleMap(s);
8278
+ this.controller = t, this.computationsHandles = /* @__PURE__ */ new Map(), this.computationHandleMap = /* @__PURE__ */ new Map(), this.erMutationEventSources = [], this.dataSourceMapTree = {}, this.sourceMapManager = new ri(this.controller, this), this.buildComputationHandleMap(s);
8328
8279
  const a = [];
8329
8280
  r.forEach((o) => {
8330
8281
  o.computation && a.push({ dataContext: { type: "global", id: o }, args: o.computation });
@@ -8638,7 +8589,7 @@ class Wi {
8638
8589
  }
8639
8590
  }
8640
8591
  } catch (i) {
8641
- throw i instanceof V ? i : new Ct("Unexpected error in dirty records computation", {
8592
+ throw i instanceof V ? i : new It("Unexpected error in dirty records computation", {
8642
8593
  schedulingPhase: "dirty-records-processing",
8643
8594
  failedComputations: [t.computation.args.constructor.displayName],
8644
8595
  causedBy: i instanceof Error ? i : new Error(String(i))
@@ -8648,8 +8599,8 @@ class Wi {
8648
8599
  getAsyncTaskRecordKey(t) {
8649
8600
  if (t.dataContext.type === "property") {
8650
8601
  const e = t.dataContext;
8651
- return `${xt}_${e.host.name}_${e.id.name}`;
8652
- } else return t.dataContext.type === "global" ? `${xt}_${t.dataContext.id.name}` : `${xt}_${t.dataContext.type}_${t.dataContext.id?.name}`;
8602
+ return `${Ct}_${e.host.name}_${e.id.name}`;
8603
+ } else return t.dataContext.type === "global" ? `${Ct}_${t.dataContext.id.name}` : `${Ct}_${t.dataContext.type}_${t.dataContext.id?.name}`;
8653
8604
  }
8654
8605
  async createAsyncTask(t, e, i, r) {
8655
8606
  if (t.dataContext.type === "property")
@@ -8718,7 +8669,7 @@ class Wi {
8718
8669
  try {
8719
8670
  o = await this.controller.retrieveLastValue(t.dataContext, i);
8720
8671
  } catch (n) {
8721
- throw new ae("Failed to retrieve last value for incremental computation", {
8672
+ throw new se("Failed to retrieve last value for incremental computation", {
8722
8673
  handleName: t.constructor.name,
8723
8674
  computationName: t.args.constructor.displayName,
8724
8675
  dataContext: t.dataContext,
@@ -8732,7 +8683,7 @@ class Wi {
8732
8683
  try {
8733
8684
  o = await this.controller.retrieveLastValue(t.dataContext, i);
8734
8685
  } catch (n) {
8735
- throw new ae("Failed to retrieve last value for incremental patch computation", {
8686
+ throw new se("Failed to retrieve last value for incremental patch computation", {
8736
8687
  handleName: t.constructor.name,
8737
8688
  computationName: t.args.constructor.displayName,
8738
8689
  dataContext: t.dataContext,
@@ -8747,7 +8698,7 @@ class Wi {
8747
8698
  dataContext: t.dataContext,
8748
8699
  computationPhase: "type-validation"
8749
8700
  });
8750
- if (s instanceof ge) {
8701
+ if (s instanceof ye) {
8751
8702
  const o = t;
8752
8703
  if (!o.compute)
8753
8704
  throw new V("compute must be defined for computation when incrementalCompute returns ComputationResultFullRecompute", {
@@ -8768,9 +8719,9 @@ class Wi {
8768
8719
  causedBy: o instanceof Error ? o : new Error(String(o))
8769
8720
  });
8770
8721
  }
8771
- if (s instanceof wt)
8722
+ if (s instanceof Rt)
8772
8723
  return;
8773
- if (s instanceof be)
8724
+ if (s instanceof ge)
8774
8725
  try {
8775
8726
  return await this.createAsyncTask(t, s.args, i);
8776
8727
  } catch (o) {
@@ -8783,7 +8734,7 @@ class Wi {
8783
8734
  });
8784
8735
  }
8785
8736
  try {
8786
- const o = s instanceof Re ? await t.asyncReturn(s.result, s.args) : s;
8737
+ const o = s instanceof be ? await t.asyncReturn(s.result, s.args) : s;
8787
8738
  t.incrementalPatchCompute ? await this.controller.applyResultPatch(t.dataContext, o, i) : await this.controller.applyResult(t.dataContext, o, i);
8788
8739
  } catch (o) {
8789
8740
  throw new V("Failed to apply computation result", {
@@ -8866,14 +8817,14 @@ class Wi {
8866
8817
  try {
8867
8818
  this.addMutationPropertyComputationDefaultValueListeners(), this.addMutationComputationListeners(), t && (await this.setupGlobalBoundStateDefaultValues(), await this.setupGlobalComputationDefaultValue(), await this.setupDictDefaultValue());
8868
8819
  } catch (e) {
8869
- throw e instanceof Ct ? e : new Ct("Unexpected error during scheduler setup", {
8820
+ throw e instanceof It ? e : new It("Unexpected error during scheduler setup", {
8870
8821
  schedulingPhase: "top-level-setup",
8871
8822
  causedBy: e instanceof Error ? e : new Error(String(e))
8872
8823
  });
8873
8824
  }
8874
8825
  }
8875
8826
  }
8876
- class Ne {
8827
+ class we {
8877
8828
  constructor(t, e, i) {
8878
8829
  this.interaction = t, this.controller = e, this.activitySeqCall = i, this.system = e.system;
8879
8830
  }
@@ -8901,7 +8852,7 @@ class Ne {
8901
8852
  async checkUser(t, e, i) {
8902
8853
  let r;
8903
8854
  if (!this.interaction.userAttributives) return !0;
8904
- const s = vt.is(this.interaction.userAttributives) ? R.fromValue(
8855
+ const s = Nt.is(this.interaction.userAttributives) ? R.fromValue(
8905
8856
  this.interaction.userAttributives.content
8906
8857
  ) : R.atom(
8907
8858
  this.interaction.userAttributives
@@ -8927,7 +8878,7 @@ class Ne {
8927
8878
  }
8928
8879
  if (this.isConceptAlias(e)) {
8929
8880
  const s = [];
8930
- return await li(e.for, async (o) => {
8881
+ return await si(e.for, async (o) => {
8931
8882
  const n = await this.isConcept(t, o);
8932
8883
  return n === !0 ? !0 : (s.push(n), !1);
8933
8884
  }) ? !0 : { name: e.name, type: "conceptAlias", stack: r, error: s };
@@ -8967,7 +8918,7 @@ class Ne {
8967
8918
  throw F.payloadValidationFailed(s.name, "data is not a ref", a);
8968
8919
  if (s.base)
8969
8920
  if (s.isCollection) {
8970
- const o = await ui(a, (n) => this.checkConcept(n, s.base));
8921
+ const o = await ai(a, (n) => this.checkConcept(n, s.base));
8971
8922
  if (o !== !0)
8972
8923
  throw F.conceptCheckFailed(s.name, o);
8973
8924
  } else {
@@ -8989,7 +8940,7 @@ class Ne {
8989
8940
  }
8990
8941
  async checkCondition(t) {
8991
8942
  if (this.interaction.conditions) {
8992
- const e = At.is(this.interaction.conditions) ? new R(this.interaction.conditions.content) : R.atom(this.interaction.conditions), i = async (s) => {
8943
+ const e = Tt.is(this.interaction.conditions) ? new R(this.interaction.conditions.content) : R.atom(this.interaction.conditions), i = async (s) => {
8993
8944
  if (!s) return !0;
8994
8945
  if (s.content) {
8995
8946
  const a = s.content;
@@ -9023,7 +8974,7 @@ class Ne {
9023
8974
  T(!i.sideEffects[o], `sideEffect ${o} already exists`), i.sideEffects[o] = { result: n, error: c };
9024
8975
  }
9025
8976
  isGetInteraction() {
9026
- return this.interaction.action === De;
8977
+ return this.interaction.action === Me;
9027
8978
  }
9028
8979
  async saveEvent(t) {
9029
8980
  return await this.controller.activityManager.saveEvent(t);
@@ -9033,8 +8984,8 @@ class Ne {
9033
8984
  if (I.is(this.interaction.data) || P.is(this.interaction.data)) {
9034
8985
  const i = this.interaction.data.name, r = this.interaction.dataPolicy?.match, s = this.interaction.dataPolicy?.modifier;
9035
8986
  this.interaction.dataPolicy?.attributeQuery;
9036
- const a = { ...t.query?.modifier || {}, ...s || {} }, o = t.query?.attributeQuery || [], n = typeof r == "function" ? await r.call(this.controller, t) : r, c = n instanceof R ? n : n ? R.atom(n) : void 0, l = R.and(c, t.query?.match);
9037
- e = await this.system.storage.find(i, l, a, o);
8987
+ const a = { ...t.query?.modifier || {}, ...s || {} }, o = t.query?.attributeQuery || [], n = typeof r == "function" ? await r.call(this.controller, t) : r, c = R.and(n, t.query?.match);
8988
+ e = await this.system.storage.find(i, c, a, o);
9038
8989
  } else
9039
8990
  T(!1, `unknown data type ${this.interaction.data}`);
9040
8991
  return e;
@@ -9136,7 +9087,7 @@ class $ {
9136
9087
  this.parent.transferToNext(this.node.uuid);
9137
9088
  }
9138
9089
  }
9139
- class oe {
9090
+ class ae {
9140
9091
  constructor(t, e) {
9141
9092
  this.graph = e, this.root = j.create(t, this.graph);
9142
9093
  }
@@ -9171,7 +9122,7 @@ class Y {
9171
9122
  for (let o of t.interactions) {
9172
9123
  const n = { content: o, next: null, uuid: o.uuid, parentGroup: e, parentSeq: r };
9173
9124
  this.uuidToNode.set(o.uuid, n), this.rawToNode.set(o, n);
9174
- const c = new Ne(o, this.controller, this);
9125
+ const c = new we(o, this.controller, this);
9175
9126
  this.uuidToInteractionCall.set(o.uuid, c), o.name && this.interactionCallByName.set(o.name, c);
9176
9127
  }
9177
9128
  for (let o of t.gateways) {
@@ -9200,7 +9151,7 @@ class Y {
9200
9151
  }), r;
9201
9152
  }
9202
9153
  async create() {
9203
- const t = oe.createInitialState(this.graph.head);
9154
+ const t = ae.createInitialState(this.graph.head);
9204
9155
  return {
9205
9156
  activityId: (await this.controller.activityManager.createActivity({
9206
9157
  name: this.activity.name,
@@ -9259,7 +9210,7 @@ class Y {
9259
9210
  s = (await this.create()).activityId;
9260
9211
  }
9261
9212
  } else if (!t) return { error: "activityId must be provided for non-head interaction of an activity" };
9262
- const a = new oe(await this.getState(s), this);
9213
+ const a = new ae(await this.getState(s), this);
9263
9214
  if (!a.isInteractionAvailable(e)) return { error: `interaction ${e} not available` };
9264
9215
  const o = await r.call(i, s, this.checkUserRef);
9265
9216
  if (o.error)
@@ -9287,7 +9238,7 @@ class Y {
9287
9238
  }), await this.setActivity(t, { refs: r });
9288
9239
  }
9289
9240
  }
9290
- class Ji extends $ {
9241
+ class Li extends $ {
9291
9242
  onChange(t, e) {
9292
9243
  if (this.graph.isStartNode(t)) {
9293
9244
  if (e)
@@ -9298,25 +9249,25 @@ class Ji extends $ {
9298
9249
  }
9299
9250
  }
9300
9251
  }
9301
- $.GroupStateNodeType.set("any", Ji);
9302
- class Hi extends $ {
9252
+ $.GroupStateNodeType.set("any", Li);
9253
+ class qi extends $ {
9303
9254
  onChange(t, e) {
9304
9255
  this.isGroupCompleted() && this.complete();
9305
9256
  }
9306
9257
  }
9307
- $.GroupStateNodeType.set("every", Hi);
9308
- class ji extends $ {
9258
+ $.GroupStateNodeType.set("every", qi);
9259
+ class Bi extends $ {
9309
9260
  onChange(t, e) {
9310
9261
  this.graph.isEndNode(t) && this.complete();
9311
9262
  }
9312
9263
  }
9313
- $.GroupStateNodeType.set("race", ji);
9314
- class Ui extends $ {
9264
+ $.GroupStateNodeType.set("race", Bi);
9265
+ class _i extends $ {
9315
9266
  // 可以根据 group 上的具体配置逻辑,来动态决定。
9316
9267
  }
9317
- $.GroupStateNodeType.set("program", Ui);
9318
- const ne = new le(), Ft = "_Interaction_", gt = "_Activity_", ve = I.create({
9319
- name: Ft,
9268
+ $.GroupStateNodeType.set("program", _i);
9269
+ const oe = new ce(), $t = "_Interaction_", yt = "_Activity_", Ne = I.create({
9270
+ name: $t,
9320
9271
  properties: [
9321
9272
  v.create({
9322
9273
  name: "interactionId",
@@ -9344,8 +9295,8 @@ const ne = new le(), Ft = "_Interaction_", gt = "_Activity_", ve = I.create({
9344
9295
  collection: !1
9345
9296
  })
9346
9297
  ]
9347
- }), ke = I.create({
9348
- name: gt,
9298
+ }), ve = I.create({
9299
+ name: yt,
9349
9300
  properties: [
9350
9301
  v.create({
9351
9302
  name: "name",
@@ -9368,26 +9319,26 @@ const ne = new le(), Ft = "_Interaction_", gt = "_Activity_", ve = I.create({
9368
9319
  collection: !1
9369
9320
  })
9370
9321
  ]
9371
- }), Ki = P.create({
9322
+ }), Wi = P.create({
9372
9323
  name: "activityInteraction",
9373
- source: ke,
9324
+ source: ve,
9374
9325
  sourceProperty: "interaction",
9375
- target: ve,
9326
+ target: Ne,
9376
9327
  targetProperty: "activity",
9377
9328
  type: "1:n"
9378
9329
  });
9379
- class Gi {
9330
+ class Ji {
9380
9331
  constructor(t, e, i) {
9381
- this.controller = t, this.activityCalls = /* @__PURE__ */ new Map(), this.activityCallsByName = /* @__PURE__ */ new Map(), this.interactionCallsByName = /* @__PURE__ */ new Map(), this.interactionCalls = /* @__PURE__ */ new Map(), this.controller.entities.push(ke, ve), this.controller.relations.push(Ki), e.forEach((r) => {
9332
+ this.controller = t, this.activityCalls = /* @__PURE__ */ new Map(), this.activityCallsByName = /* @__PURE__ */ new Map(), this.interactionCallsByName = /* @__PURE__ */ new Map(), this.interactionCalls = /* @__PURE__ */ new Map(), this.controller.entities.push(ve, Ne), this.controller.relations.push(Wi), e.forEach((r) => {
9382
9333
  const s = new Y(r, t);
9383
9334
  this.activityCalls.set(r.uuid, s), r.name && (T(!this.activityCallsByName.has(r.name), `activity name ${r.name} is duplicated`), this.activityCallsByName.set(r.name, s));
9384
9335
  }), i.forEach((r) => {
9385
- const s = new Ne(r, t);
9336
+ const s = new we(r, t);
9386
9337
  this.interactionCalls.set(r.uuid, s), r.name && (T(!this.interactionCallsByName.has(r.name), `interaction name ${r.name} is duplicated`), this.interactionCallsByName.set(r.name, s));
9387
9338
  });
9388
9339
  }
9389
9340
  async callInteraction(t, e) {
9390
- const i = ne.getStore(), r = this.controller.system.logger.child(i?.logContext || {});
9341
+ const i = oe.getStore(), r = this.controller.system.logger.child(i?.logContext || {});
9391
9342
  try {
9392
9343
  const s = this.interactionCallsByName.get(t);
9393
9344
  if (!s)
@@ -9430,11 +9381,11 @@ class Gi {
9430
9381
  }
9431
9382
  }
9432
9383
  async callActivityInteraction(t, e, i, r) {
9433
- const s = ne.getStore(), a = this.controller.system.logger.child(s?.logContext || {});
9384
+ const s = oe.getStore(), a = this.controller.system.logger.child(s?.logContext || {});
9434
9385
  try {
9435
9386
  const o = this.activityCallsByName.get(t);
9436
9387
  if (!o)
9437
- throw new se(`Cannot find activity for ${t}`, {
9388
+ throw new re(`Cannot find activity for ${t}`, {
9438
9389
  activityName: t,
9439
9390
  context: {
9440
9391
  interactionName: e,
@@ -9457,7 +9408,7 @@ class Gi {
9457
9408
  const c = await o.callInteraction(i, n.interaction.uuid, r);
9458
9409
  return c.error ? (a.error({ label: "activity", message: o.activity.name }), await this.controller.system.storage.rollbackTransaction(o.activity.name)) : await this.controller.system.storage.commitTransaction(o.activity.name), c;
9459
9410
  } catch (o) {
9460
- throw new se("Unexpected error during activity interaction call", {
9411
+ throw new re("Unexpected error during activity interaction call", {
9461
9412
  activityName: t,
9462
9413
  context: {
9463
9414
  interactionName: e,
@@ -9469,7 +9420,7 @@ class Gi {
9469
9420
  }
9470
9421
  }
9471
9422
  async createActivity(t) {
9472
- return this.controller.system.storage.create(gt, {
9423
+ return this.controller.system.storage.create(yt, {
9473
9424
  ...t,
9474
9425
  state: t.state,
9475
9426
  refs: t.refs
@@ -9479,20 +9430,20 @@ class Gi {
9479
9430
  const i = {
9480
9431
  ...e
9481
9432
  };
9482
- return delete i.state, delete i.refs, e.state && (i.state = e.state), e.refs && (i.refs = e.refs), this.controller.system.storage.update(gt, t, i);
9433
+ return delete i.state, delete i.refs, e.state && (i.state = e.state), e.refs && (i.refs = e.refs), this.controller.system.storage.update(yt, t, i);
9483
9434
  }
9484
9435
  async getActivity(t) {
9485
- return (await this.controller.system.storage.find(gt, t, void 0, ["*"])).map((e) => ({
9436
+ return (await this.controller.system.storage.find(yt, t, void 0, ["*"])).map((e) => ({
9486
9437
  ...e,
9487
9438
  state: e.state,
9488
9439
  refs: e.refs
9489
9440
  }));
9490
9441
  }
9491
9442
  async saveEvent(t) {
9492
- return this.controller.system.storage.create(Ft, t);
9443
+ return this.controller.system.storage.create($t, t);
9493
9444
  }
9494
9445
  async getEvent(t) {
9495
- return (await this.controller.system.storage.find(Ft, t, void 0, ["*"])).map((e) => ({
9446
+ return (await this.controller.system.storage.find($t, t, void 0, ["*"])).map((e) => ({
9496
9447
  ...e
9497
9448
  }));
9498
9449
  }
@@ -9509,32 +9460,32 @@ class Gi {
9509
9460
  return this.interactionCallsByName.get(t);
9510
9461
  }
9511
9462
  }
9512
- const zt = new le();
9513
- function Xi() {
9514
- return zt.getStore()?.effects;
9463
+ const Xt = new ce();
9464
+ function Hi() {
9465
+ return Xt.getStore()?.effects;
9515
9466
  }
9516
- function ce(u) {
9517
- const t = zt.getStore();
9467
+ function ne(u) {
9468
+ const t = Xt.getStore();
9518
9469
  t?.effects && t.effects.push(...u);
9519
9470
  }
9520
- const Tr = "User";
9521
- class Te {
9471
+ const br = "User";
9472
+ class ke {
9522
9473
  constructor(t) {
9523
9474
  this.name = t.name, this.record = t.record, this.content = t.content;
9524
9475
  }
9525
9476
  static create(t) {
9526
- return new Te(t);
9477
+ return new ke(t);
9527
9478
  }
9528
9479
  }
9529
- const Ot = "_isDeleted_", Ar = {
9480
+ const Ft = "_isDeleted_", Rr = {
9530
9481
  create() {
9531
9482
  return v.create({
9532
- name: Ot,
9483
+ name: Ft,
9533
9484
  type: "boolean"
9534
9485
  });
9535
9486
  }
9536
9487
  };
9537
- class Sr {
9488
+ class wr {
9538
9489
  constructor(t) {
9539
9490
  this.recordNameToSideEffects = /* @__PURE__ */ new Map(), this.globals = {
9540
9491
  BoolExp: R,
@@ -9553,21 +9504,21 @@ class Sr {
9553
9504
  forceThrowInteractionError: d = !1
9554
9505
  // 会 catch 住 error,并在 result 中返回。
9555
9506
  } = t;
9556
- this.system = e, this.ignorePermission = l, this.forceThrowInteractionError = d, this.entities = [...i], this.relations = [...r], this.activities = [...s], this.interactions = [...a], this.dict = [...o], this.recordMutationSideEffects = [...n], this.activityManager = new Gi(this, s, a);
9507
+ this.system = e, this.ignorePermission = l, this.forceThrowInteractionError = d, this.entities = [...i], this.relations = [...r], this.activities = [...s], this.interactions = [...a], this.dict = [...o], this.recordMutationSideEffects = [...n], this.activityManager = new Ji(this, s, a);
9557
9508
  const h = [
9558
- ...Ai,
9559
- ...Ei,
9509
+ ...wi,
9560
9510
  ...vi,
9561
- ...Ri,
9562
- ...yi,
9563
- ...$i,
9511
+ ...gi,
9512
+ ...fi,
9513
+ ...di,
9514
+ ...Ii,
9515
+ ...Mi,
9516
+ ...Ai,
9517
+ ...ci,
9564
9518
  ...Di,
9565
- ...xi,
9566
- ...pi,
9567
- ...Bi,
9568
9519
  ...c
9569
9520
  ];
9570
- this.scheduler = new Wi(this, this.entities, this.relations, this.dict, h), n.forEach((p) => {
9521
+ this.scheduler = new Qi(this, this.entities, this.relations, this.dict, h), n.forEach((p) => {
9571
9522
  let y = this.recordNameToSideEffects.get(p.record.name);
9572
9523
  y || this.recordNameToSideEffects.set(p.record.name, y = /* @__PURE__ */ new Set()), y.add(p);
9573
9524
  });
@@ -9587,7 +9538,7 @@ class Sr {
9587
9538
  }
9588
9539
  }
9589
9540
  async applyResult(t, e, i) {
9590
- if (!(e instanceof wt)) {
9541
+ if (!(e instanceof Rt)) {
9591
9542
  if (t.type === "global")
9592
9543
  return this.system.storage.dict.set(t.id.name, e);
9593
9544
  if (t.type === "entity") {
@@ -9606,12 +9557,12 @@ class Sr {
9606
9557
  await this.system.storage.create(r.id.name, a);
9607
9558
  } else {
9608
9559
  const r = t;
9609
- r.id.name === Ot && e ? await this.system.storage.delete(r.host.name, R.atom({ key: "id", value: ["=", i.id] })) : await this.system.storage.update(r.host.name, R.atom({ key: "id", value: ["=", i.id] }), { [r.id.name]: e });
9560
+ r.id.name === Ft && e ? await this.system.storage.delete(r.host.name, R.atom({ key: "id", value: ["=", i.id] })) : await this.system.storage.update(r.host.name, R.atom({ key: "id", value: ["=", i.id] }), { [r.id.name]: e });
9610
9561
  }
9611
9562
  }
9612
9563
  }
9613
9564
  async applyResultPatch(t, e, i) {
9614
- if (e instanceof wt || e === void 0) return;
9565
+ if (e instanceof Rt || e === void 0) return;
9615
9566
  const r = Array.isArray(e) ? e : [e];
9616
9567
  for (const s of r) {
9617
9568
  if (t.type === "global")
@@ -9629,13 +9580,13 @@ class Sr {
9629
9580
  }
9630
9581
  } else {
9631
9582
  const a = t;
9632
- a.id.name === Ot && s.data ? (T(s.type !== "delete", "Hard deletion property cannot be deleted"), await this.system.storage.delete(a.host.name, R.atom({ key: "id", value: ["=", i.id] }))) : s.type === "insert" ? await this.system.storage.update(a.host.name, R.atom({ key: "id", value: ["=", i.id] }), { [a.id.name]: s.data }) : s.type === "update" ? await this.system.storage.update(a.host.name, R.atom({ key: "id", value: ["=", i.id] }), { [a.id.name]: s.data }) : s.type === "delete" && await this.system.storage.update(a.host.name, R.atom({ key: "id", value: ["=", i.id] }), { [a.id.name]: null });
9583
+ a.id.name === Ft && s.data ? (T(s.type !== "delete", "Hard deletion property cannot be deleted"), await this.system.storage.delete(a.host.name, R.atom({ key: "id", value: ["=", i.id] }))) : s.type === "insert" ? await this.system.storage.update(a.host.name, R.atom({ key: "id", value: ["=", i.id] }), { [a.id.name]: s.data }) : s.type === "update" ? await this.system.storage.update(a.host.name, R.atom({ key: "id", value: ["=", i.id] }), { [a.id.name]: s.data }) : s.type === "delete" && await this.system.storage.update(a.host.name, R.atom({ key: "id", value: ["=", i.id] }), { [a.id.name]: null });
9633
9584
  }
9634
9585
  }
9635
9586
  }
9636
9587
  async callInteraction(t, e, i, r) {
9637
9588
  try {
9638
- const s = { effects: [] }, a = await zt.run(s, async () => i ? await this.activityManager.callActivityInteraction(i, t, r, e) : await this.activityManager.callInteraction(t, e));
9589
+ const s = { effects: [] }, a = await Xt.run(s, async () => i ? await this.activityManager.callActivityInteraction(i, t, r, e) : await this.activityManager.callInteraction(t, e));
9639
9590
  if (a.effects = s.effects, a.error && this.forceThrowInteractionError)
9640
9591
  throw a.error;
9641
9592
  return await this.runRecordChangeSideEffects(a, this.system.logger), a;
@@ -9665,7 +9616,7 @@ class Sr {
9665
9616
  result: await a.content.call(this, r)
9666
9617
  };
9667
9618
  } catch (o) {
9668
- const n = new _i(
9619
+ const n = new Vi(
9669
9620
  `Side effect '${a.name}' failed for ${r.type} on ${r.recordName}`,
9670
9621
  {
9671
9622
  sideEffectName: a.name,
@@ -9691,13 +9642,13 @@ class Sr {
9691
9642
  this.callbacks.has(t) || this.callbacks.set(t, /* @__PURE__ */ new Set()), this.callbacks.get(t).add(e);
9692
9643
  }
9693
9644
  }
9694
- function zi(u) {
9645
+ function ji(u) {
9695
9646
  return encodeURI(JSON.stringify(u));
9696
9647
  }
9697
- function Yi(u) {
9648
+ function Ui(u) {
9698
9649
  return u === void 0 ? void 0 : JSON.parse(decodeURI(u));
9699
9650
  }
9700
- class Zi {
9651
+ class Ki {
9701
9652
  constructor(t) {
9702
9653
  this.db = t, this.callbacks = /* @__PURE__ */ new Set(), this.dict = {
9703
9654
  get: async (e) => {
@@ -9722,20 +9673,20 @@ class Zi {
9722
9673
  // CAUTION kv 结构数据的实现也用 er。这是系统约定,因为也需要 Record 事件!
9723
9674
  async get(t, e, i) {
9724
9675
  const r = m.atom({ key: "key", value: ["=", e] }).and({ key: "concept", value: ["=", t] }), s = (await this.queryHandle.findOne(X, r, void 0, ["value"]))?.value;
9725
- return s === void 0 ? i : Yi(s);
9676
+ return s === void 0 ? i : Ui(s);
9726
9677
  }
9727
9678
  async set(t, e, i, r) {
9728
9679
  const s = m.atom({ key: "key", value: ["=", e] }).and({ key: "concept", value: ["=", t] });
9729
- return await this.queryHandle.findOne(X, s, void 0, ["value"]) ? this.callWithEvents(this.queryHandle.update.bind(this.queryHandle), [X, s, { concept: t, key: e.toString(), value: zi(i) }], r) : this.callWithEvents(this.queryHandle.create.bind(this.queryHandle), [X, { concept: t, key: e.toString(), value: encodeURI(JSON.stringify(i)) }], r);
9680
+ return await this.queryHandle.findOne(X, s, void 0, ["value"]) ? this.callWithEvents(this.queryHandle.update.bind(this.queryHandle), [X, s, { concept: t, key: e.toString(), value: ji(i) }], r) : this.callWithEvents(this.queryHandle.create.bind(this.queryHandle), [X, { concept: t, key: e.toString(), value: encodeURI(JSON.stringify(i)) }], r);
9730
9681
  }
9731
9682
  async setup(t, e, i = !1) {
9732
9683
  await this.db.open(i);
9733
- const r = new ai(
9684
+ const r = new ti(
9734
9685
  t,
9735
9686
  e,
9736
9687
  this.db
9737
9688
  );
9738
- i && await r.createTables(), this.queryHandle = new He(new je(r.map), this.db), this.map = r.map;
9689
+ i && await r.createTables(), this.queryHandle = new qe(new Be(r.map), this.db), this.map = r.map;
9739
9690
  }
9740
9691
  findOne(...t) {
9741
9692
  return this.queryHandle.findOne(...t);
@@ -9755,8 +9706,8 @@ class Zi {
9755
9706
  async callWithEvents(t, e, i = []) {
9756
9707
  const r = [], s = await t(...e, r), a = await this.dispatch(r);
9757
9708
  i.push(...r, ...a);
9758
- const o = Xi();
9759
- return o && r.length > 0 && ce(r), o && a.length > 0 && ce(a), s;
9709
+ const o = Hi();
9710
+ return o && r.length > 0 && ne(r), o && a.length > 0 && ne(a), s;
9760
9711
  }
9761
9712
  findRelationByName(...t) {
9762
9713
  return this.queryHandle.findRelationByName(...t);
@@ -9794,8 +9745,8 @@ class Zi {
9794
9745
  return this.db.close();
9795
9746
  }
9796
9747
  }
9797
- var tr = /* @__PURE__ */ ((u) => (u[u.ERROR = 0] = "ERROR", u[u.INFO = 1] = "INFO", u))(tr || {});
9798
- class Yt {
9748
+ var Gi = /* @__PURE__ */ ((u) => (u[u.ERROR = 0] = "ERROR", u[u.INFO = 1] = "INFO", u))(Gi || {});
9749
+ class zt {
9799
9750
  constructor(t = 0) {
9800
9751
  this.level = t;
9801
9752
  }
@@ -9806,11 +9757,11 @@ class Yt {
9806
9757
  this.level >= 0 && console.error({ type: t, name: e, sql: i, params: r, error: s });
9807
9758
  }
9808
9759
  child() {
9809
- return new Yt(this.level);
9760
+ return new zt(this.level);
9810
9761
  }
9811
9762
  }
9812
- var er = /* @__PURE__ */ ((u) => (u[u.MUTE = -1] = "MUTE", u[u.ERROR = 0] = "ERROR", u[u.INFO = 1] = "INFO", u[u.DEBUG = 2] = "DEBUG", u))(er || {});
9813
- class Zt {
9763
+ var Xi = /* @__PURE__ */ ((u) => (u[u.MUTE = -1] = "MUTE", u[u.ERROR = 0] = "ERROR", u[u.INFO = 1] = "INFO", u[u.DEBUG = 2] = "DEBUG", u))(Xi || {});
9764
+ class Yt {
9814
9765
  constructor(t = 0) {
9815
9766
  this.level = t;
9816
9767
  }
@@ -9824,16 +9775,16 @@ class Zt {
9824
9775
  this.level >= 2 && console.debug(`[DEBUG] ${t}: ${e}`, i);
9825
9776
  }
9826
9777
  child(t) {
9827
- return new Zt(this.level);
9778
+ return new Yt(this.level);
9828
9779
  }
9829
9780
  }
9830
- const Er = new Yt(), ir = new Zt();
9831
- class Ir {
9832
- constructor(t, e = ir) {
9833
- this.logger = e, this.conceptClass = /* @__PURE__ */ new Map(), this.storage = new Zi(t);
9781
+ const Nr = new zt(), zi = new Yt();
9782
+ class vr {
9783
+ constructor(t, e = zi) {
9784
+ this.logger = e, this.conceptClass = /* @__PURE__ */ new Map(), this.storage = new Ki(t);
9834
9785
  }
9835
9786
  setup(t, e, i, r = !1) {
9836
- const s = new me(t, e), { entities: a, relations: o } = s.getAll();
9787
+ const s = new fe(t, e), { entities: a, relations: o } = s.getAll();
9837
9788
  return i.forEach(({ dataContext: n, state: c }) => {
9838
9789
  Object.entries(c).forEach(([l, d]) => {
9839
9790
  if (d instanceof E) {
@@ -9859,7 +9810,7 @@ class Ir {
9859
9810
  }
9860
9811
  });
9861
9812
  }), this.storage.setup(
9862
- [...a, ni, oi],
9813
+ [...a, ii, ei],
9863
9814
  o,
9864
9815
  r
9865
9816
  );
@@ -9869,171 +9820,170 @@ class Ir {
9869
9820
  }
9870
9821
  }
9871
9822
  export {
9872
- gt as ACTIVITY_RECORD,
9873
- Le as ALL_ATTR_SYMBOL,
9874
- xt as ASYNC_TASK_RECORD,
9875
- kt as Action,
9876
- qt as Activity,
9823
+ yt as ACTIVITY_RECORD,
9824
+ Fe as ALL_ATTR_SYMBOL,
9825
+ Ct as ASYNC_TASK_RECORD,
9826
+ vt as Action,
9827
+ Lt as Activity,
9877
9828
  Y as ActivityCall,
9878
9829
  Z as ActivityGroup,
9879
- Ki as ActivityInteractionRelation,
9880
- Gi as ActivityManager,
9881
- ke as ActivityStateEntity,
9830
+ Wi as ActivityInteractionRelation,
9831
+ Ji as ActivityManager,
9832
+ ve as ActivityStateEntity,
9882
9833
  ut as Any,
9883
- vi as AnyHandles,
9834
+ gi as AnyHandles,
9884
9835
  _ as AttributeInfo,
9885
9836
  C as AttributeQuery,
9886
9837
  U as Attributive,
9887
- vt as Attributives,
9838
+ Nt as Attributives,
9888
9839
  ct as Average,
9889
- Di as AverageHandles,
9890
- ur as BaseKlass,
9840
+ Mi as AverageHandles,
9841
+ ar as BaseKlass,
9891
9842
  it as BoolAtomData,
9892
9843
  R as BoolExp,
9893
9844
  rt as BoolExpressionData,
9894
9845
  J as ComputationDataDepError,
9895
9846
  V as ComputationError,
9896
9847
  S as ComputationResult,
9897
- be as ComputationResultAsync,
9898
- ge as ComputationResultFullRecompute,
9899
- Re as ComputationResultResolved,
9900
- wt as ComputationResultSkip,
9901
- ae as ComputationStateError,
9902
- Bt as Condition,
9848
+ ge as ComputationResultAsync,
9849
+ ye as ComputationResultFullRecompute,
9850
+ be as ComputationResultResolved,
9851
+ Rt as ComputationResultSkip,
9852
+ se as ComputationStateError,
9853
+ qt as Condition,
9903
9854
  F as ConditionError,
9904
- At as Conditions,
9905
- Sr as Controller,
9855
+ Tt as Conditions,
9856
+ wr as Controller,
9906
9857
  ot as Count,
9907
- Ai as CountHandles,
9908
- Gt as Custom,
9909
- Bi as CustomHandles,
9910
- Yt as DBConsoleLogger,
9911
- tr as DBLogLevel,
9912
- ai as DBSetup,
9913
- kr as DELETED_STATE,
9858
+ wi as CountHandles,
9859
+ Kt as Custom,
9860
+ Di as CustomHandles,
9861
+ zt as DBConsoleLogger,
9862
+ Gi as DBLogLevel,
9863
+ ti as DBSetup,
9864
+ gr as DELETED_STATE,
9914
9865
  q as DICTIONARY_RECORD,
9915
- _t as DataAttributive,
9916
- Kt as DataAttributives,
9917
- fe as DataPolicy,
9918
- Qt as Dictionary,
9919
- ni as DictionaryEntity,
9866
+ Bt as DataAttributive,
9867
+ Ut as DataAttributives,
9868
+ pe as DataPolicy,
9869
+ Vt as Dictionary,
9870
+ ii as DictionaryEntity,
9920
9871
  I as Entity,
9921
- Qi as EntityCustomHandle,
9922
- He as EntityQueryHandle,
9923
- je as EntityToTableMap,
9924
- Xt as Equation,
9925
- Wt as Event,
9872
+ $i as EntityCustomHandle,
9873
+ qe as EntityQueryHandle,
9874
+ Be as EntityToTableMap,
9875
+ Gt as Equation,
9876
+ _t as Event,
9926
9877
  lt as Every,
9927
- Ri as EveryHandles,
9878
+ fi as EveryHandles,
9928
9879
  M as Expression,
9929
9880
  tt as Gateway,
9930
- De as GetAction,
9931
- wi as GlobalAnyHandle,
9932
- Fi as GlobalAverageHandle,
9881
+ Me as GetAction,
9882
+ mi as GlobalAnyHandle,
9883
+ Ci as GlobalAverageHandle,
9933
9884
  B as GlobalBoundState,
9934
- ki as GlobalCountHandle,
9935
- Vi as GlobalCustomHandle,
9936
- gi as GlobalEveryHandle,
9937
- Ii as GlobalRealTimeComputation,
9938
- di as GlobalStateMachineHandle,
9939
- Mi as GlobalSumHandle,
9940
- fi as GlobalWeightedSummationHandle,
9941
- Ot as HARD_DELETION_PROPERTY_NAME,
9942
- Ar as HardDeletionProperty,
9943
- ie as ID_ATTR,
9944
- Ft as INTERACTION_RECORD,
9945
- Nt as Inequality,
9946
- Lt as Interaction,
9947
- Ne as InteractionCall,
9948
- ve as InteractionEventEntity,
9949
- Dt as KlassByName,
9885
+ bi as GlobalCountHandle,
9886
+ Pi as GlobalCustomHandle,
9887
+ hi as GlobalEveryHandle,
9888
+ ki as GlobalRealTimeComputation,
9889
+ oi as GlobalStateMachineHandle,
9890
+ Si as GlobalSumHandle,
9891
+ li as GlobalWeightedSummationHandle,
9892
+ Ft as HARD_DELETION_PROPERTY_NAME,
9893
+ Rr as HardDeletionProperty,
9894
+ ee as ID_ATTR,
9895
+ $t as INTERACTION_RECORD,
9896
+ wt as Inequality,
9897
+ Qt as Interaction,
9898
+ we as InteractionCall,
9899
+ Ne as InteractionEventEntity,
9900
+ Ot as KlassByName,
9950
9901
  f as LINK_SYMBOL,
9951
- Rt as LinkInfo,
9902
+ bt as LinkInfo,
9952
9903
  m as MatchExp,
9953
- Qe as Modifier,
9954
- Ir as MonoSystem,
9955
- vr as NON_DELETED_STATE,
9956
- Nr as NON_EXIST_STATE,
9904
+ $e as Modifier,
9905
+ vr as MonoSystem,
9906
+ yr as NON_DELETED_STATE,
9907
+ mr as NON_EXIST_STATE,
9957
9908
  Q as NewRecordData,
9958
- gr as PHASE_AFTER_ALL,
9959
- yr as PHASE_BEFORE_ALL,
9960
- It as PHASE_NORMAL,
9961
- jt as Payload,
9962
- Ht as PayloadItem,
9909
+ dr as PHASE_AFTER_ALL,
9910
+ ur as PHASE_BEFORE_ALL,
9911
+ Et as PHASE_NORMAL,
9912
+ Ht as Payload,
9913
+ Jt as PayloadItem,
9963
9914
  v as Property,
9964
- Ni as PropertyAnyHandle,
9965
- Oi as PropertyAverageHandle,
9966
- Ti as PropertyCountHandle,
9967
- qi as PropertyCustomHandle,
9968
- bi as PropertyEveryHandle,
9969
- Ci as PropertyRealTimeComputation,
9970
- hi as PropertyStateMachineHandle,
9971
- Pi as PropertySumHandle,
9972
- Vt as PropertyTypes,
9973
- mi as PropertyWeightedSummationHandle,
9974
- ye as ROOT_LABEL,
9975
- re as ROW_ID_ATTR,
9915
+ yi as PropertyAnyHandle,
9916
+ xi as PropertyAverageHandle,
9917
+ Ri as PropertyCountHandle,
9918
+ Oi as PropertyCustomHandle,
9919
+ pi as PropertyEveryHandle,
9920
+ Ti as PropertyRealTimeComputation,
9921
+ ni as PropertyStateMachineHandle,
9922
+ Ei as PropertySumHandle,
9923
+ Dt as PropertyTypes,
9924
+ ui as PropertyWeightedSummationHandle,
9925
+ me as ROOT_LABEL,
9926
+ ie as ROW_ID_ATTR,
9976
9927
  dt as RealTime,
9977
- xi as RealTimeHandles,
9928
+ Ai as RealTimeHandles,
9978
9929
  E as RecordBoundState,
9979
9930
  et as RecordInfo,
9980
- Te as RecordMutationSideEffect,
9931
+ ke as RecordMutationSideEffect,
9981
9932
  x as RecordQuery,
9982
- Je as RecordQueryAgent,
9933
+ Le as RecordQueryAgent,
9983
9934
  L as RecordQueryTree,
9984
- Si as RecordsTransformHandle,
9985
- bt as RecursiveContext,
9986
- me as RefContainer,
9935
+ Ni as RecordsTransformHandle,
9936
+ gt as RecursiveContext,
9937
+ fe as RefContainer,
9987
9938
  P as Relation,
9988
- Li as RelationCustomHandle,
9939
+ Fi as RelationCustomHandle,
9989
9940
  X as SYSTEM_RECORD,
9990
- Wi as Scheduler,
9991
- Ut as SideEffect,
9941
+ Qi as Scheduler,
9942
+ jt as SideEffect,
9992
9943
  st as StateMachine,
9993
- pi as StateMachineHandles,
9944
+ ci as StateMachineHandles,
9994
9945
  K as StateNode,
9995
- Jt as StateTransfer,
9946
+ Wt as StateTransfer,
9996
9947
  nt as Summation,
9997
- $i as SummationHandles,
9998
- Zt as SystemConsoleLogger,
9999
- oi as SystemEntity,
10000
- er as SystemLogLevel,
10001
- he as Transfer,
10002
- Tt as Transform,
10003
- Ei as TransformHandles,
10004
- Tr as USER_ENTITY,
9948
+ Ii as SummationHandles,
9949
+ Yt as SystemConsoleLogger,
9950
+ ei as SystemEntity,
9951
+ Xi as SystemLogLevel,
9952
+ de as Transfer,
9953
+ kt as Transform,
9954
+ vi as TransformHandles,
9955
+ br as USER_ENTITY,
10005
9956
  at as WeightedSummation,
10006
- yi as WeightedSummationHandles,
10007
- ce as addToCurrentEffects,
9957
+ di as WeightedSummationHandles,
9958
+ ne as addToCurrentEffects,
10008
9959
  T as assert,
10009
- zt as asyncEffectsContext,
10010
- ne as asyncInteractionContext,
10011
- fr as boolExpToAttributives,
10012
- ar as clearAllInstances,
10013
- lr as createClass,
10014
- Ce as createInstances,
10015
- cr as createInstancesFromString,
10016
- mr as createUserRoleAttributive,
10017
- Er as dbConsoleLogger,
9960
+ Xt as asyncEffectsContext,
9961
+ oe as asyncInteractionContext,
9962
+ cr as boolExpToAttributives,
9963
+ tr as clearAllInstances,
9964
+ sr as createClass,
9965
+ Se as createInstances,
9966
+ rr as createInstancesFromString,
9967
+ lr as createUserRoleAttributive,
9968
+ Nr as dbConsoleLogger,
10018
9969
  mt as deepClone,
10019
- wr as everyAsync,
10020
- ui as everyWithErrorAsync,
10021
- br as filterMap,
10022
- hr as findRootActivity,
10023
- pe as forEachInteraction,
9970
+ fr as everyAsync,
9971
+ ai as everyWithErrorAsync,
9972
+ hr as filterMap,
9973
+ nr as findRootActivity,
9974
+ he as forEachInteraction,
10024
9975
  k as generateUUID,
10025
- Xi as getCurrentEffects,
10026
- dr as getInteractions,
10027
- Ee as indexBy,
10028
- ue as isObject,
10029
- de as isPlainObject,
10030
- Rr as mapObject,
10031
- pr as parse,
10032
- Ie as registerKlass,
10033
- or as removeAllInstance,
10034
- li as someAsync,
10035
- nr as stringifyAllInstances,
9976
+ Hi as getCurrentEffects,
9977
+ or as getInteractions,
9978
+ Zi as indexBy,
9979
+ le as isObject,
9980
+ ue as isPlainObject,
9981
+ pr as mapObject,
9982
+ Ae as registerKlass,
9983
+ er as removeAllInstance,
9984
+ si as someAsync,
9985
+ ir as stringifyAllInstances,
10036
9986
  w as stringifyAttribute,
10037
- ir as systemConsoleLogger
9987
+ zi as systemConsoleLogger
10038
9988
  };
10039
9989
  //# sourceMappingURL=index.js.map