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