@yuneta/gobj-js 7.9.10 → 7.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/gobj-js.cjs.js +94 -10
- package/dist/gobj-js.cjs.js.map +1 -1
- package/dist/gobj-js.cjs.min.js +985 -966
- package/dist/gobj-js.cjs.min.js.map +1 -1
- package/dist/gobj-js.es.js +93 -11
- package/dist/gobj-js.es.js.map +1 -1
- package/dist/gobj-js.es.min.js +1036 -1016
- package/dist/gobj-js.es.min.js.map +1 -1
- package/dist/gobj-js.iife.js +94 -10
- package/dist/gobj-js.iife.js.map +1 -1
- package/dist/gobj-js.iife.min.js +988 -969
- package/dist/gobj-js.iife.min.js.map +1 -1
- package/dist/gobj-js.umd.js +94 -10
- package/dist/gobj-js.umd.js.map +1 -1
- package/dist/gobj-js.umd.min.js +987 -968
- package/dist/gobj-js.umd.min.js.map +1 -1
- package/package.json +1 -1
package/dist/gobj-js.umd.min.js
CHANGED
|
@@ -178,7 +178,7 @@
|
|
|
178
178
|
}
|
|
179
179
|
}, O = class {
|
|
180
180
|
constructor(e, t, n, r, o) {
|
|
181
|
-
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 =
|
|
181
|
+
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 = Qt(t.priv), this.running = !1, this.playing = !1, this.disabled = !1, this.bottom_gobj = null, this.trace_level = 0, this.no_trace_level = 0;
|
|
182
182
|
}
|
|
183
183
|
}, N = Object.freeze({
|
|
184
184
|
gcflag_manual_start: 1,
|
|
@@ -224,7 +224,7 @@
|
|
|
224
224
|
};
|
|
225
225
|
var C = 0;
|
|
226
226
|
function L(e) {
|
|
227
|
-
|
|
227
|
+
gn(e) && (e = JSON.stringify(e)), qt(" ".repeat(Math.max(1, 2 * E)) + String(e));
|
|
228
228
|
}
|
|
229
229
|
var P = Object.freeze({
|
|
230
230
|
TRACE_MACHINE: 65536,
|
|
@@ -320,7 +320,7 @@
|
|
|
320
320
|
]
|
|
321
321
|
], F = 0, G = 0, V = 0;
|
|
322
322
|
function M(e, t) {
|
|
323
|
-
if (
|
|
323
|
+
if (yn(e)) return 268369920;
|
|
324
324
|
if (/^[0-9]+$/.test(String(e))) {
|
|
325
325
|
const t = Number(e);
|
|
326
326
|
if (t) return t;
|
|
@@ -328,7 +328,7 @@
|
|
|
328
328
|
return function(e) {
|
|
329
329
|
for (const [t, n] of U) if (t === e) return n;
|
|
330
330
|
return 0;
|
|
331
|
-
}(String(e)) || (
|
|
331
|
+
}(String(e)) || (Bt(`${t}: trace level NOT FOUND: ${e}`), 0);
|
|
332
332
|
}
|
|
333
333
|
function W(e) {
|
|
334
334
|
if (V) return 4294967295;
|
|
@@ -342,11 +342,11 @@
|
|
|
342
342
|
function x() {
|
|
343
343
|
if (!p || !p.jn_attrs) return 0;
|
|
344
344
|
let e = 0;
|
|
345
|
-
if (
|
|
346
|
-
const t = Number(
|
|
345
|
+
if (rt(p, "tracing")) {
|
|
346
|
+
const t = Number(ot(p, "tracing")) || 0;
|
|
347
347
|
t >= 1 && (e |= P.TRACE_MACHINE), t >= 2 && (e |= P.TRACE_EV_KW);
|
|
348
348
|
}
|
|
349
|
-
return
|
|
349
|
+
return rt(p, "trace_timer") && ot(p, "trace_timer") && (e |= P.TRACE_TIMER), rt(p, "trace_creation") && ot(p, "trace_creation") && (e |= P.TRACE_CREATE_DELETE), rt(p, "trace_start_stop") && ot(p, "trace_start_stop") && (e |= P.TRACE_START_STOP), e;
|
|
350
350
|
}
|
|
351
351
|
function Y(e) {
|
|
352
352
|
return (W(e) | x()) & P.TRACE_CREATE_DELETE;
|
|
@@ -360,169 +360,175 @@
|
|
|
360
360
|
const n = W(e) | x();
|
|
361
361
|
return !!(n & P.TRACE_MACHINE || n & P.TRACE_TIMER_PERIODIC && "EV_TIMEOUT_PERIODIC" === t || n & P.TRACE_TIMER && "EV_TIMEOUT" === t);
|
|
362
362
|
}
|
|
363
|
+
function q(e, t) {
|
|
364
|
+
if (V > 1) return !1;
|
|
365
|
+
if (!e) return !0;
|
|
366
|
+
const n = K(e);
|
|
367
|
+
return !!(n & P.TRACE_MACHINE || n & P.TRACE_TIMER_PERIODIC && "EV_TIMEOUT_PERIODIC" === t || n & P.TRACE_TIMER && "EV_TIMEOUT" === t);
|
|
368
|
+
}
|
|
363
369
|
function H(e, t) {
|
|
364
370
|
let n = {};
|
|
365
|
-
if (!
|
|
371
|
+
if (!dn(t)) return Bt("sdata_desc MUST be an array"), zt(t), n;
|
|
366
372
|
for (let r = 0; r < t.length; r++) {
|
|
367
373
|
const o = t[r];
|
|
368
|
-
o.name &&
|
|
374
|
+
o.name && z(e, n, o);
|
|
369
375
|
}
|
|
370
376
|
return n;
|
|
371
377
|
}
|
|
372
|
-
function
|
|
378
|
+
function z(e, t, n) {
|
|
373
379
|
let r, o = n.default_value;
|
|
374
380
|
switch (n.type) {
|
|
375
381
|
case T.DTP_STRING:
|
|
376
382
|
r = String(o);
|
|
377
383
|
break;
|
|
378
384
|
case T.DTP_BOOLEAN:
|
|
379
|
-
r =
|
|
385
|
+
r = vn(o);
|
|
380
386
|
break;
|
|
381
387
|
case T.DTP_INTEGER:
|
|
382
|
-
r = parseInt(o), isNaN(r) &&
|
|
388
|
+
r = parseInt(o), isNaN(r) && Bt(`${Ve(e)}: attr NaN: ${n.name}`);
|
|
383
389
|
break;
|
|
384
390
|
case T.DTP_REAL:
|
|
385
|
-
r = Number(o), isNaN(r) &&
|
|
391
|
+
r = Number(o), isNaN(r) && Bt(`${Ve(e)}: attr NaN: ${n.name}`);
|
|
386
392
|
break;
|
|
387
393
|
case T.DTP_LIST:
|
|
388
|
-
if (
|
|
394
|
+
if (bn(o)) try {
|
|
389
395
|
r = JSON.parse(o);
|
|
390
396
|
} catch (e) {
|
|
391
|
-
|
|
397
|
+
Bt(`JSON parse error: ${e.message}`);
|
|
392
398
|
}
|
|
393
399
|
else r = o;
|
|
394
|
-
|
|
400
|
+
dn(r) || (r = []);
|
|
395
401
|
break;
|
|
396
402
|
case T.DTP_DICT:
|
|
397
|
-
if (
|
|
403
|
+
if (bn(o)) try {
|
|
398
404
|
r = JSON.parse(o);
|
|
399
405
|
} catch (e) {
|
|
400
|
-
|
|
406
|
+
Bt(`JSON parse error: ${e.message}`);
|
|
401
407
|
}
|
|
402
408
|
else r = o;
|
|
403
|
-
|
|
409
|
+
gn(r) || (r = {});
|
|
404
410
|
break;
|
|
405
411
|
case T.DTP_JSON:
|
|
406
|
-
if (
|
|
412
|
+
if (bn(o)) try {
|
|
407
413
|
r = JSON.parse(o);
|
|
408
414
|
} catch (e) {
|
|
409
|
-
|
|
415
|
+
Bt(`JSON parse error: ${e.message}`);
|
|
410
416
|
}
|
|
411
417
|
else r = o;
|
|
412
418
|
break;
|
|
413
419
|
case T.DTP_POINTER: r = o;
|
|
414
420
|
}
|
|
415
|
-
return void 0 === r && (
|
|
421
|
+
return void 0 === r && (Bt(`default_value WRONG, it: ${n.name}, value: ${n.default_value}`), r = null), t[n.name] = r, 0;
|
|
416
422
|
}
|
|
417
|
-
function
|
|
423
|
+
function Q(e, t, n, r) {
|
|
418
424
|
let o;
|
|
419
425
|
switch (n.type) {
|
|
420
426
|
case T.DTP_STRING:
|
|
421
427
|
if (null == r) o = "";
|
|
422
|
-
else if (
|
|
428
|
+
else if (bn(r)) o = String(r);
|
|
423
429
|
else {
|
|
424
430
|
let e = JSON.stringify(r);
|
|
425
431
|
e && (o = String(e));
|
|
426
432
|
}
|
|
427
433
|
break;
|
|
428
434
|
case T.DTP_BOOLEAN:
|
|
429
|
-
o =
|
|
435
|
+
o = vn(r);
|
|
430
436
|
break;
|
|
431
437
|
case T.DTP_INTEGER:
|
|
432
|
-
o = parseInt(r), isNaN(o) &&
|
|
438
|
+
o = parseInt(r), isNaN(o) && Bt(`${Ve(e)}: attr NaN: ${n.name}`);
|
|
433
439
|
break;
|
|
434
440
|
case T.DTP_REAL:
|
|
435
|
-
o = Number(r), isNaN(o) &&
|
|
441
|
+
o = Number(r), isNaN(o) && Bt(`${Ve(e)}: attr NaN: ${n.name}`);
|
|
436
442
|
break;
|
|
437
443
|
case T.DTP_LIST:
|
|
438
|
-
if (
|
|
444
|
+
if (bn(r)) try {
|
|
439
445
|
o = JSON.parse(r);
|
|
440
446
|
} catch (e) {
|
|
441
|
-
|
|
447
|
+
Bt(`JSON parse error: ${e.message}`);
|
|
442
448
|
}
|
|
443
449
|
else o = r;
|
|
444
|
-
if (!
|
|
450
|
+
if (!dn(o)) return Bt(`attr must be an array: ${n.name}`), -1;
|
|
445
451
|
break;
|
|
446
452
|
case T.DTP_DICT:
|
|
447
|
-
if (
|
|
453
|
+
if (bn(r)) try {
|
|
448
454
|
o = JSON.parse(r);
|
|
449
455
|
} catch (e) {
|
|
450
|
-
|
|
456
|
+
Bt(`JSON parse error: ${e.message}`);
|
|
451
457
|
}
|
|
452
458
|
else o = r;
|
|
453
|
-
if (!
|
|
459
|
+
if (!gn(o)) return Bt(`attr must be an object: ${n.name}`), -1;
|
|
454
460
|
break;
|
|
455
461
|
case T.DTP_JSON:
|
|
456
|
-
if (
|
|
462
|
+
if (bn(r)) try {
|
|
457
463
|
o = JSON.parse(r);
|
|
458
464
|
} catch (e) {
|
|
459
|
-
|
|
465
|
+
Bt(`JSON parse error: ${e.message}`);
|
|
460
466
|
}
|
|
461
467
|
else o = r;
|
|
462
|
-
if (!
|
|
468
|
+
if (!dn(o) && !gn(o)) return Bt(`attr must be a json dict/list: ${n.name}`), -1;
|
|
463
469
|
break;
|
|
464
470
|
case T.DTP_POINTER: o = r;
|
|
465
471
|
}
|
|
466
|
-
return void 0 === o &&
|
|
472
|
+
return void 0 === o && Bt(`${Ve(e)}: attr undefined: ${n.name}`), t[n.name] = o, gn(e.priv) && e.priv.hasOwnProperty(n.name) && (e.priv[n.name] = o), e.obflag & w.obflag_created && !(e.obflag & w.obflag_destroyed) && e.gclass.gmt.mt_writing && e.gclass.gmt.mt_writing(e, n.name), 0;
|
|
467
473
|
}
|
|
468
|
-
function
|
|
474
|
+
function X(e) {
|
|
469
475
|
return e.jn_attrs;
|
|
470
476
|
}
|
|
471
|
-
function X(e, t, n) {
|
|
472
|
-
return nt(e, t) ? Q(e) : e && e.bottom_gobj ? X(e.bottom_gobj, t, n) : (n && Wt(`GClass Attribute NOT FOUND: ${Ge(e)}, attr ${t}`), null);
|
|
473
|
-
}
|
|
474
477
|
function Z(e, t, n) {
|
|
475
|
-
|
|
478
|
+
return rt(e, t) ? X(e) : e && e.bottom_gobj ? Z(e.bottom_gobj, t, n) : (n && Bt(`GClass Attribute NOT FOUND: ${Ve(e)}, attr ${t}`), null);
|
|
479
|
+
}
|
|
480
|
+
function ee(e, t, n) {
|
|
481
|
+
if (!(e && e instanceof S)) return n && Bt("gclass NULL"), null;
|
|
476
482
|
if (!t) return e.attrs_table;
|
|
477
483
|
for (let n = 0; n < e.attrs_table.length; n++) {
|
|
478
484
|
const r = e.attrs_table[n];
|
|
479
485
|
if (r.name && r.name === t) return r;
|
|
480
486
|
}
|
|
481
|
-
return n &&
|
|
487
|
+
return n && Bt(`${e.gclass_name}: GClass Attribute NOT FOUND: ${t}`), null;
|
|
482
488
|
}
|
|
483
|
-
function
|
|
484
|
-
if (
|
|
485
|
-
if (e.includes("`") || e.includes("^") || e.includes(".")) return
|
|
486
|
-
if (
|
|
489
|
+
function te(e, t, n, r, o, i, l, s, _, a, u) {
|
|
490
|
+
if (yn(e)) return Bt("gclass_name EMPTY"), null;
|
|
491
|
+
if (e.includes("`") || e.includes("^") || e.includes(".")) return Bt(`GClass name CANNOT have '.' or '^' or '\`' char: ${e}`), null;
|
|
492
|
+
if (ce(e)) return Bt(`GClass ALREADY exists: ${e}`), null;
|
|
487
493
|
let c = new S(e, r, o, i, l, s, _, a, u);
|
|
488
494
|
(function(e, t) {
|
|
489
|
-
e && e instanceof S ? t ? d[t] ?
|
|
495
|
+
e && e instanceof S ? t ? d[t] ? Bt(`gclass ALREADY REGISTERED: ${t}`) : d[t] = e : Bt("gclass_name undefined") : Bt("gclass undefined");
|
|
490
496
|
})(c, e);
|
|
491
497
|
const f = n.length;
|
|
492
498
|
for (let e = 0; e < f; e++) {
|
|
493
499
|
let t = n[e][0], r = n[e][1];
|
|
494
|
-
if (
|
|
495
|
-
if (
|
|
500
|
+
if (yn(t)) continue;
|
|
501
|
+
if (ie(c, t) < 0) return ne(c), null;
|
|
496
502
|
const o = r.length;
|
|
497
503
|
for (let e = 0; e < o; e++) {
|
|
498
504
|
let n = r[e][0], o = r[e][1], i = r[e][2];
|
|
499
|
-
|
|
505
|
+
yn(n) || le(c, t, n, o, i);
|
|
500
506
|
}
|
|
501
507
|
}
|
|
502
508
|
for (let e = 0; e < t.length; e++) {
|
|
503
509
|
let n = t[e][0], r = t[e][1];
|
|
504
|
-
if (!
|
|
505
|
-
if (
|
|
506
|
-
|
|
510
|
+
if (!yn(n)) {
|
|
511
|
+
if (ae(c, n)) return Bt(`SMachine: event repeated in input_events: ${n}`), ne(c), null;
|
|
512
|
+
_e(c, n, r);
|
|
507
513
|
}
|
|
508
514
|
}
|
|
509
515
|
if (!c.fsm_checked) {
|
|
510
|
-
if (
|
|
516
|
+
if (ue(c) < 0) return ne(c), null;
|
|
511
517
|
c.fsm_checked = !0;
|
|
512
518
|
}
|
|
513
519
|
return c;
|
|
514
520
|
}
|
|
515
|
-
function
|
|
521
|
+
function ne(e) {
|
|
516
522
|
let t;
|
|
517
|
-
if (
|
|
523
|
+
if (bn(e)) t = e;
|
|
518
524
|
else {
|
|
519
|
-
if (!(e instanceof S)) return
|
|
525
|
+
if (!(e instanceof S)) return Bt("Cannot unregister gclass, type unknown"), -1;
|
|
520
526
|
t = e.gclass_name;
|
|
521
527
|
}
|
|
522
528
|
let n = d[t];
|
|
523
|
-
return n ? n.instances > 0 ? (
|
|
529
|
+
return n ? n.instances > 0 ? (Bt(`Cannot unregister gclass, instances in use: ${t}`), -1) : (delete d[t], 0) : (Bt(`Cannot unregister gclass, not found: ${t}`), -1);
|
|
524
530
|
}
|
|
525
|
-
function
|
|
531
|
+
function re(e, t) {
|
|
526
532
|
const n = e.dl_states.length, r = e.dl_states;
|
|
527
533
|
for (let e = 0; e < n; e++) {
|
|
528
534
|
let n = r[e];
|
|
@@ -530,7 +536,7 @@
|
|
|
530
536
|
}
|
|
531
537
|
return null;
|
|
532
538
|
}
|
|
533
|
-
function
|
|
539
|
+
function oe(e, t) {
|
|
534
540
|
const n = e.dl_actions.length, r = e.dl_actions;
|
|
535
541
|
for (let e = 0; e < n; e++) {
|
|
536
542
|
let n = r[e];
|
|
@@ -538,23 +544,23 @@
|
|
|
538
544
|
}
|
|
539
545
|
return null;
|
|
540
546
|
}
|
|
541
|
-
function
|
|
542
|
-
return e instanceof S ?
|
|
543
|
-
}
|
|
544
|
-
function ie(e, t, n, r, o) {
|
|
545
|
-
if (!(e instanceof S)) return Wt("Cannot add state, typeof not GClass"), -1;
|
|
546
|
-
if (mn(t)) return Wt("state_name EMPTY"), -1;
|
|
547
|
-
let i = ne(e, t);
|
|
548
|
-
return i ? re(i, n) ? (Wt(`event already exists: gclass ${e.gclass_name}, state ${t}, event ${n}`), -1) : (i.dl_actions.push(new k(n, r, o)), 0) : (Wt(`state not found: ${t}`), -1);
|
|
547
|
+
function ie(e, t) {
|
|
548
|
+
return e instanceof S ? re(e, t) ? (Bt(`state already exists: ${t}`), -1) : (e.dl_states.push(new I(t)), 0) : (Bt("Cannot add state, typeof not GClass"), -1);
|
|
549
549
|
}
|
|
550
|
-
function le(e, t, n) {
|
|
551
|
-
|
|
550
|
+
function le(e, t, n, r, o) {
|
|
551
|
+
if (!(e instanceof S)) return Bt("Cannot add state, typeof not GClass"), -1;
|
|
552
|
+
if (yn(t)) return Bt("state_name EMPTY"), -1;
|
|
553
|
+
let i = re(e, t);
|
|
554
|
+
return i ? oe(i, n) ? (Bt(`event already exists: gclass ${e.gclass_name}, state ${t}, event ${n}`), -1) : (i.dl_actions.push(new k(n, r, o)), 0) : (Bt(`state not found: ${t}`), -1);
|
|
552
555
|
}
|
|
553
556
|
function se(e, t, n) {
|
|
554
|
-
|
|
557
|
+
yn(t) || e.push(new $(t, n));
|
|
555
558
|
}
|
|
556
|
-
function _e(e, t) {
|
|
557
|
-
|
|
559
|
+
function _e(e, t, n) {
|
|
560
|
+
return e instanceof S ? se(e.dl_events, t, n) : (Bt("Cannot add state, typeof not GClass"), -1);
|
|
561
|
+
}
|
|
562
|
+
function ae(e, t) {
|
|
563
|
+
if (!(e instanceof S)) return Bt("Cannot add state, typeof not GClass"), 0;
|
|
558
564
|
const n = e.dl_events.length, r = e.dl_events;
|
|
559
565
|
for (let e = 0; e < n; e++) {
|
|
560
566
|
let n = r[e];
|
|
@@ -562,232 +568,236 @@
|
|
|
562
568
|
}
|
|
563
569
|
return null;
|
|
564
570
|
}
|
|
565
|
-
function
|
|
566
|
-
if (!(e instanceof S)) return
|
|
571
|
+
function ue(e) {
|
|
572
|
+
if (!(e instanceof S)) return Bt("Cannot add state, typeof not GClass"), -1;
|
|
567
573
|
let t = 0;
|
|
568
|
-
|
|
574
|
+
cn(e.dl_states) || (Bt(`GClass without states: ${e.gclass_name}`), t += -1);
|
|
569
575
|
for (let n = 0; n < e.dl_states.length; n++) {
|
|
570
576
|
let r = e.dl_states[n];
|
|
571
|
-
if (!
|
|
577
|
+
if (!yn(r.state_name)) for (let n = 0; n < r.dl_actions.length; n++) {
|
|
572
578
|
let o = r.dl_actions[n];
|
|
573
|
-
|
|
579
|
+
yn(o.event_name) || (ae(e, o.event_name) || (Bt(`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 && (re(e, o.next_state) || (Bt(`SMachine: next state NOT in state names: gclass ${e.gclass_name}, state ${r.state_name}, next_state ${o.next_state}`), t += -1)));
|
|
574
580
|
}
|
|
575
581
|
}
|
|
576
582
|
for (let n = 0; n < e.dl_events.length; n++) {
|
|
577
583
|
let r = e.dl_events[n];
|
|
578
|
-
if (!
|
|
584
|
+
if (!yn(r.event_name) && (pn(r.event_flag) || (Bt(`SMachine: event flag is NOT number: gclass ${e.gclass_name}, event ${r.event_name}`), t += -1), !(r.event_flag & D.EVF_OUTPUT_EVENT))) {
|
|
579
585
|
let n = !1;
|
|
580
586
|
for (let t = 0; t < e.dl_states.length; t++) {
|
|
581
587
|
let o = e.dl_states[t];
|
|
582
|
-
|
|
588
|
+
yn(o.state_name) || oe(o, r.event_name) && (n = !0);
|
|
583
589
|
}
|
|
584
|
-
n || (
|
|
590
|
+
n || (Bt(`SMachine: input_list's event NOT in state: gclass ${e.gclass_name}, event ${r.event_name}`), t += -1);
|
|
585
591
|
}
|
|
586
592
|
}
|
|
587
593
|
return t;
|
|
588
594
|
}
|
|
589
|
-
function
|
|
595
|
+
function ce(e, t) {
|
|
590
596
|
let n = null;
|
|
591
597
|
try {
|
|
592
598
|
n = d[e];
|
|
593
599
|
} catch (e) {}
|
|
594
|
-
return n || t &&
|
|
600
|
+
return n || t && Bt(`gclass not found: ${e}`), n;
|
|
595
601
|
}
|
|
596
|
-
function
|
|
602
|
+
function fe() {
|
|
597
603
|
return !m || m.obflag & w.obflag_destroyed ? null : m;
|
|
598
604
|
}
|
|
599
|
-
function
|
|
605
|
+
function ge(e, t) {
|
|
600
606
|
e = e.toLowerCase();
|
|
601
607
|
let n = b[e];
|
|
602
|
-
return !n && t ? (
|
|
603
|
-
}
|
|
604
|
-
function ge(e) {
|
|
605
|
-
let t = Ue(e);
|
|
606
|
-
return t = t.toLowerCase(), b[t] && Wt(`service ALREADY REGISTERED: ${t}. Will be UPDATED`), b[t] = e, 0;
|
|
608
|
+
return !n && t ? (Bt(`gobj service not found: ${e}`), null) : n;
|
|
607
609
|
}
|
|
608
|
-
function de(e
|
|
609
|
-
t
|
|
610
|
+
function de(e) {
|
|
611
|
+
let t = Fe(e);
|
|
612
|
+
return t = t.toLowerCase(), b[t] && Bt(`service ALREADY REGISTERED: ${t}. Will be UPDATED`), b[t] = e, 0;
|
|
610
613
|
}
|
|
611
614
|
function be(e, t) {
|
|
612
|
-
|
|
613
|
-
n >= 0 && (on(e.dl_children, n), t.parent = null);
|
|
615
|
+
t.parent && Bt(`_add_child() ALREADY HAS PARENT: ${t.gobj_name}`), e.dl_children.push(t), t.parent = e;
|
|
614
616
|
}
|
|
615
617
|
function pe(e, t) {
|
|
616
|
-
|
|
618
|
+
let n = sr(e.dl_children, t);
|
|
619
|
+
n >= 0 && (an(e.dl_children, n), t.parent = null);
|
|
617
620
|
}
|
|
618
|
-
function me(e, t
|
|
621
|
+
function me(e, t) {
|
|
622
|
+
"__json_config_variables__" !== t && Bt(`GClass Attribute NOT FOUND: ${Ve(e)}, attr ${t}`);
|
|
623
|
+
}
|
|
624
|
+
function Ee(e, t, n) {
|
|
619
625
|
let r = t;
|
|
620
626
|
(function(e, t, n, r, o) {
|
|
621
|
-
if (!e || !t) return
|
|
627
|
+
if (!e || !t) return Bt("hsdata or kw NULL"), -1;
|
|
622
628
|
let i = 0;
|
|
623
629
|
for (const [l, s] of Object.entries(t)) {
|
|
624
|
-
const t =
|
|
625
|
-
t ? (-1 === n || t.flag & n) && (t.flag & h.SDF_DEPRECATED &&
|
|
630
|
+
const t = ee(o.gclass, l, !1);
|
|
631
|
+
t ? (-1 === n || t.flag & n) && (t.flag & h.SDF_DEPRECATED && Jt(`${Ve(o)}: Deprecated attribute used in gobj creation: ${l}`), i += Q(o, e, t, s)) : r && (r(o, l), i--);
|
|
626
632
|
}
|
|
627
633
|
return i;
|
|
628
|
-
})(
|
|
634
|
+
})(X(e), r, -1, e.gclass.gclass_flag & N.gcflag_ignore_unknown_attrs ? 0 : me, e) < 0 && (Bt(`${Ve(e)} json2data() FAILED`), zt(r));
|
|
629
635
|
}
|
|
630
|
-
function
|
|
636
|
+
function Te(e, t, r, o, i) {
|
|
631
637
|
if (i & R.gobj_flag_yuno) {
|
|
632
|
-
if (p) return
|
|
638
|
+
if (p) return Bt("__yuno__ already created"), null;
|
|
633
639
|
i |= R.gobj_flag_service;
|
|
634
640
|
} else {
|
|
635
|
-
if (!o) return
|
|
636
|
-
if (!("string" == typeof o || o instanceof O)) return
|
|
637
|
-
if (
|
|
641
|
+
if (!o) return Bt("gobj NEEDS a parent!"), null;
|
|
642
|
+
if (!("string" == typeof o || o instanceof O)) return Bt(`BAD TYPE of parent: ${o}`), null;
|
|
643
|
+
if (bn(o) && !(o = ge(o))) return Jt(`parent service not found: ${o}`), null;
|
|
638
644
|
}
|
|
639
|
-
if (i & R.gobj_flag_service &&
|
|
645
|
+
if (i & R.gobj_flag_service && ge(e, !1)) return Bt(`service ALREADY registered: ${t}^${e}`), null;
|
|
640
646
|
if (i & R.gobj_flag_default_service) {
|
|
641
|
-
if (m) return
|
|
647
|
+
if (m) return Bt(`default service ALREADY registered: ${t}^${e}`), null;
|
|
642
648
|
i |= R.gobj_flag_service;
|
|
643
649
|
}
|
|
644
|
-
if (
|
|
645
|
-
let l =
|
|
646
|
-
if (!l) return
|
|
647
|
-
if (!
|
|
648
|
-
if (!
|
|
649
|
-
if (e.includes("`")) return
|
|
650
|
-
if (e.includes("^")) return
|
|
650
|
+
if (yn(t)) return Bt("gclass_name must be a string"), null;
|
|
651
|
+
let l = ce(t, !1);
|
|
652
|
+
if (!l) return Bt(`GClass not registered: ${t}^${e}`), null;
|
|
653
|
+
if (!bn(e)) return Bt(`gobj_name must be a string: ${t}`), null;
|
|
654
|
+
if (!yn(e)) {
|
|
655
|
+
if (e.includes("`")) return Bt(`gobj_name cannot contain char ': ${t}^${e}`), null;
|
|
656
|
+
if (e.includes("^")) return Bt(`gobj_name cannot contain char ^: ${t}^${e}`), null;
|
|
651
657
|
}
|
|
652
658
|
let _ = new O(e, l, r, o, i);
|
|
653
659
|
_.jn_attrs = H(_, l.attrs_table);
|
|
654
660
|
for (const [e, t] of Object.entries(_.jn_attrs)) e in _.priv && (_.priv[e] = t);
|
|
655
661
|
let a = Y(_);
|
|
656
|
-
return a && L(n("💙💙⏩ creating: %s^%s", l.gclass_name, e)), _.gobj_flag & R.gobj_flag_service &&
|
|
662
|
+
return a && L(n("💙💙⏩ creating: %s^%s", l.gclass_name, e)), _.gobj_flag & R.gobj_flag_service && de(_), _.gobj_flag & R.gobj_flag_yuno && (p = _), _.gobj_flag & R.gobj_flag_default_service && (m = _), _.gobj_flag & R.gobj_flag_yuno || be(o, _), _.obflag |= w.obflag_created, _.gclass.instances++, Ee(_, r), _.gobj_flag & R.gobj_flag_service && s && s(_, null), _.gclass.gmt.mt_create2 ? _.gclass.gmt.mt_create2(_, r) : _.gclass.gmt.mt_create && _.gclass.gmt.mt_create(_), o && o.gclass.gmt.mt_child_added && (a && L(n("👦👦🔵 child_added(%s): %s", Me(o), Ve(_))), o.gclass.gmt.mt_child_added(o, _)), a && L(n("💙💙⏪ created: %s", Me(_))), _;
|
|
657
663
|
}
|
|
658
|
-
function
|
|
659
|
-
return
|
|
664
|
+
function he(e, t, n, r) {
|
|
665
|
+
return Te(e, t, n, r, R.gobj_flag_pure_child);
|
|
660
666
|
}
|
|
661
|
-
function
|
|
662
|
-
if (
|
|
663
|
-
e.__refs__ > 0 &&
|
|
667
|
+
function ye(e) {
|
|
668
|
+
if (Ye(e)) return void Bt("gobj NULL or DESTROYED");
|
|
669
|
+
e.__refs__ > 0 && Bt(`${Ve(e)}: gobj DESTROYING with references: ${e.__refs__}`), e.playing && (Bt(`Destroying a PLAYING gobj: ${Me(e)}`), De(e)), e.running && (Bt(`Destroying a RUNNING gobj: ${Me(e)}`), Oe(e)), e.obflag |= w.obflag_destroying, function(e) {
|
|
670
|
+
if (0 === Tt.length) return;
|
|
671
|
+
for (let t of Tt) t.src === e && (t.src = null);
|
|
672
|
+
Tt = Tt.filter((t) => t.dst !== e);
|
|
673
|
+
}(e);
|
|
664
674
|
let t = Y(e);
|
|
665
|
-
t && L(n("💔💔⏩ destroying: %s",
|
|
666
|
-
let r =
|
|
667
|
-
r && r.gclass.gmt.mt_child_removed && (t && L(n("👦👦🔴 child_removed(%s): %s",
|
|
668
|
-
let t =
|
|
669
|
-
t = t.toLowerCase(), b[t] ? delete b[t] :
|
|
670
|
-
}(e),
|
|
675
|
+
t && L(n("💔💔⏩ destroying: %s", Me(e)));
|
|
676
|
+
let r = We(e);
|
|
677
|
+
r && r.gclass.gmt.mt_child_removed && (t && L(n("👦👦🔴 child_removed(%s): %s", Me(r), Ve(e))), r.gclass.gmt.mt_child_removed(r, e)), e.gobj_flag & R.gobj_flag_service && function(e) {
|
|
678
|
+
let t = Fe(e);
|
|
679
|
+
t = t.toLowerCase(), b[t] ? delete b[t] : Bt(`"service NOT found in register": ${t}`);
|
|
680
|
+
}(e), At(e, e.dl_subscriptions, !0), At(e, e.dl_subscribings, !0), r && (pe(r, e), Ke(e) && (Be(r) !== e || Ye(r) || Je(r, null))), function(e) {
|
|
671
681
|
let t = e.dl_children.slice();
|
|
672
682
|
for (let e = 0; e < t.length; e++) {
|
|
673
683
|
let n = t[e];
|
|
674
|
-
|
|
684
|
+
Ye(n) || ye(n);
|
|
675
685
|
}
|
|
676
|
-
}(e), e.obflag & w.obflag_created && e.gclass.gmt.mt_destroy && e.gclass.gmt.mt_destroy(e), t && L(n("💔💔⏪ destroyed: %s",
|
|
686
|
+
}(e), e.obflag & w.obflag_created && e.gclass.gmt.mt_destroy && e.gclass.gmt.mt_destroy(e), t && L(n("💔💔⏪ destroyed: %s", Me(e))), e.obflag |= w.obflag_destroyed, e.obflag & w.obflag_created && e.gclass.instances--;
|
|
677
687
|
}
|
|
678
|
-
function
|
|
679
|
-
if (
|
|
680
|
-
if (e.running) return
|
|
681
|
-
if (e.disabled) return
|
|
682
|
-
B(e) && L(n("⏺ ⏺ start: %s",
|
|
688
|
+
function ve(e) {
|
|
689
|
+
if (Ye(e)) return Bt("gobj NULL or DESTROYED"), -1;
|
|
690
|
+
if (e.running) return Bt(`${Ve(e)}: GObj ALREADY RUNNING`), -1;
|
|
691
|
+
if (e.disabled) return Bt(`${Ve(e)}: GObj DISABLED`), -1;
|
|
692
|
+
B(e) && L(n("⏺ ⏺ start: %s", Me(e))), e.running = !0;
|
|
683
693
|
let t = 0;
|
|
684
694
|
return e.gclass.gmt.mt_start && (t = e.gclass.gmt.mt_start(e)), t;
|
|
685
695
|
}
|
|
686
|
-
function ve(e, t, n) {
|
|
687
|
-
return e.gclass.gclass_flag & N.gcflag_manual_start || xe(e) || De(e) || Ae(e) || ye(e), 0;
|
|
688
|
-
}
|
|
689
696
|
function je(e, t, n) {
|
|
690
|
-
return e.gclass.gclass_flag & N.gcflag_manual_start ||
|
|
697
|
+
return e.gclass.gclass_flag & N.gcflag_manual_start || Ye(e) || Ae(e) || ke(e) || ve(e), 0;
|
|
698
|
+
}
|
|
699
|
+
function Se(e, t, n) {
|
|
700
|
+
return e.gclass.gclass_flag & N.gcflag_manual_start || ke(e) ? 1 : (Ae(e) || ve(e), 0);
|
|
691
701
|
}
|
|
692
|
-
function
|
|
693
|
-
if (
|
|
694
|
-
if (!e.running) return
|
|
695
|
-
e.playing && (
|
|
702
|
+
function Oe(e) {
|
|
703
|
+
if (Ye(e)) return Bt("gobj NULL or DESTROYED"), -1;
|
|
704
|
+
if (!e.running) return Bt(`${Ve(e)}: GObj NOT RUNNING`), -1;
|
|
705
|
+
e.playing && (Jt(`${Ve(e)}: GObj stopping without previous pause`), De(e)), B(e) && L(n("⏹ ⏹ stop: %s", Me(e))), e.running = !1;
|
|
696
706
|
let t = 0;
|
|
697
707
|
return e.gclass.gmt.mt_stop && (t = e.gclass.gmt.mt_stop(e)), t;
|
|
698
708
|
}
|
|
699
|
-
function
|
|
700
|
-
return
|
|
701
|
-
}
|
|
702
|
-
function Ne(e) {
|
|
703
|
-
return xe(e) ? (Wt("gobj NULL or DESTROYED"), -1) : He(e, A.WALK_FIRST2LAST, Oe, 0, 0);
|
|
709
|
+
function Ne(e, t, n) {
|
|
710
|
+
return Ae(e) && Oe(e), 0;
|
|
704
711
|
}
|
|
705
712
|
function Re(e) {
|
|
706
|
-
|
|
707
|
-
if (e.playing) return Wt(`${Ge(e)}: GObj ALREADY PLAYING`), -1;
|
|
708
|
-
if (e.disabled) return Wt(`${Ge(e)}: GObj DISABLED`), -1;
|
|
709
|
-
if (!De(e)) {
|
|
710
|
-
if (e.gclass.gclass_flag & N.gcflag_required_start_to_play) return Wt(`${Ge(e)}: Cannot play, start not done`), -1;
|
|
711
|
-
Kt(`${Ge(e)}: GObj playing without previous start`), ye(e);
|
|
712
|
-
}
|
|
713
|
-
B(e) && L(n("⏯ ⏯ play: %s", Ve(e))), e.playing = !0;
|
|
714
|
-
let t = 0;
|
|
715
|
-
return e.gclass.gmt.mt_play && (t = e.gclass.gmt.mt_play(e), t < 0 && (e.playing = !1)), t;
|
|
713
|
+
return Ye(e) ? (Bt("gobj NULL or DESTROYED"), -1) : He(e, A.WALK_FIRST2LAST, Ne, 0, 0);
|
|
716
714
|
}
|
|
717
715
|
function we(e) {
|
|
718
|
-
|
|
716
|
+
if (Ye(e)) return Bt(`gobj NULL or DESTROYED: ${Ve(e)}`), -1;
|
|
717
|
+
if (e.playing) return Bt(`${Ve(e)}: GObj ALREADY PLAYING`), -1;
|
|
718
|
+
if (e.disabled) return Bt(`${Ve(e)}: GObj DISABLED`), -1;
|
|
719
|
+
if (!Ae(e)) {
|
|
720
|
+
if (e.gclass.gclass_flag & N.gcflag_required_start_to_play) return Bt(`${Ve(e)}: Cannot play, start not done`), -1;
|
|
721
|
+
Jt(`${Ve(e)}: GObj playing without previous start`), ve(e);
|
|
722
|
+
}
|
|
723
|
+
B(e) && L(n("⏯ ⏯ play: %s", Me(e))), e.playing = !0;
|
|
724
|
+
let t = 0;
|
|
725
|
+
return e.gclass.gmt.mt_play && (t = e.gclass.gmt.mt_play(e), t < 0 && (e.playing = !1)), t;
|
|
719
726
|
}
|
|
720
727
|
function De(e) {
|
|
721
|
-
return
|
|
728
|
+
return Ye(e) ? (Bt("gobj NULL or DESTROYED"), -1) : e.playing ? (B(e) && L(n("⏸ ⏸ pause: %s", Me(e))), e.playing = !1, e.gclass.gmt.mt_pause ? e.gclass.gmt.mt_pause(e) : 0) : (Bt(`${Ve(e)}: GObj NOT PLAYING`), -1);
|
|
722
729
|
}
|
|
723
730
|
function Ae(e) {
|
|
724
|
-
return
|
|
731
|
+
return !Ye(e) && e.running;
|
|
725
732
|
}
|
|
726
733
|
function ke(e) {
|
|
727
|
-
return !!(e
|
|
734
|
+
return !!Ye(e) || e.disabled;
|
|
728
735
|
}
|
|
729
736
|
function Ie(e) {
|
|
730
|
-
return
|
|
737
|
+
return !!(e && e.gobj_flag & R.gobj_flag_service);
|
|
731
738
|
}
|
|
732
|
-
function $e() {
|
|
733
|
-
return !
|
|
739
|
+
function $e(e) {
|
|
740
|
+
return !Ye(e) && e.playing;
|
|
734
741
|
}
|
|
735
742
|
function Ce() {
|
|
736
|
-
|
|
737
|
-
return e ? Ue(e) : "";
|
|
743
|
+
return !p || p.obflag & w.obflag_destroyed ? null : p;
|
|
738
744
|
}
|
|
739
745
|
function Le() {
|
|
740
|
-
let e =
|
|
741
|
-
return e ?
|
|
746
|
+
let e = Ce();
|
|
747
|
+
return e ? Fe(e) : "";
|
|
742
748
|
}
|
|
743
749
|
function Pe() {
|
|
744
|
-
let e =
|
|
745
|
-
return e ?
|
|
750
|
+
let e = Ce();
|
|
751
|
+
return e ? _t(e, "yuno_role") : "";
|
|
746
752
|
}
|
|
747
|
-
function Ue(
|
|
748
|
-
|
|
753
|
+
function Ue() {
|
|
754
|
+
let e = Ce();
|
|
755
|
+
return e ? _t(e, "yuno_id") : "";
|
|
749
756
|
}
|
|
750
757
|
function Fe(e) {
|
|
751
|
-
return
|
|
758
|
+
return hn(e) ? e.gobj_name : (Bt("gobj bad type"), null);
|
|
752
759
|
}
|
|
753
760
|
function Ge(e) {
|
|
754
|
-
return
|
|
761
|
+
return hn(e) ? e.gclass.gclass_name : (Bt("gobj NULL of bad type"), null);
|
|
755
762
|
}
|
|
756
763
|
function Ve(e) {
|
|
757
|
-
|
|
758
|
-
let t = Ge(e), n = Me(e);
|
|
759
|
-
for (; n;) t = Ge(n) + "`" + t, n = Me(n);
|
|
760
|
-
return t;
|
|
764
|
+
return hn(e) ? e.gclass.gclass_name + "^" + Fe(e) : (Bt("gobj bad type"), null);
|
|
761
765
|
}
|
|
762
766
|
function Me(e) {
|
|
763
|
-
|
|
767
|
+
if (!hn(e)) return Bt("gobj NULL of bad type"), null;
|
|
768
|
+
let t = Ve(e), n = We(e);
|
|
769
|
+
for (; n;) t = Ve(n) + "`" + t, n = We(n);
|
|
770
|
+
return t;
|
|
764
771
|
}
|
|
765
772
|
function We(e) {
|
|
766
|
-
return
|
|
773
|
+
return hn(e) ? e.parent : (Bt("gobj NULL of bad type"), null);
|
|
767
774
|
}
|
|
768
775
|
function Ke(e) {
|
|
769
|
-
return
|
|
776
|
+
return hn(e) ? !!(e.gobj_flag & R.gobj_flag_volatil) : (Bt("gobj NULL of bad type"), null);
|
|
770
777
|
}
|
|
771
778
|
function xe(e) {
|
|
772
|
-
return
|
|
779
|
+
return hn(e) ? !!(e.gobj_flag & R.gobj_flag_pure_child) : (Bt("gobj NULL of bad type"), null);
|
|
773
780
|
}
|
|
774
781
|
function Ye(e) {
|
|
775
|
-
return
|
|
782
|
+
return !hn(e) || !!(e.obflag & (w.obflag_destroyed | w.obflag_destroying));
|
|
776
783
|
}
|
|
777
|
-
function Be(e
|
|
778
|
-
|
|
779
|
-
e.bottom_gobj && Kt(`${Ge(e)}: bottom_gobj already set`), e.bottom_gobj = t;
|
|
784
|
+
function Be(e) {
|
|
785
|
+
return hn(e) ? e.bottom_gobj : (Bt("gobj NULL of bad type"), null);
|
|
780
786
|
}
|
|
781
|
-
function Je(e, t
|
|
782
|
-
|
|
787
|
+
function Je(e, t) {
|
|
788
|
+
if (!hn(e)) return Bt("gobj NULL of bad type"), null;
|
|
789
|
+
e.bottom_gobj && Jt(`${Ve(e)}: bottom_gobj already set`), e.bottom_gobj = t;
|
|
783
790
|
}
|
|
784
|
-
function
|
|
785
|
-
return
|
|
791
|
+
function qe(e, t, n) {
|
|
792
|
+
return hn(e) ? t ? ee(e.gclass, t, n) : e.gclass.attrs_table : (Bt("gobj NULL of bad type"), null);
|
|
786
793
|
}
|
|
787
|
-
function
|
|
788
|
-
return
|
|
794
|
+
function He(e, t, n, r, o) {
|
|
795
|
+
return Ye(e) ? (Bt("gobj NULL, destroying, or bad type"), 0) : Qe(e.dl_children, t, n, r, o);
|
|
789
796
|
}
|
|
790
797
|
function ze(e, t, n, r, o) {
|
|
798
|
+
return Ye(e) ? (Bt("gobj NULL, destroying, or bad type"), 0) : Ze(e.dl_children, t, n, r, o);
|
|
799
|
+
}
|
|
800
|
+
function Qe(e, t, n, r, o) {
|
|
791
801
|
let i, l = [...e];
|
|
792
802
|
if (t & A.WALK_LAST2FIRST) for (let e = l.length; e > 0; e--) {
|
|
793
803
|
i = l[e - 1];
|
|
@@ -801,154 +811,154 @@
|
|
|
801
811
|
}
|
|
802
812
|
return 0;
|
|
803
813
|
}
|
|
804
|
-
function
|
|
805
|
-
let i, l =
|
|
814
|
+
function Xe(e, t, n, r, o) {
|
|
815
|
+
let i, l = Qe(e, t, n, r, o);
|
|
806
816
|
if (l < 0) return l;
|
|
807
817
|
if (t & A.WALK_LAST2FIRST) {
|
|
808
|
-
for (let s = e.length; s > 0; s--) if (i = e[s - 1], l =
|
|
809
|
-
} else for (let s = 0; s < e.length; s++) if (i = e[s], l =
|
|
818
|
+
for (let s = e.length; s > 0; s--) if (i = e[s - 1], l = Xe([...i.dl_children], t, n, r, o), l < 0) return l;
|
|
819
|
+
} else for (let s = 0; s < e.length; s++) if (i = e[s], l = Xe([...i.dl_children], t, n, r, o), l < 0) return l;
|
|
810
820
|
return l;
|
|
811
821
|
}
|
|
812
|
-
function
|
|
813
|
-
if (t & A.WALK_BYLEVEL) return
|
|
822
|
+
function Ze(e, t, n, r, o) {
|
|
823
|
+
if (t & A.WALK_BYLEVEL) return Xe(e, t, n, r, o);
|
|
814
824
|
let i, l;
|
|
815
825
|
if (t & A.WALK_BOTTOM2TOP) for (let s = e.length; s > 0; s--) {
|
|
816
|
-
if (l = e[s - 1], i =
|
|
826
|
+
if (l = e[s - 1], i = Ze([...l.dl_children], t, n, r, o), i < 0) return i;
|
|
817
827
|
if (i = n(l, r, o), i < 0) return i;
|
|
818
828
|
}
|
|
819
829
|
else for (let s = 0; s < e.length; s++) {
|
|
820
830
|
if (l = e[s], i = n(l, r, o), i < 0) return i;
|
|
821
|
-
if (0 === i && (i =
|
|
831
|
+
if (0 === i && (i = Ze([...l.dl_children], t, n, r, o), i < 0)) return i;
|
|
822
832
|
}
|
|
823
833
|
return 0;
|
|
824
834
|
}
|
|
825
|
-
function
|
|
826
|
-
if (!
|
|
835
|
+
function et(e, t) {
|
|
836
|
+
if (!hn(e)) return Bt("gobj NULL of bad type"), !1;
|
|
827
837
|
let n = t.__gclass_name__, r = t.__gobj_name__, o = t.__prefix_gobj_name__;
|
|
828
838
|
t.__disabled__;
|
|
829
839
|
let i = t.__state__;
|
|
830
|
-
if (n && n !==
|
|
831
|
-
if (r && r !==
|
|
840
|
+
if (n && n !== Ge(e)) return !1;
|
|
841
|
+
if (r && r !== Fe(e)) return !1;
|
|
832
842
|
if (o) {
|
|
833
843
|
let t = o.length;
|
|
834
|
-
if (o !==
|
|
844
|
+
if (o !== Fe(e).substring(0, t)) return !1;
|
|
835
845
|
}
|
|
836
|
-
if (i && i !==
|
|
846
|
+
if (i && i !== bt(e)) return !1;
|
|
837
847
|
let l = e.jn_attrs;
|
|
838
|
-
for (const n of Object.keys(t)) if ("__gclass_name__" !== n && "__gobj_name__" !== n && "__prefix_gobj_name__" !== n && "__disabled__" !== n && "__state__" !== n &&
|
|
848
|
+
for (const n of Object.keys(t)) if ("__gclass_name__" !== n && "__gobj_name__" !== n && "__prefix_gobj_name__" !== n && "__disabled__" !== n && "__state__" !== n && rt(e, n) && l[n] !== t[n]) return !1;
|
|
839
849
|
return !0;
|
|
840
850
|
}
|
|
841
|
-
function
|
|
842
|
-
if (
|
|
851
|
+
function tt(e, t) {
|
|
852
|
+
if (Ye(e)) return Bt("gobj NULL or DESTROYED"), null;
|
|
843
853
|
const n = e.dl_children;
|
|
844
854
|
for (let e = 0; e < n.length; e++) {
|
|
845
855
|
const r = n[e];
|
|
846
|
-
if (
|
|
856
|
+
if (et(r, t)) return r;
|
|
847
857
|
}
|
|
848
858
|
return null;
|
|
849
859
|
}
|
|
850
|
-
function
|
|
860
|
+
function nt(e, t) {
|
|
851
861
|
if (!t) return null;
|
|
852
862
|
let n = t.split("`");
|
|
853
863
|
if (!function(e, t) {
|
|
854
864
|
let n = t.split("^"), r = null, o = null;
|
|
855
865
|
if (2 === n.length) {
|
|
856
|
-
if (o = n[0], r = n[1], o !==
|
|
866
|
+
if (o = n[0], r = n[1], o !== Ge(e)) return !1;
|
|
857
867
|
} else {
|
|
858
868
|
if (1 !== n.length) return !1;
|
|
859
869
|
r = n[0];
|
|
860
870
|
}
|
|
861
|
-
return r ===
|
|
871
|
+
return r === Fe(e);
|
|
862
872
|
}(e, n[0])) return null;
|
|
863
873
|
if (1 === n.length) return e;
|
|
864
874
|
let r = n[1].split("^"), o = {};
|
|
865
875
|
1 === r.length ? o.__gobj_name__ = r : (o.__gclass_name__ = r[0], o.__gobj_name__ = r[1]);
|
|
866
|
-
let i =
|
|
867
|
-
return i ? (n.splice(0, 1), n = n.join("`"),
|
|
876
|
+
let i = tt(e, o);
|
|
877
|
+
return i ? (n.splice(0, 1), n = n.join("`"), nt(i, n)) : null;
|
|
868
878
|
}
|
|
869
|
-
function
|
|
870
|
-
return !
|
|
879
|
+
function rt(e, t) {
|
|
880
|
+
return !yn(t) && !!ee(e.gclass, t, !1);
|
|
871
881
|
}
|
|
872
|
-
function
|
|
882
|
+
function ot(e, t, n) {
|
|
873
883
|
let r = e.jn_attrs;
|
|
874
884
|
if (t in r && r.hasOwnProperty(t)) {
|
|
875
885
|
let n = r[t];
|
|
876
886
|
return e.gclass.gmt.mt_reading ? e.gclass.gmt.mt_reading(e, t, n) : n;
|
|
877
887
|
}
|
|
878
|
-
return
|
|
888
|
+
return Bt(`${Ve(e)}: GClass Attribute NOT FOUND, attr ${t}`), null;
|
|
879
889
|
}
|
|
880
|
-
function
|
|
890
|
+
function it(e, t, n) {
|
|
881
891
|
let r = {}, o = e.gclass.attrs_table;
|
|
882
892
|
for (let n = 0; n < o.length; n++) {
|
|
883
893
|
const i = o[n];
|
|
884
894
|
if (i.name && (-1 === t || i.flag & t)) {
|
|
885
895
|
let t;
|
|
886
|
-
!e.gclass.gmt.mt_reading || e.obflag & w.obflag_destroyed ? t =
|
|
896
|
+
!e.gclass.gmt.mt_reading || e.obflag & w.obflag_destroyed ? t = nn(e.jn_attrs, i.name) : (t = e.gclass.gmt.mt_reading(e, i.name), void 0 === t && (t = nn(e.jn_attrs, i.name))), on(r, i.name, t);
|
|
887
897
|
}
|
|
888
898
|
}
|
|
889
899
|
return r;
|
|
890
900
|
}
|
|
891
|
-
function
|
|
901
|
+
function lt(e, t) {
|
|
892
902
|
if (t) {
|
|
893
|
-
if (0 ===
|
|
894
|
-
if (0 ===
|
|
895
|
-
if (0 ===
|
|
896
|
-
if (0 ===
|
|
903
|
+
if (0 === Sn(t, "__disabled__")) return ke(e);
|
|
904
|
+
if (0 === Sn(t, "__running__")) return Ae(e);
|
|
905
|
+
if (0 === Sn(t, "__playing__")) return $e(e);
|
|
906
|
+
if (0 === Sn(t, "__service__")) return Ie(e);
|
|
897
907
|
}
|
|
898
|
-
let n =
|
|
899
|
-
return n ? !e.gclass.gmt.mt_reading || e.obflag & w.obflag_destroyed ?
|
|
900
|
-
}
|
|
901
|
-
function lt(e, t) {
|
|
902
|
-
t && hn(t, "__trace_level__");
|
|
903
|
-
let n = X(e, t, !1);
|
|
904
|
-
return n ? !e.gclass.gmt.mt_reading || e.obflag & w.obflag_destroyed ? Xt(n, t) : e.gclass.gmt.mt_reading(e, t) : (Wt(`${Ge(e)}: GClass Attribute NOT FOUND, attr ${t}`), 0);
|
|
908
|
+
let n = Z(e, t, !1);
|
|
909
|
+
return n ? !e.gclass.gmt.mt_reading || e.obflag & w.obflag_destroyed ? nn(n, t) : e.gclass.gmt.mt_reading(e, t) : (Bt(`${Ve(e)}: GClass Attribute NOT FOUND, attr ${t}`), 0);
|
|
905
910
|
}
|
|
906
911
|
function st(e, t) {
|
|
907
|
-
|
|
908
|
-
let n =
|
|
909
|
-
return n ? !e.gclass.gmt.mt_reading || e.obflag & w.obflag_destroyed ?
|
|
912
|
+
t && Sn(t, "__trace_level__");
|
|
913
|
+
let n = Z(e, t, !1);
|
|
914
|
+
return n ? !e.gclass.gmt.mt_reading || e.obflag & w.obflag_destroyed ? nn(n, t) : e.gclass.gmt.mt_reading(e, t) : (Bt(`${Ve(e)}: GClass Attribute NOT FOUND, attr ${t}`), 0);
|
|
910
915
|
}
|
|
911
916
|
function _t(e, t) {
|
|
912
|
-
|
|
913
|
-
|
|
917
|
+
if (t && 0 === Sn(t, "__state__")) return bt(e);
|
|
918
|
+
let n = Z(e, t, !1);
|
|
919
|
+
return n ? !e.gclass.gmt.mt_reading || e.obflag & w.obflag_destroyed ? nn(n, t) : e.gclass.gmt.mt_reading(e, t) : (Bt(`${Ve(e)}: GClass Attribute NOT FOUND, attr ${t}`), 0);
|
|
920
|
+
}
|
|
921
|
+
function at(e, t) {
|
|
922
|
+
let n = Z(e, t, !1);
|
|
923
|
+
return n ? !e.gclass.gmt.mt_reading || e.obflag & w.obflag_destroyed ? nn(n, t) : e.gclass.gmt.mt_reading(e, t) : (Bt(`${Ve(e)}: GClass Attribute NOT FOUND, attr ${t}`), 0);
|
|
914
924
|
}
|
|
915
|
-
function
|
|
916
|
-
let o =
|
|
925
|
+
function ut(e, t, n, r) {
|
|
926
|
+
let o = X(e), i = 0;
|
|
917
927
|
for (const [r, l] of Object.entries(t)) {
|
|
918
|
-
let t =
|
|
919
|
-
t && (-1 === n || t.flag & n) && (i +=
|
|
928
|
+
let t = qe(e, r, !0);
|
|
929
|
+
t && (-1 === n || t.flag & n) && (i += Q(e, o, t, l));
|
|
920
930
|
}
|
|
921
931
|
return i;
|
|
922
932
|
}
|
|
923
|
-
function ut(e, t, n) {
|
|
924
|
-
let r = X(e, t, !1);
|
|
925
|
-
return r ? (r[t] = En(n), an(e.priv) && e.priv.hasOwnProperty(t) && (e.priv[t] = n), e.obflag & w.obflag_created && !(e.obflag & w.obflag_destroyed) && e.gclass.gmt.mt_writing && e.gclass.gmt.mt_writing(e, t), 0) : (Wt(`${Ge(e)}: GClass Attribute NOT FOUND, attr ${t}`), -1);
|
|
926
|
-
}
|
|
927
933
|
function ct(e, t, n) {
|
|
928
|
-
let r =
|
|
929
|
-
return r ? (r[t] =
|
|
934
|
+
let r = Z(e, t, !1);
|
|
935
|
+
return r ? (r[t] = vn(n), gn(e.priv) && e.priv.hasOwnProperty(t) && (e.priv[t] = n), e.obflag & w.obflag_created && !(e.obflag & w.obflag_destroyed) && e.gclass.gmt.mt_writing && e.gclass.gmt.mt_writing(e, t), 0) : (Bt(`${Ve(e)}: GClass Attribute NOT FOUND, attr ${t}`), -1);
|
|
930
936
|
}
|
|
931
937
|
function ft(e, t, n) {
|
|
932
|
-
let r =
|
|
933
|
-
return r ? (r[t] =
|
|
938
|
+
let r = Z(e, t, !1);
|
|
939
|
+
return r ? (r[t] = parseInt(n), gn(e.priv) && e.priv.hasOwnProperty(t) && (e.priv[t] = n), e.obflag & w.obflag_created && !(e.obflag & w.obflag_destroyed) && e.gclass.gmt.mt_writing && e.gclass.gmt.mt_writing(e, t), 0) : (Bt(`${Ve(e)}: GClass Attribute NOT FOUND, attr ${t}`), -1);
|
|
940
|
+
}
|
|
941
|
+
function gt(e, t, n) {
|
|
942
|
+
let r = Z(e, t, !1);
|
|
943
|
+
return r ? (r[t] = String(n), gn(e.priv) && e.priv.hasOwnProperty(t) && (e.priv[t] = n), e.obflag & w.obflag_created && !(e.obflag & w.obflag_destroyed) && e.gclass.gmt.mt_writing && e.gclass.gmt.mt_writing(e, t), 0) : (Bt(`${Ve(e)}: GClass Attribute NOT FOUND, attr ${t}`), -1);
|
|
934
944
|
}
|
|
935
|
-
function
|
|
936
|
-
if (
|
|
945
|
+
function dt(e, t) {
|
|
946
|
+
if (Ye(e)) return Bt("gobj NULL or DESTROYED"), null;
|
|
937
947
|
if (e.current_state.state_name === t) return !1;
|
|
938
|
-
let r =
|
|
939
|
-
if (!r) return
|
|
948
|
+
let r = re(e.gclass, t);
|
|
949
|
+
if (!r) return Bt(`${Ve(e)}: state unknown, state ${t}`), !1;
|
|
940
950
|
e.last_state = e.current_state, e.current_state = r;
|
|
941
951
|
let o = J(e, "EV_STATE_CHANGED"), i = !!function(e) {
|
|
942
952
|
return W(e) & P.TRACE_STATES;
|
|
943
953
|
}(e);
|
|
944
|
-
return (o || i) && L(n("🔀🔀 mach(%s%s^%s), new st(%s), prev st(%s)", e.running ? "" : "!!",
|
|
954
|
+
return (o || i) && L(n("🔀🔀 mach(%s%s^%s), new st(%s), prev st(%s)", e.running ? "" : "!!", Ge(e), Fe(e), bt(e), e.last_state.state_name)), !0;
|
|
945
955
|
}
|
|
946
|
-
function
|
|
947
|
-
return
|
|
956
|
+
function bt(e) {
|
|
957
|
+
return hn(e) ? e.current_state.state_name : (Bt("hgobj NULL"), "");
|
|
948
958
|
}
|
|
949
|
-
function
|
|
950
|
-
if (!
|
|
951
|
-
let r =
|
|
959
|
+
function pt(e, t, n) {
|
|
960
|
+
if (!hn(e)) return Bt("gobj NULL of bad type"), null;
|
|
961
|
+
let r = ae(e.gclass, t);
|
|
952
962
|
if (r) return r;
|
|
953
963
|
if (n) {
|
|
954
964
|
const e = g.length, n = g;
|
|
@@ -959,47 +969,51 @@
|
|
|
959
969
|
}
|
|
960
970
|
return null;
|
|
961
971
|
}
|
|
962
|
-
function
|
|
963
|
-
let r =
|
|
972
|
+
function mt(e, t, n) {
|
|
973
|
+
let r = pt(e, t, !1);
|
|
964
974
|
return !!r && !(n && !(r.event_flag & n));
|
|
965
975
|
}
|
|
966
|
-
function
|
|
967
|
-
let r =
|
|
976
|
+
function Et(e, t, n) {
|
|
977
|
+
let r = pt(e, t, !1);
|
|
968
978
|
return !!r && !(n && !(r.event_flag & n)) && !!(r.event_flag & D.EVF_OUTPUT_EVENT);
|
|
969
979
|
}
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
980
|
+
var Tt = [], ht = !1;
|
|
981
|
+
function yt() {
|
|
982
|
+
ht = !1;
|
|
983
|
+
let e = Tt;
|
|
984
|
+
Tt = [];
|
|
985
|
+
let t = 0;
|
|
986
|
+
for (let n of e) n.dst.obflag & (w.obflag_destroyed | w.obflag_destroying) || (vt(n.dst, n.event, n.kw, n.src), t++);
|
|
987
|
+
return Tt.length > 0 && !ht && (ht = !0, setTimeout(yt, 0)), t;
|
|
988
|
+
}
|
|
989
|
+
function vt(e, t, r, o) {
|
|
990
|
+
if (!(e && e instanceof O)) return Bt("gobj dst NULL"), -1;
|
|
991
|
+
if (e.obflag & (w.obflag_destroyed | w.obflag_destroying)) return Bt("gobj dst DESTROYED"), -1;
|
|
973
992
|
let i = e.current_state;
|
|
974
|
-
if (!i) return
|
|
975
|
-
let l = J(e, t) && !
|
|
976
|
-
if (V > 1) return !1;
|
|
977
|
-
if (!e) return !0;
|
|
978
|
-
const n = K(e);
|
|
979
|
-
return !!(n & P.TRACE_MACHINE || n & P.TRACE_TIMER_PERIODIC && "EV_TIMEOUT_PERIODIC" === t || n & P.TRACE_TIMER && "EV_TIMEOUT" === t);
|
|
980
|
-
}(o, t);
|
|
993
|
+
if (!i) return Bt(`${Ve(e)}: current_state NULL`), -1;
|
|
994
|
+
let l = J(e, t) && !q(o, t);
|
|
981
995
|
E++;
|
|
982
|
-
let s =
|
|
983
|
-
if (!s) return e.gclass.gmt.mt_inject_event ? (E--, l && (L(n("🔃 mach(%s%s), st: %s, ev: %s, from(%s%s)", e.running ? "" : "!!",
|
|
996
|
+
let s = oe(i, t);
|
|
997
|
+
if (!s) return e.gclass.gmt.mt_inject_event ? (E--, l && (L(n("🔃 mach(%s%s), st: %s, ev: %s, from(%s%s)", e.running ? "" : "!!", Ve(e), i.state_name, t || "", o && !o.running ? "!!" : "", Ve(o))), r && l > 1 && un(r) && zt(r)), e.gclass.gmt.mt_inject_event(e, t, r, o)) : (l && L(n("📛 mach(%s%s^%s), st: %s, ev: %s, 📛📛ERROR Event NOT DEFINED in state📛📛, from(%s%s^%s)", e.running ? "" : "!!", Ge(e), Fe(e), i.state_name, t || "", o && !o.running ? "!!" : "", Ge(o), Fe(o))), Bt(`📛📛 Event NOT DEFINED in state 📛📛: ${Ve(e)}, ${i.state_name}, ${t}`), E--, -1);
|
|
984
998
|
if (l) {
|
|
985
|
-
if (1 === C) L(n("🔄 %s %s%s %s from %s%s", t || "", e.running ? "" : "!!",
|
|
999
|
+
if (1 === C) L(n("🔄 %s %s%s %s from %s%s", t || "", e.running ? "" : "!!", Ve(e), i.state_name, o && !o.running ? "!!" : "", Ve(o)));
|
|
986
1000
|
else {
|
|
987
1001
|
let r = "";
|
|
988
|
-
s.action && (r =
|
|
1002
|
+
s.action && (r = ar(s.action)), L(n("🔄 mach(%s%s^%s), st: %s, ev: %s%s%s, ac: %s, from(%s%s^%s)", e.running ? "" : "!!", Ge(e), Fe(e), i.state_name, "", t || "", "", r, o && !o.running ? "!!" : "", Ge(o), Fe(o)));
|
|
989
1003
|
}
|
|
990
|
-
r && (W(e) | x()) & P.TRACE_EV_KW &&
|
|
1004
|
+
r && (W(e) | x()) & P.TRACE_EV_KW && un(r) && zt(r);
|
|
991
1005
|
}
|
|
992
|
-
s.next_state &&
|
|
1006
|
+
s.next_state && dt(e, s.next_state);
|
|
993
1007
|
let _ = -1;
|
|
994
1008
|
try {
|
|
995
1009
|
s.action && (_ = s.action(e, t, r, o));
|
|
996
1010
|
} finally {}
|
|
997
|
-
return !l || 1 === C || e.obflag & w.obflag_destroyed || L(n("<- mach(%s%s^%s), st: %s, ev: %s, ret: %d", e.running ? "" : "!!",
|
|
1011
|
+
return !l || 1 === C || e.obflag & w.obflag_destroyed || L(n("<- mach(%s%s^%s), st: %s, ev: %s, ret: %d", e.running ? "" : "!!", Ge(e), Fe(e), e.current_state.state_name, t || "", pn(_) ? _ : 0)), E--, _;
|
|
998
1012
|
}
|
|
999
|
-
var
|
|
1013
|
+
var jt = Object.freeze({
|
|
1000
1014
|
__hard_subscription__: 1,
|
|
1001
1015
|
__own_event__: 2
|
|
1002
|
-
}),
|
|
1016
|
+
}), St = [
|
|
1003
1017
|
j(T.DTP_POINTER, "publisher", 0, null, "publisher gobj"),
|
|
1004
1018
|
j(T.DTP_POINTER, "subscriber", 0, null, "subscriber gobj"),
|
|
1005
1019
|
j(T.DTP_STRING, "event", 0, "", "event name subscribed"),
|
|
@@ -1012,48 +1026,48 @@
|
|
|
1012
1026
|
j(T.DTP_STRING, "__service__", 0, "", "subscription service"),
|
|
1013
1027
|
v()
|
|
1014
1028
|
];
|
|
1015
|
-
function
|
|
1016
|
-
let i =
|
|
1017
|
-
if (t && t !==
|
|
1018
|
-
let t =
|
|
1019
|
-
|
|
1029
|
+
function Ot(e, t, n, r, o) {
|
|
1030
|
+
let i = Cn(t, r, "__config__", null), l = Cn(t, r, "__global__", null), s = Cn(t, r, "__local__", null), _ = Ln(t, r, "__filter__", null), a = !0;
|
|
1031
|
+
if (t && t !== $n(null, e, "publisher", null) && (a = !1), o && o !== $n(null, e, "subscriber", null) && (a = !1), n && n !== In(null, e, "event", "") && (a = !1), fn(i) > 0) {
|
|
1032
|
+
let t = Cn(null, e, "__config__", null);
|
|
1033
|
+
fn(t) > 0 && Xt(t, i) || (a = !1);
|
|
1020
1034
|
}
|
|
1021
|
-
if (
|
|
1022
|
-
let t =
|
|
1023
|
-
|
|
1035
|
+
if (fn(l) > 0) {
|
|
1036
|
+
let t = Cn(null, e, "__global__", null);
|
|
1037
|
+
fn(t) > 0 && Xt(t, l) || (a = !1);
|
|
1024
1038
|
}
|
|
1025
|
-
if (
|
|
1026
|
-
let t =
|
|
1027
|
-
|
|
1039
|
+
if (fn(s) > 0) {
|
|
1040
|
+
let t = Cn(null, e, "__local__", null);
|
|
1041
|
+
fn(t) > 0 && Xt(t, s) || (a = !1);
|
|
1028
1042
|
}
|
|
1029
|
-
if (
|
|
1030
|
-
let t =
|
|
1031
|
-
|
|
1043
|
+
if (fn(_) > 0) {
|
|
1044
|
+
let t = Ln(null, e, "__filter__", null);
|
|
1045
|
+
fn(t) > 0 && Xt(t, _) || (a = !1);
|
|
1032
1046
|
}
|
|
1033
1047
|
return a;
|
|
1034
1048
|
}
|
|
1035
|
-
function
|
|
1049
|
+
function Nt(e, t, n, r, o) {
|
|
1036
1050
|
let i = [];
|
|
1037
1051
|
for (let l = 0; l < e.length; l++) {
|
|
1038
1052
|
let s = e[l];
|
|
1039
|
-
|
|
1053
|
+
Ot(s, t, n, r, o) && sn(i, s);
|
|
1040
1054
|
}
|
|
1041
1055
|
return i;
|
|
1042
1056
|
}
|
|
1043
|
-
function
|
|
1044
|
-
for (let i = 0; i < e.length; i++) if (
|
|
1057
|
+
function Rt(e, t, n, r, o) {
|
|
1058
|
+
for (let i = 0; i < e.length; i++) if (Ot(e[i], t, n, r, o)) return i;
|
|
1045
1059
|
return -1;
|
|
1046
1060
|
}
|
|
1047
|
-
function
|
|
1048
|
-
let i =
|
|
1049
|
-
if (!!(
|
|
1050
|
-
p &&
|
|
1051
|
-
let _ =
|
|
1052
|
-
return _ >= 0 ?
|
|
1061
|
+
function wt(e, t, r, o) {
|
|
1062
|
+
let i = $n(e, t, "publisher", null, Ct.KW_REQUIRED), l = $n(e, t, "subscriber", null, Ct.KW_REQUIRED), s = In(e, t, "event", "", Ct.KW_REQUIRED);
|
|
1063
|
+
if (!!(kn(e, t, "subs_flag", null, Ct.KW_REQUIRED) & jt.__hard_subscription__) && !r) return -1;
|
|
1064
|
+
p && lt(p, "trace_subscriptions") && (L(n("💜💜👎 unsubscribing event '%s': publisher %s, subscriber'%s'", s || "", Ve(i), Ve(l))), zt(t)), i.obflag & w.obflag_destroyed || o || i.gclass.gmt.mt_subscription_deleted && i.gclass.gmt.mt_subscription_deleted(i, t);
|
|
1065
|
+
let _ = Rt(i.dl_subscriptions, i, s, t, l);
|
|
1066
|
+
return _ >= 0 ? an(i.dl_subscriptions, _) : (Bt(`${Ve(e)}: subscription in publisher not found`), zt(t)), _ = Rt(l.dl_subscribings, i, s, t, l), _ >= 0 ? an(l.dl_subscribings, _) : (Bt(`${Ve(e)}: subscription in subscriber not found`), zt(t)), 0;
|
|
1053
1067
|
}
|
|
1054
|
-
function
|
|
1055
|
-
if (null == r && (r = {}), !e) return
|
|
1056
|
-
if (!o) return
|
|
1068
|
+
function Dt(e, t, r, o) {
|
|
1069
|
+
if (null == r && (r = {}), !e) return Bt(`publisher NULL: ev ${t}`), 0;
|
|
1070
|
+
if (!o) return Bt(`subscriber NULL: ev ${t}`), 0;
|
|
1057
1071
|
const i = new Set([
|
|
1058
1072
|
"__config__",
|
|
1059
1073
|
"__global__",
|
|
@@ -1062,52 +1076,52 @@
|
|
|
1062
1076
|
"__service__"
|
|
1063
1077
|
]);
|
|
1064
1078
|
if (Object.keys(r).forEach((n) => {
|
|
1065
|
-
i.has(n) ||
|
|
1066
|
-
}),
|
|
1067
|
-
else if (!(
|
|
1068
|
-
let l =
|
|
1069
|
-
|
|
1079
|
+
i.has(n) || Bt(`${Ve(e)}: key ignored in subscription (key: ${n}, event: ${t})`);
|
|
1080
|
+
}), yn(t)) t = "";
|
|
1081
|
+
else if (!(Et(e, t, D.EVF_OUTPUT_EVENT) || e.gclass.gclass_flag & N.gcflag_no_check_output_events)) return Bt(`event NOT in output event list: ${Ve(e)}, ${t}`), 0;
|
|
1082
|
+
let l = Nt(e.dl_subscriptions, e, t, r, o);
|
|
1083
|
+
cn(l) > 0 && (Bt(`${Ve(e)}: ${cn(l)} subscription(s) REPEATED, will be deleted and override`), zt(l, "subscription REPEATED"), At(e, l, !1));
|
|
1070
1084
|
let s = function(e, t, n, r) {
|
|
1071
|
-
let o = H(e,
|
|
1072
|
-
|
|
1085
|
+
let o = H(e, St);
|
|
1086
|
+
ln(o, "event", t), ln(o, "subscriber", r), ln(o, "publisher", e);
|
|
1073
1087
|
let i = 0;
|
|
1074
1088
|
if (n) {
|
|
1075
|
-
let t =
|
|
1076
|
-
if (
|
|
1077
|
-
let n =
|
|
1078
|
-
if (
|
|
1079
|
-
let t =
|
|
1080
|
-
|
|
1089
|
+
let t = Cn(e, n, "__config__", null), r = Cn(e, n, "__global__", null), l = Cn(e, n, "__local__", null), s = Ln(e, n, "__filter__", null), _ = In(e, n, "__service__", "");
|
|
1090
|
+
if (fn(r) > 0 && ln(o, "__global__", Qt(r)), fn(t) > 0) {
|
|
1091
|
+
let n = Qt(t);
|
|
1092
|
+
if (ln(o, "__config__", n), Rn(n, "__hard_subscription__")) {
|
|
1093
|
+
let t = An(e, n, "__hard_subscription__", !1);
|
|
1094
|
+
rn(n, "__hard_subscription__"), t && (i |= jt.__hard_subscription__);
|
|
1081
1095
|
}
|
|
1082
|
-
if (
|
|
1083
|
-
let t =
|
|
1084
|
-
|
|
1096
|
+
if (Rn(n, "__own_event__")) {
|
|
1097
|
+
let t = An(e, n, "__own_event__", !1);
|
|
1098
|
+
rn(n, "__own_event__"), t && (i |= jt.__own_event__);
|
|
1085
1099
|
}
|
|
1086
1100
|
}
|
|
1087
|
-
|
|
1101
|
+
fn(l) > 0 && ln(o, "__local__", Qt(l)), fn(s) > 0 && ln(o, "__filter__", Qt(s)), yn(_) || ln(o, "__service__", _);
|
|
1088
1102
|
}
|
|
1089
|
-
return
|
|
1103
|
+
return ln(o, "subs_flag", i), o;
|
|
1090
1104
|
}(e, t, r, o);
|
|
1091
|
-
return s ? (
|
|
1105
|
+
return s ? (sn(e.dl_subscriptions, s), sn(o.dl_subscribings, s), p && lt(p, "trace_subscriptions") && (L(n("💜💜👍 subscribing event '%s', publisher '%s', subscriber %s", t || "", Ve(e), Ve(o))), r && zt(r)), e.gclass.gmt.mt_subscription_added && e.gclass.gmt.mt_subscription_added(e, s) < 0 && (wt(e, s, !0, !0), s = 0), s) : (Bt(`${Ve(e)}: _create_subscription() FAILED`), 0);
|
|
1092
1106
|
}
|
|
1093
|
-
function
|
|
1107
|
+
function At(e, t, n) {
|
|
1094
1108
|
let r = [...t];
|
|
1095
|
-
for (let t = 0; t < r.length; t++)
|
|
1109
|
+
for (let t = 0; t < r.length; t++) wt(e, r[t], n, !1);
|
|
1096
1110
|
return 0;
|
|
1097
1111
|
}
|
|
1098
|
-
function
|
|
1099
|
-
return null == n && (n = {}),
|
|
1112
|
+
function kt(e, t, n, r) {
|
|
1113
|
+
return null == n && (n = {}), Nt(e.dl_subscriptions, e, t, n, r);
|
|
1100
1114
|
}
|
|
1101
|
-
function
|
|
1102
|
-
return
|
|
1115
|
+
function It(e, t, n, r) {
|
|
1116
|
+
return Nt(e.dl_subscribings, r, t, n, e);
|
|
1103
1117
|
}
|
|
1104
|
-
function
|
|
1105
|
-
if (
|
|
1106
|
-
if (
|
|
1107
|
-
let o =
|
|
1108
|
-
if (!(o && o.event_flag & (D.EVF_SYSTEM_EVENT | D.EVF_OUTPUT_EVENT) || e.gclass.gclass_flag & N.gcflag_no_check_output_events)) return
|
|
1109
|
-
let i = p &&
|
|
1110
|
-
if (i && (L(n("🔝🔝 mach(%s%s^%s), st: %s, ev: %s%s%s", e.running ? "" : "!!",
|
|
1118
|
+
function $t(e, t, r) {
|
|
1119
|
+
if (gn(r) || (r = {}), !e || e.obflag & (w.obflag_destroyed | w.obflag_destroying)) return Bt("gobj NULL or DESTROYED"), -1;
|
|
1120
|
+
if (yn(t)) return Bt(`${Ve(e)}: event EMPTY`), -1;
|
|
1121
|
+
let o = pt(e, t, !0);
|
|
1122
|
+
if (!(o && o.event_flag & (D.EVF_SYSTEM_EVENT | D.EVF_OUTPUT_EVENT) || e.gclass.gclass_flag & N.gcflag_no_check_output_events)) return Bt(`event NOT in output event list: ${Ve(e)}, ev ${t}`), -1;
|
|
1123
|
+
let i = p && lt(p, "trace_subscriptions");
|
|
1124
|
+
if (i && (L(n("🔝🔝 mach(%s%s^%s), st: %s, ev: %s%s%s", e.running ? "" : "!!", Ge(e), Fe(e), e.current_state.state_name, "", t || "", "")), zt(r)), e.gclass.gmt.mt_publish_event) {
|
|
1111
1125
|
let n = e.gclass.gmt.mt_publish_event(e, t, r);
|
|
1112
1126
|
if (n <= 0) return n;
|
|
1113
1127
|
}
|
|
@@ -1119,28 +1133,28 @@
|
|
|
1119
1133
|
if (n < 0) break;
|
|
1120
1134
|
if (0 === n) continue;
|
|
1121
1135
|
}
|
|
1122
|
-
let u =
|
|
1123
|
-
if (!u ||
|
|
1124
|
-
let c =
|
|
1125
|
-
if (
|
|
1126
|
-
|
|
1127
|
-
let o =
|
|
1128
|
-
if (e.gclass.gmt.mt_publication_filter ? d = e.gclass.gmt.mt_publication_filter(e, t, g, u) :
|
|
1136
|
+
let u = $n(e, a, "subscriber", null, Ct.KW_REQUIRED);
|
|
1137
|
+
if (!u || Ye(u)) continue;
|
|
1138
|
+
let c = kn(e, a, "subs_flag", 0, Ct.KW_REQUIRED), f = In(e, a, "event", "", Ct.KW_REQUIRED);
|
|
1139
|
+
if (yn(f) || 0 === Sn(f, t)) {
|
|
1140
|
+
Cn(e, a, "__config__", null, 0);
|
|
1141
|
+
let o = Cn(e, a, "__global__", null, 0), l = Cn(e, a, "__local__", null, 0), f = Ln(e, a, "__filter__", null, 0), g = r, d = 1;
|
|
1142
|
+
if (e.gclass.gmt.mt_publication_filter ? d = e.gclass.gmt.mt_publication_filter(e, t, g, u) : fn(f) > 0 && (d = Gn(g, f), i && (L(n("💜💜🔄%s publishing with filter, event '%s', subscriber'%s', publisher %s", d ? "👍" : "👎", t || "", Ve(u), Ve(e))), zt(f))), d < 0) break;
|
|
1129
1143
|
if (0 === d) continue;
|
|
1130
|
-
let b =
|
|
1131
|
-
if (b && b.event_flag & D.EVF_SYSTEM_EVENT && !
|
|
1132
|
-
l &&
|
|
1133
|
-
let p =
|
|
1134
|
-
if (p < 0 && c &
|
|
1144
|
+
let b = pt(u, t, !0);
|
|
1145
|
+
if (b && b.event_flag & D.EVF_SYSTEM_EVENT && !mt(u, b.event_name, 0)) continue;
|
|
1146
|
+
l && Nn(g, l), o && Zt(g, o), i && (L(n("🔝🔄 mach(%s%s), st: %s, ev: %s, from(%s%s)", u.running ? "" : "!!", Ve(u), bt(u), t || "", e && !e.running ? "!!" : "", Ve(e))), zt(g));
|
|
1147
|
+
let p = vt(u, t, g, e);
|
|
1148
|
+
if (p < 0 && c & jt.__own_event__) {
|
|
1135
1149
|
s = -1;
|
|
1136
1150
|
break;
|
|
1137
1151
|
}
|
|
1138
|
-
if (_ += p, s++,
|
|
1152
|
+
if (_ += p, s++, Ye(e)) break;
|
|
1139
1153
|
}
|
|
1140
1154
|
}
|
|
1141
|
-
return s || o && o.event_flag & D.EVF_NO_WARN_SUBS ||
|
|
1155
|
+
return s || o && o.event_flag & D.EVF_NO_WARN_SUBS || Jt(`${Ve(e)}: Publish event WITHOUT subscribers, ev ${t}`), _;
|
|
1142
1156
|
}
|
|
1143
|
-
var
|
|
1157
|
+
var Ct = Object.freeze({
|
|
1144
1158
|
KW_REQUIRED: 1,
|
|
1145
1159
|
KW_CREATE: 2,
|
|
1146
1160
|
KW_WILD_NUMBER: 4,
|
|
@@ -1149,7 +1163,7 @@
|
|
|
1149
1163
|
KW_VERBOSE: 32,
|
|
1150
1164
|
KW_LOWER: 64,
|
|
1151
1165
|
KW_RECURSIVE: 128
|
|
1152
|
-
}),
|
|
1166
|
+
}), Lt = (Object.freeze({
|
|
1153
1167
|
JSON_OBJECT: 1,
|
|
1154
1168
|
JSON_ARRAY: 2,
|
|
1155
1169
|
JSON_STRING: 3,
|
|
@@ -1158,23 +1172,23 @@
|
|
|
1158
1172
|
JSON_TRUE: 6,
|
|
1159
1173
|
JSON_FALSE: 7,
|
|
1160
1174
|
JSON_NULL: 8
|
|
1161
|
-
}), "undefined" != typeof window ? window.console : console),
|
|
1162
|
-
var
|
|
1163
|
-
var
|
|
1164
|
-
function
|
|
1165
|
-
if (
|
|
1166
|
-
|
|
1175
|
+
}), "undefined" != typeof window ? window.console : console), Pt = Lt.error, Ut = Lt.warn, Ft = Lt.info, Gt = Lt.debug, Vt = null;
|
|
1176
|
+
var Mt = !0;
|
|
1177
|
+
var Wt = !1;
|
|
1178
|
+
function Kt(e, t, n) {
|
|
1179
|
+
if (Vt && !Wt) {
|
|
1180
|
+
Wt = !0;
|
|
1167
1181
|
try {
|
|
1168
|
-
|
|
1182
|
+
Vt(e, t, n);
|
|
1169
1183
|
} catch (e) {} finally {
|
|
1170
|
-
|
|
1184
|
+
Wt = !1;
|
|
1171
1185
|
}
|
|
1172
1186
|
}
|
|
1173
1187
|
}
|
|
1174
|
-
function
|
|
1175
|
-
e ? (
|
|
1188
|
+
function xt(e) {
|
|
1189
|
+
e ? (Pt = e, Ut = e) : (Pt = Lt.error, Ut = Lt.warn);
|
|
1176
1190
|
}
|
|
1177
|
-
function
|
|
1191
|
+
function Yt(e) {
|
|
1178
1192
|
const t = Array.prototype.slice.call(arguments);
|
|
1179
1193
|
let n = "";
|
|
1180
1194
|
if ("string" == typeof e) {
|
|
@@ -1196,36 +1210,36 @@
|
|
|
1196
1210
|
} else n = t.map((e) => "object" == typeof e ? JSON.stringify(e) : String(e)).join(" ");
|
|
1197
1211
|
return n;
|
|
1198
1212
|
}
|
|
1199
|
-
function
|
|
1200
|
-
let t =
|
|
1201
|
-
|
|
1213
|
+
function Bt(e) {
|
|
1214
|
+
let t = Yt(e), n = lr();
|
|
1215
|
+
Pt && (Pt === Lt.error ? Mt && Pt("%c" + n + " ERROR: " + String(t), "color:red") : (Mt && Lt.error("%c" + n + " ERROR: " + String(t), "color:red"), Pt(`${n} ERROR: ${String(t)}`))), Kt("error", t, n);
|
|
1202
1216
|
}
|
|
1203
|
-
function
|
|
1204
|
-
let t =
|
|
1205
|
-
|
|
1217
|
+
function Jt(e) {
|
|
1218
|
+
let t = Yt(e), n = lr();
|
|
1219
|
+
Ut && (Ut === Lt.warn ? Mt && Ut("%c" + n + " WARNING: " + String(t), "color:yellow") : (Mt && Lt.warn("%c" + n + " WARNING: " + String(t), "color:yellow"), Ut(`${n} WARNING: ${String(t)}`))), Kt("warning", t, n);
|
|
1206
1220
|
}
|
|
1207
|
-
function
|
|
1208
|
-
let t =
|
|
1209
|
-
|
|
1221
|
+
function qt(e) {
|
|
1222
|
+
let t = Yt(e), n = lr();
|
|
1223
|
+
Gt && Mt && Gt("%c" + n + " DEBUG: " + String(t), "color:silver"), Kt("debug", t, n);
|
|
1210
1224
|
}
|
|
1211
|
-
function
|
|
1212
|
-
let t =
|
|
1213
|
-
|
|
1225
|
+
function Ht(e) {
|
|
1226
|
+
let t = Yt(e), n = lr();
|
|
1227
|
+
Gt && Mt && Gt("%c" + n + " MSG: " + String(t), "color:cyan"), Kt("msg", t, n);
|
|
1214
1228
|
}
|
|
1215
|
-
function
|
|
1216
|
-
|
|
1229
|
+
function zt(e, t) {
|
|
1230
|
+
Mt && (t && window.console.warn("=====> " + t), window.console.dir(e)), Kt("json", e, lr());
|
|
1217
1231
|
}
|
|
1218
|
-
function
|
|
1232
|
+
function Qt(e) {
|
|
1219
1233
|
return structuredClone(e);
|
|
1220
1234
|
}
|
|
1221
|
-
function
|
|
1235
|
+
function Xt(e, t) {
|
|
1222
1236
|
if (e === t) return !0;
|
|
1223
1237
|
if (null === e || null === t) return e === t;
|
|
1224
1238
|
if (typeof e != typeof t) return !1;
|
|
1225
1239
|
if (Array.isArray(e) !== Array.isArray(t)) return !1;
|
|
1226
1240
|
if (Array.isArray(e)) {
|
|
1227
1241
|
if (e.length !== t.length) return !1;
|
|
1228
|
-
for (let n = 0; n < e.length; n++) if (!
|
|
1242
|
+
for (let n = 0; n < e.length; n++) if (!Xt(e[n], t[n])) return !1;
|
|
1229
1243
|
return !0;
|
|
1230
1244
|
}
|
|
1231
1245
|
if ("object" == typeof e) {
|
|
@@ -1233,211 +1247,211 @@
|
|
|
1233
1247
|
if (n.length !== r.length) return !1;
|
|
1234
1248
|
for (let o = 0; o < n.length; o++) {
|
|
1235
1249
|
if (n[o] !== r[o]) return !1;
|
|
1236
|
-
if (!
|
|
1250
|
+
if (!Xt(e[n[o]], t[r[o]])) return !1;
|
|
1237
1251
|
}
|
|
1238
1252
|
return !0;
|
|
1239
1253
|
}
|
|
1240
1254
|
return e === t;
|
|
1241
1255
|
}
|
|
1242
|
-
function
|
|
1256
|
+
function Zt(e, t) {
|
|
1243
1257
|
if (!t) return e;
|
|
1244
1258
|
for (let n of Object.keys(t)) e[n] = t[n];
|
|
1245
1259
|
return e;
|
|
1246
1260
|
}
|
|
1247
|
-
function
|
|
1261
|
+
function en(e, t) {
|
|
1248
1262
|
if (!t) return e;
|
|
1249
1263
|
for (let n in t) t.hasOwnProperty(n) && e.hasOwnProperty(n) && (e[n] = t[n]);
|
|
1250
1264
|
return e;
|
|
1251
1265
|
}
|
|
1252
|
-
function
|
|
1266
|
+
function tn(e, t) {
|
|
1253
1267
|
if (!t) return e;
|
|
1254
1268
|
for (let n in t) t.hasOwnProperty(n) && !e.hasOwnProperty(n) && (e[n] = t[n]);
|
|
1255
1269
|
return e;
|
|
1256
1270
|
}
|
|
1257
|
-
function
|
|
1271
|
+
function nn(e, t) {
|
|
1258
1272
|
if (e && e.hasOwnProperty(t)) return e[t];
|
|
1259
1273
|
}
|
|
1260
|
-
function
|
|
1274
|
+
function rn(e, t) {
|
|
1261
1275
|
e && e.hasOwnProperty(t) && delete e[t];
|
|
1262
1276
|
}
|
|
1263
|
-
function
|
|
1277
|
+
function on(e, t, n) {
|
|
1264
1278
|
e[t] = n;
|
|
1265
1279
|
}
|
|
1266
|
-
function
|
|
1280
|
+
function ln(e, t, n) {
|
|
1267
1281
|
e[t] = n;
|
|
1268
1282
|
}
|
|
1269
|
-
function
|
|
1283
|
+
function sn(e, t) {
|
|
1270
1284
|
e.push(t);
|
|
1271
1285
|
}
|
|
1272
|
-
function
|
|
1286
|
+
function _n(e, t) {
|
|
1273
1287
|
e.push(t);
|
|
1274
1288
|
}
|
|
1275
|
-
function
|
|
1289
|
+
function an(e, t) {
|
|
1276
1290
|
e.splice(t, 1);
|
|
1277
1291
|
}
|
|
1278
|
-
function
|
|
1279
|
-
return
|
|
1292
|
+
function un(e) {
|
|
1293
|
+
return gn(e) ? Object.keys(e).length : 0;
|
|
1280
1294
|
}
|
|
1281
|
-
function
|
|
1282
|
-
return
|
|
1295
|
+
function cn(e) {
|
|
1296
|
+
return dn(e) ? e.length : 0;
|
|
1283
1297
|
}
|
|
1284
|
-
function
|
|
1285
|
-
return
|
|
1298
|
+
function fn(e) {
|
|
1299
|
+
return gn(e) ? Object.keys(e).length : dn(e) ? e.length : bn(e) && e.length > 0 ? 1 : 0;
|
|
1286
1300
|
}
|
|
1287
|
-
function
|
|
1301
|
+
function gn(e) {
|
|
1288
1302
|
return null !== e && "object" == typeof e && !Array.isArray(e);
|
|
1289
1303
|
}
|
|
1290
|
-
function
|
|
1304
|
+
function dn(e) {
|
|
1291
1305
|
return Array.isArray(e);
|
|
1292
1306
|
}
|
|
1293
|
-
function
|
|
1307
|
+
function bn(e) {
|
|
1294
1308
|
return "string" == typeof e;
|
|
1295
1309
|
}
|
|
1296
|
-
function
|
|
1310
|
+
function pn(e) {
|
|
1297
1311
|
return "number" == typeof e && Number.isFinite(e);
|
|
1298
1312
|
}
|
|
1299
|
-
function
|
|
1313
|
+
function mn(e) {
|
|
1300
1314
|
return "boolean" == typeof e;
|
|
1301
1315
|
}
|
|
1302
|
-
function
|
|
1316
|
+
function En(e) {
|
|
1303
1317
|
return null == e;
|
|
1304
1318
|
}
|
|
1305
|
-
function
|
|
1319
|
+
function Tn(e) {
|
|
1306
1320
|
return "function" == typeof e;
|
|
1307
1321
|
}
|
|
1308
|
-
function
|
|
1322
|
+
function hn(e) {
|
|
1309
1323
|
return e instanceof O;
|
|
1310
1324
|
}
|
|
1311
|
-
function
|
|
1312
|
-
return !
|
|
1325
|
+
function yn(e) {
|
|
1326
|
+
return !bn(e) || 0 === e.length;
|
|
1313
1327
|
}
|
|
1314
|
-
function
|
|
1315
|
-
return
|
|
1328
|
+
function vn(e) {
|
|
1329
|
+
return pn(e) ? Boolean(e) : /^\s*(true|1|on)\s*$/i.test(e);
|
|
1316
1330
|
}
|
|
1317
|
-
function
|
|
1331
|
+
function jn(e, t) {
|
|
1318
1332
|
return e === t ? 0 : e > t ? 1 : -1;
|
|
1319
1333
|
}
|
|
1320
|
-
function
|
|
1334
|
+
function Sn(e, t) {
|
|
1321
1335
|
let n = e.toLowerCase(), r = t.toLowerCase();
|
|
1322
1336
|
return n === r ? 0 : n > r ? 1 : -1;
|
|
1323
1337
|
}
|
|
1324
|
-
function
|
|
1325
|
-
if (
|
|
1326
|
-
if (
|
|
1338
|
+
function On(e, t) {
|
|
1339
|
+
if (gn(e) || gn(t) || dn(e) || dn(t)) return 0;
|
|
1340
|
+
if (pn(e) || pn(t)) {
|
|
1327
1341
|
let n = Number(e), r = Number(t);
|
|
1328
1342
|
return n > r ? 1 : n < r ? -1 : 0;
|
|
1329
1343
|
}
|
|
1330
|
-
if (
|
|
1344
|
+
if (mn(e) || mn(t)) {
|
|
1331
1345
|
let n = Number(e), r = Number(t);
|
|
1332
1346
|
return n > r ? 1 : n < r ? -1 : 0;
|
|
1333
1347
|
}
|
|
1334
|
-
return
|
|
1348
|
+
return jn(String(e), String(t));
|
|
1335
1349
|
}
|
|
1336
|
-
function
|
|
1337
|
-
if ("object" != typeof t || Array.isArray(t)) if (Array.isArray(t)) for (const n of t)
|
|
1350
|
+
function Nn(e, t) {
|
|
1351
|
+
if ("object" != typeof t || Array.isArray(t)) if (Array.isArray(t)) for (const n of t) Nn(e, n);
|
|
1338
1352
|
else "string" == typeof t && delete e[t];
|
|
1339
1353
|
else for (const n of Object.keys(t)) delete e[n];
|
|
1340
1354
|
}
|
|
1341
|
-
function
|
|
1355
|
+
function Rn(e, t) {
|
|
1342
1356
|
return !(!(t in e) || !e.hasOwnProperty(t));
|
|
1343
1357
|
}
|
|
1344
|
-
function
|
|
1345
|
-
if (e && !
|
|
1346
|
-
if (!
|
|
1358
|
+
function wn(e, t, n, r) {
|
|
1359
|
+
if (e && !hn(e) && Bt("GObj bad instanceof"), !gn(t) && !dn(t)) return Bt(`${Ve(e)}: kw must be list or dict`), 0;
|
|
1360
|
+
if (!bn(n)) return Bt(`${Ve(e)}: path must be a string: ${String(n)}`), 0;
|
|
1347
1361
|
let o = n.split("`");
|
|
1348
1362
|
if (o.length <= 1) return t[n];
|
|
1349
1363
|
let i = o.length;
|
|
1350
|
-
for (let l = 0; l < i; l++) if (void 0 === (t = t[o[l]])) return void (r &&
|
|
1364
|
+
for (let l = 0; l < i; l++) if (void 0 === (t = t[o[l]])) return void (r && Bt(`${Ve(e)}: path not found: ${String(n)}`));
|
|
1351
1365
|
return t;
|
|
1352
1366
|
}
|
|
1353
|
-
function
|
|
1354
|
-
e && !
|
|
1367
|
+
function Dn(e, t, n) {
|
|
1368
|
+
e && !hn(e) && Bt("GObj bad instanceof");
|
|
1355
1369
|
let [r, o] = function(e, t) {
|
|
1356
1370
|
let n = e.lastIndexOf(t);
|
|
1357
1371
|
return -1 === n ? [e, ""] : [e.substring(0, n), e.substring(n + 1)];
|
|
1358
1372
|
}(n, "`");
|
|
1359
|
-
return
|
|
1373
|
+
return yn(o) ? rn(t, n) : rn(wn(e, t, r, !0), o), 0;
|
|
1360
1374
|
}
|
|
1361
|
-
function
|
|
1362
|
-
e && !
|
|
1363
|
-
let i =
|
|
1364
|
-
const l = o && o &
|
|
1375
|
+
function An(e, t, n, r, o) {
|
|
1376
|
+
e && !hn(e) && Bt("GObj bad instanceof");
|
|
1377
|
+
let i = wn(e, t, n, !1);
|
|
1378
|
+
const l = o && o & Ct.KW_REQUIRED, s = o && o & Ct.KW_CREATE, _ = o && o & Ct.KW_EXTRACT;
|
|
1365
1379
|
if (void 0 === i) {
|
|
1366
1380
|
if (s) {
|
|
1367
1381
|
let o = Boolean(r);
|
|
1368
|
-
return
|
|
1382
|
+
return Pn(e, t, n, o), o;
|
|
1369
1383
|
}
|
|
1370
|
-
return l && (
|
|
1384
|
+
return l && (Bt(`path not found: '${n}'`), zt(t)), Boolean(r);
|
|
1371
1385
|
}
|
|
1372
|
-
return _ &&
|
|
1386
|
+
return _ && Dn(e, t, n), Boolean(i);
|
|
1373
1387
|
}
|
|
1374
|
-
function
|
|
1375
|
-
e && !
|
|
1376
|
-
let i =
|
|
1377
|
-
const l = o && o &
|
|
1388
|
+
function kn(e, t, n, r, o) {
|
|
1389
|
+
e && !hn(e) && Bt("GObj bad instanceof");
|
|
1390
|
+
let i = wn(e, t, n, !1);
|
|
1391
|
+
const l = o && o & Ct.KW_REQUIRED, s = o && o & Ct.KW_CREATE, _ = o && o & Ct.KW_EXTRACT;
|
|
1378
1392
|
if (void 0 === i) {
|
|
1379
1393
|
if (s) {
|
|
1380
1394
|
let o = parseInt(r);
|
|
1381
|
-
return
|
|
1395
|
+
return Pn(e, t, n, o), o;
|
|
1382
1396
|
}
|
|
1383
|
-
return l && (
|
|
1397
|
+
return l && (Bt(`path not found: '${n}'`), zt(t)), parseInt(r);
|
|
1384
1398
|
}
|
|
1385
|
-
return _ &&
|
|
1399
|
+
return _ && Dn(e, t, n), pn(i) ? parseInt(i) : (l && (Bt(`path value MUST BE a number: ${n}`), Ht(t)), parseInt(r));
|
|
1386
1400
|
}
|
|
1387
|
-
function
|
|
1388
|
-
e && !
|
|
1389
|
-
let i =
|
|
1390
|
-
const l = o && o &
|
|
1401
|
+
function In(e, t, n, r, o) {
|
|
1402
|
+
e && !hn(e) && Bt("GObj bad instanceof");
|
|
1403
|
+
let i = wn(e, t, n, !1);
|
|
1404
|
+
const l = o && o & Ct.KW_REQUIRED, s = o && o & Ct.KW_CREATE, _ = o && o & Ct.KW_EXTRACT;
|
|
1391
1405
|
if (void 0 === i) {
|
|
1392
1406
|
if (s) {
|
|
1393
1407
|
let o = String(r);
|
|
1394
|
-
return
|
|
1408
|
+
return Pn(e, t, n, o), o;
|
|
1395
1409
|
}
|
|
1396
|
-
return l && (
|
|
1410
|
+
return l && (Bt(`path not found: '${n}'`), zt(t)), String(r);
|
|
1397
1411
|
}
|
|
1398
|
-
return _ &&
|
|
1412
|
+
return _ && Dn(e, t, n), bn(i) ? String(i) : (l && (Bt(`${Ve(e)}: path value MUST BE a string: ${n}`), Ht(t)), String(r));
|
|
1399
1413
|
}
|
|
1400
|
-
function
|
|
1401
|
-
e && !
|
|
1402
|
-
let i =
|
|
1403
|
-
const l = o && o &
|
|
1414
|
+
function $n(e, t, n, r, o) {
|
|
1415
|
+
e && !hn(e) && Bt("GObj bad instanceof");
|
|
1416
|
+
let i = wn(e, t, n, !1);
|
|
1417
|
+
const l = o && o & Ct.KW_REQUIRED, s = o && o & Ct.KW_CREATE, _ = o && o & Ct.KW_EXTRACT;
|
|
1404
1418
|
if (void 0 === i) {
|
|
1405
1419
|
if (s) {
|
|
1406
1420
|
let o = r;
|
|
1407
|
-
return
|
|
1421
|
+
return Pn(e, t, n, o), o;
|
|
1408
1422
|
}
|
|
1409
|
-
return l && (
|
|
1423
|
+
return l && (Bt(`path not found: '${n}'`), zt(t)), r;
|
|
1410
1424
|
}
|
|
1411
|
-
return _ &&
|
|
1425
|
+
return _ && Dn(e, t, n), i;
|
|
1412
1426
|
}
|
|
1413
|
-
function
|
|
1414
|
-
e && !
|
|
1415
|
-
let i =
|
|
1416
|
-
const l = o && o &
|
|
1427
|
+
function Cn(e, t, n, r, o) {
|
|
1428
|
+
e && !hn(e) && Bt("GObj bad instanceof");
|
|
1429
|
+
let i = wn(e, t, n, !1);
|
|
1430
|
+
const l = o && o & Ct.KW_REQUIRED, s = o && o & Ct.KW_CREATE, _ = o && o & Ct.KW_EXTRACT;
|
|
1417
1431
|
if (void 0 === i) {
|
|
1418
1432
|
if (s) {
|
|
1419
1433
|
let o = Object(r);
|
|
1420
|
-
return
|
|
1434
|
+
return Pn(e, t, n, o), o;
|
|
1421
1435
|
}
|
|
1422
|
-
return l && (
|
|
1436
|
+
return l && (Bt(`path not found: '${n}'`), zt(t)), Object(r);
|
|
1423
1437
|
}
|
|
1424
|
-
return _ &&
|
|
1438
|
+
return _ && Dn(e, t, n), gn(i) ? Object(i) : (l && (Bt(`path value MUST BE a dict: ${n}`), Ht(t)), Object(r));
|
|
1425
1439
|
}
|
|
1426
|
-
function
|
|
1427
|
-
e && !
|
|
1428
|
-
let i =
|
|
1429
|
-
const l = o && o &
|
|
1440
|
+
function Ln(e, t, n, r, o) {
|
|
1441
|
+
e && !hn(e) && Bt("GObj bad instanceof");
|
|
1442
|
+
let i = wn(e, t, n, !1);
|
|
1443
|
+
const l = o && o & Ct.KW_REQUIRED, s = o && o & Ct.KW_CREATE, _ = o && o & Ct.KW_EXTRACT;
|
|
1430
1444
|
if (void 0 === i) {
|
|
1431
1445
|
if (s) {
|
|
1432
1446
|
let o = r;
|
|
1433
|
-
return
|
|
1447
|
+
return Pn(e, t, n, o), o;
|
|
1434
1448
|
}
|
|
1435
|
-
return l && (
|
|
1449
|
+
return l && (Bt(`path not found: '${n}'`), zt(t)), r;
|
|
1436
1450
|
}
|
|
1437
|
-
return _ &&
|
|
1451
|
+
return _ && Dn(e, t, n), i;
|
|
1438
1452
|
}
|
|
1439
|
-
function
|
|
1440
|
-
if (e && !
|
|
1453
|
+
function Pn(e, t, n, r) {
|
|
1454
|
+
if (e && !hn(e) && Bt("GObj bad instanceof"), !gn(t)) return Bt("kw is not an object"), -1;
|
|
1441
1455
|
let o = n.split("`");
|
|
1442
1456
|
if (o.length <= 1) return t[n] = r, 0;
|
|
1443
1457
|
let i = o.length;
|
|
@@ -1447,34 +1461,34 @@
|
|
|
1447
1461
|
}
|
|
1448
1462
|
return 0;
|
|
1449
1463
|
}
|
|
1450
|
-
function
|
|
1451
|
-
if (e && !
|
|
1452
|
-
let i =
|
|
1453
|
-
return
|
|
1464
|
+
function Un(e, t, n, r, o) {
|
|
1465
|
+
if (e && !hn(e) && Bt("GObj bad instanceof"), !gn(t)) return Bt("kw is not an object"), -1;
|
|
1466
|
+
let i = Cn(e, t, n, {}, !0);
|
|
1467
|
+
return gn(i) ? (i[r] = o, 0) : (Bt("subdict is not an object"), -1);
|
|
1454
1468
|
}
|
|
1455
|
-
function
|
|
1469
|
+
function Fn(e, t, r) {
|
|
1456
1470
|
let o = "", i = !1;
|
|
1457
|
-
if (
|
|
1471
|
+
if (dn(t)) {
|
|
1458
1472
|
i = !1;
|
|
1459
1473
|
for (let l = 0; l < t.length; l++) {
|
|
1460
1474
|
let s = t[l];
|
|
1461
|
-
if (o =
|
|
1475
|
+
if (o = yn(r) ? n("%s", r) : n("%s`%d", r, l), i = Fn(e, s, o), i) break;
|
|
1462
1476
|
}
|
|
1463
|
-
} else if (
|
|
1477
|
+
} else if (gn(t)) {
|
|
1464
1478
|
i = !0;
|
|
1465
1479
|
let l = Object.keys(t);
|
|
1466
1480
|
for (let s = 0; s < l.length; s++) {
|
|
1467
1481
|
let _ = l[s], a = t[_];
|
|
1468
|
-
if (o =
|
|
1469
|
-
if (i =
|
|
1482
|
+
if (o = yn(r) ? n("%s", _) : n("%s`%s", r, _), dn(a) || gn(a)) {
|
|
1483
|
+
if (i = Fn(e, a, o), !i) break;
|
|
1470
1484
|
continue;
|
|
1471
1485
|
}
|
|
1472
|
-
let u =
|
|
1473
|
-
if (u || (u =
|
|
1486
|
+
let u = Ln(0, e, o, 0, 0);
|
|
1487
|
+
if (u || (u = nn(e, o)), !u) {
|
|
1474
1488
|
i = !1;
|
|
1475
1489
|
break;
|
|
1476
1490
|
}
|
|
1477
|
-
if (0 !==
|
|
1491
|
+
if (0 !== On(u, a)) {
|
|
1478
1492
|
i = !1;
|
|
1479
1493
|
break;
|
|
1480
1494
|
}
|
|
@@ -1482,58 +1496,58 @@
|
|
|
1482
1496
|
}
|
|
1483
1497
|
return i;
|
|
1484
1498
|
}
|
|
1485
|
-
function
|
|
1486
|
-
return 0 ===
|
|
1499
|
+
function Gn(e, t) {
|
|
1500
|
+
return 0 === fn(t) || Fn(e, t, "");
|
|
1487
1501
|
}
|
|
1488
|
-
function
|
|
1489
|
-
e && !
|
|
1502
|
+
function Vn(e, t, n, r) {
|
|
1503
|
+
e && !hn(e) && Bt("GObj bad instanceof");
|
|
1490
1504
|
let o = {};
|
|
1491
|
-
if (
|
|
1505
|
+
if (bn(n) && !yn(n)) {
|
|
1492
1506
|
let i = n;
|
|
1493
|
-
t.hasOwnProperty(i) ? o[i] = t[i] : r &&
|
|
1494
|
-
} else if (
|
|
1507
|
+
t.hasOwnProperty(i) ? o[i] = t[i] : r && Bt(`${Ve(e)}: key not found: ${i}`);
|
|
1508
|
+
} else if (gn(n) && un(n) > 0) for (let i of Object.keys(n)) t.hasOwnProperty(i) ? o[i] = t[i] : r && Bt(`${Ve(e)}: key not found: ${i}`);
|
|
1495
1509
|
else {
|
|
1496
|
-
if (!(
|
|
1510
|
+
if (!(dn(n) && cn(n) > 0)) return t;
|
|
1497
1511
|
for (let i = 0; i < n.length; i++) {
|
|
1498
1512
|
let l = n[i];
|
|
1499
|
-
t.hasOwnProperty(l) ? o[l] = t[l] : r &&
|
|
1513
|
+
t.hasOwnProperty(l) ? o[l] = t[l] : r && Bt(`${Ve(e)}: key not found: ${l}`);
|
|
1500
1514
|
}
|
|
1501
1515
|
}
|
|
1502
1516
|
return o;
|
|
1503
1517
|
}
|
|
1504
|
-
function
|
|
1518
|
+
function Mn(e, t, n, r) {
|
|
1505
1519
|
let o = {};
|
|
1506
|
-
if (
|
|
1520
|
+
if (Zt(o, t), bn(n) && !yn(n)) {
|
|
1507
1521
|
let i = n;
|
|
1508
|
-
|
|
1509
|
-
} else if (
|
|
1522
|
+
Ln(e, t, i, 0, 0) ? rn(o, i) : r && Bt(`${Ve(e)}: key not found: ${i}`);
|
|
1523
|
+
} else if (gn(n) && un(n) > 0) for (let i of Object.keys(n)) t.hasOwnProperty(i) ? rn(o, i) : r && Bt(`${Ve(e)}: key not found: ${i}`);
|
|
1510
1524
|
else {
|
|
1511
|
-
if (!(
|
|
1525
|
+
if (!(dn(n) && cn(n) > 0)) return {};
|
|
1512
1526
|
for (let i = 0; i < n.length; i++) {
|
|
1513
1527
|
let l = n[i];
|
|
1514
|
-
t.hasOwnProperty(l) ?
|
|
1528
|
+
t.hasOwnProperty(l) ? rn(o, l) : r && Bt(`${Ve(e)}: key not found: ${l}`);
|
|
1515
1529
|
}
|
|
1516
1530
|
}
|
|
1517
1531
|
return o;
|
|
1518
1532
|
}
|
|
1519
|
-
function
|
|
1533
|
+
function Wn(e, t, n = !1) {
|
|
1520
1534
|
if ("undefined" != typeof window && window.localStorage) try {
|
|
1521
1535
|
let r = window.localStorage.getItem(e);
|
|
1522
|
-
return null === r ? (n &&
|
|
1536
|
+
return null === r ? (n && Kn(e, t), t) : JSON.parse(r);
|
|
1523
1537
|
} catch (n) {
|
|
1524
1538
|
return window.console.warn(`Error reading localStorage key "${e}":`, n), t;
|
|
1525
1539
|
}
|
|
1526
1540
|
}
|
|
1527
|
-
function
|
|
1541
|
+
function Kn(e, t) {
|
|
1528
1542
|
if ("undefined" == typeof window || !window.localStorage) return 0;
|
|
1529
|
-
if (!e || void 0 === t) return
|
|
1543
|
+
if (!e || void 0 === t) return Bt(`kw_set_local_storage_value(): invalid key or value: key=${e}`), -1;
|
|
1530
1544
|
try {
|
|
1531
1545
|
return window.localStorage.setItem(e, JSON.stringify(t)), 0;
|
|
1532
1546
|
} catch (t) {
|
|
1533
|
-
return
|
|
1547
|
+
return Bt(`kw_set_local_storage_value(): cannot save "${e}" (storage full or blocked?): ${t && t.message ? t.message : t}`), -1;
|
|
1534
1548
|
}
|
|
1535
1549
|
}
|
|
1536
|
-
function
|
|
1550
|
+
function xn(e) {
|
|
1537
1551
|
if ("undefined" != typeof window && window.localStorage) if (e) try {
|
|
1538
1552
|
window.localStorage.removeItem(e);
|
|
1539
1553
|
} catch (t) {
|
|
@@ -1541,46 +1555,46 @@
|
|
|
1541
1555
|
}
|
|
1542
1556
|
else window.console.warn(`Invalid key for localStorage removal: ${e}`);
|
|
1543
1557
|
}
|
|
1544
|
-
function
|
|
1545
|
-
if (
|
|
1546
|
-
if (
|
|
1558
|
+
function Yn(e, t) {
|
|
1559
|
+
if (En(e) || En(t)) return !0;
|
|
1560
|
+
if (dn(e)) {
|
|
1547
1561
|
if (0 === e.length) return !0;
|
|
1548
1562
|
for (let n = 0; n < e.length; n++) if (e[n] === t) return !0;
|
|
1549
|
-
} else if (
|
|
1563
|
+
} else if (gn(e)) {
|
|
1550
1564
|
if (0 === Object.keys(e).length) return !0;
|
|
1551
1565
|
for (let n in e) if (n === t) return !0;
|
|
1552
|
-
} else if (
|
|
1566
|
+
} else if (bn(e) && e === t) return !0;
|
|
1553
1567
|
return !1;
|
|
1554
1568
|
}
|
|
1555
|
-
function
|
|
1556
|
-
if (e && !
|
|
1557
|
-
o || (o =
|
|
1569
|
+
function Bn(e, t, n, r, o) {
|
|
1570
|
+
if (e && !hn(e) && Bt("GObj bad instanceof"), !t) return null;
|
|
1571
|
+
o || (o = Gn);
|
|
1558
1572
|
let i = [];
|
|
1559
|
-
if (
|
|
1573
|
+
if (dn(t)) for (let l = 0; l < t.length; l++) {
|
|
1560
1574
|
let s, _ = t[l];
|
|
1561
|
-
if (
|
|
1575
|
+
if (gn(_)) s = In(e, _, "id", "", 0);
|
|
1562
1576
|
else {
|
|
1563
|
-
if (!
|
|
1577
|
+
if (!bn(_)) continue;
|
|
1564
1578
|
s = _;
|
|
1565
1579
|
}
|
|
1566
|
-
|
|
1580
|
+
Yn(n, s) && o(_, r) && i.push(_);
|
|
1567
1581
|
}
|
|
1568
1582
|
else {
|
|
1569
|
-
if (!
|
|
1583
|
+
if (!gn(t)) return Bt("kw_collect() BAD kw parameter"), null;
|
|
1570
1584
|
for (let e of Object.keys(t)) {
|
|
1571
1585
|
let l = t[e];
|
|
1572
|
-
|
|
1586
|
+
Yn(n, e) && o(l, r) && i.push(l);
|
|
1573
1587
|
}
|
|
1574
1588
|
}
|
|
1575
1589
|
return i;
|
|
1576
1590
|
}
|
|
1577
|
-
function
|
|
1591
|
+
function Jn(e, t) {
|
|
1578
1592
|
if (!e) return -1;
|
|
1579
1593
|
for (let n = 0; n < e.length; n++) if (e[n] && e[n].id === t) return n;
|
|
1580
1594
|
return -1;
|
|
1581
1595
|
}
|
|
1582
|
-
function
|
|
1583
|
-
if (!e || !t) return
|
|
1596
|
+
function qn(e, t, n) {
|
|
1597
|
+
if (!e || !t) return Bt("ERROR: str_in_list() list or str empty"), !1;
|
|
1584
1598
|
let r = e.length;
|
|
1585
1599
|
if (n) {
|
|
1586
1600
|
t = t.toLowerCase();
|
|
@@ -1591,7 +1605,7 @@
|
|
|
1591
1605
|
} else for (let n = 0; n < r; n++) if (e[n] === t) return !0;
|
|
1592
1606
|
return !1;
|
|
1593
1607
|
}
|
|
1594
|
-
function
|
|
1608
|
+
function Hn(e, t) {
|
|
1595
1609
|
try {
|
|
1596
1610
|
let n = e.__md_iev__;
|
|
1597
1611
|
if (n) return n[t];
|
|
@@ -1599,35 +1613,35 @@
|
|
|
1599
1613
|
return;
|
|
1600
1614
|
}
|
|
1601
1615
|
}
|
|
1602
|
-
function
|
|
1616
|
+
function zn(e, t, n) {
|
|
1603
1617
|
let r = e.__md_iev__;
|
|
1604
1618
|
r || (r = {}, e.__md_iev__ = r), r[t] = n;
|
|
1605
1619
|
}
|
|
1606
|
-
function
|
|
1607
|
-
if (!
|
|
1620
|
+
function Qn(e, t, n, r) {
|
|
1621
|
+
if (!hn(e)) return Bt("gobj is not a GObj"), null;
|
|
1608
1622
|
if (!t) return;
|
|
1609
|
-
let o =
|
|
1610
|
-
o || (o = [],
|
|
1623
|
+
let o = Hn(t, n);
|
|
1624
|
+
o || (o = [], zn(t, n, o));
|
|
1611
1625
|
try {
|
|
1612
|
-
|
|
1626
|
+
dn(o) && o.unshift(r);
|
|
1613
1627
|
} catch (e) {
|
|
1614
|
-
|
|
1628
|
+
Bt(e);
|
|
1615
1629
|
}
|
|
1616
1630
|
}
|
|
1617
|
-
function
|
|
1618
|
-
if (!
|
|
1619
|
-
if (!
|
|
1620
|
-
let o =
|
|
1621
|
-
return o ? 0 === o.length ? (r &&
|
|
1631
|
+
function Xn(e, t, n, r) {
|
|
1632
|
+
if (!hn(e)) return Bt("gobj is not a GObj"), null;
|
|
1633
|
+
if (!gn(t)) return Bt("kw is not a dict"), null;
|
|
1634
|
+
let o = Hn(t, n);
|
|
1635
|
+
return o ? 0 === o.length ? (r && Bt(`stack empty: ${n}`), null) : o[0] : (r && Bt(`stack NOT FOUND: ${n}`), null);
|
|
1622
1636
|
}
|
|
1623
|
-
function
|
|
1624
|
-
return
|
|
1637
|
+
function Zn(e, t, n) {
|
|
1638
|
+
return yn(n) ? Dn(e, t, "__md_iev__`__msg_type__") : Un(e, t, "__md_iev__", "__msg_type__", n), 0;
|
|
1625
1639
|
}
|
|
1626
|
-
function
|
|
1627
|
-
return
|
|
1640
|
+
function er(e, t) {
|
|
1641
|
+
return In(e, t, "__md_iev__`__msg_type__", "", 0);
|
|
1628
1642
|
}
|
|
1629
|
-
function
|
|
1630
|
-
void 0 !== n &&
|
|
1643
|
+
function tr(e, t, n) {
|
|
1644
|
+
void 0 !== n && bn(n) || (n = "");
|
|
1631
1645
|
for (let r of Object.keys(e)) {
|
|
1632
1646
|
if (!e.hasOwnProperty(r)) continue;
|
|
1633
1647
|
let o = (n.length ? "`" : "") + r;
|
|
@@ -1636,10 +1650,10 @@
|
|
|
1636
1650
|
r,
|
|
1637
1651
|
e[r],
|
|
1638
1652
|
n
|
|
1639
|
-
]),
|
|
1653
|
+
]), gn(e[r]) && tr(e[r], t, n), n = n.slice(0, -o.length);
|
|
1640
1654
|
}
|
|
1641
1655
|
}
|
|
1642
|
-
function
|
|
1656
|
+
function nr(e, t, n, r) {
|
|
1643
1657
|
if (!e) return null;
|
|
1644
1658
|
let o, i = e.length;
|
|
1645
1659
|
for (o = 0; o < i; o++) {
|
|
@@ -1647,15 +1661,15 @@
|
|
|
1647
1661
|
if (i) {
|
|
1648
1662
|
let e = i.id;
|
|
1649
1663
|
if (e && e === n) return i;
|
|
1650
|
-
if (r &&
|
|
1651
|
-
let e =
|
|
1664
|
+
if (r && Rn(i, t)) {
|
|
1665
|
+
let e = nr(i[t], t, n, r);
|
|
1652
1666
|
if (e) return e;
|
|
1653
1667
|
}
|
|
1654
1668
|
}
|
|
1655
1669
|
}
|
|
1656
1670
|
return null;
|
|
1657
1671
|
}
|
|
1658
|
-
function
|
|
1672
|
+
function rr(e) {
|
|
1659
1673
|
function t(e) {
|
|
1660
1674
|
let t = e.replace(/-/g, "+").replace(/_/g, "/");
|
|
1661
1675
|
switch (t.length % 4) {
|
|
@@ -1686,38 +1700,38 @@
|
|
|
1686
1700
|
signature: t(n[2])
|
|
1687
1701
|
};
|
|
1688
1702
|
}
|
|
1689
|
-
function
|
|
1703
|
+
function or(e) {
|
|
1690
1704
|
return null == e ? "" : String(e).replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
1691
1705
|
}
|
|
1692
|
-
function
|
|
1706
|
+
function ir(e) {
|
|
1693
1707
|
const t = document.createElement("template");
|
|
1694
1708
|
return t.innerHTML = e.trim(), t.content.firstChild;
|
|
1695
1709
|
}
|
|
1696
|
-
function
|
|
1710
|
+
function lr() {
|
|
1697
1711
|
const e = /* @__PURE__ */ new Date(), t = e.toISOString().slice(0, 19), n = String(e.getMilliseconds()).padStart(3, "0"), r = e.getTimezoneOffset();
|
|
1698
1712
|
return `${t}.${n}${r > 0 ? "-" : "+"}${String(Math.abs(r) / 60).padStart(2, "0")}${String(Math.abs(r) % 60).padStart(2, "0")}`;
|
|
1699
1713
|
}
|
|
1700
|
-
function
|
|
1714
|
+
function sr(e, t) {
|
|
1701
1715
|
if (!e) throw "ERROR: index_in_list() list empty";
|
|
1702
1716
|
for (let n = 0; n < e.length; n++) if (t === e[n]) return n;
|
|
1703
1717
|
return -1;
|
|
1704
1718
|
}
|
|
1705
|
-
function
|
|
1719
|
+
function _r() {
|
|
1706
1720
|
let e = "";
|
|
1707
1721
|
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;
|
|
1708
1722
|
}
|
|
1709
|
-
function
|
|
1723
|
+
function ar(e) {
|
|
1710
1724
|
let t = null;
|
|
1711
1725
|
return "function" != typeof e && "object" != typeof e || (t = ("" + e).match(/function\s*([\w\$]*)\s*\(/)), null !== t ? t[1] + "()" : "";
|
|
1712
1726
|
}
|
|
1713
|
-
function
|
|
1714
|
-
return "persistent-attrs-" +
|
|
1727
|
+
function ur(e) {
|
|
1728
|
+
return "persistent-attrs-" + Ve(e);
|
|
1715
1729
|
}
|
|
1716
|
-
function
|
|
1717
|
-
if (
|
|
1730
|
+
function cr(e, t) {
|
|
1731
|
+
if (bn(t)) {
|
|
1718
1732
|
if (-1 === t.indexOf("^")) {
|
|
1719
1733
|
let n, r, o = e.fkey;
|
|
1720
|
-
if (1 !==
|
|
1734
|
+
if (1 !== un(o)) return Bt("bad fkey 1"), Bt(e), Bt(t), null;
|
|
1721
1735
|
for (const e of Object.keys(o)) {
|
|
1722
1736
|
n = e, r = o[e];
|
|
1723
1737
|
break;
|
|
@@ -1730,20 +1744,20 @@
|
|
|
1730
1744
|
}
|
|
1731
1745
|
{
|
|
1732
1746
|
let n = t.split("^");
|
|
1733
|
-
return 3 !== n.length ? (
|
|
1747
|
+
return 3 !== n.length ? (Bt("bad fkey 2"), Bt(e), Bt(t), null) : {
|
|
1734
1748
|
topic_name: n[0],
|
|
1735
1749
|
id: n[1],
|
|
1736
1750
|
hook_name: n[2]
|
|
1737
1751
|
};
|
|
1738
1752
|
}
|
|
1739
1753
|
}
|
|
1740
|
-
return
|
|
1754
|
+
return gn(t) ? {
|
|
1741
1755
|
topic_name: t.topic_name,
|
|
1742
1756
|
id: t.id,
|
|
1743
1757
|
hook_name: t.hook_name
|
|
1744
|
-
} : (
|
|
1758
|
+
} : (Bt("bad fkey 3"), Bt(e), Bt(t), null);
|
|
1745
1759
|
}
|
|
1746
|
-
var
|
|
1760
|
+
var fr = [
|
|
1747
1761
|
"string",
|
|
1748
1762
|
"integer",
|
|
1749
1763
|
"object",
|
|
@@ -1753,7 +1767,7 @@
|
|
|
1753
1767
|
"real",
|
|
1754
1768
|
"boolean",
|
|
1755
1769
|
"blob"
|
|
1756
|
-
],
|
|
1770
|
+
], gr = [
|
|
1757
1771
|
"persistent",
|
|
1758
1772
|
"required",
|
|
1759
1773
|
"notnull",
|
|
@@ -1765,7 +1779,7 @@
|
|
|
1765
1779
|
"stats",
|
|
1766
1780
|
"rstats",
|
|
1767
1781
|
"pstats"
|
|
1768
|
-
],
|
|
1782
|
+
], dr = [
|
|
1769
1783
|
"hook",
|
|
1770
1784
|
"fkey",
|
|
1771
1785
|
"enum",
|
|
@@ -1791,7 +1805,7 @@
|
|
|
1791
1805
|
"coordinates",
|
|
1792
1806
|
"gbuffer"
|
|
1793
1807
|
];
|
|
1794
|
-
function
|
|
1808
|
+
function br(e) {
|
|
1795
1809
|
let t = {
|
|
1796
1810
|
name: e.id,
|
|
1797
1811
|
header: e.header,
|
|
@@ -1809,7 +1823,7 @@
|
|
|
1809
1823
|
if (!e.flag) return t;
|
|
1810
1824
|
for (let n = 0; n < e.flag.length; n++) {
|
|
1811
1825
|
let r = e.flag[n];
|
|
1812
|
-
if (
|
|
1826
|
+
if (qn(dr, r)) {
|
|
1813
1827
|
switch (r) {
|
|
1814
1828
|
case "enum":
|
|
1815
1829
|
t.enum_list = e.enum;
|
|
@@ -1820,7 +1834,7 @@
|
|
|
1820
1834
|
case "table": t.enum_list = e.table;
|
|
1821
1835
|
}
|
|
1822
1836
|
t.type = r;
|
|
1823
|
-
} else if (
|
|
1837
|
+
} else if (qn(gr, r)) switch (r) {
|
|
1824
1838
|
case "writable":
|
|
1825
1839
|
t.is_writable = !0;
|
|
1826
1840
|
break;
|
|
@@ -1833,57 +1847,57 @@
|
|
|
1833
1847
|
}
|
|
1834
1848
|
return t;
|
|
1835
1849
|
}
|
|
1836
|
-
var
|
|
1850
|
+
var pr = [
|
|
1837
1851
|
j(T.DTP_POINTER, "subscriber", 0, null, "Subscriber of output events"),
|
|
1838
1852
|
j(T.DTP_BOOLEAN, "periodic", 0, 0, "True for periodic timeouts"),
|
|
1839
1853
|
j(T.DTP_INTEGER, "msec", 0, 0, "Timeout in milliseconds"),
|
|
1840
1854
|
v()
|
|
1841
|
-
],
|
|
1855
|
+
], mr = {
|
|
1842
1856
|
periodic: !1,
|
|
1843
1857
|
msec: 0,
|
|
1844
1858
|
timer_id: -1
|
|
1845
|
-
},
|
|
1846
|
-
function
|
|
1859
|
+
}, Er = null;
|
|
1860
|
+
function Tr(e, t, n, r) {
|
|
1847
1861
|
let o = e.priv, i = o.periodic ? "EV_TIMEOUT_PERIODIC" : "EV_TIMEOUT";
|
|
1848
1862
|
return o.periodic && o.msec > 0 ? o.timer_id = setTimeout(function() {
|
|
1849
|
-
|
|
1850
|
-
}, o.msec) : o.timer_id = -1,
|
|
1863
|
+
vt(e, "EV_TIMEOUT", {}, e);
|
|
1864
|
+
}, o.msec) : o.timer_id = -1, xe(e) ? vt(We(e), i, {}, e) : $t(e, i, {}), o.periodic || -1 !== o.timer_id || Ae(e) && Oe(e), 0;
|
|
1851
1865
|
}
|
|
1852
|
-
var
|
|
1866
|
+
var hr = {
|
|
1853
1867
|
mt_create: function(e) {
|
|
1854
1868
|
let t = e.priv;
|
|
1855
|
-
const n =
|
|
1856
|
-
n &&
|
|
1869
|
+
const n = at(e, "subscriber");
|
|
1870
|
+
n && Dt(e, null, {}, n), t.periodic = lt(e, "periodic"), t.msec = st(e, "msec");
|
|
1857
1871
|
},
|
|
1858
1872
|
mt_writing: function(e, t) {
|
|
1859
1873
|
let n = e.priv;
|
|
1860
1874
|
switch (t) {
|
|
1861
1875
|
case "periodic":
|
|
1862
|
-
n.periodic =
|
|
1876
|
+
n.periodic = lt(e, "periodic");
|
|
1863
1877
|
break;
|
|
1864
|
-
case "msec": n.msec =
|
|
1865
|
-
|
|
1866
|
-
}, n.msec)), n.msec > 0 ?
|
|
1878
|
+
case "msec": n.msec = st(e, "msec"), -1 !== n.timer_id && (clearTimeout(n.timer_id), n.timer_id = -1), n.msec > 0 && (n.timer_id = setTimeout(function() {
|
|
1879
|
+
vt(e, "EV_TIMEOUT", {}, e);
|
|
1880
|
+
}, n.msec)), n.msec > 0 ? Ae(e) || ve(e) : Ae(e) && Oe(e);
|
|
1867
1881
|
}
|
|
1868
1882
|
},
|
|
1869
1883
|
mt_start: function(e) {
|
|
1870
1884
|
return 0;
|
|
1871
1885
|
},
|
|
1872
1886
|
mt_stop: function(e) {
|
|
1873
|
-
return
|
|
1887
|
+
return ft(e, "msec", -1), 0;
|
|
1874
1888
|
},
|
|
1875
1889
|
mt_destroy: function(e) {}
|
|
1876
1890
|
};
|
|
1877
|
-
function
|
|
1878
|
-
return e instanceof O ? "C_TIMER" !==
|
|
1891
|
+
function yr(e, t) {
|
|
1892
|
+
return e instanceof O ? "C_TIMER" !== Ge(e) ? (Bt("not C_TIMER GObj"), -1) : (ct(e, "periodic", !1), void ft(e, "msec", t)) : (Bt("not GObj TYPE"), -1);
|
|
1879
1893
|
}
|
|
1880
|
-
function
|
|
1881
|
-
return e instanceof O ? "C_TIMER" !==
|
|
1894
|
+
function vr(e, t) {
|
|
1895
|
+
return e instanceof O ? "C_TIMER" !== Ge(e) ? (Bt("not C_TIMER GObj"), -1) : (ct(e, "periodic", !0), void ft(e, "msec", t)) : (Bt("not GObj TYPE"), -1);
|
|
1882
1896
|
}
|
|
1883
|
-
function
|
|
1884
|
-
return e instanceof O ? "C_TIMER" !==
|
|
1897
|
+
function jr(e) {
|
|
1898
|
+
return e instanceof O ? "C_TIMER" !== Ge(e) ? (Bt("not C_TIMER GObj"), -1) : void ft(e, "msec", -1) : (Bt("not GObj TYPE"), -1);
|
|
1885
1899
|
}
|
|
1886
|
-
var
|
|
1900
|
+
var Sr = [
|
|
1887
1901
|
j(T.DTP_BOOLEAN, "changesLost", 0, !1, "Set true to warn about leaving page"),
|
|
1888
1902
|
j(T.DTP_BOOLEAN, "browser_beforeunload", 0, !1, "Set true to refreshing browser"),
|
|
1889
1903
|
j(T.DTP_STRING, "__username__", 0, "", "Username"),
|
|
@@ -1909,32 +1923,32 @@
|
|
|
1909
1923
|
j(T.DTP_BOOLEAN, "developer", 0, !1, "Developer mode enabled"),
|
|
1910
1924
|
j(T.DTP_INTEGER, "periodic_timeout", 0, "1000", "Timeout periodic, in miliseconds."),
|
|
1911
1925
|
v()
|
|
1912
|
-
],
|
|
1913
|
-
function
|
|
1914
|
-
return
|
|
1926
|
+
], Or = { gobj_timer: null }, Nr = null;
|
|
1927
|
+
function Rr(e, t, n, r) {
|
|
1928
|
+
return $t(e, t, n), 0;
|
|
1915
1929
|
}
|
|
1916
|
-
var
|
|
1930
|
+
var wr = {
|
|
1917
1931
|
mt_create: function(e) {
|
|
1918
1932
|
let t = e.priv;
|
|
1919
|
-
|
|
1933
|
+
gt(e, "start_date", lr()), gt(e, "node_uuid", _r()), e.priv.gobj_timer = he(Fe(e), "C_TIMER", {}, e), t.periodic_timeout = ot(e, "periodic_timeout");
|
|
1920
1934
|
},
|
|
1921
1935
|
mt_writing: function(e, t) {},
|
|
1922
1936
|
mt_start: function(e) {
|
|
1923
|
-
return
|
|
1937
|
+
return vr(e.priv.gobj_timer, e.priv.periodic_timeout), 0;
|
|
1924
1938
|
},
|
|
1925
1939
|
mt_stop: function(e) {
|
|
1926
|
-
return
|
|
1940
|
+
return jr(e.priv.gobj_timer), Re(e), 0;
|
|
1927
1941
|
},
|
|
1928
1942
|
mt_destroy: function(e) {},
|
|
1929
1943
|
mt_play: function(e) {
|
|
1930
|
-
let t =
|
|
1931
|
-
return
|
|
1944
|
+
let t = fe();
|
|
1945
|
+
return Ae(t) || ve(t), $e(t) || we(t), 0;
|
|
1932
1946
|
},
|
|
1933
1947
|
mt_pause: function(e) {
|
|
1934
|
-
return
|
|
1948
|
+
return De(fe()), 0;
|
|
1935
1949
|
}
|
|
1936
1950
|
};
|
|
1937
|
-
var
|
|
1951
|
+
var Dr = "ievent_gate_stack", Ar = [
|
|
1938
1952
|
j(T.DTP_STRING, "wanted_yuno_role", h.SDF_RD, "", "wanted yuno role"),
|
|
1939
1953
|
j(T.DTP_STRING, "wanted_yuno_name", h.SDF_RD, "", "wanted yuno name"),
|
|
1940
1954
|
j(T.DTP_STRING, "wanted_yuno_service", h.SDF_RD, "", "wanted yuno service"),
|
|
@@ -1951,7 +1965,7 @@
|
|
|
1951
1965
|
j(T.DTP_INTEGER, "timeout_idack", h.SDF_RD, "5000", "timeout waiting idAck"),
|
|
1952
1966
|
j(T.DTP_POINTER, "subscriber", 0, 0, "subscriber of output-events. If null then subscriber is the parent"),
|
|
1953
1967
|
v()
|
|
1954
|
-
],
|
|
1968
|
+
], kr = {
|
|
1955
1969
|
url: null,
|
|
1956
1970
|
remote_yuno_name: null,
|
|
1957
1971
|
remote_yuno_role: null,
|
|
@@ -1961,91 +1975,91 @@
|
|
|
1961
1975
|
websocket: null,
|
|
1962
1976
|
inside_on_open: !1,
|
|
1963
1977
|
retry_ms: 0
|
|
1964
|
-
},
|
|
1965
|
-
function
|
|
1966
|
-
e.priv.websocket &&
|
|
1967
|
-
const t =
|
|
1978
|
+
}, Ir = null;
|
|
1979
|
+
function $r(e) {
|
|
1980
|
+
e.priv.websocket && Bt("Websocket ALREADY setup");
|
|
1981
|
+
const t = _t(e, "url");
|
|
1968
1982
|
let n;
|
|
1969
|
-
|
|
1983
|
+
qt(`====> Starting WebSocket to '${t}' (${Ve(e)})`);
|
|
1970
1984
|
try {
|
|
1971
1985
|
n = new WebSocket(t);
|
|
1972
1986
|
} catch (n) {
|
|
1973
|
-
return
|
|
1987
|
+
return Bt(`${Ve(e)}: Cannot open WebSocket to '${t}', Error: ${n.message}`), null;
|
|
1974
1988
|
}
|
|
1975
1989
|
return n ? (n.onopen = () => {
|
|
1976
|
-
|
|
1990
|
+
vt(e, "EV_ON_OPEN", { url: t }, e);
|
|
1977
1991
|
}, n.onmessage = (n) => {
|
|
1978
|
-
|
|
1992
|
+
vt(e, "EV_ON_MESSAGE", {
|
|
1979
1993
|
url: t,
|
|
1980
1994
|
data: n.data
|
|
1981
1995
|
}, e);
|
|
1982
1996
|
}, n.onclose = (n) => {
|
|
1983
|
-
|
|
1997
|
+
Ye(e) || (lt(Ce(), "browser_beforeunload") ? Jt("Close websocket by unload page") : vt(e, "EV_ON_CLOSE", {
|
|
1984
1998
|
url: t,
|
|
1985
1999
|
e: n
|
|
1986
2000
|
}, e));
|
|
1987
|
-
}, n) : (
|
|
2001
|
+
}, n) : (Bt(`${Ve(e)}: Failed to initialize WebSocket.`), null);
|
|
1988
2002
|
}
|
|
1989
|
-
function
|
|
2003
|
+
function Cr(e, t = 1e3, n = "") {
|
|
1990
2004
|
let r = e.priv, o = r.websocket;
|
|
1991
2005
|
if (r.websocket = null, o && o.readyState !== WebSocket.CLOSED && o.readyState !== WebSocket.CLOSING) {
|
|
1992
|
-
|
|
2006
|
+
qt(`Closing WebSocket (Code: ${t}, Reason: "${n}")`);
|
|
1993
2007
|
try {
|
|
1994
2008
|
o.close(t, n);
|
|
1995
2009
|
} catch (e) {
|
|
1996
|
-
|
|
2010
|
+
Bt("Error closing WebSocket:", e.message);
|
|
1997
2011
|
}
|
|
1998
|
-
} else
|
|
2012
|
+
} else Jt("WebSocket is already closed or in the process of closing.");
|
|
1999
2013
|
}
|
|
2000
|
-
function
|
|
2001
|
-
let r =
|
|
2014
|
+
function Lr(e, t, n) {
|
|
2015
|
+
let r = lr();
|
|
2002
2016
|
try {
|
|
2003
|
-
|
|
2017
|
+
qt("\n" + r + " " + t + "\n"), zt(n);
|
|
2004
2018
|
} catch (e) {
|
|
2005
|
-
|
|
2019
|
+
qt("ERROR in trace_inter_event: " + e);
|
|
2006
2020
|
}
|
|
2007
2021
|
}
|
|
2008
|
-
var
|
|
2022
|
+
var Pr = class {
|
|
2009
2023
|
constructor(e, t) {
|
|
2010
2024
|
this.event = e, this.kw = t || {};
|
|
2011
2025
|
}
|
|
2012
2026
|
};
|
|
2013
|
-
function
|
|
2027
|
+
function Ur(e, t, n, r) {
|
|
2014
2028
|
return function(e, t) {
|
|
2015
2029
|
let n = e.priv, r = JSON.stringify(t);
|
|
2016
|
-
if (
|
|
2017
|
-
let n =
|
|
2018
|
-
i ? i(o, t, 1, r.length) :
|
|
2030
|
+
if (lt(Ce(), "trace_inter_event")) {
|
|
2031
|
+
let n = _t(e, "url"), o = Fe(Ce()) + " ==> " + n, i = ot(Ce(), "trace_ievent_callback");
|
|
2032
|
+
i ? i(o, t, 1, r.length) : Lr(0, o, t);
|
|
2019
2033
|
}
|
|
2020
|
-
if (!n.websocket || n.websocket.readyState !== WebSocket.OPEN) return
|
|
2034
|
+
if (!n.websocket || n.websocket.readyState !== WebSocket.OPEN) return Jt(`${Ve(e)}: send_iev(): websocket not open, message lost`), -1;
|
|
2021
2035
|
try {
|
|
2022
2036
|
n.websocket.send(r);
|
|
2023
2037
|
} catch (t) {
|
|
2024
|
-
|
|
2038
|
+
Bt(`${Ve(e)}: send_iev(): ${t}`);
|
|
2025
2039
|
}
|
|
2026
2040
|
return 0;
|
|
2027
2041
|
}(e, function(e, t) {
|
|
2028
|
-
return
|
|
2042
|
+
return yn(e) ? (Bt("iev_create() event NULL"), null) : new Pr(e, t);
|
|
2029
2043
|
}(t, n));
|
|
2030
2044
|
}
|
|
2031
|
-
function
|
|
2032
|
-
return
|
|
2033
|
-
dst_yuno:
|
|
2034
|
-
dst_role:
|
|
2045
|
+
function Fr(e, t, n) {
|
|
2046
|
+
return yn(n) && (n = _t(e, "wanted_yuno_service")), {
|
|
2047
|
+
dst_yuno: _t(e, "wanted_yuno_name"),
|
|
2048
|
+
dst_role: _t(e, "wanted_yuno_role"),
|
|
2035
2049
|
dst_service: n,
|
|
2036
|
-
src_yuno:
|
|
2037
|
-
src_role:
|
|
2050
|
+
src_yuno: Le(),
|
|
2051
|
+
src_role: Pe(),
|
|
2038
2052
|
src_service: t,
|
|
2039
|
-
host:
|
|
2053
|
+
host: _r()
|
|
2040
2054
|
};
|
|
2041
2055
|
}
|
|
2042
|
-
function
|
|
2043
|
-
let t = e.priv, n =
|
|
2044
|
-
s && s.length || (s =
|
|
2056
|
+
function Gr(e) {
|
|
2057
|
+
let t = e.priv, n = $e(Ce()), r = _t(Ce(), "yuno_version"), o = _t(Ce(), "yuno_release"), i = _t(Ce(), "yuno_tag"), s = ot(e, "required_services");
|
|
2058
|
+
s && s.length || (s = ot(Ce(), "required_services"));
|
|
2045
2059
|
let _ = {
|
|
2046
|
-
yuno_role:
|
|
2047
|
-
yuno_id:
|
|
2048
|
-
yuno_name:
|
|
2060
|
+
yuno_role: Pe(),
|
|
2061
|
+
yuno_id: Ue(),
|
|
2062
|
+
yuno_name: Le(),
|
|
2049
2063
|
yuno_tag: i,
|
|
2050
2064
|
yuno_version: r,
|
|
2051
2065
|
yuno_release: o,
|
|
@@ -2053,37 +2067,37 @@
|
|
|
2053
2067
|
playing: n,
|
|
2054
2068
|
pid: 0,
|
|
2055
2069
|
watcher_pid: 0,
|
|
2056
|
-
jwt:
|
|
2057
|
-
username:
|
|
2070
|
+
jwt: _t(e, "jwt"),
|
|
2071
|
+
username: _t(Ce(), "__username__"),
|
|
2058
2072
|
launch_id: 0,
|
|
2059
|
-
yuno_startdate:
|
|
2060
|
-
id:
|
|
2073
|
+
yuno_startdate: _t(Ce(), "start_date"),
|
|
2074
|
+
id: _r(),
|
|
2061
2075
|
user_agent: "undefined" != typeof window ? window.navigator.userAgent : "",
|
|
2062
2076
|
language: "undefined" != typeof window ? window.navigator.language : "",
|
|
2063
2077
|
required_services: s
|
|
2064
2078
|
};
|
|
2065
|
-
return
|
|
2079
|
+
return Qn(e, _, Dr, Fr(e, Fe(We(e)), null)), Zn(e, _, "__identity__"), yr(t.gobj_timer, st(e, "timeout_idack")), Ur(e, "EV_IDENTITY_CARD", _);
|
|
2066
2080
|
}
|
|
2067
|
-
function
|
|
2068
|
-
if (
|
|
2081
|
+
function Vr(e, t) {
|
|
2082
|
+
if (yn(t.event)) return -1;
|
|
2069
2083
|
let n = {}, r = t.__global__, o = t.__config__, i = t.__filter__, l = t.__service__, s = t.subscriber;
|
|
2070
|
-
return o && (n.__config__ = o), r && (n.__global__ = r), i && (n.__filter__ = i),
|
|
2084
|
+
return o && (n.__config__ = o), r && (n.__global__ = r), i && (n.__filter__ = i), Qn(e, n, Dr, Fr(e, Fe(s), l)), Zn(e, n, "__subscribing__"), Ur(e, t.event, n);
|
|
2071
2085
|
}
|
|
2072
|
-
function
|
|
2086
|
+
function Mr(e, t, n, r) {
|
|
2073
2087
|
let o = e.priv;
|
|
2074
|
-
return
|
|
2088
|
+
return Ae(e) && (o.websocket = $r(e)), 0;
|
|
2075
2089
|
}
|
|
2076
|
-
function
|
|
2077
|
-
return
|
|
2090
|
+
function Wr(e, t, n, r) {
|
|
2091
|
+
return qt("Websocket opened: " + e.priv.url), Gr(e), 0;
|
|
2078
2092
|
}
|
|
2079
|
-
function
|
|
2093
|
+
function Kr(e, t, n, r) {
|
|
2080
2094
|
let o = e.priv, i = n.e, l = n.url;
|
|
2081
|
-
return
|
|
2095
|
+
return xt(), Jt(`${Ve(e)}: WebSocket closed ${l} (Code: ${i.code}, Reason: "${i.reason}", Clean: ${i.wasClean})`), 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, $t(e, "EV_ON_CLOSE", {
|
|
2082
2096
|
url: l,
|
|
2083
2097
|
remote_yuno_name: o.remote_yuno_name,
|
|
2084
2098
|
remote_yuno_role: o.remote_yuno_role,
|
|
2085
2099
|
remote_yuno_service: o.remote_yuno_service
|
|
2086
|
-
})) : (
|
|
2100
|
+
})) : (Jt(`${Ve(e)}: EV_ON_OPEN_ERROR cannot open ${l} (Code: ${i.code}, Reason: "${i.reason}", Clean: ${i.wasClean})`), $t(e, "EV_ON_OPEN_ERROR", {
|
|
2087
2101
|
url: l,
|
|
2088
2102
|
remote_yuno_name: o.remote_yuno_name,
|
|
2089
2103
|
remote_yuno_role: o.remote_yuno_role,
|
|
@@ -2091,27 +2105,27 @@
|
|
|
2091
2105
|
code: i.code,
|
|
2092
2106
|
reason: i.reason,
|
|
2093
2107
|
was_clean: i.wasClean
|
|
2094
|
-
})),
|
|
2095
|
-
let t = e.priv, n =
|
|
2108
|
+
})), Ae(e) && yr(o.gobj_timer, function(e) {
|
|
2109
|
+
let t = e.priv, n = st(e, "timeout_retry"), r = st(e, "timeout_retry_max");
|
|
2096
2110
|
r < n && (r = n);
|
|
2097
2111
|
t.retry_ms = t.retry_ms ? Math.min(2 * t.retry_ms, r) : n;
|
|
2098
2112
|
let o = .2 * t.retry_ms, i = t.retry_ms - o + 2 * Math.random() * o;
|
|
2099
2113
|
return Math.max(1, Math.round(i));
|
|
2100
2114
|
}(e)), 0;
|
|
2101
2115
|
}
|
|
2102
|
-
function
|
|
2103
|
-
return
|
|
2116
|
+
function xr(e, t, n, r) {
|
|
2117
|
+
return Gr(e), 0;
|
|
2104
2118
|
}
|
|
2105
|
-
function
|
|
2119
|
+
function Yr(e, t, n, r) {
|
|
2106
2120
|
let o = e.priv;
|
|
2107
|
-
|
|
2108
|
-
let i =
|
|
2109
|
-
|
|
2110
|
-
let a =
|
|
2121
|
+
jr(o.gobj_timer);
|
|
2122
|
+
let i = Xn(e, n, Dr, !0), l = In(e, i, "src_yuno", ""), s = In(e, i, "src_role", ""), _ = In(e, i, "src_service", "");
|
|
2123
|
+
gt(e, "remote_yuno_name", l), gt(e, "remote_yuno_role", s), gt(e, "remote_yuno_service", _);
|
|
2124
|
+
let a = kn(e, n, "result", -1, 0), u = In(e, n, "comment", "", 0), c = In(e, n, "username", "", 0), f = Ln(e, n, "services_roles", {});
|
|
2111
2125
|
if (a < 0) {
|
|
2112
|
-
|
|
2126
|
+
Cr(e);
|
|
2113
2127
|
let t = {
|
|
2114
|
-
url:
|
|
2128
|
+
url: _t(e, "url"),
|
|
2115
2129
|
result: a,
|
|
2116
2130
|
comment: u,
|
|
2117
2131
|
username: c,
|
|
@@ -2119,9 +2133,9 @@
|
|
|
2119
2133
|
remote_yuno_role: s,
|
|
2120
2134
|
remote_yuno_service: _
|
|
2121
2135
|
};
|
|
2122
|
-
|
|
2136
|
+
xe(e) ? vt(We(e), "EV_ON_ID_NAK", t, e) : $t(e, "EV_ON_ID_NAK", t);
|
|
2123
2137
|
} else {
|
|
2124
|
-
if (
|
|
2138
|
+
if (dt(e, "ST_SESSION"), o.inside_on_open = !0, o.retry_ms = 0, !o.inform_on_close) {
|
|
2125
2139
|
o.inform_on_close = !0;
|
|
2126
2140
|
let t = {
|
|
2127
2141
|
username: c,
|
|
@@ -2130,133 +2144,133 @@
|
|
|
2130
2144
|
remote_yuno_service: _,
|
|
2131
2145
|
services_roles: f
|
|
2132
2146
|
};
|
|
2133
|
-
|
|
2147
|
+
xe(e) ? vt(We(e), "EV_ON_OPEN", t, e) : $t(e, "EV_ON_OPEN", t);
|
|
2134
2148
|
}
|
|
2135
2149
|
o.inside_on_open = !1, function(e) {
|
|
2136
|
-
let t =
|
|
2137
|
-
for (let n = 0; n < t.length; n++)
|
|
2150
|
+
let t = kt(e, null, null, null);
|
|
2151
|
+
for (let n = 0; n < t.length; n++) Vr(e, t[n]);
|
|
2138
2152
|
}(e);
|
|
2139
2153
|
}
|
|
2140
2154
|
return 0;
|
|
2141
2155
|
}
|
|
2142
|
-
function
|
|
2156
|
+
function Br(e, t, n, r) {
|
|
2143
2157
|
let o = e.priv.url, i = function(e, t) {
|
|
2144
2158
|
let n;
|
|
2145
2159
|
try {
|
|
2146
2160
|
n = JSON.parse(t);
|
|
2147
2161
|
} catch (e) {
|
|
2148
|
-
return
|
|
2162
|
+
return Bt("parsing inter_event json: " + e), null;
|
|
2149
2163
|
}
|
|
2150
|
-
if (!(n instanceof Object)) return
|
|
2164
|
+
if (!(n instanceof Object)) return Bt("parsing inter_event: websocket data not a json object"), null;
|
|
2151
2165
|
let r = n.event;
|
|
2152
|
-
if (!r) return
|
|
2153
|
-
if ("string" != typeof r) return
|
|
2166
|
+
if (!r) return Bt("parsing inter_event: no event"), null;
|
|
2167
|
+
if ("string" != typeof r) return Bt("parsing inter_event: event not a string"), null;
|
|
2154
2168
|
let o = n.kw;
|
|
2155
2169
|
return o ? o instanceof Object ? {
|
|
2156
2170
|
event: r,
|
|
2157
2171
|
kw: o || {}
|
|
2158
|
-
} : (
|
|
2172
|
+
} : (Bt("parsing inter_event: kw not a json object"), null) : (Bt("parsing inter_kw: no kw"), null);
|
|
2159
2173
|
}(0, n.data);
|
|
2160
|
-
if (
|
|
2161
|
-
let e =
|
|
2162
|
-
r ? r(e, i, 2, t) :
|
|
2174
|
+
if (lt(Ce(), "trace_inter_event")) {
|
|
2175
|
+
let e = Fe(Ce()) + " <== " + o, t = n.data.length, r = ot(Ce(), "trace_ievent_callback");
|
|
2176
|
+
r ? r(e, i, 2, t) : Lr(0, e, i);
|
|
2163
2177
|
}
|
|
2164
2178
|
let l = i.event, s = i.kw;
|
|
2165
|
-
if ("ST_SESSION" !==
|
|
2166
|
-
if (
|
|
2167
|
-
if (0 ===
|
|
2168
|
-
} else
|
|
2169
|
-
return
|
|
2179
|
+
if ("ST_SESSION" !== bt(e)) {
|
|
2180
|
+
if (mt(e, l, D.EVF_PUBLIC_EVENT)) {
|
|
2181
|
+
if (0 === vt(e, l, s, e)) return 0;
|
|
2182
|
+
} else Bt(`${Ve(e)}: event UNKNOWN in not-session state ${l}`);
|
|
2183
|
+
return Cr(e), -1;
|
|
2170
2184
|
}
|
|
2171
2185
|
i = null;
|
|
2172
|
-
let _ =
|
|
2173
|
-
if (u.toLowerCase() !==
|
|
2174
|
-
let c =
|
|
2186
|
+
let _ = er(e, s), a = Xn(e, s, Dr), u = In(e, a, "dst_role", "");
|
|
2187
|
+
if (u.toLowerCase() !== Pe().toLowerCase()) return Bt(`"It's not my role, dst_role: ${u}, my_role: ${Pe()}`), 0;
|
|
2188
|
+
let c = In(e, a, "dst_service", "");
|
|
2175
2189
|
if ("__subscribing__" === _) return -1;
|
|
2176
2190
|
if ("__unsubscribing__" === _) return -1;
|
|
2177
|
-
if (
|
|
2178
|
-
let f =
|
|
2191
|
+
if (mt(e, l, D.EVF_PUBLIC_EVENT)) return vt(e, l, s, e), 0;
|
|
2192
|
+
let f = ge(c, !0);
|
|
2179
2193
|
if (f) {
|
|
2180
|
-
if (!
|
|
2181
|
-
|
|
2182
|
-
} else
|
|
2194
|
+
if (!mt(f, l, D.EVF_PUBLIC_EVENT)) return Bt(`${Ve(e)}: Service found but no event or not public, service '${Ve(f)}', ev '${l}'`), -1;
|
|
2195
|
+
vt(f, l, s, e);
|
|
2196
|
+
} else xe(e) ? vt(We(e), l, s, e) : $t(e, l, s);
|
|
2183
2197
|
return 0;
|
|
2184
2198
|
}
|
|
2185
|
-
function
|
|
2199
|
+
function Jr(e, t, n, r) {
|
|
2186
2200
|
return 0;
|
|
2187
2201
|
}
|
|
2188
|
-
function
|
|
2202
|
+
function qr(e, t, n, r) {
|
|
2189
2203
|
return 0;
|
|
2190
2204
|
}
|
|
2191
|
-
var
|
|
2205
|
+
var Hr = {
|
|
2192
2206
|
mt_create: function(e) {
|
|
2193
2207
|
let t = e.priv;
|
|
2194
|
-
t.gobj_timer =
|
|
2195
|
-
const n =
|
|
2196
|
-
n &&
|
|
2208
|
+
t.gobj_timer = he(Fe(e), "C_TIMER", {}, e), t.url = _t(e, "url"), t.remote_yuno_name = _t(e, "remote_yuno_name"), t.remote_yuno_role = _t(e, "remote_yuno_role"), t.remote_yuno_service = _t(e, "remote_yuno_service"), gt(e, "wanted_yuno_name", t.remote_yuno_name), gt(e, "wanted_yuno_role", t.remote_yuno_role), gt(e, "wanted_yuno_service", t.remote_yuno_service);
|
|
2209
|
+
const n = at(e, "subscriber");
|
|
2210
|
+
n && Dt(e, null, {}, n);
|
|
2197
2211
|
},
|
|
2198
2212
|
mt_writing: function(e, t) {
|
|
2199
2213
|
let n = e.priv;
|
|
2200
2214
|
switch (t) {
|
|
2201
2215
|
case "url":
|
|
2202
|
-
n.url =
|
|
2216
|
+
n.url = _t(e, "url");
|
|
2203
2217
|
break;
|
|
2204
2218
|
case "remote_yuno_name":
|
|
2205
|
-
n.remote_yuno_name =
|
|
2219
|
+
n.remote_yuno_name = _t(e, "remote_yuno_name");
|
|
2206
2220
|
break;
|
|
2207
2221
|
case "remote_yuno_role":
|
|
2208
|
-
n.remote_yuno_role =
|
|
2222
|
+
n.remote_yuno_role = _t(e, "remote_yuno_role");
|
|
2209
2223
|
break;
|
|
2210
|
-
case "remote_yuno_service": n.remote_yuno_service =
|
|
2224
|
+
case "remote_yuno_service": n.remote_yuno_service = _t(e, "remote_yuno_service");
|
|
2211
2225
|
}
|
|
2212
2226
|
},
|
|
2213
2227
|
mt_start: function(e) {
|
|
2214
2228
|
let t = e.priv;
|
|
2215
|
-
return
|
|
2229
|
+
return t.retry_ms = 0, t.websocket = $r(e), 0;
|
|
2216
2230
|
},
|
|
2217
2231
|
mt_stop: function(e) {
|
|
2218
2232
|
let t = e.priv;
|
|
2219
|
-
return
|
|
2233
|
+
return jr(t.gobj_timer), t.websocket && Cr(e), 0;
|
|
2220
2234
|
},
|
|
2221
2235
|
mt_destroy: function(e) {},
|
|
2222
2236
|
mt_stats: function(e, t, n, r) {
|
|
2223
|
-
if ("ST_SESSION" !==
|
|
2237
|
+
if ("ST_SESSION" !== bt(e)) return Bt("Not in session"), null;
|
|
2224
2238
|
n || (n = {});
|
|
2225
|
-
let o =
|
|
2226
|
-
return i || (i = {}),
|
|
2239
|
+
let o = Fr(e, Fe(r), In(e, n, "service", null, 0)), i = Ln(e, n, "__md_stats__", null, Ct.KW_EXTRACT);
|
|
2240
|
+
return i || (i = {}), Qn(e, n, "stats_stack", {
|
|
2227
2241
|
stats: t,
|
|
2228
2242
|
kw: i
|
|
2229
|
-
}),
|
|
2243
|
+
}), Qn(e, n, Dr, o), n.__stats__ = t, Zn(e, n, "__stats__"), Ur(e, "EV_MT_STATS", n, r), null;
|
|
2230
2244
|
},
|
|
2231
2245
|
mt_command_parser: function(e, t, n, r) {
|
|
2232
|
-
if ("ST_SESSION" !==
|
|
2246
|
+
if ("ST_SESSION" !== bt(e)) return Bt("Not in session"), null;
|
|
2233
2247
|
n || (n = {});
|
|
2234
|
-
let o =
|
|
2235
|
-
return i || (i = {}),
|
|
2248
|
+
let o = Fr(e, Fe(r), In(e, n, "service", "", 0)), i = Ln(e, n, "__md_command__", null, Ct.KW_EXTRACT);
|
|
2249
|
+
return i || (i = {}), Qn(e, n, "command_stack", {
|
|
2236
2250
|
command: t,
|
|
2237
2251
|
kw: i
|
|
2238
|
-
}),
|
|
2252
|
+
}), Qn(e, n, Dr, o), n.__command__ = t, Zn(e, n, "__command__"), Ur(e, "EV_MT_COMMAND", n, r), null;
|
|
2239
2253
|
},
|
|
2240
2254
|
mt_inject_event: function(e, t, n, r) {
|
|
2241
|
-
if ("ST_SESSION" !==
|
|
2242
|
-
if (n || (n = {}),
|
|
2255
|
+
if ("ST_SESSION" !== bt(e)) return window.console.error("Not in session"), -1;
|
|
2256
|
+
if (n || (n = {}), Xn(e, n, Dr));
|
|
2243
2257
|
else {
|
|
2244
|
-
let o =
|
|
2245
|
-
|
|
2258
|
+
let o = Fr(e, Fe(r), In(e, n, "__service__", 0, 0));
|
|
2259
|
+
rn(n, "__service__"), Qn(e, n, "__message__", t), Qn(e, n, Dr, o);
|
|
2246
2260
|
}
|
|
2247
|
-
return
|
|
2261
|
+
return Zn(e, n, "__message__"), Ur(e, t, n, r);
|
|
2248
2262
|
},
|
|
2249
2263
|
mt_subscription_added: function(e, t) {
|
|
2250
2264
|
let n = e.priv;
|
|
2251
|
-
return "ST_SESSION" ===
|
|
2265
|
+
return "ST_SESSION" === bt(e) && n.websocket ? n.inside_on_open ? 0 : Vr(e, t) : 0;
|
|
2252
2266
|
},
|
|
2253
2267
|
mt_subscription_deleted: function(e, t) {
|
|
2254
2268
|
let n = e.priv;
|
|
2255
|
-
if ("ST_SESSION" !==
|
|
2269
|
+
if ("ST_SESSION" !== bt(e) || !n.websocket) return 0;
|
|
2256
2270
|
if (n.inside_on_open) return 0;
|
|
2257
|
-
if (
|
|
2271
|
+
if (yn(t.event)) return 0;
|
|
2258
2272
|
let r = {}, o = t.__global__, i = t.__config__, l = t.__filter__, s = t.__service__, _ = t.subscriber;
|
|
2259
|
-
return i && (r.__config__ = i), o && (r.__global__ = o), l && (r.__filter__ = l),
|
|
2273
|
+
return i && (r.__config__ = i), o && (r.__global__ = o), l && (r.__filter__ = l), Qn(e, r, Dr, Fr(e, Fe(_), s)), Zn(e, r, "__unsubscribing__"), Ur(e, t.event, r, e);
|
|
2260
2274
|
}
|
|
2261
2275
|
};
|
|
2262
2276
|
e.GObj = O, e.SDATA = j, e.SDATAAUTHZ = (e, t, n, r, o, i) => new y(e, t, n, null, i, r, null, 0, null, o, null), e.SDATACM = (e, t, n, r, o, i) => new y(e, t, 0, null, i, n, null, 0, o, r, null), e.SDATACM2 = (e, t, n, r, o, i, l) => new y(e, t, n, null, l, r, null, 0, i, o, null), e.SDATADF = (e, t, n, r, o, i) => new y(e, t, n, null, i, null, r, o), e.SDATAPM = (e, t, n, r, o) => new y(e, t, n, r, o), e.SDATAPM0 = (e, t, n, r, o) => new y(e, t, n, null, o, null, null, 0, null, null, r), e.SDATA_END = v, e.SDataDesc = y, e.YUNETA_VERSION = l, Object.defineProperty(e, "__yuno__", {
|
|
@@ -2270,48 +2284,48 @@
|
|
|
2270
2284
|
return t;
|
|
2271
2285
|
}, e.build_stats_response = i, e.clean_name = function(e) {
|
|
2272
2286
|
return e.replace(/[?# ^:]/g, "_");
|
|
2273
|
-
}, e.clear_timeout =
|
|
2287
|
+
}, e.clear_timeout = jr, e.cmp_two_simple_json = On, e.command_parser = function(e, t, n, r) {}, e.createElement2 = function e(t, n) {
|
|
2274
2288
|
let [r, o, i, l] = t;
|
|
2275
|
-
if (!r) return void
|
|
2289
|
+
if (!r) return void Bt("Tag must be a valid HTML element.");
|
|
2276
2290
|
let s = document.createElement(r), _ = "";
|
|
2277
2291
|
if (o && "object" == typeof o) for (let e of Object.keys(o)) if ("style" === e && "object" == typeof o[e]) {
|
|
2278
2292
|
let t = "";
|
|
2279
2293
|
for (const n of Object.keys(o[e])) t += `${n}: ${o[e][n]};`;
|
|
2280
2294
|
s.style.cssText = t;
|
|
2281
2295
|
} else "style" === e ? s.style.cssText = o[e] : "i18n" === e || "data-i18n" === e || "data_i18next" === e || "data-i18next" === e ? null !== o[e] && void 0 !== o[e] && (_ = o[e], s.setAttribute("data-i18n", _)) : s.setAttribute(e, o[e]);
|
|
2282
|
-
if (
|
|
2296
|
+
if (bn(i)) if (i = i.trim(), i.length > 0 && "<" === i[0]) s.appendChild(ir(i));
|
|
2283
2297
|
else if (n && _) s.textContent = n(_) || i;
|
|
2284
2298
|
else s.textContent = i;
|
|
2285
|
-
else if (
|
|
2286
|
-
if (i.length > 0) if (
|
|
2299
|
+
else if (dn(i)) {
|
|
2300
|
+
if (i.length > 0) if (bn(i[0])) s.appendChild(e(i, n));
|
|
2287
2301
|
else for (let t of i) Array.isArray(t) && t.length > 0 ? s.appendChild(e(t, n)) : t instanceof HTMLElement && s.appendChild(t);
|
|
2288
|
-
} else i instanceof HTMLElement || i instanceof Text || i instanceof SVGElement ? s.appendChild(i) : null != i && (
|
|
2302
|
+
} else i instanceof HTMLElement || i instanceof Text || i instanceof SVGElement ? s.appendChild(i) : null != i && (Bt("content ignored"), zt(i));
|
|
2289
2303
|
if (l && "object" == typeof l) for (const e of Object.keys(l)) s.addEventListener(e, l[e]);
|
|
2290
2304
|
return s;
|
|
2291
|
-
}, e.createOneHtml =
|
|
2292
|
-
let n =
|
|
2293
|
-
return
|
|
2305
|
+
}, e.createOneHtml = ir, e.create_json_record = function(e, t) {
|
|
2306
|
+
let n = Qt(e);
|
|
2307
|
+
return en(n, t), n;
|
|
2294
2308
|
}, e.create_template_record = function(e, t) {
|
|
2295
2309
|
let n = {};
|
|
2296
2310
|
return t || (t = {}), Object.entries(e).forEach(([e, r]) => {
|
|
2297
2311
|
let o;
|
|
2298
|
-
|
|
2312
|
+
gn(r) && (o = r.default), n[e] = Ln(null, t, e, o);
|
|
2299
2313
|
}), n;
|
|
2300
|
-
}, e.current_timestamp =
|
|
2301
|
-
let n =
|
|
2302
|
-
return n &&
|
|
2314
|
+
}, e.current_timestamp = lr, e.data_type_t = T, e.db_list_persistent_attrs = function(e, t) {
|
|
2315
|
+
let n = Wn(ur(e), null, !1), r = {};
|
|
2316
|
+
return n && gn(n) && (r = Vn(e, n, t, !1)), r;
|
|
2303
2317
|
}, e.db_load_persistent_attrs = function(e, t) {
|
|
2304
|
-
let n =
|
|
2305
|
-
if (r &&
|
|
2306
|
-
let o =
|
|
2307
|
-
o =
|
|
2318
|
+
let n = it(e, h.SDF_PERSIST), r = Wn(ur(e), null, !1);
|
|
2319
|
+
if (r && gn(r)) {
|
|
2320
|
+
let o = Vn(e, r, t, !1);
|
|
2321
|
+
o = Vn(e, o, n, !1), ut(e, o, h.SDF_PERSIST);
|
|
2308
2322
|
}
|
|
2309
2323
|
}, e.db_remove_persistent_attrs = function(e, t) {
|
|
2310
|
-
let n =
|
|
2311
|
-
0 ===
|
|
2324
|
+
let n = Mn(e, Wn(ur(e), null, !1), t, !1);
|
|
2325
|
+
0 === un(n) ? xn(ur(e)) : Kn(ur(e), n);
|
|
2312
2326
|
}, e.db_save_persistent_attrs = function(e, t) {
|
|
2313
|
-
let n =
|
|
2314
|
-
return r &&
|
|
2327
|
+
let n = Vn(e, it(e, h.SDF_PERSIST), t, !1), r = Wn(ur(e), null, !1);
|
|
2328
|
+
return r && gn(r) && tn(n, r), Kn(ur(e), n);
|
|
2315
2329
|
}, e.debounce = function(e, t = 0, n = !1) {
|
|
2316
2330
|
let r = null, o = null, i = null;
|
|
2317
2331
|
const l = (...l) => {
|
|
@@ -2336,7 +2350,7 @@
|
|
|
2336
2350
|
Object.assign(t, e);
|
|
2337
2351
|
}
|
|
2338
2352
|
return t;
|
|
2339
|
-
}, e.empty_string =
|
|
2353
|
+
}, e.empty_string = yn, e.escapeHtml = or, e.event_flag_t = D, e.gclass_add_ev_action = le, e.gclass_add_event_type = _e, e.gclass_add_state = ie, e.gclass_check_fsm = ue, e.gclass_create = te, e.gclass_event_type = ae, e.gclass_find_by_name = ce, e.gclass_flag_t = N, e.gclass_unregister = ne, e.getPositionRelativeToBody = function(e) {
|
|
2340
2354
|
if (!e) return {
|
|
2341
2355
|
top: 0,
|
|
2342
2356
|
left: 0,
|
|
@@ -2355,59 +2369,59 @@
|
|
|
2355
2369
|
right: n + s + r,
|
|
2356
2370
|
bottom: t + l + o
|
|
2357
2371
|
};
|
|
2358
|
-
}, e.get_function_name =
|
|
2372
|
+
}, e.get_function_name = ar, e.get_now = function() {
|
|
2359
2373
|
return Math.floor(Date.now() / 1e3);
|
|
2360
|
-
}, e.gobj_bottom_gobj =
|
|
2361
|
-
return
|
|
2362
|
-
}, e.gobj_change_state =
|
|
2363
|
-
if (
|
|
2364
|
-
let l = p &&
|
|
2365
|
-
return l && (L(n("🌀🌀 mach(%s%s), cmd: %s, src: %s",
|
|
2374
|
+
}, e.gobj_bottom_gobj = Be, e.gobj_change_parent = function(e, t) {
|
|
2375
|
+
return Ye(e) ? (Bt("gobj NULL or DESTROYED"), null) : t instanceof O ? (e.parent && e.parent.mt_child_removed && e.parent.mt_child_removed(e.parent, e), e.parent && (pe(e.parent, e), e.parent = null), be(t, e), t.mt_child_added && (Y(e) && qt(n("👦👦🔵 child_added(%s): %s", Me(t), Ve(e))), t.mt_child_added(t, e)), 0) : (Bt(`${Ve(e)}: gobj_change_parent() BAD TYPE of parent`), -1);
|
|
2376
|
+
}, e.gobj_change_state = dt, e.gobj_command = function(e, t, r, i) {
|
|
2377
|
+
if (Ye(e)) return Bt("gobj NULL or DESTROYED"), -1;
|
|
2378
|
+
let l = p && st(p, "tracing");
|
|
2379
|
+
return l && (L(n("🌀🌀 mach(%s%s), cmd: %s, src: %s", Ae(e) ? "" : "!!", Ve(e), t, Ve(i))), l > 1 && zt(r)), e.gclass.gmt.mt_command_parser ? e.gclass.gmt.mt_command_parser(e, t, r, i) : e.gclass.command_table ? c ? c(e, t, r, i) : o(0, -1, n("%s: global command parser not available", Ve(e)), 0, 0) : o(0, -1, n("%s: command table not available", Ve(e)), 0, 0);
|
|
2366
2380
|
}, e.gobj_create = function(e, t, n, r) {
|
|
2367
|
-
return
|
|
2368
|
-
}, e.gobj_create2 =
|
|
2369
|
-
return
|
|
2370
|
-
}, e.gobj_create_pure_child =
|
|
2371
|
-
return
|
|
2381
|
+
return Te(e, t, n, r, 0);
|
|
2382
|
+
}, e.gobj_create2 = Te, e.gobj_create_default_service = function(e, t, n, r) {
|
|
2383
|
+
return Te(e, t, n, r, R.gobj_flag_default_service | R.gobj_flag_autostart);
|
|
2384
|
+
}, e.gobj_create_pure_child = he, e.gobj_create_service = function(e, t, n, r) {
|
|
2385
|
+
return Te(e, t, n, r, R.gobj_flag_service);
|
|
2372
2386
|
}, e.gobj_create_volatil = function(e, t, n, r) {
|
|
2373
|
-
return
|
|
2387
|
+
return Te(e, t, n, r, R.gobj_flag_volatil);
|
|
2374
2388
|
}, e.gobj_create_yuno = function(e, t, n) {
|
|
2375
|
-
return
|
|
2376
|
-
}, e.gobj_current_state =
|
|
2377
|
-
if (
|
|
2389
|
+
return Te(e, t, n, null, R.gobj_flag_yuno);
|
|
2390
|
+
}, e.gobj_current_state = bt, e.gobj_default_service = fe, e.gobj_deliver_posted_events = yt, e.gobj_destroy = ye, e.gobj_find_child = tt, e.gobj_find_gobj = function(e, t) {
|
|
2391
|
+
if (yn(t)) return null;
|
|
2378
2392
|
const n = t.toLowerCase();
|
|
2379
|
-
return "__default_service__" === n ? m : "__yuno__" === n || "__root__" === n ? p :
|
|
2380
|
-
}, e.gobj_find_service =
|
|
2393
|
+
return "__default_service__" === n ? m : "__yuno__" === n || "__root__" === n ? p : nt(p, t);
|
|
2394
|
+
}, e.gobj_find_service = ge, e.gobj_find_subscribings = It, e.gobj_find_subscriptions = kt, e.gobj_flag_t = R, e.gobj_full_name = Me, e.gobj_gclass_name = Ge, e.gobj_global_trace_level = function() {
|
|
2381
2395
|
return F;
|
|
2382
|
-
}, e.gobj_has_attr =
|
|
2396
|
+
}, e.gobj_has_attr = rt, e.gobj_has_event = mt, e.gobj_has_output_event = Et, e.gobj_hsdata = X, e.gobj_is_destroying = Ye, e.gobj_is_playing = $e, e.gobj_is_pure_child = xe, e.gobj_is_running = Ae, e.gobj_is_service = Ie, e.gobj_is_volatil = Ke, e.gobj_list_persistent_attrs = function(e, t) {
|
|
2383
2397
|
return u ? u(e, t) : null;
|
|
2384
2398
|
}, e.gobj_list_subscriptions = function(e) {
|
|
2385
|
-
let t =
|
|
2399
|
+
let t = kt(e, null, null, null);
|
|
2386
2400
|
for (let n = 0; n < t.length; n++) {
|
|
2387
|
-
let r = t[n], o =
|
|
2388
|
-
|
|
2401
|
+
let r = t[n], o = $n(e, r, "publisher", null, Ct.KW_REQUIRED), i = $n(e, r, "subscriber", null, Ct.KW_REQUIRED);
|
|
2402
|
+
ln(r, "s_event", In(e, r, "event", "", Ct.KW_REQUIRED)), ln(r, "s_publisher", Ve(o)), ln(r, "s_subscriber", Ve(i));
|
|
2389
2403
|
}
|
|
2390
|
-
let n =
|
|
2404
|
+
let n = It(e, 0, null, 0);
|
|
2391
2405
|
for (let t = 0; t < n.length; t++) {
|
|
2392
|
-
let r = n[t], o =
|
|
2393
|
-
|
|
2406
|
+
let r = n[t], o = $n(e, r, "publisher", null, Ct.KW_REQUIRED), i = $n(e, r, "subscriber", null, Ct.KW_REQUIRED);
|
|
2407
|
+
ln(r, "s_event", In(e, r, "event", "", Ct.KW_REQUIRED)), ln(r, "s_publisher", Ve(o)), ln(r, "s_subscriber", Ve(i));
|
|
2394
2408
|
}
|
|
2395
2409
|
return {
|
|
2396
2410
|
subscriptions: t,
|
|
2397
2411
|
subscribings: n,
|
|
2398
|
-
"total subscriptions":
|
|
2399
|
-
total_subscribings:
|
|
2412
|
+
"total subscriptions": cn(t),
|
|
2413
|
+
total_subscribings: cn(n)
|
|
2400
2414
|
};
|
|
2401
2415
|
}, e.gobj_load_persistent_attrs = function(e, t) {
|
|
2402
|
-
return
|
|
2416
|
+
return Ie(e) ? s ? s(e, t) : -1 : (Bt(`${Ve(e)}: Only gobj services can load/save writable-persistent`), -1);
|
|
2403
2417
|
}, e.gobj_match_children = function(e, t) {
|
|
2404
|
-
if (
|
|
2418
|
+
if (Ye(e)) return Bt("gobj NULL or DESTROYED"), null;
|
|
2405
2419
|
t = t || {};
|
|
2406
2420
|
let n = [];
|
|
2407
2421
|
const r = e.dl_children;
|
|
2408
2422
|
for (let e = 0; e < r.length; e++) {
|
|
2409
2423
|
const o = r[e];
|
|
2410
|
-
|
|
2424
|
+
et(o, t) && n.push(o);
|
|
2411
2425
|
}
|
|
2412
2426
|
return n;
|
|
2413
2427
|
}, e.gobj_match_children_tree = function(e, t) {
|
|
@@ -2417,15 +2431,20 @@
|
|
|
2417
2431
|
let o = r.dl_children;
|
|
2418
2432
|
for (let r = 0; r < o.length; r++) {
|
|
2419
2433
|
let i = o[r];
|
|
2420
|
-
|
|
2434
|
+
et(i, t) && n.push(i), e(n, i);
|
|
2421
2435
|
}
|
|
2422
2436
|
}(n, e), n;
|
|
2423
|
-
}, e.gobj_match_gobj =
|
|
2424
|
-
|
|
2425
|
-
|
|
2426
|
-
|
|
2427
|
-
|
|
2428
|
-
|
|
2437
|
+
}, e.gobj_match_gobj = et, e.gobj_name = Fe, e.gobj_parent = We, e.gobj_pause = De, e.gobj_play = we, e.gobj_post_event = function(e, t, r, o) {
|
|
2438
|
+
return e && e instanceof O ? e.obflag & (w.obflag_destroyed | w.obflag_destroying) ? (Bt(`gobj_post_event(): gobj dst DESTROYING, event ${t}`), -1) : yn(t) ? (Bt("gobj_post_event(): event EMPTY"), -1) : mt(e, t, 0) ? Tt.length >= 1e4 ? (Bt(`gobj_post_event(): too many posted events, this is NOT a work queue, event ${t}, pending ${Tt.length}`), -1) : (Tt.push({
|
|
2439
|
+
dst: e,
|
|
2440
|
+
event: t,
|
|
2441
|
+
kw: r,
|
|
2442
|
+
src: o
|
|
2443
|
+
}), J(e, t) && !q(o, t) && L(n("📬 posted(%s%s), ev: %s, pending: %d", e.running ? "" : "!!", Ve(e), t, Tt.length)), ht || (ht = !0, setTimeout(yt, 0)), 0) : (Bt(`gobj_post_event(): event NOT DEFINED in gclass ${Ge(e)}, event ${t}`), -1) : (Bt(`gobj_post_event(): gobj dst NULL, event ${t}`), -1);
|
|
2444
|
+
}, e.gobj_posted_events_size = function() {
|
|
2445
|
+
return Tt.length;
|
|
2446
|
+
}, e.gobj_publish_event = $t, e.gobj_read_attr = ot, e.gobj_read_attrs = it, e.gobj_read_bool_attr = lt, e.gobj_read_integer_attr = st, e.gobj_read_pointer_attr = at, e.gobj_read_str_attr = _t, e.gobj_remove_persistent_attrs = function(e, t) {
|
|
2447
|
+
return Ie(e) ? a ? a(e, t) : -1 : (Bt(`${Ve(e)}: Only gobj services can load/save writable-persistent`), -1);
|
|
2429
2448
|
}, e.gobj_repr_global_trace_levels = function() {
|
|
2430
2449
|
return U.map(([e, t, n]) => ({
|
|
2431
2450
|
name: e,
|
|
@@ -2435,33 +2454,33 @@
|
|
|
2435
2454
|
}));
|
|
2436
2455
|
}, e.gobj_reset_volatil_attrs = function(e) {
|
|
2437
2456
|
return function(e, t, n) {
|
|
2438
|
-
if (
|
|
2457
|
+
if (Ye(e)) return Bt("gobj NULL or DESTROYED"), -1;
|
|
2439
2458
|
let r = e.gclass.attrs_table;
|
|
2440
2459
|
for (let o = 0; o < r.length; o++) {
|
|
2441
2460
|
const i = r[o];
|
|
2442
2461
|
if (i.name && !(n && i.flag & n) && (-1 === t || i.flag & t)) {
|
|
2443
|
-
const t =
|
|
2444
|
-
|
|
2462
|
+
const t = z(e, e.jn_attrs, i);
|
|
2463
|
+
gn(e.priv) && e.priv.hasOwnProperty(i.name) && (e.priv[i.name] = t), e.gclass.gmt.mt_writing && e.gclass.gmt.mt_writing(e, i.name);
|
|
2445
2464
|
}
|
|
2446
2465
|
}
|
|
2447
2466
|
return 0;
|
|
2448
2467
|
}(e, h.SDF_VOLATIL, 0);
|
|
2449
2468
|
}, e.gobj_save_persistent_attrs = function(e, t) {
|
|
2450
|
-
return
|
|
2451
|
-
}, e.gobj_search_path =
|
|
2469
|
+
return Ie(e) ? _ ? _(e, t) : -1 : (Bt(`${Ve(e)}: Only gobj services can load/save writable-persistent`), -1);
|
|
2470
|
+
}, e.gobj_search_path = nt, e.gobj_send_event = vt, e.gobj_services = function() {
|
|
2452
2471
|
let e = [];
|
|
2453
|
-
for (const t of Object.keys(b))
|
|
2472
|
+
for (const t of Object.keys(b)) _n(e, t);
|
|
2454
2473
|
return e;
|
|
2455
|
-
}, e.gobj_set_bottom_gobj =
|
|
2474
|
+
}, e.gobj_set_bottom_gobj = Je, e.gobj_set_deep_trace = function(e) {
|
|
2456
2475
|
return V = Number(e) || 0, 0;
|
|
2457
2476
|
}, e.gobj_set_gclass_no_trace = function(e, t, n) {
|
|
2458
|
-
const r =
|
|
2459
|
-
if (!r) return
|
|
2477
|
+
const r = bn(e) ? ce(e) : e;
|
|
2478
|
+
if (!r) return Bt(`gobj_set_gclass_no_trace: gclass NOT FOUND: ${e}`), -1;
|
|
2460
2479
|
const o = M(t, "gobj_set_gclass_no_trace");
|
|
2461
2480
|
return o ? (n ? r.no_trace_level |= o : r.no_trace_level &= ~o, 0) : -1;
|
|
2462
2481
|
}, e.gobj_set_gclass_trace = function(e, t, n) {
|
|
2463
|
-
const r =
|
|
2464
|
-
if (!r) return
|
|
2482
|
+
const r = bn(e) ? ce(e) : e;
|
|
2483
|
+
if (!r) return Bt(`gobj_set_gclass_trace: gclass NOT FOUND: ${e}`), -1;
|
|
2465
2484
|
const o = M(t, "gobj_set_gclass_trace");
|
|
2466
2485
|
return o ? (n ? r.trace_level |= o : r.trace_level &= ~o, 0) : -1;
|
|
2467
2486
|
}, e.gobj_set_global_no_trace = function(e, t) {
|
|
@@ -2471,36 +2490,36 @@
|
|
|
2471
2490
|
const n = M(e, "gobj_set_global_trace");
|
|
2472
2491
|
return n ? (t ? F |= n : F &= ~n, 0) : -1;
|
|
2473
2492
|
}, e.gobj_set_gobj_no_trace = function(e, t, n) {
|
|
2474
|
-
if (!e) return
|
|
2493
|
+
if (!e) return Bt("gobj_set_gobj_no_trace: gobj NULL"), -1;
|
|
2475
2494
|
const r = M(t, "gobj_set_gobj_no_trace");
|
|
2476
2495
|
return r ? (n ? e.no_trace_level |= r : e.no_trace_level &= ~r, 0) : -1;
|
|
2477
2496
|
}, e.gobj_set_gobj_trace = function(e, t, n) {
|
|
2478
|
-
if (!e) return
|
|
2497
|
+
if (!e) return Bt("gobj_set_gobj_trace: gobj NULL"), -1;
|
|
2479
2498
|
const r = M(t, "gobj_set_gobj_trace");
|
|
2480
2499
|
return r ? (n ? e.trace_level |= r : e.trace_level &= ~r, 0) : -1;
|
|
2481
2500
|
}, e.gobj_set_trace_machine_format = function(e) {
|
|
2482
2501
|
C = 1 === Number(e) ? 1 : 0;
|
|
2483
|
-
}, e.gobj_short_name =
|
|
2484
|
-
return
|
|
2502
|
+
}, e.gobj_short_name = Ve, e.gobj_start = ve, e.gobj_start_children = function(e) {
|
|
2503
|
+
return Ye(e) ? (Bt("gobj NULL or DESTROYED"), -1) : He(e, A.WALK_FIRST2LAST, je, 0, 0);
|
|
2485
2504
|
}, e.gobj_start_tree = function(e) {
|
|
2486
|
-
return
|
|
2505
|
+
return Ye(e) ? (Bt("gobj NULL or DESTROYED"), -1) : (B(e) && L(n("⏺ ⏺ ⏺ ⏺ start_tree: %s", Me(e))), e.gclass.gclass_flag & N.gcflag_manual_start || e.disabled ? 0 : (e.running || ve(e), ze(e, A.WALK_TOP2BOTTOM, Se, 0, 0)));
|
|
2487
2506
|
}, e.gobj_start_up = function(e, t, n, r, o, i, l) {
|
|
2488
2507
|
s = t, _ = n, a = r, u = o, c = i, f = l;
|
|
2489
2508
|
const d = [["EV_STATE_CHANGED", D.EVF_SYSTEM_EVENT | D.EVF_OUTPUT_EVENT | D.EVF_NO_WARN_SUBS], [0, 0]];
|
|
2490
2509
|
for (let e = 0; e < d.length; e++) {
|
|
2491
2510
|
let t = d[e][0], n = d[e][1];
|
|
2492
|
-
|
|
2511
|
+
se(g, t, n);
|
|
2493
2512
|
}
|
|
2494
2513
|
return 0;
|
|
2495
2514
|
}, e.gobj_stats = function(e, t, r, o) {
|
|
2496
|
-
return
|
|
2497
|
-
}, e.gobj_stop =
|
|
2498
|
-
return
|
|
2499
|
-
}, e.gobj_subscribe_event =
|
|
2515
|
+
return Ye(e) ? (Bt("gobj NULL or DESTROYED"), -1) : e.gclass.gmt.mt_stats ? e.gclass.gmt.mt_stats(e, t, r, o) : f ? f(e, t, r, o) : i(0, -1, n("%s, stats parser not available", Ve(e)), 0, 0);
|
|
2516
|
+
}, e.gobj_stop = Oe, e.gobj_stop_children = Re, e.gobj_stop_tree = function(e) {
|
|
2517
|
+
return Ye(e) ? (Bt("gobj NULL or DESTROYED"), -1) : (B(e) && L(n("⏹ ⏹ ⏹ ⏹ stop_tree: %s", Me(e))), Ae(e) && Oe(e), ze(e, A.WALK_TOP2BOTTOM, Ne, 0, 0));
|
|
2518
|
+
}, e.gobj_subscribe_event = Dt, e.gobj_trace_level = W, e.gobj_trace_machine_format = function() {
|
|
2500
2519
|
return C;
|
|
2501
2520
|
}, e.gobj_trace_no_level = K, e.gobj_unsubscribe_event = function(e, t, n, r) {
|
|
2502
|
-
if (null == n && (n = {}), !e) return
|
|
2503
|
-
if (!r) return
|
|
2521
|
+
if (null == n && (n = {}), !e) return Bt(`publisher NULL: ev ${t}`), 0;
|
|
2522
|
+
if (!r) return Bt(`subscriber NULL: ev ${t}`), 0;
|
|
2504
2523
|
const o = new Set([
|
|
2505
2524
|
"__config__",
|
|
2506
2525
|
"__global__",
|
|
@@ -2509,102 +2528,102 @@
|
|
|
2509
2528
|
"__service__"
|
|
2510
2529
|
]);
|
|
2511
2530
|
if (Object.keys(n).forEach((n) => {
|
|
2512
|
-
o.has(n) ||
|
|
2513
|
-
}),
|
|
2514
|
-
else if (!(
|
|
2515
|
-
let i =
|
|
2531
|
+
o.has(n) || Bt(`${Ve(e)}: key ignored in subscription (key: ${n}, event: ${t})`);
|
|
2532
|
+
}), yn(t)) t = "";
|
|
2533
|
+
else if (!(Et(e, t, D.EVF_OUTPUT_EVENT) || e.gclass.gclass_flag & N.gcflag_no_check_output_events)) return Bt(`event NOT in output event list: ${Ve(e)}, ev ${t}`), 0;
|
|
2534
|
+
let i = Nt(e.dl_subscriptions, e, t, n, r), l = 0;
|
|
2516
2535
|
for (let t = 0; t < i.length; t++) {
|
|
2517
2536
|
let n = i[t];
|
|
2518
|
-
|
|
2537
|
+
wt(e, n, !1, !1), l++;
|
|
2519
2538
|
}
|
|
2520
|
-
return l || (
|
|
2521
|
-
}, e.gobj_unsubscribe_list =
|
|
2522
|
-
if (!
|
|
2539
|
+
return l || (Jt(`${Ve(e)}: No subscription found`), zt(n, "No subscription found")), 0;
|
|
2540
|
+
}, e.gobj_unsubscribe_list = At, e.gobj_walk_gobj_children = He, e.gobj_walk_gobj_children_tree = ze, e.gobj_write_attr = function(e, t, r, o) {
|
|
2541
|
+
if (!bn(t)) return Bt(n("gobj_write_attr(%s): path must be a string", Ve(e))), -1;
|
|
2523
2542
|
let i, l = e.jn_attrs, s = t.split("`");
|
|
2524
2543
|
if (s.length <= 1) {
|
|
2525
2544
|
let o = t;
|
|
2526
|
-
return o in l && l.hasOwnProperty(o) ? (l[o] = r,
|
|
2545
|
+
return o in l && l.hasOwnProperty(o) ? (l[o] = r, gn(e.priv) && e.priv.hasOwnProperty(o) && (e.priv[o] = r), e.obflag & w.obflag_created && !(e.obflag & w.obflag_destroyed) && e.gclass.gmt.mt_writing && e.gclass.gmt.mt_writing(e, o), 0) : (Bt(n("gobj_write_attr(%s): attr not found '%s'", Ve(e), o)), -1);
|
|
2527
2546
|
}
|
|
2528
2547
|
let _ = s.length;
|
|
2529
2548
|
for (let t = 0; t < _; t++) {
|
|
2530
2549
|
i = s[t];
|
|
2531
|
-
let n =
|
|
2550
|
+
let n = tt(e, { __gobj_name__: i });
|
|
2532
2551
|
if (n && t < _ - 1) {
|
|
2533
2552
|
e = n;
|
|
2534
2553
|
continue;
|
|
2535
2554
|
}
|
|
2536
2555
|
let o = e.jn_attrs;
|
|
2537
|
-
if (i in o && o.hasOwnProperty(i)) return o[i] = r,
|
|
2556
|
+
if (i in o && o.hasOwnProperty(i)) return o[i] = r, gn(e.priv) && e.priv.hasOwnProperty(i) && (e.priv[i] = r), e.obflag & w.obflag_created && !(e.obflag & w.obflag_destroyed) && e.mt_writing && e.mt_writing(e, i), 0;
|
|
2538
2557
|
break;
|
|
2539
2558
|
}
|
|
2540
|
-
return
|
|
2541
|
-
}, e.gobj_write_attrs =
|
|
2559
|
+
return Bt(n("gobj_write_attr(%s): attr not found '%s'", Ve(e), i)), -1;
|
|
2560
|
+
}, e.gobj_write_attrs = ut, e.gobj_write_bool_attr = ct, e.gobj_write_integer_attr = ft, e.gobj_write_str_attr = gt, e.gobj_yuno = Ce, e.gobj_yuno_id = Ue, e.gobj_yuno_name = Le, e.gobj_yuno_role = Pe, e.id_index_in_obj_list = Jn, e.index_in_list = sr, e.is_array = dn, e.is_boolean = mn, e.is_date = function(e) {
|
|
2542
2561
|
return e instanceof Date && !isNaN(e);
|
|
2543
|
-
}, e.is_function =
|
|
2544
|
-
if (!
|
|
2562
|
+
}, e.is_function = Tn, e.is_gobj = hn, e.is_metadata_key = function(e) {
|
|
2563
|
+
if (!bn(e)) return !1;
|
|
2545
2564
|
let t;
|
|
2546
2565
|
for (t = 0; t < e.length && "_" === e[t] && !(t > 2); t++);
|
|
2547
2566
|
return 2 === t;
|
|
2548
|
-
}, e.is_null =
|
|
2549
|
-
if (!
|
|
2567
|
+
}, e.is_null = En, e.is_number = pn, e.is_object = gn, e.is_private_key = function(e) {
|
|
2568
|
+
if (!bn(e)) return !1;
|
|
2550
2569
|
let t;
|
|
2551
2570
|
for (t = 0; t < e.length && "_" === e[t] && !(t > 2); t++);
|
|
2552
2571
|
return 1 === t;
|
|
2553
2572
|
}, e.is_pure_number = function(e) {
|
|
2554
|
-
if (
|
|
2555
|
-
if (!
|
|
2573
|
+
if (pn(e)) return !0;
|
|
2574
|
+
if (!bn(e)) return !1;
|
|
2556
2575
|
const t = Number(e);
|
|
2557
2576
|
return !isNaN(t) && "" !== e.trim() && !isNaN(t);
|
|
2558
|
-
}, e.is_string =
|
|
2559
|
-
let o =
|
|
2560
|
-
if (!o) return
|
|
2561
|
-
if (
|
|
2577
|
+
}, e.is_string = bn, e.jdb_delete = function(e, t, n, r) {
|
|
2578
|
+
let o = Ln(null, Ln(null, e, "topics", null, 0), t, null, 0);
|
|
2579
|
+
if (!o) return Bt("jdb_delete: topic not found: " + t), null;
|
|
2580
|
+
if (yn(r.id)) return Bt("jdb_delete: record without id: " + r), Ht(r), null;
|
|
2562
2581
|
let i, l = n.split("`"), s = o;
|
|
2563
|
-
for (; (i = l.shift()) && !
|
|
2564
|
-
if (0 === l.length && s) if (
|
|
2565
|
-
let e =
|
|
2582
|
+
for (; (i = l.shift()) && !yn(i) && s;) gn(s) && (s = Ln(null, s, e.hook, null, 0)), s = nr(s, null, i, !1);
|
|
2583
|
+
if (0 === l.length && s) if (dn(s)) {
|
|
2584
|
+
let e = Jn(s, r.id);
|
|
2566
2585
|
e >= 0 && s.splice(e, 1);
|
|
2567
2586
|
} else {
|
|
2568
|
-
let t =
|
|
2587
|
+
let t = Ln(null, s, e.hook, null, 0), n = Jn(t, r.id);
|
|
2569
2588
|
n >= 0 && t.splice(n, 1);
|
|
2570
2589
|
}
|
|
2571
2590
|
return o;
|
|
2572
2591
|
}, e.jdb_get = function(e, t, n, r) {
|
|
2573
|
-
let o =
|
|
2574
|
-
return o ? (void 0 === r && (r = !0),
|
|
2592
|
+
let o = Ln(null, Ln(null, e, "topics", null, 0), t, null, 0);
|
|
2593
|
+
return o ? (void 0 === r && (r = !0), nr(o, e.hook, n, r)) : (Bt("jdb_get: topic not found: " + t), null);
|
|
2575
2594
|
}, e.jdb_get_by_idx = function(e, t, n) {
|
|
2576
|
-
let r =
|
|
2577
|
-
return r ? n < r.length ? r[n] : {} : (
|
|
2595
|
+
let r = Ln(null, Ln(null, e, "topics", null, 0), t, null, 0);
|
|
2596
|
+
return r ? n < r.length ? r[n] : {} : (Bt("jdb_get_by_idx: topic not found: " + t), null);
|
|
2578
2597
|
}, e.jdb_get_topic = function(e, t) {
|
|
2579
|
-
let n =
|
|
2580
|
-
if (!n) return
|
|
2581
|
-
return
|
|
2598
|
+
let n = Ln(null, e, "topics", null, 0);
|
|
2599
|
+
if (!n) return Bt("jdb topics section not found"), Ht(e), null;
|
|
2600
|
+
return Ln(null, n, t, null, 0) || (Bt("jdb topic not found: " + t), Ht(n), null);
|
|
2582
2601
|
}, e.jdb_init = function(e, t, n) {
|
|
2583
|
-
n && (e =
|
|
2584
|
-
let r =
|
|
2585
|
-
|
|
2586
|
-
let o =
|
|
2587
|
-
return
|
|
2588
|
-
"__" !== t.substring(0, 2) &&
|
|
2602
|
+
n && (e = Qt(e));
|
|
2603
|
+
let r = Ln(null, e, "type", [], 1);
|
|
2604
|
+
In(null, e, "hook", "data", 1);
|
|
2605
|
+
let o = Ln(null, e, "schema", {}, 1), i = Ln(null, e, "topics", {}, 1);
|
|
2606
|
+
return tr(o, function(e, t, n, o) {
|
|
2607
|
+
"__" !== t.substring(0, 2) && Ln(null, i, o, Qt(r), 1);
|
|
2589
2608
|
}, t), e;
|
|
2590
2609
|
}, e.jdb_update = function(e, t, n, r) {
|
|
2591
|
-
let o =
|
|
2592
|
-
if (!o) return
|
|
2593
|
-
if (
|
|
2610
|
+
let o = Ln(null, Ln(null, e, "topics", null, 0), t, null, 0);
|
|
2611
|
+
if (!o) return Bt("jdb_update: topic not found: " + t), null;
|
|
2612
|
+
if (yn(r.id)) return Bt("jdb_update: record without id: " + r), Ht(r), null;
|
|
2594
2613
|
let i, l = n.split("`"), s = o;
|
|
2595
|
-
for (; (i = l.shift()) && !
|
|
2596
|
-
if (0 === l.length && s) if (
|
|
2614
|
+
for (; (i = l.shift()) && !yn(i) && s;) gn(s) && (s = Ln(null, s, e.hook, [], 1)), s = nr(s, null, i, !1);
|
|
2615
|
+
if (0 === l.length && s) if (dn(s)) s.push(r);
|
|
2597
2616
|
else if (s.id === r.id) Object.assign(s, r);
|
|
2598
2617
|
else {
|
|
2599
|
-
let t =
|
|
2618
|
+
let t = Ln(null, s, e.hook, [], 1), n = nr(t, e.hook, r.id, !1);
|
|
2600
2619
|
n ? Object.assign(n, r) : t.push(r);
|
|
2601
2620
|
}
|
|
2602
2621
|
return o;
|
|
2603
|
-
}, e.json_array_append =
|
|
2622
|
+
}, e.json_array_append = sn, e.json_array_append_new = _n, e.json_array_extend = function(e, t) {
|
|
2604
2623
|
return t ? (Array.prototype.push.apply(e, t), e) : e;
|
|
2605
|
-
}, e.json_array_remove =
|
|
2624
|
+
}, e.json_array_remove = an, e.json_array_size = cn, e.json_deep_copy = Qt, e.json_is_identical = Xt, e.json_object_del = rn, e.json_object_get = nn, e.json_object_set = on, e.json_object_set_new = ln, e.json_object_size = un, e.json_object_update = Zt, e.json_object_update_existing = en, e.json_object_update_missing = tn, e.json_size = fn, e.jwt2json = function(e, t) {
|
|
2606
2625
|
try {
|
|
2607
|
-
let n =
|
|
2626
|
+
let n = rr(e);
|
|
2608
2627
|
switch (t) {
|
|
2609
2628
|
case "header": return JSON.parse(n.header);
|
|
2610
2629
|
case "signature": return JSON.parse(n.signature);
|
|
@@ -2613,122 +2632,122 @@
|
|
|
2613
2632
|
} catch (e) {
|
|
2614
2633
|
return null;
|
|
2615
2634
|
}
|
|
2616
|
-
}, e.jwtDecode =
|
|
2617
|
-
if (e && !
|
|
2618
|
-
r || (r =
|
|
2635
|
+
}, e.jwtDecode = rr, e.kw_clone_by_keys = Vn, e.kw_clone_by_not_keys = Mn, e.kw_collect = function(e, t, n, r) {
|
|
2636
|
+
if (e && !hn(e) && Bt("GObj bad instanceof"), !t) return null;
|
|
2637
|
+
r || (r = Gn);
|
|
2619
2638
|
let o = [];
|
|
2620
|
-
if (
|
|
2639
|
+
if (dn(t)) for (let e = 0; e < t.length; e++) {
|
|
2621
2640
|
let i = t[e];
|
|
2622
2641
|
r(i, n) && o.push(i);
|
|
2623
2642
|
}
|
|
2624
2643
|
else {
|
|
2625
|
-
if (!
|
|
2644
|
+
if (!gn(t)) return Bt("kw_select() BAD kw parameter"), null;
|
|
2626
2645
|
r(t, n) && o.push(t);
|
|
2627
2646
|
}
|
|
2628
2647
|
return o;
|
|
2629
|
-
}, e.kw_delete =
|
|
2630
|
-
if (!n || !
|
|
2631
|
-
for (let e = 0; e < t.length; e++) if (
|
|
2632
|
-
return r &&
|
|
2633
|
-
}, e.kw_find_path =
|
|
2634
|
-
e && !
|
|
2635
|
-
let i =
|
|
2636
|
-
const l = o && o &
|
|
2648
|
+
}, e.kw_delete = Dn, e.kw_find_json_in_list = function(e, t, n, r) {
|
|
2649
|
+
if (!n || !dn(t)) return r && Bt("item NULL or kw_list is not a list"), -1;
|
|
2650
|
+
for (let e = 0; e < t.length; e++) if (Xt(n, t[e])) return e;
|
|
2651
|
+
return r && Bt("item not found in this list"), -1;
|
|
2652
|
+
}, e.kw_find_path = wn, e.kw_flag_t = Ct, e.kw_get_bool = An, e.kw_get_dict = Cn, e.kw_get_dict_value = Ln, e.kw_get_int = kn, e.kw_get_list = function(e, t, n, r, o) {
|
|
2653
|
+
e && !hn(e) && Bt("GObj bad instanceof");
|
|
2654
|
+
let i = wn(e, t, n, !1);
|
|
2655
|
+
const l = o && o & Ct.KW_REQUIRED, s = o && o & Ct.KW_CREATE, _ = o && o & Ct.KW_EXTRACT;
|
|
2637
2656
|
if (void 0 === i) {
|
|
2638
2657
|
if (s) {
|
|
2639
2658
|
let o = Array(r);
|
|
2640
|
-
return
|
|
2659
|
+
return Pn(e, t, n, o), o;
|
|
2641
2660
|
}
|
|
2642
|
-
return l && (
|
|
2661
|
+
return l && (Bt(`path not found: '${n}'`), zt(t)), Array(r);
|
|
2643
2662
|
}
|
|
2644
|
-
return _ &&
|
|
2645
|
-
}, e.kw_get_local_storage_value =
|
|
2646
|
-
e && !
|
|
2647
|
-
let i =
|
|
2648
|
-
const l = o && o &
|
|
2663
|
+
return _ && Dn(e, t, n), dn(i) ? Array(i) : (l && (Bt(`path value MUST BE an array: ${n}`), Ht(t)), Array(r));
|
|
2664
|
+
}, e.kw_get_local_storage_value = Wn, e.kw_get_pointer = $n, e.kw_get_real = function(e, t, n, r, o) {
|
|
2665
|
+
e && !hn(e) && Bt("GObj bad instanceof");
|
|
2666
|
+
let i = wn(e, t, n, !1);
|
|
2667
|
+
const l = o && o & Ct.KW_REQUIRED, s = o && o & Ct.KW_CREATE, _ = o && o & Ct.KW_EXTRACT;
|
|
2649
2668
|
if (void 0 === i) {
|
|
2650
2669
|
if (s) {
|
|
2651
2670
|
let o = Number(r);
|
|
2652
|
-
return
|
|
2671
|
+
return Pn(e, t, n, o), o;
|
|
2653
2672
|
}
|
|
2654
|
-
return l && (
|
|
2673
|
+
return l && (Bt(`path not found: '${n}'`), zt(t)), Number(r);
|
|
2655
2674
|
}
|
|
2656
|
-
return _ &&
|
|
2657
|
-
}, e.kw_get_str =
|
|
2658
|
-
if (e && !
|
|
2659
|
-
r || (r =
|
|
2675
|
+
return _ && Dn(e, t, n), pn(i) ? Number(i) : (l && (Bt(`path value MUST BE a number: ${n}`), Ht(t)), Number(r));
|
|
2676
|
+
}, e.kw_get_str = In, e.kw_has_key = Rn, e.kw_match_simple = Gn, e.kw_pop = Nn, e.kw_remove_local_storage_value = xn, e.kw_select = function(e, t, n, r) {
|
|
2677
|
+
if (e && !hn(e) && Bt("GObj bad instanceof"), !t) return null;
|
|
2678
|
+
r || (r = Gn);
|
|
2660
2679
|
let o = [];
|
|
2661
|
-
if (
|
|
2680
|
+
if (dn(t)) for (let e = 0; e < t.length; e++) {
|
|
2662
2681
|
let i = t[e];
|
|
2663
|
-
r(i, n) && o.push(
|
|
2682
|
+
r(i, n) && o.push(Qt(i));
|
|
2664
2683
|
}
|
|
2665
2684
|
else {
|
|
2666
|
-
if (!
|
|
2667
|
-
r(t, n) && o.push(
|
|
2685
|
+
if (!gn(t)) return Bt("kw_select() BAD kw parameter"), null;
|
|
2686
|
+
r(t, n) && o.push(Qt(t));
|
|
2668
2687
|
}
|
|
2669
2688
|
return o;
|
|
2670
|
-
}, e.kw_set_dict_value =
|
|
2671
|
-
e && !
|
|
2672
|
-
let i =
|
|
2689
|
+
}, e.kw_set_dict_value = Pn, e.kw_set_local_storage_value = Kn, e.kw_set_subdict_value = Un, e.kwid_collect = Bn, e.kwid_find_one_record = function(e, t, n, r, o) {
|
|
2690
|
+
e && !hn(e) && Bt("GObj bad instanceof");
|
|
2691
|
+
let i = Bn(e, t, n, r, o);
|
|
2673
2692
|
return i.length > 0 ? i[0] : null;
|
|
2674
2693
|
}, e.kwid_get_ids = function(e, t) {
|
|
2675
|
-
if (e && !
|
|
2694
|
+
if (e && !hn(e) && Bt("GObj bad instanceof"), !t) return [];
|
|
2676
2695
|
let n = [];
|
|
2677
|
-
if (
|
|
2678
|
-
else if (
|
|
2679
|
-
else
|
|
2680
|
-
if (
|
|
2681
|
-
else if (
|
|
2682
|
-
let r =
|
|
2696
|
+
if (bn(t)) n.push(t);
|
|
2697
|
+
else if (gn(t)) for (let e in t) t.hasOwnProperty(e) && n.push(e);
|
|
2698
|
+
else dn(t) && t.forEach(function(t) {
|
|
2699
|
+
if (bn(t)) yn(t) || n.push(t);
|
|
2700
|
+
else if (gn(t)) {
|
|
2701
|
+
let r = In(e, t, "id", 0, 0);
|
|
2683
2702
|
r && n.push(r);
|
|
2684
2703
|
}
|
|
2685
2704
|
});
|
|
2686
2705
|
return n;
|
|
2687
|
-
}, e.kwid_match_id =
|
|
2688
|
-
e && !
|
|
2706
|
+
}, e.kwid_match_id = Yn, e.kwid_new_dict = function(e, t, n) {
|
|
2707
|
+
e && !hn(e) && Bt("GObj bad instanceof");
|
|
2689
2708
|
let r = {};
|
|
2690
|
-
if (
|
|
2691
|
-
else if (
|
|
2692
|
-
let o = t[n], i =
|
|
2693
|
-
|
|
2709
|
+
if (yn(n) || (t = wn(e, t, n)), gn(t)) r = t;
|
|
2710
|
+
else if (dn(t)) for (let n = 0; n < t.length; n++) {
|
|
2711
|
+
let o = t[n], i = In(e, o, "id", "", 0);
|
|
2712
|
+
yn(i) || (r[i] = o);
|
|
2694
2713
|
}
|
|
2695
|
-
else
|
|
2714
|
+
else Bt(`${Ve(e)} kwid_new_dict: data type unknown`);
|
|
2696
2715
|
return r;
|
|
2697
2716
|
}, e.list2options = function(e, t, n) {
|
|
2698
2717
|
t = t || "id", n = n || "value";
|
|
2699
2718
|
let r = [];
|
|
2700
|
-
if (
|
|
2719
|
+
if (dn(e)) for (let o = 0; o < e.length; o++) {
|
|
2701
2720
|
let i = e[o];
|
|
2702
|
-
if (
|
|
2721
|
+
if (bn(i)) r.push({
|
|
2703
2722
|
id: e[o],
|
|
2704
2723
|
value: e[o]
|
|
2705
2724
|
});
|
|
2706
|
-
else if (
|
|
2725
|
+
else if (gn(i)) {
|
|
2707
2726
|
let e = {};
|
|
2708
|
-
if (
|
|
2709
|
-
if (!
|
|
2710
|
-
if (!(
|
|
2711
|
-
|
|
2727
|
+
if (Rn(i, t)) {
|
|
2728
|
+
if (!Rn(i, n)) {
|
|
2729
|
+
if (!(fn(i) > 0)) {
|
|
2730
|
+
Bt("list2options(): object without field value: " + n);
|
|
2712
2731
|
continue;
|
|
2713
2732
|
}
|
|
2714
2733
|
n = Object.keys(i)[0];
|
|
2715
2734
|
}
|
|
2716
2735
|
e.id = i[t], e.value = i[n];
|
|
2717
2736
|
} else {
|
|
2718
|
-
if (!(
|
|
2719
|
-
|
|
2737
|
+
if (!(fn(i) > 0)) {
|
|
2738
|
+
Bt("list2options(): object without field id: " + t);
|
|
2720
2739
|
continue;
|
|
2721
2740
|
}
|
|
2722
2741
|
t = Object.keys(i)[0], e.id = t, e.value = i[t];
|
|
2723
2742
|
}
|
|
2724
2743
|
r.push(e);
|
|
2725
|
-
} else
|
|
2744
|
+
} else Bt("list2options(): case1 not implemented");
|
|
2726
2745
|
}
|
|
2727
|
-
else if (
|
|
2746
|
+
else if (gn(e)) for (let t of Object.keys(e)) r.push({
|
|
2728
2747
|
id: t,
|
|
2729
2748
|
value: t
|
|
2730
2749
|
});
|
|
2731
|
-
else
|
|
2750
|
+
else Bt("list2options(): case2 not implemented");
|
|
2732
2751
|
return r;
|
|
2733
2752
|
}, e.load_json_file = function(e, t, n) {
|
|
2734
2753
|
let r = new XMLHttpRequest();
|
|
@@ -2736,18 +2755,18 @@
|
|
|
2736
2755
|
if (4 === r.readyState) if (200 === r.status || 0 === (e = r).status && e.responseText && e.responseURL.startsWith("file:")) try {
|
|
2737
2756
|
t(JSON.parse(r.responseText));
|
|
2738
2757
|
} catch (e) {
|
|
2739
|
-
n && (
|
|
2758
|
+
n && (Bt(`JSON parse status ${r.status}, error: ${e.message}`), n(r.status));
|
|
2740
2759
|
}
|
|
2741
2760
|
else n && n(r.status);
|
|
2742
2761
|
var e;
|
|
2743
2762
|
}, r.send();
|
|
2744
|
-
}, e.log_debug =
|
|
2745
|
-
let t =
|
|
2746
|
-
|
|
2747
|
-
}, e.log_warning =
|
|
2763
|
+
}, e.log_debug = qt, e.log_error = Bt, e.log_info = function(e) {
|
|
2764
|
+
let t = Yt(e), n = lr();
|
|
2765
|
+
Ft && Mt && Ft("%c" + n + " INFO: " + String(t), "color:cyan"), Kt("info", t, n);
|
|
2766
|
+
}, e.log_warning = Jt, e.msg_iev_get_msg_type = er, e.msg_iev_get_stack = Xn, e.msg_iev_push_stack = Qn, e.msg_iev_read_key = Hn, e.msg_iev_set_msg_type = Zn, e.msg_iev_write_key = zn, e.node_uuid = _r, e.parseBoolean = vn, e.parseSVG = function(e) {
|
|
2748
2767
|
return new DOMParser().parseFromString(e, "image/svg+xml").firstChild;
|
|
2749
2768
|
}, e.refresh_language = function(e, t) {
|
|
2750
|
-
|
|
2769
|
+
Tn(t) ? (e || (e = document), e.querySelectorAll("[data-i18n]").forEach(function(e) {
|
|
2751
2770
|
let n = e.getAttribute("data-i18n");
|
|
2752
2771
|
for (let r of e.childNodes) if (r.nodeType === Node.TEXT_NODE) {
|
|
2753
2772
|
n || (n = r.nodeValue), r.nodeValue = t(n);
|
|
@@ -2762,25 +2781,25 @@
|
|
|
2762
2781
|
}), e.querySelectorAll("[data-i18n-placeholder]").forEach(function(e) {
|
|
2763
2782
|
let n = e.getAttribute("data-i18n-placeholder");
|
|
2764
2783
|
n && e.setAttribute("placeholder", t(n));
|
|
2765
|
-
})) :
|
|
2784
|
+
})) : Bt("You must supply a translation function");
|
|
2766
2785
|
}, e.register_c_ievent_cli = function() {
|
|
2767
2786
|
return function(e) {
|
|
2768
|
-
if (
|
|
2787
|
+
if (Ir) return Bt(`GClass ALREADY created: ${e}`), -1;
|
|
2769
2788
|
const t = [
|
|
2770
2789
|
["ST_DISCONNECTED", [
|
|
2771
2790
|
[
|
|
2772
2791
|
"EV_ON_OPEN",
|
|
2773
|
-
|
|
2792
|
+
Wr,
|
|
2774
2793
|
"ST_WAIT_IDENTITY_CARD_ACK"
|
|
2775
2794
|
],
|
|
2776
2795
|
[
|
|
2777
2796
|
"EV_ON_CLOSE",
|
|
2778
|
-
|
|
2797
|
+
Kr,
|
|
2779
2798
|
null
|
|
2780
2799
|
],
|
|
2781
2800
|
[
|
|
2782
2801
|
"EV_TIMEOUT",
|
|
2783
|
-
|
|
2802
|
+
Mr,
|
|
2784
2803
|
null
|
|
2785
2804
|
],
|
|
2786
2805
|
[
|
|
@@ -2792,22 +2811,22 @@
|
|
|
2792
2811
|
["ST_WAIT_IDENTITY_CARD_ACK", [
|
|
2793
2812
|
[
|
|
2794
2813
|
"EV_ON_MESSAGE",
|
|
2795
|
-
|
|
2814
|
+
Br,
|
|
2796
2815
|
null
|
|
2797
2816
|
],
|
|
2798
2817
|
[
|
|
2799
2818
|
"EV_IDENTITY_CARD_ACK",
|
|
2800
|
-
|
|
2819
|
+
Yr,
|
|
2801
2820
|
null
|
|
2802
2821
|
],
|
|
2803
2822
|
[
|
|
2804
2823
|
"EV_ON_CLOSE",
|
|
2805
|
-
|
|
2824
|
+
Kr,
|
|
2806
2825
|
"ST_DISCONNECTED"
|
|
2807
2826
|
],
|
|
2808
2827
|
[
|
|
2809
2828
|
"EV_TIMEOUT",
|
|
2810
|
-
|
|
2829
|
+
xr,
|
|
2811
2830
|
null
|
|
2812
2831
|
],
|
|
2813
2832
|
[
|
|
@@ -2819,22 +2838,22 @@
|
|
|
2819
2838
|
["ST_SESSION", [
|
|
2820
2839
|
[
|
|
2821
2840
|
"EV_ON_MESSAGE",
|
|
2822
|
-
|
|
2841
|
+
Br,
|
|
2823
2842
|
null
|
|
2824
2843
|
],
|
|
2825
2844
|
[
|
|
2826
2845
|
"EV_MT_STATS",
|
|
2827
|
-
|
|
2846
|
+
Jr,
|
|
2828
2847
|
null
|
|
2829
2848
|
],
|
|
2830
2849
|
[
|
|
2831
2850
|
"EV_MT_COMMAND",
|
|
2832
|
-
|
|
2851
|
+
qr,
|
|
2833
2852
|
null
|
|
2834
2853
|
],
|
|
2835
2854
|
[
|
|
2836
2855
|
"EV_ON_CLOSE",
|
|
2837
|
-
|
|
2856
|
+
Kr,
|
|
2838
2857
|
"ST_DISCONNECTED"
|
|
2839
2858
|
],
|
|
2840
2859
|
[
|
|
@@ -2845,7 +2864,7 @@
|
|
|
2845
2864
|
]],
|
|
2846
2865
|
[null, null]
|
|
2847
2866
|
];
|
|
2848
|
-
return (
|
|
2867
|
+
return (Ir = te(e, [
|
|
2849
2868
|
["EV_ON_MESSAGE", D.EVF_OUTPUT_EVENT],
|
|
2850
2869
|
["EV_IDENTITY_CARD_ACK", D.EVF_PUBLIC_EVENT],
|
|
2851
2870
|
["EV_ON_ID_NAK", D.EVF_PUBLIC_EVENT | D.EVF_OUTPUT_EVENT],
|
|
@@ -2856,52 +2875,52 @@
|
|
|
2856
2875
|
["EV_ON_OPEN_ERROR", D.EVF_OUTPUT_EVENT | D.EVF_NO_WARN_SUBS],
|
|
2857
2876
|
["EV_TIMEOUT", 0],
|
|
2858
2877
|
[null, 0]
|
|
2859
|
-
], t,
|
|
2878
|
+
], t, Hr, 0, Ar, kr, 0, 0, 0, N.gcflag_no_check_output_events)) ? 0 : -1;
|
|
2860
2879
|
}("C_IEVENT_CLI");
|
|
2861
2880
|
}, e.register_c_timer = function() {
|
|
2862
2881
|
return function(e) {
|
|
2863
|
-
if (
|
|
2882
|
+
if (Er) return Bt(`GClass ALREADY created: ${e}`), -1;
|
|
2864
2883
|
const t = [["ST_IDLE", [[
|
|
2865
2884
|
"EV_TIMEOUT",
|
|
2866
|
-
|
|
2885
|
+
Tr,
|
|
2867
2886
|
null
|
|
2868
2887
|
]]]];
|
|
2869
|
-
return (
|
|
2888
|
+
return (Er = te(e, [
|
|
2870
2889
|
["EV_TIMEOUT", D.EVF_OUTPUT_EVENT],
|
|
2871
2890
|
["EV_TIMEOUT_PERIODIC", D.EVF_OUTPUT_EVENT],
|
|
2872
2891
|
[0, 0]
|
|
2873
|
-
], t,
|
|
2892
|
+
], t, hr, 0, pr, mr, 0, 0, 0, N.gcflag_manual_start)) ? 0 : -1;
|
|
2874
2893
|
}("C_TIMER");
|
|
2875
2894
|
}, e.register_c_yuno = function() {
|
|
2876
2895
|
return function(e) {
|
|
2877
|
-
if (
|
|
2896
|
+
if (Nr) return Bt(`GClass ALREADY created: ${e}`), -1;
|
|
2878
2897
|
const t = [["ST_IDLE", [[
|
|
2879
2898
|
"EV_TIMEOUT_PERIODIC",
|
|
2880
|
-
|
|
2899
|
+
Rr,
|
|
2881
2900
|
null
|
|
2882
2901
|
]]]];
|
|
2883
|
-
return (
|
|
2902
|
+
return (Nr = te(e, [["EV_TIMEOUT_PERIODIC", D.EVF_OUTPUT_EVENT | D.EVF_NO_WARN_SUBS], [0, 0]], t, wr, 0, Sr, Or, 0, 0, 0, 0)) ? 0 : -1;
|
|
2884
2903
|
}("C_YUNO");
|
|
2885
2904
|
}, e.safeSrc = function(e) {
|
|
2886
2905
|
if (!e) return "";
|
|
2887
2906
|
const t = String(e).trim();
|
|
2888
|
-
return /^javascript:/i.test(t) || /^data:/i.test(t) ? "" :
|
|
2907
|
+
return /^javascript:/i.test(t) || /^data:/i.test(t) ? "" : or(t);
|
|
2889
2908
|
}, e.sdata_flag_t = h, e.send_http_json_post = function(e, t, n) {
|
|
2890
2909
|
let r = new XMLHttpRequest();
|
|
2891
2910
|
r.open("POST", e), r.setRequestHeader("Accept", "application/json"), r.setRequestHeader("Content-Type", "application/json"), r.onreadystatechange = function() {
|
|
2892
2911
|
4 === r.readyState && n(r.status, r.responseText);
|
|
2893
2912
|
}, r.send(t);
|
|
2894
2913
|
}, e.set_console_log_enabled = function(e) {
|
|
2895
|
-
|
|
2914
|
+
Mt = !!e;
|
|
2896
2915
|
}, e.set_log_callback = function(e) {
|
|
2897
|
-
|
|
2898
|
-
}, e.set_remote_log_functions =
|
|
2916
|
+
Vt = "function" == typeof e ? e : null;
|
|
2917
|
+
}, e.set_remote_log_functions = xt, e.set_timeout = yr, e.set_timeout_periodic = vr, e.sprintf = n, e.stats_parser = function(e, t, n, r) {}, e.str_in_list = qn, e.strcasecmp = Sn, e.strcmp = jn, e.strncmp = function(e, t, n) {
|
|
2899
2918
|
var r = (e + "").substring(0, n), o = (t + "").substring(0, n);
|
|
2900
2919
|
return r === o ? 0 : r > o ? 1 : -1;
|
|
2901
2920
|
}, e.strs_in_list = function(e, t, n) {
|
|
2902
|
-
if (!e) return
|
|
2903
|
-
if (!t) return
|
|
2904
|
-
for (let r = 0; r < t.length; r++) if (
|
|
2921
|
+
if (!e) return Bt("ERROR: strs_in_list() list empty"), !1;
|
|
2922
|
+
if (!t) return Bt("ERROR: strs_in_list() str empty"), !1;
|
|
2923
|
+
for (let r = 0; r < t.length; r++) if (qn(e, t[r], n)) return !0;
|
|
2905
2924
|
return !1;
|
|
2906
2925
|
}, e.strstr = function(e, t, n) {
|
|
2907
2926
|
var r;
|
|
@@ -2920,13 +2939,13 @@
|
|
|
2920
2939
|
placeholder: void 0,
|
|
2921
2940
|
fkey: null
|
|
2922
2941
|
};
|
|
2923
|
-
if (
|
|
2942
|
+
if (bn(t)) {
|
|
2924
2943
|
let e = t.split(".");
|
|
2925
2944
|
for (let t = 0; t < e.length; t++) {
|
|
2926
2945
|
let r = e[t];
|
|
2927
|
-
if (
|
|
2928
|
-
else if (
|
|
2929
|
-
else if (
|
|
2946
|
+
if (qn(fr, r)) n.real_type || (n.real_type = r);
|
|
2947
|
+
else if (qn(dr, r)) n.type || (n.type = r);
|
|
2948
|
+
else if (qn(gr, r)) switch (r) {
|
|
2930
2949
|
case "writable":
|
|
2931
2950
|
n.is_writable = !0;
|
|
2932
2951
|
break;
|
|
@@ -2938,23 +2957,23 @@
|
|
|
2938
2957
|
}
|
|
2939
2958
|
}
|
|
2940
2959
|
n.real_type || (n.real_type = "string");
|
|
2941
|
-
} else
|
|
2960
|
+
} else gn(t) ? (n = br(t), n.name || (n.name = e), n.header || (n.header = e)) : dn(t) && (n.real_type = "array", n.enum_list = t);
|
|
2942
2961
|
return n.type || (n.type = n.real_type), n;
|
|
2943
2962
|
}, e.timeTracker = function(e = "Time Tracker", t = !1) {
|
|
2944
2963
|
const n = e, r = performance.now();
|
|
2945
2964
|
let o = r;
|
|
2946
|
-
return t &&
|
|
2965
|
+
return t && Jt(`--\x3e ${n} - starting`), { mark: (e = "Intermediate", i = "") => {
|
|
2947
2966
|
const l = performance.now(), s = (l - o) / 1e3, _ = (l - r) / 1e3;
|
|
2948
|
-
return t &&
|
|
2967
|
+
return t && Jt(`--\x3e ${n} ${e} - partial: ${s} sec, total: ${_} sec, ${i}`), o = l, {
|
|
2949
2968
|
partial: s,
|
|
2950
2969
|
total: _
|
|
2951
2970
|
};
|
|
2952
2971
|
} };
|
|
2953
|
-
}, e.trace_json =
|
|
2954
|
-
if (
|
|
2972
|
+
}, e.trace_json = zt, e.trace_level_t = P, e.trace_msg = Ht, e.treedb_decoder_fkey = cr, e.treedb_decoder_hook = function(e, t) {
|
|
2973
|
+
if (bn(t)) {
|
|
2955
2974
|
if (-1 === t.indexOf("^")) {
|
|
2956
2975
|
let n, r = e.hook;
|
|
2957
|
-
if (1 !==
|
|
2976
|
+
if (1 !== un(r)) return Bt("bad hook 1"), Bt(e), Bt(t), null;
|
|
2958
2977
|
for (let e of Object.keys(r)) {
|
|
2959
2978
|
n = e, r[e];
|
|
2960
2979
|
break;
|
|
@@ -2966,25 +2985,25 @@
|
|
|
2966
2985
|
}
|
|
2967
2986
|
{
|
|
2968
2987
|
let n = t.split("^");
|
|
2969
|
-
return 2 !== n.length ? (
|
|
2988
|
+
return 2 !== n.length ? (Bt("bad hook 2"), Bt(e), Bt(t), null) : {
|
|
2970
2989
|
topic_name: n[0],
|
|
2971
2990
|
id: n[1]
|
|
2972
2991
|
};
|
|
2973
2992
|
}
|
|
2974
2993
|
}
|
|
2975
|
-
return
|
|
2994
|
+
return gn(t) ? {
|
|
2976
2995
|
topic_name: t.topic_name,
|
|
2977
2996
|
id: t.id
|
|
2978
|
-
} : (
|
|
2997
|
+
} : (Bt("bad hook 3"), Bt(e), Bt(t), null);
|
|
2979
2998
|
}, e.treedb_encoder_fkey = function(e, t) {
|
|
2980
|
-
let n =
|
|
2999
|
+
let n = cr(e, t);
|
|
2981
3000
|
return n ? n.topic_name + "^" + n.id + "^" + n.hook_name : null;
|
|
2982
|
-
}, e.treedb_get_field_desc =
|
|
2983
|
-
if (
|
|
3001
|
+
}, e.treedb_get_field_desc = br, e.treedb_hook_data_size = function(e) {
|
|
3002
|
+
if (dn(e) && 1 === fn(e)) {
|
|
2984
3003
|
let t = e[0];
|
|
2985
|
-
return
|
|
3004
|
+
return Rn(t, "size") ? t.size : 1;
|
|
2986
3005
|
}
|
|
2987
|
-
return
|
|
3006
|
+
return fn(e);
|
|
2988
3007
|
}, e.vsprintf = function(e, t) {
|
|
2989
3008
|
return n.apply(null, [e].concat(t || []));
|
|
2990
3009
|
};
|