@yuneta/gobj-js 7.22.1 → 7.25.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/gobj-js.cjs.js +40 -5
- package/dist/gobj-js.cjs.js.map +1 -1
- package/dist/gobj-js.cjs.min.js +781 -755
- package/dist/gobj-js.cjs.min.js.map +1 -1
- package/dist/gobj-js.es.js +40 -5
- package/dist/gobj-js.es.js.map +1 -1
- package/dist/gobj-js.es.min.js +846 -820
- package/dist/gobj-js.es.min.js.map +1 -1
- package/dist/gobj-js.iife.js +40 -5
- package/dist/gobj-js.iife.js.map +1 -1
- package/dist/gobj-js.iife.min.js +781 -755
- package/dist/gobj-js.iife.min.js.map +1 -1
- package/dist/gobj-js.umd.js +40 -5
- package/dist/gobj-js.umd.js.map +1 -1
- package/dist/gobj-js.umd.min.js +813 -787
- package/dist/gobj-js.umd.min.js.map +1 -1
- package/package.json +1 -1
package/dist/gobj-js.umd.min.js
CHANGED
|
@@ -144,7 +144,7 @@
|
|
|
144
144
|
DTP_POINTER: 8
|
|
145
145
|
});
|
|
146
146
|
E.DTP_POINTER;
|
|
147
|
-
var
|
|
147
|
+
var y = Object.freeze({
|
|
148
148
|
SDF_NOTACCESS: 1,
|
|
149
149
|
SDF_RD: 2,
|
|
150
150
|
SDF_WR: 4,
|
|
@@ -167,18 +167,18 @@
|
|
|
167
167
|
SDF_AUTHZ_S: 524288,
|
|
168
168
|
SDF_AUTHZ_RS: 1048576
|
|
169
169
|
});
|
|
170
|
-
|
|
171
|
-
var
|
|
170
|
+
y.SDF_RD, y.SDF_WR, y.SDF_STATS, y.SDF_PERSIST, y.SDF_VOLATIL, y.SDF_RSTATS, y.SDF_PSTATS, y.SDF_WR, y.SDF_PERSIST;
|
|
171
|
+
var T = class {
|
|
172
172
|
constructor(e, t, n = 0, r = null, l = "", o = null, s = null, i = 0, _ = null, a = null, u = null) {
|
|
173
173
|
this.type = e, this.name = t, this.alias = o, this.flag = n, this.default_value = r, this.header = s, this.fillspace = i, this.description = l, this.json_fn = _, this.schema = a, this.authpth = u;
|
|
174
174
|
}
|
|
175
|
-
}, v = () => new
|
|
175
|
+
}, v = () => new T(0, null), j = (e, t, n, r, l) => new T(e, t, n, r, l), S = class {
|
|
176
176
|
constructor(e, t, n, r, l, o, s, i, _) {
|
|
177
177
|
this.gclass_name = e, this.dl_states = [], this.dl_events = [], this.gmt = t, this.lmt = n, this.attrs_table = r, this.priv = l, this.authz_table = o, this.command_table = s, this.s_user_trace_level = i, this.gclass_flag = Number(_) || 0, this.instances = 0, this.trace_level = 0, this.no_trace_level = 0, this.jn_trace_filter = null, this.fsm_checked = !1;
|
|
178
178
|
}
|
|
179
179
|
}, O = class {
|
|
180
180
|
constructor(e, t, n, r, l) {
|
|
181
|
-
this.__refs__ = 0, this.gclass = t, this.parent = null, this.dl_children = [], this.dl_subscriptions = [], this.dl_subscribings = [], this.current_state = t.dl_states[0], this.last_state = null, this.obflag = 0, this.gobj_flag = Number(l) || 0, this.gobj_name = e, this.jn_attrs = null, this.jn_stats = {}, this.jn_user_data = {}, this.full_name = null, this.short_name = null, this.priv =
|
|
181
|
+
this.__refs__ = 0, this.gclass = t, this.parent = null, this.dl_children = [], this.dl_subscriptions = [], this.dl_subscribings = [], this.current_state = t.dl_states[0], this.last_state = null, this.obflag = 0, this.gobj_flag = Number(l) || 0, this.gobj_name = e, this.jn_attrs = null, this.jn_stats = {}, this.jn_user_data = {}, this.full_name = null, this.short_name = null, this.priv = En(t.priv), this.running = !1, this.playing = !1, this.disabled = !1, this.bottom_gobj = null, this.trace_level = 0, this.no_trace_level = 0;
|
|
182
182
|
}
|
|
183
183
|
}, w = Object.freeze({
|
|
184
184
|
gcflag_manual_start: 1,
|
|
@@ -224,7 +224,7 @@
|
|
|
224
224
|
};
|
|
225
225
|
var C = 1;
|
|
226
226
|
function P(e) {
|
|
227
|
-
|
|
227
|
+
Cn(e) && (e = JSON.stringify(e)), pn(" ".repeat(Math.max(1, 2 * h)) + String(e));
|
|
228
228
|
}
|
|
229
229
|
var L = Object.freeze({
|
|
230
230
|
TRACE_MACHINE: 65536,
|
|
@@ -326,7 +326,7 @@
|
|
|
326
326
|
return n;
|
|
327
327
|
}
|
|
328
328
|
function W(e, t, n) {
|
|
329
|
-
if (
|
|
329
|
+
if (Wn(e)) return void 0 === n ? 268369920 : 65535;
|
|
330
330
|
if (/^[0-9]+$/.test(String(e))) {
|
|
331
331
|
const t = Number(e);
|
|
332
332
|
if (t) return t;
|
|
@@ -337,7 +337,7 @@
|
|
|
337
337
|
for (let n = 0; n < t.length && n < 16; n++) if (t[n] && t[n][0] === e) return 1 << n;
|
|
338
338
|
}
|
|
339
339
|
return 0;
|
|
340
|
-
}(String(e), n) || (
|
|
340
|
+
}(String(e), n) || (dn(`${t}: trace level NOT FOUND: ${e}`), 0);
|
|
341
341
|
}
|
|
342
342
|
function x(e) {
|
|
343
343
|
if (V) return 4294967295;
|
|
@@ -393,32 +393,32 @@
|
|
|
393
393
|
return M(G, null);
|
|
394
394
|
}
|
|
395
395
|
function re(e) {
|
|
396
|
-
const t =
|
|
397
|
-
return t ? M(t.trace_level | F, t.s_user_trace_level) : (
|
|
396
|
+
const t = Ln(e) ? Se(e) : e;
|
|
397
|
+
return t ? M(t.trace_level | F, t.s_user_trace_level) : (dn(`gobj_get_gclass_trace_level: gclass NOT FOUND: ${e}`), []);
|
|
398
398
|
}
|
|
399
399
|
function le(e) {
|
|
400
|
-
const t =
|
|
401
|
-
return t ? M(t.trace_level, t.s_user_trace_level) : (
|
|
400
|
+
const t = Ln(e) ? Se(e) : e;
|
|
401
|
+
return t ? M(t.trace_level, t.s_user_trace_level) : (dn(`gobj_get_gclass_trace_level2: gclass NOT FOUND: ${e}`), []);
|
|
402
402
|
}
|
|
403
403
|
function oe(e) {
|
|
404
|
-
const t =
|
|
405
|
-
return t ? M(t.no_trace_level, t.s_user_trace_level) : (
|
|
404
|
+
const t = Ln(e) ? Se(e) : e;
|
|
405
|
+
return t ? M(t.no_trace_level, t.s_user_trace_level) : (dn(`gobj_get_gclass_trace_no_level: gclass NOT FOUND: ${e}`), []);
|
|
406
406
|
}
|
|
407
407
|
function se(e, t, n) {
|
|
408
|
-
const r =
|
|
409
|
-
if (!r) return
|
|
408
|
+
const r = Ln(e) ? Se(e) : e;
|
|
409
|
+
if (!r) return dn(`gobj_set_gclass_trace: gclass NOT FOUND: ${e}`), -1;
|
|
410
410
|
const l = null === t ? 4294967295 : W(t, "gobj_set_gclass_trace", r.s_user_trace_level || null);
|
|
411
411
|
return l ? (n ? r.trace_level |= l : r.trace_level &= ~l, 0) : -1;
|
|
412
412
|
}
|
|
413
413
|
function ie(e, t, n) {
|
|
414
|
-
const r =
|
|
415
|
-
if (!r) return
|
|
414
|
+
const r = Ln(e) ? Se(e) : e;
|
|
415
|
+
if (!r) return dn(`gobj_set_gclass_no_trace: gclass NOT FOUND: ${e}`), -1;
|
|
416
416
|
const l = null === t ? 4294967295 : W(t, "gobj_set_gclass_no_trace", r.s_user_trace_level || null);
|
|
417
417
|
return l ? (n ? r.no_trace_level |= l : r.no_trace_level &= ~l, 0) : -1;
|
|
418
418
|
}
|
|
419
419
|
function _e(e, t) {
|
|
420
420
|
let n = {};
|
|
421
|
-
if (
|
|
421
|
+
if (!Pn(t)) return dn("sdata_desc MUST be an array"), hn(t), n;
|
|
422
422
|
for (let r = 0; r < t.length; r++) {
|
|
423
423
|
const l = t[r];
|
|
424
424
|
l.name && ae(e, n, l);
|
|
@@ -432,134 +432,134 @@
|
|
|
432
432
|
r = String(l);
|
|
433
433
|
break;
|
|
434
434
|
case E.DTP_BOOLEAN:
|
|
435
|
-
r =
|
|
435
|
+
r = xn(l);
|
|
436
436
|
break;
|
|
437
437
|
case E.DTP_INTEGER:
|
|
438
|
-
r = parseInt(l), isNaN(r) &&
|
|
438
|
+
r = parseInt(l), isNaN(r) && dn(`${et(e)}: attr NaN: ${n.name}`);
|
|
439
439
|
break;
|
|
440
440
|
case E.DTP_REAL:
|
|
441
|
-
r = Number(l), isNaN(r) &&
|
|
441
|
+
r = Number(l), isNaN(r) && dn(`${et(e)}: attr NaN: ${n.name}`);
|
|
442
442
|
break;
|
|
443
443
|
case E.DTP_LIST:
|
|
444
|
-
if (
|
|
444
|
+
if (Ln(l)) try {
|
|
445
445
|
r = JSON.parse(l);
|
|
446
446
|
} catch (e) {
|
|
447
|
-
|
|
447
|
+
dn(`JSON parse error: ${e.message}`);
|
|
448
448
|
}
|
|
449
449
|
else r = l;
|
|
450
|
-
|
|
450
|
+
Pn(r) || (r = []);
|
|
451
451
|
break;
|
|
452
452
|
case E.DTP_DICT:
|
|
453
|
-
if (
|
|
453
|
+
if (Ln(l)) try {
|
|
454
454
|
r = JSON.parse(l);
|
|
455
455
|
} catch (e) {
|
|
456
|
-
|
|
456
|
+
dn(`JSON parse error: ${e.message}`);
|
|
457
457
|
}
|
|
458
458
|
else r = l;
|
|
459
|
-
|
|
459
|
+
Cn(r) || (r = {});
|
|
460
460
|
break;
|
|
461
461
|
case E.DTP_JSON:
|
|
462
|
-
if (
|
|
462
|
+
if (Ln(l)) try {
|
|
463
463
|
r = JSON.parse(l);
|
|
464
464
|
} catch (e) {
|
|
465
|
-
|
|
465
|
+
dn(`JSON parse error: ${e.message}`);
|
|
466
466
|
}
|
|
467
467
|
else r = l;
|
|
468
468
|
break;
|
|
469
469
|
case E.DTP_POINTER: r = l;
|
|
470
470
|
}
|
|
471
|
-
return void 0 === r && (
|
|
471
|
+
return void 0 === r && (dn(`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 E.DTP_STRING:
|
|
477
477
|
if (null == r) l = "";
|
|
478
|
-
else if (
|
|
478
|
+
else if (Ln(r)) l = String(r);
|
|
479
479
|
else {
|
|
480
480
|
let e = JSON.stringify(r);
|
|
481
481
|
e && (l = String(e));
|
|
482
482
|
}
|
|
483
483
|
break;
|
|
484
484
|
case E.DTP_BOOLEAN:
|
|
485
|
-
l =
|
|
485
|
+
l = xn(r);
|
|
486
486
|
break;
|
|
487
487
|
case E.DTP_INTEGER:
|
|
488
|
-
l = parseInt(r), isNaN(l) &&
|
|
488
|
+
l = parseInt(r), isNaN(l) && dn(`${et(e)}: attr NaN: ${n.name}`);
|
|
489
489
|
break;
|
|
490
490
|
case E.DTP_REAL:
|
|
491
|
-
l = Number(r), isNaN(l) &&
|
|
491
|
+
l = Number(r), isNaN(l) && dn(`${et(e)}: attr NaN: ${n.name}`);
|
|
492
492
|
break;
|
|
493
493
|
case E.DTP_LIST:
|
|
494
|
-
if (
|
|
494
|
+
if (Ln(r)) try {
|
|
495
495
|
l = JSON.parse(r);
|
|
496
496
|
} catch (e) {
|
|
497
|
-
|
|
497
|
+
dn(`JSON parse error: ${e.message}`);
|
|
498
498
|
}
|
|
499
499
|
else l = r;
|
|
500
|
-
if (
|
|
500
|
+
if (!Pn(l)) return dn(`attr must be an array: ${n.name}`), -1;
|
|
501
501
|
break;
|
|
502
502
|
case E.DTP_DICT:
|
|
503
|
-
if (
|
|
503
|
+
if (Ln(r)) try {
|
|
504
504
|
l = JSON.parse(r);
|
|
505
505
|
} catch (e) {
|
|
506
|
-
|
|
506
|
+
dn(`JSON parse error: ${e.message}`);
|
|
507
507
|
}
|
|
508
508
|
else l = r;
|
|
509
|
-
if (!
|
|
509
|
+
if (!Cn(l)) return dn(`attr must be an object: ${n.name}`), -1;
|
|
510
510
|
break;
|
|
511
511
|
case E.DTP_JSON:
|
|
512
|
-
if (
|
|
512
|
+
if (Ln(r)) try {
|
|
513
513
|
l = JSON.parse(r);
|
|
514
514
|
} catch (e) {
|
|
515
|
-
|
|
515
|
+
dn(`JSON parse error: ${e.message}`);
|
|
516
516
|
}
|
|
517
517
|
else l = r;
|
|
518
|
-
if (
|
|
518
|
+
if (!Pn(l) && !Cn(l)) return dn(`attr must be a json dict/list: ${n.name}`), -1;
|
|
519
519
|
break;
|
|
520
520
|
case E.DTP_POINTER: l = r;
|
|
521
521
|
}
|
|
522
|
-
return void 0 === l &&
|
|
522
|
+
return void 0 === l && dn(`${et(e)}: attr undefined: ${n.name}`), t[n.name] = l, Cn(e.priv) && e.priv.hasOwnProperty(n.name) && (e.priv[n.name] = l), e.obflag & R.obflag_created && !(e.obflag & R.obflag_destroyed) && e.gclass.gmt.mt_writing && e.gclass.gmt.mt_writing(e, n.name), 0;
|
|
523
523
|
}
|
|
524
524
|
function ce(e) {
|
|
525
525
|
return e.jn_attrs;
|
|
526
526
|
}
|
|
527
527
|
function fe(e, t, n) {
|
|
528
|
-
return ht(e, t) ? ce(e) : e && e.bottom_gobj ? fe(e.bottom_gobj, t, n) : (n &&
|
|
528
|
+
return ht(e, t) ? ce(e) : e && e.bottom_gobj ? fe(e.bottom_gobj, t, n) : (n && dn(`GClass Attribute NOT FOUND: ${et(e)}, attr ${t}`), null);
|
|
529
529
|
}
|
|
530
530
|
function ge(e, t, n) {
|
|
531
|
-
if (!(e && e instanceof S)) return n &&
|
|
531
|
+
if (!(e && e instanceof S)) return n && dn("gclass NULL"), null;
|
|
532
532
|
if (!t) return e.attrs_table;
|
|
533
533
|
for (let n = 0; n < e.attrs_table.length; n++) {
|
|
534
534
|
const r = e.attrs_table[n];
|
|
535
535
|
if (r.name && r.name === t) return r;
|
|
536
536
|
}
|
|
537
|
-
return n &&
|
|
537
|
+
return n && dn(`${e.gclass_name}: GClass Attribute NOT FOUND: ${t}`), null;
|
|
538
538
|
}
|
|
539
539
|
function de(e, t, n, r, l, o, s, i, _, a, u) {
|
|
540
|
-
if (
|
|
541
|
-
if (e.includes("`") || e.includes("^") || e.includes(".")) return
|
|
542
|
-
if (Se(e)) return
|
|
540
|
+
if (Wn(e)) return dn("gclass_name EMPTY"), null;
|
|
541
|
+
if (e.includes("`") || e.includes("^") || e.includes(".")) return dn(`GClass name CANNOT have '.' or '^' or '\`' char: ${e}`), null;
|
|
542
|
+
if (Se(e)) return dn(`GClass ALREADY exists: ${e}`), null;
|
|
543
543
|
let c = new S(e, r, l, o, s, i, _, a, u);
|
|
544
544
|
(function(e, t) {
|
|
545
|
-
e && e instanceof S ? t ? d[t] ?
|
|
545
|
+
e && e instanceof S ? t ? d[t] ? dn(`gclass ALREADY REGISTERED: ${t}`) : d[t] = e : dn("gclass_name undefined") : dn("gclass undefined");
|
|
546
546
|
})(c, e);
|
|
547
547
|
const f = n.length;
|
|
548
548
|
for (let e = 0; e < f; e++) {
|
|
549
549
|
let t = n[e][0], r = n[e][1];
|
|
550
|
-
if (
|
|
550
|
+
if (Wn(t)) continue;
|
|
551
551
|
if (he(c, t) < 0) return be(c), null;
|
|
552
552
|
const l = r.length;
|
|
553
553
|
for (let e = 0; e < l; e++) {
|
|
554
554
|
let n = r[e][0], l = r[e][1], o = r[e][2];
|
|
555
|
-
|
|
555
|
+
Wn(n) || Ee(c, t, n, l, o);
|
|
556
556
|
}
|
|
557
557
|
}
|
|
558
558
|
for (let e = 0; e < t.length; e++) {
|
|
559
559
|
let n = t[e][0], r = t[e][1];
|
|
560
|
-
if (!
|
|
561
|
-
if (ve(c, n)) return
|
|
562
|
-
|
|
560
|
+
if (!Wn(n)) {
|
|
561
|
+
if (ve(c, n)) return dn(`SMachine: event repeated in input_events: ${n}`), be(c), null;
|
|
562
|
+
Te(c, n, r);
|
|
563
563
|
}
|
|
564
564
|
}
|
|
565
565
|
if (!c.fsm_checked) {
|
|
@@ -570,13 +570,13 @@
|
|
|
570
570
|
}
|
|
571
571
|
function be(e) {
|
|
572
572
|
let t;
|
|
573
|
-
if (
|
|
573
|
+
if (Ln(e)) t = e;
|
|
574
574
|
else {
|
|
575
|
-
if (!(e instanceof S)) return
|
|
575
|
+
if (!(e instanceof S)) return dn("Cannot unregister gclass, type unknown"), -1;
|
|
576
576
|
t = e.gclass_name;
|
|
577
577
|
}
|
|
578
578
|
let n = d[t];
|
|
579
|
-
return n ? n.instances > 0 ? (
|
|
579
|
+
return n ? n.instances > 0 ? (dn(`Cannot unregister gclass, instances in use: ${t}`), -1) : (delete d[t], 0) : (dn(`Cannot unregister gclass, not found: ${t}`), -1);
|
|
580
580
|
}
|
|
581
581
|
function pe(e, t) {
|
|
582
582
|
const n = e.dl_states.length, r = e.dl_states;
|
|
@@ -595,22 +595,22 @@
|
|
|
595
595
|
return null;
|
|
596
596
|
}
|
|
597
597
|
function he(e, t) {
|
|
598
|
-
return e instanceof S ? pe(e, t) ? (
|
|
598
|
+
return e instanceof S ? pe(e, t) ? (dn(`state already exists: ${t}`), -1) : (e.dl_states.push(new $(t)), 0) : (dn("Cannot add state, typeof not GClass"), -1);
|
|
599
599
|
}
|
|
600
600
|
function Ee(e, t, n, r, l) {
|
|
601
|
-
if (!(e instanceof S)) return
|
|
602
|
-
if (
|
|
601
|
+
if (!(e instanceof S)) return dn("Cannot add state, typeof not GClass"), -1;
|
|
602
|
+
if (Wn(t)) return dn("state_name EMPTY"), -1;
|
|
603
603
|
let o = pe(e, t);
|
|
604
|
-
return o ? me(o, n) ? (
|
|
605
|
-
}
|
|
606
|
-
function Te(e, t, n) {
|
|
607
|
-
Gn(t) || e.push(new I(t, n));
|
|
604
|
+
return o ? me(o, n) ? (dn(`event already exists: gclass ${e.gclass_name}, state ${t}, event ${n}`), -1) : (o.dl_actions.push(new k(n, r, l)), 0) : (dn(`state not found: ${t}`), -1);
|
|
608
605
|
}
|
|
609
606
|
function ye(e, t, n) {
|
|
610
|
-
|
|
607
|
+
Wn(t) || e.push(new I(t, n));
|
|
608
|
+
}
|
|
609
|
+
function Te(e, t, n) {
|
|
610
|
+
return e instanceof S ? ye(e.dl_events, t, n) : (dn("Cannot add state, typeof not GClass"), -1);
|
|
611
611
|
}
|
|
612
612
|
function ve(e, t) {
|
|
613
|
-
if (!(e instanceof S)) return
|
|
613
|
+
if (!(e instanceof S)) return dn("Cannot add state, typeof not GClass"), 0;
|
|
614
614
|
const n = e.dl_events.length, r = e.dl_events;
|
|
615
615
|
for (let e = 0; e < n; e++) {
|
|
616
616
|
let n = r[e];
|
|
@@ -619,25 +619,25 @@
|
|
|
619
619
|
return null;
|
|
620
620
|
}
|
|
621
621
|
function je(e) {
|
|
622
|
-
if (!(e instanceof S)) return
|
|
622
|
+
if (!(e instanceof S)) return dn("Cannot add state, typeof not GClass"), -1;
|
|
623
623
|
let t = 0;
|
|
624
|
-
|
|
624
|
+
$n(e.dl_states) || (dn(`GClass without states: ${e.gclass_name}`), t += -1);
|
|
625
625
|
for (let n = 0; n < e.dl_states.length; n++) {
|
|
626
626
|
let r = e.dl_states[n];
|
|
627
|
-
if (!
|
|
627
|
+
if (!Wn(r.state_name)) for (let n = 0; n < r.dl_actions.length; n++) {
|
|
628
628
|
let l = r.dl_actions[n];
|
|
629
|
-
|
|
629
|
+
Wn(l.event_name) || (ve(e, l.event_name) || (dn(`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) || (dn(`SMachine: next state NOT in state names: gclass ${e.gclass_name}, state ${r.state_name}, next_state ${l.next_state}`), t += -1)));
|
|
630
630
|
}
|
|
631
631
|
}
|
|
632
632
|
for (let n = 0; n < e.dl_events.length; n++) {
|
|
633
633
|
let r = e.dl_events[n];
|
|
634
|
-
if (!
|
|
634
|
+
if (!Wn(r.event_name) && (Un(r.event_flag) || (dn(`SMachine: event flag is NOT number: gclass ${e.gclass_name}, event ${r.event_name}`), t += -1), !(r.event_flag & D.EVF_OUTPUT_EVENT))) {
|
|
635
635
|
let n = !1;
|
|
636
636
|
for (let t = 0; t < e.dl_states.length; t++) {
|
|
637
637
|
let l = e.dl_states[t];
|
|
638
|
-
|
|
638
|
+
Wn(l.state_name) || me(l, r.event_name) && (n = !0);
|
|
639
639
|
}
|
|
640
|
-
n || (
|
|
640
|
+
n || (dn(`SMachine: input_list's event NOT in state: gclass ${e.gclass_name}, event ${r.event_name}`), t += -1);
|
|
641
641
|
}
|
|
642
642
|
}
|
|
643
643
|
return t;
|
|
@@ -647,65 +647,65 @@
|
|
|
647
647
|
try {
|
|
648
648
|
n = d[e];
|
|
649
649
|
} catch (e) {}
|
|
650
|
-
return n || (t &&
|
|
650
|
+
return n || (t && dn(`gclass not found: ${e}`), null);
|
|
651
651
|
}
|
|
652
652
|
function Oe() {
|
|
653
653
|
return !m || m.obflag & R.obflag_destroyed ? null : m;
|
|
654
654
|
}
|
|
655
655
|
function we(e, t) {
|
|
656
656
|
e = e.toLowerCase();
|
|
657
|
-
return b[e] || (t &&
|
|
657
|
+
return b[e] || (t && dn(`gobj service not found: ${e}`), null);
|
|
658
658
|
}
|
|
659
659
|
function Ne(e) {
|
|
660
660
|
let t = Xe(e);
|
|
661
|
-
return t = t.toLowerCase(), b[t] &&
|
|
661
|
+
return t = t.toLowerCase(), b[t] && dn(`service ALREADY REGISTERED: ${t}. Will be UPDATED`), b[t] = e, 0;
|
|
662
662
|
}
|
|
663
663
|
function Re(e, t) {
|
|
664
|
-
t.parent &&
|
|
664
|
+
t.parent && dn(`_add_child() ALREADY HAS PARENT: ${t.gobj_name}`), e.dl_children.push(t), t.parent = e;
|
|
665
665
|
}
|
|
666
666
|
function De(e, t) {
|
|
667
|
-
let n =
|
|
668
|
-
n >= 0 && (
|
|
667
|
+
let n = Rr(e.dl_children, t);
|
|
668
|
+
n >= 0 && (An(e.dl_children, n), t.parent = null);
|
|
669
669
|
}
|
|
670
670
|
function Ae(e, t) {
|
|
671
|
-
return Be(e) ? _ ? _(e, t) : -1 : (
|
|
671
|
+
return Be(e) ? _ ? _(e, t) : -1 : (dn(`${et(e)}: Only gobj services can load/save writable-persistent`), -1);
|
|
672
672
|
}
|
|
673
673
|
function ke(e, t) {
|
|
674
|
-
"__json_config_variables__" !== t &&
|
|
674
|
+
"__json_config_variables__" !== t && dn(`GClass Attribute NOT FOUND: ${et(e)}, attr ${t}`);
|
|
675
675
|
}
|
|
676
676
|
function $e(e, t, n) {
|
|
677
677
|
let r = t;
|
|
678
678
|
(function(e, t, n, r, l) {
|
|
679
|
-
if (!e || !t) return
|
|
679
|
+
if (!e || !t) return dn("hsdata or kw NULL"), -1;
|
|
680
680
|
let o = 0;
|
|
681
681
|
for (const [s, i] of Object.entries(t)) {
|
|
682
682
|
const t = ge(l.gclass, s, !1);
|
|
683
|
-
t ? (-1 === n || t.flag & n) && (t.flag &
|
|
683
|
+
t ? (-1 === n || t.flag & n) && (t.flag & y.SDF_DEPRECATED && bn(`${et(l)}: Deprecated attribute used in gobj creation: ${s}`), o += ue(l, e, t, i)) : r && (r(l, s), o--);
|
|
684
684
|
}
|
|
685
685
|
return o;
|
|
686
|
-
})(ce(e), r, -1, e.gclass.gclass_flag & w.gcflag_ignore_unknown_attrs ? 0 : ke, e) < 0 && (
|
|
686
|
+
})(ce(e), r, -1, e.gclass.gclass_flag & w.gcflag_ignore_unknown_attrs ? 0 : ke, e) < 0 && (dn(`${et(e)} json2data() FAILED`), hn(r));
|
|
687
687
|
}
|
|
688
688
|
function Ie(e, t, r, l, o) {
|
|
689
689
|
if (o & N.gobj_flag_yuno) {
|
|
690
|
-
if (p) return
|
|
690
|
+
if (p) return dn("__yuno__ already created"), null;
|
|
691
691
|
o |= N.gobj_flag_service;
|
|
692
692
|
} else {
|
|
693
|
-
if (!l) return
|
|
694
|
-
if (!("string" == typeof l || l instanceof O)) return
|
|
695
|
-
if (
|
|
693
|
+
if (!l) return dn("gobj NEEDS a parent!"), null;
|
|
694
|
+
if (!("string" == typeof l || l instanceof O)) return dn(`BAD TYPE of parent: ${l}`), null;
|
|
695
|
+
if (Ln(l) && !(l = we(l))) return bn(`parent service not found: ${l}`), null;
|
|
696
696
|
}
|
|
697
|
-
if (o & N.gobj_flag_service && we(e, !1)) return
|
|
697
|
+
if (o & N.gobj_flag_service && we(e, !1)) return dn(`service ALREADY registered: ${t}^${e}`), null;
|
|
698
698
|
if (o & N.gobj_flag_default_service) {
|
|
699
|
-
if (m) return
|
|
699
|
+
if (m) return dn(`default service ALREADY registered: ${t}^${e}`), null;
|
|
700
700
|
o |= N.gobj_flag_service;
|
|
701
701
|
}
|
|
702
|
-
if (
|
|
702
|
+
if (Wn(t)) return dn("gclass_name must be a string"), null;
|
|
703
703
|
let s = Se(t, !1);
|
|
704
|
-
if (!s) return
|
|
705
|
-
if (!
|
|
706
|
-
if (!
|
|
707
|
-
if (e.includes("`")) return
|
|
708
|
-
if (e.includes("^")) return
|
|
704
|
+
if (!s) return dn(`GClass not registered: ${t}^${e}`), null;
|
|
705
|
+
if (!Ln(e)) return dn(`gobj_name must be a string: ${t}`), null;
|
|
706
|
+
if (!Wn(e)) {
|
|
707
|
+
if (e.includes("`")) return dn(`gobj_name cannot contain char ': ${t}^${e}`), null;
|
|
708
|
+
if (e.includes("^")) return dn(`gobj_name cannot contain char ^: ${t}^${e}`), null;
|
|
709
709
|
}
|
|
710
710
|
let _ = new O(e, s, r, l, o);
|
|
711
711
|
_.jn_attrs = _e(_, s.attrs_table);
|
|
@@ -717,8 +717,8 @@
|
|
|
717
717
|
return Ie(e, t, n, r, N.gobj_flag_pure_child);
|
|
718
718
|
}
|
|
719
719
|
function Pe(e) {
|
|
720
|
-
if (ot(e)) return void
|
|
721
|
-
e.__refs__ > 0 &&
|
|
720
|
+
if (ot(e)) return void dn("gobj NULL or DESTROYED");
|
|
721
|
+
e.__refs__ > 0 && dn(`${et(e)}: gobj DESTROYING with references: ${e.__refs__}`), e.playing && (dn(`Destroying a PLAYING gobj: ${tt(e)}`), xe(e)), e.running && (dn(`Destroying a RUNNING gobj: ${tt(e)}`), Ge(e)), e.obflag |= R.obflag_destroying, function(e) {
|
|
722
722
|
if (0 === Pt.length) return;
|
|
723
723
|
for (let t of Pt) t.src === e && (t.src = null);
|
|
724
724
|
Pt = Pt.filter((t) => t.dst !== e);
|
|
@@ -728,7 +728,7 @@
|
|
|
728
728
|
let r = nt(e);
|
|
729
729
|
r && r.gclass.gmt.mt_child_removed && (t && P(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) {
|
|
730
730
|
let t = Xe(e);
|
|
731
|
-
t = t.toLowerCase(), b[t] ? delete b[t] :
|
|
731
|
+
t = t.toLowerCase(), b[t] ? delete b[t] : dn(`"service NOT found in register": ${t}`);
|
|
732
732
|
}(e), Bt(e, e.dl_subscriptions, !0), Bt(e, e.dl_subscribings, !0), r && (De(r, e), rt(e) && (st(r) !== e || ot(r) || it(r, null))), function(e) {
|
|
733
733
|
let t = e.dl_children.slice();
|
|
734
734
|
for (let e = 0; e < t.length; e++) {
|
|
@@ -738,9 +738,9 @@
|
|
|
738
738
|
}(e), e.obflag & R.obflag_created && e.gclass.gmt.mt_destroy && e.gclass.gmt.mt_destroy(e), t && P(n("💔💔⏪ destroyed: %s", tt(e))), e.obflag |= R.obflag_destroyed, e.obflag & R.obflag_created && e.gclass.instances--;
|
|
739
739
|
}
|
|
740
740
|
function Le(e) {
|
|
741
|
-
if (ot(e)) return
|
|
742
|
-
if (e.running) return
|
|
743
|
-
if (e.disabled) return
|
|
741
|
+
if (ot(e)) return dn("gobj NULL or DESTROYED"), -1;
|
|
742
|
+
if (e.running) return dn(`${et(e)}: GObj ALREADY RUNNING`), -1;
|
|
743
|
+
if (e.disabled) return dn(`${et(e)}: GObj DISABLED`), -1;
|
|
744
744
|
J(e) && P(n("⏺ ⏺ start: %s", tt(e))), e.running = !0;
|
|
745
745
|
let t = 0;
|
|
746
746
|
return e.gclass.gmt.mt_start && (t = e.gclass.gmt.mt_start(e)), t;
|
|
@@ -752,9 +752,9 @@
|
|
|
752
752
|
return e.gclass.gclass_flag & w.gcflag_manual_start || Ye(e) ? 1 : (Ke(e) || Le(e), 0);
|
|
753
753
|
}
|
|
754
754
|
function Ge(e) {
|
|
755
|
-
if (ot(e)) return
|
|
756
|
-
if (!e.running) return
|
|
757
|
-
e.playing && (
|
|
755
|
+
if (ot(e)) return dn("gobj NULL or DESTROYED"), -1;
|
|
756
|
+
if (!e.running) return dn(`${et(e)}: GObj NOT RUNNING`), -1;
|
|
757
|
+
e.playing && (bn(`${et(e)}: GObj stopping without previous pause`), xe(e)), J(e) && P(n("⏹ ⏹ stop: %s", tt(e))), e.running = !1;
|
|
758
758
|
let t = 0;
|
|
759
759
|
return e.gclass.gmt.mt_stop && (t = e.gclass.gmt.mt_stop(e)), t;
|
|
760
760
|
}
|
|
@@ -762,22 +762,22 @@
|
|
|
762
762
|
return Ke(e) && Ge(e), 0;
|
|
763
763
|
}
|
|
764
764
|
function Me(e) {
|
|
765
|
-
return ot(e) ? (
|
|
765
|
+
return ot(e) ? (dn("gobj NULL or DESTROYED"), -1) : at(e, A.WALK_FIRST2LAST, Ve, 0, 0);
|
|
766
766
|
}
|
|
767
767
|
function We(e) {
|
|
768
|
-
if (ot(e)) return
|
|
769
|
-
if (e.playing) return
|
|
770
|
-
if (e.disabled) return
|
|
768
|
+
if (ot(e)) return dn(`gobj NULL or DESTROYED: ${et(e)}`), -1;
|
|
769
|
+
if (e.playing) return dn(`${et(e)}: GObj ALREADY PLAYING`), -1;
|
|
770
|
+
if (e.disabled) return dn(`${et(e)}: GObj DISABLED`), -1;
|
|
771
771
|
if (!Ke(e)) {
|
|
772
|
-
if (e.gclass.gclass_flag & w.gcflag_required_start_to_play) return
|
|
773
|
-
|
|
772
|
+
if (e.gclass.gclass_flag & w.gcflag_required_start_to_play) return dn(`${et(e)}: Cannot play, start not done`), -1;
|
|
773
|
+
bn(`${et(e)}: GObj playing without previous start`), Le(e);
|
|
774
774
|
}
|
|
775
775
|
J(e) && P(n("⏯ ⏯ play: %s", tt(e))), e.playing = !0;
|
|
776
776
|
let t = 0;
|
|
777
777
|
return e.gclass.gmt.mt_play && (t = e.gclass.gmt.mt_play(e), (t < 0 || !1 === t) && (e.playing = !1)), t;
|
|
778
778
|
}
|
|
779
779
|
function xe(e) {
|
|
780
|
-
return ot(e) ? (
|
|
780
|
+
return ot(e) ? (dn("gobj NULL or DESTROYED"), -1) : e.playing ? (J(e) && P(n("⏸ ⏸ pause: %s", tt(e))), e.playing = !1, e.gclass.gmt.mt_pause ? e.gclass.gmt.mt_pause(e) : 0) : (dn(`${et(e)}: GObj NOT PLAYING`), -1);
|
|
781
781
|
}
|
|
782
782
|
function Ke(e) {
|
|
783
783
|
return !ot(e) && e.running;
|
|
@@ -807,50 +807,50 @@
|
|
|
807
807
|
return e ? jt(e, "yuno_id") : "";
|
|
808
808
|
}
|
|
809
809
|
function Xe(e) {
|
|
810
|
-
return
|
|
810
|
+
return Mn(e) ? e.gobj_name : (dn("gobj bad type"), null);
|
|
811
811
|
}
|
|
812
812
|
function Ze(e) {
|
|
813
|
-
return
|
|
813
|
+
return Mn(e) ? e.gclass.gclass_name : (dn("gobj NULL of bad type"), null);
|
|
814
814
|
}
|
|
815
815
|
function et(e) {
|
|
816
|
-
return
|
|
816
|
+
return Mn(e) ? e.gclass.gclass_name + "^" + Xe(e) : (dn("gobj bad type"), null);
|
|
817
817
|
}
|
|
818
818
|
function tt(e) {
|
|
819
|
-
if (!
|
|
819
|
+
if (!Mn(e)) return dn("gobj NULL of bad type"), null;
|
|
820
820
|
let t = et(e), n = nt(e);
|
|
821
821
|
for (; n;) t = et(n) + "`" + t, n = nt(n);
|
|
822
822
|
return t;
|
|
823
823
|
}
|
|
824
824
|
function nt(e) {
|
|
825
|
-
return
|
|
825
|
+
return Mn(e) ? e.parent : (dn("gobj NULL of bad type"), null);
|
|
826
826
|
}
|
|
827
827
|
function rt(e) {
|
|
828
|
-
return
|
|
828
|
+
return Mn(e) ? !!(e.gobj_flag & N.gobj_flag_volatil) : (dn("gobj NULL of bad type"), null);
|
|
829
829
|
}
|
|
830
830
|
function lt(e) {
|
|
831
|
-
return
|
|
831
|
+
return Mn(e) ? !!(e.gobj_flag & N.gobj_flag_pure_child) : (dn("gobj NULL of bad type"), null);
|
|
832
832
|
}
|
|
833
833
|
function ot(e) {
|
|
834
|
-
return !
|
|
834
|
+
return !Mn(e) || !!(e.obflag & (R.obflag_destroyed | R.obflag_destroying));
|
|
835
835
|
}
|
|
836
836
|
function st(e) {
|
|
837
|
-
return
|
|
837
|
+
return Mn(e) ? e.bottom_gobj : (dn("gobj NULL of bad type"), null);
|
|
838
838
|
}
|
|
839
839
|
function it(e, t) {
|
|
840
|
-
if (!
|
|
841
|
-
e.bottom_gobj &&
|
|
840
|
+
if (!Mn(e)) return dn("gobj NULL of bad type"), null;
|
|
841
|
+
e.bottom_gobj && bn(`${et(e)}: bottom_gobj already set`), e.bottom_gobj = t;
|
|
842
842
|
}
|
|
843
843
|
function _t(e, t, n) {
|
|
844
|
-
return
|
|
844
|
+
return Mn(e) ? t ? ge(e.gclass, t, n) : e.gclass.attrs_table : (dn("gobj NULL of bad type"), null);
|
|
845
845
|
}
|
|
846
846
|
function at(e, t, n, r, l) {
|
|
847
|
-
return ot(e) ? (
|
|
847
|
+
return ot(e) ? (dn("gobj NULL, destroying, or bad type"), 0) : ft(e.dl_children, t, n, r, l);
|
|
848
848
|
}
|
|
849
849
|
function ut(e, t, n, r, l) {
|
|
850
|
-
return ot(e) ? (
|
|
850
|
+
return ot(e) ? (dn("gobj NULL, destroying, or bad type"), 0) : dt(e.dl_children, t, n, r, l);
|
|
851
851
|
}
|
|
852
852
|
function ct(e) {
|
|
853
|
-
return "number" == typeof e && isFinite(e) ? e : (null == e ||
|
|
853
|
+
return "number" == typeof e && isFinite(e) ? e : (null == e || dn(`walk callback must return a NUMBER (-1 stop, 0 descend, >0 skip children), got ${typeof e}: taken as 0`), 0);
|
|
854
854
|
}
|
|
855
855
|
function ft(e, t, n, r, l) {
|
|
856
856
|
let o, s = [...e];
|
|
@@ -888,7 +888,7 @@
|
|
|
888
888
|
return 0;
|
|
889
889
|
}
|
|
890
890
|
function bt(e, t) {
|
|
891
|
-
if (!
|
|
891
|
+
if (!Mn(e)) return dn("gobj NULL of bad type"), !1;
|
|
892
892
|
let n = t.__gclass_name__, r = t.__gobj_name__, l = t.__prefix_gobj_name__;
|
|
893
893
|
t.__disabled__;
|
|
894
894
|
let o = t.__state__;
|
|
@@ -904,7 +904,7 @@
|
|
|
904
904
|
return !0;
|
|
905
905
|
}
|
|
906
906
|
function pt(e, t) {
|
|
907
|
-
if (ot(e)) return
|
|
907
|
+
if (ot(e)) return dn("gobj NULL or DESTROYED"), null;
|
|
908
908
|
const n = e.dl_children;
|
|
909
909
|
for (let e = 0; e < n.length; e++) {
|
|
910
910
|
const r = n[e];
|
|
@@ -932,7 +932,7 @@
|
|
|
932
932
|
return o ? (n.splice(0, 1), n = n.join("`"), mt(o, n)) : null;
|
|
933
933
|
}
|
|
934
934
|
function ht(e, t) {
|
|
935
|
-
return !
|
|
935
|
+
return !Wn(t) && !!ge(e.gclass, t, !1);
|
|
936
936
|
}
|
|
937
937
|
function Et(e, t, n) {
|
|
938
938
|
let r = e.jn_attrs;
|
|
@@ -940,49 +940,49 @@
|
|
|
940
940
|
let n = r[t];
|
|
941
941
|
return e.gclass.gmt.mt_reading ? e.gclass.gmt.mt_reading(e, t, n) : n;
|
|
942
942
|
}
|
|
943
|
-
return
|
|
943
|
+
return dn(`${et(e)}: GClass Attribute NOT FOUND, attr ${t}`), null;
|
|
944
944
|
}
|
|
945
|
-
function
|
|
945
|
+
function yt(e, t, n) {
|
|
946
946
|
let r = {}, l = e.gclass.attrs_table;
|
|
947
947
|
for (let n = 0; n < l.length; n++) {
|
|
948
948
|
const o = l[n];
|
|
949
949
|
if (o.name && (-1 === t || o.flag & t)) {
|
|
950
950
|
let t;
|
|
951
|
-
!e.gclass.gmt.mt_reading || e.obflag & R.obflag_destroyed ? t =
|
|
951
|
+
!e.gclass.gmt.mt_reading || e.obflag & R.obflag_destroyed ? t = Sn(e.jn_attrs, o.name) : (t = e.gclass.gmt.mt_reading(e, o.name), void 0 === t && (t = Sn(e.jn_attrs, o.name))), wn(r, o.name, t);
|
|
952
952
|
}
|
|
953
953
|
}
|
|
954
954
|
return r;
|
|
955
955
|
}
|
|
956
|
-
function
|
|
956
|
+
function Tt(e, t) {
|
|
957
957
|
if (t) {
|
|
958
|
-
if (0 ===
|
|
959
|
-
if (0 ===
|
|
960
|
-
if (0 ===
|
|
961
|
-
if (0 ===
|
|
958
|
+
if (0 === Yn(t, "__disabled__")) return Ye(e);
|
|
959
|
+
if (0 === Yn(t, "__running__")) return Ke(e);
|
|
960
|
+
if (0 === Yn(t, "__playing__")) return Je(e);
|
|
961
|
+
if (0 === Yn(t, "__service__")) return Be(e);
|
|
962
962
|
}
|
|
963
963
|
let n = fe(e, t, !1);
|
|
964
|
-
return n ? !e.gclass.gmt.mt_reading || e.obflag & R.obflag_destroyed ?
|
|
964
|
+
return n ? !e.gclass.gmt.mt_reading || e.obflag & R.obflag_destroyed ? Sn(n, t) : e.gclass.gmt.mt_reading(e, t) : (dn(`${et(e)}: GClass Attribute NOT FOUND, attr ${t}`), 0);
|
|
965
965
|
}
|
|
966
966
|
function vt(e, t) {
|
|
967
|
-
t &&
|
|
967
|
+
t && Yn(t, "__trace_level__");
|
|
968
968
|
let n = fe(e, t, !1);
|
|
969
|
-
return n ? !e.gclass.gmt.mt_reading || e.obflag & R.obflag_destroyed ?
|
|
969
|
+
return n ? !e.gclass.gmt.mt_reading || e.obflag & R.obflag_destroyed ? Sn(n, t) : e.gclass.gmt.mt_reading(e, t) : (dn(`${et(e)}: GClass Attribute NOT FOUND, attr ${t}`), 0);
|
|
970
970
|
}
|
|
971
971
|
function jt(e, t) {
|
|
972
|
-
if (t && 0 ===
|
|
972
|
+
if (t && 0 === Yn(t, "__state__")) return kt(e);
|
|
973
973
|
let n = fe(e, t, !1);
|
|
974
|
-
return n ? !e.gclass.gmt.mt_reading || e.obflag & R.obflag_destroyed ?
|
|
974
|
+
return n ? !e.gclass.gmt.mt_reading || e.obflag & R.obflag_destroyed ? Sn(n, t) : e.gclass.gmt.mt_reading(e, t) : (dn(`${et(e)}: GClass Attribute NOT FOUND, attr ${t}`), 0);
|
|
975
975
|
}
|
|
976
976
|
function St(e, t) {
|
|
977
977
|
let n = fe(e, t, !1);
|
|
978
|
-
return n ? !e.gclass.gmt.mt_reading || e.obflag & R.obflag_destroyed ?
|
|
978
|
+
return n ? !e.gclass.gmt.mt_reading || e.obflag & R.obflag_destroyed ? Sn(n, t) : e.gclass.gmt.mt_reading(e, t) : (dn(`${et(e)}: GClass Attribute NOT FOUND, attr ${t}`), 0);
|
|
979
979
|
}
|
|
980
980
|
function Ot(e, t, r, l) {
|
|
981
|
-
if (!
|
|
981
|
+
if (!Ln(t)) return dn(n("gobj_write_attr(%s): path must be a string", et(e))), -1;
|
|
982
982
|
let o, s = e.jn_attrs, i = t.split("`");
|
|
983
983
|
if (i.length <= 1) {
|
|
984
984
|
let l = t;
|
|
985
|
-
return l in s && s.hasOwnProperty(l) ? (s[l] = r,
|
|
985
|
+
return l in s && s.hasOwnProperty(l) ? (s[l] = r, Cn(e.priv) && e.priv.hasOwnProperty(l) && (e.priv[l] = r), e.obflag & R.obflag_created && !(e.obflag & R.obflag_destroyed) && e.gclass.gmt.mt_writing && e.gclass.gmt.mt_writing(e, l), 0) : (dn(n("gobj_write_attr(%s): attr not found '%s'", et(e), l)), -1);
|
|
986
986
|
}
|
|
987
987
|
let _ = i.length;
|
|
988
988
|
for (let t = 0; t < _; t++) {
|
|
@@ -993,10 +993,10 @@
|
|
|
993
993
|
continue;
|
|
994
994
|
}
|
|
995
995
|
let l = e.jn_attrs;
|
|
996
|
-
if (o in l && l.hasOwnProperty(o)) return l[o] = r,
|
|
996
|
+
if (o in l && l.hasOwnProperty(o)) return l[o] = r, Cn(e.priv) && e.priv.hasOwnProperty(o) && (e.priv[o] = r), e.obflag & R.obflag_created && !(e.obflag & R.obflag_destroyed) && e.mt_writing && e.mt_writing(e, o), 0;
|
|
997
997
|
break;
|
|
998
998
|
}
|
|
999
|
-
return
|
|
999
|
+
return dn(n("gobj_write_attr(%s): attr not found '%s'", et(e), o)), -1;
|
|
1000
1000
|
}
|
|
1001
1001
|
function wt(e, t, n, r) {
|
|
1002
1002
|
let l = ce(e), o = 0;
|
|
@@ -1008,21 +1008,21 @@
|
|
|
1008
1008
|
}
|
|
1009
1009
|
function Nt(e, t, n) {
|
|
1010
1010
|
let r = fe(e, t, !1);
|
|
1011
|
-
return r ? (r[t] =
|
|
1011
|
+
return r ? (r[t] = xn(n), Cn(e.priv) && e.priv.hasOwnProperty(t) && (e.priv[t] = n), e.obflag & R.obflag_created && !(e.obflag & R.obflag_destroyed) && e.gclass.gmt.mt_writing && e.gclass.gmt.mt_writing(e, t), 0) : (dn(`${et(e)}: GClass Attribute NOT FOUND, attr ${t}`), -1);
|
|
1012
1012
|
}
|
|
1013
1013
|
function Rt(e, t, n) {
|
|
1014
1014
|
let r = fe(e, t, !1);
|
|
1015
|
-
return r ? (r[t] = parseInt(n),
|
|
1015
|
+
return r ? (r[t] = parseInt(n), Cn(e.priv) && e.priv.hasOwnProperty(t) && (e.priv[t] = n), e.obflag & R.obflag_created && !(e.obflag & R.obflag_destroyed) && e.gclass.gmt.mt_writing && e.gclass.gmt.mt_writing(e, t), 0) : (dn(`${et(e)}: GClass Attribute NOT FOUND, attr ${t}`), -1);
|
|
1016
1016
|
}
|
|
1017
1017
|
function Dt(e, t, n) {
|
|
1018
1018
|
let r = fe(e, t, !1);
|
|
1019
|
-
return r ? (r[t] = String(n),
|
|
1019
|
+
return r ? (r[t] = String(n), Cn(e.priv) && e.priv.hasOwnProperty(t) && (e.priv[t] = n), e.obflag & R.obflag_created && !(e.obflag & R.obflag_destroyed) && e.gclass.gmt.mt_writing && e.gclass.gmt.mt_writing(e, t), 0) : (dn(`${et(e)}: GClass Attribute NOT FOUND, attr ${t}`), -1);
|
|
1020
1020
|
}
|
|
1021
1021
|
function At(e, t) {
|
|
1022
|
-
if (ot(e)) return
|
|
1022
|
+
if (ot(e)) return dn("gobj NULL or DESTROYED"), null;
|
|
1023
1023
|
if (e.current_state.state_name === t) return !1;
|
|
1024
1024
|
let r = pe(e.gclass, t);
|
|
1025
|
-
if (!r) return
|
|
1025
|
+
if (!r) return dn(`${et(e)}: state unknown, state ${t}`), !1;
|
|
1026
1026
|
e.last_state = e.current_state, e.current_state = r;
|
|
1027
1027
|
let l = q(e, "EV_STATE_CHANGED"), o = !!function(e) {
|
|
1028
1028
|
return x(e) & L.TRACE_STATES;
|
|
@@ -1030,10 +1030,10 @@
|
|
|
1030
1030
|
return (l || o) && (1 === C || P(n("🔀🔀 mach(%s%s^%s), new st(%s), prev st(%s)", e.running ? "" : "!!", Ze(e), Xe(e), kt(e), e.last_state.state_name))), !0;
|
|
1031
1031
|
}
|
|
1032
1032
|
function kt(e) {
|
|
1033
|
-
return
|
|
1033
|
+
return Mn(e) ? e.current_state.state_name : (dn("hgobj NULL"), "");
|
|
1034
1034
|
}
|
|
1035
1035
|
function $t(e, t, n) {
|
|
1036
|
-
if (!
|
|
1036
|
+
if (!Mn(e)) return dn("gobj NULL of bad type"), null;
|
|
1037
1037
|
let r = ve(e.gclass, t);
|
|
1038
1038
|
if (r) return r;
|
|
1039
1039
|
if (n) {
|
|
@@ -1063,28 +1063,28 @@
|
|
|
1063
1063
|
return Pt.length > 0 && !Lt && (Lt = !0, setTimeout(Ut, 0)), t;
|
|
1064
1064
|
}
|
|
1065
1065
|
function Ft(e, t, r, l) {
|
|
1066
|
-
if (!(e && e instanceof O)) return
|
|
1067
|
-
if (e.obflag & (R.obflag_destroyed | R.obflag_destroying)) return
|
|
1066
|
+
if (!(e && e instanceof O)) return dn("gobj dst NULL"), -1;
|
|
1067
|
+
if (e.obflag & (R.obflag_destroyed | R.obflag_destroying)) return dn("gobj dst DESTROYED"), -1;
|
|
1068
1068
|
let o = e.current_state;
|
|
1069
|
-
if (!o) return
|
|
1069
|
+
if (!o) return dn(`${et(e)}: current_state NULL`), -1;
|
|
1070
1070
|
let s = q(e, t) && !z(l, t);
|
|
1071
1071
|
h++;
|
|
1072
1072
|
let i = me(o, t);
|
|
1073
|
-
if (!i) return e.gclass.gmt.mt_inject_event ? (h--, s && (P(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 &&
|
|
1073
|
+
if (!i) return e.gclass.gmt.mt_inject_event ? (h--, s && (P(1 === C ? n("🔜 %s %s%s %s", t || "", e.running ? "" : "!!", et(e), o.state_name) : n("🔃 mach(%s%s), st: %s, ev: %s, from(%s%s)", e.running ? "" : "!!", et(e), o.state_name, t || "", l && !l.running ? "!!" : "", et(l))), r && H(e) && kn(r) && hn(r)), e.gclass.gmt.mt_inject_event(e, t, r, l)) : (s && P(n("📛 mach(%s%s^%s), st: %s, ev: %s, 📛📛ERROR Event NOT DEFINED in state📛📛, from(%s%s^%s)", e.running ? "" : "!!", Ze(e), Xe(e), o.state_name, t || "", l && !l.running ? "!!" : "", Ze(l), Xe(l))), dn(`📛📛 Event NOT DEFINED in state 📛📛: ${et(e)}, ${o.state_name}, ${t}`), h--, -1);
|
|
1074
1074
|
if (s) {
|
|
1075
1075
|
if (1 === C) P(n("🔄 %s %s%s %s from %s%s", t || "", e.running ? "" : "!!", et(e), o.state_name, l && !l.running ? "!!" : "", et(l)));
|
|
1076
1076
|
else {
|
|
1077
1077
|
let r = "";
|
|
1078
|
-
i.action && (r =
|
|
1078
|
+
i.action && (r = Ar(i.action)), P(n("🔄 mach(%s%s^%s), st: %s, ev: %s%s%s, ac: %s, from(%s%s^%s)", e.running ? "" : "!!", Ze(e), Xe(e), o.state_name, "", t || "", "", r, l && !l.running ? "!!" : "", Ze(l), Xe(l)));
|
|
1079
1079
|
}
|
|
1080
|
-
r && H(e) &&
|
|
1080
|
+
r && H(e) && kn(r) && hn(r);
|
|
1081
1081
|
}
|
|
1082
1082
|
i.next_state && At(e, i.next_state);
|
|
1083
1083
|
let _ = -1;
|
|
1084
1084
|
try {
|
|
1085
1085
|
i.action && (_ = i.action(e, t, r, l));
|
|
1086
1086
|
} finally {}
|
|
1087
|
-
return !s || 1 === C || e.obflag & R.obflag_destroyed || P(n("<- mach(%s%s^%s), st: %s, ev: %s, ret: %d", e.running ? "" : "!!", Ze(e), Xe(e), e.current_state.state_name, t || "",
|
|
1087
|
+
return !s || 1 === C || e.obflag & R.obflag_destroyed || P(n("<- mach(%s%s^%s), st: %s, ev: %s, ret: %d", e.running ? "" : "!!", Ze(e), Xe(e), e.current_state.state_name, t || "", Un(_) ? _ : 0)), h--, _;
|
|
1088
1088
|
}
|
|
1089
1089
|
var Gt = Object.freeze({
|
|
1090
1090
|
__hard_subscription__: 1,
|
|
@@ -1103,22 +1103,22 @@
|
|
|
1103
1103
|
v()
|
|
1104
1104
|
];
|
|
1105
1105
|
function Mt(e, t, n, r, l) {
|
|
1106
|
-
let o =
|
|
1107
|
-
if (t && t !==
|
|
1108
|
-
let t =
|
|
1109
|
-
|
|
1106
|
+
let o = tr(t, r, "__config__", null), s = tr(t, r, "__global__", null), i = tr(t, r, "__local__", null), _ = nr(t, r, "__filter__", null), a = !0;
|
|
1107
|
+
if (t && t !== er(null, e, "publisher", null) && (a = !1), l && l !== er(null, e, "subscriber", null) && (a = !1), n && n !== Zn(null, e, "event", "") && (a = !1), In(o) > 0) {
|
|
1108
|
+
let t = tr(null, e, "__config__", null);
|
|
1109
|
+
In(t) > 0 && yn(t, o) || (a = !1);
|
|
1110
1110
|
}
|
|
1111
|
-
if (
|
|
1112
|
-
let t =
|
|
1113
|
-
|
|
1111
|
+
if (In(s) > 0) {
|
|
1112
|
+
let t = tr(null, e, "__global__", null);
|
|
1113
|
+
In(t) > 0 && yn(t, s) || (a = !1);
|
|
1114
1114
|
}
|
|
1115
|
-
if (
|
|
1116
|
-
let t =
|
|
1117
|
-
|
|
1115
|
+
if (In(i) > 0) {
|
|
1116
|
+
let t = tr(null, e, "__local__", null);
|
|
1117
|
+
In(t) > 0 && yn(t, i) || (a = !1);
|
|
1118
1118
|
}
|
|
1119
|
-
if (
|
|
1120
|
-
let t =
|
|
1121
|
-
|
|
1119
|
+
if (In(_) > 0) {
|
|
1120
|
+
let t = nr(null, e, "__filter__", null);
|
|
1121
|
+
In(t) > 0 && yn(t, _) || (a = !1);
|
|
1122
1122
|
}
|
|
1123
1123
|
return a;
|
|
1124
1124
|
}
|
|
@@ -1126,7 +1126,7 @@
|
|
|
1126
1126
|
let o = [];
|
|
1127
1127
|
for (let s = 0; s < e.length; s++) {
|
|
1128
1128
|
let i = e[s];
|
|
1129
|
-
Mt(i, t, n, r, l) &&
|
|
1129
|
+
Mt(i, t, n, r, l) && Rn(o, i);
|
|
1130
1130
|
}
|
|
1131
1131
|
return o;
|
|
1132
1132
|
}
|
|
@@ -1135,15 +1135,15 @@
|
|
|
1135
1135
|
return -1;
|
|
1136
1136
|
}
|
|
1137
1137
|
function Kt(e, t, r, l) {
|
|
1138
|
-
let o =
|
|
1139
|
-
if (!!(
|
|
1140
|
-
(B(s) || B(o)) && (P(n("💜💜👎 unsubscribing event '%s': publisher %s, subscriber'%s'", i || "", et(o), et(s))),
|
|
1138
|
+
let o = er(e, t, "publisher", null, zt.KW_REQUIRED), s = er(e, t, "subscriber", null, zt.KW_REQUIRED), i = Zn(e, t, "event", "", zt.KW_REQUIRED);
|
|
1139
|
+
if (!!(Xn(e, t, "subs_flag", null, zt.KW_REQUIRED) & Gt.__hard_subscription__) && !r) return -1;
|
|
1140
|
+
(B(s) || B(o)) && (P(n("💜💜👎 unsubscribing event '%s': publisher %s, subscriber'%s'", i || "", et(o), et(s))), hn(t)), o.obflag & R.obflag_destroyed || l || o.gclass.gmt.mt_subscription_deleted && o.gclass.gmt.mt_subscription_deleted(o, t);
|
|
1141
1141
|
let _ = xt(o.dl_subscriptions, o, i, t, s);
|
|
1142
|
-
return _ >= 0 ?
|
|
1142
|
+
return _ >= 0 ? An(o.dl_subscriptions, _) : (dn(`${et(e)}: subscription in publisher not found`), hn(t)), _ = xt(s.dl_subscribings, o, i, t, s), _ >= 0 ? An(s.dl_subscribings, _) : (dn(`${et(e)}: subscription in subscriber not found`), hn(t)), 0;
|
|
1143
1143
|
}
|
|
1144
1144
|
function Yt(e, t, r, l) {
|
|
1145
|
-
if (null == r && (r = {}), !e) return
|
|
1146
|
-
if (!l) return
|
|
1145
|
+
if (null == r && (r = {}), !e) return dn(`publisher NULL: ev ${t}`), 0;
|
|
1146
|
+
if (!l) return dn(`subscriber NULL: ev ${t}`), 0;
|
|
1147
1147
|
const o = /* @__PURE__ */ new Set([
|
|
1148
1148
|
"__config__",
|
|
1149
1149
|
"__global__",
|
|
@@ -1152,34 +1152,34 @@
|
|
|
1152
1152
|
"__service__"
|
|
1153
1153
|
]);
|
|
1154
1154
|
if (Object.keys(r).forEach((n) => {
|
|
1155
|
-
o.has(n) ||
|
|
1156
|
-
}),
|
|
1157
|
-
else if (!(Ct(e, t, D.EVF_OUTPUT_EVENT) || e.gclass.gclass_flag & w.gcflag_no_check_output_events)) return
|
|
1155
|
+
o.has(n) || dn(`${et(e)}: key ignored in subscription (key: ${n}, event: ${t})`);
|
|
1156
|
+
}), Wn(t)) t = "";
|
|
1157
|
+
else if (!(Ct(e, t, D.EVF_OUTPUT_EVENT) || e.gclass.gclass_flag & w.gcflag_no_check_output_events)) return dn(`event NOT in output event list: ${et(e)}, ${t}`), 0;
|
|
1158
1158
|
let s = Wt(e.dl_subscriptions, e, t, r, l);
|
|
1159
|
-
|
|
1159
|
+
$n(s) > 0 && (dn(`${et(e)}: ${$n(s)} subscription(s) REPEATED, will be deleted and override`), hn(s, "subscription REPEATED"), Bt(e, s, !1));
|
|
1160
1160
|
let i = function(e, t, n, r) {
|
|
1161
1161
|
let l = _e(e, Vt);
|
|
1162
|
-
|
|
1162
|
+
Nn(l, "event", t), Nn(l, "subscriber", r), Nn(l, "publisher", e);
|
|
1163
1163
|
let o = 0;
|
|
1164
1164
|
if (n) {
|
|
1165
|
-
let t =
|
|
1166
|
-
if (
|
|
1167
|
-
let n =
|
|
1168
|
-
if (
|
|
1169
|
-
let t =
|
|
1170
|
-
|
|
1165
|
+
let t = tr(e, n, "__config__", null), r = tr(e, n, "__global__", null), s = tr(e, n, "__local__", null), i = nr(e, n, "__filter__", null), _ = Zn(e, n, "__service__", "");
|
|
1166
|
+
if (In(r) > 0 && Nn(l, "__global__", En(r)), In(t) > 0) {
|
|
1167
|
+
let n = En(t);
|
|
1168
|
+
if (Nn(l, "__config__", n), Hn(n, "__hard_subscription__")) {
|
|
1169
|
+
let t = Qn(e, n, "__hard_subscription__", !1);
|
|
1170
|
+
On(n, "__hard_subscription__"), t && (o |= Gt.__hard_subscription__);
|
|
1171
1171
|
}
|
|
1172
|
-
if (
|
|
1173
|
-
let t =
|
|
1174
|
-
|
|
1172
|
+
if (Hn(n, "__own_event__")) {
|
|
1173
|
+
let t = Qn(e, n, "__own_event__", !1);
|
|
1174
|
+
On(n, "__own_event__"), t && (o |= Gt.__own_event__);
|
|
1175
1175
|
}
|
|
1176
1176
|
}
|
|
1177
|
-
|
|
1177
|
+
In(s) > 0 && Nn(l, "__local__", En(s)), In(i) > 0 && Nn(l, "__filter__", En(i)), Wn(_) || Nn(l, "__service__", _);
|
|
1178
1178
|
}
|
|
1179
|
-
return
|
|
1179
|
+
return Nn(l, "subs_flag", o), l;
|
|
1180
1180
|
}(e, t, r, l);
|
|
1181
|
-
if (!i) return
|
|
1182
|
-
if (
|
|
1181
|
+
if (!i) return dn(`${et(e)}: _create_subscription() FAILED`), 0;
|
|
1182
|
+
if (Rn(e.dl_subscriptions, i), Rn(l.dl_subscribings, i), (B(l) || B(e)) && (P(n("💜💜👍 subscribing event '%s', publisher '%s', subscriber %s", t || "", et(e), et(l))), r && (H(l) || H(e)) && hn(r)), e.gclass.gmt.mt_subscription_added) {
|
|
1183
1183
|
let t = e.gclass.gmt.mt_subscription_added(e, i);
|
|
1184
1184
|
(t < 0 || !1 === t) && (Kt(e, i, !0, !0), i = 0);
|
|
1185
1185
|
}
|
|
@@ -1197,12 +1197,12 @@
|
|
|
1197
1197
|
return Wt(e.dl_subscribings, r, t, n, e);
|
|
1198
1198
|
}
|
|
1199
1199
|
function qt(e, t, r) {
|
|
1200
|
-
if (
|
|
1201
|
-
if (
|
|
1200
|
+
if (Cn(r) || (r = {}), !e || e.obflag & (R.obflag_destroyed | R.obflag_destroying)) return dn("gobj NULL or DESTROYED"), -1;
|
|
1201
|
+
if (Wn(t)) return dn(`${et(e)}: event EMPTY`), -1;
|
|
1202
1202
|
let l = $t(e, t, !0);
|
|
1203
|
-
if (!(l && l.event_flag & (D.EVF_SYSTEM_EVENT | D.EVF_OUTPUT_EVENT) || e.gclass.gclass_flag & w.gcflag_no_check_output_events)) return
|
|
1203
|
+
if (!(l && l.event_flag & (D.EVF_SYSTEM_EVENT | D.EVF_OUTPUT_EVENT) || e.gclass.gclass_flag & w.gcflag_no_check_output_events)) return dn(`event NOT in output event list: ${et(e)}, ev ${t}`), -1;
|
|
1204
1204
|
let o = (B(e) || q(e, t)) && !z(e, t);
|
|
1205
|
-
if (o && (P(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 || "", "")),
|
|
1205
|
+
if (o && (P(1 === C ? n("🔝🔝 %s %s%s %s", t || "", e.running ? "" : "!!", et(e), e.current_state.state_name) : n("🔝🔝 mach(%s%s^%s), st: %s, ev: %s%s%s", e.running ? "" : "!!", Ze(e), Xe(e), e.current_state.state_name, "", t || "", "")), H(e) && kn(r) && hn(r)), e.gclass.gmt.mt_publish_event) {
|
|
1206
1206
|
let n = e.gclass.gmt.mt_publish_event(e, t, r);
|
|
1207
1207
|
if (n <= 0) return n;
|
|
1208
1208
|
}
|
|
@@ -1214,17 +1214,17 @@
|
|
|
1214
1214
|
if (n < 0) break;
|
|
1215
1215
|
if (!n) continue;
|
|
1216
1216
|
}
|
|
1217
|
-
let u =
|
|
1217
|
+
let u = er(e, a, "subscriber", null, zt.KW_REQUIRED);
|
|
1218
1218
|
if (!u || ot(u)) continue;
|
|
1219
|
-
let c =
|
|
1220
|
-
if (
|
|
1221
|
-
|
|
1222
|
-
let l =
|
|
1223
|
-
if (e.gclass.gmt.mt_publication_filter ? d = e.gclass.gmt.mt_publication_filter(e, t, g, u) :
|
|
1219
|
+
let c = Xn(e, a, "subs_flag", 0, zt.KW_REQUIRED), f = Zn(e, a, "event", "", zt.KW_REQUIRED);
|
|
1220
|
+
if (Wn(f) || 0 === Yn(f, t)) {
|
|
1221
|
+
tr(e, a, "__config__", null, 0);
|
|
1222
|
+
let l = tr(e, a, "__global__", null, 0), s = tr(e, a, "__local__", null, 0), f = nr(e, a, "__filter__", null, 0), g = r, d = 1;
|
|
1223
|
+
if (e.gclass.gmt.mt_publication_filter ? d = e.gclass.gmt.mt_publication_filter(e, t, g, u) : In(f) > 0 && (d = sr(g, f) ? 1 : 0, o && (P(n("💜💜🔄%s publishing with filter, event '%s', subscriber'%s', publisher %s", d ? "👍" : "👎", t || "", et(u), et(e))), hn(f))), d < 0) break;
|
|
1224
1224
|
if (!d) continue;
|
|
1225
1225
|
let b = $t(u, t, !0);
|
|
1226
1226
|
if (b && b.event_flag & D.EVF_SYSTEM_EVENT && !It(u, b.event_name, 0)) continue;
|
|
1227
|
-
s &&
|
|
1227
|
+
s && Jn(g, s), l && Tn(g, l), o && (P(1 === C ? n("🔝🔄 %s (%s) %s%s", t || "", t || "", u.running ? "" : "!!", et(u)) : n("🔝🔄 mach(%s%s), st: %s, ev: %s, from(%s%s)", u.running ? "" : "!!", et(u), kt(u), t || "", e && !e.running ? "!!" : "", et(e))), H(e) && kn(g) && hn(g));
|
|
1228
1228
|
let p = Ft(u, t, g, e);
|
|
1229
1229
|
if (p < 0 && c & Gt.__own_event__) {
|
|
1230
1230
|
i = -1;
|
|
@@ -1233,7 +1233,7 @@
|
|
|
1233
1233
|
if (_ += p, i++, ot(e)) break;
|
|
1234
1234
|
}
|
|
1235
1235
|
}
|
|
1236
|
-
return i || l && l.event_flag & D.EVF_NO_WARN_SUBS ||
|
|
1236
|
+
return i || l && l.event_flag & D.EVF_NO_WARN_SUBS || bn(`${et(e)}: Publish event WITHOUT subscribers, ev ${t}`), _;
|
|
1237
1237
|
}
|
|
1238
1238
|
var zt = Object.freeze({
|
|
1239
1239
|
KW_REQUIRED: 1,
|
|
@@ -1255,33 +1255,48 @@
|
|
|
1255
1255
|
JSON_FALSE: 7,
|
|
1256
1256
|
JSON_NULL: 8
|
|
1257
1257
|
});
|
|
1258
|
-
var Qt = "undefined" != typeof window ? window.console : console, Xt = Qt.error, Zt = Qt.warn, en = Qt.info, tn = Qt.debug, nn = null;
|
|
1259
|
-
var
|
|
1260
|
-
var
|
|
1261
|
-
function
|
|
1262
|
-
if (!
|
|
1263
|
-
if (!
|
|
1258
|
+
var Qt = "undefined" != typeof window ? window.console : console, Xt = Qt.error, Zt = Qt.warn, en = Qt.info, tn = Qt.debug, nn = null, rn = 600, ln = [];
|
|
1259
|
+
var on = !0;
|
|
1260
|
+
var sn = null;
|
|
1261
|
+
function _n(e, t) {
|
|
1262
|
+
if (!on) return !1;
|
|
1263
|
+
if (!sn) return !0;
|
|
1264
1264
|
try {
|
|
1265
|
-
return !!
|
|
1265
|
+
return !!sn(e, t);
|
|
1266
1266
|
} catch (e) {
|
|
1267
1267
|
return !0;
|
|
1268
1268
|
}
|
|
1269
1269
|
}
|
|
1270
|
-
var
|
|
1271
|
-
function
|
|
1272
|
-
|
|
1273
|
-
|
|
1270
|
+
var an = !1;
|
|
1271
|
+
function un(e, t, n) {
|
|
1272
|
+
an || (function(e, t, n) {
|
|
1273
|
+
let r = t;
|
|
1274
|
+
if ("json" === e) try {
|
|
1275
|
+
r = JSON.stringify(t);
|
|
1276
|
+
} catch (e) {
|
|
1277
|
+
r = String(t);
|
|
1278
|
+
}
|
|
1279
|
+
ln.push([
|
|
1280
|
+
e,
|
|
1281
|
+
r,
|
|
1282
|
+
n
|
|
1283
|
+
]), ln.length > rn && ln.shift();
|
|
1284
|
+
}(e, t, n), cn(e, t, n));
|
|
1285
|
+
}
|
|
1286
|
+
function cn(e, t, n) {
|
|
1287
|
+
if (nn && !an) {
|
|
1288
|
+
an = !0;
|
|
1274
1289
|
try {
|
|
1275
1290
|
nn(e, t, n);
|
|
1276
1291
|
} catch (e) {} finally {
|
|
1277
|
-
|
|
1292
|
+
an = !1;
|
|
1278
1293
|
}
|
|
1279
1294
|
}
|
|
1280
1295
|
}
|
|
1281
|
-
function
|
|
1296
|
+
function fn(e) {
|
|
1282
1297
|
e ? (Xt = e, Zt = e) : (Xt = Qt.error, Zt = Qt.warn);
|
|
1283
1298
|
}
|
|
1284
|
-
function
|
|
1299
|
+
function gn(e) {
|
|
1285
1300
|
const t = Array.prototype.slice.call(arguments);
|
|
1286
1301
|
let n = "";
|
|
1287
1302
|
if ("string" == typeof e) {
|
|
@@ -1303,36 +1318,36 @@
|
|
|
1303
1318
|
} else n = t.map((e) => "object" == typeof e ? JSON.stringify(e) : String(e)).join(" ");
|
|
1304
1319
|
return n;
|
|
1305
1320
|
}
|
|
1306
|
-
function
|
|
1307
|
-
let t =
|
|
1308
|
-
Xt && (Xt === Qt.error ?
|
|
1321
|
+
function dn(e) {
|
|
1322
|
+
let t = gn(e), n = Nr();
|
|
1323
|
+
Xt && (Xt === Qt.error ? _n("error", t) && Xt("%c" + n + " ERROR: " + String(t), "color:red") : (_n("error", t) && Qt.error("%c" + n + " ERROR: " + String(t), "color:red"), Xt(`${n} ERROR: ${String(t)}`))), un("error", t, n);
|
|
1309
1324
|
}
|
|
1310
|
-
function
|
|
1311
|
-
let t =
|
|
1312
|
-
Zt && (Zt === Qt.warn ?
|
|
1325
|
+
function bn(e) {
|
|
1326
|
+
let t = gn(e), n = Nr();
|
|
1327
|
+
Zt && (Zt === Qt.warn ? _n("warning", t) && Zt("%c" + n + " WARNING: " + String(t), "color:yellow") : (_n("warning", t) && Qt.warn("%c" + n + " WARNING: " + String(t), "color:yellow"), Zt(`${n} WARNING: ${String(t)}`))), un("warning", t, n);
|
|
1313
1328
|
}
|
|
1314
|
-
function
|
|
1315
|
-
let t =
|
|
1316
|
-
tn &&
|
|
1329
|
+
function pn(e) {
|
|
1330
|
+
let t = gn(e), n = Nr();
|
|
1331
|
+
tn && _n("debug", t) && tn("%c" + n + " DEBUG: " + String(t), "color:silver"), un("debug", t, n);
|
|
1317
1332
|
}
|
|
1318
|
-
function
|
|
1319
|
-
let t =
|
|
1320
|
-
tn &&
|
|
1333
|
+
function mn(e) {
|
|
1334
|
+
let t = gn(e), n = Nr();
|
|
1335
|
+
tn && _n("msg", t) && tn("%c" + n + " MSG: " + String(t), "color:cyan"), un("msg", t, n);
|
|
1321
1336
|
}
|
|
1322
|
-
function
|
|
1323
|
-
|
|
1337
|
+
function hn(e, t) {
|
|
1338
|
+
_n("json", t) && (t && window.console.warn("=====> " + t), window.console.dir(e)), un("json", e, Nr());
|
|
1324
1339
|
}
|
|
1325
|
-
function
|
|
1340
|
+
function En(e) {
|
|
1326
1341
|
return structuredClone(e);
|
|
1327
1342
|
}
|
|
1328
|
-
function
|
|
1343
|
+
function yn(e, t) {
|
|
1329
1344
|
if (e === t) return !0;
|
|
1330
1345
|
if (null === e || null === t) return e === t;
|
|
1331
1346
|
if (typeof e != typeof t) return !1;
|
|
1332
1347
|
if (Array.isArray(e) !== Array.isArray(t)) return !1;
|
|
1333
1348
|
if (Array.isArray(e)) {
|
|
1334
1349
|
if (e.length !== t.length) return !1;
|
|
1335
|
-
for (let n = 0; n < e.length; n++) if (!
|
|
1350
|
+
for (let n = 0; n < e.length; n++) if (!yn(e[n], t[n])) return !1;
|
|
1336
1351
|
return !0;
|
|
1337
1352
|
}
|
|
1338
1353
|
if ("object" == typeof e) {
|
|
@@ -1340,211 +1355,211 @@
|
|
|
1340
1355
|
if (n.length !== r.length) return !1;
|
|
1341
1356
|
for (let l = 0; l < n.length; l++) {
|
|
1342
1357
|
if (n[l] !== r[l]) return !1;
|
|
1343
|
-
if (!
|
|
1358
|
+
if (!yn(e[n[l]], t[r[l]])) return !1;
|
|
1344
1359
|
}
|
|
1345
1360
|
return !0;
|
|
1346
1361
|
}
|
|
1347
1362
|
return e === t;
|
|
1348
1363
|
}
|
|
1349
|
-
function
|
|
1364
|
+
function Tn(e, t) {
|
|
1350
1365
|
if (!t) return e;
|
|
1351
1366
|
for (let n of Object.keys(t)) e[n] = t[n];
|
|
1352
1367
|
return e;
|
|
1353
1368
|
}
|
|
1354
|
-
function
|
|
1369
|
+
function vn(e, t) {
|
|
1355
1370
|
if (!t) return e;
|
|
1356
1371
|
for (let n in t) t.hasOwnProperty(n) && e.hasOwnProperty(n) && (e[n] = t[n]);
|
|
1357
1372
|
return e;
|
|
1358
1373
|
}
|
|
1359
|
-
function
|
|
1374
|
+
function jn(e, t) {
|
|
1360
1375
|
if (!t) return e;
|
|
1361
1376
|
for (let n in t) t.hasOwnProperty(n) && !e.hasOwnProperty(n) && (e[n] = t[n]);
|
|
1362
1377
|
return e;
|
|
1363
1378
|
}
|
|
1364
|
-
function
|
|
1379
|
+
function Sn(e, t) {
|
|
1365
1380
|
if (e && e.hasOwnProperty(t)) return e[t];
|
|
1366
1381
|
}
|
|
1367
|
-
function
|
|
1382
|
+
function On(e, t) {
|
|
1368
1383
|
e && e.hasOwnProperty(t) && delete e[t];
|
|
1369
1384
|
}
|
|
1370
|
-
function
|
|
1385
|
+
function wn(e, t, n) {
|
|
1371
1386
|
e[t] = n;
|
|
1372
1387
|
}
|
|
1373
|
-
function
|
|
1388
|
+
function Nn(e, t, n) {
|
|
1374
1389
|
e[t] = n;
|
|
1375
1390
|
}
|
|
1376
|
-
function
|
|
1391
|
+
function Rn(e, t) {
|
|
1377
1392
|
e.push(t);
|
|
1378
1393
|
}
|
|
1379
|
-
function
|
|
1394
|
+
function Dn(e, t) {
|
|
1380
1395
|
e.push(t);
|
|
1381
1396
|
}
|
|
1382
|
-
function
|
|
1397
|
+
function An(e, t) {
|
|
1383
1398
|
e.splice(t, 1);
|
|
1384
1399
|
}
|
|
1385
|
-
function
|
|
1386
|
-
return
|
|
1400
|
+
function kn(e) {
|
|
1401
|
+
return Cn(e) ? Object.keys(e).length : 0;
|
|
1387
1402
|
}
|
|
1388
|
-
function
|
|
1389
|
-
return
|
|
1403
|
+
function $n(e) {
|
|
1404
|
+
return Pn(e) ? e.length : 0;
|
|
1390
1405
|
}
|
|
1391
|
-
function
|
|
1392
|
-
return
|
|
1406
|
+
function In(e) {
|
|
1407
|
+
return Cn(e) ? Object.keys(e).length : Pn(e) ? e.length : Ln(e) && e.length > 0 ? 1 : 0;
|
|
1393
1408
|
}
|
|
1394
|
-
function
|
|
1409
|
+
function Cn(e) {
|
|
1395
1410
|
return null !== e && "object" == typeof e && !Array.isArray(e);
|
|
1396
1411
|
}
|
|
1397
|
-
function
|
|
1412
|
+
function Pn(e) {
|
|
1398
1413
|
return Array.isArray(e);
|
|
1399
1414
|
}
|
|
1400
|
-
function
|
|
1415
|
+
function Ln(e) {
|
|
1401
1416
|
return "string" == typeof e;
|
|
1402
1417
|
}
|
|
1403
|
-
function
|
|
1418
|
+
function Un(e) {
|
|
1404
1419
|
return "number" == typeof e && Number.isFinite(e);
|
|
1405
1420
|
}
|
|
1406
|
-
function
|
|
1421
|
+
function Fn(e) {
|
|
1407
1422
|
return "boolean" == typeof e;
|
|
1408
1423
|
}
|
|
1409
|
-
function
|
|
1424
|
+
function Gn(e) {
|
|
1410
1425
|
return null == e;
|
|
1411
1426
|
}
|
|
1412
|
-
function
|
|
1427
|
+
function Vn(e) {
|
|
1413
1428
|
return "function" == typeof e;
|
|
1414
1429
|
}
|
|
1415
|
-
function
|
|
1430
|
+
function Mn(e) {
|
|
1416
1431
|
return e instanceof O;
|
|
1417
1432
|
}
|
|
1418
|
-
function
|
|
1419
|
-
return !
|
|
1433
|
+
function Wn(e) {
|
|
1434
|
+
return !Ln(e) || 0 === e.length;
|
|
1420
1435
|
}
|
|
1421
|
-
function
|
|
1422
|
-
return
|
|
1436
|
+
function xn(e) {
|
|
1437
|
+
return Un(e) ? Boolean(e) : /^\s*(true|1|on)\s*$/i.test(e);
|
|
1423
1438
|
}
|
|
1424
|
-
function
|
|
1439
|
+
function Kn(e, t) {
|
|
1425
1440
|
return e === t ? 0 : e > t ? 1 : -1;
|
|
1426
1441
|
}
|
|
1427
|
-
function
|
|
1442
|
+
function Yn(e, t) {
|
|
1428
1443
|
let n = e.toLowerCase(), r = t.toLowerCase();
|
|
1429
1444
|
return n === r ? 0 : n > r ? 1 : -1;
|
|
1430
1445
|
}
|
|
1431
|
-
function
|
|
1432
|
-
if (
|
|
1433
|
-
if (
|
|
1446
|
+
function Bn(e, t) {
|
|
1447
|
+
if (Cn(e) || Cn(t) || Pn(e) || Pn(t)) return 0;
|
|
1448
|
+
if (Un(e) || Un(t)) {
|
|
1434
1449
|
let n = Number(e), r = Number(t);
|
|
1435
1450
|
return n > r ? 1 : n < r ? -1 : 0;
|
|
1436
1451
|
}
|
|
1437
|
-
if (
|
|
1452
|
+
if (Fn(e) || Fn(t)) {
|
|
1438
1453
|
let n = Number(e), r = Number(t);
|
|
1439
1454
|
return n > r ? 1 : n < r ? -1 : 0;
|
|
1440
1455
|
}
|
|
1441
|
-
return
|
|
1456
|
+
return Kn(String(e), String(t));
|
|
1442
1457
|
}
|
|
1443
|
-
function
|
|
1444
|
-
if ("object" != typeof t || Array.isArray(t)) if (Array.isArray(t)) for (const n of t)
|
|
1458
|
+
function Jn(e, t) {
|
|
1459
|
+
if ("object" != typeof t || Array.isArray(t)) if (Array.isArray(t)) for (const n of t) Jn(e, n);
|
|
1445
1460
|
else "string" == typeof t && delete e[t];
|
|
1446
1461
|
else for (const n of Object.keys(t)) delete e[n];
|
|
1447
1462
|
}
|
|
1448
|
-
function
|
|
1463
|
+
function Hn(e, t) {
|
|
1449
1464
|
return !(!(t in e) || !e.hasOwnProperty(t));
|
|
1450
1465
|
}
|
|
1451
|
-
function
|
|
1452
|
-
if (e && !
|
|
1453
|
-
if (!
|
|
1466
|
+
function qn(e, t, n, r) {
|
|
1467
|
+
if (e && !Mn(e) && dn("GObj bad instanceof"), !Cn(t) && !Pn(t)) return dn(`${et(e)}: kw must be list or dict`), 0;
|
|
1468
|
+
if (!Ln(n)) return dn(`${et(e)}: path must be a string: ${String(n)}`), 0;
|
|
1454
1469
|
let l = n.split("`");
|
|
1455
1470
|
if (l.length <= 1) return t[n];
|
|
1456
1471
|
let o = l.length;
|
|
1457
|
-
for (let s = 0; s < o; s++) if (void 0 === (t = t[l[s]])) return void (r &&
|
|
1472
|
+
for (let s = 0; s < o; s++) if (void 0 === (t = t[l[s]])) return void (r && dn(`${et(e)}: path not found: ${String(n)}`));
|
|
1458
1473
|
return t;
|
|
1459
1474
|
}
|
|
1460
|
-
function
|
|
1461
|
-
e && !
|
|
1475
|
+
function zn(e, t, n) {
|
|
1476
|
+
e && !Mn(e) && dn("GObj bad instanceof");
|
|
1462
1477
|
let [r, l] = function(e, t) {
|
|
1463
1478
|
let n = e.lastIndexOf(t);
|
|
1464
1479
|
return -1 === n ? [e, ""] : [e.substring(0, n), e.substring(n + 1)];
|
|
1465
1480
|
}(n, "`");
|
|
1466
|
-
return
|
|
1481
|
+
return Wn(l) ? On(t, n) : On(qn(e, t, r, !0), l), 0;
|
|
1467
1482
|
}
|
|
1468
|
-
function
|
|
1469
|
-
e && !
|
|
1470
|
-
let o =
|
|
1483
|
+
function Qn(e, t, n, r, l) {
|
|
1484
|
+
e && !Mn(e) && dn("GObj bad instanceof");
|
|
1485
|
+
let o = qn(e, t, n, !1);
|
|
1471
1486
|
const s = l && l & zt.KW_REQUIRED, i = l && l & zt.KW_CREATE, _ = l && l & zt.KW_EXTRACT;
|
|
1472
1487
|
if (void 0 === o) {
|
|
1473
1488
|
if (i) {
|
|
1474
1489
|
let l = Boolean(r);
|
|
1475
|
-
return
|
|
1490
|
+
return rr(e, t, n, l), l;
|
|
1476
1491
|
}
|
|
1477
|
-
return s && (
|
|
1492
|
+
return s && (dn(`path not found: '${n}'`), hn(t)), Boolean(r);
|
|
1478
1493
|
}
|
|
1479
|
-
return _ &&
|
|
1494
|
+
return _ && zn(e, t, n), Boolean(o);
|
|
1480
1495
|
}
|
|
1481
|
-
function
|
|
1482
|
-
e && !
|
|
1483
|
-
let o =
|
|
1496
|
+
function Xn(e, t, n, r, l) {
|
|
1497
|
+
e && !Mn(e) && dn("GObj bad instanceof");
|
|
1498
|
+
let o = qn(e, t, n, !1);
|
|
1484
1499
|
const s = l && l & zt.KW_REQUIRED, i = l && l & zt.KW_CREATE, _ = l && l & zt.KW_EXTRACT;
|
|
1485
1500
|
if (void 0 === o) {
|
|
1486
1501
|
if (i) {
|
|
1487
1502
|
let l = parseInt(r);
|
|
1488
|
-
return
|
|
1503
|
+
return rr(e, t, n, l), l;
|
|
1489
1504
|
}
|
|
1490
|
-
return s && (
|
|
1505
|
+
return s && (dn(`path not found: '${n}'`), hn(t)), parseInt(r);
|
|
1491
1506
|
}
|
|
1492
|
-
return _ &&
|
|
1507
|
+
return _ && zn(e, t, n), Un(o) ? parseInt(o) : (s && (dn(`path value MUST BE a number: ${n}`), mn(t)), parseInt(r));
|
|
1493
1508
|
}
|
|
1494
|
-
function
|
|
1495
|
-
e && !
|
|
1496
|
-
let o =
|
|
1509
|
+
function Zn(e, t, n, r, l) {
|
|
1510
|
+
e && !Mn(e) && dn("GObj bad instanceof");
|
|
1511
|
+
let o = qn(e, t, n, !1);
|
|
1497
1512
|
const s = l && l & zt.KW_REQUIRED, i = l && l & zt.KW_CREATE, _ = l && l & zt.KW_EXTRACT;
|
|
1498
1513
|
if (void 0 === o) {
|
|
1499
1514
|
if (i) {
|
|
1500
1515
|
let l = String(r);
|
|
1501
|
-
return
|
|
1516
|
+
return rr(e, t, n, l), l;
|
|
1502
1517
|
}
|
|
1503
|
-
return s && (
|
|
1518
|
+
return s && (dn(`path not found: '${n}'`), hn(t)), String(r);
|
|
1504
1519
|
}
|
|
1505
|
-
return _ &&
|
|
1520
|
+
return _ && zn(e, t, n), Ln(o) ? String(o) : (s && (dn(`${et(e)}: path value MUST BE a string: ${n}`), mn(t)), String(r));
|
|
1506
1521
|
}
|
|
1507
|
-
function
|
|
1508
|
-
e && !
|
|
1509
|
-
let o =
|
|
1522
|
+
function er(e, t, n, r, l) {
|
|
1523
|
+
e && !Mn(e) && dn("GObj bad instanceof");
|
|
1524
|
+
let o = qn(e, t, n, !1);
|
|
1510
1525
|
const s = l && l & zt.KW_REQUIRED, i = l && l & zt.KW_CREATE, _ = l && l & zt.KW_EXTRACT;
|
|
1511
1526
|
if (void 0 === o) {
|
|
1512
1527
|
if (i) {
|
|
1513
1528
|
let l = r;
|
|
1514
|
-
return
|
|
1529
|
+
return rr(e, t, n, l), l;
|
|
1515
1530
|
}
|
|
1516
|
-
return s && (
|
|
1531
|
+
return s && (dn(`path not found: '${n}'`), hn(t)), r;
|
|
1517
1532
|
}
|
|
1518
|
-
return _ &&
|
|
1533
|
+
return _ && zn(e, t, n), o;
|
|
1519
1534
|
}
|
|
1520
|
-
function
|
|
1521
|
-
e && !
|
|
1522
|
-
let o =
|
|
1535
|
+
function tr(e, t, n, r, l) {
|
|
1536
|
+
e && !Mn(e) && dn("GObj bad instanceof");
|
|
1537
|
+
let o = qn(e, t, n, !1);
|
|
1523
1538
|
const s = l && l & zt.KW_REQUIRED, i = l && l & zt.KW_CREATE, _ = l && l & zt.KW_EXTRACT;
|
|
1524
1539
|
if (void 0 === o) {
|
|
1525
1540
|
if (i) {
|
|
1526
1541
|
let l = Object(r);
|
|
1527
|
-
return
|
|
1542
|
+
return rr(e, t, n, l), l;
|
|
1528
1543
|
}
|
|
1529
|
-
return s && (
|
|
1544
|
+
return s && (dn(`path not found: '${n}'`), hn(t)), Object(r);
|
|
1530
1545
|
}
|
|
1531
|
-
return _ &&
|
|
1546
|
+
return _ && zn(e, t, n), Cn(o) ? Object(o) : (s && (dn(`path value MUST BE a dict: ${n}`), mn(t)), Object(r));
|
|
1532
1547
|
}
|
|
1533
|
-
function
|
|
1534
|
-
e && !
|
|
1535
|
-
let o =
|
|
1548
|
+
function nr(e, t, n, r, l) {
|
|
1549
|
+
e && !Mn(e) && dn("GObj bad instanceof");
|
|
1550
|
+
let o = qn(e, t, n, !1);
|
|
1536
1551
|
const s = l && l & zt.KW_REQUIRED, i = l && l & zt.KW_CREATE, _ = l && l & zt.KW_EXTRACT;
|
|
1537
1552
|
if (void 0 === o) {
|
|
1538
1553
|
if (i) {
|
|
1539
1554
|
let l = r;
|
|
1540
|
-
return
|
|
1555
|
+
return rr(e, t, n, l), l;
|
|
1541
1556
|
}
|
|
1542
|
-
return s && (
|
|
1557
|
+
return s && (dn(`path not found: '${n}'`), hn(t)), r;
|
|
1543
1558
|
}
|
|
1544
|
-
return _ &&
|
|
1559
|
+
return _ && zn(e, t, n), o;
|
|
1545
1560
|
}
|
|
1546
|
-
function
|
|
1547
|
-
if (e && !
|
|
1561
|
+
function rr(e, t, n, r) {
|
|
1562
|
+
if (e && !Mn(e) && dn("GObj bad instanceof"), !Cn(t)) return dn("kw is not an object"), -1;
|
|
1548
1563
|
let l = n.split("`");
|
|
1549
1564
|
if (l.length <= 1) return t[n] = r, 0;
|
|
1550
1565
|
let o = l.length;
|
|
@@ -1554,34 +1569,34 @@
|
|
|
1554
1569
|
}
|
|
1555
1570
|
return 0;
|
|
1556
1571
|
}
|
|
1557
|
-
function
|
|
1558
|
-
if (e && !
|
|
1559
|
-
let o =
|
|
1560
|
-
return
|
|
1572
|
+
function lr(e, t, n, r, l) {
|
|
1573
|
+
if (e && !Mn(e) && dn("GObj bad instanceof"), !Cn(t)) return dn("kw is not an object"), -1;
|
|
1574
|
+
let o = tr(e, t, n, {}, !0);
|
|
1575
|
+
return Cn(o) ? (o[r] = l, 0) : (dn("subdict is not an object"), -1);
|
|
1561
1576
|
}
|
|
1562
|
-
function
|
|
1577
|
+
function or(e, t, r) {
|
|
1563
1578
|
let l = "", o = !1;
|
|
1564
|
-
if (
|
|
1579
|
+
if (Pn(t)) {
|
|
1565
1580
|
o = !1;
|
|
1566
1581
|
for (let s = 0; s < t.length; s++) {
|
|
1567
1582
|
let i = t[s];
|
|
1568
|
-
if (l =
|
|
1583
|
+
if (l = Wn(r) ? n("%s", r) : n("%s`%d", r, s), o = or(e, i, l), o) break;
|
|
1569
1584
|
}
|
|
1570
|
-
} else if (
|
|
1585
|
+
} else if (Cn(t)) {
|
|
1571
1586
|
o = !0;
|
|
1572
1587
|
let s = Object.keys(t);
|
|
1573
1588
|
for (let i = 0; i < s.length; i++) {
|
|
1574
1589
|
let _ = s[i], a = t[_];
|
|
1575
|
-
if (l =
|
|
1576
|
-
if (o =
|
|
1590
|
+
if (l = Wn(r) ? n("%s", _) : n("%s`%s", r, _), Pn(a) || Cn(a)) {
|
|
1591
|
+
if (o = or(e, a, l), !o) break;
|
|
1577
1592
|
continue;
|
|
1578
1593
|
}
|
|
1579
|
-
let u =
|
|
1580
|
-
if (u || (u =
|
|
1594
|
+
let u = nr(0, e, l, 0, 0);
|
|
1595
|
+
if (u || (u = Sn(e, l)), !u) {
|
|
1581
1596
|
o = !1;
|
|
1582
1597
|
break;
|
|
1583
1598
|
}
|
|
1584
|
-
if (0 !==
|
|
1599
|
+
if (0 !== Bn(u, a)) {
|
|
1585
1600
|
o = !1;
|
|
1586
1601
|
break;
|
|
1587
1602
|
}
|
|
@@ -1589,58 +1604,58 @@
|
|
|
1589
1604
|
}
|
|
1590
1605
|
return o;
|
|
1591
1606
|
}
|
|
1592
|
-
function
|
|
1593
|
-
return 0 ===
|
|
1607
|
+
function sr(e, t) {
|
|
1608
|
+
return 0 === In(t) || or(e, t, "");
|
|
1594
1609
|
}
|
|
1595
|
-
function
|
|
1596
|
-
e && !
|
|
1610
|
+
function ir(e, t, n, r) {
|
|
1611
|
+
e && !Mn(e) && dn("GObj bad instanceof");
|
|
1597
1612
|
let l = {};
|
|
1598
|
-
if (
|
|
1613
|
+
if (Ln(n) && !Wn(n)) {
|
|
1599
1614
|
let o = n;
|
|
1600
|
-
t.hasOwnProperty(o) ? l[o] = t[o] : r &&
|
|
1601
|
-
} else if (
|
|
1615
|
+
t.hasOwnProperty(o) ? l[o] = t[o] : r && dn(`${et(e)}: key not found: ${o}`);
|
|
1616
|
+
} else if (Cn(n) && kn(n) > 0) for (let o of Object.keys(n)) t.hasOwnProperty(o) ? l[o] = t[o] : r && dn(`${et(e)}: key not found: ${o}`);
|
|
1602
1617
|
else {
|
|
1603
|
-
if (!(
|
|
1618
|
+
if (!(Pn(n) && $n(n) > 0)) return t;
|
|
1604
1619
|
for (let o = 0; o < n.length; o++) {
|
|
1605
1620
|
let s = n[o];
|
|
1606
|
-
t.hasOwnProperty(s) ? l[s] = t[s] : r &&
|
|
1621
|
+
t.hasOwnProperty(s) ? l[s] = t[s] : r && dn(`${et(e)}: key not found: ${s}`);
|
|
1607
1622
|
}
|
|
1608
1623
|
}
|
|
1609
1624
|
return l;
|
|
1610
1625
|
}
|
|
1611
|
-
function
|
|
1626
|
+
function _r(e, t, n, r) {
|
|
1612
1627
|
let l = {};
|
|
1613
|
-
if (
|
|
1628
|
+
if (Tn(l, t), Ln(n) && !Wn(n)) {
|
|
1614
1629
|
let o = n;
|
|
1615
|
-
|
|
1616
|
-
} else if (
|
|
1630
|
+
nr(e, t, o, 0, 0) ? On(l, o) : r && dn(`${et(e)}: key not found: ${o}`);
|
|
1631
|
+
} else if (Cn(n) && kn(n) > 0) for (let o of Object.keys(n)) t.hasOwnProperty(o) ? On(l, o) : r && dn(`${et(e)}: key not found: ${o}`);
|
|
1617
1632
|
else {
|
|
1618
|
-
if (!(
|
|
1633
|
+
if (!(Pn(n) && $n(n) > 0)) return {};
|
|
1619
1634
|
for (let o = 0; o < n.length; o++) {
|
|
1620
1635
|
let s = n[o];
|
|
1621
|
-
t.hasOwnProperty(s) ?
|
|
1636
|
+
t.hasOwnProperty(s) ? On(l, s) : r && dn(`${et(e)}: key not found: ${s}`);
|
|
1622
1637
|
}
|
|
1623
1638
|
}
|
|
1624
1639
|
return l;
|
|
1625
1640
|
}
|
|
1626
|
-
function
|
|
1641
|
+
function ar(e, t, n = !1) {
|
|
1627
1642
|
if ("undefined" != typeof window && window.localStorage) try {
|
|
1628
1643
|
let r = window.localStorage.getItem(e);
|
|
1629
|
-
return null === r ? (n &&
|
|
1644
|
+
return null === r ? (n && ur(e, t), t) : JSON.parse(r);
|
|
1630
1645
|
} catch (n) {
|
|
1631
1646
|
return window.console.warn(`Error reading localStorage key "${e}":`, n), t;
|
|
1632
1647
|
}
|
|
1633
1648
|
}
|
|
1634
|
-
function
|
|
1649
|
+
function ur(e, t) {
|
|
1635
1650
|
if ("undefined" == typeof window || !window.localStorage) return 0;
|
|
1636
|
-
if (!e || void 0 === t) return
|
|
1651
|
+
if (!e || void 0 === t) return dn(`kw_set_local_storage_value(): invalid key or value: key=${e}`), -1;
|
|
1637
1652
|
try {
|
|
1638
1653
|
return window.localStorage.setItem(e, JSON.stringify(t)), 0;
|
|
1639
1654
|
} catch (t) {
|
|
1640
|
-
return
|
|
1655
|
+
return dn(`kw_set_local_storage_value(): cannot save "${e}" (storage full or blocked?): ${t && t.message ? t.message : t}`), -1;
|
|
1641
1656
|
}
|
|
1642
1657
|
}
|
|
1643
|
-
function
|
|
1658
|
+
function cr(e) {
|
|
1644
1659
|
if ("undefined" != typeof window && window.localStorage) if (e) try {
|
|
1645
1660
|
window.localStorage.removeItem(e);
|
|
1646
1661
|
} catch (t) {
|
|
@@ -1648,46 +1663,46 @@
|
|
|
1648
1663
|
}
|
|
1649
1664
|
else window.console.warn(`Invalid key for localStorage removal: ${e}`);
|
|
1650
1665
|
}
|
|
1651
|
-
function
|
|
1652
|
-
if (
|
|
1653
|
-
if (
|
|
1666
|
+
function fr(e, t) {
|
|
1667
|
+
if (Gn(e) || Gn(t)) return !0;
|
|
1668
|
+
if (Pn(e)) {
|
|
1654
1669
|
if (0 === e.length) return !0;
|
|
1655
1670
|
for (let n = 0; n < e.length; n++) if (e[n] === t) return !0;
|
|
1656
|
-
} else if (
|
|
1671
|
+
} else if (Cn(e)) {
|
|
1657
1672
|
if (0 === Object.keys(e).length) return !0;
|
|
1658
1673
|
for (let n in e) if (n === t) return !0;
|
|
1659
|
-
} else if (
|
|
1674
|
+
} else if (Ln(e) && e === t) return !0;
|
|
1660
1675
|
return !1;
|
|
1661
1676
|
}
|
|
1662
|
-
function
|
|
1663
|
-
if (e && !
|
|
1664
|
-
l || (l =
|
|
1677
|
+
function gr(e, t, n, r, l) {
|
|
1678
|
+
if (e && !Mn(e) && dn("GObj bad instanceof"), !t) return null;
|
|
1679
|
+
l || (l = sr);
|
|
1665
1680
|
let o = [];
|
|
1666
|
-
if (
|
|
1681
|
+
if (Pn(t)) for (let s = 0; s < t.length; s++) {
|
|
1667
1682
|
let i, _ = t[s];
|
|
1668
|
-
if (
|
|
1683
|
+
if (Cn(_)) i = Zn(e, _, "id", "", 0);
|
|
1669
1684
|
else {
|
|
1670
|
-
if (!
|
|
1685
|
+
if (!Ln(_)) continue;
|
|
1671
1686
|
i = _;
|
|
1672
1687
|
}
|
|
1673
|
-
|
|
1688
|
+
fr(n, i) && l(_, r) && o.push(_);
|
|
1674
1689
|
}
|
|
1675
1690
|
else {
|
|
1676
|
-
if (!
|
|
1691
|
+
if (!Cn(t)) return dn("kw_collect() BAD kw parameter"), null;
|
|
1677
1692
|
for (let e of Object.keys(t)) {
|
|
1678
1693
|
let s = t[e];
|
|
1679
|
-
|
|
1694
|
+
fr(n, e) && l(s, r) && o.push(s);
|
|
1680
1695
|
}
|
|
1681
1696
|
}
|
|
1682
1697
|
return o;
|
|
1683
1698
|
}
|
|
1684
|
-
function
|
|
1699
|
+
function dr(e, t) {
|
|
1685
1700
|
if (!e) return -1;
|
|
1686
1701
|
for (let n = 0; n < e.length; n++) if (e[n] && e[n].id === t) return n;
|
|
1687
1702
|
return -1;
|
|
1688
1703
|
}
|
|
1689
|
-
function
|
|
1690
|
-
if (!e || !t) return
|
|
1704
|
+
function br(e, t, n) {
|
|
1705
|
+
if (!e || !t) return dn("ERROR: str_in_list() list or str empty"), !1;
|
|
1691
1706
|
let r = e.length;
|
|
1692
1707
|
if (n) {
|
|
1693
1708
|
t = t.toLowerCase();
|
|
@@ -1698,7 +1713,7 @@
|
|
|
1698
1713
|
} else for (let n = 0; n < r; n++) if (e[n] === t) return !0;
|
|
1699
1714
|
return !1;
|
|
1700
1715
|
}
|
|
1701
|
-
function
|
|
1716
|
+
function pr(e, t) {
|
|
1702
1717
|
try {
|
|
1703
1718
|
let n = e.__md_iev__;
|
|
1704
1719
|
if (n) return n[t];
|
|
@@ -1706,35 +1721,35 @@
|
|
|
1706
1721
|
return;
|
|
1707
1722
|
}
|
|
1708
1723
|
}
|
|
1709
|
-
function
|
|
1724
|
+
function mr(e, t, n) {
|
|
1710
1725
|
let r = e.__md_iev__;
|
|
1711
1726
|
r || (r = {}, e.__md_iev__ = r), r[t] = n;
|
|
1712
1727
|
}
|
|
1713
|
-
function
|
|
1714
|
-
if (!
|
|
1728
|
+
function hr(e, t, n, r) {
|
|
1729
|
+
if (!Mn(e)) return dn("gobj is not a GObj"), null;
|
|
1715
1730
|
if (!t) return;
|
|
1716
|
-
let l =
|
|
1717
|
-
l || (l = [],
|
|
1731
|
+
let l = pr(t, n);
|
|
1732
|
+
l || (l = [], mr(t, n, l));
|
|
1718
1733
|
try {
|
|
1719
|
-
|
|
1734
|
+
Pn(l) && l.unshift(r);
|
|
1720
1735
|
} catch (e) {
|
|
1721
|
-
|
|
1736
|
+
dn(e);
|
|
1722
1737
|
}
|
|
1723
1738
|
}
|
|
1724
|
-
function
|
|
1725
|
-
if (!
|
|
1726
|
-
if (!
|
|
1727
|
-
let l =
|
|
1728
|
-
return l ? 0 === l.length ? (r &&
|
|
1739
|
+
function Er(e, t, n, r) {
|
|
1740
|
+
if (!Mn(e)) return dn("gobj is not a GObj"), null;
|
|
1741
|
+
if (!Cn(t)) return dn("kw is not a dict"), null;
|
|
1742
|
+
let l = pr(t, n);
|
|
1743
|
+
return l ? 0 === l.length ? (r && dn(`stack empty: ${n}`), null) : l[0] : (r && dn(`stack NOT FOUND: ${n}`), null);
|
|
1729
1744
|
}
|
|
1730
|
-
function
|
|
1731
|
-
return
|
|
1745
|
+
function yr(e, t, n) {
|
|
1746
|
+
return Wn(n) ? zn(e, t, "__md_iev__`__msg_type__") : lr(e, t, "__md_iev__", "__msg_type__", n), 0;
|
|
1732
1747
|
}
|
|
1733
|
-
function
|
|
1734
|
-
return
|
|
1748
|
+
function Tr(e, t) {
|
|
1749
|
+
return Zn(e, t, "__md_iev__`__msg_type__", "", 0);
|
|
1735
1750
|
}
|
|
1736
|
-
function
|
|
1737
|
-
void 0 !== n &&
|
|
1751
|
+
function vr(e, t, n) {
|
|
1752
|
+
void 0 !== n && Ln(n) || (n = "");
|
|
1738
1753
|
for (let r of Object.keys(e)) {
|
|
1739
1754
|
if (!e.hasOwnProperty(r)) continue;
|
|
1740
1755
|
let l = (n.length ? "`" : "") + r;
|
|
@@ -1743,10 +1758,10 @@
|
|
|
1743
1758
|
r,
|
|
1744
1759
|
e[r],
|
|
1745
1760
|
n
|
|
1746
|
-
]),
|
|
1761
|
+
]), Cn(e[r]) && vr(e[r], t, n), n = n.slice(0, -l.length);
|
|
1747
1762
|
}
|
|
1748
1763
|
}
|
|
1749
|
-
function
|
|
1764
|
+
function jr(e, t, n, r) {
|
|
1750
1765
|
if (!e) return null;
|
|
1751
1766
|
let l, o = e.length;
|
|
1752
1767
|
for (l = 0; l < o; l++) {
|
|
@@ -1754,15 +1769,15 @@
|
|
|
1754
1769
|
if (o) {
|
|
1755
1770
|
let e = o.id;
|
|
1756
1771
|
if (e && e === n) return o;
|
|
1757
|
-
if (r &&
|
|
1758
|
-
let e =
|
|
1772
|
+
if (r && Hn(o, t)) {
|
|
1773
|
+
let e = jr(o[t], t, n, r);
|
|
1759
1774
|
if (e) return e;
|
|
1760
1775
|
}
|
|
1761
1776
|
}
|
|
1762
1777
|
}
|
|
1763
1778
|
return null;
|
|
1764
1779
|
}
|
|
1765
|
-
function
|
|
1780
|
+
function Sr(e) {
|
|
1766
1781
|
function t(e) {
|
|
1767
1782
|
let t = e.replace(/-/g, "+").replace(/_/g, "/");
|
|
1768
1783
|
switch (t.length % 4) {
|
|
@@ -1793,36 +1808,36 @@
|
|
|
1793
1808
|
signature: t(n[2])
|
|
1794
1809
|
};
|
|
1795
1810
|
}
|
|
1796
|
-
function
|
|
1811
|
+
function Or(e) {
|
|
1797
1812
|
return null == e ? "" : String(e).replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
1798
1813
|
}
|
|
1799
|
-
function
|
|
1814
|
+
function wr(e) {
|
|
1800
1815
|
const t = document.createElement("template");
|
|
1801
1816
|
return t.innerHTML = e.trim(), t.content.firstChild;
|
|
1802
1817
|
}
|
|
1803
|
-
function
|
|
1818
|
+
function Nr(e) {
|
|
1804
1819
|
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();
|
|
1805
1820
|
return `${n}.${r}${l > 0 ? "-" : "+"}${t(Math.floor(Math.abs(l) / 60), 2)}${t(Math.abs(l) % 60, 2)}`;
|
|
1806
1821
|
}
|
|
1807
|
-
function
|
|
1822
|
+
function Rr(e, t) {
|
|
1808
1823
|
if (!e) throw "ERROR: index_in_list() list empty";
|
|
1809
1824
|
for (let n = 0; n < e.length; n++) if (t === e[n]) return n;
|
|
1810
1825
|
return -1;
|
|
1811
1826
|
}
|
|
1812
|
-
function
|
|
1827
|
+
function Dr() {
|
|
1813
1828
|
let e = "";
|
|
1814
1829
|
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;
|
|
1815
1830
|
}
|
|
1816
|
-
function
|
|
1831
|
+
function Ar(e) {
|
|
1817
1832
|
let t = null;
|
|
1818
1833
|
return "function" != typeof e && "object" != typeof e || (t = ("" + e).match(/function\s*([\w\$]*)\s*\(/)), null !== t ? t[1] + "()" : "";
|
|
1819
1834
|
}
|
|
1820
|
-
var
|
|
1821
|
-
function
|
|
1835
|
+
var kr = 256, $r = 1e5;
|
|
1836
|
+
function Ir(e) {
|
|
1822
1837
|
const t = String(e).replace(/`/g, "``");
|
|
1823
1838
|
return "[" === t[0] ? "[" + t : t;
|
|
1824
1839
|
}
|
|
1825
|
-
function
|
|
1840
|
+
function Cr(e) {
|
|
1826
1841
|
if ("string" != typeof e) return null;
|
|
1827
1842
|
let t = [], n = "";
|
|
1828
1843
|
for (let r = 0; r < e.length; r++) if ("`" !== e[r]) n += e[r];
|
|
@@ -1843,17 +1858,17 @@
|
|
|
1843
1858
|
return null !== t ? t : "[" === e[0] && "[" === e[1] ? e.slice(1) : e;
|
|
1844
1859
|
});
|
|
1845
1860
|
}
|
|
1846
|
-
function
|
|
1861
|
+
function Pr(e, t) {
|
|
1847
1862
|
return e === t || null !== e && null !== t && "object" == typeof e && "object" == typeof t && JSON.stringify(e) === JSON.stringify(t);
|
|
1848
1863
|
}
|
|
1849
|
-
function
|
|
1864
|
+
function Lr(e) {
|
|
1850
1865
|
return "persistent-attrs-" + et(e);
|
|
1851
1866
|
}
|
|
1852
|
-
function
|
|
1853
|
-
if (
|
|
1867
|
+
function Ur(e, t) {
|
|
1868
|
+
if (Ln(t)) {
|
|
1854
1869
|
if (-1 === t.indexOf("^")) {
|
|
1855
1870
|
let n, r, l = e.fkey;
|
|
1856
|
-
if (1 !==
|
|
1871
|
+
if (1 !== kn(l)) return dn("bad fkey 1"), dn(e), dn(t), null;
|
|
1857
1872
|
for (const e of Object.keys(l)) {
|
|
1858
1873
|
n = e, r = l[e];
|
|
1859
1874
|
break;
|
|
@@ -1866,20 +1881,20 @@
|
|
|
1866
1881
|
}
|
|
1867
1882
|
{
|
|
1868
1883
|
let n = t.split("^");
|
|
1869
|
-
return 3 !== n.length ? (
|
|
1884
|
+
return 3 !== n.length ? (dn("bad fkey 2"), dn(e), dn(t), null) : {
|
|
1870
1885
|
topic_name: n[0],
|
|
1871
1886
|
id: n[1],
|
|
1872
1887
|
hook_name: n[2]
|
|
1873
1888
|
};
|
|
1874
1889
|
}
|
|
1875
1890
|
}
|
|
1876
|
-
return
|
|
1891
|
+
return Cn(t) ? {
|
|
1877
1892
|
topic_name: t.topic_name,
|
|
1878
1893
|
id: t.id,
|
|
1879
1894
|
hook_name: t.hook_name
|
|
1880
|
-
} : (
|
|
1895
|
+
} : (dn("bad fkey 3"), dn(e), dn(t), null);
|
|
1881
1896
|
}
|
|
1882
|
-
var
|
|
1897
|
+
var Fr = [
|
|
1883
1898
|
"string",
|
|
1884
1899
|
"integer",
|
|
1885
1900
|
"object",
|
|
@@ -1889,7 +1904,7 @@
|
|
|
1889
1904
|
"real",
|
|
1890
1905
|
"boolean",
|
|
1891
1906
|
"blob"
|
|
1892
|
-
],
|
|
1907
|
+
], Gr = [
|
|
1893
1908
|
"persistent",
|
|
1894
1909
|
"required",
|
|
1895
1910
|
"notnull",
|
|
@@ -1901,7 +1916,7 @@
|
|
|
1901
1916
|
"stats",
|
|
1902
1917
|
"rstats",
|
|
1903
1918
|
"pstats"
|
|
1904
|
-
],
|
|
1919
|
+
], Vr = [
|
|
1905
1920
|
"hook",
|
|
1906
1921
|
"fkey",
|
|
1907
1922
|
"enum",
|
|
@@ -1930,7 +1945,7 @@
|
|
|
1930
1945
|
"coordinates",
|
|
1931
1946
|
"gbuffer"
|
|
1932
1947
|
];
|
|
1933
|
-
function
|
|
1948
|
+
function Mr(e) {
|
|
1934
1949
|
let t = {
|
|
1935
1950
|
name: e.id,
|
|
1936
1951
|
header: e.header,
|
|
@@ -1949,7 +1964,7 @@
|
|
|
1949
1964
|
if (!e.flag) return t;
|
|
1950
1965
|
for (let n = 0; n < e.flag.length; n++) {
|
|
1951
1966
|
let r = e.flag[n];
|
|
1952
|
-
if (
|
|
1967
|
+
if (br(Vr, r)) {
|
|
1953
1968
|
switch (r) {
|
|
1954
1969
|
case "enum":
|
|
1955
1970
|
t.enum_list = e.enum;
|
|
@@ -1963,7 +1978,7 @@
|
|
|
1963
1978
|
case "file": t.is_file = !0;
|
|
1964
1979
|
}
|
|
1965
1980
|
t.type = r;
|
|
1966
|
-
} else if (
|
|
1981
|
+
} else if (br(Gr, r)) switch (r) {
|
|
1967
1982
|
case "writable":
|
|
1968
1983
|
t.is_writable = !0;
|
|
1969
1984
|
break;
|
|
@@ -1976,33 +1991,33 @@
|
|
|
1976
1991
|
}
|
|
1977
1992
|
return t.is_file && (t.type = "file"), t;
|
|
1978
1993
|
}
|
|
1979
|
-
var
|
|
1994
|
+
var Wr = [
|
|
1980
1995
|
j(E.DTP_POINTER, "subscriber", 0, null, "Subscriber of output events"),
|
|
1981
1996
|
j(E.DTP_BOOLEAN, "periodic", 0, 0, "True for periodic timeouts"),
|
|
1982
1997
|
j(E.DTP_INTEGER, "msec", 0, 0, "Timeout in milliseconds"),
|
|
1983
1998
|
v()
|
|
1984
|
-
],
|
|
1999
|
+
], xr = {
|
|
1985
2000
|
periodic: !1,
|
|
1986
2001
|
msec: 0,
|
|
1987
2002
|
timer_id: -1
|
|
1988
|
-
},
|
|
1989
|
-
function
|
|
2003
|
+
}, Kr = null;
|
|
2004
|
+
function Yr(e, t, n, r) {
|
|
1990
2005
|
let l = e.priv, o = l.periodic ? "EV_TIMEOUT_PERIODIC" : "EV_TIMEOUT";
|
|
1991
2006
|
return l.periodic && l.msec > 0 ? l.timer_id = setTimeout(function() {
|
|
1992
2007
|
Ft(e, "EV_TIMEOUT", {}, e);
|
|
1993
2008
|
}, l.msec) : l.timer_id = -1, lt(e) ? Ft(nt(e), o, {}, e) : qt(e, o, {}), l.periodic || -1 !== l.timer_id || Ke(e) && Ge(e), 0;
|
|
1994
2009
|
}
|
|
1995
|
-
var
|
|
2010
|
+
var Br = {
|
|
1996
2011
|
mt_create: function(e) {
|
|
1997
2012
|
let t = e.priv;
|
|
1998
2013
|
const n = St(e, "subscriber");
|
|
1999
|
-
n && Yt(e, null, {}, n), t.periodic =
|
|
2014
|
+
n && Yt(e, null, {}, n), t.periodic = Tt(e, "periodic"), t.msec = vt(e, "msec");
|
|
2000
2015
|
},
|
|
2001
2016
|
mt_writing: function(e, t) {
|
|
2002
2017
|
let n = e.priv;
|
|
2003
2018
|
switch (t) {
|
|
2004
2019
|
case "periodic":
|
|
2005
|
-
n.periodic =
|
|
2020
|
+
n.periodic = Tt(e, "periodic");
|
|
2006
2021
|
break;
|
|
2007
2022
|
case "msec": n.msec = vt(e, "msec"), -1 !== n.timer_id && (clearTimeout(n.timer_id), n.timer_id = -1), n.msec > 0 && (n.timer_id = setTimeout(function() {
|
|
2008
2023
|
Ft(e, "EV_TIMEOUT", {}, e);
|
|
@@ -2017,16 +2032,16 @@
|
|
|
2017
2032
|
},
|
|
2018
2033
|
mt_destroy: function(e) {}
|
|
2019
2034
|
};
|
|
2020
|
-
function
|
|
2021
|
-
return e instanceof O ? "C_TIMER" !== Ze(e) ? (
|
|
2035
|
+
function Jr(e, t) {
|
|
2036
|
+
return e instanceof O ? "C_TIMER" !== Ze(e) ? (dn("not C_TIMER GObj"), -1) : (Nt(e, "periodic", !1), void Rt(e, "msec", t)) : (dn("not GObj TYPE"), -1);
|
|
2022
2037
|
}
|
|
2023
|
-
function
|
|
2024
|
-
return e instanceof O ? "C_TIMER" !== Ze(e) ? (
|
|
2038
|
+
function Hr(e, t) {
|
|
2039
|
+
return e instanceof O ? "C_TIMER" !== Ze(e) ? (dn("not C_TIMER GObj"), -1) : (Nt(e, "periodic", !0), void Rt(e, "msec", t)) : (dn("not GObj TYPE"), -1);
|
|
2025
2040
|
}
|
|
2026
|
-
function
|
|
2027
|
-
return e instanceof O ? "C_TIMER" !== Ze(e) ? (
|
|
2041
|
+
function qr(e) {
|
|
2042
|
+
return e instanceof O ? "C_TIMER" !== Ze(e) ? (dn("not C_TIMER GObj"), -1) : void Rt(e, "msec", -1) : (dn("not GObj TYPE"), -1);
|
|
2028
2043
|
}
|
|
2029
|
-
var
|
|
2044
|
+
var zr = [
|
|
2030
2045
|
j(E.DTP_BOOLEAN, "changesLost", 0, !1, "Set true to warn about leaving page"),
|
|
2031
2046
|
j(E.DTP_BOOLEAN, "browser_beforeunload", 0, !1, "Set true to refreshing browser"),
|
|
2032
2047
|
j(E.DTP_STRING, "__username__", 0, "", "Username"),
|
|
@@ -2040,69 +2055,69 @@
|
|
|
2040
2055
|
j(E.DTP_STRING, "yuno_version", 0, "", "Yuno version (APP_VERSION)"),
|
|
2041
2056
|
j(E.DTP_STRING, "yuneta_version", 0, s, "Yuneta version"),
|
|
2042
2057
|
j(E.DTP_LIST, "required_services", 0, "[]", "Required services"),
|
|
2043
|
-
j(E.DTP_DICT, "trace_levels",
|
|
2044
|
-
j(E.DTP_DICT, "no_trace_levels",
|
|
2058
|
+
j(E.DTP_DICT, "trace_levels", y.SDF_PERSIST, "{}", "Trace levels"),
|
|
2059
|
+
j(E.DTP_DICT, "no_trace_levels", y.SDF_PERSIST, "{}", "No trace levels"),
|
|
2045
2060
|
j(E.DTP_POINTER, "trace_ievent_callback", 0, null, "Where the traffic trace goes (C_IEVENT_CLI levels ievents/ievents2); console when null"),
|
|
2046
2061
|
j(E.DTP_BOOLEAN, "developer", 0, !1, "Developer mode enabled"),
|
|
2047
2062
|
j(E.DTP_INTEGER, "periodic_timeout", 0, "1000", "Timeout periodic, in miliseconds."),
|
|
2048
2063
|
v()
|
|
2049
|
-
],
|
|
2050
|
-
function
|
|
2064
|
+
], Qr = { gobj_timer: null }, Xr = null;
|
|
2065
|
+
function Zr(e, t, n, r) {
|
|
2051
2066
|
let l = Et(e, t);
|
|
2052
|
-
return
|
|
2067
|
+
return Cn(l) || (l = {}), l[n] = r, Ot(e, t, l), Ae(e, t);
|
|
2053
2068
|
}
|
|
2054
|
-
function
|
|
2069
|
+
function el(e) {
|
|
2055
2070
|
if (!0 === e || !1 === e) return e;
|
|
2056
2071
|
let t = String(null == e ? "" : e).toLowerCase();
|
|
2057
2072
|
return "true" === t || "set" === t || "false" !== t && "reset" !== t && ("" === t || isNaN(Number(t)) ? null : !!Number(t));
|
|
2058
2073
|
}
|
|
2059
|
-
function
|
|
2074
|
+
function tl() {
|
|
2060
2075
|
return `${ze()}^${qe()}`;
|
|
2061
2076
|
}
|
|
2062
|
-
function
|
|
2077
|
+
function nl(e, t, n, r) {
|
|
2063
2078
|
return qt(e, t, n), 0;
|
|
2064
2079
|
}
|
|
2065
|
-
var
|
|
2080
|
+
var rl = {
|
|
2066
2081
|
mt_create: function(e) {
|
|
2067
2082
|
let t = e.priv;
|
|
2068
|
-
Dt(e, "start_date",
|
|
2083
|
+
Dt(e, "start_date", Nr()), Dt(e, "node_uuid", Dr()), e.priv.gobj_timer = Ce(Xe(e), "C_TIMER", {}, e), t.periodic_timeout = Et(e, "periodic_timeout"), function(e) {
|
|
2069
2084
|
let t = Et(e, "trace_levels");
|
|
2070
|
-
if (!
|
|
2085
|
+
if (!Cn(t)) return 0;
|
|
2071
2086
|
let n = t.__global_trace__;
|
|
2072
|
-
if (
|
|
2087
|
+
if (Pn(n)) {
|
|
2073
2088
|
Z(4294967295, !1);
|
|
2074
2089
|
for (let e of n) Q(e, !0);
|
|
2075
2090
|
}
|
|
2076
2091
|
for (const [n, r] of Object.entries(t)) {
|
|
2077
2092
|
let t = Se(n);
|
|
2078
|
-
if (t) if (
|
|
2093
|
+
if (t) if (Pn(r)) {
|
|
2079
2094
|
se(t, null, !1);
|
|
2080
2095
|
for (let e of r) se(t, e, !0);
|
|
2081
|
-
} else
|
|
2096
|
+
} else dn(`${Xe(e)}: trace_levels of ${n} MUST be a list`);
|
|
2082
2097
|
}
|
|
2083
2098
|
}(e), function(e) {
|
|
2084
2099
|
let t = Et(e, "no_trace_levels");
|
|
2085
|
-
if (!
|
|
2100
|
+
if (!Cn(t)) return 0;
|
|
2086
2101
|
let n = t.__global_no_trace__;
|
|
2087
|
-
if (
|
|
2102
|
+
if (Pn(n)) {
|
|
2088
2103
|
ee(4294967295, !1);
|
|
2089
2104
|
for (let e of n) X(e, !0);
|
|
2090
2105
|
}
|
|
2091
2106
|
for (const [n, r] of Object.entries(t)) {
|
|
2092
2107
|
let t = Se(n);
|
|
2093
|
-
if (t) if (
|
|
2108
|
+
if (t) if (Pn(r)) {
|
|
2094
2109
|
ie(t, null, !1);
|
|
2095
2110
|
for (let e of r) ie(t, e, !0);
|
|
2096
|
-
} else
|
|
2111
|
+
} else dn(`${Xe(e)}: no_trace_levels of ${n} MUST be a list`);
|
|
2097
2112
|
}
|
|
2098
2113
|
}(e);
|
|
2099
2114
|
},
|
|
2100
2115
|
mt_writing: function(e, t) {},
|
|
2101
2116
|
mt_start: function(e) {
|
|
2102
|
-
return
|
|
2117
|
+
return Hr(e.priv.gobj_timer, e.priv.periodic_timeout), 0;
|
|
2103
2118
|
},
|
|
2104
2119
|
mt_stop: function(e) {
|
|
2105
|
-
return
|
|
2120
|
+
return qr(e.priv.gobj_timer), Me(e), 0;
|
|
2106
2121
|
},
|
|
2107
2122
|
mt_destroy: function(e) {},
|
|
2108
2123
|
mt_play: function(e) {
|
|
@@ -2118,49 +2133,49 @@
|
|
|
2118
2133
|
case "get-global-no-trace": return l(0, 0, null, null, ne());
|
|
2119
2134
|
case "set-global-trace":
|
|
2120
2135
|
case "set-global-no-trace": {
|
|
2121
|
-
let r = "set-global-no-trace" === t, o = n.level, s =
|
|
2122
|
-
return o ? null === s ? l(0, -1, `${
|
|
2136
|
+
let r = "set-global-no-trace" === t, o = n.level, s = el(n.set);
|
|
2137
|
+
return o ? null === s ? l(0, -1, `${tl()}: bitmask set or re-set?`, null, null) : (r ? X(o, s) : Q(o, s)) < 0 ? l(0, -1, `${tl()}: global trace level not found: ${o}`, null, null) : r ? (Zr(e, "no_trace_levels", "__global_no_trace__", ne()), l(0, 0, null, null, ne())) : (Zr(e, "trace_levels", "__global_trace__", te()), l(0, 0, null, null, te())) : l(0, -1, `${tl()}: what level?`, null, null);
|
|
2123
2138
|
}
|
|
2124
2139
|
case "get-gclass-trace":
|
|
2125
2140
|
case "get-gclass-no-trace":
|
|
2126
2141
|
case "set-gclass-trace":
|
|
2127
2142
|
case "set-gclass-no-trace": {
|
|
2128
2143
|
let r = t.indexOf("no-trace") >= 0, o = n.gclass_name || n.gclass || "", s = Se(o);
|
|
2129
|
-
if (!s) return l(0, -1, `${
|
|
2144
|
+
if (!s) return l(0, -1, `${tl()}: what gclass is '${o}'?`, null, null);
|
|
2130
2145
|
if (0 === t.indexOf("get-")) return l(0, 0, null, null, r ? oe(s) : re(s));
|
|
2131
|
-
let i = n.level, _ =
|
|
2132
|
-
return i ? null === _ ? l(0, -1, `${
|
|
2146
|
+
let i = n.level, _ = el(n.set);
|
|
2147
|
+
return i ? null === _ ? l(0, -1, `${tl()}: bitmask set or re-set?`, null, null) : (r ? ie(s, i, _) : se(s, i, _)) < 0 ? l(0, -1, `${tl()}: trace level of ${o} not found: ${i}`, null, null) : r ? (Zr(e, "no_trace_levels", o, oe(s)), l(0, 0, null, null, oe(s))) : (Zr(e, "trace_levels", o, le(s)), l(0, 0, null, null, re(s))) : l(0, -1, `${tl()}: what level?`, null, null);
|
|
2133
2148
|
}
|
|
2134
|
-
default: return l(0, -1, `${
|
|
2149
|
+
default: return l(0, -1, `${tl()}: command not available: ${t}`, null, null);
|
|
2135
2150
|
}
|
|
2136
2151
|
}
|
|
2137
2152
|
};
|
|
2138
|
-
var
|
|
2139
|
-
j(E.DTP_STRING, "wanted_yuno_role",
|
|
2140
|
-
j(E.DTP_STRING, "wanted_yuno_name",
|
|
2141
|
-
j(E.DTP_STRING, "wanted_yuno_service",
|
|
2142
|
-
j(E.DTP_STRING, "remote_yuno_role",
|
|
2143
|
-
j(E.DTP_STRING, "remote_yuno_name",
|
|
2144
|
-
j(E.DTP_STRING, "remote_yuno_service",
|
|
2145
|
-
j(E.DTP_STRING, "url",
|
|
2146
|
-
j(E.DTP_STRING, "jwt",
|
|
2147
|
-
j(E.DTP_STRING, "cert_pem",
|
|
2148
|
-
j(E.DTP_JSON, "extra_info",
|
|
2149
|
-
j(E.DTP_LIST, "required_services",
|
|
2150
|
-
j(E.DTP_INTEGER, "timeout_retry",
|
|
2151
|
-
j(E.DTP_INTEGER, "timeout_retry_max",
|
|
2152
|
-
j(E.DTP_INTEGER, "timeout_idack",
|
|
2153
|
+
var ll = "ievent_gate_stack", ol = [
|
|
2154
|
+
j(E.DTP_STRING, "wanted_yuno_role", y.SDF_RD, "", "wanted yuno role"),
|
|
2155
|
+
j(E.DTP_STRING, "wanted_yuno_name", y.SDF_RD, "", "wanted yuno name"),
|
|
2156
|
+
j(E.DTP_STRING, "wanted_yuno_service", y.SDF_RD, "", "wanted yuno service"),
|
|
2157
|
+
j(E.DTP_STRING, "remote_yuno_role", y.SDF_RD, "", "confirmed remote yuno role"),
|
|
2158
|
+
j(E.DTP_STRING, "remote_yuno_name", y.SDF_RD, "", "confirmed remote yuno name"),
|
|
2159
|
+
j(E.DTP_STRING, "remote_yuno_service", y.SDF_RD, "", "confirmed remote yuno service"),
|
|
2160
|
+
j(E.DTP_STRING, "url", y.SDF_RD, "", "Url to connect"),
|
|
2161
|
+
j(E.DTP_STRING, "jwt", y.SDF_PERSIST, "", "JWT"),
|
|
2162
|
+
j(E.DTP_STRING, "cert_pem", y.SDF_PERSIST, "", "SSL server certification, PEM str format"),
|
|
2163
|
+
j(E.DTP_JSON, "extra_info", y.SDF_RD, "{}", "dict data set by user, added to the identity card msg."),
|
|
2164
|
+
j(E.DTP_LIST, "required_services", y.SDF_RD, "[]", "Services this LINK requires (identity card). Empty = the yuno's `required_services`, as before. A yuno with several links to DIFFERENT backends must set it per link: the yuno-wide list is the union, so every backend is told the service names of all the others."),
|
|
2165
|
+
j(E.DTP_INTEGER, "timeout_retry", y.SDF_RD, "5000", "First reconnect delay (ms). It BACKS OFF from here, doubling up to timeout_retry_max, and resets when a session is reached"),
|
|
2166
|
+
j(E.DTP_INTEGER, "timeout_retry_max", y.SDF_RD, "60000", "Cap of the reconnect backoff (ms). Set it equal to timeout_retry for the old fixed-interval behaviour"),
|
|
2167
|
+
j(E.DTP_INTEGER, "timeout_idack", y.SDF_RD, "5000", "timeout waiting idAck"),
|
|
2153
2168
|
j(E.DTP_POINTER, "subscriber", 0, 0, "subscriber of output-events. If null then subscriber is the parent"),
|
|
2154
2169
|
v()
|
|
2155
|
-
],
|
|
2170
|
+
], sl = [
|
|
2156
2171
|
["ievents", "Trace inter-events with metadata of kw"],
|
|
2157
2172
|
["ievents2", "Trace inter-events with full kw"],
|
|
2158
2173
|
["identity-card", "Trace identity_card messages"]
|
|
2159
2174
|
];
|
|
2160
|
-
function
|
|
2175
|
+
function il(e) {
|
|
2161
2176
|
return !!(3 & x(e));
|
|
2162
2177
|
}
|
|
2163
|
-
var
|
|
2178
|
+
var _l = {
|
|
2164
2179
|
url: null,
|
|
2165
2180
|
remote_yuno_name: null,
|
|
2166
2181
|
remote_yuno_role: null,
|
|
@@ -2170,16 +2185,16 @@
|
|
|
2170
2185
|
websocket: null,
|
|
2171
2186
|
inside_on_open: !1,
|
|
2172
2187
|
retry_ms: 0
|
|
2173
|
-
},
|
|
2174
|
-
function
|
|
2175
|
-
e.priv.websocket &&
|
|
2188
|
+
}, al = null;
|
|
2189
|
+
function ul(e) {
|
|
2190
|
+
e.priv.websocket && dn("Websocket ALREADY setup");
|
|
2176
2191
|
const t = jt(e, "url");
|
|
2177
2192
|
let n;
|
|
2178
|
-
|
|
2193
|
+
pn(`====> Starting WebSocket to '${t}' (${et(e)})`);
|
|
2179
2194
|
try {
|
|
2180
2195
|
n = new WebSocket(t);
|
|
2181
2196
|
} catch (n) {
|
|
2182
|
-
return
|
|
2197
|
+
return dn(`${et(e)}: Cannot open WebSocket to '${t}', Error: ${n.message}`), null;
|
|
2183
2198
|
}
|
|
2184
2199
|
return n ? (n.onopen = () => {
|
|
2185
2200
|
Ft(e, "EV_ON_OPEN", { url: t }, e);
|
|
@@ -2189,66 +2204,66 @@
|
|
|
2189
2204
|
data: n.data
|
|
2190
2205
|
}, e);
|
|
2191
2206
|
}, n.onclose = (n) => {
|
|
2192
|
-
ot(e) || (
|
|
2207
|
+
ot(e) || (Tt(He(), "browser_beforeunload") ? bn("Close websocket by unload page") : Ft(e, "EV_ON_CLOSE", {
|
|
2193
2208
|
url: t,
|
|
2194
2209
|
e: n
|
|
2195
2210
|
}, e));
|
|
2196
|
-
}, n) : (
|
|
2211
|
+
}, n) : (dn(`${et(e)}: Failed to initialize WebSocket.`), null);
|
|
2197
2212
|
}
|
|
2198
|
-
function
|
|
2213
|
+
function cl(e, t = 1e3, n = "") {
|
|
2199
2214
|
let r = e.priv, l = r.websocket;
|
|
2200
2215
|
if (r.websocket = null, l && l.readyState !== WebSocket.CLOSED && l.readyState !== WebSocket.CLOSING) {
|
|
2201
|
-
|
|
2216
|
+
pn(`Closing WebSocket (Code: ${t}, Reason: "${n}")`);
|
|
2202
2217
|
try {
|
|
2203
2218
|
l.close(t, n);
|
|
2204
2219
|
} catch (e) {
|
|
2205
|
-
|
|
2220
|
+
dn("Error closing WebSocket:", e.message);
|
|
2206
2221
|
}
|
|
2207
|
-
} else
|
|
2222
|
+
} else bn("WebSocket is already closed or in the process of closing.");
|
|
2208
2223
|
}
|
|
2209
|
-
function
|
|
2210
|
-
let r =
|
|
2224
|
+
function fl(e, t, n) {
|
|
2225
|
+
let r = Nr();
|
|
2211
2226
|
try {
|
|
2212
|
-
|
|
2227
|
+
pn("\n" + r + " " + t + "\n"), hn(n);
|
|
2213
2228
|
} catch (e) {
|
|
2214
|
-
|
|
2229
|
+
pn("ERROR in trace_inter_event: " + e);
|
|
2215
2230
|
}
|
|
2216
2231
|
}
|
|
2217
|
-
var
|
|
2232
|
+
var gl = class {
|
|
2218
2233
|
constructor(e, t) {
|
|
2219
2234
|
this.event = e, this.kw = t || {};
|
|
2220
2235
|
}
|
|
2221
2236
|
};
|
|
2222
|
-
function
|
|
2237
|
+
function dl(e, t, n, r) {
|
|
2223
2238
|
return function(e, t) {
|
|
2224
2239
|
let n = e.priv, r = JSON.stringify(t);
|
|
2225
|
-
if (
|
|
2240
|
+
if (il(e)) {
|
|
2226
2241
|
let n = jt(e, "url"), l = Xe(He()) + " ==> " + n, o = Et(He(), "trace_ievent_callback");
|
|
2227
|
-
o ? o(l, t, 1, r.length) :
|
|
2242
|
+
o ? o(l, t, 1, r.length) : fl(0, l, t);
|
|
2228
2243
|
}
|
|
2229
|
-
if (!n.websocket || n.websocket.readyState !== WebSocket.OPEN) return
|
|
2244
|
+
if (!n.websocket || n.websocket.readyState !== WebSocket.OPEN) return bn(`${et(e)}: send_iev(): websocket not open, message lost`), -1;
|
|
2230
2245
|
try {
|
|
2231
2246
|
n.websocket.send(r);
|
|
2232
2247
|
} catch (t) {
|
|
2233
|
-
|
|
2248
|
+
dn(`${et(e)}: send_iev(): ${t}`);
|
|
2234
2249
|
}
|
|
2235
2250
|
return 0;
|
|
2236
2251
|
}(e, function(e, t) {
|
|
2237
|
-
return
|
|
2252
|
+
return Wn(e) ? (dn("iev_create() event NULL"), null) : new gl(e, t);
|
|
2238
2253
|
}(t, n));
|
|
2239
2254
|
}
|
|
2240
|
-
function
|
|
2241
|
-
return
|
|
2255
|
+
function bl(e, t, n) {
|
|
2256
|
+
return Wn(n) && (n = jt(e, "wanted_yuno_service")), {
|
|
2242
2257
|
dst_yuno: jt(e, "wanted_yuno_name"),
|
|
2243
2258
|
dst_role: jt(e, "wanted_yuno_role"),
|
|
2244
2259
|
dst_service: n,
|
|
2245
2260
|
src_yuno: qe(),
|
|
2246
2261
|
src_role: ze(),
|
|
2247
2262
|
src_service: t,
|
|
2248
|
-
host:
|
|
2263
|
+
host: Dr()
|
|
2249
2264
|
};
|
|
2250
2265
|
}
|
|
2251
|
-
function
|
|
2266
|
+
function pl(e) {
|
|
2252
2267
|
let t = e.priv, n = Je(He()), r = jt(He(), "yuno_version"), l = jt(He(), "yuno_release"), o = jt(He(), "yuno_tag"), i = Et(e, "required_services");
|
|
2253
2268
|
i && i.length || (i = Et(He(), "required_services"));
|
|
2254
2269
|
let _ = {
|
|
@@ -2266,34 +2281,34 @@
|
|
|
2266
2281
|
username: jt(He(), "__username__"),
|
|
2267
2282
|
launch_id: 0,
|
|
2268
2283
|
yuno_startdate: jt(He(), "start_date"),
|
|
2269
|
-
id:
|
|
2284
|
+
id: Dr(),
|
|
2270
2285
|
user_agent: "undefined" != typeof window ? window.navigator.userAgent : "",
|
|
2271
2286
|
language: "undefined" != typeof window ? window.navigator.language : "",
|
|
2272
2287
|
required_services: i
|
|
2273
2288
|
};
|
|
2274
|
-
return
|
|
2289
|
+
return hr(e, _, ll, bl(e, Xe(nt(e)), null)), yr(e, _, "__identity__"), Jr(t.gobj_timer, vt(e, "timeout_idack")), dl(e, "EV_IDENTITY_CARD", _);
|
|
2275
2290
|
}
|
|
2276
|
-
function
|
|
2277
|
-
if (
|
|
2291
|
+
function ml(e, t) {
|
|
2292
|
+
if (Wn(t.event)) return -1;
|
|
2278
2293
|
let n = {}, r = t.__global__, l = t.__config__, o = t.__filter__, s = t.__service__, i = t.subscriber;
|
|
2279
2294
|
l && (n.__config__ = l), r && (n.__global__ = r), o && (n.__filter__ = o);
|
|
2280
|
-
return
|
|
2295
|
+
return hr(e, n, ll, bl(e, Xe(i), s)), yr(e, n, "__subscribing__"), dl(e, t.event, n);
|
|
2281
2296
|
}
|
|
2282
|
-
function
|
|
2297
|
+
function hl(e, t, n, r) {
|
|
2283
2298
|
let l = e.priv;
|
|
2284
|
-
return Ke(e) && (l.websocket =
|
|
2299
|
+
return Ke(e) && (l.websocket = ul(e)), 0;
|
|
2285
2300
|
}
|
|
2286
|
-
function
|
|
2287
|
-
return
|
|
2301
|
+
function El(e, t, n, r) {
|
|
2302
|
+
return pn("Websocket opened: " + e.priv.url), pl(e), 0;
|
|
2288
2303
|
}
|
|
2289
|
-
function
|
|
2304
|
+
function yl(e, t, n, r) {
|
|
2290
2305
|
let l = e.priv, o = n.e, s = n.url;
|
|
2291
|
-
return
|
|
2306
|
+
return fn(), bn(`${et(e)}: WebSocket closed ${s} (Code: ${o.code}, Reason: "${o.reason}", Clean: ${o.wasClean})`), l.websocket && (l.websocket.onopen = null, l.websocket.onmessage = null, l.websocket.onerror = null, l.websocket.onclose = null, l.websocket = null), l.inform_on_close ? (l.inform_on_close = !1, qt(e, "EV_ON_CLOSE", {
|
|
2292
2307
|
url: s,
|
|
2293
2308
|
remote_yuno_name: l.remote_yuno_name,
|
|
2294
2309
|
remote_yuno_role: l.remote_yuno_role,
|
|
2295
2310
|
remote_yuno_service: l.remote_yuno_service
|
|
2296
|
-
})) : (
|
|
2311
|
+
})) : (bn(`${et(e)}: EV_ON_OPEN_ERROR cannot open ${s} (Code: ${o.code}, Reason: "${o.reason}", Clean: ${o.wasClean})`), qt(e, "EV_ON_OPEN_ERROR", {
|
|
2297
2312
|
url: s,
|
|
2298
2313
|
remote_yuno_name: l.remote_yuno_name,
|
|
2299
2314
|
remote_yuno_role: l.remote_yuno_role,
|
|
@@ -2301,7 +2316,7 @@
|
|
|
2301
2316
|
code: o.code,
|
|
2302
2317
|
reason: o.reason,
|
|
2303
2318
|
was_clean: o.wasClean
|
|
2304
|
-
})), Ke(e) &&
|
|
2319
|
+
})), Ke(e) && Jr(l.gobj_timer, function(e) {
|
|
2305
2320
|
let t = e.priv, n = vt(e, "timeout_retry"), r = vt(e, "timeout_retry_max");
|
|
2306
2321
|
r < n && (r = n);
|
|
2307
2322
|
t.retry_ms = t.retry_ms ? Math.min(2 * t.retry_ms, r) : n;
|
|
@@ -2309,17 +2324,17 @@
|
|
|
2309
2324
|
return Math.max(1, Math.round(o));
|
|
2310
2325
|
}(e)), 0;
|
|
2311
2326
|
}
|
|
2312
|
-
function
|
|
2313
|
-
return
|
|
2327
|
+
function Tl(e, t, n, r) {
|
|
2328
|
+
return pl(e), 0;
|
|
2314
2329
|
}
|
|
2315
|
-
function
|
|
2330
|
+
function vl(e, t, n, r) {
|
|
2316
2331
|
let l = e.priv;
|
|
2317
|
-
|
|
2318
|
-
let o =
|
|
2332
|
+
qr(l.gobj_timer);
|
|
2333
|
+
let o = Er(e, n, ll, !0), s = Zn(e, o, "src_yuno", ""), i = Zn(e, o, "src_role", ""), _ = Zn(e, o, "src_service", "");
|
|
2319
2334
|
Dt(e, "remote_yuno_name", s), Dt(e, "remote_yuno_role", i), Dt(e, "remote_yuno_service", _);
|
|
2320
|
-
let a =
|
|
2335
|
+
let a = Xn(e, n, "result", -1, 0), u = Zn(e, n, "comment", "", 0), c = Zn(e, n, "username", "", 0), f = nr(e, n, "services_roles", {});
|
|
2321
2336
|
if (a < 0) {
|
|
2322
|
-
|
|
2337
|
+
cl(e);
|
|
2323
2338
|
let t = {
|
|
2324
2339
|
url: jt(e, "url"),
|
|
2325
2340
|
result: a,
|
|
@@ -2344,60 +2359,60 @@
|
|
|
2344
2359
|
}
|
|
2345
2360
|
l.inside_on_open = !1, function(e) {
|
|
2346
2361
|
let t = Jt(e, null, null, null);
|
|
2347
|
-
for (let n = 0; n < t.length; n++)
|
|
2362
|
+
for (let n = 0; n < t.length; n++) ml(e, t[n]);
|
|
2348
2363
|
}(e);
|
|
2349
2364
|
}
|
|
2350
2365
|
return 0;
|
|
2351
2366
|
}
|
|
2352
|
-
function
|
|
2367
|
+
function jl(e, t, n, r) {
|
|
2353
2368
|
let l = e.priv.url, o = function(e, t) {
|
|
2354
2369
|
let n;
|
|
2355
2370
|
try {
|
|
2356
2371
|
n = JSON.parse(t);
|
|
2357
2372
|
} catch (e) {
|
|
2358
|
-
return
|
|
2373
|
+
return dn("parsing inter_event json: " + e), null;
|
|
2359
2374
|
}
|
|
2360
|
-
if (!(n instanceof Object)) return
|
|
2375
|
+
if (!(n instanceof Object)) return dn("parsing inter_event: websocket data not a json object"), null;
|
|
2361
2376
|
let r = n.event;
|
|
2362
|
-
if (!r) return
|
|
2363
|
-
if ("string" != typeof r) return
|
|
2377
|
+
if (!r) return dn("parsing inter_event: no event"), null;
|
|
2378
|
+
if ("string" != typeof r) return dn("parsing inter_event: event not a string"), null;
|
|
2364
2379
|
let l = n.kw;
|
|
2365
2380
|
return l ? l instanceof Object ? {
|
|
2366
2381
|
event: r,
|
|
2367
2382
|
kw: l || {}
|
|
2368
|
-
} : (
|
|
2383
|
+
} : (dn("parsing inter_event: kw not a json object"), null) : (dn("parsing inter_kw: no kw"), null);
|
|
2369
2384
|
}(0, n.data);
|
|
2370
|
-
if (
|
|
2385
|
+
if (il(e)) {
|
|
2371
2386
|
let e = Xe(He()) + " <== " + l, t = n.data.length, r = Et(He(), "trace_ievent_callback");
|
|
2372
|
-
r ? r(e, o, 2, t) :
|
|
2387
|
+
r ? r(e, o, 2, t) : fl(0, e, o);
|
|
2373
2388
|
}
|
|
2374
2389
|
let s = o.event, i = o.kw;
|
|
2375
2390
|
if ("ST_SESSION" !== kt(e)) {
|
|
2376
2391
|
if (It(e, s, D.EVF_PUBLIC_EVENT)) {
|
|
2377
2392
|
if (!(Ft(e, s, i, e) < 0)) return 0;
|
|
2378
|
-
} else
|
|
2379
|
-
return
|
|
2393
|
+
} else dn(`${et(e)}: event UNKNOWN in not-session state ${s}`);
|
|
2394
|
+
return cl(e), -1;
|
|
2380
2395
|
}
|
|
2381
2396
|
o = null;
|
|
2382
|
-
let _ =
|
|
2383
|
-
if (u.toLowerCase() !== ze().toLowerCase()) return
|
|
2384
|
-
let c =
|
|
2397
|
+
let _ = Tr(e, i), a = Er(e, i, ll), u = Zn(e, a, "dst_role", "");
|
|
2398
|
+
if (u.toLowerCase() !== ze().toLowerCase()) return dn(`"It's not my role, dst_role: ${u}, my_role: ${ze()}`), 0;
|
|
2399
|
+
let c = Zn(e, a, "dst_service", "");
|
|
2385
2400
|
if ("__subscribing__" === _) return -1;
|
|
2386
2401
|
if ("__unsubscribing__" === _) return -1;
|
|
2387
2402
|
if (It(e, s, D.EVF_PUBLIC_EVENT)) return Ft(e, s, i, e), 0;
|
|
2388
|
-
if (!
|
|
2403
|
+
if (!Wn(c)) {
|
|
2389
2404
|
let t = we(c, !1);
|
|
2390
|
-
return t ? It(t, s, D.EVF_PUBLIC_EVENT) ? (Ft(t, s, i, e), 0) : (
|
|
2405
|
+
return t ? It(t, s, D.EVF_PUBLIC_EVENT) ? (Ft(t, s, i, e), 0) : (dn(`${et(e)}: Service found but no event or not public, service '${et(t)}', ev '${s}'`), -1) : (bn(`${et(e)}: event for a service that is gone, DROPPED: service '${c}', ev '${s}'`), 0);
|
|
2391
2406
|
}
|
|
2392
2407
|
return lt(e) ? Ft(nt(e), s, i, e) : qt(e, s, i), 0;
|
|
2393
2408
|
}
|
|
2394
|
-
function
|
|
2409
|
+
function Sl(e, t, n, r) {
|
|
2395
2410
|
return 0;
|
|
2396
2411
|
}
|
|
2397
|
-
function
|
|
2412
|
+
function Ol(e, t, n, r) {
|
|
2398
2413
|
return 0;
|
|
2399
2414
|
}
|
|
2400
|
-
var
|
|
2415
|
+
var wl = {
|
|
2401
2416
|
mt_create: function(e) {
|
|
2402
2417
|
let t = e.priv;
|
|
2403
2418
|
t.gobj_timer = Ce(Xe(e), "C_TIMER", {}, e), t.url = jt(e, "url"), t.remote_yuno_name = jt(e, "remote_yuno_name"), t.remote_yuno_role = jt(e, "remote_yuno_role"), t.remote_yuno_service = jt(e, "remote_yuno_service"), Dt(e, "wanted_yuno_name", t.remote_yuno_name), Dt(e, "wanted_yuno_role", t.remote_yuno_role), Dt(e, "wanted_yuno_service", t.remote_yuno_service);
|
|
@@ -2421,55 +2436,55 @@
|
|
|
2421
2436
|
},
|
|
2422
2437
|
mt_start: function(e) {
|
|
2423
2438
|
let t = e.priv;
|
|
2424
|
-
return t.retry_ms = 0, t.websocket =
|
|
2439
|
+
return t.retry_ms = 0, t.websocket = ul(e), 0;
|
|
2425
2440
|
},
|
|
2426
2441
|
mt_stop: function(e) {
|
|
2427
2442
|
let t = e.priv;
|
|
2428
|
-
return
|
|
2443
|
+
return qr(t.gobj_timer), t.websocket && cl(e), 0;
|
|
2429
2444
|
},
|
|
2430
2445
|
mt_destroy: function(e) {},
|
|
2431
2446
|
mt_stats: function(e, t, n, r) {
|
|
2432
|
-
if ("ST_SESSION" !== kt(e)) return
|
|
2447
|
+
if ("ST_SESSION" !== kt(e)) return dn("Not in session"), null;
|
|
2433
2448
|
n || (n = {});
|
|
2434
|
-
let l =
|
|
2435
|
-
return o || (o = {}),
|
|
2449
|
+
let l = bl(e, Xe(r), Zn(e, n, "service", null, 0)), o = nr(e, n, "__md_stats__", null, zt.KW_EXTRACT);
|
|
2450
|
+
return o || (o = {}), hr(e, n, "stats_stack", {
|
|
2436
2451
|
stats: t,
|
|
2437
2452
|
kw: o
|
|
2438
|
-
}),
|
|
2453
|
+
}), hr(e, n, ll, l), n.__stats__ = t, yr(e, n, "__stats__"), dl(e, "EV_MT_STATS", n, r), null;
|
|
2439
2454
|
},
|
|
2440
2455
|
mt_command_parser: function(e, t, n, r) {
|
|
2441
|
-
if ("ST_SESSION" !== kt(e)) return
|
|
2456
|
+
if ("ST_SESSION" !== kt(e)) return dn("Not in session"), null;
|
|
2442
2457
|
n || (n = {});
|
|
2443
|
-
let l =
|
|
2444
|
-
return o || (o = {}),
|
|
2458
|
+
let l = bl(e, Xe(r), Zn(e, n, "service", "", 0)), o = nr(e, n, "__md_command__", null, zt.KW_EXTRACT);
|
|
2459
|
+
return o || (o = {}), hr(e, n, "command_stack", {
|
|
2445
2460
|
command: t,
|
|
2446
2461
|
kw: o
|
|
2447
|
-
}),
|
|
2462
|
+
}), hr(e, n, ll, l), n.__command__ = t, yr(e, n, "__command__"), dl(e, "EV_MT_COMMAND", n, r), null;
|
|
2448
2463
|
},
|
|
2449
2464
|
mt_inject_event: function(e, t, n, r) {
|
|
2450
2465
|
if ("ST_SESSION" !== kt(e)) return window.console.error("Not in session"), -1;
|
|
2451
|
-
if (n || (n = {}),
|
|
2466
|
+
if (n || (n = {}), Er(e, n, ll));
|
|
2452
2467
|
else {
|
|
2453
|
-
let l =
|
|
2454
|
-
|
|
2468
|
+
let l = bl(e, Xe(r), Zn(e, n, "__service__", 0, 0));
|
|
2469
|
+
On(n, "__service__"), hr(e, n, "__message__", t), hr(e, n, ll, l);
|
|
2455
2470
|
}
|
|
2456
|
-
return
|
|
2471
|
+
return yr(e, n, "__message__"), dl(e, t, n, r);
|
|
2457
2472
|
},
|
|
2458
2473
|
mt_subscription_added: function(e, t) {
|
|
2459
2474
|
let n = e.priv;
|
|
2460
|
-
return "ST_SESSION" === kt(e) && n.websocket ? n.inside_on_open ? 0 :
|
|
2475
|
+
return "ST_SESSION" === kt(e) && n.websocket ? n.inside_on_open ? 0 : ml(e, t) : 0;
|
|
2461
2476
|
},
|
|
2462
2477
|
mt_subscription_deleted: function(e, t) {
|
|
2463
2478
|
let n = e.priv;
|
|
2464
2479
|
if ("ST_SESSION" !== kt(e) || !n.websocket) return 0;
|
|
2465
2480
|
if (n.inside_on_open) return 0;
|
|
2466
|
-
if (
|
|
2481
|
+
if (Wn(t.event)) return 0;
|
|
2467
2482
|
let r = {}, l = t.__global__, o = t.__config__, s = t.__filter__, i = t.__service__, _ = t.subscriber;
|
|
2468
2483
|
o && (r.__config__ = o), l && (r.__global__ = l), s && (r.__filter__ = s);
|
|
2469
|
-
return
|
|
2484
|
+
return hr(e, r, ll, bl(e, Xe(_), i)), yr(e, r, "__unsubscribing__"), dl(e, t.event, r, e);
|
|
2470
2485
|
}
|
|
2471
2486
|
};
|
|
2472
|
-
e.GObj = O, e.SDATA = j, e.SDATAAUTHZ = (e, t, n, r, l, o) => new
|
|
2487
|
+
e.GObj = O, 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__", {
|
|
2473
2488
|
enumerable: !0,
|
|
2474
2489
|
get: function() {
|
|
2475
2490
|
return p;
|
|
@@ -2480,50 +2495,50 @@
|
|
|
2480
2495
|
return t;
|
|
2481
2496
|
}, e.build_stats_response = o, e.clean_name = function(e) {
|
|
2482
2497
|
return e.replace(/[?# ^:]/g, "_");
|
|
2483
|
-
}, e.clear_timeout =
|
|
2498
|
+
}, e.clear_timeout = qr, e.cmp_two_simple_json = Bn, e.command_parser = function(e, t, n, r) {}, e.createElement2 = function e(t, n) {
|
|
2484
2499
|
let [r, l, o, s] = t;
|
|
2485
|
-
if (!r) return void
|
|
2500
|
+
if (!r) return void dn("Tag must be a valid HTML element.");
|
|
2486
2501
|
let i = document.createElement(r), _ = "";
|
|
2487
2502
|
if (l && "object" == typeof l) for (let e of Object.keys(l)) if ("style" === e && "object" == typeof l[e]) {
|
|
2488
2503
|
let t = "";
|
|
2489
2504
|
for (const n of Object.keys(l[e])) t += `${n}: ${l[e][n]};`;
|
|
2490
2505
|
i.style.cssText = t;
|
|
2491
2506
|
} 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]);
|
|
2492
|
-
if (
|
|
2507
|
+
if (Ln(o)) if (o = o.trim(), o.length > 0 && "<" === o[0]) i.appendChild(wr(o));
|
|
2493
2508
|
else if (n && _) i.textContent = n(_) || o;
|
|
2494
2509
|
else i.textContent = o;
|
|
2495
|
-
else if (
|
|
2496
|
-
if (o.length > 0) if (
|
|
2510
|
+
else if (Pn(o)) {
|
|
2511
|
+
if (o.length > 0) if (Ln(o[0])) i.appendChild(e(o, n));
|
|
2497
2512
|
else for (let t of o) Array.isArray(t) && t.length > 0 ? i.appendChild(e(t, n)) : t instanceof HTMLElement && i.appendChild(t);
|
|
2498
|
-
} else o instanceof HTMLElement || o instanceof Text || o instanceof SVGElement ? i.appendChild(o) : null != o && (
|
|
2513
|
+
} else o instanceof HTMLElement || o instanceof Text || o instanceof SVGElement ? i.appendChild(o) : null != o && (dn("content ignored"), hn(o));
|
|
2499
2514
|
if (s && "object" == typeof s) for (const e of Object.keys(s)) i.addEventListener(e, s[e]);
|
|
2500
2515
|
return i;
|
|
2501
|
-
}, e.createOneHtml =
|
|
2502
|
-
let n =
|
|
2503
|
-
return
|
|
2516
|
+
}, e.createOneHtml = wr, e.create_json_record = function(e, t) {
|
|
2517
|
+
let n = En(e);
|
|
2518
|
+
return vn(n, t), n;
|
|
2504
2519
|
}, e.create_template_record = function(e, t) {
|
|
2505
2520
|
let n = {};
|
|
2506
2521
|
return t || (t = {}), Object.entries(e).forEach(([e, r]) => {
|
|
2507
2522
|
let l;
|
|
2508
|
-
|
|
2509
|
-
let o =
|
|
2523
|
+
Cn(r) && (l = r.default);
|
|
2524
|
+
let o = nr(null, t, e, l);
|
|
2510
2525
|
n[e] = o;
|
|
2511
2526
|
}), n;
|
|
2512
|
-
}, e.current_timestamp =
|
|
2513
|
-
let n =
|
|
2514
|
-
return n &&
|
|
2527
|
+
}, e.current_timestamp = Nr, e.data_type_t = E, e.db_list_persistent_attrs = function(e, t) {
|
|
2528
|
+
let n = ar(Lr(e), null, !1), r = {};
|
|
2529
|
+
return n && Cn(n) && (r = ir(e, n, t, !1)), r;
|
|
2515
2530
|
}, e.db_load_persistent_attrs = function(e, t) {
|
|
2516
|
-
let n =
|
|
2517
|
-
if (r &&
|
|
2518
|
-
let l =
|
|
2519
|
-
l =
|
|
2531
|
+
let n = yt(e, y.SDF_PERSIST), r = ar(Lr(e), null, !1);
|
|
2532
|
+
if (r && Cn(r)) {
|
|
2533
|
+
let l = ir(e, r, t, !1);
|
|
2534
|
+
l = ir(e, l, n, !1), wt(e, l, y.SDF_PERSIST);
|
|
2520
2535
|
}
|
|
2521
2536
|
}, e.db_remove_persistent_attrs = function(e, t) {
|
|
2522
|
-
let n =
|
|
2523
|
-
0 ===
|
|
2537
|
+
let n = _r(e, ar(Lr(e), null, !1), t, !1);
|
|
2538
|
+
0 === kn(n) ? cr(Lr(e)) : ur(Lr(e), n);
|
|
2524
2539
|
}, e.db_save_persistent_attrs = function(e, t) {
|
|
2525
|
-
let n =
|
|
2526
|
-
return r &&
|
|
2540
|
+
let n = ir(e, yt(e, y.SDF_PERSIST), t, !1), r = ar(Lr(e), null, !1);
|
|
2541
|
+
return r && Cn(r) && jn(n, r), ur(Lr(e), n);
|
|
2527
2542
|
}, e.debounce = function(e, t = 0, n = !1) {
|
|
2528
2543
|
let r = null, l = null, o = null;
|
|
2529
2544
|
const s = (...s) => {
|
|
@@ -2549,21 +2564,21 @@
|
|
|
2549
2564
|
}
|
|
2550
2565
|
return t;
|
|
2551
2566
|
}, e.empty_json = function(e) {
|
|
2552
|
-
return 0 ===
|
|
2553
|
-
}, e.empty_string =
|
|
2567
|
+
return 0 === In(e);
|
|
2568
|
+
}, e.empty_string = Wn, e.escapeHtml = Or, e.event_flag_t = D, e.flat2json = function(e) {
|
|
2554
2569
|
if (null === e || "object" != typeof e || Array.isArray(e)) throw new Error("flat2json: a flat json is an object of id -> value");
|
|
2555
2570
|
let t = null;
|
|
2556
2571
|
for (const n of Object.keys(e)) {
|
|
2557
|
-
const r =
|
|
2572
|
+
const r = Cr(n);
|
|
2558
2573
|
if (!r || 0 === r.length) throw new Error(`flat2json: malformed flat id: '${n}'`);
|
|
2559
|
-
if (r.length >
|
|
2574
|
+
if (r.length > kr) throw new Error(`flat2json: '${n}' deeper than 256`);
|
|
2560
2575
|
const l = "number" == typeof r[0];
|
|
2561
2576
|
if (null === t) t = l ? [] : {};
|
|
2562
2577
|
else if (l !== Array.isArray(t)) throw new Error(`flat2json: '${n}' does not fit a ${Array.isArray(t) ? "array" : "object"} root`);
|
|
2563
2578
|
let o = t;
|
|
2564
2579
|
for (let t = 0; t < r.length; t++) {
|
|
2565
2580
|
const l = r[t], s = "number" == typeof l, i = t === r.length - 1, _ = !i && "number" == typeof r[t + 1];
|
|
2566
|
-
if (s && l >
|
|
2581
|
+
if (s && l > $r) throw new Error(`flat2json: array index ${l} over the limit (100000) in '${n}'`);
|
|
2567
2582
|
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"}`);
|
|
2568
2583
|
if (i) {
|
|
2569
2584
|
if (Array.isArray(o)) {
|
|
@@ -2603,15 +2618,15 @@
|
|
|
2603
2618
|
removed: {},
|
|
2604
2619
|
changed: {}
|
|
2605
2620
|
};
|
|
2606
|
-
for (const e of Object.keys(n)) Object.prototype.hasOwnProperty.call(r, e) ?
|
|
2621
|
+
for (const e of Object.keys(n)) Object.prototype.hasOwnProperty.call(r, e) ? Pr(n[e], r[e]) || (l.changed[e] = {
|
|
2607
2622
|
from: n[e],
|
|
2608
2623
|
to: r[e]
|
|
2609
2624
|
}) : l.removed[e] = n[e];
|
|
2610
2625
|
for (const e of Object.keys(r)) Object.prototype.hasOwnProperty.call(n, e) || (l.added[e] = r[e]);
|
|
2611
2626
|
return l;
|
|
2612
2627
|
}, e.flat_key_join = function(e) {
|
|
2613
|
-
return Array.isArray(e) && 0 !== e.length ? e.map((e) => "number" == typeof e ? `[${e}]` :
|
|
2614
|
-
}, e.flat_key_split =
|
|
2628
|
+
return Array.isArray(e) && 0 !== e.length ? e.map((e) => "number" == typeof e ? `[${e}]` : Ir(e)).join("`") : "";
|
|
2629
|
+
}, e.flat_key_split = Cr, e.gclass_add_ev_action = Ee, e.gclass_add_event_type = 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 = Se, e.gclass_flag_t = w, e.gclass_unregister = be, e.getPositionRelativeToBody = function(e) {
|
|
2615
2630
|
if (!e) return {
|
|
2616
2631
|
top: 0,
|
|
2617
2632
|
left: 0,
|
|
@@ -2630,14 +2645,14 @@
|
|
|
2630
2645
|
right: n + i + r,
|
|
2631
2646
|
bottom: t + s + l
|
|
2632
2647
|
};
|
|
2633
|
-
}, e.get_function_name =
|
|
2648
|
+
}, e.get_function_name = Ar, e.get_now = function() {
|
|
2634
2649
|
return Math.floor(Date.now() / 1e3);
|
|
2635
2650
|
}, e.gobj_bottom_gobj = st, e.gobj_change_parent = function(e, t) {
|
|
2636
|
-
return ot(e) ? (
|
|
2651
|
+
return ot(e) ? (dn("gobj NULL or DESTROYED"), null) : t instanceof O ? (e.parent && e.parent.mt_child_removed && e.parent.mt_child_removed(e.parent, e), e.parent && (De(e.parent, e), e.parent = null), Re(t, e), t.mt_child_added && (Y(e) && pn(n("👦👦🔵 child_added(%s): %s", tt(t), et(e))), t.mt_child_added(t, e)), 0) : (dn(`${et(e)}: gobj_change_parent() BAD TYPE of parent`), -1);
|
|
2637
2652
|
}, e.gobj_change_state = At, e.gobj_command = function(e, t, r, o) {
|
|
2638
|
-
return ot(e) ? (
|
|
2653
|
+
return ot(e) ? (dn("gobj NULL or DESTROYED"), -1) : ((function(e) {
|
|
2639
2654
|
return V > 1 || !!e && !!(x(e) & L.TRACE_COMMANDS);
|
|
2640
|
-
}(e) || q(e, null) && !z(o, null)) && (P(n("🌀🌀 mach(%s%s), cmd: %s, src: %s", Ke(e) ? "" : "!!", et(e), t, et(o))), H(e) &&
|
|
2655
|
+
}(e) || q(e, null) && !z(o, null)) && (P(n("🌀🌀 mach(%s%s), cmd: %s, src: %s", Ke(e) ? "" : "!!", et(e), t, et(o))), H(e) && hn(r)), e.gclass.gmt.mt_command_parser ? e.gclass.gmt.mt_command_parser(e, t, r, o) : e.gclass.command_table ? c ? c(e, t, r, o) : l(0, -1, n("%s: global command parser not available", et(e)), 0, 0) : l(0, -1, n("%s: command table not available", et(e)), 0, 0));
|
|
2641
2656
|
}, e.gobj_create = function(e, t, n, r) {
|
|
2642
2657
|
return Ie(e, t, n, r, 0);
|
|
2643
2658
|
}, e.gobj_create2 = Ie, e.gobj_create_default_service = function(e, t, n, r) {
|
|
@@ -2649,7 +2664,7 @@
|
|
|
2649
2664
|
}, e.gobj_create_yuno = function(e, t, n) {
|
|
2650
2665
|
return Ie(e, t, n, null, N.gobj_flag_yuno);
|
|
2651
2666
|
}, e.gobj_current_state = kt, e.gobj_default_service = Oe, e.gobj_deliver_posted_events = Ut, e.gobj_destroy = Pe, e.gobj_find_child = pt, e.gobj_find_gobj = function(e, t) {
|
|
2652
|
-
if (
|
|
2667
|
+
if (Wn(t)) return null;
|
|
2653
2668
|
const n = t.toLowerCase();
|
|
2654
2669
|
return "__default_service__" === n ? m : "__yuno__" === n || "__root__" === n ? p : mt(p, t);
|
|
2655
2670
|
}, e.gobj_find_service = we, e.gobj_find_subscribings = Ht, e.gobj_find_subscriptions = Jt, 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() {
|
|
@@ -2661,24 +2676,24 @@
|
|
|
2661
2676
|
}, e.gobj_list_subscriptions = function(e) {
|
|
2662
2677
|
let t = Jt(e, null, null, null);
|
|
2663
2678
|
for (let n = 0; n < t.length; n++) {
|
|
2664
|
-
let r = t[n], l =
|
|
2665
|
-
|
|
2679
|
+
let r = t[n], l = er(e, r, "publisher", null, zt.KW_REQUIRED), o = er(e, r, "subscriber", null, zt.KW_REQUIRED);
|
|
2680
|
+
Nn(r, "s_event", Zn(e, r, "event", "", zt.KW_REQUIRED)), Nn(r, "s_publisher", et(l)), Nn(r, "s_subscriber", et(o));
|
|
2666
2681
|
}
|
|
2667
2682
|
let n = Ht(e, 0, null, 0);
|
|
2668
2683
|
for (let t = 0; t < n.length; t++) {
|
|
2669
|
-
let r = n[t], l =
|
|
2670
|
-
|
|
2684
|
+
let r = n[t], l = er(e, r, "publisher", null, zt.KW_REQUIRED), o = er(e, r, "subscriber", null, zt.KW_REQUIRED);
|
|
2685
|
+
Nn(r, "s_event", Zn(e, r, "event", "", zt.KW_REQUIRED)), Nn(r, "s_publisher", et(l)), Nn(r, "s_subscriber", et(o));
|
|
2671
2686
|
}
|
|
2672
2687
|
return {
|
|
2673
2688
|
subscriptions: t,
|
|
2674
2689
|
subscribings: n,
|
|
2675
|
-
"total subscriptions":
|
|
2676
|
-
total_subscribings:
|
|
2690
|
+
"total subscriptions": $n(t),
|
|
2691
|
+
total_subscribings: $n(n)
|
|
2677
2692
|
};
|
|
2678
2693
|
}, e.gobj_load_persistent_attrs = function(e, t) {
|
|
2679
|
-
return Be(e) ? i ? i(e, t) : -1 : (
|
|
2694
|
+
return Be(e) ? i ? i(e, t) : -1 : (dn(`${et(e)}: Only gobj services can load/save writable-persistent`), -1);
|
|
2680
2695
|
}, e.gobj_match_children = function(e, t) {
|
|
2681
|
-
if (ot(e)) return
|
|
2696
|
+
if (ot(e)) return dn("gobj NULL or DESTROYED"), null;
|
|
2682
2697
|
t = t || {};
|
|
2683
2698
|
let n = [];
|
|
2684
2699
|
const r = e.dl_children;
|
|
@@ -2698,16 +2713,16 @@
|
|
|
2698
2713
|
}
|
|
2699
2714
|
}(n, e), n;
|
|
2700
2715
|
}, 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 = function(e, t, r, l) {
|
|
2701
|
-
return e && e instanceof O ? e.obflag & (R.obflag_destroyed | R.obflag_destroying) ? (
|
|
2716
|
+
return e && e instanceof O ? e.obflag & (R.obflag_destroyed | R.obflag_destroying) ? (dn(`gobj_post_event(): gobj dst DESTROYING, event ${t}`), -1) : Wn(t) ? (dn("gobj_post_event(): event EMPTY"), -1) : It(e, t, 0) ? Pt.length >= 1e4 ? (dn(`gobj_post_event(): too many posted events, this is NOT a work queue, event ${t}, pending ${Pt.length}`), -1) : (Pt.push({
|
|
2702
2717
|
dst: e,
|
|
2703
2718
|
event: t,
|
|
2704
2719
|
kw: r,
|
|
2705
2720
|
src: l
|
|
2706
|
-
}), q(e, t) && !z(l, t) && P(n("📬 posted(%s%s), ev: %s, pending: %d", e.running ? "" : "!!", et(e), t, Pt.length)), Lt || (Lt = !0, setTimeout(Ut, 0)), 0) : (
|
|
2721
|
+
}), q(e, t) && !z(l, t) && P(n("📬 posted(%s%s), ev: %s, pending: %d", e.running ? "" : "!!", et(e), t, Pt.length)), Lt || (Lt = !0, setTimeout(Ut, 0)), 0) : (dn(`gobj_post_event(): event NOT DEFINED in gclass ${Ze(e)}, event ${t}`), -1) : (dn(`gobj_post_event(): gobj dst NULL, event ${t}`), -1);
|
|
2707
2722
|
}, e.gobj_posted_events_size = function() {
|
|
2708
2723
|
return Pt.length;
|
|
2709
|
-
}, e.gobj_publish_event = qt, e.gobj_read_attr = Et, e.gobj_read_attrs =
|
|
2710
|
-
return Be(e) ? a ? a(e, t) : -1 : (
|
|
2724
|
+
}, e.gobj_publish_event = qt, e.gobj_read_attr = Et, e.gobj_read_attrs = yt, e.gobj_read_bool_attr = Tt, e.gobj_read_integer_attr = vt, e.gobj_read_pointer_attr = St, e.gobj_read_str_attr = jt, e.gobj_remove_persistent_attrs = function(e, t) {
|
|
2725
|
+
return Be(e) ? a ? a(e, t) : -1 : (dn(`${et(e)}: Only gobj services can load/save writable-persistent`), -1);
|
|
2711
2726
|
}, e.gobj_repr_global_trace_levels = function() {
|
|
2712
2727
|
return U.map(([e, t, n]) => ({
|
|
2713
2728
|
name: e,
|
|
@@ -2717,54 +2732,54 @@
|
|
|
2717
2732
|
}));
|
|
2718
2733
|
}, e.gobj_reset_volatil_attrs = function(e) {
|
|
2719
2734
|
return function(e, t, n) {
|
|
2720
|
-
if (ot(e)) return
|
|
2735
|
+
if (ot(e)) return dn("gobj NULL or DESTROYED"), -1;
|
|
2721
2736
|
let r = e.gclass.attrs_table;
|
|
2722
2737
|
for (let l = 0; l < r.length; l++) {
|
|
2723
2738
|
const o = r[l];
|
|
2724
2739
|
if (o.name && !(n && o.flag & n) && (-1 === t || o.flag & t)) {
|
|
2725
2740
|
const t = ae(e, e.jn_attrs, o);
|
|
2726
|
-
|
|
2741
|
+
Cn(e.priv) && e.priv.hasOwnProperty(o.name) && (e.priv[o.name] = t), e.gclass.gmt.mt_writing && e.gclass.gmt.mt_writing(e, o.name);
|
|
2727
2742
|
}
|
|
2728
2743
|
}
|
|
2729
2744
|
return 0;
|
|
2730
|
-
}(e,
|
|
2745
|
+
}(e, y.SDF_VOLATIL, 0);
|
|
2731
2746
|
}, e.gobj_save_persistent_attrs = Ae, e.gobj_search_path = mt, e.gobj_send_event = Ft, e.gobj_services = function() {
|
|
2732
2747
|
let e = [];
|
|
2733
|
-
for (const t of Object.keys(b))
|
|
2748
|
+
for (const t of Object.keys(b)) Dn(e, t);
|
|
2734
2749
|
return e;
|
|
2735
2750
|
}, e.gobj_set_bottom_gobj = it, e.gobj_set_deep_trace = function(e) {
|
|
2736
2751
|
return V = Number(e) || 0, 0;
|
|
2737
2752
|
}, 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) {
|
|
2738
|
-
if (!e) return
|
|
2753
|
+
if (!e) return dn("gobj_set_gobj_no_trace: gobj NULL"), -1;
|
|
2739
2754
|
const r = W(t, "gobj_set_gobj_no_trace", e.gclass && e.gclass.s_user_trace_level || null);
|
|
2740
2755
|
return r ? (n ? e.no_trace_level |= r : e.no_trace_level &= ~r, 0) : -1;
|
|
2741
2756
|
}, e.gobj_set_gobj_trace = function(e, t, n) {
|
|
2742
|
-
if (!e) return
|
|
2757
|
+
if (!e) return dn("gobj_set_gobj_trace: gobj NULL"), -1;
|
|
2743
2758
|
const r = W(t, "gobj_set_gobj_trace", e.gclass && e.gclass.s_user_trace_level || null);
|
|
2744
2759
|
return r ? (n ? e.trace_level |= r : e.trace_level &= ~r, 0) : -1;
|
|
2745
2760
|
}, e.gobj_set_trace_machine_format = function(e) {
|
|
2746
2761
|
C = 1 === Number(e) ? 1 : 0;
|
|
2747
2762
|
}, e.gobj_short_name = et, e.gobj_start = Le, e.gobj_start_children = function(e) {
|
|
2748
|
-
return ot(e) ? (
|
|
2763
|
+
return ot(e) ? (dn("gobj NULL or DESTROYED"), -1) : at(e, A.WALK_FIRST2LAST, Ue, 0, 0);
|
|
2749
2764
|
}, e.gobj_start_tree = function(e) {
|
|
2750
|
-
return ot(e) ? (
|
|
2765
|
+
return ot(e) ? (dn("gobj NULL or DESTROYED"), -1) : (J(e) && P(n("⏺ ⏺ ⏺ ⏺ start_tree: %s", tt(e))), e.gclass.gclass_flag & w.gcflag_manual_start || e.disabled ? 0 : (e.running || Le(e), ut(e, A.WALK_TOP2BOTTOM, Fe, 0, 0)));
|
|
2751
2766
|
}, e.gobj_start_up = function(e, t, n, r, l, o, s) {
|
|
2752
2767
|
i = t, _ = n, a = r, u = l, c = o, f = s;
|
|
2753
2768
|
const d = [["EV_STATE_CHANGED", D.EVF_SYSTEM_EVENT | D.EVF_OUTPUT_EVENT | D.EVF_NO_WARN_SUBS], [0, 0]];
|
|
2754
2769
|
for (let e = 0; e < d.length; e++) {
|
|
2755
2770
|
let t = d[e][0], n = d[e][1];
|
|
2756
|
-
|
|
2771
|
+
ye(g, t, n);
|
|
2757
2772
|
}
|
|
2758
2773
|
return 0;
|
|
2759
2774
|
}, e.gobj_stats = function(e, t, r, l) {
|
|
2760
|
-
return ot(e) ? (
|
|
2775
|
+
return ot(e) ? (dn("gobj NULL or DESTROYED"), -1) : e.gclass.gmt.mt_stats ? e.gclass.gmt.mt_stats(e, t, r, l) : f ? f(e, t, r, l) : o(0, -1, n("%s, stats parser not available", et(e)), 0, 0);
|
|
2761
2776
|
}, e.gobj_stop = Ge, e.gobj_stop_children = Me, e.gobj_stop_tree = function(e) {
|
|
2762
|
-
return ot(e) ? (
|
|
2777
|
+
return ot(e) ? (dn("gobj NULL or DESTROYED"), -1) : (J(e) && P(n("⏹ ⏹ ⏹ ⏹ stop_tree: %s", tt(e))), Ke(e) && Ge(e), ut(e, A.WALK_TOP2BOTTOM, Ve, 0, 0));
|
|
2763
2778
|
}, e.gobj_subscribe_event = Yt, e.gobj_trace_level = x, e.gobj_trace_machine_format = function() {
|
|
2764
2779
|
return C;
|
|
2765
2780
|
}, e.gobj_trace_no_level = K, e.gobj_unsubscribe_event = function(e, t, n, r) {
|
|
2766
|
-
if (null == n && (n = {}), !e) return
|
|
2767
|
-
if (!r) return
|
|
2781
|
+
if (null == n && (n = {}), !e) return dn(`publisher NULL: ev ${t}`), 0;
|
|
2782
|
+
if (!r) return dn(`subscriber NULL: ev ${t}`), 0;
|
|
2768
2783
|
const l = /* @__PURE__ */ new Set([
|
|
2769
2784
|
"__config__",
|
|
2770
2785
|
"__global__",
|
|
@@ -2773,80 +2788,80 @@
|
|
|
2773
2788
|
"__service__"
|
|
2774
2789
|
]);
|
|
2775
2790
|
if (Object.keys(n).forEach((n) => {
|
|
2776
|
-
l.has(n) ||
|
|
2777
|
-
}),
|
|
2778
|
-
else if (!(Ct(e, t, D.EVF_OUTPUT_EVENT) || e.gclass.gclass_flag & w.gcflag_no_check_output_events)) return
|
|
2791
|
+
l.has(n) || dn(`${et(e)}: key ignored in subscription (key: ${n}, event: ${t})`);
|
|
2792
|
+
}), Wn(t)) t = "";
|
|
2793
|
+
else if (!(Ct(e, t, D.EVF_OUTPUT_EVENT) || e.gclass.gclass_flag & w.gcflag_no_check_output_events)) return dn(`event NOT in output event list: ${et(e)}, ev ${t}`), 0;
|
|
2779
2794
|
let o = Wt(e.dl_subscriptions, e, t, n, r), s = 0;
|
|
2780
2795
|
for (let t = 0; t < o.length; t++) {
|
|
2781
2796
|
let n = o[t];
|
|
2782
2797
|
Kt(e, n, !1, !1), s++;
|
|
2783
2798
|
}
|
|
2784
|
-
return s || (
|
|
2785
|
-
}, e.gobj_unsubscribe_list = Bt, e.gobj_walk_gobj_children = at, e.gobj_walk_gobj_children_tree = ut, e.gobj_write_attr = Ot, e.gobj_write_attrs = wt, e.gobj_write_bool_attr = Nt, e.gobj_write_integer_attr = Rt, e.gobj_write_str_attr = Dt, e.gobj_yuno = He, e.gobj_yuno_id = Qe, e.gobj_yuno_name = qe, e.gobj_yuno_role = ze, e.id_index_in_obj_list =
|
|
2799
|
+
return s || (bn(`${et(e)}: No subscription found`), hn(n, "No subscription found")), 0;
|
|
2800
|
+
}, e.gobj_unsubscribe_list = Bt, e.gobj_walk_gobj_children = at, e.gobj_walk_gobj_children_tree = ut, e.gobj_write_attr = Ot, e.gobj_write_attrs = wt, e.gobj_write_bool_attr = Nt, e.gobj_write_integer_attr = Rt, e.gobj_write_str_attr = Dt, e.gobj_yuno = He, e.gobj_yuno_id = Qe, e.gobj_yuno_name = qe, e.gobj_yuno_role = ze, e.id_index_in_obj_list = dr, e.index_in_list = Rr, e.is_array = Pn, e.is_boolean = Fn, e.is_date = function(e) {
|
|
2786
2801
|
return e instanceof Date && !isNaN(e);
|
|
2787
|
-
}, e.is_function =
|
|
2788
|
-
if (!
|
|
2802
|
+
}, e.is_function = Vn, e.is_gobj = Mn, e.is_metadata_key = function(e) {
|
|
2803
|
+
if (!Ln(e)) return !1;
|
|
2789
2804
|
let t;
|
|
2790
2805
|
for (t = 0; t < e.length && "_" === e[t] && !(t > 2); t++);
|
|
2791
2806
|
return 2 === t;
|
|
2792
|
-
}, e.is_null =
|
|
2793
|
-
if (!
|
|
2807
|
+
}, e.is_null = Gn, e.is_number = Un, e.is_object = Cn, e.is_private_key = function(e) {
|
|
2808
|
+
if (!Ln(e)) return !1;
|
|
2794
2809
|
let t;
|
|
2795
2810
|
for (t = 0; t < e.length && "_" === e[t] && !(t > 2); t++);
|
|
2796
2811
|
return 1 === t;
|
|
2797
2812
|
}, e.is_pure_number = function(e) {
|
|
2798
|
-
if (
|
|
2799
|
-
if (!
|
|
2813
|
+
if (Un(e)) return !0;
|
|
2814
|
+
if (!Ln(e)) return !1;
|
|
2800
2815
|
const t = Number(e);
|
|
2801
2816
|
return !isNaN(t) && "" !== e.trim() && !isNaN(t);
|
|
2802
|
-
}, e.is_string =
|
|
2803
|
-
let l =
|
|
2804
|
-
if (!l) return
|
|
2805
|
-
if (
|
|
2817
|
+
}, e.is_string = Ln, e.jdb_delete = function(e, t, n, r) {
|
|
2818
|
+
let l = nr(null, nr(null, e, "topics", null, 0), t, null, 0);
|
|
2819
|
+
if (!l) return dn("jdb_delete: topic not found: " + t), null;
|
|
2820
|
+
if (Wn(r.id)) return dn("jdb_delete: record without id: " + r), mn(r), null;
|
|
2806
2821
|
let o, s = n.split("`"), i = l;
|
|
2807
|
-
for (; (o = s.shift()) && !
|
|
2808
|
-
if (0 === s.length && i) if (
|
|
2809
|
-
let e =
|
|
2822
|
+
for (; (o = s.shift()) && !Wn(o) && i;) Cn(i) && (i = nr(null, i, e.hook, null, 0)), i = jr(i, null, o, !1);
|
|
2823
|
+
if (0 === s.length && i) if (Pn(i)) {
|
|
2824
|
+
let e = dr(i, r.id);
|
|
2810
2825
|
e >= 0 && i.splice(e, 1);
|
|
2811
2826
|
} else {
|
|
2812
|
-
let t =
|
|
2827
|
+
let t = nr(null, i, e.hook, null, 0), n = dr(t, r.id);
|
|
2813
2828
|
n >= 0 && t.splice(n, 1);
|
|
2814
2829
|
}
|
|
2815
2830
|
return l;
|
|
2816
2831
|
}, e.jdb_get = function(e, t, n, r) {
|
|
2817
|
-
let l =
|
|
2818
|
-
return l ? (void 0 === r && (r = !0),
|
|
2832
|
+
let l = nr(null, nr(null, e, "topics", null, 0), t, null, 0);
|
|
2833
|
+
return l ? (void 0 === r && (r = !0), jr(l, e.hook, n, r)) : (dn("jdb_get: topic not found: " + t), null);
|
|
2819
2834
|
}, e.jdb_get_by_idx = function(e, t, n) {
|
|
2820
|
-
let r =
|
|
2821
|
-
return r ? n < r.length ? r[n] : {} : (
|
|
2835
|
+
let r = nr(null, nr(null, e, "topics", null, 0), t, null, 0);
|
|
2836
|
+
return r ? n < r.length ? r[n] : {} : (dn("jdb_get_by_idx: topic not found: " + t), null);
|
|
2822
2837
|
}, e.jdb_get_topic = function(e, t) {
|
|
2823
|
-
let n =
|
|
2824
|
-
if (!n) return
|
|
2825
|
-
return
|
|
2838
|
+
let n = nr(null, e, "topics", null, 0);
|
|
2839
|
+
if (!n) return dn("jdb topics section not found"), mn(e), null;
|
|
2840
|
+
return nr(null, n, t, null, 0) || (dn("jdb topic not found: " + t), mn(n), null);
|
|
2826
2841
|
}, e.jdb_init = function(e, t, n) {
|
|
2827
|
-
n && (e =
|
|
2828
|
-
let r =
|
|
2829
|
-
|
|
2830
|
-
let l =
|
|
2831
|
-
return
|
|
2832
|
-
"__" !== t.substring(0, 2) &&
|
|
2842
|
+
n && (e = En(e));
|
|
2843
|
+
let r = nr(null, e, "type", [], 1);
|
|
2844
|
+
Zn(null, e, "hook", "data", 1);
|
|
2845
|
+
let l = nr(null, e, "schema", {}, 1), o = nr(null, e, "topics", {}, 1);
|
|
2846
|
+
return vr(l, function(e, t, n, l) {
|
|
2847
|
+
"__" !== t.substring(0, 2) && nr(null, o, l, En(r), 1);
|
|
2833
2848
|
}, t), e;
|
|
2834
2849
|
}, e.jdb_update = function(e, t, n, r) {
|
|
2835
|
-
let l =
|
|
2836
|
-
if (!l) return
|
|
2837
|
-
if (
|
|
2850
|
+
let l = nr(null, nr(null, e, "topics", null, 0), t, null, 0);
|
|
2851
|
+
if (!l) return dn("jdb_update: topic not found: " + t), null;
|
|
2852
|
+
if (Wn(r.id)) return dn("jdb_update: record without id: " + r), mn(r), null;
|
|
2838
2853
|
let o, s = n.split("`"), i = l;
|
|
2839
|
-
for (; (o = s.shift()) && !
|
|
2840
|
-
if (0 === s.length && i) if (
|
|
2854
|
+
for (; (o = s.shift()) && !Wn(o) && i;) Cn(i) && (i = nr(null, i, e.hook, [], 1)), i = jr(i, null, o, !1);
|
|
2855
|
+
if (0 === s.length && i) if (Pn(i)) i.push(r);
|
|
2841
2856
|
else if (i.id === r.id) Object.assign(i, r);
|
|
2842
2857
|
else {
|
|
2843
|
-
let t =
|
|
2858
|
+
let t = nr(null, i, e.hook, [], 1), n = jr(t, e.hook, r.id, !1);
|
|
2844
2859
|
n ? Object.assign(n, r) : t.push(r);
|
|
2845
2860
|
}
|
|
2846
2861
|
return l;
|
|
2847
2862
|
}, e.json2flat = function(e) {
|
|
2848
2863
|
const t = {}, n = (e, r, l) => {
|
|
2849
|
-
if (l >
|
|
2864
|
+
if (l > kr) throw new Error("json2flat: deeper than 256");
|
|
2850
2865
|
if (null === e || "object" != typeof e || Array.isArray(e)) {
|
|
2851
2866
|
if (Array.isArray(e) && e.length > 0) return void e.forEach((e, t) => {
|
|
2852
2867
|
const o = `[${t}]`;
|
|
@@ -2856,7 +2871,7 @@
|
|
|
2856
2871
|
const t = Object.keys(e);
|
|
2857
2872
|
if (t.length > 0) {
|
|
2858
2873
|
for (const o of t) {
|
|
2859
|
-
const t =
|
|
2874
|
+
const t = Ir(o);
|
|
2860
2875
|
n(e[o], 0 === l ? t : r + "`" + t, l + 1);
|
|
2861
2876
|
}
|
|
2862
2877
|
return;
|
|
@@ -2865,11 +2880,11 @@
|
|
|
2865
2880
|
0 !== l && (t[r] = e);
|
|
2866
2881
|
};
|
|
2867
2882
|
return null == e || n(e, "", 0), t;
|
|
2868
|
-
}, e.json_array_append =
|
|
2883
|
+
}, e.json_array_append = Rn, e.json_array_append_new = Dn, e.json_array_extend = function(e, t) {
|
|
2869
2884
|
return t ? (Array.prototype.push.apply(e, t), e) : e;
|
|
2870
|
-
}, e.json_array_remove =
|
|
2885
|
+
}, e.json_array_remove = An, e.json_array_size = $n, e.json_deep_copy = En, e.json_is_identical = yn, e.json_object_del = On, e.json_object_get = Sn, e.json_object_set = wn, e.json_object_set_new = Nn, e.json_object_size = kn, e.json_object_update = Tn, e.json_object_update_existing = vn, e.json_object_update_missing = jn, e.json_size = In, e.jwt2json = function(e, t) {
|
|
2871
2886
|
try {
|
|
2872
|
-
let n =
|
|
2887
|
+
let n = Sr(e);
|
|
2873
2888
|
switch (t) {
|
|
2874
2889
|
case "header": return JSON.parse(n.header);
|
|
2875
2890
|
case "signature": return JSON.parse(n.signature);
|
|
@@ -2878,133 +2893,133 @@
|
|
|
2878
2893
|
} catch (e) {
|
|
2879
2894
|
return null;
|
|
2880
2895
|
}
|
|
2881
|
-
}, e.jwtDecode =
|
|
2882
|
-
if (e && !
|
|
2883
|
-
r || (r =
|
|
2896
|
+
}, e.jwtDecode = Sr, e.kw_clone_by_keys = ir, e.kw_clone_by_not_keys = _r, e.kw_collect = function(e, t, n, r) {
|
|
2897
|
+
if (e && !Mn(e) && dn("GObj bad instanceof"), !t) return null;
|
|
2898
|
+
r || (r = sr);
|
|
2884
2899
|
let l = [];
|
|
2885
|
-
if (
|
|
2900
|
+
if (Pn(t)) for (let e = 0; e < t.length; e++) {
|
|
2886
2901
|
let o = t[e];
|
|
2887
2902
|
r(o, n) && l.push(o);
|
|
2888
2903
|
}
|
|
2889
2904
|
else {
|
|
2890
|
-
if (!
|
|
2905
|
+
if (!Cn(t)) return dn("kw_select() BAD kw parameter"), null;
|
|
2891
2906
|
r(t, n) && l.push(t);
|
|
2892
2907
|
}
|
|
2893
2908
|
return l;
|
|
2894
|
-
}, e.kw_delete =
|
|
2895
|
-
if (!n ||
|
|
2896
|
-
for (let e = 0; e < t.length; e++) if (
|
|
2897
|
-
return r &&
|
|
2898
|
-
}, e.kw_find_path =
|
|
2899
|
-
e && !
|
|
2900
|
-
let o =
|
|
2909
|
+
}, e.kw_delete = zn, e.kw_find_json_in_list = function(e, t, n, r) {
|
|
2910
|
+
if (!n || !Pn(t)) return r && dn("item NULL or kw_list is not a list"), -1;
|
|
2911
|
+
for (let e = 0; e < t.length; e++) if (yn(n, t[e])) return e;
|
|
2912
|
+
return r && dn("item not found in this list"), -1;
|
|
2913
|
+
}, e.kw_find_path = qn, e.kw_flag_t = zt, e.kw_get_bool = Qn, e.kw_get_dict = tr, e.kw_get_dict_value = nr, e.kw_get_int = Xn, e.kw_get_list = function(e, t, n, r, l) {
|
|
2914
|
+
e && !Mn(e) && dn("GObj bad instanceof");
|
|
2915
|
+
let o = qn(e, t, n, !1);
|
|
2901
2916
|
const s = l && l & zt.KW_REQUIRED, i = l && l & zt.KW_CREATE, _ = l && l & zt.KW_EXTRACT;
|
|
2902
2917
|
if (void 0 === o) {
|
|
2903
2918
|
if (i) {
|
|
2904
2919
|
let l = Array(r);
|
|
2905
|
-
return
|
|
2920
|
+
return rr(e, t, n, l), l;
|
|
2906
2921
|
}
|
|
2907
|
-
return s && (
|
|
2922
|
+
return s && (dn(`path not found: '${n}'`), hn(t)), Array(r);
|
|
2908
2923
|
}
|
|
2909
|
-
return _ &&
|
|
2910
|
-
}, e.kw_get_local_storage_value =
|
|
2911
|
-
e && !
|
|
2912
|
-
let o =
|
|
2924
|
+
return _ && zn(e, t, n), Pn(o) ? Array(o) : (s && (dn(`path value MUST BE an array: ${n}`), mn(t)), Array(r));
|
|
2925
|
+
}, e.kw_get_local_storage_value = ar, e.kw_get_pointer = er, e.kw_get_real = function(e, t, n, r, l) {
|
|
2926
|
+
e && !Mn(e) && dn("GObj bad instanceof");
|
|
2927
|
+
let o = qn(e, t, n, !1);
|
|
2913
2928
|
const s = l && l & zt.KW_REQUIRED, i = l && l & zt.KW_CREATE, _ = l && l & zt.KW_EXTRACT;
|
|
2914
2929
|
if (void 0 === o) {
|
|
2915
2930
|
if (i) {
|
|
2916
2931
|
let l = Number(r);
|
|
2917
|
-
return
|
|
2932
|
+
return rr(e, t, n, l), l;
|
|
2918
2933
|
}
|
|
2919
|
-
return s && (
|
|
2934
|
+
return s && (dn(`path not found: '${n}'`), hn(t)), Number(r);
|
|
2920
2935
|
}
|
|
2921
|
-
return _ &&
|
|
2922
|
-
}, e.kw_get_str =
|
|
2923
|
-
if (e && !
|
|
2924
|
-
r || (r =
|
|
2936
|
+
return _ && zn(e, t, n), Un(o) ? Number(o) : (s && (dn(`path value MUST BE a number: ${n}`), mn(t)), Number(r));
|
|
2937
|
+
}, e.kw_get_str = Zn, e.kw_has_key = Hn, e.kw_match_simple = sr, e.kw_pop = Jn, e.kw_remove_local_storage_value = cr, e.kw_select = function(e, t, n, r) {
|
|
2938
|
+
if (e && !Mn(e) && dn("GObj bad instanceof"), !t) return null;
|
|
2939
|
+
r || (r = sr);
|
|
2925
2940
|
let l = [];
|
|
2926
|
-
if (
|
|
2941
|
+
if (Pn(t)) for (let e = 0; e < t.length; e++) {
|
|
2927
2942
|
let o = t[e];
|
|
2928
|
-
r(o, n) && l.push(
|
|
2943
|
+
r(o, n) && l.push(En(o));
|
|
2929
2944
|
}
|
|
2930
2945
|
else {
|
|
2931
|
-
if (!
|
|
2932
|
-
r(t, n) && l.push(
|
|
2946
|
+
if (!Cn(t)) return dn("kw_select() BAD kw parameter"), null;
|
|
2947
|
+
r(t, n) && l.push(En(t));
|
|
2933
2948
|
}
|
|
2934
2949
|
return l;
|
|
2935
|
-
}, e.kw_set_dict_value =
|
|
2936
|
-
e && !
|
|
2937
|
-
let o =
|
|
2950
|
+
}, e.kw_set_dict_value = rr, e.kw_set_local_storage_value = ur, e.kw_set_subdict_value = lr, e.kwid_collect = gr, e.kwid_find_one_record = function(e, t, n, r, l) {
|
|
2951
|
+
e && !Mn(e) && dn("GObj bad instanceof");
|
|
2952
|
+
let o = gr(e, t, n, r, l);
|
|
2938
2953
|
return o && 0 !== o.length ? o[0] : null;
|
|
2939
2954
|
}, e.kwid_get_ids = function(e, t) {
|
|
2940
|
-
if (e && !
|
|
2955
|
+
if (e && !Mn(e) && dn("GObj bad instanceof"), !t) return [];
|
|
2941
2956
|
let n = [];
|
|
2942
|
-
if (
|
|
2943
|
-
else if (
|
|
2944
|
-
else
|
|
2945
|
-
if (
|
|
2946
|
-
else if (
|
|
2947
|
-
let r =
|
|
2957
|
+
if (Ln(t)) n.push(t);
|
|
2958
|
+
else if (Cn(t)) for (let e in t) t.hasOwnProperty(e) && n.push(e);
|
|
2959
|
+
else Pn(t) && t.forEach(function(t) {
|
|
2960
|
+
if (Ln(t)) Wn(t) || n.push(t);
|
|
2961
|
+
else if (Cn(t)) {
|
|
2962
|
+
let r = Zn(e, t, "id", 0, 0);
|
|
2948
2963
|
r && n.push(r);
|
|
2949
2964
|
}
|
|
2950
2965
|
});
|
|
2951
2966
|
return n;
|
|
2952
|
-
}, e.kwid_match_id =
|
|
2953
|
-
e && !
|
|
2967
|
+
}, e.kwid_match_id = fr, e.kwid_new_dict = function(e, t, n) {
|
|
2968
|
+
e && !Mn(e) && dn("GObj bad instanceof");
|
|
2954
2969
|
let r = {};
|
|
2955
|
-
if (
|
|
2956
|
-
else if (
|
|
2957
|
-
let l = t[n], o =
|
|
2958
|
-
|
|
2970
|
+
if (Wn(n) || (t = qn(e, t, n)), Cn(t)) r = t;
|
|
2971
|
+
else if (Pn(t)) for (let n = 0; n < t.length; n++) {
|
|
2972
|
+
let l = t[n], o = Zn(e, l, "id", "", zt.KW_REQUIRED);
|
|
2973
|
+
Wn(o) || (r[o] = l);
|
|
2959
2974
|
}
|
|
2960
|
-
else
|
|
2975
|
+
else dn(`${et(e)} kwid_new_dict: data type unknown`);
|
|
2961
2976
|
return r;
|
|
2962
2977
|
}, e.kwid_new_list = function(e, t, n) {
|
|
2963
|
-
if (e && !
|
|
2964
|
-
if (
|
|
2978
|
+
if (e && !Mn(e) && dn("GObj bad instanceof"), Wn(n) || (t = qn(e, t, n)), Pn(t)) return t;
|
|
2979
|
+
if (Cn(t)) {
|
|
2965
2980
|
let n = [];
|
|
2966
2981
|
for (let r of Object.keys(t)) {
|
|
2967
2982
|
let l = t[r];
|
|
2968
|
-
|
|
2983
|
+
Cn(l) ? (l.id = r, n.push(l)) : dn(`${et(e)} kwid_new_list: not a record: '${r}'`);
|
|
2969
2984
|
}
|
|
2970
2985
|
return n;
|
|
2971
2986
|
}
|
|
2972
|
-
return
|
|
2987
|
+
return dn(`${et(e)} kwid_new_list: wrong type for list`), [];
|
|
2973
2988
|
}, e.list2options = function(e, t, n) {
|
|
2974
2989
|
t = t || "id", n = n || "value";
|
|
2975
2990
|
let r = [];
|
|
2976
|
-
if (
|
|
2991
|
+
if (Pn(e)) for (let l = 0; l < e.length; l++) {
|
|
2977
2992
|
let o = e[l];
|
|
2978
|
-
if (
|
|
2993
|
+
if (Ln(o)) r.push({
|
|
2979
2994
|
id: e[l],
|
|
2980
2995
|
value: e[l]
|
|
2981
2996
|
});
|
|
2982
|
-
else if (
|
|
2997
|
+
else if (Cn(o)) {
|
|
2983
2998
|
let e = {};
|
|
2984
|
-
if (
|
|
2985
|
-
if (!
|
|
2986
|
-
if (!(
|
|
2987
|
-
|
|
2999
|
+
if (Hn(o, t)) {
|
|
3000
|
+
if (!Hn(o, n)) {
|
|
3001
|
+
if (!(In(o) > 0)) {
|
|
3002
|
+
dn("list2options(): object without field value: " + n);
|
|
2988
3003
|
continue;
|
|
2989
3004
|
}
|
|
2990
3005
|
n = Object.keys(o)[0];
|
|
2991
3006
|
}
|
|
2992
3007
|
e.id = o[t], e.value = o[n];
|
|
2993
3008
|
} else {
|
|
2994
|
-
if (!(
|
|
2995
|
-
|
|
3009
|
+
if (!(In(o) > 0)) {
|
|
3010
|
+
dn("list2options(): object without field id: " + t);
|
|
2996
3011
|
continue;
|
|
2997
3012
|
}
|
|
2998
3013
|
t = Object.keys(o)[0], e.id = t, e.value = o[t];
|
|
2999
3014
|
}
|
|
3000
3015
|
r.push(e);
|
|
3001
|
-
} else
|
|
3016
|
+
} else dn("list2options(): case1 not implemented");
|
|
3002
3017
|
}
|
|
3003
|
-
else if (
|
|
3018
|
+
else if (Cn(e)) for (let t of Object.keys(e)) r.push({
|
|
3004
3019
|
id: t,
|
|
3005
3020
|
value: t
|
|
3006
3021
|
});
|
|
3007
|
-
else
|
|
3022
|
+
else dn("list2options(): case2 not implemented");
|
|
3008
3023
|
return r;
|
|
3009
3024
|
}, e.load_json_file = function(e, t, n) {
|
|
3010
3025
|
let r = new XMLHttpRequest();
|
|
@@ -3012,18 +3027,18 @@
|
|
|
3012
3027
|
if (4 === r.readyState) if (200 === r.status || 0 === (e = r).status && e.responseText && e.responseURL.startsWith("file:")) try {
|
|
3013
3028
|
t(JSON.parse(r.responseText));
|
|
3014
3029
|
} catch (e) {
|
|
3015
|
-
n && (
|
|
3030
|
+
n && (dn(`JSON parse status ${r.status}, error: ${e.message}`), n(r.status));
|
|
3016
3031
|
}
|
|
3017
3032
|
else n && n(r.status);
|
|
3018
3033
|
var e;
|
|
3019
3034
|
}, r.send();
|
|
3020
|
-
}, e.log_debug =
|
|
3021
|
-
let t =
|
|
3022
|
-
en &&
|
|
3023
|
-
}, e.log_warning =
|
|
3035
|
+
}, e.log_debug = pn, e.log_error = dn, e.log_info = function(e) {
|
|
3036
|
+
let t = gn(e), n = Nr();
|
|
3037
|
+
en && _n("info", t) && en("%c" + n + " INFO: " + String(t), "color:cyan"), un("info", t, n);
|
|
3038
|
+
}, e.log_warning = bn, e.msg_iev_get_msg_type = Tr, e.msg_iev_get_stack = Er, e.msg_iev_push_stack = hr, e.msg_iev_read_key = pr, e.msg_iev_set_msg_type = yr, e.msg_iev_write_key = mr, e.node_uuid = Dr, e.parseBoolean = xn, e.parseSVG = function(e) {
|
|
3024
3039
|
return new DOMParser().parseFromString(e, "image/svg+xml").firstChild;
|
|
3025
3040
|
}, e.refresh_language = function(e, t) {
|
|
3026
|
-
if (!
|
|
3041
|
+
if (!Vn(t)) return void dn("You must supply a translation function");
|
|
3027
3042
|
e || (e = document);
|
|
3028
3043
|
const n = (t) => {
|
|
3029
3044
|
let n = [];
|
|
@@ -3047,22 +3062,22 @@
|
|
|
3047
3062
|
});
|
|
3048
3063
|
}, e.register_c_ievent_cli = function() {
|
|
3049
3064
|
return function(e) {
|
|
3050
|
-
if (
|
|
3065
|
+
if (al) return dn(`GClass ALREADY created: ${e}`), -1;
|
|
3051
3066
|
const t = [
|
|
3052
3067
|
["ST_DISCONNECTED", [
|
|
3053
3068
|
[
|
|
3054
3069
|
"EV_ON_OPEN",
|
|
3055
|
-
|
|
3070
|
+
El,
|
|
3056
3071
|
"ST_WAIT_IDENTITY_CARD_ACK"
|
|
3057
3072
|
],
|
|
3058
3073
|
[
|
|
3059
3074
|
"EV_ON_CLOSE",
|
|
3060
|
-
|
|
3075
|
+
yl,
|
|
3061
3076
|
null
|
|
3062
3077
|
],
|
|
3063
3078
|
[
|
|
3064
3079
|
"EV_TIMEOUT",
|
|
3065
|
-
|
|
3080
|
+
hl,
|
|
3066
3081
|
null
|
|
3067
3082
|
],
|
|
3068
3083
|
[
|
|
@@ -3074,22 +3089,22 @@
|
|
|
3074
3089
|
["ST_WAIT_IDENTITY_CARD_ACK", [
|
|
3075
3090
|
[
|
|
3076
3091
|
"EV_ON_MESSAGE",
|
|
3077
|
-
|
|
3092
|
+
jl,
|
|
3078
3093
|
null
|
|
3079
3094
|
],
|
|
3080
3095
|
[
|
|
3081
3096
|
"EV_IDENTITY_CARD_ACK",
|
|
3082
|
-
|
|
3097
|
+
vl,
|
|
3083
3098
|
null
|
|
3084
3099
|
],
|
|
3085
3100
|
[
|
|
3086
3101
|
"EV_ON_CLOSE",
|
|
3087
|
-
|
|
3102
|
+
yl,
|
|
3088
3103
|
"ST_DISCONNECTED"
|
|
3089
3104
|
],
|
|
3090
3105
|
[
|
|
3091
3106
|
"EV_TIMEOUT",
|
|
3092
|
-
|
|
3107
|
+
Tl,
|
|
3093
3108
|
null
|
|
3094
3109
|
],
|
|
3095
3110
|
[
|
|
@@ -3101,22 +3116,22 @@
|
|
|
3101
3116
|
["ST_SESSION", [
|
|
3102
3117
|
[
|
|
3103
3118
|
"EV_ON_MESSAGE",
|
|
3104
|
-
|
|
3119
|
+
jl,
|
|
3105
3120
|
null
|
|
3106
3121
|
],
|
|
3107
3122
|
[
|
|
3108
3123
|
"EV_MT_STATS",
|
|
3109
|
-
|
|
3124
|
+
Sl,
|
|
3110
3125
|
null
|
|
3111
3126
|
],
|
|
3112
3127
|
[
|
|
3113
3128
|
"EV_MT_COMMAND",
|
|
3114
|
-
|
|
3129
|
+
Ol,
|
|
3115
3130
|
null
|
|
3116
3131
|
],
|
|
3117
3132
|
[
|
|
3118
3133
|
"EV_ON_CLOSE",
|
|
3119
|
-
|
|
3134
|
+
yl,
|
|
3120
3135
|
"ST_DISCONNECTED"
|
|
3121
3136
|
],
|
|
3122
3137
|
[
|
|
@@ -3127,7 +3142,7 @@
|
|
|
3127
3142
|
]],
|
|
3128
3143
|
[null, null]
|
|
3129
3144
|
];
|
|
3130
|
-
return (
|
|
3145
|
+
return (al = de(e, [
|
|
3131
3146
|
["EV_ON_MESSAGE", D.EVF_OUTPUT_EVENT],
|
|
3132
3147
|
["EV_IDENTITY_CARD_ACK", D.EVF_PUBLIC_EVENT],
|
|
3133
3148
|
["EV_ON_ID_NAK", D.EVF_PUBLIC_EVENT | D.EVF_OUTPUT_EVENT],
|
|
@@ -3138,54 +3153,65 @@
|
|
|
3138
3153
|
["EV_ON_OPEN_ERROR", D.EVF_OUTPUT_EVENT | D.EVF_NO_WARN_SUBS],
|
|
3139
3154
|
["EV_TIMEOUT", 0],
|
|
3140
3155
|
[null, 0]
|
|
3141
|
-
], t,
|
|
3156
|
+
], t, wl, 0, ol, _l, 0, 0, sl, w.gcflag_no_check_output_events)) ? 0 : -1;
|
|
3142
3157
|
}("C_IEVENT_CLI");
|
|
3143
3158
|
}, e.register_c_timer = function() {
|
|
3144
3159
|
return function(e) {
|
|
3145
|
-
if (
|
|
3160
|
+
if (Kr) return dn(`GClass ALREADY created: ${e}`), -1;
|
|
3146
3161
|
const t = [["ST_IDLE", [[
|
|
3147
3162
|
"EV_TIMEOUT",
|
|
3148
|
-
|
|
3163
|
+
Yr,
|
|
3149
3164
|
null
|
|
3150
3165
|
]]]];
|
|
3151
|
-
return (
|
|
3166
|
+
return (Kr = de(e, [
|
|
3152
3167
|
["EV_TIMEOUT", D.EVF_OUTPUT_EVENT],
|
|
3153
3168
|
["EV_TIMEOUT_PERIODIC", D.EVF_OUTPUT_EVENT],
|
|
3154
3169
|
[0, 0]
|
|
3155
|
-
], t,
|
|
3170
|
+
], t, Br, 0, Wr, xr, 0, 0, 0, w.gcflag_manual_start)) ? 0 : -1;
|
|
3156
3171
|
}("C_TIMER");
|
|
3157
3172
|
}, e.register_c_yuno = function() {
|
|
3158
3173
|
return function(e) {
|
|
3159
|
-
if (
|
|
3174
|
+
if (Xr) return dn(`GClass ALREADY created: ${e}`), -1;
|
|
3160
3175
|
const t = [["ST_IDLE", [[
|
|
3161
3176
|
"EV_TIMEOUT_PERIODIC",
|
|
3162
|
-
|
|
3177
|
+
nl,
|
|
3163
3178
|
null
|
|
3164
3179
|
]]]];
|
|
3165
|
-
return (
|
|
3180
|
+
return (Xr = de(e, [["EV_TIMEOUT_PERIODIC", D.EVF_OUTPUT_EVENT | D.EVF_NO_WARN_SUBS], [0, 0]], t, rl, 0, zr, Qr, 0, 0, 0, 0)) ? 0 : -1;
|
|
3166
3181
|
}("C_YUNO");
|
|
3167
3182
|
}, e.safeSrc = function(e) {
|
|
3168
3183
|
if (!e) return "";
|
|
3169
3184
|
const t = String(e).trim();
|
|
3170
|
-
return /^javascript:/i.test(t) || /^data:/i.test(t) ? "" :
|
|
3171
|
-
}, e.sdata_flag_t =
|
|
3185
|
+
return /^javascript:/i.test(t) || /^data:/i.test(t) ? "" : Or(t);
|
|
3186
|
+
}, e.sdata_flag_t = y, e.send_http_json_post = function(e, t, n) {
|
|
3172
3187
|
let r = new XMLHttpRequest();
|
|
3173
3188
|
r.open("POST", e), r.setRequestHeader("Accept", "application/json"), r.setRequestHeader("Content-Type", "application/json"), r.onreadystatechange = function() {
|
|
3174
3189
|
4 === r.readyState && n(r.status, r.responseText);
|
|
3175
3190
|
}, r.send(t);
|
|
3176
3191
|
}, e.set_console_log_enabled = function(e) {
|
|
3177
|
-
|
|
3192
|
+
on = !!e;
|
|
3178
3193
|
}, e.set_console_log_filter = function(e) {
|
|
3179
|
-
|
|
3194
|
+
sn = "function" == typeof e ? e : null;
|
|
3180
3195
|
}, e.set_log_callback = function(e) {
|
|
3181
|
-
|
|
3182
|
-
|
|
3196
|
+
if ((e = "function" == typeof e ? e : null) && e !== nn) {
|
|
3197
|
+
nn = e;
|
|
3198
|
+
for (const [e, t, n] of ln.slice()) {
|
|
3199
|
+
let r = t;
|
|
3200
|
+
if ("json" === e) try {
|
|
3201
|
+
r = JSON.parse(t);
|
|
3202
|
+
} catch (e) {
|
|
3203
|
+
r = t;
|
|
3204
|
+
}
|
|
3205
|
+
cn(e, r, n);
|
|
3206
|
+
}
|
|
3207
|
+
} else nn = e;
|
|
3208
|
+
}, e.set_remote_log_functions = fn, e.set_timeout = Jr, e.set_timeout_periodic = Hr, e.sprintf = n, e.stats_parser = function(e, t, n, r) {}, e.str_in_list = br, e.strcasecmp = Yn, e.strcmp = Kn, e.strncmp = function(e, t, n) {
|
|
3183
3209
|
var r = (e + "").substring(0, n), l = (t + "").substring(0, n);
|
|
3184
3210
|
return r === l ? 0 : r > l ? 1 : -1;
|
|
3185
3211
|
}, e.strs_in_list = function(e, t, n) {
|
|
3186
|
-
if (!e) return
|
|
3187
|
-
if (!t) return
|
|
3188
|
-
for (let r = 0; r < t.length; r++) if (
|
|
3212
|
+
if (!e) return dn("ERROR: strs_in_list() list empty"), !1;
|
|
3213
|
+
if (!t) return dn("ERROR: strs_in_list() str empty"), !1;
|
|
3214
|
+
for (let r = 0; r < t.length; r++) if (br(e, t[r], n)) return !0;
|
|
3189
3215
|
return !1;
|
|
3190
3216
|
}, e.strstr = function(e, t, n) {
|
|
3191
3217
|
var r;
|
|
@@ -3204,13 +3230,13 @@
|
|
|
3204
3230
|
placeholder: void 0,
|
|
3205
3231
|
fkey: null
|
|
3206
3232
|
};
|
|
3207
|
-
if (
|
|
3233
|
+
if (Ln(t)) {
|
|
3208
3234
|
let e = t.split(".");
|
|
3209
3235
|
for (let t = 0; t < e.length; t++) {
|
|
3210
3236
|
let r = e[t];
|
|
3211
|
-
if (
|
|
3212
|
-
else if (
|
|
3213
|
-
else if (
|
|
3237
|
+
if (br(Fr, r)) n.real_type || (n.real_type = r);
|
|
3238
|
+
else if (br(Vr, r)) n.type || (n.type = r);
|
|
3239
|
+
else if (br(Gr, r)) switch (r) {
|
|
3214
3240
|
case "writable":
|
|
3215
3241
|
n.is_writable = !0;
|
|
3216
3242
|
break;
|
|
@@ -3222,23 +3248,23 @@
|
|
|
3222
3248
|
}
|
|
3223
3249
|
}
|
|
3224
3250
|
n.real_type || (n.real_type = "string");
|
|
3225
|
-
} else
|
|
3251
|
+
} else Cn(t) ? (n = Mr(t), n.name || (n.name = e), n.header || (n.header = e)) : Pn(t) && (n.real_type = "array", n.enum_list = t);
|
|
3226
3252
|
return n.type || (n.type = n.real_type), n;
|
|
3227
3253
|
}, e.timeTracker = function(e = "Time Tracker", t = !1) {
|
|
3228
3254
|
const n = e, r = performance.now();
|
|
3229
3255
|
let l = r;
|
|
3230
|
-
return t &&
|
|
3256
|
+
return t && bn(`--\x3e ${n} - starting`), { mark: (e = "Intermediate", o = "") => {
|
|
3231
3257
|
const s = performance.now(), i = (s - l) / 1e3, _ = (s - r) / 1e3;
|
|
3232
|
-
return t &&
|
|
3258
|
+
return t && bn(`--\x3e ${n} ${e} - partial: ${i} sec, total: ${_} sec, ${o}`), l = s, {
|
|
3233
3259
|
partial: i,
|
|
3234
3260
|
total: _
|
|
3235
3261
|
};
|
|
3236
3262
|
} };
|
|
3237
|
-
}, e.trace_json =
|
|
3238
|
-
if (
|
|
3263
|
+
}, e.trace_json = hn, e.trace_level_t = L, e.trace_msg = mn, e.treedb_decoder_fkey = Ur, e.treedb_decoder_hook = function(e, t) {
|
|
3264
|
+
if (Ln(t)) {
|
|
3239
3265
|
if (-1 === t.indexOf("^")) {
|
|
3240
3266
|
let n, r = e.hook;
|
|
3241
|
-
if (1 !==
|
|
3267
|
+
if (1 !== kn(r)) return dn("bad hook 1"), dn(e), dn(t), null;
|
|
3242
3268
|
for (let e of Object.keys(r)) {
|
|
3243
3269
|
n = e, r[e];
|
|
3244
3270
|
break;
|
|
@@ -3250,25 +3276,25 @@
|
|
|
3250
3276
|
}
|
|
3251
3277
|
{
|
|
3252
3278
|
let n = t.split("^");
|
|
3253
|
-
return 2 !== n.length ? (
|
|
3279
|
+
return 2 !== n.length ? (dn("bad hook 2"), dn(e), dn(t), null) : {
|
|
3254
3280
|
topic_name: n[0],
|
|
3255
3281
|
id: n[1]
|
|
3256
3282
|
};
|
|
3257
3283
|
}
|
|
3258
3284
|
}
|
|
3259
|
-
return
|
|
3285
|
+
return Cn(t) ? {
|
|
3260
3286
|
topic_name: t.topic_name,
|
|
3261
3287
|
id: t.id
|
|
3262
|
-
} : (
|
|
3288
|
+
} : (dn("bad hook 3"), dn(e), dn(t), null);
|
|
3263
3289
|
}, e.treedb_encoder_fkey = function(e, t) {
|
|
3264
|
-
let n =
|
|
3290
|
+
let n = Ur(e, t);
|
|
3265
3291
|
return n ? n.topic_name + "^" + n.id + "^" + n.hook_name : null;
|
|
3266
|
-
}, e.treedb_get_field_desc =
|
|
3267
|
-
if (
|
|
3292
|
+
}, e.treedb_get_field_desc = Mr, e.treedb_hook_data_size = function(e) {
|
|
3293
|
+
if (Pn(e) && 1 === In(e)) {
|
|
3268
3294
|
let t = e[0];
|
|
3269
|
-
return
|
|
3295
|
+
return Hn(t, "size") ? t.size : 1;
|
|
3270
3296
|
}
|
|
3271
|
-
return
|
|
3297
|
+
return In(e);
|
|
3272
3298
|
}, e.vsprintf = function(e, t) {
|
|
3273
3299
|
return n.apply(null, [e].concat(t || []));
|
|
3274
3300
|
}, e.walk_type_t = A;
|