@yuneta/gobj-js 7.21.0 → 7.22.0
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/README.md +21 -3
- package/dist/gobj-js.cjs.js +239 -47
- package/dist/gobj-js.cjs.js.map +1 -1
- package/dist/gobj-js.cjs.min.js +1379 -1275
- package/dist/gobj-js.cjs.min.js.map +1 -1
- package/dist/gobj-js.es.js +232 -48
- package/dist/gobj-js.es.js.map +1 -1
- package/dist/gobj-js.es.min.js +1222 -1123
- package/dist/gobj-js.es.min.js.map +1 -1
- package/dist/gobj-js.iife.js +239 -47
- package/dist/gobj-js.iife.js.map +1 -1
- package/dist/gobj-js.iife.min.js +1654 -1550
- package/dist/gobj-js.iife.min.js.map +1 -1
- package/dist/gobj-js.umd.js +239 -47
- package/dist/gobj-js.umd.js.map +1 -1
- package/dist/gobj-js.umd.min.js +1648 -1544
- package/dist/gobj-js.umd.min.js.map +1 -1
- package/package.json +1 -1
package/dist/gobj-js.iife.min.js
CHANGED
|
@@ -19,85 +19,85 @@ var gobjJs = function(e) {
|
|
|
19
19
|
};
|
|
20
20
|
function n(e) {
|
|
21
21
|
return function(e, r) {
|
|
22
|
-
var
|
|
23
|
-
for (
|
|
24
|
-
else if ("object" == typeof e[
|
|
25
|
-
if ((
|
|
26
|
-
if (null ==
|
|
27
|
-
|
|
22
|
+
var l, o, s, i, _, a, u, c, f, g = 1, d = e.length, b = "";
|
|
23
|
+
for (o = 0; o < d; o++) if ("string" == typeof e[o]) b += e[o];
|
|
24
|
+
else if ("object" == typeof e[o]) {
|
|
25
|
+
if ((i = e[o]).keys) for (l = r[g], s = 0; s < i.keys.length; s++) {
|
|
26
|
+
if (null == l) throw new Error(n("[sprintf] Cannot access property \"%s\" of undefined value \"%s\"", i.keys[s], i.keys[s - 1]));
|
|
27
|
+
l = l[i.keys[s]];
|
|
28
28
|
}
|
|
29
|
-
else
|
|
30
|
-
if (t.not_type.test(
|
|
31
|
-
switch (t.number.test(
|
|
29
|
+
else l = i.param_no ? r[i.param_no] : r[g++];
|
|
30
|
+
if (t.not_type.test(i.type) && t.not_primitive.test(i.type) && l instanceof Function && (l = l()), t.numeric_arg.test(i.type) && "number" != typeof l && isNaN(l)) throw new TypeError(n("[sprintf] expecting number but found %T", l));
|
|
31
|
+
switch (t.number.test(i.type) && (c = l >= 0), i.type) {
|
|
32
32
|
case "b":
|
|
33
|
-
|
|
33
|
+
l = parseInt(l, 10).toString(2);
|
|
34
34
|
break;
|
|
35
35
|
case "c":
|
|
36
|
-
|
|
36
|
+
l = String.fromCharCode(parseInt(l, 10));
|
|
37
37
|
break;
|
|
38
38
|
case "d":
|
|
39
39
|
case "i":
|
|
40
|
-
|
|
40
|
+
l = parseInt(l, 10);
|
|
41
41
|
break;
|
|
42
42
|
case "j":
|
|
43
|
-
|
|
43
|
+
l = JSON.stringify(l, null, i.width ? parseInt(i.width) : 0);
|
|
44
44
|
break;
|
|
45
45
|
case "e":
|
|
46
|
-
|
|
46
|
+
l = i.precision ? parseFloat(l).toExponential(i.precision) : parseFloat(l).toExponential();
|
|
47
47
|
break;
|
|
48
48
|
case "f":
|
|
49
|
-
|
|
49
|
+
l = i.precision ? parseFloat(l).toFixed(i.precision) : parseFloat(l);
|
|
50
50
|
break;
|
|
51
51
|
case "g":
|
|
52
|
-
|
|
52
|
+
l = i.precision ? String(Number(l.toPrecision(i.precision))) : parseFloat(l);
|
|
53
53
|
break;
|
|
54
54
|
case "o":
|
|
55
|
-
|
|
55
|
+
l = (parseInt(l, 10) >>> 0).toString(8);
|
|
56
56
|
break;
|
|
57
57
|
case "s":
|
|
58
|
-
|
|
58
|
+
l = String(l), l = i.precision ? l.substring(0, i.precision) : l;
|
|
59
59
|
break;
|
|
60
60
|
case "t":
|
|
61
|
-
|
|
61
|
+
l = String(!!l), l = i.precision ? l.substring(0, i.precision) : l;
|
|
62
62
|
break;
|
|
63
63
|
case "T":
|
|
64
|
-
|
|
64
|
+
l = Object.prototype.toString.call(l).slice(8, -1).toLowerCase(), l = i.precision ? l.substring(0, i.precision) : l;
|
|
65
65
|
break;
|
|
66
66
|
case "u":
|
|
67
|
-
|
|
67
|
+
l = parseInt(l, 10) >>> 0;
|
|
68
68
|
break;
|
|
69
69
|
case "v":
|
|
70
|
-
|
|
70
|
+
l = l.valueOf(), l = i.precision ? l.substring(0, i.precision) : l;
|
|
71
71
|
break;
|
|
72
72
|
case "x":
|
|
73
|
-
|
|
73
|
+
l = (parseInt(l, 10) >>> 0).toString(16);
|
|
74
74
|
break;
|
|
75
|
-
case "X":
|
|
75
|
+
case "X": l = (parseInt(l, 10) >>> 0).toString(16).toUpperCase();
|
|
76
76
|
}
|
|
77
|
-
t.json.test(
|
|
77
|
+
t.json.test(i.type) ? b += l : (!t.number.test(i.type) || c && !i.sign ? f = "" : (f = c ? "+" : "-", l = l.toString().replace(t.sign, "")), a = i.pad_char ? "0" === i.pad_char ? "0" : i.pad_char.charAt(1) : " ", u = i.width - (f + l).length, _ = i.width && u > 0 ? a.repeat(u) : "", b += i.align ? f + l + _ : "0" === a ? f + _ + l : _ + f + l);
|
|
78
78
|
}
|
|
79
79
|
return b;
|
|
80
80
|
}(function(e) {
|
|
81
81
|
if (r[e]) return r[e];
|
|
82
|
-
let n,
|
|
83
|
-
for (;
|
|
84
|
-
if (null !== (n = t.text.exec(
|
|
85
|
-
else if (null !== (n = t.modulo.exec(
|
|
82
|
+
let n, l = e, o = [], s = 0;
|
|
83
|
+
for (; l;) {
|
|
84
|
+
if (null !== (n = t.text.exec(l))) o.push(n[0]);
|
|
85
|
+
else if (null !== (n = t.modulo.exec(l))) o.push("%");
|
|
86
86
|
else {
|
|
87
|
-
if (null === (n = t.placeholder.exec(
|
|
87
|
+
if (null === (n = t.placeholder.exec(l))) throw new SyntaxError("[sprintf] unexpected placeholder");
|
|
88
88
|
if (n[2]) {
|
|
89
|
-
|
|
90
|
-
var
|
|
89
|
+
s |= 1;
|
|
90
|
+
var i = [], _ = n[2], a = [];
|
|
91
91
|
if (null === (a = t.key.exec(_))) throw new SyntaxError("[sprintf] failed to parse named argument key");
|
|
92
|
-
for (
|
|
92
|
+
for (i.push(a[1]); "" !== (_ = _.substring(a[0].length));) if (null !== (a = t.key_access.exec(_))) i.push(a[1]);
|
|
93
93
|
else {
|
|
94
94
|
if (null === (a = t.index_access.exec(_))) throw new SyntaxError("[sprintf] failed to parse named argument key");
|
|
95
|
-
|
|
95
|
+
i.push(a[1]);
|
|
96
96
|
}
|
|
97
|
-
n[2] =
|
|
98
|
-
} else
|
|
99
|
-
if (3 ===
|
|
100
|
-
|
|
97
|
+
n[2] = i;
|
|
98
|
+
} else s |= 2;
|
|
99
|
+
if (3 === s) throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");
|
|
100
|
+
o.push({
|
|
101
101
|
placeholder: n[0],
|
|
102
102
|
param_no: n[1],
|
|
103
103
|
keys: n[2],
|
|
@@ -109,29 +109,29 @@ var gobjJs = function(e) {
|
|
|
109
109
|
type: n[8]
|
|
110
110
|
});
|
|
111
111
|
}
|
|
112
|
-
|
|
112
|
+
l = l.substring(n[0].length);
|
|
113
113
|
}
|
|
114
|
-
return r[e] =
|
|
114
|
+
return r[e] = o;
|
|
115
115
|
}(e), arguments);
|
|
116
116
|
}
|
|
117
117
|
var r = Object.create(null);
|
|
118
|
-
function
|
|
118
|
+
function l(e, t, n, r, l) {
|
|
119
119
|
return {
|
|
120
120
|
result: t,
|
|
121
121
|
comment: n || {},
|
|
122
122
|
schema: r || {},
|
|
123
|
-
data:
|
|
123
|
+
data: l || []
|
|
124
124
|
};
|
|
125
125
|
}
|
|
126
|
-
function
|
|
126
|
+
function o(e, t, n, r, l) {
|
|
127
127
|
return {
|
|
128
128
|
result: t,
|
|
129
129
|
comment: n || {},
|
|
130
130
|
schema: r || {},
|
|
131
|
-
data:
|
|
131
|
+
data: l || []
|
|
132
132
|
};
|
|
133
133
|
}
|
|
134
|
-
var
|
|
134
|
+
var s = "7.0.0a", i = null, _ = null, a = null, u = null, c = null, f = null, g = [], d = Object.create(null), b = {}, p = null, m = null, E = 0, h = Object.freeze({
|
|
135
135
|
DTP_STRING: 1,
|
|
136
136
|
DTP_BOOLEAN: 2,
|
|
137
137
|
DTP_INTEGER: 3,
|
|
@@ -141,8 +141,8 @@ var gobjJs = function(e) {
|
|
|
141
141
|
DTP_JSON: 7,
|
|
142
142
|
DTP_POINTER: 8
|
|
143
143
|
});
|
|
144
|
-
|
|
145
|
-
var
|
|
144
|
+
h.DTP_POINTER;
|
|
145
|
+
var T = Object.freeze({
|
|
146
146
|
SDF_NOTACCESS: 1,
|
|
147
147
|
SDF_RD: 2,
|
|
148
148
|
SDF_WR: 4,
|
|
@@ -165,26 +165,26 @@ var gobjJs = function(e) {
|
|
|
165
165
|
SDF_AUTHZ_S: 524288,
|
|
166
166
|
SDF_AUTHZ_RS: 1048576
|
|
167
167
|
});
|
|
168
|
-
|
|
168
|
+
T.SDF_RD, T.SDF_WR, T.SDF_STATS, T.SDF_PERSIST, T.SDF_VOLATIL, T.SDF_RSTATS, T.SDF_PSTATS, T.SDF_WR, T.SDF_PERSIST;
|
|
169
169
|
var y = class {
|
|
170
|
-
constructor(e, t, n = 0, r = null,
|
|
171
|
-
this.type = e, this.name = t, this.alias =
|
|
170
|
+
constructor(e, t, n = 0, r = null, l = "", o = null, s = null, i = 0, _ = null, a = null, u = null) {
|
|
171
|
+
this.type = e, this.name = t, this.alias = o, this.flag = n, this.default_value = r, this.header = s, this.fillspace = i, this.description = l, this.json_fn = _, this.schema = a, this.authpth = u;
|
|
172
172
|
}
|
|
173
|
-
},
|
|
174
|
-
constructor(e, t, n, r,
|
|
175
|
-
this.gclass_name = e, this.dl_states = [], this.dl_events = [], this.gmt = t, this.lmt = n, this.attrs_table = r, this.priv =
|
|
173
|
+
}, v = () => new y(0, null), j = (e, t, n, r, l) => new y(e, t, n, r, l), S = class {
|
|
174
|
+
constructor(e, t, n, r, l, o, s, i, _) {
|
|
175
|
+
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 = s, this.s_user_trace_level = i, this.gclass_flag = Number(_) || 0, this.instances = 0, this.trace_level = 0, this.no_trace_level = 0, this.jn_trace_filter = null, this.fsm_checked = !1;
|
|
176
176
|
}
|
|
177
|
-
},
|
|
178
|
-
constructor(e, t, n, r,
|
|
179
|
-
this.__refs__ = 0, this.gclass = t, this.parent = null, this.dl_children = [], this.dl_subscriptions = [], this.dl_subscribings = [], this.current_state = t.dl_states[0], this.last_state = null, this.obflag = 0, this.gobj_flag = Number(
|
|
177
|
+
}, O = class {
|
|
178
|
+
constructor(e, t, n, r, l) {
|
|
179
|
+
this.__refs__ = 0, this.gclass = t, this.parent = null, this.dl_children = [], this.dl_subscriptions = [], this.dl_subscribings = [], this.current_state = t.dl_states[0], this.last_state = null, this.obflag = 0, this.gobj_flag = Number(l) || 0, this.gobj_name = e, this.jn_attrs = null, this.jn_stats = {}, this.jn_user_data = {}, this.full_name = null, this.short_name = null, this.priv = pn(t.priv), this.running = !1, this.playing = !1, this.disabled = !1, this.bottom_gobj = null, this.trace_level = 0, this.no_trace_level = 0;
|
|
180
180
|
}
|
|
181
|
-
},
|
|
181
|
+
}, w = Object.freeze({
|
|
182
182
|
gcflag_manual_start: 1,
|
|
183
183
|
gcflag_no_check_output_events: 2,
|
|
184
184
|
gcflag_ignore_unknown_attrs: 4,
|
|
185
185
|
gcflag_required_start_to_play: 8,
|
|
186
186
|
gcflag_singleton: 16
|
|
187
|
-
}),
|
|
187
|
+
}), N = Object.freeze({
|
|
188
188
|
gobj_flag_yuno: 1,
|
|
189
189
|
gobj_flag_default_service: 2,
|
|
190
190
|
gobj_flag_service: 4,
|
|
@@ -211,20 +211,20 @@ var gobjJs = function(e) {
|
|
|
211
211
|
constructor(e, t, n) {
|
|
212
212
|
this.event_name = e, this.action = t, this.next_state = n;
|
|
213
213
|
}
|
|
214
|
-
},
|
|
214
|
+
}, $ = class {
|
|
215
215
|
constructor(e) {
|
|
216
216
|
this.state_name = e, this.dl_actions = [];
|
|
217
217
|
}
|
|
218
|
-
},
|
|
218
|
+
}, I = class {
|
|
219
219
|
constructor(e, t) {
|
|
220
220
|
this.event_name = e, this.event_flag = Number(t) || 0;
|
|
221
221
|
}
|
|
222
222
|
};
|
|
223
223
|
var C = 1;
|
|
224
|
-
function
|
|
225
|
-
|
|
224
|
+
function P(e) {
|
|
225
|
+
kn(e) && (e = JSON.stringify(e)), gn(" ".repeat(Math.max(1, 2 * E)) + String(e));
|
|
226
226
|
}
|
|
227
|
-
var
|
|
227
|
+
var L = Object.freeze({
|
|
228
228
|
TRACE_MACHINE: 65536,
|
|
229
229
|
TRACE_CREATE_DELETE: 131072,
|
|
230
230
|
TRACE_CREATE_DELETE2: 262144,
|
|
@@ -243,290 +243,340 @@ var gobjJs = function(e) {
|
|
|
243
243
|
}), U = [
|
|
244
244
|
[
|
|
245
245
|
"machine",
|
|
246
|
-
|
|
246
|
+
L.TRACE_MACHINE,
|
|
247
247
|
"Trace machine"
|
|
248
248
|
],
|
|
249
249
|
[
|
|
250
250
|
"create_delete",
|
|
251
|
-
|
|
251
|
+
L.TRACE_CREATE_DELETE,
|
|
252
252
|
"Trace create/delete of gobjs"
|
|
253
253
|
],
|
|
254
254
|
[
|
|
255
255
|
"create_delete2",
|
|
256
|
-
|
|
256
|
+
L.TRACE_CREATE_DELETE2,
|
|
257
257
|
"Trace create/delete of gobjs level 2: with kw"
|
|
258
258
|
],
|
|
259
259
|
[
|
|
260
260
|
"subscriptions",
|
|
261
|
-
|
|
261
|
+
L.TRACE_SUBSCRIPTIONS,
|
|
262
262
|
"Trace subscriptions of gobjs"
|
|
263
263
|
],
|
|
264
264
|
[
|
|
265
265
|
"start_stop",
|
|
266
|
-
|
|
266
|
+
L.TRACE_START_STOP,
|
|
267
267
|
"Trace start/stop of gobjs"
|
|
268
268
|
],
|
|
269
269
|
[
|
|
270
270
|
"ev_kw",
|
|
271
|
-
|
|
271
|
+
L.TRACE_EV_KW,
|
|
272
272
|
"Trace event keywords"
|
|
273
273
|
],
|
|
274
274
|
[
|
|
275
275
|
"authzs",
|
|
276
|
-
|
|
276
|
+
L.TRACE_AUTHZS,
|
|
277
277
|
"Trace authorizations"
|
|
278
278
|
],
|
|
279
279
|
[
|
|
280
280
|
"states",
|
|
281
|
-
|
|
281
|
+
L.TRACE_STATES,
|
|
282
282
|
"Trace change of states"
|
|
283
283
|
],
|
|
284
284
|
[
|
|
285
285
|
"gbuffers",
|
|
286
|
-
|
|
286
|
+
L.TRACE_GBUFFERS,
|
|
287
287
|
"Trace gbuffers"
|
|
288
288
|
],
|
|
289
289
|
[
|
|
290
290
|
"timer",
|
|
291
|
-
|
|
291
|
+
L.TRACE_TIMER,
|
|
292
292
|
"Trace timers"
|
|
293
293
|
],
|
|
294
294
|
[
|
|
295
295
|
"fs",
|
|
296
|
-
|
|
296
|
+
L.TRACE_FS,
|
|
297
297
|
"Trace file system"
|
|
298
298
|
],
|
|
299
299
|
[
|
|
300
300
|
"liburing",
|
|
301
|
-
|
|
301
|
+
L.TRACE_URING,
|
|
302
302
|
"Trace liburing mixins"
|
|
303
303
|
],
|
|
304
304
|
[
|
|
305
305
|
"timer_periodic",
|
|
306
|
-
|
|
306
|
+
L.TRACE_TIMER_PERIODIC,
|
|
307
307
|
"Trace periodic timers"
|
|
308
308
|
],
|
|
309
309
|
[
|
|
310
310
|
"liburing_timer",
|
|
311
|
-
|
|
311
|
+
L.TRACE_URING_TIME,
|
|
312
312
|
"Trace liburing timer"
|
|
313
313
|
],
|
|
314
314
|
[
|
|
315
315
|
"commands",
|
|
316
|
-
|
|
316
|
+
L.TRACE_COMMANDS,
|
|
317
317
|
"Trace commands"
|
|
318
318
|
]
|
|
319
319
|
], F = 0, G = 0, V = 0;
|
|
320
320
|
function M(e, t) {
|
|
321
|
-
|
|
321
|
+
let n = [];
|
|
322
|
+
for (const [t, r] of U) e & r && n.push(t);
|
|
323
|
+
if (Array.isArray(t)) for (let r = 0; r < t.length && r < 16; r++) t[r] && e & 1 << r && n.push(t[r][0]);
|
|
324
|
+
return n;
|
|
325
|
+
}
|
|
326
|
+
function W(e, t, n) {
|
|
327
|
+
if (Gn(e)) return void 0 === n ? 268369920 : 65535;
|
|
322
328
|
if (/^[0-9]+$/.test(String(e))) {
|
|
323
329
|
const t = Number(e);
|
|
324
330
|
if (t) return t;
|
|
325
331
|
}
|
|
326
|
-
return function(e) {
|
|
332
|
+
return function(e, t) {
|
|
327
333
|
for (const [t, n] of U) if (t === e) return n;
|
|
334
|
+
if (Array.isArray(t)) {
|
|
335
|
+
for (let n = 0; n < t.length && n < 16; n++) if (t[n] && t[n][0] === e) return 1 << n;
|
|
336
|
+
}
|
|
328
337
|
return 0;
|
|
329
|
-
}(String(e)) || (
|
|
338
|
+
}(String(e), n) || (cn(`${t}: trace level NOT FOUND: ${e}`), 0);
|
|
330
339
|
}
|
|
331
|
-
function
|
|
340
|
+
function K(e) {
|
|
332
341
|
if (V) return 4294967295;
|
|
333
342
|
let t = F;
|
|
334
343
|
return e && (t |= e.trace_level || 0, e.gclass && (t |= e.gclass.trace_level || 0)), t;
|
|
335
344
|
}
|
|
336
|
-
function
|
|
345
|
+
function x(e) {
|
|
337
346
|
let t = G;
|
|
338
347
|
return e && (t |= e.no_trace_level || 0, e.gclass && (t |= e.gclass.no_trace_level || 0)), t;
|
|
339
348
|
}
|
|
340
|
-
function x() {
|
|
341
|
-
if (!p || !p.jn_attrs) return 0;
|
|
342
|
-
let e = 0;
|
|
343
|
-
if (ot(p, "tracing")) {
|
|
344
|
-
const t = Number(it(p, "tracing")) || 0;
|
|
345
|
-
t >= 1 && (e |= P.TRACE_MACHINE), t >= 2 && (e |= P.TRACE_EV_KW);
|
|
346
|
-
}
|
|
347
|
-
return ot(p, "trace_timer") && it(p, "trace_timer") && (e |= P.TRACE_TIMER), ot(p, "trace_creation") && it(p, "trace_creation") && (e |= P.TRACE_CREATE_DELETE), ot(p, "trace_start_stop") && it(p, "trace_start_stop") && (e |= P.TRACE_START_STOP), e;
|
|
348
|
-
}
|
|
349
349
|
function Y(e) {
|
|
350
|
-
return (
|
|
350
|
+
return K(e) & L.TRACE_CREATE_DELETE;
|
|
351
351
|
}
|
|
352
352
|
function B(e) {
|
|
353
|
-
return (
|
|
353
|
+
return K(e) & L.TRACE_SUBSCRIPTIONS;
|
|
354
|
+
}
|
|
355
|
+
function J(e) {
|
|
356
|
+
return K(e) & L.TRACE_START_STOP;
|
|
354
357
|
}
|
|
355
|
-
function
|
|
358
|
+
function H(e) {
|
|
359
|
+
return K(e) & L.TRACE_EV_KW;
|
|
360
|
+
}
|
|
361
|
+
function q(e, t) {
|
|
356
362
|
if (V > 1) return !0;
|
|
357
363
|
if (!e) return !1;
|
|
358
|
-
const n =
|
|
359
|
-
return !!(n &
|
|
364
|
+
const n = K(e);
|
|
365
|
+
return !!(n & L.TRACE_MACHINE || n & L.TRACE_TIMER_PERIODIC && "EV_TIMEOUT_PERIODIC" === t || n & L.TRACE_TIMER && "EV_TIMEOUT" === t);
|
|
360
366
|
}
|
|
361
|
-
function
|
|
367
|
+
function z(e, t) {
|
|
362
368
|
if (V > 1) return !1;
|
|
363
369
|
if (!e) return !0;
|
|
364
|
-
const n =
|
|
365
|
-
return !!(n &
|
|
370
|
+
const n = x(e);
|
|
371
|
+
return !!(n & L.TRACE_MACHINE || n & L.TRACE_TIMER_PERIODIC && "EV_TIMEOUT_PERIODIC" === t || n & L.TRACE_TIMER && "EV_TIMEOUT" === t);
|
|
366
372
|
}
|
|
367
|
-
function
|
|
373
|
+
function Q(e, t) {
|
|
374
|
+
const n = W(e, "gobj_set_global_trace");
|
|
375
|
+
return n ? (t ? F |= n : F &= ~n, 0) : -1;
|
|
376
|
+
}
|
|
377
|
+
function X(e, t) {
|
|
378
|
+
const n = W(e, "gobj_set_global_no_trace");
|
|
379
|
+
return n ? (t ? G |= n : G &= ~n, 0) : -1;
|
|
380
|
+
}
|
|
381
|
+
function Z(e, t) {
|
|
382
|
+
return F = t ? (F | e) >>> 0 : (F & ~e) >>> 0, 0;
|
|
383
|
+
}
|
|
384
|
+
function ee(e, t) {
|
|
385
|
+
return G = t ? (G | e) >>> 0 : (G & ~e) >>> 0, 0;
|
|
386
|
+
}
|
|
387
|
+
function te() {
|
|
388
|
+
return M(F, null);
|
|
389
|
+
}
|
|
390
|
+
function ne() {
|
|
391
|
+
return M(G, null);
|
|
392
|
+
}
|
|
393
|
+
function re(e) {
|
|
394
|
+
const t = In(e) ? Se(e) : e;
|
|
395
|
+
return t ? M(t.trace_level | F, t.s_user_trace_level) : (cn(`gobj_get_gclass_trace_level: gclass NOT FOUND: ${e}`), []);
|
|
396
|
+
}
|
|
397
|
+
function le(e) {
|
|
398
|
+
const t = In(e) ? Se(e) : e;
|
|
399
|
+
return t ? M(t.trace_level, t.s_user_trace_level) : (cn(`gobj_get_gclass_trace_level2: gclass NOT FOUND: ${e}`), []);
|
|
400
|
+
}
|
|
401
|
+
function oe(e) {
|
|
402
|
+
const t = In(e) ? Se(e) : e;
|
|
403
|
+
return t ? M(t.no_trace_level, t.s_user_trace_level) : (cn(`gobj_get_gclass_trace_no_level: gclass NOT FOUND: ${e}`), []);
|
|
404
|
+
}
|
|
405
|
+
function se(e, t, n) {
|
|
406
|
+
const r = In(e) ? Se(e) : e;
|
|
407
|
+
if (!r) return cn(`gobj_set_gclass_trace: gclass NOT FOUND: ${e}`), -1;
|
|
408
|
+
const l = null === t ? 4294967295 : W(t, "gobj_set_gclass_trace", r.s_user_trace_level || null);
|
|
409
|
+
return l ? (n ? r.trace_level |= l : r.trace_level &= ~l, 0) : -1;
|
|
410
|
+
}
|
|
411
|
+
function ie(e, t, n) {
|
|
412
|
+
const r = In(e) ? Se(e) : e;
|
|
413
|
+
if (!r) return cn(`gobj_set_gclass_no_trace: gclass NOT FOUND: ${e}`), -1;
|
|
414
|
+
const l = null === t ? 4294967295 : W(t, "gobj_set_gclass_no_trace", r.s_user_trace_level || null);
|
|
415
|
+
return l ? (n ? r.no_trace_level |= l : r.no_trace_level &= ~l, 0) : -1;
|
|
416
|
+
}
|
|
417
|
+
function _e(e, t) {
|
|
368
418
|
let n = {};
|
|
369
|
-
if (
|
|
419
|
+
if (!$n(t)) return cn("sdata_desc MUST be an array"), bn(t), n;
|
|
370
420
|
for (let r = 0; r < t.length; r++) {
|
|
371
|
-
const
|
|
372
|
-
|
|
421
|
+
const l = t[r];
|
|
422
|
+
l.name && ae(e, n, l);
|
|
373
423
|
}
|
|
374
424
|
return n;
|
|
375
425
|
}
|
|
376
|
-
function
|
|
377
|
-
let r,
|
|
426
|
+
function ae(e, t, n) {
|
|
427
|
+
let r, l = n.default_value;
|
|
378
428
|
switch (n.type) {
|
|
379
|
-
case
|
|
380
|
-
r = String(
|
|
429
|
+
case h.DTP_STRING:
|
|
430
|
+
r = String(l);
|
|
381
431
|
break;
|
|
382
|
-
case
|
|
383
|
-
r =
|
|
432
|
+
case h.DTP_BOOLEAN:
|
|
433
|
+
r = Vn(l);
|
|
384
434
|
break;
|
|
385
|
-
case
|
|
386
|
-
r = parseInt(
|
|
435
|
+
case h.DTP_INTEGER:
|
|
436
|
+
r = parseInt(l), isNaN(r) && cn(`${et(e)}: attr NaN: ${n.name}`);
|
|
387
437
|
break;
|
|
388
|
-
case
|
|
389
|
-
r = Number(
|
|
438
|
+
case h.DTP_REAL:
|
|
439
|
+
r = Number(l), isNaN(r) && cn(`${et(e)}: attr NaN: ${n.name}`);
|
|
390
440
|
break;
|
|
391
|
-
case
|
|
392
|
-
if (
|
|
393
|
-
r = JSON.parse(
|
|
441
|
+
case h.DTP_LIST:
|
|
442
|
+
if (In(l)) try {
|
|
443
|
+
r = JSON.parse(l);
|
|
394
444
|
} catch (e) {
|
|
395
|
-
|
|
445
|
+
cn(`JSON parse error: ${e.message}`);
|
|
396
446
|
}
|
|
397
|
-
else r =
|
|
398
|
-
|
|
447
|
+
else r = l;
|
|
448
|
+
$n(r) || (r = []);
|
|
399
449
|
break;
|
|
400
|
-
case
|
|
401
|
-
if (
|
|
402
|
-
r = JSON.parse(
|
|
450
|
+
case h.DTP_DICT:
|
|
451
|
+
if (In(l)) try {
|
|
452
|
+
r = JSON.parse(l);
|
|
403
453
|
} catch (e) {
|
|
404
|
-
|
|
454
|
+
cn(`JSON parse error: ${e.message}`);
|
|
405
455
|
}
|
|
406
|
-
else r =
|
|
407
|
-
|
|
456
|
+
else r = l;
|
|
457
|
+
kn(r) || (r = {});
|
|
408
458
|
break;
|
|
409
|
-
case
|
|
410
|
-
if (
|
|
411
|
-
r = JSON.parse(
|
|
459
|
+
case h.DTP_JSON:
|
|
460
|
+
if (In(l)) try {
|
|
461
|
+
r = JSON.parse(l);
|
|
412
462
|
} catch (e) {
|
|
413
|
-
|
|
463
|
+
cn(`JSON parse error: ${e.message}`);
|
|
414
464
|
}
|
|
415
|
-
else r =
|
|
465
|
+
else r = l;
|
|
416
466
|
break;
|
|
417
|
-
case
|
|
467
|
+
case h.DTP_POINTER: r = l;
|
|
418
468
|
}
|
|
419
|
-
return void 0 === r && (
|
|
469
|
+
return void 0 === r && (cn(`default_value WRONG, it: ${n.name}, value: ${n.default_value}`), r = null), t[n.name] = r, 0;
|
|
420
470
|
}
|
|
421
|
-
function
|
|
422
|
-
let
|
|
471
|
+
function ue(e, t, n, r) {
|
|
472
|
+
let l;
|
|
423
473
|
switch (n.type) {
|
|
424
|
-
case
|
|
425
|
-
if (null == r)
|
|
426
|
-
else if (
|
|
474
|
+
case h.DTP_STRING:
|
|
475
|
+
if (null == r) l = "";
|
|
476
|
+
else if (In(r)) l = String(r);
|
|
427
477
|
else {
|
|
428
478
|
let e = JSON.stringify(r);
|
|
429
|
-
e && (
|
|
479
|
+
e && (l = String(e));
|
|
430
480
|
}
|
|
431
481
|
break;
|
|
432
|
-
case
|
|
433
|
-
|
|
482
|
+
case h.DTP_BOOLEAN:
|
|
483
|
+
l = Vn(r);
|
|
434
484
|
break;
|
|
435
|
-
case
|
|
436
|
-
|
|
485
|
+
case h.DTP_INTEGER:
|
|
486
|
+
l = parseInt(r), isNaN(l) && cn(`${et(e)}: attr NaN: ${n.name}`);
|
|
437
487
|
break;
|
|
438
|
-
case
|
|
439
|
-
|
|
488
|
+
case h.DTP_REAL:
|
|
489
|
+
l = Number(r), isNaN(l) && cn(`${et(e)}: attr NaN: ${n.name}`);
|
|
440
490
|
break;
|
|
441
|
-
case
|
|
442
|
-
if (
|
|
443
|
-
|
|
491
|
+
case h.DTP_LIST:
|
|
492
|
+
if (In(r)) try {
|
|
493
|
+
l = JSON.parse(r);
|
|
444
494
|
} catch (e) {
|
|
445
|
-
|
|
495
|
+
cn(`JSON parse error: ${e.message}`);
|
|
446
496
|
}
|
|
447
|
-
else
|
|
448
|
-
if (
|
|
497
|
+
else l = r;
|
|
498
|
+
if (!$n(l)) return cn(`attr must be an array: ${n.name}`), -1;
|
|
449
499
|
break;
|
|
450
|
-
case
|
|
451
|
-
if (
|
|
452
|
-
|
|
500
|
+
case h.DTP_DICT:
|
|
501
|
+
if (In(r)) try {
|
|
502
|
+
l = JSON.parse(r);
|
|
453
503
|
} catch (e) {
|
|
454
|
-
|
|
504
|
+
cn(`JSON parse error: ${e.message}`);
|
|
455
505
|
}
|
|
456
|
-
else
|
|
457
|
-
if (!
|
|
506
|
+
else l = r;
|
|
507
|
+
if (!kn(l)) return cn(`attr must be an object: ${n.name}`), -1;
|
|
458
508
|
break;
|
|
459
|
-
case
|
|
460
|
-
if (
|
|
461
|
-
|
|
509
|
+
case h.DTP_JSON:
|
|
510
|
+
if (In(r)) try {
|
|
511
|
+
l = JSON.parse(r);
|
|
462
512
|
} catch (e) {
|
|
463
|
-
|
|
513
|
+
cn(`JSON parse error: ${e.message}`);
|
|
464
514
|
}
|
|
465
|
-
else
|
|
466
|
-
if (
|
|
515
|
+
else l = r;
|
|
516
|
+
if (!$n(l) && !kn(l)) return cn(`attr must be a json dict/list: ${n.name}`), -1;
|
|
467
517
|
break;
|
|
468
|
-
case
|
|
518
|
+
case h.DTP_POINTER: l = r;
|
|
469
519
|
}
|
|
470
|
-
return void 0 ===
|
|
520
|
+
return void 0 === l && cn(`${et(e)}: attr undefined: ${n.name}`), t[n.name] = l, kn(e.priv) && e.priv.hasOwnProperty(n.name) && (e.priv[n.name] = l), e.obflag & R.obflag_created && !(e.obflag & R.obflag_destroyed) && e.gclass.gmt.mt_writing && e.gclass.gmt.mt_writing(e, n.name), 0;
|
|
471
521
|
}
|
|
472
|
-
function
|
|
522
|
+
function ce(e) {
|
|
473
523
|
return e.jn_attrs;
|
|
474
524
|
}
|
|
475
|
-
function
|
|
476
|
-
return
|
|
525
|
+
function fe(e, t, n) {
|
|
526
|
+
return Et(e, t) ? ce(e) : e && e.bottom_gobj ? fe(e.bottom_gobj, t, n) : (n && cn(`GClass Attribute NOT FOUND: ${et(e)}, attr ${t}`), null);
|
|
477
527
|
}
|
|
478
|
-
function
|
|
479
|
-
if (!(e && e instanceof
|
|
528
|
+
function ge(e, t, n) {
|
|
529
|
+
if (!(e && e instanceof S)) return n && cn("gclass NULL"), null;
|
|
480
530
|
if (!t) return e.attrs_table;
|
|
481
531
|
for (let n = 0; n < e.attrs_table.length; n++) {
|
|
482
532
|
const r = e.attrs_table[n];
|
|
483
533
|
if (r.name && r.name === t) return r;
|
|
484
534
|
}
|
|
485
|
-
return n &&
|
|
535
|
+
return n && cn(`${e.gclass_name}: GClass Attribute NOT FOUND: ${t}`), null;
|
|
486
536
|
}
|
|
487
|
-
function
|
|
488
|
-
if (
|
|
489
|
-
if (e.includes("`") || e.includes("^") || e.includes(".")) return
|
|
490
|
-
if (
|
|
491
|
-
let c = new
|
|
537
|
+
function de(e, t, n, r, l, o, s, i, _, a, u) {
|
|
538
|
+
if (Gn(e)) return cn("gclass_name EMPTY"), null;
|
|
539
|
+
if (e.includes("`") || e.includes("^") || e.includes(".")) return cn(`GClass name CANNOT have '.' or '^' or '\`' char: ${e}`), null;
|
|
540
|
+
if (Se(e)) return cn(`GClass ALREADY exists: ${e}`), null;
|
|
541
|
+
let c = new S(e, r, l, o, s, i, _, a, u);
|
|
492
542
|
(function(e, t) {
|
|
493
|
-
e && e instanceof
|
|
543
|
+
e && e instanceof S ? t ? d[t] ? cn(`gclass ALREADY REGISTERED: ${t}`) : d[t] = e : cn("gclass_name undefined") : cn("gclass undefined");
|
|
494
544
|
})(c, e);
|
|
495
545
|
const f = n.length;
|
|
496
546
|
for (let e = 0; e < f; e++) {
|
|
497
547
|
let t = n[e][0], r = n[e][1];
|
|
498
|
-
if (
|
|
499
|
-
if (
|
|
500
|
-
const
|
|
501
|
-
for (let e = 0; e <
|
|
502
|
-
let n = r[e][0],
|
|
503
|
-
|
|
548
|
+
if (Gn(t)) continue;
|
|
549
|
+
if (Ee(c, t) < 0) return be(c), null;
|
|
550
|
+
const l = r.length;
|
|
551
|
+
for (let e = 0; e < l; e++) {
|
|
552
|
+
let n = r[e][0], l = r[e][1], o = r[e][2];
|
|
553
|
+
Gn(n) || he(c, t, n, l, o);
|
|
504
554
|
}
|
|
505
555
|
}
|
|
506
556
|
for (let e = 0; e < t.length; e++) {
|
|
507
557
|
let n = t[e][0], r = t[e][1];
|
|
508
|
-
if (!
|
|
509
|
-
if (
|
|
510
|
-
|
|
558
|
+
if (!Gn(n)) {
|
|
559
|
+
if (ve(c, n)) return cn(`SMachine: event repeated in input_events: ${n}`), be(c), null;
|
|
560
|
+
ye(c, n, r);
|
|
511
561
|
}
|
|
512
562
|
}
|
|
513
563
|
if (!c.fsm_checked) {
|
|
514
|
-
if (
|
|
564
|
+
if (je(c) < 0) return be(c), null;
|
|
515
565
|
c.fsm_checked = !0;
|
|
516
566
|
}
|
|
517
567
|
return c;
|
|
518
568
|
}
|
|
519
|
-
function
|
|
569
|
+
function be(e) {
|
|
520
570
|
let t;
|
|
521
|
-
if (
|
|
571
|
+
if (In(e)) t = e;
|
|
522
572
|
else {
|
|
523
|
-
if (!(e instanceof
|
|
573
|
+
if (!(e instanceof S)) return cn("Cannot unregister gclass, type unknown"), -1;
|
|
524
574
|
t = e.gclass_name;
|
|
525
575
|
}
|
|
526
576
|
let n = d[t];
|
|
527
|
-
return n ? n.instances > 0 ? (
|
|
577
|
+
return n ? n.instances > 0 ? (cn(`Cannot unregister gclass, instances in use: ${t}`), -1) : (delete d[t], 0) : (cn(`Cannot unregister gclass, not found: ${t}`), -1);
|
|
528
578
|
}
|
|
529
|
-
function
|
|
579
|
+
function pe(e, t) {
|
|
530
580
|
const n = e.dl_states.length, r = e.dl_states;
|
|
531
581
|
for (let e = 0; e < n; e++) {
|
|
532
582
|
let n = r[e];
|
|
@@ -534,7 +584,7 @@ var gobjJs = function(e) {
|
|
|
534
584
|
}
|
|
535
585
|
return null;
|
|
536
586
|
}
|
|
537
|
-
function
|
|
587
|
+
function me(e, t) {
|
|
538
588
|
const n = e.dl_actions.length, r = e.dl_actions;
|
|
539
589
|
for (let e = 0; e < n; e++) {
|
|
540
590
|
let n = r[e];
|
|
@@ -542,23 +592,23 @@ var gobjJs = function(e) {
|
|
|
542
592
|
}
|
|
543
593
|
return null;
|
|
544
594
|
}
|
|
545
|
-
function
|
|
546
|
-
return e instanceof
|
|
595
|
+
function Ee(e, t) {
|
|
596
|
+
return e instanceof S ? pe(e, t) ? (cn(`state already exists: ${t}`), -1) : (e.dl_states.push(new $(t)), 0) : (cn("Cannot add state, typeof not GClass"), -1);
|
|
547
597
|
}
|
|
548
|
-
function
|
|
549
|
-
if (!(e instanceof
|
|
550
|
-
if (
|
|
551
|
-
let
|
|
552
|
-
return
|
|
598
|
+
function he(e, t, n, r, l) {
|
|
599
|
+
if (!(e instanceof S)) return cn("Cannot add state, typeof not GClass"), -1;
|
|
600
|
+
if (Gn(t)) return cn("state_name EMPTY"), -1;
|
|
601
|
+
let o = pe(e, t);
|
|
602
|
+
return o ? me(o, n) ? (cn(`event already exists: gclass ${e.gclass_name}, state ${t}, event ${n}`), -1) : (o.dl_actions.push(new k(n, r, l)), 0) : (cn(`state not found: ${t}`), -1);
|
|
553
603
|
}
|
|
554
|
-
function
|
|
555
|
-
|
|
604
|
+
function Te(e, t, n) {
|
|
605
|
+
Gn(t) || e.push(new I(t, n));
|
|
556
606
|
}
|
|
557
|
-
function
|
|
558
|
-
return e instanceof
|
|
607
|
+
function ye(e, t, n) {
|
|
608
|
+
return e instanceof S ? Te(e.dl_events, t, n) : (cn("Cannot add state, typeof not GClass"), -1);
|
|
559
609
|
}
|
|
560
|
-
function
|
|
561
|
-
if (!(e instanceof
|
|
610
|
+
function ve(e, t) {
|
|
611
|
+
if (!(e instanceof S)) return cn("Cannot add state, typeof not GClass"), 0;
|
|
562
612
|
const n = e.dl_events.length, r = e.dl_events;
|
|
563
613
|
for (let e = 0; e < n; e++) {
|
|
564
614
|
let n = r[e];
|
|
@@ -566,399 +616,423 @@ var gobjJs = function(e) {
|
|
|
566
616
|
}
|
|
567
617
|
return null;
|
|
568
618
|
}
|
|
569
|
-
function
|
|
570
|
-
if (!(e instanceof
|
|
619
|
+
function je(e) {
|
|
620
|
+
if (!(e instanceof S)) return cn("Cannot add state, typeof not GClass"), -1;
|
|
571
621
|
let t = 0;
|
|
572
|
-
|
|
622
|
+
Dn(e.dl_states) || (cn(`GClass without states: ${e.gclass_name}`), t += -1);
|
|
573
623
|
for (let n = 0; n < e.dl_states.length; n++) {
|
|
574
624
|
let r = e.dl_states[n];
|
|
575
|
-
if (!
|
|
576
|
-
let
|
|
577
|
-
|
|
625
|
+
if (!Gn(r.state_name)) for (let n = 0; n < r.dl_actions.length; n++) {
|
|
626
|
+
let l = r.dl_actions[n];
|
|
627
|
+
Gn(l.event_name) || (ve(e, l.event_name) || (cn(`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 && (pe(e, l.next_state) || (cn(`SMachine: next state NOT in state names: gclass ${e.gclass_name}, state ${r.state_name}, next_state ${l.next_state}`), t += -1)));
|
|
578
628
|
}
|
|
579
629
|
}
|
|
580
630
|
for (let n = 0; n < e.dl_events.length; n++) {
|
|
581
631
|
let r = e.dl_events[n];
|
|
582
|
-
if (!
|
|
632
|
+
if (!Gn(r.event_name) && (Cn(r.event_flag) || (cn(`SMachine: event flag is NOT number: gclass ${e.gclass_name}, event ${r.event_name}`), t += -1), !(r.event_flag & D.EVF_OUTPUT_EVENT))) {
|
|
583
633
|
let n = !1;
|
|
584
634
|
for (let t = 0; t < e.dl_states.length; t++) {
|
|
585
|
-
let
|
|
586
|
-
|
|
635
|
+
let l = e.dl_states[t];
|
|
636
|
+
Gn(l.state_name) || me(l, r.event_name) && (n = !0);
|
|
587
637
|
}
|
|
588
|
-
n || (
|
|
638
|
+
n || (cn(`SMachine: input_list's event NOT in state: gclass ${e.gclass_name}, event ${r.event_name}`), t += -1);
|
|
589
639
|
}
|
|
590
640
|
}
|
|
591
641
|
return t;
|
|
592
642
|
}
|
|
593
|
-
function
|
|
643
|
+
function Se(e, t) {
|
|
594
644
|
let n = null;
|
|
595
645
|
try {
|
|
596
646
|
n = d[e];
|
|
597
647
|
} catch (e) {}
|
|
598
|
-
return n || (t &&
|
|
648
|
+
return n || (t && cn(`gclass not found: ${e}`), null);
|
|
599
649
|
}
|
|
600
|
-
function
|
|
650
|
+
function Oe() {
|
|
601
651
|
return !m || m.obflag & R.obflag_destroyed ? null : m;
|
|
602
652
|
}
|
|
603
|
-
function
|
|
653
|
+
function we(e, t) {
|
|
604
654
|
e = e.toLowerCase();
|
|
605
|
-
return b[e] || (t &&
|
|
655
|
+
return b[e] || (t && cn(`gobj service not found: ${e}`), null);
|
|
606
656
|
}
|
|
607
|
-
function
|
|
608
|
-
let t =
|
|
609
|
-
return t = t.toLowerCase(), b[t] &&
|
|
657
|
+
function Ne(e) {
|
|
658
|
+
let t = Xe(e);
|
|
659
|
+
return t = t.toLowerCase(), b[t] && cn(`service ALREADY REGISTERED: ${t}. Will be UPDATED`), b[t] = e, 0;
|
|
610
660
|
}
|
|
611
|
-
function
|
|
612
|
-
t.parent &&
|
|
661
|
+
function Re(e, t) {
|
|
662
|
+
t.parent && cn(`_add_child() ALREADY HAS PARENT: ${t.gobj_name}`), e.dl_children.push(t), t.parent = e;
|
|
613
663
|
}
|
|
614
|
-
function
|
|
615
|
-
let n =
|
|
616
|
-
n >= 0 && (
|
|
664
|
+
function De(e, t) {
|
|
665
|
+
let n = Or(e.dl_children, t);
|
|
666
|
+
n >= 0 && (Nn(e.dl_children, n), t.parent = null);
|
|
617
667
|
}
|
|
618
|
-
function
|
|
619
|
-
|
|
668
|
+
function Ae(e, t) {
|
|
669
|
+
return Be(e) ? _ ? _(e, t) : -1 : (cn(`${et(e)}: Only gobj services can load/save writable-persistent`), -1);
|
|
670
|
+
}
|
|
671
|
+
function ke(e, t) {
|
|
672
|
+
"__json_config_variables__" !== t && cn(`GClass Attribute NOT FOUND: ${et(e)}, attr ${t}`);
|
|
620
673
|
}
|
|
621
|
-
function
|
|
674
|
+
function $e(e, t, n) {
|
|
622
675
|
let r = t;
|
|
623
|
-
(function(e, t, n, r,
|
|
624
|
-
if (!e || !t) return
|
|
625
|
-
let
|
|
626
|
-
for (const [
|
|
627
|
-
const t =
|
|
628
|
-
t ? (-1 === n || t.flag & n) && (t.flag &
|
|
676
|
+
(function(e, t, n, r, l) {
|
|
677
|
+
if (!e || !t) return cn("hsdata or kw NULL"), -1;
|
|
678
|
+
let o = 0;
|
|
679
|
+
for (const [s, i] of Object.entries(t)) {
|
|
680
|
+
const t = ge(l.gclass, s, !1);
|
|
681
|
+
t ? (-1 === n || t.flag & n) && (t.flag & T.SDF_DEPRECATED && fn(`${et(l)}: Deprecated attribute used in gobj creation: ${s}`), o += ue(l, e, t, i)) : r && (r(l, s), o--);
|
|
629
682
|
}
|
|
630
|
-
return
|
|
631
|
-
})(
|
|
683
|
+
return o;
|
|
684
|
+
})(ce(e), r, -1, e.gclass.gclass_flag & w.gcflag_ignore_unknown_attrs ? 0 : ke, e) < 0 && (cn(`${et(e)} json2data() FAILED`), bn(r));
|
|
632
685
|
}
|
|
633
|
-
function
|
|
634
|
-
if (
|
|
635
|
-
if (p) return
|
|
636
|
-
|
|
686
|
+
function Ie(e, t, r, l, o) {
|
|
687
|
+
if (o & N.gobj_flag_yuno) {
|
|
688
|
+
if (p) return cn("__yuno__ already created"), null;
|
|
689
|
+
o |= N.gobj_flag_service;
|
|
637
690
|
} else {
|
|
638
|
-
if (!
|
|
639
|
-
if (!("string" == typeof
|
|
640
|
-
if (
|
|
641
|
-
}
|
|
642
|
-
if (
|
|
643
|
-
if (
|
|
644
|
-
if (m) return
|
|
645
|
-
|
|
646
|
-
}
|
|
647
|
-
if (
|
|
648
|
-
let
|
|
649
|
-
if (!
|
|
650
|
-
if (!
|
|
651
|
-
if (!
|
|
652
|
-
if (e.includes("`")) return
|
|
653
|
-
if (e.includes("^")) return
|
|
654
|
-
}
|
|
655
|
-
let _ = new
|
|
656
|
-
_.jn_attrs =
|
|
691
|
+
if (!l) return cn("gobj NEEDS a parent!"), null;
|
|
692
|
+
if (!("string" == typeof l || l instanceof O)) return cn(`BAD TYPE of parent: ${l}`), null;
|
|
693
|
+
if (In(l) && !(l = we(l))) return fn(`parent service not found: ${l}`), null;
|
|
694
|
+
}
|
|
695
|
+
if (o & N.gobj_flag_service && we(e, !1)) return cn(`service ALREADY registered: ${t}^${e}`), null;
|
|
696
|
+
if (o & N.gobj_flag_default_service) {
|
|
697
|
+
if (m) return cn(`default service ALREADY registered: ${t}^${e}`), null;
|
|
698
|
+
o |= N.gobj_flag_service;
|
|
699
|
+
}
|
|
700
|
+
if (Gn(t)) return cn("gclass_name must be a string"), null;
|
|
701
|
+
let s = Se(t, !1);
|
|
702
|
+
if (!s) return cn(`GClass not registered: ${t}^${e}`), null;
|
|
703
|
+
if (!In(e)) return cn(`gobj_name must be a string: ${t}`), null;
|
|
704
|
+
if (!Gn(e)) {
|
|
705
|
+
if (e.includes("`")) return cn(`gobj_name cannot contain char ': ${t}^${e}`), null;
|
|
706
|
+
if (e.includes("^")) return cn(`gobj_name cannot contain char ^: ${t}^${e}`), null;
|
|
707
|
+
}
|
|
708
|
+
let _ = new O(e, s, r, l, o);
|
|
709
|
+
_.jn_attrs = _e(_, s.attrs_table);
|
|
657
710
|
for (const [e, t] of Object.entries(_.jn_attrs)) e in _.priv && (_.priv[e] = t);
|
|
658
711
|
let a = Y(_);
|
|
659
|
-
return a &&
|
|
712
|
+
return a && P(n("💙💙⏩ creating: %s^%s", s.gclass_name, e)), _.gobj_flag & N.gobj_flag_service && Ne(_), _.gobj_flag & N.gobj_flag_yuno && (p = _), _.gobj_flag & N.gobj_flag_default_service && (m = _), _.gobj_flag & N.gobj_flag_yuno || Re(l, _), _.obflag |= R.obflag_created, _.gclass.instances++, $e(_, r), _.gobj_flag & N.gobj_flag_service && i && i(_, null), _.gclass.gmt.mt_create2 ? _.gclass.gmt.mt_create2(_, r) : _.gclass.gmt.mt_create && _.gclass.gmt.mt_create(_), l && l.gclass.gmt.mt_child_added && (a && P(n("👦👦🔵 child_added(%s): %s", tt(l), et(_))), l.gclass.gmt.mt_child_added(l, _)), a && P(n("💙💙⏪ created: %s", tt(_))), _;
|
|
660
713
|
}
|
|
661
|
-
function
|
|
662
|
-
return
|
|
714
|
+
function Ce(e, t, n, r) {
|
|
715
|
+
return Ie(e, t, n, r, N.gobj_flag_pure_child);
|
|
663
716
|
}
|
|
664
|
-
function
|
|
665
|
-
if (
|
|
666
|
-
e.__refs__ > 0 &&
|
|
667
|
-
if (0 ===
|
|
668
|
-
for (let t of
|
|
669
|
-
|
|
717
|
+
function Pe(e) {
|
|
718
|
+
if (ot(e)) return void cn("gobj NULL or DESTROYED");
|
|
719
|
+
e.__refs__ > 0 && cn(`${et(e)}: gobj DESTROYING with references: ${e.__refs__}`), e.playing && (cn(`Destroying a PLAYING gobj: ${tt(e)}`), Ke(e)), e.running && (cn(`Destroying a RUNNING gobj: ${tt(e)}`), Ge(e)), e.obflag |= R.obflag_destroying, function(e) {
|
|
720
|
+
if (0 === Pt.length) return;
|
|
721
|
+
for (let t of Pt) t.src === e && (t.src = null);
|
|
722
|
+
Pt = Pt.filter((t) => t.dst !== e);
|
|
670
723
|
}(e);
|
|
671
724
|
let t = Y(e);
|
|
672
|
-
t &&
|
|
673
|
-
let r =
|
|
674
|
-
r && r.gclass.gmt.mt_child_removed && (t &&
|
|
675
|
-
let t =
|
|
676
|
-
t = t.toLowerCase(), b[t] ? delete b[t] :
|
|
677
|
-
}(e),
|
|
725
|
+
t && P(n("💔💔⏩ destroying: %s", tt(e)));
|
|
726
|
+
let r = nt(e);
|
|
727
|
+
r && r.gclass.gmt.mt_child_removed && (t && P(n("👦👦🔴 child_removed(%s): %s", tt(r), et(e))), r.gclass.gmt.mt_child_removed(r, e)), e.gobj_flag & N.gobj_flag_service && function(e) {
|
|
728
|
+
let t = Xe(e);
|
|
729
|
+
t = t.toLowerCase(), b[t] ? delete b[t] : cn(`"service NOT found in register": ${t}`);
|
|
730
|
+
}(e), Bt(e, e.dl_subscriptions, !0), Bt(e, e.dl_subscribings, !0), r && (De(r, e), rt(e) && (st(r) !== e || ot(r) || it(r, null))), function(e) {
|
|
678
731
|
let t = e.dl_children.slice();
|
|
679
732
|
for (let e = 0; e < t.length; e++) {
|
|
680
733
|
let n = t[e];
|
|
681
|
-
|
|
734
|
+
ot(n) || Pe(n);
|
|
682
735
|
}
|
|
683
|
-
}(e), e.obflag & R.obflag_created && e.gclass.gmt.mt_destroy && e.gclass.gmt.mt_destroy(e), t &&
|
|
736
|
+
}(e), e.obflag & R.obflag_created && e.gclass.gmt.mt_destroy && e.gclass.gmt.mt_destroy(e), t && P(n("💔💔⏪ destroyed: %s", tt(e))), e.obflag |= R.obflag_destroyed, e.obflag & R.obflag_created && e.gclass.instances--;
|
|
684
737
|
}
|
|
685
|
-
function
|
|
686
|
-
if (
|
|
687
|
-
if (e.running) return
|
|
688
|
-
if (e.disabled) return
|
|
689
|
-
|
|
738
|
+
function Le(e) {
|
|
739
|
+
if (ot(e)) return cn("gobj NULL or DESTROYED"), -1;
|
|
740
|
+
if (e.running) return cn(`${et(e)}: GObj ALREADY RUNNING`), -1;
|
|
741
|
+
if (e.disabled) return cn(`${et(e)}: GObj DISABLED`), -1;
|
|
742
|
+
J(e) && P(n("⏺ ⏺ start: %s", tt(e))), e.running = !0;
|
|
690
743
|
let t = 0;
|
|
691
744
|
return e.gclass.gmt.mt_start && (t = e.gclass.gmt.mt_start(e)), t;
|
|
692
745
|
}
|
|
693
|
-
function
|
|
694
|
-
return e.gclass.gclass_flag &
|
|
746
|
+
function Ue(e, t, n) {
|
|
747
|
+
return e.gclass.gclass_flag & w.gcflag_manual_start || ot(e) || xe(e) || Ye(e) || Le(e), 0;
|
|
695
748
|
}
|
|
696
|
-
function
|
|
697
|
-
return e.gclass.gclass_flag &
|
|
749
|
+
function Fe(e, t, n) {
|
|
750
|
+
return e.gclass.gclass_flag & w.gcflag_manual_start || Ye(e) ? 1 : (xe(e) || Le(e), 0);
|
|
698
751
|
}
|
|
699
|
-
function
|
|
700
|
-
if (
|
|
701
|
-
if (!e.running) return
|
|
702
|
-
e.playing && (
|
|
752
|
+
function Ge(e) {
|
|
753
|
+
if (ot(e)) return cn("gobj NULL or DESTROYED"), -1;
|
|
754
|
+
if (!e.running) return cn(`${et(e)}: GObj NOT RUNNING`), -1;
|
|
755
|
+
e.playing && (fn(`${et(e)}: GObj stopping without previous pause`), Ke(e)), J(e) && P(n("⏹ ⏹ stop: %s", tt(e))), e.running = !1;
|
|
703
756
|
let t = 0;
|
|
704
757
|
return e.gclass.gmt.mt_stop && (t = e.gclass.gmt.mt_stop(e)), t;
|
|
705
758
|
}
|
|
706
|
-
function
|
|
707
|
-
return
|
|
759
|
+
function Ve(e, t, n) {
|
|
760
|
+
return xe(e) && Ge(e), 0;
|
|
708
761
|
}
|
|
709
|
-
function
|
|
710
|
-
return
|
|
762
|
+
function Me(e) {
|
|
763
|
+
return ot(e) ? (cn("gobj NULL or DESTROYED"), -1) : at(e, A.WALK_FIRST2LAST, Ve, 0, 0);
|
|
711
764
|
}
|
|
712
|
-
function
|
|
713
|
-
if (
|
|
714
|
-
if (e.playing) return
|
|
715
|
-
if (e.disabled) return
|
|
716
|
-
if (!
|
|
717
|
-
if (e.gclass.gclass_flag &
|
|
718
|
-
|
|
719
|
-
}
|
|
720
|
-
|
|
765
|
+
function We(e) {
|
|
766
|
+
if (ot(e)) return cn(`gobj NULL or DESTROYED: ${et(e)}`), -1;
|
|
767
|
+
if (e.playing) return cn(`${et(e)}: GObj ALREADY PLAYING`), -1;
|
|
768
|
+
if (e.disabled) return cn(`${et(e)}: GObj DISABLED`), -1;
|
|
769
|
+
if (!xe(e)) {
|
|
770
|
+
if (e.gclass.gclass_flag & w.gcflag_required_start_to_play) return cn(`${et(e)}: Cannot play, start not done`), -1;
|
|
771
|
+
fn(`${et(e)}: GObj playing without previous start`), Le(e);
|
|
772
|
+
}
|
|
773
|
+
J(e) && P(n("⏯ ⏯ play: %s", tt(e))), e.playing = !0;
|
|
721
774
|
let t = 0;
|
|
722
775
|
return e.gclass.gmt.mt_play && (t = e.gclass.gmt.mt_play(e), (t < 0 || !1 === t) && (e.playing = !1)), t;
|
|
723
776
|
}
|
|
724
|
-
function
|
|
725
|
-
return
|
|
777
|
+
function Ke(e) {
|
|
778
|
+
return ot(e) ? (cn("gobj NULL or DESTROYED"), -1) : e.playing ? (J(e) && P(n("⏸ ⏸ pause: %s", tt(e))), e.playing = !1, e.gclass.gmt.mt_pause ? e.gclass.gmt.mt_pause(e) : 0) : (cn(`${et(e)}: GObj NOT PLAYING`), -1);
|
|
726
779
|
}
|
|
727
|
-
function
|
|
728
|
-
return !
|
|
780
|
+
function xe(e) {
|
|
781
|
+
return !ot(e) && e.running;
|
|
729
782
|
}
|
|
730
|
-
function
|
|
731
|
-
return !!
|
|
783
|
+
function Ye(e) {
|
|
784
|
+
return !!ot(e) || e.disabled;
|
|
732
785
|
}
|
|
733
|
-
function
|
|
734
|
-
return !!(e && e.gobj_flag &
|
|
786
|
+
function Be(e) {
|
|
787
|
+
return !!(e && e.gobj_flag & N.gobj_flag_service);
|
|
735
788
|
}
|
|
736
|
-
function
|
|
737
|
-
return !
|
|
789
|
+
function Je(e) {
|
|
790
|
+
return !ot(e) && e.playing;
|
|
738
791
|
}
|
|
739
|
-
function
|
|
792
|
+
function He() {
|
|
740
793
|
return !p || p.obflag & R.obflag_destroyed ? null : p;
|
|
741
794
|
}
|
|
742
|
-
function
|
|
743
|
-
let e =
|
|
744
|
-
return e ?
|
|
795
|
+
function qe() {
|
|
796
|
+
let e = He();
|
|
797
|
+
return e ? Xe(e) : "";
|
|
745
798
|
}
|
|
746
|
-
function
|
|
747
|
-
let e =
|
|
748
|
-
return e ?
|
|
799
|
+
function ze() {
|
|
800
|
+
let e = He();
|
|
801
|
+
return e ? jt(e, "yuno_role") : "";
|
|
749
802
|
}
|
|
750
|
-
function
|
|
751
|
-
let e =
|
|
752
|
-
return e ?
|
|
803
|
+
function Qe() {
|
|
804
|
+
let e = He();
|
|
805
|
+
return e ? jt(e, "yuno_id") : "";
|
|
753
806
|
}
|
|
754
|
-
function
|
|
755
|
-
return
|
|
807
|
+
function Xe(e) {
|
|
808
|
+
return Fn(e) ? e.gobj_name : (cn("gobj bad type"), null);
|
|
756
809
|
}
|
|
757
|
-
function
|
|
758
|
-
return
|
|
810
|
+
function Ze(e) {
|
|
811
|
+
return Fn(e) ? e.gclass.gclass_name : (cn("gobj NULL of bad type"), null);
|
|
759
812
|
}
|
|
760
|
-
function
|
|
761
|
-
return
|
|
813
|
+
function et(e) {
|
|
814
|
+
return Fn(e) ? e.gclass.gclass_name + "^" + Xe(e) : (cn("gobj bad type"), null);
|
|
762
815
|
}
|
|
763
|
-
function
|
|
764
|
-
if (!
|
|
765
|
-
let t =
|
|
766
|
-
for (; n;) t =
|
|
816
|
+
function tt(e) {
|
|
817
|
+
if (!Fn(e)) return cn("gobj NULL of bad type"), null;
|
|
818
|
+
let t = et(e), n = nt(e);
|
|
819
|
+
for (; n;) t = et(n) + "`" + t, n = nt(n);
|
|
767
820
|
return t;
|
|
768
821
|
}
|
|
769
|
-
function
|
|
770
|
-
return
|
|
822
|
+
function nt(e) {
|
|
823
|
+
return Fn(e) ? e.parent : (cn("gobj NULL of bad type"), null);
|
|
771
824
|
}
|
|
772
|
-
function
|
|
773
|
-
return
|
|
825
|
+
function rt(e) {
|
|
826
|
+
return Fn(e) ? !!(e.gobj_flag & N.gobj_flag_volatil) : (cn("gobj NULL of bad type"), null);
|
|
774
827
|
}
|
|
775
|
-
function
|
|
776
|
-
return
|
|
828
|
+
function lt(e) {
|
|
829
|
+
return Fn(e) ? !!(e.gobj_flag & N.gobj_flag_pure_child) : (cn("gobj NULL of bad type"), null);
|
|
777
830
|
}
|
|
778
|
-
function
|
|
779
|
-
return !
|
|
831
|
+
function ot(e) {
|
|
832
|
+
return !Fn(e) || !!(e.obflag & (R.obflag_destroyed | R.obflag_destroying));
|
|
780
833
|
}
|
|
781
|
-
function
|
|
782
|
-
return
|
|
834
|
+
function st(e) {
|
|
835
|
+
return Fn(e) ? e.bottom_gobj : (cn("gobj NULL of bad type"), null);
|
|
783
836
|
}
|
|
784
|
-
function
|
|
785
|
-
if (!
|
|
786
|
-
e.bottom_gobj &&
|
|
837
|
+
function it(e, t) {
|
|
838
|
+
if (!Fn(e)) return cn("gobj NULL of bad type"), null;
|
|
839
|
+
e.bottom_gobj && fn(`${et(e)}: bottom_gobj already set`), e.bottom_gobj = t;
|
|
787
840
|
}
|
|
788
|
-
function
|
|
789
|
-
return
|
|
841
|
+
function _t(e, t, n) {
|
|
842
|
+
return Fn(e) ? t ? ge(e.gclass, t, n) : e.gclass.attrs_table : (cn("gobj NULL of bad type"), null);
|
|
790
843
|
}
|
|
791
|
-
function
|
|
792
|
-
return
|
|
844
|
+
function at(e, t, n, r, l) {
|
|
845
|
+
return ot(e) ? (cn("gobj NULL, destroying, or bad type"), 0) : ft(e.dl_children, t, n, r, l);
|
|
793
846
|
}
|
|
794
|
-
function
|
|
795
|
-
return
|
|
847
|
+
function ut(e, t, n, r, l) {
|
|
848
|
+
return ot(e) ? (cn("gobj NULL, destroying, or bad type"), 0) : dt(e.dl_children, t, n, r, l);
|
|
796
849
|
}
|
|
797
|
-
function
|
|
798
|
-
return "number" == typeof e && isFinite(e) ? e : (null == e ||
|
|
850
|
+
function ct(e) {
|
|
851
|
+
return "number" == typeof e && isFinite(e) ? e : (null == e || cn(`walk callback must return a NUMBER (-1 stop, 0 descend, >0 skip children), got ${typeof e}: taken as 0`), 0);
|
|
799
852
|
}
|
|
800
|
-
function
|
|
801
|
-
let
|
|
802
|
-
if (t & A.WALK_LAST2FIRST) for (let e =
|
|
803
|
-
|
|
804
|
-
let t =
|
|
853
|
+
function ft(e, t, n, r, l) {
|
|
854
|
+
let o, s = [...e];
|
|
855
|
+
if (t & A.WALK_LAST2FIRST) for (let e = s.length; e > 0; e--) {
|
|
856
|
+
o = s[e - 1];
|
|
857
|
+
let t = ct(n(o, r, l));
|
|
805
858
|
if (t < 0) return t;
|
|
806
859
|
}
|
|
807
|
-
else for (let e = 0; e <
|
|
808
|
-
|
|
809
|
-
let t =
|
|
860
|
+
else for (let e = 0; e < s.length; e++) {
|
|
861
|
+
o = s[e];
|
|
862
|
+
let t = ct(n(o, r, l));
|
|
810
863
|
if (t < 0) return t;
|
|
811
864
|
}
|
|
812
865
|
return 0;
|
|
813
866
|
}
|
|
814
|
-
function
|
|
815
|
-
let
|
|
816
|
-
if (
|
|
867
|
+
function gt(e, t, n, r, l) {
|
|
868
|
+
let o, s = ft(e, t, n, r, l);
|
|
869
|
+
if (s < 0) return s;
|
|
817
870
|
if (t & A.WALK_LAST2FIRST) {
|
|
818
|
-
for (let
|
|
819
|
-
} else for (let
|
|
820
|
-
return
|
|
871
|
+
for (let i = e.length; i > 0; i--) if (o = e[i - 1], s = gt([...o.dl_children], t, n, r, l), s < 0) return s;
|
|
872
|
+
} else for (let i = 0; i < e.length; i++) if (o = e[i], s = gt([...o.dl_children], t, n, r, l), s < 0) return s;
|
|
873
|
+
return s;
|
|
821
874
|
}
|
|
822
|
-
function
|
|
823
|
-
if (t & A.WALK_BYLEVEL) return
|
|
824
|
-
let
|
|
825
|
-
if (t & A.WALK_BOTTOM2TOP) for (let
|
|
826
|
-
if (
|
|
827
|
-
if (
|
|
875
|
+
function dt(e, t, n, r, l) {
|
|
876
|
+
if (t & A.WALK_BYLEVEL) return gt(e, t, n, r, l);
|
|
877
|
+
let o, s;
|
|
878
|
+
if (t & A.WALK_BOTTOM2TOP) for (let i = e.length; i > 0; i--) {
|
|
879
|
+
if (s = e[i - 1], o = dt([...s.dl_children], t, n, r, l), o < 0) return o;
|
|
880
|
+
if (o = ct(n(s, r, l)), o < 0) return o;
|
|
828
881
|
}
|
|
829
|
-
else for (let
|
|
830
|
-
if (
|
|
831
|
-
if (0 ===
|
|
882
|
+
else for (let i = 0; i < e.length; i++) {
|
|
883
|
+
if (s = e[i], o = ct(n(s, r, l)), o < 0) return o;
|
|
884
|
+
if (0 === o && (o = dt([...s.dl_children], t, n, r, l), o < 0)) return o;
|
|
832
885
|
}
|
|
833
886
|
return 0;
|
|
834
887
|
}
|
|
835
|
-
function
|
|
836
|
-
if (!
|
|
837
|
-
let n = t.__gclass_name__, r = t.__gobj_name__,
|
|
888
|
+
function bt(e, t) {
|
|
889
|
+
if (!Fn(e)) return cn("gobj NULL of bad type"), !1;
|
|
890
|
+
let n = t.__gclass_name__, r = t.__gobj_name__, l = t.__prefix_gobj_name__;
|
|
838
891
|
t.__disabled__;
|
|
839
|
-
let
|
|
840
|
-
if (n && n !==
|
|
841
|
-
if (r && r !==
|
|
842
|
-
if (
|
|
843
|
-
let t =
|
|
844
|
-
if (
|
|
845
|
-
}
|
|
846
|
-
if (
|
|
847
|
-
let
|
|
848
|
-
for (const n of Object.keys(t)) if ("__gclass_name__" !== n && "__gobj_name__" !== n && "__prefix_gobj_name__" !== n && "__disabled__" !== n && "__state__" !== n &&
|
|
892
|
+
let o = t.__state__;
|
|
893
|
+
if (n && n !== Ze(e)) return !1;
|
|
894
|
+
if (r && r !== Xe(e)) return !1;
|
|
895
|
+
if (l) {
|
|
896
|
+
let t = l.length;
|
|
897
|
+
if (l !== Xe(e).substring(0, t)) return !1;
|
|
898
|
+
}
|
|
899
|
+
if (o && o !== kt(e)) return !1;
|
|
900
|
+
let s = e.jn_attrs;
|
|
901
|
+
for (const n of Object.keys(t)) if ("__gclass_name__" !== n && "__gobj_name__" !== n && "__prefix_gobj_name__" !== n && "__disabled__" !== n && "__state__" !== n && Et(e, n) && s[n] !== t[n]) return !1;
|
|
849
902
|
return !0;
|
|
850
903
|
}
|
|
851
|
-
function
|
|
852
|
-
if (
|
|
904
|
+
function pt(e, t) {
|
|
905
|
+
if (ot(e)) return cn("gobj NULL or DESTROYED"), null;
|
|
853
906
|
const n = e.dl_children;
|
|
854
907
|
for (let e = 0; e < n.length; e++) {
|
|
855
908
|
const r = n[e];
|
|
856
|
-
if (
|
|
909
|
+
if (bt(r, t)) return r;
|
|
857
910
|
}
|
|
858
911
|
return null;
|
|
859
912
|
}
|
|
860
|
-
function
|
|
913
|
+
function mt(e, t) {
|
|
861
914
|
if (!t) return null;
|
|
862
915
|
let n = t.split("`");
|
|
863
916
|
if (!function(e, t) {
|
|
864
|
-
let n = t.split("^"), r = null,
|
|
917
|
+
let n = t.split("^"), r = null, l = null;
|
|
865
918
|
if (2 === n.length) {
|
|
866
|
-
if (
|
|
919
|
+
if (l = n[0], r = n[1], l !== Ze(e)) return !1;
|
|
867
920
|
} else {
|
|
868
921
|
if (1 !== n.length) return !1;
|
|
869
922
|
r = n[0];
|
|
870
923
|
}
|
|
871
|
-
return r ===
|
|
924
|
+
return r === Xe(e);
|
|
872
925
|
}(e, n[0])) return null;
|
|
873
926
|
if (1 === n.length) return e;
|
|
874
|
-
let r = n[1].split("^"),
|
|
875
|
-
1 === r.length ?
|
|
876
|
-
let
|
|
877
|
-
return
|
|
927
|
+
let r = n[1].split("^"), l = {};
|
|
928
|
+
1 === r.length ? l.__gobj_name__ = r : (l.__gclass_name__ = r[0], l.__gobj_name__ = r[1]);
|
|
929
|
+
let o = pt(e, l);
|
|
930
|
+
return o ? (n.splice(0, 1), n = n.join("`"), mt(o, n)) : null;
|
|
878
931
|
}
|
|
879
|
-
function
|
|
880
|
-
return !
|
|
932
|
+
function Et(e, t) {
|
|
933
|
+
return !Gn(t) && !!ge(e.gclass, t, !1);
|
|
881
934
|
}
|
|
882
|
-
function
|
|
935
|
+
function ht(e, t, n) {
|
|
883
936
|
let r = e.jn_attrs;
|
|
884
937
|
if (t in r && r.hasOwnProperty(t)) {
|
|
885
938
|
let n = r[t];
|
|
886
939
|
return e.gclass.gmt.mt_reading ? e.gclass.gmt.mt_reading(e, t, n) : n;
|
|
887
940
|
}
|
|
888
|
-
return
|
|
941
|
+
return cn(`${et(e)}: GClass Attribute NOT FOUND, attr ${t}`), null;
|
|
889
942
|
}
|
|
890
|
-
function
|
|
891
|
-
let r = {},
|
|
892
|
-
for (let n = 0; n <
|
|
893
|
-
const
|
|
894
|
-
if (
|
|
943
|
+
function Tt(e, t, n) {
|
|
944
|
+
let r = {}, l = e.gclass.attrs_table;
|
|
945
|
+
for (let n = 0; n < l.length; n++) {
|
|
946
|
+
const o = l[n];
|
|
947
|
+
if (o.name && (-1 === t || o.flag & t)) {
|
|
895
948
|
let t;
|
|
896
|
-
!e.gclass.gmt.mt_reading || e.obflag & R.obflag_destroyed ? t =
|
|
949
|
+
!e.gclass.gmt.mt_reading || e.obflag & R.obflag_destroyed ? t = yn(e.jn_attrs, o.name) : (t = e.gclass.gmt.mt_reading(e, o.name), void 0 === t && (t = yn(e.jn_attrs, o.name))), jn(r, o.name, t);
|
|
897
950
|
}
|
|
898
951
|
}
|
|
899
952
|
return r;
|
|
900
953
|
}
|
|
901
|
-
function
|
|
954
|
+
function yt(e, t) {
|
|
902
955
|
if (t) {
|
|
903
|
-
if (0 ===
|
|
904
|
-
if (0 ===
|
|
905
|
-
if (0 ===
|
|
906
|
-
if (0 ===
|
|
907
|
-
}
|
|
908
|
-
let n =
|
|
909
|
-
return n ? !e.gclass.gmt.mt_reading || e.obflag & R.obflag_destroyed ?
|
|
910
|
-
}
|
|
911
|
-
function
|
|
912
|
-
t &&
|
|
913
|
-
let n =
|
|
914
|
-
return n ? !e.gclass.gmt.mt_reading || e.obflag & R.obflag_destroyed ?
|
|
915
|
-
}
|
|
916
|
-
function
|
|
917
|
-
if (t && 0 ===
|
|
918
|
-
let n =
|
|
919
|
-
return n ? !e.gclass.gmt.mt_reading || e.obflag & R.obflag_destroyed ?
|
|
920
|
-
}
|
|
921
|
-
function
|
|
922
|
-
let n =
|
|
923
|
-
return n ? !e.gclass.gmt.mt_reading || e.obflag & R.obflag_destroyed ?
|
|
924
|
-
}
|
|
925
|
-
function
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
956
|
+
if (0 === Wn(t, "__disabled__")) return Ye(e);
|
|
957
|
+
if (0 === Wn(t, "__running__")) return xe(e);
|
|
958
|
+
if (0 === Wn(t, "__playing__")) return Je(e);
|
|
959
|
+
if (0 === Wn(t, "__service__")) return Be(e);
|
|
960
|
+
}
|
|
961
|
+
let n = fe(e, t, !1);
|
|
962
|
+
return n ? !e.gclass.gmt.mt_reading || e.obflag & R.obflag_destroyed ? yn(n, t) : e.gclass.gmt.mt_reading(e, t) : (cn(`${et(e)}: GClass Attribute NOT FOUND, attr ${t}`), 0);
|
|
963
|
+
}
|
|
964
|
+
function vt(e, t) {
|
|
965
|
+
t && Wn(t, "__trace_level__");
|
|
966
|
+
let n = fe(e, t, !1);
|
|
967
|
+
return n ? !e.gclass.gmt.mt_reading || e.obflag & R.obflag_destroyed ? yn(n, t) : e.gclass.gmt.mt_reading(e, t) : (cn(`${et(e)}: GClass Attribute NOT FOUND, attr ${t}`), 0);
|
|
968
|
+
}
|
|
969
|
+
function jt(e, t) {
|
|
970
|
+
if (t && 0 === Wn(t, "__state__")) return kt(e);
|
|
971
|
+
let n = fe(e, t, !1);
|
|
972
|
+
return n ? !e.gclass.gmt.mt_reading || e.obflag & R.obflag_destroyed ? yn(n, t) : e.gclass.gmt.mt_reading(e, t) : (cn(`${et(e)}: GClass Attribute NOT FOUND, attr ${t}`), 0);
|
|
973
|
+
}
|
|
974
|
+
function St(e, t) {
|
|
975
|
+
let n = fe(e, t, !1);
|
|
976
|
+
return n ? !e.gclass.gmt.mt_reading || e.obflag & R.obflag_destroyed ? yn(n, t) : e.gclass.gmt.mt_reading(e, t) : (cn(`${et(e)}: GClass Attribute NOT FOUND, attr ${t}`), 0);
|
|
977
|
+
}
|
|
978
|
+
function Ot(e, t, r, l) {
|
|
979
|
+
if (!In(t)) return cn(n("gobj_write_attr(%s): path must be a string", et(e))), -1;
|
|
980
|
+
let o, s = e.jn_attrs, i = t.split("`");
|
|
981
|
+
if (i.length <= 1) {
|
|
982
|
+
let l = t;
|
|
983
|
+
return l in s && s.hasOwnProperty(l) ? (s[l] = r, kn(e.priv) && e.priv.hasOwnProperty(l) && (e.priv[l] = r), e.obflag & R.obflag_created && !(e.obflag & R.obflag_destroyed) && e.gclass.gmt.mt_writing && e.gclass.gmt.mt_writing(e, l), 0) : (cn(n("gobj_write_attr(%s): attr not found '%s'", et(e), l)), -1);
|
|
984
|
+
}
|
|
985
|
+
let _ = i.length;
|
|
986
|
+
for (let t = 0; t < _; t++) {
|
|
987
|
+
o = i[t];
|
|
988
|
+
let n = pt(e, { __gobj_name__: o });
|
|
989
|
+
if (n && t < _ - 1) {
|
|
990
|
+
e = n;
|
|
991
|
+
continue;
|
|
992
|
+
}
|
|
993
|
+
let l = e.jn_attrs;
|
|
994
|
+
if (o in l && l.hasOwnProperty(o)) return l[o] = r, kn(e.priv) && e.priv.hasOwnProperty(o) && (e.priv[o] = r), e.obflag & R.obflag_created && !(e.obflag & R.obflag_destroyed) && e.mt_writing && e.mt_writing(e, o), 0;
|
|
995
|
+
break;
|
|
930
996
|
}
|
|
931
|
-
return
|
|
997
|
+
return cn(n("gobj_write_attr(%s): attr not found '%s'", et(e), o)), -1;
|
|
998
|
+
}
|
|
999
|
+
function wt(e, t, n, r) {
|
|
1000
|
+
let l = ce(e), o = 0;
|
|
1001
|
+
for (const [r, s] of Object.entries(t)) {
|
|
1002
|
+
let t = _t(e, r, !0);
|
|
1003
|
+
t && (-1 === n || t.flag & n) && (o += ue(e, l, t, s));
|
|
1004
|
+
}
|
|
1005
|
+
return o;
|
|
932
1006
|
}
|
|
933
|
-
function
|
|
934
|
-
let r =
|
|
935
|
-
return r ? (r[t] =
|
|
1007
|
+
function Nt(e, t, n) {
|
|
1008
|
+
let r = fe(e, t, !1);
|
|
1009
|
+
return r ? (r[t] = Vn(n), kn(e.priv) && e.priv.hasOwnProperty(t) && (e.priv[t] = n), e.obflag & R.obflag_created && !(e.obflag & R.obflag_destroyed) && e.gclass.gmt.mt_writing && e.gclass.gmt.mt_writing(e, t), 0) : (cn(`${et(e)}: GClass Attribute NOT FOUND, attr ${t}`), -1);
|
|
936
1010
|
}
|
|
937
|
-
function
|
|
938
|
-
let r =
|
|
939
|
-
return r ? (r[t] = parseInt(n),
|
|
1011
|
+
function Rt(e, t, n) {
|
|
1012
|
+
let r = fe(e, t, !1);
|
|
1013
|
+
return r ? (r[t] = parseInt(n), kn(e.priv) && e.priv.hasOwnProperty(t) && (e.priv[t] = n), e.obflag & R.obflag_created && !(e.obflag & R.obflag_destroyed) && e.gclass.gmt.mt_writing && e.gclass.gmt.mt_writing(e, t), 0) : (cn(`${et(e)}: GClass Attribute NOT FOUND, attr ${t}`), -1);
|
|
940
1014
|
}
|
|
941
|
-
function
|
|
942
|
-
let r =
|
|
943
|
-
return r ? (r[t] = String(n),
|
|
1015
|
+
function Dt(e, t, n) {
|
|
1016
|
+
let r = fe(e, t, !1);
|
|
1017
|
+
return r ? (r[t] = String(n), kn(e.priv) && e.priv.hasOwnProperty(t) && (e.priv[t] = n), e.obflag & R.obflag_created && !(e.obflag & R.obflag_destroyed) && e.gclass.gmt.mt_writing && e.gclass.gmt.mt_writing(e, t), 0) : (cn(`${et(e)}: GClass Attribute NOT FOUND, attr ${t}`), -1);
|
|
944
1018
|
}
|
|
945
|
-
function
|
|
946
|
-
if (
|
|
1019
|
+
function At(e, t) {
|
|
1020
|
+
if (ot(e)) return cn("gobj NULL or DESTROYED"), null;
|
|
947
1021
|
if (e.current_state.state_name === t) return !1;
|
|
948
|
-
let r =
|
|
949
|
-
if (!r) return
|
|
1022
|
+
let r = pe(e.gclass, t);
|
|
1023
|
+
if (!r) return cn(`${et(e)}: state unknown, state ${t}`), !1;
|
|
950
1024
|
e.last_state = e.current_state, e.current_state = r;
|
|
951
|
-
let
|
|
952
|
-
return
|
|
1025
|
+
let l = q(e, "EV_STATE_CHANGED"), o = !!function(e) {
|
|
1026
|
+
return K(e) & L.TRACE_STATES;
|
|
953
1027
|
}(e);
|
|
954
|
-
return (
|
|
1028
|
+
return (l || o) && (1 === C || P(n("🔀🔀 mach(%s%s^%s), new st(%s), prev st(%s)", e.running ? "" : "!!", Ze(e), Xe(e), kt(e), e.last_state.state_name))), !0;
|
|
955
1029
|
}
|
|
956
|
-
function
|
|
957
|
-
return
|
|
1030
|
+
function kt(e) {
|
|
1031
|
+
return Fn(e) ? e.current_state.state_name : (cn("hgobj NULL"), "");
|
|
958
1032
|
}
|
|
959
|
-
function
|
|
960
|
-
if (!
|
|
961
|
-
let r =
|
|
1033
|
+
function $t(e, t, n) {
|
|
1034
|
+
if (!Fn(e)) return cn("gobj NULL of bad type"), null;
|
|
1035
|
+
let r = ve(e.gclass, t);
|
|
962
1036
|
if (r) return r;
|
|
963
1037
|
if (n) {
|
|
964
1038
|
const e = g.length, n = g;
|
|
@@ -969,106 +1043,106 @@ var gobjJs = function(e) {
|
|
|
969
1043
|
}
|
|
970
1044
|
return null;
|
|
971
1045
|
}
|
|
972
|
-
function
|
|
973
|
-
let r =
|
|
1046
|
+
function It(e, t, n) {
|
|
1047
|
+
let r = $t(e, t, !1);
|
|
974
1048
|
return !!r && !(n && !(r.event_flag & n));
|
|
975
1049
|
}
|
|
976
|
-
function
|
|
977
|
-
let r =
|
|
1050
|
+
function Ct(e, t, n) {
|
|
1051
|
+
let r = $t(e, t, !1);
|
|
978
1052
|
return !!r && !(n && !(r.event_flag & n)) && !!(r.event_flag & D.EVF_OUTPUT_EVENT);
|
|
979
1053
|
}
|
|
980
|
-
var
|
|
981
|
-
function
|
|
982
|
-
|
|
983
|
-
let e =
|
|
984
|
-
|
|
1054
|
+
var Pt = [], Lt = !1;
|
|
1055
|
+
function Ut() {
|
|
1056
|
+
Lt = !1;
|
|
1057
|
+
let e = Pt;
|
|
1058
|
+
Pt = [];
|
|
985
1059
|
let t = 0;
|
|
986
|
-
for (let n of e) n.dst.obflag & (R.obflag_destroyed | R.obflag_destroying) || (
|
|
987
|
-
return
|
|
988
|
-
}
|
|
989
|
-
function
|
|
990
|
-
if (!(e && e instanceof
|
|
991
|
-
if (e.obflag & (R.obflag_destroyed | R.obflag_destroying)) return
|
|
992
|
-
let
|
|
993
|
-
if (!
|
|
994
|
-
let
|
|
1060
|
+
for (let n of e) n.dst.obflag & (R.obflag_destroyed | R.obflag_destroying) || (Ft(n.dst, n.event, n.kw, n.src), t++);
|
|
1061
|
+
return Pt.length > 0 && !Lt && (Lt = !0, setTimeout(Ut, 0)), t;
|
|
1062
|
+
}
|
|
1063
|
+
function Ft(e, t, r, l) {
|
|
1064
|
+
if (!(e && e instanceof O)) return cn("gobj dst NULL"), -1;
|
|
1065
|
+
if (e.obflag & (R.obflag_destroyed | R.obflag_destroying)) return cn("gobj dst DESTROYED"), -1;
|
|
1066
|
+
let o = e.current_state;
|
|
1067
|
+
if (!o) return cn(`${et(e)}: current_state NULL`), -1;
|
|
1068
|
+
let s = q(e, t) && !z(l, t);
|
|
995
1069
|
E++;
|
|
996
|
-
let
|
|
997
|
-
if (!
|
|
998
|
-
if (
|
|
999
|
-
if (1 === C)
|
|
1070
|
+
let i = me(o, t);
|
|
1071
|
+
if (!i) return e.gclass.gmt.mt_inject_event ? (E--, s && (P(1 === C ? n("🔜 %s %s%s %s", t || "", e.running ? "" : "!!", et(e), o.state_name) : n("🔃 mach(%s%s), st: %s, ev: %s, from(%s%s)", e.running ? "" : "!!", et(e), o.state_name, t || "", l && !l.running ? "!!" : "", et(l))), r && s > 1 && Rn(r) && bn(r)), e.gclass.gmt.mt_inject_event(e, t, r, l)) : (s && P(n("📛 mach(%s%s^%s), st: %s, ev: %s, 📛📛ERROR Event NOT DEFINED in state📛📛, from(%s%s^%s)", e.running ? "" : "!!", Ze(e), Xe(e), o.state_name, t || "", l && !l.running ? "!!" : "", Ze(l), Xe(l))), cn(`📛📛 Event NOT DEFINED in state 📛📛: ${et(e)}, ${o.state_name}, ${t}`), E--, -1);
|
|
1072
|
+
if (s) {
|
|
1073
|
+
if (1 === C) P(n("🔄 %s %s%s %s from %s%s", t || "", e.running ? "" : "!!", et(e), o.state_name, l && !l.running ? "!!" : "", et(l)));
|
|
1000
1074
|
else {
|
|
1001
1075
|
let r = "";
|
|
1002
|
-
|
|
1076
|
+
i.action && (r = Nr(i.action)), P(n("🔄 mach(%s%s^%s), st: %s, ev: %s%s%s, ac: %s, from(%s%s^%s)", e.running ? "" : "!!", Ze(e), Xe(e), o.state_name, "", t || "", "", r, l && !l.running ? "!!" : "", Ze(l), Xe(l)));
|
|
1003
1077
|
}
|
|
1004
|
-
r && (
|
|
1078
|
+
r && H(e) && Rn(r) && bn(r);
|
|
1005
1079
|
}
|
|
1006
|
-
|
|
1080
|
+
i.next_state && At(e, i.next_state);
|
|
1007
1081
|
let _ = -1;
|
|
1008
1082
|
try {
|
|
1009
|
-
|
|
1083
|
+
i.action && (_ = i.action(e, t, r, l));
|
|
1010
1084
|
} finally {}
|
|
1011
|
-
return !
|
|
1085
|
+
return !s || 1 === C || e.obflag & R.obflag_destroyed || P(n("<- mach(%s%s^%s), st: %s, ev: %s, ret: %d", e.running ? "" : "!!", Ze(e), Xe(e), e.current_state.state_name, t || "", Cn(_) ? _ : 0)), E--, _;
|
|
1012
1086
|
}
|
|
1013
|
-
var
|
|
1087
|
+
var Gt = Object.freeze({
|
|
1014
1088
|
__hard_subscription__: 1,
|
|
1015
1089
|
__own_event__: 2
|
|
1016
|
-
}),
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1090
|
+
}), Vt = [
|
|
1091
|
+
j(h.DTP_POINTER, "publisher", 0, null, "publisher gobj"),
|
|
1092
|
+
j(h.DTP_POINTER, "subscriber", 0, null, "subscriber gobj"),
|
|
1093
|
+
j(h.DTP_STRING, "event", 0, "", "event name subscribed"),
|
|
1094
|
+
j(h.DTP_STRING, "renamed_event", 0, "", "rename event name"),
|
|
1095
|
+
j(h.DTP_INTEGER, "subs_flag", 0, 0, "subscription flag"),
|
|
1096
|
+
j(h.DTP_JSON, "__config__", 0, null, "subscription config"),
|
|
1097
|
+
j(h.DTP_JSON, "__global__", 0, null, "global kw, merge in publishing"),
|
|
1098
|
+
j(h.DTP_JSON, "__local__", 0, null, "local kw, remove in publishing"),
|
|
1099
|
+
j(h.DTP_JSON, "__filter__", 0, null, "filter kw, filter in publishing"),
|
|
1100
|
+
j(h.DTP_STRING, "__service__", 0, "", "subscription service"),
|
|
1101
|
+
v()
|
|
1028
1102
|
];
|
|
1029
|
-
function
|
|
1030
|
-
let
|
|
1031
|
-
if (t && t !==
|
|
1032
|
-
let t =
|
|
1033
|
-
|
|
1103
|
+
function Mt(e, t, n, r, l) {
|
|
1104
|
+
let o = Xn(t, r, "__config__", null), s = Xn(t, r, "__global__", null), i = Xn(t, r, "__local__", null), _ = Zn(t, r, "__filter__", null), a = !0;
|
|
1105
|
+
if (t && t !== Qn(null, e, "publisher", null) && (a = !1), l && l !== Qn(null, e, "subscriber", null) && (a = !1), n && n !== zn(null, e, "event", "") && (a = !1), An(o) > 0) {
|
|
1106
|
+
let t = Xn(null, e, "__config__", null);
|
|
1107
|
+
An(t) > 0 && mn(t, o) || (a = !1);
|
|
1034
1108
|
}
|
|
1035
|
-
if (
|
|
1036
|
-
let t =
|
|
1037
|
-
|
|
1109
|
+
if (An(s) > 0) {
|
|
1110
|
+
let t = Xn(null, e, "__global__", null);
|
|
1111
|
+
An(t) > 0 && mn(t, s) || (a = !1);
|
|
1038
1112
|
}
|
|
1039
|
-
if (
|
|
1040
|
-
let t =
|
|
1041
|
-
|
|
1113
|
+
if (An(i) > 0) {
|
|
1114
|
+
let t = Xn(null, e, "__local__", null);
|
|
1115
|
+
An(t) > 0 && mn(t, i) || (a = !1);
|
|
1042
1116
|
}
|
|
1043
|
-
if (
|
|
1044
|
-
let t =
|
|
1045
|
-
|
|
1117
|
+
if (An(_) > 0) {
|
|
1118
|
+
let t = Zn(null, e, "__filter__", null);
|
|
1119
|
+
An(t) > 0 && mn(t, _) || (a = !1);
|
|
1046
1120
|
}
|
|
1047
1121
|
return a;
|
|
1048
1122
|
}
|
|
1049
|
-
function
|
|
1050
|
-
let
|
|
1051
|
-
for (let
|
|
1052
|
-
let
|
|
1053
|
-
|
|
1123
|
+
function Wt(e, t, n, r, l) {
|
|
1124
|
+
let o = [];
|
|
1125
|
+
for (let s = 0; s < e.length; s++) {
|
|
1126
|
+
let i = e[s];
|
|
1127
|
+
Mt(i, t, n, r, l) && On(o, i);
|
|
1054
1128
|
}
|
|
1055
|
-
return
|
|
1129
|
+
return o;
|
|
1056
1130
|
}
|
|
1057
|
-
function
|
|
1058
|
-
for (let
|
|
1131
|
+
function Kt(e, t, n, r, l) {
|
|
1132
|
+
for (let o = 0; o < e.length; o++) if (Mt(e[o], t, n, r, l)) return o;
|
|
1059
1133
|
return -1;
|
|
1060
1134
|
}
|
|
1061
|
-
function
|
|
1062
|
-
let
|
|
1063
|
-
if (!!(
|
|
1064
|
-
|
|
1065
|
-
let _ =
|
|
1066
|
-
return _ >= 0 ?
|
|
1067
|
-
}
|
|
1068
|
-
function
|
|
1069
|
-
if (null == r && (r = {}), !e) return
|
|
1070
|
-
if (!
|
|
1071
|
-
const
|
|
1135
|
+
function xt(e, t, r, l) {
|
|
1136
|
+
let o = Qn(e, t, "publisher", null, zt.KW_REQUIRED), s = Qn(e, t, "subscriber", null, zt.KW_REQUIRED), i = zn(e, t, "event", "", zt.KW_REQUIRED);
|
|
1137
|
+
if (!!(qn(e, t, "subs_flag", null, zt.KW_REQUIRED) & Gt.__hard_subscription__) && !r) return -1;
|
|
1138
|
+
(B(s) || B(o)) && (P(n("💜💜👎 unsubscribing event '%s': publisher %s, subscriber'%s'", i || "", et(o), et(s))), bn(t)), o.obflag & R.obflag_destroyed || l || o.gclass.gmt.mt_subscription_deleted && o.gclass.gmt.mt_subscription_deleted(o, t);
|
|
1139
|
+
let _ = Kt(o.dl_subscriptions, o, i, t, s);
|
|
1140
|
+
return _ >= 0 ? Nn(o.dl_subscriptions, _) : (cn(`${et(e)}: subscription in publisher not found`), bn(t)), _ = Kt(s.dl_subscribings, o, i, t, s), _ >= 0 ? Nn(s.dl_subscribings, _) : (cn(`${et(e)}: subscription in subscriber not found`), bn(t)), 0;
|
|
1141
|
+
}
|
|
1142
|
+
function Yt(e, t, r, l) {
|
|
1143
|
+
if (null == r && (r = {}), !e) return cn(`publisher NULL: ev ${t}`), 0;
|
|
1144
|
+
if (!l) return cn(`subscriber NULL: ev ${t}`), 0;
|
|
1145
|
+
const o = /* @__PURE__ */ new Set([
|
|
1072
1146
|
"__config__",
|
|
1073
1147
|
"__global__",
|
|
1074
1148
|
"__local__",
|
|
@@ -1076,90 +1150,90 @@ var gobjJs = function(e) {
|
|
|
1076
1150
|
"__service__"
|
|
1077
1151
|
]);
|
|
1078
1152
|
if (Object.keys(r).forEach((n) => {
|
|
1079
|
-
|
|
1080
|
-
}),
|
|
1081
|
-
else if (!(
|
|
1082
|
-
let
|
|
1083
|
-
|
|
1084
|
-
let
|
|
1085
|
-
let
|
|
1086
|
-
|
|
1087
|
-
let
|
|
1153
|
+
o.has(n) || cn(`${et(e)}: key ignored in subscription (key: ${n}, event: ${t})`);
|
|
1154
|
+
}), Gn(t)) t = "";
|
|
1155
|
+
else if (!(Ct(e, t, D.EVF_OUTPUT_EVENT) || e.gclass.gclass_flag & w.gcflag_no_check_output_events)) return cn(`event NOT in output event list: ${et(e)}, ${t}`), 0;
|
|
1156
|
+
let s = Wt(e.dl_subscriptions, e, t, r, l);
|
|
1157
|
+
Dn(s) > 0 && (cn(`${et(e)}: ${Dn(s)} subscription(s) REPEATED, will be deleted and override`), bn(s, "subscription REPEATED"), Bt(e, s, !1));
|
|
1158
|
+
let i = function(e, t, n, r) {
|
|
1159
|
+
let l = _e(e, Vt);
|
|
1160
|
+
Sn(l, "event", t), Sn(l, "subscriber", r), Sn(l, "publisher", e);
|
|
1161
|
+
let o = 0;
|
|
1088
1162
|
if (n) {
|
|
1089
|
-
let t =
|
|
1090
|
-
if (
|
|
1091
|
-
let n =
|
|
1092
|
-
if (
|
|
1093
|
-
let t =
|
|
1094
|
-
|
|
1163
|
+
let t = Xn(e, n, "__config__", null), r = Xn(e, n, "__global__", null), s = Xn(e, n, "__local__", null), i = Zn(e, n, "__filter__", null), _ = zn(e, n, "__service__", "");
|
|
1164
|
+
if (An(r) > 0 && Sn(l, "__global__", pn(r)), An(t) > 0) {
|
|
1165
|
+
let n = pn(t);
|
|
1166
|
+
if (Sn(l, "__config__", n), Yn(n, "__hard_subscription__")) {
|
|
1167
|
+
let t = Hn(e, n, "__hard_subscription__", !1);
|
|
1168
|
+
vn(n, "__hard_subscription__"), t && (o |= Gt.__hard_subscription__);
|
|
1095
1169
|
}
|
|
1096
|
-
if (
|
|
1097
|
-
let t =
|
|
1098
|
-
|
|
1170
|
+
if (Yn(n, "__own_event__")) {
|
|
1171
|
+
let t = Hn(e, n, "__own_event__", !1);
|
|
1172
|
+
vn(n, "__own_event__"), t && (o |= Gt.__own_event__);
|
|
1099
1173
|
}
|
|
1100
1174
|
}
|
|
1101
|
-
|
|
1175
|
+
An(s) > 0 && Sn(l, "__local__", pn(s)), An(i) > 0 && Sn(l, "__filter__", pn(i)), Gn(_) || Sn(l, "__service__", _);
|
|
1102
1176
|
}
|
|
1103
|
-
return
|
|
1104
|
-
}(e, t, r,
|
|
1105
|
-
if (!
|
|
1106
|
-
if (
|
|
1107
|
-
let t = e.gclass.gmt.mt_subscription_added(e,
|
|
1108
|
-
(t < 0 || !1 === t) && (
|
|
1177
|
+
return Sn(l, "subs_flag", o), l;
|
|
1178
|
+
}(e, t, r, l);
|
|
1179
|
+
if (!i) return cn(`${et(e)}: _create_subscription() FAILED`), 0;
|
|
1180
|
+
if (On(e.dl_subscriptions, i), On(l.dl_subscribings, i), (B(l) || B(e)) && (P(n("💜💜👍 subscribing event '%s', publisher '%s', subscriber %s", t || "", et(e), et(l))), r && bn(r)), e.gclass.gmt.mt_subscription_added) {
|
|
1181
|
+
let t = e.gclass.gmt.mt_subscription_added(e, i);
|
|
1182
|
+
(t < 0 || !1 === t) && (xt(e, i, !0, !0), i = 0);
|
|
1109
1183
|
}
|
|
1110
|
-
return
|
|
1184
|
+
return i;
|
|
1111
1185
|
}
|
|
1112
|
-
function
|
|
1186
|
+
function Bt(e, t, n) {
|
|
1113
1187
|
let r = [...t];
|
|
1114
|
-
for (let t = 0; t < r.length; t++)
|
|
1188
|
+
for (let t = 0; t < r.length; t++) xt(e, r[t], n, !1);
|
|
1115
1189
|
return 0;
|
|
1116
1190
|
}
|
|
1117
|
-
function
|
|
1118
|
-
return null == n && (n = {}),
|
|
1191
|
+
function Jt(e, t, n, r) {
|
|
1192
|
+
return null == n && (n = {}), Wt(e.dl_subscriptions, e, t, n, r);
|
|
1119
1193
|
}
|
|
1120
|
-
function
|
|
1121
|
-
return
|
|
1194
|
+
function Ht(e, t, n, r) {
|
|
1195
|
+
return Wt(e.dl_subscribings, r, t, n, e);
|
|
1122
1196
|
}
|
|
1123
|
-
function
|
|
1124
|
-
if (
|
|
1125
|
-
if (
|
|
1126
|
-
let
|
|
1127
|
-
if (!(
|
|
1128
|
-
let
|
|
1129
|
-
if (
|
|
1197
|
+
function qt(e, t, r) {
|
|
1198
|
+
if (kn(r) || (r = {}), !e || e.obflag & (R.obflag_destroyed | R.obflag_destroying)) return cn("gobj NULL or DESTROYED"), -1;
|
|
1199
|
+
if (Gn(t)) return cn(`${et(e)}: event EMPTY`), -1;
|
|
1200
|
+
let l = $t(e, t, !0);
|
|
1201
|
+
if (!(l && l.event_flag & (D.EVF_SYSTEM_EVENT | D.EVF_OUTPUT_EVENT) || e.gclass.gclass_flag & w.gcflag_no_check_output_events)) return cn(`event NOT in output event list: ${et(e)}, ev ${t}`), -1;
|
|
1202
|
+
let o = (B(e) || q(e, t)) && !z(e, t);
|
|
1203
|
+
if (o && (P(1 === C ? n("🔝🔝 %s %s%s %s", t || "", e.running ? "" : "!!", et(e), e.current_state.state_name) : n("🔝🔝 mach(%s%s^%s), st: %s, ev: %s%s%s", e.running ? "" : "!!", Ze(e), Xe(e), e.current_state.state_name, "", t || "", "")), Rn(r) && bn(r)), e.gclass.gmt.mt_publish_event) {
|
|
1130
1204
|
let n = e.gclass.gmt.mt_publish_event(e, t, r);
|
|
1131
1205
|
if (n <= 0) return n;
|
|
1132
1206
|
}
|
|
1133
|
-
let
|
|
1134
|
-
for (let
|
|
1135
|
-
let a = l
|
|
1207
|
+
let s = [...e.dl_subscriptions], i = 0, _ = 0;
|
|
1208
|
+
for (let l = 0; l < s.length; l++) {
|
|
1209
|
+
let a = s[l];
|
|
1136
1210
|
if (e.gclass.gmt.mt_publication_pre_filter) {
|
|
1137
1211
|
let n = e.gclass.gmt.mt_publication_pre_filter(e, a, t, r);
|
|
1138
1212
|
if (n < 0) break;
|
|
1139
1213
|
if (!n) continue;
|
|
1140
1214
|
}
|
|
1141
|
-
let u =
|
|
1142
|
-
if (!u ||
|
|
1143
|
-
let c =
|
|
1144
|
-
if (
|
|
1145
|
-
|
|
1146
|
-
let
|
|
1147
|
-
if (e.gclass.gmt.mt_publication_filter ? d = e.gclass.gmt.mt_publication_filter(e, t, g, u) :
|
|
1215
|
+
let u = Qn(e, a, "subscriber", null, zt.KW_REQUIRED);
|
|
1216
|
+
if (!u || ot(u)) continue;
|
|
1217
|
+
let c = qn(e, a, "subs_flag", 0, zt.KW_REQUIRED), f = zn(e, a, "event", "", zt.KW_REQUIRED);
|
|
1218
|
+
if (Gn(f) || 0 === Wn(f, t)) {
|
|
1219
|
+
Xn(e, a, "__config__", null, 0);
|
|
1220
|
+
let l = Xn(e, a, "__global__", null, 0), s = Xn(e, a, "__local__", null, 0), f = Zn(e, a, "__filter__", null, 0), g = r, d = 1;
|
|
1221
|
+
if (e.gclass.gmt.mt_publication_filter ? d = e.gclass.gmt.mt_publication_filter(e, t, g, u) : An(f) > 0 && (d = rr(g, f) ? 1 : 0, o && (P(n("💜💜🔄%s publishing with filter, event '%s', subscriber'%s', publisher %s", d ? "👍" : "👎", t || "", et(u), et(e))), bn(f))), d < 0) break;
|
|
1148
1222
|
if (!d) continue;
|
|
1149
|
-
let b =
|
|
1150
|
-
if (b && b.event_flag & D.EVF_SYSTEM_EVENT && !
|
|
1151
|
-
|
|
1152
|
-
let p =
|
|
1153
|
-
if (p < 0 && c &
|
|
1154
|
-
|
|
1223
|
+
let b = $t(u, t, !0);
|
|
1224
|
+
if (b && b.event_flag & D.EVF_SYSTEM_EVENT && !It(u, b.event_name, 0)) continue;
|
|
1225
|
+
s && xn(g, s), l && En(g, l), o && (P(1 === C ? n("🔝🔄 %s (%s) %s%s", t || "", t || "", u.running ? "" : "!!", et(u)) : n("🔝🔄 mach(%s%s), st: %s, ev: %s, from(%s%s)", u.running ? "" : "!!", et(u), kt(u), t || "", e && !e.running ? "!!" : "", et(e))), Rn(g) && bn(g));
|
|
1226
|
+
let p = Ft(u, t, g, e);
|
|
1227
|
+
if (p < 0 && c & Gt.__own_event__) {
|
|
1228
|
+
i = -1;
|
|
1155
1229
|
break;
|
|
1156
1230
|
}
|
|
1157
|
-
if (_ += p,
|
|
1231
|
+
if (_ += p, i++, ot(e)) break;
|
|
1158
1232
|
}
|
|
1159
1233
|
}
|
|
1160
|
-
return
|
|
1234
|
+
return i || l && l.event_flag & D.EVF_NO_WARN_SUBS || fn(`${et(e)}: Publish event WITHOUT subscribers, ev ${t}`), _;
|
|
1161
1235
|
}
|
|
1162
|
-
var
|
|
1236
|
+
var zt = Object.freeze({
|
|
1163
1237
|
KW_REQUIRED: 1,
|
|
1164
1238
|
KW_CREATE: 2,
|
|
1165
1239
|
KW_WILD_NUMBER: 4,
|
|
@@ -1179,33 +1253,33 @@ var gobjJs = function(e) {
|
|
|
1179
1253
|
JSON_FALSE: 7,
|
|
1180
1254
|
JSON_NULL: 8
|
|
1181
1255
|
});
|
|
1182
|
-
var
|
|
1183
|
-
var
|
|
1184
|
-
var
|
|
1185
|
-
function
|
|
1186
|
-
if (!
|
|
1187
|
-
if (!
|
|
1256
|
+
var Qt = "undefined" != typeof window ? window.console : console, Xt = Qt.error, Zt = Qt.warn, en = Qt.info, tn = Qt.debug, nn = null;
|
|
1257
|
+
var rn = !0;
|
|
1258
|
+
var ln = null;
|
|
1259
|
+
function on(e, t) {
|
|
1260
|
+
if (!rn) return !1;
|
|
1261
|
+
if (!ln) return !0;
|
|
1188
1262
|
try {
|
|
1189
|
-
return !!
|
|
1263
|
+
return !!ln(e, t);
|
|
1190
1264
|
} catch (e) {
|
|
1191
1265
|
return !0;
|
|
1192
1266
|
}
|
|
1193
1267
|
}
|
|
1194
|
-
var
|
|
1195
|
-
function
|
|
1196
|
-
if (
|
|
1197
|
-
|
|
1268
|
+
var sn = !1;
|
|
1269
|
+
function _n(e, t, n) {
|
|
1270
|
+
if (nn && !sn) {
|
|
1271
|
+
sn = !0;
|
|
1198
1272
|
try {
|
|
1199
|
-
|
|
1273
|
+
nn(e, t, n);
|
|
1200
1274
|
} catch (e) {} finally {
|
|
1201
|
-
|
|
1275
|
+
sn = !1;
|
|
1202
1276
|
}
|
|
1203
1277
|
}
|
|
1204
1278
|
}
|
|
1205
|
-
function
|
|
1206
|
-
e ? (
|
|
1279
|
+
function an(e) {
|
|
1280
|
+
e ? (Xt = e, Zt = e) : (Xt = Qt.error, Zt = Qt.warn);
|
|
1207
1281
|
}
|
|
1208
|
-
function
|
|
1282
|
+
function un(e) {
|
|
1209
1283
|
const t = Array.prototype.slice.call(arguments);
|
|
1210
1284
|
let n = "";
|
|
1211
1285
|
if ("string" == typeof e) {
|
|
@@ -1222,349 +1296,349 @@ var gobjJs = function(e) {
|
|
|
1222
1296
|
default: return e;
|
|
1223
1297
|
}
|
|
1224
1298
|
});
|
|
1225
|
-
const
|
|
1226
|
-
|
|
1299
|
+
const l = t.slice(r).map((e) => "object" == typeof e ? JSON.stringify(e) : String(e));
|
|
1300
|
+
l.length > 0 && (n += " " + l.join(" "));
|
|
1227
1301
|
} else n = t.map((e) => "object" == typeof e ? JSON.stringify(e) : String(e)).join(" ");
|
|
1228
1302
|
return n;
|
|
1229
1303
|
}
|
|
1230
|
-
function
|
|
1231
|
-
let t =
|
|
1232
|
-
|
|
1304
|
+
function cn(e) {
|
|
1305
|
+
let t = un(e), n = Sr();
|
|
1306
|
+
Xt && (Xt === Qt.error ? on("error", t) && Xt("%c" + n + " ERROR: " + String(t), "color:red") : (on("error", t) && Qt.error("%c" + n + " ERROR: " + String(t), "color:red"), Xt(`${n} ERROR: ${String(t)}`))), _n("error", t, n);
|
|
1233
1307
|
}
|
|
1234
|
-
function
|
|
1235
|
-
let t =
|
|
1236
|
-
|
|
1308
|
+
function fn(e) {
|
|
1309
|
+
let t = un(e), n = Sr();
|
|
1310
|
+
Zt && (Zt === Qt.warn ? on("warning", t) && Zt("%c" + n + " WARNING: " + String(t), "color:yellow") : (on("warning", t) && Qt.warn("%c" + n + " WARNING: " + String(t), "color:yellow"), Zt(`${n} WARNING: ${String(t)}`))), _n("warning", t, n);
|
|
1237
1311
|
}
|
|
1238
|
-
function
|
|
1239
|
-
let t =
|
|
1240
|
-
|
|
1312
|
+
function gn(e) {
|
|
1313
|
+
let t = un(e), n = Sr();
|
|
1314
|
+
tn && on("debug", t) && tn("%c" + n + " DEBUG: " + String(t), "color:silver"), _n("debug", t, n);
|
|
1241
1315
|
}
|
|
1242
|
-
function
|
|
1243
|
-
let t =
|
|
1244
|
-
|
|
1316
|
+
function dn(e) {
|
|
1317
|
+
let t = un(e), n = Sr();
|
|
1318
|
+
tn && on("msg", t) && tn("%c" + n + " MSG: " + String(t), "color:cyan"), _n("msg", t, n);
|
|
1245
1319
|
}
|
|
1246
|
-
function
|
|
1247
|
-
|
|
1320
|
+
function bn(e, t) {
|
|
1321
|
+
on("json", t) && (t && window.console.warn("=====> " + t), window.console.dir(e)), _n("json", e, Sr());
|
|
1248
1322
|
}
|
|
1249
|
-
function
|
|
1323
|
+
function pn(e) {
|
|
1250
1324
|
return structuredClone(e);
|
|
1251
1325
|
}
|
|
1252
|
-
function
|
|
1326
|
+
function mn(e, t) {
|
|
1253
1327
|
if (e === t) return !0;
|
|
1254
1328
|
if (null === e || null === t) return e === t;
|
|
1255
1329
|
if (typeof e != typeof t) return !1;
|
|
1256
1330
|
if (Array.isArray(e) !== Array.isArray(t)) return !1;
|
|
1257
1331
|
if (Array.isArray(e)) {
|
|
1258
1332
|
if (e.length !== t.length) return !1;
|
|
1259
|
-
for (let n = 0; n < e.length; n++) if (!
|
|
1333
|
+
for (let n = 0; n < e.length; n++) if (!mn(e[n], t[n])) return !1;
|
|
1260
1334
|
return !0;
|
|
1261
1335
|
}
|
|
1262
1336
|
if ("object" == typeof e) {
|
|
1263
1337
|
let n = Object.keys(e).sort(), r = Object.keys(t).sort();
|
|
1264
1338
|
if (n.length !== r.length) return !1;
|
|
1265
|
-
for (let
|
|
1266
|
-
if (n[
|
|
1267
|
-
if (!
|
|
1339
|
+
for (let l = 0; l < n.length; l++) {
|
|
1340
|
+
if (n[l] !== r[l]) return !1;
|
|
1341
|
+
if (!mn(e[n[l]], t[r[l]])) return !1;
|
|
1268
1342
|
}
|
|
1269
1343
|
return !0;
|
|
1270
1344
|
}
|
|
1271
1345
|
return e === t;
|
|
1272
1346
|
}
|
|
1273
|
-
function
|
|
1347
|
+
function En(e, t) {
|
|
1274
1348
|
if (!t) return e;
|
|
1275
1349
|
for (let n of Object.keys(t)) e[n] = t[n];
|
|
1276
1350
|
return e;
|
|
1277
1351
|
}
|
|
1278
|
-
function
|
|
1352
|
+
function hn(e, t) {
|
|
1279
1353
|
if (!t) return e;
|
|
1280
1354
|
for (let n in t) t.hasOwnProperty(n) && e.hasOwnProperty(n) && (e[n] = t[n]);
|
|
1281
1355
|
return e;
|
|
1282
1356
|
}
|
|
1283
|
-
function
|
|
1357
|
+
function Tn(e, t) {
|
|
1284
1358
|
if (!t) return e;
|
|
1285
1359
|
for (let n in t) t.hasOwnProperty(n) && !e.hasOwnProperty(n) && (e[n] = t[n]);
|
|
1286
1360
|
return e;
|
|
1287
1361
|
}
|
|
1288
|
-
function
|
|
1362
|
+
function yn(e, t) {
|
|
1289
1363
|
if (e && e.hasOwnProperty(t)) return e[t];
|
|
1290
1364
|
}
|
|
1291
|
-
function
|
|
1365
|
+
function vn(e, t) {
|
|
1292
1366
|
e && e.hasOwnProperty(t) && delete e[t];
|
|
1293
1367
|
}
|
|
1294
|
-
function
|
|
1368
|
+
function jn(e, t, n) {
|
|
1295
1369
|
e[t] = n;
|
|
1296
1370
|
}
|
|
1297
|
-
function
|
|
1371
|
+
function Sn(e, t, n) {
|
|
1298
1372
|
e[t] = n;
|
|
1299
1373
|
}
|
|
1300
|
-
function
|
|
1374
|
+
function On(e, t) {
|
|
1301
1375
|
e.push(t);
|
|
1302
1376
|
}
|
|
1303
|
-
function
|
|
1377
|
+
function wn(e, t) {
|
|
1304
1378
|
e.push(t);
|
|
1305
1379
|
}
|
|
1306
|
-
function
|
|
1380
|
+
function Nn(e, t) {
|
|
1307
1381
|
e.splice(t, 1);
|
|
1308
1382
|
}
|
|
1309
|
-
function
|
|
1310
|
-
return
|
|
1383
|
+
function Rn(e) {
|
|
1384
|
+
return kn(e) ? Object.keys(e).length : 0;
|
|
1311
1385
|
}
|
|
1312
|
-
function
|
|
1313
|
-
return
|
|
1386
|
+
function Dn(e) {
|
|
1387
|
+
return $n(e) ? e.length : 0;
|
|
1314
1388
|
}
|
|
1315
|
-
function
|
|
1316
|
-
return
|
|
1389
|
+
function An(e) {
|
|
1390
|
+
return kn(e) ? Object.keys(e).length : $n(e) ? e.length : In(e) && e.length > 0 ? 1 : 0;
|
|
1317
1391
|
}
|
|
1318
|
-
function
|
|
1392
|
+
function kn(e) {
|
|
1319
1393
|
return null !== e && "object" == typeof e && !Array.isArray(e);
|
|
1320
1394
|
}
|
|
1321
|
-
function
|
|
1395
|
+
function $n(e) {
|
|
1322
1396
|
return Array.isArray(e);
|
|
1323
1397
|
}
|
|
1324
|
-
function
|
|
1398
|
+
function In(e) {
|
|
1325
1399
|
return "string" == typeof e;
|
|
1326
1400
|
}
|
|
1327
|
-
function
|
|
1401
|
+
function Cn(e) {
|
|
1328
1402
|
return "number" == typeof e && Number.isFinite(e);
|
|
1329
1403
|
}
|
|
1330
|
-
function
|
|
1404
|
+
function Pn(e) {
|
|
1331
1405
|
return "boolean" == typeof e;
|
|
1332
1406
|
}
|
|
1333
|
-
function
|
|
1407
|
+
function Ln(e) {
|
|
1334
1408
|
return null == e;
|
|
1335
1409
|
}
|
|
1336
|
-
function
|
|
1410
|
+
function Un(e) {
|
|
1337
1411
|
return "function" == typeof e;
|
|
1338
1412
|
}
|
|
1339
|
-
function
|
|
1340
|
-
return e instanceof
|
|
1413
|
+
function Fn(e) {
|
|
1414
|
+
return e instanceof O;
|
|
1341
1415
|
}
|
|
1342
|
-
function
|
|
1343
|
-
return !
|
|
1416
|
+
function Gn(e) {
|
|
1417
|
+
return !In(e) || 0 === e.length;
|
|
1344
1418
|
}
|
|
1345
|
-
function
|
|
1346
|
-
return
|
|
1419
|
+
function Vn(e) {
|
|
1420
|
+
return Cn(e) ? Boolean(e) : /^\s*(true|1|on)\s*$/i.test(e);
|
|
1347
1421
|
}
|
|
1348
|
-
function
|
|
1422
|
+
function Mn(e, t) {
|
|
1349
1423
|
return e === t ? 0 : e > t ? 1 : -1;
|
|
1350
1424
|
}
|
|
1351
|
-
function
|
|
1425
|
+
function Wn(e, t) {
|
|
1352
1426
|
let n = e.toLowerCase(), r = t.toLowerCase();
|
|
1353
1427
|
return n === r ? 0 : n > r ? 1 : -1;
|
|
1354
1428
|
}
|
|
1355
|
-
function
|
|
1356
|
-
if (
|
|
1357
|
-
if (
|
|
1429
|
+
function Kn(e, t) {
|
|
1430
|
+
if (kn(e) || kn(t) || $n(e) || $n(t)) return 0;
|
|
1431
|
+
if (Cn(e) || Cn(t)) {
|
|
1358
1432
|
let n = Number(e), r = Number(t);
|
|
1359
1433
|
return n > r ? 1 : n < r ? -1 : 0;
|
|
1360
1434
|
}
|
|
1361
|
-
if (
|
|
1435
|
+
if (Pn(e) || Pn(t)) {
|
|
1362
1436
|
let n = Number(e), r = Number(t);
|
|
1363
1437
|
return n > r ? 1 : n < r ? -1 : 0;
|
|
1364
1438
|
}
|
|
1365
|
-
return
|
|
1439
|
+
return Mn(String(e), String(t));
|
|
1366
1440
|
}
|
|
1367
|
-
function
|
|
1368
|
-
if ("object" != typeof t || Array.isArray(t)) if (Array.isArray(t)) for (const n of t)
|
|
1441
|
+
function xn(e, t) {
|
|
1442
|
+
if ("object" != typeof t || Array.isArray(t)) if (Array.isArray(t)) for (const n of t) xn(e, n);
|
|
1369
1443
|
else "string" == typeof t && delete e[t];
|
|
1370
1444
|
else for (const n of Object.keys(t)) delete e[n];
|
|
1371
1445
|
}
|
|
1372
|
-
function
|
|
1446
|
+
function Yn(e, t) {
|
|
1373
1447
|
return !(!(t in e) || !e.hasOwnProperty(t));
|
|
1374
1448
|
}
|
|
1375
|
-
function
|
|
1376
|
-
if (e && !
|
|
1377
|
-
if (!
|
|
1378
|
-
let
|
|
1379
|
-
if (
|
|
1380
|
-
let
|
|
1381
|
-
for (let
|
|
1449
|
+
function Bn(e, t, n, r) {
|
|
1450
|
+
if (e && !Fn(e) && cn("GObj bad instanceof"), !kn(t) && !$n(t)) return cn(`${et(e)}: kw must be list or dict`), 0;
|
|
1451
|
+
if (!In(n)) return cn(`${et(e)}: path must be a string: ${String(n)}`), 0;
|
|
1452
|
+
let l = n.split("`");
|
|
1453
|
+
if (l.length <= 1) return t[n];
|
|
1454
|
+
let o = l.length;
|
|
1455
|
+
for (let s = 0; s < o; s++) if (void 0 === (t = t[l[s]])) return void (r && cn(`${et(e)}: path not found: ${String(n)}`));
|
|
1382
1456
|
return t;
|
|
1383
1457
|
}
|
|
1384
|
-
function
|
|
1385
|
-
e && !
|
|
1386
|
-
let [r,
|
|
1458
|
+
function Jn(e, t, n) {
|
|
1459
|
+
e && !Fn(e) && cn("GObj bad instanceof");
|
|
1460
|
+
let [r, l] = function(e, t) {
|
|
1387
1461
|
let n = e.lastIndexOf(t);
|
|
1388
1462
|
return -1 === n ? [e, ""] : [e.substring(0, n), e.substring(n + 1)];
|
|
1389
1463
|
}(n, "`");
|
|
1390
|
-
return
|
|
1391
|
-
}
|
|
1392
|
-
function
|
|
1393
|
-
e && !
|
|
1394
|
-
let
|
|
1395
|
-
const
|
|
1396
|
-
if (void 0 ===
|
|
1397
|
-
if (
|
|
1398
|
-
let
|
|
1399
|
-
return
|
|
1464
|
+
return Gn(l) ? vn(t, n) : vn(Bn(e, t, r, !0), l), 0;
|
|
1465
|
+
}
|
|
1466
|
+
function Hn(e, t, n, r, l) {
|
|
1467
|
+
e && !Fn(e) && cn("GObj bad instanceof");
|
|
1468
|
+
let o = Bn(e, t, n, !1);
|
|
1469
|
+
const s = l && l & zt.KW_REQUIRED, i = l && l & zt.KW_CREATE, _ = l && l & zt.KW_EXTRACT;
|
|
1470
|
+
if (void 0 === o) {
|
|
1471
|
+
if (i) {
|
|
1472
|
+
let l = Boolean(r);
|
|
1473
|
+
return er(e, t, n, l), l;
|
|
1400
1474
|
}
|
|
1401
|
-
return
|
|
1402
|
-
}
|
|
1403
|
-
return _ &&
|
|
1404
|
-
}
|
|
1405
|
-
function
|
|
1406
|
-
e && !
|
|
1407
|
-
let
|
|
1408
|
-
const
|
|
1409
|
-
if (void 0 ===
|
|
1410
|
-
if (
|
|
1411
|
-
let
|
|
1412
|
-
return
|
|
1475
|
+
return s && (cn(`path not found: '${n}'`), bn(t)), Boolean(r);
|
|
1476
|
+
}
|
|
1477
|
+
return _ && Jn(e, t, n), Boolean(o);
|
|
1478
|
+
}
|
|
1479
|
+
function qn(e, t, n, r, l) {
|
|
1480
|
+
e && !Fn(e) && cn("GObj bad instanceof");
|
|
1481
|
+
let o = Bn(e, t, n, !1);
|
|
1482
|
+
const s = l && l & zt.KW_REQUIRED, i = l && l & zt.KW_CREATE, _ = l && l & zt.KW_EXTRACT;
|
|
1483
|
+
if (void 0 === o) {
|
|
1484
|
+
if (i) {
|
|
1485
|
+
let l = parseInt(r);
|
|
1486
|
+
return er(e, t, n, l), l;
|
|
1413
1487
|
}
|
|
1414
|
-
return
|
|
1415
|
-
}
|
|
1416
|
-
return _ &&
|
|
1417
|
-
}
|
|
1418
|
-
function
|
|
1419
|
-
e && !
|
|
1420
|
-
let
|
|
1421
|
-
const
|
|
1422
|
-
if (void 0 ===
|
|
1423
|
-
if (
|
|
1424
|
-
let
|
|
1425
|
-
return
|
|
1488
|
+
return s && (cn(`path not found: '${n}'`), bn(t)), parseInt(r);
|
|
1489
|
+
}
|
|
1490
|
+
return _ && Jn(e, t, n), Cn(o) ? parseInt(o) : (s && (cn(`path value MUST BE a number: ${n}`), dn(t)), parseInt(r));
|
|
1491
|
+
}
|
|
1492
|
+
function zn(e, t, n, r, l) {
|
|
1493
|
+
e && !Fn(e) && cn("GObj bad instanceof");
|
|
1494
|
+
let o = Bn(e, t, n, !1);
|
|
1495
|
+
const s = l && l & zt.KW_REQUIRED, i = l && l & zt.KW_CREATE, _ = l && l & zt.KW_EXTRACT;
|
|
1496
|
+
if (void 0 === o) {
|
|
1497
|
+
if (i) {
|
|
1498
|
+
let l = String(r);
|
|
1499
|
+
return er(e, t, n, l), l;
|
|
1426
1500
|
}
|
|
1427
|
-
return
|
|
1428
|
-
}
|
|
1429
|
-
return _ &&
|
|
1430
|
-
}
|
|
1431
|
-
function
|
|
1432
|
-
e && !
|
|
1433
|
-
let
|
|
1434
|
-
const
|
|
1435
|
-
if (void 0 ===
|
|
1436
|
-
if (
|
|
1437
|
-
let
|
|
1438
|
-
return
|
|
1501
|
+
return s && (cn(`path not found: '${n}'`), bn(t)), String(r);
|
|
1502
|
+
}
|
|
1503
|
+
return _ && Jn(e, t, n), In(o) ? String(o) : (s && (cn(`${et(e)}: path value MUST BE a string: ${n}`), dn(t)), String(r));
|
|
1504
|
+
}
|
|
1505
|
+
function Qn(e, t, n, r, l) {
|
|
1506
|
+
e && !Fn(e) && cn("GObj bad instanceof");
|
|
1507
|
+
let o = Bn(e, t, n, !1);
|
|
1508
|
+
const s = l && l & zt.KW_REQUIRED, i = l && l & zt.KW_CREATE, _ = l && l & zt.KW_EXTRACT;
|
|
1509
|
+
if (void 0 === o) {
|
|
1510
|
+
if (i) {
|
|
1511
|
+
let l = r;
|
|
1512
|
+
return er(e, t, n, l), l;
|
|
1439
1513
|
}
|
|
1440
|
-
return
|
|
1441
|
-
}
|
|
1442
|
-
return _ &&
|
|
1443
|
-
}
|
|
1444
|
-
function
|
|
1445
|
-
e && !
|
|
1446
|
-
let
|
|
1447
|
-
const
|
|
1448
|
-
if (void 0 ===
|
|
1449
|
-
if (
|
|
1450
|
-
let
|
|
1451
|
-
return
|
|
1514
|
+
return s && (cn(`path not found: '${n}'`), bn(t)), r;
|
|
1515
|
+
}
|
|
1516
|
+
return _ && Jn(e, t, n), o;
|
|
1517
|
+
}
|
|
1518
|
+
function Xn(e, t, n, r, l) {
|
|
1519
|
+
e && !Fn(e) && cn("GObj bad instanceof");
|
|
1520
|
+
let o = Bn(e, t, n, !1);
|
|
1521
|
+
const s = l && l & zt.KW_REQUIRED, i = l && l & zt.KW_CREATE, _ = l && l & zt.KW_EXTRACT;
|
|
1522
|
+
if (void 0 === o) {
|
|
1523
|
+
if (i) {
|
|
1524
|
+
let l = Object(r);
|
|
1525
|
+
return er(e, t, n, l), l;
|
|
1452
1526
|
}
|
|
1453
|
-
return
|
|
1454
|
-
}
|
|
1455
|
-
return _ &&
|
|
1456
|
-
}
|
|
1457
|
-
function
|
|
1458
|
-
e && !
|
|
1459
|
-
let
|
|
1460
|
-
const
|
|
1461
|
-
if (void 0 ===
|
|
1462
|
-
if (
|
|
1463
|
-
let
|
|
1464
|
-
return
|
|
1527
|
+
return s && (cn(`path not found: '${n}'`), bn(t)), Object(r);
|
|
1528
|
+
}
|
|
1529
|
+
return _ && Jn(e, t, n), kn(o) ? Object(o) : (s && (cn(`path value MUST BE a dict: ${n}`), dn(t)), Object(r));
|
|
1530
|
+
}
|
|
1531
|
+
function Zn(e, t, n, r, l) {
|
|
1532
|
+
e && !Fn(e) && cn("GObj bad instanceof");
|
|
1533
|
+
let o = Bn(e, t, n, !1);
|
|
1534
|
+
const s = l && l & zt.KW_REQUIRED, i = l && l & zt.KW_CREATE, _ = l && l & zt.KW_EXTRACT;
|
|
1535
|
+
if (void 0 === o) {
|
|
1536
|
+
if (i) {
|
|
1537
|
+
let l = r;
|
|
1538
|
+
return er(e, t, n, l), l;
|
|
1465
1539
|
}
|
|
1466
|
-
return
|
|
1540
|
+
return s && (cn(`path not found: '${n}'`), bn(t)), r;
|
|
1467
1541
|
}
|
|
1468
|
-
return _ &&
|
|
1542
|
+
return _ && Jn(e, t, n), o;
|
|
1469
1543
|
}
|
|
1470
|
-
function
|
|
1471
|
-
if (e && !
|
|
1472
|
-
let
|
|
1473
|
-
if (
|
|
1474
|
-
let
|
|
1475
|
-
for (let e = 0; e <
|
|
1476
|
-
let n =
|
|
1477
|
-
e ===
|
|
1544
|
+
function er(e, t, n, r) {
|
|
1545
|
+
if (e && !Fn(e) && cn("GObj bad instanceof"), !kn(t)) return cn("kw is not an object"), -1;
|
|
1546
|
+
let l = n.split("`");
|
|
1547
|
+
if (l.length <= 1) return t[n] = r, 0;
|
|
1548
|
+
let o = l.length;
|
|
1549
|
+
for (let e = 0; e < o; e++) {
|
|
1550
|
+
let n = l[e];
|
|
1551
|
+
e === o - 1 ? t[n] = r : (void 0 === t[n] && (t[n] = {}), t = t[n]);
|
|
1478
1552
|
}
|
|
1479
1553
|
return 0;
|
|
1480
1554
|
}
|
|
1481
|
-
function
|
|
1482
|
-
if (e && !
|
|
1483
|
-
let
|
|
1484
|
-
return
|
|
1485
|
-
}
|
|
1486
|
-
function
|
|
1487
|
-
let
|
|
1488
|
-
if (
|
|
1489
|
-
|
|
1490
|
-
for (let
|
|
1491
|
-
let
|
|
1492
|
-
if (
|
|
1555
|
+
function tr(e, t, n, r, l) {
|
|
1556
|
+
if (e && !Fn(e) && cn("GObj bad instanceof"), !kn(t)) return cn("kw is not an object"), -1;
|
|
1557
|
+
let o = Xn(e, t, n, {}, !0);
|
|
1558
|
+
return kn(o) ? (o[r] = l, 0) : (cn("subdict is not an object"), -1);
|
|
1559
|
+
}
|
|
1560
|
+
function nr(e, t, r) {
|
|
1561
|
+
let l = "", o = !1;
|
|
1562
|
+
if ($n(t)) {
|
|
1563
|
+
o = !1;
|
|
1564
|
+
for (let s = 0; s < t.length; s++) {
|
|
1565
|
+
let i = t[s];
|
|
1566
|
+
if (l = Gn(r) ? n("%s", r) : n("%s`%d", r, s), o = nr(e, i, l), o) break;
|
|
1493
1567
|
}
|
|
1494
|
-
} else if (
|
|
1495
|
-
|
|
1496
|
-
let
|
|
1497
|
-
for (let
|
|
1498
|
-
let _ =
|
|
1499
|
-
if (
|
|
1500
|
-
if (
|
|
1568
|
+
} else if (kn(t)) {
|
|
1569
|
+
o = !0;
|
|
1570
|
+
let s = Object.keys(t);
|
|
1571
|
+
for (let i = 0; i < s.length; i++) {
|
|
1572
|
+
let _ = s[i], a = t[_];
|
|
1573
|
+
if (l = Gn(r) ? n("%s", _) : n("%s`%s", r, _), $n(a) || kn(a)) {
|
|
1574
|
+
if (o = nr(e, a, l), !o) break;
|
|
1501
1575
|
continue;
|
|
1502
1576
|
}
|
|
1503
|
-
let u =
|
|
1504
|
-
if (u || (u =
|
|
1505
|
-
|
|
1577
|
+
let u = Zn(0, e, l, 0, 0);
|
|
1578
|
+
if (u || (u = yn(e, l)), !u) {
|
|
1579
|
+
o = !1;
|
|
1506
1580
|
break;
|
|
1507
1581
|
}
|
|
1508
|
-
if (0 !==
|
|
1509
|
-
|
|
1582
|
+
if (0 !== Kn(u, a)) {
|
|
1583
|
+
o = !1;
|
|
1510
1584
|
break;
|
|
1511
1585
|
}
|
|
1512
1586
|
}
|
|
1513
1587
|
}
|
|
1514
|
-
return
|
|
1588
|
+
return o;
|
|
1515
1589
|
}
|
|
1516
|
-
function
|
|
1517
|
-
return 0 ===
|
|
1518
|
-
}
|
|
1519
|
-
function
|
|
1520
|
-
e && !
|
|
1521
|
-
let
|
|
1522
|
-
if (
|
|
1523
|
-
let
|
|
1524
|
-
t.hasOwnProperty(
|
|
1525
|
-
} else if (
|
|
1590
|
+
function rr(e, t) {
|
|
1591
|
+
return 0 === An(t) || nr(e, t, "");
|
|
1592
|
+
}
|
|
1593
|
+
function lr(e, t, n, r) {
|
|
1594
|
+
e && !Fn(e) && cn("GObj bad instanceof");
|
|
1595
|
+
let l = {};
|
|
1596
|
+
if (In(n) && !Gn(n)) {
|
|
1597
|
+
let o = n;
|
|
1598
|
+
t.hasOwnProperty(o) ? l[o] = t[o] : r && cn(`${et(e)}: key not found: ${o}`);
|
|
1599
|
+
} else if (kn(n) && Rn(n) > 0) for (let o of Object.keys(n)) t.hasOwnProperty(o) ? l[o] = t[o] : r && cn(`${et(e)}: key not found: ${o}`);
|
|
1526
1600
|
else {
|
|
1527
|
-
if (!(
|
|
1528
|
-
for (let
|
|
1529
|
-
let
|
|
1530
|
-
t.hasOwnProperty(
|
|
1601
|
+
if (!($n(n) && Dn(n) > 0)) return t;
|
|
1602
|
+
for (let o = 0; o < n.length; o++) {
|
|
1603
|
+
let s = n[o];
|
|
1604
|
+
t.hasOwnProperty(s) ? l[s] = t[s] : r && cn(`${et(e)}: key not found: ${s}`);
|
|
1531
1605
|
}
|
|
1532
1606
|
}
|
|
1533
|
-
return
|
|
1607
|
+
return l;
|
|
1534
1608
|
}
|
|
1535
|
-
function
|
|
1536
|
-
let
|
|
1537
|
-
if (
|
|
1538
|
-
let
|
|
1539
|
-
|
|
1540
|
-
} else if (
|
|
1609
|
+
function or(e, t, n, r) {
|
|
1610
|
+
let l = {};
|
|
1611
|
+
if (En(l, t), In(n) && !Gn(n)) {
|
|
1612
|
+
let o = n;
|
|
1613
|
+
Zn(e, t, o, 0, 0) ? vn(l, o) : r && cn(`${et(e)}: key not found: ${o}`);
|
|
1614
|
+
} else if (kn(n) && Rn(n) > 0) for (let o of Object.keys(n)) t.hasOwnProperty(o) ? vn(l, o) : r && cn(`${et(e)}: key not found: ${o}`);
|
|
1541
1615
|
else {
|
|
1542
|
-
if (!(
|
|
1543
|
-
for (let
|
|
1544
|
-
let
|
|
1545
|
-
t.hasOwnProperty(
|
|
1616
|
+
if (!($n(n) && Dn(n) > 0)) return {};
|
|
1617
|
+
for (let o = 0; o < n.length; o++) {
|
|
1618
|
+
let s = n[o];
|
|
1619
|
+
t.hasOwnProperty(s) ? vn(l, s) : r && cn(`${et(e)}: key not found: ${s}`);
|
|
1546
1620
|
}
|
|
1547
1621
|
}
|
|
1548
|
-
return
|
|
1622
|
+
return l;
|
|
1549
1623
|
}
|
|
1550
|
-
function
|
|
1624
|
+
function sr(e, t, n = !1) {
|
|
1551
1625
|
if ("undefined" != typeof window && window.localStorage) try {
|
|
1552
1626
|
let r = window.localStorage.getItem(e);
|
|
1553
|
-
return null === r ? (n &&
|
|
1627
|
+
return null === r ? (n && ir(e, t), t) : JSON.parse(r);
|
|
1554
1628
|
} catch (n) {
|
|
1555
1629
|
return window.console.warn(`Error reading localStorage key "${e}":`, n), t;
|
|
1556
1630
|
}
|
|
1557
1631
|
}
|
|
1558
|
-
function
|
|
1632
|
+
function ir(e, t) {
|
|
1559
1633
|
if ("undefined" == typeof window || !window.localStorage) return 0;
|
|
1560
|
-
if (!e || void 0 === t) return
|
|
1634
|
+
if (!e || void 0 === t) return cn(`kw_set_local_storage_value(): invalid key or value: key=${e}`), -1;
|
|
1561
1635
|
try {
|
|
1562
1636
|
return window.localStorage.setItem(e, JSON.stringify(t)), 0;
|
|
1563
1637
|
} catch (t) {
|
|
1564
|
-
return
|
|
1638
|
+
return cn(`kw_set_local_storage_value(): cannot save "${e}" (storage full or blocked?): ${t && t.message ? t.message : t}`), -1;
|
|
1565
1639
|
}
|
|
1566
1640
|
}
|
|
1567
|
-
function
|
|
1641
|
+
function _r(e) {
|
|
1568
1642
|
if ("undefined" != typeof window && window.localStorage) if (e) try {
|
|
1569
1643
|
window.localStorage.removeItem(e);
|
|
1570
1644
|
} catch (t) {
|
|
@@ -1572,46 +1646,46 @@ var gobjJs = function(e) {
|
|
|
1572
1646
|
}
|
|
1573
1647
|
else window.console.warn(`Invalid key for localStorage removal: ${e}`);
|
|
1574
1648
|
}
|
|
1575
|
-
function
|
|
1576
|
-
if (
|
|
1577
|
-
if (
|
|
1649
|
+
function ar(e, t) {
|
|
1650
|
+
if (Ln(e) || Ln(t)) return !0;
|
|
1651
|
+
if ($n(e)) {
|
|
1578
1652
|
if (0 === e.length) return !0;
|
|
1579
1653
|
for (let n = 0; n < e.length; n++) if (e[n] === t) return !0;
|
|
1580
|
-
} else if (
|
|
1654
|
+
} else if (kn(e)) {
|
|
1581
1655
|
if (0 === Object.keys(e).length) return !0;
|
|
1582
1656
|
for (let n in e) if (n === t) return !0;
|
|
1583
|
-
} else if (
|
|
1657
|
+
} else if (In(e) && e === t) return !0;
|
|
1584
1658
|
return !1;
|
|
1585
1659
|
}
|
|
1586
|
-
function
|
|
1587
|
-
if (e && !
|
|
1588
|
-
|
|
1589
|
-
let
|
|
1590
|
-
if (
|
|
1591
|
-
let
|
|
1592
|
-
if (
|
|
1660
|
+
function ur(e, t, n, r, l) {
|
|
1661
|
+
if (e && !Fn(e) && cn("GObj bad instanceof"), !t) return null;
|
|
1662
|
+
l || (l = rr);
|
|
1663
|
+
let o = [];
|
|
1664
|
+
if ($n(t)) for (let s = 0; s < t.length; s++) {
|
|
1665
|
+
let i, _ = t[s];
|
|
1666
|
+
if (kn(_)) i = zn(e, _, "id", "", 0);
|
|
1593
1667
|
else {
|
|
1594
|
-
if (!
|
|
1595
|
-
|
|
1668
|
+
if (!In(_)) continue;
|
|
1669
|
+
i = _;
|
|
1596
1670
|
}
|
|
1597
|
-
|
|
1671
|
+
ar(n, i) && l(_, r) && o.push(_);
|
|
1598
1672
|
}
|
|
1599
1673
|
else {
|
|
1600
|
-
if (!
|
|
1674
|
+
if (!kn(t)) return cn("kw_collect() BAD kw parameter"), null;
|
|
1601
1675
|
for (let e of Object.keys(t)) {
|
|
1602
|
-
let
|
|
1603
|
-
|
|
1676
|
+
let s = t[e];
|
|
1677
|
+
ar(n, e) && l(s, r) && o.push(s);
|
|
1604
1678
|
}
|
|
1605
1679
|
}
|
|
1606
|
-
return
|
|
1680
|
+
return o;
|
|
1607
1681
|
}
|
|
1608
|
-
function
|
|
1682
|
+
function cr(e, t) {
|
|
1609
1683
|
if (!e) return -1;
|
|
1610
1684
|
for (let n = 0; n < e.length; n++) if (e[n] && e[n].id === t) return n;
|
|
1611
1685
|
return -1;
|
|
1612
1686
|
}
|
|
1613
|
-
function
|
|
1614
|
-
if (!e || !t) return
|
|
1687
|
+
function fr(e, t, n) {
|
|
1688
|
+
if (!e || !t) return cn("ERROR: str_in_list() list or str empty"), !1;
|
|
1615
1689
|
let r = e.length;
|
|
1616
1690
|
if (n) {
|
|
1617
1691
|
t = t.toLowerCase();
|
|
@@ -1622,7 +1696,7 @@ var gobjJs = function(e) {
|
|
|
1622
1696
|
} else for (let n = 0; n < r; n++) if (e[n] === t) return !0;
|
|
1623
1697
|
return !1;
|
|
1624
1698
|
}
|
|
1625
|
-
function
|
|
1699
|
+
function gr(e, t) {
|
|
1626
1700
|
try {
|
|
1627
1701
|
let n = e.__md_iev__;
|
|
1628
1702
|
if (n) return n[t];
|
|
@@ -1630,63 +1704,63 @@ var gobjJs = function(e) {
|
|
|
1630
1704
|
return;
|
|
1631
1705
|
}
|
|
1632
1706
|
}
|
|
1633
|
-
function
|
|
1707
|
+
function dr(e, t, n) {
|
|
1634
1708
|
let r = e.__md_iev__;
|
|
1635
1709
|
r || (r = {}, e.__md_iev__ = r), r[t] = n;
|
|
1636
1710
|
}
|
|
1637
|
-
function
|
|
1638
|
-
if (!
|
|
1711
|
+
function br(e, t, n, r) {
|
|
1712
|
+
if (!Fn(e)) return cn("gobj is not a GObj"), null;
|
|
1639
1713
|
if (!t) return;
|
|
1640
|
-
let
|
|
1641
|
-
|
|
1714
|
+
let l = gr(t, n);
|
|
1715
|
+
l || (l = [], dr(t, n, l));
|
|
1642
1716
|
try {
|
|
1643
|
-
|
|
1717
|
+
$n(l) && l.unshift(r);
|
|
1644
1718
|
} catch (e) {
|
|
1645
|
-
|
|
1719
|
+
cn(e);
|
|
1646
1720
|
}
|
|
1647
1721
|
}
|
|
1648
|
-
function
|
|
1649
|
-
if (!
|
|
1650
|
-
if (!
|
|
1651
|
-
let
|
|
1652
|
-
return
|
|
1722
|
+
function pr(e, t, n, r) {
|
|
1723
|
+
if (!Fn(e)) return cn("gobj is not a GObj"), null;
|
|
1724
|
+
if (!kn(t)) return cn("kw is not a dict"), null;
|
|
1725
|
+
let l = gr(t, n);
|
|
1726
|
+
return l ? 0 === l.length ? (r && cn(`stack empty: ${n}`), null) : l[0] : (r && cn(`stack NOT FOUND: ${n}`), null);
|
|
1653
1727
|
}
|
|
1654
|
-
function
|
|
1655
|
-
return
|
|
1728
|
+
function mr(e, t, n) {
|
|
1729
|
+
return Gn(n) ? Jn(e, t, "__md_iev__`__msg_type__") : tr(e, t, "__md_iev__", "__msg_type__", n), 0;
|
|
1656
1730
|
}
|
|
1657
|
-
function
|
|
1658
|
-
return
|
|
1731
|
+
function Er(e, t) {
|
|
1732
|
+
return zn(e, t, "__md_iev__`__msg_type__", "", 0);
|
|
1659
1733
|
}
|
|
1660
|
-
function
|
|
1661
|
-
void 0 !== n &&
|
|
1734
|
+
function hr(e, t, n) {
|
|
1735
|
+
void 0 !== n && In(n) || (n = "");
|
|
1662
1736
|
for (let r of Object.keys(e)) {
|
|
1663
1737
|
if (!e.hasOwnProperty(r)) continue;
|
|
1664
|
-
let
|
|
1665
|
-
n +=
|
|
1738
|
+
let l = (n.length ? "`" : "") + r;
|
|
1739
|
+
n += l, t.apply(this, [
|
|
1666
1740
|
e,
|
|
1667
1741
|
r,
|
|
1668
1742
|
e[r],
|
|
1669
1743
|
n
|
|
1670
|
-
]),
|
|
1744
|
+
]), kn(e[r]) && hr(e[r], t, n), n = n.slice(0, -l.length);
|
|
1671
1745
|
}
|
|
1672
1746
|
}
|
|
1673
|
-
function
|
|
1747
|
+
function Tr(e, t, n, r) {
|
|
1674
1748
|
if (!e) return null;
|
|
1675
|
-
let
|
|
1676
|
-
for (
|
|
1677
|
-
let
|
|
1678
|
-
if (
|
|
1679
|
-
let e =
|
|
1680
|
-
if (e && e === n) return
|
|
1681
|
-
if (r &&
|
|
1682
|
-
let e =
|
|
1749
|
+
let l, o = e.length;
|
|
1750
|
+
for (l = 0; l < o; l++) {
|
|
1751
|
+
let o = e[l];
|
|
1752
|
+
if (o) {
|
|
1753
|
+
let e = o.id;
|
|
1754
|
+
if (e && e === n) return o;
|
|
1755
|
+
if (r && Yn(o, t)) {
|
|
1756
|
+
let e = Tr(o[t], t, n, r);
|
|
1683
1757
|
if (e) return e;
|
|
1684
1758
|
}
|
|
1685
1759
|
}
|
|
1686
1760
|
}
|
|
1687
1761
|
return null;
|
|
1688
1762
|
}
|
|
1689
|
-
function
|
|
1763
|
+
function yr(e) {
|
|
1690
1764
|
function t(e) {
|
|
1691
1765
|
let t = e.replace(/-/g, "+").replace(/_/g, "/");
|
|
1692
1766
|
switch (t.length % 4) {
|
|
@@ -1717,36 +1791,36 @@ var gobjJs = function(e) {
|
|
|
1717
1791
|
signature: t(n[2])
|
|
1718
1792
|
};
|
|
1719
1793
|
}
|
|
1720
|
-
function
|
|
1794
|
+
function vr(e) {
|
|
1721
1795
|
return null == e ? "" : String(e).replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
1722
1796
|
}
|
|
1723
|
-
function
|
|
1797
|
+
function jr(e) {
|
|
1724
1798
|
const t = document.createElement("template");
|
|
1725
1799
|
return t.innerHTML = e.trim(), t.content.firstChild;
|
|
1726
1800
|
}
|
|
1727
|
-
function
|
|
1801
|
+
function Sr() {
|
|
1728
1802
|
const e = /* @__PURE__ */ new Date(), t = e.toISOString().slice(0, 19), n = String(e.getMilliseconds()).padStart(3, "0"), r = e.getTimezoneOffset();
|
|
1729
1803
|
return `${t}.${n}${r > 0 ? "-" : "+"}${String(Math.abs(r) / 60).padStart(2, "0")}${String(Math.abs(r) % 60).padStart(2, "0")}`;
|
|
1730
1804
|
}
|
|
1731
|
-
function
|
|
1805
|
+
function Or(e, t) {
|
|
1732
1806
|
if (!e) throw "ERROR: index_in_list() list empty";
|
|
1733
1807
|
for (let n = 0; n < e.length; n++) if (t === e[n]) return n;
|
|
1734
1808
|
return -1;
|
|
1735
1809
|
}
|
|
1736
|
-
function
|
|
1810
|
+
function wr() {
|
|
1737
1811
|
let e = "";
|
|
1738
1812
|
return "undefined" != typeof window && window.localStorage ? (e = window.localStorage.getItem("host_uuid"), !e && window.crypto?.randomUUID && (e = window.crypto.randomUUID(), window.localStorage.setItem("host_uuid", e))) : e = "undefined" != typeof globalThis && globalThis.crypto?.randomUUID ? globalThis.crypto.randomUUID() : "00000000-0000-0000-0000-000000000000", e;
|
|
1739
1813
|
}
|
|
1740
|
-
function
|
|
1814
|
+
function Nr(e) {
|
|
1741
1815
|
let t = null;
|
|
1742
1816
|
return "function" != typeof e && "object" != typeof e || (t = ("" + e).match(/function\s*([\w\$]*)\s*\(/)), null !== t ? t[1] + "()" : "";
|
|
1743
1817
|
}
|
|
1744
|
-
var
|
|
1745
|
-
function
|
|
1818
|
+
var Rr = 256, Dr = 1e5;
|
|
1819
|
+
function Ar(e) {
|
|
1746
1820
|
const t = String(e).replace(/`/g, "``");
|
|
1747
1821
|
return "[" === t[0] ? "[" + t : t;
|
|
1748
1822
|
}
|
|
1749
|
-
function
|
|
1823
|
+
function kr(e) {
|
|
1750
1824
|
if ("string" != typeof e) return null;
|
|
1751
1825
|
let t = [], n = "";
|
|
1752
1826
|
for (let r = 0; r < e.length; r++) if ("`" !== e[r]) n += e[r];
|
|
@@ -1767,19 +1841,19 @@ var gobjJs = function(e) {
|
|
|
1767
1841
|
return null !== t ? t : "[" === e[0] && "[" === e[1] ? e.slice(1) : e;
|
|
1768
1842
|
});
|
|
1769
1843
|
}
|
|
1770
|
-
function
|
|
1844
|
+
function $r(e, t) {
|
|
1771
1845
|
return e === t || null !== e && null !== t && "object" == typeof e && "object" == typeof t && JSON.stringify(e) === JSON.stringify(t);
|
|
1772
1846
|
}
|
|
1773
|
-
function
|
|
1774
|
-
return "persistent-attrs-" +
|
|
1847
|
+
function Ir(e) {
|
|
1848
|
+
return "persistent-attrs-" + et(e);
|
|
1775
1849
|
}
|
|
1776
|
-
function
|
|
1777
|
-
if (
|
|
1850
|
+
function Cr(e, t) {
|
|
1851
|
+
if (In(t)) {
|
|
1778
1852
|
if (-1 === t.indexOf("^")) {
|
|
1779
|
-
let n, r,
|
|
1780
|
-
if (1 !==
|
|
1781
|
-
for (const e of Object.keys(
|
|
1782
|
-
n = e, r =
|
|
1853
|
+
let n, r, l = e.fkey;
|
|
1854
|
+
if (1 !== Rn(l)) return cn("bad fkey 1"), cn(e), cn(t), null;
|
|
1855
|
+
for (const e of Object.keys(l)) {
|
|
1856
|
+
n = e, r = l[e];
|
|
1783
1857
|
break;
|
|
1784
1858
|
}
|
|
1785
1859
|
return {
|
|
@@ -1790,20 +1864,20 @@ var gobjJs = function(e) {
|
|
|
1790
1864
|
}
|
|
1791
1865
|
{
|
|
1792
1866
|
let n = t.split("^");
|
|
1793
|
-
return 3 !== n.length ? (
|
|
1867
|
+
return 3 !== n.length ? (cn("bad fkey 2"), cn(e), cn(t), null) : {
|
|
1794
1868
|
topic_name: n[0],
|
|
1795
1869
|
id: n[1],
|
|
1796
1870
|
hook_name: n[2]
|
|
1797
1871
|
};
|
|
1798
1872
|
}
|
|
1799
1873
|
}
|
|
1800
|
-
return
|
|
1874
|
+
return kn(t) ? {
|
|
1801
1875
|
topic_name: t.topic_name,
|
|
1802
1876
|
id: t.id,
|
|
1803
1877
|
hook_name: t.hook_name
|
|
1804
|
-
} : (
|
|
1878
|
+
} : (cn("bad fkey 3"), cn(e), cn(t), null);
|
|
1805
1879
|
}
|
|
1806
|
-
var
|
|
1880
|
+
var Pr = [
|
|
1807
1881
|
"string",
|
|
1808
1882
|
"integer",
|
|
1809
1883
|
"object",
|
|
@@ -1813,7 +1887,7 @@ var gobjJs = function(e) {
|
|
|
1813
1887
|
"real",
|
|
1814
1888
|
"boolean",
|
|
1815
1889
|
"blob"
|
|
1816
|
-
],
|
|
1890
|
+
], Lr = [
|
|
1817
1891
|
"persistent",
|
|
1818
1892
|
"required",
|
|
1819
1893
|
"notnull",
|
|
@@ -1825,7 +1899,7 @@ var gobjJs = function(e) {
|
|
|
1825
1899
|
"stats",
|
|
1826
1900
|
"rstats",
|
|
1827
1901
|
"pstats"
|
|
1828
|
-
],
|
|
1902
|
+
], Ur = [
|
|
1829
1903
|
"hook",
|
|
1830
1904
|
"fkey",
|
|
1831
1905
|
"enum",
|
|
@@ -1854,7 +1928,7 @@ var gobjJs = function(e) {
|
|
|
1854
1928
|
"coordinates",
|
|
1855
1929
|
"gbuffer"
|
|
1856
1930
|
];
|
|
1857
|
-
function
|
|
1931
|
+
function Fr(e) {
|
|
1858
1932
|
let t = {
|
|
1859
1933
|
name: e.id,
|
|
1860
1934
|
header: e.header,
|
|
@@ -1873,7 +1947,7 @@ var gobjJs = function(e) {
|
|
|
1873
1947
|
if (!e.flag) return t;
|
|
1874
1948
|
for (let n = 0; n < e.flag.length; n++) {
|
|
1875
1949
|
let r = e.flag[n];
|
|
1876
|
-
if (
|
|
1950
|
+
if (fr(Ur, r)) {
|
|
1877
1951
|
switch (r) {
|
|
1878
1952
|
case "enum":
|
|
1879
1953
|
t.enum_list = e.enum;
|
|
@@ -1887,7 +1961,7 @@ var gobjJs = function(e) {
|
|
|
1887
1961
|
case "file": t.is_file = !0;
|
|
1888
1962
|
}
|
|
1889
1963
|
t.type = r;
|
|
1890
|
-
} else if (
|
|
1964
|
+
} else if (fr(Lr, r)) switch (r) {
|
|
1891
1965
|
case "writable":
|
|
1892
1966
|
t.is_writable = !0;
|
|
1893
1967
|
break;
|
|
@@ -1900,125 +1974,191 @@ var gobjJs = function(e) {
|
|
|
1900
1974
|
}
|
|
1901
1975
|
return t.is_file && (t.type = "file"), t;
|
|
1902
1976
|
}
|
|
1903
|
-
var
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
],
|
|
1977
|
+
var Gr = [
|
|
1978
|
+
j(h.DTP_POINTER, "subscriber", 0, null, "Subscriber of output events"),
|
|
1979
|
+
j(h.DTP_BOOLEAN, "periodic", 0, 0, "True for periodic timeouts"),
|
|
1980
|
+
j(h.DTP_INTEGER, "msec", 0, 0, "Timeout in milliseconds"),
|
|
1981
|
+
v()
|
|
1982
|
+
], Vr = {
|
|
1909
1983
|
periodic: !1,
|
|
1910
1984
|
msec: 0,
|
|
1911
1985
|
timer_id: -1
|
|
1912
|
-
},
|
|
1913
|
-
function
|
|
1914
|
-
let
|
|
1915
|
-
return
|
|
1916
|
-
|
|
1917
|
-
},
|
|
1918
|
-
}
|
|
1919
|
-
var
|
|
1986
|
+
}, Mr = null;
|
|
1987
|
+
function Wr(e, t, n, r) {
|
|
1988
|
+
let l = e.priv, o = l.periodic ? "EV_TIMEOUT_PERIODIC" : "EV_TIMEOUT";
|
|
1989
|
+
return l.periodic && l.msec > 0 ? l.timer_id = setTimeout(function() {
|
|
1990
|
+
Ft(e, "EV_TIMEOUT", {}, e);
|
|
1991
|
+
}, l.msec) : l.timer_id = -1, lt(e) ? Ft(nt(e), o, {}, e) : qt(e, o, {}), l.periodic || -1 !== l.timer_id || xe(e) && Ge(e), 0;
|
|
1992
|
+
}
|
|
1993
|
+
var Kr = {
|
|
1920
1994
|
mt_create: function(e) {
|
|
1921
1995
|
let t = e.priv;
|
|
1922
|
-
const n =
|
|
1923
|
-
n &&
|
|
1996
|
+
const n = St(e, "subscriber");
|
|
1997
|
+
n && Yt(e, null, {}, n), t.periodic = yt(e, "periodic"), t.msec = vt(e, "msec");
|
|
1924
1998
|
},
|
|
1925
1999
|
mt_writing: function(e, t) {
|
|
1926
2000
|
let n = e.priv;
|
|
1927
2001
|
switch (t) {
|
|
1928
2002
|
case "periodic":
|
|
1929
|
-
n.periodic =
|
|
2003
|
+
n.periodic = yt(e, "periodic");
|
|
1930
2004
|
break;
|
|
1931
|
-
case "msec": n.msec =
|
|
1932
|
-
|
|
1933
|
-
}, n.msec)), n.msec > 0 ?
|
|
2005
|
+
case "msec": n.msec = vt(e, "msec"), -1 !== n.timer_id && (clearTimeout(n.timer_id), n.timer_id = -1), n.msec > 0 && (n.timer_id = setTimeout(function() {
|
|
2006
|
+
Ft(e, "EV_TIMEOUT", {}, e);
|
|
2007
|
+
}, n.msec)), n.msec > 0 ? xe(e) || Le(e) : xe(e) && Ge(e);
|
|
1934
2008
|
}
|
|
1935
2009
|
},
|
|
1936
2010
|
mt_start: function(e) {
|
|
1937
2011
|
return 0;
|
|
1938
2012
|
},
|
|
1939
2013
|
mt_stop: function(e) {
|
|
1940
|
-
return
|
|
2014
|
+
return Rt(e, "msec", -1), 0;
|
|
1941
2015
|
},
|
|
1942
2016
|
mt_destroy: function(e) {}
|
|
1943
2017
|
};
|
|
1944
|
-
function
|
|
1945
|
-
return e instanceof
|
|
2018
|
+
function xr(e, t) {
|
|
2019
|
+
return e instanceof O ? "C_TIMER" !== Ze(e) ? (cn("not C_TIMER GObj"), -1) : (Nt(e, "periodic", !1), void Rt(e, "msec", t)) : (cn("not GObj TYPE"), -1);
|
|
2020
|
+
}
|
|
2021
|
+
function Yr(e, t) {
|
|
2022
|
+
return e instanceof O ? "C_TIMER" !== Ze(e) ? (cn("not C_TIMER GObj"), -1) : (Nt(e, "periodic", !0), void Rt(e, "msec", t)) : (cn("not GObj TYPE"), -1);
|
|
2023
|
+
}
|
|
2024
|
+
function Br(e) {
|
|
2025
|
+
return e instanceof O ? "C_TIMER" !== Ze(e) ? (cn("not C_TIMER GObj"), -1) : void Rt(e, "msec", -1) : (cn("not GObj TYPE"), -1);
|
|
2026
|
+
}
|
|
2027
|
+
var Jr = [
|
|
2028
|
+
j(h.DTP_BOOLEAN, "changesLost", 0, !1, "Set true to warn about leaving page"),
|
|
2029
|
+
j(h.DTP_BOOLEAN, "browser_beforeunload", 0, !1, "Set true to refreshing browser"),
|
|
2030
|
+
j(h.DTP_STRING, "__username__", 0, "", "Username"),
|
|
2031
|
+
j(h.DTP_STRING, "start_date", 0, "", "Yuno starting date"),
|
|
2032
|
+
j(h.DTP_STRING, "node_uuid", 0, "", "uuid of node"),
|
|
2033
|
+
j(h.DTP_STRING, "yuno_role", 0, "", "Yuno role"),
|
|
2034
|
+
j(h.DTP_STRING, "yuno_id", 0, "", "Yuno Id. Set by agent"),
|
|
2035
|
+
j(h.DTP_STRING, "yuno_name", 0, "", "Yuno name. Set by agent"),
|
|
2036
|
+
j(h.DTP_STRING, "yuno_tag", 0, "", "Tags of yuno. Set by agent"),
|
|
2037
|
+
j(h.DTP_STRING, "yuno_release", 0, "", "Yuno Release. Set by agent"),
|
|
2038
|
+
j(h.DTP_STRING, "yuno_version", 0, "", "Yuno version (APP_VERSION)"),
|
|
2039
|
+
j(h.DTP_STRING, "yuneta_version", 0, s, "Yuneta version"),
|
|
2040
|
+
j(h.DTP_LIST, "required_services", 0, "[]", "Required services"),
|
|
2041
|
+
j(h.DTP_DICT, "trace_levels", T.SDF_PERSIST, "{}", "Trace levels"),
|
|
2042
|
+
j(h.DTP_DICT, "no_trace_levels", T.SDF_PERSIST, "{}", "No trace levels"),
|
|
2043
|
+
j(h.DTP_POINTER, "trace_ievent_callback", 0, null, "Where the traffic trace goes (C_IEVENT_CLI levels ievents/ievents2); console when null"),
|
|
2044
|
+
j(h.DTP_BOOLEAN, "developer", 0, !1, "Developer mode enabled"),
|
|
2045
|
+
j(h.DTP_INTEGER, "periodic_timeout", 0, "1000", "Timeout periodic, in miliseconds."),
|
|
2046
|
+
v()
|
|
2047
|
+
], Hr = { gobj_timer: null }, qr = null;
|
|
2048
|
+
function zr(e, t, n, r) {
|
|
2049
|
+
let l = ht(e, t);
|
|
2050
|
+
return kn(l) || (l = {}), l[n] = r, Ot(e, t, l), Ae(e, t);
|
|
1946
2051
|
}
|
|
1947
|
-
function
|
|
1948
|
-
|
|
2052
|
+
function Qr(e) {
|
|
2053
|
+
if (!0 === e || !1 === e) return e;
|
|
2054
|
+
let t = String(null == e ? "" : e).toLowerCase();
|
|
2055
|
+
return "true" === t || "set" === t || "false" !== t && "reset" !== t && ("" === t || isNaN(Number(t)) ? null : !!Number(t));
|
|
1949
2056
|
}
|
|
1950
|
-
function
|
|
1951
|
-
return
|
|
1952
|
-
}
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
v(T.DTP_STRING, "start_date", 0, "", "Yuno starting date"),
|
|
1958
|
-
v(T.DTP_STRING, "node_uuid", 0, "", "uuid of node"),
|
|
1959
|
-
v(T.DTP_STRING, "yuno_role", 0, "", "Yuno role"),
|
|
1960
|
-
v(T.DTP_STRING, "yuno_id", 0, "", "Yuno Id. Set by agent"),
|
|
1961
|
-
v(T.DTP_STRING, "yuno_name", 0, "", "Yuno name. Set by agent"),
|
|
1962
|
-
v(T.DTP_STRING, "yuno_tag", 0, "", "Tags of yuno. Set by agent"),
|
|
1963
|
-
v(T.DTP_STRING, "yuno_release", 0, "", "Yuno Release. Set by agent"),
|
|
1964
|
-
v(T.DTP_STRING, "yuno_version", 0, "", "Yuno version (APP_VERSION)"),
|
|
1965
|
-
v(T.DTP_STRING, "yuneta_version", 0, l, "Yuneta version"),
|
|
1966
|
-
v(T.DTP_LIST, "required_services", 0, "[]", "Required services"),
|
|
1967
|
-
v(T.DTP_INTEGER, "tracing", 0, 0, "Tracing level"),
|
|
1968
|
-
v(T.DTP_BOOLEAN, "trace_timer", 0, 0, "Trace timers"),
|
|
1969
|
-
v(T.DTP_BOOLEAN, "trace_inter_event", 0, 0, "Trace traffic"),
|
|
1970
|
-
v(T.DTP_POINTER, "trace_ievent_callback", 0, null, "Trace traffic callback"),
|
|
1971
|
-
v(T.DTP_BOOLEAN, "trace_creation", 0, 0, "Trace creation"),
|
|
1972
|
-
v(T.DTP_BOOLEAN, "trace_start_stop", 0, 0, "Trace start/stop"),
|
|
1973
|
-
v(T.DTP_BOOLEAN, "trace_subscriptions", 0, 0, "Trace subscription"),
|
|
1974
|
-
v(T.DTP_BOOLEAN, "trace_i18n", 0, 0, "Trace i18n"),
|
|
1975
|
-
v(T.DTP_BOOLEAN, "no_poll", 0, 0, "no poll"),
|
|
1976
|
-
v(T.DTP_BOOLEAN, "developer", 0, !1, "Developer mode enabled"),
|
|
1977
|
-
v(T.DTP_INTEGER, "periodic_timeout", 0, "1000", "Timeout periodic, in miliseconds."),
|
|
1978
|
-
j()
|
|
1979
|
-
], $r = { gobj_timer: null }, Cr = null;
|
|
1980
|
-
function Lr(e, t, n, r) {
|
|
1981
|
-
return Ct(e, t, n), 0;
|
|
1982
|
-
}
|
|
1983
|
-
var Pr = {
|
|
2057
|
+
function Xr() {
|
|
2058
|
+
return `${ze()}^${qe()}`;
|
|
2059
|
+
}
|
|
2060
|
+
function Zr(e, t, n, r) {
|
|
2061
|
+
return qt(e, t, n), 0;
|
|
2062
|
+
}
|
|
2063
|
+
var el = {
|
|
1984
2064
|
mt_create: function(e) {
|
|
1985
2065
|
let t = e.priv;
|
|
1986
|
-
|
|
2066
|
+
Dt(e, "start_date", Sr()), Dt(e, "node_uuid", wr()), e.priv.gobj_timer = Ce(Xe(e), "C_TIMER", {}, e), t.periodic_timeout = ht(e, "periodic_timeout"), function(e) {
|
|
2067
|
+
let t = ht(e, "trace_levels");
|
|
2068
|
+
if (!kn(t)) return 0;
|
|
2069
|
+
let n = t.__global_trace__;
|
|
2070
|
+
if ($n(n)) {
|
|
2071
|
+
Z(4294967295, !1);
|
|
2072
|
+
for (let e of n) Q(e, !0);
|
|
2073
|
+
}
|
|
2074
|
+
for (const [n, r] of Object.entries(t)) {
|
|
2075
|
+
let t = Se(n);
|
|
2076
|
+
if (t) if ($n(r)) {
|
|
2077
|
+
se(t, null, !1);
|
|
2078
|
+
for (let e of r) se(t, e, !0);
|
|
2079
|
+
} else cn(`${Xe(e)}: trace_levels of ${n} MUST be a list`);
|
|
2080
|
+
}
|
|
2081
|
+
}(e), function(e) {
|
|
2082
|
+
let t = ht(e, "no_trace_levels");
|
|
2083
|
+
if (!kn(t)) return 0;
|
|
2084
|
+
let n = t.__global_no_trace__;
|
|
2085
|
+
if ($n(n)) {
|
|
2086
|
+
ee(4294967295, !1);
|
|
2087
|
+
for (let e of n) X(e, !0);
|
|
2088
|
+
}
|
|
2089
|
+
for (const [n, r] of Object.entries(t)) {
|
|
2090
|
+
let t = Se(n);
|
|
2091
|
+
if (t) if ($n(r)) {
|
|
2092
|
+
ie(t, null, !1);
|
|
2093
|
+
for (let e of r) ie(t, e, !0);
|
|
2094
|
+
} else cn(`${Xe(e)}: no_trace_levels of ${n} MUST be a list`);
|
|
2095
|
+
}
|
|
2096
|
+
}(e);
|
|
1987
2097
|
},
|
|
1988
2098
|
mt_writing: function(e, t) {},
|
|
1989
2099
|
mt_start: function(e) {
|
|
1990
|
-
return
|
|
2100
|
+
return Yr(e.priv.gobj_timer, e.priv.periodic_timeout), 0;
|
|
1991
2101
|
},
|
|
1992
2102
|
mt_stop: function(e) {
|
|
1993
|
-
return
|
|
2103
|
+
return Br(e.priv.gobj_timer), Me(e), 0;
|
|
1994
2104
|
},
|
|
1995
2105
|
mt_destroy: function(e) {},
|
|
1996
2106
|
mt_play: function(e) {
|
|
1997
|
-
let t =
|
|
1998
|
-
return
|
|
2107
|
+
let t = Oe();
|
|
2108
|
+
return xe(t) || Le(t), Je(t) || We(t), 0;
|
|
1999
2109
|
},
|
|
2000
2110
|
mt_pause: function(e) {
|
|
2001
|
-
return
|
|
2111
|
+
return Ke(Oe()), 0;
|
|
2112
|
+
},
|
|
2113
|
+
mt_command_parser: function(e, t, n, r) {
|
|
2114
|
+
switch (n = n || {}, t) {
|
|
2115
|
+
case "get-global-trace": return l(0, 0, null, null, te());
|
|
2116
|
+
case "get-global-no-trace": return l(0, 0, null, null, ne());
|
|
2117
|
+
case "set-global-trace":
|
|
2118
|
+
case "set-global-no-trace": {
|
|
2119
|
+
let r = "set-global-no-trace" === t, o = n.level, s = Qr(n.set);
|
|
2120
|
+
return o ? null === s ? l(0, -1, `${Xr()}: bitmask set or re-set?`, null, null) : (r ? X(o, s) : Q(o, s)) < 0 ? l(0, -1, `${Xr()}: global trace level not found: ${o}`, null, null) : r ? (zr(e, "no_trace_levels", "__global_no_trace__", ne()), l(0, 0, null, null, ne())) : (zr(e, "trace_levels", "__global_trace__", te()), l(0, 0, null, null, te())) : l(0, -1, `${Xr()}: what level?`, null, null);
|
|
2121
|
+
}
|
|
2122
|
+
case "get-gclass-trace":
|
|
2123
|
+
case "get-gclass-no-trace":
|
|
2124
|
+
case "set-gclass-trace":
|
|
2125
|
+
case "set-gclass-no-trace": {
|
|
2126
|
+
let r = t.indexOf("no-trace") >= 0, o = n.gclass_name || n.gclass || "", s = Se(o);
|
|
2127
|
+
if (!s) return l(0, -1, `${Xr()}: what gclass is '${o}'?`, null, null);
|
|
2128
|
+
if (0 === t.indexOf("get-")) return l(0, 0, null, null, r ? oe(s) : re(s));
|
|
2129
|
+
let i = n.level, _ = Qr(n.set);
|
|
2130
|
+
return i ? null === _ ? l(0, -1, `${Xr()}: bitmask set or re-set?`, null, null) : (r ? ie(s, i, _) : se(s, i, _)) < 0 ? l(0, -1, `${Xr()}: trace level of ${o} not found: ${i}`, null, null) : r ? (zr(e, "no_trace_levels", o, oe(s)), l(0, 0, null, null, oe(s))) : (zr(e, "trace_levels", o, le(s)), l(0, 0, null, null, re(s))) : l(0, -1, `${Xr()}: what level?`, null, null);
|
|
2131
|
+
}
|
|
2132
|
+
default: return l(0, -1, `${Xr()}: command not available: ${t}`, null, null);
|
|
2133
|
+
}
|
|
2002
2134
|
}
|
|
2003
2135
|
};
|
|
2004
|
-
var
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
],
|
|
2136
|
+
var tl = "ievent_gate_stack", nl = [
|
|
2137
|
+
j(h.DTP_STRING, "wanted_yuno_role", T.SDF_RD, "", "wanted yuno role"),
|
|
2138
|
+
j(h.DTP_STRING, "wanted_yuno_name", T.SDF_RD, "", "wanted yuno name"),
|
|
2139
|
+
j(h.DTP_STRING, "wanted_yuno_service", T.SDF_RD, "", "wanted yuno service"),
|
|
2140
|
+
j(h.DTP_STRING, "remote_yuno_role", T.SDF_RD, "", "confirmed remote yuno role"),
|
|
2141
|
+
j(h.DTP_STRING, "remote_yuno_name", T.SDF_RD, "", "confirmed remote yuno name"),
|
|
2142
|
+
j(h.DTP_STRING, "remote_yuno_service", T.SDF_RD, "", "confirmed remote yuno service"),
|
|
2143
|
+
j(h.DTP_STRING, "url", T.SDF_RD, "", "Url to connect"),
|
|
2144
|
+
j(h.DTP_STRING, "jwt", T.SDF_PERSIST, "", "JWT"),
|
|
2145
|
+
j(h.DTP_STRING, "cert_pem", T.SDF_PERSIST, "", "SSL server certification, PEM str format"),
|
|
2146
|
+
j(h.DTP_JSON, "extra_info", T.SDF_RD, "{}", "dict data set by user, added to the identity card msg."),
|
|
2147
|
+
j(h.DTP_LIST, "required_services", T.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."),
|
|
2148
|
+
j(h.DTP_INTEGER, "timeout_retry", T.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"),
|
|
2149
|
+
j(h.DTP_INTEGER, "timeout_retry_max", T.SDF_RD, "60000", "Cap of the reconnect backoff (ms). Set it equal to timeout_retry for the old fixed-interval behaviour"),
|
|
2150
|
+
j(h.DTP_INTEGER, "timeout_idack", T.SDF_RD, "5000", "timeout waiting idAck"),
|
|
2151
|
+
j(h.DTP_POINTER, "subscriber", 0, 0, "subscriber of output-events. If null then subscriber is the parent"),
|
|
2152
|
+
v()
|
|
2153
|
+
], rl = [
|
|
2154
|
+
["ievents", "Trace inter-events with metadata of kw"],
|
|
2155
|
+
["ievents2", "Trace inter-events with full kw"],
|
|
2156
|
+
["identity-card", "Trace identity_card messages"]
|
|
2157
|
+
];
|
|
2158
|
+
function ll(e) {
|
|
2159
|
+
return !!(3 & K(e));
|
|
2160
|
+
}
|
|
2161
|
+
var ol = {
|
|
2022
2162
|
url: null,
|
|
2023
2163
|
remote_yuno_name: null,
|
|
2024
2164
|
remote_yuno_role: null,
|
|
@@ -2028,374 +2168,374 @@ var gobjJs = function(e) {
|
|
|
2028
2168
|
websocket: null,
|
|
2029
2169
|
inside_on_open: !1,
|
|
2030
2170
|
retry_ms: 0
|
|
2031
|
-
},
|
|
2032
|
-
function
|
|
2033
|
-
e.priv.websocket &&
|
|
2034
|
-
const t =
|
|
2171
|
+
}, sl = null;
|
|
2172
|
+
function il(e) {
|
|
2173
|
+
e.priv.websocket && cn("Websocket ALREADY setup");
|
|
2174
|
+
const t = jt(e, "url");
|
|
2035
2175
|
let n;
|
|
2036
|
-
|
|
2176
|
+
gn(`====> Starting WebSocket to '${t}' (${et(e)})`);
|
|
2037
2177
|
try {
|
|
2038
2178
|
n = new WebSocket(t);
|
|
2039
2179
|
} catch (n) {
|
|
2040
|
-
return
|
|
2180
|
+
return cn(`${et(e)}: Cannot open WebSocket to '${t}', Error: ${n.message}`), null;
|
|
2041
2181
|
}
|
|
2042
2182
|
return n ? (n.onopen = () => {
|
|
2043
|
-
|
|
2183
|
+
Ft(e, "EV_ON_OPEN", { url: t }, e);
|
|
2044
2184
|
}, n.onmessage = (n) => {
|
|
2045
|
-
|
|
2185
|
+
Ft(e, "EV_ON_MESSAGE", {
|
|
2046
2186
|
url: t,
|
|
2047
2187
|
data: n.data
|
|
2048
2188
|
}, e);
|
|
2049
2189
|
}, n.onclose = (n) => {
|
|
2050
|
-
|
|
2190
|
+
ot(e) || (yt(He(), "browser_beforeunload") ? fn("Close websocket by unload page") : Ft(e, "EV_ON_CLOSE", {
|
|
2051
2191
|
url: t,
|
|
2052
2192
|
e: n
|
|
2053
2193
|
}, e));
|
|
2054
|
-
}, n) : (
|
|
2194
|
+
}, n) : (cn(`${et(e)}: Failed to initialize WebSocket.`), null);
|
|
2055
2195
|
}
|
|
2056
|
-
function
|
|
2057
|
-
let r = e.priv,
|
|
2058
|
-
if (r.websocket = null,
|
|
2059
|
-
|
|
2196
|
+
function _l(e, t = 1e3, n = "") {
|
|
2197
|
+
let r = e.priv, l = r.websocket;
|
|
2198
|
+
if (r.websocket = null, l && l.readyState !== WebSocket.CLOSED && l.readyState !== WebSocket.CLOSING) {
|
|
2199
|
+
gn(`Closing WebSocket (Code: ${t}, Reason: "${n}")`);
|
|
2060
2200
|
try {
|
|
2061
|
-
|
|
2201
|
+
l.close(t, n);
|
|
2062
2202
|
} catch (e) {
|
|
2063
|
-
|
|
2203
|
+
cn("Error closing WebSocket:", e.message);
|
|
2064
2204
|
}
|
|
2065
|
-
} else
|
|
2205
|
+
} else fn("WebSocket is already closed or in the process of closing.");
|
|
2066
2206
|
}
|
|
2067
|
-
function
|
|
2068
|
-
let r =
|
|
2207
|
+
function al(e, t, n) {
|
|
2208
|
+
let r = Sr();
|
|
2069
2209
|
try {
|
|
2070
|
-
|
|
2210
|
+
gn("\n" + r + " " + t + "\n"), bn(n);
|
|
2071
2211
|
} catch (e) {
|
|
2072
|
-
|
|
2212
|
+
gn("ERROR in trace_inter_event: " + e);
|
|
2073
2213
|
}
|
|
2074
2214
|
}
|
|
2075
|
-
var
|
|
2215
|
+
var ul = class {
|
|
2076
2216
|
constructor(e, t) {
|
|
2077
2217
|
this.event = e, this.kw = t || {};
|
|
2078
2218
|
}
|
|
2079
2219
|
};
|
|
2080
|
-
function
|
|
2220
|
+
function cl(e, t, n, r) {
|
|
2081
2221
|
return function(e, t) {
|
|
2082
2222
|
let n = e.priv, r = JSON.stringify(t);
|
|
2083
|
-
if (
|
|
2084
|
-
let n =
|
|
2085
|
-
|
|
2223
|
+
if (ll(e)) {
|
|
2224
|
+
let n = jt(e, "url"), l = Xe(He()) + " ==> " + n, o = ht(He(), "trace_ievent_callback");
|
|
2225
|
+
o ? o(l, t, 1, r.length) : al(0, l, t);
|
|
2086
2226
|
}
|
|
2087
|
-
if (!n.websocket || n.websocket.readyState !== WebSocket.OPEN) return
|
|
2227
|
+
if (!n.websocket || n.websocket.readyState !== WebSocket.OPEN) return fn(`${et(e)}: send_iev(): websocket not open, message lost`), -1;
|
|
2088
2228
|
try {
|
|
2089
2229
|
n.websocket.send(r);
|
|
2090
2230
|
} catch (t) {
|
|
2091
|
-
|
|
2231
|
+
cn(`${et(e)}: send_iev(): ${t}`);
|
|
2092
2232
|
}
|
|
2093
2233
|
return 0;
|
|
2094
2234
|
}(e, function(e, t) {
|
|
2095
|
-
return
|
|
2235
|
+
return Gn(e) ? (cn("iev_create() event NULL"), null) : new ul(e, t);
|
|
2096
2236
|
}(t, n));
|
|
2097
2237
|
}
|
|
2098
|
-
function
|
|
2099
|
-
return
|
|
2100
|
-
dst_yuno:
|
|
2101
|
-
dst_role:
|
|
2238
|
+
function fl(e, t, n) {
|
|
2239
|
+
return Gn(n) && (n = jt(e, "wanted_yuno_service")), {
|
|
2240
|
+
dst_yuno: jt(e, "wanted_yuno_name"),
|
|
2241
|
+
dst_role: jt(e, "wanted_yuno_role"),
|
|
2102
2242
|
dst_service: n,
|
|
2103
|
-
src_yuno:
|
|
2104
|
-
src_role:
|
|
2243
|
+
src_yuno: qe(),
|
|
2244
|
+
src_role: ze(),
|
|
2105
2245
|
src_service: t,
|
|
2106
|
-
host:
|
|
2246
|
+
host: wr()
|
|
2107
2247
|
};
|
|
2108
2248
|
}
|
|
2109
|
-
function
|
|
2110
|
-
let t = e.priv, n =
|
|
2111
|
-
|
|
2249
|
+
function gl(e) {
|
|
2250
|
+
let t = e.priv, n = Je(He()), r = jt(He(), "yuno_version"), l = jt(He(), "yuno_release"), o = jt(He(), "yuno_tag"), i = ht(e, "required_services");
|
|
2251
|
+
i && i.length || (i = ht(He(), "required_services"));
|
|
2112
2252
|
let _ = {
|
|
2113
|
-
yuno_role:
|
|
2114
|
-
yuno_id:
|
|
2115
|
-
yuno_name:
|
|
2116
|
-
yuno_tag:
|
|
2253
|
+
yuno_role: ze(),
|
|
2254
|
+
yuno_id: Qe(),
|
|
2255
|
+
yuno_name: qe(),
|
|
2256
|
+
yuno_tag: o,
|
|
2117
2257
|
yuno_version: r,
|
|
2118
|
-
yuno_release:
|
|
2119
|
-
yuneta_version:
|
|
2258
|
+
yuno_release: l,
|
|
2259
|
+
yuneta_version: s,
|
|
2120
2260
|
playing: n,
|
|
2121
2261
|
pid: 0,
|
|
2122
2262
|
watcher_pid: 0,
|
|
2123
|
-
jwt:
|
|
2124
|
-
username:
|
|
2263
|
+
jwt: jt(e, "jwt"),
|
|
2264
|
+
username: jt(He(), "__username__"),
|
|
2125
2265
|
launch_id: 0,
|
|
2126
|
-
yuno_startdate:
|
|
2127
|
-
id:
|
|
2266
|
+
yuno_startdate: jt(He(), "start_date"),
|
|
2267
|
+
id: wr(),
|
|
2128
2268
|
user_agent: "undefined" != typeof window ? window.navigator.userAgent : "",
|
|
2129
2269
|
language: "undefined" != typeof window ? window.navigator.language : "",
|
|
2130
|
-
required_services:
|
|
2270
|
+
required_services: i
|
|
2131
2271
|
};
|
|
2132
|
-
return
|
|
2133
|
-
}
|
|
2134
|
-
function
|
|
2135
|
-
if (
|
|
2136
|
-
let n = {}, r = t.__global__,
|
|
2137
|
-
|
|
2138
|
-
return
|
|
2139
|
-
}
|
|
2140
|
-
function
|
|
2141
|
-
let
|
|
2142
|
-
return
|
|
2143
|
-
}
|
|
2144
|
-
function
|
|
2145
|
-
return
|
|
2146
|
-
}
|
|
2147
|
-
function
|
|
2148
|
-
let
|
|
2149
|
-
return
|
|
2150
|
-
url:
|
|
2151
|
-
remote_yuno_name:
|
|
2152
|
-
remote_yuno_role:
|
|
2153
|
-
remote_yuno_service:
|
|
2154
|
-
})) : (
|
|
2155
|
-
url:
|
|
2156
|
-
remote_yuno_name:
|
|
2157
|
-
remote_yuno_role:
|
|
2158
|
-
remote_yuno_service:
|
|
2159
|
-
code:
|
|
2160
|
-
reason:
|
|
2161
|
-
was_clean:
|
|
2162
|
-
})),
|
|
2163
|
-
let t = e.priv, n =
|
|
2272
|
+
return br(e, _, tl, fl(e, Xe(nt(e)), null)), mr(e, _, "__identity__"), xr(t.gobj_timer, vt(e, "timeout_idack")), cl(e, "EV_IDENTITY_CARD", _);
|
|
2273
|
+
}
|
|
2274
|
+
function dl(e, t) {
|
|
2275
|
+
if (Gn(t.event)) return -1;
|
|
2276
|
+
let n = {}, r = t.__global__, l = t.__config__, o = t.__filter__, s = t.__service__, i = t.subscriber;
|
|
2277
|
+
l && (n.__config__ = l), r && (n.__global__ = r), o && (n.__filter__ = o);
|
|
2278
|
+
return br(e, n, tl, fl(e, Xe(i), s)), mr(e, n, "__subscribing__"), cl(e, t.event, n);
|
|
2279
|
+
}
|
|
2280
|
+
function bl(e, t, n, r) {
|
|
2281
|
+
let l = e.priv;
|
|
2282
|
+
return xe(e) && (l.websocket = il(e)), 0;
|
|
2283
|
+
}
|
|
2284
|
+
function pl(e, t, n, r) {
|
|
2285
|
+
return gn("Websocket opened: " + e.priv.url), gl(e), 0;
|
|
2286
|
+
}
|
|
2287
|
+
function ml(e, t, n, r) {
|
|
2288
|
+
let l = e.priv, o = n.e, s = n.url;
|
|
2289
|
+
return an(), fn(`${et(e)}: WebSocket closed ${s} (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, qt(e, "EV_ON_CLOSE", {
|
|
2290
|
+
url: s,
|
|
2291
|
+
remote_yuno_name: l.remote_yuno_name,
|
|
2292
|
+
remote_yuno_role: l.remote_yuno_role,
|
|
2293
|
+
remote_yuno_service: l.remote_yuno_service
|
|
2294
|
+
})) : (fn(`${et(e)}: EV_ON_OPEN_ERROR cannot open ${s} (Code: ${o.code}, Reason: "${o.reason}", Clean: ${o.wasClean})`), qt(e, "EV_ON_OPEN_ERROR", {
|
|
2295
|
+
url: s,
|
|
2296
|
+
remote_yuno_name: l.remote_yuno_name,
|
|
2297
|
+
remote_yuno_role: l.remote_yuno_role,
|
|
2298
|
+
remote_yuno_service: l.remote_yuno_service,
|
|
2299
|
+
code: o.code,
|
|
2300
|
+
reason: o.reason,
|
|
2301
|
+
was_clean: o.wasClean
|
|
2302
|
+
})), xe(e) && xr(l.gobj_timer, function(e) {
|
|
2303
|
+
let t = e.priv, n = vt(e, "timeout_retry"), r = vt(e, "timeout_retry_max");
|
|
2164
2304
|
r < n && (r = n);
|
|
2165
2305
|
t.retry_ms = t.retry_ms ? Math.min(2 * t.retry_ms, r) : n;
|
|
2166
|
-
let
|
|
2167
|
-
return Math.max(1, Math.round(
|
|
2306
|
+
let l = .2 * t.retry_ms, o = t.retry_ms - l + 2 * Math.random() * l;
|
|
2307
|
+
return Math.max(1, Math.round(o));
|
|
2168
2308
|
}(e)), 0;
|
|
2169
2309
|
}
|
|
2170
|
-
function
|
|
2171
|
-
return
|
|
2310
|
+
function El(e, t, n, r) {
|
|
2311
|
+
return gl(e), 0;
|
|
2172
2312
|
}
|
|
2173
|
-
function
|
|
2174
|
-
let
|
|
2175
|
-
|
|
2176
|
-
let
|
|
2177
|
-
|
|
2178
|
-
let a =
|
|
2313
|
+
function hl(e, t, n, r) {
|
|
2314
|
+
let l = e.priv;
|
|
2315
|
+
Br(l.gobj_timer);
|
|
2316
|
+
let o = pr(e, n, tl, !0), s = zn(e, o, "src_yuno", ""), i = zn(e, o, "src_role", ""), _ = zn(e, o, "src_service", "");
|
|
2317
|
+
Dt(e, "remote_yuno_name", s), Dt(e, "remote_yuno_role", i), Dt(e, "remote_yuno_service", _);
|
|
2318
|
+
let a = qn(e, n, "result", -1, 0), u = zn(e, n, "comment", "", 0), c = zn(e, n, "username", "", 0), f = Zn(e, n, "services_roles", {});
|
|
2179
2319
|
if (a < 0) {
|
|
2180
|
-
|
|
2320
|
+
_l(e);
|
|
2181
2321
|
let t = {
|
|
2182
|
-
url:
|
|
2322
|
+
url: jt(e, "url"),
|
|
2183
2323
|
result: a,
|
|
2184
2324
|
comment: u,
|
|
2185
2325
|
username: c,
|
|
2186
|
-
remote_yuno_name:
|
|
2187
|
-
remote_yuno_role:
|
|
2326
|
+
remote_yuno_name: s,
|
|
2327
|
+
remote_yuno_role: i,
|
|
2188
2328
|
remote_yuno_service: _
|
|
2189
2329
|
};
|
|
2190
|
-
|
|
2330
|
+
lt(e) ? Ft(nt(e), "EV_ON_ID_NAK", t, e) : qt(e, "EV_ON_ID_NAK", t);
|
|
2191
2331
|
} else {
|
|
2192
|
-
if (
|
|
2193
|
-
|
|
2332
|
+
if (At(e, "ST_SESSION"), l.inside_on_open = !0, l.retry_ms = 0, !l.inform_on_close) {
|
|
2333
|
+
l.inform_on_close = !0;
|
|
2194
2334
|
let t = {
|
|
2195
2335
|
username: c,
|
|
2196
|
-
remote_yuno_name:
|
|
2197
|
-
remote_yuno_role:
|
|
2336
|
+
remote_yuno_name: s,
|
|
2337
|
+
remote_yuno_role: i,
|
|
2198
2338
|
remote_yuno_service: _,
|
|
2199
2339
|
services_roles: f
|
|
2200
2340
|
};
|
|
2201
|
-
|
|
2341
|
+
lt(e) ? Ft(nt(e), "EV_ON_OPEN", t, e) : qt(e, "EV_ON_OPEN", t);
|
|
2202
2342
|
}
|
|
2203
|
-
|
|
2204
|
-
let t =
|
|
2205
|
-
for (let n = 0; n < t.length; n++)
|
|
2343
|
+
l.inside_on_open = !1, function(e) {
|
|
2344
|
+
let t = Jt(e, null, null, null);
|
|
2345
|
+
for (let n = 0; n < t.length; n++) dl(e, t[n]);
|
|
2206
2346
|
}(e);
|
|
2207
2347
|
}
|
|
2208
2348
|
return 0;
|
|
2209
2349
|
}
|
|
2210
|
-
function
|
|
2211
|
-
let
|
|
2350
|
+
function Tl(e, t, n, r) {
|
|
2351
|
+
let l = e.priv.url, o = function(e, t) {
|
|
2212
2352
|
let n;
|
|
2213
2353
|
try {
|
|
2214
2354
|
n = JSON.parse(t);
|
|
2215
2355
|
} catch (e) {
|
|
2216
|
-
return
|
|
2356
|
+
return cn("parsing inter_event json: " + e), null;
|
|
2217
2357
|
}
|
|
2218
|
-
if (!(n instanceof Object)) return
|
|
2358
|
+
if (!(n instanceof Object)) return cn("parsing inter_event: websocket data not a json object"), null;
|
|
2219
2359
|
let r = n.event;
|
|
2220
|
-
if (!r) return
|
|
2221
|
-
if ("string" != typeof r) return
|
|
2222
|
-
let
|
|
2223
|
-
return
|
|
2360
|
+
if (!r) return cn("parsing inter_event: no event"), null;
|
|
2361
|
+
if ("string" != typeof r) return cn("parsing inter_event: event not a string"), null;
|
|
2362
|
+
let l = n.kw;
|
|
2363
|
+
return l ? l instanceof Object ? {
|
|
2224
2364
|
event: r,
|
|
2225
|
-
kw:
|
|
2226
|
-
} : (
|
|
2365
|
+
kw: l || {}
|
|
2366
|
+
} : (cn("parsing inter_event: kw not a json object"), null) : (cn("parsing inter_kw: no kw"), null);
|
|
2227
2367
|
}(0, n.data);
|
|
2228
|
-
if (
|
|
2229
|
-
let e =
|
|
2230
|
-
r ? r(e,
|
|
2231
|
-
}
|
|
2232
|
-
let
|
|
2233
|
-
if ("ST_SESSION" !==
|
|
2234
|
-
if (
|
|
2235
|
-
if (!(
|
|
2236
|
-
} else
|
|
2237
|
-
return
|
|
2238
|
-
}
|
|
2239
|
-
|
|
2240
|
-
let _ =
|
|
2241
|
-
if (u.toLowerCase() !==
|
|
2242
|
-
let c =
|
|
2368
|
+
if (ll(e)) {
|
|
2369
|
+
let e = Xe(He()) + " <== " + l, t = n.data.length, r = ht(He(), "trace_ievent_callback");
|
|
2370
|
+
r ? r(e, o, 2, t) : al(0, e, o);
|
|
2371
|
+
}
|
|
2372
|
+
let s = o.event, i = o.kw;
|
|
2373
|
+
if ("ST_SESSION" !== kt(e)) {
|
|
2374
|
+
if (It(e, s, D.EVF_PUBLIC_EVENT)) {
|
|
2375
|
+
if (!(Ft(e, s, i, e) < 0)) return 0;
|
|
2376
|
+
} else cn(`${et(e)}: event UNKNOWN in not-session state ${s}`);
|
|
2377
|
+
return _l(e), -1;
|
|
2378
|
+
}
|
|
2379
|
+
o = null;
|
|
2380
|
+
let _ = Er(e, i), a = pr(e, i, tl), u = zn(e, a, "dst_role", "");
|
|
2381
|
+
if (u.toLowerCase() !== ze().toLowerCase()) return cn(`"It's not my role, dst_role: ${u}, my_role: ${ze()}`), 0;
|
|
2382
|
+
let c = zn(e, a, "dst_service", "");
|
|
2243
2383
|
if ("__subscribing__" === _) return -1;
|
|
2244
2384
|
if ("__unsubscribing__" === _) return -1;
|
|
2245
|
-
if (
|
|
2246
|
-
if (!
|
|
2247
|
-
let t =
|
|
2248
|
-
return t ?
|
|
2385
|
+
if (It(e, s, D.EVF_PUBLIC_EVENT)) return Ft(e, s, i, e), 0;
|
|
2386
|
+
if (!Gn(c)) {
|
|
2387
|
+
let t = we(c, !1);
|
|
2388
|
+
return t ? It(t, s, D.EVF_PUBLIC_EVENT) ? (Ft(t, s, i, e), 0) : (cn(`${et(e)}: Service found but no event or not public, service '${et(t)}', ev '${s}'`), -1) : (fn(`${et(e)}: event for a service that is gone, DROPPED: service '${c}', ev '${s}'`), 0);
|
|
2249
2389
|
}
|
|
2250
|
-
return
|
|
2390
|
+
return lt(e) ? Ft(nt(e), s, i, e) : qt(e, s, i), 0;
|
|
2251
2391
|
}
|
|
2252
|
-
function
|
|
2392
|
+
function yl(e, t, n, r) {
|
|
2253
2393
|
return 0;
|
|
2254
2394
|
}
|
|
2255
|
-
function
|
|
2395
|
+
function vl(e, t, n, r) {
|
|
2256
2396
|
return 0;
|
|
2257
2397
|
}
|
|
2258
|
-
var
|
|
2398
|
+
var jl = {
|
|
2259
2399
|
mt_create: function(e) {
|
|
2260
2400
|
let t = e.priv;
|
|
2261
|
-
t.gobj_timer =
|
|
2262
|
-
const n =
|
|
2263
|
-
n &&
|
|
2401
|
+
t.gobj_timer = Ce(Xe(e), "C_TIMER", {}, e), t.url = jt(e, "url"), t.remote_yuno_name = jt(e, "remote_yuno_name"), t.remote_yuno_role = jt(e, "remote_yuno_role"), t.remote_yuno_service = jt(e, "remote_yuno_service"), Dt(e, "wanted_yuno_name", t.remote_yuno_name), Dt(e, "wanted_yuno_role", t.remote_yuno_role), Dt(e, "wanted_yuno_service", t.remote_yuno_service);
|
|
2402
|
+
const n = St(e, "subscriber");
|
|
2403
|
+
n && Yt(e, null, {}, n);
|
|
2264
2404
|
},
|
|
2265
2405
|
mt_writing: function(e, t) {
|
|
2266
2406
|
let n = e.priv;
|
|
2267
2407
|
switch (t) {
|
|
2268
2408
|
case "url":
|
|
2269
|
-
n.url =
|
|
2409
|
+
n.url = jt(e, "url");
|
|
2270
2410
|
break;
|
|
2271
2411
|
case "remote_yuno_name":
|
|
2272
|
-
n.remote_yuno_name =
|
|
2412
|
+
n.remote_yuno_name = jt(e, "remote_yuno_name");
|
|
2273
2413
|
break;
|
|
2274
2414
|
case "remote_yuno_role":
|
|
2275
|
-
n.remote_yuno_role =
|
|
2415
|
+
n.remote_yuno_role = jt(e, "remote_yuno_role");
|
|
2276
2416
|
break;
|
|
2277
|
-
case "remote_yuno_service": n.remote_yuno_service =
|
|
2417
|
+
case "remote_yuno_service": n.remote_yuno_service = jt(e, "remote_yuno_service");
|
|
2278
2418
|
}
|
|
2279
2419
|
},
|
|
2280
2420
|
mt_start: function(e) {
|
|
2281
2421
|
let t = e.priv;
|
|
2282
|
-
return t.retry_ms = 0, t.websocket =
|
|
2422
|
+
return t.retry_ms = 0, t.websocket = il(e), 0;
|
|
2283
2423
|
},
|
|
2284
2424
|
mt_stop: function(e) {
|
|
2285
2425
|
let t = e.priv;
|
|
2286
|
-
return
|
|
2426
|
+
return Br(t.gobj_timer), t.websocket && _l(e), 0;
|
|
2287
2427
|
},
|
|
2288
2428
|
mt_destroy: function(e) {},
|
|
2289
2429
|
mt_stats: function(e, t, n, r) {
|
|
2290
|
-
if ("ST_SESSION" !==
|
|
2430
|
+
if ("ST_SESSION" !== kt(e)) return cn("Not in session"), null;
|
|
2291
2431
|
n || (n = {});
|
|
2292
|
-
let
|
|
2293
|
-
return
|
|
2432
|
+
let l = fl(e, Xe(r), zn(e, n, "service", null, 0)), o = Zn(e, n, "__md_stats__", null, zt.KW_EXTRACT);
|
|
2433
|
+
return o || (o = {}), br(e, n, "stats_stack", {
|
|
2294
2434
|
stats: t,
|
|
2295
|
-
kw:
|
|
2296
|
-
}),
|
|
2435
|
+
kw: o
|
|
2436
|
+
}), br(e, n, tl, l), n.__stats__ = t, mr(e, n, "__stats__"), cl(e, "EV_MT_STATS", n, r), null;
|
|
2297
2437
|
},
|
|
2298
2438
|
mt_command_parser: function(e, t, n, r) {
|
|
2299
|
-
if ("ST_SESSION" !==
|
|
2439
|
+
if ("ST_SESSION" !== kt(e)) return cn("Not in session"), null;
|
|
2300
2440
|
n || (n = {});
|
|
2301
|
-
let
|
|
2302
|
-
return
|
|
2441
|
+
let l = fl(e, Xe(r), zn(e, n, "service", "", 0)), o = Zn(e, n, "__md_command__", null, zt.KW_EXTRACT);
|
|
2442
|
+
return o || (o = {}), br(e, n, "command_stack", {
|
|
2303
2443
|
command: t,
|
|
2304
|
-
kw:
|
|
2305
|
-
}),
|
|
2444
|
+
kw: o
|
|
2445
|
+
}), br(e, n, tl, l), n.__command__ = t, mr(e, n, "__command__"), cl(e, "EV_MT_COMMAND", n, r), null;
|
|
2306
2446
|
},
|
|
2307
2447
|
mt_inject_event: function(e, t, n, r) {
|
|
2308
|
-
if ("ST_SESSION" !==
|
|
2309
|
-
if (n || (n = {}),
|
|
2448
|
+
if ("ST_SESSION" !== kt(e)) return window.console.error("Not in session"), -1;
|
|
2449
|
+
if (n || (n = {}), pr(e, n, tl));
|
|
2310
2450
|
else {
|
|
2311
|
-
let
|
|
2312
|
-
|
|
2451
|
+
let l = fl(e, Xe(r), zn(e, n, "__service__", 0, 0));
|
|
2452
|
+
vn(n, "__service__"), br(e, n, "__message__", t), br(e, n, tl, l);
|
|
2313
2453
|
}
|
|
2314
|
-
return
|
|
2454
|
+
return mr(e, n, "__message__"), cl(e, t, n, r);
|
|
2315
2455
|
},
|
|
2316
2456
|
mt_subscription_added: function(e, t) {
|
|
2317
2457
|
let n = e.priv;
|
|
2318
|
-
return "ST_SESSION" ===
|
|
2458
|
+
return "ST_SESSION" === kt(e) && n.websocket ? n.inside_on_open ? 0 : dl(e, t) : 0;
|
|
2319
2459
|
},
|
|
2320
2460
|
mt_subscription_deleted: function(e, t) {
|
|
2321
2461
|
let n = e.priv;
|
|
2322
|
-
if ("ST_SESSION" !==
|
|
2462
|
+
if ("ST_SESSION" !== kt(e) || !n.websocket) return 0;
|
|
2323
2463
|
if (n.inside_on_open) return 0;
|
|
2324
|
-
if (
|
|
2325
|
-
let r = {},
|
|
2326
|
-
|
|
2327
|
-
return
|
|
2464
|
+
if (Gn(t.event)) return 0;
|
|
2465
|
+
let r = {}, l = t.__global__, o = t.__config__, s = t.__filter__, i = t.__service__, _ = t.subscriber;
|
|
2466
|
+
o && (r.__config__ = o), l && (r.__global__ = l), s && (r.__filter__ = s);
|
|
2467
|
+
return br(e, r, tl, fl(e, Xe(_), i)), mr(e, r, "__unsubscribing__"), cl(e, t.event, r, e);
|
|
2328
2468
|
}
|
|
2329
2469
|
};
|
|
2330
|
-
return e.GObj =
|
|
2470
|
+
return e.GObj = O, e.SDATA = j, e.SDATAAUTHZ = (e, t, n, r, l, o) => new y(e, t, n, null, o, r, null, 0, null, l, null), e.SDATACM = (e, t, n, r, l, o) => new y(e, t, 0, null, o, n, null, 0, l, r, null), e.SDATACM2 = (e, t, n, r, l, o, s) => new y(e, t, n, null, s, r, null, 0, o, l, null), e.SDATADF = (e, t, n, r, l, o) => new y(e, t, n, null, o, null, r, l), e.SDATAPM = (e, t, n, r, l) => new y(e, t, n, r, l), e.SDATAPM0 = (e, t, n, r, l) => new y(e, t, n, null, l, null, null, 0, null, null, r), e.SDATA_END = v, e.SDataDesc = y, e.YUNETA_VERSION = s, Object.defineProperty(e, "__yuno__", {
|
|
2331
2471
|
enumerable: !0,
|
|
2332
2472
|
get: function() {
|
|
2333
2473
|
return p;
|
|
2334
2474
|
}
|
|
2335
|
-
}), e.build_command_response =
|
|
2475
|
+
}), e.build_command_response = l, e.build_path = function(...e) {
|
|
2336
2476
|
let t = "", n = 0;
|
|
2337
2477
|
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++));
|
|
2338
2478
|
return t;
|
|
2339
|
-
}, e.build_stats_response =
|
|
2479
|
+
}, e.build_stats_response = o, e.clean_name = function(e) {
|
|
2340
2480
|
return e.replace(/[?# ^:]/g, "_");
|
|
2341
|
-
}, e.clear_timeout =
|
|
2342
|
-
let [r,
|
|
2343
|
-
if (!r) return void
|
|
2344
|
-
let
|
|
2345
|
-
if (
|
|
2481
|
+
}, e.clear_timeout = Br, e.cmp_two_simple_json = Kn, e.command_parser = function(e, t, n, r) {}, e.createElement2 = function e(t, n) {
|
|
2482
|
+
let [r, l, o, s] = t;
|
|
2483
|
+
if (!r) return void cn("Tag must be a valid HTML element.");
|
|
2484
|
+
let i = document.createElement(r), _ = "";
|
|
2485
|
+
if (l && "object" == typeof l) for (let e of Object.keys(l)) if ("style" === e && "object" == typeof l[e]) {
|
|
2346
2486
|
let t = "";
|
|
2347
|
-
for (const n of Object.keys(
|
|
2348
|
-
|
|
2349
|
-
} else "style" === e ?
|
|
2350
|
-
if (
|
|
2351
|
-
else if (n && _)
|
|
2352
|
-
else
|
|
2353
|
-
else if (
|
|
2354
|
-
if (
|
|
2355
|
-
else for (let t of
|
|
2356
|
-
} else
|
|
2357
|
-
if (
|
|
2358
|
-
return
|
|
2359
|
-
}, e.createOneHtml =
|
|
2360
|
-
let n =
|
|
2361
|
-
return
|
|
2487
|
+
for (const n of Object.keys(l[e])) t += `${n}: ${l[e][n]};`;
|
|
2488
|
+
i.style.cssText = t;
|
|
2489
|
+
} else "style" === e ? i.style.cssText = l[e] : "i18n" === e || "data-i18n" === e || "data_i18next" === e || "data-i18next" === e ? null !== l[e] && void 0 !== l[e] && (_ = l[e], i.setAttribute("data-i18n", _)) : i.setAttribute(e, l[e]);
|
|
2490
|
+
if (In(o)) if (o = o.trim(), o.length > 0 && "<" === o[0]) i.appendChild(jr(o));
|
|
2491
|
+
else if (n && _) i.textContent = n(_) || o;
|
|
2492
|
+
else i.textContent = o;
|
|
2493
|
+
else if ($n(o)) {
|
|
2494
|
+
if (o.length > 0) if (In(o[0])) i.appendChild(e(o, n));
|
|
2495
|
+
else for (let t of o) Array.isArray(t) && t.length > 0 ? i.appendChild(e(t, n)) : t instanceof HTMLElement && i.appendChild(t);
|
|
2496
|
+
} else o instanceof HTMLElement || o instanceof Text || o instanceof SVGElement ? i.appendChild(o) : null != o && (cn("content ignored"), bn(o));
|
|
2497
|
+
if (s && "object" == typeof s) for (const e of Object.keys(s)) i.addEventListener(e, s[e]);
|
|
2498
|
+
return i;
|
|
2499
|
+
}, e.createOneHtml = jr, e.create_json_record = function(e, t) {
|
|
2500
|
+
let n = pn(e);
|
|
2501
|
+
return hn(n, t), n;
|
|
2362
2502
|
}, e.create_template_record = function(e, t) {
|
|
2363
2503
|
let n = {};
|
|
2364
2504
|
return t || (t = {}), Object.entries(e).forEach(([e, r]) => {
|
|
2365
|
-
let
|
|
2366
|
-
|
|
2367
|
-
let
|
|
2368
|
-
n[e] =
|
|
2505
|
+
let l;
|
|
2506
|
+
kn(r) && (l = r.default);
|
|
2507
|
+
let o = Zn(null, t, e, l);
|
|
2508
|
+
n[e] = o;
|
|
2369
2509
|
}), n;
|
|
2370
|
-
}, e.current_timestamp =
|
|
2371
|
-
let n =
|
|
2372
|
-
return n &&
|
|
2510
|
+
}, e.current_timestamp = Sr, e.data_type_t = h, e.db_list_persistent_attrs = function(e, t) {
|
|
2511
|
+
let n = sr(Ir(e), null, !1), r = {};
|
|
2512
|
+
return n && kn(n) && (r = lr(e, n, t, !1)), r;
|
|
2373
2513
|
}, e.db_load_persistent_attrs = function(e, t) {
|
|
2374
|
-
let n =
|
|
2375
|
-
if (r &&
|
|
2376
|
-
let
|
|
2377
|
-
|
|
2514
|
+
let n = Tt(e, T.SDF_PERSIST), r = sr(Ir(e), null, !1);
|
|
2515
|
+
if (r && kn(r)) {
|
|
2516
|
+
let l = lr(e, r, t, !1);
|
|
2517
|
+
l = lr(e, l, n, !1), wt(e, l, T.SDF_PERSIST);
|
|
2378
2518
|
}
|
|
2379
2519
|
}, e.db_remove_persistent_attrs = function(e, t) {
|
|
2380
|
-
let n =
|
|
2381
|
-
0 ===
|
|
2520
|
+
let n = or(e, sr(Ir(e), null, !1), t, !1);
|
|
2521
|
+
0 === Rn(n) ? _r(Ir(e)) : ir(Ir(e), n);
|
|
2382
2522
|
}, e.db_save_persistent_attrs = function(e, t) {
|
|
2383
|
-
let n =
|
|
2384
|
-
return r &&
|
|
2523
|
+
let n = lr(e, Tt(e, T.SDF_PERSIST), t, !1), r = sr(Ir(e), null, !1);
|
|
2524
|
+
return r && kn(r) && Tn(n, r), ir(Ir(e), n);
|
|
2385
2525
|
}, e.debounce = function(e, t = 0, n = !1) {
|
|
2386
|
-
let r = null,
|
|
2387
|
-
const
|
|
2388
|
-
|
|
2389
|
-
const
|
|
2526
|
+
let r = null, l = null, o = null;
|
|
2527
|
+
const s = (...s) => {
|
|
2528
|
+
o = this, l = s;
|
|
2529
|
+
const i = n && !r;
|
|
2390
2530
|
clearTimeout(r), r = setTimeout(() => {
|
|
2391
|
-
r = null, n || e.apply(
|
|
2392
|
-
}, t),
|
|
2531
|
+
r = null, n || e.apply(o, l);
|
|
2532
|
+
}, t), i && e.apply(o, l);
|
|
2393
2533
|
};
|
|
2394
|
-
return
|
|
2395
|
-
r && (clearTimeout(r), r = null, e.apply(
|
|
2396
|
-
},
|
|
2397
|
-
clearTimeout(r), r = null,
|
|
2398
|
-
},
|
|
2534
|
+
return s.flush = () => {
|
|
2535
|
+
r && (clearTimeout(r), r = null, e.apply(o, l));
|
|
2536
|
+
}, s.cancel = () => {
|
|
2537
|
+
clearTimeout(r), r = null, l = null, o = null;
|
|
2538
|
+
}, s;
|
|
2399
2539
|
}, e.delete_from_list = function(e, t) {
|
|
2400
2540
|
for (let n = 0; n < e.length; n++) if (t === e[n]) return e.splice(n, 1), !0;
|
|
2401
2541
|
return !1;
|
|
@@ -2407,40 +2547,40 @@ var gobjJs = function(e) {
|
|
|
2407
2547
|
}
|
|
2408
2548
|
return t;
|
|
2409
2549
|
}, e.empty_json = function(e) {
|
|
2410
|
-
return 0 ===
|
|
2411
|
-
}, e.empty_string =
|
|
2550
|
+
return 0 === An(e);
|
|
2551
|
+
}, e.empty_string = Gn, e.escapeHtml = vr, e.event_flag_t = D, e.flat2json = function(e) {
|
|
2412
2552
|
if (null === e || "object" != typeof e || Array.isArray(e)) throw new Error("flat2json: a flat json is an object of id -> value");
|
|
2413
2553
|
let t = null;
|
|
2414
2554
|
for (const n of Object.keys(e)) {
|
|
2415
|
-
const r =
|
|
2555
|
+
const r = kr(n);
|
|
2416
2556
|
if (!r || 0 === r.length) throw new Error(`flat2json: malformed flat id: '${n}'`);
|
|
2417
|
-
if (r.length >
|
|
2418
|
-
const
|
|
2419
|
-
if (null === t) t =
|
|
2420
|
-
else if (
|
|
2421
|
-
let
|
|
2557
|
+
if (r.length > Rr) throw new Error(`flat2json: '${n}' deeper than 256`);
|
|
2558
|
+
const l = "number" == typeof r[0];
|
|
2559
|
+
if (null === t) t = l ? [] : {};
|
|
2560
|
+
else if (l !== Array.isArray(t)) throw new Error(`flat2json: '${n}' does not fit a ${Array.isArray(t) ? "array" : "object"} root`);
|
|
2561
|
+
let o = t;
|
|
2422
2562
|
for (let t = 0; t < r.length; t++) {
|
|
2423
|
-
const
|
|
2424
|
-
if (
|
|
2425
|
-
if (
|
|
2426
|
-
if (
|
|
2427
|
-
if (Array.isArray(
|
|
2428
|
-
for (;
|
|
2429
|
-
|
|
2563
|
+
const l = r[t], s = "number" == typeof l, i = t === r.length - 1, _ = !i && "number" == typeof r[t + 1];
|
|
2564
|
+
if (s && l > Dr) throw new Error(`flat2json: array index ${l} over the limit (100000) in '${n}'`);
|
|
2565
|
+
if (s !== Array.isArray(o)) throw new Error(`flat2json: '${n}' uses a ${s ? "array index" : "key"} where the tree already has a ${Array.isArray(o) ? "array" : "object"}`);
|
|
2566
|
+
if (i) {
|
|
2567
|
+
if (Array.isArray(o)) {
|
|
2568
|
+
for (; o.length <= l;) o.push(null);
|
|
2569
|
+
o[l] = e[n];
|
|
2430
2570
|
} else {
|
|
2431
|
-
if (Object.prototype.hasOwnProperty.call(
|
|
2432
|
-
|
|
2571
|
+
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`);
|
|
2572
|
+
o[l] = e[n];
|
|
2433
2573
|
}
|
|
2434
2574
|
break;
|
|
2435
2575
|
}
|
|
2436
2576
|
let a;
|
|
2437
|
-
if (Array.isArray(
|
|
2438
|
-
for (;
|
|
2439
|
-
a =
|
|
2440
|
-
} else a =
|
|
2577
|
+
if (Array.isArray(o)) {
|
|
2578
|
+
for (; o.length <= l;) o.push(null);
|
|
2579
|
+
a = o[l], null == a && (a = _ ? [] : {}, o[l] = a);
|
|
2580
|
+
} else a = o[l], void 0 === a && (a = _ ? [] : {}, o[l] = a);
|
|
2441
2581
|
if (null === a || "object" != typeof a) throw new Error(`flat2json: '${n}' walks through a value: the same id is a leaf and a container at once`);
|
|
2442
2582
|
if (_ !== Array.isArray(a)) throw new Error(`flat2json: '${n}' needs a ${_ ? "array" : "object"} where the tree already has a ${Array.isArray(a) ? "array" : "object"}`);
|
|
2443
|
-
|
|
2583
|
+
o = a;
|
|
2444
2584
|
}
|
|
2445
2585
|
}
|
|
2446
2586
|
return null === t ? {} : t;
|
|
@@ -2456,114 +2596,116 @@ var gobjJs = function(e) {
|
|
|
2456
2596
|
}
|
|
2457
2597
|
return e;
|
|
2458
2598
|
}, e.flat_diff = function(e, t) {
|
|
2459
|
-
const n = e && "object" == typeof e ? e : {}, r = t && "object" == typeof t ? t : {},
|
|
2599
|
+
const n = e && "object" == typeof e ? e : {}, r = t && "object" == typeof t ? t : {}, l = {
|
|
2460
2600
|
added: {},
|
|
2461
2601
|
removed: {},
|
|
2462
2602
|
changed: {}
|
|
2463
2603
|
};
|
|
2464
|
-
for (const e of Object.keys(n)) Object.prototype.hasOwnProperty.call(r, e) ?
|
|
2604
|
+
for (const e of Object.keys(n)) Object.prototype.hasOwnProperty.call(r, e) ? $r(n[e], r[e]) || (l.changed[e] = {
|
|
2465
2605
|
from: n[e],
|
|
2466
2606
|
to: r[e]
|
|
2467
|
-
}) :
|
|
2468
|
-
for (const e of Object.keys(r)) Object.prototype.hasOwnProperty.call(n, e) || (
|
|
2469
|
-
return
|
|
2607
|
+
}) : l.removed[e] = n[e];
|
|
2608
|
+
for (const e of Object.keys(r)) Object.prototype.hasOwnProperty.call(n, e) || (l.added[e] = r[e]);
|
|
2609
|
+
return l;
|
|
2470
2610
|
}, e.flat_key_join = function(e) {
|
|
2471
|
-
return Array.isArray(e) && 0 !== e.length ? e.map((e) => "number" == typeof e ? `[${e}]` :
|
|
2472
|
-
}, e.flat_key_split =
|
|
2611
|
+
return Array.isArray(e) && 0 !== e.length ? e.map((e) => "number" == typeof e ? `[${e}]` : Ar(e)).join("`") : "";
|
|
2612
|
+
}, e.flat_key_split = kr, e.gclass_add_ev_action = he, e.gclass_add_event_type = ye, e.gclass_add_state = Ee, e.gclass_check_fsm = je, e.gclass_create = de, e.gclass_event_type = ve, e.gclass_find_by_name = Se, e.gclass_flag_t = w, e.gclass_unregister = be, e.getPositionRelativeToBody = function(e) {
|
|
2473
2613
|
if (!e) return {
|
|
2474
2614
|
top: 0,
|
|
2475
2615
|
left: 0,
|
|
2476
2616
|
right: 0,
|
|
2477
2617
|
bottom: 0
|
|
2478
2618
|
};
|
|
2479
|
-
const { top: t, left: n, width: r, height:
|
|
2619
|
+
const { top: t, left: n, width: r, height: l } = e.getBoundingClientRect?.() || {
|
|
2480
2620
|
top: 0,
|
|
2481
2621
|
left: 0,
|
|
2482
2622
|
width: 0,
|
|
2483
2623
|
height: 0
|
|
2484
|
-
},
|
|
2624
|
+
}, o = "undefined" != typeof window, s = o && (window.scrollY || document.documentElement?.scrollTop || document.body?.scrollTop) || 0, i = o && (window.scrollX || document.documentElement?.scrollLeft || document.body?.scrollLeft) || 0;
|
|
2485
2625
|
return {
|
|
2486
|
-
top: t +
|
|
2487
|
-
left: n +
|
|
2488
|
-
right: n +
|
|
2489
|
-
bottom: t +
|
|
2626
|
+
top: t + s,
|
|
2627
|
+
left: n + i,
|
|
2628
|
+
right: n + i + r,
|
|
2629
|
+
bottom: t + s + l
|
|
2490
2630
|
};
|
|
2491
|
-
}, e.get_function_name =
|
|
2631
|
+
}, e.get_function_name = Nr, e.get_now = function() {
|
|
2492
2632
|
return Math.floor(Date.now() / 1e3);
|
|
2493
|
-
}, e.gobj_bottom_gobj =
|
|
2494
|
-
return
|
|
2495
|
-
}, e.gobj_change_state =
|
|
2496
|
-
|
|
2497
|
-
|
|
2498
|
-
|
|
2633
|
+
}, e.gobj_bottom_gobj = st, e.gobj_change_parent = function(e, t) {
|
|
2634
|
+
return ot(e) ? (cn("gobj NULL or DESTROYED"), null) : t instanceof O ? (e.parent && e.parent.mt_child_removed && e.parent.mt_child_removed(e.parent, e), e.parent && (De(e.parent, e), e.parent = null), Re(t, e), t.mt_child_added && (Y(e) && gn(n("👦👦🔵 child_added(%s): %s", tt(t), et(e))), t.mt_child_added(t, e)), 0) : (cn(`${et(e)}: gobj_change_parent() BAD TYPE of parent`), -1);
|
|
2635
|
+
}, e.gobj_change_state = At, e.gobj_command = function(e, t, r, o) {
|
|
2636
|
+
return ot(e) ? (cn("gobj NULL or DESTROYED"), -1) : ((function(e) {
|
|
2637
|
+
return V > 1 || !!e && !!(K(e) & L.TRACE_COMMANDS);
|
|
2638
|
+
}(e) || q(e, null) && !z(o, null)) && (P(n("🌀🌀 mach(%s%s), cmd: %s, src: %s", xe(e) ? "" : "!!", et(e), t, et(o))), H(e) && bn(r)), e.gclass.gmt.mt_command_parser ? e.gclass.gmt.mt_command_parser(e, t, r, o) : e.gclass.command_table ? c ? c(e, t, r, o) : l(0, -1, n("%s: global command parser not available", et(e)), 0, 0) : l(0, -1, n("%s: command table not available", et(e)), 0, 0));
|
|
2499
2639
|
}, e.gobj_create = function(e, t, n, r) {
|
|
2500
|
-
return
|
|
2501
|
-
}, e.gobj_create2 =
|
|
2502
|
-
return
|
|
2503
|
-
}, e.gobj_create_pure_child =
|
|
2504
|
-
return
|
|
2640
|
+
return Ie(e, t, n, r, 0);
|
|
2641
|
+
}, e.gobj_create2 = Ie, e.gobj_create_default_service = function(e, t, n, r) {
|
|
2642
|
+
return Ie(e, t, n, r, N.gobj_flag_default_service | N.gobj_flag_autostart);
|
|
2643
|
+
}, e.gobj_create_pure_child = Ce, e.gobj_create_service = function(e, t, n, r) {
|
|
2644
|
+
return Ie(e, t, n, r, N.gobj_flag_service);
|
|
2505
2645
|
}, e.gobj_create_volatil = function(e, t, n, r) {
|
|
2506
|
-
return
|
|
2646
|
+
return Ie(e, t, n, r, N.gobj_flag_volatil);
|
|
2507
2647
|
}, e.gobj_create_yuno = function(e, t, n) {
|
|
2508
|
-
return
|
|
2509
|
-
}, e.gobj_current_state =
|
|
2510
|
-
if (
|
|
2648
|
+
return Ie(e, t, n, null, N.gobj_flag_yuno);
|
|
2649
|
+
}, e.gobj_current_state = kt, e.gobj_default_service = Oe, e.gobj_deliver_posted_events = Ut, e.gobj_destroy = Pe, e.gobj_find_child = pt, e.gobj_find_gobj = function(e, t) {
|
|
2650
|
+
if (Gn(t)) return null;
|
|
2511
2651
|
const n = t.toLowerCase();
|
|
2512
|
-
return "__default_service__" === n ? m : "__yuno__" === n || "__root__" === n ? p :
|
|
2513
|
-
}, e.gobj_find_service =
|
|
2652
|
+
return "__default_service__" === n ? m : "__yuno__" === n || "__root__" === n ? p : mt(p, t);
|
|
2653
|
+
}, e.gobj_find_service = we, e.gobj_find_subscribings = Ht, e.gobj_find_subscriptions = Jt, e.gobj_flag_t = N, e.gobj_full_name = tt, e.gobj_gclass_name = Ze, e.gobj_get_gclass_trace_level = re, e.gobj_get_gclass_trace_level2 = le, e.gobj_get_gclass_trace_no_level = oe, e.gobj_get_global_trace_level = te, e.gobj_get_global_trace_no_level = ne, e.gobj_global_trace_level = function() {
|
|
2514
2654
|
return F;
|
|
2515
|
-
}, e.
|
|
2655
|
+
}, e.gobj_global_trace_no_level = function() {
|
|
2656
|
+
return G;
|
|
2657
|
+
}, e.gobj_has_attr = Et, e.gobj_has_event = It, e.gobj_has_output_event = Ct, e.gobj_hsdata = ce, e.gobj_is_destroying = ot, e.gobj_is_playing = Je, e.gobj_is_pure_child = lt, e.gobj_is_running = xe, e.gobj_is_service = Be, e.gobj_is_volatil = rt, e.gobj_list_persistent_attrs = function(e, t) {
|
|
2516
2658
|
return u ? u(e, t) : null;
|
|
2517
2659
|
}, e.gobj_list_subscriptions = function(e) {
|
|
2518
|
-
let t =
|
|
2660
|
+
let t = Jt(e, null, null, null);
|
|
2519
2661
|
for (let n = 0; n < t.length; n++) {
|
|
2520
|
-
let r = t[n],
|
|
2521
|
-
|
|
2662
|
+
let r = t[n], l = Qn(e, r, "publisher", null, zt.KW_REQUIRED), o = Qn(e, r, "subscriber", null, zt.KW_REQUIRED);
|
|
2663
|
+
Sn(r, "s_event", zn(e, r, "event", "", zt.KW_REQUIRED)), Sn(r, "s_publisher", et(l)), Sn(r, "s_subscriber", et(o));
|
|
2522
2664
|
}
|
|
2523
|
-
let n =
|
|
2665
|
+
let n = Ht(e, 0, null, 0);
|
|
2524
2666
|
for (let t = 0; t < n.length; t++) {
|
|
2525
|
-
let r = n[t],
|
|
2526
|
-
|
|
2667
|
+
let r = n[t], l = Qn(e, r, "publisher", null, zt.KW_REQUIRED), o = Qn(e, r, "subscriber", null, zt.KW_REQUIRED);
|
|
2668
|
+
Sn(r, "s_event", zn(e, r, "event", "", zt.KW_REQUIRED)), Sn(r, "s_publisher", et(l)), Sn(r, "s_subscriber", et(o));
|
|
2527
2669
|
}
|
|
2528
2670
|
return {
|
|
2529
2671
|
subscriptions: t,
|
|
2530
2672
|
subscribings: n,
|
|
2531
|
-
"total subscriptions":
|
|
2532
|
-
total_subscribings:
|
|
2673
|
+
"total subscriptions": Dn(t),
|
|
2674
|
+
total_subscribings: Dn(n)
|
|
2533
2675
|
};
|
|
2534
2676
|
}, e.gobj_load_persistent_attrs = function(e, t) {
|
|
2535
|
-
return
|
|
2677
|
+
return Be(e) ? i ? i(e, t) : -1 : (cn(`${et(e)}: Only gobj services can load/save writable-persistent`), -1);
|
|
2536
2678
|
}, e.gobj_match_children = function(e, t) {
|
|
2537
|
-
if (
|
|
2679
|
+
if (ot(e)) return cn("gobj NULL or DESTROYED"), null;
|
|
2538
2680
|
t = t || {};
|
|
2539
2681
|
let n = [];
|
|
2540
2682
|
const r = e.dl_children;
|
|
2541
2683
|
for (let e = 0; e < r.length; e++) {
|
|
2542
|
-
const
|
|
2543
|
-
|
|
2684
|
+
const l = r[e];
|
|
2685
|
+
bt(l, t) && n.push(l);
|
|
2544
2686
|
}
|
|
2545
2687
|
return n;
|
|
2546
2688
|
}, e.gobj_match_children_tree = function(e, t) {
|
|
2547
2689
|
t = t || {};
|
|
2548
2690
|
let n = [];
|
|
2549
2691
|
return function e(n, r) {
|
|
2550
|
-
let
|
|
2551
|
-
for (let r = 0; r <
|
|
2552
|
-
let
|
|
2553
|
-
|
|
2692
|
+
let l = r.dl_children;
|
|
2693
|
+
for (let r = 0; r < l.length; r++) {
|
|
2694
|
+
let o = l[r];
|
|
2695
|
+
bt(o, t) && n.push(o), e(n, o);
|
|
2554
2696
|
}
|
|
2555
2697
|
}(n, e), n;
|
|
2556
|
-
}, e.gobj_match_gobj =
|
|
2557
|
-
return e && e instanceof
|
|
2698
|
+
}, e.gobj_match_gobj = bt, e.gobj_name = Xe, e.gobj_parent = nt, e.gobj_pause = Ke, e.gobj_play = We, e.gobj_post_event = function(e, t, r, l) {
|
|
2699
|
+
return e && e instanceof O ? e.obflag & (R.obflag_destroyed | R.obflag_destroying) ? (cn(`gobj_post_event(): gobj dst DESTROYING, event ${t}`), -1) : Gn(t) ? (cn("gobj_post_event(): event EMPTY"), -1) : It(e, t, 0) ? Pt.length >= 1e4 ? (cn(`gobj_post_event(): too many posted events, this is NOT a work queue, event ${t}, pending ${Pt.length}`), -1) : (Pt.push({
|
|
2558
2700
|
dst: e,
|
|
2559
2701
|
event: t,
|
|
2560
2702
|
kw: r,
|
|
2561
|
-
src:
|
|
2562
|
-
}),
|
|
2703
|
+
src: l
|
|
2704
|
+
}), q(e, t) && !z(l, t) && P(n("📬 posted(%s%s), ev: %s, pending: %d", e.running ? "" : "!!", et(e), t, Pt.length)), Lt || (Lt = !0, setTimeout(Ut, 0)), 0) : (cn(`gobj_post_event(): event NOT DEFINED in gclass ${Ze(e)}, event ${t}`), -1) : (cn(`gobj_post_event(): gobj dst NULL, event ${t}`), -1);
|
|
2563
2705
|
}, e.gobj_posted_events_size = function() {
|
|
2564
|
-
return
|
|
2565
|
-
}, e.gobj_publish_event =
|
|
2566
|
-
return
|
|
2706
|
+
return Pt.length;
|
|
2707
|
+
}, e.gobj_publish_event = qt, e.gobj_read_attr = ht, e.gobj_read_attrs = Tt, e.gobj_read_bool_attr = yt, e.gobj_read_integer_attr = vt, e.gobj_read_pointer_attr = St, e.gobj_read_str_attr = jt, e.gobj_remove_persistent_attrs = function(e, t) {
|
|
2708
|
+
return Be(e) ? a ? a(e, t) : -1 : (cn(`${et(e)}: Only gobj services can load/save writable-persistent`), -1);
|
|
2567
2709
|
}, e.gobj_repr_global_trace_levels = function() {
|
|
2568
2710
|
return U.map(([e, t, n]) => ({
|
|
2569
2711
|
name: e,
|
|
@@ -2573,73 +2715,55 @@ var gobjJs = function(e) {
|
|
|
2573
2715
|
}));
|
|
2574
2716
|
}, e.gobj_reset_volatil_attrs = function(e) {
|
|
2575
2717
|
return function(e, t, n) {
|
|
2576
|
-
if (
|
|
2718
|
+
if (ot(e)) return cn("gobj NULL or DESTROYED"), -1;
|
|
2577
2719
|
let r = e.gclass.attrs_table;
|
|
2578
|
-
for (let
|
|
2579
|
-
const
|
|
2580
|
-
if (
|
|
2581
|
-
const t =
|
|
2582
|
-
|
|
2720
|
+
for (let l = 0; l < r.length; l++) {
|
|
2721
|
+
const o = r[l];
|
|
2722
|
+
if (o.name && !(n && o.flag & n) && (-1 === t || o.flag & t)) {
|
|
2723
|
+
const t = ae(e, e.jn_attrs, o);
|
|
2724
|
+
kn(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);
|
|
2583
2725
|
}
|
|
2584
2726
|
}
|
|
2585
2727
|
return 0;
|
|
2586
|
-
}(e,
|
|
2587
|
-
}, e.gobj_save_persistent_attrs =
|
|
2588
|
-
return Ie(e) ? _ ? _(e, t) : -1 : (qt(`${Ve(e)}: Only gobj services can load/save writable-persistent`), -1);
|
|
2589
|
-
}, e.gobj_search_path = rt, e.gobj_send_event = vt, e.gobj_services = function() {
|
|
2728
|
+
}(e, T.SDF_VOLATIL, 0);
|
|
2729
|
+
}, e.gobj_save_persistent_attrs = Ae, e.gobj_search_path = mt, e.gobj_send_event = Ft, e.gobj_services = function() {
|
|
2590
2730
|
let e = [];
|
|
2591
|
-
for (const t of Object.keys(b))
|
|
2731
|
+
for (const t of Object.keys(b)) wn(e, t);
|
|
2592
2732
|
return e;
|
|
2593
|
-
}, e.gobj_set_bottom_gobj =
|
|
2733
|
+
}, e.gobj_set_bottom_gobj = it, e.gobj_set_deep_trace = function(e) {
|
|
2594
2734
|
return V = Number(e) || 0, 0;
|
|
2595
|
-
}, e.gobj_set_gclass_no_trace = function(e, t, n) {
|
|
2596
|
-
|
|
2597
|
-
|
|
2598
|
-
const o = M(t, "gobj_set_gclass_no_trace");
|
|
2599
|
-
return o ? (n ? r.no_trace_level |= o : r.no_trace_level &= ~o, 0) : -1;
|
|
2600
|
-
}, e.gobj_set_gclass_trace = function(e, t, n) {
|
|
2601
|
-
const r = En(e) ? ce(e) : e;
|
|
2602
|
-
if (!r) return qt(`gobj_set_gclass_trace: gclass NOT FOUND: ${e}`), -1;
|
|
2603
|
-
const o = M(t, "gobj_set_gclass_trace");
|
|
2604
|
-
return o ? (n ? r.trace_level |= o : r.trace_level &= ~o, 0) : -1;
|
|
2605
|
-
}, e.gobj_set_global_no_trace = function(e, t) {
|
|
2606
|
-
const n = M(e, "gobj_set_global_no_trace");
|
|
2607
|
-
return n ? (t ? G |= n : G &= ~n, 0) : -1;
|
|
2608
|
-
}, e.gobj_set_global_trace = function(e, t) {
|
|
2609
|
-
const n = M(e, "gobj_set_global_trace");
|
|
2610
|
-
return n ? (t ? F |= n : F &= ~n, 0) : -1;
|
|
2611
|
-
}, e.gobj_set_gobj_no_trace = function(e, t, n) {
|
|
2612
|
-
if (!e) return qt("gobj_set_gobj_no_trace: gobj NULL"), -1;
|
|
2613
|
-
const r = M(t, "gobj_set_gobj_no_trace");
|
|
2735
|
+
}, e.gobj_set_gclass_no_trace = ie, e.gobj_set_gclass_trace = se, e.gobj_set_global_no_trace = X, e.gobj_set_global_no_trace2 = ee, e.gobj_set_global_trace = Q, e.gobj_set_global_trace2 = Z, e.gobj_set_gobj_no_trace = function(e, t, n) {
|
|
2736
|
+
if (!e) return cn("gobj_set_gobj_no_trace: gobj NULL"), -1;
|
|
2737
|
+
const r = W(t, "gobj_set_gobj_no_trace", e.gclass && e.gclass.s_user_trace_level || null);
|
|
2614
2738
|
return r ? (n ? e.no_trace_level |= r : e.no_trace_level &= ~r, 0) : -1;
|
|
2615
2739
|
}, e.gobj_set_gobj_trace = function(e, t, n) {
|
|
2616
|
-
if (!e) return
|
|
2617
|
-
const r =
|
|
2740
|
+
if (!e) return cn("gobj_set_gobj_trace: gobj NULL"), -1;
|
|
2741
|
+
const r = W(t, "gobj_set_gobj_trace", e.gclass && e.gclass.s_user_trace_level || null);
|
|
2618
2742
|
return r ? (n ? e.trace_level |= r : e.trace_level &= ~r, 0) : -1;
|
|
2619
2743
|
}, e.gobj_set_trace_machine_format = function(e) {
|
|
2620
2744
|
C = 1 === Number(e) ? 1 : 0;
|
|
2621
|
-
}, e.gobj_short_name =
|
|
2622
|
-
return
|
|
2745
|
+
}, e.gobj_short_name = et, e.gobj_start = Le, e.gobj_start_children = function(e) {
|
|
2746
|
+
return ot(e) ? (cn("gobj NULL or DESTROYED"), -1) : at(e, A.WALK_FIRST2LAST, Ue, 0, 0);
|
|
2623
2747
|
}, e.gobj_start_tree = function(e) {
|
|
2624
|
-
return
|
|
2625
|
-
}, e.gobj_start_up = function(e, t, n, r,
|
|
2626
|
-
|
|
2748
|
+
return ot(e) ? (cn("gobj NULL or DESTROYED"), -1) : (J(e) && P(n("⏺ ⏺ ⏺ ⏺ start_tree: %s", tt(e))), e.gclass.gclass_flag & w.gcflag_manual_start || e.disabled ? 0 : (e.running || Le(e), ut(e, A.WALK_TOP2BOTTOM, Fe, 0, 0)));
|
|
2749
|
+
}, e.gobj_start_up = function(e, t, n, r, l, o, s) {
|
|
2750
|
+
i = t, _ = n, a = r, u = l, c = o, f = s;
|
|
2627
2751
|
const d = [["EV_STATE_CHANGED", D.EVF_SYSTEM_EVENT | D.EVF_OUTPUT_EVENT | D.EVF_NO_WARN_SUBS], [0, 0]];
|
|
2628
2752
|
for (let e = 0; e < d.length; e++) {
|
|
2629
2753
|
let t = d[e][0], n = d[e][1];
|
|
2630
|
-
|
|
2754
|
+
Te(g, t, n);
|
|
2631
2755
|
}
|
|
2632
2756
|
return 0;
|
|
2633
|
-
}, e.gobj_stats = function(e, t, r,
|
|
2634
|
-
return
|
|
2635
|
-
}, e.gobj_stop =
|
|
2636
|
-
return
|
|
2637
|
-
}, e.gobj_subscribe_event =
|
|
2757
|
+
}, e.gobj_stats = function(e, t, r, l) {
|
|
2758
|
+
return ot(e) ? (cn("gobj NULL or DESTROYED"), -1) : e.gclass.gmt.mt_stats ? e.gclass.gmt.mt_stats(e, t, r, l) : f ? f(e, t, r, l) : o(0, -1, n("%s, stats parser not available", et(e)), 0, 0);
|
|
2759
|
+
}, e.gobj_stop = Ge, e.gobj_stop_children = Me, e.gobj_stop_tree = function(e) {
|
|
2760
|
+
return ot(e) ? (cn("gobj NULL or DESTROYED"), -1) : (J(e) && P(n("⏹ ⏹ ⏹ ⏹ stop_tree: %s", tt(e))), xe(e) && Ge(e), ut(e, A.WALK_TOP2BOTTOM, Ve, 0, 0));
|
|
2761
|
+
}, e.gobj_subscribe_event = Yt, e.gobj_trace_level = K, e.gobj_trace_machine_format = function() {
|
|
2638
2762
|
return C;
|
|
2639
|
-
}, e.gobj_trace_no_level =
|
|
2640
|
-
if (null == n && (n = {}), !e) return
|
|
2641
|
-
if (!r) return
|
|
2642
|
-
const
|
|
2763
|
+
}, e.gobj_trace_no_level = x, e.gobj_unsubscribe_event = function(e, t, n, r) {
|
|
2764
|
+
if (null == n && (n = {}), !e) return cn(`publisher NULL: ev ${t}`), 0;
|
|
2765
|
+
if (!r) return cn(`subscriber NULL: ev ${t}`), 0;
|
|
2766
|
+
const l = /* @__PURE__ */ new Set([
|
|
2643
2767
|
"__config__",
|
|
2644
2768
|
"__global__",
|
|
2645
2769
|
"__local__",
|
|
@@ -2647,123 +2771,103 @@ var gobjJs = function(e) {
|
|
|
2647
2771
|
"__service__"
|
|
2648
2772
|
]);
|
|
2649
2773
|
if (Object.keys(n).forEach((n) => {
|
|
2650
|
-
|
|
2651
|
-
}),
|
|
2652
|
-
else if (!(
|
|
2653
|
-
let
|
|
2654
|
-
for (let t = 0; t <
|
|
2655
|
-
let n =
|
|
2656
|
-
|
|
2657
|
-
}
|
|
2658
|
-
return
|
|
2659
|
-
}, e.gobj_unsubscribe_list =
|
|
2660
|
-
if (!En(t)) return qt(n("gobj_write_attr(%s): path must be a string", Ve(e))), -1;
|
|
2661
|
-
let i, l = e.jn_attrs, s = t.split("`");
|
|
2662
|
-
if (s.length <= 1) {
|
|
2663
|
-
let o = t;
|
|
2664
|
-
return o in l && l.hasOwnProperty(o) ? (l[o] = r, pn(e.priv) && e.priv.hasOwnProperty(o) && (e.priv[o] = r), e.obflag & R.obflag_created && !(e.obflag & R.obflag_destroyed) && e.gclass.gmt.mt_writing && e.gclass.gmt.mt_writing(e, o), 0) : (qt(n("gobj_write_attr(%s): attr not found '%s'", Ve(e), o)), -1);
|
|
2665
|
-
}
|
|
2666
|
-
let _ = s.length;
|
|
2667
|
-
for (let t = 0; t < _; t++) {
|
|
2668
|
-
i = s[t];
|
|
2669
|
-
let n = nt(e, { __gobj_name__: i });
|
|
2670
|
-
if (n && t < _ - 1) {
|
|
2671
|
-
e = n;
|
|
2672
|
-
continue;
|
|
2673
|
-
}
|
|
2674
|
-
let o = e.jn_attrs;
|
|
2675
|
-
if (i in o && o.hasOwnProperty(i)) return o[i] = r, pn(e.priv) && e.priv.hasOwnProperty(i) && (e.priv[i] = r), e.obflag & R.obflag_created && !(e.obflag & R.obflag_destroyed) && e.mt_writing && e.mt_writing(e, i), 0;
|
|
2676
|
-
break;
|
|
2677
|
-
}
|
|
2678
|
-
return qt(n("gobj_write_attr(%s): attr not found '%s'", Ve(e), i)), -1;
|
|
2679
|
-
}, e.gobj_write_attrs = ct, e.gobj_write_bool_attr = ft, e.gobj_write_integer_attr = gt, e.gobj_write_str_attr = dt, e.gobj_yuno = Ce, e.gobj_yuno_id = Ue, e.gobj_yuno_name = Le, e.gobj_yuno_role = Pe, e.id_index_in_obj_list = zn, e.index_in_list = ur, e.is_array = mn, e.is_boolean = hn, e.is_date = function(e) {
|
|
2774
|
+
l.has(n) || cn(`${et(e)}: key ignored in subscription (key: ${n}, event: ${t})`);
|
|
2775
|
+
}), Gn(t)) t = "";
|
|
2776
|
+
else if (!(Ct(e, t, D.EVF_OUTPUT_EVENT) || e.gclass.gclass_flag & w.gcflag_no_check_output_events)) return cn(`event NOT in output event list: ${et(e)}, ev ${t}`), 0;
|
|
2777
|
+
let o = Wt(e.dl_subscriptions, e, t, n, r), s = 0;
|
|
2778
|
+
for (let t = 0; t < o.length; t++) {
|
|
2779
|
+
let n = o[t];
|
|
2780
|
+
xt(e, n, !1, !1), s++;
|
|
2781
|
+
}
|
|
2782
|
+
return s || (fn(`${et(e)}: No subscription found`), bn(n, "No subscription found")), 0;
|
|
2783
|
+
}, e.gobj_unsubscribe_list = Bt, e.gobj_walk_gobj_children = at, e.gobj_walk_gobj_children_tree = ut, e.gobj_write_attr = Ot, e.gobj_write_attrs = wt, e.gobj_write_bool_attr = Nt, e.gobj_write_integer_attr = Rt, e.gobj_write_str_attr = Dt, e.gobj_yuno = He, e.gobj_yuno_id = Qe, e.gobj_yuno_name = qe, e.gobj_yuno_role = ze, e.id_index_in_obj_list = cr, e.index_in_list = Or, e.is_array = $n, e.is_boolean = Pn, e.is_date = function(e) {
|
|
2680
2784
|
return e instanceof Date && !isNaN(e);
|
|
2681
|
-
}, e.is_function =
|
|
2682
|
-
if (!
|
|
2785
|
+
}, e.is_function = Un, e.is_gobj = Fn, e.is_metadata_key = function(e) {
|
|
2786
|
+
if (!In(e)) return !1;
|
|
2683
2787
|
let t;
|
|
2684
2788
|
for (t = 0; t < e.length && "_" === e[t] && !(t > 2); t++);
|
|
2685
2789
|
return 2 === t;
|
|
2686
|
-
}, e.is_null =
|
|
2687
|
-
if (!
|
|
2790
|
+
}, e.is_null = Ln, e.is_number = Cn, e.is_object = kn, e.is_private_key = function(e) {
|
|
2791
|
+
if (!In(e)) return !1;
|
|
2688
2792
|
let t;
|
|
2689
2793
|
for (t = 0; t < e.length && "_" === e[t] && !(t > 2); t++);
|
|
2690
2794
|
return 1 === t;
|
|
2691
2795
|
}, e.is_pure_number = function(e) {
|
|
2692
|
-
if (
|
|
2693
|
-
if (!
|
|
2796
|
+
if (Cn(e)) return !0;
|
|
2797
|
+
if (!In(e)) return !1;
|
|
2694
2798
|
const t = Number(e);
|
|
2695
2799
|
return !isNaN(t) && "" !== e.trim() && !isNaN(t);
|
|
2696
|
-
}, e.is_string =
|
|
2697
|
-
let
|
|
2698
|
-
if (!
|
|
2699
|
-
if (
|
|
2700
|
-
let
|
|
2701
|
-
for (; (
|
|
2702
|
-
if (0 ===
|
|
2703
|
-
let e =
|
|
2704
|
-
e >= 0 &&
|
|
2800
|
+
}, e.is_string = In, e.jdb_delete = function(e, t, n, r) {
|
|
2801
|
+
let l = Zn(null, Zn(null, e, "topics", null, 0), t, null, 0);
|
|
2802
|
+
if (!l) return cn("jdb_delete: topic not found: " + t), null;
|
|
2803
|
+
if (Gn(r.id)) return cn("jdb_delete: record without id: " + r), dn(r), null;
|
|
2804
|
+
let o, s = n.split("`"), i = l;
|
|
2805
|
+
for (; (o = s.shift()) && !Gn(o) && i;) kn(i) && (i = Zn(null, i, e.hook, null, 0)), i = Tr(i, null, o, !1);
|
|
2806
|
+
if (0 === s.length && i) if ($n(i)) {
|
|
2807
|
+
let e = cr(i, r.id);
|
|
2808
|
+
e >= 0 && i.splice(e, 1);
|
|
2705
2809
|
} else {
|
|
2706
|
-
let t =
|
|
2810
|
+
let t = Zn(null, i, e.hook, null, 0), n = cr(t, r.id);
|
|
2707
2811
|
n >= 0 && t.splice(n, 1);
|
|
2708
2812
|
}
|
|
2709
|
-
return
|
|
2813
|
+
return l;
|
|
2710
2814
|
}, e.jdb_get = function(e, t, n, r) {
|
|
2711
|
-
let
|
|
2712
|
-
return
|
|
2815
|
+
let l = Zn(null, Zn(null, e, "topics", null, 0), t, null, 0);
|
|
2816
|
+
return l ? (void 0 === r && (r = !0), Tr(l, e.hook, n, r)) : (cn("jdb_get: topic not found: " + t), null);
|
|
2713
2817
|
}, e.jdb_get_by_idx = function(e, t, n) {
|
|
2714
|
-
let r =
|
|
2715
|
-
return r ? n < r.length ? r[n] : {} : (
|
|
2818
|
+
let r = Zn(null, Zn(null, e, "topics", null, 0), t, null, 0);
|
|
2819
|
+
return r ? n < r.length ? r[n] : {} : (cn("jdb_get_by_idx: topic not found: " + t), null);
|
|
2716
2820
|
}, e.jdb_get_topic = function(e, t) {
|
|
2717
|
-
let n =
|
|
2718
|
-
if (!n) return
|
|
2719
|
-
return
|
|
2821
|
+
let n = Zn(null, e, "topics", null, 0);
|
|
2822
|
+
if (!n) return cn("jdb topics section not found"), dn(e), null;
|
|
2823
|
+
return Zn(null, n, t, null, 0) || (cn("jdb topic not found: " + t), dn(n), null);
|
|
2720
2824
|
}, e.jdb_init = function(e, t, n) {
|
|
2721
|
-
n && (e =
|
|
2722
|
-
let r =
|
|
2723
|
-
|
|
2724
|
-
let
|
|
2725
|
-
return
|
|
2726
|
-
"__" !== t.substring(0, 2) &&
|
|
2825
|
+
n && (e = pn(e));
|
|
2826
|
+
let r = Zn(null, e, "type", [], 1);
|
|
2827
|
+
zn(null, e, "hook", "data", 1);
|
|
2828
|
+
let l = Zn(null, e, "schema", {}, 1), o = Zn(null, e, "topics", {}, 1);
|
|
2829
|
+
return hr(l, function(e, t, n, l) {
|
|
2830
|
+
"__" !== t.substring(0, 2) && Zn(null, o, l, pn(r), 1);
|
|
2727
2831
|
}, t), e;
|
|
2728
2832
|
}, e.jdb_update = function(e, t, n, r) {
|
|
2729
|
-
let
|
|
2730
|
-
if (!
|
|
2731
|
-
if (
|
|
2732
|
-
let
|
|
2733
|
-
for (; (
|
|
2734
|
-
if (0 ===
|
|
2735
|
-
else if (
|
|
2833
|
+
let l = Zn(null, Zn(null, e, "topics", null, 0), t, null, 0);
|
|
2834
|
+
if (!l) return cn("jdb_update: topic not found: " + t), null;
|
|
2835
|
+
if (Gn(r.id)) return cn("jdb_update: record without id: " + r), dn(r), null;
|
|
2836
|
+
let o, s = n.split("`"), i = l;
|
|
2837
|
+
for (; (o = s.shift()) && !Gn(o) && i;) kn(i) && (i = Zn(null, i, e.hook, [], 1)), i = Tr(i, null, o, !1);
|
|
2838
|
+
if (0 === s.length && i) if ($n(i)) i.push(r);
|
|
2839
|
+
else if (i.id === r.id) Object.assign(i, r);
|
|
2736
2840
|
else {
|
|
2737
|
-
let t =
|
|
2841
|
+
let t = Zn(null, i, e.hook, [], 1), n = Tr(t, e.hook, r.id, !1);
|
|
2738
2842
|
n ? Object.assign(n, r) : t.push(r);
|
|
2739
2843
|
}
|
|
2740
|
-
return
|
|
2844
|
+
return l;
|
|
2741
2845
|
}, e.json2flat = function(e) {
|
|
2742
|
-
const t = {}, n = (e, r,
|
|
2743
|
-
if (
|
|
2846
|
+
const t = {}, n = (e, r, l) => {
|
|
2847
|
+
if (l > Rr) throw new Error("json2flat: deeper than 256");
|
|
2744
2848
|
if (null === e || "object" != typeof e || Array.isArray(e)) {
|
|
2745
2849
|
if (Array.isArray(e) && e.length > 0) return void e.forEach((e, t) => {
|
|
2746
|
-
const
|
|
2747
|
-
n(e, 0 ===
|
|
2850
|
+
const o = `[${t}]`;
|
|
2851
|
+
n(e, 0 === l ? o : r + "`" + o, l + 1);
|
|
2748
2852
|
});
|
|
2749
2853
|
} else {
|
|
2750
2854
|
const t = Object.keys(e);
|
|
2751
2855
|
if (t.length > 0) {
|
|
2752
|
-
for (const
|
|
2753
|
-
const t =
|
|
2754
|
-
n(e[
|
|
2856
|
+
for (const o of t) {
|
|
2857
|
+
const t = Ar(o);
|
|
2858
|
+
n(e[o], 0 === l ? t : r + "`" + t, l + 1);
|
|
2755
2859
|
}
|
|
2756
2860
|
return;
|
|
2757
2861
|
}
|
|
2758
2862
|
}
|
|
2759
|
-
0 !==
|
|
2863
|
+
0 !== l && (t[r] = e);
|
|
2760
2864
|
};
|
|
2761
2865
|
return null == e || n(e, "", 0), t;
|
|
2762
|
-
}, e.json_array_append =
|
|
2866
|
+
}, e.json_array_append = On, e.json_array_append_new = wn, e.json_array_extend = function(e, t) {
|
|
2763
2867
|
return t ? (Array.prototype.push.apply(e, t), e) : e;
|
|
2764
|
-
}, e.json_array_remove =
|
|
2868
|
+
}, e.json_array_remove = Nn, e.json_array_size = Dn, e.json_deep_copy = pn, e.json_is_identical = mn, e.json_object_del = vn, e.json_object_get = yn, e.json_object_set = jn, e.json_object_set_new = Sn, e.json_object_size = Rn, e.json_object_update = En, e.json_object_update_existing = hn, e.json_object_update_missing = Tn, e.json_size = An, e.jwt2json = function(e, t) {
|
|
2765
2869
|
try {
|
|
2766
|
-
let n =
|
|
2870
|
+
let n = yr(e);
|
|
2767
2871
|
switch (t) {
|
|
2768
2872
|
case "header": return JSON.parse(n.header);
|
|
2769
2873
|
case "signature": return JSON.parse(n.signature);
|
|
@@ -2772,133 +2876,133 @@ var gobjJs = function(e) {
|
|
|
2772
2876
|
} catch (e) {
|
|
2773
2877
|
return null;
|
|
2774
2878
|
}
|
|
2775
|
-
}, e.jwtDecode =
|
|
2776
|
-
if (e && !
|
|
2777
|
-
r || (r =
|
|
2778
|
-
let
|
|
2779
|
-
if (
|
|
2780
|
-
let
|
|
2781
|
-
r(
|
|
2879
|
+
}, e.jwtDecode = yr, e.kw_clone_by_keys = lr, e.kw_clone_by_not_keys = or, e.kw_collect = function(e, t, n, r) {
|
|
2880
|
+
if (e && !Fn(e) && cn("GObj bad instanceof"), !t) return null;
|
|
2881
|
+
r || (r = rr);
|
|
2882
|
+
let l = [];
|
|
2883
|
+
if ($n(t)) for (let e = 0; e < t.length; e++) {
|
|
2884
|
+
let o = t[e];
|
|
2885
|
+
r(o, n) && l.push(o);
|
|
2782
2886
|
}
|
|
2783
2887
|
else {
|
|
2784
|
-
if (!
|
|
2785
|
-
r(t, n) &&
|
|
2888
|
+
if (!kn(t)) return cn("kw_select() BAD kw parameter"), null;
|
|
2889
|
+
r(t, n) && l.push(t);
|
|
2786
2890
|
}
|
|
2787
|
-
return
|
|
2788
|
-
}, e.kw_delete =
|
|
2789
|
-
if (!n ||
|
|
2790
|
-
for (let e = 0; e < t.length; e++) if (
|
|
2791
|
-
return r &&
|
|
2792
|
-
}, e.kw_find_path =
|
|
2793
|
-
e && !
|
|
2794
|
-
let
|
|
2795
|
-
const
|
|
2796
|
-
if (void 0 ===
|
|
2797
|
-
if (
|
|
2798
|
-
let
|
|
2799
|
-
return
|
|
2891
|
+
return l;
|
|
2892
|
+
}, e.kw_delete = Jn, e.kw_find_json_in_list = function(e, t, n, r) {
|
|
2893
|
+
if (!n || !$n(t)) return r && cn("item NULL or kw_list is not a list"), -1;
|
|
2894
|
+
for (let e = 0; e < t.length; e++) if (mn(n, t[e])) return e;
|
|
2895
|
+
return r && cn("item not found in this list"), -1;
|
|
2896
|
+
}, e.kw_find_path = Bn, e.kw_flag_t = zt, e.kw_get_bool = Hn, e.kw_get_dict = Xn, e.kw_get_dict_value = Zn, e.kw_get_int = qn, e.kw_get_list = function(e, t, n, r, l) {
|
|
2897
|
+
e && !Fn(e) && cn("GObj bad instanceof");
|
|
2898
|
+
let o = Bn(e, t, n, !1);
|
|
2899
|
+
const s = l && l & zt.KW_REQUIRED, i = l && l & zt.KW_CREATE, _ = l && l & zt.KW_EXTRACT;
|
|
2900
|
+
if (void 0 === o) {
|
|
2901
|
+
if (i) {
|
|
2902
|
+
let l = Array(r);
|
|
2903
|
+
return er(e, t, n, l), l;
|
|
2800
2904
|
}
|
|
2801
|
-
return
|
|
2802
|
-
}
|
|
2803
|
-
return _ &&
|
|
2804
|
-
}, e.kw_get_local_storage_value =
|
|
2805
|
-
e && !
|
|
2806
|
-
let
|
|
2807
|
-
const
|
|
2808
|
-
if (void 0 ===
|
|
2809
|
-
if (
|
|
2810
|
-
let
|
|
2811
|
-
return
|
|
2905
|
+
return s && (cn(`path not found: '${n}'`), bn(t)), Array(r);
|
|
2906
|
+
}
|
|
2907
|
+
return _ && Jn(e, t, n), $n(o) ? Array(o) : (s && (cn(`path value MUST BE an array: ${n}`), dn(t)), Array(r));
|
|
2908
|
+
}, e.kw_get_local_storage_value = sr, e.kw_get_pointer = Qn, e.kw_get_real = function(e, t, n, r, l) {
|
|
2909
|
+
e && !Fn(e) && cn("GObj bad instanceof");
|
|
2910
|
+
let o = Bn(e, t, n, !1);
|
|
2911
|
+
const s = l && l & zt.KW_REQUIRED, i = l && l & zt.KW_CREATE, _ = l && l & zt.KW_EXTRACT;
|
|
2912
|
+
if (void 0 === o) {
|
|
2913
|
+
if (i) {
|
|
2914
|
+
let l = Number(r);
|
|
2915
|
+
return er(e, t, n, l), l;
|
|
2812
2916
|
}
|
|
2813
|
-
return
|
|
2917
|
+
return s && (cn(`path not found: '${n}'`), bn(t)), Number(r);
|
|
2814
2918
|
}
|
|
2815
|
-
return _ &&
|
|
2816
|
-
}, e.kw_get_str =
|
|
2817
|
-
if (e && !
|
|
2818
|
-
r || (r =
|
|
2819
|
-
let
|
|
2820
|
-
if (
|
|
2821
|
-
let
|
|
2822
|
-
r(
|
|
2919
|
+
return _ && Jn(e, t, n), Cn(o) ? Number(o) : (s && (cn(`path value MUST BE a number: ${n}`), dn(t)), Number(r));
|
|
2920
|
+
}, e.kw_get_str = zn, e.kw_has_key = Yn, e.kw_match_simple = rr, e.kw_pop = xn, e.kw_remove_local_storage_value = _r, e.kw_select = function(e, t, n, r) {
|
|
2921
|
+
if (e && !Fn(e) && cn("GObj bad instanceof"), !t) return null;
|
|
2922
|
+
r || (r = rr);
|
|
2923
|
+
let l = [];
|
|
2924
|
+
if ($n(t)) for (let e = 0; e < t.length; e++) {
|
|
2925
|
+
let o = t[e];
|
|
2926
|
+
r(o, n) && l.push(pn(o));
|
|
2823
2927
|
}
|
|
2824
2928
|
else {
|
|
2825
|
-
if (!
|
|
2826
|
-
r(t, n) &&
|
|
2929
|
+
if (!kn(t)) return cn("kw_select() BAD kw parameter"), null;
|
|
2930
|
+
r(t, n) && l.push(pn(t));
|
|
2827
2931
|
}
|
|
2828
|
-
return
|
|
2829
|
-
}, e.kw_set_dict_value =
|
|
2830
|
-
e && !
|
|
2831
|
-
let
|
|
2832
|
-
return
|
|
2932
|
+
return l;
|
|
2933
|
+
}, e.kw_set_dict_value = er, e.kw_set_local_storage_value = ir, e.kw_set_subdict_value = tr, e.kwid_collect = ur, e.kwid_find_one_record = function(e, t, n, r, l) {
|
|
2934
|
+
e && !Fn(e) && cn("GObj bad instanceof");
|
|
2935
|
+
let o = ur(e, t, n, r, l);
|
|
2936
|
+
return o && 0 !== o.length ? o[0] : null;
|
|
2833
2937
|
}, e.kwid_get_ids = function(e, t) {
|
|
2834
|
-
if (e && !
|
|
2938
|
+
if (e && !Fn(e) && cn("GObj bad instanceof"), !t) return [];
|
|
2835
2939
|
let n = [];
|
|
2836
|
-
if (
|
|
2837
|
-
else if (
|
|
2838
|
-
else
|
|
2839
|
-
if (
|
|
2840
|
-
else if (
|
|
2841
|
-
let r =
|
|
2940
|
+
if (In(t)) n.push(t);
|
|
2941
|
+
else if (kn(t)) for (let e in t) t.hasOwnProperty(e) && n.push(e);
|
|
2942
|
+
else $n(t) && t.forEach(function(t) {
|
|
2943
|
+
if (In(t)) Gn(t) || n.push(t);
|
|
2944
|
+
else if (kn(t)) {
|
|
2945
|
+
let r = zn(e, t, "id", 0, 0);
|
|
2842
2946
|
r && n.push(r);
|
|
2843
2947
|
}
|
|
2844
2948
|
});
|
|
2845
2949
|
return n;
|
|
2846
|
-
}, e.kwid_match_id =
|
|
2847
|
-
e && !
|
|
2950
|
+
}, e.kwid_match_id = ar, e.kwid_new_dict = function(e, t, n) {
|
|
2951
|
+
e && !Fn(e) && cn("GObj bad instanceof");
|
|
2848
2952
|
let r = {};
|
|
2849
|
-
if (
|
|
2850
|
-
else if (
|
|
2851
|
-
let
|
|
2852
|
-
|
|
2953
|
+
if (Gn(n) || (t = Bn(e, t, n)), kn(t)) r = t;
|
|
2954
|
+
else if ($n(t)) for (let n = 0; n < t.length; n++) {
|
|
2955
|
+
let l = t[n], o = zn(e, l, "id", "", zt.KW_REQUIRED);
|
|
2956
|
+
Gn(o) || (r[o] = l);
|
|
2853
2957
|
}
|
|
2854
|
-
else
|
|
2958
|
+
else cn(`${et(e)} kwid_new_dict: data type unknown`);
|
|
2855
2959
|
return r;
|
|
2856
2960
|
}, e.kwid_new_list = function(e, t, n) {
|
|
2857
|
-
if (e && !
|
|
2858
|
-
if (
|
|
2961
|
+
if (e && !Fn(e) && cn("GObj bad instanceof"), Gn(n) || (t = Bn(e, t, n)), $n(t)) return t;
|
|
2962
|
+
if (kn(t)) {
|
|
2859
2963
|
let n = [];
|
|
2860
2964
|
for (let r of Object.keys(t)) {
|
|
2861
|
-
let
|
|
2862
|
-
|
|
2965
|
+
let l = t[r];
|
|
2966
|
+
kn(l) ? (l.id = r, n.push(l)) : cn(`${et(e)} kwid_new_list: not a record: '${r}'`);
|
|
2863
2967
|
}
|
|
2864
2968
|
return n;
|
|
2865
2969
|
}
|
|
2866
|
-
return
|
|
2970
|
+
return cn(`${et(e)} kwid_new_list: wrong type for list`), [];
|
|
2867
2971
|
}, e.list2options = function(e, t, n) {
|
|
2868
2972
|
t = t || "id", n = n || "value";
|
|
2869
2973
|
let r = [];
|
|
2870
|
-
if (
|
|
2871
|
-
let
|
|
2872
|
-
if (
|
|
2873
|
-
id: e[
|
|
2874
|
-
value: e[
|
|
2974
|
+
if ($n(e)) for (let l = 0; l < e.length; l++) {
|
|
2975
|
+
let o = e[l];
|
|
2976
|
+
if (In(o)) r.push({
|
|
2977
|
+
id: e[l],
|
|
2978
|
+
value: e[l]
|
|
2875
2979
|
});
|
|
2876
|
-
else if (
|
|
2980
|
+
else if (kn(o)) {
|
|
2877
2981
|
let e = {};
|
|
2878
|
-
if (
|
|
2879
|
-
if (!
|
|
2880
|
-
if (!(
|
|
2881
|
-
|
|
2982
|
+
if (Yn(o, t)) {
|
|
2983
|
+
if (!Yn(o, n)) {
|
|
2984
|
+
if (!(An(o) > 0)) {
|
|
2985
|
+
cn("list2options(): object without field value: " + n);
|
|
2882
2986
|
continue;
|
|
2883
2987
|
}
|
|
2884
|
-
n = Object.keys(
|
|
2988
|
+
n = Object.keys(o)[0];
|
|
2885
2989
|
}
|
|
2886
|
-
e.id =
|
|
2990
|
+
e.id = o[t], e.value = o[n];
|
|
2887
2991
|
} else {
|
|
2888
|
-
if (!(
|
|
2889
|
-
|
|
2992
|
+
if (!(An(o) > 0)) {
|
|
2993
|
+
cn("list2options(): object without field id: " + t);
|
|
2890
2994
|
continue;
|
|
2891
2995
|
}
|
|
2892
|
-
t = Object.keys(
|
|
2996
|
+
t = Object.keys(o)[0], e.id = t, e.value = o[t];
|
|
2893
2997
|
}
|
|
2894
2998
|
r.push(e);
|
|
2895
|
-
} else
|
|
2999
|
+
} else cn("list2options(): case1 not implemented");
|
|
2896
3000
|
}
|
|
2897
|
-
else if (
|
|
3001
|
+
else if (kn(e)) for (let t of Object.keys(e)) r.push({
|
|
2898
3002
|
id: t,
|
|
2899
3003
|
value: t
|
|
2900
3004
|
});
|
|
2901
|
-
else
|
|
3005
|
+
else cn("list2options(): case2 not implemented");
|
|
2902
3006
|
return r;
|
|
2903
3007
|
}, e.load_json_file = function(e, t, n) {
|
|
2904
3008
|
let r = new XMLHttpRequest();
|
|
@@ -2906,18 +3010,18 @@ var gobjJs = function(e) {
|
|
|
2906
3010
|
if (4 === r.readyState) if (200 === r.status || 0 === (e = r).status && e.responseText && e.responseURL.startsWith("file:")) try {
|
|
2907
3011
|
t(JSON.parse(r.responseText));
|
|
2908
3012
|
} catch (e) {
|
|
2909
|
-
n && (
|
|
3013
|
+
n && (cn(`JSON parse status ${r.status}, error: ${e.message}`), n(r.status));
|
|
2910
3014
|
}
|
|
2911
3015
|
else n && n(r.status);
|
|
2912
3016
|
var e;
|
|
2913
3017
|
}, r.send();
|
|
2914
|
-
}, e.log_debug =
|
|
2915
|
-
let t =
|
|
2916
|
-
|
|
2917
|
-
}, e.log_warning =
|
|
3018
|
+
}, e.log_debug = gn, e.log_error = cn, e.log_info = function(e) {
|
|
3019
|
+
let t = un(e), n = Sr();
|
|
3020
|
+
en && on("info", t) && en("%c" + n + " INFO: " + String(t), "color:cyan"), _n("info", t, n);
|
|
3021
|
+
}, e.log_warning = fn, e.msg_iev_get_msg_type = Er, e.msg_iev_get_stack = pr, e.msg_iev_push_stack = br, e.msg_iev_read_key = gr, e.msg_iev_set_msg_type = mr, e.msg_iev_write_key = dr, e.node_uuid = wr, e.parseBoolean = Vn, e.parseSVG = function(e) {
|
|
2918
3022
|
return new DOMParser().parseFromString(e, "image/svg+xml").firstChild;
|
|
2919
3023
|
}, e.refresh_language = function(e, t) {
|
|
2920
|
-
if (!
|
|
3024
|
+
if (!Un(t)) return void cn("You must supply a translation function");
|
|
2921
3025
|
e || (e = document);
|
|
2922
3026
|
const n = (t) => {
|
|
2923
3027
|
let n = [];
|
|
@@ -2941,22 +3045,22 @@ var gobjJs = function(e) {
|
|
|
2941
3045
|
});
|
|
2942
3046
|
}, e.register_c_ievent_cli = function() {
|
|
2943
3047
|
return function(e) {
|
|
2944
|
-
if (
|
|
3048
|
+
if (sl) return cn(`GClass ALREADY created: ${e}`), -1;
|
|
2945
3049
|
const t = [
|
|
2946
3050
|
["ST_DISCONNECTED", [
|
|
2947
3051
|
[
|
|
2948
3052
|
"EV_ON_OPEN",
|
|
2949
|
-
|
|
3053
|
+
pl,
|
|
2950
3054
|
"ST_WAIT_IDENTITY_CARD_ACK"
|
|
2951
3055
|
],
|
|
2952
3056
|
[
|
|
2953
3057
|
"EV_ON_CLOSE",
|
|
2954
|
-
|
|
3058
|
+
ml,
|
|
2955
3059
|
null
|
|
2956
3060
|
],
|
|
2957
3061
|
[
|
|
2958
3062
|
"EV_TIMEOUT",
|
|
2959
|
-
|
|
3063
|
+
bl,
|
|
2960
3064
|
null
|
|
2961
3065
|
],
|
|
2962
3066
|
[
|
|
@@ -2968,22 +3072,22 @@ var gobjJs = function(e) {
|
|
|
2968
3072
|
["ST_WAIT_IDENTITY_CARD_ACK", [
|
|
2969
3073
|
[
|
|
2970
3074
|
"EV_ON_MESSAGE",
|
|
2971
|
-
|
|
3075
|
+
Tl,
|
|
2972
3076
|
null
|
|
2973
3077
|
],
|
|
2974
3078
|
[
|
|
2975
3079
|
"EV_IDENTITY_CARD_ACK",
|
|
2976
|
-
|
|
3080
|
+
hl,
|
|
2977
3081
|
null
|
|
2978
3082
|
],
|
|
2979
3083
|
[
|
|
2980
3084
|
"EV_ON_CLOSE",
|
|
2981
|
-
|
|
3085
|
+
ml,
|
|
2982
3086
|
"ST_DISCONNECTED"
|
|
2983
3087
|
],
|
|
2984
3088
|
[
|
|
2985
3089
|
"EV_TIMEOUT",
|
|
2986
|
-
|
|
3090
|
+
El,
|
|
2987
3091
|
null
|
|
2988
3092
|
],
|
|
2989
3093
|
[
|
|
@@ -2995,22 +3099,22 @@ var gobjJs = function(e) {
|
|
|
2995
3099
|
["ST_SESSION", [
|
|
2996
3100
|
[
|
|
2997
3101
|
"EV_ON_MESSAGE",
|
|
2998
|
-
|
|
3102
|
+
Tl,
|
|
2999
3103
|
null
|
|
3000
3104
|
],
|
|
3001
3105
|
[
|
|
3002
3106
|
"EV_MT_STATS",
|
|
3003
|
-
|
|
3107
|
+
yl,
|
|
3004
3108
|
null
|
|
3005
3109
|
],
|
|
3006
3110
|
[
|
|
3007
3111
|
"EV_MT_COMMAND",
|
|
3008
|
-
|
|
3112
|
+
vl,
|
|
3009
3113
|
null
|
|
3010
3114
|
],
|
|
3011
3115
|
[
|
|
3012
3116
|
"EV_ON_CLOSE",
|
|
3013
|
-
|
|
3117
|
+
ml,
|
|
3014
3118
|
"ST_DISCONNECTED"
|
|
3015
3119
|
],
|
|
3016
3120
|
[
|
|
@@ -3021,7 +3125,7 @@ var gobjJs = function(e) {
|
|
|
3021
3125
|
]],
|
|
3022
3126
|
[null, null]
|
|
3023
3127
|
];
|
|
3024
|
-
return (
|
|
3128
|
+
return (sl = de(e, [
|
|
3025
3129
|
["EV_ON_MESSAGE", D.EVF_OUTPUT_EVENT],
|
|
3026
3130
|
["EV_IDENTITY_CARD_ACK", D.EVF_PUBLIC_EVENT],
|
|
3027
3131
|
["EV_ON_ID_NAK", D.EVF_PUBLIC_EVENT | D.EVF_OUTPUT_EVENT],
|
|
@@ -3032,54 +3136,54 @@ var gobjJs = function(e) {
|
|
|
3032
3136
|
["EV_ON_OPEN_ERROR", D.EVF_OUTPUT_EVENT | D.EVF_NO_WARN_SUBS],
|
|
3033
3137
|
["EV_TIMEOUT", 0],
|
|
3034
3138
|
[null, 0]
|
|
3035
|
-
], t,
|
|
3139
|
+
], t, jl, 0, nl, ol, 0, 0, rl, w.gcflag_no_check_output_events)) ? 0 : -1;
|
|
3036
3140
|
}("C_IEVENT_CLI");
|
|
3037
3141
|
}, e.register_c_timer = function() {
|
|
3038
3142
|
return function(e) {
|
|
3039
|
-
if (
|
|
3143
|
+
if (Mr) return cn(`GClass ALREADY created: ${e}`), -1;
|
|
3040
3144
|
const t = [["ST_IDLE", [[
|
|
3041
3145
|
"EV_TIMEOUT",
|
|
3042
|
-
|
|
3146
|
+
Wr,
|
|
3043
3147
|
null
|
|
3044
3148
|
]]]];
|
|
3045
|
-
return (
|
|
3149
|
+
return (Mr = de(e, [
|
|
3046
3150
|
["EV_TIMEOUT", D.EVF_OUTPUT_EVENT],
|
|
3047
3151
|
["EV_TIMEOUT_PERIODIC", D.EVF_OUTPUT_EVENT],
|
|
3048
3152
|
[0, 0]
|
|
3049
|
-
], t,
|
|
3153
|
+
], t, Kr, 0, Gr, Vr, 0, 0, 0, w.gcflag_manual_start)) ? 0 : -1;
|
|
3050
3154
|
}("C_TIMER");
|
|
3051
3155
|
}, e.register_c_yuno = function() {
|
|
3052
3156
|
return function(e) {
|
|
3053
|
-
if (
|
|
3157
|
+
if (qr) return cn(`GClass ALREADY created: ${e}`), -1;
|
|
3054
3158
|
const t = [["ST_IDLE", [[
|
|
3055
3159
|
"EV_TIMEOUT_PERIODIC",
|
|
3056
|
-
|
|
3160
|
+
Zr,
|
|
3057
3161
|
null
|
|
3058
3162
|
]]]];
|
|
3059
|
-
return (
|
|
3163
|
+
return (qr = de(e, [["EV_TIMEOUT_PERIODIC", D.EVF_OUTPUT_EVENT | D.EVF_NO_WARN_SUBS], [0, 0]], t, el, 0, Jr, Hr, 0, 0, 0, 0)) ? 0 : -1;
|
|
3060
3164
|
}("C_YUNO");
|
|
3061
3165
|
}, e.safeSrc = function(e) {
|
|
3062
3166
|
if (!e) return "";
|
|
3063
3167
|
const t = String(e).trim();
|
|
3064
|
-
return /^javascript:/i.test(t) || /^data:/i.test(t) ? "" :
|
|
3065
|
-
}, e.sdata_flag_t =
|
|
3168
|
+
return /^javascript:/i.test(t) || /^data:/i.test(t) ? "" : vr(t);
|
|
3169
|
+
}, e.sdata_flag_t = T, e.send_http_json_post = function(e, t, n) {
|
|
3066
3170
|
let r = new XMLHttpRequest();
|
|
3067
3171
|
r.open("POST", e), r.setRequestHeader("Accept", "application/json"), r.setRequestHeader("Content-Type", "application/json"), r.onreadystatechange = function() {
|
|
3068
3172
|
4 === r.readyState && n(r.status, r.responseText);
|
|
3069
3173
|
}, r.send(t);
|
|
3070
3174
|
}, e.set_console_log_enabled = function(e) {
|
|
3071
|
-
|
|
3175
|
+
rn = !!e;
|
|
3072
3176
|
}, e.set_console_log_filter = function(e) {
|
|
3073
|
-
|
|
3177
|
+
ln = "function" == typeof e ? e : null;
|
|
3074
3178
|
}, e.set_log_callback = function(e) {
|
|
3075
|
-
|
|
3076
|
-
}, e.set_remote_log_functions =
|
|
3077
|
-
var r = (e + "").substring(0, n),
|
|
3078
|
-
return r ===
|
|
3179
|
+
nn = "function" == typeof e ? e : null;
|
|
3180
|
+
}, e.set_remote_log_functions = an, e.set_timeout = xr, e.set_timeout_periodic = Yr, e.sprintf = n, e.stats_parser = function(e, t, n, r) {}, e.str_in_list = fr, e.strcasecmp = Wn, e.strcmp = Mn, e.strncmp = function(e, t, n) {
|
|
3181
|
+
var r = (e + "").substring(0, n), l = (t + "").substring(0, n);
|
|
3182
|
+
return r === l ? 0 : r > l ? 1 : -1;
|
|
3079
3183
|
}, e.strs_in_list = function(e, t, n) {
|
|
3080
|
-
if (!e) return
|
|
3081
|
-
if (!t) return
|
|
3082
|
-
for (let r = 0; r < t.length; r++) if (
|
|
3184
|
+
if (!e) return cn("ERROR: strs_in_list() list empty"), !1;
|
|
3185
|
+
if (!t) return cn("ERROR: strs_in_list() str empty"), !1;
|
|
3186
|
+
for (let r = 0; r < t.length; r++) if (fr(e, t[r], n)) return !0;
|
|
3083
3187
|
return !1;
|
|
3084
3188
|
}, e.strstr = function(e, t, n) {
|
|
3085
3189
|
var r;
|
|
@@ -3098,13 +3202,13 @@ var gobjJs = function(e) {
|
|
|
3098
3202
|
placeholder: void 0,
|
|
3099
3203
|
fkey: null
|
|
3100
3204
|
};
|
|
3101
|
-
if (
|
|
3205
|
+
if (In(t)) {
|
|
3102
3206
|
let e = t.split(".");
|
|
3103
3207
|
for (let t = 0; t < e.length; t++) {
|
|
3104
3208
|
let r = e[t];
|
|
3105
|
-
if (
|
|
3106
|
-
else if (
|
|
3107
|
-
else if (
|
|
3209
|
+
if (fr(Pr, r)) n.real_type || (n.real_type = r);
|
|
3210
|
+
else if (fr(Ur, r)) n.type || (n.type = r);
|
|
3211
|
+
else if (fr(Lr, r)) switch (r) {
|
|
3108
3212
|
case "writable":
|
|
3109
3213
|
n.is_writable = !0;
|
|
3110
3214
|
break;
|
|
@@ -3116,23 +3220,23 @@ var gobjJs = function(e) {
|
|
|
3116
3220
|
}
|
|
3117
3221
|
}
|
|
3118
3222
|
n.real_type || (n.real_type = "string");
|
|
3119
|
-
} else
|
|
3223
|
+
} else kn(t) ? (n = Fr(t), n.name || (n.name = e), n.header || (n.header = e)) : $n(t) && (n.real_type = "array", n.enum_list = t);
|
|
3120
3224
|
return n.type || (n.type = n.real_type), n;
|
|
3121
3225
|
}, e.timeTracker = function(e = "Time Tracker", t = !1) {
|
|
3122
3226
|
const n = e, r = performance.now();
|
|
3123
|
-
let
|
|
3124
|
-
return t &&
|
|
3125
|
-
const
|
|
3126
|
-
return t &&
|
|
3127
|
-
partial:
|
|
3227
|
+
let l = r;
|
|
3228
|
+
return t && fn(`--\x3e ${n} - starting`), { mark: (e = "Intermediate", o = "") => {
|
|
3229
|
+
const s = performance.now(), i = (s - l) / 1e3, _ = (s - r) / 1e3;
|
|
3230
|
+
return t && fn(`--\x3e ${n} ${e} - partial: ${i} sec, total: ${_} sec, ${o}`), l = s, {
|
|
3231
|
+
partial: i,
|
|
3128
3232
|
total: _
|
|
3129
3233
|
};
|
|
3130
3234
|
} };
|
|
3131
|
-
}, e.trace_json =
|
|
3132
|
-
if (
|
|
3235
|
+
}, e.trace_json = bn, e.trace_level_t = L, e.trace_msg = dn, e.treedb_decoder_fkey = Cr, e.treedb_decoder_hook = function(e, t) {
|
|
3236
|
+
if (In(t)) {
|
|
3133
3237
|
if (-1 === t.indexOf("^")) {
|
|
3134
3238
|
let n, r = e.hook;
|
|
3135
|
-
if (1 !==
|
|
3239
|
+
if (1 !== Rn(r)) return cn("bad hook 1"), cn(e), cn(t), null;
|
|
3136
3240
|
for (let e of Object.keys(r)) {
|
|
3137
3241
|
n = e, r[e];
|
|
3138
3242
|
break;
|
|
@@ -3144,25 +3248,25 @@ var gobjJs = function(e) {
|
|
|
3144
3248
|
}
|
|
3145
3249
|
{
|
|
3146
3250
|
let n = t.split("^");
|
|
3147
|
-
return 2 !== n.length ? (
|
|
3251
|
+
return 2 !== n.length ? (cn("bad hook 2"), cn(e), cn(t), null) : {
|
|
3148
3252
|
topic_name: n[0],
|
|
3149
3253
|
id: n[1]
|
|
3150
3254
|
};
|
|
3151
3255
|
}
|
|
3152
3256
|
}
|
|
3153
|
-
return
|
|
3257
|
+
return kn(t) ? {
|
|
3154
3258
|
topic_name: t.topic_name,
|
|
3155
3259
|
id: t.id
|
|
3156
|
-
} : (
|
|
3260
|
+
} : (cn("bad hook 3"), cn(e), cn(t), null);
|
|
3157
3261
|
}, e.treedb_encoder_fkey = function(e, t) {
|
|
3158
|
-
let n =
|
|
3262
|
+
let n = Cr(e, t);
|
|
3159
3263
|
return n ? n.topic_name + "^" + n.id + "^" + n.hook_name : null;
|
|
3160
|
-
}, e.treedb_get_field_desc =
|
|
3161
|
-
if (
|
|
3264
|
+
}, e.treedb_get_field_desc = Fr, e.treedb_hook_data_size = function(e) {
|
|
3265
|
+
if ($n(e) && 1 === An(e)) {
|
|
3162
3266
|
let t = e[0];
|
|
3163
|
-
return
|
|
3267
|
+
return Yn(t, "size") ? t.size : 1;
|
|
3164
3268
|
}
|
|
3165
|
-
return
|
|
3269
|
+
return An(e);
|
|
3166
3270
|
}, e.vsprintf = function(e, t) {
|
|
3167
3271
|
return n.apply(null, [e].concat(t || []));
|
|
3168
3272
|
}, e.walk_type_t = A, e;
|