@yuneta/gobj-js 7.26.2 → 7.26.3
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 +80 -6
- package/dist/gobj-js.cjs.js.map +1 -1
- package/dist/gobj-js.cjs.min.js +183 -156
- package/dist/gobj-js.cjs.min.js.map +1 -1
- package/dist/gobj-js.es.js +77 -7
- package/dist/gobj-js.es.js.map +1 -1
- package/dist/gobj-js.es.min.js +238 -208
- package/dist/gobj-js.es.min.js.map +1 -1
- package/dist/gobj-js.iife.js +80 -6
- package/dist/gobj-js.iife.js.map +1 -1
- package/dist/gobj-js.iife.min.js +183 -156
- package/dist/gobj-js.iife.min.js.map +1 -1
- package/dist/gobj-js.umd.js +80 -6
- package/dist/gobj-js.umd.js.map +1 -1
- package/dist/gobj-js.umd.min.js +183 -156
- package/dist/gobj-js.umd.min.js.map +1 -1
- package/package.json +1 -1
package/dist/gobj-js.umd.min.js
CHANGED
|
@@ -666,7 +666,7 @@
|
|
|
666
666
|
t.parent && hn(`_add_child() ALREADY HAS PARENT: ${t.gobj_name}`), e.dl_children.push(t), t.parent = e;
|
|
667
667
|
}
|
|
668
668
|
function $e(e, t) {
|
|
669
|
-
let n =
|
|
669
|
+
let n = el(e.dl_children, t);
|
|
670
670
|
n >= 0 && (Hn(e.dl_children, n), t.parent = null);
|
|
671
671
|
}
|
|
672
672
|
function De(e, t) {
|
|
@@ -1098,7 +1098,7 @@
|
|
|
1098
1098
|
if (1 === C) L(n("🔄 %s %s%s %s from %s%s", t || "", e.running ? "" : "!!", et(e), o.state_name, l && !l.running ? "!!" : "", et(l)));
|
|
1099
1099
|
else {
|
|
1100
1100
|
let r = "";
|
|
1101
|
-
i.action && (r =
|
|
1101
|
+
i.action && (r = nl(i.action)), L(n("🔄 mach(%s%s^%s), st: %s, ev: %s%s%s, ac: %s, from(%s%s^%s)", e.running ? "" : "!!", Ze(e), Xe(e), o.state_name, "", t || "", "", r, l && !l.running ? "!!" : "", Ze(l), Xe(l)));
|
|
1102
1102
|
}
|
|
1103
1103
|
r && q(e) && zn(r) && Un(r);
|
|
1104
1104
|
}
|
|
@@ -1404,23 +1404,23 @@
|
|
|
1404
1404
|
return n;
|
|
1405
1405
|
}
|
|
1406
1406
|
function hn(e, ...t) {
|
|
1407
|
-
let n = mn(e, ...t), r =
|
|
1407
|
+
let n = mn(e, ...t), r = Zr();
|
|
1408
1408
|
tn && (tn === en.error ? cn("error", n) && tn("%c" + r + " ERROR: " + String(n), "color:red") : (cn("error", n) && en.error("%c" + r + " ERROR: " + String(n), "color:red"), tn(`${r} ERROR: ${String(n)}`))), gn("error", n, r);
|
|
1409
1409
|
}
|
|
1410
1410
|
function yn(e, ...t) {
|
|
1411
|
-
let n = mn(e, ...t), r =
|
|
1411
|
+
let n = mn(e, ...t), r = Zr();
|
|
1412
1412
|
nn && (nn === en.warn ? cn("warning", n) && nn("%c" + r + " WARNING: " + String(n), "color:yellow") : (cn("warning", n) && en.warn("%c" + r + " WARNING: " + String(n), "color:yellow"), nn(`${r} WARNING: ${String(n)}`))), gn("warning", n, r);
|
|
1413
1413
|
}
|
|
1414
1414
|
function En(e, ...t) {
|
|
1415
|
-
let n = mn(e, ...t), r =
|
|
1415
|
+
let n = mn(e, ...t), r = Zr();
|
|
1416
1416
|
ln && cn("debug", n) && ln("%c" + r + " DEBUG: " + String(n), "color:silver"), gn("debug", n, r);
|
|
1417
1417
|
}
|
|
1418
1418
|
function Tn(e, ...t) {
|
|
1419
|
-
let n = mn(e, ...t), r =
|
|
1419
|
+
let n = mn(e, ...t), r = Zr();
|
|
1420
1420
|
ln && cn("msg", n) && ln("%c" + r + " MSG: " + String(n), "color:cyan"), gn("msg", n, r);
|
|
1421
1421
|
}
|
|
1422
1422
|
function vn(e, t) {
|
|
1423
|
-
cn("json", t) && (t && en.warn("=====> " + t), en.dir(e)), gn("json", e,
|
|
1423
|
+
cn("json", t) && (t && en.warn("=====> " + t), en.dir(e)), gn("json", e, Zr());
|
|
1424
1424
|
}
|
|
1425
1425
|
var jn = [
|
|
1426
1426
|
"passw",
|
|
@@ -2109,33 +2109,49 @@
|
|
|
2109
2109
|
function Br(e) {
|
|
2110
2110
|
return null == e ? "" : String(e).replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
2111
2111
|
}
|
|
2112
|
-
|
|
2112
|
+
var Jr = class {
|
|
2113
|
+
constructor(e) {
|
|
2114
|
+
this.html = e, Object.freeze(this);
|
|
2115
|
+
}
|
|
2116
|
+
toString() {
|
|
2117
|
+
return this.html;
|
|
2118
|
+
}
|
|
2119
|
+
};
|
|
2120
|
+
function qr(e) {
|
|
2121
|
+
return e instanceof Jr;
|
|
2122
|
+
}
|
|
2123
|
+
function Hr(e) {
|
|
2124
|
+
const t = document.createElement("template");
|
|
2125
|
+
return t.innerHTML = e.html.trim(), t.content;
|
|
2126
|
+
}
|
|
2127
|
+
var zr = !1, Qr = /* @__PURE__ */ new Set();
|
|
2128
|
+
function Xr(e) {
|
|
2113
2129
|
const t = document.createElement("template");
|
|
2114
2130
|
return t.innerHTML = e.trim(), t.content.firstChild;
|
|
2115
2131
|
}
|
|
2116
|
-
function
|
|
2132
|
+
function Zr(e) {
|
|
2117
2133
|
const t = (e, t) => String(e).padStart(t, "0"), n = `${(e = e || /* @__PURE__ */ new Date()).getFullYear()}-${t(e.getMonth() + 1, 2)}-${t(e.getDate(), 2)}T${t(e.getHours(), 2)}:${t(e.getMinutes(), 2)}:${t(e.getSeconds(), 2)}`, r = t(e.getMilliseconds(), 3), l = e.getTimezoneOffset();
|
|
2118
2134
|
return `${n}.${r}${l > 0 ? "-" : "+"}${t(Math.floor(Math.abs(l) / 60), 2)}${t(Math.abs(l) % 60, 2)}`;
|
|
2119
2135
|
}
|
|
2120
|
-
function
|
|
2136
|
+
function el(e, t) {
|
|
2121
2137
|
if (!e) throw "ERROR: index_in_list() list empty";
|
|
2122
2138
|
for (let n = 0; n < e.length; n++) if (t === e[n]) return n;
|
|
2123
2139
|
return -1;
|
|
2124
2140
|
}
|
|
2125
|
-
function
|
|
2141
|
+
function tl() {
|
|
2126
2142
|
let e = "";
|
|
2127
2143
|
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;
|
|
2128
2144
|
}
|
|
2129
|
-
function
|
|
2145
|
+
function nl(e) {
|
|
2130
2146
|
let t = null;
|
|
2131
2147
|
return "function" != typeof e && "object" != typeof e || (t = ("" + e).match(/function\s*([\w\$]*)\s*\(/)), null !== t ? t[1] + "()" : "";
|
|
2132
2148
|
}
|
|
2133
|
-
var
|
|
2134
|
-
function
|
|
2149
|
+
var rl = 256, ll = 1e5;
|
|
2150
|
+
function ol(e) {
|
|
2135
2151
|
const t = String(e).replace(/`/g, "``");
|
|
2136
2152
|
return "[" === t[0] ? "[" + t : t;
|
|
2137
2153
|
}
|
|
2138
|
-
function
|
|
2154
|
+
function sl(e) {
|
|
2139
2155
|
if ("string" != typeof e) return null;
|
|
2140
2156
|
let t = [], n = "";
|
|
2141
2157
|
for (let r = 0; r < e.length; r++) if ("`" !== e[r]) n += e[r];
|
|
@@ -2156,13 +2172,13 @@
|
|
|
2156
2172
|
return null !== t ? t : "[" === e[0] && "[" === e[1] ? e.slice(1) : e;
|
|
2157
2173
|
});
|
|
2158
2174
|
}
|
|
2159
|
-
function
|
|
2175
|
+
function il(e, t) {
|
|
2160
2176
|
return e === t || null !== e && null !== t && "object" == typeof e && "object" == typeof t && JSON.stringify(e) === JSON.stringify(t);
|
|
2161
2177
|
}
|
|
2162
|
-
function
|
|
2178
|
+
function _l(e) {
|
|
2163
2179
|
return "persistent-attrs-" + et(e);
|
|
2164
2180
|
}
|
|
2165
|
-
function
|
|
2181
|
+
function al(e, t) {
|
|
2166
2182
|
if (tr(t)) {
|
|
2167
2183
|
if (-1 === t.indexOf("^")) {
|
|
2168
2184
|
let n, r, l = e.fkey;
|
|
@@ -2192,7 +2208,7 @@
|
|
|
2192
2208
|
hook_name: t.hook_name
|
|
2193
2209
|
} : (hn("bad fkey 3"), hn(e), hn(t), null);
|
|
2194
2210
|
}
|
|
2195
|
-
var
|
|
2211
|
+
var ul = [
|
|
2196
2212
|
"string",
|
|
2197
2213
|
"integer",
|
|
2198
2214
|
"object",
|
|
@@ -2202,7 +2218,7 @@
|
|
|
2202
2218
|
"real",
|
|
2203
2219
|
"boolean",
|
|
2204
2220
|
"blob"
|
|
2205
|
-
],
|
|
2221
|
+
], cl = [
|
|
2206
2222
|
"persistent",
|
|
2207
2223
|
"required",
|
|
2208
2224
|
"notnull",
|
|
@@ -2214,7 +2230,7 @@
|
|
|
2214
2230
|
"stats",
|
|
2215
2231
|
"rstats",
|
|
2216
2232
|
"pstats"
|
|
2217
|
-
],
|
|
2233
|
+
], fl = [
|
|
2218
2234
|
"hook",
|
|
2219
2235
|
"fkey",
|
|
2220
2236
|
"enum",
|
|
@@ -2243,7 +2259,7 @@
|
|
|
2243
2259
|
"coordinates",
|
|
2244
2260
|
"gbuffer"
|
|
2245
2261
|
];
|
|
2246
|
-
function
|
|
2262
|
+
function gl(e) {
|
|
2247
2263
|
let t = {
|
|
2248
2264
|
name: e.id,
|
|
2249
2265
|
header: e.header,
|
|
@@ -2262,7 +2278,7 @@
|
|
|
2262
2278
|
if (!e.flag) return t;
|
|
2263
2279
|
for (let n = 0; n < e.flag.length; n++) {
|
|
2264
2280
|
let r = e.flag[n];
|
|
2265
|
-
if (Pr(
|
|
2281
|
+
if (Pr(fl, r)) {
|
|
2266
2282
|
switch (r) {
|
|
2267
2283
|
case "enum":
|
|
2268
2284
|
t.enum_list = e.enum;
|
|
@@ -2276,7 +2292,7 @@
|
|
|
2276
2292
|
case "file": t.is_file = !0;
|
|
2277
2293
|
}
|
|
2278
2294
|
t.type = r;
|
|
2279
|
-
} else if (Pr(
|
|
2295
|
+
} else if (Pr(cl, r)) switch (r) {
|
|
2280
2296
|
case "writable":
|
|
2281
2297
|
t.is_writable = !0;
|
|
2282
2298
|
break;
|
|
@@ -2289,23 +2305,23 @@
|
|
|
2289
2305
|
}
|
|
2290
2306
|
return t.is_file && (t.type = "file"), t;
|
|
2291
2307
|
}
|
|
2292
|
-
var
|
|
2308
|
+
var dl = [
|
|
2293
2309
|
j(y.DTP_POINTER, "subscriber", 0, null, "Subscriber of output events"),
|
|
2294
2310
|
j(y.DTP_BOOLEAN, "periodic", 0, 0, "True for periodic timeouts"),
|
|
2295
2311
|
j(y.DTP_INTEGER, "msec", 0, 0, "Timeout in milliseconds"),
|
|
2296
2312
|
v()
|
|
2297
|
-
],
|
|
2313
|
+
], bl = {
|
|
2298
2314
|
periodic: !1,
|
|
2299
2315
|
msec: 0,
|
|
2300
2316
|
timer_id: -1
|
|
2301
|
-
},
|
|
2302
|
-
function
|
|
2317
|
+
}, pl = null;
|
|
2318
|
+
function ml(e, t, n, r) {
|
|
2303
2319
|
let l = e.priv, o = l.periodic ? "EV_TIMEOUT_PERIODIC" : "EV_TIMEOUT";
|
|
2304
2320
|
return l.periodic && l.msec > 0 ? l.timer_id = setTimeout(function() {
|
|
2305
2321
|
Vt(e, "EV_TIMEOUT", {}, e);
|
|
2306
2322
|
}, l.msec) : l.timer_id = -1, lt(e) ? Vt(nt(e), o, {}, e) : Xt(e, o, {}), l.periodic || -1 !== l.timer_id || Ke(e) && Ve(e), 0;
|
|
2307
2323
|
}
|
|
2308
|
-
var
|
|
2324
|
+
var hl = {
|
|
2309
2325
|
mt_create: function(e) {
|
|
2310
2326
|
let t = e.priv;
|
|
2311
2327
|
const n = Ot(e, "subscriber");
|
|
@@ -2330,16 +2346,16 @@
|
|
|
2330
2346
|
},
|
|
2331
2347
|
mt_destroy: function(e) {}
|
|
2332
2348
|
};
|
|
2333
|
-
function
|
|
2349
|
+
function yl(e, t) {
|
|
2334
2350
|
return e instanceof S ? "C_TIMER" !== Ze(e) ? (hn("not C_TIMER GObj"), -1) : (Nt(e, "periodic", !1), void Rt(e, "msec", t)) : (hn("not GObj TYPE"), -1);
|
|
2335
2351
|
}
|
|
2336
|
-
function
|
|
2352
|
+
function El(e, t) {
|
|
2337
2353
|
return e instanceof S ? "C_TIMER" !== Ze(e) ? (hn("not C_TIMER GObj"), -1) : (Nt(e, "periodic", !0), void Rt(e, "msec", t)) : (hn("not GObj TYPE"), -1);
|
|
2338
2354
|
}
|
|
2339
|
-
function
|
|
2355
|
+
function Tl(e) {
|
|
2340
2356
|
return e instanceof S ? "C_TIMER" !== Ze(e) ? (hn("not C_TIMER GObj"), -1) : void Rt(e, "msec", -1) : (hn("not GObj TYPE"), -1);
|
|
2341
2357
|
}
|
|
2342
|
-
var
|
|
2358
|
+
var vl = [
|
|
2343
2359
|
j(y.DTP_BOOLEAN, "changesLost", 0, !1, "Set true to warn about leaving page"),
|
|
2344
2360
|
j(y.DTP_BOOLEAN, "browser_beforeunload", 0, !1, "Set true to refreshing browser"),
|
|
2345
2361
|
j(y.DTP_STRING, "__username__", 0, "", "Username"),
|
|
@@ -2359,26 +2375,26 @@
|
|
|
2359
2375
|
j(y.DTP_BOOLEAN, "developer", 0, !1, "Developer mode enabled"),
|
|
2360
2376
|
j(y.DTP_INTEGER, "periodic_timeout", 0, "1000", "Timeout periodic, in miliseconds."),
|
|
2361
2377
|
v()
|
|
2362
|
-
],
|
|
2363
|
-
function
|
|
2378
|
+
], jl = { gobj_timer: null }, Ol = null;
|
|
2379
|
+
function Sl(e, t, n, r) {
|
|
2364
2380
|
let l = yt(e, t);
|
|
2365
2381
|
return Zn(l) || (l = {}), l[n] = r, St(e, t, l), De(e, t);
|
|
2366
2382
|
}
|
|
2367
|
-
function
|
|
2383
|
+
function wl(e) {
|
|
2368
2384
|
if (!0 === e || !1 === e) return e;
|
|
2369
2385
|
let t = String(null == e ? "" : e).toLowerCase();
|
|
2370
2386
|
return "true" === t || "set" === t || "false" !== t && "reset" !== t && ("" === t || isNaN(Number(t)) ? null : !!Number(t));
|
|
2371
2387
|
}
|
|
2372
|
-
function
|
|
2388
|
+
function Nl() {
|
|
2373
2389
|
return `${ze()}^${He()}`;
|
|
2374
2390
|
}
|
|
2375
|
-
function
|
|
2391
|
+
function Rl(e, t, n, r) {
|
|
2376
2392
|
return Xt(e, t, n), 0;
|
|
2377
2393
|
}
|
|
2378
|
-
var
|
|
2394
|
+
var $l = {
|
|
2379
2395
|
mt_create: function(e) {
|
|
2380
2396
|
let t = e.priv;
|
|
2381
|
-
$t(e, "start_date",
|
|
2397
|
+
$t(e, "start_date", Zr()), $t(e, "node_uuid", tl()), e.priv.gobj_timer = Ce(Xe(e), "C_TIMER", {}, e), t.periodic_timeout = yt(e, "periodic_timeout"), function(e) {
|
|
2382
2398
|
let t = yt(e, "trace_levels");
|
|
2383
2399
|
if (!Zn(t)) return 0;
|
|
2384
2400
|
let n = t.__global_trace__;
|
|
@@ -2412,10 +2428,10 @@
|
|
|
2412
2428
|
},
|
|
2413
2429
|
mt_writing: function(e, t) {},
|
|
2414
2430
|
mt_start: function(e) {
|
|
2415
|
-
return
|
|
2431
|
+
return El(e.priv.gobj_timer, e.priv.periodic_timeout), 0;
|
|
2416
2432
|
},
|
|
2417
2433
|
mt_stop: function(e) {
|
|
2418
|
-
return
|
|
2434
|
+
return Tl(e.priv.gobj_timer), Me(e), 0;
|
|
2419
2435
|
},
|
|
2420
2436
|
mt_destroy: function(e) {},
|
|
2421
2437
|
mt_play: function(e) {
|
|
@@ -2432,24 +2448,24 @@
|
|
|
2432
2448
|
case "get-global-no-trace": return l(0, 0, null, null, ne());
|
|
2433
2449
|
case "set-global-trace":
|
|
2434
2450
|
case "set-global-no-trace": {
|
|
2435
|
-
let r = "set-global-no-trace" === t, o = n.level, s =
|
|
2436
|
-
return o ? null === s ? l(0, -1, `${
|
|
2451
|
+
let r = "set-global-no-trace" === t, o = n.level, s = wl(n.set);
|
|
2452
|
+
return o ? null === s ? l(0, -1, `${Nl()}: bitmask set or re-set?`, null, null) : (r ? X(o, s) : Q(o, s)) < 0 ? l(0, -1, `${Nl()}: global trace level not found: ${o}`, null, null) : r ? (Sl(e, "no_trace_levels", "__global_no_trace__", ne()), l(0, 0, null, null, ne())) : (Sl(e, "trace_levels", "__global_trace__", te()), l(0, 0, null, null, te())) : l(0, -1, `${Nl()}: what level?`, null, null);
|
|
2437
2453
|
}
|
|
2438
2454
|
case "get-gclass-trace":
|
|
2439
2455
|
case "get-gclass-no-trace":
|
|
2440
2456
|
case "set-gclass-trace":
|
|
2441
2457
|
case "set-gclass-no-trace": {
|
|
2442
2458
|
let r = t.indexOf("no-trace") >= 0, o = n.gclass_name || n.gclass || "", s = Oe(o);
|
|
2443
|
-
if (!s) return l(0, -1, `${
|
|
2459
|
+
if (!s) return l(0, -1, `${Nl()}: what gclass is '${o}'?`, null, null);
|
|
2444
2460
|
if (0 === t.indexOf("get-")) return l(0, 0, null, null, r ? oe(s) : re(s));
|
|
2445
|
-
let i = n.level, _ =
|
|
2446
|
-
return i ? null === _ ? l(0, -1, `${
|
|
2461
|
+
let i = n.level, _ = wl(n.set);
|
|
2462
|
+
return i ? null === _ ? l(0, -1, `${Nl()}: bitmask set or re-set?`, null, null) : (r ? ie(s, i, _) : se(s, i, _)) < 0 ? l(0, -1, `${Nl()}: trace level of ${o} not found: ${i}`, null, null) : r ? (Sl(e, "no_trace_levels", o, oe(s)), l(0, 0, null, null, oe(s))) : (Sl(e, "trace_levels", o, le(s)), l(0, 0, null, null, re(s))) : l(0, -1, `${Nl()}: what level?`, null, null);
|
|
2447
2463
|
}
|
|
2448
|
-
default: return l(0, -1, `${
|
|
2464
|
+
default: return l(0, -1, `${Nl()}: command not available: ${t}`, null, null);
|
|
2449
2465
|
}
|
|
2450
2466
|
}
|
|
2451
2467
|
};
|
|
2452
|
-
var
|
|
2468
|
+
var Dl = "ievent_gate_stack", kl = [
|
|
2453
2469
|
j(y.DTP_STRING, "wanted_yuno_role", E.SDF_RD, "", "wanted yuno role"),
|
|
2454
2470
|
j(y.DTP_STRING, "wanted_yuno_name", E.SDF_RD, "", "wanted yuno name"),
|
|
2455
2471
|
j(y.DTP_STRING, "wanted_yuno_service", E.SDF_RD, "", "wanted yuno service"),
|
|
@@ -2466,15 +2482,15 @@
|
|
|
2466
2482
|
j(y.DTP_INTEGER, "timeout_idack", E.SDF_RD, "5000", "timeout waiting idAck"),
|
|
2467
2483
|
j(y.DTP_POINTER, "subscriber", 0, 0, "subscriber of output-events. If null then subscriber is the parent"),
|
|
2468
2484
|
v()
|
|
2469
|
-
],
|
|
2485
|
+
], Al = [
|
|
2470
2486
|
["ievents", "Trace inter-events with metadata of kw"],
|
|
2471
2487
|
["ievents2", "Trace inter-events with full kw"],
|
|
2472
2488
|
["identity-card", "Trace identity_card messages"]
|
|
2473
2489
|
];
|
|
2474
|
-
function
|
|
2490
|
+
function Il(e) {
|
|
2475
2491
|
return !!(3 & x(e));
|
|
2476
2492
|
}
|
|
2477
|
-
var
|
|
2493
|
+
var Cl = {
|
|
2478
2494
|
url: null,
|
|
2479
2495
|
remote_yuno_name: null,
|
|
2480
2496
|
remote_yuno_role: null,
|
|
@@ -2484,8 +2500,8 @@
|
|
|
2484
2500
|
websocket: null,
|
|
2485
2501
|
inside_on_open: !1,
|
|
2486
2502
|
retry_ms: 0
|
|
2487
|
-
},
|
|
2488
|
-
function
|
|
2503
|
+
}, Ll = null;
|
|
2504
|
+
function Pl(e) {
|
|
2489
2505
|
e.priv.websocket && hn("Websocket ALREADY setup");
|
|
2490
2506
|
const t = jt(e, "url");
|
|
2491
2507
|
En(`====> Starting WebSocket to '${t}' (${et(e)})`);
|
|
@@ -2522,7 +2538,7 @@
|
|
|
2522
2538
|
}, e));
|
|
2523
2539
|
}, r) : (hn(`${et(e)}: Failed to initialize WebSocket.`), null);
|
|
2524
2540
|
}
|
|
2525
|
-
function
|
|
2541
|
+
function Ul(e, t = 1e3, n = "") {
|
|
2526
2542
|
let r = e.priv, l = r.websocket;
|
|
2527
2543
|
if (r.websocket = null, l && l.readyState !== WebSocket.CLOSED && l.readyState !== WebSocket.CLOSING) {
|
|
2528
2544
|
En(`Closing WebSocket (Code: ${t}, Reason: "${n}")`);
|
|
@@ -2533,25 +2549,25 @@
|
|
|
2533
2549
|
}
|
|
2534
2550
|
} else yn("WebSocket is already closed or in the process of closing.");
|
|
2535
2551
|
}
|
|
2536
|
-
function
|
|
2537
|
-
let r =
|
|
2552
|
+
function Fl(e, t, n) {
|
|
2553
|
+
let r = Zr();
|
|
2538
2554
|
try {
|
|
2539
2555
|
En("\n" + r + " " + t + "\n"), Un(n);
|
|
2540
2556
|
} catch (e) {
|
|
2541
2557
|
En("ERROR in trace_inter_event: " + e);
|
|
2542
2558
|
}
|
|
2543
2559
|
}
|
|
2544
|
-
var
|
|
2560
|
+
var Vl = class {
|
|
2545
2561
|
constructor(e, t) {
|
|
2546
2562
|
this.event = e, this.kw = t || {};
|
|
2547
2563
|
}
|
|
2548
2564
|
};
|
|
2549
|
-
function
|
|
2565
|
+
function Gl(e, t, n, r) {
|
|
2550
2566
|
return function(e, t) {
|
|
2551
2567
|
let n = e.priv, r = JSON.stringify(t);
|
|
2552
|
-
if (
|
|
2568
|
+
if (Il(e)) {
|
|
2553
2569
|
let n = jt(e, "url"), l = Xe(qe()) + " ==> " + n, o = yt(qe(), "trace_ievent_callback");
|
|
2554
|
-
o ? o(l, t, 1, r.length) :
|
|
2570
|
+
o ? o(l, t, 1, r.length) : Fl(0, l, t);
|
|
2555
2571
|
}
|
|
2556
2572
|
if (!n.websocket || n.websocket.readyState !== WebSocket.OPEN) return yn(`${et(e)}: send_iev(): websocket not open, message lost`), -1;
|
|
2557
2573
|
try {
|
|
@@ -2561,10 +2577,10 @@
|
|
|
2561
2577
|
}
|
|
2562
2578
|
return 0;
|
|
2563
2579
|
}(e, function(e, t) {
|
|
2564
|
-
return ir(e) ? (hn("iev_create() event NULL"), null) : new
|
|
2580
|
+
return ir(e) ? (hn("iev_create() event NULL"), null) : new Vl(e, t);
|
|
2565
2581
|
}(t, n));
|
|
2566
2582
|
}
|
|
2567
|
-
function
|
|
2583
|
+
function Ml(e, t, n) {
|
|
2568
2584
|
return ir(n) && (n = jt(e, "wanted_yuno_service")), {
|
|
2569
2585
|
dst_yuno: jt(e, "wanted_yuno_name"),
|
|
2570
2586
|
dst_role: jt(e, "wanted_yuno_role"),
|
|
@@ -2572,10 +2588,10 @@
|
|
|
2572
2588
|
src_yuno: He(),
|
|
2573
2589
|
src_role: ze(),
|
|
2574
2590
|
src_service: t,
|
|
2575
|
-
host:
|
|
2591
|
+
host: tl()
|
|
2576
2592
|
};
|
|
2577
2593
|
}
|
|
2578
|
-
function
|
|
2594
|
+
function Wl(e) {
|
|
2579
2595
|
let t = e.priv, n = Je(qe()), r = jt(qe(), "yuno_version"), l = jt(qe(), "yuno_release"), o = jt(qe(), "yuno_tag"), i = yt(e, "required_services");
|
|
2580
2596
|
i && i.length || (i = yt(qe(), "required_services"));
|
|
2581
2597
|
let _ = {
|
|
@@ -2593,27 +2609,27 @@
|
|
|
2593
2609
|
username: jt(qe(), "__username__"),
|
|
2594
2610
|
launch_id: 0,
|
|
2595
2611
|
yuno_startdate: jt(qe(), "start_date"),
|
|
2596
|
-
id:
|
|
2612
|
+
id: tl(),
|
|
2597
2613
|
user_agent: "undefined" != typeof window ? window.navigator.userAgent : "",
|
|
2598
2614
|
language: "undefined" != typeof window ? window.navigator.language : "",
|
|
2599
2615
|
required_services: i
|
|
2600
2616
|
};
|
|
2601
|
-
return Vr(e, _,
|
|
2617
|
+
return Vr(e, _, Dl, Ml(e, Xe(nt(e)), null)), Mr(e, _, "__identity__"), yl(t.gobj_timer, vt(e, "timeout_idack")), Gl(e, "EV_IDENTITY_CARD", _);
|
|
2602
2618
|
}
|
|
2603
|
-
function
|
|
2619
|
+
function xl(e, t) {
|
|
2604
2620
|
if (ir(t.event)) return -1;
|
|
2605
2621
|
let n = {}, r = t.__global__, l = t.__config__, o = t.__filter__, s = t.__service__, i = t.subscriber;
|
|
2606
2622
|
l && (n.__config__ = l), r && (n.__global__ = r), o && (n.__filter__ = o);
|
|
2607
|
-
return Vr(e, n,
|
|
2623
|
+
return Vr(e, n, Dl, Ml(e, Xe(i), s)), Mr(e, n, "__subscribing__"), Gl(e, t.event, n);
|
|
2608
2624
|
}
|
|
2609
|
-
function
|
|
2625
|
+
function Kl(e, t, n, r) {
|
|
2610
2626
|
let l = e.priv;
|
|
2611
|
-
return Ke(e) && (l.websocket =
|
|
2627
|
+
return Ke(e) && (l.websocket = Pl(e)), 0;
|
|
2612
2628
|
}
|
|
2613
|
-
function
|
|
2614
|
-
return En("Websocket opened: " + e.priv.url),
|
|
2629
|
+
function Yl(e, t, n, r) {
|
|
2630
|
+
return En("Websocket opened: " + e.priv.url), Wl(e), 0;
|
|
2615
2631
|
}
|
|
2616
|
-
function
|
|
2632
|
+
function Bl(e, t, n, r) {
|
|
2617
2633
|
let l = e.priv, o = n.url;
|
|
2618
2634
|
return void 0 !== n.ws_seq && n.ws_seq !== l.ws_seq || (bn(), yn(`${et(e)}: WebSocket closed ${o} (Code: ${n.code}, Reason: "${n.reason}", Clean: ${n.was_clean})`), l.websocket && (l.websocket.onopen = null, l.websocket.onmessage = null, l.websocket.onerror = null, l.websocket.onclose = null, l.websocket = null), l.inform_on_close ? (l.inform_on_close = !1, Xt(e, "EV_ON_CLOSE", {
|
|
2619
2635
|
url: o,
|
|
@@ -2628,7 +2644,7 @@
|
|
|
2628
2644
|
code: n.code,
|
|
2629
2645
|
reason: n.reason,
|
|
2630
2646
|
was_clean: n.was_clean
|
|
2631
|
-
})), Ke(e) &&
|
|
2647
|
+
})), Ke(e) && yl(l.gobj_timer, function(e) {
|
|
2632
2648
|
let t = e.priv, n = vt(e, "timeout_retry"), r = vt(e, "timeout_retry_max");
|
|
2633
2649
|
r < n && (r = n);
|
|
2634
2650
|
t.retry_ms = t.retry_ms ? Math.min(2 * t.retry_ms, r) : n;
|
|
@@ -2636,17 +2652,17 @@
|
|
|
2636
2652
|
return Math.max(1, Math.round(o));
|
|
2637
2653
|
}(e))), 0;
|
|
2638
2654
|
}
|
|
2639
|
-
function
|
|
2640
|
-
return
|
|
2655
|
+
function Jl(e, t, n, r) {
|
|
2656
|
+
return Wl(e), 0;
|
|
2641
2657
|
}
|
|
2642
|
-
function
|
|
2658
|
+
function ql(e, t, n, r) {
|
|
2643
2659
|
let l = e.priv;
|
|
2644
|
-
|
|
2645
|
-
let o = Gr(e, n,
|
|
2660
|
+
Tl(l.gobj_timer);
|
|
2661
|
+
let o = Gr(e, n, Dl, !0), s = Er(e, o, "src_yuno", ""), i = Er(e, o, "src_role", ""), _ = Er(e, o, "src_service", "");
|
|
2646
2662
|
$t(e, "remote_yuno_name", s), $t(e, "remote_yuno_role", i), $t(e, "remote_yuno_service", _);
|
|
2647
2663
|
let a = yr(e, n, "result", -1, 0), u = Er(e, n, "comment", "", 0), c = Er(e, n, "username", "", 0), f = jr(e, n, "services_roles", {});
|
|
2648
2664
|
if (a < 0) {
|
|
2649
|
-
|
|
2665
|
+
Ul(e);
|
|
2650
2666
|
let t = {
|
|
2651
2667
|
url: jt(e, "url"),
|
|
2652
2668
|
result: a,
|
|
@@ -2671,12 +2687,12 @@
|
|
|
2671
2687
|
}
|
|
2672
2688
|
l.inside_on_open = !1, function(e) {
|
|
2673
2689
|
let t = zt(e, null, null, null);
|
|
2674
|
-
for (let n = 0; n < t.length; n++)
|
|
2690
|
+
for (let n = 0; n < t.length; n++) xl(e, t[n]);
|
|
2675
2691
|
}(e);
|
|
2676
2692
|
}
|
|
2677
2693
|
return 0;
|
|
2678
2694
|
}
|
|
2679
|
-
function
|
|
2695
|
+
function Hl(e, t, n, r) {
|
|
2680
2696
|
let l = e.priv.url, o = function(e, t) {
|
|
2681
2697
|
let n;
|
|
2682
2698
|
try {
|
|
@@ -2695,19 +2711,19 @@
|
|
|
2695
2711
|
} : (yn(`${et(e)}: parsing inter_event: kw not a json object`), null) : (yn(`${et(e)}: parsing inter_kw: no kw`), null);
|
|
2696
2712
|
}(e, n.data);
|
|
2697
2713
|
if (!o) return yn(`${et(e)}: frame dropped from ${l}: ${String(n.data).substring(0, 256)}`), -1;
|
|
2698
|
-
if (
|
|
2714
|
+
if (Il(e)) {
|
|
2699
2715
|
let e = Xe(qe()) + " <== " + l, t = n.data.length, r = yt(qe(), "trace_ievent_callback");
|
|
2700
|
-
r ? r(e, o, 2, t) :
|
|
2716
|
+
r ? r(e, o, 2, t) : Fl(0, e, o);
|
|
2701
2717
|
}
|
|
2702
2718
|
let s = o.event, i = o.kw;
|
|
2703
2719
|
if ("ST_SESSION" !== kt(e)) {
|
|
2704
2720
|
if (It(e, s, $.EVF_PUBLIC_EVENT)) {
|
|
2705
2721
|
if (!(Vt(e, s, i, e) < 0)) return 0;
|
|
2706
2722
|
} else hn(`${et(e)}: event UNKNOWN in not-session state ${s}`);
|
|
2707
|
-
return
|
|
2723
|
+
return Ul(e), -1;
|
|
2708
2724
|
}
|
|
2709
2725
|
o = null;
|
|
2710
|
-
let _ = Wr(e, i), a = Gr(e, i,
|
|
2726
|
+
let _ = Wr(e, i), a = Gr(e, i, Dl), u = Er(e, a, "dst_role", "");
|
|
2711
2727
|
if (u.toLowerCase() !== ze().toLowerCase()) return hn(`"It's not my role, dst_role: ${u}, my_role: ${ze()}`), 0;
|
|
2712
2728
|
let c = Er(e, a, "dst_service", "");
|
|
2713
2729
|
if ("__subscribing__" === _) return yn(`${et(e)}: subscription event ignored, I'm client (service: ${c}, event: ${s})`), -1;
|
|
@@ -2719,13 +2735,13 @@
|
|
|
2719
2735
|
}
|
|
2720
2736
|
return lt(e) ? Vt(nt(e), s, i, e) : Xt(e, s, i), 0;
|
|
2721
2737
|
}
|
|
2722
|
-
function
|
|
2738
|
+
function zl(e, t, n, r) {
|
|
2723
2739
|
return 0;
|
|
2724
2740
|
}
|
|
2725
|
-
function
|
|
2741
|
+
function Ql(e, t, n, r) {
|
|
2726
2742
|
return 0;
|
|
2727
2743
|
}
|
|
2728
|
-
var
|
|
2744
|
+
var Xl = {
|
|
2729
2745
|
mt_create: function(e) {
|
|
2730
2746
|
let t = e.priv;
|
|
2731
2747
|
t.gobj_timer = Ce(Xe(e), "C_TIMER", {}, e), t.ws_seq = 0, t.url = jt(e, "url"), t.remote_yuno_name = jt(e, "remote_yuno_name"), t.remote_yuno_role = jt(e, "remote_yuno_role"), t.remote_yuno_service = jt(e, "remote_yuno_service"), $t(e, "wanted_yuno_name", t.remote_yuno_name), $t(e, "wanted_yuno_role", t.remote_yuno_role), $t(e, "wanted_yuno_service", t.remote_yuno_service);
|
|
@@ -2755,43 +2771,43 @@
|
|
|
2755
2771
|
code: 1e3,
|
|
2756
2772
|
reason: "restarted",
|
|
2757
2773
|
was_clean: !0
|
|
2758
|
-
}, e),
|
|
2774
|
+
}, e), Tl(t.gobj_timer)), t.websocket = Pl(e), 0;
|
|
2759
2775
|
},
|
|
2760
2776
|
mt_stop: function(e) {
|
|
2761
2777
|
let t = e.priv;
|
|
2762
|
-
return
|
|
2778
|
+
return Tl(t.gobj_timer), t.websocket && Ul(e), 0;
|
|
2763
2779
|
},
|
|
2764
2780
|
mt_destroy: function(e) {},
|
|
2765
2781
|
mt_stats: function(e, t, n, r) {
|
|
2766
2782
|
if ("ST_SESSION" !== kt(e)) return hn("Not in session"), null;
|
|
2767
2783
|
n || (n = {});
|
|
2768
|
-
let l =
|
|
2784
|
+
let l = Ml(e, Xe(r), Er(e, n, "service", null, 0)), o = jr(e, n, "__md_stats__", null, Zt.KW_EXTRACT);
|
|
2769
2785
|
return o || (o = {}), Vr(e, n, "stats_stack", {
|
|
2770
2786
|
stats: t,
|
|
2771
2787
|
kw: o
|
|
2772
|
-
}), Vr(e, n,
|
|
2788
|
+
}), Vr(e, n, Dl, l), n.__stats__ = t, Mr(e, n, "__stats__"), Gl(e, "EV_MT_STATS", n, r), null;
|
|
2773
2789
|
},
|
|
2774
2790
|
mt_command_parser: function(e, t, n, r) {
|
|
2775
2791
|
if ("ST_SESSION" !== kt(e)) return hn("Not in session"), null;
|
|
2776
2792
|
n || (n = {});
|
|
2777
|
-
let l =
|
|
2793
|
+
let l = Ml(e, Xe(r), Er(e, n, "service", "", 0)), o = jr(e, n, "__md_command__", null, Zt.KW_EXTRACT);
|
|
2778
2794
|
return o || (o = {}), Vr(e, n, "command_stack", {
|
|
2779
2795
|
command: t,
|
|
2780
2796
|
kw: o
|
|
2781
|
-
}), Vr(e, n,
|
|
2797
|
+
}), Vr(e, n, Dl, l), n.__command__ = t, Mr(e, n, "__command__"), Gl(e, "EV_MT_COMMAND", n, r), null;
|
|
2782
2798
|
},
|
|
2783
2799
|
mt_inject_event: function(e, t, n, r) {
|
|
2784
2800
|
if ("ST_SESSION" !== kt(e)) return window.console.error("Not in session"), -1;
|
|
2785
|
-
if (n = Gn({}, Zn(n) ? n : {}), Zn(n.__md_iev__) && (n.__md_iev__ = Fn(n.__md_iev__)), Gr(e, n,
|
|
2801
|
+
if (n = Gn({}, Zn(n) ? n : {}), Zn(n.__md_iev__) && (n.__md_iev__ = Fn(n.__md_iev__)), Gr(e, n, Dl));
|
|
2786
2802
|
else {
|
|
2787
|
-
let l =
|
|
2788
|
-
Kn(n, "__service__"), Vr(e, n, "__message__", t), Vr(e, n,
|
|
2803
|
+
let l = Ml(e, Xe(r), Er(e, n, "__service__", 0, 0));
|
|
2804
|
+
Kn(n, "__service__"), Vr(e, n, "__message__", t), Vr(e, n, Dl, l);
|
|
2789
2805
|
}
|
|
2790
|
-
return Mr(e, n, "__message__"),
|
|
2806
|
+
return Mr(e, n, "__message__"), Gl(e, t, n, r);
|
|
2791
2807
|
},
|
|
2792
2808
|
mt_subscription_added: function(e, t) {
|
|
2793
2809
|
let n = e.priv;
|
|
2794
|
-
return "ST_SESSION" === kt(e) && n.websocket ? n.inside_on_open ? 0 :
|
|
2810
|
+
return "ST_SESSION" === kt(e) && n.websocket ? n.inside_on_open ? 0 : xl(e, t) : 0;
|
|
2795
2811
|
},
|
|
2796
2812
|
mt_subscription_deleted: function(e, t) {
|
|
2797
2813
|
let n = e.priv;
|
|
@@ -2800,7 +2816,7 @@
|
|
|
2800
2816
|
if (ir(t.event)) return 0;
|
|
2801
2817
|
let r = {}, l = t.__global__, o = t.__config__, s = t.__filter__, i = t.__service__, _ = t.subscriber;
|
|
2802
2818
|
o && (r.__config__ = o), l && (r.__global__ = l), s && (r.__filter__ = s);
|
|
2803
|
-
return Vr(e, r,
|
|
2819
|
+
return Vr(e, r, Dl, Ml(e, Xe(_), i)), Mr(e, r, "__unsubscribing__"), Gl(e, t.event, r, e);
|
|
2804
2820
|
}
|
|
2805
2821
|
};
|
|
2806
2822
|
e.GObj = S, e.SDATA = j, e.SDATAAUTHZ = (e, t, n, r, l, o) => new T(e, t, n, null, o, r, null, 0, null, l, null), e.SDATACM = (e, t, n, r, l, o) => new T(e, t, 0, null, o, n, null, 0, l, r, null), e.SDATACM2 = (e, t, n, r, l, o, s) => new T(e, t, n, null, s, r, null, 0, o, l, null), e.SDATADF = (e, t, n, r, l, o) => new T(e, t, n, null, o, null, r, l), e.SDATAPM = (e, t, n, r, l) => new T(e, t, n, r, l), e.SDATAPM0 = (e, t, n, r, l) => new T(e, t, n, null, l, null, null, 0, null, null, r), e.SDATA_END = v, e.SDataDesc = T, e.YUNETA_VERSION = s, Object.defineProperty(e, "__yuno__", {
|
|
@@ -2814,7 +2830,7 @@
|
|
|
2814
2830
|
return t;
|
|
2815
2831
|
}, e.build_stats_response = o, e.clean_name = function(e) {
|
|
2816
2832
|
return e.replace(/[?# ^:]/g, "_");
|
|
2817
|
-
}, e.clear_timeout =
|
|
2833
|
+
}, e.clear_timeout = Tl, e.cmp_two_simple_json = cr, e.command_parser = function(e, t, n, r) {}, e.createElement2 = function e(t, n) {
|
|
2818
2834
|
let [r, l, o, s] = t;
|
|
2819
2835
|
if (!r) return void hn("Tag must be a valid HTML element.");
|
|
2820
2836
|
let i = document.createElement(r), _ = "";
|
|
@@ -2823,16 +2839,21 @@
|
|
|
2823
2839
|
for (const n of Object.keys(l[e])) t += `${n}: ${l[e][n]};`;
|
|
2824
2840
|
i.style.cssText = t;
|
|
2825
2841
|
} else "style" === e ? i.style.cssText = l[e] : "i18n" === e || "data-i18n" === e || "data_i18next" === e || "data-i18next" === e ? null !== l[e] && void 0 !== l[e] && (_ = l[e], i.setAttribute("data-i18n", _)) : i.setAttribute(e, l[e]);
|
|
2826
|
-
if (
|
|
2827
|
-
else if (
|
|
2842
|
+
if (qr(o)) i.appendChild(Hr(o));
|
|
2843
|
+
else if (tr(o)) if (o = o.trim(), o.length > 0 && "<" === o[0] && !zr) i.appendChild(Xr(o));
|
|
2844
|
+
else if (o.length > 0 && "<" === o[0] && function(e) {
|
|
2845
|
+
if (Qr.size >= 100) return;
|
|
2846
|
+
const t = e.slice(0, 80);
|
|
2847
|
+
Qr.has(t) || (Qr.add(t), yn(`createElement2: a string that starts with '<' is TEXT (set_strings_are_text): use html_markup() if it is markup: ${JSON.stringify(t)}`));
|
|
2848
|
+
}(o), n && _) i.textContent = n(_) || o;
|
|
2828
2849
|
else i.textContent = o;
|
|
2829
2850
|
else if (er(o)) {
|
|
2830
2851
|
if (o.length > 0) if (tr(o[0])) i.appendChild(e(o, n));
|
|
2831
|
-
else for (let t of o) Array.isArray(t) ? t.length > 0 && i.appendChild(e(t, n)) : t instanceof Node ? i.appendChild(t) : tr(t) ? i.appendChild(document.createTextNode(t)) : null != t && !1 !== t && hn("createElement2: child ignored, type " + typeof t);
|
|
2852
|
+
else for (let t of o) Array.isArray(t) ? t.length > 0 && i.appendChild(e(t, n)) : t instanceof Node ? i.appendChild(t) : qr(t) ? i.appendChild(Hr(t)) : tr(t) ? i.appendChild(document.createTextNode(t)) : null != t && !1 !== t && hn("createElement2: child ignored, type " + typeof t);
|
|
2832
2853
|
} else o instanceof HTMLElement || o instanceof Text || o instanceof SVGElement ? i.appendChild(o) : null != o && (hn("content ignored"), vn(o));
|
|
2833
2854
|
if (s && "object" == typeof s) for (const e of Object.keys(s)) i.addEventListener(e, s[e]);
|
|
2834
2855
|
return i;
|
|
2835
|
-
}, e.createOneHtml =
|
|
2856
|
+
}, e.createOneHtml = Xr, e.create_json_record = function(e, t) {
|
|
2836
2857
|
let n = Fn(e);
|
|
2837
2858
|
return Mn(n, t), n;
|
|
2838
2859
|
}, e.create_template_record = function(e, t) {
|
|
@@ -2843,21 +2864,21 @@
|
|
|
2843
2864
|
let o = jr(null, t, e, l);
|
|
2844
2865
|
n[e] = o;
|
|
2845
2866
|
}), n;
|
|
2846
|
-
}, e.current_timestamp =
|
|
2847
|
-
let n = Dr(
|
|
2867
|
+
}, e.current_timestamp = Zr, e.data_type_t = y, e.db_list_persistent_attrs = function(e, t) {
|
|
2868
|
+
let n = Dr(_l(e), null, !1), r = {};
|
|
2848
2869
|
return n && Zn(n) && (r = Rr(e, n, t, !1)), r;
|
|
2849
2870
|
}, e.db_load_persistent_attrs = function(e, t) {
|
|
2850
|
-
let n = Et(e, E.SDF_PERSIST), r = Dr(
|
|
2871
|
+
let n = Et(e, E.SDF_PERSIST), r = Dr(_l(e), null, !1);
|
|
2851
2872
|
if (r && Zn(r)) {
|
|
2852
2873
|
let l = Rr(e, r, t, !1);
|
|
2853
2874
|
l = Rr(e, l, n, !1), wt(e, l, E.SDF_PERSIST);
|
|
2854
2875
|
}
|
|
2855
2876
|
}, e.db_remove_persistent_attrs = function(e, t) {
|
|
2856
|
-
let n = $r(e, Dr(
|
|
2857
|
-
0 === zn(n) ? Ar(
|
|
2877
|
+
let n = $r(e, Dr(_l(e), null, !1), t, !1);
|
|
2878
|
+
0 === zn(n) ? Ar(_l(e)) : kr(_l(e), n);
|
|
2858
2879
|
}, e.db_save_persistent_attrs = function(e, t) {
|
|
2859
|
-
let n = Rr(e, Et(e, E.SDF_PERSIST), t, !1), r = Dr(
|
|
2860
|
-
return r && Zn(r) && Wn(n, r), kr(
|
|
2880
|
+
let n = Rr(e, Et(e, E.SDF_PERSIST), t, !1), r = Dr(_l(e), null, !1);
|
|
2881
|
+
return r && Zn(r) && Wn(n, r), kr(_l(e), n);
|
|
2861
2882
|
}, e.debounce = function(e, t = 0, n = !1) {
|
|
2862
2883
|
let r = null, l = null, o = null;
|
|
2863
2884
|
const s = (...s) => {
|
|
@@ -2885,16 +2906,16 @@
|
|
|
2885
2906
|
if (null === e || "object" != typeof e || Array.isArray(e)) throw new Error("flat2json: a flat json is an object of id -> value");
|
|
2886
2907
|
let t = null;
|
|
2887
2908
|
for (const n of Object.keys(e)) {
|
|
2888
|
-
const r =
|
|
2909
|
+
const r = sl(n);
|
|
2889
2910
|
if (!r || 0 === r.length) throw new Error(`flat2json: malformed flat id: '${n}'`);
|
|
2890
|
-
if (r.length >
|
|
2911
|
+
if (r.length > rl) throw new Error(`flat2json: '${n}' deeper than 256`);
|
|
2891
2912
|
const l = "number" == typeof r[0];
|
|
2892
2913
|
if (null === t) t = l ? [] : {};
|
|
2893
2914
|
else if (l !== Array.isArray(t)) throw new Error(`flat2json: '${n}' does not fit a ${Array.isArray(t) ? "array" : "object"} root`);
|
|
2894
2915
|
let o = t;
|
|
2895
2916
|
for (let t = 0; t < r.length; t++) {
|
|
2896
2917
|
const l = r[t], s = "number" == typeof l, i = t === r.length - 1, _ = !i && "number" == typeof r[t + 1];
|
|
2897
|
-
if (s && l >
|
|
2918
|
+
if (s && l > ll) throw new Error(`flat2json: array index ${l} over the limit (100000) in '${n}'`);
|
|
2898
2919
|
if (s !== Array.isArray(o)) throw new Error(`flat2json: '${n}' uses a ${s ? "array index" : "key"} where the tree already has a ${Array.isArray(o) ? "array" : "object"}`);
|
|
2899
2920
|
if (i) {
|
|
2900
2921
|
if (Array.isArray(o)) {
|
|
@@ -2934,15 +2955,15 @@
|
|
|
2934
2955
|
removed: {},
|
|
2935
2956
|
changed: {}
|
|
2936
2957
|
};
|
|
2937
|
-
for (const e of Object.keys(n)) Object.prototype.hasOwnProperty.call(r, e) ?
|
|
2958
|
+
for (const e of Object.keys(n)) Object.prototype.hasOwnProperty.call(r, e) ? il(n[e], r[e]) || br(l.changed, e, {
|
|
2938
2959
|
from: n[e],
|
|
2939
2960
|
to: r[e]
|
|
2940
2961
|
}) : br(l.removed, e, n[e]);
|
|
2941
2962
|
for (const e of Object.keys(r)) Object.prototype.hasOwnProperty.call(n, e) || br(l.added, e, r[e]);
|
|
2942
2963
|
return l;
|
|
2943
2964
|
}, e.flat_key_join = function(e) {
|
|
2944
|
-
return Array.isArray(e) && 0 !== e.length ? e.map((e) => "number" == typeof e ? `[${e}]` :
|
|
2945
|
-
}, e.flat_key_split =
|
|
2965
|
+
return Array.isArray(e) && 0 !== e.length ? e.map((e) => "number" == typeof e ? `[${e}]` : ol(e)).join("`") : "";
|
|
2966
|
+
}, e.flat_key_split = sl, e.gclass_add_ev_action = ye, e.gclass_add_event_type = Te, e.gclass_add_state = he, e.gclass_check_fsm = je, e.gclass_create = de, e.gclass_event_type = ve, e.gclass_find_by_name = Oe, e.gclass_flag_t = w, e.gclass_unregister = be, e.getPositionRelativeToBody = function(e) {
|
|
2946
2967
|
if (!e) return {
|
|
2947
2968
|
top: 0,
|
|
2948
2969
|
left: 0,
|
|
@@ -2961,7 +2982,7 @@
|
|
|
2961
2982
|
right: n + i + r,
|
|
2962
2983
|
bottom: t + s + l
|
|
2963
2984
|
};
|
|
2964
|
-
}, e.get_function_name =
|
|
2985
|
+
}, e.get_function_name = nl, e.get_now = function() {
|
|
2965
2986
|
return Math.floor(Date.now() / 1e3);
|
|
2966
2987
|
}, e.gobj_bottom_gobj = st, e.gobj_change_parent = function(e, t) {
|
|
2967
2988
|
return ot(e) ? (hn("gobj NULL or DESTROYED"), null) : t instanceof S ? (e.parent && e.parent.gclass.gmt.mt_child_removed && e.parent.gclass.gmt.mt_child_removed(e.parent, e), e.parent && ($e(e.parent, e), e.parent = null), Re(t, e), t.gclass.gmt.mt_child_added && (Y(e) && En(n("👦👦🔵 child_added(%s): %s", tt(t), et(e))), t.gclass.gmt.mt_child_added(t, e)), 0) : (hn(`${et(e)}: gobj_change_parent() BAD TYPE of parent`), -1);
|
|
@@ -3108,9 +3129,11 @@
|
|
|
3108
3129
|
0 === r ? i++ : r < 0 ? _++ : a++;
|
|
3109
3130
|
}
|
|
3110
3131
|
return _ ? yn(`${et(e)}: Hard subscription not removed, only gobj_unsubscribe_list() with force removes it (event: ${t}, hard: ${_})`) : i || a || (yn(`${et(e)}: No subscription found`), Un(n, "No subscription found")), 0;
|
|
3111
|
-
}, e.gobj_unsubscribe_list = Ht, e.gobj_walk_gobj_children = at, e.gobj_walk_gobj_children_tree = ut, e.gobj_write_attr = St, e.gobj_write_attrs = wt, e.gobj_write_bool_attr = Nt, e.gobj_write_integer_attr = Rt, e.gobj_write_str_attr = $t, e.gobj_yuno = qe, e.gobj_yuno_id = Qe, e.gobj_yuno_name = He, e.gobj_yuno_role = ze, e.
|
|
3132
|
+
}, e.gobj_unsubscribe_list = Ht, e.gobj_walk_gobj_children = at, e.gobj_walk_gobj_children_tree = ut, e.gobj_write_attr = St, e.gobj_write_attrs = wt, e.gobj_write_bool_attr = Nt, e.gobj_write_integer_attr = Rt, e.gobj_write_str_attr = $t, e.gobj_yuno = qe, e.gobj_yuno_id = Qe, e.gobj_yuno_name = He, e.gobj_yuno_role = ze, e.html_markup = function(e) {
|
|
3133
|
+
return "string" != typeof e ? (hn("html_markup: not a string, type " + typeof e), new Jr("")) : new Jr(e);
|
|
3134
|
+
}, e.id_index_in_obj_list = Lr, e.index_in_list = el, e.is_array = er, e.is_boolean = rr, e.is_date = function(e) {
|
|
3112
3135
|
return e instanceof Date && !isNaN(e);
|
|
3113
|
-
}, e.is_function = or, e.is_gobj = sr, e.is_metadata_key = function(e) {
|
|
3136
|
+
}, e.is_function = or, e.is_gobj = sr, e.is_html_markup = qr, e.is_metadata_key = function(e) {
|
|
3114
3137
|
if (!tr(e)) return !1;
|
|
3115
3138
|
let t = 0;
|
|
3116
3139
|
for (; t < e.length && "_" === e[t] && !(t > 2); t++);
|
|
@@ -3172,7 +3195,7 @@
|
|
|
3172
3195
|
return l;
|
|
3173
3196
|
}, e.json2flat = function(e) {
|
|
3174
3197
|
const t = {}, n = (e, r, l) => {
|
|
3175
|
-
if (l >
|
|
3198
|
+
if (l > rl) throw new Error("json2flat: deeper than 256");
|
|
3176
3199
|
if (null === e || "object" != typeof e || Array.isArray(e)) {
|
|
3177
3200
|
if (Array.isArray(e) && e.length > 0) return void e.forEach((e, t) => {
|
|
3178
3201
|
const o = `[${t}]`;
|
|
@@ -3182,7 +3205,7 @@
|
|
|
3182
3205
|
const t = Object.keys(e);
|
|
3183
3206
|
if (t.length > 0) {
|
|
3184
3207
|
for (const o of t) {
|
|
3185
|
-
const t =
|
|
3208
|
+
const t = ol(o);
|
|
3186
3209
|
n(e[o], 0 === l ? t : r + "`" + t, l + 1);
|
|
3187
3210
|
}
|
|
3188
3211
|
return;
|
|
@@ -3348,9 +3371,9 @@
|
|
|
3348
3371
|
var e;
|
|
3349
3372
|
}, r.send();
|
|
3350
3373
|
}, e.log_debug = En, e.log_error = hn, e.log_info = function(e, ...t) {
|
|
3351
|
-
let n = mn(e, ...t), r =
|
|
3374
|
+
let n = mn(e, ...t), r = Zr();
|
|
3352
3375
|
rn && cn("info", n) && rn("%c" + r + " INFO: " + String(n), "color:cyan"), gn("info", n, r);
|
|
3353
|
-
}, e.log_warning = yn, e.mask_secrets_inline = kn, e.msg_iev_get_msg_type = Wr, e.msg_iev_get_stack = Gr, e.msg_iev_push_stack = Vr, e.msg_iev_read_key = Ur, e.msg_iev_set_msg_type = Mr, e.msg_iev_write_key = Fr, e.node_uuid =
|
|
3376
|
+
}, e.log_warning = yn, e.mask_secrets_inline = kn, e.msg_iev_get_msg_type = Wr, e.msg_iev_get_stack = Gr, e.msg_iev_push_stack = Vr, e.msg_iev_read_key = Ur, e.msg_iev_set_msg_type = Mr, e.msg_iev_write_key = Fr, e.node_uuid = tl, e.parseBoolean = _r, e.parseSVG = function(e) {
|
|
3354
3377
|
return new DOMParser().parseFromString(e, "image/svg+xml").firstChild;
|
|
3355
3378
|
}, e.refresh_language = function(e, t) {
|
|
3356
3379
|
if (!or(t)) return void hn("You must supply a translation function");
|
|
@@ -3377,22 +3400,22 @@
|
|
|
3377
3400
|
});
|
|
3378
3401
|
}, e.register_c_ievent_cli = function() {
|
|
3379
3402
|
return function(e) {
|
|
3380
|
-
if (
|
|
3403
|
+
if (Ll) return hn(`GClass ALREADY created: ${e}`), -1;
|
|
3381
3404
|
const t = [
|
|
3382
3405
|
["ST_DISCONNECTED", [
|
|
3383
3406
|
[
|
|
3384
3407
|
"EV_ON_OPEN",
|
|
3385
|
-
|
|
3408
|
+
Yl,
|
|
3386
3409
|
"ST_WAIT_IDENTITY_CARD_ACK"
|
|
3387
3410
|
],
|
|
3388
3411
|
[
|
|
3389
3412
|
"EV_ON_CLOSE",
|
|
3390
|
-
|
|
3413
|
+
Bl,
|
|
3391
3414
|
null
|
|
3392
3415
|
],
|
|
3393
3416
|
[
|
|
3394
3417
|
"EV_TIMEOUT",
|
|
3395
|
-
|
|
3418
|
+
Kl,
|
|
3396
3419
|
null
|
|
3397
3420
|
],
|
|
3398
3421
|
[
|
|
@@ -3404,22 +3427,22 @@
|
|
|
3404
3427
|
["ST_WAIT_IDENTITY_CARD_ACK", [
|
|
3405
3428
|
[
|
|
3406
3429
|
"EV_ON_MESSAGE",
|
|
3407
|
-
|
|
3430
|
+
Hl,
|
|
3408
3431
|
null
|
|
3409
3432
|
],
|
|
3410
3433
|
[
|
|
3411
3434
|
"EV_IDENTITY_CARD_ACK",
|
|
3412
|
-
|
|
3435
|
+
ql,
|
|
3413
3436
|
null
|
|
3414
3437
|
],
|
|
3415
3438
|
[
|
|
3416
3439
|
"EV_ON_CLOSE",
|
|
3417
|
-
|
|
3440
|
+
Bl,
|
|
3418
3441
|
"ST_DISCONNECTED"
|
|
3419
3442
|
],
|
|
3420
3443
|
[
|
|
3421
3444
|
"EV_TIMEOUT",
|
|
3422
|
-
|
|
3445
|
+
Jl,
|
|
3423
3446
|
null
|
|
3424
3447
|
],
|
|
3425
3448
|
[
|
|
@@ -3431,22 +3454,22 @@
|
|
|
3431
3454
|
["ST_SESSION", [
|
|
3432
3455
|
[
|
|
3433
3456
|
"EV_ON_MESSAGE",
|
|
3434
|
-
|
|
3457
|
+
Hl,
|
|
3435
3458
|
null
|
|
3436
3459
|
],
|
|
3437
3460
|
[
|
|
3438
3461
|
"EV_MT_STATS",
|
|
3439
|
-
|
|
3462
|
+
zl,
|
|
3440
3463
|
null
|
|
3441
3464
|
],
|
|
3442
3465
|
[
|
|
3443
3466
|
"EV_MT_COMMAND",
|
|
3444
|
-
|
|
3467
|
+
Ql,
|
|
3445
3468
|
null
|
|
3446
3469
|
],
|
|
3447
3470
|
[
|
|
3448
3471
|
"EV_ON_CLOSE",
|
|
3449
|
-
|
|
3472
|
+
Bl,
|
|
3450
3473
|
"ST_DISCONNECTED"
|
|
3451
3474
|
],
|
|
3452
3475
|
[
|
|
@@ -3457,7 +3480,7 @@
|
|
|
3457
3480
|
]],
|
|
3458
3481
|
[null, null]
|
|
3459
3482
|
];
|
|
3460
|
-
return (
|
|
3483
|
+
return (Ll = de(e, [
|
|
3461
3484
|
["EV_ON_MESSAGE", $.EVF_OUTPUT_EVENT],
|
|
3462
3485
|
["EV_IDENTITY_CARD_ACK", $.EVF_PUBLIC_EVENT],
|
|
3463
3486
|
["EV_ON_ID_NAK", $.EVF_PUBLIC_EVENT | $.EVF_OUTPUT_EVENT],
|
|
@@ -3468,31 +3491,31 @@
|
|
|
3468
3491
|
["EV_ON_OPEN_ERROR", $.EVF_OUTPUT_EVENT | $.EVF_NO_WARN_SUBS],
|
|
3469
3492
|
["EV_TIMEOUT", 0],
|
|
3470
3493
|
[null, 0]
|
|
3471
|
-
], t,
|
|
3494
|
+
], t, Xl, 0, kl, Cl, 0, 0, Al, w.gcflag_no_check_output_events)) ? 0 : -1;
|
|
3472
3495
|
}("C_IEVENT_CLI");
|
|
3473
3496
|
}, e.register_c_timer = function() {
|
|
3474
3497
|
return function(e) {
|
|
3475
|
-
if (
|
|
3498
|
+
if (pl) return hn(`GClass ALREADY created: ${e}`), -1;
|
|
3476
3499
|
const t = [["ST_IDLE", [[
|
|
3477
3500
|
"EV_TIMEOUT",
|
|
3478
|
-
|
|
3501
|
+
ml,
|
|
3479
3502
|
null
|
|
3480
3503
|
]]]];
|
|
3481
|
-
return (
|
|
3504
|
+
return (pl = de(e, [
|
|
3482
3505
|
["EV_TIMEOUT", $.EVF_OUTPUT_EVENT],
|
|
3483
3506
|
["EV_TIMEOUT_PERIODIC", $.EVF_OUTPUT_EVENT],
|
|
3484
3507
|
[0, 0]
|
|
3485
|
-
], t,
|
|
3508
|
+
], t, hl, 0, dl, bl, 0, 0, 0, w.gcflag_manual_start)) ? 0 : -1;
|
|
3486
3509
|
}("C_TIMER");
|
|
3487
3510
|
}, e.register_c_yuno = function() {
|
|
3488
3511
|
return function(e) {
|
|
3489
|
-
if (
|
|
3512
|
+
if (Ol) return hn(`GClass ALREADY created: ${e}`), -1;
|
|
3490
3513
|
const t = [["ST_IDLE", [[
|
|
3491
3514
|
"EV_TIMEOUT_PERIODIC",
|
|
3492
|
-
|
|
3515
|
+
Rl,
|
|
3493
3516
|
null
|
|
3494
3517
|
]]]];
|
|
3495
|
-
return (
|
|
3518
|
+
return (Ol = de(e, [["EV_TIMEOUT_PERIODIC", $.EVF_OUTPUT_EVENT | $.EVF_NO_WARN_SUBS], [0, 0]], t, $l, 0, vl, jl, 0, 0, 0, 0)) ? 0 : -1;
|
|
3496
3519
|
}("C_YUNO");
|
|
3497
3520
|
}, e.safeSrc = function(e) {
|
|
3498
3521
|
if (!e) return "";
|
|
@@ -3520,7 +3543,11 @@
|
|
|
3520
3543
|
dn(e, r, n);
|
|
3521
3544
|
}
|
|
3522
3545
|
} else on = e;
|
|
3523
|
-
}, e.set_remote_log_functions = bn, e.
|
|
3546
|
+
}, e.set_remote_log_functions = bn, e.set_strings_are_text = function(e) {
|
|
3547
|
+
zr = !!e;
|
|
3548
|
+
}, e.set_timeout = yl, e.set_timeout_periodic = El, e.sprintf = n, e.stats_parser = function(e, t, n, r) {}, e.str_in_list = Pr, e.strcasecmp = ur, e.strcmp = ar, e.strings_are_text = function() {
|
|
3549
|
+
return zr;
|
|
3550
|
+
}, e.strncmp = function(e, t, n) {
|
|
3524
3551
|
var r = (e + "").substring(0, n), l = (t + "").substring(0, n);
|
|
3525
3552
|
return r === l ? 0 : r > l ? 1 : -1;
|
|
3526
3553
|
}, e.strs_in_list = function(e, t, n) {
|
|
@@ -3549,9 +3576,9 @@
|
|
|
3549
3576
|
let e = t.split(".");
|
|
3550
3577
|
for (let t = 0; t < e.length; t++) {
|
|
3551
3578
|
let r = e[t];
|
|
3552
|
-
if (Pr(
|
|
3553
|
-
else if (Pr(
|
|
3554
|
-
else if (Pr(
|
|
3579
|
+
if (Pr(ul, r)) n.real_type || (n.real_type = r);
|
|
3580
|
+
else if (Pr(fl, r)) n.type || (n.type = r);
|
|
3581
|
+
else if (Pr(cl, r)) switch (r) {
|
|
3555
3582
|
case "writable":
|
|
3556
3583
|
n.is_writable = !0;
|
|
3557
3584
|
break;
|
|
@@ -3563,7 +3590,7 @@
|
|
|
3563
3590
|
}
|
|
3564
3591
|
}
|
|
3565
3592
|
n.real_type || (n.real_type = "string");
|
|
3566
|
-
} else Zn(t) ? (n =
|
|
3593
|
+
} else Zn(t) ? (n = gl(t), n.name || (n.name = e), n.header || (n.header = e)) : er(t) && (n.real_type = "array", n.enum_list = t);
|
|
3567
3594
|
return n.type || (n.type = n.real_type), n;
|
|
3568
3595
|
}, e.timeTracker = function(e = "Time Tracker", t = !1) {
|
|
3569
3596
|
const n = e, r = performance.now();
|
|
@@ -3575,7 +3602,7 @@
|
|
|
3575
3602
|
total: _
|
|
3576
3603
|
};
|
|
3577
3604
|
} };
|
|
3578
|
-
}, e.trace_json = vn, e.trace_json_masked = Un, e.trace_level_t = P, e.trace_msg = Tn, e.treedb_decoder_fkey =
|
|
3605
|
+
}, e.trace_json = vn, e.trace_json_masked = Un, e.trace_level_t = P, e.trace_msg = Tn, e.treedb_decoder_fkey = al, e.treedb_decoder_hook = function(e, t) {
|
|
3579
3606
|
if (tr(t)) {
|
|
3580
3607
|
if (-1 === t.indexOf("^")) {
|
|
3581
3608
|
let n, r = e.hook;
|
|
@@ -3602,9 +3629,9 @@
|
|
|
3602
3629
|
id: t.id
|
|
3603
3630
|
} : (hn("bad hook 3"), hn(e), hn(t), null);
|
|
3604
3631
|
}, e.treedb_encoder_fkey = function(e, t) {
|
|
3605
|
-
let n =
|
|
3632
|
+
let n = al(e, t);
|
|
3606
3633
|
return n ? n.topic_name + "^" + n.id + "^" + n.hook_name : null;
|
|
3607
|
-
}, e.treedb_get_field_desc =
|
|
3634
|
+
}, e.treedb_get_field_desc = gl, e.treedb_hook_data_size = function(e) {
|
|
3608
3635
|
if (er(e) && 1 === Xn(e)) {
|
|
3609
3636
|
let t = e[0];
|
|
3610
3637
|
return gr(t, "size") ? t.size : 1;
|