@yuneta/gobj-js 7.26.26 → 7.26.28
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 +38 -8
- package/dist/gobj-js.cjs.js +251 -60
- package/dist/gobj-js.cjs.js.map +1 -1
- package/dist/gobj-js.cjs.min.js +802 -692
- package/dist/gobj-js.cjs.min.js.map +1 -1
- package/dist/gobj-js.es.js +251 -61
- package/dist/gobj-js.es.js.map +1 -1
- package/dist/gobj-js.es.min.js +460 -351
- package/dist/gobj-js.es.min.js.map +1 -1
- package/dist/gobj-js.iife.js +251 -60
- package/dist/gobj-js.iife.js.map +1 -1
- package/dist/gobj-js.iife.min.js +795 -685
- package/dist/gobj-js.iife.min.js.map +1 -1
- package/dist/gobj-js.umd.js +251 -60
- package/dist/gobj-js.umd.js.map +1 -1
- package/dist/gobj-js.umd.min.js +795 -685
- package/dist/gobj-js.umd.min.js.map +1 -1
- package/package.json +1 -1
package/dist/gobj-js.umd.min.js
CHANGED
|
@@ -229,7 +229,7 @@
|
|
|
229
229
|
};
|
|
230
230
|
var x = 1;
|
|
231
231
|
function K(e) {
|
|
232
|
-
|
|
232
|
+
Bo(e) && (e = JSON.stringify(e)), ar(" ".repeat(Math.max(1, 2 * h)) + String(e));
|
|
233
233
|
}
|
|
234
234
|
var B = Object.freeze({
|
|
235
235
|
TRACE_MACHINE: 65536,
|
|
@@ -323,7 +323,7 @@
|
|
|
323
323
|
B.TRACE_COMMANDS,
|
|
324
324
|
"Trace commands"
|
|
325
325
|
]
|
|
326
|
-
], J = 0,
|
|
326
|
+
], J = 0, q = 0, H = 0;
|
|
327
327
|
function z(e, t) {
|
|
328
328
|
let n = [];
|
|
329
329
|
for (const [t, r] of Y) e & r && n.push(t);
|
|
@@ -331,7 +331,7 @@
|
|
|
331
331
|
return n;
|
|
332
332
|
}
|
|
333
333
|
function Q(e, t, n) {
|
|
334
|
-
if (
|
|
334
|
+
if (Zo(e)) return void 0 === n ? 268369920 : 65535;
|
|
335
335
|
if (/^[0-9]+$/.test(String(e))) {
|
|
336
336
|
const t = Number(e);
|
|
337
337
|
if (t) return t;
|
|
@@ -345,12 +345,12 @@
|
|
|
345
345
|
}(String(e), n) || (ir(`${t}: trace level NOT FOUND: ${e}`), 0);
|
|
346
346
|
}
|
|
347
347
|
function X(e) {
|
|
348
|
-
if (
|
|
348
|
+
if (H) return 4294967295;
|
|
349
349
|
let t = J;
|
|
350
350
|
return e && (t |= e.trace_level || 0, e.gclass && (t |= e.gclass.trace_level || 0)), t;
|
|
351
351
|
}
|
|
352
352
|
function Z(e) {
|
|
353
|
-
let t =
|
|
353
|
+
let t = q;
|
|
354
354
|
return e && (t |= e.no_trace_level || 0, e.gclass && (t |= e.gclass.no_trace_level || 0)), t;
|
|
355
355
|
}
|
|
356
356
|
function ee(e) {
|
|
@@ -366,13 +366,13 @@
|
|
|
366
366
|
return X(e) & B.TRACE_EV_KW;
|
|
367
367
|
}
|
|
368
368
|
function oe(e, t) {
|
|
369
|
-
if (
|
|
369
|
+
if (H > 1) return !0;
|
|
370
370
|
if (!e) return !1;
|
|
371
371
|
const n = X(e);
|
|
372
372
|
return !!(n & B.TRACE_MACHINE || n & B.TRACE_TIMER_PERIODIC && "EV_TIMEOUT_PERIODIC" === t || n & B.TRACE_TIMER && "EV_TIMEOUT" === t);
|
|
373
373
|
}
|
|
374
374
|
function le(e, t) {
|
|
375
|
-
if (
|
|
375
|
+
if (H > 1) return !1;
|
|
376
376
|
if (!e) return !0;
|
|
377
377
|
const n = Z(e);
|
|
378
378
|
return !!(n & B.TRACE_MACHINE || n & B.TRACE_TIMER_PERIODIC && "EV_TIMEOUT_PERIODIC" === t || n & B.TRACE_TIMER && "EV_TIMEOUT" === t);
|
|
@@ -383,47 +383,47 @@
|
|
|
383
383
|
}
|
|
384
384
|
function se(e, t) {
|
|
385
385
|
const n = Q(e, "gobj_set_global_no_trace");
|
|
386
|
-
return n ? (t ?
|
|
386
|
+
return n ? (t ? q |= n : q &= ~n, 0) : -1;
|
|
387
387
|
}
|
|
388
388
|
function ae(e, t) {
|
|
389
389
|
return J = t ? (J | e) >>> 0 : (J & ~e) >>> 0, 0;
|
|
390
390
|
}
|
|
391
391
|
function ue(e, t) {
|
|
392
|
-
return
|
|
392
|
+
return q = t ? (q | e) >>> 0 : (q & ~e) >>> 0, 0;
|
|
393
393
|
}
|
|
394
394
|
function _e() {
|
|
395
395
|
return z(J, null);
|
|
396
396
|
}
|
|
397
397
|
function ce() {
|
|
398
|
-
return z(
|
|
398
|
+
return z(q, null);
|
|
399
399
|
}
|
|
400
400
|
function fe(e) {
|
|
401
|
-
const t =
|
|
401
|
+
const t = Jo(e) ? et(e) : e;
|
|
402
402
|
return t ? z(t.trace_level | J, t.s_user_trace_level) : (ir(`gobj_get_gclass_trace_level: gclass NOT FOUND: ${e}`), []);
|
|
403
403
|
}
|
|
404
404
|
function ge(e) {
|
|
405
|
-
const t =
|
|
405
|
+
const t = Jo(e) ? et(e) : e;
|
|
406
406
|
return t ? z(t.trace_level, t.s_user_trace_level) : (ir(`gobj_get_gclass_trace_level2: gclass NOT FOUND: ${e}`), []);
|
|
407
407
|
}
|
|
408
408
|
function de(e) {
|
|
409
|
-
const t =
|
|
409
|
+
const t = Jo(e) ? et(e) : e;
|
|
410
410
|
return t ? z(t.no_trace_level, t.s_user_trace_level) : (ir(`gobj_get_gclass_trace_no_level: gclass NOT FOUND: ${e}`), []);
|
|
411
411
|
}
|
|
412
412
|
function be(e, t, n) {
|
|
413
|
-
const r =
|
|
413
|
+
const r = Jo(e) ? et(e) : e;
|
|
414
414
|
if (!r) return ir(`gobj_set_gclass_trace: gclass NOT FOUND: ${e}`), -1;
|
|
415
415
|
const o = null === t ? 4294967295 : Q(t, "gobj_set_gclass_trace", r.s_user_trace_level || null);
|
|
416
416
|
return o ? (n ? r.trace_level |= o : r.trace_level &= ~o, 0) : -1;
|
|
417
417
|
}
|
|
418
418
|
function pe(e, t, n) {
|
|
419
|
-
const r =
|
|
419
|
+
const r = Jo(e) ? et(e) : e;
|
|
420
420
|
if (!r) return ir(`gobj_set_gclass_no_trace: gclass NOT FOUND: ${e}`), -1;
|
|
421
421
|
const o = null === t ? 4294967295 : Q(t, "gobj_set_gclass_no_trace", r.s_user_trace_level || null);
|
|
422
422
|
return o ? (n ? r.no_trace_level |= o : r.no_trace_level &= ~o, 0) : -1;
|
|
423
423
|
}
|
|
424
424
|
function me(e, t) {
|
|
425
425
|
let n = {};
|
|
426
|
-
if (!
|
|
426
|
+
if (!Yo(t)) return ir("sdata_desc MUST be an array"), _r(t), n;
|
|
427
427
|
for (let r = 0; r < t.length; r++) {
|
|
428
428
|
const o = t[r];
|
|
429
429
|
o.name && he(e, n, o);
|
|
@@ -437,7 +437,7 @@
|
|
|
437
437
|
r = String(o);
|
|
438
438
|
break;
|
|
439
439
|
case E.DTP_BOOLEAN:
|
|
440
|
-
r =
|
|
440
|
+
r = el(o);
|
|
441
441
|
break;
|
|
442
442
|
case E.DTP_INTEGER:
|
|
443
443
|
r = parseInt(o), isNaN(r) && ir(`${kt(e)}: attr NaN: ${n.name}`);
|
|
@@ -446,26 +446,26 @@
|
|
|
446
446
|
r = Number(o), isNaN(r) && ir(`${kt(e)}: attr NaN: ${n.name}`);
|
|
447
447
|
break;
|
|
448
448
|
case E.DTP_LIST:
|
|
449
|
-
if (
|
|
449
|
+
if (Jo(o)) try {
|
|
450
450
|
r = JSON.parse(o);
|
|
451
451
|
} catch (e) {
|
|
452
452
|
ir(`JSON parse error: ${e.message}`);
|
|
453
453
|
}
|
|
454
454
|
else r = o;
|
|
455
|
-
|
|
455
|
+
Yo(r) || (r = []);
|
|
456
456
|
break;
|
|
457
457
|
case E.DTP_DICT:
|
|
458
|
-
if (
|
|
458
|
+
if (Jo(o)) try {
|
|
459
459
|
r = JSON.parse(o);
|
|
460
460
|
} catch (e) {
|
|
461
461
|
ir(`JSON parse error: ${e.message}`);
|
|
462
462
|
}
|
|
463
463
|
else r = o;
|
|
464
|
-
|
|
464
|
+
Bo(r) || (r = {});
|
|
465
465
|
break;
|
|
466
466
|
case E.DTP_JSON:
|
|
467
467
|
if ("" === o || void 0 === o) r = null;
|
|
468
|
-
else if (
|
|
468
|
+
else if (Jo(o)) try {
|
|
469
469
|
r = JSON.parse(o);
|
|
470
470
|
} catch (e) {
|
|
471
471
|
ir(`JSON parse error: ${e.message}`);
|
|
@@ -554,16 +554,16 @@
|
|
|
554
554
|
}(e)) return t;
|
|
555
555
|
}
|
|
556
556
|
function $e(e, t) {
|
|
557
|
-
return T(e) ?
|
|
557
|
+
return T(e) ? Jo(t) : w(e) ? Bo(t) : S(e) ? Yo(t) : !$(e) || "number" == typeof t || "boolean" == typeof t;
|
|
558
558
|
}
|
|
559
559
|
function Ae(e) {
|
|
560
560
|
return e >= -0x8000000000000000 && e < 0x8000000000000000;
|
|
561
561
|
}
|
|
562
562
|
function Re(e) {
|
|
563
|
-
return
|
|
563
|
+
return Yo(e) ? "an array" : Bo(e) ? "an object" : Jo(e) ? je : "number" == typeof e ? Number.isInteger(e) && Ae(e) ? "an integer" : "a real" : "boolean" == typeof e ? "a boolean" : "null";
|
|
564
564
|
}
|
|
565
565
|
function De(e, t, n) {
|
|
566
|
-
if (
|
|
566
|
+
if (Jo(t) || (t = ""), T(e)) return {
|
|
567
567
|
value: t,
|
|
568
568
|
refused: null
|
|
569
569
|
};
|
|
@@ -658,9 +658,9 @@
|
|
|
658
658
|
value: void 0,
|
|
659
659
|
refused: null
|
|
660
660
|
};
|
|
661
|
-
const n =
|
|
661
|
+
const n = Jo(t) && t.indexOf("\0") >= 0;
|
|
662
662
|
if (N(e)) {
|
|
663
|
-
if (!
|
|
663
|
+
if (!Jo(t) || n) return {
|
|
664
664
|
value: t,
|
|
665
665
|
refused: null
|
|
666
666
|
};
|
|
@@ -673,7 +673,7 @@
|
|
|
673
673
|
return T(e) || w(e) || S(e) || $(e) ? n ? {
|
|
674
674
|
value: void 0,
|
|
675
675
|
refused: "a text with a NUL in it"
|
|
676
|
-
} :
|
|
676
|
+
} : Jo(t) && !T(e) ? De(e, t, !0) : $e(e, t) ? $(e) ? function(e, t) {
|
|
677
677
|
return "number" != typeof t || Number.isFinite(t) ? j(e) ? {
|
|
678
678
|
value: "boolean" == typeof t ? t : 0 !== t,
|
|
679
679
|
refused: null
|
|
@@ -777,7 +777,7 @@
|
|
|
777
777
|
function Fe(e) {
|
|
778
778
|
if (Le(e)) try {
|
|
779
779
|
const t = JSON.stringify(e);
|
|
780
|
-
return
|
|
780
|
+
return Jo(t) ? t : void 0;
|
|
781
781
|
} catch (e) {
|
|
782
782
|
return;
|
|
783
783
|
}
|
|
@@ -794,7 +794,7 @@
|
|
|
794
794
|
let l;
|
|
795
795
|
if (t.flag & A.SDF_SECRET) l = "********";
|
|
796
796
|
else {
|
|
797
|
-
l =
|
|
797
|
+
l = Jo(n) ? n : Fe(void 0 === n ? null : n), void 0 === l && (l = `<${Ue}>`);
|
|
798
798
|
const e = To(l);
|
|
799
799
|
if (null !== e && (l = e), l.length > 64) {
|
|
800
800
|
let e = 64;
|
|
@@ -809,7 +809,7 @@
|
|
|
809
809
|
switch (n.type) {
|
|
810
810
|
case E.DTP_STRING:
|
|
811
811
|
if (null == r) o = "";
|
|
812
|
-
else if (
|
|
812
|
+
else if (Jo(r)) o = String(r);
|
|
813
813
|
else if (o = Fe(r), void 0 === o) return Me(e, n, r, Ue), -1;
|
|
814
814
|
break;
|
|
815
815
|
case E.DTP_BOOLEAN:
|
|
@@ -825,7 +825,7 @@
|
|
|
825
825
|
}
|
|
826
826
|
break;
|
|
827
827
|
case E.DTP_JSON:
|
|
828
|
-
if (o = r,
|
|
828
|
+
if (o = r, Jo(r)) {
|
|
829
829
|
const e = r.trim();
|
|
830
830
|
if (e.startsWith("{") || e.startsWith("[")) try {
|
|
831
831
|
o = JSON.parse(e);
|
|
@@ -836,7 +836,7 @@
|
|
|
836
836
|
break;
|
|
837
837
|
case E.DTP_POINTER: o = r;
|
|
838
838
|
}
|
|
839
|
-
return void 0 === o && ir(`${kt(e)}: attr undefined: ${n.name}`), t[n.name] = o,
|
|
839
|
+
return void 0 === o && ir(`${kt(e)}: attr undefined: ${n.name}`), t[n.name] = o, Bo(e.priv) && Object.prototype.hasOwnProperty.call(e.priv, n.name) && (e.priv[n.name] = o), e.obflag & U.obflag_created && !(e.obflag & U.obflag_destroyed) && e.gclass.gmt.mt_writing && e.gclass.gmt.mt_writing(e, n.name), 0;
|
|
840
840
|
}
|
|
841
841
|
function Ve(e) {
|
|
842
842
|
return e.jn_attrs;
|
|
@@ -854,7 +854,7 @@
|
|
|
854
854
|
return n && ir(`${e.gclass_name}: GClass Attribute NOT FOUND: ${t}`), null;
|
|
855
855
|
}
|
|
856
856
|
function Ke(e, t, n, r, o, l, i, s, a, u, _) {
|
|
857
|
-
if (
|
|
857
|
+
if (Zo(e)) return ir("gclass_name EMPTY"), null;
|
|
858
858
|
if (e.includes("`") || e.includes("^") || e.includes(".")) return ir(`GClass name CANNOT have '.' or '^' or '\`' char: ${e}`), null;
|
|
859
859
|
if (et(e)) return ir(`GClass ALREADY exists: ${e}`), null;
|
|
860
860
|
let c = new C(e, r, o, l, i, s, a, u, _);
|
|
@@ -864,17 +864,17 @@
|
|
|
864
864
|
const f = n.length;
|
|
865
865
|
for (let e = 0; e < f; e++) {
|
|
866
866
|
let t = n[e][0], r = n[e][1];
|
|
867
|
-
if (
|
|
868
|
-
if (
|
|
867
|
+
if (Zo(t)) continue;
|
|
868
|
+
if (qe(c, t) < 0) return Be(c), null;
|
|
869
869
|
const o = r.length;
|
|
870
870
|
for (let e = 0; e < o; e++) {
|
|
871
871
|
let n = r[e][0], o = r[e][1], l = r[e][2];
|
|
872
|
-
|
|
872
|
+
Zo(n) || He(c, t, n, o, l);
|
|
873
873
|
}
|
|
874
874
|
}
|
|
875
875
|
for (let e = 0; e < t.length; e++) {
|
|
876
876
|
let n = t[e][0], r = t[e][1];
|
|
877
|
-
if (!
|
|
877
|
+
if (!Zo(n)) {
|
|
878
878
|
if (Xe(c, n)) return ir(`SMachine: event repeated in input_events: ${n}`), Be(c), null;
|
|
879
879
|
Qe(c, n, r);
|
|
880
880
|
}
|
|
@@ -887,7 +887,7 @@
|
|
|
887
887
|
}
|
|
888
888
|
function Be(e) {
|
|
889
889
|
let t;
|
|
890
|
-
if (
|
|
890
|
+
if (Jo(e)) t = e;
|
|
891
891
|
else {
|
|
892
892
|
if (!(e instanceof C)) return ir("Cannot unregister gclass, type unknown"), -1;
|
|
893
893
|
t = e.gclass_name;
|
|
@@ -911,17 +911,17 @@
|
|
|
911
911
|
}
|
|
912
912
|
return null;
|
|
913
913
|
}
|
|
914
|
-
function
|
|
914
|
+
function qe(e, t) {
|
|
915
915
|
return e instanceof C ? Ye(e, t) ? (ir(`state already exists: ${t}`), -1) : (e.dl_states.push(new V(t)), 0) : (ir("Cannot add state, typeof not GClass"), -1);
|
|
916
916
|
}
|
|
917
|
-
function
|
|
917
|
+
function He(e, t, n, r, o) {
|
|
918
918
|
if (!(e instanceof C)) return ir("Cannot add state, typeof not GClass"), -1;
|
|
919
|
-
if (
|
|
919
|
+
if (Zo(t)) return ir("state_name EMPTY"), -1;
|
|
920
920
|
let l = Ye(e, t);
|
|
921
921
|
return l ? Je(l, n) ? (ir(`event already exists: gclass ${e.gclass_name}, state ${t}, event ${n}`), -1) : (l.dl_actions.push(new G(n, r, o)), 0) : (ir(`state not found: ${t}`), -1);
|
|
922
922
|
}
|
|
923
923
|
function ze(e, t, n) {
|
|
924
|
-
|
|
924
|
+
Zo(t) || e.push(new W(t, n));
|
|
925
925
|
}
|
|
926
926
|
function Qe(e, t, n) {
|
|
927
927
|
return e instanceof C ? ze(e.dl_events, t, n) : (ir("Cannot add state, typeof not GClass"), -1);
|
|
@@ -941,18 +941,18 @@
|
|
|
941
941
|
Wo(e.dl_states) || (ir(`GClass without states: ${e.gclass_name}`), t += -1);
|
|
942
942
|
for (let n = 0; n < e.dl_states.length; n++) {
|
|
943
943
|
let r = e.dl_states[n];
|
|
944
|
-
if (!
|
|
944
|
+
if (!Zo(r.state_name)) for (let n = 0; n < r.dl_actions.length; n++) {
|
|
945
945
|
let o = r.dl_actions[n];
|
|
946
|
-
|
|
946
|
+
Zo(o.event_name) || (Xe(e, o.event_name) || (ir(`SMachine: state's event NOT in input_events: gclass ${e.gclass_name}, state ${r.state_name}, event ${o.event_name}`), t += -1), o.next_state && (Ye(e, o.next_state) || (ir(`SMachine: next state NOT in state names: gclass ${e.gclass_name}, state ${r.state_name}, next_state ${o.next_state}`), t += -1)));
|
|
947
947
|
}
|
|
948
948
|
}
|
|
949
949
|
for (let n = 0; n < e.dl_events.length; n++) {
|
|
950
950
|
let r = e.dl_events[n];
|
|
951
|
-
if (!
|
|
951
|
+
if (!Zo(r.event_name) && (qo(r.event_flag) || (ir(`SMachine: event flag is NOT number: gclass ${e.gclass_name}, event ${r.event_name}`), t += -1), !(r.event_flag & F.EVF_OUTPUT_EVENT))) {
|
|
952
952
|
let n = !1;
|
|
953
953
|
for (let t = 0; t < e.dl_states.length; t++) {
|
|
954
954
|
let o = e.dl_states[t];
|
|
955
|
-
|
|
955
|
+
Zo(o.state_name) || Je(o, r.event_name) && (n = !0);
|
|
956
956
|
}
|
|
957
957
|
n || (ir(`SMachine: input_list's event NOT in state: gclass ${e.gclass_name}, event ${r.event_name}`), t += -1);
|
|
958
958
|
}
|
|
@@ -970,7 +970,7 @@
|
|
|
970
970
|
return !m || m.obflag & U.obflag_destroyed ? null : m;
|
|
971
971
|
}
|
|
972
972
|
function nt(e, t) {
|
|
973
|
-
if (!
|
|
973
|
+
if (!Jo(e)) return ir(`gobj_find_service(): service name must be a string: ${e}`), null;
|
|
974
974
|
e = e.toLowerCase();
|
|
975
975
|
return b[e] || (t && ir(`gobj service not found: ${e}`), null);
|
|
976
976
|
}
|
|
@@ -982,7 +982,7 @@
|
|
|
982
982
|
t.parent && ir(`_add_child() ALREADY HAS PARENT: ${t.gobj_name}`), e.dl_children.push(t), t.parent = e;
|
|
983
983
|
}
|
|
984
984
|
function lt(e, t) {
|
|
985
|
-
let n =
|
|
985
|
+
let n = zl(e.dl_children, t);
|
|
986
986
|
n >= 0 && (Go(e.dl_children, n), t.parent = null);
|
|
987
987
|
}
|
|
988
988
|
function it(e, t) {
|
|
@@ -1010,7 +1010,7 @@
|
|
|
1010
1010
|
} else {
|
|
1011
1011
|
if (!o) return ir("gobj NEEDS a parent!"), null;
|
|
1012
1012
|
if (!("string" == typeof o || o instanceof I)) return ir(`BAD TYPE of parent: ${o}`), null;
|
|
1013
|
-
if (
|
|
1013
|
+
if (Jo(o)) {
|
|
1014
1014
|
const e = o;
|
|
1015
1015
|
if (!(o = nt(e))) return sr(`parent service not found: ${e}`), null;
|
|
1016
1016
|
}
|
|
@@ -1020,11 +1020,11 @@
|
|
|
1020
1020
|
if (m) return ir(`default service ALREADY registered: ${t}^${e}`), null;
|
|
1021
1021
|
l |= L.gobj_flag_service;
|
|
1022
1022
|
}
|
|
1023
|
-
if (
|
|
1023
|
+
if (Zo(t)) return ir("gclass_name must be a string"), null;
|
|
1024
1024
|
let i = et(t, !1);
|
|
1025
1025
|
if (!i) return ir(`GClass not registered: ${t}^${e}`), null;
|
|
1026
|
-
if (!
|
|
1027
|
-
if (!
|
|
1026
|
+
if (!Jo(e)) return ir(`gobj_name must be a string: ${t}`), null;
|
|
1027
|
+
if (!Zo(e)) {
|
|
1028
1028
|
if (e.includes("`")) return ir(`gobj_name cannot contain char ': ${t}^${e}`), null;
|
|
1029
1029
|
if (e.includes("^")) return ir(`gobj_name cannot contain char ^: ${t}^${e}`), null;
|
|
1030
1030
|
}
|
|
@@ -1080,17 +1080,38 @@
|
|
|
1080
1080
|
if (Ut(e)) return ir("gobj NULL or DESTROYED"), -1;
|
|
1081
1081
|
if (e.running) return ir(`${kt(e)}: GObj ALREADY RUNNING`), -1;
|
|
1082
1082
|
if (e.disabled) return ir(`${kt(e)}: GObj DISABLED`), -1;
|
|
1083
|
+
const t = function(e) {
|
|
1084
|
+
const t = Ve(e), n = [];
|
|
1085
|
+
if (!Yo(e.gclass.attrs_table)) return null;
|
|
1086
|
+
for (const r of e.gclass.attrs_table) {
|
|
1087
|
+
if (!(r.name && r.flag & A.SDF_REQUIRED)) continue;
|
|
1088
|
+
const e = t[r.name];
|
|
1089
|
+
switch (r.type) {
|
|
1090
|
+
case E.DTP_STRING:
|
|
1091
|
+
Jo(e) && !Zo(e) || n.push(r.name);
|
|
1092
|
+
break;
|
|
1093
|
+
case E.DTP_LIST:
|
|
1094
|
+
case E.DTP_DICT:
|
|
1095
|
+
case E.DTP_JSON:
|
|
1096
|
+
Ko(e) && n.push(r.name);
|
|
1097
|
+
break;
|
|
1098
|
+
case E.DTP_POINTER: e || n.push(r.name);
|
|
1099
|
+
}
|
|
1100
|
+
}
|
|
1101
|
+
return n.length ? n : null;
|
|
1102
|
+
}(e);
|
|
1103
|
+
if (t) return ir(`${kt(e)}: Cannot start without all required attributes: ` + JSON.stringify(t)), -1;
|
|
1083
1104
|
ne(e) && K(n("⏺ ⏺ start: %s", Ct(e))), e.running = !0;
|
|
1084
|
-
let
|
|
1105
|
+
let r = 0;
|
|
1085
1106
|
if (e.gclass.gmt.mt_start) {
|
|
1086
|
-
const
|
|
1107
|
+
const t = vn(e, "mt_start", y.FRAME_METHOD);
|
|
1087
1108
|
try {
|
|
1088
|
-
|
|
1109
|
+
r = e.gclass.gmt.mt_start(e);
|
|
1089
1110
|
} finally {
|
|
1090
|
-
En(
|
|
1111
|
+
En(t);
|
|
1091
1112
|
}
|
|
1092
1113
|
}
|
|
1093
|
-
return
|
|
1114
|
+
return r;
|
|
1094
1115
|
}
|
|
1095
1116
|
function gt(e) {
|
|
1096
1117
|
const t = vn(e, "gobj_start", y.FRAME_WATCH);
|
|
@@ -1199,88 +1220,102 @@
|
|
|
1199
1220
|
return e ? tn(e, "yuno_id") : "";
|
|
1200
1221
|
}
|
|
1201
1222
|
function Rt(e) {
|
|
1202
|
-
return
|
|
1223
|
+
return Xo(e) ? e.gobj_name : (ir("gobj bad type"), null);
|
|
1203
1224
|
}
|
|
1204
1225
|
function Dt(e) {
|
|
1205
|
-
return
|
|
1226
|
+
return Xo(e) ? e.gclass.gclass_name : (ir("gobj NULL of bad type"), null);
|
|
1206
1227
|
}
|
|
1207
1228
|
function kt(e) {
|
|
1208
|
-
return
|
|
1229
|
+
return Xo(e) ? e.gclass.gclass_name + "^" + Rt(e) : (ir("gobj bad type"), null);
|
|
1209
1230
|
}
|
|
1210
1231
|
function Ct(e) {
|
|
1211
|
-
if (!
|
|
1232
|
+
if (!Xo(e)) return ir("gobj NULL of bad type"), null;
|
|
1212
1233
|
let t = kt(e), n = It(e);
|
|
1213
1234
|
for (; n;) t = kt(n) + "`" + t, n = It(n);
|
|
1214
1235
|
return t;
|
|
1215
1236
|
}
|
|
1216
1237
|
function It(e) {
|
|
1217
|
-
return
|
|
1238
|
+
return Xo(e) ? e.parent : (ir("gobj NULL of bad type"), null);
|
|
1218
1239
|
}
|
|
1219
1240
|
function Pt(e) {
|
|
1220
|
-
return
|
|
1241
|
+
return Xo(e) ? !!(e.gobj_flag & L.gobj_flag_volatil) : (ir("gobj NULL of bad type"), null);
|
|
1221
1242
|
}
|
|
1222
1243
|
function Lt(e) {
|
|
1223
|
-
return
|
|
1244
|
+
return Xo(e) ? !!(e.gobj_flag & L.gobj_flag_pure_child) : (ir("gobj NULL of bad type"), null);
|
|
1224
1245
|
}
|
|
1225
1246
|
function Ut(e) {
|
|
1226
|
-
return !
|
|
1247
|
+
return !Xo(e) || !!(e.obflag & (U.obflag_destroyed | U.obflag_destroying));
|
|
1227
1248
|
}
|
|
1228
1249
|
function Ft(e) {
|
|
1229
|
-
return
|
|
1250
|
+
return Xo(e) ? e.bottom_gobj : (ir("gobj NULL of bad type"), null);
|
|
1230
1251
|
}
|
|
1231
1252
|
function Mt(e, t) {
|
|
1232
|
-
if (!
|
|
1253
|
+
if (!Xo(e)) return ir("gobj NULL of bad type"), null;
|
|
1233
1254
|
e.bottom_gobj && t && sr(`${kt(e)}: bottom_gobj already set`), e.bottom_gobj = t;
|
|
1234
1255
|
}
|
|
1235
1256
|
function Gt(e, t, n) {
|
|
1236
|
-
return
|
|
1257
|
+
return Xo(e) ? t ? xe(e.gclass, t, n) : e.gclass.attrs_table : (ir("gobj NULL of bad type"), null);
|
|
1237
1258
|
}
|
|
1238
1259
|
function Vt(e, t, n, r, o) {
|
|
1239
|
-
return Ut(e) ? (ir("gobj NULL, destroying, or bad type"), 0) :
|
|
1260
|
+
return Ut(e) ? (ir("gobj NULL, destroying, or bad type"), 0) : function(e, t, n, r, o, l) {
|
|
1261
|
+
let i, s = [...e.dl_children];
|
|
1262
|
+
if (n & M.WALK_LAST2FIRST) for (let n = s.length; n > 0; n--) {
|
|
1263
|
+
if (i = s[n - 1], Kt(i, e, t)) continue;
|
|
1264
|
+
t.add(i);
|
|
1265
|
+
let a = xt(r(i, o, l));
|
|
1266
|
+
if (a < 0) return a;
|
|
1267
|
+
}
|
|
1268
|
+
else for (let n = 0; n < s.length; n++) {
|
|
1269
|
+
if (i = s[n], Kt(i, e, t)) continue;
|
|
1270
|
+
t.add(i);
|
|
1271
|
+
let a = xt(r(i, o, l));
|
|
1272
|
+
if (a < 0) return a;
|
|
1273
|
+
}
|
|
1274
|
+
return 0;
|
|
1275
|
+
}(e, /* @__PURE__ */ new Set(), t, n, r, o);
|
|
1240
1276
|
}
|
|
1241
1277
|
function Wt(e, t, n, r, o) {
|
|
1242
|
-
return Ut(e) ? (ir("gobj NULL, destroying, or bad type"), 0) : Yt(e
|
|
1278
|
+
return Ut(e) ? (ir("gobj NULL, destroying, or bad type"), 0) : Yt(e, /* @__PURE__ */ new Set(), t, n, r, o);
|
|
1243
1279
|
}
|
|
1244
1280
|
function xt(e) {
|
|
1245
1281
|
return "number" == typeof e && isFinite(e) ? e : (null == e || ir(`walk callback must return a NUMBER (-1 stop, 0 descend, >0 skip children), got ${typeof e}: taken as 0`), 0);
|
|
1246
1282
|
}
|
|
1247
|
-
function Kt(e, t, n
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1283
|
+
function Kt(e, t, n) {
|
|
1284
|
+
return Ut(e) || e.parent !== t || n.has(e);
|
|
1285
|
+
}
|
|
1286
|
+
function Bt(e, t, n, r, o, l) {
|
|
1287
|
+
let i = [...e.dl_children];
|
|
1288
|
+
n & M.WALK_LAST2FIRST && i.reverse();
|
|
1289
|
+
let s = [];
|
|
1290
|
+
for (const n of i) {
|
|
1291
|
+
if (Kt(n, e, t)) continue;
|
|
1292
|
+
t.add(n), s.push(n);
|
|
1293
|
+
let i = xt(r(n, o, l));
|
|
1294
|
+
if (i < 0) return i;
|
|
1253
1295
|
}
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
let
|
|
1257
|
-
if (
|
|
1296
|
+
for (const e of s) {
|
|
1297
|
+
if (Ut(e)) continue;
|
|
1298
|
+
let i = Bt(e, t, n, r, o, l);
|
|
1299
|
+
if (i < 0) return i;
|
|
1258
1300
|
}
|
|
1259
1301
|
return 0;
|
|
1260
1302
|
}
|
|
1261
|
-
function
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
if (
|
|
1265
|
-
for (let
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
if (t & M.WALK_BOTTOM2TOP) for (let s = e.length; s > 0; s--) {
|
|
1273
|
-
if (i = e[s - 1], l = Yt([...i.dl_children], t, n, r, o), l < 0) return l;
|
|
1274
|
-
if (l = xt(n(i, r, o)), l < 0) return l;
|
|
1275
|
-
}
|
|
1276
|
-
else for (let s = 0; s < e.length; s++) {
|
|
1277
|
-
if (i = e[s], l = xt(n(i, r, o)), l < 0) return l;
|
|
1278
|
-
if (0 === l && (l = Yt([...i.dl_children], t, n, r, o), l < 0)) return l;
|
|
1303
|
+
function Yt(e, t, n, r, o, l) {
|
|
1304
|
+
if (n & M.WALK_BYLEVEL) return Bt(e, t, n, r, o, l);
|
|
1305
|
+
let i, s, a = [...e.dl_children];
|
|
1306
|
+
if (n & M.WALK_BOTTOM2TOP) {
|
|
1307
|
+
for (let u = a.length; u > 0; u--) if (s = a[u - 1], !Kt(s, e, t)) {
|
|
1308
|
+
if (i = Yt(s, t, n, r, o, l), i < 0) return i;
|
|
1309
|
+
if (!Ut(s) && (t.add(s), i = xt(r(s, o, l)), i < 0)) return i;
|
|
1310
|
+
}
|
|
1311
|
+
} else for (let u = 0; u < a.length; u++) if (s = a[u], !Kt(s, e, t)) {
|
|
1312
|
+
if (t.add(s), i = xt(r(s, o, l)), i < 0) return i;
|
|
1313
|
+
if (0 === i && !Ut(s) && (i = Yt(s, t, n, r, o, l), i < 0)) return i;
|
|
1279
1314
|
}
|
|
1280
1315
|
return 0;
|
|
1281
1316
|
}
|
|
1282
1317
|
function Jt(e, t) {
|
|
1283
|
-
if (!
|
|
1318
|
+
if (!Xo(e)) return ir("gobj NULL of bad type"), !1;
|
|
1284
1319
|
let n = t.__gclass_name__, r = t.__gobj_name__, o = t.__prefix_gobj_name__;
|
|
1285
1320
|
t.__disabled__;
|
|
1286
1321
|
let l = t.__state__;
|
|
@@ -1295,7 +1330,7 @@
|
|
|
1295
1330
|
for (const n of Object.keys(t)) if ("__gclass_name__" !== n && "__gobj_name__" !== n && "__prefix_gobj_name__" !== n && "__disabled__" !== n && "__state__" !== n && zt(e, n) && i[n] !== t[n]) return !1;
|
|
1296
1331
|
return !0;
|
|
1297
1332
|
}
|
|
1298
|
-
function
|
|
1333
|
+
function qt(e, t) {
|
|
1299
1334
|
if (Ut(e)) return ir("gobj NULL or DESTROYED"), null;
|
|
1300
1335
|
const n = e.dl_children;
|
|
1301
1336
|
for (let e = 0; e < n.length; e++) {
|
|
@@ -1304,7 +1339,7 @@
|
|
|
1304
1339
|
}
|
|
1305
1340
|
return null;
|
|
1306
1341
|
}
|
|
1307
|
-
function
|
|
1342
|
+
function Ht(e, t) {
|
|
1308
1343
|
if (!t) return null;
|
|
1309
1344
|
let n = t.split("`");
|
|
1310
1345
|
if (!function(e, t) {
|
|
@@ -1320,11 +1355,11 @@
|
|
|
1320
1355
|
if (1 === n.length) return e;
|
|
1321
1356
|
let r = n[1].split("^"), o = {};
|
|
1322
1357
|
1 === r.length ? o.__gobj_name__ = r : (o.__gclass_name__ = r[0], o.__gobj_name__ = r[1]);
|
|
1323
|
-
let l =
|
|
1324
|
-
return l ? (n.splice(0, 1), n = n.join("`"),
|
|
1358
|
+
let l = qt(e, o);
|
|
1359
|
+
return l ? (n.splice(0, 1), n = n.join("`"), Ht(l, n)) : null;
|
|
1325
1360
|
}
|
|
1326
1361
|
function zt(e, t) {
|
|
1327
|
-
return !
|
|
1362
|
+
return !Zo(t) && !!xe(e.gclass, t, !1);
|
|
1328
1363
|
}
|
|
1329
1364
|
function Qt(e, t, n) {
|
|
1330
1365
|
let r = e.jn_attrs;
|
|
@@ -1347,21 +1382,21 @@
|
|
|
1347
1382
|
}
|
|
1348
1383
|
function Zt(e, t) {
|
|
1349
1384
|
if (t) {
|
|
1350
|
-
if (0 ===
|
|
1351
|
-
if (0 ===
|
|
1352
|
-
if (0 ===
|
|
1353
|
-
if (0 ===
|
|
1385
|
+
if (0 === nl(t, "__disabled__")) return jt(e);
|
|
1386
|
+
if (0 === nl(t, "__running__")) return Tt(e);
|
|
1387
|
+
if (0 === nl(t, "__playing__")) return St(e);
|
|
1388
|
+
if (0 === nl(t, "__service__")) return Ot(e);
|
|
1354
1389
|
}
|
|
1355
1390
|
let n = We(e, t, !1);
|
|
1356
1391
|
return n ? !e.gclass.gmt.mt_reading || e.obflag & U.obflag_destroyed ? Io(n, t) : e.gclass.gmt.mt_reading(e, t) : (ir(`${kt(e)}: GClass Attribute NOT FOUND, attr ${t}`), 0);
|
|
1357
1392
|
}
|
|
1358
1393
|
function en(e, t) {
|
|
1359
|
-
t &&
|
|
1394
|
+
t && nl(t, "__trace_level__");
|
|
1360
1395
|
let n = We(e, t, !1);
|
|
1361
1396
|
return n ? !e.gclass.gmt.mt_reading || e.obflag & U.obflag_destroyed ? Io(n, t) : e.gclass.gmt.mt_reading(e, t) : (ir(`${kt(e)}: GClass Attribute NOT FOUND, attr ${t}`), 0);
|
|
1362
1397
|
}
|
|
1363
1398
|
function tn(e, t) {
|
|
1364
|
-
if (t && 0 ===
|
|
1399
|
+
if (t && 0 === nl(t, "__state__")) return fn(e);
|
|
1365
1400
|
let n = We(e, t, !1);
|
|
1366
1401
|
return n ? !e.gclass.gmt.mt_reading || e.obflag & U.obflag_destroyed ? Io(n, t) : e.gclass.gmt.mt_reading(e, t) : (ir(`${kt(e)}: GClass Attribute NOT FOUND, attr ${t}`), 0);
|
|
1367
1402
|
}
|
|
@@ -1370,7 +1405,7 @@
|
|
|
1370
1405
|
return n ? !e.gclass.gmt.mt_reading || e.obflag & U.obflag_destroyed ? Io(n, t) : e.gclass.gmt.mt_reading(e, t) : (ir(`${kt(e)}: GClass Attribute NOT FOUND, attr ${t}`), 0);
|
|
1371
1406
|
}
|
|
1372
1407
|
function rn(e, t, r, o) {
|
|
1373
|
-
if (!
|
|
1408
|
+
if (!Jo(t)) return ir(n("gobj_write_attr(%s): path must be a string", kt(e))), -1;
|
|
1374
1409
|
let l, i = e.jn_attrs, s = t.split("`");
|
|
1375
1410
|
if (s.length <= 1) {
|
|
1376
1411
|
let o = t;
|
|
@@ -1379,7 +1414,7 @@
|
|
|
1379
1414
|
let a = s.length;
|
|
1380
1415
|
for (let t = 0; t < a; t++) {
|
|
1381
1416
|
l = s[t];
|
|
1382
|
-
let n =
|
|
1417
|
+
let n = qt(e, { __gobj_name__: l });
|
|
1383
1418
|
if (n && t < a - 1) {
|
|
1384
1419
|
e = n;
|
|
1385
1420
|
continue;
|
|
@@ -1398,7 +1433,7 @@
|
|
|
1398
1433
|
let o;
|
|
1399
1434
|
if (T(n)) {
|
|
1400
1435
|
if (null == r) return { value: "" };
|
|
1401
|
-
if (
|
|
1436
|
+
if (Jo(r)) return { value: r };
|
|
1402
1437
|
o = {
|
|
1403
1438
|
value: Fe(r),
|
|
1404
1439
|
refused: Ue
|
|
@@ -1428,7 +1463,7 @@
|
|
|
1428
1463
|
let r = We(e, t, !1);
|
|
1429
1464
|
if (r) {
|
|
1430
1465
|
const o = ln(e, t, E.DTP_BOOLEAN, n);
|
|
1431
|
-
return o.refused ? -1 : (r[t] = o.value,
|
|
1466
|
+
return o.refused ? -1 : (r[t] = o.value, Bo(e.priv) && Object.prototype.hasOwnProperty.call(e.priv, t) && (e.priv[t] = r[t]), e.obflag & U.obflag_created && !(e.obflag & U.obflag_destroyed) && e.gclass.gmt.mt_writing && e.gclass.gmt.mt_writing(e, t), 0);
|
|
1432
1467
|
}
|
|
1433
1468
|
return ir(`${kt(e)}: GClass Attribute NOT FOUND, attr ${t}`), -1;
|
|
1434
1469
|
}
|
|
@@ -1436,7 +1471,7 @@
|
|
|
1436
1471
|
let r = We(e, t, !1);
|
|
1437
1472
|
if (r) {
|
|
1438
1473
|
const o = ln(e, t, E.DTP_INTEGER, n);
|
|
1439
|
-
return o.refused ? -1 : (r[t] = o.value,
|
|
1474
|
+
return o.refused ? -1 : (r[t] = o.value, Bo(e.priv) && Object.prototype.hasOwnProperty.call(e.priv, t) && (e.priv[t] = r[t]), e.obflag & U.obflag_created && !(e.obflag & U.obflag_destroyed) && e.gclass.gmt.mt_writing && e.gclass.gmt.mt_writing(e, t), 0);
|
|
1440
1475
|
}
|
|
1441
1476
|
return ir(`${kt(e)}: GClass Attribute NOT FOUND, attr ${t}`), -1;
|
|
1442
1477
|
}
|
|
@@ -1444,7 +1479,7 @@
|
|
|
1444
1479
|
let r = We(e, t, !1);
|
|
1445
1480
|
if (r) {
|
|
1446
1481
|
const o = ln(e, t, E.DTP_STRING, n);
|
|
1447
|
-
return o.refused ? -1 : (r[t] = o.value,
|
|
1482
|
+
return o.refused ? -1 : (r[t] = o.value, Bo(e.priv) && Object.prototype.hasOwnProperty.call(e.priv, t) && (e.priv[t] = r[t]), e.obflag & U.obflag_created && !(e.obflag & U.obflag_destroyed) && e.gclass.gmt.mt_writing && e.gclass.gmt.mt_writing(e, t), 0);
|
|
1448
1483
|
}
|
|
1449
1484
|
return ir(`${kt(e)}: GClass Attribute NOT FOUND, attr ${t}`), -1;
|
|
1450
1485
|
}
|
|
@@ -1460,10 +1495,10 @@
|
|
|
1460
1495
|
return (o || l) && (1 === x || K(n("🔀🔀 mach(%s%s^%s), new st(%s), prev st(%s)", e.running ? "" : "!!", Dt(e), Rt(e), fn(e), e.last_state.state_name))), !0;
|
|
1461
1496
|
}
|
|
1462
1497
|
function fn(e) {
|
|
1463
|
-
return
|
|
1498
|
+
return Xo(e) ? e.current_state.state_name : (ir("hgobj NULL"), "");
|
|
1464
1499
|
}
|
|
1465
1500
|
function gn(e, t, n) {
|
|
1466
|
-
if (!
|
|
1501
|
+
if (!Xo(e)) return ir("gobj NULL of bad type"), null;
|
|
1467
1502
|
let r = Xe(e.gclass, t);
|
|
1468
1503
|
if (r) return r;
|
|
1469
1504
|
if (n) {
|
|
@@ -1485,7 +1520,7 @@
|
|
|
1485
1520
|
}
|
|
1486
1521
|
var pn = [], mn = !1;
|
|
1487
1522
|
function hn(e, t, r, o) {
|
|
1488
|
-
return e && e instanceof I ? e.obflag & (U.obflag_destroyed | U.obflag_destroying) ? (ir(`gobj_post_event(): gobj dst DESTROYING, event ${t}`), -1) :
|
|
1523
|
+
return e && e instanceof I ? e.obflag & (U.obflag_destroyed | U.obflag_destroying) ? (ir(`gobj_post_event(): gobj dst DESTROYING, event ${t}`), -1) : Zo(t) ? (ir("gobj_post_event(): event EMPTY"), -1) : dn(e, t, 0) ? pn.length >= 1e4 ? (ir(`gobj_post_event(): too many posted events, this is NOT a work queue, event ${t}, pending ${pn.length}`), -1) : (pn.push({
|
|
1489
1524
|
dst: e,
|
|
1490
1525
|
event: t,
|
|
1491
1526
|
kw: r,
|
|
@@ -1551,7 +1586,7 @@
|
|
|
1551
1586
|
if (1 === x) K(n("🔄 %s %s%s %s from %s%s", t || "", e.running ? "" : "!!", kt(e), l.state_name, o && !o.running ? "!!" : "", kt(o)));
|
|
1552
1587
|
else {
|
|
1553
1588
|
let r = "";
|
|
1554
|
-
s.action && (r =
|
|
1589
|
+
s.action && (r = ei(s.action)), K(n("🔄 mach(%s%s^%s), st: %s, ev: %s%s%s, ac: %s, from(%s%s^%s)", e.running ? "" : "!!", Dt(e), Rt(e), l.state_name, "", t || "", "", r, o && !o.running ? "!!" : "", Dt(o), Rt(o)));
|
|
1555
1590
|
}
|
|
1556
1591
|
r && re(e) && Vo(r) && $o(r);
|
|
1557
1592
|
}
|
|
@@ -1570,7 +1605,7 @@
|
|
|
1570
1605
|
} finally {
|
|
1571
1606
|
En(a);
|
|
1572
1607
|
}
|
|
1573
|
-
return i && 1 !== x && !a.destroyed && K(n("<- mach(%s%s^%s), st: %s, ev: %s, ret: %d", e.running ? "" : "!!", Dt(e), Rt(e), e.current_state.state_name, t || "",
|
|
1608
|
+
return i && 1 !== x && !a.destroyed && K(n("<- mach(%s%s^%s), st: %s, ev: %s, ret: %d", e.running ? "" : "!!", Dt(e), Rt(e), e.current_state.state_name, t || "", qo(u) ? u : 0)), h--, u;
|
|
1574
1609
|
}
|
|
1575
1610
|
var On = Object.freeze({
|
|
1576
1611
|
__rename_event_name__: 1,
|
|
@@ -1603,34 +1638,34 @@
|
|
|
1603
1638
|
];
|
|
1604
1639
|
function Nn(e, t) {
|
|
1605
1640
|
let n = e ? e.__config__ : null;
|
|
1606
|
-
if (!
|
|
1641
|
+
if (!Bo(n) || !ll(n, "__hard_subscription__") && !ll(n, "__own_event__") && !ll(n, "__rename_event_name__")) return {
|
|
1607
1642
|
kw: e,
|
|
1608
1643
|
renamed_event: ""
|
|
1609
1644
|
};
|
|
1610
1645
|
let r = Do({}, e), o = Do({}, n);
|
|
1611
1646
|
r.__config__ = o;
|
|
1612
|
-
let l = "", i = o.__rename_event_name__, s = "string" != typeof i ||
|
|
1647
|
+
let l = "", i = o.__rename_event_name__, s = "string" != typeof i || Zo(i) ? null : Sn(i, 0, !1);
|
|
1613
1648
|
return s && (l = s.event_name, delete o.__rename_event_name__, t && xo(r.__global__) > 0 && (r.__global__ = Do(Do({}, r.__global__), { __original_event_name__: t }))), delete o.__hard_subscription__, delete o.__own_event__, {
|
|
1614
1649
|
kw: r,
|
|
1615
1650
|
renamed_event: l
|
|
1616
1651
|
};
|
|
1617
1652
|
}
|
|
1618
1653
|
function $n(e, t, n, r, o, l) {
|
|
1619
|
-
let i =
|
|
1620
|
-
if (t && t !==
|
|
1621
|
-
let t =
|
|
1654
|
+
let i = bl(t, o, "__config__", null), s = bl(t, o, "__global__", null), a = bl(t, o, "__local__", null), u = pl(t, o, "__filter__", null), _ = !0;
|
|
1655
|
+
if (t && t !== dl(null, e, "publisher", null) && (_ = !1), l && l !== dl(null, e, "subscriber", null) && (_ = !1), n && n !== gl(null, e, "event", "") && (_ = !1), r && r !== gl(null, e, "renamed_event", "") && (_ = !1), xo(i) > 0) {
|
|
1656
|
+
let t = bl(null, e, "__config__", null);
|
|
1622
1657
|
xo(t) > 0 && Ro(t, i) || (_ = !1);
|
|
1623
1658
|
}
|
|
1624
1659
|
if (xo(s) > 0) {
|
|
1625
|
-
let t =
|
|
1660
|
+
let t = bl(null, e, "__global__", null);
|
|
1626
1661
|
xo(t) > 0 && Ro(t, s) || (_ = !1);
|
|
1627
1662
|
}
|
|
1628
1663
|
if (xo(a) > 0) {
|
|
1629
|
-
let t =
|
|
1664
|
+
let t = bl(null, e, "__local__", null);
|
|
1630
1665
|
xo(t) > 0 && Ro(t, a) || (_ = !1);
|
|
1631
1666
|
}
|
|
1632
1667
|
if (xo(u) > 0) {
|
|
1633
|
-
let t =
|
|
1668
|
+
let t = pl(null, e, "__filter__", null);
|
|
1634
1669
|
xo(t) > 0 && Ro(t, u) || (_ = !1);
|
|
1635
1670
|
}
|
|
1636
1671
|
return _;
|
|
@@ -1647,8 +1682,8 @@
|
|
|
1647
1682
|
return e.indexOf(t);
|
|
1648
1683
|
}
|
|
1649
1684
|
function Dn(e, t, r, o) {
|
|
1650
|
-
let l =
|
|
1651
|
-
if (!!(
|
|
1685
|
+
let l = dl(e, t, "publisher", null, Un.KW_REQUIRED), i = dl(e, t, "subscriber", null, Un.KW_REQUIRED), s = gl(e, t, "event", "", Un.KW_REQUIRED);
|
|
1686
|
+
if (!!(fl(e, t, "subs_flag", null, Un.KW_REQUIRED) & On.__hard_subscription__) && !r) return -1;
|
|
1652
1687
|
let a = te(i) || te(l);
|
|
1653
1688
|
if (Rn(l.dl_subscriptions, t) < 0) return a && K(n("💜💜👎 unsubscribing event '%s': publisher %s, subscriber'%s', ALREADY REMOVED", s || "", kt(l), kt(i))), 1;
|
|
1654
1689
|
a && (K(n("💜💜👎 unsubscribing event '%s': publisher %s, subscriber'%s'", s || "", kt(l), kt(i))), _r(t)), l.obflag & U.obflag_destroyed || o || l.gclass.gmt.mt_subscription_deleted && l.gclass.gmt.mt_subscription_deleted(l, t);
|
|
@@ -1667,10 +1702,10 @@
|
|
|
1667
1702
|
]);
|
|
1668
1703
|
if (Object.keys(r).forEach((n) => {
|
|
1669
1704
|
l.has(n) || ir(`${kt(e)}: key ignored in subscription (key: ${n}, event: ${t})`);
|
|
1670
|
-
}),
|
|
1705
|
+
}), Zo(t)) t = "";
|
|
1671
1706
|
else if (!(bn(e, t, F.EVF_OUTPUT_EVENT) || e.gclass.gclass_flag & P.gcflag_no_check_output_events)) return ir(`event NOT in output event list: ${kt(e)}, ${t}`), 0;
|
|
1672
1707
|
let i = Nn(r, t), s = An(e.dl_subscriptions, e, t, i.renamed_event, i.kw, o), a = null;
|
|
1673
|
-
for (let t = 0; t < s.length; t++) if (
|
|
1708
|
+
for (let t = 0; t < s.length; t++) if (fl(e, s[t], "subs_flag", 0, Un.KW_REQUIRED) & On.__hard_subscription__) {
|
|
1674
1709
|
a = s[t];
|
|
1675
1710
|
break;
|
|
1676
1711
|
}
|
|
@@ -1681,29 +1716,29 @@
|
|
|
1681
1716
|
Uo(o, "event", t), Uo(o, "subscriber", r), Uo(o, "publisher", e);
|
|
1682
1717
|
let l = 0;
|
|
1683
1718
|
if (n) {
|
|
1684
|
-
let r =
|
|
1719
|
+
let r = bl(e, n, "__config__", null), i = bl(e, n, "__global__", null), s = bl(e, n, "__local__", null), a = pl(e, n, "__filter__", null), u = gl(e, n, "__service__", "");
|
|
1685
1720
|
if (xo(i) > 0 && Uo(o, "__global__", Ao(i)), xo(r) > 0) {
|
|
1686
1721
|
let n = Ao(r);
|
|
1687
1722
|
Uo(o, "__config__", n);
|
|
1688
|
-
let i =
|
|
1689
|
-
if (!
|
|
1723
|
+
let i = gl(e, n, "__rename_event_name__", "");
|
|
1724
|
+
if (!Zo(i)) {
|
|
1690
1725
|
let r = Sn(i, 0, !1);
|
|
1691
1726
|
if (r) {
|
|
1692
1727
|
Uo(o, "renamed_event", r.event_name), delete n.__rename_event_name__, l |= On.__rename_event_name__;
|
|
1693
|
-
let i =
|
|
1694
|
-
|
|
1728
|
+
let i = bl(e, o, "__global__", null);
|
|
1729
|
+
Bo(i) || (i = {}, Uo(o, "__global__", i)), i.__original_event_name__ = t;
|
|
1695
1730
|
} else ir(`${kt(e)}: EVENT NOT FOUND (__rename_event_name__: ${i})`);
|
|
1696
1731
|
}
|
|
1697
|
-
if (
|
|
1698
|
-
let t =
|
|
1732
|
+
if (ll(n, "__hard_subscription__")) {
|
|
1733
|
+
let t = cl(e, n, "__hard_subscription__", !1);
|
|
1699
1734
|
Po(n, "__hard_subscription__"), t && (l |= On.__hard_subscription__);
|
|
1700
1735
|
}
|
|
1701
|
-
if (
|
|
1702
|
-
let t =
|
|
1736
|
+
if (ll(n, "__own_event__")) {
|
|
1737
|
+
let t = cl(e, n, "__own_event__", !1);
|
|
1703
1738
|
Po(n, "__own_event__"), t && (l |= On.__own_event__);
|
|
1704
1739
|
}
|
|
1705
1740
|
}
|
|
1706
|
-
xo(s) > 0 && Uo(o, "__local__", Ao(s)), xo(a) > 0 && Uo(o, "__filter__", Ao(a)),
|
|
1741
|
+
xo(s) > 0 && Uo(o, "__local__", Ao(s)), xo(a) > 0 && Uo(o, "__filter__", Ao(a)), Zo(u) || Uo(o, "__service__", u);
|
|
1707
1742
|
}
|
|
1708
1743
|
return Uo(o, "subs_flag", l), o;
|
|
1709
1744
|
}(e, t, r, o);
|
|
@@ -1726,8 +1761,8 @@
|
|
|
1726
1761
|
return An(e.dl_subscribings, r, t, null, n, e);
|
|
1727
1762
|
}
|
|
1728
1763
|
function Ln(e, t, r) {
|
|
1729
|
-
if (
|
|
1730
|
-
if (
|
|
1764
|
+
if (Bo(r) || (r = {}), !e || e.obflag & (U.obflag_destroyed | U.obflag_destroying)) return ir("gobj NULL or DESTROYED"), -1;
|
|
1765
|
+
if (Zo(t)) return ir(`${kt(e)}: event EMPTY`), -1;
|
|
1731
1766
|
let o = gn(e, t, !0);
|
|
1732
1767
|
if (!(o && o.event_flag & (F.EVF_SYSTEM_EVENT | F.EVF_OUTPUT_EVENT) || e.gclass.gclass_flag & P.gcflag_no_check_output_events)) return ir(`event NOT in output event list: ${kt(e)}, ev ${t}`), -1;
|
|
1733
1768
|
let l = (te(e) || oe(e, t)) && !le(e, t);
|
|
@@ -1745,20 +1780,20 @@
|
|
|
1745
1780
|
if (n < 0) break;
|
|
1746
1781
|
if (!n) continue;
|
|
1747
1782
|
}
|
|
1748
|
-
let c =
|
|
1783
|
+
let c = dl(e, _, "subscriber", null, Un.KW_REQUIRED);
|
|
1749
1784
|
if (!c || Ut(c)) continue;
|
|
1750
|
-
let f =
|
|
1751
|
-
if (
|
|
1752
|
-
|
|
1753
|
-
let o =
|
|
1754
|
-
|
|
1785
|
+
let f = fl(e, _, "subs_flag", 0, Un.KW_REQUIRED), g = gl(e, _, "event", "", Un.KW_REQUIRED);
|
|
1786
|
+
if (Zo(g) || 0 === nl(g, t)) {
|
|
1787
|
+
bl(e, _, "__config__", null, 0);
|
|
1788
|
+
let o = bl(e, _, "__global__", null, 0), i = bl(e, _, "__local__", null, 0), g = pl(e, _, "__filter__", null, 0), d = _.renamed_event;
|
|
1789
|
+
Zo(d) && (d = t);
|
|
1755
1790
|
let b = 1;
|
|
1756
|
-
if (e.gclass.gmt.mt_publication_filter ? b = e.gclass.gmt.mt_publication_filter(e, t, r, c) : xo(g) > 0 && (b =
|
|
1791
|
+
if (e.gclass.gmt.mt_publication_filter ? b = e.gclass.gmt.mt_publication_filter(e, t, r, c) : xo(g) > 0 && (b = vl(r, g) ? 1 : 0, l && (K(n("💜💜🔄%s publishing with filter, event '%s', subscriber'%s', publisher %s", b ? "👍" : "👎", t || "", kt(c), kt(e))), _r(g))), b < 0) break;
|
|
1757
1792
|
if (!b) continue;
|
|
1758
1793
|
let p = gn(c, t, !0);
|
|
1759
1794
|
if (p && p.event_flag & F.EVF_SYSTEM_EVENT && !dn(c, p.event_name, 0)) continue;
|
|
1760
1795
|
let m = r;
|
|
1761
|
-
(xo(i) > 0 || xo(o) > 0) && (m = Do({}, r)), xo(i) > 0 &&
|
|
1796
|
+
(xo(i) > 0 || xo(o) > 0) && (m = Do({}, r)), xo(i) > 0 && ol(m, i), xo(o) > 0 && Do(m, Ao(o)), l && (K(1 === x ? n("🔝🔄 %s (%s) %s%s", t || "", d || "", c.running ? "" : "!!", kt(c)) : n("🔝🔄 mach(%s%s), st: %s, ev: %s (%s), from(%s%s)", c.running ? "" : "!!", kt(c), fn(c), t || "", d || "", e && !e.running ? "!!" : "", kt(e))), re(e) && Vo(m) && $o(m));
|
|
1762
1797
|
let h = jn(c, d, m, e);
|
|
1763
1798
|
if (h < 0 && f & On.__own_event__) {
|
|
1764
1799
|
s = -1;
|
|
@@ -1795,7 +1830,7 @@
|
|
|
1795
1830
|
var Fn = "undefined" != typeof window ? window.console : console, Mn = Fn.error, Gn = Fn.warn, Vn = Fn.info, Wn = Fn.debug, xn = null, Kn = 600, Bn = [];
|
|
1796
1831
|
var Yn = !0;
|
|
1797
1832
|
var Jn = null;
|
|
1798
|
-
function
|
|
1833
|
+
function qn(e, t) {
|
|
1799
1834
|
if (!Yn) return !1;
|
|
1800
1835
|
if (!Jn) return !0;
|
|
1801
1836
|
try {
|
|
@@ -1804,9 +1839,9 @@
|
|
|
1804
1839
|
return !0;
|
|
1805
1840
|
}
|
|
1806
1841
|
}
|
|
1807
|
-
var
|
|
1842
|
+
var Hn = !1;
|
|
1808
1843
|
function zn(e, t, n) {
|
|
1809
|
-
|
|
1844
|
+
Hn || (function(e, t, n) {
|
|
1810
1845
|
let r = t;
|
|
1811
1846
|
"json" === e && (r = Zn(t)), Bn.push([
|
|
1812
1847
|
e,
|
|
@@ -1816,12 +1851,12 @@
|
|
|
1816
1851
|
}(e, t, n), Qn(e, t, n));
|
|
1817
1852
|
}
|
|
1818
1853
|
function Qn(e, t, n) {
|
|
1819
|
-
if (xn && !
|
|
1820
|
-
|
|
1854
|
+
if (xn && !Hn) {
|
|
1855
|
+
Hn = !0;
|
|
1821
1856
|
try {
|
|
1822
1857
|
xn(e, t, n);
|
|
1823
1858
|
} catch (e) {} finally {
|
|
1824
|
-
|
|
1859
|
+
Hn = !1;
|
|
1825
1860
|
}
|
|
1826
1861
|
}
|
|
1827
1862
|
}
|
|
@@ -1899,23 +1934,23 @@
|
|
|
1899
1934
|
}
|
|
1900
1935
|
}
|
|
1901
1936
|
function ir(e, ...t) {
|
|
1902
|
-
let n = nr(e, ...t), r =
|
|
1903
|
-
Mn && (Mn === Fn.error ?
|
|
1937
|
+
let n = nr(e, ...t), r = Hl();
|
|
1938
|
+
Mn && (Mn === Fn.error ? qn("error", n) && rr(Mn, "%c" + r + " ERROR: " + String(n), "color:red") : (qn("error", n) && Fn.error("%c" + r + " ERROR: " + String(n), "color:red"), lr(Mn, `${r} ERROR: ${String(n)}`))), zn("error", n, r);
|
|
1904
1939
|
}
|
|
1905
1940
|
function sr(e, ...t) {
|
|
1906
|
-
let n = nr(e, ...t), r =
|
|
1907
|
-
Gn && (Gn === Fn.warn ?
|
|
1941
|
+
let n = nr(e, ...t), r = Hl();
|
|
1942
|
+
Gn && (Gn === Fn.warn ? qn("warning", n) && rr(Gn, "%c" + r + " WARNING: " + String(n), "color:yellow") : (qn("warning", n) && Fn.warn("%c" + r + " WARNING: " + String(n), "color:yellow"), lr(Gn, `${r} WARNING: ${String(n)}`))), zn("warning", n, r);
|
|
1908
1943
|
}
|
|
1909
1944
|
function ar(e, ...t) {
|
|
1910
|
-
let n = nr(e, ...t), r =
|
|
1911
|
-
Wn &&
|
|
1945
|
+
let n = nr(e, ...t), r = Hl();
|
|
1946
|
+
Wn && qn("debug", n) && rr(Wn, "%c" + r + " DEBUG: " + String(n), "color:silver"), zn("debug", n, r);
|
|
1912
1947
|
}
|
|
1913
1948
|
function ur(e, ...t) {
|
|
1914
|
-
let n = nr(e, ...t), r =
|
|
1915
|
-
Wn &&
|
|
1949
|
+
let n = nr(e, ...t), r = Hl();
|
|
1950
|
+
Wn && qn("msg", n) && rr(Wn, "%c" + r + " MSG: " + String(n), "color:cyan"), zn("msg", n, r);
|
|
1916
1951
|
}
|
|
1917
1952
|
function _r(e, t) {
|
|
1918
|
-
|
|
1953
|
+
qn("json", t) && (t && rr(Fn.warn, "=====> " + er(t)), rr(Fn.dir, e)), zn("json", e, Hl());
|
|
1919
1954
|
}
|
|
1920
1955
|
function cr(e) {
|
|
1921
1956
|
const t = new Array(128).fill(null);
|
|
@@ -2259,9 +2294,9 @@
|
|
|
2259
2294
|
function Br(e, t, n) {
|
|
2260
2295
|
for (let r = t; r < n; r++) e[r] = 1;
|
|
2261
2296
|
}
|
|
2262
|
-
var Yr = 0, Jr = 1,
|
|
2263
|
-
function
|
|
2264
|
-
const l = n ===
|
|
2297
|
+
var Yr = 0, Jr = 1, qr = 2;
|
|
2298
|
+
function Hr(e, t, n, r, o) {
|
|
2299
|
+
const l = n === qr ? Tr : Er;
|
|
2265
2300
|
let i = !1;
|
|
2266
2301
|
const s = (t) => t >= e.length || " " === e[t] || " " === e[t] || "\0" === e[t];
|
|
2267
2302
|
let a = "", u = 0, _ = 0;
|
|
@@ -2475,7 +2510,7 @@
|
|
|
2475
2510
|
const s = i.join(""), a = new Uint8Array(s.length);
|
|
2476
2511
|
(function(e, t) {
|
|
2477
2512
|
const n = po(e, Er), r = new Uint8Array(e.length);
|
|
2478
|
-
|
|
2513
|
+
Hr(e, n, Yr, t, r), _o(e, t, r), fo(e, t), go(e, t), bo(e, t);
|
|
2479
2514
|
})(s, a), vo(s, a, n + 1);
|
|
2480
2515
|
let u = 0;
|
|
2481
2516
|
for (let n = 0; n < s.length; n++) {
|
|
@@ -2485,13 +2520,13 @@
|
|
|
2485
2520
|
}
|
|
2486
2521
|
function Eo(e, t) {
|
|
2487
2522
|
const n = po(e, Er), r = po(e, Tr), o = new Uint8Array(e.length);
|
|
2488
|
-
(
|
|
2523
|
+
(Hr(e, n, Yr, t, o) || n !== r) && Hr(e, r, qr, t, null), function(e) {
|
|
2489
2524
|
for (let t = 0; t < e.length; t++) {
|
|
2490
2525
|
const n = e.charCodeAt(t);
|
|
2491
2526
|
if ((101 === n || 98 === n || 66 === n) && Mr(e, t)[1]) return !0;
|
|
2492
2527
|
}
|
|
2493
2528
|
return !1;
|
|
2494
|
-
}(e) &&
|
|
2529
|
+
}(e) && Hr(e, n, Jr, t, null), _o(e, t, o), fo(e, t), go(e, t), bo(e, t), vo(e, t, 0);
|
|
2495
2530
|
}
|
|
2496
2531
|
function To(e) {
|
|
2497
2532
|
if ("string" != typeof e) return null;
|
|
@@ -2563,7 +2598,7 @@
|
|
|
2563
2598
|
}
|
|
2564
2599
|
r.left -= 1 + a.length;
|
|
2565
2600
|
let u, _ = e[a];
|
|
2566
|
-
u = (jr(a, 0, a.length, Er) || o && "value" === a) && null != _ && "" !== _ ? "********" : wo(_, t, n + 1, r), u !== _ && (i = !0),
|
|
2601
|
+
u = (jr(a, 0, a.length, Er) || o && "value" === a) && null != _ && "" !== _ ? "********" : wo(_, t, n + 1, r), u !== _ && (i = !0), sl(l, a, u);
|
|
2567
2602
|
}
|
|
2568
2603
|
s && (l["<more>"] = Kr);
|
|
2569
2604
|
}
|
|
@@ -2605,17 +2640,17 @@
|
|
|
2605
2640
|
}
|
|
2606
2641
|
function Do(e, t) {
|
|
2607
2642
|
if (!t) return e;
|
|
2608
|
-
for (let n of Object.keys(t))
|
|
2643
|
+
for (let n of Object.keys(t)) sl(e, n, t[n]);
|
|
2609
2644
|
return e;
|
|
2610
2645
|
}
|
|
2611
2646
|
function ko(e, t) {
|
|
2612
2647
|
if (!t) return e;
|
|
2613
|
-
for (let n in t) Object.prototype.hasOwnProperty.call(t, n) && Object.prototype.hasOwnProperty.call(e, n) &&
|
|
2648
|
+
for (let n in t) Object.prototype.hasOwnProperty.call(t, n) && Object.prototype.hasOwnProperty.call(e, n) && sl(e, n, t[n]);
|
|
2614
2649
|
return e;
|
|
2615
2650
|
}
|
|
2616
2651
|
function Co(e, t) {
|
|
2617
2652
|
if (!t) return e;
|
|
2618
|
-
for (let n in t) Object.prototype.hasOwnProperty.call(t, n) && !Object.prototype.hasOwnProperty.call(e, n) &&
|
|
2653
|
+
for (let n in t) Object.prototype.hasOwnProperty.call(t, n) && !Object.prototype.hasOwnProperty.call(e, n) && sl(e, n, t[n]);
|
|
2619
2654
|
return e;
|
|
2620
2655
|
}
|
|
2621
2656
|
function Io(e, t) {
|
|
@@ -2625,10 +2660,10 @@
|
|
|
2625
2660
|
e && Object.prototype.hasOwnProperty.call(e, t) && delete e[t];
|
|
2626
2661
|
}
|
|
2627
2662
|
function Lo(e, t, n) {
|
|
2628
|
-
|
|
2663
|
+
sl(e, t, n);
|
|
2629
2664
|
}
|
|
2630
2665
|
function Uo(e, t, n) {
|
|
2631
|
-
|
|
2666
|
+
sl(e, t, n);
|
|
2632
2667
|
}
|
|
2633
2668
|
function Fo(e, t) {
|
|
2634
2669
|
e.push(t);
|
|
@@ -2640,54 +2675,57 @@
|
|
|
2640
2675
|
e.splice(t, 1);
|
|
2641
2676
|
}
|
|
2642
2677
|
function Vo(e) {
|
|
2643
|
-
return
|
|
2678
|
+
return Bo(e) ? Object.keys(e).length : 0;
|
|
2644
2679
|
}
|
|
2645
2680
|
function Wo(e) {
|
|
2646
|
-
return
|
|
2681
|
+
return Yo(e) ? e.length : 0;
|
|
2647
2682
|
}
|
|
2648
2683
|
function xo(e) {
|
|
2649
|
-
return
|
|
2684
|
+
return Bo(e) ? Object.keys(e).length : Yo(e) ? e.length : Jo(e) && e.length > 0 ? 1 : 0;
|
|
2650
2685
|
}
|
|
2651
2686
|
function Ko(e) {
|
|
2652
|
-
return
|
|
2687
|
+
return 0 === xo(e);
|
|
2653
2688
|
}
|
|
2654
2689
|
function Bo(e) {
|
|
2655
|
-
return Array.isArray(e);
|
|
2690
|
+
return null !== e && "object" == typeof e && !Array.isArray(e);
|
|
2656
2691
|
}
|
|
2657
2692
|
function Yo(e) {
|
|
2658
|
-
return
|
|
2693
|
+
return Array.isArray(e);
|
|
2659
2694
|
}
|
|
2660
2695
|
function Jo(e) {
|
|
2696
|
+
return "string" == typeof e;
|
|
2697
|
+
}
|
|
2698
|
+
function qo(e) {
|
|
2661
2699
|
return "number" == typeof e && Number.isFinite(e);
|
|
2662
2700
|
}
|
|
2663
2701
|
function Ho(e) {
|
|
2664
2702
|
return "boolean" == typeof e;
|
|
2665
2703
|
}
|
|
2666
|
-
function qo(e) {
|
|
2667
|
-
return null == e;
|
|
2668
|
-
}
|
|
2669
2704
|
function zo(e) {
|
|
2670
|
-
return
|
|
2705
|
+
return null == e;
|
|
2671
2706
|
}
|
|
2672
2707
|
function Qo(e) {
|
|
2673
|
-
return
|
|
2708
|
+
return "function" == typeof e;
|
|
2674
2709
|
}
|
|
2675
2710
|
function Xo(e) {
|
|
2676
|
-
return
|
|
2711
|
+
return e instanceof I;
|
|
2677
2712
|
}
|
|
2678
2713
|
function Zo(e) {
|
|
2679
|
-
return Jo(e)
|
|
2714
|
+
return !Jo(e) || 0 === e.length;
|
|
2680
2715
|
}
|
|
2681
|
-
function el(e
|
|
2682
|
-
return e
|
|
2716
|
+
function el(e) {
|
|
2717
|
+
return qo(e) ? Boolean(e) : /^\s*(true|1|on)\s*$/i.test(e);
|
|
2683
2718
|
}
|
|
2684
2719
|
function tl(e, t) {
|
|
2720
|
+
return e === t ? 0 : e > t ? 1 : -1;
|
|
2721
|
+
}
|
|
2722
|
+
function nl(e, t) {
|
|
2685
2723
|
let n = e.toLowerCase(), r = t.toLowerCase();
|
|
2686
2724
|
return n === r ? 0 : n > r ? 1 : -1;
|
|
2687
2725
|
}
|
|
2688
|
-
function
|
|
2689
|
-
if (
|
|
2690
|
-
if (
|
|
2726
|
+
function rl(e, t) {
|
|
2727
|
+
if (Bo(e) || Bo(t) || Yo(e) || Yo(t)) return 0;
|
|
2728
|
+
if (qo(e) || qo(t)) {
|
|
2691
2729
|
let n = Number(e), r = Number(t);
|
|
2692
2730
|
return Number.isNaN(n) && (n = 0), Number.isNaN(r) && (r = 0), n > r ? 1 : n < r ? -1 : 0;
|
|
2693
2731
|
}
|
|
@@ -2695,20 +2733,20 @@
|
|
|
2695
2733
|
let n = Number(e), r = Number(t);
|
|
2696
2734
|
return n > r ? 1 : n < r ? -1 : 0;
|
|
2697
2735
|
}
|
|
2698
|
-
return
|
|
2736
|
+
return tl(String(e), String(t));
|
|
2699
2737
|
}
|
|
2700
|
-
function
|
|
2701
|
-
if ("object" != typeof t || Array.isArray(t)) if (Array.isArray(t)) for (const n of t)
|
|
2738
|
+
function ol(e, t) {
|
|
2739
|
+
if ("object" != typeof t || Array.isArray(t)) if (Array.isArray(t)) for (const n of t) ol(e, n);
|
|
2702
2740
|
else "string" == typeof t && delete e[t];
|
|
2703
2741
|
else for (const n of Object.keys(t)) delete e[n];
|
|
2704
2742
|
}
|
|
2705
|
-
function
|
|
2743
|
+
function ll(e, t) {
|
|
2706
2744
|
return !(!(t in e) || !Object.prototype.hasOwnProperty.call(e, t));
|
|
2707
2745
|
}
|
|
2708
|
-
function
|
|
2746
|
+
function il(e, t) {
|
|
2709
2747
|
return !Object.prototype.hasOwnProperty.call(e, t);
|
|
2710
2748
|
}
|
|
2711
|
-
function
|
|
2749
|
+
function sl(e, t, n) {
|
|
2712
2750
|
"__proto__" === t ? Object.defineProperty(e, t, {
|
|
2713
2751
|
value: n,
|
|
2714
2752
|
writable: !0,
|
|
@@ -2716,81 +2754,81 @@
|
|
|
2716
2754
|
configurable: !0
|
|
2717
2755
|
}) : e[t] = n;
|
|
2718
2756
|
}
|
|
2719
|
-
function
|
|
2757
|
+
function al(e, t) {
|
|
2720
2758
|
if (!/^[0-9]+$/.test(t)) return -1;
|
|
2721
2759
|
const n = Number(t);
|
|
2722
2760
|
return n >= e.length ? -1 : n;
|
|
2723
2761
|
}
|
|
2724
|
-
function
|
|
2725
|
-
e && !
|
|
2762
|
+
function ul(e, t, n, r) {
|
|
2763
|
+
e && !Xo(e) && ir("GObj bad instanceof");
|
|
2726
2764
|
const o = e ? `${kt(e)}: ` : "";
|
|
2727
|
-
if (!
|
|
2728
|
-
if (!
|
|
2765
|
+
if (!Bo(t) && !Yo(t)) return void ir(`${o}kw must be list or dict: '${String(n)}'`);
|
|
2766
|
+
if (!Jo(n)) return void ir(`${o}path must be a string: ${String(n)}`);
|
|
2729
2767
|
let l = n.split("`"), i = l.length;
|
|
2730
2768
|
for (let e = 0; e < i; e++) {
|
|
2731
|
-
if (
|
|
2732
|
-
const i =
|
|
2769
|
+
if (Yo(t)) {
|
|
2770
|
+
const i = al(t, l[e]);
|
|
2733
2771
|
if (i < 0) return void (r && ir(`${o}path not found: '${n}'`));
|
|
2734
2772
|
l[e] = String(i);
|
|
2735
2773
|
}
|
|
2736
|
-
if (
|
|
2774
|
+
if (il(t, l[e])) return void (r && ir(`${o}path not found: '${n}'`));
|
|
2737
2775
|
if (e === i - 1) break;
|
|
2738
2776
|
if (null == (t = t[l[e]])) return void (r && ir(`${o}path not found: '${n}'`));
|
|
2739
|
-
if (!
|
|
2777
|
+
if (!Bo(t) && !Yo(t)) return void ir(`${o}kw must be list or dict: '${n}'`);
|
|
2740
2778
|
}
|
|
2741
2779
|
let s = t[l[i - 1]];
|
|
2742
2780
|
return void 0 === s && r && ir(`${o}path not found: '${n}'`), s;
|
|
2743
2781
|
}
|
|
2744
|
-
function
|
|
2745
|
-
e && !
|
|
2782
|
+
function _l(e, t, n) {
|
|
2783
|
+
e && !Xo(e) && ir("GObj bad instanceof");
|
|
2746
2784
|
const r = e ? kt(e) + ": " : "";
|
|
2747
|
-
if (!
|
|
2785
|
+
if (!Jo(n)) return ir(`${r}kw_delete(): path must be a string: ${String(n)}`), -1;
|
|
2748
2786
|
let [o, l] = function(e, t) {
|
|
2749
2787
|
let n = e.lastIndexOf(t);
|
|
2750
2788
|
return -1 === n ? [e, ""] : [e.substring(0, n), e.substring(n + 1)];
|
|
2751
2789
|
}(n, "`"), i = t;
|
|
2752
|
-
if (
|
|
2753
|
-
else if (i =
|
|
2754
|
-
return
|
|
2790
|
+
if (Zo(l)) l = n;
|
|
2791
|
+
else if (i = ul(e, t, o, !0), void 0 === i) return -1;
|
|
2792
|
+
return Yo(i) ? (ir(`${r}kw_delete(): cannot delete an item of a list: '${n}'`), -1) : Bo(i) && Object.prototype.hasOwnProperty.call(i, l) ? (delete i[l], 0) : (ir(`${r}kw_delete(): path not found: '${n}'`), -1);
|
|
2755
2793
|
}
|
|
2756
|
-
function
|
|
2757
|
-
e && !
|
|
2758
|
-
let l =
|
|
2794
|
+
function cl(e, t, n, r, o) {
|
|
2795
|
+
e && !Xo(e) && ir("GObj bad instanceof");
|
|
2796
|
+
let l = ul(e, t, n, !1);
|
|
2759
2797
|
const i = o && o & Un.KW_REQUIRED, s = o && o & Un.KW_CREATE, a = o && o & Un.KW_EXTRACT, u = o && o & Un.KW_WILD_NUMBER;
|
|
2760
2798
|
if (void 0 === l) {
|
|
2761
2799
|
if (s && t) {
|
|
2762
2800
|
let o = Boolean(r);
|
|
2763
|
-
return
|
|
2801
|
+
return ml(e, t, n, o), o;
|
|
2764
2802
|
}
|
|
2765
2803
|
return i && (ir(`path not found: '${n}'`), $o(t)), Boolean(r);
|
|
2766
2804
|
}
|
|
2767
2805
|
let _;
|
|
2768
2806
|
if (Ho(l)) _ = l;
|
|
2769
|
-
else if (u &&
|
|
2770
|
-
else if (u &&
|
|
2807
|
+
else if (u && qo(l)) _ = 0 !== l;
|
|
2808
|
+
else if (u && Jo(l)) _ = "true" === l.toLowerCase() || "false" !== l.toLowerCase() && 0 !== (parseInt(l, 10) || 0);
|
|
2771
2809
|
else {
|
|
2772
2810
|
if (!u || null !== l) return u ? (ir(`${e ? kt(e) + ": " : ""}path MUST BE a simple json element: '${n}'`), $o(t), !1) : (ir(`${e ? kt(e) + ": " : ""}path MUST BE a json boolean: '${n}'`), $o(t), Boolean(r));
|
|
2773
2811
|
_ = !1;
|
|
2774
2812
|
}
|
|
2775
|
-
return a &&
|
|
2813
|
+
return a && _l(e, t, n), _;
|
|
2776
2814
|
}
|
|
2777
|
-
function
|
|
2778
|
-
e && !
|
|
2779
|
-
let l =
|
|
2815
|
+
function fl(e, t, n, r, o) {
|
|
2816
|
+
e && !Xo(e) && ir("GObj bad instanceof");
|
|
2817
|
+
let l = ul(e, t, n, !1);
|
|
2780
2818
|
const i = o && o & Un.KW_REQUIRED, s = o && o & Un.KW_CREATE, a = o && o & Un.KW_EXTRACT, u = o && o & Un.KW_WILD_NUMBER;
|
|
2781
2819
|
if (void 0 === l) {
|
|
2782
2820
|
if (s && t) {
|
|
2783
2821
|
let o = parseInt(r);
|
|
2784
|
-
return
|
|
2822
|
+
return ml(e, t, n, o), o;
|
|
2785
2823
|
}
|
|
2786
2824
|
return i && (ir(`path not found: '${n}'`), $o(t)), parseInt(r);
|
|
2787
2825
|
}
|
|
2788
2826
|
let _;
|
|
2789
|
-
if (
|
|
2827
|
+
if (qo(l)) _ = Math.trunc(l);
|
|
2790
2828
|
else {
|
|
2791
2829
|
if (!u) return ir(`${e ? kt(e) + ": " : ""}path MUST BE a json integer: '${n}'`), $o(t), parseInt(r);
|
|
2792
2830
|
if (Ho(l)) _ = l ? 1 : 0;
|
|
2793
|
-
else if (
|
|
2831
|
+
else if (Jo(l)) _ = function(e) {
|
|
2794
2832
|
const t = /^\s*([+-]?)(0[xX][0-9a-fA-F]+|0[0-7]*|[1-9][0-9]*)/.exec(e);
|
|
2795
2833
|
if (!t) return 0;
|
|
2796
2834
|
let n, r = t[2];
|
|
@@ -2801,120 +2839,120 @@
|
|
|
2801
2839
|
_ = 0;
|
|
2802
2840
|
}
|
|
2803
2841
|
}
|
|
2804
|
-
return a &&
|
|
2842
|
+
return a && _l(e, t, n), _;
|
|
2805
2843
|
}
|
|
2806
|
-
function
|
|
2807
|
-
e && !
|
|
2808
|
-
let l =
|
|
2844
|
+
function gl(e, t, n, r, o) {
|
|
2845
|
+
e && !Xo(e) && ir("GObj bad instanceof");
|
|
2846
|
+
let l = ul(e, t, n, !1);
|
|
2809
2847
|
const i = o && o & Un.KW_REQUIRED, s = o && o & Un.KW_CREATE, a = o && o & Un.KW_EXTRACT;
|
|
2810
|
-
return void 0 === l ? s && t ? (
|
|
2811
|
-
let n =
|
|
2848
|
+
return void 0 === l ? s && t ? (ml(e, t, n, Jo(r) ? r : null), r) : (i && !function(e, t) {
|
|
2849
|
+
let n = Jo(t) ? t.split("`") : [], r = e;
|
|
2812
2850
|
for (let e = 0; e < n.length - 1; e++) {
|
|
2813
|
-
if (!
|
|
2851
|
+
if (!Bo(r) && !Yo(r)) return !1;
|
|
2814
2852
|
r = r[n[e]];
|
|
2815
2853
|
}
|
|
2816
|
-
return !(!
|
|
2817
|
-
}(t, n) && (ir(`path not found: '${n}'`), $o(t)), r) :
|
|
2854
|
+
return !(!Bo(r) && !Yo(r) || 0 === n.length) && Object.prototype.hasOwnProperty.call(r, n[n.length - 1]);
|
|
2855
|
+
}(t, n) && (ir(`path not found: '${n}'`), $o(t)), r) : Jo(l) ? (a && _l(e, t, n), l) : (null !== l && (ir(`${e ? kt(e) + ": " : ""}path MUST BE a json str: '${n}'`), $o(t)), r);
|
|
2818
2856
|
}
|
|
2819
|
-
function
|
|
2820
|
-
e && !
|
|
2821
|
-
let l =
|
|
2857
|
+
function dl(e, t, n, r, o) {
|
|
2858
|
+
e && !Xo(e) && ir("GObj bad instanceof");
|
|
2859
|
+
let l = ul(e, t, n, !1);
|
|
2822
2860
|
const i = o && o & Un.KW_REQUIRED, s = o && o & Un.KW_CREATE, a = o && o & Un.KW_EXTRACT;
|
|
2823
2861
|
if (void 0 === l) {
|
|
2824
2862
|
if (s) {
|
|
2825
2863
|
let o = r;
|
|
2826
|
-
return
|
|
2864
|
+
return ml(e, t, n, o), o;
|
|
2827
2865
|
}
|
|
2828
2866
|
return i && (ir(`path not found: '${n}'`), $o(t)), r;
|
|
2829
2867
|
}
|
|
2830
|
-
return a &&
|
|
2868
|
+
return a && _l(e, t, n), l;
|
|
2831
2869
|
}
|
|
2832
|
-
function
|
|
2833
|
-
e && !
|
|
2834
|
-
let l =
|
|
2870
|
+
function bl(e, t, n, r, o) {
|
|
2871
|
+
e && !Xo(e) && ir("GObj bad instanceof");
|
|
2872
|
+
let l = ul(e, t, n, !1);
|
|
2835
2873
|
const i = o && o & Un.KW_REQUIRED, s = o && o & Un.KW_CREATE, a = o && o & Un.KW_EXTRACT;
|
|
2836
|
-
return void 0 === l ? s &&
|
|
2874
|
+
return void 0 === l ? s && Bo(r) && t ? (ml(e, t, n, r), r) : (i && (ir(`path not found: '${n}'`), $o(t)), r) : Bo(l) ? (a && _l(e, t, n), l) : s && null === l && Bo(r) ? (ml(e, t, n, r), r) : s && null === l ? (i && (ir(`path not found: '${n}'`), $o(t)), r) : ((i || s) && (ir(`${e ? kt(e) + ": " : ""}path MUST BE a json dict: '${n}'` + (s ? ", cannot create" : "")), $o(t)), r);
|
|
2837
2875
|
}
|
|
2838
|
-
function
|
|
2839
|
-
e && !
|
|
2840
|
-
let l =
|
|
2876
|
+
function pl(e, t, n, r, o) {
|
|
2877
|
+
e && !Xo(e) && ir("GObj bad instanceof");
|
|
2878
|
+
let l = ul(e, t, n, !1);
|
|
2841
2879
|
const i = o && o & Un.KW_REQUIRED, s = o && o & Un.KW_CREATE, a = o && o & Un.KW_EXTRACT;
|
|
2842
2880
|
if (void 0 === l) {
|
|
2843
2881
|
if (s) {
|
|
2844
2882
|
let o = r;
|
|
2845
|
-
return
|
|
2883
|
+
return ml(e, t, n, o), o;
|
|
2846
2884
|
}
|
|
2847
2885
|
return i && (ir(`path not found: '${n}'`), $o(t)), r;
|
|
2848
2886
|
}
|
|
2849
|
-
return a &&
|
|
2887
|
+
return a && _l(e, t, n), l;
|
|
2850
2888
|
}
|
|
2851
|
-
function
|
|
2852
|
-
if (e && !
|
|
2853
|
-
if (!
|
|
2889
|
+
function ml(e, t, n, r) {
|
|
2890
|
+
if (e && !Xo(e) && ir("GObj bad instanceof"), !Bo(t)) return ir("kw is not an object"), -1;
|
|
2891
|
+
if (!Jo(n)) return ir(`${e ? kt(e) + ": " : ""}kw_set_dict_value(): path must be a string: ${String(n)}`), -1;
|
|
2854
2892
|
if ("" === n) return ir((e ? kt(e) + ": " : "") + "kw_set_dict_value(): path empty"), -1;
|
|
2855
2893
|
if (n.split("`").includes("")) return ir(`${e ? kt(e) + ": " : ""}kw_set_dict_value(): empty segment in path: '${n}'`), -1;
|
|
2856
2894
|
let o = n.split("`"), l = o.length;
|
|
2857
2895
|
for (let i = 0; i < l; i++) {
|
|
2858
2896
|
let s = o[i];
|
|
2859
|
-
if (
|
|
2860
|
-
const r =
|
|
2897
|
+
if (Yo(t)) {
|
|
2898
|
+
const r = al(t, s);
|
|
2861
2899
|
if (r < 0) return ir(`${e ? kt(e) + ": " : ""}kw_set_dict_value(): segment '${s}' is not an index of its list: '${n}'`), -1;
|
|
2862
2900
|
s = String(r);
|
|
2863
2901
|
}
|
|
2864
|
-
if (i === l - 1)
|
|
2902
|
+
if (i === l - 1) sl(t, s, r);
|
|
2865
2903
|
else {
|
|
2866
|
-
let r =
|
|
2867
|
-
if (void 0 === r)
|
|
2868
|
-
else if (!
|
|
2904
|
+
let r = il(t, s) ? void 0 : t[s];
|
|
2905
|
+
if (void 0 === r) sl(t, s, {});
|
|
2906
|
+
else if (!Bo(r) && !Yo(r)) return ir(`${e ? kt(e) + ": " : ""}kw_set_dict_value(): segment '${s}' is not a dict or a list: '${n}'`), -1;
|
|
2869
2907
|
t = t[s];
|
|
2870
2908
|
}
|
|
2871
2909
|
}
|
|
2872
2910
|
return 0;
|
|
2873
2911
|
}
|
|
2874
|
-
function
|
|
2875
|
-
if (e && !
|
|
2876
|
-
let l =
|
|
2912
|
+
function hl(e, t, n, r, o) {
|
|
2913
|
+
if (e && !Xo(e) && ir("GObj bad instanceof"), !Bo(t)) return ir("kw is not an object"), -1;
|
|
2914
|
+
let l = ul(e, t, n, !1);
|
|
2877
2915
|
if (void 0 === l) {
|
|
2878
|
-
if (!
|
|
2916
|
+
if (!Jo(n) || function(e, t) {
|
|
2879
2917
|
let n = t.split("`"), r = e;
|
|
2880
2918
|
for (let e = 0; e < n.length - 1; e++) {
|
|
2881
|
-
if (
|
|
2882
|
-
const t =
|
|
2919
|
+
if (Yo(r)) {
|
|
2920
|
+
const t = al(r, n[e]);
|
|
2883
2921
|
if (t < 0) return !1;
|
|
2884
2922
|
r = r[t];
|
|
2885
2923
|
} else r = Object.prototype.hasOwnProperty.call(r, n[e]) ? r[n[e]] : void 0;
|
|
2886
2924
|
if (null == r) return !1;
|
|
2887
|
-
if (!
|
|
2925
|
+
if (!Bo(r) && !Yo(r)) return !0;
|
|
2888
2926
|
}
|
|
2889
2927
|
return !1;
|
|
2890
2928
|
}(t, n)) return -1;
|
|
2891
|
-
if (l = {},
|
|
2929
|
+
if (l = {}, ml(e, t, n, l) < 0) return -1;
|
|
2892
2930
|
}
|
|
2893
|
-
return
|
|
2931
|
+
return Bo(l) ? (sl(l, r, o), 0) : (ir(`subdict is not an object: '${n}'`), -1);
|
|
2894
2932
|
}
|
|
2895
|
-
function
|
|
2933
|
+
function yl(e, t, r) {
|
|
2896
2934
|
let o = "", l = !1;
|
|
2897
|
-
if (
|
|
2935
|
+
if (Yo(t)) {
|
|
2898
2936
|
l = !1;
|
|
2899
2937
|
for (let i = 0; i < t.length; i++) {
|
|
2900
2938
|
let s = t[i];
|
|
2901
|
-
if (o =
|
|
2939
|
+
if (o = Zo(r) ? n("%s", r) : n("%s`%d", r, i), l = yl(e, s, o), l) break;
|
|
2902
2940
|
}
|
|
2903
|
-
} else if (
|
|
2941
|
+
} else if (Bo(t)) {
|
|
2904
2942
|
l = !0;
|
|
2905
2943
|
let i = Object.keys(t);
|
|
2906
2944
|
for (let s = 0; s < i.length; s++) {
|
|
2907
2945
|
let a = i[s], u = t[a];
|
|
2908
|
-
if (o =
|
|
2909
|
-
if (l =
|
|
2946
|
+
if (o = Zo(r) ? n("%s", a) : n("%s`%s", r, a), Yo(u) || Bo(u)) {
|
|
2947
|
+
if (l = yl(e, u, o), !l) break;
|
|
2910
2948
|
continue;
|
|
2911
2949
|
}
|
|
2912
|
-
let _ =
|
|
2950
|
+
let _ = pl(0, e, o, void 0, 0);
|
|
2913
2951
|
if (void 0 === _ && (_ = Io(e, o)), void 0 === _) {
|
|
2914
2952
|
l = !1;
|
|
2915
2953
|
break;
|
|
2916
2954
|
}
|
|
2917
|
-
if (0 !==
|
|
2955
|
+
if (0 !== rl(_, u)) {
|
|
2918
2956
|
l = !1;
|
|
2919
2957
|
break;
|
|
2920
2958
|
}
|
|
@@ -2922,34 +2960,34 @@
|
|
|
2922
2960
|
}
|
|
2923
2961
|
return l;
|
|
2924
2962
|
}
|
|
2925
|
-
function
|
|
2926
|
-
return 0 === xo(t) ||
|
|
2963
|
+
function vl(e, t) {
|
|
2964
|
+
return 0 === xo(t) || yl(e, t, "");
|
|
2927
2965
|
}
|
|
2928
|
-
function
|
|
2929
|
-
e && !
|
|
2966
|
+
function El(e, t, n, r) {
|
|
2967
|
+
e && !Xo(e) && ir("GObj bad instanceof");
|
|
2930
2968
|
let o = {};
|
|
2931
|
-
if (
|
|
2969
|
+
if (Jo(n) && !Zo(n)) {
|
|
2932
2970
|
let l = n;
|
|
2933
|
-
Object.prototype.hasOwnProperty.call(t, l) ?
|
|
2934
|
-
} else if (
|
|
2971
|
+
Object.prototype.hasOwnProperty.call(t, l) ? sl(o, l, t[l]) : r && ir(`${kt(e)}: key not found: ${l}`);
|
|
2972
|
+
} else if (Bo(n) && Vo(n) > 0) for (let l of Object.keys(n)) Object.prototype.hasOwnProperty.call(t, l) ? sl(o, l, t[l]) : r && ir(`${kt(e)}: key not found: ${l}`);
|
|
2935
2973
|
else {
|
|
2936
|
-
if (!(
|
|
2974
|
+
if (!(Yo(n) && Wo(n) > 0)) return t;
|
|
2937
2975
|
for (let l = 0; l < n.length; l++) {
|
|
2938
2976
|
let i = n[l];
|
|
2939
|
-
Object.prototype.hasOwnProperty.call(t, i) ?
|
|
2977
|
+
Object.prototype.hasOwnProperty.call(t, i) ? sl(o, i, t[i]) : r && ir(`${kt(e)}: key not found: ${i}`);
|
|
2940
2978
|
}
|
|
2941
2979
|
}
|
|
2942
2980
|
return o;
|
|
2943
2981
|
}
|
|
2944
|
-
function
|
|
2982
|
+
function Tl(e, t, n, r) {
|
|
2945
2983
|
let o = {};
|
|
2946
|
-
if (!
|
|
2947
|
-
if (Do(o, t),
|
|
2984
|
+
if (!Bo(t)) return o;
|
|
2985
|
+
if (Do(o, t), Jo(n) && !Zo(n)) {
|
|
2948
2986
|
let l = n;
|
|
2949
2987
|
Object.prototype.hasOwnProperty.call(t, l) ? Po(o, l) : r && ir(`${kt(e)}: key not found: ${l}`);
|
|
2950
|
-
} else if (
|
|
2988
|
+
} else if (Bo(n) && Vo(n) > 0) for (let l of Object.keys(n)) Object.prototype.hasOwnProperty.call(t, l) ? Po(o, l) : r && ir(`${kt(e)}: key not found: ${l}`);
|
|
2951
2989
|
else {
|
|
2952
|
-
if (!(
|
|
2990
|
+
if (!(Yo(n) && Wo(n) > 0)) return {};
|
|
2953
2991
|
for (let l = 0; l < n.length; l++) {
|
|
2954
2992
|
let i = n[l];
|
|
2955
2993
|
Object.prototype.hasOwnProperty.call(t, i) ? Po(o, i) : r && ir(`${kt(e)}: key not found: ${i}`);
|
|
@@ -2957,82 +2995,119 @@
|
|
|
2957
2995
|
}
|
|
2958
2996
|
return o;
|
|
2959
2997
|
}
|
|
2960
|
-
|
|
2961
|
-
|
|
2962
|
-
|
|
2998
|
+
function jl() {
|
|
2999
|
+
if ("undefined" == typeof window) return null;
|
|
3000
|
+
let e;
|
|
3001
|
+
try {
|
|
3002
|
+
e = window.localStorage;
|
|
3003
|
+
} catch (e) {
|
|
3004
|
+
const t = () => {
|
|
3005
|
+
throw e;
|
|
3006
|
+
};
|
|
3007
|
+
return {
|
|
3008
|
+
getItem: t,
|
|
3009
|
+
setItem: t,
|
|
3010
|
+
removeItem: t
|
|
3011
|
+
};
|
|
3012
|
+
}
|
|
3013
|
+
return e || null;
|
|
3014
|
+
}
|
|
3015
|
+
var Ol = /* @__PURE__ */ new Set();
|
|
3016
|
+
function Sl(e, t) {
|
|
3017
|
+
Ol.has(e) || (Ol.add(e), sr(t));
|
|
2963
3018
|
}
|
|
2964
|
-
function
|
|
2965
|
-
|
|
2966
|
-
|
|
3019
|
+
function wl(e, t, n = !1) {
|
|
3020
|
+
const r = jl();
|
|
3021
|
+
if (!r) return t;
|
|
3022
|
+
const o = `kw_get_local_storage_value(): localStorage key "${e}"`;
|
|
3023
|
+
let l;
|
|
2967
3024
|
try {
|
|
2968
|
-
|
|
3025
|
+
l = r.getItem(e);
|
|
2969
3026
|
} catch (n) {
|
|
2970
|
-
return
|
|
3027
|
+
return Sl(e, `${o} cannot be read (storage blocked?): the default is used`), t;
|
|
2971
3028
|
}
|
|
2972
|
-
let
|
|
2973
|
-
if (null !==
|
|
2974
|
-
|
|
3029
|
+
let i = !0, s = null;
|
|
3030
|
+
if (null !== l) try {
|
|
3031
|
+
s = JSON.parse(l);
|
|
2975
3032
|
} catch (t) {
|
|
2976
|
-
|
|
3033
|
+
s = null;
|
|
3034
|
+
try {
|
|
3035
|
+
r.removeItem(e), sr(`${o} does not hold json: removed, the default is used`);
|
|
3036
|
+
} catch (t) {
|
|
3037
|
+
i = !1, Sl(e, `${o} does not hold json and cannot be removed: the default is used`);
|
|
3038
|
+
}
|
|
3039
|
+
}
|
|
3040
|
+
if (null === s && (s = t, n)) {
|
|
3041
|
+
const n = Fe(t);
|
|
3042
|
+
if (void 0 === n) ir(`${o}: cannot write the default: a value with no json text`);
|
|
3043
|
+
else try {
|
|
3044
|
+
r.setItem(e, n);
|
|
3045
|
+
} catch (t) {
|
|
3046
|
+
i = !1, Sl(e, `${o} cannot be written (storage full or blocked?): the default is used, not kept`);
|
|
3047
|
+
}
|
|
2977
3048
|
}
|
|
2978
|
-
return
|
|
3049
|
+
return i && Ol.delete(e), s;
|
|
2979
3050
|
}
|
|
2980
|
-
function
|
|
2981
|
-
if (
|
|
2982
|
-
|
|
3051
|
+
function Nl(e, t) {
|
|
3052
|
+
if (!e) return ir(`kw_set_local_storage_value(): invalid key: key=${e}`), -1;
|
|
3053
|
+
const n = Fe(t);
|
|
3054
|
+
if (void 0 === n) return ir(`kw_set_local_storage_value(): cannot save "${e}": a value with no json text`), -1;
|
|
3055
|
+
const r = jl();
|
|
3056
|
+
if (!r) return 0;
|
|
2983
3057
|
try {
|
|
2984
|
-
return
|
|
3058
|
+
return r.setItem(e, n), 0;
|
|
2985
3059
|
} catch (t) {
|
|
2986
3060
|
return ir(`kw_set_local_storage_value(): cannot save "${e}" (storage full or blocked?): ${t && t.message ? t.message : t}`), -1;
|
|
2987
3061
|
}
|
|
2988
3062
|
}
|
|
2989
|
-
function
|
|
2990
|
-
|
|
2991
|
-
|
|
3063
|
+
function $l(e) {
|
|
3064
|
+
const t = jl();
|
|
3065
|
+
if (t) if (e) try {
|
|
3066
|
+
t.removeItem(e);
|
|
2992
3067
|
} catch (t) {
|
|
2993
|
-
|
|
3068
|
+
sr(`kw_remove_local_storage_value(): cannot remove "${e}" (storage blocked?): ${t && t.message ? t.message : t}`);
|
|
2994
3069
|
}
|
|
2995
|
-
else
|
|
3070
|
+
else ir(`kw_remove_local_storage_value(): invalid key: key=${e}`);
|
|
2996
3071
|
}
|
|
2997
|
-
function
|
|
2998
|
-
if (
|
|
2999
|
-
if (
|
|
3072
|
+
function Al(e, t) {
|
|
3073
|
+
if (zo(e) || zo(t)) return !0;
|
|
3074
|
+
if (Yo(e)) {
|
|
3000
3075
|
if (0 === e.length) return !0;
|
|
3001
3076
|
for (let n = 0; n < e.length; n++) if (e[n] === t) return !0;
|
|
3002
|
-
} else if (
|
|
3077
|
+
} else if (Bo(e)) {
|
|
3003
3078
|
if (0 === Object.keys(e).length) return !0;
|
|
3004
3079
|
for (let n in e) if (n === t) return !0;
|
|
3005
|
-
} else if (
|
|
3080
|
+
} else if (Jo(e) && e === t) return !0;
|
|
3006
3081
|
return !1;
|
|
3007
3082
|
}
|
|
3008
|
-
function
|
|
3009
|
-
if (e && !
|
|
3010
|
-
o || (o =
|
|
3083
|
+
function Rl(e, t, n, r, o) {
|
|
3084
|
+
if (e && !Xo(e) && ir("GObj bad instanceof"), !t) return null;
|
|
3085
|
+
o || (o = vl);
|
|
3011
3086
|
let l = [];
|
|
3012
|
-
if (
|
|
3087
|
+
if (Yo(t)) for (let i = 0; i < t.length; i++) {
|
|
3013
3088
|
let s, a = t[i];
|
|
3014
|
-
if (
|
|
3089
|
+
if (Bo(a)) s = gl(e, a, "id", "", 0);
|
|
3015
3090
|
else {
|
|
3016
|
-
if (!
|
|
3091
|
+
if (!Jo(a)) continue;
|
|
3017
3092
|
s = a;
|
|
3018
3093
|
}
|
|
3019
|
-
|
|
3094
|
+
Al(n, s) && o(a, r) && l.push(a);
|
|
3020
3095
|
}
|
|
3021
3096
|
else {
|
|
3022
|
-
if (!
|
|
3097
|
+
if (!Bo(t)) return ir("kw_collect() BAD kw parameter"), null;
|
|
3023
3098
|
for (let e of Object.keys(t)) {
|
|
3024
3099
|
let i = t[e];
|
|
3025
|
-
|
|
3100
|
+
Al(n, e) && o(i, r) && l.push(i);
|
|
3026
3101
|
}
|
|
3027
3102
|
}
|
|
3028
3103
|
return l;
|
|
3029
3104
|
}
|
|
3030
|
-
function
|
|
3105
|
+
function Dl(e, t) {
|
|
3031
3106
|
if (!e) return -1;
|
|
3032
3107
|
for (let n = 0; n < e.length; n++) if (e[n] && e[n].id === t) return n;
|
|
3033
3108
|
return -1;
|
|
3034
3109
|
}
|
|
3035
|
-
function
|
|
3110
|
+
function kl(e, t, n) {
|
|
3036
3111
|
if (!e || !t) return ir("ERROR: str_in_list() list or str empty"), !1;
|
|
3037
3112
|
let r = e.length;
|
|
3038
3113
|
if (n) {
|
|
@@ -3044,7 +3119,7 @@
|
|
|
3044
3119
|
} else for (let n = 0; n < r; n++) if (e[n] === t) return !0;
|
|
3045
3120
|
return !1;
|
|
3046
3121
|
}
|
|
3047
|
-
function
|
|
3122
|
+
function Cl(e, t) {
|
|
3048
3123
|
try {
|
|
3049
3124
|
let n = e.__md_iev__;
|
|
3050
3125
|
if (n) return n[t];
|
|
@@ -3052,35 +3127,35 @@
|
|
|
3052
3127
|
return;
|
|
3053
3128
|
}
|
|
3054
3129
|
}
|
|
3055
|
-
function
|
|
3130
|
+
function Il(e, t, n) {
|
|
3056
3131
|
let r = e.__md_iev__;
|
|
3057
3132
|
r || (r = {}, e.__md_iev__ = r), r[t] = n;
|
|
3058
3133
|
}
|
|
3059
|
-
function
|
|
3060
|
-
if (!
|
|
3134
|
+
function Pl(e, t, n, r) {
|
|
3135
|
+
if (!Xo(e)) return ir("gobj is not a GObj"), null;
|
|
3061
3136
|
if (!t) return;
|
|
3062
|
-
let o =
|
|
3063
|
-
o || (o = [],
|
|
3137
|
+
let o = Cl(t, n);
|
|
3138
|
+
o || (o = [], Il(t, n, o));
|
|
3064
3139
|
try {
|
|
3065
|
-
|
|
3140
|
+
Yo(o) && o.unshift(r);
|
|
3066
3141
|
} catch (e) {
|
|
3067
3142
|
ir(e);
|
|
3068
3143
|
}
|
|
3069
3144
|
}
|
|
3070
|
-
function
|
|
3071
|
-
if (!
|
|
3072
|
-
if (!
|
|
3073
|
-
let o =
|
|
3145
|
+
function Ll(e, t, n, r) {
|
|
3146
|
+
if (!Xo(e)) return ir("gobj is not a GObj"), null;
|
|
3147
|
+
if (!Bo(t)) return ir("kw is not a dict"), null;
|
|
3148
|
+
let o = Cl(t, n);
|
|
3074
3149
|
return o ? 0 === o.length ? (r && ir(`stack empty: ${n}`), null) : o[0] : (r && ir(`stack NOT FOUND: ${n}`), null);
|
|
3075
3150
|
}
|
|
3076
|
-
function
|
|
3077
|
-
return
|
|
3151
|
+
function Ul(e, t, n) {
|
|
3152
|
+
return Zo(n) ? _l(e, t, "__md_iev__`__msg_type__") : hl(e, t, "__md_iev__", "__msg_type__", n), 0;
|
|
3078
3153
|
}
|
|
3079
|
-
function
|
|
3080
|
-
return
|
|
3154
|
+
function Fl(e, t) {
|
|
3155
|
+
return gl(e, t, "__md_iev__`__msg_type__", "", 0);
|
|
3081
3156
|
}
|
|
3082
|
-
function
|
|
3083
|
-
void 0 !== n &&
|
|
3157
|
+
function Ml(e, t, n) {
|
|
3158
|
+
void 0 !== n && Jo(n) || (n = "");
|
|
3084
3159
|
for (let r of Object.keys(e)) {
|
|
3085
3160
|
if (!Object.prototype.hasOwnProperty.call(e, r)) continue;
|
|
3086
3161
|
let o = (n.length ? "`" : "") + r;
|
|
@@ -3089,10 +3164,10 @@
|
|
|
3089
3164
|
r,
|
|
3090
3165
|
e[r],
|
|
3091
3166
|
n
|
|
3092
|
-
]),
|
|
3167
|
+
]), Bo(e[r]) && Ml(e[r], t, n), n = n.slice(0, -o.length);
|
|
3093
3168
|
}
|
|
3094
3169
|
}
|
|
3095
|
-
function
|
|
3170
|
+
function Gl(e, t, n, r) {
|
|
3096
3171
|
if (!e) return null;
|
|
3097
3172
|
let o, l = e.length;
|
|
3098
3173
|
for (o = 0; o < l; o++) {
|
|
@@ -3100,15 +3175,15 @@
|
|
|
3100
3175
|
if (l) {
|
|
3101
3176
|
let e = l.id;
|
|
3102
3177
|
if (e && e === n) return l;
|
|
3103
|
-
if (r &&
|
|
3104
|
-
let e =
|
|
3178
|
+
if (r && ll(l, t)) {
|
|
3179
|
+
let e = Gl(l[t], t, n, r);
|
|
3105
3180
|
if (e) return e;
|
|
3106
3181
|
}
|
|
3107
3182
|
}
|
|
3108
3183
|
}
|
|
3109
3184
|
return null;
|
|
3110
3185
|
}
|
|
3111
|
-
function
|
|
3186
|
+
function Vl(e) {
|
|
3112
3187
|
function t(e) {
|
|
3113
3188
|
let t = e.replace(/-/g, "+").replace(/_/g, "/");
|
|
3114
3189
|
switch (t.length % 4) {
|
|
@@ -3139,10 +3214,10 @@
|
|
|
3139
3214
|
signature: t(n[2])
|
|
3140
3215
|
};
|
|
3141
3216
|
}
|
|
3142
|
-
function
|
|
3217
|
+
function Wl(e) {
|
|
3143
3218
|
return null == e ? "" : String(e).replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
3144
3219
|
}
|
|
3145
|
-
var
|
|
3220
|
+
var xl = class {
|
|
3146
3221
|
constructor(e) {
|
|
3147
3222
|
this.html = e, Object.freeze(this);
|
|
3148
3223
|
}
|
|
@@ -3150,41 +3225,68 @@
|
|
|
3150
3225
|
return this.html;
|
|
3151
3226
|
}
|
|
3152
3227
|
};
|
|
3153
|
-
function
|
|
3154
|
-
return e instanceof
|
|
3228
|
+
function Kl(e) {
|
|
3229
|
+
return e instanceof xl;
|
|
3155
3230
|
}
|
|
3156
|
-
function
|
|
3231
|
+
function Bl(e) {
|
|
3157
3232
|
const t = document.createElement("template");
|
|
3158
3233
|
return t.innerHTML = e.html.trim(), t.content;
|
|
3159
3234
|
}
|
|
3160
|
-
var
|
|
3161
|
-
function
|
|
3235
|
+
var Yl = !1, Jl = /* @__PURE__ */ new Set();
|
|
3236
|
+
function ql(e) {
|
|
3162
3237
|
const t = document.createElement("template");
|
|
3163
3238
|
return t.innerHTML = e.trim(), t.content.firstChild;
|
|
3164
3239
|
}
|
|
3165
|
-
function
|
|
3240
|
+
function Hl(e) {
|
|
3166
3241
|
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), o = e.getTimezoneOffset();
|
|
3167
3242
|
return `${n}.${r}${o > 0 ? "-" : "+"}${t(Math.floor(Math.abs(o) / 60), 2)}${t(Math.abs(o) % 60, 2)}`;
|
|
3168
3243
|
}
|
|
3169
|
-
function
|
|
3244
|
+
function zl(e, t) {
|
|
3170
3245
|
if (!e) throw "ERROR: index_in_list() list empty";
|
|
3171
3246
|
for (let n = 0; n < e.length; n++) if (t === e[n]) return n;
|
|
3172
3247
|
return -1;
|
|
3173
3248
|
}
|
|
3174
|
-
function
|
|
3175
|
-
|
|
3176
|
-
|
|
3249
|
+
function Ql() {
|
|
3250
|
+
const e = "undefined" != typeof window && window.crypto || globalThis.crypto;
|
|
3251
|
+
if (e && "function" == typeof e.randomUUID) return e.randomUUID();
|
|
3252
|
+
const t = /* @__PURE__ */ new Uint8Array(16);
|
|
3253
|
+
if (e && "function" == typeof e.getRandomValues) e.getRandomValues(t);
|
|
3254
|
+
else for (let e = 0; e < t.length; e++) t[e] = Math.floor(256 * Math.random());
|
|
3255
|
+
t[6] = 15 & t[6] | 64, t[8] = 63 & t[8] | 128;
|
|
3256
|
+
const n = Array.from(t, (e) => e.toString(16).padStart(2, "0")).join("");
|
|
3257
|
+
return `${n.slice(0, 8)}-${n.slice(8, 12)}-${n.slice(12, 16)}-${n.slice(16, 20)}-${n.slice(20)}`;
|
|
3258
|
+
}
|
|
3259
|
+
var Xl = null;
|
|
3260
|
+
function Zl() {
|
|
3261
|
+
if (Xl) return Xl;
|
|
3262
|
+
const e = jl();
|
|
3263
|
+
if (!e) return Xl = Ql();
|
|
3264
|
+
let t = null;
|
|
3265
|
+
try {
|
|
3266
|
+
t = e.getItem("host_uuid");
|
|
3267
|
+
} catch (e) {
|
|
3268
|
+
return Sl("host_uuid", "node_uuid(): localStorage cannot be read (storage blocked?): a uuid of this page only"), Xl = Ql();
|
|
3269
|
+
}
|
|
3270
|
+
if (!t) {
|
|
3271
|
+
t = Ql();
|
|
3272
|
+
try {
|
|
3273
|
+
e.setItem("host_uuid", t);
|
|
3274
|
+
} catch (e) {
|
|
3275
|
+
Sl("host_uuid", "node_uuid(): localStorage cannot be written (storage full or blocked?): a uuid of this page only");
|
|
3276
|
+
}
|
|
3277
|
+
}
|
|
3278
|
+
return Xl = t;
|
|
3177
3279
|
}
|
|
3178
|
-
function
|
|
3280
|
+
function ei(e) {
|
|
3179
3281
|
let t = null;
|
|
3180
3282
|
return "function" != typeof e && "object" != typeof e || (t = ("" + e).match(/function\s*([\w\$]*)\s*\(/)), null !== t ? t[1] + "()" : "";
|
|
3181
3283
|
}
|
|
3182
|
-
var
|
|
3183
|
-
function
|
|
3284
|
+
var ti = 256, ni = 1e5;
|
|
3285
|
+
function ri(e) {
|
|
3184
3286
|
const t = String(e).replace(/`/g, "``");
|
|
3185
3287
|
return "[" === t[0] ? "[" + t : t;
|
|
3186
3288
|
}
|
|
3187
|
-
function
|
|
3289
|
+
function oi(e) {
|
|
3188
3290
|
if ("string" != typeof e) return null;
|
|
3189
3291
|
let t = [], n = "";
|
|
3190
3292
|
for (let r = 0; r < e.length; r++) if ("`" !== e[r]) n += e[r];
|
|
@@ -3205,14 +3307,14 @@
|
|
|
3205
3307
|
return null !== t ? t : "[" === e[0] && "[" === e[1] ? e.slice(1) : e;
|
|
3206
3308
|
});
|
|
3207
3309
|
}
|
|
3208
|
-
function
|
|
3310
|
+
function li(e, t) {
|
|
3209
3311
|
return e === t || null !== e && null !== t && "object" == typeof e && "object" == typeof t && JSON.stringify(e) === JSON.stringify(t);
|
|
3210
3312
|
}
|
|
3211
|
-
function
|
|
3313
|
+
function ii(e) {
|
|
3212
3314
|
return "persistent-attrs-" + kt(e);
|
|
3213
3315
|
}
|
|
3214
|
-
function
|
|
3215
|
-
if (
|
|
3316
|
+
function si(e, t) {
|
|
3317
|
+
if (Jo(t)) {
|
|
3216
3318
|
if (-1 === t.indexOf("^")) {
|
|
3217
3319
|
let n, r, o = e.fkey;
|
|
3218
3320
|
if (1 !== Vo(o)) return ir("bad fkey 1"), ir(e), ir(t), null;
|
|
@@ -3235,13 +3337,13 @@
|
|
|
3235
3337
|
};
|
|
3236
3338
|
}
|
|
3237
3339
|
}
|
|
3238
|
-
return
|
|
3340
|
+
return Bo(t) ? {
|
|
3239
3341
|
topic_name: t.topic_name,
|
|
3240
3342
|
id: t.id,
|
|
3241
3343
|
hook_name: t.hook_name
|
|
3242
3344
|
} : (ir("bad fkey 3"), ir(e), ir(t), null);
|
|
3243
3345
|
}
|
|
3244
|
-
var
|
|
3346
|
+
var ai = [
|
|
3245
3347
|
"string",
|
|
3246
3348
|
"integer",
|
|
3247
3349
|
"object",
|
|
@@ -3251,7 +3353,7 @@
|
|
|
3251
3353
|
"real",
|
|
3252
3354
|
"boolean",
|
|
3253
3355
|
"blob"
|
|
3254
|
-
],
|
|
3356
|
+
], ui = [
|
|
3255
3357
|
"persistent",
|
|
3256
3358
|
"required",
|
|
3257
3359
|
"notnull",
|
|
@@ -3263,7 +3365,7 @@
|
|
|
3263
3365
|
"stats",
|
|
3264
3366
|
"rstats",
|
|
3265
3367
|
"pstats"
|
|
3266
|
-
],
|
|
3368
|
+
], _i = [
|
|
3267
3369
|
"hook",
|
|
3268
3370
|
"fkey",
|
|
3269
3371
|
"enum",
|
|
@@ -3292,7 +3394,7 @@
|
|
|
3292
3394
|
"coordinates",
|
|
3293
3395
|
"gbuffer"
|
|
3294
3396
|
];
|
|
3295
|
-
function
|
|
3397
|
+
function ci(e) {
|
|
3296
3398
|
let t = {
|
|
3297
3399
|
name: e.id,
|
|
3298
3400
|
header: e.header,
|
|
@@ -3311,7 +3413,7 @@
|
|
|
3311
3413
|
if (!e.flag) return t;
|
|
3312
3414
|
for (let n = 0; n < e.flag.length; n++) {
|
|
3313
3415
|
let r = e.flag[n];
|
|
3314
|
-
if (
|
|
3416
|
+
if (kl(_i, r)) {
|
|
3315
3417
|
switch (r) {
|
|
3316
3418
|
case "enum":
|
|
3317
3419
|
t.enum_list = e.enum;
|
|
@@ -3325,7 +3427,7 @@
|
|
|
3325
3427
|
case "file": t.is_file = !0;
|
|
3326
3428
|
}
|
|
3327
3429
|
t.type = r;
|
|
3328
|
-
} else if (
|
|
3430
|
+
} else if (kl(ui, r)) switch (r) {
|
|
3329
3431
|
case "writable":
|
|
3330
3432
|
t.is_writable = !0;
|
|
3331
3433
|
break;
|
|
@@ -3338,23 +3440,23 @@
|
|
|
3338
3440
|
}
|
|
3339
3441
|
return t.is_file && (t.type = "file"), t;
|
|
3340
3442
|
}
|
|
3341
|
-
var
|
|
3443
|
+
var fi = [
|
|
3342
3444
|
k(E.DTP_POINTER, "subscriber", 0, null, "Subscriber of output events"),
|
|
3343
3445
|
k(E.DTP_BOOLEAN, "periodic", 0, 0, "True for periodic timeouts"),
|
|
3344
3446
|
k(E.DTP_INTEGER, "msec", 0, 0, "Timeout in milliseconds"),
|
|
3345
3447
|
D()
|
|
3346
|
-
],
|
|
3448
|
+
], gi = {
|
|
3347
3449
|
periodic: !1,
|
|
3348
3450
|
msec: 0,
|
|
3349
3451
|
timer_id: -1
|
|
3350
|
-
},
|
|
3351
|
-
function
|
|
3452
|
+
}, di = null;
|
|
3453
|
+
function bi(e, t, n, r) {
|
|
3352
3454
|
let o = e.priv, l = o.periodic ? "EV_TIMEOUT_PERIODIC" : "EV_TIMEOUT";
|
|
3353
3455
|
return o.periodic && o.msec > 0 ? o.timer_id = setTimeout(function() {
|
|
3354
3456
|
jn(e, "EV_TIMEOUT", {}, e);
|
|
3355
3457
|
}, o.msec) : o.timer_id = -1, Ln(e, l, {}), o.periodic || -1 !== o.timer_id || Tt(e) && mt(e), 0;
|
|
3356
3458
|
}
|
|
3357
|
-
var
|
|
3459
|
+
var pi = {
|
|
3358
3460
|
mt_create: function(e) {
|
|
3359
3461
|
let t = e.priv, n = nn(e, "subscriber");
|
|
3360
3462
|
n ? kn(e, null, {}, n) : Lt(e) && (n = It(e), kn(e, null, {}, n)), t.periodic = Zt(e, "periodic"), t.msec = en(e, "msec");
|
|
@@ -3378,19 +3480,19 @@
|
|
|
3378
3480
|
},
|
|
3379
3481
|
mt_destroy: function(e) {}
|
|
3380
3482
|
};
|
|
3381
|
-
function
|
|
3483
|
+
function mi(e) {
|
|
3382
3484
|
return "number" == typeof e && Number.isFinite(e) ? Math.round(e) : e;
|
|
3383
3485
|
}
|
|
3384
|
-
function
|
|
3385
|
-
return e instanceof I ? "C_TIMER" !== Dt(e) ? (ir("not C_TIMER GObj"), -1) : (an(e, "periodic", !1), void un(e, "msec",
|
|
3486
|
+
function hi(e, t) {
|
|
3487
|
+
return e instanceof I ? "C_TIMER" !== Dt(e) ? (ir("not C_TIMER GObj"), -1) : (an(e, "periodic", !1), void un(e, "msec", mi(t))) : (ir("not GObj TYPE"), -1);
|
|
3386
3488
|
}
|
|
3387
|
-
function
|
|
3388
|
-
return e instanceof I ? "C_TIMER" !== Dt(e) ? (ir("not C_TIMER GObj"), -1) : (an(e, "periodic", !0), void un(e, "msec",
|
|
3489
|
+
function yi(e, t) {
|
|
3490
|
+
return e instanceof I ? "C_TIMER" !== Dt(e) ? (ir("not C_TIMER GObj"), -1) : (an(e, "periodic", !0), void un(e, "msec", mi(t))) : (ir("not GObj TYPE"), -1);
|
|
3389
3491
|
}
|
|
3390
|
-
function
|
|
3492
|
+
function vi(e) {
|
|
3391
3493
|
return e instanceof I ? "C_TIMER" !== Dt(e) ? (ir("not C_TIMER GObj"), -1) : void un(e, "msec", -1) : (ir("not GObj TYPE"), -1);
|
|
3392
3494
|
}
|
|
3393
|
-
var
|
|
3495
|
+
var Ei = [
|
|
3394
3496
|
k(E.DTP_BOOLEAN, "changesLost", 0, !1, "Set true to warn about leaving page"),
|
|
3395
3497
|
k(E.DTP_BOOLEAN, "browser_beforeunload", 0, !1, "Set true to refreshing browser"),
|
|
3396
3498
|
k(E.DTP_STRING, "__username__", 0, "", "Username"),
|
|
@@ -3410,60 +3512,60 @@
|
|
|
3410
3512
|
k(E.DTP_BOOLEAN, "developer", 0, !1, "Developer mode enabled"),
|
|
3411
3513
|
k(E.DTP_INTEGER, "periodic_timeout", 0, "1000", "Timeout periodic, in miliseconds."),
|
|
3412
3514
|
D()
|
|
3413
|
-
],
|
|
3414
|
-
function
|
|
3515
|
+
], Ti = { gobj_timer: null }, ji = null;
|
|
3516
|
+
function Oi(e, t, n, r) {
|
|
3415
3517
|
let o = Qt(e, t);
|
|
3416
|
-
return
|
|
3518
|
+
return Bo(o) || (o = {}), o[n] = r, rn(e, t, o), it(e, t);
|
|
3417
3519
|
}
|
|
3418
|
-
var
|
|
3419
|
-
function
|
|
3520
|
+
var Si = -2147483648, wi = 2147483647;
|
|
3521
|
+
function Ni(e) {
|
|
3420
3522
|
if (!0 === e || !1 === e) return e;
|
|
3421
|
-
if ("number" == typeof e) return !Number.isInteger(e) || e <
|
|
3523
|
+
if ("number" == typeof e) return !Number.isInteger(e) || e < Si || e > wi ? null : 0 !== e;
|
|
3422
3524
|
if ("string" != typeof e || "" === e) return null;
|
|
3423
3525
|
let t = e.toLowerCase();
|
|
3424
3526
|
if ("set" === t) return !0;
|
|
3425
3527
|
if ("reset" === t) return !1;
|
|
3426
3528
|
if (/^-?(0|[1-9][0-9]*)$/.test(e)) {
|
|
3427
3529
|
let t = Number(e);
|
|
3428
|
-
return t <
|
|
3530
|
+
return t < Si || t > wi ? null : 0 !== t;
|
|
3429
3531
|
}
|
|
3430
3532
|
return "true" === t || "yes" === t || "on" === t || "false" !== t && "no" !== t && "off" !== t && null;
|
|
3431
3533
|
}
|
|
3432
|
-
function
|
|
3534
|
+
function $i() {
|
|
3433
3535
|
return `${$t()}^${Nt()}`;
|
|
3434
3536
|
}
|
|
3435
|
-
function
|
|
3537
|
+
function Ai(e, t, n, r) {
|
|
3436
3538
|
return Ln(e, t, n), 0;
|
|
3437
3539
|
}
|
|
3438
|
-
var
|
|
3540
|
+
var Ri = {
|
|
3439
3541
|
mt_create: function(e) {
|
|
3440
3542
|
let t = e.priv;
|
|
3441
|
-
_n(e, "start_date",
|
|
3543
|
+
_n(e, "start_date", Hl()), _n(e, "node_uuid", Zl()), e.priv.gobj_timer = _t(Rt(e), "C_TIMER", {}, e), t.periodic_timeout = Qt(e, "periodic_timeout"), function(e) {
|
|
3442
3544
|
let t = Qt(e, "trace_levels");
|
|
3443
|
-
if (!
|
|
3545
|
+
if (!Bo(t)) return 0;
|
|
3444
3546
|
let n = t.__global_trace__;
|
|
3445
|
-
if (
|
|
3547
|
+
if (Yo(n)) {
|
|
3446
3548
|
ae(4294967295, !1);
|
|
3447
3549
|
for (let e of n) ie(e, !0);
|
|
3448
3550
|
}
|
|
3449
3551
|
for (const [n, r] of Object.entries(t)) {
|
|
3450
3552
|
let t = et(n);
|
|
3451
|
-
if (t) if (
|
|
3553
|
+
if (t) if (Yo(r)) {
|
|
3452
3554
|
be(t, null, !1);
|
|
3453
3555
|
for (let e of r) be(t, e, !0);
|
|
3454
3556
|
} else ir(`${Rt(e)}: trace_levels of ${n} MUST be a list`);
|
|
3455
3557
|
}
|
|
3456
3558
|
}(e), function(e) {
|
|
3457
3559
|
let t = Qt(e, "no_trace_levels");
|
|
3458
|
-
if (!
|
|
3560
|
+
if (!Bo(t)) return 0;
|
|
3459
3561
|
let n = t.__global_no_trace__;
|
|
3460
|
-
if (
|
|
3562
|
+
if (Yo(n)) {
|
|
3461
3563
|
ue(4294967295, !1);
|
|
3462
3564
|
for (let e of n) se(e, !0);
|
|
3463
3565
|
}
|
|
3464
3566
|
for (const [n, r] of Object.entries(t)) {
|
|
3465
3567
|
let t = et(n);
|
|
3466
|
-
if (t) if (
|
|
3568
|
+
if (t) if (Yo(r)) {
|
|
3467
3569
|
pe(t, null, !1);
|
|
3468
3570
|
for (let e of r) pe(t, e, !0);
|
|
3469
3571
|
} else ir(`${Rt(e)}: no_trace_levels of ${n} MUST be a list`);
|
|
@@ -3472,10 +3574,10 @@
|
|
|
3472
3574
|
},
|
|
3473
3575
|
mt_writing: function(e, t) {},
|
|
3474
3576
|
mt_start: function(e) {
|
|
3475
|
-
return
|
|
3577
|
+
return yi(e.priv.gobj_timer, e.priv.periodic_timeout), 0;
|
|
3476
3578
|
},
|
|
3477
3579
|
mt_stop: function(e) {
|
|
3478
|
-
return
|
|
3580
|
+
return vi(e.priv.gobj_timer), yt(e), 0;
|
|
3479
3581
|
},
|
|
3480
3582
|
mt_destroy: function(e) {},
|
|
3481
3583
|
mt_play: function(e) {
|
|
@@ -3492,24 +3594,24 @@
|
|
|
3492
3594
|
case "get-global-no-trace": return o(0, 0, null, null, ce());
|
|
3493
3595
|
case "set-global-trace":
|
|
3494
3596
|
case "set-global-no-trace": {
|
|
3495
|
-
let r = "set-global-no-trace" === t, l = n.level, i =
|
|
3496
|
-
return l ? null === i ? o(0, -1, `${
|
|
3597
|
+
let r = "set-global-no-trace" === t, l = n.level, i = Ni(n.set);
|
|
3598
|
+
return l ? null === i ? o(0, -1, `${$i()}: bitmask set or re-set?`, null, null) : (r ? se(l, i) : ie(l, i)) < 0 ? o(0, -1, `${$i()}: global trace level not found: ${l}`, null, null) : r ? (Oi(e, "no_trace_levels", "__global_no_trace__", ce()), o(0, 0, null, null, ce())) : (Oi(e, "trace_levels", "__global_trace__", _e()), o(0, 0, null, null, _e())) : o(0, -1, `${$i()}: what level?`, null, null);
|
|
3497
3599
|
}
|
|
3498
3600
|
case "get-gclass-trace":
|
|
3499
3601
|
case "get-gclass-no-trace":
|
|
3500
3602
|
case "set-gclass-trace":
|
|
3501
3603
|
case "set-gclass-no-trace": {
|
|
3502
3604
|
let r = t.indexOf("no-trace") >= 0, l = n.gclass_name || n.gclass || "", i = et(l);
|
|
3503
|
-
if (!i) return o(0, -1, `${
|
|
3605
|
+
if (!i) return o(0, -1, `${$i()}: what gclass is '${l}'?`, null, null);
|
|
3504
3606
|
if (0 === t.indexOf("get-")) return o(0, 0, null, null, r ? de(i) : fe(i));
|
|
3505
|
-
let s = n.level, a =
|
|
3506
|
-
return s ? null === a ? o(0, -1, `${
|
|
3607
|
+
let s = n.level, a = Ni(n.set);
|
|
3608
|
+
return s ? null === a ? o(0, -1, `${$i()}: bitmask set or re-set?`, null, null) : (r ? pe(i, s, a) : be(i, s, a)) < 0 ? o(0, -1, `${$i()}: trace level of ${l} not found: ${s}`, null, null) : r ? (Oi(e, "no_trace_levels", l, de(i)), o(0, 0, null, null, de(i))) : (Oi(e, "trace_levels", l, ge(i)), o(0, 0, null, null, fe(i))) : o(0, -1, `${$i()}: what level?`, null, null);
|
|
3507
3609
|
}
|
|
3508
|
-
default: return o(0, -1, `${
|
|
3610
|
+
default: return o(0, -1, `${$i()}: command not available: ${t}`, null, null);
|
|
3509
3611
|
}
|
|
3510
3612
|
}
|
|
3511
3613
|
};
|
|
3512
|
-
var
|
|
3614
|
+
var Di = "ievent_gate_stack", ki = [
|
|
3513
3615
|
k(E.DTP_STRING, "wanted_yuno_role", A.SDF_RD, "", "wanted yuno role"),
|
|
3514
3616
|
k(E.DTP_STRING, "wanted_yuno_name", A.SDF_RD, "", "wanted yuno name"),
|
|
3515
3617
|
k(E.DTP_STRING, "wanted_yuno_service", A.SDF_RD, "", "wanted yuno service"),
|
|
@@ -3521,20 +3623,20 @@
|
|
|
3521
3623
|
k(E.DTP_STRING, "cert_pem", A.SDF_PERSIST, "", "SSL server certification, PEM str format"),
|
|
3522
3624
|
k(E.DTP_JSON, "extra_info", A.SDF_RD, "{}", "dict data set by user, added to the identity card msg."),
|
|
3523
3625
|
k(E.DTP_LIST, "required_services", A.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."),
|
|
3524
|
-
k(E.DTP_INTEGER, "timeout_retry", A.SDF_RD, "5000", "
|
|
3626
|
+
k(E.DTP_INTEGER, "timeout_retry", A.SDF_RD, "5000", "Base of the first reconnect delay (ms, ±20% jitter), at least 1000. It BACKS OFF from here, doubling up to timeout_retry_max, and resets when a session is reached"),
|
|
3525
3627
|
k(E.DTP_INTEGER, "timeout_retry_max", A.SDF_RD, "60000", "Cap of the reconnect backoff (ms). Set it equal to timeout_retry for the old fixed-interval behaviour"),
|
|
3526
3628
|
k(E.DTP_INTEGER, "timeout_idack", A.SDF_RD, "5000", "timeout waiting idAck"),
|
|
3527
3629
|
k(E.DTP_POINTER, "subscriber", 0, 0, "subscriber of output-events. If null then subscriber is the parent"),
|
|
3528
3630
|
D()
|
|
3529
|
-
],
|
|
3631
|
+
], Ci = [
|
|
3530
3632
|
["ievents", "Trace inter-events with metadata of kw"],
|
|
3531
3633
|
["ievents2", "Trace inter-events with full kw"],
|
|
3532
3634
|
["identity-card", "Trace identity_card messages"]
|
|
3533
3635
|
];
|
|
3534
|
-
function
|
|
3636
|
+
function Ii(e) {
|
|
3535
3637
|
return !!(3 & X(e));
|
|
3536
3638
|
}
|
|
3537
|
-
var
|
|
3639
|
+
var Pi = {
|
|
3538
3640
|
url: null,
|
|
3539
3641
|
remote_yuno_name: null,
|
|
3540
3642
|
remote_yuno_role: null,
|
|
@@ -3545,9 +3647,10 @@
|
|
|
3545
3647
|
inside_on_open: !1,
|
|
3546
3648
|
retry_ms: 0,
|
|
3547
3649
|
retry_ms_before_session: 0,
|
|
3548
|
-
session_since: 0
|
|
3549
|
-
|
|
3550
|
-
|
|
3650
|
+
session_since: 0,
|
|
3651
|
+
retry_floor_warned: !1
|
|
3652
|
+
}, Li = null;
|
|
3653
|
+
function Ui(e) {
|
|
3551
3654
|
e.priv.websocket && ir("Websocket ALREADY setup");
|
|
3552
3655
|
const t = tn(e, "url");
|
|
3553
3656
|
ar(`====> Starting WebSocket to '${t}' (${kt(e)})`);
|
|
@@ -3562,7 +3665,7 @@
|
|
|
3562
3665
|
code: 1006,
|
|
3563
3666
|
reason: r.message,
|
|
3564
3667
|
was_clean: !1
|
|
3565
|
-
}, e) < 0 &&
|
|
3668
|
+
}, e) < 0 && hi(e.priv.gobj_timer, Zi(e)), null;
|
|
3566
3669
|
}
|
|
3567
3670
|
return r ? (r.onopen = () => {
|
|
3568
3671
|
n !== e.priv.ws_seq || Ut(e) || jn(e, "EV_ON_OPEN", {
|
|
@@ -3584,7 +3687,7 @@
|
|
|
3584
3687
|
}, e));
|
|
3585
3688
|
}, r) : (ir(`${kt(e)}: Failed to initialize WebSocket.`), null);
|
|
3586
3689
|
}
|
|
3587
|
-
function
|
|
3690
|
+
function Fi(e, t = 1e3, n = "") {
|
|
3588
3691
|
let r = e.priv, o = r.websocket;
|
|
3589
3692
|
if (r.websocket = null, o && o.readyState !== WebSocket.CLOSED && o.readyState !== WebSocket.CLOSING) {
|
|
3590
3693
|
ar(`Closing WebSocket (Code: ${t}, Reason: "${n}")`);
|
|
@@ -3595,12 +3698,12 @@
|
|
|
3595
3698
|
}
|
|
3596
3699
|
} else sr("WebSocket is already closed or in the process of closing.");
|
|
3597
3700
|
}
|
|
3598
|
-
function
|
|
3701
|
+
function Mi(e, t) {
|
|
3599
3702
|
let n = e.priv;
|
|
3600
|
-
"ST_SESSION" === fn(e) && (performance.now() - n.session_since <
|
|
3703
|
+
"ST_SESSION" === fn(e) && (performance.now() - n.session_since < Xi(e).max && (n.retry_ms = n.retry_ms_before_session), n.retry_ms_before_session = 0), Fi(e, 4002, t);
|
|
3601
3704
|
}
|
|
3602
|
-
var
|
|
3603
|
-
function
|
|
3705
|
+
var Gi = 128;
|
|
3706
|
+
function Vi(e, t) {
|
|
3604
3707
|
let n = String(e), r = To(n);
|
|
3605
3708
|
if (null !== r && (n = r), n.length > t) {
|
|
3606
3709
|
let e = t, r = n.charCodeAt(e);
|
|
@@ -3608,25 +3711,25 @@
|
|
|
3608
3711
|
}
|
|
3609
3712
|
return n;
|
|
3610
3713
|
}
|
|
3611
|
-
function
|
|
3612
|
-
let r =
|
|
3714
|
+
function Wi(e, t, n) {
|
|
3715
|
+
let r = Hl();
|
|
3613
3716
|
try {
|
|
3614
3717
|
ar("\n" + r + " " + t + "\n"), $o(n);
|
|
3615
3718
|
} catch (e) {
|
|
3616
3719
|
ar("ERROR in trace_inter_event: " + e);
|
|
3617
3720
|
}
|
|
3618
3721
|
}
|
|
3619
|
-
var
|
|
3722
|
+
var xi = class {
|
|
3620
3723
|
constructor(e, t) {
|
|
3621
3724
|
this.event = e, this.kw = t || {};
|
|
3622
3725
|
}
|
|
3623
3726
|
};
|
|
3624
|
-
function
|
|
3727
|
+
function Ki(e, t, n, r) {
|
|
3625
3728
|
return function(e, t) {
|
|
3626
3729
|
let n = e.priv, r = JSON.stringify(t);
|
|
3627
|
-
if (
|
|
3730
|
+
if (Ii(e)) {
|
|
3628
3731
|
let n = tn(e, "url"), o = Rt(wt()) + " ==> " + n, l = Qt(wt(), "trace_ievent_callback");
|
|
3629
|
-
l ? l(o, t, 1, r.length) :
|
|
3732
|
+
l ? l(o, t, 1, r.length) : Wi(0, o, t);
|
|
3630
3733
|
}
|
|
3631
3734
|
if (!n.websocket || n.websocket.readyState !== WebSocket.OPEN) return sr(`${kt(e)}: send_iev(): websocket not open, message lost`), -1;
|
|
3632
3735
|
try {
|
|
@@ -3636,21 +3739,21 @@
|
|
|
3636
3739
|
}
|
|
3637
3740
|
return 0;
|
|
3638
3741
|
}(e, function(e, t) {
|
|
3639
|
-
return
|
|
3742
|
+
return Zo(e) ? (ir("iev_create() event NULL"), null) : new xi(e, t);
|
|
3640
3743
|
}(t, n));
|
|
3641
3744
|
}
|
|
3642
|
-
function
|
|
3643
|
-
return
|
|
3745
|
+
function Bi(e, t, n) {
|
|
3746
|
+
return Zo(n) && (n = tn(e, "wanted_yuno_service")), {
|
|
3644
3747
|
dst_yuno: tn(e, "wanted_yuno_name"),
|
|
3645
3748
|
dst_role: tn(e, "wanted_yuno_role"),
|
|
3646
3749
|
dst_service: n,
|
|
3647
3750
|
src_yuno: Nt(),
|
|
3648
3751
|
src_role: $t(),
|
|
3649
3752
|
src_service: t,
|
|
3650
|
-
host:
|
|
3753
|
+
host: Zl()
|
|
3651
3754
|
};
|
|
3652
3755
|
}
|
|
3653
|
-
function
|
|
3756
|
+
function Yi(e) {
|
|
3654
3757
|
let t = e.priv, n = St(wt()), r = tn(wt(), "yuno_version"), o = tn(wt(), "yuno_release"), l = tn(wt(), "yuno_tag"), s = Qt(e, "required_services");
|
|
3655
3758
|
s && s.length || (s = Qt(wt(), "required_services"));
|
|
3656
3759
|
let a = {
|
|
@@ -3668,32 +3771,32 @@
|
|
|
3668
3771
|
username: tn(wt(), "__username__"),
|
|
3669
3772
|
launch_id: 0,
|
|
3670
3773
|
yuno_startdate: tn(wt(), "start_date"),
|
|
3671
|
-
id:
|
|
3774
|
+
id: Zl(),
|
|
3672
3775
|
user_agent: "undefined" != typeof window ? window.navigator.userAgent : "",
|
|
3673
3776
|
language: "undefined" != typeof window ? window.navigator.language : "",
|
|
3674
3777
|
required_services: s
|
|
3675
3778
|
};
|
|
3676
|
-
return
|
|
3779
|
+
return Pl(e, a, Di, Bi(e, Rt(It(e)), null)), Ul(e, a, "__identity__"), hi(t.gobj_timer, en(e, "timeout_idack")), Ki(e, "EV_IDENTITY_CARD", a);
|
|
3677
3780
|
}
|
|
3678
|
-
function
|
|
3679
|
-
if (
|
|
3781
|
+
function Ji(e, t) {
|
|
3782
|
+
if (Zo(t.event)) return -1;
|
|
3680
3783
|
let n = {}, r = t.__global__, o = t.__config__, l = t.__filter__, i = t.__service__, s = t.subscriber;
|
|
3681
3784
|
o && (n.__config__ = o), r && (n.__global__ = r), l && (n.__filter__ = l);
|
|
3682
|
-
return
|
|
3785
|
+
return Pl(e, n, Di, Bi(e, Rt(s), i)), Ul(e, n, "__subscribing__"), Ki(e, t.event, n);
|
|
3683
3786
|
}
|
|
3684
|
-
function
|
|
3787
|
+
function qi(e, t, n, r) {
|
|
3685
3788
|
let o = e.priv;
|
|
3686
|
-
return Tt(e) && (o.websocket =
|
|
3789
|
+
return Tt(e) && (o.websocket = Ui(e)), 0;
|
|
3687
3790
|
}
|
|
3688
|
-
function
|
|
3689
|
-
return ar("Websocket opened: " + e.priv.url),
|
|
3791
|
+
function Hi(e, t, n, r) {
|
|
3792
|
+
return ar("Websocket opened: " + e.priv.url), Yi(e), 0;
|
|
3690
3793
|
}
|
|
3691
|
-
function
|
|
3794
|
+
function zi(e, t, n, r) {
|
|
3692
3795
|
let o = e.priv, l = n.url;
|
|
3693
3796
|
if (void 0 !== n.ws_seq && n.ws_seq !== o.ws_seq) return 0;
|
|
3694
3797
|
Xn();
|
|
3695
|
-
const i =
|
|
3696
|
-
return
|
|
3798
|
+
const i = Vi(void 0 === n.reason ? "" : n.reason, 256);
|
|
3799
|
+
return Ii(e) && ur(`${kt(e)}: WebSocket closed ${l} (Code: ${n.code}, Reason: "${i}", Clean: ${n.was_clean})`), o.websocket && (o.websocket.onopen = null, o.websocket.onmessage = null, o.websocket.onerror = null, o.websocket.onclose = null, o.websocket = null), o.inform_on_close ? (o.inform_on_close = !1, (!n.was_clean || 1e3 !== n.code && 1001 !== n.code) && Tt(e) && sr(`${kt(e)}: session closed ${l} (Code: ${n.code}, Reason: "${i}", Clean: ${n.was_clean})`), Ln(e, "EV_ON_CLOSE", {
|
|
3697
3800
|
url: l,
|
|
3698
3801
|
remote_yuno_name: o.remote_yuno_name,
|
|
3699
3802
|
remote_yuno_role: o.remote_yuno_role,
|
|
@@ -3709,24 +3812,33 @@
|
|
|
3709
3812
|
code: n.code,
|
|
3710
3813
|
reason: i,
|
|
3711
3814
|
was_clean: n.was_clean
|
|
3712
|
-
})), Tt(e) &&
|
|
3815
|
+
})), Tt(e) && hi(o.gobj_timer, Zi(e)), 0;
|
|
3713
3816
|
}
|
|
3714
|
-
|
|
3817
|
+
var Qi = 1e3;
|
|
3818
|
+
function Xi(e) {
|
|
3715
3819
|
let t = e.priv, n = en(e, "timeout_retry"), r = en(e, "timeout_retry_max");
|
|
3716
|
-
|
|
3820
|
+
return n >= Qi || (t.retry_floor_warned || (t.retry_floor_warned = !0, sr(`${kt(e)}: timeout_retry ${n} ms is below ${Qi} ms: ${Qi} ms is used`)), n = Qi), r >= n || (r = n), {
|
|
3821
|
+
base: n,
|
|
3822
|
+
max: r
|
|
3823
|
+
};
|
|
3824
|
+
}
|
|
3825
|
+
function Zi(e) {
|
|
3826
|
+
let t = e.priv;
|
|
3827
|
+
const { base: n, max: r } = Xi(e);
|
|
3828
|
+
t.retry_ms = t.retry_ms ? Math.min(2 * t.retry_ms, r) : n;
|
|
3717
3829
|
let o = .2 * t.retry_ms, l = t.retry_ms - o + 2 * Math.random() * o;
|
|
3718
3830
|
return Math.max(1, Math.round(l));
|
|
3719
3831
|
}
|
|
3720
|
-
function
|
|
3721
|
-
return
|
|
3832
|
+
function es(e, t, n, r) {
|
|
3833
|
+
return Yi(e), 0;
|
|
3722
3834
|
}
|
|
3723
|
-
function
|
|
3835
|
+
function ts(e, t, n, r) {
|
|
3724
3836
|
let o = e.priv;
|
|
3725
|
-
|
|
3726
|
-
let l =
|
|
3837
|
+
vi(o.gobj_timer);
|
|
3838
|
+
let l = Ll(e, n, Di, !0), i = gl(e, l, "src_yuno", ""), s = gl(e, l, "src_role", ""), a = gl(e, l, "src_service", "");
|
|
3727
3839
|
_n(e, "remote_yuno_name", i), _n(e, "remote_yuno_role", s), _n(e, "remote_yuno_service", a);
|
|
3728
|
-
let u =
|
|
3729
|
-
if (u < 0)
|
|
3840
|
+
let u = fl(e, n, "result", -1, 0), _ = gl(e, n, "comment", "", 0), c = gl(e, n, "username", "", 0), f = pl(e, n, "services_roles", {});
|
|
3841
|
+
if (u < 0) Fi(e), Ln(e, "EV_ON_ID_NAK", {
|
|
3730
3842
|
url: tn(e, "url"),
|
|
3731
3843
|
result: u,
|
|
3732
3844
|
comment: _,
|
|
@@ -3743,11 +3855,11 @@
|
|
|
3743
3855
|
services_roles: f
|
|
3744
3856
|
})), o.inside_on_open = !1, function(e) {
|
|
3745
3857
|
let t = In(e, null, null, null);
|
|
3746
|
-
for (let n = 0; n < t.length; n++)
|
|
3858
|
+
for (let n = 0; n < t.length; n++) Ji(e, t[n]);
|
|
3747
3859
|
}(e);
|
|
3748
3860
|
return 0;
|
|
3749
3861
|
}
|
|
3750
|
-
function
|
|
3862
|
+
function ns(e, t, n, r) {
|
|
3751
3863
|
let o = e.priv.url, l = function(e, t) {
|
|
3752
3864
|
let n;
|
|
3753
3865
|
try {
|
|
@@ -3766,49 +3878,49 @@
|
|
|
3766
3878
|
kw: o || {}
|
|
3767
3879
|
} : (sr(`${kt(e)}: parsing inter_event: kw not a json object`), null) : (sr(`${kt(e)}: parsing inter_kw: no kw`), null);
|
|
3768
3880
|
}(e, n.data);
|
|
3769
|
-
if (!l) return sr(`${kt(e)}: frame dropped from ${o}: ${
|
|
3770
|
-
if (
|
|
3881
|
+
if (!l) return sr(`${kt(e)}: frame dropped from ${o}: ${Vi(n.data, 256)}`), -1;
|
|
3882
|
+
if (Ii(e)) {
|
|
3771
3883
|
let e = Rt(wt()) + " <== " + o, t = n.data.length, r = Qt(wt(), "trace_ievent_callback");
|
|
3772
|
-
r ? r(e, l, 2, t) :
|
|
3884
|
+
r ? r(e, l, 2, t) : Wi(0, e, l);
|
|
3773
3885
|
}
|
|
3774
3886
|
let i = l.event, s = l.kw;
|
|
3775
3887
|
if ("ST_SESSION" !== fn(e)) {
|
|
3776
3888
|
if ("ev_identity_card_ack" === String(i).toLowerCase()) {
|
|
3777
3889
|
if (!(jn(e, "EV_IDENTITY_CARD_ACK", s, e) < 0)) return 0;
|
|
3778
|
-
} else sr(`${kt(e)}: event UNKNOWN in not-session state ${
|
|
3779
|
-
return
|
|
3890
|
+
} else sr(`${kt(e)}: event UNKNOWN in not-session state ${Vi(i, Gi)}`);
|
|
3891
|
+
return Mi(e, "event out of session"), -1;
|
|
3780
3892
|
}
|
|
3781
3893
|
l = null;
|
|
3782
|
-
let a =
|
|
3783
|
-
if (!
|
|
3784
|
-
let c =
|
|
3785
|
-
if (!
|
|
3786
|
-
let f =
|
|
3787
|
-
if ("__subscribing__" === a) return sr(`${kt(e)}: subscription event ignored, I'm client (service: ${
|
|
3788
|
-
if ("__unsubscribing__" === a) return sr(`${kt(e)}: unsubscription event ignored, I'm client (service: ${
|
|
3894
|
+
let a = Fl(e, s), u = Ll(e, s, Di), _ = gl(e, u, "dst_role", "");
|
|
3895
|
+
if (!Zo(_) && _.toLowerCase() !== String($t()).toLowerCase()) return sr(`${kt(e)}: It's not my role, dst_role: ${Vi(_, Gi)}, my_role: ${$t()}, event: ${Vi(i, Gi)}`), Mi(e, "not my role"), -1;
|
|
3896
|
+
let c = gl(e, u, "dst_yuno", "");
|
|
3897
|
+
if (!Zo(c) && c.toLowerCase() !== String(Nt()).toLowerCase()) return sr(`${kt(e)}: It's not my name, dst_yuno: ${Vi(c, Gi)}, my_name: ${Nt()}, event: ${Vi(i, Gi)}`), Mi(e, "not my name"), -1;
|
|
3898
|
+
let f = gl(e, u, "dst_service", "");
|
|
3899
|
+
if ("__subscribing__" === a) return sr(`${kt(e)}: subscription event ignored, I'm client (service: ${Vi(f, Gi)}, event: ${Vi(i, Gi)})`), -1;
|
|
3900
|
+
if ("__unsubscribing__" === a) return sr(`${kt(e)}: unsubscription event ignored, I'm client (service: ${Vi(f, Gi)}, event: ${Vi(i, Gi)})`), -1;
|
|
3789
3901
|
const g = Sn(i, 0, !1);
|
|
3790
3902
|
if (g && dn(e, g.event_name, 0)) {
|
|
3791
3903
|
const t = g.event_name;
|
|
3792
|
-
return dn(e, t, F.EVF_PUBLIC_EVENT) && "EV_IDENTITY_CARD_ACK" !== t ? (jn(e, t, s, e), 0) : (sr(`${kt(e)}: event of the transport itself, or out of its place, DROPPED: ev '${
|
|
3904
|
+
return dn(e, t, F.EVF_PUBLIC_EVENT) && "EV_IDENTITY_CARD_ACK" !== t ? (jn(e, t, s, e), 0) : (sr(`${kt(e)}: event of the transport itself, or out of its place, DROPPED: ev '${Vi(i, Gi)}'`), -1);
|
|
3793
3905
|
}
|
|
3794
|
-
if (!
|
|
3906
|
+
if (!Zo(f)) {
|
|
3795
3907
|
let t = nt(f, !1);
|
|
3796
|
-
return t ? dn(t, i, F.EVF_PUBLIC_EVENT) ? (jn(t, i, s, e), 0) : (sr(`${kt(e)}: Service found but no event or not public, DROPPED: service '${kt(t)}', ev '${
|
|
3908
|
+
return t ? dn(t, i, F.EVF_PUBLIC_EVENT) ? (jn(t, i, s, e), 0) : (sr(`${kt(e)}: Service found but no event or not public, DROPPED: service '${kt(t)}', ev '${Vi(i, Gi)}'`), -1) : (sr(`${kt(e)}: event for a service that is gone, DROPPED: service '${Vi(f, Gi)}', ev '${Vi(i, Gi)}'`), 0);
|
|
3797
3909
|
}
|
|
3798
3910
|
let d = Sn(i, F.EVF_PUBLIC_EVENT, !1);
|
|
3799
|
-
return d ? (Ln(e, d.event_name, s), 0) : (sr(`${kt(e)}: event that no gclass declares public, DROPPED: ev '${
|
|
3911
|
+
return d ? (Ln(e, d.event_name, s), 0) : (sr(`${kt(e)}: event that no gclass declares public, DROPPED: ev '${Vi(i, Gi)}'`), -1);
|
|
3800
3912
|
}
|
|
3801
|
-
function
|
|
3913
|
+
function rs(e, t, n, r) {
|
|
3802
3914
|
const o = n && "string" == typeof n[r] ? n[r] : "", l = n && "string" == typeof n.service ? n.service : "";
|
|
3803
|
-
return sr(`${kt(e)}: ${t} not served by this client, DROPPED: ${r.replace(/_/g, "")} '${
|
|
3915
|
+
return sr(`${kt(e)}: ${t} not served by this client, DROPPED: ${r.replace(/_/g, "")} '${Vi(o, Gi)}', service '${Vi(l, Gi)}'`), -1;
|
|
3804
3916
|
}
|
|
3805
|
-
function
|
|
3806
|
-
return
|
|
3917
|
+
function os(e, t, n, r) {
|
|
3918
|
+
return rs(e, t, n, "__stats__");
|
|
3807
3919
|
}
|
|
3808
|
-
function
|
|
3809
|
-
return
|
|
3920
|
+
function ls(e, t, n, r) {
|
|
3921
|
+
return rs(e, t, n, "__command__");
|
|
3810
3922
|
}
|
|
3811
|
-
var
|
|
3923
|
+
var is = {
|
|
3812
3924
|
mt_create: function(e) {
|
|
3813
3925
|
let t = e.priv;
|
|
3814
3926
|
t.gobj_timer = _t(Rt(e), "C_TIMER", {}, e), t.ws_seq = 0, t.url = tn(e, "url"), t.remote_yuno_name = tn(e, "remote_yuno_name"), t.remote_yuno_role = tn(e, "remote_yuno_role"), t.remote_yuno_service = tn(e, "remote_yuno_service"), _n(e, "wanted_yuno_name", t.remote_yuno_name), _n(e, "wanted_yuno_role", t.remote_yuno_role), _n(e, "wanted_yuno_service", t.remote_yuno_service);
|
|
@@ -3838,52 +3950,52 @@
|
|
|
3838
3950
|
code: 1e3,
|
|
3839
3951
|
reason: "restarted",
|
|
3840
3952
|
was_clean: !0
|
|
3841
|
-
}, e),
|
|
3953
|
+
}, e), vi(t.gobj_timer)), t.websocket = Ui(e), 0;
|
|
3842
3954
|
},
|
|
3843
3955
|
mt_stop: function(e) {
|
|
3844
3956
|
let t = e.priv;
|
|
3845
|
-
return
|
|
3957
|
+
return vi(t.gobj_timer), t.websocket && Fi(e), 0;
|
|
3846
3958
|
},
|
|
3847
3959
|
mt_destroy: function(e) {},
|
|
3848
3960
|
mt_stats: function(e, t, n, r) {
|
|
3849
3961
|
if ("ST_SESSION" !== fn(e)) return ir("Not in session"), null;
|
|
3850
3962
|
n || (n = {});
|
|
3851
|
-
let o =
|
|
3852
|
-
return l || (l = {}),
|
|
3963
|
+
let o = Bi(e, Rt(r), gl(e, n, "service", null, 0)), l = pl(e, n, "__md_stats__", null, Un.KW_EXTRACT);
|
|
3964
|
+
return l || (l = {}), Pl(e, n, "stats_stack", {
|
|
3853
3965
|
stats: t,
|
|
3854
3966
|
kw: l
|
|
3855
|
-
}),
|
|
3967
|
+
}), Pl(e, n, Di, o), n.__stats__ = t, Ul(e, n, "__stats__"), Ki(e, "EV_MT_STATS", n, r), null;
|
|
3856
3968
|
},
|
|
3857
3969
|
mt_command_parser: function(e, t, n, r) {
|
|
3858
3970
|
if ("ST_SESSION" !== fn(e)) return ir("Not in session"), null;
|
|
3859
3971
|
n || (n = {});
|
|
3860
|
-
let o =
|
|
3861
|
-
return l || (l = {}),
|
|
3972
|
+
let o = Bi(e, Rt(r), gl(e, n, "service", "", 0)), l = pl(e, n, "__md_command__", null, Un.KW_EXTRACT);
|
|
3973
|
+
return l || (l = {}), Pl(e, n, "command_stack", {
|
|
3862
3974
|
command: t,
|
|
3863
3975
|
kw: l
|
|
3864
|
-
}),
|
|
3976
|
+
}), Pl(e, n, Di, o), n.__command__ = t, Ul(e, n, "__command__"), Ki(e, "EV_MT_COMMAND", n, r), null;
|
|
3865
3977
|
},
|
|
3866
3978
|
mt_inject_event: function(e, t, n, r) {
|
|
3867
3979
|
if ("ST_SESSION" !== fn(e)) return window.console.error("Not in session"), -1;
|
|
3868
|
-
if (n = Do({},
|
|
3980
|
+
if (n = Do({}, Bo(n) ? n : {}), Bo(n.__md_iev__) && (n.__md_iev__ = Ao(n.__md_iev__)), Ll(e, n, Di));
|
|
3869
3981
|
else {
|
|
3870
|
-
let o =
|
|
3871
|
-
Po(n, "__service__"),
|
|
3982
|
+
let o = Bi(e, Rt(r), gl(e, n, "__service__", 0, 0));
|
|
3983
|
+
Po(n, "__service__"), Pl(e, n, "__message__", t), Pl(e, n, Di, o);
|
|
3872
3984
|
}
|
|
3873
|
-
return
|
|
3985
|
+
return Ul(e, n, "__message__"), Ki(e, t, n, r);
|
|
3874
3986
|
},
|
|
3875
3987
|
mt_subscription_added: function(e, t) {
|
|
3876
3988
|
let n = e.priv;
|
|
3877
|
-
return "ST_SESSION" === fn(e) && n.websocket ? n.inside_on_open ? 0 :
|
|
3989
|
+
return "ST_SESSION" === fn(e) && n.websocket ? n.inside_on_open ? 0 : Ji(e, t) : 0;
|
|
3878
3990
|
},
|
|
3879
3991
|
mt_subscription_deleted: function(e, t) {
|
|
3880
3992
|
let n = e.priv;
|
|
3881
3993
|
if ("ST_SESSION" !== fn(e) || !n.websocket) return 0;
|
|
3882
3994
|
if (n.inside_on_open) return 0;
|
|
3883
|
-
if (
|
|
3995
|
+
if (Zo(t.event)) return 0;
|
|
3884
3996
|
let r = {}, o = t.__global__, l = t.__config__, i = t.__filter__, s = t.__service__, a = t.subscriber;
|
|
3885
3997
|
l && (r.__config__ = l), o && (r.__global__ = o), i && (r.__filter__ = i);
|
|
3886
|
-
return
|
|
3998
|
+
return Pl(e, r, Di, Bi(e, Rt(a), s)), Ul(e, r, "__unsubscribing__"), Ki(e, t.event, r, e);
|
|
3887
3999
|
}
|
|
3888
4000
|
};
|
|
3889
4001
|
e.GObj = I, e.SDATA = k, e.SDATAAUTHZ = (e, t, n, r, o, l) => new R(e, t, n, null, l, r, null, 0, null, o, null), e.SDATACM = (e, t, n, r, o, l) => new R(e, t, 0, null, l, n, null, 0, o, r, null), e.SDATACM2 = (e, t, n, r, o, l, i) => new R(e, t, n, null, i, r, null, 0, l, o, null), e.SDATADF = (e, t, n, r, o, l) => new R(e, t, n, null, l, null, r, o), e.SDATAPM = (e, t, n, r, o) => new R(e, t, n, r, o), e.SDATAPM0 = (e, t, n, r, o) => new R(e, t, n, null, o, null, null, 0, null, null, r), e.SDATA_END = D, e.SDataDesc = R, e.YUNETA_VERSION = i, Object.defineProperty(e, "__yuno__", {
|
|
@@ -3897,7 +4009,7 @@
|
|
|
3897
4009
|
return t;
|
|
3898
4010
|
}, e.build_stats_response = l, e.clean_name = function(e) {
|
|
3899
4011
|
return e.replace(/[?# ^:]/g, "_");
|
|
3900
|
-
}, e.clear_timeout =
|
|
4012
|
+
}, e.clear_timeout = vi, e.cmp_two_simple_json = rl, e.command_parameter_from_json = ke, e.command_parameter_from_text = function(e, t) {
|
|
3901
4013
|
const n = De(e, t, !1);
|
|
3902
4014
|
return void 0 !== n.value || n.refused || (n.refused = je), n;
|
|
3903
4015
|
}, e.command_parser = function(e, t, n, r) {}, e.createElement2 = function e(t, n) {
|
|
@@ -3909,46 +4021,46 @@
|
|
|
3909
4021
|
for (const n of Object.keys(o[e])) t += `${n}: ${o[e][n]};`;
|
|
3910
4022
|
s.style.cssText = t;
|
|
3911
4023
|
} else "style" === e ? s.style.cssText = o[e] : "i18n" === e || "data-i18n" === e || "data_i18next" === e || "data-i18next" === e ? null !== o[e] && void 0 !== o[e] && (a = o[e], s.setAttribute("data-i18n", a)) : s.setAttribute(e, o[e]);
|
|
3912
|
-
if (
|
|
3913
|
-
else if (
|
|
4024
|
+
if (Kl(l)) s.appendChild(Bl(l));
|
|
4025
|
+
else if (Jo(l)) if (l = l.trim(), l.length > 0 && "<" === l[0] && !Yl) s.appendChild(ql(l));
|
|
3914
4026
|
else if (l.length > 0 && "<" === l[0] && function(e) {
|
|
3915
|
-
if (
|
|
4027
|
+
if (Jl.size >= 100) return;
|
|
3916
4028
|
const t = e.slice(0, 80);
|
|
3917
|
-
|
|
4029
|
+
Jl.has(t) || (Jl.add(t), sr(`createElement2: a string that starts with '<' is TEXT (set_strings_are_text): use html_markup() if it is markup: ${JSON.stringify(t)}`));
|
|
3918
4030
|
}(l), n && a) s.textContent = n(a) || l;
|
|
3919
4031
|
else s.textContent = l;
|
|
3920
|
-
else if (
|
|
3921
|
-
if (l.length > 0) if (
|
|
3922
|
-
else for (let t of l) Array.isArray(t) ? t.length > 0 && s.appendChild(e(t, n)) : t instanceof Node ? s.appendChild(t) :
|
|
4032
|
+
else if (Yo(l)) {
|
|
4033
|
+
if (l.length > 0) if (Jo(l[0])) s.appendChild(e(l, n));
|
|
4034
|
+
else for (let t of l) Array.isArray(t) ? t.length > 0 && s.appendChild(e(t, n)) : t instanceof Node ? s.appendChild(t) : Kl(t) ? s.appendChild(Bl(t)) : Jo(t) ? s.appendChild(document.createTextNode(t)) : null != t && !1 !== t && ir("createElement2: child ignored, type " + typeof t);
|
|
3923
4035
|
} else l instanceof HTMLElement || l instanceof Text || l instanceof SVGElement ? s.appendChild(l) : null != l && (ir("content ignored"), _r(l));
|
|
3924
4036
|
if (i && "object" == typeof i) for (const e of Object.keys(i)) s.addEventListener(e, i[e]);
|
|
3925
4037
|
return s;
|
|
3926
|
-
}, e.createOneHtml =
|
|
4038
|
+
}, e.createOneHtml = ql, e.create_json_record = function(e, t) {
|
|
3927
4039
|
let n = Ao(e);
|
|
3928
4040
|
return ko(n, t), n;
|
|
3929
4041
|
}, e.create_template_record = function(e, t) {
|
|
3930
4042
|
let n = {};
|
|
3931
4043
|
return t || (t = {}), Object.entries(e).forEach(([e, r]) => {
|
|
3932
4044
|
let o;
|
|
3933
|
-
|
|
3934
|
-
let l =
|
|
4045
|
+
Bo(r) && (o = r.default);
|
|
4046
|
+
let l = pl(null, t, e, o);
|
|
3935
4047
|
Lo(n, e, l);
|
|
3936
4048
|
}), n;
|
|
3937
|
-
}, e.current_timestamp =
|
|
3938
|
-
let n =
|
|
3939
|
-
return n &&
|
|
4049
|
+
}, e.current_timestamp = Hl, e.data_type_t = E, e.db_list_persistent_attrs = function(e, t) {
|
|
4050
|
+
let n = wl(ii(e), null, !1), r = {};
|
|
4051
|
+
return n && Bo(n) && (r = El(e, n, t, !1)), r;
|
|
3940
4052
|
}, e.db_load_persistent_attrs = function(e, t) {
|
|
3941
|
-
let n = Xt(e, A.SDF_PERSIST), r =
|
|
3942
|
-
if (r &&
|
|
3943
|
-
let o =
|
|
3944
|
-
o =
|
|
4053
|
+
let n = Xt(e, A.SDF_PERSIST), r = wl(ii(e), null, !1);
|
|
4054
|
+
if (r && Bo(r)) {
|
|
4055
|
+
let o = El(e, r, t, !1);
|
|
4056
|
+
o = El(e, o, n, !1), sn(e, o, A.SDF_PERSIST);
|
|
3945
4057
|
}
|
|
3946
4058
|
}, e.db_remove_persistent_attrs = function(e, t) {
|
|
3947
|
-
let n =
|
|
3948
|
-
0 === Vo(n) ?
|
|
4059
|
+
let n = Tl(e, wl(ii(e), null, !1), t, !1);
|
|
4060
|
+
0 === Vo(n) ? $l(ii(e)) : Nl(ii(e), n);
|
|
3949
4061
|
}, e.db_save_persistent_attrs = function(e, t) {
|
|
3950
|
-
let n =
|
|
3951
|
-
return r &&
|
|
4062
|
+
let n = El(e, Xt(e, A.SDF_PERSIST), t, !1), r = wl(ii(e), null, !1);
|
|
4063
|
+
return r && Bo(r) && Co(n, r), Nl(ii(e), n);
|
|
3952
4064
|
}, e.debounce = function(e, t = 0, n = !1) {
|
|
3953
4065
|
let r = null, o = null, l = null;
|
|
3954
4066
|
const i = (...i) => {
|
|
@@ -3970,22 +4082,20 @@
|
|
|
3970
4082
|
const t = {};
|
|
3971
4083
|
for (const n of e) Do(t, structuredClone(n));
|
|
3972
4084
|
return t;
|
|
3973
|
-
}, e.empty_json = function(e) {
|
|
3974
|
-
return 0 === xo(e);
|
|
3975
|
-
}, e.empty_string = Xo, e.escapeHtml = Gl, e.event_flag_t = F, e.flat2json = function(e) {
|
|
4085
|
+
}, e.empty_json = Ko, e.empty_string = Zo, e.escapeHtml = Wl, e.event_flag_t = F, e.flat2json = function(e) {
|
|
3976
4086
|
if (null === e || "object" != typeof e || Array.isArray(e)) throw new Error("flat2json: a flat json is an object of id -> value");
|
|
3977
4087
|
let t = null;
|
|
3978
4088
|
for (const n of Object.keys(e)) {
|
|
3979
|
-
const r =
|
|
4089
|
+
const r = oi(n);
|
|
3980
4090
|
if (!r || 0 === r.length) throw new Error(`flat2json: malformed flat id: '${n}'`);
|
|
3981
|
-
if (r.length >
|
|
4091
|
+
if (r.length > ti) throw new Error(`flat2json: '${n}' deeper than 256`);
|
|
3982
4092
|
const o = "number" == typeof r[0];
|
|
3983
4093
|
if (null === t) t = o ? [] : {};
|
|
3984
4094
|
else if (o !== Array.isArray(t)) throw new Error(`flat2json: '${n}' does not fit a ${Array.isArray(t) ? "array" : "object"} root`);
|
|
3985
4095
|
let l = t;
|
|
3986
4096
|
for (let t = 0; t < r.length; t++) {
|
|
3987
4097
|
const o = r[t], i = "number" == typeof o, s = t === r.length - 1, a = !s && "number" == typeof r[t + 1];
|
|
3988
|
-
if (i && o >
|
|
4098
|
+
if (i && o > ni) throw new Error(`flat2json: array index ${o} over the limit (100000) in '${n}'`);
|
|
3989
4099
|
if (i !== Array.isArray(l)) throw new Error(`flat2json: '${n}' uses a ${i ? "array index" : "key"} where the tree already has a ${Array.isArray(l) ? "array" : "object"}`);
|
|
3990
4100
|
if (s) {
|
|
3991
4101
|
if (Array.isArray(l)) {
|
|
@@ -3993,7 +4103,7 @@
|
|
|
3993
4103
|
l[o] = e[n];
|
|
3994
4104
|
} else {
|
|
3995
4105
|
if (Object.prototype.hasOwnProperty.call(l, o)) throw new Error(`flat2json: '${n}' is written twice, or once as a value and once as a container`);
|
|
3996
|
-
|
|
4106
|
+
sl(l, o, e[n]);
|
|
3997
4107
|
}
|
|
3998
4108
|
break;
|
|
3999
4109
|
}
|
|
@@ -4001,7 +4111,7 @@
|
|
|
4001
4111
|
if (Array.isArray(l)) {
|
|
4002
4112
|
for (; l.length <= o;) l.push(null);
|
|
4003
4113
|
u = l[o], null == u && (u = a ? [] : {}, l[o] = u);
|
|
4004
|
-
} else u =
|
|
4114
|
+
} else u = il(l, o) ? void 0 : l[o], void 0 === u && (u = a ? [] : {}, sl(l, o, u));
|
|
4005
4115
|
if (null === u || "object" != typeof u) throw new Error(`flat2json: '${n}' walks through a value: the same id is a leaf and a container at once`);
|
|
4006
4116
|
if (a !== Array.isArray(u)) throw new Error(`flat2json: '${n}' needs a ${a ? "array" : "object"} where the tree already has a ${Array.isArray(u) ? "array" : "object"}`);
|
|
4007
4117
|
l = u;
|
|
@@ -4012,11 +4122,11 @@
|
|
|
4012
4122
|
if (null === e || "object" != typeof e || Array.isArray(e)) throw new Error("flat_apply: a flat json is an object of id -> value");
|
|
4013
4123
|
if (null === t || "object" != typeof t) throw new Error("flat_apply: a diff is the object flat_diff() answers");
|
|
4014
4124
|
for (const n of Object.keys(t.removed || {})) delete e[n];
|
|
4015
|
-
for (const n of Object.keys(t.added || {}))
|
|
4125
|
+
for (const n of Object.keys(t.added || {})) sl(e, n, t.added[n]);
|
|
4016
4126
|
for (const n of Object.keys(t.changed || {})) {
|
|
4017
4127
|
const r = t.changed[n];
|
|
4018
4128
|
if (!r || !Object.prototype.hasOwnProperty.call(r, "to")) throw new Error(`flat_apply: changed '${n}' without a 'to'`);
|
|
4019
|
-
|
|
4129
|
+
sl(e, n, r.to);
|
|
4020
4130
|
}
|
|
4021
4131
|
return e;
|
|
4022
4132
|
}, e.flat_diff = function(e, t) {
|
|
@@ -4025,15 +4135,15 @@
|
|
|
4025
4135
|
removed: {},
|
|
4026
4136
|
changed: {}
|
|
4027
4137
|
};
|
|
4028
|
-
for (const e of Object.keys(n)) Object.prototype.hasOwnProperty.call(r, e) ?
|
|
4138
|
+
for (const e of Object.keys(n)) Object.prototype.hasOwnProperty.call(r, e) ? li(n[e], r[e]) || sl(o.changed, e, {
|
|
4029
4139
|
from: n[e],
|
|
4030
4140
|
to: r[e]
|
|
4031
|
-
}) :
|
|
4032
|
-
for (const e of Object.keys(r)) Object.prototype.hasOwnProperty.call(n, e) ||
|
|
4141
|
+
}) : sl(o.removed, e, n[e]);
|
|
4142
|
+
for (const e of Object.keys(r)) Object.prototype.hasOwnProperty.call(n, e) || sl(o.added, e, r[e]);
|
|
4033
4143
|
return o;
|
|
4034
4144
|
}, e.flat_key_join = function(e) {
|
|
4035
|
-
return Array.isArray(e) && 0 !== e.length ? e.map((e) => "number" == typeof e ? `[${e}]` :
|
|
4036
|
-
}, e.flat_key_split =
|
|
4145
|
+
return Array.isArray(e) && 0 !== e.length ? e.map((e) => "number" == typeof e ? `[${e}]` : ri(e)).join("`") : "";
|
|
4146
|
+
}, e.flat_key_split = oi, e.gclass_add_ev_action = He, e.gclass_add_event_type = Qe, e.gclass_add_state = qe, e.gclass_check_fsm = Ze, e.gclass_create = Ke, e.gclass_event_type = Xe, e.gclass_find_by_name = et, e.gclass_flag_t = P, e.gclass_unregister = Be, e.getPositionRelativeToBody = function(e) {
|
|
4037
4147
|
if (!e) return {
|
|
4038
4148
|
top: 0,
|
|
4039
4149
|
left: 0,
|
|
@@ -4052,14 +4162,14 @@
|
|
|
4052
4162
|
right: n + s + r,
|
|
4053
4163
|
bottom: t + i + o
|
|
4054
4164
|
};
|
|
4055
|
-
}, e.get_function_name =
|
|
4165
|
+
}, e.get_function_name = ei, e.get_now = function() {
|
|
4056
4166
|
return Math.floor(Date.now() / 1e3);
|
|
4057
4167
|
}, e.gobj_bottom_gobj = Ft, e.gobj_change_parent = function(e, t) {
|
|
4058
4168
|
return Ut(e) ? (ir("gobj NULL or DESTROYED"), null) : t instanceof I ? (e.parent && e.parent.gclass.gmt.mt_child_removed && e.parent.gclass.gmt.mt_child_removed(e.parent, e), e.parent && (lt(e.parent, e), e.parent = null), ot(t, e), t.gclass.gmt.mt_child_added && (ee(e) && ar(n("👦👦🔵 child_added(%s): %s", Ct(t), kt(e))), t.gclass.gmt.mt_child_added(t, e)), 0) : (ir(`${kt(e)}: gobj_change_parent() BAD TYPE of parent`), -1);
|
|
4059
4169
|
}, e.gobj_change_state = cn, e.gobj_command = function(e, t, r, l) {
|
|
4060
4170
|
if (Ut(e)) return ir("gobj NULL or DESTROYED"), -1;
|
|
4061
4171
|
if (function(e) {
|
|
4062
|
-
return
|
|
4172
|
+
return H > 1 || !!e && !!(X(e) & B.TRACE_COMMANDS);
|
|
4063
4173
|
}(e) || oe(e, null) && !le(l, null)) {
|
|
4064
4174
|
let o = To(t);
|
|
4065
4175
|
K(n("🌀🌀 mach(%s%s), cmd: %s, src: %s", Tt(e) ? "" : "!!", kt(e), null !== o ? o : t, kt(l))), re(e) && $o(r);
|
|
@@ -4075,26 +4185,26 @@
|
|
|
4075
4185
|
return ut(e, t, n, r, L.gobj_flag_volatil);
|
|
4076
4186
|
}, e.gobj_create_yuno = function(e, t, n) {
|
|
4077
4187
|
return ut(e, t, n, null, L.gobj_flag_yuno);
|
|
4078
|
-
}, e.gobj_current_state = fn, e.gobj_default_service = tt, e.gobj_deliver_posted_events = yn, e.gobj_destroy = ct, e.gobj_find_child =
|
|
4079
|
-
if (
|
|
4188
|
+
}, e.gobj_current_state = fn, e.gobj_default_service = tt, e.gobj_deliver_posted_events = yn, e.gobj_destroy = ct, e.gobj_find_child = qt, e.gobj_find_event_type = Sn, e.gobj_find_gobj = function(e, t) {
|
|
4189
|
+
if (Zo(t)) return null;
|
|
4080
4190
|
const n = t.toLowerCase();
|
|
4081
|
-
return "__default_service__" === n ? m : "__yuno__" === n || "__root__" === n ? p :
|
|
4191
|
+
return "__default_service__" === n ? m : "__yuno__" === n || "__root__" === n ? p : Ht(p, t);
|
|
4082
4192
|
}, e.gobj_find_service = nt, e.gobj_find_subscribings = Pn, e.gobj_find_subscriptions = In, e.gobj_flag_t = L, e.gobj_full_name = Ct, e.gobj_gclass_name = Dt, e.gobj_get_gclass_trace_level = fe, e.gobj_get_gclass_trace_level2 = ge, e.gobj_get_gclass_trace_no_level = de, e.gobj_get_global_trace_level = _e, e.gobj_get_global_trace_no_level = ce, e.gobj_global_trace_level = function() {
|
|
4083
4193
|
return J;
|
|
4084
4194
|
}, e.gobj_global_trace_no_level = function() {
|
|
4085
|
-
return
|
|
4195
|
+
return q;
|
|
4086
4196
|
}, e.gobj_has_attr = zt, e.gobj_has_event = dn, e.gobj_has_output_event = bn, e.gobj_hsdata = Ve, e.gobj_is_destroying = Ut, e.gobj_is_playing = St, e.gobj_is_pure_child = Lt, e.gobj_is_running = Tt, e.gobj_is_service = Ot, e.gobj_is_volatil = Pt, e.gobj_list_persistent_attrs = function(e, t) {
|
|
4087
4197
|
return _ ? _(e, t) : null;
|
|
4088
4198
|
}, e.gobj_list_subscriptions = function(e) {
|
|
4089
4199
|
let t = In(e, null, null, null);
|
|
4090
4200
|
for (let n = 0; n < t.length; n++) {
|
|
4091
|
-
let r = t[n], o =
|
|
4092
|
-
Uo(r, "s_event",
|
|
4201
|
+
let r = t[n], o = dl(e, r, "publisher", null, Un.KW_REQUIRED), l = dl(e, r, "subscriber", null, Un.KW_REQUIRED);
|
|
4202
|
+
Uo(r, "s_event", gl(e, r, "event", "", Un.KW_REQUIRED)), Uo(r, "s_publisher", kt(o)), Uo(r, "s_subscriber", kt(l));
|
|
4093
4203
|
}
|
|
4094
4204
|
let n = Pn(e, 0, null, 0);
|
|
4095
4205
|
for (let t = 0; t < n.length; t++) {
|
|
4096
|
-
let r = n[t], o =
|
|
4097
|
-
Uo(r, "s_event",
|
|
4206
|
+
let r = n[t], o = dl(e, r, "publisher", null, Un.KW_REQUIRED), l = dl(e, r, "subscriber", null, Un.KW_REQUIRED);
|
|
4207
|
+
Uo(r, "s_event", gl(e, r, "event", "", Un.KW_REQUIRED)), Uo(r, "s_publisher", kt(o)), Uo(r, "s_subscriber", kt(l));
|
|
4098
4208
|
}
|
|
4099
4209
|
return {
|
|
4100
4210
|
subscriptions: t,
|
|
@@ -4141,16 +4251,16 @@
|
|
|
4141
4251
|
let r = e.gclass.attrs_table;
|
|
4142
4252
|
for (let o = 0; o < r.length; o++) {
|
|
4143
4253
|
const l = r[o];
|
|
4144
|
-
l.name && (n && l.flag & n || (-1 === t || l.flag & t) && (he(e, e.jn_attrs, l),
|
|
4254
|
+
l.name && (n && l.flag & n || (-1 === t || l.flag & t) && (he(e, e.jn_attrs, l), Bo(e.priv) && Object.prototype.hasOwnProperty.call(e.priv, l.name) && (e.priv[l.name] = e.jn_attrs[l.name]), e.gclass.gmt.mt_writing && e.gclass.gmt.mt_writing(e, l.name)));
|
|
4145
4255
|
}
|
|
4146
4256
|
return 0;
|
|
4147
4257
|
}(e, A.SDF_VOLATIL, 0);
|
|
4148
|
-
}, e.gobj_save_persistent_attrs = it, e.gobj_search_path =
|
|
4258
|
+
}, e.gobj_save_persistent_attrs = it, e.gobj_search_path = Ht, e.gobj_send_event = jn, e.gobj_services = function() {
|
|
4149
4259
|
let e = [];
|
|
4150
4260
|
for (const t of Object.keys(b)) Mo(e, t);
|
|
4151
4261
|
return e;
|
|
4152
4262
|
}, e.gobj_set_bottom_gobj = Mt, e.gobj_set_deep_trace = function(e) {
|
|
4153
|
-
return
|
|
4263
|
+
return H = Number(e) || 0, 0;
|
|
4154
4264
|
}, e.gobj_set_gclass_no_trace = pe, e.gobj_set_gclass_trace = be, e.gobj_set_global_no_trace = se, e.gobj_set_global_no_trace2 = ue, e.gobj_set_global_trace = ie, e.gobj_set_global_trace2 = ae, e.gobj_set_gobj_no_trace = function(e, t, n) {
|
|
4155
4265
|
if (!e) return ir("gobj_set_gobj_no_trace: gobj NULL"), -1;
|
|
4156
4266
|
const r = Q(t, "gobj_set_gobj_no_trace", e.gclass && e.gclass.s_user_trace_level || null);
|
|
@@ -4191,7 +4301,7 @@
|
|
|
4191
4301
|
]);
|
|
4192
4302
|
if (Object.keys(n).forEach((n) => {
|
|
4193
4303
|
o.has(n) || ir(`${kt(e)}: key ignored in subscription (key: ${n}, event: ${t})`);
|
|
4194
|
-
}),
|
|
4304
|
+
}), Zo(t)) t = "";
|
|
4195
4305
|
else if (!(bn(e, t, F.EVF_OUTPUT_EVENT) || e.gclass.gclass_flag & P.gcflag_no_check_output_events)) return ir(`event NOT in output event list: ${kt(e)}, ev ${t}`), 0;
|
|
4196
4306
|
let l = Nn(n, t), i = An(e.dl_subscriptions, e, t, l.renamed_event, l.kw, r), s = 0, a = 0, u = 0;
|
|
4197
4307
|
for (let t = 0; t < i.length; t++) {
|
|
@@ -4200,75 +4310,75 @@
|
|
|
4200
4310
|
}
|
|
4201
4311
|
return a ? sr(`${kt(e)}: Hard subscription not removed, only gobj_unsubscribe_list() with force removes it (event: ${t}, hard: ${a})`) : s || u || (sr(`${kt(e)}: No subscription found`), $o(n, "No subscription found")), 0;
|
|
4202
4312
|
}, e.gobj_unsubscribe_list = Cn, e.gobj_walk_gobj_children = Vt, e.gobj_walk_gobj_children_tree = Wt, e.gobj_write_attr = rn, e.gobj_write_attrs = sn, e.gobj_write_bool_attr = an, e.gobj_write_integer_attr = un, e.gobj_write_str_attr = _n, e.gobj_yuno = wt, e.gobj_yuno_id = At, e.gobj_yuno_name = Nt, e.gobj_yuno_role = $t, e.html_markup = function(e) {
|
|
4203
|
-
return "string" != typeof e ? (ir("html_markup: not a string, type " + typeof e), new
|
|
4204
|
-
}, e.id_index_in_obj_list =
|
|
4313
|
+
return "string" != typeof e ? (ir("html_markup: not a string, type " + typeof e), new xl("")) : new xl(e);
|
|
4314
|
+
}, e.id_index_in_obj_list = Dl, e.index_in_list = zl, e.is_array = Yo, e.is_boolean = Ho, e.is_date = function(e) {
|
|
4205
4315
|
return e instanceof Date && !isNaN(e);
|
|
4206
|
-
}, e.is_function =
|
|
4207
|
-
if (!
|
|
4316
|
+
}, e.is_function = Qo, e.is_gobj = Xo, e.is_html_markup = Kl, e.is_metadata_key = function(e) {
|
|
4317
|
+
if (!Jo(e)) return !1;
|
|
4208
4318
|
let t = 0;
|
|
4209
4319
|
for (; t < e.length && "_" === e[t] && !(t > 2); t++);
|
|
4210
4320
|
return 2 === t;
|
|
4211
|
-
}, e.is_null =
|
|
4212
|
-
if (!
|
|
4321
|
+
}, e.is_null = zo, e.is_number = qo, e.is_object = Bo, e.is_private_key = function(e) {
|
|
4322
|
+
if (!Jo(e)) return !1;
|
|
4213
4323
|
let t = 0;
|
|
4214
4324
|
for (; t < e.length && "_" === e[t] && !(t > 2); t++);
|
|
4215
4325
|
return 1 === t;
|
|
4216
4326
|
}, e.is_pure_number = function(e) {
|
|
4217
|
-
if (
|
|
4218
|
-
if (!
|
|
4327
|
+
if (qo(e)) return !0;
|
|
4328
|
+
if (!Jo(e)) return !1;
|
|
4219
4329
|
const t = Number(e);
|
|
4220
4330
|
return !isNaN(t) && "" !== e.trim() && !isNaN(t);
|
|
4221
4331
|
}, e.is_secret_name = function(e) {
|
|
4222
4332
|
return "string" == typeof e && vr(e, 0, e.length, !0, !0);
|
|
4223
|
-
}, e.is_string =
|
|
4224
|
-
let o =
|
|
4333
|
+
}, e.is_string = Jo, e.jdb_delete = function(e, t, n, r) {
|
|
4334
|
+
let o = pl(null, pl(null, e, "topics", null, 0), t, null, 0);
|
|
4225
4335
|
if (!o) return ir("jdb_delete: topic not found: " + t), null;
|
|
4226
|
-
if (!
|
|
4227
|
-
if (!
|
|
4336
|
+
if (!Bo(r) || Zo(r.id)) return ir(`jdb_delete: record without id: ${Zn(r)}`), null;
|
|
4337
|
+
if (!Jo(n)) return ir(`jdb_delete: path must be a string: ${String(n)}`), null;
|
|
4228
4338
|
if ("" !== n && n.split("`").includes("")) return ir(`jdb_delete: empty segment in path: '${n}'`), null;
|
|
4229
4339
|
let l, i = n.split("`"), s = o;
|
|
4230
|
-
for (; (l = i.shift()) && !
|
|
4340
|
+
for (; (l = i.shift()) && !Zo(l) && s;) Bo(s) && (s = pl(null, s, e.hook, null, 0)), s = Gl(s, null, l, !1);
|
|
4231
4341
|
if (!s || 0 !== i.length) return ir(`jdb_delete: path not found in topic '${t}': '${n}'`), null;
|
|
4232
|
-
let a =
|
|
4342
|
+
let a = Yo(s) ? s : pl(null, s, e.hook, null, 0), u = Dl(a, r.id);
|
|
4233
4343
|
return u < 0 ? (ir(`jdb_delete: record not found in topic '${t}': '${n}' '${r.id}'`), null) : (a.splice(u, 1), o);
|
|
4234
4344
|
}, e.jdb_get = function(e, t, n, r) {
|
|
4235
|
-
let o =
|
|
4236
|
-
return o ? (void 0 === r && (r = !0),
|
|
4345
|
+
let o = pl(null, pl(null, e, "topics", null, 0), t, null, 0);
|
|
4346
|
+
return o ? (void 0 === r && (r = !0), Gl(o, e.hook, n, r)) : (ir("jdb_get: topic not found: " + t), null);
|
|
4237
4347
|
}, e.jdb_get_by_idx = function(e, t, n) {
|
|
4238
|
-
let r =
|
|
4348
|
+
let r = pl(null, pl(null, e, "topics", null, 0), t, null, 0);
|
|
4239
4349
|
return r ? n < r.length ? r[n] : {} : (ir("jdb_get_by_idx: topic not found: " + t), null);
|
|
4240
4350
|
}, e.jdb_get_topic = function(e, t) {
|
|
4241
|
-
let n =
|
|
4351
|
+
let n = pl(null, e, "topics", null, 0);
|
|
4242
4352
|
if (!n) return ir("jdb topics section not found"), ur(e), null;
|
|
4243
|
-
return
|
|
4353
|
+
return pl(null, n, t, null, 0) || (ir("jdb topic not found: " + t), ur(n), null);
|
|
4244
4354
|
}, e.jdb_init = function(e, t, n) {
|
|
4245
4355
|
n && (e = Ao(e));
|
|
4246
|
-
let r =
|
|
4247
|
-
|
|
4248
|
-
let o =
|
|
4249
|
-
return
|
|
4250
|
-
"__" === t.substring(0, 2) ||
|
|
4356
|
+
let r = pl(null, e, "type", [], Un.KW_CREATE);
|
|
4357
|
+
gl(null, e, "hook", "data", Un.KW_CREATE);
|
|
4358
|
+
let o = pl(null, e, "schema", {}, Un.KW_CREATE), l = pl(null, e, "topics", {}, Un.KW_CREATE);
|
|
4359
|
+
return Ml(o, function(e, t, n, o) {
|
|
4360
|
+
"__" === t.substring(0, 2) || Bo(n) || pl(null, l, o, Ao(r), Un.KW_CREATE);
|
|
4251
4361
|
}, t), e;
|
|
4252
4362
|
}, e.jdb_update = function(e, t, n, r) {
|
|
4253
|
-
let o =
|
|
4363
|
+
let o = pl(null, pl(null, e, "topics", null, 0), t, null, 0);
|
|
4254
4364
|
if (!o) return ir("jdb_update: topic not found: " + t), null;
|
|
4255
|
-
if (!
|
|
4256
|
-
if (!
|
|
4365
|
+
if (!Bo(r) || Zo(r.id)) return ir(`jdb_update: record without id: ${Zn(r)}`), null;
|
|
4366
|
+
if (!Jo(n)) return ir(`jdb_update: path must be a string: ${String(n)}`), null;
|
|
4257
4367
|
if ("" !== n && n.split("`").includes("")) return ir(`jdb_update: empty segment in path: '${n}'`), null;
|
|
4258
4368
|
let l, i, s = n.split("`"), a = o;
|
|
4259
|
-
for (; (l = s.shift()) && !
|
|
4369
|
+
for (; (l = s.shift()) && !Zo(l) && a;) Bo(a) && (a = pl(null, a, e.hook, null, 0)), a = Gl(a, null, l, !1);
|
|
4260
4370
|
if (!a || 0 !== s.length) return ir(`jdb_update: path not found in topic '${t}': '${n}'`), null;
|
|
4261
|
-
if (
|
|
4371
|
+
if (Yo(a)) i = a;
|
|
4262
4372
|
else {
|
|
4263
4373
|
if (a.id === r.id) return Do(a, r), o;
|
|
4264
|
-
if (i =
|
|
4265
|
-
else if (!
|
|
4374
|
+
if (i = pl(null, a, e.hook, null, 0), null == i) i = [], Lo(a, e.hook, i);
|
|
4375
|
+
else if (!Yo(i)) return ir(`jdb_update: the hook '${e.hook}' of '${n}' is not a list in topic '${t}'`), null;
|
|
4266
4376
|
}
|
|
4267
|
-
let u =
|
|
4377
|
+
let u = Gl(i, e.hook, r.id, !1);
|
|
4268
4378
|
return u ? Do(u, r) : i.push(r), o;
|
|
4269
4379
|
}, e.json2flat = function(e) {
|
|
4270
4380
|
const t = {}, n = (e, r, o) => {
|
|
4271
|
-
if (o >
|
|
4381
|
+
if (o > ti) throw new Error("json2flat: deeper than 256");
|
|
4272
4382
|
if (null === e || "object" != typeof e || Array.isArray(e)) {
|
|
4273
4383
|
if (Array.isArray(e) && e.length > 0) return void e.forEach((e, t) => {
|
|
4274
4384
|
const l = `[${t}]`;
|
|
@@ -4278,20 +4388,20 @@
|
|
|
4278
4388
|
const t = Object.keys(e);
|
|
4279
4389
|
if (t.length > 0) {
|
|
4280
4390
|
for (const l of t) {
|
|
4281
|
-
const t =
|
|
4391
|
+
const t = ri(l);
|
|
4282
4392
|
n(e[l], 0 === o ? t : r + "`" + t, o + 1);
|
|
4283
4393
|
}
|
|
4284
4394
|
return;
|
|
4285
4395
|
}
|
|
4286
4396
|
}
|
|
4287
|
-
0 !== o &&
|
|
4397
|
+
0 !== o && sl(t, r, e);
|
|
4288
4398
|
};
|
|
4289
4399
|
return null == e || n(e, "", 0), t;
|
|
4290
4400
|
}, e.json_array_append = Fo, e.json_array_append_new = Mo, e.json_array_extend = function(e, t) {
|
|
4291
4401
|
return t ? (Array.prototype.push.apply(e, t), e) : e;
|
|
4292
|
-
}, e.json_array_remove = Go, e.json_array_size = Wo, e.json_deep_copy = Ao, e.json_is_identical = Ro, e.json_mask_secrets = No, e.json_object_del = Po, e.json_object_get = Io, e.json_object_set = Lo, e.json_object_set_new = Uo, e.json_object_size = Vo, e.json_object_update = Do, e.json_object_update_existing = ko, e.json_object_update_missing = Co, e.json_size = xo, e.jwt2json = function(e, t) {
|
|
4402
|
+
}, e.json_array_remove = Go, e.json_array_size = Wo, e.json_deep_copy = Ao, e.json_is_identical = Ro, e.json_mask_secrets = No, e.json_object_del = Po, e.json_object_get = Io, e.json_object_set = Lo, e.json_object_set_new = Uo, e.json_object_size = Vo, e.json_object_update = Do, e.json_object_update_existing = ko, e.json_object_update_missing = Co, e.json_size = xo, e.json_text_of = Fe, e.jwt2json = function(e, t) {
|
|
4293
4403
|
try {
|
|
4294
|
-
let n =
|
|
4404
|
+
let n = Vl(e);
|
|
4295
4405
|
switch (t) {
|
|
4296
4406
|
case "header": return JSON.parse(n.header);
|
|
4297
4407
|
case "signature": return JSON.parse(n.signature);
|
|
@@ -4300,98 +4410,98 @@
|
|
|
4300
4410
|
} catch (e) {
|
|
4301
4411
|
return null;
|
|
4302
4412
|
}
|
|
4303
|
-
}, e.jwtDecode =
|
|
4304
|
-
if (e && !
|
|
4305
|
-
r || (r =
|
|
4413
|
+
}, e.jwtDecode = Vl, e.kw_clone_by_keys = El, e.kw_clone_by_not_keys = Tl, e.kw_collect = function(e, t, n, r) {
|
|
4414
|
+
if (e && !Xo(e) && ir("GObj bad instanceof"), !t) return null;
|
|
4415
|
+
r || (r = vl);
|
|
4306
4416
|
let o = [];
|
|
4307
|
-
if (
|
|
4417
|
+
if (Yo(t)) for (let e = 0; e < t.length; e++) {
|
|
4308
4418
|
let l = t[e];
|
|
4309
4419
|
r(l, n) && o.push(l);
|
|
4310
4420
|
}
|
|
4311
4421
|
else {
|
|
4312
|
-
if (!
|
|
4422
|
+
if (!Bo(t)) return ir("kw_select() BAD kw parameter"), null;
|
|
4313
4423
|
r(t, n) && o.push(t);
|
|
4314
4424
|
}
|
|
4315
4425
|
return o;
|
|
4316
|
-
}, e.kw_delete =
|
|
4317
|
-
if (!n || !
|
|
4426
|
+
}, e.kw_delete = _l, e.kw_find_json_in_list = function(e, t, n, r) {
|
|
4427
|
+
if (!n || !Yo(t)) return r && ir("item NULL or kw_list is not a list"), -1;
|
|
4318
4428
|
for (let e = 0; e < t.length; e++) if (Ro(n, t[e])) return e;
|
|
4319
4429
|
return r && ir("item not found in this list"), -1;
|
|
4320
|
-
}, e.kw_find_path =
|
|
4321
|
-
e && !
|
|
4322
|
-
let l =
|
|
4430
|
+
}, e.kw_find_path = ul, e.kw_flag_t = Un, e.kw_get_bool = cl, e.kw_get_dict = bl, e.kw_get_dict_value = pl, e.kw_get_int = fl, e.kw_get_list = function(e, t, n, r, o) {
|
|
4431
|
+
e && !Xo(e) && ir("GObj bad instanceof");
|
|
4432
|
+
let l = ul(e, t, n, !1);
|
|
4323
4433
|
const i = o && o & Un.KW_REQUIRED, s = o && o & Un.KW_CREATE, a = o && o & Un.KW_EXTRACT;
|
|
4324
|
-
return void 0 === l ? s &&
|
|
4325
|
-
}, e.kw_get_local_storage_value =
|
|
4326
|
-
e && !
|
|
4327
|
-
let l =
|
|
4434
|
+
return void 0 === l ? s && Yo(r) && t ? (ml(e, t, n, r), r) : (i && (ir(`path not found: '${n}'`), $o(t)), r) : Yo(l) ? (a && _l(e, t, n), l) : s && null === l && Yo(r) ? (ml(e, t, n, r), r) : s && null === l ? (i && (ir(`path not found: '${n}'`), $o(t)), r) : ((i || s) && (ir(`${e ? kt(e) + ": " : ""}path MUST BE a json list: '${n}'` + (s ? ", cannot create" : "")), $o(t)), r);
|
|
4435
|
+
}, e.kw_get_local_storage_value = wl, e.kw_get_pointer = dl, e.kw_get_real = function(e, t, n, r, o) {
|
|
4436
|
+
e && !Xo(e) && ir("GObj bad instanceof");
|
|
4437
|
+
let l = ul(e, t, n, !1);
|
|
4328
4438
|
const i = o && o & Un.KW_REQUIRED, s = o && o & Un.KW_CREATE, a = o && o & Un.KW_EXTRACT, u = o && o & Un.KW_WILD_NUMBER;
|
|
4329
4439
|
if (void 0 === l) {
|
|
4330
4440
|
if (s && t) {
|
|
4331
4441
|
let o = Number(r);
|
|
4332
|
-
return
|
|
4442
|
+
return ml(e, t, n, o), o;
|
|
4333
4443
|
}
|
|
4334
4444
|
return i && (ir(`path not found: '${n}'`), $o(t)), Number(r);
|
|
4335
4445
|
}
|
|
4336
4446
|
let _;
|
|
4337
|
-
if (
|
|
4447
|
+
if (qo(l)) _ = l;
|
|
4338
4448
|
else {
|
|
4339
4449
|
if (!u) return ir(`${e ? kt(e) + ": " : ""}path MUST BE a json real: '${n}'`), $o(t), Number(r);
|
|
4340
4450
|
if (Ho(l)) _ = l ? 1 : 0;
|
|
4341
|
-
else if (
|
|
4451
|
+
else if (Jo(l)) _ = parseFloat(l), Number.isNaN(_) && (_ = 0);
|
|
4342
4452
|
else {
|
|
4343
4453
|
if (null !== l) return ir(`${e ? kt(e) + ": " : ""}path MUST BE a simple json element: '${n}'`), $o(t), 0;
|
|
4344
4454
|
_ = 0;
|
|
4345
4455
|
}
|
|
4346
4456
|
}
|
|
4347
|
-
return a &&
|
|
4348
|
-
}, e.kw_get_str =
|
|
4349
|
-
if (e && !
|
|
4350
|
-
r || (r =
|
|
4457
|
+
return a && _l(e, t, n), _;
|
|
4458
|
+
}, e.kw_get_str = gl, e.kw_has_key = ll, e.kw_match_simple = vl, e.kw_pop = ol, e.kw_remove_local_storage_value = $l, e.kw_select = function(e, t, n, r) {
|
|
4459
|
+
if (e && !Xo(e) && ir("GObj bad instanceof"), !t) return null;
|
|
4460
|
+
r || (r = vl);
|
|
4351
4461
|
let o = [];
|
|
4352
|
-
if (
|
|
4462
|
+
if (Yo(t)) for (let e = 0; e < t.length; e++) {
|
|
4353
4463
|
let l = t[e];
|
|
4354
4464
|
r(l, n) && o.push(Ao(l));
|
|
4355
4465
|
}
|
|
4356
4466
|
else {
|
|
4357
|
-
if (!
|
|
4467
|
+
if (!Bo(t)) return ir("kw_select() BAD kw parameter"), null;
|
|
4358
4468
|
r(t, n) && o.push(Ao(t));
|
|
4359
4469
|
}
|
|
4360
4470
|
return o;
|
|
4361
|
-
}, e.kw_set_dict_value =
|
|
4362
|
-
e && !
|
|
4363
|
-
let l =
|
|
4471
|
+
}, e.kw_set_dict_value = ml, e.kw_set_local_storage_value = Nl, e.kw_set_subdict_value = hl, e.kwid_collect = Rl, e.kwid_find_one_record = function(e, t, n, r, o) {
|
|
4472
|
+
e && !Xo(e) && ir("GObj bad instanceof");
|
|
4473
|
+
let l = Rl(e, t, n, r, o);
|
|
4364
4474
|
return l && 0 !== l.length ? l[0] : null;
|
|
4365
4475
|
}, e.kwid_get_ids = function(e, t) {
|
|
4366
|
-
if (e && !
|
|
4476
|
+
if (e && !Xo(e) && ir("GObj bad instanceof"), !t) return [];
|
|
4367
4477
|
let n = [];
|
|
4368
|
-
if (
|
|
4369
|
-
else if (
|
|
4370
|
-
else
|
|
4371
|
-
if (
|
|
4372
|
-
else if (
|
|
4373
|
-
let r =
|
|
4478
|
+
if (Jo(t)) n.push(t);
|
|
4479
|
+
else if (Bo(t)) for (let e in t) Object.prototype.hasOwnProperty.call(t, e) && n.push(e);
|
|
4480
|
+
else Yo(t) && t.forEach(function(t) {
|
|
4481
|
+
if (Jo(t)) Zo(t) || n.push(t);
|
|
4482
|
+
else if (Bo(t)) {
|
|
4483
|
+
let r = gl(e, t, "id", 0, 0);
|
|
4374
4484
|
r && n.push(r);
|
|
4375
4485
|
}
|
|
4376
4486
|
});
|
|
4377
4487
|
return n;
|
|
4378
|
-
}, e.kwid_match_id =
|
|
4379
|
-
e && !
|
|
4488
|
+
}, e.kwid_match_id = Al, e.kwid_new_dict = function(e, t, n) {
|
|
4489
|
+
e && !Xo(e) && ir("GObj bad instanceof");
|
|
4380
4490
|
let r = {};
|
|
4381
|
-
if (
|
|
4382
|
-
else if (
|
|
4383
|
-
let o = t[n], l =
|
|
4384
|
-
|
|
4491
|
+
if (Zo(n) || (t = ul(e, t, n)), Bo(t)) r = t;
|
|
4492
|
+
else if (Yo(t)) for (let n = 0; n < t.length; n++) {
|
|
4493
|
+
let o = t[n], l = gl(e, o, "id", "", Un.KW_REQUIRED);
|
|
4494
|
+
Zo(l) || sl(r, l, o);
|
|
4385
4495
|
}
|
|
4386
4496
|
else ir(`${kt(e)} kwid_new_dict: data type unknown`);
|
|
4387
4497
|
return r;
|
|
4388
4498
|
}, e.kwid_new_list = function(e, t, n) {
|
|
4389
|
-
if (e && !
|
|
4390
|
-
if (
|
|
4499
|
+
if (e && !Xo(e) && ir("GObj bad instanceof"), Zo(n) || (t = ul(e, t, n)), Yo(t)) return t;
|
|
4500
|
+
if (Bo(t)) {
|
|
4391
4501
|
let n = [];
|
|
4392
4502
|
for (let r of Object.keys(t)) {
|
|
4393
4503
|
let o = t[r];
|
|
4394
|
-
|
|
4504
|
+
Bo(o) ? (o.id = r, n.push(o)) : ir(`${kt(e)} kwid_new_list: not a record: '${r}'`);
|
|
4395
4505
|
}
|
|
4396
4506
|
return n;
|
|
4397
4507
|
}
|
|
@@ -4399,16 +4509,16 @@
|
|
|
4399
4509
|
}, e.list2options = function(e, t, n) {
|
|
4400
4510
|
t = t || "id", n = n || "value";
|
|
4401
4511
|
let r = [];
|
|
4402
|
-
if (
|
|
4512
|
+
if (Yo(e)) for (let o = 0; o < e.length; o++) {
|
|
4403
4513
|
let l = e[o];
|
|
4404
|
-
if (
|
|
4514
|
+
if (Jo(l)) r.push({
|
|
4405
4515
|
id: e[o],
|
|
4406
4516
|
value: e[o]
|
|
4407
4517
|
});
|
|
4408
|
-
else if (
|
|
4518
|
+
else if (Bo(l)) {
|
|
4409
4519
|
let e = {};
|
|
4410
|
-
if (
|
|
4411
|
-
if (!
|
|
4520
|
+
if (ll(l, t)) {
|
|
4521
|
+
if (!ll(l, n)) {
|
|
4412
4522
|
if (!(xo(l) > 0)) {
|
|
4413
4523
|
ir("list2options(): object without field value: " + n);
|
|
4414
4524
|
continue;
|
|
@@ -4426,7 +4536,7 @@
|
|
|
4426
4536
|
r.push(e);
|
|
4427
4537
|
} else ir("list2options(): case1 not implemented");
|
|
4428
4538
|
}
|
|
4429
|
-
else if (
|
|
4539
|
+
else if (Bo(e)) for (let t of Object.keys(e)) r.push({
|
|
4430
4540
|
id: t,
|
|
4431
4541
|
value: t
|
|
4432
4542
|
});
|
|
@@ -4444,12 +4554,12 @@
|
|
|
4444
4554
|
var e;
|
|
4445
4555
|
}, r.send();
|
|
4446
4556
|
}, e.log_debug = ar, e.log_error = ir, e.log_info = function(e, ...t) {
|
|
4447
|
-
let n = nr(e, ...t), r =
|
|
4448
|
-
Vn &&
|
|
4449
|
-
}, e.log_warning = sr, e.mask_secrets_inline = To, e.msg_iev_get_msg_type =
|
|
4557
|
+
let n = nr(e, ...t), r = Hl();
|
|
4558
|
+
Vn && qn("info", n) && rr(Vn, "%c" + r + " INFO: " + String(n), "color:cyan"), zn("info", n, r);
|
|
4559
|
+
}, e.log_warning = sr, e.mask_secrets_inline = To, e.msg_iev_get_msg_type = Fl, e.msg_iev_get_stack = Ll, e.msg_iev_push_stack = Pl, e.msg_iev_read_key = Cl, e.msg_iev_set_msg_type = Ul, e.msg_iev_write_key = Il, e.node_uuid = Zl, e.parseBoolean = el, e.parseSVG = function(e) {
|
|
4450
4560
|
return new DOMParser().parseFromString(e, "image/svg+xml").firstChild;
|
|
4451
4561
|
}, e.refresh_language = function(e, t) {
|
|
4452
|
-
if (!
|
|
4562
|
+
if (!Qo(t)) return void ir("You must supply a translation function");
|
|
4453
4563
|
e || (e = document);
|
|
4454
4564
|
const n = (t) => {
|
|
4455
4565
|
let n = [];
|
|
@@ -4473,22 +4583,22 @@
|
|
|
4473
4583
|
});
|
|
4474
4584
|
}, e.register_c_ievent_cli = function() {
|
|
4475
4585
|
return function(e) {
|
|
4476
|
-
if (
|
|
4586
|
+
if (Li) return ir(`GClass ALREADY created: ${e}`), -1;
|
|
4477
4587
|
const t = [
|
|
4478
4588
|
["ST_DISCONNECTED", [
|
|
4479
4589
|
[
|
|
4480
4590
|
"EV_ON_OPEN",
|
|
4481
|
-
|
|
4591
|
+
Hi,
|
|
4482
4592
|
"ST_WAIT_IDENTITY_CARD_ACK"
|
|
4483
4593
|
],
|
|
4484
4594
|
[
|
|
4485
4595
|
"EV_ON_CLOSE",
|
|
4486
|
-
|
|
4596
|
+
zi,
|
|
4487
4597
|
null
|
|
4488
4598
|
],
|
|
4489
4599
|
[
|
|
4490
4600
|
"EV_TIMEOUT",
|
|
4491
|
-
|
|
4601
|
+
qi,
|
|
4492
4602
|
null
|
|
4493
4603
|
],
|
|
4494
4604
|
[
|
|
@@ -4500,22 +4610,22 @@
|
|
|
4500
4610
|
["ST_WAIT_IDENTITY_CARD_ACK", [
|
|
4501
4611
|
[
|
|
4502
4612
|
"EV_ON_MESSAGE",
|
|
4503
|
-
|
|
4613
|
+
ns,
|
|
4504
4614
|
null
|
|
4505
4615
|
],
|
|
4506
4616
|
[
|
|
4507
4617
|
"EV_IDENTITY_CARD_ACK",
|
|
4508
|
-
|
|
4618
|
+
ts,
|
|
4509
4619
|
null
|
|
4510
4620
|
],
|
|
4511
4621
|
[
|
|
4512
4622
|
"EV_ON_CLOSE",
|
|
4513
|
-
|
|
4623
|
+
zi,
|
|
4514
4624
|
"ST_DISCONNECTED"
|
|
4515
4625
|
],
|
|
4516
4626
|
[
|
|
4517
4627
|
"EV_TIMEOUT",
|
|
4518
|
-
|
|
4628
|
+
es,
|
|
4519
4629
|
null
|
|
4520
4630
|
],
|
|
4521
4631
|
[
|
|
@@ -4527,22 +4637,22 @@
|
|
|
4527
4637
|
["ST_SESSION", [
|
|
4528
4638
|
[
|
|
4529
4639
|
"EV_ON_MESSAGE",
|
|
4530
|
-
|
|
4640
|
+
ns,
|
|
4531
4641
|
null
|
|
4532
4642
|
],
|
|
4533
4643
|
[
|
|
4534
4644
|
"EV_MT_STATS",
|
|
4535
|
-
|
|
4645
|
+
os,
|
|
4536
4646
|
null
|
|
4537
4647
|
],
|
|
4538
4648
|
[
|
|
4539
4649
|
"EV_MT_COMMAND",
|
|
4540
|
-
|
|
4650
|
+
ls,
|
|
4541
4651
|
null
|
|
4542
4652
|
],
|
|
4543
4653
|
[
|
|
4544
4654
|
"EV_ON_CLOSE",
|
|
4545
|
-
|
|
4655
|
+
zi,
|
|
4546
4656
|
"ST_DISCONNECTED"
|
|
4547
4657
|
],
|
|
4548
4658
|
[
|
|
@@ -4553,7 +4663,7 @@
|
|
|
4553
4663
|
]],
|
|
4554
4664
|
[null, null]
|
|
4555
4665
|
];
|
|
4556
|
-
return (
|
|
4666
|
+
return (Li = Ke(e, [
|
|
4557
4667
|
["EV_ON_MESSAGE", F.EVF_OUTPUT_EVENT],
|
|
4558
4668
|
["EV_IDENTITY_CARD_ACK", F.EVF_PUBLIC_EVENT],
|
|
4559
4669
|
["EV_ON_ID_NAK", F.EVF_OUTPUT_EVENT],
|
|
@@ -4564,36 +4674,36 @@
|
|
|
4564
4674
|
["EV_ON_OPEN_ERROR", F.EVF_OUTPUT_EVENT | F.EVF_NO_WARN_SUBS],
|
|
4565
4675
|
["EV_TIMEOUT", 0],
|
|
4566
4676
|
[null, 0]
|
|
4567
|
-
], t,
|
|
4677
|
+
], t, is, 0, ki, Pi, 0, 0, Ci, P.gcflag_no_check_output_events)) ? 0 : -1;
|
|
4568
4678
|
}("C_IEVENT_CLI");
|
|
4569
4679
|
}, e.register_c_timer = function() {
|
|
4570
4680
|
return function(e) {
|
|
4571
|
-
if (
|
|
4681
|
+
if (di) return ir(`GClass ALREADY created: ${e}`), -1;
|
|
4572
4682
|
const t = [["ST_IDLE", [[
|
|
4573
4683
|
"EV_TIMEOUT",
|
|
4574
|
-
|
|
4684
|
+
bi,
|
|
4575
4685
|
null
|
|
4576
4686
|
]]]];
|
|
4577
|
-
return (
|
|
4687
|
+
return (di = Ke(e, [
|
|
4578
4688
|
["EV_TIMEOUT", F.EVF_OUTPUT_EVENT],
|
|
4579
4689
|
["EV_TIMEOUT_PERIODIC", F.EVF_OUTPUT_EVENT],
|
|
4580
4690
|
[0, 0]
|
|
4581
|
-
], t,
|
|
4691
|
+
], t, pi, 0, fi, gi, 0, 0, 0, P.gcflag_manual_start)) ? 0 : -1;
|
|
4582
4692
|
}("C_TIMER");
|
|
4583
4693
|
}, e.register_c_yuno = function() {
|
|
4584
4694
|
return function(e) {
|
|
4585
|
-
if (
|
|
4695
|
+
if (ji) return ir(`GClass ALREADY created: ${e}`), -1;
|
|
4586
4696
|
const t = [["ST_IDLE", [[
|
|
4587
4697
|
"EV_TIMEOUT_PERIODIC",
|
|
4588
|
-
|
|
4698
|
+
Ai,
|
|
4589
4699
|
null
|
|
4590
4700
|
]]]];
|
|
4591
|
-
return (
|
|
4701
|
+
return (ji = Ke(e, [["EV_TIMEOUT_PERIODIC", F.EVF_OUTPUT_EVENT | F.EVF_NO_WARN_SUBS], [0, 0]], t, Ri, 0, Ei, Ti, 0, 0, 0, 0)) ? 0 : -1;
|
|
4592
4702
|
}("C_YUNO");
|
|
4593
4703
|
}, e.safeSrc = function(e) {
|
|
4594
4704
|
if (!e) return "";
|
|
4595
4705
|
const t = String(e).trim();
|
|
4596
|
-
return /^javascript:/i.test(t) || /^data:/i.test(t) ? "" :
|
|
4706
|
+
return /^javascript:/i.test(t) || /^data:/i.test(t) ? "" : Wl(t);
|
|
4597
4707
|
}, e.sdata_flag_t = A, e.send_http_json_post = function(e, t, n) {
|
|
4598
4708
|
let r = new XMLHttpRequest();
|
|
4599
4709
|
r.open("POST", e), r.setRequestHeader("Accept", "application/json"), r.setRequestHeader("Content-Type", "application/json"), r.onreadystatechange = function() {
|
|
@@ -4617,16 +4727,16 @@
|
|
|
4617
4727
|
}
|
|
4618
4728
|
} else xn = e;
|
|
4619
4729
|
}, e.set_remote_log_functions = Xn, e.set_strings_are_text = function(e) {
|
|
4620
|
-
|
|
4621
|
-
}, e.set_timeout =
|
|
4622
|
-
return
|
|
4730
|
+
Yl = !!e;
|
|
4731
|
+
}, e.set_timeout = hi, e.set_timeout_periodic = yi, e.sprintf = n, e.stats_parser = function(e, t, n, r) {}, e.str_in_list = kl, e.strcasecmp = nl, e.strcmp = tl, e.strings_are_text = function() {
|
|
4732
|
+
return Yl;
|
|
4623
4733
|
}, e.strncmp = function(e, t, n) {
|
|
4624
4734
|
var r = (e + "").substring(0, n), o = (t + "").substring(0, n);
|
|
4625
4735
|
return r === o ? 0 : r > o ? 1 : -1;
|
|
4626
4736
|
}, e.strs_in_list = function(e, t, n) {
|
|
4627
4737
|
if (!e) return ir("ERROR: strs_in_list() list empty"), !1;
|
|
4628
4738
|
if (!t) return ir("ERROR: strs_in_list() str empty"), !1;
|
|
4629
|
-
for (let r = 0; r < t.length; r++) if (
|
|
4739
|
+
for (let r = 0; r < t.length; r++) if (kl(e, t[r], n)) return !0;
|
|
4630
4740
|
return !1;
|
|
4631
4741
|
}, e.strstr = function(e, t, n) {
|
|
4632
4742
|
var r;
|
|
@@ -4645,13 +4755,13 @@
|
|
|
4645
4755
|
placeholder: void 0,
|
|
4646
4756
|
fkey: null
|
|
4647
4757
|
};
|
|
4648
|
-
if (
|
|
4758
|
+
if (Jo(t)) {
|
|
4649
4759
|
let e = t.split(".");
|
|
4650
4760
|
for (let t = 0; t < e.length; t++) {
|
|
4651
4761
|
let r = e[t];
|
|
4652
|
-
if (
|
|
4653
|
-
else if (
|
|
4654
|
-
else if (
|
|
4762
|
+
if (kl(ai, r)) n.real_type || (n.real_type = r);
|
|
4763
|
+
else if (kl(_i, r)) n.type || (n.type = r);
|
|
4764
|
+
else if (kl(ui, r)) switch (r) {
|
|
4655
4765
|
case "writable":
|
|
4656
4766
|
n.is_writable = !0;
|
|
4657
4767
|
break;
|
|
@@ -4663,7 +4773,7 @@
|
|
|
4663
4773
|
}
|
|
4664
4774
|
}
|
|
4665
4775
|
n.real_type || (n.real_type = "string");
|
|
4666
|
-
} else
|
|
4776
|
+
} else Bo(t) ? (n = ci(t), n.name || (n.name = e), n.header || (n.header = e)) : Yo(t) && (n.real_type = "array", n.enum_list = t);
|
|
4667
4777
|
return n.type || (n.type = n.real_type), n;
|
|
4668
4778
|
}, e.timeTracker = function(e = "Time Tracker", t = !1) {
|
|
4669
4779
|
const n = e, r = performance.now();
|
|
@@ -4675,8 +4785,8 @@
|
|
|
4675
4785
|
total: a
|
|
4676
4786
|
};
|
|
4677
4787
|
} };
|
|
4678
|
-
}, e.trace_json = _r, e.trace_json_masked = $o, e.trace_level_t = B, e.trace_msg = ur, e.treedb_decoder_fkey =
|
|
4679
|
-
if (
|
|
4788
|
+
}, e.trace_json = _r, e.trace_json_masked = $o, e.trace_level_t = B, e.trace_msg = ur, e.treedb_decoder_fkey = si, e.treedb_decoder_hook = function(e, t) {
|
|
4789
|
+
if (Jo(t)) {
|
|
4680
4790
|
if (-1 === t.indexOf("^")) {
|
|
4681
4791
|
let n, r = e.hook;
|
|
4682
4792
|
if (1 !== Vo(r)) return ir("bad hook 1"), ir(e), ir(t), null;
|
|
@@ -4697,17 +4807,17 @@
|
|
|
4697
4807
|
};
|
|
4698
4808
|
}
|
|
4699
4809
|
}
|
|
4700
|
-
return
|
|
4810
|
+
return Bo(t) ? {
|
|
4701
4811
|
topic_name: t.topic_name,
|
|
4702
4812
|
id: t.id
|
|
4703
4813
|
} : (ir("bad hook 3"), ir(e), ir(t), null);
|
|
4704
4814
|
}, e.treedb_encoder_fkey = function(e, t) {
|
|
4705
|
-
let n =
|
|
4815
|
+
let n = si(e, t);
|
|
4706
4816
|
return n ? n.topic_name + "^" + n.id + "^" + n.hook_name : null;
|
|
4707
|
-
}, e.treedb_get_field_desc =
|
|
4708
|
-
if (
|
|
4817
|
+
}, e.treedb_get_field_desc = ci, e.treedb_hook_data_size = function(e) {
|
|
4818
|
+
if (Yo(e) && 1 === xo(e)) {
|
|
4709
4819
|
let t = e[0];
|
|
4710
|
-
return
|
|
4820
|
+
return ll(t, "size") ? t.size : 1;
|
|
4711
4821
|
}
|
|
4712
4822
|
return xo(e);
|
|
4713
4823
|
}, e.vsprintf = function(e, t) {
|