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