@encatch/web-sdk 0.0.35-beta.3 → 0.0.35-beta.4
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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { l as Xs, x as ov, k as vh, t as sv, u as Ss } from "./module-
|
|
1
|
+
import { l as Xs, x as ov, k as vh, t as sv, u as Ss } from "./module-7fG0W-i9.js";
|
|
2
2
|
var Bo, Lt, ac, Uu, Go = 0, bh = [], jt = Xs, Zu = jt.__b, qu = jt.__r, Hu = jt.diffed, Bu = jt.__c, Gu = jt.unmount, Wu = jt.__;
|
|
3
3
|
function Ml(e, t) {
|
|
4
4
|
jt.__h && jt.__h(Lt, e, Go || t), Go = 0;
|
|
@@ -1,91 +1,91 @@
|
|
|
1
|
-
var
|
|
1
|
+
var $, p, te, ue, F, Q, ne, ie, se, K, z, j, I = {}, oe = [], de = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i, W = Array.isArray;
|
|
2
2
|
function k(t, e) {
|
|
3
3
|
for (var n in e) t[n] = e[n];
|
|
4
4
|
return t;
|
|
5
5
|
}
|
|
6
|
-
function
|
|
6
|
+
function V(t) {
|
|
7
7
|
t && t.parentNode && t.parentNode.removeChild(t);
|
|
8
8
|
}
|
|
9
|
-
function
|
|
9
|
+
function he(t, e, n) {
|
|
10
10
|
var i, r, s, _ = {};
|
|
11
11
|
for (s in e) s == "key" ? i = e[s] : s == "ref" ? r = e[s] : _[s] = e[s];
|
|
12
|
-
if (arguments.length > 2 && (_.children = arguments.length > 3 ?
|
|
13
|
-
return
|
|
12
|
+
if (arguments.length > 2 && (_.children = arguments.length > 3 ? $.call(arguments, 2) : n), typeof t == "function" && t.defaultProps != null) for (s in t.defaultProps) _[s] === void 0 && (_[s] = t.defaultProps[s]);
|
|
13
|
+
return T(t, _, i, r, null);
|
|
14
14
|
}
|
|
15
|
-
function
|
|
16
|
-
var s = { type: t, props: e, key: n, ref: i, __k: null, __: null, __b: 0, __e: null, __c: null, constructor: void 0, __v: r ?? ++
|
|
17
|
-
return r == null &&
|
|
15
|
+
function T(t, e, n, i, r) {
|
|
16
|
+
var s = { type: t, props: e, key: n, ref: i, __k: null, __: null, __b: 0, __e: null, __c: null, constructor: void 0, __v: r ?? ++te, __i: -1, __u: 0 };
|
|
17
|
+
return r == null && p.vnode != null && p.vnode(s), s;
|
|
18
18
|
}
|
|
19
|
-
function
|
|
19
|
+
function H(t) {
|
|
20
20
|
return t.children;
|
|
21
21
|
}
|
|
22
|
-
function
|
|
22
|
+
function B(t, e) {
|
|
23
23
|
this.props = t, this.context = e;
|
|
24
24
|
}
|
|
25
|
-
function
|
|
26
|
-
if (e == null) return t.__ ?
|
|
25
|
+
function P(t, e) {
|
|
26
|
+
if (e == null) return t.__ ? P(t.__, t.__i + 1) : null;
|
|
27
27
|
for (var n; e < t.__k.length; e++) if ((n = t.__k[e]) != null && n.__e != null) return n.__e;
|
|
28
|
-
return typeof t.type == "function" ?
|
|
28
|
+
return typeof t.type == "function" ? P(t) : null;
|
|
29
29
|
}
|
|
30
|
-
function
|
|
30
|
+
function re(t) {
|
|
31
31
|
var e, n;
|
|
32
32
|
if ((t = t.__) != null && t.__c != null) {
|
|
33
33
|
for (t.__e = t.__c.base = null, e = 0; e < t.__k.length; e++) if ((n = t.__k[e]) != null && n.__e != null) {
|
|
34
34
|
t.__e = t.__c.base = n.__e;
|
|
35
35
|
break;
|
|
36
36
|
}
|
|
37
|
-
return
|
|
37
|
+
return re(t);
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
|
-
function
|
|
41
|
-
(!t.__d && (t.__d = !0) && F.push(t) && !
|
|
40
|
+
function X(t) {
|
|
41
|
+
(!t.__d && (t.__d = !0) && F.push(t) && !A.__r++ || Q != p.debounceRendering) && ((Q = p.debounceRendering) || ne)(A);
|
|
42
42
|
}
|
|
43
|
-
function
|
|
44
|
-
for (var t, e, n, i, r, s, _,
|
|
45
|
-
|
|
43
|
+
function A() {
|
|
44
|
+
for (var t, e, n, i, r, s, _, a = 1; F.length; ) F.length > a && F.sort(ie), t = F.shift(), a = F.length, t.__d && (n = void 0, i = void 0, r = (i = (e = t).__v).__e, s = [], _ = [], e.__P && ((n = k({}, i)).__v = i.__v + 1, p.vnode && p.vnode(n), q(e.__P, n, i, e.__n, e.__P.namespaceURI, 32 & i.__u ? [r] : null, s, r ?? P(i), !!(32 & i.__u), _), n.__v = i.__v, n.__.__k[n.__i] = n, ae(s, n, _), i.__e = i.__ = null, n.__e != r && re(n)));
|
|
45
|
+
A.__r = 0;
|
|
46
46
|
}
|
|
47
|
-
function
|
|
48
|
-
var o, m,
|
|
49
|
-
for (
|
|
50
|
-
return n.__e =
|
|
47
|
+
function _e(t, e, n, i, r, s, _, a, f, c, u) {
|
|
48
|
+
var o, m, l, g, y, v, d, h = i && i.__k || oe, S = e.length;
|
|
49
|
+
for (f = pe(n, e, h, f, S), o = 0; o < S; o++) (l = n.__k[o]) != null && (m = l.__i == -1 ? I : h[l.__i] || I, l.__i = o, v = q(t, l, m, r, s, _, a, f, c, u), g = l.__e, l.ref && m.ref != l.ref && (m.ref && G(m.ref, null, l), u.push(l.ref, l.__c || g, l)), y == null && g != null && (y = g), (d = !!(4 & l.__u)) || m.__k === l.__k ? f = ce(l, f, t, d) : typeof l.type == "function" && v !== void 0 ? f = v : g && (f = g.nextSibling), l.__u &= -7);
|
|
50
|
+
return n.__e = y, f;
|
|
51
51
|
}
|
|
52
52
|
function pe(t, e, n, i, r) {
|
|
53
|
-
var s, _,
|
|
54
|
-
for (t.__k = new Array(r), s = 0; s < r; s++) (_ = e[s]) != null && typeof _ != "boolean" && typeof _ != "function" ? (
|
|
55
|
-
if (o) for (s = 0; s <
|
|
53
|
+
var s, _, a, f, c, u = n.length, o = u, m = 0;
|
|
54
|
+
for (t.__k = new Array(r), s = 0; s < r; s++) (_ = e[s]) != null && typeof _ != "boolean" && typeof _ != "function" ? (f = s + m, (_ = t.__k[s] = typeof _ == "string" || typeof _ == "number" || typeof _ == "bigint" || _.constructor == String ? T(null, _, null, null, null) : W(_) ? T(H, { children: _ }, null, null, null) : _.constructor == null && _.__b > 0 ? T(_.type, _.props, _.key, _.ref ? _.ref : null, _.__v) : _).__ = t, _.__b = t.__b + 1, a = null, (c = _.__i = me(_, n, f, o)) != -1 && (o--, (a = n[c]) && (a.__u |= 2)), a == null || a.__v == null ? (c == -1 && (r > u ? m-- : r < u && m++), typeof _.type != "function" && (_.__u |= 4)) : c != f && (c == f - 1 ? m-- : c == f + 1 ? m++ : (c > f ? m-- : m++, _.__u |= 4))) : t.__k[s] = null;
|
|
55
|
+
if (o) for (s = 0; s < u; s++) (a = n[s]) != null && (2 & a.__u) == 0 && (a.__e == i && (i = P(a)), fe(a, a));
|
|
56
56
|
return i;
|
|
57
57
|
}
|
|
58
|
-
function
|
|
58
|
+
function ce(t, e, n, i) {
|
|
59
59
|
var r, s;
|
|
60
60
|
if (typeof t.type == "function") {
|
|
61
|
-
for (r = t.__k, s = 0; r && s < r.length; s++) r[s] && (r[s].__ = t, e =
|
|
61
|
+
for (r = t.__k, s = 0; r && s < r.length; s++) r[s] && (r[s].__ = t, e = ce(r[s], e, n, i));
|
|
62
62
|
return e;
|
|
63
63
|
}
|
|
64
|
-
t.__e != e && (i && (e && t.type && !e.parentNode && (e =
|
|
64
|
+
t.__e != e && (i && (e && t.type && !e.parentNode && (e = P(t)), n.insertBefore(t.__e, e || null)), e = t.__e);
|
|
65
65
|
do
|
|
66
66
|
e = e && e.nextSibling;
|
|
67
67
|
while (e != null && e.nodeType == 8);
|
|
68
68
|
return e;
|
|
69
69
|
}
|
|
70
70
|
function me(t, e, n, i) {
|
|
71
|
-
var r, s, _,
|
|
72
|
-
if (c === null && t.key == null ||
|
|
73
|
-
if (i > (
|
|
74
|
-
for (r = n - 1, s = n + 1; r >= 0 || s < e.length; ) if ((c = e[_ = r >= 0 ? r-- : s++]) != null && (2 & c.__u) == 0 &&
|
|
71
|
+
var r, s, _, a = t.key, f = t.type, c = e[n], u = c != null && (2 & c.__u) == 0;
|
|
72
|
+
if (c === null && t.key == null || u && a == c.key && f == c.type) return n;
|
|
73
|
+
if (i > (u ? 1 : 0)) {
|
|
74
|
+
for (r = n - 1, s = n + 1; r >= 0 || s < e.length; ) if ((c = e[_ = r >= 0 ? r-- : s++]) != null && (2 & c.__u) == 0 && a == c.key && f == c.type) return _;
|
|
75
75
|
}
|
|
76
76
|
return -1;
|
|
77
77
|
}
|
|
78
|
-
function
|
|
79
|
-
e[0] == "-" ? t.setProperty(e, n ?? "") : t[e] = n == null ? "" : typeof n != "number" ||
|
|
78
|
+
function Y(t, e, n) {
|
|
79
|
+
e[0] == "-" ? t.setProperty(e, n ?? "") : t[e] = n == null ? "" : typeof n != "number" || de.test(e) ? n : n + "px";
|
|
80
80
|
}
|
|
81
|
-
function
|
|
81
|
+
function U(t, e, n, i, r) {
|
|
82
82
|
var s, _;
|
|
83
83
|
e: if (e == "style") if (typeof n == "string") t.style.cssText = n;
|
|
84
84
|
else {
|
|
85
|
-
if (typeof i == "string" && (t.style.cssText = i = ""), i) for (e in i) n && e in n ||
|
|
86
|
-
if (n) for (e in n) i && n[e] == i[e] ||
|
|
85
|
+
if (typeof i == "string" && (t.style.cssText = i = ""), i) for (e in i) n && e in n || Y(t.style, e, "");
|
|
86
|
+
if (n) for (e in n) i && n[e] == i[e] || Y(t.style, e, n[e]);
|
|
87
87
|
}
|
|
88
|
-
else if (e[0] == "o" && e[1] == "n") s = e != (e = e.replace(
|
|
88
|
+
else if (e[0] == "o" && e[1] == "n") s = e != (e = e.replace(se, "$1")), _ = e.toLowerCase(), e = _ in t || e == "onFocusOut" || e == "onFocusIn" ? _.slice(2) : e.slice(2), t.l || (t.l = {}), t.l[e + s] = n, n ? i ? n.u = i.u : (n.u = K, t.addEventListener(e, s ? j : z, s)) : t.removeEventListener(e, s ? j : z, s);
|
|
89
89
|
else {
|
|
90
90
|
if (r == "http://www.w3.org/2000/svg") e = e.replace(/xlink(H|:h)/, "h").replace(/sName$/, "s");
|
|
91
91
|
else if (e != "width" && e != "height" && e != "href" && e != "list" && e != "form" && e != "tabIndex" && e != "download" && e != "rowSpan" && e != "colSpan" && e != "role" && e != "popover" && e in t) try {
|
|
@@ -96,173 +96,159 @@ function B(t, e, n, i, r) {
|
|
|
96
96
|
typeof n == "function" || (n == null || n === !1 && e[4] != "-" ? t.removeAttribute(e) : t.setAttribute(e, e == "popover" && n == 1 ? "" : n));
|
|
97
97
|
}
|
|
98
98
|
}
|
|
99
|
-
function
|
|
99
|
+
function Z(t) {
|
|
100
100
|
return function(e) {
|
|
101
101
|
if (this.l) {
|
|
102
102
|
var n = this.l[e.type + t];
|
|
103
|
-
if (e.t == null) e.t =
|
|
103
|
+
if (e.t == null) e.t = K++;
|
|
104
104
|
else if (e.t < n.u) return;
|
|
105
|
-
return n(
|
|
105
|
+
return n(p.event ? p.event(e) : e);
|
|
106
106
|
}
|
|
107
107
|
};
|
|
108
108
|
}
|
|
109
|
-
function
|
|
110
|
-
var
|
|
109
|
+
function q(t, e, n, i, r, s, _, a, f, c) {
|
|
110
|
+
var u, o, m, l, g, y, v, d, h, S, w, M, x, J, L, D, O, b = e.type;
|
|
111
111
|
if (e.constructor != null) return null;
|
|
112
|
-
128 & n.__u && (
|
|
112
|
+
128 & n.__u && (f = !!(32 & n.__u), s = [a = e.__e = n.__e]), (u = p.__b) && u(e);
|
|
113
113
|
e: if (typeof b == "function") try {
|
|
114
|
-
if (
|
|
114
|
+
if (d = e.props, h = "prototype" in b && b.prototype.render, S = (u = b.contextType) && i[u.__c], w = u ? S ? S.props.value : u.__ : i, n.__c ? v = (o = e.__c = n.__c).__ = o.__E : (h ? e.__c = o = new b(d, w) : (e.__c = o = new B(d, w), o.constructor = b, o.render = ve), S && S.sub(o), o.props = d, o.state || (o.state = {}), o.context = w, o.__n = i, m = o.__d = !0, o.__h = [], o._sb = []), h && o.__s == null && (o.__s = o.state), h && b.getDerivedStateFromProps != null && (o.__s == o.state && (o.__s = k({}, o.__s)), k(o.__s, b.getDerivedStateFromProps(d, o.__s))), l = o.props, g = o.state, o.__v = e, m) h && b.getDerivedStateFromProps == null && o.componentWillMount != null && o.componentWillMount(), h && o.componentDidMount != null && o.__h.push(o.componentDidMount);
|
|
115
115
|
else {
|
|
116
|
-
if (
|
|
117
|
-
for (e.__v != n.__v && (o.props =
|
|
118
|
-
|
|
119
|
-
}),
|
|
116
|
+
if (h && b.getDerivedStateFromProps == null && d !== l && o.componentWillReceiveProps != null && o.componentWillReceiveProps(d, w), !o.__e && o.shouldComponentUpdate != null && o.shouldComponentUpdate(d, o.__s, w) === !1 || e.__v == n.__v) {
|
|
117
|
+
for (e.__v != n.__v && (o.props = d, o.state = o.__s, o.__d = !1), e.__e = n.__e, e.__k = n.__k, e.__k.some(function(C) {
|
|
118
|
+
C && (C.__ = e);
|
|
119
|
+
}), M = 0; M < o._sb.length; M++) o.__h.push(o._sb[M]);
|
|
120
120
|
o._sb = [], o.__h.length && _.push(o);
|
|
121
121
|
break e;
|
|
122
122
|
}
|
|
123
|
-
o.componentWillUpdate != null && o.componentWillUpdate(
|
|
124
|
-
o.componentDidUpdate(
|
|
123
|
+
o.componentWillUpdate != null && o.componentWillUpdate(d, o.__s, w), h && o.componentDidUpdate != null && o.__h.push(function() {
|
|
124
|
+
o.componentDidUpdate(l, g, y);
|
|
125
125
|
});
|
|
126
126
|
}
|
|
127
|
-
if (o.context = w, o.props =
|
|
128
|
-
for (o.state = o.__s, o.__d = !1, x && x(e),
|
|
127
|
+
if (o.context = w, o.props = d, o.__P = t, o.__e = !1, x = p.__r, J = 0, h) {
|
|
128
|
+
for (o.state = o.__s, o.__d = !1, x && x(e), u = o.render(o.props, o.state, o.context), L = 0; L < o._sb.length; L++) o.__h.push(o._sb[L]);
|
|
129
129
|
o._sb = [];
|
|
130
130
|
} else do
|
|
131
|
-
o.__d = !1, x && x(e),
|
|
132
|
-
while (o.__d && ++
|
|
133
|
-
o.state = o.__s, o.getChildContext != null && (i = k(k({}, i), o.getChildContext())),
|
|
134
|
-
} catch (
|
|
135
|
-
if (e.__v = null,
|
|
136
|
-
for (e.__u |=
|
|
137
|
-
s[s.indexOf(
|
|
131
|
+
o.__d = !1, x && x(e), u = o.render(o.props, o.state, o.context), o.state = o.__s;
|
|
132
|
+
while (o.__d && ++J < 25);
|
|
133
|
+
o.state = o.__s, o.getChildContext != null && (i = k(k({}, i), o.getChildContext())), h && !m && o.getSnapshotBeforeUpdate != null && (y = o.getSnapshotBeforeUpdate(l, g)), D = u, u != null && u.type === H && u.key == null && (D = le(u.props.children)), a = _e(t, W(D) ? D : [D], e, n, i, r, s, _, a, f, c), o.base = e.__e, e.__u &= -161, o.__h.length && _.push(o), v && (o.__E = o.__ = null);
|
|
134
|
+
} catch (C) {
|
|
135
|
+
if (e.__v = null, f || s != null) if (C.then) {
|
|
136
|
+
for (e.__u |= f ? 160 : 128; a && a.nodeType == 8 && a.nextSibling; ) a = a.nextSibling;
|
|
137
|
+
s[s.indexOf(a)] = null, e.__e = a;
|
|
138
138
|
} else {
|
|
139
|
-
for (
|
|
140
|
-
|
|
139
|
+
for (O = s.length; O--; ) V(s[O]);
|
|
140
|
+
R(e);
|
|
141
141
|
}
|
|
142
|
-
else e.__e = n.__e, e.__k = n.__k,
|
|
143
|
-
|
|
142
|
+
else e.__e = n.__e, e.__k = n.__k, C.then || R(e);
|
|
143
|
+
p.__e(C, e, n);
|
|
144
144
|
}
|
|
145
|
-
else s == null && e.__v == n.__v ? (e.__k = n.__k, e.__e = n.__e) :
|
|
146
|
-
return (
|
|
145
|
+
else s == null && e.__v == n.__v ? (e.__k = n.__k, e.__e = n.__e) : a = e.__e = ge(n.__e, e, n, i, r, s, _, f, c);
|
|
146
|
+
return (u = p.diffed) && u(e), 128 & e.__u ? void 0 : a;
|
|
147
147
|
}
|
|
148
|
-
function
|
|
149
|
-
t && t.__c && (t.__c.__e = !0), t && t.__k && t.__k.forEach(
|
|
148
|
+
function R(t) {
|
|
149
|
+
t && t.__c && (t.__c.__e = !0), t && t.__k && t.__k.forEach(R);
|
|
150
150
|
}
|
|
151
|
-
function
|
|
152
|
-
for (var i = 0; i < n.length; i++)
|
|
153
|
-
|
|
151
|
+
function ae(t, e, n) {
|
|
152
|
+
for (var i = 0; i < n.length; i++) G(n[i], n[++i], n[++i]);
|
|
153
|
+
p.__c && p.__c(e, t), t.some(function(r) {
|
|
154
154
|
try {
|
|
155
155
|
t = r.__h, r.__h = [], t.some(function(s) {
|
|
156
156
|
s.call(r);
|
|
157
157
|
});
|
|
158
158
|
} catch (s) {
|
|
159
|
-
|
|
159
|
+
p.__e(s, r.__v);
|
|
160
160
|
}
|
|
161
161
|
});
|
|
162
162
|
}
|
|
163
|
-
function
|
|
164
|
-
return typeof t != "object" || t == null || t.__b && t.__b > 0 ? t : W(t) ? t.map(
|
|
163
|
+
function le(t) {
|
|
164
|
+
return typeof t != "object" || t == null || t.__b && t.__b > 0 ? t : W(t) ? t.map(le) : k({}, t);
|
|
165
165
|
}
|
|
166
|
-
function ge(t, e, n, i, r, s, _,
|
|
167
|
-
var c,
|
|
168
|
-
if (
|
|
169
|
-
for (c = 0; c < s.length; c++) if ((
|
|
170
|
-
t =
|
|
166
|
+
function ge(t, e, n, i, r, s, _, a, f) {
|
|
167
|
+
var c, u, o, m, l, g, y, v = n.props, d = e.props, h = e.type;
|
|
168
|
+
if (h == "svg" ? r = "http://www.w3.org/2000/svg" : h == "math" ? r = "http://www.w3.org/1998/Math/MathML" : r || (r = "http://www.w3.org/1999/xhtml"), s != null) {
|
|
169
|
+
for (c = 0; c < s.length; c++) if ((l = s[c]) && "setAttribute" in l == !!h && (h ? l.localName == h : l.nodeType == 3)) {
|
|
170
|
+
t = l, s[c] = null;
|
|
171
171
|
break;
|
|
172
172
|
}
|
|
173
173
|
}
|
|
174
174
|
if (t == null) {
|
|
175
|
-
if (
|
|
176
|
-
t = document.createElementNS(r,
|
|
175
|
+
if (h == null) return document.createTextNode(d);
|
|
176
|
+
t = document.createElementNS(r, h, d.is && d), a && (p.__m && p.__m(e, s), a = !1), s = null;
|
|
177
177
|
}
|
|
178
|
-
if (
|
|
178
|
+
if (h == null) v === d || a && t.data == d || (t.data = d);
|
|
179
179
|
else {
|
|
180
|
-
if (s = s &&
|
|
181
|
-
for (c in
|
|
182
|
-
if (c == "dangerouslySetInnerHTML") o =
|
|
183
|
-
else if (!(c in
|
|
184
|
-
if (c == "value" && "defaultValue" in
|
|
185
|
-
|
|
180
|
+
if (s = s && $.call(t.childNodes), v = n.props || I, !a && s != null) for (v = {}, c = 0; c < t.attributes.length; c++) v[(l = t.attributes[c]).name] = l.value;
|
|
181
|
+
for (c in v) if (l = v[c], c != "children") {
|
|
182
|
+
if (c == "dangerouslySetInnerHTML") o = l;
|
|
183
|
+
else if (!(c in d)) {
|
|
184
|
+
if (c == "value" && "defaultValue" in d || c == "checked" && "defaultChecked" in d) continue;
|
|
185
|
+
U(t, c, null, l, r);
|
|
186
186
|
}
|
|
187
187
|
}
|
|
188
|
-
for (c in
|
|
189
|
-
if (
|
|
190
|
-
else if (o && (t.innerHTML = ""),
|
|
191
|
-
|
|
188
|
+
for (c in d) l = d[c], c == "children" ? m = l : c == "dangerouslySetInnerHTML" ? u = l : c == "value" ? g = l : c == "checked" ? y = l : a && typeof l != "function" || v[c] === l || U(t, c, l, v[c], r);
|
|
189
|
+
if (u) a || o && (u.__html == o.__html || u.__html == t.innerHTML) || (t.innerHTML = u.__html), e.__k = [];
|
|
190
|
+
else if (o && (t.innerHTML = ""), _e(e.type == "template" ? t.content : t, W(m) ? m : [m], e, n, i, h == "foreignObject" ? "http://www.w3.org/1999/xhtml" : r, s, _, s ? s[0] : n.__k && P(n, 0), a, f), s != null) for (c = s.length; c--; ) V(s[c]);
|
|
191
|
+
a || (c = "value", h == "progress" && g == null ? t.removeAttribute("value") : g != null && (g !== t[c] || h == "progress" && !g || h == "option" && g != v[c]) && U(t, c, g, v[c], r), c = "checked", y != null && y != t[c] && U(t, c, y, v[c], r));
|
|
192
192
|
}
|
|
193
193
|
return t;
|
|
194
194
|
}
|
|
195
|
-
function
|
|
195
|
+
function G(t, e, n) {
|
|
196
196
|
try {
|
|
197
197
|
if (typeof t == "function") {
|
|
198
198
|
var i = typeof t.__u == "function";
|
|
199
199
|
i && t.__u(), i && e == null || (t.__u = t(e));
|
|
200
200
|
} else t.current = e;
|
|
201
201
|
} catch (r) {
|
|
202
|
-
|
|
202
|
+
p.__e(r, n);
|
|
203
203
|
}
|
|
204
204
|
}
|
|
205
|
-
function
|
|
205
|
+
function fe(t, e, n) {
|
|
206
206
|
var i, r;
|
|
207
|
-
if (
|
|
207
|
+
if (p.unmount && p.unmount(t), (i = t.ref) && (i.current && i.current != t.__e || G(i, null, e)), (i = t.__c) != null) {
|
|
208
208
|
if (i.componentWillUnmount) try {
|
|
209
209
|
i.componentWillUnmount();
|
|
210
210
|
} catch (s) {
|
|
211
|
-
|
|
211
|
+
p.__e(s, e);
|
|
212
212
|
}
|
|
213
213
|
i.base = i.__P = null;
|
|
214
214
|
}
|
|
215
|
-
if (i = t.__k) for (r = 0; r < i.length; r++) i[r] &&
|
|
216
|
-
n ||
|
|
215
|
+
if (i = t.__k) for (r = 0; r < i.length; r++) i[r] && fe(i[r], e, n || typeof t.type != "function");
|
|
216
|
+
n || V(t.__e), t.__c = t.__ = t.__e = void 0;
|
|
217
217
|
}
|
|
218
|
-
function
|
|
218
|
+
function ve(t, e, n) {
|
|
219
219
|
return this.constructor(t, n);
|
|
220
220
|
}
|
|
221
|
-
function
|
|
221
|
+
function ye(t, e, n) {
|
|
222
222
|
var i, r, s, _;
|
|
223
|
-
e == document && (e = document.documentElement),
|
|
223
|
+
e == document && (e = document.documentElement), p.__ && p.__(t, e), r = (i = !1) ? null : e.__k, s = [], _ = [], q(e, t = e.__k = he(H, null, [t]), r || I, I, e.namespaceURI, r ? null : e.firstChild ? $.call(e.childNodes) : null, s, r ? r.__e : e.firstChild, i, _), ae(s, t, _);
|
|
224
224
|
}
|
|
225
|
-
|
|
225
|
+
$ = oe.slice, p = { __e: function(t, e, n, i) {
|
|
226
226
|
for (var r, s, _; e = e.__; ) if ((r = e.__c) && !r.__) try {
|
|
227
227
|
if ((s = r.constructor) && s.getDerivedStateFromError != null && (r.setState(s.getDerivedStateFromError(t)), _ = r.__d), r.componentDidCatch != null && (r.componentDidCatch(t, i || {}), _ = r.__d), _) return r.__E = r;
|
|
228
|
-
} catch (
|
|
229
|
-
t =
|
|
228
|
+
} catch (a) {
|
|
229
|
+
t = a;
|
|
230
230
|
}
|
|
231
231
|
throw t;
|
|
232
|
-
} },
|
|
232
|
+
} }, te = 0, ue = function(t) {
|
|
233
233
|
return t != null && t.constructor == null;
|
|
234
|
-
},
|
|
234
|
+
}, B.prototype.setState = function(t, e) {
|
|
235
235
|
var n;
|
|
236
|
-
n = this.__s != null && this.__s != this.state ? this.__s : this.__s = k({}, this.state), typeof t == "function" && (t = t(k({}, n), this.props)), t && k(n, t), t != null && this.__v && (e && this._sb.push(e),
|
|
237
|
-
},
|
|
238
|
-
this.__v && (this.__e = !0, t && this.__h.push(t),
|
|
239
|
-
},
|
|
236
|
+
n = this.__s != null && this.__s != this.state ? this.__s : this.__s = k({}, this.state), typeof t == "function" && (t = t(k({}, n), this.props)), t && k(n, t), t != null && this.__v && (e && this._sb.push(e), X(this));
|
|
237
|
+
}, B.prototype.forceUpdate = function(t) {
|
|
238
|
+
this.__v && (this.__e = !0, t && this.__h.push(t), X(this));
|
|
239
|
+
}, B.prototype.render = H, F = [], ne = typeof Promise == "function" ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, ie = function(t, e) {
|
|
240
240
|
return t.__v.__b - e.__v.__b;
|
|
241
|
-
},
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
Component: D,
|
|
245
|
-
Fragment: L,
|
|
246
|
-
createElement: R,
|
|
247
|
-
h: R,
|
|
248
|
-
get isValidElement() {
|
|
249
|
-
return ie;
|
|
250
|
-
},
|
|
251
|
-
get options() {
|
|
252
|
-
return d;
|
|
253
|
-
},
|
|
254
|
-
render: ve
|
|
255
|
-
}, Symbol.toStringTag, { value: "Module" }));
|
|
256
|
-
var ke = 0;
|
|
257
|
-
function Se(t, e, n, i, r, s) {
|
|
241
|
+
}, A.__r = 0, se = /(PointerCapture)$|Capture$/i, K = 0, z = Z(!1), j = Z(!0);
|
|
242
|
+
var be = 0;
|
|
243
|
+
function ke(t, e, n, i, r, s) {
|
|
258
244
|
e || (e = {});
|
|
259
|
-
var _,
|
|
260
|
-
if ("ref" in
|
|
261
|
-
var c = { type: t, props:
|
|
262
|
-
if (typeof t == "function" && (_ = t.defaultProps)) for (
|
|
263
|
-
return
|
|
245
|
+
var _, a, f = e;
|
|
246
|
+
if ("ref" in f) for (a in f = {}, e) a == "ref" ? _ = e[a] : f[a] = e[a];
|
|
247
|
+
var c = { type: t, props: f, key: n, ref: _, __k: null, __: null, __b: 0, __e: null, __c: null, constructor: void 0, __v: --be, __i: -1, __u: 0, __source: r, __self: s };
|
|
248
|
+
if (typeof t == "function" && (_ = t.defaultProps)) for (a in _) f[a] === void 0 && (f[a] = _[a]);
|
|
249
|
+
return p.vnode && p.vnode(c), c;
|
|
264
250
|
}
|
|
265
|
-
function
|
|
251
|
+
function Se() {
|
|
266
252
|
const t = {
|
|
267
253
|
_i: [],
|
|
268
254
|
apiKey: "",
|
|
@@ -282,10 +268,10 @@ function we() {
|
|
|
282
268
|
r && !r.startsWith("/") && (r = "/" + r), r = r.replace(/\/+$/, "");
|
|
283
269
|
const s = `${t.config.host}${r}/encatch-web-sdk.js`, _ = document.createElement("script");
|
|
284
270
|
_.src = s, _.type = "module", _.async = !0;
|
|
285
|
-
const
|
|
286
|
-
|
|
287
|
-
const
|
|
288
|
-
|
|
271
|
+
const a = document.head.firstChild;
|
|
272
|
+
a ? document.head.insertBefore(_, a) : document.head.appendChild(_);
|
|
273
|
+
const f = document.createElement("div");
|
|
274
|
+
f.id = "enisght-root", document.body.appendChild(f);
|
|
289
275
|
}
|
|
290
276
|
}
|
|
291
277
|
}, e = [
|
|
@@ -314,24 +300,24 @@ function we() {
|
|
|
314
300
|
});
|
|
315
301
|
}), t;
|
|
316
302
|
}
|
|
317
|
-
let
|
|
318
|
-
async function
|
|
319
|
-
if (!(
|
|
320
|
-
|
|
303
|
+
let ee = !1;
|
|
304
|
+
async function we() {
|
|
305
|
+
if (!(ee || typeof window > "u" || typeof document > "u")) {
|
|
306
|
+
ee = !0;
|
|
321
307
|
try {
|
|
322
|
-
const
|
|
308
|
+
const t = (await import("./core-wrapper-DnkpWu-Q.js")).default;
|
|
323
309
|
if (typeof document > "u") return;
|
|
324
|
-
let
|
|
325
|
-
!
|
|
310
|
+
let e = document.getElementById("enisght-root");
|
|
311
|
+
!e && document.body && (e = document.createElement("div"), e.id = "enisght-root", document.body.appendChild(e)), e && ye(/* @__PURE__ */ ke(t, {}), e);
|
|
326
312
|
} catch (t) {
|
|
327
313
|
console.error("Failed to load Encatch core:", t);
|
|
328
314
|
}
|
|
329
315
|
}
|
|
330
316
|
}
|
|
331
317
|
let E = null;
|
|
332
|
-
class
|
|
318
|
+
class N {
|
|
333
319
|
constructor() {
|
|
334
|
-
if (this.instance =
|
|
320
|
+
if (this.instance = Se(), typeof window < "u" && (window.encatch || (window.encatch = this.instance)), typeof window < "u" && typeof document < "u" && !document.getElementById("enisght-root")) {
|
|
335
321
|
const e = document.createElement("div");
|
|
336
322
|
e.id = "enisght-root", document.body ? document.body.appendChild(e) : document.readyState === "loading" && document.addEventListener("DOMContentLoaded", () => {
|
|
337
323
|
!document.getElementById("enisght-root") && document.body && document.body.appendChild(e);
|
|
@@ -343,13 +329,13 @@ class $ {
|
|
|
343
329
|
* This provides a convenient API: Encatch.init(apiKey, options)
|
|
344
330
|
*/
|
|
345
331
|
static init(e, n) {
|
|
346
|
-
return E || (E = new
|
|
332
|
+
return E || (E = new N()), E.init(e, n), E;
|
|
347
333
|
}
|
|
348
334
|
/**
|
|
349
335
|
* Get the default singleton instance
|
|
350
336
|
*/
|
|
351
337
|
static getInstance() {
|
|
352
|
-
return E || (E = new
|
|
338
|
+
return E || (E = new N()), E;
|
|
353
339
|
}
|
|
354
340
|
/**
|
|
355
341
|
* Initialize the Encatch SDK
|
|
@@ -360,7 +346,7 @@ class $ {
|
|
|
360
346
|
this.instance.apiKey = e, n && Object.assign(this.instance.config, n);
|
|
361
347
|
return;
|
|
362
348
|
}
|
|
363
|
-
this.instance.initialized || (this.instance.apiKey = e, this.instance.config.host = n?.host || "https://app.encatch.com", n?.autoStartSessionDisabled !== void 0 && (this.instance.config.autoStartSessionDisabled = n.autoStartSessionDisabled), n?.processAfterIdentitySet !== void 0 ? this.instance.config.processAfterIdentitySet = n.processAfterIdentitySet : this.instance.config.processAfterIdentitySet = !1, n?.autoStartEnabled !== void 0 && (this.instance.config.autoStartEnabled = n.autoStartEnabled), n?.themeMode ? this.instance.config.themeMode = n.themeMode : this.instance.config.themeMode = "light", n?.language ? this.instance.config.language = n.language : this.instance.config.language = "en", n?.customCssLink && (this.instance.config.customCssLink = n.customCssLink), n?.setUser && (this.instance.config.setUser = n.setUser), n?.onFormEvent && (this.instance.config.onFormEvent = n.onFormEvent), n?.customProperties && (this.instance.config.customProperties = n.customProperties), n?.onSessionDisabled && (this.instance.config.onSessionDisabled = n.onSessionDisabled), this.instance.initialized = !0, typeof window < "u" && (window.encatch = this.instance),
|
|
349
|
+
this.instance.initialized || (this.instance.apiKey = e, this.instance.config.host = n?.host || "https://app.encatch.com", n?.autoStartSessionDisabled !== void 0 && (this.instance.config.autoStartSessionDisabled = n.autoStartSessionDisabled), n?.processAfterIdentitySet !== void 0 ? this.instance.config.processAfterIdentitySet = n.processAfterIdentitySet : this.instance.config.processAfterIdentitySet = !1, n?.autoStartEnabled !== void 0 && (this.instance.config.autoStartEnabled = n.autoStartEnabled), n?.themeMode ? this.instance.config.themeMode = n.themeMode : this.instance.config.themeMode = "light", n?.language ? this.instance.config.language = n.language : this.instance.config.language = "en", n?.customCssLink && (this.instance.config.customCssLink = n.customCssLink), n?.setUser && (this.instance.config.setUser = n.setUser), n?.onFormEvent && (this.instance.config.onFormEvent = n.onFormEvent), n?.customProperties && (this.instance.config.customProperties = n.customProperties), n?.onSessionDisabled && (this.instance.config.onSessionDisabled = n.onSessionDisabled), this.instance.initialized = !0, typeof window < "u" && (window.encatch = this.instance), we());
|
|
364
350
|
}
|
|
365
351
|
/**
|
|
366
352
|
* Track a custom event
|
|
@@ -483,13 +469,13 @@ class $ {
|
|
|
483
469
|
return this.instance;
|
|
484
470
|
}
|
|
485
471
|
}
|
|
486
|
-
const
|
|
472
|
+
const Ee = typeof window < "u" ? new N() : null;
|
|
487
473
|
export {
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
474
|
+
N as E,
|
|
475
|
+
Ee as e,
|
|
476
|
+
H as k,
|
|
477
|
+
p as l,
|
|
478
|
+
ue as t,
|
|
479
|
+
ke as u,
|
|
480
|
+
B as x
|
|
495
481
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@encatch/web-sdk",
|
|
3
|
-
"version": "0.0.35-beta.
|
|
3
|
+
"version": "0.0.35-beta.4",
|
|
4
4
|
"description": "A powerful, lightweight JavaScript SDK for collecting user feedback and running surveys on web applications",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist-sdk/plugin/sdk/module.js",
|
|
@@ -50,8 +50,8 @@
|
|
|
50
50
|
"preact-iso": "^2.11.0",
|
|
51
51
|
"ua-parser-js": "^2.0.6",
|
|
52
52
|
"@encatch/api-sdk": "0.0.11-beta.2",
|
|
53
|
-
"@encatch/
|
|
54
|
-
"@encatch/
|
|
53
|
+
"@encatch/event-publisher": "0.0.2-beta.0",
|
|
54
|
+
"@encatch/schema": "0.1.38-beta.4"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
57
|
"@preact/preset-vite": "^2.10.2",
|
package/src/module.tsx
CHANGED
|
@@ -15,6 +15,8 @@
|
|
|
15
15
|
|
|
16
16
|
import { createEncatchInstance } from "./encatch-instance";
|
|
17
17
|
import { EncatchConfig, FormEventType, FormEventPayload } from "./@types/encatch-type";
|
|
18
|
+
// Import render statically to avoid dynamic/static import conflict with preact
|
|
19
|
+
import { render } from "preact";
|
|
18
20
|
|
|
19
21
|
let coreLoaded = false;
|
|
20
22
|
|
|
@@ -28,8 +30,7 @@ async function loadCore() {
|
|
|
28
30
|
coreLoaded = true;
|
|
29
31
|
|
|
30
32
|
try {
|
|
31
|
-
// Dynamically import
|
|
32
|
-
const { render } = await import("preact");
|
|
33
|
+
// Dynamically import the core wrapper (preact render is already imported statically)
|
|
33
34
|
const CoreWrapper = (await import("./core-wrapper")).default;
|
|
34
35
|
|
|
35
36
|
// Ensure root exists (SSR-safe)
|