@yuneta/gobj-js 7.26.18 → 7.26.19
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 +11 -6
- package/dist/gobj-js.cjs.js.map +1 -1
- package/dist/gobj-js.cjs.min.js +879 -874
- package/dist/gobj-js.cjs.min.js.map +1 -1
- package/dist/gobj-js.es.js +11 -6
- package/dist/gobj-js.es.js.map +1 -1
- package/dist/gobj-js.es.min.js +917 -912
- package/dist/gobj-js.es.min.js.map +1 -1
- package/dist/gobj-js.iife.js +11 -6
- package/dist/gobj-js.iife.js.map +1 -1
- package/dist/gobj-js.iife.min.js +879 -874
- package/dist/gobj-js.iife.min.js.map +1 -1
- package/dist/gobj-js.umd.js +11 -6
- package/dist/gobj-js.umd.js.map +1 -1
- package/dist/gobj-js.umd.min.js +879 -874
- package/dist/gobj-js.umd.min.js.map +1 -1
- package/package.json +1 -1
package/dist/gobj-js.umd.min.js
CHANGED
|
@@ -177,7 +177,7 @@
|
|
|
177
177
|
}
|
|
178
178
|
}, S = class {
|
|
179
179
|
constructor(e, t, n, r, l) {
|
|
180
|
-
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 =
|
|
180
|
+
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 = xn(t.priv), this.running = !1, this.playing = !1, this.disabled = !1, this.bottom_gobj = null, this.trace_level = 0, this.no_trace_level = 0;
|
|
181
181
|
}
|
|
182
182
|
}, w = Object.freeze({
|
|
183
183
|
gcflag_manual_start: 1,
|
|
@@ -223,7 +223,7 @@
|
|
|
223
223
|
};
|
|
224
224
|
var C = 1;
|
|
225
225
|
function L(e) {
|
|
226
|
-
|
|
226
|
+
lr(e) && (e = JSON.stringify(e)), Sn(" ".repeat(Math.max(1, 2 * h)) + String(e));
|
|
227
227
|
}
|
|
228
228
|
var P = Object.freeze({
|
|
229
229
|
TRACE_MACHINE: 65536,
|
|
@@ -325,7 +325,7 @@
|
|
|
325
325
|
return n;
|
|
326
326
|
}
|
|
327
327
|
function W(e, t, n) {
|
|
328
|
-
if (
|
|
328
|
+
if (fr(e)) return void 0 === n ? 268369920 : 65535;
|
|
329
329
|
if (/^[0-9]+$/.test(String(e))) {
|
|
330
330
|
const t = Number(e);
|
|
331
331
|
if (t) return t;
|
|
@@ -336,7 +336,7 @@
|
|
|
336
336
|
for (let n = 0; n < t.length && n < 16; n++) if (t[n] && t[n][0] === e) return 1 << n;
|
|
337
337
|
}
|
|
338
338
|
return 0;
|
|
339
|
-
}(String(e), n) || (
|
|
339
|
+
}(String(e), n) || (jn(`${t}: trace level NOT FOUND: ${e}`), 0);
|
|
340
340
|
}
|
|
341
341
|
function x(e) {
|
|
342
342
|
if (G) return 4294967295;
|
|
@@ -392,32 +392,32 @@
|
|
|
392
392
|
return M(V, null);
|
|
393
393
|
}
|
|
394
394
|
function re(e) {
|
|
395
|
-
const t =
|
|
396
|
-
return t ? M(t.trace_level | F, t.s_user_trace_level) : (
|
|
395
|
+
const t = sr(e) ? Oe(e) : e;
|
|
396
|
+
return t ? M(t.trace_level | F, t.s_user_trace_level) : (jn(`gobj_get_gclass_trace_level: gclass NOT FOUND: ${e}`), []);
|
|
397
397
|
}
|
|
398
398
|
function le(e) {
|
|
399
|
-
const t =
|
|
400
|
-
return t ? M(t.trace_level, t.s_user_trace_level) : (
|
|
399
|
+
const t = sr(e) ? Oe(e) : e;
|
|
400
|
+
return t ? M(t.trace_level, t.s_user_trace_level) : (jn(`gobj_get_gclass_trace_level2: gclass NOT FOUND: ${e}`), []);
|
|
401
401
|
}
|
|
402
402
|
function oe(e) {
|
|
403
|
-
const t =
|
|
404
|
-
return t ? M(t.no_trace_level, t.s_user_trace_level) : (
|
|
403
|
+
const t = sr(e) ? Oe(e) : e;
|
|
404
|
+
return t ? M(t.no_trace_level, t.s_user_trace_level) : (jn(`gobj_get_gclass_trace_no_level: gclass NOT FOUND: ${e}`), []);
|
|
405
405
|
}
|
|
406
406
|
function se(e, t, n) {
|
|
407
|
-
const r =
|
|
408
|
-
if (!r) return
|
|
407
|
+
const r = sr(e) ? Oe(e) : e;
|
|
408
|
+
if (!r) return jn(`gobj_set_gclass_trace: gclass NOT FOUND: ${e}`), -1;
|
|
409
409
|
const l = null === t ? 4294967295 : W(t, "gobj_set_gclass_trace", r.s_user_trace_level || null);
|
|
410
410
|
return l ? (n ? r.trace_level |= l : r.trace_level &= ~l, 0) : -1;
|
|
411
411
|
}
|
|
412
412
|
function ie(e, t, n) {
|
|
413
|
-
const r =
|
|
414
|
-
if (!r) return
|
|
413
|
+
const r = sr(e) ? Oe(e) : e;
|
|
414
|
+
if (!r) return jn(`gobj_set_gclass_no_trace: gclass NOT FOUND: ${e}`), -1;
|
|
415
415
|
const l = null === t ? 4294967295 : W(t, "gobj_set_gclass_no_trace", r.s_user_trace_level || null);
|
|
416
416
|
return l ? (n ? r.no_trace_level |= l : r.no_trace_level &= ~l, 0) : -1;
|
|
417
417
|
}
|
|
418
418
|
function _e(e, t) {
|
|
419
419
|
let n = {};
|
|
420
|
-
if (!
|
|
420
|
+
if (!or(t)) return jn("sdata_desc MUST be an array"), Nn(t), n;
|
|
421
421
|
for (let r = 0; r < t.length; r++) {
|
|
422
422
|
const l = t[r];
|
|
423
423
|
l.name && ae(e, n, l);
|
|
@@ -431,85 +431,85 @@
|
|
|
431
431
|
r = String(l);
|
|
432
432
|
break;
|
|
433
433
|
case y.DTP_BOOLEAN:
|
|
434
|
-
r =
|
|
434
|
+
r = gr(l);
|
|
435
435
|
break;
|
|
436
436
|
case y.DTP_INTEGER:
|
|
437
|
-
r = parseInt(l), isNaN(r) &&
|
|
437
|
+
r = parseInt(l), isNaN(r) && jn(`${et(e)}: attr NaN: ${n.name}`);
|
|
438
438
|
break;
|
|
439
439
|
case y.DTP_REAL:
|
|
440
|
-
r = Number(l), isNaN(r) &&
|
|
440
|
+
r = Number(l), isNaN(r) && jn(`${et(e)}: attr NaN: ${n.name}`);
|
|
441
441
|
break;
|
|
442
442
|
case y.DTP_LIST:
|
|
443
|
-
if (
|
|
443
|
+
if (sr(l)) try {
|
|
444
444
|
r = JSON.parse(l);
|
|
445
445
|
} catch (e) {
|
|
446
|
-
|
|
446
|
+
jn(`JSON parse error: ${e.message}`);
|
|
447
447
|
}
|
|
448
448
|
else r = l;
|
|
449
|
-
|
|
449
|
+
or(r) || (r = []);
|
|
450
450
|
break;
|
|
451
451
|
case y.DTP_DICT:
|
|
452
|
-
if (
|
|
452
|
+
if (sr(l)) try {
|
|
453
453
|
r = JSON.parse(l);
|
|
454
454
|
} catch (e) {
|
|
455
|
-
|
|
455
|
+
jn(`JSON parse error: ${e.message}`);
|
|
456
456
|
}
|
|
457
457
|
else r = l;
|
|
458
|
-
|
|
458
|
+
lr(r) || (r = {});
|
|
459
459
|
break;
|
|
460
460
|
case y.DTP_JSON:
|
|
461
461
|
if ("" === l || void 0 === l) r = null;
|
|
462
|
-
else if (
|
|
462
|
+
else if (sr(l)) try {
|
|
463
463
|
r = JSON.parse(l);
|
|
464
464
|
} catch (e) {
|
|
465
|
-
|
|
465
|
+
jn(`JSON parse error: ${e.message}`);
|
|
466
466
|
}
|
|
467
467
|
else r = l;
|
|
468
468
|
break;
|
|
469
469
|
case y.DTP_POINTER: r = l;
|
|
470
470
|
}
|
|
471
|
-
return void 0 === r && (
|
|
471
|
+
return void 0 === r && (jn(`default_value WRONG, it: ${n.name}, value: ${n.default_value}`), r = null), t[n.name] = r, 0;
|
|
472
472
|
}
|
|
473
473
|
function ue(e, t, n, r) {
|
|
474
474
|
let l;
|
|
475
475
|
switch (n.type) {
|
|
476
476
|
case y.DTP_STRING:
|
|
477
477
|
if (null == r) l = "";
|
|
478
|
-
else if (
|
|
478
|
+
else if (sr(r)) l = String(r);
|
|
479
479
|
else {
|
|
480
480
|
let e = JSON.stringify(r);
|
|
481
481
|
e && (l = String(e));
|
|
482
482
|
}
|
|
483
483
|
break;
|
|
484
484
|
case y.DTP_BOOLEAN:
|
|
485
|
-
l =
|
|
485
|
+
l = gr(r);
|
|
486
486
|
break;
|
|
487
487
|
case y.DTP_INTEGER:
|
|
488
|
-
if (l = parseInt(r), isNaN(l)) return
|
|
488
|
+
if (l = parseInt(r), isNaN(l)) return jn(`${et(e)}: attr NaN: ${n.name}`), -1;
|
|
489
489
|
break;
|
|
490
490
|
case y.DTP_REAL:
|
|
491
|
-
if (l = Number(r), isNaN(l)) return
|
|
491
|
+
if (l = Number(r), isNaN(l)) return jn(`${et(e)}: attr NaN: ${n.name}`), -1;
|
|
492
492
|
break;
|
|
493
493
|
case y.DTP_LIST:
|
|
494
|
-
if (
|
|
494
|
+
if (sr(r)) try {
|
|
495
495
|
l = JSON.parse(r);
|
|
496
496
|
} catch (e) {
|
|
497
|
-
|
|
497
|
+
jn(`JSON parse error: ${e.message}`);
|
|
498
498
|
}
|
|
499
499
|
else l = r;
|
|
500
|
-
if (!
|
|
500
|
+
if (!or(l)) return jn(`attr must be an array: ${n.name}`), -1;
|
|
501
501
|
break;
|
|
502
502
|
case y.DTP_DICT:
|
|
503
|
-
if (
|
|
503
|
+
if (sr(r)) try {
|
|
504
504
|
l = JSON.parse(r);
|
|
505
505
|
} catch (e) {
|
|
506
|
-
|
|
506
|
+
jn(`JSON parse error: ${e.message}`);
|
|
507
507
|
}
|
|
508
508
|
else l = r;
|
|
509
|
-
if (!
|
|
509
|
+
if (!lr(l)) return jn(`attr must be an object: ${n.name}`), -1;
|
|
510
510
|
break;
|
|
511
511
|
case y.DTP_JSON:
|
|
512
|
-
if (l = r,
|
|
512
|
+
if (l = r, sr(r)) {
|
|
513
513
|
const e = r.trim();
|
|
514
514
|
if (e.startsWith("{") || e.startsWith("[")) try {
|
|
515
515
|
l = JSON.parse(e);
|
|
@@ -520,46 +520,46 @@
|
|
|
520
520
|
break;
|
|
521
521
|
case y.DTP_POINTER: l = r;
|
|
522
522
|
}
|
|
523
|
-
return void 0 === l &&
|
|
523
|
+
return void 0 === l && jn(`${et(e)}: attr undefined: ${n.name}`), t[n.name] = l, lr(e.priv) && Object.prototype.hasOwnProperty.call(e.priv, n.name) && (e.priv[n.name] = l), e.obflag & $.obflag_created && !(e.obflag & $.obflag_destroyed) && e.gclass.gmt.mt_writing && e.gclass.gmt.mt_writing(e, n.name), 0;
|
|
524
524
|
}
|
|
525
525
|
function ce(e) {
|
|
526
526
|
return e.jn_attrs;
|
|
527
527
|
}
|
|
528
528
|
function fe(e, t, n) {
|
|
529
|
-
return ht(e, t) ? ce(e) : e && e.bottom_gobj ? fe(e.bottom_gobj, t, n) : (n &&
|
|
529
|
+
return ht(e, t) ? ce(e) : e && e.bottom_gobj ? fe(e.bottom_gobj, t, n) : (n && jn(`GClass Attribute NOT FOUND: ${et(e)}, attr ${t}`), null);
|
|
530
530
|
}
|
|
531
531
|
function ge(e, t, n) {
|
|
532
|
-
if (!(e && e instanceof O)) return n &&
|
|
532
|
+
if (!(e && e instanceof O)) return n && jn("gclass NULL"), null;
|
|
533
533
|
if (!t) return e.attrs_table;
|
|
534
534
|
for (let n = 0; n < e.attrs_table.length; n++) {
|
|
535
535
|
const r = e.attrs_table[n];
|
|
536
536
|
if (r.name && r.name === t) return r;
|
|
537
537
|
}
|
|
538
|
-
return n &&
|
|
538
|
+
return n && jn(`${e.gclass_name}: GClass Attribute NOT FOUND: ${t}`), null;
|
|
539
539
|
}
|
|
540
540
|
function de(e, t, n, r, l, o, s, i, _, a, u) {
|
|
541
|
-
if (
|
|
542
|
-
if (e.includes("`") || e.includes("^") || e.includes(".")) return
|
|
543
|
-
if (Oe(e)) return
|
|
541
|
+
if (fr(e)) return jn("gclass_name EMPTY"), null;
|
|
542
|
+
if (e.includes("`") || e.includes("^") || e.includes(".")) return jn(`GClass name CANNOT have '.' or '^' or '\`' char: ${e}`), null;
|
|
543
|
+
if (Oe(e)) return jn(`GClass ALREADY exists: ${e}`), null;
|
|
544
544
|
let c = new O(e, r, l, o, s, i, _, a, u);
|
|
545
545
|
(function(e, t) {
|
|
546
|
-
e && e instanceof O ? t ? d[t] ?
|
|
546
|
+
e && e instanceof O ? t ? d[t] ? jn(`gclass ALREADY REGISTERED: ${t}`) : d[t] = e : jn("gclass_name undefined") : jn("gclass undefined");
|
|
547
547
|
})(c, e);
|
|
548
548
|
const f = n.length;
|
|
549
549
|
for (let e = 0; e < f; e++) {
|
|
550
550
|
let t = n[e][0], r = n[e][1];
|
|
551
|
-
if (
|
|
551
|
+
if (fr(t)) continue;
|
|
552
552
|
if (he(c, t) < 0) return be(c), null;
|
|
553
553
|
const l = r.length;
|
|
554
554
|
for (let e = 0; e < l; e++) {
|
|
555
555
|
let n = r[e][0], l = r[e][1], o = r[e][2];
|
|
556
|
-
|
|
556
|
+
fr(n) || ye(c, t, n, l, o);
|
|
557
557
|
}
|
|
558
558
|
}
|
|
559
559
|
for (let e = 0; e < t.length; e++) {
|
|
560
560
|
let n = t[e][0], r = t[e][1];
|
|
561
|
-
if (!
|
|
562
|
-
if (ve(c, n)) return
|
|
561
|
+
if (!fr(n)) {
|
|
562
|
+
if (ve(c, n)) return jn(`SMachine: event repeated in input_events: ${n}`), be(c), null;
|
|
563
563
|
Te(c, n, r);
|
|
564
564
|
}
|
|
565
565
|
}
|
|
@@ -571,13 +571,13 @@
|
|
|
571
571
|
}
|
|
572
572
|
function be(e) {
|
|
573
573
|
let t;
|
|
574
|
-
if (
|
|
574
|
+
if (sr(e)) t = e;
|
|
575
575
|
else {
|
|
576
|
-
if (!(e instanceof O)) return
|
|
576
|
+
if (!(e instanceof O)) return jn("Cannot unregister gclass, type unknown"), -1;
|
|
577
577
|
t = e.gclass_name;
|
|
578
578
|
}
|
|
579
579
|
let n = d[t];
|
|
580
|
-
return n ? n.instances > 0 ? (
|
|
580
|
+
return n ? n.instances > 0 ? (jn(`Cannot unregister gclass, instances in use: ${t}`), -1) : (delete d[t], 0) : (jn(`Cannot unregister gclass, not found: ${t}`), -1);
|
|
581
581
|
}
|
|
582
582
|
function pe(e, t) {
|
|
583
583
|
const n = e.dl_states.length, r = e.dl_states;
|
|
@@ -596,22 +596,22 @@
|
|
|
596
596
|
return null;
|
|
597
597
|
}
|
|
598
598
|
function he(e, t) {
|
|
599
|
-
return e instanceof O ? pe(e, t) ? (
|
|
599
|
+
return e instanceof O ? pe(e, t) ? (jn(`state already exists: ${t}`), -1) : (e.dl_states.push(new A(t)), 0) : (jn("Cannot add state, typeof not GClass"), -1);
|
|
600
600
|
}
|
|
601
601
|
function ye(e, t, n, r, l) {
|
|
602
|
-
if (!(e instanceof O)) return
|
|
603
|
-
if (
|
|
602
|
+
if (!(e instanceof O)) return jn("Cannot add state, typeof not GClass"), -1;
|
|
603
|
+
if (fr(t)) return jn("state_name EMPTY"), -1;
|
|
604
604
|
let o = pe(e, t);
|
|
605
|
-
return o ? me(o, n) ? (
|
|
605
|
+
return o ? me(o, n) ? (jn(`event already exists: gclass ${e.gclass_name}, state ${t}, event ${n}`), -1) : (o.dl_actions.push(new k(n, r, l)), 0) : (jn(`state not found: ${t}`), -1);
|
|
606
606
|
}
|
|
607
607
|
function Ee(e, t, n) {
|
|
608
|
-
|
|
608
|
+
fr(t) || e.push(new I(t, n));
|
|
609
609
|
}
|
|
610
610
|
function Te(e, t, n) {
|
|
611
|
-
return e instanceof O ? Ee(e.dl_events, t, n) : (
|
|
611
|
+
return e instanceof O ? Ee(e.dl_events, t, n) : (jn("Cannot add state, typeof not GClass"), -1);
|
|
612
612
|
}
|
|
613
613
|
function ve(e, t) {
|
|
614
|
-
if (!(e instanceof O)) return
|
|
614
|
+
if (!(e instanceof O)) return jn("Cannot add state, typeof not GClass"), 0;
|
|
615
615
|
const n = e.dl_events.length, r = e.dl_events;
|
|
616
616
|
for (let e = 0; e < n; e++) {
|
|
617
617
|
let n = r[e];
|
|
@@ -620,25 +620,25 @@
|
|
|
620
620
|
return null;
|
|
621
621
|
}
|
|
622
622
|
function je(e) {
|
|
623
|
-
if (!(e instanceof O)) return
|
|
623
|
+
if (!(e instanceof O)) return jn("Cannot add state, typeof not GClass"), -1;
|
|
624
624
|
let t = 0;
|
|
625
|
-
|
|
625
|
+
nr(e.dl_states) || (jn(`GClass without states: ${e.gclass_name}`), t += -1);
|
|
626
626
|
for (let n = 0; n < e.dl_states.length; n++) {
|
|
627
627
|
let r = e.dl_states[n];
|
|
628
|
-
if (!
|
|
628
|
+
if (!fr(r.state_name)) for (let n = 0; n < r.dl_actions.length; n++) {
|
|
629
629
|
let l = r.dl_actions[n];
|
|
630
|
-
|
|
630
|
+
fr(l.event_name) || (ve(e, l.event_name) || (jn(`SMachine: state's event NOT in input_events: gclass ${e.gclass_name}, state ${r.state_name}, event ${l.event_name}`), t += -1), l.next_state && (pe(e, l.next_state) || (jn(`SMachine: next state NOT in state names: gclass ${e.gclass_name}, state ${r.state_name}, next_state ${l.next_state}`), t += -1)));
|
|
631
631
|
}
|
|
632
632
|
}
|
|
633
633
|
for (let n = 0; n < e.dl_events.length; n++) {
|
|
634
634
|
let r = e.dl_events[n];
|
|
635
|
-
if (!
|
|
635
|
+
if (!fr(r.event_name) && (ir(r.event_flag) || (jn(`SMachine: event flag is NOT number: gclass ${e.gclass_name}, event ${r.event_name}`), t += -1), !(r.event_flag & R.EVF_OUTPUT_EVENT))) {
|
|
636
636
|
let n = !1;
|
|
637
637
|
for (let t = 0; t < e.dl_states.length; t++) {
|
|
638
638
|
let l = e.dl_states[t];
|
|
639
|
-
|
|
639
|
+
fr(l.state_name) || me(l, r.event_name) && (n = !0);
|
|
640
640
|
}
|
|
641
|
-
n || (
|
|
641
|
+
n || (jn(`SMachine: input_list's event NOT in state: gclass ${e.gclass_name}, event ${r.event_name}`), t += -1);
|
|
642
642
|
}
|
|
643
643
|
}
|
|
644
644
|
return t;
|
|
@@ -648,69 +648,69 @@
|
|
|
648
648
|
try {
|
|
649
649
|
n = d[e];
|
|
650
650
|
} catch (e) {}
|
|
651
|
-
return n || (t &&
|
|
651
|
+
return n || (t && jn(`gclass not found: ${e}`), null);
|
|
652
652
|
}
|
|
653
653
|
function Se() {
|
|
654
654
|
return !m || m.obflag & $.obflag_destroyed ? null : m;
|
|
655
655
|
}
|
|
656
656
|
function we(e, t) {
|
|
657
|
-
if (!
|
|
657
|
+
if (!sr(e)) return jn(`gobj_find_service(): service name must be a string: ${e}`), null;
|
|
658
658
|
e = e.toLowerCase();
|
|
659
|
-
return b[e] || (t &&
|
|
659
|
+
return b[e] || (t && jn(`gobj service not found: ${e}`), null);
|
|
660
660
|
}
|
|
661
661
|
function Ne(e) {
|
|
662
662
|
let t = Xe(e);
|
|
663
|
-
return t = t.toLowerCase(), b[t] &&
|
|
663
|
+
return t = t.toLowerCase(), b[t] && jn(`service ALREADY REGISTERED: ${t}. Will be UPDATED`), b[t] = e, 0;
|
|
664
664
|
}
|
|
665
665
|
function $e(e, t) {
|
|
666
|
-
t.parent &&
|
|
666
|
+
t.parent && jn(`_add_child() ALREADY HAS PARENT: ${t.gobj_name}`), e.dl_children.push(t), t.parent = e;
|
|
667
667
|
}
|
|
668
668
|
function Re(e, t) {
|
|
669
|
-
let n =
|
|
670
|
-
n >= 0 && (
|
|
669
|
+
let n = sl(e.dl_children, t);
|
|
670
|
+
n >= 0 && (er(e.dl_children, n), t.parent = null);
|
|
671
671
|
}
|
|
672
672
|
function De(e, t) {
|
|
673
|
-
return Be(e) ? _ ? _(e, t) : -1 : (
|
|
673
|
+
return Be(e) ? _ ? _(e, t) : -1 : (jn(`${et(e)}: Only gobj services can load/save writable-persistent`), -1);
|
|
674
674
|
}
|
|
675
675
|
function ke(e, t) {
|
|
676
|
-
"__json_config_variables__" !== t &&
|
|
676
|
+
"__json_config_variables__" !== t && jn(`GClass Attribute NOT FOUND: ${et(e)}, attr ${t}`);
|
|
677
677
|
}
|
|
678
678
|
function Ae(e, t, n) {
|
|
679
679
|
let r = t;
|
|
680
680
|
(function(e, t, n, r, l) {
|
|
681
|
-
if (!e || !t) return
|
|
681
|
+
if (!e || !t) return jn("hsdata or kw NULL"), -1;
|
|
682
682
|
let o = 0;
|
|
683
683
|
for (const [s, i] of Object.entries(t)) {
|
|
684
684
|
const t = ge(l.gclass, s, !1);
|
|
685
|
-
t ? (-1 === n || t.flag & n) && (t.flag & E.SDF_DEPRECATED &&
|
|
685
|
+
t ? (-1 === n || t.flag & n) && (t.flag & E.SDF_DEPRECATED && On(`${et(l)}: Deprecated attribute used in gobj creation: ${s}`), o += ue(l, e, t, i)) : r && (r(l, s), o--);
|
|
686
686
|
}
|
|
687
687
|
return o;
|
|
688
|
-
})(ce(e), r, -1, e.gclass.gclass_flag & w.gcflag_ignore_unknown_attrs ? 0 : ke, e) < 0 && (
|
|
688
|
+
})(ce(e), r, -1, e.gclass.gclass_flag & w.gcflag_ignore_unknown_attrs ? 0 : ke, e) < 0 && (jn(`${et(e)} json2data() FAILED`), Wn(r));
|
|
689
689
|
}
|
|
690
690
|
function Ie(e, t, r, l, o) {
|
|
691
691
|
if (o & N.gobj_flag_yuno) {
|
|
692
|
-
if (p) return
|
|
692
|
+
if (p) return jn("__yuno__ already created"), null;
|
|
693
693
|
o |= N.gobj_flag_service;
|
|
694
694
|
} else {
|
|
695
|
-
if (!l) return
|
|
696
|
-
if (!("string" == typeof l || l instanceof S)) return
|
|
697
|
-
if (
|
|
695
|
+
if (!l) return jn("gobj NEEDS a parent!"), null;
|
|
696
|
+
if (!("string" == typeof l || l instanceof S)) return jn(`BAD TYPE of parent: ${l}`), null;
|
|
697
|
+
if (sr(l)) {
|
|
698
698
|
const e = l;
|
|
699
|
-
if (!(l = we(e))) return
|
|
699
|
+
if (!(l = we(e))) return On(`parent service not found: ${e}`), null;
|
|
700
700
|
}
|
|
701
701
|
}
|
|
702
|
-
if (o & N.gobj_flag_service && we(e, !1)) return
|
|
702
|
+
if (o & N.gobj_flag_service && we(e, !1)) return jn(`service ALREADY registered: ${t}^${e}`), null;
|
|
703
703
|
if (o & N.gobj_flag_default_service) {
|
|
704
|
-
if (m) return
|
|
704
|
+
if (m) return jn(`default service ALREADY registered: ${t}^${e}`), null;
|
|
705
705
|
o |= N.gobj_flag_service;
|
|
706
706
|
}
|
|
707
|
-
if (
|
|
707
|
+
if (fr(t)) return jn("gclass_name must be a string"), null;
|
|
708
708
|
let s = Oe(t, !1);
|
|
709
|
-
if (!s) return
|
|
710
|
-
if (!
|
|
711
|
-
if (!
|
|
712
|
-
if (e.includes("`")) return
|
|
713
|
-
if (e.includes("^")) return
|
|
709
|
+
if (!s) return jn(`GClass not registered: ${t}^${e}`), null;
|
|
710
|
+
if (!sr(e)) return jn(`gobj_name must be a string: ${t}`), null;
|
|
711
|
+
if (!fr(e)) {
|
|
712
|
+
if (e.includes("`")) return jn(`gobj_name cannot contain char ': ${t}^${e}`), null;
|
|
713
|
+
if (e.includes("^")) return jn(`gobj_name cannot contain char ^: ${t}^${e}`), null;
|
|
714
714
|
}
|
|
715
715
|
let _ = new S(e, s, r, l, o);
|
|
716
716
|
_.jn_attrs = _e(_, s.attrs_table);
|
|
@@ -722,8 +722,8 @@
|
|
|
722
722
|
return Ie(e, t, n, r, N.gobj_flag_pure_child);
|
|
723
723
|
}
|
|
724
724
|
function Le(e) {
|
|
725
|
-
if (ot(e)) return void
|
|
726
|
-
e.__refs__ > 0 &&
|
|
725
|
+
if (ot(e)) return void jn("gobj NULL or DESTROYED");
|
|
726
|
+
e.__refs__ > 0 && jn(`${et(e)}: gobj DESTROYING with references: ${e.__refs__}`), e.playing && (jn(`Destroying a PLAYING gobj: ${tt(e)}`), xe(e)), e.running && (jn(`Destroying a RUNNING gobj: ${tt(e)}`), Ve(e)), e.obflag |= $.obflag_destroying, function(e) {
|
|
727
727
|
if (0 === Lt.length) return;
|
|
728
728
|
for (let t of Lt) t.src === e && (t.src = null);
|
|
729
729
|
Lt = Lt.filter((t) => t.dst !== e);
|
|
@@ -733,7 +733,7 @@
|
|
|
733
733
|
let r = nt(e);
|
|
734
734
|
r && r.gclass.gmt.mt_child_removed && (t && L(n("👦👦🔴 child_removed(%s): %s", tt(r), et(e))), r.gclass.gmt.mt_child_removed(r, e)), e.gobj_flag & N.gobj_flag_service && function(e) {
|
|
735
735
|
let t = Xe(e);
|
|
736
|
-
t = t.toLowerCase(), b[t] ? delete b[t] :
|
|
736
|
+
t = t.toLowerCase(), b[t] ? delete b[t] : jn(`"service NOT found in register": ${t}`);
|
|
737
737
|
}(e), e === m && (m = null), Ht(e, e.dl_subscriptions, !0), Ht(e, e.dl_subscribings, !0), r && (Re(r, e), rt(e) && (st(r) !== e || ot(r) || it(r, null))), function(e) {
|
|
738
738
|
let t = e.dl_children.slice();
|
|
739
739
|
for (let e = 0; e < t.length; e++) {
|
|
@@ -743,9 +743,9 @@
|
|
|
743
743
|
}(e), e.obflag & $.obflag_created && e.gclass.gmt.mt_destroy && e.gclass.gmt.mt_destroy(e), t && L(n("💔💔⏪ destroyed: %s", tt(e))), e.obflag |= $.obflag_destroyed, e.obflag & $.obflag_created && e.gclass.instances--;
|
|
744
744
|
}
|
|
745
745
|
function Pe(e) {
|
|
746
|
-
if (ot(e)) return
|
|
747
|
-
if (e.running) return
|
|
748
|
-
if (e.disabled) return
|
|
746
|
+
if (ot(e)) return jn("gobj NULL or DESTROYED"), -1;
|
|
747
|
+
if (e.running) return jn(`${et(e)}: GObj ALREADY RUNNING`), -1;
|
|
748
|
+
if (e.disabled) return jn(`${et(e)}: GObj DISABLED`), -1;
|
|
749
749
|
J(e) && L(n("⏺ ⏺ start: %s", tt(e))), e.running = !0;
|
|
750
750
|
let t = 0;
|
|
751
751
|
return e.gclass.gmt.mt_start && (t = e.gclass.gmt.mt_start(e)), t;
|
|
@@ -757,9 +757,9 @@
|
|
|
757
757
|
return e.gclass.gclass_flag & w.gcflag_manual_start || Ye(e) ? 1 : (Ke(e) || Pe(e), 0);
|
|
758
758
|
}
|
|
759
759
|
function Ve(e) {
|
|
760
|
-
if (ot(e)) return
|
|
761
|
-
if (!e.running) return
|
|
762
|
-
e.playing && (
|
|
760
|
+
if (ot(e)) return jn("gobj NULL or DESTROYED"), -1;
|
|
761
|
+
if (!e.running) return jn(`${et(e)}: GObj NOT RUNNING`), -1;
|
|
762
|
+
e.playing && (On(`${et(e)}: GObj stopping without previous pause`), xe(e)), J(e) && L(n("⏹ ⏹ stop: %s", tt(e))), e.running = !1;
|
|
763
763
|
let t = 0;
|
|
764
764
|
return e.gclass.gmt.mt_stop && (t = e.gclass.gmt.mt_stop(e)), t;
|
|
765
765
|
}
|
|
@@ -767,22 +767,22 @@
|
|
|
767
767
|
return Ke(e) && Ve(e), 0;
|
|
768
768
|
}
|
|
769
769
|
function Me(e) {
|
|
770
|
-
return ot(e) ? (
|
|
770
|
+
return ot(e) ? (jn("gobj NULL or DESTROYED"), -1) : at(e, D.WALK_FIRST2LAST, Ge, 0, 0);
|
|
771
771
|
}
|
|
772
772
|
function We(e) {
|
|
773
|
-
if (ot(e)) return
|
|
774
|
-
if (e.playing) return
|
|
775
|
-
if (e.disabled) return
|
|
773
|
+
if (ot(e)) return jn(`gobj NULL or DESTROYED: ${et(e)}`), -1;
|
|
774
|
+
if (e.playing) return jn(`${et(e)}: GObj ALREADY PLAYING`), -1;
|
|
775
|
+
if (e.disabled) return jn(`${et(e)}: GObj DISABLED`), -1;
|
|
776
776
|
if (!Ke(e)) {
|
|
777
|
-
if (e.gclass.gclass_flag & w.gcflag_required_start_to_play) return
|
|
778
|
-
|
|
777
|
+
if (e.gclass.gclass_flag & w.gcflag_required_start_to_play) return jn(`${et(e)}: Cannot play, start not done`), -1;
|
|
778
|
+
On(`${et(e)}: GObj playing without previous start`), Pe(e);
|
|
779
779
|
}
|
|
780
780
|
J(e) && L(n("⏯ ⏯ play: %s", tt(e))), e.playing = !0;
|
|
781
781
|
let t = 0;
|
|
782
782
|
return e.gclass.gmt.mt_play && (t = e.gclass.gmt.mt_play(e), (t < 0 || !1 === t) && (e.playing = !1)), t;
|
|
783
783
|
}
|
|
784
784
|
function xe(e) {
|
|
785
|
-
return ot(e) ? (
|
|
785
|
+
return ot(e) ? (jn("gobj NULL or DESTROYED"), -1) : e.playing ? (J(e) && L(n("⏸ ⏸ pause: %s", tt(e))), e.playing = !1, e.gclass.gmt.mt_pause ? e.gclass.gmt.mt_pause(e) : 0) : (jn(`${et(e)}: GObj NOT PLAYING`), -1);
|
|
786
786
|
}
|
|
787
787
|
function Ke(e) {
|
|
788
788
|
return !ot(e) && e.running;
|
|
@@ -812,50 +812,50 @@
|
|
|
812
812
|
return e ? jt(e, "yuno_id") : "";
|
|
813
813
|
}
|
|
814
814
|
function Xe(e) {
|
|
815
|
-
return
|
|
815
|
+
return cr(e) ? e.gobj_name : (jn("gobj bad type"), null);
|
|
816
816
|
}
|
|
817
817
|
function Ze(e) {
|
|
818
|
-
return
|
|
818
|
+
return cr(e) ? e.gclass.gclass_name : (jn("gobj NULL of bad type"), null);
|
|
819
819
|
}
|
|
820
820
|
function et(e) {
|
|
821
|
-
return
|
|
821
|
+
return cr(e) ? e.gclass.gclass_name + "^" + Xe(e) : (jn("gobj bad type"), null);
|
|
822
822
|
}
|
|
823
823
|
function tt(e) {
|
|
824
|
-
if (!
|
|
824
|
+
if (!cr(e)) return jn("gobj NULL of bad type"), null;
|
|
825
825
|
let t = et(e), n = nt(e);
|
|
826
826
|
for (; n;) t = et(n) + "`" + t, n = nt(n);
|
|
827
827
|
return t;
|
|
828
828
|
}
|
|
829
829
|
function nt(e) {
|
|
830
|
-
return
|
|
830
|
+
return cr(e) ? e.parent : (jn("gobj NULL of bad type"), null);
|
|
831
831
|
}
|
|
832
832
|
function rt(e) {
|
|
833
|
-
return
|
|
833
|
+
return cr(e) ? !!(e.gobj_flag & N.gobj_flag_volatil) : (jn("gobj NULL of bad type"), null);
|
|
834
834
|
}
|
|
835
835
|
function lt(e) {
|
|
836
|
-
return
|
|
836
|
+
return cr(e) ? !!(e.gobj_flag & N.gobj_flag_pure_child) : (jn("gobj NULL of bad type"), null);
|
|
837
837
|
}
|
|
838
838
|
function ot(e) {
|
|
839
|
-
return !
|
|
839
|
+
return !cr(e) || !!(e.obflag & ($.obflag_destroyed | $.obflag_destroying));
|
|
840
840
|
}
|
|
841
841
|
function st(e) {
|
|
842
|
-
return
|
|
842
|
+
return cr(e) ? e.bottom_gobj : (jn("gobj NULL of bad type"), null);
|
|
843
843
|
}
|
|
844
844
|
function it(e, t) {
|
|
845
|
-
if (!
|
|
846
|
-
e.bottom_gobj && t &&
|
|
845
|
+
if (!cr(e)) return jn("gobj NULL of bad type"), null;
|
|
846
|
+
e.bottom_gobj && t && On(`${et(e)}: bottom_gobj already set`), e.bottom_gobj = t;
|
|
847
847
|
}
|
|
848
848
|
function _t(e, t, n) {
|
|
849
|
-
return
|
|
849
|
+
return cr(e) ? t ? ge(e.gclass, t, n) : e.gclass.attrs_table : (jn("gobj NULL of bad type"), null);
|
|
850
850
|
}
|
|
851
851
|
function at(e, t, n, r, l) {
|
|
852
|
-
return ot(e) ? (
|
|
852
|
+
return ot(e) ? (jn("gobj NULL, destroying, or bad type"), 0) : ft(e.dl_children, t, n, r, l);
|
|
853
853
|
}
|
|
854
854
|
function ut(e, t, n, r, l) {
|
|
855
|
-
return ot(e) ? (
|
|
855
|
+
return ot(e) ? (jn("gobj NULL, destroying, or bad type"), 0) : dt(e.dl_children, t, n, r, l);
|
|
856
856
|
}
|
|
857
857
|
function ct(e) {
|
|
858
|
-
return "number" == typeof e && isFinite(e) ? e : (null == e ||
|
|
858
|
+
return "number" == typeof e && isFinite(e) ? e : (null == e || jn(`walk callback must return a NUMBER (-1 stop, 0 descend, >0 skip children), got ${typeof e}: taken as 0`), 0);
|
|
859
859
|
}
|
|
860
860
|
function ft(e, t, n, r, l) {
|
|
861
861
|
let o, s = [...e];
|
|
@@ -893,7 +893,7 @@
|
|
|
893
893
|
return 0;
|
|
894
894
|
}
|
|
895
895
|
function bt(e, t) {
|
|
896
|
-
if (!
|
|
896
|
+
if (!cr(e)) return jn("gobj NULL of bad type"), !1;
|
|
897
897
|
let n = t.__gclass_name__, r = t.__gobj_name__, l = t.__prefix_gobj_name__;
|
|
898
898
|
t.__disabled__;
|
|
899
899
|
let o = t.__state__;
|
|
@@ -909,7 +909,7 @@
|
|
|
909
909
|
return !0;
|
|
910
910
|
}
|
|
911
911
|
function pt(e, t) {
|
|
912
|
-
if (ot(e)) return
|
|
912
|
+
if (ot(e)) return jn("gobj NULL or DESTROYED"), null;
|
|
913
913
|
const n = e.dl_children;
|
|
914
914
|
for (let e = 0; e < n.length; e++) {
|
|
915
915
|
const r = n[e];
|
|
@@ -937,7 +937,7 @@
|
|
|
937
937
|
return o ? (n.splice(0, 1), n = n.join("`"), mt(o, n)) : null;
|
|
938
938
|
}
|
|
939
939
|
function ht(e, t) {
|
|
940
|
-
return !
|
|
940
|
+
return !fr(t) && !!ge(e.gclass, t, !1);
|
|
941
941
|
}
|
|
942
942
|
function yt(e, t, n) {
|
|
943
943
|
let r = e.jn_attrs;
|
|
@@ -945,7 +945,7 @@
|
|
|
945
945
|
let n = r[t];
|
|
946
946
|
return e.gclass.gmt.mt_reading ? e.gclass.gmt.mt_reading(e, t, n) : n;
|
|
947
947
|
}
|
|
948
|
-
return
|
|
948
|
+
return jn(`${et(e)}: GClass Attribute NOT FOUND, attr ${t}`), null;
|
|
949
949
|
}
|
|
950
950
|
function Et(e, t, n) {
|
|
951
951
|
let r = {}, l = e.gclass.attrs_table;
|
|
@@ -953,41 +953,41 @@
|
|
|
953
953
|
const o = l[n];
|
|
954
954
|
if (o.name && (-1 === t || o.flag & t)) {
|
|
955
955
|
let t;
|
|
956
|
-
!e.gclass.gmt.mt_reading || e.obflag & $.obflag_destroyed ? t =
|
|
956
|
+
!e.gclass.gmt.mt_reading || e.obflag & $.obflag_destroyed ? t = qn(e.jn_attrs, o.name) : (t = e.gclass.gmt.mt_reading(e, o.name), void 0 === t && (t = qn(e.jn_attrs, o.name))), zn(r, o.name, t);
|
|
957
957
|
}
|
|
958
958
|
}
|
|
959
959
|
return r;
|
|
960
960
|
}
|
|
961
961
|
function Tt(e, t) {
|
|
962
962
|
if (t) {
|
|
963
|
-
if (0 ===
|
|
964
|
-
if (0 ===
|
|
965
|
-
if (0 ===
|
|
966
|
-
if (0 ===
|
|
963
|
+
if (0 === br(t, "__disabled__")) return Ye(e);
|
|
964
|
+
if (0 === br(t, "__running__")) return Ke(e);
|
|
965
|
+
if (0 === br(t, "__playing__")) return Je(e);
|
|
966
|
+
if (0 === br(t, "__service__")) return Be(e);
|
|
967
967
|
}
|
|
968
968
|
let n = fe(e, t, !1);
|
|
969
|
-
return n ? !e.gclass.gmt.mt_reading || e.obflag & $.obflag_destroyed ?
|
|
969
|
+
return n ? !e.gclass.gmt.mt_reading || e.obflag & $.obflag_destroyed ? qn(n, t) : e.gclass.gmt.mt_reading(e, t) : (jn(`${et(e)}: GClass Attribute NOT FOUND, attr ${t}`), 0);
|
|
970
970
|
}
|
|
971
971
|
function vt(e, t) {
|
|
972
|
-
t &&
|
|
972
|
+
t && br(t, "__trace_level__");
|
|
973
973
|
let n = fe(e, t, !1);
|
|
974
|
-
return n ? !e.gclass.gmt.mt_reading || e.obflag & $.obflag_destroyed ?
|
|
974
|
+
return n ? !e.gclass.gmt.mt_reading || e.obflag & $.obflag_destroyed ? qn(n, t) : e.gclass.gmt.mt_reading(e, t) : (jn(`${et(e)}: GClass Attribute NOT FOUND, attr ${t}`), 0);
|
|
975
975
|
}
|
|
976
976
|
function jt(e, t) {
|
|
977
|
-
if (t && 0 ===
|
|
977
|
+
if (t && 0 === br(t, "__state__")) return kt(e);
|
|
978
978
|
let n = fe(e, t, !1);
|
|
979
|
-
return n ? !e.gclass.gmt.mt_reading || e.obflag & $.obflag_destroyed ?
|
|
979
|
+
return n ? !e.gclass.gmt.mt_reading || e.obflag & $.obflag_destroyed ? qn(n, t) : e.gclass.gmt.mt_reading(e, t) : (jn(`${et(e)}: GClass Attribute NOT FOUND, attr ${t}`), 0);
|
|
980
980
|
}
|
|
981
981
|
function Ot(e, t) {
|
|
982
982
|
let n = fe(e, t, !1);
|
|
983
|
-
return n ? !e.gclass.gmt.mt_reading || e.obflag & $.obflag_destroyed ?
|
|
983
|
+
return n ? !e.gclass.gmt.mt_reading || e.obflag & $.obflag_destroyed ? qn(n, t) : e.gclass.gmt.mt_reading(e, t) : (jn(`${et(e)}: GClass Attribute NOT FOUND, attr ${t}`), 0);
|
|
984
984
|
}
|
|
985
985
|
function St(e, t, r, l) {
|
|
986
|
-
if (!
|
|
986
|
+
if (!sr(t)) return jn(n("gobj_write_attr(%s): path must be a string", et(e))), -1;
|
|
987
987
|
let o, s = e.jn_attrs, i = t.split("`");
|
|
988
988
|
if (i.length <= 1) {
|
|
989
989
|
let l = t;
|
|
990
|
-
return l in s && Object.prototype.hasOwnProperty.call(s, l) ? (s[l] = r,
|
|
990
|
+
return l in s && Object.prototype.hasOwnProperty.call(s, l) ? (s[l] = r, lr(e.priv) && Object.prototype.hasOwnProperty.call(e.priv, l) && (e.priv[l] = r), e.obflag & $.obflag_created && !(e.obflag & $.obflag_destroyed) && e.gclass.gmt.mt_writing && e.gclass.gmt.mt_writing(e, l), 0) : (jn(n("gobj_write_attr(%s): attr not found '%s'", et(e), l)), -1);
|
|
991
991
|
}
|
|
992
992
|
let _ = i.length;
|
|
993
993
|
for (let t = 0; t < _; t++) {
|
|
@@ -998,10 +998,10 @@
|
|
|
998
998
|
continue;
|
|
999
999
|
}
|
|
1000
1000
|
let l = e.jn_attrs;
|
|
1001
|
-
if (o in l && Object.prototype.hasOwnProperty.call(l, o)) return l[o] = r,
|
|
1001
|
+
if (o in l && Object.prototype.hasOwnProperty.call(l, o)) return l[o] = r, lr(e.priv) && Object.prototype.hasOwnProperty.call(e.priv, o) && (e.priv[o] = r), e.obflag & $.obflag_created && !(e.obflag & $.obflag_destroyed) && e.gclass.gmt.mt_writing && e.gclass.gmt.mt_writing(e, o), 0;
|
|
1002
1002
|
break;
|
|
1003
1003
|
}
|
|
1004
|
-
return
|
|
1004
|
+
return jn(n("gobj_write_attr(%s): attr not found '%s'", et(e), o)), -1;
|
|
1005
1005
|
}
|
|
1006
1006
|
function wt(e, t, n, r) {
|
|
1007
1007
|
let l = ce(e), o = 0;
|
|
@@ -1013,21 +1013,21 @@
|
|
|
1013
1013
|
}
|
|
1014
1014
|
function Nt(e, t, n) {
|
|
1015
1015
|
let r = fe(e, t, !1);
|
|
1016
|
-
return r ? (r[t] =
|
|
1016
|
+
return r ? (r[t] = gr(n), lr(e.priv) && Object.prototype.hasOwnProperty.call(e.priv, t) && (e.priv[t] = r[t]), e.obflag & $.obflag_created && !(e.obflag & $.obflag_destroyed) && e.gclass.gmt.mt_writing && e.gclass.gmt.mt_writing(e, t), 0) : (jn(`${et(e)}: GClass Attribute NOT FOUND, attr ${t}`), -1);
|
|
1017
1017
|
}
|
|
1018
1018
|
function $t(e, t, n) {
|
|
1019
1019
|
let r = fe(e, t, !1);
|
|
1020
|
-
return r ? (r[t] = parseInt(n),
|
|
1020
|
+
return r ? (r[t] = parseInt(n), lr(e.priv) && Object.prototype.hasOwnProperty.call(e.priv, t) && (e.priv[t] = r[t]), e.obflag & $.obflag_created && !(e.obflag & $.obflag_destroyed) && e.gclass.gmt.mt_writing && e.gclass.gmt.mt_writing(e, t), 0) : (jn(`${et(e)}: GClass Attribute NOT FOUND, attr ${t}`), -1);
|
|
1021
1021
|
}
|
|
1022
1022
|
function Rt(e, t, n) {
|
|
1023
1023
|
let r = fe(e, t, !1);
|
|
1024
|
-
return r ? (r[t] = String(n),
|
|
1024
|
+
return r ? (r[t] = String(n), lr(e.priv) && Object.prototype.hasOwnProperty.call(e.priv, t) && (e.priv[t] = r[t]), e.obflag & $.obflag_created && !(e.obflag & $.obflag_destroyed) && e.gclass.gmt.mt_writing && e.gclass.gmt.mt_writing(e, t), 0) : (jn(`${et(e)}: GClass Attribute NOT FOUND, attr ${t}`), -1);
|
|
1025
1025
|
}
|
|
1026
1026
|
function Dt(e, t) {
|
|
1027
|
-
if (ot(e)) return
|
|
1027
|
+
if (ot(e)) return jn("gobj NULL or DESTROYED"), null;
|
|
1028
1028
|
if (e.current_state.state_name === t) return !1;
|
|
1029
1029
|
let r = pe(e.gclass, t);
|
|
1030
|
-
if (!r) return
|
|
1030
|
+
if (!r) return jn(`${et(e)}: state unknown, state ${t}`), !1;
|
|
1031
1031
|
e.last_state = e.current_state, e.current_state = r;
|
|
1032
1032
|
let l = H(e, "EV_STATE_CHANGED"), o = !!function(e) {
|
|
1033
1033
|
return x(e) & P.TRACE_STATES;
|
|
@@ -1035,10 +1035,10 @@
|
|
|
1035
1035
|
return (l || o) && (1 === C || L(n("🔀🔀 mach(%s%s^%s), new st(%s), prev st(%s)", e.running ? "" : "!!", Ze(e), Xe(e), kt(e), e.last_state.state_name))), !0;
|
|
1036
1036
|
}
|
|
1037
1037
|
function kt(e) {
|
|
1038
|
-
return
|
|
1038
|
+
return cr(e) ? e.current_state.state_name : (jn("hgobj NULL"), "");
|
|
1039
1039
|
}
|
|
1040
1040
|
function At(e, t, n) {
|
|
1041
|
-
if (!
|
|
1041
|
+
if (!cr(e)) return jn("gobj NULL of bad type"), null;
|
|
1042
1042
|
let r = ve(e.gclass, t);
|
|
1043
1043
|
if (r) return r;
|
|
1044
1044
|
if (n) {
|
|
@@ -1060,12 +1060,12 @@
|
|
|
1060
1060
|
}
|
|
1061
1061
|
var Lt = [], Pt = !1;
|
|
1062
1062
|
function Ut(e, t, r, l) {
|
|
1063
|
-
return e && e instanceof S ? e.obflag & ($.obflag_destroyed | $.obflag_destroying) ? (
|
|
1063
|
+
return e && e instanceof S ? e.obflag & ($.obflag_destroyed | $.obflag_destroying) ? (jn(`gobj_post_event(): gobj dst DESTROYING, event ${t}`), -1) : fr(t) ? (jn("gobj_post_event(): event EMPTY"), -1) : It(e, t, 0) ? Lt.length >= 1e4 ? (jn(`gobj_post_event(): too many posted events, this is NOT a work queue, event ${t}, pending ${Lt.length}`), -1) : (Lt.push({
|
|
1064
1064
|
dst: e,
|
|
1065
1065
|
event: t,
|
|
1066
1066
|
kw: r,
|
|
1067
1067
|
src: l
|
|
1068
|
-
}), H(e, t) && !z(l, t) && L(n("📬 posted(%s%s), ev: %s, pending: %d", e.running ? "" : "!!", et(e), t, Lt.length)), Pt || (Pt = !0, setTimeout(Ft, 0)), 0) : (
|
|
1068
|
+
}), H(e, t) && !z(l, t) && L(n("📬 posted(%s%s), ev: %s, pending: %d", e.running ? "" : "!!", et(e), t, Lt.length)), Pt || (Pt = !0, setTimeout(Ft, 0)), 0) : (jn(`gobj_post_event(): event NOT DEFINED in gclass ${Ze(e)}, event ${t}`), -1) : (jn(`gobj_post_event(): gobj dst NULL, event ${t}`), -1);
|
|
1069
1069
|
}
|
|
1070
1070
|
function Ft() {
|
|
1071
1071
|
Pt = !1;
|
|
@@ -1086,21 +1086,21 @@
|
|
|
1086
1086
|
return Lt.length > 0 && !Pt && (Pt = !0, setTimeout(Ft, 0)), t;
|
|
1087
1087
|
}
|
|
1088
1088
|
function Vt(e, t, r, l) {
|
|
1089
|
-
if (!(e && e instanceof S)) return
|
|
1090
|
-
if (e.obflag & ($.obflag_destroyed | $.obflag_destroying)) return
|
|
1089
|
+
if (!(e && e instanceof S)) return jn("gobj dst NULL"), -1;
|
|
1090
|
+
if (e.obflag & ($.obflag_destroyed | $.obflag_destroying)) return jn("gobj dst DESTROYED"), -1;
|
|
1091
1091
|
let o = e.current_state;
|
|
1092
|
-
if (!o) return
|
|
1092
|
+
if (!o) return jn(`${et(e)}: current_state NULL`), -1;
|
|
1093
1093
|
let s = H(e, t) && !z(l, t);
|
|
1094
1094
|
h++;
|
|
1095
1095
|
let i = me(o, t);
|
|
1096
|
-
if (!i) return e.gclass.gmt.mt_inject_event ? (h--, s && (L(1 === C ? n("🔜 %s %s%s %s", t || "", e.running ? "" : "!!", et(e), o.state_name) : n("🔃 mach(%s%s), st: %s, ev: %s, from(%s%s)", e.running ? "" : "!!", et(e), o.state_name, t || "", l && !l.running ? "!!" : "", et(l))), r && q(e) &&
|
|
1096
|
+
if (!i) return e.gclass.gmt.mt_inject_event ? (h--, s && (L(1 === C ? n("🔜 %s %s%s %s", t || "", e.running ? "" : "!!", et(e), o.state_name) : n("🔃 mach(%s%s), st: %s, ev: %s, from(%s%s)", e.running ? "" : "!!", et(e), o.state_name, t || "", l && !l.running ? "!!" : "", et(l))), r && q(e) && tr(r) && Wn(r)), e.gclass.gmt.mt_inject_event(e, t, r, l)) : (s && L(n("📛 mach(%s%s^%s), st: %s, ev: %s, 📛📛ERROR Event NOT DEFINED in state📛📛, from(%s%s^%s)", e.running ? "" : "!!", Ze(e), Xe(e), o.state_name, t || "", l && !l.running ? "!!" : "", Ze(l), Xe(l))), jn(`📛📛 Event NOT DEFINED in state 📛📛: ${et(e)}, ${o.state_name}, ${t}`), h--, -1);
|
|
1097
1097
|
if (s) {
|
|
1098
1098
|
if (1 === C) L(n("🔄 %s %s%s %s from %s%s", t || "", e.running ? "" : "!!", et(e), o.state_name, l && !l.running ? "!!" : "", et(l)));
|
|
1099
1099
|
else {
|
|
1100
1100
|
let r = "";
|
|
1101
|
-
i.action && (r =
|
|
1101
|
+
i.action && (r = _l(i.action)), L(n("🔄 mach(%s%s^%s), st: %s, ev: %s%s%s, ac: %s, from(%s%s^%s)", e.running ? "" : "!!", Ze(e), Xe(e), o.state_name, "", t || "", "", r, l && !l.running ? "!!" : "", Ze(l), Xe(l)));
|
|
1102
1102
|
}
|
|
1103
|
-
r && q(e) &&
|
|
1103
|
+
r && q(e) && tr(r) && Wn(r);
|
|
1104
1104
|
}
|
|
1105
1105
|
i.next_state && Dt(e, i.next_state);
|
|
1106
1106
|
let _ = -1;
|
|
@@ -1108,14 +1108,14 @@
|
|
|
1108
1108
|
i.action && (_ = i.action(e, t, r, l));
|
|
1109
1109
|
} catch (n) {
|
|
1110
1110
|
if (h--, !n || !n.__gobj_logged__) {
|
|
1111
|
-
|
|
1111
|
+
jn(`${et(e)}: action of ${t} in ${o.state_name} THREW: ${n && n.stack ? n.stack : n}`);
|
|
1112
1112
|
try {
|
|
1113
1113
|
n.__gobj_logged__ = !0;
|
|
1114
1114
|
} catch (e) {}
|
|
1115
1115
|
}
|
|
1116
1116
|
throw n;
|
|
1117
1117
|
}
|
|
1118
|
-
return !s || 1 === C || e.obflag & $.obflag_destroyed || L(n("<- mach(%s%s^%s), st: %s, ev: %s, ret: %d", e.running ? "" : "!!", Ze(e), Xe(e), e.current_state.state_name, t || "",
|
|
1118
|
+
return !s || 1 === C || e.obflag & $.obflag_destroyed || L(n("<- mach(%s%s^%s), st: %s, ev: %s, ret: %d", e.running ? "" : "!!", Ze(e), Xe(e), e.current_state.state_name, t || "", ir(_) ? _ : 0)), h--, _;
|
|
1119
1119
|
}
|
|
1120
1120
|
var Gt = Object.freeze({
|
|
1121
1121
|
__rename_event_name__: 1,
|
|
@@ -1148,35 +1148,35 @@
|
|
|
1148
1148
|
];
|
|
1149
1149
|
function xt(e, t) {
|
|
1150
1150
|
let n = e ? e.__config__ : null;
|
|
1151
|
-
if (!
|
|
1151
|
+
if (!lr(n) || !hr(n, "__hard_subscription__") && !hr(n, "__own_event__") && !hr(n, "__rename_event_name__")) return {
|
|
1152
1152
|
kw: e,
|
|
1153
1153
|
renamed_event: ""
|
|
1154
1154
|
};
|
|
1155
|
-
let r =
|
|
1155
|
+
let r = Yn({}, e), l = Yn({}, n);
|
|
1156
1156
|
r.__config__ = l;
|
|
1157
|
-
let o = "", s = l.__rename_event_name__, i = "string" != typeof s ||
|
|
1158
|
-
return i && (o = i.event_name, delete l.__rename_event_name__, t &&
|
|
1157
|
+
let o = "", s = l.__rename_event_name__, i = "string" != typeof s || fr(s) ? null : Mt(s);
|
|
1158
|
+
return i && (o = i.event_name, delete l.__rename_event_name__, t && rr(r.__global__) > 0 && (r.__global__ = Yn(Yn({}, r.__global__), { __original_event_name__: t }))), delete l.__hard_subscription__, delete l.__own_event__, {
|
|
1159
1159
|
kw: r,
|
|
1160
1160
|
renamed_event: o
|
|
1161
1161
|
};
|
|
1162
1162
|
}
|
|
1163
1163
|
function Kt(e, t, n, r, l, o) {
|
|
1164
|
-
let s =
|
|
1165
|
-
if (t && t !==
|
|
1166
|
-
let t =
|
|
1167
|
-
|
|
1164
|
+
let s = $r(t, l, "__config__", null), i = $r(t, l, "__global__", null), _ = $r(t, l, "__local__", null), a = Rr(t, l, "__filter__", null), u = !0;
|
|
1165
|
+
if (t && t !== Nr(null, e, "publisher", null) && (u = !1), o && o !== Nr(null, e, "subscriber", null) && (u = !1), n && n !== wr(null, e, "event", "") && (u = !1), r && r !== wr(null, e, "renamed_event", "") && (u = !1), rr(s) > 0) {
|
|
1166
|
+
let t = $r(null, e, "__config__", null);
|
|
1167
|
+
rr(t) > 0 && Kn(t, s) || (u = !1);
|
|
1168
1168
|
}
|
|
1169
|
-
if (
|
|
1170
|
-
let t =
|
|
1171
|
-
|
|
1169
|
+
if (rr(i) > 0) {
|
|
1170
|
+
let t = $r(null, e, "__global__", null);
|
|
1171
|
+
rr(t) > 0 && Kn(t, i) || (u = !1);
|
|
1172
1172
|
}
|
|
1173
|
-
if (
|
|
1174
|
-
let t =
|
|
1175
|
-
|
|
1173
|
+
if (rr(_) > 0) {
|
|
1174
|
+
let t = $r(null, e, "__local__", null);
|
|
1175
|
+
rr(t) > 0 && Kn(t, _) || (u = !1);
|
|
1176
1176
|
}
|
|
1177
|
-
if (
|
|
1178
|
-
let t =
|
|
1179
|
-
|
|
1177
|
+
if (rr(a) > 0) {
|
|
1178
|
+
let t = Rr(null, e, "__filter__", null);
|
|
1179
|
+
rr(t) > 0 && Kn(t, a) || (u = !1);
|
|
1180
1180
|
}
|
|
1181
1181
|
return u;
|
|
1182
1182
|
}
|
|
@@ -1184,7 +1184,7 @@
|
|
|
1184
1184
|
let s = [];
|
|
1185
1185
|
for (let i = 0; i < e.length; i++) {
|
|
1186
1186
|
let _ = e[i];
|
|
1187
|
-
Kt(_, t, n, r, l, o) &&
|
|
1187
|
+
Kt(_, t, n, r, l, o) && Xn(s, _);
|
|
1188
1188
|
}
|
|
1189
1189
|
return s;
|
|
1190
1190
|
}
|
|
@@ -1192,17 +1192,17 @@
|
|
|
1192
1192
|
return e.indexOf(t);
|
|
1193
1193
|
}
|
|
1194
1194
|
function Jt(e, t, r, l) {
|
|
1195
|
-
let o =
|
|
1196
|
-
if (!!(
|
|
1195
|
+
let o = Nr(e, t, "publisher", null, Zt.KW_REQUIRED), s = Nr(e, t, "subscriber", null, Zt.KW_REQUIRED), i = wr(e, t, "event", "", Zt.KW_REQUIRED);
|
|
1196
|
+
if (!!(Sr(e, t, "subs_flag", null, Zt.KW_REQUIRED) & Gt.__hard_subscription__) && !r) return -1;
|
|
1197
1197
|
let _ = B(s) || B(o);
|
|
1198
1198
|
if (Bt(o.dl_subscriptions, t) < 0) return _ && L(n("💜💜👎 unsubscribing event '%s': publisher %s, subscriber'%s', ALREADY REMOVED", i || "", et(o), et(s))), 1;
|
|
1199
|
-
_ && (L(n("💜💜👎 unsubscribing event '%s': publisher %s, subscriber'%s'", i || "", et(o), et(s))),
|
|
1199
|
+
_ && (L(n("💜💜👎 unsubscribing event '%s': publisher %s, subscriber'%s'", i || "", et(o), et(s))), Nn(t)), o.obflag & $.obflag_destroyed || l || o.gclass.gmt.mt_subscription_deleted && o.gclass.gmt.mt_subscription_deleted(o, t);
|
|
1200
1200
|
let a = Bt(o.dl_subscriptions, t);
|
|
1201
|
-
return a >= 0 ?
|
|
1201
|
+
return a >= 0 ? er(o.dl_subscriptions, a) : (jn(`${et(e)}: subscription in publisher not found`), Nn(t)), a = Bt(s.dl_subscribings, t), a >= 0 ? er(s.dl_subscribings, a) : (jn(`${et(e)}: subscription in subscriber not found`), Nn(t)), 0;
|
|
1202
1202
|
}
|
|
1203
1203
|
function qt(e, t, r, l) {
|
|
1204
|
-
if (null == r && (r = {}), !e) return
|
|
1205
|
-
if (!l) return
|
|
1204
|
+
if (null == r && (r = {}), !e) return jn(`publisher NULL: ev ${t}`), 0;
|
|
1205
|
+
if (!l) return jn(`subscriber NULL: ev ${t}`), 0;
|
|
1206
1206
|
const o = /* @__PURE__ */ new Set([
|
|
1207
1207
|
"__config__",
|
|
1208
1208
|
"__global__",
|
|
@@ -1211,49 +1211,49 @@
|
|
|
1211
1211
|
"__service__"
|
|
1212
1212
|
]);
|
|
1213
1213
|
if (Object.keys(r).forEach((n) => {
|
|
1214
|
-
o.has(n) ||
|
|
1215
|
-
}),
|
|
1216
|
-
else if (!(Ct(e, t, R.EVF_OUTPUT_EVENT) || e.gclass.gclass_flag & w.gcflag_no_check_output_events)) return
|
|
1214
|
+
o.has(n) || jn(`${et(e)}: key ignored in subscription (key: ${n}, event: ${t})`);
|
|
1215
|
+
}), fr(t)) t = "";
|
|
1216
|
+
else if (!(Ct(e, t, R.EVF_OUTPUT_EVENT) || e.gclass.gclass_flag & w.gcflag_no_check_output_events)) return jn(`event NOT in output event list: ${et(e)}, ${t}`), 0;
|
|
1217
1217
|
let s = xt(r, t), i = Yt(e.dl_subscriptions, e, t, s.renamed_event, s.kw, l), _ = null;
|
|
1218
|
-
for (let t = 0; t < i.length; t++) if (
|
|
1218
|
+
for (let t = 0; t < i.length; t++) if (Sr(e, i[t], "subs_flag", 0, Zt.KW_REQUIRED) & Gt.__hard_subscription__) {
|
|
1219
1219
|
_ = i[t];
|
|
1220
1220
|
break;
|
|
1221
1221
|
}
|
|
1222
|
-
if (_) return
|
|
1223
|
-
|
|
1222
|
+
if (_) return On(`${et(e)}: Hard subscription REPEATED, the one there is kept and returned (event: ${t}, subscriber: ${et(l)})`), _;
|
|
1223
|
+
nr(i) > 0 && (jn(`${et(e)}: ${nr(i)} subscription(s) REPEATED, will be deleted and override`), Nn(i, "subscription REPEATED"), Ht(e, i, !1));
|
|
1224
1224
|
let a = function(e, t, n, r) {
|
|
1225
1225
|
let l = _e(e, Wt);
|
|
1226
|
-
|
|
1226
|
+
Qn(l, "event", t), Qn(l, "subscriber", r), Qn(l, "publisher", e);
|
|
1227
1227
|
let o = 0;
|
|
1228
1228
|
if (n) {
|
|
1229
|
-
let r =
|
|
1230
|
-
if (
|
|
1231
|
-
let n =
|
|
1232
|
-
|
|
1233
|
-
let s =
|
|
1234
|
-
if (!
|
|
1229
|
+
let r = $r(e, n, "__config__", null), s = $r(e, n, "__global__", null), i = $r(e, n, "__local__", null), _ = Rr(e, n, "__filter__", null), a = wr(e, n, "__service__", "");
|
|
1230
|
+
if (rr(s) > 0 && Qn(l, "__global__", xn(s)), rr(r) > 0) {
|
|
1231
|
+
let n = xn(r);
|
|
1232
|
+
Qn(l, "__config__", n);
|
|
1233
|
+
let s = wr(e, n, "__rename_event_name__", "");
|
|
1234
|
+
if (!fr(s)) {
|
|
1235
1235
|
let r = Mt(s);
|
|
1236
1236
|
if (r) {
|
|
1237
|
-
|
|
1238
|
-
let s =
|
|
1239
|
-
|
|
1240
|
-
} else
|
|
1237
|
+
Qn(l, "renamed_event", r.event_name), delete n.__rename_event_name__, o |= Gt.__rename_event_name__;
|
|
1238
|
+
let s = $r(e, l, "__global__", null);
|
|
1239
|
+
lr(s) || (s = {}, Qn(l, "__global__", s)), s.__original_event_name__ = t;
|
|
1240
|
+
} else jn(`${et(e)}: EVENT NOT FOUND (__rename_event_name__: ${s})`);
|
|
1241
1241
|
}
|
|
1242
|
-
if (
|
|
1243
|
-
let t =
|
|
1244
|
-
|
|
1242
|
+
if (hr(n, "__hard_subscription__")) {
|
|
1243
|
+
let t = Or(e, n, "__hard_subscription__", !1);
|
|
1244
|
+
Hn(n, "__hard_subscription__"), t && (o |= Gt.__hard_subscription__);
|
|
1245
1245
|
}
|
|
1246
|
-
if (
|
|
1247
|
-
let t =
|
|
1248
|
-
|
|
1246
|
+
if (hr(n, "__own_event__")) {
|
|
1247
|
+
let t = Or(e, n, "__own_event__", !1);
|
|
1248
|
+
Hn(n, "__own_event__"), t && (o |= Gt.__own_event__);
|
|
1249
1249
|
}
|
|
1250
1250
|
}
|
|
1251
|
-
|
|
1251
|
+
rr(i) > 0 && Qn(l, "__local__", xn(i)), rr(_) > 0 && Qn(l, "__filter__", xn(_)), fr(a) || Qn(l, "__service__", a);
|
|
1252
1252
|
}
|
|
1253
|
-
return
|
|
1253
|
+
return Qn(l, "subs_flag", o), l;
|
|
1254
1254
|
}(e, t, r, l);
|
|
1255
|
-
if (!a) return
|
|
1256
|
-
if (
|
|
1255
|
+
if (!a) return jn(`${et(e)}: _create_subscription() FAILED`), 0;
|
|
1256
|
+
if (Xn(e.dl_subscriptions, a), Xn(l.dl_subscribings, a), (B(l) || B(e)) && (L(n("💜💜👍 subscribing event '%s', publisher '%s', subscriber %s", t || "", et(e), et(l))), r && (q(l) || q(e)) && Wn(r)), e.gclass.gmt.mt_subscription_added) {
|
|
1257
1257
|
let t = e.gclass.gmt.mt_subscription_added(e, a);
|
|
1258
1258
|
(t < 0 || !1 === t) && (Jt(e, a, !0, !0), a = 0);
|
|
1259
1259
|
}
|
|
@@ -1262,7 +1262,7 @@
|
|
|
1262
1262
|
function Ht(e, t, n) {
|
|
1263
1263
|
let r = [...t], l = 0;
|
|
1264
1264
|
for (let t = 0; t < r.length; t++) Jt(e, r[t], n, !1) > 0 && l++;
|
|
1265
|
-
return l &&
|
|
1265
|
+
return l && On(`${et(e)}: Subscription(s) already removed, nothing to remove (count: ${l})`), 0;
|
|
1266
1266
|
}
|
|
1267
1267
|
function zt(e, t, n, r) {
|
|
1268
1268
|
return null == n && (n = {}), Yt(e.dl_subscriptions, e, t, null, n, r);
|
|
@@ -1271,12 +1271,12 @@
|
|
|
1271
1271
|
return Yt(e.dl_subscribings, r, t, null, n, e);
|
|
1272
1272
|
}
|
|
1273
1273
|
function Xt(e, t, r) {
|
|
1274
|
-
if (
|
|
1275
|
-
if (
|
|
1274
|
+
if (lr(r) || (r = {}), !e || e.obflag & ($.obflag_destroyed | $.obflag_destroying)) return jn("gobj NULL or DESTROYED"), -1;
|
|
1275
|
+
if (fr(t)) return jn(`${et(e)}: event EMPTY`), -1;
|
|
1276
1276
|
let l = At(e, t, !0);
|
|
1277
|
-
if (!(l && l.event_flag & (R.EVF_SYSTEM_EVENT | R.EVF_OUTPUT_EVENT) || e.gclass.gclass_flag & w.gcflag_no_check_output_events)) return
|
|
1277
|
+
if (!(l && l.event_flag & (R.EVF_SYSTEM_EVENT | R.EVF_OUTPUT_EVENT) || e.gclass.gclass_flag & w.gcflag_no_check_output_events)) return jn(`event NOT in output event list: ${et(e)}, ev ${t}`), -1;
|
|
1278
1278
|
let o = (B(e) || H(e, t)) && !z(e, t);
|
|
1279
|
-
if (o && (L(1 === C ? n("🔝🔝 %s %s%s %s", t || "", e.running ? "" : "!!", et(e), e.current_state.state_name) : n("🔝🔝 mach(%s%s^%s), st: %s, ev: %s%s%s", e.running ? "" : "!!", Ze(e), Xe(e), e.current_state.state_name, "", t || "", "")), q(e) &&
|
|
1279
|
+
if (o && (L(1 === C ? n("🔝🔝 %s %s%s %s", t || "", e.running ? "" : "!!", et(e), e.current_state.state_name) : n("🔝🔝 mach(%s%s^%s), st: %s, ev: %s%s%s", e.running ? "" : "!!", Ze(e), Xe(e), e.current_state.state_name, "", t || "", "")), q(e) && tr(r) && Wn(r)), e.gclass.gmt.mt_publish_event) {
|
|
1280
1280
|
let n = e.gclass.gmt.mt_publish_event(e, t, r);
|
|
1281
1281
|
if (n <= 0) return n;
|
|
1282
1282
|
}
|
|
@@ -1288,20 +1288,20 @@
|
|
|
1288
1288
|
if (n < 0) break;
|
|
1289
1289
|
if (!n) continue;
|
|
1290
1290
|
}
|
|
1291
|
-
let u =
|
|
1291
|
+
let u = Nr(e, a, "subscriber", null, Zt.KW_REQUIRED);
|
|
1292
1292
|
if (!u || ot(u)) continue;
|
|
1293
|
-
let c =
|
|
1294
|
-
if (
|
|
1295
|
-
|
|
1296
|
-
let l =
|
|
1297
|
-
|
|
1293
|
+
let c = Sr(e, a, "subs_flag", 0, Zt.KW_REQUIRED), f = wr(e, a, "event", "", Zt.KW_REQUIRED);
|
|
1294
|
+
if (fr(f) || 0 === br(f, t)) {
|
|
1295
|
+
$r(e, a, "__config__", null, 0);
|
|
1296
|
+
let l = $r(e, a, "__global__", null, 0), s = $r(e, a, "__local__", null, 0), f = Rr(e, a, "__filter__", null, 0), g = a.renamed_event;
|
|
1297
|
+
fr(g) && (g = t);
|
|
1298
1298
|
let d = 1;
|
|
1299
|
-
if (e.gclass.gmt.mt_publication_filter ? d = e.gclass.gmt.mt_publication_filter(e, t, r, u) :
|
|
1299
|
+
if (e.gclass.gmt.mt_publication_filter ? d = e.gclass.gmt.mt_publication_filter(e, t, r, u) : rr(f) > 0 && (d = Ir(r, f) ? 1 : 0, o && (L(n("💜💜🔄%s publishing with filter, event '%s', subscriber'%s', publisher %s", d ? "👍" : "👎", t || "", et(u), et(e))), Nn(f))), d < 0) break;
|
|
1300
1300
|
if (!d) continue;
|
|
1301
1301
|
let b = At(u, t, !0);
|
|
1302
1302
|
if (b && b.event_flag & R.EVF_SYSTEM_EVENT && !It(u, b.event_name, 0)) continue;
|
|
1303
1303
|
let p = r;
|
|
1304
|
-
(
|
|
1304
|
+
(rr(s) > 0 || rr(l) > 0) && (p = Yn({}, r)), rr(s) > 0 && mr(p, s), rr(l) > 0 && Yn(p, xn(l)), o && (L(1 === C ? n("🔝🔄 %s (%s) %s%s", t || "", g || "", u.running ? "" : "!!", et(u)) : n("🔝🔄 mach(%s%s), st: %s, ev: %s (%s), from(%s%s)", u.running ? "" : "!!", et(u), kt(u), t || "", g || "", e && !e.running ? "!!" : "", et(e))), q(e) && tr(p) && Wn(p));
|
|
1305
1305
|
let m = Vt(u, g, p, e);
|
|
1306
1306
|
if (m < 0 && c & Gt.__own_event__) {
|
|
1307
1307
|
i = -1;
|
|
@@ -1310,7 +1310,7 @@
|
|
|
1310
1310
|
if (_ += m, i++, ot(e)) break;
|
|
1311
1311
|
}
|
|
1312
1312
|
}
|
|
1313
|
-
return i || l && l.event_flag & R.EVF_NO_WARN_SUBS ||
|
|
1313
|
+
return i || l && l.event_flag & R.EVF_NO_WARN_SUBS || On(`${et(e)}: Publish event WITHOUT subscribers, ev ${t}`), _;
|
|
1314
1314
|
}
|
|
1315
1315
|
var Zt = Object.freeze({
|
|
1316
1316
|
KW_REQUIRED: 1,
|
|
@@ -1418,41 +1418,46 @@
|
|
|
1418
1418
|
} else n = t.map((e) => "object" == typeof e ? pn(e) : mn(e)).join(" ");
|
|
1419
1419
|
return n;
|
|
1420
1420
|
}
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1421
|
+
function En(e, ...t) {
|
|
1422
|
+
try {
|
|
1423
|
+
e(...t);
|
|
1424
|
+
} catch (e) {
|
|
1425
1425
|
try {
|
|
1426
|
-
e
|
|
1427
|
-
} catch (e) {
|
|
1428
|
-
try {
|
|
1429
|
-
en.error("a log function threw:", e);
|
|
1430
|
-
} catch (e) {}
|
|
1431
|
-
} finally {
|
|
1432
|
-
En = !1;
|
|
1433
|
-
}
|
|
1426
|
+
en.error("a log function threw:", e);
|
|
1427
|
+
} catch (e) {}
|
|
1434
1428
|
}
|
|
1435
1429
|
}
|
|
1430
|
+
var Tn = !1;
|
|
1436
1431
|
function vn(e, ...t) {
|
|
1437
|
-
|
|
1438
|
-
|
|
1432
|
+
if (!Tn) {
|
|
1433
|
+
Tn = !0;
|
|
1434
|
+
try {
|
|
1435
|
+
En(e, ...t);
|
|
1436
|
+
} finally {
|
|
1437
|
+
Tn = !1;
|
|
1438
|
+
}
|
|
1439
|
+
}
|
|
1439
1440
|
}
|
|
1440
1441
|
function jn(e, ...t) {
|
|
1441
|
-
let n = yn(e, ...t), r =
|
|
1442
|
-
|
|
1442
|
+
let n = yn(e, ...t), r = ol();
|
|
1443
|
+
tn && (tn === en.error ? cn("error", n) && En(tn, "%c" + r + " ERROR: " + String(n), "color:red") : (cn("error", n) && en.error("%c" + r + " ERROR: " + String(n), "color:red"), vn(tn, `${r} ERROR: ${String(n)}`))), gn("error", n, r);
|
|
1443
1444
|
}
|
|
1444
1445
|
function On(e, ...t) {
|
|
1445
|
-
let n = yn(e, ...t), r =
|
|
1446
|
-
|
|
1446
|
+
let n = yn(e, ...t), r = ol();
|
|
1447
|
+
nn && (nn === en.warn ? cn("warning", n) && En(nn, "%c" + r + " WARNING: " + String(n), "color:yellow") : (cn("warning", n) && en.warn("%c" + r + " WARNING: " + String(n), "color:yellow"), vn(nn, `${r} WARNING: ${String(n)}`))), gn("warning", n, r);
|
|
1447
1448
|
}
|
|
1448
1449
|
function Sn(e, ...t) {
|
|
1449
|
-
let n = yn(e, ...t), r =
|
|
1450
|
-
ln && cn("
|
|
1450
|
+
let n = yn(e, ...t), r = ol();
|
|
1451
|
+
ln && cn("debug", n) && En(ln, "%c" + r + " DEBUG: " + String(n), "color:silver"), gn("debug", n, r);
|
|
1452
|
+
}
|
|
1453
|
+
function wn(e, ...t) {
|
|
1454
|
+
let n = yn(e, ...t), r = ol();
|
|
1455
|
+
ln && cn("msg", n) && En(ln, "%c" + r + " MSG: " + String(n), "color:cyan"), gn("msg", n, r);
|
|
1451
1456
|
}
|
|
1452
|
-
function
|
|
1453
|
-
cn("json", t) && (t &&
|
|
1457
|
+
function Nn(e, t) {
|
|
1458
|
+
cn("json", t) && (t && En(en.warn, "=====> " + mn(t)), En(en.dir, e)), gn("json", e, ol());
|
|
1454
1459
|
}
|
|
1455
|
-
var
|
|
1460
|
+
var $n = [
|
|
1456
1461
|
"passw",
|
|
1457
1462
|
"pwd",
|
|
1458
1463
|
"passphrase",
|
|
@@ -1464,12 +1469,12 @@
|
|
|
1464
1469
|
"cookie",
|
|
1465
1470
|
"credential",
|
|
1466
1471
|
"salt"
|
|
1467
|
-
],
|
|
1472
|
+
], Rn = [
|
|
1468
1473
|
"apikey",
|
|
1469
1474
|
"sessionid",
|
|
1470
1475
|
"sessionkey",
|
|
1471
1476
|
"authdata"
|
|
1472
|
-
],
|
|
1477
|
+
], Dn = /* @__PURE__ */ new Set([
|
|
1473
1478
|
"endpoint",
|
|
1474
1479
|
"url",
|
|
1475
1480
|
"uri",
|
|
@@ -1493,25 +1498,25 @@
|
|
|
1493
1498
|
"expires",
|
|
1494
1499
|
"mode"
|
|
1495
1500
|
]);
|
|
1496
|
-
function
|
|
1501
|
+
function kn(e) {
|
|
1497
1502
|
if ("string" != typeof e || e.length < 3) return !1;
|
|
1498
1503
|
let t = e.toLowerCase(), n = !1;
|
|
1499
|
-
for (const e of
|
|
1504
|
+
for (const e of $n) if (t.indexOf(e) >= 0) {
|
|
1500
1505
|
n = !0;
|
|
1501
1506
|
break;
|
|
1502
1507
|
}
|
|
1503
1508
|
if (!n) {
|
|
1504
1509
|
let e = t.replace(/[_\-. \t]/g, "");
|
|
1505
|
-
for (const t of
|
|
1510
|
+
for (const t of Rn) if (e.indexOf(t) >= 0) {
|
|
1506
1511
|
n = !0;
|
|
1507
1512
|
break;
|
|
1508
1513
|
}
|
|
1509
1514
|
}
|
|
1510
1515
|
if (n || (n = t.indexOf("priv") >= 0 && t.indexOf("key") >= 0), !n) return !1;
|
|
1511
|
-
for (const e of t.split(/[_\-. \t]/)) if (
|
|
1516
|
+
for (const e of t.split(/[_\-. \t]/)) if (Dn.has(e)) return !1;
|
|
1512
1517
|
return !0;
|
|
1513
1518
|
}
|
|
1514
|
-
function
|
|
1519
|
+
function An(e, t, n) {
|
|
1515
1520
|
const r = (e) => " " === e || " " === e, l = (t) => n && e[t] === n && (t + 1 >= e.length || r(e[t + 1]));
|
|
1516
1521
|
let o = t;
|
|
1517
1522
|
for (;;) {
|
|
@@ -1527,12 +1532,12 @@
|
|
|
1527
1532
|
o = t;
|
|
1528
1533
|
}
|
|
1529
1534
|
}
|
|
1530
|
-
var
|
|
1531
|
-
function
|
|
1535
|
+
var In = 128, Cn = 4194304, Ln = "<not shown: too large to mask>";
|
|
1536
|
+
function Pn(e) {
|
|
1532
1537
|
if ("string" != typeof e || e.indexOf("=") < 0) return null;
|
|
1533
|
-
if (e.length >
|
|
1538
|
+
if (e.length > Cn) return Ln;
|
|
1534
1539
|
let t, n = !1, r = /(^|[ \t])attribute=["']?([^ \t"']*)/g;
|
|
1535
|
-
for (; null !== (t = r.exec(e));)
|
|
1540
|
+
for (; null !== (t = r.exec(e));) kn(t[2].slice(-128)) && (n = !0);
|
|
1536
1541
|
let l = [], o = 0, s = !1, i = "", _ = 0, a = 0;
|
|
1537
1542
|
const u = (t) => t >= e.length || " " === e[t] || " " === e[t];
|
|
1538
1543
|
for (; a < e.length;) {
|
|
@@ -1545,8 +1550,8 @@
|
|
|
1545
1550
|
a++;
|
|
1546
1551
|
continue;
|
|
1547
1552
|
}
|
|
1548
|
-
let r = e.substring(Math.max(_, a -
|
|
1549
|
-
if (_ = a + 1, !(
|
|
1553
|
+
let r = e.substring(Math.max(_, a - In), a);
|
|
1554
|
+
if (_ = a + 1, !(kn(r) || n && "value" === r.toLowerCase())) {
|
|
1550
1555
|
a++;
|
|
1551
1556
|
continue;
|
|
1552
1557
|
}
|
|
@@ -1555,18 +1560,18 @@
|
|
|
1555
1560
|
if (f) {
|
|
1556
1561
|
for (c = a + 1; c < e.length && e[c] !== f;) c++;
|
|
1557
1562
|
e[c] === f && c++;
|
|
1558
|
-
} else c =
|
|
1563
|
+
} else c = An(e, a, i);
|
|
1559
1564
|
c > a && (l.push(e.substring(o, a)), l.push("********"), o = c, s = !0), a = c, _ = a;
|
|
1560
1565
|
}
|
|
1561
1566
|
return s ? (l.push(e.substring(o)), l.join("")) : null;
|
|
1562
1567
|
}
|
|
1563
|
-
var
|
|
1564
|
-
var
|
|
1565
|
-
function
|
|
1568
|
+
var Un = 64, Fn = "<not shown: the masking failed>";
|
|
1569
|
+
var Vn = Symbol("mask-in-progress");
|
|
1570
|
+
function Gn(e, t, n, r) {
|
|
1566
1571
|
if ("string" == typeof e) {
|
|
1567
|
-
if (e.length > r.left) return r.left = 0,
|
|
1572
|
+
if (e.length > r.left) return r.left = 0, Ln;
|
|
1568
1573
|
r.left -= e.length;
|
|
1569
|
-
let t =
|
|
1574
|
+
let t = Pn(e);
|
|
1570
1575
|
return null !== t ? t : e;
|
|
1571
1576
|
}
|
|
1572
1577
|
let l = Array.isArray(e);
|
|
@@ -1575,13 +1580,13 @@
|
|
|
1575
1580
|
let t = Object.getPrototypeOf(e);
|
|
1576
1581
|
return t === Object.prototype || null === t;
|
|
1577
1582
|
}(e)) return e;
|
|
1578
|
-
if (r.left <= 0) return
|
|
1583
|
+
if (r.left <= 0) return Ln;
|
|
1579
1584
|
if (t.has(e)) {
|
|
1580
1585
|
let n = t.get(e);
|
|
1581
|
-
return n ===
|
|
1586
|
+
return n === Vn ? "<cycle>" : n;
|
|
1582
1587
|
}
|
|
1583
|
-
if (n >=
|
|
1584
|
-
r.left -= 1, t.set(e,
|
|
1588
|
+
if (n >= Un) return "<deeper not shown>";
|
|
1589
|
+
r.left -= 1, t.set(e, Vn);
|
|
1585
1590
|
let o, s = !1, i = !1;
|
|
1586
1591
|
if (l) {
|
|
1587
1592
|
o = [];
|
|
@@ -1591,13 +1596,13 @@
|
|
|
1591
1596
|
break;
|
|
1592
1597
|
}
|
|
1593
1598
|
r.left -= 1;
|
|
1594
|
-
let _ =
|
|
1599
|
+
let _ = Gn(e[l], t, n + 1, r);
|
|
1595
1600
|
_ !== e[l] && (s = !0), o.push(_);
|
|
1596
1601
|
}
|
|
1597
|
-
i && o.push(
|
|
1602
|
+
i && o.push(Ln);
|
|
1598
1603
|
} else {
|
|
1599
1604
|
o = Object.create(Object.getPrototypeOf(e));
|
|
1600
|
-
let l = "string" == typeof e.attribute &&
|
|
1605
|
+
let l = "string" == typeof e.attribute && kn(e.attribute.slice(-128));
|
|
1601
1606
|
for (const _ in e) {
|
|
1602
1607
|
if (!Object.prototype.hasOwnProperty.call(e, _)) continue;
|
|
1603
1608
|
if (r.left <= 0) {
|
|
@@ -1606,33 +1611,33 @@
|
|
|
1606
1611
|
}
|
|
1607
1612
|
r.left -= 1 + _.length;
|
|
1608
1613
|
let a, u = e[_];
|
|
1609
|
-
a = (
|
|
1614
|
+
a = (kn(_.slice(-128)) || l && "value" === _) && null != u && "" !== u ? "********" : Gn(u, t, n + 1, r), a !== u && (s = !0), Er(o, _, a);
|
|
1610
1615
|
}
|
|
1611
|
-
i && (o["<more>"] =
|
|
1616
|
+
i && (o["<more>"] = Ln);
|
|
1612
1617
|
}
|
|
1613
1618
|
return s || i || (o = e), t.set(e, o), o;
|
|
1614
1619
|
}
|
|
1615
|
-
function
|
|
1620
|
+
function Mn(e) {
|
|
1616
1621
|
try {
|
|
1617
|
-
return
|
|
1622
|
+
return Gn(e, /* @__PURE__ */ new WeakMap(), 0, { left: Cn });
|
|
1618
1623
|
} catch (e) {
|
|
1619
|
-
return
|
|
1624
|
+
return Fn;
|
|
1620
1625
|
}
|
|
1621
1626
|
}
|
|
1622
|
-
function
|
|
1623
|
-
|
|
1627
|
+
function Wn(e, t) {
|
|
1628
|
+
Nn(Mn(e), t);
|
|
1624
1629
|
}
|
|
1625
|
-
function
|
|
1630
|
+
function xn(e) {
|
|
1626
1631
|
return structuredClone(e);
|
|
1627
1632
|
}
|
|
1628
|
-
function
|
|
1633
|
+
function Kn(e, t) {
|
|
1629
1634
|
if (e === t) return !0;
|
|
1630
1635
|
if (null === e || null === t) return e === t;
|
|
1631
1636
|
if (typeof e != typeof t) return !1;
|
|
1632
1637
|
if (Array.isArray(e) !== Array.isArray(t)) return !1;
|
|
1633
1638
|
if (Array.isArray(e)) {
|
|
1634
1639
|
if (e.length !== t.length) return !1;
|
|
1635
|
-
for (let n = 0; n < e.length; n++) if (!
|
|
1640
|
+
for (let n = 0; n < e.length; n++) if (!Kn(e[n], t[n])) return !1;
|
|
1636
1641
|
return !0;
|
|
1637
1642
|
}
|
|
1638
1643
|
if ("object" == typeof e) {
|
|
@@ -1640,118 +1645,118 @@
|
|
|
1640
1645
|
if (n.length !== r.length) return !1;
|
|
1641
1646
|
for (let l = 0; l < n.length; l++) {
|
|
1642
1647
|
if (n[l] !== r[l]) return !1;
|
|
1643
|
-
if (!
|
|
1648
|
+
if (!Kn(e[n[l]], t[r[l]])) return !1;
|
|
1644
1649
|
}
|
|
1645
1650
|
return !0;
|
|
1646
1651
|
}
|
|
1647
1652
|
return e === t;
|
|
1648
1653
|
}
|
|
1649
|
-
function Kn(e, t) {
|
|
1650
|
-
if (!t) return e;
|
|
1651
|
-
for (let n of Object.keys(t)) yr(e, n, t[n]);
|
|
1652
|
-
return e;
|
|
1653
|
-
}
|
|
1654
1654
|
function Yn(e, t) {
|
|
1655
1655
|
if (!t) return e;
|
|
1656
|
-
for (let n
|
|
1656
|
+
for (let n of Object.keys(t)) Er(e, n, t[n]);
|
|
1657
1657
|
return e;
|
|
1658
1658
|
}
|
|
1659
1659
|
function Bn(e, t) {
|
|
1660
1660
|
if (!t) return e;
|
|
1661
|
-
for (let n in t) Object.prototype.hasOwnProperty.call(t, n) &&
|
|
1661
|
+
for (let n in t) Object.prototype.hasOwnProperty.call(t, n) && Object.prototype.hasOwnProperty.call(e, n) && Er(e, n, t[n]);
|
|
1662
1662
|
return e;
|
|
1663
1663
|
}
|
|
1664
1664
|
function Jn(e, t) {
|
|
1665
|
-
if (
|
|
1665
|
+
if (!t) return e;
|
|
1666
|
+
for (let n in t) Object.prototype.hasOwnProperty.call(t, n) && !Object.prototype.hasOwnProperty.call(e, n) && Er(e, n, t[n]);
|
|
1667
|
+
return e;
|
|
1666
1668
|
}
|
|
1667
1669
|
function qn(e, t) {
|
|
1668
|
-
e && Object.prototype.hasOwnProperty.call(e, t)
|
|
1670
|
+
if (e && Object.prototype.hasOwnProperty.call(e, t)) return e[t];
|
|
1669
1671
|
}
|
|
1670
|
-
function Hn(e, t
|
|
1671
|
-
|
|
1672
|
+
function Hn(e, t) {
|
|
1673
|
+
e && Object.prototype.hasOwnProperty.call(e, t) && delete e[t];
|
|
1672
1674
|
}
|
|
1673
1675
|
function zn(e, t, n) {
|
|
1674
|
-
|
|
1676
|
+
Er(e, t, n);
|
|
1675
1677
|
}
|
|
1676
|
-
function Qn(e, t) {
|
|
1677
|
-
e
|
|
1678
|
+
function Qn(e, t, n) {
|
|
1679
|
+
Er(e, t, n);
|
|
1678
1680
|
}
|
|
1679
1681
|
function Xn(e, t) {
|
|
1680
1682
|
e.push(t);
|
|
1681
1683
|
}
|
|
1682
1684
|
function Zn(e, t) {
|
|
1683
|
-
e.
|
|
1685
|
+
e.push(t);
|
|
1684
1686
|
}
|
|
1685
|
-
function er(e) {
|
|
1686
|
-
|
|
1687
|
+
function er(e, t) {
|
|
1688
|
+
e.splice(t, 1);
|
|
1687
1689
|
}
|
|
1688
1690
|
function tr(e) {
|
|
1689
|
-
return lr(e) ? e.length : 0;
|
|
1691
|
+
return lr(e) ? Object.keys(e).length : 0;
|
|
1690
1692
|
}
|
|
1691
1693
|
function nr(e) {
|
|
1692
|
-
return
|
|
1694
|
+
return or(e) ? e.length : 0;
|
|
1693
1695
|
}
|
|
1694
1696
|
function rr(e) {
|
|
1695
|
-
return
|
|
1697
|
+
return lr(e) ? Object.keys(e).length : or(e) ? e.length : sr(e) && e.length > 0 ? 1 : 0;
|
|
1696
1698
|
}
|
|
1697
1699
|
function lr(e) {
|
|
1698
|
-
return Array.isArray(e);
|
|
1700
|
+
return null !== e && "object" == typeof e && !Array.isArray(e);
|
|
1699
1701
|
}
|
|
1700
1702
|
function or(e) {
|
|
1701
|
-
return
|
|
1703
|
+
return Array.isArray(e);
|
|
1702
1704
|
}
|
|
1703
1705
|
function sr(e) {
|
|
1704
|
-
return "
|
|
1706
|
+
return "string" == typeof e;
|
|
1705
1707
|
}
|
|
1706
1708
|
function ir(e) {
|
|
1707
|
-
return "
|
|
1709
|
+
return "number" == typeof e && Number.isFinite(e);
|
|
1708
1710
|
}
|
|
1709
1711
|
function _r(e) {
|
|
1710
|
-
return
|
|
1712
|
+
return "boolean" == typeof e;
|
|
1711
1713
|
}
|
|
1712
1714
|
function ar(e) {
|
|
1713
|
-
return
|
|
1715
|
+
return null == e;
|
|
1714
1716
|
}
|
|
1715
1717
|
function ur(e) {
|
|
1716
|
-
return
|
|
1718
|
+
return "function" == typeof e;
|
|
1717
1719
|
}
|
|
1718
1720
|
function cr(e) {
|
|
1719
|
-
return
|
|
1721
|
+
return e instanceof S;
|
|
1720
1722
|
}
|
|
1721
1723
|
function fr(e) {
|
|
1722
|
-
return sr(e)
|
|
1724
|
+
return !sr(e) || 0 === e.length;
|
|
1723
1725
|
}
|
|
1724
|
-
function gr(e
|
|
1725
|
-
return e
|
|
1726
|
+
function gr(e) {
|
|
1727
|
+
return ir(e) ? Boolean(e) : /^\s*(true|1|on)\s*$/i.test(e);
|
|
1726
1728
|
}
|
|
1727
1729
|
function dr(e, t) {
|
|
1730
|
+
return e === t ? 0 : e > t ? 1 : -1;
|
|
1731
|
+
}
|
|
1732
|
+
function br(e, t) {
|
|
1728
1733
|
let n = e.toLowerCase(), r = t.toLowerCase();
|
|
1729
1734
|
return n === r ? 0 : n > r ? 1 : -1;
|
|
1730
1735
|
}
|
|
1731
|
-
function
|
|
1732
|
-
if (
|
|
1733
|
-
if (
|
|
1736
|
+
function pr(e, t) {
|
|
1737
|
+
if (lr(e) || lr(t) || or(e) || or(t)) return 0;
|
|
1738
|
+
if (ir(e) || ir(t)) {
|
|
1734
1739
|
let n = Number(e), r = Number(t);
|
|
1735
1740
|
return Number.isNaN(n) && (n = 0), Number.isNaN(r) && (r = 0), n > r ? 1 : n < r ? -1 : 0;
|
|
1736
1741
|
}
|
|
1737
|
-
if (
|
|
1742
|
+
if (_r(e) || _r(t)) {
|
|
1738
1743
|
let n = Number(e), r = Number(t);
|
|
1739
1744
|
return n > r ? 1 : n < r ? -1 : 0;
|
|
1740
1745
|
}
|
|
1741
|
-
return
|
|
1746
|
+
return dr(String(e), String(t));
|
|
1742
1747
|
}
|
|
1743
|
-
function
|
|
1744
|
-
if ("object" != typeof t || Array.isArray(t)) if (Array.isArray(t)) for (const n of t)
|
|
1748
|
+
function mr(e, t) {
|
|
1749
|
+
if ("object" != typeof t || Array.isArray(t)) if (Array.isArray(t)) for (const n of t) mr(e, n);
|
|
1745
1750
|
else "string" == typeof t && delete e[t];
|
|
1746
1751
|
else for (const n of Object.keys(t)) delete e[n];
|
|
1747
1752
|
}
|
|
1748
|
-
function
|
|
1753
|
+
function hr(e, t) {
|
|
1749
1754
|
return !(!(t in e) || !Object.prototype.hasOwnProperty.call(e, t));
|
|
1750
1755
|
}
|
|
1751
|
-
function
|
|
1756
|
+
function yr(e, t) {
|
|
1752
1757
|
return !Object.prototype.hasOwnProperty.call(e, t);
|
|
1753
1758
|
}
|
|
1754
|
-
function
|
|
1759
|
+
function Er(e, t, n) {
|
|
1755
1760
|
"__proto__" === t ? Object.defineProperty(e, t, {
|
|
1756
1761
|
value: n,
|
|
1757
1762
|
writable: !0,
|
|
@@ -1759,205 +1764,205 @@
|
|
|
1759
1764
|
configurable: !0
|
|
1760
1765
|
}) : e[t] = n;
|
|
1761
1766
|
}
|
|
1762
|
-
function
|
|
1767
|
+
function Tr(e, t) {
|
|
1763
1768
|
if (!/^[0-9]+$/.test(t)) return -1;
|
|
1764
1769
|
const n = Number(t);
|
|
1765
1770
|
return n >= e.length ? -1 : n;
|
|
1766
1771
|
}
|
|
1767
|
-
function
|
|
1768
|
-
e && !
|
|
1772
|
+
function vr(e, t, n, r) {
|
|
1773
|
+
e && !cr(e) && jn("GObj bad instanceof");
|
|
1769
1774
|
const l = e ? `${et(e)}: ` : "";
|
|
1770
|
-
if (!
|
|
1771
|
-
if (!
|
|
1775
|
+
if (!lr(t) && !or(t)) return void jn(`${l}kw must be list or dict: '${String(n)}'`);
|
|
1776
|
+
if (!sr(n)) return void jn(`${l}path must be a string: ${String(n)}`);
|
|
1772
1777
|
let o = n.split("`"), s = o.length;
|
|
1773
1778
|
for (let e = 0; e < s; e++) {
|
|
1774
|
-
if (
|
|
1775
|
-
const s =
|
|
1776
|
-
if (s < 0) return void (r &&
|
|
1779
|
+
if (or(t)) {
|
|
1780
|
+
const s = Tr(t, o[e]);
|
|
1781
|
+
if (s < 0) return void (r && jn(`${l}path not found: '${n}'`));
|
|
1777
1782
|
o[e] = String(s);
|
|
1778
1783
|
}
|
|
1779
|
-
if (
|
|
1784
|
+
if (yr(t, o[e])) return void (r && jn(`${l}path not found: '${n}'`));
|
|
1780
1785
|
if (e === s - 1) break;
|
|
1781
|
-
if (null == (t = t[o[e]])) return void (r &&
|
|
1782
|
-
if (!
|
|
1786
|
+
if (null == (t = t[o[e]])) return void (r && jn(`${l}path not found: '${n}'`));
|
|
1787
|
+
if (!lr(t) && !or(t)) return void jn(`${l}kw must be list or dict: '${n}'`);
|
|
1783
1788
|
}
|
|
1784
1789
|
let i = t[o[s - 1]];
|
|
1785
|
-
return void 0 === i && r &&
|
|
1790
|
+
return void 0 === i && r && jn(`${l}path not found: '${n}'`), i;
|
|
1786
1791
|
}
|
|
1787
|
-
function
|
|
1788
|
-
e && !
|
|
1792
|
+
function jr(e, t, n) {
|
|
1793
|
+
e && !cr(e) && jn("GObj bad instanceof");
|
|
1789
1794
|
const r = e ? et(e) + ": " : "";
|
|
1790
|
-
if (!
|
|
1795
|
+
if (!sr(n)) return jn(`${r}kw_delete(): path must be a string: ${String(n)}`), -1;
|
|
1791
1796
|
let [l, o] = function(e, t) {
|
|
1792
1797
|
let n = e.lastIndexOf(t);
|
|
1793
1798
|
return -1 === n ? [e, ""] : [e.substring(0, n), e.substring(n + 1)];
|
|
1794
1799
|
}(n, "`"), s = t;
|
|
1795
|
-
if (
|
|
1796
|
-
else if (s =
|
|
1797
|
-
return
|
|
1800
|
+
if (fr(o)) o = n;
|
|
1801
|
+
else if (s = vr(e, t, l, !0), void 0 === s) return -1;
|
|
1802
|
+
return or(s) ? (jn(`${r}kw_delete(): cannot delete an item of a list: '${n}'`), -1) : lr(s) && Object.prototype.hasOwnProperty.call(s, o) ? (delete s[o], 0) : (jn(`${r}kw_delete(): path not found: '${n}'`), -1);
|
|
1798
1803
|
}
|
|
1799
|
-
function
|
|
1800
|
-
e && !
|
|
1801
|
-
let o =
|
|
1804
|
+
function Or(e, t, n, r, l) {
|
|
1805
|
+
e && !cr(e) && jn("GObj bad instanceof");
|
|
1806
|
+
let o = vr(e, t, n, !1);
|
|
1802
1807
|
const s = l && l & Zt.KW_REQUIRED, i = l && l & Zt.KW_CREATE, _ = l && l & Zt.KW_EXTRACT, a = l && l & Zt.KW_WILD_NUMBER;
|
|
1803
1808
|
if (void 0 === o) {
|
|
1804
1809
|
if (i && t) {
|
|
1805
1810
|
let l = Boolean(r);
|
|
1806
|
-
return
|
|
1811
|
+
return Dr(e, t, n, l), l;
|
|
1807
1812
|
}
|
|
1808
|
-
return s && (
|
|
1813
|
+
return s && (jn(`path not found: '${n}'`), Wn(t)), Boolean(r);
|
|
1809
1814
|
}
|
|
1810
1815
|
let u;
|
|
1811
|
-
if (
|
|
1812
|
-
else if (a &&
|
|
1813
|
-
else if (a &&
|
|
1816
|
+
if (_r(o)) u = o;
|
|
1817
|
+
else if (a && ir(o)) u = 0 !== o;
|
|
1818
|
+
else if (a && sr(o)) u = "true" === o.toLowerCase() || "false" !== o.toLowerCase() && 0 !== (parseInt(o, 10) || 0);
|
|
1814
1819
|
else {
|
|
1815
|
-
if (!a || null !== o) return a ? (
|
|
1820
|
+
if (!a || null !== o) return a ? (jn(`${e ? et(e) + ": " : ""}path MUST BE a simple json element: '${n}'`), Wn(t), !1) : (jn(`${e ? et(e) + ": " : ""}path MUST BE a json boolean: '${n}'`), Wn(t), Boolean(r));
|
|
1816
1821
|
u = !1;
|
|
1817
1822
|
}
|
|
1818
|
-
return _ &&
|
|
1823
|
+
return _ && jr(e, t, n), u;
|
|
1819
1824
|
}
|
|
1820
|
-
function
|
|
1821
|
-
e && !
|
|
1822
|
-
let o =
|
|
1825
|
+
function Sr(e, t, n, r, l) {
|
|
1826
|
+
e && !cr(e) && jn("GObj bad instanceof");
|
|
1827
|
+
let o = vr(e, t, n, !1);
|
|
1823
1828
|
const s = l && l & Zt.KW_REQUIRED, i = l && l & Zt.KW_CREATE, _ = l && l & Zt.KW_EXTRACT, a = l && l & Zt.KW_WILD_NUMBER;
|
|
1824
1829
|
if (void 0 === o) {
|
|
1825
1830
|
if (i && t) {
|
|
1826
1831
|
let l = parseInt(r);
|
|
1827
|
-
return
|
|
1832
|
+
return Dr(e, t, n, l), l;
|
|
1828
1833
|
}
|
|
1829
|
-
return s && (
|
|
1834
|
+
return s && (jn(`path not found: '${n}'`), Wn(t)), parseInt(r);
|
|
1830
1835
|
}
|
|
1831
1836
|
let u;
|
|
1832
|
-
if (
|
|
1837
|
+
if (ir(o)) u = Math.trunc(o);
|
|
1833
1838
|
else {
|
|
1834
|
-
if (!a) return
|
|
1835
|
-
if (
|
|
1836
|
-
else if (
|
|
1839
|
+
if (!a) return jn(`${e ? et(e) + ": " : ""}path MUST BE a json integer: '${n}'`), Wn(t), parseInt(r);
|
|
1840
|
+
if (_r(o)) u = o ? 1 : 0;
|
|
1841
|
+
else if (sr(o)) u = function(e) {
|
|
1837
1842
|
const t = /^\s*([+-]?)(0[xX][0-9a-fA-F]+|0[0-7]*|[1-9][0-9]*)/.exec(e);
|
|
1838
1843
|
if (!t) return 0;
|
|
1839
1844
|
let n, r = t[2];
|
|
1840
1845
|
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;
|
|
1841
1846
|
}(o);
|
|
1842
1847
|
else {
|
|
1843
|
-
if (null !== o) return
|
|
1848
|
+
if (null !== o) return jn(`${e ? et(e) + ": " : ""}path MUST BE a simple json element: '${n}'`), Wn(t), 0;
|
|
1844
1849
|
u = 0;
|
|
1845
1850
|
}
|
|
1846
1851
|
}
|
|
1847
|
-
return _ &&
|
|
1852
|
+
return _ && jr(e, t, n), u;
|
|
1848
1853
|
}
|
|
1849
|
-
function
|
|
1850
|
-
e && !
|
|
1851
|
-
let o =
|
|
1854
|
+
function wr(e, t, n, r, l) {
|
|
1855
|
+
e && !cr(e) && jn("GObj bad instanceof");
|
|
1856
|
+
let o = vr(e, t, n, !1);
|
|
1852
1857
|
const s = l && l & Zt.KW_REQUIRED, i = l && l & Zt.KW_CREATE, _ = l && l & Zt.KW_EXTRACT;
|
|
1853
|
-
return void 0 === o ? i && t ? (
|
|
1854
|
-
let n =
|
|
1858
|
+
return void 0 === o ? i && t ? (Dr(e, t, n, sr(r) ? r : null), r) : (s && !function(e, t) {
|
|
1859
|
+
let n = sr(t) ? t.split("`") : [], r = e;
|
|
1855
1860
|
for (let e = 0; e < n.length - 1; e++) {
|
|
1856
|
-
if (!
|
|
1861
|
+
if (!lr(r) && !or(r)) return !1;
|
|
1857
1862
|
r = r[n[e]];
|
|
1858
1863
|
}
|
|
1859
|
-
return !(!
|
|
1860
|
-
}(t, n) && (
|
|
1864
|
+
return !(!lr(r) && !or(r) || 0 === n.length) && Object.prototype.hasOwnProperty.call(r, n[n.length - 1]);
|
|
1865
|
+
}(t, n) && (jn(`path not found: '${n}'`), Wn(t)), r) : sr(o) ? (_ && jr(e, t, n), o) : (null !== o && (jn(`${e ? et(e) + ": " : ""}path MUST BE a json str: '${n}'`), Wn(t)), r);
|
|
1861
1866
|
}
|
|
1862
|
-
function
|
|
1863
|
-
e && !
|
|
1864
|
-
let o =
|
|
1867
|
+
function Nr(e, t, n, r, l) {
|
|
1868
|
+
e && !cr(e) && jn("GObj bad instanceof");
|
|
1869
|
+
let o = vr(e, t, n, !1);
|
|
1865
1870
|
const s = l && l & Zt.KW_REQUIRED, i = l && l & Zt.KW_CREATE, _ = l && l & Zt.KW_EXTRACT;
|
|
1866
1871
|
if (void 0 === o) {
|
|
1867
1872
|
if (i) {
|
|
1868
1873
|
let l = r;
|
|
1869
|
-
return
|
|
1874
|
+
return Dr(e, t, n, l), l;
|
|
1870
1875
|
}
|
|
1871
|
-
return s && (
|
|
1876
|
+
return s && (jn(`path not found: '${n}'`), Wn(t)), r;
|
|
1872
1877
|
}
|
|
1873
|
-
return _ &&
|
|
1878
|
+
return _ && jr(e, t, n), o;
|
|
1874
1879
|
}
|
|
1875
|
-
function
|
|
1876
|
-
e && !
|
|
1877
|
-
let o =
|
|
1880
|
+
function $r(e, t, n, r, l) {
|
|
1881
|
+
e && !cr(e) && jn("GObj bad instanceof");
|
|
1882
|
+
let o = vr(e, t, n, !1);
|
|
1878
1883
|
const s = l && l & Zt.KW_REQUIRED, i = l && l & Zt.KW_CREATE, _ = l && l & Zt.KW_EXTRACT;
|
|
1879
|
-
return void 0 === o ? i &&
|
|
1884
|
+
return void 0 === o ? i && lr(r) && t ? (Dr(e, t, n, r), r) : (s && (jn(`path not found: '${n}'`), Wn(t)), r) : lr(o) ? (_ && jr(e, t, n), o) : i && null === o && lr(r) ? (Dr(e, t, n, r), r) : i && null === o ? (s && (jn(`path not found: '${n}'`), Wn(t)), r) : ((s || i) && (jn(`${e ? et(e) + ": " : ""}path MUST BE a json dict: '${n}'` + (i ? ", cannot create" : "")), Wn(t)), r);
|
|
1880
1885
|
}
|
|
1881
|
-
function
|
|
1882
|
-
e && !
|
|
1883
|
-
let o =
|
|
1886
|
+
function Rr(e, t, n, r, l) {
|
|
1887
|
+
e && !cr(e) && jn("GObj bad instanceof");
|
|
1888
|
+
let o = vr(e, t, n, !1);
|
|
1884
1889
|
const s = l && l & Zt.KW_REQUIRED, i = l && l & Zt.KW_CREATE, _ = l && l & Zt.KW_EXTRACT;
|
|
1885
1890
|
if (void 0 === o) {
|
|
1886
1891
|
if (i) {
|
|
1887
1892
|
let l = r;
|
|
1888
|
-
return
|
|
1893
|
+
return Dr(e, t, n, l), l;
|
|
1889
1894
|
}
|
|
1890
|
-
return s && (
|
|
1895
|
+
return s && (jn(`path not found: '${n}'`), Wn(t)), r;
|
|
1891
1896
|
}
|
|
1892
|
-
return _ &&
|
|
1897
|
+
return _ && jr(e, t, n), o;
|
|
1893
1898
|
}
|
|
1894
|
-
function
|
|
1895
|
-
if (e && !
|
|
1896
|
-
if (!
|
|
1897
|
-
if ("" === n) return
|
|
1898
|
-
if (n.split("`").includes("")) return
|
|
1899
|
+
function Dr(e, t, n, r) {
|
|
1900
|
+
if (e && !cr(e) && jn("GObj bad instanceof"), !lr(t)) return jn("kw is not an object"), -1;
|
|
1901
|
+
if (!sr(n)) return jn(`${e ? et(e) + ": " : ""}kw_set_dict_value(): path must be a string: ${String(n)}`), -1;
|
|
1902
|
+
if ("" === n) return jn((e ? et(e) + ": " : "") + "kw_set_dict_value(): path empty"), -1;
|
|
1903
|
+
if (n.split("`").includes("")) return jn(`${e ? et(e) + ": " : ""}kw_set_dict_value(): empty segment in path: '${n}'`), -1;
|
|
1899
1904
|
let l = n.split("`"), o = l.length;
|
|
1900
1905
|
for (let s = 0; s < o; s++) {
|
|
1901
1906
|
let i = l[s];
|
|
1902
|
-
if (
|
|
1903
|
-
const r =
|
|
1904
|
-
if (r < 0) return
|
|
1907
|
+
if (or(t)) {
|
|
1908
|
+
const r = Tr(t, i);
|
|
1909
|
+
if (r < 0) return jn(`${e ? et(e) + ": " : ""}kw_set_dict_value(): segment '${i}' is not an index of its list: '${n}'`), -1;
|
|
1905
1910
|
i = String(r);
|
|
1906
1911
|
}
|
|
1907
|
-
if (s === o - 1)
|
|
1912
|
+
if (s === o - 1) Er(t, i, r);
|
|
1908
1913
|
else {
|
|
1909
|
-
let r =
|
|
1910
|
-
if (void 0 === r)
|
|
1911
|
-
else if (!
|
|
1914
|
+
let r = yr(t, i) ? void 0 : t[i];
|
|
1915
|
+
if (void 0 === r) Er(t, i, {});
|
|
1916
|
+
else if (!lr(r) && !or(r)) return jn(`${e ? et(e) + ": " : ""}kw_set_dict_value(): segment '${i}' is not a dict or a list: '${n}'`), -1;
|
|
1912
1917
|
t = t[i];
|
|
1913
1918
|
}
|
|
1914
1919
|
}
|
|
1915
1920
|
return 0;
|
|
1916
1921
|
}
|
|
1917
|
-
function
|
|
1918
|
-
if (e && !
|
|
1919
|
-
let o =
|
|
1922
|
+
function kr(e, t, n, r, l) {
|
|
1923
|
+
if (e && !cr(e) && jn("GObj bad instanceof"), !lr(t)) return jn("kw is not an object"), -1;
|
|
1924
|
+
let o = vr(e, t, n, !1);
|
|
1920
1925
|
if (void 0 === o) {
|
|
1921
|
-
if (!
|
|
1926
|
+
if (!sr(n) || function(e, t) {
|
|
1922
1927
|
let n = t.split("`"), r = e;
|
|
1923
1928
|
for (let e = 0; e < n.length - 1; e++) {
|
|
1924
|
-
if (
|
|
1925
|
-
const t =
|
|
1929
|
+
if (or(r)) {
|
|
1930
|
+
const t = Tr(r, n[e]);
|
|
1926
1931
|
if (t < 0) return !1;
|
|
1927
1932
|
r = r[t];
|
|
1928
1933
|
} else r = Object.prototype.hasOwnProperty.call(r, n[e]) ? r[n[e]] : void 0;
|
|
1929
1934
|
if (null == r) return !1;
|
|
1930
|
-
if (!
|
|
1935
|
+
if (!lr(r) && !or(r)) return !0;
|
|
1931
1936
|
}
|
|
1932
1937
|
return !1;
|
|
1933
1938
|
}(t, n)) return -1;
|
|
1934
|
-
if (o = {},
|
|
1939
|
+
if (o = {}, Dr(e, t, n, o) < 0) return -1;
|
|
1935
1940
|
}
|
|
1936
|
-
return
|
|
1941
|
+
return lr(o) ? (Er(o, r, l), 0) : (jn(`subdict is not an object: '${n}'`), -1);
|
|
1937
1942
|
}
|
|
1938
|
-
function
|
|
1943
|
+
function Ar(e, t, r) {
|
|
1939
1944
|
let l = "", o = !1;
|
|
1940
|
-
if (
|
|
1945
|
+
if (or(t)) {
|
|
1941
1946
|
o = !1;
|
|
1942
1947
|
for (let s = 0; s < t.length; s++) {
|
|
1943
1948
|
let i = t[s];
|
|
1944
|
-
if (l =
|
|
1949
|
+
if (l = fr(r) ? n("%s", r) : n("%s`%d", r, s), o = Ar(e, i, l), o) break;
|
|
1945
1950
|
}
|
|
1946
|
-
} else if (
|
|
1951
|
+
} else if (lr(t)) {
|
|
1947
1952
|
o = !0;
|
|
1948
1953
|
let s = Object.keys(t);
|
|
1949
1954
|
for (let i = 0; i < s.length; i++) {
|
|
1950
1955
|
let _ = s[i], a = t[_];
|
|
1951
|
-
if (l =
|
|
1952
|
-
if (o =
|
|
1956
|
+
if (l = fr(r) ? n("%s", _) : n("%s`%s", r, _), or(a) || lr(a)) {
|
|
1957
|
+
if (o = Ar(e, a, l), !o) break;
|
|
1953
1958
|
continue;
|
|
1954
1959
|
}
|
|
1955
|
-
let u =
|
|
1956
|
-
if (void 0 === u && (u =
|
|
1960
|
+
let u = Rr(0, e, l, void 0, 0);
|
|
1961
|
+
if (void 0 === u && (u = qn(e, l)), void 0 === u) {
|
|
1957
1962
|
o = !1;
|
|
1958
1963
|
break;
|
|
1959
1964
|
}
|
|
1960
|
-
if (0 !==
|
|
1965
|
+
if (0 !== pr(u, a)) {
|
|
1961
1966
|
o = !1;
|
|
1962
1967
|
break;
|
|
1963
1968
|
}
|
|
@@ -1965,59 +1970,59 @@
|
|
|
1965
1970
|
}
|
|
1966
1971
|
return o;
|
|
1967
1972
|
}
|
|
1968
|
-
function
|
|
1969
|
-
return 0 ===
|
|
1973
|
+
function Ir(e, t) {
|
|
1974
|
+
return 0 === rr(t) || Ar(e, t, "");
|
|
1970
1975
|
}
|
|
1971
|
-
function
|
|
1972
|
-
e && !
|
|
1976
|
+
function Cr(e, t, n, r) {
|
|
1977
|
+
e && !cr(e) && jn("GObj bad instanceof");
|
|
1973
1978
|
let l = {};
|
|
1974
|
-
if (
|
|
1979
|
+
if (sr(n) && !fr(n)) {
|
|
1975
1980
|
let o = n;
|
|
1976
|
-
Object.prototype.hasOwnProperty.call(t, o) ?
|
|
1977
|
-
} else if (
|
|
1981
|
+
Object.prototype.hasOwnProperty.call(t, o) ? Er(l, o, t[o]) : r && jn(`${et(e)}: key not found: ${o}`);
|
|
1982
|
+
} else if (lr(n) && tr(n) > 0) for (let o of Object.keys(n)) Object.prototype.hasOwnProperty.call(t, o) ? Er(l, o, t[o]) : r && jn(`${et(e)}: key not found: ${o}`);
|
|
1978
1983
|
else {
|
|
1979
|
-
if (!(
|
|
1984
|
+
if (!(or(n) && nr(n) > 0)) return t;
|
|
1980
1985
|
for (let o = 0; o < n.length; o++) {
|
|
1981
1986
|
let s = n[o];
|
|
1982
|
-
Object.prototype.hasOwnProperty.call(t, s) ?
|
|
1987
|
+
Object.prototype.hasOwnProperty.call(t, s) ? Er(l, s, t[s]) : r && jn(`${et(e)}: key not found: ${s}`);
|
|
1983
1988
|
}
|
|
1984
1989
|
}
|
|
1985
1990
|
return l;
|
|
1986
1991
|
}
|
|
1987
|
-
function
|
|
1992
|
+
function Lr(e, t, n, r) {
|
|
1988
1993
|
let l = {};
|
|
1989
|
-
if (!
|
|
1990
|
-
if (
|
|
1994
|
+
if (!lr(t)) return l;
|
|
1995
|
+
if (Yn(l, t), sr(n) && !fr(n)) {
|
|
1991
1996
|
let o = n;
|
|
1992
|
-
Object.prototype.hasOwnProperty.call(t, o) ?
|
|
1993
|
-
} else if (
|
|
1997
|
+
Object.prototype.hasOwnProperty.call(t, o) ? Hn(l, o) : r && jn(`${et(e)}: key not found: ${o}`);
|
|
1998
|
+
} else if (lr(n) && tr(n) > 0) for (let o of Object.keys(n)) Object.prototype.hasOwnProperty.call(t, o) ? Hn(l, o) : r && jn(`${et(e)}: key not found: ${o}`);
|
|
1994
1999
|
else {
|
|
1995
|
-
if (!(
|
|
2000
|
+
if (!(or(n) && nr(n) > 0)) return {};
|
|
1996
2001
|
for (let o = 0; o < n.length; o++) {
|
|
1997
2002
|
let s = n[o];
|
|
1998
|
-
Object.prototype.hasOwnProperty.call(t, s) ?
|
|
2003
|
+
Object.prototype.hasOwnProperty.call(t, s) ? Hn(l, s) : r && jn(`${et(e)}: key not found: ${s}`);
|
|
1999
2004
|
}
|
|
2000
2005
|
}
|
|
2001
2006
|
return l;
|
|
2002
2007
|
}
|
|
2003
|
-
function
|
|
2008
|
+
function Pr(e, t, n = !1) {
|
|
2004
2009
|
if ("undefined" != typeof window && window.localStorage) try {
|
|
2005
2010
|
let r = window.localStorage.getItem(e);
|
|
2006
|
-
return null === r ? (n &&
|
|
2011
|
+
return null === r ? (n && Ur(e, t), t) : JSON.parse(r);
|
|
2007
2012
|
} catch (n) {
|
|
2008
2013
|
return window.console.warn(`Error reading localStorage key "${e}":`, n), t;
|
|
2009
2014
|
}
|
|
2010
2015
|
}
|
|
2011
|
-
function
|
|
2016
|
+
function Ur(e, t) {
|
|
2012
2017
|
if ("undefined" == typeof window || !window.localStorage) return 0;
|
|
2013
|
-
if (!e || void 0 === t) return
|
|
2018
|
+
if (!e || void 0 === t) return jn(`kw_set_local_storage_value(): invalid key or value: key=${e}`), -1;
|
|
2014
2019
|
try {
|
|
2015
2020
|
return window.localStorage.setItem(e, JSON.stringify(t)), 0;
|
|
2016
2021
|
} catch (t) {
|
|
2017
|
-
return
|
|
2022
|
+
return jn(`kw_set_local_storage_value(): cannot save "${e}" (storage full or blocked?): ${t && t.message ? t.message : t}`), -1;
|
|
2018
2023
|
}
|
|
2019
2024
|
}
|
|
2020
|
-
function
|
|
2025
|
+
function Fr(e) {
|
|
2021
2026
|
if ("undefined" != typeof window && window.localStorage) if (e) try {
|
|
2022
2027
|
window.localStorage.removeItem(e);
|
|
2023
2028
|
} catch (t) {
|
|
@@ -2025,46 +2030,46 @@
|
|
|
2025
2030
|
}
|
|
2026
2031
|
else window.console.warn(`Invalid key for localStorage removal: ${e}`);
|
|
2027
2032
|
}
|
|
2028
|
-
function
|
|
2029
|
-
if (
|
|
2030
|
-
if (
|
|
2033
|
+
function Vr(e, t) {
|
|
2034
|
+
if (ar(e) || ar(t)) return !0;
|
|
2035
|
+
if (or(e)) {
|
|
2031
2036
|
if (0 === e.length) return !0;
|
|
2032
2037
|
for (let n = 0; n < e.length; n++) if (e[n] === t) return !0;
|
|
2033
|
-
} else if (
|
|
2038
|
+
} else if (lr(e)) {
|
|
2034
2039
|
if (0 === Object.keys(e).length) return !0;
|
|
2035
2040
|
for (let n in e) if (n === t) return !0;
|
|
2036
|
-
} else if (
|
|
2041
|
+
} else if (sr(e) && e === t) return !0;
|
|
2037
2042
|
return !1;
|
|
2038
2043
|
}
|
|
2039
|
-
function
|
|
2040
|
-
if (e && !
|
|
2041
|
-
l || (l =
|
|
2044
|
+
function Gr(e, t, n, r, l) {
|
|
2045
|
+
if (e && !cr(e) && jn("GObj bad instanceof"), !t) return null;
|
|
2046
|
+
l || (l = Ir);
|
|
2042
2047
|
let o = [];
|
|
2043
|
-
if (
|
|
2048
|
+
if (or(t)) for (let s = 0; s < t.length; s++) {
|
|
2044
2049
|
let i, _ = t[s];
|
|
2045
|
-
if (
|
|
2050
|
+
if (lr(_)) i = wr(e, _, "id", "", 0);
|
|
2046
2051
|
else {
|
|
2047
|
-
if (!
|
|
2052
|
+
if (!sr(_)) continue;
|
|
2048
2053
|
i = _;
|
|
2049
2054
|
}
|
|
2050
|
-
|
|
2055
|
+
Vr(n, i) && l(_, r) && o.push(_);
|
|
2051
2056
|
}
|
|
2052
2057
|
else {
|
|
2053
|
-
if (!
|
|
2058
|
+
if (!lr(t)) return jn("kw_collect() BAD kw parameter"), null;
|
|
2054
2059
|
for (let e of Object.keys(t)) {
|
|
2055
2060
|
let s = t[e];
|
|
2056
|
-
|
|
2061
|
+
Vr(n, e) && l(s, r) && o.push(s);
|
|
2057
2062
|
}
|
|
2058
2063
|
}
|
|
2059
2064
|
return o;
|
|
2060
2065
|
}
|
|
2061
|
-
function
|
|
2066
|
+
function Mr(e, t) {
|
|
2062
2067
|
if (!e) return -1;
|
|
2063
2068
|
for (let n = 0; n < e.length; n++) if (e[n] && e[n].id === t) return n;
|
|
2064
2069
|
return -1;
|
|
2065
2070
|
}
|
|
2066
|
-
function
|
|
2067
|
-
if (!e || !t) return
|
|
2071
|
+
function Wr(e, t, n) {
|
|
2072
|
+
if (!e || !t) return jn("ERROR: str_in_list() list or str empty"), !1;
|
|
2068
2073
|
let r = e.length;
|
|
2069
2074
|
if (n) {
|
|
2070
2075
|
t = t.toLowerCase();
|
|
@@ -2075,7 +2080,7 @@
|
|
|
2075
2080
|
} else for (let n = 0; n < r; n++) if (e[n] === t) return !0;
|
|
2076
2081
|
return !1;
|
|
2077
2082
|
}
|
|
2078
|
-
function
|
|
2083
|
+
function xr(e, t) {
|
|
2079
2084
|
try {
|
|
2080
2085
|
let n = e.__md_iev__;
|
|
2081
2086
|
if (n) return n[t];
|
|
@@ -2083,35 +2088,35 @@
|
|
|
2083
2088
|
return;
|
|
2084
2089
|
}
|
|
2085
2090
|
}
|
|
2086
|
-
function
|
|
2091
|
+
function Kr(e, t, n) {
|
|
2087
2092
|
let r = e.__md_iev__;
|
|
2088
2093
|
r || (r = {}, e.__md_iev__ = r), r[t] = n;
|
|
2089
2094
|
}
|
|
2090
|
-
function
|
|
2091
|
-
if (!
|
|
2095
|
+
function Yr(e, t, n, r) {
|
|
2096
|
+
if (!cr(e)) return jn("gobj is not a GObj"), null;
|
|
2092
2097
|
if (!t) return;
|
|
2093
|
-
let l =
|
|
2094
|
-
l || (l = [],
|
|
2098
|
+
let l = xr(t, n);
|
|
2099
|
+
l || (l = [], Kr(t, n, l));
|
|
2095
2100
|
try {
|
|
2096
|
-
|
|
2101
|
+
or(l) && l.unshift(r);
|
|
2097
2102
|
} catch (e) {
|
|
2098
|
-
|
|
2103
|
+
jn(e);
|
|
2099
2104
|
}
|
|
2100
2105
|
}
|
|
2101
|
-
function
|
|
2102
|
-
if (!
|
|
2103
|
-
if (!
|
|
2104
|
-
let l =
|
|
2105
|
-
return l ? 0 === l.length ? (r &&
|
|
2106
|
+
function Br(e, t, n, r) {
|
|
2107
|
+
if (!cr(e)) return jn("gobj is not a GObj"), null;
|
|
2108
|
+
if (!lr(t)) return jn("kw is not a dict"), null;
|
|
2109
|
+
let l = xr(t, n);
|
|
2110
|
+
return l ? 0 === l.length ? (r && jn(`stack empty: ${n}`), null) : l[0] : (r && jn(`stack NOT FOUND: ${n}`), null);
|
|
2106
2111
|
}
|
|
2107
|
-
function
|
|
2108
|
-
return
|
|
2112
|
+
function Jr(e, t, n) {
|
|
2113
|
+
return fr(n) ? jr(e, t, "__md_iev__`__msg_type__") : kr(e, t, "__md_iev__", "__msg_type__", n), 0;
|
|
2109
2114
|
}
|
|
2110
|
-
function
|
|
2111
|
-
return
|
|
2115
|
+
function qr(e, t) {
|
|
2116
|
+
return wr(e, t, "__md_iev__`__msg_type__", "", 0);
|
|
2112
2117
|
}
|
|
2113
|
-
function
|
|
2114
|
-
void 0 !== n &&
|
|
2118
|
+
function Hr(e, t, n) {
|
|
2119
|
+
void 0 !== n && sr(n) || (n = "");
|
|
2115
2120
|
for (let r of Object.keys(e)) {
|
|
2116
2121
|
if (!Object.prototype.hasOwnProperty.call(e, r)) continue;
|
|
2117
2122
|
let l = (n.length ? "`" : "") + r;
|
|
@@ -2120,10 +2125,10 @@
|
|
|
2120
2125
|
r,
|
|
2121
2126
|
e[r],
|
|
2122
2127
|
n
|
|
2123
|
-
]),
|
|
2128
|
+
]), lr(e[r]) && Hr(e[r], t, n), n = n.slice(0, -l.length);
|
|
2124
2129
|
}
|
|
2125
2130
|
}
|
|
2126
|
-
function
|
|
2131
|
+
function zr(e, t, n, r) {
|
|
2127
2132
|
if (!e) return null;
|
|
2128
2133
|
let l, o = e.length;
|
|
2129
2134
|
for (l = 0; l < o; l++) {
|
|
@@ -2131,15 +2136,15 @@
|
|
|
2131
2136
|
if (o) {
|
|
2132
2137
|
let e = o.id;
|
|
2133
2138
|
if (e && e === n) return o;
|
|
2134
|
-
if (r &&
|
|
2135
|
-
let e =
|
|
2139
|
+
if (r && hr(o, t)) {
|
|
2140
|
+
let e = zr(o[t], t, n, r);
|
|
2136
2141
|
if (e) return e;
|
|
2137
2142
|
}
|
|
2138
2143
|
}
|
|
2139
2144
|
}
|
|
2140
2145
|
return null;
|
|
2141
2146
|
}
|
|
2142
|
-
function
|
|
2147
|
+
function Qr(e) {
|
|
2143
2148
|
function t(e) {
|
|
2144
2149
|
let t = e.replace(/-/g, "+").replace(/_/g, "/");
|
|
2145
2150
|
switch (t.length % 4) {
|
|
@@ -2170,10 +2175,10 @@
|
|
|
2170
2175
|
signature: t(n[2])
|
|
2171
2176
|
};
|
|
2172
2177
|
}
|
|
2173
|
-
function
|
|
2178
|
+
function Xr(e) {
|
|
2174
2179
|
return null == e ? "" : String(e).replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
2175
2180
|
}
|
|
2176
|
-
var
|
|
2181
|
+
var Zr = class {
|
|
2177
2182
|
constructor(e) {
|
|
2178
2183
|
this.html = e, Object.freeze(this);
|
|
2179
2184
|
}
|
|
@@ -2181,41 +2186,41 @@
|
|
|
2181
2186
|
return this.html;
|
|
2182
2187
|
}
|
|
2183
2188
|
};
|
|
2184
|
-
function Zr(e) {
|
|
2185
|
-
return e instanceof Xr;
|
|
2186
|
-
}
|
|
2187
2189
|
function el(e) {
|
|
2190
|
+
return e instanceof Zr;
|
|
2191
|
+
}
|
|
2192
|
+
function tl(e) {
|
|
2188
2193
|
const t = document.createElement("template");
|
|
2189
2194
|
return t.innerHTML = e.html.trim(), t.content;
|
|
2190
2195
|
}
|
|
2191
|
-
var
|
|
2192
|
-
function
|
|
2196
|
+
var nl = !1, rl = /* @__PURE__ */ new Set();
|
|
2197
|
+
function ll(e) {
|
|
2193
2198
|
const t = document.createElement("template");
|
|
2194
2199
|
return t.innerHTML = e.trim(), t.content.firstChild;
|
|
2195
2200
|
}
|
|
2196
|
-
function
|
|
2201
|
+
function ol(e) {
|
|
2197
2202
|
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();
|
|
2198
2203
|
return `${n}.${r}${l > 0 ? "-" : "+"}${t(Math.floor(Math.abs(l) / 60), 2)}${t(Math.abs(l) % 60, 2)}`;
|
|
2199
2204
|
}
|
|
2200
|
-
function
|
|
2205
|
+
function sl(e, t) {
|
|
2201
2206
|
if (!e) throw "ERROR: index_in_list() list empty";
|
|
2202
2207
|
for (let n = 0; n < e.length; n++) if (t === e[n]) return n;
|
|
2203
2208
|
return -1;
|
|
2204
2209
|
}
|
|
2205
|
-
function
|
|
2210
|
+
function il() {
|
|
2206
2211
|
let e = "";
|
|
2207
2212
|
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;
|
|
2208
2213
|
}
|
|
2209
|
-
function
|
|
2214
|
+
function _l(e) {
|
|
2210
2215
|
let t = null;
|
|
2211
2216
|
return "function" != typeof e && "object" != typeof e || (t = ("" + e).match(/function\s*([\w\$]*)\s*\(/)), null !== t ? t[1] + "()" : "";
|
|
2212
2217
|
}
|
|
2213
|
-
var
|
|
2214
|
-
function
|
|
2218
|
+
var al = 256, ul = 1e5;
|
|
2219
|
+
function cl(e) {
|
|
2215
2220
|
const t = String(e).replace(/`/g, "``");
|
|
2216
2221
|
return "[" === t[0] ? "[" + t : t;
|
|
2217
2222
|
}
|
|
2218
|
-
function
|
|
2223
|
+
function fl(e) {
|
|
2219
2224
|
if ("string" != typeof e) return null;
|
|
2220
2225
|
let t = [], n = "";
|
|
2221
2226
|
for (let r = 0; r < e.length; r++) if ("`" !== e[r]) n += e[r];
|
|
@@ -2236,17 +2241,17 @@
|
|
|
2236
2241
|
return null !== t ? t : "[" === e[0] && "[" === e[1] ? e.slice(1) : e;
|
|
2237
2242
|
});
|
|
2238
2243
|
}
|
|
2239
|
-
function
|
|
2244
|
+
function gl(e, t) {
|
|
2240
2245
|
return e === t || null !== e && null !== t && "object" == typeof e && "object" == typeof t && JSON.stringify(e) === JSON.stringify(t);
|
|
2241
2246
|
}
|
|
2242
|
-
function
|
|
2247
|
+
function dl(e) {
|
|
2243
2248
|
return "persistent-attrs-" + et(e);
|
|
2244
2249
|
}
|
|
2245
|
-
function
|
|
2246
|
-
if (
|
|
2250
|
+
function bl(e, t) {
|
|
2251
|
+
if (sr(t)) {
|
|
2247
2252
|
if (-1 === t.indexOf("^")) {
|
|
2248
2253
|
let n, r, l = e.fkey;
|
|
2249
|
-
if (1 !==
|
|
2254
|
+
if (1 !== tr(l)) return jn("bad fkey 1"), jn(e), jn(t), null;
|
|
2250
2255
|
for (const e of Object.keys(l)) {
|
|
2251
2256
|
n = e, r = l[e];
|
|
2252
2257
|
break;
|
|
@@ -2259,20 +2264,20 @@
|
|
|
2259
2264
|
}
|
|
2260
2265
|
{
|
|
2261
2266
|
let n = t.split("^");
|
|
2262
|
-
return 3 !== n.length ? (
|
|
2267
|
+
return 3 !== n.length ? (jn("bad fkey 2"), jn(e), jn(t), null) : {
|
|
2263
2268
|
topic_name: n[0],
|
|
2264
2269
|
id: n[1],
|
|
2265
2270
|
hook_name: n[2]
|
|
2266
2271
|
};
|
|
2267
2272
|
}
|
|
2268
2273
|
}
|
|
2269
|
-
return
|
|
2274
|
+
return lr(t) ? {
|
|
2270
2275
|
topic_name: t.topic_name,
|
|
2271
2276
|
id: t.id,
|
|
2272
2277
|
hook_name: t.hook_name
|
|
2273
|
-
} : (
|
|
2278
|
+
} : (jn("bad fkey 3"), jn(e), jn(t), null);
|
|
2274
2279
|
}
|
|
2275
|
-
var
|
|
2280
|
+
var pl = [
|
|
2276
2281
|
"string",
|
|
2277
2282
|
"integer",
|
|
2278
2283
|
"object",
|
|
@@ -2282,7 +2287,7 @@
|
|
|
2282
2287
|
"real",
|
|
2283
2288
|
"boolean",
|
|
2284
2289
|
"blob"
|
|
2285
|
-
],
|
|
2290
|
+
], ml = [
|
|
2286
2291
|
"persistent",
|
|
2287
2292
|
"required",
|
|
2288
2293
|
"notnull",
|
|
@@ -2294,7 +2299,7 @@
|
|
|
2294
2299
|
"stats",
|
|
2295
2300
|
"rstats",
|
|
2296
2301
|
"pstats"
|
|
2297
|
-
],
|
|
2302
|
+
], hl = [
|
|
2298
2303
|
"hook",
|
|
2299
2304
|
"fkey",
|
|
2300
2305
|
"enum",
|
|
@@ -2323,7 +2328,7 @@
|
|
|
2323
2328
|
"coordinates",
|
|
2324
2329
|
"gbuffer"
|
|
2325
2330
|
];
|
|
2326
|
-
function
|
|
2331
|
+
function yl(e) {
|
|
2327
2332
|
let t = {
|
|
2328
2333
|
name: e.id,
|
|
2329
2334
|
header: e.header,
|
|
@@ -2342,7 +2347,7 @@
|
|
|
2342
2347
|
if (!e.flag) return t;
|
|
2343
2348
|
for (let n = 0; n < e.flag.length; n++) {
|
|
2344
2349
|
let r = e.flag[n];
|
|
2345
|
-
if (
|
|
2350
|
+
if (Wr(hl, r)) {
|
|
2346
2351
|
switch (r) {
|
|
2347
2352
|
case "enum":
|
|
2348
2353
|
t.enum_list = e.enum;
|
|
@@ -2356,7 +2361,7 @@
|
|
|
2356
2361
|
case "file": t.is_file = !0;
|
|
2357
2362
|
}
|
|
2358
2363
|
t.type = r;
|
|
2359
|
-
} else if (
|
|
2364
|
+
} else if (Wr(ml, r)) switch (r) {
|
|
2360
2365
|
case "writable":
|
|
2361
2366
|
t.is_writable = !0;
|
|
2362
2367
|
break;
|
|
@@ -2369,23 +2374,23 @@
|
|
|
2369
2374
|
}
|
|
2370
2375
|
return t.is_file && (t.type = "file"), t;
|
|
2371
2376
|
}
|
|
2372
|
-
var
|
|
2377
|
+
var El = [
|
|
2373
2378
|
j(y.DTP_POINTER, "subscriber", 0, null, "Subscriber of output events"),
|
|
2374
2379
|
j(y.DTP_BOOLEAN, "periodic", 0, 0, "True for periodic timeouts"),
|
|
2375
2380
|
j(y.DTP_INTEGER, "msec", 0, 0, "Timeout in milliseconds"),
|
|
2376
2381
|
v()
|
|
2377
|
-
],
|
|
2382
|
+
], Tl = {
|
|
2378
2383
|
periodic: !1,
|
|
2379
2384
|
msec: 0,
|
|
2380
2385
|
timer_id: -1
|
|
2381
|
-
},
|
|
2382
|
-
function
|
|
2386
|
+
}, vl = null;
|
|
2387
|
+
function jl(e, t, n, r) {
|
|
2383
2388
|
let l = e.priv, o = l.periodic ? "EV_TIMEOUT_PERIODIC" : "EV_TIMEOUT";
|
|
2384
2389
|
return l.periodic && l.msec > 0 ? l.timer_id = setTimeout(function() {
|
|
2385
2390
|
Vt(e, "EV_TIMEOUT", {}, e);
|
|
2386
2391
|
}, l.msec) : l.timer_id = -1, lt(e) ? Vt(nt(e), o, {}, e) : Xt(e, o, {}), l.periodic || -1 !== l.timer_id || Ke(e) && Ve(e), 0;
|
|
2387
2392
|
}
|
|
2388
|
-
var
|
|
2393
|
+
var Ol = {
|
|
2389
2394
|
mt_create: function(e) {
|
|
2390
2395
|
let t = e.priv;
|
|
2391
2396
|
const n = Ot(e, "subscriber");
|
|
@@ -2410,16 +2415,16 @@
|
|
|
2410
2415
|
},
|
|
2411
2416
|
mt_destroy: function(e) {}
|
|
2412
2417
|
};
|
|
2413
|
-
function Ol(e, t) {
|
|
2414
|
-
return e instanceof S ? "C_TIMER" !== Ze(e) ? (vn("not C_TIMER GObj"), -1) : (Nt(e, "periodic", !1), void $t(e, "msec", t)) : (vn("not GObj TYPE"), -1);
|
|
2415
|
-
}
|
|
2416
2418
|
function Sl(e, t) {
|
|
2417
|
-
return e instanceof S ? "C_TIMER" !== Ze(e) ? (
|
|
2419
|
+
return e instanceof S ? "C_TIMER" !== Ze(e) ? (jn("not C_TIMER GObj"), -1) : (Nt(e, "periodic", !1), void $t(e, "msec", t)) : (jn("not GObj TYPE"), -1);
|
|
2420
|
+
}
|
|
2421
|
+
function wl(e, t) {
|
|
2422
|
+
return e instanceof S ? "C_TIMER" !== Ze(e) ? (jn("not C_TIMER GObj"), -1) : (Nt(e, "periodic", !0), void $t(e, "msec", t)) : (jn("not GObj TYPE"), -1);
|
|
2418
2423
|
}
|
|
2419
|
-
function
|
|
2420
|
-
return e instanceof S ? "C_TIMER" !== Ze(e) ? (
|
|
2424
|
+
function Nl(e) {
|
|
2425
|
+
return e instanceof S ? "C_TIMER" !== Ze(e) ? (jn("not C_TIMER GObj"), -1) : void $t(e, "msec", -1) : (jn("not GObj TYPE"), -1);
|
|
2421
2426
|
}
|
|
2422
|
-
var
|
|
2427
|
+
var $l = [
|
|
2423
2428
|
j(y.DTP_BOOLEAN, "changesLost", 0, !1, "Set true to warn about leaving page"),
|
|
2424
2429
|
j(y.DTP_BOOLEAN, "browser_beforeunload", 0, !1, "Set true to refreshing browser"),
|
|
2425
2430
|
j(y.DTP_STRING, "__username__", 0, "", "Username"),
|
|
@@ -2439,63 +2444,63 @@
|
|
|
2439
2444
|
j(y.DTP_BOOLEAN, "developer", 0, !1, "Developer mode enabled"),
|
|
2440
2445
|
j(y.DTP_INTEGER, "periodic_timeout", 0, "1000", "Timeout periodic, in miliseconds."),
|
|
2441
2446
|
v()
|
|
2442
|
-
],
|
|
2443
|
-
function
|
|
2447
|
+
], Rl = { gobj_timer: null }, Dl = null;
|
|
2448
|
+
function kl(e, t, n, r) {
|
|
2444
2449
|
let l = yt(e, t);
|
|
2445
|
-
return
|
|
2450
|
+
return lr(l) || (l = {}), l[n] = r, St(e, t, l), De(e, t);
|
|
2446
2451
|
}
|
|
2447
|
-
function
|
|
2452
|
+
function Al(e) {
|
|
2448
2453
|
if (!0 === e || !1 === e) return e;
|
|
2449
2454
|
let t = String(null == e ? "" : e).toLowerCase();
|
|
2450
2455
|
return "true" === t || "set" === t || "false" !== t && "reset" !== t && ("" === t || isNaN(Number(t)) ? null : !!Number(t));
|
|
2451
2456
|
}
|
|
2452
|
-
function
|
|
2457
|
+
function Il() {
|
|
2453
2458
|
return `${ze()}^${He()}`;
|
|
2454
2459
|
}
|
|
2455
|
-
function
|
|
2460
|
+
function Cl(e, t, n, r) {
|
|
2456
2461
|
return Xt(e, t, n), 0;
|
|
2457
2462
|
}
|
|
2458
|
-
var
|
|
2463
|
+
var Ll = {
|
|
2459
2464
|
mt_create: function(e) {
|
|
2460
2465
|
let t = e.priv;
|
|
2461
|
-
Rt(e, "start_date",
|
|
2466
|
+
Rt(e, "start_date", ol()), Rt(e, "node_uuid", il()), e.priv.gobj_timer = Ce(Xe(e), "C_TIMER", {}, e), t.periodic_timeout = yt(e, "periodic_timeout"), function(e) {
|
|
2462
2467
|
let t = yt(e, "trace_levels");
|
|
2463
|
-
if (!
|
|
2468
|
+
if (!lr(t)) return 0;
|
|
2464
2469
|
let n = t.__global_trace__;
|
|
2465
|
-
if (
|
|
2470
|
+
if (or(n)) {
|
|
2466
2471
|
Z(4294967295, !1);
|
|
2467
2472
|
for (let e of n) Q(e, !0);
|
|
2468
2473
|
}
|
|
2469
2474
|
for (const [n, r] of Object.entries(t)) {
|
|
2470
2475
|
let t = Oe(n);
|
|
2471
|
-
if (t) if (
|
|
2476
|
+
if (t) if (or(r)) {
|
|
2472
2477
|
se(t, null, !1);
|
|
2473
2478
|
for (let e of r) se(t, e, !0);
|
|
2474
|
-
} else
|
|
2479
|
+
} else jn(`${Xe(e)}: trace_levels of ${n} MUST be a list`);
|
|
2475
2480
|
}
|
|
2476
2481
|
}(e), function(e) {
|
|
2477
2482
|
let t = yt(e, "no_trace_levels");
|
|
2478
|
-
if (!
|
|
2483
|
+
if (!lr(t)) return 0;
|
|
2479
2484
|
let n = t.__global_no_trace__;
|
|
2480
|
-
if (
|
|
2485
|
+
if (or(n)) {
|
|
2481
2486
|
ee(4294967295, !1);
|
|
2482
2487
|
for (let e of n) X(e, !0);
|
|
2483
2488
|
}
|
|
2484
2489
|
for (const [n, r] of Object.entries(t)) {
|
|
2485
2490
|
let t = Oe(n);
|
|
2486
|
-
if (t) if (
|
|
2491
|
+
if (t) if (or(r)) {
|
|
2487
2492
|
ie(t, null, !1);
|
|
2488
2493
|
for (let e of r) ie(t, e, !0);
|
|
2489
|
-
} else
|
|
2494
|
+
} else jn(`${Xe(e)}: no_trace_levels of ${n} MUST be a list`);
|
|
2490
2495
|
}
|
|
2491
2496
|
}(e);
|
|
2492
2497
|
},
|
|
2493
2498
|
mt_writing: function(e, t) {},
|
|
2494
2499
|
mt_start: function(e) {
|
|
2495
|
-
return
|
|
2500
|
+
return wl(e.priv.gobj_timer, e.priv.periodic_timeout), 0;
|
|
2496
2501
|
},
|
|
2497
2502
|
mt_stop: function(e) {
|
|
2498
|
-
return
|
|
2503
|
+
return Nl(e.priv.gobj_timer), Me(e), 0;
|
|
2499
2504
|
},
|
|
2500
2505
|
mt_destroy: function(e) {},
|
|
2501
2506
|
mt_play: function(e) {
|
|
@@ -2512,24 +2517,24 @@
|
|
|
2512
2517
|
case "get-global-no-trace": return l(0, 0, null, null, ne());
|
|
2513
2518
|
case "set-global-trace":
|
|
2514
2519
|
case "set-global-no-trace": {
|
|
2515
|
-
let r = "set-global-no-trace" === t, o = n.level, s =
|
|
2516
|
-
return o ? null === s ? l(0, -1, `${
|
|
2520
|
+
let r = "set-global-no-trace" === t, o = n.level, s = Al(n.set);
|
|
2521
|
+
return o ? null === s ? l(0, -1, `${Il()}: bitmask set or re-set?`, null, null) : (r ? X(o, s) : Q(o, s)) < 0 ? l(0, -1, `${Il()}: global trace level not found: ${o}`, null, null) : r ? (kl(e, "no_trace_levels", "__global_no_trace__", ne()), l(0, 0, null, null, ne())) : (kl(e, "trace_levels", "__global_trace__", te()), l(0, 0, null, null, te())) : l(0, -1, `${Il()}: what level?`, null, null);
|
|
2517
2522
|
}
|
|
2518
2523
|
case "get-gclass-trace":
|
|
2519
2524
|
case "get-gclass-no-trace":
|
|
2520
2525
|
case "set-gclass-trace":
|
|
2521
2526
|
case "set-gclass-no-trace": {
|
|
2522
2527
|
let r = t.indexOf("no-trace") >= 0, o = n.gclass_name || n.gclass || "", s = Oe(o);
|
|
2523
|
-
if (!s) return l(0, -1, `${
|
|
2528
|
+
if (!s) return l(0, -1, `${Il()}: what gclass is '${o}'?`, null, null);
|
|
2524
2529
|
if (0 === t.indexOf("get-")) return l(0, 0, null, null, r ? oe(s) : re(s));
|
|
2525
|
-
let i = n.level, _ =
|
|
2526
|
-
return i ? null === _ ? l(0, -1, `${
|
|
2530
|
+
let i = n.level, _ = Al(n.set);
|
|
2531
|
+
return i ? null === _ ? l(0, -1, `${Il()}: bitmask set or re-set?`, null, null) : (r ? ie(s, i, _) : se(s, i, _)) < 0 ? l(0, -1, `${Il()}: trace level of ${o} not found: ${i}`, null, null) : r ? (kl(e, "no_trace_levels", o, oe(s)), l(0, 0, null, null, oe(s))) : (kl(e, "trace_levels", o, le(s)), l(0, 0, null, null, re(s))) : l(0, -1, `${Il()}: what level?`, null, null);
|
|
2527
2532
|
}
|
|
2528
|
-
default: return l(0, -1, `${
|
|
2533
|
+
default: return l(0, -1, `${Il()}: command not available: ${t}`, null, null);
|
|
2529
2534
|
}
|
|
2530
2535
|
}
|
|
2531
2536
|
};
|
|
2532
|
-
var
|
|
2537
|
+
var Pl = "ievent_gate_stack", Ul = [
|
|
2533
2538
|
j(y.DTP_STRING, "wanted_yuno_role", E.SDF_RD, "", "wanted yuno role"),
|
|
2534
2539
|
j(y.DTP_STRING, "wanted_yuno_name", E.SDF_RD, "", "wanted yuno name"),
|
|
2535
2540
|
j(y.DTP_STRING, "wanted_yuno_service", E.SDF_RD, "", "wanted yuno service"),
|
|
@@ -2546,15 +2551,15 @@
|
|
|
2546
2551
|
j(y.DTP_INTEGER, "timeout_idack", E.SDF_RD, "5000", "timeout waiting idAck"),
|
|
2547
2552
|
j(y.DTP_POINTER, "subscriber", 0, 0, "subscriber of output-events. If null then subscriber is the parent"),
|
|
2548
2553
|
v()
|
|
2549
|
-
],
|
|
2554
|
+
], Fl = [
|
|
2550
2555
|
["ievents", "Trace inter-events with metadata of kw"],
|
|
2551
2556
|
["ievents2", "Trace inter-events with full kw"],
|
|
2552
2557
|
["identity-card", "Trace identity_card messages"]
|
|
2553
2558
|
];
|
|
2554
|
-
function
|
|
2559
|
+
function Vl(e) {
|
|
2555
2560
|
return !!(3 & x(e));
|
|
2556
2561
|
}
|
|
2557
|
-
var
|
|
2562
|
+
var Gl = {
|
|
2558
2563
|
url: null,
|
|
2559
2564
|
remote_yuno_name: null,
|
|
2560
2565
|
remote_yuno_role: null,
|
|
@@ -2564,23 +2569,23 @@
|
|
|
2564
2569
|
websocket: null,
|
|
2565
2570
|
inside_on_open: !1,
|
|
2566
2571
|
retry_ms: 0
|
|
2567
|
-
},
|
|
2568
|
-
function
|
|
2569
|
-
e.priv.websocket &&
|
|
2572
|
+
}, Ml = null;
|
|
2573
|
+
function Wl(e) {
|
|
2574
|
+
e.priv.websocket && jn("Websocket ALREADY setup");
|
|
2570
2575
|
const t = jt(e, "url");
|
|
2571
|
-
|
|
2576
|
+
Sn(`====> Starting WebSocket to '${t}' (${et(e)})`);
|
|
2572
2577
|
const n = ++e.priv.ws_seq;
|
|
2573
2578
|
let r;
|
|
2574
2579
|
try {
|
|
2575
2580
|
r = new WebSocket(t);
|
|
2576
2581
|
} catch (r) {
|
|
2577
|
-
return
|
|
2582
|
+
return jn(`${et(e)}: Cannot open WebSocket to '${t}', Error: ${r.message}`), Ut(e, "EV_ON_CLOSE", {
|
|
2578
2583
|
url: t,
|
|
2579
2584
|
ws_seq: n,
|
|
2580
2585
|
code: 1006,
|
|
2581
2586
|
reason: r.message,
|
|
2582
2587
|
was_clean: !1
|
|
2583
|
-
}, e) < 0 &&
|
|
2588
|
+
}, e) < 0 && Sl(e.priv.gobj_timer, Zl(e)), null;
|
|
2584
2589
|
}
|
|
2585
2590
|
return r ? (r.onopen = () => {
|
|
2586
2591
|
n !== e.priv.ws_seq || ot(e) || Vt(e, "EV_ON_OPEN", {
|
|
@@ -2593,69 +2598,69 @@
|
|
|
2593
2598
|
data: r.data
|
|
2594
2599
|
}, e);
|
|
2595
2600
|
}, r.onclose = (r) => {
|
|
2596
|
-
ot(e) || n === e.priv.ws_seq && (Tt(qe(), "browser_beforeunload") ?
|
|
2601
|
+
ot(e) || n === e.priv.ws_seq && (Tt(qe(), "browser_beforeunload") ? On("Close websocket by unload page") : Vt(e, "EV_ON_CLOSE", {
|
|
2597
2602
|
url: t,
|
|
2598
2603
|
ws_seq: n,
|
|
2599
2604
|
code: r.code,
|
|
2600
2605
|
reason: r.reason,
|
|
2601
2606
|
was_clean: r.wasClean
|
|
2602
2607
|
}, e));
|
|
2603
|
-
}, r) : (
|
|
2608
|
+
}, r) : (jn(`${et(e)}: Failed to initialize WebSocket.`), null);
|
|
2604
2609
|
}
|
|
2605
|
-
function
|
|
2610
|
+
function xl(e, t = 1e3, n = "") {
|
|
2606
2611
|
let r = e.priv, l = r.websocket;
|
|
2607
2612
|
if (r.websocket = null, l && l.readyState !== WebSocket.CLOSED && l.readyState !== WebSocket.CLOSING) {
|
|
2608
|
-
|
|
2613
|
+
Sn(`Closing WebSocket (Code: ${t}, Reason: "${n}")`);
|
|
2609
2614
|
try {
|
|
2610
2615
|
l.close(t, n);
|
|
2611
2616
|
} catch (t) {
|
|
2612
|
-
|
|
2617
|
+
jn(`${et(e)}: Error closing WebSocket: ${t.message}`);
|
|
2613
2618
|
}
|
|
2614
|
-
} else
|
|
2619
|
+
} else On("WebSocket is already closed or in the process of closing.");
|
|
2615
2620
|
}
|
|
2616
|
-
function
|
|
2617
|
-
let r =
|
|
2621
|
+
function Kl(e, t, n) {
|
|
2622
|
+
let r = ol();
|
|
2618
2623
|
try {
|
|
2619
|
-
|
|
2624
|
+
Sn("\n" + r + " " + t + "\n"), Wn(n);
|
|
2620
2625
|
} catch (e) {
|
|
2621
|
-
|
|
2626
|
+
Sn("ERROR in trace_inter_event: " + e);
|
|
2622
2627
|
}
|
|
2623
2628
|
}
|
|
2624
|
-
var
|
|
2629
|
+
var Yl = class {
|
|
2625
2630
|
constructor(e, t) {
|
|
2626
2631
|
this.event = e, this.kw = t || {};
|
|
2627
2632
|
}
|
|
2628
2633
|
};
|
|
2629
|
-
function
|
|
2634
|
+
function Bl(e, t, n, r) {
|
|
2630
2635
|
return function(e, t) {
|
|
2631
2636
|
let n = e.priv, r = JSON.stringify(t);
|
|
2632
|
-
if (
|
|
2637
|
+
if (Vl(e)) {
|
|
2633
2638
|
let n = jt(e, "url"), l = Xe(qe()) + " ==> " + n, o = yt(qe(), "trace_ievent_callback");
|
|
2634
|
-
o ? o(l, t, 1, r.length) :
|
|
2639
|
+
o ? o(l, t, 1, r.length) : Kl(0, l, t);
|
|
2635
2640
|
}
|
|
2636
|
-
if (!n.websocket || n.websocket.readyState !== WebSocket.OPEN) return
|
|
2641
|
+
if (!n.websocket || n.websocket.readyState !== WebSocket.OPEN) return On(`${et(e)}: send_iev(): websocket not open, message lost`), -1;
|
|
2637
2642
|
try {
|
|
2638
2643
|
n.websocket.send(r);
|
|
2639
2644
|
} catch (t) {
|
|
2640
|
-
|
|
2645
|
+
jn(`${et(e)}: send_iev(): ${t}`);
|
|
2641
2646
|
}
|
|
2642
2647
|
return 0;
|
|
2643
2648
|
}(e, function(e, t) {
|
|
2644
|
-
return
|
|
2649
|
+
return fr(e) ? (jn("iev_create() event NULL"), null) : new Yl(e, t);
|
|
2645
2650
|
}(t, n));
|
|
2646
2651
|
}
|
|
2647
|
-
function
|
|
2648
|
-
return
|
|
2652
|
+
function Jl(e, t, n) {
|
|
2653
|
+
return fr(n) && (n = jt(e, "wanted_yuno_service")), {
|
|
2649
2654
|
dst_yuno: jt(e, "wanted_yuno_name"),
|
|
2650
2655
|
dst_role: jt(e, "wanted_yuno_role"),
|
|
2651
2656
|
dst_service: n,
|
|
2652
2657
|
src_yuno: He(),
|
|
2653
2658
|
src_role: ze(),
|
|
2654
2659
|
src_service: t,
|
|
2655
|
-
host:
|
|
2660
|
+
host: il()
|
|
2656
2661
|
};
|
|
2657
2662
|
}
|
|
2658
|
-
function
|
|
2663
|
+
function ql(e) {
|
|
2659
2664
|
let t = e.priv, n = Je(qe()), r = jt(qe(), "yuno_version"), l = jt(qe(), "yuno_release"), o = jt(qe(), "yuno_tag"), i = yt(e, "required_services");
|
|
2660
2665
|
i && i.length || (i = yt(qe(), "required_services"));
|
|
2661
2666
|
let _ = {
|
|
@@ -2673,34 +2678,34 @@
|
|
|
2673
2678
|
username: jt(qe(), "__username__"),
|
|
2674
2679
|
launch_id: 0,
|
|
2675
2680
|
yuno_startdate: jt(qe(), "start_date"),
|
|
2676
|
-
id:
|
|
2681
|
+
id: il(),
|
|
2677
2682
|
user_agent: "undefined" != typeof window ? window.navigator.userAgent : "",
|
|
2678
2683
|
language: "undefined" != typeof window ? window.navigator.language : "",
|
|
2679
2684
|
required_services: i
|
|
2680
2685
|
};
|
|
2681
|
-
return
|
|
2686
|
+
return Yr(e, _, Pl, Jl(e, Xe(nt(e)), null)), Jr(e, _, "__identity__"), Sl(t.gobj_timer, vt(e, "timeout_idack")), Bl(e, "EV_IDENTITY_CARD", _);
|
|
2682
2687
|
}
|
|
2683
|
-
function
|
|
2684
|
-
if (
|
|
2688
|
+
function Hl(e, t) {
|
|
2689
|
+
if (fr(t.event)) return -1;
|
|
2685
2690
|
let n = {}, r = t.__global__, l = t.__config__, o = t.__filter__, s = t.__service__, i = t.subscriber;
|
|
2686
2691
|
l && (n.__config__ = l), r && (n.__global__ = r), o && (n.__filter__ = o);
|
|
2687
|
-
return
|
|
2688
|
-
}
|
|
2689
|
-
function Hl(e, t, n, r) {
|
|
2690
|
-
let l = e.priv;
|
|
2691
|
-
return Ke(e) && (l.websocket = Ml(e)), 0;
|
|
2692
|
+
return Yr(e, n, Pl, Jl(e, Xe(i), s)), Jr(e, n, "__subscribing__"), Bl(e, t.event, n);
|
|
2692
2693
|
}
|
|
2693
2694
|
function zl(e, t, n, r) {
|
|
2694
|
-
|
|
2695
|
+
let l = e.priv;
|
|
2696
|
+
return Ke(e) && (l.websocket = Wl(e)), 0;
|
|
2695
2697
|
}
|
|
2696
2698
|
function Ql(e, t, n, r) {
|
|
2699
|
+
return Sn("Websocket opened: " + e.priv.url), ql(e), 0;
|
|
2700
|
+
}
|
|
2701
|
+
function Xl(e, t, n, r) {
|
|
2697
2702
|
let l = e.priv, o = n.url;
|
|
2698
|
-
return void 0 !== n.ws_seq && n.ws_seq !== l.ws_seq || (bn(),
|
|
2703
|
+
return void 0 !== n.ws_seq && n.ws_seq !== l.ws_seq || (bn(), On(`${et(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, Xt(e, "EV_ON_CLOSE", {
|
|
2699
2704
|
url: o,
|
|
2700
2705
|
remote_yuno_name: l.remote_yuno_name,
|
|
2701
2706
|
remote_yuno_role: l.remote_yuno_role,
|
|
2702
2707
|
remote_yuno_service: l.remote_yuno_service
|
|
2703
|
-
})) : Ke(e) && (
|
|
2708
|
+
})) : Ke(e) && (On(`${et(e)}: EV_ON_OPEN_ERROR cannot open ${o} (Code: ${n.code}, Reason: "${n.reason}", Clean: ${n.was_clean})`), Xt(e, "EV_ON_OPEN_ERROR", {
|
|
2704
2709
|
url: o,
|
|
2705
2710
|
remote_yuno_name: l.remote_yuno_name,
|
|
2706
2711
|
remote_yuno_role: l.remote_yuno_role,
|
|
@@ -2708,25 +2713,25 @@
|
|
|
2708
2713
|
code: n.code,
|
|
2709
2714
|
reason: n.reason,
|
|
2710
2715
|
was_clean: n.was_clean
|
|
2711
|
-
})), Ke(e) &&
|
|
2716
|
+
})), Ke(e) && Sl(l.gobj_timer, Zl(e))), 0;
|
|
2712
2717
|
}
|
|
2713
|
-
function
|
|
2718
|
+
function Zl(e) {
|
|
2714
2719
|
let t = e.priv, n = vt(e, "timeout_retry"), r = vt(e, "timeout_retry_max");
|
|
2715
2720
|
r < n && (r = n), t.retry_ms = t.retry_ms ? Math.min(2 * t.retry_ms, r) : n;
|
|
2716
2721
|
let l = .2 * t.retry_ms, o = t.retry_ms - l + 2 * Math.random() * l;
|
|
2717
2722
|
return Math.max(1, Math.round(o));
|
|
2718
2723
|
}
|
|
2719
|
-
function Zl(e, t, n, r) {
|
|
2720
|
-
return Jl(e), 0;
|
|
2721
|
-
}
|
|
2722
2724
|
function eo(e, t, n, r) {
|
|
2725
|
+
return ql(e), 0;
|
|
2726
|
+
}
|
|
2727
|
+
function to(e, t, n, r) {
|
|
2723
2728
|
let l = e.priv;
|
|
2724
|
-
|
|
2725
|
-
let o =
|
|
2729
|
+
Nl(l.gobj_timer);
|
|
2730
|
+
let o = Br(e, n, Pl, !0), s = wr(e, o, "src_yuno", ""), i = wr(e, o, "src_role", ""), _ = wr(e, o, "src_service", "");
|
|
2726
2731
|
Rt(e, "remote_yuno_name", s), Rt(e, "remote_yuno_role", i), Rt(e, "remote_yuno_service", _);
|
|
2727
|
-
let a =
|
|
2732
|
+
let a = Sr(e, n, "result", -1, 0), u = wr(e, n, "comment", "", 0), c = wr(e, n, "username", "", 0), f = Rr(e, n, "services_roles", {});
|
|
2728
2733
|
if (a < 0) {
|
|
2729
|
-
|
|
2734
|
+
xl(e);
|
|
2730
2735
|
let t = {
|
|
2731
2736
|
url: jt(e, "url"),
|
|
2732
2737
|
result: a,
|
|
@@ -2751,61 +2756,61 @@
|
|
|
2751
2756
|
}
|
|
2752
2757
|
l.inside_on_open = !1, function(e) {
|
|
2753
2758
|
let t = zt(e, null, null, null);
|
|
2754
|
-
for (let n = 0; n < t.length; n++)
|
|
2759
|
+
for (let n = 0; n < t.length; n++) Hl(e, t[n]);
|
|
2755
2760
|
}(e);
|
|
2756
2761
|
}
|
|
2757
2762
|
return 0;
|
|
2758
2763
|
}
|
|
2759
|
-
function
|
|
2764
|
+
function no(e, t, n, r) {
|
|
2760
2765
|
let l = e.priv.url, o = function(e, t) {
|
|
2761
2766
|
let n;
|
|
2762
2767
|
try {
|
|
2763
2768
|
n = JSON.parse(t);
|
|
2764
2769
|
} catch (t) {
|
|
2765
|
-
return
|
|
2770
|
+
return On(`${et(e)}: parsing inter_event json: ${t}`), null;
|
|
2766
2771
|
}
|
|
2767
|
-
if (!(n instanceof Object)) return
|
|
2772
|
+
if (!(n instanceof Object)) return On(`${et(e)}: parsing inter_event: websocket data not a json object`), null;
|
|
2768
2773
|
let r = n.event;
|
|
2769
|
-
if (!r) return
|
|
2770
|
-
if ("string" != typeof r) return
|
|
2774
|
+
if (!r) return On(`${et(e)}: parsing inter_event: no event`), null;
|
|
2775
|
+
if ("string" != typeof r) return On(`${et(e)}: parsing inter_event: event not a string`), null;
|
|
2771
2776
|
let l = n.kw;
|
|
2772
2777
|
return l ? l instanceof Object ? {
|
|
2773
2778
|
event: r,
|
|
2774
2779
|
kw: l || {}
|
|
2775
|
-
} : (
|
|
2780
|
+
} : (On(`${et(e)}: parsing inter_event: kw not a json object`), null) : (On(`${et(e)}: parsing inter_kw: no kw`), null);
|
|
2776
2781
|
}(e, n.data);
|
|
2777
|
-
if (!o) return
|
|
2778
|
-
if (
|
|
2782
|
+
if (!o) return On(`${et(e)}: frame dropped from ${l}: ${String(n.data).substring(0, 256)}`), -1;
|
|
2783
|
+
if (Vl(e)) {
|
|
2779
2784
|
let e = Xe(qe()) + " <== " + l, t = n.data.length, r = yt(qe(), "trace_ievent_callback");
|
|
2780
|
-
r ? r(e, o, 2, t) :
|
|
2785
|
+
r ? r(e, o, 2, t) : Kl(0, e, o);
|
|
2781
2786
|
}
|
|
2782
2787
|
let s = o.event, i = o.kw;
|
|
2783
2788
|
if ("ST_SESSION" !== kt(e)) {
|
|
2784
2789
|
if (It(e, s, R.EVF_PUBLIC_EVENT)) {
|
|
2785
2790
|
if (!(Vt(e, s, i, e) < 0)) return 0;
|
|
2786
|
-
} else
|
|
2787
|
-
return
|
|
2791
|
+
} else jn(`${et(e)}: event UNKNOWN in not-session state ${s}`);
|
|
2792
|
+
return xl(e), -1;
|
|
2788
2793
|
}
|
|
2789
2794
|
o = null;
|
|
2790
|
-
let _ =
|
|
2791
|
-
if (u.toLowerCase() !== ze().toLowerCase()) return
|
|
2792
|
-
let c =
|
|
2793
|
-
if ("__subscribing__" === _) return
|
|
2794
|
-
if ("__unsubscribing__" === _) return
|
|
2795
|
+
let _ = qr(e, i), a = Br(e, i, Pl), u = wr(e, a, "dst_role", "");
|
|
2796
|
+
if (u.toLowerCase() !== ze().toLowerCase()) return jn(`"It's not my role, dst_role: ${u}, my_role: ${ze()}`), 0;
|
|
2797
|
+
let c = wr(e, a, "dst_service", "");
|
|
2798
|
+
if ("__subscribing__" === _) return On(`${et(e)}: subscription event ignored, I'm client (service: ${c}, event: ${s})`), -1;
|
|
2799
|
+
if ("__unsubscribing__" === _) return On(`${et(e)}: unsubscription event ignored, I'm client (service: ${c}, event: ${s})`), -1;
|
|
2795
2800
|
if (It(e, s, R.EVF_PUBLIC_EVENT)) return Vt(e, s, i, e), 0;
|
|
2796
|
-
if (!
|
|
2801
|
+
if (!fr(c)) {
|
|
2797
2802
|
let t = we(c, !1);
|
|
2798
|
-
return t ? It(t, s, R.EVF_PUBLIC_EVENT) ? (Vt(t, s, i, e), 0) : (
|
|
2803
|
+
return t ? It(t, s, R.EVF_PUBLIC_EVENT) ? (Vt(t, s, i, e), 0) : (jn(`${et(e)}: Service found but no event or not public, service '${et(t)}', ev '${s}'`), -1) : (On(`${et(e)}: event for a service that is gone, DROPPED: service '${c}', ev '${s}'`), 0);
|
|
2799
2804
|
}
|
|
2800
2805
|
return lt(e) ? Vt(nt(e), s, i, e) : Xt(e, s, i), 0;
|
|
2801
2806
|
}
|
|
2802
|
-
function
|
|
2807
|
+
function ro(e, t, n, r) {
|
|
2803
2808
|
return 0;
|
|
2804
2809
|
}
|
|
2805
|
-
function
|
|
2810
|
+
function lo(e, t, n, r) {
|
|
2806
2811
|
return 0;
|
|
2807
2812
|
}
|
|
2808
|
-
var
|
|
2813
|
+
var oo = {
|
|
2809
2814
|
mt_create: function(e) {
|
|
2810
2815
|
let t = e.priv;
|
|
2811
2816
|
t.gobj_timer = Ce(Xe(e), "C_TIMER", {}, e), t.ws_seq = 0, t.url = jt(e, "url"), t.remote_yuno_name = jt(e, "remote_yuno_name"), t.remote_yuno_role = jt(e, "remote_yuno_role"), t.remote_yuno_service = jt(e, "remote_yuno_service"), Rt(e, "wanted_yuno_name", t.remote_yuno_name), Rt(e, "wanted_yuno_role", t.remote_yuno_role), Rt(e, "wanted_yuno_service", t.remote_yuno_service);
|
|
@@ -2835,52 +2840,52 @@
|
|
|
2835
2840
|
code: 1e3,
|
|
2836
2841
|
reason: "restarted",
|
|
2837
2842
|
was_clean: !0
|
|
2838
|
-
}, e),
|
|
2843
|
+
}, e), Nl(t.gobj_timer)), t.websocket = Wl(e), 0;
|
|
2839
2844
|
},
|
|
2840
2845
|
mt_stop: function(e) {
|
|
2841
2846
|
let t = e.priv;
|
|
2842
|
-
return
|
|
2847
|
+
return Nl(t.gobj_timer), t.websocket && xl(e), 0;
|
|
2843
2848
|
},
|
|
2844
2849
|
mt_destroy: function(e) {},
|
|
2845
2850
|
mt_stats: function(e, t, n, r) {
|
|
2846
|
-
if ("ST_SESSION" !== kt(e)) return
|
|
2851
|
+
if ("ST_SESSION" !== kt(e)) return jn("Not in session"), null;
|
|
2847
2852
|
n || (n = {});
|
|
2848
|
-
let l =
|
|
2849
|
-
return o || (o = {}),
|
|
2853
|
+
let l = Jl(e, Xe(r), wr(e, n, "service", null, 0)), o = Rr(e, n, "__md_stats__", null, Zt.KW_EXTRACT);
|
|
2854
|
+
return o || (o = {}), Yr(e, n, "stats_stack", {
|
|
2850
2855
|
stats: t,
|
|
2851
2856
|
kw: o
|
|
2852
|
-
}),
|
|
2857
|
+
}), Yr(e, n, Pl, l), n.__stats__ = t, Jr(e, n, "__stats__"), Bl(e, "EV_MT_STATS", n, r), null;
|
|
2853
2858
|
},
|
|
2854
2859
|
mt_command_parser: function(e, t, n, r) {
|
|
2855
|
-
if ("ST_SESSION" !== kt(e)) return
|
|
2860
|
+
if ("ST_SESSION" !== kt(e)) return jn("Not in session"), null;
|
|
2856
2861
|
n || (n = {});
|
|
2857
|
-
let l =
|
|
2858
|
-
return o || (o = {}),
|
|
2862
|
+
let l = Jl(e, Xe(r), wr(e, n, "service", "", 0)), o = Rr(e, n, "__md_command__", null, Zt.KW_EXTRACT);
|
|
2863
|
+
return o || (o = {}), Yr(e, n, "command_stack", {
|
|
2859
2864
|
command: t,
|
|
2860
2865
|
kw: o
|
|
2861
|
-
}),
|
|
2866
|
+
}), Yr(e, n, Pl, l), n.__command__ = t, Jr(e, n, "__command__"), Bl(e, "EV_MT_COMMAND", n, r), null;
|
|
2862
2867
|
},
|
|
2863
2868
|
mt_inject_event: function(e, t, n, r) {
|
|
2864
2869
|
if ("ST_SESSION" !== kt(e)) return window.console.error("Not in session"), -1;
|
|
2865
|
-
if (n =
|
|
2870
|
+
if (n = Yn({}, lr(n) ? n : {}), lr(n.__md_iev__) && (n.__md_iev__ = xn(n.__md_iev__)), Br(e, n, Pl));
|
|
2866
2871
|
else {
|
|
2867
|
-
let l =
|
|
2868
|
-
|
|
2872
|
+
let l = Jl(e, Xe(r), wr(e, n, "__service__", 0, 0));
|
|
2873
|
+
Hn(n, "__service__"), Yr(e, n, "__message__", t), Yr(e, n, Pl, l);
|
|
2869
2874
|
}
|
|
2870
|
-
return
|
|
2875
|
+
return Jr(e, n, "__message__"), Bl(e, t, n, r);
|
|
2871
2876
|
},
|
|
2872
2877
|
mt_subscription_added: function(e, t) {
|
|
2873
2878
|
let n = e.priv;
|
|
2874
|
-
return "ST_SESSION" === kt(e) && n.websocket ? n.inside_on_open ? 0 :
|
|
2879
|
+
return "ST_SESSION" === kt(e) && n.websocket ? n.inside_on_open ? 0 : Hl(e, t) : 0;
|
|
2875
2880
|
},
|
|
2876
2881
|
mt_subscription_deleted: function(e, t) {
|
|
2877
2882
|
let n = e.priv;
|
|
2878
2883
|
if ("ST_SESSION" !== kt(e) || !n.websocket) return 0;
|
|
2879
2884
|
if (n.inside_on_open) return 0;
|
|
2880
|
-
if (
|
|
2885
|
+
if (fr(t.event)) return 0;
|
|
2881
2886
|
let r = {}, l = t.__global__, o = t.__config__, s = t.__filter__, i = t.__service__, _ = t.subscriber;
|
|
2882
2887
|
o && (r.__config__ = o), l && (r.__global__ = l), s && (r.__filter__ = s);
|
|
2883
|
-
return
|
|
2888
|
+
return Yr(e, r, Pl, Jl(e, Xe(_), i)), Jr(e, r, "__unsubscribing__"), Bl(e, t.event, r, e);
|
|
2884
2889
|
}
|
|
2885
2890
|
};
|
|
2886
2891
|
e.GObj = S, e.SDATA = j, e.SDATAAUTHZ = (e, t, n, r, l, o) => new T(e, t, n, null, o, r, null, 0, null, l, null), e.SDATACM = (e, t, n, r, l, o) => new T(e, t, 0, null, o, n, null, 0, l, r, null), e.SDATACM2 = (e, t, n, r, l, o, s) => new T(e, t, n, null, s, r, null, 0, o, l, null), e.SDATADF = (e, t, n, r, l, o) => new T(e, t, n, null, o, null, r, l), e.SDATAPM = (e, t, n, r, l) => new T(e, t, n, r, l), e.SDATAPM0 = (e, t, n, r, l) => new T(e, t, n, null, l, null, null, 0, null, null, r), e.SDATA_END = v, e.SDataDesc = T, e.YUNETA_VERSION = s, Object.defineProperty(e, "__yuno__", {
|
|
@@ -2894,55 +2899,55 @@
|
|
|
2894
2899
|
return t;
|
|
2895
2900
|
}, e.build_stats_response = o, e.clean_name = function(e) {
|
|
2896
2901
|
return e.replace(/[?# ^:]/g, "_");
|
|
2897
|
-
}, e.clear_timeout =
|
|
2902
|
+
}, e.clear_timeout = Nl, e.cmp_two_simple_json = pr, e.command_parser = function(e, t, n, r) {}, e.createElement2 = function e(t, n) {
|
|
2898
2903
|
let [r, l, o, s] = t;
|
|
2899
|
-
if (!r) return void
|
|
2904
|
+
if (!r) return void jn("Tag must be a valid HTML element.");
|
|
2900
2905
|
let i = document.createElement(r), _ = "";
|
|
2901
2906
|
if (l && "object" == typeof l) for (let e of Object.keys(l)) if ("style" === e && "object" == typeof l[e]) {
|
|
2902
2907
|
let t = "";
|
|
2903
2908
|
for (const n of Object.keys(l[e])) t += `${n}: ${l[e][n]};`;
|
|
2904
2909
|
i.style.cssText = t;
|
|
2905
2910
|
} else "style" === e ? i.style.cssText = l[e] : "i18n" === e || "data-i18n" === e || "data_i18next" === e || "data-i18next" === e ? null !== l[e] && void 0 !== l[e] && (_ = l[e], i.setAttribute("data-i18n", _)) : i.setAttribute(e, l[e]);
|
|
2906
|
-
if (
|
|
2907
|
-
else if (
|
|
2911
|
+
if (el(o)) i.appendChild(tl(o));
|
|
2912
|
+
else if (sr(o)) if (o = o.trim(), o.length > 0 && "<" === o[0] && !nl) i.appendChild(ll(o));
|
|
2908
2913
|
else if (o.length > 0 && "<" === o[0] && function(e) {
|
|
2909
|
-
if (
|
|
2914
|
+
if (rl.size >= 100) return;
|
|
2910
2915
|
const t = e.slice(0, 80);
|
|
2911
|
-
|
|
2916
|
+
rl.has(t) || (rl.add(t), On(`createElement2: a string that starts with '<' is TEXT (set_strings_are_text): use html_markup() if it is markup: ${JSON.stringify(t)}`));
|
|
2912
2917
|
}(o), n && _) i.textContent = n(_) || o;
|
|
2913
2918
|
else i.textContent = o;
|
|
2914
|
-
else if (
|
|
2915
|
-
if (o.length > 0) if (
|
|
2916
|
-
else for (let t of o) Array.isArray(t) ? t.length > 0 && i.appendChild(e(t, n)) : t instanceof Node ? i.appendChild(t) :
|
|
2917
|
-
} else o instanceof HTMLElement || o instanceof Text || o instanceof SVGElement ? i.appendChild(o) : null != o && (
|
|
2919
|
+
else if (or(o)) {
|
|
2920
|
+
if (o.length > 0) if (sr(o[0])) i.appendChild(e(o, n));
|
|
2921
|
+
else for (let t of o) Array.isArray(t) ? t.length > 0 && i.appendChild(e(t, n)) : t instanceof Node ? i.appendChild(t) : el(t) ? i.appendChild(tl(t)) : sr(t) ? i.appendChild(document.createTextNode(t)) : null != t && !1 !== t && jn("createElement2: child ignored, type " + typeof t);
|
|
2922
|
+
} else o instanceof HTMLElement || o instanceof Text || o instanceof SVGElement ? i.appendChild(o) : null != o && (jn("content ignored"), Nn(o));
|
|
2918
2923
|
if (s && "object" == typeof s) for (const e of Object.keys(s)) i.addEventListener(e, s[e]);
|
|
2919
2924
|
return i;
|
|
2920
|
-
}, e.createOneHtml =
|
|
2921
|
-
let n =
|
|
2922
|
-
return
|
|
2925
|
+
}, e.createOneHtml = ll, e.create_json_record = function(e, t) {
|
|
2926
|
+
let n = xn(e);
|
|
2927
|
+
return Bn(n, t), n;
|
|
2923
2928
|
}, e.create_template_record = function(e, t) {
|
|
2924
2929
|
let n = {};
|
|
2925
2930
|
return t || (t = {}), Object.entries(e).forEach(([e, r]) => {
|
|
2926
2931
|
let l;
|
|
2927
|
-
|
|
2928
|
-
let o =
|
|
2929
|
-
|
|
2932
|
+
lr(r) && (l = r.default);
|
|
2933
|
+
let o = Rr(null, t, e, l);
|
|
2934
|
+
zn(n, e, o);
|
|
2930
2935
|
}), n;
|
|
2931
|
-
}, e.current_timestamp =
|
|
2932
|
-
let n =
|
|
2933
|
-
return n &&
|
|
2936
|
+
}, e.current_timestamp = ol, e.data_type_t = y, e.db_list_persistent_attrs = function(e, t) {
|
|
2937
|
+
let n = Pr(dl(e), null, !1), r = {};
|
|
2938
|
+
return n && lr(n) && (r = Cr(e, n, t, !1)), r;
|
|
2934
2939
|
}, e.db_load_persistent_attrs = function(e, t) {
|
|
2935
|
-
let n = Et(e, E.SDF_PERSIST), r =
|
|
2936
|
-
if (r &&
|
|
2937
|
-
let l =
|
|
2938
|
-
l =
|
|
2940
|
+
let n = Et(e, E.SDF_PERSIST), r = Pr(dl(e), null, !1);
|
|
2941
|
+
if (r && lr(r)) {
|
|
2942
|
+
let l = Cr(e, r, t, !1);
|
|
2943
|
+
l = Cr(e, l, n, !1), wt(e, l, E.SDF_PERSIST);
|
|
2939
2944
|
}
|
|
2940
2945
|
}, e.db_remove_persistent_attrs = function(e, t) {
|
|
2941
|
-
let n =
|
|
2942
|
-
0 ===
|
|
2946
|
+
let n = Lr(e, Pr(dl(e), null, !1), t, !1);
|
|
2947
|
+
0 === tr(n) ? Fr(dl(e)) : Ur(dl(e), n);
|
|
2943
2948
|
}, e.db_save_persistent_attrs = function(e, t) {
|
|
2944
|
-
let n =
|
|
2945
|
-
return r &&
|
|
2949
|
+
let n = Cr(e, Et(e, E.SDF_PERSIST), t, !1), r = Pr(dl(e), null, !1);
|
|
2950
|
+
return r && lr(r) && Jn(n, r), Ur(dl(e), n);
|
|
2946
2951
|
}, e.debounce = function(e, t = 0, n = !1) {
|
|
2947
2952
|
let r = null, l = null, o = null;
|
|
2948
2953
|
const s = (...s) => {
|
|
@@ -2962,24 +2967,24 @@
|
|
|
2962
2967
|
return !1;
|
|
2963
2968
|
}, e.duplicate_objects = function(...e) {
|
|
2964
2969
|
const t = {};
|
|
2965
|
-
for (const n of e)
|
|
2970
|
+
for (const n of e) Yn(t, structuredClone(n));
|
|
2966
2971
|
return t;
|
|
2967
2972
|
}, e.empty_json = function(e) {
|
|
2968
|
-
return 0 ===
|
|
2969
|
-
}, e.empty_string =
|
|
2973
|
+
return 0 === rr(e);
|
|
2974
|
+
}, e.empty_string = fr, e.escapeHtml = Xr, e.event_flag_t = R, e.flat2json = function(e) {
|
|
2970
2975
|
if (null === e || "object" != typeof e || Array.isArray(e)) throw new Error("flat2json: a flat json is an object of id -> value");
|
|
2971
2976
|
let t = null;
|
|
2972
2977
|
for (const n of Object.keys(e)) {
|
|
2973
|
-
const r =
|
|
2978
|
+
const r = fl(n);
|
|
2974
2979
|
if (!r || 0 === r.length) throw new Error(`flat2json: malformed flat id: '${n}'`);
|
|
2975
|
-
if (r.length >
|
|
2980
|
+
if (r.length > al) throw new Error(`flat2json: '${n}' deeper than 256`);
|
|
2976
2981
|
const l = "number" == typeof r[0];
|
|
2977
2982
|
if (null === t) t = l ? [] : {};
|
|
2978
2983
|
else if (l !== Array.isArray(t)) throw new Error(`flat2json: '${n}' does not fit a ${Array.isArray(t) ? "array" : "object"} root`);
|
|
2979
2984
|
let o = t;
|
|
2980
2985
|
for (let t = 0; t < r.length; t++) {
|
|
2981
2986
|
const l = r[t], s = "number" == typeof l, i = t === r.length - 1, _ = !i && "number" == typeof r[t + 1];
|
|
2982
|
-
if (s && l >
|
|
2987
|
+
if (s && l > ul) throw new Error(`flat2json: array index ${l} over the limit (100000) in '${n}'`);
|
|
2983
2988
|
if (s !== Array.isArray(o)) throw new Error(`flat2json: '${n}' uses a ${s ? "array index" : "key"} where the tree already has a ${Array.isArray(o) ? "array" : "object"}`);
|
|
2984
2989
|
if (i) {
|
|
2985
2990
|
if (Array.isArray(o)) {
|
|
@@ -2987,7 +2992,7 @@
|
|
|
2987
2992
|
o[l] = e[n];
|
|
2988
2993
|
} else {
|
|
2989
2994
|
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`);
|
|
2990
|
-
|
|
2995
|
+
Er(o, l, e[n]);
|
|
2991
2996
|
}
|
|
2992
2997
|
break;
|
|
2993
2998
|
}
|
|
@@ -2995,7 +3000,7 @@
|
|
|
2995
3000
|
if (Array.isArray(o)) {
|
|
2996
3001
|
for (; o.length <= l;) o.push(null);
|
|
2997
3002
|
a = o[l], null == a && (a = _ ? [] : {}, o[l] = a);
|
|
2998
|
-
} else a =
|
|
3003
|
+
} else a = yr(o, l) ? void 0 : o[l], void 0 === a && (a = _ ? [] : {}, Er(o, l, a));
|
|
2999
3004
|
if (null === a || "object" != typeof a) throw new Error(`flat2json: '${n}' walks through a value: the same id is a leaf and a container at once`);
|
|
3000
3005
|
if (_ !== Array.isArray(a)) throw new Error(`flat2json: '${n}' needs a ${_ ? "array" : "object"} where the tree already has a ${Array.isArray(a) ? "array" : "object"}`);
|
|
3001
3006
|
o = a;
|
|
@@ -3006,11 +3011,11 @@
|
|
|
3006
3011
|
if (null === e || "object" != typeof e || Array.isArray(e)) throw new Error("flat_apply: a flat json is an object of id -> value");
|
|
3007
3012
|
if (null === t || "object" != typeof t) throw new Error("flat_apply: a diff is the object flat_diff() answers");
|
|
3008
3013
|
for (const n of Object.keys(t.removed || {})) delete e[n];
|
|
3009
|
-
for (const n of Object.keys(t.added || {}))
|
|
3014
|
+
for (const n of Object.keys(t.added || {})) Er(e, n, t.added[n]);
|
|
3010
3015
|
for (const n of Object.keys(t.changed || {})) {
|
|
3011
3016
|
const r = t.changed[n];
|
|
3012
3017
|
if (!r || !Object.prototype.hasOwnProperty.call(r, "to")) throw new Error(`flat_apply: changed '${n}' without a 'to'`);
|
|
3013
|
-
|
|
3018
|
+
Er(e, n, r.to);
|
|
3014
3019
|
}
|
|
3015
3020
|
return e;
|
|
3016
3021
|
}, e.flat_diff = function(e, t) {
|
|
@@ -3019,15 +3024,15 @@
|
|
|
3019
3024
|
removed: {},
|
|
3020
3025
|
changed: {}
|
|
3021
3026
|
};
|
|
3022
|
-
for (const e of Object.keys(n)) Object.prototype.hasOwnProperty.call(r, e) ?
|
|
3027
|
+
for (const e of Object.keys(n)) Object.prototype.hasOwnProperty.call(r, e) ? gl(n[e], r[e]) || Er(l.changed, e, {
|
|
3023
3028
|
from: n[e],
|
|
3024
3029
|
to: r[e]
|
|
3025
|
-
}) :
|
|
3026
|
-
for (const e of Object.keys(r)) Object.prototype.hasOwnProperty.call(n, e) ||
|
|
3030
|
+
}) : Er(l.removed, e, n[e]);
|
|
3031
|
+
for (const e of Object.keys(r)) Object.prototype.hasOwnProperty.call(n, e) || Er(l.added, e, r[e]);
|
|
3027
3032
|
return l;
|
|
3028
3033
|
}, e.flat_key_join = function(e) {
|
|
3029
|
-
return Array.isArray(e) && 0 !== e.length ? e.map((e) => "number" == typeof e ? `[${e}]` :
|
|
3030
|
-
}, e.flat_key_split =
|
|
3034
|
+
return Array.isArray(e) && 0 !== e.length ? e.map((e) => "number" == typeof e ? `[${e}]` : cl(e)).join("`") : "";
|
|
3035
|
+
}, e.flat_key_split = fl, e.gclass_add_ev_action = ye, e.gclass_add_event_type = Te, e.gclass_add_state = he, e.gclass_check_fsm = je, e.gclass_create = de, e.gclass_event_type = ve, e.gclass_find_by_name = Oe, e.gclass_flag_t = w, e.gclass_unregister = be, e.getPositionRelativeToBody = function(e) {
|
|
3031
3036
|
if (!e) return {
|
|
3032
3037
|
top: 0,
|
|
3033
3038
|
left: 0,
|
|
@@ -3046,17 +3051,17 @@
|
|
|
3046
3051
|
right: n + i + r,
|
|
3047
3052
|
bottom: t + s + l
|
|
3048
3053
|
};
|
|
3049
|
-
}, e.get_function_name =
|
|
3054
|
+
}, e.get_function_name = _l, e.get_now = function() {
|
|
3050
3055
|
return Math.floor(Date.now() / 1e3);
|
|
3051
3056
|
}, e.gobj_bottom_gobj = st, e.gobj_change_parent = function(e, t) {
|
|
3052
|
-
return ot(e) ? (
|
|
3057
|
+
return ot(e) ? (jn("gobj NULL or DESTROYED"), null) : t instanceof S ? (e.parent && e.parent.gclass.gmt.mt_child_removed && e.parent.gclass.gmt.mt_child_removed(e.parent, e), e.parent && (Re(e.parent, e), e.parent = null), $e(t, e), t.gclass.gmt.mt_child_added && (Y(e) && Sn(n("👦👦🔵 child_added(%s): %s", tt(t), et(e))), t.gclass.gmt.mt_child_added(t, e)), 0) : (jn(`${et(e)}: gobj_change_parent() BAD TYPE of parent`), -1);
|
|
3053
3058
|
}, e.gobj_change_state = Dt, e.gobj_command = function(e, t, r, o) {
|
|
3054
|
-
if (ot(e)) return
|
|
3059
|
+
if (ot(e)) return jn("gobj NULL or DESTROYED"), -1;
|
|
3055
3060
|
if (function(e) {
|
|
3056
3061
|
return G > 1 || !!e && !!(x(e) & P.TRACE_COMMANDS);
|
|
3057
3062
|
}(e) || H(e, null) && !z(o, null)) {
|
|
3058
|
-
let l =
|
|
3059
|
-
L(n("🌀🌀 mach(%s%s), cmd: %s, src: %s", Ke(e) ? "" : "!!", et(e), null !== l ? l : t, et(o))), q(e) &&
|
|
3063
|
+
let l = Pn(t);
|
|
3064
|
+
L(n("🌀🌀 mach(%s%s), cmd: %s, src: %s", Ke(e) ? "" : "!!", et(e), null !== l ? l : t, et(o))), q(e) && Wn(r);
|
|
3060
3065
|
}
|
|
3061
3066
|
return e.gclass.gmt.mt_command_parser ? e.gclass.gmt.mt_command_parser(e, t, r, o) : e.gclass.command_table ? c ? c(e, t, r, o) : l(0, -1, n("%s: global command parser not available", et(e)), 0, 0) : l(0, -1, n("%s: command table not available", et(e)), 0, 0);
|
|
3062
3067
|
}, e.gobj_create = function(e, t, n, r) {
|
|
@@ -3070,7 +3075,7 @@
|
|
|
3070
3075
|
}, e.gobj_create_yuno = function(e, t, n) {
|
|
3071
3076
|
return Ie(e, t, n, null, N.gobj_flag_yuno);
|
|
3072
3077
|
}, e.gobj_current_state = kt, e.gobj_default_service = Se, e.gobj_deliver_posted_events = Ft, e.gobj_destroy = Le, e.gobj_find_child = pt, e.gobj_find_gobj = function(e, t) {
|
|
3073
|
-
if (
|
|
3078
|
+
if (fr(t)) return null;
|
|
3074
3079
|
const n = t.toLowerCase();
|
|
3075
3080
|
return "__default_service__" === n ? m : "__yuno__" === n || "__root__" === n ? p : mt(p, t);
|
|
3076
3081
|
}, e.gobj_find_service = we, e.gobj_find_subscribings = Qt, e.gobj_find_subscriptions = zt, e.gobj_flag_t = N, e.gobj_full_name = tt, e.gobj_gclass_name = Ze, e.gobj_get_gclass_trace_level = re, e.gobj_get_gclass_trace_level2 = le, e.gobj_get_gclass_trace_no_level = oe, e.gobj_get_global_trace_level = te, e.gobj_get_global_trace_no_level = ne, e.gobj_global_trace_level = function() {
|
|
@@ -3082,24 +3087,24 @@
|
|
|
3082
3087
|
}, e.gobj_list_subscriptions = function(e) {
|
|
3083
3088
|
let t = zt(e, null, null, null);
|
|
3084
3089
|
for (let n = 0; n < t.length; n++) {
|
|
3085
|
-
let r = t[n], l =
|
|
3086
|
-
|
|
3090
|
+
let r = t[n], l = Nr(e, r, "publisher", null, Zt.KW_REQUIRED), o = Nr(e, r, "subscriber", null, Zt.KW_REQUIRED);
|
|
3091
|
+
Qn(r, "s_event", wr(e, r, "event", "", Zt.KW_REQUIRED)), Qn(r, "s_publisher", et(l)), Qn(r, "s_subscriber", et(o));
|
|
3087
3092
|
}
|
|
3088
3093
|
let n = Qt(e, 0, null, 0);
|
|
3089
3094
|
for (let t = 0; t < n.length; t++) {
|
|
3090
|
-
let r = n[t], l =
|
|
3091
|
-
|
|
3095
|
+
let r = n[t], l = Nr(e, r, "publisher", null, Zt.KW_REQUIRED), o = Nr(e, r, "subscriber", null, Zt.KW_REQUIRED);
|
|
3096
|
+
Qn(r, "s_event", wr(e, r, "event", "", Zt.KW_REQUIRED)), Qn(r, "s_publisher", et(l)), Qn(r, "s_subscriber", et(o));
|
|
3092
3097
|
}
|
|
3093
3098
|
return {
|
|
3094
3099
|
subscriptions: t,
|
|
3095
3100
|
subscribings: n,
|
|
3096
|
-
"total subscriptions":
|
|
3097
|
-
total_subscribings:
|
|
3101
|
+
"total subscriptions": nr(t),
|
|
3102
|
+
total_subscribings: nr(n)
|
|
3098
3103
|
};
|
|
3099
3104
|
}, e.gobj_load_persistent_attrs = function(e, t) {
|
|
3100
|
-
return Be(e) ? i ? i(e, t) : -1 : (
|
|
3105
|
+
return Be(e) ? i ? i(e, t) : -1 : (jn(`${et(e)}: Only gobj services can load/save writable-persistent`), -1);
|
|
3101
3106
|
}, e.gobj_match_children = function(e, t) {
|
|
3102
|
-
if (ot(e)) return
|
|
3107
|
+
if (ot(e)) return jn("gobj NULL or DESTROYED"), null;
|
|
3103
3108
|
t = t || {};
|
|
3104
3109
|
let n = [];
|
|
3105
3110
|
const r = e.dl_children;
|
|
@@ -3121,7 +3126,7 @@
|
|
|
3121
3126
|
}, e.gobj_match_gobj = bt, e.gobj_name = Xe, e.gobj_parent = nt, e.gobj_pause = xe, e.gobj_play = We, e.gobj_post_event = Ut, e.gobj_posted_events_size = function() {
|
|
3122
3127
|
return Lt.length;
|
|
3123
3128
|
}, e.gobj_publish_event = Xt, e.gobj_read_attr = yt, e.gobj_read_attrs = Et, e.gobj_read_bool_attr = Tt, e.gobj_read_integer_attr = vt, e.gobj_read_pointer_attr = Ot, e.gobj_read_str_attr = jt, e.gobj_remove_persistent_attrs = function(e, t) {
|
|
3124
|
-
return Be(e) ? a ? a(e, t) : -1 : (
|
|
3129
|
+
return Be(e) ? a ? a(e, t) : -1 : (jn(`${et(e)}: Only gobj services can load/save writable-persistent`), -1);
|
|
3125
3130
|
}, e.gobj_repr_global_trace_levels = function() {
|
|
3126
3131
|
return U.map(([e, t, n]) => ({
|
|
3127
3132
|
name: e,
|
|
@@ -3131,34 +3136,34 @@
|
|
|
3131
3136
|
}));
|
|
3132
3137
|
}, e.gobj_reset_volatil_attrs = function(e) {
|
|
3133
3138
|
return function(e, t, n) {
|
|
3134
|
-
if (ot(e)) return
|
|
3139
|
+
if (ot(e)) return jn("gobj NULL or DESTROYED"), -1;
|
|
3135
3140
|
let r = e.gclass.attrs_table;
|
|
3136
3141
|
for (let l = 0; l < r.length; l++) {
|
|
3137
3142
|
const o = r[l];
|
|
3138
|
-
o.name && (n && o.flag & n || (-1 === t || o.flag & t) && (ae(e, e.jn_attrs, o),
|
|
3143
|
+
o.name && (n && o.flag & n || (-1 === t || o.flag & t) && (ae(e, e.jn_attrs, o), lr(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)));
|
|
3139
3144
|
}
|
|
3140
3145
|
return 0;
|
|
3141
3146
|
}(e, E.SDF_VOLATIL, 0);
|
|
3142
3147
|
}, e.gobj_save_persistent_attrs = De, e.gobj_search_path = mt, e.gobj_send_event = Vt, e.gobj_services = function() {
|
|
3143
3148
|
let e = [];
|
|
3144
|
-
for (const t of Object.keys(b))
|
|
3149
|
+
for (const t of Object.keys(b)) Zn(e, t);
|
|
3145
3150
|
return e;
|
|
3146
3151
|
}, e.gobj_set_bottom_gobj = it, e.gobj_set_deep_trace = function(e) {
|
|
3147
3152
|
return G = Number(e) || 0, 0;
|
|
3148
3153
|
}, e.gobj_set_gclass_no_trace = ie, e.gobj_set_gclass_trace = se, e.gobj_set_global_no_trace = X, e.gobj_set_global_no_trace2 = ee, e.gobj_set_global_trace = Q, e.gobj_set_global_trace2 = Z, e.gobj_set_gobj_no_trace = function(e, t, n) {
|
|
3149
|
-
if (!e) return
|
|
3154
|
+
if (!e) return jn("gobj_set_gobj_no_trace: gobj NULL"), -1;
|
|
3150
3155
|
const r = W(t, "gobj_set_gobj_no_trace", e.gclass && e.gclass.s_user_trace_level || null);
|
|
3151
3156
|
return r ? (n ? e.no_trace_level |= r : e.no_trace_level &= ~r, 0) : -1;
|
|
3152
3157
|
}, e.gobj_set_gobj_trace = function(e, t, n) {
|
|
3153
|
-
if (!e) return
|
|
3158
|
+
if (!e) return jn("gobj_set_gobj_trace: gobj NULL"), -1;
|
|
3154
3159
|
const r = W(t, "gobj_set_gobj_trace", e.gclass && e.gclass.s_user_trace_level || null);
|
|
3155
3160
|
return r ? (n ? e.trace_level |= r : e.trace_level &= ~r, 0) : -1;
|
|
3156
3161
|
}, e.gobj_set_trace_machine_format = function(e) {
|
|
3157
3162
|
C = 1 === Number(e) ? 1 : 0;
|
|
3158
3163
|
}, e.gobj_short_name = et, e.gobj_start = Pe, e.gobj_start_children = function(e) {
|
|
3159
|
-
return ot(e) ? (
|
|
3164
|
+
return ot(e) ? (jn("gobj NULL or DESTROYED"), -1) : at(e, D.WALK_FIRST2LAST, Ue, 0, 0);
|
|
3160
3165
|
}, e.gobj_start_tree = function(e) {
|
|
3161
|
-
return ot(e) ? (
|
|
3166
|
+
return ot(e) ? (jn("gobj NULL or DESTROYED"), -1) : (J(e) && L(n("⏺ ⏺ ⏺ ⏺ start_tree: %s", tt(e))), e.gclass.gclass_flag & w.gcflag_manual_start || e.disabled ? 0 : (e.running || Pe(e), ut(e, D.WALK_TOP2BOTTOM, Fe, 0, 0)));
|
|
3162
3167
|
}, e.gobj_start_up = function(e, t, n, r, l, o, s) {
|
|
3163
3168
|
i = t, _ = n, a = r, u = l, c = o, f = s;
|
|
3164
3169
|
const d = [["EV_STATE_CHANGED", R.EVF_SYSTEM_EVENT | R.EVF_OUTPUT_EVENT | R.EVF_NO_WARN_SUBS], [0, 0]];
|
|
@@ -3168,14 +3173,14 @@
|
|
|
3168
3173
|
}
|
|
3169
3174
|
return 0;
|
|
3170
3175
|
}, e.gobj_stats = function(e, t, r, l) {
|
|
3171
|
-
return ot(e) ? (
|
|
3176
|
+
return ot(e) ? (jn("gobj NULL or DESTROYED"), -1) : e.gclass.gmt.mt_stats ? e.gclass.gmt.mt_stats(e, t, r, l) : f ? f(e, t, r, l) : o(0, -1, n("%s, stats parser not available", et(e)), 0, 0);
|
|
3172
3177
|
}, e.gobj_stop = Ve, e.gobj_stop_children = Me, e.gobj_stop_tree = function(e) {
|
|
3173
|
-
return ot(e) ? (
|
|
3178
|
+
return ot(e) ? (jn("gobj NULL or DESTROYED"), -1) : (J(e) && L(n("⏹ ⏹ ⏹ ⏹ stop_tree: %s", tt(e))), Ke(e) && Ve(e), ut(e, D.WALK_TOP2BOTTOM, Ge, 0, 0));
|
|
3174
3179
|
}, e.gobj_subscribe_event = qt, e.gobj_trace_level = x, e.gobj_trace_machine_format = function() {
|
|
3175
3180
|
return C;
|
|
3176
3181
|
}, e.gobj_trace_no_level = K, e.gobj_unsubscribe_event = function(e, t, n, r) {
|
|
3177
|
-
if (null == n && (n = {}), !e) return
|
|
3178
|
-
if (!r) return
|
|
3182
|
+
if (null == n && (n = {}), !e) return jn(`publisher NULL: ev ${t}`), 0;
|
|
3183
|
+
if (!r) return jn(`subscriber NULL: ev ${t}`), 0;
|
|
3179
3184
|
const l = /* @__PURE__ */ new Set([
|
|
3180
3185
|
"__config__",
|
|
3181
3186
|
"__global__",
|
|
@@ -3184,83 +3189,83 @@
|
|
|
3184
3189
|
"__service__"
|
|
3185
3190
|
]);
|
|
3186
3191
|
if (Object.keys(n).forEach((n) => {
|
|
3187
|
-
l.has(n) ||
|
|
3188
|
-
}),
|
|
3189
|
-
else if (!(Ct(e, t, R.EVF_OUTPUT_EVENT) || e.gclass.gclass_flag & w.gcflag_no_check_output_events)) return
|
|
3192
|
+
l.has(n) || jn(`${et(e)}: key ignored in subscription (key: ${n}, event: ${t})`);
|
|
3193
|
+
}), fr(t)) t = "";
|
|
3194
|
+
else if (!(Ct(e, t, R.EVF_OUTPUT_EVENT) || e.gclass.gclass_flag & w.gcflag_no_check_output_events)) return jn(`event NOT in output event list: ${et(e)}, ev ${t}`), 0;
|
|
3190
3195
|
let o = xt(n, t), s = Yt(e.dl_subscriptions, e, t, o.renamed_event, o.kw, r), i = 0, _ = 0, a = 0;
|
|
3191
3196
|
for (let t = 0; t < s.length; t++) {
|
|
3192
3197
|
let n = s[t], r = Jt(e, n, !1, !1);
|
|
3193
3198
|
0 === r ? i++ : r < 0 ? _++ : a++;
|
|
3194
3199
|
}
|
|
3195
|
-
return _ ?
|
|
3200
|
+
return _ ? On(`${et(e)}: Hard subscription not removed, only gobj_unsubscribe_list() with force removes it (event: ${t}, hard: ${_})`) : i || a || (On(`${et(e)}: No subscription found`), Wn(n, "No subscription found")), 0;
|
|
3196
3201
|
}, e.gobj_unsubscribe_list = Ht, e.gobj_walk_gobj_children = at, e.gobj_walk_gobj_children_tree = ut, e.gobj_write_attr = St, e.gobj_write_attrs = wt, e.gobj_write_bool_attr = Nt, e.gobj_write_integer_attr = $t, e.gobj_write_str_attr = Rt, e.gobj_yuno = qe, e.gobj_yuno_id = Qe, e.gobj_yuno_name = He, e.gobj_yuno_role = ze, e.html_markup = function(e) {
|
|
3197
|
-
return "string" != typeof e ? (
|
|
3198
|
-
}, e.id_index_in_obj_list =
|
|
3202
|
+
return "string" != typeof e ? (jn("html_markup: not a string, type " + typeof e), new Zr("")) : new Zr(e);
|
|
3203
|
+
}, e.id_index_in_obj_list = Mr, e.index_in_list = sl, e.is_array = or, e.is_boolean = _r, e.is_date = function(e) {
|
|
3199
3204
|
return e instanceof Date && !isNaN(e);
|
|
3200
|
-
}, e.is_function =
|
|
3201
|
-
if (!
|
|
3205
|
+
}, e.is_function = ur, e.is_gobj = cr, e.is_html_markup = el, e.is_metadata_key = function(e) {
|
|
3206
|
+
if (!sr(e)) return !1;
|
|
3202
3207
|
let t = 0;
|
|
3203
3208
|
for (; t < e.length && "_" === e[t] && !(t > 2); t++);
|
|
3204
3209
|
return 2 === t;
|
|
3205
|
-
}, e.is_null =
|
|
3206
|
-
if (!
|
|
3210
|
+
}, e.is_null = ar, e.is_number = ir, e.is_object = lr, e.is_private_key = function(e) {
|
|
3211
|
+
if (!sr(e)) return !1;
|
|
3207
3212
|
let t = 0;
|
|
3208
3213
|
for (; t < e.length && "_" === e[t] && !(t > 2); t++);
|
|
3209
3214
|
return 1 === t;
|
|
3210
3215
|
}, e.is_pure_number = function(e) {
|
|
3211
|
-
if (
|
|
3212
|
-
if (!
|
|
3216
|
+
if (ir(e)) return !0;
|
|
3217
|
+
if (!sr(e)) return !1;
|
|
3213
3218
|
const t = Number(e);
|
|
3214
3219
|
return !isNaN(t) && "" !== e.trim() && !isNaN(t);
|
|
3215
|
-
}, e.is_secret_name =
|
|
3216
|
-
let l =
|
|
3217
|
-
if (!l) return
|
|
3218
|
-
if (!
|
|
3219
|
-
if (!
|
|
3220
|
-
if ("" !== n && n.split("`").includes("")) return
|
|
3220
|
+
}, e.is_secret_name = kn, e.is_string = sr, e.jdb_delete = function(e, t, n, r) {
|
|
3221
|
+
let l = Rr(null, Rr(null, e, "topics", null, 0), t, null, 0);
|
|
3222
|
+
if (!l) return jn("jdb_delete: topic not found: " + t), null;
|
|
3223
|
+
if (!lr(r) || fr(r.id)) return jn(`jdb_delete: record without id: ${pn(r)}`), null;
|
|
3224
|
+
if (!sr(n)) return jn(`jdb_delete: path must be a string: ${String(n)}`), null;
|
|
3225
|
+
if ("" !== n && n.split("`").includes("")) return jn(`jdb_delete: empty segment in path: '${n}'`), null;
|
|
3221
3226
|
let o, s = n.split("`"), i = l;
|
|
3222
|
-
for (; (o = s.shift()) && !
|
|
3223
|
-
if (!i || 0 !== s.length) return
|
|
3224
|
-
let _ =
|
|
3225
|
-
return a < 0 ? (
|
|
3227
|
+
for (; (o = s.shift()) && !fr(o) && i;) lr(i) && (i = Rr(null, i, e.hook, null, 0)), i = zr(i, null, o, !1);
|
|
3228
|
+
if (!i || 0 !== s.length) return jn(`jdb_delete: path not found in topic '${t}': '${n}'`), null;
|
|
3229
|
+
let _ = or(i) ? i : Rr(null, i, e.hook, null, 0), a = Mr(_, r.id);
|
|
3230
|
+
return a < 0 ? (jn(`jdb_delete: record not found in topic '${t}': '${n}' '${r.id}'`), null) : (_.splice(a, 1), l);
|
|
3226
3231
|
}, e.jdb_get = function(e, t, n, r) {
|
|
3227
|
-
let l =
|
|
3228
|
-
return l ? (void 0 === r && (r = !0),
|
|
3232
|
+
let l = Rr(null, Rr(null, e, "topics", null, 0), t, null, 0);
|
|
3233
|
+
return l ? (void 0 === r && (r = !0), zr(l, e.hook, n, r)) : (jn("jdb_get: topic not found: " + t), null);
|
|
3229
3234
|
}, e.jdb_get_by_idx = function(e, t, n) {
|
|
3230
|
-
let r =
|
|
3231
|
-
return r ? n < r.length ? r[n] : {} : (
|
|
3235
|
+
let r = Rr(null, Rr(null, e, "topics", null, 0), t, null, 0);
|
|
3236
|
+
return r ? n < r.length ? r[n] : {} : (jn("jdb_get_by_idx: topic not found: " + t), null);
|
|
3232
3237
|
}, e.jdb_get_topic = function(e, t) {
|
|
3233
|
-
let n =
|
|
3234
|
-
if (!n) return
|
|
3235
|
-
return
|
|
3238
|
+
let n = Rr(null, e, "topics", null, 0);
|
|
3239
|
+
if (!n) return jn("jdb topics section not found"), wn(e), null;
|
|
3240
|
+
return Rr(null, n, t, null, 0) || (jn("jdb topic not found: " + t), wn(n), null);
|
|
3236
3241
|
}, e.jdb_init = function(e, t, n) {
|
|
3237
|
-
n && (e =
|
|
3238
|
-
let r =
|
|
3239
|
-
|
|
3240
|
-
let l =
|
|
3241
|
-
return
|
|
3242
|
-
"__" === t.substring(0, 2) ||
|
|
3242
|
+
n && (e = xn(e));
|
|
3243
|
+
let r = Rr(null, e, "type", [], Zt.KW_CREATE);
|
|
3244
|
+
wr(null, e, "hook", "data", Zt.KW_CREATE);
|
|
3245
|
+
let l = Rr(null, e, "schema", {}, Zt.KW_CREATE), o = Rr(null, e, "topics", {}, Zt.KW_CREATE);
|
|
3246
|
+
return Hr(l, function(e, t, n, l) {
|
|
3247
|
+
"__" === t.substring(0, 2) || lr(n) || Rr(null, o, l, xn(r), Zt.KW_CREATE);
|
|
3243
3248
|
}, t), e;
|
|
3244
3249
|
}, e.jdb_update = function(e, t, n, r) {
|
|
3245
|
-
let l =
|
|
3246
|
-
if (!l) return
|
|
3247
|
-
if (!
|
|
3248
|
-
if (!
|
|
3249
|
-
if ("" !== n && n.split("`").includes("")) return
|
|
3250
|
+
let l = Rr(null, Rr(null, e, "topics", null, 0), t, null, 0);
|
|
3251
|
+
if (!l) return jn("jdb_update: topic not found: " + t), null;
|
|
3252
|
+
if (!lr(r) || fr(r.id)) return jn(`jdb_update: record without id: ${pn(r)}`), null;
|
|
3253
|
+
if (!sr(n)) return jn(`jdb_update: path must be a string: ${String(n)}`), null;
|
|
3254
|
+
if ("" !== n && n.split("`").includes("")) return jn(`jdb_update: empty segment in path: '${n}'`), null;
|
|
3250
3255
|
let o, s, i = n.split("`"), _ = l;
|
|
3251
|
-
for (; (o = i.shift()) && !
|
|
3252
|
-
if (!_ || 0 !== i.length) return
|
|
3253
|
-
if (
|
|
3256
|
+
for (; (o = i.shift()) && !fr(o) && _;) lr(_) && (_ = Rr(null, _, e.hook, null, 0)), _ = zr(_, null, o, !1);
|
|
3257
|
+
if (!_ || 0 !== i.length) return jn(`jdb_update: path not found in topic '${t}': '${n}'`), null;
|
|
3258
|
+
if (or(_)) s = _;
|
|
3254
3259
|
else {
|
|
3255
|
-
if (_.id === r.id) return
|
|
3256
|
-
if (s =
|
|
3257
|
-
else if (!
|
|
3260
|
+
if (_.id === r.id) return Yn(_, r), l;
|
|
3261
|
+
if (s = Rr(null, _, e.hook, null, 0), null == s) s = [], zn(_, e.hook, s);
|
|
3262
|
+
else if (!or(s)) return jn(`jdb_update: the hook '${e.hook}' of '${n}' is not a list in topic '${t}'`), null;
|
|
3258
3263
|
}
|
|
3259
|
-
let a =
|
|
3260
|
-
return a ?
|
|
3264
|
+
let a = zr(s, e.hook, r.id, !1);
|
|
3265
|
+
return a ? Yn(a, r) : s.push(r), l;
|
|
3261
3266
|
}, e.json2flat = function(e) {
|
|
3262
3267
|
const t = {}, n = (e, r, l) => {
|
|
3263
|
-
if (l >
|
|
3268
|
+
if (l > al) throw new Error("json2flat: deeper than 256");
|
|
3264
3269
|
if (null === e || "object" != typeof e || Array.isArray(e)) {
|
|
3265
3270
|
if (Array.isArray(e) && e.length > 0) return void e.forEach((e, t) => {
|
|
3266
3271
|
const o = `[${t}]`;
|
|
@@ -3270,20 +3275,20 @@
|
|
|
3270
3275
|
const t = Object.keys(e);
|
|
3271
3276
|
if (t.length > 0) {
|
|
3272
3277
|
for (const o of t) {
|
|
3273
|
-
const t =
|
|
3278
|
+
const t = cl(o);
|
|
3274
3279
|
n(e[o], 0 === l ? t : r + "`" + t, l + 1);
|
|
3275
3280
|
}
|
|
3276
3281
|
return;
|
|
3277
3282
|
}
|
|
3278
3283
|
}
|
|
3279
|
-
0 !== l &&
|
|
3284
|
+
0 !== l && Er(t, r, e);
|
|
3280
3285
|
};
|
|
3281
3286
|
return null == e || n(e, "", 0), t;
|
|
3282
|
-
}, e.json_array_append =
|
|
3287
|
+
}, e.json_array_append = Xn, e.json_array_append_new = Zn, e.json_array_extend = function(e, t) {
|
|
3283
3288
|
return t ? (Array.prototype.push.apply(e, t), e) : e;
|
|
3284
|
-
}, e.json_array_remove =
|
|
3289
|
+
}, e.json_array_remove = er, e.json_array_size = nr, e.json_deep_copy = xn, e.json_is_identical = Kn, e.json_mask_secrets = Mn, e.json_object_del = Hn, e.json_object_get = qn, e.json_object_set = zn, e.json_object_set_new = Qn, e.json_object_size = tr, e.json_object_update = Yn, e.json_object_update_existing = Bn, e.json_object_update_missing = Jn, e.json_size = rr, e.jwt2json = function(e, t) {
|
|
3285
3290
|
try {
|
|
3286
|
-
let n =
|
|
3291
|
+
let n = Qr(e);
|
|
3287
3292
|
switch (t) {
|
|
3288
3293
|
case "header": return JSON.parse(n.header);
|
|
3289
3294
|
case "signature": return JSON.parse(n.signature);
|
|
@@ -3292,137 +3297,137 @@
|
|
|
3292
3297
|
} catch (e) {
|
|
3293
3298
|
return null;
|
|
3294
3299
|
}
|
|
3295
|
-
}, e.jwtDecode =
|
|
3296
|
-
if (e && !
|
|
3297
|
-
r || (r =
|
|
3300
|
+
}, e.jwtDecode = Qr, e.kw_clone_by_keys = Cr, e.kw_clone_by_not_keys = Lr, e.kw_collect = function(e, t, n, r) {
|
|
3301
|
+
if (e && !cr(e) && jn("GObj bad instanceof"), !t) return null;
|
|
3302
|
+
r || (r = Ir);
|
|
3298
3303
|
let l = [];
|
|
3299
|
-
if (
|
|
3304
|
+
if (or(t)) for (let e = 0; e < t.length; e++) {
|
|
3300
3305
|
let o = t[e];
|
|
3301
3306
|
r(o, n) && l.push(o);
|
|
3302
3307
|
}
|
|
3303
3308
|
else {
|
|
3304
|
-
if (!
|
|
3309
|
+
if (!lr(t)) return jn("kw_select() BAD kw parameter"), null;
|
|
3305
3310
|
r(t, n) && l.push(t);
|
|
3306
3311
|
}
|
|
3307
3312
|
return l;
|
|
3308
|
-
}, e.kw_delete =
|
|
3309
|
-
if (!n || !
|
|
3310
|
-
for (let e = 0; e < t.length; e++) if (
|
|
3311
|
-
return r &&
|
|
3312
|
-
}, e.kw_find_path =
|
|
3313
|
-
e && !
|
|
3314
|
-
let o =
|
|
3313
|
+
}, e.kw_delete = jr, e.kw_find_json_in_list = function(e, t, n, r) {
|
|
3314
|
+
if (!n || !or(t)) return r && jn("item NULL or kw_list is not a list"), -1;
|
|
3315
|
+
for (let e = 0; e < t.length; e++) if (Kn(n, t[e])) return e;
|
|
3316
|
+
return r && jn("item not found in this list"), -1;
|
|
3317
|
+
}, e.kw_find_path = vr, e.kw_flag_t = Zt, e.kw_get_bool = Or, e.kw_get_dict = $r, e.kw_get_dict_value = Rr, e.kw_get_int = Sr, e.kw_get_list = function(e, t, n, r, l) {
|
|
3318
|
+
e && !cr(e) && jn("GObj bad instanceof");
|
|
3319
|
+
let o = vr(e, t, n, !1);
|
|
3315
3320
|
const s = l && l & Zt.KW_REQUIRED, i = l && l & Zt.KW_CREATE, _ = l && l & Zt.KW_EXTRACT;
|
|
3316
|
-
return void 0 === o ? i &&
|
|
3317
|
-
}, e.kw_get_local_storage_value =
|
|
3318
|
-
e && !
|
|
3319
|
-
let o =
|
|
3321
|
+
return void 0 === o ? i && or(r) && t ? (Dr(e, t, n, r), r) : (s && (jn(`path not found: '${n}'`), Wn(t)), r) : or(o) ? (_ && jr(e, t, n), o) : i && null === o && or(r) ? (Dr(e, t, n, r), r) : i && null === o ? (s && (jn(`path not found: '${n}'`), Wn(t)), r) : ((s || i) && (jn(`${e ? et(e) + ": " : ""}path MUST BE a json list: '${n}'` + (i ? ", cannot create" : "")), Wn(t)), r);
|
|
3322
|
+
}, e.kw_get_local_storage_value = Pr, e.kw_get_pointer = Nr, e.kw_get_real = function(e, t, n, r, l) {
|
|
3323
|
+
e && !cr(e) && jn("GObj bad instanceof");
|
|
3324
|
+
let o = vr(e, t, n, !1);
|
|
3320
3325
|
const s = l && l & Zt.KW_REQUIRED, i = l && l & Zt.KW_CREATE, _ = l && l & Zt.KW_EXTRACT, a = l && l & Zt.KW_WILD_NUMBER;
|
|
3321
3326
|
if (void 0 === o) {
|
|
3322
3327
|
if (i && t) {
|
|
3323
3328
|
let l = Number(r);
|
|
3324
|
-
return
|
|
3329
|
+
return Dr(e, t, n, l), l;
|
|
3325
3330
|
}
|
|
3326
|
-
return s && (
|
|
3331
|
+
return s && (jn(`path not found: '${n}'`), Wn(t)), Number(r);
|
|
3327
3332
|
}
|
|
3328
3333
|
let u;
|
|
3329
|
-
if (
|
|
3334
|
+
if (ir(o)) u = o;
|
|
3330
3335
|
else {
|
|
3331
|
-
if (!a) return
|
|
3332
|
-
if (
|
|
3333
|
-
else if (
|
|
3336
|
+
if (!a) return jn(`${e ? et(e) + ": " : ""}path MUST BE a json real: '${n}'`), Wn(t), Number(r);
|
|
3337
|
+
if (_r(o)) u = o ? 1 : 0;
|
|
3338
|
+
else if (sr(o)) u = parseFloat(o), Number.isNaN(u) && (u = 0);
|
|
3334
3339
|
else {
|
|
3335
|
-
if (null !== o) return
|
|
3340
|
+
if (null !== o) return jn(`${e ? et(e) + ": " : ""}path MUST BE a simple json element: '${n}'`), Wn(t), 0;
|
|
3336
3341
|
u = 0;
|
|
3337
3342
|
}
|
|
3338
3343
|
}
|
|
3339
|
-
return _ &&
|
|
3340
|
-
}, e.kw_get_str =
|
|
3341
|
-
if (e && !
|
|
3342
|
-
r || (r =
|
|
3344
|
+
return _ && jr(e, t, n), u;
|
|
3345
|
+
}, e.kw_get_str = wr, e.kw_has_key = hr, e.kw_match_simple = Ir, e.kw_pop = mr, e.kw_remove_local_storage_value = Fr, e.kw_select = function(e, t, n, r) {
|
|
3346
|
+
if (e && !cr(e) && jn("GObj bad instanceof"), !t) return null;
|
|
3347
|
+
r || (r = Ir);
|
|
3343
3348
|
let l = [];
|
|
3344
|
-
if (
|
|
3349
|
+
if (or(t)) for (let e = 0; e < t.length; e++) {
|
|
3345
3350
|
let o = t[e];
|
|
3346
|
-
r(o, n) && l.push(
|
|
3351
|
+
r(o, n) && l.push(xn(o));
|
|
3347
3352
|
}
|
|
3348
3353
|
else {
|
|
3349
|
-
if (!
|
|
3350
|
-
r(t, n) && l.push(
|
|
3354
|
+
if (!lr(t)) return jn("kw_select() BAD kw parameter"), null;
|
|
3355
|
+
r(t, n) && l.push(xn(t));
|
|
3351
3356
|
}
|
|
3352
3357
|
return l;
|
|
3353
|
-
}, e.kw_set_dict_value =
|
|
3354
|
-
e && !
|
|
3355
|
-
let o =
|
|
3358
|
+
}, e.kw_set_dict_value = Dr, e.kw_set_local_storage_value = Ur, e.kw_set_subdict_value = kr, e.kwid_collect = Gr, e.kwid_find_one_record = function(e, t, n, r, l) {
|
|
3359
|
+
e && !cr(e) && jn("GObj bad instanceof");
|
|
3360
|
+
let o = Gr(e, t, n, r, l);
|
|
3356
3361
|
return o && 0 !== o.length ? o[0] : null;
|
|
3357
3362
|
}, e.kwid_get_ids = function(e, t) {
|
|
3358
|
-
if (e && !
|
|
3363
|
+
if (e && !cr(e) && jn("GObj bad instanceof"), !t) return [];
|
|
3359
3364
|
let n = [];
|
|
3360
|
-
if (
|
|
3361
|
-
else if (
|
|
3362
|
-
else
|
|
3363
|
-
if (
|
|
3364
|
-
else if (
|
|
3365
|
-
let r =
|
|
3365
|
+
if (sr(t)) n.push(t);
|
|
3366
|
+
else if (lr(t)) for (let e in t) Object.prototype.hasOwnProperty.call(t, e) && n.push(e);
|
|
3367
|
+
else or(t) && t.forEach(function(t) {
|
|
3368
|
+
if (sr(t)) fr(t) || n.push(t);
|
|
3369
|
+
else if (lr(t)) {
|
|
3370
|
+
let r = wr(e, t, "id", 0, 0);
|
|
3366
3371
|
r && n.push(r);
|
|
3367
3372
|
}
|
|
3368
3373
|
});
|
|
3369
3374
|
return n;
|
|
3370
|
-
}, e.kwid_match_id =
|
|
3371
|
-
e && !
|
|
3375
|
+
}, e.kwid_match_id = Vr, e.kwid_new_dict = function(e, t, n) {
|
|
3376
|
+
e && !cr(e) && jn("GObj bad instanceof");
|
|
3372
3377
|
let r = {};
|
|
3373
|
-
if (
|
|
3374
|
-
else if (
|
|
3375
|
-
let l = t[n], o =
|
|
3376
|
-
|
|
3378
|
+
if (fr(n) || (t = vr(e, t, n)), lr(t)) r = t;
|
|
3379
|
+
else if (or(t)) for (let n = 0; n < t.length; n++) {
|
|
3380
|
+
let l = t[n], o = wr(e, l, "id", "", Zt.KW_REQUIRED);
|
|
3381
|
+
fr(o) || Er(r, o, l);
|
|
3377
3382
|
}
|
|
3378
|
-
else
|
|
3383
|
+
else jn(`${et(e)} kwid_new_dict: data type unknown`);
|
|
3379
3384
|
return r;
|
|
3380
3385
|
}, e.kwid_new_list = function(e, t, n) {
|
|
3381
|
-
if (e && !
|
|
3382
|
-
if (
|
|
3386
|
+
if (e && !cr(e) && jn("GObj bad instanceof"), fr(n) || (t = vr(e, t, n)), or(t)) return t;
|
|
3387
|
+
if (lr(t)) {
|
|
3383
3388
|
let n = [];
|
|
3384
3389
|
for (let r of Object.keys(t)) {
|
|
3385
3390
|
let l = t[r];
|
|
3386
|
-
|
|
3391
|
+
lr(l) ? (l.id = r, n.push(l)) : jn(`${et(e)} kwid_new_list: not a record: '${r}'`);
|
|
3387
3392
|
}
|
|
3388
3393
|
return n;
|
|
3389
3394
|
}
|
|
3390
|
-
return
|
|
3395
|
+
return jn(`${et(e)} kwid_new_list: wrong type for list`), [];
|
|
3391
3396
|
}, e.list2options = function(e, t, n) {
|
|
3392
3397
|
t = t || "id", n = n || "value";
|
|
3393
3398
|
let r = [];
|
|
3394
|
-
if (
|
|
3399
|
+
if (or(e)) for (let l = 0; l < e.length; l++) {
|
|
3395
3400
|
let o = e[l];
|
|
3396
|
-
if (
|
|
3401
|
+
if (sr(o)) r.push({
|
|
3397
3402
|
id: e[l],
|
|
3398
3403
|
value: e[l]
|
|
3399
3404
|
});
|
|
3400
|
-
else if (
|
|
3405
|
+
else if (lr(o)) {
|
|
3401
3406
|
let e = {};
|
|
3402
|
-
if (
|
|
3403
|
-
if (!
|
|
3404
|
-
if (!(
|
|
3405
|
-
|
|
3407
|
+
if (hr(o, t)) {
|
|
3408
|
+
if (!hr(o, n)) {
|
|
3409
|
+
if (!(rr(o) > 0)) {
|
|
3410
|
+
jn("list2options(): object without field value: " + n);
|
|
3406
3411
|
continue;
|
|
3407
3412
|
}
|
|
3408
3413
|
n = Object.keys(o)[0];
|
|
3409
3414
|
}
|
|
3410
3415
|
e.id = o[t], e.value = o[n];
|
|
3411
3416
|
} else {
|
|
3412
|
-
if (!(
|
|
3413
|
-
|
|
3417
|
+
if (!(rr(o) > 0)) {
|
|
3418
|
+
jn("list2options(): object without field id: " + t);
|
|
3414
3419
|
continue;
|
|
3415
3420
|
}
|
|
3416
3421
|
t = Object.keys(o)[0], e.id = t, e.value = o[t];
|
|
3417
3422
|
}
|
|
3418
3423
|
r.push(e);
|
|
3419
|
-
} else
|
|
3424
|
+
} else jn("list2options(): case1 not implemented");
|
|
3420
3425
|
}
|
|
3421
|
-
else if (
|
|
3426
|
+
else if (lr(e)) for (let t of Object.keys(e)) r.push({
|
|
3422
3427
|
id: t,
|
|
3423
3428
|
value: t
|
|
3424
3429
|
});
|
|
3425
|
-
else
|
|
3430
|
+
else jn("list2options(): case2 not implemented");
|
|
3426
3431
|
return r;
|
|
3427
3432
|
}, e.load_json_file = function(e, t, n) {
|
|
3428
3433
|
let r = new XMLHttpRequest();
|
|
@@ -3430,18 +3435,18 @@
|
|
|
3430
3435
|
if (4 === r.readyState) if (200 === r.status || 0 === (e = r).status && e.responseText && e.responseURL.startsWith("file:")) try {
|
|
3431
3436
|
t(JSON.parse(r.responseText));
|
|
3432
3437
|
} catch (e) {
|
|
3433
|
-
n && (
|
|
3438
|
+
n && (jn(`JSON parse status ${r.status}, error: ${e.message}`), n(r.status));
|
|
3434
3439
|
}
|
|
3435
3440
|
else n && n(r.status);
|
|
3436
3441
|
var e;
|
|
3437
3442
|
}, r.send();
|
|
3438
|
-
}, e.log_debug =
|
|
3439
|
-
let n = yn(e, ...t), r =
|
|
3440
|
-
rn && cn("info", n) &&
|
|
3441
|
-
}, e.log_warning =
|
|
3443
|
+
}, e.log_debug = Sn, e.log_error = jn, e.log_info = function(e, ...t) {
|
|
3444
|
+
let n = yn(e, ...t), r = ol();
|
|
3445
|
+
rn && cn("info", n) && En(rn, "%c" + r + " INFO: " + String(n), "color:cyan"), gn("info", n, r);
|
|
3446
|
+
}, e.log_warning = On, e.mask_secrets_inline = Pn, e.msg_iev_get_msg_type = qr, e.msg_iev_get_stack = Br, e.msg_iev_push_stack = Yr, e.msg_iev_read_key = xr, e.msg_iev_set_msg_type = Jr, e.msg_iev_write_key = Kr, e.node_uuid = il, e.parseBoolean = gr, e.parseSVG = function(e) {
|
|
3442
3447
|
return new DOMParser().parseFromString(e, "image/svg+xml").firstChild;
|
|
3443
3448
|
}, e.refresh_language = function(e, t) {
|
|
3444
|
-
if (!
|
|
3449
|
+
if (!ur(t)) return void jn("You must supply a translation function");
|
|
3445
3450
|
e || (e = document);
|
|
3446
3451
|
const n = (t) => {
|
|
3447
3452
|
let n = [];
|
|
@@ -3465,22 +3470,22 @@
|
|
|
3465
3470
|
});
|
|
3466
3471
|
}, e.register_c_ievent_cli = function() {
|
|
3467
3472
|
return function(e) {
|
|
3468
|
-
if (
|
|
3473
|
+
if (Ml) return jn(`GClass ALREADY created: ${e}`), -1;
|
|
3469
3474
|
const t = [
|
|
3470
3475
|
["ST_DISCONNECTED", [
|
|
3471
3476
|
[
|
|
3472
3477
|
"EV_ON_OPEN",
|
|
3473
|
-
|
|
3478
|
+
Ql,
|
|
3474
3479
|
"ST_WAIT_IDENTITY_CARD_ACK"
|
|
3475
3480
|
],
|
|
3476
3481
|
[
|
|
3477
3482
|
"EV_ON_CLOSE",
|
|
3478
|
-
|
|
3483
|
+
Xl,
|
|
3479
3484
|
null
|
|
3480
3485
|
],
|
|
3481
3486
|
[
|
|
3482
3487
|
"EV_TIMEOUT",
|
|
3483
|
-
|
|
3488
|
+
zl,
|
|
3484
3489
|
null
|
|
3485
3490
|
],
|
|
3486
3491
|
[
|
|
@@ -3492,22 +3497,22 @@
|
|
|
3492
3497
|
["ST_WAIT_IDENTITY_CARD_ACK", [
|
|
3493
3498
|
[
|
|
3494
3499
|
"EV_ON_MESSAGE",
|
|
3495
|
-
|
|
3500
|
+
no,
|
|
3496
3501
|
null
|
|
3497
3502
|
],
|
|
3498
3503
|
[
|
|
3499
3504
|
"EV_IDENTITY_CARD_ACK",
|
|
3500
|
-
|
|
3505
|
+
to,
|
|
3501
3506
|
null
|
|
3502
3507
|
],
|
|
3503
3508
|
[
|
|
3504
3509
|
"EV_ON_CLOSE",
|
|
3505
|
-
|
|
3510
|
+
Xl,
|
|
3506
3511
|
"ST_DISCONNECTED"
|
|
3507
3512
|
],
|
|
3508
3513
|
[
|
|
3509
3514
|
"EV_TIMEOUT",
|
|
3510
|
-
|
|
3515
|
+
eo,
|
|
3511
3516
|
null
|
|
3512
3517
|
],
|
|
3513
3518
|
[
|
|
@@ -3519,22 +3524,22 @@
|
|
|
3519
3524
|
["ST_SESSION", [
|
|
3520
3525
|
[
|
|
3521
3526
|
"EV_ON_MESSAGE",
|
|
3522
|
-
|
|
3527
|
+
no,
|
|
3523
3528
|
null
|
|
3524
3529
|
],
|
|
3525
3530
|
[
|
|
3526
3531
|
"EV_MT_STATS",
|
|
3527
|
-
|
|
3532
|
+
ro,
|
|
3528
3533
|
null
|
|
3529
3534
|
],
|
|
3530
3535
|
[
|
|
3531
3536
|
"EV_MT_COMMAND",
|
|
3532
|
-
|
|
3537
|
+
lo,
|
|
3533
3538
|
null
|
|
3534
3539
|
],
|
|
3535
3540
|
[
|
|
3536
3541
|
"EV_ON_CLOSE",
|
|
3537
|
-
|
|
3542
|
+
Xl,
|
|
3538
3543
|
"ST_DISCONNECTED"
|
|
3539
3544
|
],
|
|
3540
3545
|
[
|
|
@@ -3545,7 +3550,7 @@
|
|
|
3545
3550
|
]],
|
|
3546
3551
|
[null, null]
|
|
3547
3552
|
];
|
|
3548
|
-
return (
|
|
3553
|
+
return (Ml = de(e, [
|
|
3549
3554
|
["EV_ON_MESSAGE", R.EVF_OUTPUT_EVENT],
|
|
3550
3555
|
["EV_IDENTITY_CARD_ACK", R.EVF_PUBLIC_EVENT],
|
|
3551
3556
|
["EV_ON_ID_NAK", R.EVF_PUBLIC_EVENT | R.EVF_OUTPUT_EVENT],
|
|
@@ -3556,36 +3561,36 @@
|
|
|
3556
3561
|
["EV_ON_OPEN_ERROR", R.EVF_OUTPUT_EVENT | R.EVF_NO_WARN_SUBS],
|
|
3557
3562
|
["EV_TIMEOUT", 0],
|
|
3558
3563
|
[null, 0]
|
|
3559
|
-
], t,
|
|
3564
|
+
], t, oo, 0, Ul, Gl, 0, 0, Fl, w.gcflag_no_check_output_events)) ? 0 : -1;
|
|
3560
3565
|
}("C_IEVENT_CLI");
|
|
3561
3566
|
}, e.register_c_timer = function() {
|
|
3562
3567
|
return function(e) {
|
|
3563
|
-
if (
|
|
3568
|
+
if (vl) return jn(`GClass ALREADY created: ${e}`), -1;
|
|
3564
3569
|
const t = [["ST_IDLE", [[
|
|
3565
3570
|
"EV_TIMEOUT",
|
|
3566
|
-
|
|
3571
|
+
jl,
|
|
3567
3572
|
null
|
|
3568
3573
|
]]]];
|
|
3569
|
-
return (
|
|
3574
|
+
return (vl = de(e, [
|
|
3570
3575
|
["EV_TIMEOUT", R.EVF_OUTPUT_EVENT],
|
|
3571
3576
|
["EV_TIMEOUT_PERIODIC", R.EVF_OUTPUT_EVENT],
|
|
3572
3577
|
[0, 0]
|
|
3573
|
-
], t,
|
|
3578
|
+
], t, Ol, 0, El, Tl, 0, 0, 0, w.gcflag_manual_start)) ? 0 : -1;
|
|
3574
3579
|
}("C_TIMER");
|
|
3575
3580
|
}, e.register_c_yuno = function() {
|
|
3576
3581
|
return function(e) {
|
|
3577
|
-
if (
|
|
3582
|
+
if (Dl) return jn(`GClass ALREADY created: ${e}`), -1;
|
|
3578
3583
|
const t = [["ST_IDLE", [[
|
|
3579
3584
|
"EV_TIMEOUT_PERIODIC",
|
|
3580
|
-
|
|
3585
|
+
Cl,
|
|
3581
3586
|
null
|
|
3582
3587
|
]]]];
|
|
3583
|
-
return (
|
|
3588
|
+
return (Dl = de(e, [["EV_TIMEOUT_PERIODIC", R.EVF_OUTPUT_EVENT | R.EVF_NO_WARN_SUBS], [0, 0]], t, Ll, 0, $l, Rl, 0, 0, 0, 0)) ? 0 : -1;
|
|
3584
3589
|
}("C_YUNO");
|
|
3585
3590
|
}, e.safeSrc = function(e) {
|
|
3586
3591
|
if (!e) return "";
|
|
3587
3592
|
const t = String(e).trim();
|
|
3588
|
-
return /^javascript:/i.test(t) || /^data:/i.test(t) ? "" :
|
|
3593
|
+
return /^javascript:/i.test(t) || /^data:/i.test(t) ? "" : Xr(t);
|
|
3589
3594
|
}, e.sdata_flag_t = E, e.send_http_json_post = function(e, t, n) {
|
|
3590
3595
|
let r = new XMLHttpRequest();
|
|
3591
3596
|
r.open("POST", e), r.setRequestHeader("Accept", "application/json"), r.setRequestHeader("Content-Type", "application/json"), r.onreadystatechange = function() {
|
|
@@ -3609,16 +3614,16 @@
|
|
|
3609
3614
|
}
|
|
3610
3615
|
} else on = e;
|
|
3611
3616
|
}, e.set_remote_log_functions = bn, e.set_strings_are_text = function(e) {
|
|
3612
|
-
|
|
3613
|
-
}, e.set_timeout =
|
|
3614
|
-
return
|
|
3617
|
+
nl = !!e;
|
|
3618
|
+
}, e.set_timeout = Sl, e.set_timeout_periodic = wl, e.sprintf = n, e.stats_parser = function(e, t, n, r) {}, e.str_in_list = Wr, e.strcasecmp = br, e.strcmp = dr, e.strings_are_text = function() {
|
|
3619
|
+
return nl;
|
|
3615
3620
|
}, e.strncmp = function(e, t, n) {
|
|
3616
3621
|
var r = (e + "").substring(0, n), l = (t + "").substring(0, n);
|
|
3617
3622
|
return r === l ? 0 : r > l ? 1 : -1;
|
|
3618
3623
|
}, e.strs_in_list = function(e, t, n) {
|
|
3619
|
-
if (!e) return
|
|
3620
|
-
if (!t) return
|
|
3621
|
-
for (let r = 0; r < t.length; r++) if (
|
|
3624
|
+
if (!e) return jn("ERROR: strs_in_list() list empty"), !1;
|
|
3625
|
+
if (!t) return jn("ERROR: strs_in_list() str empty"), !1;
|
|
3626
|
+
for (let r = 0; r < t.length; r++) if (Wr(e, t[r], n)) return !0;
|
|
3622
3627
|
return !1;
|
|
3623
3628
|
}, e.strstr = function(e, t, n) {
|
|
3624
3629
|
var r;
|
|
@@ -3637,13 +3642,13 @@
|
|
|
3637
3642
|
placeholder: void 0,
|
|
3638
3643
|
fkey: null
|
|
3639
3644
|
};
|
|
3640
|
-
if (
|
|
3645
|
+
if (sr(t)) {
|
|
3641
3646
|
let e = t.split(".");
|
|
3642
3647
|
for (let t = 0; t < e.length; t++) {
|
|
3643
3648
|
let r = e[t];
|
|
3644
|
-
if (
|
|
3645
|
-
else if (
|
|
3646
|
-
else if (
|
|
3649
|
+
if (Wr(pl, r)) n.real_type || (n.real_type = r);
|
|
3650
|
+
else if (Wr(hl, r)) n.type || (n.type = r);
|
|
3651
|
+
else if (Wr(ml, r)) switch (r) {
|
|
3647
3652
|
case "writable":
|
|
3648
3653
|
n.is_writable = !0;
|
|
3649
3654
|
break;
|
|
@@ -3655,23 +3660,23 @@
|
|
|
3655
3660
|
}
|
|
3656
3661
|
}
|
|
3657
3662
|
n.real_type || (n.real_type = "string");
|
|
3658
|
-
} else
|
|
3663
|
+
} else lr(t) ? (n = yl(t), n.name || (n.name = e), n.header || (n.header = e)) : or(t) && (n.real_type = "array", n.enum_list = t);
|
|
3659
3664
|
return n.type || (n.type = n.real_type), n;
|
|
3660
3665
|
}, e.timeTracker = function(e = "Time Tracker", t = !1) {
|
|
3661
3666
|
const n = e, r = performance.now();
|
|
3662
3667
|
let l = r;
|
|
3663
|
-
return t &&
|
|
3668
|
+
return t && On(`--\x3e ${n} - starting`), { mark: (e = "Intermediate", o = "") => {
|
|
3664
3669
|
const s = performance.now(), i = (s - l) / 1e3, _ = (s - r) / 1e3;
|
|
3665
|
-
return t &&
|
|
3670
|
+
return t && On(`--\x3e ${n} ${e} - partial: ${i} sec, total: ${_} sec, ${o}`), l = s, {
|
|
3666
3671
|
partial: i,
|
|
3667
3672
|
total: _
|
|
3668
3673
|
};
|
|
3669
3674
|
} };
|
|
3670
|
-
}, e.trace_json =
|
|
3671
|
-
if (
|
|
3675
|
+
}, e.trace_json = Nn, e.trace_json_masked = Wn, e.trace_level_t = P, e.trace_msg = wn, e.treedb_decoder_fkey = bl, e.treedb_decoder_hook = function(e, t) {
|
|
3676
|
+
if (sr(t)) {
|
|
3672
3677
|
if (-1 === t.indexOf("^")) {
|
|
3673
3678
|
let n, r = e.hook;
|
|
3674
|
-
if (1 !==
|
|
3679
|
+
if (1 !== tr(r)) return jn("bad hook 1"), jn(e), jn(t), null;
|
|
3675
3680
|
for (let e of Object.keys(r)) {
|
|
3676
3681
|
n = e, r[e];
|
|
3677
3682
|
break;
|
|
@@ -3683,25 +3688,25 @@
|
|
|
3683
3688
|
}
|
|
3684
3689
|
{
|
|
3685
3690
|
let n = t.split("^");
|
|
3686
|
-
return 2 !== n.length ? (
|
|
3691
|
+
return 2 !== n.length ? (jn("bad hook 2"), jn(e), jn(t), null) : {
|
|
3687
3692
|
topic_name: n[0],
|
|
3688
3693
|
id: n[1]
|
|
3689
3694
|
};
|
|
3690
3695
|
}
|
|
3691
3696
|
}
|
|
3692
|
-
return
|
|
3697
|
+
return lr(t) ? {
|
|
3693
3698
|
topic_name: t.topic_name,
|
|
3694
3699
|
id: t.id
|
|
3695
|
-
} : (
|
|
3700
|
+
} : (jn("bad hook 3"), jn(e), jn(t), null);
|
|
3696
3701
|
}, e.treedb_encoder_fkey = function(e, t) {
|
|
3697
|
-
let n =
|
|
3702
|
+
let n = bl(e, t);
|
|
3698
3703
|
return n ? n.topic_name + "^" + n.id + "^" + n.hook_name : null;
|
|
3699
|
-
}, e.treedb_get_field_desc =
|
|
3700
|
-
if (
|
|
3704
|
+
}, e.treedb_get_field_desc = yl, e.treedb_hook_data_size = function(e) {
|
|
3705
|
+
if (or(e) && 1 === rr(e)) {
|
|
3701
3706
|
let t = e[0];
|
|
3702
|
-
return
|
|
3707
|
+
return hr(t, "size") ? t.size : 1;
|
|
3703
3708
|
}
|
|
3704
|
-
return
|
|
3709
|
+
return rr(e);
|
|
3705
3710
|
}, e.vsprintf = function(e, t) {
|
|
3706
3711
|
return n.apply(null, [e].concat(t || []));
|
|
3707
3712
|
}, e.walk_type_t = D;
|