@yuneta/gobj-js 7.7.1 → 7.7.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/gobj-js.cjs.js +15 -6
- package/dist/gobj-js.cjs.js.map +1 -1
- package/dist/gobj-js.cjs.min.js +60 -56
- package/dist/gobj-js.cjs.min.js.map +1 -1
- package/dist/gobj-js.es.js +15 -6
- package/dist/gobj-js.es.js.map +1 -1
- package/dist/gobj-js.es.min.js +63 -59
- package/dist/gobj-js.es.min.js.map +1 -1
- package/dist/gobj-js.iife.js +15 -6
- package/dist/gobj-js.iife.js.map +1 -1
- package/dist/gobj-js.iife.min.js +75 -71
- package/dist/gobj-js.iife.min.js.map +1 -1
- package/dist/gobj-js.umd.js +15 -6
- package/dist/gobj-js.umd.js.map +1 -1
- package/dist/gobj-js.umd.min.js +519 -515
- package/dist/gobj-js.umd.min.js.map +1 -1
- package/package.json +2 -3
package/dist/gobj-js.es.min.js
CHANGED
|
@@ -173,11 +173,11 @@ var O = class {
|
|
|
173
173
|
constructor(e, t, n = 0, r = null, l = "", i = null, o = null, s = 0, a = null, u = null, _ = null) {
|
|
174
174
|
this.type = e, this.name = t, this.alias = i, this.flag = n, this.default_value = r, this.header = o, this.fillspace = s, this.description = l, this.json_fn = a, this.schema = u, this.authpth = _;
|
|
175
175
|
}
|
|
176
|
-
}, v = () => new O(0, null), N = (e, t, n, r, l) => new O(e, t, n, r, l), w = (e, t, n, r, l, i) => new O(e, t, 0, null, i, n, null, 0, l, r, null), D = (e, t, n, r, l, i, o) => new O(e, t, n, null, o, r, null, 0, i, l, null), R = (e, t, n, r, l) => new O(e, t, n, r, l), j = (e, t, n, r, l, i) => new O(e, t, n, null, i, r, null, 0, null, l, null), $ = (e, t, n, r, l) => new O(e, t, n, null, l, null, null, 0, null, null, r), I = (e, t, n, r, l, i) => new O(e, t, n, null, i, null, r, l),
|
|
176
|
+
}, v = () => new O(0, null), N = (e, t, n, r, l) => new O(e, t, n, r, l), w = (e, t, n, r, l, i) => new O(e, t, 0, null, i, n, null, 0, l, r, null), D = (e, t, n, r, l, i, o) => new O(e, t, n, null, o, r, null, 0, i, l, null), R = (e, t, n, r, l) => new O(e, t, n, r, l), j = (e, t, n, r, l, i) => new O(e, t, n, null, i, r, null, 0, null, l, null), $ = (e, t, n, r, l) => new O(e, t, n, null, l, null, null, 0, null, null, r), I = (e, t, n, r, l, i) => new O(e, t, n, null, i, null, r, l), k = class {
|
|
177
177
|
constructor(e, t, n, r, l, i, o, s, a) {
|
|
178
178
|
this.gclass_name = e, this.dl_states = [], this.dl_events = [], this.gmt = t, this.lmt = n, this.attrs_table = r, this.priv = l, this.authz_table = i, this.command_table = o, this.s_user_trace_level = s, this.gclass_flag = Number(a) || 0, this.instances = 0, this.trace_level = 0, this.no_trace_level = 0, this.jn_trace_filter = null, this.fsm_checked = !1;
|
|
179
179
|
}
|
|
180
|
-
},
|
|
180
|
+
}, A = class {
|
|
181
181
|
constructor(e, t, n, r, l) {
|
|
182
182
|
this.__refs__ = 0, this.gclass = t, this.parent = null, this.dl_children = [], this.dl_subscriptions = [], this.dl_subscribings = [], this.current_state = t.dl_states[0], this.last_state = null, this.obflag = 0, this.gobj_flag = Number(l) || 0, this.gobj_name = e, this.jn_attrs = null, this.jn_stats = {}, this.jn_user_data = {}, this.full_name = null, this.short_name = null, this.priv = En(t.priv), this.running = !1, this.playing = !1, this.disabled = !1, this.bottom_gobj = null, this.trace_level = 0, this.no_trace_level = 0;
|
|
183
183
|
}
|
|
@@ -354,7 +354,7 @@ function X(e, t, n) {
|
|
|
354
354
|
return mt(e, t) ? z(e) : e && e.bottom_gobj ? X(e.bottom_gobj, t, n) : (n && fn(`GClass Attribute NOT FOUND: ${Xe(e)}, attr ${t}`), null);
|
|
355
355
|
}
|
|
356
356
|
function H(e, t, n) {
|
|
357
|
-
if (!(e && e instanceof
|
|
357
|
+
if (!(e && e instanceof k)) return n && fn("gclass NULL"), null;
|
|
358
358
|
if (!t) return e.attrs_table;
|
|
359
359
|
for (let n = 0; n < e.attrs_table.length; n++) {
|
|
360
360
|
const r = e.attrs_table[n];
|
|
@@ -366,9 +366,9 @@ function Z(e, t, n, r, l, i, o, s, a, u, _) {
|
|
|
366
366
|
if (xn(e)) return fn("gclass_name EMPTY"), null;
|
|
367
367
|
if (e.includes("`") || e.includes("^") || e.includes(".")) return fn(`GClass name CANNOT have '.' or '^' or '\`' char: ${e}`), null;
|
|
368
368
|
if (ue(e)) return fn(`GClass ALREADY exists: ${e}`), null;
|
|
369
|
-
let c = new
|
|
369
|
+
let c = new k(e, r, l, i, o, s, a, u, _);
|
|
370
370
|
(function(e, t) {
|
|
371
|
-
e && e instanceof
|
|
371
|
+
e && e instanceof k ? t ? p[t] ? fn(`gclass ALREADY REGISTERED: ${t}`) : p[t] = e : fn("gclass_name undefined") : fn("gclass undefined");
|
|
372
372
|
})(c, e);
|
|
373
373
|
const f = n.length;
|
|
374
374
|
for (let e = 0; e < f; e++) {
|
|
@@ -398,7 +398,7 @@ function ee(e) {
|
|
|
398
398
|
let t;
|
|
399
399
|
if (Cn(e)) t = e;
|
|
400
400
|
else {
|
|
401
|
-
if (!(e instanceof
|
|
401
|
+
if (!(e instanceof k)) return fn("Cannot unregister gclass, type unknown"), -1;
|
|
402
402
|
t = e.gclass_name;
|
|
403
403
|
}
|
|
404
404
|
let n = p[t];
|
|
@@ -421,10 +421,10 @@ function ne(e, t) {
|
|
|
421
421
|
return null;
|
|
422
422
|
}
|
|
423
423
|
function re(e, t) {
|
|
424
|
-
return e instanceof
|
|
424
|
+
return e instanceof k ? te(e, t) ? (fn(`state already exists: ${t}`), -1) : (e.dl_states.push(new V(t)), 0) : (fn("Cannot add state, typeof not GClass"), -1);
|
|
425
425
|
}
|
|
426
426
|
function le(e, t, n, r, l) {
|
|
427
|
-
if (!(e instanceof
|
|
427
|
+
if (!(e instanceof k)) return fn("Cannot add state, typeof not GClass"), -1;
|
|
428
428
|
if (xn(t)) return fn("state_name EMPTY"), -1;
|
|
429
429
|
let i = te(e, t);
|
|
430
430
|
return i ? ne(i, n) ? (fn(`event already exists: gclass ${e.gclass_name}, state ${t}, event ${n}`), -1) : (i.dl_actions.push(new G(n, r, l)), 0) : (fn(`state not found: ${t}`), -1);
|
|
@@ -433,10 +433,10 @@ function ie(e, t, n) {
|
|
|
433
433
|
xn(t) || e.push(new W(t, n));
|
|
434
434
|
}
|
|
435
435
|
function oe(e, t, n) {
|
|
436
|
-
return e instanceof
|
|
436
|
+
return e instanceof k ? ie(e.dl_events, t, n) : (fn("Cannot add state, typeof not GClass"), -1);
|
|
437
437
|
}
|
|
438
438
|
function se(e, t) {
|
|
439
|
-
if (!(e instanceof
|
|
439
|
+
if (!(e instanceof k)) return fn("Cannot add state, typeof not GClass"), 0;
|
|
440
440
|
const n = e.dl_events.length, r = e.dl_events;
|
|
441
441
|
for (let e = 0; e < n; e++) {
|
|
442
442
|
let n = r[e];
|
|
@@ -445,9 +445,9 @@ function se(e, t) {
|
|
|
445
445
|
return null;
|
|
446
446
|
}
|
|
447
447
|
function ae(e) {
|
|
448
|
-
if (!(e instanceof
|
|
448
|
+
if (!(e instanceof k)) return fn("Cannot add state, typeof not GClass"), -1;
|
|
449
449
|
let t = 0;
|
|
450
|
-
|
|
450
|
+
An(e.dl_states) || (fn(`GClass without states: ${e.gclass_name}`), t += -1);
|
|
451
451
|
for (let n = 0; n < e.dl_states.length; n++) {
|
|
452
452
|
let r = e.dl_states[n];
|
|
453
453
|
if (!xn(r.state_name)) for (let n = 0; n < r.dl_actions.length; n++) {
|
|
@@ -532,7 +532,7 @@ function Se(e, n, r, l, i) {
|
|
|
532
532
|
i |= P.gobj_flag_service;
|
|
533
533
|
} else {
|
|
534
534
|
if (!l) return fn("gobj NEEDS a parent!"), null;
|
|
535
|
-
if (!("string" == typeof l || l instanceof
|
|
535
|
+
if (!("string" == typeof l || l instanceof A)) return fn(`BAD TYPE of parent: ${l}`), null;
|
|
536
536
|
if (Cn(l) && !(l = fe(l))) return gn(`parent service not found: ${l}`), null;
|
|
537
537
|
}
|
|
538
538
|
if (i & P.gobj_flag_service && fe(e, !1)) return fn(`service ALREADY registered: ${n}^${e}`), null;
|
|
@@ -548,7 +548,7 @@ function Se(e, n, r, l, i) {
|
|
|
548
548
|
if (e.includes("`")) return fn(`gobj_name cannot contain char ': ${n}^${e}`), null;
|
|
549
549
|
if (e.includes("^")) return fn(`gobj_name cannot contain char ^: ${n}^${e}`), null;
|
|
550
550
|
}
|
|
551
|
-
let s = new
|
|
551
|
+
let s = new A(e, o, r, l, i);
|
|
552
552
|
s.jn_attrs = J(s, o.attrs_table);
|
|
553
553
|
for (const [e, t] of Object.entries(s.jn_attrs)) e in s.priv && (s.priv[e] = t);
|
|
554
554
|
let a = E && Tt(E, "trace_creation");
|
|
@@ -600,14 +600,14 @@ function $e(e) {
|
|
|
600
600
|
function Ie(e, t, n) {
|
|
601
601
|
return e.gclass.gclass_flag & L.gcflag_manual_start || nt(e) || We(e) || Me(e) || $e(e), 0;
|
|
602
602
|
}
|
|
603
|
-
function
|
|
603
|
+
function ke(e) {
|
|
604
604
|
return nt(e) ? (fn("gobj NULL or DESTROYED"), -1) : ot(e, F.WALK_FIRST2LAST, Ie, 0, 0);
|
|
605
605
|
}
|
|
606
|
-
function
|
|
606
|
+
function Ae(e, t, n) {
|
|
607
607
|
return e.gclass.gclass_flag & L.gcflag_manual_start || Me(e) ? 1 : (We(e) || $e(e), 0);
|
|
608
608
|
}
|
|
609
609
|
function Le(e) {
|
|
610
|
-
return nt(e) ? (fn("gobj NULL or DESTROYED"), -1) : (E && Tt(E, "trace_start_stop") && x(t("⏺ ⏺ ⏺ ⏺ start_tree: %s", He(e))), e.gclass.gclass_flag & L.gcflag_manual_start || e.disabled ? 0 : (e.running || $e(e), st(e, F.WALK_TOP2BOTTOM,
|
|
610
|
+
return nt(e) ? (fn("gobj NULL or DESTROYED"), -1) : (E && Tt(E, "trace_start_stop") && x(t("⏺ ⏺ ⏺ ⏺ start_tree: %s", He(e))), e.gclass.gclass_flag & L.gcflag_manual_start || e.disabled ? 0 : (e.running || $e(e), st(e, F.WALK_TOP2BOTTOM, Ae, 0, 0)));
|
|
611
611
|
}
|
|
612
612
|
function Pe(e) {
|
|
613
613
|
if (nt(e)) return fn("gobj NULL or DESTROYED"), -1;
|
|
@@ -926,10 +926,10 @@ function $t(e, t) {
|
|
|
926
926
|
function It(e) {
|
|
927
927
|
return Yn(e) ? e.current_state.state_name : (fn("hgobj NULL"), "");
|
|
928
928
|
}
|
|
929
|
-
function
|
|
930
|
-
return nt(e) ? (fn("gobj NULL or DESTROYED"), null) : n instanceof
|
|
929
|
+
function kt(e, n) {
|
|
930
|
+
return nt(e) ? (fn("gobj NULL or DESTROYED"), null) : n instanceof A ? (e.parent && e.parent.mt_child_removed && e.parent.mt_child_removed(e.parent, e), e.parent && (be(e.parent, e), e.parent = null), de(n, e), n.mt_child_added && (E && Tt(E, "trace_creation") && bn(t("👦👦🔵 child_added(%s): %s", He(n), Xe(e))), n.mt_child_added(n, e)), 0) : (fn(`${Xe(e)}: gobj_change_parent() BAD TYPE of parent`), -1);
|
|
931
931
|
}
|
|
932
|
-
function
|
|
932
|
+
function At(e, t, n) {
|
|
933
933
|
if (!Yn(e)) return fn("gobj NULL of bad type"), null;
|
|
934
934
|
let r = se(e.gclass, t);
|
|
935
935
|
if (r) return r;
|
|
@@ -943,11 +943,11 @@ function kt(e, t, n) {
|
|
|
943
943
|
return null;
|
|
944
944
|
}
|
|
945
945
|
function Lt(e, t, n) {
|
|
946
|
-
let r =
|
|
946
|
+
let r = At(e, t, !1);
|
|
947
947
|
return !!r && !(n && !(r.event_flag & n));
|
|
948
948
|
}
|
|
949
949
|
function Pt(e, t, n) {
|
|
950
|
-
let r =
|
|
950
|
+
let r = At(e, t, !1);
|
|
951
951
|
return !!r && !(n && !(r.event_flag & n)) && !!(r.event_flag & C.EVF_OUTPUT_EVENT);
|
|
952
952
|
}
|
|
953
953
|
function Ut(e, t, n, r) {
|
|
@@ -956,21 +956,21 @@ function Ut(e, t, n, r) {
|
|
|
956
956
|
}, 10);
|
|
957
957
|
}
|
|
958
958
|
function Ct(e, n, r, l) {
|
|
959
|
-
if (!(e && e instanceof
|
|
959
|
+
if (!(e && e instanceof A)) return fn("gobj dst NULL"), -1;
|
|
960
960
|
if (e.obflag & (U.obflag_destroyed | U.obflag_destroying)) return fn("gobj dst DESTROYED"), -1;
|
|
961
961
|
let i = e.current_state;
|
|
962
962
|
if (!i) return fn(`${Xe(e)}: current_state NULL`), -1;
|
|
963
963
|
let o = 0;
|
|
964
964
|
o = E && yt(E, "tracing"), "C_TIMER" === ze(l) && (o = E && yt(E, "trace_timer")), T++;
|
|
965
965
|
let s = ne(i, n);
|
|
966
|
-
if (!s) return e.gclass.gmt.mt_inject_event ? (T--, o && (x(t("🔃 mach(%s%s), st: %s, ev: %s, from(%s%s)", e.running ? "" : "!!", Xe(e), i.state_name, n || "", l && !l.running ? "!!" : "", Xe(l))), r && o > 1 &&
|
|
966
|
+
if (!s) return e.gclass.gmt.mt_inject_event ? (T--, o && (x(t("🔃 mach(%s%s), st: %s, ev: %s, from(%s%s)", e.running ? "" : "!!", Xe(e), i.state_name, n || "", l && !l.running ? "!!" : "", Xe(l))), r && o > 1 && kn(r) && mn(r)), e.gclass.gmt.mt_inject_event(e, n, r, l)) : (o && x(t("📛 mach(%s%s^%s), st: %s, ev: %s, 📛📛ERROR Event NOT DEFINED in state📛📛, from(%s%s^%s)", e.running ? "" : "!!", ze(e), qe(e), i.state_name, n || "", l && !l.running ? "!!" : "", ze(l), qe(l))), fn(`📛📛 Event NOT DEFINED in state 📛📛: ${Xe(e)}, ${i.state_name}, ${n}`), T--, -1);
|
|
967
967
|
if (o) {
|
|
968
968
|
if (1 === M) x(t("🔄 %s %s%s %s from %s%s", n || "", e.running ? "" : "!!", Xe(e), i.state_name, l && !l.running ? "!!" : "", Xe(l)));
|
|
969
969
|
else {
|
|
970
970
|
let r = "";
|
|
971
971
|
s.action && (r = fl(s.action)), x(t("🔄 mach(%s%s^%s), st: %s, ev: %s%s%s, ac: %s, from(%s%s^%s)", e.running ? "" : "!!", ze(e), qe(e), i.state_name, "", n || "", "", r, l && !l.running ? "!!" : "", ze(l), qe(l)));
|
|
972
972
|
}
|
|
973
|
-
r && o > 1 &&
|
|
973
|
+
r && o > 1 && kn(r) && mn(r);
|
|
974
974
|
}
|
|
975
975
|
s.next_state && $t(e, s.next_state);
|
|
976
976
|
let a = -1;
|
|
@@ -1049,7 +1049,7 @@ function Yt(e, n, r, l) {
|
|
|
1049
1049
|
}), xn(n)) n = "";
|
|
1050
1050
|
else if (!(Pt(e, n, C.EVF_OUTPUT_EVENT) || e.gclass.gclass_flag & L.gcflag_no_check_output_events)) return fn(`event NOT in output event list: ${Xe(e)}, ${n}`), 0;
|
|
1051
1051
|
let o = Wt(e.dl_subscriptions, e, n, r, l);
|
|
1052
|
-
|
|
1052
|
+
An(o) > 0 && (fn(`${Xe(e)}: ${An(o)} subscription(s) REPEATED, will be deleted and override`), mn(o, "subscription REPEATED"), Bt(e, o, !1));
|
|
1053
1053
|
let s = function(e, t, n, r) {
|
|
1054
1054
|
let l = J(e, Gt);
|
|
1055
1055
|
Dn(l, "event", t), Dn(l, "subscriber", r), Dn(l, "publisher", e);
|
|
@@ -1116,8 +1116,8 @@ function Qt(e) {
|
|
|
1116
1116
|
return {
|
|
1117
1117
|
subscriptions: t,
|
|
1118
1118
|
subscribings: n,
|
|
1119
|
-
"total subscriptions":
|
|
1120
|
-
total_subscribings:
|
|
1119
|
+
"total subscriptions": An(t),
|
|
1120
|
+
total_subscribings: An(n)
|
|
1121
1121
|
};
|
|
1122
1122
|
}
|
|
1123
1123
|
function qt(e, t, n, r) {
|
|
@@ -1126,7 +1126,7 @@ function qt(e, t, n, r) {
|
|
|
1126
1126
|
function zt(e, n, r) {
|
|
1127
1127
|
if (Pn(r) || (r = {}), !e || e.obflag & (U.obflag_destroyed | U.obflag_destroying)) return fn("gobj NULL or DESTROYED"), -1;
|
|
1128
1128
|
if (xn(n)) return fn(`${Xe(e)}: event EMPTY`), -1;
|
|
1129
|
-
let l =
|
|
1129
|
+
let l = At(e, n, !0);
|
|
1130
1130
|
if (!(l && l.event_flag & (C.EVF_SYSTEM_EVENT | C.EVF_OUTPUT_EVENT) || e.gclass.gclass_flag & L.gcflag_no_check_output_events)) return fn(`event NOT in output event list: ${Xe(e)}, ev ${n}`), -1;
|
|
1131
1131
|
let i = E && Tt(E, "trace_subscriptions");
|
|
1132
1132
|
if (i && (x(t("🔝🔝 mach(%s%s^%s), st: %s, ev: %s%s%s", e.running ? "" : "!!", ze(e), qe(e), e.current_state.state_name, "", n || "", "")), mn(r)), e.gclass.gmt.mt_publish_event) {
|
|
@@ -1149,7 +1149,7 @@ function zt(e, n, r) {
|
|
|
1149
1149
|
let l = ur(e, u, "__global__", null, 0), o = ur(e, u, "__local__", null, 0), f = _r(e, u, "__filter__", null, 0), g = r, d = 1;
|
|
1150
1150
|
if (e.gclass.gmt.mt_publication_filter ? d = e.gclass.gmt.mt_publication_filter(e, n, g, _) : Ln(f) > 0 && (d = br(g, f), i && (x(t("💜💜🔄%s publishing with filter, event '%s', subscriber'%s', publisher %s", d ? "👍" : "👎", n || "", Xe(_), Xe(e))), mn(f))), d < 0) break;
|
|
1151
1151
|
if (0 === d) continue;
|
|
1152
|
-
let b =
|
|
1152
|
+
let b = At(_, n, !0);
|
|
1153
1153
|
if (b && b.event_flag & C.EVF_SYSTEM_EVENT && !Lt(_, b.event_name, 0)) continue;
|
|
1154
1154
|
o && er(g, o), l && yn(g, l), i && (x(t("🔝🔄 mach(%s%s), st: %s, ev: %s, from(%s%s)", _.running ? "" : "!!", Xe(_), It(_), n || "", e && !e.running ? "!!" : "", Xe(e))), mn(g));
|
|
1155
1155
|
let p = Ct(_, n, g, e);
|
|
@@ -1322,10 +1322,10 @@ function $n(e, t) {
|
|
|
1322
1322
|
function In(e, t) {
|
|
1323
1323
|
return t ? (Array.prototype.push.apply(e, t), e) : e;
|
|
1324
1324
|
}
|
|
1325
|
-
function
|
|
1325
|
+
function kn(e) {
|
|
1326
1326
|
return Pn(e) ? Object.keys(e).length : 0;
|
|
1327
1327
|
}
|
|
1328
|
-
function
|
|
1328
|
+
function An(e) {
|
|
1329
1329
|
return Un(e) ? e.length : 0;
|
|
1330
1330
|
}
|
|
1331
1331
|
function Ln(e) {
|
|
@@ -1362,7 +1362,7 @@ function Kn(e) {
|
|
|
1362
1362
|
return "function" == typeof e;
|
|
1363
1363
|
}
|
|
1364
1364
|
function Yn(e) {
|
|
1365
|
-
return e instanceof
|
|
1365
|
+
return e instanceof A;
|
|
1366
1366
|
}
|
|
1367
1367
|
function xn(e) {
|
|
1368
1368
|
return !Cn(e) || 0 === e.length;
|
|
@@ -1626,9 +1626,9 @@ function hr(e, t, n, r) {
|
|
|
1626
1626
|
if (Cn(n) && !xn(n)) {
|
|
1627
1627
|
let i = n;
|
|
1628
1628
|
t.hasOwnProperty(i) ? l[i] = t[i] : r && fn(`${Xe(e)}: key not found: ${i}`);
|
|
1629
|
-
} else if (Pn(n) &&
|
|
1629
|
+
} else if (Pn(n) && kn(n) > 0) for (let i of Object.keys(n)) t.hasOwnProperty(i) ? l[i] = t[i] : r && fn(`${Xe(e)}: key not found: ${i}`);
|
|
1630
1630
|
else {
|
|
1631
|
-
if (!(Un(n) &&
|
|
1631
|
+
if (!(Un(n) && An(n) > 0)) return t;
|
|
1632
1632
|
for (let i = 0; i < n.length; i++) {
|
|
1633
1633
|
let o = n[i];
|
|
1634
1634
|
t.hasOwnProperty(o) ? l[o] = t[o] : r && fn(`${Xe(e)}: key not found: ${o}`);
|
|
@@ -1641,9 +1641,9 @@ function Tr(e, t, n, r) {
|
|
|
1641
1641
|
if (yn(l, t), Cn(n) && !xn(n)) {
|
|
1642
1642
|
let i = n;
|
|
1643
1643
|
_r(e, t, i, 0, 0) ? Nn(l, i) : r && fn(`${Xe(e)}: key not found: ${i}`);
|
|
1644
|
-
} else if (Pn(n) &&
|
|
1644
|
+
} else if (Pn(n) && kn(n) > 0) for (let i of Object.keys(n)) t.hasOwnProperty(i) ? Nn(l, i) : r && fn(`${Xe(e)}: key not found: ${i}`);
|
|
1645
1645
|
else {
|
|
1646
|
-
if (!(Un(n) &&
|
|
1646
|
+
if (!(Un(n) && An(n) > 0)) return {};
|
|
1647
1647
|
for (let i = 0; i < n.length; i++) {
|
|
1648
1648
|
let o = n[i];
|
|
1649
1649
|
t.hasOwnProperty(o) ? Nn(l, o) : r && fn(`${Xe(e)}: key not found: ${o}`);
|
|
@@ -1712,9 +1712,9 @@ function wr(e, t, n) {
|
|
|
1712
1712
|
e && !Yn(e) && fn("GObj bad instanceof");
|
|
1713
1713
|
let r = {};
|
|
1714
1714
|
if (xn(n) || (t = nr(e, t, n)), Pn(t)) r = t;
|
|
1715
|
-
else if (Un(t)) for (let
|
|
1716
|
-
let
|
|
1717
|
-
xn(
|
|
1715
|
+
else if (Un(t)) for (let n = 0; n < t.length; n++) {
|
|
1716
|
+
let l = t[n], i = sr(e, l, "id", "", 0);
|
|
1717
|
+
xn(i) || (r[i] = l);
|
|
1718
1718
|
}
|
|
1719
1719
|
else fn(`${Xe(e)} kwid_new_dict: data type unknown`);
|
|
1720
1720
|
return r;
|
|
@@ -1792,13 +1792,13 @@ function Ir(e, t, n) {
|
|
|
1792
1792
|
} else for (let n = 0; n < r; n++) if (e[n] === t) return !0;
|
|
1793
1793
|
return !1;
|
|
1794
1794
|
}
|
|
1795
|
-
function
|
|
1795
|
+
function kr(e, t, n) {
|
|
1796
1796
|
if (!e) return fn("ERROR: strs_in_list() list empty"), !1;
|
|
1797
1797
|
if (!t) return fn("ERROR: strs_in_list() str empty"), !1;
|
|
1798
1798
|
for (let r = 0; r < t.length; r++) if (Ir(e, t[r], n)) return !0;
|
|
1799
1799
|
return !1;
|
|
1800
1800
|
}
|
|
1801
|
-
function
|
|
1801
|
+
function Ar(e, t) {
|
|
1802
1802
|
for (let n = 0; n < e.length; n++) if (t === e[n]) return e.splice(n, 1), !0;
|
|
1803
1803
|
return !1;
|
|
1804
1804
|
}
|
|
@@ -2121,7 +2121,7 @@ function ml(e, t) {
|
|
|
2121
2121
|
}
|
|
2122
2122
|
function El(e, t) {
|
|
2123
2123
|
let n = Tr(e, yr(bl(e), null, !1), t, !1);
|
|
2124
|
-
0 ===
|
|
2124
|
+
0 === kn(n) ? Or(bl(e)) : Sr(bl(e), n);
|
|
2125
2125
|
}
|
|
2126
2126
|
function hl(e, t) {
|
|
2127
2127
|
let n = yr(bl(e), null, !1), r = {};
|
|
@@ -2138,7 +2138,7 @@ function yl(e, t) {
|
|
|
2138
2138
|
if (Cn(t)) {
|
|
2139
2139
|
if (-1 === t.indexOf("^")) {
|
|
2140
2140
|
let n, r, l = e.fkey;
|
|
2141
|
-
if (1 !==
|
|
2141
|
+
if (1 !== kn(l)) return fn("bad fkey 1"), fn(e), fn(t), null;
|
|
2142
2142
|
for (const e of Object.keys(l)) {
|
|
2143
2143
|
n = e, r = l[e];
|
|
2144
2144
|
break;
|
|
@@ -2172,7 +2172,7 @@ function Ol(e, t) {
|
|
|
2172
2172
|
if (Cn(t)) {
|
|
2173
2173
|
if (-1 === t.indexOf("^")) {
|
|
2174
2174
|
let n, r = e.hook;
|
|
2175
|
-
if (1 !==
|
|
2175
|
+
if (1 !== kn(r)) return fn("bad hook 1"), fn(e), fn(t), null;
|
|
2176
2176
|
for (let e of Object.keys(r)) {
|
|
2177
2177
|
n = e, r[e];
|
|
2178
2178
|
break;
|
|
@@ -2255,7 +2255,8 @@ function Dl(e) {
|
|
|
2255
2255
|
is_hidden: !1,
|
|
2256
2256
|
default_value: e.default,
|
|
2257
2257
|
placeholder: e.placeholder,
|
|
2258
|
-
fillspace: e.fillspace || 4
|
|
2258
|
+
fillspace: e.fillspace || 4,
|
|
2259
|
+
fkey: e.fkey || null
|
|
2259
2260
|
};
|
|
2260
2261
|
if (!e.flag) return t;
|
|
2261
2262
|
for (let n = 0; n < e.flag.length; n++) {
|
|
@@ -2295,7 +2296,8 @@ function Rl(e, t) {
|
|
|
2295
2296
|
is_writable: !1,
|
|
2296
2297
|
is_hidden: !1,
|
|
2297
2298
|
default_value: void 0,
|
|
2298
|
-
placeholder: void 0
|
|
2299
|
+
placeholder: void 0,
|
|
2300
|
+
fkey: null
|
|
2299
2301
|
};
|
|
2300
2302
|
if (Cn(t)) {
|
|
2301
2303
|
let e = t.split(".");
|
|
@@ -2321,7 +2323,8 @@ function Rl(e, t) {
|
|
|
2321
2323
|
function jl(e, t) {
|
|
2322
2324
|
let n = {};
|
|
2323
2325
|
return t || (t = {}), Object.entries(e).forEach(([e, r]) => {
|
|
2324
|
-
|
|
2326
|
+
let l;
|
|
2327
|
+
Pn(r) && (l = r.default), n[e] = _r(null, t, e, l);
|
|
2325
2328
|
}), n;
|
|
2326
2329
|
}
|
|
2327
2330
|
var $l = [
|
|
@@ -2333,8 +2336,8 @@ var $l = [
|
|
|
2333
2336
|
periodic: !1,
|
|
2334
2337
|
msec: 0,
|
|
2335
2338
|
timer_id: -1
|
|
2336
|
-
},
|
|
2337
|
-
function
|
|
2339
|
+
}, kl = null;
|
|
2340
|
+
function Al(e, t, n, r) {
|
|
2338
2341
|
let l = e.priv, i = l.periodic ? "EV_TIMEOUT_PERIODIC" : "EV_TIMEOUT";
|
|
2339
2342
|
return tt(e) ? Ct(Ze(e), i, {}, e) : zt(e, i, {}), l.periodic && (l.timer_id = setTimeout(function() {
|
|
2340
2343
|
Ct(e, "EV_TIMEOUT", {}, e);
|
|
@@ -2367,13 +2370,13 @@ var Ll = {
|
|
|
2367
2370
|
};
|
|
2368
2371
|
function Pl() {
|
|
2369
2372
|
return function(e) {
|
|
2370
|
-
if (
|
|
2373
|
+
if (kl) return fn(`GClass ALREADY created: ${e}`), -1;
|
|
2371
2374
|
const t = [["ST_IDLE", [[
|
|
2372
2375
|
"EV_TIMEOUT",
|
|
2373
|
-
|
|
2376
|
+
Al,
|
|
2374
2377
|
null
|
|
2375
2378
|
]]]];
|
|
2376
|
-
return (
|
|
2379
|
+
return (kl = Z(e, [
|
|
2377
2380
|
["EV_TIMEOUT", C.EVF_OUTPUT_EVENT],
|
|
2378
2381
|
["EV_TIMEOUT_PERIODIC", C.EVF_OUTPUT_EVENT],
|
|
2379
2382
|
[0, 0]
|
|
@@ -2381,13 +2384,13 @@ function Pl() {
|
|
|
2381
2384
|
}("C_TIMER");
|
|
2382
2385
|
}
|
|
2383
2386
|
function Ul(e, t) {
|
|
2384
|
-
return e instanceof
|
|
2387
|
+
return e instanceof A ? "C_TIMER" !== ze(e) ? (fn("not C_TIMER GObj"), -1) : (Dt(e, "periodic", !1), void Rt(e, "msec", t)) : (fn("not GObj TYPE"), -1);
|
|
2385
2388
|
}
|
|
2386
2389
|
function Cl(e, t) {
|
|
2387
|
-
return e instanceof
|
|
2390
|
+
return e instanceof A ? "C_TIMER" !== ze(e) ? (fn("not C_TIMER GObj"), -1) : (Dt(e, "periodic", !0), void Rt(e, "msec", t)) : (fn("not GObj TYPE"), -1);
|
|
2388
2391
|
}
|
|
2389
2392
|
function Fl(e) {
|
|
2390
|
-
return e instanceof
|
|
2393
|
+
return e instanceof A ? "C_TIMER" !== ze(e) ? (fn("not C_TIMER GObj"), -1) : void Rt(e, "msec", -1) : (fn("not GObj TYPE"), -1);
|
|
2391
2394
|
}
|
|
2392
2395
|
var Gl = [
|
|
2393
2396
|
N(y.DTP_BOOLEAN, "changesLost", 0, !1, "Set true to warn about leaving page"),
|
|
@@ -2531,6 +2534,7 @@ function Zl(e, t, n, r) {
|
|
|
2531
2534
|
let n = St(e, "url"), l = qe(xe()) + " ==> " + n, i = Et(xe(), "trace_ievent_callback");
|
|
2532
2535
|
i ? i(l, t, 1, r.length) : Xl(0, l, t);
|
|
2533
2536
|
}
|
|
2537
|
+
if (!n.websocket || n.websocket.readyState !== WebSocket.OPEN) return gn(`${Xe(e)}: send_iev(): websocket not open, message lost`), -1;
|
|
2534
2538
|
try {
|
|
2535
2539
|
n.websocket.send(r);
|
|
2536
2540
|
} catch (t) {
|
|
@@ -2753,11 +2757,11 @@ var ci = {
|
|
|
2753
2757
|
},
|
|
2754
2758
|
mt_subscription_added: function(e, t) {
|
|
2755
2759
|
let n = e.priv;
|
|
2756
|
-
return "ST_SESSION"
|
|
2760
|
+
return "ST_SESSION" === It(e) && n.websocket ? n.inside_on_open ? 0 : ni(e, t) : 0;
|
|
2757
2761
|
},
|
|
2758
2762
|
mt_subscription_deleted: function(e, t) {
|
|
2759
2763
|
let n = e.priv;
|
|
2760
|
-
if ("ST_SESSION" !== It(e)) return 0;
|
|
2764
|
+
if ("ST_SESSION" !== It(e) || !n.websocket) return 0;
|
|
2761
2765
|
if (n.inside_on_open) return 0;
|
|
2762
2766
|
if (xn(t.event)) return 0;
|
|
2763
2767
|
let r = {}, l = t.__global__, i = t.__config__, o = t.__filter__, s = t.__service__, a = t.subscriber;
|
|
@@ -2860,6 +2864,6 @@ function fi() {
|
|
|
2860
2864
|
], t, ci, 0, Bl, Jl, 0, 0, 0, L.gcflag_no_check_output_events)) ? 0 : -1;
|
|
2861
2865
|
}("C_IEVENT_CLI");
|
|
2862
2866
|
}
|
|
2863
|
-
export {
|
|
2867
|
+
export { A as GObj, N as SDATA, j as SDATAAUTHZ, w as SDATACM, D as SDATACM2, I as SDATADF, R as SDATAPM, $ as SDATAPM0, v as SDATA_END, O as SDataDesc, a as YUNETA_VERSION, E as __yuno__, i as build_command_response, dl as build_path, s as build_stats_response, cl as clean_name, Fl as clear_timeout, zn as cmp_two_simple_json, l as command_parser, nl as createElement2, tl as createOneHtml, zr as create_json_record, jl as create_template_record, sl as current_timestamp, y as data_type_t, hl as db_list_persistent_attrs, pl as db_load_persistent_attrs, El as db_remove_persistent_attrs, ml as db_save_persistent_attrs, gl as debounce, Ar as delete_from_list, hn as duplicate_objects, xn as empty_string, Zr as escapeHtml, C as event_flag_t, le as gclass_add_ev_action, oe as gclass_add_event_type, re as gclass_add_state, ae as gclass_check_fsm, Z as gclass_create, se as gclass_event_type, ue as gclass_find_by_name, L as gclass_flag_t, ee as gclass_unregister, rl as getPositionRelativeToBody, fl as get_function_name, al as get_now, rt as gobj_bottom_gobj, kt as gobj_change_parent, $t as gobj_change_state, Xt as gobj_command, Re as gobj_create, Se as gobj_create2, Ne as gobj_create_default_service, De as gobj_create_pure_child, ve as gobj_create_service, we as gobj_create_volatil, Oe as gobj_create_yuno, It as gobj_current_state, ce as gobj_default_service, je as gobj_destroy, gt as gobj_find_child, ct as gobj_find_gobj, fe as gobj_find_service, qt as gobj_find_subscribings, Jt as gobj_find_subscriptions, P as gobj_flag_t, He as gobj_full_name, ze as gobj_gclass_name, mt as gobj_has_attr, Lt as gobj_has_event, Pt as gobj_has_output_event, z as gobj_hsdata, nt as gobj_is_destroying, Ye as gobj_is_playing, tt as gobj_is_pure_child, We as gobj_is_running, Ke as gobj_is_service, et as gobj_is_volatil, he as gobj_list_persistent_attrs, Qt as gobj_list_subscriptions, pe as gobj_load_persistent_attrs, dt as gobj_match_children, bt as gobj_match_children_tree, ft as gobj_match_gobj, qe as gobj_name, Ze as gobj_parent, Ve as gobj_pause, Ge as gobj_play, Ut as gobj_post_event, zt as gobj_publish_event, Et as gobj_read_attr, ht as gobj_read_attrs, Tt as gobj_read_bool_attr, yt as gobj_read_integer_attr, Ot as gobj_read_pointer_attr, St as gobj_read_str_attr, Ee as gobj_remove_persistent_attrs, Nt as gobj_reset_volatil_attrs, me as gobj_save_persistent_attrs, pt as gobj_search_path, Ct as gobj_send_event, _e as gobj_services, lt as gobj_set_bottom_gobj, K as gobj_set_trace_machine_format, Xe as gobj_short_name, $e as gobj_start, ke as gobj_start_children, Le as gobj_start_tree, B as gobj_start_up, Ht as gobj_stats, Pe as gobj_stop, Ce as gobj_stop_children, Fe as gobj_stop_tree, Yt as gobj_subscribe_event, Y as gobj_trace_machine_format, xt as gobj_unsubscribe_event, Bt as gobj_unsubscribe_list, ot as gobj_walk_gobj_children, st as gobj_walk_gobj_children_tree, vt as gobj_write_attr, wt as gobj_write_attrs, Dt as gobj_write_bool_attr, Rt as gobj_write_integer_attr, jt as gobj_write_str_attr, xe as gobj_yuno, Qe as gobj_yuno_id, Be as gobj_yuno_name, Je as gobj_yuno_role, $r as id_index_in_obj_list, ul as index_in_list, Un as is_array, Gn as is_boolean, Mn as is_date, Kn as is_function, Yn as is_gobj, Hn as is_metadata_key, Vn as is_null, Fn as is_number, Pn as is_object, Zn as is_private_key, Wn as is_pure_number, Cn as is_string, xr as jdb_delete, Jr as jdb_get, Qr as jdb_get_by_idx, Br as jdb_get_topic, Kr as jdb_init, Yr as jdb_update, Rn as json_array_append, jn as json_array_append_new, In as json_array_extend, $n as json_array_remove, An as json_array_size, En as json_deep_copy, Tn as json_is_identical, Nn as json_object_del, vn as json_object_get, wn as json_object_set, Dn as json_object_set_new, kn as json_object_size, yn as json_object_update, Sn as json_object_update_existing, On as json_object_update_missing, Ln as json_size, Hr as jwt2json, Xr as jwtDecode, hr as kw_clone_by_keys, Tr as kw_clone_by_not_keys, Er as kw_collect, rr as kw_delete, pr as kw_find_json_in_list, nr as kw_find_path, Zt as kw_flag_t, lr as kw_get_bool, ur as kw_get_dict, _r as kw_get_dict_value, ir as kw_get_int, cr as kw_get_list, yr as kw_get_local_storage_value, ar as kw_get_pointer, or as kw_get_real, sr as kw_get_str, tr as kw_has_key, br as kw_match_simple, er as kw_pop, Or as kw_remove_local_storage_value, mr as kw_select, fr as kw_set_dict_value, Sr as kw_set_local_storage_value, gr as kw_set_subdict_value, Nr as kwid_collect, Dr as kwid_find_one_record, Rr as kwid_get_ids, vr as kwid_match_id, wr as kwid_new_dict, jr as list2options, Vr as load_json_file, bn as log_debug, fn as log_error, dn as log_info, gn as log_warning, Gr as msg_iev_get_msg_type, Cr as msg_iev_get_stack, Ur as msg_iev_push_stack, Lr as msg_iev_read_key, Fr as msg_iev_set_msg_type, Pr as msg_iev_write_key, _l as node_uuid, Bn as parseBoolean, ll as parseSVG, il as refresh_language, fi as register_c_ievent_cli, Pl as register_c_timer, Yl as register_c_yuno, el as safeSrc, S as sdata_flag_t, Wr as send_http_json_post, sn as set_log_callback, _n as set_remote_log_functions, Ul as set_timeout, Cl as set_timeout_periodic, t as sprintf, o as stats_parser, Ir as str_in_list, qn as strcasecmp, Qn as strcmp, Jn as strncmp, kr as strs_in_list, Xn as strstr, Rl as template_get_field_desc, ol as timeTracker, mn as trace_json, pn as trace_msg, yl as treedb_decoder_fkey, Ol as treedb_decoder_hook, Sl as treedb_encoder_fkey, Dl as treedb_get_field_desc, Tl as treedb_hook_data_size, n as vsprintf };
|
|
2864
2868
|
|
|
2865
2869
|
//# sourceMappingURL=gobj-js.es.min.js.map
|