@yuneta/gobj-js 7.16.4 → 7.16.6
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 +17 -6
- package/dist/gobj-js.cjs.js.map +1 -1
- package/dist/gobj-js.cjs.min.js +290 -280
- package/dist/gobj-js.cjs.min.js.map +1 -1
- package/dist/gobj-js.es.js +17 -6
- package/dist/gobj-js.es.js.map +1 -1
- package/dist/gobj-js.es.min.js +18 -8
- package/dist/gobj-js.es.min.js.map +1 -1
- package/dist/gobj-js.iife.js +17 -6
- package/dist/gobj-js.iife.js.map +1 -1
- package/dist/gobj-js.iife.min.js +608 -598
- package/dist/gobj-js.iife.min.js.map +1 -1
- package/dist/gobj-js.umd.js +17 -6
- package/dist/gobj-js.umd.js.map +1 -1
- package/dist/gobj-js.umd.min.js +608 -598
- package/dist/gobj-js.umd.min.js.map +1 -1
- package/package.json +1 -1
package/dist/gobj-js.cjs.min.js
CHANGED
|
@@ -325,7 +325,7 @@ function G(e, t) {
|
|
|
325
325
|
return function(e) {
|
|
326
326
|
for (const [t, n] of L) if (t === e) return n;
|
|
327
327
|
return 0;
|
|
328
|
-
}(String(e)) || (
|
|
328
|
+
}(String(e)) || (Ht(`${t}: trace level NOT FOUND: ${e}`), 0);
|
|
329
329
|
}
|
|
330
330
|
function V(e) {
|
|
331
331
|
if (F) return 4294967295;
|
|
@@ -363,16 +363,16 @@ function J(e, t) {
|
|
|
363
363
|
const n = M(e);
|
|
364
364
|
return !!(n & C.TRACE_MACHINE || n & C.TRACE_TIMER_PERIODIC && "EV_TIMEOUT_PERIODIC" === t || n & C.TRACE_TIMER && "EV_TIMEOUT" === t);
|
|
365
365
|
}
|
|
366
|
-
function
|
|
366
|
+
function H(e, t) {
|
|
367
367
|
let n = {};
|
|
368
|
-
if (!bn(t)) return
|
|
368
|
+
if (!bn(t)) return Ht("sdata_desc MUST be an array"), Xt(t), n;
|
|
369
369
|
for (let r = 0; r < t.length; r++) {
|
|
370
370
|
const o = t[r];
|
|
371
|
-
o.name &&
|
|
371
|
+
o.name && q(e, n, o);
|
|
372
372
|
}
|
|
373
373
|
return n;
|
|
374
374
|
}
|
|
375
|
-
function
|
|
375
|
+
function q(e, t, n) {
|
|
376
376
|
let r, o = n.default_value;
|
|
377
377
|
switch (n.type) {
|
|
378
378
|
case E.DTP_STRING:
|
|
@@ -382,16 +382,16 @@ function H(e, t, n) {
|
|
|
382
382
|
r = Sn(o);
|
|
383
383
|
break;
|
|
384
384
|
case E.DTP_INTEGER:
|
|
385
|
-
r = parseInt(o), isNaN(r) &&
|
|
385
|
+
r = parseInt(o), isNaN(r) && Ht(`${Fe(e)}: attr NaN: ${n.name}`);
|
|
386
386
|
break;
|
|
387
387
|
case E.DTP_REAL:
|
|
388
|
-
r = Number(o), isNaN(r) &&
|
|
388
|
+
r = Number(o), isNaN(r) && Ht(`${Fe(e)}: attr NaN: ${n.name}`);
|
|
389
389
|
break;
|
|
390
390
|
case E.DTP_LIST:
|
|
391
391
|
if (mn(o)) try {
|
|
392
392
|
r = JSON.parse(o);
|
|
393
393
|
} catch (e) {
|
|
394
|
-
|
|
394
|
+
Ht(`JSON parse error: ${e.message}`);
|
|
395
395
|
}
|
|
396
396
|
else r = o;
|
|
397
397
|
bn(r) || (r = []);
|
|
@@ -400,7 +400,7 @@ function H(e, t, n) {
|
|
|
400
400
|
if (mn(o)) try {
|
|
401
401
|
r = JSON.parse(o);
|
|
402
402
|
} catch (e) {
|
|
403
|
-
|
|
403
|
+
Ht(`JSON parse error: ${e.message}`);
|
|
404
404
|
}
|
|
405
405
|
else r = o;
|
|
406
406
|
dn(r) || (r = {});
|
|
@@ -409,13 +409,13 @@ function H(e, t, n) {
|
|
|
409
409
|
if (mn(o)) try {
|
|
410
410
|
r = JSON.parse(o);
|
|
411
411
|
} catch (e) {
|
|
412
|
-
|
|
412
|
+
Ht(`JSON parse error: ${e.message}`);
|
|
413
413
|
}
|
|
414
414
|
else r = o;
|
|
415
415
|
break;
|
|
416
416
|
case E.DTP_POINTER: r = o;
|
|
417
417
|
}
|
|
418
|
-
return void 0 === r && (
|
|
418
|
+
return void 0 === r && (Ht(`default_value WRONG, it: ${n.name}, value: ${n.default_value}`), r = null), t[n.name] = r, 0;
|
|
419
419
|
}
|
|
420
420
|
function z(e, t, n, r) {
|
|
421
421
|
let o;
|
|
@@ -432,64 +432,64 @@ function z(e, t, n, r) {
|
|
|
432
432
|
o = Sn(r);
|
|
433
433
|
break;
|
|
434
434
|
case E.DTP_INTEGER:
|
|
435
|
-
o = parseInt(r), isNaN(o) &&
|
|
435
|
+
o = parseInt(r), isNaN(o) && Ht(`${Fe(e)}: attr NaN: ${n.name}`);
|
|
436
436
|
break;
|
|
437
437
|
case E.DTP_REAL:
|
|
438
|
-
o = Number(r), isNaN(o) &&
|
|
438
|
+
o = Number(r), isNaN(o) && Ht(`${Fe(e)}: attr NaN: ${n.name}`);
|
|
439
439
|
break;
|
|
440
440
|
case E.DTP_LIST:
|
|
441
441
|
if (mn(r)) try {
|
|
442
442
|
o = JSON.parse(r);
|
|
443
443
|
} catch (e) {
|
|
444
|
-
|
|
444
|
+
Ht(`JSON parse error: ${e.message}`);
|
|
445
445
|
}
|
|
446
446
|
else o = r;
|
|
447
|
-
if (!bn(o)) return
|
|
447
|
+
if (!bn(o)) return Ht(`attr must be an array: ${n.name}`), -1;
|
|
448
448
|
break;
|
|
449
449
|
case E.DTP_DICT:
|
|
450
450
|
if (mn(r)) try {
|
|
451
451
|
o = JSON.parse(r);
|
|
452
452
|
} catch (e) {
|
|
453
|
-
|
|
453
|
+
Ht(`JSON parse error: ${e.message}`);
|
|
454
454
|
}
|
|
455
455
|
else o = r;
|
|
456
|
-
if (!dn(o)) return
|
|
456
|
+
if (!dn(o)) return Ht(`attr must be an object: ${n.name}`), -1;
|
|
457
457
|
break;
|
|
458
458
|
case E.DTP_JSON:
|
|
459
459
|
if (mn(r)) try {
|
|
460
460
|
o = JSON.parse(r);
|
|
461
461
|
} catch (e) {
|
|
462
|
-
|
|
462
|
+
Ht(`JSON parse error: ${e.message}`);
|
|
463
463
|
}
|
|
464
464
|
else o = r;
|
|
465
|
-
if (!bn(o) && !dn(o)) return
|
|
465
|
+
if (!bn(o) && !dn(o)) return Ht(`attr must be a json dict/list: ${n.name}`), -1;
|
|
466
466
|
break;
|
|
467
467
|
case E.DTP_POINTER: o = r;
|
|
468
468
|
}
|
|
469
|
-
return void 0 === o &&
|
|
469
|
+
return void 0 === o && Ht(`${Fe(e)}: attr undefined: ${n.name}`), t[n.name] = o, dn(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;
|
|
470
470
|
}
|
|
471
471
|
function Q(e) {
|
|
472
472
|
return e.jn_attrs;
|
|
473
473
|
}
|
|
474
474
|
function X(e, t, n) {
|
|
475
|
-
return rt(e, t) ? Q(e) : e && e.bottom_gobj ? X(e.bottom_gobj, t, n) : (n &&
|
|
475
|
+
return rt(e, t) ? Q(e) : e && e.bottom_gobj ? X(e.bottom_gobj, t, n) : (n && Ht(`GClass Attribute NOT FOUND: ${Fe(e)}, attr ${t}`), null);
|
|
476
476
|
}
|
|
477
477
|
function Z(e, t, n) {
|
|
478
|
-
if (!(e && e instanceof v)) return n &&
|
|
478
|
+
if (!(e && e instanceof v)) return n && Ht("gclass NULL"), null;
|
|
479
479
|
if (!t) return e.attrs_table;
|
|
480
480
|
for (let n = 0; n < e.attrs_table.length; n++) {
|
|
481
481
|
const r = e.attrs_table[n];
|
|
482
482
|
if (r.name && r.name === t) return r;
|
|
483
483
|
}
|
|
484
|
-
return n &&
|
|
484
|
+
return n && Ht(`${e.gclass_name}: GClass Attribute NOT FOUND: ${t}`), null;
|
|
485
485
|
}
|
|
486
486
|
function ee(e, t, n, r, o, s, l, i, _, a, u) {
|
|
487
|
-
if (vn(e)) return
|
|
488
|
-
if (e.includes("`") || e.includes("^") || e.includes(".")) return
|
|
489
|
-
if (ue(e)) return
|
|
487
|
+
if (vn(e)) return Ht("gclass_name EMPTY"), null;
|
|
488
|
+
if (e.includes("`") || e.includes("^") || e.includes(".")) return Ht(`GClass name CANNOT have '.' or '^' or '\`' char: ${e}`), null;
|
|
489
|
+
if (ue(e)) return Ht(`GClass ALREADY exists: ${e}`), null;
|
|
490
490
|
let c = new v(e, r, o, s, l, i, _, a, u);
|
|
491
491
|
(function(e, t) {
|
|
492
|
-
e && e instanceof v ? t ? g[t] ?
|
|
492
|
+
e && e instanceof v ? t ? g[t] ? Ht(`gclass ALREADY REGISTERED: ${t}`) : g[t] = e : Ht("gclass_name undefined") : Ht("gclass undefined");
|
|
493
493
|
})(c, e);
|
|
494
494
|
const f = n.length;
|
|
495
495
|
for (let e = 0; e < f; e++) {
|
|
@@ -505,7 +505,7 @@ function ee(e, t, n, r, o, s, l, i, _, a, u) {
|
|
|
505
505
|
for (let e = 0; e < t.length; e++) {
|
|
506
506
|
let n = t[e][0], r = t[e][1];
|
|
507
507
|
if (!vn(n)) {
|
|
508
|
-
if (_e(c, n)) return
|
|
508
|
+
if (_e(c, n)) return Ht(`SMachine: event repeated in input_events: ${n}`), te(c), null;
|
|
509
509
|
ie(c, n, r);
|
|
510
510
|
}
|
|
511
511
|
}
|
|
@@ -519,11 +519,11 @@ function te(e) {
|
|
|
519
519
|
let t;
|
|
520
520
|
if (mn(e)) t = e;
|
|
521
521
|
else {
|
|
522
|
-
if (!(e instanceof v)) return
|
|
522
|
+
if (!(e instanceof v)) return Ht("Cannot unregister gclass, type unknown"), -1;
|
|
523
523
|
t = e.gclass_name;
|
|
524
524
|
}
|
|
525
525
|
let n = g[t];
|
|
526
|
-
return n ? n.instances > 0 ? (
|
|
526
|
+
return n ? n.instances > 0 ? (Ht(`Cannot unregister gclass, instances in use: ${t}`), -1) : (delete g[t], 0) : (Ht(`Cannot unregister gclass, not found: ${t}`), -1);
|
|
527
527
|
}
|
|
528
528
|
function ne(e, t) {
|
|
529
529
|
const n = e.dl_states.length, r = e.dl_states;
|
|
@@ -542,22 +542,22 @@ function re(e, t) {
|
|
|
542
542
|
return null;
|
|
543
543
|
}
|
|
544
544
|
function oe(e, t) {
|
|
545
|
-
return e instanceof v ? ne(e, t) ? (
|
|
545
|
+
return e instanceof v ? ne(e, t) ? (Ht(`state already exists: ${t}`), -1) : (e.dl_states.push(new A(t)), 0) : (Ht("Cannot add state, typeof not GClass"), -1);
|
|
546
546
|
}
|
|
547
547
|
function se(e, t, n, r, o) {
|
|
548
|
-
if (!(e instanceof v)) return
|
|
549
|
-
if (vn(t)) return
|
|
548
|
+
if (!(e instanceof v)) return Ht("Cannot add state, typeof not GClass"), -1;
|
|
549
|
+
if (vn(t)) return Ht("state_name EMPTY"), -1;
|
|
550
550
|
let s = ne(e, t);
|
|
551
|
-
return s ? re(s, n) ? (
|
|
551
|
+
return s ? re(s, n) ? (Ht(`event already exists: gclass ${e.gclass_name}, state ${t}, event ${n}`), -1) : (s.dl_actions.push(new D(n, r, o)), 0) : (Ht(`state not found: ${t}`), -1);
|
|
552
552
|
}
|
|
553
553
|
function le(e, t, n) {
|
|
554
554
|
vn(t) || e.push(new k(t, n));
|
|
555
555
|
}
|
|
556
556
|
function ie(e, t, n) {
|
|
557
|
-
return e instanceof v ? le(e.dl_events, t, n) : (
|
|
557
|
+
return e instanceof v ? le(e.dl_events, t, n) : (Ht("Cannot add state, typeof not GClass"), -1);
|
|
558
558
|
}
|
|
559
559
|
function _e(e, t) {
|
|
560
|
-
if (!(e instanceof v)) return
|
|
560
|
+
if (!(e instanceof v)) return Ht("Cannot add state, typeof not GClass"), 0;
|
|
561
561
|
const n = e.dl_events.length, r = e.dl_events;
|
|
562
562
|
for (let e = 0; e < n; e++) {
|
|
563
563
|
let n = r[e];
|
|
@@ -566,25 +566,25 @@ function _e(e, t) {
|
|
|
566
566
|
return null;
|
|
567
567
|
}
|
|
568
568
|
function ae(e) {
|
|
569
|
-
if (!(e instanceof v)) return
|
|
569
|
+
if (!(e instanceof v)) return Ht("Cannot add state, typeof not GClass"), -1;
|
|
570
570
|
let t = 0;
|
|
571
|
-
gn(e.dl_states) || (
|
|
571
|
+
gn(e.dl_states) || (Ht(`GClass without states: ${e.gclass_name}`), t += -1);
|
|
572
572
|
for (let n = 0; n < e.dl_states.length; n++) {
|
|
573
573
|
let r = e.dl_states[n];
|
|
574
574
|
if (!vn(r.state_name)) for (let n = 0; n < r.dl_actions.length; n++) {
|
|
575
575
|
let o = r.dl_actions[n];
|
|
576
|
-
vn(o.event_name) || (_e(e, o.event_name) || (
|
|
576
|
+
vn(o.event_name) || (_e(e, o.event_name) || (Ht(`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 && (ne(e, o.next_state) || (Ht(`SMachine: next state NOT in state names: gclass ${e.gclass_name}, state ${r.state_name}, next_state ${o.next_state}`), t += -1)));
|
|
577
577
|
}
|
|
578
578
|
}
|
|
579
579
|
for (let n = 0; n < e.dl_events.length; n++) {
|
|
580
580
|
let r = e.dl_events[n];
|
|
581
|
-
if (!vn(r.event_name) && (En(r.event_flag) || (
|
|
581
|
+
if (!vn(r.event_name) && (En(r.event_flag) || (Ht(`SMachine: event flag is NOT number: gclass ${e.gclass_name}, event ${r.event_name}`), t += -1), !(r.event_flag & R.EVF_OUTPUT_EVENT))) {
|
|
582
582
|
let n = !1;
|
|
583
583
|
for (let t = 0; t < e.dl_states.length; t++) {
|
|
584
584
|
let o = e.dl_states[t];
|
|
585
585
|
vn(o.state_name) || re(o, r.event_name) && (n = !0);
|
|
586
586
|
}
|
|
587
|
-
n || (
|
|
587
|
+
n || (Ht(`SMachine: input_list's event NOT in state: gclass ${e.gclass_name}, event ${r.event_name}`), t += -1);
|
|
588
588
|
}
|
|
589
589
|
}
|
|
590
590
|
return t;
|
|
@@ -594,65 +594,65 @@ function ue(e, t) {
|
|
|
594
594
|
try {
|
|
595
595
|
n = g[e];
|
|
596
596
|
} catch (e) {}
|
|
597
|
-
return n || (t &&
|
|
597
|
+
return n || (t && Ht(`gclass not found: ${e}`), null);
|
|
598
598
|
}
|
|
599
599
|
function ce() {
|
|
600
600
|
return !b || b.obflag & w.obflag_destroyed ? null : b;
|
|
601
601
|
}
|
|
602
602
|
function fe(e, t) {
|
|
603
603
|
e = e.toLowerCase();
|
|
604
|
-
return p[e] || (t &&
|
|
604
|
+
return p[e] || (t && Ht(`gobj service not found: ${e}`), null);
|
|
605
605
|
}
|
|
606
606
|
function ge(e) {
|
|
607
607
|
let t = Pe(e);
|
|
608
|
-
return t = t.toLowerCase(), p[t] &&
|
|
608
|
+
return t = t.toLowerCase(), p[t] && Ht(`service ALREADY REGISTERED: ${t}. Will be UPDATED`), p[t] = e, 0;
|
|
609
609
|
}
|
|
610
610
|
function pe(e, t) {
|
|
611
|
-
t.parent &&
|
|
611
|
+
t.parent && Ht(`_add_child() ALREADY HAS PARENT: ${t.gobj_name}`), e.dl_children.push(t), t.parent = e;
|
|
612
612
|
}
|
|
613
613
|
function de(e, t) {
|
|
614
614
|
let n = ar(e.dl_children, t);
|
|
615
615
|
n >= 0 && (cn(e.dl_children, n), t.parent = null);
|
|
616
616
|
}
|
|
617
617
|
function be(e, t) {
|
|
618
|
-
"__json_config_variables__" !== t &&
|
|
618
|
+
"__json_config_variables__" !== t && Ht(`GClass Attribute NOT FOUND: ${Fe(e)}, attr ${t}`);
|
|
619
619
|
}
|
|
620
620
|
function me(e, t, n) {
|
|
621
621
|
let r = t;
|
|
622
622
|
(function(e, t, n, r, o) {
|
|
623
|
-
if (!e || !t) return
|
|
623
|
+
if (!e || !t) return Ht("hsdata or kw NULL"), -1;
|
|
624
624
|
let s = 0;
|
|
625
625
|
for (const [l, i] of Object.entries(t)) {
|
|
626
626
|
const t = Z(o.gclass, l, !1);
|
|
627
|
-
t ? (-1 === n || t.flag & n) && (t.flag & T.SDF_DEPRECATED &&
|
|
627
|
+
t ? (-1 === n || t.flag & n) && (t.flag & T.SDF_DEPRECATED && qt(`${Fe(o)}: Deprecated attribute used in gobj creation: ${l}`), s += z(o, e, t, i)) : r && (r(o, l), s--);
|
|
628
628
|
}
|
|
629
629
|
return s;
|
|
630
|
-
})(Q(e), r, -1, e.gclass.gclass_flag & O.gcflag_ignore_unknown_attrs ? 0 : be, e) < 0 && (
|
|
630
|
+
})(Q(e), r, -1, e.gclass.gclass_flag & O.gcflag_ignore_unknown_attrs ? 0 : be, e) < 0 && (Ht(`${Fe(e)} json2data() FAILED`), Xt(r));
|
|
631
631
|
}
|
|
632
632
|
function Ee(e, n, r, o, s) {
|
|
633
633
|
if (s & N.gobj_flag_yuno) {
|
|
634
|
-
if (d) return
|
|
634
|
+
if (d) return Ht("__yuno__ already created"), null;
|
|
635
635
|
s |= N.gobj_flag_service;
|
|
636
636
|
} else {
|
|
637
|
-
if (!o) return
|
|
638
|
-
if (!("string" == typeof o || o instanceof S)) return
|
|
639
|
-
if (mn(o) && !(o = fe(o))) return
|
|
637
|
+
if (!o) return Ht("gobj NEEDS a parent!"), null;
|
|
638
|
+
if (!("string" == typeof o || o instanceof S)) return Ht(`BAD TYPE of parent: ${o}`), null;
|
|
639
|
+
if (mn(o) && !(o = fe(o))) return qt(`parent service not found: ${o}`), null;
|
|
640
640
|
}
|
|
641
|
-
if (s & N.gobj_flag_service && fe(e, !1)) return
|
|
641
|
+
if (s & N.gobj_flag_service && fe(e, !1)) return Ht(`service ALREADY registered: ${n}^${e}`), null;
|
|
642
642
|
if (s & N.gobj_flag_default_service) {
|
|
643
|
-
if (b) return
|
|
643
|
+
if (b) return Ht(`default service ALREADY registered: ${n}^${e}`), null;
|
|
644
644
|
s |= N.gobj_flag_service;
|
|
645
645
|
}
|
|
646
|
-
if (vn(n)) return
|
|
646
|
+
if (vn(n)) return Ht("gclass_name must be a string"), null;
|
|
647
647
|
let i = ue(n, !1);
|
|
648
|
-
if (!i) return
|
|
649
|
-
if (!mn(e)) return
|
|
648
|
+
if (!i) return Ht(`GClass not registered: ${n}^${e}`), null;
|
|
649
|
+
if (!mn(e)) return Ht(`gobj_name must be a string: ${n}`), null;
|
|
650
650
|
if (!vn(e)) {
|
|
651
|
-
if (e.includes("`")) return
|
|
652
|
-
if (e.includes("^")) return
|
|
651
|
+
if (e.includes("`")) return Ht(`gobj_name cannot contain char ': ${n}^${e}`), null;
|
|
652
|
+
if (e.includes("^")) return Ht(`gobj_name cannot contain char ^: ${n}^${e}`), null;
|
|
653
653
|
}
|
|
654
654
|
let _ = new S(e, i, r, o, s);
|
|
655
|
-
_.jn_attrs =
|
|
655
|
+
_.jn_attrs = H(_, i.attrs_table);
|
|
656
656
|
for (const [e, t] of Object.entries(_.jn_attrs)) e in _.priv && (_.priv[e] = t);
|
|
657
657
|
let a = K(_);
|
|
658
658
|
return a && $(t("💙💙⏩ creating: %s^%s", i.gclass_name, e)), _.gobj_flag & N.gobj_flag_service && ge(_), _.gobj_flag & N.gobj_flag_yuno && (d = _), _.gobj_flag & N.gobj_flag_default_service && (b = _), _.gobj_flag & N.gobj_flag_yuno || pe(o, _), _.obflag |= w.obflag_created, _.gclass.instances++, me(_, r), _.gobj_flag & N.gobj_flag_service && l && l(_, 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 && $(t("👦👦🔵 child_added(%s): %s", Ge(o), Fe(_))), o.gclass.gmt.mt_child_added(o, _)), a && $(t("💙💙⏪ created: %s", Ge(_))), _;
|
|
@@ -661,8 +661,8 @@ function Te(e, t, n, r) {
|
|
|
661
661
|
return Ee(e, t, n, r, N.gobj_flag_pure_child);
|
|
662
662
|
}
|
|
663
663
|
function he(e) {
|
|
664
|
-
if (Ke(e)) return void
|
|
665
|
-
e.__refs__ > 0 &&
|
|
664
|
+
if (Ke(e)) return void Ht("gobj NULL or DESTROYED");
|
|
665
|
+
e.__refs__ > 0 && Ht(`${Fe(e)}: gobj DESTROYING with references: ${e.__refs__}`), e.playing && (Ht(`Destroying a PLAYING gobj: ${Ge(e)}`), Re(e)), e.running && (Ht(`Destroying a RUNNING gobj: ${Ge(e)}`), Se(e)), e.obflag |= w.obflag_destroying, function(e) {
|
|
666
666
|
if (0 === Tt.length) return;
|
|
667
667
|
for (let t of Tt) t.src === e && (t.src = null);
|
|
668
668
|
Tt = Tt.filter((t) => t.dst !== e);
|
|
@@ -672,7 +672,7 @@ function he(e) {
|
|
|
672
672
|
let r = Ve(e);
|
|
673
673
|
r && r.gclass.gmt.mt_child_removed && (n && $(t("👦👦🔴 child_removed(%s): %s", Ge(r), Fe(e))), r.gclass.gmt.mt_child_removed(r, e)), e.gobj_flag & N.gobj_flag_service && function(e) {
|
|
674
674
|
let t = Pe(e);
|
|
675
|
-
t = t.toLowerCase(), p[t] ? delete p[t] :
|
|
675
|
+
t = t.toLowerCase(), p[t] ? delete p[t] : Ht(`"service NOT found in register": ${t}`);
|
|
676
676
|
}(e), Dt(e, e.dl_subscriptions, !0), Dt(e, e.dl_subscribings, !0), r && (de(r, e), Me(e) && (Ye(r) !== e || Ke(r) || Be(r, null))), function(e) {
|
|
677
677
|
let t = e.dl_children.slice();
|
|
678
678
|
for (let e = 0; e < t.length; e++) {
|
|
@@ -682,9 +682,9 @@ function he(e) {
|
|
|
682
682
|
}(e), e.obflag & w.obflag_created && e.gclass.gmt.mt_destroy && e.gclass.gmt.mt_destroy(e), n && $(t("💔💔⏪ destroyed: %s", Ge(e))), e.obflag |= w.obflag_destroyed, e.obflag & w.obflag_created && e.gclass.instances--;
|
|
683
683
|
}
|
|
684
684
|
function ye(e) {
|
|
685
|
-
if (Ke(e)) return
|
|
686
|
-
if (e.running) return
|
|
687
|
-
if (e.disabled) return
|
|
685
|
+
if (Ke(e)) return Ht("gobj NULL or DESTROYED"), -1;
|
|
686
|
+
if (e.running) return Ht(`${Fe(e)}: GObj ALREADY RUNNING`), -1;
|
|
687
|
+
if (e.disabled) return Ht(`${Fe(e)}: GObj DISABLED`), -1;
|
|
688
688
|
Y(e) && $(t("⏺ ⏺ start: %s", Ge(e))), e.running = !0;
|
|
689
689
|
let n = 0;
|
|
690
690
|
return e.gclass.gmt.mt_start && (n = e.gclass.gmt.mt_start(e)), n;
|
|
@@ -696,9 +696,9 @@ function ve(e, t, n) {
|
|
|
696
696
|
return e.gclass.gclass_flag & O.gcflag_manual_start || De(e) ? 1 : (xe(e) || ye(e), 0);
|
|
697
697
|
}
|
|
698
698
|
function Se(e) {
|
|
699
|
-
if (Ke(e)) return
|
|
700
|
-
if (!e.running) return
|
|
701
|
-
e.playing && (
|
|
699
|
+
if (Ke(e)) return Ht("gobj NULL or DESTROYED"), -1;
|
|
700
|
+
if (!e.running) return Ht(`${Fe(e)}: GObj NOT RUNNING`), -1;
|
|
701
|
+
e.playing && (qt(`${Fe(e)}: GObj stopping without previous pause`), Re(e)), Y(e) && $(t("⏹ ⏹ stop: %s", Ge(e))), e.running = !1;
|
|
702
702
|
let n = 0;
|
|
703
703
|
return e.gclass.gmt.mt_stop && (n = e.gclass.gmt.mt_stop(e)), n;
|
|
704
704
|
}
|
|
@@ -706,22 +706,22 @@ function Oe(e, t, n) {
|
|
|
706
706
|
return xe(e) && Se(e), 0;
|
|
707
707
|
}
|
|
708
708
|
function Ne(e) {
|
|
709
|
-
return Ke(e) ? (
|
|
709
|
+
return Ke(e) ? (Ht("gobj NULL or DESTROYED"), -1) : He(e, x.WALK_FIRST2LAST, Oe, 0, 0);
|
|
710
710
|
}
|
|
711
711
|
function we(e) {
|
|
712
|
-
if (Ke(e)) return
|
|
713
|
-
if (e.playing) return
|
|
714
|
-
if (e.disabled) return
|
|
712
|
+
if (Ke(e)) return Ht(`gobj NULL or DESTROYED: ${Fe(e)}`), -1;
|
|
713
|
+
if (e.playing) return Ht(`${Fe(e)}: GObj ALREADY PLAYING`), -1;
|
|
714
|
+
if (e.disabled) return Ht(`${Fe(e)}: GObj DISABLED`), -1;
|
|
715
715
|
if (!xe(e)) {
|
|
716
|
-
if (e.gclass.gclass_flag & O.gcflag_required_start_to_play) return
|
|
717
|
-
|
|
716
|
+
if (e.gclass.gclass_flag & O.gcflag_required_start_to_play) return Ht(`${Fe(e)}: Cannot play, start not done`), -1;
|
|
717
|
+
qt(`${Fe(e)}: GObj playing without previous start`), ye(e);
|
|
718
718
|
}
|
|
719
719
|
Y(e) && $(t("⏯ ⏯ play: %s", Ge(e))), e.playing = !0;
|
|
720
720
|
let n = 0;
|
|
721
721
|
return e.gclass.gmt.mt_play && (n = e.gclass.gmt.mt_play(e), (n < 0 || !1 === n) && (e.playing = !1)), n;
|
|
722
722
|
}
|
|
723
723
|
function Re(e) {
|
|
724
|
-
return Ke(e) ? (
|
|
724
|
+
return Ke(e) ? (Ht("gobj NULL or DESTROYED"), -1) : e.playing ? (Y(e) && $(t("⏸ ⏸ pause: %s", Ge(e))), e.playing = !1, e.gclass.gmt.mt_pause ? e.gclass.gmt.mt_pause(e) : 0) : (Ht(`${Fe(e)}: GObj NOT PLAYING`), -1);
|
|
725
725
|
}
|
|
726
726
|
function xe(e) {
|
|
727
727
|
return !Ke(e) && e.running;
|
|
@@ -751,50 +751,50 @@ function Le() {
|
|
|
751
751
|
return e ? _t(e, "yuno_id") : "";
|
|
752
752
|
}
|
|
753
753
|
function Pe(e) {
|
|
754
|
-
return jn(e) ? e.gobj_name : (
|
|
754
|
+
return jn(e) ? e.gobj_name : (Ht("gobj bad type"), null);
|
|
755
755
|
}
|
|
756
756
|
function Ue(e) {
|
|
757
|
-
return jn(e) ? e.gclass.gclass_name : (
|
|
757
|
+
return jn(e) ? e.gclass.gclass_name : (Ht("gobj NULL of bad type"), null);
|
|
758
758
|
}
|
|
759
759
|
function Fe(e) {
|
|
760
|
-
return jn(e) ? e.gclass.gclass_name + "^" + Pe(e) : (
|
|
760
|
+
return jn(e) ? e.gclass.gclass_name + "^" + Pe(e) : (Ht("gobj bad type"), null);
|
|
761
761
|
}
|
|
762
762
|
function Ge(e) {
|
|
763
|
-
if (!jn(e)) return
|
|
763
|
+
if (!jn(e)) return Ht("gobj NULL of bad type"), null;
|
|
764
764
|
let t = Fe(e), n = Ve(e);
|
|
765
765
|
for (; n;) t = Fe(n) + "`" + t, n = Ve(n);
|
|
766
766
|
return t;
|
|
767
767
|
}
|
|
768
768
|
function Ve(e) {
|
|
769
|
-
return jn(e) ? e.parent : (
|
|
769
|
+
return jn(e) ? e.parent : (Ht("gobj NULL of bad type"), null);
|
|
770
770
|
}
|
|
771
771
|
function Me(e) {
|
|
772
|
-
return jn(e) ? !!(e.gobj_flag & N.gobj_flag_volatil) : (
|
|
772
|
+
return jn(e) ? !!(e.gobj_flag & N.gobj_flag_volatil) : (Ht("gobj NULL of bad type"), null);
|
|
773
773
|
}
|
|
774
774
|
function We(e) {
|
|
775
|
-
return jn(e) ? !!(e.gobj_flag & N.gobj_flag_pure_child) : (
|
|
775
|
+
return jn(e) ? !!(e.gobj_flag & N.gobj_flag_pure_child) : (Ht("gobj NULL of bad type"), null);
|
|
776
776
|
}
|
|
777
777
|
function Ke(e) {
|
|
778
778
|
return !jn(e) || !!(e.obflag & (w.obflag_destroyed | w.obflag_destroying));
|
|
779
779
|
}
|
|
780
780
|
function Ye(e) {
|
|
781
|
-
return jn(e) ? e.bottom_gobj : (
|
|
781
|
+
return jn(e) ? e.bottom_gobj : (Ht("gobj NULL of bad type"), null);
|
|
782
782
|
}
|
|
783
783
|
function Be(e, t) {
|
|
784
|
-
if (!jn(e)) return
|
|
785
|
-
e.bottom_gobj &&
|
|
784
|
+
if (!jn(e)) return Ht("gobj NULL of bad type"), null;
|
|
785
|
+
e.bottom_gobj && qt(`${Fe(e)}: bottom_gobj already set`), e.bottom_gobj = t;
|
|
786
786
|
}
|
|
787
787
|
function Je(e, t, n) {
|
|
788
|
-
return jn(e) ? t ? Z(e.gclass, t, n) : e.gclass.attrs_table : (
|
|
789
|
-
}
|
|
790
|
-
function qe(e, t, n, r, o) {
|
|
791
|
-
return Ke(e) ? (qt("gobj NULL, destroying, or bad type"), 0) : Qe(e.dl_children, t, n, r, o);
|
|
788
|
+
return jn(e) ? t ? Z(e.gclass, t, n) : e.gclass.attrs_table : (Ht("gobj NULL of bad type"), null);
|
|
792
789
|
}
|
|
793
790
|
function He(e, t, n, r, o) {
|
|
794
|
-
return Ke(e) ? (
|
|
791
|
+
return Ke(e) ? (Ht("gobj NULL, destroying, or bad type"), 0) : Qe(e.dl_children, t, n, r, o);
|
|
792
|
+
}
|
|
793
|
+
function qe(e, t, n, r, o) {
|
|
794
|
+
return Ke(e) ? (Ht("gobj NULL, destroying, or bad type"), 0) : Ze(e.dl_children, t, n, r, o);
|
|
795
795
|
}
|
|
796
796
|
function ze(e) {
|
|
797
|
-
return "number" == typeof e && isFinite(e) ? e : (null == e ||
|
|
797
|
+
return "number" == typeof e && isFinite(e) ? e : (null == e || Ht(`walk callback must return a NUMBER (-1 stop, 0 descend, >0 skip children), got ${typeof e}: taken as 0`), 0);
|
|
798
798
|
}
|
|
799
799
|
function Qe(e, t, n, r, o) {
|
|
800
800
|
let s, l = [...e];
|
|
@@ -832,7 +832,7 @@ function Ze(e, t, n, r, o) {
|
|
|
832
832
|
return 0;
|
|
833
833
|
}
|
|
834
834
|
function et(e, t) {
|
|
835
|
-
if (!jn(e)) return
|
|
835
|
+
if (!jn(e)) return Ht("gobj NULL of bad type"), !1;
|
|
836
836
|
let n = t.__gclass_name__, r = t.__gobj_name__, o = t.__prefix_gobj_name__;
|
|
837
837
|
t.__disabled__;
|
|
838
838
|
let s = t.__state__;
|
|
@@ -848,7 +848,7 @@ function et(e, t) {
|
|
|
848
848
|
return !0;
|
|
849
849
|
}
|
|
850
850
|
function tt(e, t) {
|
|
851
|
-
if (Ke(e)) return
|
|
851
|
+
if (Ke(e)) return Ht("gobj NULL or DESTROYED"), null;
|
|
852
852
|
const n = e.dl_children;
|
|
853
853
|
for (let e = 0; e < n.length; e++) {
|
|
854
854
|
const r = n[e];
|
|
@@ -884,7 +884,7 @@ function ot(e, t, n) {
|
|
|
884
884
|
let n = r[t];
|
|
885
885
|
return e.gclass.gmt.mt_reading ? e.gclass.gmt.mt_reading(e, t, n) : n;
|
|
886
886
|
}
|
|
887
|
-
return
|
|
887
|
+
return Ht(`${Fe(e)}: GClass Attribute NOT FOUND, attr ${t}`), null;
|
|
888
888
|
}
|
|
889
889
|
function st(e, t, n) {
|
|
890
890
|
let r = {}, o = e.gclass.attrs_table;
|
|
@@ -905,21 +905,21 @@ function lt(e, t) {
|
|
|
905
905
|
if (0 === Nn(t, "__service__")) return Ae(e);
|
|
906
906
|
}
|
|
907
907
|
let n = X(e, t, !1);
|
|
908
|
-
return n ? !e.gclass.gmt.mt_reading || e.obflag & w.obflag_destroyed ? on(n, t) : e.gclass.gmt.mt_reading(e, t) : (
|
|
908
|
+
return n ? !e.gclass.gmt.mt_reading || e.obflag & w.obflag_destroyed ? on(n, t) : e.gclass.gmt.mt_reading(e, t) : (Ht(`${Fe(e)}: GClass Attribute NOT FOUND, attr ${t}`), 0);
|
|
909
909
|
}
|
|
910
910
|
function it(e, t) {
|
|
911
911
|
t && Nn(t, "__trace_level__");
|
|
912
912
|
let n = X(e, t, !1);
|
|
913
|
-
return n ? !e.gclass.gmt.mt_reading || e.obflag & w.obflag_destroyed ? on(n, t) : e.gclass.gmt.mt_reading(e, t) : (
|
|
913
|
+
return n ? !e.gclass.gmt.mt_reading || e.obflag & w.obflag_destroyed ? on(n, t) : e.gclass.gmt.mt_reading(e, t) : (Ht(`${Fe(e)}: GClass Attribute NOT FOUND, attr ${t}`), 0);
|
|
914
914
|
}
|
|
915
915
|
function _t(e, t) {
|
|
916
916
|
if (t && 0 === Nn(t, "__state__")) return dt(e);
|
|
917
917
|
let n = X(e, t, !1);
|
|
918
|
-
return n ? !e.gclass.gmt.mt_reading || e.obflag & w.obflag_destroyed ? on(n, t) : e.gclass.gmt.mt_reading(e, t) : (
|
|
918
|
+
return n ? !e.gclass.gmt.mt_reading || e.obflag & w.obflag_destroyed ? on(n, t) : e.gclass.gmt.mt_reading(e, t) : (Ht(`${Fe(e)}: GClass Attribute NOT FOUND, attr ${t}`), 0);
|
|
919
919
|
}
|
|
920
920
|
function at(e, t) {
|
|
921
921
|
let n = X(e, t, !1);
|
|
922
|
-
return n ? !e.gclass.gmt.mt_reading || e.obflag & w.obflag_destroyed ? on(n, t) : e.gclass.gmt.mt_reading(e, t) : (
|
|
922
|
+
return n ? !e.gclass.gmt.mt_reading || e.obflag & w.obflag_destroyed ? on(n, t) : e.gclass.gmt.mt_reading(e, t) : (Ht(`${Fe(e)}: GClass Attribute NOT FOUND, attr ${t}`), 0);
|
|
923
923
|
}
|
|
924
924
|
function ut(e, t, n, r) {
|
|
925
925
|
let o = Q(e), s = 0;
|
|
@@ -931,21 +931,21 @@ function ut(e, t, n, r) {
|
|
|
931
931
|
}
|
|
932
932
|
function ct(e, t, n) {
|
|
933
933
|
let r = X(e, t, !1);
|
|
934
|
-
return r ? (r[t] = Sn(n), dn(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) : (
|
|
934
|
+
return r ? (r[t] = Sn(n), dn(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) : (Ht(`${Fe(e)}: GClass Attribute NOT FOUND, attr ${t}`), -1);
|
|
935
935
|
}
|
|
936
936
|
function ft(e, t, n) {
|
|
937
937
|
let r = X(e, t, !1);
|
|
938
|
-
return r ? (r[t] = parseInt(n), dn(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) : (
|
|
938
|
+
return r ? (r[t] = parseInt(n), dn(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) : (Ht(`${Fe(e)}: GClass Attribute NOT FOUND, attr ${t}`), -1);
|
|
939
939
|
}
|
|
940
940
|
function gt(e, t, n) {
|
|
941
941
|
let r = X(e, t, !1);
|
|
942
|
-
return r ? (r[t] = String(n), dn(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) : (
|
|
942
|
+
return r ? (r[t] = String(n), dn(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) : (Ht(`${Fe(e)}: GClass Attribute NOT FOUND, attr ${t}`), -1);
|
|
943
943
|
}
|
|
944
944
|
function pt(e, n) {
|
|
945
|
-
if (Ke(e)) return
|
|
945
|
+
if (Ke(e)) return Ht("gobj NULL or DESTROYED"), null;
|
|
946
946
|
if (e.current_state.state_name === n) return !1;
|
|
947
947
|
let r = ne(e.gclass, n);
|
|
948
|
-
if (!r) return
|
|
948
|
+
if (!r) return Ht(`${Fe(e)}: state unknown, state ${n}`), !1;
|
|
949
949
|
e.last_state = e.current_state, e.current_state = r;
|
|
950
950
|
let o = B(e, "EV_STATE_CHANGED"), s = !!function(e) {
|
|
951
951
|
return V(e) & C.TRACE_STATES;
|
|
@@ -953,10 +953,10 @@ function pt(e, n) {
|
|
|
953
953
|
return (o || s) && (1 === I || $(t("🔀🔀 mach(%s%s^%s), new st(%s), prev st(%s)", e.running ? "" : "!!", Ue(e), Pe(e), dt(e), e.last_state.state_name))), !0;
|
|
954
954
|
}
|
|
955
955
|
function dt(e) {
|
|
956
|
-
return jn(e) ? e.current_state.state_name : (
|
|
956
|
+
return jn(e) ? e.current_state.state_name : (Ht("hgobj NULL"), "");
|
|
957
957
|
}
|
|
958
958
|
function bt(e, t, n) {
|
|
959
|
-
if (!jn(e)) return
|
|
959
|
+
if (!jn(e)) return Ht("gobj NULL of bad type"), null;
|
|
960
960
|
let r = _e(e.gclass, t);
|
|
961
961
|
if (r) return r;
|
|
962
962
|
if (n) {
|
|
@@ -986,14 +986,14 @@ function yt() {
|
|
|
986
986
|
return Tt.length > 0 && !ht && (ht = !0, setTimeout(yt, 0)), t;
|
|
987
987
|
}
|
|
988
988
|
function jt(e, n, r, o) {
|
|
989
|
-
if (!(e && e instanceof S)) return
|
|
990
|
-
if (e.obflag & (w.obflag_destroyed | w.obflag_destroying)) return
|
|
989
|
+
if (!(e && e instanceof S)) return Ht("gobj dst NULL"), -1;
|
|
990
|
+
if (e.obflag & (w.obflag_destroyed | w.obflag_destroying)) return Ht("gobj dst DESTROYED"), -1;
|
|
991
991
|
let s = e.current_state;
|
|
992
|
-
if (!s) return
|
|
992
|
+
if (!s) return Ht(`${Fe(e)}: current_state NULL`), -1;
|
|
993
993
|
let l = B(e, n) && !J(o, n);
|
|
994
994
|
m++;
|
|
995
995
|
let i = re(s, n);
|
|
996
|
-
if (!i) return e.gclass.gmt.mt_inject_event ? (m--, l && ($(1 === I ? t("🔜 %s %s%s %s", n || "", e.running ? "" : "!!", Fe(e), s.state_name) : t("🔃 mach(%s%s), st: %s, ev: %s, from(%s%s)", e.running ? "" : "!!", Fe(e), s.state_name, n || "", o && !o.running ? "!!" : "", Fe(o))), r && l > 1 && fn(r) && Xt(r)), e.gclass.gmt.mt_inject_event(e, n, r, o)) : (l && $(t("📛 mach(%s%s^%s), st: %s, ev: %s, 📛📛ERROR Event NOT DEFINED in state📛📛, from(%s%s^%s)", e.running ? "" : "!!", Ue(e), Pe(e), s.state_name, n || "", o && !o.running ? "!!" : "", Ue(o), Pe(o))),
|
|
996
|
+
if (!i) return e.gclass.gmt.mt_inject_event ? (m--, l && ($(1 === I ? t("🔜 %s %s%s %s", n || "", e.running ? "" : "!!", Fe(e), s.state_name) : t("🔃 mach(%s%s), st: %s, ev: %s, from(%s%s)", e.running ? "" : "!!", Fe(e), s.state_name, n || "", o && !o.running ? "!!" : "", Fe(o))), r && l > 1 && fn(r) && Xt(r)), e.gclass.gmt.mt_inject_event(e, n, r, o)) : (l && $(t("📛 mach(%s%s^%s), st: %s, ev: %s, 📛📛ERROR Event NOT DEFINED in state📛📛, from(%s%s^%s)", e.running ? "" : "!!", Ue(e), Pe(e), s.state_name, n || "", o && !o.running ? "!!" : "", Ue(o), Pe(o))), Ht(`📛📛 Event NOT DEFINED in state 📛📛: ${Fe(e)}, ${s.state_name}, ${n}`), m--, -1);
|
|
997
997
|
if (l) {
|
|
998
998
|
if (1 === I) $(t("🔄 %s %s%s %s from %s%s", n || "", e.running ? "" : "!!", Fe(e), s.state_name, o && !o.running ? "!!" : "", Fe(o)));
|
|
999
999
|
else {
|
|
@@ -1062,11 +1062,11 @@ function Rt(e, n, r, o) {
|
|
|
1062
1062
|
if (!!(In(e, n, "subs_flag", null, $t.KW_REQUIRED) & vt.__hard_subscription__) && !r) return -1;
|
|
1063
1063
|
d && lt(d, "trace_subscriptions") && ($(t("💜💜👎 unsubscribing event '%s': publisher %s, subscriber'%s'", i || "", Fe(s), Fe(l))), Xt(n)), s.obflag & w.obflag_destroyed || o || s.gclass.gmt.mt_subscription_deleted && s.gclass.gmt.mt_subscription_deleted(s, n);
|
|
1064
1064
|
let _ = wt(s.dl_subscriptions, s, i, n, l);
|
|
1065
|
-
return _ >= 0 ? cn(s.dl_subscriptions, _) : (
|
|
1065
|
+
return _ >= 0 ? cn(s.dl_subscriptions, _) : (Ht(`${Fe(e)}: subscription in publisher not found`), Xt(n)), _ = wt(l.dl_subscribings, s, i, n, l), _ >= 0 ? cn(l.dl_subscribings, _) : (Ht(`${Fe(e)}: subscription in subscriber not found`), Xt(n)), 0;
|
|
1066
1066
|
}
|
|
1067
1067
|
function xt(e, n, r, o) {
|
|
1068
|
-
if (null == r && (r = {}), !e) return
|
|
1069
|
-
if (!o) return
|
|
1068
|
+
if (null == r && (r = {}), !e) return Ht(`publisher NULL: ev ${n}`), 0;
|
|
1069
|
+
if (!o) return Ht(`subscriber NULL: ev ${n}`), 0;
|
|
1070
1070
|
const s = /* @__PURE__ */ new Set([
|
|
1071
1071
|
"__config__",
|
|
1072
1072
|
"__global__",
|
|
@@ -1075,13 +1075,13 @@ function xt(e, n, r, o) {
|
|
|
1075
1075
|
"__service__"
|
|
1076
1076
|
]);
|
|
1077
1077
|
if (Object.keys(r).forEach((t) => {
|
|
1078
|
-
s.has(t) ||
|
|
1078
|
+
s.has(t) || Ht(`${Fe(e)}: key ignored in subscription (key: ${t}, event: ${n})`);
|
|
1079
1079
|
}), vn(n)) n = "";
|
|
1080
|
-
else if (!(Et(e, n, R.EVF_OUTPUT_EVENT) || e.gclass.gclass_flag & O.gcflag_no_check_output_events)) return
|
|
1080
|
+
else if (!(Et(e, n, R.EVF_OUTPUT_EVENT) || e.gclass.gclass_flag & O.gcflag_no_check_output_events)) return Ht(`event NOT in output event list: ${Fe(e)}, ${n}`), 0;
|
|
1081
1081
|
let l = Nt(e.dl_subscriptions, e, n, r, o);
|
|
1082
|
-
gn(l) > 0 && (
|
|
1082
|
+
gn(l) > 0 && (Ht(`${Fe(e)}: ${gn(l)} subscription(s) REPEATED, will be deleted and override`), Xt(l, "subscription REPEATED"), Dt(e, l, !1));
|
|
1083
1083
|
let i = function(e, t, n, r) {
|
|
1084
|
-
let o =
|
|
1084
|
+
let o = H(e, St);
|
|
1085
1085
|
_n(o, "event", t), _n(o, "subscriber", r), _n(o, "publisher", e);
|
|
1086
1086
|
let s = 0;
|
|
1087
1087
|
if (n) {
|
|
@@ -1101,7 +1101,7 @@ function xt(e, n, r, o) {
|
|
|
1101
1101
|
}
|
|
1102
1102
|
return _n(o, "subs_flag", s), o;
|
|
1103
1103
|
}(e, n, r, o);
|
|
1104
|
-
if (!i) return
|
|
1104
|
+
if (!i) return Ht(`${Fe(e)}: _create_subscription() FAILED`), 0;
|
|
1105
1105
|
if (an(e.dl_subscriptions, i), an(o.dl_subscribings, i), d && lt(d, "trace_subscriptions") && ($(t("💜💜👍 subscribing event '%s', publisher '%s', subscriber %s", n || "", Fe(e), Fe(o))), r && Xt(r)), e.gclass.gmt.mt_subscription_added) {
|
|
1106
1106
|
let t = e.gclass.gmt.mt_subscription_added(e, i);
|
|
1107
1107
|
(t < 0 || !1 === t) && (Rt(e, i, !0, !0), i = 0);
|
|
@@ -1120,10 +1120,10 @@ function kt(e, t, n, r) {
|
|
|
1120
1120
|
return Nt(e.dl_subscribings, r, t, n, e);
|
|
1121
1121
|
}
|
|
1122
1122
|
function It(e, n, r) {
|
|
1123
|
-
if (dn(r) || (r = {}), !e || e.obflag & (w.obflag_destroyed | w.obflag_destroying)) return
|
|
1124
|
-
if (vn(n)) return
|
|
1123
|
+
if (dn(r) || (r = {}), !e || e.obflag & (w.obflag_destroyed | w.obflag_destroying)) return Ht("gobj NULL or DESTROYED"), -1;
|
|
1124
|
+
if (vn(n)) return Ht(`${Fe(e)}: event EMPTY`), -1;
|
|
1125
1125
|
let o = bt(e, n, !0);
|
|
1126
|
-
if (!(o && o.event_flag & (R.EVF_SYSTEM_EVENT | R.EVF_OUTPUT_EVENT) || e.gclass.gclass_flag & O.gcflag_no_check_output_events)) return
|
|
1126
|
+
if (!(o && o.event_flag & (R.EVF_SYSTEM_EVENT | R.EVF_OUTPUT_EVENT) || e.gclass.gclass_flag & O.gcflag_no_check_output_events)) return Ht(`event NOT in output event list: ${Fe(e)}, ev ${n}`), -1;
|
|
1127
1127
|
let s = d && lt(d, "trace_subscriptions");
|
|
1128
1128
|
if (s && ($(1 === I ? t("🔝🔝 %s %s%s %s", n || "", e.running ? "" : "!!", Fe(e), e.current_state.state_name) : t("🔝🔝 mach(%s%s^%s), st: %s, ev: %s%s%s", e.running ? "" : "!!", Ue(e), Pe(e), e.current_state.state_name, "", n || "", "")), fn(r) && Xt(r)), e.gclass.gmt.mt_publish_event) {
|
|
1129
1129
|
let t = e.gclass.gmt.mt_publish_event(e, n, r);
|
|
@@ -1156,7 +1156,7 @@ function It(e, n, r) {
|
|
|
1156
1156
|
if (_ += b, i++, Ke(e)) break;
|
|
1157
1157
|
}
|
|
1158
1158
|
}
|
|
1159
|
-
return i || o && o.event_flag & R.EVF_NO_WARN_SUBS ||
|
|
1159
|
+
return i || o && o.event_flag & R.EVF_NO_WARN_SUBS || qt(`${Fe(e)}: Publish event WITHOUT subscribers, ev ${n}`), _;
|
|
1160
1160
|
}
|
|
1161
1161
|
var $t = Object.freeze({
|
|
1162
1162
|
KW_REQUIRED: 1,
|
|
@@ -1226,11 +1226,11 @@ function Jt(e) {
|
|
|
1226
1226
|
} else n = t.map((e) => "object" == typeof e ? JSON.stringify(e) : String(e)).join(" ");
|
|
1227
1227
|
return n;
|
|
1228
1228
|
}
|
|
1229
|
-
function
|
|
1229
|
+
function Ht(e) {
|
|
1230
1230
|
let t = Jt(e), n = _r();
|
|
1231
1231
|
Lt && (Lt === Ct.error ? Wt("error", t) && Lt("%c" + n + " ERROR: " + String(t), "color:red") : (Wt("error", t) && Ct.error("%c" + n + " ERROR: " + String(t), "color:red"), Lt(`${n} ERROR: ${String(t)}`))), Yt("error", t, n);
|
|
1232
1232
|
}
|
|
1233
|
-
function
|
|
1233
|
+
function qt(e) {
|
|
1234
1234
|
let t = Jt(e), n = _r();
|
|
1235
1235
|
Pt && (Pt === Ct.warn ? Wt("warning", t) && Pt("%c" + n + " WARNING: " + String(t), "color:yellow") : (Wt("warning", t) && Ct.warn("%c" + n + " WARNING: " + String(t), "color:yellow"), Pt(`${n} WARNING: ${String(t)}`))), Yt("warning", t, n);
|
|
1236
1236
|
}
|
|
@@ -1372,16 +1372,16 @@ function xn(e, t) {
|
|
|
1372
1372
|
return !(!(t in e) || !e.hasOwnProperty(t));
|
|
1373
1373
|
}
|
|
1374
1374
|
function Dn(e, t, n, r) {
|
|
1375
|
-
if (e && !jn(e) &&
|
|
1376
|
-
if (!mn(n)) return
|
|
1375
|
+
if (e && !jn(e) && Ht("GObj bad instanceof"), !dn(t) && !bn(t)) return Ht(`${Fe(e)}: kw must be list or dict`), 0;
|
|
1376
|
+
if (!mn(n)) return Ht(`${Fe(e)}: path must be a string: ${String(n)}`), 0;
|
|
1377
1377
|
let o = n.split("`");
|
|
1378
1378
|
if (o.length <= 1) return t[n];
|
|
1379
1379
|
let s = o.length;
|
|
1380
|
-
for (let l = 0; l < s; l++) if (void 0 === (t = t[o[l]])) return void (r &&
|
|
1380
|
+
for (let l = 0; l < s; l++) if (void 0 === (t = t[o[l]])) return void (r && Ht(`${Fe(e)}: path not found: ${String(n)}`));
|
|
1381
1381
|
return t;
|
|
1382
1382
|
}
|
|
1383
1383
|
function An(e, t, n) {
|
|
1384
|
-
e && !jn(e) &&
|
|
1384
|
+
e && !jn(e) && Ht("GObj bad instanceof");
|
|
1385
1385
|
let [r, o] = function(e, t) {
|
|
1386
1386
|
let n = e.lastIndexOf(t);
|
|
1387
1387
|
return -1 === n ? [e, ""] : [e.substring(0, n), e.substring(n + 1)];
|
|
@@ -1389,7 +1389,7 @@ function An(e, t, n) {
|
|
|
1389
1389
|
return vn(o) ? sn(t, n) : sn(Dn(e, t, r, !0), o), 0;
|
|
1390
1390
|
}
|
|
1391
1391
|
function kn(e, t, n, r, o) {
|
|
1392
|
-
e && !jn(e) &&
|
|
1392
|
+
e && !jn(e) && Ht("GObj bad instanceof");
|
|
1393
1393
|
let s = Dn(e, t, n, !1);
|
|
1394
1394
|
const l = o && o & $t.KW_REQUIRED, i = o && o & $t.KW_CREATE, _ = o && o & $t.KW_EXTRACT;
|
|
1395
1395
|
if (void 0 === s) {
|
|
@@ -1397,12 +1397,12 @@ function kn(e, t, n, r, o) {
|
|
|
1397
1397
|
let o = Boolean(r);
|
|
1398
1398
|
return Un(e, t, n, o), o;
|
|
1399
1399
|
}
|
|
1400
|
-
return l && (
|
|
1400
|
+
return l && (Ht(`path not found: '${n}'`), Xt(t)), Boolean(r);
|
|
1401
1401
|
}
|
|
1402
1402
|
return _ && An(e, t, n), Boolean(s);
|
|
1403
1403
|
}
|
|
1404
1404
|
function In(e, t, n, r, o) {
|
|
1405
|
-
e && !jn(e) &&
|
|
1405
|
+
e && !jn(e) && Ht("GObj bad instanceof");
|
|
1406
1406
|
let s = Dn(e, t, n, !1);
|
|
1407
1407
|
const l = o && o & $t.KW_REQUIRED, i = o && o & $t.KW_CREATE, _ = o && o & $t.KW_EXTRACT;
|
|
1408
1408
|
if (void 0 === s) {
|
|
@@ -1410,12 +1410,12 @@ function In(e, t, n, r, o) {
|
|
|
1410
1410
|
let o = parseInt(r);
|
|
1411
1411
|
return Un(e, t, n, o), o;
|
|
1412
1412
|
}
|
|
1413
|
-
return l && (
|
|
1413
|
+
return l && (Ht(`path not found: '${n}'`), Xt(t)), parseInt(r);
|
|
1414
1414
|
}
|
|
1415
|
-
return _ && An(e, t, n), En(s) ? parseInt(s) : (l && (
|
|
1415
|
+
return _ && An(e, t, n), En(s) ? parseInt(s) : (l && (Ht(`path value MUST BE a number: ${n}`), Qt(t)), parseInt(r));
|
|
1416
1416
|
}
|
|
1417
1417
|
function $n(e, t, n, r, o) {
|
|
1418
|
-
e && !jn(e) &&
|
|
1418
|
+
e && !jn(e) && Ht("GObj bad instanceof");
|
|
1419
1419
|
let s = Dn(e, t, n, !1);
|
|
1420
1420
|
const l = o && o & $t.KW_REQUIRED, i = o && o & $t.KW_CREATE, _ = o && o & $t.KW_EXTRACT;
|
|
1421
1421
|
if (void 0 === s) {
|
|
@@ -1423,12 +1423,12 @@ function $n(e, t, n, r, o) {
|
|
|
1423
1423
|
let o = String(r);
|
|
1424
1424
|
return Un(e, t, n, o), o;
|
|
1425
1425
|
}
|
|
1426
|
-
return l && (
|
|
1426
|
+
return l && (Ht(`path not found: '${n}'`), Xt(t)), String(r);
|
|
1427
1427
|
}
|
|
1428
|
-
return _ && An(e, t, n), mn(s) ? String(s) : (l && (
|
|
1428
|
+
return _ && An(e, t, n), mn(s) ? String(s) : (l && (Ht(`${Fe(e)}: path value MUST BE a string: ${n}`), Qt(t)), String(r));
|
|
1429
1429
|
}
|
|
1430
1430
|
function Cn(e, t, n, r, o) {
|
|
1431
|
-
e && !jn(e) &&
|
|
1431
|
+
e && !jn(e) && Ht("GObj bad instanceof");
|
|
1432
1432
|
let s = Dn(e, t, n, !1);
|
|
1433
1433
|
const l = o && o & $t.KW_REQUIRED, i = o && o & $t.KW_CREATE, _ = o && o & $t.KW_EXTRACT;
|
|
1434
1434
|
if (void 0 === s) {
|
|
@@ -1436,12 +1436,12 @@ function Cn(e, t, n, r, o) {
|
|
|
1436
1436
|
let o = r;
|
|
1437
1437
|
return Un(e, t, n, o), o;
|
|
1438
1438
|
}
|
|
1439
|
-
return l && (
|
|
1439
|
+
return l && (Ht(`path not found: '${n}'`), Xt(t)), r;
|
|
1440
1440
|
}
|
|
1441
1441
|
return _ && An(e, t, n), s;
|
|
1442
1442
|
}
|
|
1443
1443
|
function Ln(e, t, n, r, o) {
|
|
1444
|
-
e && !jn(e) &&
|
|
1444
|
+
e && !jn(e) && Ht("GObj bad instanceof");
|
|
1445
1445
|
let s = Dn(e, t, n, !1);
|
|
1446
1446
|
const l = o && o & $t.KW_REQUIRED, i = o && o & $t.KW_CREATE, _ = o && o & $t.KW_EXTRACT;
|
|
1447
1447
|
if (void 0 === s) {
|
|
@@ -1449,12 +1449,12 @@ function Ln(e, t, n, r, o) {
|
|
|
1449
1449
|
let o = Object(r);
|
|
1450
1450
|
return Un(e, t, n, o), o;
|
|
1451
1451
|
}
|
|
1452
|
-
return l && (
|
|
1452
|
+
return l && (Ht(`path not found: '${n}'`), Xt(t)), Object(r);
|
|
1453
1453
|
}
|
|
1454
|
-
return _ && An(e, t, n), dn(s) ? Object(s) : (l && (
|
|
1454
|
+
return _ && An(e, t, n), dn(s) ? Object(s) : (l && (Ht(`path value MUST BE a dict: ${n}`), Qt(t)), Object(r));
|
|
1455
1455
|
}
|
|
1456
1456
|
function Pn(e, t, n, r, o) {
|
|
1457
|
-
e && !jn(e) &&
|
|
1457
|
+
e && !jn(e) && Ht("GObj bad instanceof");
|
|
1458
1458
|
let s = Dn(e, t, n, !1);
|
|
1459
1459
|
const l = o && o & $t.KW_REQUIRED, i = o && o & $t.KW_CREATE, _ = o && o & $t.KW_EXTRACT;
|
|
1460
1460
|
if (void 0 === s) {
|
|
@@ -1462,12 +1462,12 @@ function Pn(e, t, n, r, o) {
|
|
|
1462
1462
|
let o = r;
|
|
1463
1463
|
return Un(e, t, n, o), o;
|
|
1464
1464
|
}
|
|
1465
|
-
return l && (
|
|
1465
|
+
return l && (Ht(`path not found: '${n}'`), Xt(t)), r;
|
|
1466
1466
|
}
|
|
1467
1467
|
return _ && An(e, t, n), s;
|
|
1468
1468
|
}
|
|
1469
1469
|
function Un(e, t, n, r) {
|
|
1470
|
-
if (e && !jn(e) &&
|
|
1470
|
+
if (e && !jn(e) && Ht("GObj bad instanceof"), !dn(t)) return Ht("kw is not an object"), -1;
|
|
1471
1471
|
let o = n.split("`");
|
|
1472
1472
|
if (o.length <= 1) return t[n] = r, 0;
|
|
1473
1473
|
let s = o.length;
|
|
@@ -1478,9 +1478,9 @@ function Un(e, t, n, r) {
|
|
|
1478
1478
|
return 0;
|
|
1479
1479
|
}
|
|
1480
1480
|
function Fn(e, t, n, r, o) {
|
|
1481
|
-
if (e && !jn(e) &&
|
|
1481
|
+
if (e && !jn(e) && Ht("GObj bad instanceof"), !dn(t)) return Ht("kw is not an object"), -1;
|
|
1482
1482
|
let s = Ln(e, t, n, {}, !0);
|
|
1483
|
-
return dn(s) ? (s[r] = o, 0) : (
|
|
1483
|
+
return dn(s) ? (s[r] = o, 0) : (Ht("subdict is not an object"), -1);
|
|
1484
1484
|
}
|
|
1485
1485
|
function Gn(e, n, r) {
|
|
1486
1486
|
let o = "", s = !1;
|
|
@@ -1516,17 +1516,17 @@ function Vn(e, t) {
|
|
|
1516
1516
|
return 0 === pn(t) || Gn(e, t, "");
|
|
1517
1517
|
}
|
|
1518
1518
|
function Mn(e, t, n, r) {
|
|
1519
|
-
e && !jn(e) &&
|
|
1519
|
+
e && !jn(e) && Ht("GObj bad instanceof");
|
|
1520
1520
|
let o = {};
|
|
1521
1521
|
if (mn(n) && !vn(n)) {
|
|
1522
1522
|
let s = n;
|
|
1523
|
-
t.hasOwnProperty(s) ? o[s] = t[s] : r &&
|
|
1524
|
-
} else if (dn(n) && fn(n) > 0) for (let s of Object.keys(n)) t.hasOwnProperty(s) ? o[s] = t[s] : r &&
|
|
1523
|
+
t.hasOwnProperty(s) ? o[s] = t[s] : r && Ht(`${Fe(e)}: key not found: ${s}`);
|
|
1524
|
+
} else if (dn(n) && fn(n) > 0) for (let s of Object.keys(n)) t.hasOwnProperty(s) ? o[s] = t[s] : r && Ht(`${Fe(e)}: key not found: ${s}`);
|
|
1525
1525
|
else {
|
|
1526
1526
|
if (!(bn(n) && gn(n) > 0)) return t;
|
|
1527
1527
|
for (let s = 0; s < n.length; s++) {
|
|
1528
1528
|
let l = n[s];
|
|
1529
|
-
t.hasOwnProperty(l) ? o[l] = t[l] : r &&
|
|
1529
|
+
t.hasOwnProperty(l) ? o[l] = t[l] : r && Ht(`${Fe(e)}: key not found: ${l}`);
|
|
1530
1530
|
}
|
|
1531
1531
|
}
|
|
1532
1532
|
return o;
|
|
@@ -1535,13 +1535,13 @@ function Wn(e, t, n, r) {
|
|
|
1535
1535
|
let o = {};
|
|
1536
1536
|
if (tn(o, t), mn(n) && !vn(n)) {
|
|
1537
1537
|
let s = n;
|
|
1538
|
-
Pn(e, t, s, 0, 0) ? sn(o, s) : r &&
|
|
1539
|
-
} else if (dn(n) && fn(n) > 0) for (let s of Object.keys(n)) t.hasOwnProperty(s) ? sn(o, s) : r &&
|
|
1538
|
+
Pn(e, t, s, 0, 0) ? sn(o, s) : r && Ht(`${Fe(e)}: key not found: ${s}`);
|
|
1539
|
+
} else if (dn(n) && fn(n) > 0) for (let s of Object.keys(n)) t.hasOwnProperty(s) ? sn(o, s) : r && Ht(`${Fe(e)}: key not found: ${s}`);
|
|
1540
1540
|
else {
|
|
1541
1541
|
if (!(bn(n) && gn(n) > 0)) return {};
|
|
1542
1542
|
for (let s = 0; s < n.length; s++) {
|
|
1543
1543
|
let l = n[s];
|
|
1544
|
-
t.hasOwnProperty(l) ? sn(o, l) : r &&
|
|
1544
|
+
t.hasOwnProperty(l) ? sn(o, l) : r && Ht(`${Fe(e)}: key not found: ${l}`);
|
|
1545
1545
|
}
|
|
1546
1546
|
}
|
|
1547
1547
|
return o;
|
|
@@ -1556,11 +1556,11 @@ function Kn(e, t, n = !1) {
|
|
|
1556
1556
|
}
|
|
1557
1557
|
function Yn(e, t) {
|
|
1558
1558
|
if ("undefined" == typeof window || !window.localStorage) return 0;
|
|
1559
|
-
if (!e || void 0 === t) return
|
|
1559
|
+
if (!e || void 0 === t) return Ht(`kw_set_local_storage_value(): invalid key or value: key=${e}`), -1;
|
|
1560
1560
|
try {
|
|
1561
1561
|
return window.localStorage.setItem(e, JSON.stringify(t)), 0;
|
|
1562
1562
|
} catch (t) {
|
|
1563
|
-
return
|
|
1563
|
+
return Ht(`kw_set_local_storage_value(): cannot save "${e}" (storage full or blocked?): ${t && t.message ? t.message : t}`), -1;
|
|
1564
1564
|
}
|
|
1565
1565
|
}
|
|
1566
1566
|
function Bn(e) {
|
|
@@ -1582,8 +1582,8 @@ function Jn(e, t) {
|
|
|
1582
1582
|
} else if (mn(e) && e === t) return !0;
|
|
1583
1583
|
return !1;
|
|
1584
1584
|
}
|
|
1585
|
-
function
|
|
1586
|
-
if (e && !jn(e) &&
|
|
1585
|
+
function Hn(e, t, n, r, o) {
|
|
1586
|
+
if (e && !jn(e) && Ht("GObj bad instanceof"), !t) return null;
|
|
1587
1587
|
o || (o = Vn);
|
|
1588
1588
|
let s = [];
|
|
1589
1589
|
if (bn(t)) for (let l = 0; l < t.length; l++) {
|
|
@@ -1596,7 +1596,7 @@ function qn(e, t, n, r, o) {
|
|
|
1596
1596
|
Jn(n, i) && o(_, r) && s.push(_);
|
|
1597
1597
|
}
|
|
1598
1598
|
else {
|
|
1599
|
-
if (!dn(t)) return
|
|
1599
|
+
if (!dn(t)) return Ht("kw_collect() BAD kw parameter"), null;
|
|
1600
1600
|
for (let e of Object.keys(t)) {
|
|
1601
1601
|
let l = t[e];
|
|
1602
1602
|
Jn(n, e) && o(l, r) && s.push(l);
|
|
@@ -1604,13 +1604,13 @@ function qn(e, t, n, r, o) {
|
|
|
1604
1604
|
}
|
|
1605
1605
|
return s;
|
|
1606
1606
|
}
|
|
1607
|
-
function
|
|
1607
|
+
function qn(e, t) {
|
|
1608
1608
|
if (!e) return -1;
|
|
1609
1609
|
for (let n = 0; n < e.length; n++) if (e[n] && e[n].id === t) return n;
|
|
1610
1610
|
return -1;
|
|
1611
1611
|
}
|
|
1612
1612
|
function zn(e, t, n) {
|
|
1613
|
-
if (!e || !t) return
|
|
1613
|
+
if (!e || !t) return Ht("ERROR: str_in_list() list or str empty"), !1;
|
|
1614
1614
|
let r = e.length;
|
|
1615
1615
|
if (n) {
|
|
1616
1616
|
t = t.toLowerCase();
|
|
@@ -1634,21 +1634,21 @@ function Xn(e, t, n) {
|
|
|
1634
1634
|
r || (r = {}, e.__md_iev__ = r), r[t] = n;
|
|
1635
1635
|
}
|
|
1636
1636
|
function Zn(e, t, n, r) {
|
|
1637
|
-
if (!jn(e)) return
|
|
1637
|
+
if (!jn(e)) return Ht("gobj is not a GObj"), null;
|
|
1638
1638
|
if (!t) return;
|
|
1639
1639
|
let o = Qn(t, n);
|
|
1640
1640
|
o || (o = [], Xn(t, n, o));
|
|
1641
1641
|
try {
|
|
1642
1642
|
bn(o) && o.unshift(r);
|
|
1643
1643
|
} catch (e) {
|
|
1644
|
-
|
|
1644
|
+
Ht(e);
|
|
1645
1645
|
}
|
|
1646
1646
|
}
|
|
1647
1647
|
function er(e, t, n, r) {
|
|
1648
|
-
if (!jn(e)) return
|
|
1649
|
-
if (!dn(t)) return
|
|
1648
|
+
if (!jn(e)) return Ht("gobj is not a GObj"), null;
|
|
1649
|
+
if (!dn(t)) return Ht("kw is not a dict"), null;
|
|
1650
1650
|
let o = Qn(t, n);
|
|
1651
|
-
return o ? 0 === o.length ? (r &&
|
|
1651
|
+
return o ? 0 === o.length ? (r && Ht(`stack empty: ${n}`), null) : o[0] : (r && Ht(`stack NOT FOUND: ${n}`), null);
|
|
1652
1652
|
}
|
|
1653
1653
|
function tr(e, t, n) {
|
|
1654
1654
|
return vn(n) ? An(e, t, "__md_iev__`__msg_type__") : Fn(e, t, "__md_iev__", "__msg_type__", n), 0;
|
|
@@ -1776,7 +1776,7 @@ function Er(e, t) {
|
|
|
1776
1776
|
if (mn(t)) {
|
|
1777
1777
|
if (-1 === t.indexOf("^")) {
|
|
1778
1778
|
let n, r, o = e.fkey;
|
|
1779
|
-
if (1 !== fn(o)) return
|
|
1779
|
+
if (1 !== fn(o)) return Ht("bad fkey 1"), Ht(e), Ht(t), null;
|
|
1780
1780
|
for (const e of Object.keys(o)) {
|
|
1781
1781
|
n = e, r = o[e];
|
|
1782
1782
|
break;
|
|
@@ -1789,7 +1789,7 @@ function Er(e, t) {
|
|
|
1789
1789
|
}
|
|
1790
1790
|
{
|
|
1791
1791
|
let n = t.split("^");
|
|
1792
|
-
return 3 !== n.length ? (
|
|
1792
|
+
return 3 !== n.length ? (Ht("bad fkey 2"), Ht(e), Ht(t), null) : {
|
|
1793
1793
|
topic_name: n[0],
|
|
1794
1794
|
id: n[1],
|
|
1795
1795
|
hook_name: n[2]
|
|
@@ -1800,7 +1800,7 @@ function Er(e, t) {
|
|
|
1800
1800
|
topic_name: t.topic_name,
|
|
1801
1801
|
id: t.id,
|
|
1802
1802
|
hook_name: t.hook_name
|
|
1803
|
-
} : (
|
|
1803
|
+
} : (Ht("bad fkey 3"), Ht(e), Ht(t), null);
|
|
1804
1804
|
}
|
|
1805
1805
|
var Tr = [
|
|
1806
1806
|
"string",
|
|
@@ -1866,7 +1866,8 @@ function jr(e) {
|
|
|
1866
1866
|
default_value: e.default,
|
|
1867
1867
|
placeholder: e.placeholder,
|
|
1868
1868
|
fillspace: e.fillspace || 4,
|
|
1869
|
-
fkey: e.fkey || null
|
|
1869
|
+
fkey: e.fkey || null,
|
|
1870
|
+
is_file: !1
|
|
1870
1871
|
};
|
|
1871
1872
|
if (!e.flag) return t;
|
|
1872
1873
|
for (let n = 0; n < e.flag.length; n++) {
|
|
@@ -1879,7 +1880,10 @@ function jr(e) {
|
|
|
1879
1880
|
case "template":
|
|
1880
1881
|
t.enum_list = e.template;
|
|
1881
1882
|
break;
|
|
1882
|
-
case "table":
|
|
1883
|
+
case "table":
|
|
1884
|
+
t.enum_list = e.table;
|
|
1885
|
+
break;
|
|
1886
|
+
case "file": t.is_file = !0;
|
|
1883
1887
|
}
|
|
1884
1888
|
t.type = r;
|
|
1885
1889
|
} else if (zn(hr, r)) switch (r) {
|
|
@@ -1893,7 +1897,7 @@ function jr(e) {
|
|
|
1893
1897
|
case "hidden": t.is_hidden = !0;
|
|
1894
1898
|
}
|
|
1895
1899
|
}
|
|
1896
|
-
return t;
|
|
1900
|
+
return t.is_file && (t.type = "file"), t;
|
|
1897
1901
|
}
|
|
1898
1902
|
var vr = [
|
|
1899
1903
|
j(E.DTP_POINTER, "subscriber", 0, null, "Subscriber of output events"),
|
|
@@ -1937,13 +1941,13 @@ var wr = {
|
|
|
1937
1941
|
mt_destroy: function(e) {}
|
|
1938
1942
|
};
|
|
1939
1943
|
function Rr(e, t) {
|
|
1940
|
-
return e instanceof S ? "C_TIMER" !== Ue(e) ? (
|
|
1944
|
+
return e instanceof S ? "C_TIMER" !== Ue(e) ? (Ht("not C_TIMER GObj"), -1) : (ct(e, "periodic", !1), void ft(e, "msec", t)) : (Ht("not GObj TYPE"), -1);
|
|
1941
1945
|
}
|
|
1942
1946
|
function xr(e, t) {
|
|
1943
|
-
return e instanceof S ? "C_TIMER" !== Ue(e) ? (
|
|
1947
|
+
return e instanceof S ? "C_TIMER" !== Ue(e) ? (Ht("not C_TIMER GObj"), -1) : (ct(e, "periodic", !0), void ft(e, "msec", t)) : (Ht("not GObj TYPE"), -1);
|
|
1944
1948
|
}
|
|
1945
1949
|
function Dr(e) {
|
|
1946
|
-
return e instanceof S ? "C_TIMER" !== Ue(e) ? (
|
|
1950
|
+
return e instanceof S ? "C_TIMER" !== Ue(e) ? (Ht("not C_TIMER GObj"), -1) : void ft(e, "msec", -1) : (Ht("not GObj TYPE"), -1);
|
|
1947
1951
|
}
|
|
1948
1952
|
var Ar = [
|
|
1949
1953
|
j(E.DTP_BOOLEAN, "changesLost", 0, !1, "Set true to warn about leaving page"),
|
|
@@ -2025,14 +2029,14 @@ var Lr = "ievent_gate_stack", Pr = [
|
|
|
2025
2029
|
retry_ms: 0
|
|
2026
2030
|
}, Fr = null;
|
|
2027
2031
|
function Gr(e) {
|
|
2028
|
-
e.priv.websocket &&
|
|
2032
|
+
e.priv.websocket && Ht("Websocket ALREADY setup");
|
|
2029
2033
|
const t = _t(e, "url");
|
|
2030
2034
|
let n;
|
|
2031
2035
|
zt(`====> Starting WebSocket to '${t}' (${Fe(e)})`);
|
|
2032
2036
|
try {
|
|
2033
2037
|
n = new WebSocket(t);
|
|
2034
2038
|
} catch (n) {
|
|
2035
|
-
return
|
|
2039
|
+
return Ht(`${Fe(e)}: Cannot open WebSocket to '${t}', Error: ${n.message}`), null;
|
|
2036
2040
|
}
|
|
2037
2041
|
return n ? (n.onopen = () => {
|
|
2038
2042
|
jt(e, "EV_ON_OPEN", { url: t }, e);
|
|
@@ -2042,11 +2046,11 @@ function Gr(e) {
|
|
|
2042
2046
|
data: n.data
|
|
2043
2047
|
}, e);
|
|
2044
2048
|
}, n.onclose = (n) => {
|
|
2045
|
-
Ke(e) || (lt(Ie(), "browser_beforeunload") ?
|
|
2049
|
+
Ke(e) || (lt(Ie(), "browser_beforeunload") ? qt("Close websocket by unload page") : jt(e, "EV_ON_CLOSE", {
|
|
2046
2050
|
url: t,
|
|
2047
2051
|
e: n
|
|
2048
2052
|
}, e));
|
|
2049
|
-
}, n) : (
|
|
2053
|
+
}, n) : (Ht(`${Fe(e)}: Failed to initialize WebSocket.`), null);
|
|
2050
2054
|
}
|
|
2051
2055
|
function Vr(e, t = 1e3, n = "") {
|
|
2052
2056
|
let r = e.priv, o = r.websocket;
|
|
@@ -2055,9 +2059,9 @@ function Vr(e, t = 1e3, n = "") {
|
|
|
2055
2059
|
try {
|
|
2056
2060
|
o.close(t, n);
|
|
2057
2061
|
} catch (e) {
|
|
2058
|
-
|
|
2062
|
+
Ht("Error closing WebSocket:", e.message);
|
|
2059
2063
|
}
|
|
2060
|
-
} else
|
|
2064
|
+
} else qt("WebSocket is already closed or in the process of closing.");
|
|
2061
2065
|
}
|
|
2062
2066
|
function Mr(e, t, n) {
|
|
2063
2067
|
let r = _r();
|
|
@@ -2079,15 +2083,15 @@ function Kr(e, t, n, r) {
|
|
|
2079
2083
|
let n = _t(e, "url"), o = Pe(Ie()) + " ==> " + n, s = ot(Ie(), "trace_ievent_callback");
|
|
2080
2084
|
s ? s(o, t, 1, r.length) : Mr(0, o, t);
|
|
2081
2085
|
}
|
|
2082
|
-
if (!n.websocket || n.websocket.readyState !== WebSocket.OPEN) return
|
|
2086
|
+
if (!n.websocket || n.websocket.readyState !== WebSocket.OPEN) return qt(`${Fe(e)}: send_iev(): websocket not open, message lost`), -1;
|
|
2083
2087
|
try {
|
|
2084
2088
|
n.websocket.send(r);
|
|
2085
2089
|
} catch (t) {
|
|
2086
|
-
|
|
2090
|
+
Ht(`${Fe(e)}: send_iev(): ${t}`);
|
|
2087
2091
|
}
|
|
2088
2092
|
return 0;
|
|
2089
2093
|
}(e, function(e, t) {
|
|
2090
|
-
return vn(e) ? (
|
|
2094
|
+
return vn(e) ? (Ht("iev_create() event NULL"), null) : new Wr(e, t);
|
|
2091
2095
|
}(t, n));
|
|
2092
2096
|
}
|
|
2093
2097
|
function Yr(e, t, n) {
|
|
@@ -2132,21 +2136,21 @@ function Jr(e, t) {
|
|
|
2132
2136
|
o && (n.__config__ = o), r && (n.__global__ = r), s && (n.__filter__ = s);
|
|
2133
2137
|
return Zn(e, n, Lr, Yr(e, Pe(i), l)), tr(e, n, "__subscribing__"), Kr(e, t.event, n);
|
|
2134
2138
|
}
|
|
2135
|
-
function
|
|
2139
|
+
function Hr(e, t, n, r) {
|
|
2136
2140
|
let o = e.priv;
|
|
2137
2141
|
return xe(e) && (o.websocket = Gr(e)), 0;
|
|
2138
2142
|
}
|
|
2139
|
-
function
|
|
2143
|
+
function qr(e, t, n, r) {
|
|
2140
2144
|
return zt("Websocket opened: " + e.priv.url), Br(e), 0;
|
|
2141
2145
|
}
|
|
2142
2146
|
function zr(e, t, n, r) {
|
|
2143
2147
|
let o = e.priv, s = n.e, l = n.url;
|
|
2144
|
-
return Bt(),
|
|
2148
|
+
return Bt(), qt(`${Fe(e)}: WebSocket closed ${l} (Code: ${s.code}, Reason: "${s.reason}", Clean: ${s.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, It(e, "EV_ON_CLOSE", {
|
|
2145
2149
|
url: l,
|
|
2146
2150
|
remote_yuno_name: o.remote_yuno_name,
|
|
2147
2151
|
remote_yuno_role: o.remote_yuno_role,
|
|
2148
2152
|
remote_yuno_service: o.remote_yuno_service
|
|
2149
|
-
})) : (
|
|
2153
|
+
})) : (qt(`${Fe(e)}: EV_ON_OPEN_ERROR cannot open ${l} (Code: ${s.code}, Reason: "${s.reason}", Clean: ${s.wasClean})`), It(e, "EV_ON_OPEN_ERROR", {
|
|
2150
2154
|
url: l,
|
|
2151
2155
|
remote_yuno_name: o.remote_yuno_name,
|
|
2152
2156
|
remote_yuno_role: o.remote_yuno_role,
|
|
@@ -2208,17 +2212,17 @@ function Zr(e, t, n, r) {
|
|
|
2208
2212
|
try {
|
|
2209
2213
|
n = JSON.parse(t);
|
|
2210
2214
|
} catch (e) {
|
|
2211
|
-
return
|
|
2215
|
+
return Ht("parsing inter_event json: " + e), null;
|
|
2212
2216
|
}
|
|
2213
|
-
if (!(n instanceof Object)) return
|
|
2217
|
+
if (!(n instanceof Object)) return Ht("parsing inter_event: websocket data not a json object"), null;
|
|
2214
2218
|
let r = n.event;
|
|
2215
|
-
if (!r) return
|
|
2216
|
-
if ("string" != typeof r) return
|
|
2219
|
+
if (!r) return Ht("parsing inter_event: no event"), null;
|
|
2220
|
+
if ("string" != typeof r) return Ht("parsing inter_event: event not a string"), null;
|
|
2217
2221
|
let o = n.kw;
|
|
2218
2222
|
return o ? o instanceof Object ? {
|
|
2219
2223
|
event: r,
|
|
2220
2224
|
kw: o || {}
|
|
2221
|
-
} : (
|
|
2225
|
+
} : (Ht("parsing inter_event: kw not a json object"), null) : (Ht("parsing inter_kw: no kw"), null);
|
|
2222
2226
|
}(0, n.data);
|
|
2223
2227
|
if (lt(Ie(), "trace_inter_event")) {
|
|
2224
2228
|
let e = Pe(Ie()) + " <== " + o, t = n.data.length, r = ot(Ie(), "trace_ievent_callback");
|
|
@@ -2228,19 +2232,19 @@ function Zr(e, t, n, r) {
|
|
|
2228
2232
|
if ("ST_SESSION" !== dt(e)) {
|
|
2229
2233
|
if (mt(e, l, R.EVF_PUBLIC_EVENT)) {
|
|
2230
2234
|
if (!(jt(e, l, i, e) < 0)) return 0;
|
|
2231
|
-
} else
|
|
2235
|
+
} else Ht(`${Fe(e)}: event UNKNOWN in not-session state ${l}`);
|
|
2232
2236
|
return Vr(e), -1;
|
|
2233
2237
|
}
|
|
2234
2238
|
s = null;
|
|
2235
2239
|
let _ = nr(e, i), a = er(e, i, Lr), u = $n(e, a, "dst_role", "");
|
|
2236
|
-
if (u.toLowerCase() !== Ce().toLowerCase()) return
|
|
2240
|
+
if (u.toLowerCase() !== Ce().toLowerCase()) return Ht(`"It's not my role, dst_role: ${u}, my_role: ${Ce()}`), 0;
|
|
2237
2241
|
let c = $n(e, a, "dst_service", "");
|
|
2238
2242
|
if ("__subscribing__" === _) return -1;
|
|
2239
2243
|
if ("__unsubscribing__" === _) return -1;
|
|
2240
2244
|
if (mt(e, l, R.EVF_PUBLIC_EVENT)) return jt(e, l, i, e), 0;
|
|
2241
2245
|
if (!vn(c)) {
|
|
2242
2246
|
let t = fe(c, !1);
|
|
2243
|
-
return t ? mt(t, l, R.EVF_PUBLIC_EVENT) ? (jt(t, l, i, e), 0) : (
|
|
2247
|
+
return t ? mt(t, l, R.EVF_PUBLIC_EVENT) ? (jt(t, l, i, e), 0) : (Ht(`${Fe(e)}: Service found but no event or not public, service '${Fe(t)}', ev '${l}'`), -1) : (qt(`${Fe(e)}: event for a service that is gone, DROPPED: service '${c}', ev '${l}'`), 0);
|
|
2244
2248
|
}
|
|
2245
2249
|
return We(e) ? jt(Ve(e), l, i, e) : It(e, l, i), 0;
|
|
2246
2250
|
}
|
|
@@ -2282,7 +2286,7 @@ var no = {
|
|
|
2282
2286
|
},
|
|
2283
2287
|
mt_destroy: function(e) {},
|
|
2284
2288
|
mt_stats: function(e, t, n, r) {
|
|
2285
|
-
if ("ST_SESSION" !== dt(e)) return
|
|
2289
|
+
if ("ST_SESSION" !== dt(e)) return Ht("Not in session"), null;
|
|
2286
2290
|
n || (n = {});
|
|
2287
2291
|
let o = Yr(e, Pe(r), $n(e, n, "service", null, 0)), s = Pn(e, n, "__md_stats__", null, $t.KW_EXTRACT);
|
|
2288
2292
|
return s || (s = {}), Zn(e, n, "stats_stack", {
|
|
@@ -2291,7 +2295,7 @@ var no = {
|
|
|
2291
2295
|
}), Zn(e, n, Lr, o), n.__stats__ = t, tr(e, n, "__stats__"), Kr(e, "EV_MT_STATS", n, r), null;
|
|
2292
2296
|
},
|
|
2293
2297
|
mt_command_parser: function(e, t, n, r) {
|
|
2294
|
-
if ("ST_SESSION" !== dt(e)) return
|
|
2298
|
+
if ("ST_SESSION" !== dt(e)) return Ht("Not in session"), null;
|
|
2295
2299
|
n || (n = {});
|
|
2296
2300
|
let o = Yr(e, Pe(r), $n(e, n, "service", "", 0)), s = Pn(e, n, "__md_command__", null, $t.KW_EXTRACT);
|
|
2297
2301
|
return s || (s = {}), Zn(e, n, "command_stack", {
|
|
@@ -2335,7 +2339,7 @@ exports.GObj = S, exports.SDATA = j, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
2335
2339
|
return e.replace(/[?# ^:]/g, "_");
|
|
2336
2340
|
}, exports.clear_timeout = Dr, exports.cmp_two_simple_json = wn, exports.command_parser = function(e, t, n, r) {}, exports.createElement2 = function e(t, n) {
|
|
2337
2341
|
let [r, o, s, l] = t;
|
|
2338
|
-
if (!r) return void
|
|
2342
|
+
if (!r) return void Ht("Tag must be a valid HTML element.");
|
|
2339
2343
|
let i = document.createElement(r), _ = "";
|
|
2340
2344
|
if (o && "object" == typeof o) for (let e of Object.keys(o)) if ("style" === e && "object" == typeof o[e]) {
|
|
2341
2345
|
let t = "";
|
|
@@ -2348,7 +2352,7 @@ exports.GObj = S, exports.SDATA = j, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
2348
2352
|
else if (bn(s)) {
|
|
2349
2353
|
if (s.length > 0) if (mn(s[0])) i.appendChild(e(s, n));
|
|
2350
2354
|
else for (let t of s) Array.isArray(t) && t.length > 0 ? i.appendChild(e(t, n)) : t instanceof HTMLElement && i.appendChild(t);
|
|
2351
|
-
} else s instanceof HTMLElement || s instanceof Text || s instanceof SVGElement ? i.appendChild(s) : null != s && (
|
|
2355
|
+
} else s instanceof HTMLElement || s instanceof Text || s instanceof SVGElement ? i.appendChild(s) : null != s && (Ht("content ignored"), Xt(s));
|
|
2352
2356
|
if (l && "object" == typeof l) for (const e of Object.keys(l)) i.addEventListener(e, l[e]);
|
|
2353
2357
|
return i;
|
|
2354
2358
|
}, exports.createOneHtml = ir, exports.create_json_record = function(e, t) {
|
|
@@ -2486,9 +2490,9 @@ exports.GObj = S, exports.SDATA = j, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
2486
2490
|
}, exports.get_function_name = cr, exports.get_now = function() {
|
|
2487
2491
|
return Math.floor(Date.now() / 1e3);
|
|
2488
2492
|
}, exports.gobj_bottom_gobj = Ye, exports.gobj_change_parent = function(e, n) {
|
|
2489
|
-
return Ke(e) ? (
|
|
2493
|
+
return Ke(e) ? (Ht("gobj NULL or DESTROYED"), null) : n instanceof S ? (e.parent && e.parent.mt_child_removed && e.parent.mt_child_removed(e.parent, e), e.parent && (de(e.parent, e), e.parent = null), pe(n, e), n.mt_child_added && (K(e) && zt(t("👦👦🔵 child_added(%s): %s", Ge(n), Fe(e))), n.mt_child_added(n, e)), 0) : (Ht(`${Fe(e)}: gobj_change_parent() BAD TYPE of parent`), -1);
|
|
2490
2494
|
}, exports.gobj_change_state = pt, exports.gobj_command = function(e, n, o, s) {
|
|
2491
|
-
if (Ke(e)) return
|
|
2495
|
+
if (Ke(e)) return Ht("gobj NULL or DESTROYED"), -1;
|
|
2492
2496
|
let l = d && it(d, "tracing");
|
|
2493
2497
|
return l && ($(t("🌀🌀 mach(%s%s), cmd: %s, src: %s", xe(e) ? "" : "!!", Fe(e), n, Fe(s))), l > 1 && Xt(o)), e.gclass.gmt.mt_command_parser ? e.gclass.gmt.mt_command_parser(e, n, o, s) : e.gclass.command_table ? u ? u(e, n, o, s) : r(0, -1, t("%s: global command parser not available", Fe(e)), 0, 0) : r(0, -1, t("%s: command table not available", Fe(e)), 0, 0);
|
|
2494
2498
|
}, exports.gobj_create = function(e, t, n, r) {
|
|
@@ -2527,9 +2531,9 @@ exports.GObj = S, exports.SDATA = j, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
2527
2531
|
total_subscribings: gn(n)
|
|
2528
2532
|
};
|
|
2529
2533
|
}, exports.gobj_load_persistent_attrs = function(e, t) {
|
|
2530
|
-
return Ae(e) ? l ? l(e, t) : -1 : (
|
|
2534
|
+
return Ae(e) ? l ? l(e, t) : -1 : (Ht(`${Fe(e)}: Only gobj services can load/save writable-persistent`), -1);
|
|
2531
2535
|
}, exports.gobj_match_children = function(e, t) {
|
|
2532
|
-
if (Ke(e)) return
|
|
2536
|
+
if (Ke(e)) return Ht("gobj NULL or DESTROYED"), null;
|
|
2533
2537
|
t = t || {};
|
|
2534
2538
|
let n = [];
|
|
2535
2539
|
const r = e.dl_children;
|
|
@@ -2549,16 +2553,16 @@ exports.GObj = S, exports.SDATA = j, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
2549
2553
|
}
|
|
2550
2554
|
}(n, e), n;
|
|
2551
2555
|
}, exports.gobj_match_gobj = et, exports.gobj_name = Pe, exports.gobj_parent = Ve, exports.gobj_pause = Re, exports.gobj_play = we, exports.gobj_post_event = function(e, n, r, o) {
|
|
2552
|
-
return e && e instanceof S ? e.obflag & (w.obflag_destroyed | w.obflag_destroying) ? (
|
|
2556
|
+
return e && e instanceof S ? e.obflag & (w.obflag_destroyed | w.obflag_destroying) ? (Ht(`gobj_post_event(): gobj dst DESTROYING, event ${n}`), -1) : vn(n) ? (Ht("gobj_post_event(): event EMPTY"), -1) : mt(e, n, 0) ? Tt.length >= 1e4 ? (Ht(`gobj_post_event(): too many posted events, this is NOT a work queue, event ${n}, pending ${Tt.length}`), -1) : (Tt.push({
|
|
2553
2557
|
dst: e,
|
|
2554
2558
|
event: n,
|
|
2555
2559
|
kw: r,
|
|
2556
2560
|
src: o
|
|
2557
|
-
}), B(e, n) && !J(o, n) && $(t("📬 posted(%s%s), ev: %s, pending: %d", e.running ? "" : "!!", Fe(e), n, Tt.length)), ht || (ht = !0, setTimeout(yt, 0)), 0) : (
|
|
2561
|
+
}), B(e, n) && !J(o, n) && $(t("📬 posted(%s%s), ev: %s, pending: %d", e.running ? "" : "!!", Fe(e), n, Tt.length)), ht || (ht = !0, setTimeout(yt, 0)), 0) : (Ht(`gobj_post_event(): event NOT DEFINED in gclass ${Ue(e)}, event ${n}`), -1) : (Ht(`gobj_post_event(): gobj dst NULL, event ${n}`), -1);
|
|
2558
2562
|
}, exports.gobj_posted_events_size = function() {
|
|
2559
2563
|
return Tt.length;
|
|
2560
2564
|
}, exports.gobj_publish_event = It, exports.gobj_read_attr = ot, exports.gobj_read_attrs = st, exports.gobj_read_bool_attr = lt, exports.gobj_read_integer_attr = it, exports.gobj_read_pointer_attr = at, exports.gobj_read_str_attr = _t, exports.gobj_remove_persistent_attrs = function(e, t) {
|
|
2561
|
-
return Ae(e) ? _ ? _(e, t) : -1 : (
|
|
2565
|
+
return Ae(e) ? _ ? _(e, t) : -1 : (Ht(`${Fe(e)}: Only gobj services can load/save writable-persistent`), -1);
|
|
2562
2566
|
}, exports.gobj_repr_global_trace_levels = function() {
|
|
2563
2567
|
return L.map(([e, t, n]) => ({
|
|
2564
2568
|
name: e,
|
|
@@ -2568,19 +2572,19 @@ exports.GObj = S, exports.SDATA = j, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
2568
2572
|
}));
|
|
2569
2573
|
}, exports.gobj_reset_volatil_attrs = function(e) {
|
|
2570
2574
|
return function(e, t, n) {
|
|
2571
|
-
if (Ke(e)) return
|
|
2575
|
+
if (Ke(e)) return Ht("gobj NULL or DESTROYED"), -1;
|
|
2572
2576
|
let r = e.gclass.attrs_table;
|
|
2573
2577
|
for (let o = 0; o < r.length; o++) {
|
|
2574
2578
|
const s = r[o];
|
|
2575
2579
|
if (s.name && !(n && s.flag & n) && (-1 === t || s.flag & t)) {
|
|
2576
|
-
const t =
|
|
2580
|
+
const t = q(e, e.jn_attrs, s);
|
|
2577
2581
|
dn(e.priv) && e.priv.hasOwnProperty(s.name) && (e.priv[s.name] = t), e.gclass.gmt.mt_writing && e.gclass.gmt.mt_writing(e, s.name);
|
|
2578
2582
|
}
|
|
2579
2583
|
}
|
|
2580
2584
|
return 0;
|
|
2581
2585
|
}(e, T.SDF_VOLATIL, 0);
|
|
2582
2586
|
}, exports.gobj_save_persistent_attrs = function(e, t) {
|
|
2583
|
-
return Ae(e) ? i ? i(e, t) : -1 : (
|
|
2587
|
+
return Ae(e) ? i ? i(e, t) : -1 : (Ht(`${Fe(e)}: Only gobj services can load/save writable-persistent`), -1);
|
|
2584
2588
|
}, exports.gobj_search_path = nt, exports.gobj_send_event = jt, exports.gobj_services = function() {
|
|
2585
2589
|
let e = [];
|
|
2586
2590
|
for (const t of Object.keys(p)) un(e, t);
|
|
@@ -2589,12 +2593,12 @@ exports.GObj = S, exports.SDATA = j, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
2589
2593
|
return F = Number(e) || 0, 0;
|
|
2590
2594
|
}, exports.gobj_set_gclass_no_trace = function(e, t, n) {
|
|
2591
2595
|
const r = mn(e) ? ue(e) : e;
|
|
2592
|
-
if (!r) return
|
|
2596
|
+
if (!r) return Ht(`gobj_set_gclass_no_trace: gclass NOT FOUND: ${e}`), -1;
|
|
2593
2597
|
const o = G(t, "gobj_set_gclass_no_trace");
|
|
2594
2598
|
return o ? (n ? r.no_trace_level |= o : r.no_trace_level &= ~o, 0) : -1;
|
|
2595
2599
|
}, exports.gobj_set_gclass_trace = function(e, t, n) {
|
|
2596
2600
|
const r = mn(e) ? ue(e) : e;
|
|
2597
|
-
if (!r) return
|
|
2601
|
+
if (!r) return Ht(`gobj_set_gclass_trace: gclass NOT FOUND: ${e}`), -1;
|
|
2598
2602
|
const o = G(t, "gobj_set_gclass_trace");
|
|
2599
2603
|
return o ? (n ? r.trace_level |= o : r.trace_level &= ~o, 0) : -1;
|
|
2600
2604
|
}, exports.gobj_set_global_no_trace = function(e, t) {
|
|
@@ -2604,19 +2608,19 @@ exports.GObj = S, exports.SDATA = j, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
2604
2608
|
const n = G(e, "gobj_set_global_trace");
|
|
2605
2609
|
return n ? (t ? P |= n : P &= ~n, 0) : -1;
|
|
2606
2610
|
}, exports.gobj_set_gobj_no_trace = function(e, t, n) {
|
|
2607
|
-
if (!e) return
|
|
2611
|
+
if (!e) return Ht("gobj_set_gobj_no_trace: gobj NULL"), -1;
|
|
2608
2612
|
const r = G(t, "gobj_set_gobj_no_trace");
|
|
2609
2613
|
return r ? (n ? e.no_trace_level |= r : e.no_trace_level &= ~r, 0) : -1;
|
|
2610
2614
|
}, exports.gobj_set_gobj_trace = function(e, t, n) {
|
|
2611
|
-
if (!e) return
|
|
2615
|
+
if (!e) return Ht("gobj_set_gobj_trace: gobj NULL"), -1;
|
|
2612
2616
|
const r = G(t, "gobj_set_gobj_trace");
|
|
2613
2617
|
return r ? (n ? e.trace_level |= r : e.trace_level &= ~r, 0) : -1;
|
|
2614
2618
|
}, exports.gobj_set_trace_machine_format = function(e) {
|
|
2615
2619
|
I = 1 === Number(e) ? 1 : 0;
|
|
2616
2620
|
}, exports.gobj_short_name = Fe, exports.gobj_start = ye, exports.gobj_start_children = function(e) {
|
|
2617
|
-
return Ke(e) ? (
|
|
2621
|
+
return Ke(e) ? (Ht("gobj NULL or DESTROYED"), -1) : He(e, x.WALK_FIRST2LAST, je, 0, 0);
|
|
2618
2622
|
}, exports.gobj_start_tree = function(e) {
|
|
2619
|
-
return Ke(e) ? (
|
|
2623
|
+
return Ke(e) ? (Ht("gobj NULL or DESTROYED"), -1) : (Y(e) && $(t("⏺ ⏺ ⏺ ⏺ start_tree: %s", Ge(e))), e.gclass.gclass_flag & O.gcflag_manual_start || e.disabled ? 0 : (e.running || ye(e), qe(e, x.WALK_TOP2BOTTOM, ve, 0, 0)));
|
|
2620
2624
|
}, exports.gobj_start_up = function(e, t, n, r, o, s, g) {
|
|
2621
2625
|
l = t, i = n, _ = r, a = o, u = s, c = g;
|
|
2622
2626
|
const p = [["EV_STATE_CHANGED", R.EVF_SYSTEM_EVENT | R.EVF_OUTPUT_EVENT | R.EVF_NO_WARN_SUBS], [0, 0]];
|
|
@@ -2626,14 +2630,14 @@ exports.GObj = S, exports.SDATA = j, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
2626
2630
|
}
|
|
2627
2631
|
return 0;
|
|
2628
2632
|
}, exports.gobj_stats = function(e, n, r, s) {
|
|
2629
|
-
return Ke(e) ? (
|
|
2633
|
+
return Ke(e) ? (Ht("gobj NULL or DESTROYED"), -1) : e.gclass.gmt.mt_stats ? e.gclass.gmt.mt_stats(e, n, r, s) : c ? c(e, n, r, s) : o(0, -1, t("%s, stats parser not available", Fe(e)), 0, 0);
|
|
2630
2634
|
}, exports.gobj_stop = Se, exports.gobj_stop_children = Ne, exports.gobj_stop_tree = function(e) {
|
|
2631
|
-
return Ke(e) ? (
|
|
2635
|
+
return Ke(e) ? (Ht("gobj NULL or DESTROYED"), -1) : (Y(e) && $(t("⏹ ⏹ ⏹ ⏹ stop_tree: %s", Ge(e))), xe(e) && Se(e), qe(e, x.WALK_TOP2BOTTOM, Oe, 0, 0));
|
|
2632
2636
|
}, exports.gobj_subscribe_event = xt, exports.gobj_trace_level = V, exports.gobj_trace_machine_format = function() {
|
|
2633
2637
|
return I;
|
|
2634
2638
|
}, exports.gobj_trace_no_level = M, exports.gobj_unsubscribe_event = function(e, t, n, r) {
|
|
2635
|
-
if (null == n && (n = {}), !e) return
|
|
2636
|
-
if (!r) return
|
|
2639
|
+
if (null == n && (n = {}), !e) return Ht(`publisher NULL: ev ${t}`), 0;
|
|
2640
|
+
if (!r) return Ht(`subscriber NULL: ev ${t}`), 0;
|
|
2637
2641
|
const o = /* @__PURE__ */ new Set([
|
|
2638
2642
|
"__config__",
|
|
2639
2643
|
"__global__",
|
|
@@ -2642,21 +2646,21 @@ exports.GObj = S, exports.SDATA = j, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
2642
2646
|
"__service__"
|
|
2643
2647
|
]);
|
|
2644
2648
|
if (Object.keys(n).forEach((n) => {
|
|
2645
|
-
o.has(n) ||
|
|
2649
|
+
o.has(n) || Ht(`${Fe(e)}: key ignored in subscription (key: ${n}, event: ${t})`);
|
|
2646
2650
|
}), vn(t)) t = "";
|
|
2647
|
-
else if (!(Et(e, t, R.EVF_OUTPUT_EVENT) || e.gclass.gclass_flag & O.gcflag_no_check_output_events)) return
|
|
2651
|
+
else if (!(Et(e, t, R.EVF_OUTPUT_EVENT) || e.gclass.gclass_flag & O.gcflag_no_check_output_events)) return Ht(`event NOT in output event list: ${Fe(e)}, ev ${t}`), 0;
|
|
2648
2652
|
let s = Nt(e.dl_subscriptions, e, t, n, r), l = 0;
|
|
2649
2653
|
for (let t = 0; t < s.length; t++) {
|
|
2650
2654
|
let n = s[t];
|
|
2651
2655
|
Rt(e, n, !1, !1), l++;
|
|
2652
2656
|
}
|
|
2653
|
-
return l || (
|
|
2654
|
-
}, exports.gobj_unsubscribe_list = Dt, exports.gobj_walk_gobj_children =
|
|
2655
|
-
if (!mn(n)) return
|
|
2657
|
+
return l || (qt(`${Fe(e)}: No subscription found`), Xt(n, "No subscription found")), 0;
|
|
2658
|
+
}, exports.gobj_unsubscribe_list = Dt, exports.gobj_walk_gobj_children = He, exports.gobj_walk_gobj_children_tree = qe, exports.gobj_write_attr = function(e, n, r, o) {
|
|
2659
|
+
if (!mn(n)) return Ht(t("gobj_write_attr(%s): path must be a string", Fe(e))), -1;
|
|
2656
2660
|
let s, l = e.jn_attrs, i = n.split("`");
|
|
2657
2661
|
if (i.length <= 1) {
|
|
2658
2662
|
let o = n;
|
|
2659
|
-
return o in l && l.hasOwnProperty(o) ? (l[o] = r, dn(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) : (
|
|
2663
|
+
return o in l && l.hasOwnProperty(o) ? (l[o] = r, dn(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) : (Ht(t("gobj_write_attr(%s): attr not found '%s'", Fe(e), o)), -1);
|
|
2660
2664
|
}
|
|
2661
2665
|
let _ = i.length;
|
|
2662
2666
|
for (let t = 0; t < _; t++) {
|
|
@@ -2670,8 +2674,8 @@ exports.GObj = S, exports.SDATA = j, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
2670
2674
|
if (s in o && o.hasOwnProperty(s)) return o[s] = r, dn(e.priv) && e.priv.hasOwnProperty(s) && (e.priv[s] = r), e.obflag & w.obflag_created && !(e.obflag & w.obflag_destroyed) && e.mt_writing && e.mt_writing(e, s), 0;
|
|
2671
2675
|
break;
|
|
2672
2676
|
}
|
|
2673
|
-
return
|
|
2674
|
-
}, exports.gobj_write_attrs = ut, exports.gobj_write_bool_attr = ct, exports.gobj_write_integer_attr = ft, exports.gobj_write_str_attr = gt, exports.gobj_yuno = Ie, exports.gobj_yuno_id = Le, exports.gobj_yuno_name = $e, exports.gobj_yuno_role = Ce, exports.id_index_in_obj_list =
|
|
2677
|
+
return Ht(t("gobj_write_attr(%s): attr not found '%s'", Fe(e), s)), -1;
|
|
2678
|
+
}, exports.gobj_write_attrs = ut, exports.gobj_write_bool_attr = ct, exports.gobj_write_integer_attr = ft, exports.gobj_write_str_attr = gt, exports.gobj_yuno = Ie, exports.gobj_yuno_id = Le, exports.gobj_yuno_name = $e, exports.gobj_yuno_role = Ce, exports.id_index_in_obj_list = qn, exports.index_in_list = ar, exports.is_array = bn, exports.is_boolean = Tn, exports.is_date = function(e) {
|
|
2675
2679
|
return e instanceof Date && !isNaN(e);
|
|
2676
2680
|
}, exports.is_function = yn, exports.is_gobj = jn, exports.is_metadata_key = function(e) {
|
|
2677
2681
|
if (!mn(e)) return !1;
|
|
@@ -2690,28 +2694,28 @@ exports.GObj = S, exports.SDATA = j, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
2690
2694
|
return !isNaN(t) && "" !== e.trim() && !isNaN(t);
|
|
2691
2695
|
}, exports.is_string = mn, exports.jdb_delete = function(e, t, n, r) {
|
|
2692
2696
|
let o = Pn(null, Pn(null, e, "topics", null, 0), t, null, 0);
|
|
2693
|
-
if (!o) return
|
|
2694
|
-
if (vn(r.id)) return
|
|
2697
|
+
if (!o) return Ht("jdb_delete: topic not found: " + t), null;
|
|
2698
|
+
if (vn(r.id)) return Ht("jdb_delete: record without id: " + r), Qt(r), null;
|
|
2695
2699
|
let s, l = n.split("`"), i = o;
|
|
2696
2700
|
for (; (s = l.shift()) && !vn(s) && i;) dn(i) && (i = Pn(null, i, e.hook, null, 0)), i = or(i, null, s, !1);
|
|
2697
2701
|
if (0 === l.length && i) if (bn(i)) {
|
|
2698
|
-
let e =
|
|
2702
|
+
let e = qn(i, r.id);
|
|
2699
2703
|
e >= 0 && i.splice(e, 1);
|
|
2700
2704
|
} else {
|
|
2701
|
-
let t = Pn(null, i, e.hook, null, 0), n =
|
|
2705
|
+
let t = Pn(null, i, e.hook, null, 0), n = qn(t, r.id);
|
|
2702
2706
|
n >= 0 && t.splice(n, 1);
|
|
2703
2707
|
}
|
|
2704
2708
|
return o;
|
|
2705
2709
|
}, exports.jdb_get = function(e, t, n, r) {
|
|
2706
2710
|
let o = Pn(null, Pn(null, e, "topics", null, 0), t, null, 0);
|
|
2707
|
-
return o ? (void 0 === r && (r = !0), or(o, e.hook, n, r)) : (
|
|
2711
|
+
return o ? (void 0 === r && (r = !0), or(o, e.hook, n, r)) : (Ht("jdb_get: topic not found: " + t), null);
|
|
2708
2712
|
}, exports.jdb_get_by_idx = function(e, t, n) {
|
|
2709
2713
|
let r = Pn(null, Pn(null, e, "topics", null, 0), t, null, 0);
|
|
2710
|
-
return r ? n < r.length ? r[n] : {} : (
|
|
2714
|
+
return r ? n < r.length ? r[n] : {} : (Ht("jdb_get_by_idx: topic not found: " + t), null);
|
|
2711
2715
|
}, exports.jdb_get_topic = function(e, t) {
|
|
2712
2716
|
let n = Pn(null, e, "topics", null, 0);
|
|
2713
|
-
if (!n) return
|
|
2714
|
-
return Pn(null, n, t, null, 0) || (
|
|
2717
|
+
if (!n) return Ht("jdb topics section not found"), Qt(e), null;
|
|
2718
|
+
return Pn(null, n, t, null, 0) || (Ht("jdb topic not found: " + t), Qt(n), null);
|
|
2715
2719
|
}, exports.jdb_init = function(e, t, n) {
|
|
2716
2720
|
n && (e = Zt(e));
|
|
2717
2721
|
let r = Pn(null, e, "type", [], 1);
|
|
@@ -2722,8 +2726,8 @@ exports.GObj = S, exports.SDATA = j, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
2722
2726
|
}, t), e;
|
|
2723
2727
|
}, exports.jdb_update = function(e, t, n, r) {
|
|
2724
2728
|
let o = Pn(null, Pn(null, e, "topics", null, 0), t, null, 0);
|
|
2725
|
-
if (!o) return
|
|
2726
|
-
if (vn(r.id)) return
|
|
2729
|
+
if (!o) return Ht("jdb_update: topic not found: " + t), null;
|
|
2730
|
+
if (vn(r.id)) return Ht("jdb_update: record without id: " + r), Qt(r), null;
|
|
2727
2731
|
let s, l = n.split("`"), i = o;
|
|
2728
2732
|
for (; (s = l.shift()) && !vn(s) && i;) dn(i) && (i = Pn(null, i, e.hook, [], 1)), i = or(i, null, s, !1);
|
|
2729
2733
|
if (0 === l.length && i) if (bn(i)) i.push(r);
|
|
@@ -2768,7 +2772,7 @@ exports.GObj = S, exports.SDATA = j, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
2768
2772
|
return null;
|
|
2769
2773
|
}
|
|
2770
2774
|
}, exports.jwtDecode = sr, exports.kw_clone_by_keys = Mn, exports.kw_clone_by_not_keys = Wn, exports.kw_collect = function(e, t, n, r) {
|
|
2771
|
-
if (e && !jn(e) &&
|
|
2775
|
+
if (e && !jn(e) && Ht("GObj bad instanceof"), !t) return null;
|
|
2772
2776
|
r || (r = Vn);
|
|
2773
2777
|
let o = [];
|
|
2774
2778
|
if (bn(t)) for (let e = 0; e < t.length; e++) {
|
|
@@ -2776,16 +2780,16 @@ exports.GObj = S, exports.SDATA = j, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
2776
2780
|
r(s, n) && o.push(s);
|
|
2777
2781
|
}
|
|
2778
2782
|
else {
|
|
2779
|
-
if (!dn(t)) return
|
|
2783
|
+
if (!dn(t)) return Ht("kw_select() BAD kw parameter"), null;
|
|
2780
2784
|
r(t, n) && o.push(t);
|
|
2781
2785
|
}
|
|
2782
2786
|
return o;
|
|
2783
2787
|
}, exports.kw_delete = An, exports.kw_find_json_in_list = function(e, t, n, r) {
|
|
2784
|
-
if (!n || !bn(t)) return r &&
|
|
2788
|
+
if (!n || !bn(t)) return r && Ht("item NULL or kw_list is not a list"), -1;
|
|
2785
2789
|
for (let e = 0; e < t.length; e++) if (en(n, t[e])) return e;
|
|
2786
|
-
return r &&
|
|
2790
|
+
return r && Ht("item not found in this list"), -1;
|
|
2787
2791
|
}, exports.kw_find_path = Dn, exports.kw_flag_t = $t, exports.kw_get_bool = kn, exports.kw_get_dict = Ln, exports.kw_get_dict_value = Pn, exports.kw_get_int = In, exports.kw_get_list = function(e, t, n, r, o) {
|
|
2788
|
-
e && !jn(e) &&
|
|
2792
|
+
e && !jn(e) && Ht("GObj bad instanceof");
|
|
2789
2793
|
let s = Dn(e, t, n, !1);
|
|
2790
2794
|
const l = o && o & $t.KW_REQUIRED, i = o && o & $t.KW_CREATE, _ = o && o & $t.KW_EXTRACT;
|
|
2791
2795
|
if (void 0 === s) {
|
|
@@ -2793,11 +2797,11 @@ exports.GObj = S, exports.SDATA = j, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
2793
2797
|
let o = Array(r);
|
|
2794
2798
|
return Un(e, t, n, o), o;
|
|
2795
2799
|
}
|
|
2796
|
-
return l && (
|
|
2800
|
+
return l && (Ht(`path not found: '${n}'`), Xt(t)), Array(r);
|
|
2797
2801
|
}
|
|
2798
|
-
return _ && An(e, t, n), bn(s) ? Array(s) : (l && (
|
|
2802
|
+
return _ && An(e, t, n), bn(s) ? Array(s) : (l && (Ht(`path value MUST BE an array: ${n}`), Qt(t)), Array(r));
|
|
2799
2803
|
}, exports.kw_get_local_storage_value = Kn, exports.kw_get_pointer = Cn, exports.kw_get_real = function(e, t, n, r, o) {
|
|
2800
|
-
e && !jn(e) &&
|
|
2804
|
+
e && !jn(e) && Ht("GObj bad instanceof");
|
|
2801
2805
|
let s = Dn(e, t, n, !1);
|
|
2802
2806
|
const l = o && o & $t.KW_REQUIRED, i = o && o & $t.KW_CREATE, _ = o && o & $t.KW_EXTRACT;
|
|
2803
2807
|
if (void 0 === s) {
|
|
@@ -2805,11 +2809,11 @@ exports.GObj = S, exports.SDATA = j, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
2805
2809
|
let o = Number(r);
|
|
2806
2810
|
return Un(e, t, n, o), o;
|
|
2807
2811
|
}
|
|
2808
|
-
return l && (
|
|
2812
|
+
return l && (Ht(`path not found: '${n}'`), Xt(t)), Number(r);
|
|
2809
2813
|
}
|
|
2810
|
-
return _ && An(e, t, n), En(s) ? Number(s) : (l && (
|
|
2814
|
+
return _ && An(e, t, n), En(s) ? Number(s) : (l && (Ht(`path value MUST BE a number: ${n}`), Qt(t)), Number(r));
|
|
2811
2815
|
}, exports.kw_get_str = $n, exports.kw_has_key = xn, exports.kw_match_simple = Vn, exports.kw_pop = Rn, exports.kw_remove_local_storage_value = Bn, exports.kw_select = function(e, t, n, r) {
|
|
2812
|
-
if (e && !jn(e) &&
|
|
2816
|
+
if (e && !jn(e) && Ht("GObj bad instanceof"), !t) return null;
|
|
2813
2817
|
r || (r = Vn);
|
|
2814
2818
|
let o = [];
|
|
2815
2819
|
if (bn(t)) for (let e = 0; e < t.length; e++) {
|
|
@@ -2817,16 +2821,16 @@ exports.GObj = S, exports.SDATA = j, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
2817
2821
|
r(s, n) && o.push(Zt(s));
|
|
2818
2822
|
}
|
|
2819
2823
|
else {
|
|
2820
|
-
if (!dn(t)) return
|
|
2824
|
+
if (!dn(t)) return Ht("kw_select() BAD kw parameter"), null;
|
|
2821
2825
|
r(t, n) && o.push(Zt(t));
|
|
2822
2826
|
}
|
|
2823
2827
|
return o;
|
|
2824
|
-
}, exports.kw_set_dict_value = Un, exports.kw_set_local_storage_value = Yn, exports.kw_set_subdict_value = Fn, exports.kwid_collect =
|
|
2825
|
-
e && !jn(e) &&
|
|
2826
|
-
let s =
|
|
2828
|
+
}, exports.kw_set_dict_value = Un, exports.kw_set_local_storage_value = Yn, exports.kw_set_subdict_value = Fn, exports.kwid_collect = Hn, exports.kwid_find_one_record = function(e, t, n, r, o) {
|
|
2829
|
+
e && !jn(e) && Ht("GObj bad instanceof");
|
|
2830
|
+
let s = Hn(e, t, n, r, o);
|
|
2827
2831
|
return s.length > 0 ? s[0] : null;
|
|
2828
2832
|
}, exports.kwid_get_ids = function(e, t) {
|
|
2829
|
-
if (e && !jn(e) &&
|
|
2833
|
+
if (e && !jn(e) && Ht("GObj bad instanceof"), !t) return [];
|
|
2830
2834
|
let n = [];
|
|
2831
2835
|
if (mn(t)) n.push(t);
|
|
2832
2836
|
else if (dn(t)) for (let e in t) t.hasOwnProperty(e) && n.push(e);
|
|
@@ -2839,14 +2843,14 @@ exports.GObj = S, exports.SDATA = j, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
2839
2843
|
});
|
|
2840
2844
|
return n;
|
|
2841
2845
|
}, exports.kwid_match_id = Jn, exports.kwid_new_dict = function(e, t, n) {
|
|
2842
|
-
e && !jn(e) &&
|
|
2846
|
+
e && !jn(e) && Ht("GObj bad instanceof");
|
|
2843
2847
|
let r = {};
|
|
2844
2848
|
if (vn(n) || (t = Dn(e, t, n)), dn(t)) r = t;
|
|
2845
2849
|
else if (bn(t)) for (let n = 0; n < t.length; n++) {
|
|
2846
2850
|
let o = t[n], s = $n(e, o, "id", "", 0);
|
|
2847
2851
|
vn(s) || (r[s] = o);
|
|
2848
2852
|
}
|
|
2849
|
-
else
|
|
2853
|
+
else Ht(`${Fe(e)} kwid_new_dict: data type unknown`);
|
|
2850
2854
|
return r;
|
|
2851
2855
|
}, exports.list2options = function(e, t, n) {
|
|
2852
2856
|
t = t || "id", n = n || "value";
|
|
@@ -2862,7 +2866,7 @@ exports.GObj = S, exports.SDATA = j, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
2862
2866
|
if (xn(s, t)) {
|
|
2863
2867
|
if (!xn(s, n)) {
|
|
2864
2868
|
if (!(pn(s) > 0)) {
|
|
2865
|
-
|
|
2869
|
+
Ht("list2options(): object without field value: " + n);
|
|
2866
2870
|
continue;
|
|
2867
2871
|
}
|
|
2868
2872
|
n = Object.keys(s)[0];
|
|
@@ -2870,19 +2874,19 @@ exports.GObj = S, exports.SDATA = j, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
2870
2874
|
e.id = s[t], e.value = s[n];
|
|
2871
2875
|
} else {
|
|
2872
2876
|
if (!(pn(s) > 0)) {
|
|
2873
|
-
|
|
2877
|
+
Ht("list2options(): object without field id: " + t);
|
|
2874
2878
|
continue;
|
|
2875
2879
|
}
|
|
2876
2880
|
t = Object.keys(s)[0], e.id = t, e.value = s[t];
|
|
2877
2881
|
}
|
|
2878
2882
|
r.push(e);
|
|
2879
|
-
} else
|
|
2883
|
+
} else Ht("list2options(): case1 not implemented");
|
|
2880
2884
|
}
|
|
2881
2885
|
else if (dn(e)) for (let t of Object.keys(e)) r.push({
|
|
2882
2886
|
id: t,
|
|
2883
2887
|
value: t
|
|
2884
2888
|
});
|
|
2885
|
-
else
|
|
2889
|
+
else Ht("list2options(): case2 not implemented");
|
|
2886
2890
|
return r;
|
|
2887
2891
|
}, exports.load_json_file = function(e, t, n) {
|
|
2888
2892
|
let r = new XMLHttpRequest();
|
|
@@ -2890,41 +2894,47 @@ exports.GObj = S, exports.SDATA = j, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
2890
2894
|
if (4 === r.readyState) if (200 === r.status || 0 === (e = r).status && e.responseText && e.responseURL.startsWith("file:")) try {
|
|
2891
2895
|
t(JSON.parse(r.responseText));
|
|
2892
2896
|
} catch (e) {
|
|
2893
|
-
n && (
|
|
2897
|
+
n && (Ht(`JSON parse status ${r.status}, error: ${e.message}`), n(r.status));
|
|
2894
2898
|
}
|
|
2895
2899
|
else n && n(r.status);
|
|
2896
2900
|
var e;
|
|
2897
2901
|
}, r.send();
|
|
2898
|
-
}, exports.log_debug = zt, exports.log_error =
|
|
2902
|
+
}, exports.log_debug = zt, exports.log_error = Ht, exports.log_info = function(e) {
|
|
2899
2903
|
let t = Jt(e), n = _r();
|
|
2900
2904
|
Ut && Wt("info", t) && Ut("%c" + n + " INFO: " + String(t), "color:cyan"), Yt("info", t, n);
|
|
2901
|
-
}, exports.log_warning =
|
|
2905
|
+
}, exports.log_warning = qt, exports.msg_iev_get_msg_type = nr, exports.msg_iev_get_stack = er, exports.msg_iev_push_stack = Zn, exports.msg_iev_read_key = Qn, exports.msg_iev_set_msg_type = tr, exports.msg_iev_write_key = Xn, exports.node_uuid = ur, exports.parseBoolean = Sn, exports.parseSVG = function(e) {
|
|
2902
2906
|
return new DOMParser().parseFromString(e, "image/svg+xml").firstChild;
|
|
2903
2907
|
}, exports.refresh_language = function(e, t) {
|
|
2904
|
-
yn(t)
|
|
2908
|
+
if (!yn(t)) return void Ht("You must supply a translation function");
|
|
2909
|
+
e || (e = document);
|
|
2910
|
+
const n = (t) => {
|
|
2911
|
+
let n = [];
|
|
2912
|
+
return "function" == typeof e.matches && e.matches(t) && n.push(e), n.push(...e.querySelectorAll(t)), n;
|
|
2913
|
+
};
|
|
2914
|
+
n("[data-i18n]").forEach(function(e) {
|
|
2905
2915
|
let n = e.getAttribute("data-i18n");
|
|
2906
2916
|
for (let r of e.childNodes) if (r.nodeType === Node.TEXT_NODE) {
|
|
2907
2917
|
n || (n = r.nodeValue), r.nodeValue = t(n);
|
|
2908
2918
|
break;
|
|
2909
2919
|
}
|
|
2910
|
-
}),
|
|
2920
|
+
}), n("[data-i18n-title]").forEach(function(e) {
|
|
2911
2921
|
let n = e.getAttribute("data-i18n-title");
|
|
2912
2922
|
n && e.setAttribute("title", t(n));
|
|
2913
|
-
}),
|
|
2923
|
+
}), n("[data-i18n-aria-label]").forEach(function(e) {
|
|
2914
2924
|
let n = e.getAttribute("data-i18n-aria-label");
|
|
2915
2925
|
n && e.setAttribute("aria-label", t(n));
|
|
2916
|
-
}),
|
|
2926
|
+
}), n("[data-i18n-placeholder]").forEach(function(e) {
|
|
2917
2927
|
let n = e.getAttribute("data-i18n-placeholder");
|
|
2918
2928
|
n && e.setAttribute("placeholder", t(n));
|
|
2919
|
-
})
|
|
2929
|
+
});
|
|
2920
2930
|
}, exports.register_c_ievent_cli = function() {
|
|
2921
2931
|
return function(e) {
|
|
2922
|
-
if (Fr) return
|
|
2932
|
+
if (Fr) return Ht(`GClass ALREADY created: ${e}`), -1;
|
|
2923
2933
|
const t = [
|
|
2924
2934
|
["ST_DISCONNECTED", [
|
|
2925
2935
|
[
|
|
2926
2936
|
"EV_ON_OPEN",
|
|
2927
|
-
|
|
2937
|
+
qr,
|
|
2928
2938
|
"ST_WAIT_IDENTITY_CARD_ACK"
|
|
2929
2939
|
],
|
|
2930
2940
|
[
|
|
@@ -2934,7 +2944,7 @@ exports.GObj = S, exports.SDATA = j, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
2934
2944
|
],
|
|
2935
2945
|
[
|
|
2936
2946
|
"EV_TIMEOUT",
|
|
2937
|
-
|
|
2947
|
+
Hr,
|
|
2938
2948
|
null
|
|
2939
2949
|
],
|
|
2940
2950
|
[
|
|
@@ -3014,7 +3024,7 @@ exports.GObj = S, exports.SDATA = j, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
3014
3024
|
}("C_IEVENT_CLI");
|
|
3015
3025
|
}, exports.register_c_timer = function() {
|
|
3016
3026
|
return function(e) {
|
|
3017
|
-
if (Or) return
|
|
3027
|
+
if (Or) return Ht(`GClass ALREADY created: ${e}`), -1;
|
|
3018
3028
|
const t = [["ST_IDLE", [[
|
|
3019
3029
|
"EV_TIMEOUT",
|
|
3020
3030
|
Nr,
|
|
@@ -3028,7 +3038,7 @@ exports.GObj = S, exports.SDATA = j, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
3028
3038
|
}("C_TIMER");
|
|
3029
3039
|
}, exports.register_c_yuno = function() {
|
|
3030
3040
|
return function(e) {
|
|
3031
|
-
if (Ir) return
|
|
3041
|
+
if (Ir) return Ht(`GClass ALREADY created: ${e}`), -1;
|
|
3032
3042
|
const t = [["ST_IDLE", [[
|
|
3033
3043
|
"EV_TIMEOUT_PERIODIC",
|
|
3034
3044
|
$r,
|
|
@@ -3055,8 +3065,8 @@ exports.GObj = S, exports.SDATA = j, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
3055
3065
|
var r = (e + "").substring(0, n), o = (t + "").substring(0, n);
|
|
3056
3066
|
return r === o ? 0 : r > o ? 1 : -1;
|
|
3057
3067
|
}, exports.strs_in_list = function(e, t, n) {
|
|
3058
|
-
if (!e) return
|
|
3059
|
-
if (!t) return
|
|
3068
|
+
if (!e) return Ht("ERROR: strs_in_list() list empty"), !1;
|
|
3069
|
+
if (!t) return Ht("ERROR: strs_in_list() str empty"), !1;
|
|
3060
3070
|
for (let r = 0; r < t.length; r++) if (zn(e, t[r], n)) return !0;
|
|
3061
3071
|
return !1;
|
|
3062
3072
|
}, exports.strstr = function(e, t, n) {
|
|
@@ -3099,9 +3109,9 @@ exports.GObj = S, exports.SDATA = j, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
3099
3109
|
}, exports.timeTracker = function(e = "Time Tracker", t = !1) {
|
|
3100
3110
|
const n = e, r = performance.now();
|
|
3101
3111
|
let o = r;
|
|
3102
|
-
return t &&
|
|
3112
|
+
return t && qt(`--\x3e ${n} - starting`), { mark: (e = "Intermediate", s = "") => {
|
|
3103
3113
|
const l = performance.now(), i = (l - o) / 1e3, _ = (l - r) / 1e3;
|
|
3104
|
-
return t &&
|
|
3114
|
+
return t && qt(`--\x3e ${n} ${e} - partial: ${i} sec, total: ${_} sec, ${s}`), o = l, {
|
|
3105
3115
|
partial: i,
|
|
3106
3116
|
total: _
|
|
3107
3117
|
};
|
|
@@ -3110,7 +3120,7 @@ exports.GObj = S, exports.SDATA = j, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
3110
3120
|
if (mn(t)) {
|
|
3111
3121
|
if (-1 === t.indexOf("^")) {
|
|
3112
3122
|
let n, r = e.hook;
|
|
3113
|
-
if (1 !== fn(r)) return
|
|
3123
|
+
if (1 !== fn(r)) return Ht("bad hook 1"), Ht(e), Ht(t), null;
|
|
3114
3124
|
for (let e of Object.keys(r)) {
|
|
3115
3125
|
n = e, r[e];
|
|
3116
3126
|
break;
|
|
@@ -3122,7 +3132,7 @@ exports.GObj = S, exports.SDATA = j, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
3122
3132
|
}
|
|
3123
3133
|
{
|
|
3124
3134
|
let n = t.split("^");
|
|
3125
|
-
return 2 !== n.length ? (
|
|
3135
|
+
return 2 !== n.length ? (Ht("bad hook 2"), Ht(e), Ht(t), null) : {
|
|
3126
3136
|
topic_name: n[0],
|
|
3127
3137
|
id: n[1]
|
|
3128
3138
|
};
|
|
@@ -3131,7 +3141,7 @@ exports.GObj = S, exports.SDATA = j, exports.SDATAAUTHZ = (e, t, n, r, o, s) =>
|
|
|
3131
3141
|
return dn(t) ? {
|
|
3132
3142
|
topic_name: t.topic_name,
|
|
3133
3143
|
id: t.id
|
|
3134
|
-
} : (
|
|
3144
|
+
} : (Ht("bad hook 3"), Ht(e), Ht(t), null);
|
|
3135
3145
|
}, exports.treedb_encoder_fkey = function(e, t) {
|
|
3136
3146
|
let n = Er(e, t);
|
|
3137
3147
|
return n ? n.topic_name + "^" + n.id + "^" + n.hook_name : null;
|