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