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