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