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