@gudhub/core 1.2.4-beta.47 → 1.2.4-beta.48

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/gudhub.es.js CHANGED
@@ -100,21 +100,21 @@ function requireUtils$1() {
100
100
  for (var j = 0, F = x.length; j < F; j++)
101
101
  D.call(null, x[j], j, x);
102
102
  else
103
- for (var N in x)
104
- Object.prototype.hasOwnProperty.call(x, N) && D.call(null, x[N], N, x);
103
+ for (var M in x)
104
+ Object.prototype.hasOwnProperty.call(x, M) && D.call(null, x[M], M, x);
105
105
  }
106
106
  function b() {
107
107
  var x = {};
108
- function D(N, B) {
109
- d(x[B]) && d(N) ? x[B] = b(x[B], N) : d(N) ? x[B] = b({}, N) : t(N) ? x[B] = N.slice() : x[B] = N;
108
+ function D(M, B) {
109
+ d(x[B]) && d(M) ? x[B] = b(x[B], M) : d(M) ? x[B] = b({}, M) : t(M) ? x[B] = M.slice() : x[B] = M;
110
110
  }
111
111
  for (var j = 0, F = arguments.length; j < F; j++)
112
112
  g(arguments[j], D);
113
113
  return x;
114
114
  }
115
115
  function A(x, D, j) {
116
- return g(D, function(N, B) {
117
- j && typeof N == "function" ? x[B] = n(N, j) : x[B] = N;
116
+ return g(D, function(M, B) {
117
+ j && typeof M == "function" ? x[B] = n(M, j) : x[B] = M;
118
118
  }), x;
119
119
  }
120
120
  function q(x) {
@@ -1098,7 +1098,7 @@ function requireGetIntrinsic() {
1098
1098
  "%URIErrorPrototype%": ["URIError", "prototype"],
1099
1099
  "%WeakMapPrototype%": ["WeakMap", "prototype"],
1100
1100
  "%WeakSetPrototype%": ["WeakSet", "prototype"]
1101
- }, A = requireFunctionBind(), q = /* @__PURE__ */ requireHasown(), x = A.call(Function.call, Array.prototype.concat), D = A.call(Function.apply, Array.prototype.splice), j = A.call(Function.call, String.prototype.replace), F = A.call(Function.call, String.prototype.slice), N = A.call(Function.call, RegExp.prototype.exec), B = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g, U = /\\(\\)?/g, H = function(W) {
1101
+ }, A = requireFunctionBind(), q = /* @__PURE__ */ requireHasown(), x = A.call(Function.call, Array.prototype.concat), D = A.call(Function.apply, Array.prototype.splice), j = A.call(Function.call, String.prototype.replace), F = A.call(Function.call, String.prototype.slice), M = A.call(Function.call, RegExp.prototype.exec), B = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g, U = /\\(\\)?/g, H = function(W) {
1102
1102
  var te = F(W, 0, 1), Z = F(W, -1);
1103
1103
  if (te === "%" && Z !== "%")
1104
1104
  throw new a("invalid intrinsic syntax, expected closing `%`");
@@ -1127,15 +1127,15 @@ function requireGetIntrinsic() {
1127
1127
  throw new s("intrinsic name must be a non-empty string");
1128
1128
  if (arguments.length > 1 && typeof te != "boolean")
1129
1129
  throw new s('"allowMissing" argument must be a boolean');
1130
- if (N(/^%?[^%]*%?$/, W) === null)
1130
+ if (M(/^%?[^%]*%?$/, W) === null)
1131
1131
  throw new a("`%` may not be present anywhere but at the beginning and end of the intrinsic name");
1132
- var Z = H(W), V = Z.length > 0 ? Z[0] : "", pe = z("%" + V + "%", te), C = pe.name, k = pe.value, $ = !1, Y = pe.alias;
1133
- Y && (V = Y[0], D(Z, x([0, 1], Y)));
1134
- for (var se = 1, X = !0; se < Z.length; se += 1) {
1132
+ var Z = H(W), V = Z.length > 0 ? Z[0] : "", pe = z("%" + V + "%", te), C = pe.name, k = pe.value, $ = !1, Q = pe.alias;
1133
+ Q && (V = Q[0], D(Z, x([0, 1], Q)));
1134
+ for (var se = 1, Y = !0; se < Z.length; se += 1) {
1135
1135
  var ne = Z[se], ue = F(ne, 0, 1), le = F(ne, -1);
1136
1136
  if ((ue === '"' || ue === "'" || ue === "`" || le === '"' || le === "'" || le === "`") && ue !== le)
1137
1137
  throw new a("property names with quotes must have matching quotes");
1138
- if ((ne === "constructor" || !X) && ($ = !0), V += "." + ne, C = "%" + V + "%", q(S, C))
1138
+ if ((ne === "constructor" || !Y) && ($ = !0), V += "." + ne, C = "%" + V + "%", q(S, C))
1139
1139
  k = S[C];
1140
1140
  else if (k != null) {
1141
1141
  if (!(ne in k)) {
@@ -1145,10 +1145,10 @@ function requireGetIntrinsic() {
1145
1145
  }
1146
1146
  if (f && se + 1 >= Z.length) {
1147
1147
  var me = f(k, ne);
1148
- X = !!me, X && "get" in me && !("originalValue" in me.get) ? k = me.get : k = k[ne];
1148
+ Y = !!me, Y && "get" in me && !("originalValue" in me.get) ? k = me.get : k = k[ne];
1149
1149
  } else
1150
- X = q(k, ne), k = k[ne];
1151
- X && !$ && (S[C] = k);
1150
+ Y = q(k, ne), k = k[ne];
1151
+ Y && !$ && (S[C] = k);
1152
1152
  }
1153
1153
  }
1154
1154
  return k;
@@ -1299,7 +1299,7 @@ var objectInspect, hasRequiredObjectInspect;
1299
1299
  function requireObjectInspect() {
1300
1300
  if (hasRequiredObjectInspect) return objectInspect;
1301
1301
  hasRequiredObjectInspect = 1;
1302
- var n = typeof Map == "function" && Map.prototype, e = Object.getOwnPropertyDescriptor && n ? Object.getOwnPropertyDescriptor(Map.prototype, "size") : null, t = n && e && typeof e.get == "function" ? e.get : null, r = n && Map.prototype.forEach, i = typeof Set == "function" && Set.prototype, a = Object.getOwnPropertyDescriptor && i ? Object.getOwnPropertyDescriptor(Set.prototype, "size") : null, s = i && a && typeof a.get == "function" ? a.get : null, l = i && Set.prototype.forEach, u = typeof WeakMap == "function" && WeakMap.prototype, o = u ? WeakMap.prototype.has : null, f = typeof WeakSet == "function" && WeakSet.prototype, d = f ? WeakSet.prototype.has : null, h = typeof WeakRef == "function" && WeakRef.prototype, y = h ? WeakRef.prototype.deref : null, m = Boolean.prototype.valueOf, v = Object.prototype.toString, p = Function.prototype.toString, E = String.prototype.match, S = String.prototype.slice, w = String.prototype.replace, g = String.prototype.toUpperCase, b = String.prototype.toLowerCase, A = RegExp.prototype.test, q = Array.prototype.concat, x = Array.prototype.join, D = Array.prototype.slice, j = Math.floor, F = typeof BigInt == "function" ? BigInt.prototype.valueOf : null, N = Object.getOwnPropertySymbols, B = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? Symbol.prototype.toString : null, U = typeof Symbol == "function" && typeof Symbol.iterator == "object", H = typeof Symbol == "function" && Symbol.toStringTag && (typeof Symbol.toStringTag === U || !0) ? Symbol.toStringTag : null, z = Object.prototype.propertyIsEnumerable, K = (typeof Reflect == "function" ? Reflect.getPrototypeOf : Object.getPrototypeOf) || ([].__proto__ === Array.prototype ? function(O) {
1302
+ var n = typeof Map == "function" && Map.prototype, e = Object.getOwnPropertyDescriptor && n ? Object.getOwnPropertyDescriptor(Map.prototype, "size") : null, t = n && e && typeof e.get == "function" ? e.get : null, r = n && Map.prototype.forEach, i = typeof Set == "function" && Set.prototype, a = Object.getOwnPropertyDescriptor && i ? Object.getOwnPropertyDescriptor(Set.prototype, "size") : null, s = i && a && typeof a.get == "function" ? a.get : null, l = i && Set.prototype.forEach, u = typeof WeakMap == "function" && WeakMap.prototype, o = u ? WeakMap.prototype.has : null, f = typeof WeakSet == "function" && WeakSet.prototype, d = f ? WeakSet.prototype.has : null, h = typeof WeakRef == "function" && WeakRef.prototype, y = h ? WeakRef.prototype.deref : null, m = Boolean.prototype.valueOf, v = Object.prototype.toString, p = Function.prototype.toString, E = String.prototype.match, S = String.prototype.slice, w = String.prototype.replace, g = String.prototype.toUpperCase, b = String.prototype.toLowerCase, A = RegExp.prototype.test, q = Array.prototype.concat, x = Array.prototype.join, D = Array.prototype.slice, j = Math.floor, F = typeof BigInt == "function" ? BigInt.prototype.valueOf : null, M = Object.getOwnPropertySymbols, B = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? Symbol.prototype.toString : null, U = typeof Symbol == "function" && typeof Symbol.iterator == "object", H = typeof Symbol == "function" && Symbol.toStringTag && (typeof Symbol.toStringTag === U || !0) ? Symbol.toStringTag : null, z = Object.prototype.propertyIsEnumerable, K = (typeof Reflect == "function" ? Reflect.getPrototypeOf : Object.getPrototypeOf) || ([].__proto__ === Array.prototype ? function(O) {
1303
1303
  return O.__proto__;
1304
1304
  } : null);
1305
1305
  function W(O, P) {
@@ -1329,7 +1329,7 @@ function requireObjectInspect() {
1329
1329
  throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');
1330
1330
  if (Se(ae, "numericSeparator") && typeof ae.numericSeparator != "boolean")
1331
1331
  throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');
1332
- var Ne = ae.numericSeparator;
1332
+ var Me = ae.numericSeparator;
1333
1333
  if (typeof P > "u")
1334
1334
  return "undefined";
1335
1335
  if (P === null)
@@ -1342,11 +1342,11 @@ function requireObjectInspect() {
1342
1342
  if (P === 0)
1343
1343
  return 1 / 0 / P > 0 ? "0" : "-0";
1344
1344
  var Ee = String(P);
1345
- return Ne ? W(P, Ee) : Ee;
1345
+ return Me ? W(P, Ee) : Ee;
1346
1346
  }
1347
1347
  if (typeof P == "bigint") {
1348
1348
  var Re = String(P) + "n";
1349
- return Ne ? W(P, Re) : Re;
1349
+ return Me ? W(P, Re) : Re;
1350
1350
  }
1351
1351
  var He = typeof ae.depth > "u" ? 5 : ae.depth;
1352
1352
  if (typeof re > "u" && (re = 0), re >= He && He > 0 && typeof P == "object")
@@ -1365,27 +1365,27 @@ function requireObjectInspect() {
1365
1365
  }
1366
1366
  return O(ke, ae, re + 1, fe);
1367
1367
  }
1368
- if (typeof P == "function" && !Y(P)) {
1369
- var Je = Te(P), Ye = M(P, xe);
1370
- return "[Function" + (Je ? ": " + Je : " (anonymous)") + "]" + (Ye.length > 0 ? " { " + x.call(Ye, ", ") + " }" : "");
1368
+ if (typeof P == "function" && !Q(P)) {
1369
+ var Je = Te(P), Qe = N(P, xe);
1370
+ return "[Function" + (Je ? ": " + Je : " (anonymous)") + "]" + (Qe.length > 0 ? " { " + x.call(Qe, ", ") + " }" : "");
1371
1371
  }
1372
1372
  if (le(P)) {
1373
- var Xe = U ? w.call(String(P), /^(Symbol\(.*\))_[^)]*$/, "$1") : B.call(P);
1374
- return typeof P == "object" && !U ? Ie(Xe) : Xe;
1373
+ var Ye = U ? w.call(String(P), /^(Symbol\(.*\))_[^)]*$/, "$1") : B.call(P);
1374
+ return typeof P == "object" && !U ? Ie(Ye) : Ye;
1375
1375
  }
1376
- if (Me(P)) {
1377
- for (var Ue = "<" + b.call(String(P.nodeName)), Qe = P.attributes || [], Ge = 0; Ge < Qe.length; Ge++)
1378
- Ue += " " + Qe[Ge].name + "=" + pe(C(Qe[Ge].value), "double", ae);
1376
+ if (Ne(P)) {
1377
+ for (var Ue = "<" + b.call(String(P.nodeName)), Xe = P.attributes || [], Ge = 0; Ge < Xe.length; Ge++)
1378
+ Ue += " " + Xe[Ge].name + "=" + pe(C(Xe[Ge].value), "double", ae);
1379
1379
  return Ue += ">", P.childNodes && P.childNodes.length && (Ue += "..."), Ue += "</" + b.call(String(P.nodeName)) + ">", Ue;
1380
1380
  }
1381
1381
  if (k(P)) {
1382
1382
  if (P.length === 0)
1383
1383
  return "[]";
1384
- var Pe = M(P, xe);
1385
- return $e && !we(Pe) ? "[" + Q(Pe, $e) + "]" : "[ " + x.call(Pe, ", ") + " ]";
1384
+ var Pe = N(P, xe);
1385
+ return $e && !we(Pe) ? "[" + X(Pe, $e) + "]" : "[ " + x.call(Pe, ", ") + " ]";
1386
1386
  }
1387
1387
  if (se(P)) {
1388
- var Ve = M(P, xe);
1388
+ var Ve = N(P, xe);
1389
1389
  return !("cause" in Error.prototype) && "cause" in P && !z.call(P, "cause") ? "{ [" + String(P) + "] " + x.call(q.call("[cause]: " + xe(P.cause), Ve), ", ") + " }" : Ve.length === 0 ? "[" + String(P) + "]" : "{ [" + String(P) + "] " + x.call(Ve, ", ") + " }";
1390
1390
  }
1391
1391
  if (typeof P == "object" && qe) {
@@ -1420,15 +1420,15 @@ function requireObjectInspect() {
1420
1420
  return Ie(xe(F.call(P)));
1421
1421
  if (ue(P))
1422
1422
  return Ie(m.call(P));
1423
- if (X(P))
1423
+ if (Y(P))
1424
1424
  return Ie(xe(String(P)));
1425
1425
  if (typeof window < "u" && P === window)
1426
1426
  return "{ [object Window] }";
1427
1427
  if (P === commonjsGlobal)
1428
1428
  return "{ [object globalThis] }";
1429
- if (!$(P) && !Y(P)) {
1430
- var Ae = M(P, xe), he = K ? K(P) === Object.prototype : P instanceof Object || P.constructor === Object, Ze = P instanceof Object ? "" : "null prototype", We = !he && H && Object(P) === P && H in P ? S.call(be(P), 8, -1) : Ze ? "Object" : "", Ce = he || typeof P.constructor != "function" ? "" : P.constructor.name ? P.constructor.name + " " : "", et = Ce + (We || Ze ? "[" + x.call(q.call([], We || [], Ze || []), ": ") + "] " : "");
1431
- return Ae.length === 0 ? et + "{}" : $e ? et + "{" + Q(Ae, $e) + "}" : et + "{ " + x.call(Ae, ", ") + " }";
1429
+ if (!$(P) && !Q(P)) {
1430
+ var Ae = N(P, xe), he = K ? K(P) === Object.prototype : P instanceof Object || P.constructor === Object, Ze = P instanceof Object ? "" : "null prototype", We = !he && H && Object(P) === P && H in P ? S.call(be(P), 8, -1) : Ze ? "Object" : "", Ce = he || typeof P.constructor != "function" ? "" : P.constructor.name ? P.constructor.name + " " : "", et = Ce + (We || Ze ? "[" + x.call(q.call([], We || [], Ze || []), ": ") + "] " : "");
1431
+ return Ae.length === 0 ? et + "{}" : $e ? et + "{" + X(Ae, $e) + "}" : et + "{ " + x.call(Ae, ", ") + " }";
1432
1432
  }
1433
1433
  return String(P);
1434
1434
  };
@@ -1445,13 +1445,13 @@ function requireObjectInspect() {
1445
1445
  function $(O) {
1446
1446
  return be(O) === "[object Date]" && (!H || !(typeof O == "object" && H in O));
1447
1447
  }
1448
- function Y(O) {
1448
+ function Q(O) {
1449
1449
  return be(O) === "[object RegExp]" && (!H || !(typeof O == "object" && H in O));
1450
1450
  }
1451
1451
  function se(O) {
1452
1452
  return be(O) === "[object Error]" && (!H || !(typeof O == "object" && H in O));
1453
1453
  }
1454
- function X(O) {
1454
+ function Y(O) {
1455
1455
  return be(O) === "[object String]" && (!H || !(typeof O == "object" && H in O));
1456
1456
  }
1457
1457
  function ne(O) {
@@ -1574,7 +1574,7 @@ function requireObjectInspect() {
1574
1574
  }
1575
1575
  return !1;
1576
1576
  }
1577
- function Me(O) {
1577
+ function Ne(O) {
1578
1578
  return !O || typeof O != "object" ? !1 : typeof HTMLElement < "u" && O instanceof HTMLElement ? !0 : typeof O.nodeName == "string" && typeof O.getAttribute == "function";
1579
1579
  }
1580
1580
  function Oe(O, P) {
@@ -1602,7 +1602,7 @@ function requireObjectInspect() {
1602
1602
  return O + " { ? }";
1603
1603
  }
1604
1604
  function ce(O, P, G, re) {
1605
- var fe = re ? Q(G, re) : x.call(G, ", ");
1605
+ var fe = re ? X(G, re) : x.call(G, ", ");
1606
1606
  return O + " (" + P + ") {" + fe + "}";
1607
1607
  }
1608
1608
  function we(O) {
@@ -1625,7 +1625,7 @@ function requireObjectInspect() {
1625
1625
  prev: x.call(Array(P + 1), G)
1626
1626
  };
1627
1627
  }
1628
- function Q(O, P) {
1628
+ function X(O, P) {
1629
1629
  if (O.length === 0)
1630
1630
  return "";
1631
1631
  var G = `
@@ -1633,22 +1633,22 @@ function requireObjectInspect() {
1633
1633
  return G + x.call(O, "," + G) + `
1634
1634
  ` + P.prev;
1635
1635
  }
1636
- function M(O, P) {
1636
+ function N(O, P) {
1637
1637
  var G = k(O), re = [];
1638
1638
  if (G) {
1639
1639
  re.length = O.length;
1640
1640
  for (var fe = 0; fe < O.length; fe++)
1641
1641
  re[fe] = Se(O, fe) ? P(O[fe], O) : "";
1642
1642
  }
1643
- var ae = typeof N == "function" ? N(O) : [], qe;
1643
+ var ae = typeof M == "function" ? M(O) : [], qe;
1644
1644
  if (U) {
1645
1645
  qe = {};
1646
- for (var Ne = 0; Ne < ae.length; Ne++)
1647
- qe["$" + ae[Ne]] = ae[Ne];
1646
+ for (var Me = 0; Me < ae.length; Me++)
1647
+ qe["$" + ae[Me]] = ae[Me];
1648
1648
  }
1649
1649
  for (var Ee in O)
1650
1650
  Se(O, Ee) && (G && String(Number(Ee)) === Ee && Ee < O.length || U && qe["$" + Ee] instanceof Symbol || (A.call(/[^\w$]/, Ee) ? re.push(P(Ee, O) + ": " + P(O[Ee], O)) : re.push(Ee + ": " + P(O[Ee], O))));
1651
- if (typeof N == "function")
1651
+ if (typeof M == "function")
1652
1652
  for (var Re = 0; Re < ae.length; Re++)
1653
1653
  z.call(O, ae[Re]) && re.push("[" + P(ae[Re]) + "]: " + P(O[ae[Re]], O));
1654
1654
  return re;
@@ -1903,7 +1903,7 @@ function requireStringify() {
1903
1903
  strictNullHandling: !1
1904
1904
  }, d = function(p) {
1905
1905
  return typeof p == "string" || typeof p == "number" || typeof p == "boolean" || typeof p == "symbol" || typeof p == "bigint";
1906
- }, h = {}, y = function v(p, E, S, w, g, b, A, q, x, D, j, F, N, B, U, H) {
1906
+ }, h = {}, y = function v(p, E, S, w, g, b, A, q, x, D, j, F, M, B, U, H) {
1907
1907
  for (var z = p, K = H, W = 0, te = !1; (K = K.get(h)) !== void 0 && !te; ) {
1908
1908
  var Z = K.get(p);
1909
1909
  if (W += 1, typeof Z < "u") {
@@ -1923,9 +1923,9 @@ function requireStringify() {
1923
1923
  if (d(z) || e.isBuffer(z)) {
1924
1924
  if (A) {
1925
1925
  var V = B ? E : A(E, f.encoder, U, "key", F);
1926
- return [N(V) + "=" + N(A(z, f.encoder, U, "value", F))];
1926
+ return [M(V) + "=" + M(A(z, f.encoder, U, "value", F))];
1927
1927
  }
1928
- return [N(E) + "=" + N(String(z))];
1928
+ return [M(E) + "=" + M(String(z))];
1929
1929
  }
1930
1930
  var pe = [];
1931
1931
  if (typeof z > "u")
@@ -1941,13 +1941,13 @@ function requireStringify() {
1941
1941
  var k = Object.keys(z);
1942
1942
  C = x ? k.sort(x) : k;
1943
1943
  }
1944
- for (var $ = w && a(z) && z.length === 1 ? E + "[]" : E, Y = 0; Y < C.length; ++Y) {
1945
- var se = C[Y], X = typeof se == "object" && typeof se.value < "u" ? se.value : z[se];
1946
- if (!(b && X === null)) {
1944
+ for (var $ = w && a(z) && z.length === 1 ? E + "[]" : E, Q = 0; Q < C.length; ++Q) {
1945
+ var se = C[Q], Y = typeof se == "object" && typeof se.value < "u" ? se.value : z[se];
1946
+ if (!(b && Y === null)) {
1947
1947
  var ne = a(z) ? typeof S == "function" ? S($, se) : $ : $ + (D ? "." + se : "[" + se + "]");
1948
1948
  H.set(p, W);
1949
1949
  var ue = n();
1950
- ue.set(h, H), l(pe, v(X, ne, S, w, g, b, S === "comma" && B && a(z) ? null : A, q, x, D, j, F, N, B, U, ue));
1950
+ ue.set(h, H), l(pe, v(Y, ne, S, w, g, b, S === "comma" && B && a(z) ? null : A, q, x, D, j, F, M, B, U, ue));
1951
1951
  }
1952
1952
  }
1953
1953
  return pe;
@@ -2001,8 +2001,8 @@ function requireStringify() {
2001
2001
  var F = w[j];
2002
2002
  S.skipNulls && E[F] === null || l(b, y(E[F], F, q, x, S.strictNullHandling, S.skipNulls, S.encode ? S.encoder : null, S.filter, S.sort, S.allowDots, S.serializeDate, S.format, S.formatter, S.encodeValuesOnly, S.charset, D));
2003
2003
  }
2004
- var N = b.join(S.delimiter), B = S.addQueryPrefix === !0 ? "?" : "";
2005
- return S.charsetSentinel && (S.charset === "iso-8859-1" ? B += "utf8=%26%2310003%3B&" : B += "utf8=%E2%9C%93&"), N.length > 0 ? B + N : "";
2004
+ var M = b.join(S.delimiter), B = S.addQueryPrefix === !0 ? "?" : "";
2005
+ return S.charsetSentinel && (S.charset === "iso-8859-1" ? B += "utf8=%26%2310003%3B&" : B += "utf8=%E2%9C%93&"), M.length > 0 ? B + M : "";
2006
2006
  }, stringify_1;
2007
2007
  }
2008
2008
  var parse$1, hasRequiredParse;
@@ -2878,9 +2878,9 @@ function require_export() {
2878
2878
  return h.prototype = d.prototype, h;
2879
2879
  };
2880
2880
  return _export = function(d, h) {
2881
- var y = d.target, m = d.global, v = d.stat, p = d.proto, E = m ? n : v ? n[y] : n[y] && n[y].prototype, S = m ? s : s[y] || u(s, y, {})[y], w = S.prototype, g, b, A, q, x, D, j, F, N;
2881
+ var y = d.target, m = d.global, v = d.stat, p = d.proto, E = m ? n : v ? n[y] : n[y] && n[y].prototype, S = m ? s : s[y] || u(s, y, {})[y], w = S.prototype, g, b, A, q, x, D, j, F, M;
2882
2882
  for (q in h)
2883
- g = a(m ? q : y + (v ? "." : "#") + q, d.forced), b = !g && E && o(E, q), D = S[q], b && (d.dontCallGetSet ? (N = i(E, q), j = N && N.value) : j = E[q]), x = b && j ? j : h[q], !(!g && !p && typeof D == typeof x) && (d.bind && b ? F = l(x, n) : d.wrap && b ? F = f(x) : p && r(x) ? F = t(x) : F = x, (d.sham || x && x.sham || D && D.sham) && u(F, "sham", !0), u(S, q, F), p && (A = y + "Prototype", o(s, A) || u(s, A, {}), u(s[A], q, x), d.real && w && (g || !w[q]) && u(w, q, x)));
2883
+ g = a(m ? q : y + (v ? "." : "#") + q, d.forced), b = !g && E && o(E, q), D = S[q], b && (d.dontCallGetSet ? (M = i(E, q), j = M && M.value) : j = E[q]), x = b && j ? j : h[q], !(!g && !p && typeof D == typeof x) && (d.bind && b ? F = l(x, n) : d.wrap && b ? F = f(x) : p && r(x) ? F = t(x) : F = x, (d.sham || x && x.sham || D && D.sham) && u(F, "sham", !0), u(S, q, F), p && (A = y + "Prototype", o(s, A) || u(s, A, {}), u(s[A], q, x), d.real && w && (g || !w[q]) && u(w, q, x)));
2884
2884
  }, _export;
2885
2885
  }
2886
2886
  var mathTrunc, hasRequiredMathTrunc;
@@ -3362,9 +3362,9 @@ function requireArrayIteration() {
3362
3362
  var n = /* @__PURE__ */ requireFunctionBindContext(), e = /* @__PURE__ */ requireFunctionUncurryThis(), t = /* @__PURE__ */ requireIndexedObject(), r = /* @__PURE__ */ requireToObject(), i = /* @__PURE__ */ requireLengthOfArrayLike(), a = /* @__PURE__ */ requireArraySpeciesCreate(), s = e([].push), l = function(u) {
3363
3363
  var o = u === 1, f = u === 2, d = u === 3, h = u === 4, y = u === 6, m = u === 7, v = u === 5 || y;
3364
3364
  return function(p, E, S, w) {
3365
- for (var g = r(p), b = t(g), A = i(b), q = n(E, S), x = 0, D = w || a, j = o ? D(p, A) : f || m ? D(p, 0) : void 0, F, N; A > x; x++) if ((v || x in b) && (F = b[x], N = q(F, x, g), u))
3366
- if (o) j[x] = N;
3367
- else if (N) switch (u) {
3365
+ for (var g = r(p), b = t(g), A = i(b), q = n(E, S), x = 0, D = w || a, j = o ? D(p, A) : f || m ? D(p, 0) : void 0, F, M; A > x; x++) if ((v || x in b) && (F = b[x], M = q(F, x, g), u))
3366
+ if (o) j[x] = M;
3367
+ else if (M) switch (u) {
3368
3368
  case 3:
3369
3369
  return !0;
3370
3370
  // some
@@ -3418,9 +3418,9 @@ var hasRequiredEs_symbol_constructor;
3418
3418
  function requireEs_symbol_constructor() {
3419
3419
  if (hasRequiredEs_symbol_constructor) return es_symbol_constructor;
3420
3420
  hasRequiredEs_symbol_constructor = 1;
3421
- var n = /* @__PURE__ */ require_export(), e = /* @__PURE__ */ requireGlobalThis(), t = /* @__PURE__ */ requireFunctionCall(), r = /* @__PURE__ */ requireFunctionUncurryThis(), i = /* @__PURE__ */ requireIsPure(), a = /* @__PURE__ */ requireDescriptors(), s = /* @__PURE__ */ requireSymbolConstructorDetection(), l = /* @__PURE__ */ requireFails(), u = /* @__PURE__ */ requireHasOwnProperty(), o = /* @__PURE__ */ requireObjectIsPrototypeOf(), f = /* @__PURE__ */ requireAnObject(), d = /* @__PURE__ */ requireToIndexedObject(), h = /* @__PURE__ */ requireToPropertyKey(), y = /* @__PURE__ */ requireToString(), m = /* @__PURE__ */ requireCreatePropertyDescriptor(), v = /* @__PURE__ */ requireObjectCreate(), p = /* @__PURE__ */ requireObjectKeys(), E = /* @__PURE__ */ requireObjectGetOwnPropertyNames(), S = /* @__PURE__ */ requireObjectGetOwnPropertyNamesExternal(), w = /* @__PURE__ */ requireObjectGetOwnPropertySymbols(), g = /* @__PURE__ */ requireObjectGetOwnPropertyDescriptor(), b = /* @__PURE__ */ requireObjectDefineProperty(), A = /* @__PURE__ */ requireObjectDefineProperties(), q = /* @__PURE__ */ requireObjectPropertyIsEnumerable(), x = /* @__PURE__ */ requireDefineBuiltIn(), D = /* @__PURE__ */ requireDefineBuiltInAccessor(), j = /* @__PURE__ */ requireShared(), F = /* @__PURE__ */ requireSharedKey(), N = /* @__PURE__ */ requireHiddenKeys(), B = /* @__PURE__ */ requireUid(), U = /* @__PURE__ */ requireWellKnownSymbol(), H = /* @__PURE__ */ requireWellKnownSymbolWrapped(), z = /* @__PURE__ */ requireWellKnownSymbolDefine(), K = /* @__PURE__ */ requireSymbolDefineToPrimitive(), W = /* @__PURE__ */ requireSetToStringTag(), te = /* @__PURE__ */ requireInternalState(), Z = requireArrayIteration().forEach, V = F("hidden"), pe = "Symbol", C = "prototype", k = te.set, $ = te.getterFor(pe), Y = Object[C], se = e.Symbol, X = se && se[C], ne = e.RangeError, ue = e.TypeError, le = e.QObject, me = g.f, ve = b.f, Se = S.f, be = q.f, Te = r([].push), ye = j("symbols"), Fe = j("op-symbols"), ze = j("wks"), je = !le || !le[C] || !le[C].findChild, Be = function(Q, M, O) {
3422
- var P = me(Y, M);
3423
- P && delete Y[M], ve(Q, M, O), P && Q !== Y && ve(Y, M, P);
3421
+ var n = /* @__PURE__ */ require_export(), e = /* @__PURE__ */ requireGlobalThis(), t = /* @__PURE__ */ requireFunctionCall(), r = /* @__PURE__ */ requireFunctionUncurryThis(), i = /* @__PURE__ */ requireIsPure(), a = /* @__PURE__ */ requireDescriptors(), s = /* @__PURE__ */ requireSymbolConstructorDetection(), l = /* @__PURE__ */ requireFails(), u = /* @__PURE__ */ requireHasOwnProperty(), o = /* @__PURE__ */ requireObjectIsPrototypeOf(), f = /* @__PURE__ */ requireAnObject(), d = /* @__PURE__ */ requireToIndexedObject(), h = /* @__PURE__ */ requireToPropertyKey(), y = /* @__PURE__ */ requireToString(), m = /* @__PURE__ */ requireCreatePropertyDescriptor(), v = /* @__PURE__ */ requireObjectCreate(), p = /* @__PURE__ */ requireObjectKeys(), E = /* @__PURE__ */ requireObjectGetOwnPropertyNames(), S = /* @__PURE__ */ requireObjectGetOwnPropertyNamesExternal(), w = /* @__PURE__ */ requireObjectGetOwnPropertySymbols(), g = /* @__PURE__ */ requireObjectGetOwnPropertyDescriptor(), b = /* @__PURE__ */ requireObjectDefineProperty(), A = /* @__PURE__ */ requireObjectDefineProperties(), q = /* @__PURE__ */ requireObjectPropertyIsEnumerable(), x = /* @__PURE__ */ requireDefineBuiltIn(), D = /* @__PURE__ */ requireDefineBuiltInAccessor(), j = /* @__PURE__ */ requireShared(), F = /* @__PURE__ */ requireSharedKey(), M = /* @__PURE__ */ requireHiddenKeys(), B = /* @__PURE__ */ requireUid(), U = /* @__PURE__ */ requireWellKnownSymbol(), H = /* @__PURE__ */ requireWellKnownSymbolWrapped(), z = /* @__PURE__ */ requireWellKnownSymbolDefine(), K = /* @__PURE__ */ requireSymbolDefineToPrimitive(), W = /* @__PURE__ */ requireSetToStringTag(), te = /* @__PURE__ */ requireInternalState(), Z = requireArrayIteration().forEach, V = F("hidden"), pe = "Symbol", C = "prototype", k = te.set, $ = te.getterFor(pe), Q = Object[C], se = e.Symbol, Y = se && se[C], ne = e.RangeError, ue = e.TypeError, le = e.QObject, me = g.f, ve = b.f, Se = S.f, be = q.f, Te = r([].push), ye = j("symbols"), Fe = j("op-symbols"), ze = j("wks"), je = !le || !le[C] || !le[C].findChild, Be = function(X, N, O) {
3422
+ var P = me(Q, N);
3423
+ P && delete Q[N], ve(X, N, O), P && X !== Q && ve(Q, N, P);
3424
3424
  }, ie = a && l(function() {
3425
3425
  return v(ve({}, "a", {
3426
3426
  get: function() {
@@ -3429,52 +3429,52 @@ function requireEs_symbol_constructor() {
3429
3429
  }).a;
3430
3430
  }
3431
3431
  })).a !== 7;
3432
- }) ? Be : ve, Me = function(Q, M) {
3433
- var O = ye[Q] = v(X);
3432
+ }) ? Be : ve, Ne = function(X, N) {
3433
+ var O = ye[X] = v(Y);
3434
3434
  return k(O, {
3435
3435
  type: pe,
3436
- tag: Q,
3437
- description: M
3438
- }), a || (O.description = M), O;
3439
- }, Oe = function(M, O, P) {
3440
- M === Y && Oe(Fe, O, P), f(M);
3436
+ tag: X,
3437
+ description: N
3438
+ }), a || (O.description = N), O;
3439
+ }, Oe = function(N, O, P) {
3440
+ N === Q && Oe(Fe, O, P), f(N);
3441
3441
  var G = h(O);
3442
- return f(P), u(ye, G) ? (P.enumerable ? (u(M, V) && M[V][G] && (M[V][G] = !1), P = v(P, {
3442
+ return f(P), u(ye, G) ? (P.enumerable ? (u(N, V) && N[V][G] && (N[V][G] = !1), P = v(P, {
3443
3443
  enumerable: m(0, !1)
3444
- })) : (u(M, V) || ve(M, V, m(1, v(null))), M[V][G] = !0), ie(M, G, P)) : ve(M, G, P);
3445
- }, Le = function(M, O) {
3446
- f(M);
3444
+ })) : (u(N, V) || ve(N, V, m(1, v(null))), N[V][G] = !0), ie(N, G, P)) : ve(N, G, P);
3445
+ }, Le = function(N, O) {
3446
+ f(N);
3447
3447
  var P = d(O), G = p(P).concat(J(P));
3448
3448
  return Z(G, function(re) {
3449
- (!a || t(ee, P, re)) && Oe(M, re, P[re]);
3450
- }), M;
3451
- }, Ie = function(M, O) {
3452
- return O === void 0 ? v(M) : Le(v(M), O);
3453
- }, ee = function(M) {
3454
- var O = h(M), P = t(be, this, O);
3455
- return this === Y && u(ye, O) && !u(Fe, O) ? !1 : P || !u(this, O) || !u(ye, O) || u(this, V) && this[V][O] ? P : !0;
3456
- }, ce = function(M, O) {
3457
- var P = d(M), G = h(O);
3458
- if (!(P === Y && u(ye, G) && !u(Fe, G))) {
3449
+ (!a || t(ee, P, re)) && Oe(N, re, P[re]);
3450
+ }), N;
3451
+ }, Ie = function(N, O) {
3452
+ return O === void 0 ? v(N) : Le(v(N), O);
3453
+ }, ee = function(N) {
3454
+ var O = h(N), P = t(be, this, O);
3455
+ return this === Q && u(ye, O) && !u(Fe, O) ? !1 : P || !u(this, O) || !u(ye, O) || u(this, V) && this[V][O] ? P : !0;
3456
+ }, ce = function(N, O) {
3457
+ var P = d(N), G = h(O);
3458
+ if (!(P === Q && u(ye, G) && !u(Fe, G))) {
3459
3459
  var re = me(P, G);
3460
3460
  return re && u(ye, G) && !(u(P, V) && P[V][G]) && (re.enumerable = !0), re;
3461
3461
  }
3462
- }, we = function(M) {
3463
- var O = Se(d(M)), P = [];
3462
+ }, we = function(N) {
3463
+ var O = Se(d(N)), P = [];
3464
3464
  return Z(O, function(G) {
3465
- !u(ye, G) && !u(N, G) && Te(P, G);
3465
+ !u(ye, G) && !u(M, G) && Te(P, G);
3466
3466
  }), P;
3467
- }, J = function(Q) {
3468
- var M = Q === Y, O = Se(M ? Fe : d(Q)), P = [];
3467
+ }, J = function(X) {
3468
+ var N = X === Q, O = Se(N ? Fe : d(X)), P = [];
3469
3469
  return Z(O, function(G) {
3470
- u(ye, G) && (!M || u(Y, G)) && Te(P, ye[G]);
3470
+ u(ye, G) && (!N || u(Q, G)) && Te(P, ye[G]);
3471
3471
  }), P;
3472
3472
  };
3473
3473
  return s || (se = function() {
3474
- if (o(X, this)) throw new ue("Symbol is not a constructor");
3475
- var M = !arguments.length || arguments[0] === void 0 ? void 0 : y(arguments[0]), O = B(M), P = function(G) {
3474
+ if (o(Y, this)) throw new ue("Symbol is not a constructor");
3475
+ var N = !arguments.length || arguments[0] === void 0 ? void 0 : y(arguments[0]), O = B(N), P = function(G) {
3476
3476
  var re = this === void 0 ? e : this;
3477
- re === Y && t(P, Fe, G), u(re, V) && u(re[V], O) && (re[V][O] = !1);
3477
+ re === Q && t(P, Fe, G), u(re, V) && u(re[V], O) && (re[V][O] = !1);
3478
3478
  var fe = m(1, G);
3479
3479
  try {
3480
3480
  ie(re, O, fe);
@@ -3483,22 +3483,22 @@ function requireEs_symbol_constructor() {
3483
3483
  Be(re, O, fe);
3484
3484
  }
3485
3485
  };
3486
- return a && je && ie(Y, O, {
3486
+ return a && je && ie(Q, O, {
3487
3487
  configurable: !0,
3488
3488
  set: P
3489
- }), Me(O, M);
3490
- }, X = se[C], x(X, "toString", function() {
3489
+ }), Ne(O, N);
3490
+ }, Y = se[C], x(Y, "toString", function() {
3491
3491
  return $(this).tag;
3492
- }), x(se, "withoutSetter", function(Q) {
3493
- return Me(B(Q), Q);
3494
- }), q.f = ee, b.f = Oe, A.f = Le, g.f = ce, E.f = S.f = we, w.f = J, H.f = function(Q) {
3495
- return Me(U(Q), Q);
3496
- }, a && (D(X, "description", {
3492
+ }), x(se, "withoutSetter", function(X) {
3493
+ return Ne(B(X), X);
3494
+ }), q.f = ee, b.f = Oe, A.f = Le, g.f = ce, E.f = S.f = we, w.f = J, H.f = function(X) {
3495
+ return Ne(U(X), X);
3496
+ }, a && (D(Y, "description", {
3497
3497
  configurable: !0,
3498
3498
  get: function() {
3499
3499
  return $(this).description;
3500
3500
  }
3501
- }), i || x(Y, "propertyIsEnumerable", ee, {
3501
+ }), i || x(Q, "propertyIsEnumerable", ee, {
3502
3502
  unsafe: !0
3503
3503
  }))), n({
3504
3504
  global: !0,
@@ -3508,8 +3508,8 @@ function requireEs_symbol_constructor() {
3508
3508
  sham: !s
3509
3509
  }, {
3510
3510
  Symbol: se
3511
- }), Z(p(ze), function(Q) {
3512
- z(Q);
3511
+ }), Z(p(ze), function(X) {
3512
+ z(X);
3513
3513
  }), n({
3514
3514
  target: pe,
3515
3515
  stat: !0,
@@ -3547,7 +3547,7 @@ function requireEs_symbol_constructor() {
3547
3547
  // `Object.getOwnPropertyNames` method
3548
3548
  // https://tc39.es/ecma262/#sec-object.getownpropertynames
3549
3549
  getOwnPropertyNames: we
3550
- }), K(), W(se, pe), N[V] = !0, es_symbol_constructor;
3550
+ }), K(), W(se, pe), M[V] = !0, es_symbol_constructor;
3551
3551
  }
3552
3552
  var es_symbol_for = {}, symbolRegistryDetection, hasRequiredSymbolRegistryDetection;
3553
3553
  function requireSymbolRegistryDetection() {
@@ -3624,14 +3624,14 @@ function requireEs_json_stringify() {
3624
3624
  }), A = a(function() {
3625
3625
  return h("\uDF06\uD834") !== '"\\udf06\\ud834"' || h("\uDEAD") !== '"\\udead"';
3626
3626
  }), q = function(D, j) {
3627
- var F = u(arguments), N = o(j);
3628
- if (!(!s(N) && (D === void 0 || l(D))))
3627
+ var F = u(arguments), M = o(j);
3628
+ if (!(!s(M) && (D === void 0 || l(D))))
3629
3629
  return F[1] = function(B, U) {
3630
- if (s(N) && (U = r(N, this, d(B), U)), !l(U)) return U;
3630
+ if (s(M) && (U = r(M, this, d(B), U)), !l(U)) return U;
3631
3631
  }, t(h, null, F);
3632
3632
  }, x = function(D, j, F) {
3633
- var N = m(F, j - 1), B = m(F, j + 1);
3634
- return y(w, D) && !y(g, B) || y(g, D) && !y(w, N) ? "\\u" + E(v(D, 0), 16) : D;
3633
+ var M = m(F, j - 1), B = m(F, j + 1);
3634
+ return y(w, D) && !y(g, B) || y(g, D) && !y(w, M) ? "\\u" + E(v(D, 0), 16) : D;
3635
3635
  };
3636
3636
  return h && n({
3637
3637
  target: "JSON",
@@ -3640,7 +3640,7 @@ function requireEs_json_stringify() {
3640
3640
  forced: b || A
3641
3641
  }, {
3642
3642
  // eslint-disable-next-line no-unused-vars -- required for `.length`
3643
- stringify: function(j, F, N) {
3643
+ stringify: function(j, F, M) {
3644
3644
  var B = u(arguments), U = t(b ? q : h, null, B);
3645
3645
  return A && typeof U == "string" ? p(U, S, x) : U;
3646
3646
  }
@@ -4469,7 +4469,7 @@ function requireIteratorDefine() {
4469
4469
  var n = /* @__PURE__ */ require_export(), e = /* @__PURE__ */ requireFunctionCall(), t = /* @__PURE__ */ requireIsPure(), r = /* @__PURE__ */ requireFunctionName(), i = /* @__PURE__ */ requireIsCallable(), a = /* @__PURE__ */ requireIteratorCreateConstructor(), s = /* @__PURE__ */ requireObjectGetPrototypeOf(), l = /* @__PURE__ */ requireObjectSetPrototypeOf(), u = /* @__PURE__ */ requireSetToStringTag(), o = /* @__PURE__ */ requireCreateNonEnumerableProperty(), f = /* @__PURE__ */ requireDefineBuiltIn(), d = /* @__PURE__ */ requireWellKnownSymbol(), h = /* @__PURE__ */ requireIterators(), y = /* @__PURE__ */ requireIteratorsCore(), m = r.PROPER, v = r.CONFIGURABLE, p = y.IteratorPrototype, E = y.BUGGY_SAFARI_ITERATORS, S = d("iterator"), w = "keys", g = "values", b = "entries", A = function() {
4470
4470
  return this;
4471
4471
  };
4472
- return iteratorDefine = function(q, x, D, j, F, N, B) {
4472
+ return iteratorDefine = function(q, x, D, j, F, M, B) {
4473
4473
  a(D, x, j);
4474
4474
  var U = function(k) {
4475
4475
  if (k === F && te) return te;
@@ -4497,7 +4497,7 @@ function requireIteratorDefine() {
4497
4497
  })), F)
4498
4498
  if (pe = {
4499
4499
  values: U(g),
4500
- keys: N ? te : U(w),
4500
+ keys: M ? te : U(w),
4501
4501
  entries: U(b)
4502
4502
  }, B) for (C in pe)
4503
4503
  (E || z || !(C in K)) && f(K, C, pe[C]);
@@ -6304,13 +6304,6 @@ function generateModulesList(n, e, t) {
6304
6304
  url: e + "/" + t + "turbo_sms.js",
6305
6305
  type: "automation",
6306
6306
  icon: "email"
6307
- },
6308
- {
6309
- data_type: "JsCode",
6310
- name: "Js Code",
6311
- url: e + "/" + t + "js_code.js",
6312
- type: "automation",
6313
- icon: "code_editor"
6314
6307
  }
6315
6308
  ];
6316
6309
  }
@@ -6387,13 +6380,11 @@ function requireBrowser() {
6387
6380
  }), browser;
6388
6381
  }
6389
6382
  var browserExports = requireBrowser();
6390
- const Websocket = /* @__PURE__ */ getDefaultExportFromCjs(browserExports), IS_BROWSER_MAIN_THREAD = ![typeof window, typeof document].includes("undefined"), IS_BROWSER_WORKER = typeof self == "object" && typeof WorkerGlobalScope < "u", IS_BROWSER = IS_BROWSER_MAIN_THREAD || IS_BROWSER_WORKER;
6391
- typeof process < "u" && // @ts-expect-error
6392
- process.versions != null && // @ts-expect-error
6393
- process.versions.node != null;
6383
+ const Websocket = /* @__PURE__ */ getDefaultExportFromCjs(browserExports), IS_BROWSER_MAIN_THREAD = typeof window < "u" && typeof document < "u", IS_BROWSER_WORKER_THREAD = typeof self == "object" && typeof WorkerGlobalScope < "u", IS_BROWSER = IS_BROWSER_MAIN_THREAD || IS_BROWSER_WORKER_THREAD;
6384
+ typeof process < "u" && process.versions != null && process.versions.node != null;
6394
6385
  class WebSocketApi {
6395
6386
  constructor(e, t) {
6396
- this.websocket = null, this.connected = !1, this.queue = [], this.url = e, this.auth = t, this.heartBeatTimeStemp = 1e13, this.ALLOWED_HEART_BEAT_DELEY = 12e3, this.firstHeartBeat = !0, this.reload = !0, this.isBrowser = IS_BROWSER;
6387
+ this.websocket = null, this.connected = !1, this.queue = [], this.url = e, this.auth = t, this.heartBeatTimeStemp = 1e13, this.ALLOWED_HEART_BEAT_DELEY = 12e3, this.firstHeartBeat = !0, this.reload = !0, this.isBrowser = IS_BROWSER_MAIN_THREAD;
6397
6388
  }
6398
6389
  async addSubscription(e) {
6399
6390
  const t = await this.auth.getToken(), r = "token=".concat(t, "/~/app_id=").concat(e);
@@ -6447,7 +6438,9 @@ class WebSocketApi {
6447
6438
  }
6448
6439
  }
6449
6440
  }
6450
- const server_url = "https://gudhub.com/GudHub_Test", wss_url = "wss://gudhub.com/GudHub/ws/app/", node_server_url = "https://gudhub.com/api/services/prod", async_modules_path = "build/latest/async_modules_node/", automation_modules_path = "build/latest/automation_modules/", file_server_url = "https://gudhub.com", cache_chunk_requests = !0, cache_app_requests = !0;
6441
+ const server_url = "https://gudhub.com/GudHub_Test", wss_url = "wss://gudhub.com/GudHub/ws/app/", node_server_url = "https://gudhub.com/api/services/prod", async_modules_path = "build/latest/async_modules_node/", automation_modules_path = "build/latest/automation_modules/", file_server_url = "https://gudhub.com", cache_chunk_requests = !0;
6442
+ let useWorkerToProcessRequestsData = !0;
6443
+ IS_BROWSER || (useWorkerToProcessRequestsData = !1);
6451
6444
  async function filterPreparation(n, e, t) {
6452
6445
  let r = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
6453
6446
  const i = [], a = {
@@ -6883,11 +6876,11 @@ function search(n, e, t) {
6883
6876
  ignoreLocation: o
6884
6877
  }) <= y ? x = D : g = D, D = Math.floor((g - x) / 2 + x);
6885
6878
  g = D;
6886
- let j = Math.max(1, h - D + 1), F = s ? d : Math.min(h + D, d) + f, N = Array(F + 2);
6887
- N[F + 1] = (1 << q) - 1;
6879
+ let j = Math.max(1, h - D + 1), F = s ? d : Math.min(h + D, d) + f, M = Array(F + 2);
6880
+ M[F + 1] = (1 << q) - 1;
6888
6881
  for (let U = F; U >= j; U -= 1) {
6889
6882
  let H = U - 1, z = t[n.charAt(H)];
6890
- if (v && (p[H] = +!!z), N[U] = (N[U + 1] << 1 | 1) & z, q && (N[U] |= (S[U + 1] | S[U]) << 1 | 1 | S[U + 1]), N[U] & b && (w = computeScore$1(e, {
6883
+ if (v && (p[H] = +!!z), M[U] = (M[U + 1] << 1 | 1) & z, q && (M[U] |= (S[U + 1] | S[U]) << 1 | 1 | S[U + 1]), M[U] & b && (w = computeScore$1(e, {
6891
6884
  errors: q,
6892
6885
  currentLocation: H,
6893
6886
  expectedLocation: h,
@@ -6907,7 +6900,7 @@ function search(n, e, t) {
6907
6900
  ignoreLocation: o
6908
6901
  }) > y)
6909
6902
  break;
6910
- S = N;
6903
+ S = M;
6911
6904
  }
6912
6905
  const A = {
6913
6906
  isMatch: m >= 0,
@@ -8193,7 +8186,7 @@ function requireJsonpath() {
8193
8186
  function F(c) {
8194
8187
  return "01234567".indexOf(c) >= 0;
8195
8188
  }
8196
- function N(c) {
8189
+ function M(c) {
8197
8190
  return c === 32 || c === 9 || c === 11 || c === 12 || c === 160 || c >= 5760 && [5760, 6158, 8192, 8193, 8194, 8195, 8196, 8197, 8198, 8199, 8200, 8201, 8202, 8239, 8287, 12288, 65279].indexOf(c) >= 0;
8198
8191
  }
8199
8192
  function B(c) {
@@ -8323,7 +8316,7 @@ function requireJsonpath() {
8323
8316
  function C() {
8324
8317
  var c, _;
8325
8318
  for (_ = p === 0; p < w; )
8326
- if (c = m.charCodeAt(p), N(c))
8319
+ if (c = m.charCodeAt(p), M(c))
8327
8320
  ++p;
8328
8321
  else if (B(c))
8329
8322
  ++p, c === 13 && m.charCodeAt(p) === 10 && ++p, ++E, S = p, _ = !0;
@@ -8362,7 +8355,7 @@ function requireJsonpath() {
8362
8355
  ++p, _ += String.fromCharCode(c), c === 92 && (_ = _.substr(0, _.length - 1), m.charCodeAt(p) !== 117 && ee({}, d.UnexpectedToken, "ILLEGAL"), ++p, c = k("u"), (!c || c === "\\" || !H(c.charCodeAt(0))) && ee({}, d.UnexpectedToken, "ILLEGAL"), _ += c);
8363
8356
  return _;
8364
8357
  }
8365
- function Y() {
8358
+ function Q() {
8366
8359
  var c, _;
8367
8360
  for (c = p++; p < w; ) {
8368
8361
  if (_ = m.charCodeAt(p), _ === 92)
@@ -8376,7 +8369,7 @@ function requireJsonpath() {
8376
8369
  }
8377
8370
  function se() {
8378
8371
  var c, _, I;
8379
- return c = p, _ = m.charCodeAt(p) === 92 ? $() : Y(), _.length === 1 ? I = s.Identifier : te(_) ? I = s.Keyword : _ === "null" ? I = s.NullLiteral : _ === "true" || _ === "false" ? I = s.BooleanLiteral : I = s.Identifier, {
8372
+ return c = p, _ = m.charCodeAt(p) === 92 ? $() : Q(), _.length === 1 ? I = s.Identifier : te(_) ? I = s.Keyword : _ === "null" ? I = s.NullLiteral : _ === "true" || _ === "false" ? I = s.BooleanLiteral : I = s.Identifier, {
8380
8373
  type: I,
8381
8374
  value: _,
8382
8375
  lineNumber: E,
@@ -8385,7 +8378,7 @@ function requireJsonpath() {
8385
8378
  end: p
8386
8379
  };
8387
8380
  }
8388
- function X() {
8381
+ function Y() {
8389
8382
  var c = p, _ = m.charCodeAt(p), I, R = m[p], T, L, oe;
8390
8383
  switch (_) {
8391
8384
  // Check for most common single-character punctuators.
@@ -8705,23 +8698,23 @@ function requireJsonpath() {
8705
8698
  return ye();
8706
8699
  if (c.type === "Punctuator") {
8707
8700
  if (c.value === "]")
8708
- return X();
8701
+ return Y();
8709
8702
  if (c.value === ")")
8710
- return _ = q.tokens[q.openParenToken - 1], _ && _.type === "Keyword" && (_.value === "if" || _.value === "while" || _.value === "for" || _.value === "with") ? ye() : X();
8703
+ return _ = q.tokens[q.openParenToken - 1], _ && _.type === "Keyword" && (_.value === "if" || _.value === "while" || _.value === "for" || _.value === "with") ? ye() : Y();
8711
8704
  if (c.value === "}") {
8712
8705
  if (q.tokens[q.openCurlyToken - 3] && q.tokens[q.openCurlyToken - 3].type === "Keyword") {
8713
8706
  if (_ = q.tokens[q.openCurlyToken - 4], !_)
8714
- return X();
8707
+ return Y();
8715
8708
  } else if (q.tokens[q.openCurlyToken - 4] && q.tokens[q.openCurlyToken - 4].type === "Keyword") {
8716
8709
  if (_ = q.tokens[q.openCurlyToken - 5], !_)
8717
8710
  return ye();
8718
8711
  } else
8719
- return X();
8720
- return u.indexOf(_.value) >= 0 ? X() : ye();
8712
+ return Y();
8713
+ return u.indexOf(_.value) >= 0 ? Y() : ye();
8721
8714
  }
8722
8715
  return ye();
8723
8716
  }
8724
- return c.type === "Keyword" ? ye() : X();
8717
+ return c.type === "Keyword" ? ye() : Y();
8725
8718
  }
8726
8719
  function je() {
8727
8720
  var c;
@@ -8731,7 +8724,7 @@ function requireJsonpath() {
8731
8724
  lineStart: S,
8732
8725
  start: p,
8733
8726
  end: p
8734
- } : (c = m.charCodeAt(p), U(c) ? se() : c === 40 || c === 41 || c === 59 ? X() : c === 39 || c === 34 ? me() : c === 46 ? D(m.charCodeAt(p + 1)) ? le() : X() : D(c) ? le() : q.tokenize && c === 47 ? ze() : X());
8727
+ } : (c = m.charCodeAt(p), U(c) ? se() : c === 40 || c === 41 || c === 59 ? Y() : c === 39 || c === 34 ? me() : c === 46 ? D(m.charCodeAt(p + 1)) ? le() : Y() : D(c) ? le() : q.tokenize && c === 47 ? ze() : Y());
8735
8728
  }
8736
8729
  function Be() {
8737
8730
  var c, _, I;
@@ -8754,7 +8747,7 @@ function requireJsonpath() {
8754
8747
  var c;
8755
8748
  return c = b, p = c.end, E = c.lineNumber, S = c.lineStart, b = typeof q.tokens < "u" ? Be() : je(), p = c.end, E = c.lineNumber, S = c.lineStart, c;
8756
8749
  }
8757
- function Me() {
8750
+ function Ne() {
8758
8751
  var c, _, I;
8759
8752
  c = p, _ = E, I = S, b = typeof q.tokens < "u" ? Be() : je(), p = c, E = _, S = I;
8760
8753
  }
@@ -9103,11 +9096,11 @@ function requireJsonpath() {
9103
9096
  var _ = ie();
9104
9097
  (_.type !== s.Punctuator || _.value !== c) && we(_);
9105
9098
  }
9106
- function Q(c) {
9099
+ function X(c) {
9107
9100
  var _ = ie();
9108
9101
  (_.type !== s.Keyword || _.value !== c) && we(_);
9109
9102
  }
9110
- function M(c) {
9103
+ function N(c) {
9111
9104
  return b.type === s.Punctuator && b.value === c;
9112
9105
  }
9113
9106
  function O(c) {
@@ -9119,19 +9112,19 @@ function requireJsonpath() {
9119
9112
  }
9120
9113
  function G() {
9121
9114
  var c;
9122
- if (m.charCodeAt(p) === 59 || M(";")) {
9115
+ if (m.charCodeAt(p) === 59 || N(";")) {
9123
9116
  ie();
9124
9117
  return;
9125
9118
  }
9126
- c = E, C(), E === c && b.type !== s.EOF && !M("}") && we(b);
9119
+ c = E, C(), E === c && b.type !== s.EOF && !N("}") && we(b);
9127
9120
  }
9128
9121
  function re(c) {
9129
9122
  return c.type === o.Identifier || c.type === o.MemberExpression;
9130
9123
  }
9131
9124
  function fe() {
9132
9125
  var c = [], _;
9133
- for (_ = b, J("["); !M("]"); )
9134
- M(",") ? (ie(), c.push(null)) : (c.push(Ae()), M("]") || J(","));
9126
+ for (_ = b, J("["); !N("]"); )
9127
+ N(",") ? (ie(), c.push(null)) : (c.push(Ae()), N("]") || J(","));
9135
9128
  return ie(), g.markEnd(g.createArrayExpression(c), _);
9136
9129
  }
9137
9130
  function ae(c, _) {
@@ -9142,10 +9135,10 @@ function requireJsonpath() {
9142
9135
  var c, _;
9143
9136
  return _ = b, c = ie(), c.type === s.StringLiteral || c.type === s.NumericLiteral ? (v && c.octal && ce(c, d.StrictOctalLiteral), g.markEnd(g.createLiteral(c), _)) : g.markEnd(g.createIdentifier(c.value), _);
9144
9137
  }
9145
- function Ne() {
9138
+ function Me() {
9146
9139
  var c, _, I, R, T, L;
9147
9140
  if (c = b, L = b, c.type === s.Identifier)
9148
- return I = qe(), c.value === "get" && !M(":") ? (_ = qe(), J("("), J(")"), R = ae([]), g.markEnd(g.createProperty("get", _, R), L)) : c.value === "set" && !M(":") ? (_ = qe(), J("("), c = b, c.type !== s.Identifier ? (J(")"), ce(c, d.UnexpectedToken, c.value), R = ae([])) : (T = [Ce()], J(")"), R = ae(T, c)), g.markEnd(g.createProperty("set", _, R), L)) : (J(":"), R = Ae(), g.markEnd(g.createProperty("init", I, R), L));
9141
+ return I = qe(), c.value === "get" && !N(":") ? (_ = qe(), J("("), J(")"), R = ae([]), g.markEnd(g.createProperty("get", _, R), L)) : c.value === "set" && !N(":") ? (_ = qe(), J("("), c = b, c.type !== s.Identifier ? (J(")"), ce(c, d.UnexpectedToken, c.value), R = ae([])) : (T = [Ce()], J(")"), R = ae(T, c)), g.markEnd(g.createProperty("set", _, R), L)) : (J(":"), R = Ae(), g.markEnd(g.createProperty("init", I, R), L));
9149
9142
  if (c.type === s.EOF || c.type === s.Punctuator)
9150
9143
  we(c);
9151
9144
  else
@@ -9153,8 +9146,8 @@ function requireJsonpath() {
9153
9146
  }
9154
9147
  function Ee() {
9155
9148
  var c = [], _, I, R, T, L = {}, oe = String, de;
9156
- for (de = b, J("{"); !M("}"); )
9157
- _ = Ne(), _.key.type === o.Identifier ? I = _.key.name : I = oe(_.key.value), T = _.kind === "init" ? f.Data : _.kind === "get" ? f.Get : f.Set, R = "$" + I, Object.prototype.hasOwnProperty.call(L, R) ? (L[R] === f.Data ? v && T === f.Data ? ce({}, d.StrictDuplicateProperty) : T !== f.Data && ce({}, d.AccessorDataProperty) : T === f.Data ? ce({}, d.AccessorDataProperty) : L[R] & T && ce({}, d.AccessorGetSet), L[R] |= T) : L[R] = T, c.push(_), M("}") || J(",");
9149
+ for (de = b, J("{"); !N("}"); )
9150
+ _ = Me(), _.key.type === o.Identifier ? I = _.key.name : I = oe(_.key.value), T = _.kind === "init" ? f.Data : _.kind === "get" ? f.Get : f.Set, R = "$" + I, Object.prototype.hasOwnProperty.call(L, R) ? (L[R] === f.Data ? v && T === f.Data ? ce({}, d.StrictDuplicateProperty) : T !== f.Data && ce({}, d.AccessorDataProperty) : T === f.Data ? ce({}, d.AccessorDataProperty) : L[R] & T && ce({}, d.AccessorGetSet), L[R] |= T) : L[R] = T, c.push(_), N("}") || J(",");
9158
9151
  return J("}"), g.markEnd(g.createObjectExpression(c), de);
9159
9152
  }
9160
9153
  function Re() {
@@ -9163,11 +9156,11 @@ function requireJsonpath() {
9163
9156
  }
9164
9157
  function He() {
9165
9158
  var c, _, I, R;
9166
- if (M("("))
9159
+ if (N("("))
9167
9160
  return Re();
9168
- if (M("["))
9161
+ if (N("["))
9169
9162
  return fe();
9170
- if (M("{"))
9163
+ if (N("{"))
9171
9164
  return Ee();
9172
9165
  if (c = b.type, R = b, c === s.Identifier)
9173
9166
  I = g.createIdentifier(ie().value);
@@ -9177,13 +9170,13 @@ function requireJsonpath() {
9177
9170
  if (O("function"))
9178
9171
  return qt();
9179
9172
  O("this") ? (ie(), I = g.createThisExpression()) : we(ie());
9180
- } else c === s.BooleanLiteral ? (_ = ie(), _.value = _.value === "true", I = g.createLiteral(_)) : c === s.NullLiteral ? (_ = ie(), _.value = null, I = g.createLiteral(_)) : M("/") || M("/=") ? (typeof q.tokens < "u" ? I = g.createLiteral(ye()) : I = g.createLiteral(Te()), Me()) : we(ie());
9173
+ } else c === s.BooleanLiteral ? (_ = ie(), _.value = _.value === "true", I = g.createLiteral(_)) : c === s.NullLiteral ? (_ = ie(), _.value = null, I = g.createLiteral(_)) : N("/") || N("/=") ? (typeof q.tokens < "u" ? I = g.createLiteral(ye()) : I = g.createLiteral(Te()), Ne()) : we(ie());
9181
9174
  return g.markEnd(I, R);
9182
9175
  }
9183
9176
  function $e() {
9184
9177
  var c = [];
9185
- if (J("("), !M(")"))
9186
- for (; p < w && (c.push(Ae()), !M(")")); )
9178
+ if (J("("), !N(")"))
9179
+ for (; p < w && (c.push(Ae()), !N(")")); )
9187
9180
  J(",");
9188
9181
  return J(")"), c;
9189
9182
  }
@@ -9194,42 +9187,42 @@ function requireJsonpath() {
9194
9187
  function Je() {
9195
9188
  return J("."), xe();
9196
9189
  }
9197
- function Ye() {
9190
+ function Qe() {
9198
9191
  var c;
9199
9192
  return J("["), c = he(), J("]"), c;
9200
9193
  }
9201
- function Xe() {
9194
+ function Ye() {
9202
9195
  var c, _, I;
9203
- return I = b, Q("new"), c = Qe(), _ = M("(") ? $e() : [], g.markEnd(g.createNewExpression(c, _), I);
9196
+ return I = b, X("new"), c = Xe(), _ = N("(") ? $e() : [], g.markEnd(g.createNewExpression(c, _), I);
9204
9197
  }
9205
9198
  function Ue() {
9206
9199
  var c, _, I, R, T;
9207
- for (T = b, c = A.allowIn, A.allowIn = !0, _ = O("new") ? Xe() : He(), A.allowIn = c; ; ) {
9208
- if (M("."))
9200
+ for (T = b, c = A.allowIn, A.allowIn = !0, _ = O("new") ? Ye() : He(), A.allowIn = c; ; ) {
9201
+ if (N("."))
9209
9202
  R = Je(), _ = g.createMemberExpression(".", _, R);
9210
- else if (M("("))
9203
+ else if (N("("))
9211
9204
  I = $e(), _ = g.createCallExpression(_, I);
9212
- else if (M("["))
9213
- R = Ye(), _ = g.createMemberExpression("[", _, R);
9205
+ else if (N("["))
9206
+ R = Qe(), _ = g.createMemberExpression("[", _, R);
9214
9207
  else
9215
9208
  break;
9216
9209
  g.markEnd(_, T);
9217
9210
  }
9218
9211
  return _;
9219
9212
  }
9220
- function Qe() {
9213
+ function Xe() {
9221
9214
  var c, _, I, R;
9222
- for (R = b, c = A.allowIn, _ = O("new") ? Xe() : He(), A.allowIn = c; M(".") || M("["); )
9223
- M("[") ? (I = Ye(), _ = g.createMemberExpression("[", _, I)) : (I = Je(), _ = g.createMemberExpression(".", _, I)), g.markEnd(_, R);
9215
+ for (R = b, c = A.allowIn, _ = O("new") ? Ye() : He(), A.allowIn = c; N(".") || N("["); )
9216
+ N("[") ? (I = Qe(), _ = g.createMemberExpression("[", _, I)) : (I = Je(), _ = g.createMemberExpression(".", _, I)), g.markEnd(_, R);
9224
9217
  return _;
9225
9218
  }
9226
9219
  function Ge() {
9227
9220
  var c, _, I = b;
9228
- return c = Ue(), b.type === s.Punctuator && (M("++") || M("--")) && !Ie() && (v && c.type === o.Identifier && W(c.name) && ce({}, d.StrictLHSPostfix), re(c) || ce({}, d.InvalidLHSInAssignment), _ = ie(), c = g.markEnd(g.createPostfixExpression(_.value, c), I)), c;
9221
+ return c = Ue(), b.type === s.Punctuator && (N("++") || N("--")) && !Ie() && (v && c.type === o.Identifier && W(c.name) && ce({}, d.StrictLHSPostfix), re(c) || ce({}, d.InvalidLHSInAssignment), _ = ie(), c = g.markEnd(g.createPostfixExpression(_.value, c), I)), c;
9229
9222
  }
9230
9223
  function Pe() {
9231
9224
  var c, _, I;
9232
- return b.type !== s.Punctuator && b.type !== s.Keyword ? _ = Ge() : M("++") || M("--") ? (I = b, c = ie(), _ = Pe(), v && _.type === o.Identifier && W(_.name) && ce({}, d.StrictLHSPrefix), re(_) || ce({}, d.InvalidLHSInAssignment), _ = g.createUnaryExpression(c.value, _), _ = g.markEnd(_, I)) : M("+") || M("-") || M("~") || M("!") ? (I = b, c = ie(), _ = Pe(), _ = g.createUnaryExpression(c.value, _), _ = g.markEnd(_, I)) : O("delete") || O("void") || O("typeof") ? (I = b, c = ie(), _ = Pe(), _ = g.createUnaryExpression(c.value, _), _ = g.markEnd(_, I), v && _.operator === "delete" && _.argument.type === o.Identifier && ce({}, d.StrictDelete)) : _ = Ge(), _;
9225
+ return b.type !== s.Punctuator && b.type !== s.Keyword ? _ = Ge() : N("++") || N("--") ? (I = b, c = ie(), _ = Pe(), v && _.type === o.Identifier && W(_.name) && ce({}, d.StrictLHSPrefix), re(_) || ce({}, d.InvalidLHSInAssignment), _ = g.createUnaryExpression(c.value, _), _ = g.markEnd(_, I)) : N("+") || N("-") || N("~") || N("!") ? (I = b, c = ie(), _ = Pe(), _ = g.createUnaryExpression(c.value, _), _ = g.markEnd(_, I)) : O("delete") || O("void") || O("typeof") ? (I = b, c = ie(), _ = Pe(), _ = g.createUnaryExpression(c.value, _), _ = g.markEnd(_, I), v && _.operator === "delete" && _.argument.type === o.Identifier && ce({}, d.StrictDelete)) : _ = Ge(), _;
9233
9226
  }
9234
9227
  function Ve(c, _) {
9235
9228
  var I = 0;
@@ -9299,7 +9292,7 @@ function requireJsonpath() {
9299
9292
  }
9300
9293
  function nt() {
9301
9294
  var c, _, I, R, T;
9302
- return T = b, c = rt(), M("?") && (ie(), _ = A.allowIn, A.allowIn = !0, I = Ae(), A.allowIn = _, J(":"), R = Ae(), c = g.createConditionalExpression(c, I, R), g.markEnd(c, T)), c;
9295
+ return T = b, c = rt(), N("?") && (ie(), _ = A.allowIn, A.allowIn = !0, I = Ae(), A.allowIn = _, J(":"), R = Ae(), c = g.createConditionalExpression(c, I, R), g.markEnd(c, T)), c;
9303
9296
  }
9304
9297
  function Ae() {
9305
9298
  var c, _, I, R, T;
@@ -9307,15 +9300,15 @@ function requireJsonpath() {
9307
9300
  }
9308
9301
  function he() {
9309
9302
  var c, _ = b;
9310
- if (c = Ae(), M(",")) {
9311
- for (c = g.createSequenceExpression([c]); p < w && M(","); )
9303
+ if (c = Ae(), N(",")) {
9304
+ for (c = g.createSequenceExpression([c]); p < w && N(","); )
9312
9305
  ie(), c.expressions.push(Ae());
9313
9306
  g.markEnd(c, _);
9314
9307
  }
9315
9308
  return c;
9316
9309
  }
9317
9310
  function Ze() {
9318
- for (var c = [], _; p < w && !(M("}") || (_ = tt(), typeof _ > "u")); )
9311
+ for (var c = [], _; p < w && !(N("}") || (_ = tt(), typeof _ > "u")); )
9319
9312
  c.push(_);
9320
9313
  return c;
9321
9314
  }
@@ -9329,12 +9322,12 @@ function requireJsonpath() {
9329
9322
  }
9330
9323
  function et(c) {
9331
9324
  var _ = null, I, R;
9332
- return R = b, I = Ce(), v && W(I.name) && ce({}, d.StrictVarName), c === "const" ? (J("="), _ = Ae()) : M("=") && (ie(), _ = Ae()), g.markEnd(g.createVariableDeclarator(I, _), R);
9325
+ return R = b, I = Ce(), v && W(I.name) && ce({}, d.StrictVarName), c === "const" ? (J("="), _ = Ae()) : N("=") && (ie(), _ = Ae()), g.markEnd(g.createVariableDeclarator(I, _), R);
9333
9326
  }
9334
9327
  function ke(c) {
9335
9328
  var _ = [];
9336
9329
  do {
9337
- if (_.push(et(c)), !M(","))
9330
+ if (_.push(et(c)), !N(","))
9338
9331
  break;
9339
9332
  ie();
9340
9333
  } while (p < w);
@@ -9342,11 +9335,11 @@ function requireJsonpath() {
9342
9335
  }
9343
9336
  function Ke() {
9344
9337
  var c;
9345
- return Q("var"), c = ke(), G(), g.createVariableDeclaration(c, "var");
9338
+ return X("var"), c = ke(), G(), g.createVariableDeclaration(c, "var");
9346
9339
  }
9347
9340
  function at(c) {
9348
9341
  var _, I;
9349
- return I = b, Q(c), _ = ke(c), G(), g.markEnd(g.createVariableDeclaration(_, c), I);
9342
+ return I = b, X(c), _ = ke(c), G(), g.markEnd(g.createVariableDeclaration(_, c), I);
9350
9343
  }
9351
9344
  function it() {
9352
9345
  return J(";"), g.createEmptyStatement();
@@ -9357,15 +9350,15 @@ function requireJsonpath() {
9357
9350
  }
9358
9351
  function pt() {
9359
9352
  var c, _, I;
9360
- return Q("if"), J("("), c = he(), J(")"), _ = De(), O("else") ? (ie(), I = De()) : I = null, g.createIfStatement(c, _, I);
9353
+ return X("if"), J("("), c = he(), J(")"), _ = De(), O("else") ? (ie(), I = De()) : I = null, g.createIfStatement(c, _, I);
9361
9354
  }
9362
9355
  function dt() {
9363
9356
  var c, _, I;
9364
- return Q("do"), I = A.inIteration, A.inIteration = !0, c = De(), A.inIteration = I, Q("while"), J("("), _ = he(), J(")"), M(";") && ie(), g.createDoWhileStatement(c, _);
9357
+ return X("do"), I = A.inIteration, A.inIteration = !0, c = De(), A.inIteration = I, X("while"), J("("), _ = he(), J(")"), N(";") && ie(), g.createDoWhileStatement(c, _);
9365
9358
  }
9366
9359
  function ft() {
9367
9360
  var c, _, I;
9368
- return Q("while"), J("("), c = he(), J(")"), I = A.inIteration, A.inIteration = !0, _ = De(), A.inIteration = I, g.createWhileStatement(c, _);
9361
+ return X("while"), J("("), c = he(), J(")"), I = A.inIteration, A.inIteration = !0, _ = De(), A.inIteration = I, g.createWhileStatement(c, _);
9369
9362
  }
9370
9363
  function ht() {
9371
9364
  var c, _, I;
@@ -9373,52 +9366,52 @@ function requireJsonpath() {
9373
9366
  }
9374
9367
  function mt() {
9375
9368
  var c, _, I, R, T, L, oe;
9376
- return c = _ = I = null, Q("for"), J("("), M(";") ? ie() : (O("var") || O("let") ? (A.allowIn = !1, c = ht(), A.allowIn = !0, c.declarations.length === 1 && O("in") && (ie(), R = c, T = he(), c = null)) : (A.allowIn = !1, c = he(), A.allowIn = !0, O("in") && (re(c) || ce({}, d.InvalidLHSInForIn), ie(), R = c, T = he(), c = null)), typeof R > "u" && J(";")), typeof R > "u" && (M(";") || (_ = he()), J(";"), M(")") || (I = he())), J(")"), oe = A.inIteration, A.inIteration = !0, L = De(), A.inIteration = oe, typeof R > "u" ? g.createForStatement(c, _, I, L) : g.createForInStatement(R, T, L);
9369
+ return c = _ = I = null, X("for"), J("("), N(";") ? ie() : (O("var") || O("let") ? (A.allowIn = !1, c = ht(), A.allowIn = !0, c.declarations.length === 1 && O("in") && (ie(), R = c, T = he(), c = null)) : (A.allowIn = !1, c = he(), A.allowIn = !0, O("in") && (re(c) || ce({}, d.InvalidLHSInForIn), ie(), R = c, T = he(), c = null)), typeof R > "u" && J(";")), typeof R > "u" && (N(";") || (_ = he()), J(";"), N(")") || (I = he())), J(")"), oe = A.inIteration, A.inIteration = !0, L = De(), A.inIteration = oe, typeof R > "u" ? g.createForStatement(c, _, I, L) : g.createForInStatement(R, T, L);
9377
9370
  }
9378
9371
  function yt() {
9379
9372
  var c = null, _;
9380
- return Q("continue"), m.charCodeAt(p) === 59 ? (ie(), A.inIteration || ee({}, d.IllegalContinue), g.createContinueStatement(null)) : Ie() ? (A.inIteration || ee({}, d.IllegalContinue), g.createContinueStatement(null)) : (b.type === s.Identifier && (c = Ce(), _ = "$" + c.name, Object.prototype.hasOwnProperty.call(A.labelSet, _) || ee({}, d.UnknownLabel, c.name)), G(), c === null && !A.inIteration && ee({}, d.IllegalContinue), g.createContinueStatement(c));
9373
+ return X("continue"), m.charCodeAt(p) === 59 ? (ie(), A.inIteration || ee({}, d.IllegalContinue), g.createContinueStatement(null)) : Ie() ? (A.inIteration || ee({}, d.IllegalContinue), g.createContinueStatement(null)) : (b.type === s.Identifier && (c = Ce(), _ = "$" + c.name, Object.prototype.hasOwnProperty.call(A.labelSet, _) || ee({}, d.UnknownLabel, c.name)), G(), c === null && !A.inIteration && ee({}, d.IllegalContinue), g.createContinueStatement(c));
9381
9374
  }
9382
9375
  function gt() {
9383
9376
  var c = null, _;
9384
- return Q("break"), m.charCodeAt(p) === 59 ? (ie(), A.inIteration || A.inSwitch || ee({}, d.IllegalBreak), g.createBreakStatement(null)) : Ie() ? (A.inIteration || A.inSwitch || ee({}, d.IllegalBreak), g.createBreakStatement(null)) : (b.type === s.Identifier && (c = Ce(), _ = "$" + c.name, Object.prototype.hasOwnProperty.call(A.labelSet, _) || ee({}, d.UnknownLabel, c.name)), G(), c === null && !(A.inIteration || A.inSwitch) && ee({}, d.IllegalBreak), g.createBreakStatement(c));
9377
+ return X("break"), m.charCodeAt(p) === 59 ? (ie(), A.inIteration || A.inSwitch || ee({}, d.IllegalBreak), g.createBreakStatement(null)) : Ie() ? (A.inIteration || A.inSwitch || ee({}, d.IllegalBreak), g.createBreakStatement(null)) : (b.type === s.Identifier && (c = Ce(), _ = "$" + c.name, Object.prototype.hasOwnProperty.call(A.labelSet, _) || ee({}, d.UnknownLabel, c.name)), G(), c === null && !(A.inIteration || A.inSwitch) && ee({}, d.IllegalBreak), g.createBreakStatement(c));
9385
9378
  }
9386
9379
  function _t() {
9387
9380
  var c = null;
9388
- return Q("return"), A.inFunctionBody || ce({}, d.IllegalReturn), m.charCodeAt(p) === 32 && U(m.charCodeAt(p + 1)) ? (c = he(), G(), g.createReturnStatement(c)) : Ie() ? g.createReturnStatement(null) : (M(";") || !M("}") && b.type !== s.EOF && (c = he()), G(), g.createReturnStatement(c));
9381
+ return X("return"), A.inFunctionBody || ce({}, d.IllegalReturn), m.charCodeAt(p) === 32 && U(m.charCodeAt(p + 1)) ? (c = he(), G(), g.createReturnStatement(c)) : Ie() ? g.createReturnStatement(null) : (N(";") || !N("}") && b.type !== s.EOF && (c = he()), G(), g.createReturnStatement(c));
9389
9382
  }
9390
9383
  function vt() {
9391
9384
  var c, _;
9392
- return v && (C(), ce({}, d.StrictModeWith)), Q("with"), J("("), c = he(), J(")"), _ = De(), g.createWithStatement(c, _);
9385
+ return v && (C(), ce({}, d.StrictModeWith)), X("with"), J("("), c = he(), J(")"), _ = De(), g.createWithStatement(c, _);
9393
9386
  }
9394
9387
  function bt() {
9395
9388
  var c, _ = [], I, R;
9396
- for (R = b, O("default") ? (ie(), c = null) : (Q("case"), c = he()), J(":"); p < w && !(M("}") || O("default") || O("case")); )
9389
+ for (R = b, O("default") ? (ie(), c = null) : (X("case"), c = he()), J(":"); p < w && !(N("}") || O("default") || O("case")); )
9397
9390
  I = De(), _.push(I);
9398
9391
  return g.markEnd(g.createSwitchCase(c, _), R);
9399
9392
  }
9400
9393
  function St() {
9401
9394
  var c, _, I, R, T;
9402
- if (Q("switch"), J("("), c = he(), J(")"), J("{"), _ = [], M("}"))
9395
+ if (X("switch"), J("("), c = he(), J(")"), J("{"), _ = [], N("}"))
9403
9396
  return ie(), g.createSwitchStatement(c, _);
9404
- for (R = A.inSwitch, A.inSwitch = !0, T = !1; p < w && !M("}"); )
9397
+ for (R = A.inSwitch, A.inSwitch = !0, T = !1; p < w && !N("}"); )
9405
9398
  I = bt(), I.test === null && (T && ee({}, d.MultipleDefaultsInSwitch), T = !0), _.push(I);
9406
9399
  return A.inSwitch = R, J("}"), g.createSwitchStatement(c, _);
9407
9400
  }
9408
9401
  function wt() {
9409
9402
  var c;
9410
- return Q("throw"), Ie() && ee({}, d.NewlineAfterThrow), c = he(), G(), g.createThrowStatement(c);
9403
+ return X("throw"), Ie() && ee({}, d.NewlineAfterThrow), c = he(), G(), g.createThrowStatement(c);
9411
9404
  }
9412
9405
  function Et() {
9413
9406
  var c, _, I;
9414
- return I = b, Q("catch"), J("("), M(")") && we(b), c = Ce(), v && W(c.name) && ce({}, d.StrictCatchVariable), J(")"), _ = We(), g.markEnd(g.createCatchClause(c, _), I);
9407
+ return I = b, X("catch"), J("("), N(")") && we(b), c = Ce(), v && W(c.name) && ce({}, d.StrictCatchVariable), J(")"), _ = We(), g.markEnd(g.createCatchClause(c, _), I);
9415
9408
  }
9416
9409
  function At() {
9417
9410
  var c, _ = [], I = null;
9418
- return Q("try"), c = We(), O("catch") && _.push(Et()), O("finally") && (ie(), I = We()), _.length === 0 && !I && ee({}, d.NoCatchOrFinally), g.createTryStatement(c, [], _, I);
9411
+ return X("try"), c = We(), O("catch") && _.push(Et()), O("finally") && (ie(), I = We()), _.length === 0 && !I && ee({}, d.NoCatchOrFinally), g.createTryStatement(c, [], _, I);
9419
9412
  }
9420
9413
  function It() {
9421
- return Q("debugger"), G(), g.createDebuggerStatement();
9414
+ return X("debugger"), G(), g.createDebuggerStatement();
9422
9415
  }
9423
9416
  function De() {
9424
9417
  var c = b.type, _, I, R, T;
@@ -9462,20 +9455,20 @@ function requireJsonpath() {
9462
9455
  case "with":
9463
9456
  return g.markEnd(vt(), T);
9464
9457
  }
9465
- return _ = he(), _.type === o.Identifier && M(":") ? (ie(), R = "$" + _.name, Object.prototype.hasOwnProperty.call(A.labelSet, R) && ee({}, d.Redeclaration, "Label", _.name), A.labelSet[R] = !0, I = De(), delete A.labelSet[R], g.markEnd(g.createLabeledStatement(_, I), T)) : (G(), g.markEnd(g.createExpressionStatement(_), T));
9458
+ return _ = he(), _.type === o.Identifier && N(":") ? (ie(), R = "$" + _.name, Object.prototype.hasOwnProperty.call(A.labelSet, R) && ee({}, d.Redeclaration, "Label", _.name), A.labelSet[R] = !0, I = De(), delete A.labelSet[R], g.markEnd(g.createLabeledStatement(_, I), T)) : (G(), g.markEnd(g.createExpressionStatement(_), T));
9466
9459
  }
9467
9460
  function st() {
9468
9461
  var c, _ = [], I, R, T, L, oe, de, _e, ge;
9469
9462
  for (ge = b, J("{"); p < w && !(b.type !== s.StringLiteral || (I = b, c = tt(), _.push(c), c.expression.type !== o.Literal)); )
9470
9463
  R = m.slice(I.start + 1, I.end - 1), R === "use strict" ? (v = !0, T && ce(T, d.StrictOctalLiteral)) : !T && I.octal && (T = I);
9471
- for (L = A.labelSet, oe = A.inIteration, de = A.inSwitch, _e = A.inFunctionBody, A.labelSet = {}, A.inIteration = !1, A.inSwitch = !1, A.inFunctionBody = !0; p < w && !(M("}") || (c = tt(), typeof c > "u")); )
9464
+ for (L = A.labelSet, oe = A.inIteration, de = A.inSwitch, _e = A.inFunctionBody, A.labelSet = {}, A.inIteration = !1, A.inSwitch = !1, A.inFunctionBody = !0; p < w && !(N("}") || (c = tt(), typeof c > "u")); )
9472
9465
  _.push(c);
9473
9466
  return J("}"), A.labelSet = L, A.inIteration = oe, A.inSwitch = de, A.inFunctionBody = _e, g.markEnd(g.createBlockStatement(_), ge);
9474
9467
  }
9475
9468
  function ot(c) {
9476
9469
  var _, I = [], R, T, L, oe, de;
9477
- if (J("("), !M(")"))
9478
- for (L = {}; p < w && (R = b, _ = Ce(), oe = "$" + R.value, v ? (W(R.value) && (T = R, de = d.StrictParamName), Object.prototype.hasOwnProperty.call(L, oe) && (T = R, de = d.StrictParamDupe)) : c || (W(R.value) ? (c = R, de = d.StrictParamName) : K(R.value) ? (c = R, de = d.StrictReservedWord) : Object.prototype.hasOwnProperty.call(L, oe) && (c = R, de = d.StrictParamDupe)), I.push(_), L[oe] = !0, !M(")")); )
9470
+ if (J("("), !N(")"))
9471
+ for (L = {}; p < w && (R = b, _ = Ce(), oe = "$" + R.value, v ? (W(R.value) && (T = R, de = d.StrictParamName), Object.prototype.hasOwnProperty.call(L, oe) && (T = R, de = d.StrictParamDupe)) : c || (W(R.value) ? (c = R, de = d.StrictParamName) : K(R.value) ? (c = R, de = d.StrictReservedWord) : Object.prototype.hasOwnProperty.call(L, oe) && (c = R, de = d.StrictParamDupe)), I.push(_), L[oe] = !0, !N(")")); )
9479
9472
  J(",");
9480
9473
  return J(")"), {
9481
9474
  params: I,
@@ -9486,11 +9479,11 @@ function requireJsonpath() {
9486
9479
  }
9487
9480
  function ut() {
9488
9481
  var c, _ = [], I, R, T, L, oe, de, _e, ge;
9489
- return ge = b, Q("function"), R = b, c = Ce(), v ? W(R.value) && ce(R, d.StrictFunctionName) : W(R.value) ? (oe = R, de = d.StrictFunctionName) : K(R.value) && (oe = R, de = d.StrictReservedWord), L = ot(oe), _ = L.params, T = L.stricted, oe = L.firstRestricted, L.message && (de = L.message), _e = v, I = st(), v && oe && ee(oe, de), v && T && ce(T, de), v = _e, g.markEnd(g.createFunctionDeclaration(c, _, [], I), ge);
9482
+ return ge = b, X("function"), R = b, c = Ce(), v ? W(R.value) && ce(R, d.StrictFunctionName) : W(R.value) ? (oe = R, de = d.StrictFunctionName) : K(R.value) && (oe = R, de = d.StrictReservedWord), L = ot(oe), _ = L.params, T = L.stricted, oe = L.firstRestricted, L.message && (de = L.message), _e = v, I = st(), v && oe && ee(oe, de), v && T && ce(T, de), v = _e, g.markEnd(g.createFunctionDeclaration(c, _, [], I), ge);
9490
9483
  }
9491
9484
  function qt() {
9492
9485
  var c, _ = null, I, R, T, L, oe = [], de, _e, ge;
9493
- return ge = b, Q("function"), M("(") || (c = b, _ = Ce(), v ? W(c.value) && ce(c, d.StrictFunctionName) : W(c.value) ? (R = c, T = d.StrictFunctionName) : K(c.value) && (R = c, T = d.StrictReservedWord)), L = ot(R), oe = L.params, I = L.stricted, R = L.firstRestricted, L.message && (T = L.message), _e = v, de = st(), v && R && ee(R, T), v && I && ce(I, T), v = _e, g.markEnd(g.createFunctionExpression(_, oe, [], de), ge);
9486
+ return ge = b, X("function"), N("(") || (c = b, _ = Ce(), v ? W(c.value) && ce(c, d.StrictFunctionName) : W(c.value) ? (R = c, T = d.StrictFunctionName) : K(c.value) && (R = c, T = d.StrictReservedWord)), L = ot(R), oe = L.params, I = L.stricted, R = L.firstRestricted, L.message && (T = L.message), _e = v, de = st(), v && R && ee(R, T), v && I && ce(I, T), v = _e, g.markEnd(g.createFunctionExpression(_, oe, [], de), ge);
9494
9487
  }
9495
9488
  function tt() {
9496
9489
  if (b.type === s.Keyword)
@@ -9515,7 +9508,7 @@ function requireJsonpath() {
9515
9508
  }
9516
9509
  function Ot() {
9517
9510
  var c, _;
9518
- return C(), Me(), _ = b, v = !1, c = xt(), g.markEnd(g.createProgram(c), _);
9511
+ return C(), Ne(), _ = b, v = !1, c = xt(), g.markEnd(g.createProgram(c), _);
9519
9512
  }
9520
9513
  function lt() {
9521
9514
  var c, _, I, R = [];
@@ -9537,7 +9530,7 @@ function requireJsonpath() {
9537
9530
  lastCommentStart: -1
9538
9531
  }, q = {}, _ = _ || {}, _.tokens = !0, q.tokens = [], q.tokenize = !0, q.openParenToken = -1, q.openCurlyToken = -1, q.range = typeof _.range == "boolean" && _.range, q.loc = typeof _.loc == "boolean" && _.loc, typeof _.comment == "boolean" && _.comment && (q.comments = []), typeof _.tolerant == "boolean" && _.tolerant && (q.errors = []);
9539
9532
  try {
9540
- if (Me(), b.type === s.EOF)
9533
+ if (Ne(), b.type === s.EOF)
9541
9534
  return q.tokens;
9542
9535
  for (R = ie(); b.type !== s.EOF; )
9543
9536
  try {
@@ -10090,11 +10083,11 @@ function requireJsonpath() {
10090
10083
  var V;
10091
10084
  return V = y.lexer.lex() || A, typeof V != "number" && (V = y.symbols_[V] || V), V;
10092
10085
  }
10093
- for (var F, N, B, U, H = {}, z, K, W, te; ; ) {
10094
- if (N = m[m.length - 1], this.defaultActions[N] ? B = this.defaultActions[N] : ((F === null || typeof F > "u") && (F = j()), B = E[N] && E[N][F]), typeof B > "u" || !B.length || !B[0]) {
10086
+ for (var F, M, B, U, H = {}, z, K, W, te; ; ) {
10087
+ if (M = m[m.length - 1], this.defaultActions[M] ? B = this.defaultActions[M] : ((F === null || typeof F > "u") && (F = j()), B = E[M] && E[M][F]), typeof B > "u" || !B.length || !B[0]) {
10095
10088
  var Z = "";
10096
10089
  te = [];
10097
- for (z in E[N])
10090
+ for (z in E[M])
10098
10091
  this.terminals_[z] && z > b && te.push("'" + this.terminals_[z] + "'");
10099
10092
  this.lexer.showPosition ? Z = "Parse error on line " + (w + 1) + `:
10100
10093
  ` + this.lexer.showPosition() + `
@@ -10107,7 +10100,7 @@ Expecting ` + te.join(", ") + ", got '" + (this.terminals_[F] || F) + "'" : Z =
10107
10100
  });
10108
10101
  }
10109
10102
  if (B[0] instanceof Array && B.length > 1)
10110
- throw new Error("Parse Error: multiple actions possible at state: " + N + ", token: " + F);
10103
+ throw new Error("Parse Error: multiple actions possible at state: " + M + ", token: " + F);
10111
10104
  switch (B[0]) {
10112
10105
  case 1:
10113
10106
  m.push(F), v.push(this.lexer.yytext), p.push(this.lexer.yylloc), m.push(B[1]), F = null, g = this.lexer.yyleng, S = this.lexer.yytext, w = this.lexer.yylineno, x = this.lexer.yylloc;
@@ -10495,11 +10488,11 @@ Expecting ` + te.join(", ") + ", got '" + (this.terminals_[F] || F) + "'" : Z =
10495
10488
  var A = t(".."), q = this, x = [], D = A.nodes(g, "$..*").slice(1);
10496
10489
  return D.forEach(function(j) {
10497
10490
  x.length >= b || w.expression.value.forEach(function(F) {
10498
- var N = {
10491
+ var M = {
10499
10492
  operation: "subscript",
10500
10493
  scope: "child",
10501
10494
  expression: F.expression
10502
- }, B = q.resolve(N), U = B(N, j);
10495
+ }, B = q.resolve(M), U = B(M, j);
10503
10496
  x = x.concat(U);
10504
10497
  });
10505
10498
  }), E(x);
@@ -10549,21 +10542,21 @@ Expecting ` + te.join(", ") + ", got '" + (this.terminals_[F] || F) + "'" : Z =
10549
10542
  }
10550
10543
  function y(w) {
10551
10544
  return function(g, b, A, q) {
10552
- var x = g.value, D = g.path, j = [], F = (function(N, B) {
10553
- d(N) ? (N.forEach(function(U, H) {
10545
+ var x = g.value, D = g.path, j = [], F = (function(M, B) {
10546
+ d(M) ? (M.forEach(function(U, H) {
10554
10547
  j.length >= q || A(H, U, b) && j.push({
10555
10548
  path: B.concat(H),
10556
10549
  value: U
10557
10550
  });
10558
- }), N.forEach(function(U, H) {
10551
+ }), M.forEach(function(U, H) {
10559
10552
  j.length >= q || w && F(U, B.concat(H));
10560
- })) : h(N) && (this.keys(N).forEach(function(U) {
10561
- j.length >= q || A(U, N[U], b) && j.push({
10553
+ })) : h(M) && (this.keys(M).forEach(function(U) {
10554
+ j.length >= q || A(U, M[U], b) && j.push({
10562
10555
  path: B.concat(U),
10563
- value: N[U]
10556
+ value: M[U]
10564
10557
  });
10565
- }), this.keys(N).forEach(function(U) {
10566
- j.length >= q || w && F(N[U], B.concat(U));
10558
+ }), this.keys(M).forEach(function(U) {
10559
+ j.length >= q || w && F(M[U], B.concat(U));
10567
10560
  }));
10568
10561
  }).bind(this);
10569
10562
  return F(x, D), j;
@@ -10916,26 +10909,26 @@ Expecting ` + te.join(", ") + ", got '" + (this.terminals_[F] || F) + "'" : Z =
10916
10909
  k.push(f(arguments[$]));
10917
10910
  return k.join(" ");
10918
10911
  }
10919
- for (var $ = 1, Y = arguments, se = Y.length, X = String(C).replace(l, function(ue) {
10912
+ for (var $ = 1, Q = arguments, se = Q.length, Y = String(C).replace(l, function(ue) {
10920
10913
  if (ue === "%%") return "%";
10921
10914
  if ($ >= se) return ue;
10922
10915
  switch (ue) {
10923
10916
  case "%s":
10924
- return String(Y[$++]);
10917
+ return String(Q[$++]);
10925
10918
  case "%d":
10926
- return Number(Y[$++]);
10919
+ return Number(Q[$++]);
10927
10920
  case "%j":
10928
10921
  try {
10929
- return JSON.stringify(Y[$++]);
10922
+ return JSON.stringify(Q[$++]);
10930
10923
  } catch {
10931
10924
  return "[Circular]";
10932
10925
  }
10933
10926
  default:
10934
10927
  return ue;
10935
10928
  }
10936
- }), ne = Y[$]; $ < se; ne = Y[++$])
10937
- A(ne) || !B(ne) ? X += " " + ne : X += " " + f(ne);
10938
- return X;
10929
+ }), ne = Q[$]; $ < se; ne = Q[++$])
10930
+ A(ne) || !B(ne) ? Y += " " + ne : Y += " " + f(ne);
10931
+ return Y;
10939
10932
  }, i.deprecate = function(C, k) {
10940
10933
  if (F(s.process))
10941
10934
  return function() {
@@ -10944,7 +10937,7 @@ Expecting ` + te.join(", ") + ", got '" + (this.terminals_[F] || F) + "'" : Z =
10944
10937
  if (a.noDeprecation === !0)
10945
10938
  return C;
10946
10939
  var $ = !1;
10947
- function Y() {
10940
+ function Q() {
10948
10941
  if (!$) {
10949
10942
  if (a.throwDeprecation)
10950
10943
  throw new Error(k);
@@ -10952,7 +10945,7 @@ Expecting ` + te.join(", ") + ", got '" + (this.terminals_[F] || F) + "'" : Z =
10952
10945
  }
10953
10946
  return C.apply(this, arguments);
10954
10947
  }
10955
- return Y;
10948
+ return Q;
10956
10949
  };
10957
10950
  var u = {}, o;
10958
10951
  i.debuglog = function(C) {
@@ -11009,7 +11002,7 @@ Expecting ` + te.join(", ") + ", got '" + (this.terminals_[F] || F) + "'" : Z =
11009
11002
  }
11010
11003
  function y(C) {
11011
11004
  var k = {};
11012
- return C.forEach(function($, Y) {
11005
+ return C.forEach(function($, Q) {
11013
11006
  k[$] = !0;
11014
11007
  }), k;
11015
11008
  }
@@ -11017,21 +11010,21 @@ Expecting ` + te.join(", ") + ", got '" + (this.terminals_[F] || F) + "'" : Z =
11017
11010
  if (C.customInspect && k && z(k.inspect) && // Filter out the util module, it's inspect function is special
11018
11011
  k.inspect !== i.inspect && // Also filter out any prototype objects using the circular check.
11019
11012
  !(k.constructor && k.constructor.prototype === k)) {
11020
- var Y = k.inspect($, C);
11021
- return D(Y) || (Y = m(C, Y, $)), Y;
11013
+ var Q = k.inspect($, C);
11014
+ return D(Q) || (Q = m(C, Q, $)), Q;
11022
11015
  }
11023
11016
  var se = v(C, k);
11024
11017
  if (se)
11025
11018
  return se;
11026
- var X = Object.keys(k), ne = y(X);
11027
- if (C.showHidden && (X = Object.getOwnPropertyNames(k)), H(k) && (X.indexOf("message") >= 0 || X.indexOf("description") >= 0))
11019
+ var Y = Object.keys(k), ne = y(Y);
11020
+ if (C.showHidden && (Y = Object.getOwnPropertyNames(k)), H(k) && (Y.indexOf("message") >= 0 || Y.indexOf("description") >= 0))
11028
11021
  return p(k);
11029
- if (X.length === 0) {
11022
+ if (Y.length === 0) {
11030
11023
  if (z(k)) {
11031
11024
  var ue = k.name ? ": " + k.name : "";
11032
11025
  return C.stylize("[Function" + ue + "]", "special");
11033
11026
  }
11034
- if (N(k))
11027
+ if (M(k))
11035
11028
  return C.stylize(RegExp.prototype.toString.call(k), "regexp");
11036
11029
  if (U(k))
11037
11030
  return C.stylize(Date.prototype.toString.call(k), "date");
@@ -11043,13 +11036,13 @@ Expecting ` + te.join(", ") + ", got '" + (this.terminals_[F] || F) + "'" : Z =
11043
11036
  var Se = k.name ? ": " + k.name : "";
11044
11037
  le = " [Function" + Se + "]";
11045
11038
  }
11046
- if (N(k) && (le = " " + RegExp.prototype.toString.call(k)), U(k) && (le = " " + Date.prototype.toUTCString.call(k)), H(k) && (le = " " + p(k)), X.length === 0 && (!me || k.length == 0))
11039
+ if (M(k) && (le = " " + RegExp.prototype.toString.call(k)), U(k) && (le = " " + Date.prototype.toUTCString.call(k)), H(k) && (le = " " + p(k)), Y.length === 0 && (!me || k.length == 0))
11047
11040
  return ve[0] + le + ve[1];
11048
11041
  if ($ < 0)
11049
- return N(k) ? C.stylize(RegExp.prototype.toString.call(k), "regexp") : C.stylize("[Object]", "special");
11042
+ return M(k) ? C.stylize(RegExp.prototype.toString.call(k), "regexp") : C.stylize("[Object]", "special");
11050
11043
  C.seen.push(k);
11051
11044
  var be;
11052
- return me ? be = E(C, k, $, ne, X) : be = X.map(function(Te) {
11045
+ return me ? be = E(C, k, $, ne, Y) : be = Y.map(function(Te) {
11053
11046
  return S(C, k, $, ne, Te, me);
11054
11047
  }), C.seen.pop(), w(be, le, ve);
11055
11048
  }
@@ -11066,19 +11059,19 @@ Expecting ` + te.join(", ") + ", got '" + (this.terminals_[F] || F) + "'" : Z =
11066
11059
  function p(C) {
11067
11060
  return "[" + Error.prototype.toString.call(C) + "]";
11068
11061
  }
11069
- function E(C, k, $, Y, se) {
11070
- for (var X = [], ne = 0, ue = k.length; ne < ue; ++ne)
11071
- pe(k, String(ne)) ? X.push(S(C, k, $, Y, String(ne), !0)) : X.push("");
11062
+ function E(C, k, $, Q, se) {
11063
+ for (var Y = [], ne = 0, ue = k.length; ne < ue; ++ne)
11064
+ pe(k, String(ne)) ? Y.push(S(C, k, $, Q, String(ne), !0)) : Y.push("");
11072
11065
  return se.forEach(function(le) {
11073
- le.match(/^\d+$/) || X.push(S(C, k, $, Y, le, !0));
11074
- }), X;
11066
+ le.match(/^\d+$/) || Y.push(S(C, k, $, Q, le, !0));
11067
+ }), Y;
11075
11068
  }
11076
- function S(C, k, $, Y, se, X) {
11069
+ function S(C, k, $, Q, se, Y) {
11077
11070
  var ne, ue, le;
11078
11071
  if (le = Object.getOwnPropertyDescriptor(k, se) || {
11079
11072
  value: k[se]
11080
- }, le.get ? le.set ? ue = C.stylize("[Getter/Setter]", "special") : ue = C.stylize("[Getter]", "special") : le.set && (ue = C.stylize("[Setter]", "special")), pe(Y, se) || (ne = "[" + se + "]"), ue || (C.seen.indexOf(le.value) < 0 ? (A($) ? ue = m(C, le.value, null) : ue = m(C, le.value, $ - 1), ue.indexOf(`
11081
- `) > -1 && (X ? ue = ue.split(`
11073
+ }, le.get ? le.set ? ue = C.stylize("[Getter/Setter]", "special") : ue = C.stylize("[Getter]", "special") : le.set && (ue = C.stylize("[Setter]", "special")), pe(Q, se) || (ne = "[" + se + "]"), ue || (C.seen.indexOf(le.value) < 0 ? (A($) ? ue = m(C, le.value, null) : ue = m(C, le.value, $ - 1), ue.indexOf(`
11074
+ `) > -1 && (Y ? ue = ue.split(`
11082
11075
  `).map(function(me) {
11083
11076
  return " " + me;
11084
11077
  }).join(`
@@ -11088,18 +11081,18 @@ Expecting ` + te.join(", ") + ", got '" + (this.terminals_[F] || F) + "'" : Z =
11088
11081
  return " " + me;
11089
11082
  }).join(`
11090
11083
  `))) : ue = C.stylize("[Circular]", "special")), F(ne)) {
11091
- if (X && se.match(/^\d+$/))
11084
+ if (Y && se.match(/^\d+$/))
11092
11085
  return ue;
11093
11086
  ne = JSON.stringify("" + se), ne.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/) ? (ne = ne.substr(1, ne.length - 2), ne = C.stylize(ne, "name")) : (ne = ne.replace(/'/g, "\\'").replace(/\\"/g, '"').replace(/(^"|"$)/g, "'"), ne = C.stylize(ne, "string"));
11094
11087
  }
11095
11088
  return ne + ": " + ue;
11096
11089
  }
11097
11090
  function w(C, k, $) {
11098
- var Y = C.reduce(function(se, X) {
11099
- return X.indexOf(`
11100
- `) >= 0, se + X.replace(/\u001b\[\d\d?m/g, "").length + 1;
11091
+ var Q = C.reduce(function(se, Y) {
11092
+ return Y.indexOf(`
11093
+ `) >= 0, se + Y.replace(/\u001b\[\d\d?m/g, "").length + 1;
11101
11094
  }, 0);
11102
- return Y > 60 ? $[0] + (k === "" ? "" : k + `
11095
+ return Q > 60 ? $[0] + (k === "" ? "" : k + `
11103
11096
  `) + " " + C.join(`,
11104
11097
  `) + " " + $[1] : $[0] + k + " " + C.join(", ") + " " + $[1];
11105
11098
  }
@@ -11135,10 +11128,10 @@ Expecting ` + te.join(", ") + ", got '" + (this.terminals_[F] || F) + "'" : Z =
11135
11128
  return C === void 0;
11136
11129
  }
11137
11130
  i.isUndefined = F;
11138
- function N(C) {
11131
+ function M(C) {
11139
11132
  return B(C) && W(C) === "[object RegExp]";
11140
11133
  }
11141
- i.isRegExp = N;
11134
+ i.isRegExp = M;
11142
11135
  function B(C) {
11143
11136
  return typeof C == "object" && C !== null;
11144
11137
  }
@@ -11175,8 +11168,8 @@ Expecting ` + te.join(", ") + ", got '" + (this.terminals_[F] || F) + "'" : Z =
11175
11168
  console.log("%s - %s", V(), i.format.apply(i, arguments));
11176
11169
  }, i.inherits = t("inherits"), i._extend = function(C, k) {
11177
11170
  if (!k || !B(k)) return C;
11178
- for (var $ = Object.keys(k), Y = $.length; Y--; )
11179
- C[$[Y]] = k[$[Y]];
11171
+ for (var $ = Object.keys(k), Q = $.length; Q--; )
11172
+ C[$[Q]] = k[$[Q]];
11180
11173
  return C;
11181
11174
  };
11182
11175
  function pe(C, k) {
@@ -11467,9 +11460,9 @@ Expecting ` + te.join(", ") + ", got '" + (this.terminals_[F] || F) + "'" : Z =
11467
11460
  F[Z] = l[Z];
11468
11461
  });
11469
11462
  for (var v = 0; v < d.params.length; v++) {
11470
- var N = d.params[v];
11471
- if (N.type == "Identifier")
11472
- l[N.name] = null;
11463
+ var M = d.params[v];
11464
+ if (M.type == "Identifier")
11465
+ l[M.name] = null;
11473
11466
  else return u;
11474
11467
  }
11475
11468
  for (var v in j)
@@ -11845,8 +11838,8 @@ function requireSetDay() {
11845
11838
  var g = (0, l.getDefaultOptions)(), b = (0, a.default)((h = (y = (m = (v = d == null ? void 0 : d.weekStartsOn) !== null && v !== void 0 ? v : d == null || (p = d.locale) === null || p === void 0 || (E = p.options) === null || E === void 0 ? void 0 : E.weekStartsOn) !== null && m !== void 0 ? m : g.weekStartsOn) !== null && y !== void 0 ? y : (S = g.locale) === null || S === void 0 || (w = S.options) === null || w === void 0 ? void 0 : w.weekStartsOn) !== null && h !== void 0 ? h : 0);
11846
11839
  if (!(b >= 0 && b <= 6))
11847
11840
  throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");
11848
- var A = (0, i.default)(o), q = (0, a.default)(f), x = A.getDay(), D = q % 7, j = (D + 7) % 7, F = 7 - b, N = q < 0 || q > 6 ? q - (x + F) % 7 : (j + F) % 7 - (x + F) % 7;
11849
- return (0, r.default)(A, N);
11841
+ var A = (0, i.default)(o), q = (0, a.default)(f), x = A.getDay(), D = q % 7, j = (D + 7) % 7, F = 7 - b, M = q < 0 || q > 6 ? q - (x + F) % 7 : (j + F) % 7 - (x + F) % 7;
11842
+ return (0, r.default)(A, M);
11850
11843
  }
11851
11844
  n.exports = e.default;
11852
11845
  }(setDay$1, setDay$1.exports)), setDay$1.exports;
@@ -13004,7 +12997,6 @@ class Utils {
13004
12997
  populateWithItemRef(e, t, r, i, a, s) {
13005
12998
  return populateWithItemRef(e, t, r, i, a, s);
13006
12999
  }
13007
- //here
13008
13000
  compareItems(e, t, r) {
13009
13001
  return compareItems(e, t, r);
13010
13002
  }
@@ -13067,7 +13059,6 @@ class Utils {
13067
13059
  compareObjects(e, t) {
13068
13060
  return compareObjects(e, t);
13069
13061
  }
13070
- //
13071
13062
  compareAppsItemsLists(e, t, r) {
13072
13063
  const i = new Blob([compare_items_lists_Worker()], {
13073
13064
  type: "application/javascript"
@@ -13438,7 +13429,7 @@ async function createAngularModuleInstance(gudhub, module_id, module_url, angula
13438
13429
  async function createClassInstance(n, e, t, r, i) {
13439
13430
  try {
13440
13431
  t || console.error("JS link must be provided for this data type - ".concat(e));
13441
- let s = await ((f) => (!IS_BROWSER_MAIN_THREAD && !global.hasOwnProperty("window") && (global.window = proxy, global.document = i.document, global.Element = i.Element, global.CharacterData = i.CharacterData, global.this = proxy, global.self = proxy, global.Blob = i.Blob, global.Node = i.Node, global.navigator = i.navigator, global.HTMLElement = i.HTMLElement, global.XMLHttpRequest = i.XMLHttpRequest, global.WebSocket = i.WebSocket, global.crypto = i.crypto, global.DOMParser = i.DOMParser, global.Symbol = i.Symbol, global.document.queryCommandSupported = (d) => (console.log("QUERY COMMAND SUPPORTED: ", d), !1), global.angular = angular), new Promise(async (d) => {
13432
+ let s = await ((f) => (IS_BROWSER_MAIN_THREAD || (global.window = proxy, global.document = i.document, global.Element = i.Element, global.CharacterData = i.CharacterData, global.this = proxy, global.self = proxy, global.Blob = i.Blob, global.Node = i.Node, global.navigator = i.navigator, global.HTMLElement = i.HTMLElement, global.XMLHttpRequest = i.XMLHttpRequest, global.WebSocket = i.WebSocket, global.crypto = i.crypto, global.DOMParser = i.DOMParser, global.Symbol = i.Symbol, global.document.queryCommandSupported = (d) => (console.log("QUERY COMMAND SUPPORTED: ", d), !1), global.angular = angular), new Promise(async (d) => {
13442
13433
  let h = await axios.get(f).catch((v) => {
13443
13434
  console.log("Failed to fetch: ".concat(f, " in ghconstructor. Module id: ").concat(e));
13444
13435
  }), m = "data:text/javascript;charset=utf-8," + encodeURIComponent(h.data);
@@ -13453,7 +13444,7 @@ async function createClassInstance(n, e, t, r, i) {
13453
13444
  console.log("Error while importing module: ".concat(e)), console.log(f);
13454
13445
  }
13455
13446
  let u = new l.default(e);
13456
- if (r && IS_BROWSER_MAIN_THREAD) {
13447
+ if (r && IS_BROWSER) {
13457
13448
  const f = document.createElement("link");
13458
13449
  f.href = r, f.setAttribute("data-module", e), f.setAttribute("rel", "stylesheet"), document.getElementsByTagName("head")[0].appendChild(f);
13459
13450
  }
@@ -13796,14 +13787,6 @@ class AppProcessor {
13796
13787
  if (e)
13797
13788
  return (await this.getApp(e)).views_list;
13798
13789
  }
13799
- async handleAppChange(e, t, r) {
13800
- let i = this.util.areViewListsEqual(t.views_list, r.views_list), a = this.util.areFieldListsEqual(t.field_list, r.field_list);
13801
- (i || a) && this.updateAppFieldsAndViews({
13802
- id: e,
13803
- views_list: r.views_list,
13804
- field_list: r.field_list
13805
- });
13806
- }
13807
13790
  clearAppProcessor() {
13808
13791
  this.getAppListPromises = null, this.getAppPromises = {}, this.applistReceived = !1;
13809
13792
  }
@@ -13963,17 +13946,6 @@ class ItemProcessor {
13963
13946
  });
13964
13947
  }), t;
13965
13948
  }
13966
- //here
13967
- /////
13968
- handleItemsChange(e, t, r) {
13969
- let i = this.util.compareItems(t.items_list, r.items_list);
13970
- this.updateItemsInStorage(e, i.diff_src_items), this.addItemsToStorage(e, i.new_src_items);
13971
- }
13972
- //
13973
- triggerItemsChange(e, t) {
13974
- this.updateItemsInStorage(e, t.diff_src_items), this.addItemsToStorage(e, t.new_src_items);
13975
- }
13976
- //
13977
13949
  handleDiff(e, t) {
13978
13950
  this.updateItemsInStorage(e, t.diff_src_items), this.addItemsToStorage(e, t.new_src_items), this.deleteItemsFromStorage(e, t.trash_src_items);
13979
13951
  }
@@ -14881,28 +14853,17 @@ class WebSocketEmitter {
14881
14853
  class DataService {
14882
14854
  }
14883
14855
  let AppDataService$1 = class extends DataService {
14884
- //interface for indexeddb and http services
14885
14856
  constructor(e, t, r) {
14886
14857
  super(), this.chunkDataService = new ChunkDataService(e, chunkDataServiceConf, r), this.gudhub = r;
14887
14858
  }
14888
14859
  isWithCache() {
14889
14860
  return !1;
14890
14861
  }
14891
- //here
14892
14862
  async processRequestedApp(e, t) {
14893
14863
  if (!this.isWithCache()) {
14894
14864
  let r = await this.chunkDataService.getMergedChunkForIDList(e, t.chunks);
14895
14865
  return r && (t.items_list = await this.gudhub.util.mergeChunks([r, t])), t;
14896
14866
  }
14897
- throw new Error();
14898
- }
14899
- }, ChunkDataService$1 = class extends DataService {
14900
- //interface for indexeddb and http services
14901
- //here
14902
- getMergedChunkForIDList(e) {
14903
- }
14904
- isWithCache() {
14905
- return !1;
14906
14867
  }
14907
14868
  };
14908
14869
  class AppAPI {
@@ -14936,12 +14897,12 @@ class AppHttpService extends AppDataService$1 {
14936
14897
  let i = new HttpService(t);
14937
14898
  objectAssignWithOverride(this, i);
14938
14899
  }
14900
+ // TODO getApp -> getAppAndProcessData
14939
14901
  async getApp(e) {
14940
14902
  let t = await this.appApi.getApp(e);
14941
14903
  return this.processRequestedApp(e, t);
14942
14904
  }
14943
- //TODO should be getApp and getAppAndProcessData - refactor whole code to use them
14944
- //TODO андрей говорил про то что там надо фильтровать айтемы удаленные, я так и не доделал
14905
+ // TODO -> getApp
14945
14906
  async getAppWithoutProcessing(e) {
14946
14907
  return this.appApi.getApp(e);
14947
14908
  }
@@ -14955,6 +14916,56 @@ class AppHttpService extends AppDataService$1 {
14955
14916
  }
14956
14917
  }
14957
14918
  }
14919
+ let ChunkDataService$1 = class extends DataService {
14920
+ getMergedChunkForIDList(e) {
14921
+ }
14922
+ isWithCache() {
14923
+ return !1;
14924
+ }
14925
+ };
14926
+ class ChunkAPI {
14927
+ constructor(e) {
14928
+ this.req = e;
14929
+ }
14930
+ async getChunk(e, t) {
14931
+ return this.req.get({
14932
+ url: "".concat(this.req.root, "/api/get-items-chunk/").concat(e, "/").concat(t),
14933
+ method: "GET"
14934
+ });
14935
+ }
14936
+ async getLastChunk(e) {
14937
+ return this.req.axiosRequest({
14938
+ url: "".concat(this.req.root, "/api/get-last-items-chunk/").concat(e),
14939
+ method: "GET"
14940
+ });
14941
+ }
14942
+ }
14943
+ class ChunkHttpService extends ChunkDataService$1 {
14944
+ constructor(e, t) {
14945
+ super(), this.chunkApi = new ChunkAPI(e);
14946
+ let r = new HttpService(t);
14947
+ objectAssignWithOverride(this, r);
14948
+ }
14949
+ async getChunk(e, t) {
14950
+ return this.chunkApi.getChunk(e, t);
14951
+ }
14952
+ async getChunksForId(e) {
14953
+ return [];
14954
+ }
14955
+ getCachedMergedChunk(e, t) {
14956
+ }
14957
+ getMergedChunkForIDList(e, t) {
14958
+ }
14959
+ putChunk() {
14960
+ }
14961
+ static [Symbol.hasInstance](e) {
14962
+ try {
14963
+ return e instanceof ChunkHttpService || e instanceof HttpService;
14964
+ } catch {
14965
+ return !1;
14966
+ }
14967
+ }
14968
+ }
14958
14969
  const appsConf = {
14959
14970
  // dbName,
14960
14971
  // dbVersion,
@@ -14968,17 +14979,13 @@ const appsConf = {
14968
14979
  // dbVersion,
14969
14980
  store: "chunksMergeCache"
14970
14981
  };
14971
- class IndexedDBService {
14972
- constructor(e) {
14973
- this.store = e.store, this.dbName = e.dbName, this.dbVersion = e.dbVersion, this.requestCache = /* @__PURE__ */ new Map();
14974
- }
14982
+ class StoreBackend {
14975
14983
  }
14976
- class IndexedDBManager {
14984
+ class IndexedDBManager extends StoreBackend {
14977
14985
  constructor(e, t) {
14978
14986
  if (IndexedDBManager.dbNameToInstanceMap || (IndexedDBManager.dbNameToInstanceMap = /* @__PURE__ */ new Map()), IndexedDBManager.dbNameToInstanceMap.has(e)) return IndexedDBManager.dbNameToInstanceMap.get(e);
14979
- this.db = null, this.dbName = e, this.storeNameList = t, IndexedDBManager.dbNameToInstanceMap.set(e, this), this.db = null;
14987
+ this.db = null, this.dbName = e, this.storeNameList = t, IndexedDBManager.dbNameToInstanceMap.set(e, this);
14980
14988
  }
14981
- // TODO also remove outdated stores
14982
14989
  async checkAndCreateStore(e) {
14983
14990
  const r = (await indexedDB.databases()).find((s) => s.name === this.dbName);
14984
14991
  let i = !1, a = this;
@@ -15000,12 +15007,6 @@ class IndexedDBManager {
15000
15007
  }, u.onerror = l;
15001
15008
  });
15002
15009
  }
15003
- // // Usage example
15004
- // checkAndCreateStore('myDatabase', 'myObjectStore').then(() => {
15005
- // console.log('Check and creation (if necessary) complete.');
15006
- // }).catch(error => {
15007
- // console.error('Error checking and creating object store:', error);
15008
- // });
15009
15010
  async openDB() {
15010
15011
  if (this.db) return this.db;
15011
15012
  let e, t, r = new Promise((s, l) => {
@@ -15031,129 +15032,30 @@ class IndexedDBManager {
15031
15032
  }
15032
15033
  });
15033
15034
  }
15034
- // в инете пишут что индексдб сам хендлит транзакции, может не нужно вообще городить эти конструкции
15035
- // async enqueueOperation(storeName, type, operation) {
15036
- // await this.ensureStoreExists(storeName); // Ensure the store exists <-----------------------
15037
- // const db = await this.dbPromise;
15038
- // return new Promise((resolve, reject) => {
15039
- // const transaction = db.transaction(storeName, type);
15040
- // const store = transaction.objectStore(storeName);
15041
- // const request = operation(store);
15042
- // request.onsuccess = (event) => {
15043
- // resolve(event.target.result);
15044
- // };
15045
- // request.onerror = (event) => {
15046
- // reject(event.target.error);
15047
- // };
15048
- // });
15049
- // }
15050
- async enqueueOperation(e, t) {
15051
- if (this.queue.push({
15052
- storeName: e,
15053
- operation: t
15054
- }), !this.isProcessing) {
15055
- for (this.isProcessing = !0; this.queue.length > 0; ) {
15056
- const {
15057
- storeName: r,
15058
- operation: i
15059
- } = this.queue.shift();
15060
- try {
15061
- await this.executeOperation(r, i);
15062
- } catch (a) {
15063
- console.error("Operation failed:", a);
15064
- }
15065
- }
15066
- this.isProcessing = !1;
15067
- }
15068
- }
15069
- // единственное что тут не нравится - версия динамически меняется
15070
- async ensureStoreExists(e) {
15071
- }
15072
- // async ensureStoreExists(storeName) {
15073
- // const db = await this.dbPromise;
15074
- // if (!db.objectStoreNames.contains(storeName)) {
15075
- // this.db.close();
15076
- // const version = db.version + 1;
15077
- // const request = indexedDB.open(this.dbName, version);
15078
- // request.onupgradeneeded = (event) => {
15079
- // const upgradedDb = event.target.result;
15080
- // if (!upgradedDb.objectStoreNames.contains(storeName)) {
15081
- // upgradedDb.createObjectStore(storeName, { keyPath: 'id', autoIncrement: true });
15035
+ // async enqueueOperation(storeName, operation) {
15036
+ // this.queue.push({ storeName, operation });
15037
+ // if (!this.isProcessing) {
15038
+ // this.isProcessing = true;
15039
+ // while (this.queue.length > 0) {
15040
+ // const { storeName, operation } = this.queue.shift();
15041
+ // try {
15042
+ // await this.executeOperation(storeName, operation);
15043
+ // } catch (error) {
15044
+ // console.error('Operation failed:', error);
15082
15045
  // }
15083
- // };
15084
- // return new Promise((resolve, reject) => {
15085
- // request.onsuccess = (event) => {
15086
- // this.db = event.target.result;
15087
- // this.dbPromise = Promise.resolve(this.db); // Update the dbPromise
15088
- // resolve(this.db);
15089
- // };
15090
- // request.onerror = (event) => {
15091
- // reject(event.target.error);
15092
- // };
15093
- // });
15046
+ // }
15047
+ // this.isProcessing = false;
15094
15048
  // }
15095
- // return Promise.resolve(db);
15096
15049
  // }
15097
- async createObjectStore(e) {
15098
- }
15099
- }
15100
- const gudhubIndexedDBManager = new IndexedDBManager(
15101
- dbName,
15102
- // dbVersion,
15103
- [appsConf.store, chunksConf.store, chunksMergeConf.store]
15104
- );
15105
- class ChunkAPI {
15106
- constructor(e) {
15107
- this.req = e;
15108
- }
15109
- async getChunk(e, t) {
15110
- return this.req.get({
15111
- url: "".concat(this.req.root, "/api/get-items-chunk/").concat(e, "/").concat(t),
15112
- method: "GET"
15113
- });
15114
- }
15115
- async getLastChunk(e) {
15116
- return this.req.axiosRequest({
15117
- url: "".concat(this.req.root, "/api/get-last-items-chunk/").concat(e),
15118
- method: "GET"
15119
- });
15120
- }
15121
- }
15122
- class ChunkHttpService extends ChunkDataService$1 {
15123
- constructor(e, t) {
15124
- super(), this.chunkApi = new ChunkAPI(e);
15125
- let r = new HttpService(t);
15126
- objectAssignWithOverride(this, r);
15127
- }
15128
- async getChunk(e, t) {
15129
- return this.chunkApi.getChunk(e, t);
15130
- }
15131
- async getChunksForId(e) {
15132
- return [];
15133
- }
15134
- getCachedMergedChunk(e, t) {
15135
- }
15136
- //here
15137
- getMergedChunkForIDList(e, t) {
15138
- }
15139
- putChunk() {
15140
- }
15141
- static [Symbol.hasInstance](e) {
15142
- try {
15143
- return e instanceof ChunkHttpService || e instanceof HttpService;
15144
- } catch {
15145
- return !1;
15146
- }
15147
- }
15148
15050
  }
15051
+ const indexedDBStoreBackendSingleton = new IndexedDBManager(dbName, [appsConf.store, chunksConf.store, chunksMergeConf.store]);
15149
15052
  class BaseStoreManager {
15150
- // constructor(dbManager, dbName, storeName) {
15151
15053
  constructor(e, t) {
15152
- this.dbManager = e, this.storeName = t;
15054
+ this.storeBackend = e, this.storeName = t;
15153
15055
  }
15154
15056
  async addItem(e, t) {
15155
15057
  return new Promise(async (r, i) => {
15156
- this.dbManager.executeOperation(this.storeName, (a) => {
15058
+ this.storeBackend.executeOperation(this.storeName, (a) => {
15157
15059
  const s = a.add(t, e);
15158
15060
  s.onsuccess = r, s.onerror = i;
15159
15061
  });
@@ -15161,7 +15063,7 @@ class BaseStoreManager {
15161
15063
  }
15162
15064
  async putItem(e, t) {
15163
15065
  return new Promise(async (r, i) => {
15164
- this.dbManager.executeOperation(this.storeName, (a) => {
15066
+ this.storeBackend.executeOperation(this.storeName, (a) => {
15165
15067
  const s = a.put(t, e);
15166
15068
  s.onsuccess = r, s.onerror = i;
15167
15069
  });
@@ -15173,19 +15075,10 @@ class BaseStoreManager {
15173
15075
  } catch {
15174
15076
  return !1;
15175
15077
  }
15176
- return new Promise(async (t, r) => {
15177
- this.dbManager.executeOperation(this.storeName, (i) => {
15178
- const a = i.get(e);
15179
- a.onsuccess = () => {
15180
- const s = a.result;
15181
- t(s);
15182
- }, a.onerror = r;
15183
- });
15184
- });
15185
15078
  }
15186
15079
  async getItem(e) {
15187
15080
  return new Promise(async (t, r) => {
15188
- this.dbManager.executeOperation(this.storeName, (i) => {
15081
+ this.storeBackend.executeOperation(this.storeName, (i) => {
15189
15082
  const a = i.get(e);
15190
15083
  a.onsuccess = () => {
15191
15084
  const s = a.result;
@@ -15196,7 +15089,7 @@ class BaseStoreManager {
15196
15089
  }
15197
15090
  async updateItem(e, t) {
15198
15091
  return new Promise(async (r, i) => {
15199
- this.dbManager.executeOperation(this.storeName, (a) => {
15092
+ this.storeBackend.executeOperation(this.storeName, (a) => {
15200
15093
  const s = a.get(e);
15201
15094
  s.onsuccess = () => {
15202
15095
  const l = s.result;
@@ -15207,7 +15100,7 @@ class BaseStoreManager {
15207
15100
  }
15208
15101
  async deleteItem(e) {
15209
15102
  return new Promise(async (t, r) => {
15210
- this.dbManager.executeOperation(this.storeName, (i) => {
15103
+ this.storeBackend.executeOperation(this.storeName, (i) => {
15211
15104
  const a = i.delete(e);
15212
15105
  a.onsuccess = t, a.onerror = r;
15213
15106
  });
@@ -15216,7 +15109,7 @@ class BaseStoreManager {
15216
15109
  }
15217
15110
  class AppStoreManager extends BaseStoreManager {
15218
15111
  constructor() {
15219
- super(gudhubIndexedDBManager, appsConf.store);
15112
+ super(indexedDBStoreBackendSingleton, appsConf.store);
15220
15113
  }
15221
15114
  async getApp(e) {
15222
15115
  return this.getItem(e);
@@ -15233,11 +15126,10 @@ class AppStoreManager extends BaseStoreManager {
15233
15126
  async deleteApp(e) {
15234
15127
  return this.deleteItem(e);
15235
15128
  }
15236
- // Additional methods specific to AppStoreManager if necessary
15237
15129
  }
15238
15130
  class MergedChunksStoreManager extends BaseStoreManager {
15239
15131
  constructor() {
15240
- super(gudhubIndexedDBManager, chunksMergeConf.store);
15132
+ super(indexedDBStoreBackendSingleton, chunksMergeConf.store);
15241
15133
  }
15242
15134
  async get(e) {
15243
15135
  return this.getItem(e);
@@ -15257,11 +15149,9 @@ class IndexedDBChunkService extends ChunkDataService$1 {
15257
15149
  constructor(e, t, r) {
15258
15150
  super(e, t), this.dataService = new ChunkHttpService(e), this.requestCache = /* @__PURE__ */ new Map(), this.gudhub = r, this.storeManager = new MergedChunksStoreManager();
15259
15151
  }
15260
- //TODO use IndexedDBFacade here
15261
- // indexDBAccess = new IndexedDBFacade;
15262
15152
  static [Symbol.hasInstance](e) {
15263
15153
  try {
15264
- return e instanceof IndexedDBChunkService || e instanceof IndexedDBService;
15154
+ return e instanceof IndexedDBChunkService;
15265
15155
  } catch {
15266
15156
  return !1;
15267
15157
  }
@@ -15328,116 +15218,26 @@ class IndexedDBChunkService extends ChunkDataService$1 {
15328
15218
  };
15329
15219
  }
15330
15220
  }
15331
- // async function fetchAndMergeArrays(urls) {
15332
- // try {
15333
- // // Create an array of fetch promises
15334
- // const requests = urls.map(url => fetch(url).then(response => response.json()));
15335
- // // Wait for all requests to complete
15336
- // const results = await Promise.all(requests);
15337
- // // Merge all arrays
15338
- // const mergedArray = results.flat(); // or use reduce: results.reduce((acc, arr) => acc.concat(arr), []);
15339
- // return mergedArray;
15340
- // } catch (error) {
15341
- // console.error('Error fetching data:', error);
15342
- // throw error;
15343
- // }
15344
- // }
15345
- // // Example usage:
15346
- // const urls = ['https://api.example.com/data1', 'https://api.example.com/data2'];
15347
- // fetchAndMergeArrays(urls)
15348
- // .then(mergedArray => console.log(mergedArray))
15349
- // .catch(error => console.error('Error:', error));
15350
- //todo also optimize chunks transactions etc
15351
15221
  async putMergedChunks(e, t) {
15352
15222
  return this.storeManager.put(e, t);
15353
15223
  }
15354
- // async getMergedChunks(id, data) {
15355
- // return this.storeManager.get(id, data);
15356
- // }
15357
- async putChunk(e, t) {
15358
- return this.storeManager.putChunk(e, t);
15359
- }
15360
- // async getApp(id) {
15361
- // if (this.requestCache.has(id)) return this.requestCache.get(id);
15362
- // let self = this;
15363
- // let dataServiceRequest = this.dataService.getApp(id);
15364
- // let pr = new Promise(async (resolve, reject) => {
15365
- // try {
15366
- // const db = await self.openDatabase();
15367
- // const transaction = db.transaction(self.store, "readonly");
15368
- // const store = transaction.objectStore(self.store);
15369
- // const storeRequest = store.get(id);
15370
- // storeRequest.onsuccess = (e) => {
15371
- // let cachedData = e.target.result;
15372
- // if (
15373
- // !cachedData
15374
- // ) {
15375
- // dataServiceRequest.then(resolve, reject);
15376
- // dataServiceRequest.then(data => self.putApp(id, data));
15377
- // }
15378
- // if (
15379
- // cachedData
15380
- // ) {
15381
- // resolve(cachedData);
15382
- // dataServiceRequest.then(async (data) => {
15383
- // // self.gudhub.processAppUpd(data, cachedData);//
15384
- // await self.putApp(id, data);
15385
- // self.gudhub.triggerAppUpdate(id, prevVersion, newVersion);
15386
- // });
15387
- // }
15388
- // };
15389
- // storeRequest.onerror = () => {
15390
- // dataServiceRequest.then(resolve, reject);
15391
- // dataServiceRequest.then(data => self.putApp(id, data));
15392
- // }
15393
- // } catch (error) {
15394
- // dataServiceRequest.then(resolve, reject);
15395
- // dataServiceRequest.then(data => self.putApp(id, data));
15396
- // }
15397
- // });
15398
- // self.requestCache.set(id, pr);
15399
- // return pr;
15400
- // }
15401
- async getChunk(e, t) {
15402
- if (this.requestCache.has(t)) return this.requestCache.get(t);
15403
- try {
15404
- let r = this.storeManager.getChunk(t);
15405
- return self.requestCache.set(t, r), await r, r;
15406
- } catch {
15407
- let i = this.dataService.getChunk(e, t);
15408
- this.requestCache.set(t, i);
15409
- let a = await i;
15410
- return this.putChunk(t, a), i;
15411
- }
15412
- }
15413
- // async openDatabase() {
15414
- // return new Promise((resolve, reject) => {
15415
- // const request = indexedDB.open(this.dbName, this.dbVersion);
15416
- // request.onsuccess = event => {
15417
- // resolve(event.target.result);
15418
- // };
15419
- // request.onerror = event => {
15420
- // reject(event.target.error);
15421
- // };
15422
- // });
15423
- // }
15424
15224
  }
15425
- const jsContent = `(function(){"use strict";(()=>{let Dt,qt,Or,jr;var oe=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{};function G(n){return n&&n.__esModule?n.default:n}function Tr(n,e,t,r){Object.defineProperty(n,e,{get:t,set:r,enumerable:!0,configurable:!0})}var Bt={},_t={},A=oe.parcelRequire94c2;A==null&&((A=function(n){if(n in Bt)return Bt[n].exports;if(n in _t){var e=_t[n];delete _t[n];var t={id:n,exports:{}};return Bt[n]=t,e.call(t.exports,t,t.exports),t.exports}var r=Error("Cannot find module '"+n+"'");throw r.code="MODULE_NOT_FOUND",r}).register=function(n,e){_t[n]=e},oe.parcelRequire94c2=A);var L=A.register;L("1ufAB",function(n,e){var t=A("iEaqd"),r=A("iNZzY"),a=A("2VbXH"),i=A("6Mx50");function l(u){var o=new a(u),p=r(a.prototype.request,o);return t.extend(p,a.prototype,o),t.extend(p,o),p}var s=l(A("bM4se"));s.Axios=a,s.create=function(u){return l(i(s.defaults,u))},s.Cancel=A("g2liO"),s.CancelToken=A("14PRn"),s.isCancel=A("8kGOw"),s.all=function(u){return Promise.all(u)},s.spread=A("i3hBo"),s.isAxiosError=A("dhYWP"),n.exports=s,n.exports.default=s}),L("iEaqd",function(n,e){var t=A("iNZzY"),r=Object.prototype.toString;function a(I){return r.call(I)==="[object Array]"}function i(I){return I===void 0}function l(I){return I!==null&&!i(I)&&I.constructor!==null&&!i(I.constructor)&&typeof I.constructor.isBuffer=="function"&&I.constructor.isBuffer(I)}function s(I){return r.call(I)==="[object ArrayBuffer]"}function u(I){return typeof FormData<"u"&&I instanceof FormData}function o(I){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?ArrayBuffer.isView(I):I&&I.buffer&&I.buffer instanceof ArrayBuffer}function p(I){return typeof I=="string"}function m(I){return typeof I=="number"}function d(I){return I!==null&&typeof I=="object"}function y(I){if(r.call(I)!=="[object Object]")return!1;var F=Object.getPrototypeOf(I);return F===null||F===Object.prototype}function f(I){return r.call(I)==="[object Date]"}function S(I){return r.call(I)==="[object File]"}function v(I){return r.call(I)==="[object Blob]"}function w(I){return r.call(I)==="[object Function]"}function g(I){return d(I)&&w(I.pipe)}function _(I){return typeof URLSearchParams<"u"&&I instanceof URLSearchParams}function $(I){return I.trim?I.trim():I.replace(/^\\s+|\\s+$/g,"")}function x(){return(typeof navigator>"u"||navigator.product!=="ReactNative"&&navigator.product!=="NativeScript"&&navigator.product!=="NS")&&typeof window<"u"&&typeof document<"u"}function T(I,F){if(I!=null)if(typeof I!="object"&&(I=[I]),a(I))for(var C=0,B=I.length;C<B;C++)F.call(null,I[C],C,I);else for(var V in I)Object.prototype.hasOwnProperty.call(I,V)&&F.call(null,I[V],V,I)}function P(){var I={};function F(V,X){y(I[X])&&y(V)?I[X]=P(I[X],V):y(V)?I[X]=P({},V):a(V)?I[X]=V.slice():I[X]=V}for(var C=0,B=arguments.length;C<B;C++)T(arguments[C],F);return I}function D(I,F,C){return T(F,function(B,V){C&&typeof B=="function"?I[V]=t(B,C):I[V]=B}),I}function R(I){return I.charCodeAt(0)===65279&&(I=I.slice(1)),I}n.exports={isArray:a,isArrayBuffer:s,isBuffer:l,isFormData:u,isArrayBufferView:o,isString:p,isNumber:m,isObject:d,isPlainObject:y,isUndefined:i,isDate:f,isFile:S,isBlob:v,isFunction:w,isStream:g,isURLSearchParams:_,isStandardBrowserEnv:x,forEach:T,merge:P,extend:D,trim:$,stripBOM:R}}),L("iNZzY",function(n,e){n.exports=function(t,r){return function(){for(var a=Array(arguments.length),i=0;i<a.length;i++)a[i]=arguments[i];return t.apply(r,a)}}}),L("2VbXH",function(n,e){var t=A("iEaqd"),r=A("gWG2h"),a=A("4m3Da"),i=A("d4try"),l=A("6Mx50"),s=A("hiYAY"),u=s.validators;function o(p){this.defaults=p,this.interceptors={request:new a,response:new a}}o.prototype.request=function(p){typeof p=="string"?(p=arguments[1]||{},p.url=arguments[0]):p=p||{},(p=l(this.defaults,p)).method?p.method=p.method.toLowerCase():this.defaults.method?p.method=this.defaults.method.toLowerCase():p.method="get";var m,d=p.transitional;d!==void 0&&s.assertOptions(d,{silentJSONParsing:u.transitional(u.boolean,"1.0.0"),forcedJSONParsing:u.transitional(u.boolean,"1.0.0"),clarifyTimeoutError:u.transitional(u.boolean,"1.0.0")},!1);var y=[],f=!0;this.interceptors.request.forEach(function($){(typeof $.runWhen!="function"||$.runWhen(p)!==!1)&&(f=f&&$.synchronous,y.unshift($.fulfilled,$.rejected))});var S=[];if(this.interceptors.response.forEach(function($){S.push($.fulfilled,$.rejected)}),!f){var v=[i,void 0];for(Array.prototype.unshift.apply(v,y),v=v.concat(S),m=Promise.resolve(p);v.length;)m=m.then(v.shift(),v.shift());return m}for(var w=p;y.length;){var g=y.shift(),_=y.shift();try{w=g(w)}catch($){_($);break}}try{m=i(w)}catch($){return Promise.reject($)}for(;S.length;)m=m.then(S.shift(),S.shift());return m},o.prototype.getUri=function(p){return r((p=l(this.defaults,p)).url,p.params,p.paramsSerializer).replace(/^\\?/,"")},t.forEach(["delete","get","head","options"],function(p){o.prototype[p]=function(m,d){return this.request(l(d||{},{method:p,url:m,data:(d||{}).data}))}}),t.forEach(["post","put","patch"],function(p){o.prototype[p]=function(m,d,y){return this.request(l(y||{},{method:p,url:m,data:d}))}}),n.exports=o}),L("gWG2h",function(n,e){var t=A("iEaqd");function r(a){return encodeURIComponent(a).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}n.exports=function(a,i,l){if(!i)return a;if(l)s=l(i);else if(t.isURLSearchParams(i))s=i.toString();else{var s,u=[];t.forEach(i,function(p,m){p!=null&&(t.isArray(p)?m+="[]":p=[p],t.forEach(p,function(d){t.isDate(d)?d=d.toISOString():t.isObject(d)&&(d=JSON.stringify(d)),u.push(r(m)+"="+r(d))}))}),s=u.join("&")}if(s){var o=a.indexOf("#");o!==-1&&(a=a.slice(0,o)),a+=(a.indexOf("?")===-1?"?":"&")+s}return a}}),L("4m3Da",function(n,e){var t=A("iEaqd");function r(){this.handlers=[]}r.prototype.use=function(a,i,l){return this.handlers.push({fulfilled:a,rejected:i,synchronous:!!l&&l.synchronous,runWhen:l?l.runWhen:null}),this.handlers.length-1},r.prototype.eject=function(a){this.handlers[a]&&(this.handlers[a]=null)},r.prototype.forEach=function(a){t.forEach(this.handlers,function(i){i!==null&&a(i)})},n.exports=r}),L("d4try",function(n,e){var t=A("iEaqd"),r=A("gu59S"),a=A("8kGOw"),i=A("bM4se");function l(s){s.cancelToken&&s.cancelToken.throwIfRequested()}n.exports=function(s){return l(s),s.headers=s.headers||{},s.data=r.call(s,s.data,s.headers,s.transformRequest),s.headers=t.merge(s.headers.common||{},s.headers[s.method]||{},s.headers),t.forEach(["delete","get","head","post","put","patch","common"],function(u){delete s.headers[u]}),(s.adapter||i.adapter)(s).then(function(u){return l(s),u.data=r.call(s,u.data,u.headers,s.transformResponse),u},function(u){return!a(u)&&(l(s),u&&u.response&&(u.response.data=r.call(s,u.response.data,u.response.headers,s.transformResponse))),Promise.reject(u)})}}),L("gu59S",function(n,e){var t=A("iEaqd"),r=A("bM4se");n.exports=function(a,i,l){var s=this||r;return t.forEach(l,function(u){a=u.call(s,a,i)}),a}}),L("bM4se",function(n,e){var t=A("2dKjk"),r=A("iEaqd"),a=A("4xE2z"),i=A("9na6w"),l={"Content-Type":"application/x-www-form-urlencoded"};function s(p,m){!r.isUndefined(p)&&r.isUndefined(p["Content-Type"])&&(p["Content-Type"]=m)}function u(p,m,d){if(r.isString(p))try{return(m||JSON.parse)(p),r.trim(p)}catch(y){if(y.name!=="SyntaxError")throw y}return(0,JSON.stringify)(p)}var o={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:function(){var p;return(typeof XMLHttpRequest<"u"||t!==void 0&&Object.prototype.toString.call(t)==="[object process]")&&(p=A("kHaX1")),p}(),transformRequest:[function(p,m){return a(m,"Accept"),a(m,"Content-Type"),r.isFormData(p)||r.isArrayBuffer(p)||r.isBuffer(p)||r.isStream(p)||r.isFile(p)||r.isBlob(p)?p:r.isArrayBufferView(p)?p.buffer:r.isURLSearchParams(p)?(s(m,"application/x-www-form-urlencoded;charset=utf-8"),p.toString()):r.isObject(p)||m&&m["Content-Type"]==="application/json"?(s(m,"application/json"),u(p)):p}],transformResponse:[function(p){var m=this.transitional,d=m&&m.silentJSONParsing,y=m&&m.forcedJSONParsing,f=!d&&this.responseType==="json";if(f||y&&r.isString(p)&&p.length)try{return JSON.parse(p)}catch(S){if(f)throw S.name==="SyntaxError"?i(S,this,"E_JSON_PARSE"):S}return p}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(p){return p>=200&&p<300}};o.headers={common:{Accept:"application/json, text/plain, */*"}},r.forEach(["delete","get","head"],function(p){o.headers[p]={}}),r.forEach(["post","put","patch"],function(p){o.headers[p]=r.merge(l)}),n.exports=o}),L("2dKjk",function(n,e){var t,r,a,i=n.exports={};function l(){throw Error("setTimeout has not been defined")}function s(){throw Error("clearTimeout has not been defined")}function u(w){if(t===setTimeout)return setTimeout(w,0);if((t===l||!t)&&setTimeout)return t=setTimeout,setTimeout(w,0);try{return t(w,0)}catch{try{return t.call(null,w,0)}catch{return t.call(this,w,0)}}}function o(w){if(r===clearTimeout)return clearTimeout(w);if((r===s||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(w);try{return r(w)}catch{try{return r.call(null,w)}catch{return r.call(this,w)}}}(function(){try{t=typeof setTimeout=="function"?setTimeout:l}catch{t=l}try{r=typeof clearTimeout=="function"?clearTimeout:s}catch{r=s}})();var p=[],m=!1,d=-1;function y(){m&&a&&(m=!1,a.length?p=a.concat(p):d=-1,p.length&&f())}function f(){if(!m){var w=u(y);m=!0;for(var g=p.length;g;){for(a=p,p=[];++d<g;)a&&a[d].run();d=-1,g=p.length}a=null,m=!1,o(w)}}function S(w,g){this.fun=w,this.array=g}function v(){}i.nextTick=function(w){var g=Array(arguments.length-1);if(arguments.length>1)for(var _=1;_<arguments.length;_++)g[_-1]=arguments[_];p.push(new S(w,g)),p.length!==1||m||u(f)},S.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=v,i.addListener=v,i.once=v,i.off=v,i.removeListener=v,i.removeAllListeners=v,i.emit=v,i.prependListener=v,i.prependOnceListener=v,i.listeners=function(w){return[]},i.binding=function(w){throw Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(w){throw Error("process.chdir is not supported")},i.umask=function(){return 0}}),L("4xE2z",function(n,e){var t=A("iEaqd");n.exports=function(r,a){t.forEach(r,function(i,l){l!==a&&l.toUpperCase()===a.toUpperCase()&&(r[a]=i,delete r[l])})}}),L("9na6w",function(n,e){n.exports=function(t,r,a,i,l){return t.config=r,a&&(t.code=a),t.request=i,t.response=l,t.isAxiosError=!0,t.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code}},t}}),L("kHaX1",function(n,e){var t=A("iEaqd"),r=A("hAgIk"),a=A("gIEx2"),i=A("gWG2h"),l=A("e3Yo9"),s=A("lo19V"),u=A("eg6xZ"),o=A("iUqaj");n.exports=function(p){return new Promise(function(m,d){var y=p.data,f=p.headers,S=p.responseType;t.isFormData(y)&&delete f["Content-Type"];var v=new XMLHttpRequest;if(p.auth){var w=p.auth.username||"",g=p.auth.password?unescape(encodeURIComponent(p.auth.password)):"";f.Authorization="Basic "+btoa(w+":"+g)}var _=l(p.baseURL,p.url);function $(){if(v){var T="getAllResponseHeaders"in v?s(v.getAllResponseHeaders()):null,P=S&&S!=="text"&&S!=="json"?v.response:v.responseText,D={data:P,status:v.status,statusText:v.statusText,headers:T,config:p,request:v};r(m,d,D),v=null}}if(v.open(p.method.toUpperCase(),i(_,p.params,p.paramsSerializer),!0),v.timeout=p.timeout,"onloadend"in v?v.onloadend=$:v.onreadystatechange=function(){v&&v.readyState===4&&(v.status!==0||v.responseURL&&v.responseURL.indexOf("file:")===0)&&setTimeout($)},v.onabort=function(){v&&(d(o("Request aborted",p,"ECONNABORTED",v)),v=null)},v.onerror=function(){d(o("Network Error",p,null,v)),v=null},v.ontimeout=function(){var T="timeout of "+p.timeout+"ms exceeded";p.timeoutErrorMessage&&(T=p.timeoutErrorMessage),d(o(T,p,p.transitional&&p.transitional.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",v)),v=null},t.isStandardBrowserEnv()){var x=(p.withCredentials||u(_))&&p.xsrfCookieName?a.read(p.xsrfCookieName):void 0;x&&(f[p.xsrfHeaderName]=x)}"setRequestHeader"in v&&t.forEach(f,function(T,P){y===void 0&&P.toLowerCase()==="content-type"?delete f[P]:v.setRequestHeader(P,T)}),t.isUndefined(p.withCredentials)||(v.withCredentials=!!p.withCredentials),S&&S!=="json"&&(v.responseType=p.responseType),typeof p.onDownloadProgress=="function"&&v.addEventListener("progress",p.onDownloadProgress),typeof p.onUploadProgress=="function"&&v.upload&&v.upload.addEventListener("progress",p.onUploadProgress),p.cancelToken&&p.cancelToken.promise.then(function(T){v&&(v.abort(),d(T),v=null)}),y||(y=null),v.send(y)})}}),L("hAgIk",function(n,e){var t=A("iUqaj");n.exports=function(r,a,i){var l=i.config.validateStatus;!i.status||!l||l(i.status)?r(i):a(t("Request failed with status code "+i.status,i.config,null,i.request,i))}}),L("iUqaj",function(n,e){var t=A("9na6w");n.exports=function(r,a,i,l,s){return t(Error(r),a,i,l,s)}}),L("gIEx2",function(n,e){var t=A("iEaqd");n.exports=t.isStandardBrowserEnv()?function(){return{write:function(r,a,i,l,s,u){var o=[];o.push(r+"="+encodeURIComponent(a)),t.isNumber(i)&&o.push("expires="+new Date(i).toGMTString()),t.isString(l)&&o.push("path="+l),t.isString(s)&&o.push("domain="+s),u===!0&&o.push("secure"),document.cookie=o.join("; ")},read:function(r){var a=document.cookie.match(RegExp("(^|;\\\\s*)("+r+")=([^;]*)"));return a?decodeURIComponent(a[3]):null},remove:function(r){this.write(r,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}()}),L("e3Yo9",function(n,e){var t=A("2rjk0"),r=A("5nGHC");n.exports=function(a,i){return a&&!t(i)?r(a,i):i}}),L("2rjk0",function(n,e){n.exports=function(t){return/^([a-z][a-z\\d\\+\\-\\.]*:)?\\/\\//i.test(t)}}),L("5nGHC",function(n,e){n.exports=function(t,r){return r?t.replace(/\\/+$/,"")+"/"+r.replace(/^\\/+/,""):t}}),L("lo19V",function(n,e){var t=A("iEaqd"),r=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];n.exports=function(a){var i,l,s,u={};return a&&t.forEach(a.split(\`
15426
- \`),function(o){s=o.indexOf(":"),i=t.trim(o.substr(0,s)).toLowerCase(),l=t.trim(o.substr(s+1)),i&&!(u[i]&&r.indexOf(i)>=0)&&(i==="set-cookie"?u[i]=(u[i]?u[i]:[]).concat([l]):u[i]=u[i]?u[i]+", "+l:l)}),u}}),L("eg6xZ",function(n,e){var t=A("iEaqd");n.exports=t.isStandardBrowserEnv()?function(){var r,a=/(msie|trident)/i.test(navigator.userAgent),i=document.createElement("a");function l(s){var u=s;return a&&(i.setAttribute("href",u),u=i.href),i.setAttribute("href",u),{href:i.href,protocol:i.protocol?i.protocol.replace(/:$/,""):"",host:i.host,search:i.search?i.search.replace(/^\\?/,""):"",hash:i.hash?i.hash.replace(/^#/,""):"",hostname:i.hostname,port:i.port,pathname:i.pathname.charAt(0)==="/"?i.pathname:"/"+i.pathname}}return r=l(window.location.href),function(s){var u=t.isString(s)?l(s):s;return u.protocol===r.protocol&&u.host===r.host}}():function(){return function(){return!0}}()}),L("8kGOw",function(n,e){n.exports=function(t){return!!(t&&t.__CANCEL__)}}),L("6Mx50",function(n,e){var t=A("iEaqd");n.exports=function(r,a){a=a||{};var i={},l=["url","method","data"],s=["headers","auth","proxy","params"],u=["baseURL","transformRequest","transformResponse","paramsSerializer","timeout","timeoutMessage","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","decompress","maxContentLength","maxBodyLength","maxRedirects","transport","httpAgent","httpsAgent","cancelToken","socketPath","responseEncoding"],o=["validateStatus"];function p(f,S){return t.isPlainObject(f)&&t.isPlainObject(S)?t.merge(f,S):t.isPlainObject(S)?t.merge({},S):t.isArray(S)?S.slice():S}function m(f){t.isUndefined(a[f])?t.isUndefined(r[f])||(i[f]=p(void 0,r[f])):i[f]=p(r[f],a[f])}t.forEach(l,function(f){t.isUndefined(a[f])||(i[f]=p(void 0,a[f]))}),t.forEach(s,m),t.forEach(u,function(f){t.isUndefined(a[f])?t.isUndefined(r[f])||(i[f]=p(void 0,r[f])):i[f]=p(void 0,a[f])}),t.forEach(o,function(f){f in a?i[f]=p(r[f],a[f]):f in r&&(i[f]=p(void 0,r[f]))});var d=l.concat(s).concat(u).concat(o),y=Object.keys(r).concat(Object.keys(a)).filter(function(f){return d.indexOf(f)===-1});return t.forEach(y,m),i}}),L("hiYAY",function(n,e){var t=A("bTAft"),r={};["object","boolean","number","function","string","symbol"].forEach(function(u,o){r[u]=function(p){return typeof p===u||"a"+(o<1?"n ":" ")+u}});var a={},i=t.version.split(".");function l(u,o){for(var p=o?o.split("."):i,m=u.split("."),d=0;d<3;d++){if(p[d]>m[d])return!0;if(p[d]<m[d])break}return!1}function s(u,o,p){if(typeof u!="object")throw TypeError("options must be an object");for(var m=Object.keys(u),d=m.length;d-- >0;){var y=m[d],f=o[y];if(f){var S=u[y],v=S===void 0||f(S,y,u);if(v!==!0)throw TypeError("option "+y+" must be "+v);continue}if(p!==!0)throw Error("Unknown option "+y)}}r.transitional=function(u,o,p){var m=o&&l(o);function d(y,f){return"[Axios v"+t.version+"] Transitional option '"+y+"'"+f+(p?". "+p:"")}return function(y,f,S){if(u===!1)throw Error(d(f," has been removed in "+o));return m&&!a[f]&&(a[f]=!0,console.warn(d(f," has been deprecated since v"+o+" and will be removed in the near future"))),!u||u(y,f,S)}},n.exports={isOlderVersion:l,assertOptions:s,validators:r}}),L("bTAft",function(n,e){n.exports=JSON.parse('{"_args":[["axios@0.21.4","/home/vitaly/Documents/work/gudhubclient/override_npm/gudhub"]],"_from":"axios@0.21.4","_id":"axios@0.21.4","_inBundle":false,"_integrity":"sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==","_location":"/axios","_phantomChildren":{},"_requested":{"type":"version","registry":true,"raw":"axios@0.21.4","name":"axios","escapedName":"axios","rawSpec":"0.21.4","saveSpec":null,"fetchSpec":"0.21.4"},"_requiredBy":["/"],"_resolved":"https://registry.npmjs.org/axios/-/axios-0.21.4.tgz","_spec":"0.21.4","_where":"/home/vitaly/Documents/work/gudhubclient/override_npm/gudhub","author":{"name":"Matt Zabriskie"},"browser":{"./lib/adapters/http.js":"./lib/adapters/xhr.js"},"bugs":{"url":"https://github.com/axios/axios/issues"},"bundlesize":[{"path":"./dist/axios.min.js","threshold":"5kB"}],"dependencies":{"follow-redirects":"^1.14.0"},"description":"Promise based HTTP client for the browser and node.js","devDependencies":{"coveralls":"^3.0.0","es6-promise":"^4.2.4","grunt":"^1.3.0","grunt-banner":"^0.6.0","grunt-cli":"^1.2.0","grunt-contrib-clean":"^1.1.0","grunt-contrib-watch":"^1.0.0","grunt-eslint":"^23.0.0","grunt-karma":"^4.0.0","grunt-mocha-test":"^0.13.3","grunt-ts":"^6.0.0-beta.19","grunt-webpack":"^4.0.2","istanbul-instrumenter-loader":"^1.0.0","jasmine-core":"^2.4.1","karma":"^6.3.2","karma-chrome-launcher":"^3.1.0","karma-firefox-launcher":"^2.1.0","karma-jasmine":"^1.1.1","karma-jasmine-ajax":"^0.1.13","karma-safari-launcher":"^1.0.0","karma-sauce-launcher":"^4.3.6","karma-sinon":"^1.0.5","karma-sourcemap-loader":"^0.3.8","karma-webpack":"^4.0.2","load-grunt-tasks":"^3.5.2","minimist":"^1.2.0","mocha":"^8.2.1","sinon":"^4.5.0","terser-webpack-plugin":"^4.2.3","typescript":"^4.0.5","url-search-params":"^0.10.0","webpack":"^4.44.2","webpack-dev-server":"^3.11.0"},"homepage":"https://axios-http.com","jsdelivr":"dist/axios.min.js","keywords":["xhr","http","ajax","promise","node"],"license":"MIT","main":"index.js","name":"axios","repository":{"type":"git","url":"git+https://github.com/axios/axios.git"},"scripts":{"build":"NODE_ENV=production grunt build","coveralls":"cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js","examples":"node ./examples/server.js","fix":"eslint --fix lib/**/*.js","postversion":"git push && git push --tags","preversion":"npm test","start":"node ./sandbox/server.js","test":"grunt test","version":"npm run build && grunt version && git add -A dist && git add CHANGELOG.md bower.json package.json"},"typings":"./index.d.ts","unpkg":"dist/axios.min.js","version":"0.21.4"}')}),L("g2liO",function(n,e){function t(r){this.message=r}t.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},t.prototype.__CANCEL__=!0,n.exports=t}),L("14PRn",function(n,e){var t=A("g2liO");function r(a){if(typeof a!="function")throw TypeError("executor must be a function.");this.promise=new Promise(function(s){i=s});var i,l=this;a(function(s){l.reason||(l.reason=new t(s),i(l.reason))})}r.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},r.source=function(){var a;return{token:new r(function(i){a=i}),cancel:a}},n.exports=r}),L("i3hBo",function(n,e){n.exports=function(t){return function(r){return t.apply(null,r)}}}),L("dhYWP",function(n,e){n.exports=function(t){return typeof t=="object"&&t.isAxiosError===!0}}),L("kfIQl",function(n,e){var t=typeof Symbol<"u"&&Symbol,r=A("lyEFc");n.exports=function(){return typeof t=="function"&&typeof Symbol=="function"&&typeof t("foo")=="symbol"&&typeof Symbol("bar")=="symbol"&&r()}}),L("lyEFc",function(n,e){n.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},r=Symbol("test"),a=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(a)!=="[object Symbol]")return!1;var i=42;for(r in t[r]=i,t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var l=Object.getOwnPropertySymbols(t);if(l.length!==1||l[0]!==r||!Object.prototype.propertyIsEnumerable.call(t,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var s=Object.getOwnPropertyDescriptor(t,r);if(s.value!==i||s.enumerable!==!0)return!1}return!0}}),L("bJ3CN",function(n,e){var t={__proto__:null,foo:{}},r=Object;n.exports=function(){return{__proto__:t}.foo===t.foo&&!(t instanceof r)}}),L("9cNUg",function(n,e){var t=A("hGGZx"),r=function(){return!!t};r.hasArrayLengthDefineBug=function(){if(!t)return null;try{return t([],"length",{value:1}).length!==1}catch{return!0}},n.exports=r}),L("hGGZx",function(n,e){var t=A("hMrGw")("%Object.defineProperty%",!0)||!1;if(t)try{t({},"a",{value:1})}catch{t=!1}n.exports=t}),L("hMrGw",function(n,e){var t=A("dUpie"),r=A("48xLS"),a=A("4Vqmv"),i=A("7x6DQ"),l=A("kPNod"),s=A("b9GfH"),u=A("8DBKi"),o=Function,p=function(H){try{return o('"use strict"; return ('+H+").constructor;")()}catch{}},m=Object.getOwnPropertyDescriptor;if(m)try{m({},"")}catch{m=null}var d=function(){throw new s},y=m?function(){try{return arguments.callee,d}catch{try{return m(arguments,"callee").get}catch{return d}}}():d,f=A("kfIQl")(),S=A("bJ3CN")(),v=Object.getPrototypeOf||(S?function(H){return H.__proto__}:null),w={},g=typeof Uint8Array<"u"&&v?v(Uint8Array):void 0,_={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?void 0:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?void 0:ArrayBuffer,"%ArrayIteratorPrototype%":f&&v?v([][Symbol.iterator]()):void 0,"%AsyncFromSyncIteratorPrototype%":void 0,"%AsyncFunction%":w,"%AsyncGenerator%":w,"%AsyncGeneratorFunction%":w,"%AsyncIteratorPrototype%":w,"%Atomics%":typeof Atomics>"u"?void 0:Atomics,"%BigInt%":typeof BigInt>"u"?void 0:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?void 0:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?void 0:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?void 0:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":t,"%eval%":eval,"%EvalError%":r,"%Float32Array%":typeof Float32Array>"u"?void 0:Float32Array,"%Float64Array%":typeof Float64Array>"u"?void 0:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?void 0:FinalizationRegistry,"%Function%":o,"%GeneratorFunction%":w,"%Int8Array%":typeof Int8Array>"u"?void 0:Int8Array,"%Int16Array%":typeof Int16Array>"u"?void 0:Int16Array,"%Int32Array%":typeof Int32Array>"u"?void 0:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":f&&v?v(v([][Symbol.iterator]())):void 0,"%JSON%":typeof JSON=="object"?JSON:void 0,"%Map%":typeof Map>"u"?void 0:Map,"%MapIteratorPrototype%":typeof Map<"u"&&f&&v?v(new Map()[Symbol.iterator]()):void 0,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?void 0:Promise,"%Proxy%":typeof Proxy>"u"?void 0:Proxy,"%RangeError%":a,"%ReferenceError%":i,"%Reflect%":typeof Reflect>"u"?void 0:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?void 0:Set,"%SetIteratorPrototype%":typeof Set<"u"&&f&&v?v(new Set()[Symbol.iterator]()):void 0,"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?void 0:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":f&&v?v(""[Symbol.iterator]()):void 0,"%Symbol%":f?Symbol:void 0,"%SyntaxError%":l,"%ThrowTypeError%":y,"%TypedArray%":g,"%TypeError%":s,"%Uint8Array%":typeof Uint8Array>"u"?void 0:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?void 0:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?void 0:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?void 0:Uint32Array,"%URIError%":u,"%WeakMap%":typeof WeakMap>"u"?void 0:WeakMap,"%WeakRef%":typeof WeakRef>"u"?void 0:WeakRef,"%WeakSet%":typeof WeakSet>"u"?void 0:WeakSet};if(v)try{null.error}catch(H){var $=v(v(H));_["%Error.prototype%"]=$}var x=function H(ie){var ee;if(ie==="%AsyncFunction%")ee=p("async function () {}");else if(ie==="%GeneratorFunction%")ee=p("function* () {}");else if(ie==="%AsyncGeneratorFunction%")ee=p("async function* () {}");else if(ie==="%AsyncGenerator%"){var k=H("%AsyncGeneratorFunction%");k&&(ee=k.prototype)}else if(ie==="%AsyncIteratorPrototype%"){var O=H("%AsyncGenerator%");O&&v&&(ee=v(O.prototype))}return _[ie]=ee,ee},T={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},P=A("hweMw"),D=A("23C6u"),R=P.call(Function.call,Array.prototype.concat),I=P.call(Function.apply,Array.prototype.splice),F=P.call(Function.call,String.prototype.replace),C=P.call(Function.call,String.prototype.slice),B=P.call(Function.call,RegExp.prototype.exec),V=/[^%.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|(["'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|%$))/g,X=/\\\\(\\\\)?/g,le=function(H){var ie=C(H,0,1),ee=C(H,-1);if(ie==="%"&&ee!=="%")throw new l("invalid intrinsic syntax, expected closing \`%\`");if(ee==="%"&&ie!=="%")throw new l("invalid intrinsic syntax, expected opening \`%\`");var k=[];return F(H,V,function(O,N,K,se){k[k.length]=K?F(se,X,"$1"):N||O}),k},ve=function(H,ie){var ee,k=H;if(D(T,k)&&(k="%"+(ee=T[k])[0]+"%"),D(_,k)){var O=_[k];if(O===w&&(O=x(k)),O===void 0&&!ie)throw new s("intrinsic "+H+" exists, but is not available. Please file an issue!");return{alias:ee,name:k,value:O}}throw new l("intrinsic "+H+" does not exist!")};n.exports=function(H,ie){if(typeof H!="string"||H.length===0)throw new s("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof ie!="boolean")throw new s('"allowMissing" argument must be a boolean');if(B(/^%?[^%]*%?$/,H)===null)throw new l("\`%\` may not be present anywhere but at the beginning and end of the intrinsic name");var ee=le(H),k=ee.length>0?ee[0]:"",O=ve("%"+k+"%",ie),N=O.name,K=O.value,se=!1,te=O.alias;te&&(k=te[0],I(ee,R([0,1],te)));for(var J=1,ce=!0;J<ee.length;J+=1){var re=ee[J],fe=C(re,0,1),ke=C(re,-1);if((fe==='"'||fe==="'"||fe==="\`"||ke==='"'||ke==="'"||ke==="\`")&&fe!==ke)throw new l("property names with quotes must have matching quotes");if(re!=="constructor"&&ce||(se=!0),k+="."+re,D(_,N="%"+k+"%"))K=_[N];else if(K!=null){if(!(re in K)){if(!ie)throw new s("base intrinsic for "+H+" exists, but the property is not available.");return}if(m&&J+1>=ee.length){var Ae=m(K,re);K=(ce=!!Ae)&&"get"in Ae&&!("originalValue"in Ae.get)?Ae.get:K[re]}else ce=D(K,re),K=K[re];ce&&!se&&(_[N]=K)}}return K}}),L("dUpie",function(n,e){n.exports=Error}),L("48xLS",function(n,e){n.exports=EvalError}),L("4Vqmv",function(n,e){n.exports=RangeError}),L("7x6DQ",function(n,e){n.exports=ReferenceError}),L("kPNod",function(n,e){n.exports=SyntaxError}),L("b9GfH",function(n,e){n.exports=TypeError}),L("8DBKi",function(n,e){n.exports=URIError}),L("hweMw",function(n,e){var t=A("2Eytq");n.exports=Function.prototype.bind||t}),L("2Eytq",function(n,e){var t="Function.prototype.bind called on incompatible ",r=Object.prototype.toString,a=Math.max,i="[object Function]",l=function(o,p){for(var m=[],d=0;d<o.length;d+=1)m[d]=o[d];for(var y=0;y<p.length;y+=1)m[y+o.length]=p[y];return m},s=function(o,p){for(var m=[],d=p,y=0;d<o.length;d+=1,y+=1)m[y]=o[d];return m},u=function(o,p){for(var m="",d=0;d<o.length;d+=1)m+=o[d],d+1<o.length&&(m+=p);return m};n.exports=function(o){var p,m=this;if(typeof m!="function"||r.apply(m)!==i)throw TypeError(t+m);for(var d=s(arguments,1),y=function(){if(this instanceof p){var g=m.apply(this,l(d,arguments));return Object(g)===g?g:this}return m.apply(o,l(d,arguments))},f=a(0,m.length-d.length),S=[],v=0;v<f;v++)S[v]="$"+v;if(p=Function("binder","return function ("+u(S,",")+"){ return binder.apply(this,arguments); }")(y),m.prototype){var w=function(){};w.prototype=m.prototype,p.prototype=new w,w.prototype=null}return p}}),L("23C6u",function(n,e){var t=Function.prototype.call,r=Object.prototype.hasOwnProperty,a=A("hweMw");n.exports=a.call(t,r)}),L("5ZWAZ",function(n,e){function t(r){return n.exports=t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(a){return typeof a}:function(a){return a&&typeof Symbol=="function"&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},n.exports.__esModule=!0,n.exports.default=n.exports,t(r)}n.exports=t,n.exports.__esModule=!0,n.exports.default=n.exports}),L("fgq5y",function(n,e){var t=A("f3Ywx").default;Object.defineProperty(n.exports,"__esModule",{value:!0}),n.exports.default=l;var r=t(A("a9VQw")),a=t(A("glRwo")),i=t(A("ayR3G"));function l(s,u){(0,i.default)(2,arguments);var o=(0,a.default)(s),p=(0,r.default)(u);return isNaN(p)?new Date(NaN):(p&&o.setDate(o.getDate()+p),o)}n.exports=n.exports.default}),L("f3Ywx",function(n,e){function t(r){return r&&r.__esModule?r:{default:r}}n.exports=t,n.exports.__esModule=!0,n.exports.default=n.exports}),L("a9VQw",function(n,e){function t(r){if(r===null||r===!0||r===!1)return NaN;var a=Number(r);return isNaN(a)?a:a<0?Math.ceil(a):Math.floor(a)}Object.defineProperty(n.exports,"__esModule",{value:!0}),n.exports.default=t,n.exports=n.exports.default}),L("glRwo",function(n,e){var t=A("f3Ywx").default;Object.defineProperty(n.exports,"__esModule",{value:!0}),n.exports.default=i;var r=t(A("5ZWAZ")),a=t(A("ayR3G"));function i(l){(0,a.default)(1,arguments);var s=Object.prototype.toString.call(l);return l instanceof Date||(0,r.default)(l)==="object"&&s==="[object Date]"?new Date(l.getTime()):typeof l=="number"||s==="[object Number]"?new Date(l):((typeof l=="string"||s==="[object String]")&&typeof console<"u"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use \`parseISO\` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn(Error().stack)),new Date(NaN))}n.exports=n.exports.default}),L("ayR3G",function(n,e){function t(r,a){if(a.length<r)throw TypeError(r+" argument"+(r>1?"s":"")+" required, but only "+a.length+" present")}Object.defineProperty(n.exports,"__esModule",{value:!0}),n.exports.default=t,n.exports=n.exports.default}),L("byyO9",function(n,e){var t=A("f3Ywx").default;Object.defineProperty(n.exports,"__esModule",{value:!0}),n.exports.default=l;var r=t(A("a9VQw")),a=t(A("glRwo")),i=t(A("ayR3G"));function l(s,u){(0,i.default)(2,arguments);var o=(0,a.default)(s),p=(0,r.default)(u);if(isNaN(p))return new Date(NaN);if(!p)return o;var m=o.getDate(),d=new Date(o.getTime());return d.setMonth(o.getMonth()+p+1,0),m>=d.getDate()?d:(o.setFullYear(d.getFullYear(),d.getMonth(),m),o)}n.exports=n.exports.default}),L("hLz6R",function(n,e){var t=A("f3Ywx").default;Object.defineProperty(n.exports,"__esModule",{value:!0}),n.exports.default=s;var r=t(A("glRwo")),a=t(A("a9VQw")),i=t(A("ayR3G")),l=A("lmyOi");function s(u,o){(0,i.default)(1,arguments);var p,m,d,y,f,S,v,w,g=(0,l.getDefaultOptions)(),_=(0,a.default)((p=(m=(d=(y=o==null?void 0:o.weekStartsOn)!==null&&y!==void 0?y:o==null||(f=o.locale)===null||f===void 0||(S=f.options)===null||S===void 0?void 0:S.weekStartsOn)!==null&&d!==void 0?d:g.weekStartsOn)!==null&&m!==void 0?m:(v=g.locale)===null||v===void 0||(w=v.options)===null||w===void 0?void 0:w.weekStartsOn)!==null&&p!==void 0?p:0);if(!(_>=0&&_<=6))throw RangeError("weekStartsOn must be between 0 and 6 inclusively");var $=(0,r.default)(u),x=$.getDay(),T=(x<_?7:0)+x-_;return $.setDate($.getDate()-T),$.setHours(0,0,0,0),$}n.exports=n.exports.default}),L("lmyOi",function(n,e){Object.defineProperty(n.exports,"__esModule",{value:!0}),n.exports.getDefaultOptions=r,n.exports.setDefaultOptions=a;var t={};function r(){return t}function a(i){t=i}}),L("kmcAT",function(n,e){A("akXK4"),A("5xozB")}),L("akXK4",function(n,e){n.exports=A("1ufAB")}),L("5xozB",function(n,e){Tr(n.exports,"IS_BROWSER_MAIN_THREAD",()=>r),Tr(n.exports,"IS_BROWSER",()=>i);var t=A("2dKjk");let r=![typeof window,typeof document].includes("undefined"),a=typeof self=="object"&&typeof WorkerGlobalScope<"u",i=r||a;t!==void 0&&t.versions!=null&&t.versions.node});let ia="https://gudhub.com/GudHub_Test",sa="wss://gudhub.com/GudHub/ws/app/",oa="https://gudhub.com/api/services/prod",la="build/latest/async_modules_node/",ca="build/latest/automation_modules/",ua="https://gudhub.com",pa=!0,da=!0;var Ee=A("5xozB");class Pr{}class Ut extends Pr{constructor(e,t,r){super(),this.chunkDataService=new qt(e,jr,r),this.gudhub=r}isWithCache(){return!1}async processRequestedApp(e,t){if(!this.isWithCache()){let r=await this.chunkDataService.getMergedChunkForIDList(e,t.chunks);return r&&(t.items_list=await this.gudhub.util.mergeChunks([r,t])),t}throw Error()}}class Cr extends Pr{getMergedChunkForIDList(e){}isWithCache(){return!1}}class fa{constructor(e){this.req=e}async getApp(e){return this.req.get({url:"/api/app/get",params:{app_id:e}})}}let Nr=(n,...e)=>{for(let t of e)if(t)for(let r of Object.keys(t)){let a=Object.getOwnPropertyDescriptor(t,r);a.enumerable&&Object.defineProperty(n,r,a)}};class bt{}class Qe extends Ut{constructor(e,t,r){super(e,t,r),this.appApi=new fa(e),Nr(this,new bt(t))}async getApp(e){let t=await this.appApi.getApp(e);return this.processRequestedApp(e,t)}async getAppWithoutProcessing(e){return this.appApi.getApp(e)}async putApp(e,t){}static[Symbol.hasInstance](e){try{return e instanceof Qe||e instanceof bt}catch{return!1}}}let vt={store:"apps"},Mr={store:"chunks"},ha="gudhub",wt={store:"chunksMergeCache"};class Gt{constructor(e){this.store=e.store,this.dbName=e.dbName,this.dbVersion=e.dbVersion,this.requestCache=new Map}}class We{constructor(e,t){if(We.dbNameToInstanceMap||(We.dbNameToInstanceMap=new Map),We.dbNameToInstanceMap.has(e))return We.dbNameToInstanceMap.get(e);this.db=null,this.dbName=e,this.storeNameList=t,We.dbNameToInstanceMap.set(e,this),this.db=null}async checkAndCreateStore(e){let t=(await indexedDB.databases()).find(i=>i.name===this.dbName),r=!1,a=this;return t&&(r=await new Promise((i,l)=>{let s=indexedDB.open(a.dbName);s.onsuccess=function(u){let o=u.target.result,p=o.objectStoreNames.contains(e);o.close(),i(p)},s.onerror=function(u){l(u.target.error)}})),!!r||new Promise((i,l)=>{let s=indexedDB.open(a.dbName,t?t.version+1:1);s.onupgradeneeded=function(u){let o=u.target.result;o.objectStoreNames.contains(e)||o.createObjectStore(e)},s.onsuccess=function(u){u.target.result.close(),i()},s.onerror=l})}async openDB(){let e,t;if(this.db)return this.db;let r=new Promise((l,s)=>{e=l,t=s});for(let l of this.storeNameList)await this.checkAndCreateStore(l);let a=this,i=indexedDB.open(this.dbName);return i.onsuccess=l=>{a.db=l.target.result,e(this.db)},i.onerror=t,r}async executeOperation(e,t){let r=await this.openDB();return new Promise((a,i)=>{let l=r.transaction(e,"readwrite"),s=l.objectStore(e);l.oncomplete=()=>a(),l.onerror=u=>i(\`Transaction failed: \${u.target.error}\`);try{t(s)}catch(u){i(\`Operation failed: \${u.message}\`)}})}async enqueueOperation(e,t){if(this.queue.push({storeName:e,operation:t}),!this.isProcessing){for(this.isProcessing=!0;this.queue.length>0;){let{storeName:r,operation:a}=this.queue.shift();try{await this.executeOperation(r,a)}catch(i){console.error("Operation failed:",i)}}this.isProcessing=!1}}async ensureStoreExists(e){}async createObjectStore(e){}}let Rr=new We(ha,[vt.store,Mr.store,wt.store]);class ma{constructor(e){this.req=e}async getChunk(e,t){return this.req.get({url:\`\${this.req.root}/api/get-items-chunk/\${e}/\${t}\`,method:"GET"})}async getLastChunk(e){return this.req.axiosRequest({url:\`\${this.req.root}/api/get-last-items-chunk/\${e}\`,method:"GET"})}}class $t extends Cr{constructor(e,t){super(),this.chunkApi=new ma(e),Nr(this,new bt(t))}async getChunk(e,t){return this.chunkApi.getChunk(e,t)}async getChunksForId(e){return[]}getCachedMergedChunk(e,t){}getMergedChunkForIDList(e,t){}putChunk(){}static[Symbol.hasInstance](e){try{return e instanceof $t||e instanceof bt}catch{return!1}}}class Fr{constructor(e,t){this.dbManager=e,this.storeName=t}async addItem(e,t){return new Promise(async(r,a)=>{this.dbManager.executeOperation(this.storeName,i=>{let l=i.add(t,e);l.onsuccess=r,l.onerror=a})})}async putItem(e,t){return new Promise(async(r,a)=>{this.dbManager.executeOperation(this.storeName,i=>{let l=i.put(t,e);l.onsuccess=r,l.onerror=a})})}async hasItem(e){try{return!!await this.getItem(e)}catch{return!1}return new Promise(async(t,r)=>{this.dbManager.executeOperation(this.storeName,a=>{let i=a.get(e);i.onsuccess=()=>{t(i.result)},i.onerror=r})})}async getItem(e){return new Promise(async(t,r)=>{this.dbManager.executeOperation(this.storeName,a=>{let i=a.get(e);i.onsuccess=()=>{t(i.result)},i.onerror=r})})}async updateItem(e,t){return new Promise(async(r,a)=>{this.dbManager.executeOperation(this.storeName,i=>{let l=i.get(e);l.onsuccess=()=>{let s=l.result;Object.assign(s,t),i.put(s,e),r()},l.onerror=a})})}async deleteItem(e){return new Promise(async(t,r)=>{this.dbManager.executeOperation(this.storeName,a=>{let i=a.delete(e);i.onsuccess=t,i.onerror=r})})}}class Lr extends Fr{constructor(){super(Rr,vt.store)}async getApp(e){return this.getItem(e)}async addApp(e,t){return this.addItem(e,t)}async putApp(e,t){return this.putItem(e,t)}async hasApp(e){return this.hasItem(e)}async deleteApp(e){return this.deleteItem(e)}}class ga extends Fr{constructor(){super(Rr,wt.store)}async get(e){return this.getItem(e)}async add(e,t){return this.addItem(e,t)}async put(e,t){return this.putItem(e,t)}async delete(e){return this.deleteItem(e)}}class at extends Cr{constructor(e,t,r){super(e,t),this.dataService=new $t(e),this.requestCache=new Map,this.gudhub=r,this.storeManager=new ga}static[Symbol.hasInstance](e){try{return e instanceof at||e instanceof Gt}catch{return!1}}async getCachedMergedChunk(e,t){try{return(await this.storeManager.get(e)).mergedData}catch{let a=t.map(s=>this.dataService.getChunk(e,s)),i=await Promise.all(a),l=await this.gudhub.util.mergeChunks(i);return this.putMergedChunks(e,{hashes:t,mergedData:{items_list:l}}),{items_list:l}}}isWithCache(){return!0}async getMergedChunkForApp(e){}async getMergedChunkForIDList(e,t){try{let r,a=!0,i=await this.storeManager.get(e);try{if(t.length<i.hashes.length)throw Error();for(let u of i.hashes)t.indexOf(u)!=i.hashes.indexOf(u)&&(a=!1)}catch{a=!1}let l=[],s=[];if(t.length>i.hashes.length&&(l=t.slice(i.hashes.length)),a||(l=t),l.length>0){let u=l.map(o=>this.dataService.getChunk(e,o));s=await Promise.all(u)}return a||(r=await this.gudhub.util.mergeChunks([...s])),a&&(r=await this.gudhub.util.mergeChunks([i.mergedData,...s])),l.length>0&&this.putMergedChunks(e,{hashes:t,mergedData:{items_list:r}}),{items_list:r}}catch{let a=t.map(s=>this.dataService.getChunk(e,s)),i=await Promise.all(a),l=await this.gudhub.util.mergeChunks(i);return this.putMergedChunks(e,{hashes:t,mergedData:{items_list:l}}),{items_list:l}}}async putMergedChunks(e,t){return this.storeManager.put(e,t)}async putChunk(e,t){return this.storeManager.putChunk(e,t)}async getChunk(e,t){if(this.requestCache.has(t))return this.requestCache.get(t);try{let r=this.storeManager.getChunk(t);return self.requestCache.set(t,r),await r,r}catch{let a=this.dataService.getChunk(e,t);this.requestCache.set(t,a);let i=await a;return this.putChunk(t,i),a}}}class Wt extends Ut{constructor(e,t,r){super(e,t,r),this.dataService=new Qe(e,t,r),this.requestCache=new Map,this.gudhub=r,this.chunkDataService=new at(e,wt,r),this.storeManager=new Lr}static[Symbol.hasInstance](e){try{return e instanceof Wt||e instanceof Gt}catch{return!1}}isWithCache(){return!1}async getAppWithoutProcessing(e){let t=await this.dataService.getAppWithoutProcessing(e);return await this.putApp(e,t),t}async getApp(e){let t=this,r=await this.dataService.getAppWithoutProcessing(e);return await t.processRequestedApp(e,r)}async getCached(e){return this.storeManager.getApp(e)}async putApp(e,t){return this.storeManager.putApp(e,t)}}class Ht extends Ut{constructor(e,t,r){super(e,t,r),this.dataService=new Qe(e,t,r),this.requestCache=new Map,this.gudhub=r,this.resolveFnMap=new Map,this.appRequestAndProcessWorker=new AppRequestWorkerScript,this.appRequestAndProcessWorker.postMessage({type:"init",gudhubSerialized:this.gudhub.serialized});let a=this;this.appRequestAndProcessWorker.onerror=function(i){},this.appRequestAndProcessWorker.onmessage=function(i){i.data.type=="requestApp"&&a.resolveFnMap.has(i.data.id)&&a.resolveFnMap.get(i.data.id)(i.data.data),i.data.type=="processData"&&(a.gudhub.itemProcessor.handleDiff(i.data.id,i.data.compareRes),(i.data.viewListChanged||i.data.fieldListChanged)&&a.gudhub.appProcessor.updateAppFieldsAndViews(i.data.newVersion))},this.storeManager=new Lr}static[Symbol.hasInstance](e){try{return e instanceof Ht||e instanceof Gt}catch{return!1}}isWithCache(){return!1}async getApp(e){if(this.requestCache.has(e))return this.requestCache.get(e);let t=this;await this.has(e);{let r=new Promise((a,i)=>{t.resolveFnMap.set(e,a)});return this.requestCache.set(e,r),this.appRequestAndProcessWorker.postMessage({type:"requestApp",id:e}),r}}async getCached(e){return this.storeManager.getApp(e)}async has(e){try{return this.storeManager.hasApp(e)}catch{}}async putApp(e,t){return this.storeManager.putApp(e,t)}}A("5xozB"),Ee.IS_BROWSER&&pa?(qt=at,jr=Mr):qt=$t,Ee.IS_BROWSER&&da?(Dt=Ht,Or=vt):Dt=Qe;var Ee=A("5xozB");class Dr{constructor(e,t,r,a,i,l,s){this.storage=e,this.pipeService=t,this.req=r,this.ws=a,this.applistReceived=!1,this.activateSW=l,this.util=i,this.appListeners(),this.dataService=s,this.appRequestCache=new Map}async createNewAppApi(e){try{let t=await this.req.post({url:"/api/app/create",form:{app:JSON.stringify(e)}});return t.from_apps_list=!0,t}catch(t){return console.log(t),null}}async updateAppApi(e){try{return await this.req.post({url:"/api/app/update",form:{app:JSON.stringify(e)}})}catch(t){return console.log(t),null}}async deleteAppApi(e){try{return await this.req.post({url:"/api/app/delete",form:{app_id:e}})}catch(t){return console.log(t),null}}async getAppListApi(){try{return(await this.req.get({url:"/api/applist/get"})).apps_list.map(e=>(e.from_apps_list=!0,e))}catch(e){return console.log(e),null}}getAppListFromStorage(){return this.storage.getAppsList()}getAppFromStorage(e){let t=this.storage.getApp(e);return t&&t.field_list.length?t:null}addNewAppToStorage(e){return this.storage.getAppsList().push(e)}saveAppInStorage(e){e.items_object={};for(let r=0;r<e.items_list.length;r++){e.items_object[e.items_list[r].item_id]={};for(let a=0;a<e.items_list[r].fields.length;a++)e.items_object[e.items_list[r].item_id][e.items_list[r].fields[a].field_id]=e.items_list[r].fields[a]}let t=this.storage.getApp(e.app_id);return t?(e.from_apps_list=t.from_apps_list,e.permission=t.permission,this.storage.updateApp(e)):(e.from_apps_list=!1,this.addNewAppToStorage(e)),this.getAppFromStorage(e.app_id)}updateAppFieldsAndViews(e){let t=this.getAppFromStorage(e.app_id);e.items_list=t.items_list,e.file_list=t.file_list,e.from_apps_list=t.from_apps_list,e.items_object=t.items_object,this.storage.updateApp(e),this.pipeService.emit("gh_app_views_update",{app_id:e.app_id},e.views_list),e.field_list.forEach(r=>{this.pipeService.emit("gh_model_update",{app_id:e.app_id,field_id:r.field_id},r)})}updateAppInStorage(e){this.storage.getApp(e.app_id)?(this.storage.updateApp(e),this.pipeService.emit("gh_app_update",{app_id:e.app_id},e),this.pipeService.emit("gh_items_update",{app_id:e.app_id},e.items_list)):this.addNewAppToStorage(e)}deletingAppFromStorage(e){let t=this.storage.getAppsList();return t.forEach((r,a)=>{r.app_id==e&&t.splice(a)}),t}updateAppsListInStorage(e=[]){for(let t of e){let r=this.storage.getApp(t.app_id);r?(r.from_apps_list=t.from_apps_list,r.permission=t.permission):this.addNewAppToStorage(t)}}async refreshApps(e=[]){for(let t of e)if(t!=null)try{let r=await this.dataService.getApp(t);if(r){r.items_object={};for(let a=0;a<r.items_list.length;a++){r.items_object[r.items_list[a].item_id]={};for(let i=0;i<r.items_list[a].fields.length;i++)r.items_object[r.items_list[a].item_id][r.items_list[a].fields[i].field_id]=r.items_list[a].fields[i]}this.updateAppInStorage(r),this.pipeService.emit("gh_app_views_update",{app_id:r.app_id},r.views_list)}}catch(r){console.log(r)}console.log("Apps refreshed: ",JSON.stringify(e))}async refreshAppsList(){let e=this.getAppListFromStorage(),t=(await this.getAppListApi()).map(r=>({...r,...e.find(a=>a.app_id===r.app_id)}));this.updateAppsListInStorage(t),this.pipeService.emit("gh_apps_list_refreshed",{})}async getAppsList(){let e=this.getAppListFromStorage();if(!this.applistReceived){let t=await this.getAppListApi();if(!t)return null;this.updateAppsListInStorage(t),this.applistReceived=!0,e=t}return e}async getAppInfo(e){let t=await this.getAppsList();return t?t.find(r=>r.app_id==e):null}async deleteApp(e){return await this.deleteAppApi(e),this.deletingAppFromStorage(e)}async getApp(e,t=!1){if(!e)return null;let r=this.getAppFromStorage(e);if(r)return r;if(this.appRequestCache.has(e))return this.appRequestCache.get(e);let a=this,i=new Promise(async(l,s)=>{try{let u=await a.dataService.getApp(e);u||s();let o=t?u:{...u,items_list:u.items_list.filter(p=>!p.trash)};o=t?o:{...o,field_list:o.field_list.filter(p=>!p.trash)},l(o),a.saveAppInStorage(o),a.ws.addSubscription(e)}catch{s()}});return a.appRequestCache.set(e,i),i}async updateApp(e){if(!e.views_list||!e.views_list.length||!e.show){let r=await this.getApp(e.app_id);e.views_list&&e.views_list.length||(e.views_list=r.views_list),e.show===void 0&&(e.show=r.show)}let t=await this.updateAppApi(e);return this.updateAppFieldsAndViews(t),t}async updateAppInfo(e={}){return this.pipeService.emit("gh_app_info_update",{app_id:e.app_id},e),this.updateApp(e)}async createNewApp(e){let t=await this.createNewAppApi(e);return t.items_object={},this.addNewAppToStorage(t),t}async getAppViews(e){if(e)return(await this.getApp(e)).views_list}async handleAppChange(e,t,r){let a=this.util.areViewListsEqual(t.views_list,r.views_list),i=this.util.areFieldListsEqual(t.field_list,r.field_list);(a||i)&&this.updateAppFieldsAndViews({id:e,views_list:r.views_list,field_list:r.field_list})}clearAppProcessor(){this.getAppListPromises=null,this.getAppPromises={},this.applistReceived=!1}appListeners(){this.pipeService.onRoot("gh_app_get",{},async(e,t)=>{if(t&&t.app_id){let r=await this.getApp(t.app_id);this.pipeService.emit("gh_app_get",t,r)}}),this.pipeService.onRoot("gh_apps_list_get",{},async(e,t)=>{let r=await this.getAppsList();this.pipeService.emit("gh_apps_list_get",t,r)}),this.pipeService.onRoot("gh_delete_app",{},async(e,t)=>{let r=await this.deleteApp(t.app_id);this.pipeService.emit("gh_apps_list_update",{recipient:"all"},r)}),this.pipeService.onRoot("gh_app_update",{},async(e,t)=>{t.app.items_list=[],t.app.file_list=[];let r=await this.updateApp(t.app);this.pipeService.emit("gh_app_views_update",{app_id:r.app_id},r.views_list);let a=await this.getAppsList();this.pipeService.emit("gh_apps_list_update",{recipient:"all"},a),r.field_list.forEach(i=>{this.pipeService.emit("gh_model_update",{app_id:r.app_id,field_id:i.field_id},i)})}),this.pipeService.onRoot("gh_app_view_get",{},async(e,t)=>{if(t&&t.app_id){let r=await this.getApp(t.app_id);r.views_list.forEach((a,i)=>{a.view_id==t.view_id&&this.pipeService.emit("gh_app_view_get",t,r.views_list[i])})}}),this.pipeService.onRoot("gh_app_info_get",{},async(e,t)=>{let r=await this.getAppInfo(t.app_id);r&&this.pipeService.emit("gh_app_info_get",t,r)}),this.pipeService.onRoot("gh_app_info_update",{},async(e,t)=>{if(t&&t.app){let r=await this.updateAppInfo(t.app);this.pipeService.emit("gh_app_info_update",{app_id:t.app.app_id},r)}}),this.pipeService.onRoot("gh_app_create",{},async(e,t)=>{await this.createNewApp(t.app);let r=await this.getAppsList();this.pipeService.emit("gh_apps_list_update",{recipient:"all"},r)}),Ee.IS_BROWSER_MAIN_THREAD&&this.activateSW&&navigator.serviceWorker.addEventListener("message",async e=>{if(e.data.type==="refresh app"){let t=await this.getApp(e.data.payload.app_id);t&&this.util.compareAppsItemsLists(t.items_list,e.data.payload.items_list.filter(r=>!r.trash),({diff_fields_items:r,diff_fields_items_Ids:a,diff_items:i,newItems:l,deletedItems:s})=>{(i.length||l.length||s.length)&&(this.pipeService.emit("gh_items_update",{app_id:e.data.payload.app_id},e.data.payload.items_list.filter(u=>!u.trash)),i.forEach(u=>this.pipeService.emit("gh_item_update",{app_id:e.data.payload.app_id,item_id:u.item_id},u))),a.forEach(u=>{let o=r[u];o&&o.forEach(p=>{this.pipeService.emit("gh_value_update",{app_id:e.data.payload.app_id,item_id:u,field_id:p.field_id},p.field_value)})})}),e.data.payload.items_list=await this.util.mergeChunks([t,e.data.payload]),this.saveAppInStorage(e.data.payload)}})}}var ht=A("akXK4");function qr(n=[]){return n.filter(e=>e.field_value!=null)}function ya(n={}){let e=Object.entries(n);return e.length?\`&\${e.map(([t,r])=>\`\${t}=\${r}\`).join("&")}\`:""}var St={},Br={},zt={},be=A("hMrGw"),He={},be=A("hMrGw"),it={},Vt=A("hweMw"),be=A("hMrGw"),Ur={},be=A("hMrGw"),Jt={},ot=A("hGGZx"),_a=A("kPNod"),we=A("b9GfH"),st={},be=A("hMrGw"),xt=be("%Object.getOwnPropertyDescriptor%",!0);if(xt)try{xt([],"length")}catch{xt=null}st=xt,Jt=function(n,e,t){if(!n||typeof n!="object"&&typeof n!="function")throw new we("\`obj\` must be an object or a function\`");if(typeof e!="string"&&typeof e!="symbol")throw new we("\`property\` must be a string or a symbol\`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new we("\`nonEnumerable\`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new we("\`nonWritable\`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new we("\`nonConfigurable\`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new we("\`loose\`, if provided, must be a boolean");var r=arguments.length>3?arguments[3]:null,a=arguments.length>4?arguments[4]:null,i=arguments.length>5?arguments[5]:null,l=arguments.length>6&&arguments[6],s=!!st&&st(n,e);if(ot)ot(n,e,{configurable:i===null&&s?s.configurable:!i,enumerable:r===null&&s?s.enumerable:!r,value:t,writable:a===null&&s?s.writable:!a});else{if(!l&&(r||a||i))throw new _a("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");n[e]=t}};var ba=A("9cNUg")(),we=A("b9GfH"),va=be("%Math.floor%");Ur=function(n,e){if(typeof n!="function")throw new we("\`fn\` is not a function");if(typeof e!="number"||e<0||e>4294967295||va(e)!==e)throw new we("\`length\` must be a positive 32-bit integer");var t=arguments.length>2&&!!arguments[2],r=!0,a=!0;if("length"in n&&st){var i=st(n,"length");i&&!i.configurable&&(r=!1),i&&!i.writable&&(a=!1)}return(r||a||!t)&&(ba?Jt(n,"length",e,!0,!0):Jt(n,"length",e)),n};var we=A("b9GfH"),Gr=be("%Function.prototype.apply%"),Wr=be("%Function.prototype.call%"),Hr=be("%Reflect.apply%",!0)||Vt.call(Wr,Gr),ot=A("hGGZx"),wa=be("%Math.max%");it=function(n){if(typeof n!="function")throw new we("a function is required");var e=Hr(Vt,Wr,arguments);return Ur(e,1+wa(0,n.length-(arguments.length-1)),!0)};var zr=function(){return Hr(Vt,Gr,arguments)};ot?ot(it,"apply",{value:zr}):it.apply=zr;var $a=it(be("String.prototype.indexOf"));He=function(n,e){var t=be(n,!!e);return typeof t=="function"&&$a(n,".prototype.")>-1?it(t):t};var Vr={},Yt=typeof Map=="function"&&Map.prototype,Qt=Object.getOwnPropertyDescriptor&&Yt?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,Et=Yt&&Qt&&typeof Qt.get=="function"?Qt.get:null,Jr=Yt&&Map.prototype.forEach,Xt=typeof Set=="function"&&Set.prototype,Kt=Object.getOwnPropertyDescriptor&&Xt?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,kt=Xt&&Kt&&typeof Kt.get=="function"?Kt.get:null,Yr=Xt&&Set.prototype.forEach,Sa=typeof WeakMap=="function"&&WeakMap.prototype,lt=Sa?WeakMap.prototype.has:null,xa=typeof WeakSet=="function"&&WeakSet.prototype,ct=xa?WeakSet.prototype.has:null,Ea=typeof WeakRef=="function"&&WeakRef.prototype,Qr=Ea?WeakRef.prototype.deref:null,ka=Boolean.prototype.valueOf,Aa=Object.prototype.toString,Ia=Function.prototype.toString,Oa=String.prototype.match,Zt=String.prototype.slice,Fe=String.prototype.replace,ja=String.prototype.toUpperCase,Xr=String.prototype.toLowerCase,Kr=RegExp.prototype.test,Zr=Array.prototype.concat,Oe=Array.prototype.join,Ta=Array.prototype.slice,en=Math.floor,er=typeof BigInt=="function"?BigInt.prototype.valueOf:null,tr=Object.getOwnPropertySymbols,rr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,Xe=typeof Symbol=="function"&&typeof Symbol.iterator=="object",ge=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===Xe||!0)?Symbol.toStringTag:null,tn=Object.prototype.propertyIsEnumerable,rn=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(n){return n.__proto__}:null);function nn(n,e){if(n===1/0||n===-1/0||n!=n||n&&n>-1e3&&n<1e3||Kr.call(/e/,e))return e;var t=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof n=="number"){var r=n<0?-en(-n):en(n);if(r!==n){var a=String(r),i=Zt.call(e,a.length+1);return Fe.call(a,t,"$&_")+"."+Fe.call(Fe.call(i,/([0-9]{3})/g,"$&_"),/_$/,"")}}return Fe.call(e,t,"$&_")}var nr={},an=nr.custom,sn=cn(an)?an:null;function on(n,e,t){var r=(t.quoteStyle||e)==="double"?'"':"'";return r+n+r}function Pa(n){return Fe.call(String(n),/"/g,"&quot;")}function ar(n){return De(n)==="[object Array]"&&(!ge||!(typeof n=="object"&&ge in n))}function Ca(n){return De(n)==="[object Date]"&&(!ge||!(typeof n=="object"&&ge in n))}function ln(n){return De(n)==="[object RegExp]"&&(!ge||!(typeof n=="object"&&ge in n))}function Na(n){return De(n)==="[object Error]"&&(!ge||!(typeof n=="object"&&ge in n))}function Ma(n){return De(n)==="[object String]"&&(!ge||!(typeof n=="object"&&ge in n))}function Ra(n){return De(n)==="[object Number]"&&(!ge||!(typeof n=="object"&&ge in n))}function Fa(n){return De(n)==="[object Boolean]"&&(!ge||!(typeof n=="object"&&ge in n))}function cn(n){if(Xe)return n&&typeof n=="object"&&n instanceof Symbol;if(typeof n=="symbol")return!0;if(!n||typeof n!="object"||!rr)return!1;try{return rr.call(n),!0}catch{}return!1}function La(n){if(!n||typeof n!="object"||!er)return!1;try{return er.call(n),!0}catch{}return!1}Vr=function n(e,t,r,a){var i=t||{};if(Le(i,"quoteStyle")&&i.quoteStyle!=="single"&&i.quoteStyle!=="double")throw TypeError('option "quoteStyle" must be "single" or "double"');if(Le(i,"maxStringLength")&&(typeof i.maxStringLength=="number"?i.maxStringLength<0&&i.maxStringLength!==1/0:i.maxStringLength!==null))throw TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or \`null\`');var l=!Le(i,"customInspect")||i.customInspect;if(typeof l!="boolean"&&l!=="symbol")throw TypeError("option \\"customInspect\\", if provided, must be \`true\`, \`false\`, or \`'symbol'\`");if(Le(i,"indent")&&i.indent!==null&&i.indent!==" "&&!(parseInt(i.indent,10)===i.indent&&i.indent>0))throw TypeError('option "indent" must be "\\\\t", an integer > 0, or \`null\`');if(Le(i,"numericSeparator")&&typeof i.numericSeparator!="boolean")throw TypeError('option "numericSeparator", if provided, must be \`true\` or \`false\`');var s=i.numericSeparator;if(e===void 0)return"undefined";if(e===null)return"null";if(typeof e=="boolean")return e?"true":"false";if(typeof e=="string")return pn(e,i);if(typeof e=="number"){if(e===0)return 1/0/e>0?"0":"-0";var u=String(e);return s?nn(e,u):u}if(typeof e=="bigint"){var o=String(e)+"n";return s?nn(e,o):o}var p=i.depth===void 0?5:i.depth;if(r===void 0&&(r=0),r>=p&&p>0&&typeof e=="object")return ar(e)?"[Array]":"[Object]";var m=Ya(i,r);if(a===void 0)a=[];else if(un(a,e)>=0)return"[Circular]";function d(C,B,V){if(B&&(a=Ta.call(a)).push(B),V){var X={depth:i.depth};return Le(i,"quoteStyle")&&(X.quoteStyle=i.quoteStyle),n(C,X,r+1,a)}return n(C,i,r+1,a)}if(typeof e=="function"&&!ln(e)){var y=qa(e),f=At(e,d);return"[Function"+(y?": "+y:" (anonymous)")+"]"+(f.length>0?" { "+Oe.call(f,", ")+" }":"")}if(cn(e)){var S=Xe?Fe.call(String(e),/^(Symbol\\(.*\\))_[^)]*$/,"$1"):rr.call(e);return typeof e!="object"||Xe?S:ut(S)}if(za(e)){for(var v="<"+Xr.call(String(e.nodeName)),w=e.attributes||[],g=0;g<w.length;g++)v+=" "+w[g].name+"="+on(Pa(w[g].value),"double",i);return v+=">",e.childNodes&&e.childNodes.length&&(v+="..."),v+="</"+Xr.call(String(e.nodeName))+">"}if(ar(e)){if(e.length===0)return"[]";var _=At(e,d);return m&&!Ja(_)?"["+sr(_,m)+"]":"[ "+Oe.call(_,", ")+" ]"}if(Na(e)){var $=At(e,d);return"cause"in Error.prototype||!("cause"in e)||tn.call(e,"cause")?$.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+Oe.call($,", ")+" }":"{ ["+String(e)+"] "+Oe.call(Zr.call("[cause]: "+d(e.cause),$),", ")+" }"}if(typeof e=="object"&&l){if(sn&&typeof e[sn]=="function"&&nr)return nr(e,{depth:p-r});if(l!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if(Ba(e)){var x=[];return Jr&&Jr.call(e,function(C,B){x.push(d(B,e,!0)+" => "+d(C,e))}),dn("Map",Et.call(e),x,m)}if(Wa(e)){var T=[];return Yr&&Yr.call(e,function(C){T.push(d(C,e))}),dn("Set",kt.call(e),T,m)}if(Ua(e))return ir("WeakMap");if(Ha(e))return ir("WeakSet");if(Ga(e))return ir("WeakRef");if(Ra(e))return ut(d(Number(e)));if(La(e))return ut(d(er.call(e)));if(Fa(e))return ut(ka.call(e));if(Ma(e))return ut(d(String(e)));if(typeof window<"u"&&e===window)return"{ [object Window] }";if(e===oe)return"{ [object globalThis] }";if(!Ca(e)&&!ln(e)){var P=At(e,d),D=rn?rn(e)===Object.prototype:e instanceof Object||e.constructor===Object,R=e instanceof Object?"":"null prototype",I=!D&&ge&&Object(e)===e&&ge in e?Zt.call(De(e),8,-1):R?"Object":"",F=(D||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"")+(I||R?"["+Oe.call(Zr.call([],I||[],R||[]),": ")+"] ":"");return P.length===0?F+"{}":m?F+"{"+sr(P,m)+"}":F+"{ "+Oe.call(P,", ")+" }"}return String(e)};var Da=Object.prototype.hasOwnProperty||function(n){return n in this};function Le(n,e){return Da.call(n,e)}function De(n){return Aa.call(n)}function qa(n){if(n.name)return n.name;var e=Oa.call(Ia.call(n),/^function\\s*([\\w$]+)/);return e?e[1]:null}function un(n,e){if(n.indexOf)return n.indexOf(e);for(var t=0,r=n.length;t<r;t++)if(n[t]===e)return t;return-1}function Ba(n){if(!Et||!n||typeof n!="object")return!1;try{Et.call(n);try{kt.call(n)}catch{return!0}return n instanceof Map}catch{}return!1}function Ua(n){if(!lt||!n||typeof n!="object")return!1;try{lt.call(n,lt);try{ct.call(n,ct)}catch{return!0}return n instanceof WeakMap}catch{}return!1}function Ga(n){if(!Qr||!n||typeof n!="object")return!1;try{return Qr.call(n),!0}catch{}return!1}function Wa(n){if(!kt||!n||typeof n!="object")return!1;try{kt.call(n);try{Et.call(n)}catch{return!0}return n instanceof Set}catch{}return!1}function Ha(n){if(!ct||!n||typeof n!="object")return!1;try{ct.call(n,ct);try{lt.call(n,lt)}catch{return!0}return n instanceof WeakSet}catch{}return!1}function za(n){return!!n&&typeof n=="object"&&(typeof HTMLElement<"u"&&n instanceof HTMLElement||typeof n.nodeName=="string"&&typeof n.getAttribute=="function")}function pn(n,e){if(n.length>e.maxStringLength){var t=n.length-e.maxStringLength,r="... "+t+" more character"+(t>1?"s":"");return pn(Zt.call(n,0,e.maxStringLength),e)+r}return on(Fe.call(Fe.call(n,/(['\\\\])/g,"\\\\$1"),/[\\x00-\\x1f]/g,Va),"single",e)}function Va(n){var e=n.charCodeAt(0),t={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return t?"\\\\"+t:"\\\\x"+(e<16?"0":"")+ja.call(e.toString(16))}function ut(n){return"Object("+n+")"}function ir(n){return n+" { ? }"}function dn(n,e,t,r){return n+" ("+e+") {"+(r?sr(t,r):Oe.call(t,", "))+"}"}function Ja(n){for(var e=0;e<n.length;e++)if(un(n[e],\`
15427
- \`)>=0)return!1;return!0}function Ya(n,e){var t;if(n.indent===" ")t=" ";else{if(typeof n.indent!="number"||!(n.indent>0))return null;t=Oe.call(Array(n.indent+1)," ")}return{base:t,prev:Oe.call(Array(e+1),t)}}function sr(n,e){if(n.length===0)return"";var t=\`
15428
- \`+e.prev+e.base;return t+Oe.call(n,","+t)+\`
15429
- \`+e.prev}function At(n,e){var t,r=ar(n),a=[];if(r){a.length=n.length;for(var i=0;i<n.length;i++)a[i]=Le(n,i)?e(n[i],n):""}var l=typeof tr=="function"?tr(n):[];if(Xe){t={};for(var s=0;s<l.length;s++)t["$"+l[s]]=l[s]}for(var u in n)if(Le(n,u)&&(!r||String(Number(u))!==u||!(u<n.length))){if(Xe&&t["$"+u]instanceof Symbol)continue;Kr.call(/[^\\w$]/,u)?a.push(e(u,n)+": "+e(n[u],n)):a.push(u+": "+e(n[u],n))}if(typeof tr=="function")for(var o=0;o<l.length;o++)tn.call(n,l[o])&&a.push("["+e(l[o])+"]: "+e(n[l[o]],n));return a}var we=A("b9GfH"),It=be("%WeakMap%",!0),Ot=be("%Map%",!0),Qa=He("WeakMap.prototype.get",!0),Xa=He("WeakMap.prototype.set",!0),Ka=He("WeakMap.prototype.has",!0),Za=He("Map.prototype.get",!0),ei=He("Map.prototype.set",!0),ti=He("Map.prototype.has",!0),or=function(n,e){for(var t,r=n;(t=r.next)!==null;r=t)if(t.key===e)return r.next=t.next,t.next=n.next,n.next=t,t},ri=function(n,e){var t=or(n,e);return t&&t.value},ni=function(n,e,t){var r=or(n,e);r?r.value=t:n.next={key:e,next:n.next,value:t}},ai=function(n,e){return!!or(n,e)};zt=function(){var n,e,t,r={assert:function(a){if(!r.has(a))throw new we("Side channel does not contain "+Vr(a))},get:function(a){if(It&&a&&(typeof a=="object"||typeof a=="function")){if(n)return Qa(n,a)}else if(Ot){if(e)return Za(e,a)}else if(t)return ri(t,a)},has:function(a){if(It&&a&&(typeof a=="object"||typeof a=="function")){if(n)return Ka(n,a)}else if(Ot){if(e)return ti(e,a)}else if(t)return ai(t,a);return!1},set:function(a,i){It&&a&&(typeof a=="object"||typeof a=="function")?(n||(n=new It),Xa(n,a,i)):Ot?(e||(e=new Ot),ei(e,a,i)):(t||(t={key:{},next:null}),ni(t,a,i))}};return r};var Se={},qe={},ii=String.prototype.replace,si=/%20/g,lr={RFC1738:"RFC1738",RFC3986:"RFC3986"};qe={default:lr.RFC3986,formatters:{RFC1738:function(n){return ii.call(n,si,"+")},RFC3986:function(n){return String(n)}},RFC1738:lr.RFC1738,RFC3986:lr.RFC3986};var cr=Object.prototype.hasOwnProperty,ze=Array.isArray,je=function(){for(var n=[],e=0;e<256;++e)n.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return n}(),oi=function(n){for(;n.length>1;){var e=n.pop(),t=e.obj[e.prop];if(ze(t)){for(var r=[],a=0;a<t.length;++a)t[a]!==void 0&&r.push(t[a]);e.obj[e.prop]=r}}},fn=function(n,e){for(var t=e&&e.plainObjects?Object.create(null):{},r=0;r<n.length;++r)n[r]!==void 0&&(t[r]=n[r]);return t},li=function n(e,t,r){if(!t)return e;if(typeof t!="object"){if(ze(e))e.push(t);else{if(!e||typeof e!="object")return[e,t];(r&&(r.plainObjects||r.allowPrototypes)||!cr.call(Object.prototype,t))&&(e[t]=!0)}return e}if(!e||typeof e!="object")return[e].concat(t);var a=e;return ze(e)&&!ze(t)&&(a=fn(e,r)),ze(e)&&ze(t)?(t.forEach(function(i,l){if(cr.call(e,l)){var s=e[l];s&&typeof s=="object"&&i&&typeof i=="object"?e[l]=n(s,i,r):e.push(i)}else e[l]=i}),e):Object.keys(t).reduce(function(i,l){var s=t[l];return cr.call(i,l)?i[l]=n(i[l],s,r):i[l]=s,i},a)},ci=function(n,e){return Object.keys(e).reduce(function(t,r){return t[r]=e[r],t},n)},ui=function(n,e,t){var r=n.replace(/\\+/g," ");if(t==="iso-8859-1")return r.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(r)}catch{return r}},pi=function(n,e,t,r,a){if(n.length===0)return n;var i=n;if(typeof n=="symbol"?i=Symbol.prototype.toString.call(n):typeof n!="string"&&(i=String(n)),t==="iso-8859-1")return escape(i).replace(/%u[0-9a-f]{4}/gi,function(o){return"%26%23"+parseInt(o.slice(2),16)+"%3B"});for(var l="",s=0;s<i.length;++s){var u=i.charCodeAt(s);if(u===45||u===46||u===95||u===126||u>=48&&u<=57||u>=65&&u<=90||u>=97&&u<=122||a===qe.RFC1738&&(u===40||u===41)){l+=i.charAt(s);continue}if(u<128){l+=je[u];continue}if(u<2048){l+=je[192|u>>6]+je[128|63&u];continue}if(u<55296||u>=57344){l+=je[224|u>>12]+je[128|u>>6&63]+je[128|63&u];continue}s+=1,l+=je[240|(u=65536+((1023&u)<<10|1023&i.charCodeAt(s)))>>18]+je[128|u>>12&63]+je[128|u>>6&63]+je[128|63&u]}return l},di=function(n){for(var e=[{obj:{o:n},prop:"o"}],t=[],r=0;r<e.length;++r)for(var a=e[r],i=a.obj[a.prop],l=Object.keys(i),s=0;s<l.length;++s){var u=l[s],o=i[u];typeof o=="object"&&o!==null&&t.indexOf(o)===-1&&(e.push({obj:i,prop:u}),t.push(o))}return oi(e),n},fi=function(n){return Object.prototype.toString.call(n)==="[object RegExp]"},hi=function(n){return!!n&&typeof n=="object"&&!!(n.constructor&&n.constructor.isBuffer&&n.constructor.isBuffer(n))},mi=function(n,e){return[].concat(n,e)},gi=function(n,e){if(ze(n)){for(var t=[],r=0;r<n.length;r+=1)t.push(e(n[r]));return t}return e(n)};Se={arrayToObject:fn,assign:ci,combine:mi,compact:di,decode:ui,encode:pi,isBuffer:hi,isRegExp:fi,maybeMap:gi,merge:li};var yi=Object.prototype.hasOwnProperty,hn={brackets:function(n){return n+"[]"},comma:"comma",indices:function(n,e){return n+"["+e+"]"},repeat:function(n){return n}},Me=Array.isArray,_i=Array.prototype.push,mn=function(n,e){_i.apply(n,Me(e)?e:[e])},bi=Date.prototype.toISOString,gn=qe.default,ye={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:Se.encode,encodeValuesOnly:!1,format:gn,formatter:qe.formatters[gn],indices:!1,serializeDate:function(n){return bi.call(n)},skipNulls:!1,strictNullHandling:!1},vi=function(n){return typeof n=="string"||typeof n=="number"||typeof n=="boolean"||typeof n=="symbol"||typeof n=="bigint"},ur={},wi=function n(e,t,r,a,i,l,s,u,o,p,m,d,y,f,S,v){for(var w,g=e,_=v,$=0,x=!1;(_=_.get(ur))!==void 0&&!x;){var T=_.get(e);if($+=1,T!==void 0){if(T===$)throw RangeError("Cyclic object value");x=!0}_.get(ur)===void 0&&($=0)}if(typeof u=="function"?g=u(t,g):g instanceof Date?g=m(g):r==="comma"&&Me(g)&&(g=Se.maybeMap(g,function(X){return X instanceof Date?m(X):X})),g===null){if(i)return s&&!f?s(t,ye.encoder,S,"key",d):t;g=""}if(vi(g)||Se.isBuffer(g))return s?[y(f?t:s(t,ye.encoder,S,"key",d))+"="+y(s(g,ye.encoder,S,"value",d))]:[y(t)+"="+y(String(g))];var P=[];if(g===void 0)return P;if(r==="comma"&&Me(g))f&&s&&(g=Se.maybeMap(g,s)),w=[{value:g.length>0?g.join(",")||null:void 0}];else if(Me(u))w=u;else{var D=Object.keys(g);w=o?D.sort(o):D}for(var R=a&&Me(g)&&g.length===1?t+"[]":t,I=0;I<w.length;++I){var F=w[I],C=typeof F=="object"&&F.value!==void 0?F.value:g[F];if(!l||C!==null){var B=Me(g)?typeof r=="function"?r(R,F):R:R+(p?"."+F:"["+F+"]");v.set(e,$);var V=zt();V.set(ur,v),mn(P,n(C,B,r,a,i,l,r==="comma"&&f&&Me(g)?null:s,u,o,p,m,d,y,f,S,V))}}return P},$i=function(n){if(!n)return ye;if(n.encoder!==null&&n.encoder!==void 0&&typeof n.encoder!="function")throw TypeError("Encoder has to be a function.");var e=n.charset||ye.charset;if(n.charset!==void 0&&n.charset!=="utf-8"&&n.charset!=="iso-8859-1")throw TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var t=qe.default;if(n.format!==void 0){if(!yi.call(qe.formatters,n.format))throw TypeError("Unknown format option provided.");t=n.format}var r=qe.formatters[t],a=ye.filter;return(typeof n.filter=="function"||Me(n.filter))&&(a=n.filter),{addQueryPrefix:typeof n.addQueryPrefix=="boolean"?n.addQueryPrefix:ye.addQueryPrefix,allowDots:n.allowDots===void 0?ye.allowDots:!!n.allowDots,charset:e,charsetSentinel:typeof n.charsetSentinel=="boolean"?n.charsetSentinel:ye.charsetSentinel,delimiter:n.delimiter===void 0?ye.delimiter:n.delimiter,encode:typeof n.encode=="boolean"?n.encode:ye.encode,encoder:typeof n.encoder=="function"?n.encoder:ye.encoder,encodeValuesOnly:typeof n.encodeValuesOnly=="boolean"?n.encodeValuesOnly:ye.encodeValuesOnly,filter:a,format:t,formatter:r,serializeDate:typeof n.serializeDate=="function"?n.serializeDate:ye.serializeDate,skipNulls:typeof n.skipNulls=="boolean"?n.skipNulls:ye.skipNulls,sort:typeof n.sort=="function"?n.sort:null,strictNullHandling:typeof n.strictNullHandling=="boolean"?n.strictNullHandling:ye.strictNullHandling}};Br=function(n,e){var t,r,a=n,i=$i(e);typeof i.filter=="function"?a=i.filter("",a):Me(i.filter)&&(t=i.filter);var l=[];if(typeof a!="object"||a===null)return"";r=e&&e.arrayFormat in hn?e.arrayFormat:e&&"indices"in e?e.indices?"indices":"repeat":"indices";var s=hn[r];if(e&&"commaRoundTrip"in e&&typeof e.commaRoundTrip!="boolean")throw TypeError("\`commaRoundTrip\` must be a boolean, or absent");var u=s==="comma"&&e&&e.commaRoundTrip;t||(t=Object.keys(a)),i.sort&&t.sort(i.sort);for(var o=zt(),p=0;p<t.length;++p){var m=t[p];i.skipNulls&&a[m]===null||mn(l,wi(a[m],m,s,u,i.strictNullHandling,i.skipNulls,i.encode?i.encoder:null,i.filter,i.sort,i.allowDots,i.serializeDate,i.format,i.formatter,i.encodeValuesOnly,i.charset,o))}var d=l.join(i.delimiter),y=i.addQueryPrefix===!0?"?":"";return i.charsetSentinel&&(i.charset==="iso-8859-1"?y+="utf8=%26%2310003%3B&":y+="utf8=%E2%9C%93&"),d.length>0?y+d:""};var yn={},pr=Object.prototype.hasOwnProperty,Si=Array.isArray,de={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:Se.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},xi=function(n){return n.replace(/&#(\\d+);/g,function(e,t){return String.fromCharCode(parseInt(t,10))})},_n=function(n,e){return n&&typeof n=="string"&&e.comma&&n.indexOf(",")>-1?n.split(","):n},Ei="utf8=%26%2310003%3B",ki="utf8=%E2%9C%93",Ai=function(n,e){var t={__proto__:null},r=e.ignoreQueryPrefix?n.replace(/^\\?/,""):n,a=e.parameterLimit===1/0?void 0:e.parameterLimit,i=r.split(e.delimiter,a),l=-1,s=e.charset;if(e.charsetSentinel)for(u=0;u<i.length;++u)i[u].indexOf("utf8=")===0&&(i[u]===ki?s="utf-8":i[u]===Ei&&(s="iso-8859-1"),l=u,u=i.length);for(u=0;u<i.length;++u)if(u!==l){var u,o,p,m=i[u],d=m.indexOf("]="),y=d===-1?m.indexOf("="):d+1;y===-1?(o=e.decoder(m,de.decoder,s,"key"),p=e.strictNullHandling?null:""):(o=e.decoder(m.slice(0,y),de.decoder,s,"key"),p=Se.maybeMap(_n(m.slice(y+1),e),function(f){return e.decoder(f,de.decoder,s,"value")})),p&&e.interpretNumericEntities&&s==="iso-8859-1"&&(p=xi(p)),m.indexOf("[]=")>-1&&(p=Si(p)?[p]:p),pr.call(t,o)?t[o]=Se.combine(t[o],p):t[o]=p}return t},Ii=function(n,e,t,r){for(var a=r?e:_n(e,t),i=n.length-1;i>=0;--i){var l,s=n[i];if(s==="[]"&&t.parseArrays)l=[].concat(a);else{l=t.plainObjects?Object.create(null):{};var u=s.charAt(0)==="["&&s.charAt(s.length-1)==="]"?s.slice(1,-1):s,o=parseInt(u,10);t.parseArrays||u!==""?!isNaN(o)&&s!==u&&String(o)===u&&o>=0&&t.parseArrays&&o<=t.arrayLimit?(l=[])[o]=a:u!=="__proto__"&&(l[u]=a):l={0:a}}a=l}return a},Oi=function(n,e,t,r){if(n){var a=t.allowDots?n.replace(/\\.([^.[]+)/g,"[$1]"):n,i=/(\\[[^[\\]]*])/,l=/(\\[[^[\\]]*])/g,s=t.depth>0&&i.exec(a),u=s?a.slice(0,s.index):a,o=[];if(u){if(!t.plainObjects&&pr.call(Object.prototype,u)&&!t.allowPrototypes)return;o.push(u)}for(var p=0;t.depth>0&&(s=l.exec(a))!==null&&p<t.depth;){if(p+=1,!t.plainObjects&&pr.call(Object.prototype,s[1].slice(1,-1))&&!t.allowPrototypes)return;o.push(s[1])}return s&&o.push("["+a.slice(s.index)+"]"),Ii(o,e,t,r)}},ji=function(n){if(!n)return de;if(n.decoder!==null&&n.decoder!==void 0&&typeof n.decoder!="function")throw TypeError("Decoder has to be a function.");if(n.charset!==void 0&&n.charset!=="utf-8"&&n.charset!=="iso-8859-1")throw TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var e=n.charset===void 0?de.charset:n.charset;return{allowDots:n.allowDots===void 0?de.allowDots:!!n.allowDots,allowPrototypes:typeof n.allowPrototypes=="boolean"?n.allowPrototypes:de.allowPrototypes,allowSparse:typeof n.allowSparse=="boolean"?n.allowSparse:de.allowSparse,arrayLimit:typeof n.arrayLimit=="number"?n.arrayLimit:de.arrayLimit,charset:e,charsetSentinel:typeof n.charsetSentinel=="boolean"?n.charsetSentinel:de.charsetSentinel,comma:typeof n.comma=="boolean"?n.comma:de.comma,decoder:typeof n.decoder=="function"?n.decoder:de.decoder,delimiter:typeof n.delimiter=="string"||Se.isRegExp(n.delimiter)?n.delimiter:de.delimiter,depth:typeof n.depth=="number"||n.depth===!1?+n.depth:de.depth,ignoreQueryPrefix:n.ignoreQueryPrefix===!0,interpretNumericEntities:typeof n.interpretNumericEntities=="boolean"?n.interpretNumericEntities:de.interpretNumericEntities,parameterLimit:typeof n.parameterLimit=="number"?n.parameterLimit:de.parameterLimit,parseArrays:n.parseArrays!==!1,plainObjects:typeof n.plainObjects=="boolean"?n.plainObjects:de.plainObjects,strictNullHandling:typeof n.strictNullHandling=="boolean"?n.strictNullHandling:de.strictNullHandling}};yn=function(n,e){var t=ji(e);if(n===""||n==null)return t.plainObjects?Object.create(null):{};for(var r=typeof n=="string"?Ai(n,t):n,a=t.plainObjects?Object.create(null):{},i=Object.keys(r),l=0;l<i.length;++l){var s=i[l],u=Oi(s,r[s],t,typeof n=="string");a=Se.merge(a,u,t)}return t.allowSparse===!0?a:Se.compact(a)},St={formats:qe,parse:yn,stringify:Br};class Ti{constructor(e){this.root=e,this.requestPromises=[]}init(e){this.getToken=e}async get(e){let t=await this.getToken(),r=this.getHashCode(e);if(this.requestPromises[r])return this.requestPromises[r].promise;let a=new Promise((i,l)=>{let s;e.externalResource?s=e.url:(s=this.root+e.url,s=\`\${s}\${/\\?/.test(s)?"&":"?"}token=\${t}\${ya(e.params)}\`),G(ht).get(s,{validateStatus:function(u){return u<400}}).then(function(u){u.status!=200&&console.error(\`GUDHUB HTTP SERVICE: GET ERROR: \${u.status}\`,u),i(u.data)}).catch(function(u){console.error(\`GUDHUB HTTP SERVICE: GET ERROR: \${u.response.status}
15430
- \`,u),console.log("Request message: ",e),u.response&&u.response.data&&console.log("Error response data: ",u.response.data),l(u)})});return this.pushPromise(a,r),a}async post(e){let t=this.getHashCode(e);if(e.form.token=await this.getToken(),this.requestPromises[t])return this.requestPromises[t].promise;let r=new Promise((a,i)=>{G(ht).post(this.root+e.url,G(St).stringify(e.form),{maxBodyLength:1/0,headers:e.headers||{"Content-Type":"application/x-www-form-urlencoded"},validateStatus:function(l){return l<400}}).then(function(l){l.status!=200&&console.error(\`GUDHUB HTTP SERVICE: POST ERROR: \${l.status}\`,l),a(l.data)}).catch(function(l){console.error(\`GUDHUB HTTP SERVICE: POST ERROR: \${l.response.status}
15431
- \`,l),console.log("Request message: ",e),i(l)})});return this.pushPromise(r,t),r}axiosRequest(e){let t=this.getHashCode(e);if(this.requestPromises[t])return this.requestPromises[t].promise;let r=e.method?e.method.toLowerCase():"get",a=e.url,i=e.headers||{};e.form&&(i["Content-Type"]="application/x-www-form-urlencoded");let l=new Promise(async(s,u)=>{try{let{data:o}=await G(ht)[r](a,r==="post"?G(St).stringify(e.form)||e.body:{headers:i},r==="post"?{headers:i}:{});s(o)}catch(o){console.log("ERROR -> GUDHUB HTTP SERVICE -> SIMPLE POST :",o.message),console.log("Request message: ",e),u(o)}});return this.pushPromise(l,t),l}pushPromise(e,t){this.requestPromises[t]={promise:e,hesh:t,callback:e.then(()=>{this.destroyPromise(t)}).catch(r=>{this.destroyPromise(t)})}}destroyPromise(e){this.requestPromises=this.requestPromises.filter(t=>t.hesh!==e)}getHashCode(e){let t=0,r=G(St).stringify(e);if(r.length==0)return t;for(let a=0;a<r.length;a++)t=(t<<5)-t+r.charCodeAt(a),t&=t;return"h"+t}}function dr(n){let e="";for(let t in n)n.hasOwnProperty(t)&&n[t]&&(e+="."+n[t]);return e?e.substring(1):"any"}function Pi(n,e,t){return n==null||typeof n!="string"?(console.log(\`Listener type is "undefined" or not have actual 'type' for subscribe\`),!1):e==null||typeof e!="object"?(console.log(\`Listener destination is "undefined" or not have actual 'type' for subscribe\`),!1):typeof t=="function"||(console.log("Listener is not a function for subscribe!"),!1)}class Ci{constructor(){this.subscribers={},this.messageBox={}}on(e,t,r){return Pi(e,t,r)&&e.split(" ").map(a=>a+":"+dr(t)).forEach(a=>{this.subscribers[a]||(this.subscribers[a]=new Set),this.subscribers[a].add(r),this.checkMessageBox(a)}),this}emit(e,t,r,a){return e.split(" ").forEach(i=>{let l=i+":"+dr(t),s=!1;if(this.subscribers[l]){if(this.subscribers[l].size==0)return this.messageBox[l]=[e,t,r,a,s],this;this.subscribers[l].forEach(function(u){u(null,r,a)})}else this.messageBox[l]=[e,t,r,a,s]}),this}onRoot(e,t,r){return this.on(e,t,r)}destroy(e,t,r){return e.split(" ").forEach(a=>{let i=a+":"+dr(t);this.subscribers[i]&&r&&this.subscribers[i].delete(r),this.subscribers[i]&&!r&&delete this.subscribers[i]}),this}checkMessageBox(e){this.cleanMesssageBox(),this.messageBox[e]&&setTimeout(()=>{this.messageBox[e]&&(this.emit(...this.messageBox[e]),this.messageBox[e][4]=!0)},0)}cleanMesssageBox(){for(let e in this.messageBox)this.messageBox[e][4]&&delete this.messageBox[e]}}function Ni(n,e,t){return[{data_type:"text",name:"Text",icon:"text_icon",url:e+"/"+n+"text_data.js",type:"gh_element",technology:"angular"},{data_type:"text_opt",name:"Options",icon:"option_gh_element",url:e+"/"+n+"text_options_data.js",type:"gh_element",technology:"angular"},{data_type:"number",name:"Number",icon:"number",url:e+"/"+n+"number_data.js",type:"gh_element",technology:"angular"},{data_type:"task_board",name:"Task Board",icon:"task_board",url:e+"/"+n+"task_board_data.js",type:"gh_element",technology:"angular"},{data_type:"visualizer",name:"visualizer",icon:"visualizer",url:e+"/"+n+"visualizer_data.js",type:"gh_element",technology:"angular"},{data_type:"enterprice_visualizer",name:"Enterprice Visualizer",icon:"visualizer",private:!0,url:e+"/"+n+"enterprice_visualizer_data.js",type:"gh_element",technology:"angular"},{data_type:"email",name:"Email",icon:"email",url:e+"/"+n+"email_data.js",type:"gh_element",technology:"angular"},{data_type:"date",name:"Date",icon:"date_gh_element",url:e+"/"+n+"date_data.js",type:"gh_element",technology:"angular"},{data_type:"radio_button",name:"Radio Button",icon:"radio_button_gh_element",url:e+"/"+n+"radio_button_data.js",type:"gh_element",technology:"angular"},{data_type:"radio_icon",name:"Radio icon",icon:"radio_icon_gh_element",url:e+"/"+n+"radio_icon_data.js",type:"gh_element",technology:"angular"},{data_type:"twilio_phone",name:"Twilio Phone",icon:"phone_twilio_gh_element",url:e+"/"+n+"twilio_phone_data.js",type:"gh_element",technology:"angular"},{data_type:"twilio_autodialer",name:"Twilio Auto Dialer",icon:"twilio_dialer",url:e+"/"+n+"twillio_autodialer_data.js",type:"gh_element",technology:"angular"},{data_type:"color",name:"Color",icon:"paint_gh_element",url:e+"/"+n+"color_data.js",type:"gh_element",technology:"angular"},{data_type:"charts",name:"Charts",icon:"graph_gh_element",url:e+"/"+n+"charts_data.js",type:"gh_element",technology:"angular"},{data_type:"funnel_chart",name:"Funnel chart",icon:"funnel_chart_gh_element",url:e+"/"+n+"funnel_chart_data.js",type:"gh_element",technology:"angular"},{data_type:"add_items_from_template",name:"Add items from template",icon:"contact_second",url:e+"/"+n+"add_items_from_template_data.js",type:"gh_element",technology:"angular"},{data_type:"item_ref",name:"Reference",icon:"reference",url:e+"/"+n+"itemRef_data.js",type:"gh_element",technology:"angular"},{data_type:"calendar",name:"Calendar",icon:"calendar",js:"https://gudhub.com/modules/FullCalendar-Gh-Element/dist/main.js?t=4",css:"https://gudhub.com/modules/FullCalendar-Gh-Element/dist/style.css?t=1",type:"gh_element",technology:"class"},{data_type:"data_ref",name:"Data Reference",icon:"data_reference",url:e+"/"+n+"data_ref_data.js",type:"gh_element",technology:"angular"},{data_type:"table",name:"Table",icon:"table",url:e+"/"+n+"table_data.js",type:"gh_element",technology:"angular"},{data_type:"tile",name:"Tile table",icon:"tile_table",url:e+"/"+n+"tile_data.js",type:"gh_element",technology:"angular"},{data_type:"file",name:"File",icon:"box",url:e+"/"+n+"file_data.js",type:"gh_element",technology:"angular"},{data_type:"image",name:"Image",icon:"image",url:e+"/"+n+"image_data.js",type:"gh_element",technology:"angular"},{data_type:"text_editor",name:"Text Editor",icon:"square",url:e+"/"+n+"text_editor_data.js",type:"gh_element",technology:"angular"},{data_type:"tinymse",name:"Text editor MSE",icon:"tag",url:e+"/"+n+"tinymse_data.js",type:"gh_element",technology:"angular"},{data_type:"duration",name:"Duration",icon:"number_gh_element",url:e+"/"+n+"duration_data.js",type:"gh_element",technology:"angular"},{data_type:"user",name:"User",icon:"user_gh_element",url:e+"/"+n+"user_data.js",type:"gh_element",technology:"angular"},{data_type:"app",name:"App",icon:"app",url:e+"/"+n+"application_data.js",type:"gh_element",technology:"angular"},{data_type:"field",name:"Field",icon:"field_gh_element",url:e+"/"+n+"field_data.js",type:"gh_element",technology:"angular"},{data_type:"available",name:"Available",icon:"availible_gh_element",url:e+"/"+n+"available_data.js",type:"gh_element",technology:"angular"},{data_type:"view_list",name:"View List",icon:"view_list",url:e+"/"+n+"view_list_data.js",type:"gh_element",technology:"angular"},{data_type:"calculator",name:"Calculator",icon:"calculator",url:e+"/"+n+"calculator_data.js",type:"gh_element",technology:"angular"},{data_type:"string_join",name:"String Joiner",icon:"string_join_gh_element",url:e+"/"+n+"string_joiner_data.js",type:"gh_element",technology:"angular"},{data_type:"signature",name:"Signature",icon:"signature",url:e+"/"+n+"signature_data.js",type:"gh_element",technology:"angular"},{data_type:"sendEmail",name:"Send Email",icon:"send_email_gh_element",url:e+"/"+n+"send_email_data.js",type:"gh_element",technology:"angular"},{data_type:"boolean",name:"Yes/No",icon:"boolen_gh_element",url:e+"/"+n+"boolean_data.js",type:"gh_element",technology:"angular"},{data_type:"product_gallery",name:"Product gallery",icon:"product_gallery",url:e+"/"+n+"product_gallery_data.js",type:"gh_element",technology:"angular"},{data_type:"online_inventory",name:"Online inventory",icon:"slab",url:e+"/"+n+"online_inventory_data.js",type:"gh_element",technology:"angular"},{data_type:"3d_edges",name:"3D Edges",icon:"3d_edges_gh_element",url:e+"/"+n+"3d_edges_data.js",type:"gh_element",technology:"angular"},{data_type:"color_list",name:"Color list",icon:"circular_gh_element",url:e+"/"+n+"color_list_data.js",type:"gh_element",technology:"angular"},{data_type:"go_to_link",name:"Go to Link",icon:"go_to_link",url:e+"/"+n+"go_to_link_data.js",type:"gh_element",technology:"angular"},{data_type:"go_to_view",name:"Go to View",icon:"go_to_view",url:e+"/"+n+"go_to_view_data.js",type:"gh_element",technology:"angular"},{data_type:"range",name:"Range",icon:"range_gh_element",url:e+"/"+n+"range_data.js",type:"gh_element",technology:"angular"},{data_type:"barcode",name:"Barcode",icon:"barcode_gh_element",url:e+"/"+n+"barcode_data.js",type:"gh_element",technology:"angular"},{data_type:"item_remote_add",name:"Item remote add",icon:"remote_add_gh_element",url:e+"/"+n+"item_remote_add_data.js",type:"gh_element",technology:"angular"},{data_type:"item_remote_update",name:"Item remote update",icon:"remote_update_gh_element",url:e+"/"+n+"item_remote_update_data.js",type:"gh_element",technology:"angular"},{data_type:"timeline",name:"Timeline",icon:"timeline",url:e+"/"+n+"timeline_data.js",type:"gh_element",technology:"angular"},{data_type:"delete_item",name:"Delete Item",icon:"rubbish",url:e+"/"+n+"delete_action.js",type:"gh_element",technology:"angular"},{data_type:"print_doc",name:"Print document",icon:"print",url:e+"/"+n+"print_doc_action.js",type:"gh_element",technology:"angular"},{data_type:"open_item",name:"Open Item",icon:"delete",private:!0,url:e+"/"+n+"open_item_action.js",type:"gh_element",technology:"angular"},{data_type:"edit_template",name:"Edit template",icon:"delete",private:!0,url:e+"/"+n+"edit_template_action.js",type:"gh_element",technology:"angular"},{data_type:"open_app",private:!0,name:"Open App",icon:"delete",url:e+"/"+n+"open_app_action.js",type:"gh_element",technology:"angular"},{data_type:"user_settings",private:!0,name:"User Settings",icon:"delete",url:e+"/"+n+"user_settings_action.js",type:"gh_element",technology:"angular"},{data_type:"app_sharing",name:"Sharing",icon:"sharing",url:e+"/"+n+"sharing_action.js",type:"gh_element",technology:"angular"},{data_type:"app_constructor",private:!0,name:"App constructor",icon:"app_constructor",url:e+"/"+n+"app_constructor_action.js",type:"gh_element",technology:"angular"},{data_type:"app_settings",name:"App Settings",icon:"configuration",url:e+"/"+n+"app_settings_action.js",type:"gh_element",technology:"angular"},{data_type:"export_csv",name:"Export CSV",icon:"export_csv",url:e+"/"+n+"export_csv.js",type:"gh_element",technology:"angular"},{data_type:"import_csv",name:"Import CSV",icon:"import_csv",url:e+"/"+n+"import_csv.js",type:"gh_element",technology:"angular"},{data_type:"add_items",name:"Add Items",icon:"plus",url:e+"/"+n+"add_items_action.js",type:"gh_element",technology:"angular"},{data_type:"update_items",name:"Update Items",icon:"update",url:e+"/"+n+"update_items_action.js",type:"gh_element",technology:"angular"},{data_type:"install_app",name:"Install",icon:"install",url:e+"/"+n+"install_app_action.js",type:"gh_element",technology:"angular"},{data_type:"search_action",name:"Search",icon:"search",url:e+"/"+n+"search_action.js",type:"gh_element",technology:"angular"},{data_type:"filter_table",name:"Table filter",icon:"filter",url:e+"/"+n+"filter_table_action.js",type:"gh_element",technology:"angular"},{data_type:"slider",name:"Slider",icon:"slider",url:e+"/"+n+"slider_data.js",type:"gh_element",technology:"angular"},{data_type:"clone_item",name:"Clone Item",icon:"double_plus",url:e+"/"+n+"clone_item_action.js",type:"gh_element",technology:"angular"},{data_type:"close",name:"Close",icon:"cross",url:e+"/"+n+"close_action.js",type:"gh_element",technology:"angular"},{data_type:"phone",name:"Phone",icon:"phone_thin",url:e+"/"+n+"phone_data.js",type:"gh_element",technology:"angular"},{data_type:"link",name:"Link",icon:"link_gh_element",url:e+"/"+n+"link_data.js",type:"gh_element",technology:"angular"},{data_type:"sheduling",name:"Sheduling",icon:"scheduling",url:e+"/"+n+"sheduling_data.js",type:"gh_element",technology:"angular"},{data_type:"qrcode",name:"QR Code",icon:"qr_code",url:e+"/"+n+"qrcode_data.js",type:"gh_element",technology:"angular"},{data_type:"graph2d",name:"Graph",icon:"graph",url:e+"/"+n+"graph2d_data.js",type:"gh_element",technology:"angular"},{data_type:"quote_tool",name:"Quote tool",icon:"quoters",url:e+"/"+n+"quote_tool_data.js",type:"gh_element",technology:"angular"},{data_type:"cards",name:"Cards",icon:"cards",url:e+"/"+n+"cards_data.js",type:"gh_element",technology:"angular"},{data_type:"jsonConstructor",name:"Json Constructor",icon:"button",url:e+"/"+n+"json_constructor_data.js",type:"gh_element",technology:"angular"},{data_type:"button",name:"Button",icon:"button",js:"https://gudhub.com/modules/button_action/button_action.js?t=1",type:"gh_element",technology:"class"},{data_type:"editorjs",name:"EditorJS",icon:"code_editor",js:"https://gudhub.com/modules/Editor-Js/dist/main.js?t=2",css:"https://gudhub.com/modules/Editor-Js/dist/style.css?t=2",type:"gh_element",technology:"class"},{data_type:"filter_advanced",name:"Filter Advanced",icon:"filter_advanced",url:e+"/"+n+"filter_advanced_data.js",type:"gh_element",technology:"angular"},{data_type:"code_editor",name:"Code Editor",icon:"code_editor",url:e+"/"+n+"code_editor_data.js",type:"gh_element",technology:"angular"},{data_type:"icon",name:"Icon",icon:"icon_gh_element",url:e+"/"+n+"icon_data.js",type:"gh_element",technology:"angular"},{data_type:"quoteRequest",name:"Quote Request",icon:"invoices",url:e+"/"+n+"quote_request_data.js",type:"gh_element",technology:"angular"},{data_type:"view_container",name:"View Container",icon:"pencil",url:e+"/"+n+"view_container_data.js",type:"gh_element",technology:"angular"},{data_type:"element_ref",name:"Element Reference",icon:"cloudSync_gh_element",url:e+"/"+n+"element_ref_data.js",type:"gh_element",technology:"angular"},{data_type:"quote_tool_objects_renderer",name:"Quote Tool Renderer",icon:"l_counter",url:e+"/"+n+"quote_tool_objects_renderer_data.js",type:"gh_element",technology:"angular"},{data_type:"quote_tool_objects_renderer_generator",name:"Quote Tool Parts Generator",icon:"l_counter_arrow",url:e+"/"+n+"quote_tool_objects_renderer_generator_data.js",type:"gh_element",technology:"angular"},{data_type:"trigger",name:"Trigger",icon:"job",url:e+"/"+n+"trigger_data.js",type:"gh_element",technology:"angular"},{data_type:"voting",name:"Voting",icon:"like_gh_element",url:e+"/"+n+"voting_data.js",type:"gh_element",technology:"angular"},{data_type:"view_tabs",name:"View Tab",icon:"tabs",url:e+"/"+n+"view_tabs.js",type:"gh_element",technology:"angular"},{data_type:"filter_tabs",name:"Filter Tabs",icon:"filter_tabs_gh_element",url:e+"/"+n+"filter_tabs.js",type:"gh_element",technology:"angular"},{data_type:"gps_coords",name:"GPS Coords",icon:"location_gh_element",url:e+"/"+n+"gps_coords.js",type:"gh_element",technology:"angular"},{data_type:"google_map",name:"Google Map",icon:"location",url:e+"/"+n+"google_map_data.js",type:"gh_element",technology:"angular"},{data_type:"data_migrations",name:"Data migrations",icon:"view_list_gh_element",url:e+"/"+n+"data_migrations.js",type:"gh_element",technology:"angular"},{data_type:"additional_settings",name:"Additional Settings",icon:"",private:!0,url:e+"/"+n+"gh_additional_settings_data.js",type:"gh_element",technology:"angular"},{data_type:"send_request",name:"Send Request",icon:"send_request_gh_element",url:e+"/"+n+"send_request_data.js",type:"gh_element",technology:"angular"},{data_type:"webcam",name:"Web camera",icon:"webcam_gh_element",url:e+"/"+n+"webcam_data.js",type:"gh_element",technology:"angular"},{data_type:"json_viewer",name:"JSON viewer",icon:"json_gh_element",url:e+"/"+n+"json_viewer_data.js",type:"gh_element",technology:"angular"},{data_type:"notifications",name:"Notifications",icon:"full_gh_element",url:e+"/"+n+"notifications_data.js",type:"gh_element",technology:"angular"},{data_type:"api",name:"API",icon:"job",url:e+"/"+n+"api_data.js",type:"gh_element",technology:"angular"},{data_type:"smart_input",name:"Smart Input",icon:"roket",url:e+"/"+n+"smart_input_data.js",type:"gh_element",technology:"angular"},{data_type:"json_editor",name:"JSON Editor",icon:"code",url:e+"/"+n+"json_editor_data.js",type:"gh_element",technology:"angular"},{data_type:"grapes_html_editor",name:"Grapes Html Editor",icon:"code_editor",url:e+"/"+n+"grapes_html_editor_data.js",type:"gh_element",technology:"angular"},{data_type:"quiz",name:"Quiz",icon:"quiz_gh_element",url:e+"/"+n+"quiz_data.js",type:"gh_element",technology:"angular"},{data_type:"password_input",name:"Password",icon:"lock_gh_element",url:e+"/"+n+"password_input_data.js",type:"gh_element",technology:"angular"},{data_type:"vs_code",name:"VS Code",icon:"code_editor",url:e+"/"+n+"vs_code_data.js",type:"gh_element",technology:"angular"},{data_type:"nested_list",name:"Nested List",icon:"scheduling",js:"https://gudhub.com/modules/Nested-List/dist/main.js?t=2",css:"https://gudhub.com/modules/Nested-List/dist/style.css?t=2",type:"gh_element",technology:"class"},{data_type:"countertop_smart_quote",name:"Countertop Smart Quote",icon:"quoters",url:e+"/"+n+"countertop_smart_quote_data.js",type:"gh_element",technology:"angular"},{data_type:"markdown_viewer",name:"Markdown viewer",icon:"code_editor",js:"https://gudhub.com/modules/markdown-it-gh-element/dist/main.js?t=1",css:"https://gudhub.com/modules/markdown-it-gh-element/dist/style.css?t=1",type:"gh_element",technology:"class"},{data_type:"html_viewer",name:"HTML Viewer",icon:"code_editor",js:"https://gudhub.com/modules/HTML-Viewer/dist/main.js?t=1",css:"https://gudhub.com/modules/HTML-Viewer/dist/style.css?t=1",type:"gh_element",technology:"class"},{data_type:"element_customizer",name:"Element Customizer",icon:"pencil",url:e+"/"+n+"element_customizer_data.js",type:"gh_element",technology:"angular"},{data_type:"task",name:"Task",icon:"table",url:e+"/"+n+"task_data.js",type:"gh_element",technology:"angular"},{data_type:"cron_picker",name:"Cron Picker",icon:"table",js:"https://gudhub.com/modules/Cron-Picker/dist/main.js?t=2",css:"https://gudhub.com/modules/Cron-Picker/dist/style.css?t=2",type:"gh_element",technology:"class"},{data_type:"balance_sheet",name:"Balance Sheet",icon:"table",js:"https://gudhub.com/modules/balance-sheet/dist/main.js?t=2",css:"https://gudhub.com/modules/balance-sheet/dist/style.css?t=2",type:"gh_element",technology:"class"},{data_type:"quote_form",name:"Quote Form",icon:"table",js:"https://gudhub.com/modules/countertop-quote-form/dist/main.js",css:"https://gudhub.com/modules/countertop-quote-form/dist/style.css",type:"gh_element",technology:"class"},{data_type:"static_nested_list",name:"Nested Filter",icon:"scheduling",js:"https://gudhub.com/modules/nested-filter/dist/main.js?t=1",css:"https://gudhub.com/modules/nested-filter/dist/style.css?t=1",type:"gh_element",technology:"class"},{data_type:"conversations",name:"Conversations",icon:"timeline",js:"https://gudhub.com/modules/conversation/dist/main.js?t=1",css:"https://gudhub.com/modules/conversation/dist/style.css?t=1",type:"gh_element",technology:"class"},{data_type:"study_journal",name:"Study Journal",icon:"timeline",js:"https://gudhub.com/modules/Study-Journal/dist/main.js?t=1",css:"https://gudhub.com/modules/Study-Journal/dist/style.css",type:"gh_element",technology:"class"},{data_type:"study_schedule",name:"Study Schedule",icon:"timeline",js:"https://gudhub.com/modules/Study-Schedule/dist/main.js?t=1",css:"https://gudhub.com/modules/Study-Schedule/dist/style.css?t=1",type:"gh_element",technology:"class"},{data_type:"avatar",name:"Avatar",icon:"user",js:"https://gudhub.com/modules/Gh-Avatar/dist/main.js?t=1",css:"https://gudhub.com/modules/Gh-Avatar/dist/style.css?t=1",type:"gh_element",technology:"class"},{data_type:"text_area",name:"Text Area",icon:"text_icon",js:"https://gudhub.com/modules/text-area-ghe/dist/main.js?t=3",css:"https://gudhub.com/modules/text-area-ghe/dist/style.css",type:"gh_element",technology:"class"},{data_type:"resource_calendar",name:"Resource Сalendar",icon:"calendar",url:e+"/"+n+"resource_calendar_data.js",type:"gh_element",technology:"angular"},{data_type:"visualizer_with_control_panel",name:"Visualizer With Control Panel",icon:"visualizer",url:e+"/"+n+"visualizer_with_control_panel_data.js",type:"gh_element",technology:"angular"},{data_type:"API",name:"API",url:e+"/"+t+"api_node.js",type:"automation",icon:"automation_api",private:!0},{data_type:"Calculator",name:"Calculator",url:e+"/"+t+"calculator.js",type:"automation",icon:"automation_calculator"},{data_type:"CompareItems",name:"Compare Items",url:e+"/"+t+"compare_items.js",type:"automation",icon:"automation_compare_items"},{data_type:"Constants",name:"Constants",url:e+"/"+t+"constants.js",type:"automation",icon:"automation_constants"},{data_type:"CreateFiles",name:"Create Files",url:e+"/"+t+"create_files.js",type:"automation",icon:"automation_create_files"},{data_type:"CreateItemsApi",name:"Create Items Api",url:e+"/"+t+"create_item_api.js",type:"automation",icon:"automation_create_items_api"},{data_type:"FileDuplicate",name:"File Duplicate",url:e+"/"+t+"file_duplicate.js",type:"automation",icon:"automation_file_duplicate"},{data_type:"Filter",name:"Filter",url:e+"/"+t+"filter_node.js",type:"automation",icon:"filter"},{data_type:"GetItemByItemRef",name:"Get Item By Item Ref",url:e+"/"+t+"get_item_by_item_ref.js",type:"automation",icon:"automation_get_item_by_item_ref"},{data_type:"GetItems",name:"Get Items",url:e+"/"+t+"get_items.js",type:"automation",icon:"automation_get_items"},{data_type:"GhElementNode",name:"Gh Element Node",url:e+"/"+t+"gh_element_node.js",type:"automation",icon:"automation_gh_element_node",private:!0,created_for:["GhElement"]},{data_type:"IfCondition",name:"If Condition",url:e+"/"+t+"if_condition.js",type:"automation",icon:"automation_if_condition"},{data_type:"ItemConstructor",name:"Item Constructor",url:e+"/"+t+"item_constructor.js",type:"automation",icon:"automation_item_constructor"},{data_type:"ItemDestructor",name:"Item Destructor",url:e+"/"+t+"item_destructor.js",type:"automation",icon:"automation_item_destructor"},{data_type:"JSONScheme",name:"JSON Scheme",url:e+"/"+t+"json_scheme.js",type:"automation",icon:"automation_json_scheme"},{data_type:"MergeItems",name:"Merge Items",url:e+"/"+t+"merge_items.js",type:"automation",icon:"automation_merge_items"},{data_type:"MessageConstructor",name:"Message Constructor",url:e+"/"+t+"message_constructor.js",type:"automation",icon:"automation_message_constructor"},{data_type:"ObjectToItem",name:"Object To Item",url:e+"/"+t+"obj_to_item.js",type:"automation",icon:"automation_object_to_item"},{data_type:"ObjectConstructor",name:"Object Constructor",url:e+"/"+t+"object_constructor.js",type:"automation",icon:"automation_object_constructor"},{data_type:"ObjectDestructor",name:"Object Destructor",url:e+"/"+t+"object_destructor.js",type:"automation",icon:"automation_object_destructor"},{data_type:"PopulateElement",name:"Populate Element",url:e+"/"+t+"populate_element.js",type:"automation",icon:"automation_populate_element",private:!0,created_for:["GhElement"]},{data_type:"PopulateItems",name:"Populate Items",url:e+"/"+t+"populate_items.js",type:"automation",icon:"automation_populate_items"},{data_type:"PopulateWithDate",name:"Populate With Date",url:e+"/"+t+"populate_with_date.js",type:"automation",icon:"automation_populate_with_date"},{data_type:"PopulateWithItemRef",name:"Populate with Item Ref",url:e+"/"+t+"populate_with_item_ref.js",type:"automation",icon:"automation_populate_with_item_ref"},{data_type:"PopUpForm",name:"Pop Up Form",url:e+"/"+t+"popup_form.js",type:"automation",icon:"automation_pop_up_form",private:!0,created_for:["Quiz","GhElement","SmartInput","Iterator"]},{data_type:"QuizForm",name:"Quiz Form",url:e+"/"+t+"quiz_form.js",type:"automation",icon:"automation_quiz_form",private:!0,created_for:["Quiz"]},{data_type:"QuizNode",name:"Quiz Node",url:e+"/"+t+"quiz_node.js",type:"automation",icon:"automation_quiz_node",private:!0},{data_type:"Request",name:"Request",url:e+"/"+t+"request_node.js",type:"automation",icon:"automation_request"},{data_type:"Response",name:"Response",url:e+"/"+t+"response_node.js",type:"automation",icon:"automation_response",private:!0,created_for:["API"]},{data_type:"SmartInput",name:"Smart Input",url:e+"/"+t+"smart_input.js",type:"automation",icon:"automation_smart_input",private:!0},{data_type:"Trigger",name:"Trigger",url:e+"/"+t+"trigger_node.js",type:"automation",icon:"automation_trigger",private:!0},{data_type:"TwilioSMS",name:"Twilio SMS",url:e+"/"+t+"twilio_sms.js",type:"automation",icon:"automation_twilio"},{data_type:"TwilioAuth",name:"Twilio Auth",url:e+"/"+t+"twilio_auth.js",type:"automation",icon:"table"},{data_type:"TwilioDevice",name:"Twilio Device",url:e+"/"+t+"twilio_device.js",type:"automation",icon:"table"},{data_type:"UpdateItemsApi",name:"Update Items Api",url:e+"/"+t+"update_items_api.js",type:"automation",icon:"automation_update_items_api"},{data_type:"GoogleCalendar",name:"Google Calendar",url:e+"/"+t+"google_calendar.js",type:"automation",icon:"calendar"},{data_type:"VerifyEmail",name:"Verify email",url:e+"/"+t+"verify_email.js",type:"automation",icon:"check_in_circle"},{data_type:"Iterator",name:"Iterator",url:e+"/"+t+"iterator.js",type:"automation",icon:"update"},{data_type:"IteratorInput",name:"Iterator Input",url:e+"/"+t+"iterator_input.js",type:"automation",icon:"arrow_right",private:!0},{data_type:"IteratorOutput",name:"Iterator Output",url:e+"/"+t+"iterator_output.js",type:"automation",icon:"arrow_right",private:!0},{data_type:"SendEmail",name:"Send email",url:e+"/"+t+"send_email.js",type:"automation",icon:"email"},{data_type:"FileReader",name:"File Reader",url:e+"/"+t+"file_reader.js",type:"automation",icon:"file"},{data_type:"WebsitesChecker",name:"Websites Checker",url:e+"/"+t+"websites_checker.js",type:"automation",icon:"world"},{data_type:"VoiceMachineDetection",name:"Voice Machine Detection",url:e+"/"+t+"voice_machine_detection.js",type:"automation",icon:"automation_calculator"},{data_type:"Task",name:"Task",url:e+"/"+t+"task.js",type:"automation",icon:"automation_calculator",private:!0},{data_type:"DeleteItems",name:"Delete Items",url:e+"/"+t+"delete_items.js",type:"automation",icon:"rubbish"},{data_type:"GoToItem",name:"Go To Item",url:e+"/"+t+"go_to_item.js",type:"automation",icon:"cursor_point"},{data_type:"FireWorks",name:"Fire Works",url:e+"/"+t+"fireworks_node.js",type:"automation",icon:"weeding_party"},{data_type:"SendMessage",name:"Send Message",url:e+"/"+t+"send_message.js",type:"automation",icon:"speech_bubble"},{data_type:"TurboSMS",name:"Turbo SMS",url:e+"/"+t+"turbo_sms.js",type:"automation",icon:"email"},{data_type:"JsCode",name:"Js Code",url:e+"/"+t+"js_code.js",type:"automation",icon:"code_editor"}]}class Mi{constructor(e,t,r){this.apps_list=[],this.users_list=[],this.user={},this.modulesList=Ni(e,t,r),this.ghComponentsPromises=[]}getMainStorage(){return this}getAppsList(){return this.apps_list}getUser(){return this.user}getUsersList(){return this.users_list}getModulesList(e,t,r){return e===void 0?this.modulesList:t==!1?this.modulesList.filter(a=>a.created_for?a.type===e&&a.private&&a.created_for.includes(r):a.type===e&&!a.private):this.modulesList.filter(a=>a.type===e)}getModuleUrl(e){return this.modulesList.find(t=>t.data_type==e)}setUser(e){this.user=e,this.users_list.push(e)}updateUser(e={}){e.avatar_128&&(e.avatar_128=e.avatar_128+"?"+new Date().getTime()),e.avatar_512&&(e.avatar_512=e.avatar_512+"?"+new Date().getTime()),this.user={...this.user,...e},this.users_list=this.users_list.filter(t=>t.user_id!=e.user_id),this.users_list.push(this.user)}unsetUser(){this.user={}}getApp(e){for(let t=0;t<this.apps_list.length;t++)if(this.apps_list[t].app_id==e)return this.apps_list[t]}unsetApps(){this.apps_list=[]}updateApp(e){return this.apps_list=this.apps_list.map(t=>t.app_id==e.app_id?e:t),this.apps_list}deleteApp(e){return this.apps_list=this.apps_list.filter(t=>t.app_id!=e),this.apps_list}async updateItemsInApp(e,t){let r=await this.getApp(t);return r&&(r.items_list=updateItems(e,r.items_list,this.pipeService.emit.bind(this.pipeService),t),this.updateApp(r)),r}async addItemsToApp(e,t){let r=await this.getApp(t);return r&&(r.items_list.push(...e),this.updateApp(r),this.pipeService.emit("gh_items_update",{app_id:t},e)),r}async deleteItemsInApp(e,t){let r=await this.getApp(t);return r&&(r.items_list=r.items_list.filter(a=>!e.find(i=>i.item_id==a.item_id)),this.updateApp(r)),r}}var bn={};bn=function(){throw Error("ws does not work in the browser. Browser clients must use the native WebSocket object")};var Ee=A("5xozB");class Ri{constructor(e,t){this.websocket=null,this.connected=!1,this.queue=[],this.url=e,this.auth=t,this.heartBeatTimeStemp=1e13,this.ALLOWED_HEART_BEAT_DELEY=12e3,this.firstHeartBeat=!0,this.reload=!0,this.isBrowser=Ee.IS_BROWSER}async addSubscription(e){let t=await this.auth.getToken(),r=\`token=\${t}/~/app_id=\${e}\`;this.connected&&this.websocket.send(r),this.queue.push(e)}async onOpen(){this.reload=!0,console.log("websocket opened"),this.connected=!0;let e=await this.auth.getToken();this.queue.forEach(t=>{let r=\`token=\${e}/~/app_id=\${t}\`;this.websocket.send(r)})}onError(e){console.log("websocket error: ",e),this.websocket.close()}onClose(){console.log("websocket close"),this.connected=!1;try{this.initWebSocket(this.onMassageHandler,this.refreshAppsHandler)}catch(e){console.log(e)}}async onMessage(e){let t=this.isBrowser?e.data:e;if(t.match(/HeartBeat/)){let r=new Date().getTime()-this.heartBeatTimeStemp;this.ALLOWED_HEART_BEAT_DELEY<r?await this.onConnectionLost():(this.websocket.send("HeartBeat"),this.heartBeatTimeStemp=new Date().getTime())}if(this.firstHeartBeat&&(this.connectionChecker(),this.firstHeartBeat=!1),t.match(/[{}]/)){let r=JSON.parse(t),a=await this.auth.getToken();r.token!=a&&this.onMassageHandler(r)}}initWebSocket(e,t){this.onMassageHandler=e,this.refreshAppsHandler=t,this.isBrowser?(this.websocket=new WebSocket(this.url),this.websocket.onopen=this.onOpen.bind(this),this.websocket.onerror=this.onError.bind(this),this.websocket.onclose=this.onClose.bind(this),this.websocket.onmessage=this.onMessage.bind(this)):(this.websocket=new(G(bn))(this.url),this.websocket.on("open",this.onOpen),this.websocket.on("error",this.onError),this.websocket.on("close",this.onClose),this.websocket.on("message",this.onMessage)),console.log("websocket initialized")}connectionChecker(){setInterval(async()=>{let e=new Date().getTime()-this.heartBeatTimeStemp;this.ALLOWED_HEART_BEAT_DELEY<e&&await this.onConnectionLost()},1e3)}async onConnectionLost(){try{await this.auth.getVersion(),this.reload&&(this.reload=!1,console.log("Connected"),this.heartBeatTimeStemp=1e13,this.websocket.close())}catch(e){console.log(e)}}}async function Fi(n,e,t,r={}){let a=[],i={variableMethodcurrent_app:()=>[r.current_app_id||r.app_id],variableMethodelement_app:()=>[r.element_app_id],variableMethodcurrent_item:()=>[\`\${r.current_app_id||r.app_id}.\${r.item_id}\`],variableMethoduser_id:()=>[e.getUser().user_id],variableMethoduser_email:s=>[e.getUser().username],variableMethodtoday(s){let u=new Date,o=new Date(u.getFullYear(),u.getMonth(),u.getDate()),p=new Date(u.getFullYear(),u.getMonth(),u.getDate()+1);return[o.valueOf().toString()+":"+p.valueOf().toString()]},variableMethodvariable:s=>[r[s]]};if(n)for(let s of n)if(s)switch(s.input_type){case"variable":for(let o of(s.valuesArray=[],s==null?void 0:s.input_value.split(","))){let p=i[s.input_type+"Method"+o];typeof p=="function"?s.valuesArray?s.valuesArray.push(...p()):s.valuesArray=p():s.valuesArray?s.valuesArray.push(...i.variableMethodvariable(o)):s.valuesArray=i.variableMethodvariable(o)}a.push(s);break;case"field":let u=await l({app_id:r.current_app_id||r.app_id,item_id:r.item_id,field_id:s.input_value});u!=null&&s.valuesArray.push(u),a.push(s);break;default:a.push(s)}else a.push(s);function l(s){return new Promise(u=>{t.on("gh_value_get",s,function o(p,m){t.destroy("gh_value_get",s,o),u(m)}).emit("gh_value_get",{},s)})}return a}function Re(n){return Array.isArray?Array.isArray(n):$n(n)==="[object Array]"}function Li(n){if(typeof n=="string")return n;let e=n+"";return e=="0"&&1/n==-1/0?"-0":e}function Di(n){return n==null?"":Li(n)}function Te(n){return typeof n=="string"}function vn(n){return typeof n=="number"}function qi(n){return n===!0||n===!1||Bi(n)&&$n(n)=="[object Boolean]"}function wn(n){return typeof n=="object"}function Bi(n){return wn(n)&&n!==null}function $e(n){return n!=null}function fr(n){return!n.trim().length}function $n(n){return n==null?n===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(n)}let Ui="Incorrect 'index' type",Gi=n=>\`Invalid value for key \${n}\`,Wi=n=>\`Pattern length exceeds max of \${n}.\`,Hi=n=>\`Missing \${n} property in key\`,zi=n=>\`Property 'weight' in key '\${n}' must be a positive integer\`,Sn=Object.prototype.hasOwnProperty;class Vi{constructor(e){this._keys=[],this._keyMap={};let t=0;e.forEach(r=>{let a=xn(r);t+=a.weight,this._keys.push(a),this._keyMap[a.id]=a,t+=a.weight}),this._keys.forEach(r=>{r.weight/=t})}get(e){return this._keyMap[e]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function xn(n){let e=null,t=null,r=null,a=1,i=null;if(Te(n)||Re(n))r=n,e=En(n),t=hr(n);else{if(!Sn.call(n,"name"))throw Error(Hi("name"));let l=n.name;if(r=l,Sn.call(n,"weight")&&(a=n.weight)<=0)throw Error(zi(l));e=En(l),t=hr(l),i=n.getFn}return{path:e,id:t,weight:a,src:r,getFn:i}}function En(n){return Re(n)?n:n.split(".")}function hr(n){return Re(n)?n.join("."):n}function Ji(n,e){let t=[],r=!1,a=(i,l,s)=>{if($e(i))if(l[s]){let u=i[l[s]];if($e(u))if(s===l.length-1&&(Te(u)||vn(u)||qi(u)))t.push(Di(u));else if(Re(u)){r=!0;for(let o=0,p=u.length;o<p;o+=1)a(u[o],l,s+1)}else l.length&&a(u,l,s+1)}else t.push(i)};return a(n,Te(e)?e.split("."):e,0),r?t:t[0]}var W={...{isCaseSensitive:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(n,e)=>n.score===e.score?n.idx<e.idx?-1:1:n.score<e.score?-1:1},...{includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},...{location:0,threshold:.6,distance:100},...{useExtendedSearch:!1,getFn:Ji,ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1}};let Yi=/[^ ]+/g;function Qi(n=1,e=3){let t=new Map,r=Math.pow(10,e);return{get(a){let i=a.match(Yi).length;if(t.has(i))return t.get(i);let l=parseFloat(Math.round(1/Math.pow(i,.5*n)*r)/r);return t.set(i,l),l},clear(){t.clear()}}}class mr{constructor({getFn:e=W.getFn,fieldNormWeight:t=W.fieldNormWeight}={}){this.norm=Qi(t,3),this.getFn=e,this.isCreated=!1,this.setIndexRecords()}setSources(e=[]){this.docs=e}setIndexRecords(e=[]){this.records=e}setKeys(e=[]){this.keys=e,this._keysMap={},e.forEach((t,r)=>{this._keysMap[t.id]=r})}create(){!this.isCreated&&this.docs.length&&(this.isCreated=!0,Te(this.docs[0])?this.docs.forEach((e,t)=>{this._addString(e,t)}):this.docs.forEach((e,t)=>{this._addObject(e,t)}),this.norm.clear())}add(e){let t=this.size();Te(e)?this._addString(e,t):this._addObject(e,t)}removeAt(e){this.records.splice(e,1);for(let t=e,r=this.size();t<r;t+=1)this.records[t].i-=1}getValueForItemAtKeyId(e,t){return e[this._keysMap[t]]}size(){return this.records.length}_addString(e,t){if(!$e(e)||fr(e))return;let r={v:e,i:t,n:this.norm.get(e)};this.records.push(r)}_addObject(e,t){let r={i:t,$:{}};this.keys.forEach((a,i)=>{let l=a.getFn?a.getFn(e):this.getFn(e,a.path);if($e(l)){if(Re(l)){let s=[],u=[{nestedArrIndex:-1,value:l}];for(;u.length;){let{nestedArrIndex:o,value:p}=u.pop();if($e(p))if(Te(p)&&!fr(p)){let m={v:p,i:o,n:this.norm.get(p)};s.push(m)}else Re(p)&&p.forEach((m,d)=>{u.push({nestedArrIndex:d,value:m})})}r.$[i]=s}else if(Te(l)&&!fr(l)){let s={v:l,n:this.norm.get(l)};r.$[i]=s}}}),this.records.push(r)}toJSON(){return{keys:this.keys,records:this.records}}}function kn(n,e,{getFn:t=W.getFn,fieldNormWeight:r=W.fieldNormWeight}={}){let a=new mr({getFn:t,fieldNormWeight:r});return a.setKeys(n.map(xn)),a.setSources(e),a.create(),a}function Xi(n,{getFn:e=W.getFn,fieldNormWeight:t=W.fieldNormWeight}={}){let{keys:r,records:a}=n,i=new mr({getFn:e,fieldNormWeight:t});return i.setKeys(r),i.setIndexRecords(a),i}function jt(n,{errors:e=0,currentLocation:t=0,expectedLocation:r=0,distance:a=W.distance,ignoreLocation:i=W.ignoreLocation}={}){let l=e/n.length;if(i)return l;let s=Math.abs(r-t);return a?l+s/a:s?1:l}function Ki(n=[],e=W.minMatchCharLength){let t=[],r=-1,a=-1,i=0;for(let l=n.length;i<l;i+=1){let s=n[i];s&&r===-1?r=i:s||r===-1||((a=i-1)-r+1>=e&&t.push([r,a]),r=-1)}return n[i-1]&&i-r>=e&&t.push([r,i-1]),t}let Ve=32;function Zi(n,e,t,{location:r=W.location,distance:a=W.distance,threshold:i=W.threshold,findAllMatches:l=W.findAllMatches,minMatchCharLength:s=W.minMatchCharLength,includeMatches:u=W.includeMatches,ignoreLocation:o=W.ignoreLocation}={}){let p;if(e.length>Ve)throw Error(Wi(Ve));let m=e.length,d=n.length,y=Math.max(0,Math.min(r,d)),f=i,S=y,v=s>1||u,w=v?Array(d):[];for(;(p=n.indexOf(e,S))>-1;)if(f=Math.min(jt(e,{currentLocation:p,expectedLocation:y,distance:a,ignoreLocation:o}),f),S=p+m,v){let P=0;for(;P<m;)w[p+P]=1,P+=1}S=-1;let g=[],_=1,$=m+d,x=1<<m-1;for(let P=0;P<m;P+=1){let D=0,R=$;for(;D<R;)jt(e,{errors:P,currentLocation:y+R,expectedLocation:y,distance:a,ignoreLocation:o})<=f?D=R:$=R,R=Math.floor(($-D)/2+D);$=R;let I=Math.max(1,y-R+1),F=l?d:Math.min(y+R,d)+m,C=Array(F+2);C[F+1]=(1<<P)-1;for(let B=F;B>=I;B-=1){let V=B-1,X=t[n.charAt(V)];if(v&&(w[V]=+!!X),C[B]=(C[B+1]<<1|1)&X,P&&(C[B]|=(g[B+1]|g[B])<<1|1|g[B+1]),C[B]&x&&(_=jt(e,{errors:P,currentLocation:V,expectedLocation:y,distance:a,ignoreLocation:o}))<=f){if(f=_,(S=V)<=y)break;I=Math.max(1,2*y-S)}}if(jt(e,{errors:P+1,currentLocation:y,expectedLocation:y,distance:a,ignoreLocation:o})>f)break;g=C}let T={isMatch:S>=0,score:Math.max(.001,_)};if(v){let P=Ki(w,s);P.length?u&&(T.indices=P):T.isMatch=!1}return T}function es(n){let e={};for(let t=0,r=n.length;t<r;t+=1){let a=n.charAt(t);e[a]=(e[a]||0)|1<<r-t-1}return e}class An{constructor(e,{location:t=W.location,threshold:r=W.threshold,distance:a=W.distance,includeMatches:i=W.includeMatches,findAllMatches:l=W.findAllMatches,minMatchCharLength:s=W.minMatchCharLength,isCaseSensitive:u=W.isCaseSensitive,ignoreLocation:o=W.ignoreLocation}={}){if(this.options={location:t,threshold:r,distance:a,includeMatches:i,findAllMatches:l,minMatchCharLength:s,isCaseSensitive:u,ignoreLocation:o},this.pattern=u?e:e.toLowerCase(),this.chunks=[],!this.pattern.length)return;let p=(d,y)=>{this.chunks.push({pattern:d,alphabet:es(d),startIndex:y})},m=this.pattern.length;if(m>Ve){let d=0,y=m%Ve,f=m-y;for(;d<f;)p(this.pattern.substr(d,Ve),d),d+=Ve;if(y){let S=m-Ve;p(this.pattern.substr(S),S)}}else p(this.pattern,0)}searchIn(e){let{isCaseSensitive:t,includeMatches:r}=this.options;if(t||(e=e.toLowerCase()),this.pattern===e){let f={isMatch:!0,score:0};return r&&(f.indices=[[0,e.length-1]]),f}let{location:a,distance:i,threshold:l,findAllMatches:s,minMatchCharLength:u,ignoreLocation:o}=this.options,p=[],m=0,d=!1;this.chunks.forEach(({pattern:f,alphabet:S,startIndex:v})=>{let{isMatch:w,score:g,indices:_}=Zi(e,f,S,{location:a+v,distance:i,threshold:l,findAllMatches:s,minMatchCharLength:u,includeMatches:r,ignoreLocation:o});w&&(d=!0),m+=g,w&&_&&(p=[...p,..._])});let y={isMatch:d,score:d?m/this.chunks.length:1};return d&&r&&(y.indices=p),y}}class Be{constructor(e){this.pattern=e}static isMultiMatch(e){return In(e,this.multiRegex)}static isSingleMatch(e){return In(e,this.singleRegex)}search(){}}function In(n,e){let t=n.match(e);return t?t[1]:null}class ts extends Be{constructor(e){super(e)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(e){let t=e===this.pattern;return{isMatch:t,score:t?0:1,indices:[0,this.pattern.length-1]}}}class rs extends Be{constructor(e){super(e)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(e){let t=e.indexOf(this.pattern)===-1;return{isMatch:t,score:t?0:1,indices:[0,e.length-1]}}}class ns extends Be{constructor(e){super(e)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\\^"(.*)"$/}static get singleRegex(){return/^\\^(.*)$/}search(e){let t=e.startsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,this.pattern.length-1]}}}class as extends Be{constructor(e){super(e)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\\^"(.*)"$/}static get singleRegex(){return/^!\\^(.*)$/}search(e){let t=!e.startsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,e.length-1]}}}class is extends Be{constructor(e){super(e)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\\$$/}static get singleRegex(){return/^(.*)\\$$/}search(e){let t=e.endsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[e.length-this.pattern.length,e.length-1]}}}class ss extends Be{constructor(e){super(e)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\\$$/}static get singleRegex(){return/^!(.*)\\$$/}search(e){let t=!e.endsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,e.length-1]}}}class On extends Be{constructor(e,{location:t=W.location,threshold:r=W.threshold,distance:a=W.distance,includeMatches:i=W.includeMatches,findAllMatches:l=W.findAllMatches,minMatchCharLength:s=W.minMatchCharLength,isCaseSensitive:u=W.isCaseSensitive,ignoreLocation:o=W.ignoreLocation}={}){super(e),this._bitapSearch=new An(e,{location:t,threshold:r,distance:a,includeMatches:i,findAllMatches:l,minMatchCharLength:s,isCaseSensitive:u,ignoreLocation:o})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(e){return this._bitapSearch.searchIn(e)}}class jn extends Be{constructor(e){super(e)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(e){let t,r=0,a=[],i=this.pattern.length;for(;(t=e.indexOf(this.pattern,r))>-1;)r=t+i,a.push([t,r-1]);let l=!!a.length;return{isMatch:l,score:l?0:1,indices:a}}}let gr=[ts,jn,ns,as,ss,is,rs,On],Tn=gr.length,os=/ +(?=(?:[^\\"]*\\"[^\\"]*\\")*[^\\"]*$)/,ls="|";function cs(n,e={}){return n.split(ls).map(t=>{let r=t.trim().split(os).filter(i=>i&&!!i.trim()),a=[];for(let i=0,l=r.length;i<l;i+=1){let s=r[i],u=!1,o=-1;for(;!u&&++o<Tn;){let p=gr[o],m=p.isMultiMatch(s);m&&(a.push(new p(m,e)),u=!0)}if(!u)for(o=-1;++o<Tn;){let p=gr[o],m=p.isSingleMatch(s);if(m){a.push(new p(m,e));break}}}return a})}let us=new Set([On.type,jn.type]);class ps{constructor(e,{isCaseSensitive:t=W.isCaseSensitive,includeMatches:r=W.includeMatches,minMatchCharLength:a=W.minMatchCharLength,ignoreLocation:i=W.ignoreLocation,findAllMatches:l=W.findAllMatches,location:s=W.location,threshold:u=W.threshold,distance:o=W.distance}={}){this.query=null,this.options={isCaseSensitive:t,includeMatches:r,minMatchCharLength:a,findAllMatches:l,ignoreLocation:i,location:s,threshold:u,distance:o},this.pattern=t?e:e.toLowerCase(),this.query=cs(this.pattern,this.options)}static condition(e,t){return t.useExtendedSearch}searchIn(e){let t=this.query;if(!t)return{isMatch:!1,score:1};let{includeMatches:r,isCaseSensitive:a}=this.options;e=a?e:e.toLowerCase();let i=0,l=[],s=0;for(let u=0,o=t.length;u<o;u+=1){let p=t[u];l.length=0,i=0;for(let m=0,d=p.length;m<d;m+=1){let y=p[m],{isMatch:f,indices:S,score:v}=y.search(e);if(f){if(i+=1,s+=v,r){let w=y.constructor.type;us.has(w)?l=[...l,...S]:l.push(S)}}else{s=0,i=0,l.length=0;break}}if(i){let m={isMatch:!0,score:s/i};return r&&(m.indices=l),m}}return{isMatch:!1,score:1}}}let yr=[];function ds(...n){yr.push(...n)}function _r(n,e){for(let t=0,r=yr.length;t<r;t+=1){let a=yr[t];if(a.condition(n,e))return new a(n,e)}return new An(n,e)}let Tt={AND:"$and",OR:"$or"},br={PATH:"$path",PATTERN:"$val"},vr=n=>!!(n[Tt.AND]||n[Tt.OR]),fs=n=>!!n[br.PATH],hs=n=>!Re(n)&&wn(n)&&!vr(n),Pn=n=>({[Tt.AND]:Object.keys(n).map(e=>({[e]:n[e]}))});function Cn(n,e,{auto:t=!0}={}){let r=a=>{let i=Object.keys(a),l=fs(a);if(!l&&i.length>1&&!vr(a))return r(Pn(a));if(hs(a)){let u=l?a[br.PATH]:i[0],o=l?a[br.PATTERN]:a[u];if(!Te(o))throw Error(Gi(u));let p={keyId:hr(u),pattern:o};return t&&(p.searcher=_r(o,e)),p}let s={children:[],operator:i[0]};return i.forEach(u=>{let o=a[u];Re(o)&&o.forEach(p=>{s.children.push(r(p))})}),s};return vr(n)||(n=Pn(n)),r(n)}function ms(n,{ignoreFieldNorm:e=W.ignoreFieldNorm}){n.forEach(t=>{let r=1;t.matches.forEach(({key:a,norm:i,score:l})=>{let s=a?a.weight:null;r*=Math.pow(l===0&&s?Number.EPSILON:l,(s||1)*(e?1:i))}),t.score=r})}function gs(n,e){let t=n.matches;e.matches=[],$e(t)&&t.forEach(r=>{if(!$e(r.indices)||!r.indices.length)return;let{indices:a,value:i}=r,l={indices:a,value:i};r.key&&(l.key=r.key.src),r.idx>-1&&(l.refIndex=r.idx),e.matches.push(l)})}function ys(n,e){e.score=n.score}function _s(n,e,{includeMatches:t=W.includeMatches,includeScore:r=W.includeScore}={}){let a=[];return t&&a.push(gs),r&&a.push(ys),n.map(i=>{let{idx:l}=i,s={item:e[l],refIndex:l};return a.length&&a.forEach(u=>{u(i,s)}),s})}class Ke{constructor(e,t={},r){this.options={...W,...t},this.options.useExtendedSearch,this._keyStore=new Vi(this.options.keys),this.setCollection(e,r)}setCollection(e,t){if(this._docs=e,t&&!(t instanceof mr))throw Error(Ui);this._myIndex=t||kn(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(e){$e(e)&&(this._docs.push(e),this._myIndex.add(e))}remove(e=()=>!1){let t=[];for(let r=0,a=this._docs.length;r<a;r+=1){let i=this._docs[r];e(i,r)&&(this.removeAt(r),r-=1,a-=1,t.push(i))}return t}removeAt(e){this._docs.splice(e,1),this._myIndex.removeAt(e)}getIndex(){return this._myIndex}search(e,{limit:t=-1}={}){let{includeMatches:r,includeScore:a,shouldSort:i,sortFn:l,ignoreFieldNorm:s}=this.options,u=Te(e)?Te(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e);return ms(u,{ignoreFieldNorm:s}),i&&u.sort(l),vn(t)&&t>-1&&(u=u.slice(0,t)),_s(u,this._docs,{includeMatches:r,includeScore:a})}_searchStringList(e){let t=_r(e,this.options),{records:r}=this._myIndex,a=[];return r.forEach(({v:i,i:l,n:s})=>{if(!$e(i))return;let{isMatch:u,score:o,indices:p}=t.searchIn(i);u&&a.push({item:i,idx:l,matches:[{score:o,value:i,norm:s,indices:p}]})}),a}_searchLogical(e){let t=Cn(e,this.options),r=(s,u,o)=>{if(!s.children){let{keyId:m,searcher:d}=s,y=this._findMatches({key:this._keyStore.get(m),value:this._myIndex.getValueForItemAtKeyId(u,m),searcher:d});return y&&y.length?[{idx:o,item:u,matches:y}]:[]}let p=[];for(let m=0,d=s.children.length;m<d;m+=1){let y=r(s.children[m],u,o);if(y.length)p.push(...y);else if(s.operator===Tt.AND)return[]}return p},a=this._myIndex.records,i={},l=[];return a.forEach(({$:s,i:u})=>{if($e(s)){let o=r(t,s,u);o.length&&(i[u]||(i[u]={idx:u,item:s,matches:[]},l.push(i[u])),o.forEach(({matches:p})=>{i[u].matches.push(...p)}))}}),l}_searchObjectList(e){let t=_r(e,this.options),{keys:r,records:a}=this._myIndex,i=[];return a.forEach(({$:l,i:s})=>{if(!$e(l))return;let u=[];r.forEach((o,p)=>{u.push(...this._findMatches({key:o,value:l[p],searcher:t}))}),u.length&&i.push({idx:s,item:l,matches:u})}),i}_findMatches({key:e,value:t,searcher:r}){if(!$e(t))return[];let a=[];if(Re(t))t.forEach(({v:i,i:l,n:s})=>{if(!$e(i))return;let{isMatch:u,score:o,indices:p}=r.searchIn(i);u&&a.push({score:o,key:e,value:i,idx:l,norm:s,indices:p})});else{let{v:i,n:l}=t,{isMatch:s,score:u,indices:o}=r.searchIn(i);s&&a.push({score:u,key:e,value:i,norm:l,indices:o})}return a}}function bs(n,e){let[t,r,a]=n.split(":"),[i,l]=e.split(":"),s=6371,u=Pt(i-t),o=Pt(l-r),p=Math.sin(u/2)*Math.sin(u/2)+Math.cos(Pt(t))*Math.cos(Pt(i))*Math.sin(o/2)*Math.sin(o/2),m=2*Math.atan2(Math.sqrt(p),Math.sqrt(1-p))*s;return Number(a)>=m}function Pt(n){return Math.PI/180*n}function vs({type:n,date:e=0,match:t=!0}={},r){if(!r&&n)return!1;let a=new Date,i=!0;switch(n){case"day":let l=Ze(e),s=Ze(e+1);i=l<=r&&r<s;break;case"days":if(e<0){let d=Ze(1);i=Ze(-6)<=r&&r<d}else{let d=Ze(),y=Ze(7);i=d<=r&&r<y}break;case"day_week":i=e===new Date(r).getDay();break;case"week":let u=a.getDate()-a.getDay(),o=u+(e==-2?13:6),[p,m]=ws(a.setDate(u+7*e),new Date().setDate(o+7*e));i=p<=r&&r<=m;break;case"month":if(a.getFullYear()!==new Date(r).getFullYear())return!1;i=a.getMonth()+e===new Date(r).getMonth();break;case"year":i=a.getFullYear()+e===new Date(r).getFullYear();break;default:return!0}return t?i:!i}function ws(n,e){return[new Date(n),new Date(e)]}function Ze(n=0){let e=new Date;return new Date(e.getFullYear(),e.getMonth(),e.getDate()+n).valueOf()}function Nn(n,e){if(n&&n.length)return e?n.filter(t=>t.fields.find(r=>r.index_value&&r.index_value.toLowerCase().indexOf(e.toLowerCase())!==-1)):n}Ke.version="6.6.2",Ke.createIndex=kn,Ke.parseIndex=Xi,Ke.config=W,Ke.parseQuery=Cn,ds(ps);let Mn=new Ke([]);function $s(n,e){return Mn.setCollection(e),!!Mn.search(n).length}function Ss(n,e){let t=new Ts;return n&&n.length?t.filter(e,n):[]}class xs{changeBehavior(e){switch(e){case"contain_or":this._checkFn=function(t,r){return r.some(a=>t.some(i=>i.indexOf(a)!==-1))};break;case"contain_and":this._checkFn=function(t,r){return r.every(a=>t.some(i=>i.indexOf(a)!==-1))};break;case"not_contain_or":this._checkFn=function(t,r){return r.some(a=>t.every(i=>i.indexOf(a)===-1))};break;case"not_contain_and":this._checkFn=function(t,r){return r.every(a=>t.every(i=>i.indexOf(a)===-1))};break;case"equal_or":this._checkFn=function(t,r){return!!t.length&&t.some(a=>r.some(i=>a==i))};break;case"equal_and":this._checkFn=function(t,r){if(!t.length)return!1;let a=new Set(r);for(;t.length&&a.size;){let i=t.pop();a.has(i)&&a.delete(i)}return!a.size};break;case"not_equal_or":this._checkFn=function(t,r){if(!t.length)return!0;let a=new Set(r);for(;t.length&&a.size;){let i=t.pop();if(!a.has(i))return!0}return!1};break;case"not_equal_and":this._checkFn=function(t,r){let a=new Set(r);for(;t.length&&a.size;){let i=t.pop();if(a.has(i))return!1}return!0};break;case"bigger":this._checkFn=function(t,r){return r.some(a=>t.every(i=>i>a))};break;case"lower":this._checkFn=function(t,r){return r.some(a=>t.every(i=>i<a))};break;case"range":this._checkFn=function(t,r){return r.some(a=>t.every(i=>a.start<=i&&i<a.end))};break;case"value":this._checkFn=function(t,r){return r.some(a=>t.some(i=>i==a))};break;case"search":this._checkFn=function(t,r){return r.some(a=>$s(a,t))};break;case"phone_equal_or":this._checkFn=function(t,r){return!!t.length&&r.some(a=>t.some(i=>i.replace(/[^0-9]/g,"").indexOf(a.replace(/[^0-9]/g,""))!==-1))};break;case"distance":this._checkFn=function(t,r){return r.some(a=>t.some(i=>bs(a,i)))};break;case"date_in":case"date_out":this._checkFn=function(t,r){return r.some(a=>t.some(i=>vs(a,i)))};break;case"recurring_date":this._checkFn=function(t,r){return r.some(a=>t.some(i=>gudhub.checkRecurringDate(i,a)))}}return this}check(e){return this.changeBehavior(e.getCheckOption())._checkFn(e.getEntity(),e.getFilterValues())}}class wr{convert(e){return[Number(e)]}convertFilterValue(e){return Number(e)}}class Es extends wr{convertFilterValue(e){return{start:Number(e.split(":")[0]),end:Number(e.split(":")[1])}}}class ks{convert(e){return String(e??"").toLowerCase().split(",")}convertFilterValue(e){return e===0?"0":String(e||"").toLowerCase()}}class As extends wr{convertFilterValue(e){let[t,r,a]=e.split(":");return{type:t,date:Number(r),match:!!Number(a)}}}class Is{convert(e){return[String(!!e)]}convertFilterValue(e){return String(e)}}class Os{convert(e){return[Number(e)]}convertFilterValue(e){return String(e)}}class js{constructor(){this._strategies={stringStrategy:new ks,numberStrategy:new wr,booleanStrategy:new Is,rangeStrategy:new Es,dateStrategy:new As,recurringDateStrategy:new Os}}setStrategy(e){switch(this._checkOption=e,e){case"contain_or":case"contain_and":case"not_contain_or":case"not_contain_and":case"equal_or":case"equal_and":case"not_equal_or":case"not_equal_and":case"phone_equal_or":case"distance":case"search":this._currentStrategy=this._strategies.stringStrategy;break;case"bigger":case"lower":this._currentStrategy=this._strategies.numberStrategy;break;case"range":this._currentStrategy=this._strategies.rangeStrategy;break;case"date_in":case"date_out":this._currentStrategy=this._strategies.dateStrategy;break;case"value":this._currentStrategy=this._strategies.booleanStrategy;break;case"recurring_date":this._currentStrategy=this._strategies.recurringDateStrategy}return this}setEntity(e){return this._entity=this._currentStrategy.convert(e),this}getEntity(){return this._entity}setFilterValues(e){let t=Array.isArray(e)?e:[e];return this._filterValues=t.map(r=>this._currentStrategy.convertFilterValue(r)),this}getFilterValues(){return this._filterValues}getCheckOption(){return this._checkOption}}class Ts{constructor(){}filter(e,t){let r=this.checkIfAllFiltersHaveAndStrategy(e),a=[],i=e.filter(function(l){return l.valuesArray.length});for(let l of t){let s=!0;for(let u=0;u<i.length;u++){let o=i[u],p=l.fields.find(function(y){return o.field_id==y.field_id}),m=new js,d=new xs;switch(m.setStrategy(o.search_type).setEntity(p&&p.field_value!=null?p.field_value:null).setFilterValues(o.valuesArray),o.boolean_strategy){case"and":default:s=s&&d.check(m);break;case"or":s=s||d.check(m)}if(!s&&r)break}s&&a.push(l)}return a.length||e.length&&!a.length?a:t}checkIfAllFiltersHaveAndStrategy(e){return e.every(t=>!t.boolean_strategy||t.boolean_strategy=="and")}}function Ps(n,e){let t=[],r=[];if(n.length>0?n.forEach(a=>{r.push(a)}):r=e,r.length>0){r.forEach((a,i)=>{for(let l=0;l<e.length;l++)a.field_id==e[l].field_id&&(t.push(a.field_id),r[i]=gudhub.mergeObjects(e[l],a))});for(let a=0;a<e.length;a++)t.includes(e[a].field_id)||r.push(e[a])}return r}var $r={};function Cs(n,e){let t=[];return e.forEach(r=>{let a=[];try{a=G($r).paths(n,r.json_path),t.push({field_id:r.field_id,json_paths:a,json_paths_length:a.length})}catch(i){console.log(i)}}),t.sort((r,a)=>a.json_paths_length-r.json_paths_length),Ms(t).map(r=>({fields:r.fields.map(a=>({field_id:a.field_id,field_value:G($r).value(n,a.json_path)}))}))}function Ns(n,e){let t=[];return e.forEach(r=>{t.push({path_to_compare:r,match_coefficient:0})}),n.forEach((r,a)=>{for(var i=0;i<t.length;i++)t[i].path_to_compare[a]==r&&(t[i].match_coefficient+=1/(a+1))}),t.sort((r,a)=>a.match_coefficient-r.match_coefficient),t[0].path_to_compare}function Ms(n){let e=[];return n.length&&n[0].json_paths.forEach(t=>{let r={fields:[]};n.forEach(a=>{r.fields.push({field_id:a.field_id,json_path:Ns(t,a.json_paths)})}),e.push(r)}),e}function Rs(n,e,t,r,a,i){let l=[],s=function(u,o){let p=Je(o,a);p&&(p.field_value=i+"."+u.item_id,l.push(o))};return t.forEach(u=>{n.forEach(o=>{qs(o,u,e,r,s)})}),l}function Fs(n,e,t){let r=JSON.parse(JSON.stringify(n)),a=JSON.parse(JSON.stringify(e)),i=[],l=function(p,m){i.push(Ds(p,m))},s=function(p){i.push(p)},u=function(p){i.push(p)};return t?Rn(r,a,t,l,s,u):Fn(r,a,l,s,u,function(p){i.push(p)}),i}function Ls(n,e,t){let r=JSON.parse(JSON.stringify(n)),a=JSON.parse(JSON.stringify(e)),i={is_items_diff:!1,new_src_items:[],diff_src_items:[],same_items:[],trash_src_items:[]},l=function(p){i.diff_src_items.push(p)},s=function(p){i.same_items.push(p)},u=function(p){i.new_src_items.push(p)},o=function(p){i.trash_src_items.push(p)};return t&&Rn(r,a,t,l,s,u),t||Fn(r,a,l,s,u,null,o),i.is_items_diff=i.new_src_items.length>0||i.diff_src_items.length>0,i}function Ds(n,e){return n.fields.forEach(t=>{let r=Je(e,t.field_id);r?(r.field_value=t.field_value,t.history&&r.history&&(r.history=t.history.concat(r.history))):e.fields.push(t)}),e}function Rn(n,e,t,r,a,i){n.forEach(l=>{let s=!0,u=Je(l,t).field_value;e.forEach(o=>{u==Je(o,t).field_value&&(s=!1,Ln(l,o,r,a))}),s&&i(l)})}function Fn(n,e,t,r,a,i,l){let s=new Bs(e);if(n.forEach(u=>{let o=s.pullItemIndex(u.item_id);o!=null?Ln(u,e[o],t,r,l):(u.trash&&l(u),u.trash||a(u))}),i)for(let[u,o]of Object.entries(s.itemsMap))i(e[o])}function Ln(n,e,t,r,a){let i=!0;for(let l=0;l<n.fields.length;l++){let s=Je(e,n.fields[l].field_id);s?s.field_value!=n.fields[l].field_value&&(i=i&&!1):i=i&&!1}i&&(n.trash&&a(n,e),n.trash||r(n,e)),i||(n.trash&&a(n,e),n.trash||t(n,e))}function qs(n,e,t,r,a){Je(n,t).field_value==Je(e,r).field_value&&a(n,e)}function Je(n,e){let t=null;for(let r=0;r<n.fields.length;r++)e==n.fields[r].field_id&&(t=n.fields[r]);return t}(function(n){$r=n()})(function(){return function n(e,t,r){function a(s,u){if(!t[s]){if(!e[s]){var o=void 0;if(!u&&o)return o(s,!0);if(i)return i(s,!0);var p=Error("Cannot find module '"+s+"'");throw p.code="MODULE_NOT_FOUND",p}var m=t[s]={exports:{}};e[s][0].call(m.exports,function(d){return a(e[s][1][d]||d)},m,m.exports,n,e,t,r)}return t[s].exports}for(var i=void 0,l=0;l<r.length;l++)a(r[l]);return a}({"./aesprim":[function(n,e,t){(function(r,a){a(t!==void 0?t:r.esprima={})})(this,function(r){var a,i,l,s,u,o,p,m,d,y,f,S,v,w,g,_,$,x;function T(c,h){if(!c)throw Error("ASSERT: "+h)}function P(c){return c>=48&&c<=57}function D(c){return"0123456789abcdefABCDEF".indexOf(c)>=0}function R(c){return"01234567".indexOf(c)>=0}function I(c){return c===32||c===9||c===11||c===12||c===160||c>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].indexOf(c)>=0}function F(c){return c===10||c===13||c===8232||c===8233}function C(c){return c==64||c===36||c===95||c>=65&&c<=90||c>=97&&c<=122||c===92||c>=128&&p.NonAsciiIdentifierStart.test(String.fromCharCode(c))}function B(c){return c===36||c===95||c>=65&&c<=90||c>=97&&c<=122||c>=48&&c<=57||c===92||c>=128&&p.NonAsciiIdentifierPart.test(String.fromCharCode(c))}function V(c){switch(c){case"class":case"enum":case"export":case"extends":case"import":case"super":return!0;default:return!1}}function X(c){switch(c){case"implements":case"interface":case"package":case"private":case"protected":case"public":case"static":case"yield":case"let":return!0;default:return!1}}function le(c){return c==="eval"||c==="arguments"}function ve(c){if(y&&X(c))return!0;switch(c.length){case 2:return c==="if"||c==="in"||c==="do";case 3:return c==="var"||c==="for"||c==="new"||c==="try"||c==="let";case 4:return c==="this"||c==="else"||c==="case"||c==="void"||c==="with"||c==="enum";case 5:return c==="while"||c==="break"||c==="catch"||c==="throw"||c==="const"||c==="yield"||c==="class"||c==="super";case 6:return c==="return"||c==="typeof"||c==="delete"||c==="switch"||c==="export"||c==="import";case 7:return c==="default"||c==="finally"||c==="extends";case 8:return c==="function"||c==="continue"||c==="debugger";case 10:return c==="instanceof";default:return!1}}function H(c,h,b,E,j){var M;T(typeof b=="number","Comment must have valid position"),!($.lastCommentStart>=b)&&($.lastCommentStart=b,M={type:c,value:h},x.range&&(M.range=[b,E]),x.loc&&(M.loc=j),x.comments.push(M),x.attachComment&&(x.leadingComments.push(M),x.trailingComments.push(M)))}function ie(c){var h,b,E,j;for(h=f-c,b={start:{line:S,column:f-v-c}};f<w;)if(E=d.charCodeAt(f),++f,F(E)){x.comments&&(j=d.slice(h+c,f-1),b.end={line:S,column:f-v-1},H("Line",j,h,f-1,b)),E===13&&d.charCodeAt(f)===10&&++f,++S,v=f;return}x.comments&&(j=d.slice(h+c,f),b.end={line:S,column:f-v},H("Line",j,h,f,b))}function ee(){var c,h,b,E;for(x.comments&&(c=f-2,h={start:{line:S,column:f-v-2}});f<w;)if(F(b=d.charCodeAt(f)))b===13&&d.charCodeAt(f+1)===10&&++f,++S,v=++f,f>=w&&Q({},o.UnexpectedToken,"ILLEGAL");else if(b===42){if(d.charCodeAt(f+1)===47){++f,++f,x.comments&&(E=d.slice(c+2,f-2),h.end={line:S,column:f-v},H("Block",E,c,f,h));return}++f}else++f;Q({},o.UnexpectedToken,"ILLEGAL")}function k(){var c,h;for(h=f===0;f<w;)if(I(c=d.charCodeAt(f)))++f;else if(F(c))++f,c===13&&d.charCodeAt(f)===10&&++f,++S,v=f,h=!0;else if(c===47)if((c=d.charCodeAt(f+1))===47)++f,++f,ie(2),h=!0;else if(c===42)++f,++f,ee();else break;else if(h&&c===45)if(d.charCodeAt(f+1)===45&&d.charCodeAt(f+2)===62)f+=3,ie(3);else break;else if(c===60)if(d.slice(f+1,f+4)==="!--")++f,++f,++f,++f,ie(4);else break;else break}function O(c){var h,b,E,j=0;for(h=0,b=c==="u"?4:2;h<b;++h){if(!(f<w&&D(d[f])))return"";E=d[f++],j=16*j+"0123456789abcdef".indexOf(E.toLowerCase())}return String.fromCharCode(j)}function N(){var c,h;for(h=String.fromCharCode(c=d.charCodeAt(f++)),c===92&&(d.charCodeAt(f)!==117&&Q({},o.UnexpectedToken,"ILLEGAL"),++f,(c=O("u"))&&c!=="\\\\"&&C(c.charCodeAt(0))||Q({},o.UnexpectedToken,"ILLEGAL"),h=c);f<w&&B(c=d.charCodeAt(f));)++f,h+=String.fromCharCode(c),c===92&&(h=h.substr(0,h.length-1),d.charCodeAt(f)!==117&&Q({},o.UnexpectedToken,"ILLEGAL"),++f,(c=O("u"))&&c!=="\\\\"&&B(c.charCodeAt(0))||Q({},o.UnexpectedToken,"ILLEGAL"),h+=c);return h}function K(){var c,h;for(c=f++;f<w;){if((h=d.charCodeAt(f))===92)return f=c,N();if(B(h))++f;else break}return d.slice(c,f)}function se(){var c,h;return c=f,{type:(h=d.charCodeAt(f)===92?N():K()).length===1?a.Identifier:ve(h)?a.Keyword:h==="null"?a.NullLiteral:h==="true"||h==="false"?a.BooleanLiteral:a.Identifier,value:h,lineNumber:S,lineStart:v,start:c,end:f}}function te(){var c,h,b,E,j=f,M=d.charCodeAt(f),z=d[f];switch(M){case 46:case 40:case 41:case 59:case 44:case 123:case 125:case 91:case 93:case 58:case 63:case 126:return++f,x.tokenize&&(M===40?x.openParenToken=x.tokens.length:M===123&&(x.openCurlyToken=x.tokens.length)),{type:a.Punctuator,value:String.fromCharCode(M),lineNumber:S,lineStart:v,start:j,end:f};default:if((c=d.charCodeAt(f+1))===61)switch(M){case 43:case 45:case 47:case 60:case 62:case 94:case 124:case 37:case 38:case 42:return f+=2,{type:a.Punctuator,value:String.fromCharCode(M)+String.fromCharCode(c),lineNumber:S,lineStart:v,start:j,end:f};case 33:case 61:return f+=2,d.charCodeAt(f)===61&&++f,{type:a.Punctuator,value:d.slice(j,f),lineNumber:S,lineStart:v,start:j,end:f}}}return(E=d.substr(f,4))===">>>="?(f+=4,{type:a.Punctuator,value:E,lineNumber:S,lineStart:v,start:j,end:f}):(b=E.substr(0,3))===">>>"||b==="<<="||b===">>="?(f+=3,{type:a.Punctuator,value:b,lineNumber:S,lineStart:v,start:j,end:f}):z===(h=b.substr(0,2))[1]&&"+-<>&|".indexOf(z)>=0||h==="=>"?(f+=2,{type:a.Punctuator,value:h,lineNumber:S,lineStart:v,start:j,end:f}):"<>=!+-*%&|^/".indexOf(z)>=0?(++f,{type:a.Punctuator,value:z,lineNumber:S,lineStart:v,start:j,end:f}):void Q({},o.UnexpectedToken,"ILLEGAL")}function J(c){for(var h="";f<w&&D(d[f]);)h+=d[f++];return h.length===0&&Q({},o.UnexpectedToken,"ILLEGAL"),C(d.charCodeAt(f))&&Q({},o.UnexpectedToken,"ILLEGAL"),{type:a.NumericLiteral,value:parseInt("0x"+h,16),lineNumber:S,lineStart:v,start:c,end:f}}function ce(c){for(var h="0"+d[f++];f<w&&R(d[f]);)h+=d[f++];return(C(d.charCodeAt(f))||P(d.charCodeAt(f)))&&Q({},o.UnexpectedToken,"ILLEGAL"),{type:a.NumericLiteral,value:parseInt(h,8),octal:!0,lineNumber:S,lineStart:v,start:c,end:f}}function re(){var c,h,b;if(T(P((b=d[f]).charCodeAt(0))||b===".","Numeric literal must start with a decimal digit or a decimal point"),h=f,c="",b!=="."){if(c=d[f++],b=d[f],c==="0"){if(b==="x"||b==="X")return++f,J(h);if(R(b))return ce(h);b&&P(b.charCodeAt(0))&&Q({},o.UnexpectedToken,"ILLEGAL")}for(;P(d.charCodeAt(f));)c+=d[f++];b=d[f]}if(b==="."){for(c+=d[f++];P(d.charCodeAt(f));)c+=d[f++];b=d[f]}if(b==="e"||b==="E")if(c+=d[f++],((b=d[f])==="+"||b==="-")&&(c+=d[f++]),P(d.charCodeAt(f)))for(;P(d.charCodeAt(f));)c+=d[f++];else Q({},o.UnexpectedToken,"ILLEGAL");return C(d.charCodeAt(f))&&Q({},o.UnexpectedToken,"ILLEGAL"),{type:a.NumericLiteral,value:parseFloat(c),lineNumber:S,lineStart:v,start:h,end:f}}function fe(){var c,h,b,E,j,M,z,pe,ae="",_e=!1;for(z=S,pe=v,T((c=d[f])==="'"||c==='"',"String literal must starts with a quote"),h=f,++f;f<w;){if((b=d[f++])===c){c="";break}if(b==="\\\\")if((b=d[f++])&&F(b.charCodeAt(0)))++S,b==="\\r"&&d[f]===\`
15225
+ const jsContent = `(function(){"use strict";(()=>{let Ut,vt,Tr,Gt;var le=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{};function G(n){return n&&n.__esModule?n.default:n}function Pr(n,e,t,r){Object.defineProperty(n,e,{get:t,set:r,enumerable:!0,configurable:!0})}var Wt={},wt={},A=le.parcelRequire94c2;A==null&&((A=function(n){if(n in Wt)return Wt[n].exports;if(n in wt){var e=wt[n];delete wt[n];var t={id:n,exports:{}};return Wt[n]=t,e.call(t.exports,t,t.exports),t.exports}var r=Error("Cannot find module '"+n+"'");throw r.code="MODULE_NOT_FOUND",r}).register=function(n,e){wt[n]=e},le.parcelRequire94c2=A);var L=A.register;L("1ufAB",function(n,e){var t=A("iEaqd"),r=A("iNZzY"),a=A("2VbXH"),i=A("6Mx50");function l(u){var o=new a(u),p=r(a.prototype.request,o);return t.extend(p,a.prototype,o),t.extend(p,o),p}var s=l(A("bM4se"));s.Axios=a,s.create=function(u){return l(i(s.defaults,u))},s.Cancel=A("g2liO"),s.CancelToken=A("14PRn"),s.isCancel=A("8kGOw"),s.all=function(u){return Promise.all(u)},s.spread=A("i3hBo"),s.isAxiosError=A("dhYWP"),n.exports=s,n.exports.default=s}),L("iEaqd",function(n,e){var t=A("iNZzY"),r=Object.prototype.toString;function a(I){return r.call(I)==="[object Array]"}function i(I){return I===void 0}function l(I){return I!==null&&!i(I)&&I.constructor!==null&&!i(I.constructor)&&typeof I.constructor.isBuffer=="function"&&I.constructor.isBuffer(I)}function s(I){return r.call(I)==="[object ArrayBuffer]"}function u(I){return typeof FormData<"u"&&I instanceof FormData}function o(I){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?ArrayBuffer.isView(I):I&&I.buffer&&I.buffer instanceof ArrayBuffer}function p(I){return typeof I=="string"}function m(I){return typeof I=="number"}function d(I){return I!==null&&typeof I=="object"}function y(I){if(r.call(I)!=="[object Object]")return!1;var F=Object.getPrototypeOf(I);return F===null||F===Object.prototype}function f(I){return r.call(I)==="[object Date]"}function S(I){return r.call(I)==="[object File]"}function v(I){return r.call(I)==="[object Blob]"}function w(I){return r.call(I)==="[object Function]"}function g(I){return d(I)&&w(I.pipe)}function _(I){return typeof URLSearchParams<"u"&&I instanceof URLSearchParams}function $(I){return I.trim?I.trim():I.replace(/^\\s+|\\s+$/g,"")}function x(){return(typeof navigator>"u"||navigator.product!=="ReactNative"&&navigator.product!=="NativeScript"&&navigator.product!=="NS")&&typeof window<"u"&&typeof document<"u"}function T(I,F){if(I!=null)if(typeof I!="object"&&(I=[I]),a(I))for(var C=0,B=I.length;C<B;C++)F.call(null,I[C],C,I);else for(var V in I)Object.prototype.hasOwnProperty.call(I,V)&&F.call(null,I[V],V,I)}function P(){var I={};function F(V,X){y(I[X])&&y(V)?I[X]=P(I[X],V):y(V)?I[X]=P({},V):a(V)?I[X]=V.slice():I[X]=V}for(var C=0,B=arguments.length;C<B;C++)T(arguments[C],F);return I}function D(I,F,C){return T(F,function(B,V){C&&typeof B=="function"?I[V]=t(B,C):I[V]=B}),I}function R(I){return I.charCodeAt(0)===65279&&(I=I.slice(1)),I}n.exports={isArray:a,isArrayBuffer:s,isBuffer:l,isFormData:u,isArrayBufferView:o,isString:p,isNumber:m,isObject:d,isPlainObject:y,isUndefined:i,isDate:f,isFile:S,isBlob:v,isFunction:w,isStream:g,isURLSearchParams:_,isStandardBrowserEnv:x,forEach:T,merge:P,extend:D,trim:$,stripBOM:R}}),L("iNZzY",function(n,e){n.exports=function(t,r){return function(){for(var a=Array(arguments.length),i=0;i<a.length;i++)a[i]=arguments[i];return t.apply(r,a)}}}),L("2VbXH",function(n,e){var t=A("iEaqd"),r=A("gWG2h"),a=A("4m3Da"),i=A("d4try"),l=A("6Mx50"),s=A("hiYAY"),u=s.validators;function o(p){this.defaults=p,this.interceptors={request:new a,response:new a}}o.prototype.request=function(p){typeof p=="string"?(p=arguments[1]||{},p.url=arguments[0]):p=p||{},(p=l(this.defaults,p)).method?p.method=p.method.toLowerCase():this.defaults.method?p.method=this.defaults.method.toLowerCase():p.method="get";var m,d=p.transitional;d!==void 0&&s.assertOptions(d,{silentJSONParsing:u.transitional(u.boolean,"1.0.0"),forcedJSONParsing:u.transitional(u.boolean,"1.0.0"),clarifyTimeoutError:u.transitional(u.boolean,"1.0.0")},!1);var y=[],f=!0;this.interceptors.request.forEach(function($){(typeof $.runWhen!="function"||$.runWhen(p)!==!1)&&(f=f&&$.synchronous,y.unshift($.fulfilled,$.rejected))});var S=[];if(this.interceptors.response.forEach(function($){S.push($.fulfilled,$.rejected)}),!f){var v=[i,void 0];for(Array.prototype.unshift.apply(v,y),v=v.concat(S),m=Promise.resolve(p);v.length;)m=m.then(v.shift(),v.shift());return m}for(var w=p;y.length;){var g=y.shift(),_=y.shift();try{w=g(w)}catch($){_($);break}}try{m=i(w)}catch($){return Promise.reject($)}for(;S.length;)m=m.then(S.shift(),S.shift());return m},o.prototype.getUri=function(p){return r((p=l(this.defaults,p)).url,p.params,p.paramsSerializer).replace(/^\\?/,"")},t.forEach(["delete","get","head","options"],function(p){o.prototype[p]=function(m,d){return this.request(l(d||{},{method:p,url:m,data:(d||{}).data}))}}),t.forEach(["post","put","patch"],function(p){o.prototype[p]=function(m,d,y){return this.request(l(y||{},{method:p,url:m,data:d}))}}),n.exports=o}),L("gWG2h",function(n,e){var t=A("iEaqd");function r(a){return encodeURIComponent(a).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}n.exports=function(a,i,l){if(!i)return a;if(l)s=l(i);else if(t.isURLSearchParams(i))s=i.toString();else{var s,u=[];t.forEach(i,function(p,m){p!=null&&(t.isArray(p)?m+="[]":p=[p],t.forEach(p,function(d){t.isDate(d)?d=d.toISOString():t.isObject(d)&&(d=JSON.stringify(d)),u.push(r(m)+"="+r(d))}))}),s=u.join("&")}if(s){var o=a.indexOf("#");o!==-1&&(a=a.slice(0,o)),a+=(a.indexOf("?")===-1?"?":"&")+s}return a}}),L("4m3Da",function(n,e){var t=A("iEaqd");function r(){this.handlers=[]}r.prototype.use=function(a,i,l){return this.handlers.push({fulfilled:a,rejected:i,synchronous:!!l&&l.synchronous,runWhen:l?l.runWhen:null}),this.handlers.length-1},r.prototype.eject=function(a){this.handlers[a]&&(this.handlers[a]=null)},r.prototype.forEach=function(a){t.forEach(this.handlers,function(i){i!==null&&a(i)})},n.exports=r}),L("d4try",function(n,e){var t=A("iEaqd"),r=A("gu59S"),a=A("8kGOw"),i=A("bM4se");function l(s){s.cancelToken&&s.cancelToken.throwIfRequested()}n.exports=function(s){return l(s),s.headers=s.headers||{},s.data=r.call(s,s.data,s.headers,s.transformRequest),s.headers=t.merge(s.headers.common||{},s.headers[s.method]||{},s.headers),t.forEach(["delete","get","head","post","put","patch","common"],function(u){delete s.headers[u]}),(s.adapter||i.adapter)(s).then(function(u){return l(s),u.data=r.call(s,u.data,u.headers,s.transformResponse),u},function(u){return!a(u)&&(l(s),u&&u.response&&(u.response.data=r.call(s,u.response.data,u.response.headers,s.transformResponse))),Promise.reject(u)})}}),L("gu59S",function(n,e){var t=A("iEaqd"),r=A("bM4se");n.exports=function(a,i,l){var s=this||r;return t.forEach(l,function(u){a=u.call(s,a,i)}),a}}),L("bM4se",function(n,e){var t=A("2dKjk"),r=A("iEaqd"),a=A("4xE2z"),i=A("9na6w"),l={"Content-Type":"application/x-www-form-urlencoded"};function s(p,m){!r.isUndefined(p)&&r.isUndefined(p["Content-Type"])&&(p["Content-Type"]=m)}function u(p,m,d){if(r.isString(p))try{return(m||JSON.parse)(p),r.trim(p)}catch(y){if(y.name!=="SyntaxError")throw y}return(0,JSON.stringify)(p)}var o={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:function(){var p;return(typeof XMLHttpRequest<"u"||t!==void 0&&Object.prototype.toString.call(t)==="[object process]")&&(p=A("kHaX1")),p}(),transformRequest:[function(p,m){return a(m,"Accept"),a(m,"Content-Type"),r.isFormData(p)||r.isArrayBuffer(p)||r.isBuffer(p)||r.isStream(p)||r.isFile(p)||r.isBlob(p)?p:r.isArrayBufferView(p)?p.buffer:r.isURLSearchParams(p)?(s(m,"application/x-www-form-urlencoded;charset=utf-8"),p.toString()):r.isObject(p)||m&&m["Content-Type"]==="application/json"?(s(m,"application/json"),u(p)):p}],transformResponse:[function(p){var m=this.transitional,d=m&&m.silentJSONParsing,y=m&&m.forcedJSONParsing,f=!d&&this.responseType==="json";if(f||y&&r.isString(p)&&p.length)try{return JSON.parse(p)}catch(S){if(f)throw S.name==="SyntaxError"?i(S,this,"E_JSON_PARSE"):S}return p}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(p){return p>=200&&p<300}};o.headers={common:{Accept:"application/json, text/plain, */*"}},r.forEach(["delete","get","head"],function(p){o.headers[p]={}}),r.forEach(["post","put","patch"],function(p){o.headers[p]=r.merge(l)}),n.exports=o}),L("2dKjk",function(n,e){var t,r,a,i=n.exports={};function l(){throw Error("setTimeout has not been defined")}function s(){throw Error("clearTimeout has not been defined")}function u(w){if(t===setTimeout)return setTimeout(w,0);if((t===l||!t)&&setTimeout)return t=setTimeout,setTimeout(w,0);try{return t(w,0)}catch{try{return t.call(null,w,0)}catch{return t.call(this,w,0)}}}function o(w){if(r===clearTimeout)return clearTimeout(w);if((r===s||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(w);try{return r(w)}catch{try{return r.call(null,w)}catch{return r.call(this,w)}}}(function(){try{t=typeof setTimeout=="function"?setTimeout:l}catch{t=l}try{r=typeof clearTimeout=="function"?clearTimeout:s}catch{r=s}})();var p=[],m=!1,d=-1;function y(){m&&a&&(m=!1,a.length?p=a.concat(p):d=-1,p.length&&f())}function f(){if(!m){var w=u(y);m=!0;for(var g=p.length;g;){for(a=p,p=[];++d<g;)a&&a[d].run();d=-1,g=p.length}a=null,m=!1,o(w)}}function S(w,g){this.fun=w,this.array=g}function v(){}i.nextTick=function(w){var g=Array(arguments.length-1);if(arguments.length>1)for(var _=1;_<arguments.length;_++)g[_-1]=arguments[_];p.push(new S(w,g)),p.length!==1||m||u(f)},S.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=v,i.addListener=v,i.once=v,i.off=v,i.removeListener=v,i.removeAllListeners=v,i.emit=v,i.prependListener=v,i.prependOnceListener=v,i.listeners=function(w){return[]},i.binding=function(w){throw Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(w){throw Error("process.chdir is not supported")},i.umask=function(){return 0}}),L("4xE2z",function(n,e){var t=A("iEaqd");n.exports=function(r,a){t.forEach(r,function(i,l){l!==a&&l.toUpperCase()===a.toUpperCase()&&(r[a]=i,delete r[l])})}}),L("9na6w",function(n,e){n.exports=function(t,r,a,i,l){return t.config=r,a&&(t.code=a),t.request=i,t.response=l,t.isAxiosError=!0,t.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code}},t}}),L("kHaX1",function(n,e){var t=A("iEaqd"),r=A("hAgIk"),a=A("gIEx2"),i=A("gWG2h"),l=A("e3Yo9"),s=A("lo19V"),u=A("eg6xZ"),o=A("iUqaj");n.exports=function(p){return new Promise(function(m,d){var y=p.data,f=p.headers,S=p.responseType;t.isFormData(y)&&delete f["Content-Type"];var v=new XMLHttpRequest;if(p.auth){var w=p.auth.username||"",g=p.auth.password?unescape(encodeURIComponent(p.auth.password)):"";f.Authorization="Basic "+btoa(w+":"+g)}var _=l(p.baseURL,p.url);function $(){if(v){var T="getAllResponseHeaders"in v?s(v.getAllResponseHeaders()):null,P=S&&S!=="text"&&S!=="json"?v.response:v.responseText,D={data:P,status:v.status,statusText:v.statusText,headers:T,config:p,request:v};r(m,d,D),v=null}}if(v.open(p.method.toUpperCase(),i(_,p.params,p.paramsSerializer),!0),v.timeout=p.timeout,"onloadend"in v?v.onloadend=$:v.onreadystatechange=function(){v&&v.readyState===4&&(v.status!==0||v.responseURL&&v.responseURL.indexOf("file:")===0)&&setTimeout($)},v.onabort=function(){v&&(d(o("Request aborted",p,"ECONNABORTED",v)),v=null)},v.onerror=function(){d(o("Network Error",p,null,v)),v=null},v.ontimeout=function(){var T="timeout of "+p.timeout+"ms exceeded";p.timeoutErrorMessage&&(T=p.timeoutErrorMessage),d(o(T,p,p.transitional&&p.transitional.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",v)),v=null},t.isStandardBrowserEnv()){var x=(p.withCredentials||u(_))&&p.xsrfCookieName?a.read(p.xsrfCookieName):void 0;x&&(f[p.xsrfHeaderName]=x)}"setRequestHeader"in v&&t.forEach(f,function(T,P){y===void 0&&P.toLowerCase()==="content-type"?delete f[P]:v.setRequestHeader(P,T)}),t.isUndefined(p.withCredentials)||(v.withCredentials=!!p.withCredentials),S&&S!=="json"&&(v.responseType=p.responseType),typeof p.onDownloadProgress=="function"&&v.addEventListener("progress",p.onDownloadProgress),typeof p.onUploadProgress=="function"&&v.upload&&v.upload.addEventListener("progress",p.onUploadProgress),p.cancelToken&&p.cancelToken.promise.then(function(T){v&&(v.abort(),d(T),v=null)}),y||(y=null),v.send(y)})}}),L("hAgIk",function(n,e){var t=A("iUqaj");n.exports=function(r,a,i){var l=i.config.validateStatus;!i.status||!l||l(i.status)?r(i):a(t("Request failed with status code "+i.status,i.config,null,i.request,i))}}),L("iUqaj",function(n,e){var t=A("9na6w");n.exports=function(r,a,i,l,s){return t(Error(r),a,i,l,s)}}),L("gIEx2",function(n,e){var t=A("iEaqd");n.exports=t.isStandardBrowserEnv()?function(){return{write:function(r,a,i,l,s,u){var o=[];o.push(r+"="+encodeURIComponent(a)),t.isNumber(i)&&o.push("expires="+new Date(i).toGMTString()),t.isString(l)&&o.push("path="+l),t.isString(s)&&o.push("domain="+s),u===!0&&o.push("secure"),document.cookie=o.join("; ")},read:function(r){var a=document.cookie.match(RegExp("(^|;\\\\s*)("+r+")=([^;]*)"));return a?decodeURIComponent(a[3]):null},remove:function(r){this.write(r,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}()}),L("e3Yo9",function(n,e){var t=A("2rjk0"),r=A("5nGHC");n.exports=function(a,i){return a&&!t(i)?r(a,i):i}}),L("2rjk0",function(n,e){n.exports=function(t){return/^([a-z][a-z\\d\\+\\-\\.]*:)?\\/\\//i.test(t)}}),L("5nGHC",function(n,e){n.exports=function(t,r){return r?t.replace(/\\/+$/,"")+"/"+r.replace(/^\\/+/,""):t}}),L("lo19V",function(n,e){var t=A("iEaqd"),r=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];n.exports=function(a){var i,l,s,u={};return a&&t.forEach(a.split(\`
15226
+ \`),function(o){s=o.indexOf(":"),i=t.trim(o.substr(0,s)).toLowerCase(),l=t.trim(o.substr(s+1)),i&&!(u[i]&&r.indexOf(i)>=0)&&(i==="set-cookie"?u[i]=(u[i]?u[i]:[]).concat([l]):u[i]=u[i]?u[i]+", "+l:l)}),u}}),L("eg6xZ",function(n,e){var t=A("iEaqd");n.exports=t.isStandardBrowserEnv()?function(){var r,a=/(msie|trident)/i.test(navigator.userAgent),i=document.createElement("a");function l(s){var u=s;return a&&(i.setAttribute("href",u),u=i.href),i.setAttribute("href",u),{href:i.href,protocol:i.protocol?i.protocol.replace(/:$/,""):"",host:i.host,search:i.search?i.search.replace(/^\\?/,""):"",hash:i.hash?i.hash.replace(/^#/,""):"",hostname:i.hostname,port:i.port,pathname:i.pathname.charAt(0)==="/"?i.pathname:"/"+i.pathname}}return r=l(window.location.href),function(s){var u=t.isString(s)?l(s):s;return u.protocol===r.protocol&&u.host===r.host}}():function(){return function(){return!0}}()}),L("8kGOw",function(n,e){n.exports=function(t){return!!(t&&t.__CANCEL__)}}),L("6Mx50",function(n,e){var t=A("iEaqd");n.exports=function(r,a){a=a||{};var i={},l=["url","method","data"],s=["headers","auth","proxy","params"],u=["baseURL","transformRequest","transformResponse","paramsSerializer","timeout","timeoutMessage","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","decompress","maxContentLength","maxBodyLength","maxRedirects","transport","httpAgent","httpsAgent","cancelToken","socketPath","responseEncoding"],o=["validateStatus"];function p(f,S){return t.isPlainObject(f)&&t.isPlainObject(S)?t.merge(f,S):t.isPlainObject(S)?t.merge({},S):t.isArray(S)?S.slice():S}function m(f){t.isUndefined(a[f])?t.isUndefined(r[f])||(i[f]=p(void 0,r[f])):i[f]=p(r[f],a[f])}t.forEach(l,function(f){t.isUndefined(a[f])||(i[f]=p(void 0,a[f]))}),t.forEach(s,m),t.forEach(u,function(f){t.isUndefined(a[f])?t.isUndefined(r[f])||(i[f]=p(void 0,r[f])):i[f]=p(void 0,a[f])}),t.forEach(o,function(f){f in a?i[f]=p(r[f],a[f]):f in r&&(i[f]=p(void 0,r[f]))});var d=l.concat(s).concat(u).concat(o),y=Object.keys(r).concat(Object.keys(a)).filter(function(f){return d.indexOf(f)===-1});return t.forEach(y,m),i}}),L("hiYAY",function(n,e){var t=A("bTAft"),r={};["object","boolean","number","function","string","symbol"].forEach(function(u,o){r[u]=function(p){return typeof p===u||"a"+(o<1?"n ":" ")+u}});var a={},i=t.version.split(".");function l(u,o){for(var p=o?o.split("."):i,m=u.split("."),d=0;d<3;d++){if(p[d]>m[d])return!0;if(p[d]<m[d])break}return!1}function s(u,o,p){if(typeof u!="object")throw TypeError("options must be an object");for(var m=Object.keys(u),d=m.length;d-- >0;){var y=m[d],f=o[y];if(f){var S=u[y],v=S===void 0||f(S,y,u);if(v!==!0)throw TypeError("option "+y+" must be "+v);continue}if(p!==!0)throw Error("Unknown option "+y)}}r.transitional=function(u,o,p){var m=o&&l(o);function d(y,f){return"[Axios v"+t.version+"] Transitional option '"+y+"'"+f+(p?". "+p:"")}return function(y,f,S){if(u===!1)throw Error(d(f," has been removed in "+o));return m&&!a[f]&&(a[f]=!0,console.warn(d(f," has been deprecated since v"+o+" and will be removed in the near future"))),!u||u(y,f,S)}},n.exports={isOlderVersion:l,assertOptions:s,validators:r}}),L("bTAft",function(n,e){n.exports=JSON.parse('{"_args":[["axios@0.21.4","/home/vitaly/Documents/work/gudhubclient/override_npm/gudhub"]],"_from":"axios@0.21.4","_id":"axios@0.21.4","_inBundle":false,"_integrity":"sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==","_location":"/axios","_phantomChildren":{},"_requested":{"type":"version","registry":true,"raw":"axios@0.21.4","name":"axios","escapedName":"axios","rawSpec":"0.21.4","saveSpec":null,"fetchSpec":"0.21.4"},"_requiredBy":["/"],"_resolved":"https://registry.npmjs.org/axios/-/axios-0.21.4.tgz","_spec":"0.21.4","_where":"/home/vitaly/Documents/work/gudhubclient/override_npm/gudhub","author":{"name":"Matt Zabriskie"},"browser":{"./lib/adapters/http.js":"./lib/adapters/xhr.js"},"bugs":{"url":"https://github.com/axios/axios/issues"},"bundlesize":[{"path":"./dist/axios.min.js","threshold":"5kB"}],"dependencies":{"follow-redirects":"^1.14.0"},"description":"Promise based HTTP client for the browser and node.js","devDependencies":{"coveralls":"^3.0.0","es6-promise":"^4.2.4","grunt":"^1.3.0","grunt-banner":"^0.6.0","grunt-cli":"^1.2.0","grunt-contrib-clean":"^1.1.0","grunt-contrib-watch":"^1.0.0","grunt-eslint":"^23.0.0","grunt-karma":"^4.0.0","grunt-mocha-test":"^0.13.3","grunt-ts":"^6.0.0-beta.19","grunt-webpack":"^4.0.2","istanbul-instrumenter-loader":"^1.0.0","jasmine-core":"^2.4.1","karma":"^6.3.2","karma-chrome-launcher":"^3.1.0","karma-firefox-launcher":"^2.1.0","karma-jasmine":"^1.1.1","karma-jasmine-ajax":"^0.1.13","karma-safari-launcher":"^1.0.0","karma-sauce-launcher":"^4.3.6","karma-sinon":"^1.0.5","karma-sourcemap-loader":"^0.3.8","karma-webpack":"^4.0.2","load-grunt-tasks":"^3.5.2","minimist":"^1.2.0","mocha":"^8.2.1","sinon":"^4.5.0","terser-webpack-plugin":"^4.2.3","typescript":"^4.0.5","url-search-params":"^0.10.0","webpack":"^4.44.2","webpack-dev-server":"^3.11.0"},"homepage":"https://axios-http.com","jsdelivr":"dist/axios.min.js","keywords":["xhr","http","ajax","promise","node"],"license":"MIT","main":"index.js","name":"axios","repository":{"type":"git","url":"git+https://github.com/axios/axios.git"},"scripts":{"build":"NODE_ENV=production grunt build","coveralls":"cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js","examples":"node ./examples/server.js","fix":"eslint --fix lib/**/*.js","postversion":"git push && git push --tags","preversion":"npm test","start":"node ./sandbox/server.js","test":"grunt test","version":"npm run build && grunt version && git add -A dist && git add CHANGELOG.md bower.json package.json"},"typings":"./index.d.ts","unpkg":"dist/axios.min.js","version":"0.21.4"}')}),L("g2liO",function(n,e){function t(r){this.message=r}t.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},t.prototype.__CANCEL__=!0,n.exports=t}),L("14PRn",function(n,e){var t=A("g2liO");function r(a){if(typeof a!="function")throw TypeError("executor must be a function.");this.promise=new Promise(function(s){i=s});var i,l=this;a(function(s){l.reason||(l.reason=new t(s),i(l.reason))})}r.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},r.source=function(){var a;return{token:new r(function(i){a=i}),cancel:a}},n.exports=r}),L("i3hBo",function(n,e){n.exports=function(t){return function(r){return t.apply(null,r)}}}),L("dhYWP",function(n,e){n.exports=function(t){return typeof t=="object"&&t.isAxiosError===!0}}),L("kfIQl",function(n,e){var t=typeof Symbol<"u"&&Symbol,r=A("lyEFc");n.exports=function(){return typeof t=="function"&&typeof Symbol=="function"&&typeof t("foo")=="symbol"&&typeof Symbol("bar")=="symbol"&&r()}}),L("lyEFc",function(n,e){n.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},r=Symbol("test"),a=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(a)!=="[object Symbol]")return!1;var i=42;for(r in t[r]=i,t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var l=Object.getOwnPropertySymbols(t);if(l.length!==1||l[0]!==r||!Object.prototype.propertyIsEnumerable.call(t,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var s=Object.getOwnPropertyDescriptor(t,r);if(s.value!==i||s.enumerable!==!0)return!1}return!0}}),L("bJ3CN",function(n,e){var t={__proto__:null,foo:{}},r=Object;n.exports=function(){return{__proto__:t}.foo===t.foo&&!(t instanceof r)}}),L("9cNUg",function(n,e){var t=A("hGGZx"),r=function(){return!!t};r.hasArrayLengthDefineBug=function(){if(!t)return null;try{return t([],"length",{value:1}).length!==1}catch{return!0}},n.exports=r}),L("hGGZx",function(n,e){var t=A("hMrGw")("%Object.defineProperty%",!0)||!1;if(t)try{t({},"a",{value:1})}catch{t=!1}n.exports=t}),L("hMrGw",function(n,e){var t=A("dUpie"),r=A("48xLS"),a=A("4Vqmv"),i=A("7x6DQ"),l=A("kPNod"),s=A("b9GfH"),u=A("8DBKi"),o=Function,p=function(H){try{return o('"use strict"; return ('+H+").constructor;")()}catch{}},m=Object.getOwnPropertyDescriptor;if(m)try{m({},"")}catch{m=null}var d=function(){throw new s},y=m?function(){try{return arguments.callee,d}catch{try{return m(arguments,"callee").get}catch{return d}}}():d,f=A("kfIQl")(),S=A("bJ3CN")(),v=Object.getPrototypeOf||(S?function(H){return H.__proto__}:null),w={},g=typeof Uint8Array<"u"&&v?v(Uint8Array):void 0,_={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?void 0:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?void 0:ArrayBuffer,"%ArrayIteratorPrototype%":f&&v?v([][Symbol.iterator]()):void 0,"%AsyncFromSyncIteratorPrototype%":void 0,"%AsyncFunction%":w,"%AsyncGenerator%":w,"%AsyncGeneratorFunction%":w,"%AsyncIteratorPrototype%":w,"%Atomics%":typeof Atomics>"u"?void 0:Atomics,"%BigInt%":typeof BigInt>"u"?void 0:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?void 0:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?void 0:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?void 0:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":t,"%eval%":eval,"%EvalError%":r,"%Float32Array%":typeof Float32Array>"u"?void 0:Float32Array,"%Float64Array%":typeof Float64Array>"u"?void 0:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?void 0:FinalizationRegistry,"%Function%":o,"%GeneratorFunction%":w,"%Int8Array%":typeof Int8Array>"u"?void 0:Int8Array,"%Int16Array%":typeof Int16Array>"u"?void 0:Int16Array,"%Int32Array%":typeof Int32Array>"u"?void 0:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":f&&v?v(v([][Symbol.iterator]())):void 0,"%JSON%":typeof JSON=="object"?JSON:void 0,"%Map%":typeof Map>"u"?void 0:Map,"%MapIteratorPrototype%":typeof Map<"u"&&f&&v?v(new Map()[Symbol.iterator]()):void 0,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?void 0:Promise,"%Proxy%":typeof Proxy>"u"?void 0:Proxy,"%RangeError%":a,"%ReferenceError%":i,"%Reflect%":typeof Reflect>"u"?void 0:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?void 0:Set,"%SetIteratorPrototype%":typeof Set<"u"&&f&&v?v(new Set()[Symbol.iterator]()):void 0,"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?void 0:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":f&&v?v(""[Symbol.iterator]()):void 0,"%Symbol%":f?Symbol:void 0,"%SyntaxError%":l,"%ThrowTypeError%":y,"%TypedArray%":g,"%TypeError%":s,"%Uint8Array%":typeof Uint8Array>"u"?void 0:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?void 0:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?void 0:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?void 0:Uint32Array,"%URIError%":u,"%WeakMap%":typeof WeakMap>"u"?void 0:WeakMap,"%WeakRef%":typeof WeakRef>"u"?void 0:WeakRef,"%WeakSet%":typeof WeakSet>"u"?void 0:WeakSet};if(v)try{null.error}catch(H){var $=v(v(H));_["%Error.prototype%"]=$}var x=function H(ie){var ee;if(ie==="%AsyncFunction%")ee=p("async function () {}");else if(ie==="%GeneratorFunction%")ee=p("function* () {}");else if(ie==="%AsyncGeneratorFunction%")ee=p("async function* () {}");else if(ie==="%AsyncGenerator%"){var k=H("%AsyncGeneratorFunction%");k&&(ee=k.prototype)}else if(ie==="%AsyncIteratorPrototype%"){var O=H("%AsyncGenerator%");O&&v&&(ee=v(O.prototype))}return _[ie]=ee,ee},T={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},P=A("hweMw"),D=A("23C6u"),R=P.call(Function.call,Array.prototype.concat),I=P.call(Function.apply,Array.prototype.splice),F=P.call(Function.call,String.prototype.replace),C=P.call(Function.call,String.prototype.slice),B=P.call(Function.call,RegExp.prototype.exec),V=/[^%.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|(["'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|%$))/g,X=/\\\\(\\\\)?/g,oe=function(H){var ie=C(H,0,1),ee=C(H,-1);if(ie==="%"&&ee!=="%")throw new l("invalid intrinsic syntax, expected closing \`%\`");if(ee==="%"&&ie!=="%")throw new l("invalid intrinsic syntax, expected opening \`%\`");var k=[];return F(H,V,function(O,N,K,se){k[k.length]=K?F(se,X,"$1"):N||O}),k},we=function(H,ie){var ee,k=H;if(D(T,k)&&(k="%"+(ee=T[k])[0]+"%"),D(_,k)){var O=_[k];if(O===w&&(O=x(k)),O===void 0&&!ie)throw new s("intrinsic "+H+" exists, but is not available. Please file an issue!");return{alias:ee,name:k,value:O}}throw new l("intrinsic "+H+" does not exist!")};n.exports=function(H,ie){if(typeof H!="string"||H.length===0)throw new s("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof ie!="boolean")throw new s('"allowMissing" argument must be a boolean');if(B(/^%?[^%]*%?$/,H)===null)throw new l("\`%\` may not be present anywhere but at the beginning and end of the intrinsic name");var ee=oe(H),k=ee.length>0?ee[0]:"",O=we("%"+k+"%",ie),N=O.name,K=O.value,se=!1,te=O.alias;te&&(k=te[0],I(ee,R([0,1],te)));for(var J=1,ce=!0;J<ee.length;J+=1){var re=ee[J],fe=C(re,0,1),Ae=C(re,-1);if((fe==='"'||fe==="'"||fe==="\`"||Ae==='"'||Ae==="'"||Ae==="\`")&&fe!==Ae)throw new l("property names with quotes must have matching quotes");if(re!=="constructor"&&ce||(se=!0),k+="."+re,D(_,N="%"+k+"%"))K=_[N];else if(K!=null){if(!(re in K)){if(!ie)throw new s("base intrinsic for "+H+" exists, but the property is not available.");return}if(m&&J+1>=ee.length){var Ie=m(K,re);K=(ce=!!Ie)&&"get"in Ie&&!("originalValue"in Ie.get)?Ie.get:K[re]}else ce=D(K,re),K=K[re];ce&&!se&&(_[N]=K)}}return K}}),L("dUpie",function(n,e){n.exports=Error}),L("48xLS",function(n,e){n.exports=EvalError}),L("4Vqmv",function(n,e){n.exports=RangeError}),L("7x6DQ",function(n,e){n.exports=ReferenceError}),L("kPNod",function(n,e){n.exports=SyntaxError}),L("b9GfH",function(n,e){n.exports=TypeError}),L("8DBKi",function(n,e){n.exports=URIError}),L("hweMw",function(n,e){var t=A("2Eytq");n.exports=Function.prototype.bind||t}),L("2Eytq",function(n,e){var t="Function.prototype.bind called on incompatible ",r=Object.prototype.toString,a=Math.max,i="[object Function]",l=function(o,p){for(var m=[],d=0;d<o.length;d+=1)m[d]=o[d];for(var y=0;y<p.length;y+=1)m[y+o.length]=p[y];return m},s=function(o,p){for(var m=[],d=p,y=0;d<o.length;d+=1,y+=1)m[y]=o[d];return m},u=function(o,p){for(var m="",d=0;d<o.length;d+=1)m+=o[d],d+1<o.length&&(m+=p);return m};n.exports=function(o){var p,m=this;if(typeof m!="function"||r.apply(m)!==i)throw TypeError(t+m);for(var d=s(arguments,1),y=function(){if(this instanceof p){var g=m.apply(this,l(d,arguments));return Object(g)===g?g:this}return m.apply(o,l(d,arguments))},f=a(0,m.length-d.length),S=[],v=0;v<f;v++)S[v]="$"+v;if(p=Function("binder","return function ("+u(S,",")+"){ return binder.apply(this,arguments); }")(y),m.prototype){var w=function(){};w.prototype=m.prototype,p.prototype=new w,w.prototype=null}return p}}),L("23C6u",function(n,e){var t=Function.prototype.call,r=Object.prototype.hasOwnProperty,a=A("hweMw");n.exports=a.call(t,r)}),L("5ZWAZ",function(n,e){function t(r){return n.exports=t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(a){return typeof a}:function(a){return a&&typeof Symbol=="function"&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},n.exports.__esModule=!0,n.exports.default=n.exports,t(r)}n.exports=t,n.exports.__esModule=!0,n.exports.default=n.exports}),L("fgq5y",function(n,e){var t=A("f3Ywx").default;Object.defineProperty(n.exports,"__esModule",{value:!0}),n.exports.default=l;var r=t(A("a9VQw")),a=t(A("glRwo")),i=t(A("ayR3G"));function l(s,u){(0,i.default)(2,arguments);var o=(0,a.default)(s),p=(0,r.default)(u);return isNaN(p)?new Date(NaN):(p&&o.setDate(o.getDate()+p),o)}n.exports=n.exports.default}),L("f3Ywx",function(n,e){function t(r){return r&&r.__esModule?r:{default:r}}n.exports=t,n.exports.__esModule=!0,n.exports.default=n.exports}),L("a9VQw",function(n,e){function t(r){if(r===null||r===!0||r===!1)return NaN;var a=Number(r);return isNaN(a)?a:a<0?Math.ceil(a):Math.floor(a)}Object.defineProperty(n.exports,"__esModule",{value:!0}),n.exports.default=t,n.exports=n.exports.default}),L("glRwo",function(n,e){var t=A("f3Ywx").default;Object.defineProperty(n.exports,"__esModule",{value:!0}),n.exports.default=i;var r=t(A("5ZWAZ")),a=t(A("ayR3G"));function i(l){(0,a.default)(1,arguments);var s=Object.prototype.toString.call(l);return l instanceof Date||(0,r.default)(l)==="object"&&s==="[object Date]"?new Date(l.getTime()):typeof l=="number"||s==="[object Number]"?new Date(l):((typeof l=="string"||s==="[object String]")&&typeof console<"u"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use \`parseISO\` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn(Error().stack)),new Date(NaN))}n.exports=n.exports.default}),L("ayR3G",function(n,e){function t(r,a){if(a.length<r)throw TypeError(r+" argument"+(r>1?"s":"")+" required, but only "+a.length+" present")}Object.defineProperty(n.exports,"__esModule",{value:!0}),n.exports.default=t,n.exports=n.exports.default}),L("byyO9",function(n,e){var t=A("f3Ywx").default;Object.defineProperty(n.exports,"__esModule",{value:!0}),n.exports.default=l;var r=t(A("a9VQw")),a=t(A("glRwo")),i=t(A("ayR3G"));function l(s,u){(0,i.default)(2,arguments);var o=(0,a.default)(s),p=(0,r.default)(u);if(isNaN(p))return new Date(NaN);if(!p)return o;var m=o.getDate(),d=new Date(o.getTime());return d.setMonth(o.getMonth()+p+1,0),m>=d.getDate()?d:(o.setFullYear(d.getFullYear(),d.getMonth(),m),o)}n.exports=n.exports.default}),L("hLz6R",function(n,e){var t=A("f3Ywx").default;Object.defineProperty(n.exports,"__esModule",{value:!0}),n.exports.default=s;var r=t(A("glRwo")),a=t(A("a9VQw")),i=t(A("ayR3G")),l=A("lmyOi");function s(u,o){(0,i.default)(1,arguments);var p,m,d,y,f,S,v,w,g=(0,l.getDefaultOptions)(),_=(0,a.default)((p=(m=(d=(y=o==null?void 0:o.weekStartsOn)!==null&&y!==void 0?y:o==null||(f=o.locale)===null||f===void 0||(S=f.options)===null||S===void 0?void 0:S.weekStartsOn)!==null&&d!==void 0?d:g.weekStartsOn)!==null&&m!==void 0?m:(v=g.locale)===null||v===void 0||(w=v.options)===null||w===void 0?void 0:w.weekStartsOn)!==null&&p!==void 0?p:0);if(!(_>=0&&_<=6))throw RangeError("weekStartsOn must be between 0 and 6 inclusively");var $=(0,r.default)(u),x=$.getDay(),T=(x<_?7:0)+x-_;return $.setDate($.getDate()-T),$.setHours(0,0,0,0),$}n.exports=n.exports.default}),L("lmyOi",function(n,e){Object.defineProperty(n.exports,"__esModule",{value:!0}),n.exports.getDefaultOptions=r,n.exports.setDefaultOptions=a;var t={};function r(){return t}function a(i){t=i}}),L("kmcAT",function(n,e){A("akXK4"),A("5xozB")}),L("akXK4",function(n,e){n.exports=A("1ufAB")}),L("5xozB",function(n,e){Pr(n.exports,"IS_BROWSER_MAIN_THREAD",()=>r),Pr(n.exports,"IS_BROWSER",()=>i);var t=A("2dKjk");let r=typeof window<"u"&&typeof document<"u",a=typeof self=="object"&&typeof WorkerGlobalScope<"u",i=r||a;t!==void 0&&t.versions!=null&&t.versions.node});var me=A("5xozB");let ca="https://gudhub.com/GudHub_Test",ua="wss://gudhub.com/GudHub/ws/app/",pa="https://gudhub.com/api/services/prod",da="build/latest/async_modules_node/",fa="build/latest/automation_modules/",ha="https://gudhub.com",Cr=!0,Nr=!1,Ke=!0;me.IS_BROWSER||(Ke=!1);var me=A("5xozB");class Mr{}class $t extends Mr{constructor(e,t,r){super(),this.chunkDataService=new vt(e,Gt,r),this.gudhub=r}isWithCache(){return!1}async processRequestedApp(e,t){if(!this.isWithCache()){let r=await this.chunkDataService.getMergedChunkForIDList(e,t.chunks);return r&&(t.items_list=await this.gudhub.util.mergeChunks([r,t])),t}}}class ma{constructor(e){this.req=e}async getApp(e){return this.req.get({url:"/api/app/get",params:{app_id:e}})}}let Rr=(n,...e)=>{for(let t of e)if(t)for(let r of Object.keys(t)){let a=Object.getOwnPropertyDescriptor(t,r);a.enumerable&&Object.defineProperty(n,r,a)}};class St{}class He extends $t{constructor(e,t,r){super(e,t,r),this.appApi=new ma(e),Rr(this,new St(t))}async getApp(e){let t=await this.appApi.getApp(e);return this.processRequestedApp(e,t)}async getAppWithoutProcessing(e){return this.appApi.getApp(e)}async putApp(e,t){}static[Symbol.hasInstance](e){try{return e instanceof He||e instanceof St}catch{return!1}}}class Fr extends Mr{getMergedChunkForIDList(e){}isWithCache(){return!1}}class ga{constructor(e){this.req=e}async getChunk(e,t){return this.req.get({url:\`\${this.req.root}/api/get-items-chunk/\${e}/\${t}\`,method:"GET"})}async getLastChunk(e){return this.req.axiosRequest({url:\`\${this.req.root}/api/get-last-items-chunk/\${e}\`,method:"GET"})}}class xt extends Fr{constructor(e,t){super(),this.chunkApi=new ga(e),Rr(this,new St(t))}async getChunk(e,t){return this.chunkApi.getChunk(e,t)}async getChunksForId(e){return[]}getCachedMergedChunk(e,t){}getMergedChunkForIDList(e,t){}putChunk(){}static[Symbol.hasInstance](e){try{return e instanceof xt||e instanceof St}catch{return!1}}}let Et={store:"apps"},Ht={store:"chunks"},ya="gudhub",zt={store:"chunksMergeCache"};class _a{}class ze extends _a{constructor(e,t){if(ze.dbNameToInstanceMap||(ze.dbNameToInstanceMap=new Map),ze.dbNameToInstanceMap.has(e))return ze.dbNameToInstanceMap.get(e);this.db=null,this.dbName=e,this.storeNameList=t,ze.dbNameToInstanceMap.set(e,this)}async checkAndCreateStore(e){let t=(await indexedDB.databases()).find(i=>i.name===this.dbName),r=!1,a=this;return t&&(r=await new Promise((i,l)=>{let s=indexedDB.open(a.dbName);s.onsuccess=function(u){let o=u.target.result,p=o.objectStoreNames.contains(e);o.close(),i(p)},s.onerror=function(u){l(u.target.error)}})),!!r||new Promise((i,l)=>{let s=indexedDB.open(a.dbName,t?t.version+1:1);s.onupgradeneeded=function(u){let o=u.target.result;o.objectStoreNames.contains(e)||o.createObjectStore(e)},s.onsuccess=function(u){u.target.result.close(),i()},s.onerror=l})}async openDB(){let e,t;if(this.db)return this.db;let r=new Promise((l,s)=>{e=l,t=s});for(let l of this.storeNameList)await this.checkAndCreateStore(l);let a=this,i=indexedDB.open(this.dbName);return i.onsuccess=l=>{a.db=l.target.result,e(this.db)},i.onerror=t,r}async executeOperation(e,t){let r=await this.openDB();return new Promise((a,i)=>{let l=r.transaction(e,"readwrite"),s=l.objectStore(e);l.oncomplete=()=>a(),l.onerror=u=>i(\`Transaction failed: \${u.target.error}\`);try{t(s)}catch(u){i(\`Operation failed: \${u.message}\`)}})}}let Lr=new ze(ya,[Et.store,Ht.store,zt.store]);class Dr{constructor(e,t){this.storeBackend=e,this.storeName=t}async addItem(e,t){return new Promise(async(r,a)=>{this.storeBackend.executeOperation(this.storeName,i=>{let l=i.add(t,e);l.onsuccess=r,l.onerror=a})})}async putItem(e,t){return new Promise(async(r,a)=>{this.storeBackend.executeOperation(this.storeName,i=>{let l=i.put(t,e);l.onsuccess=r,l.onerror=a})})}async hasItem(e){try{return!!await this.getItem(e)}catch{return!1}}async getItem(e){return new Promise(async(t,r)=>{this.storeBackend.executeOperation(this.storeName,a=>{let i=a.get(e);i.onsuccess=()=>{t(i.result)},i.onerror=r})})}async updateItem(e,t){return new Promise(async(r,a)=>{this.storeBackend.executeOperation(this.storeName,i=>{let l=i.get(e);l.onsuccess=()=>{let s=l.result;Object.assign(s,t),i.put(s,e),r()},l.onerror=a})})}async deleteItem(e){return new Promise(async(t,r)=>{this.storeBackend.executeOperation(this.storeName,a=>{let i=a.delete(e);i.onsuccess=t,i.onerror=r})})}}class qr extends Dr{constructor(){super(Lr,Et.store)}async getApp(e){return this.getItem(e)}async addApp(e,t){return this.addItem(e,t)}async putApp(e,t){return this.putItem(e,t)}async hasApp(e){return this.hasItem(e)}async deleteApp(e){return this.deleteItem(e)}}class ba extends Dr{constructor(){super(Lr,zt.store)}async get(e){return this.getItem(e)}async add(e,t){return this.addItem(e,t)}async put(e,t){return this.putItem(e,t)}async delete(e){return this.deleteItem(e)}}class st extends Fr{constructor(e,t,r){super(e,t),this.dataService=new xt(e),this.requestCache=new Map,this.gudhub=r,this.storeManager=new ba}static[Symbol.hasInstance](e){try{return e instanceof st}catch{return!1}}async getCachedMergedChunk(e,t){try{return(await this.storeManager.get(e)).mergedData}catch{let a=t.map(s=>this.dataService.getChunk(e,s)),i=await Promise.all(a),l=await this.gudhub.util.mergeChunks(i);return this.putMergedChunks(e,{hashes:t,mergedData:{items_list:l}}),{items_list:l}}}isWithCache(){return!0}async getMergedChunkForApp(e){}async getMergedChunkForIDList(e,t){try{let r,a=!0,i=await this.storeManager.get(e);try{if(t.length<i.hashes.length)throw Error();for(let u of i.hashes)t.indexOf(u)!=i.hashes.indexOf(u)&&(a=!1)}catch{a=!1}let l=[],s=[];if(t.length>i.hashes.length&&(l=t.slice(i.hashes.length)),a||(l=t),l.length>0){let u=l.map(o=>this.dataService.getChunk(e,o));s=await Promise.all(u)}return a||(r=await this.gudhub.util.mergeChunks([...s])),a&&(r=await this.gudhub.util.mergeChunks([i.mergedData,...s])),l.length>0&&this.putMergedChunks(e,{hashes:t,mergedData:{items_list:r}}),{items_list:r}}catch{let a=t.map(s=>this.dataService.getChunk(e,s)),i=await Promise.all(a),l=await this.gudhub.util.mergeChunks(i);return this.putMergedChunks(e,{hashes:t,mergedData:{items_list:l}}),{items_list:l}}}async putMergedChunks(e,t){return this.storeManager.put(e,t)}}let xe={INIT:1,REQUEST_APP:2,PROCESS_DATA:3,DECLINE_PROCESS_DATA_REQUEST:4};class Vt extends $t{constructor(e,t,r){super(e,t,r),this.dataService=new He(e,t,r),this.requestCache=new Map,this.gudhub=r,this.resolveFnMap=new Map,this.appRequestAndProcessWorker=new AppRequestWorkerScript,this.appRequestAndProcessWorker.postMessage({type:xe.INIT,gudhubSerialized:this.gudhub.serialized});let a=this;this.appRequestAndProcessWorker.onerror=function(i){},this.appRequestAndProcessWorker.onmessage=function(i){i.data.type==xe.REQUEST_APP&&a.resolveFnMap.has(i.data.id)&&a.resolveFnMap.get(i.data.id)(i.data.data),i.data.type==xe.PROCESS_DATA&&(a.gudhub.itemProcessor.handleDiff(i.data.id,i.data.compareRes),(i.data.viewListChanged||i.data.fieldListChanged)&&a.gudhub.appProcessor.updateAppFieldsAndViews(i.data.newVersion))},this.isWithCache(),this.storeManager=new qr}static[Symbol.hasInstance](e){try{return e instanceof Vt}catch{return!1}}isWithCache(){return!0}async getApp(e){if(this.requestCache.has(e))return this.requestCache.get(e);let t=this;await this.has(e);{let r=new Promise((a,i)=>{t.resolveFnMap.set(e,a)});return this.requestCache.set(e,r),this.appRequestAndProcessWorker.postMessage({type:xe.REQUEST_APP,id:e}),r}}async getCached(e){return this.storeManager.getApp(e)}async has(e){try{return this.storeManager.hasApp(e)}catch{}}async putApp(e,t){return this.storeManager.putApp(e,t)}}class Br extends $t{constructor(e,t,r){super(e,t,r),this.dataService=new He(e,null,r),this.requestCache=new Map,this.gudhub=r}isWithCache(){return!1}async getAppWithoutProcessing(e){let t=await this.dataService.getAppWithoutProcessing(e);return await this.putApp(e,t),t}async getApp(e){let t;if(this.requestCache.has(e))return this.requestCache.get(e);let r=new Promise((l,s)=>{t=l});this.requestCache.set(e,r);let a=await this.dataService.getAppWithoutProcessing(e),i=await this.processRequestedApp(e,a);return t(i),i}async has(e){return!1}async getCached(e){throw Error()}async putApp(e,t){throw Error()}}class va extends $t{constructor(e,t,r){super(e,t,r),this.dataService=new He(e,t,r),this.requestCache=new Map,this.gudhub=r,this.resolveFnMap=new Map,this.appRequestAndProcessWorker=new AppRequestWorkerScript,this.appRequestAndProcessWorker.postMessage({type:xe.INIT,gudhubSerialized:this.gudhub.serialized});let a=this;this.appRequestAndProcessWorker.onerror=function(i){},this.appRequestAndProcessWorker.onmessage=function(i){i.data.type==xe.REQUEST_APP&&a.resolveFnMap.has(i.data.id)&&a.resolveFnMap.get(i.data.id)(i.data.data),i.data.type==xe.PROCESS_DATA&&(a.gudhub.itemProcessor.handleDiff(i.data.id,i.data.compareRes),(i.data.viewListChanged||i.data.fieldListChanged)&&a.gudhub.appProcessor.updateAppFieldsAndViews(i.data.newVersion))},this.isWithCache(),this.storeManager=new qr}static[Symbol.hasInstance](e){try{return e instanceof Vt}catch{return!1}}isWithCache(){return!1}async getApp(e){if(this.requestCache.has(e))return this.requestCache.get(e);let t=new Promise((r,a)=>{self.resolveFnMap.set(e,r)});return this.requestCache.set(e,t),this.appRequestAndProcessWorker.postMessage({type:xe.REQUEST_APP,id:e}),t}async getCached(e){return this.storeManager.getApp(e)}async has(e){try{return this.storeManager.hasApp(e)}catch{}}async putApp(e,t){return this.storeManager.putApp(e,t)}}A("5xozB"),me.IS_BROWSER,me.IS_BROWSER&&Ke&&(Ut=va,Tr=Et),me.IS_BROWSER||(Ut=He),Ke&&(Ur=Br),me.IS_BROWSER&&Cr&&!Ke&&(vt=st,Gt=Ht),me.IS_BROWSER&&Cr&&Ke&&(vt=st,Gt=Ht),me.IS_BROWSER||(vt=xt);let Ur=Br,wa=st;var me=A("5xozB");class Gr{constructor(e,t,r,a,i,l,s){this.storage=e,this.pipeService=t,this.req=r,this.ws=a,this.applistReceived=!1,this.activateSW=l,this.util=i,this.appListeners(),this.dataService=s,this.appRequestCache=new Map}async createNewAppApi(e){try{let t=await this.req.post({url:"/api/app/create",form:{app:JSON.stringify(e)}});return t.from_apps_list=!0,t}catch(t){return console.log(t),null}}async updateAppApi(e){try{return await this.req.post({url:"/api/app/update",form:{app:JSON.stringify(e)}})}catch(t){return console.log(t),null}}async deleteAppApi(e){try{return await this.req.post({url:"/api/app/delete",form:{app_id:e}})}catch(t){return console.log(t),null}}async getAppListApi(){try{return(await this.req.get({url:"/api/applist/get"})).apps_list.map(e=>(e.from_apps_list=!0,e))}catch(e){return console.log(e),null}}getAppListFromStorage(){return this.storage.getAppsList()}getAppFromStorage(e){let t=this.storage.getApp(e);return t&&t.field_list.length?t:null}addNewAppToStorage(e){return this.storage.getAppsList().push(e)}saveAppInStorage(e){e.items_object={};for(let r=0;r<e.items_list.length;r++){e.items_object[e.items_list[r].item_id]={};for(let a=0;a<e.items_list[r].fields.length;a++)e.items_object[e.items_list[r].item_id][e.items_list[r].fields[a].field_id]=e.items_list[r].fields[a]}let t=this.storage.getApp(e.app_id);return t?(e.from_apps_list=t.from_apps_list,e.permission=t.permission,this.storage.updateApp(e)):(e.from_apps_list=!1,this.addNewAppToStorage(e)),this.getAppFromStorage(e.app_id)}updateAppFieldsAndViews(e){let t=this.getAppFromStorage(e.app_id);e.items_list=t.items_list,e.file_list=t.file_list,e.from_apps_list=t.from_apps_list,e.items_object=t.items_object,this.storage.updateApp(e),this.pipeService.emit("gh_app_views_update",{app_id:e.app_id},e.views_list),e.field_list.forEach(r=>{this.pipeService.emit("gh_model_update",{app_id:e.app_id,field_id:r.field_id},r)})}updateAppInStorage(e){this.storage.getApp(e.app_id)?(this.storage.updateApp(e),this.pipeService.emit("gh_app_update",{app_id:e.app_id},e),this.pipeService.emit("gh_items_update",{app_id:e.app_id},e.items_list)):this.addNewAppToStorage(e)}deletingAppFromStorage(e){let t=this.storage.getAppsList();return t.forEach((r,a)=>{r.app_id==e&&t.splice(a)}),t}updateAppsListInStorage(e=[]){for(let t of e){let r=this.storage.getApp(t.app_id);r?(r.from_apps_list=t.from_apps_list,r.permission=t.permission):this.addNewAppToStorage(t)}}async refreshApps(e=[]){for(let t of e)if(t!=null)try{let r=await this.dataService.getApp(t);if(r){r.items_object={};for(let a=0;a<r.items_list.length;a++){r.items_object[r.items_list[a].item_id]={};for(let i=0;i<r.items_list[a].fields.length;i++)r.items_object[r.items_list[a].item_id][r.items_list[a].fields[i].field_id]=r.items_list[a].fields[i]}this.updateAppInStorage(r),this.pipeService.emit("gh_app_views_update",{app_id:r.app_id},r.views_list)}}catch(r){console.log(r)}console.log("Apps refreshed: ",JSON.stringify(e))}async refreshAppsList(){let e=this.getAppListFromStorage(),t=(await this.getAppListApi()).map(r=>({...r,...e.find(a=>a.app_id===r.app_id)}));this.updateAppsListInStorage(t),this.pipeService.emit("gh_apps_list_refreshed",{})}async getAppsList(){let e=this.getAppListFromStorage();if(!this.applistReceived){let t=await this.getAppListApi();if(!t)return null;this.updateAppsListInStorage(t),this.applistReceived=!0,e=t}return e}async getAppInfo(e){let t=await this.getAppsList();return t?t.find(r=>r.app_id==e):null}async deleteApp(e){return await this.deleteAppApi(e),this.deletingAppFromStorage(e)}async getApp(e,t=!1){if(!e)return null;let r=this.getAppFromStorage(e);if(r)return r;if(this.appRequestCache.has(e))return this.appRequestCache.get(e);let a=this,i=new Promise(async(l,s)=>{try{let u=await a.dataService.getApp(e);u||s();let o=t?u:{...u,items_list:u.items_list.filter(p=>!p.trash)};o=t?o:{...o,field_list:o.field_list.filter(p=>!p.trash)},l(o),a.saveAppInStorage(o),a.ws.addSubscription(e)}catch{s()}});return a.appRequestCache.set(e,i),i}async updateApp(e){if(!e.views_list||!e.views_list.length||!e.show){let r=await this.getApp(e.app_id);e.views_list&&e.views_list.length||(e.views_list=r.views_list),e.show===void 0&&(e.show=r.show)}let t=await this.updateAppApi(e);return this.updateAppFieldsAndViews(t),t}async updateAppInfo(e={}){return this.pipeService.emit("gh_app_info_update",{app_id:e.app_id},e),this.updateApp(e)}async createNewApp(e){let t=await this.createNewAppApi(e);return t.items_object={},this.addNewAppToStorage(t),t}async getAppViews(e){if(e)return(await this.getApp(e)).views_list}clearAppProcessor(){this.getAppListPromises=null,this.getAppPromises={},this.applistReceived=!1}appListeners(){this.pipeService.onRoot("gh_app_get",{},async(e,t)=>{if(t&&t.app_id){let r=await this.getApp(t.app_id);this.pipeService.emit("gh_app_get",t,r)}}),this.pipeService.onRoot("gh_apps_list_get",{},async(e,t)=>{let r=await this.getAppsList();this.pipeService.emit("gh_apps_list_get",t,r)}),this.pipeService.onRoot("gh_delete_app",{},async(e,t)=>{let r=await this.deleteApp(t.app_id);this.pipeService.emit("gh_apps_list_update",{recipient:"all"},r)}),this.pipeService.onRoot("gh_app_update",{},async(e,t)=>{t.app.items_list=[],t.app.file_list=[];let r=await this.updateApp(t.app);this.pipeService.emit("gh_app_views_update",{app_id:r.app_id},r.views_list);let a=await this.getAppsList();this.pipeService.emit("gh_apps_list_update",{recipient:"all"},a),r.field_list.forEach(i=>{this.pipeService.emit("gh_model_update",{app_id:r.app_id,field_id:i.field_id},i)})}),this.pipeService.onRoot("gh_app_view_get",{},async(e,t)=>{if(t&&t.app_id){let r=await this.getApp(t.app_id);r.views_list.forEach((a,i)=>{a.view_id==t.view_id&&this.pipeService.emit("gh_app_view_get",t,r.views_list[i])})}}),this.pipeService.onRoot("gh_app_info_get",{},async(e,t)=>{let r=await this.getAppInfo(t.app_id);r&&this.pipeService.emit("gh_app_info_get",t,r)}),this.pipeService.onRoot("gh_app_info_update",{},async(e,t)=>{if(t&&t.app){let r=await this.updateAppInfo(t.app);this.pipeService.emit("gh_app_info_update",{app_id:t.app.app_id},r)}}),this.pipeService.onRoot("gh_app_create",{},async(e,t)=>{await this.createNewApp(t.app);let r=await this.getAppsList();this.pipeService.emit("gh_apps_list_update",{recipient:"all"},r)}),me.IS_BROWSER_MAIN_THREAD&&this.activateSW&&navigator.serviceWorker.addEventListener("message",async e=>{if(e.data.type==="refresh app"){let t=await this.getApp(e.data.payload.app_id);t&&this.util.compareAppsItemsLists(t.items_list,e.data.payload.items_list.filter(r=>!r.trash),({diff_fields_items:r,diff_fields_items_Ids:a,diff_items:i,newItems:l,deletedItems:s})=>{(i.length||l.length||s.length)&&(this.pipeService.emit("gh_items_update",{app_id:e.data.payload.app_id},e.data.payload.items_list.filter(u=>!u.trash)),i.forEach(u=>this.pipeService.emit("gh_item_update",{app_id:e.data.payload.app_id,item_id:u.item_id},u))),a.forEach(u=>{let o=r[u];o&&o.forEach(p=>{this.pipeService.emit("gh_value_update",{app_id:e.data.payload.app_id,item_id:u,field_id:p.field_id},p.field_value)})})}),e.data.payload.items_list=await this.util.mergeChunks([t,e.data.payload]),this.saveAppInStorage(e.data.payload)}})}}var gt=A("akXK4");function Wr(n=[]){return n.filter(e=>e.field_value!=null)}function $a(n={}){let e=Object.entries(n);return e.length?\`&\${e.map(([t,r])=>\`\${t}=\${r}\`).join("&")}\`:""}var kt={},Hr={},Jt={},ve=A("hMrGw"),Ve={},ve=A("hMrGw"),ot={},Qt=A("hweMw"),ve=A("hMrGw"),zr={},ve=A("hMrGw"),Yt={},ct=A("hGGZx"),Sa=A("kPNod"),$e=A("b9GfH"),lt={},ve=A("hMrGw"),At=ve("%Object.getOwnPropertyDescriptor%",!0);if(At)try{At([],"length")}catch{At=null}lt=At,Yt=function(n,e,t){if(!n||typeof n!="object"&&typeof n!="function")throw new $e("\`obj\` must be an object or a function\`");if(typeof e!="string"&&typeof e!="symbol")throw new $e("\`property\` must be a string or a symbol\`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new $e("\`nonEnumerable\`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new $e("\`nonWritable\`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new $e("\`nonConfigurable\`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new $e("\`loose\`, if provided, must be a boolean");var r=arguments.length>3?arguments[3]:null,a=arguments.length>4?arguments[4]:null,i=arguments.length>5?arguments[5]:null,l=arguments.length>6&&arguments[6],s=!!lt&&lt(n,e);if(ct)ct(n,e,{configurable:i===null&&s?s.configurable:!i,enumerable:r===null&&s?s.enumerable:!r,value:t,writable:a===null&&s?s.writable:!a});else{if(!l&&(r||a||i))throw new Sa("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");n[e]=t}};var xa=A("9cNUg")(),$e=A("b9GfH"),Ea=ve("%Math.floor%");zr=function(n,e){if(typeof n!="function")throw new $e("\`fn\` is not a function");if(typeof e!="number"||e<0||e>4294967295||Ea(e)!==e)throw new $e("\`length\` must be a positive 32-bit integer");var t=arguments.length>2&&!!arguments[2],r=!0,a=!0;if("length"in n&&lt){var i=lt(n,"length");i&&!i.configurable&&(r=!1),i&&!i.writable&&(a=!1)}return(r||a||!t)&&(xa?Yt(n,"length",e,!0,!0):Yt(n,"length",e)),n};var $e=A("b9GfH"),Vr=ve("%Function.prototype.apply%"),Jr=ve("%Function.prototype.call%"),Qr=ve("%Reflect.apply%",!0)||Qt.call(Jr,Vr),ct=A("hGGZx"),ka=ve("%Math.max%");ot=function(n){if(typeof n!="function")throw new $e("a function is required");var e=Qr(Qt,Jr,arguments);return zr(e,1+ka(0,n.length-(arguments.length-1)),!0)};var Yr=function(){return Qr(Qt,Vr,arguments)};ct?ct(ot,"apply",{value:Yr}):ot.apply=Yr;var Aa=ot(ve("String.prototype.indexOf"));Ve=function(n,e){var t=ve(n,!!e);return typeof t=="function"&&Aa(n,".prototype.")>-1?ot(t):t};var Xr={},Xt=typeof Map=="function"&&Map.prototype,Kt=Object.getOwnPropertyDescriptor&&Xt?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,It=Xt&&Kt&&typeof Kt.get=="function"?Kt.get:null,Kr=Xt&&Map.prototype.forEach,Zt=typeof Set=="function"&&Set.prototype,er=Object.getOwnPropertyDescriptor&&Zt?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,Ot=Zt&&er&&typeof er.get=="function"?er.get:null,Zr=Zt&&Set.prototype.forEach,Ia=typeof WeakMap=="function"&&WeakMap.prototype,ut=Ia?WeakMap.prototype.has:null,Oa=typeof WeakSet=="function"&&WeakSet.prototype,pt=Oa?WeakSet.prototype.has:null,ja=typeof WeakRef=="function"&&WeakRef.prototype,en=ja?WeakRef.prototype.deref:null,Ta=Boolean.prototype.valueOf,Pa=Object.prototype.toString,Ca=Function.prototype.toString,Na=String.prototype.match,tr=String.prototype.slice,De=String.prototype.replace,Ma=String.prototype.toUpperCase,tn=String.prototype.toLowerCase,rn=RegExp.prototype.test,nn=Array.prototype.concat,je=Array.prototype.join,Ra=Array.prototype.slice,an=Math.floor,rr=typeof BigInt=="function"?BigInt.prototype.valueOf:null,nr=Object.getOwnPropertySymbols,ar=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,Ze=typeof Symbol=="function"&&typeof Symbol.iterator=="object",ye=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===Ze||!0)?Symbol.toStringTag:null,sn=Object.prototype.propertyIsEnumerable,on=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(n){return n.__proto__}:null);function ln(n,e){if(n===1/0||n===-1/0||n!=n||n&&n>-1e3&&n<1e3||rn.call(/e/,e))return e;var t=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof n=="number"){var r=n<0?-an(-n):an(n);if(r!==n){var a=String(r),i=tr.call(e,a.length+1);return De.call(a,t,"$&_")+"."+De.call(De.call(i,/([0-9]{3})/g,"$&_"),/_$/,"")}}return De.call(e,t,"$&_")}var ir={},cn=ir.custom,un=fn(cn)?cn:null;function pn(n,e,t){var r=(t.quoteStyle||e)==="double"?'"':"'";return r+n+r}function Fa(n){return De.call(String(n),/"/g,"&quot;")}function sr(n){return Be(n)==="[object Array]"&&(!ye||!(typeof n=="object"&&ye in n))}function La(n){return Be(n)==="[object Date]"&&(!ye||!(typeof n=="object"&&ye in n))}function dn(n){return Be(n)==="[object RegExp]"&&(!ye||!(typeof n=="object"&&ye in n))}function Da(n){return Be(n)==="[object Error]"&&(!ye||!(typeof n=="object"&&ye in n))}function qa(n){return Be(n)==="[object String]"&&(!ye||!(typeof n=="object"&&ye in n))}function Ba(n){return Be(n)==="[object Number]"&&(!ye||!(typeof n=="object"&&ye in n))}function Ua(n){return Be(n)==="[object Boolean]"&&(!ye||!(typeof n=="object"&&ye in n))}function fn(n){if(Ze)return n&&typeof n=="object"&&n instanceof Symbol;if(typeof n=="symbol")return!0;if(!n||typeof n!="object"||!ar)return!1;try{return ar.call(n),!0}catch{}return!1}function Ga(n){if(!n||typeof n!="object"||!rr)return!1;try{return rr.call(n),!0}catch{}return!1}Xr=function n(e,t,r,a){var i=t||{};if(qe(i,"quoteStyle")&&i.quoteStyle!=="single"&&i.quoteStyle!=="double")throw TypeError('option "quoteStyle" must be "single" or "double"');if(qe(i,"maxStringLength")&&(typeof i.maxStringLength=="number"?i.maxStringLength<0&&i.maxStringLength!==1/0:i.maxStringLength!==null))throw TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or \`null\`');var l=!qe(i,"customInspect")||i.customInspect;if(typeof l!="boolean"&&l!=="symbol")throw TypeError("option \\"customInspect\\", if provided, must be \`true\`, \`false\`, or \`'symbol'\`");if(qe(i,"indent")&&i.indent!==null&&i.indent!==" "&&!(parseInt(i.indent,10)===i.indent&&i.indent>0))throw TypeError('option "indent" must be "\\\\t", an integer > 0, or \`null\`');if(qe(i,"numericSeparator")&&typeof i.numericSeparator!="boolean")throw TypeError('option "numericSeparator", if provided, must be \`true\` or \`false\`');var s=i.numericSeparator;if(e===void 0)return"undefined";if(e===null)return"null";if(typeof e=="boolean")return e?"true":"false";if(typeof e=="string")return mn(e,i);if(typeof e=="number"){if(e===0)return 1/0/e>0?"0":"-0";var u=String(e);return s?ln(e,u):u}if(typeof e=="bigint"){var o=String(e)+"n";return s?ln(e,o):o}var p=i.depth===void 0?5:i.depth;if(r===void 0&&(r=0),r>=p&&p>0&&typeof e=="object")return sr(e)?"[Array]":"[Object]";var m=ei(i,r);if(a===void 0)a=[];else if(hn(a,e)>=0)return"[Circular]";function d(C,B,V){if(B&&(a=Ra.call(a)).push(B),V){var X={depth:i.depth};return qe(i,"quoteStyle")&&(X.quoteStyle=i.quoteStyle),n(C,X,r+1,a)}return n(C,i,r+1,a)}if(typeof e=="function"&&!dn(e)){var y=Ha(e),f=jt(e,d);return"[Function"+(y?": "+y:" (anonymous)")+"]"+(f.length>0?" { "+je.call(f,", ")+" }":"")}if(fn(e)){var S=Ze?De.call(String(e),/^(Symbol\\(.*\\))_[^)]*$/,"$1"):ar.call(e);return typeof e!="object"||Ze?S:dt(S)}if(Xa(e)){for(var v="<"+tn.call(String(e.nodeName)),w=e.attributes||[],g=0;g<w.length;g++)v+=" "+w[g].name+"="+pn(Fa(w[g].value),"double",i);return v+=">",e.childNodes&&e.childNodes.length&&(v+="..."),v+="</"+tn.call(String(e.nodeName))+">"}if(sr(e)){if(e.length===0)return"[]";var _=jt(e,d);return m&&!Za(_)?"["+lr(_,m)+"]":"[ "+je.call(_,", ")+" ]"}if(Da(e)){var $=jt(e,d);return"cause"in Error.prototype||!("cause"in e)||sn.call(e,"cause")?$.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+je.call($,", ")+" }":"{ ["+String(e)+"] "+je.call(nn.call("[cause]: "+d(e.cause),$),", ")+" }"}if(typeof e=="object"&&l){if(un&&typeof e[un]=="function"&&ir)return ir(e,{depth:p-r});if(l!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if(za(e)){var x=[];return Kr&&Kr.call(e,function(C,B){x.push(d(B,e,!0)+" => "+d(C,e))}),gn("Map",It.call(e),x,m)}if(Qa(e)){var T=[];return Zr&&Zr.call(e,function(C){T.push(d(C,e))}),gn("Set",Ot.call(e),T,m)}if(Va(e))return or("WeakMap");if(Ya(e))return or("WeakSet");if(Ja(e))return or("WeakRef");if(Ba(e))return dt(d(Number(e)));if(Ga(e))return dt(d(rr.call(e)));if(Ua(e))return dt(Ta.call(e));if(qa(e))return dt(d(String(e)));if(typeof window<"u"&&e===window)return"{ [object Window] }";if(e===le)return"{ [object globalThis] }";if(!La(e)&&!dn(e)){var P=jt(e,d),D=on?on(e)===Object.prototype:e instanceof Object||e.constructor===Object,R=e instanceof Object?"":"null prototype",I=!D&&ye&&Object(e)===e&&ye in e?tr.call(Be(e),8,-1):R?"Object":"",F=(D||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"")+(I||R?"["+je.call(nn.call([],I||[],R||[]),": ")+"] ":"");return P.length===0?F+"{}":m?F+"{"+lr(P,m)+"}":F+"{ "+je.call(P,", ")+" }"}return String(e)};var Wa=Object.prototype.hasOwnProperty||function(n){return n in this};function qe(n,e){return Wa.call(n,e)}function Be(n){return Pa.call(n)}function Ha(n){if(n.name)return n.name;var e=Na.call(Ca.call(n),/^function\\s*([\\w$]+)/);return e?e[1]:null}function hn(n,e){if(n.indexOf)return n.indexOf(e);for(var t=0,r=n.length;t<r;t++)if(n[t]===e)return t;return-1}function za(n){if(!It||!n||typeof n!="object")return!1;try{It.call(n);try{Ot.call(n)}catch{return!0}return n instanceof Map}catch{}return!1}function Va(n){if(!ut||!n||typeof n!="object")return!1;try{ut.call(n,ut);try{pt.call(n,pt)}catch{return!0}return n instanceof WeakMap}catch{}return!1}function Ja(n){if(!en||!n||typeof n!="object")return!1;try{return en.call(n),!0}catch{}return!1}function Qa(n){if(!Ot||!n||typeof n!="object")return!1;try{Ot.call(n);try{It.call(n)}catch{return!0}return n instanceof Set}catch{}return!1}function Ya(n){if(!pt||!n||typeof n!="object")return!1;try{pt.call(n,pt);try{ut.call(n,ut)}catch{return!0}return n instanceof WeakSet}catch{}return!1}function Xa(n){return!!n&&typeof n=="object"&&(typeof HTMLElement<"u"&&n instanceof HTMLElement||typeof n.nodeName=="string"&&typeof n.getAttribute=="function")}function mn(n,e){if(n.length>e.maxStringLength){var t=n.length-e.maxStringLength,r="... "+t+" more character"+(t>1?"s":"");return mn(tr.call(n,0,e.maxStringLength),e)+r}return pn(De.call(De.call(n,/(['\\\\])/g,"\\\\$1"),/[\\x00-\\x1f]/g,Ka),"single",e)}function Ka(n){var e=n.charCodeAt(0),t={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return t?"\\\\"+t:"\\\\x"+(e<16?"0":"")+Ma.call(e.toString(16))}function dt(n){return"Object("+n+")"}function or(n){return n+" { ? }"}function gn(n,e,t,r){return n+" ("+e+") {"+(r?lr(t,r):je.call(t,", "))+"}"}function Za(n){for(var e=0;e<n.length;e++)if(hn(n[e],\`
15227
+ \`)>=0)return!1;return!0}function ei(n,e){var t;if(n.indent===" ")t=" ";else{if(typeof n.indent!="number"||!(n.indent>0))return null;t=je.call(Array(n.indent+1)," ")}return{base:t,prev:je.call(Array(e+1),t)}}function lr(n,e){if(n.length===0)return"";var t=\`
15228
+ \`+e.prev+e.base;return t+je.call(n,","+t)+\`
15229
+ \`+e.prev}function jt(n,e){var t,r=sr(n),a=[];if(r){a.length=n.length;for(var i=0;i<n.length;i++)a[i]=qe(n,i)?e(n[i],n):""}var l=typeof nr=="function"?nr(n):[];if(Ze){t={};for(var s=0;s<l.length;s++)t["$"+l[s]]=l[s]}for(var u in n)if(qe(n,u)&&(!r||String(Number(u))!==u||!(u<n.length))){if(Ze&&t["$"+u]instanceof Symbol)continue;rn.call(/[^\\w$]/,u)?a.push(e(u,n)+": "+e(n[u],n)):a.push(u+": "+e(n[u],n))}if(typeof nr=="function")for(var o=0;o<l.length;o++)sn.call(n,l[o])&&a.push("["+e(l[o])+"]: "+e(n[l[o]],n));return a}var $e=A("b9GfH"),Tt=ve("%WeakMap%",!0),Pt=ve("%Map%",!0),ti=Ve("WeakMap.prototype.get",!0),ri=Ve("WeakMap.prototype.set",!0),ni=Ve("WeakMap.prototype.has",!0),ai=Ve("Map.prototype.get",!0),ii=Ve("Map.prototype.set",!0),si=Ve("Map.prototype.has",!0),cr=function(n,e){for(var t,r=n;(t=r.next)!==null;r=t)if(t.key===e)return r.next=t.next,t.next=n.next,n.next=t,t},oi=function(n,e){var t=cr(n,e);return t&&t.value},li=function(n,e,t){var r=cr(n,e);r?r.value=t:n.next={key:e,next:n.next,value:t}},ci=function(n,e){return!!cr(n,e)};Jt=function(){var n,e,t,r={assert:function(a){if(!r.has(a))throw new $e("Side channel does not contain "+Xr(a))},get:function(a){if(Tt&&a&&(typeof a=="object"||typeof a=="function")){if(n)return ti(n,a)}else if(Pt){if(e)return ai(e,a)}else if(t)return oi(t,a)},has:function(a){if(Tt&&a&&(typeof a=="object"||typeof a=="function")){if(n)return ni(n,a)}else if(Pt){if(e)return si(e,a)}else if(t)return ci(t,a);return!1},set:function(a,i){Tt&&a&&(typeof a=="object"||typeof a=="function")?(n||(n=new Tt),ri(n,a,i)):Pt?(e||(e=new Pt),ii(e,a,i)):(t||(t={key:{},next:null}),li(t,a,i))}};return r};var Ee={},Ue={},ui=String.prototype.replace,pi=/%20/g,ur={RFC1738:"RFC1738",RFC3986:"RFC3986"};Ue={default:ur.RFC3986,formatters:{RFC1738:function(n){return ui.call(n,pi,"+")},RFC3986:function(n){return String(n)}},RFC1738:ur.RFC1738,RFC3986:ur.RFC3986};var pr=Object.prototype.hasOwnProperty,Je=Array.isArray,Te=function(){for(var n=[],e=0;e<256;++e)n.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return n}(),di=function(n){for(;n.length>1;){var e=n.pop(),t=e.obj[e.prop];if(Je(t)){for(var r=[],a=0;a<t.length;++a)t[a]!==void 0&&r.push(t[a]);e.obj[e.prop]=r}}},yn=function(n,e){for(var t=e&&e.plainObjects?Object.create(null):{},r=0;r<n.length;++r)n[r]!==void 0&&(t[r]=n[r]);return t},fi=function n(e,t,r){if(!t)return e;if(typeof t!="object"){if(Je(e))e.push(t);else{if(!e||typeof e!="object")return[e,t];(r&&(r.plainObjects||r.allowPrototypes)||!pr.call(Object.prototype,t))&&(e[t]=!0)}return e}if(!e||typeof e!="object")return[e].concat(t);var a=e;return Je(e)&&!Je(t)&&(a=yn(e,r)),Je(e)&&Je(t)?(t.forEach(function(i,l){if(pr.call(e,l)){var s=e[l];s&&typeof s=="object"&&i&&typeof i=="object"?e[l]=n(s,i,r):e.push(i)}else e[l]=i}),e):Object.keys(t).reduce(function(i,l){var s=t[l];return pr.call(i,l)?i[l]=n(i[l],s,r):i[l]=s,i},a)},hi=function(n,e){return Object.keys(e).reduce(function(t,r){return t[r]=e[r],t},n)},mi=function(n,e,t){var r=n.replace(/\\+/g," ");if(t==="iso-8859-1")return r.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(r)}catch{return r}},gi=function(n,e,t,r,a){if(n.length===0)return n;var i=n;if(typeof n=="symbol"?i=Symbol.prototype.toString.call(n):typeof n!="string"&&(i=String(n)),t==="iso-8859-1")return escape(i).replace(/%u[0-9a-f]{4}/gi,function(o){return"%26%23"+parseInt(o.slice(2),16)+"%3B"});for(var l="",s=0;s<i.length;++s){var u=i.charCodeAt(s);if(u===45||u===46||u===95||u===126||u>=48&&u<=57||u>=65&&u<=90||u>=97&&u<=122||a===Ue.RFC1738&&(u===40||u===41)){l+=i.charAt(s);continue}if(u<128){l+=Te[u];continue}if(u<2048){l+=Te[192|u>>6]+Te[128|63&u];continue}if(u<55296||u>=57344){l+=Te[224|u>>12]+Te[128|u>>6&63]+Te[128|63&u];continue}s+=1,l+=Te[240|(u=65536+((1023&u)<<10|1023&i.charCodeAt(s)))>>18]+Te[128|u>>12&63]+Te[128|u>>6&63]+Te[128|63&u]}return l},yi=function(n){for(var e=[{obj:{o:n},prop:"o"}],t=[],r=0;r<e.length;++r)for(var a=e[r],i=a.obj[a.prop],l=Object.keys(i),s=0;s<l.length;++s){var u=l[s],o=i[u];typeof o=="object"&&o!==null&&t.indexOf(o)===-1&&(e.push({obj:i,prop:u}),t.push(o))}return di(e),n},_i=function(n){return Object.prototype.toString.call(n)==="[object RegExp]"},bi=function(n){return!!n&&typeof n=="object"&&!!(n.constructor&&n.constructor.isBuffer&&n.constructor.isBuffer(n))},vi=function(n,e){return[].concat(n,e)},wi=function(n,e){if(Je(n)){for(var t=[],r=0;r<n.length;r+=1)t.push(e(n[r]));return t}return e(n)};Ee={arrayToObject:yn,assign:hi,combine:vi,compact:yi,decode:mi,encode:gi,isBuffer:bi,isRegExp:_i,maybeMap:wi,merge:fi};var $i=Object.prototype.hasOwnProperty,_n={brackets:function(n){return n+"[]"},comma:"comma",indices:function(n,e){return n+"["+e+"]"},repeat:function(n){return n}},Re=Array.isArray,Si=Array.prototype.push,bn=function(n,e){Si.apply(n,Re(e)?e:[e])},xi=Date.prototype.toISOString,vn=Ue.default,_e={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:Ee.encode,encodeValuesOnly:!1,format:vn,formatter:Ue.formatters[vn],indices:!1,serializeDate:function(n){return xi.call(n)},skipNulls:!1,strictNullHandling:!1},Ei=function(n){return typeof n=="string"||typeof n=="number"||typeof n=="boolean"||typeof n=="symbol"||typeof n=="bigint"},dr={},ki=function n(e,t,r,a,i,l,s,u,o,p,m,d,y,f,S,v){for(var w,g=e,_=v,$=0,x=!1;(_=_.get(dr))!==void 0&&!x;){var T=_.get(e);if($+=1,T!==void 0){if(T===$)throw RangeError("Cyclic object value");x=!0}_.get(dr)===void 0&&($=0)}if(typeof u=="function"?g=u(t,g):g instanceof Date?g=m(g):r==="comma"&&Re(g)&&(g=Ee.maybeMap(g,function(X){return X instanceof Date?m(X):X})),g===null){if(i)return s&&!f?s(t,_e.encoder,S,"key",d):t;g=""}if(Ei(g)||Ee.isBuffer(g))return s?[y(f?t:s(t,_e.encoder,S,"key",d))+"="+y(s(g,_e.encoder,S,"value",d))]:[y(t)+"="+y(String(g))];var P=[];if(g===void 0)return P;if(r==="comma"&&Re(g))f&&s&&(g=Ee.maybeMap(g,s)),w=[{value:g.length>0?g.join(",")||null:void 0}];else if(Re(u))w=u;else{var D=Object.keys(g);w=o?D.sort(o):D}for(var R=a&&Re(g)&&g.length===1?t+"[]":t,I=0;I<w.length;++I){var F=w[I],C=typeof F=="object"&&F.value!==void 0?F.value:g[F];if(!l||C!==null){var B=Re(g)?typeof r=="function"?r(R,F):R:R+(p?"."+F:"["+F+"]");v.set(e,$);var V=Jt();V.set(dr,v),bn(P,n(C,B,r,a,i,l,r==="comma"&&f&&Re(g)?null:s,u,o,p,m,d,y,f,S,V))}}return P},Ai=function(n){if(!n)return _e;if(n.encoder!==null&&n.encoder!==void 0&&typeof n.encoder!="function")throw TypeError("Encoder has to be a function.");var e=n.charset||_e.charset;if(n.charset!==void 0&&n.charset!=="utf-8"&&n.charset!=="iso-8859-1")throw TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var t=Ue.default;if(n.format!==void 0){if(!$i.call(Ue.formatters,n.format))throw TypeError("Unknown format option provided.");t=n.format}var r=Ue.formatters[t],a=_e.filter;return(typeof n.filter=="function"||Re(n.filter))&&(a=n.filter),{addQueryPrefix:typeof n.addQueryPrefix=="boolean"?n.addQueryPrefix:_e.addQueryPrefix,allowDots:n.allowDots===void 0?_e.allowDots:!!n.allowDots,charset:e,charsetSentinel:typeof n.charsetSentinel=="boolean"?n.charsetSentinel:_e.charsetSentinel,delimiter:n.delimiter===void 0?_e.delimiter:n.delimiter,encode:typeof n.encode=="boolean"?n.encode:_e.encode,encoder:typeof n.encoder=="function"?n.encoder:_e.encoder,encodeValuesOnly:typeof n.encodeValuesOnly=="boolean"?n.encodeValuesOnly:_e.encodeValuesOnly,filter:a,format:t,formatter:r,serializeDate:typeof n.serializeDate=="function"?n.serializeDate:_e.serializeDate,skipNulls:typeof n.skipNulls=="boolean"?n.skipNulls:_e.skipNulls,sort:typeof n.sort=="function"?n.sort:null,strictNullHandling:typeof n.strictNullHandling=="boolean"?n.strictNullHandling:_e.strictNullHandling}};Hr=function(n,e){var t,r,a=n,i=Ai(e);typeof i.filter=="function"?a=i.filter("",a):Re(i.filter)&&(t=i.filter);var l=[];if(typeof a!="object"||a===null)return"";r=e&&e.arrayFormat in _n?e.arrayFormat:e&&"indices"in e?e.indices?"indices":"repeat":"indices";var s=_n[r];if(e&&"commaRoundTrip"in e&&typeof e.commaRoundTrip!="boolean")throw TypeError("\`commaRoundTrip\` must be a boolean, or absent");var u=s==="comma"&&e&&e.commaRoundTrip;t||(t=Object.keys(a)),i.sort&&t.sort(i.sort);for(var o=Jt(),p=0;p<t.length;++p){var m=t[p];i.skipNulls&&a[m]===null||bn(l,ki(a[m],m,s,u,i.strictNullHandling,i.skipNulls,i.encode?i.encoder:null,i.filter,i.sort,i.allowDots,i.serializeDate,i.format,i.formatter,i.encodeValuesOnly,i.charset,o))}var d=l.join(i.delimiter),y=i.addQueryPrefix===!0?"?":"";return i.charsetSentinel&&(i.charset==="iso-8859-1"?y+="utf8=%26%2310003%3B&":y+="utf8=%E2%9C%93&"),d.length>0?y+d:""};var wn={},fr=Object.prototype.hasOwnProperty,Ii=Array.isArray,de={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:Ee.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},Oi=function(n){return n.replace(/&#(\\d+);/g,function(e,t){return String.fromCharCode(parseInt(t,10))})},$n=function(n,e){return n&&typeof n=="string"&&e.comma&&n.indexOf(",")>-1?n.split(","):n},ji="utf8=%26%2310003%3B",Ti="utf8=%E2%9C%93",Pi=function(n,e){var t={__proto__:null},r=e.ignoreQueryPrefix?n.replace(/^\\?/,""):n,a=e.parameterLimit===1/0?void 0:e.parameterLimit,i=r.split(e.delimiter,a),l=-1,s=e.charset;if(e.charsetSentinel)for(u=0;u<i.length;++u)i[u].indexOf("utf8=")===0&&(i[u]===Ti?s="utf-8":i[u]===ji&&(s="iso-8859-1"),l=u,u=i.length);for(u=0;u<i.length;++u)if(u!==l){var u,o,p,m=i[u],d=m.indexOf("]="),y=d===-1?m.indexOf("="):d+1;y===-1?(o=e.decoder(m,de.decoder,s,"key"),p=e.strictNullHandling?null:""):(o=e.decoder(m.slice(0,y),de.decoder,s,"key"),p=Ee.maybeMap($n(m.slice(y+1),e),function(f){return e.decoder(f,de.decoder,s,"value")})),p&&e.interpretNumericEntities&&s==="iso-8859-1"&&(p=Oi(p)),m.indexOf("[]=")>-1&&(p=Ii(p)?[p]:p),fr.call(t,o)?t[o]=Ee.combine(t[o],p):t[o]=p}return t},Ci=function(n,e,t,r){for(var a=r?e:$n(e,t),i=n.length-1;i>=0;--i){var l,s=n[i];if(s==="[]"&&t.parseArrays)l=[].concat(a);else{l=t.plainObjects?Object.create(null):{};var u=s.charAt(0)==="["&&s.charAt(s.length-1)==="]"?s.slice(1,-1):s,o=parseInt(u,10);t.parseArrays||u!==""?!isNaN(o)&&s!==u&&String(o)===u&&o>=0&&t.parseArrays&&o<=t.arrayLimit?(l=[])[o]=a:u!=="__proto__"&&(l[u]=a):l={0:a}}a=l}return a},Ni=function(n,e,t,r){if(n){var a=t.allowDots?n.replace(/\\.([^.[]+)/g,"[$1]"):n,i=/(\\[[^[\\]]*])/,l=/(\\[[^[\\]]*])/g,s=t.depth>0&&i.exec(a),u=s?a.slice(0,s.index):a,o=[];if(u){if(!t.plainObjects&&fr.call(Object.prototype,u)&&!t.allowPrototypes)return;o.push(u)}for(var p=0;t.depth>0&&(s=l.exec(a))!==null&&p<t.depth;){if(p+=1,!t.plainObjects&&fr.call(Object.prototype,s[1].slice(1,-1))&&!t.allowPrototypes)return;o.push(s[1])}return s&&o.push("["+a.slice(s.index)+"]"),Ci(o,e,t,r)}},Mi=function(n){if(!n)return de;if(n.decoder!==null&&n.decoder!==void 0&&typeof n.decoder!="function")throw TypeError("Decoder has to be a function.");if(n.charset!==void 0&&n.charset!=="utf-8"&&n.charset!=="iso-8859-1")throw TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var e=n.charset===void 0?de.charset:n.charset;return{allowDots:n.allowDots===void 0?de.allowDots:!!n.allowDots,allowPrototypes:typeof n.allowPrototypes=="boolean"?n.allowPrototypes:de.allowPrototypes,allowSparse:typeof n.allowSparse=="boolean"?n.allowSparse:de.allowSparse,arrayLimit:typeof n.arrayLimit=="number"?n.arrayLimit:de.arrayLimit,charset:e,charsetSentinel:typeof n.charsetSentinel=="boolean"?n.charsetSentinel:de.charsetSentinel,comma:typeof n.comma=="boolean"?n.comma:de.comma,decoder:typeof n.decoder=="function"?n.decoder:de.decoder,delimiter:typeof n.delimiter=="string"||Ee.isRegExp(n.delimiter)?n.delimiter:de.delimiter,depth:typeof n.depth=="number"||n.depth===!1?+n.depth:de.depth,ignoreQueryPrefix:n.ignoreQueryPrefix===!0,interpretNumericEntities:typeof n.interpretNumericEntities=="boolean"?n.interpretNumericEntities:de.interpretNumericEntities,parameterLimit:typeof n.parameterLimit=="number"?n.parameterLimit:de.parameterLimit,parseArrays:n.parseArrays!==!1,plainObjects:typeof n.plainObjects=="boolean"?n.plainObjects:de.plainObjects,strictNullHandling:typeof n.strictNullHandling=="boolean"?n.strictNullHandling:de.strictNullHandling}};wn=function(n,e){var t=Mi(e);if(n===""||n==null)return t.plainObjects?Object.create(null):{};for(var r=typeof n=="string"?Pi(n,t):n,a=t.plainObjects?Object.create(null):{},i=Object.keys(r),l=0;l<i.length;++l){var s=i[l],u=Ni(s,r[s],t,typeof n=="string");a=Ee.merge(a,u,t)}return t.allowSparse===!0?a:Ee.compact(a)},kt={formats:Ue,parse:wn,stringify:Hr};class Ri{constructor(e){this.root=e,this.requestPromises=[]}init(e){this.getToken=e}async get(e){let t=await this.getToken(),r=this.getHashCode(e);if(this.requestPromises[r])return this.requestPromises[r].promise;let a=new Promise((i,l)=>{let s;e.externalResource?s=e.url:(s=this.root+e.url,s=\`\${s}\${/\\?/.test(s)?"&":"?"}token=\${t}\${$a(e.params)}\`),G(gt).get(s,{validateStatus:function(u){return u<400}}).then(function(u){u.status!=200&&console.error(\`GUDHUB HTTP SERVICE: GET ERROR: \${u.status}\`,u),i(u.data)}).catch(function(u){console.error(\`GUDHUB HTTP SERVICE: GET ERROR: \${u.response.status}
15230
+ \`,u),console.log("Request message: ",e),u.response&&u.response.data&&console.log("Error response data: ",u.response.data),l(u)})});return this.pushPromise(a,r),a}async post(e){let t=this.getHashCode(e);if(e.form.token=await this.getToken(),this.requestPromises[t])return this.requestPromises[t].promise;let r=new Promise((a,i)=>{G(gt).post(this.root+e.url,G(kt).stringify(e.form),{maxBodyLength:1/0,headers:e.headers||{"Content-Type":"application/x-www-form-urlencoded"},validateStatus:function(l){return l<400}}).then(function(l){l.status!=200&&console.error(\`GUDHUB HTTP SERVICE: POST ERROR: \${l.status}\`,l),a(l.data)}).catch(function(l){console.error(\`GUDHUB HTTP SERVICE: POST ERROR: \${l.response.status}
15231
+ \`,l),console.log("Request message: ",e),i(l)})});return this.pushPromise(r,t),r}axiosRequest(e){let t=this.getHashCode(e);if(this.requestPromises[t])return this.requestPromises[t].promise;let r=e.method?e.method.toLowerCase():"get",a=e.url,i=e.headers||{};e.form&&(i["Content-Type"]="application/x-www-form-urlencoded");let l=new Promise(async(s,u)=>{try{let{data:o}=await G(gt)[r](a,r==="post"?G(kt).stringify(e.form)||e.body:{headers:i},r==="post"?{headers:i}:{});s(o)}catch(o){console.log("ERROR -> GUDHUB HTTP SERVICE -> SIMPLE POST :",o.message),console.log("Request message: ",e),u(o)}});return this.pushPromise(l,t),l}pushPromise(e,t){this.requestPromises[t]={promise:e,hesh:t,callback:e.then(()=>{this.destroyPromise(t)}).catch(r=>{this.destroyPromise(t)})}}destroyPromise(e){this.requestPromises=this.requestPromises.filter(t=>t.hesh!==e)}getHashCode(e){let t=0,r=G(kt).stringify(e);if(r.length==0)return t;for(let a=0;a<r.length;a++)t=(t<<5)-t+r.charCodeAt(a),t&=t;return"h"+t}}function hr(n){let e="";for(let t in n)n.hasOwnProperty(t)&&n[t]&&(e+="."+n[t]);return e?e.substring(1):"any"}function Fi(n,e,t){return n==null||typeof n!="string"?(console.log(\`Listener type is "undefined" or not have actual 'type' for subscribe\`),!1):e==null||typeof e!="object"?(console.log(\`Listener destination is "undefined" or not have actual 'type' for subscribe\`),!1):typeof t=="function"||(console.log("Listener is not a function for subscribe!"),!1)}class Li{constructor(){this.subscribers={},this.messageBox={}}on(e,t,r){return Fi(e,t,r)&&e.split(" ").map(a=>a+":"+hr(t)).forEach(a=>{this.subscribers[a]||(this.subscribers[a]=new Set),this.subscribers[a].add(r),this.checkMessageBox(a)}),this}emit(e,t,r,a){return e.split(" ").forEach(i=>{let l=i+":"+hr(t),s=!1;if(this.subscribers[l]){if(this.subscribers[l].size==0)return this.messageBox[l]=[e,t,r,a,s],this;this.subscribers[l].forEach(function(u){u(null,r,a)})}else this.messageBox[l]=[e,t,r,a,s]}),this}onRoot(e,t,r){return this.on(e,t,r)}destroy(e,t,r){return e.split(" ").forEach(a=>{let i=a+":"+hr(t);this.subscribers[i]&&r&&this.subscribers[i].delete(r),this.subscribers[i]&&!r&&delete this.subscribers[i]}),this}checkMessageBox(e){this.cleanMesssageBox(),this.messageBox[e]&&setTimeout(()=>{this.messageBox[e]&&(this.emit(...this.messageBox[e]),this.messageBox[e][4]=!0)},0)}cleanMesssageBox(){for(let e in this.messageBox)this.messageBox[e][4]&&delete this.messageBox[e]}}function Di(n,e,t){return[{data_type:"text",name:"Text",icon:"text_icon",url:e+"/"+n+"text_data.js",type:"gh_element",technology:"angular"},{data_type:"text_opt",name:"Options",icon:"option_gh_element",url:e+"/"+n+"text_options_data.js",type:"gh_element",technology:"angular"},{data_type:"number",name:"Number",icon:"number",url:e+"/"+n+"number_data.js",type:"gh_element",technology:"angular"},{data_type:"task_board",name:"Task Board",icon:"task_board",url:e+"/"+n+"task_board_data.js",type:"gh_element",technology:"angular"},{data_type:"visualizer",name:"visualizer",icon:"visualizer",url:e+"/"+n+"visualizer_data.js",type:"gh_element",technology:"angular"},{data_type:"enterprice_visualizer",name:"Enterprice Visualizer",icon:"visualizer",private:!0,url:e+"/"+n+"enterprice_visualizer_data.js",type:"gh_element",technology:"angular"},{data_type:"email",name:"Email",icon:"email",url:e+"/"+n+"email_data.js",type:"gh_element",technology:"angular"},{data_type:"date",name:"Date",icon:"date_gh_element",url:e+"/"+n+"date_data.js",type:"gh_element",technology:"angular"},{data_type:"radio_button",name:"Radio Button",icon:"radio_button_gh_element",url:e+"/"+n+"radio_button_data.js",type:"gh_element",technology:"angular"},{data_type:"radio_icon",name:"Radio icon",icon:"radio_icon_gh_element",url:e+"/"+n+"radio_icon_data.js",type:"gh_element",technology:"angular"},{data_type:"twilio_phone",name:"Twilio Phone",icon:"phone_twilio_gh_element",url:e+"/"+n+"twilio_phone_data.js",type:"gh_element",technology:"angular"},{data_type:"twilio_autodialer",name:"Twilio Auto Dialer",icon:"twilio_dialer",url:e+"/"+n+"twillio_autodialer_data.js",type:"gh_element",technology:"angular"},{data_type:"color",name:"Color",icon:"paint_gh_element",url:e+"/"+n+"color_data.js",type:"gh_element",technology:"angular"},{data_type:"charts",name:"Charts",icon:"graph_gh_element",url:e+"/"+n+"charts_data.js",type:"gh_element",technology:"angular"},{data_type:"funnel_chart",name:"Funnel chart",icon:"funnel_chart_gh_element",url:e+"/"+n+"funnel_chart_data.js",type:"gh_element",technology:"angular"},{data_type:"add_items_from_template",name:"Add items from template",icon:"contact_second",url:e+"/"+n+"add_items_from_template_data.js",type:"gh_element",technology:"angular"},{data_type:"item_ref",name:"Reference",icon:"reference",url:e+"/"+n+"itemRef_data.js",type:"gh_element",technology:"angular"},{data_type:"calendar",name:"Calendar",icon:"calendar",js:"https://gudhub.com/modules/FullCalendar-Gh-Element/dist/main.js?t=4",css:"https://gudhub.com/modules/FullCalendar-Gh-Element/dist/style.css?t=1",type:"gh_element",technology:"class"},{data_type:"data_ref",name:"Data Reference",icon:"data_reference",url:e+"/"+n+"data_ref_data.js",type:"gh_element",technology:"angular"},{data_type:"table",name:"Table",icon:"table",url:e+"/"+n+"table_data.js",type:"gh_element",technology:"angular"},{data_type:"tile",name:"Tile table",icon:"tile_table",url:e+"/"+n+"tile_data.js",type:"gh_element",technology:"angular"},{data_type:"file",name:"File",icon:"box",url:e+"/"+n+"file_data.js",type:"gh_element",technology:"angular"},{data_type:"image",name:"Image",icon:"image",url:e+"/"+n+"image_data.js",type:"gh_element",technology:"angular"},{data_type:"text_editor",name:"Text Editor",icon:"square",url:e+"/"+n+"text_editor_data.js",type:"gh_element",technology:"angular"},{data_type:"tinymse",name:"Text editor MSE",icon:"tag",url:e+"/"+n+"tinymse_data.js",type:"gh_element",technology:"angular"},{data_type:"duration",name:"Duration",icon:"number_gh_element",url:e+"/"+n+"duration_data.js",type:"gh_element",technology:"angular"},{data_type:"user",name:"User",icon:"user_gh_element",url:e+"/"+n+"user_data.js",type:"gh_element",technology:"angular"},{data_type:"app",name:"App",icon:"app",url:e+"/"+n+"application_data.js",type:"gh_element",technology:"angular"},{data_type:"field",name:"Field",icon:"field_gh_element",url:e+"/"+n+"field_data.js",type:"gh_element",technology:"angular"},{data_type:"available",name:"Available",icon:"availible_gh_element",url:e+"/"+n+"available_data.js",type:"gh_element",technology:"angular"},{data_type:"view_list",name:"View List",icon:"view_list",url:e+"/"+n+"view_list_data.js",type:"gh_element",technology:"angular"},{data_type:"calculator",name:"Calculator",icon:"calculator",url:e+"/"+n+"calculator_data.js",type:"gh_element",technology:"angular"},{data_type:"string_join",name:"String Joiner",icon:"string_join_gh_element",url:e+"/"+n+"string_joiner_data.js",type:"gh_element",technology:"angular"},{data_type:"signature",name:"Signature",icon:"signature",url:e+"/"+n+"signature_data.js",type:"gh_element",technology:"angular"},{data_type:"sendEmail",name:"Send Email",icon:"send_email_gh_element",url:e+"/"+n+"send_email_data.js",type:"gh_element",technology:"angular"},{data_type:"boolean",name:"Yes/No",icon:"boolen_gh_element",url:e+"/"+n+"boolean_data.js",type:"gh_element",technology:"angular"},{data_type:"product_gallery",name:"Product gallery",icon:"product_gallery",url:e+"/"+n+"product_gallery_data.js",type:"gh_element",technology:"angular"},{data_type:"online_inventory",name:"Online inventory",icon:"slab",url:e+"/"+n+"online_inventory_data.js",type:"gh_element",technology:"angular"},{data_type:"3d_edges",name:"3D Edges",icon:"3d_edges_gh_element",url:e+"/"+n+"3d_edges_data.js",type:"gh_element",technology:"angular"},{data_type:"color_list",name:"Color list",icon:"circular_gh_element",url:e+"/"+n+"color_list_data.js",type:"gh_element",technology:"angular"},{data_type:"go_to_link",name:"Go to Link",icon:"go_to_link",url:e+"/"+n+"go_to_link_data.js",type:"gh_element",technology:"angular"},{data_type:"go_to_view",name:"Go to View",icon:"go_to_view",url:e+"/"+n+"go_to_view_data.js",type:"gh_element",technology:"angular"},{data_type:"range",name:"Range",icon:"range_gh_element",url:e+"/"+n+"range_data.js",type:"gh_element",technology:"angular"},{data_type:"barcode",name:"Barcode",icon:"barcode_gh_element",url:e+"/"+n+"barcode_data.js",type:"gh_element",technology:"angular"},{data_type:"item_remote_add",name:"Item remote add",icon:"remote_add_gh_element",url:e+"/"+n+"item_remote_add_data.js",type:"gh_element",technology:"angular"},{data_type:"item_remote_update",name:"Item remote update",icon:"remote_update_gh_element",url:e+"/"+n+"item_remote_update_data.js",type:"gh_element",technology:"angular"},{data_type:"timeline",name:"Timeline",icon:"timeline",url:e+"/"+n+"timeline_data.js",type:"gh_element",technology:"angular"},{data_type:"delete_item",name:"Delete Item",icon:"rubbish",url:e+"/"+n+"delete_action.js",type:"gh_element",technology:"angular"},{data_type:"print_doc",name:"Print document",icon:"print",url:e+"/"+n+"print_doc_action.js",type:"gh_element",technology:"angular"},{data_type:"open_item",name:"Open Item",icon:"delete",private:!0,url:e+"/"+n+"open_item_action.js",type:"gh_element",technology:"angular"},{data_type:"edit_template",name:"Edit template",icon:"delete",private:!0,url:e+"/"+n+"edit_template_action.js",type:"gh_element",technology:"angular"},{data_type:"open_app",private:!0,name:"Open App",icon:"delete",url:e+"/"+n+"open_app_action.js",type:"gh_element",technology:"angular"},{data_type:"user_settings",private:!0,name:"User Settings",icon:"delete",url:e+"/"+n+"user_settings_action.js",type:"gh_element",technology:"angular"},{data_type:"app_sharing",name:"Sharing",icon:"sharing",url:e+"/"+n+"sharing_action.js",type:"gh_element",technology:"angular"},{data_type:"app_constructor",private:!0,name:"App constructor",icon:"app_constructor",url:e+"/"+n+"app_constructor_action.js",type:"gh_element",technology:"angular"},{data_type:"app_settings",name:"App Settings",icon:"configuration",url:e+"/"+n+"app_settings_action.js",type:"gh_element",technology:"angular"},{data_type:"export_csv",name:"Export CSV",icon:"export_csv",url:e+"/"+n+"export_csv.js",type:"gh_element",technology:"angular"},{data_type:"import_csv",name:"Import CSV",icon:"import_csv",url:e+"/"+n+"import_csv.js",type:"gh_element",technology:"angular"},{data_type:"add_items",name:"Add Items",icon:"plus",url:e+"/"+n+"add_items_action.js",type:"gh_element",technology:"angular"},{data_type:"update_items",name:"Update Items",icon:"update",url:e+"/"+n+"update_items_action.js",type:"gh_element",technology:"angular"},{data_type:"install_app",name:"Install",icon:"install",url:e+"/"+n+"install_app_action.js",type:"gh_element",technology:"angular"},{data_type:"search_action",name:"Search",icon:"search",url:e+"/"+n+"search_action.js",type:"gh_element",technology:"angular"},{data_type:"filter_table",name:"Table filter",icon:"filter",url:e+"/"+n+"filter_table_action.js",type:"gh_element",technology:"angular"},{data_type:"slider",name:"Slider",icon:"slider",url:e+"/"+n+"slider_data.js",type:"gh_element",technology:"angular"},{data_type:"clone_item",name:"Clone Item",icon:"double_plus",url:e+"/"+n+"clone_item_action.js",type:"gh_element",technology:"angular"},{data_type:"close",name:"Close",icon:"cross",url:e+"/"+n+"close_action.js",type:"gh_element",technology:"angular"},{data_type:"phone",name:"Phone",icon:"phone_thin",url:e+"/"+n+"phone_data.js",type:"gh_element",technology:"angular"},{data_type:"link",name:"Link",icon:"link_gh_element",url:e+"/"+n+"link_data.js",type:"gh_element",technology:"angular"},{data_type:"sheduling",name:"Sheduling",icon:"scheduling",url:e+"/"+n+"sheduling_data.js",type:"gh_element",technology:"angular"},{data_type:"qrcode",name:"QR Code",icon:"qr_code",url:e+"/"+n+"qrcode_data.js",type:"gh_element",technology:"angular"},{data_type:"graph2d",name:"Graph",icon:"graph",url:e+"/"+n+"graph2d_data.js",type:"gh_element",technology:"angular"},{data_type:"quote_tool",name:"Quote tool",icon:"quoters",url:e+"/"+n+"quote_tool_data.js",type:"gh_element",technology:"angular"},{data_type:"cards",name:"Cards",icon:"cards",url:e+"/"+n+"cards_data.js",type:"gh_element",technology:"angular"},{data_type:"jsonConstructor",name:"Json Constructor",icon:"button",url:e+"/"+n+"json_constructor_data.js",type:"gh_element",technology:"angular"},{data_type:"button",name:"Button",icon:"button",js:"https://gudhub.com/modules/button_action/button_action.js?t=1",type:"gh_element",technology:"class"},{data_type:"editorjs",name:"EditorJS",icon:"code_editor",js:"https://gudhub.com/modules/Editor-Js/dist/main.js?t=2",css:"https://gudhub.com/modules/Editor-Js/dist/style.css?t=2",type:"gh_element",technology:"class"},{data_type:"filter_advanced",name:"Filter Advanced",icon:"filter_advanced",url:e+"/"+n+"filter_advanced_data.js",type:"gh_element",technology:"angular"},{data_type:"code_editor",name:"Code Editor",icon:"code_editor",url:e+"/"+n+"code_editor_data.js",type:"gh_element",technology:"angular"},{data_type:"icon",name:"Icon",icon:"icon_gh_element",url:e+"/"+n+"icon_data.js",type:"gh_element",technology:"angular"},{data_type:"quoteRequest",name:"Quote Request",icon:"invoices",url:e+"/"+n+"quote_request_data.js",type:"gh_element",technology:"angular"},{data_type:"view_container",name:"View Container",icon:"pencil",url:e+"/"+n+"view_container_data.js",type:"gh_element",technology:"angular"},{data_type:"element_ref",name:"Element Reference",icon:"cloudSync_gh_element",url:e+"/"+n+"element_ref_data.js",type:"gh_element",technology:"angular"},{data_type:"quote_tool_objects_renderer",name:"Quote Tool Renderer",icon:"l_counter",url:e+"/"+n+"quote_tool_objects_renderer_data.js",type:"gh_element",technology:"angular"},{data_type:"quote_tool_objects_renderer_generator",name:"Quote Tool Parts Generator",icon:"l_counter_arrow",url:e+"/"+n+"quote_tool_objects_renderer_generator_data.js",type:"gh_element",technology:"angular"},{data_type:"trigger",name:"Trigger",icon:"job",url:e+"/"+n+"trigger_data.js",type:"gh_element",technology:"angular"},{data_type:"voting",name:"Voting",icon:"like_gh_element",url:e+"/"+n+"voting_data.js",type:"gh_element",technology:"angular"},{data_type:"view_tabs",name:"View Tab",icon:"tabs",url:e+"/"+n+"view_tabs.js",type:"gh_element",technology:"angular"},{data_type:"filter_tabs",name:"Filter Tabs",icon:"filter_tabs_gh_element",url:e+"/"+n+"filter_tabs.js",type:"gh_element",technology:"angular"},{data_type:"gps_coords",name:"GPS Coords",icon:"location_gh_element",url:e+"/"+n+"gps_coords.js",type:"gh_element",technology:"angular"},{data_type:"google_map",name:"Google Map",icon:"location",url:e+"/"+n+"google_map_data.js",type:"gh_element",technology:"angular"},{data_type:"data_migrations",name:"Data migrations",icon:"view_list_gh_element",url:e+"/"+n+"data_migrations.js",type:"gh_element",technology:"angular"},{data_type:"additional_settings",name:"Additional Settings",icon:"",private:!0,url:e+"/"+n+"gh_additional_settings_data.js",type:"gh_element",technology:"angular"},{data_type:"send_request",name:"Send Request",icon:"send_request_gh_element",url:e+"/"+n+"send_request_data.js",type:"gh_element",technology:"angular"},{data_type:"webcam",name:"Web camera",icon:"webcam_gh_element",url:e+"/"+n+"webcam_data.js",type:"gh_element",technology:"angular"},{data_type:"json_viewer",name:"JSON viewer",icon:"json_gh_element",url:e+"/"+n+"json_viewer_data.js",type:"gh_element",technology:"angular"},{data_type:"notifications",name:"Notifications",icon:"full_gh_element",url:e+"/"+n+"notifications_data.js",type:"gh_element",technology:"angular"},{data_type:"api",name:"API",icon:"job",url:e+"/"+n+"api_data.js",type:"gh_element",technology:"angular"},{data_type:"smart_input",name:"Smart Input",icon:"roket",url:e+"/"+n+"smart_input_data.js",type:"gh_element",technology:"angular"},{data_type:"json_editor",name:"JSON Editor",icon:"code",url:e+"/"+n+"json_editor_data.js",type:"gh_element",technology:"angular"},{data_type:"grapes_html_editor",name:"Grapes Html Editor",icon:"code_editor",url:e+"/"+n+"grapes_html_editor_data.js",type:"gh_element",technology:"angular"},{data_type:"quiz",name:"Quiz",icon:"quiz_gh_element",url:e+"/"+n+"quiz_data.js",type:"gh_element",technology:"angular"},{data_type:"password_input",name:"Password",icon:"lock_gh_element",url:e+"/"+n+"password_input_data.js",type:"gh_element",technology:"angular"},{data_type:"vs_code",name:"VS Code",icon:"code_editor",url:e+"/"+n+"vs_code_data.js",type:"gh_element",technology:"angular"},{data_type:"nested_list",name:"Nested List",icon:"scheduling",js:"https://gudhub.com/modules/Nested-List/dist/main.js?t=2",css:"https://gudhub.com/modules/Nested-List/dist/style.css?t=2",type:"gh_element",technology:"class"},{data_type:"countertop_smart_quote",name:"Countertop Smart Quote",icon:"quoters",url:e+"/"+n+"countertop_smart_quote_data.js",type:"gh_element",technology:"angular"},{data_type:"markdown_viewer",name:"Markdown viewer",icon:"code_editor",js:"https://gudhub.com/modules/markdown-it-gh-element/dist/main.js?t=1",css:"https://gudhub.com/modules/markdown-it-gh-element/dist/style.css?t=1",type:"gh_element",technology:"class"},{data_type:"html_viewer",name:"HTML Viewer",icon:"code_editor",js:"https://gudhub.com/modules/HTML-Viewer/dist/main.js?t=1",css:"https://gudhub.com/modules/HTML-Viewer/dist/style.css?t=1",type:"gh_element",technology:"class"},{data_type:"element_customizer",name:"Element Customizer",icon:"pencil",url:e+"/"+n+"element_customizer_data.js",type:"gh_element",technology:"angular"},{data_type:"task",name:"Task",icon:"table",url:e+"/"+n+"task_data.js",type:"gh_element",technology:"angular"},{data_type:"cron_picker",name:"Cron Picker",icon:"table",js:"https://gudhub.com/modules/Cron-Picker/dist/main.js?t=2",css:"https://gudhub.com/modules/Cron-Picker/dist/style.css?t=2",type:"gh_element",technology:"class"},{data_type:"balance_sheet",name:"Balance Sheet",icon:"table",js:"https://gudhub.com/modules/balance-sheet/dist/main.js?t=2",css:"https://gudhub.com/modules/balance-sheet/dist/style.css?t=2",type:"gh_element",technology:"class"},{data_type:"quote_form",name:"Quote Form",icon:"table",js:"https://gudhub.com/modules/countertop-quote-form/dist/main.js",css:"https://gudhub.com/modules/countertop-quote-form/dist/style.css",type:"gh_element",technology:"class"},{data_type:"static_nested_list",name:"Nested Filter",icon:"scheduling",js:"https://gudhub.com/modules/nested-filter/dist/main.js?t=1",css:"https://gudhub.com/modules/nested-filter/dist/style.css?t=1",type:"gh_element",technology:"class"},{data_type:"conversations",name:"Conversations",icon:"timeline",js:"https://gudhub.com/modules/conversation/dist/main.js?t=1",css:"https://gudhub.com/modules/conversation/dist/style.css?t=1",type:"gh_element",technology:"class"},{data_type:"study_journal",name:"Study Journal",icon:"timeline",js:"https://gudhub.com/modules/Study-Journal/dist/main.js?t=1",css:"https://gudhub.com/modules/Study-Journal/dist/style.css",type:"gh_element",technology:"class"},{data_type:"study_schedule",name:"Study Schedule",icon:"timeline",js:"https://gudhub.com/modules/Study-Schedule/dist/main.js?t=1",css:"https://gudhub.com/modules/Study-Schedule/dist/style.css?t=1",type:"gh_element",technology:"class"},{data_type:"avatar",name:"Avatar",icon:"user",js:"https://gudhub.com/modules/Gh-Avatar/dist/main.js?t=1",css:"https://gudhub.com/modules/Gh-Avatar/dist/style.css?t=1",type:"gh_element",technology:"class"},{data_type:"text_area",name:"Text Area",icon:"text_icon",js:"https://gudhub.com/modules/text-area-ghe/dist/main.js?t=3",css:"https://gudhub.com/modules/text-area-ghe/dist/style.css",type:"gh_element",technology:"class"},{data_type:"resource_calendar",name:"Resource Сalendar",icon:"calendar",url:e+"/"+n+"resource_calendar_data.js",type:"gh_element",technology:"angular"},{data_type:"visualizer_with_control_panel",name:"Visualizer With Control Panel",icon:"visualizer",url:e+"/"+n+"visualizer_with_control_panel_data.js",type:"gh_element",technology:"angular"},{data_type:"API",name:"API",url:e+"/"+t+"api_node.js",type:"automation",icon:"automation_api",private:!0},{data_type:"Calculator",name:"Calculator",url:e+"/"+t+"calculator.js",type:"automation",icon:"automation_calculator"},{data_type:"CompareItems",name:"Compare Items",url:e+"/"+t+"compare_items.js",type:"automation",icon:"automation_compare_items"},{data_type:"Constants",name:"Constants",url:e+"/"+t+"constants.js",type:"automation",icon:"automation_constants"},{data_type:"CreateFiles",name:"Create Files",url:e+"/"+t+"create_files.js",type:"automation",icon:"automation_create_files"},{data_type:"CreateItemsApi",name:"Create Items Api",url:e+"/"+t+"create_item_api.js",type:"automation",icon:"automation_create_items_api"},{data_type:"FileDuplicate",name:"File Duplicate",url:e+"/"+t+"file_duplicate.js",type:"automation",icon:"automation_file_duplicate"},{data_type:"Filter",name:"Filter",url:e+"/"+t+"filter_node.js",type:"automation",icon:"filter"},{data_type:"GetItemByItemRef",name:"Get Item By Item Ref",url:e+"/"+t+"get_item_by_item_ref.js",type:"automation",icon:"automation_get_item_by_item_ref"},{data_type:"GetItems",name:"Get Items",url:e+"/"+t+"get_items.js",type:"automation",icon:"automation_get_items"},{data_type:"GhElementNode",name:"Gh Element Node",url:e+"/"+t+"gh_element_node.js",type:"automation",icon:"automation_gh_element_node",private:!0,created_for:["GhElement"]},{data_type:"IfCondition",name:"If Condition",url:e+"/"+t+"if_condition.js",type:"automation",icon:"automation_if_condition"},{data_type:"ItemConstructor",name:"Item Constructor",url:e+"/"+t+"item_constructor.js",type:"automation",icon:"automation_item_constructor"},{data_type:"ItemDestructor",name:"Item Destructor",url:e+"/"+t+"item_destructor.js",type:"automation",icon:"automation_item_destructor"},{data_type:"JSONScheme",name:"JSON Scheme",url:e+"/"+t+"json_scheme.js",type:"automation",icon:"automation_json_scheme"},{data_type:"MergeItems",name:"Merge Items",url:e+"/"+t+"merge_items.js",type:"automation",icon:"automation_merge_items"},{data_type:"MessageConstructor",name:"Message Constructor",url:e+"/"+t+"message_constructor.js",type:"automation",icon:"automation_message_constructor"},{data_type:"ObjectToItem",name:"Object To Item",url:e+"/"+t+"obj_to_item.js",type:"automation",icon:"automation_object_to_item"},{data_type:"ObjectConstructor",name:"Object Constructor",url:e+"/"+t+"object_constructor.js",type:"automation",icon:"automation_object_constructor"},{data_type:"ObjectDestructor",name:"Object Destructor",url:e+"/"+t+"object_destructor.js",type:"automation",icon:"automation_object_destructor"},{data_type:"PopulateElement",name:"Populate Element",url:e+"/"+t+"populate_element.js",type:"automation",icon:"automation_populate_element",private:!0,created_for:["GhElement"]},{data_type:"PopulateItems",name:"Populate Items",url:e+"/"+t+"populate_items.js",type:"automation",icon:"automation_populate_items"},{data_type:"PopulateWithDate",name:"Populate With Date",url:e+"/"+t+"populate_with_date.js",type:"automation",icon:"automation_populate_with_date"},{data_type:"PopulateWithItemRef",name:"Populate with Item Ref",url:e+"/"+t+"populate_with_item_ref.js",type:"automation",icon:"automation_populate_with_item_ref"},{data_type:"PopUpForm",name:"Pop Up Form",url:e+"/"+t+"popup_form.js",type:"automation",icon:"automation_pop_up_form",private:!0,created_for:["Quiz","GhElement","SmartInput","Iterator"]},{data_type:"QuizForm",name:"Quiz Form",url:e+"/"+t+"quiz_form.js",type:"automation",icon:"automation_quiz_form",private:!0,created_for:["Quiz"]},{data_type:"QuizNode",name:"Quiz Node",url:e+"/"+t+"quiz_node.js",type:"automation",icon:"automation_quiz_node",private:!0},{data_type:"Request",name:"Request",url:e+"/"+t+"request_node.js",type:"automation",icon:"automation_request"},{data_type:"Response",name:"Response",url:e+"/"+t+"response_node.js",type:"automation",icon:"automation_response",private:!0,created_for:["API"]},{data_type:"SmartInput",name:"Smart Input",url:e+"/"+t+"smart_input.js",type:"automation",icon:"automation_smart_input",private:!0},{data_type:"Trigger",name:"Trigger",url:e+"/"+t+"trigger_node.js",type:"automation",icon:"automation_trigger",private:!0},{data_type:"TwilioSMS",name:"Twilio SMS",url:e+"/"+t+"twilio_sms.js",type:"automation",icon:"automation_twilio"},{data_type:"TwilioAuth",name:"Twilio Auth",url:e+"/"+t+"twilio_auth.js",type:"automation",icon:"table"},{data_type:"TwilioDevice",name:"Twilio Device",url:e+"/"+t+"twilio_device.js",type:"automation",icon:"table"},{data_type:"UpdateItemsApi",name:"Update Items Api",url:e+"/"+t+"update_items_api.js",type:"automation",icon:"automation_update_items_api"},{data_type:"GoogleCalendar",name:"Google Calendar",url:e+"/"+t+"google_calendar.js",type:"automation",icon:"calendar"},{data_type:"VerifyEmail",name:"Verify email",url:e+"/"+t+"verify_email.js",type:"automation",icon:"check_in_circle"},{data_type:"Iterator",name:"Iterator",url:e+"/"+t+"iterator.js",type:"automation",icon:"update"},{data_type:"IteratorInput",name:"Iterator Input",url:e+"/"+t+"iterator_input.js",type:"automation",icon:"arrow_right",private:!0},{data_type:"IteratorOutput",name:"Iterator Output",url:e+"/"+t+"iterator_output.js",type:"automation",icon:"arrow_right",private:!0},{data_type:"SendEmail",name:"Send email",url:e+"/"+t+"send_email.js",type:"automation",icon:"email"},{data_type:"FileReader",name:"File Reader",url:e+"/"+t+"file_reader.js",type:"automation",icon:"file"},{data_type:"WebsitesChecker",name:"Websites Checker",url:e+"/"+t+"websites_checker.js",type:"automation",icon:"world"},{data_type:"VoiceMachineDetection",name:"Voice Machine Detection",url:e+"/"+t+"voice_machine_detection.js",type:"automation",icon:"automation_calculator"},{data_type:"Task",name:"Task",url:e+"/"+t+"task.js",type:"automation",icon:"automation_calculator",private:!0},{data_type:"DeleteItems",name:"Delete Items",url:e+"/"+t+"delete_items.js",type:"automation",icon:"rubbish"},{data_type:"GoToItem",name:"Go To Item",url:e+"/"+t+"go_to_item.js",type:"automation",icon:"cursor_point"},{data_type:"FireWorks",name:"Fire Works",url:e+"/"+t+"fireworks_node.js",type:"automation",icon:"weeding_party"},{data_type:"SendMessage",name:"Send Message",url:e+"/"+t+"send_message.js",type:"automation",icon:"speech_bubble"},{data_type:"TurboSMS",name:"Turbo SMS",url:e+"/"+t+"turbo_sms.js",type:"automation",icon:"email"}]}class qi{constructor(e,t,r){this.apps_list=[],this.users_list=[],this.user={},this.modulesList=Di(e,t,r),this.ghComponentsPromises=[]}getMainStorage(){return this}getAppsList(){return this.apps_list}getUser(){return this.user}getUsersList(){return this.users_list}getModulesList(e,t,r){return e===void 0?this.modulesList:t==!1?this.modulesList.filter(a=>a.created_for?a.type===e&&a.private&&a.created_for.includes(r):a.type===e&&!a.private):this.modulesList.filter(a=>a.type===e)}getModuleUrl(e){return this.modulesList.find(t=>t.data_type==e)}setUser(e){this.user=e,this.users_list.push(e)}updateUser(e={}){e.avatar_128&&(e.avatar_128=e.avatar_128+"?"+new Date().getTime()),e.avatar_512&&(e.avatar_512=e.avatar_512+"?"+new Date().getTime()),this.user={...this.user,...e},this.users_list=this.users_list.filter(t=>t.user_id!=e.user_id),this.users_list.push(this.user)}unsetUser(){this.user={}}getApp(e){for(let t=0;t<this.apps_list.length;t++)if(this.apps_list[t].app_id==e)return this.apps_list[t]}unsetApps(){this.apps_list=[]}updateApp(e){return this.apps_list=this.apps_list.map(t=>t.app_id==e.app_id?e:t),this.apps_list}deleteApp(e){return this.apps_list=this.apps_list.filter(t=>t.app_id!=e),this.apps_list}async updateItemsInApp(e,t){let r=await this.getApp(t);return r&&(r.items_list=updateItems(e,r.items_list,this.pipeService.emit.bind(this.pipeService),t),this.updateApp(r)),r}async addItemsToApp(e,t){let r=await this.getApp(t);return r&&(r.items_list.push(...e),this.updateApp(r),this.pipeService.emit("gh_items_update",{app_id:t},e)),r}async deleteItemsInApp(e,t){let r=await this.getApp(t);return r&&(r.items_list=r.items_list.filter(a=>!e.find(i=>i.item_id==a.item_id)),this.updateApp(r)),r}}var Sn={};Sn=function(){throw Error("ws does not work in the browser. Browser clients must use the native WebSocket object")};var me=A("5xozB");class Bi{constructor(e,t){this.websocket=null,this.connected=!1,this.queue=[],this.url=e,this.auth=t,this.heartBeatTimeStemp=1e13,this.ALLOWED_HEART_BEAT_DELEY=12e3,this.firstHeartBeat=!0,this.reload=!0,this.isBrowser=me.IS_BROWSER_MAIN_THREAD}async addSubscription(e){let t=await this.auth.getToken(),r=\`token=\${t}/~/app_id=\${e}\`;this.connected&&this.websocket.send(r),this.queue.push(e)}async onOpen(){this.reload=!0,console.log("websocket opened"),this.connected=!0;let e=await this.auth.getToken();this.queue.forEach(t=>{let r=\`token=\${e}/~/app_id=\${t}\`;this.websocket.send(r)})}onError(e){console.log("websocket error: ",e),this.websocket.close()}onClose(){console.log("websocket close"),this.connected=!1;try{this.initWebSocket(this.onMassageHandler,this.refreshAppsHandler)}catch(e){console.log(e)}}async onMessage(e){let t=this.isBrowser?e.data:e;if(t.match(/HeartBeat/)){let r=new Date().getTime()-this.heartBeatTimeStemp;this.ALLOWED_HEART_BEAT_DELEY<r?await this.onConnectionLost():(this.websocket.send("HeartBeat"),this.heartBeatTimeStemp=new Date().getTime())}if(this.firstHeartBeat&&(this.connectionChecker(),this.firstHeartBeat=!1),t.match(/[{}]/)){let r=JSON.parse(t),a=await this.auth.getToken();r.token!=a&&this.onMassageHandler(r)}}initWebSocket(e,t){this.onMassageHandler=e,this.refreshAppsHandler=t,this.isBrowser?(this.websocket=new WebSocket(this.url),this.websocket.onopen=this.onOpen.bind(this),this.websocket.onerror=this.onError.bind(this),this.websocket.onclose=this.onClose.bind(this),this.websocket.onmessage=this.onMessage.bind(this)):(this.websocket=new(G(Sn))(this.url),this.websocket.on("open",this.onOpen),this.websocket.on("error",this.onError),this.websocket.on("close",this.onClose),this.websocket.on("message",this.onMessage)),console.log("websocket initialized")}connectionChecker(){setInterval(async()=>{let e=new Date().getTime()-this.heartBeatTimeStemp;this.ALLOWED_HEART_BEAT_DELEY<e&&await this.onConnectionLost()},1e3)}async onConnectionLost(){try{await this.auth.getVersion(),this.reload&&(this.reload=!1,console.log("Connected"),this.heartBeatTimeStemp=1e13,this.websocket.close())}catch(e){console.log(e)}}}async function Ui(n,e,t,r={}){let a=[],i={variableMethodcurrent_app:()=>[r.current_app_id||r.app_id],variableMethodelement_app:()=>[r.element_app_id],variableMethodcurrent_item:()=>[\`\${r.current_app_id||r.app_id}.\${r.item_id}\`],variableMethoduser_id:()=>[e.getUser().user_id],variableMethoduser_email:s=>[e.getUser().username],variableMethodtoday(s){let u=new Date,o=new Date(u.getFullYear(),u.getMonth(),u.getDate()),p=new Date(u.getFullYear(),u.getMonth(),u.getDate()+1);return[o.valueOf().toString()+":"+p.valueOf().toString()]},variableMethodvariable:s=>[r[s]]};if(n)for(let s of n)if(s)switch(s.input_type){case"variable":for(let o of(s.valuesArray=[],s==null?void 0:s.input_value.split(","))){let p=i[s.input_type+"Method"+o];typeof p=="function"?s.valuesArray?s.valuesArray.push(...p()):s.valuesArray=p():s.valuesArray?s.valuesArray.push(...i.variableMethodvariable(o)):s.valuesArray=i.variableMethodvariable(o)}a.push(s);break;case"field":let u=await l({app_id:r.current_app_id||r.app_id,item_id:r.item_id,field_id:s.input_value});u!=null&&s.valuesArray.push(u),a.push(s);break;default:a.push(s)}else a.push(s);function l(s){return new Promise(u=>{t.on("gh_value_get",s,function o(p,m){t.destroy("gh_value_get",s,o),u(m)}).emit("gh_value_get",{},s)})}return a}function Fe(n){return Array.isArray?Array.isArray(n):kn(n)==="[object Array]"}function Gi(n){if(typeof n=="string")return n;let e=n+"";return e=="0"&&1/n==-1/0?"-0":e}function Wi(n){return n==null?"":Gi(n)}function Pe(n){return typeof n=="string"}function xn(n){return typeof n=="number"}function Hi(n){return n===!0||n===!1||zi(n)&&kn(n)=="[object Boolean]"}function En(n){return typeof n=="object"}function zi(n){return En(n)&&n!==null}function Se(n){return n!=null}function mr(n){return!n.trim().length}function kn(n){return n==null?n===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(n)}let Vi="Incorrect 'index' type",Ji=n=>\`Invalid value for key \${n}\`,Qi=n=>\`Pattern length exceeds max of \${n}.\`,Yi=n=>\`Missing \${n} property in key\`,Xi=n=>\`Property 'weight' in key '\${n}' must be a positive integer\`,An=Object.prototype.hasOwnProperty;class Ki{constructor(e){this._keys=[],this._keyMap={};let t=0;e.forEach(r=>{let a=In(r);t+=a.weight,this._keys.push(a),this._keyMap[a.id]=a,t+=a.weight}),this._keys.forEach(r=>{r.weight/=t})}get(e){return this._keyMap[e]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function In(n){let e=null,t=null,r=null,a=1,i=null;if(Pe(n)||Fe(n))r=n,e=On(n),t=gr(n);else{if(!An.call(n,"name"))throw Error(Yi("name"));let l=n.name;if(r=l,An.call(n,"weight")&&(a=n.weight)<=0)throw Error(Xi(l));e=On(l),t=gr(l),i=n.getFn}return{path:e,id:t,weight:a,src:r,getFn:i}}function On(n){return Fe(n)?n:n.split(".")}function gr(n){return Fe(n)?n.join("."):n}function Zi(n,e){let t=[],r=!1,a=(i,l,s)=>{if(Se(i))if(l[s]){let u=i[l[s]];if(Se(u))if(s===l.length-1&&(Pe(u)||xn(u)||Hi(u)))t.push(Wi(u));else if(Fe(u)){r=!0;for(let o=0,p=u.length;o<p;o+=1)a(u[o],l,s+1)}else l.length&&a(u,l,s+1)}else t.push(i)};return a(n,Pe(e)?e.split("."):e,0),r?t:t[0]}var W={...{isCaseSensitive:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(n,e)=>n.score===e.score?n.idx<e.idx?-1:1:n.score<e.score?-1:1},...{includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},...{location:0,threshold:.6,distance:100},...{useExtendedSearch:!1,getFn:Zi,ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1}};let es=/[^ ]+/g;function ts(n=1,e=3){let t=new Map,r=Math.pow(10,e);return{get(a){let i=a.match(es).length;if(t.has(i))return t.get(i);let l=parseFloat(Math.round(1/Math.pow(i,.5*n)*r)/r);return t.set(i,l),l},clear(){t.clear()}}}class yr{constructor({getFn:e=W.getFn,fieldNormWeight:t=W.fieldNormWeight}={}){this.norm=ts(t,3),this.getFn=e,this.isCreated=!1,this.setIndexRecords()}setSources(e=[]){this.docs=e}setIndexRecords(e=[]){this.records=e}setKeys(e=[]){this.keys=e,this._keysMap={},e.forEach((t,r)=>{this._keysMap[t.id]=r})}create(){!this.isCreated&&this.docs.length&&(this.isCreated=!0,Pe(this.docs[0])?this.docs.forEach((e,t)=>{this._addString(e,t)}):this.docs.forEach((e,t)=>{this._addObject(e,t)}),this.norm.clear())}add(e){let t=this.size();Pe(e)?this._addString(e,t):this._addObject(e,t)}removeAt(e){this.records.splice(e,1);for(let t=e,r=this.size();t<r;t+=1)this.records[t].i-=1}getValueForItemAtKeyId(e,t){return e[this._keysMap[t]]}size(){return this.records.length}_addString(e,t){if(!Se(e)||mr(e))return;let r={v:e,i:t,n:this.norm.get(e)};this.records.push(r)}_addObject(e,t){let r={i:t,$:{}};this.keys.forEach((a,i)=>{let l=a.getFn?a.getFn(e):this.getFn(e,a.path);if(Se(l)){if(Fe(l)){let s=[],u=[{nestedArrIndex:-1,value:l}];for(;u.length;){let{nestedArrIndex:o,value:p}=u.pop();if(Se(p))if(Pe(p)&&!mr(p)){let m={v:p,i:o,n:this.norm.get(p)};s.push(m)}else Fe(p)&&p.forEach((m,d)=>{u.push({nestedArrIndex:d,value:m})})}r.$[i]=s}else if(Pe(l)&&!mr(l)){let s={v:l,n:this.norm.get(l)};r.$[i]=s}}}),this.records.push(r)}toJSON(){return{keys:this.keys,records:this.records}}}function jn(n,e,{getFn:t=W.getFn,fieldNormWeight:r=W.fieldNormWeight}={}){let a=new yr({getFn:t,fieldNormWeight:r});return a.setKeys(n.map(In)),a.setSources(e),a.create(),a}function rs(n,{getFn:e=W.getFn,fieldNormWeight:t=W.fieldNormWeight}={}){let{keys:r,records:a}=n,i=new yr({getFn:e,fieldNormWeight:t});return i.setKeys(r),i.setIndexRecords(a),i}function Ct(n,{errors:e=0,currentLocation:t=0,expectedLocation:r=0,distance:a=W.distance,ignoreLocation:i=W.ignoreLocation}={}){let l=e/n.length;if(i)return l;let s=Math.abs(r-t);return a?l+s/a:s?1:l}function ns(n=[],e=W.minMatchCharLength){let t=[],r=-1,a=-1,i=0;for(let l=n.length;i<l;i+=1){let s=n[i];s&&r===-1?r=i:s||r===-1||((a=i-1)-r+1>=e&&t.push([r,a]),r=-1)}return n[i-1]&&i-r>=e&&t.push([r,i-1]),t}let Qe=32;function as(n,e,t,{location:r=W.location,distance:a=W.distance,threshold:i=W.threshold,findAllMatches:l=W.findAllMatches,minMatchCharLength:s=W.minMatchCharLength,includeMatches:u=W.includeMatches,ignoreLocation:o=W.ignoreLocation}={}){let p;if(e.length>Qe)throw Error(Qi(Qe));let m=e.length,d=n.length,y=Math.max(0,Math.min(r,d)),f=i,S=y,v=s>1||u,w=v?Array(d):[];for(;(p=n.indexOf(e,S))>-1;)if(f=Math.min(Ct(e,{currentLocation:p,expectedLocation:y,distance:a,ignoreLocation:o}),f),S=p+m,v){let P=0;for(;P<m;)w[p+P]=1,P+=1}S=-1;let g=[],_=1,$=m+d,x=1<<m-1;for(let P=0;P<m;P+=1){let D=0,R=$;for(;D<R;)Ct(e,{errors:P,currentLocation:y+R,expectedLocation:y,distance:a,ignoreLocation:o})<=f?D=R:$=R,R=Math.floor(($-D)/2+D);$=R;let I=Math.max(1,y-R+1),F=l?d:Math.min(y+R,d)+m,C=Array(F+2);C[F+1]=(1<<P)-1;for(let B=F;B>=I;B-=1){let V=B-1,X=t[n.charAt(V)];if(v&&(w[V]=+!!X),C[B]=(C[B+1]<<1|1)&X,P&&(C[B]|=(g[B+1]|g[B])<<1|1|g[B+1]),C[B]&x&&(_=Ct(e,{errors:P,currentLocation:V,expectedLocation:y,distance:a,ignoreLocation:o}))<=f){if(f=_,(S=V)<=y)break;I=Math.max(1,2*y-S)}}if(Ct(e,{errors:P+1,currentLocation:y,expectedLocation:y,distance:a,ignoreLocation:o})>f)break;g=C}let T={isMatch:S>=0,score:Math.max(.001,_)};if(v){let P=ns(w,s);P.length?u&&(T.indices=P):T.isMatch=!1}return T}function is(n){let e={};for(let t=0,r=n.length;t<r;t+=1){let a=n.charAt(t);e[a]=(e[a]||0)|1<<r-t-1}return e}class Tn{constructor(e,{location:t=W.location,threshold:r=W.threshold,distance:a=W.distance,includeMatches:i=W.includeMatches,findAllMatches:l=W.findAllMatches,minMatchCharLength:s=W.minMatchCharLength,isCaseSensitive:u=W.isCaseSensitive,ignoreLocation:o=W.ignoreLocation}={}){if(this.options={location:t,threshold:r,distance:a,includeMatches:i,findAllMatches:l,minMatchCharLength:s,isCaseSensitive:u,ignoreLocation:o},this.pattern=u?e:e.toLowerCase(),this.chunks=[],!this.pattern.length)return;let p=(d,y)=>{this.chunks.push({pattern:d,alphabet:is(d),startIndex:y})},m=this.pattern.length;if(m>Qe){let d=0,y=m%Qe,f=m-y;for(;d<f;)p(this.pattern.substr(d,Qe),d),d+=Qe;if(y){let S=m-Qe;p(this.pattern.substr(S),S)}}else p(this.pattern,0)}searchIn(e){let{isCaseSensitive:t,includeMatches:r}=this.options;if(t||(e=e.toLowerCase()),this.pattern===e){let f={isMatch:!0,score:0};return r&&(f.indices=[[0,e.length-1]]),f}let{location:a,distance:i,threshold:l,findAllMatches:s,minMatchCharLength:u,ignoreLocation:o}=this.options,p=[],m=0,d=!1;this.chunks.forEach(({pattern:f,alphabet:S,startIndex:v})=>{let{isMatch:w,score:g,indices:_}=as(e,f,S,{location:a+v,distance:i,threshold:l,findAllMatches:s,minMatchCharLength:u,includeMatches:r,ignoreLocation:o});w&&(d=!0),m+=g,w&&_&&(p=[...p,..._])});let y={isMatch:d,score:d?m/this.chunks.length:1};return d&&r&&(y.indices=p),y}}class Ge{constructor(e){this.pattern=e}static isMultiMatch(e){return Pn(e,this.multiRegex)}static isSingleMatch(e){return Pn(e,this.singleRegex)}search(){}}function Pn(n,e){let t=n.match(e);return t?t[1]:null}class ss extends Ge{constructor(e){super(e)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(e){let t=e===this.pattern;return{isMatch:t,score:t?0:1,indices:[0,this.pattern.length-1]}}}class os extends Ge{constructor(e){super(e)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(e){let t=e.indexOf(this.pattern)===-1;return{isMatch:t,score:t?0:1,indices:[0,e.length-1]}}}class ls extends Ge{constructor(e){super(e)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\\^"(.*)"$/}static get singleRegex(){return/^\\^(.*)$/}search(e){let t=e.startsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,this.pattern.length-1]}}}class cs extends Ge{constructor(e){super(e)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\\^"(.*)"$/}static get singleRegex(){return/^!\\^(.*)$/}search(e){let t=!e.startsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,e.length-1]}}}class us extends Ge{constructor(e){super(e)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\\$$/}static get singleRegex(){return/^(.*)\\$$/}search(e){let t=e.endsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[e.length-this.pattern.length,e.length-1]}}}class ps extends Ge{constructor(e){super(e)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\\$$/}static get singleRegex(){return/^!(.*)\\$$/}search(e){let t=!e.endsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,e.length-1]}}}class Cn extends Ge{constructor(e,{location:t=W.location,threshold:r=W.threshold,distance:a=W.distance,includeMatches:i=W.includeMatches,findAllMatches:l=W.findAllMatches,minMatchCharLength:s=W.minMatchCharLength,isCaseSensitive:u=W.isCaseSensitive,ignoreLocation:o=W.ignoreLocation}={}){super(e),this._bitapSearch=new Tn(e,{location:t,threshold:r,distance:a,includeMatches:i,findAllMatches:l,minMatchCharLength:s,isCaseSensitive:u,ignoreLocation:o})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(e){return this._bitapSearch.searchIn(e)}}class Nn extends Ge{constructor(e){super(e)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(e){let t,r=0,a=[],i=this.pattern.length;for(;(t=e.indexOf(this.pattern,r))>-1;)r=t+i,a.push([t,r-1]);let l=!!a.length;return{isMatch:l,score:l?0:1,indices:a}}}let _r=[ss,Nn,ls,cs,ps,us,os,Cn],Mn=_r.length,ds=/ +(?=(?:[^\\"]*\\"[^\\"]*\\")*[^\\"]*$)/,fs="|";function hs(n,e={}){return n.split(fs).map(t=>{let r=t.trim().split(ds).filter(i=>i&&!!i.trim()),a=[];for(let i=0,l=r.length;i<l;i+=1){let s=r[i],u=!1,o=-1;for(;!u&&++o<Mn;){let p=_r[o],m=p.isMultiMatch(s);m&&(a.push(new p(m,e)),u=!0)}if(!u)for(o=-1;++o<Mn;){let p=_r[o],m=p.isSingleMatch(s);if(m){a.push(new p(m,e));break}}}return a})}let ms=new Set([Cn.type,Nn.type]);class gs{constructor(e,{isCaseSensitive:t=W.isCaseSensitive,includeMatches:r=W.includeMatches,minMatchCharLength:a=W.minMatchCharLength,ignoreLocation:i=W.ignoreLocation,findAllMatches:l=W.findAllMatches,location:s=W.location,threshold:u=W.threshold,distance:o=W.distance}={}){this.query=null,this.options={isCaseSensitive:t,includeMatches:r,minMatchCharLength:a,findAllMatches:l,ignoreLocation:i,location:s,threshold:u,distance:o},this.pattern=t?e:e.toLowerCase(),this.query=hs(this.pattern,this.options)}static condition(e,t){return t.useExtendedSearch}searchIn(e){let t=this.query;if(!t)return{isMatch:!1,score:1};let{includeMatches:r,isCaseSensitive:a}=this.options;e=a?e:e.toLowerCase();let i=0,l=[],s=0;for(let u=0,o=t.length;u<o;u+=1){let p=t[u];l.length=0,i=0;for(let m=0,d=p.length;m<d;m+=1){let y=p[m],{isMatch:f,indices:S,score:v}=y.search(e);if(f){if(i+=1,s+=v,r){let w=y.constructor.type;ms.has(w)?l=[...l,...S]:l.push(S)}}else{s=0,i=0,l.length=0;break}}if(i){let m={isMatch:!0,score:s/i};return r&&(m.indices=l),m}}return{isMatch:!1,score:1}}}let br=[];function ys(...n){br.push(...n)}function vr(n,e){for(let t=0,r=br.length;t<r;t+=1){let a=br[t];if(a.condition(n,e))return new a(n,e)}return new Tn(n,e)}let Nt={AND:"$and",OR:"$or"},wr={PATH:"$path",PATTERN:"$val"},$r=n=>!!(n[Nt.AND]||n[Nt.OR]),_s=n=>!!n[wr.PATH],bs=n=>!Fe(n)&&En(n)&&!$r(n),Rn=n=>({[Nt.AND]:Object.keys(n).map(e=>({[e]:n[e]}))});function Fn(n,e,{auto:t=!0}={}){let r=a=>{let i=Object.keys(a),l=_s(a);if(!l&&i.length>1&&!$r(a))return r(Rn(a));if(bs(a)){let u=l?a[wr.PATH]:i[0],o=l?a[wr.PATTERN]:a[u];if(!Pe(o))throw Error(Ji(u));let p={keyId:gr(u),pattern:o};return t&&(p.searcher=vr(o,e)),p}let s={children:[],operator:i[0]};return i.forEach(u=>{let o=a[u];Fe(o)&&o.forEach(p=>{s.children.push(r(p))})}),s};return $r(n)||(n=Rn(n)),r(n)}function vs(n,{ignoreFieldNorm:e=W.ignoreFieldNorm}){n.forEach(t=>{let r=1;t.matches.forEach(({key:a,norm:i,score:l})=>{let s=a?a.weight:null;r*=Math.pow(l===0&&s?Number.EPSILON:l,(s||1)*(e?1:i))}),t.score=r})}function ws(n,e){let t=n.matches;e.matches=[],Se(t)&&t.forEach(r=>{if(!Se(r.indices)||!r.indices.length)return;let{indices:a,value:i}=r,l={indices:a,value:i};r.key&&(l.key=r.key.src),r.idx>-1&&(l.refIndex=r.idx),e.matches.push(l)})}function $s(n,e){e.score=n.score}function Ss(n,e,{includeMatches:t=W.includeMatches,includeScore:r=W.includeScore}={}){let a=[];return t&&a.push(ws),r&&a.push($s),n.map(i=>{let{idx:l}=i,s={item:e[l],refIndex:l};return a.length&&a.forEach(u=>{u(i,s)}),s})}class et{constructor(e,t={},r){this.options={...W,...t},this.options.useExtendedSearch,this._keyStore=new Ki(this.options.keys),this.setCollection(e,r)}setCollection(e,t){if(this._docs=e,t&&!(t instanceof yr))throw Error(Vi);this._myIndex=t||jn(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(e){Se(e)&&(this._docs.push(e),this._myIndex.add(e))}remove(e=()=>!1){let t=[];for(let r=0,a=this._docs.length;r<a;r+=1){let i=this._docs[r];e(i,r)&&(this.removeAt(r),r-=1,a-=1,t.push(i))}return t}removeAt(e){this._docs.splice(e,1),this._myIndex.removeAt(e)}getIndex(){return this._myIndex}search(e,{limit:t=-1}={}){let{includeMatches:r,includeScore:a,shouldSort:i,sortFn:l,ignoreFieldNorm:s}=this.options,u=Pe(e)?Pe(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e);return vs(u,{ignoreFieldNorm:s}),i&&u.sort(l),xn(t)&&t>-1&&(u=u.slice(0,t)),Ss(u,this._docs,{includeMatches:r,includeScore:a})}_searchStringList(e){let t=vr(e,this.options),{records:r}=this._myIndex,a=[];return r.forEach(({v:i,i:l,n:s})=>{if(!Se(i))return;let{isMatch:u,score:o,indices:p}=t.searchIn(i);u&&a.push({item:i,idx:l,matches:[{score:o,value:i,norm:s,indices:p}]})}),a}_searchLogical(e){let t=Fn(e,this.options),r=(s,u,o)=>{if(!s.children){let{keyId:m,searcher:d}=s,y=this._findMatches({key:this._keyStore.get(m),value:this._myIndex.getValueForItemAtKeyId(u,m),searcher:d});return y&&y.length?[{idx:o,item:u,matches:y}]:[]}let p=[];for(let m=0,d=s.children.length;m<d;m+=1){let y=r(s.children[m],u,o);if(y.length)p.push(...y);else if(s.operator===Nt.AND)return[]}return p},a=this._myIndex.records,i={},l=[];return a.forEach(({$:s,i:u})=>{if(Se(s)){let o=r(t,s,u);o.length&&(i[u]||(i[u]={idx:u,item:s,matches:[]},l.push(i[u])),o.forEach(({matches:p})=>{i[u].matches.push(...p)}))}}),l}_searchObjectList(e){let t=vr(e,this.options),{keys:r,records:a}=this._myIndex,i=[];return a.forEach(({$:l,i:s})=>{if(!Se(l))return;let u=[];r.forEach((o,p)=>{u.push(...this._findMatches({key:o,value:l[p],searcher:t}))}),u.length&&i.push({idx:s,item:l,matches:u})}),i}_findMatches({key:e,value:t,searcher:r}){if(!Se(t))return[];let a=[];if(Fe(t))t.forEach(({v:i,i:l,n:s})=>{if(!Se(i))return;let{isMatch:u,score:o,indices:p}=r.searchIn(i);u&&a.push({score:o,key:e,value:i,idx:l,norm:s,indices:p})});else{let{v:i,n:l}=t,{isMatch:s,score:u,indices:o}=r.searchIn(i);s&&a.push({score:u,key:e,value:i,norm:l,indices:o})}return a}}function xs(n,e){let[t,r,a]=n.split(":"),[i,l]=e.split(":"),s=6371,u=Mt(i-t),o=Mt(l-r),p=Math.sin(u/2)*Math.sin(u/2)+Math.cos(Mt(t))*Math.cos(Mt(i))*Math.sin(o/2)*Math.sin(o/2),m=2*Math.atan2(Math.sqrt(p),Math.sqrt(1-p))*s;return Number(a)>=m}function Mt(n){return Math.PI/180*n}function Es({type:n,date:e=0,match:t=!0}={},r){if(!r&&n)return!1;let a=new Date,i=!0;switch(n){case"day":let l=tt(e),s=tt(e+1);i=l<=r&&r<s;break;case"days":if(e<0){let d=tt(1);i=tt(-6)<=r&&r<d}else{let d=tt(),y=tt(7);i=d<=r&&r<y}break;case"day_week":i=e===new Date(r).getDay();break;case"week":let u=a.getDate()-a.getDay(),o=u+(e==-2?13:6),[p,m]=ks(a.setDate(u+7*e),new Date().setDate(o+7*e));i=p<=r&&r<=m;break;case"month":if(a.getFullYear()!==new Date(r).getFullYear())return!1;i=a.getMonth()+e===new Date(r).getMonth();break;case"year":i=a.getFullYear()+e===new Date(r).getFullYear();break;default:return!0}return t?i:!i}function ks(n,e){return[new Date(n),new Date(e)]}function tt(n=0){let e=new Date;return new Date(e.getFullYear(),e.getMonth(),e.getDate()+n).valueOf()}function Ln(n,e){if(n&&n.length)return e?n.filter(t=>t.fields.find(r=>r.index_value&&r.index_value.toLowerCase().indexOf(e.toLowerCase())!==-1)):n}et.version="6.6.2",et.createIndex=jn,et.parseIndex=rs,et.config=W,et.parseQuery=Fn,ys(gs);let Dn=new et([]);function As(n,e){return Dn.setCollection(e),!!Dn.search(n).length}function Is(n,e){let t=new Rs;return n&&n.length?t.filter(e,n):[]}class Os{changeBehavior(e){switch(e){case"contain_or":this._checkFn=function(t,r){return r.some(a=>t.some(i=>i.indexOf(a)!==-1))};break;case"contain_and":this._checkFn=function(t,r){return r.every(a=>t.some(i=>i.indexOf(a)!==-1))};break;case"not_contain_or":this._checkFn=function(t,r){return r.some(a=>t.every(i=>i.indexOf(a)===-1))};break;case"not_contain_and":this._checkFn=function(t,r){return r.every(a=>t.every(i=>i.indexOf(a)===-1))};break;case"equal_or":this._checkFn=function(t,r){return!!t.length&&t.some(a=>r.some(i=>a==i))};break;case"equal_and":this._checkFn=function(t,r){if(!t.length)return!1;let a=new Set(r);for(;t.length&&a.size;){let i=t.pop();a.has(i)&&a.delete(i)}return!a.size};break;case"not_equal_or":this._checkFn=function(t,r){if(!t.length)return!0;let a=new Set(r);for(;t.length&&a.size;){let i=t.pop();if(!a.has(i))return!0}return!1};break;case"not_equal_and":this._checkFn=function(t,r){let a=new Set(r);for(;t.length&&a.size;){let i=t.pop();if(a.has(i))return!1}return!0};break;case"bigger":this._checkFn=function(t,r){return r.some(a=>t.every(i=>i>a))};break;case"lower":this._checkFn=function(t,r){return r.some(a=>t.every(i=>i<a))};break;case"range":this._checkFn=function(t,r){return r.some(a=>t.every(i=>a.start<=i&&i<a.end))};break;case"value":this._checkFn=function(t,r){return r.some(a=>t.some(i=>i==a))};break;case"search":this._checkFn=function(t,r){return r.some(a=>As(a,t))};break;case"phone_equal_or":this._checkFn=function(t,r){return!!t.length&&r.some(a=>t.some(i=>i.replace(/[^0-9]/g,"").indexOf(a.replace(/[^0-9]/g,""))!==-1))};break;case"distance":this._checkFn=function(t,r){return r.some(a=>t.some(i=>xs(a,i)))};break;case"date_in":case"date_out":this._checkFn=function(t,r){return r.some(a=>t.some(i=>Es(a,i)))};break;case"recurring_date":this._checkFn=function(t,r){return r.some(a=>t.some(i=>gudhub.checkRecurringDate(i,a)))}}return this}check(e){return this.changeBehavior(e.getCheckOption())._checkFn(e.getEntity(),e.getFilterValues())}}class Sr{convert(e){return[Number(e)]}convertFilterValue(e){return Number(e)}}class js extends Sr{convertFilterValue(e){return{start:Number(e.split(":")[0]),end:Number(e.split(":")[1])}}}class Ts{convert(e){return String(e??"").toLowerCase().split(",")}convertFilterValue(e){return e===0?"0":String(e||"").toLowerCase()}}class Ps extends Sr{convertFilterValue(e){let[t,r,a]=e.split(":");return{type:t,date:Number(r),match:!!Number(a)}}}class Cs{convert(e){return[String(!!e)]}convertFilterValue(e){return String(e)}}class Ns{convert(e){return[Number(e)]}convertFilterValue(e){return String(e)}}class Ms{constructor(){this._strategies={stringStrategy:new Ts,numberStrategy:new Sr,booleanStrategy:new Cs,rangeStrategy:new js,dateStrategy:new Ps,recurringDateStrategy:new Ns}}setStrategy(e){switch(this._checkOption=e,e){case"contain_or":case"contain_and":case"not_contain_or":case"not_contain_and":case"equal_or":case"equal_and":case"not_equal_or":case"not_equal_and":case"phone_equal_or":case"distance":case"search":this._currentStrategy=this._strategies.stringStrategy;break;case"bigger":case"lower":this._currentStrategy=this._strategies.numberStrategy;break;case"range":this._currentStrategy=this._strategies.rangeStrategy;break;case"date_in":case"date_out":this._currentStrategy=this._strategies.dateStrategy;break;case"value":this._currentStrategy=this._strategies.booleanStrategy;break;case"recurring_date":this._currentStrategy=this._strategies.recurringDateStrategy}return this}setEntity(e){return this._entity=this._currentStrategy.convert(e),this}getEntity(){return this._entity}setFilterValues(e){let t=Array.isArray(e)?e:[e];return this._filterValues=t.map(r=>this._currentStrategy.convertFilterValue(r)),this}getFilterValues(){return this._filterValues}getCheckOption(){return this._checkOption}}class Rs{constructor(){}filter(e,t){let r=this.checkIfAllFiltersHaveAndStrategy(e),a=[],i=e.filter(function(l){return l.valuesArray.length});for(let l of t){let s=!0;for(let u=0;u<i.length;u++){let o=i[u],p=l.fields.find(function(y){return o.field_id==y.field_id}),m=new Ms,d=new Os;switch(m.setStrategy(o.search_type).setEntity(p&&p.field_value!=null?p.field_value:null).setFilterValues(o.valuesArray),o.boolean_strategy){case"and":default:s=s&&d.check(m);break;case"or":s=s||d.check(m)}if(!s&&r)break}s&&a.push(l)}return a.length||e.length&&!a.length?a:t}checkIfAllFiltersHaveAndStrategy(e){return e.every(t=>!t.boolean_strategy||t.boolean_strategy=="and")}}function Fs(n,e){let t=[],r=[];if(n.length>0?n.forEach(a=>{r.push(a)}):r=e,r.length>0){r.forEach((a,i)=>{for(let l=0;l<e.length;l++)a.field_id==e[l].field_id&&(t.push(a.field_id),r[i]=gudhub.mergeObjects(e[l],a))});for(let a=0;a<e.length;a++)t.includes(e[a].field_id)||r.push(e[a])}return r}var xr={};function Ls(n,e){let t=[];return e.forEach(r=>{let a=[];try{a=G(xr).paths(n,r.json_path),t.push({field_id:r.field_id,json_paths:a,json_paths_length:a.length})}catch(i){console.log(i)}}),t.sort((r,a)=>a.json_paths_length-r.json_paths_length),qs(t).map(r=>({fields:r.fields.map(a=>({field_id:a.field_id,field_value:G(xr).value(n,a.json_path)}))}))}function Ds(n,e){let t=[];return e.forEach(r=>{t.push({path_to_compare:r,match_coefficient:0})}),n.forEach((r,a)=>{for(var i=0;i<t.length;i++)t[i].path_to_compare[a]==r&&(t[i].match_coefficient+=1/(a+1))}),t.sort((r,a)=>a.match_coefficient-r.match_coefficient),t[0].path_to_compare}function qs(n){let e=[];return n.length&&n[0].json_paths.forEach(t=>{let r={fields:[]};n.forEach(a=>{r.fields.push({field_id:a.field_id,json_path:Ds(t,a.json_paths)})}),e.push(r)}),e}function Bs(n,e,t,r,a,i){let l=[],s=function(u,o){let p=Ye(o,a);p&&(p.field_value=i+"."+u.item_id,l.push(o))};return t.forEach(u=>{n.forEach(o=>{Hs(o,u,e,r,s)})}),l}function Us(n,e,t){let r=JSON.parse(JSON.stringify(n)),a=JSON.parse(JSON.stringify(e)),i=[],l=function(p,m){i.push(Ws(p,m))},s=function(p){i.push(p)},u=function(p){i.push(p)};return t?qn(r,a,t,l,s,u):Bn(r,a,l,s,u,function(p){i.push(p)}),i}function Gs(n,e,t){let r=JSON.parse(JSON.stringify(n)),a=JSON.parse(JSON.stringify(e)),i={is_items_diff:!1,new_src_items:[],diff_src_items:[],same_items:[],trash_src_items:[]},l=function(p){i.diff_src_items.push(p)},s=function(p){i.same_items.push(p)},u=function(p){i.new_src_items.push(p)},o=function(p){i.trash_src_items.push(p)};return t&&qn(r,a,t,l,s,u),t||Bn(r,a,l,s,u,null,o),i.is_items_diff=i.new_src_items.length>0||i.diff_src_items.length>0,i}function Ws(n,e){return n.fields.forEach(t=>{let r=Ye(e,t.field_id);r?(r.field_value=t.field_value,t.history&&r.history&&(r.history=t.history.concat(r.history))):e.fields.push(t)}),e}function qn(n,e,t,r,a,i){n.forEach(l=>{let s=!0,u=Ye(l,t).field_value;e.forEach(o=>{u==Ye(o,t).field_value&&(s=!1,Un(l,o,r,a))}),s&&i(l)})}function Bn(n,e,t,r,a,i,l){let s=new zs(e);if(n.forEach(u=>{let o=s.pullItemIndex(u.item_id);o!=null?Un(u,e[o],t,r,l):(u.trash&&l(u),u.trash||a(u))}),i)for(let[u,o]of Object.entries(s.itemsMap))i(e[o])}function Un(n,e,t,r,a){let i=!0;for(let l=0;l<n.fields.length;l++){let s=Ye(e,n.fields[l].field_id);s?s.field_value!=n.fields[l].field_value&&(i=i&&!1):i=i&&!1}i&&(n.trash&&a(n,e),n.trash||r(n,e)),i||(n.trash&&a(n,e),n.trash||t(n,e))}function Hs(n,e,t,r,a){Ye(n,t).field_value==Ye(e,r).field_value&&a(n,e)}function Ye(n,e){let t=null;for(let r=0;r<n.fields.length;r++)e==n.fields[r].field_id&&(t=n.fields[r]);return t}(function(n){xr=n()})(function(){return function n(e,t,r){function a(s,u){if(!t[s]){if(!e[s]){var o=void 0;if(!u&&o)return o(s,!0);if(i)return i(s,!0);var p=Error("Cannot find module '"+s+"'");throw p.code="MODULE_NOT_FOUND",p}var m=t[s]={exports:{}};e[s][0].call(m.exports,function(d){return a(e[s][1][d]||d)},m,m.exports,n,e,t,r)}return t[s].exports}for(var i=void 0,l=0;l<r.length;l++)a(r[l]);return a}({"./aesprim":[function(n,e,t){(function(r,a){a(t!==void 0?t:r.esprima={})})(this,function(r){var a,i,l,s,u,o,p,m,d,y,f,S,v,w,g,_,$,x;function T(c,h){if(!c)throw Error("ASSERT: "+h)}function P(c){return c>=48&&c<=57}function D(c){return"0123456789abcdefABCDEF".indexOf(c)>=0}function R(c){return"01234567".indexOf(c)>=0}function I(c){return c===32||c===9||c===11||c===12||c===160||c>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].indexOf(c)>=0}function F(c){return c===10||c===13||c===8232||c===8233}function C(c){return c==64||c===36||c===95||c>=65&&c<=90||c>=97&&c<=122||c===92||c>=128&&p.NonAsciiIdentifierStart.test(String.fromCharCode(c))}function B(c){return c===36||c===95||c>=65&&c<=90||c>=97&&c<=122||c>=48&&c<=57||c===92||c>=128&&p.NonAsciiIdentifierPart.test(String.fromCharCode(c))}function V(c){switch(c){case"class":case"enum":case"export":case"extends":case"import":case"super":return!0;default:return!1}}function X(c){switch(c){case"implements":case"interface":case"package":case"private":case"protected":case"public":case"static":case"yield":case"let":return!0;default:return!1}}function oe(c){return c==="eval"||c==="arguments"}function we(c){if(y&&X(c))return!0;switch(c.length){case 2:return c==="if"||c==="in"||c==="do";case 3:return c==="var"||c==="for"||c==="new"||c==="try"||c==="let";case 4:return c==="this"||c==="else"||c==="case"||c==="void"||c==="with"||c==="enum";case 5:return c==="while"||c==="break"||c==="catch"||c==="throw"||c==="const"||c==="yield"||c==="class"||c==="super";case 6:return c==="return"||c==="typeof"||c==="delete"||c==="switch"||c==="export"||c==="import";case 7:return c==="default"||c==="finally"||c==="extends";case 8:return c==="function"||c==="continue"||c==="debugger";case 10:return c==="instanceof";default:return!1}}function H(c,h,b,E,j){var M;T(typeof b=="number","Comment must have valid position"),!($.lastCommentStart>=b)&&($.lastCommentStart=b,M={type:c,value:h},x.range&&(M.range=[b,E]),x.loc&&(M.loc=j),x.comments.push(M),x.attachComment&&(x.leadingComments.push(M),x.trailingComments.push(M)))}function ie(c){var h,b,E,j;for(h=f-c,b={start:{line:S,column:f-v-c}};f<w;)if(E=d.charCodeAt(f),++f,F(E)){x.comments&&(j=d.slice(h+c,f-1),b.end={line:S,column:f-v-1},H("Line",j,h,f-1,b)),E===13&&d.charCodeAt(f)===10&&++f,++S,v=f;return}x.comments&&(j=d.slice(h+c,f),b.end={line:S,column:f-v},H("Line",j,h,f,b))}function ee(){var c,h,b,E;for(x.comments&&(c=f-2,h={start:{line:S,column:f-v-2}});f<w;)if(F(b=d.charCodeAt(f)))b===13&&d.charCodeAt(f+1)===10&&++f,++S,v=++f,f>=w&&Y({},o.UnexpectedToken,"ILLEGAL");else if(b===42){if(d.charCodeAt(f+1)===47){++f,++f,x.comments&&(E=d.slice(c+2,f-2),h.end={line:S,column:f-v},H("Block",E,c,f,h));return}++f}else++f;Y({},o.UnexpectedToken,"ILLEGAL")}function k(){var c,h;for(h=f===0;f<w;)if(I(c=d.charCodeAt(f)))++f;else if(F(c))++f,c===13&&d.charCodeAt(f)===10&&++f,++S,v=f,h=!0;else if(c===47)if((c=d.charCodeAt(f+1))===47)++f,++f,ie(2),h=!0;else if(c===42)++f,++f,ee();else break;else if(h&&c===45)if(d.charCodeAt(f+1)===45&&d.charCodeAt(f+2)===62)f+=3,ie(3);else break;else if(c===60)if(d.slice(f+1,f+4)==="!--")++f,++f,++f,++f,ie(4);else break;else break}function O(c){var h,b,E,j=0;for(h=0,b=c==="u"?4:2;h<b;++h){if(!(f<w&&D(d[f])))return"";E=d[f++],j=16*j+"0123456789abcdef".indexOf(E.toLowerCase())}return String.fromCharCode(j)}function N(){var c,h;for(h=String.fromCharCode(c=d.charCodeAt(f++)),c===92&&(d.charCodeAt(f)!==117&&Y({},o.UnexpectedToken,"ILLEGAL"),++f,(c=O("u"))&&c!=="\\\\"&&C(c.charCodeAt(0))||Y({},o.UnexpectedToken,"ILLEGAL"),h=c);f<w&&B(c=d.charCodeAt(f));)++f,h+=String.fromCharCode(c),c===92&&(h=h.substr(0,h.length-1),d.charCodeAt(f)!==117&&Y({},o.UnexpectedToken,"ILLEGAL"),++f,(c=O("u"))&&c!=="\\\\"&&B(c.charCodeAt(0))||Y({},o.UnexpectedToken,"ILLEGAL"),h+=c);return h}function K(){var c,h;for(c=f++;f<w;){if((h=d.charCodeAt(f))===92)return f=c,N();if(B(h))++f;else break}return d.slice(c,f)}function se(){var c,h;return c=f,{type:(h=d.charCodeAt(f)===92?N():K()).length===1?a.Identifier:we(h)?a.Keyword:h==="null"?a.NullLiteral:h==="true"||h==="false"?a.BooleanLiteral:a.Identifier,value:h,lineNumber:S,lineStart:v,start:c,end:f}}function te(){var c,h,b,E,j=f,M=d.charCodeAt(f),z=d[f];switch(M){case 46:case 40:case 41:case 59:case 44:case 123:case 125:case 91:case 93:case 58:case 63:case 126:return++f,x.tokenize&&(M===40?x.openParenToken=x.tokens.length:M===123&&(x.openCurlyToken=x.tokens.length)),{type:a.Punctuator,value:String.fromCharCode(M),lineNumber:S,lineStart:v,start:j,end:f};default:if((c=d.charCodeAt(f+1))===61)switch(M){case 43:case 45:case 47:case 60:case 62:case 94:case 124:case 37:case 38:case 42:return f+=2,{type:a.Punctuator,value:String.fromCharCode(M)+String.fromCharCode(c),lineNumber:S,lineStart:v,start:j,end:f};case 33:case 61:return f+=2,d.charCodeAt(f)===61&&++f,{type:a.Punctuator,value:d.slice(j,f),lineNumber:S,lineStart:v,start:j,end:f}}}return(E=d.substr(f,4))===">>>="?(f+=4,{type:a.Punctuator,value:E,lineNumber:S,lineStart:v,start:j,end:f}):(b=E.substr(0,3))===">>>"||b==="<<="||b===">>="?(f+=3,{type:a.Punctuator,value:b,lineNumber:S,lineStart:v,start:j,end:f}):z===(h=b.substr(0,2))[1]&&"+-<>&|".indexOf(z)>=0||h==="=>"?(f+=2,{type:a.Punctuator,value:h,lineNumber:S,lineStart:v,start:j,end:f}):"<>=!+-*%&|^/".indexOf(z)>=0?(++f,{type:a.Punctuator,value:z,lineNumber:S,lineStart:v,start:j,end:f}):void Y({},o.UnexpectedToken,"ILLEGAL")}function J(c){for(var h="";f<w&&D(d[f]);)h+=d[f++];return h.length===0&&Y({},o.UnexpectedToken,"ILLEGAL"),C(d.charCodeAt(f))&&Y({},o.UnexpectedToken,"ILLEGAL"),{type:a.NumericLiteral,value:parseInt("0x"+h,16),lineNumber:S,lineStart:v,start:c,end:f}}function ce(c){for(var h="0"+d[f++];f<w&&R(d[f]);)h+=d[f++];return(C(d.charCodeAt(f))||P(d.charCodeAt(f)))&&Y({},o.UnexpectedToken,"ILLEGAL"),{type:a.NumericLiteral,value:parseInt(h,8),octal:!0,lineNumber:S,lineStart:v,start:c,end:f}}function re(){var c,h,b;if(T(P((b=d[f]).charCodeAt(0))||b===".","Numeric literal must start with a decimal digit or a decimal point"),h=f,c="",b!=="."){if(c=d[f++],b=d[f],c==="0"){if(b==="x"||b==="X")return++f,J(h);if(R(b))return ce(h);b&&P(b.charCodeAt(0))&&Y({},o.UnexpectedToken,"ILLEGAL")}for(;P(d.charCodeAt(f));)c+=d[f++];b=d[f]}if(b==="."){for(c+=d[f++];P(d.charCodeAt(f));)c+=d[f++];b=d[f]}if(b==="e"||b==="E")if(c+=d[f++],((b=d[f])==="+"||b==="-")&&(c+=d[f++]),P(d.charCodeAt(f)))for(;P(d.charCodeAt(f));)c+=d[f++];else Y({},o.UnexpectedToken,"ILLEGAL");return C(d.charCodeAt(f))&&Y({},o.UnexpectedToken,"ILLEGAL"),{type:a.NumericLiteral,value:parseFloat(c),lineNumber:S,lineStart:v,start:h,end:f}}function fe(){var c,h,b,E,j,M,z,pe,ae="",be=!1;for(z=S,pe=v,T((c=d[f])==="'"||c==='"',"String literal must starts with a quote"),h=f,++f;f<w;){if((b=d[f++])===c){c="";break}if(b==="\\\\")if((b=d[f++])&&F(b.charCodeAt(0)))++S,b==="\\r"&&d[f]===\`
15432
15232
  \`&&++f,v=f;else switch(b){case"u":case"x":M=f,(j=O(b))?ae+=j:(f=M,ae+=b);break;case"n":ae+=\`
15433
- \`;break;case"r":ae+="\\r";break;case"t":ae+=" ";break;case"b":ae+="\\b";break;case"f":ae+="\\f";break;case"v":ae+="\\v";break;default:R(b)?((E="01234567".indexOf(b))!==0&&(_e=!0),f<w&&R(d[f])&&(_e=!0,E=8*E+"01234567".indexOf(d[f++]),"0123".indexOf(b)>=0&&f<w&&R(d[f])&&(E=8*E+"01234567".indexOf(d[f++]))),ae+=String.fromCharCode(E)):ae+=b}else{if(F(b.charCodeAt(0)))break;ae+=b}}return c!==""&&Q({},o.UnexpectedToken,"ILLEGAL"),{type:a.StringLiteral,value:ae,octal:_e,startLineNumber:z,startLineStart:pe,lineNumber:S,lineStart:v,start:h,end:f}}function ke(c,h){var b;try{b=new RegExp(c,h)}catch{Q({},o.InvalidRegExp)}return b}function Ae(){var c,h,b,E;for(T((c=d[f])==="/","Regular expression literal must start with a slash"),h=d[f++],b=!1,E=!1;f<w;)if(h+=c=d[f++],c==="\\\\")F((c=d[f++]).charCodeAt(0))&&Q({},o.UnterminatedRegExp),h+=c;else if(F(c.charCodeAt(0)))Q({},o.UnterminatedRegExp);else if(b)c==="]"&&(b=!1);else{if(c==="/"){E=!0;break}c==="["&&(b=!0)}return E||Q({},o.UnterminatedRegExp),{value:h.substr(1,h.length-2),literal:h}}function Sr(){var c,h,b,E;for(h="",b="";f<w&&B((c=d[f]).charCodeAt(0));)if(++f,c==="\\\\"&&f<w)if((c=d[f])==="u"){if(E=++f,c=O("u"))for(b+=c,h+="\\\\u";E<f;++E)h+=d[E];else f=E,b+="u",h+="\\\\u";ne({},o.UnexpectedToken,"ILLEGAL")}else h+="\\\\",ne({},o.UnexpectedToken,"ILLEGAL");else b+=c,h+=c;return{value:b,literal:h}}function zn(){var c,h,b,E;return _=null,k(),c=f,h=Ae(),b=Sr(),E=ke(h.value,b.value),x.tokenize?{type:a.RegularExpression,value:E,lineNumber:S,lineStart:v,start:c,end:f}:{literal:h.literal+b.literal,value:E,start:c,end:f}}function rt(){var c,h,b,E;return k(),c=f,h={start:{line:S,column:f-v}},b=zn(),h.end={line:S,column:f-v},x.tokenize||(x.tokens.length>0&&(E=x.tokens[x.tokens.length-1]).range[0]===c&&E.type==="Punctuator"&&(E.value==="/"||E.value==="/=")&&x.tokens.pop(),x.tokens.push({type:"RegularExpression",value:b.literal,range:[c,f],loc:h})),b}function Bo(c){return c.type===a.Identifier||c.type===a.Keyword||c.type===a.BooleanLiteral||c.type===a.NullLiteral}function Uo(){var c,h;if(!(c=x.tokens[x.tokens.length-1]))return rt();if(c.type==="Punctuator"){if(c.value==="]")return te();if(c.value===")")return(h=x.tokens[x.openParenToken-1])&&h.type==="Keyword"&&(h.value==="if"||h.value==="while"||h.value==="for"||h.value==="with")?rt():te();if(c.value==="}"){if(x.tokens[x.openCurlyToken-3]&&x.tokens[x.openCurlyToken-3].type==="Keyword"){if(!(h=x.tokens[x.openCurlyToken-4]))return te()}else{if(!x.tokens[x.openCurlyToken-4]||x.tokens[x.openCurlyToken-4].type!=="Keyword")return te();if(!(h=x.tokens[x.openCurlyToken-5]))return rt()}if(l.indexOf(h.value)>=0)return te()}return rt()}return c.type==="Keyword"?rt():te()}function xr(){var c;return k(),f>=w?{type:a.EOF,lineNumber:S,lineStart:v,start:f,end:f}:C(c=d.charCodeAt(f))?se():c===40||c===41||c===59?te():c===39||c===34?fe():c===46?P(d.charCodeAt(f+1))?re():te():P(c)?re():x.tokenize&&c===47?Uo():te()}function Vn(){var c,h,b;return k(),c={start:{line:S,column:f-v}},h=xr(),c.end={line:S,column:f-v},h.type!==a.EOF&&(b=d.slice(h.start,h.end),x.tokens.push({type:i[h.type],value:b,range:[h.start,h.end],loc:c})),h}function Y(){var c;return f=(c=_).end,S=c.lineNumber,v=c.lineStart,_=x.tokens!==void 0?Vn():xr(),f=c.end,S=c.lineNumber,v=c.lineStart,c}function Er(){var c,h,b;c=f,h=S,b=v,_=x.tokens!==void 0?Vn():xr(),f=c,S=h,v=b}function Jn(c,h){this.line=c,this.column=h}function Go(c,h,b,E){this.start=new Jn(c,h),this.end=new Jn(b,E)}function gt(){var c,h,b,E;return c=f,h=S,b=v,k(),E=S!==h,f=c,S=h,v=b,E}function Q(c,h){var b,E=Array.prototype.slice.call(arguments,2),j=h.replace(/%(\\d)/g,function(M,z){return T(z<E.length,"Message reference must be in range"),E[z]});throw typeof c.lineNumber=="number"?((b=Error("Line "+c.lineNumber+": "+j)).index=c.start,b.lineNumber=c.lineNumber,b.column=c.start-v+1):((b=Error("Line "+S+": "+j)).index=f,b.lineNumber=S,b.column=f-v+1),b.description=j,b}function ne(){try{Q.apply(null,arguments)}catch(c){if(x.errors)x.errors.push(c);else throw c}}function Pe(c){if(c.type===a.EOF&&Q(c,o.UnexpectedEOS),c.type===a.NumericLiteral&&Q(c,o.UnexpectedNumber),c.type===a.StringLiteral&&Q(c,o.UnexpectedString),c.type===a.Identifier&&Q(c,o.UnexpectedIdentifier),c.type===a.Keyword){if(V(c.value))Q(c,o.UnexpectedReserved);else if(y&&X(c.value)){ne(c,o.StrictReservedWord);return}Q(c,o.UnexpectedToken,c.value)}Q(c,o.UnexpectedToken,c.value)}function U(c){var h=Y();(h.type!==a.Punctuator||h.value!==c)&&Pe(h)}function ue(c){var h=Y();(h.type!==a.Keyword||h.value!==c)&&Pe(h)}function q(c){return _.type===a.Punctuator&&_.value===c}function me(c){return _.type===a.Keyword&&_.value===c}function Wo(){var c;return _.type===a.Punctuator&&((c=_.value)==="="||c==="*="||c==="/="||c==="%="||c==="+="||c==="-="||c==="<<="||c===">>="||c===">>>="||c==="&="||c==="^="||c==="|=")}function Ce(){var c;if(d.charCodeAt(f)===59||q(";")){Y();return}c=S,k(),S!==c||_.type===a.EOF||q("}")||Pe(_)}function Rt(c){return c.type===s.Identifier||c.type===s.MemberExpression}function Ho(){var c,h=[];for(c=_,U("[");!q("]");)q(",")?(Y(),h.push(null)):(h.push(Ie()),q("]")||U(","));return Y(),g.markEnd(g.createArrayExpression(h),c)}function kr(c,h){var b,E,j;return b=y,j=_,E=Ir(),h&&y&&le(c[0].name)&&ne(h,o.StrictParamName),y=b,g.markEnd(g.createFunctionExpression(null,c,[],E),j)}function Ft(){var c,h;return h=_,(c=Y()).type===a.StringLiteral||c.type===a.NumericLiteral?(y&&c.octal&&ne(c,o.StrictOctalLiteral),g.markEnd(g.createLiteral(c),h)):g.markEnd(g.createIdentifier(c.value),h)}function zo(){var c,h,b,E,j,M;return c=_,M=_,c.type===a.Identifier?(b=Ft(),c.value!=="get"||q(":")?c.value!=="set"||q(":")?(U(":"),E=Ie(),g.markEnd(g.createProperty("init",b,E),M)):(h=Ft(),U("("),(c=_).type!==a.Identifier?(U(")"),ne(c,o.UnexpectedToken,c.value),E=kr([])):(j=[Ge()],U(")"),E=kr(j,c)),g.markEnd(g.createProperty("set",h,E),M)):(h=Ft(),U("("),U(")"),E=kr([]),g.markEnd(g.createProperty("get",h,E),M))):c.type!==a.EOF&&c.type!==a.Punctuator?(h=Ft(),U(":"),E=Ie(),g.markEnd(g.createProperty("init",h,E),M)):void Pe(c)}function Vo(){var c,h,b,E,j,M=[],z={},pe=String;for(j=_,U("{");!q("}");)h=(c=zo()).key.type===s.Identifier?c.key.name:pe(c.key.value),E=c.kind==="init"?u.Data:c.kind==="get"?u.Get:u.Set,b="$"+h,Object.prototype.hasOwnProperty.call(z,b)?(z[b]===u.Data?y&&E===u.Data?ne({},o.StrictDuplicateProperty):E!==u.Data&&ne({},o.AccessorDataProperty):E===u.Data?ne({},o.AccessorDataProperty):z[b]&E&&ne({},o.AccessorGetSet),z[b]|=E):z[b]=E,M.push(c),q("}")||U(",");return U("}"),g.markEnd(g.createObjectExpression(M),j)}function Jo(){var c;return U("("),c=he(),U(")"),c}function Yn(){var c,h,b,E;if(q("("))return Jo();if(q("["))return Ho();if(q("{"))return Vo();if(c=_.type,E=_,c===a.Identifier)b=g.createIdentifier(Y().value);else if(c===a.StringLiteral||c===a.NumericLiteral)y&&_.octal&&ne(_,o.StrictOctalLiteral),b=g.createLiteral(Y());else if(c===a.Keyword){if(me("function"))return wl();me("this")?(Y(),b=g.createThisExpression()):Pe(Y())}else c===a.BooleanLiteral?((h=Y()).value=h.value==="true",b=g.createLiteral(h)):c===a.NullLiteral?((h=Y()).value=null,b=g.createLiteral(h)):q("/")||q("/=")?(b=x.tokens!==void 0?g.createLiteral(rt()):g.createLiteral(zn()),Er()):Pe(Y());return g.markEnd(b,E)}function Qn(){var c=[];if(U("("),!q(")"))for(;f<w&&(c.push(Ie()),!q(")"));)U(",");return U(")"),c}function Yo(){var c,h;return h=_,Bo(c=Y())||Pe(c),g.markEnd(g.createIdentifier(c.value),h)}function Xn(){return U("."),Yo()}function Kn(){var c;return U("["),c=he(),U("]"),c}function Zn(){var c,h,b;return b=_,ue("new"),c=Xo(),h=q("(")?Qn():[],g.markEnd(g.createNewExpression(c,h),b)}function Qo(){var c,h,b,E,j;for(j=_,c=$.allowIn,$.allowIn=!0,h=me("new")?Zn():Yn(),$.allowIn=c;;){if(q("."))E=Xn(),h=g.createMemberExpression(".",h,E);else if(q("("))b=Qn(),h=g.createCallExpression(h,b);else if(q("["))E=Kn(),h=g.createMemberExpression("[",h,E);else break;g.markEnd(h,j)}return h}function Xo(){var c,h,b,E;for(E=_,c=$.allowIn,h=me("new")?Zn():Yn(),$.allowIn=c;q(".")||q("[");)q("[")?(b=Kn(),h=g.createMemberExpression("[",h,b)):(b=Xn(),h=g.createMemberExpression(".",h,b)),g.markEnd(h,E);return h}function ea(){var c,h,b=_;return c=Qo(),_.type===a.Punctuator&&(q("++")||q("--"))&&!gt()&&(y&&c.type===s.Identifier&&le(c.name)&&ne({},o.StrictLHSPostfix),Rt(c)||ne({},o.InvalidLHSInAssignment),h=Y(),c=g.markEnd(g.createPostfixExpression(h.value,c),b)),c}function nt(){var c,h,b;return _.type!==a.Punctuator&&_.type!==a.Keyword?h=ea():q("++")||q("--")?(b=_,c=Y(),h=nt(),y&&h.type===s.Identifier&&le(h.name)&&ne({},o.StrictLHSPrefix),Rt(h)||ne({},o.InvalidLHSInAssignment),h=g.createUnaryExpression(c.value,h),h=g.markEnd(h,b)):q("+")||q("-")||q("~")||q("!")?(b=_,c=Y(),h=nt(),h=g.createUnaryExpression(c.value,h),h=g.markEnd(h,b)):me("delete")||me("void")||me("typeof")?(b=_,c=Y(),h=nt(),h=g.createUnaryExpression(c.value,h),h=g.markEnd(h,b),y&&h.operator==="delete"&&h.argument.type===s.Identifier&&ne({},o.StrictDelete)):h=ea(),h}function ta(c,h){var b=0;if(c.type!==a.Punctuator&&c.type!==a.Keyword)return 0;switch(c.value){case"||":b=1;break;case"&&":b=2;break;case"|":b=3;break;case"^":b=4;break;case"&":b=5;break;case"==":case"!=":case"===":case"!==":b=6;break;case"<":case">":case"<=":case">=":case"instanceof":b=7;break;case"in":b=h?7:0;break;case"<<":case">>":case">>>":b=8;break;case"+":case"-":b=9;break;case"*":case"/":case"%":b=11}return b}function Ko(){var c,h,b,E,j,M,z,pe,ae,_e;if(c=_,ae=nt(),(j=ta(E=_,$.allowIn))===0)return ae;for(E.prec=j,Y(),h=[c,_],M=[ae,E,z=nt()];(j=ta(_,$.allowIn))>0;){for(;M.length>2&&j<=M[M.length-2].prec;)z=M.pop(),pe=M.pop().value,ae=M.pop(),b=g.createBinaryExpression(pe,ae,z),h.pop(),c=h[h.length-1],g.markEnd(b,c),M.push(b);(E=Y()).prec=j,M.push(E),h.push(_),b=nt(),M.push(b)}for(_e=M.length-1,b=M[_e],h.pop();_e>1;)b=g.createBinaryExpression(M[_e-1].value,M[_e-2],b),_e-=2,c=h.pop(),g.markEnd(b,c);return b}function Zo(){var c,h,b,E,j;return j=_,c=Ko(),q("?")&&(Y(),h=$.allowIn,$.allowIn=!0,b=Ie(),$.allowIn=h,U(":"),E=Ie(),c=g.createConditionalExpression(c,b,E),g.markEnd(c,j)),c}function Ie(){var c,h,b,E,j;return c=_,j=_,E=h=Zo(),Wo()&&(Rt(h)||ne({},o.InvalidLHSInAssignment),y&&h.type===s.Identifier&&le(h.name)&&ne(c,o.StrictLHSAssignment),c=Y(),b=Ie(),E=g.markEnd(g.createAssignmentExpression(c.value,h,b),j)),E}function he(){var c,h=_;if(c=Ie(),q(",")){for(c=g.createSequenceExpression([c]);f<w&&q(",");)Y(),c.expressions.push(Ie());g.markEnd(c,h)}return c}function el(){for(var c,h=[];f<w&&!q("}")&&(c=yt())!==void 0;)h.push(c);return h}function Lt(){var c,h;return h=_,U("{"),c=el(),U("}"),g.markEnd(g.createBlockStatement(c),h)}function Ge(){var c,h;return h=_,(c=Y()).type!==a.Identifier&&Pe(c),g.markEnd(g.createIdentifier(c.value),h)}function tl(c){var h,b,E=null;return b=_,h=Ge(),y&&le(h.name)&&ne({},o.StrictVarName),c==="const"?(U("="),E=Ie()):q("=")&&(Y(),E=Ie()),g.markEnd(g.createVariableDeclarator(h,E),b)}function Ar(c){var h=[];do{if(h.push(tl(c)),!q(","))break;Y()}while(f<w);return h}function rl(){var c;return ue("var"),c=Ar(),Ce(),g.createVariableDeclaration(c,"var")}function nl(c){var h,b;return b=_,ue(c),h=Ar(c),Ce(),g.markEnd(g.createVariableDeclaration(h,c),b)}function al(){return U(";"),g.createEmptyStatement()}function il(){var c=he();return Ce(),g.createExpressionStatement(c)}function sl(){var c,h,b;return ue("if"),U("("),c=he(),U(")"),h=Ne(),me("else")?(Y(),b=Ne()):b=null,g.createIfStatement(c,h,b)}function ol(){var c,h,b;return ue("do"),b=$.inIteration,$.inIteration=!0,c=Ne(),$.inIteration=b,ue("while"),U("("),h=he(),U(")"),q(";")&&Y(),g.createDoWhileStatement(c,h)}function ll(){var c,h,b;return ue("while"),U("("),c=he(),U(")"),b=$.inIteration,$.inIteration=!0,h=Ne(),$.inIteration=b,g.createWhileStatement(c,h)}function cl(){var c,h,b;return b=_,c=Y(),h=Ar(),g.markEnd(g.createVariableDeclaration(h,c.value),b)}function ul(){var c,h,b,E,j,M,z;return c=h=b=null,ue("for"),U("("),q(";")?Y():(me("var")||me("let")?($.allowIn=!1,c=cl(),$.allowIn=!0,c.declarations.length===1&&me("in")&&(Y(),E=c,j=he(),c=null)):($.allowIn=!1,c=he(),$.allowIn=!0,me("in")&&(Rt(c)||ne({},o.InvalidLHSInForIn),Y(),E=c,j=he(),c=null)),E===void 0&&U(";")),E!==void 0||(q(";")||(h=he()),U(";"),q(")")||(b=he())),U(")"),z=$.inIteration,$.inIteration=!0,M=Ne(),$.inIteration=z,E===void 0?g.createForStatement(c,h,b,M):g.createForInStatement(E,j,M)}function pl(){var c,h=null;return ue("continue"),d.charCodeAt(f)===59?(Y(),$.inIteration||Q({},o.IllegalContinue),g.createContinueStatement(null)):gt()?($.inIteration||Q({},o.IllegalContinue),g.createContinueStatement(null)):(_.type!==a.Identifier||(c="$"+(h=Ge()).name,Object.prototype.hasOwnProperty.call($.labelSet,c)||Q({},o.UnknownLabel,h.name)),Ce(),h!==null||$.inIteration||Q({},o.IllegalContinue),g.createContinueStatement(h))}function dl(){var c,h=null;return ue("break"),d.charCodeAt(f)===59?(Y(),$.inIteration||$.inSwitch||Q({},o.IllegalBreak),g.createBreakStatement(null)):gt()?($.inIteration||$.inSwitch||Q({},o.IllegalBreak),g.createBreakStatement(null)):(_.type!==a.Identifier||(c="$"+(h=Ge()).name,Object.prototype.hasOwnProperty.call($.labelSet,c)||Q({},o.UnknownLabel,h.name)),Ce(),h!==null||$.inIteration||$.inSwitch||Q({},o.IllegalBreak),g.createBreakStatement(h))}function fl(){var c=null;return ue("return"),$.inFunctionBody||ne({},o.IllegalReturn),d.charCodeAt(f)===32&&C(d.charCodeAt(f+1))?(c=he(),Ce(),g.createReturnStatement(c)):gt()?g.createReturnStatement(null):(q(";")||q("}")||_.type===a.EOF||(c=he()),Ce(),g.createReturnStatement(c))}function hl(){var c,h;return y&&(k(),ne({},o.StrictModeWith)),ue("with"),U("("),c=he(),U(")"),h=Ne(),g.createWithStatement(c,h)}function ml(){var c,h,b,E=[];for(b=_,me("default")?(Y(),c=null):(ue("case"),c=he()),U(":");f<w&&!(q("}")||me("default")||me("case"));)h=Ne(),E.push(h);return g.markEnd(g.createSwitchCase(c,E),b)}function gl(){var c,h,b,E,j;if(ue("switch"),U("("),c=he(),U(")"),U("{"),h=[],q("}"))return Y(),g.createSwitchStatement(c,h);for(E=$.inSwitch,$.inSwitch=!0,j=!1;f<w&&!q("}");)(b=ml()).test===null&&(j&&Q({},o.MultipleDefaultsInSwitch),j=!0),h.push(b);return $.inSwitch=E,U("}"),g.createSwitchStatement(c,h)}function yl(){var c;return ue("throw"),gt()&&Q({},o.NewlineAfterThrow),c=he(),Ce(),g.createThrowStatement(c)}function _l(){var c,h,b;return b=_,ue("catch"),U("("),q(")")&&Pe(_),c=Ge(),y&&le(c.name)&&ne({},o.StrictCatchVariable),U(")"),h=Lt(),g.markEnd(g.createCatchClause(c,h),b)}function bl(){var c,h=[],b=null;return ue("try"),c=Lt(),me("catch")&&h.push(_l()),me("finally")&&(Y(),b=Lt()),h.length!==0||b||Q({},o.NoCatchOrFinally),g.createTryStatement(c,[],h,b)}function vl(){return ue("debugger"),Ce(),g.createDebuggerStatement()}function Ne(){var c,h,b,E,j=_.type;if(j===a.EOF&&Pe(_),j===a.Punctuator&&_.value==="{")return Lt();if(E=_,j===a.Punctuator)switch(_.value){case";":return g.markEnd(al(),E);case"(":return g.markEnd(il(),E)}if(j===a.Keyword)switch(_.value){case"break":return g.markEnd(dl(),E);case"continue":return g.markEnd(pl(),E);case"debugger":return g.markEnd(vl(),E);case"do":return g.markEnd(ol(),E);case"for":return g.markEnd(ul(),E);case"function":return g.markEnd(na(),E);case"if":return g.markEnd(sl(),E);case"return":return g.markEnd(fl(),E);case"switch":return g.markEnd(gl(),E);case"throw":return g.markEnd(yl(),E);case"try":return g.markEnd(bl(),E);case"var":return g.markEnd(rl(),E);case"while":return g.markEnd(ll(),E);case"with":return g.markEnd(hl(),E)}return(c=he()).type===s.Identifier&&q(":")?(Y(),b="$"+c.name,Object.prototype.hasOwnProperty.call($.labelSet,b)&&Q({},o.Redeclaration,"Label",c.name),$.labelSet[b]=!0,h=Ne(),delete $.labelSet[b],g.markEnd(g.createLabeledStatement(c,h),E)):(Ce(),g.markEnd(g.createExpressionStatement(c),E))}function Ir(){var c,h,b,E,j,M,z,pe,ae=[];for(pe=_,U("{");f<w&&_.type===a.StringLiteral&&(h=_,c=yt(),ae.push(c),c.expression.type===s.Literal);)d.slice(h.start+1,h.end-1)==="use strict"?(y=!0,b&&ne(b,o.StrictOctalLiteral)):!b&&h.octal&&(b=h);for(E=$.labelSet,j=$.inIteration,M=$.inSwitch,z=$.inFunctionBody,$.labelSet={},$.inIteration=!1,$.inSwitch=!1,$.inFunctionBody=!0;f<w&&!q("}")&&(c=yt())!==void 0;)ae.push(c);return U("}"),$.labelSet=E,$.inIteration=j,$.inSwitch=M,$.inFunctionBody=z,g.markEnd(g.createBlockStatement(ae),pe)}function ra(c){var h,b,E,j,M,z,pe=[];if(U("("),!q(")"))for(j={};f<w&&(b=_,h=Ge(),M="$"+b.value,y?(le(b.value)&&(E=b,z=o.StrictParamName),Object.prototype.hasOwnProperty.call(j,M)&&(E=b,z=o.StrictParamDupe)):!c&&(le(b.value)?(c=b,z=o.StrictParamName):X(b.value)?(c=b,z=o.StrictReservedWord):Object.prototype.hasOwnProperty.call(j,M)&&(c=b,z=o.StrictParamDupe)),pe.push(h),j[M]=!0,!q(")"));)U(",");return U(")"),{params:pe,stricted:E,firstRestricted:c,message:z}}function na(){var c,h,b,E,j,M,z,pe,ae,_e=[];return ae=_,ue("function"),b=_,c=Ge(),y?le(b.value)&&ne(b,o.StrictFunctionName):le(b.value)?(M=b,z=o.StrictFunctionName):X(b.value)&&(M=b,z=o.StrictReservedWord),_e=(j=ra(M)).params,E=j.stricted,M=j.firstRestricted,j.message&&(z=j.message),pe=y,h=Ir(),y&&M&&Q(M,z),y&&E&&ne(E,z),y=pe,g.markEnd(g.createFunctionDeclaration(c,_e,[],h),ae)}function wl(){var c,h,b,E,j,M,z,pe,ae=null,_e=[];return pe=_,ue("function"),!q("(")&&(c=_,ae=Ge(),y?le(c.value)&&ne(c,o.StrictFunctionName):le(c.value)?(b=c,E=o.StrictFunctionName):X(c.value)&&(b=c,E=o.StrictReservedWord)),_e=(j=ra(b)).params,h=j.stricted,b=j.firstRestricted,j.message&&(E=j.message),z=y,M=Ir(),y&&b&&Q(b,E),y&&h&&ne(h,E),y=z,g.markEnd(g.createFunctionExpression(ae,_e,[],M),pe)}function yt(){if(_.type===a.Keyword)switch(_.value){case"const":case"let":return nl(_.value);case"function":return na();default:return Ne()}if(_.type!==a.EOF)return Ne()}function $l(){for(var c,h,b,E=[];f<w&&(h=_).type===a.StringLiteral&&(E.push(c=yt()),c.expression.type===s.Literal);)d.slice(h.start+1,h.end-1)==="use strict"?(y=!0,b&&ne(b,o.StrictOctalLiteral)):!b&&h.octal&&(b=h);for(;f<w&&(c=yt())!==void 0;)E.push(c);return E}function Sl(){var c,h;return k(),Er(),h=_,y=!1,c=$l(),g.markEnd(g.createProgram(c),h)}function aa(){var c,h,b,E=[];for(c=0;c<x.tokens.length;++c)b={type:(h=x.tokens[c]).type,value:h.value},x.range&&(b.range=h.range),x.loc&&(b.loc=h.loc),E.push(b);x.tokens=E}function xl(c,h){var b,E,j;b=String,typeof c=="string"||c instanceof String||(c=b(c)),g=m,f=0,S=(d=c).length>0?1:0,v=0,w=d.length,_=null,$={allowIn:!0,labelSet:{},inFunctionBody:!1,inIteration:!1,inSwitch:!1,lastCommentStart:-1},x={},(h=h||{}).tokens=!0,x.tokens=[],x.tokenize=!0,x.openParenToken=-1,x.openCurlyToken=-1,x.range=typeof h.range=="boolean"&&h.range,x.loc=typeof h.loc=="boolean"&&h.loc,typeof h.comment=="boolean"&&h.comment&&(x.comments=[]),typeof h.tolerant=="boolean"&&h.tolerant&&(x.errors=[]);try{if(Er(),_.type===a.EOF)return x.tokens;for(E=Y();_.type!==a.EOF;)try{E=Y()}catch(M){if(E=_,x.errors){x.errors.push(M);break}throw M}aa(),j=x.tokens,x.comments!==void 0&&(j.comments=x.comments),x.errors!==void 0&&(j.errors=x.errors)}catch(M){throw M}finally{x={}}return j}function El(c,h){var b,E;E=String,typeof c=="string"||c instanceof String||(c=E(c)),g=m,f=0,S=(d=c).length>0?1:0,v=0,w=d.length,_=null,$={allowIn:!0,labelSet:{},inFunctionBody:!1,inIteration:!1,inSwitch:!1,lastCommentStart:-1},x={},h!==void 0&&(x.range=typeof h.range=="boolean"&&h.range,x.loc=typeof h.loc=="boolean"&&h.loc,x.attachComment=typeof h.attachComment=="boolean"&&h.attachComment,x.loc&&h.source!==null&&h.source!==void 0&&(x.source=E(h.source)),typeof h.tokens=="boolean"&&h.tokens&&(x.tokens=[]),typeof h.comment=="boolean"&&h.comment&&(x.comments=[]),typeof h.tolerant=="boolean"&&h.tolerant&&(x.errors=[]),x.attachComment&&(x.range=!0,x.comments=[],x.bottomRightStack=[],x.trailingComments=[],x.leadingComments=[]));try{b=Sl(),x.comments!==void 0&&(b.comments=x.comments),x.tokens!==void 0&&(aa(),b.tokens=x.tokens),x.errors!==void 0&&(b.errors=x.errors)}catch(j){throw j}finally{x={}}return b}(i={})[(a={BooleanLiteral:1,EOF:2,Identifier:3,Keyword:4,NullLiteral:5,NumericLiteral:6,Punctuator:7,StringLiteral:8,RegularExpression:9}).BooleanLiteral]="Boolean",i[a.EOF]="<end>",i[a.Identifier]="Identifier",i[a.Keyword]="Keyword",i[a.NullLiteral]="Null",i[a.NumericLiteral]="Numeric",i[a.Punctuator]="Punctuator",i[a.StringLiteral]="String",i[a.RegularExpression]="RegularExpression",l=["(","{","[","in","typeof","instanceof","new","return","case","delete","throw","void","=","+=","-=","*=","/=","%=","<<=",">>=",">>>=","&=","|=","^=",",","+","-","*","/","%","++","--","<<",">>",">>>","&","|","^","!","~","&&","||","?",":","===","==",">=","<=","<",">","!=","!=="],s={AssignmentExpression:"AssignmentExpression",ArrayExpression:"ArrayExpression",BlockStatement:"BlockStatement",BinaryExpression:"BinaryExpression",BreakStatement:"BreakStatement",CallExpression:"CallExpression",CatchClause:"CatchClause",ConditionalExpression:"ConditionalExpression",ContinueStatement:"ContinueStatement",DoWhileStatement:"DoWhileStatement",DebuggerStatement:"DebuggerStatement",EmptyStatement:"EmptyStatement",ExpressionStatement:"ExpressionStatement",ForStatement:"ForStatement",ForInStatement:"ForInStatement",FunctionDeclaration:"FunctionDeclaration",FunctionExpression:"FunctionExpression",Identifier:"Identifier",IfStatement:"IfStatement",Literal:"Literal",LabeledStatement:"LabeledStatement",LogicalExpression:"LogicalExpression",MemberExpression:"MemberExpression",NewExpression:"NewExpression",ObjectExpression:"ObjectExpression",Program:"Program",Property:"Property",ReturnStatement:"ReturnStatement",SequenceExpression:"SequenceExpression",SwitchStatement:"SwitchStatement",SwitchCase:"SwitchCase",ThisExpression:"ThisExpression",ThrowStatement:"ThrowStatement",TryStatement:"TryStatement",UnaryExpression:"UnaryExpression",UpdateExpression:"UpdateExpression",VariableDeclaration:"VariableDeclaration",VariableDeclarator:"VariableDeclarator",WhileStatement:"WhileStatement",WithStatement:"WithStatement"},u={Data:1,Get:2,Set:4},o={UnexpectedToken:"Unexpected token %0",UnexpectedNumber:"Unexpected number",UnexpectedString:"Unexpected string",UnexpectedIdentifier:"Unexpected identifier",UnexpectedReserved:"Unexpected reserved word",UnexpectedEOS:"Unexpected end of input",NewlineAfterThrow:"Illegal newline after throw",InvalidRegExp:"Invalid regular expression",UnterminatedRegExp:"Invalid regular expression: missing /",InvalidLHSInAssignment:"Invalid left-hand side in assignment",InvalidLHSInForIn:"Invalid left-hand side in for-in",MultipleDefaultsInSwitch:"More than one default clause in switch statement",NoCatchOrFinally:"Missing catch or finally after try",UnknownLabel:"Undefined label '%0'",Redeclaration:"%0 '%1' has already been declared",IllegalContinue:"Illegal continue statement",IllegalBreak:"Illegal break statement",IllegalReturn:"Illegal return statement",StrictModeWith:"Strict mode code may not include a with statement",StrictCatchVariable:"Catch variable may not be eval or arguments in strict mode",StrictVarName:"Variable name may not be eval or arguments in strict mode",StrictParamName:"Parameter name eval or arguments is not allowed in strict mode",StrictParamDupe:"Strict mode function may not have duplicate parameter names",StrictFunctionName:"Function name may not be eval or arguments in strict mode",StrictOctalLiteral:"Octal literals are not allowed in strict mode.",StrictDelete:"Delete of an unqualified identifier in strict mode.",StrictDuplicateProperty:"Duplicate data property in object literal not allowed in strict mode",AccessorDataProperty:"Object literal may not have data and accessor property with the same name",AccessorGetSet:"Object literal may not have multiple get/set accessors with the same name",StrictLHSAssignment:"Assignment to eval or arguments is not allowed in strict mode",StrictLHSPostfix:"Postfix increment/decrement may not have eval or arguments operand in strict mode",StrictLHSPrefix:"Prefix increment/decrement may not have eval or arguments operand in strict mode",StrictReservedWord:"Use of future reserved word in strict mode"},p={NonAsciiIdentifierStart:RegExp("[ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԧԱ-Ֆՙա-ևא-תװ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࢠࢢ-ࢬऄ-हऽॐक़-ॡॱ-ॷॹ-ॿঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-ళవ-హఽౘౙౠౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൠൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛰᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤜᥐ-ᥭᥰ-ᥴᦀ-ᦫᧁ-ᧇᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᳩ-ᳬᳮ-ᳱᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⸯ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚗꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꪀ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ]"),NonAsciiIdentifierPart:RegExp("[ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮ̀-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁ҃-҇Ҋ-ԧԱ-Ֆՙա-և֑-ׇֽֿׁׂׅׄא-תװ-ײؐ-ؚؠ-٩ٮ-ۓە-ۜ۟-۪ۨ-ۼۿܐ-݊ݍ-ޱ߀-ߵߺࠀ-࠭ࡀ-࡛ࢠࢢ-ࢬࣤ-ࣾऀ-ॣ०-९ॱ-ॷॹ-ॿঁ-ঃঅ-ঌএঐও-নপ-রলশ-হ়-ৄেৈো-ৎৗড়ঢ়য়-ৣ০-ৱਁ-ਃਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹ਼ਾ-ੂੇੈੋ-੍ੑਖ਼-ੜਫ਼੦-ੵઁ-ઃઅ-ઍએ-ઑઓ-નપ-રલળવ-હ઼-ૅે-ૉો-્ૐૠ-ૣ૦-૯ଁ-ଃଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହ଼-ୄେୈୋ-୍ୖୗଡ଼ଢ଼ୟ-ୣ୦-୯ୱஂஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹா-ூெ-ைொ-்ௐௗ௦-௯ఁ-ఃఅ-ఌఎ-ఐఒ-నప-ళవ-హఽ-ౄె-ైొ-్ౕౖౘౙౠ-ౣ౦-౯ಂಃಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹ಼-ೄೆ-ೈೊ-್ೕೖೞೠ-ೣ೦-೯ೱೲംഃഅ-ഌഎ-ഐഒ-ഺഽ-ൄെ-ൈൊ-ൎൗൠ-ൣ൦-൯ൺ-ൿංඃඅ-ඖක-නඳ-රලව-ෆ්ා-ුූෘ-ෟෲෳก-ฺเ-๎๐-๙ກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ູົ-ຽເ-ໄໆ່-ໍ໐-໙ໜ-ໟༀ༘༙༠-༩༹༵༷༾-ཇཉ-ཬཱ-྄྆-ྗྙ-ྼ࿆က-၉ၐ-ႝႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚ፝-፟ᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛰᜀ-ᜌᜎ-᜔ᜠ-᜴ᝀ-ᝓᝠ-ᝬᝮ-ᝰᝲᝳក-៓ៗៜ៝០-៩᠋-᠍᠐-᠙ᠠ-ᡷᢀ-ᢪᢰ-ᣵᤀ-ᤜᤠ-ᤫᤰ-᤻᥆-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉ᧐-᧙ᨀ-ᨛᨠ-ᩞ᩠-᩿᩼-᪉᪐-᪙ᪧᬀ-ᭋ᭐-᭙᭫-᭳ᮀ-᯳ᰀ-᰷᱀-᱉ᱍ-ᱽ᳐-᳔᳒-ᳶᴀ-ᷦ᷼-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼ‌‍‿⁀⁔ⁱⁿₐ-ₜ⃐-⃥⃜⃡-⃰ℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯ⵿-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⷠ-ⷿⸯ々-〇〡-〯〱-〵〸-〼ぁ-ゖ゙゚ゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘫꙀ-꙯ꙴ-꙽ꙿ-ꚗꚟ-꛱ꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꠧꡀ-ꡳꢀ-꣄꣐-꣙꣠-ꣷꣻ꤀-꤭ꤰ-꥓ꥠ-ꥼꦀ-꧀ꧏ-꧙ꨀ-ꨶꩀ-ꩍ꩐-꩙ꩠ-ꩶꩺꩻꪀ-ꫂꫛ-ꫝꫠ-ꫯꫲ-꫶ꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯪ꯬꯭꯰-꯹가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻ︀-️︠-︦︳︴﹍-﹏ﹰ-ﹴﹶ-ﻼ0-9A-Z_a-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ]")},m={name:"SyntaxTree",processComment:function(c){var h,b;if(c.type!==s.Program||!(c.body.length>0)){for(x.trailingComments.length>0?x.trailingComments[0].range[0]>=c.range[1]?(b=x.trailingComments,x.trailingComments=[]):x.trailingComments.length=0:x.bottomRightStack.length>0&&x.bottomRightStack[x.bottomRightStack.length-1].trailingComments&&x.bottomRightStack[x.bottomRightStack.length-1].trailingComments[0].range[0]>=c.range[1]&&(b=x.bottomRightStack[x.bottomRightStack.length-1].trailingComments,delete x.bottomRightStack[x.bottomRightStack.length-1].trailingComments);x.bottomRightStack.length>0&&x.bottomRightStack[x.bottomRightStack.length-1].range[0]>=c.range[0];)h=x.bottomRightStack.pop();h?h.leadingComments&&h.leadingComments[h.leadingComments.length-1].range[1]<=c.range[0]&&(c.leadingComments=h.leadingComments,delete h.leadingComments):x.leadingComments.length>0&&x.leadingComments[x.leadingComments.length-1].range[1]<=c.range[0]&&(c.leadingComments=x.leadingComments,x.leadingComments=[]),b&&(c.trailingComments=b),x.bottomRightStack.push(c)}},markEnd:function(c,h){return x.range&&(c.range=[h.start,f]),x.loc&&(c.loc=new Go(h.startLineNumber===void 0?h.lineNumber:h.startLineNumber,h.start-(h.startLineStart===void 0?h.lineStart:h.startLineStart),S,f-v),this.postProcess(c)),x.attachComment&&this.processComment(c),c},postProcess:function(c){return x.source&&(c.loc.source=x.source),c},createArrayExpression:function(c){return{type:s.ArrayExpression,elements:c}},createAssignmentExpression:function(c,h,b){return{type:s.AssignmentExpression,operator:c,left:h,right:b}},createBinaryExpression:function(c,h,b){return{type:c==="||"||c==="&&"?s.LogicalExpression:s.BinaryExpression,operator:c,left:h,right:b}},createBlockStatement:function(c){return{type:s.BlockStatement,body:c}},createBreakStatement:function(c){return{type:s.BreakStatement,label:c}},createCallExpression:function(c,h){return{type:s.CallExpression,callee:c,arguments:h}},createCatchClause:function(c,h){return{type:s.CatchClause,param:c,body:h}},createConditionalExpression:function(c,h,b){return{type:s.ConditionalExpression,test:c,consequent:h,alternate:b}},createContinueStatement:function(c){return{type:s.ContinueStatement,label:c}},createDebuggerStatement:function(){return{type:s.DebuggerStatement}},createDoWhileStatement:function(c,h){return{type:s.DoWhileStatement,body:c,test:h}},createEmptyStatement:function(){return{type:s.EmptyStatement}},createExpressionStatement:function(c){return{type:s.ExpressionStatement,expression:c}},createForStatement:function(c,h,b,E){return{type:s.ForStatement,init:c,test:h,update:b,body:E}},createForInStatement:function(c,h,b){return{type:s.ForInStatement,left:c,right:h,body:b,each:!1}},createFunctionDeclaration:function(c,h,b,E){return{type:s.FunctionDeclaration,id:c,params:h,defaults:b,body:E,rest:null,generator:!1,expression:!1}},createFunctionExpression:function(c,h,b,E){return{type:s.FunctionExpression,id:c,params:h,defaults:b,body:E,rest:null,generator:!1,expression:!1}},createIdentifier:function(c){return{type:s.Identifier,name:c}},createIfStatement:function(c,h,b){return{type:s.IfStatement,test:c,consequent:h,alternate:b}},createLabeledStatement:function(c,h){return{type:s.LabeledStatement,label:c,body:h}},createLiteral:function(c){return{type:s.Literal,value:c.value,raw:d.slice(c.start,c.end)}},createMemberExpression:function(c,h,b){return{type:s.MemberExpression,computed:c==="[",object:h,property:b}},createNewExpression:function(c,h){return{type:s.NewExpression,callee:c,arguments:h}},createObjectExpression:function(c){return{type:s.ObjectExpression,properties:c}},createPostfixExpression:function(c,h){return{type:s.UpdateExpression,operator:c,argument:h,prefix:!1}},createProgram:function(c){return{type:s.Program,body:c}},createProperty:function(c,h,b){return{type:s.Property,key:h,value:b,kind:c}},createReturnStatement:function(c){return{type:s.ReturnStatement,argument:c}},createSequenceExpression:function(c){return{type:s.SequenceExpression,expressions:c}},createSwitchCase:function(c,h){return{type:s.SwitchCase,test:c,consequent:h}},createSwitchStatement:function(c,h){return{type:s.SwitchStatement,discriminant:c,cases:h}},createThisExpression:function(){return{type:s.ThisExpression}},createThrowStatement:function(c){return{type:s.ThrowStatement,argument:c}},createTryStatement:function(c,h,b,E){return{type:s.TryStatement,block:c,guardedHandlers:h,handlers:b,finalizer:E}},createUnaryExpression:function(c,h){return c==="++"||c==="--"?{type:s.UpdateExpression,operator:c,argument:h,prefix:!0}:{type:s.UnaryExpression,operator:c,argument:h,prefix:!0}},createVariableDeclaration:function(c,h){return{type:s.VariableDeclaration,declarations:c,kind:h}},createVariableDeclarator:function(c,h){return{type:s.VariableDeclarator,id:c,init:h}},createWhileStatement:function(c,h){return{type:s.WhileStatement,test:c,body:h}},createWithStatement:function(c,h){return{type:s.WithStatement,object:c,body:h}}},r.version="1.2.2",r.tokenize=xl,r.parse=El,r.Syntax=function(){var c,h={};for(c in typeof Object.create=="function"&&(h=Object.create(null)),s)s.hasOwnProperty(c)&&(h[c]=s[c]);return typeof Object.freeze=="function"&&Object.freeze(h),h}()})},{}],1:[function(n,e,t){(function(r){var a=function(){var i={trace:function(){},yy:{},symbols_:{error:2,JSON_PATH:3,DOLLAR:4,PATH_COMPONENTS:5,LEADING_CHILD_MEMBER_EXPRESSION:6,PATH_COMPONENT:7,MEMBER_COMPONENT:8,SUBSCRIPT_COMPONENT:9,CHILD_MEMBER_COMPONENT:10,DESCENDANT_MEMBER_COMPONENT:11,DOT:12,MEMBER_EXPRESSION:13,DOT_DOT:14,STAR:15,IDENTIFIER:16,SCRIPT_EXPRESSION:17,INTEGER:18,END:19,CHILD_SUBSCRIPT_COMPONENT:20,DESCENDANT_SUBSCRIPT_COMPONENT:21,"[":22,SUBSCRIPT:23,"]":24,SUBSCRIPT_EXPRESSION:25,SUBSCRIPT_EXPRESSION_LIST:26,SUBSCRIPT_EXPRESSION_LISTABLE:27,",":28,STRING_LITERAL:29,ARRAY_SLICE:30,FILTER_EXPRESSION:31,QQ_STRING:32,Q_STRING:33,$accept:0,$end:1},terminals_:{2:"error",4:"DOLLAR",12:"DOT",14:"DOT_DOT",15:"STAR",16:"IDENTIFIER",17:"SCRIPT_EXPRESSION",18:"INTEGER",19:"END",22:"[",24:"]",28:",",30:"ARRAY_SLICE",31:"FILTER_EXPRESSION",32:"QQ_STRING",33:"Q_STRING"},productions_:[0,[3,1],[3,2],[3,1],[3,2],[5,1],[5,2],[7,1],[7,1],[8,1],[8,1],[10,2],[6,1],[11,2],[13,1],[13,1],[13,1],[13,1],[13,1],[9,1],[9,1],[20,3],[21,4],[23,1],[23,1],[26,1],[26,3],[27,1],[27,1],[27,1],[25,1],[25,1],[25,1],[29,1],[29,1]],performAction:function(o,p,m,d,y,f,S){d.ast||(d.ast=l,l.initialize());var v=f.length-1;switch(y){case 1:return d.ast.set({expression:{type:"root",value:f[v]}}),d.ast.unshift(),d.ast.yield();case 2:return d.ast.set({expression:{type:"root",value:f[v-1]}}),d.ast.unshift(),d.ast.yield();case 3:return d.ast.unshift(),d.ast.yield();case 4:return d.ast.set({operation:"member",scope:"child",expression:{type:"identifier",value:f[v-1]}}),d.ast.unshift(),d.ast.yield();case 5:case 6:case 11:case 13:case 18:case 21:case 22:case 23:break;case 7:d.ast.set({operation:"member"}),d.ast.push();break;case 8:d.ast.set({operation:"subscript"}),d.ast.push();break;case 9:case 19:d.ast.set({scope:"child"});break;case 10:case 20:d.ast.set({scope:"descendant"});break;case 12:d.ast.set({scope:"child",operation:"member"});break;case 14:d.ast.set({expression:{type:"wildcard",value:f[v]}});break;case 15:d.ast.set({expression:{type:"identifier",value:f[v]}});break;case 16:d.ast.set({expression:{type:"script_expression",value:f[v]}});break;case 17:d.ast.set({expression:{type:"numeric_literal",value:parseInt(f[v])}});break;case 24:f[v].length>1?d.ast.set({expression:{type:"union",value:f[v]}}):this.$=f[v];break;case 25:this.$=[f[v]];break;case 26:this.$=f[v-2].concat(f[v]);break;case 27:this.$={expression:{type:"numeric_literal",value:parseInt(f[v])}},d.ast.set(this.$);break;case 28:this.$={expression:{type:"string_literal",value:f[v]}},d.ast.set(this.$);break;case 29:this.$={expression:{type:"slice",value:f[v]}},d.ast.set(this.$);break;case 30:this.$={expression:{type:"wildcard",value:f[v]}},d.ast.set(this.$);break;case 31:this.$={expression:{type:"script_expression",value:f[v]}},d.ast.set(this.$);break;case 32:this.$={expression:{type:"filter_expression",value:f[v]}},d.ast.set(this.$);break;case 33:case 34:this.$=f[v]}},table:[{3:1,4:[1,2],6:3,13:4,15:[1,5],16:[1,6],17:[1,7],18:[1,8],19:[1,9]},{1:[3]},{1:[2,1],5:10,7:11,8:12,9:13,10:14,11:15,12:[1,18],14:[1,19],20:16,21:17,22:[1,20]},{1:[2,3],5:21,7:11,8:12,9:13,10:14,11:15,12:[1,18],14:[1,19],20:16,21:17,22:[1,20]},{1:[2,12],12:[2,12],14:[2,12],22:[2,12]},{1:[2,14],12:[2,14],14:[2,14],22:[2,14]},{1:[2,15],12:[2,15],14:[2,15],22:[2,15]},{1:[2,16],12:[2,16],14:[2,16],22:[2,16]},{1:[2,17],12:[2,17],14:[2,17],22:[2,17]},{1:[2,18],12:[2,18],14:[2,18],22:[2,18]},{1:[2,2],7:22,8:12,9:13,10:14,11:15,12:[1,18],14:[1,19],20:16,21:17,22:[1,20]},{1:[2,5],12:[2,5],14:[2,5],22:[2,5]},{1:[2,7],12:[2,7],14:[2,7],22:[2,7]},{1:[2,8],12:[2,8],14:[2,8],22:[2,8]},{1:[2,9],12:[2,9],14:[2,9],22:[2,9]},{1:[2,10],12:[2,10],14:[2,10],22:[2,10]},{1:[2,19],12:[2,19],14:[2,19],22:[2,19]},{1:[2,20],12:[2,20],14:[2,20],22:[2,20]},{13:23,15:[1,5],16:[1,6],17:[1,7],18:[1,8],19:[1,9]},{13:24,15:[1,5],16:[1,6],17:[1,7],18:[1,8],19:[1,9],22:[1,25]},{15:[1,29],17:[1,30],18:[1,33],23:26,25:27,26:28,27:32,29:34,30:[1,35],31:[1,31],32:[1,36],33:[1,37]},{1:[2,4],7:22,8:12,9:13,10:14,11:15,12:[1,18],14:[1,19],20:16,21:17,22:[1,20]},{1:[2,6],12:[2,6],14:[2,6],22:[2,6]},{1:[2,11],12:[2,11],14:[2,11],22:[2,11]},{1:[2,13],12:[2,13],14:[2,13],22:[2,13]},{15:[1,29],17:[1,30],18:[1,33],23:38,25:27,26:28,27:32,29:34,30:[1,35],31:[1,31],32:[1,36],33:[1,37]},{24:[1,39]},{24:[2,23]},{24:[2,24],28:[1,40]},{24:[2,30]},{24:[2,31]},{24:[2,32]},{24:[2,25],28:[2,25]},{24:[2,27],28:[2,27]},{24:[2,28],28:[2,28]},{24:[2,29],28:[2,29]},{24:[2,33],28:[2,33]},{24:[2,34],28:[2,34]},{24:[1,41]},{1:[2,21],12:[2,21],14:[2,21],22:[2,21]},{18:[1,33],27:42,29:34,30:[1,35],32:[1,36],33:[1,37]},{1:[2,22],12:[2,22],14:[2,22],22:[2,22]},{24:[2,26],28:[2,26]}],defaultActions:{27:[2,23],29:[2,30],30:[2,31],31:[2,32]},parseError:function(o,p){if(p.recoverable)this.trace(o);else throw Error(o)},parse:function(o){var p=this,m=[0],d=[null],y=[],f=this.table,S="",v=0,w=0,g=0,_=2,$=1,x=y.slice.call(arguments,1);this.lexer.setInput(o),this.lexer.yy=this.yy,this.yy.lexer=this.lexer,this.yy.parser=this,this.lexer.yylloc===void 0&&(this.lexer.yylloc={});var T=this.lexer.yylloc;y.push(T);var P=this.lexer.options&&this.lexer.options.ranges;function D(){var ee;return typeof(ee=p.lexer.lex()||$)!="number"&&(ee=p.symbols_[ee]||ee),ee}typeof this.yy.parseError=="function"?this.parseError=this.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;for(var R,I,F,C,B,V,X,le,ve,H={};;){if(F=m[m.length-1],this.defaultActions[F]?C=this.defaultActions[F]:(R==null&&(R=D()),C=f[F]&&f[F][R]),C===void 0||!C.length||!C[0]){var ie="";for(V in ve=[],f[F])this.terminals_[V]&&V>_&&ve.push("'"+this.terminals_[V]+"'");ie=this.lexer.showPosition?"Parse error on line "+(v+1)+\`:
15233
+ \`;break;case"r":ae+="\\r";break;case"t":ae+=" ";break;case"b":ae+="\\b";break;case"f":ae+="\\f";break;case"v":ae+="\\v";break;default:R(b)?((E="01234567".indexOf(b))!==0&&(be=!0),f<w&&R(d[f])&&(be=!0,E=8*E+"01234567".indexOf(d[f++]),"0123".indexOf(b)>=0&&f<w&&R(d[f])&&(E=8*E+"01234567".indexOf(d[f++]))),ae+=String.fromCharCode(E)):ae+=b}else{if(F(b.charCodeAt(0)))break;ae+=b}}return c!==""&&Y({},o.UnexpectedToken,"ILLEGAL"),{type:a.StringLiteral,value:ae,octal:be,startLineNumber:z,startLineStart:pe,lineNumber:S,lineStart:v,start:h,end:f}}function Ae(c,h){var b;try{b=new RegExp(c,h)}catch{Y({},o.InvalidRegExp)}return b}function Ie(){var c,h,b,E;for(T((c=d[f])==="/","Regular expression literal must start with a slash"),h=d[f++],b=!1,E=!1;f<w;)if(h+=c=d[f++],c==="\\\\")F((c=d[f++]).charCodeAt(0))&&Y({},o.UnterminatedRegExp),h+=c;else if(F(c.charCodeAt(0)))Y({},o.UnterminatedRegExp);else if(b)c==="]"&&(b=!1);else{if(c==="/"){E=!0;break}c==="["&&(b=!0)}return E||Y({},o.UnterminatedRegExp),{value:h.substr(1,h.length-2),literal:h}}function Er(){var c,h,b,E;for(h="",b="";f<w&&B((c=d[f]).charCodeAt(0));)if(++f,c==="\\\\"&&f<w)if((c=d[f])==="u"){if(E=++f,c=O("u"))for(b+=c,h+="\\\\u";E<f;++E)h+=d[E];else f=E,b+="u",h+="\\\\u";ne({},o.UnexpectedToken,"ILLEGAL")}else h+="\\\\",ne({},o.UnexpectedToken,"ILLEGAL");else b+=c,h+=c;return{value:b,literal:h}}function Yn(){var c,h,b,E;return _=null,k(),c=f,h=Ie(),b=Er(),E=Ae(h.value,b.value),x.tokenize?{type:a.RegularExpression,value:E,lineNumber:S,lineStart:v,start:c,end:f}:{literal:h.literal+b.literal,value:E,start:c,end:f}}function at(){var c,h,b,E;return k(),c=f,h={start:{line:S,column:f-v}},b=Yn(),h.end={line:S,column:f-v},x.tokenize||(x.tokens.length>0&&(E=x.tokens[x.tokens.length-1]).range[0]===c&&E.type==="Punctuator"&&(E.value==="/"||E.value==="/=")&&x.tokens.pop(),x.tokens.push({type:"RegularExpression",value:b.literal,range:[c,f],loc:h})),b}function zo(c){return c.type===a.Identifier||c.type===a.Keyword||c.type===a.BooleanLiteral||c.type===a.NullLiteral}function Vo(){var c,h;if(!(c=x.tokens[x.tokens.length-1]))return at();if(c.type==="Punctuator"){if(c.value==="]")return te();if(c.value===")")return(h=x.tokens[x.openParenToken-1])&&h.type==="Keyword"&&(h.value==="if"||h.value==="while"||h.value==="for"||h.value==="with")?at():te();if(c.value==="}"){if(x.tokens[x.openCurlyToken-3]&&x.tokens[x.openCurlyToken-3].type==="Keyword"){if(!(h=x.tokens[x.openCurlyToken-4]))return te()}else{if(!x.tokens[x.openCurlyToken-4]||x.tokens[x.openCurlyToken-4].type!=="Keyword")return te();if(!(h=x.tokens[x.openCurlyToken-5]))return at()}if(l.indexOf(h.value)>=0)return te()}return at()}return c.type==="Keyword"?at():te()}function kr(){var c;return k(),f>=w?{type:a.EOF,lineNumber:S,lineStart:v,start:f,end:f}:C(c=d.charCodeAt(f))?se():c===40||c===41||c===59?te():c===39||c===34?fe():c===46?P(d.charCodeAt(f+1))?re():te():P(c)?re():x.tokenize&&c===47?Vo():te()}function Xn(){var c,h,b;return k(),c={start:{line:S,column:f-v}},h=kr(),c.end={line:S,column:f-v},h.type!==a.EOF&&(b=d.slice(h.start,h.end),x.tokens.push({type:i[h.type],value:b,range:[h.start,h.end],loc:c})),h}function Q(){var c;return f=(c=_).end,S=c.lineNumber,v=c.lineStart,_=x.tokens!==void 0?Xn():kr(),f=c.end,S=c.lineNumber,v=c.lineStart,c}function Ar(){var c,h,b;c=f,h=S,b=v,_=x.tokens!==void 0?Xn():kr(),f=c,S=h,v=b}function Kn(c,h){this.line=c,this.column=h}function Jo(c,h,b,E){this.start=new Kn(c,h),this.end=new Kn(b,E)}function _t(){var c,h,b,E;return c=f,h=S,b=v,k(),E=S!==h,f=c,S=h,v=b,E}function Y(c,h){var b,E=Array.prototype.slice.call(arguments,2),j=h.replace(/%(\\d)/g,function(M,z){return T(z<E.length,"Message reference must be in range"),E[z]});throw typeof c.lineNumber=="number"?((b=Error("Line "+c.lineNumber+": "+j)).index=c.start,b.lineNumber=c.lineNumber,b.column=c.start-v+1):((b=Error("Line "+S+": "+j)).index=f,b.lineNumber=S,b.column=f-v+1),b.description=j,b}function ne(){try{Y.apply(null,arguments)}catch(c){if(x.errors)x.errors.push(c);else throw c}}function Ce(c){if(c.type===a.EOF&&Y(c,o.UnexpectedEOS),c.type===a.NumericLiteral&&Y(c,o.UnexpectedNumber),c.type===a.StringLiteral&&Y(c,o.UnexpectedString),c.type===a.Identifier&&Y(c,o.UnexpectedIdentifier),c.type===a.Keyword){if(V(c.value))Y(c,o.UnexpectedReserved);else if(y&&X(c.value)){ne(c,o.StrictReservedWord);return}Y(c,o.UnexpectedToken,c.value)}Y(c,o.UnexpectedToken,c.value)}function U(c){var h=Q();(h.type!==a.Punctuator||h.value!==c)&&Ce(h)}function ue(c){var h=Q();(h.type!==a.Keyword||h.value!==c)&&Ce(h)}function q(c){return _.type===a.Punctuator&&_.value===c}function ge(c){return _.type===a.Keyword&&_.value===c}function Qo(){var c;return _.type===a.Punctuator&&((c=_.value)==="="||c==="*="||c==="/="||c==="%="||c==="+="||c==="-="||c==="<<="||c===">>="||c===">>>="||c==="&="||c==="^="||c==="|=")}function Ne(){var c;if(d.charCodeAt(f)===59||q(";")){Q();return}c=S,k(),S!==c||_.type===a.EOF||q("}")||Ce(_)}function Dt(c){return c.type===s.Identifier||c.type===s.MemberExpression}function Yo(){var c,h=[];for(c=_,U("[");!q("]");)q(",")?(Q(),h.push(null)):(h.push(Oe()),q("]")||U(","));return Q(),g.markEnd(g.createArrayExpression(h),c)}function Ir(c,h){var b,E,j;return b=y,j=_,E=jr(),h&&y&&oe(c[0].name)&&ne(h,o.StrictParamName),y=b,g.markEnd(g.createFunctionExpression(null,c,[],E),j)}function qt(){var c,h;return h=_,(c=Q()).type===a.StringLiteral||c.type===a.NumericLiteral?(y&&c.octal&&ne(c,o.StrictOctalLiteral),g.markEnd(g.createLiteral(c),h)):g.markEnd(g.createIdentifier(c.value),h)}function Xo(){var c,h,b,E,j,M;return c=_,M=_,c.type===a.Identifier?(b=qt(),c.value!=="get"||q(":")?c.value!=="set"||q(":")?(U(":"),E=Oe(),g.markEnd(g.createProperty("init",b,E),M)):(h=qt(),U("("),(c=_).type!==a.Identifier?(U(")"),ne(c,o.UnexpectedToken,c.value),E=Ir([])):(j=[We()],U(")"),E=Ir(j,c)),g.markEnd(g.createProperty("set",h,E),M)):(h=qt(),U("("),U(")"),E=Ir([]),g.markEnd(g.createProperty("get",h,E),M))):c.type!==a.EOF&&c.type!==a.Punctuator?(h=qt(),U(":"),E=Oe(),g.markEnd(g.createProperty("init",h,E),M)):void Ce(c)}function Ko(){var c,h,b,E,j,M=[],z={},pe=String;for(j=_,U("{");!q("}");)h=(c=Xo()).key.type===s.Identifier?c.key.name:pe(c.key.value),E=c.kind==="init"?u.Data:c.kind==="get"?u.Get:u.Set,b="$"+h,Object.prototype.hasOwnProperty.call(z,b)?(z[b]===u.Data?y&&E===u.Data?ne({},o.StrictDuplicateProperty):E!==u.Data&&ne({},o.AccessorDataProperty):E===u.Data?ne({},o.AccessorDataProperty):z[b]&E&&ne({},o.AccessorGetSet),z[b]|=E):z[b]=E,M.push(c),q("}")||U(",");return U("}"),g.markEnd(g.createObjectExpression(M),j)}function Zo(){var c;return U("("),c=he(),U(")"),c}function Zn(){var c,h,b,E;if(q("("))return Zo();if(q("["))return Yo();if(q("{"))return Ko();if(c=_.type,E=_,c===a.Identifier)b=g.createIdentifier(Q().value);else if(c===a.StringLiteral||c===a.NumericLiteral)y&&_.octal&&ne(_,o.StrictOctalLiteral),b=g.createLiteral(Q());else if(c===a.Keyword){if(ge("function"))return kl();ge("this")?(Q(),b=g.createThisExpression()):Ce(Q())}else c===a.BooleanLiteral?((h=Q()).value=h.value==="true",b=g.createLiteral(h)):c===a.NullLiteral?((h=Q()).value=null,b=g.createLiteral(h)):q("/")||q("/=")?(b=x.tokens!==void 0?g.createLiteral(at()):g.createLiteral(Yn()),Ar()):Ce(Q());return g.markEnd(b,E)}function ea(){var c=[];if(U("("),!q(")"))for(;f<w&&(c.push(Oe()),!q(")"));)U(",");return U(")"),c}function el(){var c,h;return h=_,zo(c=Q())||Ce(c),g.markEnd(g.createIdentifier(c.value),h)}function ta(){return U("."),el()}function ra(){var c;return U("["),c=he(),U("]"),c}function na(){var c,h,b;return b=_,ue("new"),c=rl(),h=q("(")?ea():[],g.markEnd(g.createNewExpression(c,h),b)}function tl(){var c,h,b,E,j;for(j=_,c=$.allowIn,$.allowIn=!0,h=ge("new")?na():Zn(),$.allowIn=c;;){if(q("."))E=ta(),h=g.createMemberExpression(".",h,E);else if(q("("))b=ea(),h=g.createCallExpression(h,b);else if(q("["))E=ra(),h=g.createMemberExpression("[",h,E);else break;g.markEnd(h,j)}return h}function rl(){var c,h,b,E;for(E=_,c=$.allowIn,h=ge("new")?na():Zn(),$.allowIn=c;q(".")||q("[");)q("[")?(b=ra(),h=g.createMemberExpression("[",h,b)):(b=ta(),h=g.createMemberExpression(".",h,b)),g.markEnd(h,E);return h}function aa(){var c,h,b=_;return c=tl(),_.type===a.Punctuator&&(q("++")||q("--"))&&!_t()&&(y&&c.type===s.Identifier&&oe(c.name)&&ne({},o.StrictLHSPostfix),Dt(c)||ne({},o.InvalidLHSInAssignment),h=Q(),c=g.markEnd(g.createPostfixExpression(h.value,c),b)),c}function it(){var c,h,b;return _.type!==a.Punctuator&&_.type!==a.Keyword?h=aa():q("++")||q("--")?(b=_,c=Q(),h=it(),y&&h.type===s.Identifier&&oe(h.name)&&ne({},o.StrictLHSPrefix),Dt(h)||ne({},o.InvalidLHSInAssignment),h=g.createUnaryExpression(c.value,h),h=g.markEnd(h,b)):q("+")||q("-")||q("~")||q("!")?(b=_,c=Q(),h=it(),h=g.createUnaryExpression(c.value,h),h=g.markEnd(h,b)):ge("delete")||ge("void")||ge("typeof")?(b=_,c=Q(),h=it(),h=g.createUnaryExpression(c.value,h),h=g.markEnd(h,b),y&&h.operator==="delete"&&h.argument.type===s.Identifier&&ne({},o.StrictDelete)):h=aa(),h}function ia(c,h){var b=0;if(c.type!==a.Punctuator&&c.type!==a.Keyword)return 0;switch(c.value){case"||":b=1;break;case"&&":b=2;break;case"|":b=3;break;case"^":b=4;break;case"&":b=5;break;case"==":case"!=":case"===":case"!==":b=6;break;case"<":case">":case"<=":case">=":case"instanceof":b=7;break;case"in":b=h?7:0;break;case"<<":case">>":case">>>":b=8;break;case"+":case"-":b=9;break;case"*":case"/":case"%":b=11}return b}function nl(){var c,h,b,E,j,M,z,pe,ae,be;if(c=_,ae=it(),(j=ia(E=_,$.allowIn))===0)return ae;for(E.prec=j,Q(),h=[c,_],M=[ae,E,z=it()];(j=ia(_,$.allowIn))>0;){for(;M.length>2&&j<=M[M.length-2].prec;)z=M.pop(),pe=M.pop().value,ae=M.pop(),b=g.createBinaryExpression(pe,ae,z),h.pop(),c=h[h.length-1],g.markEnd(b,c),M.push(b);(E=Q()).prec=j,M.push(E),h.push(_),b=it(),M.push(b)}for(be=M.length-1,b=M[be],h.pop();be>1;)b=g.createBinaryExpression(M[be-1].value,M[be-2],b),be-=2,c=h.pop(),g.markEnd(b,c);return b}function al(){var c,h,b,E,j;return j=_,c=nl(),q("?")&&(Q(),h=$.allowIn,$.allowIn=!0,b=Oe(),$.allowIn=h,U(":"),E=Oe(),c=g.createConditionalExpression(c,b,E),g.markEnd(c,j)),c}function Oe(){var c,h,b,E,j;return c=_,j=_,E=h=al(),Qo()&&(Dt(h)||ne({},o.InvalidLHSInAssignment),y&&h.type===s.Identifier&&oe(h.name)&&ne(c,o.StrictLHSAssignment),c=Q(),b=Oe(),E=g.markEnd(g.createAssignmentExpression(c.value,h,b),j)),E}function he(){var c,h=_;if(c=Oe(),q(",")){for(c=g.createSequenceExpression([c]);f<w&&q(",");)Q(),c.expressions.push(Oe());g.markEnd(c,h)}return c}function il(){for(var c,h=[];f<w&&!q("}")&&(c=bt())!==void 0;)h.push(c);return h}function Bt(){var c,h;return h=_,U("{"),c=il(),U("}"),g.markEnd(g.createBlockStatement(c),h)}function We(){var c,h;return h=_,(c=Q()).type!==a.Identifier&&Ce(c),g.markEnd(g.createIdentifier(c.value),h)}function sl(c){var h,b,E=null;return b=_,h=We(),y&&oe(h.name)&&ne({},o.StrictVarName),c==="const"?(U("="),E=Oe()):q("=")&&(Q(),E=Oe()),g.markEnd(g.createVariableDeclarator(h,E),b)}function Or(c){var h=[];do{if(h.push(sl(c)),!q(","))break;Q()}while(f<w);return h}function ol(){var c;return ue("var"),c=Or(),Ne(),g.createVariableDeclaration(c,"var")}function ll(c){var h,b;return b=_,ue(c),h=Or(c),Ne(),g.markEnd(g.createVariableDeclaration(h,c),b)}function cl(){return U(";"),g.createEmptyStatement()}function ul(){var c=he();return Ne(),g.createExpressionStatement(c)}function pl(){var c,h,b;return ue("if"),U("("),c=he(),U(")"),h=Me(),ge("else")?(Q(),b=Me()):b=null,g.createIfStatement(c,h,b)}function dl(){var c,h,b;return ue("do"),b=$.inIteration,$.inIteration=!0,c=Me(),$.inIteration=b,ue("while"),U("("),h=he(),U(")"),q(";")&&Q(),g.createDoWhileStatement(c,h)}function fl(){var c,h,b;return ue("while"),U("("),c=he(),U(")"),b=$.inIteration,$.inIteration=!0,h=Me(),$.inIteration=b,g.createWhileStatement(c,h)}function hl(){var c,h,b;return b=_,c=Q(),h=Or(),g.markEnd(g.createVariableDeclaration(h,c.value),b)}function ml(){var c,h,b,E,j,M,z;return c=h=b=null,ue("for"),U("("),q(";")?Q():(ge("var")||ge("let")?($.allowIn=!1,c=hl(),$.allowIn=!0,c.declarations.length===1&&ge("in")&&(Q(),E=c,j=he(),c=null)):($.allowIn=!1,c=he(),$.allowIn=!0,ge("in")&&(Dt(c)||ne({},o.InvalidLHSInForIn),Q(),E=c,j=he(),c=null)),E===void 0&&U(";")),E!==void 0||(q(";")||(h=he()),U(";"),q(")")||(b=he())),U(")"),z=$.inIteration,$.inIteration=!0,M=Me(),$.inIteration=z,E===void 0?g.createForStatement(c,h,b,M):g.createForInStatement(E,j,M)}function gl(){var c,h=null;return ue("continue"),d.charCodeAt(f)===59?(Q(),$.inIteration||Y({},o.IllegalContinue),g.createContinueStatement(null)):_t()?($.inIteration||Y({},o.IllegalContinue),g.createContinueStatement(null)):(_.type!==a.Identifier||(c="$"+(h=We()).name,Object.prototype.hasOwnProperty.call($.labelSet,c)||Y({},o.UnknownLabel,h.name)),Ne(),h!==null||$.inIteration||Y({},o.IllegalContinue),g.createContinueStatement(h))}function yl(){var c,h=null;return ue("break"),d.charCodeAt(f)===59?(Q(),$.inIteration||$.inSwitch||Y({},o.IllegalBreak),g.createBreakStatement(null)):_t()?($.inIteration||$.inSwitch||Y({},o.IllegalBreak),g.createBreakStatement(null)):(_.type!==a.Identifier||(c="$"+(h=We()).name,Object.prototype.hasOwnProperty.call($.labelSet,c)||Y({},o.UnknownLabel,h.name)),Ne(),h!==null||$.inIteration||$.inSwitch||Y({},o.IllegalBreak),g.createBreakStatement(h))}function _l(){var c=null;return ue("return"),$.inFunctionBody||ne({},o.IllegalReturn),d.charCodeAt(f)===32&&C(d.charCodeAt(f+1))?(c=he(),Ne(),g.createReturnStatement(c)):_t()?g.createReturnStatement(null):(q(";")||q("}")||_.type===a.EOF||(c=he()),Ne(),g.createReturnStatement(c))}function bl(){var c,h;return y&&(k(),ne({},o.StrictModeWith)),ue("with"),U("("),c=he(),U(")"),h=Me(),g.createWithStatement(c,h)}function vl(){var c,h,b,E=[];for(b=_,ge("default")?(Q(),c=null):(ue("case"),c=he()),U(":");f<w&&!(q("}")||ge("default")||ge("case"));)h=Me(),E.push(h);return g.markEnd(g.createSwitchCase(c,E),b)}function wl(){var c,h,b,E,j;if(ue("switch"),U("("),c=he(),U(")"),U("{"),h=[],q("}"))return Q(),g.createSwitchStatement(c,h);for(E=$.inSwitch,$.inSwitch=!0,j=!1;f<w&&!q("}");)(b=vl()).test===null&&(j&&Y({},o.MultipleDefaultsInSwitch),j=!0),h.push(b);return $.inSwitch=E,U("}"),g.createSwitchStatement(c,h)}function $l(){var c;return ue("throw"),_t()&&Y({},o.NewlineAfterThrow),c=he(),Ne(),g.createThrowStatement(c)}function Sl(){var c,h,b;return b=_,ue("catch"),U("("),q(")")&&Ce(_),c=We(),y&&oe(c.name)&&ne({},o.StrictCatchVariable),U(")"),h=Bt(),g.markEnd(g.createCatchClause(c,h),b)}function xl(){var c,h=[],b=null;return ue("try"),c=Bt(),ge("catch")&&h.push(Sl()),ge("finally")&&(Q(),b=Bt()),h.length!==0||b||Y({},o.NoCatchOrFinally),g.createTryStatement(c,[],h,b)}function El(){return ue("debugger"),Ne(),g.createDebuggerStatement()}function Me(){var c,h,b,E,j=_.type;if(j===a.EOF&&Ce(_),j===a.Punctuator&&_.value==="{")return Bt();if(E=_,j===a.Punctuator)switch(_.value){case";":return g.markEnd(cl(),E);case"(":return g.markEnd(ul(),E)}if(j===a.Keyword)switch(_.value){case"break":return g.markEnd(yl(),E);case"continue":return g.markEnd(gl(),E);case"debugger":return g.markEnd(El(),E);case"do":return g.markEnd(dl(),E);case"for":return g.markEnd(ml(),E);case"function":return g.markEnd(oa(),E);case"if":return g.markEnd(pl(),E);case"return":return g.markEnd(_l(),E);case"switch":return g.markEnd(wl(),E);case"throw":return g.markEnd($l(),E);case"try":return g.markEnd(xl(),E);case"var":return g.markEnd(ol(),E);case"while":return g.markEnd(fl(),E);case"with":return g.markEnd(bl(),E)}return(c=he()).type===s.Identifier&&q(":")?(Q(),b="$"+c.name,Object.prototype.hasOwnProperty.call($.labelSet,b)&&Y({},o.Redeclaration,"Label",c.name),$.labelSet[b]=!0,h=Me(),delete $.labelSet[b],g.markEnd(g.createLabeledStatement(c,h),E)):(Ne(),g.markEnd(g.createExpressionStatement(c),E))}function jr(){var c,h,b,E,j,M,z,pe,ae=[];for(pe=_,U("{");f<w&&_.type===a.StringLiteral&&(h=_,c=bt(),ae.push(c),c.expression.type===s.Literal);)d.slice(h.start+1,h.end-1)==="use strict"?(y=!0,b&&ne(b,o.StrictOctalLiteral)):!b&&h.octal&&(b=h);for(E=$.labelSet,j=$.inIteration,M=$.inSwitch,z=$.inFunctionBody,$.labelSet={},$.inIteration=!1,$.inSwitch=!1,$.inFunctionBody=!0;f<w&&!q("}")&&(c=bt())!==void 0;)ae.push(c);return U("}"),$.labelSet=E,$.inIteration=j,$.inSwitch=M,$.inFunctionBody=z,g.markEnd(g.createBlockStatement(ae),pe)}function sa(c){var h,b,E,j,M,z,pe=[];if(U("("),!q(")"))for(j={};f<w&&(b=_,h=We(),M="$"+b.value,y?(oe(b.value)&&(E=b,z=o.StrictParamName),Object.prototype.hasOwnProperty.call(j,M)&&(E=b,z=o.StrictParamDupe)):!c&&(oe(b.value)?(c=b,z=o.StrictParamName):X(b.value)?(c=b,z=o.StrictReservedWord):Object.prototype.hasOwnProperty.call(j,M)&&(c=b,z=o.StrictParamDupe)),pe.push(h),j[M]=!0,!q(")"));)U(",");return U(")"),{params:pe,stricted:E,firstRestricted:c,message:z}}function oa(){var c,h,b,E,j,M,z,pe,ae,be=[];return ae=_,ue("function"),b=_,c=We(),y?oe(b.value)&&ne(b,o.StrictFunctionName):oe(b.value)?(M=b,z=o.StrictFunctionName):X(b.value)&&(M=b,z=o.StrictReservedWord),be=(j=sa(M)).params,E=j.stricted,M=j.firstRestricted,j.message&&(z=j.message),pe=y,h=jr(),y&&M&&Y(M,z),y&&E&&ne(E,z),y=pe,g.markEnd(g.createFunctionDeclaration(c,be,[],h),ae)}function kl(){var c,h,b,E,j,M,z,pe,ae=null,be=[];return pe=_,ue("function"),!q("(")&&(c=_,ae=We(),y?oe(c.value)&&ne(c,o.StrictFunctionName):oe(c.value)?(b=c,E=o.StrictFunctionName):X(c.value)&&(b=c,E=o.StrictReservedWord)),be=(j=sa(b)).params,h=j.stricted,b=j.firstRestricted,j.message&&(E=j.message),z=y,M=jr(),y&&b&&Y(b,E),y&&h&&ne(h,E),y=z,g.markEnd(g.createFunctionExpression(ae,be,[],M),pe)}function bt(){if(_.type===a.Keyword)switch(_.value){case"const":case"let":return ll(_.value);case"function":return oa();default:return Me()}if(_.type!==a.EOF)return Me()}function Al(){for(var c,h,b,E=[];f<w&&(h=_).type===a.StringLiteral&&(E.push(c=bt()),c.expression.type===s.Literal);)d.slice(h.start+1,h.end-1)==="use strict"?(y=!0,b&&ne(b,o.StrictOctalLiteral)):!b&&h.octal&&(b=h);for(;f<w&&(c=bt())!==void 0;)E.push(c);return E}function Il(){var c,h;return k(),Ar(),h=_,y=!1,c=Al(),g.markEnd(g.createProgram(c),h)}function la(){var c,h,b,E=[];for(c=0;c<x.tokens.length;++c)b={type:(h=x.tokens[c]).type,value:h.value},x.range&&(b.range=h.range),x.loc&&(b.loc=h.loc),E.push(b);x.tokens=E}function Ol(c,h){var b,E,j;b=String,typeof c=="string"||c instanceof String||(c=b(c)),g=m,f=0,S=(d=c).length>0?1:0,v=0,w=d.length,_=null,$={allowIn:!0,labelSet:{},inFunctionBody:!1,inIteration:!1,inSwitch:!1,lastCommentStart:-1},x={},(h=h||{}).tokens=!0,x.tokens=[],x.tokenize=!0,x.openParenToken=-1,x.openCurlyToken=-1,x.range=typeof h.range=="boolean"&&h.range,x.loc=typeof h.loc=="boolean"&&h.loc,typeof h.comment=="boolean"&&h.comment&&(x.comments=[]),typeof h.tolerant=="boolean"&&h.tolerant&&(x.errors=[]);try{if(Ar(),_.type===a.EOF)return x.tokens;for(E=Q();_.type!==a.EOF;)try{E=Q()}catch(M){if(E=_,x.errors){x.errors.push(M);break}throw M}la(),j=x.tokens,x.comments!==void 0&&(j.comments=x.comments),x.errors!==void 0&&(j.errors=x.errors)}catch(M){throw M}finally{x={}}return j}function jl(c,h){var b,E;E=String,typeof c=="string"||c instanceof String||(c=E(c)),g=m,f=0,S=(d=c).length>0?1:0,v=0,w=d.length,_=null,$={allowIn:!0,labelSet:{},inFunctionBody:!1,inIteration:!1,inSwitch:!1,lastCommentStart:-1},x={},h!==void 0&&(x.range=typeof h.range=="boolean"&&h.range,x.loc=typeof h.loc=="boolean"&&h.loc,x.attachComment=typeof h.attachComment=="boolean"&&h.attachComment,x.loc&&h.source!==null&&h.source!==void 0&&(x.source=E(h.source)),typeof h.tokens=="boolean"&&h.tokens&&(x.tokens=[]),typeof h.comment=="boolean"&&h.comment&&(x.comments=[]),typeof h.tolerant=="boolean"&&h.tolerant&&(x.errors=[]),x.attachComment&&(x.range=!0,x.comments=[],x.bottomRightStack=[],x.trailingComments=[],x.leadingComments=[]));try{b=Il(),x.comments!==void 0&&(b.comments=x.comments),x.tokens!==void 0&&(la(),b.tokens=x.tokens),x.errors!==void 0&&(b.errors=x.errors)}catch(j){throw j}finally{x={}}return b}(i={})[(a={BooleanLiteral:1,EOF:2,Identifier:3,Keyword:4,NullLiteral:5,NumericLiteral:6,Punctuator:7,StringLiteral:8,RegularExpression:9}).BooleanLiteral]="Boolean",i[a.EOF]="<end>",i[a.Identifier]="Identifier",i[a.Keyword]="Keyword",i[a.NullLiteral]="Null",i[a.NumericLiteral]="Numeric",i[a.Punctuator]="Punctuator",i[a.StringLiteral]="String",i[a.RegularExpression]="RegularExpression",l=["(","{","[","in","typeof","instanceof","new","return","case","delete","throw","void","=","+=","-=","*=","/=","%=","<<=",">>=",">>>=","&=","|=","^=",",","+","-","*","/","%","++","--","<<",">>",">>>","&","|","^","!","~","&&","||","?",":","===","==",">=","<=","<",">","!=","!=="],s={AssignmentExpression:"AssignmentExpression",ArrayExpression:"ArrayExpression",BlockStatement:"BlockStatement",BinaryExpression:"BinaryExpression",BreakStatement:"BreakStatement",CallExpression:"CallExpression",CatchClause:"CatchClause",ConditionalExpression:"ConditionalExpression",ContinueStatement:"ContinueStatement",DoWhileStatement:"DoWhileStatement",DebuggerStatement:"DebuggerStatement",EmptyStatement:"EmptyStatement",ExpressionStatement:"ExpressionStatement",ForStatement:"ForStatement",ForInStatement:"ForInStatement",FunctionDeclaration:"FunctionDeclaration",FunctionExpression:"FunctionExpression",Identifier:"Identifier",IfStatement:"IfStatement",Literal:"Literal",LabeledStatement:"LabeledStatement",LogicalExpression:"LogicalExpression",MemberExpression:"MemberExpression",NewExpression:"NewExpression",ObjectExpression:"ObjectExpression",Program:"Program",Property:"Property",ReturnStatement:"ReturnStatement",SequenceExpression:"SequenceExpression",SwitchStatement:"SwitchStatement",SwitchCase:"SwitchCase",ThisExpression:"ThisExpression",ThrowStatement:"ThrowStatement",TryStatement:"TryStatement",UnaryExpression:"UnaryExpression",UpdateExpression:"UpdateExpression",VariableDeclaration:"VariableDeclaration",VariableDeclarator:"VariableDeclarator",WhileStatement:"WhileStatement",WithStatement:"WithStatement"},u={Data:1,Get:2,Set:4},o={UnexpectedToken:"Unexpected token %0",UnexpectedNumber:"Unexpected number",UnexpectedString:"Unexpected string",UnexpectedIdentifier:"Unexpected identifier",UnexpectedReserved:"Unexpected reserved word",UnexpectedEOS:"Unexpected end of input",NewlineAfterThrow:"Illegal newline after throw",InvalidRegExp:"Invalid regular expression",UnterminatedRegExp:"Invalid regular expression: missing /",InvalidLHSInAssignment:"Invalid left-hand side in assignment",InvalidLHSInForIn:"Invalid left-hand side in for-in",MultipleDefaultsInSwitch:"More than one default clause in switch statement",NoCatchOrFinally:"Missing catch or finally after try",UnknownLabel:"Undefined label '%0'",Redeclaration:"%0 '%1' has already been declared",IllegalContinue:"Illegal continue statement",IllegalBreak:"Illegal break statement",IllegalReturn:"Illegal return statement",StrictModeWith:"Strict mode code may not include a with statement",StrictCatchVariable:"Catch variable may not be eval or arguments in strict mode",StrictVarName:"Variable name may not be eval or arguments in strict mode",StrictParamName:"Parameter name eval or arguments is not allowed in strict mode",StrictParamDupe:"Strict mode function may not have duplicate parameter names",StrictFunctionName:"Function name may not be eval or arguments in strict mode",StrictOctalLiteral:"Octal literals are not allowed in strict mode.",StrictDelete:"Delete of an unqualified identifier in strict mode.",StrictDuplicateProperty:"Duplicate data property in object literal not allowed in strict mode",AccessorDataProperty:"Object literal may not have data and accessor property with the same name",AccessorGetSet:"Object literal may not have multiple get/set accessors with the same name",StrictLHSAssignment:"Assignment to eval or arguments is not allowed in strict mode",StrictLHSPostfix:"Postfix increment/decrement may not have eval or arguments operand in strict mode",StrictLHSPrefix:"Prefix increment/decrement may not have eval or arguments operand in strict mode",StrictReservedWord:"Use of future reserved word in strict mode"},p={NonAsciiIdentifierStart:RegExp("[ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԧԱ-Ֆՙա-ևא-תװ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࢠࢢ-ࢬऄ-हऽॐक़-ॡॱ-ॷॹ-ॿঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-ళవ-హఽౘౙౠౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൠൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛰᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤜᥐ-ᥭᥰ-ᥴᦀ-ᦫᧁ-ᧇᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᳩ-ᳬᳮ-ᳱᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⸯ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚗꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꪀ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ]"),NonAsciiIdentifierPart:RegExp("[ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮ̀-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁ҃-҇Ҋ-ԧԱ-Ֆՙա-և֑-ׇֽֿׁׂׅׄא-תװ-ײؐ-ؚؠ-٩ٮ-ۓە-ۜ۟-۪ۨ-ۼۿܐ-݊ݍ-ޱ߀-ߵߺࠀ-࠭ࡀ-࡛ࢠࢢ-ࢬࣤ-ࣾऀ-ॣ०-९ॱ-ॷॹ-ॿঁ-ঃঅ-ঌএঐও-নপ-রলশ-হ়-ৄেৈো-ৎৗড়ঢ়য়-ৣ০-ৱਁ-ਃਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹ਼ਾ-ੂੇੈੋ-੍ੑਖ਼-ੜਫ਼੦-ੵઁ-ઃઅ-ઍએ-ઑઓ-નપ-રલળવ-હ઼-ૅે-ૉો-્ૐૠ-ૣ૦-૯ଁ-ଃଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହ଼-ୄେୈୋ-୍ୖୗଡ଼ଢ଼ୟ-ୣ୦-୯ୱஂஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹா-ூெ-ைொ-்ௐௗ௦-௯ఁ-ఃఅ-ఌఎ-ఐఒ-నప-ళవ-హఽ-ౄె-ైొ-్ౕౖౘౙౠ-ౣ౦-౯ಂಃಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹ಼-ೄೆ-ೈೊ-್ೕೖೞೠ-ೣ೦-೯ೱೲംഃഅ-ഌഎ-ഐഒ-ഺഽ-ൄെ-ൈൊ-ൎൗൠ-ൣ൦-൯ൺ-ൿංඃඅ-ඖක-නඳ-රලව-ෆ්ා-ුූෘ-ෟෲෳก-ฺเ-๎๐-๙ກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ູົ-ຽເ-ໄໆ່-ໍ໐-໙ໜ-ໟༀ༘༙༠-༩༹༵༷༾-ཇཉ-ཬཱ-྄྆-ྗྙ-ྼ࿆က-၉ၐ-ႝႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚ፝-፟ᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛰᜀ-ᜌᜎ-᜔ᜠ-᜴ᝀ-ᝓᝠ-ᝬᝮ-ᝰᝲᝳក-៓ៗៜ៝០-៩᠋-᠍᠐-᠙ᠠ-ᡷᢀ-ᢪᢰ-ᣵᤀ-ᤜᤠ-ᤫᤰ-᤻᥆-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉ᧐-᧙ᨀ-ᨛᨠ-ᩞ᩠-᩿᩼-᪉᪐-᪙ᪧᬀ-ᭋ᭐-᭙᭫-᭳ᮀ-᯳ᰀ-᰷᱀-᱉ᱍ-ᱽ᳐-᳔᳒-ᳶᴀ-ᷦ᷼-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼ‌‍‿⁀⁔ⁱⁿₐ-ₜ⃐-⃥⃜⃡-⃰ℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯ⵿-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⷠ-ⷿⸯ々-〇〡-〯〱-〵〸-〼ぁ-ゖ゙゚ゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘫꙀ-꙯ꙴ-꙽ꙿ-ꚗꚟ-꛱ꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꠧꡀ-ꡳꢀ-꣄꣐-꣙꣠-ꣷꣻ꤀-꤭ꤰ-꥓ꥠ-ꥼꦀ-꧀ꧏ-꧙ꨀ-ꨶꩀ-ꩍ꩐-꩙ꩠ-ꩶꩺꩻꪀ-ꫂꫛ-ꫝꫠ-ꫯꫲ-꫶ꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯪ꯬꯭꯰-꯹가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻ︀-️︠-︦︳︴﹍-﹏ﹰ-ﹴﹶ-ﻼ0-9A-Z_a-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ]")},m={name:"SyntaxTree",processComment:function(c){var h,b;if(c.type!==s.Program||!(c.body.length>0)){for(x.trailingComments.length>0?x.trailingComments[0].range[0]>=c.range[1]?(b=x.trailingComments,x.trailingComments=[]):x.trailingComments.length=0:x.bottomRightStack.length>0&&x.bottomRightStack[x.bottomRightStack.length-1].trailingComments&&x.bottomRightStack[x.bottomRightStack.length-1].trailingComments[0].range[0]>=c.range[1]&&(b=x.bottomRightStack[x.bottomRightStack.length-1].trailingComments,delete x.bottomRightStack[x.bottomRightStack.length-1].trailingComments);x.bottomRightStack.length>0&&x.bottomRightStack[x.bottomRightStack.length-1].range[0]>=c.range[0];)h=x.bottomRightStack.pop();h?h.leadingComments&&h.leadingComments[h.leadingComments.length-1].range[1]<=c.range[0]&&(c.leadingComments=h.leadingComments,delete h.leadingComments):x.leadingComments.length>0&&x.leadingComments[x.leadingComments.length-1].range[1]<=c.range[0]&&(c.leadingComments=x.leadingComments,x.leadingComments=[]),b&&(c.trailingComments=b),x.bottomRightStack.push(c)}},markEnd:function(c,h){return x.range&&(c.range=[h.start,f]),x.loc&&(c.loc=new Jo(h.startLineNumber===void 0?h.lineNumber:h.startLineNumber,h.start-(h.startLineStart===void 0?h.lineStart:h.startLineStart),S,f-v),this.postProcess(c)),x.attachComment&&this.processComment(c),c},postProcess:function(c){return x.source&&(c.loc.source=x.source),c},createArrayExpression:function(c){return{type:s.ArrayExpression,elements:c}},createAssignmentExpression:function(c,h,b){return{type:s.AssignmentExpression,operator:c,left:h,right:b}},createBinaryExpression:function(c,h,b){return{type:c==="||"||c==="&&"?s.LogicalExpression:s.BinaryExpression,operator:c,left:h,right:b}},createBlockStatement:function(c){return{type:s.BlockStatement,body:c}},createBreakStatement:function(c){return{type:s.BreakStatement,label:c}},createCallExpression:function(c,h){return{type:s.CallExpression,callee:c,arguments:h}},createCatchClause:function(c,h){return{type:s.CatchClause,param:c,body:h}},createConditionalExpression:function(c,h,b){return{type:s.ConditionalExpression,test:c,consequent:h,alternate:b}},createContinueStatement:function(c){return{type:s.ContinueStatement,label:c}},createDebuggerStatement:function(){return{type:s.DebuggerStatement}},createDoWhileStatement:function(c,h){return{type:s.DoWhileStatement,body:c,test:h}},createEmptyStatement:function(){return{type:s.EmptyStatement}},createExpressionStatement:function(c){return{type:s.ExpressionStatement,expression:c}},createForStatement:function(c,h,b,E){return{type:s.ForStatement,init:c,test:h,update:b,body:E}},createForInStatement:function(c,h,b){return{type:s.ForInStatement,left:c,right:h,body:b,each:!1}},createFunctionDeclaration:function(c,h,b,E){return{type:s.FunctionDeclaration,id:c,params:h,defaults:b,body:E,rest:null,generator:!1,expression:!1}},createFunctionExpression:function(c,h,b,E){return{type:s.FunctionExpression,id:c,params:h,defaults:b,body:E,rest:null,generator:!1,expression:!1}},createIdentifier:function(c){return{type:s.Identifier,name:c}},createIfStatement:function(c,h,b){return{type:s.IfStatement,test:c,consequent:h,alternate:b}},createLabeledStatement:function(c,h){return{type:s.LabeledStatement,label:c,body:h}},createLiteral:function(c){return{type:s.Literal,value:c.value,raw:d.slice(c.start,c.end)}},createMemberExpression:function(c,h,b){return{type:s.MemberExpression,computed:c==="[",object:h,property:b}},createNewExpression:function(c,h){return{type:s.NewExpression,callee:c,arguments:h}},createObjectExpression:function(c){return{type:s.ObjectExpression,properties:c}},createPostfixExpression:function(c,h){return{type:s.UpdateExpression,operator:c,argument:h,prefix:!1}},createProgram:function(c){return{type:s.Program,body:c}},createProperty:function(c,h,b){return{type:s.Property,key:h,value:b,kind:c}},createReturnStatement:function(c){return{type:s.ReturnStatement,argument:c}},createSequenceExpression:function(c){return{type:s.SequenceExpression,expressions:c}},createSwitchCase:function(c,h){return{type:s.SwitchCase,test:c,consequent:h}},createSwitchStatement:function(c,h){return{type:s.SwitchStatement,discriminant:c,cases:h}},createThisExpression:function(){return{type:s.ThisExpression}},createThrowStatement:function(c){return{type:s.ThrowStatement,argument:c}},createTryStatement:function(c,h,b,E){return{type:s.TryStatement,block:c,guardedHandlers:h,handlers:b,finalizer:E}},createUnaryExpression:function(c,h){return c==="++"||c==="--"?{type:s.UpdateExpression,operator:c,argument:h,prefix:!0}:{type:s.UnaryExpression,operator:c,argument:h,prefix:!0}},createVariableDeclaration:function(c,h){return{type:s.VariableDeclaration,declarations:c,kind:h}},createVariableDeclarator:function(c,h){return{type:s.VariableDeclarator,id:c,init:h}},createWhileStatement:function(c,h){return{type:s.WhileStatement,test:c,body:h}},createWithStatement:function(c,h){return{type:s.WithStatement,object:c,body:h}}},r.version="1.2.2",r.tokenize=Ol,r.parse=jl,r.Syntax=function(){var c,h={};for(c in typeof Object.create=="function"&&(h=Object.create(null)),s)s.hasOwnProperty(c)&&(h[c]=s[c]);return typeof Object.freeze=="function"&&Object.freeze(h),h}()})},{}],1:[function(n,e,t){(function(r){var a=function(){var i={trace:function(){},yy:{},symbols_:{error:2,JSON_PATH:3,DOLLAR:4,PATH_COMPONENTS:5,LEADING_CHILD_MEMBER_EXPRESSION:6,PATH_COMPONENT:7,MEMBER_COMPONENT:8,SUBSCRIPT_COMPONENT:9,CHILD_MEMBER_COMPONENT:10,DESCENDANT_MEMBER_COMPONENT:11,DOT:12,MEMBER_EXPRESSION:13,DOT_DOT:14,STAR:15,IDENTIFIER:16,SCRIPT_EXPRESSION:17,INTEGER:18,END:19,CHILD_SUBSCRIPT_COMPONENT:20,DESCENDANT_SUBSCRIPT_COMPONENT:21,"[":22,SUBSCRIPT:23,"]":24,SUBSCRIPT_EXPRESSION:25,SUBSCRIPT_EXPRESSION_LIST:26,SUBSCRIPT_EXPRESSION_LISTABLE:27,",":28,STRING_LITERAL:29,ARRAY_SLICE:30,FILTER_EXPRESSION:31,QQ_STRING:32,Q_STRING:33,$accept:0,$end:1},terminals_:{2:"error",4:"DOLLAR",12:"DOT",14:"DOT_DOT",15:"STAR",16:"IDENTIFIER",17:"SCRIPT_EXPRESSION",18:"INTEGER",19:"END",22:"[",24:"]",28:",",30:"ARRAY_SLICE",31:"FILTER_EXPRESSION",32:"QQ_STRING",33:"Q_STRING"},productions_:[0,[3,1],[3,2],[3,1],[3,2],[5,1],[5,2],[7,1],[7,1],[8,1],[8,1],[10,2],[6,1],[11,2],[13,1],[13,1],[13,1],[13,1],[13,1],[9,1],[9,1],[20,3],[21,4],[23,1],[23,1],[26,1],[26,3],[27,1],[27,1],[27,1],[25,1],[25,1],[25,1],[29,1],[29,1]],performAction:function(o,p,m,d,y,f,S){d.ast||(d.ast=l,l.initialize());var v=f.length-1;switch(y){case 1:return d.ast.set({expression:{type:"root",value:f[v]}}),d.ast.unshift(),d.ast.yield();case 2:return d.ast.set({expression:{type:"root",value:f[v-1]}}),d.ast.unshift(),d.ast.yield();case 3:return d.ast.unshift(),d.ast.yield();case 4:return d.ast.set({operation:"member",scope:"child",expression:{type:"identifier",value:f[v-1]}}),d.ast.unshift(),d.ast.yield();case 5:case 6:case 11:case 13:case 18:case 21:case 22:case 23:break;case 7:d.ast.set({operation:"member"}),d.ast.push();break;case 8:d.ast.set({operation:"subscript"}),d.ast.push();break;case 9:case 19:d.ast.set({scope:"child"});break;case 10:case 20:d.ast.set({scope:"descendant"});break;case 12:d.ast.set({scope:"child",operation:"member"});break;case 14:d.ast.set({expression:{type:"wildcard",value:f[v]}});break;case 15:d.ast.set({expression:{type:"identifier",value:f[v]}});break;case 16:d.ast.set({expression:{type:"script_expression",value:f[v]}});break;case 17:d.ast.set({expression:{type:"numeric_literal",value:parseInt(f[v])}});break;case 24:f[v].length>1?d.ast.set({expression:{type:"union",value:f[v]}}):this.$=f[v];break;case 25:this.$=[f[v]];break;case 26:this.$=f[v-2].concat(f[v]);break;case 27:this.$={expression:{type:"numeric_literal",value:parseInt(f[v])}},d.ast.set(this.$);break;case 28:this.$={expression:{type:"string_literal",value:f[v]}},d.ast.set(this.$);break;case 29:this.$={expression:{type:"slice",value:f[v]}},d.ast.set(this.$);break;case 30:this.$={expression:{type:"wildcard",value:f[v]}},d.ast.set(this.$);break;case 31:this.$={expression:{type:"script_expression",value:f[v]}},d.ast.set(this.$);break;case 32:this.$={expression:{type:"filter_expression",value:f[v]}},d.ast.set(this.$);break;case 33:case 34:this.$=f[v]}},table:[{3:1,4:[1,2],6:3,13:4,15:[1,5],16:[1,6],17:[1,7],18:[1,8],19:[1,9]},{1:[3]},{1:[2,1],5:10,7:11,8:12,9:13,10:14,11:15,12:[1,18],14:[1,19],20:16,21:17,22:[1,20]},{1:[2,3],5:21,7:11,8:12,9:13,10:14,11:15,12:[1,18],14:[1,19],20:16,21:17,22:[1,20]},{1:[2,12],12:[2,12],14:[2,12],22:[2,12]},{1:[2,14],12:[2,14],14:[2,14],22:[2,14]},{1:[2,15],12:[2,15],14:[2,15],22:[2,15]},{1:[2,16],12:[2,16],14:[2,16],22:[2,16]},{1:[2,17],12:[2,17],14:[2,17],22:[2,17]},{1:[2,18],12:[2,18],14:[2,18],22:[2,18]},{1:[2,2],7:22,8:12,9:13,10:14,11:15,12:[1,18],14:[1,19],20:16,21:17,22:[1,20]},{1:[2,5],12:[2,5],14:[2,5],22:[2,5]},{1:[2,7],12:[2,7],14:[2,7],22:[2,7]},{1:[2,8],12:[2,8],14:[2,8],22:[2,8]},{1:[2,9],12:[2,9],14:[2,9],22:[2,9]},{1:[2,10],12:[2,10],14:[2,10],22:[2,10]},{1:[2,19],12:[2,19],14:[2,19],22:[2,19]},{1:[2,20],12:[2,20],14:[2,20],22:[2,20]},{13:23,15:[1,5],16:[1,6],17:[1,7],18:[1,8],19:[1,9]},{13:24,15:[1,5],16:[1,6],17:[1,7],18:[1,8],19:[1,9],22:[1,25]},{15:[1,29],17:[1,30],18:[1,33],23:26,25:27,26:28,27:32,29:34,30:[1,35],31:[1,31],32:[1,36],33:[1,37]},{1:[2,4],7:22,8:12,9:13,10:14,11:15,12:[1,18],14:[1,19],20:16,21:17,22:[1,20]},{1:[2,6],12:[2,6],14:[2,6],22:[2,6]},{1:[2,11],12:[2,11],14:[2,11],22:[2,11]},{1:[2,13],12:[2,13],14:[2,13],22:[2,13]},{15:[1,29],17:[1,30],18:[1,33],23:38,25:27,26:28,27:32,29:34,30:[1,35],31:[1,31],32:[1,36],33:[1,37]},{24:[1,39]},{24:[2,23]},{24:[2,24],28:[1,40]},{24:[2,30]},{24:[2,31]},{24:[2,32]},{24:[2,25],28:[2,25]},{24:[2,27],28:[2,27]},{24:[2,28],28:[2,28]},{24:[2,29],28:[2,29]},{24:[2,33],28:[2,33]},{24:[2,34],28:[2,34]},{24:[1,41]},{1:[2,21],12:[2,21],14:[2,21],22:[2,21]},{18:[1,33],27:42,29:34,30:[1,35],32:[1,36],33:[1,37]},{1:[2,22],12:[2,22],14:[2,22],22:[2,22]},{24:[2,26],28:[2,26]}],defaultActions:{27:[2,23],29:[2,30],30:[2,31],31:[2,32]},parseError:function(o,p){if(p.recoverable)this.trace(o);else throw Error(o)},parse:function(o){var p=this,m=[0],d=[null],y=[],f=this.table,S="",v=0,w=0,g=0,_=2,$=1,x=y.slice.call(arguments,1);this.lexer.setInput(o),this.lexer.yy=this.yy,this.yy.lexer=this.lexer,this.yy.parser=this,this.lexer.yylloc===void 0&&(this.lexer.yylloc={});var T=this.lexer.yylloc;y.push(T);var P=this.lexer.options&&this.lexer.options.ranges;function D(){var ee;return typeof(ee=p.lexer.lex()||$)!="number"&&(ee=p.symbols_[ee]||ee),ee}typeof this.yy.parseError=="function"?this.parseError=this.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;for(var R,I,F,C,B,V,X,oe,we,H={};;){if(F=m[m.length-1],this.defaultActions[F]?C=this.defaultActions[F]:(R==null&&(R=D()),C=f[F]&&f[F][R]),C===void 0||!C.length||!C[0]){var ie="";for(V in we=[],f[F])this.terminals_[V]&&V>_&&we.push("'"+this.terminals_[V]+"'");ie=this.lexer.showPosition?"Parse error on line "+(v+1)+\`:
15434
15234
  \`+this.lexer.showPosition()+\`
15435
- Expecting \`+ve.join(", ")+", got '"+(this.terminals_[R]||R)+"'":"Parse error on line "+(v+1)+": Unexpected "+(R==$?"end of input":"'"+(this.terminals_[R]||R)+"'"),this.parseError(ie,{text:this.lexer.match,token:this.terminals_[R]||R,line:this.lexer.yylineno,loc:T,expected:ve})}if(C[0]instanceof Array&&C.length>1)throw Error("Parse Error: multiple actions possible at state: "+F+", token: "+R);switch(C[0]){case 1:m.push(R),d.push(this.lexer.yytext),y.push(this.lexer.yylloc),m.push(C[1]),R=null,I?(R=I,I=null):(w=this.lexer.yyleng,S=this.lexer.yytext,v=this.lexer.yylineno,T=this.lexer.yylloc,g>0);break;case 2:if(X=this.productions_[C[1]][1],H.$=d[d.length-X],H._$={first_line:y[y.length-(X||1)].first_line,last_line:y[y.length-1].last_line,first_column:y[y.length-(X||1)].first_column,last_column:y[y.length-1].last_column},P&&(H._$.range=[y[y.length-(X||1)].range[0],y[y.length-1].range[1]]),(B=this.performAction.apply(H,[S,w,v,this.yy,C[1],d,y].concat(x)))!==void 0)return B;X&&(m=m.slice(0,-1*X*2),d=d.slice(0,-1*X),y=y.slice(0,-1*X)),m.push(this.productions_[C[1]][0]),d.push(H.$),y.push(H._$),le=f[m[m.length-2]][m[m.length-1]],m.push(le);break;case 3:return!0}}return!0}},l={initialize:function(){this._nodes=[],this._node={},this._stash=[]},set:function(o){for(var p in o)this._node[p]=o[p];return this._node},node:function(o){return arguments.length&&(this._node=o),this._node},push:function(){this._nodes.push(this._node),this._node={}},unshift:function(){this._nodes.unshift(this._node),this._node={}},yield:function(){var o=this._nodes;return this.initialize(),o}},s=function(){return{EOF:1,parseError:function(o,p){if(this.yy.parser)this.yy.parser.parseError(o,p);else throw Error(o)},setInput:function(o){return this._input=o,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var o=this._input[0];return this.yytext+=o,this.yyleng++,this.offset++,this.match+=o,this.matched+=o,o.match(/(?:\\r\\n?|\\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),o},unput:function(o){var p=o.length,m=o.split(/(?:\\r\\n?|\\n)/g);this._input=o+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-p-1),this.offset-=p;var d=this.match.split(/(?:\\r\\n?|\\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),m.length-1&&(this.yylineno-=m.length-1);var y=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:m?(m.length===d.length?this.yylloc.first_column:0)+d[d.length-m.length].length-m[0].length:this.yylloc.first_column-p},this.options.ranges&&(this.yylloc.range=[y[0],y[0]+this.yyleng-p]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+\`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
15235
+ Expecting \`+we.join(", ")+", got '"+(this.terminals_[R]||R)+"'":"Parse error on line "+(v+1)+": Unexpected "+(R==$?"end of input":"'"+(this.terminals_[R]||R)+"'"),this.parseError(ie,{text:this.lexer.match,token:this.terminals_[R]||R,line:this.lexer.yylineno,loc:T,expected:we})}if(C[0]instanceof Array&&C.length>1)throw Error("Parse Error: multiple actions possible at state: "+F+", token: "+R);switch(C[0]){case 1:m.push(R),d.push(this.lexer.yytext),y.push(this.lexer.yylloc),m.push(C[1]),R=null,I?(R=I,I=null):(w=this.lexer.yyleng,S=this.lexer.yytext,v=this.lexer.yylineno,T=this.lexer.yylloc,g>0);break;case 2:if(X=this.productions_[C[1]][1],H.$=d[d.length-X],H._$={first_line:y[y.length-(X||1)].first_line,last_line:y[y.length-1].last_line,first_column:y[y.length-(X||1)].first_column,last_column:y[y.length-1].last_column},P&&(H._$.range=[y[y.length-(X||1)].range[0],y[y.length-1].range[1]]),(B=this.performAction.apply(H,[S,w,v,this.yy,C[1],d,y].concat(x)))!==void 0)return B;X&&(m=m.slice(0,-1*X*2),d=d.slice(0,-1*X),y=y.slice(0,-1*X)),m.push(this.productions_[C[1]][0]),d.push(H.$),y.push(H._$),oe=f[m[m.length-2]][m[m.length-1]],m.push(oe);break;case 3:return!0}}return!0}},l={initialize:function(){this._nodes=[],this._node={},this._stash=[]},set:function(o){for(var p in o)this._node[p]=o[p];return this._node},node:function(o){return arguments.length&&(this._node=o),this._node},push:function(){this._nodes.push(this._node),this._node={}},unshift:function(){this._nodes.unshift(this._node),this._node={}},yield:function(){var o=this._nodes;return this.initialize(),o}},s=function(){return{EOF:1,parseError:function(o,p){if(this.yy.parser)this.yy.parser.parseError(o,p);else throw Error(o)},setInput:function(o){return this._input=o,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var o=this._input[0];return this.yytext+=o,this.yyleng++,this.offset++,this.match+=o,this.matched+=o,o.match(/(?:\\r\\n?|\\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),o},unput:function(o){var p=o.length,m=o.split(/(?:\\r\\n?|\\n)/g);this._input=o+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-p-1),this.offset-=p;var d=this.match.split(/(?:\\r\\n?|\\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),m.length-1&&(this.yylineno-=m.length-1);var y=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:m?(m.length===d.length?this.yylloc.first_column:0)+d[d.length-m.length].length-m[0].length:this.yylloc.first_column-p},this.options.ranges&&(this.yylloc.range=[y[0],y[0]+this.yyleng-p]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+\`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
15436
15236
  \`+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(o){this.unput(this.match.slice(o))},pastInput:function(){var o=this.matched.substr(0,this.matched.length-this.match.length);return(o.length>20?"...":"")+o.substr(-20).replace(/\\n/g,"")},upcomingInput:function(){var o=this.match;return o.length<20&&(o+=this._input.substr(0,20-o.length)),(o.substr(0,20)+(o.length>20?"...":"")).replace(/\\n/g,"")},showPosition:function(){var o=this.pastInput(),p=Array(o.length+1).join("-");return o+this.upcomingInput()+\`
15437
15237
  \`+p+"^"},test_match:function(o,p){var m,d,y;if(this.options.backtrack_lexer&&(y={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(y.yylloc.range=this.yylloc.range.slice(0))),(d=o[0].match(/(?:\\r\\n?|\\n).*/g))&&(this.yylineno+=d.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:d?d[d.length-1].length-d[d.length-1].match(/\\r?\\n?/)[0].length:this.yylloc.last_column+o[0].length},this.yytext+=o[0],this.match+=o[0],this.matches=o,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(o[0].length),this.matched+=o[0],m=this.performAction.call(this,this.yy,this,p,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),m)return m;if(this._backtrack)for(var f in y)this[f]=y[f];return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var o,p,m,d,y=this._currentRules(),f=0;f<y.length;f++)if((m=this._input.match(this.rules[y[f]]))&&(!p||m[0].length>p[0].length)){if(p=m,d=f,this.options.backtrack_lexer){if((o=this.test_match(m,y[f]))!==!1)return o;if(!this._backtrack)return!1;p=!1;continue}if(!this.options.flex)break}return p?(o=this.test_match(p,y[d]))!==!1&&o:this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+\`. Unrecognized text.
15438
15238
  \`+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){return this.next()||this.lex()},begin:function(o){this.conditionStack.push(o)},popState:function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(o){return(o=this.conditionStack.length-1-Math.abs(o||0))>=0?this.conditionStack[o]:"INITIAL"},pushState:function(o){this.begin(o)},stateStackSize:function(){return this.conditionStack.length},options:{},performAction:function(o,p,m,d){switch(m){case 0:return 4;case 1:return 14;case 2:return 12;case 3:return 15;case 4:return 16;case 5:return 22;case 6:return 24;case 7:return 28;case 8:return 30;case 9:return 18;case 10:return p.yytext=p.yytext.substr(1,p.yyleng-2),32;case 11:return p.yytext=p.yytext.substr(1,p.yyleng-2),33;case 12:return 17;case 13:return 31}},rules:[/^(?:\\$)/,/^(?:\\.\\.)/,/^(?:\\.)/,/^(?:\\*)/,/^(?:[a-zA-Z_]+[a-zA-Z0-9_]*)/,/^(?:\\[)/,/^(?:\\])/,/^(?:,)/,/^(?:((-?(?:0|[1-9][0-9]*)))?\\:((-?(?:0|[1-9][0-9]*)))?(\\:((-?(?:0|[1-9][0-9]*)))?)?)/,/^(?:(-?(?:0|[1-9][0-9]*)))/,/^(?:"(?:\\\\["bfnrt/\\\\]|\\\\u[a-fA-F0-9]{4}|[^"\\\\])*")/,/^(?:'(?:\\\\['bfnrt/\\\\]|\\\\u[a-fA-F0-9]{4}|[^'\\\\])*')/,/^(?:\\(.+?\\)(?=\\]))/,/^(?:\\?\\(.+?\\)(?=\\]))/],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13],inclusive:!0}}}}();function u(){this.yy={}}return i.lexer=s,u.prototype=i,i.Parser=u,new u}();n!==void 0&&t!==void 0&&(t.parser=a,t.Parser=a.Parser,t.parse=function(){return a.parse.apply(a,arguments)},t.main=function(i){i[1]||(console.log("Usage: "+i[0]+" FILE"),r.exit(1));var l=n("fs").readFileSync(n("path").normalize(i[1]),"utf8");return t.parser.parse(l)},e!==void 0&&n.main===e&&t.main(r.argv.slice(1)))}).call(this,n("_process"))},{_process:14,fs:12,path:13}],2:[function(n,e,t){e.exports={identifier:"[a-zA-Z_]+[a-zA-Z0-9_]*",integer:"-?(?:0|[1-9][0-9]*)",qq_string:'"(?:\\\\\\\\["bfnrt/\\\\\\\\]|\\\\\\\\u[a-fA-F0-9]{4}|[^"\\\\\\\\])*"',q_string:"'(?:\\\\\\\\['bfnrt/\\\\\\\\]|\\\\\\\\u[a-fA-F0-9]{4}|[^'\\\\\\\\])*'"}},{}],3:[function(n,e,t){var r=n("./dict"),a=n("fs"),i={lex:{macros:{esc:"\\\\\\\\",int:r.integer},rules:[["\\\\$","return 'DOLLAR'"],["\\\\.\\\\.","return 'DOT_DOT'"],["\\\\.","return 'DOT'"],["\\\\*","return 'STAR'"],[r.identifier,"return 'IDENTIFIER'"],["\\\\[","return '['"],["\\\\]","return ']'"],[",","return ','"],["({int})?\\\\:({int})?(\\\\:({int})?)?","return 'ARRAY_SLICE'"],["{int}","return 'INTEGER'"],[r.qq_string,"yytext = yytext.substr(1,yyleng-2); return 'QQ_STRING';"],[r.q_string,"yytext = yytext.substr(1,yyleng-2); return 'Q_STRING';"],["\\\\(.+?\\\\)(?=\\\\])","return 'SCRIPT_EXPRESSION'"],["\\\\?\\\\(.+?\\\\)(?=\\\\])","return 'FILTER_EXPRESSION'"]]},start:"JSON_PATH",bnf:{JSON_PATH:[["DOLLAR",'yy.ast.set({ expression: { type: "root", value: $1 } }); yy.ast.unshift(); return yy.ast.yield()'],["DOLLAR PATH_COMPONENTS",'yy.ast.set({ expression: { type: "root", value: $1 } }); yy.ast.unshift(); return yy.ast.yield()'],["LEADING_CHILD_MEMBER_EXPRESSION","yy.ast.unshift(); return yy.ast.yield()"],["LEADING_CHILD_MEMBER_EXPRESSION PATH_COMPONENTS",'yy.ast.set({ operation: "member", scope: "child", expression: { type: "identifier", value: $1 }}); yy.ast.unshift(); return yy.ast.yield()']],PATH_COMPONENTS:[["PATH_COMPONENT",""],["PATH_COMPONENTS PATH_COMPONENT",""]],PATH_COMPONENT:[["MEMBER_COMPONENT",'yy.ast.set({ operation: "member" }); yy.ast.push()'],["SUBSCRIPT_COMPONENT",'yy.ast.set({ operation: "subscript" }); yy.ast.push() ']],MEMBER_COMPONENT:[["CHILD_MEMBER_COMPONENT",'yy.ast.set({ scope: "child" })'],["DESCENDANT_MEMBER_COMPONENT",'yy.ast.set({ scope: "descendant" })']],CHILD_MEMBER_COMPONENT:[["DOT MEMBER_EXPRESSION",""]],LEADING_CHILD_MEMBER_EXPRESSION:[["MEMBER_EXPRESSION",'yy.ast.set({ scope: "child", operation: "member" })']],DESCENDANT_MEMBER_COMPONENT:[["DOT_DOT MEMBER_EXPRESSION",""]],MEMBER_EXPRESSION:[["STAR",'yy.ast.set({ expression: { type: "wildcard", value: $1 } })'],["IDENTIFIER",'yy.ast.set({ expression: { type: "identifier", value: $1 } })'],["SCRIPT_EXPRESSION",'yy.ast.set({ expression: { type: "script_expression", value: $1 } })'],["INTEGER",'yy.ast.set({ expression: { type: "numeric_literal", value: parseInt($1) } })'],["END",""]],SUBSCRIPT_COMPONENT:[["CHILD_SUBSCRIPT_COMPONENT",'yy.ast.set({ scope: "child" })'],["DESCENDANT_SUBSCRIPT_COMPONENT",'yy.ast.set({ scope: "descendant" })']],CHILD_SUBSCRIPT_COMPONENT:[["[ SUBSCRIPT ]",""]],DESCENDANT_SUBSCRIPT_COMPONENT:[["DOT_DOT [ SUBSCRIPT ]",""]],SUBSCRIPT:[["SUBSCRIPT_EXPRESSION",""],["SUBSCRIPT_EXPRESSION_LIST",'$1.length > 1? yy.ast.set({ expression: { type: "union", value: $1 } }) : $$ = $1']],SUBSCRIPT_EXPRESSION_LIST:[["SUBSCRIPT_EXPRESSION_LISTABLE","$$ = [$1]"],["SUBSCRIPT_EXPRESSION_LIST , SUBSCRIPT_EXPRESSION_LISTABLE","$$ = $1.concat($3)"]],SUBSCRIPT_EXPRESSION_LISTABLE:[["INTEGER",'$$ = { expression: { type: "numeric_literal", value: parseInt($1) } }; yy.ast.set($$)'],["STRING_LITERAL",'$$ = { expression: { type: "string_literal", value: $1 } }; yy.ast.set($$)'],["ARRAY_SLICE",'$$ = { expression: { type: "slice", value: $1 } }; yy.ast.set($$)']],SUBSCRIPT_EXPRESSION:[["STAR",'$$ = { expression: { type: "wildcard", value: $1 } }; yy.ast.set($$)'],["SCRIPT_EXPRESSION",'$$ = { expression: { type: "script_expression", value: $1 } }; yy.ast.set($$)'],["FILTER_EXPRESSION",'$$ = { expression: { type: "filter_expression", value: $1 } }; yy.ast.set($$)']],STRING_LITERAL:[["QQ_STRING","$$ = $1"],["Q_STRING","$$ = $1"]]}};a.readFileSync&&(i.moduleInclude=a.readFileSync(n.resolve("../include/module.js")),i.actionInclude=a.readFileSync(n.resolve("../include/action.js"))),e.exports=i},{"./dict":2,fs:12}],4:[function(n,e,t){var r=n("./aesprim"),a=n("./slice"),i=n("static-eval"),l=n("underscore").uniq,s=function(){return this.initialize.apply(this,arguments)};function u(w,g,_){var $=n("./index"),x=f(r.parse(g).body[0].expression,{"@":w.value}),T=_.replace(/\\{\\{\\s*value\\s*\\}\\}/g,x),P=$.nodes(w.value,T);return P.forEach(function(D){D.path=w.path.concat(D.path.slice(1))}),P}function o(w){return Array.isArray(w)}function p(w){return w&&!(w instanceof Array)&&w instanceof Object}function m(w){return function(g,_,$,x){var T=g.value,P=g.path,D=[],R=(function(I,F){o(I)?(I.forEach(function(C,B){!(D.length>=x)&&$(B,C,_)&&D.push({path:F.concat(B),value:C})}),I.forEach(function(C,B){!(D.length>=x)&&w&&R(C,F.concat(B))})):p(I)&&(this.keys(I).forEach(function(C){!(D.length>=x)&&$(C,I[C],_)&&D.push({path:F.concat(C),value:I[C]})}),this.keys(I).forEach(function(C){!(D.length>=x)&&w&&R(I[C],F.concat(C))}))}).bind(this);return R(T,P),D}}function d(w){return function(g,_,$){return this.descend(_,g.expression.value,w,$)}}function y(w){return function(g,_,$){return this.traverse(_,g.expression.value,w,$)}}function f(){try{return i.apply(this,arguments)}catch{}}function S(w){return l(w=w.filter(function(g){return g}),function(g){return g.path.map(function(_){return String(_).replace("-","--")}).join("-")})}function v(w){var g=String(w);return g.match(/^-?[0-9]+$/)?parseInt(g):null}s.prototype.initialize=function(){this.traverse=m(!0),this.descend=m()},s.prototype.keys=Object.keys,s.prototype.resolve=function(w){var g=[w.operation,w.scope,w.expression.type].join("-"),_=this._fns[g];if(!_)throw Error("couldn't resolve key: "+g);return _.bind(this)},s.prototype.register=function(w,g){if(!g instanceof Function)throw Error("handler must be a function");this._fns[w]=g},s.prototype._fns={"member-child-identifier":function(w,g){var _=w.expression.value,$=g.value;if($ instanceof Object&&_ in $)return[{value:$[_],path:g.path.concat(_)}]},"member-descendant-identifier":y(function(w,g,_){return w==_}),"subscript-child-numeric_literal":d(function(w,g,_){return w===_}),"member-child-numeric_literal":d(function(w,g,_){return String(w)===String(_)}),"subscript-descendant-numeric_literal":y(function(w,g,_){return w===_}),"member-child-wildcard":d(function(){return!0}),"member-descendant-wildcard":y(function(){return!0}),"subscript-descendant-wildcard":y(function(){return!0}),"subscript-child-wildcard":d(function(){return!0}),"subscript-child-slice":function(w,g){if(o(g.value)){var _=w.expression.value.split(":").map(v),$=g.value.map(function(x,T){return{value:x,path:g.path.concat(T)}});return a.apply(null,[$].concat(_))}},"subscript-child-union":function(w,g){var _=[];return w.expression.value.forEach(function($){var x={operation:"subscript",scope:"child",expression:$.expression},T=this.resolve(x)(x,g);T&&(_=_.concat(T))},this),S(_)},"subscript-descendant-union":function(w,g,_){var $=n(".."),x=this,T=[];return $.nodes(g,"$..*").slice(1).forEach(function(P){T.length>=_||w.expression.value.forEach(function(D){var R={operation:"subscript",scope:"child",expression:D.expression},I=x.resolve(R)(R,P);T=T.concat(I)})}),S(T)},"subscript-child-filter_expression":function(w,g,_){var $=w.expression.value.slice(2,-1),x=r.parse($).body[0].expression,T=function(P,D){return f(x,{"@":D})};return this.descend(g,null,T,_)},"subscript-descendant-filter_expression":function(w,g,_){var $=w.expression.value.slice(2,-1),x=r.parse($).body[0].expression,T=function(P,D){return f(x,{"@":D})};return this.traverse(g,null,T,_)},"subscript-child-script_expression":function(w,g){return u(g,w.expression.value.slice(1,-1),"$[{{value}}]")},"member-child-script_expression":function(w,g){return u(g,w.expression.value.slice(1,-1),"$.{{value}}")},"member-descendant-script_expression":function(w,g){return u(g,w.expression.value.slice(1,-1),"$..value")}},s.prototype._fns["subscript-child-string_literal"]=s.prototype._fns["member-child-identifier"],s.prototype._fns["member-descendant-numeric_literal"]=s.prototype._fns["subscript-descendant-string_literal"]=s.prototype._fns["member-descendant-identifier"],e.exports=s},{"..":"jsonpath","./aesprim":"./aesprim","./index":5,"./slice":7,"static-eval":15,underscore:12}],5:[function(n,e,t){var r=n("assert"),a=n("./dict"),i=n("./parser"),l=n("./handlers"),s=function(){this.initialize.apply(this,arguments)};function u(p){return Object.prototype.toString.call(p)=="[object String]"}s.prototype.initialize=function(){this.parser=new i,this.handlers=new l},s.prototype.parse=function(p){return r.ok(u(p),"we need a path"),this.parser.parse(p)},s.prototype.parent=function(p,m){r.ok(p instanceof Object,"obj needs to be an object"),r.ok(m,"we need a path");var d=this.nodes(p,m)[0];return d.path.pop(),this.value(p,d.path)},s.prototype.apply=function(p,m,d){r.ok(p instanceof Object,"obj needs to be an object"),r.ok(m,"we need a path"),r.equal(typeof d,"function","fn needs to be function");var y=this.nodes(p,m).sort(function(f,S){return S.path.length-f.path.length});return y.forEach(function(f){var S=f.path.pop(),v=this.value(p,this.stringify(f.path)),w=f.value=d.call(p,v[S]);v[S]=w},this),y},s.prototype.value=function(p,m,d){if(r.ok(p instanceof Object,"obj needs to be an object"),r.ok(m,"we need a path"),arguments.length>=3){var y=this.nodes(p,m).shift();if(!y)return this._vivify(p,m,d);var f=y.path.slice(-1).shift();this.parent(p,this.stringify(y.path))[f]=d}return this.query(p,this.stringify(m),1).shift()},s.prototype._vivify=function(p,m,d){var y=this;r.ok(p instanceof Object,"obj needs to be an object"),r.ok(m,"we need a path");var f=this.parser.parse(m).map(function(v){return v.expression.value}),S=function(v,w){var g=v.pop(),_=y.value(p,v);_||(S(v.concat(),typeof g=="string"?{}:[]),_=y.value(p,v)),_[g]=w};return S(f,d),this.query(p,m)[0]},s.prototype.query=function(p,m,d){return r.ok(p instanceof Object,"obj needs to be an object"),r.ok(u(m),"we need a path"),this.nodes(p,m,d).map(function(y){return y.value})},s.prototype.paths=function(p,m,d){return r.ok(p instanceof Object,"obj needs to be an object"),r.ok(m,"we need a path"),this.nodes(p,m,d).map(function(y){return y.path})},s.prototype.nodes=function(p,m,d){if(r.ok(p instanceof Object,"obj needs to be an object"),r.ok(m,"we need a path"),d===0)return[];var y=this.parser.parse(m),f=this.handlers,S=[{path:["$"],value:p}],v=[];return y.length&&y[0].expression.type=="root"&&y.shift(),y.length?(y.forEach(function(w,g){if(!(v.length>=d)){var _=f.resolve(w),$=[];S.forEach(function(x){if(!(v.length>=d)){var T=_(w,x,d);g==y.length-1?v=v.concat(T||[]):$=$.concat(T||[])}}),S=$}}),d?v.slice(0,d):v):S},s.prototype.stringify=function(p){r.ok(p,"we need a path");var m="$",d={"descendant-member":"..{{value}}","child-member":".{{value}}","descendant-subscript":"..[{{value}}]","child-subscript":"[{{value}}]"};return(p=this._normalize(p)).forEach(function(y){if(y.expression.type!="root"){var f,S=[y.scope,y.operation].join("-"),v=d[S];if(f=y.expression.type=="string_literal"?JSON.stringify(y.expression.value):y.expression.value,!v)throw Error("couldn't find template "+S);m+=v.replace(/{{value}}/,f)}}),m},s.prototype._normalize=function(p){if(r.ok(p,"we need a path"),typeof p=="string")return this.parser.parse(p);if(Array.isArray(p)&&typeof p[0]=="string"){var m=[{expression:{type:"root",value:"$"}}];return p.forEach(function(d,y){if(d!="$"||y!==0)if(typeof d=="string"&&d.match("^"+a.identifier+"$"))m.push({operation:"member",scope:"child",expression:{value:d,type:"identifier"}});else{var f=typeof d=="number"?"numeric_literal":"string_literal";m.push({operation:"subscript",scope:"child",expression:{value:d,type:f}})}}),m}if(Array.isArray(p)&&typeof p[0]=="object")return p;throw Error("couldn't understand path "+p)},s.Handlers=l,s.Parser=i;var o=new s;o.JSONPath=s,e.exports=o},{"./dict":2,"./handlers":4,"./parser":6,assert:8}],6:[function(n,e,t){var r=n("./grammar"),a=n("../generated/parser"),i=function(){var l=new a.Parser,s=l.parseError;return l.yy.parseError=function(){l.yy.ast&&l.yy.ast.initialize(),s.apply(l,arguments)},l};i.grammar=r,e.exports=i},{"../generated/parser":1,"./grammar":3}],7:[function(n,e,t){e.exports=function(a,i,l,s){if(typeof i=="string")throw Error("start cannot be a string");if(typeof l=="string")throw Error("end cannot be a string");if(typeof s=="string")throw Error("step cannot be a string");var u=a.length;if(s===0)throw Error("step cannot be zero");if(s=s?r(s):1,i=i<0?u+i:i,l=l<0?u+l:l,i=r(i===0?0:i||(s>0?0:u-1)),l=r(l===0?0:l||(s>0?u:-1)),i=s>0?Math.max(0,i):Math.min(u,i),l=s>0?Math.min(l,u):Math.max(-1,l),s>0&&l<=i||s<0&&i<=l)return[];for(var o=[],p=i;p!=l&&(!(s<0)||!(p<=l))&&(!(s>0)||!(p>=l));p+=s)o.push(a[p]);return o};function r(a){return String(a).match(/^[0-9]+$/)?parseInt(a):Number.isFinite(a)?parseInt(a,10):0}},{}],8:[function(n,e,t){var r=n("util/"),a=Array.prototype.slice,i=Object.prototype.hasOwnProperty,l=e.exports=m;function s(g,_){return r.isUndefined(_)?""+_:r.isNumber(_)&&!isFinite(_)||r.isFunction(_)||r.isRegExp(_)?_.toString():_}function u(g,_){return r.isString(g)?g.length<_?g:g.slice(0,_):g}function o(g){return u(JSON.stringify(g.actual,s),128)+" "+g.operator+" "+u(JSON.stringify(g.expected,s),128)}function p(g,_,$,x,T){throw new l.AssertionError({message:$,actual:g,expected:_,operator:x,stackStartFunction:T})}function m(g,_){g||p(g,!0,_,"==",l.ok)}function d(g,_){if(g===_)return!0;if(r.isBuffer(g)&&r.isBuffer(_)){if(g.length!=_.length)return!1;for(var $=0;$<g.length;$++)if(g[$]!==_[$])return!1;return!0}return r.isDate(g)&&r.isDate(_)?g.getTime()===_.getTime():r.isRegExp(g)&&r.isRegExp(_)?g.source===_.source&&g.global===_.global&&g.multiline===_.multiline&&g.lastIndex===_.lastIndex&&g.ignoreCase===_.ignoreCase:r.isObject(g)||r.isObject(_)?f(g,_):g==_}function y(g){return Object.prototype.toString.call(g)=="[object Arguments]"}function f(g,_){if(r.isNullOrUndefined(g)||r.isNullOrUndefined(_)||g.prototype!==_.prototype)return!1;if(r.isPrimitive(g)||r.isPrimitive(_))return g===_;var $=y(g),x=y(_);if($&&!x||!$&&x)return!1;if($)return d(g=a.call(g),_=a.call(_));var T,P,D=w(g),R=w(_);if(D.length!=R.length)return!1;for(D.sort(),R.sort(),P=D.length-1;P>=0;P--)if(D[P]!=R[P])return!1;for(P=D.length-1;P>=0;P--)if(!d(g[T=D[P]],_[T]))return!1;return!0}function S(g,_){return!!g&&!!_&&(Object.prototype.toString.call(_)=="[object RegExp]"?_.test(g):g instanceof _||_.call({},g)===!0)}function v(g,_,$,x){var T;r.isString($)&&(x=$,$=null);try{_()}catch(P){T=P}if(x=($&&$.name?" ("+$.name+").":".")+(x?" "+x:"."),g&&!T&&p(T,$,"Missing expected exception"+x),!g&&S(T,$)&&p(T,$,"Got unwanted exception"+x),g&&T&&$&&!S(T,$)||!g&&T)throw T}l.AssertionError=function(g){this.name="AssertionError",this.actual=g.actual,this.expected=g.expected,this.operator=g.operator,g.message?(this.message=g.message,this.generatedMessage=!1):(this.message=o(this),this.generatedMessage=!0);var _=g.stackStartFunction||p;if(Error.captureStackTrace)Error.captureStackTrace(this,_);else{var $=Error();if($.stack){var x=$.stack,T=_.name,P=x.indexOf(\`
15439
15239
  \`+T);if(P>=0){var D=x.indexOf(\`
15440
- \`,P+1);x=x.substring(D+1)}this.stack=x}}},r.inherits(l.AssertionError,Error),l.fail=p,l.ok=m,l.equal=function(g,_,$){g!=_&&p(g,_,$,"==",l.equal)},l.notEqual=function(g,_,$){g==_&&p(g,_,$,"!=",l.notEqual)},l.deepEqual=function(g,_,$){d(g,_)||p(g,_,$,"deepEqual",l.deepEqual)},l.notDeepEqual=function(g,_,$){d(g,_)&&p(g,_,$,"notDeepEqual",l.notDeepEqual)},l.strictEqual=function(g,_,$){g!==_&&p(g,_,$,"===",l.strictEqual)},l.notStrictEqual=function(g,_,$){g===_&&p(g,_,$,"!==",l.notStrictEqual)},l.throws=function(g,_,$){v.apply(this,[!0].concat(a.call(arguments)))},l.doesNotThrow=function(g,_){v.apply(this,[!1].concat(a.call(arguments)))},l.ifError=function(g){if(g)throw g};var w=Object.keys||function(g){var _=[];for(var $ in g)i.call(g,$)&&_.push($);return _}},{"util/":11}],9:[function(n,e,t){typeof Object.create=="function"?e.exports=function(r,a){r.super_=a,r.prototype=Object.create(a.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(r,a){r.super_=a;var i=function(){};i.prototype=a.prototype,r.prototype=new i,r.prototype.constructor=r}},{}],10:[function(n,e,t){e.exports=function(r){return r&&typeof r=="object"&&typeof r.copy=="function"&&typeof r.fill=="function"&&typeof r.readUInt8=="function"}},{}],11:[function(n,e,t){(function(r,a){var i,l=/%[sdj%]/g;t.format=function(k){if(!P(k)){for(var O=[],N=0;N<arguments.length;N++)O.push(u(arguments[N]));return O.join(" ")}for(var N=1,K=arguments,se=K.length,te=String(k).replace(l,function(re){if(re==="%%")return"%";if(N>=se)return re;switch(re){case"%s":return String(K[N++]);case"%d":return Number(K[N++]);case"%j":try{return JSON.stringify(K[N++])}catch{return"[Circular]"}default:return re}}),J=K[N];N<se;J=K[++N])$(J)||!F(J)?te+=" "+J:te+=" "+u(J);return te},t.deprecate=function(k,O){if(R(a.process))return function(){return t.deprecate(k,O).apply(this,arguments)};if(r.noDeprecation===!0)return k;var N=!1;return function(){if(!N){if(r.throwDeprecation)throw Error(O);r.traceDeprecation?console.trace(O):console.error(O),N=!0}return k.apply(this,arguments)}};var s={};function u(k,O){var N={seen:[],stylize:p};return arguments.length>=3&&(N.depth=arguments[2]),arguments.length>=4&&(N.colors=arguments[3]),_(O)?N.showHidden=O:O&&t._extend(N,O),R(N.showHidden)&&(N.showHidden=!1),R(N.depth)&&(N.depth=2),R(N.colors)&&(N.colors=!1),R(N.customInspect)&&(N.customInspect=!0),N.colors&&(N.stylize=o),d(N,k,N.depth)}function o(k,O){var N=u.styles[O];return N?"\\x1B["+u.colors[N][0]+"m"+k+"\\x1B["+u.colors[N][1]+"m":k}function p(k,O){return k}function m(k){var O={};return k.forEach(function(N,K){O[N]=!0}),O}function d(k,O,N){if(k.customInspect&&O&&V(O.inspect)&&O.inspect!==t.inspect&&!(O.constructor&&O.constructor.prototype===O)){var K,se=O.inspect(N,k);return P(se)||(se=d(k,se,N)),se}var te=y(k,O);if(te)return te;var J=Object.keys(O),ce=m(J);if(k.showHidden&&(J=Object.getOwnPropertyNames(O)),B(O)&&(J.indexOf("message")>=0||J.indexOf("description")>=0))return f(O);if(J.length===0){if(V(O)){var re=O.name?": "+O.name:"";return k.stylize("[Function"+re+"]","special")}if(I(O))return k.stylize(RegExp.prototype.toString.call(O),"regexp");if(C(O))return k.stylize(Date.prototype.toString.call(O),"date");if(B(O))return f(O)}var fe="",ke=!1,Ae=["{","}"];return g(O)&&(ke=!0,Ae=["[","]"]),V(O)&&(fe=" [Function"+(O.name?": "+O.name:"")+"]"),I(O)&&(fe=" "+RegExp.prototype.toString.call(O)),C(O)&&(fe=" "+Date.prototype.toUTCString.call(O)),B(O)&&(fe=" "+f(O)),J.length!==0||ke&&O.length!=0?N<0?I(O)?k.stylize(RegExp.prototype.toString.call(O),"regexp"):k.stylize("[Object]","special"):(k.seen.push(O),K=ke?S(k,O,N,ce,J):J.map(function(Sr){return v(k,O,N,ce,Sr,ke)}),k.seen.pop(),w(K,fe,Ae)):Ae[0]+fe+Ae[1]}function y(k,O){if(R(O))return k.stylize("undefined","undefined");if(P(O)){var N="'"+JSON.stringify(O).replace(/^"|"$/g,"").replace(/'/g,"\\\\'").replace(/\\\\"/g,'"')+"'";return k.stylize(N,"string")}return T(O)?k.stylize(""+O,"number"):_(O)?k.stylize(""+O,"boolean"):$(O)?k.stylize("null","null"):void 0}function f(k){return"["+Error.prototype.toString.call(k)+"]"}function S(k,O,N,K,se){for(var te=[],J=0,ce=O.length;J<ce;++J)ee(O,String(J))?te.push(v(k,O,N,K,String(J),!0)):te.push("");return se.forEach(function(re){re.match(/^\\d+$/)||te.push(v(k,O,N,K,re,!0))}),te}function v(k,O,N,K,se,te){var J,ce,re;if((re=Object.getOwnPropertyDescriptor(O,se)||{value:O[se]}).get?ce=re.set?k.stylize("[Getter/Setter]","special"):k.stylize("[Getter]","special"):re.set&&(ce=k.stylize("[Setter]","special")),ee(K,se)||(J="["+se+"]"),!ce&&(0>k.seen.indexOf(re.value)?(ce=$(N)?d(k,re.value,null):d(k,re.value,N-1)).indexOf(\`
15240
+ \`,P+1);x=x.substring(D+1)}this.stack=x}}},r.inherits(l.AssertionError,Error),l.fail=p,l.ok=m,l.equal=function(g,_,$){g!=_&&p(g,_,$,"==",l.equal)},l.notEqual=function(g,_,$){g==_&&p(g,_,$,"!=",l.notEqual)},l.deepEqual=function(g,_,$){d(g,_)||p(g,_,$,"deepEqual",l.deepEqual)},l.notDeepEqual=function(g,_,$){d(g,_)&&p(g,_,$,"notDeepEqual",l.notDeepEqual)},l.strictEqual=function(g,_,$){g!==_&&p(g,_,$,"===",l.strictEqual)},l.notStrictEqual=function(g,_,$){g===_&&p(g,_,$,"!==",l.notStrictEqual)},l.throws=function(g,_,$){v.apply(this,[!0].concat(a.call(arguments)))},l.doesNotThrow=function(g,_){v.apply(this,[!1].concat(a.call(arguments)))},l.ifError=function(g){if(g)throw g};var w=Object.keys||function(g){var _=[];for(var $ in g)i.call(g,$)&&_.push($);return _}},{"util/":11}],9:[function(n,e,t){typeof Object.create=="function"?e.exports=function(r,a){r.super_=a,r.prototype=Object.create(a.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(r,a){r.super_=a;var i=function(){};i.prototype=a.prototype,r.prototype=new i,r.prototype.constructor=r}},{}],10:[function(n,e,t){e.exports=function(r){return r&&typeof r=="object"&&typeof r.copy=="function"&&typeof r.fill=="function"&&typeof r.readUInt8=="function"}},{}],11:[function(n,e,t){(function(r,a){var i,l=/%[sdj%]/g;t.format=function(k){if(!P(k)){for(var O=[],N=0;N<arguments.length;N++)O.push(u(arguments[N]));return O.join(" ")}for(var N=1,K=arguments,se=K.length,te=String(k).replace(l,function(re){if(re==="%%")return"%";if(N>=se)return re;switch(re){case"%s":return String(K[N++]);case"%d":return Number(K[N++]);case"%j":try{return JSON.stringify(K[N++])}catch{return"[Circular]"}default:return re}}),J=K[N];N<se;J=K[++N])$(J)||!F(J)?te+=" "+J:te+=" "+u(J);return te},t.deprecate=function(k,O){if(R(a.process))return function(){return t.deprecate(k,O).apply(this,arguments)};if(r.noDeprecation===!0)return k;var N=!1;return function(){if(!N){if(r.throwDeprecation)throw Error(O);r.traceDeprecation?console.trace(O):console.error(O),N=!0}return k.apply(this,arguments)}};var s={};function u(k,O){var N={seen:[],stylize:p};return arguments.length>=3&&(N.depth=arguments[2]),arguments.length>=4&&(N.colors=arguments[3]),_(O)?N.showHidden=O:O&&t._extend(N,O),R(N.showHidden)&&(N.showHidden=!1),R(N.depth)&&(N.depth=2),R(N.colors)&&(N.colors=!1),R(N.customInspect)&&(N.customInspect=!0),N.colors&&(N.stylize=o),d(N,k,N.depth)}function o(k,O){var N=u.styles[O];return N?"\\x1B["+u.colors[N][0]+"m"+k+"\\x1B["+u.colors[N][1]+"m":k}function p(k,O){return k}function m(k){var O={};return k.forEach(function(N,K){O[N]=!0}),O}function d(k,O,N){if(k.customInspect&&O&&V(O.inspect)&&O.inspect!==t.inspect&&!(O.constructor&&O.constructor.prototype===O)){var K,se=O.inspect(N,k);return P(se)||(se=d(k,se,N)),se}var te=y(k,O);if(te)return te;var J=Object.keys(O),ce=m(J);if(k.showHidden&&(J=Object.getOwnPropertyNames(O)),B(O)&&(J.indexOf("message")>=0||J.indexOf("description")>=0))return f(O);if(J.length===0){if(V(O)){var re=O.name?": "+O.name:"";return k.stylize("[Function"+re+"]","special")}if(I(O))return k.stylize(RegExp.prototype.toString.call(O),"regexp");if(C(O))return k.stylize(Date.prototype.toString.call(O),"date");if(B(O))return f(O)}var fe="",Ae=!1,Ie=["{","}"];return g(O)&&(Ae=!0,Ie=["[","]"]),V(O)&&(fe=" [Function"+(O.name?": "+O.name:"")+"]"),I(O)&&(fe=" "+RegExp.prototype.toString.call(O)),C(O)&&(fe=" "+Date.prototype.toUTCString.call(O)),B(O)&&(fe=" "+f(O)),J.length!==0||Ae&&O.length!=0?N<0?I(O)?k.stylize(RegExp.prototype.toString.call(O),"regexp"):k.stylize("[Object]","special"):(k.seen.push(O),K=Ae?S(k,O,N,ce,J):J.map(function(Er){return v(k,O,N,ce,Er,Ae)}),k.seen.pop(),w(K,fe,Ie)):Ie[0]+fe+Ie[1]}function y(k,O){if(R(O))return k.stylize("undefined","undefined");if(P(O)){var N="'"+JSON.stringify(O).replace(/^"|"$/g,"").replace(/'/g,"\\\\'").replace(/\\\\"/g,'"')+"'";return k.stylize(N,"string")}return T(O)?k.stylize(""+O,"number"):_(O)?k.stylize(""+O,"boolean"):$(O)?k.stylize("null","null"):void 0}function f(k){return"["+Error.prototype.toString.call(k)+"]"}function S(k,O,N,K,se){for(var te=[],J=0,ce=O.length;J<ce;++J)ee(O,String(J))?te.push(v(k,O,N,K,String(J),!0)):te.push("");return se.forEach(function(re){re.match(/^\\d+$/)||te.push(v(k,O,N,K,re,!0))}),te}function v(k,O,N,K,se,te){var J,ce,re;if((re=Object.getOwnPropertyDescriptor(O,se)||{value:O[se]}).get?ce=re.set?k.stylize("[Getter/Setter]","special"):k.stylize("[Getter]","special"):re.set&&(ce=k.stylize("[Setter]","special")),ee(K,se)||(J="["+se+"]"),!ce&&(0>k.seen.indexOf(re.value)?(ce=$(N)?d(k,re.value,null):d(k,re.value,N-1)).indexOf(\`
15441
15241
  \`)>-1&&(ce=te?ce.split(\`
15442
15242
  \`).map(function(fe){return" "+fe}).join(\`
15443
15243
  \`).substr(2):\`
@@ -15446,7 +15246,7 @@ Expecting \`+ve.join(", ")+", got '"+(this.terminals_[R]||R)+"'":"Parse error on
15446
15246
  \`)):ce=k.stylize("[Circular]","special")),R(J)){if(te&&se.match(/^\\d+$/))return ce;(J=JSON.stringify(""+se)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(J=J.substr(1,J.length-2),J=k.stylize(J,"name")):(J=J.replace(/'/g,"\\\\'").replace(/\\\\"/g,'"').replace(/(^"|"$)/g,"'"),J=k.stylize(J,"string"))}return J+": "+ce}function w(k,O,N){var K=0;return k.reduce(function(se,te){return K++,te.indexOf(\`
15447
15247
  \`)>=0&&K++,se+te.replace(/\\u001b\\[\\d\\d?m/g,"").length+1},0)>60?N[0]+(O===""?"":O+\`
15448
15248
  \`)+" "+k.join(\`,
15449
- \`)+" "+N[1]:N[0]+O+" "+k.join(", ")+" "+N[1]}function g(k){return Array.isArray(k)}function _(k){return typeof k=="boolean"}function $(k){return k===null}function x(k){return k==null}function T(k){return typeof k=="number"}function P(k){return typeof k=="string"}function D(k){return typeof k=="symbol"}function R(k){return k===void 0}function I(k){return F(k)&&le(k)==="[object RegExp]"}function F(k){return typeof k=="object"&&k!==null}function C(k){return F(k)&&le(k)==="[object Date]"}function B(k){return F(k)&&(le(k)==="[object Error]"||k instanceof Error)}function V(k){return typeof k=="function"}function X(k){return k===null||typeof k=="boolean"||typeof k=="number"||typeof k=="string"||typeof k=="symbol"||k===void 0}function le(k){return Object.prototype.toString.call(k)}function ve(k){return k<10?"0"+k.toString(10):k.toString(10)}t.debuglog=function(k){if(R(i)&&(i=r.env.NODE_DEBUG||""),!s[k=k.toUpperCase()])if(RegExp("\\\\b"+k+"\\\\b","i").test(i)){var O=r.pid;s[k]=function(){var N=t.format.apply(t,arguments);console.error("%s %d: %s",k,O,N)}}else s[k]=function(){};return s[k]},t.inspect=u,u.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},u.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.isArray=g,t.isBoolean=_,t.isNull=$,t.isNullOrUndefined=x,t.isNumber=T,t.isString=P,t.isSymbol=D,t.isUndefined=R,t.isRegExp=I,t.isObject=F,t.isDate=C,t.isError=B,t.isFunction=V,t.isPrimitive=X,t.isBuffer=n("./support/isBuffer");var H=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function ie(){var k=new Date,O=[ve(k.getHours()),ve(k.getMinutes()),ve(k.getSeconds())].join(":");return[k.getDate(),H[k.getMonth()],O].join(" ")}function ee(k,O){return Object.prototype.hasOwnProperty.call(k,O)}t.log=function(){console.log("%s - %s",ie(),t.format.apply(t,arguments))},t.inherits=n("inherits"),t._extend=function(k,O){if(!O||!F(O))return k;for(var N=Object.keys(O),K=N.length;K--;)k[N[K]]=O[N[K]];return k}}).call(this,n("_process"),oe!==void 0?oe:typeof self<"u"?self:typeof window<"u"?window:{})},{"./support/isBuffer":10,_process:14,inherits:9}],12:[function(n,e,t){},{}],13:[function(n,e,t){(function(r){function a(u,o){for(var p=0,m=u.length-1;m>=0;m--){var d=u[m];d==="."?u.splice(m,1):d===".."?(u.splice(m,1),p++):p&&(u.splice(m,1),p--)}if(o)for(;p--;p)u.unshift("..");return u}function i(u){typeof u!="string"&&(u+="");var o,p=0,m=-1,d=!0;for(o=u.length-1;o>=0;--o)if(u.charCodeAt(o)===47){if(!d){p=o+1;break}}else m===-1&&(d=!1,m=o+1);return m===-1?"":u.slice(p,m)}function l(u,o){if(u.filter)return u.filter(o);for(var p=[],m=0;m<u.length;m++)o(u[m],m,u)&&p.push(u[m]);return p}t.resolve=function(){for(var u="",o=!1,p=arguments.length-1;p>=-1&&!o;p--){var m=p>=0?arguments[p]:r.cwd();if(typeof m!="string")throw TypeError("Arguments to path.resolve must be strings");m&&(u=m+"/"+u,o=m.charAt(0)==="/")}return u=a(l(u.split("/"),function(d){return!!d}),!o).join("/"),(o?"/":"")+u||"."},t.normalize=function(u){var o=t.isAbsolute(u),p=s(u,-1)==="/";return(u=a(l(u.split("/"),function(m){return!!m}),!o).join("/"))||o||(u="."),u&&p&&(u+="/"),(o?"/":"")+u},t.isAbsolute=function(u){return u.charAt(0)==="/"},t.join=function(){var u=Array.prototype.slice.call(arguments,0);return t.normalize(l(u,function(o,p){if(typeof o!="string")throw TypeError("Arguments to path.join must be strings");return o}).join("/"))},t.relative=function(u,o){function p(w){for(var g=0;g<w.length&&w[g]==="";g++);for(var _=w.length-1;_>=0&&w[_]==="";_--);return g>_?[]:w.slice(g,_-g+1)}u=t.resolve(u).substr(1),o=t.resolve(o).substr(1);for(var m=p(u.split("/")),d=p(o.split("/")),y=Math.min(m.length,d.length),f=y,S=0;S<y;S++)if(m[S]!==d[S]){f=S;break}for(var v=[],S=f;S<m.length;S++)v.push("..");return(v=v.concat(d.slice(f))).join("/")},t.sep="/",t.delimiter=":",t.dirname=function(u){if(typeof u!="string"&&(u+=""),u.length===0)return".";for(var o=u.charCodeAt(0),p=o===47,m=-1,d=!0,y=u.length-1;y>=1;--y)if((o=u.charCodeAt(y))===47){if(!d){m=y;break}}else d=!1;return m===-1?p?"/":".":p&&m===1?"/":u.slice(0,m)},t.basename=function(u,o){var p=i(u);return o&&p.substr(-1*o.length)===o&&(p=p.substr(0,p.length-o.length)),p},t.extname=function(u){typeof u!="string"&&(u+="");for(var o=-1,p=0,m=-1,d=!0,y=0,f=u.length-1;f>=0;--f){var S=u.charCodeAt(f);if(S===47){if(!d){p=f+1;break}continue}m===-1&&(d=!1,m=f+1),S===46?o===-1?o=f:y!==1&&(y=1):o!==-1&&(y=-1)}return o===-1||m===-1||y===0||y===1&&o===m-1&&o===p+1?"":u.slice(o,m)};var s="ab".substr(-1)==="b"?function(u,o,p){return u.substr(o,p)}:function(u,o,p){return o<0&&(o=u.length+o),u.substr(o,p)}}).call(this,n("_process"))},{_process:14}],14:[function(n,e,t){var r,a,i,l=e.exports={};function s(){throw Error("setTimeout has not been defined")}function u(){throw Error("clearTimeout has not been defined")}function o(g){if(r===setTimeout)return setTimeout(g,0);if((r===s||!r)&&setTimeout)return r=setTimeout,setTimeout(g,0);try{return r(g,0)}catch{try{return r.call(null,g,0)}catch{return r.call(this,g,0)}}}function p(g){if(a===clearTimeout)return clearTimeout(g);if((a===u||!a)&&clearTimeout)return a=clearTimeout,clearTimeout(g);try{return a(g)}catch{try{return a.call(null,g)}catch{return a.call(this,g)}}}(function(){try{r=typeof setTimeout=="function"?setTimeout:s}catch{r=s}try{a=typeof clearTimeout=="function"?clearTimeout:u}catch{a=u}})();var m=[],d=!1,y=-1;function f(){d&&i&&(d=!1,i.length?m=i.concat(m):y=-1,m.length&&S())}function S(){if(!d){var g=o(f);d=!0;for(var _=m.length;_;){for(i=m,m=[];++y<_;)i&&i[y].run();y=-1,_=m.length}i=null,d=!1,p(g)}}function v(g,_){this.fun=g,this.array=_}function w(){}l.nextTick=function(g){var _=Array(arguments.length-1);if(arguments.length>1)for(var $=1;$<arguments.length;$++)_[$-1]=arguments[$];m.push(new v(g,_)),m.length!==1||d||o(S)},v.prototype.run=function(){this.fun.apply(null,this.array)},l.title="browser",l.browser=!0,l.env={},l.argv=[],l.version="",l.versions={},l.on=w,l.addListener=w,l.once=w,l.off=w,l.removeListener=w,l.removeAllListeners=w,l.emit=w,l.prependListener=w,l.prependOnceListener=w,l.listeners=function(g){return[]},l.binding=function(g){throw Error("process.binding is not supported")},l.cwd=function(){return"/"},l.chdir=function(g){throw Error("process.chdir is not supported")},l.umask=function(){return 0}},{}],15:[function(n,e,t){var r=n("escodegen").generate;e.exports=function(a,i){i||(i={});var l={},s=function u(o,p){if(o.type==="Literal")return o.value;if(o.type==="UnaryExpression"){var m=u(o.argument);return o.operator==="+"?+m:o.operator==="-"?-m:o.operator==="~"?~m:o.operator==="!"?!m:l}if(o.type==="ArrayExpression"){for(var d=[],y=0,f=o.elements.length;y<f;y++){var S=u(o.elements[y]);if(S===l)return l;d.push(S)}return d}if(o.type==="ObjectExpression"){for(var v={},y=0;y<o.properties.length;y++){var w=o.properties[y],g=w.value===null?w.value:u(w.value);if(g===l)return l;v[w.key.value||w.key.name]=g}return v}if(o.type==="BinaryExpression"||o.type==="LogicalExpression"){var f=u(o.left);if(f===l)return l;var _=u(o.right);if(_===l)return l;var $=o.operator;return $==="=="?f==_:$==="==="?f===_:$==="!="?f!=_:$==="!=="?f!==_:$==="+"?f+_:$==="-"?f-_:$==="*"?f*_:$==="/"?f/_:$==="%"?f%_:$==="<"?f<_:$==="<="?f<=_:$===">"?f>_:$===">="?f>=_:$==="|"?f|_:$==="&"?f&_:$==="^"?f^_:$==="&&"?f&&_:$==="||"?f||_:l}if(o.type==="Identifier")return{}.hasOwnProperty.call(i,o.name)?i[o.name]:l;if(o.type==="ThisExpression")return{}.hasOwnProperty.call(i,"this")?i.this:l;if(o.type==="CallExpression"){var x=u(o.callee);if(x===l||typeof x!="function")return l;var T=o.callee.object?u(o.callee.object):l;T===l&&(T=null);for(var P=[],y=0,f=o.arguments.length;y<f;y++){var S=u(o.arguments[y]);if(S===l)return l;P.push(S)}return x.apply(T,P)}else if(o.type==="MemberExpression"){var v=u(o.object);if(v===l||typeof v=="function")return l;if(o.property.type==="Identifier")return v[o.property.name];var w=u(o.property);return w===l?l:v[w]}else if(o.type==="ConditionalExpression"){var m=u(o.test);return m===l?l:u(m?o.consequent:o.alternate)}else if(o.type==="ExpressionStatement"){var m=u(o.expression);return m===l?l:m}else{if(o.type==="ReturnStatement")return u(o.argument);if(o.type==="FunctionExpression"){var D=o.body.body,R={};Object.keys(i).forEach(function(H){R[H]=i[H]});for(var y=0;y<o.params.length;y++){var I=o.params[y];if(I.type!="Identifier")return l;i[I.name]=null}for(var y in D)if(u(D[y])===l)return l;var F=Object.keys(i=R),C=F.map(function(H){return i[H]});return Function(F.join(", "),"return "+r(o)).apply(null,C)}else if(o.type==="TemplateLiteral"){for(var B="",y=0;y<o.expressions.length;y++)B+=u(o.quasis[y]),B+=u(o.expressions[y]);return B+u(o.quasis[y])}else if(o.type==="TaggedTemplateExpression"){var V=u(o.tag),X=o.quasi,le=X.quasis.map(u),ve=X.expressions.map(u);return V.apply(null,[le].concat(ve))}else return o.type==="TemplateElement"?o.value.cooked:l}}(a);return s===l?void 0:s}},{escodegen:12}],jsonpath:[function(n,e,t){e.exports=n("./lib/index")},{"./lib/index":5}]},{},["jsonpath"])("jsonpath")});class Bs{constructor(e){this._itemsMap={},e.forEach((t,r)=>{this._itemsMap[t.item_id]=r})}pullItemIndex(e){let t=this._itemsMap[e];return delete this._itemsMap[e],t}getItemIndex(e){return this._itemsMap[e]}get itemsMap(){return this._itemsMap}}function Us(n,e){let t,r=[];n?t=n.split(","):r=e;let a=new Set;function i(l){let s=!a.has(l);return s&&a.add(l),s}return n&&e.forEach(l=>{let s="";t.forEach((u,o)=>{let p=l.fields.find(m=>m.field_id==u);p&&(s+=p.field_value),t.length-1==o&&i(s)&&r.push(l)})}),r}function Gs(n,e,t){var r=JSON.parse(JSON.stringify(n));return t?Ws(r,e):Hs(r,e)}function Ws(n,e){return n.forEach(t=>{e.forEach(r=>{let a=t.fields.find(i=>i.element_id==r.element_id);a?a.field_value=r.field_value:(r.field_id=r.element_id,t.fields.push(r))})}),n}function Hs(n,e){return n.forEach(t=>{t.fields=[].concat(e)}),n}var Z={},dt=A("f3Ywx"),et=dt.default;Object.defineProperty(Z,"__esModule",{value:!0}),Z.default=Xs;var zs=et(A("5ZWAZ")),Vs=et(A("fgq5y")),Js=et(A("byyO9")),Ys=et(A("glRwo")),Qs=et(A("ayR3G")),Ye=et(A("a9VQw"));function Xs(n,e){if((0,Qs.default)(2,arguments),!e||(0,zs.default)(e)!=="object")return new Date(NaN);var t=e.years?(0,Ye.default)(e.years):0,r=e.months?(0,Ye.default)(e.months):0,a=e.weeks?(0,Ye.default)(e.weeks):0,i=e.days?(0,Ye.default)(e.days):0,l=e.hours?(0,Ye.default)(e.hours):0,s=e.minutes?(0,Ye.default)(e.minutes):0,u=e.seconds?(0,Ye.default)(e.seconds):0,o=(0,Ys.default)(n),p=r||t?(0,Js.default)(o,r+12*t):o,m=i||a?(0,Vs.default)(p,i+7*a):p,d=1e3*(u+60*(s+60*l));return new Date(m.getTime()+d)}Z=Z.default;var xe={},dt=A("f3Ywx"),Ct=dt.default;Object.defineProperty(xe,"__esModule",{value:!0}),xe.default=ro;var Ks=Ct(A("fgq5y")),Zs=Ct(A("glRwo")),Dn=Ct(A("a9VQw")),eo=Ct(A("ayR3G")),to=A("lmyOi");function ro(n,e,t){(0,eo.default)(2,arguments);var r,a,i,l,s,u,o,p,m=(0,to.getDefaultOptions)(),d=(0,Dn.default)((r=(a=(i=(l=t==null?void 0:t.weekStartsOn)!==null&&l!==void 0?l:t==null||(s=t.locale)===null||s===void 0||(u=s.options)===null||u===void 0?void 0:u.weekStartsOn)!==null&&i!==void 0?i:m.weekStartsOn)!==null&&a!==void 0?a:(o=m.locale)===null||o===void 0||(p=o.options)===null||p===void 0?void 0:p.weekStartsOn)!==null&&r!==void 0?r:0);if(!(d>=0&&d<=6))throw RangeError("weekStartsOn must be between 0 and 6 inclusively");var y=(0,Zs.default)(n),f=(0,Dn.default)(e),S=y.getDay(),v=(f%7+7)%7,w=7-d,g=f<0||f>6?f-(S+w)%7:(v+w)%7-(S+w)%7;return(0,Ks.default)(y,g)}xe=xe.default;var pt={},dt=A("f3Ywx"),qn=dt.default;Object.defineProperty(pt,"__esModule",{value:!0}),pt.default=ao;var Bn=qn(A("hLz6R")),no=qn(A("ayR3G"));function ao(n,e,t){(0,no.default)(2,arguments);var r=(0,Bn.default)(n,t),a=(0,Bn.default)(e,t);return r.getTime()===a.getTime()}function io(n,e){return n.forEach(t=>{e.forEach(r=>{let a=t.fields.find(i=>i.element_id==r.element_id);a?r.data_range?(r.date_type.includes("calendar"),a.field_value=\`\${so(r.date_type)}:\${Nt(r.date_type)}\`):a.field_value=Nt(r.date_type):t.fields.push({field_id:r.element_id,element_id:r.element_id,field_value:Nt(r.date_type)})})}),n}function so(n){let e=new Date;function t(a){let i;var l=a.getDay();n.includes("week_current,current")&&(i=0),n.includes("week_next,future")&&(i=7),n.includes("week_past,past")&&(i=-7);let s=a.getDate()-l+i+(l==0?-6:1);return new Date(a.setDate(s))}function r(a){let i,l,s=Math.floor(a.getMonth()/3),u=a.getFullYear();return n.includes("quarter_current,current")&&(i=0,l=0),n.includes("quarter_next,future")&&(i=3,l=0),n.includes("quarter_past,past")&&(i=-3,l=0),new Date(u,3*s+i,1+l)}switch(n){case"week_current,current":case"week_next,future":case"week_past,past":return t(new Date).getTime();case"month_current,current":return new Date(e.getFullYear(),e.getMonth(),1).getTime();case"quarter_current,current":case"quarter_next,future":case"quarter_past,past":return r(new Date).getTime();case"year_current,current":return G(Z)(new Date(e.getFullYear(),0,1),{years:0}).getTime();case"month_next,future":return new Date(e.getFullYear(),e.getMonth()+1,1).getTime();case"year_next,future":case"today_current,current":case"7_days_future,future":case"10_days_future,future":case"14_days_future,future":case"30_days_future,future":return G(Z)(e,{days:0}).getTime();case"month_past,past":return new Date(e.getFullYear(),e.getMonth()-1,1).getTime();case"year_past,past":return G(Z)(e,{years:-1}).getTime();case"year_past,past,calendar":return G(Z)(new Date(e.getFullYear(),0,1),{years:-1}).getTime();case"year_future,future,calendar":return G(Z)(new Date(e.getFullYear()+1,0,1),{years:0}).getTime();case"tomorrow,future":return G(Z)(e,{days:1}).getTime();case"yesterday,past":return G(Z)(e,{days:-1}).getTime();case"7_days_past,past":return G(Z)(e,{days:-7}).getTime();case"10_days_past,past":return G(Z)(e,{days:-10}).getTime();case"14_days_past,past":return G(Z)(e,{days:-14}).getTime();case"30_days_past,past":return G(Z)(e,{days:-30}).getTime()}}function Nt(n){var e=new Date;function t(s){var u=(s=new Date(s)).getDay(),o=s.getDate()-u+6+(u==0?6:1);return new Date(s.setDate(o))}function r(s){var u=(s=new Date(s)).getDay(),o=s.getDate()-u+13+(u==0?-6:1);return new Date(s.setDate(o))}function a(s){var u=(s=new Date(s)).getDay(),o=s.getDate()-u-1+(u==0?-6:1);return new Date(s.setDate(o))}let i=Math.floor(e.getMonth()/3),l=e.getFullYear();switch(n){case"next_day":case"tomorrow,future":return G(Z)(e,{days:1}).getTime();case"two_days_after":return G(Z)(e,{days:2}).getTime();case"three_days_after":return G(Z)(e,{days:3}).getTime();case"four_days_after":return G(Z)(e,{days:4}).getTime();case"next_week":return G(Z)(e,{weeks:1}).getTime();case"two_weeks_after":return G(Z)(e,{weeks:2}).getTime();case"three_weeks_after":return G(Z)(e,{weeks:3}).getTime();case"this_sunday":return G(xe)(e,0,{weekStartsOn:1});case"this_monday":return G(xe)(e,1,{weekStartsOn:1});case"this_tuesday":return G(xe)(e,2,{weekStartsOn:1});case"this_wednesday":return G(xe)(e,3,{weekStartsOn:1});case"this_thursday":return G(xe)(e,4,{weekStartsOn:1});case"this_friday":return G(xe)(e,5,{weekStartsOn:1});case"this_saturday":return G(xe)(e,6,{weekStartsOn:1});case"today_current,current":case"7_days_past,past":case"10_days_past,past":case"14_days_past,past":case"30_days_past,past":case"year_past,past":return G(Z)(e,{days:0}).getTime();case"7_days_future,future":return G(Z)(e,{days:7}).getTime();case"10_days_future,future":return G(Z)(e,{days:10}).getTime();case"14_days_future,future":return G(Z)(e,{days:14}).getTime();case"30_days_future,future":return G(Z)(e,{days:30}).getTime();case"yesterday,past":return G(Z)(e,{days:-1}).getTime();case"year_future,future,calendar":return G(Z)(new Date(e.getFullYear()+1,0,0),{years:1}).getTime();case"year_past,past,calendar":return G(Z)(new Date(e.getFullYear(),0,0),{years:0}).getTime();case"week_current,current":return t(new Date).getTime();case"month_current,current":return new Date(e.getFullYear(),e.getMonth()+1,0).getTime();case"quarter_current,current":return new Date(l,(i+1)*3,0).getTime();case"year_current,current":return G(Z)(new Date(e.getFullYear()+1,0,0),{years:0}).getTime();case"week_next,future":return r(new Date).getTime();case"month_next,future":return new Date(e.getFullYear(),e.getMonth()+2,0).getTime();case"quarter_next,future":return new Date(l,(i+1)*3+3,0).getTime();case"year_next,future":return G(Z)(e,{years:1}).getTime();case"week_past,past":return a(new Date).getTime();case"month_past,past":return new Date(e.getFullYear(),e.getMonth(),0,0).getTime();case"quarter_past,past":return new Date(l,(i+1)*3-3,0).getTime();default:return e.getTime()}}function oo(n,e){n=new Date(n);let t=new Date;switch(e){case"day":return n.getDate()+"."+n.getMonth()==t.getDate()+"."+t.getMonth();case"week":let r=new Date(new Date().getFullYear(),n.getMonth(),n.getDate());return G(pt)(r,t);case"month":return n.getMonth()===t.getMonth();default:return!0}}function lo(n,e,t){return tt(n,e,t)}function Mt(n){return n&&typeof n=="object"&&Object.prototype.toString.call(n)!=="[object RegExp]"&&Object.prototype.toString.call(n)!=="[object Date]"}function co(n){return Array.isArray(n)?[]:{}}function ft(n,e){return e&&e.clone===!0&&Mt(n)?tt(co(n),n,e):n}function Un(n,e,t){var r=n.slice();return e.forEach(function(a,i){r[i]===void 0?r[i]=ft(a,t):Mt(a)?r[i]=tt(n[i],a,t):n.indexOf(a)===-1&&r.push(ft(a,t))}),r}function uo(n,e,t){var r={};return Mt(n)&&Object.keys(n).forEach(function(a){r[a]=ft(n[a],t)}),Object.keys(e).forEach(function(a){Mt(e[a])&&n[a]?r[a]=tt(n[a],e[a],t):r[a]=ft(e[a],t)}),r}function tt(n,e,t){n=n!==void 0?n:{};var r=Array.isArray(e=e!==void 0?e:{}),a=(t||{arrayMerge:Un}).arrayMerge||Un;return r?Array.isArray(n)?a(n,e,t):ft(e,t):uo(n,e,t)}function Gn(n){let e={};return n.forEach(t=>{t.items_list.forEach(r=>{let a=e[r.item_id];return a?(a.trash=r.trash,r.fields.forEach(i=>{let l=!0;a.fields=a.fields.map(s=>Number(s.field_id)===Number(i.field_id)&&(l=!1,s.field_value!=i.field_value)?{...i,history:i.history.concat(s.history)}:s),l&&a.fields.push(i)})):e[r.item_id]=r})}),Object.values(e)}function po(n){return Gn(n)}function fo(n,e,t,r,a){let i,l=JSON.parse(JSON.stringify(n)),s=r||"children",u=!!a&&a;for(i=0;i<l.length;i++)l[i][t]&&l[i][t]!==0&&l.forEach(m=>{l[i][t]==m[e]?(m[s]||(m[s]=[]),m[s].push(l[i]),l.splice(i,1),i==0?i=0:i--):m[s]&&o(m)});function o(m){m[s].forEach(d=>{d[e]==l[i][t]?(d[s]||(d[s]=[]),d[s].push(l[i]),l.splice(i,1),i==0?i=0:i--):d[s]&&o(d)})}function p(m){m.sort((d,y)=>d[u]-y[u]),m.forEach(d=>{d[s]&&p(d[s])})}return u&&p(l),l}pt=pt.default,tt.all=function(n,e){if(!Array.isArray(n)||n.length<2)throw Error("first argument should be an array with at least two elements");return n.reduce(function(t,r){return tt(t,r,e)})},self.onmessage=function(n){let e=Gn(n.data);self.postMessage(e)};class ho{constructor(e){this.gudhub=e}mergeFieldLists(e,t){let r=JSON.parse(JSON.stringify(e)),a=JSON.parse(JSON.stringify(t)),i=a.map(l=>l.field_id);return a.length?a.reduce((l,s)=>{let u=null;if(l.find((o,p)=>s.field_id==o.field_id&&(u=p,!0)))l[u]=this.gudhub.util.mergeObjects(l[u],s);else{let o=s.data_model&&s.data_model.interpretation&&s.data_model.interpretation.find(p=>p.src=="table")||{settings:{show_field:1}};if(o.settings.show_field){let p=this.gudhub.util.mergeObjects({show:1},o),m=this.gudhub.util.mergeObjects(p,s);l.push(m)}}return l},r).filter(function(l){return l.show&&i.indexOf(l.field_id)!=-1}):[]}createFieldsListToView(e,t){let r=this;return new Promise(async a=>{let i=await this.gudhub.getFieldModels(e);if(t.length!==0){let s=[];t.forEach((u,o)=>{let p=i.find(m=>u.field_id==m.field_id);p&&(p.data_model.interpretation.find(m=>m.src=="table"),s.push({field_id:p.field_id,show:u.show,width:u.width?u.width:"150px"})),o+1==t.length&&l(s)})}else l(t);function l(s){let u=0;i.forEach((o,p)=>{s.find(m=>o.field_id==m.field_id)?(u==i.length-1&&a(s),u++):r.gudhub.ghconstructor.getInstance(o.data_type).then(m=>{if(m){let d=m.getTemplate().model.data_model.interpretation.find(y=>y.src=="table");d||(d={settings:{show_field:1}}),s.push({field_id:o.field_id,show:d.settings.show_field}),u==i.length-1&&a(s)}u++},function(m){u++})})}})}createFieldsListToViewWithDataType(e,t){return new Promise(async r=>{let a=[],i=await this.gudhub.getFieldModels(e),l=i.map(u=>+u.field_id),s=[];a=i.reduce((u,o)=>(u.find((p,m)=>o.field_id==p.field_id)||(u.push({field_id:o.field_id,data_type:o.data_type}),s.push(new Promise(async p=>{let m=(await this.gudhub.ghconstructor.getInstance(o.data_type)).getTemplate().model.data_model.interpretation.find(d=>d.src=="table")||{settings:{show_field:1}};u.find(d=>d.field_id==o.field_id).show=m.settings.show_field,p(!0)}))),u),t),Promise.all(s).then(()=>{r(a=a.filter(u=>l.indexOf(u.field_id)!=-1))})})}}class mo{constructor(e){this.gudhub=e,this.selectedItems={}}async selectItems(e,t){if(!this.selectedItems.hasOwnProperty(e)){this.selectedItems[e]={items:[],app:[]};let i=await this.gudhub.getApp(e);this.selectedItems[e].app=i}let r=this.selectedItems[e],a=r.items.map(i=>i.item_id);t.forEach(i=>{a.indexOf(i.item_id)!=-1?r.items.splice(a.indexOf(i.item_id),1):r.items[r.items.length]=i})}getSelectedItems(e){return this.selectedItems[e]?this.selectedItems[e]:{items:[],app:[]}}clearSelectedItems(e){this.selectedItems[e]&&(this.selectedItems[e].items=[])}isItemSelected(e,t){let r=this.getSelectedItems(e);return r!==null&&(r=r.items.map(a=>a.item_id)).indexOf(t)!=-1}}function go(){return\`function createList(items) {
15249
+ \`)+" "+N[1]:N[0]+O+" "+k.join(", ")+" "+N[1]}function g(k){return Array.isArray(k)}function _(k){return typeof k=="boolean"}function $(k){return k===null}function x(k){return k==null}function T(k){return typeof k=="number"}function P(k){return typeof k=="string"}function D(k){return typeof k=="symbol"}function R(k){return k===void 0}function I(k){return F(k)&&oe(k)==="[object RegExp]"}function F(k){return typeof k=="object"&&k!==null}function C(k){return F(k)&&oe(k)==="[object Date]"}function B(k){return F(k)&&(oe(k)==="[object Error]"||k instanceof Error)}function V(k){return typeof k=="function"}function X(k){return k===null||typeof k=="boolean"||typeof k=="number"||typeof k=="string"||typeof k=="symbol"||k===void 0}function oe(k){return Object.prototype.toString.call(k)}function we(k){return k<10?"0"+k.toString(10):k.toString(10)}t.debuglog=function(k){if(R(i)&&(i=r.env.NODE_DEBUG||""),!s[k=k.toUpperCase()])if(RegExp("\\\\b"+k+"\\\\b","i").test(i)){var O=r.pid;s[k]=function(){var N=t.format.apply(t,arguments);console.error("%s %d: %s",k,O,N)}}else s[k]=function(){};return s[k]},t.inspect=u,u.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},u.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.isArray=g,t.isBoolean=_,t.isNull=$,t.isNullOrUndefined=x,t.isNumber=T,t.isString=P,t.isSymbol=D,t.isUndefined=R,t.isRegExp=I,t.isObject=F,t.isDate=C,t.isError=B,t.isFunction=V,t.isPrimitive=X,t.isBuffer=n("./support/isBuffer");var H=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function ie(){var k=new Date,O=[we(k.getHours()),we(k.getMinutes()),we(k.getSeconds())].join(":");return[k.getDate(),H[k.getMonth()],O].join(" ")}function ee(k,O){return Object.prototype.hasOwnProperty.call(k,O)}t.log=function(){console.log("%s - %s",ie(),t.format.apply(t,arguments))},t.inherits=n("inherits"),t._extend=function(k,O){if(!O||!F(O))return k;for(var N=Object.keys(O),K=N.length;K--;)k[N[K]]=O[N[K]];return k}}).call(this,n("_process"),le!==void 0?le:typeof self<"u"?self:typeof window<"u"?window:{})},{"./support/isBuffer":10,_process:14,inherits:9}],12:[function(n,e,t){},{}],13:[function(n,e,t){(function(r){function a(u,o){for(var p=0,m=u.length-1;m>=0;m--){var d=u[m];d==="."?u.splice(m,1):d===".."?(u.splice(m,1),p++):p&&(u.splice(m,1),p--)}if(o)for(;p--;p)u.unshift("..");return u}function i(u){typeof u!="string"&&(u+="");var o,p=0,m=-1,d=!0;for(o=u.length-1;o>=0;--o)if(u.charCodeAt(o)===47){if(!d){p=o+1;break}}else m===-1&&(d=!1,m=o+1);return m===-1?"":u.slice(p,m)}function l(u,o){if(u.filter)return u.filter(o);for(var p=[],m=0;m<u.length;m++)o(u[m],m,u)&&p.push(u[m]);return p}t.resolve=function(){for(var u="",o=!1,p=arguments.length-1;p>=-1&&!o;p--){var m=p>=0?arguments[p]:r.cwd();if(typeof m!="string")throw TypeError("Arguments to path.resolve must be strings");m&&(u=m+"/"+u,o=m.charAt(0)==="/")}return u=a(l(u.split("/"),function(d){return!!d}),!o).join("/"),(o?"/":"")+u||"."},t.normalize=function(u){var o=t.isAbsolute(u),p=s(u,-1)==="/";return(u=a(l(u.split("/"),function(m){return!!m}),!o).join("/"))||o||(u="."),u&&p&&(u+="/"),(o?"/":"")+u},t.isAbsolute=function(u){return u.charAt(0)==="/"},t.join=function(){var u=Array.prototype.slice.call(arguments,0);return t.normalize(l(u,function(o,p){if(typeof o!="string")throw TypeError("Arguments to path.join must be strings");return o}).join("/"))},t.relative=function(u,o){function p(w){for(var g=0;g<w.length&&w[g]==="";g++);for(var _=w.length-1;_>=0&&w[_]==="";_--);return g>_?[]:w.slice(g,_-g+1)}u=t.resolve(u).substr(1),o=t.resolve(o).substr(1);for(var m=p(u.split("/")),d=p(o.split("/")),y=Math.min(m.length,d.length),f=y,S=0;S<y;S++)if(m[S]!==d[S]){f=S;break}for(var v=[],S=f;S<m.length;S++)v.push("..");return(v=v.concat(d.slice(f))).join("/")},t.sep="/",t.delimiter=":",t.dirname=function(u){if(typeof u!="string"&&(u+=""),u.length===0)return".";for(var o=u.charCodeAt(0),p=o===47,m=-1,d=!0,y=u.length-1;y>=1;--y)if((o=u.charCodeAt(y))===47){if(!d){m=y;break}}else d=!1;return m===-1?p?"/":".":p&&m===1?"/":u.slice(0,m)},t.basename=function(u,o){var p=i(u);return o&&p.substr(-1*o.length)===o&&(p=p.substr(0,p.length-o.length)),p},t.extname=function(u){typeof u!="string"&&(u+="");for(var o=-1,p=0,m=-1,d=!0,y=0,f=u.length-1;f>=0;--f){var S=u.charCodeAt(f);if(S===47){if(!d){p=f+1;break}continue}m===-1&&(d=!1,m=f+1),S===46?o===-1?o=f:y!==1&&(y=1):o!==-1&&(y=-1)}return o===-1||m===-1||y===0||y===1&&o===m-1&&o===p+1?"":u.slice(o,m)};var s="ab".substr(-1)==="b"?function(u,o,p){return u.substr(o,p)}:function(u,o,p){return o<0&&(o=u.length+o),u.substr(o,p)}}).call(this,n("_process"))},{_process:14}],14:[function(n,e,t){var r,a,i,l=e.exports={};function s(){throw Error("setTimeout has not been defined")}function u(){throw Error("clearTimeout has not been defined")}function o(g){if(r===setTimeout)return setTimeout(g,0);if((r===s||!r)&&setTimeout)return r=setTimeout,setTimeout(g,0);try{return r(g,0)}catch{try{return r.call(null,g,0)}catch{return r.call(this,g,0)}}}function p(g){if(a===clearTimeout)return clearTimeout(g);if((a===u||!a)&&clearTimeout)return a=clearTimeout,clearTimeout(g);try{return a(g)}catch{try{return a.call(null,g)}catch{return a.call(this,g)}}}(function(){try{r=typeof setTimeout=="function"?setTimeout:s}catch{r=s}try{a=typeof clearTimeout=="function"?clearTimeout:u}catch{a=u}})();var m=[],d=!1,y=-1;function f(){d&&i&&(d=!1,i.length?m=i.concat(m):y=-1,m.length&&S())}function S(){if(!d){var g=o(f);d=!0;for(var _=m.length;_;){for(i=m,m=[];++y<_;)i&&i[y].run();y=-1,_=m.length}i=null,d=!1,p(g)}}function v(g,_){this.fun=g,this.array=_}function w(){}l.nextTick=function(g){var _=Array(arguments.length-1);if(arguments.length>1)for(var $=1;$<arguments.length;$++)_[$-1]=arguments[$];m.push(new v(g,_)),m.length!==1||d||o(S)},v.prototype.run=function(){this.fun.apply(null,this.array)},l.title="browser",l.browser=!0,l.env={},l.argv=[],l.version="",l.versions={},l.on=w,l.addListener=w,l.once=w,l.off=w,l.removeListener=w,l.removeAllListeners=w,l.emit=w,l.prependListener=w,l.prependOnceListener=w,l.listeners=function(g){return[]},l.binding=function(g){throw Error("process.binding is not supported")},l.cwd=function(){return"/"},l.chdir=function(g){throw Error("process.chdir is not supported")},l.umask=function(){return 0}},{}],15:[function(n,e,t){var r=n("escodegen").generate;e.exports=function(a,i){i||(i={});var l={},s=function u(o,p){if(o.type==="Literal")return o.value;if(o.type==="UnaryExpression"){var m=u(o.argument);return o.operator==="+"?+m:o.operator==="-"?-m:o.operator==="~"?~m:o.operator==="!"?!m:l}if(o.type==="ArrayExpression"){for(var d=[],y=0,f=o.elements.length;y<f;y++){var S=u(o.elements[y]);if(S===l)return l;d.push(S)}return d}if(o.type==="ObjectExpression"){for(var v={},y=0;y<o.properties.length;y++){var w=o.properties[y],g=w.value===null?w.value:u(w.value);if(g===l)return l;v[w.key.value||w.key.name]=g}return v}if(o.type==="BinaryExpression"||o.type==="LogicalExpression"){var f=u(o.left);if(f===l)return l;var _=u(o.right);if(_===l)return l;var $=o.operator;return $==="=="?f==_:$==="==="?f===_:$==="!="?f!=_:$==="!=="?f!==_:$==="+"?f+_:$==="-"?f-_:$==="*"?f*_:$==="/"?f/_:$==="%"?f%_:$==="<"?f<_:$==="<="?f<=_:$===">"?f>_:$===">="?f>=_:$==="|"?f|_:$==="&"?f&_:$==="^"?f^_:$==="&&"?f&&_:$==="||"?f||_:l}if(o.type==="Identifier")return{}.hasOwnProperty.call(i,o.name)?i[o.name]:l;if(o.type==="ThisExpression")return{}.hasOwnProperty.call(i,"this")?i.this:l;if(o.type==="CallExpression"){var x=u(o.callee);if(x===l||typeof x!="function")return l;var T=o.callee.object?u(o.callee.object):l;T===l&&(T=null);for(var P=[],y=0,f=o.arguments.length;y<f;y++){var S=u(o.arguments[y]);if(S===l)return l;P.push(S)}return x.apply(T,P)}else if(o.type==="MemberExpression"){var v=u(o.object);if(v===l||typeof v=="function")return l;if(o.property.type==="Identifier")return v[o.property.name];var w=u(o.property);return w===l?l:v[w]}else if(o.type==="ConditionalExpression"){var m=u(o.test);return m===l?l:u(m?o.consequent:o.alternate)}else if(o.type==="ExpressionStatement"){var m=u(o.expression);return m===l?l:m}else{if(o.type==="ReturnStatement")return u(o.argument);if(o.type==="FunctionExpression"){var D=o.body.body,R={};Object.keys(i).forEach(function(H){R[H]=i[H]});for(var y=0;y<o.params.length;y++){var I=o.params[y];if(I.type!="Identifier")return l;i[I.name]=null}for(var y in D)if(u(D[y])===l)return l;var F=Object.keys(i=R),C=F.map(function(H){return i[H]});return Function(F.join(", "),"return "+r(o)).apply(null,C)}else if(o.type==="TemplateLiteral"){for(var B="",y=0;y<o.expressions.length;y++)B+=u(o.quasis[y]),B+=u(o.expressions[y]);return B+u(o.quasis[y])}else if(o.type==="TaggedTemplateExpression"){var V=u(o.tag),X=o.quasi,oe=X.quasis.map(u),we=X.expressions.map(u);return V.apply(null,[oe].concat(we))}else return o.type==="TemplateElement"?o.value.cooked:l}}(a);return s===l?void 0:s}},{escodegen:12}],jsonpath:[function(n,e,t){e.exports=n("./lib/index")},{"./lib/index":5}]},{},["jsonpath"])("jsonpath")});class zs{constructor(e){this._itemsMap={},e.forEach((t,r)=>{this._itemsMap[t.item_id]=r})}pullItemIndex(e){let t=this._itemsMap[e];return delete this._itemsMap[e],t}getItemIndex(e){return this._itemsMap[e]}get itemsMap(){return this._itemsMap}}function Vs(n,e){let t,r=[];n?t=n.split(","):r=e;let a=new Set;function i(l){let s=!a.has(l);return s&&a.add(l),s}return n&&e.forEach(l=>{let s="";t.forEach((u,o)=>{let p=l.fields.find(m=>m.field_id==u);p&&(s+=p.field_value),t.length-1==o&&i(s)&&r.push(l)})}),r}function Js(n,e,t){var r=JSON.parse(JSON.stringify(n));return t?Qs(r,e):Ys(r,e)}function Qs(n,e){return n.forEach(t=>{e.forEach(r=>{let a=t.fields.find(i=>i.element_id==r.element_id);a?a.field_value=r.field_value:(r.field_id=r.element_id,t.fields.push(r))})}),n}function Ys(n,e){return n.forEach(t=>{t.fields=[].concat(e)}),n}var Z={},ht=A("f3Ywx"),rt=ht.default;Object.defineProperty(Z,"__esModule",{value:!0}),Z.default=ro;var Xs=rt(A("5ZWAZ")),Ks=rt(A("fgq5y")),Zs=rt(A("byyO9")),eo=rt(A("glRwo")),to=rt(A("ayR3G")),Xe=rt(A("a9VQw"));function ro(n,e){if((0,to.default)(2,arguments),!e||(0,Xs.default)(e)!=="object")return new Date(NaN);var t=e.years?(0,Xe.default)(e.years):0,r=e.months?(0,Xe.default)(e.months):0,a=e.weeks?(0,Xe.default)(e.weeks):0,i=e.days?(0,Xe.default)(e.days):0,l=e.hours?(0,Xe.default)(e.hours):0,s=e.minutes?(0,Xe.default)(e.minutes):0,u=e.seconds?(0,Xe.default)(e.seconds):0,o=(0,eo.default)(n),p=r||t?(0,Zs.default)(o,r+12*t):o,m=i||a?(0,Ks.default)(p,i+7*a):p,d=1e3*(u+60*(s+60*l));return new Date(m.getTime()+d)}Z=Z.default;var ke={},ht=A("f3Ywx"),Rt=ht.default;Object.defineProperty(ke,"__esModule",{value:!0}),ke.default=oo;var no=Rt(A("fgq5y")),ao=Rt(A("glRwo")),Gn=Rt(A("a9VQw")),io=Rt(A("ayR3G")),so=A("lmyOi");function oo(n,e,t){(0,io.default)(2,arguments);var r,a,i,l,s,u,o,p,m=(0,so.getDefaultOptions)(),d=(0,Gn.default)((r=(a=(i=(l=t==null?void 0:t.weekStartsOn)!==null&&l!==void 0?l:t==null||(s=t.locale)===null||s===void 0||(u=s.options)===null||u===void 0?void 0:u.weekStartsOn)!==null&&i!==void 0?i:m.weekStartsOn)!==null&&a!==void 0?a:(o=m.locale)===null||o===void 0||(p=o.options)===null||p===void 0?void 0:p.weekStartsOn)!==null&&r!==void 0?r:0);if(!(d>=0&&d<=6))throw RangeError("weekStartsOn must be between 0 and 6 inclusively");var y=(0,ao.default)(n),f=(0,Gn.default)(e),S=y.getDay(),v=(f%7+7)%7,w=7-d,g=f<0||f>6?f-(S+w)%7:(v+w)%7-(S+w)%7;return(0,no.default)(y,g)}ke=ke.default;var ft={},ht=A("f3Ywx"),Wn=ht.default;Object.defineProperty(ft,"__esModule",{value:!0}),ft.default=co;var Hn=Wn(A("hLz6R")),lo=Wn(A("ayR3G"));function co(n,e,t){(0,lo.default)(2,arguments);var r=(0,Hn.default)(n,t),a=(0,Hn.default)(e,t);return r.getTime()===a.getTime()}function uo(n,e){return n.forEach(t=>{e.forEach(r=>{let a=t.fields.find(i=>i.element_id==r.element_id);a?r.data_range?(r.date_type.includes("calendar"),a.field_value=\`\${po(r.date_type)}:\${Ft(r.date_type)}\`):a.field_value=Ft(r.date_type):t.fields.push({field_id:r.element_id,element_id:r.element_id,field_value:Ft(r.date_type)})})}),n}function po(n){let e=new Date;function t(a){let i;var l=a.getDay();n.includes("week_current,current")&&(i=0),n.includes("week_next,future")&&(i=7),n.includes("week_past,past")&&(i=-7);let s=a.getDate()-l+i+(l==0?-6:1);return new Date(a.setDate(s))}function r(a){let i,l,s=Math.floor(a.getMonth()/3),u=a.getFullYear();return n.includes("quarter_current,current")&&(i=0,l=0),n.includes("quarter_next,future")&&(i=3,l=0),n.includes("quarter_past,past")&&(i=-3,l=0),new Date(u,3*s+i,1+l)}switch(n){case"week_current,current":case"week_next,future":case"week_past,past":return t(new Date).getTime();case"month_current,current":return new Date(e.getFullYear(),e.getMonth(),1).getTime();case"quarter_current,current":case"quarter_next,future":case"quarter_past,past":return r(new Date).getTime();case"year_current,current":return G(Z)(new Date(e.getFullYear(),0,1),{years:0}).getTime();case"month_next,future":return new Date(e.getFullYear(),e.getMonth()+1,1).getTime();case"year_next,future":case"today_current,current":case"7_days_future,future":case"10_days_future,future":case"14_days_future,future":case"30_days_future,future":return G(Z)(e,{days:0}).getTime();case"month_past,past":return new Date(e.getFullYear(),e.getMonth()-1,1).getTime();case"year_past,past":return G(Z)(e,{years:-1}).getTime();case"year_past,past,calendar":return G(Z)(new Date(e.getFullYear(),0,1),{years:-1}).getTime();case"year_future,future,calendar":return G(Z)(new Date(e.getFullYear()+1,0,1),{years:0}).getTime();case"tomorrow,future":return G(Z)(e,{days:1}).getTime();case"yesterday,past":return G(Z)(e,{days:-1}).getTime();case"7_days_past,past":return G(Z)(e,{days:-7}).getTime();case"10_days_past,past":return G(Z)(e,{days:-10}).getTime();case"14_days_past,past":return G(Z)(e,{days:-14}).getTime();case"30_days_past,past":return G(Z)(e,{days:-30}).getTime()}}function Ft(n){var e=new Date;function t(s){var u=(s=new Date(s)).getDay(),o=s.getDate()-u+6+(u==0?6:1);return new Date(s.setDate(o))}function r(s){var u=(s=new Date(s)).getDay(),o=s.getDate()-u+13+(u==0?-6:1);return new Date(s.setDate(o))}function a(s){var u=(s=new Date(s)).getDay(),o=s.getDate()-u-1+(u==0?-6:1);return new Date(s.setDate(o))}let i=Math.floor(e.getMonth()/3),l=e.getFullYear();switch(n){case"next_day":case"tomorrow,future":return G(Z)(e,{days:1}).getTime();case"two_days_after":return G(Z)(e,{days:2}).getTime();case"three_days_after":return G(Z)(e,{days:3}).getTime();case"four_days_after":return G(Z)(e,{days:4}).getTime();case"next_week":return G(Z)(e,{weeks:1}).getTime();case"two_weeks_after":return G(Z)(e,{weeks:2}).getTime();case"three_weeks_after":return G(Z)(e,{weeks:3}).getTime();case"this_sunday":return G(ke)(e,0,{weekStartsOn:1});case"this_monday":return G(ke)(e,1,{weekStartsOn:1});case"this_tuesday":return G(ke)(e,2,{weekStartsOn:1});case"this_wednesday":return G(ke)(e,3,{weekStartsOn:1});case"this_thursday":return G(ke)(e,4,{weekStartsOn:1});case"this_friday":return G(ke)(e,5,{weekStartsOn:1});case"this_saturday":return G(ke)(e,6,{weekStartsOn:1});case"today_current,current":case"7_days_past,past":case"10_days_past,past":case"14_days_past,past":case"30_days_past,past":case"year_past,past":return G(Z)(e,{days:0}).getTime();case"7_days_future,future":return G(Z)(e,{days:7}).getTime();case"10_days_future,future":return G(Z)(e,{days:10}).getTime();case"14_days_future,future":return G(Z)(e,{days:14}).getTime();case"30_days_future,future":return G(Z)(e,{days:30}).getTime();case"yesterday,past":return G(Z)(e,{days:-1}).getTime();case"year_future,future,calendar":return G(Z)(new Date(e.getFullYear()+1,0,0),{years:1}).getTime();case"year_past,past,calendar":return G(Z)(new Date(e.getFullYear(),0,0),{years:0}).getTime();case"week_current,current":return t(new Date).getTime();case"month_current,current":return new Date(e.getFullYear(),e.getMonth()+1,0).getTime();case"quarter_current,current":return new Date(l,(i+1)*3,0).getTime();case"year_current,current":return G(Z)(new Date(e.getFullYear()+1,0,0),{years:0}).getTime();case"week_next,future":return r(new Date).getTime();case"month_next,future":return new Date(e.getFullYear(),e.getMonth()+2,0).getTime();case"quarter_next,future":return new Date(l,(i+1)*3+3,0).getTime();case"year_next,future":return G(Z)(e,{years:1}).getTime();case"week_past,past":return a(new Date).getTime();case"month_past,past":return new Date(e.getFullYear(),e.getMonth(),0,0).getTime();case"quarter_past,past":return new Date(l,(i+1)*3-3,0).getTime();default:return e.getTime()}}function fo(n,e){n=new Date(n);let t=new Date;switch(e){case"day":return n.getDate()+"."+n.getMonth()==t.getDate()+"."+t.getMonth();case"week":let r=new Date(new Date().getFullYear(),n.getMonth(),n.getDate());return G(ft)(r,t);case"month":return n.getMonth()===t.getMonth();default:return!0}}function ho(n,e,t){return nt(n,e,t)}function Lt(n){return n&&typeof n=="object"&&Object.prototype.toString.call(n)!=="[object RegExp]"&&Object.prototype.toString.call(n)!=="[object Date]"}function mo(n){return Array.isArray(n)?[]:{}}function mt(n,e){return e&&e.clone===!0&&Lt(n)?nt(mo(n),n,e):n}function zn(n,e,t){var r=n.slice();return e.forEach(function(a,i){r[i]===void 0?r[i]=mt(a,t):Lt(a)?r[i]=nt(n[i],a,t):n.indexOf(a)===-1&&r.push(mt(a,t))}),r}function go(n,e,t){var r={};return Lt(n)&&Object.keys(n).forEach(function(a){r[a]=mt(n[a],t)}),Object.keys(e).forEach(function(a){Lt(e[a])&&n[a]?r[a]=nt(n[a],e[a],t):r[a]=mt(e[a],t)}),r}function nt(n,e,t){n=n!==void 0?n:{};var r=Array.isArray(e=e!==void 0?e:{}),a=(t||{arrayMerge:zn}).arrayMerge||zn;return r?Array.isArray(n)?a(n,e,t):mt(e,t):go(n,e,t)}function Vn(n){let e={};return n.forEach(t=>{t.items_list.forEach(r=>{let a=e[r.item_id];return a?(a.trash=r.trash,r.fields.forEach(i=>{let l=!0;a.fields=a.fields.map(s=>Number(s.field_id)===Number(i.field_id)&&(l=!1,s.field_value!=i.field_value)?{...i,history:i.history.concat(s.history)}:s),l&&a.fields.push(i)})):e[r.item_id]=r})}),Object.values(e)}function yo(n){return Vn(n)}function _o(n,e,t,r,a){let i,l=JSON.parse(JSON.stringify(n)),s=r||"children",u=!!a&&a;for(i=0;i<l.length;i++)l[i][t]&&l[i][t]!==0&&l.forEach(m=>{l[i][t]==m[e]?(m[s]||(m[s]=[]),m[s].push(l[i]),l.splice(i,1),i==0?i=0:i--):m[s]&&o(m)});function o(m){m[s].forEach(d=>{d[e]==l[i][t]?(d[s]||(d[s]=[]),d[s].push(l[i]),l.splice(i,1),i==0?i=0:i--):d[s]&&o(d)})}function p(m){m.sort((d,y)=>d[u]-y[u]),m.forEach(d=>{d[s]&&p(d[s])})}return u&&p(l),l}ft=ft.default,nt.all=function(n,e){if(!Array.isArray(n)||n.length<2)throw Error("first argument should be an array with at least two elements");return n.reduce(function(t,r){return nt(t,r,e)})},self.onmessage=function(n){let e=Vn(n.data);self.postMessage(e)};class bo{constructor(e){this.gudhub=e}mergeFieldLists(e,t){let r=JSON.parse(JSON.stringify(e)),a=JSON.parse(JSON.stringify(t)),i=a.map(l=>l.field_id);return a.length?a.reduce((l,s)=>{let u=null;if(l.find((o,p)=>s.field_id==o.field_id&&(u=p,!0)))l[u]=this.gudhub.util.mergeObjects(l[u],s);else{let o=s.data_model&&s.data_model.interpretation&&s.data_model.interpretation.find(p=>p.src=="table")||{settings:{show_field:1}};if(o.settings.show_field){let p=this.gudhub.util.mergeObjects({show:1},o),m=this.gudhub.util.mergeObjects(p,s);l.push(m)}}return l},r).filter(function(l){return l.show&&i.indexOf(l.field_id)!=-1}):[]}createFieldsListToView(e,t){let r=this;return new Promise(async a=>{let i=await this.gudhub.getFieldModels(e);if(t.length!==0){let s=[];t.forEach((u,o)=>{let p=i.find(m=>u.field_id==m.field_id);p&&(p.data_model.interpretation.find(m=>m.src=="table"),s.push({field_id:p.field_id,show:u.show,width:u.width?u.width:"150px"})),o+1==t.length&&l(s)})}else l(t);function l(s){let u=0;i.forEach((o,p)=>{s.find(m=>o.field_id==m.field_id)?(u==i.length-1&&a(s),u++):r.gudhub.ghconstructor.getInstance(o.data_type).then(m=>{if(m){let d=m.getTemplate().model.data_model.interpretation.find(y=>y.src=="table");d||(d={settings:{show_field:1}}),s.push({field_id:o.field_id,show:d.settings.show_field}),u==i.length-1&&a(s)}u++},function(m){u++})})}})}createFieldsListToViewWithDataType(e,t){return new Promise(async r=>{let a=[],i=await this.gudhub.getFieldModels(e),l=i.map(u=>+u.field_id),s=[];a=i.reduce((u,o)=>(u.find((p,m)=>o.field_id==p.field_id)||(u.push({field_id:o.field_id,data_type:o.data_type}),s.push(new Promise(async p=>{let m=(await this.gudhub.ghconstructor.getInstance(o.data_type)).getTemplate().model.data_model.interpretation.find(d=>d.src=="table")||{settings:{show_field:1}};u.find(d=>d.field_id==o.field_id).show=m.settings.show_field,p(!0)}))),u),t),Promise.all(s).then(()=>{r(a=a.filter(u=>l.indexOf(u.field_id)!=-1))})})}}class vo{constructor(e){this.gudhub=e,this.selectedItems={}}async selectItems(e,t){if(!this.selectedItems.hasOwnProperty(e)){this.selectedItems[e]={items:[],app:[]};let i=await this.gudhub.getApp(e);this.selectedItems[e].app=i}let r=this.selectedItems[e],a=r.items.map(i=>i.item_id);t.forEach(i=>{a.indexOf(i.item_id)!=-1?r.items.splice(a.indexOf(i.item_id),1):r.items[r.items.length]=i})}getSelectedItems(e){return this.selectedItems[e]?this.selectedItems[e]:{items:[],app:[]}}clearSelectedItems(e){this.selectedItems[e]&&(this.selectedItems[e].items=[])}isItemSelected(e,t){let r=this.getSelectedItems(e);return r!==null&&(r=r.items.map(a=>a.item_id)).indexOf(t)!=-1}}function wo(){return\`function createList(items) {
15450
15250
  return items.reduce(
15451
15251
  (acc, item) => {
15452
15252
  acc.list[item.item_id] = item;
@@ -15518,7 +15318,7 @@ Expecting \`+ve.join(", ")+", got '"+(this.terminals_[R]||R)+"'":"Parse error on
15518
15318
 
15519
15319
  const diff = compareItemsLists(items_list1, items_list2);
15520
15320
  self.postMessage({ diff });
15521
- });\`}function yo(n,e,t,r,a){async function i(d,y,f){let S=null;if(d.type==="array"&&(S=Number(d.is_static)?Array(await u(d.childs,y,f)):await l(d,y,f)),d.type==="object"&&(S=Number(d.current_item)?await s(d,y):await u(d.childs,y,f)),d.type==="property"&&(S=await o(d,y,f)),typeof d=="object"&&d.type===void 0){let v={};for(let w in d)if(d.hasOwnProperty(w)){let g=d[w],_=await i(g,y,f);v[w]=_[g.property_name]}return v}return{[d.property_name]:S}}async function l(d,y,f){let S=await t.gudhub.getApp(Number(d.app_id)),v=await m(d.filter,S.items_list,f,y);if(d.isSortable&&d.field_id_to_sort&&d.field_id_to_sort!==""){let w=v.flatMap(_=>{let $=_.fields.find(x=>x.field_id==d.field_id_to_sort);return $&&$.field_value!=""?_:[]}),g=v.filter(_=>{if(!w.includes(_))return _});v=[...w=w.sort((_,$)=>d.sortType=="desc"?$.fields.find(x=>x.field_id==d.field_id_to_sort).field_value-_.fields.find(x=>x.field_id==d.field_id_to_sort).field_value:_.fields.find(x=>x.field_id==d.field_id_to_sort).field_value-$.fields.find(x=>x.field_id==d.field_id_to_sort).field_value),...g]}if(d.offset){let w;w=d.use_variables_for_limit_and_offset&&r?r[d.offset]:/^[0-9]+$/.test(d.offset)?d.offset:0,v=v.slice(w)}if(d.limit){let w;(w=d.use_variables_for_limit_and_offset&&r?r[d.limit]:/^[0-9]+$/.test(d.limit)||0)!==0&&(v=v.slice(0,w))}return Promise.all(v.map(async w=>u(d.childs,w,S.app_id)))}async function s(d,y){let f=await t.gudhub.getApp(d.app_id),S=f.items_list||[];return u(d.childs,y||S[0],f.app_id)}async function u(d,y,f){let S=await d.map(async v=>i(v,y,f));return(await Promise.all(S)).reduce((v,w)=>({...v,...w}),{})}async function o(d,y,f){switch(d.property_type){case"static":return d.static_field_value;case"variable":return d.variable_type==="app_id"?f:\`\${f}.\${y.item_id}\`;case"field_id":return d.field_id;case"function":return typeof d.function=="function"?d.function(y,f,t.gudhub,...d.args):await Function("item, appId, gudhub","return (async "+d.function+")(item, appId, gudhub)")(y,f,t.gudhub);default:return!d.field_id&&d.name_space&&(d.field_id=await t.gudhub.getFieldIdByNameSpace(f,d.name_space)),Number(d.interpretation)?await t.gudhub.getInterpretationById(Number(f),Number(y.item_id),Number(d.field_id),"value"):await t.gudhub.getFieldValue(Number(f),Number(y.item_id),Number(d.field_id))}}async function p(d,y,f,S,v){let w=await t.gudhub.prefilter(JSON.parse(JSON.stringify(d)),{element_app_id:y,app_id:f,item_id:S,...r});return t.gudhub.filter(v,[...w,...d])}async function m(d=[],y=[],f="",S={}){return d.length?p(d,f,f,S.item_id,y):[...y]}return i(n,e,a)}class _o{constructor(e){this.gudhub=e,this.appsConnectingMap={apps:[],fields:[],items:[],views:[]}}createAppsFromTemplate(e,t,r,a){let i=this;return new Promise(l=>{let s=100/(6*e.apps.length),u=0;i.createApps(e,o=>{u+=1,r&&r.call(this,{percent:u*s,status:o})},a).then(o=>{i.createItems(o,t,p=>{typeof p=="string"?(u+=1,r&&r.call(this,{percent:u*s,status:p})):typeof p=="object"&&(r&&r.call(this,{status:"Done",apps:p}),l())},a)})})}createItems(e,t,r,a){return new Promise(async i=>{let l=t||1e5,s=this,u=[],o=[],{accesstoken:p}=await s.gudhub.req.axiosRequest({method:"POST",url:"https://gudhub.com/GudHub_Test/auth/login",form:{auth_key:"3HMOtCbC0M/1/1e4y4Uxo/Kh/aFN4V5LG2//5ixx7TZyiUfMb7IHAAHCj9PsLrOSDrZuuWkbX4BIX23f51H+eA=="}});e.forEach(m=>{o.push(new Promise(async d=>{let y;y=a?await s.gudhub.req.axiosRequest({url:\`https://gudhub.com/GudHub_Test/api/app/get?token=\${p}&app_id=\${s._searchOldAppId(m.app_id,s.appsConnectingMap.apps)}\`,method:"GET"}):await s.gudhub.getApp(s._searchOldAppId(m.app_id,s.appsConnectingMap.apps)),r&&r.call(this,\`GET APP: \${y.app_name} (Items steps)\`);let f=JSON.parse(JSON.stringify(y)),S=f.items_list.map(v=>({index_number:v.index_number,item_id:0,fields:[]})).filter((v,w)=>w<=l);s.gudhub.addNewItems(m.app_id,S).then(v=>{r&&r.call(this,\`ADD NEW ITEMS: \${y.app_name} (Items steps)\`),m.items_list=v,s._updateMap(m.items_list,f.items_list),s._addFieldValue(f.items_list,m.items_list,s.appsConnectingMap),u.push(m),d()})}))}),Promise.all(o).then(()=>{u.forEach(m=>{m.items_list.forEach(d=>{d.fields.forEach(y=>{s.appsConnectingMap.fields.forEach(f=>{y.field_id===f.old_field_id&&(y.field_id=f.new_field_id,y.element_id=f.new_field_id)})})})}),s.deleteField(u),s.replaceValue(u,s.appsConnectingMap).then(()=>{let m=[];u.forEach(d=>{m.push(new Promise(y=>{let f=d.items_list.map(S=>(S.fields.forEach(v=>{delete v.data_id}),S));s.gudhub.updateItems(d.app_id,f).then(()=>{r&&r.call(this,\`REPLACE VALUE: \${d.app_name} (Items steps)\`),y()})}))}),Promise.all(m).then(()=>{r.call(this,u),i()})})})})}deleteField(e){e.forEach(t=>{t.items_list.forEach(r=>{r.fields=r.fields.filter(a=>t.field_list.findIndex(i=>i.field_id==a.field_id)>-1)})})}replaceValue(e,t){return new Promise(async r=>{let a=[],i=this;e.forEach(l=>{l.field_list.forEach(s=>{s.data_type==="item_ref"&&i._replaceValueItemRef(l,s,t),a.push(new Promise(u=>{i.gudhub.ghconstructor.getInstance(s.data_type).then(o=>{if(o===void 0){console.log("ERROR WHILE GETTING INSTANCE OF ",s.data_type),u({type:s.data_type});return}if(o.getTemplate().constructor=="file")return i.gudhub.util.fileInstallerHelper(l.app_id,l.items_list,s.field_id).then(p=>{u(p)});o.getTemplate().constructor=="document"?i.documentInstallerHelper(l.app_id,l.items_list,s.field_id).then(p=>{u(o)}):u(o)})}))})}),a.length>0?Promise.all(a).then(l=>{r(l)}):r(result)})}documentInstallerHelper(e,t,r){let a=this,i=[];return new Promise(async l=>{for(let s of t){let u=s.item_id,o=s.fields.find(p=>p.element_id===r);if(o&&o.field_value&&o.field_value.length>0){let p=await a.gudhub.getDocument({_id:o.field_value});if(p&&p.data){let m=await a.gudhub.createDocument({app_id:e,item_id:u,element_id:r,data:p.data});o.field_value=m._id,i.push(s)}}}l(i)})}_replaceValueItemRef(e,t,r){e.items_list.forEach(a=>{a.fields.forEach(i=>{if(i.field_id===t.field_id&&i.field_value){let l=i.field_value.split(",");l.forEach((s,u)=>{let o=s.split(".");r.apps.forEach(p=>{o[0]==p.old_app_id&&(o[0]=p.new_app_id)}),r.items.forEach(p=>{o[1]==p.old_item_id&&(o[1]=p.new_item_id)}),l[u]=o.join(".")}),i.field_value=l.join(",")}})})}_addFieldValue(e,t,r){t.forEach(a=>{r.items.forEach(i=>{a.item_id===i.new_item_id&&e.forEach(l=>{i.old_item_id===l.item_id&&(a.fields=l.fields)})})})}_updateMap(e,t){t.forEach(r=>{e.forEach(a=>{r.index_number===a.index_number&&this.appsConnectingMap.items.push({old_item_id:r.item_id,new_item_id:a.item_id})})})}_searchOldAppId(e,t){let r=0;return t.forEach(a=>{a.new_app_id===e&&(r=a.old_app_id)}),r}createApps(e,t,r){let a=this,i={step_size:100/(3*e.apps.length),apps:[]};return new Promise(async l=>{let s={},u=[],o=[],{accesstoken:p}=await a.gudhub.req.axiosRequest({method:"POST",url:"https://gudhub.com/GudHub_Test/auth/login",form:{auth_key:"3HMOtCbC0M/1/1e4y4Uxo/Kh/aFN4V5LG2//5ixx7TZyiUfMb7IHAAHCj9PsLrOSDrZuuWkbX4BIX23f51H+eA=="}});for(let m of e.apps){let d;d=r?await a.gudhub.req.axiosRequest({url:\`https://gudhub.com/GudHub_Test/api/app/get?token=\${p}&app_id=\${m}\`,method:"GET"}):await a.gudhub.getApp(m),t&&t.call(this,\`GET APP: \${d.app_name} (App steps)\`);let y=JSON.parse(JSON.stringify(d));s[y.app_id]=y,i.apps.push(y.icon);let f=a.prepareAppTemplate(y);f.app_name=f.app_name+" New",f.privacy=1,e.data_to_change&&(e.data_to_change.name&&(f.app_name=e.data_to_change.name),e.data_to_change.icon&&(f.icon=e.data_to_change.icon)),a.resetViewsIds(f),a.gudhub.createNewApp(f).then(S=>{t&&t.call(this,\`CREATE NEW APP: \${d.app_name} (App steps)\`),u.push(S),a.mapApp(y,S,a.appsConnectingMap),e.apps.length==u.length&&(a.connectApps(u,a.appsConnectingMap,s),u.forEach(v=>{a.gudhub.updateApp(v).then(w=>{t&&t.call(this,\`UPDATE APP: \${d.app_name} (App steps)\`),o.push(w),e.apps.length==o.length&&l(o)})}))})}})}mapApp(e,t,r){r.apps.push({old_app_id:e.app_id,new_app_id:t.app_id,old_view_init:e.view_init,new_view_init:t.view_init}),e.field_list.forEach(a=>{t.field_list.forEach(i=>{a.name_space==i.name_space&&r.fields.push({name_space:a.name_space,old_field_id:a.field_id,new_field_id:i.field_id})})}),e.views_list.forEach(a=>{t.views_list.forEach(i=>{a.name==i.name&&r.views.push({name:a.name,old_view_id:a.view_id,new_view_id:i.view_id})})})}crawling(e,t){let r=e===null?[]:Object.keys(e),a=this;r.length>0&&r.forEach(i=>{let l=e[i];l!==void 0&&typeof e!="string"&&(t(i,l,e),a.crawling(l,t))})}resetViewsIds(e){e.view_init=0,this.crawling(e.views_list,function(t,r,a){(t=="view_id"||t=="container_id")&&(a[t]=0)})}connectApps(e,t,r){let a=this;return e.forEach(i=>{t.apps.forEach(l=>{i.view_init===l.new_view_init&&t.views.forEach(s=>{l.old_view_init===s.old_view_id&&(i.view_init=s.new_view_id)})}),a.crawling(i.field_list,function(l,s,u){if(l.indexOf("field_id")!==-1||l.indexOf("FieldId")!==-1||l.indexOf("destination_field")!==-1){let o=String(s).split(","),p=[];t.fields.forEach(m=>{o.forEach(d=>{d==m.old_field_id&&p.push(m.new_field_id)})}),p.length&&(u[l]=p.join(","))}if((l.indexOf("app_id")!=-1||l.indexOf("AppId")!=-1||l.indexOf("destination_app")!=-1)&&t.apps.forEach(o=>{s==o.old_app_id&&(u[l]=o.new_app_id)}),l.indexOf("view_id")!==-1&&t.views.forEach(o=>{s==o.old_view_id&&(u[l]=o.new_view_id)}),l.indexOf("src")!==-1&&isFinite(s)){let o="container_id",p=t.apps.find(d=>d.new_app_id===i.app_id).old_app_id,m=a.findPath(r[p].views_list,o,s);u[l]=\`\${a.getValueByPath(i.views_list,m,o)}\`}if(l.indexOf("trigger")!==-1&&s.model&&s.model.nodes){let o=s.model.nodes,p=["inputs","outputs"];for(let m in o)p.forEach(d=>{let y=o[m];Object.keys(y[d]).filter(f=>f!==""&&!isNaN(f)).forEach(f=>{let S=t.fields.filter(v=>v.old_field_id==f);if(S.length!==0&&S[0].new_field_id){let v=S[0].new_field_id.toString(),w=y[d][f];w.connections.forEach(g=>{g.input==f&&(g.input=v),g.output==f&&(g.output=v)}),delete y[d][f],y[d][v]=w}})})}})}),e}getValueByPath(e,t,r){let a=e;return t.split(".").forEach(i=>{a=a[i]}),a[r]}findPath(e,t,r){let a=this,i=!1,l=!1,s=[];return a.crawling(e,function(u,o,p){l&&s.reverse().forEach(m=>{l&&(m.delete=!0,m.parent===p&&(l=!1,(s=s.filter(d=>!d.delete)).reverse()))}),i||(typeof p[u]=="object"&&s.push({prop:u,parent:p}),o==r&&t===u?i=!0:Object.keys(p).pop()!==u||typeof p[u]=="object"||(l=!0))}),s.map(u=>u.prop).join(".")}prepareAppTemplate(e){let t=this,r=JSON.parse(JSON.stringify(e));return t.crawling(r.views_list,function(a,i,l){a=="element_id"&&(l.element_id=-Number(i),l.create_element=-Number(i))}),r.field_list.forEach(a=>{a.create_field=-Number(a.field_id),a.element_id=-Number(a.field_id),a.field_id=-Number(a.field_id),a.field_value=""}),r.items_list=[],delete r.app_id,delete r.icon.id,delete r.group_id,delete r.trash,delete r.last_update,delete r.file_list,r}}class bo{constructor(e){this.gudhub=e}fileInstallerHelper(e,t,r){let a=this;return new Promise(i=>{let l=[[]],s=Promise.resolve(),u=[];t.forEach(o=>{let p=o.item_id,m=o.fields.find(d=>d.element_id===r);m&&m.field_value&&m.field_value.split(".").forEach(d=>{let y={source:d,destination:{app_id:e,item_id:p,element_id:r}};l[l.length-1].length!==10?l[l.length-1].push(y):l.push([y])})}),l.forEach(o=>{s=s.then(()=>a.gudhub.duplicateFile(o)).then(p=>{u=[...u,...p]})}),s.then(()=>{t.forEach(o=>{let p=o.item_id,m=o.fields.find(d=>d.element_id===r);m&&m.field_value&&(m.field_value="",u.forEach(d=>{d.item_id===p&&(m.field_value=m.field_value.split(",").filter(y=>y).concat(d.file_id).join(","))}))}),i()})})}}function vo(n,e){return JSON.stringify(n)===JSON.stringify(e)}async function Wn(n){await Promise.all(n);let e=!0;for(let t of n){let r=await wo(t);if(r.state==="pending"){e=!1;break}if(r.state==="rejected")throw r.reason}return!!e||Wn(n)}function wo(n){let e={state:"pending"};return Promise.race([n,e]).then(t=>t===e?t:{state:"resolved",value:t},t=>({state:"rejected",reason:t}))}function $o(n,e){if(!n||!n.length)return[];if(!n[0].fields.length)return n;var t=e&&e.sort_field_id||n[0].fields[0].field_id;function r(a){for(var i=null,l=0;l<a.fields.length;l++)if(a.fields[l].field_id==t){i=a.fields[l].field_value;break}return i}return n.sort(function(a,i){var l=r(a),s=r(i);return l===null?-1:s===null?1:/^\\d+$/.test(l)&&/^\\d+$/.test(s)?Number(l)<Number(s)?-1:1:/^\\d+$/.test(l)||/^\\d+$/.test(s)?/^\\d+$/.test(l)?-1:1:l.toLowerCase()>s.toLowerCase()?1:-1}),e&&e.descending?n.reverse():n}class So{constructor(e){this.gudhub=e,this.MergeFields=new ho(e),this.ItemsSelection=new mo(e),this.AppsTemplateService=new _o(e),this.FileHelper=new bo(e)}prefilter(e,t={}){return Fi(e,this.gudhub.storage,this.gudhub.pipeService,t)}filter(e,t){return Ss(e,t)}mergeFilters(e,t){return Ps(e,t)}group(e,t){return Us(e,t)}async getFilteredItems(e=[],t=[],r,a,i,l="",s,u){let o=await this.prefilter(t,{element_app_id:r,app_id:a,item_id:i}),p=this.filter(e,o);return this.group(l,p).filter(m=>!s||Nn([m],s).length===1).filter(m=>!u||Nn([m],u).length===1)}jsonToItems(e,t){return Cs(e,t)}getDate(e){return Nt(e)}checkRecurringDate(e,t){return oo(e,t)}populateItems(e,t,r){return Gs(e,t,r)}populateWithDate(e,t){return io(e,t)}populateWithItemRef(e,t,r,a,i,l){return Rs(e,t,r,a,i,l)}compareItems(e,t,r){return Ls(e,t,r)}mergeItems(e,t,r){return Fs(e,t,r)}mergeObjects(e,t,r){return lo(e,t,r)}makeNestedList(e,t,r,a,i){return fo(e,t,r,a,i)}async mergeChunks(e){return po(e)}mergeFieldLists(e,t){return this.MergeFields.mergeFieldLists(e,t)}createFieldsListToView(e,t){return this.MergeFields.createFieldsListToView(e,t)}createFieldsListToViewWithDataType(e,t){return this.MergeFields.createFieldsListToViewWithDataType(e,t)}selectItems(e,t){return this.ItemsSelection.selectItems(e,t)}getSelectedItems(e){return this.ItemsSelection.getSelectedItems(e)}clearSelectedItems(e){return this.ItemsSelection.clearSelectedItems(e)}isItemSelected(e,t){return this.ItemsSelection.isItemSelected(e,t)}jsonConstructor(e,t,r,a){return yo(e,t,this,r,a)}fileInstallerHelper(e,t,r){return this.FileHelper.fileInstallerHelper(e,t,r)}createAppsFromTemplate(e,t,r,a){return this.AppsTemplateService.createAppsFromTemplate(e,t,r,a)}createApps(e){return this.AppsTemplateService.createApps(e)}createItems(e,t){return this.AppsTemplateService.createItems(e,t)}areViewListsEqual(e,t){let r=e.sort((i,l)=>i.view_id-l.view_id),a=t.sort((i,l)=>i.view_id-l.view_id);return this.compareObjects(r,a)}areFieldListsEqual(e,t){let r=e.sort((i,l)=>i.field_id-l.field_id),a=t.sort((i,l)=>i.field_id-l.field_id);return this.compareObjects(r,a)}compareObjects(e,t){return vo(e,t)}compareAppsItemsLists(e,t,r){let a=new Blob([go()],{type:"application/javascript"});this.worker=new Worker(URL.createObjectURL(a)),this.worker.postMessage({items_list1:e,items_list2:t}),this.worker.addEventListener("message",i=>{let{diff:l}=i.data;r(l)})}dynamicPromiseAll(e){return Wn(e)}sortItems(e,t){return $o(e,t)}debounce(e,t){let r;return function(...a){clearTimeout(r),r=setTimeout(()=>{e.apply(this,a)},t)}}}class xo{constructor(e,t){this.req=e,this.storage=t}async login({username:e,password:t}={}){let r=await this.loginApi(e,t);return this.storage.updateUser(r),r}async loginWithToken(e){let t=await this.loginWithTokenApi(e);return this.storage.updateUser(t),t}async logout(e){return await this.logoutApi(e)}async signup(e){return await this.signupApi(e)}async updateToken(e){return await this.updateTokenApi(e)}async updateUser(e){let t=await this.updateUserApi(e);return this.storage.updateUser(t),t}async updateAvatar(e){let t=await this.avatarUploadApi(e);return this.storage.updateUser(t),t}async getUsersList(e){return await this.getUsersListApi(e)}async loginApi(e,t){try{return await this.req.axiosRequest({method:"POST",url:\`\${this.req.root}/auth/login\`,form:{username:e,password:t}})}catch(r){console.log(r)}}async loginWithTokenApi(e){try{return await this.req.axiosRequest({method:"POST",url:\`\${this.req.root}/auth/login?accesstoken=\${e}\`})}catch(t){console.log(t)}}async updateTokenApi(e){try{return await this.req.axiosRequest({method:"POST",url:\`\${this.req.root}/auth/login\`,form:{auth_key:e}})}catch(t){console.log(t)}}logoutApi(e){return this.req.post({url:"/auth/logout",form:{token:e}})}signupApi(e){return this.req.axiosRequest({method:"POST",url:\`\${this.req.root}/auth/singup\`,form:{user:JSON.stringify(e)}})}getUsersListApi(e){return this.req.get({url:"/auth/userlist",params:{keyword:e}})}updateUserApi(e){return this.req.post({url:"/auth/updateuser",form:{user:JSON.stringify(e)}})}avatarUploadApi(e){return this.req.post({url:"/auth/avatar-upload",form:{image:e}})}getUserByIdApi(e){return this.req.get({url:"/auth/getuserbyid",params:{id:e}})}getVersion(){return this.req.get({url:"/version"})}getUserFromStorage(e){return this.storage.getUsersList().find(t=>t.user_id==e)}saveUserToStorage(e){let t=this.storage.getUsersList();return t.find(r=>r.user_id==e.user_id)||(t.push(e),e)}async getUserById(e){let t=this.getUserFromStorage(e);if(!t){let r=await this.getUserByIdApi(e);if(!r)return null;(t=this.getUserFromStorage(e))||(this.saveUserToStorage(r),t=r)}return t}async getToken(){let e=new Date(this.storage.getUser().expirydate),t=new Date,r=this.storage.getUser().accesstoken;if(e<t||!r){let a=await this.updateToken(this.storage.getUser().auth_key);this.storage.updateUser(a),r=a.accesstoken}return r}}var Eo=A("kmcAT"),ht=A("akXK4"),Ee=A("5xozB");async function ko(n,e,t,r,a){try{let i;t||console.error(\`JS link must be provided for this data type - \${e}\`);let l=o=>(Ee.IS_BROWSER_MAIN_THREAD||oe.hasOwnProperty("window")||(oe.window=proxy,oe.document=a.document,oe.Element=a.Element,oe.CharacterData=a.CharacterData,oe.this=proxy,oe.self=proxy,oe.Blob=a.Blob,oe.Node=a.Node,oe.navigator=a.navigator,oe.HTMLElement=a.HTMLElement,oe.XMLHttpRequest=a.XMLHttpRequest,oe.WebSocket=a.WebSocket,oe.crypto=a.crypto,oe.DOMParser=a.DOMParser,oe.Symbol=a.Symbol,oe.document.queryCommandSupported=p=>(console.log("QUERY COMMAND SUPPORTED: ",p),!1),oe.angular=angular),new Promise(async p=>{let m=await G(ht).get(o).catch(f=>{console.log(\`Failed to fetch: \${o} in ghconstructor. Module id: \${e}\`)}),d=encodeURIComponent(m.data),y="data:text/javascript;charset=utf-8,"+d;p(y)})),s=await l(t);try{i=await import(s)}catch(o){console.log(\`Error while importing module: \${e}\`),console.log(o)}let u=new i.default(e);if(r&&Ee.IS_BROWSER_MAIN_THREAD){let o=document.createElement("link");o.href=r,o.setAttribute("data-module",e),o.setAttribute("rel","stylesheet"),document.getElementsByTagName("head")[0].appendChild(o)}return{type:e,getTemplate:function(o,p,m,d,y,f){let S=m!=="false";return u.getTemplate(o,p,S,d,y,f)},getDefaultValue:function(o,p,m,d){return new Promise(async y=>{let f=u.getDefaultValue;if(f){let S=await f(o,p,m,d);y(S)}else y(null)})},getSettings:function(o,p,m){return u.getSettings(o,p,m)},filter:{getSearchOptions:function(o){let p=u;return p.filter&&p.filter.getSearchOptions?u.filter.getSearchOptions(o):[]},getDropdownValues:function(){let o=u;return o.filter&&o.filter.getDropdownValues?o.filter.getDropdownValues():[]}},getInterpretation:function(o,p,m,d,y,f){return new Promise(async S=>{let v=u;try{let w=await v.getInterpretation(n,o,f,y,d,m),g=w.find($=>$.id==p)||w.find($=>$.id=="default"),_=await g.content();S({html:_})}catch(w){console.log(\`ERROR IN \${e}\`,w),S({html:"<span>no interpretation</span>"})}})},getInterpretationsList:function(o,p,m,d){return u.getInterpretation(o,p,m,d)},getInterpretatedValue:function(o,p,m,d){return new Promise(async y=>{let f=u.getInterpretatedValue;if(f){let S=await f(o,p,m,d);y(S)}else y(o)})},onMessage:function(o,p,m){return new Promise(async d=>{let y=u.onMessage;if(y){let f=await y(o,p,m);d(f)}d(null)})},extendController:function(o){u.getActionScope(o)},runAction:function(o){try{u.runAction(o)}catch{}},getWindowScope:function(o){return u.getWindowScope(o)},getWindowHTML:function(o){return u.getWindowHTML(o)}}}catch(i){console.log(i),console.log(\`Failed in createClassInstance (ghconstructor). Module id: \${e}. JS url: \${t}\`)}}class Ao{constructor(e){this.gudhub=e,this.cache={},this.modulesQueue={},this.angularInjector,this.nodeWindow}async getInstance(e){return this.getCached(e)||(this.modulesQueue[e]||(this.modulesQueue[e]=this.createInstance(e)),await this.modulesQueue[e]),this.getCached(e)}pupToCache(e,t){this.cache[e]=t}getCached(e){return this.cache[e]}initAngularInjector(e){this.angularInjector=e}initJsdomWindow(e){this.nodeWindow=e}async createInstance(e){let t,r=this.gudhub.storage.getModuleUrl(e);if(!r){console.log(\`Cannot find module: \${e}\`);return}return r.type==="gh_element"&&(r.technology==="angular"?t=await G(Eo)(this.gudhub,e,r.url,this.angularInjector,this.nodeWindow):r.technology==="class"&&(t=await ko(this.gudhub,e,r.js,r.css,this.nodeWindow))),t&&this.pupToCache(e,t),t}}class Io{constructor(e,t,r,a,i){this.storage=e,this.pipeService=t,this.req=r,this.appProcessor=a,this.util=i,this.itemListeners()}async addItemsApi(e,t){try{return await this.req.post({url:"/api/items/add",form:{items:JSON.stringify(t),app_id:e}})}catch(r){return console.log(r),null}}async updateItemsApi(e,t){try{return await this.req.post({url:"/api/items/update",form:{items:JSON.stringify(t),app_id:e}})}catch(r){return console.log(r),null}}deleteItemsApi(e){try{let t=this.req.post({url:"/api/items/delete",form:{items_ids:JSON.stringify(e)}});return t.from_apps_list=!0,t}catch(t){return console.log(t),null}}async addItemsToStorage(e,t){let r=await this.appProcessor.getApp(e);return r&&(t.forEach(a=>{r.items_list.push(a),r.items_object[a.item_id]={};for(let i=0;i<a.fields.length;i++)r.items_object[a.item_id][a.fields[i].field_id]=a.fields[i];this.pipeService.emit("gh_item_update",{app_id:e},[a])}),this.pipeService.emit("gh_items_update",{app_id:e},r.items_list),this.storage.updateApp(r)),r}async updateItemsInStorage(e,t){this.pipeService.emit("gh_items_update",{app_id:e},t);let r=await this.appProcessor.getApp(e);return r&&t&&t.forEach(a=>{let i={app_id:e};this.pipeService.emit("gh_item_update",i,[a]),i.item_id=a.item_id,this.pipeService.emit("gh_item_update",i,a);let l=r.items_list.find(s=>s.item_id==a.item_id);l&&a.fields.forEach(s=>{let u=l.fields.find(o=>o.field_id==s.field_id);i.field_id=s.field_id,u?u.field_value!=s.field_value&&(u.field_value=s.field_value,r.items_object[l.item_id][u.field_id]=u,this.pipeService.emit("gh_value_update",i,s.field_value)):(l.fields.push(s),r.items_object[l.item_id][s.field_id]=s,this.pipeService.emit("gh_value_update",i,s.field_value))})}),t}handleItemsChange(e,t,r){let a=this.util.compareItems(t.items_list,r.items_list);this.updateItemsInStorage(e,a.diff_src_items),this.addItemsToStorage(e,a.new_src_items)}triggerItemsChange(e,t){this.updateItemsInStorage(e,t.diff_src_items),this.addItemsToStorage(e,t.new_src_items)}handleDiff(e,t){this.updateItemsInStorage(e,t.diff_src_items),this.addItemsToStorage(e,t.new_src_items),this.deleteItemsFromStorage(e,t.trash_src_items)}async deleteItemsFromStorage(e,t=[]){let r=await this.appProcessor.getApp(e);r&&(r.items_list=r.items_list.filter(a=>!t.find(i=>a.item_id==i.item_id)||(delete r.items_object[a.item_id],!1)),this.pipeService.emit("gh_items_update",{app_id:e},r.items_list),this.storage.updateApp(r))}async getItems(e,t=!1){let r=await this.appProcessor.getApp(e,t);return r?r.items_list:null}async addNewItems(e,t){let r=t.map(i=>({...i,fields:qr(i.fields)})),a=await this.addItemsApi(e,r);return await this.addItemsToStorage(e,a),this.pipeService.emit("gh_items_add",{app_id:e},a),a}async updateItems(e,t){let r=t.map(i=>({...i,fields:qr(i.fields)})),a=await this.updateItemsApi(e,r);return await this.updateItemsInStorage(e,a)}async deleteItems(e,t){return this.deleteItemsApi(t).then(async r=>await this.deleteItemsFromStorage(e,r))}itemListeners(){this.pipeService.onRoot("gh_items_get",{},async(e,t)=>{if(t&&t.app_id){let r=await this.getItems(t.app_id);r?this.pipeService.emit("gh_items_get",t,r):this.pipeService.emit("gh_items_get",t,[])}}),this.pipeService.onRoot("gh_items_add",{},async(e,t)=>{if(t&&t.app_id&&t.items){let r=await this.addNewItems(t.app_id,t.items);r?this.pipeService.emit("gh_items_add",t,r):this.pipeService.emit("gh_items_add",t,[])}}),this.pipeService.onRoot("gh_items_update",{},async(e,t)=>{if(t&&t.app_id&&t.items){let r=await this.updateItems(t.app_id,t.items);r?this.pipeService.emit("gh_items_update",t,r):this.pipeService.emit("gh_items_update",t,[])}}),this.pipeService.onRoot("gh_item_get",{},async(e,t)=>{if(t&&t.app_id){let r=(await this.getItems(t.app_id)).find(a=>a.item_id==t.item_id);this.pipeService.emit("gh_item_get",t,r)}}),this.pipeService.onRoot("gh_filtered_items_get",{},async(e,t)=>{if(t&&t.element_app_id){let r=await this.getItems(t.element_app_id),a=await this.util.getFilteredItems(r,t.filters_list,t.element_app_id,t.app_id,t.item_id,t.field_groupe,t.search,t.search_params);this.pipeService.emit("gh_filtered_items_get",t,a)}}),this.pipeService.onRoot("gh_filter_items",{},async(e,t)=>{if(t&&t.items){let r=await this.util.getFilteredItems(t.items,t.filters_list,t.element_app_id,t.app_id,t.item_id,t.field_groupe,t.search,t.search_params);this.pipeService.emit("gh_filter_items",t,r)}})}}class Oo{constructor(e,t,r,a,i){this.storage=e,this.req=t,this.appProcessor=r,this.itemProcessor=a,this.pipeService=i,this.fieldListeners()}deleteFieldApi(e){return this.req.post({url:"/api/app/delete-field",form:{field_id:e}})}async updatedFieldApi(e,t={}){let r=await this.appProcessor.getApp(e),a={app_id:e,app_name:r.app_name,group_id:r.group_id,icon:r.icon,field_list:r.field_list.map(i=>i.field_id==t.field_id?{...i,...t}:i),views_list:r.views_list};return this.appProcessor.updateApp(a)}setFieldValueApi(e,t,r,a){let i=[{item_id:t,fields:[{field_id:r,field_value:a}]}];return this.itemProcessor.updateItems(e,i)}deleteFieldInStorage(e,t){let r=this.storage.getApp(e);return r.field_list=r.field_list.filter(a=>a.file_id!=t),r.items_list=r.items_list.map(a=>(a.fields=a.fields.filter(i=>i.field_id!=t),a)),this.storage.updateApp(r),!0}updateFieldInStorage(e,t){let r=this.storage.getApp(e);return r.field_list=r.field_list.map(a=>a.field_id==t.field_id?{...a,...t}:a),this.storage.updateApp(r),t}updateFieldValue(e,t,r,a){let i=this.storage.getApp(e);return i.items_list.forEach(l=>{l.item_id==t&&l.fields.forEach(s=>{s.field_id==r&&(s.field_value=a,i.items_object[l.item_id][s.field_id]=s)})}),this.storage.updateApp(i),a}async getField(e,t){let r=await this.appProcessor.getApp(e);if(!r)return null;for(let a=0;a<r.field_list.length;a++)if(r.field_list[a].field_id==t)return r.field_list[a];return null}async getFieldIdByNameSpace(e,t){let r=await this.appProcessor.getApp(e);if(!r)return null;for(let a=0;a<r.field_list.length;a++)if(r.field_list[a].name_space==t)return r.field_list[a].field_id;return null}async getFieldModels(e){let t=await this.appProcessor.getApp(e);return t?t.field_list:null}async updateField(e,t){if(!e||!t)return;let r=await this.updatedFieldApi(e,t);return this.updateFieldInStorage(e,r)}async deleteField(e,t){return await this.deleteFieldApi(t),this.deleteFieldInStorage(e,t)}async getFieldValue(e,t,r){let a=null,i=await this.appProcessor.getApp(e);try{a=i.items_object[t][r].field_value}catch{}return a}async setFieldValue(e,t,r,a){if(e&&t&&r)return await this.setFieldValueApi(e,t,r,a),this.updateFieldValue(e,t,r,a)}fieldListeners(){this.pipeService.onRoot("gh_value_get",{},async(e,t)=>{if(t.app_id&&t.item_id&&t.field_id){let r=await this.getFieldValue(t.app_id,t.item_id,t.field_id);this.pipeService.emit("gh_value_get",t,r)}}),this.pipeService.onRoot("gh_value_set",{},async(e,t)=>{t.item_id&&(this.setFieldValue(t.app_id,t.item_id,t.field_id,t.new_value),delete t.new_value)}),this.pipeService.onRoot("gh_model_get",{},async(e,t)=>{try{let r=await this.getField(t.app_id,t.field_id);this.pipeService.emit("gh_model_get",t,r)}catch(r){console.log("Field model: ",r)}}),this.pipeService.onRoot("gh_model_update",{},async(e,t)=>{let r=await this.updateField(t.app_id,t.field_model);this.pipeService.emit("gh_model_update",{app_id:t.app_id,field_id:t.field_id},r)}),this.pipeService.onRoot("gh_models_get",{},async(e,t)=>{let r=await this.getFieldModels(t.app_id);this.pipeService.emit("gh_models_get",t,r)}),this.pipeService.onRoot("gh_model_delete",{},async(e,t)=>{let r=await this.deleteField(t.app_id,t.field_id);this.pipeService.emit("gh_model_delete",t,r)})}}class jo{constructor(e,t,r,a){this.storage=e,this.pipeService=t,this.req=r,this.appProcessor=a}async uploadFileApi(e,t,r){try{let a={"file-0":e,app_id:t,item_id:r};return await this.req.post({url:"/file/formupload",form:a})}catch(a){return console.log(a),null}}async uploadFileFromStringApi(e){try{return await this.req.post({url:"/file/upload",form:{file:JSON.stringify(e)}})}catch(t){return console.log(t),null}}async updateFileFromStringApi(e,t,r,a,i,l,s){try{let u={file_name:r,extension:a,file_id:t,format:i,source:e,alt:l,title:s};return await this.req.post({url:"/file/update",form:{file:JSON.stringify(u)}})}catch(u){return console.log(u),null}}async duplicateFileApi(e){return this.req.post({url:"/api/new/file/duplicate",headers:{"Content-Type":"application/x-www-form-urlencoded"},form:{files:JSON.stringify(e)}})}async downloadFileFromString(e,t){if(!await this.isFileExists(e,t))return!1;{let r=await this.getFile(e,t),a=await this.req.get({url:r.url+"?timestamp="+r.last_update,externalResource:!0});return{file:r,data:a,type:"file"}}}async duplicateFile(e){let t=await this.duplicateFileApi(e);return t.forEach(r=>{this.addFileToStorage(r.app_id,r)}),t}async deleteFileApi(e){try{return await this.req.get({url:\`/file/delete?file_id=\${e}\`})}catch(t){return console.log(t),null}}addFileToStorage(e,t){let r=this.storage.getApp(e);r&&(r.file_list.push(t),this.storage.updateApp(r),this.pipeService.emit("gh_file_upload",{app_id:e,item_id:t.item_id,file_id:t.file_id},t))}addFilesToStorage(e,t){let r=this.storage.getApp(e);r&&(r.file_list.push(...t),this.storage.updateApp(r),t.forEach(a=>{this.pipeService.emit("gh_file_upload",{app_id:e,item_id:a.item_id,file_id:a.file_id},a)}))}deleteFileFromStorage(e,t){let r=this.storage.getApp(t);if(r){let a;r.file_list=r.file_list.filter(i=>i.file_id!=e||(a=i,!1)),this.storage.updateApp(r),this.pipeService.emit("gh_file_delete",{file_id:e},a)}}updateFileInStorage(e,t,r){let a=this.storage.getApp(t);a&&(a.file_list=a.file_list.map(i=>i.file_id==e?r:i),this.storage.updateApp(a),this.pipeService.emit("gh_file_update",{file_id:e}))}async getFile(e,t){let r=await this.appProcessor.getApp(e);return new Promise((a,i)=>{a(r.file_list.find(l=>l.file_id==t)||"")})}async getFiles(e,t=[]){let r=await this.appProcessor.getApp(e);return new Promise((a,i)=>{a(r.file_list.filter(l=>t.some(s=>s==l.file_id))||"")})}async uploadFile(e,t,r){let a=await this.uploadFileApi(e,t,r);return this.addFileToStorage(t,a),a}async uploadFileFromString(e){let t=await this.uploadFileFromStringApi(e);return this.addFileToStorage(t.app_id,t),t}async updateFileFromString(e,t,r,a,i,l,s){let u=await this.updateFileFromStringApi(e,t,r,a,i,l,s);return this.updateFileInStorage(t,u.app_id,u),u}async deleteFile(e,t){return await this.deleteFileApi(e),this.deleteFileFromStorage(e,t),!0}async isFileExists(e,t){let r=/^(https?:\\/\\/)?([\\da-z\\.-]+)\\.([a-z\\.]{2,6})([\\/\\w \\.-]*)*\\/?$/;if(!t)return!1;{let a=await this.getFile(e,t);return!!a&&r.test(a.url)}}}class To{constructor(e,t){this.req=e,this.pipeService=t}createDocument(e){return this.emitDocumentInsert(e),this.req.post({url:"/api/new/document/insert-one",headers:{"Content-Type":"application/x-www-form-urlencoded"},form:{document:JSON.stringify(e)}})}emitDocumentInsert(e){let t=typeof e.data=="string"?JSON.parse(e.data):e.data;this.pipeService.emit("gh_document_insert_one",{app_id:e.app_id,item_id:e.item_id,element_id:e.element_id},t)}getDocument(e){return this.req.post({url:"/api/new/document/find-one",headers:{"Content-Type":"application/x-www-form-urlencoded"},form:{document:JSON.stringify(e)}})}getDocuments(e){return this.req.post({url:"/api/new/document/find",headers:{"Content-Type":"application/x-www-form-urlencoded"},form:{document:JSON.stringify(e)}})}deleteDocument(e){return this.req.post({url:"/api/new/document/remove-one",headers:{"Content-Type":"application/x-www-form-urlencoded"},form:{document:JSON.stringify(e)}})}}class Po{constructor(e){this.gudhub=e}async getInterpretationObj(e,t,r,a,i,l){var s=[],u=t.data_model.interpretation.find(function(p){return p.src==r})||t.data_model.interpretation.find(function(p){return p.src=="table"})||{id:"default"};if(e.data_model&&e.data_model.interpretation){for(var o=0;o<e.data_model.interpretation.length;o++)(e.data_model.interpretation[o].src==r||e.data_model.interpretation[o].src==a)&&s.push(e.data_model.interpretation[o]);for(var o=0;o<s.length;o++)if(s[o].settings&&s[o].settings.condition_filter&&s[o].settings.filters_list.length>0){let m=await gudhub.getItem(l,i);if(m&&gudhub.filter([m],s[o].settings.filters_list).length>0){u=s[o];break}}else u=gudhub.mergeObjects(u,s[o])}return u}getInterpretation(e,t,r,a,i,l,s){let u=this;return new Promise(async(o,p)=>{var m=t&&t.data_type?t.data_type:r;m?gudhub.ghconstructor.getInstance(m).then(async function(d){if(d){var y=await u.getInterpretationObj(t,d.getTemplate().model,a,s,i,l);d.getInterpretation(e,y.id,m,t,i,l).then(function(f){o(gudhub.mergeObjects(f,y))},function(f){p()})}},function(d){}):console.error("Get Interpretation: data_type is undefined",r,t)})}async getInterpretationById(e,t,r,a,i=null,l=null){let s=i??await this.gudhub.getFieldValue(e,t,r),u=l??await this.gudhub.getField(e,r);if(u==null)return"";let o=await this.gudhub.ghconstructor.getInstance(u.data_type),p=await o.getInterpretation(s,a,u.data_type,u,t,e);return p.html=="<span>no interpretation</span>"?s:p.html}}var Ee=A("5xozB");function Co(n,e){switch(e.api){case"/items/update":console.log("/items/update - ",e),n.itemProcessor.updateItemsInStorage(e.app_id,e.response);break;case"/items/add":console.log("/items/add - ",e),n.itemProcessor.addItemsToStorage(e.app_id,e.response);break;case"/items/delete":console.log("/items/delete - ",e),n.itemProcessor.deleteItemsFromStorage(e.app_id,e.response);break;case"/app/update":console.log("/app/update - ",e),n.appProcessor.updateAppFieldsAndViews(e.response);break;case"/file/delete":console.log("file/delete - ",e),n.fileManager.deleteFileFromStorage(e.response.file_id,e.app_id);break;case"/file/upload":console.log("file/upload - ",e),n.fileManager.addFileToStorage(e.app_id,e.response);break;case"/file/formupload":console.log("file/formupload - ",e);break;case"/file/update":n.fileManager.updateFileInStorage(e.response.file_id,e.response.app_id,e.response),console.log("file/update - ",e);break;case"/new/file/duplicate":n.fileManager.addFilesToStorage(e.app_id,e.response),console.log("new/file/duplicate - ",e);break;case"/api/new/document/insert-one":n.documentManager.emitDocumentInsert(e.response),console.log("/api/new/document/insert-one - ",e);break;case"/ws/emit-to-user":console.log("/ws/emit-to-user - ",e);break;case"/ws/broadcast-to-app-subscribers":console.log("/ws/broadcast-to-app-subscribers - ",e);let t=JSON.parse(e.response);if(!t.data_type)return;n.ghconstructor.getInstance(t.data_type).then(r=>{r.onMessage(e.app_id,e.user_id,t)});break;default:console.warn("WEBSOCKETS is not process this API:",e.api)}}class No{constructor(e,t){this.req=t,this.gudhub=e}async createGroupApi(e){try{let t={token:await this.gudhub.auth.getToken(),group_name:e};return await this.req.post({url:"/api/sharing-group/create-group",form:t})}catch(t){return console.log(t),null}}async updateGroupApi(e,t){try{let r={token:await this.gudhub.auth.getToken(),group_name:t,group_id:e};return await this.req.post({url:"/api/sharing-group/update-group",form:r})}catch(r){return console.log(r),null}}async deleteGroupApi(e){try{let t={token:await this.gudhub.auth.getToken(),group_id:e};return await this.req.post({url:"/api/sharing-group/delete-group",form:t})}catch(t){return console.log(t),null}}async addUserToGroupApi(e,t,r){try{let a={token:await this.gudhub.auth.getToken(),group_id:e,user_id:t,group_permission:r};return await this.req.post({url:"/api/sharing-group/add-user-to-group",form:a})}catch(a){return console.log(a),null}}async getUsersByGroupApi(e){try{let t={token:await this.gudhub.auth.getToken(),group_id:e};return await this.req.post({url:"/api/sharing-group/get-users-by-group",form:t})}catch(t){return console.log(t),null}}async updateUserInGroupApi(e,t,r){try{let a={token:await this.gudhub.auth.getToken(),user_id:e,group_id:t,group_permission:r};return await this.req.post({url:"/api/sharing-group/update-user-in-group",form:a})}catch(a){return console.log(a),null}}async deleteUserFromGroupApi(e,t){try{let r={token:await this.gudhub.auth.getToken(),user_id:e,group_id:t};return await this.req.post({url:"/api/sharing-group/delete-user-from-group",form:r})}catch(r){return console.log(r),null}}async getGroupsByUserApi(e){try{let t={token:await this.gudhub.auth.getToken(),user_id:e};return await this.req.post({url:"/api/sharing-group/get-groups-by-user",form:t})}catch(t){return console.log(t),null}}}class Mo{constructor(e,t){this.req=t,this.gudhub=e}async addAppToGroupApi(e,t,r){try{let a={token:await this.gudhub.auth.getToken(),app_id:e,group_id:t,app_permission:r};return await this.req.post({url:"/api/sharing-group/add-app-to-group",form:a})}catch(a){return console.log(a),null}}async getAppsByGroupApi(e){try{let t={token:await this.gudhub.auth.getToken(),group_id:e};return await this.req.post({url:"/api/sharing-group/get-apps-by-group",form:t})}catch(t){return console.log(t),null}}async updateAppInGroupApi(e,t,r){try{let a={token:await this.gudhub.auth.getToken(),group_id:t,app_id:e,app_permission:r};return await this.req.post({url:"/api/sharing-group/update-app-in-group",form:a})}catch(a){return console.log(a),null}}async deleteAppFromGroupApi(e,t,r){try{let a={token:await this.gudhub.auth.getToken(),group_id:t,app_id:e,app_permission:r};return await this.req.post({url:"/api/sharing-group/delete-app-from-group",form:a})}catch(a){return console.log(a),null}}async getGroupsByAppApi(e){try{let t={token:await this.gudhub.auth.getToken(),app_id:e};return await this.req.post({url:"/api/sharing-group/get-groups-by-app",form:t})}catch(t){return console.log(t),null}}}class Ro{constructor(e,t,r){this.req=t,this.gudhub=e,this.pipeService=r,this.groupManager=new No(e,t),this.appGroupSharing=new Mo(e,t)}createGroup(e){return this.groupManager.createGroupApi(e)}updateGroup(e,t){return this.groupManager.updateGroupApi(e,t)}deleteGroup(e){return this.groupManager.deleteGroupApi(e)}async addUserToGroup(e,t,r){let a=await this.groupManager.addUserToGroupApi(e,t,r);return this.pipeService.emit("group_members_add",{app_id:"group_sharing"},a),a}getUsersByGroup(e){return this.groupManager.getUsersByGroupApi(e)}async updateUserInGroup(e,t,r){let a=await this.groupManager.updateUserInGroupApi(e,t,r);return this.pipeService.emit("group_members_update",{app_id:"group_sharing"},a),a}async deleteUserFromGroup(e,t){let r=await this.groupManager.deleteUserFromGroupApi(e,t);return this.pipeService.emit("group_members_delete",{app_id:"group_sharing"},r),r}getGroupsByUser(e){return this.groupManager.getGroupsByUserApi(e)}addAppToGroup(e,t,r){return this.appGroupSharing.addAppToGroupApi(e,t,r)}getAppsByGroup(e){return this.appGroupSharing.getAppsByGroupApi(e)}updateAppInGroup(e,t,r){return this.appGroupSharing.updateAppInGroupApi(e,t,r)}deleteAppFromGroup(e,t,r){return this.appGroupSharing.deleteAppFromGroupApi(e,t,r)}getGroupsByApp(e){return this.appGroupSharing.getGroupsByAppApi(e)}}class Fo{constructor(e,t){this.req=t,this.gudhub=e}async add(e,t,r){try{let a={token:await this.gudhub.auth.getToken(),app_id:e,user_id:t,sharing_permission:r};return await this.req.post({url:"/sharing/add",form:a})}catch(a){return console.log(a),null}}async update(e,t,r){try{let a={token:await this.gudhub.auth.getToken(),app_id:e,user_id:t,sharing_permission:r};return await this.req.post({url:"/sharing/update",form:a})}catch(a){return console.log(a),null}}async delete(e,t){try{let r={token:await this.gudhub.auth.getToken(),app_id:e,user_id:t};return await this.req.post({url:"/sharing/delete",form:r})}catch(r){return console.log(r),null}}async getAppUsers(e){try{let t={token:await this.gudhub.auth.getToken(),app_id:e};return await this.req.post({url:"/sharing/get-app-users",form:t})}catch(t){return console.log(t),null}}async addInvitation(e,t){try{let r={token:await this.gudhub.auth.getToken(),guests_emails:e,apps:t};return await this.req.post({url:"/api/invitation/add",form:r})}catch(r){return console.log(r),null}}}class Lo{constructor(e){this.gudhub=e}async emitToUser(e,t){let r={user_id:e,data:typeof t=="object"?JSON.stringify(t):t};return await this.gudhub.req.post({url:"/ws/emit-to-user",form:r})}async broadcastToAppSubscribers(e,t,r){let a={app_id:e,data:JSON.stringify({data_type:t,data:r})};return await this.gudhub.req.post({url:"/ws/broadcast-to-app-subscribers",form:a})}}class Do{constructor(e,t={server_url:ia,wss_url:sa,node_server_url:oa,initWebsocket:!1,activateSW:!1,swLink:"",async_modules_path:la,file_server_url:ua,automation_modules_path:ca,accesstoken:this.accesstoken,expirydate:this.expirydate}){if(this.serialized={authKey:e,options:t},this.config=t,this.ghconstructor=new Ao(this),this.interpritate=new Po(this),this.pipeService=new Ci,this.storage=new Mi(t.async_modules_path,t.file_server_url,t.automation_modules_path),this.util=new So(this),this.req=new Ti(t.server_url),this.auth=new xo(this.req,this.storage),this.sharing=new Fo(this,this.req),this.groupSharing=new Ro(this,this.req,this.pipeService),e?this.storage.setUser({auth_key:e}):t.accesstoken&&t.expirydate&&this.storage.setUser({accesstoken:t.accesstoken,expirydate:t.expirydate}),this.req.init(this.auth.getToken.bind(this.auth)),this.ws=new Ri(t.wss_url,this.auth),this.initializeAppProcessor(),this.itemProcessor=new Io(this.storage,this.pipeService,this.req,this.appProcessor,this.util),this.fieldProcessor=new Oo(this.storage,this.req,this.appProcessor,this.itemProcessor,this.pipeService),this.fileManager=new jo(this.storage,this.pipeService,this.req,this.appProcessor),this.documentManager=new To(this.req,this.pipeService),this.websocketsemitter=new Lo(this),t.initWebsocket){let r=this;this.ws.initWebSocket(Co.bind(this,r),this.appProcessor.refreshApps.bind(this.appProcessor))}t.activateSW&&this.activateSW(t.swLink)}initializeAppProcessor(){this.appProcessor=new Dr(this.storage,this.pipeService,this.req,this.ws,this.util,this.config.activateSW,new Dt(this.req,Or,this))}async activateSW(e){if(Ee.IS_BROWSER_MAIN_THREAD&&"serviceWorker"in window.navigator)try{let t=await window.navigator.serviceWorker.register(e);t.update().then(()=>console.log("%cSW ->>> Service worker successful updated","display: inline-block ; background-color: #689f38 ; color: #ffffff ; font-weight: bold ; padding: 3px 7px; border-radius: 3px;")).catch(()=>console.warn("SW ->>> Service worker is not updated")),console.log("%cSW ->>> Service worker is registered","display: inline-block ; background-color: #689f38 ; color: #ffffff ; font-weight: bold ; padding: 3px 7px; border-radius: 3px;",t)}catch(t){console.warn("%cSW ->>> Service worker is not registered","display: inline-block ; background-color: #d32f2f ; color: #ffffff ; font-weight: bold ; padding: 3px 7px; border-radius: 3px;",t)}else console.log("%cSW ->>> ServiceWorkers not supported","display: inline-block ; background-color: #d32f2f ; color: #ffffff ; font-weight: bold ; padding: 3px 7px; border-radius: 3px;")}on(e,t,r){return this.pipeService.on(e,t,r),this}emit(e,t,r,a){return this.pipeService.emit(e,t,r,a),this}destroy(e,t,r){return this.pipeService.destroy(e,t,r),this}prefilter(e,t){return this.util.prefilter(e,t)}debounce(e,t){return this.util.debounce(e,t)}emitToUser(e,t){return this.websocketsemitter.emitToUser(e,t)}broadcastToAppSubscribers(e,t,r){return this.websocketsemitter.broadcastToAppSubscribers(e,t,r)}getInterpretation(e,t,r,a,i,l,s){return this.interpritate.getInterpretation(e,t,r,a,i,l,s)}getInterpretationById(e,t,r,a,i,l){return this.interpritate.getInterpretationById(e,t,r,a,i,l)}filter(e,t){return this.util.filter(e,t)}mergeFilters(e,t){return this.util.mergeFilters(e,t)}group(e,t){return this.util.group(e,t)}getFilteredItems(e,t,r={}){return this.util.getFilteredItems(e,t,r.element_app_id,r.app_id,r.item_id,r.field_group,r.search,r.search_params)}sortItems(e,t){return this.util.sortItems(e,t)}triggerAppChange(e,t,r){this.itemProcessor.handleItemsChange(e,t,r),this.appProcessor.handleAppChange(e,t,r)}triggerIemsChange(e,t){this.itemProcessor.triggerItemsChange(e,t)}jsonToItems(e,t){return this.util.jsonToItems(e,t)}getDate(e){return this.util.getDate(e)}populateWithDate(e,t){return this.util.populateWithDate(e,t)}checkRecurringDate(e,t){return this.util.checkRecurringDate(e,t)}populateItems(e,t,r){return this.util.populateItems(e,t,r)}populateWithItemRef(e,t,r,a,i,l){return this.util.populateWithItemRef(e,t,r,a,i,l)}compareItems(e,t,r){return this.util.compareItems(e,t,r)}mergeItems(e,t,r){return this.util.mergeItems(e,t,r)}mergeObjects(e,t){return this.util.mergeObjects(e,t)}makeNestedList(e,t,r,a,i){return this.util.makeNestedList(e,t,r,a,i)}jsonConstructor(e,t,r,a){return this.util.jsonConstructor(e,t,r,a)}getAppsList(){return this.appProcessor.getAppsList()}getAppInfo(e){return this.appProcessor.getAppInfo(e)}deleteApp(e){return this.appProcessor.deleteApp(e)}getApp(e){return this.appProcessor.getApp(e)}updateApp(e){return this.appProcessor.updateApp(e)}updateAppInfo(e){return this.appProcessor.updateAppInfo(e)}createNewApp(e){return this.appProcessor.createNewApp(e)}getItems(e){return this.itemProcessor.getItems(e)}async getItem(e,t){let r=await this.getItems(e);if(r)return r.find(a=>a.item_id==t)}addNewItems(e,t){return this.itemProcessor.addNewItems(e,t)}updateItems(e,t){return this.itemProcessor.updateItems(e,t)}deleteItems(e,t){return this.itemProcessor.deleteItems(e,t)}getField(e,t){return this.fieldProcessor.getField(e,t)}getFieldIdByNameSpace(e,t){return this.fieldProcessor.getFieldIdByNameSpace(e,t)}getFieldModels(e){return this.fieldProcessor.getFieldModels(e)}updateField(e,t){return this.fieldProcessor.updateField(e,t)}deleteField(e,t){return this.fieldProcessor.deleteField(e,t)}getFieldValue(e,t,r){return this.fieldProcessor.getFieldValue(e,t,r)}setFieldValue(e,t,r,a){return this.fieldProcessor.setFieldValue(e,t,r,a)}getFile(e,t){return this.fileManager.getFile(e,t)}getFiles(e,t){return this.fileManager.getFiles(e,t)}uploadFile(e,t,r){return this.fileManager.uploadFile(e,t,r)}uploadFileFromString(e,t,r,a,i,l,s){return this.fileManager.uploadFileFromString(e,t,r,a,i,l,s)}updateFileFromString(e,t,r,a,i,l,s){return this.fileManager.updateFileFromString(e,t,r,a,i,l,s)}deleteFile(e,t){return this.fileManager.deleteFile(e,t)}duplicateFile(e){return this.fileManager.duplicateFile(e)}downloadFileFromString(e,t){return this.fileManager.downloadFileFromString(e,t)}createDocument(e){return this.documentManager.createDocument(e)}getDocument(e){return this.documentManager.getDocument(e)}getDocuments(e){return this.documentManager.getDocuments(e)}deleteDocument(e){return this.documentManager.deleteDocument(e)}login(e){return this.auth.login(e)}loginWithToken(e){return this.auth.loginWithToken(e)}logout(e){return this.appProcessor.clearAppProcessor(),this.auth.logout(e)}signup(e){return this.auth.signup(e)}getUsersList(e){return this.auth.getUsersList(e)}updateToken(e){return this.auth.updateToken(e)}avatarUploadApi(e){return this.auth.avatarUploadApi(e)}getVersion(){return this.auth.getVersion()}getUserById(e){return this.auth.getUserById(e)}getToken(){return this.auth.getToken()}updateUser(e){return this.auth.updateUser(e)}updateAvatar(e){return this.auth.updateAvatar(e)}}class qo extends Do{initializeAppProcessor(){this.appProcessor=new Dr(this.storage,this.pipeService,this.req,this.ws,this.util,!1,new Qe(this.req,null,this))}}let Ue={},mt={},Hn={};self.onmessage=async function(n){if(n.data.type==="init"&&(n.data.gudhubSerialized.options.initWebsocket=!1,mt=new Wt((Ue=new qo(n.data.gudhubSerialized.authKey,n.data.gudhubSerialized.options)).req,vt,Ue),Hn=new at(Ue.req,wt,Ue)),n.data.type==="processData"){let e=await mt.getCached(n.data.id),t=e.chunks,r=await mt.getAppWithoutProcessing(n.data.id),a=!0;if(t.length!=r.chunks.length&&(a=!1),r.chunks.some(u=>!t.includes(u))&&(a=!1),!a){let u=await Hn.getCachedMergedChunk(n.data.id,e.chunks);u&&(e.items_list=await Ue.util.mergeChunks([u,e])),r=await mt.getApp(n.data.id)}let i=Ue.compareItems(r.items_list,e.items_list),l=Ue.util.areViewListsEqual(e.views_list,r.views_list),s=Ue.util.areFieldListsEqual(e.field_list,r.field_list);this.postMessage({id:n.data.id,compareRes:i,newVersion:r,type:n.data.type,viewListChanged:l,fieldListChanged:s})}if(n.data.type==="requestApp"){let e=await mt.getApp(n.data.id);this.postMessage({id:n.data.id,type:n.data.type,data:e})}}})()})();
15321
+ });\`}function $o(n,e,t,r,a){async function i(d,y,f){let S=null;if(d.type==="array"&&(S=Number(d.is_static)?Array(await u(d.childs,y,f)):await l(d,y,f)),d.type==="object"&&(S=Number(d.current_item)?await s(d,y):await u(d.childs,y,f)),d.type==="property"&&(S=await o(d,y,f)),typeof d=="object"&&d.type===void 0){let v={};for(let w in d)if(d.hasOwnProperty(w)){let g=d[w],_=await i(g,y,f);v[w]=_[g.property_name]}return v}return{[d.property_name]:S}}async function l(d,y,f){let S=await t.gudhub.getApp(Number(d.app_id)),v=await m(d.filter,S.items_list,f,y);if(d.isSortable&&d.field_id_to_sort&&d.field_id_to_sort!==""){let w=v.flatMap(_=>{let $=_.fields.find(x=>x.field_id==d.field_id_to_sort);return $&&$.field_value!=""?_:[]}),g=v.filter(_=>{if(!w.includes(_))return _});v=[...w=w.sort((_,$)=>d.sortType=="desc"?$.fields.find(x=>x.field_id==d.field_id_to_sort).field_value-_.fields.find(x=>x.field_id==d.field_id_to_sort).field_value:_.fields.find(x=>x.field_id==d.field_id_to_sort).field_value-$.fields.find(x=>x.field_id==d.field_id_to_sort).field_value),...g]}if(d.offset){let w;w=d.use_variables_for_limit_and_offset&&r?r[d.offset]:/^[0-9]+$/.test(d.offset)?d.offset:0,v=v.slice(w)}if(d.limit){let w;(w=d.use_variables_for_limit_and_offset&&r?r[d.limit]:/^[0-9]+$/.test(d.limit)||0)!==0&&(v=v.slice(0,w))}return Promise.all(v.map(async w=>u(d.childs,w,S.app_id)))}async function s(d,y){let f=await t.gudhub.getApp(d.app_id),S=f.items_list||[];return u(d.childs,y||S[0],f.app_id)}async function u(d,y,f){let S=await d.map(async v=>i(v,y,f));return(await Promise.all(S)).reduce((v,w)=>({...v,...w}),{})}async function o(d,y,f){switch(d.property_type){case"static":return d.static_field_value;case"variable":return d.variable_type==="app_id"?f:\`\${f}.\${y.item_id}\`;case"field_id":return d.field_id;case"function":return typeof d.function=="function"?d.function(y,f,t.gudhub,...d.args):await Function("item, appId, gudhub","return (async "+d.function+")(item, appId, gudhub)")(y,f,t.gudhub);default:return!d.field_id&&d.name_space&&(d.field_id=await t.gudhub.getFieldIdByNameSpace(f,d.name_space)),Number(d.interpretation)?await t.gudhub.getInterpretationById(Number(f),Number(y.item_id),Number(d.field_id),"value"):await t.gudhub.getFieldValue(Number(f),Number(y.item_id),Number(d.field_id))}}async function p(d,y,f,S,v){let w=await t.gudhub.prefilter(JSON.parse(JSON.stringify(d)),{element_app_id:y,app_id:f,item_id:S,...r});return t.gudhub.filter(v,[...w,...d])}async function m(d=[],y=[],f="",S={}){return d.length?p(d,f,f,S.item_id,y):[...y]}return i(n,e,a)}class So{constructor(e){this.gudhub=e,this.appsConnectingMap={apps:[],fields:[],items:[],views:[]}}createAppsFromTemplate(e,t,r,a){let i=this;return new Promise(l=>{let s=100/(6*e.apps.length),u=0;i.createApps(e,o=>{u+=1,r&&r.call(this,{percent:u*s,status:o})},a).then(o=>{i.createItems(o,t,p=>{typeof p=="string"?(u+=1,r&&r.call(this,{percent:u*s,status:p})):typeof p=="object"&&(r&&r.call(this,{status:"Done",apps:p}),l())},a)})})}createItems(e,t,r,a){return new Promise(async i=>{let l=t||1e5,s=this,u=[],o=[],{accesstoken:p}=await s.gudhub.req.axiosRequest({method:"POST",url:"https://gudhub.com/GudHub_Test/auth/login",form:{auth_key:"3HMOtCbC0M/1/1e4y4Uxo/Kh/aFN4V5LG2//5ixx7TZyiUfMb7IHAAHCj9PsLrOSDrZuuWkbX4BIX23f51H+eA=="}});e.forEach(m=>{o.push(new Promise(async d=>{let y;y=a?await s.gudhub.req.axiosRequest({url:\`https://gudhub.com/GudHub_Test/api/app/get?token=\${p}&app_id=\${s._searchOldAppId(m.app_id,s.appsConnectingMap.apps)}\`,method:"GET"}):await s.gudhub.getApp(s._searchOldAppId(m.app_id,s.appsConnectingMap.apps)),r&&r.call(this,\`GET APP: \${y.app_name} (Items steps)\`);let f=JSON.parse(JSON.stringify(y)),S=f.items_list.map(v=>({index_number:v.index_number,item_id:0,fields:[]})).filter((v,w)=>w<=l);s.gudhub.addNewItems(m.app_id,S).then(v=>{r&&r.call(this,\`ADD NEW ITEMS: \${y.app_name} (Items steps)\`),m.items_list=v,s._updateMap(m.items_list,f.items_list),s._addFieldValue(f.items_list,m.items_list,s.appsConnectingMap),u.push(m),d()})}))}),Promise.all(o).then(()=>{u.forEach(m=>{m.items_list.forEach(d=>{d.fields.forEach(y=>{s.appsConnectingMap.fields.forEach(f=>{y.field_id===f.old_field_id&&(y.field_id=f.new_field_id,y.element_id=f.new_field_id)})})})}),s.deleteField(u),s.replaceValue(u,s.appsConnectingMap).then(()=>{let m=[];u.forEach(d=>{m.push(new Promise(y=>{let f=d.items_list.map(S=>(S.fields.forEach(v=>{delete v.data_id}),S));s.gudhub.updateItems(d.app_id,f).then(()=>{r&&r.call(this,\`REPLACE VALUE: \${d.app_name} (Items steps)\`),y()})}))}),Promise.all(m).then(()=>{r.call(this,u),i()})})})})}deleteField(e){e.forEach(t=>{t.items_list.forEach(r=>{r.fields=r.fields.filter(a=>t.field_list.findIndex(i=>i.field_id==a.field_id)>-1)})})}replaceValue(e,t){return new Promise(async r=>{let a=[],i=this;e.forEach(l=>{l.field_list.forEach(s=>{s.data_type==="item_ref"&&i._replaceValueItemRef(l,s,t),a.push(new Promise(u=>{i.gudhub.ghconstructor.getInstance(s.data_type).then(o=>{if(o===void 0){console.log("ERROR WHILE GETTING INSTANCE OF ",s.data_type),u({type:s.data_type});return}if(o.getTemplate().constructor=="file")return i.gudhub.util.fileInstallerHelper(l.app_id,l.items_list,s.field_id).then(p=>{u(p)});o.getTemplate().constructor=="document"?i.documentInstallerHelper(l.app_id,l.items_list,s.field_id).then(p=>{u(o)}):u(o)})}))})}),a.length>0?Promise.all(a).then(l=>{r(l)}):r(result)})}documentInstallerHelper(e,t,r){let a=this,i=[];return new Promise(async l=>{for(let s of t){let u=s.item_id,o=s.fields.find(p=>p.element_id===r);if(o&&o.field_value&&o.field_value.length>0){let p=await a.gudhub.getDocument({_id:o.field_value});if(p&&p.data){let m=await a.gudhub.createDocument({app_id:e,item_id:u,element_id:r,data:p.data});o.field_value=m._id,i.push(s)}}}l(i)})}_replaceValueItemRef(e,t,r){e.items_list.forEach(a=>{a.fields.forEach(i=>{if(i.field_id===t.field_id&&i.field_value){let l=i.field_value.split(",");l.forEach((s,u)=>{let o=s.split(".");r.apps.forEach(p=>{o[0]==p.old_app_id&&(o[0]=p.new_app_id)}),r.items.forEach(p=>{o[1]==p.old_item_id&&(o[1]=p.new_item_id)}),l[u]=o.join(".")}),i.field_value=l.join(",")}})})}_addFieldValue(e,t,r){t.forEach(a=>{r.items.forEach(i=>{a.item_id===i.new_item_id&&e.forEach(l=>{i.old_item_id===l.item_id&&(a.fields=l.fields)})})})}_updateMap(e,t){t.forEach(r=>{e.forEach(a=>{r.index_number===a.index_number&&this.appsConnectingMap.items.push({old_item_id:r.item_id,new_item_id:a.item_id})})})}_searchOldAppId(e,t){let r=0;return t.forEach(a=>{a.new_app_id===e&&(r=a.old_app_id)}),r}createApps(e,t,r){let a=this,i={step_size:100/(3*e.apps.length),apps:[]};return new Promise(async l=>{let s={},u=[],o=[],{accesstoken:p}=await a.gudhub.req.axiosRequest({method:"POST",url:"https://gudhub.com/GudHub_Test/auth/login",form:{auth_key:"3HMOtCbC0M/1/1e4y4Uxo/Kh/aFN4V5LG2//5ixx7TZyiUfMb7IHAAHCj9PsLrOSDrZuuWkbX4BIX23f51H+eA=="}});for(let m of e.apps){let d;d=r?await a.gudhub.req.axiosRequest({url:\`https://gudhub.com/GudHub_Test/api/app/get?token=\${p}&app_id=\${m}\`,method:"GET"}):await a.gudhub.getApp(m),t&&t.call(this,\`GET APP: \${d.app_name} (App steps)\`);let y=JSON.parse(JSON.stringify(d));s[y.app_id]=y,i.apps.push(y.icon);let f=a.prepareAppTemplate(y);f.app_name=f.app_name+" New",f.privacy=1,e.data_to_change&&(e.data_to_change.name&&(f.app_name=e.data_to_change.name),e.data_to_change.icon&&(f.icon=e.data_to_change.icon)),a.resetViewsIds(f),a.gudhub.createNewApp(f).then(S=>{t&&t.call(this,\`CREATE NEW APP: \${d.app_name} (App steps)\`),u.push(S),a.mapApp(y,S,a.appsConnectingMap),e.apps.length==u.length&&(a.connectApps(u,a.appsConnectingMap,s),u.forEach(v=>{a.gudhub.updateApp(v).then(w=>{t&&t.call(this,\`UPDATE APP: \${d.app_name} (App steps)\`),o.push(w),e.apps.length==o.length&&l(o)})}))})}})}mapApp(e,t,r){r.apps.push({old_app_id:e.app_id,new_app_id:t.app_id,old_view_init:e.view_init,new_view_init:t.view_init}),e.field_list.forEach(a=>{t.field_list.forEach(i=>{a.name_space==i.name_space&&r.fields.push({name_space:a.name_space,old_field_id:a.field_id,new_field_id:i.field_id})})}),e.views_list.forEach(a=>{t.views_list.forEach(i=>{a.name==i.name&&r.views.push({name:a.name,old_view_id:a.view_id,new_view_id:i.view_id})})})}crawling(e,t){let r=e===null?[]:Object.keys(e),a=this;r.length>0&&r.forEach(i=>{let l=e[i];l!==void 0&&typeof e!="string"&&(t(i,l,e),a.crawling(l,t))})}resetViewsIds(e){e.view_init=0,this.crawling(e.views_list,function(t,r,a){(t=="view_id"||t=="container_id")&&(a[t]=0)})}connectApps(e,t,r){let a=this;return e.forEach(i=>{t.apps.forEach(l=>{i.view_init===l.new_view_init&&t.views.forEach(s=>{l.old_view_init===s.old_view_id&&(i.view_init=s.new_view_id)})}),a.crawling(i.field_list,function(l,s,u){if(l.indexOf("field_id")!==-1||l.indexOf("FieldId")!==-1||l.indexOf("destination_field")!==-1){let o=String(s).split(","),p=[];t.fields.forEach(m=>{o.forEach(d=>{d==m.old_field_id&&p.push(m.new_field_id)})}),p.length&&(u[l]=p.join(","))}if((l.indexOf("app_id")!=-1||l.indexOf("AppId")!=-1||l.indexOf("destination_app")!=-1)&&t.apps.forEach(o=>{s==o.old_app_id&&(u[l]=o.new_app_id)}),l.indexOf("view_id")!==-1&&t.views.forEach(o=>{s==o.old_view_id&&(u[l]=o.new_view_id)}),l.indexOf("src")!==-1&&isFinite(s)){let o="container_id",p=t.apps.find(d=>d.new_app_id===i.app_id).old_app_id,m=a.findPath(r[p].views_list,o,s);u[l]=\`\${a.getValueByPath(i.views_list,m,o)}\`}if(l.indexOf("trigger")!==-1&&s.model&&s.model.nodes){let o=s.model.nodes,p=["inputs","outputs"];for(let m in o)p.forEach(d=>{let y=o[m];Object.keys(y[d]).filter(f=>f!==""&&!isNaN(f)).forEach(f=>{let S=t.fields.filter(v=>v.old_field_id==f);if(S.length!==0&&S[0].new_field_id){let v=S[0].new_field_id.toString(),w=y[d][f];w.connections.forEach(g=>{g.input==f&&(g.input=v),g.output==f&&(g.output=v)}),delete y[d][f],y[d][v]=w}})})}})}),e}getValueByPath(e,t,r){let a=e;return t.split(".").forEach(i=>{a=a[i]}),a[r]}findPath(e,t,r){let a=this,i=!1,l=!1,s=[];return a.crawling(e,function(u,o,p){l&&s.reverse().forEach(m=>{l&&(m.delete=!0,m.parent===p&&(l=!1,(s=s.filter(d=>!d.delete)).reverse()))}),i||(typeof p[u]=="object"&&s.push({prop:u,parent:p}),o==r&&t===u?i=!0:Object.keys(p).pop()!==u||typeof p[u]=="object"||(l=!0))}),s.map(u=>u.prop).join(".")}prepareAppTemplate(e){let t=this,r=JSON.parse(JSON.stringify(e));return t.crawling(r.views_list,function(a,i,l){a=="element_id"&&(l.element_id=-Number(i),l.create_element=-Number(i))}),r.field_list.forEach(a=>{a.create_field=-Number(a.field_id),a.element_id=-Number(a.field_id),a.field_id=-Number(a.field_id),a.field_value=""}),r.items_list=[],delete r.app_id,delete r.icon.id,delete r.group_id,delete r.trash,delete r.last_update,delete r.file_list,r}}class xo{constructor(e){this.gudhub=e}fileInstallerHelper(e,t,r){let a=this;return new Promise(i=>{let l=[[]],s=Promise.resolve(),u=[];t.forEach(o=>{let p=o.item_id,m=o.fields.find(d=>d.element_id===r);m&&m.field_value&&m.field_value.split(".").forEach(d=>{let y={source:d,destination:{app_id:e,item_id:p,element_id:r}};l[l.length-1].length!==10?l[l.length-1].push(y):l.push([y])})}),l.forEach(o=>{s=s.then(()=>a.gudhub.duplicateFile(o)).then(p=>{u=[...u,...p]})}),s.then(()=>{t.forEach(o=>{let p=o.item_id,m=o.fields.find(d=>d.element_id===r);m&&m.field_value&&(m.field_value="",u.forEach(d=>{d.item_id===p&&(m.field_value=m.field_value.split(",").filter(y=>y).concat(d.file_id).join(","))}))}),i()})})}}function Eo(n,e){return JSON.stringify(n)===JSON.stringify(e)}async function Jn(n){await Promise.all(n);let e=!0;for(let t of n){let r=await ko(t);if(r.state==="pending"){e=!1;break}if(r.state==="rejected")throw r.reason}return!!e||Jn(n)}function ko(n){let e={state:"pending"};return Promise.race([n,e]).then(t=>t===e?t:{state:"resolved",value:t},t=>({state:"rejected",reason:t}))}function Ao(n,e){if(!n||!n.length)return[];if(!n[0].fields.length)return n;var t=e&&e.sort_field_id||n[0].fields[0].field_id;function r(a){for(var i=null,l=0;l<a.fields.length;l++)if(a.fields[l].field_id==t){i=a.fields[l].field_value;break}return i}return n.sort(function(a,i){var l=r(a),s=r(i);return l===null?-1:s===null?1:/^\\d+$/.test(l)&&/^\\d+$/.test(s)?Number(l)<Number(s)?-1:1:/^\\d+$/.test(l)||/^\\d+$/.test(s)?/^\\d+$/.test(l)?-1:1:l.toLowerCase()>s.toLowerCase()?1:-1}),e&&e.descending?n.reverse():n}class Io{constructor(e){this.gudhub=e,this.MergeFields=new bo(e),this.ItemsSelection=new vo(e),this.AppsTemplateService=new So(e),this.FileHelper=new xo(e)}prefilter(e,t={}){return Ui(e,this.gudhub.storage,this.gudhub.pipeService,t)}filter(e,t){return Is(e,t)}mergeFilters(e,t){return Fs(e,t)}group(e,t){return Vs(e,t)}async getFilteredItems(e=[],t=[],r,a,i,l="",s,u){let o=await this.prefilter(t,{element_app_id:r,app_id:a,item_id:i}),p=this.filter(e,o);return this.group(l,p).filter(m=>!s||Ln([m],s).length===1).filter(m=>!u||Ln([m],u).length===1)}jsonToItems(e,t){return Ls(e,t)}getDate(e){return Ft(e)}checkRecurringDate(e,t){return fo(e,t)}populateItems(e,t,r){return Js(e,t,r)}populateWithDate(e,t){return uo(e,t)}populateWithItemRef(e,t,r,a,i,l){return Bs(e,t,r,a,i,l)}compareItems(e,t,r){return Gs(e,t,r)}mergeItems(e,t,r){return Us(e,t,r)}mergeObjects(e,t,r){return ho(e,t,r)}makeNestedList(e,t,r,a,i){return _o(e,t,r,a,i)}async mergeChunks(e){return yo(e)}mergeFieldLists(e,t){return this.MergeFields.mergeFieldLists(e,t)}createFieldsListToView(e,t){return this.MergeFields.createFieldsListToView(e,t)}createFieldsListToViewWithDataType(e,t){return this.MergeFields.createFieldsListToViewWithDataType(e,t)}selectItems(e,t){return this.ItemsSelection.selectItems(e,t)}getSelectedItems(e){return this.ItemsSelection.getSelectedItems(e)}clearSelectedItems(e){return this.ItemsSelection.clearSelectedItems(e)}isItemSelected(e,t){return this.ItemsSelection.isItemSelected(e,t)}jsonConstructor(e,t,r,a){return $o(e,t,this,r,a)}fileInstallerHelper(e,t,r){return this.FileHelper.fileInstallerHelper(e,t,r)}createAppsFromTemplate(e,t,r,a){return this.AppsTemplateService.createAppsFromTemplate(e,t,r,a)}createApps(e){return this.AppsTemplateService.createApps(e)}createItems(e,t){return this.AppsTemplateService.createItems(e,t)}areViewListsEqual(e,t){let r=e.sort((i,l)=>i.view_id-l.view_id),a=t.sort((i,l)=>i.view_id-l.view_id);return this.compareObjects(r,a)}areFieldListsEqual(e,t){let r=e.sort((i,l)=>i.field_id-l.field_id),a=t.sort((i,l)=>i.field_id-l.field_id);return this.compareObjects(r,a)}compareObjects(e,t){return Eo(e,t)}compareAppsItemsLists(e,t,r){let a=new Blob([wo()],{type:"application/javascript"});this.worker=new Worker(URL.createObjectURL(a)),this.worker.postMessage({items_list1:e,items_list2:t}),this.worker.addEventListener("message",i=>{let{diff:l}=i.data;r(l)})}dynamicPromiseAll(e){return Jn(e)}sortItems(e,t){return Ao(e,t)}debounce(e,t){let r;return function(...a){clearTimeout(r),r=setTimeout(()=>{e.apply(this,a)},t)}}}class Oo{constructor(e,t){this.req=e,this.storage=t}async login({username:e,password:t}={}){let r=await this.loginApi(e,t);return this.storage.updateUser(r),r}async loginWithToken(e){let t=await this.loginWithTokenApi(e);return this.storage.updateUser(t),t}async logout(e){return await this.logoutApi(e)}async signup(e){return await this.signupApi(e)}async updateToken(e){return await this.updateTokenApi(e)}async updateUser(e){let t=await this.updateUserApi(e);return this.storage.updateUser(t),t}async updateAvatar(e){let t=await this.avatarUploadApi(e);return this.storage.updateUser(t),t}async getUsersList(e){return await this.getUsersListApi(e)}async loginApi(e,t){try{return await this.req.axiosRequest({method:"POST",url:\`\${this.req.root}/auth/login\`,form:{username:e,password:t}})}catch(r){console.log(r)}}async loginWithTokenApi(e){try{return await this.req.axiosRequest({method:"POST",url:\`\${this.req.root}/auth/login?accesstoken=\${e}\`})}catch(t){console.log(t)}}async updateTokenApi(e){try{return await this.req.axiosRequest({method:"POST",url:\`\${this.req.root}/auth/login\`,form:{auth_key:e}})}catch(t){console.log(t)}}logoutApi(e){return this.req.post({url:"/auth/logout",form:{token:e}})}signupApi(e){return this.req.axiosRequest({method:"POST",url:\`\${this.req.root}/auth/singup\`,form:{user:JSON.stringify(e)}})}getUsersListApi(e){return this.req.get({url:"/auth/userlist",params:{keyword:e}})}updateUserApi(e){return this.req.post({url:"/auth/updateuser",form:{user:JSON.stringify(e)}})}avatarUploadApi(e){return this.req.post({url:"/auth/avatar-upload",form:{image:e}})}getUserByIdApi(e){return this.req.get({url:"/auth/getuserbyid",params:{id:e}})}getVersion(){return this.req.get({url:"/version"})}getUserFromStorage(e){return this.storage.getUsersList().find(t=>t.user_id==e)}saveUserToStorage(e){let t=this.storage.getUsersList();return t.find(r=>r.user_id==e.user_id)||(t.push(e),e)}async getUserById(e){let t=this.getUserFromStorage(e);if(!t){let r=await this.getUserByIdApi(e);if(!r)return null;(t=this.getUserFromStorage(e))||(this.saveUserToStorage(r),t=r)}return t}async getToken(){let e=new Date(this.storage.getUser().expirydate),t=new Date,r=this.storage.getUser().accesstoken;if(e<t||!r){let a=await this.updateToken(this.storage.getUser().auth_key);this.storage.updateUser(a),r=a.accesstoken}return r}}var jo=A("kmcAT"),gt=A("akXK4"),me=A("5xozB");async function To(n,e,t,r,a){try{let i;t||console.error(\`JS link must be provided for this data type - \${e}\`);let l=o=>(me.IS_BROWSER_MAIN_THREAD||(le.window=proxy,le.document=a.document,le.Element=a.Element,le.CharacterData=a.CharacterData,le.this=proxy,le.self=proxy,le.Blob=a.Blob,le.Node=a.Node,le.navigator=a.navigator,le.HTMLElement=a.HTMLElement,le.XMLHttpRequest=a.XMLHttpRequest,le.WebSocket=a.WebSocket,le.crypto=a.crypto,le.DOMParser=a.DOMParser,le.Symbol=a.Symbol,le.document.queryCommandSupported=p=>(console.log("QUERY COMMAND SUPPORTED: ",p),!1),le.angular=angular),new Promise(async p=>{let m=await G(gt).get(o).catch(f=>{console.log(\`Failed to fetch: \${o} in ghconstructor. Module id: \${e}\`)}),d=encodeURIComponent(m.data),y="data:text/javascript;charset=utf-8,"+d;p(y)})),s=await l(t);try{i=await import(s)}catch(o){console.log(\`Error while importing module: \${e}\`),console.log(o)}let u=new i.default(e);if(r&&me.IS_BROWSER){let o=document.createElement("link");o.href=r,o.setAttribute("data-module",e),o.setAttribute("rel","stylesheet"),document.getElementsByTagName("head")[0].appendChild(o)}return{type:e,getTemplate:function(o,p,m,d,y,f){let S=m!=="false";return u.getTemplate(o,p,S,d,y,f)},getDefaultValue:function(o,p,m,d){return new Promise(async y=>{let f=u.getDefaultValue;if(f){let S=await f(o,p,m,d);y(S)}else y(null)})},getSettings:function(o,p,m){return u.getSettings(o,p,m)},filter:{getSearchOptions:function(o){let p=u;return p.filter&&p.filter.getSearchOptions?u.filter.getSearchOptions(o):[]},getDropdownValues:function(){let o=u;return o.filter&&o.filter.getDropdownValues?o.filter.getDropdownValues():[]}},getInterpretation:function(o,p,m,d,y,f){return new Promise(async S=>{let v=u;try{let w=await v.getInterpretation(n,o,f,y,d,m),g=w.find($=>$.id==p)||w.find($=>$.id=="default"),_=await g.content();S({html:_})}catch(w){console.log(\`ERROR IN \${e}\`,w),S({html:"<span>no interpretation</span>"})}})},getInterpretationsList:function(o,p,m,d){return u.getInterpretation(o,p,m,d)},getInterpretatedValue:function(o,p,m,d){return new Promise(async y=>{let f=u.getInterpretatedValue;if(f){let S=await f(o,p,m,d);y(S)}else y(o)})},onMessage:function(o,p,m){return new Promise(async d=>{let y=u.onMessage;if(y){let f=await y(o,p,m);d(f)}d(null)})},extendController:function(o){u.getActionScope(o)},runAction:function(o){try{u.runAction(o)}catch{}},getWindowScope:function(o){return u.getWindowScope(o)},getWindowHTML:function(o){return u.getWindowHTML(o)}}}catch(i){console.log(i),console.log(\`Failed in createClassInstance (ghconstructor). Module id: \${e}. JS url: \${t}\`)}}class Po{constructor(e){this.gudhub=e,this.cache={},this.modulesQueue={},this.angularInjector,this.nodeWindow}async getInstance(e){return this.getCached(e)||(this.modulesQueue[e]||(this.modulesQueue[e]=this.createInstance(e)),await this.modulesQueue[e]),this.getCached(e)}pupToCache(e,t){this.cache[e]=t}getCached(e){return this.cache[e]}initAngularInjector(e){this.angularInjector=e}initJsdomWindow(e){this.nodeWindow=e}async createInstance(e){let t,r=this.gudhub.storage.getModuleUrl(e);if(!r){console.log(\`Cannot find module: \${e}\`);return}return r.type==="gh_element"&&(r.technology==="angular"?t=await G(jo)(this.gudhub,e,r.url,this.angularInjector,this.nodeWindow):r.technology==="class"&&(t=await To(this.gudhub,e,r.js,r.css,this.nodeWindow))),t&&this.pupToCache(e,t),t}}class Co{constructor(e,t,r,a,i){this.storage=e,this.pipeService=t,this.req=r,this.appProcessor=a,this.util=i,this.itemListeners()}async addItemsApi(e,t){try{return await this.req.post({url:"/api/items/add",form:{items:JSON.stringify(t),app_id:e}})}catch(r){return console.log(r),null}}async updateItemsApi(e,t){try{return await this.req.post({url:"/api/items/update",form:{items:JSON.stringify(t),app_id:e}})}catch(r){return console.log(r),null}}deleteItemsApi(e){try{let t=this.req.post({url:"/api/items/delete",form:{items_ids:JSON.stringify(e)}});return t.from_apps_list=!0,t}catch(t){return console.log(t),null}}async addItemsToStorage(e,t){let r=await this.appProcessor.getApp(e);return r&&(t.forEach(a=>{r.items_list.push(a),r.items_object[a.item_id]={};for(let i=0;i<a.fields.length;i++)r.items_object[a.item_id][a.fields[i].field_id]=a.fields[i];this.pipeService.emit("gh_item_update",{app_id:e},[a])}),this.pipeService.emit("gh_items_update",{app_id:e},r.items_list),this.storage.updateApp(r)),r}async updateItemsInStorage(e,t){this.pipeService.emit("gh_items_update",{app_id:e},t);let r=await this.appProcessor.getApp(e);return r&&t&&t.forEach(a=>{let i={app_id:e};this.pipeService.emit("gh_item_update",i,[a]),i.item_id=a.item_id,this.pipeService.emit("gh_item_update",i,a);let l=r.items_list.find(s=>s.item_id==a.item_id);l&&a.fields.forEach(s=>{let u=l.fields.find(o=>o.field_id==s.field_id);i.field_id=s.field_id,u?u.field_value!=s.field_value&&(u.field_value=s.field_value,r.items_object[l.item_id][u.field_id]=u,this.pipeService.emit("gh_value_update",i,s.field_value)):(l.fields.push(s),r.items_object[l.item_id][s.field_id]=s,this.pipeService.emit("gh_value_update",i,s.field_value))})}),t}handleDiff(e,t){this.updateItemsInStorage(e,t.diff_src_items),this.addItemsToStorage(e,t.new_src_items),this.deleteItemsFromStorage(e,t.trash_src_items)}async deleteItemsFromStorage(e,t=[]){let r=await this.appProcessor.getApp(e);r&&(r.items_list=r.items_list.filter(a=>!t.find(i=>a.item_id==i.item_id)||(delete r.items_object[a.item_id],!1)),this.pipeService.emit("gh_items_update",{app_id:e},r.items_list),this.storage.updateApp(r))}async getItems(e,t=!1){let r=await this.appProcessor.getApp(e,t);return r?r.items_list:null}async addNewItems(e,t){let r=t.map(i=>({...i,fields:Wr(i.fields)})),a=await this.addItemsApi(e,r);return await this.addItemsToStorage(e,a),this.pipeService.emit("gh_items_add",{app_id:e},a),a}async updateItems(e,t){let r=t.map(i=>({...i,fields:Wr(i.fields)})),a=await this.updateItemsApi(e,r);return await this.updateItemsInStorage(e,a)}async deleteItems(e,t){return this.deleteItemsApi(t).then(async r=>await this.deleteItemsFromStorage(e,r))}itemListeners(){this.pipeService.onRoot("gh_items_get",{},async(e,t)=>{if(t&&t.app_id){let r=await this.getItems(t.app_id);r?this.pipeService.emit("gh_items_get",t,r):this.pipeService.emit("gh_items_get",t,[])}}),this.pipeService.onRoot("gh_items_add",{},async(e,t)=>{if(t&&t.app_id&&t.items){let r=await this.addNewItems(t.app_id,t.items);r?this.pipeService.emit("gh_items_add",t,r):this.pipeService.emit("gh_items_add",t,[])}}),this.pipeService.onRoot("gh_items_update",{},async(e,t)=>{if(t&&t.app_id&&t.items){let r=await this.updateItems(t.app_id,t.items);r?this.pipeService.emit("gh_items_update",t,r):this.pipeService.emit("gh_items_update",t,[])}}),this.pipeService.onRoot("gh_item_get",{},async(e,t)=>{if(t&&t.app_id){let r=(await this.getItems(t.app_id)).find(a=>a.item_id==t.item_id);this.pipeService.emit("gh_item_get",t,r)}}),this.pipeService.onRoot("gh_filtered_items_get",{},async(e,t)=>{if(t&&t.element_app_id){let r=await this.getItems(t.element_app_id),a=await this.util.getFilteredItems(r,t.filters_list,t.element_app_id,t.app_id,t.item_id,t.field_groupe,t.search,t.search_params);this.pipeService.emit("gh_filtered_items_get",t,a)}}),this.pipeService.onRoot("gh_filter_items",{},async(e,t)=>{if(t&&t.items){let r=await this.util.getFilteredItems(t.items,t.filters_list,t.element_app_id,t.app_id,t.item_id,t.field_groupe,t.search,t.search_params);this.pipeService.emit("gh_filter_items",t,r)}})}}class No{constructor(e,t,r,a,i){this.storage=e,this.req=t,this.appProcessor=r,this.itemProcessor=a,this.pipeService=i,this.fieldListeners()}deleteFieldApi(e){return this.req.post({url:"/api/app/delete-field",form:{field_id:e}})}async updatedFieldApi(e,t={}){let r=await this.appProcessor.getApp(e),a={app_id:e,app_name:r.app_name,group_id:r.group_id,icon:r.icon,field_list:r.field_list.map(i=>i.field_id==t.field_id?{...i,...t}:i),views_list:r.views_list};return this.appProcessor.updateApp(a)}setFieldValueApi(e,t,r,a){let i=[{item_id:t,fields:[{field_id:r,field_value:a}]}];return this.itemProcessor.updateItems(e,i)}deleteFieldInStorage(e,t){let r=this.storage.getApp(e);return r.field_list=r.field_list.filter(a=>a.file_id!=t),r.items_list=r.items_list.map(a=>(a.fields=a.fields.filter(i=>i.field_id!=t),a)),this.storage.updateApp(r),!0}updateFieldInStorage(e,t){let r=this.storage.getApp(e);return r.field_list=r.field_list.map(a=>a.field_id==t.field_id?{...a,...t}:a),this.storage.updateApp(r),t}updateFieldValue(e,t,r,a){let i=this.storage.getApp(e);return i.items_list.forEach(l=>{l.item_id==t&&l.fields.forEach(s=>{s.field_id==r&&(s.field_value=a,i.items_object[l.item_id][s.field_id]=s)})}),this.storage.updateApp(i),a}async getField(e,t){let r=await this.appProcessor.getApp(e);if(!r)return null;for(let a=0;a<r.field_list.length;a++)if(r.field_list[a].field_id==t)return r.field_list[a];return null}async getFieldIdByNameSpace(e,t){let r=await this.appProcessor.getApp(e);if(!r)return null;for(let a=0;a<r.field_list.length;a++)if(r.field_list[a].name_space==t)return r.field_list[a].field_id;return null}async getFieldModels(e){let t=await this.appProcessor.getApp(e);return t?t.field_list:null}async updateField(e,t){if(!e||!t)return;let r=await this.updatedFieldApi(e,t);return this.updateFieldInStorage(e,r)}async deleteField(e,t){return await this.deleteFieldApi(t),this.deleteFieldInStorage(e,t)}async getFieldValue(e,t,r){let a=null,i=await this.appProcessor.getApp(e);try{a=i.items_object[t][r].field_value}catch{}return a}async setFieldValue(e,t,r,a){if(e&&t&&r)return await this.setFieldValueApi(e,t,r,a),this.updateFieldValue(e,t,r,a)}fieldListeners(){this.pipeService.onRoot("gh_value_get",{},async(e,t)=>{if(t.app_id&&t.item_id&&t.field_id){let r=await this.getFieldValue(t.app_id,t.item_id,t.field_id);this.pipeService.emit("gh_value_get",t,r)}}),this.pipeService.onRoot("gh_value_set",{},async(e,t)=>{t.item_id&&(this.setFieldValue(t.app_id,t.item_id,t.field_id,t.new_value),delete t.new_value)}),this.pipeService.onRoot("gh_model_get",{},async(e,t)=>{try{let r=await this.getField(t.app_id,t.field_id);this.pipeService.emit("gh_model_get",t,r)}catch(r){console.log("Field model: ",r)}}),this.pipeService.onRoot("gh_model_update",{},async(e,t)=>{let r=await this.updateField(t.app_id,t.field_model);this.pipeService.emit("gh_model_update",{app_id:t.app_id,field_id:t.field_id},r)}),this.pipeService.onRoot("gh_models_get",{},async(e,t)=>{let r=await this.getFieldModels(t.app_id);this.pipeService.emit("gh_models_get",t,r)}),this.pipeService.onRoot("gh_model_delete",{},async(e,t)=>{let r=await this.deleteField(t.app_id,t.field_id);this.pipeService.emit("gh_model_delete",t,r)})}}class Mo{constructor(e,t,r,a){this.storage=e,this.pipeService=t,this.req=r,this.appProcessor=a}async uploadFileApi(e,t,r){try{let a={"file-0":e,app_id:t,item_id:r};return await this.req.post({url:"/file/formupload",form:a})}catch(a){return console.log(a),null}}async uploadFileFromStringApi(e){try{return await this.req.post({url:"/file/upload",form:{file:JSON.stringify(e)}})}catch(t){return console.log(t),null}}async updateFileFromStringApi(e,t,r,a,i,l,s){try{let u={file_name:r,extension:a,file_id:t,format:i,source:e,alt:l,title:s};return await this.req.post({url:"/file/update",form:{file:JSON.stringify(u)}})}catch(u){return console.log(u),null}}async duplicateFileApi(e){return this.req.post({url:"/api/new/file/duplicate",headers:{"Content-Type":"application/x-www-form-urlencoded"},form:{files:JSON.stringify(e)}})}async downloadFileFromString(e,t){if(!await this.isFileExists(e,t))return!1;{let r=await this.getFile(e,t),a=await this.req.get({url:r.url+"?timestamp="+r.last_update,externalResource:!0});return{file:r,data:a,type:"file"}}}async duplicateFile(e){let t=await this.duplicateFileApi(e);return t.forEach(r=>{this.addFileToStorage(r.app_id,r)}),t}async deleteFileApi(e){try{return await this.req.get({url:\`/file/delete?file_id=\${e}\`})}catch(t){return console.log(t),null}}addFileToStorage(e,t){let r=this.storage.getApp(e);r&&(r.file_list.push(t),this.storage.updateApp(r),this.pipeService.emit("gh_file_upload",{app_id:e,item_id:t.item_id,file_id:t.file_id},t))}addFilesToStorage(e,t){let r=this.storage.getApp(e);r&&(r.file_list.push(...t),this.storage.updateApp(r),t.forEach(a=>{this.pipeService.emit("gh_file_upload",{app_id:e,item_id:a.item_id,file_id:a.file_id},a)}))}deleteFileFromStorage(e,t){let r=this.storage.getApp(t);if(r){let a;r.file_list=r.file_list.filter(i=>i.file_id!=e||(a=i,!1)),this.storage.updateApp(r),this.pipeService.emit("gh_file_delete",{file_id:e},a)}}updateFileInStorage(e,t,r){let a=this.storage.getApp(t);a&&(a.file_list=a.file_list.map(i=>i.file_id==e?r:i),this.storage.updateApp(a),this.pipeService.emit("gh_file_update",{file_id:e}))}async getFile(e,t){let r=await this.appProcessor.getApp(e);return new Promise((a,i)=>{a(r.file_list.find(l=>l.file_id==t)||"")})}async getFiles(e,t=[]){let r=await this.appProcessor.getApp(e);return new Promise((a,i)=>{a(r.file_list.filter(l=>t.some(s=>s==l.file_id))||"")})}async uploadFile(e,t,r){let a=await this.uploadFileApi(e,t,r);return this.addFileToStorage(t,a),a}async uploadFileFromString(e){let t=await this.uploadFileFromStringApi(e);return this.addFileToStorage(t.app_id,t),t}async updateFileFromString(e,t,r,a,i,l,s){let u=await this.updateFileFromStringApi(e,t,r,a,i,l,s);return this.updateFileInStorage(t,u.app_id,u),u}async deleteFile(e,t){return await this.deleteFileApi(e),this.deleteFileFromStorage(e,t),!0}async isFileExists(e,t){let r=/^(https?:\\/\\/)?([\\da-z\\.-]+)\\.([a-z\\.]{2,6})([\\/\\w \\.-]*)*\\/?$/;if(!t)return!1;{let a=await this.getFile(e,t);return!!a&&r.test(a.url)}}}class Ro{constructor(e,t){this.req=e,this.pipeService=t}createDocument(e){return this.emitDocumentInsert(e),this.req.post({url:"/api/new/document/insert-one",headers:{"Content-Type":"application/x-www-form-urlencoded"},form:{document:JSON.stringify(e)}})}emitDocumentInsert(e){let t=typeof e.data=="string"?JSON.parse(e.data):e.data;this.pipeService.emit("gh_document_insert_one",{app_id:e.app_id,item_id:e.item_id,element_id:e.element_id},t)}getDocument(e){return this.req.post({url:"/api/new/document/find-one",headers:{"Content-Type":"application/x-www-form-urlencoded"},form:{document:JSON.stringify(e)}})}getDocuments(e){return this.req.post({url:"/api/new/document/find",headers:{"Content-Type":"application/x-www-form-urlencoded"},form:{document:JSON.stringify(e)}})}deleteDocument(e){return this.req.post({url:"/api/new/document/remove-one",headers:{"Content-Type":"application/x-www-form-urlencoded"},form:{document:JSON.stringify(e)}})}}class Fo{constructor(e){this.gudhub=e}async getInterpretationObj(e,t,r,a,i,l){var s=[],u=t.data_model.interpretation.find(function(p){return p.src==r})||t.data_model.interpretation.find(function(p){return p.src=="table"})||{id:"default"};if(e.data_model&&e.data_model.interpretation){for(var o=0;o<e.data_model.interpretation.length;o++)(e.data_model.interpretation[o].src==r||e.data_model.interpretation[o].src==a)&&s.push(e.data_model.interpretation[o]);for(var o=0;o<s.length;o++)if(s[o].settings&&s[o].settings.condition_filter&&s[o].settings.filters_list.length>0){let m=await gudhub.getItem(l,i);if(m&&gudhub.filter([m],s[o].settings.filters_list).length>0){u=s[o];break}}else u=gudhub.mergeObjects(u,s[o])}return u}getInterpretation(e,t,r,a,i,l,s){let u=this;return new Promise(async(o,p)=>{var m=t&&t.data_type?t.data_type:r;m?gudhub.ghconstructor.getInstance(m).then(async function(d){if(d){var y=await u.getInterpretationObj(t,d.getTemplate().model,a,s,i,l);d.getInterpretation(e,y.id,m,t,i,l).then(function(f){o(gudhub.mergeObjects(f,y))},function(f){p()})}},function(d){}):console.error("Get Interpretation: data_type is undefined",r,t)})}async getInterpretationById(e,t,r,a,i=null,l=null){let s=i??await this.gudhub.getFieldValue(e,t,r),u=l??await this.gudhub.getField(e,r);if(u==null)return"";let o=await this.gudhub.ghconstructor.getInstance(u.data_type),p=await o.getInterpretation(s,a,u.data_type,u,t,e);return p.html=="<span>no interpretation</span>"?s:p.html}}var me=A("5xozB");function Lo(n,e){switch(e.api){case"/items/update":console.log("/items/update - ",e),n.itemProcessor.updateItemsInStorage(e.app_id,e.response);break;case"/items/add":console.log("/items/add - ",e),n.itemProcessor.addItemsToStorage(e.app_id,e.response);break;case"/items/delete":console.log("/items/delete - ",e),n.itemProcessor.deleteItemsFromStorage(e.app_id,e.response);break;case"/app/update":console.log("/app/update - ",e),n.appProcessor.updateAppFieldsAndViews(e.response);break;case"/file/delete":console.log("file/delete - ",e),n.fileManager.deleteFileFromStorage(e.response.file_id,e.app_id);break;case"/file/upload":console.log("file/upload - ",e),n.fileManager.addFileToStorage(e.app_id,e.response);break;case"/file/formupload":console.log("file/formupload - ",e);break;case"/file/update":n.fileManager.updateFileInStorage(e.response.file_id,e.response.app_id,e.response),console.log("file/update - ",e);break;case"/new/file/duplicate":n.fileManager.addFilesToStorage(e.app_id,e.response),console.log("new/file/duplicate - ",e);break;case"/api/new/document/insert-one":n.documentManager.emitDocumentInsert(e.response),console.log("/api/new/document/insert-one - ",e);break;case"/ws/emit-to-user":console.log("/ws/emit-to-user - ",e);break;case"/ws/broadcast-to-app-subscribers":console.log("/ws/broadcast-to-app-subscribers - ",e);let t=JSON.parse(e.response);if(!t.data_type)return;n.ghconstructor.getInstance(t.data_type).then(r=>{r.onMessage(e.app_id,e.user_id,t)});break;default:console.warn("WEBSOCKETS is not process this API:",e.api)}}class Do{constructor(e,t){this.req=t,this.gudhub=e}async createGroupApi(e){try{let t={token:await this.gudhub.auth.getToken(),group_name:e};return await this.req.post({url:"/api/sharing-group/create-group",form:t})}catch(t){return console.log(t),null}}async updateGroupApi(e,t){try{let r={token:await this.gudhub.auth.getToken(),group_name:t,group_id:e};return await this.req.post({url:"/api/sharing-group/update-group",form:r})}catch(r){return console.log(r),null}}async deleteGroupApi(e){try{let t={token:await this.gudhub.auth.getToken(),group_id:e};return await this.req.post({url:"/api/sharing-group/delete-group",form:t})}catch(t){return console.log(t),null}}async addUserToGroupApi(e,t,r){try{let a={token:await this.gudhub.auth.getToken(),group_id:e,user_id:t,group_permission:r};return await this.req.post({url:"/api/sharing-group/add-user-to-group",form:a})}catch(a){return console.log(a),null}}async getUsersByGroupApi(e){try{let t={token:await this.gudhub.auth.getToken(),group_id:e};return await this.req.post({url:"/api/sharing-group/get-users-by-group",form:t})}catch(t){return console.log(t),null}}async updateUserInGroupApi(e,t,r){try{let a={token:await this.gudhub.auth.getToken(),user_id:e,group_id:t,group_permission:r};return await this.req.post({url:"/api/sharing-group/update-user-in-group",form:a})}catch(a){return console.log(a),null}}async deleteUserFromGroupApi(e,t){try{let r={token:await this.gudhub.auth.getToken(),user_id:e,group_id:t};return await this.req.post({url:"/api/sharing-group/delete-user-from-group",form:r})}catch(r){return console.log(r),null}}async getGroupsByUserApi(e){try{let t={token:await this.gudhub.auth.getToken(),user_id:e};return await this.req.post({url:"/api/sharing-group/get-groups-by-user",form:t})}catch(t){return console.log(t),null}}}class qo{constructor(e,t){this.req=t,this.gudhub=e}async addAppToGroupApi(e,t,r){try{let a={token:await this.gudhub.auth.getToken(),app_id:e,group_id:t,app_permission:r};return await this.req.post({url:"/api/sharing-group/add-app-to-group",form:a})}catch(a){return console.log(a),null}}async getAppsByGroupApi(e){try{let t={token:await this.gudhub.auth.getToken(),group_id:e};return await this.req.post({url:"/api/sharing-group/get-apps-by-group",form:t})}catch(t){return console.log(t),null}}async updateAppInGroupApi(e,t,r){try{let a={token:await this.gudhub.auth.getToken(),group_id:t,app_id:e,app_permission:r};return await this.req.post({url:"/api/sharing-group/update-app-in-group",form:a})}catch(a){return console.log(a),null}}async deleteAppFromGroupApi(e,t,r){try{let a={token:await this.gudhub.auth.getToken(),group_id:t,app_id:e,app_permission:r};return await this.req.post({url:"/api/sharing-group/delete-app-from-group",form:a})}catch(a){return console.log(a),null}}async getGroupsByAppApi(e){try{let t={token:await this.gudhub.auth.getToken(),app_id:e};return await this.req.post({url:"/api/sharing-group/get-groups-by-app",form:t})}catch(t){return console.log(t),null}}}class Bo{constructor(e,t,r){this.req=t,this.gudhub=e,this.pipeService=r,this.groupManager=new Do(e,t),this.appGroupSharing=new qo(e,t)}createGroup(e){return this.groupManager.createGroupApi(e)}updateGroup(e,t){return this.groupManager.updateGroupApi(e,t)}deleteGroup(e){return this.groupManager.deleteGroupApi(e)}async addUserToGroup(e,t,r){let a=await this.groupManager.addUserToGroupApi(e,t,r);return this.pipeService.emit("group_members_add",{app_id:"group_sharing"},a),a}getUsersByGroup(e){return this.groupManager.getUsersByGroupApi(e)}async updateUserInGroup(e,t,r){let a=await this.groupManager.updateUserInGroupApi(e,t,r);return this.pipeService.emit("group_members_update",{app_id:"group_sharing"},a),a}async deleteUserFromGroup(e,t){let r=await this.groupManager.deleteUserFromGroupApi(e,t);return this.pipeService.emit("group_members_delete",{app_id:"group_sharing"},r),r}getGroupsByUser(e){return this.groupManager.getGroupsByUserApi(e)}addAppToGroup(e,t,r){return this.appGroupSharing.addAppToGroupApi(e,t,r)}getAppsByGroup(e){return this.appGroupSharing.getAppsByGroupApi(e)}updateAppInGroup(e,t,r){return this.appGroupSharing.updateAppInGroupApi(e,t,r)}deleteAppFromGroup(e,t,r){return this.appGroupSharing.deleteAppFromGroupApi(e,t,r)}getGroupsByApp(e){return this.appGroupSharing.getGroupsByAppApi(e)}}class Uo{constructor(e,t){this.req=t,this.gudhub=e}async add(e,t,r){try{let a={token:await this.gudhub.auth.getToken(),app_id:e,user_id:t,sharing_permission:r};return await this.req.post({url:"/sharing/add",form:a})}catch(a){return console.log(a),null}}async update(e,t,r){try{let a={token:await this.gudhub.auth.getToken(),app_id:e,user_id:t,sharing_permission:r};return await this.req.post({url:"/sharing/update",form:a})}catch(a){return console.log(a),null}}async delete(e,t){try{let r={token:await this.gudhub.auth.getToken(),app_id:e,user_id:t};return await this.req.post({url:"/sharing/delete",form:r})}catch(r){return console.log(r),null}}async getAppUsers(e){try{let t={token:await this.gudhub.auth.getToken(),app_id:e};return await this.req.post({url:"/sharing/get-app-users",form:t})}catch(t){return console.log(t),null}}async addInvitation(e,t){try{let r={token:await this.gudhub.auth.getToken(),guests_emails:e,apps:t};return await this.req.post({url:"/api/invitation/add",form:r})}catch(r){return console.log(r),null}}}class Go{constructor(e){this.gudhub=e}async emitToUser(e,t){let r={user_id:e,data:typeof t=="object"?JSON.stringify(t):t};return await this.gudhub.req.post({url:"/ws/emit-to-user",form:r})}async broadcastToAppSubscribers(e,t,r){let a={app_id:e,data:JSON.stringify({data_type:t,data:r})};return await this.gudhub.req.post({url:"/ws/broadcast-to-app-subscribers",form:a})}}class Wo{constructor(e,t={server_url:ca,wss_url:ua,node_server_url:pa,initWebsocket:!1,activateSW:!1,swLink:"",async_modules_path:da,file_server_url:ha,automation_modules_path:fa,accesstoken:this.accesstoken,expirydate:this.expirydate}){if(this.serialized={authKey:e,options:t},this.config=t,this.ghconstructor=new Po(this),this.interpritate=new Fo(this),this.pipeService=new Li,this.storage=new qi(t.async_modules_path,t.file_server_url,t.automation_modules_path),this.util=new Io(this),this.req=new Ri(t.server_url),this.auth=new Oo(this.req,this.storage),this.sharing=new Uo(this,this.req),this.groupSharing=new Bo(this,this.req,this.pipeService),e?this.storage.setUser({auth_key:e}):t.accesstoken&&t.expirydate&&this.storage.setUser({accesstoken:t.accesstoken,expirydate:t.expirydate}),this.req.init(this.auth.getToken.bind(this.auth)),this.ws=new Bi(t.wss_url,this.auth),this.initializeAppProcessor(),this.itemProcessor=new Co(this.storage,this.pipeService,this.req,this.appProcessor,this.util),this.fieldProcessor=new No(this.storage,this.req,this.appProcessor,this.itemProcessor,this.pipeService),this.fileManager=new Mo(this.storage,this.pipeService,this.req,this.appProcessor),this.documentManager=new Ro(this.req,this.pipeService),this.websocketsemitter=new Go(this),t.initWebsocket){let r=this;this.ws.initWebSocket(Lo.bind(this,r),this.appProcessor.refreshApps.bind(this.appProcessor))}t.activateSW&&this.activateSW(t.swLink)}initializeAppProcessor(){this.appProcessor=new Gr(this.storage,this.pipeService,this.req,this.ws,this.util,this.config.activateSW,new Ut(this.req,Tr,this))}async activateSW(e){if(me.IS_BROWSER_MAIN_THREAD&&"serviceWorker"in window.navigator)try{let t=await window.navigator.serviceWorker.register(e);t.update().then(()=>console.log("%cSW ->>> Service worker successful updated","display: inline-block ; background-color: #689f38 ; color: #ffffff ; font-weight: bold ; padding: 3px 7px; border-radius: 3px;")).catch(()=>console.warn("SW ->>> Service worker is not updated")),console.log("%cSW ->>> Service worker is registered","display: inline-block ; background-color: #689f38 ; color: #ffffff ; font-weight: bold ; padding: 3px 7px; border-radius: 3px;",t)}catch(t){console.warn("%cSW ->>> Service worker is not registered","display: inline-block ; background-color: #d32f2f ; color: #ffffff ; font-weight: bold ; padding: 3px 7px; border-radius: 3px;",t)}else console.log("%cSW ->>> ServiceWorkers not supported","display: inline-block ; background-color: #d32f2f ; color: #ffffff ; font-weight: bold ; padding: 3px 7px; border-radius: 3px;")}on(e,t,r){return this.pipeService.on(e,t,r),this}emit(e,t,r,a){return this.pipeService.emit(e,t,r,a),this}destroy(e,t,r){return this.pipeService.destroy(e,t,r),this}prefilter(e,t){return this.util.prefilter(e,t)}debounce(e,t){return this.util.debounce(e,t)}emitToUser(e,t){return this.websocketsemitter.emitToUser(e,t)}broadcastToAppSubscribers(e,t,r){return this.websocketsemitter.broadcastToAppSubscribers(e,t,r)}getInterpretation(e,t,r,a,i,l,s){return this.interpritate.getInterpretation(e,t,r,a,i,l,s)}getInterpretationById(e,t,r,a,i,l){return this.interpritate.getInterpretationById(e,t,r,a,i,l)}filter(e,t){return this.util.filter(e,t)}mergeFilters(e,t){return this.util.mergeFilters(e,t)}group(e,t){return this.util.group(e,t)}getFilteredItems(e,t,r={}){return this.util.getFilteredItems(e,t,r.element_app_id,r.app_id,r.item_id,r.field_group,r.search,r.search_params)}sortItems(e,t){return this.util.sortItems(e,t)}jsonToItems(e,t){return this.util.jsonToItems(e,t)}getDate(e){return this.util.getDate(e)}populateWithDate(e,t){return this.util.populateWithDate(e,t)}checkRecurringDate(e,t){return this.util.checkRecurringDate(e,t)}populateItems(e,t,r){return this.util.populateItems(e,t,r)}populateWithItemRef(e,t,r,a,i,l){return this.util.populateWithItemRef(e,t,r,a,i,l)}compareItems(e,t,r){return this.util.compareItems(e,t,r)}mergeItems(e,t,r){return this.util.mergeItems(e,t,r)}mergeObjects(e,t){return this.util.mergeObjects(e,t)}makeNestedList(e,t,r,a,i){return this.util.makeNestedList(e,t,r,a,i)}jsonConstructor(e,t,r,a){return this.util.jsonConstructor(e,t,r,a)}getAppsList(){return this.appProcessor.getAppsList()}getAppInfo(e){return this.appProcessor.getAppInfo(e)}deleteApp(e){return this.appProcessor.deleteApp(e)}getApp(e){return this.appProcessor.getApp(e)}updateApp(e){return this.appProcessor.updateApp(e)}updateAppInfo(e){return this.appProcessor.updateAppInfo(e)}createNewApp(e){return this.appProcessor.createNewApp(e)}getItems(e){return this.itemProcessor.getItems(e)}async getItem(e,t){let r=await this.getItems(e);if(r)return r.find(a=>a.item_id==t)}addNewItems(e,t){return this.itemProcessor.addNewItems(e,t)}updateItems(e,t){return this.itemProcessor.updateItems(e,t)}deleteItems(e,t){return this.itemProcessor.deleteItems(e,t)}getField(e,t){return this.fieldProcessor.getField(e,t)}getFieldIdByNameSpace(e,t){return this.fieldProcessor.getFieldIdByNameSpace(e,t)}getFieldModels(e){return this.fieldProcessor.getFieldModels(e)}updateField(e,t){return this.fieldProcessor.updateField(e,t)}deleteField(e,t){return this.fieldProcessor.deleteField(e,t)}getFieldValue(e,t,r){return this.fieldProcessor.getFieldValue(e,t,r)}setFieldValue(e,t,r,a){return this.fieldProcessor.setFieldValue(e,t,r,a)}getFile(e,t){return this.fileManager.getFile(e,t)}getFiles(e,t){return this.fileManager.getFiles(e,t)}uploadFile(e,t,r){return this.fileManager.uploadFile(e,t,r)}uploadFileFromString(e,t,r,a,i,l,s){return this.fileManager.uploadFileFromString(e,t,r,a,i,l,s)}updateFileFromString(e,t,r,a,i,l,s){return this.fileManager.updateFileFromString(e,t,r,a,i,l,s)}deleteFile(e,t){return this.fileManager.deleteFile(e,t)}duplicateFile(e){return this.fileManager.duplicateFile(e)}downloadFileFromString(e,t){return this.fileManager.downloadFileFromString(e,t)}createDocument(e){return this.documentManager.createDocument(e)}getDocument(e){return this.documentManager.getDocument(e)}getDocuments(e){return this.documentManager.getDocuments(e)}deleteDocument(e){return this.documentManager.deleteDocument(e)}login(e){return this.auth.login(e)}loginWithToken(e){return this.auth.loginWithToken(e)}logout(e){return this.appProcessor.clearAppProcessor(),this.auth.logout(e)}signup(e){return this.auth.signup(e)}getUsersList(e){return this.auth.getUsersList(e)}updateToken(e){return this.auth.updateToken(e)}avatarUploadApi(e){return this.auth.avatarUploadApi(e)}getVersion(){return this.auth.getVersion()}getUserById(e){return this.auth.getUserById(e)}getToken(){return this.auth.getToken()}updateUser(e){return this.auth.updateUser(e)}updateAvatar(e){return this.auth.updateAvatar(e)}}class Ho extends Wo{initializeAppProcessor(){this.appProcessor=new Gr(this.storage,this.pipeService,this.req,this.ws,this.util,!1,new He(this.req,null,this))}}let Le={},yt={},Qn={};self.onmessage=async function(n){if(n.data.type===xe.INIT&&(n.data.gudhubSerialized.options.initWebsocket=!1,Le=new Ho(n.data.gudhubSerialized.authKey,n.data.gudhubSerialized.options),yt=new Ur(Le.req,Et,Le),Qn=new wa(Le.req,zt,Le)),n.data.type==xe.PROCESS_DATA){if(!n.data.usedCachedDataVersion){this.postMessage({id:n.data.id,type:xe.DECLINE_PROCESS_DATA_REQUEST});return}let e=await yt.getCached(n.data.id),t=e.chunks,r=await yt.getAppWithoutProcessing(n.data.id),a=!0;if(t.length!=r.chunks.length&&(a=!1),r.chunks.some(u=>!t.includes(u))&&(a=!1),!a){let u=await Qn.getCachedMergedChunk(n.data.id,e.chunks);u&&(e.items_list=await Le.util.mergeChunks([u,e])),r=await yt.getApp(n.data.id)}let i=Le.compareItems(r.items_list,e.items_list),l=Le.util.areViewListsEqual(e.views_list,r.views_list),s=Le.util.areFieldListsEqual(e.field_list,r.field_list);this.postMessage({id:n.data.id,compareRes:i,newVersion:r,type:n.data.type,viewListChanged:l,fieldListChanged:s})}if(n.data.type==xe.REQUEST_APP){let e=await yt.getApp(n.data.id);this.postMessage({id:n.data.id,type:n.data.type,data:e})}}})()})();
15522
15322
  `, blob = typeof self < "u" && self.Blob && new Blob([jsContent], {
15523
15323
  type: "text/javascript;charset=utf-8"
15524
15324
  });
@@ -15540,21 +15340,27 @@ function WorkerWrapper(n) {
15540
15340
  e && (self.URL || self.webkitURL).revokeObjectURL(e);
15541
15341
  }
15542
15342
  }
15343
+ let WORKER_EVENTS = {
15344
+ INIT: 1,
15345
+ REQUEST_APP: 2,
15346
+ PROCESS_DATA: 3,
15347
+ DECLINE_PROCESS_DATA_REQUEST: 4
15348
+ };
15543
15349
  class IndexedDBAppService extends AppDataService$1 {
15544
15350
  constructor(e, t, r) {
15545
15351
  super(e, t, r), this.dataService = new AppHttpService(e, t, r), this.requestCache = /* @__PURE__ */ new Map(), this.gudhub = r, this.resolveFnMap = /* @__PURE__ */ new Map(), this.appRequestAndProcessWorker = new WorkerWrapper(), this.appRequestAndProcessWorker.postMessage({
15546
- type: "init",
15352
+ type: WORKER_EVENTS.INIT,
15547
15353
  gudhubSerialized: this.gudhub.serialized
15548
15354
  });
15549
15355
  let i = this;
15550
15356
  this.appRequestAndProcessWorker.onerror = function(a) {
15551
15357
  }, this.appRequestAndProcessWorker.onmessage = function(a) {
15552
- a.data.type == "requestApp" && i.resolveFnMap.has(a.data.id) && i.resolveFnMap.get(a.data.id)(a.data.data), a.data.type == "processData" && (i.gudhub.itemProcessor.handleDiff(a.data.id, a.data.compareRes), (a.data.viewListChanged || a.data.fieldListChanged) && i.gudhub.appProcessor.updateAppFieldsAndViews(a.data.newVersion));
15553
- }, this.storeManager = new AppStoreManager();
15358
+ a.data.type == WORKER_EVENTS.REQUEST_APP && i.resolveFnMap.has(a.data.id) && i.resolveFnMap.get(a.data.id)(a.data.data), a.data.type == WORKER_EVENTS.PROCESS_DATA && (i.gudhub.itemProcessor.handleDiff(a.data.id, a.data.compareRes), (a.data.viewListChanged || a.data.fieldListChanged) && i.gudhub.appProcessor.updateAppFieldsAndViews(a.data.newVersion));
15359
+ }, this.isWithCache(), this.storeManager = new AppStoreManager();
15554
15360
  }
15555
15361
  static [Symbol.hasInstance](e) {
15556
15362
  try {
15557
- return e instanceof IndexedDBAppService || e instanceof IndexedDBService;
15363
+ return e instanceof IndexedDBAppService;
15558
15364
  } catch {
15559
15365
  return !1;
15560
15366
  }
@@ -15562,20 +15368,27 @@ class IndexedDBAppService extends AppDataService$1 {
15562
15368
  //TODO use IndexedDBFacade here
15563
15369
  // indexDBAccess = new IndexedDBFacade;
15564
15370
  isWithCache() {
15565
- return !1;
15371
+ return !0;
15566
15372
  }
15567
15373
  async getApp(e) {
15568
15374
  if (this.requestCache.has(e)) return this.requestCache.get(e);
15569
- let t = this;
15570
- await this.has(e);
15571
- {
15572
- let r = new Promise((i, a) => {
15573
- t.resolveFnMap.set(e, i);
15375
+ let t = this, r = await this.has(e);
15376
+ if (r = !1, r) {
15377
+ let i = await this.getCached(e), a = await this.chunkDataService.getCachedMergedChunk(e, i.chunks);
15378
+ i.items_list = await this.gudhub.util.mergeChunks([a, i]);
15379
+ let s = Promise.resolve(i);
15380
+ return this.requestCache.set(e, s), this.appRequestAndProcessWorker.postMessage({
15381
+ type: WORKER_EVENTS.PROCESS_DATA,
15382
+ id: e
15383
+ }), s;
15384
+ } else {
15385
+ let i = new Promise((a, s) => {
15386
+ t.resolveFnMap.set(e, a);
15574
15387
  });
15575
- return this.requestCache.set(e, r), this.appRequestAndProcessWorker.postMessage({
15576
- type: "requestApp",
15388
+ return this.requestCache.set(e, i), this.appRequestAndProcessWorker.postMessage({
15389
+ type: WORKER_EVENTS.REQUEST_APP,
15577
15390
  id: e
15578
- }), r;
15391
+ }), i;
15579
15392
  }
15580
15393
  }
15581
15394
  //TODO page isnt loaded when indexeddb empty. Investigate getApp in IndexedDBAppService here
@@ -15592,24 +15405,92 @@ class IndexedDBAppService extends AppDataService$1 {
15592
15405
  async putApp(e, t) {
15593
15406
  return this.storeManager.putApp(e, t);
15594
15407
  }
15595
- //todo openDatabase only once and then preserve it for further usage
15596
- // async openDatabase() {
15597
- // if (this.db) return this.db;
15598
- // return new Promise((resolve, reject) => {
15599
- // const request = indexedDB.open(this.dbName, this.dbVersion);
15600
- // request.onsuccess = event => {
15601
- // this.db = event.target.result;
15602
- // resolve(this.db);
15603
- // };
15604
- // request.onerror = event => {
15605
- // reject(event.target.error);
15606
- // };
15607
- // });
15608
- // }
15408
+ }
15409
+ class AppHttpWorkerService extends AppDataService$1 {
15410
+ constructor(e, t, r) {
15411
+ super(e, t, r), this.dataService = new AppHttpService(e, null, r), this.requestCache = /* @__PURE__ */ new Map(), this.gudhub = r;
15412
+ }
15413
+ isWithCache() {
15414
+ return !1;
15415
+ }
15416
+ async getAppWithoutProcessing(e) {
15417
+ let t = await this.dataService.getAppWithoutProcessing(e);
15418
+ return await this.putApp(e, t), t;
15419
+ }
15420
+ async getApp(e) {
15421
+ if (this.requestCache.has(e)) return this.requestCache.get(e);
15422
+ let t, r = new Promise((s, l) => {
15423
+ t = s;
15424
+ });
15425
+ this.requestCache.set(e, r);
15426
+ let i = await this.dataService.getAppWithoutProcessing(e), a = await this.processRequestedApp(e, i);
15427
+ return t(a), a;
15428
+ }
15429
+ async has(e) {
15430
+ return !1;
15431
+ }
15432
+ async getCached(e) {
15433
+ throw new Error();
15434
+ }
15435
+ async putApp(e, t) {
15436
+ throw new Error();
15437
+ }
15438
+ }
15439
+ class AppThroughWebWorkerService extends AppDataService$1 {
15440
+ constructor(e, t, r) {
15441
+ super(e, t, r), this.dataService = new AppHttpService(e, t, r), this.requestCache = /* @__PURE__ */ new Map(), this.gudhub = r, this.resolveFnMap = /* @__PURE__ */ new Map(), this.appRequestAndProcessWorker = new WorkerWrapper(), this.appRequestAndProcessWorker.postMessage({
15442
+ type: WORKER_EVENTS.INIT,
15443
+ gudhubSerialized: this.gudhub.serialized
15444
+ });
15445
+ let i = this;
15446
+ this.appRequestAndProcessWorker.onerror = function(a) {
15447
+ }, this.appRequestAndProcessWorker.onmessage = function(a) {
15448
+ a.data.type == WORKER_EVENTS.REQUEST_APP && i.resolveFnMap.has(a.data.id) && i.resolveFnMap.get(a.data.id)(a.data.data), a.data.type == WORKER_EVENTS.PROCESS_DATA && (i.gudhub.itemProcessor.handleDiff(a.data.id, a.data.compareRes), (a.data.viewListChanged || a.data.fieldListChanged) && i.gudhub.appProcessor.updateAppFieldsAndViews(a.data.newVersion));
15449
+ }, this.isWithCache(), this.storeManager = new AppStoreManager();
15450
+ }
15451
+ static [Symbol.hasInstance](e) {
15452
+ try {
15453
+ return e instanceof IndexedDBAppService;
15454
+ } catch {
15455
+ return !1;
15456
+ }
15457
+ }
15458
+ isWithCache() {
15459
+ return !1;
15460
+ }
15461
+ //TODO -> rename to get ? Also should be for all derived classes and class tree
15462
+ async getApp(e) {
15463
+ if (this.requestCache.has(e)) return this.requestCache.get(e);
15464
+ let t = new Promise((r, i) => {
15465
+ self.resolveFnMap.set(e, r);
15466
+ });
15467
+ return this.requestCache.set(e, t), this.appRequestAndProcessWorker.postMessage({
15468
+ type: WORKER_EVENTS.REQUEST_APP,
15469
+ id: e
15470
+ }), t;
15471
+ }
15472
+ async getCached(e) {
15473
+ return this.storeManager.getApp(e);
15474
+ }
15475
+ async has(e) {
15476
+ try {
15477
+ return this.storeManager.hasApp(e);
15478
+ } catch {
15479
+ debugger;
15480
+ }
15481
+ }
15482
+ async putApp(e, t) {
15483
+ return this.storeManager.putApp(e, t);
15484
+ }
15609
15485
  }
15610
15486
  let AppDataService, ChunkDataService, appDataServiceConf, chunkDataServiceConf;
15611
- IS_BROWSER && cache_chunk_requests ? (ChunkDataService = IndexedDBChunkService, chunkDataServiceConf = chunksConf) : ChunkDataService = ChunkHttpService;
15612
- IS_BROWSER && cache_app_requests ? (AppDataService = IndexedDBAppService, appDataServiceConf = appsConf) : AppDataService = AppHttpService;
15487
+ IS_BROWSER && useWorkerToProcessRequestsData && (AppDataService = AppThroughWebWorkerService, appDataServiceConf = appsConf);
15488
+ IS_BROWSER || (AppDataService = AppHttpService);
15489
+ useWorkerToProcessRequestsData && (AppDataServiceForWorker = AppHttpWorkerService);
15490
+ IS_BROWSER && cache_chunk_requests && !useWorkerToProcessRequestsData && (ChunkDataService = IndexedDBChunkService, chunkDataServiceConf = chunksConf);
15491
+ IS_BROWSER && cache_chunk_requests && useWorkerToProcessRequestsData && (ChunkDataService = IndexedDBChunkService, chunkDataServiceConf = chunksConf);
15492
+ IS_BROWSER || (ChunkDataService = ChunkHttpService);
15493
+ let AppDataServiceForWorker = AppHttpWorkerService;
15613
15494
  class GudHub {
15614
15495
  constructor(e) {
15615
15496
  let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {
@@ -15640,16 +15521,7 @@ class GudHub {
15640
15521
  t.activateSW && this.activateSW(t.swLink);
15641
15522
  }
15642
15523
  initializeAppProcessor() {
15643
- this.appProcessor = new AppProcessor(
15644
- this.storage,
15645
- this.pipeService,
15646
- this.req,
15647
- this.ws,
15648
- // this.chunksManager,
15649
- this.util,
15650
- this.config.activateSW,
15651
- new AppDataService(this.req, appDataServiceConf, this)
15652
- );
15524
+ this.appProcessor = new AppProcessor(this.storage, this.pipeService, this.req, this.ws, this.util, this.config.activateSW, new AppDataService(this.req, appDataServiceConf, this));
15653
15525
  }
15654
15526
  async activateSW(e) {
15655
15527
  if (IS_BROWSER_MAIN_THREAD && "serviceWorker" in window.navigator)
@@ -15719,16 +15591,6 @@ class GudHub {
15719
15591
  sortItems(e, t) {
15720
15592
  return this.util.sortItems(e, t);
15721
15593
  }
15722
- //
15723
- //here
15724
- triggerAppChange(e, t, r) {
15725
- this.itemProcessor.handleItemsChange(e, t, r), this.appProcessor.handleAppChange(e, t, r);
15726
- }
15727
- //
15728
- //TODO handleAppChange
15729
- triggerIemsChange(e, t) {
15730
- this.itemProcessor.triggerItemsChange(e, t);
15731
- }
15732
15594
  jsonToItems(e, t) {
15733
15595
  return this.util.jsonToItems(e, t);
15734
15596
  }