@yuneta/gobj-js 7.26.15 → 7.26.16
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 +38 -10
- package/dist/gobj-js.cjs.js.map +1 -1
- package/dist/gobj-js.cjs.min.js +884 -870
- package/dist/gobj-js.cjs.min.js.map +1 -1
- package/dist/gobj-js.es.js +38 -10
- package/dist/gobj-js.es.js.map +1 -1
- package/dist/gobj-js.es.min.js +925 -911
- package/dist/gobj-js.es.min.js.map +1 -1
- package/dist/gobj-js.iife.js +38 -10
- package/dist/gobj-js.iife.js.map +1 -1
- package/dist/gobj-js.iife.min.js +884 -870
- package/dist/gobj-js.iife.min.js.map +1 -1
- package/dist/gobj-js.umd.js +38 -10
- package/dist/gobj-js.umd.js.map +1 -1
- package/dist/gobj-js.umd.min.js +884 -870
- package/dist/gobj-js.umd.min.js.map +1 -1
- package/package.json +1 -1
package/dist/gobj-js.es.min.js
CHANGED
|
@@ -178,7 +178,7 @@ var O = class {
|
|
|
178
178
|
}
|
|
179
179
|
}, I = class {
|
|
180
180
|
constructor(e, t, n, r, l) {
|
|
181
|
-
this.__refs__ = 0, this.gclass = t, this.parent = null, this.dl_children = [], this.dl_subscriptions = [], this.dl_subscribings = [], this.current_state = t.dl_states[0], this.last_state = null, this.obflag = 0, this.gobj_flag = Number(l) || 0, this.gobj_name = e, this.jn_attrs = null, this.jn_stats = {}, this.jn_user_data = {}, this.full_name = null, this.short_name = null, this.priv =
|
|
181
|
+
this.__refs__ = 0, this.gclass = t, this.parent = null, this.dl_children = [], this.dl_subscriptions = [], this.dl_subscribings = [], this.current_state = t.dl_states[0], this.last_state = null, this.obflag = 0, this.gobj_flag = Number(l) || 0, this.gobj_name = e, this.jn_attrs = null, this.jn_stats = {}, this.jn_user_data = {}, this.full_name = null, this.short_name = null, this.priv = Rr(t.priv), this.running = !1, this.playing = !1, this.disabled = !1, this.bottom_gobj = null, this.trace_level = 0, this.no_trace_level = 0;
|
|
182
182
|
}
|
|
183
183
|
}, C = Object.freeze({
|
|
184
184
|
gcflag_manual_start: 1,
|
|
@@ -230,7 +230,7 @@ function K() {
|
|
|
230
230
|
return W;
|
|
231
231
|
}
|
|
232
232
|
function Y(e) {
|
|
233
|
-
|
|
233
|
+
Jr(e) && (e = JSON.stringify(e)), cr(" ".repeat(Math.max(1, 2 * y)) + String(e));
|
|
234
234
|
}
|
|
235
235
|
var B = Object.freeze({
|
|
236
236
|
TRACE_MACHINE: 65536,
|
|
@@ -332,7 +332,7 @@ function Q(e, t) {
|
|
|
332
332
|
return n;
|
|
333
333
|
}
|
|
334
334
|
function X(e, t, n) {
|
|
335
|
-
if (
|
|
335
|
+
if (rl(e)) return void 0 === n ? 268369920 : 65535;
|
|
336
336
|
if (/^[0-9]+$/.test(String(e))) {
|
|
337
337
|
const t = Number(e);
|
|
338
338
|
if (t) return t;
|
|
@@ -343,7 +343,7 @@ function X(e, t, n) {
|
|
|
343
343
|
for (let n = 0; n < t.length && n < 16; n++) if (t[n] && t[n][0] === e) return 1 << n;
|
|
344
344
|
}
|
|
345
345
|
return 0;
|
|
346
|
-
}(String(e), n) || (
|
|
346
|
+
}(String(e), n) || (ar(`${t}: trace level NOT FOUND: ${e}`), 0);
|
|
347
347
|
}
|
|
348
348
|
function Z(e) {
|
|
349
349
|
if (z) return 4294967295;
|
|
@@ -405,39 +405,39 @@ function de() {
|
|
|
405
405
|
return Q(H, null);
|
|
406
406
|
}
|
|
407
407
|
function be(e) {
|
|
408
|
-
const t =
|
|
409
|
-
return t ? Q(t.trace_level | q, t.s_user_trace_level) : (
|
|
408
|
+
const t = Hr(e) ? Me(e) : e;
|
|
409
|
+
return t ? Q(t.trace_level | q, t.s_user_trace_level) : (ar(`gobj_get_gclass_trace_level: gclass NOT FOUND: ${e}`), []);
|
|
410
410
|
}
|
|
411
411
|
function pe(e) {
|
|
412
|
-
const t =
|
|
413
|
-
return t ? Q(t.trace_level, t.s_user_trace_level) : (
|
|
412
|
+
const t = Hr(e) ? Me(e) : e;
|
|
413
|
+
return t ? Q(t.trace_level, t.s_user_trace_level) : (ar(`gobj_get_gclass_trace_level2: gclass NOT FOUND: ${e}`), []);
|
|
414
414
|
}
|
|
415
415
|
function me(e) {
|
|
416
|
-
const t =
|
|
417
|
-
return t ? Q(t.no_trace_level, t.s_user_trace_level) : (
|
|
416
|
+
const t = Hr(e) ? Me(e) : e;
|
|
417
|
+
return t ? Q(t.no_trace_level, t.s_user_trace_level) : (ar(`gobj_get_gclass_trace_no_level: gclass NOT FOUND: ${e}`), []);
|
|
418
418
|
}
|
|
419
419
|
function he(e) {
|
|
420
420
|
return z = Number(e) || 0, 0;
|
|
421
421
|
}
|
|
422
422
|
function Ee(e, t, n) {
|
|
423
|
-
const r =
|
|
424
|
-
if (!r) return
|
|
423
|
+
const r = Hr(e) ? Me(e) : e;
|
|
424
|
+
if (!r) return ar(`gobj_set_gclass_trace: gclass NOT FOUND: ${e}`), -1;
|
|
425
425
|
const l = null === t ? 4294967295 : X(t, "gobj_set_gclass_trace", r.s_user_trace_level || null);
|
|
426
426
|
return l ? (n ? r.trace_level |= l : r.trace_level &= ~l, 0) : -1;
|
|
427
427
|
}
|
|
428
428
|
function ye(e, t, n) {
|
|
429
|
-
if (!e) return
|
|
429
|
+
if (!e) return ar("gobj_set_gobj_trace: gobj NULL"), -1;
|
|
430
430
|
const r = X(t, "gobj_set_gobj_trace", e.gclass && e.gclass.s_user_trace_level || null);
|
|
431
431
|
return r ? (n ? e.trace_level |= r : e.trace_level &= ~r, 0) : -1;
|
|
432
432
|
}
|
|
433
433
|
function Te(e, t, n) {
|
|
434
|
-
const r =
|
|
435
|
-
if (!r) return
|
|
434
|
+
const r = Hr(e) ? Me(e) : e;
|
|
435
|
+
if (!r) return ar(`gobj_set_gclass_no_trace: gclass NOT FOUND: ${e}`), -1;
|
|
436
436
|
const l = null === t ? 4294967295 : X(t, "gobj_set_gclass_no_trace", r.s_user_trace_level || null);
|
|
437
437
|
return l ? (n ? r.no_trace_level |= l : r.no_trace_level &= ~l, 0) : -1;
|
|
438
438
|
}
|
|
439
439
|
function ve(e, t, n) {
|
|
440
|
-
if (!e) return
|
|
440
|
+
if (!e) return ar("gobj_set_gobj_no_trace: gobj NULL"), -1;
|
|
441
441
|
const r = X(t, "gobj_set_gobj_no_trace", e.gclass && e.gclass.s_user_trace_level || null);
|
|
442
442
|
return r ? (n ? e.no_trace_level |= r : e.no_trace_level &= ~r, 0) : -1;
|
|
443
443
|
}
|
|
@@ -460,7 +460,7 @@ function Se(e, t, n, r, l, o, i) {
|
|
|
460
460
|
}
|
|
461
461
|
function Ne(e, t) {
|
|
462
462
|
let n = {};
|
|
463
|
-
if (!
|
|
463
|
+
if (!qr(t)) return ar("sdata_desc MUST be an array"), gr(t), n;
|
|
464
464
|
for (let r = 0; r < t.length; r++) {
|
|
465
465
|
const l = t[r];
|
|
466
466
|
l.name && we(e, n, l);
|
|
@@ -474,85 +474,85 @@ function we(e, t, n) {
|
|
|
474
474
|
r = String(l);
|
|
475
475
|
break;
|
|
476
476
|
case T.DTP_BOOLEAN:
|
|
477
|
-
r =
|
|
477
|
+
r = ll(l);
|
|
478
478
|
break;
|
|
479
479
|
case T.DTP_INTEGER:
|
|
480
|
-
r = parseInt(l), isNaN(r) &&
|
|
480
|
+
r = parseInt(l), isNaN(r) && ar(`${Rt(e)}: attr NaN: ${n.name}`);
|
|
481
481
|
break;
|
|
482
482
|
case T.DTP_REAL:
|
|
483
|
-
r = Number(l), isNaN(r) &&
|
|
483
|
+
r = Number(l), isNaN(r) && ar(`${Rt(e)}: attr NaN: ${n.name}`);
|
|
484
484
|
break;
|
|
485
485
|
case T.DTP_LIST:
|
|
486
|
-
if (
|
|
486
|
+
if (Hr(l)) try {
|
|
487
487
|
r = JSON.parse(l);
|
|
488
488
|
} catch (e) {
|
|
489
|
-
|
|
489
|
+
ar(`JSON parse error: ${e.message}`);
|
|
490
490
|
}
|
|
491
491
|
else r = l;
|
|
492
|
-
|
|
492
|
+
qr(r) || (r = []);
|
|
493
493
|
break;
|
|
494
494
|
case T.DTP_DICT:
|
|
495
|
-
if (
|
|
495
|
+
if (Hr(l)) try {
|
|
496
496
|
r = JSON.parse(l);
|
|
497
497
|
} catch (e) {
|
|
498
|
-
|
|
498
|
+
ar(`JSON parse error: ${e.message}`);
|
|
499
499
|
}
|
|
500
500
|
else r = l;
|
|
501
|
-
|
|
501
|
+
Jr(r) || (r = {});
|
|
502
502
|
break;
|
|
503
503
|
case T.DTP_JSON:
|
|
504
504
|
if ("" === l || void 0 === l) r = null;
|
|
505
|
-
else if (
|
|
505
|
+
else if (Hr(l)) try {
|
|
506
506
|
r = JSON.parse(l);
|
|
507
507
|
} catch (e) {
|
|
508
|
-
|
|
508
|
+
ar(`JSON parse error: ${e.message}`);
|
|
509
509
|
}
|
|
510
510
|
else r = l;
|
|
511
511
|
break;
|
|
512
512
|
case T.DTP_POINTER: r = l;
|
|
513
513
|
}
|
|
514
|
-
return void 0 === r && (
|
|
514
|
+
return void 0 === r && (ar(`default_value WRONG, it: ${n.name}, value: ${n.default_value}`), r = null), t[n.name] = r, 0;
|
|
515
515
|
}
|
|
516
516
|
function je(e, t, n, r) {
|
|
517
517
|
let l;
|
|
518
518
|
switch (n.type) {
|
|
519
519
|
case T.DTP_STRING:
|
|
520
520
|
if (null == r) l = "";
|
|
521
|
-
else if (
|
|
521
|
+
else if (Hr(r)) l = String(r);
|
|
522
522
|
else {
|
|
523
523
|
let e = JSON.stringify(r);
|
|
524
524
|
e && (l = String(e));
|
|
525
525
|
}
|
|
526
526
|
break;
|
|
527
527
|
case T.DTP_BOOLEAN:
|
|
528
|
-
l =
|
|
528
|
+
l = ll(r);
|
|
529
529
|
break;
|
|
530
530
|
case T.DTP_INTEGER:
|
|
531
|
-
if (l = parseInt(r), isNaN(l)) return
|
|
531
|
+
if (l = parseInt(r), isNaN(l)) return ar(`${Rt(e)}: attr NaN: ${n.name}`), -1;
|
|
532
532
|
break;
|
|
533
533
|
case T.DTP_REAL:
|
|
534
|
-
if (l = Number(r), isNaN(l)) return
|
|
534
|
+
if (l = Number(r), isNaN(l)) return ar(`${Rt(e)}: attr NaN: ${n.name}`), -1;
|
|
535
535
|
break;
|
|
536
536
|
case T.DTP_LIST:
|
|
537
|
-
if (
|
|
537
|
+
if (Hr(r)) try {
|
|
538
538
|
l = JSON.parse(r);
|
|
539
539
|
} catch (e) {
|
|
540
|
-
|
|
540
|
+
ar(`JSON parse error: ${e.message}`);
|
|
541
541
|
}
|
|
542
542
|
else l = r;
|
|
543
|
-
if (!
|
|
543
|
+
if (!qr(l)) return ar(`attr must be an array: ${n.name}`), -1;
|
|
544
544
|
break;
|
|
545
545
|
case T.DTP_DICT:
|
|
546
|
-
if (
|
|
546
|
+
if (Hr(r)) try {
|
|
547
547
|
l = JSON.parse(r);
|
|
548
548
|
} catch (e) {
|
|
549
|
-
|
|
549
|
+
ar(`JSON parse error: ${e.message}`);
|
|
550
550
|
}
|
|
551
551
|
else l = r;
|
|
552
|
-
if (!
|
|
552
|
+
if (!Jr(l)) return ar(`attr must be an object: ${n.name}`), -1;
|
|
553
553
|
break;
|
|
554
554
|
case T.DTP_JSON:
|
|
555
|
-
if (l = r,
|
|
555
|
+
if (l = r, Hr(r)) {
|
|
556
556
|
const e = r.trim();
|
|
557
557
|
if (e.startsWith("{") || e.startsWith("[")) try {
|
|
558
558
|
l = JSON.parse(e);
|
|
@@ -563,46 +563,46 @@ function je(e, t, n, r) {
|
|
|
563
563
|
break;
|
|
564
564
|
case T.DTP_POINTER: l = r;
|
|
565
565
|
}
|
|
566
|
-
return void 0 === l &&
|
|
566
|
+
return void 0 === l && ar(`${Rt(e)}: attr undefined: ${n.name}`), t[n.name] = l, Jr(e.priv) && Object.prototype.hasOwnProperty.call(e.priv, n.name) && (e.priv[n.name] = l), e.obflag & P.obflag_created && !(e.obflag & P.obflag_destroyed) && e.gclass.gmt.mt_writing && e.gclass.gmt.mt_writing(e, n.name), 0;
|
|
567
567
|
}
|
|
568
568
|
function $e(e) {
|
|
569
569
|
return e.jn_attrs;
|
|
570
570
|
}
|
|
571
571
|
function Re(e, t, n) {
|
|
572
|
-
return zt(e, t) ? $e(e) : e && e.bottom_gobj ? Re(e.bottom_gobj, t, n) : (n &&
|
|
572
|
+
return zt(e, t) ? $e(e) : e && e.bottom_gobj ? Re(e.bottom_gobj, t, n) : (n && ar(`GClass Attribute NOT FOUND: ${Rt(e)}, attr ${t}`), null);
|
|
573
573
|
}
|
|
574
574
|
function De(e, t, n) {
|
|
575
|
-
if (!(e && e instanceof k)) return n &&
|
|
575
|
+
if (!(e && e instanceof k)) return n && ar("gclass NULL"), null;
|
|
576
576
|
if (!t) return e.attrs_table;
|
|
577
577
|
for (let n = 0; n < e.attrs_table.length; n++) {
|
|
578
578
|
const r = e.attrs_table[n];
|
|
579
579
|
if (r.name && r.name === t) return r;
|
|
580
580
|
}
|
|
581
|
-
return n &&
|
|
581
|
+
return n && ar(`${e.gclass_name}: GClass Attribute NOT FOUND: ${t}`), null;
|
|
582
582
|
}
|
|
583
583
|
function Ae(e, t, n, r, l, o, i, s, a, u, _) {
|
|
584
|
-
if (
|
|
585
|
-
if (e.includes("`") || e.includes("^") || e.includes(".")) return
|
|
586
|
-
if (Me(e)) return
|
|
584
|
+
if (rl(e)) return ar("gclass_name EMPTY"), null;
|
|
585
|
+
if (e.includes("`") || e.includes("^") || e.includes(".")) return ar(`GClass name CANNOT have '.' or '^' or '\`' char: ${e}`), null;
|
|
586
|
+
if (Me(e)) return ar(`GClass ALREADY exists: ${e}`), null;
|
|
587
587
|
let c = new k(e, r, l, o, i, s, a, u, _);
|
|
588
588
|
(function(e, t) {
|
|
589
|
-
e && e instanceof k ? t ? p[t] ?
|
|
589
|
+
e && e instanceof k ? t ? p[t] ? ar(`gclass ALREADY REGISTERED: ${t}`) : p[t] = e : ar("gclass_name undefined") : ar("gclass undefined");
|
|
590
590
|
})(c, e);
|
|
591
591
|
const f = n.length;
|
|
592
592
|
for (let e = 0; e < f; e++) {
|
|
593
593
|
let t = n[e][0], r = n[e][1];
|
|
594
|
-
if (
|
|
594
|
+
if (rl(t)) continue;
|
|
595
595
|
if (Le(c, t) < 0) return ke(c), null;
|
|
596
596
|
const l = r.length;
|
|
597
597
|
for (let e = 0; e < l; e++) {
|
|
598
598
|
let n = r[e][0], l = r[e][1], o = r[e][2];
|
|
599
|
-
|
|
599
|
+
rl(n) || Pe(c, t, n, l, o);
|
|
600
600
|
}
|
|
601
601
|
}
|
|
602
602
|
for (let e = 0; e < t.length; e++) {
|
|
603
603
|
let n = t[e][0], r = t[e][1];
|
|
604
|
-
if (!
|
|
605
|
-
if (Ve(c, n)) return
|
|
604
|
+
if (!rl(n)) {
|
|
605
|
+
if (Ve(c, n)) return ar(`SMachine: event repeated in input_events: ${n}`), ke(c), null;
|
|
606
606
|
Fe(c, n, r);
|
|
607
607
|
}
|
|
608
608
|
}
|
|
@@ -614,13 +614,13 @@ function Ae(e, t, n, r, l, o, i, s, a, u, _) {
|
|
|
614
614
|
}
|
|
615
615
|
function ke(e) {
|
|
616
616
|
let t;
|
|
617
|
-
if (
|
|
617
|
+
if (Hr(e)) t = e;
|
|
618
618
|
else {
|
|
619
|
-
if (!(e instanceof k)) return
|
|
619
|
+
if (!(e instanceof k)) return ar("Cannot unregister gclass, type unknown"), -1;
|
|
620
620
|
t = e.gclass_name;
|
|
621
621
|
}
|
|
622
622
|
let n = p[t];
|
|
623
|
-
return n ? n.instances > 0 ? (
|
|
623
|
+
return n ? n.instances > 0 ? (ar(`Cannot unregister gclass, instances in use: ${t}`), -1) : (delete p[t], 0) : (ar(`Cannot unregister gclass, not found: ${t}`), -1);
|
|
624
624
|
}
|
|
625
625
|
function Ie(e, t) {
|
|
626
626
|
const n = e.dl_states.length, r = e.dl_states;
|
|
@@ -639,22 +639,22 @@ function Ce(e, t) {
|
|
|
639
639
|
return null;
|
|
640
640
|
}
|
|
641
641
|
function Le(e, t) {
|
|
642
|
-
return e instanceof k ? Ie(e, t) ? (
|
|
642
|
+
return e instanceof k ? Ie(e, t) ? (ar(`state already exists: ${t}`), -1) : (e.dl_states.push(new G(t)), 0) : (ar("Cannot add state, typeof not GClass"), -1);
|
|
643
643
|
}
|
|
644
644
|
function Pe(e, t, n, r, l) {
|
|
645
|
-
if (!(e instanceof k)) return
|
|
646
|
-
if (
|
|
645
|
+
if (!(e instanceof k)) return ar("Cannot add state, typeof not GClass"), -1;
|
|
646
|
+
if (rl(t)) return ar("state_name EMPTY"), -1;
|
|
647
647
|
let o = Ie(e, t);
|
|
648
|
-
return o ? Ce(o, n) ? (
|
|
648
|
+
return o ? Ce(o, n) ? (ar(`event already exists: gclass ${e.gclass_name}, state ${t}, event ${n}`), -1) : (o.dl_actions.push(new V(n, r, l)), 0) : (ar(`state not found: ${t}`), -1);
|
|
649
649
|
}
|
|
650
650
|
function Ue(e, t, n) {
|
|
651
|
-
|
|
651
|
+
rl(t) || e.push(new M(t, n));
|
|
652
652
|
}
|
|
653
653
|
function Fe(e, t, n) {
|
|
654
|
-
return e instanceof k ? Ue(e.dl_events, t, n) : (
|
|
654
|
+
return e instanceof k ? Ue(e.dl_events, t, n) : (ar("Cannot add state, typeof not GClass"), -1);
|
|
655
655
|
}
|
|
656
656
|
function Ve(e, t) {
|
|
657
|
-
if (!(e instanceof k)) return
|
|
657
|
+
if (!(e instanceof k)) return ar("Cannot add state, typeof not GClass"), 0;
|
|
658
658
|
const n = e.dl_events.length, r = e.dl_events;
|
|
659
659
|
for (let e = 0; e < n; e++) {
|
|
660
660
|
let n = r[e];
|
|
@@ -663,25 +663,25 @@ function Ve(e, t) {
|
|
|
663
663
|
return null;
|
|
664
664
|
}
|
|
665
665
|
function Ge(e) {
|
|
666
|
-
if (!(e instanceof k)) return
|
|
666
|
+
if (!(e instanceof k)) return ar("Cannot add state, typeof not GClass"), -1;
|
|
667
667
|
let t = 0;
|
|
668
|
-
|
|
668
|
+
Kr(e.dl_states) || (ar(`GClass without states: ${e.gclass_name}`), t += -1);
|
|
669
669
|
for (let n = 0; n < e.dl_states.length; n++) {
|
|
670
670
|
let r = e.dl_states[n];
|
|
671
|
-
if (!
|
|
671
|
+
if (!rl(r.state_name)) for (let n = 0; n < r.dl_actions.length; n++) {
|
|
672
672
|
let l = r.dl_actions[n];
|
|
673
|
-
|
|
673
|
+
rl(l.event_name) || (Ve(e, l.event_name) || (ar(`SMachine: state's event NOT in input_events: gclass ${e.gclass_name}, state ${r.state_name}, event ${l.event_name}`), t += -1), l.next_state && (Ie(e, l.next_state) || (ar(`SMachine: next state NOT in state names: gclass ${e.gclass_name}, state ${r.state_name}, next_state ${l.next_state}`), t += -1)));
|
|
674
674
|
}
|
|
675
675
|
}
|
|
676
676
|
for (let n = 0; n < e.dl_events.length; n++) {
|
|
677
677
|
let r = e.dl_events[n];
|
|
678
|
-
if (!
|
|
678
|
+
if (!rl(r.event_name) && (zr(r.event_flag) || (ar(`SMachine: event flag is NOT number: gclass ${e.gclass_name}, event ${r.event_name}`), t += -1), !(r.event_flag & U.EVF_OUTPUT_EVENT))) {
|
|
679
679
|
let n = !1;
|
|
680
680
|
for (let t = 0; t < e.dl_states.length; t++) {
|
|
681
681
|
let l = e.dl_states[t];
|
|
682
|
-
|
|
682
|
+
rl(l.state_name) || Ce(l, r.event_name) && (n = !0);
|
|
683
683
|
}
|
|
684
|
-
n || (
|
|
684
|
+
n || (ar(`SMachine: input_list's event NOT in state: gclass ${e.gclass_name}, event ${r.event_name}`), t += -1);
|
|
685
685
|
}
|
|
686
686
|
}
|
|
687
687
|
return t;
|
|
@@ -691,83 +691,83 @@ function Me(e, t) {
|
|
|
691
691
|
try {
|
|
692
692
|
n = p[e];
|
|
693
693
|
} catch (e) {}
|
|
694
|
-
return n || (t &&
|
|
694
|
+
return n || (t && ar(`gclass not found: ${e}`), null);
|
|
695
695
|
}
|
|
696
696
|
function We() {
|
|
697
697
|
let e = [];
|
|
698
|
-
for (const t of Object.keys(m))
|
|
698
|
+
for (const t of Object.keys(m)) Gr(e, t);
|
|
699
699
|
return e;
|
|
700
700
|
}
|
|
701
701
|
function xe() {
|
|
702
702
|
return !E || E.obflag & P.obflag_destroyed ? null : E;
|
|
703
703
|
}
|
|
704
704
|
function Ke(e, t) {
|
|
705
|
-
if (!
|
|
705
|
+
if (!Hr(e)) return ar(`gobj_find_service(): service name must be a string: ${e}`), null;
|
|
706
706
|
e = e.toLowerCase();
|
|
707
|
-
return m[e] || (t &&
|
|
707
|
+
return m[e] || (t && ar(`gobj service not found: ${e}`), null);
|
|
708
708
|
}
|
|
709
709
|
function Ye(e) {
|
|
710
710
|
let t = jt(e);
|
|
711
|
-
return t = t.toLowerCase(), m[t] &&
|
|
711
|
+
return t = t.toLowerCase(), m[t] && ar(`service ALREADY REGISTERED: ${t}. Will be UPDATED`), m[t] = e, 0;
|
|
712
712
|
}
|
|
713
713
|
function Be(e, t) {
|
|
714
|
-
t.parent &&
|
|
714
|
+
t.parent && ar(`_add_child() ALREADY HAS PARENT: ${t.gobj_name}`), e.dl_children.push(t), t.parent = e;
|
|
715
715
|
}
|
|
716
716
|
function Je(e, t) {
|
|
717
|
-
let n =
|
|
718
|
-
n >= 0 && (
|
|
717
|
+
let n = Co(e.dl_children, t);
|
|
718
|
+
n >= 0 && (Mr(e.dl_children, n), t.parent = null);
|
|
719
719
|
}
|
|
720
720
|
function qe(e, t) {
|
|
721
|
-
return Tt(e) ? u ? u(e, t) : -1 : (
|
|
721
|
+
return Tt(e) ? u ? u(e, t) : -1 : (ar(`${Rt(e)}: Only gobj services can load/save writable-persistent`), -1);
|
|
722
722
|
}
|
|
723
723
|
function He(e, t) {
|
|
724
|
-
return Tt(e) ? _ ? _(e, t) : -1 : (
|
|
724
|
+
return Tt(e) ? _ ? _(e, t) : -1 : (ar(`${Rt(e)}: Only gobj services can load/save writable-persistent`), -1);
|
|
725
725
|
}
|
|
726
726
|
function ze(e, t) {
|
|
727
|
-
return Tt(e) ? c ? c(e, t) : -1 : (
|
|
727
|
+
return Tt(e) ? c ? c(e, t) : -1 : (ar(`${Rt(e)}: Only gobj services can load/save writable-persistent`), -1);
|
|
728
728
|
}
|
|
729
729
|
function Qe(e, t) {
|
|
730
730
|
return f ? f(e, t) : null;
|
|
731
731
|
}
|
|
732
732
|
function Xe(e, t) {
|
|
733
|
-
"__json_config_variables__" !== t &&
|
|
733
|
+
"__json_config_variables__" !== t && ar(`GClass Attribute NOT FOUND: ${Rt(e)}, attr ${t}`);
|
|
734
734
|
}
|
|
735
735
|
function Ze(e, t, n) {
|
|
736
736
|
let r = t;
|
|
737
737
|
(function(e, t, n, r, l) {
|
|
738
|
-
if (!e || !t) return
|
|
738
|
+
if (!e || !t) return ar("hsdata or kw NULL"), -1;
|
|
739
739
|
let o = 0;
|
|
740
740
|
for (const [i, s] of Object.entries(t)) {
|
|
741
741
|
const t = De(l.gclass, i, !1);
|
|
742
|
-
t ? (-1 === n || t.flag & n) && (t.flag & v.SDF_DEPRECATED &&
|
|
742
|
+
t ? (-1 === n || t.flag & n) && (t.flag & v.SDF_DEPRECATED && ur(`${Rt(l)}: Deprecated attribute used in gobj creation: ${i}`), o += je(l, e, t, s)) : r && (r(l, i), o--);
|
|
743
743
|
}
|
|
744
744
|
return o;
|
|
745
|
-
})($e(e), r, -1, e.gclass.gclass_flag & C.gcflag_ignore_unknown_attrs ? 0 : Xe, e) < 0 && (
|
|
745
|
+
})($e(e), r, -1, e.gclass.gclass_flag & C.gcflag_ignore_unknown_attrs ? 0 : Xe, e) < 0 && (ar(`${Rt(e)} json2data() FAILED`), $r(r));
|
|
746
746
|
}
|
|
747
747
|
function et(e, n, r, l, o) {
|
|
748
748
|
if (o & L.gobj_flag_yuno) {
|
|
749
|
-
if (h) return
|
|
749
|
+
if (h) return ar("__yuno__ already created"), null;
|
|
750
750
|
o |= L.gobj_flag_service;
|
|
751
751
|
} else {
|
|
752
|
-
if (!l) return
|
|
753
|
-
if (!("string" == typeof l || l instanceof I)) return
|
|
754
|
-
if (
|
|
752
|
+
if (!l) return ar("gobj NEEDS a parent!"), null;
|
|
753
|
+
if (!("string" == typeof l || l instanceof I)) return ar(`BAD TYPE of parent: ${l}`), null;
|
|
754
|
+
if (Hr(l)) {
|
|
755
755
|
const e = l;
|
|
756
|
-
if (!(l = Ke(e))) return
|
|
756
|
+
if (!(l = Ke(e))) return ur(`parent service not found: ${e}`), null;
|
|
757
757
|
}
|
|
758
758
|
}
|
|
759
|
-
if (o & L.gobj_flag_service && Ke(e, !1)) return
|
|
759
|
+
if (o & L.gobj_flag_service && Ke(e, !1)) return ar(`service ALREADY registered: ${n}^${e}`), null;
|
|
760
760
|
if (o & L.gobj_flag_default_service) {
|
|
761
|
-
if (E) return
|
|
761
|
+
if (E) return ar(`default service ALREADY registered: ${n}^${e}`), null;
|
|
762
762
|
o |= L.gobj_flag_service;
|
|
763
763
|
}
|
|
764
|
-
if (
|
|
764
|
+
if (rl(n)) return ar("gclass_name must be a string"), null;
|
|
765
765
|
let i = Me(n, !1);
|
|
766
|
-
if (!i) return
|
|
767
|
-
if (!
|
|
768
|
-
if (!
|
|
769
|
-
if (e.includes("`")) return
|
|
770
|
-
if (e.includes("^")) return
|
|
766
|
+
if (!i) return ar(`GClass not registered: ${n}^${e}`), null;
|
|
767
|
+
if (!Hr(e)) return ar(`gobj_name must be a string: ${n}`), null;
|
|
768
|
+
if (!rl(e)) {
|
|
769
|
+
if (e.includes("`")) return ar(`gobj_name cannot contain char ': ${n}^${e}`), null;
|
|
770
|
+
if (e.includes("^")) return ar(`gobj_name cannot contain char ^: ${n}^${e}`), null;
|
|
771
771
|
}
|
|
772
772
|
let s = new I(e, i, r, l, o);
|
|
773
773
|
s.jn_attrs = Ne(s, i.attrs_table);
|
|
@@ -794,8 +794,8 @@ function it(e, t, n, r) {
|
|
|
794
794
|
return et(e, t, n, r, 0);
|
|
795
795
|
}
|
|
796
796
|
function st(e) {
|
|
797
|
-
if (Ct(e)) return void
|
|
798
|
-
e.__refs__ > 0 &&
|
|
797
|
+
if (Ct(e)) return void ar("gobj NULL or DESTROYED");
|
|
798
|
+
e.__refs__ > 0 && ar(`${Rt(e)}: gobj DESTROYING with references: ${e.__refs__}`), e.playing && (ar(`Destroying a PLAYING gobj: ${Dt(e)}`), ht(e)), e.running && (ar(`Destroying a RUNNING gobj: ${Dt(e)}`), gt(e)), e.obflag |= P.obflag_destroying, function(e) {
|
|
799
799
|
if (0 === pn.length) return;
|
|
800
800
|
for (let t of pn) t.src === e && (t.src = null);
|
|
801
801
|
pn = pn.filter((t) => t.dst !== e);
|
|
@@ -805,7 +805,7 @@ function st(e) {
|
|
|
805
805
|
let r = At(e);
|
|
806
806
|
r && r.gclass.gmt.mt_child_removed && (n && Y(t("👦👦🔴 child_removed(%s): %s", Dt(r), Rt(e))), r.gclass.gmt.mt_child_removed(r, e)), e.gobj_flag & L.gobj_flag_service && function(e) {
|
|
807
807
|
let t = jt(e);
|
|
808
|
-
t = t.toLowerCase(), m[t] ? delete m[t] :
|
|
808
|
+
t = t.toLowerCase(), m[t] ? delete m[t] : ar(`"service NOT found in register": ${t}`);
|
|
809
809
|
}(e), e === E && (E = null), kn(e, e.dl_subscriptions, !0), kn(e, e.dl_subscribings, !0), r && (Je(r, e), kt(e) && (Lt(r) !== e || Ct(r) || Pt(r, null))), function(e) {
|
|
810
810
|
let t = e.dl_children.slice();
|
|
811
811
|
for (let e = 0; e < t.length; e++) {
|
|
@@ -815,9 +815,9 @@ function st(e) {
|
|
|
815
815
|
}(e), e.obflag & P.obflag_created && e.gclass.gmt.mt_destroy && e.gclass.gmt.mt_destroy(e), n && Y(t("💔💔⏪ destroyed: %s", Dt(e))), e.obflag |= P.obflag_destroyed, e.obflag & P.obflag_created && e.gclass.instances--;
|
|
816
816
|
}
|
|
817
817
|
function at(e) {
|
|
818
|
-
if (Ct(e)) return
|
|
819
|
-
if (e.running) return
|
|
820
|
-
if (e.disabled) return
|
|
818
|
+
if (Ct(e)) return ar("gobj NULL or DESTROYED"), -1;
|
|
819
|
+
if (e.running) return ar(`${Rt(e)}: GObj ALREADY RUNNING`), -1;
|
|
820
|
+
if (e.disabled) return ar(`${Rt(e)}: GObj DISABLED`), -1;
|
|
821
821
|
re(e) && Y(t("⏺ ⏺ start: %s", Dt(e))), e.running = !0;
|
|
822
822
|
let n = 0;
|
|
823
823
|
return e.gclass.gmt.mt_start && (n = e.gclass.gmt.mt_start(e)), n;
|
|
@@ -826,18 +826,18 @@ function ut(e, t, n) {
|
|
|
826
826
|
return e.gclass.gclass_flag & C.gcflag_manual_start || Ct(e) || Et(e) || yt(e) || at(e), 0;
|
|
827
827
|
}
|
|
828
828
|
function _t(e) {
|
|
829
|
-
return Ct(e) ? (
|
|
829
|
+
return Ct(e) ? (ar("gobj NULL or DESTROYED"), -1) : Ft(e, F.WALK_FIRST2LAST, ut, 0, 0);
|
|
830
830
|
}
|
|
831
831
|
function ct(e, t, n) {
|
|
832
832
|
return e.gclass.gclass_flag & C.gcflag_manual_start || yt(e) ? 1 : (Et(e) || at(e), 0);
|
|
833
833
|
}
|
|
834
834
|
function ft(e) {
|
|
835
|
-
return Ct(e) ? (
|
|
835
|
+
return Ct(e) ? (ar("gobj NULL or DESTROYED"), -1) : (re(e) && Y(t("⏺ ⏺ ⏺ ⏺ start_tree: %s", Dt(e))), e.gclass.gclass_flag & C.gcflag_manual_start || e.disabled ? 0 : (e.running || at(e), Vt(e, F.WALK_TOP2BOTTOM, ct, 0, 0)));
|
|
836
836
|
}
|
|
837
837
|
function gt(e) {
|
|
838
|
-
if (Ct(e)) return
|
|
839
|
-
if (!e.running) return
|
|
840
|
-
e.playing && (
|
|
838
|
+
if (Ct(e)) return ar("gobj NULL or DESTROYED"), -1;
|
|
839
|
+
if (!e.running) return ar(`${Rt(e)}: GObj NOT RUNNING`), -1;
|
|
840
|
+
e.playing && (ur(`${Rt(e)}: GObj stopping without previous pause`), ht(e)), re(e) && Y(t("⏹ ⏹ stop: %s", Dt(e))), e.running = !1;
|
|
841
841
|
let n = 0;
|
|
842
842
|
return e.gclass.gmt.mt_stop && (n = e.gclass.gmt.mt_stop(e)), n;
|
|
843
843
|
}
|
|
@@ -845,25 +845,25 @@ function dt(e, t, n) {
|
|
|
845
845
|
return Et(e) && gt(e), 0;
|
|
846
846
|
}
|
|
847
847
|
function bt(e) {
|
|
848
|
-
return Ct(e) ? (
|
|
848
|
+
return Ct(e) ? (ar("gobj NULL or DESTROYED"), -1) : Ft(e, F.WALK_FIRST2LAST, dt, 0, 0);
|
|
849
849
|
}
|
|
850
850
|
function pt(e) {
|
|
851
|
-
return Ct(e) ? (
|
|
851
|
+
return Ct(e) ? (ar("gobj NULL or DESTROYED"), -1) : (re(e) && Y(t("⏹ ⏹ ⏹ ⏹ stop_tree: %s", Dt(e))), Et(e) && gt(e), Vt(e, F.WALK_TOP2BOTTOM, dt, 0, 0));
|
|
852
852
|
}
|
|
853
853
|
function mt(e) {
|
|
854
|
-
if (Ct(e)) return
|
|
855
|
-
if (e.playing) return
|
|
856
|
-
if (e.disabled) return
|
|
854
|
+
if (Ct(e)) return ar(`gobj NULL or DESTROYED: ${Rt(e)}`), -1;
|
|
855
|
+
if (e.playing) return ar(`${Rt(e)}: GObj ALREADY PLAYING`), -1;
|
|
856
|
+
if (e.disabled) return ar(`${Rt(e)}: GObj DISABLED`), -1;
|
|
857
857
|
if (!Et(e)) {
|
|
858
|
-
if (e.gclass.gclass_flag & C.gcflag_required_start_to_play) return
|
|
859
|
-
|
|
858
|
+
if (e.gclass.gclass_flag & C.gcflag_required_start_to_play) return ar(`${Rt(e)}: Cannot play, start not done`), -1;
|
|
859
|
+
ur(`${Rt(e)}: GObj playing without previous start`), at(e);
|
|
860
860
|
}
|
|
861
861
|
re(e) && Y(t("⏯ ⏯ play: %s", Dt(e))), e.playing = !0;
|
|
862
862
|
let n = 0;
|
|
863
863
|
return e.gclass.gmt.mt_play && (n = e.gclass.gmt.mt_play(e), (n < 0 || !1 === n) && (e.playing = !1)), n;
|
|
864
864
|
}
|
|
865
865
|
function ht(e) {
|
|
866
|
-
return Ct(e) ? (
|
|
866
|
+
return Ct(e) ? (ar("gobj NULL or DESTROYED"), -1) : e.playing ? (re(e) && Y(t("⏸ ⏸ pause: %s", Dt(e))), e.playing = !1, e.gclass.gmt.mt_pause ? e.gclass.gmt.mt_pause(e) : 0) : (ar(`${Rt(e)}: GObj NOT PLAYING`), -1);
|
|
867
867
|
}
|
|
868
868
|
function Et(e) {
|
|
869
869
|
return !Ct(e) && e.running;
|
|
@@ -893,50 +893,50 @@ function wt() {
|
|
|
893
893
|
return e ? tn(e, "yuno_id") : "";
|
|
894
894
|
}
|
|
895
895
|
function jt(e) {
|
|
896
|
-
return
|
|
896
|
+
return nl(e) ? e.gobj_name : (ar("gobj bad type"), null);
|
|
897
897
|
}
|
|
898
898
|
function $t(e) {
|
|
899
|
-
return
|
|
899
|
+
return nl(e) ? e.gclass.gclass_name : (ar("gobj NULL of bad type"), null);
|
|
900
900
|
}
|
|
901
901
|
function Rt(e) {
|
|
902
|
-
return
|
|
902
|
+
return nl(e) ? e.gclass.gclass_name + "^" + jt(e) : (ar("gobj bad type"), null);
|
|
903
903
|
}
|
|
904
904
|
function Dt(e) {
|
|
905
|
-
if (!
|
|
905
|
+
if (!nl(e)) return ar("gobj NULL of bad type"), null;
|
|
906
906
|
let t = Rt(e), n = At(e);
|
|
907
907
|
for (; n;) t = Rt(n) + "`" + t, n = At(n);
|
|
908
908
|
return t;
|
|
909
909
|
}
|
|
910
910
|
function At(e) {
|
|
911
|
-
return
|
|
911
|
+
return nl(e) ? e.parent : (ar("gobj NULL of bad type"), null);
|
|
912
912
|
}
|
|
913
913
|
function kt(e) {
|
|
914
|
-
return
|
|
914
|
+
return nl(e) ? !!(e.gobj_flag & L.gobj_flag_volatil) : (ar("gobj NULL of bad type"), null);
|
|
915
915
|
}
|
|
916
916
|
function It(e) {
|
|
917
|
-
return
|
|
917
|
+
return nl(e) ? !!(e.gobj_flag & L.gobj_flag_pure_child) : (ar("gobj NULL of bad type"), null);
|
|
918
918
|
}
|
|
919
919
|
function Ct(e) {
|
|
920
|
-
return !
|
|
920
|
+
return !nl(e) || !!(e.obflag & (P.obflag_destroyed | P.obflag_destroying));
|
|
921
921
|
}
|
|
922
922
|
function Lt(e) {
|
|
923
|
-
return
|
|
923
|
+
return nl(e) ? e.bottom_gobj : (ar("gobj NULL of bad type"), null);
|
|
924
924
|
}
|
|
925
925
|
function Pt(e, t) {
|
|
926
|
-
if (!
|
|
927
|
-
e.bottom_gobj && t &&
|
|
926
|
+
if (!nl(e)) return ar("gobj NULL of bad type"), null;
|
|
927
|
+
e.bottom_gobj && t && ur(`${Rt(e)}: bottom_gobj already set`), e.bottom_gobj = t;
|
|
928
928
|
}
|
|
929
929
|
function Ut(e, t, n) {
|
|
930
|
-
return
|
|
930
|
+
return nl(e) ? t ? De(e.gclass, t, n) : e.gclass.attrs_table : (ar("gobj NULL of bad type"), null);
|
|
931
931
|
}
|
|
932
932
|
function Ft(e, t, n, r, l) {
|
|
933
|
-
return Ct(e) ? (
|
|
933
|
+
return Ct(e) ? (ar("gobj NULL, destroying, or bad type"), 0) : Mt(e.dl_children, t, n, r, l);
|
|
934
934
|
}
|
|
935
935
|
function Vt(e, t, n, r, l) {
|
|
936
|
-
return Ct(e) ? (
|
|
936
|
+
return Ct(e) ? (ar("gobj NULL, destroying, or bad type"), 0) : xt(e.dl_children, t, n, r, l);
|
|
937
937
|
}
|
|
938
938
|
function Gt(e) {
|
|
939
|
-
return "number" == typeof e && isFinite(e) ? e : (null == e ||
|
|
939
|
+
return "number" == typeof e && isFinite(e) ? e : (null == e || ar(`walk callback must return a NUMBER (-1 stop, 0 descend, >0 skip children), got ${typeof e}: taken as 0`), 0);
|
|
940
940
|
}
|
|
941
941
|
function Mt(e, t, n, r, l) {
|
|
942
942
|
let o, i = [...e];
|
|
@@ -974,12 +974,12 @@ function xt(e, t, n, r, l) {
|
|
|
974
974
|
return 0;
|
|
975
975
|
}
|
|
976
976
|
function Kt(e, t) {
|
|
977
|
-
if (
|
|
977
|
+
if (rl(t)) return null;
|
|
978
978
|
const n = t.toLowerCase();
|
|
979
979
|
return "__default_service__" === n ? E : "__yuno__" === n || "__root__" === n ? h : Ht(h, t);
|
|
980
980
|
}
|
|
981
981
|
function Yt(e, t) {
|
|
982
|
-
if (!
|
|
982
|
+
if (!nl(e)) return ar("gobj NULL of bad type"), !1;
|
|
983
983
|
let n = t.__gclass_name__, r = t.__gobj_name__, l = t.__prefix_gobj_name__;
|
|
984
984
|
t.__disabled__;
|
|
985
985
|
let o = t.__state__;
|
|
@@ -995,7 +995,7 @@ function Yt(e, t) {
|
|
|
995
995
|
return !0;
|
|
996
996
|
}
|
|
997
997
|
function Bt(e, t) {
|
|
998
|
-
if (Ct(e)) return
|
|
998
|
+
if (Ct(e)) return ar("gobj NULL or DESTROYED"), null;
|
|
999
999
|
const n = e.dl_children;
|
|
1000
1000
|
for (let e = 0; e < n.length; e++) {
|
|
1001
1001
|
const r = n[e];
|
|
@@ -1004,7 +1004,7 @@ function Bt(e, t) {
|
|
|
1004
1004
|
return null;
|
|
1005
1005
|
}
|
|
1006
1006
|
function Jt(e, t) {
|
|
1007
|
-
if (Ct(e)) return
|
|
1007
|
+
if (Ct(e)) return ar("gobj NULL or DESTROYED"), null;
|
|
1008
1008
|
t = t || {};
|
|
1009
1009
|
let n = [];
|
|
1010
1010
|
const r = e.dl_children;
|
|
@@ -1045,7 +1045,7 @@ function Ht(e, t) {
|
|
|
1045
1045
|
return o ? (n.splice(0, 1), n = n.join("`"), Ht(o, n)) : null;
|
|
1046
1046
|
}
|
|
1047
1047
|
function zt(e, t) {
|
|
1048
|
-
return !
|
|
1048
|
+
return !rl(t) && !!De(e.gclass, t, !1);
|
|
1049
1049
|
}
|
|
1050
1050
|
function Qt(e, t, n) {
|
|
1051
1051
|
let r = e.jn_attrs;
|
|
@@ -1053,7 +1053,7 @@ function Qt(e, t, n) {
|
|
|
1053
1053
|
let n = r[t];
|
|
1054
1054
|
return e.gclass.gmt.mt_reading ? e.gclass.gmt.mt_reading(e, t, n) : n;
|
|
1055
1055
|
}
|
|
1056
|
-
return
|
|
1056
|
+
return ar(`${Rt(e)}: GClass Attribute NOT FOUND, attr ${t}`), null;
|
|
1057
1057
|
}
|
|
1058
1058
|
function Xt(e, t, n) {
|
|
1059
1059
|
let r = {}, l = e.gclass.attrs_table;
|
|
@@ -1061,41 +1061,41 @@ function Xt(e, t, n) {
|
|
|
1061
1061
|
const o = l[n];
|
|
1062
1062
|
if (o.name && (-1 === t || o.flag & t)) {
|
|
1063
1063
|
let t;
|
|
1064
|
-
!e.gclass.gmt.mt_reading || e.obflag & P.obflag_destroyed ? t =
|
|
1064
|
+
!e.gclass.gmt.mt_reading || e.obflag & P.obflag_destroyed ? t = Lr(e.jn_attrs, o.name) : (t = e.gclass.gmt.mt_reading(e, o.name), void 0 === t && (t = Lr(e.jn_attrs, o.name))), Ur(r, o.name, t);
|
|
1065
1065
|
}
|
|
1066
1066
|
}
|
|
1067
1067
|
return r;
|
|
1068
1068
|
}
|
|
1069
1069
|
function Zt(e, t) {
|
|
1070
1070
|
if (t) {
|
|
1071
|
-
if (0 ===
|
|
1072
|
-
if (0 ===
|
|
1073
|
-
if (0 ===
|
|
1074
|
-
if (0 ===
|
|
1071
|
+
if (0 === sl(t, "__disabled__")) return yt(e);
|
|
1072
|
+
if (0 === sl(t, "__running__")) return Et(e);
|
|
1073
|
+
if (0 === sl(t, "__playing__")) return vt(e);
|
|
1074
|
+
if (0 === sl(t, "__service__")) return Tt(e);
|
|
1075
1075
|
}
|
|
1076
1076
|
let n = Re(e, t, !1);
|
|
1077
|
-
return n ? !e.gclass.gmt.mt_reading || e.obflag & P.obflag_destroyed ?
|
|
1077
|
+
return n ? !e.gclass.gmt.mt_reading || e.obflag & P.obflag_destroyed ? Lr(n, t) : e.gclass.gmt.mt_reading(e, t) : (ar(`${Rt(e)}: GClass Attribute NOT FOUND, attr ${t}`), 0);
|
|
1078
1078
|
}
|
|
1079
1079
|
function en(e, t) {
|
|
1080
|
-
t &&
|
|
1080
|
+
t && sl(t, "__trace_level__");
|
|
1081
1081
|
let n = Re(e, t, !1);
|
|
1082
|
-
return n ? !e.gclass.gmt.mt_reading || e.obflag & P.obflag_destroyed ?
|
|
1082
|
+
return n ? !e.gclass.gmt.mt_reading || e.obflag & P.obflag_destroyed ? Lr(n, t) : e.gclass.gmt.mt_reading(e, t) : (ar(`${Rt(e)}: GClass Attribute NOT FOUND, attr ${t}`), 0);
|
|
1083
1083
|
}
|
|
1084
1084
|
function tn(e, t) {
|
|
1085
|
-
if (t && 0 ===
|
|
1085
|
+
if (t && 0 === sl(t, "__state__")) return cn(e);
|
|
1086
1086
|
let n = Re(e, t, !1);
|
|
1087
|
-
return n ? !e.gclass.gmt.mt_reading || e.obflag & P.obflag_destroyed ?
|
|
1087
|
+
return n ? !e.gclass.gmt.mt_reading || e.obflag & P.obflag_destroyed ? Lr(n, t) : e.gclass.gmt.mt_reading(e, t) : (ar(`${Rt(e)}: GClass Attribute NOT FOUND, attr ${t}`), 0);
|
|
1088
1088
|
}
|
|
1089
1089
|
function nn(e, t) {
|
|
1090
1090
|
let n = Re(e, t, !1);
|
|
1091
|
-
return n ? !e.gclass.gmt.mt_reading || e.obflag & P.obflag_destroyed ?
|
|
1091
|
+
return n ? !e.gclass.gmt.mt_reading || e.obflag & P.obflag_destroyed ? Lr(n, t) : e.gclass.gmt.mt_reading(e, t) : (ar(`${Rt(e)}: GClass Attribute NOT FOUND, attr ${t}`), 0);
|
|
1092
1092
|
}
|
|
1093
1093
|
function rn(e, n, r, l) {
|
|
1094
|
-
if (!
|
|
1094
|
+
if (!Hr(n)) return ar(t("gobj_write_attr(%s): path must be a string", Rt(e))), -1;
|
|
1095
1095
|
let o, i = e.jn_attrs, s = n.split("`");
|
|
1096
1096
|
if (s.length <= 1) {
|
|
1097
1097
|
let l = n;
|
|
1098
|
-
return l in i && Object.prototype.hasOwnProperty.call(i, l) ? (i[l] = r,
|
|
1098
|
+
return l in i && Object.prototype.hasOwnProperty.call(i, l) ? (i[l] = r, Jr(e.priv) && Object.prototype.hasOwnProperty.call(e.priv, l) && (e.priv[l] = r), e.obflag & P.obflag_created && !(e.obflag & P.obflag_destroyed) && e.gclass.gmt.mt_writing && e.gclass.gmt.mt_writing(e, l), 0) : (ar(t("gobj_write_attr(%s): attr not found '%s'", Rt(e), l)), -1);
|
|
1099
1099
|
}
|
|
1100
1100
|
let a = s.length;
|
|
1101
1101
|
for (let t = 0; t < a; t++) {
|
|
@@ -1106,18 +1106,18 @@ function rn(e, n, r, l) {
|
|
|
1106
1106
|
continue;
|
|
1107
1107
|
}
|
|
1108
1108
|
let l = e.jn_attrs;
|
|
1109
|
-
if (o in l && Object.prototype.hasOwnProperty.call(l, o)) return l[o] = r,
|
|
1109
|
+
if (o in l && Object.prototype.hasOwnProperty.call(l, o)) return l[o] = r, Jr(e.priv) && Object.prototype.hasOwnProperty.call(e.priv, o) && (e.priv[o] = r), e.obflag & P.obflag_created && !(e.obflag & P.obflag_destroyed) && e.gclass.gmt.mt_writing && e.gclass.gmt.mt_writing(e, o), 0;
|
|
1110
1110
|
break;
|
|
1111
1111
|
}
|
|
1112
|
-
return
|
|
1112
|
+
return ar(t("gobj_write_attr(%s): attr not found '%s'", Rt(e), o)), -1;
|
|
1113
1113
|
}
|
|
1114
1114
|
function ln(e) {
|
|
1115
1115
|
return function(e, t, n) {
|
|
1116
|
-
if (Ct(e)) return
|
|
1116
|
+
if (Ct(e)) return ar("gobj NULL or DESTROYED"), -1;
|
|
1117
1117
|
let r = e.gclass.attrs_table;
|
|
1118
1118
|
for (let l = 0; l < r.length; l++) {
|
|
1119
1119
|
const o = r[l];
|
|
1120
|
-
o.name && (n && o.flag & n || (-1 === t || o.flag & t) && (we(e, e.jn_attrs, o),
|
|
1120
|
+
o.name && (n && o.flag & n || (-1 === t || o.flag & t) && (we(e, e.jn_attrs, o), Jr(e.priv) && Object.prototype.hasOwnProperty.call(e.priv, o.name) && (e.priv[o.name] = e.jn_attrs[o.name]), e.gclass.gmt.mt_writing && e.gclass.gmt.mt_writing(e, o.name)));
|
|
1121
1121
|
}
|
|
1122
1122
|
return 0;
|
|
1123
1123
|
}(e, v.SDF_VOLATIL, 0);
|
|
@@ -1132,21 +1132,21 @@ function on(e, t, n, r) {
|
|
|
1132
1132
|
}
|
|
1133
1133
|
function sn(e, t, n) {
|
|
1134
1134
|
let r = Re(e, t, !1);
|
|
1135
|
-
return r ? (r[t] =
|
|
1135
|
+
return r ? (r[t] = ll(n), Jr(e.priv) && Object.prototype.hasOwnProperty.call(e.priv, t) && (e.priv[t] = r[t]), e.obflag & P.obflag_created && !(e.obflag & P.obflag_destroyed) && e.gclass.gmt.mt_writing && e.gclass.gmt.mt_writing(e, t), 0) : (ar(`${Rt(e)}: GClass Attribute NOT FOUND, attr ${t}`), -1);
|
|
1136
1136
|
}
|
|
1137
1137
|
function an(e, t, n) {
|
|
1138
1138
|
let r = Re(e, t, !1);
|
|
1139
|
-
return r ? (r[t] = parseInt(n),
|
|
1139
|
+
return r ? (r[t] = parseInt(n), Jr(e.priv) && Object.prototype.hasOwnProperty.call(e.priv, t) && (e.priv[t] = r[t]), e.obflag & P.obflag_created && !(e.obflag & P.obflag_destroyed) && e.gclass.gmt.mt_writing && e.gclass.gmt.mt_writing(e, t), 0) : (ar(`${Rt(e)}: GClass Attribute NOT FOUND, attr ${t}`), -1);
|
|
1140
1140
|
}
|
|
1141
1141
|
function un(e, t, n) {
|
|
1142
1142
|
let r = Re(e, t, !1);
|
|
1143
|
-
return r ? (r[t] = String(n),
|
|
1143
|
+
return r ? (r[t] = String(n), Jr(e.priv) && Object.prototype.hasOwnProperty.call(e.priv, t) && (e.priv[t] = r[t]), e.obflag & P.obflag_created && !(e.obflag & P.obflag_destroyed) && e.gclass.gmt.mt_writing && e.gclass.gmt.mt_writing(e, t), 0) : (ar(`${Rt(e)}: GClass Attribute NOT FOUND, attr ${t}`), -1);
|
|
1144
1144
|
}
|
|
1145
1145
|
function _n(e, n) {
|
|
1146
|
-
if (Ct(e)) return
|
|
1146
|
+
if (Ct(e)) return ar("gobj NULL or DESTROYED"), null;
|
|
1147
1147
|
if (e.current_state.state_name === n) return !1;
|
|
1148
1148
|
let r = Ie(e.gclass, n);
|
|
1149
|
-
if (!r) return
|
|
1149
|
+
if (!r) return ar(`${Rt(e)}: state unknown, state ${n}`), !1;
|
|
1150
1150
|
e.last_state = e.current_state, e.current_state = r;
|
|
1151
1151
|
let l = oe(e, "EV_STATE_CHANGED"), o = !!function(e) {
|
|
1152
1152
|
return Z(e) & B.TRACE_STATES;
|
|
@@ -1154,13 +1154,13 @@ function _n(e, n) {
|
|
|
1154
1154
|
return (l || o) && (1 === W || Y(t("🔀🔀 mach(%s%s^%s), new st(%s), prev st(%s)", e.running ? "" : "!!", $t(e), jt(e), cn(e), e.last_state.state_name))), !0;
|
|
1155
1155
|
}
|
|
1156
1156
|
function cn(e) {
|
|
1157
|
-
return
|
|
1157
|
+
return nl(e) ? e.current_state.state_name : (ar("hgobj NULL"), "");
|
|
1158
1158
|
}
|
|
1159
1159
|
function fn(e, n) {
|
|
1160
|
-
return Ct(e) ? (
|
|
1160
|
+
return Ct(e) ? (ar("gobj NULL or DESTROYED"), null) : n instanceof I ? (e.parent && e.parent.gclass.gmt.mt_child_removed && e.parent.gclass.gmt.mt_child_removed(e.parent, e), e.parent && (Je(e.parent, e), e.parent = null), Be(n, e), n.gclass.gmt.mt_child_added && (te(e) && cr(t("👦👦🔵 child_added(%s): %s", Dt(n), Rt(e))), n.gclass.gmt.mt_child_added(n, e)), 0) : (ar(`${Rt(e)}: gobj_change_parent() BAD TYPE of parent`), -1);
|
|
1161
1161
|
}
|
|
1162
1162
|
function gn(e, t, n) {
|
|
1163
|
-
if (!
|
|
1163
|
+
if (!nl(e)) return ar("gobj NULL of bad type"), null;
|
|
1164
1164
|
let r = Ve(e.gclass, t);
|
|
1165
1165
|
if (r) return r;
|
|
1166
1166
|
if (n) {
|
|
@@ -1182,12 +1182,12 @@ function bn(e, t, n) {
|
|
|
1182
1182
|
}
|
|
1183
1183
|
var pn = [], mn = !1;
|
|
1184
1184
|
function hn(e, n, r, l) {
|
|
1185
|
-
return e && e instanceof I ? e.obflag & (P.obflag_destroyed | P.obflag_destroying) ? (
|
|
1185
|
+
return e && e instanceof I ? e.obflag & (P.obflag_destroyed | P.obflag_destroying) ? (ar(`gobj_post_event(): gobj dst DESTROYING, event ${n}`), -1) : rl(n) ? (ar("gobj_post_event(): event EMPTY"), -1) : dn(e, n, 0) ? pn.length >= 1e4 ? (ar(`gobj_post_event(): too many posted events, this is NOT a work queue, event ${n}, pending ${pn.length}`), -1) : (pn.push({
|
|
1186
1186
|
dst: e,
|
|
1187
1187
|
event: n,
|
|
1188
1188
|
kw: r,
|
|
1189
1189
|
src: l
|
|
1190
|
-
}), oe(e, n) && !ie(l, n) && Y(t("📬 posted(%s%s), ev: %s, pending: %d", e.running ? "" : "!!", Rt(e), n, pn.length)), mn || (mn = !0, setTimeout(yn, 0)), 0) : (
|
|
1190
|
+
}), oe(e, n) && !ie(l, n) && Y(t("📬 posted(%s%s), ev: %s, pending: %d", e.running ? "" : "!!", Rt(e), n, pn.length)), mn || (mn = !0, setTimeout(yn, 0)), 0) : (ar(`gobj_post_event(): event NOT DEFINED in gclass ${$t(e)}, event ${n}`), -1) : (ar(`gobj_post_event(): gobj dst NULL, event ${n}`), -1);
|
|
1191
1191
|
}
|
|
1192
1192
|
function En() {
|
|
1193
1193
|
return pn.length;
|
|
@@ -1211,21 +1211,21 @@ function yn() {
|
|
|
1211
1211
|
return pn.length > 0 && !mn && (mn = !0, setTimeout(yn, 0)), t;
|
|
1212
1212
|
}
|
|
1213
1213
|
function Tn(e, n, r, l) {
|
|
1214
|
-
if (!(e && e instanceof I)) return
|
|
1215
|
-
if (e.obflag & (P.obflag_destroyed | P.obflag_destroying)) return
|
|
1214
|
+
if (!(e && e instanceof I)) return ar("gobj dst NULL"), -1;
|
|
1215
|
+
if (e.obflag & (P.obflag_destroyed | P.obflag_destroying)) return ar("gobj dst DESTROYED"), -1;
|
|
1216
1216
|
let o = e.current_state;
|
|
1217
|
-
if (!o) return
|
|
1217
|
+
if (!o) return ar(`${Rt(e)}: current_state NULL`), -1;
|
|
1218
1218
|
let i = oe(e, n) && !ie(l, n);
|
|
1219
1219
|
y++;
|
|
1220
1220
|
let s = Ce(o, n);
|
|
1221
|
-
if (!s) return e.gclass.gmt.mt_inject_event ? (y--, i && (Y(1 === W ? t("🔜 %s %s%s %s", n || "", e.running ? "" : "!!", Rt(e), o.state_name) : t("🔃 mach(%s%s), st: %s, ev: %s, from(%s%s)", e.running ? "" : "!!", Rt(e), o.state_name, n || "", l && !l.running ? "!!" : "", Rt(l))), r && le(e) &&
|
|
1221
|
+
if (!s) return e.gclass.gmt.mt_inject_event ? (y--, i && (Y(1 === W ? t("🔜 %s %s%s %s", n || "", e.running ? "" : "!!", Rt(e), o.state_name) : t("🔃 mach(%s%s), st: %s, ev: %s, from(%s%s)", e.running ? "" : "!!", Rt(e), o.state_name, n || "", l && !l.running ? "!!" : "", Rt(l))), r && le(e) && xr(r) && $r(r)), e.gclass.gmt.mt_inject_event(e, n, r, l)) : (i && Y(t("📛 mach(%s%s^%s), st: %s, ev: %s, 📛📛ERROR Event NOT DEFINED in state📛📛, from(%s%s^%s)", e.running ? "" : "!!", $t(e), jt(e), o.state_name, n || "", l && !l.running ? "!!" : "", $t(l), jt(l))), ar(`📛📛 Event NOT DEFINED in state 📛📛: ${Rt(e)}, ${o.state_name}, ${n}`), y--, -1);
|
|
1222
1222
|
if (i) {
|
|
1223
1223
|
if (1 === W) Y(t("🔄 %s %s%s %s from %s%s", n || "", e.running ? "" : "!!", Rt(e), o.state_name, l && !l.running ? "!!" : "", Rt(l)));
|
|
1224
1224
|
else {
|
|
1225
1225
|
let r = "";
|
|
1226
|
-
s.action && (r =
|
|
1226
|
+
s.action && (r = Uo(s.action)), Y(t("🔄 mach(%s%s^%s), st: %s, ev: %s%s%s, ac: %s, from(%s%s^%s)", e.running ? "" : "!!", $t(e), jt(e), o.state_name, "", n || "", "", r, l && !l.running ? "!!" : "", $t(l), jt(l)));
|
|
1227
1227
|
}
|
|
1228
|
-
r && le(e) &&
|
|
1228
|
+
r && le(e) && xr(r) && $r(r);
|
|
1229
1229
|
}
|
|
1230
1230
|
s.next_state && _n(e, s.next_state);
|
|
1231
1231
|
let a = -1;
|
|
@@ -1233,14 +1233,14 @@ function Tn(e, n, r, l) {
|
|
|
1233
1233
|
s.action && (a = s.action(e, n, r, l));
|
|
1234
1234
|
} catch (t) {
|
|
1235
1235
|
if (y--, !t || !t.__gobj_logged__) {
|
|
1236
|
-
|
|
1236
|
+
ar(`${Rt(e)}: action of ${n} in ${o.state_name} THREW: ${t && t.stack ? t.stack : t}`);
|
|
1237
1237
|
try {
|
|
1238
1238
|
t.__gobj_logged__ = !0;
|
|
1239
1239
|
} catch (e) {}
|
|
1240
1240
|
}
|
|
1241
1241
|
throw t;
|
|
1242
1242
|
}
|
|
1243
|
-
return !i || 1 === W || e.obflag & P.obflag_destroyed || Y(t("<- mach(%s%s^%s), st: %s, ev: %s, ret: %d", e.running ? "" : "!!", $t(e), jt(e), e.current_state.state_name, n || "",
|
|
1243
|
+
return !i || 1 === W || e.obflag & P.obflag_destroyed || Y(t("<- mach(%s%s^%s), st: %s, ev: %s, ret: %d", e.running ? "" : "!!", $t(e), jt(e), e.current_state.state_name, n || "", zr(a) ? a : 0)), y--, a;
|
|
1244
1244
|
}
|
|
1245
1245
|
var vn = Object.freeze({
|
|
1246
1246
|
__rename_event_name__: 1,
|
|
@@ -1273,35 +1273,35 @@ var Sn = [
|
|
|
1273
1273
|
];
|
|
1274
1274
|
function Nn(e, t) {
|
|
1275
1275
|
let n = e ? e.__config__ : null;
|
|
1276
|
-
if (!
|
|
1276
|
+
if (!Jr(n) || !gl(n, "__hard_subscription__") && !gl(n, "__own_event__") && !gl(n, "__rename_event_name__")) return {
|
|
1277
1277
|
kw: e,
|
|
1278
1278
|
renamed_event: ""
|
|
1279
1279
|
};
|
|
1280
|
-
let r =
|
|
1280
|
+
let r = kr({}, e), l = kr({}, n);
|
|
1281
1281
|
r.__config__ = l;
|
|
1282
|
-
let o = "", i = l.__rename_event_name__, s = "string" != typeof i ||
|
|
1283
|
-
return s && (o = s.event_name, delete l.__rename_event_name__, t &&
|
|
1282
|
+
let o = "", i = l.__rename_event_name__, s = "string" != typeof i || rl(i) ? null : On(i);
|
|
1283
|
+
return s && (o = s.event_name, delete l.__rename_event_name__, t && Yr(r.__global__) > 0 && (r.__global__ = kr(kr({}, r.__global__), { __original_event_name__: t }))), delete l.__hard_subscription__, delete l.__own_event__, {
|
|
1284
1284
|
kw: r,
|
|
1285
1285
|
renamed_event: o
|
|
1286
1286
|
};
|
|
1287
1287
|
}
|
|
1288
1288
|
function wn(e, t, n, r, l, o) {
|
|
1289
|
-
let i =
|
|
1290
|
-
if (t && t !==
|
|
1291
|
-
let t =
|
|
1292
|
-
|
|
1289
|
+
let i = Sl(t, l, "__config__", null), s = Sl(t, l, "__global__", null), a = Sl(t, l, "__local__", null), u = Nl(t, l, "__filter__", null), _ = !0;
|
|
1290
|
+
if (t && t !== Ol(null, e, "publisher", null) && (_ = !1), o && o !== Ol(null, e, "subscriber", null) && (_ = !1), n && n !== vl(null, e, "event", "") && (_ = !1), r && r !== vl(null, e, "renamed_event", "") && (_ = !1), Yr(i) > 0) {
|
|
1291
|
+
let t = Sl(null, e, "__config__", null);
|
|
1292
|
+
Yr(t) > 0 && Ar(t, i) || (_ = !1);
|
|
1293
1293
|
}
|
|
1294
|
-
if (
|
|
1295
|
-
let t =
|
|
1296
|
-
|
|
1294
|
+
if (Yr(s) > 0) {
|
|
1295
|
+
let t = Sl(null, e, "__global__", null);
|
|
1296
|
+
Yr(t) > 0 && Ar(t, s) || (_ = !1);
|
|
1297
1297
|
}
|
|
1298
|
-
if (
|
|
1299
|
-
let t =
|
|
1300
|
-
|
|
1298
|
+
if (Yr(a) > 0) {
|
|
1299
|
+
let t = Sl(null, e, "__local__", null);
|
|
1300
|
+
Yr(t) > 0 && Ar(t, a) || (_ = !1);
|
|
1301
1301
|
}
|
|
1302
|
-
if (
|
|
1303
|
-
let t =
|
|
1304
|
-
|
|
1302
|
+
if (Yr(u) > 0) {
|
|
1303
|
+
let t = Nl(null, e, "__filter__", null);
|
|
1304
|
+
Yr(t) > 0 && Ar(t, u) || (_ = !1);
|
|
1305
1305
|
}
|
|
1306
1306
|
return _;
|
|
1307
1307
|
}
|
|
@@ -1309,7 +1309,7 @@ function jn(e, t, n, r, l, o) {
|
|
|
1309
1309
|
let i = [];
|
|
1310
1310
|
for (let s = 0; s < e.length; s++) {
|
|
1311
1311
|
let a = e[s];
|
|
1312
|
-
wn(a, t, n, r, l, o) &&
|
|
1312
|
+
wn(a, t, n, r, l, o) && Vr(i, a);
|
|
1313
1313
|
}
|
|
1314
1314
|
return i;
|
|
1315
1315
|
}
|
|
@@ -1317,17 +1317,17 @@ function $n(e, t) {
|
|
|
1317
1317
|
return e.indexOf(t);
|
|
1318
1318
|
}
|
|
1319
1319
|
function Rn(e, n, r, l) {
|
|
1320
|
-
let o =
|
|
1321
|
-
if (!!(
|
|
1320
|
+
let o = Ol(e, n, "publisher", null, Vn.KW_REQUIRED), i = Ol(e, n, "subscriber", null, Vn.KW_REQUIRED), s = vl(e, n, "event", "", Vn.KW_REQUIRED);
|
|
1321
|
+
if (!!(yl(e, n, "subs_flag", null, Vn.KW_REQUIRED) & vn.__hard_subscription__) && !r) return -1;
|
|
1322
1322
|
let a = ne(i) || ne(o);
|
|
1323
1323
|
if ($n(o.dl_subscriptions, n) < 0) return a && Y(t("💜💜👎 unsubscribing event '%s': publisher %s, subscriber'%s', ALREADY REMOVED", s || "", Rt(o), Rt(i))), 1;
|
|
1324
|
-
a && (Y(t("💜💜👎 unsubscribing event '%s': publisher %s, subscriber'%s'", s || "", Rt(o), Rt(i))),
|
|
1324
|
+
a && (Y(t("💜💜👎 unsubscribing event '%s': publisher %s, subscriber'%s'", s || "", Rt(o), Rt(i))), gr(n)), o.obflag & P.obflag_destroyed || l || o.gclass.gmt.mt_subscription_deleted && o.gclass.gmt.mt_subscription_deleted(o, n);
|
|
1325
1325
|
let u = $n(o.dl_subscriptions, n);
|
|
1326
|
-
return u >= 0 ?
|
|
1326
|
+
return u >= 0 ? Mr(o.dl_subscriptions, u) : (ar(`${Rt(e)}: subscription in publisher not found`), gr(n)), u = $n(i.dl_subscribings, n), u >= 0 ? Mr(i.dl_subscribings, u) : (ar(`${Rt(e)}: subscription in subscriber not found`), gr(n)), 0;
|
|
1327
1327
|
}
|
|
1328
1328
|
function Dn(e, n, r, l) {
|
|
1329
|
-
if (null == r && (r = {}), !e) return
|
|
1330
|
-
if (!l) return
|
|
1329
|
+
if (null == r && (r = {}), !e) return ar(`publisher NULL: ev ${n}`), 0;
|
|
1330
|
+
if (!l) return ar(`subscriber NULL: ev ${n}`), 0;
|
|
1331
1331
|
const o = /* @__PURE__ */ new Set([
|
|
1332
1332
|
"__config__",
|
|
1333
1333
|
"__global__",
|
|
@@ -1336,57 +1336,57 @@ function Dn(e, n, r, l) {
|
|
|
1336
1336
|
"__service__"
|
|
1337
1337
|
]);
|
|
1338
1338
|
if (Object.keys(r).forEach((t) => {
|
|
1339
|
-
o.has(t) ||
|
|
1340
|
-
}),
|
|
1341
|
-
else if (!(bn(e, n, U.EVF_OUTPUT_EVENT) || e.gclass.gclass_flag & C.gcflag_no_check_output_events)) return
|
|
1339
|
+
o.has(t) || ar(`${Rt(e)}: key ignored in subscription (key: ${t}, event: ${n})`);
|
|
1340
|
+
}), rl(n)) n = "";
|
|
1341
|
+
else if (!(bn(e, n, U.EVF_OUTPUT_EVENT) || e.gclass.gclass_flag & C.gcflag_no_check_output_events)) return ar(`event NOT in output event list: ${Rt(e)}, ${n}`), 0;
|
|
1342
1342
|
let i = Nn(r, n), s = jn(e.dl_subscriptions, e, n, i.renamed_event, i.kw, l), a = null;
|
|
1343
|
-
for (let t = 0; t < s.length; t++) if (
|
|
1343
|
+
for (let t = 0; t < s.length; t++) if (yl(e, s[t], "subs_flag", 0, Vn.KW_REQUIRED) & vn.__hard_subscription__) {
|
|
1344
1344
|
a = s[t];
|
|
1345
1345
|
break;
|
|
1346
1346
|
}
|
|
1347
|
-
if (a) return
|
|
1348
|
-
|
|
1347
|
+
if (a) return ur(`${Rt(e)}: Hard subscription REPEATED, the one there is kept and returned (event: ${n}, subscriber: ${Rt(l)})`), a;
|
|
1348
|
+
Kr(s) > 0 && (ar(`${Rt(e)}: ${Kr(s)} subscription(s) REPEATED, will be deleted and override`), gr(s, "subscription REPEATED"), kn(e, s, !1));
|
|
1349
1349
|
let u = function(e, t, n, r) {
|
|
1350
1350
|
let l = Ne(e, Sn);
|
|
1351
|
-
|
|
1351
|
+
Fr(l, "event", t), Fr(l, "subscriber", r), Fr(l, "publisher", e);
|
|
1352
1352
|
let o = 0;
|
|
1353
1353
|
if (n) {
|
|
1354
|
-
let r =
|
|
1355
|
-
if (
|
|
1356
|
-
let n =
|
|
1357
|
-
|
|
1358
|
-
let i =
|
|
1359
|
-
if (!
|
|
1354
|
+
let r = Sl(e, n, "__config__", null), i = Sl(e, n, "__global__", null), s = Sl(e, n, "__local__", null), a = Nl(e, n, "__filter__", null), u = vl(e, n, "__service__", "");
|
|
1355
|
+
if (Yr(i) > 0 && Fr(l, "__global__", Rr(i)), Yr(r) > 0) {
|
|
1356
|
+
let n = Rr(r);
|
|
1357
|
+
Fr(l, "__config__", n);
|
|
1358
|
+
let i = vl(e, n, "__rename_event_name__", "");
|
|
1359
|
+
if (!rl(i)) {
|
|
1360
1360
|
let r = On(i);
|
|
1361
1361
|
if (r) {
|
|
1362
|
-
|
|
1363
|
-
let i =
|
|
1364
|
-
|
|
1365
|
-
} else
|
|
1362
|
+
Fr(l, "renamed_event", r.event_name), delete n.__rename_event_name__, o |= vn.__rename_event_name__;
|
|
1363
|
+
let i = Sl(e, l, "__global__", null);
|
|
1364
|
+
Jr(i) || (i = {}, Fr(l, "__global__", i)), i.__original_event_name__ = t;
|
|
1365
|
+
} else ar(`${Rt(e)}: EVENT NOT FOUND (__rename_event_name__: ${i})`);
|
|
1366
1366
|
}
|
|
1367
|
-
if (
|
|
1368
|
-
let t =
|
|
1369
|
-
|
|
1367
|
+
if (gl(n, "__hard_subscription__")) {
|
|
1368
|
+
let t = El(e, n, "__hard_subscription__", !1);
|
|
1369
|
+
Pr(n, "__hard_subscription__"), t && (o |= vn.__hard_subscription__);
|
|
1370
1370
|
}
|
|
1371
|
-
if (
|
|
1372
|
-
let t =
|
|
1373
|
-
|
|
1371
|
+
if (gl(n, "__own_event__")) {
|
|
1372
|
+
let t = El(e, n, "__own_event__", !1);
|
|
1373
|
+
Pr(n, "__own_event__"), t && (o |= vn.__own_event__);
|
|
1374
1374
|
}
|
|
1375
1375
|
}
|
|
1376
|
-
|
|
1376
|
+
Yr(s) > 0 && Fr(l, "__local__", Rr(s)), Yr(a) > 0 && Fr(l, "__filter__", Rr(a)), rl(u) || Fr(l, "__service__", u);
|
|
1377
1377
|
}
|
|
1378
|
-
return
|
|
1378
|
+
return Fr(l, "subs_flag", o), l;
|
|
1379
1379
|
}(e, n, r, l);
|
|
1380
|
-
if (!u) return
|
|
1381
|
-
if (
|
|
1380
|
+
if (!u) return ar(`${Rt(e)}: _create_subscription() FAILED`), 0;
|
|
1381
|
+
if (Vr(e.dl_subscriptions, u), Vr(l.dl_subscribings, u), (ne(l) || ne(e)) && (Y(t("💜💜👍 subscribing event '%s', publisher '%s', subscriber %s", n || "", Rt(e), Rt(l))), r && (le(l) || le(e)) && $r(r)), e.gclass.gmt.mt_subscription_added) {
|
|
1382
1382
|
let t = e.gclass.gmt.mt_subscription_added(e, u);
|
|
1383
1383
|
(t < 0 || !1 === t) && (Rn(e, u, !0, !0), u = 0);
|
|
1384
1384
|
}
|
|
1385
1385
|
return u;
|
|
1386
1386
|
}
|
|
1387
1387
|
function An(e, t, n, r) {
|
|
1388
|
-
if (null == n && (n = {}), !e) return
|
|
1389
|
-
if (!r) return
|
|
1388
|
+
if (null == n && (n = {}), !e) return ar(`publisher NULL: ev ${t}`), 0;
|
|
1389
|
+
if (!r) return ar(`subscriber NULL: ev ${t}`), 0;
|
|
1390
1390
|
const l = /* @__PURE__ */ new Set([
|
|
1391
1391
|
"__config__",
|
|
1392
1392
|
"__global__",
|
|
@@ -1395,20 +1395,20 @@ function An(e, t, n, r) {
|
|
|
1395
1395
|
"__service__"
|
|
1396
1396
|
]);
|
|
1397
1397
|
if (Object.keys(n).forEach((n) => {
|
|
1398
|
-
l.has(n) ||
|
|
1399
|
-
}),
|
|
1400
|
-
else if (!(bn(e, t, U.EVF_OUTPUT_EVENT) || e.gclass.gclass_flag & C.gcflag_no_check_output_events)) return
|
|
1398
|
+
l.has(n) || ar(`${Rt(e)}: key ignored in subscription (key: ${n}, event: ${t})`);
|
|
1399
|
+
}), rl(t)) t = "";
|
|
1400
|
+
else if (!(bn(e, t, U.EVF_OUTPUT_EVENT) || e.gclass.gclass_flag & C.gcflag_no_check_output_events)) return ar(`event NOT in output event list: ${Rt(e)}, ev ${t}`), 0;
|
|
1401
1401
|
let o = Nn(n, t), i = jn(e.dl_subscriptions, e, t, o.renamed_event, o.kw, r), s = 0, a = 0, u = 0;
|
|
1402
1402
|
for (let t = 0; t < i.length; t++) {
|
|
1403
1403
|
let n = i[t], r = Rn(e, n, !1, !1);
|
|
1404
1404
|
0 === r ? s++ : r < 0 ? a++ : u++;
|
|
1405
1405
|
}
|
|
1406
|
-
return a ?
|
|
1406
|
+
return a ? ur(`${Rt(e)}: Hard subscription not removed, only gobj_unsubscribe_list() with force removes it (event: ${t}, hard: ${a})`) : s || u || (ur(`${Rt(e)}: No subscription found`), $r(n, "No subscription found")), 0;
|
|
1407
1407
|
}
|
|
1408
1408
|
function kn(e, t, n) {
|
|
1409
1409
|
let r = [...t], l = 0;
|
|
1410
1410
|
for (let t = 0; t < r.length; t++) Rn(e, r[t], n, !1) > 0 && l++;
|
|
1411
|
-
return l &&
|
|
1411
|
+
return l && ur(`${Rt(e)}: Subscription(s) already removed, nothing to remove (count: ${l})`), 0;
|
|
1412
1412
|
}
|
|
1413
1413
|
function In(e, t, n, r) {
|
|
1414
1414
|
return null == n && (n = {}), jn(e.dl_subscriptions, e, t, null, n, r);
|
|
@@ -1416,31 +1416,31 @@ function In(e, t, n, r) {
|
|
|
1416
1416
|
function Cn(e) {
|
|
1417
1417
|
let t = In(e, null, null, null);
|
|
1418
1418
|
for (let n = 0; n < t.length; n++) {
|
|
1419
|
-
let r = t[n], l =
|
|
1420
|
-
|
|
1419
|
+
let r = t[n], l = Ol(e, r, "publisher", null, Vn.KW_REQUIRED), o = Ol(e, r, "subscriber", null, Vn.KW_REQUIRED);
|
|
1420
|
+
Fr(r, "s_event", vl(e, r, "event", "", Vn.KW_REQUIRED)), Fr(r, "s_publisher", Rt(l)), Fr(r, "s_subscriber", Rt(o));
|
|
1421
1421
|
}
|
|
1422
1422
|
let n = Ln(e, 0, null, 0);
|
|
1423
1423
|
for (let t = 0; t < n.length; t++) {
|
|
1424
|
-
let r = n[t], l =
|
|
1425
|
-
|
|
1424
|
+
let r = n[t], l = Ol(e, r, "publisher", null, Vn.KW_REQUIRED), o = Ol(e, r, "subscriber", null, Vn.KW_REQUIRED);
|
|
1425
|
+
Fr(r, "s_event", vl(e, r, "event", "", Vn.KW_REQUIRED)), Fr(r, "s_publisher", Rt(l)), Fr(r, "s_subscriber", Rt(o));
|
|
1426
1426
|
}
|
|
1427
1427
|
return {
|
|
1428
1428
|
subscriptions: t,
|
|
1429
1429
|
subscribings: n,
|
|
1430
|
-
"total subscriptions":
|
|
1431
|
-
total_subscribings:
|
|
1430
|
+
"total subscriptions": Kr(t),
|
|
1431
|
+
total_subscribings: Kr(n)
|
|
1432
1432
|
};
|
|
1433
1433
|
}
|
|
1434
1434
|
function Ln(e, t, n, r) {
|
|
1435
1435
|
return jn(e.dl_subscribings, r, t, null, n, e);
|
|
1436
1436
|
}
|
|
1437
1437
|
function Pn(e, n, r) {
|
|
1438
|
-
if (
|
|
1439
|
-
if (
|
|
1438
|
+
if (Jr(r) || (r = {}), !e || e.obflag & (P.obflag_destroyed | P.obflag_destroying)) return ar("gobj NULL or DESTROYED"), -1;
|
|
1439
|
+
if (rl(n)) return ar(`${Rt(e)}: event EMPTY`), -1;
|
|
1440
1440
|
let l = gn(e, n, !0);
|
|
1441
|
-
if (!(l && l.event_flag & (U.EVF_SYSTEM_EVENT | U.EVF_OUTPUT_EVENT) || e.gclass.gclass_flag & C.gcflag_no_check_output_events)) return
|
|
1441
|
+
if (!(l && l.event_flag & (U.EVF_SYSTEM_EVENT | U.EVF_OUTPUT_EVENT) || e.gclass.gclass_flag & C.gcflag_no_check_output_events)) return ar(`event NOT in output event list: ${Rt(e)}, ev ${n}`), -1;
|
|
1442
1442
|
let o = (ne(e) || oe(e, n)) && !ie(e, n);
|
|
1443
|
-
if (o && (Y(1 === W ? t("🔝🔝 %s %s%s %s", n || "", e.running ? "" : "!!", Rt(e), e.current_state.state_name) : t("🔝🔝 mach(%s%s^%s), st: %s, ev: %s%s%s", e.running ? "" : "!!", $t(e), jt(e), e.current_state.state_name, "", n || "", "")), le(e) &&
|
|
1443
|
+
if (o && (Y(1 === W ? t("🔝🔝 %s %s%s %s", n || "", e.running ? "" : "!!", Rt(e), e.current_state.state_name) : t("🔝🔝 mach(%s%s^%s), st: %s, ev: %s%s%s", e.running ? "" : "!!", $t(e), jt(e), e.current_state.state_name, "", n || "", "")), le(e) && xr(r) && $r(r)), e.gclass.gmt.mt_publish_event) {
|
|
1444
1444
|
let t = e.gclass.gmt.mt_publish_event(e, n, r);
|
|
1445
1445
|
if (t <= 0) return t;
|
|
1446
1446
|
}
|
|
@@ -1452,20 +1452,20 @@ function Pn(e, n, r) {
|
|
|
1452
1452
|
if (t < 0) break;
|
|
1453
1453
|
if (!t) continue;
|
|
1454
1454
|
}
|
|
1455
|
-
let _ =
|
|
1455
|
+
let _ = Ol(e, u, "subscriber", null, Vn.KW_REQUIRED);
|
|
1456
1456
|
if (!_ || Ct(_)) continue;
|
|
1457
|
-
let c =
|
|
1458
|
-
if (
|
|
1459
|
-
|
|
1460
|
-
let l =
|
|
1461
|
-
|
|
1457
|
+
let c = yl(e, u, "subs_flag", 0, Vn.KW_REQUIRED), f = vl(e, u, "event", "", Vn.KW_REQUIRED);
|
|
1458
|
+
if (rl(f) || 0 === sl(f, n)) {
|
|
1459
|
+
Sl(e, u, "__config__", null, 0);
|
|
1460
|
+
let l = Sl(e, u, "__global__", null, 0), i = Sl(e, u, "__local__", null, 0), f = Nl(e, u, "__filter__", null, 0), g = u.renamed_event;
|
|
1461
|
+
rl(g) && (g = n);
|
|
1462
1462
|
let d = 1;
|
|
1463
|
-
if (e.gclass.gmt.mt_publication_filter ? d = e.gclass.gmt.mt_publication_filter(e, n, r, _) :
|
|
1463
|
+
if (e.gclass.gmt.mt_publication_filter ? d = e.gclass.gmt.mt_publication_filter(e, n, r, _) : Yr(f) > 0 && (d = Dl(r, f) ? 1 : 0, o && (Y(t("💜💜🔄%s publishing with filter, event '%s', subscriber'%s', publisher %s", d ? "👍" : "👎", n || "", Rt(_), Rt(e))), gr(f))), d < 0) break;
|
|
1464
1464
|
if (!d) continue;
|
|
1465
1465
|
let b = gn(_, n, !0);
|
|
1466
1466
|
if (b && b.event_flag & U.EVF_SYSTEM_EVENT && !dn(_, b.event_name, 0)) continue;
|
|
1467
1467
|
let p = r;
|
|
1468
|
-
(
|
|
1468
|
+
(Yr(i) > 0 || Yr(l) > 0) && (p = kr({}, r)), Yr(i) > 0 && fl(p, i), Yr(l) > 0 && kr(p, Rr(l)), o && (Y(1 === W ? t("🔝🔄 %s (%s) %s%s", n || "", g || "", _.running ? "" : "!!", Rt(_)) : t("🔝🔄 mach(%s%s), st: %s, ev: %s (%s), from(%s%s)", _.running ? "" : "!!", Rt(_), cn(_), n || "", g || "", e && !e.running ? "!!" : "", Rt(e))), le(e) && xr(p) && $r(p));
|
|
1469
1469
|
let m = Tn(_, g, p, e);
|
|
1470
1470
|
if (m < 0 && c & vn.__own_event__) {
|
|
1471
1471
|
s = -1;
|
|
@@ -1474,20 +1474,20 @@ function Pn(e, n, r) {
|
|
|
1474
1474
|
if (a += m, s++, Ct(e)) break;
|
|
1475
1475
|
}
|
|
1476
1476
|
}
|
|
1477
|
-
return s || l && l.event_flag & U.EVF_NO_WARN_SUBS ||
|
|
1477
|
+
return s || l && l.event_flag & U.EVF_NO_WARN_SUBS || ur(`${Rt(e)}: Publish event WITHOUT subscribers, ev ${n}`), a;
|
|
1478
1478
|
}
|
|
1479
1479
|
function Un(e, n, r, l) {
|
|
1480
|
-
if (Ct(e)) return
|
|
1480
|
+
if (Ct(e)) return ar("gobj NULL or DESTROYED"), -1;
|
|
1481
1481
|
if (function(e) {
|
|
1482
1482
|
return z > 1 || !!e && !!(Z(e) & B.TRACE_COMMANDS);
|
|
1483
1483
|
}(e) || oe(e, null) && !ie(l, null)) {
|
|
1484
|
-
let o =
|
|
1485
|
-
Y(t("🌀🌀 mach(%s%s), cmd: %s, src: %s", Et(e) ? "" : "!!", Rt(e), null !== o ? o : n, Rt(l))), le(e) &&
|
|
1484
|
+
let o = vr(n);
|
|
1485
|
+
Y(t("🌀🌀 mach(%s%s), cmd: %s, src: %s", Et(e) ? "" : "!!", Rt(e), null !== o ? o : n, Rt(l))), le(e) && $r(r);
|
|
1486
1486
|
}
|
|
1487
1487
|
return e.gclass.gmt.mt_command_parser ? e.gclass.gmt.mt_command_parser(e, n, r, l) : e.gclass.command_table ? g ? g(e, n, r, l) : o(0, -1, t("%s: global command parser not available", Rt(e)), 0, 0) : o(0, -1, t("%s: command table not available", Rt(e)), 0, 0);
|
|
1488
1488
|
}
|
|
1489
1489
|
function Fn(e, n, r, l) {
|
|
1490
|
-
return Ct(e) ? (
|
|
1490
|
+
return Ct(e) ? (ar("gobj NULL or DESTROYED"), -1) : e.gclass.gmt.mt_stats ? e.gclass.gmt.mt_stats(e, n, r, l) : d ? d(e, n, r, l) : s(0, -1, t("%s, stats parser not available", Rt(e)), 0, 0);
|
|
1491
1491
|
}
|
|
1492
1492
|
var Vn = Object.freeze({
|
|
1493
1493
|
KW_REQUIRED: 1,
|
|
@@ -1582,6 +1582,20 @@ function lr(e) {
|
|
|
1582
1582
|
}
|
|
1583
1583
|
}
|
|
1584
1584
|
function or(e) {
|
|
1585
|
+
try {
|
|
1586
|
+
return String(e);
|
|
1587
|
+
} catch (t) {
|
|
1588
|
+
return lr(e);
|
|
1589
|
+
}
|
|
1590
|
+
}
|
|
1591
|
+
function ir(e, t) {
|
|
1592
|
+
try {
|
|
1593
|
+
return e(t);
|
|
1594
|
+
} catch (e) {
|
|
1595
|
+
return or(t);
|
|
1596
|
+
}
|
|
1597
|
+
}
|
|
1598
|
+
function sr(e) {
|
|
1585
1599
|
const t = Array.prototype.slice.call(arguments);
|
|
1586
1600
|
let n = "";
|
|
1587
1601
|
if ("string" == typeof e) {
|
|
@@ -1590,44 +1604,44 @@ function or(e) {
|
|
|
1590
1604
|
n = e.replace(/%[sdifoO]/g, (e) => {
|
|
1591
1605
|
const n = t[r++];
|
|
1592
1606
|
switch (e) {
|
|
1593
|
-
case "%s": return
|
|
1607
|
+
case "%s": return or(n);
|
|
1594
1608
|
case "%d":
|
|
1595
|
-
case "%i": return parseInt
|
|
1596
|
-
case "%f": return parseFloat
|
|
1609
|
+
case "%i": return ir(parseInt, n);
|
|
1610
|
+
case "%f": return ir(parseFloat, n);
|
|
1597
1611
|
case "%o":
|
|
1598
|
-
case "%O": return "object" == typeof n ? lr(n) :
|
|
1612
|
+
case "%O": return "object" == typeof n ? lr(n) : or(n);
|
|
1599
1613
|
default: return e;
|
|
1600
1614
|
}
|
|
1601
1615
|
});
|
|
1602
|
-
const l = t.slice(r).map((e) => "object" == typeof e ? lr(e) :
|
|
1616
|
+
const l = t.slice(r).map((e) => "object" == typeof e ? lr(e) : or(e));
|
|
1603
1617
|
l.length > 0 && (n += " " + l.join(" "));
|
|
1604
|
-
} else n = t.map((e) => "object" == typeof e ? lr(e) :
|
|
1618
|
+
} else n = t.map((e) => "object" == typeof e ? lr(e) : or(e)).join(" ");
|
|
1605
1619
|
return n;
|
|
1606
1620
|
}
|
|
1607
|
-
function
|
|
1608
|
-
let n =
|
|
1621
|
+
function ar(e, ...t) {
|
|
1622
|
+
let n = sr(e, ...t), r = ko();
|
|
1609
1623
|
Mn && (Mn === Gn.error ? Zn("error", n) && Mn("%c" + r + " ERROR: " + String(n), "color:red") : (Zn("error", n) && Gn.error("%c" + r + " ERROR: " + String(n), "color:red"), Mn(`${r} ERROR: ${String(n)}`))), tr("error", n, r);
|
|
1610
1624
|
}
|
|
1611
|
-
function
|
|
1612
|
-
let n =
|
|
1625
|
+
function ur(e, ...t) {
|
|
1626
|
+
let n = sr(e, ...t), r = ko();
|
|
1613
1627
|
Wn && (Wn === Gn.warn ? Zn("warning", n) && Wn("%c" + r + " WARNING: " + String(n), "color:yellow") : (Zn("warning", n) && Gn.warn("%c" + r + " WARNING: " + String(n), "color:yellow"), Wn(`${r} WARNING: ${String(n)}`))), tr("warning", n, r);
|
|
1614
1628
|
}
|
|
1615
|
-
function
|
|
1616
|
-
let n =
|
|
1629
|
+
function _r(e, ...t) {
|
|
1630
|
+
let n = sr(e, ...t), r = ko();
|
|
1617
1631
|
xn && Zn("info", n) && xn("%c" + r + " INFO: " + String(n), "color:cyan"), tr("info", n, r);
|
|
1618
1632
|
}
|
|
1619
|
-
function
|
|
1620
|
-
let n =
|
|
1633
|
+
function cr(e, ...t) {
|
|
1634
|
+
let n = sr(e, ...t), r = ko();
|
|
1621
1635
|
Kn && Zn("debug", n) && Kn("%c" + r + " DEBUG: " + String(n), "color:silver"), tr("debug", n, r);
|
|
1622
1636
|
}
|
|
1623
|
-
function
|
|
1624
|
-
let n =
|
|
1637
|
+
function fr(e, ...t) {
|
|
1638
|
+
let n = sr(e, ...t), r = ko();
|
|
1625
1639
|
Kn && Zn("msg", n) && Kn("%c" + r + " MSG: " + String(n), "color:cyan"), tr("msg", n, r);
|
|
1626
1640
|
}
|
|
1627
|
-
function
|
|
1628
|
-
Zn("json", t) && (t && Gn.warn("=====> " + t), Gn.dir(e)), tr("json", e,
|
|
1641
|
+
function gr(e, t) {
|
|
1642
|
+
Zn("json", t) && (t && Gn.warn("=====> " + t), Gn.dir(e)), tr("json", e, ko());
|
|
1629
1643
|
}
|
|
1630
|
-
var
|
|
1644
|
+
var dr = [
|
|
1631
1645
|
"passw",
|
|
1632
1646
|
"pwd",
|
|
1633
1647
|
"passphrase",
|
|
@@ -1639,12 +1653,12 @@ var fr = [
|
|
|
1639
1653
|
"cookie",
|
|
1640
1654
|
"credential",
|
|
1641
1655
|
"salt"
|
|
1642
|
-
],
|
|
1656
|
+
], br = [
|
|
1643
1657
|
"apikey",
|
|
1644
1658
|
"sessionid",
|
|
1645
1659
|
"sessionkey",
|
|
1646
1660
|
"authdata"
|
|
1647
|
-
],
|
|
1661
|
+
], pr = /* @__PURE__ */ new Set([
|
|
1648
1662
|
"endpoint",
|
|
1649
1663
|
"url",
|
|
1650
1664
|
"uri",
|
|
@@ -1668,25 +1682,25 @@ var fr = [
|
|
|
1668
1682
|
"expires",
|
|
1669
1683
|
"mode"
|
|
1670
1684
|
]);
|
|
1671
|
-
function
|
|
1685
|
+
function mr(e) {
|
|
1672
1686
|
if ("string" != typeof e || e.length < 3) return !1;
|
|
1673
1687
|
let t = e.toLowerCase(), n = !1;
|
|
1674
|
-
for (const e of
|
|
1688
|
+
for (const e of dr) if (t.indexOf(e) >= 0) {
|
|
1675
1689
|
n = !0;
|
|
1676
1690
|
break;
|
|
1677
1691
|
}
|
|
1678
1692
|
if (!n) {
|
|
1679
1693
|
let e = t.replace(/[_\-. \t]/g, "");
|
|
1680
|
-
for (const t of
|
|
1694
|
+
for (const t of br) if (e.indexOf(t) >= 0) {
|
|
1681
1695
|
n = !0;
|
|
1682
1696
|
break;
|
|
1683
1697
|
}
|
|
1684
1698
|
}
|
|
1685
1699
|
if (n || (n = t.indexOf("priv") >= 0 && t.indexOf("key") >= 0), !n) return !1;
|
|
1686
|
-
for (const e of t.split(/[_\-. \t]/)) if (
|
|
1700
|
+
for (const e of t.split(/[_\-. \t]/)) if (pr.has(e)) return !1;
|
|
1687
1701
|
return !0;
|
|
1688
1702
|
}
|
|
1689
|
-
function
|
|
1703
|
+
function hr(e, t, n) {
|
|
1690
1704
|
const r = (e) => " " === e || " " === e, l = (t) => n && e[t] === n && (t + 1 >= e.length || r(e[t + 1]));
|
|
1691
1705
|
let o = t;
|
|
1692
1706
|
for (;;) {
|
|
@@ -1702,12 +1716,12 @@ function pr(e, t, n) {
|
|
|
1702
1716
|
o = t;
|
|
1703
1717
|
}
|
|
1704
1718
|
}
|
|
1705
|
-
var
|
|
1706
|
-
function
|
|
1719
|
+
var Er = 128, yr = 4194304, Tr = "<not shown: too large to mask>";
|
|
1720
|
+
function vr(e) {
|
|
1707
1721
|
if ("string" != typeof e || e.indexOf("=") < 0) return null;
|
|
1708
|
-
if (e.length >
|
|
1722
|
+
if (e.length > yr) return Tr;
|
|
1709
1723
|
let t, n = !1, r = /(^|[ \t])attribute=["']?([^ \t"']*)/g;
|
|
1710
|
-
for (; null !== (t = r.exec(e));)
|
|
1724
|
+
for (; null !== (t = r.exec(e));) mr(t[2].slice(-128)) && (n = !0);
|
|
1711
1725
|
let l = [], o = 0, i = !1, s = "", a = 0, u = 0;
|
|
1712
1726
|
const _ = (t) => t >= e.length || " " === e[t] || " " === e[t];
|
|
1713
1727
|
for (; u < e.length;) {
|
|
@@ -1720,8 +1734,8 @@ function yr(e) {
|
|
|
1720
1734
|
u++;
|
|
1721
1735
|
continue;
|
|
1722
1736
|
}
|
|
1723
|
-
let r = e.substring(Math.max(a, u -
|
|
1724
|
-
if (a = u + 1, !(
|
|
1737
|
+
let r = e.substring(Math.max(a, u - Er), u);
|
|
1738
|
+
if (a = u + 1, !(mr(r) || n && "value" === r.toLowerCase())) {
|
|
1725
1739
|
u++;
|
|
1726
1740
|
continue;
|
|
1727
1741
|
}
|
|
@@ -1730,18 +1744,18 @@ function yr(e) {
|
|
|
1730
1744
|
if (f) {
|
|
1731
1745
|
for (c = u + 1; c < e.length && e[c] !== f;) c++;
|
|
1732
1746
|
e[c] === f && c++;
|
|
1733
|
-
} else c =
|
|
1747
|
+
} else c = hr(e, u, s);
|
|
1734
1748
|
c > u && (l.push(e.substring(o, u)), l.push("********"), o = c, i = !0), u = c, a = u;
|
|
1735
1749
|
}
|
|
1736
1750
|
return i ? (l.push(e.substring(o)), l.join("")) : null;
|
|
1737
1751
|
}
|
|
1738
|
-
var
|
|
1739
|
-
var
|
|
1740
|
-
function
|
|
1752
|
+
var Or = 64, Sr = "<not shown: the masking failed>";
|
|
1753
|
+
var Nr = Symbol("mask-in-progress");
|
|
1754
|
+
function wr(e, t, n, r) {
|
|
1741
1755
|
if ("string" == typeof e) {
|
|
1742
|
-
if (e.length > r.left) return r.left = 0,
|
|
1756
|
+
if (e.length > r.left) return r.left = 0, Tr;
|
|
1743
1757
|
r.left -= e.length;
|
|
1744
|
-
let t =
|
|
1758
|
+
let t = vr(e);
|
|
1745
1759
|
return null !== t ? t : e;
|
|
1746
1760
|
}
|
|
1747
1761
|
let l = Array.isArray(e);
|
|
@@ -1750,13 +1764,13 @@ function Sr(e, t, n, r) {
|
|
|
1750
1764
|
let t = Object.getPrototypeOf(e);
|
|
1751
1765
|
return t === Object.prototype || null === t;
|
|
1752
1766
|
}(e)) return e;
|
|
1753
|
-
if (r.left <= 0) return
|
|
1767
|
+
if (r.left <= 0) return Tr;
|
|
1754
1768
|
if (t.has(e)) {
|
|
1755
1769
|
let n = t.get(e);
|
|
1756
|
-
return n ===
|
|
1770
|
+
return n === Nr ? "<cycle>" : n;
|
|
1757
1771
|
}
|
|
1758
|
-
if (n >=
|
|
1759
|
-
r.left -= 1, t.set(e,
|
|
1772
|
+
if (n >= Or) return "<deeper not shown>";
|
|
1773
|
+
r.left -= 1, t.set(e, Nr);
|
|
1760
1774
|
let o, i = !1, s = !1;
|
|
1761
1775
|
if (l) {
|
|
1762
1776
|
o = [];
|
|
@@ -1766,13 +1780,13 @@ function Sr(e, t, n, r) {
|
|
|
1766
1780
|
break;
|
|
1767
1781
|
}
|
|
1768
1782
|
r.left -= 1;
|
|
1769
|
-
let a =
|
|
1783
|
+
let a = wr(e[l], t, n + 1, r);
|
|
1770
1784
|
a !== e[l] && (i = !0), o.push(a);
|
|
1771
1785
|
}
|
|
1772
|
-
s && o.push(
|
|
1786
|
+
s && o.push(Tr);
|
|
1773
1787
|
} else {
|
|
1774
1788
|
o = Object.create(Object.getPrototypeOf(e));
|
|
1775
|
-
let l = "string" == typeof e.attribute &&
|
|
1789
|
+
let l = "string" == typeof e.attribute && mr(e.attribute.slice(-128));
|
|
1776
1790
|
for (const a in e) {
|
|
1777
1791
|
if (!Object.prototype.hasOwnProperty.call(e, a)) continue;
|
|
1778
1792
|
if (r.left <= 0) {
|
|
@@ -1781,38 +1795,38 @@ function Sr(e, t, n, r) {
|
|
|
1781
1795
|
}
|
|
1782
1796
|
r.left -= 1 + a.length;
|
|
1783
1797
|
let u, _ = e[a];
|
|
1784
|
-
u = (
|
|
1798
|
+
u = (mr(a.slice(-128)) || l && "value" === a) && null != _ && "" !== _ ? "********" : wr(_, t, n + 1, r), u !== _ && (i = !0), bl(o, a, u);
|
|
1785
1799
|
}
|
|
1786
|
-
s && (o["<more>"] =
|
|
1800
|
+
s && (o["<more>"] = Tr);
|
|
1787
1801
|
}
|
|
1788
1802
|
return i || s || (o = e), t.set(e, o), o;
|
|
1789
1803
|
}
|
|
1790
|
-
function
|
|
1804
|
+
function jr(e) {
|
|
1791
1805
|
try {
|
|
1792
|
-
return
|
|
1806
|
+
return wr(e, /* @__PURE__ */ new WeakMap(), 0, { left: yr });
|
|
1793
1807
|
} catch (e) {
|
|
1794
|
-
return
|
|
1808
|
+
return Sr;
|
|
1795
1809
|
}
|
|
1796
1810
|
}
|
|
1797
|
-
function
|
|
1798
|
-
|
|
1811
|
+
function $r(e, t) {
|
|
1812
|
+
gr(jr(e), t);
|
|
1799
1813
|
}
|
|
1800
|
-
function
|
|
1814
|
+
function Rr(e) {
|
|
1801
1815
|
return structuredClone(e);
|
|
1802
1816
|
}
|
|
1803
|
-
function
|
|
1817
|
+
function Dr(...e) {
|
|
1804
1818
|
const t = {};
|
|
1805
|
-
for (const n of e)
|
|
1819
|
+
for (const n of e) kr(t, structuredClone(n));
|
|
1806
1820
|
return t;
|
|
1807
1821
|
}
|
|
1808
|
-
function
|
|
1822
|
+
function Ar(e, t) {
|
|
1809
1823
|
if (e === t) return !0;
|
|
1810
1824
|
if (null === e || null === t) return e === t;
|
|
1811
1825
|
if (typeof e != typeof t) return !1;
|
|
1812
1826
|
if (Array.isArray(e) !== Array.isArray(t)) return !1;
|
|
1813
1827
|
if (Array.isArray(e)) {
|
|
1814
1828
|
if (e.length !== t.length) return !1;
|
|
1815
|
-
for (let n = 0; n < e.length; n++) if (!
|
|
1829
|
+
for (let n = 0; n < e.length; n++) if (!Ar(e[n], t[n])) return !1;
|
|
1816
1830
|
return !0;
|
|
1817
1831
|
}
|
|
1818
1832
|
if ("object" == typeof e) {
|
|
@@ -1820,153 +1834,153 @@ function Rr(e, t) {
|
|
|
1820
1834
|
if (n.length !== r.length) return !1;
|
|
1821
1835
|
for (let l = 0; l < n.length; l++) {
|
|
1822
1836
|
if (n[l] !== r[l]) return !1;
|
|
1823
|
-
if (!
|
|
1837
|
+
if (!Ar(e[n[l]], t[r[l]])) return !1;
|
|
1824
1838
|
}
|
|
1825
1839
|
return !0;
|
|
1826
1840
|
}
|
|
1827
1841
|
return e === t;
|
|
1828
1842
|
}
|
|
1829
|
-
function
|
|
1843
|
+
function kr(e, t) {
|
|
1830
1844
|
if (!t) return e;
|
|
1831
|
-
for (let n of Object.keys(t))
|
|
1845
|
+
for (let n of Object.keys(t)) bl(e, n, t[n]);
|
|
1832
1846
|
return e;
|
|
1833
1847
|
}
|
|
1834
|
-
function
|
|
1848
|
+
function Ir(e, t) {
|
|
1835
1849
|
if (!t) return e;
|
|
1836
|
-
for (let n in t) Object.prototype.hasOwnProperty.call(t, n) && Object.prototype.hasOwnProperty.call(e, n) &&
|
|
1850
|
+
for (let n in t) Object.prototype.hasOwnProperty.call(t, n) && Object.prototype.hasOwnProperty.call(e, n) && bl(e, n, t[n]);
|
|
1837
1851
|
return e;
|
|
1838
1852
|
}
|
|
1839
|
-
function
|
|
1853
|
+
function Cr(e, t) {
|
|
1840
1854
|
if (!t) return e;
|
|
1841
|
-
for (let n in t) Object.prototype.hasOwnProperty.call(t, n) && !Object.prototype.hasOwnProperty.call(e, n) &&
|
|
1855
|
+
for (let n in t) Object.prototype.hasOwnProperty.call(t, n) && !Object.prototype.hasOwnProperty.call(e, n) && bl(e, n, t[n]);
|
|
1842
1856
|
return e;
|
|
1843
1857
|
}
|
|
1844
|
-
function
|
|
1858
|
+
function Lr(e, t) {
|
|
1845
1859
|
if (e && Object.prototype.hasOwnProperty.call(e, t)) return e[t];
|
|
1846
1860
|
}
|
|
1847
|
-
function
|
|
1861
|
+
function Pr(e, t) {
|
|
1848
1862
|
e && Object.prototype.hasOwnProperty.call(e, t) && delete e[t];
|
|
1849
1863
|
}
|
|
1850
|
-
function
|
|
1851
|
-
|
|
1864
|
+
function Ur(e, t, n) {
|
|
1865
|
+
bl(e, t, n);
|
|
1852
1866
|
}
|
|
1853
|
-
function
|
|
1854
|
-
|
|
1867
|
+
function Fr(e, t, n) {
|
|
1868
|
+
bl(e, t, n);
|
|
1855
1869
|
}
|
|
1856
|
-
function
|
|
1870
|
+
function Vr(e, t) {
|
|
1857
1871
|
e.push(t);
|
|
1858
1872
|
}
|
|
1859
|
-
function
|
|
1873
|
+
function Gr(e, t) {
|
|
1860
1874
|
e.push(t);
|
|
1861
1875
|
}
|
|
1862
|
-
function
|
|
1876
|
+
function Mr(e, t) {
|
|
1863
1877
|
e.splice(t, 1);
|
|
1864
1878
|
}
|
|
1865
|
-
function
|
|
1879
|
+
function Wr(e, t) {
|
|
1866
1880
|
return t ? (Array.prototype.push.apply(e, t), e) : e;
|
|
1867
1881
|
}
|
|
1868
|
-
function Mr(e) {
|
|
1869
|
-
return Yr(e) ? Object.keys(e).length : 0;
|
|
1870
|
-
}
|
|
1871
|
-
function Wr(e) {
|
|
1872
|
-
return Br(e) ? e.length : 0;
|
|
1873
|
-
}
|
|
1874
1882
|
function xr(e) {
|
|
1875
|
-
return
|
|
1883
|
+
return Jr(e) ? Object.keys(e).length : 0;
|
|
1876
1884
|
}
|
|
1877
1885
|
function Kr(e) {
|
|
1878
|
-
return
|
|
1886
|
+
return qr(e) ? e.length : 0;
|
|
1879
1887
|
}
|
|
1880
1888
|
function Yr(e) {
|
|
1881
|
-
return
|
|
1889
|
+
return Jr(e) ? Object.keys(e).length : qr(e) ? e.length : Hr(e) && e.length > 0 ? 1 : 0;
|
|
1882
1890
|
}
|
|
1883
1891
|
function Br(e) {
|
|
1884
|
-
return
|
|
1892
|
+
return 0 === Yr(e);
|
|
1885
1893
|
}
|
|
1886
1894
|
function Jr(e) {
|
|
1887
|
-
return "
|
|
1895
|
+
return null !== e && "object" == typeof e && !Array.isArray(e);
|
|
1888
1896
|
}
|
|
1889
1897
|
function qr(e) {
|
|
1890
|
-
return
|
|
1898
|
+
return Array.isArray(e);
|
|
1891
1899
|
}
|
|
1892
1900
|
function Hr(e) {
|
|
1893
|
-
return "
|
|
1901
|
+
return "string" == typeof e;
|
|
1894
1902
|
}
|
|
1895
1903
|
function zr(e) {
|
|
1896
|
-
return
|
|
1904
|
+
return "number" == typeof e && Number.isFinite(e);
|
|
1897
1905
|
}
|
|
1898
1906
|
function Qr(e) {
|
|
1899
|
-
|
|
1900
|
-
if (!Jr(e)) return !1;
|
|
1901
|
-
const t = Number(e);
|
|
1902
|
-
return !isNaN(t) && "" !== e.trim() && !isNaN(t);
|
|
1907
|
+
return "boolean" == typeof e;
|
|
1903
1908
|
}
|
|
1904
1909
|
function Xr(e) {
|
|
1905
|
-
return
|
|
1910
|
+
return null == e;
|
|
1906
1911
|
}
|
|
1907
1912
|
function Zr(e) {
|
|
1908
|
-
|
|
1913
|
+
if (zr(e)) return !0;
|
|
1914
|
+
if (!Hr(e)) return !1;
|
|
1915
|
+
const t = Number(e);
|
|
1916
|
+
return !isNaN(t) && "" !== e.trim() && !isNaN(t);
|
|
1909
1917
|
}
|
|
1910
1918
|
function el(e) {
|
|
1911
|
-
return e instanceof
|
|
1919
|
+
return e instanceof Date && !isNaN(e);
|
|
1912
1920
|
}
|
|
1913
1921
|
function tl(e) {
|
|
1914
|
-
return
|
|
1922
|
+
return "function" == typeof e;
|
|
1915
1923
|
}
|
|
1916
1924
|
function nl(e) {
|
|
1917
|
-
return
|
|
1925
|
+
return e instanceof I;
|
|
1926
|
+
}
|
|
1927
|
+
function rl(e) {
|
|
1928
|
+
return !Hr(e) || 0 === e.length;
|
|
1918
1929
|
}
|
|
1919
|
-
function
|
|
1930
|
+
function ll(e) {
|
|
1931
|
+
return zr(e) ? Boolean(e) : /^\s*(true|1|on)\s*$/i.test(e);
|
|
1932
|
+
}
|
|
1933
|
+
function ol(e, t, n) {
|
|
1920
1934
|
var r = (e + "").substring(0, n), l = (t + "").substring(0, n);
|
|
1921
1935
|
return r === l ? 0 : r > l ? 1 : -1;
|
|
1922
1936
|
}
|
|
1923
|
-
function
|
|
1937
|
+
function il(e, t) {
|
|
1924
1938
|
return e === t ? 0 : e > t ? 1 : -1;
|
|
1925
1939
|
}
|
|
1926
|
-
function
|
|
1940
|
+
function sl(e, t) {
|
|
1927
1941
|
let n = e.toLowerCase(), r = t.toLowerCase();
|
|
1928
1942
|
return n === r ? 0 : n > r ? 1 : -1;
|
|
1929
1943
|
}
|
|
1930
|
-
function
|
|
1931
|
-
if (
|
|
1932
|
-
if (
|
|
1944
|
+
function al(e, t) {
|
|
1945
|
+
if (Jr(e) || Jr(t) || qr(e) || qr(t)) return 0;
|
|
1946
|
+
if (zr(e) || zr(t)) {
|
|
1933
1947
|
let n = Number(e), r = Number(t);
|
|
1934
1948
|
return Number.isNaN(n) && (n = 0), Number.isNaN(r) && (r = 0), n > r ? 1 : n < r ? -1 : 0;
|
|
1935
1949
|
}
|
|
1936
|
-
if (
|
|
1950
|
+
if (Qr(e) || Qr(t)) {
|
|
1937
1951
|
let n = Number(e), r = Number(t);
|
|
1938
1952
|
return n > r ? 1 : n < r ? -1 : 0;
|
|
1939
1953
|
}
|
|
1940
|
-
return
|
|
1954
|
+
return il(String(e), String(t));
|
|
1941
1955
|
}
|
|
1942
|
-
function
|
|
1956
|
+
function ul(e, t, n) {
|
|
1943
1957
|
var r;
|
|
1944
1958
|
return -1 !== (r = (e += "").indexOf(t)) && (n ? e.substring(0, r) : e.slice(r));
|
|
1945
1959
|
}
|
|
1946
|
-
function
|
|
1947
|
-
if (!
|
|
1960
|
+
function _l(e) {
|
|
1961
|
+
if (!Hr(e)) return !1;
|
|
1948
1962
|
let t = 0;
|
|
1949
1963
|
for (; t < e.length && "_" === e[t] && !(t > 2); t++);
|
|
1950
1964
|
return 2 === t;
|
|
1951
1965
|
}
|
|
1952
|
-
function
|
|
1953
|
-
if (!
|
|
1966
|
+
function cl(e) {
|
|
1967
|
+
if (!Hr(e)) return !1;
|
|
1954
1968
|
let t = 0;
|
|
1955
1969
|
for (; t < e.length && "_" === e[t] && !(t > 2); t++);
|
|
1956
1970
|
return 1 === t;
|
|
1957
1971
|
}
|
|
1958
|
-
function
|
|
1959
|
-
if ("object" != typeof t || Array.isArray(t)) if (Array.isArray(t)) for (const n of t)
|
|
1972
|
+
function fl(e, t) {
|
|
1973
|
+
if ("object" != typeof t || Array.isArray(t)) if (Array.isArray(t)) for (const n of t) fl(e, n);
|
|
1960
1974
|
else "string" == typeof t && delete e[t];
|
|
1961
1975
|
else for (const n of Object.keys(t)) delete e[n];
|
|
1962
1976
|
}
|
|
1963
|
-
function
|
|
1977
|
+
function gl(e, t) {
|
|
1964
1978
|
return !(!(t in e) || !Object.prototype.hasOwnProperty.call(e, t));
|
|
1965
1979
|
}
|
|
1966
|
-
function
|
|
1980
|
+
function dl(e, t) {
|
|
1967
1981
|
return !Object.prototype.hasOwnProperty.call(e, t);
|
|
1968
1982
|
}
|
|
1969
|
-
function
|
|
1983
|
+
function bl(e, t, n) {
|
|
1970
1984
|
"__proto__" === t ? Object.defineProperty(e, t, {
|
|
1971
1985
|
value: n,
|
|
1972
1986
|
writable: !0,
|
|
@@ -1974,235 +1988,235 @@ function gl(e, t, n) {
|
|
|
1974
1988
|
configurable: !0
|
|
1975
1989
|
}) : e[t] = n;
|
|
1976
1990
|
}
|
|
1977
|
-
function
|
|
1991
|
+
function pl(e, t) {
|
|
1978
1992
|
if (!/^[0-9]+$/.test(t)) return -1;
|
|
1979
1993
|
const n = Number(t);
|
|
1980
1994
|
return n >= e.length ? -1 : n;
|
|
1981
1995
|
}
|
|
1982
|
-
function
|
|
1983
|
-
e && !
|
|
1996
|
+
function ml(e, t, n, r) {
|
|
1997
|
+
e && !nl(e) && ar("GObj bad instanceof");
|
|
1984
1998
|
const l = e ? `${Rt(e)}: ` : "";
|
|
1985
|
-
if (!
|
|
1986
|
-
if (!
|
|
1999
|
+
if (!Jr(t) && !qr(t)) return void ar(`${l}kw must be list or dict: '${String(n)}'`);
|
|
2000
|
+
if (!Hr(n)) return void ar(`${l}path must be a string: ${String(n)}`);
|
|
1987
2001
|
let o = n.split("`"), i = o.length;
|
|
1988
2002
|
for (let e = 0; e < i; e++) {
|
|
1989
|
-
if (
|
|
1990
|
-
const i =
|
|
1991
|
-
if (i < 0) return void (r &&
|
|
2003
|
+
if (qr(t)) {
|
|
2004
|
+
const i = pl(t, o[e]);
|
|
2005
|
+
if (i < 0) return void (r && ar(`${l}path not found: '${n}'`));
|
|
1992
2006
|
o[e] = String(i);
|
|
1993
2007
|
}
|
|
1994
|
-
if (
|
|
2008
|
+
if (dl(t, o[e])) return void (r && ar(`${l}path not found: '${n}'`));
|
|
1995
2009
|
if (e === i - 1) break;
|
|
1996
|
-
if (null == (t = t[o[e]])) return void (r &&
|
|
1997
|
-
if (!
|
|
2010
|
+
if (null == (t = t[o[e]])) return void (r && ar(`${l}path not found: '${n}'`));
|
|
2011
|
+
if (!Jr(t) && !qr(t)) return void ar(`${l}kw must be list or dict: '${n}'`);
|
|
1998
2012
|
}
|
|
1999
2013
|
let s = t[o[i - 1]];
|
|
2000
|
-
return void 0 === s && r &&
|
|
2014
|
+
return void 0 === s && r && ar(`${l}path not found: '${n}'`), s;
|
|
2001
2015
|
}
|
|
2002
|
-
function
|
|
2003
|
-
e && !
|
|
2016
|
+
function hl(e, t, n) {
|
|
2017
|
+
e && !nl(e) && ar("GObj bad instanceof");
|
|
2004
2018
|
const r = e ? Rt(e) + ": " : "";
|
|
2005
|
-
if (!
|
|
2019
|
+
if (!Hr(n)) return ar(`${r}kw_delete(): path must be a string: ${String(n)}`), -1;
|
|
2006
2020
|
let [l, o] = function(e, t) {
|
|
2007
2021
|
let n = e.lastIndexOf(t);
|
|
2008
2022
|
return -1 === n ? [e, ""] : [e.substring(0, n), e.substring(n + 1)];
|
|
2009
2023
|
}(n, "`"), i = t;
|
|
2010
|
-
if (
|
|
2011
|
-
else if (i =
|
|
2012
|
-
return
|
|
2024
|
+
if (rl(o)) o = n;
|
|
2025
|
+
else if (i = ml(e, t, l, !0), void 0 === i) return -1;
|
|
2026
|
+
return qr(i) ? (ar(`${r}kw_delete(): cannot delete an item of a list: '${n}'`), -1) : Jr(i) && Object.prototype.hasOwnProperty.call(i, o) ? (delete i[o], 0) : (ar(`${r}kw_delete(): path not found: '${n}'`), -1);
|
|
2013
2027
|
}
|
|
2014
|
-
function
|
|
2015
|
-
e && !
|
|
2016
|
-
let o =
|
|
2028
|
+
function El(e, t, n, r, l) {
|
|
2029
|
+
e && !nl(e) && ar("GObj bad instanceof");
|
|
2030
|
+
let o = ml(e, t, n, !1);
|
|
2017
2031
|
const i = l && l & Vn.KW_REQUIRED, s = l && l & Vn.KW_CREATE, a = l && l & Vn.KW_EXTRACT, u = l && l & Vn.KW_WILD_NUMBER;
|
|
2018
2032
|
if (void 0 === o) {
|
|
2019
2033
|
if (s && t) {
|
|
2020
2034
|
let l = Boolean(r);
|
|
2021
|
-
return
|
|
2035
|
+
return jl(e, t, n, l), l;
|
|
2022
2036
|
}
|
|
2023
|
-
return i && (
|
|
2037
|
+
return i && (ar(`path not found: '${n}'`), $r(t)), Boolean(r);
|
|
2024
2038
|
}
|
|
2025
2039
|
let _;
|
|
2026
|
-
if (
|
|
2027
|
-
else if (u &&
|
|
2028
|
-
else if (u &&
|
|
2040
|
+
if (Qr(o)) _ = o;
|
|
2041
|
+
else if (u && zr(o)) _ = 0 !== o;
|
|
2042
|
+
else if (u && Hr(o)) _ = "true" === o.toLowerCase() || "false" !== o.toLowerCase() && 0 !== (parseInt(o, 10) || 0);
|
|
2029
2043
|
else {
|
|
2030
|
-
if (!u || null !== o) return u ? (
|
|
2044
|
+
if (!u || null !== o) return u ? (ar(`${e ? Rt(e) + ": " : ""}path MUST BE a simple json element: '${n}'`), $r(t), !1) : (ar(`${e ? Rt(e) + ": " : ""}path MUST BE a json boolean: '${n}'`), $r(t), Boolean(r));
|
|
2031
2045
|
_ = !1;
|
|
2032
2046
|
}
|
|
2033
|
-
return a &&
|
|
2047
|
+
return a && hl(e, t, n), _;
|
|
2034
2048
|
}
|
|
2035
|
-
function
|
|
2036
|
-
e && !
|
|
2037
|
-
let o =
|
|
2049
|
+
function yl(e, t, n, r, l) {
|
|
2050
|
+
e && !nl(e) && ar("GObj bad instanceof");
|
|
2051
|
+
let o = ml(e, t, n, !1);
|
|
2038
2052
|
const i = l && l & Vn.KW_REQUIRED, s = l && l & Vn.KW_CREATE, a = l && l & Vn.KW_EXTRACT, u = l && l & Vn.KW_WILD_NUMBER;
|
|
2039
2053
|
if (void 0 === o) {
|
|
2040
2054
|
if (s && t) {
|
|
2041
2055
|
let l = parseInt(r);
|
|
2042
|
-
return
|
|
2056
|
+
return jl(e, t, n, l), l;
|
|
2043
2057
|
}
|
|
2044
|
-
return i && (
|
|
2058
|
+
return i && (ar(`path not found: '${n}'`), $r(t)), parseInt(r);
|
|
2045
2059
|
}
|
|
2046
2060
|
let _;
|
|
2047
|
-
if (
|
|
2061
|
+
if (zr(o)) _ = Math.trunc(o);
|
|
2048
2062
|
else {
|
|
2049
|
-
if (!u) return
|
|
2050
|
-
if (
|
|
2051
|
-
else if (
|
|
2063
|
+
if (!u) return ar(`${e ? Rt(e) + ": " : ""}path MUST BE a json integer: '${n}'`), $r(t), parseInt(r);
|
|
2064
|
+
if (Qr(o)) _ = o ? 1 : 0;
|
|
2065
|
+
else if (Hr(o)) _ = function(e) {
|
|
2052
2066
|
const t = /^\s*([+-]?)(0[xX][0-9a-fA-F]+|0[0-7]*|[1-9][0-9]*)/.exec(e);
|
|
2053
2067
|
if (!t) return 0;
|
|
2054
2068
|
let n, r = t[2];
|
|
2055
2069
|
return n = r.length > 1 && ("x" === r[1] || "X" === r[1]) ? parseInt(r.substring(2), 16) : "0" === r[0] ? parseInt(r, 8) : parseInt(r, 10), "-" === t[1] ? -n : n;
|
|
2056
2070
|
}(o);
|
|
2057
2071
|
else {
|
|
2058
|
-
if (null !== o) return
|
|
2072
|
+
if (null !== o) return ar(`${e ? Rt(e) + ": " : ""}path MUST BE a simple json element: '${n}'`), $r(t), 0;
|
|
2059
2073
|
_ = 0;
|
|
2060
2074
|
}
|
|
2061
2075
|
}
|
|
2062
|
-
return a &&
|
|
2076
|
+
return a && hl(e, t, n), _;
|
|
2063
2077
|
}
|
|
2064
|
-
function
|
|
2065
|
-
e && !
|
|
2066
|
-
let o =
|
|
2078
|
+
function Tl(e, t, n, r, l) {
|
|
2079
|
+
e && !nl(e) && ar("GObj bad instanceof");
|
|
2080
|
+
let o = ml(e, t, n, !1);
|
|
2067
2081
|
const i = l && l & Vn.KW_REQUIRED, s = l && l & Vn.KW_CREATE, a = l && l & Vn.KW_EXTRACT, u = l && l & Vn.KW_WILD_NUMBER;
|
|
2068
2082
|
if (void 0 === o) {
|
|
2069
2083
|
if (s && t) {
|
|
2070
2084
|
let l = Number(r);
|
|
2071
|
-
return
|
|
2085
|
+
return jl(e, t, n, l), l;
|
|
2072
2086
|
}
|
|
2073
|
-
return i && (
|
|
2087
|
+
return i && (ar(`path not found: '${n}'`), $r(t)), Number(r);
|
|
2074
2088
|
}
|
|
2075
2089
|
let _;
|
|
2076
|
-
if (
|
|
2090
|
+
if (zr(o)) _ = o;
|
|
2077
2091
|
else {
|
|
2078
|
-
if (!u) return
|
|
2079
|
-
if (
|
|
2080
|
-
else if (
|
|
2092
|
+
if (!u) return ar(`${e ? Rt(e) + ": " : ""}path MUST BE a json real: '${n}'`), $r(t), Number(r);
|
|
2093
|
+
if (Qr(o)) _ = o ? 1 : 0;
|
|
2094
|
+
else if (Hr(o)) _ = parseFloat(o), Number.isNaN(_) && (_ = 0);
|
|
2081
2095
|
else {
|
|
2082
|
-
if (null !== o) return
|
|
2096
|
+
if (null !== o) return ar(`${e ? Rt(e) + ": " : ""}path MUST BE a simple json element: '${n}'`), $r(t), 0;
|
|
2083
2097
|
_ = 0;
|
|
2084
2098
|
}
|
|
2085
2099
|
}
|
|
2086
|
-
return a &&
|
|
2100
|
+
return a && hl(e, t, n), _;
|
|
2087
2101
|
}
|
|
2088
|
-
function
|
|
2089
|
-
e && !
|
|
2090
|
-
let o =
|
|
2102
|
+
function vl(e, t, n, r, l) {
|
|
2103
|
+
e && !nl(e) && ar("GObj bad instanceof");
|
|
2104
|
+
let o = ml(e, t, n, !1);
|
|
2091
2105
|
const i = l && l & Vn.KW_REQUIRED, s = l && l & Vn.KW_CREATE, a = l && l & Vn.KW_EXTRACT;
|
|
2092
|
-
return void 0 === o ? s && t ? (
|
|
2093
|
-
let n =
|
|
2106
|
+
return void 0 === o ? s && t ? (jl(e, t, n, Hr(r) ? r : null), r) : (i && !function(e, t) {
|
|
2107
|
+
let n = Hr(t) ? t.split("`") : [], r = e;
|
|
2094
2108
|
for (let e = 0; e < n.length - 1; e++) {
|
|
2095
|
-
if (!
|
|
2109
|
+
if (!Jr(r) && !qr(r)) return !1;
|
|
2096
2110
|
r = r[n[e]];
|
|
2097
2111
|
}
|
|
2098
|
-
return !(!
|
|
2099
|
-
}(t, n) && (
|
|
2112
|
+
return !(!Jr(r) && !qr(r) || 0 === n.length) && Object.prototype.hasOwnProperty.call(r, n[n.length - 1]);
|
|
2113
|
+
}(t, n) && (ar(`path not found: '${n}'`), $r(t)), r) : Hr(o) ? (a && hl(e, t, n), o) : (null !== o && (ar(`${e ? Rt(e) + ": " : ""}path MUST BE a json str: '${n}'`), $r(t)), r);
|
|
2100
2114
|
}
|
|
2101
|
-
function
|
|
2102
|
-
e && !
|
|
2103
|
-
let o =
|
|
2115
|
+
function Ol(e, t, n, r, l) {
|
|
2116
|
+
e && !nl(e) && ar("GObj bad instanceof");
|
|
2117
|
+
let o = ml(e, t, n, !1);
|
|
2104
2118
|
const i = l && l & Vn.KW_REQUIRED, s = l && l & Vn.KW_CREATE, a = l && l & Vn.KW_EXTRACT;
|
|
2105
2119
|
if (void 0 === o) {
|
|
2106
2120
|
if (s) {
|
|
2107
2121
|
let l = r;
|
|
2108
|
-
return
|
|
2122
|
+
return jl(e, t, n, l), l;
|
|
2109
2123
|
}
|
|
2110
|
-
return i && (
|
|
2124
|
+
return i && (ar(`path not found: '${n}'`), $r(t)), r;
|
|
2111
2125
|
}
|
|
2112
|
-
return a &&
|
|
2126
|
+
return a && hl(e, t, n), o;
|
|
2113
2127
|
}
|
|
2114
|
-
function
|
|
2115
|
-
e && !
|
|
2116
|
-
let o =
|
|
2128
|
+
function Sl(e, t, n, r, l) {
|
|
2129
|
+
e && !nl(e) && ar("GObj bad instanceof");
|
|
2130
|
+
let o = ml(e, t, n, !1);
|
|
2117
2131
|
const i = l && l & Vn.KW_REQUIRED, s = l && l & Vn.KW_CREATE, a = l && l & Vn.KW_EXTRACT;
|
|
2118
|
-
return void 0 === o ? s &&
|
|
2132
|
+
return void 0 === o ? s && Jr(r) && t ? (jl(e, t, n, r), r) : (i && (ar(`path not found: '${n}'`), $r(t)), r) : Jr(o) ? (a && hl(e, t, n), o) : s && null === o && Jr(r) ? (jl(e, t, n, r), r) : s && null === o ? (i && (ar(`path not found: '${n}'`), $r(t)), r) : ((i || s) && (ar(`${e ? Rt(e) + ": " : ""}path MUST BE a json dict: '${n}'` + (s ? ", cannot create" : "")), $r(t)), r);
|
|
2119
2133
|
}
|
|
2120
|
-
function
|
|
2121
|
-
e && !
|
|
2122
|
-
let o =
|
|
2134
|
+
function Nl(e, t, n, r, l) {
|
|
2135
|
+
e && !nl(e) && ar("GObj bad instanceof");
|
|
2136
|
+
let o = ml(e, t, n, !1);
|
|
2123
2137
|
const i = l && l & Vn.KW_REQUIRED, s = l && l & Vn.KW_CREATE, a = l && l & Vn.KW_EXTRACT;
|
|
2124
2138
|
if (void 0 === o) {
|
|
2125
2139
|
if (s) {
|
|
2126
2140
|
let l = r;
|
|
2127
|
-
return
|
|
2141
|
+
return jl(e, t, n, l), l;
|
|
2128
2142
|
}
|
|
2129
|
-
return i && (
|
|
2143
|
+
return i && (ar(`path not found: '${n}'`), $r(t)), r;
|
|
2130
2144
|
}
|
|
2131
|
-
return a &&
|
|
2145
|
+
return a && hl(e, t, n), o;
|
|
2132
2146
|
}
|
|
2133
|
-
function
|
|
2134
|
-
e && !
|
|
2135
|
-
let o =
|
|
2147
|
+
function wl(e, t, n, r, l) {
|
|
2148
|
+
e && !nl(e) && ar("GObj bad instanceof");
|
|
2149
|
+
let o = ml(e, t, n, !1);
|
|
2136
2150
|
const i = l && l & Vn.KW_REQUIRED, s = l && l & Vn.KW_CREATE, a = l && l & Vn.KW_EXTRACT;
|
|
2137
|
-
return void 0 === o ? s &&
|
|
2151
|
+
return void 0 === o ? s && qr(r) && t ? (jl(e, t, n, r), r) : (i && (ar(`path not found: '${n}'`), $r(t)), r) : qr(o) ? (a && hl(e, t, n), o) : s && null === o && qr(r) ? (jl(e, t, n, r), r) : s && null === o ? (i && (ar(`path not found: '${n}'`), $r(t)), r) : ((i || s) && (ar(`${e ? Rt(e) + ": " : ""}path MUST BE a json list: '${n}'` + (s ? ", cannot create" : "")), $r(t)), r);
|
|
2138
2152
|
}
|
|
2139
|
-
function
|
|
2140
|
-
if (e && !
|
|
2141
|
-
if (!
|
|
2142
|
-
if ("" === n) return
|
|
2143
|
-
if (n.split("`").includes("")) return
|
|
2153
|
+
function jl(e, t, n, r) {
|
|
2154
|
+
if (e && !nl(e) && ar("GObj bad instanceof"), !Jr(t)) return ar("kw is not an object"), -1;
|
|
2155
|
+
if (!Hr(n)) return ar(`${e ? Rt(e) + ": " : ""}kw_set_dict_value(): path must be a string: ${String(n)}`), -1;
|
|
2156
|
+
if ("" === n) return ar((e ? Rt(e) + ": " : "") + "kw_set_dict_value(): path empty"), -1;
|
|
2157
|
+
if (n.split("`").includes("")) return ar(`${e ? Rt(e) + ": " : ""}kw_set_dict_value(): empty segment in path: '${n}'`), -1;
|
|
2144
2158
|
let l = n.split("`"), o = l.length;
|
|
2145
2159
|
for (let i = 0; i < o; i++) {
|
|
2146
2160
|
let s = l[i];
|
|
2147
|
-
if (
|
|
2148
|
-
const r =
|
|
2149
|
-
if (r < 0) return
|
|
2161
|
+
if (qr(t)) {
|
|
2162
|
+
const r = pl(t, s);
|
|
2163
|
+
if (r < 0) return ar(`${e ? Rt(e) + ": " : ""}kw_set_dict_value(): segment '${s}' is not an index of its list: '${n}'`), -1;
|
|
2150
2164
|
s = String(r);
|
|
2151
2165
|
}
|
|
2152
|
-
if (i === o - 1)
|
|
2166
|
+
if (i === o - 1) bl(t, s, r);
|
|
2153
2167
|
else {
|
|
2154
|
-
let r =
|
|
2155
|
-
if (void 0 === r)
|
|
2156
|
-
else if (!
|
|
2168
|
+
let r = dl(t, s) ? void 0 : t[s];
|
|
2169
|
+
if (void 0 === r) bl(t, s, {});
|
|
2170
|
+
else if (!Jr(r) && !qr(r)) return ar(`${e ? Rt(e) + ": " : ""}kw_set_dict_value(): segment '${s}' is not a dict or a list: '${n}'`), -1;
|
|
2157
2171
|
t = t[s];
|
|
2158
2172
|
}
|
|
2159
2173
|
}
|
|
2160
2174
|
return 0;
|
|
2161
2175
|
}
|
|
2162
|
-
function
|
|
2163
|
-
if (e && !
|
|
2164
|
-
let o =
|
|
2176
|
+
function $l(e, t, n, r, l) {
|
|
2177
|
+
if (e && !nl(e) && ar("GObj bad instanceof"), !Jr(t)) return ar("kw is not an object"), -1;
|
|
2178
|
+
let o = ml(e, t, n, !1);
|
|
2165
2179
|
if (void 0 === o) {
|
|
2166
|
-
if (!
|
|
2180
|
+
if (!Hr(n) || function(e, t) {
|
|
2167
2181
|
let n = t.split("`"), r = e;
|
|
2168
2182
|
for (let e = 0; e < n.length - 1; e++) {
|
|
2169
|
-
if (
|
|
2170
|
-
const t =
|
|
2183
|
+
if (qr(r)) {
|
|
2184
|
+
const t = pl(r, n[e]);
|
|
2171
2185
|
if (t < 0) return !1;
|
|
2172
2186
|
r = r[t];
|
|
2173
2187
|
} else r = Object.prototype.hasOwnProperty.call(r, n[e]) ? r[n[e]] : void 0;
|
|
2174
2188
|
if (null == r) return !1;
|
|
2175
|
-
if (!
|
|
2189
|
+
if (!Jr(r) && !qr(r)) return !0;
|
|
2176
2190
|
}
|
|
2177
2191
|
return !1;
|
|
2178
2192
|
}(t, n)) return -1;
|
|
2179
|
-
if (o = {},
|
|
2193
|
+
if (o = {}, jl(e, t, n, o) < 0) return -1;
|
|
2180
2194
|
}
|
|
2181
|
-
return
|
|
2195
|
+
return Jr(o) ? (bl(o, r, l), 0) : (ar(`subdict is not an object: '${n}'`), -1);
|
|
2182
2196
|
}
|
|
2183
|
-
function
|
|
2197
|
+
function Rl(e, n, r) {
|
|
2184
2198
|
let l = "", o = !1;
|
|
2185
|
-
if (
|
|
2199
|
+
if (qr(n)) {
|
|
2186
2200
|
o = !1;
|
|
2187
2201
|
for (let i = 0; i < n.length; i++) {
|
|
2188
2202
|
let s = n[i];
|
|
2189
|
-
if (l =
|
|
2203
|
+
if (l = rl(r) ? t("%s", r) : t("%s`%d", r, i), o = Rl(e, s, l), o) break;
|
|
2190
2204
|
}
|
|
2191
|
-
} else if (
|
|
2205
|
+
} else if (Jr(n)) {
|
|
2192
2206
|
o = !0;
|
|
2193
2207
|
let i = Object.keys(n);
|
|
2194
2208
|
for (let s = 0; s < i.length; s++) {
|
|
2195
2209
|
let a = i[s], u = n[a];
|
|
2196
|
-
if (l =
|
|
2197
|
-
if (o =
|
|
2210
|
+
if (l = rl(r) ? t("%s", a) : t("%s`%s", r, a), qr(u) || Jr(u)) {
|
|
2211
|
+
if (o = Rl(e, u, l), !o) break;
|
|
2198
2212
|
continue;
|
|
2199
2213
|
}
|
|
2200
|
-
let _ =
|
|
2201
|
-
if (void 0 === _ && (_ =
|
|
2214
|
+
let _ = Nl(0, e, l, void 0, 0);
|
|
2215
|
+
if (void 0 === _ && (_ = Lr(e, l)), void 0 === _) {
|
|
2202
2216
|
o = !1;
|
|
2203
2217
|
break;
|
|
2204
2218
|
}
|
|
2205
|
-
if (0 !==
|
|
2219
|
+
if (0 !== al(_, u)) {
|
|
2206
2220
|
o = !1;
|
|
2207
2221
|
break;
|
|
2208
2222
|
}
|
|
@@ -2210,92 +2224,92 @@ function jl(e, n, r) {
|
|
|
2210
2224
|
}
|
|
2211
2225
|
return o;
|
|
2212
2226
|
}
|
|
2213
|
-
function
|
|
2214
|
-
return 0 ===
|
|
2227
|
+
function Dl(e, t) {
|
|
2228
|
+
return 0 === Yr(t) || Rl(e, t, "");
|
|
2215
2229
|
}
|
|
2216
|
-
function
|
|
2217
|
-
if (!n || !
|
|
2218
|
-
for (let e = 0; e < t.length; e++) if (
|
|
2219
|
-
return r &&
|
|
2230
|
+
function Al(e, t, n, r) {
|
|
2231
|
+
if (!n || !qr(t)) return r && ar("item NULL or kw_list is not a list"), -1;
|
|
2232
|
+
for (let e = 0; e < t.length; e++) if (Ar(n, t[e])) return e;
|
|
2233
|
+
return r && ar("item not found in this list"), -1;
|
|
2220
2234
|
}
|
|
2221
|
-
function
|
|
2222
|
-
if (e && !
|
|
2223
|
-
r || (r =
|
|
2235
|
+
function kl(e, t, n, r) {
|
|
2236
|
+
if (e && !nl(e) && ar("GObj bad instanceof"), !t) return null;
|
|
2237
|
+
r || (r = Dl);
|
|
2224
2238
|
let l = [];
|
|
2225
|
-
if (
|
|
2239
|
+
if (qr(t)) for (let e = 0; e < t.length; e++) {
|
|
2226
2240
|
let o = t[e];
|
|
2227
|
-
r(o, n) && l.push(
|
|
2241
|
+
r(o, n) && l.push(Rr(o));
|
|
2228
2242
|
}
|
|
2229
2243
|
else {
|
|
2230
|
-
if (!
|
|
2231
|
-
r(t, n) && l.push(
|
|
2244
|
+
if (!Jr(t)) return ar("kw_select() BAD kw parameter"), null;
|
|
2245
|
+
r(t, n) && l.push(Rr(t));
|
|
2232
2246
|
}
|
|
2233
2247
|
return l;
|
|
2234
2248
|
}
|
|
2235
|
-
function
|
|
2236
|
-
if (e && !
|
|
2237
|
-
r || (r =
|
|
2249
|
+
function Il(e, t, n, r) {
|
|
2250
|
+
if (e && !nl(e) && ar("GObj bad instanceof"), !t) return null;
|
|
2251
|
+
r || (r = Dl);
|
|
2238
2252
|
let l = [];
|
|
2239
|
-
if (
|
|
2253
|
+
if (qr(t)) for (let e = 0; e < t.length; e++) {
|
|
2240
2254
|
let o = t[e];
|
|
2241
2255
|
r(o, n) && l.push(o);
|
|
2242
2256
|
}
|
|
2243
2257
|
else {
|
|
2244
|
-
if (!
|
|
2258
|
+
if (!Jr(t)) return ar("kw_select() BAD kw parameter"), null;
|
|
2245
2259
|
r(t, n) && l.push(t);
|
|
2246
2260
|
}
|
|
2247
2261
|
return l;
|
|
2248
2262
|
}
|
|
2249
|
-
function
|
|
2250
|
-
e && !
|
|
2263
|
+
function Cl(e, t, n, r) {
|
|
2264
|
+
e && !nl(e) && ar("GObj bad instanceof");
|
|
2251
2265
|
let l = {};
|
|
2252
|
-
if (
|
|
2266
|
+
if (Hr(n) && !rl(n)) {
|
|
2253
2267
|
let o = n;
|
|
2254
|
-
Object.prototype.hasOwnProperty.call(t, o) ?
|
|
2255
|
-
} else if (
|
|
2268
|
+
Object.prototype.hasOwnProperty.call(t, o) ? bl(l, o, t[o]) : r && ar(`${Rt(e)}: key not found: ${o}`);
|
|
2269
|
+
} else if (Jr(n) && xr(n) > 0) for (let o of Object.keys(n)) Object.prototype.hasOwnProperty.call(t, o) ? bl(l, o, t[o]) : r && ar(`${Rt(e)}: key not found: ${o}`);
|
|
2256
2270
|
else {
|
|
2257
|
-
if (!(
|
|
2271
|
+
if (!(qr(n) && Kr(n) > 0)) return t;
|
|
2258
2272
|
for (let o = 0; o < n.length; o++) {
|
|
2259
2273
|
let i = n[o];
|
|
2260
|
-
Object.prototype.hasOwnProperty.call(t, i) ?
|
|
2274
|
+
Object.prototype.hasOwnProperty.call(t, i) ? bl(l, i, t[i]) : r && ar(`${Rt(e)}: key not found: ${i}`);
|
|
2261
2275
|
}
|
|
2262
2276
|
}
|
|
2263
2277
|
return l;
|
|
2264
2278
|
}
|
|
2265
|
-
function
|
|
2279
|
+
function Ll(e, t, n, r) {
|
|
2266
2280
|
let l = {};
|
|
2267
|
-
if (!
|
|
2268
|
-
if (
|
|
2281
|
+
if (!Jr(t)) return l;
|
|
2282
|
+
if (kr(l, t), Hr(n) && !rl(n)) {
|
|
2269
2283
|
let o = n;
|
|
2270
|
-
Object.prototype.hasOwnProperty.call(t, o) ?
|
|
2271
|
-
} else if (
|
|
2284
|
+
Object.prototype.hasOwnProperty.call(t, o) ? Pr(l, o) : r && ar(`${Rt(e)}: key not found: ${o}`);
|
|
2285
|
+
} else if (Jr(n) && xr(n) > 0) for (let o of Object.keys(n)) Object.prototype.hasOwnProperty.call(t, o) ? Pr(l, o) : r && ar(`${Rt(e)}: key not found: ${o}`);
|
|
2272
2286
|
else {
|
|
2273
|
-
if (!(
|
|
2287
|
+
if (!(qr(n) && Kr(n) > 0)) return {};
|
|
2274
2288
|
for (let o = 0; o < n.length; o++) {
|
|
2275
2289
|
let i = n[o];
|
|
2276
|
-
Object.prototype.hasOwnProperty.call(t, i) ?
|
|
2290
|
+
Object.prototype.hasOwnProperty.call(t, i) ? Pr(l, i) : r && ar(`${Rt(e)}: key not found: ${i}`);
|
|
2277
2291
|
}
|
|
2278
2292
|
}
|
|
2279
2293
|
return l;
|
|
2280
2294
|
}
|
|
2281
|
-
function
|
|
2295
|
+
function Pl(e, t, n = !1) {
|
|
2282
2296
|
if ("undefined" != typeof window && window.localStorage) try {
|
|
2283
2297
|
let r = window.localStorage.getItem(e);
|
|
2284
|
-
return null === r ? (n &&
|
|
2298
|
+
return null === r ? (n && Ul(e, t), t) : JSON.parse(r);
|
|
2285
2299
|
} catch (n) {
|
|
2286
2300
|
return window.console.warn(`Error reading localStorage key "${e}":`, n), t;
|
|
2287
2301
|
}
|
|
2288
2302
|
}
|
|
2289
|
-
function
|
|
2303
|
+
function Ul(e, t) {
|
|
2290
2304
|
if ("undefined" == typeof window || !window.localStorage) return 0;
|
|
2291
|
-
if (!e || void 0 === t) return
|
|
2305
|
+
if (!e || void 0 === t) return ar(`kw_set_local_storage_value(): invalid key or value: key=${e}`), -1;
|
|
2292
2306
|
try {
|
|
2293
2307
|
return window.localStorage.setItem(e, JSON.stringify(t)), 0;
|
|
2294
2308
|
} catch (t) {
|
|
2295
|
-
return
|
|
2309
|
+
return ar(`kw_set_local_storage_value(): cannot save "${e}" (storage full or blocked?): ${t && t.message ? t.message : t}`), -1;
|
|
2296
2310
|
}
|
|
2297
2311
|
}
|
|
2298
|
-
function
|
|
2312
|
+
function Fl(e) {
|
|
2299
2313
|
if ("undefined" != typeof window && window.localStorage) if (e) try {
|
|
2300
2314
|
window.localStorage.removeItem(e);
|
|
2301
2315
|
} catch (t) {
|
|
@@ -2303,125 +2317,125 @@ function Pl(e) {
|
|
|
2303
2317
|
}
|
|
2304
2318
|
else window.console.warn(`Invalid key for localStorage removal: ${e}`);
|
|
2305
2319
|
}
|
|
2306
|
-
function
|
|
2307
|
-
if (
|
|
2308
|
-
if (
|
|
2320
|
+
function Vl(e, t) {
|
|
2321
|
+
if (Xr(e) || Xr(t)) return !0;
|
|
2322
|
+
if (qr(e)) {
|
|
2309
2323
|
if (0 === e.length) return !0;
|
|
2310
2324
|
for (let n = 0; n < e.length; n++) if (e[n] === t) return !0;
|
|
2311
|
-
} else if (
|
|
2325
|
+
} else if (Jr(e)) {
|
|
2312
2326
|
if (0 === Object.keys(e).length) return !0;
|
|
2313
2327
|
for (let n in e) if (n === t) return !0;
|
|
2314
|
-
} else if (
|
|
2328
|
+
} else if (Hr(e) && e === t) return !0;
|
|
2315
2329
|
return !1;
|
|
2316
2330
|
}
|
|
2317
|
-
function
|
|
2318
|
-
if (e && !
|
|
2319
|
-
l || (l =
|
|
2331
|
+
function Gl(e, t, n, r, l) {
|
|
2332
|
+
if (e && !nl(e) && ar("GObj bad instanceof"), !t) return null;
|
|
2333
|
+
l || (l = Dl);
|
|
2320
2334
|
let o = [];
|
|
2321
|
-
if (
|
|
2335
|
+
if (qr(t)) for (let i = 0; i < t.length; i++) {
|
|
2322
2336
|
let s, a = t[i];
|
|
2323
|
-
if (
|
|
2337
|
+
if (Jr(a)) s = vl(e, a, "id", "", 0);
|
|
2324
2338
|
else {
|
|
2325
|
-
if (!
|
|
2339
|
+
if (!Hr(a)) continue;
|
|
2326
2340
|
s = a;
|
|
2327
2341
|
}
|
|
2328
|
-
|
|
2342
|
+
Vl(n, s) && l(a, r) && o.push(a);
|
|
2329
2343
|
}
|
|
2330
2344
|
else {
|
|
2331
|
-
if (!
|
|
2345
|
+
if (!Jr(t)) return ar("kw_collect() BAD kw parameter"), null;
|
|
2332
2346
|
for (let e of Object.keys(t)) {
|
|
2333
2347
|
let i = t[e];
|
|
2334
|
-
|
|
2348
|
+
Vl(n, e) && l(i, r) && o.push(i);
|
|
2335
2349
|
}
|
|
2336
2350
|
}
|
|
2337
2351
|
return o;
|
|
2338
2352
|
}
|
|
2339
|
-
function
|
|
2340
|
-
e && !
|
|
2353
|
+
function Ml(e, t, n) {
|
|
2354
|
+
e && !nl(e) && ar("GObj bad instanceof");
|
|
2341
2355
|
let r = {};
|
|
2342
|
-
if (
|
|
2343
|
-
else if (
|
|
2344
|
-
let l = t[n], o =
|
|
2345
|
-
|
|
2356
|
+
if (rl(n) || (t = ml(e, t, n)), Jr(t)) r = t;
|
|
2357
|
+
else if (qr(t)) for (let n = 0; n < t.length; n++) {
|
|
2358
|
+
let l = t[n], o = vl(e, l, "id", "", Vn.KW_REQUIRED);
|
|
2359
|
+
rl(o) || bl(r, o, l);
|
|
2346
2360
|
}
|
|
2347
|
-
else
|
|
2361
|
+
else ar(`${Rt(e)} kwid_new_dict: data type unknown`);
|
|
2348
2362
|
return r;
|
|
2349
2363
|
}
|
|
2350
|
-
function
|
|
2351
|
-
if (e && !
|
|
2352
|
-
if (
|
|
2364
|
+
function Wl(e, t, n) {
|
|
2365
|
+
if (e && !nl(e) && ar("GObj bad instanceof"), rl(n) || (t = ml(e, t, n)), qr(t)) return t;
|
|
2366
|
+
if (Jr(t)) {
|
|
2353
2367
|
let n = [];
|
|
2354
2368
|
for (let r of Object.keys(t)) {
|
|
2355
2369
|
let l = t[r];
|
|
2356
|
-
|
|
2370
|
+
Jr(l) ? (l.id = r, n.push(l)) : ar(`${Rt(e)} kwid_new_list: not a record: '${r}'`);
|
|
2357
2371
|
}
|
|
2358
2372
|
return n;
|
|
2359
2373
|
}
|
|
2360
|
-
return
|
|
2374
|
+
return ar(`${Rt(e)} kwid_new_list: wrong type for list`), [];
|
|
2361
2375
|
}
|
|
2362
|
-
function
|
|
2363
|
-
e && !
|
|
2364
|
-
let o =
|
|
2376
|
+
function xl(e, t, n, r, l) {
|
|
2377
|
+
e && !nl(e) && ar("GObj bad instanceof");
|
|
2378
|
+
let o = Gl(e, t, n, r, l);
|
|
2365
2379
|
return o && 0 !== o.length ? o[0] : null;
|
|
2366
2380
|
}
|
|
2367
|
-
function
|
|
2368
|
-
if (e && !
|
|
2381
|
+
function Kl(e, t) {
|
|
2382
|
+
if (e && !nl(e) && ar("GObj bad instanceof"), !t) return [];
|
|
2369
2383
|
let n = [];
|
|
2370
|
-
if (
|
|
2371
|
-
else if (
|
|
2372
|
-
else
|
|
2373
|
-
if (
|
|
2374
|
-
else if (
|
|
2375
|
-
let r =
|
|
2384
|
+
if (Hr(t)) n.push(t);
|
|
2385
|
+
else if (Jr(t)) for (let e in t) Object.prototype.hasOwnProperty.call(t, e) && n.push(e);
|
|
2386
|
+
else qr(t) && t.forEach(function(t) {
|
|
2387
|
+
if (Hr(t)) rl(t) || n.push(t);
|
|
2388
|
+
else if (Jr(t)) {
|
|
2389
|
+
let r = vl(e, t, "id", 0, 0);
|
|
2376
2390
|
r && n.push(r);
|
|
2377
2391
|
}
|
|
2378
2392
|
});
|
|
2379
2393
|
return n;
|
|
2380
2394
|
}
|
|
2381
|
-
function
|
|
2395
|
+
function Yl(e, t, n) {
|
|
2382
2396
|
t = t || "id", n = n || "value";
|
|
2383
2397
|
let r = [];
|
|
2384
|
-
if (
|
|
2398
|
+
if (qr(e)) for (let l = 0; l < e.length; l++) {
|
|
2385
2399
|
let o = e[l];
|
|
2386
|
-
if (
|
|
2400
|
+
if (Hr(o)) r.push({
|
|
2387
2401
|
id: e[l],
|
|
2388
2402
|
value: e[l]
|
|
2389
2403
|
});
|
|
2390
|
-
else if (
|
|
2404
|
+
else if (Jr(o)) {
|
|
2391
2405
|
let e = {};
|
|
2392
|
-
if (
|
|
2393
|
-
if (!
|
|
2394
|
-
if (!(
|
|
2395
|
-
|
|
2406
|
+
if (gl(o, t)) {
|
|
2407
|
+
if (!gl(o, n)) {
|
|
2408
|
+
if (!(Yr(o) > 0)) {
|
|
2409
|
+
ar("list2options(): object without field value: " + n);
|
|
2396
2410
|
continue;
|
|
2397
2411
|
}
|
|
2398
2412
|
n = Object.keys(o)[0];
|
|
2399
2413
|
}
|
|
2400
2414
|
e.id = o[t], e.value = o[n];
|
|
2401
2415
|
} else {
|
|
2402
|
-
if (!(
|
|
2403
|
-
|
|
2416
|
+
if (!(Yr(o) > 0)) {
|
|
2417
|
+
ar("list2options(): object without field id: " + t);
|
|
2404
2418
|
continue;
|
|
2405
2419
|
}
|
|
2406
2420
|
t = Object.keys(o)[0], e.id = t, e.value = o[t];
|
|
2407
2421
|
}
|
|
2408
2422
|
r.push(e);
|
|
2409
|
-
} else
|
|
2423
|
+
} else ar("list2options(): case1 not implemented");
|
|
2410
2424
|
}
|
|
2411
|
-
else if (
|
|
2425
|
+
else if (Jr(e)) for (let t of Object.keys(e)) r.push({
|
|
2412
2426
|
id: t,
|
|
2413
2427
|
value: t
|
|
2414
2428
|
});
|
|
2415
|
-
else
|
|
2429
|
+
else ar("list2options(): case2 not implemented");
|
|
2416
2430
|
return r;
|
|
2417
2431
|
}
|
|
2418
|
-
function
|
|
2432
|
+
function Bl(e, t) {
|
|
2419
2433
|
if (!e) return -1;
|
|
2420
2434
|
for (let n = 0; n < e.length; n++) if (e[n] && e[n].id === t) return n;
|
|
2421
2435
|
return -1;
|
|
2422
2436
|
}
|
|
2423
|
-
function
|
|
2424
|
-
if (!e || !t) return
|
|
2437
|
+
function Jl(e, t, n) {
|
|
2438
|
+
if (!e || !t) return ar("ERROR: str_in_list() list or str empty"), !1;
|
|
2425
2439
|
let r = e.length;
|
|
2426
2440
|
if (n) {
|
|
2427
2441
|
t = t.toLowerCase();
|
|
@@ -2432,17 +2446,17 @@ function Yl(e, t, n) {
|
|
|
2432
2446
|
} else for (let n = 0; n < r; n++) if (e[n] === t) return !0;
|
|
2433
2447
|
return !1;
|
|
2434
2448
|
}
|
|
2435
|
-
function
|
|
2436
|
-
if (!e) return
|
|
2437
|
-
if (!t) return
|
|
2438
|
-
for (let r = 0; r < t.length; r++) if (
|
|
2449
|
+
function ql(e, t, n) {
|
|
2450
|
+
if (!e) return ar("ERROR: strs_in_list() list empty"), !1;
|
|
2451
|
+
if (!t) return ar("ERROR: strs_in_list() str empty"), !1;
|
|
2452
|
+
for (let r = 0; r < t.length; r++) if (Jl(e, t[r], n)) return !0;
|
|
2439
2453
|
return !1;
|
|
2440
2454
|
}
|
|
2441
|
-
function
|
|
2455
|
+
function Hl(e, t) {
|
|
2442
2456
|
for (let n = 0; n < e.length; n++) if (t === e[n]) return e.splice(n, 1), !0;
|
|
2443
2457
|
return !1;
|
|
2444
2458
|
}
|
|
2445
|
-
function
|
|
2459
|
+
function zl(e, t) {
|
|
2446
2460
|
try {
|
|
2447
2461
|
let n = e.__md_iev__;
|
|
2448
2462
|
if (n) return n[t];
|
|
@@ -2450,53 +2464,53 @@ function ql(e, t) {
|
|
|
2450
2464
|
return;
|
|
2451
2465
|
}
|
|
2452
2466
|
}
|
|
2453
|
-
function
|
|
2467
|
+
function Ql(e, t, n) {
|
|
2454
2468
|
let r = e.__md_iev__;
|
|
2455
2469
|
r || (r = {}, e.__md_iev__ = r), r[t] = n;
|
|
2456
2470
|
}
|
|
2457
|
-
function
|
|
2458
|
-
if (!
|
|
2471
|
+
function Xl(e, t, n, r) {
|
|
2472
|
+
if (!nl(e)) return ar("gobj is not a GObj"), null;
|
|
2459
2473
|
if (!t) return;
|
|
2460
|
-
let l =
|
|
2461
|
-
l || (l = [],
|
|
2474
|
+
let l = zl(t, n);
|
|
2475
|
+
l || (l = [], Ql(t, n, l));
|
|
2462
2476
|
try {
|
|
2463
|
-
|
|
2477
|
+
qr(l) && l.unshift(r);
|
|
2464
2478
|
} catch (e) {
|
|
2465
|
-
|
|
2479
|
+
ar(e);
|
|
2466
2480
|
}
|
|
2467
2481
|
}
|
|
2468
|
-
function
|
|
2469
|
-
if (!
|
|
2470
|
-
if (!
|
|
2471
|
-
let l =
|
|
2472
|
-
return l ? 0 === l.length ? (r &&
|
|
2482
|
+
function Zl(e, t, n, r) {
|
|
2483
|
+
if (!nl(e)) return ar("gobj is not a GObj"), null;
|
|
2484
|
+
if (!Jr(t)) return ar("kw is not a dict"), null;
|
|
2485
|
+
let l = zl(t, n);
|
|
2486
|
+
return l ? 0 === l.length ? (r && ar(`stack empty: ${n}`), null) : l[0] : (r && ar(`stack NOT FOUND: ${n}`), null);
|
|
2473
2487
|
}
|
|
2474
|
-
function
|
|
2475
|
-
return
|
|
2488
|
+
function eo(e, t, n) {
|
|
2489
|
+
return rl(n) ? hl(e, t, "__md_iev__`__msg_type__") : $l(e, t, "__md_iev__", "__msg_type__", n), 0;
|
|
2476
2490
|
}
|
|
2477
|
-
function
|
|
2478
|
-
return
|
|
2491
|
+
function to(e, t) {
|
|
2492
|
+
return vl(e, t, "__md_iev__`__msg_type__", "", 0);
|
|
2479
2493
|
}
|
|
2480
|
-
function
|
|
2494
|
+
function no(e, t, n) {
|
|
2481
2495
|
let r = new XMLHttpRequest();
|
|
2482
2496
|
r.open("GET", e, !0), r.setRequestHeader("Accept", "application/json"), r.onreadystatechange = function() {
|
|
2483
2497
|
if (4 === r.readyState) if (200 === r.status || 0 === (e = r).status && e.responseText && e.responseURL.startsWith("file:")) try {
|
|
2484
2498
|
t(JSON.parse(r.responseText));
|
|
2485
2499
|
} catch (e) {
|
|
2486
|
-
n && (
|
|
2500
|
+
n && (ar(`JSON parse status ${r.status}, error: ${e.message}`), n(r.status));
|
|
2487
2501
|
}
|
|
2488
2502
|
else n && n(r.status);
|
|
2489
2503
|
var e;
|
|
2490
2504
|
}, r.send();
|
|
2491
2505
|
}
|
|
2492
|
-
function
|
|
2506
|
+
function ro(e, t, n) {
|
|
2493
2507
|
let r = new XMLHttpRequest();
|
|
2494
2508
|
r.open("POST", e), r.setRequestHeader("Accept", "application/json"), r.setRequestHeader("Content-Type", "application/json"), r.onreadystatechange = function() {
|
|
2495
2509
|
4 === r.readyState && n(r.status, r.responseText);
|
|
2496
2510
|
}, r.send(t);
|
|
2497
2511
|
}
|
|
2498
|
-
function
|
|
2499
|
-
void 0 !== n &&
|
|
2512
|
+
function lo(e, t, n) {
|
|
2513
|
+
void 0 !== n && Hr(n) || (n = "");
|
|
2500
2514
|
for (let r of Object.keys(e)) {
|
|
2501
2515
|
if (!Object.prototype.hasOwnProperty.call(e, r)) continue;
|
|
2502
2516
|
let l = (n.length ? "`" : "") + r;
|
|
@@ -2505,62 +2519,62 @@ function no(e, t, n) {
|
|
|
2505
2519
|
r,
|
|
2506
2520
|
e[r],
|
|
2507
2521
|
n
|
|
2508
|
-
]),
|
|
2522
|
+
]), Jr(e[r]) && lo(e[r], t, n), n = n.slice(0, -l.length);
|
|
2509
2523
|
}
|
|
2510
2524
|
}
|
|
2511
|
-
function
|
|
2512
|
-
n && (e =
|
|
2513
|
-
let r =
|
|
2514
|
-
|
|
2515
|
-
let l =
|
|
2516
|
-
return
|
|
2517
|
-
"__" === t.substring(0, 2) ||
|
|
2525
|
+
function oo(e, t, n) {
|
|
2526
|
+
n && (e = Rr(e));
|
|
2527
|
+
let r = Nl(null, e, "type", [], Vn.KW_CREATE);
|
|
2528
|
+
vl(null, e, "hook", "data", Vn.KW_CREATE);
|
|
2529
|
+
let l = Nl(null, e, "schema", {}, Vn.KW_CREATE), o = Nl(null, e, "topics", {}, Vn.KW_CREATE);
|
|
2530
|
+
return lo(l, function(e, t, n, l) {
|
|
2531
|
+
"__" === t.substring(0, 2) || Jr(n) || Nl(null, o, l, Rr(r), Vn.KW_CREATE);
|
|
2518
2532
|
}, t), e;
|
|
2519
2533
|
}
|
|
2520
|
-
function
|
|
2521
|
-
let l =
|
|
2522
|
-
if (!l) return
|
|
2523
|
-
if (!
|
|
2524
|
-
if (!
|
|
2525
|
-
if ("" !== n && n.split("`").includes("")) return
|
|
2534
|
+
function io(e, t, n, r) {
|
|
2535
|
+
let l = Nl(null, Nl(null, e, "topics", null, 0), t, null, 0);
|
|
2536
|
+
if (!l) return ar("jdb_update: topic not found: " + t), null;
|
|
2537
|
+
if (!Jr(r) || rl(r.id)) return ar(`jdb_update: record without id: ${lr(r)}`), null;
|
|
2538
|
+
if (!Hr(n)) return ar(`jdb_update: path must be a string: ${String(n)}`), null;
|
|
2539
|
+
if ("" !== n && n.split("`").includes("")) return ar(`jdb_update: empty segment in path: '${n}'`), null;
|
|
2526
2540
|
let o, i, s = n.split("`"), a = l;
|
|
2527
|
-
for (; (o = s.shift()) && !
|
|
2528
|
-
if (!a || 0 !== s.length) return
|
|
2529
|
-
if (
|
|
2541
|
+
for (; (o = s.shift()) && !rl(o) && a;) Jr(a) && (a = Nl(null, a, e.hook, null, 0)), a = co(a, null, o, !1);
|
|
2542
|
+
if (!a || 0 !== s.length) return ar(`jdb_update: path not found in topic '${t}': '${n}'`), null;
|
|
2543
|
+
if (qr(a)) i = a;
|
|
2530
2544
|
else {
|
|
2531
|
-
if (a.id === r.id) return
|
|
2532
|
-
if (i =
|
|
2533
|
-
else if (!
|
|
2534
|
-
}
|
|
2535
|
-
let u =
|
|
2536
|
-
return u ?
|
|
2537
|
-
}
|
|
2538
|
-
function oo(e, t, n, r) {
|
|
2539
|
-
let l = Ol(null, Ol(null, e, "topics", null, 0), t, null, 0);
|
|
2540
|
-
if (!l) return ir("jdb_delete: topic not found: " + t), null;
|
|
2541
|
-
if (!Yr(r) || tl(r.id)) return ir(`jdb_delete: record without id: ${lr(r)}`), null;
|
|
2542
|
-
if (!Jr(n)) return ir(`jdb_delete: path must be a string: ${String(n)}`), null;
|
|
2543
|
-
if ("" !== n && n.split("`").includes("")) return ir(`jdb_delete: empty segment in path: '${n}'`), null;
|
|
2544
|
-
let o, i = n.split("`"), s = l;
|
|
2545
|
-
for (; (o = i.shift()) && !tl(o) && s;) Yr(s) && (s = Ol(null, s, e.hook, null, 0)), s = uo(s, null, o, !1);
|
|
2546
|
-
if (!s || 0 !== i.length) return ir(`jdb_delete: path not found in topic '${t}': '${n}'`), null;
|
|
2547
|
-
let a = Br(s) ? s : Ol(null, s, e.hook, null, 0), u = Kl(a, r.id);
|
|
2548
|
-
return u < 0 ? (ir(`jdb_delete: record not found in topic '${t}': '${n}' '${r.id}'`), null) : (a.splice(u, 1), l);
|
|
2549
|
-
}
|
|
2550
|
-
function io(e, t) {
|
|
2551
|
-
let n = Ol(null, e, "topics", null, 0);
|
|
2552
|
-
if (!n) return ir("jdb topics section not found"), _r(e), null;
|
|
2553
|
-
return Ol(null, n, t, null, 0) || (ir("jdb topic not found: " + t), _r(n), null);
|
|
2545
|
+
if (a.id === r.id) return kr(a, r), l;
|
|
2546
|
+
if (i = Nl(null, a, e.hook, null, 0), null == i) i = [], Ur(a, e.hook, i);
|
|
2547
|
+
else if (!qr(i)) return ar(`jdb_update: the hook '${e.hook}' of '${n}' is not a list in topic '${t}'`), null;
|
|
2548
|
+
}
|
|
2549
|
+
let u = co(i, e.hook, r.id, !1);
|
|
2550
|
+
return u ? kr(u, r) : i.push(r), l;
|
|
2554
2551
|
}
|
|
2555
2552
|
function so(e, t, n, r) {
|
|
2556
|
-
let l =
|
|
2557
|
-
|
|
2553
|
+
let l = Nl(null, Nl(null, e, "topics", null, 0), t, null, 0);
|
|
2554
|
+
if (!l) return ar("jdb_delete: topic not found: " + t), null;
|
|
2555
|
+
if (!Jr(r) || rl(r.id)) return ar(`jdb_delete: record without id: ${lr(r)}`), null;
|
|
2556
|
+
if (!Hr(n)) return ar(`jdb_delete: path must be a string: ${String(n)}`), null;
|
|
2557
|
+
if ("" !== n && n.split("`").includes("")) return ar(`jdb_delete: empty segment in path: '${n}'`), null;
|
|
2558
|
+
let o, i = n.split("`"), s = l;
|
|
2559
|
+
for (; (o = i.shift()) && !rl(o) && s;) Jr(s) && (s = Nl(null, s, e.hook, null, 0)), s = co(s, null, o, !1);
|
|
2560
|
+
if (!s || 0 !== i.length) return ar(`jdb_delete: path not found in topic '${t}': '${n}'`), null;
|
|
2561
|
+
let a = qr(s) ? s : Nl(null, s, e.hook, null, 0), u = Bl(a, r.id);
|
|
2562
|
+
return u < 0 ? (ar(`jdb_delete: record not found in topic '${t}': '${n}' '${r.id}'`), null) : (a.splice(u, 1), l);
|
|
2558
2563
|
}
|
|
2559
|
-
function ao(e, t
|
|
2560
|
-
let
|
|
2561
|
-
|
|
2564
|
+
function ao(e, t) {
|
|
2565
|
+
let n = Nl(null, e, "topics", null, 0);
|
|
2566
|
+
if (!n) return ar("jdb topics section not found"), fr(e), null;
|
|
2567
|
+
return Nl(null, n, t, null, 0) || (ar("jdb topic not found: " + t), fr(n), null);
|
|
2562
2568
|
}
|
|
2563
2569
|
function uo(e, t, n, r) {
|
|
2570
|
+
let l = Nl(null, Nl(null, e, "topics", null, 0), t, null, 0);
|
|
2571
|
+
return l ? (void 0 === r && (r = !0), co(l, e.hook, n, r)) : (ar("jdb_get: topic not found: " + t), null);
|
|
2572
|
+
}
|
|
2573
|
+
function _o(e, t, n) {
|
|
2574
|
+
let r = Nl(null, Nl(null, e, "topics", null, 0), t, null, 0);
|
|
2575
|
+
return r ? n < r.length ? r[n] : {} : (ar("jdb_get_by_idx: topic not found: " + t), null);
|
|
2576
|
+
}
|
|
2577
|
+
function co(e, t, n, r) {
|
|
2564
2578
|
if (!e) return null;
|
|
2565
2579
|
let l, o = e.length;
|
|
2566
2580
|
for (l = 0; l < o; l++) {
|
|
@@ -2568,19 +2582,19 @@ function uo(e, t, n, r) {
|
|
|
2568
2582
|
if (o) {
|
|
2569
2583
|
let e = o.id;
|
|
2570
2584
|
if (e && e === n) return o;
|
|
2571
|
-
if (r &&
|
|
2572
|
-
let e =
|
|
2585
|
+
if (r && gl(o, t)) {
|
|
2586
|
+
let e = co(o[t], t, n, r);
|
|
2573
2587
|
if (e) return e;
|
|
2574
2588
|
}
|
|
2575
2589
|
}
|
|
2576
2590
|
}
|
|
2577
2591
|
return null;
|
|
2578
2592
|
}
|
|
2579
|
-
function
|
|
2580
|
-
let n =
|
|
2581
|
-
return
|
|
2593
|
+
function fo(e, t) {
|
|
2594
|
+
let n = Rr(e);
|
|
2595
|
+
return Ir(n, t), n;
|
|
2582
2596
|
}
|
|
2583
|
-
function
|
|
2597
|
+
function go(e) {
|
|
2584
2598
|
function t(e) {
|
|
2585
2599
|
let t = e.replace(/-/g, "+").replace(/_/g, "/");
|
|
2586
2600
|
switch (t.length % 4) {
|
|
@@ -2611,9 +2625,9 @@ function co(e) {
|
|
|
2611
2625
|
signature: t(n[2])
|
|
2612
2626
|
};
|
|
2613
2627
|
}
|
|
2614
|
-
function
|
|
2628
|
+
function bo(e, t) {
|
|
2615
2629
|
try {
|
|
2616
|
-
let n =
|
|
2630
|
+
let n = go(e);
|
|
2617
2631
|
switch (t) {
|
|
2618
2632
|
case "header": return JSON.parse(n.header);
|
|
2619
2633
|
case "signature": return JSON.parse(n.signature);
|
|
@@ -2623,15 +2637,15 @@ function fo(e, t) {
|
|
|
2623
2637
|
return null;
|
|
2624
2638
|
}
|
|
2625
2639
|
}
|
|
2626
|
-
function
|
|
2640
|
+
function po(e) {
|
|
2627
2641
|
return null == e ? "" : String(e).replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
2628
2642
|
}
|
|
2629
|
-
function
|
|
2643
|
+
function mo(e) {
|
|
2630
2644
|
if (!e) return "";
|
|
2631
2645
|
const t = String(e).trim();
|
|
2632
|
-
return /^javascript:/i.test(t) || /^data:/i.test(t) ? "" :
|
|
2646
|
+
return /^javascript:/i.test(t) || /^data:/i.test(t) ? "" : po(t);
|
|
2633
2647
|
}
|
|
2634
|
-
var
|
|
2648
|
+
var ho = class {
|
|
2635
2649
|
constructor(e) {
|
|
2636
2650
|
this.html = e, Object.freeze(this);
|
|
2637
2651
|
}
|
|
@@ -2639,52 +2653,52 @@ var po = class {
|
|
|
2639
2653
|
return this.html;
|
|
2640
2654
|
}
|
|
2641
2655
|
};
|
|
2642
|
-
function
|
|
2643
|
-
return "string" != typeof e ? (
|
|
2656
|
+
function Eo(e) {
|
|
2657
|
+
return "string" != typeof e ? (ar("html_markup: not a string, type " + typeof e), new ho("")) : new ho(e);
|
|
2644
2658
|
}
|
|
2645
|
-
function
|
|
2646
|
-
return e instanceof
|
|
2659
|
+
function yo(e) {
|
|
2660
|
+
return e instanceof ho;
|
|
2647
2661
|
}
|
|
2648
|
-
function
|
|
2662
|
+
function To(e) {
|
|
2649
2663
|
const t = document.createElement("template");
|
|
2650
2664
|
return t.innerHTML = e.html.trim(), t.content;
|
|
2651
2665
|
}
|
|
2652
|
-
var
|
|
2653
|
-
function
|
|
2654
|
-
|
|
2666
|
+
var vo = !1, Oo = /* @__PURE__ */ new Set();
|
|
2667
|
+
function So(e) {
|
|
2668
|
+
vo = !!e;
|
|
2655
2669
|
}
|
|
2656
|
-
function
|
|
2657
|
-
return
|
|
2670
|
+
function No() {
|
|
2671
|
+
return vo;
|
|
2658
2672
|
}
|
|
2659
|
-
function
|
|
2673
|
+
function wo(e) {
|
|
2660
2674
|
const t = document.createElement("template");
|
|
2661
2675
|
return t.innerHTML = e.trim(), t.content.firstChild;
|
|
2662
2676
|
}
|
|
2663
|
-
function
|
|
2677
|
+
function jo(e, t) {
|
|
2664
2678
|
let [n, r, l, o] = e;
|
|
2665
|
-
if (!n) return void
|
|
2679
|
+
if (!n) return void ar("Tag must be a valid HTML element.");
|
|
2666
2680
|
let i = document.createElement(n), s = "";
|
|
2667
2681
|
if (r && "object" == typeof r) for (let e of Object.keys(r)) if ("style" === e && "object" == typeof r[e]) {
|
|
2668
2682
|
let t = "";
|
|
2669
2683
|
for (const n of Object.keys(r[e])) t += `${n}: ${r[e][n]};`;
|
|
2670
2684
|
i.style.cssText = t;
|
|
2671
2685
|
} else "style" === e ? i.style.cssText = r[e] : "i18n" === e || "data-i18n" === e || "data_i18next" === e || "data-i18next" === e ? null !== r[e] && void 0 !== r[e] && (s = r[e], i.setAttribute("data-i18n", s)) : i.setAttribute(e, r[e]);
|
|
2672
|
-
if (
|
|
2673
|
-
else if (
|
|
2686
|
+
if (yo(l)) i.appendChild(To(l));
|
|
2687
|
+
else if (Hr(l)) if (l = l.trim(), l.length > 0 && "<" === l[0] && !vo) i.appendChild(wo(l));
|
|
2674
2688
|
else if (l.length > 0 && "<" === l[0] && function(e) {
|
|
2675
|
-
if (
|
|
2689
|
+
if (Oo.size >= 100) return;
|
|
2676
2690
|
const t = e.slice(0, 80);
|
|
2677
|
-
|
|
2691
|
+
Oo.has(t) || (Oo.add(t), ur(`createElement2: a string that starts with '<' is TEXT (set_strings_are_text): use html_markup() if it is markup: ${JSON.stringify(t)}`));
|
|
2678
2692
|
}(l), t && s) i.textContent = t(s) || l;
|
|
2679
2693
|
else i.textContent = l;
|
|
2680
|
-
else if (
|
|
2681
|
-
if (l.length > 0) if (
|
|
2682
|
-
else for (let e of l) Array.isArray(e) ? e.length > 0 && i.appendChild(
|
|
2683
|
-
} else l instanceof HTMLElement || l instanceof Text || l instanceof SVGElement ? i.appendChild(l) : null != l && (
|
|
2694
|
+
else if (qr(l)) {
|
|
2695
|
+
if (l.length > 0) if (Hr(l[0])) i.appendChild(jo(l, t));
|
|
2696
|
+
else for (let e of l) Array.isArray(e) ? e.length > 0 && i.appendChild(jo(e, t)) : e instanceof Node ? i.appendChild(e) : yo(e) ? i.appendChild(To(e)) : Hr(e) ? i.appendChild(document.createTextNode(e)) : null != e && !1 !== e && ar("createElement2: child ignored, type " + typeof e);
|
|
2697
|
+
} else l instanceof HTMLElement || l instanceof Text || l instanceof SVGElement ? i.appendChild(l) : null != l && (ar("content ignored"), gr(l));
|
|
2684
2698
|
if (o && "object" == typeof o) for (const e of Object.keys(o)) i.addEventListener(e, o[e]);
|
|
2685
2699
|
return i;
|
|
2686
2700
|
}
|
|
2687
|
-
function
|
|
2701
|
+
function $o(e) {
|
|
2688
2702
|
if (!e) return {
|
|
2689
2703
|
top: 0,
|
|
2690
2704
|
left: 0,
|
|
@@ -2704,11 +2718,11 @@ function wo(e) {
|
|
|
2704
2718
|
bottom: t + i + l
|
|
2705
2719
|
};
|
|
2706
2720
|
}
|
|
2707
|
-
function
|
|
2721
|
+
function Ro(e) {
|
|
2708
2722
|
return new DOMParser().parseFromString(e, "image/svg+xml").firstChild;
|
|
2709
2723
|
}
|
|
2710
|
-
function
|
|
2711
|
-
if (!
|
|
2724
|
+
function Do(e, t) {
|
|
2725
|
+
if (!tl(t)) return void ar("You must supply a translation function");
|
|
2712
2726
|
e || (e = document);
|
|
2713
2727
|
const n = (t) => {
|
|
2714
2728
|
let n = [];
|
|
@@ -2731,41 +2745,41 @@ function $o(e, t) {
|
|
|
2731
2745
|
n && e.setAttribute("placeholder", t(n));
|
|
2732
2746
|
});
|
|
2733
2747
|
}
|
|
2734
|
-
function
|
|
2748
|
+
function Ao(e = "Time Tracker", t = !1) {
|
|
2735
2749
|
const n = e, r = performance.now();
|
|
2736
2750
|
let l = r;
|
|
2737
|
-
return t &&
|
|
2751
|
+
return t && ur(`--\x3e ${n} - starting`), { mark: (e = "Intermediate", o = "") => {
|
|
2738
2752
|
const i = performance.now(), s = (i - l) / 1e3, a = (i - r) / 1e3;
|
|
2739
|
-
return t &&
|
|
2753
|
+
return t && ur(`--\x3e ${n} ${e} - partial: ${s} sec, total: ${a} sec, ${o}`), l = i, {
|
|
2740
2754
|
partial: s,
|
|
2741
2755
|
total: a
|
|
2742
2756
|
};
|
|
2743
2757
|
} };
|
|
2744
2758
|
}
|
|
2745
|
-
function
|
|
2759
|
+
function ko(e) {
|
|
2746
2760
|
const t = (e, t) => String(e).padStart(t, "0"), n = `${(e = e || /* @__PURE__ */ new Date()).getFullYear()}-${t(e.getMonth() + 1, 2)}-${t(e.getDate(), 2)}T${t(e.getHours(), 2)}:${t(e.getMinutes(), 2)}:${t(e.getSeconds(), 2)}`, r = t(e.getMilliseconds(), 3), l = e.getTimezoneOffset();
|
|
2747
2761
|
return `${n}.${r}${l > 0 ? "-" : "+"}${t(Math.floor(Math.abs(l) / 60), 2)}${t(Math.abs(l) % 60, 2)}`;
|
|
2748
2762
|
}
|
|
2749
|
-
function
|
|
2763
|
+
function Io() {
|
|
2750
2764
|
return Math.floor(Date.now() / 1e3);
|
|
2751
2765
|
}
|
|
2752
|
-
function
|
|
2766
|
+
function Co(e, t) {
|
|
2753
2767
|
if (!e) throw "ERROR: index_in_list() list empty";
|
|
2754
2768
|
for (let n = 0; n < e.length; n++) if (t === e[n]) return n;
|
|
2755
2769
|
return -1;
|
|
2756
2770
|
}
|
|
2757
|
-
function
|
|
2771
|
+
function Lo() {
|
|
2758
2772
|
let e = "";
|
|
2759
2773
|
return "undefined" != typeof window && window.localStorage ? (e = window.localStorage.getItem("host_uuid"), !e && window.crypto?.randomUUID && (e = window.crypto.randomUUID(), window.localStorage.setItem("host_uuid", e))) : e = "undefined" != typeof globalThis && globalThis.crypto?.randomUUID ? globalThis.crypto.randomUUID() : "00000000-0000-0000-0000-000000000000", e;
|
|
2760
2774
|
}
|
|
2761
|
-
function
|
|
2775
|
+
function Po(e) {
|
|
2762
2776
|
return e.replace(/[?# ^:]/g, "_");
|
|
2763
2777
|
}
|
|
2764
|
-
function
|
|
2778
|
+
function Uo(e) {
|
|
2765
2779
|
let t = null;
|
|
2766
2780
|
return "function" != typeof e && "object" != typeof e || (t = ("" + e).match(/function\s*([\w\$]*)\s*\(/)), null !== t ? t[1] + "()" : "";
|
|
2767
2781
|
}
|
|
2768
|
-
function
|
|
2782
|
+
function Fo(e, t = 0, n = !1) {
|
|
2769
2783
|
let r = null, l = null, o = null;
|
|
2770
2784
|
const i = (...i) => {
|
|
2771
2785
|
o = this, l = i;
|
|
@@ -2780,20 +2794,20 @@ function Po(e, t = 0, n = !1) {
|
|
|
2780
2794
|
clearTimeout(r), r = null, l = null, o = null;
|
|
2781
2795
|
}, i;
|
|
2782
2796
|
}
|
|
2783
|
-
function
|
|
2797
|
+
function Vo(...e) {
|
|
2784
2798
|
let t = "", n = 0;
|
|
2785
2799
|
for (let r of e) null != r && "" !== r && (r = String(r), r = 0 === n ? r.replace(/\/+$/, "") : r.replace(/^\/+/, "").replace(/\/+$/, ""), "" !== r && (n > 0 && (t += "/"), t += r, n++));
|
|
2786
2800
|
return t;
|
|
2787
2801
|
}
|
|
2788
|
-
var
|
|
2789
|
-
function
|
|
2802
|
+
var Go = 256, Mo = 1e5;
|
|
2803
|
+
function Wo(e) {
|
|
2790
2804
|
const t = String(e).replace(/`/g, "``");
|
|
2791
2805
|
return "[" === t[0] ? "[" + t : t;
|
|
2792
2806
|
}
|
|
2793
|
-
function
|
|
2794
|
-
return Array.isArray(e) && 0 !== e.length ? e.map((e) => "number" == typeof e ? `[${e}]` :
|
|
2807
|
+
function xo(e) {
|
|
2808
|
+
return Array.isArray(e) && 0 !== e.length ? e.map((e) => "number" == typeof e ? `[${e}]` : Wo(e)).join("`") : "";
|
|
2795
2809
|
}
|
|
2796
|
-
function
|
|
2810
|
+
function Ko(e) {
|
|
2797
2811
|
if ("string" != typeof e) return null;
|
|
2798
2812
|
let t = [], n = "";
|
|
2799
2813
|
for (let r = 0; r < e.length; r++) if ("`" !== e[r]) n += e[r];
|
|
@@ -2814,9 +2828,9 @@ function Wo(e) {
|
|
|
2814
2828
|
return null !== t ? t : "[" === e[0] && "[" === e[1] ? e.slice(1) : e;
|
|
2815
2829
|
});
|
|
2816
2830
|
}
|
|
2817
|
-
function
|
|
2831
|
+
function Yo(e) {
|
|
2818
2832
|
const t = {}, n = (e, r, l) => {
|
|
2819
|
-
if (l >
|
|
2833
|
+
if (l > Go) throw new Error("json2flat: deeper than 256");
|
|
2820
2834
|
if (null === e || "object" != typeof e || Array.isArray(e)) {
|
|
2821
2835
|
if (Array.isArray(e) && e.length > 0) return void e.forEach((e, t) => {
|
|
2822
2836
|
const o = `[${t}]`;
|
|
@@ -2826,30 +2840,30 @@ function xo(e) {
|
|
|
2826
2840
|
const t = Object.keys(e);
|
|
2827
2841
|
if (t.length > 0) {
|
|
2828
2842
|
for (const o of t) {
|
|
2829
|
-
const t =
|
|
2843
|
+
const t = Wo(o);
|
|
2830
2844
|
n(e[o], 0 === l ? t : r + "`" + t, l + 1);
|
|
2831
2845
|
}
|
|
2832
2846
|
return;
|
|
2833
2847
|
}
|
|
2834
2848
|
}
|
|
2835
|
-
0 !== l &&
|
|
2849
|
+
0 !== l && bl(t, r, e);
|
|
2836
2850
|
};
|
|
2837
2851
|
return null == e || n(e, "", 0), t;
|
|
2838
2852
|
}
|
|
2839
|
-
function
|
|
2853
|
+
function Bo(e) {
|
|
2840
2854
|
if (null === e || "object" != typeof e || Array.isArray(e)) throw new Error("flat2json: a flat json is an object of id -> value");
|
|
2841
2855
|
let t = null;
|
|
2842
2856
|
for (const n of Object.keys(e)) {
|
|
2843
|
-
const r =
|
|
2857
|
+
const r = Ko(n);
|
|
2844
2858
|
if (!r || 0 === r.length) throw new Error(`flat2json: malformed flat id: '${n}'`);
|
|
2845
|
-
if (r.length >
|
|
2859
|
+
if (r.length > Go) throw new Error(`flat2json: '${n}' deeper than 256`);
|
|
2846
2860
|
const l = "number" == typeof r[0];
|
|
2847
2861
|
if (null === t) t = l ? [] : {};
|
|
2848
2862
|
else if (l !== Array.isArray(t)) throw new Error(`flat2json: '${n}' does not fit a ${Array.isArray(t) ? "array" : "object"} root`);
|
|
2849
2863
|
let o = t;
|
|
2850
2864
|
for (let t = 0; t < r.length; t++) {
|
|
2851
2865
|
const l = r[t], i = "number" == typeof l, s = t === r.length - 1, a = !s && "number" == typeof r[t + 1];
|
|
2852
|
-
if (i && l >
|
|
2866
|
+
if (i && l > Mo) throw new Error(`flat2json: array index ${l} over the limit (100000) in '${n}'`);
|
|
2853
2867
|
if (i !== Array.isArray(o)) throw new Error(`flat2json: '${n}' uses a ${i ? "array index" : "key"} where the tree already has a ${Array.isArray(o) ? "array" : "object"}`);
|
|
2854
2868
|
if (s) {
|
|
2855
2869
|
if (Array.isArray(o)) {
|
|
@@ -2857,7 +2871,7 @@ function Ko(e) {
|
|
|
2857
2871
|
o[l] = e[n];
|
|
2858
2872
|
} else {
|
|
2859
2873
|
if (Object.prototype.hasOwnProperty.call(o, l)) throw new Error(`flat2json: '${n}' is written twice, or once as a value and once as a container`);
|
|
2860
|
-
|
|
2874
|
+
bl(o, l, e[n]);
|
|
2861
2875
|
}
|
|
2862
2876
|
break;
|
|
2863
2877
|
}
|
|
@@ -2865,7 +2879,7 @@ function Ko(e) {
|
|
|
2865
2879
|
if (Array.isArray(o)) {
|
|
2866
2880
|
for (; o.length <= l;) o.push(null);
|
|
2867
2881
|
u = o[l], null == u && (u = a ? [] : {}, o[l] = u);
|
|
2868
|
-
} else u =
|
|
2882
|
+
} else u = dl(o, l) ? void 0 : o[l], void 0 === u && (u = a ? [] : {}, bl(o, l, u));
|
|
2869
2883
|
if (null === u || "object" != typeof u) throw new Error(`flat2json: '${n}' walks through a value: the same id is a leaf and a container at once`);
|
|
2870
2884
|
if (a !== Array.isArray(u)) throw new Error(`flat2json: '${n}' needs a ${a ? "array" : "object"} where the tree already has a ${Array.isArray(u) ? "array" : "object"}`);
|
|
2871
2885
|
o = u;
|
|
@@ -2873,68 +2887,68 @@ function Ko(e) {
|
|
|
2873
2887
|
}
|
|
2874
2888
|
return null === t ? {} : t;
|
|
2875
2889
|
}
|
|
2876
|
-
function
|
|
2890
|
+
function Jo(e, t) {
|
|
2877
2891
|
return e === t || null !== e && null !== t && "object" == typeof e && "object" == typeof t && JSON.stringify(e) === JSON.stringify(t);
|
|
2878
2892
|
}
|
|
2879
|
-
function
|
|
2893
|
+
function qo(e, t) {
|
|
2880
2894
|
const n = e && "object" == typeof e ? e : {}, r = t && "object" == typeof t ? t : {}, l = {
|
|
2881
2895
|
added: {},
|
|
2882
2896
|
removed: {},
|
|
2883
2897
|
changed: {}
|
|
2884
2898
|
};
|
|
2885
|
-
for (const e of Object.keys(n)) Object.prototype.hasOwnProperty.call(r, e) ?
|
|
2899
|
+
for (const e of Object.keys(n)) Object.prototype.hasOwnProperty.call(r, e) ? Jo(n[e], r[e]) || bl(l.changed, e, {
|
|
2886
2900
|
from: n[e],
|
|
2887
2901
|
to: r[e]
|
|
2888
|
-
}) :
|
|
2889
|
-
for (const e of Object.keys(r)) Object.prototype.hasOwnProperty.call(n, e) ||
|
|
2902
|
+
}) : bl(l.removed, e, n[e]);
|
|
2903
|
+
for (const e of Object.keys(r)) Object.prototype.hasOwnProperty.call(n, e) || bl(l.added, e, r[e]);
|
|
2890
2904
|
return l;
|
|
2891
2905
|
}
|
|
2892
|
-
function
|
|
2906
|
+
function Ho(e, t) {
|
|
2893
2907
|
if (null === e || "object" != typeof e || Array.isArray(e)) throw new Error("flat_apply: a flat json is an object of id -> value");
|
|
2894
2908
|
if (null === t || "object" != typeof t) throw new Error("flat_apply: a diff is the object flat_diff() answers");
|
|
2895
2909
|
for (const n of Object.keys(t.removed || {})) delete e[n];
|
|
2896
|
-
for (const n of Object.keys(t.added || {}))
|
|
2910
|
+
for (const n of Object.keys(t.added || {})) bl(e, n, t.added[n]);
|
|
2897
2911
|
for (const n of Object.keys(t.changed || {})) {
|
|
2898
2912
|
const r = t.changed[n];
|
|
2899
2913
|
if (!r || !Object.prototype.hasOwnProperty.call(r, "to")) throw new Error(`flat_apply: changed '${n}' without a 'to'`);
|
|
2900
|
-
|
|
2914
|
+
bl(e, n, r.to);
|
|
2901
2915
|
}
|
|
2902
2916
|
return e;
|
|
2903
2917
|
}
|
|
2904
|
-
function
|
|
2918
|
+
function zo(e) {
|
|
2905
2919
|
return "persistent-attrs-" + Rt(e);
|
|
2906
2920
|
}
|
|
2907
|
-
function
|
|
2908
|
-
let n = Xt(e, v.SDF_PERSIST), r =
|
|
2909
|
-
if (r &&
|
|
2910
|
-
let l =
|
|
2911
|
-
l =
|
|
2921
|
+
function Qo(e, t) {
|
|
2922
|
+
let n = Xt(e, v.SDF_PERSIST), r = Pl(zo(e), null, !1);
|
|
2923
|
+
if (r && Jr(r)) {
|
|
2924
|
+
let l = Cl(e, r, t, !1);
|
|
2925
|
+
l = Cl(e, l, n, !1), on(e, l, v.SDF_PERSIST);
|
|
2912
2926
|
}
|
|
2913
2927
|
}
|
|
2914
|
-
function
|
|
2915
|
-
let n =
|
|
2916
|
-
return r &&
|
|
2928
|
+
function Xo(e, t) {
|
|
2929
|
+
let n = Cl(e, Xt(e, v.SDF_PERSIST), t, !1), r = Pl(zo(e), null, !1);
|
|
2930
|
+
return r && Jr(r) && Cr(n, r), Ul(zo(e), n);
|
|
2917
2931
|
}
|
|
2918
|
-
function
|
|
2919
|
-
let n =
|
|
2920
|
-
0 ===
|
|
2932
|
+
function Zo(e, t) {
|
|
2933
|
+
let n = Ll(e, Pl(zo(e), null, !1), t, !1);
|
|
2934
|
+
0 === xr(n) ? Fl(zo(e)) : Ul(zo(e), n);
|
|
2921
2935
|
}
|
|
2922
|
-
function
|
|
2923
|
-
let n =
|
|
2924
|
-
return n &&
|
|
2936
|
+
function ei(e, t) {
|
|
2937
|
+
let n = Pl(zo(e), null, !1), r = {};
|
|
2938
|
+
return n && Jr(n) && (r = Cl(e, n, t, !1)), r;
|
|
2925
2939
|
}
|
|
2926
|
-
function
|
|
2927
|
-
if (
|
|
2940
|
+
function ti(e) {
|
|
2941
|
+
if (qr(e) && 1 === Yr(e)) {
|
|
2928
2942
|
let t = e[0];
|
|
2929
|
-
return
|
|
2943
|
+
return gl(t, "size") ? t.size : 1;
|
|
2930
2944
|
}
|
|
2931
|
-
return
|
|
2945
|
+
return Yr(e);
|
|
2932
2946
|
}
|
|
2933
|
-
function
|
|
2934
|
-
if (
|
|
2947
|
+
function ni(e, t) {
|
|
2948
|
+
if (Hr(t)) {
|
|
2935
2949
|
if (-1 === t.indexOf("^")) {
|
|
2936
2950
|
let n, r, l = e.fkey;
|
|
2937
|
-
if (1 !==
|
|
2951
|
+
if (1 !== xr(l)) return ar("bad fkey 1"), ar(e), ar(t), null;
|
|
2938
2952
|
for (const e of Object.keys(l)) {
|
|
2939
2953
|
n = e, r = l[e];
|
|
2940
2954
|
break;
|
|
@@ -2947,28 +2961,28 @@ function ei(e, t) {
|
|
|
2947
2961
|
}
|
|
2948
2962
|
{
|
|
2949
2963
|
let n = t.split("^");
|
|
2950
|
-
return 3 !== n.length ? (
|
|
2964
|
+
return 3 !== n.length ? (ar("bad fkey 2"), ar(e), ar(t), null) : {
|
|
2951
2965
|
topic_name: n[0],
|
|
2952
2966
|
id: n[1],
|
|
2953
2967
|
hook_name: n[2]
|
|
2954
2968
|
};
|
|
2955
2969
|
}
|
|
2956
2970
|
}
|
|
2957
|
-
return
|
|
2971
|
+
return Jr(t) ? {
|
|
2958
2972
|
topic_name: t.topic_name,
|
|
2959
2973
|
id: t.id,
|
|
2960
2974
|
hook_name: t.hook_name
|
|
2961
|
-
} : (
|
|
2975
|
+
} : (ar("bad fkey 3"), ar(e), ar(t), null);
|
|
2962
2976
|
}
|
|
2963
|
-
function
|
|
2964
|
-
let n =
|
|
2977
|
+
function ri(e, t) {
|
|
2978
|
+
let n = ni(e, t);
|
|
2965
2979
|
return n ? n.topic_name + "^" + n.id + "^" + n.hook_name : null;
|
|
2966
2980
|
}
|
|
2967
|
-
function
|
|
2968
|
-
if (
|
|
2981
|
+
function li(e, t) {
|
|
2982
|
+
if (Hr(t)) {
|
|
2969
2983
|
if (-1 === t.indexOf("^")) {
|
|
2970
2984
|
let n, r = e.hook;
|
|
2971
|
-
if (1 !==
|
|
2985
|
+
if (1 !== xr(r)) return ar("bad hook 1"), ar(e), ar(t), null;
|
|
2972
2986
|
for (let e of Object.keys(r)) {
|
|
2973
2987
|
n = e, r[e];
|
|
2974
2988
|
break;
|
|
@@ -2980,18 +2994,18 @@ function ni(e, t) {
|
|
|
2980
2994
|
}
|
|
2981
2995
|
{
|
|
2982
2996
|
let n = t.split("^");
|
|
2983
|
-
return 2 !== n.length ? (
|
|
2997
|
+
return 2 !== n.length ? (ar("bad hook 2"), ar(e), ar(t), null) : {
|
|
2984
2998
|
topic_name: n[0],
|
|
2985
2999
|
id: n[1]
|
|
2986
3000
|
};
|
|
2987
3001
|
}
|
|
2988
3002
|
}
|
|
2989
|
-
return
|
|
3003
|
+
return Jr(t) ? {
|
|
2990
3004
|
topic_name: t.topic_name,
|
|
2991
3005
|
id: t.id
|
|
2992
|
-
} : (
|
|
3006
|
+
} : (ar("bad hook 3"), ar(e), ar(t), null);
|
|
2993
3007
|
}
|
|
2994
|
-
var
|
|
3008
|
+
var oi = [
|
|
2995
3009
|
"string",
|
|
2996
3010
|
"integer",
|
|
2997
3011
|
"object",
|
|
@@ -3001,7 +3015,7 @@ var ri = [
|
|
|
3001
3015
|
"real",
|
|
3002
3016
|
"boolean",
|
|
3003
3017
|
"blob"
|
|
3004
|
-
],
|
|
3018
|
+
], ii = [
|
|
3005
3019
|
"persistent",
|
|
3006
3020
|
"required",
|
|
3007
3021
|
"notnull",
|
|
@@ -3013,7 +3027,7 @@ var ri = [
|
|
|
3013
3027
|
"stats",
|
|
3014
3028
|
"rstats",
|
|
3015
3029
|
"pstats"
|
|
3016
|
-
],
|
|
3030
|
+
], si = [
|
|
3017
3031
|
"hook",
|
|
3018
3032
|
"fkey",
|
|
3019
3033
|
"enum",
|
|
@@ -3042,7 +3056,7 @@ var ri = [
|
|
|
3042
3056
|
"coordinates",
|
|
3043
3057
|
"gbuffer"
|
|
3044
3058
|
];
|
|
3045
|
-
function
|
|
3059
|
+
function ai(e) {
|
|
3046
3060
|
let t = {
|
|
3047
3061
|
name: e.id,
|
|
3048
3062
|
header: e.header,
|
|
@@ -3061,7 +3075,7 @@ function ii(e) {
|
|
|
3061
3075
|
if (!e.flag) return t;
|
|
3062
3076
|
for (let n = 0; n < e.flag.length; n++) {
|
|
3063
3077
|
let r = e.flag[n];
|
|
3064
|
-
if (
|
|
3078
|
+
if (Jl(si, r)) {
|
|
3065
3079
|
switch (r) {
|
|
3066
3080
|
case "enum":
|
|
3067
3081
|
t.enum_list = e.enum;
|
|
@@ -3075,7 +3089,7 @@ function ii(e) {
|
|
|
3075
3089
|
case "file": t.is_file = !0;
|
|
3076
3090
|
}
|
|
3077
3091
|
t.type = r;
|
|
3078
|
-
} else if (
|
|
3092
|
+
} else if (Jl(ii, r)) switch (r) {
|
|
3079
3093
|
case "writable":
|
|
3080
3094
|
t.is_writable = !0;
|
|
3081
3095
|
break;
|
|
@@ -3088,7 +3102,7 @@ function ii(e) {
|
|
|
3088
3102
|
}
|
|
3089
3103
|
return t.is_file && (t.type = "file"), t;
|
|
3090
3104
|
}
|
|
3091
|
-
function
|
|
3105
|
+
function ui(e, t) {
|
|
3092
3106
|
let n = {
|
|
3093
3107
|
name: e,
|
|
3094
3108
|
header: e,
|
|
@@ -3102,13 +3116,13 @@ function si(e, t) {
|
|
|
3102
3116
|
placeholder: void 0,
|
|
3103
3117
|
fkey: null
|
|
3104
3118
|
};
|
|
3105
|
-
if (
|
|
3119
|
+
if (Hr(t)) {
|
|
3106
3120
|
let e = t.split(".");
|
|
3107
3121
|
for (let t = 0; t < e.length; t++) {
|
|
3108
3122
|
let r = e[t];
|
|
3109
|
-
if (
|
|
3110
|
-
else if (
|
|
3111
|
-
else if (
|
|
3123
|
+
if (Jl(oi, r)) n.real_type || (n.real_type = r);
|
|
3124
|
+
else if (Jl(si, r)) n.type || (n.type = r);
|
|
3125
|
+
else if (Jl(ii, r)) switch (r) {
|
|
3112
3126
|
case "writable":
|
|
3113
3127
|
n.is_writable = !0;
|
|
3114
3128
|
break;
|
|
@@ -3120,35 +3134,35 @@ function si(e, t) {
|
|
|
3120
3134
|
}
|
|
3121
3135
|
}
|
|
3122
3136
|
n.real_type || (n.real_type = "string");
|
|
3123
|
-
} else
|
|
3137
|
+
} else Jr(t) ? (n = ai(t), n.name || (n.name = e), n.header || (n.header = e)) : qr(t) && (n.real_type = "array", n.enum_list = t);
|
|
3124
3138
|
return n.type || (n.type = n.real_type), n;
|
|
3125
3139
|
}
|
|
3126
|
-
function
|
|
3140
|
+
function _i(e, t) {
|
|
3127
3141
|
let n = {};
|
|
3128
3142
|
return t || (t = {}), Object.entries(e).forEach(([e, r]) => {
|
|
3129
3143
|
let l;
|
|
3130
|
-
|
|
3131
|
-
let o =
|
|
3132
|
-
|
|
3144
|
+
Jr(r) && (l = r.default);
|
|
3145
|
+
let o = Nl(null, t, e, l);
|
|
3146
|
+
Ur(n, e, o);
|
|
3133
3147
|
}), n;
|
|
3134
3148
|
}
|
|
3135
|
-
var
|
|
3149
|
+
var ci = [
|
|
3136
3150
|
N(T.DTP_POINTER, "subscriber", 0, null, "Subscriber of output events"),
|
|
3137
3151
|
N(T.DTP_BOOLEAN, "periodic", 0, 0, "True for periodic timeouts"),
|
|
3138
3152
|
N(T.DTP_INTEGER, "msec", 0, 0, "Timeout in milliseconds"),
|
|
3139
3153
|
S()
|
|
3140
|
-
],
|
|
3154
|
+
], fi = {
|
|
3141
3155
|
periodic: !1,
|
|
3142
3156
|
msec: 0,
|
|
3143
3157
|
timer_id: -1
|
|
3144
|
-
},
|
|
3145
|
-
function
|
|
3158
|
+
}, gi = null;
|
|
3159
|
+
function di(e, t, n, r) {
|
|
3146
3160
|
let l = e.priv, o = l.periodic ? "EV_TIMEOUT_PERIODIC" : "EV_TIMEOUT";
|
|
3147
3161
|
return l.periodic && l.msec > 0 ? l.timer_id = setTimeout(function() {
|
|
3148
3162
|
Tn(e, "EV_TIMEOUT", {}, e);
|
|
3149
3163
|
}, l.msec) : l.timer_id = -1, It(e) ? Tn(At(e), o, {}, e) : Pn(e, o, {}), l.periodic || -1 !== l.timer_id || Et(e) && gt(e), 0;
|
|
3150
3164
|
}
|
|
3151
|
-
var
|
|
3165
|
+
var bi = {
|
|
3152
3166
|
mt_create: function(e) {
|
|
3153
3167
|
let t = e.priv;
|
|
3154
3168
|
const n = nn(e, "subscriber");
|
|
@@ -3173,31 +3187,31 @@ var gi = {
|
|
|
3173
3187
|
},
|
|
3174
3188
|
mt_destroy: function(e) {}
|
|
3175
3189
|
};
|
|
3176
|
-
function
|
|
3190
|
+
function pi() {
|
|
3177
3191
|
return function(e) {
|
|
3178
|
-
if (
|
|
3192
|
+
if (gi) return ar(`GClass ALREADY created: ${e}`), -1;
|
|
3179
3193
|
const t = [["ST_IDLE", [[
|
|
3180
3194
|
"EV_TIMEOUT",
|
|
3181
|
-
|
|
3195
|
+
di,
|
|
3182
3196
|
null
|
|
3183
3197
|
]]]];
|
|
3184
|
-
return (
|
|
3198
|
+
return (gi = Ae(e, [
|
|
3185
3199
|
["EV_TIMEOUT", U.EVF_OUTPUT_EVENT],
|
|
3186
3200
|
["EV_TIMEOUT_PERIODIC", U.EVF_OUTPUT_EVENT],
|
|
3187
3201
|
[0, 0]
|
|
3188
|
-
], t,
|
|
3202
|
+
], t, bi, 0, ci, fi, 0, 0, 0, C.gcflag_manual_start)) ? 0 : -1;
|
|
3189
3203
|
}("C_TIMER");
|
|
3190
3204
|
}
|
|
3191
|
-
function
|
|
3192
|
-
return e instanceof I ? "C_TIMER" !== $t(e) ? (
|
|
3205
|
+
function mi(e, t) {
|
|
3206
|
+
return e instanceof I ? "C_TIMER" !== $t(e) ? (ar("not C_TIMER GObj"), -1) : (sn(e, "periodic", !1), void an(e, "msec", t)) : (ar("not GObj TYPE"), -1);
|
|
3193
3207
|
}
|
|
3194
|
-
function
|
|
3195
|
-
return e instanceof I ? "C_TIMER" !== $t(e) ? (
|
|
3208
|
+
function hi(e, t) {
|
|
3209
|
+
return e instanceof I ? "C_TIMER" !== $t(e) ? (ar("not C_TIMER GObj"), -1) : (sn(e, "periodic", !0), void an(e, "msec", t)) : (ar("not GObj TYPE"), -1);
|
|
3196
3210
|
}
|
|
3197
|
-
function
|
|
3198
|
-
return e instanceof I ? "C_TIMER" !== $t(e) ? (
|
|
3211
|
+
function Ei(e) {
|
|
3212
|
+
return e instanceof I ? "C_TIMER" !== $t(e) ? (ar("not C_TIMER GObj"), -1) : void an(e, "msec", -1) : (ar("not GObj TYPE"), -1);
|
|
3199
3213
|
}
|
|
3200
|
-
var
|
|
3214
|
+
var yi = [
|
|
3201
3215
|
N(T.DTP_BOOLEAN, "changesLost", 0, !1, "Set true to warn about leaving page"),
|
|
3202
3216
|
N(T.DTP_BOOLEAN, "browser_beforeunload", 0, !1, "Set true to refreshing browser"),
|
|
3203
3217
|
N(T.DTP_STRING, "__username__", 0, "", "Username"),
|
|
@@ -3217,63 +3231,63 @@ var hi = [
|
|
|
3217
3231
|
N(T.DTP_BOOLEAN, "developer", 0, !1, "Developer mode enabled"),
|
|
3218
3232
|
N(T.DTP_INTEGER, "periodic_timeout", 0, "1000", "Timeout periodic, in miliseconds."),
|
|
3219
3233
|
S()
|
|
3220
|
-
],
|
|
3221
|
-
function
|
|
3234
|
+
], Ti = { gobj_timer: null }, vi = null;
|
|
3235
|
+
function Oi(e, t, n, r) {
|
|
3222
3236
|
let l = Qt(e, t);
|
|
3223
|
-
return
|
|
3237
|
+
return Jr(l) || (l = {}), l[n] = r, rn(e, t, l), He(e, t);
|
|
3224
3238
|
}
|
|
3225
|
-
function
|
|
3239
|
+
function Si(e) {
|
|
3226
3240
|
if (!0 === e || !1 === e) return e;
|
|
3227
3241
|
let t = String(null == e ? "" : e).toLowerCase();
|
|
3228
3242
|
return "true" === t || "set" === t || "false" !== t && "reset" !== t && ("" === t || isNaN(Number(t)) ? null : !!Number(t));
|
|
3229
3243
|
}
|
|
3230
|
-
function
|
|
3244
|
+
function Ni() {
|
|
3231
3245
|
return `${Nt()}^${St()}`;
|
|
3232
3246
|
}
|
|
3233
|
-
function
|
|
3247
|
+
function wi(e, t, n, r) {
|
|
3234
3248
|
return Pn(e, t, n), 0;
|
|
3235
3249
|
}
|
|
3236
|
-
var
|
|
3250
|
+
var ji = {
|
|
3237
3251
|
mt_create: function(e) {
|
|
3238
3252
|
let t = e.priv;
|
|
3239
|
-
un(e, "start_date",
|
|
3253
|
+
un(e, "start_date", ko()), un(e, "node_uuid", Lo()), e.priv.gobj_timer = ot(jt(e), "C_TIMER", {}, e), t.periodic_timeout = Qt(e, "periodic_timeout"), function(e) {
|
|
3240
3254
|
let t = Qt(e, "trace_levels");
|
|
3241
|
-
if (!
|
|
3255
|
+
if (!Jr(t)) return 0;
|
|
3242
3256
|
let n = t.__global_trace__;
|
|
3243
|
-
if (
|
|
3257
|
+
if (qr(n)) {
|
|
3244
3258
|
ce(4294967295, !1);
|
|
3245
3259
|
for (let e of n) se(e, !0);
|
|
3246
3260
|
}
|
|
3247
3261
|
for (const [n, r] of Object.entries(t)) {
|
|
3248
3262
|
let t = Me(n);
|
|
3249
|
-
if (t) if (
|
|
3263
|
+
if (t) if (qr(r)) {
|
|
3250
3264
|
Ee(t, null, !1);
|
|
3251
3265
|
for (let e of r) Ee(t, e, !0);
|
|
3252
|
-
} else
|
|
3266
|
+
} else ar(`${jt(e)}: trace_levels of ${n} MUST be a list`);
|
|
3253
3267
|
}
|
|
3254
3268
|
}(e), function(e) {
|
|
3255
3269
|
let t = Qt(e, "no_trace_levels");
|
|
3256
|
-
if (!
|
|
3270
|
+
if (!Jr(t)) return 0;
|
|
3257
3271
|
let n = t.__global_no_trace__;
|
|
3258
|
-
if (
|
|
3272
|
+
if (qr(n)) {
|
|
3259
3273
|
fe(4294967295, !1);
|
|
3260
3274
|
for (let e of n) ae(e, !0);
|
|
3261
3275
|
}
|
|
3262
3276
|
for (const [n, r] of Object.entries(t)) {
|
|
3263
3277
|
let t = Me(n);
|
|
3264
|
-
if (t) if (
|
|
3278
|
+
if (t) if (qr(r)) {
|
|
3265
3279
|
Te(t, null, !1);
|
|
3266
3280
|
for (let e of r) Te(t, e, !0);
|
|
3267
|
-
} else
|
|
3281
|
+
} else ar(`${jt(e)}: no_trace_levels of ${n} MUST be a list`);
|
|
3268
3282
|
}
|
|
3269
3283
|
}(e);
|
|
3270
3284
|
},
|
|
3271
3285
|
mt_writing: function(e, t) {},
|
|
3272
3286
|
mt_start: function(e) {
|
|
3273
|
-
return
|
|
3287
|
+
return hi(e.priv.gobj_timer, e.priv.periodic_timeout), 0;
|
|
3274
3288
|
},
|
|
3275
3289
|
mt_stop: function(e) {
|
|
3276
|
-
return
|
|
3290
|
+
return Ei(e.priv.gobj_timer), bt(e), 0;
|
|
3277
3291
|
},
|
|
3278
3292
|
mt_destroy: function(e) {},
|
|
3279
3293
|
mt_play: function(e) {
|
|
@@ -3290,35 +3304,35 @@ var Ni = {
|
|
|
3290
3304
|
case "get-global-no-trace": return o(0, 0, null, null, de());
|
|
3291
3305
|
case "set-global-trace":
|
|
3292
3306
|
case "set-global-no-trace": {
|
|
3293
|
-
let r = "set-global-no-trace" === t, l = n.level, i =
|
|
3294
|
-
return l ? null === i ? o(0, -1, `${
|
|
3307
|
+
let r = "set-global-no-trace" === t, l = n.level, i = Si(n.set);
|
|
3308
|
+
return l ? null === i ? o(0, -1, `${Ni()}: bitmask set or re-set?`, null, null) : (r ? ae(l, i) : se(l, i)) < 0 ? o(0, -1, `${Ni()}: global trace level not found: ${l}`, null, null) : r ? (Oi(e, "no_trace_levels", "__global_no_trace__", de()), o(0, 0, null, null, de())) : (Oi(e, "trace_levels", "__global_trace__", ge()), o(0, 0, null, null, ge())) : o(0, -1, `${Ni()}: what level?`, null, null);
|
|
3295
3309
|
}
|
|
3296
3310
|
case "get-gclass-trace":
|
|
3297
3311
|
case "get-gclass-no-trace":
|
|
3298
3312
|
case "set-gclass-trace":
|
|
3299
3313
|
case "set-gclass-no-trace": {
|
|
3300
3314
|
let r = t.indexOf("no-trace") >= 0, l = n.gclass_name || n.gclass || "", i = Me(l);
|
|
3301
|
-
if (!i) return o(0, -1, `${
|
|
3315
|
+
if (!i) return o(0, -1, `${Ni()}: what gclass is '${l}'?`, null, null);
|
|
3302
3316
|
if (0 === t.indexOf("get-")) return o(0, 0, null, null, r ? me(i) : be(i));
|
|
3303
|
-
let s = n.level, a =
|
|
3304
|
-
return s ? null === a ? o(0, -1, `${
|
|
3317
|
+
let s = n.level, a = Si(n.set);
|
|
3318
|
+
return s ? null === a ? o(0, -1, `${Ni()}: bitmask set or re-set?`, null, null) : (r ? Te(i, s, a) : Ee(i, s, a)) < 0 ? o(0, -1, `${Ni()}: trace level of ${l} not found: ${s}`, null, null) : r ? (Oi(e, "no_trace_levels", l, me(i)), o(0, 0, null, null, me(i))) : (Oi(e, "trace_levels", l, pe(i)), o(0, 0, null, null, be(i))) : o(0, -1, `${Ni()}: what level?`, null, null);
|
|
3305
3319
|
}
|
|
3306
|
-
default: return o(0, -1, `${
|
|
3320
|
+
default: return o(0, -1, `${Ni()}: command not available: ${t}`, null, null);
|
|
3307
3321
|
}
|
|
3308
3322
|
}
|
|
3309
3323
|
};
|
|
3310
|
-
function
|
|
3324
|
+
function $i() {
|
|
3311
3325
|
return function(e) {
|
|
3312
|
-
if (
|
|
3326
|
+
if (vi) return ar(`GClass ALREADY created: ${e}`), -1;
|
|
3313
3327
|
const t = [["ST_IDLE", [[
|
|
3314
3328
|
"EV_TIMEOUT_PERIODIC",
|
|
3315
|
-
|
|
3329
|
+
wi,
|
|
3316
3330
|
null
|
|
3317
3331
|
]]]];
|
|
3318
|
-
return (
|
|
3332
|
+
return (vi = Ae(e, [["EV_TIMEOUT_PERIODIC", U.EVF_OUTPUT_EVENT | U.EVF_NO_WARN_SUBS], [0, 0]], t, ji, 0, yi, Ti, 0, 0, 0, 0)) ? 0 : -1;
|
|
3319
3333
|
}("C_YUNO");
|
|
3320
3334
|
}
|
|
3321
|
-
var
|
|
3335
|
+
var Ri = "ievent_gate_stack", Di = [
|
|
3322
3336
|
N(T.DTP_STRING, "wanted_yuno_role", v.SDF_RD, "", "wanted yuno role"),
|
|
3323
3337
|
N(T.DTP_STRING, "wanted_yuno_name", v.SDF_RD, "", "wanted yuno name"),
|
|
3324
3338
|
N(T.DTP_STRING, "wanted_yuno_service", v.SDF_RD, "", "wanted yuno service"),
|
|
@@ -3335,15 +3349,15 @@ var ji = "ievent_gate_stack", $i = [
|
|
|
3335
3349
|
N(T.DTP_INTEGER, "timeout_idack", v.SDF_RD, "5000", "timeout waiting idAck"),
|
|
3336
3350
|
N(T.DTP_POINTER, "subscriber", 0, 0, "subscriber of output-events. If null then subscriber is the parent"),
|
|
3337
3351
|
S()
|
|
3338
|
-
],
|
|
3352
|
+
], Ai = [
|
|
3339
3353
|
["ievents", "Trace inter-events with metadata of kw"],
|
|
3340
3354
|
["ievents2", "Trace inter-events with full kw"],
|
|
3341
3355
|
["identity-card", "Trace identity_card messages"]
|
|
3342
3356
|
];
|
|
3343
|
-
function
|
|
3357
|
+
function ki(e) {
|
|
3344
3358
|
return !!(3 & Z(e));
|
|
3345
3359
|
}
|
|
3346
|
-
var
|
|
3360
|
+
var Ii = {
|
|
3347
3361
|
url: null,
|
|
3348
3362
|
remote_yuno_name: null,
|
|
3349
3363
|
remote_yuno_role: null,
|
|
@@ -3353,23 +3367,23 @@ var Ai = {
|
|
|
3353
3367
|
websocket: null,
|
|
3354
3368
|
inside_on_open: !1,
|
|
3355
3369
|
retry_ms: 0
|
|
3356
|
-
},
|
|
3357
|
-
function
|
|
3358
|
-
e.priv.websocket &&
|
|
3370
|
+
}, Ci = null;
|
|
3371
|
+
function Li(e) {
|
|
3372
|
+
e.priv.websocket && ar("Websocket ALREADY setup");
|
|
3359
3373
|
const t = tn(e, "url");
|
|
3360
|
-
|
|
3374
|
+
cr(`====> Starting WebSocket to '${t}' (${Rt(e)})`);
|
|
3361
3375
|
const n = ++e.priv.ws_seq;
|
|
3362
3376
|
let r;
|
|
3363
3377
|
try {
|
|
3364
3378
|
r = new WebSocket(t);
|
|
3365
3379
|
} catch (r) {
|
|
3366
|
-
return
|
|
3380
|
+
return ar(`${Rt(e)}: Cannot open WebSocket to '${t}', Error: ${r.message}`), hn(e, "EV_ON_CLOSE", {
|
|
3367
3381
|
url: t,
|
|
3368
3382
|
ws_seq: n,
|
|
3369
3383
|
code: 1006,
|
|
3370
3384
|
reason: r.message,
|
|
3371
3385
|
was_clean: !1
|
|
3372
|
-
}, e) < 0 &&
|
|
3386
|
+
}, e) < 0 && mi(e.priv.gobj_timer, Bi(e)), null;
|
|
3373
3387
|
}
|
|
3374
3388
|
return r ? (r.onopen = () => {
|
|
3375
3389
|
n !== e.priv.ws_seq || Ct(e) || Tn(e, "EV_ON_OPEN", {
|
|
@@ -3382,69 +3396,69 @@ function Ii(e) {
|
|
|
3382
3396
|
data: r.data
|
|
3383
3397
|
}, e);
|
|
3384
3398
|
}, r.onclose = (r) => {
|
|
3385
|
-
Ct(e) || n === e.priv.ws_seq && (Zt(Ot(), "browser_beforeunload") ?
|
|
3399
|
+
Ct(e) || n === e.priv.ws_seq && (Zt(Ot(), "browser_beforeunload") ? ur("Close websocket by unload page") : Tn(e, "EV_ON_CLOSE", {
|
|
3386
3400
|
url: t,
|
|
3387
3401
|
ws_seq: n,
|
|
3388
3402
|
code: r.code,
|
|
3389
3403
|
reason: r.reason,
|
|
3390
3404
|
was_clean: r.wasClean
|
|
3391
3405
|
}, e));
|
|
3392
|
-
}, r) : (
|
|
3406
|
+
}, r) : (ar(`${Rt(e)}: Failed to initialize WebSocket.`), null);
|
|
3393
3407
|
}
|
|
3394
|
-
function
|
|
3408
|
+
function Pi(e, t = 1e3, n = "") {
|
|
3395
3409
|
let r = e.priv, l = r.websocket;
|
|
3396
3410
|
if (r.websocket = null, l && l.readyState !== WebSocket.CLOSED && l.readyState !== WebSocket.CLOSING) {
|
|
3397
|
-
|
|
3411
|
+
cr(`Closing WebSocket (Code: ${t}, Reason: "${n}")`);
|
|
3398
3412
|
try {
|
|
3399
3413
|
l.close(t, n);
|
|
3400
3414
|
} catch (t) {
|
|
3401
|
-
|
|
3415
|
+
ar(`${Rt(e)}: Error closing WebSocket: ${t.message}`);
|
|
3402
3416
|
}
|
|
3403
|
-
} else
|
|
3417
|
+
} else ur("WebSocket is already closed or in the process of closing.");
|
|
3404
3418
|
}
|
|
3405
|
-
function
|
|
3406
|
-
let r =
|
|
3419
|
+
function Ui(e, t, n) {
|
|
3420
|
+
let r = ko();
|
|
3407
3421
|
try {
|
|
3408
|
-
|
|
3422
|
+
cr("\n" + r + " " + t + "\n"), $r(n);
|
|
3409
3423
|
} catch (e) {
|
|
3410
|
-
|
|
3424
|
+
cr("ERROR in trace_inter_event: " + e);
|
|
3411
3425
|
}
|
|
3412
3426
|
}
|
|
3413
|
-
var
|
|
3427
|
+
var Fi = class {
|
|
3414
3428
|
constructor(e, t) {
|
|
3415
3429
|
this.event = e, this.kw = t || {};
|
|
3416
3430
|
}
|
|
3417
3431
|
};
|
|
3418
|
-
function
|
|
3432
|
+
function Vi(e, t, n, r) {
|
|
3419
3433
|
return function(e, t) {
|
|
3420
3434
|
let n = e.priv, r = JSON.stringify(t);
|
|
3421
|
-
if (
|
|
3435
|
+
if (ki(e)) {
|
|
3422
3436
|
let n = tn(e, "url"), l = jt(Ot()) + " ==> " + n, o = Qt(Ot(), "trace_ievent_callback");
|
|
3423
|
-
o ? o(l, t, 1, r.length) :
|
|
3437
|
+
o ? o(l, t, 1, r.length) : Ui(0, l, t);
|
|
3424
3438
|
}
|
|
3425
|
-
if (!n.websocket || n.websocket.readyState !== WebSocket.OPEN) return
|
|
3439
|
+
if (!n.websocket || n.websocket.readyState !== WebSocket.OPEN) return ur(`${Rt(e)}: send_iev(): websocket not open, message lost`), -1;
|
|
3426
3440
|
try {
|
|
3427
3441
|
n.websocket.send(r);
|
|
3428
3442
|
} catch (t) {
|
|
3429
|
-
|
|
3443
|
+
ar(`${Rt(e)}: send_iev(): ${t}`);
|
|
3430
3444
|
}
|
|
3431
3445
|
return 0;
|
|
3432
3446
|
}(e, function(e, t) {
|
|
3433
|
-
return
|
|
3447
|
+
return rl(e) ? (ar("iev_create() event NULL"), null) : new Fi(e, t);
|
|
3434
3448
|
}(t, n));
|
|
3435
3449
|
}
|
|
3436
|
-
function
|
|
3437
|
-
return
|
|
3450
|
+
function Gi(e, t, n) {
|
|
3451
|
+
return rl(n) && (n = tn(e, "wanted_yuno_service")), {
|
|
3438
3452
|
dst_yuno: tn(e, "wanted_yuno_name"),
|
|
3439
3453
|
dst_role: tn(e, "wanted_yuno_role"),
|
|
3440
3454
|
dst_service: n,
|
|
3441
3455
|
src_yuno: St(),
|
|
3442
3456
|
src_role: Nt(),
|
|
3443
3457
|
src_service: t,
|
|
3444
|
-
host:
|
|
3458
|
+
host: Lo()
|
|
3445
3459
|
};
|
|
3446
3460
|
}
|
|
3447
|
-
function
|
|
3461
|
+
function Mi(e) {
|
|
3448
3462
|
let t = e.priv, n = vt(Ot()), r = tn(Ot(), "yuno_version"), l = tn(Ot(), "yuno_release"), o = tn(Ot(), "yuno_tag"), i = Qt(e, "required_services");
|
|
3449
3463
|
i && i.length || (i = Qt(Ot(), "required_services"));
|
|
3450
3464
|
let s = {
|
|
@@ -3462,34 +3476,34 @@ function Vi(e) {
|
|
|
3462
3476
|
username: tn(Ot(), "__username__"),
|
|
3463
3477
|
launch_id: 0,
|
|
3464
3478
|
yuno_startdate: tn(Ot(), "start_date"),
|
|
3465
|
-
id:
|
|
3479
|
+
id: Lo(),
|
|
3466
3480
|
user_agent: "undefined" != typeof window ? window.navigator.userAgent : "",
|
|
3467
3481
|
language: "undefined" != typeof window ? window.navigator.language : "",
|
|
3468
3482
|
required_services: i
|
|
3469
3483
|
};
|
|
3470
|
-
return
|
|
3484
|
+
return Xl(e, s, Ri, Gi(e, jt(At(e)), null)), eo(e, s, "__identity__"), mi(t.gobj_timer, en(e, "timeout_idack")), Vi(e, "EV_IDENTITY_CARD", s);
|
|
3471
3485
|
}
|
|
3472
|
-
function
|
|
3473
|
-
if (
|
|
3486
|
+
function Wi(e, t) {
|
|
3487
|
+
if (rl(t.event)) return -1;
|
|
3474
3488
|
let n = {}, r = t.__global__, l = t.__config__, o = t.__filter__, i = t.__service__, s = t.subscriber;
|
|
3475
3489
|
l && (n.__config__ = l), r && (n.__global__ = r), o && (n.__filter__ = o);
|
|
3476
|
-
return
|
|
3490
|
+
return Xl(e, n, Ri, Gi(e, jt(s), i)), eo(e, n, "__subscribing__"), Vi(e, t.event, n);
|
|
3477
3491
|
}
|
|
3478
|
-
function
|
|
3492
|
+
function xi(e, t, n, r) {
|
|
3479
3493
|
let l = e.priv;
|
|
3480
|
-
return Et(e) && (l.websocket =
|
|
3494
|
+
return Et(e) && (l.websocket = Li(e)), 0;
|
|
3481
3495
|
}
|
|
3482
|
-
function
|
|
3483
|
-
return
|
|
3496
|
+
function Ki(e, t, n, r) {
|
|
3497
|
+
return cr("Websocket opened: " + e.priv.url), Mi(e), 0;
|
|
3484
3498
|
}
|
|
3485
|
-
function
|
|
3499
|
+
function Yi(e, t, n, r) {
|
|
3486
3500
|
let l = e.priv, o = n.url;
|
|
3487
|
-
return void 0 !== n.ws_seq && n.ws_seq !== l.ws_seq || (rr(),
|
|
3501
|
+
return void 0 !== n.ws_seq && n.ws_seq !== l.ws_seq || (rr(), ur(`${Rt(e)}: WebSocket closed ${o} (Code: ${n.code}, Reason: "${n.reason}", Clean: ${n.was_clean})`), l.websocket && (l.websocket.onopen = null, l.websocket.onmessage = null, l.websocket.onerror = null, l.websocket.onclose = null, l.websocket = null), l.inform_on_close ? (l.inform_on_close = !1, Pn(e, "EV_ON_CLOSE", {
|
|
3488
3502
|
url: o,
|
|
3489
3503
|
remote_yuno_name: l.remote_yuno_name,
|
|
3490
3504
|
remote_yuno_role: l.remote_yuno_role,
|
|
3491
3505
|
remote_yuno_service: l.remote_yuno_service
|
|
3492
|
-
})) : Et(e) && (
|
|
3506
|
+
})) : Et(e) && (ur(`${Rt(e)}: EV_ON_OPEN_ERROR cannot open ${o} (Code: ${n.code}, Reason: "${n.reason}", Clean: ${n.was_clean})`), Pn(e, "EV_ON_OPEN_ERROR", {
|
|
3493
3507
|
url: o,
|
|
3494
3508
|
remote_yuno_name: l.remote_yuno_name,
|
|
3495
3509
|
remote_yuno_role: l.remote_yuno_role,
|
|
@@ -3497,25 +3511,25 @@ function xi(e, t, n, r) {
|
|
|
3497
3511
|
code: n.code,
|
|
3498
3512
|
reason: n.reason,
|
|
3499
3513
|
was_clean: n.was_clean
|
|
3500
|
-
})), Et(e) &&
|
|
3514
|
+
})), Et(e) && mi(l.gobj_timer, Bi(e))), 0;
|
|
3501
3515
|
}
|
|
3502
|
-
function
|
|
3516
|
+
function Bi(e) {
|
|
3503
3517
|
let t = e.priv, n = en(e, "timeout_retry"), r = en(e, "timeout_retry_max");
|
|
3504
3518
|
r < n && (r = n), t.retry_ms = t.retry_ms ? Math.min(2 * t.retry_ms, r) : n;
|
|
3505
3519
|
let l = .2 * t.retry_ms, o = t.retry_ms - l + 2 * Math.random() * l;
|
|
3506
3520
|
return Math.max(1, Math.round(o));
|
|
3507
3521
|
}
|
|
3508
|
-
function
|
|
3509
|
-
return
|
|
3522
|
+
function Ji(e, t, n, r) {
|
|
3523
|
+
return Mi(e), 0;
|
|
3510
3524
|
}
|
|
3511
|
-
function
|
|
3525
|
+
function qi(e, t, n, r) {
|
|
3512
3526
|
let l = e.priv;
|
|
3513
|
-
|
|
3514
|
-
let o =
|
|
3527
|
+
Ei(l.gobj_timer);
|
|
3528
|
+
let o = Zl(e, n, Ri, !0), i = vl(e, o, "src_yuno", ""), s = vl(e, o, "src_role", ""), a = vl(e, o, "src_service", "");
|
|
3515
3529
|
un(e, "remote_yuno_name", i), un(e, "remote_yuno_role", s), un(e, "remote_yuno_service", a);
|
|
3516
|
-
let u =
|
|
3530
|
+
let u = yl(e, n, "result", -1, 0), _ = vl(e, n, "comment", "", 0), c = vl(e, n, "username", "", 0), f = Nl(e, n, "services_roles", {});
|
|
3517
3531
|
if (u < 0) {
|
|
3518
|
-
|
|
3532
|
+
Pi(e);
|
|
3519
3533
|
let t = {
|
|
3520
3534
|
url: tn(e, "url"),
|
|
3521
3535
|
result: u,
|
|
@@ -3540,61 +3554,61 @@ function Bi(e, t, n, r) {
|
|
|
3540
3554
|
}
|
|
3541
3555
|
l.inside_on_open = !1, function(e) {
|
|
3542
3556
|
let t = In(e, null, null, null);
|
|
3543
|
-
for (let n = 0; n < t.length; n++)
|
|
3557
|
+
for (let n = 0; n < t.length; n++) Wi(e, t[n]);
|
|
3544
3558
|
}(e);
|
|
3545
3559
|
}
|
|
3546
3560
|
return 0;
|
|
3547
3561
|
}
|
|
3548
|
-
function
|
|
3562
|
+
function Hi(e, t, n, r) {
|
|
3549
3563
|
let l = e.priv.url, o = function(e, t) {
|
|
3550
3564
|
let n;
|
|
3551
3565
|
try {
|
|
3552
3566
|
n = JSON.parse(t);
|
|
3553
3567
|
} catch (t) {
|
|
3554
|
-
return
|
|
3568
|
+
return ur(`${Rt(e)}: parsing inter_event json: ${t}`), null;
|
|
3555
3569
|
}
|
|
3556
|
-
if (!(n instanceof Object)) return
|
|
3570
|
+
if (!(n instanceof Object)) return ur(`${Rt(e)}: parsing inter_event: websocket data not a json object`), null;
|
|
3557
3571
|
let r = n.event;
|
|
3558
|
-
if (!r) return
|
|
3559
|
-
if ("string" != typeof r) return
|
|
3572
|
+
if (!r) return ur(`${Rt(e)}: parsing inter_event: no event`), null;
|
|
3573
|
+
if ("string" != typeof r) return ur(`${Rt(e)}: parsing inter_event: event not a string`), null;
|
|
3560
3574
|
let l = n.kw;
|
|
3561
3575
|
return l ? l instanceof Object ? {
|
|
3562
3576
|
event: r,
|
|
3563
3577
|
kw: l || {}
|
|
3564
|
-
} : (
|
|
3578
|
+
} : (ur(`${Rt(e)}: parsing inter_event: kw not a json object`), null) : (ur(`${Rt(e)}: parsing inter_kw: no kw`), null);
|
|
3565
3579
|
}(e, n.data);
|
|
3566
|
-
if (!o) return
|
|
3567
|
-
if (
|
|
3580
|
+
if (!o) return ur(`${Rt(e)}: frame dropped from ${l}: ${String(n.data).substring(0, 256)}`), -1;
|
|
3581
|
+
if (ki(e)) {
|
|
3568
3582
|
let e = jt(Ot()) + " <== " + l, t = n.data.length, r = Qt(Ot(), "trace_ievent_callback");
|
|
3569
|
-
r ? r(e, o, 2, t) :
|
|
3583
|
+
r ? r(e, o, 2, t) : Ui(0, e, o);
|
|
3570
3584
|
}
|
|
3571
3585
|
let i = o.event, s = o.kw;
|
|
3572
3586
|
if ("ST_SESSION" !== cn(e)) {
|
|
3573
3587
|
if (dn(e, i, U.EVF_PUBLIC_EVENT)) {
|
|
3574
3588
|
if (!(Tn(e, i, s, e) < 0)) return 0;
|
|
3575
|
-
} else
|
|
3576
|
-
return
|
|
3589
|
+
} else ar(`${Rt(e)}: event UNKNOWN in not-session state ${i}`);
|
|
3590
|
+
return Pi(e), -1;
|
|
3577
3591
|
}
|
|
3578
3592
|
o = null;
|
|
3579
|
-
let a =
|
|
3580
|
-
if (_.toLowerCase() !== Nt().toLowerCase()) return
|
|
3581
|
-
let c =
|
|
3582
|
-
if ("__subscribing__" === a) return
|
|
3583
|
-
if ("__unsubscribing__" === a) return
|
|
3593
|
+
let a = to(e, s), u = Zl(e, s, Ri), _ = vl(e, u, "dst_role", "");
|
|
3594
|
+
if (_.toLowerCase() !== Nt().toLowerCase()) return ar(`"It's not my role, dst_role: ${_}, my_role: ${Nt()}`), 0;
|
|
3595
|
+
let c = vl(e, u, "dst_service", "");
|
|
3596
|
+
if ("__subscribing__" === a) return ur(`${Rt(e)}: subscription event ignored, I'm client (service: ${c}, event: ${i})`), -1;
|
|
3597
|
+
if ("__unsubscribing__" === a) return ur(`${Rt(e)}: unsubscription event ignored, I'm client (service: ${c}, event: ${i})`), -1;
|
|
3584
3598
|
if (dn(e, i, U.EVF_PUBLIC_EVENT)) return Tn(e, i, s, e), 0;
|
|
3585
|
-
if (!
|
|
3599
|
+
if (!rl(c)) {
|
|
3586
3600
|
let t = Ke(c, !1);
|
|
3587
|
-
return t ? dn(t, i, U.EVF_PUBLIC_EVENT) ? (Tn(t, i, s, e), 0) : (
|
|
3601
|
+
return t ? dn(t, i, U.EVF_PUBLIC_EVENT) ? (Tn(t, i, s, e), 0) : (ar(`${Rt(e)}: Service found but no event or not public, service '${Rt(t)}', ev '${i}'`), -1) : (ur(`${Rt(e)}: event for a service that is gone, DROPPED: service '${c}', ev '${i}'`), 0);
|
|
3588
3602
|
}
|
|
3589
3603
|
return It(e) ? Tn(At(e), i, s, e) : Pn(e, i, s), 0;
|
|
3590
3604
|
}
|
|
3591
|
-
function
|
|
3605
|
+
function zi(e, t, n, r) {
|
|
3592
3606
|
return 0;
|
|
3593
3607
|
}
|
|
3594
|
-
function
|
|
3608
|
+
function Qi(e, t, n, r) {
|
|
3595
3609
|
return 0;
|
|
3596
3610
|
}
|
|
3597
|
-
var
|
|
3611
|
+
var Xi = {
|
|
3598
3612
|
mt_create: function(e) {
|
|
3599
3613
|
let t = e.priv;
|
|
3600
3614
|
t.gobj_timer = ot(jt(e), "C_TIMER", {}, e), t.ws_seq = 0, t.url = tn(e, "url"), t.remote_yuno_name = tn(e, "remote_yuno_name"), t.remote_yuno_role = tn(e, "remote_yuno_role"), t.remote_yuno_service = tn(e, "remote_yuno_service"), un(e, "wanted_yuno_name", t.remote_yuno_name), un(e, "wanted_yuno_role", t.remote_yuno_role), un(e, "wanted_yuno_service", t.remote_yuno_service);
|
|
@@ -3624,72 +3638,72 @@ var zi = {
|
|
|
3624
3638
|
code: 1e3,
|
|
3625
3639
|
reason: "restarted",
|
|
3626
3640
|
was_clean: !0
|
|
3627
|
-
}, e),
|
|
3641
|
+
}, e), Ei(t.gobj_timer)), t.websocket = Li(e), 0;
|
|
3628
3642
|
},
|
|
3629
3643
|
mt_stop: function(e) {
|
|
3630
3644
|
let t = e.priv;
|
|
3631
|
-
return
|
|
3645
|
+
return Ei(t.gobj_timer), t.websocket && Pi(e), 0;
|
|
3632
3646
|
},
|
|
3633
3647
|
mt_destroy: function(e) {},
|
|
3634
3648
|
mt_stats: function(e, t, n, r) {
|
|
3635
|
-
if ("ST_SESSION" !== cn(e)) return
|
|
3649
|
+
if ("ST_SESSION" !== cn(e)) return ar("Not in session"), null;
|
|
3636
3650
|
n || (n = {});
|
|
3637
|
-
let l =
|
|
3638
|
-
return o || (o = {}),
|
|
3651
|
+
let l = Gi(e, jt(r), vl(e, n, "service", null, 0)), o = Nl(e, n, "__md_stats__", null, Vn.KW_EXTRACT);
|
|
3652
|
+
return o || (o = {}), Xl(e, n, "stats_stack", {
|
|
3639
3653
|
stats: t,
|
|
3640
3654
|
kw: o
|
|
3641
|
-
}),
|
|
3655
|
+
}), Xl(e, n, Ri, l), n.__stats__ = t, eo(e, n, "__stats__"), Vi(e, "EV_MT_STATS", n, r), null;
|
|
3642
3656
|
},
|
|
3643
3657
|
mt_command_parser: function(e, t, n, r) {
|
|
3644
|
-
if ("ST_SESSION" !== cn(e)) return
|
|
3658
|
+
if ("ST_SESSION" !== cn(e)) return ar("Not in session"), null;
|
|
3645
3659
|
n || (n = {});
|
|
3646
|
-
let l =
|
|
3647
|
-
return o || (o = {}),
|
|
3660
|
+
let l = Gi(e, jt(r), vl(e, n, "service", "", 0)), o = Nl(e, n, "__md_command__", null, Vn.KW_EXTRACT);
|
|
3661
|
+
return o || (o = {}), Xl(e, n, "command_stack", {
|
|
3648
3662
|
command: t,
|
|
3649
3663
|
kw: o
|
|
3650
|
-
}),
|
|
3664
|
+
}), Xl(e, n, Ri, l), n.__command__ = t, eo(e, n, "__command__"), Vi(e, "EV_MT_COMMAND", n, r), null;
|
|
3651
3665
|
},
|
|
3652
3666
|
mt_inject_event: function(e, t, n, r) {
|
|
3653
3667
|
if ("ST_SESSION" !== cn(e)) return window.console.error("Not in session"), -1;
|
|
3654
|
-
if (n =
|
|
3668
|
+
if (n = kr({}, Jr(n) ? n : {}), Jr(n.__md_iev__) && (n.__md_iev__ = Rr(n.__md_iev__)), Zl(e, n, Ri));
|
|
3655
3669
|
else {
|
|
3656
|
-
let l =
|
|
3657
|
-
|
|
3670
|
+
let l = Gi(e, jt(r), vl(e, n, "__service__", 0, 0));
|
|
3671
|
+
Pr(n, "__service__"), Xl(e, n, "__message__", t), Xl(e, n, Ri, l);
|
|
3658
3672
|
}
|
|
3659
|
-
return
|
|
3673
|
+
return eo(e, n, "__message__"), Vi(e, t, n, r);
|
|
3660
3674
|
},
|
|
3661
3675
|
mt_subscription_added: function(e, t) {
|
|
3662
3676
|
let n = e.priv;
|
|
3663
|
-
return "ST_SESSION" === cn(e) && n.websocket ? n.inside_on_open ? 0 :
|
|
3677
|
+
return "ST_SESSION" === cn(e) && n.websocket ? n.inside_on_open ? 0 : Wi(e, t) : 0;
|
|
3664
3678
|
},
|
|
3665
3679
|
mt_subscription_deleted: function(e, t) {
|
|
3666
3680
|
let n = e.priv;
|
|
3667
3681
|
if ("ST_SESSION" !== cn(e) || !n.websocket) return 0;
|
|
3668
3682
|
if (n.inside_on_open) return 0;
|
|
3669
|
-
if (
|
|
3683
|
+
if (rl(t.event)) return 0;
|
|
3670
3684
|
let r = {}, l = t.__global__, o = t.__config__, i = t.__filter__, s = t.__service__, a = t.subscriber;
|
|
3671
3685
|
o && (r.__config__ = o), l && (r.__global__ = l), i && (r.__filter__ = i);
|
|
3672
|
-
return
|
|
3686
|
+
return Xl(e, r, Ri, Gi(e, jt(a), s)), eo(e, r, "__unsubscribing__"), Vi(e, t.event, r, e);
|
|
3673
3687
|
}
|
|
3674
3688
|
};
|
|
3675
|
-
function
|
|
3689
|
+
function Zi() {
|
|
3676
3690
|
return function(e) {
|
|
3677
|
-
if (
|
|
3691
|
+
if (Ci) return ar(`GClass ALREADY created: ${e}`), -1;
|
|
3678
3692
|
const t = [
|
|
3679
3693
|
["ST_DISCONNECTED", [
|
|
3680
3694
|
[
|
|
3681
3695
|
"EV_ON_OPEN",
|
|
3682
|
-
|
|
3696
|
+
Ki,
|
|
3683
3697
|
"ST_WAIT_IDENTITY_CARD_ACK"
|
|
3684
3698
|
],
|
|
3685
3699
|
[
|
|
3686
3700
|
"EV_ON_CLOSE",
|
|
3687
|
-
|
|
3701
|
+
Yi,
|
|
3688
3702
|
null
|
|
3689
3703
|
],
|
|
3690
3704
|
[
|
|
3691
3705
|
"EV_TIMEOUT",
|
|
3692
|
-
|
|
3706
|
+
xi,
|
|
3693
3707
|
null
|
|
3694
3708
|
],
|
|
3695
3709
|
[
|
|
@@ -3701,22 +3715,22 @@ function Qi() {
|
|
|
3701
3715
|
["ST_WAIT_IDENTITY_CARD_ACK", [
|
|
3702
3716
|
[
|
|
3703
3717
|
"EV_ON_MESSAGE",
|
|
3704
|
-
|
|
3718
|
+
Hi,
|
|
3705
3719
|
null
|
|
3706
3720
|
],
|
|
3707
3721
|
[
|
|
3708
3722
|
"EV_IDENTITY_CARD_ACK",
|
|
3709
|
-
|
|
3723
|
+
qi,
|
|
3710
3724
|
null
|
|
3711
3725
|
],
|
|
3712
3726
|
[
|
|
3713
3727
|
"EV_ON_CLOSE",
|
|
3714
|
-
|
|
3728
|
+
Yi,
|
|
3715
3729
|
"ST_DISCONNECTED"
|
|
3716
3730
|
],
|
|
3717
3731
|
[
|
|
3718
3732
|
"EV_TIMEOUT",
|
|
3719
|
-
|
|
3733
|
+
Ji,
|
|
3720
3734
|
null
|
|
3721
3735
|
],
|
|
3722
3736
|
[
|
|
@@ -3728,22 +3742,22 @@ function Qi() {
|
|
|
3728
3742
|
["ST_SESSION", [
|
|
3729
3743
|
[
|
|
3730
3744
|
"EV_ON_MESSAGE",
|
|
3731
|
-
|
|
3745
|
+
Hi,
|
|
3732
3746
|
null
|
|
3733
3747
|
],
|
|
3734
3748
|
[
|
|
3735
3749
|
"EV_MT_STATS",
|
|
3736
|
-
|
|
3750
|
+
zi,
|
|
3737
3751
|
null
|
|
3738
3752
|
],
|
|
3739
3753
|
[
|
|
3740
3754
|
"EV_MT_COMMAND",
|
|
3741
|
-
|
|
3755
|
+
Qi,
|
|
3742
3756
|
null
|
|
3743
3757
|
],
|
|
3744
3758
|
[
|
|
3745
3759
|
"EV_ON_CLOSE",
|
|
3746
|
-
|
|
3760
|
+
Yi,
|
|
3747
3761
|
"ST_DISCONNECTED"
|
|
3748
3762
|
],
|
|
3749
3763
|
[
|
|
@@ -3754,7 +3768,7 @@ function Qi() {
|
|
|
3754
3768
|
]],
|
|
3755
3769
|
[null, null]
|
|
3756
3770
|
];
|
|
3757
|
-
return (
|
|
3771
|
+
return (Ci = Ae(e, [
|
|
3758
3772
|
["EV_ON_MESSAGE", U.EVF_OUTPUT_EVENT],
|
|
3759
3773
|
["EV_IDENTITY_CARD_ACK", U.EVF_PUBLIC_EVENT],
|
|
3760
3774
|
["EV_ON_ID_NAK", U.EVF_PUBLIC_EVENT | U.EVF_OUTPUT_EVENT],
|
|
@@ -3765,9 +3779,9 @@ function Qi() {
|
|
|
3765
3779
|
["EV_ON_OPEN_ERROR", U.EVF_OUTPUT_EVENT | U.EVF_NO_WARN_SUBS],
|
|
3766
3780
|
["EV_TIMEOUT", 0],
|
|
3767
3781
|
[null, 0]
|
|
3768
|
-
], t,
|
|
3782
|
+
], t, Xi, 0, Di, Ii, 0, 0, Ai, C.gcflag_no_check_output_events)) ? 0 : -1;
|
|
3769
3783
|
}("C_IEVENT_CLI");
|
|
3770
3784
|
}
|
|
3771
|
-
export { I as GObj, N as SDATA, R as SDATAAUTHZ, w as SDATACM, j as SDATACM2, A as SDATADF, $ as SDATAPM, D as SDATAPM0, S as SDATA_END, O as SDataDesc, a as YUNETA_VERSION, h as __yuno__, o as build_command_response,
|
|
3785
|
+
export { I as GObj, N as SDATA, R as SDATAAUTHZ, w as SDATACM, j as SDATACM2, A as SDATADF, $ as SDATAPM, D as SDATAPM0, S as SDATA_END, O as SDataDesc, a as YUNETA_VERSION, h as __yuno__, o as build_command_response, Vo as build_path, s as build_stats_response, Po as clean_name, Ei as clear_timeout, al as cmp_two_simple_json, l as command_parser, jo as createElement2, wo as createOneHtml, fo as create_json_record, _i as create_template_record, ko as current_timestamp, T as data_type_t, ei as db_list_persistent_attrs, Qo as db_load_persistent_attrs, Zo as db_remove_persistent_attrs, Xo as db_save_persistent_attrs, Fo as debounce, Hl as delete_from_list, Dr as duplicate_objects, Br as empty_json, rl as empty_string, po as escapeHtml, U as event_flag_t, Bo as flat2json, Ho as flat_apply, qo as flat_diff, xo as flat_key_join, Ko as flat_key_split, Pe as gclass_add_ev_action, Fe as gclass_add_event_type, Le as gclass_add_state, Ge as gclass_check_fsm, Ae as gclass_create, Ve as gclass_event_type, Me as gclass_find_by_name, C as gclass_flag_t, ke as gclass_unregister, $o as getPositionRelativeToBody, Uo as get_function_name, Io as get_now, Lt as gobj_bottom_gobj, fn as gobj_change_parent, _n as gobj_change_state, Un as gobj_command, it as gobj_create, et as gobj_create2, rt as gobj_create_default_service, ot as gobj_create_pure_child, nt as gobj_create_service, lt as gobj_create_volatil, tt as gobj_create_yuno, cn as gobj_current_state, xe as gobj_default_service, yn as gobj_deliver_posted_events, st as gobj_destroy, Bt as gobj_find_child, Kt as gobj_find_gobj, Ke as gobj_find_service, Ln as gobj_find_subscribings, In as gobj_find_subscriptions, L as gobj_flag_t, Dt as gobj_full_name, $t as gobj_gclass_name, be as gobj_get_gclass_trace_level, pe as gobj_get_gclass_trace_level2, me as gobj_get_gclass_trace_no_level, ge as gobj_get_global_trace_level, de as gobj_get_global_trace_no_level, ue as gobj_global_trace_level, _e as gobj_global_trace_no_level, zt as gobj_has_attr, dn as gobj_has_event, bn as gobj_has_output_event, $e as gobj_hsdata, Ct as gobj_is_destroying, vt as gobj_is_playing, It as gobj_is_pure_child, Et as gobj_is_running, Tt as gobj_is_service, kt as gobj_is_volatil, Qe as gobj_list_persistent_attrs, Cn as gobj_list_subscriptions, qe as gobj_load_persistent_attrs, Jt as gobj_match_children, qt as gobj_match_children_tree, Yt as gobj_match_gobj, jt as gobj_name, At as gobj_parent, ht as gobj_pause, mt as gobj_play, hn as gobj_post_event, En as gobj_posted_events_size, Pn as gobj_publish_event, Qt as gobj_read_attr, Xt as gobj_read_attrs, Zt as gobj_read_bool_attr, en as gobj_read_integer_attr, nn as gobj_read_pointer_attr, tn as gobj_read_str_attr, ze as gobj_remove_persistent_attrs, Oe as gobj_repr_global_trace_levels, ln as gobj_reset_volatil_attrs, He as gobj_save_persistent_attrs, Ht as gobj_search_path, Tn as gobj_send_event, We as gobj_services, Pt as gobj_set_bottom_gobj, he as gobj_set_deep_trace, Te as gobj_set_gclass_no_trace, Ee as gobj_set_gclass_trace, ae as gobj_set_global_no_trace, fe as gobj_set_global_no_trace2, se as gobj_set_global_trace, ce as gobj_set_global_trace2, ve as gobj_set_gobj_no_trace, ye as gobj_set_gobj_trace, x as gobj_set_trace_machine_format, Rt as gobj_short_name, at as gobj_start, _t as gobj_start_children, ft as gobj_start_tree, Se as gobj_start_up, Fn as gobj_stats, gt as gobj_stop, bt as gobj_stop_children, pt as gobj_stop_tree, Dn as gobj_subscribe_event, Z as gobj_trace_level, K as gobj_trace_machine_format, ee as gobj_trace_no_level, An as gobj_unsubscribe_event, kn as gobj_unsubscribe_list, Ft as gobj_walk_gobj_children, Vt as gobj_walk_gobj_children_tree, rn as gobj_write_attr, on as gobj_write_attrs, sn as gobj_write_bool_attr, an as gobj_write_integer_attr, un as gobj_write_str_attr, Ot as gobj_yuno, wt as gobj_yuno_id, St as gobj_yuno_name, Nt as gobj_yuno_role, Eo as html_markup, Bl as id_index_in_obj_list, Co as index_in_list, qr as is_array, Qr as is_boolean, el as is_date, tl as is_function, nl as is_gobj, yo as is_html_markup, _l as is_metadata_key, Xr as is_null, zr as is_number, Jr as is_object, cl as is_private_key, Zr as is_pure_number, mr as is_secret_name, Hr as is_string, so as jdb_delete, uo as jdb_get, _o as jdb_get_by_idx, ao as jdb_get_topic, oo as jdb_init, io as jdb_update, Yo as json2flat, Vr as json_array_append, Gr as json_array_append_new, Wr as json_array_extend, Mr as json_array_remove, Kr as json_array_size, Rr as json_deep_copy, Ar as json_is_identical, jr as json_mask_secrets, Pr as json_object_del, Lr as json_object_get, Ur as json_object_set, Fr as json_object_set_new, xr as json_object_size, kr as json_object_update, Ir as json_object_update_existing, Cr as json_object_update_missing, Yr as json_size, bo as jwt2json, go as jwtDecode, Cl as kw_clone_by_keys, Ll as kw_clone_by_not_keys, Il as kw_collect, hl as kw_delete, Al as kw_find_json_in_list, ml as kw_find_path, Vn as kw_flag_t, El as kw_get_bool, Sl as kw_get_dict, Nl as kw_get_dict_value, yl as kw_get_int, wl as kw_get_list, Pl as kw_get_local_storage_value, Ol as kw_get_pointer, Tl as kw_get_real, vl as kw_get_str, gl as kw_has_key, Dl as kw_match_simple, fl as kw_pop, Fl as kw_remove_local_storage_value, kl as kw_select, jl as kw_set_dict_value, Ul as kw_set_local_storage_value, $l as kw_set_subdict_value, Gl as kwid_collect, xl as kwid_find_one_record, Kl as kwid_get_ids, Vl as kwid_match_id, Ml as kwid_new_dict, Wl as kwid_new_list, Yl as list2options, no as load_json_file, cr as log_debug, ar as log_error, _r as log_info, ur as log_warning, vr as mask_secrets_inline, to as msg_iev_get_msg_type, Zl as msg_iev_get_stack, Xl as msg_iev_push_stack, zl as msg_iev_read_key, eo as msg_iev_set_msg_type, Ql as msg_iev_write_key, Lo as node_uuid, ll as parseBoolean, Ro as parseSVG, Do as refresh_language, Zi as register_c_ievent_cli, pi as register_c_timer, $i as register_c_yuno, mo as safeSrc, v as sdata_flag_t, ro as send_http_json_post, zn as set_console_log_enabled, Xn as set_console_log_filter, qn as set_log_callback, rr as set_remote_log_functions, So as set_strings_are_text, mi as set_timeout, hi as set_timeout_periodic, t as sprintf, i as stats_parser, Jl as str_in_list, sl as strcasecmp, il as strcmp, No as strings_are_text, ol as strncmp, ql as strs_in_list, ul as strstr, ui as template_get_field_desc, Ao as timeTracker, gr as trace_json, $r as trace_json_masked, B as trace_level_t, fr as trace_msg, ni as treedb_decoder_fkey, li as treedb_decoder_hook, ri as treedb_encoder_fkey, ai as treedb_get_field_desc, ti as treedb_hook_data_size, n as vsprintf, F as walk_type_t };
|
|
3772
3786
|
|
|
3773
3787
|
//# sourceMappingURL=gobj-js.es.min.js.map
|