@yuneta/gobj-js 7.25.0 → 7.25.2
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 +6 -0
- package/dist/gobj-js.cjs.js +67 -34
- package/dist/gobj-js.cjs.js.map +1 -1
- package/dist/gobj-js.cjs.min.js +141 -154
- package/dist/gobj-js.cjs.min.js.map +1 -1
- package/dist/gobj-js.es.js +67 -34
- package/dist/gobj-js.es.js.map +1 -1
- package/dist/gobj-js.es.min.js +224 -237
- package/dist/gobj-js.es.min.js.map +1 -1
- package/dist/gobj-js.iife.js +67 -34
- package/dist/gobj-js.iife.js.map +1 -1
- package/dist/gobj-js.iife.min.js +216 -229
- package/dist/gobj-js.iife.min.js.map +1 -1
- package/dist/gobj-js.umd.js +67 -34
- package/dist/gobj-js.umd.js.map +1 -1
- package/dist/gobj-js.umd.min.js +313 -326
- package/dist/gobj-js.umd.min.js.map +1 -1
- package/package.json +1 -1
package/dist/gobj-js.umd.min.js
CHANGED
|
@@ -144,7 +144,7 @@
|
|
|
144
144
|
DTP_POINTER: 8
|
|
145
145
|
});
|
|
146
146
|
E.DTP_POINTER;
|
|
147
|
-
var
|
|
147
|
+
var T = Object.freeze({
|
|
148
148
|
SDF_NOTACCESS: 1,
|
|
149
149
|
SDF_RD: 2,
|
|
150
150
|
SDF_WR: 4,
|
|
@@ -167,12 +167,12 @@
|
|
|
167
167
|
SDF_AUTHZ_S: 524288,
|
|
168
168
|
SDF_AUTHZ_RS: 1048576
|
|
169
169
|
});
|
|
170
|
-
|
|
171
|
-
var
|
|
170
|
+
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;
|
|
171
|
+
var y = class {
|
|
172
172
|
constructor(e, t, n = 0, r = null, l = "", o = null, s = null, i = 0, _ = null, a = null, u = null) {
|
|
173
173
|
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;
|
|
174
174
|
}
|
|
175
|
-
}, v = () => new
|
|
175
|
+
}, v = () => new y(0, null), j = (e, t, n, r, l) => new y(e, t, n, r, l), S = class {
|
|
176
176
|
constructor(e, t, n, r, l, o, s, i, _) {
|
|
177
177
|
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;
|
|
178
178
|
}
|
|
@@ -180,13 +180,13 @@
|
|
|
180
180
|
constructor(e, t, n, r, l) {
|
|
181
181
|
this.__refs__ = 0, this.gclass = t, this.parent = null, this.dl_children = [], this.dl_subscriptions = [], this.dl_subscribings = [], this.current_state = t.dl_states[0], this.last_state = null, this.obflag = 0, this.gobj_flag = Number(l) || 0, this.gobj_name = e, this.jn_attrs = null, this.jn_stats = {}, this.jn_user_data = {}, this.full_name = null, this.short_name = null, this.priv = En(t.priv), this.running = !1, this.playing = !1, this.disabled = !1, this.bottom_gobj = null, this.trace_level = 0, this.no_trace_level = 0;
|
|
182
182
|
}
|
|
183
|
-
},
|
|
183
|
+
}, N = Object.freeze({
|
|
184
184
|
gcflag_manual_start: 1,
|
|
185
185
|
gcflag_no_check_output_events: 2,
|
|
186
186
|
gcflag_ignore_unknown_attrs: 4,
|
|
187
187
|
gcflag_required_start_to_play: 8,
|
|
188
188
|
gcflag_singleton: 16
|
|
189
|
-
}),
|
|
189
|
+
}), w = Object.freeze({
|
|
190
190
|
gobj_flag_yuno: 1,
|
|
191
191
|
gobj_flag_default_service: 2,
|
|
192
192
|
gobj_flag_service: 4,
|
|
@@ -223,10 +223,10 @@
|
|
|
223
223
|
}
|
|
224
224
|
};
|
|
225
225
|
var C = 1;
|
|
226
|
-
function
|
|
226
|
+
function L(e) {
|
|
227
227
|
Cn(e) && (e = JSON.stringify(e)), pn(" ".repeat(Math.max(1, 2 * h)) + String(e));
|
|
228
228
|
}
|
|
229
|
-
var
|
|
229
|
+
var P = Object.freeze({
|
|
230
230
|
TRACE_MACHINE: 65536,
|
|
231
231
|
TRACE_CREATE_DELETE: 131072,
|
|
232
232
|
TRACE_CREATE_DELETE2: 262144,
|
|
@@ -245,77 +245,77 @@
|
|
|
245
245
|
}), U = [
|
|
246
246
|
[
|
|
247
247
|
"machine",
|
|
248
|
-
|
|
248
|
+
P.TRACE_MACHINE,
|
|
249
249
|
"Trace machine"
|
|
250
250
|
],
|
|
251
251
|
[
|
|
252
252
|
"create_delete",
|
|
253
|
-
|
|
253
|
+
P.TRACE_CREATE_DELETE,
|
|
254
254
|
"Trace create/delete of gobjs"
|
|
255
255
|
],
|
|
256
256
|
[
|
|
257
257
|
"create_delete2",
|
|
258
|
-
|
|
258
|
+
P.TRACE_CREATE_DELETE2,
|
|
259
259
|
"Trace create/delete of gobjs level 2: with kw"
|
|
260
260
|
],
|
|
261
261
|
[
|
|
262
262
|
"subscriptions",
|
|
263
|
-
|
|
263
|
+
P.TRACE_SUBSCRIPTIONS,
|
|
264
264
|
"Trace subscriptions of gobjs"
|
|
265
265
|
],
|
|
266
266
|
[
|
|
267
267
|
"start_stop",
|
|
268
|
-
|
|
268
|
+
P.TRACE_START_STOP,
|
|
269
269
|
"Trace start/stop of gobjs"
|
|
270
270
|
],
|
|
271
271
|
[
|
|
272
272
|
"ev_kw",
|
|
273
|
-
|
|
273
|
+
P.TRACE_EV_KW,
|
|
274
274
|
"Trace event keywords"
|
|
275
275
|
],
|
|
276
276
|
[
|
|
277
277
|
"authzs",
|
|
278
|
-
|
|
278
|
+
P.TRACE_AUTHZS,
|
|
279
279
|
"Trace authorizations"
|
|
280
280
|
],
|
|
281
281
|
[
|
|
282
282
|
"states",
|
|
283
|
-
|
|
283
|
+
P.TRACE_STATES,
|
|
284
284
|
"Trace change of states"
|
|
285
285
|
],
|
|
286
286
|
[
|
|
287
287
|
"gbuffers",
|
|
288
|
-
|
|
288
|
+
P.TRACE_GBUFFERS,
|
|
289
289
|
"Trace gbuffers"
|
|
290
290
|
],
|
|
291
291
|
[
|
|
292
292
|
"timer",
|
|
293
|
-
|
|
293
|
+
P.TRACE_TIMER,
|
|
294
294
|
"Trace timers"
|
|
295
295
|
],
|
|
296
296
|
[
|
|
297
297
|
"fs",
|
|
298
|
-
|
|
298
|
+
P.TRACE_FS,
|
|
299
299
|
"Trace file system"
|
|
300
300
|
],
|
|
301
301
|
[
|
|
302
302
|
"liburing",
|
|
303
|
-
|
|
303
|
+
P.TRACE_URING,
|
|
304
304
|
"Trace liburing mixins"
|
|
305
305
|
],
|
|
306
306
|
[
|
|
307
307
|
"timer_periodic",
|
|
308
|
-
|
|
308
|
+
P.TRACE_TIMER_PERIODIC,
|
|
309
309
|
"Trace periodic timers"
|
|
310
310
|
],
|
|
311
311
|
[
|
|
312
312
|
"liburing_timer",
|
|
313
|
-
|
|
313
|
+
P.TRACE_URING_TIME,
|
|
314
314
|
"Trace liburing timer"
|
|
315
315
|
],
|
|
316
316
|
[
|
|
317
317
|
"commands",
|
|
318
|
-
|
|
318
|
+
P.TRACE_COMMANDS,
|
|
319
319
|
"Trace commands"
|
|
320
320
|
]
|
|
321
321
|
], F = 0, G = 0, V = 0;
|
|
@@ -339,38 +339,38 @@
|
|
|
339
339
|
return 0;
|
|
340
340
|
}(String(e), n) || (dn(`${t}: trace level NOT FOUND: ${e}`), 0);
|
|
341
341
|
}
|
|
342
|
-
function
|
|
342
|
+
function K(e) {
|
|
343
343
|
if (V) return 4294967295;
|
|
344
344
|
let t = F;
|
|
345
345
|
return e && (t |= e.trace_level || 0, e.gclass && (t |= e.gclass.trace_level || 0)), t;
|
|
346
346
|
}
|
|
347
|
-
function
|
|
347
|
+
function x(e) {
|
|
348
348
|
let t = G;
|
|
349
349
|
return e && (t |= e.no_trace_level || 0, e.gclass && (t |= e.gclass.no_trace_level || 0)), t;
|
|
350
350
|
}
|
|
351
351
|
function Y(e) {
|
|
352
|
-
return
|
|
352
|
+
return K(e) & P.TRACE_CREATE_DELETE;
|
|
353
353
|
}
|
|
354
354
|
function B(e) {
|
|
355
|
-
return
|
|
355
|
+
return K(e) & P.TRACE_SUBSCRIPTIONS;
|
|
356
356
|
}
|
|
357
357
|
function J(e) {
|
|
358
|
-
return
|
|
358
|
+
return K(e) & P.TRACE_START_STOP;
|
|
359
359
|
}
|
|
360
360
|
function H(e) {
|
|
361
|
-
return
|
|
361
|
+
return K(e) & P.TRACE_EV_KW;
|
|
362
362
|
}
|
|
363
363
|
function q(e, t) {
|
|
364
364
|
if (V > 1) return !0;
|
|
365
365
|
if (!e) return !1;
|
|
366
|
-
const n =
|
|
367
|
-
return !!(n &
|
|
366
|
+
const n = K(e);
|
|
367
|
+
return !!(n & P.TRACE_MACHINE || n & P.TRACE_TIMER_PERIODIC && "EV_TIMEOUT_PERIODIC" === t || n & P.TRACE_TIMER && "EV_TIMEOUT" === t);
|
|
368
368
|
}
|
|
369
369
|
function z(e, t) {
|
|
370
370
|
if (V > 1) return !1;
|
|
371
371
|
if (!e) return !0;
|
|
372
|
-
const n =
|
|
373
|
-
return !!(n &
|
|
372
|
+
const n = x(e);
|
|
373
|
+
return !!(n & P.TRACE_MACHINE || n & P.TRACE_TIMER_PERIODIC && "EV_TIMEOUT_PERIODIC" === t || n & P.TRACE_TIMER && "EV_TIMEOUT" === t);
|
|
374
374
|
}
|
|
375
375
|
function Q(e, t) {
|
|
376
376
|
const n = W(e, "gobj_set_global_trace");
|
|
@@ -393,32 +393,32 @@
|
|
|
393
393
|
return M(G, null);
|
|
394
394
|
}
|
|
395
395
|
function re(e) {
|
|
396
|
-
const t =
|
|
396
|
+
const t = Pn(e) ? Se(e) : e;
|
|
397
397
|
return t ? M(t.trace_level | F, t.s_user_trace_level) : (dn(`gobj_get_gclass_trace_level: gclass NOT FOUND: ${e}`), []);
|
|
398
398
|
}
|
|
399
399
|
function le(e) {
|
|
400
|
-
const t =
|
|
400
|
+
const t = Pn(e) ? Se(e) : e;
|
|
401
401
|
return t ? M(t.trace_level, t.s_user_trace_level) : (dn(`gobj_get_gclass_trace_level2: gclass NOT FOUND: ${e}`), []);
|
|
402
402
|
}
|
|
403
403
|
function oe(e) {
|
|
404
|
-
const t =
|
|
404
|
+
const t = Pn(e) ? Se(e) : e;
|
|
405
405
|
return t ? M(t.no_trace_level, t.s_user_trace_level) : (dn(`gobj_get_gclass_trace_no_level: gclass NOT FOUND: ${e}`), []);
|
|
406
406
|
}
|
|
407
407
|
function se(e, t, n) {
|
|
408
|
-
const r =
|
|
408
|
+
const r = Pn(e) ? Se(e) : e;
|
|
409
409
|
if (!r) return dn(`gobj_set_gclass_trace: gclass NOT FOUND: ${e}`), -1;
|
|
410
410
|
const l = null === t ? 4294967295 : W(t, "gobj_set_gclass_trace", r.s_user_trace_level || null);
|
|
411
411
|
return l ? (n ? r.trace_level |= l : r.trace_level &= ~l, 0) : -1;
|
|
412
412
|
}
|
|
413
413
|
function ie(e, t, n) {
|
|
414
|
-
const r =
|
|
414
|
+
const r = Pn(e) ? Se(e) : e;
|
|
415
415
|
if (!r) return dn(`gobj_set_gclass_no_trace: gclass NOT FOUND: ${e}`), -1;
|
|
416
416
|
const l = null === t ? 4294967295 : W(t, "gobj_set_gclass_no_trace", r.s_user_trace_level || null);
|
|
417
417
|
return l ? (n ? r.no_trace_level |= l : r.no_trace_level &= ~l, 0) : -1;
|
|
418
418
|
}
|
|
419
419
|
function _e(e, t) {
|
|
420
420
|
let n = {};
|
|
421
|
-
if (!
|
|
421
|
+
if (!Ln(t)) return dn("sdata_desc MUST be an array"), hn(t), n;
|
|
422
422
|
for (let r = 0; r < t.length; r++) {
|
|
423
423
|
const l = t[r];
|
|
424
424
|
l.name && ae(e, n, l);
|
|
@@ -432,7 +432,7 @@
|
|
|
432
432
|
r = String(l);
|
|
433
433
|
break;
|
|
434
434
|
case E.DTP_BOOLEAN:
|
|
435
|
-
r =
|
|
435
|
+
r = Kn(l);
|
|
436
436
|
break;
|
|
437
437
|
case E.DTP_INTEGER:
|
|
438
438
|
r = parseInt(l), isNaN(r) && dn(`${et(e)}: attr NaN: ${n.name}`);
|
|
@@ -441,16 +441,16 @@
|
|
|
441
441
|
r = Number(l), isNaN(r) && dn(`${et(e)}: attr NaN: ${n.name}`);
|
|
442
442
|
break;
|
|
443
443
|
case E.DTP_LIST:
|
|
444
|
-
if (
|
|
444
|
+
if (Pn(l)) try {
|
|
445
445
|
r = JSON.parse(l);
|
|
446
446
|
} catch (e) {
|
|
447
447
|
dn(`JSON parse error: ${e.message}`);
|
|
448
448
|
}
|
|
449
449
|
else r = l;
|
|
450
|
-
|
|
450
|
+
Ln(r) || (r = []);
|
|
451
451
|
break;
|
|
452
452
|
case E.DTP_DICT:
|
|
453
|
-
if (
|
|
453
|
+
if (Pn(l)) try {
|
|
454
454
|
r = JSON.parse(l);
|
|
455
455
|
} catch (e) {
|
|
456
456
|
dn(`JSON parse error: ${e.message}`);
|
|
@@ -459,7 +459,7 @@
|
|
|
459
459
|
Cn(r) || (r = {});
|
|
460
460
|
break;
|
|
461
461
|
case E.DTP_JSON:
|
|
462
|
-
if (
|
|
462
|
+
if (Pn(l)) try {
|
|
463
463
|
r = JSON.parse(l);
|
|
464
464
|
} catch (e) {
|
|
465
465
|
dn(`JSON parse error: ${e.message}`);
|
|
@@ -475,14 +475,14 @@
|
|
|
475
475
|
switch (n.type) {
|
|
476
476
|
case E.DTP_STRING:
|
|
477
477
|
if (null == r) l = "";
|
|
478
|
-
else if (
|
|
478
|
+
else if (Pn(r)) l = String(r);
|
|
479
479
|
else {
|
|
480
480
|
let e = JSON.stringify(r);
|
|
481
481
|
e && (l = String(e));
|
|
482
482
|
}
|
|
483
483
|
break;
|
|
484
484
|
case E.DTP_BOOLEAN:
|
|
485
|
-
l =
|
|
485
|
+
l = Kn(r);
|
|
486
486
|
break;
|
|
487
487
|
case E.DTP_INTEGER:
|
|
488
488
|
l = parseInt(r), isNaN(l) && dn(`${et(e)}: attr NaN: ${n.name}`);
|
|
@@ -491,16 +491,16 @@
|
|
|
491
491
|
l = Number(r), isNaN(l) && dn(`${et(e)}: attr NaN: ${n.name}`);
|
|
492
492
|
break;
|
|
493
493
|
case E.DTP_LIST:
|
|
494
|
-
if (
|
|
494
|
+
if (Pn(r)) try {
|
|
495
495
|
l = JSON.parse(r);
|
|
496
496
|
} catch (e) {
|
|
497
497
|
dn(`JSON parse error: ${e.message}`);
|
|
498
498
|
}
|
|
499
499
|
else l = r;
|
|
500
|
-
if (!
|
|
500
|
+
if (!Ln(l)) return dn(`attr must be an array: ${n.name}`), -1;
|
|
501
501
|
break;
|
|
502
502
|
case E.DTP_DICT:
|
|
503
|
-
if (
|
|
503
|
+
if (Pn(r)) try {
|
|
504
504
|
l = JSON.parse(r);
|
|
505
505
|
} catch (e) {
|
|
506
506
|
dn(`JSON parse error: ${e.message}`);
|
|
@@ -509,13 +509,13 @@
|
|
|
509
509
|
if (!Cn(l)) return dn(`attr must be an object: ${n.name}`), -1;
|
|
510
510
|
break;
|
|
511
511
|
case E.DTP_JSON:
|
|
512
|
-
if (
|
|
512
|
+
if (Pn(r)) try {
|
|
513
513
|
l = JSON.parse(r);
|
|
514
514
|
} catch (e) {
|
|
515
515
|
dn(`JSON parse error: ${e.message}`);
|
|
516
516
|
}
|
|
517
517
|
else l = r;
|
|
518
|
-
if (!
|
|
518
|
+
if (!Ln(l) && !Cn(l)) return dn(`attr must be a json dict/list: ${n.name}`), -1;
|
|
519
519
|
break;
|
|
520
520
|
case E.DTP_POINTER: l = r;
|
|
521
521
|
}
|
|
@@ -559,7 +559,7 @@
|
|
|
559
559
|
let n = t[e][0], r = t[e][1];
|
|
560
560
|
if (!Wn(n)) {
|
|
561
561
|
if (ve(c, n)) return dn(`SMachine: event repeated in input_events: ${n}`), be(c), null;
|
|
562
|
-
|
|
562
|
+
ye(c, n, r);
|
|
563
563
|
}
|
|
564
564
|
}
|
|
565
565
|
if (!c.fsm_checked) {
|
|
@@ -570,7 +570,7 @@
|
|
|
570
570
|
}
|
|
571
571
|
function be(e) {
|
|
572
572
|
let t;
|
|
573
|
-
if (
|
|
573
|
+
if (Pn(e)) t = e;
|
|
574
574
|
else {
|
|
575
575
|
if (!(e instanceof S)) return dn("Cannot unregister gclass, type unknown"), -1;
|
|
576
576
|
t = e.gclass_name;
|
|
@@ -603,11 +603,11 @@
|
|
|
603
603
|
let o = pe(e, t);
|
|
604
604
|
return o ? me(o, n) ? (dn(`event already exists: gclass ${e.gclass_name}, state ${t}, event ${n}`), -1) : (o.dl_actions.push(new k(n, r, l)), 0) : (dn(`state not found: ${t}`), -1);
|
|
605
605
|
}
|
|
606
|
-
function
|
|
606
|
+
function Te(e, t, n) {
|
|
607
607
|
Wn(t) || e.push(new I(t, n));
|
|
608
608
|
}
|
|
609
|
-
function
|
|
610
|
-
return e instanceof S ?
|
|
609
|
+
function ye(e, t, n) {
|
|
610
|
+
return e instanceof S ? Te(e.dl_events, t, n) : (dn("Cannot add state, typeof not GClass"), -1);
|
|
611
611
|
}
|
|
612
612
|
function ve(e, t) {
|
|
613
613
|
if (!(e instanceof S)) return dn("Cannot add state, typeof not GClass"), 0;
|
|
@@ -652,11 +652,11 @@
|
|
|
652
652
|
function Oe() {
|
|
653
653
|
return !m || m.obflag & R.obflag_destroyed ? null : m;
|
|
654
654
|
}
|
|
655
|
-
function
|
|
655
|
+
function Ne(e, t) {
|
|
656
656
|
e = e.toLowerCase();
|
|
657
657
|
return b[e] || (t && dn(`gobj service not found: ${e}`), null);
|
|
658
658
|
}
|
|
659
|
-
function
|
|
659
|
+
function we(e) {
|
|
660
660
|
let t = Xe(e);
|
|
661
661
|
return t = t.toLowerCase(), b[t] && dn(`service ALREADY REGISTERED: ${t}. Will be UPDATED`), b[t] = e, 0;
|
|
662
662
|
}
|
|
@@ -680,29 +680,29 @@
|
|
|
680
680
|
let o = 0;
|
|
681
681
|
for (const [s, i] of Object.entries(t)) {
|
|
682
682
|
const t = ge(l.gclass, s, !1);
|
|
683
|
-
t ? (-1 === n || t.flag & n) && (t.flag &
|
|
683
|
+
t ? (-1 === n || t.flag & n) && (t.flag & T.SDF_DEPRECATED && bn(`${et(l)}: Deprecated attribute used in gobj creation: ${s}`), o += ue(l, e, t, i)) : r && (r(l, s), o--);
|
|
684
684
|
}
|
|
685
685
|
return o;
|
|
686
|
-
})(ce(e), r, -1, e.gclass.gclass_flag &
|
|
686
|
+
})(ce(e), r, -1, e.gclass.gclass_flag & N.gcflag_ignore_unknown_attrs ? 0 : ke, e) < 0 && (dn(`${et(e)} json2data() FAILED`), hn(r));
|
|
687
687
|
}
|
|
688
688
|
function Ie(e, t, r, l, o) {
|
|
689
|
-
if (o &
|
|
689
|
+
if (o & w.gobj_flag_yuno) {
|
|
690
690
|
if (p) return dn("__yuno__ already created"), null;
|
|
691
|
-
o |=
|
|
691
|
+
o |= w.gobj_flag_service;
|
|
692
692
|
} else {
|
|
693
693
|
if (!l) return dn("gobj NEEDS a parent!"), null;
|
|
694
694
|
if (!("string" == typeof l || l instanceof O)) return dn(`BAD TYPE of parent: ${l}`), null;
|
|
695
|
-
if (
|
|
695
|
+
if (Pn(l) && !(l = Ne(l))) return bn(`parent service not found: ${l}`), null;
|
|
696
696
|
}
|
|
697
|
-
if (o &
|
|
698
|
-
if (o &
|
|
697
|
+
if (o & w.gobj_flag_service && Ne(e, !1)) return dn(`service ALREADY registered: ${t}^${e}`), null;
|
|
698
|
+
if (o & w.gobj_flag_default_service) {
|
|
699
699
|
if (m) return dn(`default service ALREADY registered: ${t}^${e}`), null;
|
|
700
|
-
o |=
|
|
700
|
+
o |= w.gobj_flag_service;
|
|
701
701
|
}
|
|
702
702
|
if (Wn(t)) return dn("gclass_name must be a string"), null;
|
|
703
703
|
let s = Se(t, !1);
|
|
704
704
|
if (!s) return dn(`GClass not registered: ${t}^${e}`), null;
|
|
705
|
-
if (!
|
|
705
|
+
if (!Pn(e)) return dn(`gobj_name must be a string: ${t}`), null;
|
|
706
706
|
if (!Wn(e)) {
|
|
707
707
|
if (e.includes("`")) return dn(`gobj_name cannot contain char ': ${t}^${e}`), null;
|
|
708
708
|
if (e.includes("^")) return dn(`gobj_name cannot contain char ^: ${t}^${e}`), null;
|
|
@@ -711,55 +711,55 @@
|
|
|
711
711
|
_.jn_attrs = _e(_, s.attrs_table);
|
|
712
712
|
for (const [e, t] of Object.entries(_.jn_attrs)) e in _.priv && (_.priv[e] = t);
|
|
713
713
|
let a = Y(_);
|
|
714
|
-
return a &&
|
|
714
|
+
return a && L(n("💙💙⏩ creating: %s^%s", s.gclass_name, e)), _.gobj_flag & w.gobj_flag_service && we(_), _.gobj_flag & w.gobj_flag_yuno && (p = _), _.gobj_flag & w.gobj_flag_default_service && (m = _), _.gobj_flag & w.gobj_flag_yuno || Re(l, _), _.obflag |= R.obflag_created, _.gclass.instances++, $e(_, r), _.gobj_flag & w.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 && L(n("👦👦🔵 child_added(%s): %s", tt(l), et(_))), l.gclass.gmt.mt_child_added(l, _)), a && L(n("💙💙⏪ created: %s", tt(_))), _;
|
|
715
715
|
}
|
|
716
716
|
function Ce(e, t, n, r) {
|
|
717
|
-
return Ie(e, t, n, r,
|
|
717
|
+
return Ie(e, t, n, r, w.gobj_flag_pure_child);
|
|
718
718
|
}
|
|
719
|
-
function
|
|
719
|
+
function Le(e) {
|
|
720
720
|
if (ot(e)) return void dn("gobj NULL or DESTROYED");
|
|
721
|
-
e.__refs__ > 0 && dn(`${et(e)}: gobj DESTROYING with references: ${e.__refs__}`), e.playing && (dn(`Destroying a PLAYING gobj: ${tt(e)}`),
|
|
722
|
-
if (0 ===
|
|
723
|
-
for (let t of
|
|
724
|
-
|
|
721
|
+
e.__refs__ > 0 && dn(`${et(e)}: gobj DESTROYING with references: ${e.__refs__}`), e.playing && (dn(`Destroying a PLAYING gobj: ${tt(e)}`), Ke(e)), e.running && (dn(`Destroying a RUNNING gobj: ${tt(e)}`), Ge(e)), e.obflag |= R.obflag_destroying, function(e) {
|
|
722
|
+
if (0 === Lt.length) return;
|
|
723
|
+
for (let t of Lt) t.src === e && (t.src = null);
|
|
724
|
+
Lt = Lt.filter((t) => t.dst !== e);
|
|
725
725
|
}(e);
|
|
726
726
|
let t = Y(e);
|
|
727
|
-
t &&
|
|
727
|
+
t && L(n("💔💔⏩ destroying: %s", tt(e)));
|
|
728
728
|
let r = nt(e);
|
|
729
|
-
r && r.gclass.gmt.mt_child_removed && (t &&
|
|
729
|
+
r && r.gclass.gmt.mt_child_removed && (t && L(n("👦👦🔴 child_removed(%s): %s", tt(r), et(e))), r.gclass.gmt.mt_child_removed(r, e)), e.gobj_flag & w.gobj_flag_service && function(e) {
|
|
730
730
|
let t = Xe(e);
|
|
731
731
|
t = t.toLowerCase(), b[t] ? delete b[t] : dn(`"service NOT found in register": ${t}`);
|
|
732
732
|
}(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) {
|
|
733
733
|
let t = e.dl_children.slice();
|
|
734
734
|
for (let e = 0; e < t.length; e++) {
|
|
735
735
|
let n = t[e];
|
|
736
|
-
ot(n) ||
|
|
736
|
+
ot(n) || Le(n);
|
|
737
737
|
}
|
|
738
|
-
}(e), e.obflag & R.obflag_created && e.gclass.gmt.mt_destroy && e.gclass.gmt.mt_destroy(e), t &&
|
|
738
|
+
}(e), e.obflag & R.obflag_created && e.gclass.gmt.mt_destroy && e.gclass.gmt.mt_destroy(e), t && L(n("💔💔⏪ destroyed: %s", tt(e))), e.obflag |= R.obflag_destroyed, e.obflag & R.obflag_created && e.gclass.instances--;
|
|
739
739
|
}
|
|
740
|
-
function
|
|
740
|
+
function Pe(e) {
|
|
741
741
|
if (ot(e)) return dn("gobj NULL or DESTROYED"), -1;
|
|
742
742
|
if (e.running) return dn(`${et(e)}: GObj ALREADY RUNNING`), -1;
|
|
743
743
|
if (e.disabled) return dn(`${et(e)}: GObj DISABLED`), -1;
|
|
744
|
-
J(e) &&
|
|
744
|
+
J(e) && L(n("⏺ ⏺ start: %s", tt(e))), e.running = !0;
|
|
745
745
|
let t = 0;
|
|
746
746
|
return e.gclass.gmt.mt_start && (t = e.gclass.gmt.mt_start(e)), t;
|
|
747
747
|
}
|
|
748
748
|
function Ue(e, t, n) {
|
|
749
|
-
return e.gclass.gclass_flag &
|
|
749
|
+
return e.gclass.gclass_flag & N.gcflag_manual_start || ot(e) || xe(e) || Ye(e) || Pe(e), 0;
|
|
750
750
|
}
|
|
751
751
|
function Fe(e, t, n) {
|
|
752
|
-
return e.gclass.gclass_flag &
|
|
752
|
+
return e.gclass.gclass_flag & N.gcflag_manual_start || Ye(e) ? 1 : (xe(e) || Pe(e), 0);
|
|
753
753
|
}
|
|
754
754
|
function Ge(e) {
|
|
755
755
|
if (ot(e)) return dn("gobj NULL or DESTROYED"), -1;
|
|
756
756
|
if (!e.running) return dn(`${et(e)}: GObj NOT RUNNING`), -1;
|
|
757
|
-
e.playing && (bn(`${et(e)}: GObj stopping without previous pause`),
|
|
757
|
+
e.playing && (bn(`${et(e)}: GObj stopping without previous pause`), Ke(e)), J(e) && L(n("⏹ ⏹ stop: %s", tt(e))), e.running = !1;
|
|
758
758
|
let t = 0;
|
|
759
759
|
return e.gclass.gmt.mt_stop && (t = e.gclass.gmt.mt_stop(e)), t;
|
|
760
760
|
}
|
|
761
761
|
function Ve(e, t, n) {
|
|
762
|
-
return
|
|
762
|
+
return xe(e) && Ge(e), 0;
|
|
763
763
|
}
|
|
764
764
|
function Me(e) {
|
|
765
765
|
return ot(e) ? (dn("gobj NULL or DESTROYED"), -1) : at(e, A.WALK_FIRST2LAST, Ve, 0, 0);
|
|
@@ -768,25 +768,25 @@
|
|
|
768
768
|
if (ot(e)) return dn(`gobj NULL or DESTROYED: ${et(e)}`), -1;
|
|
769
769
|
if (e.playing) return dn(`${et(e)}: GObj ALREADY PLAYING`), -1;
|
|
770
770
|
if (e.disabled) return dn(`${et(e)}: GObj DISABLED`), -1;
|
|
771
|
-
if (!
|
|
772
|
-
if (e.gclass.gclass_flag &
|
|
773
|
-
bn(`${et(e)}: GObj playing without previous start`),
|
|
771
|
+
if (!xe(e)) {
|
|
772
|
+
if (e.gclass.gclass_flag & N.gcflag_required_start_to_play) return dn(`${et(e)}: Cannot play, start not done`), -1;
|
|
773
|
+
bn(`${et(e)}: GObj playing without previous start`), Pe(e);
|
|
774
774
|
}
|
|
775
|
-
J(e) &&
|
|
775
|
+
J(e) && L(n("⏯ ⏯ play: %s", tt(e))), e.playing = !0;
|
|
776
776
|
let t = 0;
|
|
777
777
|
return e.gclass.gmt.mt_play && (t = e.gclass.gmt.mt_play(e), (t < 0 || !1 === t) && (e.playing = !1)), t;
|
|
778
778
|
}
|
|
779
|
-
function xe(e) {
|
|
780
|
-
return ot(e) ? (dn("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) : (dn(`${et(e)}: GObj NOT PLAYING`), -1);
|
|
781
|
-
}
|
|
782
779
|
function Ke(e) {
|
|
780
|
+
return ot(e) ? (dn("gobj NULL or DESTROYED"), -1) : e.playing ? (J(e) && L(n("⏸ ⏸ pause: %s", tt(e))), e.playing = !1, e.gclass.gmt.mt_pause ? e.gclass.gmt.mt_pause(e) : 0) : (dn(`${et(e)}: GObj NOT PLAYING`), -1);
|
|
781
|
+
}
|
|
782
|
+
function xe(e) {
|
|
783
783
|
return !ot(e) && e.running;
|
|
784
784
|
}
|
|
785
785
|
function Ye(e) {
|
|
786
786
|
return !!ot(e) || e.disabled;
|
|
787
787
|
}
|
|
788
788
|
function Be(e) {
|
|
789
|
-
return !!(e && e.gobj_flag &
|
|
789
|
+
return !!(e && e.gobj_flag & w.gobj_flag_service);
|
|
790
790
|
}
|
|
791
791
|
function Je(e) {
|
|
792
792
|
return !ot(e) && e.playing;
|
|
@@ -825,10 +825,10 @@
|
|
|
825
825
|
return Mn(e) ? e.parent : (dn("gobj NULL of bad type"), null);
|
|
826
826
|
}
|
|
827
827
|
function rt(e) {
|
|
828
|
-
return Mn(e) ? !!(e.gobj_flag &
|
|
828
|
+
return Mn(e) ? !!(e.gobj_flag & w.gobj_flag_volatil) : (dn("gobj NULL of bad type"), null);
|
|
829
829
|
}
|
|
830
830
|
function lt(e) {
|
|
831
|
-
return Mn(e) ? !!(e.gobj_flag &
|
|
831
|
+
return Mn(e) ? !!(e.gobj_flag & w.gobj_flag_pure_child) : (dn("gobj NULL of bad type"), null);
|
|
832
832
|
}
|
|
833
833
|
function ot(e) {
|
|
834
834
|
return !Mn(e) || !!(e.obflag & (R.obflag_destroyed | R.obflag_destroying));
|
|
@@ -942,21 +942,21 @@
|
|
|
942
942
|
}
|
|
943
943
|
return dn(`${et(e)}: GClass Attribute NOT FOUND, attr ${t}`), null;
|
|
944
944
|
}
|
|
945
|
-
function
|
|
945
|
+
function Tt(e, t, n) {
|
|
946
946
|
let r = {}, l = e.gclass.attrs_table;
|
|
947
947
|
for (let n = 0; n < l.length; n++) {
|
|
948
948
|
const o = l[n];
|
|
949
949
|
if (o.name && (-1 === t || o.flag & t)) {
|
|
950
950
|
let t;
|
|
951
|
-
!e.gclass.gmt.mt_reading || e.obflag & R.obflag_destroyed ? t = Sn(e.jn_attrs, o.name) : (t = e.gclass.gmt.mt_reading(e, o.name), void 0 === t && (t = Sn(e.jn_attrs, o.name))),
|
|
951
|
+
!e.gclass.gmt.mt_reading || e.obflag & R.obflag_destroyed ? t = Sn(e.jn_attrs, o.name) : (t = e.gclass.gmt.mt_reading(e, o.name), void 0 === t && (t = Sn(e.jn_attrs, o.name))), Nn(r, o.name, t);
|
|
952
952
|
}
|
|
953
953
|
}
|
|
954
954
|
return r;
|
|
955
955
|
}
|
|
956
|
-
function
|
|
956
|
+
function yt(e, t) {
|
|
957
957
|
if (t) {
|
|
958
958
|
if (0 === Yn(t, "__disabled__")) return Ye(e);
|
|
959
|
-
if (0 === Yn(t, "__running__")) return
|
|
959
|
+
if (0 === Yn(t, "__running__")) return xe(e);
|
|
960
960
|
if (0 === Yn(t, "__playing__")) return Je(e);
|
|
961
961
|
if (0 === Yn(t, "__service__")) return Be(e);
|
|
962
962
|
}
|
|
@@ -978,7 +978,7 @@
|
|
|
978
978
|
return n ? !e.gclass.gmt.mt_reading || e.obflag & R.obflag_destroyed ? Sn(n, t) : e.gclass.gmt.mt_reading(e, t) : (dn(`${et(e)}: GClass Attribute NOT FOUND, attr ${t}`), 0);
|
|
979
979
|
}
|
|
980
980
|
function Ot(e, t, r, l) {
|
|
981
|
-
if (!
|
|
981
|
+
if (!Pn(t)) return dn(n("gobj_write_attr(%s): path must be a string", et(e))), -1;
|
|
982
982
|
let o, s = e.jn_attrs, i = t.split("`");
|
|
983
983
|
if (i.length <= 1) {
|
|
984
984
|
let l = t;
|
|
@@ -998,7 +998,7 @@
|
|
|
998
998
|
}
|
|
999
999
|
return dn(n("gobj_write_attr(%s): attr not found '%s'", et(e), o)), -1;
|
|
1000
1000
|
}
|
|
1001
|
-
function
|
|
1001
|
+
function Nt(e, t, n, r) {
|
|
1002
1002
|
let l = ce(e), o = 0;
|
|
1003
1003
|
for (const [r, s] of Object.entries(t)) {
|
|
1004
1004
|
let t = _t(e, r, !0);
|
|
@@ -1006,9 +1006,9 @@
|
|
|
1006
1006
|
}
|
|
1007
1007
|
return o;
|
|
1008
1008
|
}
|
|
1009
|
-
function
|
|
1009
|
+
function wt(e, t, n) {
|
|
1010
1010
|
let r = fe(e, t, !1);
|
|
1011
|
-
return r ? (r[t] =
|
|
1011
|
+
return r ? (r[t] = Kn(n), Cn(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) : (dn(`${et(e)}: GClass Attribute NOT FOUND, attr ${t}`), -1);
|
|
1012
1012
|
}
|
|
1013
1013
|
function Rt(e, t, n) {
|
|
1014
1014
|
let r = fe(e, t, !1);
|
|
@@ -1025,9 +1025,9 @@
|
|
|
1025
1025
|
if (!r) return dn(`${et(e)}: state unknown, state ${t}`), !1;
|
|
1026
1026
|
e.last_state = e.current_state, e.current_state = r;
|
|
1027
1027
|
let l = q(e, "EV_STATE_CHANGED"), o = !!function(e) {
|
|
1028
|
-
return
|
|
1028
|
+
return K(e) & P.TRACE_STATES;
|
|
1029
1029
|
}(e);
|
|
1030
|
-
return (l || o) && (1 === C ||
|
|
1030
|
+
return (l || o) && (1 === C || L(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;
|
|
1031
1031
|
}
|
|
1032
1032
|
function kt(e) {
|
|
1033
1033
|
return Mn(e) ? e.current_state.state_name : (dn("hgobj NULL"), "");
|
|
@@ -1053,14 +1053,14 @@
|
|
|
1053
1053
|
let r = $t(e, t, !1);
|
|
1054
1054
|
return !!r && !(n && !(r.event_flag & n)) && !!(r.event_flag & D.EVF_OUTPUT_EVENT);
|
|
1055
1055
|
}
|
|
1056
|
-
var
|
|
1056
|
+
var Lt = [], Pt = !1;
|
|
1057
1057
|
function Ut() {
|
|
1058
|
-
|
|
1059
|
-
let e =
|
|
1060
|
-
|
|
1058
|
+
Pt = !1;
|
|
1059
|
+
let e = Lt;
|
|
1060
|
+
Lt = [];
|
|
1061
1061
|
let t = 0;
|
|
1062
1062
|
for (let n of e) n.dst.obflag & (R.obflag_destroyed | R.obflag_destroying) || (Ft(n.dst, n.event, n.kw, n.src), t++);
|
|
1063
|
-
return
|
|
1063
|
+
return Lt.length > 0 && !Pt && (Pt = !0, setTimeout(Ut, 0)), t;
|
|
1064
1064
|
}
|
|
1065
1065
|
function Ft(e, t, r, l) {
|
|
1066
1066
|
if (!(e && e instanceof O)) return dn("gobj dst NULL"), -1;
|
|
@@ -1070,12 +1070,12 @@
|
|
|
1070
1070
|
let s = q(e, t) && !z(l, t);
|
|
1071
1071
|
h++;
|
|
1072
1072
|
let i = me(o, t);
|
|
1073
|
-
if (!i) return e.gclass.gmt.mt_inject_event ? (h--, s && (
|
|
1073
|
+
if (!i) return e.gclass.gmt.mt_inject_event ? (h--, s && (L(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 && H(e) && kn(r) && hn(r)), e.gclass.gmt.mt_inject_event(e, t, r, l)) : (s && L(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))), dn(`📛📛 Event NOT DEFINED in state 📛📛: ${et(e)}, ${o.state_name}, ${t}`), h--, -1);
|
|
1074
1074
|
if (s) {
|
|
1075
|
-
if (1 === C)
|
|
1075
|
+
if (1 === C) L(n("🔄 %s %s%s %s from %s%s", t || "", e.running ? "" : "!!", et(e), o.state_name, l && !l.running ? "!!" : "", et(l)));
|
|
1076
1076
|
else {
|
|
1077
1077
|
let r = "";
|
|
1078
|
-
i.action && (r = Ar(i.action)),
|
|
1078
|
+
i.action && (r = Ar(i.action)), L(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)));
|
|
1079
1079
|
}
|
|
1080
1080
|
r && H(e) && kn(r) && hn(r);
|
|
1081
1081
|
}
|
|
@@ -1084,7 +1084,7 @@
|
|
|
1084
1084
|
try {
|
|
1085
1085
|
i.action && (_ = i.action(e, t, r, l));
|
|
1086
1086
|
} finally {}
|
|
1087
|
-
return !s || 1 === C || e.obflag & R.obflag_destroyed ||
|
|
1087
|
+
return !s || 1 === C || e.obflag & R.obflag_destroyed || L(n("<- mach(%s%s^%s), st: %s, ev: %s, ret: %d", e.running ? "" : "!!", Ze(e), Xe(e), e.current_state.state_name, t || "", Un(_) ? _ : 0)), h--, _;
|
|
1088
1088
|
}
|
|
1089
1089
|
var Gt = Object.freeze({
|
|
1090
1090
|
__hard_subscription__: 1,
|
|
@@ -1106,19 +1106,19 @@
|
|
|
1106
1106
|
let o = tr(t, r, "__config__", null), s = tr(t, r, "__global__", null), i = tr(t, r, "__local__", null), _ = nr(t, r, "__filter__", null), a = !0;
|
|
1107
1107
|
if (t && t !== er(null, e, "publisher", null) && (a = !1), l && l !== er(null, e, "subscriber", null) && (a = !1), n && n !== Zn(null, e, "event", "") && (a = !1), In(o) > 0) {
|
|
1108
1108
|
let t = tr(null, e, "__config__", null);
|
|
1109
|
-
In(t) > 0 &&
|
|
1109
|
+
In(t) > 0 && Tn(t, o) || (a = !1);
|
|
1110
1110
|
}
|
|
1111
1111
|
if (In(s) > 0) {
|
|
1112
1112
|
let t = tr(null, e, "__global__", null);
|
|
1113
|
-
In(t) > 0 &&
|
|
1113
|
+
In(t) > 0 && Tn(t, s) || (a = !1);
|
|
1114
1114
|
}
|
|
1115
1115
|
if (In(i) > 0) {
|
|
1116
1116
|
let t = tr(null, e, "__local__", null);
|
|
1117
|
-
In(t) > 0 &&
|
|
1117
|
+
In(t) > 0 && Tn(t, i) || (a = !1);
|
|
1118
1118
|
}
|
|
1119
1119
|
if (In(_) > 0) {
|
|
1120
1120
|
let t = nr(null, e, "__filter__", null);
|
|
1121
|
-
In(t) > 0 &&
|
|
1121
|
+
In(t) > 0 && Tn(t, _) || (a = !1);
|
|
1122
1122
|
}
|
|
1123
1123
|
return a;
|
|
1124
1124
|
}
|
|
@@ -1130,16 +1130,16 @@
|
|
|
1130
1130
|
}
|
|
1131
1131
|
return o;
|
|
1132
1132
|
}
|
|
1133
|
-
function
|
|
1133
|
+
function Kt(e, t, n, r, l) {
|
|
1134
1134
|
for (let o = 0; o < e.length; o++) if (Mt(e[o], t, n, r, l)) return o;
|
|
1135
1135
|
return -1;
|
|
1136
1136
|
}
|
|
1137
|
-
function
|
|
1137
|
+
function xt(e, t, r, l) {
|
|
1138
1138
|
let o = er(e, t, "publisher", null, zt.KW_REQUIRED), s = er(e, t, "subscriber", null, zt.KW_REQUIRED), i = Zn(e, t, "event", "", zt.KW_REQUIRED);
|
|
1139
1139
|
if (!!(Xn(e, t, "subs_flag", null, zt.KW_REQUIRED) & Gt.__hard_subscription__) && !r) return -1;
|
|
1140
|
-
(B(s) || B(o)) && (
|
|
1141
|
-
let _ =
|
|
1142
|
-
return _ >= 0 ? An(o.dl_subscriptions, _) : (dn(`${et(e)}: subscription in publisher not found`), hn(t)), _ =
|
|
1140
|
+
(B(s) || B(o)) && (L(n("💜💜👎 unsubscribing event '%s': publisher %s, subscriber'%s'", i || "", et(o), et(s))), hn(t)), o.obflag & R.obflag_destroyed || l || o.gclass.gmt.mt_subscription_deleted && o.gclass.gmt.mt_subscription_deleted(o, t);
|
|
1141
|
+
let _ = Kt(o.dl_subscriptions, o, i, t, s);
|
|
1142
|
+
return _ >= 0 ? An(o.dl_subscriptions, _) : (dn(`${et(e)}: subscription in publisher not found`), hn(t)), _ = Kt(s.dl_subscribings, o, i, t, s), _ >= 0 ? An(s.dl_subscribings, _) : (dn(`${et(e)}: subscription in subscriber not found`), hn(t)), 0;
|
|
1143
1143
|
}
|
|
1144
1144
|
function Yt(e, t, r, l) {
|
|
1145
1145
|
if (null == r && (r = {}), !e) return dn(`publisher NULL: ev ${t}`), 0;
|
|
@@ -1154,18 +1154,18 @@
|
|
|
1154
1154
|
if (Object.keys(r).forEach((n) => {
|
|
1155
1155
|
o.has(n) || dn(`${et(e)}: key ignored in subscription (key: ${n}, event: ${t})`);
|
|
1156
1156
|
}), Wn(t)) t = "";
|
|
1157
|
-
else if (!(Ct(e, t, D.EVF_OUTPUT_EVENT) || e.gclass.gclass_flag &
|
|
1157
|
+
else if (!(Ct(e, t, D.EVF_OUTPUT_EVENT) || e.gclass.gclass_flag & N.gcflag_no_check_output_events)) return dn(`event NOT in output event list: ${et(e)}, ${t}`), 0;
|
|
1158
1158
|
let s = Wt(e.dl_subscriptions, e, t, r, l);
|
|
1159
1159
|
$n(s) > 0 && (dn(`${et(e)}: ${$n(s)} subscription(s) REPEATED, will be deleted and override`), hn(s, "subscription REPEATED"), Bt(e, s, !1));
|
|
1160
1160
|
let i = function(e, t, n, r) {
|
|
1161
1161
|
let l = _e(e, Vt);
|
|
1162
|
-
|
|
1162
|
+
wn(l, "event", t), wn(l, "subscriber", r), wn(l, "publisher", e);
|
|
1163
1163
|
let o = 0;
|
|
1164
1164
|
if (n) {
|
|
1165
1165
|
let t = tr(e, n, "__config__", null), r = tr(e, n, "__global__", null), s = tr(e, n, "__local__", null), i = nr(e, n, "__filter__", null), _ = Zn(e, n, "__service__", "");
|
|
1166
|
-
if (In(r) > 0 &&
|
|
1166
|
+
if (In(r) > 0 && wn(l, "__global__", En(r)), In(t) > 0) {
|
|
1167
1167
|
let n = En(t);
|
|
1168
|
-
if (
|
|
1168
|
+
if (wn(l, "__config__", n), Hn(n, "__hard_subscription__")) {
|
|
1169
1169
|
let t = Qn(e, n, "__hard_subscription__", !1);
|
|
1170
1170
|
On(n, "__hard_subscription__"), t && (o |= Gt.__hard_subscription__);
|
|
1171
1171
|
}
|
|
@@ -1174,20 +1174,20 @@
|
|
|
1174
1174
|
On(n, "__own_event__"), t && (o |= Gt.__own_event__);
|
|
1175
1175
|
}
|
|
1176
1176
|
}
|
|
1177
|
-
In(s) > 0 &&
|
|
1177
|
+
In(s) > 0 && wn(l, "__local__", En(s)), In(i) > 0 && wn(l, "__filter__", En(i)), Wn(_) || wn(l, "__service__", _);
|
|
1178
1178
|
}
|
|
1179
|
-
return
|
|
1179
|
+
return wn(l, "subs_flag", o), l;
|
|
1180
1180
|
}(e, t, r, l);
|
|
1181
1181
|
if (!i) return dn(`${et(e)}: _create_subscription() FAILED`), 0;
|
|
1182
|
-
if (Rn(e.dl_subscriptions, i), Rn(l.dl_subscribings, i), (B(l) || B(e)) && (
|
|
1182
|
+
if (Rn(e.dl_subscriptions, i), Rn(l.dl_subscribings, i), (B(l) || B(e)) && (L(n("💜💜👍 subscribing event '%s', publisher '%s', subscriber %s", t || "", et(e), et(l))), r && (H(l) || H(e)) && hn(r)), e.gclass.gmt.mt_subscription_added) {
|
|
1183
1183
|
let t = e.gclass.gmt.mt_subscription_added(e, i);
|
|
1184
|
-
(t < 0 || !1 === t) && (
|
|
1184
|
+
(t < 0 || !1 === t) && (xt(e, i, !0, !0), i = 0);
|
|
1185
1185
|
}
|
|
1186
1186
|
return i;
|
|
1187
1187
|
}
|
|
1188
1188
|
function Bt(e, t, n) {
|
|
1189
1189
|
let r = [...t];
|
|
1190
|
-
for (let t = 0; t < r.length; t++)
|
|
1190
|
+
for (let t = 0; t < r.length; t++) xt(e, r[t], n, !1);
|
|
1191
1191
|
return 0;
|
|
1192
1192
|
}
|
|
1193
1193
|
function Jt(e, t, n, r) {
|
|
@@ -1200,9 +1200,9 @@
|
|
|
1200
1200
|
if (Cn(r) || (r = {}), !e || e.obflag & (R.obflag_destroyed | R.obflag_destroying)) return dn("gobj NULL or DESTROYED"), -1;
|
|
1201
1201
|
if (Wn(t)) return dn(`${et(e)}: event EMPTY`), -1;
|
|
1202
1202
|
let l = $t(e, t, !0);
|
|
1203
|
-
if (!(l && l.event_flag & (D.EVF_SYSTEM_EVENT | D.EVF_OUTPUT_EVENT) || e.gclass.gclass_flag &
|
|
1203
|
+
if (!(l && l.event_flag & (D.EVF_SYSTEM_EVENT | D.EVF_OUTPUT_EVENT) || e.gclass.gclass_flag & N.gcflag_no_check_output_events)) return dn(`event NOT in output event list: ${et(e)}, ev ${t}`), -1;
|
|
1204
1204
|
let o = (B(e) || q(e, t)) && !z(e, t);
|
|
1205
|
-
if (o && (
|
|
1205
|
+
if (o && (L(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 || "", "")), H(e) && kn(r) && hn(r)), e.gclass.gmt.mt_publish_event) {
|
|
1206
1206
|
let n = e.gclass.gmt.mt_publish_event(e, t, r);
|
|
1207
1207
|
if (n <= 0) return n;
|
|
1208
1208
|
}
|
|
@@ -1220,11 +1220,11 @@
|
|
|
1220
1220
|
if (Wn(f) || 0 === Yn(f, t)) {
|
|
1221
1221
|
tr(e, a, "__config__", null, 0);
|
|
1222
1222
|
let l = tr(e, a, "__global__", null, 0), s = tr(e, a, "__local__", null, 0), f = nr(e, a, "__filter__", null, 0), g = r, d = 1;
|
|
1223
|
-
if (e.gclass.gmt.mt_publication_filter ? d = e.gclass.gmt.mt_publication_filter(e, t, g, u) : In(f) > 0 && (d = sr(g, f) ? 1 : 0, o && (
|
|
1223
|
+
if (e.gclass.gmt.mt_publication_filter ? d = e.gclass.gmt.mt_publication_filter(e, t, g, u) : In(f) > 0 && (d = sr(g, f) ? 1 : 0, o && (L(n("💜💜🔄%s publishing with filter, event '%s', subscriber'%s', publisher %s", d ? "👍" : "👎", t || "", et(u), et(e))), hn(f))), d < 0) break;
|
|
1224
1224
|
if (!d) continue;
|
|
1225
1225
|
let b = $t(u, t, !0);
|
|
1226
1226
|
if (b && b.event_flag & D.EVF_SYSTEM_EVENT && !It(u, b.event_name, 0)) continue;
|
|
1227
|
-
s && Jn(g, s), l &&
|
|
1227
|
+
s && Jn(g, s), l && yn(g, l), o && (L(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))), H(e) && kn(g) && hn(g));
|
|
1228
1228
|
let p = Ft(u, t, g, e);
|
|
1229
1229
|
if (p < 0 && c & Gt.__own_event__) {
|
|
1230
1230
|
i = -1;
|
|
@@ -1319,35 +1319,35 @@
|
|
|
1319
1319
|
return n;
|
|
1320
1320
|
}
|
|
1321
1321
|
function dn(e) {
|
|
1322
|
-
let t = gn(e), n =
|
|
1322
|
+
let t = gn(e), n = wr();
|
|
1323
1323
|
Xt && (Xt === Qt.error ? _n("error", t) && Xt("%c" + n + " ERROR: " + String(t), "color:red") : (_n("error", t) && Qt.error("%c" + n + " ERROR: " + String(t), "color:red"), Xt(`${n} ERROR: ${String(t)}`))), un("error", t, n);
|
|
1324
1324
|
}
|
|
1325
1325
|
function bn(e) {
|
|
1326
|
-
let t = gn(e), n =
|
|
1326
|
+
let t = gn(e), n = wr();
|
|
1327
1327
|
Zt && (Zt === Qt.warn ? _n("warning", t) && Zt("%c" + n + " WARNING: " + String(t), "color:yellow") : (_n("warning", t) && Qt.warn("%c" + n + " WARNING: " + String(t), "color:yellow"), Zt(`${n} WARNING: ${String(t)}`))), un("warning", t, n);
|
|
1328
1328
|
}
|
|
1329
1329
|
function pn(e) {
|
|
1330
|
-
let t = gn(e), n =
|
|
1330
|
+
let t = gn(e), n = wr();
|
|
1331
1331
|
tn && _n("debug", t) && tn("%c" + n + " DEBUG: " + String(t), "color:silver"), un("debug", t, n);
|
|
1332
1332
|
}
|
|
1333
1333
|
function mn(e) {
|
|
1334
|
-
let t = gn(e), n =
|
|
1334
|
+
let t = gn(e), n = wr();
|
|
1335
1335
|
tn && _n("msg", t) && tn("%c" + n + " MSG: " + String(t), "color:cyan"), un("msg", t, n);
|
|
1336
1336
|
}
|
|
1337
1337
|
function hn(e, t) {
|
|
1338
|
-
_n("json", t) && (t &&
|
|
1338
|
+
_n("json", t) && (t && Qt.warn("=====> " + t), Qt.dir(e)), un("json", e, wr());
|
|
1339
1339
|
}
|
|
1340
1340
|
function En(e) {
|
|
1341
1341
|
return structuredClone(e);
|
|
1342
1342
|
}
|
|
1343
|
-
function
|
|
1343
|
+
function Tn(e, t) {
|
|
1344
1344
|
if (e === t) return !0;
|
|
1345
1345
|
if (null === e || null === t) return e === t;
|
|
1346
1346
|
if (typeof e != typeof t) return !1;
|
|
1347
1347
|
if (Array.isArray(e) !== Array.isArray(t)) return !1;
|
|
1348
1348
|
if (Array.isArray(e)) {
|
|
1349
1349
|
if (e.length !== t.length) return !1;
|
|
1350
|
-
for (let n = 0; n < e.length; n++) if (!
|
|
1350
|
+
for (let n = 0; n < e.length; n++) if (!Tn(e[n], t[n])) return !1;
|
|
1351
1351
|
return !0;
|
|
1352
1352
|
}
|
|
1353
1353
|
if ("object" == typeof e) {
|
|
@@ -1355,13 +1355,13 @@
|
|
|
1355
1355
|
if (n.length !== r.length) return !1;
|
|
1356
1356
|
for (let l = 0; l < n.length; l++) {
|
|
1357
1357
|
if (n[l] !== r[l]) return !1;
|
|
1358
|
-
if (!
|
|
1358
|
+
if (!Tn(e[n[l]], t[r[l]])) return !1;
|
|
1359
1359
|
}
|
|
1360
1360
|
return !0;
|
|
1361
1361
|
}
|
|
1362
1362
|
return e === t;
|
|
1363
1363
|
}
|
|
1364
|
-
function
|
|
1364
|
+
function yn(e, t) {
|
|
1365
1365
|
if (!t) return e;
|
|
1366
1366
|
for (let n of Object.keys(t)) e[n] = t[n];
|
|
1367
1367
|
return e;
|
|
@@ -1382,10 +1382,10 @@
|
|
|
1382
1382
|
function On(e, t) {
|
|
1383
1383
|
e && e.hasOwnProperty(t) && delete e[t];
|
|
1384
1384
|
}
|
|
1385
|
-
function
|
|
1385
|
+
function Nn(e, t, n) {
|
|
1386
1386
|
e[t] = n;
|
|
1387
1387
|
}
|
|
1388
|
-
function
|
|
1388
|
+
function wn(e, t, n) {
|
|
1389
1389
|
e[t] = n;
|
|
1390
1390
|
}
|
|
1391
1391
|
function Rn(e, t) {
|
|
@@ -1401,18 +1401,18 @@
|
|
|
1401
1401
|
return Cn(e) ? Object.keys(e).length : 0;
|
|
1402
1402
|
}
|
|
1403
1403
|
function $n(e) {
|
|
1404
|
-
return
|
|
1404
|
+
return Ln(e) ? e.length : 0;
|
|
1405
1405
|
}
|
|
1406
1406
|
function In(e) {
|
|
1407
|
-
return Cn(e) ? Object.keys(e).length :
|
|
1407
|
+
return Cn(e) ? Object.keys(e).length : Ln(e) ? e.length : Pn(e) && e.length > 0 ? 1 : 0;
|
|
1408
1408
|
}
|
|
1409
1409
|
function Cn(e) {
|
|
1410
1410
|
return null !== e && "object" == typeof e && !Array.isArray(e);
|
|
1411
1411
|
}
|
|
1412
|
-
function
|
|
1412
|
+
function Ln(e) {
|
|
1413
1413
|
return Array.isArray(e);
|
|
1414
1414
|
}
|
|
1415
|
-
function
|
|
1415
|
+
function Pn(e) {
|
|
1416
1416
|
return "string" == typeof e;
|
|
1417
1417
|
}
|
|
1418
1418
|
function Un(e) {
|
|
@@ -1431,12 +1431,12 @@
|
|
|
1431
1431
|
return e instanceof O;
|
|
1432
1432
|
}
|
|
1433
1433
|
function Wn(e) {
|
|
1434
|
-
return !
|
|
1434
|
+
return !Pn(e) || 0 === e.length;
|
|
1435
1435
|
}
|
|
1436
|
-
function
|
|
1436
|
+
function Kn(e) {
|
|
1437
1437
|
return Un(e) ? Boolean(e) : /^\s*(true|1|on)\s*$/i.test(e);
|
|
1438
1438
|
}
|
|
1439
|
-
function
|
|
1439
|
+
function xn(e, t) {
|
|
1440
1440
|
return e === t ? 0 : e > t ? 1 : -1;
|
|
1441
1441
|
}
|
|
1442
1442
|
function Yn(e, t) {
|
|
@@ -1444,7 +1444,7 @@
|
|
|
1444
1444
|
return n === r ? 0 : n > r ? 1 : -1;
|
|
1445
1445
|
}
|
|
1446
1446
|
function Bn(e, t) {
|
|
1447
|
-
if (Cn(e) || Cn(t) ||
|
|
1447
|
+
if (Cn(e) || Cn(t) || Ln(e) || Ln(t)) return 0;
|
|
1448
1448
|
if (Un(e) || Un(t)) {
|
|
1449
1449
|
let n = Number(e), r = Number(t);
|
|
1450
1450
|
return n > r ? 1 : n < r ? -1 : 0;
|
|
@@ -1453,7 +1453,7 @@
|
|
|
1453
1453
|
let n = Number(e), r = Number(t);
|
|
1454
1454
|
return n > r ? 1 : n < r ? -1 : 0;
|
|
1455
1455
|
}
|
|
1456
|
-
return
|
|
1456
|
+
return xn(String(e), String(t));
|
|
1457
1457
|
}
|
|
1458
1458
|
function Jn(e, t) {
|
|
1459
1459
|
if ("object" != typeof t || Array.isArray(t)) if (Array.isArray(t)) for (const n of t) Jn(e, n);
|
|
@@ -1464,8 +1464,8 @@
|
|
|
1464
1464
|
return !(!(t in e) || !e.hasOwnProperty(t));
|
|
1465
1465
|
}
|
|
1466
1466
|
function qn(e, t, n, r) {
|
|
1467
|
-
if (e && !Mn(e) && dn("GObj bad instanceof"), !Cn(t) && !
|
|
1468
|
-
if (!
|
|
1467
|
+
if (e && !Mn(e) && dn("GObj bad instanceof"), !Cn(t) && !Ln(t)) return dn(`${et(e)}: kw must be list or dict`), 0;
|
|
1468
|
+
if (!Pn(n)) return dn(`${et(e)}: path must be a string: ${String(n)}`), 0;
|
|
1469
1469
|
let l = n.split("`");
|
|
1470
1470
|
if (l.length <= 1) return t[n];
|
|
1471
1471
|
let o = l.length;
|
|
@@ -1483,7 +1483,7 @@
|
|
|
1483
1483
|
function Qn(e, t, n, r, l) {
|
|
1484
1484
|
e && !Mn(e) && dn("GObj bad instanceof");
|
|
1485
1485
|
let o = qn(e, t, n, !1);
|
|
1486
|
-
const s = l && l & zt.KW_REQUIRED, i = l && l & zt.KW_CREATE, _ = l && l & zt.KW_EXTRACT;
|
|
1486
|
+
const s = l && l & zt.KW_REQUIRED, i = l && l & zt.KW_CREATE, _ = l && l & zt.KW_EXTRACT, a = l && l & zt.KW_WILD_NUMBER;
|
|
1487
1487
|
if (void 0 === o) {
|
|
1488
1488
|
if (i) {
|
|
1489
1489
|
let l = Boolean(r);
|
|
@@ -1491,7 +1491,15 @@
|
|
|
1491
1491
|
}
|
|
1492
1492
|
return s && (dn(`path not found: '${n}'`), hn(t)), Boolean(r);
|
|
1493
1493
|
}
|
|
1494
|
-
|
|
1494
|
+
let u;
|
|
1495
|
+
if (Fn(o)) u = o;
|
|
1496
|
+
else if (a && Un(o)) u = 0 !== o;
|
|
1497
|
+
else if (a && Pn(o)) u = "true" === o.toLowerCase() || "false" !== o.toLowerCase() && 0 !== (parseInt(o) || 0);
|
|
1498
|
+
else {
|
|
1499
|
+
if (!a || null !== o) return s && (dn(`${et(e)}: path value MUST BE a boolean: ${n}`), mn(t)), Boolean(r);
|
|
1500
|
+
u = !1;
|
|
1501
|
+
}
|
|
1502
|
+
return _ && zn(e, t, n), u;
|
|
1495
1503
|
}
|
|
1496
1504
|
function Xn(e, t, n, r, l) {
|
|
1497
1505
|
e && !Mn(e) && dn("GObj bad instanceof");
|
|
@@ -1510,14 +1518,7 @@
|
|
|
1510
1518
|
e && !Mn(e) && dn("GObj bad instanceof");
|
|
1511
1519
|
let o = qn(e, t, n, !1);
|
|
1512
1520
|
const s = l && l & zt.KW_REQUIRED, i = l && l & zt.KW_CREATE, _ = l && l & zt.KW_EXTRACT;
|
|
1513
|
-
|
|
1514
|
-
if (i) {
|
|
1515
|
-
let l = String(r);
|
|
1516
|
-
return rr(e, t, n, l), l;
|
|
1517
|
-
}
|
|
1518
|
-
return s && (dn(`path not found: '${n}'`), hn(t)), String(r);
|
|
1519
|
-
}
|
|
1520
|
-
return _ && zn(e, t, n), Ln(o) ? String(o) : (s && (dn(`${et(e)}: path value MUST BE a string: ${n}`), mn(t)), String(r));
|
|
1521
|
+
return void 0 === o ? i ? (rr(e, t, n, Pn(r) ? r : null), r) : (s && (dn(`path not found: '${n}'`), hn(t)), r) : (_ && zn(e, t, n), Pn(o) ? o : (s && (dn(`${et(e)}: path value MUST BE a string: ${n}`), mn(t)), r));
|
|
1521
1522
|
}
|
|
1522
1523
|
function er(e, t, n, r, l) {
|
|
1523
1524
|
e && !Mn(e) && dn("GObj bad instanceof");
|
|
@@ -1536,14 +1537,7 @@
|
|
|
1536
1537
|
e && !Mn(e) && dn("GObj bad instanceof");
|
|
1537
1538
|
let o = qn(e, t, n, !1);
|
|
1538
1539
|
const s = l && l & zt.KW_REQUIRED, i = l && l & zt.KW_CREATE, _ = l && l & zt.KW_EXTRACT;
|
|
1539
|
-
|
|
1540
|
-
if (i) {
|
|
1541
|
-
let l = Object(r);
|
|
1542
|
-
return rr(e, t, n, l), l;
|
|
1543
|
-
}
|
|
1544
|
-
return s && (dn(`path not found: '${n}'`), hn(t)), Object(r);
|
|
1545
|
-
}
|
|
1546
|
-
return _ && zn(e, t, n), Cn(o) ? Object(o) : (s && (dn(`path value MUST BE a dict: ${n}`), mn(t)), Object(r));
|
|
1540
|
+
return void 0 === o ? i && Cn(r) && t ? (rr(e, t, n, r), r) : (s && (dn(`path not found: '${n}'`), hn(t)), r) : Cn(o) ? (_ && zn(e, t, n), o) : (s && (dn(`${et(e)}: path value MUST BE a dict: ${n}`), mn(t)), r);
|
|
1547
1541
|
}
|
|
1548
1542
|
function nr(e, t, n, r, l) {
|
|
1549
1543
|
e && !Mn(e) && dn("GObj bad instanceof");
|
|
@@ -1571,12 +1565,12 @@
|
|
|
1571
1565
|
}
|
|
1572
1566
|
function lr(e, t, n, r, l) {
|
|
1573
1567
|
if (e && !Mn(e) && dn("GObj bad instanceof"), !Cn(t)) return dn("kw is not an object"), -1;
|
|
1574
|
-
let o = tr(e, t, n, {},
|
|
1568
|
+
let o = tr(e, t, n, {}, zt.KW_CREATE);
|
|
1575
1569
|
return Cn(o) ? (o[r] = l, 0) : (dn("subdict is not an object"), -1);
|
|
1576
1570
|
}
|
|
1577
1571
|
function or(e, t, r) {
|
|
1578
1572
|
let l = "", o = !1;
|
|
1579
|
-
if (
|
|
1573
|
+
if (Ln(t)) {
|
|
1580
1574
|
o = !1;
|
|
1581
1575
|
for (let s = 0; s < t.length; s++) {
|
|
1582
1576
|
let i = t[s];
|
|
@@ -1587,7 +1581,7 @@
|
|
|
1587
1581
|
let s = Object.keys(t);
|
|
1588
1582
|
for (let i = 0; i < s.length; i++) {
|
|
1589
1583
|
let _ = s[i], a = t[_];
|
|
1590
|
-
if (l = Wn(r) ? n("%s", _) : n("%s`%s", r, _),
|
|
1584
|
+
if (l = Wn(r) ? n("%s", _) : n("%s`%s", r, _), Ln(a) || Cn(a)) {
|
|
1591
1585
|
if (o = or(e, a, l), !o) break;
|
|
1592
1586
|
continue;
|
|
1593
1587
|
}
|
|
@@ -1610,12 +1604,12 @@
|
|
|
1610
1604
|
function ir(e, t, n, r) {
|
|
1611
1605
|
e && !Mn(e) && dn("GObj bad instanceof");
|
|
1612
1606
|
let l = {};
|
|
1613
|
-
if (
|
|
1607
|
+
if (Pn(n) && !Wn(n)) {
|
|
1614
1608
|
let o = n;
|
|
1615
1609
|
t.hasOwnProperty(o) ? l[o] = t[o] : r && dn(`${et(e)}: key not found: ${o}`);
|
|
1616
1610
|
} else if (Cn(n) && kn(n) > 0) for (let o of Object.keys(n)) t.hasOwnProperty(o) ? l[o] = t[o] : r && dn(`${et(e)}: key not found: ${o}`);
|
|
1617
1611
|
else {
|
|
1618
|
-
if (!(
|
|
1612
|
+
if (!(Ln(n) && $n(n) > 0)) return t;
|
|
1619
1613
|
for (let o = 0; o < n.length; o++) {
|
|
1620
1614
|
let s = n[o];
|
|
1621
1615
|
t.hasOwnProperty(s) ? l[s] = t[s] : r && dn(`${et(e)}: key not found: ${s}`);
|
|
@@ -1625,12 +1619,12 @@
|
|
|
1625
1619
|
}
|
|
1626
1620
|
function _r(e, t, n, r) {
|
|
1627
1621
|
let l = {};
|
|
1628
|
-
if (
|
|
1622
|
+
if (yn(l, t), Pn(n) && !Wn(n)) {
|
|
1629
1623
|
let o = n;
|
|
1630
1624
|
nr(e, t, o, 0, 0) ? On(l, o) : r && dn(`${et(e)}: key not found: ${o}`);
|
|
1631
1625
|
} else if (Cn(n) && kn(n) > 0) for (let o of Object.keys(n)) t.hasOwnProperty(o) ? On(l, o) : r && dn(`${et(e)}: key not found: ${o}`);
|
|
1632
1626
|
else {
|
|
1633
|
-
if (!(
|
|
1627
|
+
if (!(Ln(n) && $n(n) > 0)) return {};
|
|
1634
1628
|
for (let o = 0; o < n.length; o++) {
|
|
1635
1629
|
let s = n[o];
|
|
1636
1630
|
t.hasOwnProperty(s) ? On(l, s) : r && dn(`${et(e)}: key not found: ${s}`);
|
|
@@ -1665,24 +1659,24 @@
|
|
|
1665
1659
|
}
|
|
1666
1660
|
function fr(e, t) {
|
|
1667
1661
|
if (Gn(e) || Gn(t)) return !0;
|
|
1668
|
-
if (
|
|
1662
|
+
if (Ln(e)) {
|
|
1669
1663
|
if (0 === e.length) return !0;
|
|
1670
1664
|
for (let n = 0; n < e.length; n++) if (e[n] === t) return !0;
|
|
1671
1665
|
} else if (Cn(e)) {
|
|
1672
1666
|
if (0 === Object.keys(e).length) return !0;
|
|
1673
1667
|
for (let n in e) if (n === t) return !0;
|
|
1674
|
-
} else if (
|
|
1668
|
+
} else if (Pn(e) && e === t) return !0;
|
|
1675
1669
|
return !1;
|
|
1676
1670
|
}
|
|
1677
1671
|
function gr(e, t, n, r, l) {
|
|
1678
1672
|
if (e && !Mn(e) && dn("GObj bad instanceof"), !t) return null;
|
|
1679
1673
|
l || (l = sr);
|
|
1680
1674
|
let o = [];
|
|
1681
|
-
if (
|
|
1675
|
+
if (Ln(t)) for (let s = 0; s < t.length; s++) {
|
|
1682
1676
|
let i, _ = t[s];
|
|
1683
1677
|
if (Cn(_)) i = Zn(e, _, "id", "", 0);
|
|
1684
1678
|
else {
|
|
1685
|
-
if (!
|
|
1679
|
+
if (!Pn(_)) continue;
|
|
1686
1680
|
i = _;
|
|
1687
1681
|
}
|
|
1688
1682
|
fr(n, i) && l(_, r) && o.push(_);
|
|
@@ -1731,7 +1725,7 @@
|
|
|
1731
1725
|
let l = pr(t, n);
|
|
1732
1726
|
l || (l = [], mr(t, n, l));
|
|
1733
1727
|
try {
|
|
1734
|
-
|
|
1728
|
+
Ln(l) && l.unshift(r);
|
|
1735
1729
|
} catch (e) {
|
|
1736
1730
|
dn(e);
|
|
1737
1731
|
}
|
|
@@ -1742,14 +1736,14 @@
|
|
|
1742
1736
|
let l = pr(t, n);
|
|
1743
1737
|
return l ? 0 === l.length ? (r && dn(`stack empty: ${n}`), null) : l[0] : (r && dn(`stack NOT FOUND: ${n}`), null);
|
|
1744
1738
|
}
|
|
1745
|
-
function
|
|
1739
|
+
function Tr(e, t, n) {
|
|
1746
1740
|
return Wn(n) ? zn(e, t, "__md_iev__`__msg_type__") : lr(e, t, "__md_iev__", "__msg_type__", n), 0;
|
|
1747
1741
|
}
|
|
1748
|
-
function
|
|
1742
|
+
function yr(e, t) {
|
|
1749
1743
|
return Zn(e, t, "__md_iev__`__msg_type__", "", 0);
|
|
1750
1744
|
}
|
|
1751
1745
|
function vr(e, t, n) {
|
|
1752
|
-
void 0 !== n &&
|
|
1746
|
+
void 0 !== n && Pn(n) || (n = "");
|
|
1753
1747
|
for (let r of Object.keys(e)) {
|
|
1754
1748
|
if (!e.hasOwnProperty(r)) continue;
|
|
1755
1749
|
let l = (n.length ? "`" : "") + r;
|
|
@@ -1811,11 +1805,11 @@
|
|
|
1811
1805
|
function Or(e) {
|
|
1812
1806
|
return null == e ? "" : String(e).replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
1813
1807
|
}
|
|
1814
|
-
function
|
|
1808
|
+
function Nr(e) {
|
|
1815
1809
|
const t = document.createElement("template");
|
|
1816
1810
|
return t.innerHTML = e.trim(), t.content.firstChild;
|
|
1817
1811
|
}
|
|
1818
|
-
function
|
|
1812
|
+
function wr(e) {
|
|
1819
1813
|
const t = (e, t) => String(e).padStart(t, "0"), n = `${(e = e || /* @__PURE__ */ new Date()).getFullYear()}-${t(e.getMonth() + 1, 2)}-${t(e.getDate(), 2)}T${t(e.getHours(), 2)}:${t(e.getMinutes(), 2)}:${t(e.getSeconds(), 2)}`, r = t(e.getMilliseconds(), 3), l = e.getTimezoneOffset();
|
|
1820
1814
|
return `${n}.${r}${l > 0 ? "-" : "+"}${t(Math.floor(Math.abs(l) / 60), 2)}${t(Math.abs(l) % 60, 2)}`;
|
|
1821
1815
|
}
|
|
@@ -1858,14 +1852,14 @@
|
|
|
1858
1852
|
return null !== t ? t : "[" === e[0] && "[" === e[1] ? e.slice(1) : e;
|
|
1859
1853
|
});
|
|
1860
1854
|
}
|
|
1861
|
-
function
|
|
1855
|
+
function Lr(e, t) {
|
|
1862
1856
|
return e === t || null !== e && null !== t && "object" == typeof e && "object" == typeof t && JSON.stringify(e) === JSON.stringify(t);
|
|
1863
1857
|
}
|
|
1864
|
-
function
|
|
1858
|
+
function Pr(e) {
|
|
1865
1859
|
return "persistent-attrs-" + et(e);
|
|
1866
1860
|
}
|
|
1867
1861
|
function Ur(e, t) {
|
|
1868
|
-
if (
|
|
1862
|
+
if (Pn(t)) {
|
|
1869
1863
|
if (-1 === t.indexOf("^")) {
|
|
1870
1864
|
let n, r, l = e.fkey;
|
|
1871
1865
|
if (1 !== kn(l)) return dn("bad fkey 1"), dn(e), dn(t), null;
|
|
@@ -1996,32 +1990,32 @@
|
|
|
1996
1990
|
j(E.DTP_BOOLEAN, "periodic", 0, 0, "True for periodic timeouts"),
|
|
1997
1991
|
j(E.DTP_INTEGER, "msec", 0, 0, "Timeout in milliseconds"),
|
|
1998
1992
|
v()
|
|
1999
|
-
],
|
|
1993
|
+
], Kr = {
|
|
2000
1994
|
periodic: !1,
|
|
2001
1995
|
msec: 0,
|
|
2002
1996
|
timer_id: -1
|
|
2003
|
-
},
|
|
1997
|
+
}, xr = null;
|
|
2004
1998
|
function Yr(e, t, n, r) {
|
|
2005
1999
|
let l = e.priv, o = l.periodic ? "EV_TIMEOUT_PERIODIC" : "EV_TIMEOUT";
|
|
2006
2000
|
return l.periodic && l.msec > 0 ? l.timer_id = setTimeout(function() {
|
|
2007
2001
|
Ft(e, "EV_TIMEOUT", {}, e);
|
|
2008
|
-
}, l.msec) : l.timer_id = -1, lt(e) ? Ft(nt(e), o, {}, e) : qt(e, o, {}), l.periodic || -1 !== l.timer_id ||
|
|
2002
|
+
}, 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;
|
|
2009
2003
|
}
|
|
2010
2004
|
var Br = {
|
|
2011
2005
|
mt_create: function(e) {
|
|
2012
2006
|
let t = e.priv;
|
|
2013
2007
|
const n = St(e, "subscriber");
|
|
2014
|
-
n && Yt(e, null, {}, n), t.periodic =
|
|
2008
|
+
n && Yt(e, null, {}, n), t.periodic = yt(e, "periodic"), t.msec = vt(e, "msec");
|
|
2015
2009
|
},
|
|
2016
2010
|
mt_writing: function(e, t) {
|
|
2017
2011
|
let n = e.priv;
|
|
2018
2012
|
switch (t) {
|
|
2019
2013
|
case "periodic":
|
|
2020
|
-
n.periodic =
|
|
2014
|
+
n.periodic = yt(e, "periodic");
|
|
2021
2015
|
break;
|
|
2022
2016
|
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() {
|
|
2023
2017
|
Ft(e, "EV_TIMEOUT", {}, e);
|
|
2024
|
-
}, n.msec)), n.msec > 0 ?
|
|
2018
|
+
}, n.msec)), n.msec > 0 ? xe(e) || Pe(e) : xe(e) && Ge(e);
|
|
2025
2019
|
}
|
|
2026
2020
|
},
|
|
2027
2021
|
mt_start: function(e) {
|
|
@@ -2033,10 +2027,10 @@
|
|
|
2033
2027
|
mt_destroy: function(e) {}
|
|
2034
2028
|
};
|
|
2035
2029
|
function Jr(e, t) {
|
|
2036
|
-
return e instanceof O ? "C_TIMER" !== Ze(e) ? (dn("not C_TIMER GObj"), -1) : (
|
|
2030
|
+
return e instanceof O ? "C_TIMER" !== Ze(e) ? (dn("not C_TIMER GObj"), -1) : (wt(e, "periodic", !1), void Rt(e, "msec", t)) : (dn("not GObj TYPE"), -1);
|
|
2037
2031
|
}
|
|
2038
2032
|
function Hr(e, t) {
|
|
2039
|
-
return e instanceof O ? "C_TIMER" !== Ze(e) ? (dn("not C_TIMER GObj"), -1) : (
|
|
2033
|
+
return e instanceof O ? "C_TIMER" !== Ze(e) ? (dn("not C_TIMER GObj"), -1) : (wt(e, "periodic", !0), void Rt(e, "msec", t)) : (dn("not GObj TYPE"), -1);
|
|
2040
2034
|
}
|
|
2041
2035
|
function qr(e) {
|
|
2042
2036
|
return e instanceof O ? "C_TIMER" !== Ze(e) ? (dn("not C_TIMER GObj"), -1) : void Rt(e, "msec", -1) : (dn("not GObj TYPE"), -1);
|
|
@@ -2055,8 +2049,8 @@
|
|
|
2055
2049
|
j(E.DTP_STRING, "yuno_version", 0, "", "Yuno version (APP_VERSION)"),
|
|
2056
2050
|
j(E.DTP_STRING, "yuneta_version", 0, s, "Yuneta version"),
|
|
2057
2051
|
j(E.DTP_LIST, "required_services", 0, "[]", "Required services"),
|
|
2058
|
-
j(E.DTP_DICT, "trace_levels",
|
|
2059
|
-
j(E.DTP_DICT, "no_trace_levels",
|
|
2052
|
+
j(E.DTP_DICT, "trace_levels", T.SDF_PERSIST, "{}", "Trace levels"),
|
|
2053
|
+
j(E.DTP_DICT, "no_trace_levels", T.SDF_PERSIST, "{}", "No trace levels"),
|
|
2060
2054
|
j(E.DTP_POINTER, "trace_ievent_callback", 0, null, "Where the traffic trace goes (C_IEVENT_CLI levels ievents/ievents2); console when null"),
|
|
2061
2055
|
j(E.DTP_BOOLEAN, "developer", 0, !1, "Developer mode enabled"),
|
|
2062
2056
|
j(E.DTP_INTEGER, "periodic_timeout", 0, "1000", "Timeout periodic, in miliseconds."),
|
|
@@ -2080,17 +2074,17 @@
|
|
|
2080
2074
|
var rl = {
|
|
2081
2075
|
mt_create: function(e) {
|
|
2082
2076
|
let t = e.priv;
|
|
2083
|
-
Dt(e, "start_date",
|
|
2077
|
+
Dt(e, "start_date", wr()), Dt(e, "node_uuid", Dr()), e.priv.gobj_timer = Ce(Xe(e), "C_TIMER", {}, e), t.periodic_timeout = Et(e, "periodic_timeout"), function(e) {
|
|
2084
2078
|
let t = Et(e, "trace_levels");
|
|
2085
2079
|
if (!Cn(t)) return 0;
|
|
2086
2080
|
let n = t.__global_trace__;
|
|
2087
|
-
if (
|
|
2081
|
+
if (Ln(n)) {
|
|
2088
2082
|
Z(4294967295, !1);
|
|
2089
2083
|
for (let e of n) Q(e, !0);
|
|
2090
2084
|
}
|
|
2091
2085
|
for (const [n, r] of Object.entries(t)) {
|
|
2092
2086
|
let t = Se(n);
|
|
2093
|
-
if (t) if (
|
|
2087
|
+
if (t) if (Ln(r)) {
|
|
2094
2088
|
se(t, null, !1);
|
|
2095
2089
|
for (let e of r) se(t, e, !0);
|
|
2096
2090
|
} else dn(`${Xe(e)}: trace_levels of ${n} MUST be a list`);
|
|
@@ -2099,13 +2093,13 @@
|
|
|
2099
2093
|
let t = Et(e, "no_trace_levels");
|
|
2100
2094
|
if (!Cn(t)) return 0;
|
|
2101
2095
|
let n = t.__global_no_trace__;
|
|
2102
|
-
if (
|
|
2096
|
+
if (Ln(n)) {
|
|
2103
2097
|
ee(4294967295, !1);
|
|
2104
2098
|
for (let e of n) X(e, !0);
|
|
2105
2099
|
}
|
|
2106
2100
|
for (const [n, r] of Object.entries(t)) {
|
|
2107
2101
|
let t = Se(n);
|
|
2108
|
-
if (t) if (
|
|
2102
|
+
if (t) if (Ln(r)) {
|
|
2109
2103
|
ie(t, null, !1);
|
|
2110
2104
|
for (let e of r) ie(t, e, !0);
|
|
2111
2105
|
} else dn(`${Xe(e)}: no_trace_levels of ${n} MUST be a list`);
|
|
@@ -2122,10 +2116,10 @@
|
|
|
2122
2116
|
mt_destroy: function(e) {},
|
|
2123
2117
|
mt_play: function(e) {
|
|
2124
2118
|
let t = Oe();
|
|
2125
|
-
return
|
|
2119
|
+
return xe(t) || Pe(t), Je(t) || We(t), 0;
|
|
2126
2120
|
},
|
|
2127
2121
|
mt_pause: function(e) {
|
|
2128
|
-
return
|
|
2122
|
+
return Ke(Oe()), 0;
|
|
2129
2123
|
},
|
|
2130
2124
|
mt_command_parser: function(e, t, n, r) {
|
|
2131
2125
|
switch (n = n || {}, t) {
|
|
@@ -2151,20 +2145,20 @@
|
|
|
2151
2145
|
}
|
|
2152
2146
|
};
|
|
2153
2147
|
var ll = "ievent_gate_stack", ol = [
|
|
2154
|
-
j(E.DTP_STRING, "wanted_yuno_role",
|
|
2155
|
-
j(E.DTP_STRING, "wanted_yuno_name",
|
|
2156
|
-
j(E.DTP_STRING, "wanted_yuno_service",
|
|
2157
|
-
j(E.DTP_STRING, "remote_yuno_role",
|
|
2158
|
-
j(E.DTP_STRING, "remote_yuno_name",
|
|
2159
|
-
j(E.DTP_STRING, "remote_yuno_service",
|
|
2160
|
-
j(E.DTP_STRING, "url",
|
|
2161
|
-
j(E.DTP_STRING, "jwt",
|
|
2162
|
-
j(E.DTP_STRING, "cert_pem",
|
|
2163
|
-
j(E.DTP_JSON, "extra_info",
|
|
2164
|
-
j(E.DTP_LIST, "required_services",
|
|
2165
|
-
j(E.DTP_INTEGER, "timeout_retry",
|
|
2166
|
-
j(E.DTP_INTEGER, "timeout_retry_max",
|
|
2167
|
-
j(E.DTP_INTEGER, "timeout_idack",
|
|
2148
|
+
j(E.DTP_STRING, "wanted_yuno_role", T.SDF_RD, "", "wanted yuno role"),
|
|
2149
|
+
j(E.DTP_STRING, "wanted_yuno_name", T.SDF_RD, "", "wanted yuno name"),
|
|
2150
|
+
j(E.DTP_STRING, "wanted_yuno_service", T.SDF_RD, "", "wanted yuno service"),
|
|
2151
|
+
j(E.DTP_STRING, "remote_yuno_role", T.SDF_RD, "", "confirmed remote yuno role"),
|
|
2152
|
+
j(E.DTP_STRING, "remote_yuno_name", T.SDF_RD, "", "confirmed remote yuno name"),
|
|
2153
|
+
j(E.DTP_STRING, "remote_yuno_service", T.SDF_RD, "", "confirmed remote yuno service"),
|
|
2154
|
+
j(E.DTP_STRING, "url", T.SDF_RD, "", "Url to connect"),
|
|
2155
|
+
j(E.DTP_STRING, "jwt", T.SDF_PERSIST, "", "JWT"),
|
|
2156
|
+
j(E.DTP_STRING, "cert_pem", T.SDF_PERSIST, "", "SSL server certification, PEM str format"),
|
|
2157
|
+
j(E.DTP_JSON, "extra_info", T.SDF_RD, "{}", "dict data set by user, added to the identity card msg."),
|
|
2158
|
+
j(E.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."),
|
|
2159
|
+
j(E.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"),
|
|
2160
|
+
j(E.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"),
|
|
2161
|
+
j(E.DTP_INTEGER, "timeout_idack", T.SDF_RD, "5000", "timeout waiting idAck"),
|
|
2168
2162
|
j(E.DTP_POINTER, "subscriber", 0, 0, "subscriber of output-events. If null then subscriber is the parent"),
|
|
2169
2163
|
v()
|
|
2170
2164
|
], sl = [
|
|
@@ -2173,7 +2167,7 @@
|
|
|
2173
2167
|
["identity-card", "Trace identity_card messages"]
|
|
2174
2168
|
];
|
|
2175
2169
|
function il(e) {
|
|
2176
|
-
return !!(3 &
|
|
2170
|
+
return !!(3 & K(e));
|
|
2177
2171
|
}
|
|
2178
2172
|
var _l = {
|
|
2179
2173
|
url: null,
|
|
@@ -2204,7 +2198,7 @@
|
|
|
2204
2198
|
data: n.data
|
|
2205
2199
|
}, e);
|
|
2206
2200
|
}, n.onclose = (n) => {
|
|
2207
|
-
ot(e) || (
|
|
2201
|
+
ot(e) || (yt(He(), "browser_beforeunload") ? bn("Close websocket by unload page") : Ft(e, "EV_ON_CLOSE", {
|
|
2208
2202
|
url: t,
|
|
2209
2203
|
e: n
|
|
2210
2204
|
}, e));
|
|
@@ -2222,7 +2216,7 @@
|
|
|
2222
2216
|
} else bn("WebSocket is already closed or in the process of closing.");
|
|
2223
2217
|
}
|
|
2224
2218
|
function fl(e, t, n) {
|
|
2225
|
-
let r =
|
|
2219
|
+
let r = wr();
|
|
2226
2220
|
try {
|
|
2227
2221
|
pn("\n" + r + " " + t + "\n"), hn(n);
|
|
2228
2222
|
} catch (e) {
|
|
@@ -2286,22 +2280,22 @@
|
|
|
2286
2280
|
language: "undefined" != typeof window ? window.navigator.language : "",
|
|
2287
2281
|
required_services: i
|
|
2288
2282
|
};
|
|
2289
|
-
return hr(e, _, ll, bl(e, Xe(nt(e)), null)),
|
|
2283
|
+
return hr(e, _, ll, bl(e, Xe(nt(e)), null)), Tr(e, _, "__identity__"), Jr(t.gobj_timer, vt(e, "timeout_idack")), dl(e, "EV_IDENTITY_CARD", _);
|
|
2290
2284
|
}
|
|
2291
2285
|
function ml(e, t) {
|
|
2292
2286
|
if (Wn(t.event)) return -1;
|
|
2293
2287
|
let n = {}, r = t.__global__, l = t.__config__, o = t.__filter__, s = t.__service__, i = t.subscriber;
|
|
2294
2288
|
l && (n.__config__ = l), r && (n.__global__ = r), o && (n.__filter__ = o);
|
|
2295
|
-
return hr(e, n, ll, bl(e, Xe(i), s)),
|
|
2289
|
+
return hr(e, n, ll, bl(e, Xe(i), s)), Tr(e, n, "__subscribing__"), dl(e, t.event, n);
|
|
2296
2290
|
}
|
|
2297
2291
|
function hl(e, t, n, r) {
|
|
2298
2292
|
let l = e.priv;
|
|
2299
|
-
return
|
|
2293
|
+
return xe(e) && (l.websocket = ul(e)), 0;
|
|
2300
2294
|
}
|
|
2301
2295
|
function El(e, t, n, r) {
|
|
2302
2296
|
return pn("Websocket opened: " + e.priv.url), pl(e), 0;
|
|
2303
2297
|
}
|
|
2304
|
-
function
|
|
2298
|
+
function Tl(e, t, n, r) {
|
|
2305
2299
|
let l = e.priv, o = n.e, s = n.url;
|
|
2306
2300
|
return fn(), bn(`${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", {
|
|
2307
2301
|
url: s,
|
|
@@ -2316,7 +2310,7 @@
|
|
|
2316
2310
|
code: o.code,
|
|
2317
2311
|
reason: o.reason,
|
|
2318
2312
|
was_clean: o.wasClean
|
|
2319
|
-
})),
|
|
2313
|
+
})), xe(e) && Jr(l.gobj_timer, function(e) {
|
|
2320
2314
|
let t = e.priv, n = vt(e, "timeout_retry"), r = vt(e, "timeout_retry_max");
|
|
2321
2315
|
r < n && (r = n);
|
|
2322
2316
|
t.retry_ms = t.retry_ms ? Math.min(2 * t.retry_ms, r) : n;
|
|
@@ -2324,7 +2318,7 @@
|
|
|
2324
2318
|
return Math.max(1, Math.round(o));
|
|
2325
2319
|
}(e)), 0;
|
|
2326
2320
|
}
|
|
2327
|
-
function
|
|
2321
|
+
function yl(e, t, n, r) {
|
|
2328
2322
|
return pl(e), 0;
|
|
2329
2323
|
}
|
|
2330
2324
|
function vl(e, t, n, r) {
|
|
@@ -2394,14 +2388,14 @@
|
|
|
2394
2388
|
return cl(e), -1;
|
|
2395
2389
|
}
|
|
2396
2390
|
o = null;
|
|
2397
|
-
let _ =
|
|
2391
|
+
let _ = yr(e, i), a = Er(e, i, ll), u = Zn(e, a, "dst_role", "");
|
|
2398
2392
|
if (u.toLowerCase() !== ze().toLowerCase()) return dn(`"It's not my role, dst_role: ${u}, my_role: ${ze()}`), 0;
|
|
2399
2393
|
let c = Zn(e, a, "dst_service", "");
|
|
2400
2394
|
if ("__subscribing__" === _) return -1;
|
|
2401
2395
|
if ("__unsubscribing__" === _) return -1;
|
|
2402
2396
|
if (It(e, s, D.EVF_PUBLIC_EVENT)) return Ft(e, s, i, e), 0;
|
|
2403
2397
|
if (!Wn(c)) {
|
|
2404
|
-
let t =
|
|
2398
|
+
let t = Ne(c, !1);
|
|
2405
2399
|
return t ? It(t, s, D.EVF_PUBLIC_EVENT) ? (Ft(t, s, i, e), 0) : (dn(`${et(e)}: Service found but no event or not public, service '${et(t)}', ev '${s}'`), -1) : (bn(`${et(e)}: event for a service that is gone, DROPPED: service '${c}', ev '${s}'`), 0);
|
|
2406
2400
|
}
|
|
2407
2401
|
return lt(e) ? Ft(nt(e), s, i, e) : qt(e, s, i), 0;
|
|
@@ -2412,7 +2406,7 @@
|
|
|
2412
2406
|
function Ol(e, t, n, r) {
|
|
2413
2407
|
return 0;
|
|
2414
2408
|
}
|
|
2415
|
-
var
|
|
2409
|
+
var Nl = {
|
|
2416
2410
|
mt_create: function(e) {
|
|
2417
2411
|
let t = e.priv;
|
|
2418
2412
|
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);
|
|
@@ -2450,7 +2444,7 @@
|
|
|
2450
2444
|
return o || (o = {}), hr(e, n, "stats_stack", {
|
|
2451
2445
|
stats: t,
|
|
2452
2446
|
kw: o
|
|
2453
|
-
}), hr(e, n, ll, l), n.__stats__ = t,
|
|
2447
|
+
}), hr(e, n, ll, l), n.__stats__ = t, Tr(e, n, "__stats__"), dl(e, "EV_MT_STATS", n, r), null;
|
|
2454
2448
|
},
|
|
2455
2449
|
mt_command_parser: function(e, t, n, r) {
|
|
2456
2450
|
if ("ST_SESSION" !== kt(e)) return dn("Not in session"), null;
|
|
@@ -2459,7 +2453,7 @@
|
|
|
2459
2453
|
return o || (o = {}), hr(e, n, "command_stack", {
|
|
2460
2454
|
command: t,
|
|
2461
2455
|
kw: o
|
|
2462
|
-
}), hr(e, n, ll, l), n.__command__ = t,
|
|
2456
|
+
}), hr(e, n, ll, l), n.__command__ = t, Tr(e, n, "__command__"), dl(e, "EV_MT_COMMAND", n, r), null;
|
|
2463
2457
|
},
|
|
2464
2458
|
mt_inject_event: function(e, t, n, r) {
|
|
2465
2459
|
if ("ST_SESSION" !== kt(e)) return window.console.error("Not in session"), -1;
|
|
@@ -2468,7 +2462,7 @@
|
|
|
2468
2462
|
let l = bl(e, Xe(r), Zn(e, n, "__service__", 0, 0));
|
|
2469
2463
|
On(n, "__service__"), hr(e, n, "__message__", t), hr(e, n, ll, l);
|
|
2470
2464
|
}
|
|
2471
|
-
return
|
|
2465
|
+
return Tr(e, n, "__message__"), dl(e, t, n, r);
|
|
2472
2466
|
},
|
|
2473
2467
|
mt_subscription_added: function(e, t) {
|
|
2474
2468
|
let n = e.priv;
|
|
@@ -2481,10 +2475,10 @@
|
|
|
2481
2475
|
if (Wn(t.event)) return 0;
|
|
2482
2476
|
let r = {}, l = t.__global__, o = t.__config__, s = t.__filter__, i = t.__service__, _ = t.subscriber;
|
|
2483
2477
|
o && (r.__config__ = o), l && (r.__global__ = l), s && (r.__filter__ = s);
|
|
2484
|
-
return hr(e, r, ll, bl(e, Xe(_), i)),
|
|
2478
|
+
return hr(e, r, ll, bl(e, Xe(_), i)), Tr(e, r, "__unsubscribing__"), dl(e, t.event, r, e);
|
|
2485
2479
|
}
|
|
2486
2480
|
};
|
|
2487
|
-
e.GObj = O, e.SDATA = j, e.SDATAAUTHZ = (e, t, n, r, l, o) => new
|
|
2481
|
+
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__", {
|
|
2488
2482
|
enumerable: !0,
|
|
2489
2483
|
get: function() {
|
|
2490
2484
|
return p;
|
|
@@ -2504,16 +2498,16 @@
|
|
|
2504
2498
|
for (const n of Object.keys(l[e])) t += `${n}: ${l[e][n]};`;
|
|
2505
2499
|
i.style.cssText = t;
|
|
2506
2500
|
} 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]);
|
|
2507
|
-
if (
|
|
2501
|
+
if (Pn(o)) if (o = o.trim(), o.length > 0 && "<" === o[0]) i.appendChild(Nr(o));
|
|
2508
2502
|
else if (n && _) i.textContent = n(_) || o;
|
|
2509
2503
|
else i.textContent = o;
|
|
2510
|
-
else if (
|
|
2511
|
-
if (o.length > 0) if (
|
|
2504
|
+
else if (Ln(o)) {
|
|
2505
|
+
if (o.length > 0) if (Pn(o[0])) i.appendChild(e(o, n));
|
|
2512
2506
|
else for (let t of o) Array.isArray(t) && t.length > 0 ? i.appendChild(e(t, n)) : t instanceof HTMLElement && i.appendChild(t);
|
|
2513
2507
|
} else o instanceof HTMLElement || o instanceof Text || o instanceof SVGElement ? i.appendChild(o) : null != o && (dn("content ignored"), hn(o));
|
|
2514
2508
|
if (s && "object" == typeof s) for (const e of Object.keys(s)) i.addEventListener(e, s[e]);
|
|
2515
2509
|
return i;
|
|
2516
|
-
}, e.createOneHtml =
|
|
2510
|
+
}, e.createOneHtml = Nr, e.create_json_record = function(e, t) {
|
|
2517
2511
|
let n = En(e);
|
|
2518
2512
|
return vn(n, t), n;
|
|
2519
2513
|
}, e.create_template_record = function(e, t) {
|
|
@@ -2524,21 +2518,21 @@
|
|
|
2524
2518
|
let o = nr(null, t, e, l);
|
|
2525
2519
|
n[e] = o;
|
|
2526
2520
|
}), n;
|
|
2527
|
-
}, e.current_timestamp =
|
|
2528
|
-
let n = ar(
|
|
2521
|
+
}, e.current_timestamp = wr, e.data_type_t = E, e.db_list_persistent_attrs = function(e, t) {
|
|
2522
|
+
let n = ar(Pr(e), null, !1), r = {};
|
|
2529
2523
|
return n && Cn(n) && (r = ir(e, n, t, !1)), r;
|
|
2530
2524
|
}, e.db_load_persistent_attrs = function(e, t) {
|
|
2531
|
-
let n =
|
|
2525
|
+
let n = Tt(e, T.SDF_PERSIST), r = ar(Pr(e), null, !1);
|
|
2532
2526
|
if (r && Cn(r)) {
|
|
2533
2527
|
let l = ir(e, r, t, !1);
|
|
2534
|
-
l = ir(e, l, n, !1),
|
|
2528
|
+
l = ir(e, l, n, !1), Nt(e, l, T.SDF_PERSIST);
|
|
2535
2529
|
}
|
|
2536
2530
|
}, e.db_remove_persistent_attrs = function(e, t) {
|
|
2537
|
-
let n = _r(e, ar(
|
|
2538
|
-
0 === kn(n) ? cr(
|
|
2531
|
+
let n = _r(e, ar(Pr(e), null, !1), t, !1);
|
|
2532
|
+
0 === kn(n) ? cr(Pr(e)) : ur(Pr(e), n);
|
|
2539
2533
|
}, e.db_save_persistent_attrs = function(e, t) {
|
|
2540
|
-
let n = ir(e,
|
|
2541
|
-
return r && Cn(r) && jn(n, r), ur(
|
|
2534
|
+
let n = ir(e, Tt(e, T.SDF_PERSIST), t, !1), r = ar(Pr(e), null, !1);
|
|
2535
|
+
return r && Cn(r) && jn(n, r), ur(Pr(e), n);
|
|
2542
2536
|
}, e.debounce = function(e, t = 0, n = !1) {
|
|
2543
2537
|
let r = null, l = null, o = null;
|
|
2544
2538
|
const s = (...s) => {
|
|
@@ -2618,7 +2612,7 @@
|
|
|
2618
2612
|
removed: {},
|
|
2619
2613
|
changed: {}
|
|
2620
2614
|
};
|
|
2621
|
-
for (const e of Object.keys(n)) Object.prototype.hasOwnProperty.call(r, e) ?
|
|
2615
|
+
for (const e of Object.keys(n)) Object.prototype.hasOwnProperty.call(r, e) ? Lr(n[e], r[e]) || (l.changed[e] = {
|
|
2622
2616
|
from: n[e],
|
|
2623
2617
|
to: r[e]
|
|
2624
2618
|
}) : l.removed[e] = n[e];
|
|
@@ -2626,7 +2620,7 @@
|
|
|
2626
2620
|
return l;
|
|
2627
2621
|
}, e.flat_key_join = function(e) {
|
|
2628
2622
|
return Array.isArray(e) && 0 !== e.length ? e.map((e) => "number" == typeof e ? `[${e}]` : Ir(e)).join("`") : "";
|
|
2629
|
-
}, e.flat_key_split = Cr, e.gclass_add_ev_action = Ee, e.gclass_add_event_type =
|
|
2623
|
+
}, e.flat_key_split = Cr, e.gclass_add_ev_action = Ee, e.gclass_add_event_type = ye, e.gclass_add_state = he, e.gclass_check_fsm = je, e.gclass_create = de, e.gclass_event_type = ve, e.gclass_find_by_name = Se, e.gclass_flag_t = N, e.gclass_unregister = be, e.getPositionRelativeToBody = function(e) {
|
|
2630
2624
|
if (!e) return {
|
|
2631
2625
|
top: 0,
|
|
2632
2626
|
left: 0,
|
|
@@ -2651,38 +2645,38 @@
|
|
|
2651
2645
|
return ot(e) ? (dn("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) && pn(n("👦👦🔵 child_added(%s): %s", tt(t), et(e))), t.mt_child_added(t, e)), 0) : (dn(`${et(e)}: gobj_change_parent() BAD TYPE of parent`), -1);
|
|
2652
2646
|
}, e.gobj_change_state = At, e.gobj_command = function(e, t, r, o) {
|
|
2653
2647
|
return ot(e) ? (dn("gobj NULL or DESTROYED"), -1) : ((function(e) {
|
|
2654
|
-
return V > 1 || !!e && !!(
|
|
2655
|
-
}(e) || q(e, null) && !z(o, null)) && (
|
|
2648
|
+
return V > 1 || !!e && !!(K(e) & P.TRACE_COMMANDS);
|
|
2649
|
+
}(e) || q(e, null) && !z(o, null)) && (L(n("🌀🌀 mach(%s%s), cmd: %s, src: %s", xe(e) ? "" : "!!", et(e), t, et(o))), H(e) && hn(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));
|
|
2656
2650
|
}, e.gobj_create = function(e, t, n, r) {
|
|
2657
2651
|
return Ie(e, t, n, r, 0);
|
|
2658
2652
|
}, e.gobj_create2 = Ie, e.gobj_create_default_service = function(e, t, n, r) {
|
|
2659
|
-
return Ie(e, t, n, r,
|
|
2653
|
+
return Ie(e, t, n, r, w.gobj_flag_default_service | w.gobj_flag_autostart);
|
|
2660
2654
|
}, e.gobj_create_pure_child = Ce, e.gobj_create_service = function(e, t, n, r) {
|
|
2661
|
-
return Ie(e, t, n, r,
|
|
2655
|
+
return Ie(e, t, n, r, w.gobj_flag_service);
|
|
2662
2656
|
}, e.gobj_create_volatil = function(e, t, n, r) {
|
|
2663
|
-
return Ie(e, t, n, r,
|
|
2657
|
+
return Ie(e, t, n, r, w.gobj_flag_volatil);
|
|
2664
2658
|
}, e.gobj_create_yuno = function(e, t, n) {
|
|
2665
|
-
return Ie(e, t, n, null,
|
|
2666
|
-
}, e.gobj_current_state = kt, e.gobj_default_service = Oe, e.gobj_deliver_posted_events = Ut, e.gobj_destroy =
|
|
2659
|
+
return Ie(e, t, n, null, w.gobj_flag_yuno);
|
|
2660
|
+
}, e.gobj_current_state = kt, e.gobj_default_service = Oe, e.gobj_deliver_posted_events = Ut, e.gobj_destroy = Le, e.gobj_find_child = pt, e.gobj_find_gobj = function(e, t) {
|
|
2667
2661
|
if (Wn(t)) return null;
|
|
2668
2662
|
const n = t.toLowerCase();
|
|
2669
2663
|
return "__default_service__" === n ? m : "__yuno__" === n || "__root__" === n ? p : mt(p, t);
|
|
2670
|
-
}, e.gobj_find_service =
|
|
2664
|
+
}, e.gobj_find_service = Ne, e.gobj_find_subscribings = Ht, e.gobj_find_subscriptions = Jt, e.gobj_flag_t = w, 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() {
|
|
2671
2665
|
return F;
|
|
2672
2666
|
}, e.gobj_global_trace_no_level = function() {
|
|
2673
2667
|
return G;
|
|
2674
|
-
}, e.gobj_has_attr = ht, 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 =
|
|
2668
|
+
}, e.gobj_has_attr = ht, 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) {
|
|
2675
2669
|
return u ? u(e, t) : null;
|
|
2676
2670
|
}, e.gobj_list_subscriptions = function(e) {
|
|
2677
2671
|
let t = Jt(e, null, null, null);
|
|
2678
2672
|
for (let n = 0; n < t.length; n++) {
|
|
2679
2673
|
let r = t[n], l = er(e, r, "publisher", null, zt.KW_REQUIRED), o = er(e, r, "subscriber", null, zt.KW_REQUIRED);
|
|
2680
|
-
|
|
2674
|
+
wn(r, "s_event", Zn(e, r, "event", "", zt.KW_REQUIRED)), wn(r, "s_publisher", et(l)), wn(r, "s_subscriber", et(o));
|
|
2681
2675
|
}
|
|
2682
2676
|
let n = Ht(e, 0, null, 0);
|
|
2683
2677
|
for (let t = 0; t < n.length; t++) {
|
|
2684
2678
|
let r = n[t], l = er(e, r, "publisher", null, zt.KW_REQUIRED), o = er(e, r, "subscriber", null, zt.KW_REQUIRED);
|
|
2685
|
-
|
|
2679
|
+
wn(r, "s_event", Zn(e, r, "event", "", zt.KW_REQUIRED)), wn(r, "s_publisher", et(l)), wn(r, "s_subscriber", et(o));
|
|
2686
2680
|
}
|
|
2687
2681
|
return {
|
|
2688
2682
|
subscriptions: t,
|
|
@@ -2712,16 +2706,16 @@
|
|
|
2712
2706
|
bt(o, t) && n.push(o), e(n, o);
|
|
2713
2707
|
}
|
|
2714
2708
|
}(n, e), n;
|
|
2715
|
-
}, e.gobj_match_gobj = bt, e.gobj_name = Xe, e.gobj_parent = nt, e.gobj_pause =
|
|
2716
|
-
return e && e instanceof O ? e.obflag & (R.obflag_destroyed | R.obflag_destroying) ? (dn(`gobj_post_event(): gobj dst DESTROYING, event ${t}`), -1) : Wn(t) ? (dn("gobj_post_event(): event EMPTY"), -1) : It(e, t, 0) ?
|
|
2709
|
+
}, 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) {
|
|
2710
|
+
return e && e instanceof O ? e.obflag & (R.obflag_destroyed | R.obflag_destroying) ? (dn(`gobj_post_event(): gobj dst DESTROYING, event ${t}`), -1) : Wn(t) ? (dn("gobj_post_event(): event EMPTY"), -1) : It(e, t, 0) ? Lt.length >= 1e4 ? (dn(`gobj_post_event(): too many posted events, this is NOT a work queue, event ${t}, pending ${Lt.length}`), -1) : (Lt.push({
|
|
2717
2711
|
dst: e,
|
|
2718
2712
|
event: t,
|
|
2719
2713
|
kw: r,
|
|
2720
2714
|
src: l
|
|
2721
|
-
}), q(e, t) && !z(l, t) &&
|
|
2715
|
+
}), q(e, t) && !z(l, t) && L(n("📬 posted(%s%s), ev: %s, pending: %d", e.running ? "" : "!!", et(e), t, Lt.length)), Pt || (Pt = !0, setTimeout(Ut, 0)), 0) : (dn(`gobj_post_event(): event NOT DEFINED in gclass ${Ze(e)}, event ${t}`), -1) : (dn(`gobj_post_event(): gobj dst NULL, event ${t}`), -1);
|
|
2722
2716
|
}, e.gobj_posted_events_size = function() {
|
|
2723
|
-
return
|
|
2724
|
-
}, e.gobj_publish_event = qt, e.gobj_read_attr = Et, e.gobj_read_attrs =
|
|
2717
|
+
return Lt.length;
|
|
2718
|
+
}, e.gobj_publish_event = qt, e.gobj_read_attr = Et, 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) {
|
|
2725
2719
|
return Be(e) ? a ? a(e, t) : -1 : (dn(`${et(e)}: Only gobj services can load/save writable-persistent`), -1);
|
|
2726
2720
|
}, e.gobj_repr_global_trace_levels = function() {
|
|
2727
2721
|
return U.map(([e, t, n]) => ({
|
|
@@ -2742,7 +2736,7 @@
|
|
|
2742
2736
|
}
|
|
2743
2737
|
}
|
|
2744
2738
|
return 0;
|
|
2745
|
-
}(e,
|
|
2739
|
+
}(e, T.SDF_VOLATIL, 0);
|
|
2746
2740
|
}, e.gobj_save_persistent_attrs = Ae, e.gobj_search_path = mt, e.gobj_send_event = Ft, e.gobj_services = function() {
|
|
2747
2741
|
let e = [];
|
|
2748
2742
|
for (const t of Object.keys(b)) Dn(e, t);
|
|
@@ -2759,25 +2753,25 @@
|
|
|
2759
2753
|
return r ? (n ? e.trace_level |= r : e.trace_level &= ~r, 0) : -1;
|
|
2760
2754
|
}, e.gobj_set_trace_machine_format = function(e) {
|
|
2761
2755
|
C = 1 === Number(e) ? 1 : 0;
|
|
2762
|
-
}, e.gobj_short_name = et, e.gobj_start =
|
|
2756
|
+
}, e.gobj_short_name = et, e.gobj_start = Pe, e.gobj_start_children = function(e) {
|
|
2763
2757
|
return ot(e) ? (dn("gobj NULL or DESTROYED"), -1) : at(e, A.WALK_FIRST2LAST, Ue, 0, 0);
|
|
2764
2758
|
}, e.gobj_start_tree = function(e) {
|
|
2765
|
-
return ot(e) ? (dn("gobj NULL or DESTROYED"), -1) : (J(e) &&
|
|
2759
|
+
return ot(e) ? (dn("gobj NULL or DESTROYED"), -1) : (J(e) && L(n("⏺ ⏺ ⏺ ⏺ start_tree: %s", tt(e))), e.gclass.gclass_flag & N.gcflag_manual_start || e.disabled ? 0 : (e.running || Pe(e), ut(e, A.WALK_TOP2BOTTOM, Fe, 0, 0)));
|
|
2766
2760
|
}, e.gobj_start_up = function(e, t, n, r, l, o, s) {
|
|
2767
2761
|
i = t, _ = n, a = r, u = l, c = o, f = s;
|
|
2768
2762
|
const d = [["EV_STATE_CHANGED", D.EVF_SYSTEM_EVENT | D.EVF_OUTPUT_EVENT | D.EVF_NO_WARN_SUBS], [0, 0]];
|
|
2769
2763
|
for (let e = 0; e < d.length; e++) {
|
|
2770
2764
|
let t = d[e][0], n = d[e][1];
|
|
2771
|
-
|
|
2765
|
+
Te(g, t, n);
|
|
2772
2766
|
}
|
|
2773
2767
|
return 0;
|
|
2774
2768
|
}, e.gobj_stats = function(e, t, r, l) {
|
|
2775
2769
|
return ot(e) ? (dn("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);
|
|
2776
2770
|
}, e.gobj_stop = Ge, e.gobj_stop_children = Me, e.gobj_stop_tree = function(e) {
|
|
2777
|
-
return ot(e) ? (dn("gobj NULL or DESTROYED"), -1) : (J(e) &&
|
|
2778
|
-
}, e.gobj_subscribe_event = Yt, e.gobj_trace_level =
|
|
2771
|
+
return ot(e) ? (dn("gobj NULL or DESTROYED"), -1) : (J(e) && L(n("⏹ ⏹ ⏹ ⏹ stop_tree: %s", tt(e))), xe(e) && Ge(e), ut(e, A.WALK_TOP2BOTTOM, Ve, 0, 0));
|
|
2772
|
+
}, e.gobj_subscribe_event = Yt, e.gobj_trace_level = K, e.gobj_trace_machine_format = function() {
|
|
2779
2773
|
return C;
|
|
2780
|
-
}, e.gobj_trace_no_level =
|
|
2774
|
+
}, e.gobj_trace_no_level = x, e.gobj_unsubscribe_event = function(e, t, n, r) {
|
|
2781
2775
|
if (null == n && (n = {}), !e) return dn(`publisher NULL: ev ${t}`), 0;
|
|
2782
2776
|
if (!r) return dn(`subscriber NULL: ev ${t}`), 0;
|
|
2783
2777
|
const l = /* @__PURE__ */ new Set([
|
|
@@ -2790,37 +2784,37 @@
|
|
|
2790
2784
|
if (Object.keys(n).forEach((n) => {
|
|
2791
2785
|
l.has(n) || dn(`${et(e)}: key ignored in subscription (key: ${n}, event: ${t})`);
|
|
2792
2786
|
}), Wn(t)) t = "";
|
|
2793
|
-
else if (!(Ct(e, t, D.EVF_OUTPUT_EVENT) || e.gclass.gclass_flag &
|
|
2787
|
+
else if (!(Ct(e, t, D.EVF_OUTPUT_EVENT) || e.gclass.gclass_flag & N.gcflag_no_check_output_events)) return dn(`event NOT in output event list: ${et(e)}, ev ${t}`), 0;
|
|
2794
2788
|
let o = Wt(e.dl_subscriptions, e, t, n, r), s = 0;
|
|
2795
2789
|
for (let t = 0; t < o.length; t++) {
|
|
2796
2790
|
let n = o[t];
|
|
2797
|
-
|
|
2791
|
+
xt(e, n, !1, !1), s++;
|
|
2798
2792
|
}
|
|
2799
2793
|
return s || (bn(`${et(e)}: No subscription found`), hn(n, "No subscription found")), 0;
|
|
2800
|
-
}, 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 =
|
|
2794
|
+
}, 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 = Nt, e.gobj_write_bool_attr = wt, 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 = dr, e.index_in_list = Rr, e.is_array = Ln, e.is_boolean = Fn, e.is_date = function(e) {
|
|
2801
2795
|
return e instanceof Date && !isNaN(e);
|
|
2802
2796
|
}, e.is_function = Vn, e.is_gobj = Mn, e.is_metadata_key = function(e) {
|
|
2803
|
-
if (!
|
|
2797
|
+
if (!Pn(e)) return !1;
|
|
2804
2798
|
let t;
|
|
2805
2799
|
for (t = 0; t < e.length && "_" === e[t] && !(t > 2); t++);
|
|
2806
2800
|
return 2 === t;
|
|
2807
2801
|
}, e.is_null = Gn, e.is_number = Un, e.is_object = Cn, e.is_private_key = function(e) {
|
|
2808
|
-
if (!
|
|
2802
|
+
if (!Pn(e)) return !1;
|
|
2809
2803
|
let t;
|
|
2810
2804
|
for (t = 0; t < e.length && "_" === e[t] && !(t > 2); t++);
|
|
2811
2805
|
return 1 === t;
|
|
2812
2806
|
}, e.is_pure_number = function(e) {
|
|
2813
2807
|
if (Un(e)) return !0;
|
|
2814
|
-
if (!
|
|
2808
|
+
if (!Pn(e)) return !1;
|
|
2815
2809
|
const t = Number(e);
|
|
2816
2810
|
return !isNaN(t) && "" !== e.trim() && !isNaN(t);
|
|
2817
|
-
}, e.is_string =
|
|
2811
|
+
}, e.is_string = Pn, e.jdb_delete = function(e, t, n, r) {
|
|
2818
2812
|
let l = nr(null, nr(null, e, "topics", null, 0), t, null, 0);
|
|
2819
2813
|
if (!l) return dn("jdb_delete: topic not found: " + t), null;
|
|
2820
2814
|
if (Wn(r.id)) return dn("jdb_delete: record without id: " + r), mn(r), null;
|
|
2821
2815
|
let o, s = n.split("`"), i = l;
|
|
2822
2816
|
for (; (o = s.shift()) && !Wn(o) && i;) Cn(i) && (i = nr(null, i, e.hook, null, 0)), i = jr(i, null, o, !1);
|
|
2823
|
-
if (0 === s.length && i) if (
|
|
2817
|
+
if (0 === s.length && i) if (Ln(i)) {
|
|
2824
2818
|
let e = dr(i, r.id);
|
|
2825
2819
|
e >= 0 && i.splice(e, 1);
|
|
2826
2820
|
} else {
|
|
@@ -2852,7 +2846,7 @@
|
|
|
2852
2846
|
if (Wn(r.id)) return dn("jdb_update: record without id: " + r), mn(r), null;
|
|
2853
2847
|
let o, s = n.split("`"), i = l;
|
|
2854
2848
|
for (; (o = s.shift()) && !Wn(o) && i;) Cn(i) && (i = nr(null, i, e.hook, [], 1)), i = jr(i, null, o, !1);
|
|
2855
|
-
if (0 === s.length && i) if (
|
|
2849
|
+
if (0 === s.length && i) if (Ln(i)) i.push(r);
|
|
2856
2850
|
else if (i.id === r.id) Object.assign(i, r);
|
|
2857
2851
|
else {
|
|
2858
2852
|
let t = nr(null, i, e.hook, [], 1), n = jr(t, e.hook, r.id, !1);
|
|
@@ -2882,7 +2876,7 @@
|
|
|
2882
2876
|
return null == e || n(e, "", 0), t;
|
|
2883
2877
|
}, e.json_array_append = Rn, e.json_array_append_new = Dn, e.json_array_extend = function(e, t) {
|
|
2884
2878
|
return t ? (Array.prototype.push.apply(e, t), e) : e;
|
|
2885
|
-
}, e.json_array_remove = An, e.json_array_size = $n, e.json_deep_copy = En, e.json_is_identical =
|
|
2879
|
+
}, e.json_array_remove = An, e.json_array_size = $n, e.json_deep_copy = En, e.json_is_identical = Tn, e.json_object_del = On, e.json_object_get = Sn, e.json_object_set = Nn, e.json_object_set_new = wn, e.json_object_size = kn, e.json_object_update = yn, e.json_object_update_existing = vn, e.json_object_update_missing = jn, e.json_size = In, e.jwt2json = function(e, t) {
|
|
2886
2880
|
try {
|
|
2887
2881
|
let n = Sr(e);
|
|
2888
2882
|
switch (t) {
|
|
@@ -2897,7 +2891,7 @@
|
|
|
2897
2891
|
if (e && !Mn(e) && dn("GObj bad instanceof"), !t) return null;
|
|
2898
2892
|
r || (r = sr);
|
|
2899
2893
|
let l = [];
|
|
2900
|
-
if (
|
|
2894
|
+
if (Ln(t)) for (let e = 0; e < t.length; e++) {
|
|
2901
2895
|
let o = t[e];
|
|
2902
2896
|
r(o, n) && l.push(o);
|
|
2903
2897
|
}
|
|
@@ -2907,21 +2901,14 @@
|
|
|
2907
2901
|
}
|
|
2908
2902
|
return l;
|
|
2909
2903
|
}, e.kw_delete = zn, e.kw_find_json_in_list = function(e, t, n, r) {
|
|
2910
|
-
if (!n || !
|
|
2911
|
-
for (let e = 0; e < t.length; e++) if (
|
|
2904
|
+
if (!n || !Ln(t)) return r && dn("item NULL or kw_list is not a list"), -1;
|
|
2905
|
+
for (let e = 0; e < t.length; e++) if (Tn(n, t[e])) return e;
|
|
2912
2906
|
return r && dn("item not found in this list"), -1;
|
|
2913
2907
|
}, e.kw_find_path = qn, e.kw_flag_t = zt, e.kw_get_bool = Qn, e.kw_get_dict = tr, e.kw_get_dict_value = nr, e.kw_get_int = Xn, e.kw_get_list = function(e, t, n, r, l) {
|
|
2914
2908
|
e && !Mn(e) && dn("GObj bad instanceof");
|
|
2915
2909
|
let o = qn(e, t, n, !1);
|
|
2916
2910
|
const s = l && l & zt.KW_REQUIRED, i = l && l & zt.KW_CREATE, _ = l && l & zt.KW_EXTRACT;
|
|
2917
|
-
|
|
2918
|
-
if (i) {
|
|
2919
|
-
let l = Array(r);
|
|
2920
|
-
return rr(e, t, n, l), l;
|
|
2921
|
-
}
|
|
2922
|
-
return s && (dn(`path not found: '${n}'`), hn(t)), Array(r);
|
|
2923
|
-
}
|
|
2924
|
-
return _ && zn(e, t, n), Pn(o) ? Array(o) : (s && (dn(`path value MUST BE an array: ${n}`), mn(t)), Array(r));
|
|
2911
|
+
return void 0 === o ? i && Ln(r) && t ? (rr(e, t, n, r), r) : (s && (dn(`path not found: '${n}'`), hn(t)), r) : Ln(o) ? (_ && zn(e, t, n), o) : (s && (dn(`${et(e)}: path value MUST BE an array: ${n}`), mn(t)), r);
|
|
2925
2912
|
}, e.kw_get_local_storage_value = ar, e.kw_get_pointer = er, e.kw_get_real = function(e, t, n, r, l) {
|
|
2926
2913
|
e && !Mn(e) && dn("GObj bad instanceof");
|
|
2927
2914
|
let o = qn(e, t, n, !1);
|
|
@@ -2938,7 +2925,7 @@
|
|
|
2938
2925
|
if (e && !Mn(e) && dn("GObj bad instanceof"), !t) return null;
|
|
2939
2926
|
r || (r = sr);
|
|
2940
2927
|
let l = [];
|
|
2941
|
-
if (
|
|
2928
|
+
if (Ln(t)) for (let e = 0; e < t.length; e++) {
|
|
2942
2929
|
let o = t[e];
|
|
2943
2930
|
r(o, n) && l.push(En(o));
|
|
2944
2931
|
}
|
|
@@ -2954,10 +2941,10 @@
|
|
|
2954
2941
|
}, e.kwid_get_ids = function(e, t) {
|
|
2955
2942
|
if (e && !Mn(e) && dn("GObj bad instanceof"), !t) return [];
|
|
2956
2943
|
let n = [];
|
|
2957
|
-
if (
|
|
2944
|
+
if (Pn(t)) n.push(t);
|
|
2958
2945
|
else if (Cn(t)) for (let e in t) t.hasOwnProperty(e) && n.push(e);
|
|
2959
|
-
else
|
|
2960
|
-
if (
|
|
2946
|
+
else Ln(t) && t.forEach(function(t) {
|
|
2947
|
+
if (Pn(t)) Wn(t) || n.push(t);
|
|
2961
2948
|
else if (Cn(t)) {
|
|
2962
2949
|
let r = Zn(e, t, "id", 0, 0);
|
|
2963
2950
|
r && n.push(r);
|
|
@@ -2968,14 +2955,14 @@
|
|
|
2968
2955
|
e && !Mn(e) && dn("GObj bad instanceof");
|
|
2969
2956
|
let r = {};
|
|
2970
2957
|
if (Wn(n) || (t = qn(e, t, n)), Cn(t)) r = t;
|
|
2971
|
-
else if (
|
|
2958
|
+
else if (Ln(t)) for (let n = 0; n < t.length; n++) {
|
|
2972
2959
|
let l = t[n], o = Zn(e, l, "id", "", zt.KW_REQUIRED);
|
|
2973
2960
|
Wn(o) || (r[o] = l);
|
|
2974
2961
|
}
|
|
2975
2962
|
else dn(`${et(e)} kwid_new_dict: data type unknown`);
|
|
2976
2963
|
return r;
|
|
2977
2964
|
}, e.kwid_new_list = function(e, t, n) {
|
|
2978
|
-
if (e && !Mn(e) && dn("GObj bad instanceof"), Wn(n) || (t = qn(e, t, n)),
|
|
2965
|
+
if (e && !Mn(e) && dn("GObj bad instanceof"), Wn(n) || (t = qn(e, t, n)), Ln(t)) return t;
|
|
2979
2966
|
if (Cn(t)) {
|
|
2980
2967
|
let n = [];
|
|
2981
2968
|
for (let r of Object.keys(t)) {
|
|
@@ -2988,9 +2975,9 @@
|
|
|
2988
2975
|
}, e.list2options = function(e, t, n) {
|
|
2989
2976
|
t = t || "id", n = n || "value";
|
|
2990
2977
|
let r = [];
|
|
2991
|
-
if (
|
|
2978
|
+
if (Ln(e)) for (let l = 0; l < e.length; l++) {
|
|
2992
2979
|
let o = e[l];
|
|
2993
|
-
if (
|
|
2980
|
+
if (Pn(o)) r.push({
|
|
2994
2981
|
id: e[l],
|
|
2995
2982
|
value: e[l]
|
|
2996
2983
|
});
|
|
@@ -3033,9 +3020,9 @@
|
|
|
3033
3020
|
var e;
|
|
3034
3021
|
}, r.send();
|
|
3035
3022
|
}, e.log_debug = pn, e.log_error = dn, e.log_info = function(e) {
|
|
3036
|
-
let t = gn(e), n =
|
|
3023
|
+
let t = gn(e), n = wr();
|
|
3037
3024
|
en && _n("info", t) && en("%c" + n + " INFO: " + String(t), "color:cyan"), un("info", t, n);
|
|
3038
|
-
}, e.log_warning = bn, e.msg_iev_get_msg_type =
|
|
3025
|
+
}, e.log_warning = bn, e.msg_iev_get_msg_type = yr, e.msg_iev_get_stack = Er, e.msg_iev_push_stack = hr, e.msg_iev_read_key = pr, e.msg_iev_set_msg_type = Tr, e.msg_iev_write_key = mr, e.node_uuid = Dr, e.parseBoolean = Kn, e.parseSVG = function(e) {
|
|
3039
3026
|
return new DOMParser().parseFromString(e, "image/svg+xml").firstChild;
|
|
3040
3027
|
}, e.refresh_language = function(e, t) {
|
|
3041
3028
|
if (!Vn(t)) return void dn("You must supply a translation function");
|
|
@@ -3072,7 +3059,7 @@
|
|
|
3072
3059
|
],
|
|
3073
3060
|
[
|
|
3074
3061
|
"EV_ON_CLOSE",
|
|
3075
|
-
|
|
3062
|
+
Tl,
|
|
3076
3063
|
null
|
|
3077
3064
|
],
|
|
3078
3065
|
[
|
|
@@ -3099,12 +3086,12 @@
|
|
|
3099
3086
|
],
|
|
3100
3087
|
[
|
|
3101
3088
|
"EV_ON_CLOSE",
|
|
3102
|
-
|
|
3089
|
+
Tl,
|
|
3103
3090
|
"ST_DISCONNECTED"
|
|
3104
3091
|
],
|
|
3105
3092
|
[
|
|
3106
3093
|
"EV_TIMEOUT",
|
|
3107
|
-
|
|
3094
|
+
yl,
|
|
3108
3095
|
null
|
|
3109
3096
|
],
|
|
3110
3097
|
[
|
|
@@ -3131,7 +3118,7 @@
|
|
|
3131
3118
|
],
|
|
3132
3119
|
[
|
|
3133
3120
|
"EV_ON_CLOSE",
|
|
3134
|
-
|
|
3121
|
+
Tl,
|
|
3135
3122
|
"ST_DISCONNECTED"
|
|
3136
3123
|
],
|
|
3137
3124
|
[
|
|
@@ -3153,21 +3140,21 @@
|
|
|
3153
3140
|
["EV_ON_OPEN_ERROR", D.EVF_OUTPUT_EVENT | D.EVF_NO_WARN_SUBS],
|
|
3154
3141
|
["EV_TIMEOUT", 0],
|
|
3155
3142
|
[null, 0]
|
|
3156
|
-
], t,
|
|
3143
|
+
], t, Nl, 0, ol, _l, 0, 0, sl, N.gcflag_no_check_output_events)) ? 0 : -1;
|
|
3157
3144
|
}("C_IEVENT_CLI");
|
|
3158
3145
|
}, e.register_c_timer = function() {
|
|
3159
3146
|
return function(e) {
|
|
3160
|
-
if (
|
|
3147
|
+
if (xr) return dn(`GClass ALREADY created: ${e}`), -1;
|
|
3161
3148
|
const t = [["ST_IDLE", [[
|
|
3162
3149
|
"EV_TIMEOUT",
|
|
3163
3150
|
Yr,
|
|
3164
3151
|
null
|
|
3165
3152
|
]]]];
|
|
3166
|
-
return (
|
|
3153
|
+
return (xr = de(e, [
|
|
3167
3154
|
["EV_TIMEOUT", D.EVF_OUTPUT_EVENT],
|
|
3168
3155
|
["EV_TIMEOUT_PERIODIC", D.EVF_OUTPUT_EVENT],
|
|
3169
3156
|
[0, 0]
|
|
3170
|
-
], t, Br, 0, Wr,
|
|
3157
|
+
], t, Br, 0, Wr, Kr, 0, 0, 0, N.gcflag_manual_start)) ? 0 : -1;
|
|
3171
3158
|
}("C_TIMER");
|
|
3172
3159
|
}, e.register_c_yuno = function() {
|
|
3173
3160
|
return function(e) {
|
|
@@ -3183,7 +3170,7 @@
|
|
|
3183
3170
|
if (!e) return "";
|
|
3184
3171
|
const t = String(e).trim();
|
|
3185
3172
|
return /^javascript:/i.test(t) || /^data:/i.test(t) ? "" : Or(t);
|
|
3186
|
-
}, e.sdata_flag_t =
|
|
3173
|
+
}, e.sdata_flag_t = T, e.send_http_json_post = function(e, t, n) {
|
|
3187
3174
|
let r = new XMLHttpRequest();
|
|
3188
3175
|
r.open("POST", e), r.setRequestHeader("Accept", "application/json"), r.setRequestHeader("Content-Type", "application/json"), r.onreadystatechange = function() {
|
|
3189
3176
|
4 === r.readyState && n(r.status, r.responseText);
|
|
@@ -3205,7 +3192,7 @@
|
|
|
3205
3192
|
cn(e, r, n);
|
|
3206
3193
|
}
|
|
3207
3194
|
} else nn = e;
|
|
3208
|
-
}, e.set_remote_log_functions = fn, e.set_timeout = Jr, e.set_timeout_periodic = Hr, e.sprintf = n, e.stats_parser = function(e, t, n, r) {}, e.str_in_list = br, e.strcasecmp = Yn, e.strcmp =
|
|
3195
|
+
}, e.set_remote_log_functions = fn, e.set_timeout = Jr, e.set_timeout_periodic = Hr, e.sprintf = n, e.stats_parser = function(e, t, n, r) {}, e.str_in_list = br, e.strcasecmp = Yn, e.strcmp = xn, e.strncmp = function(e, t, n) {
|
|
3209
3196
|
var r = (e + "").substring(0, n), l = (t + "").substring(0, n);
|
|
3210
3197
|
return r === l ? 0 : r > l ? 1 : -1;
|
|
3211
3198
|
}, e.strs_in_list = function(e, t, n) {
|
|
@@ -3230,7 +3217,7 @@
|
|
|
3230
3217
|
placeholder: void 0,
|
|
3231
3218
|
fkey: null
|
|
3232
3219
|
};
|
|
3233
|
-
if (
|
|
3220
|
+
if (Pn(t)) {
|
|
3234
3221
|
let e = t.split(".");
|
|
3235
3222
|
for (let t = 0; t < e.length; t++) {
|
|
3236
3223
|
let r = e[t];
|
|
@@ -3248,7 +3235,7 @@
|
|
|
3248
3235
|
}
|
|
3249
3236
|
}
|
|
3250
3237
|
n.real_type || (n.real_type = "string");
|
|
3251
|
-
} else Cn(t) ? (n = Mr(t), n.name || (n.name = e), n.header || (n.header = e)) :
|
|
3238
|
+
} else Cn(t) ? (n = Mr(t), n.name || (n.name = e), n.header || (n.header = e)) : Ln(t) && (n.real_type = "array", n.enum_list = t);
|
|
3252
3239
|
return n.type || (n.type = n.real_type), n;
|
|
3253
3240
|
}, e.timeTracker = function(e = "Time Tracker", t = !1) {
|
|
3254
3241
|
const n = e, r = performance.now();
|
|
@@ -3260,8 +3247,8 @@
|
|
|
3260
3247
|
total: _
|
|
3261
3248
|
};
|
|
3262
3249
|
} };
|
|
3263
|
-
}, e.trace_json = hn, e.trace_level_t =
|
|
3264
|
-
if (
|
|
3250
|
+
}, e.trace_json = hn, e.trace_level_t = P, e.trace_msg = mn, e.treedb_decoder_fkey = Ur, e.treedb_decoder_hook = function(e, t) {
|
|
3251
|
+
if (Pn(t)) {
|
|
3265
3252
|
if (-1 === t.indexOf("^")) {
|
|
3266
3253
|
let n, r = e.hook;
|
|
3267
3254
|
if (1 !== kn(r)) return dn("bad hook 1"), dn(e), dn(t), null;
|
|
@@ -3290,7 +3277,7 @@
|
|
|
3290
3277
|
let n = Ur(e, t);
|
|
3291
3278
|
return n ? n.topic_name + "^" + n.id + "^" + n.hook_name : null;
|
|
3292
3279
|
}, e.treedb_get_field_desc = Mr, e.treedb_hook_data_size = function(e) {
|
|
3293
|
-
if (
|
|
3280
|
+
if (Ln(e) && 1 === In(e)) {
|
|
3294
3281
|
let t = e[0];
|
|
3295
3282
|
return Hn(t, "size") ? t.size : 1;
|
|
3296
3283
|
}
|