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