@yuneta/gobj-js 7.13.8 → 7.16.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/gobj-js.cjs.js +245 -5
- package/dist/gobj-js.cjs.js.map +1 -1
- package/dist/gobj-js.cjs.min.js +660 -550
- package/dist/gobj-js.cjs.min.js.map +1 -1
- package/dist/gobj-js.es.js +240 -6
- package/dist/gobj-js.es.js.map +1 -1
- package/dist/gobj-js.es.min.js +958 -843
- package/dist/gobj-js.es.min.js.map +1 -1
- package/dist/gobj-js.iife.js +245 -5
- package/dist/gobj-js.iife.js.map +1 -1
- package/dist/gobj-js.iife.min.js +796 -686
- package/dist/gobj-js.iife.min.js.map +1 -1
- package/dist/gobj-js.umd.js +245 -5
- package/dist/gobj-js.umd.js.map +1 -1
- package/dist/gobj-js.umd.min.js +796 -686
- package/dist/gobj-js.umd.min.js.map +1 -1
- package/package.json +2 -2
package/dist/gobj-js.es.min.js
CHANGED
|
@@ -17,12 +17,12 @@ var e = {
|
|
|
17
17
|
};
|
|
18
18
|
function t(n) {
|
|
19
19
|
return function(n, r) {
|
|
20
|
-
var l,
|
|
21
|
-
for (
|
|
22
|
-
else if ("object" == typeof n[
|
|
23
|
-
if ((s = n[
|
|
24
|
-
if (null == l) throw new Error(t("[sprintf] Cannot access property \"%s\" of undefined value \"%s\"", s.keys[
|
|
25
|
-
l = l[s.keys[
|
|
20
|
+
var l, o, i, s, a, u, _, c, f, g = 1, d = n.length, b = "";
|
|
21
|
+
for (o = 0; o < d; o++) if ("string" == typeof n[o]) b += n[o];
|
|
22
|
+
else if ("object" == typeof n[o]) {
|
|
23
|
+
if ((s = n[o]).keys) for (l = r[g], i = 0; i < s.keys.length; i++) {
|
|
24
|
+
if (null == l) throw new Error(t("[sprintf] Cannot access property \"%s\" of undefined value \"%s\"", s.keys[i], s.keys[i - 1]));
|
|
25
|
+
l = l[s.keys[i]];
|
|
26
26
|
}
|
|
27
27
|
else l = s.param_no ? r[s.param_no] : r[g++];
|
|
28
28
|
if (e.not_type.test(s.type) && e.not_primitive.test(s.type) && l instanceof Function && (l = l()), e.numeric_arg.test(s.type) && "number" != typeof l && isNaN(l)) throw new TypeError(t("[sprintf] expecting number but found %T", l));
|
|
@@ -77,14 +77,14 @@ function t(n) {
|
|
|
77
77
|
return b;
|
|
78
78
|
}(function(t) {
|
|
79
79
|
if (r[t]) return r[t];
|
|
80
|
-
let n, l = t,
|
|
80
|
+
let n, l = t, o = [], i = 0;
|
|
81
81
|
for (; l;) {
|
|
82
|
-
if (null !== (n = e.text.exec(l)))
|
|
83
|
-
else if (null !== (n = e.modulo.exec(l)))
|
|
82
|
+
if (null !== (n = e.text.exec(l))) o.push(n[0]);
|
|
83
|
+
else if (null !== (n = e.modulo.exec(l))) o.push("%");
|
|
84
84
|
else {
|
|
85
85
|
if (null === (n = e.placeholder.exec(l))) throw new SyntaxError("[sprintf] unexpected placeholder");
|
|
86
86
|
if (n[2]) {
|
|
87
|
-
|
|
87
|
+
i |= 1;
|
|
88
88
|
var s = [], a = n[2], u = [];
|
|
89
89
|
if (null === (u = e.key.exec(a))) throw new SyntaxError("[sprintf] failed to parse named argument key");
|
|
90
90
|
for (s.push(u[1]); "" !== (a = a.substring(u[0].length));) if (null !== (u = e.key_access.exec(a))) s.push(u[1]);
|
|
@@ -93,9 +93,9 @@ function t(n) {
|
|
|
93
93
|
s.push(u[1]);
|
|
94
94
|
}
|
|
95
95
|
n[2] = s;
|
|
96
|
-
} else
|
|
97
|
-
if (3 ===
|
|
98
|
-
|
|
96
|
+
} else i |= 2;
|
|
97
|
+
if (3 === i) throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");
|
|
98
|
+
o.push({
|
|
99
99
|
placeholder: n[0],
|
|
100
100
|
param_no: n[1],
|
|
101
101
|
keys: n[2],
|
|
@@ -109,7 +109,7 @@ function t(n) {
|
|
|
109
109
|
}
|
|
110
110
|
l = l.substring(n[0].length);
|
|
111
111
|
}
|
|
112
|
-
return r[t] =
|
|
112
|
+
return r[t] = o;
|
|
113
113
|
}(n), arguments);
|
|
114
114
|
}
|
|
115
115
|
function n(e, n) {
|
|
@@ -117,7 +117,7 @@ function n(e, n) {
|
|
|
117
117
|
}
|
|
118
118
|
var r = Object.create(null);
|
|
119
119
|
function l(e, t, n, r) {}
|
|
120
|
-
function
|
|
120
|
+
function o(e, t, n, r, l) {
|
|
121
121
|
return {
|
|
122
122
|
result: t,
|
|
123
123
|
comment: n || {},
|
|
@@ -125,7 +125,7 @@ function i(e, t, n, r, l) {
|
|
|
125
125
|
data: l || []
|
|
126
126
|
};
|
|
127
127
|
}
|
|
128
|
-
function
|
|
128
|
+
function i(e, t, n, r) {}
|
|
129
129
|
function s(e, t, n, r, l) {
|
|
130
130
|
return {
|
|
131
131
|
result: t,
|
|
@@ -134,7 +134,7 @@ function s(e, t, n, r, l) {
|
|
|
134
134
|
data: l || []
|
|
135
135
|
};
|
|
136
136
|
}
|
|
137
|
-
var a = "7.0.0a", u = null, _ = null, c = null, f = null, g = null, d = null, b = [],
|
|
137
|
+
var a = "7.0.0a", u = null, _ = null, c = null, f = null, g = null, d = null, b = [], p = Object.create(null), m = {}, E = null, T = null, h = 0, y = Object.freeze({
|
|
138
138
|
DTP_STRING: 1,
|
|
139
139
|
DTP_BOOLEAN: 2,
|
|
140
140
|
DTP_INTEGER: 3,
|
|
@@ -145,7 +145,7 @@ var a = "7.0.0a", u = null, _ = null, c = null, f = null, g = null, d = null, b
|
|
|
145
145
|
DTP_POINTER: 8
|
|
146
146
|
});
|
|
147
147
|
y.DTP_POINTER;
|
|
148
|
-
var
|
|
148
|
+
var v = Object.freeze({
|
|
149
149
|
SDF_NOTACCESS: 1,
|
|
150
150
|
SDF_RD: 2,
|
|
151
151
|
SDF_WR: 4,
|
|
@@ -168,14 +168,14 @@ var S = Object.freeze({
|
|
|
168
168
|
SDF_AUTHZ_S: 524288,
|
|
169
169
|
SDF_AUTHZ_RS: 1048576
|
|
170
170
|
});
|
|
171
|
-
|
|
172
|
-
var
|
|
173
|
-
constructor(e, t, n = 0, r = null, l = "",
|
|
174
|
-
this.type = e, this.name = t, this.alias =
|
|
171
|
+
v.SDF_RD, v.SDF_WR, v.SDF_STATS, v.SDF_PERSIST, v.SDF_VOLATIL, v.SDF_RSTATS, v.SDF_PSTATS, v.SDF_WR, v.SDF_PERSIST;
|
|
172
|
+
var O = class {
|
|
173
|
+
constructor(e, t, n = 0, r = null, l = "", o = null, i = null, s = 0, a = null, u = null, _ = null) {
|
|
174
|
+
this.type = e, this.name = t, this.alias = o, this.flag = n, this.default_value = r, this.header = i, this.fillspace = s, this.description = l, this.json_fn = a, this.schema = u, this.authpth = _;
|
|
175
175
|
}
|
|
176
|
-
},
|
|
177
|
-
constructor(e, t, n, r, l,
|
|
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 =
|
|
176
|
+
}, S = () => new O(0, null), N = (e, t, n, r, l) => new O(e, t, n, r, l), R = (e, t, n, r, l, o) => new O(e, t, 0, null, o, n, null, 0, l, r, null), j = (e, t, n, r, l, o, i) => new O(e, t, n, null, i, r, null, 0, o, l, null), w = (e, t, n, r, l) => new O(e, t, n, r, l), D = (e, t, n, r, l, o) => new O(e, t, n, null, o, r, null, 0, null, l, null), A = (e, t, n, r, l) => new O(e, t, n, null, l, null, null, 0, null, null, r), I = (e, t, n, r, l, o) => new O(e, t, n, null, o, null, r, l), $ = class {
|
|
177
|
+
constructor(e, t, n, r, l, o, i, s, a) {
|
|
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 = o, this.command_table = i, 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
|
}, k = class {
|
|
181
181
|
constructor(e, t, n, r, l) {
|
|
@@ -227,10 +227,10 @@ var W = 1;
|
|
|
227
227
|
function K(e) {
|
|
228
228
|
W = 1 === Number(e) ? 1 : 0;
|
|
229
229
|
}
|
|
230
|
-
function
|
|
230
|
+
function x() {
|
|
231
231
|
return W;
|
|
232
232
|
}
|
|
233
|
-
function
|
|
233
|
+
function Y(e) {
|
|
234
234
|
gr(e) && (e = JSON.stringify(e)), Jn(" ".repeat(Math.max(1, 2 * h)) + String(e));
|
|
235
235
|
}
|
|
236
236
|
var B = Object.freeze({
|
|
@@ -327,7 +327,7 @@ var B = Object.freeze({
|
|
|
327
327
|
]
|
|
328
328
|
], q = 0, H = 0, Q = 0;
|
|
329
329
|
function z(e, t) {
|
|
330
|
-
if (
|
|
330
|
+
if (Or(e)) return 268369920;
|
|
331
331
|
if (/^[0-9]+$/.test(String(e))) {
|
|
332
332
|
const t = Number(e);
|
|
333
333
|
if (t) return t;
|
|
@@ -335,7 +335,7 @@ function z(e, t) {
|
|
|
335
335
|
return function(e) {
|
|
336
336
|
for (const [t, n] of J) if (t === e) return n;
|
|
337
337
|
return 0;
|
|
338
|
-
}(String(e)) || (
|
|
338
|
+
}(String(e)) || (xn(`${t}: trace level NOT FOUND: ${e}`), 0);
|
|
339
339
|
}
|
|
340
340
|
function X(e) {
|
|
341
341
|
if (Q) return 4294967295;
|
|
@@ -373,11 +373,11 @@ function le(e, t) {
|
|
|
373
373
|
const n = Z(e);
|
|
374
374
|
return !!(n & B.TRACE_MACHINE || n & B.TRACE_TIMER_PERIODIC && "EV_TIMEOUT_PERIODIC" === t || n & B.TRACE_TIMER && "EV_TIMEOUT" === t);
|
|
375
375
|
}
|
|
376
|
-
function
|
|
376
|
+
function oe(e, t) {
|
|
377
377
|
const n = z(e, "gobj_set_global_trace");
|
|
378
378
|
return n ? (t ? q |= n : q &= ~n, 0) : -1;
|
|
379
379
|
}
|
|
380
|
-
function
|
|
380
|
+
function ie(e, t) {
|
|
381
381
|
const n = z(e, "gobj_set_global_no_trace");
|
|
382
382
|
return n ? (t ? H |= n : H &= ~n, 0) : -1;
|
|
383
383
|
}
|
|
@@ -389,23 +389,23 @@ function ae(e) {
|
|
|
389
389
|
}
|
|
390
390
|
function ue(e, t, n) {
|
|
391
391
|
const r = br(e) ? Ie(e) : e;
|
|
392
|
-
if (!r) return
|
|
392
|
+
if (!r) return xn(`gobj_set_gclass_trace: gclass NOT FOUND: ${e}`), -1;
|
|
393
393
|
const l = z(t, "gobj_set_gclass_trace");
|
|
394
394
|
return l ? (n ? r.trace_level |= l : r.trace_level &= ~l, 0) : -1;
|
|
395
395
|
}
|
|
396
396
|
function _e(e, t, n) {
|
|
397
|
-
if (!e) return
|
|
397
|
+
if (!e) return xn("gobj_set_gobj_trace: gobj NULL"), -1;
|
|
398
398
|
const r = z(t, "gobj_set_gobj_trace");
|
|
399
399
|
return r ? (n ? e.trace_level |= r : e.trace_level &= ~r, 0) : -1;
|
|
400
400
|
}
|
|
401
401
|
function ce(e, t, n) {
|
|
402
402
|
const r = br(e) ? Ie(e) : e;
|
|
403
|
-
if (!r) return
|
|
403
|
+
if (!r) return xn(`gobj_set_gclass_no_trace: gclass NOT FOUND: ${e}`), -1;
|
|
404
404
|
const l = z(t, "gobj_set_gclass_no_trace");
|
|
405
405
|
return l ? (n ? r.no_trace_level |= l : r.no_trace_level &= ~l, 0) : -1;
|
|
406
406
|
}
|
|
407
407
|
function fe(e, t, n) {
|
|
408
|
-
if (!e) return
|
|
408
|
+
if (!e) return xn("gobj_set_gobj_no_trace: gobj NULL"), -1;
|
|
409
409
|
const r = z(t, "gobj_set_gobj_no_trace");
|
|
410
410
|
return r ? (n ? e.no_trace_level |= r : e.no_trace_level &= ~r, 0) : -1;
|
|
411
411
|
}
|
|
@@ -417,44 +417,44 @@ function ge() {
|
|
|
417
417
|
set: !!(q & t)
|
|
418
418
|
}));
|
|
419
419
|
}
|
|
420
|
-
function de(e, t, n, r, l,
|
|
421
|
-
u = t, _ = n, c = r, f = l, g =
|
|
420
|
+
function de(e, t, n, r, l, o, i) {
|
|
421
|
+
u = t, _ = n, c = r, f = l, g = o, d = i;
|
|
422
422
|
const s = [["EV_STATE_CHANGED", U.EVF_SYSTEM_EVENT | U.EVF_OUTPUT_EVENT | U.EVF_NO_WARN_SUBS], [0, 0]];
|
|
423
423
|
for (let e = 0; e < s.length; e++) {
|
|
424
424
|
let t = s[e][0], n = s[e][1];
|
|
425
|
-
|
|
425
|
+
je(b, t, n);
|
|
426
426
|
}
|
|
427
427
|
return 0;
|
|
428
428
|
}
|
|
429
429
|
function be(e, t) {
|
|
430
430
|
let n = {};
|
|
431
|
-
if (!dr(t)) return
|
|
431
|
+
if (!dr(t)) return xn("sdata_desc MUST be an array"), Hn(t), n;
|
|
432
432
|
for (let r = 0; r < t.length; r++) {
|
|
433
433
|
const l = t[r];
|
|
434
|
-
l.name &&
|
|
434
|
+
l.name && pe(e, n, l);
|
|
435
435
|
}
|
|
436
436
|
return n;
|
|
437
437
|
}
|
|
438
|
-
function
|
|
438
|
+
function pe(e, t, n) {
|
|
439
439
|
let r, l = n.default_value;
|
|
440
440
|
switch (n.type) {
|
|
441
441
|
case y.DTP_STRING:
|
|
442
442
|
r = String(l);
|
|
443
443
|
break;
|
|
444
444
|
case y.DTP_BOOLEAN:
|
|
445
|
-
r =
|
|
445
|
+
r = Sr(l);
|
|
446
446
|
break;
|
|
447
447
|
case y.DTP_INTEGER:
|
|
448
|
-
r = parseInt(l), isNaN(r) &&
|
|
448
|
+
r = parseInt(l), isNaN(r) && xn(`${Tt(e)}: attr NaN: ${n.name}`);
|
|
449
449
|
break;
|
|
450
450
|
case y.DTP_REAL:
|
|
451
|
-
r = Number(l), isNaN(r) &&
|
|
451
|
+
r = Number(l), isNaN(r) && xn(`${Tt(e)}: attr NaN: ${n.name}`);
|
|
452
452
|
break;
|
|
453
453
|
case y.DTP_LIST:
|
|
454
454
|
if (br(l)) try {
|
|
455
455
|
r = JSON.parse(l);
|
|
456
456
|
} catch (e) {
|
|
457
|
-
|
|
457
|
+
xn(`JSON parse error: ${e.message}`);
|
|
458
458
|
}
|
|
459
459
|
else r = l;
|
|
460
460
|
dr(r) || (r = []);
|
|
@@ -463,7 +463,7 @@ function me(e, t, n) {
|
|
|
463
463
|
if (br(l)) try {
|
|
464
464
|
r = JSON.parse(l);
|
|
465
465
|
} catch (e) {
|
|
466
|
-
|
|
466
|
+
xn(`JSON parse error: ${e.message}`);
|
|
467
467
|
}
|
|
468
468
|
else r = l;
|
|
469
469
|
gr(r) || (r = {});
|
|
@@ -472,15 +472,15 @@ function me(e, t, n) {
|
|
|
472
472
|
if (br(l)) try {
|
|
473
473
|
r = JSON.parse(l);
|
|
474
474
|
} catch (e) {
|
|
475
|
-
|
|
475
|
+
xn(`JSON parse error: ${e.message}`);
|
|
476
476
|
}
|
|
477
477
|
else r = l;
|
|
478
478
|
break;
|
|
479
479
|
case y.DTP_POINTER: r = l;
|
|
480
480
|
}
|
|
481
|
-
return void 0 === r && (
|
|
481
|
+
return void 0 === r && (xn(`default_value WRONG, it: ${n.name}, value: ${n.default_value}`), r = null), t[n.name] = r, 0;
|
|
482
482
|
}
|
|
483
|
-
function
|
|
483
|
+
function me(e, t, n, r) {
|
|
484
484
|
let l;
|
|
485
485
|
switch (n.type) {
|
|
486
486
|
case y.DTP_STRING:
|
|
@@ -492,103 +492,103 @@ function pe(e, t, n, r) {
|
|
|
492
492
|
}
|
|
493
493
|
break;
|
|
494
494
|
case y.DTP_BOOLEAN:
|
|
495
|
-
l =
|
|
495
|
+
l = Sr(r);
|
|
496
496
|
break;
|
|
497
497
|
case y.DTP_INTEGER:
|
|
498
|
-
l = parseInt(r), isNaN(l) &&
|
|
498
|
+
l = parseInt(r), isNaN(l) && xn(`${Tt(e)}: attr NaN: ${n.name}`);
|
|
499
499
|
break;
|
|
500
500
|
case y.DTP_REAL:
|
|
501
|
-
l = Number(r), isNaN(l) &&
|
|
501
|
+
l = Number(r), isNaN(l) && xn(`${Tt(e)}: attr NaN: ${n.name}`);
|
|
502
502
|
break;
|
|
503
503
|
case y.DTP_LIST:
|
|
504
504
|
if (br(r)) try {
|
|
505
505
|
l = JSON.parse(r);
|
|
506
506
|
} catch (e) {
|
|
507
|
-
|
|
507
|
+
xn(`JSON parse error: ${e.message}`);
|
|
508
508
|
}
|
|
509
509
|
else l = r;
|
|
510
|
-
if (!dr(l)) return
|
|
510
|
+
if (!dr(l)) return xn(`attr must be an array: ${n.name}`), -1;
|
|
511
511
|
break;
|
|
512
512
|
case y.DTP_DICT:
|
|
513
513
|
if (br(r)) try {
|
|
514
514
|
l = JSON.parse(r);
|
|
515
515
|
} catch (e) {
|
|
516
|
-
|
|
516
|
+
xn(`JSON parse error: ${e.message}`);
|
|
517
517
|
}
|
|
518
518
|
else l = r;
|
|
519
|
-
if (!gr(l)) return
|
|
519
|
+
if (!gr(l)) return xn(`attr must be an object: ${n.name}`), -1;
|
|
520
520
|
break;
|
|
521
521
|
case y.DTP_JSON:
|
|
522
522
|
if (br(r)) try {
|
|
523
523
|
l = JSON.parse(r);
|
|
524
524
|
} catch (e) {
|
|
525
|
-
|
|
525
|
+
xn(`JSON parse error: ${e.message}`);
|
|
526
526
|
}
|
|
527
527
|
else l = r;
|
|
528
|
-
if (!dr(l) && !gr(l)) return
|
|
528
|
+
if (!dr(l) && !gr(l)) return xn(`attr must be a json dict/list: ${n.name}`), -1;
|
|
529
529
|
break;
|
|
530
530
|
case y.DTP_POINTER: l = r;
|
|
531
531
|
}
|
|
532
|
-
return void 0 === l &&
|
|
532
|
+
return void 0 === l && xn(`${Tt(e)}: attr undefined: ${n.name}`), t[n.name] = l, gr(e.priv) && e.priv.hasOwnProperty(n.name) && (e.priv[n.name] = l), e.obflag & P.obflag_created && !(e.obflag & P.obflag_destroyed) && e.gclass.gmt.mt_writing && e.gclass.gmt.mt_writing(e, n.name), 0;
|
|
533
533
|
}
|
|
534
534
|
function Ee(e) {
|
|
535
535
|
return e.jn_attrs;
|
|
536
536
|
}
|
|
537
537
|
function Te(e, t, n) {
|
|
538
|
-
return Vt(e, t) ? Ee(e) : e && e.bottom_gobj ? Te(e.bottom_gobj, t, n) : (n &&
|
|
538
|
+
return Vt(e, t) ? Ee(e) : e && e.bottom_gobj ? Te(e.bottom_gobj, t, n) : (n && xn(`GClass Attribute NOT FOUND: ${Tt(e)}, attr ${t}`), null);
|
|
539
539
|
}
|
|
540
540
|
function he(e, t, n) {
|
|
541
|
-
if (!(e && e instanceof $)) return n &&
|
|
541
|
+
if (!(e && e instanceof $)) return n && xn("gclass NULL"), null;
|
|
542
542
|
if (!t) return e.attrs_table;
|
|
543
543
|
for (let n = 0; n < e.attrs_table.length; n++) {
|
|
544
544
|
const r = e.attrs_table[n];
|
|
545
545
|
if (r.name && r.name === t) return r;
|
|
546
546
|
}
|
|
547
|
-
return n &&
|
|
547
|
+
return n && xn(`${e.gclass_name}: GClass Attribute NOT FOUND: ${t}`), null;
|
|
548
548
|
}
|
|
549
|
-
function ye(e, t, n, r, l,
|
|
550
|
-
if (
|
|
551
|
-
if (e.includes("`") || e.includes("^") || e.includes(".")) return
|
|
552
|
-
if (Ie(e)) return
|
|
553
|
-
let c = new $(e, r, l,
|
|
549
|
+
function ye(e, t, n, r, l, o, i, s, a, u, _) {
|
|
550
|
+
if (Or(e)) return xn("gclass_name EMPTY"), null;
|
|
551
|
+
if (e.includes("`") || e.includes("^") || e.includes(".")) return xn(`GClass name CANNOT have '.' or '^' or '\`' char: ${e}`), null;
|
|
552
|
+
if (Ie(e)) return xn(`GClass ALREADY exists: ${e}`), null;
|
|
553
|
+
let c = new $(e, r, l, o, i, s, a, u, _);
|
|
554
554
|
(function(e, t) {
|
|
555
|
-
e && e instanceof $ ? t ?
|
|
555
|
+
e && e instanceof $ ? t ? p[t] ? xn(`gclass ALREADY REGISTERED: ${t}`) : p[t] = e : xn("gclass_name undefined") : xn("gclass undefined");
|
|
556
556
|
})(c, e);
|
|
557
557
|
const f = n.length;
|
|
558
558
|
for (let e = 0; e < f; e++) {
|
|
559
559
|
let t = n[e][0], r = n[e][1];
|
|
560
|
-
if (
|
|
561
|
-
if (Ne(c, t) < 0) return
|
|
560
|
+
if (Or(t)) continue;
|
|
561
|
+
if (Ne(c, t) < 0) return ve(c), null;
|
|
562
562
|
const l = r.length;
|
|
563
563
|
for (let e = 0; e < l; e++) {
|
|
564
|
-
let n = r[e][0], l = r[e][1],
|
|
565
|
-
|
|
564
|
+
let n = r[e][0], l = r[e][1], o = r[e][2];
|
|
565
|
+
Or(n) || Re(c, t, n, l, o);
|
|
566
566
|
}
|
|
567
567
|
}
|
|
568
568
|
for (let e = 0; e < t.length; e++) {
|
|
569
569
|
let n = t[e][0], r = t[e][1];
|
|
570
|
-
if (!
|
|
571
|
-
if (
|
|
570
|
+
if (!Or(n)) {
|
|
571
|
+
if (De(c, n)) return xn(`SMachine: event repeated in input_events: ${n}`), ve(c), null;
|
|
572
572
|
we(c, n, r);
|
|
573
573
|
}
|
|
574
574
|
}
|
|
575
575
|
if (!c.fsm_checked) {
|
|
576
|
-
if (Ae(c) < 0) return
|
|
576
|
+
if (Ae(c) < 0) return ve(c), null;
|
|
577
577
|
c.fsm_checked = !0;
|
|
578
578
|
}
|
|
579
579
|
return c;
|
|
580
580
|
}
|
|
581
|
-
function
|
|
581
|
+
function ve(e) {
|
|
582
582
|
let t;
|
|
583
583
|
if (br(e)) t = e;
|
|
584
584
|
else {
|
|
585
|
-
if (!(e instanceof $)) return
|
|
585
|
+
if (!(e instanceof $)) return xn("Cannot unregister gclass, type unknown"), -1;
|
|
586
586
|
t = e.gclass_name;
|
|
587
587
|
}
|
|
588
|
-
let n =
|
|
589
|
-
return n ? n.instances > 0 ? (
|
|
588
|
+
let n = p[t];
|
|
589
|
+
return n ? n.instances > 0 ? (xn(`Cannot unregister gclass, instances in use: ${t}`), -1) : (delete p[t], 0) : (xn(`Cannot unregister gclass, not found: ${t}`), -1);
|
|
590
590
|
}
|
|
591
|
-
function
|
|
591
|
+
function Oe(e, t) {
|
|
592
592
|
const n = e.dl_states.length, r = e.dl_states;
|
|
593
593
|
for (let e = 0; e < n; e++) {
|
|
594
594
|
let n = r[e];
|
|
@@ -596,7 +596,7 @@ function ve(e, t) {
|
|
|
596
596
|
}
|
|
597
597
|
return null;
|
|
598
598
|
}
|
|
599
|
-
function
|
|
599
|
+
function Se(e, t) {
|
|
600
600
|
const n = e.dl_actions.length, r = e.dl_actions;
|
|
601
601
|
for (let e = 0; e < n; e++) {
|
|
602
602
|
let n = r[e];
|
|
@@ -605,22 +605,22 @@ function Oe(e, t) {
|
|
|
605
605
|
return null;
|
|
606
606
|
}
|
|
607
607
|
function Ne(e, t) {
|
|
608
|
-
return e instanceof $ ?
|
|
608
|
+
return e instanceof $ ? Oe(e, t) ? (xn(`state already exists: ${t}`), -1) : (e.dl_states.push(new V(t)), 0) : (xn("Cannot add state, typeof not GClass"), -1);
|
|
609
609
|
}
|
|
610
610
|
function Re(e, t, n, r, l) {
|
|
611
|
-
if (!(e instanceof $)) return
|
|
612
|
-
if (
|
|
613
|
-
let
|
|
614
|
-
return
|
|
611
|
+
if (!(e instanceof $)) return xn("Cannot add state, typeof not GClass"), -1;
|
|
612
|
+
if (Or(t)) return xn("state_name EMPTY"), -1;
|
|
613
|
+
let o = Oe(e, t);
|
|
614
|
+
return o ? Se(o, n) ? (xn(`event already exists: gclass ${e.gclass_name}, state ${t}, event ${n}`), -1) : (o.dl_actions.push(new G(n, r, l)), 0) : (xn(`state not found: ${t}`), -1);
|
|
615
615
|
}
|
|
616
|
-
function
|
|
617
|
-
|
|
616
|
+
function je(e, t, n) {
|
|
617
|
+
Or(t) || e.push(new M(t, n));
|
|
618
618
|
}
|
|
619
619
|
function we(e, t, n) {
|
|
620
|
-
return e instanceof $ ?
|
|
620
|
+
return e instanceof $ ? je(e.dl_events, t, n) : (xn("Cannot add state, typeof not GClass"), -1);
|
|
621
621
|
}
|
|
622
|
-
function
|
|
623
|
-
if (!(e instanceof $)) return
|
|
622
|
+
function De(e, t) {
|
|
623
|
+
if (!(e instanceof $)) return xn("Cannot add state, typeof not GClass"), 0;
|
|
624
624
|
const n = e.dl_events.length, r = e.dl_events;
|
|
625
625
|
for (let e = 0; e < n; e++) {
|
|
626
626
|
let n = r[e];
|
|
@@ -629,25 +629,25 @@ function je(e, t) {
|
|
|
629
629
|
return null;
|
|
630
630
|
}
|
|
631
631
|
function Ae(e) {
|
|
632
|
-
if (!(e instanceof $)) return
|
|
632
|
+
if (!(e instanceof $)) return xn("Cannot add state, typeof not GClass"), -1;
|
|
633
633
|
let t = 0;
|
|
634
|
-
cr(e.dl_states) || (
|
|
634
|
+
cr(e.dl_states) || (xn(`GClass without states: ${e.gclass_name}`), t += -1);
|
|
635
635
|
for (let n = 0; n < e.dl_states.length; n++) {
|
|
636
636
|
let r = e.dl_states[n];
|
|
637
|
-
if (!
|
|
637
|
+
if (!Or(r.state_name)) for (let n = 0; n < r.dl_actions.length; n++) {
|
|
638
638
|
let l = r.dl_actions[n];
|
|
639
|
-
|
|
639
|
+
Or(l.event_name) || (De(e, l.event_name) || (xn(`SMachine: state's event NOT in input_events: gclass ${e.gclass_name}, state ${r.state_name}, event ${l.event_name}`), t += -1), l.next_state && (Oe(e, l.next_state) || (xn(`SMachine: next state NOT in state names: gclass ${e.gclass_name}, state ${r.state_name}, next_state ${l.next_state}`), t += -1)));
|
|
640
640
|
}
|
|
641
641
|
}
|
|
642
642
|
for (let n = 0; n < e.dl_events.length; n++) {
|
|
643
643
|
let r = e.dl_events[n];
|
|
644
|
-
if (!
|
|
644
|
+
if (!Or(r.event_name) && (pr(r.event_flag) || (xn(`SMachine: event flag is NOT number: gclass ${e.gclass_name}, event ${r.event_name}`), t += -1), !(r.event_flag & U.EVF_OUTPUT_EVENT))) {
|
|
645
645
|
let n = !1;
|
|
646
646
|
for (let t = 0; t < e.dl_states.length; t++) {
|
|
647
647
|
let l = e.dl_states[t];
|
|
648
|
-
|
|
648
|
+
Or(l.state_name) || Se(l, r.event_name) && (n = !0);
|
|
649
649
|
}
|
|
650
|
-
n || (
|
|
650
|
+
n || (xn(`SMachine: input_list's event NOT in state: gclass ${e.gclass_name}, event ${r.event_name}`), t += -1);
|
|
651
651
|
}
|
|
652
652
|
}
|
|
653
653
|
return t;
|
|
@@ -655,13 +655,13 @@ function Ae(e) {
|
|
|
655
655
|
function Ie(e, t) {
|
|
656
656
|
let n = null;
|
|
657
657
|
try {
|
|
658
|
-
n =
|
|
658
|
+
n = p[e];
|
|
659
659
|
} catch (e) {}
|
|
660
|
-
return n || (t &&
|
|
660
|
+
return n || (t && xn(`gclass not found: ${e}`), null);
|
|
661
661
|
}
|
|
662
662
|
function $e() {
|
|
663
663
|
let e = [];
|
|
664
|
-
for (const t of Object.keys(
|
|
664
|
+
for (const t of Object.keys(m)) sr(e, t);
|
|
665
665
|
return e;
|
|
666
666
|
}
|
|
667
667
|
function ke() {
|
|
@@ -669,295 +669,295 @@ function ke() {
|
|
|
669
669
|
}
|
|
670
670
|
function Ce(e, t) {
|
|
671
671
|
e = e.toLowerCase();
|
|
672
|
-
return
|
|
672
|
+
return m[e] || (t && xn(`gobj service not found: ${e}`), null);
|
|
673
673
|
}
|
|
674
674
|
function Le(e) {
|
|
675
|
-
let t =
|
|
676
|
-
return t = t.toLowerCase(),
|
|
675
|
+
let t = mt(e);
|
|
676
|
+
return t = t.toLowerCase(), m[t] && xn(`service ALREADY REGISTERED: ${t}. Will be UPDATED`), m[t] = e, 0;
|
|
677
677
|
}
|
|
678
678
|
function Pe(e, t) {
|
|
679
|
-
t.parent &&
|
|
679
|
+
t.parent && xn(`_add_child() ALREADY HAS PARENT: ${t.gobj_name}`), e.dl_children.push(t), t.parent = e;
|
|
680
680
|
}
|
|
681
681
|
function Ue(e, t) {
|
|
682
682
|
let n = Ml(e.dl_children, t);
|
|
683
683
|
n >= 0 && (ar(e.dl_children, n), t.parent = null);
|
|
684
684
|
}
|
|
685
685
|
function Fe(e, t) {
|
|
686
|
-
return ct(e) ? u ? u(e, t) : -1 : (
|
|
686
|
+
return ct(e) ? u ? u(e, t) : -1 : (xn(`${Tt(e)}: Only gobj services can load/save writable-persistent`), -1);
|
|
687
687
|
}
|
|
688
688
|
function Ge(e, t) {
|
|
689
|
-
return ct(e) ? _ ? _(e, t) : -1 : (
|
|
689
|
+
return ct(e) ? _ ? _(e, t) : -1 : (xn(`${Tt(e)}: Only gobj services can load/save writable-persistent`), -1);
|
|
690
690
|
}
|
|
691
691
|
function Ve(e, t) {
|
|
692
|
-
return ct(e) ? c ? c(e, t) : -1 : (
|
|
692
|
+
return ct(e) ? c ? c(e, t) : -1 : (xn(`${Tt(e)}: Only gobj services can load/save writable-persistent`), -1);
|
|
693
693
|
}
|
|
694
694
|
function Me(e, t) {
|
|
695
695
|
return f ? f(e, t) : null;
|
|
696
696
|
}
|
|
697
697
|
function We(e, t) {
|
|
698
|
-
"__json_config_variables__" !== t &&
|
|
698
|
+
"__json_config_variables__" !== t && xn(`GClass Attribute NOT FOUND: ${Tt(e)}, attr ${t}`);
|
|
699
699
|
}
|
|
700
700
|
function Ke(e, t, n) {
|
|
701
701
|
let r = t;
|
|
702
702
|
(function(e, t, n, r, l) {
|
|
703
|
-
if (!e || !t) return
|
|
704
|
-
let
|
|
705
|
-
for (const [
|
|
706
|
-
const t = he(l.gclass,
|
|
707
|
-
t ? (-1 === n || t.flag & n) && (t.flag &
|
|
703
|
+
if (!e || !t) return xn("hsdata or kw NULL"), -1;
|
|
704
|
+
let o = 0;
|
|
705
|
+
for (const [i, s] of Object.entries(t)) {
|
|
706
|
+
const t = he(l.gclass, i, !1);
|
|
707
|
+
t ? (-1 === n || t.flag & n) && (t.flag & v.SDF_DEPRECATED && Yn(`${Tt(l)}: Deprecated attribute used in gobj creation: ${i}`), o += me(l, e, t, s)) : r && (r(l, i), o--);
|
|
708
708
|
}
|
|
709
|
-
return
|
|
710
|
-
})(Ee(e), r, -1, e.gclass.gclass_flag & C.gcflag_ignore_unknown_attrs ? 0 : We, e) < 0 && (
|
|
709
|
+
return o;
|
|
710
|
+
})(Ee(e), r, -1, e.gclass.gclass_flag & C.gcflag_ignore_unknown_attrs ? 0 : We, e) < 0 && (xn(`${Tt(e)} json2data() FAILED`), Hn(r));
|
|
711
711
|
}
|
|
712
|
-
function
|
|
713
|
-
if (
|
|
714
|
-
if (E) return
|
|
715
|
-
|
|
712
|
+
function xe(e, n, r, l, o) {
|
|
713
|
+
if (o & L.gobj_flag_yuno) {
|
|
714
|
+
if (E) return xn("__yuno__ already created"), null;
|
|
715
|
+
o |= L.gobj_flag_service;
|
|
716
716
|
} else {
|
|
717
|
-
if (!l) return
|
|
718
|
-
if (!("string" == typeof l || l instanceof k)) return
|
|
719
|
-
if (br(l) && !(l = Ce(l))) return
|
|
720
|
-
}
|
|
721
|
-
if (
|
|
722
|
-
if (
|
|
723
|
-
if (T) return
|
|
724
|
-
|
|
725
|
-
}
|
|
726
|
-
if (
|
|
727
|
-
let
|
|
728
|
-
if (!
|
|
729
|
-
if (!br(e)) return
|
|
730
|
-
if (!
|
|
731
|
-
if (e.includes("`")) return
|
|
732
|
-
if (e.includes("^")) return
|
|
733
|
-
}
|
|
734
|
-
let s = new k(e,
|
|
735
|
-
s.jn_attrs = be(s,
|
|
717
|
+
if (!l) return xn("gobj NEEDS a parent!"), null;
|
|
718
|
+
if (!("string" == typeof l || l instanceof k)) return xn(`BAD TYPE of parent: ${l}`), null;
|
|
719
|
+
if (br(l) && !(l = Ce(l))) return Yn(`parent service not found: ${l}`), null;
|
|
720
|
+
}
|
|
721
|
+
if (o & L.gobj_flag_service && Ce(e, !1)) return xn(`service ALREADY registered: ${n}^${e}`), null;
|
|
722
|
+
if (o & L.gobj_flag_default_service) {
|
|
723
|
+
if (T) return xn(`default service ALREADY registered: ${n}^${e}`), null;
|
|
724
|
+
o |= L.gobj_flag_service;
|
|
725
|
+
}
|
|
726
|
+
if (Or(n)) return xn("gclass_name must be a string"), null;
|
|
727
|
+
let i = Ie(n, !1);
|
|
728
|
+
if (!i) return xn(`GClass not registered: ${n}^${e}`), null;
|
|
729
|
+
if (!br(e)) return xn(`gobj_name must be a string: ${n}`), null;
|
|
730
|
+
if (!Or(e)) {
|
|
731
|
+
if (e.includes("`")) return xn(`gobj_name cannot contain char ': ${n}^${e}`), null;
|
|
732
|
+
if (e.includes("^")) return xn(`gobj_name cannot contain char ^: ${n}^${e}`), null;
|
|
733
|
+
}
|
|
734
|
+
let s = new k(e, i, r, l, o);
|
|
735
|
+
s.jn_attrs = be(s, i.attrs_table);
|
|
736
736
|
for (const [e, t] of Object.entries(s.jn_attrs)) e in s.priv && (s.priv[e] = t);
|
|
737
737
|
let a = te(s);
|
|
738
|
-
return a &&
|
|
738
|
+
return a && Y(t("💙💙⏩ creating: %s^%s", i.gclass_name, e)), s.gobj_flag & L.gobj_flag_service && Le(s), s.gobj_flag & L.gobj_flag_yuno && (E = s), s.gobj_flag & L.gobj_flag_default_service && (T = s), s.gobj_flag & L.gobj_flag_yuno || Pe(l, s), s.obflag |= P.obflag_created, s.gclass.instances++, Ke(s, r), s.gobj_flag & L.gobj_flag_service && u && u(s, null), s.gclass.gmt.mt_create2 ? s.gclass.gmt.mt_create2(s, r) : s.gclass.gmt.mt_create && s.gclass.gmt.mt_create(s), l && l.gclass.gmt.mt_child_added && (a && Y(t("👦👦🔵 child_added(%s): %s", ht(l), Tt(s))), l.gclass.gmt.mt_child_added(l, s)), a && Y(t("💙💙⏪ created: %s", ht(s))), s;
|
|
739
739
|
}
|
|
740
|
-
function
|
|
741
|
-
return
|
|
740
|
+
function Ye(e, t, n) {
|
|
741
|
+
return xe(e, t, n, null, L.gobj_flag_yuno);
|
|
742
742
|
}
|
|
743
743
|
function Be(e, t, n, r) {
|
|
744
|
-
return
|
|
744
|
+
return xe(e, t, n, r, L.gobj_flag_service);
|
|
745
745
|
}
|
|
746
746
|
function Je(e, t, n, r) {
|
|
747
|
-
return
|
|
747
|
+
return xe(e, t, n, r, L.gobj_flag_default_service | L.gobj_flag_autostart);
|
|
748
748
|
}
|
|
749
749
|
function qe(e, t, n, r) {
|
|
750
|
-
return
|
|
750
|
+
return xe(e, t, n, r, L.gobj_flag_volatil);
|
|
751
751
|
}
|
|
752
752
|
function He(e, t, n, r) {
|
|
753
|
-
return
|
|
753
|
+
return xe(e, t, n, r, L.gobj_flag_pure_child);
|
|
754
754
|
}
|
|
755
755
|
function Qe(e, t, n, r) {
|
|
756
|
-
return
|
|
756
|
+
return xe(e, t, n, r, 0);
|
|
757
757
|
}
|
|
758
758
|
function ze(e) {
|
|
759
|
-
if (
|
|
760
|
-
e.__refs__ > 0 &&
|
|
759
|
+
if (St(e)) return void xn("gobj NULL or DESTROYED");
|
|
760
|
+
e.__refs__ > 0 && xn(`${Tt(e)}: gobj DESTROYING with references: ${e.__refs__}`), e.playing && (xn(`Destroying a PLAYING gobj: ${ht(e)}`), at(e)), e.running && (xn(`Destroying a RUNNING gobj: ${ht(e)}`), rt(e)), e.obflag |= P.obflag_destroying, function(e) {
|
|
761
761
|
if (0 === on.length) return;
|
|
762
762
|
for (let t of on) t.src === e && (t.src = null);
|
|
763
763
|
on = on.filter((t) => t.dst !== e);
|
|
764
764
|
}(e);
|
|
765
765
|
let n = te(e);
|
|
766
|
-
n &&
|
|
766
|
+
n && Y(t("💔💔⏩ destroying: %s", ht(e)));
|
|
767
767
|
let r = yt(e);
|
|
768
|
-
r && r.gclass.gmt.mt_child_removed && (n &&
|
|
769
|
-
let t =
|
|
770
|
-
t = t.toLowerCase(),
|
|
771
|
-
}(e), hn(e, e.dl_subscriptions, !0), hn(e, e.dl_subscribings, !0), r && (Ue(r, e),
|
|
768
|
+
r && r.gclass.gmt.mt_child_removed && (n && Y(t("👦👦🔴 child_removed(%s): %s", ht(r), Tt(e))), r.gclass.gmt.mt_child_removed(r, e)), e.gobj_flag & L.gobj_flag_service && function(e) {
|
|
769
|
+
let t = mt(e);
|
|
770
|
+
t = t.toLowerCase(), m[t] ? delete m[t] : xn(`"service NOT found in register": ${t}`);
|
|
771
|
+
}(e), hn(e, e.dl_subscriptions, !0), hn(e, e.dl_subscribings, !0), r && (Ue(r, e), vt(e) && (Nt(r) !== e || St(r) || Rt(r, null))), function(e) {
|
|
772
772
|
let t = e.dl_children.slice();
|
|
773
773
|
for (let e = 0; e < t.length; e++) {
|
|
774
774
|
let n = t[e];
|
|
775
|
-
|
|
775
|
+
St(n) || ze(n);
|
|
776
776
|
}
|
|
777
|
-
}(e), e.obflag & P.obflag_created && e.gclass.gmt.mt_destroy && e.gclass.gmt.mt_destroy(e), n &&
|
|
777
|
+
}(e), e.obflag & P.obflag_created && e.gclass.gmt.mt_destroy && e.gclass.gmt.mt_destroy(e), n && Y(t("💔💔⏪ destroyed: %s", ht(e))), e.obflag |= P.obflag_destroyed, e.obflag & P.obflag_created && e.gclass.instances--;
|
|
778
778
|
}
|
|
779
779
|
function Xe(e) {
|
|
780
|
-
if (
|
|
781
|
-
if (e.running) return
|
|
782
|
-
if (e.disabled) return
|
|
783
|
-
ne(e) &&
|
|
780
|
+
if (St(e)) return xn("gobj NULL or DESTROYED"), -1;
|
|
781
|
+
if (e.running) return xn(`${Tt(e)}: GObj ALREADY RUNNING`), -1;
|
|
782
|
+
if (e.disabled) return xn(`${Tt(e)}: GObj DISABLED`), -1;
|
|
783
|
+
ne(e) && Y(t("⏺ ⏺ start: %s", ht(e))), e.running = !0;
|
|
784
784
|
let n = 0;
|
|
785
785
|
return e.gclass.gmt.mt_start && (n = e.gclass.gmt.mt_start(e)), n;
|
|
786
786
|
}
|
|
787
787
|
function Ze(e, t, n) {
|
|
788
|
-
return e.gclass.gclass_flag & C.gcflag_manual_start ||
|
|
788
|
+
return e.gclass.gclass_flag & C.gcflag_manual_start || St(e) || ut(e) || _t(e) || Xe(e), 0;
|
|
789
789
|
}
|
|
790
790
|
function et(e) {
|
|
791
|
-
return
|
|
791
|
+
return St(e) ? (xn("gobj NULL or DESTROYED"), -1) : wt(e, F.WALK_FIRST2LAST, Ze, 0, 0);
|
|
792
792
|
}
|
|
793
793
|
function tt(e, t, n) {
|
|
794
794
|
return e.gclass.gclass_flag & C.gcflag_manual_start || _t(e) ? 1 : (ut(e) || Xe(e), 0);
|
|
795
795
|
}
|
|
796
796
|
function nt(e) {
|
|
797
|
-
return
|
|
797
|
+
return St(e) ? (xn("gobj NULL or DESTROYED"), -1) : (ne(e) && Y(t("⏺ ⏺ ⏺ ⏺ start_tree: %s", ht(e))), e.gclass.gclass_flag & C.gcflag_manual_start || e.disabled ? 0 : (e.running || Xe(e), Dt(e, F.WALK_TOP2BOTTOM, tt, 0, 0)));
|
|
798
798
|
}
|
|
799
799
|
function rt(e) {
|
|
800
|
-
if (
|
|
801
|
-
if (!e.running) return
|
|
802
|
-
e.playing && (
|
|
800
|
+
if (St(e)) return xn("gobj NULL or DESTROYED"), -1;
|
|
801
|
+
if (!e.running) return xn(`${Tt(e)}: GObj NOT RUNNING`), -1;
|
|
802
|
+
e.playing && (Yn(`${Tt(e)}: GObj stopping without previous pause`), at(e)), ne(e) && Y(t("⏹ ⏹ stop: %s", ht(e))), e.running = !1;
|
|
803
803
|
let n = 0;
|
|
804
804
|
return e.gclass.gmt.mt_stop && (n = e.gclass.gmt.mt_stop(e)), n;
|
|
805
805
|
}
|
|
806
806
|
function lt(e, t, n) {
|
|
807
807
|
return ut(e) && rt(e), 0;
|
|
808
808
|
}
|
|
809
|
-
function it(e) {
|
|
810
|
-
return Ot(e) ? (Yn("gobj NULL or DESTROYED"), -1) : wt(e, F.WALK_FIRST2LAST, lt, 0, 0);
|
|
811
|
-
}
|
|
812
809
|
function ot(e) {
|
|
813
|
-
return
|
|
810
|
+
return St(e) ? (xn("gobj NULL or DESTROYED"), -1) : wt(e, F.WALK_FIRST2LAST, lt, 0, 0);
|
|
811
|
+
}
|
|
812
|
+
function it(e) {
|
|
813
|
+
return St(e) ? (xn("gobj NULL or DESTROYED"), -1) : (ne(e) && Y(t("⏹ ⏹ ⏹ ⏹ stop_tree: %s", ht(e))), ut(e) && rt(e), Dt(e, F.WALK_TOP2BOTTOM, lt, 0, 0));
|
|
814
814
|
}
|
|
815
815
|
function st(e) {
|
|
816
|
-
if (
|
|
817
|
-
if (e.playing) return
|
|
818
|
-
if (e.disabled) return
|
|
816
|
+
if (St(e)) return xn(`gobj NULL or DESTROYED: ${Tt(e)}`), -1;
|
|
817
|
+
if (e.playing) return xn(`${Tt(e)}: GObj ALREADY PLAYING`), -1;
|
|
818
|
+
if (e.disabled) return xn(`${Tt(e)}: GObj DISABLED`), -1;
|
|
819
819
|
if (!ut(e)) {
|
|
820
|
-
if (e.gclass.gclass_flag & C.gcflag_required_start_to_play) return
|
|
821
|
-
|
|
820
|
+
if (e.gclass.gclass_flag & C.gcflag_required_start_to_play) return xn(`${Tt(e)}: Cannot play, start not done`), -1;
|
|
821
|
+
Yn(`${Tt(e)}: GObj playing without previous start`), Xe(e);
|
|
822
822
|
}
|
|
823
|
-
ne(e) &&
|
|
823
|
+
ne(e) && Y(t("⏯ ⏯ play: %s", ht(e))), e.playing = !0;
|
|
824
824
|
let n = 0;
|
|
825
825
|
return e.gclass.gmt.mt_play && (n = e.gclass.gmt.mt_play(e), (n < 0 || !1 === n) && (e.playing = !1)), n;
|
|
826
826
|
}
|
|
827
827
|
function at(e) {
|
|
828
|
-
return
|
|
828
|
+
return St(e) ? (xn("gobj NULL or DESTROYED"), -1) : e.playing ? (ne(e) && Y(t("⏸ ⏸ pause: %s", ht(e))), e.playing = !1, e.gclass.gmt.mt_pause ? e.gclass.gmt.mt_pause(e) : 0) : (xn(`${Tt(e)}: GObj NOT PLAYING`), -1);
|
|
829
829
|
}
|
|
830
830
|
function ut(e) {
|
|
831
|
-
return !
|
|
831
|
+
return !St(e) && e.running;
|
|
832
832
|
}
|
|
833
833
|
function _t(e) {
|
|
834
|
-
return !!
|
|
834
|
+
return !!St(e) || e.disabled;
|
|
835
835
|
}
|
|
836
836
|
function ct(e) {
|
|
837
837
|
return !!(e && e.gobj_flag & L.gobj_flag_service);
|
|
838
838
|
}
|
|
839
839
|
function ft(e) {
|
|
840
|
-
return !
|
|
840
|
+
return !St(e) && e.playing;
|
|
841
841
|
}
|
|
842
842
|
function gt() {
|
|
843
843
|
return !E || E.obflag & P.obflag_destroyed ? null : E;
|
|
844
844
|
}
|
|
845
845
|
function dt() {
|
|
846
846
|
let e = gt();
|
|
847
|
-
return e ?
|
|
847
|
+
return e ? mt(e) : "";
|
|
848
848
|
}
|
|
849
849
|
function bt() {
|
|
850
850
|
let e = gt();
|
|
851
|
-
return e ?
|
|
851
|
+
return e ? Yt(e, "yuno_role") : "";
|
|
852
852
|
}
|
|
853
|
-
function
|
|
853
|
+
function pt() {
|
|
854
854
|
let e = gt();
|
|
855
|
-
return e ?
|
|
855
|
+
return e ? Yt(e, "yuno_id") : "";
|
|
856
856
|
}
|
|
857
|
-
function
|
|
858
|
-
return
|
|
857
|
+
function mt(e) {
|
|
858
|
+
return vr(e) ? e.gobj_name : (xn("gobj bad type"), null);
|
|
859
859
|
}
|
|
860
860
|
function Et(e) {
|
|
861
|
-
return
|
|
861
|
+
return vr(e) ? e.gclass.gclass_name : (xn("gobj NULL of bad type"), null);
|
|
862
862
|
}
|
|
863
863
|
function Tt(e) {
|
|
864
|
-
return
|
|
864
|
+
return vr(e) ? e.gclass.gclass_name + "^" + mt(e) : (xn("gobj bad type"), null);
|
|
865
865
|
}
|
|
866
866
|
function ht(e) {
|
|
867
|
-
if (!
|
|
867
|
+
if (!vr(e)) return xn("gobj NULL of bad type"), null;
|
|
868
868
|
let t = Tt(e), n = yt(e);
|
|
869
869
|
for (; n;) t = Tt(n) + "`" + t, n = yt(n);
|
|
870
870
|
return t;
|
|
871
871
|
}
|
|
872
872
|
function yt(e) {
|
|
873
|
-
return
|
|
874
|
-
}
|
|
875
|
-
function St(e) {
|
|
876
|
-
return Sr(e) ? !!(e.gobj_flag & L.gobj_flag_volatil) : (Yn("gobj NULL of bad type"), null);
|
|
873
|
+
return vr(e) ? e.parent : (xn("gobj NULL of bad type"), null);
|
|
877
874
|
}
|
|
878
875
|
function vt(e) {
|
|
879
|
-
return
|
|
876
|
+
return vr(e) ? !!(e.gobj_flag & L.gobj_flag_volatil) : (xn("gobj NULL of bad type"), null);
|
|
880
877
|
}
|
|
881
878
|
function Ot(e) {
|
|
882
|
-
return
|
|
879
|
+
return vr(e) ? !!(e.gobj_flag & L.gobj_flag_pure_child) : (xn("gobj NULL of bad type"), null);
|
|
880
|
+
}
|
|
881
|
+
function St(e) {
|
|
882
|
+
return !vr(e) || !!(e.obflag & (P.obflag_destroyed | P.obflag_destroying));
|
|
883
883
|
}
|
|
884
884
|
function Nt(e) {
|
|
885
|
-
return
|
|
885
|
+
return vr(e) ? e.bottom_gobj : (xn("gobj NULL of bad type"), null);
|
|
886
886
|
}
|
|
887
887
|
function Rt(e, t) {
|
|
888
|
-
if (!
|
|
889
|
-
e.bottom_gobj &&
|
|
888
|
+
if (!vr(e)) return xn("gobj NULL of bad type"), null;
|
|
889
|
+
e.bottom_gobj && Yn(`${Tt(e)}: bottom_gobj already set`), e.bottom_gobj = t;
|
|
890
890
|
}
|
|
891
|
-
function
|
|
892
|
-
return
|
|
891
|
+
function jt(e, t, n) {
|
|
892
|
+
return vr(e) ? t ? he(e.gclass, t, n) : e.gclass.attrs_table : (xn("gobj NULL of bad type"), null);
|
|
893
893
|
}
|
|
894
894
|
function wt(e, t, n, r, l) {
|
|
895
|
-
return
|
|
895
|
+
return St(e) ? (xn("gobj NULL, destroying, or bad type"), 0) : It(e.dl_children, t, n, r, l);
|
|
896
896
|
}
|
|
897
|
-
function
|
|
898
|
-
return
|
|
897
|
+
function Dt(e, t, n, r, l) {
|
|
898
|
+
return St(e) ? (xn("gobj NULL, destroying, or bad type"), 0) : kt(e.dl_children, t, n, r, l);
|
|
899
899
|
}
|
|
900
900
|
function At(e) {
|
|
901
|
-
return "number" == typeof e && isFinite(e) ? e : (null == e ||
|
|
901
|
+
return "number" == typeof e && isFinite(e) ? e : (null == e || xn(`walk callback must return a NUMBER (-1 stop, 0 descend, >0 skip children), got ${typeof e}: taken as 0`), 0);
|
|
902
902
|
}
|
|
903
903
|
function It(e, t, n, r, l) {
|
|
904
|
-
let
|
|
905
|
-
if (t & F.WALK_LAST2FIRST) for (let e =
|
|
906
|
-
|
|
907
|
-
let t = At(n(
|
|
904
|
+
let o, i = [...e];
|
|
905
|
+
if (t & F.WALK_LAST2FIRST) for (let e = i.length; e > 0; e--) {
|
|
906
|
+
o = i[e - 1];
|
|
907
|
+
let t = At(n(o, r, l));
|
|
908
908
|
if (t < 0) return t;
|
|
909
909
|
}
|
|
910
|
-
else for (let e = 0; e <
|
|
911
|
-
|
|
912
|
-
let t = At(n(
|
|
910
|
+
else for (let e = 0; e < i.length; e++) {
|
|
911
|
+
o = i[e];
|
|
912
|
+
let t = At(n(o, r, l));
|
|
913
913
|
if (t < 0) return t;
|
|
914
914
|
}
|
|
915
915
|
return 0;
|
|
916
916
|
}
|
|
917
917
|
function $t(e, t, n, r, l) {
|
|
918
|
-
let
|
|
919
|
-
if (
|
|
918
|
+
let o, i = It(e, t, n, r, l);
|
|
919
|
+
if (i < 0) return i;
|
|
920
920
|
if (t & F.WALK_LAST2FIRST) {
|
|
921
|
-
for (let s = e.length; s > 0; s--) if (
|
|
922
|
-
} else for (let s = 0; s < e.length; s++) if (
|
|
923
|
-
return
|
|
921
|
+
for (let s = e.length; s > 0; s--) if (o = e[s - 1], i = $t([...o.dl_children], t, n, r, l), i < 0) return i;
|
|
922
|
+
} else for (let s = 0; s < e.length; s++) if (o = e[s], i = $t([...o.dl_children], t, n, r, l), i < 0) return i;
|
|
923
|
+
return i;
|
|
924
924
|
}
|
|
925
925
|
function kt(e, t, n, r, l) {
|
|
926
926
|
if (t & F.WALK_BYLEVEL) return $t(e, t, n, r, l);
|
|
927
|
-
let
|
|
927
|
+
let o, i;
|
|
928
928
|
if (t & F.WALK_BOTTOM2TOP) for (let s = e.length; s > 0; s--) {
|
|
929
|
-
if (
|
|
930
|
-
if (
|
|
929
|
+
if (i = e[s - 1], o = kt([...i.dl_children], t, n, r, l), o < 0) return o;
|
|
930
|
+
if (o = At(n(i, r, l)), o < 0) return o;
|
|
931
931
|
}
|
|
932
932
|
else for (let s = 0; s < e.length; s++) {
|
|
933
|
-
if (
|
|
934
|
-
if (0 ===
|
|
933
|
+
if (i = e[s], o = At(n(i, r, l)), o < 0) return o;
|
|
934
|
+
if (0 === o && (o = kt([...i.dl_children], t, n, r, l), o < 0)) return o;
|
|
935
935
|
}
|
|
936
936
|
return 0;
|
|
937
937
|
}
|
|
938
938
|
function Ct(e, t) {
|
|
939
|
-
if (
|
|
939
|
+
if (Or(t)) return null;
|
|
940
940
|
const n = t.toLowerCase();
|
|
941
941
|
return "__default_service__" === n ? T : "__yuno__" === n || "__root__" === n ? E : Gt(E, t);
|
|
942
942
|
}
|
|
943
943
|
function Lt(e, t) {
|
|
944
|
-
if (!
|
|
944
|
+
if (!vr(e)) return xn("gobj NULL of bad type"), !1;
|
|
945
945
|
let n = t.__gclass_name__, r = t.__gobj_name__, l = t.__prefix_gobj_name__;
|
|
946
946
|
t.__disabled__;
|
|
947
|
-
let
|
|
947
|
+
let o = t.__state__;
|
|
948
948
|
if (n && n !== Et(e)) return !1;
|
|
949
|
-
if (r && r !==
|
|
949
|
+
if (r && r !== mt(e)) return !1;
|
|
950
950
|
if (l) {
|
|
951
951
|
let t = l.length;
|
|
952
|
-
if (l !==
|
|
952
|
+
if (l !== mt(e).substring(0, t)) return !1;
|
|
953
953
|
}
|
|
954
|
-
if (
|
|
955
|
-
let
|
|
956
|
-
for (const n of Object.keys(t)) if ("__gclass_name__" !== n && "__gobj_name__" !== n && "__prefix_gobj_name__" !== n && "__disabled__" !== n && "__state__" !== n && Vt(e, n) &&
|
|
954
|
+
if (o && o !== en(e)) return !1;
|
|
955
|
+
let i = e.jn_attrs;
|
|
956
|
+
for (const n of Object.keys(t)) if ("__gclass_name__" !== n && "__gobj_name__" !== n && "__prefix_gobj_name__" !== n && "__disabled__" !== n && "__state__" !== n && Vt(e, n) && i[n] !== t[n]) return !1;
|
|
957
957
|
return !0;
|
|
958
958
|
}
|
|
959
959
|
function Pt(e, t) {
|
|
960
|
-
if (
|
|
960
|
+
if (St(e)) return xn("gobj NULL or DESTROYED"), null;
|
|
961
961
|
const n = e.dl_children;
|
|
962
962
|
for (let e = 0; e < n.length; e++) {
|
|
963
963
|
const r = n[e];
|
|
@@ -966,7 +966,7 @@ function Pt(e, t) {
|
|
|
966
966
|
return null;
|
|
967
967
|
}
|
|
968
968
|
function Ut(e, t) {
|
|
969
|
-
if (
|
|
969
|
+
if (St(e)) return xn("gobj NULL or DESTROYED"), null;
|
|
970
970
|
t = t || {};
|
|
971
971
|
let n = [];
|
|
972
972
|
const r = e.dl_children;
|
|
@@ -982,8 +982,8 @@ function Ft(e, t) {
|
|
|
982
982
|
return function e(n, r) {
|
|
983
983
|
let l = r.dl_children;
|
|
984
984
|
for (let r = 0; r < l.length; r++) {
|
|
985
|
-
let
|
|
986
|
-
Lt(
|
|
985
|
+
let o = l[r];
|
|
986
|
+
Lt(o, t) && n.push(o), e(n, o);
|
|
987
987
|
}
|
|
988
988
|
}(n, e), n;
|
|
989
989
|
}
|
|
@@ -998,16 +998,16 @@ function Gt(e, t) {
|
|
|
998
998
|
if (1 !== n.length) return !1;
|
|
999
999
|
r = n[0];
|
|
1000
1000
|
}
|
|
1001
|
-
return r ===
|
|
1001
|
+
return r === mt(e);
|
|
1002
1002
|
}(e, n[0])) return null;
|
|
1003
1003
|
if (1 === n.length) return e;
|
|
1004
1004
|
let r = n[1].split("^"), l = {};
|
|
1005
1005
|
1 === r.length ? l.__gobj_name__ = r : (l.__gclass_name__ = r[0], l.__gobj_name__ = r[1]);
|
|
1006
|
-
let
|
|
1007
|
-
return
|
|
1006
|
+
let o = Pt(e, l);
|
|
1007
|
+
return o ? (n.splice(0, 1), n = n.join("`"), Gt(o, n)) : null;
|
|
1008
1008
|
}
|
|
1009
1009
|
function Vt(e, t) {
|
|
1010
|
-
return !
|
|
1010
|
+
return !Or(t) && !!he(e.gclass, t, !1);
|
|
1011
1011
|
}
|
|
1012
1012
|
function Mt(e, t, n) {
|
|
1013
1013
|
let r = e.jn_attrs;
|
|
@@ -1015,118 +1015,118 @@ function Mt(e, t, n) {
|
|
|
1015
1015
|
let n = r[t];
|
|
1016
1016
|
return e.gclass.gmt.mt_reading ? e.gclass.gmt.mt_reading(e, t, n) : n;
|
|
1017
1017
|
}
|
|
1018
|
-
return
|
|
1018
|
+
return xn(`${Tt(e)}: GClass Attribute NOT FOUND, attr ${t}`), null;
|
|
1019
1019
|
}
|
|
1020
1020
|
function Wt(e, t, n) {
|
|
1021
1021
|
let r = {}, l = e.gclass.attrs_table;
|
|
1022
1022
|
for (let n = 0; n < l.length; n++) {
|
|
1023
|
-
const
|
|
1024
|
-
if (
|
|
1023
|
+
const o = l[n];
|
|
1024
|
+
if (o.name && (-1 === t || o.flag & t)) {
|
|
1025
1025
|
let t;
|
|
1026
|
-
!e.gclass.gmt.mt_reading || e.obflag & P.obflag_destroyed ? t = nr(e.jn_attrs,
|
|
1026
|
+
!e.gclass.gmt.mt_reading || e.obflag & P.obflag_destroyed ? t = nr(e.jn_attrs, o.name) : (t = e.gclass.gmt.mt_reading(e, o.name), void 0 === t && (t = nr(e.jn_attrs, o.name))), lr(r, o.name, t);
|
|
1027
1027
|
}
|
|
1028
1028
|
}
|
|
1029
1029
|
return r;
|
|
1030
1030
|
}
|
|
1031
1031
|
function Kt(e, t) {
|
|
1032
1032
|
if (t) {
|
|
1033
|
-
if (0 ===
|
|
1034
|
-
if (0 ===
|
|
1035
|
-
if (0 ===
|
|
1036
|
-
if (0 ===
|
|
1033
|
+
if (0 === jr(t, "__disabled__")) return _t(e);
|
|
1034
|
+
if (0 === jr(t, "__running__")) return ut(e);
|
|
1035
|
+
if (0 === jr(t, "__playing__")) return ft(e);
|
|
1036
|
+
if (0 === jr(t, "__service__")) return ct(e);
|
|
1037
1037
|
}
|
|
1038
1038
|
let n = Te(e, t, !1);
|
|
1039
|
-
return n ? !e.gclass.gmt.mt_reading || e.obflag & P.obflag_destroyed ? nr(n, t) : e.gclass.gmt.mt_reading(e, t) : (
|
|
1039
|
+
return n ? !e.gclass.gmt.mt_reading || e.obflag & P.obflag_destroyed ? nr(n, t) : e.gclass.gmt.mt_reading(e, t) : (xn(`${Tt(e)}: GClass Attribute NOT FOUND, attr ${t}`), 0);
|
|
1040
1040
|
}
|
|
1041
|
-
function
|
|
1042
|
-
t &&
|
|
1041
|
+
function xt(e, t) {
|
|
1042
|
+
t && jr(t, "__trace_level__");
|
|
1043
1043
|
let n = Te(e, t, !1);
|
|
1044
|
-
return n ? !e.gclass.gmt.mt_reading || e.obflag & P.obflag_destroyed ? nr(n, t) : e.gclass.gmt.mt_reading(e, t) : (
|
|
1044
|
+
return n ? !e.gclass.gmt.mt_reading || e.obflag & P.obflag_destroyed ? nr(n, t) : e.gclass.gmt.mt_reading(e, t) : (xn(`${Tt(e)}: GClass Attribute NOT FOUND, attr ${t}`), 0);
|
|
1045
1045
|
}
|
|
1046
|
-
function
|
|
1047
|
-
if (t && 0 ===
|
|
1046
|
+
function Yt(e, t) {
|
|
1047
|
+
if (t && 0 === jr(t, "__state__")) return en(e);
|
|
1048
1048
|
let n = Te(e, t, !1);
|
|
1049
|
-
return n ? !e.gclass.gmt.mt_reading || e.obflag & P.obflag_destroyed ? nr(n, t) : e.gclass.gmt.mt_reading(e, t) : (
|
|
1049
|
+
return n ? !e.gclass.gmt.mt_reading || e.obflag & P.obflag_destroyed ? nr(n, t) : e.gclass.gmt.mt_reading(e, t) : (xn(`${Tt(e)}: GClass Attribute NOT FOUND, attr ${t}`), 0);
|
|
1050
1050
|
}
|
|
1051
1051
|
function Bt(e, t) {
|
|
1052
1052
|
let n = Te(e, t, !1);
|
|
1053
|
-
return n ? !e.gclass.gmt.mt_reading || e.obflag & P.obflag_destroyed ? nr(n, t) : e.gclass.gmt.mt_reading(e, t) : (
|
|
1053
|
+
return n ? !e.gclass.gmt.mt_reading || e.obflag & P.obflag_destroyed ? nr(n, t) : e.gclass.gmt.mt_reading(e, t) : (xn(`${Tt(e)}: GClass Attribute NOT FOUND, attr ${t}`), 0);
|
|
1054
1054
|
}
|
|
1055
1055
|
function Jt(e, n, r, l) {
|
|
1056
|
-
if (!br(n)) return
|
|
1057
|
-
let
|
|
1056
|
+
if (!br(n)) return xn(t("gobj_write_attr(%s): path must be a string", Tt(e))), -1;
|
|
1057
|
+
let o, i = e.jn_attrs, s = n.split("`");
|
|
1058
1058
|
if (s.length <= 1) {
|
|
1059
1059
|
let l = n;
|
|
1060
|
-
return l in
|
|
1060
|
+
return l in i && i.hasOwnProperty(l) ? (i[l] = r, gr(e.priv) && e.priv.hasOwnProperty(l) && (e.priv[l] = r), e.obflag & P.obflag_created && !(e.obflag & P.obflag_destroyed) && e.gclass.gmt.mt_writing && e.gclass.gmt.mt_writing(e, l), 0) : (xn(t("gobj_write_attr(%s): attr not found '%s'", Tt(e), l)), -1);
|
|
1061
1061
|
}
|
|
1062
1062
|
let a = s.length;
|
|
1063
1063
|
for (let t = 0; t < a; t++) {
|
|
1064
|
-
|
|
1065
|
-
let n = Pt(e, { __gobj_name__:
|
|
1064
|
+
o = s[t];
|
|
1065
|
+
let n = Pt(e, { __gobj_name__: o });
|
|
1066
1066
|
if (n && t < a - 1) {
|
|
1067
1067
|
e = n;
|
|
1068
1068
|
continue;
|
|
1069
1069
|
}
|
|
1070
1070
|
let l = e.jn_attrs;
|
|
1071
|
-
if (
|
|
1071
|
+
if (o in l && l.hasOwnProperty(o)) return l[o] = r, gr(e.priv) && e.priv.hasOwnProperty(o) && (e.priv[o] = r), e.obflag & P.obflag_created && !(e.obflag & P.obflag_destroyed) && e.mt_writing && e.mt_writing(e, o), 0;
|
|
1072
1072
|
break;
|
|
1073
1073
|
}
|
|
1074
|
-
return
|
|
1074
|
+
return xn(t("gobj_write_attr(%s): attr not found '%s'", Tt(e), o)), -1;
|
|
1075
1075
|
}
|
|
1076
1076
|
function qt(e) {
|
|
1077
1077
|
return function(e, t, n) {
|
|
1078
|
-
if (
|
|
1078
|
+
if (St(e)) return xn("gobj NULL or DESTROYED"), -1;
|
|
1079
1079
|
let r = e.gclass.attrs_table;
|
|
1080
1080
|
for (let l = 0; l < r.length; l++) {
|
|
1081
|
-
const
|
|
1082
|
-
if (
|
|
1083
|
-
const t =
|
|
1084
|
-
gr(e.priv) && e.priv.hasOwnProperty(
|
|
1081
|
+
const o = r[l];
|
|
1082
|
+
if (o.name && !(n && o.flag & n) && (-1 === t || o.flag & t)) {
|
|
1083
|
+
const t = pe(e, e.jn_attrs, o);
|
|
1084
|
+
gr(e.priv) && e.priv.hasOwnProperty(o.name) && (e.priv[o.name] = t), e.gclass.gmt.mt_writing && e.gclass.gmt.mt_writing(e, o.name);
|
|
1085
1085
|
}
|
|
1086
1086
|
}
|
|
1087
1087
|
return 0;
|
|
1088
|
-
}(e,
|
|
1088
|
+
}(e, v.SDF_VOLATIL, 0);
|
|
1089
1089
|
}
|
|
1090
1090
|
function Ht(e, t, n, r) {
|
|
1091
|
-
let l = Ee(e),
|
|
1092
|
-
for (const [r,
|
|
1093
|
-
let t =
|
|
1094
|
-
t && (-1 === n || t.flag & n) && (
|
|
1091
|
+
let l = Ee(e), o = 0;
|
|
1092
|
+
for (const [r, i] of Object.entries(t)) {
|
|
1093
|
+
let t = jt(e, r, !0);
|
|
1094
|
+
t && (-1 === n || t.flag & n) && (o += me(e, l, t, i));
|
|
1095
1095
|
}
|
|
1096
|
-
return
|
|
1096
|
+
return o;
|
|
1097
1097
|
}
|
|
1098
1098
|
function Qt(e, t, n) {
|
|
1099
1099
|
let r = Te(e, t, !1);
|
|
1100
|
-
return r ? (r[t] =
|
|
1100
|
+
return r ? (r[t] = Sr(n), gr(e.priv) && e.priv.hasOwnProperty(t) && (e.priv[t] = n), e.obflag & P.obflag_created && !(e.obflag & P.obflag_destroyed) && e.gclass.gmt.mt_writing && e.gclass.gmt.mt_writing(e, t), 0) : (xn(`${Tt(e)}: GClass Attribute NOT FOUND, attr ${t}`), -1);
|
|
1101
1101
|
}
|
|
1102
1102
|
function zt(e, t, n) {
|
|
1103
1103
|
let r = Te(e, t, !1);
|
|
1104
|
-
return r ? (r[t] = parseInt(n), gr(e.priv) && e.priv.hasOwnProperty(t) && (e.priv[t] = n), e.obflag & P.obflag_created && !(e.obflag & P.obflag_destroyed) && e.gclass.gmt.mt_writing && e.gclass.gmt.mt_writing(e, t), 0) : (
|
|
1104
|
+
return r ? (r[t] = parseInt(n), gr(e.priv) && e.priv.hasOwnProperty(t) && (e.priv[t] = n), e.obflag & P.obflag_created && !(e.obflag & P.obflag_destroyed) && e.gclass.gmt.mt_writing && e.gclass.gmt.mt_writing(e, t), 0) : (xn(`${Tt(e)}: GClass Attribute NOT FOUND, attr ${t}`), -1);
|
|
1105
1105
|
}
|
|
1106
1106
|
function Xt(e, t, n) {
|
|
1107
1107
|
let r = Te(e, t, !1);
|
|
1108
|
-
return r ? (r[t] = String(n), gr(e.priv) && e.priv.hasOwnProperty(t) && (e.priv[t] = n), e.obflag & P.obflag_created && !(e.obflag & P.obflag_destroyed) && e.gclass.gmt.mt_writing && e.gclass.gmt.mt_writing(e, t), 0) : (
|
|
1108
|
+
return r ? (r[t] = String(n), gr(e.priv) && e.priv.hasOwnProperty(t) && (e.priv[t] = n), e.obflag & P.obflag_created && !(e.obflag & P.obflag_destroyed) && e.gclass.gmt.mt_writing && e.gclass.gmt.mt_writing(e, t), 0) : (xn(`${Tt(e)}: GClass Attribute NOT FOUND, attr ${t}`), -1);
|
|
1109
1109
|
}
|
|
1110
1110
|
function Zt(e, n) {
|
|
1111
|
-
if (
|
|
1111
|
+
if (St(e)) return xn("gobj NULL or DESTROYED"), null;
|
|
1112
1112
|
if (e.current_state.state_name === n) return !1;
|
|
1113
|
-
let r =
|
|
1114
|
-
if (!r) return
|
|
1113
|
+
let r = Oe(e.gclass, n);
|
|
1114
|
+
if (!r) return xn(`${Tt(e)}: state unknown, state ${n}`), !1;
|
|
1115
1115
|
e.last_state = e.current_state, e.current_state = r;
|
|
1116
|
-
let l = re(e, "EV_STATE_CHANGED"),
|
|
1116
|
+
let l = re(e, "EV_STATE_CHANGED"), o = !!function(e) {
|
|
1117
1117
|
return X(e) & B.TRACE_STATES;
|
|
1118
1118
|
}(e);
|
|
1119
|
-
return (l ||
|
|
1119
|
+
return (l || o) && (1 === W || Y(t("🔀🔀 mach(%s%s^%s), new st(%s), prev st(%s)", e.running ? "" : "!!", Et(e), mt(e), en(e), e.last_state.state_name))), !0;
|
|
1120
1120
|
}
|
|
1121
1121
|
function en(e) {
|
|
1122
|
-
return
|
|
1122
|
+
return vr(e) ? e.current_state.state_name : (xn("hgobj NULL"), "");
|
|
1123
1123
|
}
|
|
1124
1124
|
function tn(e, n) {
|
|
1125
|
-
return
|
|
1125
|
+
return St(e) ? (xn("gobj NULL or DESTROYED"), null) : n instanceof k ? (e.parent && e.parent.mt_child_removed && e.parent.mt_child_removed(e.parent, e), e.parent && (Ue(e.parent, e), e.parent = null), Pe(n, e), n.mt_child_added && (te(e) && Jn(t("👦👦🔵 child_added(%s): %s", ht(n), Tt(e))), n.mt_child_added(n, e)), 0) : (xn(`${Tt(e)}: gobj_change_parent() BAD TYPE of parent`), -1);
|
|
1126
1126
|
}
|
|
1127
1127
|
function nn(e, t, n) {
|
|
1128
|
-
if (!
|
|
1129
|
-
let r =
|
|
1128
|
+
if (!vr(e)) return xn("gobj NULL of bad type"), null;
|
|
1129
|
+
let r = De(e.gclass, t);
|
|
1130
1130
|
if (r) return r;
|
|
1131
1131
|
if (n) {
|
|
1132
1132
|
const e = b.length, n = b;
|
|
@@ -1147,12 +1147,12 @@ function ln(e, t, n) {
|
|
|
1147
1147
|
}
|
|
1148
1148
|
var on = [], sn = !1;
|
|
1149
1149
|
function an(e, n, r, l) {
|
|
1150
|
-
return e && e instanceof k ? e.obflag & (P.obflag_destroyed | P.obflag_destroying) ? (
|
|
1150
|
+
return e && e instanceof k ? e.obflag & (P.obflag_destroyed | P.obflag_destroying) ? (xn(`gobj_post_event(): gobj dst DESTROYING, event ${n}`), -1) : Or(n) ? (xn("gobj_post_event(): event EMPTY"), -1) : rn(e, n, 0) ? on.length >= 1e4 ? (xn(`gobj_post_event(): too many posted events, this is NOT a work queue, event ${n}, pending ${on.length}`), -1) : (on.push({
|
|
1151
1151
|
dst: e,
|
|
1152
1152
|
event: n,
|
|
1153
1153
|
kw: r,
|
|
1154
1154
|
src: l
|
|
1155
|
-
}), re(e, n) && !le(l, n) &&
|
|
1155
|
+
}), re(e, n) && !le(l, n) && Y(t("📬 posted(%s%s), ev: %s, pending: %d", e.running ? "" : "!!", Tt(e), n, on.length)), sn || (sn = !0, setTimeout(_n, 0)), 0) : (xn(`gobj_post_event(): event NOT DEFINED in gclass ${Et(e)}, event ${n}`), -1) : (xn(`gobj_post_event(): gobj dst NULL, event ${n}`), -1);
|
|
1156
1156
|
}
|
|
1157
1157
|
function un() {
|
|
1158
1158
|
return on.length;
|
|
@@ -1166,19 +1166,19 @@ function _n() {
|
|
|
1166
1166
|
return on.length > 0 && !sn && (sn = !0, setTimeout(_n, 0)), t;
|
|
1167
1167
|
}
|
|
1168
1168
|
function cn(e, n, r, l) {
|
|
1169
|
-
if (!(e && e instanceof k)) return
|
|
1170
|
-
if (e.obflag & (P.obflag_destroyed | P.obflag_destroying)) return
|
|
1171
|
-
let
|
|
1172
|
-
if (!
|
|
1173
|
-
let
|
|
1169
|
+
if (!(e && e instanceof k)) return xn("gobj dst NULL"), -1;
|
|
1170
|
+
if (e.obflag & (P.obflag_destroyed | P.obflag_destroying)) return xn("gobj dst DESTROYED"), -1;
|
|
1171
|
+
let o = e.current_state;
|
|
1172
|
+
if (!o) return xn(`${Tt(e)}: current_state NULL`), -1;
|
|
1173
|
+
let i = re(e, n) && !le(l, n);
|
|
1174
1174
|
h++;
|
|
1175
|
-
let s =
|
|
1176
|
-
if (!s) return e.gclass.gmt.mt_inject_event ? (h--,
|
|
1177
|
-
if (
|
|
1178
|
-
if (1 === W)
|
|
1175
|
+
let s = Se(o, n);
|
|
1176
|
+
if (!s) return e.gclass.gmt.mt_inject_event ? (h--, i && (Y(1 === W ? t("🔜 %s %s%s %s", n || "", e.running ? "" : "!!", Tt(e), o.state_name) : t("🔃 mach(%s%s), st: %s, ev: %s, from(%s%s)", e.running ? "" : "!!", Tt(e), o.state_name, n || "", l && !l.running ? "!!" : "", Tt(l))), r && i > 1 && _r(r) && Hn(r)), e.gclass.gmt.mt_inject_event(e, n, r, l)) : (i && Y(t("📛 mach(%s%s^%s), st: %s, ev: %s, 📛📛ERROR Event NOT DEFINED in state📛📛, from(%s%s^%s)", e.running ? "" : "!!", Et(e), mt(e), o.state_name, n || "", l && !l.running ? "!!" : "", Et(l), mt(l))), xn(`📛📛 Event NOT DEFINED in state 📛📛: ${Tt(e)}, ${o.state_name}, ${n}`), h--, -1);
|
|
1177
|
+
if (i) {
|
|
1178
|
+
if (1 === W) Y(t("🔄 %s %s%s %s from %s%s", n || "", e.running ? "" : "!!", Tt(e), o.state_name, l && !l.running ? "!!" : "", Tt(l)));
|
|
1179
1179
|
else {
|
|
1180
1180
|
let r = "";
|
|
1181
|
-
s.action && (r =
|
|
1181
|
+
s.action && (r = xl(s.action)), Y(t("🔄 mach(%s%s^%s), st: %s, ev: %s%s%s, ac: %s, from(%s%s^%s)", e.running ? "" : "!!", Et(e), mt(e), o.state_name, "", n || "", "", r, l && !l.running ? "!!" : "", Et(l), mt(l)));
|
|
1182
1182
|
}
|
|
1183
1183
|
r && (X(e) | ee()) & B.TRACE_EV_KW && _r(r) && Hn(r);
|
|
1184
1184
|
}
|
|
@@ -1187,7 +1187,7 @@ function cn(e, n, r, l) {
|
|
|
1187
1187
|
try {
|
|
1188
1188
|
s.action && (a = s.action(e, n, r, l));
|
|
1189
1189
|
} finally {}
|
|
1190
|
-
return !
|
|
1190
|
+
return !i || 1 === W || e.obflag & P.obflag_destroyed || Y(t("<- mach(%s%s^%s), st: %s, ev: %s, ret: %d", e.running ? "" : "!!", Et(e), mt(e), e.current_state.state_name, n || "", pr(a) ? a : 0)), h--, a;
|
|
1191
1191
|
}
|
|
1192
1192
|
var fn = Object.freeze({
|
|
1193
1193
|
__hard_subscription__: 1,
|
|
@@ -1203,17 +1203,17 @@ var fn = Object.freeze({
|
|
|
1203
1203
|
N(y.DTP_JSON, "__local__", 0, null, "local kw, remove in publishing"),
|
|
1204
1204
|
N(y.DTP_JSON, "__filter__", 0, null, "filter kw, filter in publishing"),
|
|
1205
1205
|
N(y.DTP_STRING, "__service__", 0, "", "subscription service"),
|
|
1206
|
-
|
|
1206
|
+
S()
|
|
1207
1207
|
];
|
|
1208
1208
|
function dn(e, t, n, r, l) {
|
|
1209
|
-
let
|
|
1210
|
-
if (t && t !== Vr(null, e, "publisher", null) && (u = !1), l && l !== Vr(null, e, "subscriber", null) && (u = !1), n && n !== Gr(null, e, "event", "") && (u = !1), fr(
|
|
1209
|
+
let o = Mr(t, r, "__config__", null), i = Mr(t, r, "__global__", null), s = Mr(t, r, "__local__", null), a = Wr(t, r, "__filter__", null), u = !0;
|
|
1210
|
+
if (t && t !== Vr(null, e, "publisher", null) && (u = !1), l && l !== Vr(null, e, "subscriber", null) && (u = !1), n && n !== Gr(null, e, "event", "") && (u = !1), fr(o) > 0) {
|
|
1211
1211
|
let t = Mr(null, e, "__config__", null);
|
|
1212
|
-
fr(t) > 0 && Xn(t,
|
|
1212
|
+
fr(t) > 0 && Xn(t, o) || (u = !1);
|
|
1213
1213
|
}
|
|
1214
|
-
if (fr(
|
|
1214
|
+
if (fr(i) > 0) {
|
|
1215
1215
|
let t = Mr(null, e, "__global__", null);
|
|
1216
|
-
fr(t) > 0 && Xn(t,
|
|
1216
|
+
fr(t) > 0 && Xn(t, i) || (u = !1);
|
|
1217
1217
|
}
|
|
1218
1218
|
if (fr(s) > 0) {
|
|
1219
1219
|
let t = Mr(null, e, "__local__", null);
|
|
@@ -1226,28 +1226,28 @@ function dn(e, t, n, r, l) {
|
|
|
1226
1226
|
return u;
|
|
1227
1227
|
}
|
|
1228
1228
|
function bn(e, t, n, r, l) {
|
|
1229
|
-
let
|
|
1230
|
-
for (let
|
|
1231
|
-
let s = e[
|
|
1232
|
-
dn(s, t, n, r, l) &&
|
|
1229
|
+
let o = [];
|
|
1230
|
+
for (let i = 0; i < e.length; i++) {
|
|
1231
|
+
let s = e[i];
|
|
1232
|
+
dn(s, t, n, r, l) && ir(o, s);
|
|
1233
1233
|
}
|
|
1234
|
-
return
|
|
1234
|
+
return o;
|
|
1235
1235
|
}
|
|
1236
|
-
function
|
|
1237
|
-
for (let
|
|
1236
|
+
function pn(e, t, n, r, l) {
|
|
1237
|
+
for (let o = 0; o < e.length; o++) if (dn(e[o], t, n, r, l)) return o;
|
|
1238
1238
|
return -1;
|
|
1239
1239
|
}
|
|
1240
|
-
function
|
|
1241
|
-
let
|
|
1242
|
-
if (!!(Ur(e, n, "subs_flag", null,
|
|
1243
|
-
E && Kt(E, "trace_subscriptions") && (
|
|
1244
|
-
let a =
|
|
1245
|
-
return a >= 0 ? ar(
|
|
1240
|
+
function mn(e, n, r, l) {
|
|
1241
|
+
let o = Vr(e, n, "publisher", null, jn.KW_REQUIRED), i = Vr(e, n, "subscriber", null, jn.KW_REQUIRED), s = Gr(e, n, "event", "", jn.KW_REQUIRED);
|
|
1242
|
+
if (!!(Ur(e, n, "subs_flag", null, jn.KW_REQUIRED) & fn.__hard_subscription__) && !r) return -1;
|
|
1243
|
+
E && Kt(E, "trace_subscriptions") && (Y(t("💜💜👎 unsubscribing event '%s': publisher %s, subscriber'%s'", s || "", Tt(o), Tt(i))), Hn(n)), o.obflag & P.obflag_destroyed || l || o.gclass.gmt.mt_subscription_deleted && o.gclass.gmt.mt_subscription_deleted(o, n);
|
|
1244
|
+
let a = pn(o.dl_subscriptions, o, s, n, i);
|
|
1245
|
+
return a >= 0 ? ar(o.dl_subscriptions, a) : (xn(`${Tt(e)}: subscription in publisher not found`), Hn(n)), a = pn(i.dl_subscribings, o, s, n, i), a >= 0 ? ar(i.dl_subscribings, a) : (xn(`${Tt(e)}: subscription in subscriber not found`), Hn(n)), 0;
|
|
1246
1246
|
}
|
|
1247
1247
|
function En(e, n, r, l) {
|
|
1248
|
-
if (null == r && (r = {}), !e) return
|
|
1249
|
-
if (!l) return
|
|
1250
|
-
const
|
|
1248
|
+
if (null == r && (r = {}), !e) return xn(`publisher NULL: ev ${n}`), 0;
|
|
1249
|
+
if (!l) return xn(`subscriber NULL: ev ${n}`), 0;
|
|
1250
|
+
const o = /* @__PURE__ */ new Set([
|
|
1251
1251
|
"__config__",
|
|
1252
1252
|
"__global__",
|
|
1253
1253
|
"__local__",
|
|
@@ -1255,42 +1255,42 @@ function En(e, n, r, l) {
|
|
|
1255
1255
|
"__service__"
|
|
1256
1256
|
]);
|
|
1257
1257
|
if (Object.keys(r).forEach((t) => {
|
|
1258
|
-
|
|
1259
|
-
}),
|
|
1260
|
-
else if (!(ln(e, n, U.EVF_OUTPUT_EVENT) || e.gclass.gclass_flag & C.gcflag_no_check_output_events)) return
|
|
1261
|
-
let
|
|
1262
|
-
cr(
|
|
1258
|
+
o.has(t) || xn(`${Tt(e)}: key ignored in subscription (key: ${t}, event: ${n})`);
|
|
1259
|
+
}), Or(n)) n = "";
|
|
1260
|
+
else if (!(ln(e, n, U.EVF_OUTPUT_EVENT) || e.gclass.gclass_flag & C.gcflag_no_check_output_events)) return xn(`event NOT in output event list: ${Tt(e)}, ${n}`), 0;
|
|
1261
|
+
let i = bn(e.dl_subscriptions, e, n, r, l);
|
|
1262
|
+
cr(i) > 0 && (xn(`${Tt(e)}: ${cr(i)} subscription(s) REPEATED, will be deleted and override`), Hn(i, "subscription REPEATED"), hn(e, i, !1));
|
|
1263
1263
|
let s = function(e, t, n, r) {
|
|
1264
1264
|
let l = be(e, gn);
|
|
1265
|
-
|
|
1266
|
-
let
|
|
1265
|
+
or(l, "event", t), or(l, "subscriber", r), or(l, "publisher", e);
|
|
1266
|
+
let o = 0;
|
|
1267
1267
|
if (n) {
|
|
1268
|
-
let t = Mr(e, n, "__config__", null), r = Mr(e, n, "__global__", null),
|
|
1269
|
-
if (fr(r) > 0 &&
|
|
1268
|
+
let t = Mr(e, n, "__config__", null), r = Mr(e, n, "__global__", null), i = Mr(e, n, "__local__", null), s = Wr(e, n, "__filter__", null), a = Gr(e, n, "__service__", "");
|
|
1269
|
+
if (fr(r) > 0 && or(l, "__global__", Qn(r)), fr(t) > 0) {
|
|
1270
1270
|
let n = Qn(t);
|
|
1271
|
-
if (
|
|
1271
|
+
if (or(l, "__config__", n), kr(n, "__hard_subscription__")) {
|
|
1272
1272
|
let t = Pr(e, n, "__hard_subscription__", !1);
|
|
1273
|
-
rr(n, "__hard_subscription__"), t && (
|
|
1273
|
+
rr(n, "__hard_subscription__"), t && (o |= fn.__hard_subscription__);
|
|
1274
1274
|
}
|
|
1275
1275
|
if (kr(n, "__own_event__")) {
|
|
1276
1276
|
let t = Pr(e, n, "__own_event__", !1);
|
|
1277
|
-
rr(n, "__own_event__"), t && (
|
|
1277
|
+
rr(n, "__own_event__"), t && (o |= fn.__own_event__);
|
|
1278
1278
|
}
|
|
1279
1279
|
}
|
|
1280
|
-
fr(
|
|
1280
|
+
fr(i) > 0 && or(l, "__local__", Qn(i)), fr(s) > 0 && or(l, "__filter__", Qn(s)), Or(a) || or(l, "__service__", a);
|
|
1281
1281
|
}
|
|
1282
|
-
return
|
|
1282
|
+
return or(l, "subs_flag", o), l;
|
|
1283
1283
|
}(e, n, r, l);
|
|
1284
|
-
if (!s) return
|
|
1285
|
-
if (
|
|
1284
|
+
if (!s) return xn(`${Tt(e)}: _create_subscription() FAILED`), 0;
|
|
1285
|
+
if (ir(e.dl_subscriptions, s), ir(l.dl_subscribings, s), E && Kt(E, "trace_subscriptions") && (Y(t("💜💜👍 subscribing event '%s', publisher '%s', subscriber %s", n || "", Tt(e), Tt(l))), r && Hn(r)), e.gclass.gmt.mt_subscription_added) {
|
|
1286
1286
|
let t = e.gclass.gmt.mt_subscription_added(e, s);
|
|
1287
|
-
(t < 0 || !1 === t) && (
|
|
1287
|
+
(t < 0 || !1 === t) && (mn(e, s, !0, !0), s = 0);
|
|
1288
1288
|
}
|
|
1289
1289
|
return s;
|
|
1290
1290
|
}
|
|
1291
1291
|
function Tn(e, t, n, r) {
|
|
1292
|
-
if (null == n && (n = {}), !e) return
|
|
1293
|
-
if (!r) return
|
|
1292
|
+
if (null == n && (n = {}), !e) return xn(`publisher NULL: ev ${t}`), 0;
|
|
1293
|
+
if (!r) return xn(`subscriber NULL: ev ${t}`), 0;
|
|
1294
1294
|
const l = /* @__PURE__ */ new Set([
|
|
1295
1295
|
"__config__",
|
|
1296
1296
|
"__global__",
|
|
@@ -1299,34 +1299,34 @@ function Tn(e, t, n, r) {
|
|
|
1299
1299
|
"__service__"
|
|
1300
1300
|
]);
|
|
1301
1301
|
if (Object.keys(n).forEach((n) => {
|
|
1302
|
-
l.has(n) ||
|
|
1303
|
-
}),
|
|
1304
|
-
else if (!(ln(e, t, U.EVF_OUTPUT_EVENT) || e.gclass.gclass_flag & C.gcflag_no_check_output_events)) return
|
|
1305
|
-
let
|
|
1306
|
-
for (let t = 0; t <
|
|
1307
|
-
let n =
|
|
1308
|
-
|
|
1302
|
+
l.has(n) || xn(`${Tt(e)}: key ignored in subscription (key: ${n}, event: ${t})`);
|
|
1303
|
+
}), Or(t)) t = "";
|
|
1304
|
+
else if (!(ln(e, t, U.EVF_OUTPUT_EVENT) || e.gclass.gclass_flag & C.gcflag_no_check_output_events)) return xn(`event NOT in output event list: ${Tt(e)}, ev ${t}`), 0;
|
|
1305
|
+
let o = bn(e.dl_subscriptions, e, t, n, r), i = 0;
|
|
1306
|
+
for (let t = 0; t < o.length; t++) {
|
|
1307
|
+
let n = o[t];
|
|
1308
|
+
mn(e, n, !1, !1), i++;
|
|
1309
1309
|
}
|
|
1310
|
-
return
|
|
1310
|
+
return i || (Yn(`${Tt(e)}: No subscription found`), Hn(n, "No subscription found")), 0;
|
|
1311
1311
|
}
|
|
1312
1312
|
function hn(e, t, n) {
|
|
1313
1313
|
let r = [...t];
|
|
1314
|
-
for (let t = 0; t < r.length; t++)
|
|
1314
|
+
for (let t = 0; t < r.length; t++) mn(e, r[t], n, !1);
|
|
1315
1315
|
return 0;
|
|
1316
1316
|
}
|
|
1317
1317
|
function yn(e, t, n, r) {
|
|
1318
1318
|
return null == n && (n = {}), bn(e.dl_subscriptions, e, t, n, r);
|
|
1319
1319
|
}
|
|
1320
|
-
function
|
|
1320
|
+
function vn(e) {
|
|
1321
1321
|
let t = yn(e, null, null, null);
|
|
1322
1322
|
for (let n = 0; n < t.length; n++) {
|
|
1323
|
-
let r = t[n], l = Vr(e, r, "publisher", null,
|
|
1324
|
-
|
|
1323
|
+
let r = t[n], l = Vr(e, r, "publisher", null, jn.KW_REQUIRED), o = Vr(e, r, "subscriber", null, jn.KW_REQUIRED);
|
|
1324
|
+
or(r, "s_event", Gr(e, r, "event", "", jn.KW_REQUIRED)), or(r, "s_publisher", Tt(l)), or(r, "s_subscriber", Tt(o));
|
|
1325
1325
|
}
|
|
1326
|
-
let n =
|
|
1326
|
+
let n = On(e, 0, null, 0);
|
|
1327
1327
|
for (let t = 0; t < n.length; t++) {
|
|
1328
|
-
let r = n[t], l = Vr(e, r, "publisher", null,
|
|
1329
|
-
|
|
1328
|
+
let r = n[t], l = Vr(e, r, "publisher", null, jn.KW_REQUIRED), o = Vr(e, r, "subscriber", null, jn.KW_REQUIRED);
|
|
1329
|
+
or(r, "s_event", Gr(e, r, "event", "", jn.KW_REQUIRED)), or(r, "s_publisher", Tt(l)), or(r, "s_subscriber", Tt(o));
|
|
1330
1330
|
}
|
|
1331
1331
|
return {
|
|
1332
1332
|
subscriptions: t,
|
|
@@ -1335,57 +1335,57 @@ function Sn(e) {
|
|
|
1335
1335
|
total_subscribings: cr(n)
|
|
1336
1336
|
};
|
|
1337
1337
|
}
|
|
1338
|
-
function
|
|
1338
|
+
function On(e, t, n, r) {
|
|
1339
1339
|
return bn(e.dl_subscribings, r, t, n, e);
|
|
1340
1340
|
}
|
|
1341
|
-
function
|
|
1342
|
-
if (gr(r) || (r = {}), !e || e.obflag & (P.obflag_destroyed | P.obflag_destroying)) return
|
|
1343
|
-
if (
|
|
1341
|
+
function Sn(e, n, r) {
|
|
1342
|
+
if (gr(r) || (r = {}), !e || e.obflag & (P.obflag_destroyed | P.obflag_destroying)) return xn("gobj NULL or DESTROYED"), -1;
|
|
1343
|
+
if (Or(n)) return xn(`${Tt(e)}: event EMPTY`), -1;
|
|
1344
1344
|
let l = nn(e, n, !0);
|
|
1345
|
-
if (!(l && l.event_flag & (U.EVF_SYSTEM_EVENT | U.EVF_OUTPUT_EVENT) || e.gclass.gclass_flag & C.gcflag_no_check_output_events)) return
|
|
1346
|
-
let
|
|
1347
|
-
if (
|
|
1345
|
+
if (!(l && l.event_flag & (U.EVF_SYSTEM_EVENT | U.EVF_OUTPUT_EVENT) || e.gclass.gclass_flag & C.gcflag_no_check_output_events)) return xn(`event NOT in output event list: ${Tt(e)}, ev ${n}`), -1;
|
|
1346
|
+
let o = E && Kt(E, "trace_subscriptions");
|
|
1347
|
+
if (o && (Y(1 === W ? t("🔝🔝 %s %s%s %s", n || "", e.running ? "" : "!!", Tt(e), e.current_state.state_name) : t("🔝🔝 mach(%s%s^%s), st: %s, ev: %s%s%s", e.running ? "" : "!!", Et(e), mt(e), e.current_state.state_name, "", n || "", "")), _r(r) && Hn(r)), e.gclass.gmt.mt_publish_event) {
|
|
1348
1348
|
let t = e.gclass.gmt.mt_publish_event(e, n, r);
|
|
1349
1349
|
if (t <= 0) return t;
|
|
1350
1350
|
}
|
|
1351
|
-
let
|
|
1352
|
-
for (let l = 0; l <
|
|
1353
|
-
let u =
|
|
1351
|
+
let i = [...e.dl_subscriptions], s = 0, a = 0;
|
|
1352
|
+
for (let l = 0; l < i.length; l++) {
|
|
1353
|
+
let u = i[l];
|
|
1354
1354
|
if (e.gclass.gmt.mt_publication_pre_filter) {
|
|
1355
1355
|
let t = e.gclass.gmt.mt_publication_pre_filter(e, u, n, r);
|
|
1356
1356
|
if (t < 0) break;
|
|
1357
1357
|
if (!t) continue;
|
|
1358
1358
|
}
|
|
1359
|
-
let _ = Vr(e, u, "subscriber", null,
|
|
1360
|
-
if (!_ ||
|
|
1361
|
-
let c = Ur(e, u, "subs_flag", 0,
|
|
1362
|
-
if (
|
|
1359
|
+
let _ = Vr(e, u, "subscriber", null, jn.KW_REQUIRED);
|
|
1360
|
+
if (!_ || St(_)) continue;
|
|
1361
|
+
let c = Ur(e, u, "subs_flag", 0, jn.KW_REQUIRED), f = Gr(e, u, "event", "", jn.KW_REQUIRED);
|
|
1362
|
+
if (Or(f) || 0 === jr(f, n)) {
|
|
1363
1363
|
Mr(e, u, "__config__", null, 0);
|
|
1364
|
-
let l = Mr(e, u, "__global__", null, 0),
|
|
1365
|
-
if (e.gclass.gmt.mt_publication_filter ? d = e.gclass.gmt.mt_publication_filter(e, n, g, _) : fr(f) > 0 && (d = Jr(g, f) ? 1 : 0,
|
|
1364
|
+
let l = Mr(e, u, "__global__", null, 0), i = Mr(e, u, "__local__", null, 0), f = Wr(e, u, "__filter__", null, 0), g = r, d = 1;
|
|
1365
|
+
if (e.gclass.gmt.mt_publication_filter ? d = e.gclass.gmt.mt_publication_filter(e, n, g, _) : fr(f) > 0 && (d = Jr(g, f) ? 1 : 0, o && (Y(t("💜💜🔄%s publishing with filter, event '%s', subscriber'%s', publisher %s", d ? "👍" : "👎", n || "", Tt(_), Tt(e))), Hn(f))), d < 0) break;
|
|
1366
1366
|
if (!d) continue;
|
|
1367
1367
|
let b = nn(_, n, !0);
|
|
1368
1368
|
if (b && b.event_flag & U.EVF_SYSTEM_EVENT && !rn(_, b.event_name, 0)) continue;
|
|
1369
|
-
|
|
1370
|
-
let
|
|
1371
|
-
if (
|
|
1369
|
+
i && $r(g, i), l && Zn(g, l), o && (Y(1 === W ? t("🔝🔄 %s (%s) %s%s", n || "", n || "", _.running ? "" : "!!", Tt(_)) : t("🔝🔄 mach(%s%s), st: %s, ev: %s, from(%s%s)", _.running ? "" : "!!", Tt(_), en(_), n || "", e && !e.running ? "!!" : "", Tt(e))), _r(g) && Hn(g));
|
|
1370
|
+
let p = cn(_, n, g, e);
|
|
1371
|
+
if (p < 0 && c & fn.__own_event__) {
|
|
1372
1372
|
s = -1;
|
|
1373
1373
|
break;
|
|
1374
1374
|
}
|
|
1375
|
-
if (a +=
|
|
1375
|
+
if (a += p, s++, St(e)) break;
|
|
1376
1376
|
}
|
|
1377
1377
|
}
|
|
1378
|
-
return s || l && l.event_flag & U.EVF_NO_WARN_SUBS ||
|
|
1378
|
+
return s || l && l.event_flag & U.EVF_NO_WARN_SUBS || Yn(`${Tt(e)}: Publish event WITHOUT subscribers, ev ${n}`), a;
|
|
1379
1379
|
}
|
|
1380
1380
|
function Nn(e, n, r, l) {
|
|
1381
|
-
if (
|
|
1382
|
-
let
|
|
1383
|
-
return
|
|
1381
|
+
if (St(e)) return xn("gobj NULL or DESTROYED"), -1;
|
|
1382
|
+
let i = E && xt(E, "tracing");
|
|
1383
|
+
return i && (Y(t("🌀🌀 mach(%s%s), cmd: %s, src: %s", ut(e) ? "" : "!!", Tt(e), n, Tt(l))), i > 1 && Hn(r)), e.gclass.gmt.mt_command_parser ? e.gclass.gmt.mt_command_parser(e, n, r, l) : e.gclass.command_table ? g ? g(e, n, r, l) : o(0, -1, t("%s: global command parser not available", Tt(e)), 0, 0) : o(0, -1, t("%s: command table not available", Tt(e)), 0, 0);
|
|
1384
1384
|
}
|
|
1385
1385
|
function Rn(e, n, r, l) {
|
|
1386
|
-
return
|
|
1386
|
+
return St(e) ? (xn("gobj NULL or DESTROYED"), -1) : e.gclass.gmt.mt_stats ? e.gclass.gmt.mt_stats(e, n, r, l) : d ? d(e, n, r, l) : s(0, -1, t("%s, stats parser not available", Tt(e)), 0, 0);
|
|
1387
1387
|
}
|
|
1388
|
-
var
|
|
1388
|
+
var jn = Object.freeze({
|
|
1389
1389
|
KW_REQUIRED: 1,
|
|
1390
1390
|
KW_CREATE: 2,
|
|
1391
1391
|
KW_WILD_NUMBER: 4,
|
|
@@ -1405,7 +1405,7 @@ Object.freeze({
|
|
|
1405
1405
|
JSON_FALSE: 7,
|
|
1406
1406
|
JSON_NULL: 8
|
|
1407
1407
|
});
|
|
1408
|
-
var wn = "undefined" != typeof window ? window.console : console,
|
|
1408
|
+
var wn = "undefined" != typeof window ? window.console : console, Dn = wn.error, An = wn.warn, In = wn.info, $n = wn.debug, kn = null;
|
|
1409
1409
|
function Cn(e) {
|
|
1410
1410
|
kn = "function" == typeof e ? e : null;
|
|
1411
1411
|
}
|
|
@@ -1438,7 +1438,7 @@ function Mn(e, t, n) {
|
|
|
1438
1438
|
}
|
|
1439
1439
|
}
|
|
1440
1440
|
function Wn(e) {
|
|
1441
|
-
e ? (
|
|
1441
|
+
e ? (Dn = e, An = e) : (Dn = wn.error, An = wn.warn);
|
|
1442
1442
|
}
|
|
1443
1443
|
function Kn(e) {
|
|
1444
1444
|
const t = Array.prototype.slice.call(arguments);
|
|
@@ -1462,11 +1462,11 @@ function Kn(e) {
|
|
|
1462
1462
|
} else n = t.map((e) => "object" == typeof e ? JSON.stringify(e) : String(e)).join(" ");
|
|
1463
1463
|
return n;
|
|
1464
1464
|
}
|
|
1465
|
-
function
|
|
1465
|
+
function xn(e) {
|
|
1466
1466
|
let t = Kn(e), n = Gl();
|
|
1467
|
-
|
|
1467
|
+
Dn && (Dn === wn.error ? Gn("error", t) && Dn("%c" + n + " ERROR: " + String(t), "color:red") : (Gn("error", t) && wn.error("%c" + n + " ERROR: " + String(t), "color:red"), Dn(`${n} ERROR: ${String(t)}`))), Mn("error", t, n);
|
|
1468
1468
|
}
|
|
1469
|
-
function
|
|
1469
|
+
function Yn(e) {
|
|
1470
1470
|
let t = Kn(e), n = Gl();
|
|
1471
1471
|
An && (An === wn.warn ? Gn("warning", t) && An("%c" + n + " WARNING: " + String(t), "color:yellow") : (Gn("warning", t) && wn.warn("%c" + n + " WARNING: " + String(t), "color:yellow"), An(`${n} WARNING: ${String(t)}`))), Mn("warning", t, n);
|
|
1472
1472
|
}
|
|
@@ -1541,10 +1541,10 @@ function rr(e, t) {
|
|
|
1541
1541
|
function lr(e, t, n) {
|
|
1542
1542
|
e[t] = n;
|
|
1543
1543
|
}
|
|
1544
|
-
function
|
|
1544
|
+
function or(e, t, n) {
|
|
1545
1545
|
e[t] = n;
|
|
1546
1546
|
}
|
|
1547
|
-
function
|
|
1547
|
+
function ir(e, t) {
|
|
1548
1548
|
e.push(t);
|
|
1549
1549
|
}
|
|
1550
1550
|
function sr(e, t) {
|
|
@@ -1574,17 +1574,17 @@ function dr(e) {
|
|
|
1574
1574
|
function br(e) {
|
|
1575
1575
|
return "string" == typeof e;
|
|
1576
1576
|
}
|
|
1577
|
-
function
|
|
1577
|
+
function pr(e) {
|
|
1578
1578
|
return "number" == typeof e && Number.isFinite(e);
|
|
1579
1579
|
}
|
|
1580
|
-
function
|
|
1580
|
+
function mr(e) {
|
|
1581
1581
|
return "boolean" == typeof e;
|
|
1582
1582
|
}
|
|
1583
1583
|
function Er(e) {
|
|
1584
1584
|
return null == e;
|
|
1585
1585
|
}
|
|
1586
1586
|
function Tr(e) {
|
|
1587
|
-
if (
|
|
1587
|
+
if (pr(e)) return !0;
|
|
1588
1588
|
if (!br(e)) return !1;
|
|
1589
1589
|
const t = Number(e);
|
|
1590
1590
|
return !isNaN(t) && "" !== e.trim() && !isNaN(t);
|
|
@@ -1595,14 +1595,14 @@ function hr(e) {
|
|
|
1595
1595
|
function yr(e) {
|
|
1596
1596
|
return "function" == typeof e;
|
|
1597
1597
|
}
|
|
1598
|
-
function
|
|
1598
|
+
function vr(e) {
|
|
1599
1599
|
return e instanceof k;
|
|
1600
1600
|
}
|
|
1601
|
-
function
|
|
1601
|
+
function Or(e) {
|
|
1602
1602
|
return !br(e) || 0 === e.length;
|
|
1603
1603
|
}
|
|
1604
|
-
function
|
|
1605
|
-
return
|
|
1604
|
+
function Sr(e) {
|
|
1605
|
+
return pr(e) ? Boolean(e) : /^\s*(true|1|on)\s*$/i.test(e);
|
|
1606
1606
|
}
|
|
1607
1607
|
function Nr(e, t, n) {
|
|
1608
1608
|
var r = (e + "").substring(0, n), l = (t + "").substring(0, n);
|
|
@@ -1611,23 +1611,23 @@ function Nr(e, t, n) {
|
|
|
1611
1611
|
function Rr(e, t) {
|
|
1612
1612
|
return e === t ? 0 : e > t ? 1 : -1;
|
|
1613
1613
|
}
|
|
1614
|
-
function
|
|
1614
|
+
function jr(e, t) {
|
|
1615
1615
|
let n = e.toLowerCase(), r = t.toLowerCase();
|
|
1616
1616
|
return n === r ? 0 : n > r ? 1 : -1;
|
|
1617
1617
|
}
|
|
1618
1618
|
function wr(e, t) {
|
|
1619
1619
|
if (gr(e) || gr(t) || dr(e) || dr(t)) return 0;
|
|
1620
|
-
if (
|
|
1620
|
+
if (pr(e) || pr(t)) {
|
|
1621
1621
|
let n = Number(e), r = Number(t);
|
|
1622
1622
|
return n > r ? 1 : n < r ? -1 : 0;
|
|
1623
1623
|
}
|
|
1624
|
-
if (
|
|
1624
|
+
if (mr(e) || mr(t)) {
|
|
1625
1625
|
let n = Number(e), r = Number(t);
|
|
1626
1626
|
return n > r ? 1 : n < r ? -1 : 0;
|
|
1627
1627
|
}
|
|
1628
1628
|
return Rr(String(e), String(t));
|
|
1629
1629
|
}
|
|
1630
|
-
function
|
|
1630
|
+
function Dr(e, t, n) {
|
|
1631
1631
|
var r;
|
|
1632
1632
|
return -1 !== (r = (e += "").indexOf(t)) && (n ? e.substring(0, r) : e.slice(r));
|
|
1633
1633
|
}
|
|
@@ -1652,235 +1652,235 @@ function kr(e, t) {
|
|
|
1652
1652
|
return !(!(t in e) || !e.hasOwnProperty(t));
|
|
1653
1653
|
}
|
|
1654
1654
|
function Cr(e, t, n, r) {
|
|
1655
|
-
if (e && !
|
|
1656
|
-
if (!br(n)) return
|
|
1655
|
+
if (e && !vr(e) && xn("GObj bad instanceof"), !gr(t) && !dr(t)) return xn(`${Tt(e)}: kw must be list or dict`), 0;
|
|
1656
|
+
if (!br(n)) return xn(`${Tt(e)}: path must be a string: ${String(n)}`), 0;
|
|
1657
1657
|
let l = n.split("`");
|
|
1658
1658
|
if (l.length <= 1) return t[n];
|
|
1659
|
-
let
|
|
1660
|
-
for (let
|
|
1659
|
+
let o = l.length;
|
|
1660
|
+
for (let i = 0; i < o; i++) if (void 0 === (t = t[l[i]])) return void (r && xn(`${Tt(e)}: path not found: ${String(n)}`));
|
|
1661
1661
|
return t;
|
|
1662
1662
|
}
|
|
1663
1663
|
function Lr(e, t, n) {
|
|
1664
|
-
e && !
|
|
1664
|
+
e && !vr(e) && xn("GObj bad instanceof");
|
|
1665
1665
|
let [r, l] = function(e, t) {
|
|
1666
1666
|
let n = e.lastIndexOf(t);
|
|
1667
1667
|
return -1 === n ? [e, ""] : [e.substring(0, n), e.substring(n + 1)];
|
|
1668
1668
|
}(n, "`");
|
|
1669
|
-
return
|
|
1669
|
+
return Or(l) ? rr(t, n) : rr(Cr(e, t, r, !0), l), 0;
|
|
1670
1670
|
}
|
|
1671
1671
|
function Pr(e, t, n, r, l) {
|
|
1672
|
-
e && !
|
|
1673
|
-
let
|
|
1674
|
-
const
|
|
1675
|
-
if (void 0 ===
|
|
1672
|
+
e && !vr(e) && xn("GObj bad instanceof");
|
|
1673
|
+
let o = Cr(e, t, n, !1);
|
|
1674
|
+
const i = l && l & jn.KW_REQUIRED, s = l && l & jn.KW_CREATE, a = l && l & jn.KW_EXTRACT;
|
|
1675
|
+
if (void 0 === o) {
|
|
1676
1676
|
if (s) {
|
|
1677
1677
|
let l = Boolean(r);
|
|
1678
|
-
return
|
|
1678
|
+
return xr(e, t, n, l), l;
|
|
1679
1679
|
}
|
|
1680
|
-
return
|
|
1680
|
+
return i && (xn(`path not found: '${n}'`), Hn(t)), Boolean(r);
|
|
1681
1681
|
}
|
|
1682
|
-
return a && Lr(e, t, n), Boolean(
|
|
1682
|
+
return a && Lr(e, t, n), Boolean(o);
|
|
1683
1683
|
}
|
|
1684
1684
|
function Ur(e, t, n, r, l) {
|
|
1685
|
-
e && !
|
|
1686
|
-
let
|
|
1687
|
-
const
|
|
1688
|
-
if (void 0 ===
|
|
1685
|
+
e && !vr(e) && xn("GObj bad instanceof");
|
|
1686
|
+
let o = Cr(e, t, n, !1);
|
|
1687
|
+
const i = l && l & jn.KW_REQUIRED, s = l && l & jn.KW_CREATE, a = l && l & jn.KW_EXTRACT;
|
|
1688
|
+
if (void 0 === o) {
|
|
1689
1689
|
if (s) {
|
|
1690
1690
|
let l = parseInt(r);
|
|
1691
|
-
return
|
|
1691
|
+
return xr(e, t, n, l), l;
|
|
1692
1692
|
}
|
|
1693
|
-
return
|
|
1693
|
+
return i && (xn(`path not found: '${n}'`), Hn(t)), parseInt(r);
|
|
1694
1694
|
}
|
|
1695
|
-
return a && Lr(e, t, n),
|
|
1695
|
+
return a && Lr(e, t, n), pr(o) ? parseInt(o) : (i && (xn(`path value MUST BE a number: ${n}`), qn(t)), parseInt(r));
|
|
1696
1696
|
}
|
|
1697
1697
|
function Fr(e, t, n, r, l) {
|
|
1698
|
-
e && !
|
|
1699
|
-
let
|
|
1700
|
-
const
|
|
1701
|
-
if (void 0 ===
|
|
1698
|
+
e && !vr(e) && xn("GObj bad instanceof");
|
|
1699
|
+
let o = Cr(e, t, n, !1);
|
|
1700
|
+
const i = l && l & jn.KW_REQUIRED, s = l && l & jn.KW_CREATE, a = l && l & jn.KW_EXTRACT;
|
|
1701
|
+
if (void 0 === o) {
|
|
1702
1702
|
if (s) {
|
|
1703
1703
|
let l = Number(r);
|
|
1704
|
-
return
|
|
1704
|
+
return xr(e, t, n, l), l;
|
|
1705
1705
|
}
|
|
1706
|
-
return
|
|
1706
|
+
return i && (xn(`path not found: '${n}'`), Hn(t)), Number(r);
|
|
1707
1707
|
}
|
|
1708
|
-
return a && Lr(e, t, n),
|
|
1708
|
+
return a && Lr(e, t, n), pr(o) ? Number(o) : (i && (xn(`path value MUST BE a number: ${n}`), qn(t)), Number(r));
|
|
1709
1709
|
}
|
|
1710
1710
|
function Gr(e, t, n, r, l) {
|
|
1711
|
-
e && !
|
|
1712
|
-
let
|
|
1713
|
-
const
|
|
1714
|
-
if (void 0 ===
|
|
1711
|
+
e && !vr(e) && xn("GObj bad instanceof");
|
|
1712
|
+
let o = Cr(e, t, n, !1);
|
|
1713
|
+
const i = l && l & jn.KW_REQUIRED, s = l && l & jn.KW_CREATE, a = l && l & jn.KW_EXTRACT;
|
|
1714
|
+
if (void 0 === o) {
|
|
1715
1715
|
if (s) {
|
|
1716
1716
|
let l = String(r);
|
|
1717
|
-
return
|
|
1717
|
+
return xr(e, t, n, l), l;
|
|
1718
1718
|
}
|
|
1719
|
-
return
|
|
1719
|
+
return i && (xn(`path not found: '${n}'`), Hn(t)), String(r);
|
|
1720
1720
|
}
|
|
1721
|
-
return a && Lr(e, t, n), br(
|
|
1721
|
+
return a && Lr(e, t, n), br(o) ? String(o) : (i && (xn(`${Tt(e)}: path value MUST BE a string: ${n}`), qn(t)), String(r));
|
|
1722
1722
|
}
|
|
1723
1723
|
function Vr(e, t, n, r, l) {
|
|
1724
|
-
e && !
|
|
1725
|
-
let
|
|
1726
|
-
const
|
|
1727
|
-
if (void 0 ===
|
|
1724
|
+
e && !vr(e) && xn("GObj bad instanceof");
|
|
1725
|
+
let o = Cr(e, t, n, !1);
|
|
1726
|
+
const i = l && l & jn.KW_REQUIRED, s = l && l & jn.KW_CREATE, a = l && l & jn.KW_EXTRACT;
|
|
1727
|
+
if (void 0 === o) {
|
|
1728
1728
|
if (s) {
|
|
1729
1729
|
let l = r;
|
|
1730
|
-
return
|
|
1730
|
+
return xr(e, t, n, l), l;
|
|
1731
1731
|
}
|
|
1732
|
-
return
|
|
1732
|
+
return i && (xn(`path not found: '${n}'`), Hn(t)), r;
|
|
1733
1733
|
}
|
|
1734
|
-
return a && Lr(e, t, n),
|
|
1734
|
+
return a && Lr(e, t, n), o;
|
|
1735
1735
|
}
|
|
1736
1736
|
function Mr(e, t, n, r, l) {
|
|
1737
|
-
e && !
|
|
1738
|
-
let
|
|
1739
|
-
const
|
|
1740
|
-
if (void 0 ===
|
|
1737
|
+
e && !vr(e) && xn("GObj bad instanceof");
|
|
1738
|
+
let o = Cr(e, t, n, !1);
|
|
1739
|
+
const i = l && l & jn.KW_REQUIRED, s = l && l & jn.KW_CREATE, a = l && l & jn.KW_EXTRACT;
|
|
1740
|
+
if (void 0 === o) {
|
|
1741
1741
|
if (s) {
|
|
1742
1742
|
let l = Object(r);
|
|
1743
|
-
return
|
|
1743
|
+
return xr(e, t, n, l), l;
|
|
1744
1744
|
}
|
|
1745
|
-
return
|
|
1745
|
+
return i && (xn(`path not found: '${n}'`), Hn(t)), Object(r);
|
|
1746
1746
|
}
|
|
1747
|
-
return a && Lr(e, t, n), gr(
|
|
1747
|
+
return a && Lr(e, t, n), gr(o) ? Object(o) : (i && (xn(`path value MUST BE a dict: ${n}`), qn(t)), Object(r));
|
|
1748
1748
|
}
|
|
1749
1749
|
function Wr(e, t, n, r, l) {
|
|
1750
|
-
e && !
|
|
1751
|
-
let
|
|
1752
|
-
const
|
|
1753
|
-
if (void 0 ===
|
|
1750
|
+
e && !vr(e) && xn("GObj bad instanceof");
|
|
1751
|
+
let o = Cr(e, t, n, !1);
|
|
1752
|
+
const i = l && l & jn.KW_REQUIRED, s = l && l & jn.KW_CREATE, a = l && l & jn.KW_EXTRACT;
|
|
1753
|
+
if (void 0 === o) {
|
|
1754
1754
|
if (s) {
|
|
1755
1755
|
let l = r;
|
|
1756
|
-
return
|
|
1756
|
+
return xr(e, t, n, l), l;
|
|
1757
1757
|
}
|
|
1758
|
-
return
|
|
1758
|
+
return i && (xn(`path not found: '${n}'`), Hn(t)), r;
|
|
1759
1759
|
}
|
|
1760
|
-
return a && Lr(e, t, n),
|
|
1760
|
+
return a && Lr(e, t, n), o;
|
|
1761
1761
|
}
|
|
1762
1762
|
function Kr(e, t, n, r, l) {
|
|
1763
|
-
e && !
|
|
1764
|
-
let
|
|
1765
|
-
const
|
|
1766
|
-
if (void 0 ===
|
|
1763
|
+
e && !vr(e) && xn("GObj bad instanceof");
|
|
1764
|
+
let o = Cr(e, t, n, !1);
|
|
1765
|
+
const i = l && l & jn.KW_REQUIRED, s = l && l & jn.KW_CREATE, a = l && l & jn.KW_EXTRACT;
|
|
1766
|
+
if (void 0 === o) {
|
|
1767
1767
|
if (s) {
|
|
1768
1768
|
let l = Array(r);
|
|
1769
|
-
return
|
|
1769
|
+
return xr(e, t, n, l), l;
|
|
1770
1770
|
}
|
|
1771
|
-
return
|
|
1771
|
+
return i && (xn(`path not found: '${n}'`), Hn(t)), Array(r);
|
|
1772
1772
|
}
|
|
1773
|
-
return a && Lr(e, t, n), dr(
|
|
1773
|
+
return a && Lr(e, t, n), dr(o) ? Array(o) : (i && (xn(`path value MUST BE an array: ${n}`), qn(t)), Array(r));
|
|
1774
1774
|
}
|
|
1775
|
-
function
|
|
1776
|
-
if (e && !
|
|
1775
|
+
function xr(e, t, n, r) {
|
|
1776
|
+
if (e && !vr(e) && xn("GObj bad instanceof"), !gr(t)) return xn("kw is not an object"), -1;
|
|
1777
1777
|
let l = n.split("`");
|
|
1778
1778
|
if (l.length <= 1) return t[n] = r, 0;
|
|
1779
|
-
let
|
|
1780
|
-
for (let e = 0; e <
|
|
1779
|
+
let o = l.length;
|
|
1780
|
+
for (let e = 0; e < o; e++) {
|
|
1781
1781
|
let n = l[e];
|
|
1782
|
-
e ===
|
|
1782
|
+
e === o - 1 ? t[n] = r : (void 0 === t[n] && (t[n] = {}), t = t[n]);
|
|
1783
1783
|
}
|
|
1784
1784
|
return 0;
|
|
1785
1785
|
}
|
|
1786
|
-
function
|
|
1787
|
-
if (e && !
|
|
1788
|
-
let
|
|
1789
|
-
return gr(
|
|
1786
|
+
function Yr(e, t, n, r, l) {
|
|
1787
|
+
if (e && !vr(e) && xn("GObj bad instanceof"), !gr(t)) return xn("kw is not an object"), -1;
|
|
1788
|
+
let o = Mr(e, t, n, {}, !0);
|
|
1789
|
+
return gr(o) ? (o[r] = l, 0) : (xn("subdict is not an object"), -1);
|
|
1790
1790
|
}
|
|
1791
1791
|
function Br(e, n, r) {
|
|
1792
|
-
let l = "",
|
|
1792
|
+
let l = "", o = !1;
|
|
1793
1793
|
if (dr(n)) {
|
|
1794
|
-
|
|
1795
|
-
for (let
|
|
1796
|
-
let s = n[
|
|
1797
|
-
if (l =
|
|
1794
|
+
o = !1;
|
|
1795
|
+
for (let i = 0; i < n.length; i++) {
|
|
1796
|
+
let s = n[i];
|
|
1797
|
+
if (l = Or(r) ? t("%s", r) : t("%s`%d", r, i), o = Br(e, s, l), o) break;
|
|
1798
1798
|
}
|
|
1799
1799
|
} else if (gr(n)) {
|
|
1800
|
-
|
|
1801
|
-
let
|
|
1802
|
-
for (let s = 0; s <
|
|
1803
|
-
let a =
|
|
1804
|
-
if (l =
|
|
1805
|
-
if (
|
|
1800
|
+
o = !0;
|
|
1801
|
+
let i = Object.keys(n);
|
|
1802
|
+
for (let s = 0; s < i.length; s++) {
|
|
1803
|
+
let a = i[s], u = n[a];
|
|
1804
|
+
if (l = Or(r) ? t("%s", a) : t("%s`%s", r, a), dr(u) || gr(u)) {
|
|
1805
|
+
if (o = Br(e, u, l), !o) break;
|
|
1806
1806
|
continue;
|
|
1807
1807
|
}
|
|
1808
1808
|
let _ = Wr(0, e, l, 0, 0);
|
|
1809
1809
|
if (_ || (_ = nr(e, l)), !_) {
|
|
1810
|
-
|
|
1810
|
+
o = !1;
|
|
1811
1811
|
break;
|
|
1812
1812
|
}
|
|
1813
1813
|
if (0 !== wr(_, u)) {
|
|
1814
|
-
|
|
1814
|
+
o = !1;
|
|
1815
1815
|
break;
|
|
1816
1816
|
}
|
|
1817
1817
|
}
|
|
1818
1818
|
}
|
|
1819
|
-
return
|
|
1819
|
+
return o;
|
|
1820
1820
|
}
|
|
1821
1821
|
function Jr(e, t) {
|
|
1822
1822
|
return 0 === fr(t) || Br(e, t, "");
|
|
1823
1823
|
}
|
|
1824
1824
|
function qr(e, t, n, r) {
|
|
1825
|
-
if (!n || !dr(t)) return r &&
|
|
1825
|
+
if (!n || !dr(t)) return r && xn("item NULL or kw_list is not a list"), -1;
|
|
1826
1826
|
for (let e = 0; e < t.length; e++) if (Xn(n, t[e])) return e;
|
|
1827
|
-
return r &&
|
|
1827
|
+
return r && xn("item not found in this list"), -1;
|
|
1828
1828
|
}
|
|
1829
1829
|
function Hr(e, t, n, r) {
|
|
1830
|
-
if (e && !
|
|
1830
|
+
if (e && !vr(e) && xn("GObj bad instanceof"), !t) return null;
|
|
1831
1831
|
r || (r = Jr);
|
|
1832
1832
|
let l = [];
|
|
1833
1833
|
if (dr(t)) for (let e = 0; e < t.length; e++) {
|
|
1834
|
-
let
|
|
1835
|
-
r(
|
|
1834
|
+
let o = t[e];
|
|
1835
|
+
r(o, n) && l.push(Qn(o));
|
|
1836
1836
|
}
|
|
1837
1837
|
else {
|
|
1838
|
-
if (!gr(t)) return
|
|
1838
|
+
if (!gr(t)) return xn("kw_select() BAD kw parameter"), null;
|
|
1839
1839
|
r(t, n) && l.push(Qn(t));
|
|
1840
1840
|
}
|
|
1841
1841
|
return l;
|
|
1842
1842
|
}
|
|
1843
1843
|
function Qr(e, t, n, r) {
|
|
1844
|
-
if (e && !
|
|
1844
|
+
if (e && !vr(e) && xn("GObj bad instanceof"), !t) return null;
|
|
1845
1845
|
r || (r = Jr);
|
|
1846
1846
|
let l = [];
|
|
1847
1847
|
if (dr(t)) for (let e = 0; e < t.length; e++) {
|
|
1848
|
-
let
|
|
1849
|
-
r(
|
|
1848
|
+
let o = t[e];
|
|
1849
|
+
r(o, n) && l.push(o);
|
|
1850
1850
|
}
|
|
1851
1851
|
else {
|
|
1852
|
-
if (!gr(t)) return
|
|
1852
|
+
if (!gr(t)) return xn("kw_select() BAD kw parameter"), null;
|
|
1853
1853
|
r(t, n) && l.push(t);
|
|
1854
1854
|
}
|
|
1855
1855
|
return l;
|
|
1856
1856
|
}
|
|
1857
1857
|
function zr(e, t, n, r) {
|
|
1858
|
-
e && !
|
|
1858
|
+
e && !vr(e) && xn("GObj bad instanceof");
|
|
1859
1859
|
let l = {};
|
|
1860
|
-
if (br(n) && !
|
|
1861
|
-
let
|
|
1862
|
-
t.hasOwnProperty(
|
|
1863
|
-
} else if (gr(n) && _r(n) > 0) for (let
|
|
1860
|
+
if (br(n) && !Or(n)) {
|
|
1861
|
+
let o = n;
|
|
1862
|
+
t.hasOwnProperty(o) ? l[o] = t[o] : r && xn(`${Tt(e)}: key not found: ${o}`);
|
|
1863
|
+
} else if (gr(n) && _r(n) > 0) for (let o of Object.keys(n)) t.hasOwnProperty(o) ? l[o] = t[o] : r && xn(`${Tt(e)}: key not found: ${o}`);
|
|
1864
1864
|
else {
|
|
1865
1865
|
if (!(dr(n) && cr(n) > 0)) return t;
|
|
1866
|
-
for (let
|
|
1867
|
-
let
|
|
1868
|
-
t.hasOwnProperty(
|
|
1866
|
+
for (let o = 0; o < n.length; o++) {
|
|
1867
|
+
let i = n[o];
|
|
1868
|
+
t.hasOwnProperty(i) ? l[i] = t[i] : r && xn(`${Tt(e)}: key not found: ${i}`);
|
|
1869
1869
|
}
|
|
1870
1870
|
}
|
|
1871
1871
|
return l;
|
|
1872
1872
|
}
|
|
1873
1873
|
function Xr(e, t, n, r) {
|
|
1874
1874
|
let l = {};
|
|
1875
|
-
if (Zn(l, t), br(n) && !
|
|
1876
|
-
let
|
|
1877
|
-
Wr(e, t,
|
|
1878
|
-
} else if (gr(n) && _r(n) > 0) for (let
|
|
1875
|
+
if (Zn(l, t), br(n) && !Or(n)) {
|
|
1876
|
+
let o = n;
|
|
1877
|
+
Wr(e, t, o, 0, 0) ? rr(l, o) : r && xn(`${Tt(e)}: key not found: ${o}`);
|
|
1878
|
+
} else if (gr(n) && _r(n) > 0) for (let o of Object.keys(n)) t.hasOwnProperty(o) ? rr(l, o) : r && xn(`${Tt(e)}: key not found: ${o}`);
|
|
1879
1879
|
else {
|
|
1880
1880
|
if (!(dr(n) && cr(n) > 0)) return {};
|
|
1881
|
-
for (let
|
|
1882
|
-
let
|
|
1883
|
-
t.hasOwnProperty(
|
|
1881
|
+
for (let o = 0; o < n.length; o++) {
|
|
1882
|
+
let i = n[o];
|
|
1883
|
+
t.hasOwnProperty(i) ? rr(l, i) : r && xn(`${Tt(e)}: key not found: ${i}`);
|
|
1884
1884
|
}
|
|
1885
1885
|
}
|
|
1886
1886
|
return l;
|
|
@@ -1895,11 +1895,11 @@ function Zr(e, t, n = !1) {
|
|
|
1895
1895
|
}
|
|
1896
1896
|
function el(e, t) {
|
|
1897
1897
|
if ("undefined" == typeof window || !window.localStorage) return 0;
|
|
1898
|
-
if (!e || void 0 === t) return
|
|
1898
|
+
if (!e || void 0 === t) return xn(`kw_set_local_storage_value(): invalid key or value: key=${e}`), -1;
|
|
1899
1899
|
try {
|
|
1900
1900
|
return window.localStorage.setItem(e, JSON.stringify(t)), 0;
|
|
1901
1901
|
} catch (t) {
|
|
1902
|
-
return
|
|
1902
|
+
return xn(`kw_set_local_storage_value(): cannot save "${e}" (storage full or blocked?): ${t && t.message ? t.message : t}`), -1;
|
|
1903
1903
|
}
|
|
1904
1904
|
}
|
|
1905
1905
|
function tl(e) {
|
|
@@ -1922,50 +1922,50 @@ function nl(e, t) {
|
|
|
1922
1922
|
return !1;
|
|
1923
1923
|
}
|
|
1924
1924
|
function rl(e, t, n, r, l) {
|
|
1925
|
-
if (e && !
|
|
1925
|
+
if (e && !vr(e) && xn("GObj bad instanceof"), !t) return null;
|
|
1926
1926
|
l || (l = Jr);
|
|
1927
|
-
let
|
|
1928
|
-
if (dr(t)) for (let
|
|
1929
|
-
let s, a = t[
|
|
1927
|
+
let o = [];
|
|
1928
|
+
if (dr(t)) for (let i = 0; i < t.length; i++) {
|
|
1929
|
+
let s, a = t[i];
|
|
1930
1930
|
if (gr(a)) s = Gr(e, a, "id", "", 0);
|
|
1931
1931
|
else {
|
|
1932
1932
|
if (!br(a)) continue;
|
|
1933
1933
|
s = a;
|
|
1934
1934
|
}
|
|
1935
|
-
nl(n, s) && l(a, r) &&
|
|
1935
|
+
nl(n, s) && l(a, r) && o.push(a);
|
|
1936
1936
|
}
|
|
1937
1937
|
else {
|
|
1938
|
-
if (!gr(t)) return
|
|
1938
|
+
if (!gr(t)) return xn("kw_collect() BAD kw parameter"), null;
|
|
1939
1939
|
for (let e of Object.keys(t)) {
|
|
1940
|
-
let
|
|
1941
|
-
nl(n, e) && l(
|
|
1940
|
+
let i = t[e];
|
|
1941
|
+
nl(n, e) && l(i, r) && o.push(i);
|
|
1942
1942
|
}
|
|
1943
1943
|
}
|
|
1944
|
-
return
|
|
1944
|
+
return o;
|
|
1945
1945
|
}
|
|
1946
1946
|
function ll(e, t, n) {
|
|
1947
|
-
e && !
|
|
1947
|
+
e && !vr(e) && xn("GObj bad instanceof");
|
|
1948
1948
|
let r = {};
|
|
1949
|
-
if (
|
|
1949
|
+
if (Or(n) || (t = Cr(e, t, n)), gr(t)) r = t;
|
|
1950
1950
|
else if (dr(t)) for (let n = 0; n < t.length; n++) {
|
|
1951
|
-
let l = t[n],
|
|
1952
|
-
|
|
1951
|
+
let l = t[n], o = Gr(e, l, "id", "", 0);
|
|
1952
|
+
Or(o) || (r[o] = l);
|
|
1953
1953
|
}
|
|
1954
|
-
else
|
|
1954
|
+
else xn(`${Tt(e)} kwid_new_dict: data type unknown`);
|
|
1955
1955
|
return r;
|
|
1956
1956
|
}
|
|
1957
|
-
function
|
|
1958
|
-
e && !
|
|
1959
|
-
let
|
|
1960
|
-
return
|
|
1957
|
+
function ol(e, t, n, r, l) {
|
|
1958
|
+
e && !vr(e) && xn("GObj bad instanceof");
|
|
1959
|
+
let o = rl(e, t, n, r, l);
|
|
1960
|
+
return o.length > 0 ? o[0] : null;
|
|
1961
1961
|
}
|
|
1962
|
-
function
|
|
1963
|
-
if (e && !
|
|
1962
|
+
function il(e, t) {
|
|
1963
|
+
if (e && !vr(e) && xn("GObj bad instanceof"), !t) return [];
|
|
1964
1964
|
let n = [];
|
|
1965
1965
|
if (br(t)) n.push(t);
|
|
1966
1966
|
else if (gr(t)) for (let e in t) t.hasOwnProperty(e) && n.push(e);
|
|
1967
1967
|
else dr(t) && t.forEach(function(t) {
|
|
1968
|
-
if (br(t))
|
|
1968
|
+
if (br(t)) Or(t) || n.push(t);
|
|
1969
1969
|
else if (gr(t)) {
|
|
1970
1970
|
let r = Gr(e, t, "id", 0, 0);
|
|
1971
1971
|
r && n.push(r);
|
|
@@ -1977,37 +1977,37 @@ function sl(e, t, n) {
|
|
|
1977
1977
|
t = t || "id", n = n || "value";
|
|
1978
1978
|
let r = [];
|
|
1979
1979
|
if (dr(e)) for (let l = 0; l < e.length; l++) {
|
|
1980
|
-
let
|
|
1981
|
-
if (br(
|
|
1980
|
+
let o = e[l];
|
|
1981
|
+
if (br(o)) r.push({
|
|
1982
1982
|
id: e[l],
|
|
1983
1983
|
value: e[l]
|
|
1984
1984
|
});
|
|
1985
|
-
else if (gr(
|
|
1985
|
+
else if (gr(o)) {
|
|
1986
1986
|
let e = {};
|
|
1987
|
-
if (kr(
|
|
1988
|
-
if (!kr(
|
|
1989
|
-
if (!(fr(
|
|
1990
|
-
|
|
1987
|
+
if (kr(o, t)) {
|
|
1988
|
+
if (!kr(o, n)) {
|
|
1989
|
+
if (!(fr(o) > 0)) {
|
|
1990
|
+
xn("list2options(): object without field value: " + n);
|
|
1991
1991
|
continue;
|
|
1992
1992
|
}
|
|
1993
|
-
n = Object.keys(
|
|
1993
|
+
n = Object.keys(o)[0];
|
|
1994
1994
|
}
|
|
1995
|
-
e.id =
|
|
1995
|
+
e.id = o[t], e.value = o[n];
|
|
1996
1996
|
} else {
|
|
1997
|
-
if (!(fr(
|
|
1998
|
-
|
|
1997
|
+
if (!(fr(o) > 0)) {
|
|
1998
|
+
xn("list2options(): object without field id: " + t);
|
|
1999
1999
|
continue;
|
|
2000
2000
|
}
|
|
2001
|
-
t = Object.keys(
|
|
2001
|
+
t = Object.keys(o)[0], e.id = t, e.value = o[t];
|
|
2002
2002
|
}
|
|
2003
2003
|
r.push(e);
|
|
2004
|
-
} else
|
|
2004
|
+
} else xn("list2options(): case1 not implemented");
|
|
2005
2005
|
}
|
|
2006
2006
|
else if (gr(e)) for (let t of Object.keys(e)) r.push({
|
|
2007
2007
|
id: t,
|
|
2008
2008
|
value: t
|
|
2009
2009
|
});
|
|
2010
|
-
else
|
|
2010
|
+
else xn("list2options(): case2 not implemented");
|
|
2011
2011
|
return r;
|
|
2012
2012
|
}
|
|
2013
2013
|
function al(e, t) {
|
|
@@ -2016,7 +2016,7 @@ function al(e, t) {
|
|
|
2016
2016
|
return -1;
|
|
2017
2017
|
}
|
|
2018
2018
|
function ul(e, t, n) {
|
|
2019
|
-
if (!e || !t) return
|
|
2019
|
+
if (!e || !t) return xn("ERROR: str_in_list() list or str empty"), !1;
|
|
2020
2020
|
let r = e.length;
|
|
2021
2021
|
if (n) {
|
|
2022
2022
|
t = t.toLowerCase();
|
|
@@ -2028,8 +2028,8 @@ function ul(e, t, n) {
|
|
|
2028
2028
|
return !1;
|
|
2029
2029
|
}
|
|
2030
2030
|
function _l(e, t, n) {
|
|
2031
|
-
if (!e) return
|
|
2032
|
-
if (!t) return
|
|
2031
|
+
if (!e) return xn("ERROR: strs_in_list() list empty"), !1;
|
|
2032
|
+
if (!t) return xn("ERROR: strs_in_list() str empty"), !1;
|
|
2033
2033
|
for (let r = 0; r < t.length; r++) if (ul(e, t[r], n)) return !0;
|
|
2034
2034
|
return !1;
|
|
2035
2035
|
}
|
|
@@ -2050,26 +2050,26 @@ function gl(e, t, n) {
|
|
|
2050
2050
|
r || (r = {}, e.__md_iev__ = r), r[t] = n;
|
|
2051
2051
|
}
|
|
2052
2052
|
function dl(e, t, n, r) {
|
|
2053
|
-
if (!
|
|
2053
|
+
if (!vr(e)) return xn("gobj is not a GObj"), null;
|
|
2054
2054
|
if (!t) return;
|
|
2055
2055
|
let l = fl(t, n);
|
|
2056
2056
|
l || (l = [], gl(t, n, l));
|
|
2057
2057
|
try {
|
|
2058
2058
|
dr(l) && l.unshift(r);
|
|
2059
2059
|
} catch (e) {
|
|
2060
|
-
|
|
2060
|
+
xn(e);
|
|
2061
2061
|
}
|
|
2062
2062
|
}
|
|
2063
2063
|
function bl(e, t, n, r) {
|
|
2064
|
-
if (!
|
|
2065
|
-
if (!gr(t)) return
|
|
2064
|
+
if (!vr(e)) return xn("gobj is not a GObj"), null;
|
|
2065
|
+
if (!gr(t)) return xn("kw is not a dict"), null;
|
|
2066
2066
|
let l = fl(t, n);
|
|
2067
|
-
return l ? 0 === l.length ? (r &&
|
|
2067
|
+
return l ? 0 === l.length ? (r && xn(`stack empty: ${n}`), null) : l[0] : (r && xn(`stack NOT FOUND: ${n}`), null);
|
|
2068
2068
|
}
|
|
2069
|
-
function
|
|
2070
|
-
return
|
|
2069
|
+
function pl(e, t, n) {
|
|
2070
|
+
return Or(n) ? Lr(e, t, "__md_iev__`__msg_type__") : Yr(e, t, "__md_iev__", "__msg_type__", n), 0;
|
|
2071
2071
|
}
|
|
2072
|
-
function
|
|
2072
|
+
function ml(e, t) {
|
|
2073
2073
|
return Gr(e, t, "__md_iev__`__msg_type__", "", 0);
|
|
2074
2074
|
}
|
|
2075
2075
|
function El(e, t, n) {
|
|
@@ -2078,7 +2078,7 @@ function El(e, t, n) {
|
|
|
2078
2078
|
if (4 === r.readyState) if (200 === r.status || 0 === (e = r).status && e.responseText && e.responseURL.startsWith("file:")) try {
|
|
2079
2079
|
t(JSON.parse(r.responseText));
|
|
2080
2080
|
} catch (e) {
|
|
2081
|
-
n && (
|
|
2081
|
+
n && (xn(`JSON parse status ${r.status}, error: ${e.message}`), n(r.status));
|
|
2082
2082
|
}
|
|
2083
2083
|
else n && n(r.status);
|
|
2084
2084
|
var e;
|
|
@@ -2107,32 +2107,32 @@ function yl(e, t, n) {
|
|
|
2107
2107
|
n && (e = Qn(e));
|
|
2108
2108
|
let r = Wr(null, e, "type", [], 1);
|
|
2109
2109
|
Gr(null, e, "hook", "data", 1);
|
|
2110
|
-
let l = Wr(null, e, "schema", {}, 1),
|
|
2110
|
+
let l = Wr(null, e, "schema", {}, 1), o = Wr(null, e, "topics", {}, 1);
|
|
2111
2111
|
return hl(l, function(e, t, n, l) {
|
|
2112
|
-
"__" !== t.substring(0, 2) && Wr(null,
|
|
2112
|
+
"__" !== t.substring(0, 2) && Wr(null, o, l, Qn(r), 1);
|
|
2113
2113
|
}, t), e;
|
|
2114
2114
|
}
|
|
2115
|
-
function
|
|
2115
|
+
function vl(e, t, n, r) {
|
|
2116
2116
|
let l = Wr(null, Wr(null, e, "topics", null, 0), t, null, 0);
|
|
2117
|
-
if (!l) return
|
|
2118
|
-
if (
|
|
2119
|
-
let
|
|
2120
|
-
for (; (
|
|
2121
|
-
if (0 ===
|
|
2117
|
+
if (!l) return xn("jdb_update: topic not found: " + t), null;
|
|
2118
|
+
if (Or(r.id)) return xn("jdb_update: record without id: " + r), qn(r), null;
|
|
2119
|
+
let o, i = n.split("`"), s = l;
|
|
2120
|
+
for (; (o = i.shift()) && !Or(o) && s;) gr(s) && (s = Wr(null, s, e.hook, [], 1)), s = jl(s, null, o, !1);
|
|
2121
|
+
if (0 === i.length && s) if (dr(s)) s.push(r);
|
|
2122
2122
|
else if (s.id === r.id) Object.assign(s, r);
|
|
2123
2123
|
else {
|
|
2124
|
-
let t = Wr(null, s, e.hook, [], 1), n =
|
|
2124
|
+
let t = Wr(null, s, e.hook, [], 1), n = jl(t, e.hook, r.id, !1);
|
|
2125
2125
|
n ? Object.assign(n, r) : t.push(r);
|
|
2126
2126
|
}
|
|
2127
2127
|
return l;
|
|
2128
2128
|
}
|
|
2129
|
-
function
|
|
2129
|
+
function Ol(e, t, n, r) {
|
|
2130
2130
|
let l = Wr(null, Wr(null, e, "topics", null, 0), t, null, 0);
|
|
2131
|
-
if (!l) return
|
|
2132
|
-
if (
|
|
2133
|
-
let
|
|
2134
|
-
for (; (
|
|
2135
|
-
if (0 ===
|
|
2131
|
+
if (!l) return xn("jdb_delete: topic not found: " + t), null;
|
|
2132
|
+
if (Or(r.id)) return xn("jdb_delete: record without id: " + r), qn(r), null;
|
|
2133
|
+
let o, i = n.split("`"), s = l;
|
|
2134
|
+
for (; (o = i.shift()) && !Or(o) && s;) gr(s) && (s = Wr(null, s, e.hook, null, 0)), s = jl(s, null, o, !1);
|
|
2135
|
+
if (0 === i.length && s) if (dr(s)) {
|
|
2136
2136
|
let e = al(s, r.id);
|
|
2137
2137
|
e >= 0 && s.splice(e, 1);
|
|
2138
2138
|
} else {
|
|
@@ -2141,29 +2141,29 @@ function vl(e, t, n, r) {
|
|
|
2141
2141
|
}
|
|
2142
2142
|
return l;
|
|
2143
2143
|
}
|
|
2144
|
-
function
|
|
2144
|
+
function Sl(e, t) {
|
|
2145
2145
|
let n = Wr(null, e, "topics", null, 0);
|
|
2146
|
-
if (!n) return
|
|
2147
|
-
return Wr(null, n, t, null, 0) || (
|
|
2146
|
+
if (!n) return xn("jdb topics section not found"), qn(e), null;
|
|
2147
|
+
return Wr(null, n, t, null, 0) || (xn("jdb topic not found: " + t), qn(n), null);
|
|
2148
2148
|
}
|
|
2149
2149
|
function Nl(e, t, n, r) {
|
|
2150
2150
|
let l = Wr(null, Wr(null, e, "topics", null, 0), t, null, 0);
|
|
2151
|
-
return l ? (void 0 === r && (r = !0),
|
|
2151
|
+
return l ? (void 0 === r && (r = !0), jl(l, e.hook, n, r)) : (xn("jdb_get: topic not found: " + t), null);
|
|
2152
2152
|
}
|
|
2153
2153
|
function Rl(e, t, n) {
|
|
2154
2154
|
let r = Wr(null, Wr(null, e, "topics", null, 0), t, null, 0);
|
|
2155
|
-
return r ? n < r.length ? r[n] : {} : (
|
|
2155
|
+
return r ? n < r.length ? r[n] : {} : (xn("jdb_get_by_idx: topic not found: " + t), null);
|
|
2156
2156
|
}
|
|
2157
|
-
function
|
|
2157
|
+
function jl(e, t, n, r) {
|
|
2158
2158
|
if (!e) return null;
|
|
2159
|
-
let l,
|
|
2160
|
-
for (l = 0; l <
|
|
2161
|
-
let
|
|
2162
|
-
if (
|
|
2163
|
-
let e =
|
|
2164
|
-
if (e && e === n) return
|
|
2165
|
-
if (r && kr(
|
|
2166
|
-
let e =
|
|
2159
|
+
let l, o = e.length;
|
|
2160
|
+
for (l = 0; l < o; l++) {
|
|
2161
|
+
let o = e[l];
|
|
2162
|
+
if (o) {
|
|
2163
|
+
let e = o.id;
|
|
2164
|
+
if (e && e === n) return o;
|
|
2165
|
+
if (r && kr(o, t)) {
|
|
2166
|
+
let e = jl(o[t], t, n, r);
|
|
2167
2167
|
if (e) return e;
|
|
2168
2168
|
}
|
|
2169
2169
|
}
|
|
@@ -2174,7 +2174,7 @@ function wl(e, t) {
|
|
|
2174
2174
|
let n = Qn(e);
|
|
2175
2175
|
return er(n, t), n;
|
|
2176
2176
|
}
|
|
2177
|
-
function
|
|
2177
|
+
function Dl(e) {
|
|
2178
2178
|
function t(e) {
|
|
2179
2179
|
let t = e.replace(/-/g, "+").replace(/_/g, "/");
|
|
2180
2180
|
switch (t.length % 4) {
|
|
@@ -2207,7 +2207,7 @@ function jl(e) {
|
|
|
2207
2207
|
}
|
|
2208
2208
|
function Al(e, t) {
|
|
2209
2209
|
try {
|
|
2210
|
-
let n =
|
|
2210
|
+
let n = Dl(e);
|
|
2211
2211
|
switch (t) {
|
|
2212
2212
|
case "header": return JSON.parse(n.header);
|
|
2213
2213
|
case "signature": return JSON.parse(n.signature);
|
|
@@ -2230,23 +2230,23 @@ function kl(e) {
|
|
|
2230
2230
|
return t.innerHTML = e.trim(), t.content.firstChild;
|
|
2231
2231
|
}
|
|
2232
2232
|
function Cl(e, t) {
|
|
2233
|
-
let [n, r, l,
|
|
2234
|
-
if (!n) return void
|
|
2235
|
-
let
|
|
2233
|
+
let [n, r, l, o] = e;
|
|
2234
|
+
if (!n) return void xn("Tag must be a valid HTML element.");
|
|
2235
|
+
let i = document.createElement(n), s = "";
|
|
2236
2236
|
if (r && "object" == typeof r) for (let e of Object.keys(r)) if ("style" === e && "object" == typeof r[e]) {
|
|
2237
2237
|
let t = "";
|
|
2238
2238
|
for (const n of Object.keys(r[e])) t += `${n}: ${r[e][n]};`;
|
|
2239
|
-
|
|
2240
|
-
} else "style" === e ?
|
|
2241
|
-
if (br(l)) if (l = l.trim(), l.length > 0 && "<" === l[0])
|
|
2242
|
-
else if (t && s)
|
|
2243
|
-
else
|
|
2239
|
+
i.style.cssText = t;
|
|
2240
|
+
} else "style" === e ? i.style.cssText = r[e] : "i18n" === e || "data-i18n" === e || "data_i18next" === e || "data-i18next" === e ? null !== r[e] && void 0 !== r[e] && (s = r[e], i.setAttribute("data-i18n", s)) : i.setAttribute(e, r[e]);
|
|
2241
|
+
if (br(l)) if (l = l.trim(), l.length > 0 && "<" === l[0]) i.appendChild(kl(l));
|
|
2242
|
+
else if (t && s) i.textContent = t(s) || l;
|
|
2243
|
+
else i.textContent = l;
|
|
2244
2244
|
else if (dr(l)) {
|
|
2245
|
-
if (l.length > 0) if (br(l[0]))
|
|
2246
|
-
else for (let e of l) Array.isArray(e) && e.length > 0 ?
|
|
2247
|
-
} else l instanceof HTMLElement || l instanceof Text || l instanceof SVGElement ?
|
|
2248
|
-
if (
|
|
2249
|
-
return
|
|
2245
|
+
if (l.length > 0) if (br(l[0])) i.appendChild(Cl(l, t));
|
|
2246
|
+
else for (let e of l) Array.isArray(e) && e.length > 0 ? i.appendChild(Cl(e, t)) : e instanceof HTMLElement && i.appendChild(e);
|
|
2247
|
+
} else l instanceof HTMLElement || l instanceof Text || l instanceof SVGElement ? i.appendChild(l) : null != l && (xn("content ignored"), Hn(l));
|
|
2248
|
+
if (o && "object" == typeof o) for (const e of Object.keys(o)) i.addEventListener(e, o[e]);
|
|
2249
|
+
return i;
|
|
2250
2250
|
}
|
|
2251
2251
|
function Ll(e) {
|
|
2252
2252
|
if (!e) return {
|
|
@@ -2260,12 +2260,12 @@ function Ll(e) {
|
|
|
2260
2260
|
left: 0,
|
|
2261
2261
|
width: 0,
|
|
2262
2262
|
height: 0
|
|
2263
|
-
},
|
|
2263
|
+
}, o = "undefined" != typeof window, i = o && (window.scrollY || document.documentElement?.scrollTop || document.body?.scrollTop) || 0, s = o && (window.scrollX || document.documentElement?.scrollLeft || document.body?.scrollLeft) || 0;
|
|
2264
2264
|
return {
|
|
2265
|
-
top: t +
|
|
2265
|
+
top: t + i,
|
|
2266
2266
|
left: n + s,
|
|
2267
2267
|
right: n + s + r,
|
|
2268
|
-
bottom: t +
|
|
2268
|
+
bottom: t + i + l
|
|
2269
2269
|
};
|
|
2270
2270
|
}
|
|
2271
2271
|
function Pl(e) {
|
|
@@ -2287,14 +2287,14 @@ function Ul(e, t) {
|
|
|
2287
2287
|
}), e.querySelectorAll("[data-i18n-placeholder]").forEach(function(e) {
|
|
2288
2288
|
let n = e.getAttribute("data-i18n-placeholder");
|
|
2289
2289
|
n && e.setAttribute("placeholder", t(n));
|
|
2290
|
-
})) :
|
|
2290
|
+
})) : xn("You must supply a translation function");
|
|
2291
2291
|
}
|
|
2292
2292
|
function Fl(e = "Time Tracker", t = !1) {
|
|
2293
2293
|
const n = e, r = performance.now();
|
|
2294
2294
|
let l = r;
|
|
2295
|
-
return t &&
|
|
2296
|
-
const
|
|
2297
|
-
return t &&
|
|
2295
|
+
return t && Yn(`--\x3e ${n} - starting`), { mark: (e = "Intermediate", o = "") => {
|
|
2296
|
+
const i = performance.now(), s = (i - l) / 1e3, a = (i - r) / 1e3;
|
|
2297
|
+
return t && Yn(`--\x3e ${n} ${e} - partial: ${s} sec, total: ${a} sec, ${o}`), l = i, {
|
|
2298
2298
|
partial: s,
|
|
2299
2299
|
total: a
|
|
2300
2300
|
};
|
|
@@ -2319,64 +2319,180 @@ function Wl() {
|
|
|
2319
2319
|
function Kl(e) {
|
|
2320
2320
|
return e.replace(/[?# ^:]/g, "_");
|
|
2321
2321
|
}
|
|
2322
|
-
function
|
|
2322
|
+
function xl(e) {
|
|
2323
2323
|
let t = null;
|
|
2324
2324
|
return "function" != typeof e && "object" != typeof e || (t = ("" + e).match(/function\s*([\w\$]*)\s*\(/)), null !== t ? t[1] + "()" : "";
|
|
2325
2325
|
}
|
|
2326
|
-
function
|
|
2327
|
-
let r = null, l = null,
|
|
2328
|
-
const
|
|
2329
|
-
|
|
2326
|
+
function Yl(e, t = 0, n = !1) {
|
|
2327
|
+
let r = null, l = null, o = null;
|
|
2328
|
+
const i = (...i) => {
|
|
2329
|
+
o = this, l = i;
|
|
2330
2330
|
const s = n && !r;
|
|
2331
2331
|
clearTimeout(r), r = setTimeout(() => {
|
|
2332
|
-
r = null, n || e.apply(
|
|
2333
|
-
}, t), s && e.apply(
|
|
2332
|
+
r = null, n || e.apply(o, l);
|
|
2333
|
+
}, t), s && e.apply(o, l);
|
|
2334
2334
|
};
|
|
2335
|
-
return
|
|
2336
|
-
r && (clearTimeout(r), r = null, e.apply(
|
|
2337
|
-
},
|
|
2338
|
-
clearTimeout(r), r = null, l = null,
|
|
2339
|
-
},
|
|
2335
|
+
return i.flush = () => {
|
|
2336
|
+
r && (clearTimeout(r), r = null, e.apply(o, l));
|
|
2337
|
+
}, i.cancel = () => {
|
|
2338
|
+
clearTimeout(r), r = null, l = null, o = null;
|
|
2339
|
+
}, i;
|
|
2340
2340
|
}
|
|
2341
2341
|
function Bl(...e) {
|
|
2342
2342
|
let t = "", n = 0;
|
|
2343
2343
|
for (let r of e) null != r && "" !== r && (r = String(r), r = 0 === n ? r.replace(/\/+$/, "") : r.replace(/^\/+/, "").replace(/\/+$/, ""), "" !== r && (n > 0 && (t += "/"), t += r, n++));
|
|
2344
2344
|
return t;
|
|
2345
2345
|
}
|
|
2346
|
-
|
|
2346
|
+
var Jl = 256, ql = 1e5;
|
|
2347
|
+
function Hl(e) {
|
|
2348
|
+
const t = String(e).replace(/`/g, "``");
|
|
2349
|
+
return "[" === t[0] ? "[" + t : t;
|
|
2350
|
+
}
|
|
2351
|
+
function Ql(e) {
|
|
2352
|
+
return Array.isArray(e) && 0 !== e.length ? e.map((e) => "number" == typeof e ? `[${e}]` : Hl(e)).join("`") : "";
|
|
2353
|
+
}
|
|
2354
|
+
function zl(e) {
|
|
2355
|
+
if ("string" != typeof e) return null;
|
|
2356
|
+
let t = [], n = "";
|
|
2357
|
+
for (let r = 0; r < e.length; r++) if ("`" !== e[r]) n += e[r];
|
|
2358
|
+
else {
|
|
2359
|
+
if ("`" === e[r + 1]) {
|
|
2360
|
+
n += "`", r++;
|
|
2361
|
+
continue;
|
|
2362
|
+
}
|
|
2363
|
+
t.push(n), n = "";
|
|
2364
|
+
}
|
|
2365
|
+
return t.push(n), t.map((e) => {
|
|
2366
|
+
const t = function(e) {
|
|
2367
|
+
if ("string" != typeof e || e.length < 3 || "[" !== e[0]) return null;
|
|
2368
|
+
if ("]" !== e[e.length - 1]) return null;
|
|
2369
|
+
const t = e.slice(1, -1);
|
|
2370
|
+
return /^[0-9]+$/.test(t) ? t.length > 1 && "0" === t[0] ? null : parseInt(t, 10) : null;
|
|
2371
|
+
}(e);
|
|
2372
|
+
return null !== t ? t : "[" === e[0] && "[" === e[1] ? e.slice(1) : e;
|
|
2373
|
+
});
|
|
2374
|
+
}
|
|
2375
|
+
function Xl(e) {
|
|
2376
|
+
const t = {}, n = (e, r, l) => {
|
|
2377
|
+
if (l > Jl) throw new Error("json2flat: deeper than 256");
|
|
2378
|
+
if (null === e || "object" != typeof e || Array.isArray(e)) {
|
|
2379
|
+
if (Array.isArray(e) && e.length > 0) return void e.forEach((e, t) => {
|
|
2380
|
+
const o = `[${t}]`;
|
|
2381
|
+
n(e, 0 === l ? o : r + "`" + o, l + 1);
|
|
2382
|
+
});
|
|
2383
|
+
} else {
|
|
2384
|
+
const t = Object.keys(e);
|
|
2385
|
+
if (t.length > 0) {
|
|
2386
|
+
for (const o of t) {
|
|
2387
|
+
const t = Hl(o);
|
|
2388
|
+
n(e[o], 0 === l ? t : r + "`" + t, l + 1);
|
|
2389
|
+
}
|
|
2390
|
+
return;
|
|
2391
|
+
}
|
|
2392
|
+
}
|
|
2393
|
+
0 !== l && (t[r] = e);
|
|
2394
|
+
};
|
|
2395
|
+
return null == e || n(e, "", 0), t;
|
|
2396
|
+
}
|
|
2397
|
+
function Zl(e) {
|
|
2398
|
+
if (null === e || "object" != typeof e || Array.isArray(e)) throw new Error("flat2json: a flat json is an object of id -> value");
|
|
2399
|
+
let t = null;
|
|
2400
|
+
for (const n of Object.keys(e)) {
|
|
2401
|
+
const r = zl(n);
|
|
2402
|
+
if (!r || 0 === r.length) throw new Error(`flat2json: malformed flat id: '${n}'`);
|
|
2403
|
+
if (r.length > Jl) throw new Error(`flat2json: '${n}' deeper than 256`);
|
|
2404
|
+
const l = "number" == typeof r[0];
|
|
2405
|
+
if (null === t) t = l ? [] : {};
|
|
2406
|
+
else if (l !== Array.isArray(t)) throw new Error(`flat2json: '${n}' does not fit a ${Array.isArray(t) ? "array" : "object"} root`);
|
|
2407
|
+
let o = t;
|
|
2408
|
+
for (let t = 0; t < r.length; t++) {
|
|
2409
|
+
const l = r[t], i = "number" == typeof l, s = t === r.length - 1, a = !s && "number" == typeof r[t + 1];
|
|
2410
|
+
if (i && l > ql) throw new Error(`flat2json: array index ${l} over the limit (100000) in '${n}'`);
|
|
2411
|
+
if (i !== Array.isArray(o)) throw new Error(`flat2json: '${n}' uses a ${i ? "array index" : "key"} where the tree already has a ${Array.isArray(o) ? "array" : "object"}`);
|
|
2412
|
+
if (s) {
|
|
2413
|
+
if (Array.isArray(o)) {
|
|
2414
|
+
for (; o.length <= l;) o.push(null);
|
|
2415
|
+
o[l] = e[n];
|
|
2416
|
+
} else {
|
|
2417
|
+
if (Object.prototype.hasOwnProperty.call(o, l)) throw new Error(`flat2json: '${n}' is written twice, or once as a value and once as a container`);
|
|
2418
|
+
o[l] = e[n];
|
|
2419
|
+
}
|
|
2420
|
+
break;
|
|
2421
|
+
}
|
|
2422
|
+
let u;
|
|
2423
|
+
if (Array.isArray(o)) {
|
|
2424
|
+
for (; o.length <= l;) o.push(null);
|
|
2425
|
+
u = o[l], null == u && (u = a ? [] : {}, o[l] = u);
|
|
2426
|
+
} else u = o[l], void 0 === u && (u = a ? [] : {}, o[l] = u);
|
|
2427
|
+
if (null === u || "object" != typeof u) throw new Error(`flat2json: '${n}' walks through a value: the same id is a leaf and a container at once`);
|
|
2428
|
+
if (a !== Array.isArray(u)) throw new Error(`flat2json: '${n}' needs a ${a ? "array" : "object"} where the tree already has a ${Array.isArray(u) ? "array" : "object"}`);
|
|
2429
|
+
o = u;
|
|
2430
|
+
}
|
|
2431
|
+
}
|
|
2432
|
+
return null === t ? {} : t;
|
|
2433
|
+
}
|
|
2434
|
+
function eo(e, t) {
|
|
2435
|
+
return e === t || null !== e && null !== t && "object" == typeof e && "object" == typeof t && JSON.stringify(e) === JSON.stringify(t);
|
|
2436
|
+
}
|
|
2437
|
+
function to(e, t) {
|
|
2438
|
+
const n = e && "object" == typeof e ? e : {}, r = t && "object" == typeof t ? t : {}, l = {
|
|
2439
|
+
added: {},
|
|
2440
|
+
removed: {},
|
|
2441
|
+
changed: {}
|
|
2442
|
+
};
|
|
2443
|
+
for (const e of Object.keys(n)) Object.prototype.hasOwnProperty.call(r, e) ? eo(n[e], r[e]) || (l.changed[e] = {
|
|
2444
|
+
from: n[e],
|
|
2445
|
+
to: r[e]
|
|
2446
|
+
}) : l.removed[e] = n[e];
|
|
2447
|
+
for (const e of Object.keys(r)) Object.prototype.hasOwnProperty.call(n, e) || (l.added[e] = r[e]);
|
|
2448
|
+
return l;
|
|
2449
|
+
}
|
|
2450
|
+
function no(e, t) {
|
|
2451
|
+
if (null === e || "object" != typeof e || Array.isArray(e)) throw new Error("flat_apply: a flat json is an object of id -> value");
|
|
2452
|
+
if (null === t || "object" != typeof t) throw new Error("flat_apply: a diff is the object flat_diff() answers");
|
|
2453
|
+
for (const n of Object.keys(t.removed || {})) delete e[n];
|
|
2454
|
+
for (const n of Object.keys(t.added || {})) e[n] = t.added[n];
|
|
2455
|
+
for (const n of Object.keys(t.changed || {})) {
|
|
2456
|
+
const r = t.changed[n];
|
|
2457
|
+
if (!r || !Object.prototype.hasOwnProperty.call(r, "to")) throw new Error(`flat_apply: changed '${n}' without a 'to'`);
|
|
2458
|
+
e[n] = r.to;
|
|
2459
|
+
}
|
|
2460
|
+
return e;
|
|
2461
|
+
}
|
|
2462
|
+
function ro(e) {
|
|
2347
2463
|
return "persistent-attrs-" + Tt(e);
|
|
2348
2464
|
}
|
|
2349
|
-
function
|
|
2350
|
-
let n = Wt(e,
|
|
2465
|
+
function lo(e, t) {
|
|
2466
|
+
let n = Wt(e, v.SDF_PERSIST), r = Zr(ro(e), null, !1);
|
|
2351
2467
|
if (r && gr(r)) {
|
|
2352
2468
|
let l = zr(e, r, t, !1);
|
|
2353
|
-
l = zr(e, l, n, !1), Ht(e, l,
|
|
2469
|
+
l = zr(e, l, n, !1), Ht(e, l, v.SDF_PERSIST);
|
|
2354
2470
|
}
|
|
2355
2471
|
}
|
|
2356
|
-
function
|
|
2357
|
-
let n = zr(e, Wt(e,
|
|
2358
|
-
return r && gr(r) && tr(n, r), el(
|
|
2472
|
+
function oo(e, t) {
|
|
2473
|
+
let n = zr(e, Wt(e, v.SDF_PERSIST), t, !1), r = Zr(ro(e), null, !1);
|
|
2474
|
+
return r && gr(r) && tr(n, r), el(ro(e), n);
|
|
2359
2475
|
}
|
|
2360
|
-
function
|
|
2361
|
-
let n = Xr(e, Zr(
|
|
2362
|
-
0 === _r(n) ? tl(
|
|
2476
|
+
function io(e, t) {
|
|
2477
|
+
let n = Xr(e, Zr(ro(e), null, !1), t, !1);
|
|
2478
|
+
0 === _r(n) ? tl(ro(e)) : el(ro(e), n);
|
|
2363
2479
|
}
|
|
2364
|
-
function
|
|
2365
|
-
let n = Zr(
|
|
2480
|
+
function so(e, t) {
|
|
2481
|
+
let n = Zr(ro(e), null, !1), r = {};
|
|
2366
2482
|
return n && gr(n) && (r = zr(e, n, t, !1)), r;
|
|
2367
2483
|
}
|
|
2368
|
-
function
|
|
2484
|
+
function ao(e) {
|
|
2369
2485
|
if (dr(e) && 1 === fr(e)) {
|
|
2370
2486
|
let t = e[0];
|
|
2371
2487
|
return kr(t, "size") ? t.size : 1;
|
|
2372
2488
|
}
|
|
2373
2489
|
return fr(e);
|
|
2374
2490
|
}
|
|
2375
|
-
function
|
|
2491
|
+
function uo(e, t) {
|
|
2376
2492
|
if (br(t)) {
|
|
2377
2493
|
if (-1 === t.indexOf("^")) {
|
|
2378
2494
|
let n, r, l = e.fkey;
|
|
2379
|
-
if (1 !== _r(l)) return
|
|
2495
|
+
if (1 !== _r(l)) return xn("bad fkey 1"), xn(e), xn(t), null;
|
|
2380
2496
|
for (const e of Object.keys(l)) {
|
|
2381
2497
|
n = e, r = l[e];
|
|
2382
2498
|
break;
|
|
@@ -2389,7 +2505,7 @@ function Zl(e, t) {
|
|
|
2389
2505
|
}
|
|
2390
2506
|
{
|
|
2391
2507
|
let n = t.split("^");
|
|
2392
|
-
return 3 !== n.length ? (
|
|
2508
|
+
return 3 !== n.length ? (xn("bad fkey 2"), xn(e), xn(t), null) : {
|
|
2393
2509
|
topic_name: n[0],
|
|
2394
2510
|
id: n[1],
|
|
2395
2511
|
hook_name: n[2]
|
|
@@ -2400,17 +2516,17 @@ function Zl(e, t) {
|
|
|
2400
2516
|
topic_name: t.topic_name,
|
|
2401
2517
|
id: t.id,
|
|
2402
2518
|
hook_name: t.hook_name
|
|
2403
|
-
} : (
|
|
2519
|
+
} : (xn("bad fkey 3"), xn(e), xn(t), null);
|
|
2404
2520
|
}
|
|
2405
|
-
function
|
|
2406
|
-
let n =
|
|
2521
|
+
function _o(e, t) {
|
|
2522
|
+
let n = uo(e, t);
|
|
2407
2523
|
return n ? n.topic_name + "^" + n.id + "^" + n.hook_name : null;
|
|
2408
2524
|
}
|
|
2409
|
-
function
|
|
2525
|
+
function co(e, t) {
|
|
2410
2526
|
if (br(t)) {
|
|
2411
2527
|
if (-1 === t.indexOf("^")) {
|
|
2412
2528
|
let n, r = e.hook;
|
|
2413
|
-
if (1 !== _r(r)) return
|
|
2529
|
+
if (1 !== _r(r)) return xn("bad hook 1"), xn(e), xn(t), null;
|
|
2414
2530
|
for (let e of Object.keys(r)) {
|
|
2415
2531
|
n = e, r[e];
|
|
2416
2532
|
break;
|
|
@@ -2422,7 +2538,7 @@ function ti(e, t) {
|
|
|
2422
2538
|
}
|
|
2423
2539
|
{
|
|
2424
2540
|
let n = t.split("^");
|
|
2425
|
-
return 2 !== n.length ? (
|
|
2541
|
+
return 2 !== n.length ? (xn("bad hook 2"), xn(e), xn(t), null) : {
|
|
2426
2542
|
topic_name: n[0],
|
|
2427
2543
|
id: n[1]
|
|
2428
2544
|
};
|
|
@@ -2431,9 +2547,9 @@ function ti(e, t) {
|
|
|
2431
2547
|
return gr(t) ? {
|
|
2432
2548
|
topic_name: t.topic_name,
|
|
2433
2549
|
id: t.id
|
|
2434
|
-
} : (
|
|
2550
|
+
} : (xn("bad hook 3"), xn(e), xn(t), null);
|
|
2435
2551
|
}
|
|
2436
|
-
var
|
|
2552
|
+
var fo = [
|
|
2437
2553
|
"string",
|
|
2438
2554
|
"integer",
|
|
2439
2555
|
"object",
|
|
@@ -2443,7 +2559,7 @@ var ni = [
|
|
|
2443
2559
|
"real",
|
|
2444
2560
|
"boolean",
|
|
2445
2561
|
"blob"
|
|
2446
|
-
],
|
|
2562
|
+
], go = [
|
|
2447
2563
|
"persistent",
|
|
2448
2564
|
"required",
|
|
2449
2565
|
"notnull",
|
|
@@ -2455,7 +2571,7 @@ var ni = [
|
|
|
2455
2571
|
"stats",
|
|
2456
2572
|
"rstats",
|
|
2457
2573
|
"pstats"
|
|
2458
|
-
],
|
|
2574
|
+
], bo = [
|
|
2459
2575
|
"hook",
|
|
2460
2576
|
"fkey",
|
|
2461
2577
|
"enum",
|
|
@@ -2482,7 +2598,7 @@ var ni = [
|
|
|
2482
2598
|
"coordinates",
|
|
2483
2599
|
"gbuffer"
|
|
2484
2600
|
];
|
|
2485
|
-
function
|
|
2601
|
+
function po(e) {
|
|
2486
2602
|
let t = {
|
|
2487
2603
|
name: e.id,
|
|
2488
2604
|
header: e.header,
|
|
@@ -2500,7 +2616,7 @@ function ii(e) {
|
|
|
2500
2616
|
if (!e.flag) return t;
|
|
2501
2617
|
for (let n = 0; n < e.flag.length; n++) {
|
|
2502
2618
|
let r = e.flag[n];
|
|
2503
|
-
if (ul(
|
|
2619
|
+
if (ul(bo, r)) {
|
|
2504
2620
|
switch (r) {
|
|
2505
2621
|
case "enum":
|
|
2506
2622
|
t.enum_list = e.enum;
|
|
@@ -2511,7 +2627,7 @@ function ii(e) {
|
|
|
2511
2627
|
case "table": t.enum_list = e.table;
|
|
2512
2628
|
}
|
|
2513
2629
|
t.type = r;
|
|
2514
|
-
} else if (ul(
|
|
2630
|
+
} else if (ul(go, r)) switch (r) {
|
|
2515
2631
|
case "writable":
|
|
2516
2632
|
t.is_writable = !0;
|
|
2517
2633
|
break;
|
|
@@ -2524,7 +2640,7 @@ function ii(e) {
|
|
|
2524
2640
|
}
|
|
2525
2641
|
return t;
|
|
2526
2642
|
}
|
|
2527
|
-
function
|
|
2643
|
+
function mo(e, t) {
|
|
2528
2644
|
let n = {
|
|
2529
2645
|
name: e,
|
|
2530
2646
|
header: e,
|
|
@@ -2542,9 +2658,9 @@ function oi(e, t) {
|
|
|
2542
2658
|
let e = t.split(".");
|
|
2543
2659
|
for (let t = 0; t < e.length; t++) {
|
|
2544
2660
|
let r = e[t];
|
|
2545
|
-
if (ul(
|
|
2546
|
-
else if (ul(
|
|
2547
|
-
else if (ul(
|
|
2661
|
+
if (ul(fo, r)) n.real_type || (n.real_type = r);
|
|
2662
|
+
else if (ul(bo, r)) n.type || (n.type = r);
|
|
2663
|
+
else if (ul(go, r)) switch (r) {
|
|
2548
2664
|
case "writable":
|
|
2549
2665
|
n.is_writable = !0;
|
|
2550
2666
|
break;
|
|
@@ -2556,39 +2672,39 @@ function oi(e, t) {
|
|
|
2556
2672
|
}
|
|
2557
2673
|
}
|
|
2558
2674
|
n.real_type || (n.real_type = "string");
|
|
2559
|
-
} else gr(t) ? (n =
|
|
2675
|
+
} else gr(t) ? (n = po(t), n.name || (n.name = e), n.header || (n.header = e)) : dr(t) && (n.real_type = "array", n.enum_list = t);
|
|
2560
2676
|
return n.type || (n.type = n.real_type), n;
|
|
2561
2677
|
}
|
|
2562
|
-
function
|
|
2678
|
+
function Eo(e, t) {
|
|
2563
2679
|
let n = {};
|
|
2564
2680
|
return t || (t = {}), Object.entries(e).forEach(([e, r]) => {
|
|
2565
2681
|
let l;
|
|
2566
2682
|
gr(r) && (l = r.default);
|
|
2567
|
-
let
|
|
2568
|
-
n[e] =
|
|
2683
|
+
let o = Wr(null, t, e, l);
|
|
2684
|
+
n[e] = o;
|
|
2569
2685
|
}), n;
|
|
2570
2686
|
}
|
|
2571
|
-
var
|
|
2687
|
+
var To = [
|
|
2572
2688
|
N(y.DTP_POINTER, "subscriber", 0, null, "Subscriber of output events"),
|
|
2573
2689
|
N(y.DTP_BOOLEAN, "periodic", 0, 0, "True for periodic timeouts"),
|
|
2574
2690
|
N(y.DTP_INTEGER, "msec", 0, 0, "Timeout in milliseconds"),
|
|
2575
|
-
|
|
2576
|
-
],
|
|
2691
|
+
S()
|
|
2692
|
+
], ho = {
|
|
2577
2693
|
periodic: !1,
|
|
2578
2694
|
msec: 0,
|
|
2579
2695
|
timer_id: -1
|
|
2580
|
-
},
|
|
2581
|
-
function
|
|
2582
|
-
let l = e.priv,
|
|
2696
|
+
}, yo = null;
|
|
2697
|
+
function vo(e, t, n, r) {
|
|
2698
|
+
let l = e.priv, o = l.periodic ? "EV_TIMEOUT_PERIODIC" : "EV_TIMEOUT";
|
|
2583
2699
|
return l.periodic && l.msec > 0 ? l.timer_id = setTimeout(function() {
|
|
2584
2700
|
cn(e, "EV_TIMEOUT", {}, e);
|
|
2585
|
-
}, l.msec) : l.timer_id = -1,
|
|
2701
|
+
}, l.msec) : l.timer_id = -1, Ot(e) ? cn(yt(e), o, {}, e) : Sn(e, o, {}), l.periodic || -1 !== l.timer_id || ut(e) && rt(e), 0;
|
|
2586
2702
|
}
|
|
2587
|
-
var
|
|
2703
|
+
var Oo = {
|
|
2588
2704
|
mt_create: function(e) {
|
|
2589
2705
|
let t = e.priv;
|
|
2590
2706
|
const n = Bt(e, "subscriber");
|
|
2591
|
-
n && En(e, null, {}, n), t.periodic = Kt(e, "periodic"), t.msec =
|
|
2707
|
+
n && En(e, null, {}, n), t.periodic = Kt(e, "periodic"), t.msec = xt(e, "msec");
|
|
2592
2708
|
},
|
|
2593
2709
|
mt_writing: function(e, t) {
|
|
2594
2710
|
let n = e.priv;
|
|
@@ -2596,7 +2712,7 @@ var fi = {
|
|
|
2596
2712
|
case "periodic":
|
|
2597
2713
|
n.periodic = Kt(e, "periodic");
|
|
2598
2714
|
break;
|
|
2599
|
-
case "msec": n.msec =
|
|
2715
|
+
case "msec": n.msec = xt(e, "msec"), -1 !== n.timer_id && (clearTimeout(n.timer_id), n.timer_id = -1), n.msec > 0 && (n.timer_id = setTimeout(function() {
|
|
2600
2716
|
cn(e, "EV_TIMEOUT", {}, e);
|
|
2601
2717
|
}, n.msec)), n.msec > 0 ? ut(e) || Xe(e) : ut(e) && rt(e);
|
|
2602
2718
|
}
|
|
@@ -2609,31 +2725,31 @@ var fi = {
|
|
|
2609
2725
|
},
|
|
2610
2726
|
mt_destroy: function(e) {}
|
|
2611
2727
|
};
|
|
2612
|
-
function
|
|
2728
|
+
function So() {
|
|
2613
2729
|
return function(e) {
|
|
2614
|
-
if (
|
|
2730
|
+
if (yo) return xn(`GClass ALREADY created: ${e}`), -1;
|
|
2615
2731
|
const t = [["ST_IDLE", [[
|
|
2616
2732
|
"EV_TIMEOUT",
|
|
2617
|
-
|
|
2733
|
+
vo,
|
|
2618
2734
|
null
|
|
2619
2735
|
]]]];
|
|
2620
|
-
return (
|
|
2736
|
+
return (yo = ye(e, [
|
|
2621
2737
|
["EV_TIMEOUT", U.EVF_OUTPUT_EVENT],
|
|
2622
2738
|
["EV_TIMEOUT_PERIODIC", U.EVF_OUTPUT_EVENT],
|
|
2623
2739
|
[0, 0]
|
|
2624
|
-
], t,
|
|
2740
|
+
], t, Oo, 0, To, ho, 0, 0, 0, C.gcflag_manual_start)) ? 0 : -1;
|
|
2625
2741
|
}("C_TIMER");
|
|
2626
2742
|
}
|
|
2627
|
-
function
|
|
2628
|
-
return e instanceof k ? "C_TIMER" !== Et(e) ? (
|
|
2743
|
+
function No(e, t) {
|
|
2744
|
+
return e instanceof k ? "C_TIMER" !== Et(e) ? (xn("not C_TIMER GObj"), -1) : (Qt(e, "periodic", !1), void zt(e, "msec", t)) : (xn("not GObj TYPE"), -1);
|
|
2629
2745
|
}
|
|
2630
|
-
function
|
|
2631
|
-
return e instanceof k ? "C_TIMER" !== Et(e) ? (
|
|
2746
|
+
function Ro(e, t) {
|
|
2747
|
+
return e instanceof k ? "C_TIMER" !== Et(e) ? (xn("not C_TIMER GObj"), -1) : (Qt(e, "periodic", !0), void zt(e, "msec", t)) : (xn("not GObj TYPE"), -1);
|
|
2632
2748
|
}
|
|
2633
|
-
function
|
|
2634
|
-
return e instanceof k ? "C_TIMER" !== Et(e) ? (
|
|
2749
|
+
function jo(e) {
|
|
2750
|
+
return e instanceof k ? "C_TIMER" !== Et(e) ? (xn("not C_TIMER GObj"), -1) : void zt(e, "msec", -1) : (xn("not GObj TYPE"), -1);
|
|
2635
2751
|
}
|
|
2636
|
-
var
|
|
2752
|
+
var wo = [
|
|
2637
2753
|
N(y.DTP_BOOLEAN, "changesLost", 0, !1, "Set true to warn about leaving page"),
|
|
2638
2754
|
N(y.DTP_BOOLEAN, "browser_beforeunload", 0, !1, "Set true to refreshing browser"),
|
|
2639
2755
|
N(y.DTP_STRING, "__username__", 0, "", "Username"),
|
|
@@ -2658,22 +2774,22 @@ var pi = [
|
|
|
2658
2774
|
N(y.DTP_BOOLEAN, "no_poll", 0, 0, "no poll"),
|
|
2659
2775
|
N(y.DTP_BOOLEAN, "developer", 0, !1, "Developer mode enabled"),
|
|
2660
2776
|
N(y.DTP_INTEGER, "periodic_timeout", 0, "1000", "Timeout periodic, in miliseconds."),
|
|
2661
|
-
|
|
2662
|
-
],
|
|
2663
|
-
function
|
|
2664
|
-
return
|
|
2777
|
+
S()
|
|
2778
|
+
], Do = { gobj_timer: null }, Ao = null;
|
|
2779
|
+
function Io(e, t, n, r) {
|
|
2780
|
+
return Sn(e, t, n), 0;
|
|
2665
2781
|
}
|
|
2666
|
-
var
|
|
2782
|
+
var $o = {
|
|
2667
2783
|
mt_create: function(e) {
|
|
2668
2784
|
let t = e.priv;
|
|
2669
|
-
Xt(e, "start_date", Gl()), Xt(e, "node_uuid", Wl()), e.priv.gobj_timer = He(
|
|
2785
|
+
Xt(e, "start_date", Gl()), Xt(e, "node_uuid", Wl()), e.priv.gobj_timer = He(mt(e), "C_TIMER", {}, e), t.periodic_timeout = Mt(e, "periodic_timeout");
|
|
2670
2786
|
},
|
|
2671
2787
|
mt_writing: function(e, t) {},
|
|
2672
2788
|
mt_start: function(e) {
|
|
2673
|
-
return
|
|
2789
|
+
return Ro(e.priv.gobj_timer, e.priv.periodic_timeout), 0;
|
|
2674
2790
|
},
|
|
2675
2791
|
mt_stop: function(e) {
|
|
2676
|
-
return
|
|
2792
|
+
return jo(e.priv.gobj_timer), ot(e), 0;
|
|
2677
2793
|
},
|
|
2678
2794
|
mt_destroy: function(e) {},
|
|
2679
2795
|
mt_play: function(e) {
|
|
@@ -2684,35 +2800,35 @@ var yi = {
|
|
|
2684
2800
|
return at(ke()), 0;
|
|
2685
2801
|
}
|
|
2686
2802
|
};
|
|
2687
|
-
function
|
|
2803
|
+
function ko() {
|
|
2688
2804
|
return function(e) {
|
|
2689
|
-
if (
|
|
2805
|
+
if (Ao) return xn(`GClass ALREADY created: ${e}`), -1;
|
|
2690
2806
|
const t = [["ST_IDLE", [[
|
|
2691
2807
|
"EV_TIMEOUT_PERIODIC",
|
|
2692
|
-
|
|
2808
|
+
Io,
|
|
2693
2809
|
null
|
|
2694
2810
|
]]]];
|
|
2695
|
-
return (
|
|
2811
|
+
return (Ao = ye(e, [["EV_TIMEOUT_PERIODIC", U.EVF_OUTPUT_EVENT | U.EVF_NO_WARN_SUBS], [0, 0]], t, $o, 0, wo, Do, 0, 0, 0, 0)) ? 0 : -1;
|
|
2696
2812
|
}("C_YUNO");
|
|
2697
2813
|
}
|
|
2698
|
-
var
|
|
2699
|
-
N(y.DTP_STRING, "wanted_yuno_role",
|
|
2700
|
-
N(y.DTP_STRING, "wanted_yuno_name",
|
|
2701
|
-
N(y.DTP_STRING, "wanted_yuno_service",
|
|
2702
|
-
N(y.DTP_STRING, "remote_yuno_role",
|
|
2703
|
-
N(y.DTP_STRING, "remote_yuno_name",
|
|
2704
|
-
N(y.DTP_STRING, "remote_yuno_service",
|
|
2705
|
-
N(y.DTP_STRING, "url",
|
|
2706
|
-
N(y.DTP_STRING, "jwt",
|
|
2707
|
-
N(y.DTP_STRING, "cert_pem",
|
|
2708
|
-
N(y.DTP_JSON, "extra_info",
|
|
2709
|
-
N(y.DTP_LIST, "required_services",
|
|
2710
|
-
N(y.DTP_INTEGER, "timeout_retry",
|
|
2711
|
-
N(y.DTP_INTEGER, "timeout_retry_max",
|
|
2712
|
-
N(y.DTP_INTEGER, "timeout_idack",
|
|
2814
|
+
var Co = "ievent_gate_stack", Lo = [
|
|
2815
|
+
N(y.DTP_STRING, "wanted_yuno_role", v.SDF_RD, "", "wanted yuno role"),
|
|
2816
|
+
N(y.DTP_STRING, "wanted_yuno_name", v.SDF_RD, "", "wanted yuno name"),
|
|
2817
|
+
N(y.DTP_STRING, "wanted_yuno_service", v.SDF_RD, "", "wanted yuno service"),
|
|
2818
|
+
N(y.DTP_STRING, "remote_yuno_role", v.SDF_RD, "", "confirmed remote yuno role"),
|
|
2819
|
+
N(y.DTP_STRING, "remote_yuno_name", v.SDF_RD, "", "confirmed remote yuno name"),
|
|
2820
|
+
N(y.DTP_STRING, "remote_yuno_service", v.SDF_RD, "", "confirmed remote yuno service"),
|
|
2821
|
+
N(y.DTP_STRING, "url", v.SDF_RD, "", "Url to connect"),
|
|
2822
|
+
N(y.DTP_STRING, "jwt", v.SDF_PERSIST, "", "JWT"),
|
|
2823
|
+
N(y.DTP_STRING, "cert_pem", v.SDF_PERSIST, "", "SSL server certification, PEM str format"),
|
|
2824
|
+
N(y.DTP_JSON, "extra_info", v.SDF_RD, "{}", "dict data set by user, added to the identity card msg."),
|
|
2825
|
+
N(y.DTP_LIST, "required_services", v.SDF_RD, "[]", "Services this LINK requires (identity card). Empty = the yuno's `required_services`, as before. A yuno with several links to DIFFERENT backends must set it per link: the yuno-wide list is the union, so every backend is told the service names of all the others."),
|
|
2826
|
+
N(y.DTP_INTEGER, "timeout_retry", v.SDF_RD, "5000", "First reconnect delay (ms). It BACKS OFF from here, doubling up to timeout_retry_max, and resets when a session is reached"),
|
|
2827
|
+
N(y.DTP_INTEGER, "timeout_retry_max", v.SDF_RD, "60000", "Cap of the reconnect backoff (ms). Set it equal to timeout_retry for the old fixed-interval behaviour"),
|
|
2828
|
+
N(y.DTP_INTEGER, "timeout_idack", v.SDF_RD, "5000", "timeout waiting idAck"),
|
|
2713
2829
|
N(y.DTP_POINTER, "subscriber", 0, 0, "subscriber of output-events. If null then subscriber is the parent"),
|
|
2714
|
-
|
|
2715
|
-
],
|
|
2830
|
+
S()
|
|
2831
|
+
], Po = {
|
|
2716
2832
|
url: null,
|
|
2717
2833
|
remote_yuno_name: null,
|
|
2718
2834
|
remote_yuno_role: null,
|
|
@@ -2722,16 +2838,16 @@ var vi = "ievent_gate_stack", Oi = [
|
|
|
2722
2838
|
websocket: null,
|
|
2723
2839
|
inside_on_open: !1,
|
|
2724
2840
|
retry_ms: 0
|
|
2725
|
-
},
|
|
2726
|
-
function
|
|
2727
|
-
e.priv.websocket &&
|
|
2728
|
-
const t =
|
|
2841
|
+
}, Uo = null;
|
|
2842
|
+
function Fo(e) {
|
|
2843
|
+
e.priv.websocket && xn("Websocket ALREADY setup");
|
|
2844
|
+
const t = Yt(e, "url");
|
|
2729
2845
|
let n;
|
|
2730
2846
|
Jn(`====> Starting WebSocket to '${t}' (${Tt(e)})`);
|
|
2731
2847
|
try {
|
|
2732
2848
|
n = new WebSocket(t);
|
|
2733
2849
|
} catch (n) {
|
|
2734
|
-
return
|
|
2850
|
+
return xn(`${Tt(e)}: Cannot open WebSocket to '${t}', Error: ${n.message}`), null;
|
|
2735
2851
|
}
|
|
2736
2852
|
return n ? (n.onopen = () => {
|
|
2737
2853
|
cn(e, "EV_ON_OPEN", { url: t }, e);
|
|
@@ -2741,24 +2857,24 @@ function Di(e) {
|
|
|
2741
2857
|
data: n.data
|
|
2742
2858
|
}, e);
|
|
2743
2859
|
}, n.onclose = (n) => {
|
|
2744
|
-
|
|
2860
|
+
St(e) || (Kt(gt(), "browser_beforeunload") ? Yn("Close websocket by unload page") : cn(e, "EV_ON_CLOSE", {
|
|
2745
2861
|
url: t,
|
|
2746
2862
|
e: n
|
|
2747
2863
|
}, e));
|
|
2748
|
-
}, n) : (
|
|
2864
|
+
}, n) : (xn(`${Tt(e)}: Failed to initialize WebSocket.`), null);
|
|
2749
2865
|
}
|
|
2750
|
-
function
|
|
2866
|
+
function Go(e, t = 1e3, n = "") {
|
|
2751
2867
|
let r = e.priv, l = r.websocket;
|
|
2752
2868
|
if (r.websocket = null, l && l.readyState !== WebSocket.CLOSED && l.readyState !== WebSocket.CLOSING) {
|
|
2753
2869
|
Jn(`Closing WebSocket (Code: ${t}, Reason: "${n}")`);
|
|
2754
2870
|
try {
|
|
2755
2871
|
l.close(t, n);
|
|
2756
2872
|
} catch (e) {
|
|
2757
|
-
|
|
2873
|
+
xn("Error closing WebSocket:", e.message);
|
|
2758
2874
|
}
|
|
2759
|
-
} else
|
|
2875
|
+
} else Yn("WebSocket is already closed or in the process of closing.");
|
|
2760
2876
|
}
|
|
2761
|
-
function
|
|
2877
|
+
function Vo(e, t, n) {
|
|
2762
2878
|
let r = Gl();
|
|
2763
2879
|
try {
|
|
2764
2880
|
Jn("\n" + r + " " + t + "\n"), Hn(n);
|
|
@@ -2766,33 +2882,33 @@ function ji(e, t, n) {
|
|
|
2766
2882
|
Jn("ERROR in trace_inter_event: " + e);
|
|
2767
2883
|
}
|
|
2768
2884
|
}
|
|
2769
|
-
var
|
|
2885
|
+
var Mo = class {
|
|
2770
2886
|
constructor(e, t) {
|
|
2771
2887
|
this.event = e, this.kw = t || {};
|
|
2772
2888
|
}
|
|
2773
2889
|
};
|
|
2774
|
-
function
|
|
2890
|
+
function Wo(e, t, n, r) {
|
|
2775
2891
|
return function(e, t) {
|
|
2776
2892
|
let n = e.priv, r = JSON.stringify(t);
|
|
2777
2893
|
if (Kt(gt(), "trace_inter_event")) {
|
|
2778
|
-
let n =
|
|
2779
|
-
|
|
2894
|
+
let n = Yt(e, "url"), l = mt(gt()) + " ==> " + n, o = Mt(gt(), "trace_ievent_callback");
|
|
2895
|
+
o ? o(l, t, 1, r.length) : Vo(0, l, t);
|
|
2780
2896
|
}
|
|
2781
|
-
if (!n.websocket || n.websocket.readyState !== WebSocket.OPEN) return
|
|
2897
|
+
if (!n.websocket || n.websocket.readyState !== WebSocket.OPEN) return Yn(`${Tt(e)}: send_iev(): websocket not open, message lost`), -1;
|
|
2782
2898
|
try {
|
|
2783
2899
|
n.websocket.send(r);
|
|
2784
2900
|
} catch (t) {
|
|
2785
|
-
|
|
2901
|
+
xn(`${Tt(e)}: send_iev(): ${t}`);
|
|
2786
2902
|
}
|
|
2787
2903
|
return 0;
|
|
2788
2904
|
}(e, function(e, t) {
|
|
2789
|
-
return
|
|
2905
|
+
return Or(e) ? (xn("iev_create() event NULL"), null) : new Mo(e, t);
|
|
2790
2906
|
}(t, n));
|
|
2791
2907
|
}
|
|
2792
|
-
function
|
|
2793
|
-
return
|
|
2794
|
-
dst_yuno:
|
|
2795
|
-
dst_role:
|
|
2908
|
+
function Ko(e, t, n) {
|
|
2909
|
+
return Or(n) && (n = Yt(e, "wanted_yuno_service")), {
|
|
2910
|
+
dst_yuno: Yt(e, "wanted_yuno_name"),
|
|
2911
|
+
dst_role: Yt(e, "wanted_yuno_role"),
|
|
2796
2912
|
dst_service: n,
|
|
2797
2913
|
src_yuno: dt(),
|
|
2798
2914
|
src_role: bt(),
|
|
@@ -2800,160 +2916,159 @@ function $i(e, t, n) {
|
|
|
2800
2916
|
host: Wl()
|
|
2801
2917
|
};
|
|
2802
2918
|
}
|
|
2803
|
-
function
|
|
2804
|
-
let t = e.priv, n = ft(gt()), r =
|
|
2805
|
-
|
|
2919
|
+
function xo(e) {
|
|
2920
|
+
let t = e.priv, n = ft(gt()), r = Yt(gt(), "yuno_version"), l = Yt(gt(), "yuno_release"), o = Yt(gt(), "yuno_tag"), i = Mt(e, "required_services");
|
|
2921
|
+
i && i.length || (i = Mt(gt(), "required_services"));
|
|
2806
2922
|
let s = {
|
|
2807
2923
|
yuno_role: bt(),
|
|
2808
|
-
yuno_id:
|
|
2924
|
+
yuno_id: pt(),
|
|
2809
2925
|
yuno_name: dt(),
|
|
2810
|
-
yuno_tag:
|
|
2926
|
+
yuno_tag: o,
|
|
2811
2927
|
yuno_version: r,
|
|
2812
2928
|
yuno_release: l,
|
|
2813
2929
|
yuneta_version: a,
|
|
2814
2930
|
playing: n,
|
|
2815
2931
|
pid: 0,
|
|
2816
2932
|
watcher_pid: 0,
|
|
2817
|
-
jwt:
|
|
2818
|
-
username:
|
|
2933
|
+
jwt: Yt(e, "jwt"),
|
|
2934
|
+
username: Yt(gt(), "__username__"),
|
|
2819
2935
|
launch_id: 0,
|
|
2820
|
-
yuno_startdate:
|
|
2936
|
+
yuno_startdate: Yt(gt(), "start_date"),
|
|
2821
2937
|
id: Wl(),
|
|
2822
2938
|
user_agent: "undefined" != typeof window ? window.navigator.userAgent : "",
|
|
2823
2939
|
language: "undefined" != typeof window ? window.navigator.language : "",
|
|
2824
|
-
required_services:
|
|
2940
|
+
required_services: i
|
|
2825
2941
|
};
|
|
2826
|
-
return dl(e, s,
|
|
2942
|
+
return dl(e, s, Co, Ko(e, mt(yt(e)), null)), pl(e, s, "__identity__"), No(t.gobj_timer, xt(e, "timeout_idack")), Wo(e, "EV_IDENTITY_CARD", s);
|
|
2827
2943
|
}
|
|
2828
|
-
function
|
|
2829
|
-
if (
|
|
2830
|
-
let n = {}, r = t.__global__, l = t.__config__,
|
|
2831
|
-
l && (n.__config__ = l), r && (n.__global__ = r),
|
|
2832
|
-
return dl(e, n,
|
|
2944
|
+
function Yo(e, t) {
|
|
2945
|
+
if (Or(t.event)) return -1;
|
|
2946
|
+
let n = {}, r = t.__global__, l = t.__config__, o = t.__filter__, i = t.__service__, s = t.subscriber;
|
|
2947
|
+
l && (n.__config__ = l), r && (n.__global__ = r), o && (n.__filter__ = o);
|
|
2948
|
+
return dl(e, n, Co, Ko(e, mt(s), i)), pl(e, n, "__subscribing__"), Wo(e, t.event, n);
|
|
2833
2949
|
}
|
|
2834
|
-
function
|
|
2950
|
+
function Bo(e, t, n, r) {
|
|
2835
2951
|
let l = e.priv;
|
|
2836
|
-
return ut(e) && (l.websocket =
|
|
2952
|
+
return ut(e) && (l.websocket = Fo(e)), 0;
|
|
2837
2953
|
}
|
|
2838
|
-
function
|
|
2839
|
-
return Jn("Websocket opened: " + e.priv.url),
|
|
2954
|
+
function Jo(e, t, n, r) {
|
|
2955
|
+
return Jn("Websocket opened: " + e.priv.url), xo(e), 0;
|
|
2840
2956
|
}
|
|
2841
|
-
function
|
|
2842
|
-
let l = e.priv,
|
|
2843
|
-
return Wn(),
|
|
2844
|
-
url:
|
|
2957
|
+
function qo(e, t, n, r) {
|
|
2958
|
+
let l = e.priv, o = n.e, i = n.url;
|
|
2959
|
+
return Wn(), Yn(`${Tt(e)}: WebSocket closed ${i} (Code: ${o.code}, Reason: "${o.reason}", Clean: ${o.wasClean})`), l.websocket && (l.websocket.onopen = null, l.websocket.onmessage = null, l.websocket.onerror = null, l.websocket.onclose = null, l.websocket = null), l.inform_on_close ? (l.inform_on_close = !1, Sn(e, "EV_ON_CLOSE", {
|
|
2960
|
+
url: i,
|
|
2845
2961
|
remote_yuno_name: l.remote_yuno_name,
|
|
2846
2962
|
remote_yuno_role: l.remote_yuno_role,
|
|
2847
2963
|
remote_yuno_service: l.remote_yuno_service
|
|
2848
|
-
})) : (
|
|
2849
|
-
url:
|
|
2964
|
+
})) : (Yn(`${Tt(e)}: EV_ON_OPEN_ERROR cannot open ${i} (Code: ${o.code}, Reason: "${o.reason}", Clean: ${o.wasClean})`), Sn(e, "EV_ON_OPEN_ERROR", {
|
|
2965
|
+
url: i,
|
|
2850
2966
|
remote_yuno_name: l.remote_yuno_name,
|
|
2851
2967
|
remote_yuno_role: l.remote_yuno_role,
|
|
2852
2968
|
remote_yuno_service: l.remote_yuno_service,
|
|
2853
|
-
code:
|
|
2854
|
-
reason:
|
|
2855
|
-
was_clean:
|
|
2856
|
-
})), ut(e) &&
|
|
2857
|
-
let t = e.priv, n =
|
|
2969
|
+
code: o.code,
|
|
2970
|
+
reason: o.reason,
|
|
2971
|
+
was_clean: o.wasClean
|
|
2972
|
+
})), ut(e) && No(l.gobj_timer, function(e) {
|
|
2973
|
+
let t = e.priv, n = xt(e, "timeout_retry"), r = xt(e, "timeout_retry_max");
|
|
2858
2974
|
r < n && (r = n);
|
|
2859
2975
|
t.retry_ms = t.retry_ms ? Math.min(2 * t.retry_ms, r) : n;
|
|
2860
|
-
let l = .2 * t.retry_ms,
|
|
2861
|
-
return Math.max(1, Math.round(
|
|
2976
|
+
let l = .2 * t.retry_ms, o = t.retry_ms - l + 2 * Math.random() * l;
|
|
2977
|
+
return Math.max(1, Math.round(o));
|
|
2862
2978
|
}(e)), 0;
|
|
2863
2979
|
}
|
|
2864
|
-
function
|
|
2865
|
-
return
|
|
2980
|
+
function Ho(e, t, n, r) {
|
|
2981
|
+
return xo(e), 0;
|
|
2866
2982
|
}
|
|
2867
|
-
function
|
|
2983
|
+
function Qo(e, t, n, r) {
|
|
2868
2984
|
let l = e.priv;
|
|
2869
|
-
|
|
2870
|
-
let
|
|
2871
|
-
Xt(e, "remote_yuno_name",
|
|
2985
|
+
jo(l.gobj_timer);
|
|
2986
|
+
let o = bl(e, n, Co, !0), i = Gr(e, o, "src_yuno", ""), s = Gr(e, o, "src_role", ""), a = Gr(e, o, "src_service", "");
|
|
2987
|
+
Xt(e, "remote_yuno_name", i), Xt(e, "remote_yuno_role", s), Xt(e, "remote_yuno_service", a);
|
|
2872
2988
|
let u = Ur(e, n, "result", -1, 0), _ = Gr(e, n, "comment", "", 0), c = Gr(e, n, "username", "", 0), f = Wr(e, n, "services_roles", {});
|
|
2873
2989
|
if (u < 0) {
|
|
2874
|
-
|
|
2990
|
+
Go(e);
|
|
2875
2991
|
let t = {
|
|
2876
|
-
url:
|
|
2992
|
+
url: Yt(e, "url"),
|
|
2877
2993
|
result: u,
|
|
2878
2994
|
comment: _,
|
|
2879
2995
|
username: c,
|
|
2880
|
-
remote_yuno_name:
|
|
2996
|
+
remote_yuno_name: i,
|
|
2881
2997
|
remote_yuno_role: s,
|
|
2882
2998
|
remote_yuno_service: a
|
|
2883
2999
|
};
|
|
2884
|
-
|
|
3000
|
+
Ot(e) ? cn(yt(e), "EV_ON_ID_NAK", t, e) : Sn(e, "EV_ON_ID_NAK", t);
|
|
2885
3001
|
} else {
|
|
2886
3002
|
if (Zt(e, "ST_SESSION"), l.inside_on_open = !0, l.retry_ms = 0, !l.inform_on_close) {
|
|
2887
3003
|
l.inform_on_close = !0;
|
|
2888
3004
|
let t = {
|
|
2889
3005
|
username: c,
|
|
2890
|
-
remote_yuno_name:
|
|
3006
|
+
remote_yuno_name: i,
|
|
2891
3007
|
remote_yuno_role: s,
|
|
2892
3008
|
remote_yuno_service: a,
|
|
2893
3009
|
services_roles: f
|
|
2894
3010
|
};
|
|
2895
|
-
|
|
3011
|
+
Ot(e) ? cn(yt(e), "EV_ON_OPEN", t, e) : Sn(e, "EV_ON_OPEN", t);
|
|
2896
3012
|
}
|
|
2897
3013
|
l.inside_on_open = !1, function(e) {
|
|
2898
3014
|
let t = yn(e, null, null, null);
|
|
2899
|
-
for (let n = 0; n < t.length; n++)
|
|
3015
|
+
for (let n = 0; n < t.length; n++) Yo(e, t[n]);
|
|
2900
3016
|
}(e);
|
|
2901
3017
|
}
|
|
2902
3018
|
return 0;
|
|
2903
3019
|
}
|
|
2904
|
-
function
|
|
2905
|
-
let l = e.priv.url,
|
|
3020
|
+
function zo(e, t, n, r) {
|
|
3021
|
+
let l = e.priv.url, o = function(e, t) {
|
|
2906
3022
|
let n;
|
|
2907
3023
|
try {
|
|
2908
3024
|
n = JSON.parse(t);
|
|
2909
3025
|
} catch (e) {
|
|
2910
|
-
return
|
|
3026
|
+
return xn("parsing inter_event json: " + e), null;
|
|
2911
3027
|
}
|
|
2912
|
-
if (!(n instanceof Object)) return
|
|
3028
|
+
if (!(n instanceof Object)) return xn("parsing inter_event: websocket data not a json object"), null;
|
|
2913
3029
|
let r = n.event;
|
|
2914
|
-
if (!r) return
|
|
2915
|
-
if ("string" != typeof r) return
|
|
3030
|
+
if (!r) return xn("parsing inter_event: no event"), null;
|
|
3031
|
+
if ("string" != typeof r) return xn("parsing inter_event: event not a string"), null;
|
|
2916
3032
|
let l = n.kw;
|
|
2917
3033
|
return l ? l instanceof Object ? {
|
|
2918
3034
|
event: r,
|
|
2919
3035
|
kw: l || {}
|
|
2920
|
-
} : (
|
|
3036
|
+
} : (xn("parsing inter_event: kw not a json object"), null) : (xn("parsing inter_kw: no kw"), null);
|
|
2921
3037
|
}(0, n.data);
|
|
2922
3038
|
if (Kt(gt(), "trace_inter_event")) {
|
|
2923
|
-
let e =
|
|
2924
|
-
r ? r(e,
|
|
3039
|
+
let e = mt(gt()) + " <== " + l, t = n.data.length, r = Mt(gt(), "trace_ievent_callback");
|
|
3040
|
+
r ? r(e, o, 2, t) : Vo(0, e, o);
|
|
2925
3041
|
}
|
|
2926
|
-
let
|
|
3042
|
+
let i = o.event, s = o.kw;
|
|
2927
3043
|
if ("ST_SESSION" !== en(e)) {
|
|
2928
|
-
if (rn(e,
|
|
2929
|
-
if (!(cn(e,
|
|
2930
|
-
} else
|
|
2931
|
-
return
|
|
2932
|
-
}
|
|
2933
|
-
|
|
2934
|
-
let a =
|
|
2935
|
-
if (_.toLowerCase() !== bt().toLowerCase()) return
|
|
3044
|
+
if (rn(e, i, U.EVF_PUBLIC_EVENT)) {
|
|
3045
|
+
if (!(cn(e, i, s, e) < 0)) return 0;
|
|
3046
|
+
} else xn(`${Tt(e)}: event UNKNOWN in not-session state ${i}`);
|
|
3047
|
+
return Go(e), -1;
|
|
3048
|
+
}
|
|
3049
|
+
o = null;
|
|
3050
|
+
let a = ml(e, s), u = bl(e, s, Co), _ = Gr(e, u, "dst_role", "");
|
|
3051
|
+
if (_.toLowerCase() !== bt().toLowerCase()) return xn(`"It's not my role, dst_role: ${_}, my_role: ${bt()}`), 0;
|
|
2936
3052
|
let c = Gr(e, u, "dst_service", "");
|
|
2937
3053
|
if ("__subscribing__" === a) return -1;
|
|
2938
3054
|
if ("__unsubscribing__" === a) return -1;
|
|
2939
|
-
if (rn(e,
|
|
2940
|
-
|
|
2941
|
-
|
|
2942
|
-
|
|
2943
|
-
|
|
2944
|
-
|
|
2945
|
-
return 0;
|
|
3055
|
+
if (rn(e, i, U.EVF_PUBLIC_EVENT)) return cn(e, i, s, e), 0;
|
|
3056
|
+
if (!Or(c)) {
|
|
3057
|
+
let t = Ce(c, !1);
|
|
3058
|
+
return t ? rn(t, i, U.EVF_PUBLIC_EVENT) ? (cn(t, i, s, e), 0) : (xn(`${Tt(e)}: Service found but no event or not public, service '${Tt(t)}', ev '${i}'`), -1) : (Yn(`${Tt(e)}: event for a service that is gone, DROPPED: service '${c}', ev '${i}'`), 0);
|
|
3059
|
+
}
|
|
3060
|
+
return Ot(e) ? cn(yt(e), i, s, e) : Sn(e, i, s), 0;
|
|
2946
3061
|
}
|
|
2947
|
-
function
|
|
3062
|
+
function Xo(e, t, n, r) {
|
|
2948
3063
|
return 0;
|
|
2949
3064
|
}
|
|
2950
|
-
function
|
|
3065
|
+
function Zo(e, t, n, r) {
|
|
2951
3066
|
return 0;
|
|
2952
3067
|
}
|
|
2953
|
-
var
|
|
3068
|
+
var ei = {
|
|
2954
3069
|
mt_create: function(e) {
|
|
2955
3070
|
let t = e.priv;
|
|
2956
|
-
t.gobj_timer = He(
|
|
3071
|
+
t.gobj_timer = He(mt(e), "C_TIMER", {}, e), t.url = Yt(e, "url"), t.remote_yuno_name = Yt(e, "remote_yuno_name"), t.remote_yuno_role = Yt(e, "remote_yuno_role"), t.remote_yuno_service = Yt(e, "remote_yuno_service"), Xt(e, "wanted_yuno_name", t.remote_yuno_name), Xt(e, "wanted_yuno_role", t.remote_yuno_role), Xt(e, "wanted_yuno_service", t.remote_yuno_service);
|
|
2957
3072
|
const n = Bt(e, "subscriber");
|
|
2958
3073
|
n && En(e, null, {}, n);
|
|
2959
3074
|
},
|
|
@@ -2961,85 +3076,85 @@ var Ki = {
|
|
|
2961
3076
|
let n = e.priv;
|
|
2962
3077
|
switch (t) {
|
|
2963
3078
|
case "url":
|
|
2964
|
-
n.url =
|
|
3079
|
+
n.url = Yt(e, "url");
|
|
2965
3080
|
break;
|
|
2966
3081
|
case "remote_yuno_name":
|
|
2967
|
-
n.remote_yuno_name =
|
|
3082
|
+
n.remote_yuno_name = Yt(e, "remote_yuno_name");
|
|
2968
3083
|
break;
|
|
2969
3084
|
case "remote_yuno_role":
|
|
2970
|
-
n.remote_yuno_role =
|
|
3085
|
+
n.remote_yuno_role = Yt(e, "remote_yuno_role");
|
|
2971
3086
|
break;
|
|
2972
|
-
case "remote_yuno_service": n.remote_yuno_service =
|
|
3087
|
+
case "remote_yuno_service": n.remote_yuno_service = Yt(e, "remote_yuno_service");
|
|
2973
3088
|
}
|
|
2974
3089
|
},
|
|
2975
3090
|
mt_start: function(e) {
|
|
2976
3091
|
let t = e.priv;
|
|
2977
|
-
return t.retry_ms = 0, t.websocket =
|
|
3092
|
+
return t.retry_ms = 0, t.websocket = Fo(e), 0;
|
|
2978
3093
|
},
|
|
2979
3094
|
mt_stop: function(e) {
|
|
2980
3095
|
let t = e.priv;
|
|
2981
|
-
return
|
|
3096
|
+
return jo(t.gobj_timer), t.websocket && Go(e), 0;
|
|
2982
3097
|
},
|
|
2983
3098
|
mt_destroy: function(e) {},
|
|
2984
3099
|
mt_stats: function(e, t, n, r) {
|
|
2985
|
-
if ("ST_SESSION" !== en(e)) return
|
|
3100
|
+
if ("ST_SESSION" !== en(e)) return xn("Not in session"), null;
|
|
2986
3101
|
n || (n = {});
|
|
2987
|
-
let l =
|
|
2988
|
-
return
|
|
3102
|
+
let l = Ko(e, mt(r), Gr(e, n, "service", null, 0)), o = Wr(e, n, "__md_stats__", null, jn.KW_EXTRACT);
|
|
3103
|
+
return o || (o = {}), dl(e, n, "stats_stack", {
|
|
2989
3104
|
stats: t,
|
|
2990
|
-
kw:
|
|
2991
|
-
}), dl(e, n,
|
|
3105
|
+
kw: o
|
|
3106
|
+
}), dl(e, n, Co, l), n.__stats__ = t, pl(e, n, "__stats__"), Wo(e, "EV_MT_STATS", n, r), null;
|
|
2992
3107
|
},
|
|
2993
3108
|
mt_command_parser: function(e, t, n, r) {
|
|
2994
|
-
if ("ST_SESSION" !== en(e)) return
|
|
3109
|
+
if ("ST_SESSION" !== en(e)) return xn("Not in session"), null;
|
|
2995
3110
|
n || (n = {});
|
|
2996
|
-
let l =
|
|
2997
|
-
return
|
|
3111
|
+
let l = Ko(e, mt(r), Gr(e, n, "service", "", 0)), o = Wr(e, n, "__md_command__", null, jn.KW_EXTRACT);
|
|
3112
|
+
return o || (o = {}), dl(e, n, "command_stack", {
|
|
2998
3113
|
command: t,
|
|
2999
|
-
kw:
|
|
3000
|
-
}), dl(e, n,
|
|
3114
|
+
kw: o
|
|
3115
|
+
}), dl(e, n, Co, l), n.__command__ = t, pl(e, n, "__command__"), Wo(e, "EV_MT_COMMAND", n, r), null;
|
|
3001
3116
|
},
|
|
3002
3117
|
mt_inject_event: function(e, t, n, r) {
|
|
3003
3118
|
if ("ST_SESSION" !== en(e)) return window.console.error("Not in session"), -1;
|
|
3004
|
-
if (n || (n = {}), bl(e, n,
|
|
3119
|
+
if (n || (n = {}), bl(e, n, Co));
|
|
3005
3120
|
else {
|
|
3006
|
-
let l =
|
|
3007
|
-
rr(n, "__service__"), dl(e, n, "__message__", t), dl(e, n,
|
|
3121
|
+
let l = Ko(e, mt(r), Gr(e, n, "__service__", 0, 0));
|
|
3122
|
+
rr(n, "__service__"), dl(e, n, "__message__", t), dl(e, n, Co, l);
|
|
3008
3123
|
}
|
|
3009
|
-
return
|
|
3124
|
+
return pl(e, n, "__message__"), Wo(e, t, n, r);
|
|
3010
3125
|
},
|
|
3011
3126
|
mt_subscription_added: function(e, t) {
|
|
3012
3127
|
let n = e.priv;
|
|
3013
|
-
return "ST_SESSION" === en(e) && n.websocket ? n.inside_on_open ? 0 :
|
|
3128
|
+
return "ST_SESSION" === en(e) && n.websocket ? n.inside_on_open ? 0 : Yo(e, t) : 0;
|
|
3014
3129
|
},
|
|
3015
3130
|
mt_subscription_deleted: function(e, t) {
|
|
3016
3131
|
let n = e.priv;
|
|
3017
3132
|
if ("ST_SESSION" !== en(e) || !n.websocket) return 0;
|
|
3018
3133
|
if (n.inside_on_open) return 0;
|
|
3019
|
-
if (
|
|
3020
|
-
let r = {}, l = t.__global__,
|
|
3021
|
-
|
|
3022
|
-
return dl(e, r,
|
|
3134
|
+
if (Or(t.event)) return 0;
|
|
3135
|
+
let r = {}, l = t.__global__, o = t.__config__, i = t.__filter__, s = t.__service__, a = t.subscriber;
|
|
3136
|
+
o && (r.__config__ = o), l && (r.__global__ = l), i && (r.__filter__ = i);
|
|
3137
|
+
return dl(e, r, Co, Ko(e, mt(a), s)), pl(e, r, "__unsubscribing__"), Wo(e, t.event, r, e);
|
|
3023
3138
|
}
|
|
3024
3139
|
};
|
|
3025
|
-
function
|
|
3140
|
+
function ti() {
|
|
3026
3141
|
return function(e) {
|
|
3027
|
-
if (
|
|
3142
|
+
if (Uo) return xn(`GClass ALREADY created: ${e}`), -1;
|
|
3028
3143
|
const t = [
|
|
3029
3144
|
["ST_DISCONNECTED", [
|
|
3030
3145
|
[
|
|
3031
3146
|
"EV_ON_OPEN",
|
|
3032
|
-
|
|
3147
|
+
Jo,
|
|
3033
3148
|
"ST_WAIT_IDENTITY_CARD_ACK"
|
|
3034
3149
|
],
|
|
3035
3150
|
[
|
|
3036
3151
|
"EV_ON_CLOSE",
|
|
3037
|
-
|
|
3152
|
+
qo,
|
|
3038
3153
|
null
|
|
3039
3154
|
],
|
|
3040
3155
|
[
|
|
3041
3156
|
"EV_TIMEOUT",
|
|
3042
|
-
|
|
3157
|
+
Bo,
|
|
3043
3158
|
null
|
|
3044
3159
|
],
|
|
3045
3160
|
[
|
|
@@ -3051,22 +3166,22 @@ function Yi() {
|
|
|
3051
3166
|
["ST_WAIT_IDENTITY_CARD_ACK", [
|
|
3052
3167
|
[
|
|
3053
3168
|
"EV_ON_MESSAGE",
|
|
3054
|
-
|
|
3169
|
+
zo,
|
|
3055
3170
|
null
|
|
3056
3171
|
],
|
|
3057
3172
|
[
|
|
3058
3173
|
"EV_IDENTITY_CARD_ACK",
|
|
3059
|
-
|
|
3174
|
+
Qo,
|
|
3060
3175
|
null
|
|
3061
3176
|
],
|
|
3062
3177
|
[
|
|
3063
3178
|
"EV_ON_CLOSE",
|
|
3064
|
-
|
|
3179
|
+
qo,
|
|
3065
3180
|
"ST_DISCONNECTED"
|
|
3066
3181
|
],
|
|
3067
3182
|
[
|
|
3068
3183
|
"EV_TIMEOUT",
|
|
3069
|
-
|
|
3184
|
+
Ho,
|
|
3070
3185
|
null
|
|
3071
3186
|
],
|
|
3072
3187
|
[
|
|
@@ -3078,22 +3193,22 @@ function Yi() {
|
|
|
3078
3193
|
["ST_SESSION", [
|
|
3079
3194
|
[
|
|
3080
3195
|
"EV_ON_MESSAGE",
|
|
3081
|
-
|
|
3196
|
+
zo,
|
|
3082
3197
|
null
|
|
3083
3198
|
],
|
|
3084
3199
|
[
|
|
3085
3200
|
"EV_MT_STATS",
|
|
3086
|
-
|
|
3201
|
+
Xo,
|
|
3087
3202
|
null
|
|
3088
3203
|
],
|
|
3089
3204
|
[
|
|
3090
3205
|
"EV_MT_COMMAND",
|
|
3091
|
-
|
|
3206
|
+
Zo,
|
|
3092
3207
|
null
|
|
3093
3208
|
],
|
|
3094
3209
|
[
|
|
3095
3210
|
"EV_ON_CLOSE",
|
|
3096
|
-
|
|
3211
|
+
qo,
|
|
3097
3212
|
"ST_DISCONNECTED"
|
|
3098
3213
|
],
|
|
3099
3214
|
[
|
|
@@ -3104,7 +3219,7 @@ function Yi() {
|
|
|
3104
3219
|
]],
|
|
3105
3220
|
[null, null]
|
|
3106
3221
|
];
|
|
3107
|
-
return (
|
|
3222
|
+
return (Uo = ye(e, [
|
|
3108
3223
|
["EV_ON_MESSAGE", U.EVF_OUTPUT_EVENT],
|
|
3109
3224
|
["EV_IDENTITY_CARD_ACK", U.EVF_PUBLIC_EVENT],
|
|
3110
3225
|
["EV_ON_ID_NAK", U.EVF_PUBLIC_EVENT | U.EVF_OUTPUT_EVENT],
|
|
@@ -3115,9 +3230,9 @@ function Yi() {
|
|
|
3115
3230
|
["EV_ON_OPEN_ERROR", U.EVF_OUTPUT_EVENT | U.EVF_NO_WARN_SUBS],
|
|
3116
3231
|
["EV_TIMEOUT", 0],
|
|
3117
3232
|
[null, 0]
|
|
3118
|
-
], t,
|
|
3233
|
+
], t, ei, 0, Lo, Po, 0, 0, 0, C.gcflag_no_check_output_events)) ? 0 : -1;
|
|
3119
3234
|
}("C_IEVENT_CLI");
|
|
3120
3235
|
}
|
|
3121
|
-
export { k as GObj, N as SDATA,
|
|
3236
|
+
export { k as GObj, N as SDATA, D as SDATAAUTHZ, R as SDATACM, j as SDATACM2, I as SDATADF, w as SDATAPM, A as SDATAPM0, S as SDATA_END, O as SDataDesc, a as YUNETA_VERSION, E as __yuno__, o as build_command_response, Bl as build_path, s as build_stats_response, Kl as clean_name, jo as clear_timeout, wr as cmp_two_simple_json, l as command_parser, Cl as createElement2, kl as createOneHtml, wl as create_json_record, Eo as create_template_record, Gl as current_timestamp, y as data_type_t, so as db_list_persistent_attrs, lo as db_load_persistent_attrs, io as db_remove_persistent_attrs, oo as db_save_persistent_attrs, Yl as debounce, cl as delete_from_list, zn as duplicate_objects, Or as empty_string, Il as escapeHtml, U as event_flag_t, Zl as flat2json, no as flat_apply, to as flat_diff, Ql as flat_key_join, zl as flat_key_split, Re as gclass_add_ev_action, we as gclass_add_event_type, Ne as gclass_add_state, Ae as gclass_check_fsm, ye as gclass_create, De as gclass_event_type, Ie as gclass_find_by_name, C as gclass_flag_t, ve as gclass_unregister, Ll as getPositionRelativeToBody, xl as get_function_name, Vl as get_now, Nt as gobj_bottom_gobj, tn as gobj_change_parent, Zt as gobj_change_state, Nn as gobj_command, Qe as gobj_create, xe as gobj_create2, Je as gobj_create_default_service, He as gobj_create_pure_child, Be as gobj_create_service, qe as gobj_create_volatil, Ye as gobj_create_yuno, en as gobj_current_state, ke as gobj_default_service, _n as gobj_deliver_posted_events, ze as gobj_destroy, Pt as gobj_find_child, Ct as gobj_find_gobj, Ce as gobj_find_service, On as gobj_find_subscribings, yn as gobj_find_subscriptions, L as gobj_flag_t, ht as gobj_full_name, Et as gobj_gclass_name, se as gobj_global_trace_level, Vt as gobj_has_attr, rn as gobj_has_event, ln as gobj_has_output_event, Ee as gobj_hsdata, St as gobj_is_destroying, ft as gobj_is_playing, Ot as gobj_is_pure_child, ut as gobj_is_running, ct as gobj_is_service, vt as gobj_is_volatil, Me as gobj_list_persistent_attrs, vn as gobj_list_subscriptions, Fe as gobj_load_persistent_attrs, Ut as gobj_match_children, Ft as gobj_match_children_tree, Lt as gobj_match_gobj, mt as gobj_name, yt as gobj_parent, at as gobj_pause, st as gobj_play, an as gobj_post_event, un as gobj_posted_events_size, Sn as gobj_publish_event, Mt as gobj_read_attr, Wt as gobj_read_attrs, Kt as gobj_read_bool_attr, xt as gobj_read_integer_attr, Bt as gobj_read_pointer_attr, Yt as gobj_read_str_attr, Ve as gobj_remove_persistent_attrs, ge as gobj_repr_global_trace_levels, qt as gobj_reset_volatil_attrs, Ge as gobj_save_persistent_attrs, Gt as gobj_search_path, cn as gobj_send_event, $e as gobj_services, Rt as gobj_set_bottom_gobj, ae as gobj_set_deep_trace, ce as gobj_set_gclass_no_trace, ue as gobj_set_gclass_trace, ie as gobj_set_global_no_trace, oe as gobj_set_global_trace, fe as gobj_set_gobj_no_trace, _e as gobj_set_gobj_trace, K as gobj_set_trace_machine_format, Tt as gobj_short_name, Xe as gobj_start, et as gobj_start_children, nt as gobj_start_tree, de as gobj_start_up, Rn as gobj_stats, rt as gobj_stop, ot as gobj_stop_children, it as gobj_stop_tree, En as gobj_subscribe_event, X as gobj_trace_level, x as gobj_trace_machine_format, Z as gobj_trace_no_level, Tn as gobj_unsubscribe_event, hn as gobj_unsubscribe_list, wt as gobj_walk_gobj_children, Dt as gobj_walk_gobj_children_tree, Jt as gobj_write_attr, Ht as gobj_write_attrs, Qt as gobj_write_bool_attr, zt as gobj_write_integer_attr, Xt as gobj_write_str_attr, gt as gobj_yuno, pt as gobj_yuno_id, dt as gobj_yuno_name, bt as gobj_yuno_role, al as id_index_in_obj_list, Ml as index_in_list, dr as is_array, mr as is_boolean, hr as is_date, yr as is_function, vr as is_gobj, Ar as is_metadata_key, Er as is_null, pr as is_number, gr as is_object, Ir as is_private_key, Tr as is_pure_number, br as is_string, Ol as jdb_delete, Nl as jdb_get, Rl as jdb_get_by_idx, Sl as jdb_get_topic, yl as jdb_init, vl as jdb_update, Xl as json2flat, ir as json_array_append, sr as json_array_append_new, ur as json_array_extend, ar as json_array_remove, cr as json_array_size, Qn as json_deep_copy, Xn as json_is_identical, rr as json_object_del, nr as json_object_get, lr as json_object_set, or as json_object_set_new, _r as json_object_size, Zn as json_object_update, er as json_object_update_existing, tr as json_object_update_missing, fr as json_size, Al as jwt2json, Dl as jwtDecode, zr as kw_clone_by_keys, Xr as kw_clone_by_not_keys, Qr as kw_collect, Lr as kw_delete, qr as kw_find_json_in_list, Cr as kw_find_path, jn as kw_flag_t, Pr as kw_get_bool, Mr as kw_get_dict, Wr as kw_get_dict_value, Ur as kw_get_int, Kr as kw_get_list, Zr as kw_get_local_storage_value, Vr as kw_get_pointer, Fr as kw_get_real, Gr as kw_get_str, kr as kw_has_key, Jr as kw_match_simple, $r as kw_pop, tl as kw_remove_local_storage_value, Hr as kw_select, xr as kw_set_dict_value, el as kw_set_local_storage_value, Yr as kw_set_subdict_value, rl as kwid_collect, ol as kwid_find_one_record, il as kwid_get_ids, nl as kwid_match_id, ll as kwid_new_dict, sl as list2options, El as load_json_file, Jn as log_debug, xn as log_error, Bn as log_info, Yn as log_warning, ml as msg_iev_get_msg_type, bl as msg_iev_get_stack, dl as msg_iev_push_stack, fl as msg_iev_read_key, pl as msg_iev_set_msg_type, gl as msg_iev_write_key, Wl as node_uuid, Sr as parseBoolean, Pl as parseSVG, Ul as refresh_language, ti as register_c_ievent_cli, So as register_c_timer, ko as register_c_yuno, $l as safeSrc, v as sdata_flag_t, Tl as send_http_json_post, Pn as set_console_log_enabled, Fn as set_console_log_filter, Cn as set_log_callback, Wn as set_remote_log_functions, No as set_timeout, Ro as set_timeout_periodic, t as sprintf, i as stats_parser, ul as str_in_list, jr as strcasecmp, Rr as strcmp, Nr as strncmp, _l as strs_in_list, Dr as strstr, mo as template_get_field_desc, Fl as timeTracker, Hn as trace_json, B as trace_level_t, qn as trace_msg, uo as treedb_decoder_fkey, co as treedb_decoder_hook, _o as treedb_encoder_fkey, po as treedb_get_field_desc, ao as treedb_hook_data_size, n as vsprintf, F as walk_type_t };
|
|
3122
3237
|
|
|
3123
3238
|
//# sourceMappingURL=gobj-js.es.min.js.map
|