@yuneta/gobj-js 7.25.1 → 7.25.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -0
- package/dist/gobj-js.cjs.js +56 -27
- package/dist/gobj-js.cjs.js.map +1 -1
- package/dist/gobj-js.cjs.min.js +140 -146
- package/dist/gobj-js.cjs.min.js.map +1 -1
- package/dist/gobj-js.es.js +56 -27
- package/dist/gobj-js.es.js.map +1 -1
- package/dist/gobj-js.es.min.js +276 -282
- package/dist/gobj-js.es.min.js.map +1 -1
- package/dist/gobj-js.iife.js +56 -27
- package/dist/gobj-js.iife.js.map +1 -1
- package/dist/gobj-js.iife.min.js +216 -222
- package/dist/gobj-js.iife.min.js.map +1 -1
- package/dist/gobj-js.umd.js +56 -27
- package/dist/gobj-js.umd.js.map +1 -1
- package/dist/gobj-js.umd.min.js +313 -319
- package/dist/gobj-js.umd.min.js.map +1 -1
- package/package.json +1 -1
package/dist/gobj-js.umd.min.js
CHANGED
|
@@ -144,7 +144,7 @@
|
|
|
144
144
|
DTP_POINTER: 8
|
|
145
145
|
});
|
|
146
146
|
E.DTP_POINTER;
|
|
147
|
-
var
|
|
147
|
+
var T = Object.freeze({
|
|
148
148
|
SDF_NOTACCESS: 1,
|
|
149
149
|
SDF_RD: 2,
|
|
150
150
|
SDF_WR: 4,
|
|
@@ -167,12 +167,12 @@
|
|
|
167
167
|
SDF_AUTHZ_S: 524288,
|
|
168
168
|
SDF_AUTHZ_RS: 1048576
|
|
169
169
|
});
|
|
170
|
-
|
|
171
|
-
var
|
|
170
|
+
T.SDF_RD, T.SDF_WR, T.SDF_STATS, T.SDF_PERSIST, T.SDF_VOLATIL, T.SDF_RSTATS, T.SDF_PSTATS, T.SDF_WR, T.SDF_PERSIST;
|
|
171
|
+
var y = class {
|
|
172
172
|
constructor(e, t, n = 0, r = null, l = "", o = null, s = null, i = 0, _ = null, a = null, u = null) {
|
|
173
173
|
this.type = e, this.name = t, this.alias = o, this.flag = n, this.default_value = r, this.header = s, this.fillspace = i, this.description = l, this.json_fn = _, this.schema = a, this.authpth = u;
|
|
174
174
|
}
|
|
175
|
-
}, v = () => new
|
|
175
|
+
}, v = () => new y(0, null), j = (e, t, n, r, l) => new y(e, t, n, r, l), S = class {
|
|
176
176
|
constructor(e, t, n, r, l, o, s, i, _) {
|
|
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 = s, this.s_user_trace_level = i, this.gclass_flag = Number(_) || 0, this.instances = 0, this.trace_level = 0, this.no_trace_level = 0, this.jn_trace_filter = null, this.fsm_checked = !1;
|
|
178
178
|
}
|
|
@@ -180,13 +180,13 @@
|
|
|
180
180
|
constructor(e, t, n, r, l) {
|
|
181
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 = En(t.priv), this.running = !1, this.playing = !1, this.disabled = !1, this.bottom_gobj = null, this.trace_level = 0, this.no_trace_level = 0;
|
|
182
182
|
}
|
|
183
|
-
},
|
|
183
|
+
}, N = Object.freeze({
|
|
184
184
|
gcflag_manual_start: 1,
|
|
185
185
|
gcflag_no_check_output_events: 2,
|
|
186
186
|
gcflag_ignore_unknown_attrs: 4,
|
|
187
187
|
gcflag_required_start_to_play: 8,
|
|
188
188
|
gcflag_singleton: 16
|
|
189
|
-
}),
|
|
189
|
+
}), w = Object.freeze({
|
|
190
190
|
gobj_flag_yuno: 1,
|
|
191
191
|
gobj_flag_default_service: 2,
|
|
192
192
|
gobj_flag_service: 4,
|
|
@@ -223,10 +223,10 @@
|
|
|
223
223
|
}
|
|
224
224
|
};
|
|
225
225
|
var C = 1;
|
|
226
|
-
function
|
|
226
|
+
function L(e) {
|
|
227
227
|
Cn(e) && (e = JSON.stringify(e)), pn(" ".repeat(Math.max(1, 2 * h)) + String(e));
|
|
228
228
|
}
|
|
229
|
-
var
|
|
229
|
+
var P = Object.freeze({
|
|
230
230
|
TRACE_MACHINE: 65536,
|
|
231
231
|
TRACE_CREATE_DELETE: 131072,
|
|
232
232
|
TRACE_CREATE_DELETE2: 262144,
|
|
@@ -245,77 +245,77 @@
|
|
|
245
245
|
}), U = [
|
|
246
246
|
[
|
|
247
247
|
"machine",
|
|
248
|
-
|
|
248
|
+
P.TRACE_MACHINE,
|
|
249
249
|
"Trace machine"
|
|
250
250
|
],
|
|
251
251
|
[
|
|
252
252
|
"create_delete",
|
|
253
|
-
|
|
253
|
+
P.TRACE_CREATE_DELETE,
|
|
254
254
|
"Trace create/delete of gobjs"
|
|
255
255
|
],
|
|
256
256
|
[
|
|
257
257
|
"create_delete2",
|
|
258
|
-
|
|
258
|
+
P.TRACE_CREATE_DELETE2,
|
|
259
259
|
"Trace create/delete of gobjs level 2: with kw"
|
|
260
260
|
],
|
|
261
261
|
[
|
|
262
262
|
"subscriptions",
|
|
263
|
-
|
|
263
|
+
P.TRACE_SUBSCRIPTIONS,
|
|
264
264
|
"Trace subscriptions of gobjs"
|
|
265
265
|
],
|
|
266
266
|
[
|
|
267
267
|
"start_stop",
|
|
268
|
-
|
|
268
|
+
P.TRACE_START_STOP,
|
|
269
269
|
"Trace start/stop of gobjs"
|
|
270
270
|
],
|
|
271
271
|
[
|
|
272
272
|
"ev_kw",
|
|
273
|
-
|
|
273
|
+
P.TRACE_EV_KW,
|
|
274
274
|
"Trace event keywords"
|
|
275
275
|
],
|
|
276
276
|
[
|
|
277
277
|
"authzs",
|
|
278
|
-
|
|
278
|
+
P.TRACE_AUTHZS,
|
|
279
279
|
"Trace authorizations"
|
|
280
280
|
],
|
|
281
281
|
[
|
|
282
282
|
"states",
|
|
283
|
-
|
|
283
|
+
P.TRACE_STATES,
|
|
284
284
|
"Trace change of states"
|
|
285
285
|
],
|
|
286
286
|
[
|
|
287
287
|
"gbuffers",
|
|
288
|
-
|
|
288
|
+
P.TRACE_GBUFFERS,
|
|
289
289
|
"Trace gbuffers"
|
|
290
290
|
],
|
|
291
291
|
[
|
|
292
292
|
"timer",
|
|
293
|
-
|
|
293
|
+
P.TRACE_TIMER,
|
|
294
294
|
"Trace timers"
|
|
295
295
|
],
|
|
296
296
|
[
|
|
297
297
|
"fs",
|
|
298
|
-
|
|
298
|
+
P.TRACE_FS,
|
|
299
299
|
"Trace file system"
|
|
300
300
|
],
|
|
301
301
|
[
|
|
302
302
|
"liburing",
|
|
303
|
-
|
|
303
|
+
P.TRACE_URING,
|
|
304
304
|
"Trace liburing mixins"
|
|
305
305
|
],
|
|
306
306
|
[
|
|
307
307
|
"timer_periodic",
|
|
308
|
-
|
|
308
|
+
P.TRACE_TIMER_PERIODIC,
|
|
309
309
|
"Trace periodic timers"
|
|
310
310
|
],
|
|
311
311
|
[
|
|
312
312
|
"liburing_timer",
|
|
313
|
-
|
|
313
|
+
P.TRACE_URING_TIME,
|
|
314
314
|
"Trace liburing timer"
|
|
315
315
|
],
|
|
316
316
|
[
|
|
317
317
|
"commands",
|
|
318
|
-
|
|
318
|
+
P.TRACE_COMMANDS,
|
|
319
319
|
"Trace commands"
|
|
320
320
|
]
|
|
321
321
|
], F = 0, G = 0, V = 0;
|
|
@@ -339,38 +339,38 @@
|
|
|
339
339
|
return 0;
|
|
340
340
|
}(String(e), n) || (dn(`${t}: trace level NOT FOUND: ${e}`), 0);
|
|
341
341
|
}
|
|
342
|
-
function
|
|
342
|
+
function K(e) {
|
|
343
343
|
if (V) return 4294967295;
|
|
344
344
|
let t = F;
|
|
345
345
|
return e && (t |= e.trace_level || 0, e.gclass && (t |= e.gclass.trace_level || 0)), t;
|
|
346
346
|
}
|
|
347
|
-
function
|
|
347
|
+
function x(e) {
|
|
348
348
|
let t = G;
|
|
349
349
|
return e && (t |= e.no_trace_level || 0, e.gclass && (t |= e.gclass.no_trace_level || 0)), t;
|
|
350
350
|
}
|
|
351
351
|
function Y(e) {
|
|
352
|
-
return
|
|
352
|
+
return K(e) & P.TRACE_CREATE_DELETE;
|
|
353
353
|
}
|
|
354
354
|
function B(e) {
|
|
355
|
-
return
|
|
355
|
+
return K(e) & P.TRACE_SUBSCRIPTIONS;
|
|
356
356
|
}
|
|
357
357
|
function J(e) {
|
|
358
|
-
return
|
|
358
|
+
return K(e) & P.TRACE_START_STOP;
|
|
359
359
|
}
|
|
360
360
|
function H(e) {
|
|
361
|
-
return
|
|
361
|
+
return K(e) & P.TRACE_EV_KW;
|
|
362
362
|
}
|
|
363
363
|
function q(e, t) {
|
|
364
364
|
if (V > 1) return !0;
|
|
365
365
|
if (!e) return !1;
|
|
366
|
-
const n =
|
|
367
|
-
return !!(n &
|
|
366
|
+
const n = K(e);
|
|
367
|
+
return !!(n & P.TRACE_MACHINE || n & P.TRACE_TIMER_PERIODIC && "EV_TIMEOUT_PERIODIC" === t || n & P.TRACE_TIMER && "EV_TIMEOUT" === t);
|
|
368
368
|
}
|
|
369
369
|
function z(e, t) {
|
|
370
370
|
if (V > 1) return !1;
|
|
371
371
|
if (!e) return !0;
|
|
372
|
-
const n =
|
|
373
|
-
return !!(n &
|
|
372
|
+
const n = x(e);
|
|
373
|
+
return !!(n & P.TRACE_MACHINE || n & P.TRACE_TIMER_PERIODIC && "EV_TIMEOUT_PERIODIC" === t || n & P.TRACE_TIMER && "EV_TIMEOUT" === t);
|
|
374
374
|
}
|
|
375
375
|
function Q(e, t) {
|
|
376
376
|
const n = W(e, "gobj_set_global_trace");
|
|
@@ -393,32 +393,32 @@
|
|
|
393
393
|
return M(G, null);
|
|
394
394
|
}
|
|
395
395
|
function re(e) {
|
|
396
|
-
const t =
|
|
396
|
+
const t = Pn(e) ? Se(e) : e;
|
|
397
397
|
return t ? M(t.trace_level | F, t.s_user_trace_level) : (dn(`gobj_get_gclass_trace_level: gclass NOT FOUND: ${e}`), []);
|
|
398
398
|
}
|
|
399
399
|
function le(e) {
|
|
400
|
-
const t =
|
|
400
|
+
const t = Pn(e) ? Se(e) : e;
|
|
401
401
|
return t ? M(t.trace_level, t.s_user_trace_level) : (dn(`gobj_get_gclass_trace_level2: gclass NOT FOUND: ${e}`), []);
|
|
402
402
|
}
|
|
403
403
|
function oe(e) {
|
|
404
|
-
const t =
|
|
404
|
+
const t = Pn(e) ? Se(e) : e;
|
|
405
405
|
return t ? M(t.no_trace_level, t.s_user_trace_level) : (dn(`gobj_get_gclass_trace_no_level: gclass NOT FOUND: ${e}`), []);
|
|
406
406
|
}
|
|
407
407
|
function se(e, t, n) {
|
|
408
|
-
const r =
|
|
408
|
+
const r = Pn(e) ? Se(e) : e;
|
|
409
409
|
if (!r) return dn(`gobj_set_gclass_trace: gclass NOT FOUND: ${e}`), -1;
|
|
410
410
|
const l = null === t ? 4294967295 : W(t, "gobj_set_gclass_trace", r.s_user_trace_level || null);
|
|
411
411
|
return l ? (n ? r.trace_level |= l : r.trace_level &= ~l, 0) : -1;
|
|
412
412
|
}
|
|
413
413
|
function ie(e, t, n) {
|
|
414
|
-
const r =
|
|
414
|
+
const r = Pn(e) ? Se(e) : e;
|
|
415
415
|
if (!r) return dn(`gobj_set_gclass_no_trace: gclass NOT FOUND: ${e}`), -1;
|
|
416
416
|
const l = null === t ? 4294967295 : W(t, "gobj_set_gclass_no_trace", r.s_user_trace_level || null);
|
|
417
417
|
return l ? (n ? r.no_trace_level |= l : r.no_trace_level &= ~l, 0) : -1;
|
|
418
418
|
}
|
|
419
419
|
function _e(e, t) {
|
|
420
420
|
let n = {};
|
|
421
|
-
if (!
|
|
421
|
+
if (!Ln(t)) return dn("sdata_desc MUST be an array"), hn(t), n;
|
|
422
422
|
for (let r = 0; r < t.length; r++) {
|
|
423
423
|
const l = t[r];
|
|
424
424
|
l.name && ae(e, n, l);
|
|
@@ -432,7 +432,7 @@
|
|
|
432
432
|
r = String(l);
|
|
433
433
|
break;
|
|
434
434
|
case E.DTP_BOOLEAN:
|
|
435
|
-
r =
|
|
435
|
+
r = Kn(l);
|
|
436
436
|
break;
|
|
437
437
|
case E.DTP_INTEGER:
|
|
438
438
|
r = parseInt(l), isNaN(r) && dn(`${et(e)}: attr NaN: ${n.name}`);
|
|
@@ -441,16 +441,16 @@
|
|
|
441
441
|
r = Number(l), isNaN(r) && dn(`${et(e)}: attr NaN: ${n.name}`);
|
|
442
442
|
break;
|
|
443
443
|
case E.DTP_LIST:
|
|
444
|
-
if (
|
|
444
|
+
if (Pn(l)) try {
|
|
445
445
|
r = JSON.parse(l);
|
|
446
446
|
} catch (e) {
|
|
447
447
|
dn(`JSON parse error: ${e.message}`);
|
|
448
448
|
}
|
|
449
449
|
else r = l;
|
|
450
|
-
|
|
450
|
+
Ln(r) || (r = []);
|
|
451
451
|
break;
|
|
452
452
|
case E.DTP_DICT:
|
|
453
|
-
if (
|
|
453
|
+
if (Pn(l)) try {
|
|
454
454
|
r = JSON.parse(l);
|
|
455
455
|
} catch (e) {
|
|
456
456
|
dn(`JSON parse error: ${e.message}`);
|
|
@@ -459,7 +459,7 @@
|
|
|
459
459
|
Cn(r) || (r = {});
|
|
460
460
|
break;
|
|
461
461
|
case E.DTP_JSON:
|
|
462
|
-
if (
|
|
462
|
+
if (Pn(l)) try {
|
|
463
463
|
r = JSON.parse(l);
|
|
464
464
|
} catch (e) {
|
|
465
465
|
dn(`JSON parse error: ${e.message}`);
|
|
@@ -475,14 +475,14 @@
|
|
|
475
475
|
switch (n.type) {
|
|
476
476
|
case E.DTP_STRING:
|
|
477
477
|
if (null == r) l = "";
|
|
478
|
-
else if (
|
|
478
|
+
else if (Pn(r)) l = String(r);
|
|
479
479
|
else {
|
|
480
480
|
let e = JSON.stringify(r);
|
|
481
481
|
e && (l = String(e));
|
|
482
482
|
}
|
|
483
483
|
break;
|
|
484
484
|
case E.DTP_BOOLEAN:
|
|
485
|
-
l =
|
|
485
|
+
l = Kn(r);
|
|
486
486
|
break;
|
|
487
487
|
case E.DTP_INTEGER:
|
|
488
488
|
l = parseInt(r), isNaN(l) && dn(`${et(e)}: attr NaN: ${n.name}`);
|
|
@@ -491,16 +491,16 @@
|
|
|
491
491
|
l = Number(r), isNaN(l) && dn(`${et(e)}: attr NaN: ${n.name}`);
|
|
492
492
|
break;
|
|
493
493
|
case E.DTP_LIST:
|
|
494
|
-
if (
|
|
494
|
+
if (Pn(r)) try {
|
|
495
495
|
l = JSON.parse(r);
|
|
496
496
|
} catch (e) {
|
|
497
497
|
dn(`JSON parse error: ${e.message}`);
|
|
498
498
|
}
|
|
499
499
|
else l = r;
|
|
500
|
-
if (!
|
|
500
|
+
if (!Ln(l)) return dn(`attr must be an array: ${n.name}`), -1;
|
|
501
501
|
break;
|
|
502
502
|
case E.DTP_DICT:
|
|
503
|
-
if (
|
|
503
|
+
if (Pn(r)) try {
|
|
504
504
|
l = JSON.parse(r);
|
|
505
505
|
} catch (e) {
|
|
506
506
|
dn(`JSON parse error: ${e.message}`);
|
|
@@ -509,13 +509,13 @@
|
|
|
509
509
|
if (!Cn(l)) return dn(`attr must be an object: ${n.name}`), -1;
|
|
510
510
|
break;
|
|
511
511
|
case E.DTP_JSON:
|
|
512
|
-
if (
|
|
512
|
+
if (Pn(r)) try {
|
|
513
513
|
l = JSON.parse(r);
|
|
514
514
|
} catch (e) {
|
|
515
515
|
dn(`JSON parse error: ${e.message}`);
|
|
516
516
|
}
|
|
517
517
|
else l = r;
|
|
518
|
-
if (!
|
|
518
|
+
if (!Ln(l) && !Cn(l)) return dn(`attr must be a json dict/list: ${n.name}`), -1;
|
|
519
519
|
break;
|
|
520
520
|
case E.DTP_POINTER: l = r;
|
|
521
521
|
}
|
|
@@ -559,7 +559,7 @@
|
|
|
559
559
|
let n = t[e][0], r = t[e][1];
|
|
560
560
|
if (!Wn(n)) {
|
|
561
561
|
if (ve(c, n)) return dn(`SMachine: event repeated in input_events: ${n}`), be(c), null;
|
|
562
|
-
|
|
562
|
+
ye(c, n, r);
|
|
563
563
|
}
|
|
564
564
|
}
|
|
565
565
|
if (!c.fsm_checked) {
|
|
@@ -570,7 +570,7 @@
|
|
|
570
570
|
}
|
|
571
571
|
function be(e) {
|
|
572
572
|
let t;
|
|
573
|
-
if (
|
|
573
|
+
if (Pn(e)) t = e;
|
|
574
574
|
else {
|
|
575
575
|
if (!(e instanceof S)) return dn("Cannot unregister gclass, type unknown"), -1;
|
|
576
576
|
t = e.gclass_name;
|
|
@@ -603,11 +603,11 @@
|
|
|
603
603
|
let o = pe(e, t);
|
|
604
604
|
return o ? me(o, n) ? (dn(`event already exists: gclass ${e.gclass_name}, state ${t}, event ${n}`), -1) : (o.dl_actions.push(new k(n, r, l)), 0) : (dn(`state not found: ${t}`), -1);
|
|
605
605
|
}
|
|
606
|
-
function
|
|
606
|
+
function Te(e, t, n) {
|
|
607
607
|
Wn(t) || e.push(new I(t, n));
|
|
608
608
|
}
|
|
609
|
-
function
|
|
610
|
-
return e instanceof S ?
|
|
609
|
+
function ye(e, t, n) {
|
|
610
|
+
return e instanceof S ? Te(e.dl_events, t, n) : (dn("Cannot add state, typeof not GClass"), -1);
|
|
611
611
|
}
|
|
612
612
|
function ve(e, t) {
|
|
613
613
|
if (!(e instanceof S)) return dn("Cannot add state, typeof not GClass"), 0;
|
|
@@ -652,11 +652,11 @@
|
|
|
652
652
|
function Oe() {
|
|
653
653
|
return !m || m.obflag & R.obflag_destroyed ? null : m;
|
|
654
654
|
}
|
|
655
|
-
function
|
|
655
|
+
function Ne(e, t) {
|
|
656
656
|
e = e.toLowerCase();
|
|
657
657
|
return b[e] || (t && dn(`gobj service not found: ${e}`), null);
|
|
658
658
|
}
|
|
659
|
-
function
|
|
659
|
+
function we(e) {
|
|
660
660
|
let t = Xe(e);
|
|
661
661
|
return t = t.toLowerCase(), b[t] && dn(`service ALREADY REGISTERED: ${t}. Will be UPDATED`), b[t] = e, 0;
|
|
662
662
|
}
|
|
@@ -680,29 +680,29 @@
|
|
|
680
680
|
let o = 0;
|
|
681
681
|
for (const [s, i] of Object.entries(t)) {
|
|
682
682
|
const t = ge(l.gclass, s, !1);
|
|
683
|
-
t ? (-1 === n || t.flag & n) && (t.flag &
|
|
683
|
+
t ? (-1 === n || t.flag & n) && (t.flag & T.SDF_DEPRECATED && bn(`${et(l)}: Deprecated attribute used in gobj creation: ${s}`), o += ue(l, e, t, i)) : r && (r(l, s), o--);
|
|
684
684
|
}
|
|
685
685
|
return o;
|
|
686
|
-
})(ce(e), r, -1, e.gclass.gclass_flag &
|
|
686
|
+
})(ce(e), r, -1, e.gclass.gclass_flag & N.gcflag_ignore_unknown_attrs ? 0 : ke, e) < 0 && (dn(`${et(e)} json2data() FAILED`), hn(r));
|
|
687
687
|
}
|
|
688
688
|
function Ie(e, t, r, l, o) {
|
|
689
|
-
if (o &
|
|
689
|
+
if (o & w.gobj_flag_yuno) {
|
|
690
690
|
if (p) return dn("__yuno__ already created"), null;
|
|
691
|
-
o |=
|
|
691
|
+
o |= w.gobj_flag_service;
|
|
692
692
|
} else {
|
|
693
693
|
if (!l) return dn("gobj NEEDS a parent!"), null;
|
|
694
694
|
if (!("string" == typeof l || l instanceof O)) return dn(`BAD TYPE of parent: ${l}`), null;
|
|
695
|
-
if (
|
|
695
|
+
if (Pn(l) && !(l = Ne(l))) return bn(`parent service not found: ${l}`), null;
|
|
696
696
|
}
|
|
697
|
-
if (o &
|
|
698
|
-
if (o &
|
|
697
|
+
if (o & w.gobj_flag_service && Ne(e, !1)) return dn(`service ALREADY registered: ${t}^${e}`), null;
|
|
698
|
+
if (o & w.gobj_flag_default_service) {
|
|
699
699
|
if (m) return dn(`default service ALREADY registered: ${t}^${e}`), null;
|
|
700
|
-
o |=
|
|
700
|
+
o |= w.gobj_flag_service;
|
|
701
701
|
}
|
|
702
702
|
if (Wn(t)) return dn("gclass_name must be a string"), null;
|
|
703
703
|
let s = Se(t, !1);
|
|
704
704
|
if (!s) return dn(`GClass not registered: ${t}^${e}`), null;
|
|
705
|
-
if (!
|
|
705
|
+
if (!Pn(e)) return dn(`gobj_name must be a string: ${t}`), null;
|
|
706
706
|
if (!Wn(e)) {
|
|
707
707
|
if (e.includes("`")) return dn(`gobj_name cannot contain char ': ${t}^${e}`), null;
|
|
708
708
|
if (e.includes("^")) return dn(`gobj_name cannot contain char ^: ${t}^${e}`), null;
|
|
@@ -711,55 +711,55 @@
|
|
|
711
711
|
_.jn_attrs = _e(_, s.attrs_table);
|
|
712
712
|
for (const [e, t] of Object.entries(_.jn_attrs)) e in _.priv && (_.priv[e] = t);
|
|
713
713
|
let a = Y(_);
|
|
714
|
-
return a &&
|
|
714
|
+
return a && L(n("💙💙⏩ creating: %s^%s", s.gclass_name, e)), _.gobj_flag & w.gobj_flag_service && we(_), _.gobj_flag & w.gobj_flag_yuno && (p = _), _.gobj_flag & w.gobj_flag_default_service && (m = _), _.gobj_flag & w.gobj_flag_yuno || Re(l, _), _.obflag |= R.obflag_created, _.gclass.instances++, $e(_, r), _.gobj_flag & w.gobj_flag_service && i && i(_, null), _.gclass.gmt.mt_create2 ? _.gclass.gmt.mt_create2(_, r) : _.gclass.gmt.mt_create && _.gclass.gmt.mt_create(_), l && l.gclass.gmt.mt_child_added && (a && L(n("👦👦🔵 child_added(%s): %s", tt(l), et(_))), l.gclass.gmt.mt_child_added(l, _)), a && L(n("💙💙⏪ created: %s", tt(_))), _;
|
|
715
715
|
}
|
|
716
716
|
function Ce(e, t, n, r) {
|
|
717
|
-
return Ie(e, t, n, r,
|
|
717
|
+
return Ie(e, t, n, r, w.gobj_flag_pure_child);
|
|
718
718
|
}
|
|
719
|
-
function
|
|
719
|
+
function Le(e) {
|
|
720
720
|
if (ot(e)) return void dn("gobj NULL or DESTROYED");
|
|
721
|
-
e.__refs__ > 0 && dn(`${et(e)}: gobj DESTROYING with references: ${e.__refs__}`), e.playing && (dn(`Destroying a PLAYING gobj: ${tt(e)}`),
|
|
722
|
-
if (0 ===
|
|
723
|
-
for (let t of
|
|
724
|
-
|
|
721
|
+
e.__refs__ > 0 && dn(`${et(e)}: gobj DESTROYING with references: ${e.__refs__}`), e.playing && (dn(`Destroying a PLAYING gobj: ${tt(e)}`), Ke(e)), e.running && (dn(`Destroying a RUNNING gobj: ${tt(e)}`), Ge(e)), e.obflag |= R.obflag_destroying, function(e) {
|
|
722
|
+
if (0 === Lt.length) return;
|
|
723
|
+
for (let t of Lt) t.src === e && (t.src = null);
|
|
724
|
+
Lt = Lt.filter((t) => t.dst !== e);
|
|
725
725
|
}(e);
|
|
726
726
|
let t = Y(e);
|
|
727
|
-
t &&
|
|
727
|
+
t && L(n("💔💔⏩ destroying: %s", tt(e)));
|
|
728
728
|
let r = nt(e);
|
|
729
|
-
r && r.gclass.gmt.mt_child_removed && (t &&
|
|
729
|
+
r && r.gclass.gmt.mt_child_removed && (t && L(n("👦👦🔴 child_removed(%s): %s", tt(r), et(e))), r.gclass.gmt.mt_child_removed(r, e)), e.gobj_flag & w.gobj_flag_service && function(e) {
|
|
730
730
|
let t = Xe(e);
|
|
731
731
|
t = t.toLowerCase(), b[t] ? delete b[t] : dn(`"service NOT found in register": ${t}`);
|
|
732
732
|
}(e), Bt(e, e.dl_subscriptions, !0), Bt(e, e.dl_subscribings, !0), r && (De(r, e), rt(e) && (st(r) !== e || ot(r) || it(r, null))), function(e) {
|
|
733
733
|
let t = e.dl_children.slice();
|
|
734
734
|
for (let e = 0; e < t.length; e++) {
|
|
735
735
|
let n = t[e];
|
|
736
|
-
ot(n) ||
|
|
736
|
+
ot(n) || Le(n);
|
|
737
737
|
}
|
|
738
|
-
}(e), e.obflag & R.obflag_created && e.gclass.gmt.mt_destroy && e.gclass.gmt.mt_destroy(e), t &&
|
|
738
|
+
}(e), e.obflag & R.obflag_created && e.gclass.gmt.mt_destroy && e.gclass.gmt.mt_destroy(e), t && L(n("💔💔⏪ destroyed: %s", tt(e))), e.obflag |= R.obflag_destroyed, e.obflag & R.obflag_created && e.gclass.instances--;
|
|
739
739
|
}
|
|
740
|
-
function
|
|
740
|
+
function Pe(e) {
|
|
741
741
|
if (ot(e)) return dn("gobj NULL or DESTROYED"), -1;
|
|
742
742
|
if (e.running) return dn(`${et(e)}: GObj ALREADY RUNNING`), -1;
|
|
743
743
|
if (e.disabled) return dn(`${et(e)}: GObj DISABLED`), -1;
|
|
744
|
-
J(e) &&
|
|
744
|
+
J(e) && L(n("⏺ ⏺ start: %s", tt(e))), e.running = !0;
|
|
745
745
|
let t = 0;
|
|
746
746
|
return e.gclass.gmt.mt_start && (t = e.gclass.gmt.mt_start(e)), t;
|
|
747
747
|
}
|
|
748
748
|
function Ue(e, t, n) {
|
|
749
|
-
return e.gclass.gclass_flag &
|
|
749
|
+
return e.gclass.gclass_flag & N.gcflag_manual_start || ot(e) || xe(e) || Ye(e) || Pe(e), 0;
|
|
750
750
|
}
|
|
751
751
|
function Fe(e, t, n) {
|
|
752
|
-
return e.gclass.gclass_flag &
|
|
752
|
+
return e.gclass.gclass_flag & N.gcflag_manual_start || Ye(e) ? 1 : (xe(e) || Pe(e), 0);
|
|
753
753
|
}
|
|
754
754
|
function Ge(e) {
|
|
755
755
|
if (ot(e)) return dn("gobj NULL or DESTROYED"), -1;
|
|
756
756
|
if (!e.running) return dn(`${et(e)}: GObj NOT RUNNING`), -1;
|
|
757
|
-
e.playing && (bn(`${et(e)}: GObj stopping without previous pause`),
|
|
757
|
+
e.playing && (bn(`${et(e)}: GObj stopping without previous pause`), Ke(e)), J(e) && L(n("⏹ ⏹ stop: %s", tt(e))), e.running = !1;
|
|
758
758
|
let t = 0;
|
|
759
759
|
return e.gclass.gmt.mt_stop && (t = e.gclass.gmt.mt_stop(e)), t;
|
|
760
760
|
}
|
|
761
761
|
function Ve(e, t, n) {
|
|
762
|
-
return
|
|
762
|
+
return xe(e) && Ge(e), 0;
|
|
763
763
|
}
|
|
764
764
|
function Me(e) {
|
|
765
765
|
return ot(e) ? (dn("gobj NULL or DESTROYED"), -1) : at(e, A.WALK_FIRST2LAST, Ve, 0, 0);
|
|
@@ -768,25 +768,25 @@
|
|
|
768
768
|
if (ot(e)) return dn(`gobj NULL or DESTROYED: ${et(e)}`), -1;
|
|
769
769
|
if (e.playing) return dn(`${et(e)}: GObj ALREADY PLAYING`), -1;
|
|
770
770
|
if (e.disabled) return dn(`${et(e)}: GObj DISABLED`), -1;
|
|
771
|
-
if (!
|
|
772
|
-
if (e.gclass.gclass_flag &
|
|
773
|
-
bn(`${et(e)}: GObj playing without previous start`),
|
|
771
|
+
if (!xe(e)) {
|
|
772
|
+
if (e.gclass.gclass_flag & N.gcflag_required_start_to_play) return dn(`${et(e)}: Cannot play, start not done`), -1;
|
|
773
|
+
bn(`${et(e)}: GObj playing without previous start`), Pe(e);
|
|
774
774
|
}
|
|
775
|
-
J(e) &&
|
|
775
|
+
J(e) && L(n("⏯ ⏯ play: %s", tt(e))), e.playing = !0;
|
|
776
776
|
let t = 0;
|
|
777
777
|
return e.gclass.gmt.mt_play && (t = e.gclass.gmt.mt_play(e), (t < 0 || !1 === t) && (e.playing = !1)), t;
|
|
778
778
|
}
|
|
779
|
-
function xe(e) {
|
|
780
|
-
return ot(e) ? (dn("gobj NULL or DESTROYED"), -1) : e.playing ? (J(e) && P(n("⏸ ⏸ pause: %s", tt(e))), e.playing = !1, e.gclass.gmt.mt_pause ? e.gclass.gmt.mt_pause(e) : 0) : (dn(`${et(e)}: GObj NOT PLAYING`), -1);
|
|
781
|
-
}
|
|
782
779
|
function Ke(e) {
|
|
780
|
+
return ot(e) ? (dn("gobj NULL or DESTROYED"), -1) : e.playing ? (J(e) && L(n("⏸ ⏸ pause: %s", tt(e))), e.playing = !1, e.gclass.gmt.mt_pause ? e.gclass.gmt.mt_pause(e) : 0) : (dn(`${et(e)}: GObj NOT PLAYING`), -1);
|
|
781
|
+
}
|
|
782
|
+
function xe(e) {
|
|
783
783
|
return !ot(e) && e.running;
|
|
784
784
|
}
|
|
785
785
|
function Ye(e) {
|
|
786
786
|
return !!ot(e) || e.disabled;
|
|
787
787
|
}
|
|
788
788
|
function Be(e) {
|
|
789
|
-
return !!(e && e.gobj_flag &
|
|
789
|
+
return !!(e && e.gobj_flag & w.gobj_flag_service);
|
|
790
790
|
}
|
|
791
791
|
function Je(e) {
|
|
792
792
|
return !ot(e) && e.playing;
|
|
@@ -825,10 +825,10 @@
|
|
|
825
825
|
return Mn(e) ? e.parent : (dn("gobj NULL of bad type"), null);
|
|
826
826
|
}
|
|
827
827
|
function rt(e) {
|
|
828
|
-
return Mn(e) ? !!(e.gobj_flag &
|
|
828
|
+
return Mn(e) ? !!(e.gobj_flag & w.gobj_flag_volatil) : (dn("gobj NULL of bad type"), null);
|
|
829
829
|
}
|
|
830
830
|
function lt(e) {
|
|
831
|
-
return Mn(e) ? !!(e.gobj_flag &
|
|
831
|
+
return Mn(e) ? !!(e.gobj_flag & w.gobj_flag_pure_child) : (dn("gobj NULL of bad type"), null);
|
|
832
832
|
}
|
|
833
833
|
function ot(e) {
|
|
834
834
|
return !Mn(e) || !!(e.obflag & (R.obflag_destroyed | R.obflag_destroying));
|
|
@@ -942,21 +942,21 @@
|
|
|
942
942
|
}
|
|
943
943
|
return dn(`${et(e)}: GClass Attribute NOT FOUND, attr ${t}`), null;
|
|
944
944
|
}
|
|
945
|
-
function
|
|
945
|
+
function Tt(e, t, n) {
|
|
946
946
|
let r = {}, l = e.gclass.attrs_table;
|
|
947
947
|
for (let n = 0; n < l.length; n++) {
|
|
948
948
|
const o = l[n];
|
|
949
949
|
if (o.name && (-1 === t || o.flag & t)) {
|
|
950
950
|
let t;
|
|
951
|
-
!e.gclass.gmt.mt_reading || e.obflag & R.obflag_destroyed ? t = Sn(e.jn_attrs, o.name) : (t = e.gclass.gmt.mt_reading(e, o.name), void 0 === t && (t = Sn(e.jn_attrs, o.name))),
|
|
951
|
+
!e.gclass.gmt.mt_reading || e.obflag & R.obflag_destroyed ? t = Sn(e.jn_attrs, o.name) : (t = e.gclass.gmt.mt_reading(e, o.name), void 0 === t && (t = Sn(e.jn_attrs, o.name))), Nn(r, o.name, t);
|
|
952
952
|
}
|
|
953
953
|
}
|
|
954
954
|
return r;
|
|
955
955
|
}
|
|
956
|
-
function
|
|
956
|
+
function yt(e, t) {
|
|
957
957
|
if (t) {
|
|
958
958
|
if (0 === Yn(t, "__disabled__")) return Ye(e);
|
|
959
|
-
if (0 === Yn(t, "__running__")) return
|
|
959
|
+
if (0 === Yn(t, "__running__")) return xe(e);
|
|
960
960
|
if (0 === Yn(t, "__playing__")) return Je(e);
|
|
961
961
|
if (0 === Yn(t, "__service__")) return Be(e);
|
|
962
962
|
}
|
|
@@ -978,7 +978,7 @@
|
|
|
978
978
|
return n ? !e.gclass.gmt.mt_reading || e.obflag & R.obflag_destroyed ? Sn(n, t) : e.gclass.gmt.mt_reading(e, t) : (dn(`${et(e)}: GClass Attribute NOT FOUND, attr ${t}`), 0);
|
|
979
979
|
}
|
|
980
980
|
function Ot(e, t, r, l) {
|
|
981
|
-
if (!
|
|
981
|
+
if (!Pn(t)) return dn(n("gobj_write_attr(%s): path must be a string", et(e))), -1;
|
|
982
982
|
let o, s = e.jn_attrs, i = t.split("`");
|
|
983
983
|
if (i.length <= 1) {
|
|
984
984
|
let l = t;
|
|
@@ -998,7 +998,7 @@
|
|
|
998
998
|
}
|
|
999
999
|
return dn(n("gobj_write_attr(%s): attr not found '%s'", et(e), o)), -1;
|
|
1000
1000
|
}
|
|
1001
|
-
function
|
|
1001
|
+
function Nt(e, t, n, r) {
|
|
1002
1002
|
let l = ce(e), o = 0;
|
|
1003
1003
|
for (const [r, s] of Object.entries(t)) {
|
|
1004
1004
|
let t = _t(e, r, !0);
|
|
@@ -1006,9 +1006,9 @@
|
|
|
1006
1006
|
}
|
|
1007
1007
|
return o;
|
|
1008
1008
|
}
|
|
1009
|
-
function
|
|
1009
|
+
function wt(e, t, n) {
|
|
1010
1010
|
let r = fe(e, t, !1);
|
|
1011
|
-
return r ? (r[t] =
|
|
1011
|
+
return r ? (r[t] = Kn(n), Cn(e.priv) && e.priv.hasOwnProperty(t) && (e.priv[t] = n), e.obflag & R.obflag_created && !(e.obflag & R.obflag_destroyed) && e.gclass.gmt.mt_writing && e.gclass.gmt.mt_writing(e, t), 0) : (dn(`${et(e)}: GClass Attribute NOT FOUND, attr ${t}`), -1);
|
|
1012
1012
|
}
|
|
1013
1013
|
function Rt(e, t, n) {
|
|
1014
1014
|
let r = fe(e, t, !1);
|
|
@@ -1025,9 +1025,9 @@
|
|
|
1025
1025
|
if (!r) return dn(`${et(e)}: state unknown, state ${t}`), !1;
|
|
1026
1026
|
e.last_state = e.current_state, e.current_state = r;
|
|
1027
1027
|
let l = q(e, "EV_STATE_CHANGED"), o = !!function(e) {
|
|
1028
|
-
return
|
|
1028
|
+
return K(e) & P.TRACE_STATES;
|
|
1029
1029
|
}(e);
|
|
1030
|
-
return (l || o) && (1 === C ||
|
|
1030
|
+
return (l || o) && (1 === C || L(n("🔀🔀 mach(%s%s^%s), new st(%s), prev st(%s)", e.running ? "" : "!!", Ze(e), Xe(e), kt(e), e.last_state.state_name))), !0;
|
|
1031
1031
|
}
|
|
1032
1032
|
function kt(e) {
|
|
1033
1033
|
return Mn(e) ? e.current_state.state_name : (dn("hgobj NULL"), "");
|
|
@@ -1053,14 +1053,14 @@
|
|
|
1053
1053
|
let r = $t(e, t, !1);
|
|
1054
1054
|
return !!r && !(n && !(r.event_flag & n)) && !!(r.event_flag & D.EVF_OUTPUT_EVENT);
|
|
1055
1055
|
}
|
|
1056
|
-
var
|
|
1056
|
+
var Lt = [], Pt = !1;
|
|
1057
1057
|
function Ut() {
|
|
1058
|
-
|
|
1059
|
-
let e =
|
|
1060
|
-
|
|
1058
|
+
Pt = !1;
|
|
1059
|
+
let e = Lt;
|
|
1060
|
+
Lt = [];
|
|
1061
1061
|
let t = 0;
|
|
1062
1062
|
for (let n of e) n.dst.obflag & (R.obflag_destroyed | R.obflag_destroying) || (Ft(n.dst, n.event, n.kw, n.src), t++);
|
|
1063
|
-
return
|
|
1063
|
+
return Lt.length > 0 && !Pt && (Pt = !0, setTimeout(Ut, 0)), t;
|
|
1064
1064
|
}
|
|
1065
1065
|
function Ft(e, t, r, l) {
|
|
1066
1066
|
if (!(e && e instanceof O)) return dn("gobj dst NULL"), -1;
|
|
@@ -1070,12 +1070,12 @@
|
|
|
1070
1070
|
let s = q(e, t) && !z(l, t);
|
|
1071
1071
|
h++;
|
|
1072
1072
|
let i = me(o, t);
|
|
1073
|
-
if (!i) return e.gclass.gmt.mt_inject_event ? (h--, s && (
|
|
1073
|
+
if (!i) return e.gclass.gmt.mt_inject_event ? (h--, s && (L(1 === C ? n("🔜 %s %s%s %s", t || "", e.running ? "" : "!!", et(e), o.state_name) : n("🔃 mach(%s%s), st: %s, ev: %s, from(%s%s)", e.running ? "" : "!!", et(e), o.state_name, t || "", l && !l.running ? "!!" : "", et(l))), r && H(e) && kn(r) && hn(r)), e.gclass.gmt.mt_inject_event(e, t, r, l)) : (s && L(n("📛 mach(%s%s^%s), st: %s, ev: %s, 📛📛ERROR Event NOT DEFINED in state📛📛, from(%s%s^%s)", e.running ? "" : "!!", Ze(e), Xe(e), o.state_name, t || "", l && !l.running ? "!!" : "", Ze(l), Xe(l))), dn(`📛📛 Event NOT DEFINED in state 📛📛: ${et(e)}, ${o.state_name}, ${t}`), h--, -1);
|
|
1074
1074
|
if (s) {
|
|
1075
|
-
if (1 === C)
|
|
1075
|
+
if (1 === C) L(n("🔄 %s %s%s %s from %s%s", t || "", e.running ? "" : "!!", et(e), o.state_name, l && !l.running ? "!!" : "", et(l)));
|
|
1076
1076
|
else {
|
|
1077
1077
|
let r = "";
|
|
1078
|
-
i.action && (r = Ar(i.action)),
|
|
1078
|
+
i.action && (r = Ar(i.action)), L(n("🔄 mach(%s%s^%s), st: %s, ev: %s%s%s, ac: %s, from(%s%s^%s)", e.running ? "" : "!!", Ze(e), Xe(e), o.state_name, "", t || "", "", r, l && !l.running ? "!!" : "", Ze(l), Xe(l)));
|
|
1079
1079
|
}
|
|
1080
1080
|
r && H(e) && kn(r) && hn(r);
|
|
1081
1081
|
}
|
|
@@ -1084,7 +1084,7 @@
|
|
|
1084
1084
|
try {
|
|
1085
1085
|
i.action && (_ = i.action(e, t, r, l));
|
|
1086
1086
|
} finally {}
|
|
1087
|
-
return !s || 1 === C || e.obflag & R.obflag_destroyed ||
|
|
1087
|
+
return !s || 1 === C || e.obflag & R.obflag_destroyed || L(n("<- mach(%s%s^%s), st: %s, ev: %s, ret: %d", e.running ? "" : "!!", Ze(e), Xe(e), e.current_state.state_name, t || "", Un(_) ? _ : 0)), h--, _;
|
|
1088
1088
|
}
|
|
1089
1089
|
var Gt = Object.freeze({
|
|
1090
1090
|
__hard_subscription__: 1,
|
|
@@ -1106,19 +1106,19 @@
|
|
|
1106
1106
|
let o = tr(t, r, "__config__", null), s = tr(t, r, "__global__", null), i = tr(t, r, "__local__", null), _ = nr(t, r, "__filter__", null), a = !0;
|
|
1107
1107
|
if (t && t !== er(null, e, "publisher", null) && (a = !1), l && l !== er(null, e, "subscriber", null) && (a = !1), n && n !== Zn(null, e, "event", "") && (a = !1), In(o) > 0) {
|
|
1108
1108
|
let t = tr(null, e, "__config__", null);
|
|
1109
|
-
In(t) > 0 &&
|
|
1109
|
+
In(t) > 0 && Tn(t, o) || (a = !1);
|
|
1110
1110
|
}
|
|
1111
1111
|
if (In(s) > 0) {
|
|
1112
1112
|
let t = tr(null, e, "__global__", null);
|
|
1113
|
-
In(t) > 0 &&
|
|
1113
|
+
In(t) > 0 && Tn(t, s) || (a = !1);
|
|
1114
1114
|
}
|
|
1115
1115
|
if (In(i) > 0) {
|
|
1116
1116
|
let t = tr(null, e, "__local__", null);
|
|
1117
|
-
In(t) > 0 &&
|
|
1117
|
+
In(t) > 0 && Tn(t, i) || (a = !1);
|
|
1118
1118
|
}
|
|
1119
1119
|
if (In(_) > 0) {
|
|
1120
1120
|
let t = nr(null, e, "__filter__", null);
|
|
1121
|
-
In(t) > 0 &&
|
|
1121
|
+
In(t) > 0 && Tn(t, _) || (a = !1);
|
|
1122
1122
|
}
|
|
1123
1123
|
return a;
|
|
1124
1124
|
}
|
|
@@ -1130,16 +1130,16 @@
|
|
|
1130
1130
|
}
|
|
1131
1131
|
return o;
|
|
1132
1132
|
}
|
|
1133
|
-
function
|
|
1133
|
+
function Kt(e, t, n, r, l) {
|
|
1134
1134
|
for (let o = 0; o < e.length; o++) if (Mt(e[o], t, n, r, l)) return o;
|
|
1135
1135
|
return -1;
|
|
1136
1136
|
}
|
|
1137
|
-
function
|
|
1137
|
+
function xt(e, t, r, l) {
|
|
1138
1138
|
let o = er(e, t, "publisher", null, zt.KW_REQUIRED), s = er(e, t, "subscriber", null, zt.KW_REQUIRED), i = Zn(e, t, "event", "", zt.KW_REQUIRED);
|
|
1139
1139
|
if (!!(Xn(e, t, "subs_flag", null, zt.KW_REQUIRED) & Gt.__hard_subscription__) && !r) return -1;
|
|
1140
|
-
(B(s) || B(o)) && (
|
|
1141
|
-
let _ =
|
|
1142
|
-
return _ >= 0 ? An(o.dl_subscriptions, _) : (dn(`${et(e)}: subscription in publisher not found`), hn(t)), _ =
|
|
1140
|
+
(B(s) || B(o)) && (L(n("💜💜👎 unsubscribing event '%s': publisher %s, subscriber'%s'", i || "", et(o), et(s))), hn(t)), o.obflag & R.obflag_destroyed || l || o.gclass.gmt.mt_subscription_deleted && o.gclass.gmt.mt_subscription_deleted(o, t);
|
|
1141
|
+
let _ = Kt(o.dl_subscriptions, o, i, t, s);
|
|
1142
|
+
return _ >= 0 ? An(o.dl_subscriptions, _) : (dn(`${et(e)}: subscription in publisher not found`), hn(t)), _ = Kt(s.dl_subscribings, o, i, t, s), _ >= 0 ? An(s.dl_subscribings, _) : (dn(`${et(e)}: subscription in subscriber not found`), hn(t)), 0;
|
|
1143
1143
|
}
|
|
1144
1144
|
function Yt(e, t, r, l) {
|
|
1145
1145
|
if (null == r && (r = {}), !e) return dn(`publisher NULL: ev ${t}`), 0;
|
|
@@ -1154,18 +1154,18 @@
|
|
|
1154
1154
|
if (Object.keys(r).forEach((n) => {
|
|
1155
1155
|
o.has(n) || dn(`${et(e)}: key ignored in subscription (key: ${n}, event: ${t})`);
|
|
1156
1156
|
}), Wn(t)) t = "";
|
|
1157
|
-
else if (!(Ct(e, t, D.EVF_OUTPUT_EVENT) || e.gclass.gclass_flag &
|
|
1157
|
+
else if (!(Ct(e, t, D.EVF_OUTPUT_EVENT) || e.gclass.gclass_flag & N.gcflag_no_check_output_events)) return dn(`event NOT in output event list: ${et(e)}, ${t}`), 0;
|
|
1158
1158
|
let s = Wt(e.dl_subscriptions, e, t, r, l);
|
|
1159
1159
|
$n(s) > 0 && (dn(`${et(e)}: ${$n(s)} subscription(s) REPEATED, will be deleted and override`), hn(s, "subscription REPEATED"), Bt(e, s, !1));
|
|
1160
1160
|
let i = function(e, t, n, r) {
|
|
1161
1161
|
let l = _e(e, Vt);
|
|
1162
|
-
|
|
1162
|
+
wn(l, "event", t), wn(l, "subscriber", r), wn(l, "publisher", e);
|
|
1163
1163
|
let o = 0;
|
|
1164
1164
|
if (n) {
|
|
1165
1165
|
let t = tr(e, n, "__config__", null), r = tr(e, n, "__global__", null), s = tr(e, n, "__local__", null), i = nr(e, n, "__filter__", null), _ = Zn(e, n, "__service__", "");
|
|
1166
|
-
if (In(r) > 0 &&
|
|
1166
|
+
if (In(r) > 0 && wn(l, "__global__", En(r)), In(t) > 0) {
|
|
1167
1167
|
let n = En(t);
|
|
1168
|
-
if (
|
|
1168
|
+
if (wn(l, "__config__", n), Hn(n, "__hard_subscription__")) {
|
|
1169
1169
|
let t = Qn(e, n, "__hard_subscription__", !1);
|
|
1170
1170
|
On(n, "__hard_subscription__"), t && (o |= Gt.__hard_subscription__);
|
|
1171
1171
|
}
|
|
@@ -1174,20 +1174,20 @@
|
|
|
1174
1174
|
On(n, "__own_event__"), t && (o |= Gt.__own_event__);
|
|
1175
1175
|
}
|
|
1176
1176
|
}
|
|
1177
|
-
In(s) > 0 &&
|
|
1177
|
+
In(s) > 0 && wn(l, "__local__", En(s)), In(i) > 0 && wn(l, "__filter__", En(i)), Wn(_) || wn(l, "__service__", _);
|
|
1178
1178
|
}
|
|
1179
|
-
return
|
|
1179
|
+
return wn(l, "subs_flag", o), l;
|
|
1180
1180
|
}(e, t, r, l);
|
|
1181
1181
|
if (!i) return dn(`${et(e)}: _create_subscription() FAILED`), 0;
|
|
1182
|
-
if (Rn(e.dl_subscriptions, i), Rn(l.dl_subscribings, i), (B(l) || B(e)) && (
|
|
1182
|
+
if (Rn(e.dl_subscriptions, i), Rn(l.dl_subscribings, i), (B(l) || B(e)) && (L(n("💜💜👍 subscribing event '%s', publisher '%s', subscriber %s", t || "", et(e), et(l))), r && (H(l) || H(e)) && hn(r)), e.gclass.gmt.mt_subscription_added) {
|
|
1183
1183
|
let t = e.gclass.gmt.mt_subscription_added(e, i);
|
|
1184
|
-
(t < 0 || !1 === t) && (
|
|
1184
|
+
(t < 0 || !1 === t) && (xt(e, i, !0, !0), i = 0);
|
|
1185
1185
|
}
|
|
1186
1186
|
return i;
|
|
1187
1187
|
}
|
|
1188
1188
|
function Bt(e, t, n) {
|
|
1189
1189
|
let r = [...t];
|
|
1190
|
-
for (let t = 0; t < r.length; t++)
|
|
1190
|
+
for (let t = 0; t < r.length; t++) xt(e, r[t], n, !1);
|
|
1191
1191
|
return 0;
|
|
1192
1192
|
}
|
|
1193
1193
|
function Jt(e, t, n, r) {
|
|
@@ -1200,9 +1200,9 @@
|
|
|
1200
1200
|
if (Cn(r) || (r = {}), !e || e.obflag & (R.obflag_destroyed | R.obflag_destroying)) return dn("gobj NULL or DESTROYED"), -1;
|
|
1201
1201
|
if (Wn(t)) return dn(`${et(e)}: event EMPTY`), -1;
|
|
1202
1202
|
let l = $t(e, t, !0);
|
|
1203
|
-
if (!(l && l.event_flag & (D.EVF_SYSTEM_EVENT | D.EVF_OUTPUT_EVENT) || e.gclass.gclass_flag &
|
|
1203
|
+
if (!(l && l.event_flag & (D.EVF_SYSTEM_EVENT | D.EVF_OUTPUT_EVENT) || e.gclass.gclass_flag & N.gcflag_no_check_output_events)) return dn(`event NOT in output event list: ${et(e)}, ev ${t}`), -1;
|
|
1204
1204
|
let o = (B(e) || q(e, t)) && !z(e, t);
|
|
1205
|
-
if (o && (
|
|
1205
|
+
if (o && (L(1 === C ? n("🔝🔝 %s %s%s %s", t || "", e.running ? "" : "!!", et(e), e.current_state.state_name) : n("🔝🔝 mach(%s%s^%s), st: %s, ev: %s%s%s", e.running ? "" : "!!", Ze(e), Xe(e), e.current_state.state_name, "", t || "", "")), H(e) && kn(r) && hn(r)), e.gclass.gmt.mt_publish_event) {
|
|
1206
1206
|
let n = e.gclass.gmt.mt_publish_event(e, t, r);
|
|
1207
1207
|
if (n <= 0) return n;
|
|
1208
1208
|
}
|
|
@@ -1220,11 +1220,11 @@
|
|
|
1220
1220
|
if (Wn(f) || 0 === Yn(f, t)) {
|
|
1221
1221
|
tr(e, a, "__config__", null, 0);
|
|
1222
1222
|
let l = tr(e, a, "__global__", null, 0), s = tr(e, a, "__local__", null, 0), f = nr(e, a, "__filter__", null, 0), g = r, d = 1;
|
|
1223
|
-
if (e.gclass.gmt.mt_publication_filter ? d = e.gclass.gmt.mt_publication_filter(e, t, g, u) : In(f) > 0 && (d = sr(g, f) ? 1 : 0, o && (
|
|
1223
|
+
if (e.gclass.gmt.mt_publication_filter ? d = e.gclass.gmt.mt_publication_filter(e, t, g, u) : In(f) > 0 && (d = sr(g, f) ? 1 : 0, o && (L(n("💜💜🔄%s publishing with filter, event '%s', subscriber'%s', publisher %s", d ? "👍" : "👎", t || "", et(u), et(e))), hn(f))), d < 0) break;
|
|
1224
1224
|
if (!d) continue;
|
|
1225
1225
|
let b = $t(u, t, !0);
|
|
1226
1226
|
if (b && b.event_flag & D.EVF_SYSTEM_EVENT && !It(u, b.event_name, 0)) continue;
|
|
1227
|
-
s && Jn(g, s), l &&
|
|
1227
|
+
s && Jn(g, s), l && yn(g, l), o && (L(1 === C ? n("🔝🔄 %s (%s) %s%s", t || "", t || "", u.running ? "" : "!!", et(u)) : n("🔝🔄 mach(%s%s), st: %s, ev: %s, from(%s%s)", u.running ? "" : "!!", et(u), kt(u), t || "", e && !e.running ? "!!" : "", et(e))), H(e) && kn(g) && hn(g));
|
|
1228
1228
|
let p = Ft(u, t, g, e);
|
|
1229
1229
|
if (p < 0 && c & Gt.__own_event__) {
|
|
1230
1230
|
i = -1;
|
|
@@ -1319,35 +1319,35 @@
|
|
|
1319
1319
|
return n;
|
|
1320
1320
|
}
|
|
1321
1321
|
function dn(e) {
|
|
1322
|
-
let t = gn(e), n =
|
|
1322
|
+
let t = gn(e), n = wr();
|
|
1323
1323
|
Xt && (Xt === Qt.error ? _n("error", t) && Xt("%c" + n + " ERROR: " + String(t), "color:red") : (_n("error", t) && Qt.error("%c" + n + " ERROR: " + String(t), "color:red"), Xt(`${n} ERROR: ${String(t)}`))), un("error", t, n);
|
|
1324
1324
|
}
|
|
1325
1325
|
function bn(e) {
|
|
1326
|
-
let t = gn(e), n =
|
|
1326
|
+
let t = gn(e), n = wr();
|
|
1327
1327
|
Zt && (Zt === Qt.warn ? _n("warning", t) && Zt("%c" + n + " WARNING: " + String(t), "color:yellow") : (_n("warning", t) && Qt.warn("%c" + n + " WARNING: " + String(t), "color:yellow"), Zt(`${n} WARNING: ${String(t)}`))), un("warning", t, n);
|
|
1328
1328
|
}
|
|
1329
1329
|
function pn(e) {
|
|
1330
|
-
let t = gn(e), n =
|
|
1330
|
+
let t = gn(e), n = wr();
|
|
1331
1331
|
tn && _n("debug", t) && tn("%c" + n + " DEBUG: " + String(t), "color:silver"), un("debug", t, n);
|
|
1332
1332
|
}
|
|
1333
1333
|
function mn(e) {
|
|
1334
|
-
let t = gn(e), n =
|
|
1334
|
+
let t = gn(e), n = wr();
|
|
1335
1335
|
tn && _n("msg", t) && tn("%c" + n + " MSG: " + String(t), "color:cyan"), un("msg", t, n);
|
|
1336
1336
|
}
|
|
1337
1337
|
function hn(e, t) {
|
|
1338
|
-
_n("json", t) && (t &&
|
|
1338
|
+
_n("json", t) && (t && Qt.warn("=====> " + t), Qt.dir(e)), un("json", e, wr());
|
|
1339
1339
|
}
|
|
1340
1340
|
function En(e) {
|
|
1341
1341
|
return structuredClone(e);
|
|
1342
1342
|
}
|
|
1343
|
-
function
|
|
1343
|
+
function Tn(e, t) {
|
|
1344
1344
|
if (e === t) return !0;
|
|
1345
1345
|
if (null === e || null === t) return e === t;
|
|
1346
1346
|
if (typeof e != typeof t) return !1;
|
|
1347
1347
|
if (Array.isArray(e) !== Array.isArray(t)) return !1;
|
|
1348
1348
|
if (Array.isArray(e)) {
|
|
1349
1349
|
if (e.length !== t.length) return !1;
|
|
1350
|
-
for (let n = 0; n < e.length; n++) if (!
|
|
1350
|
+
for (let n = 0; n < e.length; n++) if (!Tn(e[n], t[n])) return !1;
|
|
1351
1351
|
return !0;
|
|
1352
1352
|
}
|
|
1353
1353
|
if ("object" == typeof e) {
|
|
@@ -1355,13 +1355,13 @@
|
|
|
1355
1355
|
if (n.length !== r.length) return !1;
|
|
1356
1356
|
for (let l = 0; l < n.length; l++) {
|
|
1357
1357
|
if (n[l] !== r[l]) return !1;
|
|
1358
|
-
if (!
|
|
1358
|
+
if (!Tn(e[n[l]], t[r[l]])) return !1;
|
|
1359
1359
|
}
|
|
1360
1360
|
return !0;
|
|
1361
1361
|
}
|
|
1362
1362
|
return e === t;
|
|
1363
1363
|
}
|
|
1364
|
-
function
|
|
1364
|
+
function yn(e, t) {
|
|
1365
1365
|
if (!t) return e;
|
|
1366
1366
|
for (let n of Object.keys(t)) e[n] = t[n];
|
|
1367
1367
|
return e;
|
|
@@ -1382,10 +1382,10 @@
|
|
|
1382
1382
|
function On(e, t) {
|
|
1383
1383
|
e && e.hasOwnProperty(t) && delete e[t];
|
|
1384
1384
|
}
|
|
1385
|
-
function
|
|
1385
|
+
function Nn(e, t, n) {
|
|
1386
1386
|
e[t] = n;
|
|
1387
1387
|
}
|
|
1388
|
-
function
|
|
1388
|
+
function wn(e, t, n) {
|
|
1389
1389
|
e[t] = n;
|
|
1390
1390
|
}
|
|
1391
1391
|
function Rn(e, t) {
|
|
@@ -1401,18 +1401,18 @@
|
|
|
1401
1401
|
return Cn(e) ? Object.keys(e).length : 0;
|
|
1402
1402
|
}
|
|
1403
1403
|
function $n(e) {
|
|
1404
|
-
return
|
|
1404
|
+
return Ln(e) ? e.length : 0;
|
|
1405
1405
|
}
|
|
1406
1406
|
function In(e) {
|
|
1407
|
-
return Cn(e) ? Object.keys(e).length :
|
|
1407
|
+
return Cn(e) ? Object.keys(e).length : Ln(e) ? e.length : Pn(e) && e.length > 0 ? 1 : 0;
|
|
1408
1408
|
}
|
|
1409
1409
|
function Cn(e) {
|
|
1410
1410
|
return null !== e && "object" == typeof e && !Array.isArray(e);
|
|
1411
1411
|
}
|
|
1412
|
-
function
|
|
1412
|
+
function Ln(e) {
|
|
1413
1413
|
return Array.isArray(e);
|
|
1414
1414
|
}
|
|
1415
|
-
function
|
|
1415
|
+
function Pn(e) {
|
|
1416
1416
|
return "string" == typeof e;
|
|
1417
1417
|
}
|
|
1418
1418
|
function Un(e) {
|
|
@@ -1431,12 +1431,12 @@
|
|
|
1431
1431
|
return e instanceof O;
|
|
1432
1432
|
}
|
|
1433
1433
|
function Wn(e) {
|
|
1434
|
-
return !
|
|
1434
|
+
return !Pn(e) || 0 === e.length;
|
|
1435
1435
|
}
|
|
1436
|
-
function
|
|
1436
|
+
function Kn(e) {
|
|
1437
1437
|
return Un(e) ? Boolean(e) : /^\s*(true|1|on)\s*$/i.test(e);
|
|
1438
1438
|
}
|
|
1439
|
-
function
|
|
1439
|
+
function xn(e, t) {
|
|
1440
1440
|
return e === t ? 0 : e > t ? 1 : -1;
|
|
1441
1441
|
}
|
|
1442
1442
|
function Yn(e, t) {
|
|
@@ -1444,7 +1444,7 @@
|
|
|
1444
1444
|
return n === r ? 0 : n > r ? 1 : -1;
|
|
1445
1445
|
}
|
|
1446
1446
|
function Bn(e, t) {
|
|
1447
|
-
if (Cn(e) || Cn(t) ||
|
|
1447
|
+
if (Cn(e) || Cn(t) || Ln(e) || Ln(t)) return 0;
|
|
1448
1448
|
if (Un(e) || Un(t)) {
|
|
1449
1449
|
let n = Number(e), r = Number(t);
|
|
1450
1450
|
return n > r ? 1 : n < r ? -1 : 0;
|
|
@@ -1453,7 +1453,7 @@
|
|
|
1453
1453
|
let n = Number(e), r = Number(t);
|
|
1454
1454
|
return n > r ? 1 : n < r ? -1 : 0;
|
|
1455
1455
|
}
|
|
1456
|
-
return
|
|
1456
|
+
return xn(String(e), String(t));
|
|
1457
1457
|
}
|
|
1458
1458
|
function Jn(e, t) {
|
|
1459
1459
|
if ("object" != typeof t || Array.isArray(t)) if (Array.isArray(t)) for (const n of t) Jn(e, n);
|
|
@@ -1464,8 +1464,8 @@
|
|
|
1464
1464
|
return !(!(t in e) || !e.hasOwnProperty(t));
|
|
1465
1465
|
}
|
|
1466
1466
|
function qn(e, t, n, r) {
|
|
1467
|
-
if (e && !Mn(e) && dn("GObj bad instanceof"), !Cn(t) && !
|
|
1468
|
-
if (!
|
|
1467
|
+
if (e && !Mn(e) && dn("GObj bad instanceof"), !Cn(t) && !Ln(t)) return dn(`${et(e)}: kw must be list or dict`), 0;
|
|
1468
|
+
if (!Pn(n)) return dn(`${et(e)}: path must be a string: ${String(n)}`), 0;
|
|
1469
1469
|
let l = n.split("`");
|
|
1470
1470
|
if (l.length <= 1) return t[n];
|
|
1471
1471
|
let o = l.length;
|
|
@@ -1483,7 +1483,7 @@
|
|
|
1483
1483
|
function Qn(e, t, n, r, l) {
|
|
1484
1484
|
e && !Mn(e) && dn("GObj bad instanceof");
|
|
1485
1485
|
let o = qn(e, t, n, !1);
|
|
1486
|
-
const s = l && l & zt.KW_REQUIRED, i = l && l & zt.KW_CREATE, _ = l && l & zt.KW_EXTRACT;
|
|
1486
|
+
const s = l && l & zt.KW_REQUIRED, i = l && l & zt.KW_CREATE, _ = l && l & zt.KW_EXTRACT, a = l && l & zt.KW_WILD_NUMBER;
|
|
1487
1487
|
if (void 0 === o) {
|
|
1488
1488
|
if (i) {
|
|
1489
1489
|
let l = Boolean(r);
|
|
@@ -1491,7 +1491,15 @@
|
|
|
1491
1491
|
}
|
|
1492
1492
|
return s && (dn(`path not found: '${n}'`), hn(t)), Boolean(r);
|
|
1493
1493
|
}
|
|
1494
|
-
|
|
1494
|
+
let u;
|
|
1495
|
+
if (Fn(o)) u = o;
|
|
1496
|
+
else if (a && Un(o)) u = 0 !== o;
|
|
1497
|
+
else if (a && Pn(o)) u = "true" === o.toLowerCase() || "false" !== o.toLowerCase() && 0 !== (parseInt(o) || 0);
|
|
1498
|
+
else {
|
|
1499
|
+
if (!a || null !== o) return s && (dn(`${et(e)}: path value MUST BE a boolean: ${n}`), mn(t)), Boolean(r);
|
|
1500
|
+
u = !1;
|
|
1501
|
+
}
|
|
1502
|
+
return _ && zn(e, t, n), u;
|
|
1495
1503
|
}
|
|
1496
1504
|
function Xn(e, t, n, r, l) {
|
|
1497
1505
|
e && !Mn(e) && dn("GObj bad instanceof");
|
|
@@ -1510,7 +1518,7 @@
|
|
|
1510
1518
|
e && !Mn(e) && dn("GObj bad instanceof");
|
|
1511
1519
|
let o = qn(e, t, n, !1);
|
|
1512
1520
|
const s = l && l & zt.KW_REQUIRED, i = l && l & zt.KW_CREATE, _ = l && l & zt.KW_EXTRACT;
|
|
1513
|
-
return void 0 === o ? i ? (rr(e, t, n,
|
|
1521
|
+
return void 0 === o ? i ? (rr(e, t, n, Pn(r) ? r : null), r) : (s && (dn(`path not found: '${n}'`), hn(t)), r) : (_ && zn(e, t, n), Pn(o) ? o : (s && (dn(`${et(e)}: path value MUST BE a string: ${n}`), mn(t)), r));
|
|
1514
1522
|
}
|
|
1515
1523
|
function er(e, t, n, r, l) {
|
|
1516
1524
|
e && !Mn(e) && dn("GObj bad instanceof");
|
|
@@ -1529,14 +1537,7 @@
|
|
|
1529
1537
|
e && !Mn(e) && dn("GObj bad instanceof");
|
|
1530
1538
|
let o = qn(e, t, n, !1);
|
|
1531
1539
|
const s = l && l & zt.KW_REQUIRED, i = l && l & zt.KW_CREATE, _ = l && l & zt.KW_EXTRACT;
|
|
1532
|
-
|
|
1533
|
-
if (i) {
|
|
1534
|
-
let l = Object(r);
|
|
1535
|
-
return rr(e, t, n, l), l;
|
|
1536
|
-
}
|
|
1537
|
-
return s && (dn(`path not found: '${n}'`), hn(t)), Object(r);
|
|
1538
|
-
}
|
|
1539
|
-
return _ && zn(e, t, n), Cn(o) ? Object(o) : (s && (dn(`path value MUST BE a dict: ${n}`), mn(t)), Object(r));
|
|
1540
|
+
return void 0 === o ? i && Cn(r) && t ? (rr(e, t, n, r), r) : (s && (dn(`path not found: '${n}'`), hn(t)), r) : Cn(o) ? (_ && zn(e, t, n), o) : (s && (dn(`${et(e)}: path value MUST BE a dict: ${n}`), mn(t)), r);
|
|
1540
1541
|
}
|
|
1541
1542
|
function nr(e, t, n, r, l) {
|
|
1542
1543
|
e && !Mn(e) && dn("GObj bad instanceof");
|
|
@@ -1564,12 +1565,12 @@
|
|
|
1564
1565
|
}
|
|
1565
1566
|
function lr(e, t, n, r, l) {
|
|
1566
1567
|
if (e && !Mn(e) && dn("GObj bad instanceof"), !Cn(t)) return dn("kw is not an object"), -1;
|
|
1567
|
-
let o = tr(e, t, n, {},
|
|
1568
|
+
let o = tr(e, t, n, {}, zt.KW_CREATE);
|
|
1568
1569
|
return Cn(o) ? (o[r] = l, 0) : (dn("subdict is not an object"), -1);
|
|
1569
1570
|
}
|
|
1570
1571
|
function or(e, t, r) {
|
|
1571
1572
|
let l = "", o = !1;
|
|
1572
|
-
if (
|
|
1573
|
+
if (Ln(t)) {
|
|
1573
1574
|
o = !1;
|
|
1574
1575
|
for (let s = 0; s < t.length; s++) {
|
|
1575
1576
|
let i = t[s];
|
|
@@ -1580,7 +1581,7 @@
|
|
|
1580
1581
|
let s = Object.keys(t);
|
|
1581
1582
|
for (let i = 0; i < s.length; i++) {
|
|
1582
1583
|
let _ = s[i], a = t[_];
|
|
1583
|
-
if (l = Wn(r) ? n("%s", _) : n("%s`%s", r, _),
|
|
1584
|
+
if (l = Wn(r) ? n("%s", _) : n("%s`%s", r, _), Ln(a) || Cn(a)) {
|
|
1584
1585
|
if (o = or(e, a, l), !o) break;
|
|
1585
1586
|
continue;
|
|
1586
1587
|
}
|
|
@@ -1603,12 +1604,12 @@
|
|
|
1603
1604
|
function ir(e, t, n, r) {
|
|
1604
1605
|
e && !Mn(e) && dn("GObj bad instanceof");
|
|
1605
1606
|
let l = {};
|
|
1606
|
-
if (
|
|
1607
|
+
if (Pn(n) && !Wn(n)) {
|
|
1607
1608
|
let o = n;
|
|
1608
1609
|
t.hasOwnProperty(o) ? l[o] = t[o] : r && dn(`${et(e)}: key not found: ${o}`);
|
|
1609
1610
|
} else if (Cn(n) && kn(n) > 0) for (let o of Object.keys(n)) t.hasOwnProperty(o) ? l[o] = t[o] : r && dn(`${et(e)}: key not found: ${o}`);
|
|
1610
1611
|
else {
|
|
1611
|
-
if (!(
|
|
1612
|
+
if (!(Ln(n) && $n(n) > 0)) return t;
|
|
1612
1613
|
for (let o = 0; o < n.length; o++) {
|
|
1613
1614
|
let s = n[o];
|
|
1614
1615
|
t.hasOwnProperty(s) ? l[s] = t[s] : r && dn(`${et(e)}: key not found: ${s}`);
|
|
@@ -1618,12 +1619,12 @@
|
|
|
1618
1619
|
}
|
|
1619
1620
|
function _r(e, t, n, r) {
|
|
1620
1621
|
let l = {};
|
|
1621
|
-
if (
|
|
1622
|
+
if (yn(l, t), Pn(n) && !Wn(n)) {
|
|
1622
1623
|
let o = n;
|
|
1623
1624
|
nr(e, t, o, 0, 0) ? On(l, o) : r && dn(`${et(e)}: key not found: ${o}`);
|
|
1624
1625
|
} else if (Cn(n) && kn(n) > 0) for (let o of Object.keys(n)) t.hasOwnProperty(o) ? On(l, o) : r && dn(`${et(e)}: key not found: ${o}`);
|
|
1625
1626
|
else {
|
|
1626
|
-
if (!(
|
|
1627
|
+
if (!(Ln(n) && $n(n) > 0)) return {};
|
|
1627
1628
|
for (let o = 0; o < n.length; o++) {
|
|
1628
1629
|
let s = n[o];
|
|
1629
1630
|
t.hasOwnProperty(s) ? On(l, s) : r && dn(`${et(e)}: key not found: ${s}`);
|
|
@@ -1658,24 +1659,24 @@
|
|
|
1658
1659
|
}
|
|
1659
1660
|
function fr(e, t) {
|
|
1660
1661
|
if (Gn(e) || Gn(t)) return !0;
|
|
1661
|
-
if (
|
|
1662
|
+
if (Ln(e)) {
|
|
1662
1663
|
if (0 === e.length) return !0;
|
|
1663
1664
|
for (let n = 0; n < e.length; n++) if (e[n] === t) return !0;
|
|
1664
1665
|
} else if (Cn(e)) {
|
|
1665
1666
|
if (0 === Object.keys(e).length) return !0;
|
|
1666
1667
|
for (let n in e) if (n === t) return !0;
|
|
1667
|
-
} else if (
|
|
1668
|
+
} else if (Pn(e) && e === t) return !0;
|
|
1668
1669
|
return !1;
|
|
1669
1670
|
}
|
|
1670
1671
|
function gr(e, t, n, r, l) {
|
|
1671
1672
|
if (e && !Mn(e) && dn("GObj bad instanceof"), !t) return null;
|
|
1672
1673
|
l || (l = sr);
|
|
1673
1674
|
let o = [];
|
|
1674
|
-
if (
|
|
1675
|
+
if (Ln(t)) for (let s = 0; s < t.length; s++) {
|
|
1675
1676
|
let i, _ = t[s];
|
|
1676
1677
|
if (Cn(_)) i = Zn(e, _, "id", "", 0);
|
|
1677
1678
|
else {
|
|
1678
|
-
if (!
|
|
1679
|
+
if (!Pn(_)) continue;
|
|
1679
1680
|
i = _;
|
|
1680
1681
|
}
|
|
1681
1682
|
fr(n, i) && l(_, r) && o.push(_);
|
|
@@ -1724,7 +1725,7 @@
|
|
|
1724
1725
|
let l = pr(t, n);
|
|
1725
1726
|
l || (l = [], mr(t, n, l));
|
|
1726
1727
|
try {
|
|
1727
|
-
|
|
1728
|
+
Ln(l) && l.unshift(r);
|
|
1728
1729
|
} catch (e) {
|
|
1729
1730
|
dn(e);
|
|
1730
1731
|
}
|
|
@@ -1735,14 +1736,14 @@
|
|
|
1735
1736
|
let l = pr(t, n);
|
|
1736
1737
|
return l ? 0 === l.length ? (r && dn(`stack empty: ${n}`), null) : l[0] : (r && dn(`stack NOT FOUND: ${n}`), null);
|
|
1737
1738
|
}
|
|
1738
|
-
function
|
|
1739
|
+
function Tr(e, t, n) {
|
|
1739
1740
|
return Wn(n) ? zn(e, t, "__md_iev__`__msg_type__") : lr(e, t, "__md_iev__", "__msg_type__", n), 0;
|
|
1740
1741
|
}
|
|
1741
|
-
function
|
|
1742
|
+
function yr(e, t) {
|
|
1742
1743
|
return Zn(e, t, "__md_iev__`__msg_type__", "", 0);
|
|
1743
1744
|
}
|
|
1744
1745
|
function vr(e, t, n) {
|
|
1745
|
-
void 0 !== n &&
|
|
1746
|
+
void 0 !== n && Pn(n) || (n = "");
|
|
1746
1747
|
for (let r of Object.keys(e)) {
|
|
1747
1748
|
if (!e.hasOwnProperty(r)) continue;
|
|
1748
1749
|
let l = (n.length ? "`" : "") + r;
|
|
@@ -1804,11 +1805,11 @@
|
|
|
1804
1805
|
function Or(e) {
|
|
1805
1806
|
return null == e ? "" : String(e).replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
1806
1807
|
}
|
|
1807
|
-
function
|
|
1808
|
+
function Nr(e) {
|
|
1808
1809
|
const t = document.createElement("template");
|
|
1809
1810
|
return t.innerHTML = e.trim(), t.content.firstChild;
|
|
1810
1811
|
}
|
|
1811
|
-
function
|
|
1812
|
+
function wr(e) {
|
|
1812
1813
|
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();
|
|
1813
1814
|
return `${n}.${r}${l > 0 ? "-" : "+"}${t(Math.floor(Math.abs(l) / 60), 2)}${t(Math.abs(l) % 60, 2)}`;
|
|
1814
1815
|
}
|
|
@@ -1851,14 +1852,14 @@
|
|
|
1851
1852
|
return null !== t ? t : "[" === e[0] && "[" === e[1] ? e.slice(1) : e;
|
|
1852
1853
|
});
|
|
1853
1854
|
}
|
|
1854
|
-
function
|
|
1855
|
+
function Lr(e, t) {
|
|
1855
1856
|
return e === t || null !== e && null !== t && "object" == typeof e && "object" == typeof t && JSON.stringify(e) === JSON.stringify(t);
|
|
1856
1857
|
}
|
|
1857
|
-
function
|
|
1858
|
+
function Pr(e) {
|
|
1858
1859
|
return "persistent-attrs-" + et(e);
|
|
1859
1860
|
}
|
|
1860
1861
|
function Ur(e, t) {
|
|
1861
|
-
if (
|
|
1862
|
+
if (Pn(t)) {
|
|
1862
1863
|
if (-1 === t.indexOf("^")) {
|
|
1863
1864
|
let n, r, l = e.fkey;
|
|
1864
1865
|
if (1 !== kn(l)) return dn("bad fkey 1"), dn(e), dn(t), null;
|
|
@@ -1989,32 +1990,32 @@
|
|
|
1989
1990
|
j(E.DTP_BOOLEAN, "periodic", 0, 0, "True for periodic timeouts"),
|
|
1990
1991
|
j(E.DTP_INTEGER, "msec", 0, 0, "Timeout in milliseconds"),
|
|
1991
1992
|
v()
|
|
1992
|
-
],
|
|
1993
|
+
], Kr = {
|
|
1993
1994
|
periodic: !1,
|
|
1994
1995
|
msec: 0,
|
|
1995
1996
|
timer_id: -1
|
|
1996
|
-
},
|
|
1997
|
+
}, xr = null;
|
|
1997
1998
|
function Yr(e, t, n, r) {
|
|
1998
1999
|
let l = e.priv, o = l.periodic ? "EV_TIMEOUT_PERIODIC" : "EV_TIMEOUT";
|
|
1999
2000
|
return l.periodic && l.msec > 0 ? l.timer_id = setTimeout(function() {
|
|
2000
2001
|
Ft(e, "EV_TIMEOUT", {}, e);
|
|
2001
|
-
}, l.msec) : l.timer_id = -1, lt(e) ? Ft(nt(e), o, {}, e) : qt(e, o, {}), l.periodic || -1 !== l.timer_id ||
|
|
2002
|
+
}, l.msec) : l.timer_id = -1, lt(e) ? Ft(nt(e), o, {}, e) : qt(e, o, {}), l.periodic || -1 !== l.timer_id || xe(e) && Ge(e), 0;
|
|
2002
2003
|
}
|
|
2003
2004
|
var Br = {
|
|
2004
2005
|
mt_create: function(e) {
|
|
2005
2006
|
let t = e.priv;
|
|
2006
2007
|
const n = St(e, "subscriber");
|
|
2007
|
-
n && Yt(e, null, {}, n), t.periodic =
|
|
2008
|
+
n && Yt(e, null, {}, n), t.periodic = yt(e, "periodic"), t.msec = vt(e, "msec");
|
|
2008
2009
|
},
|
|
2009
2010
|
mt_writing: function(e, t) {
|
|
2010
2011
|
let n = e.priv;
|
|
2011
2012
|
switch (t) {
|
|
2012
2013
|
case "periodic":
|
|
2013
|
-
n.periodic =
|
|
2014
|
+
n.periodic = yt(e, "periodic");
|
|
2014
2015
|
break;
|
|
2015
2016
|
case "msec": n.msec = vt(e, "msec"), -1 !== n.timer_id && (clearTimeout(n.timer_id), n.timer_id = -1), n.msec > 0 && (n.timer_id = setTimeout(function() {
|
|
2016
2017
|
Ft(e, "EV_TIMEOUT", {}, e);
|
|
2017
|
-
}, n.msec)), n.msec > 0 ?
|
|
2018
|
+
}, n.msec)), n.msec > 0 ? xe(e) || Pe(e) : xe(e) && Ge(e);
|
|
2018
2019
|
}
|
|
2019
2020
|
},
|
|
2020
2021
|
mt_start: function(e) {
|
|
@@ -2026,10 +2027,10 @@
|
|
|
2026
2027
|
mt_destroy: function(e) {}
|
|
2027
2028
|
};
|
|
2028
2029
|
function Jr(e, t) {
|
|
2029
|
-
return e instanceof O ? "C_TIMER" !== Ze(e) ? (dn("not C_TIMER GObj"), -1) : (
|
|
2030
|
+
return e instanceof O ? "C_TIMER" !== Ze(e) ? (dn("not C_TIMER GObj"), -1) : (wt(e, "periodic", !1), void Rt(e, "msec", t)) : (dn("not GObj TYPE"), -1);
|
|
2030
2031
|
}
|
|
2031
2032
|
function Hr(e, t) {
|
|
2032
|
-
return e instanceof O ? "C_TIMER" !== Ze(e) ? (dn("not C_TIMER GObj"), -1) : (
|
|
2033
|
+
return e instanceof O ? "C_TIMER" !== Ze(e) ? (dn("not C_TIMER GObj"), -1) : (wt(e, "periodic", !0), void Rt(e, "msec", t)) : (dn("not GObj TYPE"), -1);
|
|
2033
2034
|
}
|
|
2034
2035
|
function qr(e) {
|
|
2035
2036
|
return e instanceof O ? "C_TIMER" !== Ze(e) ? (dn("not C_TIMER GObj"), -1) : void Rt(e, "msec", -1) : (dn("not GObj TYPE"), -1);
|
|
@@ -2048,8 +2049,8 @@
|
|
|
2048
2049
|
j(E.DTP_STRING, "yuno_version", 0, "", "Yuno version (APP_VERSION)"),
|
|
2049
2050
|
j(E.DTP_STRING, "yuneta_version", 0, s, "Yuneta version"),
|
|
2050
2051
|
j(E.DTP_LIST, "required_services", 0, "[]", "Required services"),
|
|
2051
|
-
j(E.DTP_DICT, "trace_levels",
|
|
2052
|
-
j(E.DTP_DICT, "no_trace_levels",
|
|
2052
|
+
j(E.DTP_DICT, "trace_levels", T.SDF_PERSIST, "{}", "Trace levels"),
|
|
2053
|
+
j(E.DTP_DICT, "no_trace_levels", T.SDF_PERSIST, "{}", "No trace levels"),
|
|
2053
2054
|
j(E.DTP_POINTER, "trace_ievent_callback", 0, null, "Where the traffic trace goes (C_IEVENT_CLI levels ievents/ievents2); console when null"),
|
|
2054
2055
|
j(E.DTP_BOOLEAN, "developer", 0, !1, "Developer mode enabled"),
|
|
2055
2056
|
j(E.DTP_INTEGER, "periodic_timeout", 0, "1000", "Timeout periodic, in miliseconds."),
|
|
@@ -2073,17 +2074,17 @@
|
|
|
2073
2074
|
var rl = {
|
|
2074
2075
|
mt_create: function(e) {
|
|
2075
2076
|
let t = e.priv;
|
|
2076
|
-
Dt(e, "start_date",
|
|
2077
|
+
Dt(e, "start_date", wr()), Dt(e, "node_uuid", Dr()), e.priv.gobj_timer = Ce(Xe(e), "C_TIMER", {}, e), t.periodic_timeout = Et(e, "periodic_timeout"), function(e) {
|
|
2077
2078
|
let t = Et(e, "trace_levels");
|
|
2078
2079
|
if (!Cn(t)) return 0;
|
|
2079
2080
|
let n = t.__global_trace__;
|
|
2080
|
-
if (
|
|
2081
|
+
if (Ln(n)) {
|
|
2081
2082
|
Z(4294967295, !1);
|
|
2082
2083
|
for (let e of n) Q(e, !0);
|
|
2083
2084
|
}
|
|
2084
2085
|
for (const [n, r] of Object.entries(t)) {
|
|
2085
2086
|
let t = Se(n);
|
|
2086
|
-
if (t) if (
|
|
2087
|
+
if (t) if (Ln(r)) {
|
|
2087
2088
|
se(t, null, !1);
|
|
2088
2089
|
for (let e of r) se(t, e, !0);
|
|
2089
2090
|
} else dn(`${Xe(e)}: trace_levels of ${n} MUST be a list`);
|
|
@@ -2092,13 +2093,13 @@
|
|
|
2092
2093
|
let t = Et(e, "no_trace_levels");
|
|
2093
2094
|
if (!Cn(t)) return 0;
|
|
2094
2095
|
let n = t.__global_no_trace__;
|
|
2095
|
-
if (
|
|
2096
|
+
if (Ln(n)) {
|
|
2096
2097
|
ee(4294967295, !1);
|
|
2097
2098
|
for (let e of n) X(e, !0);
|
|
2098
2099
|
}
|
|
2099
2100
|
for (const [n, r] of Object.entries(t)) {
|
|
2100
2101
|
let t = Se(n);
|
|
2101
|
-
if (t) if (
|
|
2102
|
+
if (t) if (Ln(r)) {
|
|
2102
2103
|
ie(t, null, !1);
|
|
2103
2104
|
for (let e of r) ie(t, e, !0);
|
|
2104
2105
|
} else dn(`${Xe(e)}: no_trace_levels of ${n} MUST be a list`);
|
|
@@ -2115,10 +2116,10 @@
|
|
|
2115
2116
|
mt_destroy: function(e) {},
|
|
2116
2117
|
mt_play: function(e) {
|
|
2117
2118
|
let t = Oe();
|
|
2118
|
-
return
|
|
2119
|
+
return xe(t) || Pe(t), Je(t) || We(t), 0;
|
|
2119
2120
|
},
|
|
2120
2121
|
mt_pause: function(e) {
|
|
2121
|
-
return
|
|
2122
|
+
return Ke(Oe()), 0;
|
|
2122
2123
|
},
|
|
2123
2124
|
mt_command_parser: function(e, t, n, r) {
|
|
2124
2125
|
switch (n = n || {}, t) {
|
|
@@ -2144,20 +2145,20 @@
|
|
|
2144
2145
|
}
|
|
2145
2146
|
};
|
|
2146
2147
|
var ll = "ievent_gate_stack", ol = [
|
|
2147
|
-
j(E.DTP_STRING, "wanted_yuno_role",
|
|
2148
|
-
j(E.DTP_STRING, "wanted_yuno_name",
|
|
2149
|
-
j(E.DTP_STRING, "wanted_yuno_service",
|
|
2150
|
-
j(E.DTP_STRING, "remote_yuno_role",
|
|
2151
|
-
j(E.DTP_STRING, "remote_yuno_name",
|
|
2152
|
-
j(E.DTP_STRING, "remote_yuno_service",
|
|
2153
|
-
j(E.DTP_STRING, "url",
|
|
2154
|
-
j(E.DTP_STRING, "jwt",
|
|
2155
|
-
j(E.DTP_STRING, "cert_pem",
|
|
2156
|
-
j(E.DTP_JSON, "extra_info",
|
|
2157
|
-
j(E.DTP_LIST, "required_services",
|
|
2158
|
-
j(E.DTP_INTEGER, "timeout_retry",
|
|
2159
|
-
j(E.DTP_INTEGER, "timeout_retry_max",
|
|
2160
|
-
j(E.DTP_INTEGER, "timeout_idack",
|
|
2148
|
+
j(E.DTP_STRING, "wanted_yuno_role", T.SDF_RD, "", "wanted yuno role"),
|
|
2149
|
+
j(E.DTP_STRING, "wanted_yuno_name", T.SDF_RD, "", "wanted yuno name"),
|
|
2150
|
+
j(E.DTP_STRING, "wanted_yuno_service", T.SDF_RD, "", "wanted yuno service"),
|
|
2151
|
+
j(E.DTP_STRING, "remote_yuno_role", T.SDF_RD, "", "confirmed remote yuno role"),
|
|
2152
|
+
j(E.DTP_STRING, "remote_yuno_name", T.SDF_RD, "", "confirmed remote yuno name"),
|
|
2153
|
+
j(E.DTP_STRING, "remote_yuno_service", T.SDF_RD, "", "confirmed remote yuno service"),
|
|
2154
|
+
j(E.DTP_STRING, "url", T.SDF_RD, "", "Url to connect"),
|
|
2155
|
+
j(E.DTP_STRING, "jwt", T.SDF_PERSIST, "", "JWT"),
|
|
2156
|
+
j(E.DTP_STRING, "cert_pem", T.SDF_PERSIST, "", "SSL server certification, PEM str format"),
|
|
2157
|
+
j(E.DTP_JSON, "extra_info", T.SDF_RD, "{}", "dict data set by user, added to the identity card msg."),
|
|
2158
|
+
j(E.DTP_LIST, "required_services", T.SDF_RD, "[]", "Services this LINK requires (identity card). Empty = the yuno's `required_services`, as before. A yuno with several links to DIFFERENT backends must set it per link: the yuno-wide list is the union, so every backend is told the service names of all the others."),
|
|
2159
|
+
j(E.DTP_INTEGER, "timeout_retry", T.SDF_RD, "5000", "First reconnect delay (ms). It BACKS OFF from here, doubling up to timeout_retry_max, and resets when a session is reached"),
|
|
2160
|
+
j(E.DTP_INTEGER, "timeout_retry_max", T.SDF_RD, "60000", "Cap of the reconnect backoff (ms). Set it equal to timeout_retry for the old fixed-interval behaviour"),
|
|
2161
|
+
j(E.DTP_INTEGER, "timeout_idack", T.SDF_RD, "5000", "timeout waiting idAck"),
|
|
2161
2162
|
j(E.DTP_POINTER, "subscriber", 0, 0, "subscriber of output-events. If null then subscriber is the parent"),
|
|
2162
2163
|
v()
|
|
2163
2164
|
], sl = [
|
|
@@ -2166,7 +2167,7 @@
|
|
|
2166
2167
|
["identity-card", "Trace identity_card messages"]
|
|
2167
2168
|
];
|
|
2168
2169
|
function il(e) {
|
|
2169
|
-
return !!(3 &
|
|
2170
|
+
return !!(3 & K(e));
|
|
2170
2171
|
}
|
|
2171
2172
|
var _l = {
|
|
2172
2173
|
url: null,
|
|
@@ -2197,7 +2198,7 @@
|
|
|
2197
2198
|
data: n.data
|
|
2198
2199
|
}, e);
|
|
2199
2200
|
}, n.onclose = (n) => {
|
|
2200
|
-
ot(e) || (
|
|
2201
|
+
ot(e) || (yt(He(), "browser_beforeunload") ? bn("Close websocket by unload page") : Ft(e, "EV_ON_CLOSE", {
|
|
2201
2202
|
url: t,
|
|
2202
2203
|
e: n
|
|
2203
2204
|
}, e));
|
|
@@ -2215,7 +2216,7 @@
|
|
|
2215
2216
|
} else bn("WebSocket is already closed or in the process of closing.");
|
|
2216
2217
|
}
|
|
2217
2218
|
function fl(e, t, n) {
|
|
2218
|
-
let r =
|
|
2219
|
+
let r = wr();
|
|
2219
2220
|
try {
|
|
2220
2221
|
pn("\n" + r + " " + t + "\n"), hn(n);
|
|
2221
2222
|
} catch (e) {
|
|
@@ -2279,22 +2280,22 @@
|
|
|
2279
2280
|
language: "undefined" != typeof window ? window.navigator.language : "",
|
|
2280
2281
|
required_services: i
|
|
2281
2282
|
};
|
|
2282
|
-
return hr(e, _, ll, bl(e, Xe(nt(e)), null)),
|
|
2283
|
+
return hr(e, _, ll, bl(e, Xe(nt(e)), null)), Tr(e, _, "__identity__"), Jr(t.gobj_timer, vt(e, "timeout_idack")), dl(e, "EV_IDENTITY_CARD", _);
|
|
2283
2284
|
}
|
|
2284
2285
|
function ml(e, t) {
|
|
2285
2286
|
if (Wn(t.event)) return -1;
|
|
2286
2287
|
let n = {}, r = t.__global__, l = t.__config__, o = t.__filter__, s = t.__service__, i = t.subscriber;
|
|
2287
2288
|
l && (n.__config__ = l), r && (n.__global__ = r), o && (n.__filter__ = o);
|
|
2288
|
-
return hr(e, n, ll, bl(e, Xe(i), s)),
|
|
2289
|
+
return hr(e, n, ll, bl(e, Xe(i), s)), Tr(e, n, "__subscribing__"), dl(e, t.event, n);
|
|
2289
2290
|
}
|
|
2290
2291
|
function hl(e, t, n, r) {
|
|
2291
2292
|
let l = e.priv;
|
|
2292
|
-
return
|
|
2293
|
+
return xe(e) && (l.websocket = ul(e)), 0;
|
|
2293
2294
|
}
|
|
2294
2295
|
function El(e, t, n, r) {
|
|
2295
2296
|
return pn("Websocket opened: " + e.priv.url), pl(e), 0;
|
|
2296
2297
|
}
|
|
2297
|
-
function
|
|
2298
|
+
function Tl(e, t, n, r) {
|
|
2298
2299
|
let l = e.priv, o = n.e, s = n.url;
|
|
2299
2300
|
return fn(), bn(`${et(e)}: WebSocket closed ${s} (Code: ${o.code}, Reason: "${o.reason}", Clean: ${o.wasClean})`), 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, qt(e, "EV_ON_CLOSE", {
|
|
2300
2301
|
url: s,
|
|
@@ -2309,7 +2310,7 @@
|
|
|
2309
2310
|
code: o.code,
|
|
2310
2311
|
reason: o.reason,
|
|
2311
2312
|
was_clean: o.wasClean
|
|
2312
|
-
})),
|
|
2313
|
+
})), xe(e) && Jr(l.gobj_timer, function(e) {
|
|
2313
2314
|
let t = e.priv, n = vt(e, "timeout_retry"), r = vt(e, "timeout_retry_max");
|
|
2314
2315
|
r < n && (r = n);
|
|
2315
2316
|
t.retry_ms = t.retry_ms ? Math.min(2 * t.retry_ms, r) : n;
|
|
@@ -2317,7 +2318,7 @@
|
|
|
2317
2318
|
return Math.max(1, Math.round(o));
|
|
2318
2319
|
}(e)), 0;
|
|
2319
2320
|
}
|
|
2320
|
-
function
|
|
2321
|
+
function yl(e, t, n, r) {
|
|
2321
2322
|
return pl(e), 0;
|
|
2322
2323
|
}
|
|
2323
2324
|
function vl(e, t, n, r) {
|
|
@@ -2387,14 +2388,14 @@
|
|
|
2387
2388
|
return cl(e), -1;
|
|
2388
2389
|
}
|
|
2389
2390
|
o = null;
|
|
2390
|
-
let _ =
|
|
2391
|
+
let _ = yr(e, i), a = Er(e, i, ll), u = Zn(e, a, "dst_role", "");
|
|
2391
2392
|
if (u.toLowerCase() !== ze().toLowerCase()) return dn(`"It's not my role, dst_role: ${u}, my_role: ${ze()}`), 0;
|
|
2392
2393
|
let c = Zn(e, a, "dst_service", "");
|
|
2393
2394
|
if ("__subscribing__" === _) return -1;
|
|
2394
2395
|
if ("__unsubscribing__" === _) return -1;
|
|
2395
2396
|
if (It(e, s, D.EVF_PUBLIC_EVENT)) return Ft(e, s, i, e), 0;
|
|
2396
2397
|
if (!Wn(c)) {
|
|
2397
|
-
let t =
|
|
2398
|
+
let t = Ne(c, !1);
|
|
2398
2399
|
return t ? It(t, s, D.EVF_PUBLIC_EVENT) ? (Ft(t, s, i, e), 0) : (dn(`${et(e)}: Service found but no event or not public, service '${et(t)}', ev '${s}'`), -1) : (bn(`${et(e)}: event for a service that is gone, DROPPED: service '${c}', ev '${s}'`), 0);
|
|
2399
2400
|
}
|
|
2400
2401
|
return lt(e) ? Ft(nt(e), s, i, e) : qt(e, s, i), 0;
|
|
@@ -2405,7 +2406,7 @@
|
|
|
2405
2406
|
function Ol(e, t, n, r) {
|
|
2406
2407
|
return 0;
|
|
2407
2408
|
}
|
|
2408
|
-
var
|
|
2409
|
+
var Nl = {
|
|
2409
2410
|
mt_create: function(e) {
|
|
2410
2411
|
let t = e.priv;
|
|
2411
2412
|
t.gobj_timer = Ce(Xe(e), "C_TIMER", {}, e), t.url = jt(e, "url"), t.remote_yuno_name = jt(e, "remote_yuno_name"), t.remote_yuno_role = jt(e, "remote_yuno_role"), t.remote_yuno_service = jt(e, "remote_yuno_service"), Dt(e, "wanted_yuno_name", t.remote_yuno_name), Dt(e, "wanted_yuno_role", t.remote_yuno_role), Dt(e, "wanted_yuno_service", t.remote_yuno_service);
|
|
@@ -2443,7 +2444,7 @@
|
|
|
2443
2444
|
return o || (o = {}), hr(e, n, "stats_stack", {
|
|
2444
2445
|
stats: t,
|
|
2445
2446
|
kw: o
|
|
2446
|
-
}), hr(e, n, ll, l), n.__stats__ = t,
|
|
2447
|
+
}), hr(e, n, ll, l), n.__stats__ = t, Tr(e, n, "__stats__"), dl(e, "EV_MT_STATS", n, r), null;
|
|
2447
2448
|
},
|
|
2448
2449
|
mt_command_parser: function(e, t, n, r) {
|
|
2449
2450
|
if ("ST_SESSION" !== kt(e)) return dn("Not in session"), null;
|
|
@@ -2452,7 +2453,7 @@
|
|
|
2452
2453
|
return o || (o = {}), hr(e, n, "command_stack", {
|
|
2453
2454
|
command: t,
|
|
2454
2455
|
kw: o
|
|
2455
|
-
}), hr(e, n, ll, l), n.__command__ = t,
|
|
2456
|
+
}), hr(e, n, ll, l), n.__command__ = t, Tr(e, n, "__command__"), dl(e, "EV_MT_COMMAND", n, r), null;
|
|
2456
2457
|
},
|
|
2457
2458
|
mt_inject_event: function(e, t, n, r) {
|
|
2458
2459
|
if ("ST_SESSION" !== kt(e)) return window.console.error("Not in session"), -1;
|
|
@@ -2461,7 +2462,7 @@
|
|
|
2461
2462
|
let l = bl(e, Xe(r), Zn(e, n, "__service__", 0, 0));
|
|
2462
2463
|
On(n, "__service__"), hr(e, n, "__message__", t), hr(e, n, ll, l);
|
|
2463
2464
|
}
|
|
2464
|
-
return
|
|
2465
|
+
return Tr(e, n, "__message__"), dl(e, t, n, r);
|
|
2465
2466
|
},
|
|
2466
2467
|
mt_subscription_added: function(e, t) {
|
|
2467
2468
|
let n = e.priv;
|
|
@@ -2474,10 +2475,10 @@
|
|
|
2474
2475
|
if (Wn(t.event)) return 0;
|
|
2475
2476
|
let r = {}, l = t.__global__, o = t.__config__, s = t.__filter__, i = t.__service__, _ = t.subscriber;
|
|
2476
2477
|
o && (r.__config__ = o), l && (r.__global__ = l), s && (r.__filter__ = s);
|
|
2477
|
-
return hr(e, r, ll, bl(e, Xe(_), i)),
|
|
2478
|
+
return hr(e, r, ll, bl(e, Xe(_), i)), Tr(e, r, "__unsubscribing__"), dl(e, t.event, r, e);
|
|
2478
2479
|
}
|
|
2479
2480
|
};
|
|
2480
|
-
e.GObj = O, e.SDATA = j, e.SDATAAUTHZ = (e, t, n, r, l, o) => new
|
|
2481
|
+
e.GObj = O, e.SDATA = j, e.SDATAAUTHZ = (e, t, n, r, l, o) => new y(e, t, n, null, o, r, null, 0, null, l, null), e.SDATACM = (e, t, n, r, l, o) => new y(e, t, 0, null, o, n, null, 0, l, r, null), e.SDATACM2 = (e, t, n, r, l, o, s) => new y(e, t, n, null, s, r, null, 0, o, l, null), e.SDATADF = (e, t, n, r, l, o) => new y(e, t, n, null, o, null, r, l), e.SDATAPM = (e, t, n, r, l) => new y(e, t, n, r, l), e.SDATAPM0 = (e, t, n, r, l) => new y(e, t, n, null, l, null, null, 0, null, null, r), e.SDATA_END = v, e.SDataDesc = y, e.YUNETA_VERSION = s, Object.defineProperty(e, "__yuno__", {
|
|
2481
2482
|
enumerable: !0,
|
|
2482
2483
|
get: function() {
|
|
2483
2484
|
return p;
|
|
@@ -2497,16 +2498,16 @@
|
|
|
2497
2498
|
for (const n of Object.keys(l[e])) t += `${n}: ${l[e][n]};`;
|
|
2498
2499
|
i.style.cssText = t;
|
|
2499
2500
|
} else "style" === e ? i.style.cssText = l[e] : "i18n" === e || "data-i18n" === e || "data_i18next" === e || "data-i18next" === e ? null !== l[e] && void 0 !== l[e] && (_ = l[e], i.setAttribute("data-i18n", _)) : i.setAttribute(e, l[e]);
|
|
2500
|
-
if (
|
|
2501
|
+
if (Pn(o)) if (o = o.trim(), o.length > 0 && "<" === o[0]) i.appendChild(Nr(o));
|
|
2501
2502
|
else if (n && _) i.textContent = n(_) || o;
|
|
2502
2503
|
else i.textContent = o;
|
|
2503
|
-
else if (
|
|
2504
|
-
if (o.length > 0) if (
|
|
2504
|
+
else if (Ln(o)) {
|
|
2505
|
+
if (o.length > 0) if (Pn(o[0])) i.appendChild(e(o, n));
|
|
2505
2506
|
else for (let t of o) Array.isArray(t) && t.length > 0 ? i.appendChild(e(t, n)) : t instanceof HTMLElement && i.appendChild(t);
|
|
2506
2507
|
} else o instanceof HTMLElement || o instanceof Text || o instanceof SVGElement ? i.appendChild(o) : null != o && (dn("content ignored"), hn(o));
|
|
2507
2508
|
if (s && "object" == typeof s) for (const e of Object.keys(s)) i.addEventListener(e, s[e]);
|
|
2508
2509
|
return i;
|
|
2509
|
-
}, e.createOneHtml =
|
|
2510
|
+
}, e.createOneHtml = Nr, e.create_json_record = function(e, t) {
|
|
2510
2511
|
let n = En(e);
|
|
2511
2512
|
return vn(n, t), n;
|
|
2512
2513
|
}, e.create_template_record = function(e, t) {
|
|
@@ -2517,21 +2518,21 @@
|
|
|
2517
2518
|
let o = nr(null, t, e, l);
|
|
2518
2519
|
n[e] = o;
|
|
2519
2520
|
}), n;
|
|
2520
|
-
}, e.current_timestamp =
|
|
2521
|
-
let n = ar(
|
|
2521
|
+
}, e.current_timestamp = wr, e.data_type_t = E, e.db_list_persistent_attrs = function(e, t) {
|
|
2522
|
+
let n = ar(Pr(e), null, !1), r = {};
|
|
2522
2523
|
return n && Cn(n) && (r = ir(e, n, t, !1)), r;
|
|
2523
2524
|
}, e.db_load_persistent_attrs = function(e, t) {
|
|
2524
|
-
let n =
|
|
2525
|
+
let n = Tt(e, T.SDF_PERSIST), r = ar(Pr(e), null, !1);
|
|
2525
2526
|
if (r && Cn(r)) {
|
|
2526
2527
|
let l = ir(e, r, t, !1);
|
|
2527
|
-
l = ir(e, l, n, !1),
|
|
2528
|
+
l = ir(e, l, n, !1), Nt(e, l, T.SDF_PERSIST);
|
|
2528
2529
|
}
|
|
2529
2530
|
}, e.db_remove_persistent_attrs = function(e, t) {
|
|
2530
|
-
let n = _r(e, ar(
|
|
2531
|
-
0 === kn(n) ? cr(
|
|
2531
|
+
let n = _r(e, ar(Pr(e), null, !1), t, !1);
|
|
2532
|
+
0 === kn(n) ? cr(Pr(e)) : ur(Pr(e), n);
|
|
2532
2533
|
}, e.db_save_persistent_attrs = function(e, t) {
|
|
2533
|
-
let n = ir(e,
|
|
2534
|
-
return r && Cn(r) && jn(n, r), ur(
|
|
2534
|
+
let n = ir(e, Tt(e, T.SDF_PERSIST), t, !1), r = ar(Pr(e), null, !1);
|
|
2535
|
+
return r && Cn(r) && jn(n, r), ur(Pr(e), n);
|
|
2535
2536
|
}, e.debounce = function(e, t = 0, n = !1) {
|
|
2536
2537
|
let r = null, l = null, o = null;
|
|
2537
2538
|
const s = (...s) => {
|
|
@@ -2611,7 +2612,7 @@
|
|
|
2611
2612
|
removed: {},
|
|
2612
2613
|
changed: {}
|
|
2613
2614
|
};
|
|
2614
|
-
for (const e of Object.keys(n)) Object.prototype.hasOwnProperty.call(r, e) ?
|
|
2615
|
+
for (const e of Object.keys(n)) Object.prototype.hasOwnProperty.call(r, e) ? Lr(n[e], r[e]) || (l.changed[e] = {
|
|
2615
2616
|
from: n[e],
|
|
2616
2617
|
to: r[e]
|
|
2617
2618
|
}) : l.removed[e] = n[e];
|
|
@@ -2619,7 +2620,7 @@
|
|
|
2619
2620
|
return l;
|
|
2620
2621
|
}, e.flat_key_join = function(e) {
|
|
2621
2622
|
return Array.isArray(e) && 0 !== e.length ? e.map((e) => "number" == typeof e ? `[${e}]` : Ir(e)).join("`") : "";
|
|
2622
|
-
}, e.flat_key_split = Cr, e.gclass_add_ev_action = Ee, e.gclass_add_event_type =
|
|
2623
|
+
}, e.flat_key_split = Cr, e.gclass_add_ev_action = Ee, e.gclass_add_event_type = ye, e.gclass_add_state = he, e.gclass_check_fsm = je, e.gclass_create = de, e.gclass_event_type = ve, e.gclass_find_by_name = Se, e.gclass_flag_t = N, e.gclass_unregister = be, e.getPositionRelativeToBody = function(e) {
|
|
2623
2624
|
if (!e) return {
|
|
2624
2625
|
top: 0,
|
|
2625
2626
|
left: 0,
|
|
@@ -2644,38 +2645,38 @@
|
|
|
2644
2645
|
return ot(e) ? (dn("gobj NULL or DESTROYED"), null) : t instanceof O ? (e.parent && e.parent.mt_child_removed && e.parent.mt_child_removed(e.parent, e), e.parent && (De(e.parent, e), e.parent = null), Re(t, e), t.mt_child_added && (Y(e) && pn(n("👦👦🔵 child_added(%s): %s", tt(t), et(e))), t.mt_child_added(t, e)), 0) : (dn(`${et(e)}: gobj_change_parent() BAD TYPE of parent`), -1);
|
|
2645
2646
|
}, e.gobj_change_state = At, e.gobj_command = function(e, t, r, o) {
|
|
2646
2647
|
return ot(e) ? (dn("gobj NULL or DESTROYED"), -1) : ((function(e) {
|
|
2647
|
-
return V > 1 || !!e && !!(
|
|
2648
|
-
}(e) || q(e, null) && !z(o, null)) && (
|
|
2648
|
+
return V > 1 || !!e && !!(K(e) & P.TRACE_COMMANDS);
|
|
2649
|
+
}(e) || q(e, null) && !z(o, null)) && (L(n("🌀🌀 mach(%s%s), cmd: %s, src: %s", xe(e) ? "" : "!!", et(e), t, et(o))), H(e) && hn(r)), e.gclass.gmt.mt_command_parser ? e.gclass.gmt.mt_command_parser(e, t, r, o) : e.gclass.command_table ? c ? c(e, t, r, o) : l(0, -1, n("%s: global command parser not available", et(e)), 0, 0) : l(0, -1, n("%s: command table not available", et(e)), 0, 0));
|
|
2649
2650
|
}, e.gobj_create = function(e, t, n, r) {
|
|
2650
2651
|
return Ie(e, t, n, r, 0);
|
|
2651
2652
|
}, e.gobj_create2 = Ie, e.gobj_create_default_service = function(e, t, n, r) {
|
|
2652
|
-
return Ie(e, t, n, r,
|
|
2653
|
+
return Ie(e, t, n, r, w.gobj_flag_default_service | w.gobj_flag_autostart);
|
|
2653
2654
|
}, e.gobj_create_pure_child = Ce, e.gobj_create_service = function(e, t, n, r) {
|
|
2654
|
-
return Ie(e, t, n, r,
|
|
2655
|
+
return Ie(e, t, n, r, w.gobj_flag_service);
|
|
2655
2656
|
}, e.gobj_create_volatil = function(e, t, n, r) {
|
|
2656
|
-
return Ie(e, t, n, r,
|
|
2657
|
+
return Ie(e, t, n, r, w.gobj_flag_volatil);
|
|
2657
2658
|
}, e.gobj_create_yuno = function(e, t, n) {
|
|
2658
|
-
return Ie(e, t, n, null,
|
|
2659
|
-
}, e.gobj_current_state = kt, e.gobj_default_service = Oe, e.gobj_deliver_posted_events = Ut, e.gobj_destroy =
|
|
2659
|
+
return Ie(e, t, n, null, w.gobj_flag_yuno);
|
|
2660
|
+
}, e.gobj_current_state = kt, e.gobj_default_service = Oe, e.gobj_deliver_posted_events = Ut, e.gobj_destroy = Le, e.gobj_find_child = pt, e.gobj_find_gobj = function(e, t) {
|
|
2660
2661
|
if (Wn(t)) return null;
|
|
2661
2662
|
const n = t.toLowerCase();
|
|
2662
2663
|
return "__default_service__" === n ? m : "__yuno__" === n || "__root__" === n ? p : mt(p, t);
|
|
2663
|
-
}, e.gobj_find_service =
|
|
2664
|
+
}, e.gobj_find_service = Ne, e.gobj_find_subscribings = Ht, e.gobj_find_subscriptions = Jt, e.gobj_flag_t = w, e.gobj_full_name = tt, e.gobj_gclass_name = Ze, e.gobj_get_gclass_trace_level = re, e.gobj_get_gclass_trace_level2 = le, e.gobj_get_gclass_trace_no_level = oe, e.gobj_get_global_trace_level = te, e.gobj_get_global_trace_no_level = ne, e.gobj_global_trace_level = function() {
|
|
2664
2665
|
return F;
|
|
2665
2666
|
}, e.gobj_global_trace_no_level = function() {
|
|
2666
2667
|
return G;
|
|
2667
|
-
}, e.gobj_has_attr = ht, e.gobj_has_event = It, e.gobj_has_output_event = Ct, e.gobj_hsdata = ce, e.gobj_is_destroying = ot, e.gobj_is_playing = Je, e.gobj_is_pure_child = lt, e.gobj_is_running =
|
|
2668
|
+
}, e.gobj_has_attr = ht, e.gobj_has_event = It, e.gobj_has_output_event = Ct, e.gobj_hsdata = ce, e.gobj_is_destroying = ot, e.gobj_is_playing = Je, e.gobj_is_pure_child = lt, e.gobj_is_running = xe, e.gobj_is_service = Be, e.gobj_is_volatil = rt, e.gobj_list_persistent_attrs = function(e, t) {
|
|
2668
2669
|
return u ? u(e, t) : null;
|
|
2669
2670
|
}, e.gobj_list_subscriptions = function(e) {
|
|
2670
2671
|
let t = Jt(e, null, null, null);
|
|
2671
2672
|
for (let n = 0; n < t.length; n++) {
|
|
2672
2673
|
let r = t[n], l = er(e, r, "publisher", null, zt.KW_REQUIRED), o = er(e, r, "subscriber", null, zt.KW_REQUIRED);
|
|
2673
|
-
|
|
2674
|
+
wn(r, "s_event", Zn(e, r, "event", "", zt.KW_REQUIRED)), wn(r, "s_publisher", et(l)), wn(r, "s_subscriber", et(o));
|
|
2674
2675
|
}
|
|
2675
2676
|
let n = Ht(e, 0, null, 0);
|
|
2676
2677
|
for (let t = 0; t < n.length; t++) {
|
|
2677
2678
|
let r = n[t], l = er(e, r, "publisher", null, zt.KW_REQUIRED), o = er(e, r, "subscriber", null, zt.KW_REQUIRED);
|
|
2678
|
-
|
|
2679
|
+
wn(r, "s_event", Zn(e, r, "event", "", zt.KW_REQUIRED)), wn(r, "s_publisher", et(l)), wn(r, "s_subscriber", et(o));
|
|
2679
2680
|
}
|
|
2680
2681
|
return {
|
|
2681
2682
|
subscriptions: t,
|
|
@@ -2705,16 +2706,16 @@
|
|
|
2705
2706
|
bt(o, t) && n.push(o), e(n, o);
|
|
2706
2707
|
}
|
|
2707
2708
|
}(n, e), n;
|
|
2708
|
-
}, e.gobj_match_gobj = bt, e.gobj_name = Xe, e.gobj_parent = nt, e.gobj_pause =
|
|
2709
|
-
return e && e instanceof O ? e.obflag & (R.obflag_destroyed | R.obflag_destroying) ? (dn(`gobj_post_event(): gobj dst DESTROYING, event ${t}`), -1) : Wn(t) ? (dn("gobj_post_event(): event EMPTY"), -1) : It(e, t, 0) ?
|
|
2709
|
+
}, e.gobj_match_gobj = bt, e.gobj_name = Xe, e.gobj_parent = nt, e.gobj_pause = Ke, e.gobj_play = We, e.gobj_post_event = function(e, t, r, l) {
|
|
2710
|
+
return e && e instanceof O ? e.obflag & (R.obflag_destroyed | R.obflag_destroying) ? (dn(`gobj_post_event(): gobj dst DESTROYING, event ${t}`), -1) : Wn(t) ? (dn("gobj_post_event(): event EMPTY"), -1) : It(e, t, 0) ? Lt.length >= 1e4 ? (dn(`gobj_post_event(): too many posted events, this is NOT a work queue, event ${t}, pending ${Lt.length}`), -1) : (Lt.push({
|
|
2710
2711
|
dst: e,
|
|
2711
2712
|
event: t,
|
|
2712
2713
|
kw: r,
|
|
2713
2714
|
src: l
|
|
2714
|
-
}), q(e, t) && !z(l, t) &&
|
|
2715
|
+
}), q(e, t) && !z(l, t) && L(n("📬 posted(%s%s), ev: %s, pending: %d", e.running ? "" : "!!", et(e), t, Lt.length)), Pt || (Pt = !0, setTimeout(Ut, 0)), 0) : (dn(`gobj_post_event(): event NOT DEFINED in gclass ${Ze(e)}, event ${t}`), -1) : (dn(`gobj_post_event(): gobj dst NULL, event ${t}`), -1);
|
|
2715
2716
|
}, e.gobj_posted_events_size = function() {
|
|
2716
|
-
return
|
|
2717
|
-
}, e.gobj_publish_event = qt, e.gobj_read_attr = Et, e.gobj_read_attrs =
|
|
2717
|
+
return Lt.length;
|
|
2718
|
+
}, e.gobj_publish_event = qt, e.gobj_read_attr = Et, e.gobj_read_attrs = Tt, e.gobj_read_bool_attr = yt, e.gobj_read_integer_attr = vt, e.gobj_read_pointer_attr = St, e.gobj_read_str_attr = jt, e.gobj_remove_persistent_attrs = function(e, t) {
|
|
2718
2719
|
return Be(e) ? a ? a(e, t) : -1 : (dn(`${et(e)}: Only gobj services can load/save writable-persistent`), -1);
|
|
2719
2720
|
}, e.gobj_repr_global_trace_levels = function() {
|
|
2720
2721
|
return U.map(([e, t, n]) => ({
|
|
@@ -2735,7 +2736,7 @@
|
|
|
2735
2736
|
}
|
|
2736
2737
|
}
|
|
2737
2738
|
return 0;
|
|
2738
|
-
}(e,
|
|
2739
|
+
}(e, T.SDF_VOLATIL, 0);
|
|
2739
2740
|
}, e.gobj_save_persistent_attrs = Ae, e.gobj_search_path = mt, e.gobj_send_event = Ft, e.gobj_services = function() {
|
|
2740
2741
|
let e = [];
|
|
2741
2742
|
for (const t of Object.keys(b)) Dn(e, t);
|
|
@@ -2752,25 +2753,25 @@
|
|
|
2752
2753
|
return r ? (n ? e.trace_level |= r : e.trace_level &= ~r, 0) : -1;
|
|
2753
2754
|
}, e.gobj_set_trace_machine_format = function(e) {
|
|
2754
2755
|
C = 1 === Number(e) ? 1 : 0;
|
|
2755
|
-
}, e.gobj_short_name = et, e.gobj_start =
|
|
2756
|
+
}, e.gobj_short_name = et, e.gobj_start = Pe, e.gobj_start_children = function(e) {
|
|
2756
2757
|
return ot(e) ? (dn("gobj NULL or DESTROYED"), -1) : at(e, A.WALK_FIRST2LAST, Ue, 0, 0);
|
|
2757
2758
|
}, e.gobj_start_tree = function(e) {
|
|
2758
|
-
return ot(e) ? (dn("gobj NULL or DESTROYED"), -1) : (J(e) &&
|
|
2759
|
+
return ot(e) ? (dn("gobj NULL or DESTROYED"), -1) : (J(e) && L(n("⏺ ⏺ ⏺ ⏺ start_tree: %s", tt(e))), e.gclass.gclass_flag & N.gcflag_manual_start || e.disabled ? 0 : (e.running || Pe(e), ut(e, A.WALK_TOP2BOTTOM, Fe, 0, 0)));
|
|
2759
2760
|
}, e.gobj_start_up = function(e, t, n, r, l, o, s) {
|
|
2760
2761
|
i = t, _ = n, a = r, u = l, c = o, f = s;
|
|
2761
2762
|
const d = [["EV_STATE_CHANGED", D.EVF_SYSTEM_EVENT | D.EVF_OUTPUT_EVENT | D.EVF_NO_WARN_SUBS], [0, 0]];
|
|
2762
2763
|
for (let e = 0; e < d.length; e++) {
|
|
2763
2764
|
let t = d[e][0], n = d[e][1];
|
|
2764
|
-
|
|
2765
|
+
Te(g, t, n);
|
|
2765
2766
|
}
|
|
2766
2767
|
return 0;
|
|
2767
2768
|
}, e.gobj_stats = function(e, t, r, l) {
|
|
2768
2769
|
return ot(e) ? (dn("gobj NULL or DESTROYED"), -1) : e.gclass.gmt.mt_stats ? e.gclass.gmt.mt_stats(e, t, r, l) : f ? f(e, t, r, l) : o(0, -1, n("%s, stats parser not available", et(e)), 0, 0);
|
|
2769
2770
|
}, e.gobj_stop = Ge, e.gobj_stop_children = Me, e.gobj_stop_tree = function(e) {
|
|
2770
|
-
return ot(e) ? (dn("gobj NULL or DESTROYED"), -1) : (J(e) &&
|
|
2771
|
-
}, e.gobj_subscribe_event = Yt, e.gobj_trace_level =
|
|
2771
|
+
return ot(e) ? (dn("gobj NULL or DESTROYED"), -1) : (J(e) && L(n("⏹ ⏹ ⏹ ⏹ stop_tree: %s", tt(e))), xe(e) && Ge(e), ut(e, A.WALK_TOP2BOTTOM, Ve, 0, 0));
|
|
2772
|
+
}, e.gobj_subscribe_event = Yt, e.gobj_trace_level = K, e.gobj_trace_machine_format = function() {
|
|
2772
2773
|
return C;
|
|
2773
|
-
}, e.gobj_trace_no_level =
|
|
2774
|
+
}, e.gobj_trace_no_level = x, e.gobj_unsubscribe_event = function(e, t, n, r) {
|
|
2774
2775
|
if (null == n && (n = {}), !e) return dn(`publisher NULL: ev ${t}`), 0;
|
|
2775
2776
|
if (!r) return dn(`subscriber NULL: ev ${t}`), 0;
|
|
2776
2777
|
const l = /* @__PURE__ */ new Set([
|
|
@@ -2783,37 +2784,37 @@
|
|
|
2783
2784
|
if (Object.keys(n).forEach((n) => {
|
|
2784
2785
|
l.has(n) || dn(`${et(e)}: key ignored in subscription (key: ${n}, event: ${t})`);
|
|
2785
2786
|
}), Wn(t)) t = "";
|
|
2786
|
-
else if (!(Ct(e, t, D.EVF_OUTPUT_EVENT) || e.gclass.gclass_flag &
|
|
2787
|
+
else if (!(Ct(e, t, D.EVF_OUTPUT_EVENT) || e.gclass.gclass_flag & N.gcflag_no_check_output_events)) return dn(`event NOT in output event list: ${et(e)}, ev ${t}`), 0;
|
|
2787
2788
|
let o = Wt(e.dl_subscriptions, e, t, n, r), s = 0;
|
|
2788
2789
|
for (let t = 0; t < o.length; t++) {
|
|
2789
2790
|
let n = o[t];
|
|
2790
|
-
|
|
2791
|
+
xt(e, n, !1, !1), s++;
|
|
2791
2792
|
}
|
|
2792
2793
|
return s || (bn(`${et(e)}: No subscription found`), hn(n, "No subscription found")), 0;
|
|
2793
|
-
}, e.gobj_unsubscribe_list = Bt, e.gobj_walk_gobj_children = at, e.gobj_walk_gobj_children_tree = ut, e.gobj_write_attr = Ot, e.gobj_write_attrs =
|
|
2794
|
+
}, e.gobj_unsubscribe_list = Bt, e.gobj_walk_gobj_children = at, e.gobj_walk_gobj_children_tree = ut, e.gobj_write_attr = Ot, e.gobj_write_attrs = Nt, e.gobj_write_bool_attr = wt, e.gobj_write_integer_attr = Rt, e.gobj_write_str_attr = Dt, e.gobj_yuno = He, e.gobj_yuno_id = Qe, e.gobj_yuno_name = qe, e.gobj_yuno_role = ze, e.id_index_in_obj_list = dr, e.index_in_list = Rr, e.is_array = Ln, e.is_boolean = Fn, e.is_date = function(e) {
|
|
2794
2795
|
return e instanceof Date && !isNaN(e);
|
|
2795
2796
|
}, e.is_function = Vn, e.is_gobj = Mn, e.is_metadata_key = function(e) {
|
|
2796
|
-
if (!
|
|
2797
|
+
if (!Pn(e)) return !1;
|
|
2797
2798
|
let t;
|
|
2798
2799
|
for (t = 0; t < e.length && "_" === e[t] && !(t > 2); t++);
|
|
2799
2800
|
return 2 === t;
|
|
2800
2801
|
}, e.is_null = Gn, e.is_number = Un, e.is_object = Cn, e.is_private_key = function(e) {
|
|
2801
|
-
if (!
|
|
2802
|
+
if (!Pn(e)) return !1;
|
|
2802
2803
|
let t;
|
|
2803
2804
|
for (t = 0; t < e.length && "_" === e[t] && !(t > 2); t++);
|
|
2804
2805
|
return 1 === t;
|
|
2805
2806
|
}, e.is_pure_number = function(e) {
|
|
2806
2807
|
if (Un(e)) return !0;
|
|
2807
|
-
if (!
|
|
2808
|
+
if (!Pn(e)) return !1;
|
|
2808
2809
|
const t = Number(e);
|
|
2809
2810
|
return !isNaN(t) && "" !== e.trim() && !isNaN(t);
|
|
2810
|
-
}, e.is_string =
|
|
2811
|
+
}, e.is_string = Pn, e.jdb_delete = function(e, t, n, r) {
|
|
2811
2812
|
let l = nr(null, nr(null, e, "topics", null, 0), t, null, 0);
|
|
2812
2813
|
if (!l) return dn("jdb_delete: topic not found: " + t), null;
|
|
2813
2814
|
if (Wn(r.id)) return dn("jdb_delete: record without id: " + r), mn(r), null;
|
|
2814
2815
|
let o, s = n.split("`"), i = l;
|
|
2815
2816
|
for (; (o = s.shift()) && !Wn(o) && i;) Cn(i) && (i = nr(null, i, e.hook, null, 0)), i = jr(i, null, o, !1);
|
|
2816
|
-
if (0 === s.length && i) if (
|
|
2817
|
+
if (0 === s.length && i) if (Ln(i)) {
|
|
2817
2818
|
let e = dr(i, r.id);
|
|
2818
2819
|
e >= 0 && i.splice(e, 1);
|
|
2819
2820
|
} else {
|
|
@@ -2845,7 +2846,7 @@
|
|
|
2845
2846
|
if (Wn(r.id)) return dn("jdb_update: record without id: " + r), mn(r), null;
|
|
2846
2847
|
let o, s = n.split("`"), i = l;
|
|
2847
2848
|
for (; (o = s.shift()) && !Wn(o) && i;) Cn(i) && (i = nr(null, i, e.hook, [], 1)), i = jr(i, null, o, !1);
|
|
2848
|
-
if (0 === s.length && i) if (
|
|
2849
|
+
if (0 === s.length && i) if (Ln(i)) i.push(r);
|
|
2849
2850
|
else if (i.id === r.id) Object.assign(i, r);
|
|
2850
2851
|
else {
|
|
2851
2852
|
let t = nr(null, i, e.hook, [], 1), n = jr(t, e.hook, r.id, !1);
|
|
@@ -2875,7 +2876,7 @@
|
|
|
2875
2876
|
return null == e || n(e, "", 0), t;
|
|
2876
2877
|
}, e.json_array_append = Rn, e.json_array_append_new = Dn, e.json_array_extend = function(e, t) {
|
|
2877
2878
|
return t ? (Array.prototype.push.apply(e, t), e) : e;
|
|
2878
|
-
}, e.json_array_remove = An, e.json_array_size = $n, e.json_deep_copy = En, e.json_is_identical =
|
|
2879
|
+
}, e.json_array_remove = An, e.json_array_size = $n, e.json_deep_copy = En, e.json_is_identical = Tn, e.json_object_del = On, e.json_object_get = Sn, e.json_object_set = Nn, e.json_object_set_new = wn, e.json_object_size = kn, e.json_object_update = yn, e.json_object_update_existing = vn, e.json_object_update_missing = jn, e.json_size = In, e.jwt2json = function(e, t) {
|
|
2879
2880
|
try {
|
|
2880
2881
|
let n = Sr(e);
|
|
2881
2882
|
switch (t) {
|
|
@@ -2890,7 +2891,7 @@
|
|
|
2890
2891
|
if (e && !Mn(e) && dn("GObj bad instanceof"), !t) return null;
|
|
2891
2892
|
r || (r = sr);
|
|
2892
2893
|
let l = [];
|
|
2893
|
-
if (
|
|
2894
|
+
if (Ln(t)) for (let e = 0; e < t.length; e++) {
|
|
2894
2895
|
let o = t[e];
|
|
2895
2896
|
r(o, n) && l.push(o);
|
|
2896
2897
|
}
|
|
@@ -2900,21 +2901,14 @@
|
|
|
2900
2901
|
}
|
|
2901
2902
|
return l;
|
|
2902
2903
|
}, e.kw_delete = zn, e.kw_find_json_in_list = function(e, t, n, r) {
|
|
2903
|
-
if (!n || !
|
|
2904
|
-
for (let e = 0; e < t.length; e++) if (
|
|
2904
|
+
if (!n || !Ln(t)) return r && dn("item NULL or kw_list is not a list"), -1;
|
|
2905
|
+
for (let e = 0; e < t.length; e++) if (Tn(n, t[e])) return e;
|
|
2905
2906
|
return r && dn("item not found in this list"), -1;
|
|
2906
2907
|
}, e.kw_find_path = qn, e.kw_flag_t = zt, e.kw_get_bool = Qn, e.kw_get_dict = tr, e.kw_get_dict_value = nr, e.kw_get_int = Xn, e.kw_get_list = function(e, t, n, r, l) {
|
|
2907
2908
|
e && !Mn(e) && dn("GObj bad instanceof");
|
|
2908
2909
|
let o = qn(e, t, n, !1);
|
|
2909
2910
|
const s = l && l & zt.KW_REQUIRED, i = l && l & zt.KW_CREATE, _ = l && l & zt.KW_EXTRACT;
|
|
2910
|
-
|
|
2911
|
-
if (i) {
|
|
2912
|
-
let l = Array(r);
|
|
2913
|
-
return rr(e, t, n, l), l;
|
|
2914
|
-
}
|
|
2915
|
-
return s && (dn(`path not found: '${n}'`), hn(t)), Array(r);
|
|
2916
|
-
}
|
|
2917
|
-
return _ && zn(e, t, n), Pn(o) ? Array(o) : (s && (dn(`path value MUST BE an array: ${n}`), mn(t)), Array(r));
|
|
2911
|
+
return void 0 === o ? i && Ln(r) && t ? (rr(e, t, n, r), r) : (s && (dn(`path not found: '${n}'`), hn(t)), r) : Ln(o) ? (_ && zn(e, t, n), o) : (s && (dn(`${et(e)}: path value MUST BE an array: ${n}`), mn(t)), r);
|
|
2918
2912
|
}, e.kw_get_local_storage_value = ar, e.kw_get_pointer = er, e.kw_get_real = function(e, t, n, r, l) {
|
|
2919
2913
|
e && !Mn(e) && dn("GObj bad instanceof");
|
|
2920
2914
|
let o = qn(e, t, n, !1);
|
|
@@ -2931,7 +2925,7 @@
|
|
|
2931
2925
|
if (e && !Mn(e) && dn("GObj bad instanceof"), !t) return null;
|
|
2932
2926
|
r || (r = sr);
|
|
2933
2927
|
let l = [];
|
|
2934
|
-
if (
|
|
2928
|
+
if (Ln(t)) for (let e = 0; e < t.length; e++) {
|
|
2935
2929
|
let o = t[e];
|
|
2936
2930
|
r(o, n) && l.push(En(o));
|
|
2937
2931
|
}
|
|
@@ -2947,10 +2941,10 @@
|
|
|
2947
2941
|
}, e.kwid_get_ids = function(e, t) {
|
|
2948
2942
|
if (e && !Mn(e) && dn("GObj bad instanceof"), !t) return [];
|
|
2949
2943
|
let n = [];
|
|
2950
|
-
if (
|
|
2944
|
+
if (Pn(t)) n.push(t);
|
|
2951
2945
|
else if (Cn(t)) for (let e in t) t.hasOwnProperty(e) && n.push(e);
|
|
2952
|
-
else
|
|
2953
|
-
if (
|
|
2946
|
+
else Ln(t) && t.forEach(function(t) {
|
|
2947
|
+
if (Pn(t)) Wn(t) || n.push(t);
|
|
2954
2948
|
else if (Cn(t)) {
|
|
2955
2949
|
let r = Zn(e, t, "id", 0, 0);
|
|
2956
2950
|
r && n.push(r);
|
|
@@ -2961,14 +2955,14 @@
|
|
|
2961
2955
|
e && !Mn(e) && dn("GObj bad instanceof");
|
|
2962
2956
|
let r = {};
|
|
2963
2957
|
if (Wn(n) || (t = qn(e, t, n)), Cn(t)) r = t;
|
|
2964
|
-
else if (
|
|
2958
|
+
else if (Ln(t)) for (let n = 0; n < t.length; n++) {
|
|
2965
2959
|
let l = t[n], o = Zn(e, l, "id", "", zt.KW_REQUIRED);
|
|
2966
2960
|
Wn(o) || (r[o] = l);
|
|
2967
2961
|
}
|
|
2968
2962
|
else dn(`${et(e)} kwid_new_dict: data type unknown`);
|
|
2969
2963
|
return r;
|
|
2970
2964
|
}, e.kwid_new_list = function(e, t, n) {
|
|
2971
|
-
if (e && !Mn(e) && dn("GObj bad instanceof"), Wn(n) || (t = qn(e, t, n)),
|
|
2965
|
+
if (e && !Mn(e) && dn("GObj bad instanceof"), Wn(n) || (t = qn(e, t, n)), Ln(t)) return t;
|
|
2972
2966
|
if (Cn(t)) {
|
|
2973
2967
|
let n = [];
|
|
2974
2968
|
for (let r of Object.keys(t)) {
|
|
@@ -2981,9 +2975,9 @@
|
|
|
2981
2975
|
}, e.list2options = function(e, t, n) {
|
|
2982
2976
|
t = t || "id", n = n || "value";
|
|
2983
2977
|
let r = [];
|
|
2984
|
-
if (
|
|
2978
|
+
if (Ln(e)) for (let l = 0; l < e.length; l++) {
|
|
2985
2979
|
let o = e[l];
|
|
2986
|
-
if (
|
|
2980
|
+
if (Pn(o)) r.push({
|
|
2987
2981
|
id: e[l],
|
|
2988
2982
|
value: e[l]
|
|
2989
2983
|
});
|
|
@@ -3026,9 +3020,9 @@
|
|
|
3026
3020
|
var e;
|
|
3027
3021
|
}, r.send();
|
|
3028
3022
|
}, e.log_debug = pn, e.log_error = dn, e.log_info = function(e) {
|
|
3029
|
-
let t = gn(e), n =
|
|
3023
|
+
let t = gn(e), n = wr();
|
|
3030
3024
|
en && _n("info", t) && en("%c" + n + " INFO: " + String(t), "color:cyan"), un("info", t, n);
|
|
3031
|
-
}, e.log_warning = bn, e.msg_iev_get_msg_type =
|
|
3025
|
+
}, e.log_warning = bn, e.msg_iev_get_msg_type = yr, e.msg_iev_get_stack = Er, e.msg_iev_push_stack = hr, e.msg_iev_read_key = pr, e.msg_iev_set_msg_type = Tr, e.msg_iev_write_key = mr, e.node_uuid = Dr, e.parseBoolean = Kn, e.parseSVG = function(e) {
|
|
3032
3026
|
return new DOMParser().parseFromString(e, "image/svg+xml").firstChild;
|
|
3033
3027
|
}, e.refresh_language = function(e, t) {
|
|
3034
3028
|
if (!Vn(t)) return void dn("You must supply a translation function");
|
|
@@ -3065,7 +3059,7 @@
|
|
|
3065
3059
|
],
|
|
3066
3060
|
[
|
|
3067
3061
|
"EV_ON_CLOSE",
|
|
3068
|
-
|
|
3062
|
+
Tl,
|
|
3069
3063
|
null
|
|
3070
3064
|
],
|
|
3071
3065
|
[
|
|
@@ -3092,12 +3086,12 @@
|
|
|
3092
3086
|
],
|
|
3093
3087
|
[
|
|
3094
3088
|
"EV_ON_CLOSE",
|
|
3095
|
-
|
|
3089
|
+
Tl,
|
|
3096
3090
|
"ST_DISCONNECTED"
|
|
3097
3091
|
],
|
|
3098
3092
|
[
|
|
3099
3093
|
"EV_TIMEOUT",
|
|
3100
|
-
|
|
3094
|
+
yl,
|
|
3101
3095
|
null
|
|
3102
3096
|
],
|
|
3103
3097
|
[
|
|
@@ -3124,7 +3118,7 @@
|
|
|
3124
3118
|
],
|
|
3125
3119
|
[
|
|
3126
3120
|
"EV_ON_CLOSE",
|
|
3127
|
-
|
|
3121
|
+
Tl,
|
|
3128
3122
|
"ST_DISCONNECTED"
|
|
3129
3123
|
],
|
|
3130
3124
|
[
|
|
@@ -3146,21 +3140,21 @@
|
|
|
3146
3140
|
["EV_ON_OPEN_ERROR", D.EVF_OUTPUT_EVENT | D.EVF_NO_WARN_SUBS],
|
|
3147
3141
|
["EV_TIMEOUT", 0],
|
|
3148
3142
|
[null, 0]
|
|
3149
|
-
], t,
|
|
3143
|
+
], t, Nl, 0, ol, _l, 0, 0, sl, N.gcflag_no_check_output_events)) ? 0 : -1;
|
|
3150
3144
|
}("C_IEVENT_CLI");
|
|
3151
3145
|
}, e.register_c_timer = function() {
|
|
3152
3146
|
return function(e) {
|
|
3153
|
-
if (
|
|
3147
|
+
if (xr) return dn(`GClass ALREADY created: ${e}`), -1;
|
|
3154
3148
|
const t = [["ST_IDLE", [[
|
|
3155
3149
|
"EV_TIMEOUT",
|
|
3156
3150
|
Yr,
|
|
3157
3151
|
null
|
|
3158
3152
|
]]]];
|
|
3159
|
-
return (
|
|
3153
|
+
return (xr = de(e, [
|
|
3160
3154
|
["EV_TIMEOUT", D.EVF_OUTPUT_EVENT],
|
|
3161
3155
|
["EV_TIMEOUT_PERIODIC", D.EVF_OUTPUT_EVENT],
|
|
3162
3156
|
[0, 0]
|
|
3163
|
-
], t, Br, 0, Wr,
|
|
3157
|
+
], t, Br, 0, Wr, Kr, 0, 0, 0, N.gcflag_manual_start)) ? 0 : -1;
|
|
3164
3158
|
}("C_TIMER");
|
|
3165
3159
|
}, e.register_c_yuno = function() {
|
|
3166
3160
|
return function(e) {
|
|
@@ -3176,7 +3170,7 @@
|
|
|
3176
3170
|
if (!e) return "";
|
|
3177
3171
|
const t = String(e).trim();
|
|
3178
3172
|
return /^javascript:/i.test(t) || /^data:/i.test(t) ? "" : Or(t);
|
|
3179
|
-
}, e.sdata_flag_t =
|
|
3173
|
+
}, e.sdata_flag_t = T, e.send_http_json_post = function(e, t, n) {
|
|
3180
3174
|
let r = new XMLHttpRequest();
|
|
3181
3175
|
r.open("POST", e), r.setRequestHeader("Accept", "application/json"), r.setRequestHeader("Content-Type", "application/json"), r.onreadystatechange = function() {
|
|
3182
3176
|
4 === r.readyState && n(r.status, r.responseText);
|
|
@@ -3198,7 +3192,7 @@
|
|
|
3198
3192
|
cn(e, r, n);
|
|
3199
3193
|
}
|
|
3200
3194
|
} else nn = e;
|
|
3201
|
-
}, e.set_remote_log_functions = fn, e.set_timeout = Jr, e.set_timeout_periodic = Hr, e.sprintf = n, e.stats_parser = function(e, t, n, r) {}, e.str_in_list = br, e.strcasecmp = Yn, e.strcmp =
|
|
3195
|
+
}, e.set_remote_log_functions = fn, e.set_timeout = Jr, e.set_timeout_periodic = Hr, e.sprintf = n, e.stats_parser = function(e, t, n, r) {}, e.str_in_list = br, e.strcasecmp = Yn, e.strcmp = xn, e.strncmp = function(e, t, n) {
|
|
3202
3196
|
var r = (e + "").substring(0, n), l = (t + "").substring(0, n);
|
|
3203
3197
|
return r === l ? 0 : r > l ? 1 : -1;
|
|
3204
3198
|
}, e.strs_in_list = function(e, t, n) {
|
|
@@ -3223,7 +3217,7 @@
|
|
|
3223
3217
|
placeholder: void 0,
|
|
3224
3218
|
fkey: null
|
|
3225
3219
|
};
|
|
3226
|
-
if (
|
|
3220
|
+
if (Pn(t)) {
|
|
3227
3221
|
let e = t.split(".");
|
|
3228
3222
|
for (let t = 0; t < e.length; t++) {
|
|
3229
3223
|
let r = e[t];
|
|
@@ -3241,7 +3235,7 @@
|
|
|
3241
3235
|
}
|
|
3242
3236
|
}
|
|
3243
3237
|
n.real_type || (n.real_type = "string");
|
|
3244
|
-
} else Cn(t) ? (n = Mr(t), n.name || (n.name = e), n.header || (n.header = e)) :
|
|
3238
|
+
} else Cn(t) ? (n = Mr(t), n.name || (n.name = e), n.header || (n.header = e)) : Ln(t) && (n.real_type = "array", n.enum_list = t);
|
|
3245
3239
|
return n.type || (n.type = n.real_type), n;
|
|
3246
3240
|
}, e.timeTracker = function(e = "Time Tracker", t = !1) {
|
|
3247
3241
|
const n = e, r = performance.now();
|
|
@@ -3253,8 +3247,8 @@
|
|
|
3253
3247
|
total: _
|
|
3254
3248
|
};
|
|
3255
3249
|
} };
|
|
3256
|
-
}, e.trace_json = hn, e.trace_level_t =
|
|
3257
|
-
if (
|
|
3250
|
+
}, e.trace_json = hn, e.trace_level_t = P, e.trace_msg = mn, e.treedb_decoder_fkey = Ur, e.treedb_decoder_hook = function(e, t) {
|
|
3251
|
+
if (Pn(t)) {
|
|
3258
3252
|
if (-1 === t.indexOf("^")) {
|
|
3259
3253
|
let n, r = e.hook;
|
|
3260
3254
|
if (1 !== kn(r)) return dn("bad hook 1"), dn(e), dn(t), null;
|
|
@@ -3283,7 +3277,7 @@
|
|
|
3283
3277
|
let n = Ur(e, t);
|
|
3284
3278
|
return n ? n.topic_name + "^" + n.id + "^" + n.hook_name : null;
|
|
3285
3279
|
}, e.treedb_get_field_desc = Mr, e.treedb_hook_data_size = function(e) {
|
|
3286
|
-
if (
|
|
3280
|
+
if (Ln(e) && 1 === In(e)) {
|
|
3287
3281
|
let t = e[0];
|
|
3288
3282
|
return Hn(t, "size") ? t.size : 1;
|
|
3289
3283
|
}
|