@evelan/jexity-widget 0.11.8 → 0.12.1
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/index.mjs +1047 -951
- package/dist/index.mjs.map +1 -1
- package/dist/react.mjs +1002 -906
- package/dist/react.mjs.map +1 -1
- package/dist/types/lib/history-patch.d.ts +8 -0
- package/dist/types/lib/history-patch.d.ts.map +1 -0
- package/dist/types/lib/widgetBootstrap.d.ts +2 -0
- package/dist/types/lib/widgetBootstrap.d.ts.map +1 -1
- package/dist/types/module/shell/WidgetShell.d.ts +6 -2
- package/dist/types/module/shell/WidgetShell.d.ts.map +1 -1
- package/dist/types/module/shell/hooks/useBootstrap.d.ts +10 -1
- package/dist/types/module/shell/hooks/useBootstrap.d.ts.map +1 -1
- package/dist/types/module/shell/hooks/usePathGuard.d.ts +7 -0
- package/dist/types/module/shell/hooks/usePathGuard.d.ts.map +1 -0
- package/dist/types/module/shell/shell.state.d.ts +12 -0
- package/dist/types/module/shell/shell.state.d.ts.map +1 -1
- package/dist/types/types.d.ts +13 -0
- package/dist/types/types.d.ts.map +1 -1
- package/dist/widget.js +20 -20
- package/dist/widget.js.map +1 -1
- package/package.json +2 -2
package/dist/react.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { createContext as
|
|
2
|
-
const
|
|
3
|
-
function
|
|
4
|
-
const { children: e, ...n } = t, [r, i] =
|
|
5
|
-
|
|
1
|
+
import { createContext as xo, useState as bo, useRef as zt, useEffect as vo, createElement as Dn, useContext as yo } from "react";
|
|
2
|
+
const Br = xo(null);
|
|
3
|
+
function vu(t) {
|
|
4
|
+
const { children: e, ...n } = t, [r, i] = bo(!1), o = zt(null), s = zt(null), l = zt(null), a = n.mode === "embedded";
|
|
5
|
+
vo(() => {
|
|
6
6
|
let d = !1;
|
|
7
|
-
return Promise.resolve().then(() =>
|
|
7
|
+
return Promise.resolve().then(() => xu).then(
|
|
8
8
|
(h) => {
|
|
9
9
|
if (d)
|
|
10
10
|
return;
|
|
@@ -31,40 +31,40 @@ function su(t) {
|
|
|
31
31
|
},
|
|
32
32
|
isOpen: r
|
|
33
33
|
};
|
|
34
|
-
return
|
|
35
|
-
|
|
34
|
+
return Dn(
|
|
35
|
+
Br.Provider,
|
|
36
36
|
{ value: u },
|
|
37
|
-
a ?
|
|
37
|
+
a ? Dn("div", {
|
|
38
38
|
ref: l,
|
|
39
39
|
style: { width: "100%", height: "100%" }
|
|
40
40
|
}) : e
|
|
41
41
|
);
|
|
42
42
|
}
|
|
43
|
-
function
|
|
44
|
-
const t =
|
|
43
|
+
function yu() {
|
|
44
|
+
const t = yo(Br);
|
|
45
45
|
if (!t)
|
|
46
46
|
throw new Error("useJexityChat must be used within a <JexityChatProvider>");
|
|
47
47
|
return t;
|
|
48
48
|
}
|
|
49
|
-
var it, b,
|
|
49
|
+
var it, b, Vr, Hr, he, Bn, Wr, Jr, Kr, vn, Gt, Yt, Zr, Ge = {}, Gr = [], ko = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i, ot = Array.isArray;
|
|
50
50
|
function ee(t, e) {
|
|
51
51
|
for (var n in e) t[n] = e[n];
|
|
52
52
|
return t;
|
|
53
53
|
}
|
|
54
|
-
function
|
|
54
|
+
function yn(t) {
|
|
55
55
|
t && t.parentNode && t.parentNode.removeChild(t);
|
|
56
56
|
}
|
|
57
|
-
function
|
|
57
|
+
function D(t, e, n) {
|
|
58
58
|
var r, i, o, s = {};
|
|
59
59
|
for (o in e) o == "key" ? r = e[o] : o == "ref" ? i = e[o] : s[o] = e[o];
|
|
60
60
|
if (arguments.length > 2 && (s.children = arguments.length > 3 ? it.call(arguments, 2) : n), typeof t == "function" && t.defaultProps != null) for (o in t.defaultProps) s[o] === void 0 && (s[o] = t.defaultProps[o]);
|
|
61
61
|
return He(t, s, r, i, null);
|
|
62
62
|
}
|
|
63
63
|
function He(t, e, n, r, i) {
|
|
64
|
-
var o = { type: t, props: e, key: n, ref: r, __k: null, __: null, __b: 0, __e: null, __c: null, constructor: void 0, __v: i ?? ++
|
|
64
|
+
var o = { type: t, props: e, key: n, ref: r, __k: null, __: null, __b: 0, __e: null, __c: null, constructor: void 0, __v: i ?? ++Vr, __i: -1, __u: 0 };
|
|
65
65
|
return i == null && b.vnode != null && b.vnode(o), o;
|
|
66
66
|
}
|
|
67
|
-
function
|
|
67
|
+
function wo() {
|
|
68
68
|
return { current: null };
|
|
69
69
|
}
|
|
70
70
|
function Q(t) {
|
|
@@ -73,46 +73,46 @@ function Q(t) {
|
|
|
73
73
|
function W(t, e) {
|
|
74
74
|
this.props = t, this.context = e;
|
|
75
75
|
}
|
|
76
|
-
function
|
|
77
|
-
if (e == null) return t.__ ?
|
|
76
|
+
function Ae(t, e) {
|
|
77
|
+
if (e == null) return t.__ ? Ae(t.__, t.__i + 1) : null;
|
|
78
78
|
for (var n; e < t.__k.length; e++) if ((n = t.__k[e]) != null && n.__e != null) return n.__e;
|
|
79
|
-
return typeof t.type == "function" ?
|
|
79
|
+
return typeof t.type == "function" ? Ae(t) : null;
|
|
80
80
|
}
|
|
81
|
-
function
|
|
81
|
+
function Yr(t) {
|
|
82
82
|
var e, n;
|
|
83
83
|
if ((t = t.__) != null && t.__c != null) {
|
|
84
84
|
for (t.__e = t.__c.base = null, e = 0; e < t.__k.length; e++) if ((n = t.__k[e]) != null && n.__e != null) {
|
|
85
85
|
t.__e = t.__c.base = n.__e;
|
|
86
86
|
break;
|
|
87
87
|
}
|
|
88
|
-
return
|
|
88
|
+
return Yr(t);
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
|
-
function
|
|
92
|
-
(!t.__d && (t.__d = !0) && he.push(t) && !bt.__r++ ||
|
|
91
|
+
function Xt(t) {
|
|
92
|
+
(!t.__d && (t.__d = !0) && he.push(t) && !bt.__r++ || Bn != b.debounceRendering) && ((Bn = b.debounceRendering) || Wr)(bt);
|
|
93
93
|
}
|
|
94
94
|
function bt() {
|
|
95
|
-
for (var t, e, n, r, i, o, s, l = 1; he.length; ) he.length > l && he.sort(
|
|
95
|
+
for (var t, e, n, r, i, o, s, l = 1; he.length; ) he.length > l && he.sort(Jr), t = he.shift(), l = he.length, t.__d && (n = void 0, r = void 0, i = (r = (e = t).__v).__e, o = [], s = [], e.__P && ((n = ee({}, r)).__v = r.__v + 1, b.vnode && b.vnode(n), kn(e.__P, n, r, e.__n, e.__P.namespaceURI, 32 & r.__u ? [i] : null, o, i ?? Ae(r), !!(32 & r.__u), s), n.__v = r.__v, n.__.__k[n.__i] = n, ti(o, n, s), r.__e = r.__ = null, n.__e != i && Yr(n)));
|
|
96
96
|
bt.__r = 0;
|
|
97
97
|
}
|
|
98
|
-
function
|
|
99
|
-
var h, p, f, g, m, x, y, v = r && r.__k ||
|
|
100
|
-
for (a =
|
|
98
|
+
function Xr(t, e, n, r, i, o, s, l, a, u, d) {
|
|
99
|
+
var h, p, f, g, m, x, y, v = r && r.__k || Gr, T = e.length;
|
|
100
|
+
for (a = _o(n, e, v, a, T), h = 0; h < T; h++) (f = n.__k[h]) != null && (p = f.__i == -1 ? Ge : v[f.__i] || Ge, f.__i = h, x = kn(t, f, p, i, o, s, l, a, u, d), g = f.__e, f.ref && p.ref != f.ref && (p.ref && wn(p.ref, null, f), d.push(f.ref, f.__c || g, f)), m == null && g != null && (m = g), (y = !!(4 & f.__u)) || p.__k === f.__k ? a = ei(f, a, t, y) : typeof f.type == "function" && x !== void 0 ? a = x : g && (a = g.nextSibling), f.__u &= -7);
|
|
101
101
|
return n.__e = m, a;
|
|
102
102
|
}
|
|
103
|
-
function
|
|
103
|
+
function _o(t, e, n, r, i) {
|
|
104
104
|
var o, s, l, a, u, d = n.length, h = d, p = 0;
|
|
105
|
-
for (t.__k = new Array(i), o = 0; o < i; o++) (s = e[o]) != null && typeof s != "boolean" && typeof s != "function" ? (a = o + p, (s = t.__k[o] = typeof s == "string" || typeof s == "number" || typeof s == "bigint" || s.constructor == String ? He(null, s, null, null, null) : ot(s) ? He(Q, { children: s }, null, null, null) : s.constructor == null && s.__b > 0 ? He(s.type, s.props, s.key, s.ref ? s.ref : null, s.__v) : s).__ = t, s.__b = t.__b + 1, l = null, (u = s.__i =
|
|
106
|
-
if (h) for (o = 0; o < d; o++) (l = n[o]) != null && (2 & l.__u) == 0 && (l.__e == r && (r =
|
|
105
|
+
for (t.__k = new Array(i), o = 0; o < i; o++) (s = e[o]) != null && typeof s != "boolean" && typeof s != "function" ? (a = o + p, (s = t.__k[o] = typeof s == "string" || typeof s == "number" || typeof s == "bigint" || s.constructor == String ? He(null, s, null, null, null) : ot(s) ? He(Q, { children: s }, null, null, null) : s.constructor == null && s.__b > 0 ? He(s.type, s.props, s.key, s.ref ? s.ref : null, s.__v) : s).__ = t, s.__b = t.__b + 1, l = null, (u = s.__i = jo(s, n, a, h)) != -1 && (h--, (l = n[u]) && (l.__u |= 2)), l == null || l.__v == null ? (u == -1 && (i > d ? p-- : i < d && p++), typeof s.type != "function" && (s.__u |= 4)) : u != a && (u == a - 1 ? p-- : u == a + 1 ? p++ : (u > a ? p-- : p++, s.__u |= 4))) : t.__k[o] = null;
|
|
106
|
+
if (h) for (o = 0; o < d; o++) (l = n[o]) != null && (2 & l.__u) == 0 && (l.__e == r && (r = Ae(l)), ri(l, l));
|
|
107
107
|
return r;
|
|
108
108
|
}
|
|
109
|
-
function
|
|
109
|
+
function ei(t, e, n, r) {
|
|
110
110
|
var i, o;
|
|
111
111
|
if (typeof t.type == "function") {
|
|
112
|
-
for (i = t.__k, o = 0; i && o < i.length; o++) i[o] && (i[o].__ = t, e =
|
|
112
|
+
for (i = t.__k, o = 0; i && o < i.length; o++) i[o] && (i[o].__ = t, e = ei(i[o], e, n, r));
|
|
113
113
|
return e;
|
|
114
114
|
}
|
|
115
|
-
t.__e != e && (r && (e && t.type && !e.parentNode && (e =
|
|
115
|
+
t.__e != e && (r && (e && t.type && !e.parentNode && (e = Ae(t)), n.insertBefore(t.__e, e || null)), e = t.__e);
|
|
116
116
|
do
|
|
117
117
|
e = e && e.nextSibling;
|
|
118
118
|
while (e != null && e.nodeType == 8);
|
|
@@ -123,7 +123,7 @@ function te(t, e) {
|
|
|
123
123
|
te(n, e);
|
|
124
124
|
}) : e.push(t)), e;
|
|
125
125
|
}
|
|
126
|
-
function
|
|
126
|
+
function jo(t, e, n, r) {
|
|
127
127
|
var i, o, s, l = t.key, a = t.type, u = e[n], d = u != null && (2 & u.__u) == 0;
|
|
128
128
|
if (u === null && t.key == null || d && l == u.key && a == u.type) return n;
|
|
129
129
|
if (r > (d ? 1 : 0)) {
|
|
@@ -131,17 +131,17 @@ function vo(t, e, n, r) {
|
|
|
131
131
|
}
|
|
132
132
|
return -1;
|
|
133
133
|
}
|
|
134
|
-
function
|
|
135
|
-
e[0] == "-" ? t.setProperty(e, n ?? "") : t[e] = n == null ? "" : typeof n != "number" ||
|
|
134
|
+
function Vn(t, e, n) {
|
|
135
|
+
e[0] == "-" ? t.setProperty(e, n ?? "") : t[e] = n == null ? "" : typeof n != "number" || ko.test(e) ? n : n + "px";
|
|
136
136
|
}
|
|
137
137
|
function ut(t, e, n, r, i) {
|
|
138
138
|
var o, s;
|
|
139
139
|
e: if (e == "style") if (typeof n == "string") t.style.cssText = n;
|
|
140
140
|
else {
|
|
141
|
-
if (typeof r == "string" && (t.style.cssText = r = ""), r) for (e in r) n && e in n ||
|
|
142
|
-
if (n) for (e in n) r && n[e] == r[e] ||
|
|
141
|
+
if (typeof r == "string" && (t.style.cssText = r = ""), r) for (e in r) n && e in n || Vn(t.style, e, "");
|
|
142
|
+
if (n) for (e in n) r && n[e] == r[e] || Vn(t.style, e, n[e]);
|
|
143
143
|
}
|
|
144
|
-
else if (e[0] == "o" && e[1] == "n") o = e != (e = e.replace(
|
|
144
|
+
else if (e[0] == "o" && e[1] == "n") o = e != (e = e.replace(Kr, "$1")), s = e.toLowerCase(), e = s in t || e == "onFocusOut" || e == "onFocusIn" ? s.slice(2) : e.slice(2), t.l || (t.l = {}), t.l[e + o] = n, n ? r ? n.u = r.u : (n.u = vn, t.addEventListener(e, o ? Yt : Gt, o)) : t.removeEventListener(e, o ? Yt : Gt, o);
|
|
145
145
|
else {
|
|
146
146
|
if (i == "http://www.w3.org/2000/svg") e = e.replace(/xlink(H|:h)/, "h").replace(/sName$/, "s");
|
|
147
147
|
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 {
|
|
@@ -152,22 +152,22 @@ function ut(t, e, n, r, i) {
|
|
|
152
152
|
typeof n == "function" || (n == null || n === !1 && e[4] != "-" ? t.removeAttribute(e) : t.setAttribute(e, e == "popover" && n == 1 ? "" : n));
|
|
153
153
|
}
|
|
154
154
|
}
|
|
155
|
-
function
|
|
155
|
+
function Hn(t) {
|
|
156
156
|
return function(e) {
|
|
157
157
|
if (this.l) {
|
|
158
158
|
var n = this.l[e.type + t];
|
|
159
|
-
if (e.t == null) e.t =
|
|
159
|
+
if (e.t == null) e.t = vn++;
|
|
160
160
|
else if (e.t < n.u) return;
|
|
161
161
|
return n(b.event ? b.event(e) : e);
|
|
162
162
|
}
|
|
163
163
|
};
|
|
164
164
|
}
|
|
165
|
-
function
|
|
166
|
-
var d, h, p, f, g, m, x, y, v,
|
|
165
|
+
function kn(t, e, n, r, i, o, s, l, a, u) {
|
|
166
|
+
var d, h, p, f, g, m, x, y, v, T, K, se, B, Fn, ct, Ne, Ot, Z = e.type;
|
|
167
167
|
if (e.constructor != null) return null;
|
|
168
168
|
128 & n.__u && (a = !!(32 & n.__u), o = [l = e.__e = n.__e]), (d = b.__b) && d(e);
|
|
169
169
|
e: if (typeof Z == "function") try {
|
|
170
|
-
if (y = e.props, v = "prototype" in Z && Z.prototype.render,
|
|
170
|
+
if (y = e.props, v = "prototype" in Z && Z.prototype.render, T = (d = Z.contextType) && r[d.__c], K = d ? T ? T.props.value : d.__ : r, n.__c ? x = (h = e.__c = n.__c).__ = h.__E : (v ? e.__c = h = new Z(y, K) : (e.__c = h = new W(y, K), h.constructor = Z, h.render = Co), T && T.sub(h), h.props = y, h.state || (h.state = {}), h.context = K, h.__n = r, p = h.__d = !0, h.__h = [], h._sb = []), v && h.__s == null && (h.__s = h.state), v && Z.getDerivedStateFromProps != null && (h.__s == h.state && (h.__s = ee({}, h.__s)), ee(h.__s, Z.getDerivedStateFromProps(y, h.__s))), f = h.props, g = h.state, h.__v = e, p) v && Z.getDerivedStateFromProps == null && h.componentWillMount != null && h.componentWillMount(), v && h.componentDidMount != null && h.__h.push(h.componentDidMount);
|
|
171
171
|
else {
|
|
172
172
|
if (v && Z.getDerivedStateFromProps == null && y !== f && h.componentWillReceiveProps != null && h.componentWillReceiveProps(y, K), !h.__e && h.shouldComponentUpdate != null && h.shouldComponentUpdate(y, h.__s, K) === !1 || e.__v == n.__v) {
|
|
173
173
|
for (e.__v != n.__v && (h.props = y, h.state = h.__s, h.__d = !1), e.__e = n.__e, e.__k = n.__k, e.__k.some(function(ke) {
|
|
@@ -180,32 +180,32 @@ function bn(t, e, n, r, i, o, s, l, a, u) {
|
|
|
180
180
|
h.componentDidUpdate(f, g, m);
|
|
181
181
|
});
|
|
182
182
|
}
|
|
183
|
-
if (h.context = K, h.props = y, h.__P = t, h.__e = !1, B = b.__r,
|
|
183
|
+
if (h.context = K, h.props = y, h.__P = t, h.__e = !1, B = b.__r, Fn = 0, v) {
|
|
184
184
|
for (h.state = h.__s, h.__d = !1, B && B(e), d = h.render(h.props, h.state, h.context), ct = 0; ct < h._sb.length; ct++) h.__h.push(h._sb[ct]);
|
|
185
185
|
h._sb = [];
|
|
186
186
|
} else do
|
|
187
187
|
h.__d = !1, B && B(e), d = h.render(h.props, h.state, h.context), h.state = h.__s;
|
|
188
|
-
while (h.__d && ++
|
|
189
|
-
h.state = h.__s, h.getChildContext != null && (r = ee(ee({}, r), h.getChildContext())), v && !p && h.getSnapshotBeforeUpdate != null && (m = h.getSnapshotBeforeUpdate(f, g)),
|
|
188
|
+
while (h.__d && ++Fn < 25);
|
|
189
|
+
h.state = h.__s, h.getChildContext != null && (r = ee(ee({}, r), h.getChildContext())), v && !p && h.getSnapshotBeforeUpdate != null && (m = h.getSnapshotBeforeUpdate(f, g)), Ne = d, d != null && d.type === Q && d.key == null && (Ne = ni(d.props.children)), l = Xr(t, ot(Ne) ? Ne : [Ne], e, n, r, i, o, s, l, a, u), h.base = e.__e, e.__u &= -161, h.__h.length && s.push(h), x && (h.__E = h.__ = null);
|
|
190
190
|
} catch (ke) {
|
|
191
191
|
if (e.__v = null, a || o != null) if (ke.then) {
|
|
192
192
|
for (e.__u |= a ? 160 : 128; l && l.nodeType == 8 && l.nextSibling; ) l = l.nextSibling;
|
|
193
193
|
o[o.indexOf(l)] = null, e.__e = l;
|
|
194
194
|
} else {
|
|
195
|
-
for (
|
|
196
|
-
|
|
195
|
+
for (Ot = o.length; Ot--; ) yn(o[Ot]);
|
|
196
|
+
en(e);
|
|
197
197
|
}
|
|
198
|
-
else e.__e = n.__e, e.__k = n.__k, ke.then ||
|
|
198
|
+
else e.__e = n.__e, e.__k = n.__k, ke.then || en(e);
|
|
199
199
|
b.__e(ke, e, n);
|
|
200
200
|
}
|
|
201
|
-
else o == null && e.__v == n.__v ? (e.__k = n.__k, e.__e = n.__e) : l = e.__e =
|
|
201
|
+
else o == null && e.__v == n.__v ? (e.__k = n.__k, e.__e = n.__e) : l = e.__e = So(n.__e, e, n, r, i, o, s, a, u);
|
|
202
202
|
return (d = b.diffed) && d(e), 128 & e.__u ? void 0 : l;
|
|
203
203
|
}
|
|
204
|
-
function
|
|
205
|
-
t && t.__c && (t.__c.__e = !0), t && t.__k && t.__k.forEach(
|
|
204
|
+
function en(t) {
|
|
205
|
+
t && t.__c && (t.__c.__e = !0), t && t.__k && t.__k.forEach(en);
|
|
206
206
|
}
|
|
207
|
-
function
|
|
208
|
-
for (var r = 0; r < n.length; r++)
|
|
207
|
+
function ti(t, e, n) {
|
|
208
|
+
for (var r = 0; r < n.length; r++) wn(n[r], n[++r], n[++r]);
|
|
209
209
|
b.__c && b.__c(e, t), t.some(function(i) {
|
|
210
210
|
try {
|
|
211
211
|
t = i.__h, i.__h = [], t.some(function(o) {
|
|
@@ -216,10 +216,10 @@ function Zr(t, e, n) {
|
|
|
216
216
|
}
|
|
217
217
|
});
|
|
218
218
|
}
|
|
219
|
-
function
|
|
220
|
-
return typeof t != "object" || t == null || t.__b && t.__b > 0 ? t : ot(t) ? t.map(
|
|
219
|
+
function ni(t) {
|
|
220
|
+
return typeof t != "object" || t == null || t.__b && t.__b > 0 ? t : ot(t) ? t.map(ni) : ee({}, t);
|
|
221
221
|
}
|
|
222
|
-
function
|
|
222
|
+
function So(t, e, n, r, i, o, s, l, a) {
|
|
223
223
|
var u, d, h, p, f, g, m, x = n.props, y = e.props, v = e.type;
|
|
224
224
|
if (v == "svg" ? i = "http://www.w3.org/2000/svg" : v == "math" ? i = "http://www.w3.org/1998/Math/MathML" : i || (i = "http://www.w3.org/1999/xhtml"), o != null) {
|
|
225
225
|
for (u = 0; u < o.length; u++) if ((f = o[u]) && "setAttribute" in f == !!v && (v ? f.localName == v : f.nodeType == 3)) {
|
|
@@ -243,12 +243,12 @@ function yo(t, e, n, r, i, o, s, l, a) {
|
|
|
243
243
|
}
|
|
244
244
|
for (u in y) f = y[u], u == "children" ? p = f : u == "dangerouslySetInnerHTML" ? d = f : u == "value" ? g = f : u == "checked" ? m = f : l && typeof f != "function" || x[u] === f || ut(t, u, f, x[u], i);
|
|
245
245
|
if (d) l || h && (d.__html == h.__html || d.__html == t.innerHTML) || (t.innerHTML = d.__html), e.__k = [];
|
|
246
|
-
else if (h && (t.innerHTML = ""),
|
|
246
|
+
else if (h && (t.innerHTML = ""), Xr(e.type == "template" ? t.content : t, ot(p) ? p : [p], e, n, r, v == "foreignObject" ? "http://www.w3.org/1999/xhtml" : i, o, s, o ? o[0] : n.__k && Ae(n, 0), l, a), o != null) for (u = o.length; u--; ) yn(o[u]);
|
|
247
247
|
l || (u = "value", v == "progress" && g == null ? t.removeAttribute("value") : g != null && (g !== t[u] || v == "progress" && !g || v == "option" && g != x[u]) && ut(t, u, g, x[u], i), u = "checked", m != null && m != t[u] && ut(t, u, m, x[u], i));
|
|
248
248
|
}
|
|
249
249
|
return t;
|
|
250
250
|
}
|
|
251
|
-
function
|
|
251
|
+
function wn(t, e, n) {
|
|
252
252
|
try {
|
|
253
253
|
if (typeof t == "function") {
|
|
254
254
|
var r = typeof t.__u == "function";
|
|
@@ -258,9 +258,9 @@ function vn(t, e, n) {
|
|
|
258
258
|
b.__e(i, n);
|
|
259
259
|
}
|
|
260
260
|
}
|
|
261
|
-
function
|
|
261
|
+
function ri(t, e, n) {
|
|
262
262
|
var r, i;
|
|
263
|
-
if (b.unmount && b.unmount(t), (r = t.ref) && (r.current && r.current != t.__e ||
|
|
263
|
+
if (b.unmount && b.unmount(t), (r = t.ref) && (r.current && r.current != t.__e || wn(r, null, e)), (r = t.__c) != null) {
|
|
264
264
|
if (r.componentWillUnmount) try {
|
|
265
265
|
r.componentWillUnmount();
|
|
266
266
|
} catch (o) {
|
|
@@ -268,25 +268,25 @@ function Yr(t, e, n) {
|
|
|
268
268
|
}
|
|
269
269
|
r.base = r.__P = null;
|
|
270
270
|
}
|
|
271
|
-
if (r = t.__k) for (i = 0; i < r.length; i++) r[i] &&
|
|
272
|
-
n ||
|
|
271
|
+
if (r = t.__k) for (i = 0; i < r.length; i++) r[i] && ri(r[i], e, n || typeof t.type != "function");
|
|
272
|
+
n || yn(t.__e), t.__c = t.__ = t.__e = void 0;
|
|
273
273
|
}
|
|
274
|
-
function
|
|
274
|
+
function Co(t, e, n) {
|
|
275
275
|
return this.constructor(t, n);
|
|
276
276
|
}
|
|
277
277
|
function ge(t, e, n) {
|
|
278
278
|
var r, i, o, s;
|
|
279
|
-
e == document && (e = document.documentElement), b.__ && b.__(t, e), i = (r = typeof n == "function") ? null : n && n.__k || e.__k, o = [], s = [],
|
|
279
|
+
e == document && (e = document.documentElement), b.__ && b.__(t, e), i = (r = typeof n == "function") ? null : n && n.__k || e.__k, o = [], s = [], kn(e, t = (!r && n || e).__k = D(Q, null, [t]), i || Ge, Ge, e.namespaceURI, !r && n ? [n] : i ? null : e.firstChild ? it.call(e.childNodes) : null, o, !r && n ? n : i ? i.__e : e.firstChild, r, s), ti(o, t, s);
|
|
280
280
|
}
|
|
281
|
-
function
|
|
282
|
-
ge(t, e,
|
|
281
|
+
function ii(t, e) {
|
|
282
|
+
ge(t, e, ii);
|
|
283
283
|
}
|
|
284
|
-
function
|
|
284
|
+
function Ro(t, e, n) {
|
|
285
285
|
var r, i, o, s, l = ee({}, t.props);
|
|
286
286
|
for (o in t.type && t.type.defaultProps && (s = t.type.defaultProps), e) o == "key" ? r = e[o] : o == "ref" ? i = e[o] : l[o] = e[o] === void 0 && s != null ? s[o] : e[o];
|
|
287
287
|
return arguments.length > 2 && (l.children = arguments.length > 3 ? it.call(arguments, 2) : n), He(t.type, l, r || t.key, i || t.ref, null);
|
|
288
288
|
}
|
|
289
|
-
function
|
|
289
|
+
function To(t) {
|
|
290
290
|
function e(n) {
|
|
291
291
|
var r, i;
|
|
292
292
|
return this.getChildContext || (r = /* @__PURE__ */ new Set(), (i = {})[e.__c] = this, this.getChildContext = function() {
|
|
@@ -295,7 +295,7 @@ function _o(t) {
|
|
|
295
295
|
r = null;
|
|
296
296
|
}, this.shouldComponentUpdate = function(o) {
|
|
297
297
|
this.props.value != o.value && r.forEach(function(s) {
|
|
298
|
-
s.__e = !0,
|
|
298
|
+
s.__e = !0, Xt(s);
|
|
299
299
|
});
|
|
300
300
|
}, this.sub = function(o) {
|
|
301
301
|
r.add(o);
|
|
@@ -305,48 +305,48 @@ function _o(t) {
|
|
|
305
305
|
};
|
|
306
306
|
}), n.children;
|
|
307
307
|
}
|
|
308
|
-
return e.__c = "__cC" +
|
|
308
|
+
return e.__c = "__cC" + Zr++, e.__ = t, e.Provider = e.__l = (e.Consumer = function(n, r) {
|
|
309
309
|
return n.children(r);
|
|
310
310
|
}).contextType = e, e;
|
|
311
311
|
}
|
|
312
|
-
it =
|
|
312
|
+
it = Gr.slice, b = { __e: function(t, e, n, r) {
|
|
313
313
|
for (var i, o, s; e = e.__; ) if ((i = e.__c) && !i.__) try {
|
|
314
314
|
if ((o = i.constructor) && o.getDerivedStateFromError != null && (i.setState(o.getDerivedStateFromError(t)), s = i.__d), i.componentDidCatch != null && (i.componentDidCatch(t, r || {}), s = i.__d), s) return i.__E = i;
|
|
315
315
|
} catch (l) {
|
|
316
316
|
t = l;
|
|
317
317
|
}
|
|
318
318
|
throw t;
|
|
319
|
-
} },
|
|
319
|
+
} }, Vr = 0, Hr = function(t) {
|
|
320
320
|
return t != null && t.constructor == null;
|
|
321
321
|
}, W.prototype.setState = function(t, e) {
|
|
322
322
|
var n;
|
|
323
|
-
n = this.__s != null && this.__s != this.state ? this.__s : this.__s = ee({}, this.state), typeof t == "function" && (t = t(ee({}, n), this.props)), t && ee(n, t), t != null && this.__v && (e && this._sb.push(e),
|
|
323
|
+
n = this.__s != null && this.__s != this.state ? this.__s : this.__s = ee({}, this.state), typeof t == "function" && (t = t(ee({}, n), this.props)), t && ee(n, t), t != null && this.__v && (e && this._sb.push(e), Xt(this));
|
|
324
324
|
}, W.prototype.forceUpdate = function(t) {
|
|
325
|
-
this.__v && (this.__e = !0, t && this.__h.push(t),
|
|
326
|
-
}, W.prototype.render = Q, he = [],
|
|
325
|
+
this.__v && (this.__e = !0, t && this.__h.push(t), Xt(this));
|
|
326
|
+
}, W.prototype.render = Q, he = [], Wr = typeof Promise == "function" ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, Jr = function(t, e) {
|
|
327
327
|
return t.__v.__b - e.__v.__b;
|
|
328
|
-
}, bt.__r = 0,
|
|
329
|
-
var
|
|
328
|
+
}, bt.__r = 0, Kr = /(PointerCapture)$|Capture$/i, vn = 0, Gt = Hn(!1), Yt = Hn(!0), Zr = 0;
|
|
329
|
+
var Ao = 0;
|
|
330
330
|
function c(t, e, n, r, i, o) {
|
|
331
331
|
e || (e = {});
|
|
332
332
|
var s, l, a = e;
|
|
333
333
|
if ("ref" in a) for (l in a = {}, e) l == "ref" ? s = e[l] : a[l] = e[l];
|
|
334
|
-
var u = { type: t, props: a, key: n, ref: s, __k: null, __: null, __b: 0, __e: null, __c: null, constructor: void 0, __v: --
|
|
334
|
+
var u = { type: t, props: a, key: n, ref: s, __k: null, __: null, __b: 0, __e: null, __c: null, constructor: void 0, __v: --Ao, __i: -1, __u: 0, __source: i, __self: o };
|
|
335
335
|
if (typeof t == "function" && (s = t.defaultProps)) for (l in s) a[l] === void 0 && (a[l] = s[l]);
|
|
336
336
|
return b.vnode && b.vnode(u), u;
|
|
337
337
|
}
|
|
338
|
-
var ce, j,
|
|
339
|
-
function
|
|
340
|
-
S.__h && S.__h(j, t,
|
|
338
|
+
var ce, j, Nt, Wn, Ie = 0, oi = [], S = b, Jn = S.__b, Kn = S.__r, Zn = S.diffed, Gn = S.__c, Yn = S.unmount, Xn = S.__;
|
|
339
|
+
function Pe(t, e) {
|
|
340
|
+
S.__h && S.__h(j, t, Ie || e), Ie = 0;
|
|
341
341
|
var n = j.__H || (j.__H = { __: [], __h: [] });
|
|
342
342
|
return t >= n.__.length && n.__.push({}), n.__[t];
|
|
343
343
|
}
|
|
344
344
|
function C(t) {
|
|
345
|
-
return
|
|
345
|
+
return Ie = 1, _n(ci, t);
|
|
346
346
|
}
|
|
347
|
-
function
|
|
348
|
-
var r =
|
|
349
|
-
if (r.t = t, !r.__c && (r.__ = [n ? n(e) :
|
|
347
|
+
function _n(t, e, n) {
|
|
348
|
+
var r = Pe(ce++, 2);
|
|
349
|
+
if (r.t = t, !r.__c && (r.__ = [n ? n(e) : ci(void 0, e), function(l) {
|
|
350
350
|
var a = r.__N ? r.__N[0] : r.__[0], u = r.t(a, l);
|
|
351
351
|
a !== u && (r.__N = [u, r.__[1]], r.__c.setState({}));
|
|
352
352
|
}], r.__c = j, !j.__f)) {
|
|
@@ -378,21 +378,21 @@ function yn(t, e, n) {
|
|
|
378
378
|
}
|
|
379
379
|
return r.__N || r.__;
|
|
380
380
|
}
|
|
381
|
-
function
|
|
382
|
-
var n =
|
|
383
|
-
!S.__s &&
|
|
381
|
+
function R(t, e) {
|
|
382
|
+
var n = Pe(ce++, 3);
|
|
383
|
+
!S.__s && jn(n.__H, e) && (n.__ = t, n.u = e, j.__H.__h.push(n));
|
|
384
384
|
}
|
|
385
385
|
function st(t, e) {
|
|
386
|
-
var n =
|
|
387
|
-
!S.__s &&
|
|
386
|
+
var n = Pe(ce++, 4);
|
|
387
|
+
!S.__s && jn(n.__H, e) && (n.__ = t, n.u = e, j.__h.push(n));
|
|
388
388
|
}
|
|
389
389
|
function ue(t) {
|
|
390
|
-
return
|
|
390
|
+
return Ie = 5, J(function() {
|
|
391
391
|
return { current: t };
|
|
392
392
|
}, []);
|
|
393
393
|
}
|
|
394
|
-
function
|
|
395
|
-
|
|
394
|
+
function si(t, e, n) {
|
|
395
|
+
Ie = 6, st(function() {
|
|
396
396
|
if (typeof t == "function") {
|
|
397
397
|
var r = t(e());
|
|
398
398
|
return function() {
|
|
@@ -405,23 +405,23 @@ function ti(t, e, n) {
|
|
|
405
405
|
}, n == null ? n : n.concat(t));
|
|
406
406
|
}
|
|
407
407
|
function J(t, e) {
|
|
408
|
-
var n =
|
|
409
|
-
return
|
|
408
|
+
var n = Pe(ce++, 7);
|
|
409
|
+
return jn(n.__H, e) && (n.__ = t(), n.__H = e, n.__h = t), n.__;
|
|
410
410
|
}
|
|
411
|
-
function
|
|
412
|
-
return
|
|
411
|
+
function Te(t, e) {
|
|
412
|
+
return Ie = 8, J(function() {
|
|
413
413
|
return t;
|
|
414
414
|
}, e);
|
|
415
415
|
}
|
|
416
|
-
function
|
|
417
|
-
var e = j.context[t.__c], n =
|
|
416
|
+
function It(t) {
|
|
417
|
+
var e = j.context[t.__c], n = Pe(ce++, 9);
|
|
418
418
|
return n.c = t, e ? (n.__ == null && (n.__ = !0, e.sub(j)), e.props.value) : t.__;
|
|
419
419
|
}
|
|
420
|
-
function
|
|
420
|
+
function ai(t, e) {
|
|
421
421
|
S.useDebugValue && S.useDebugValue(e ? e(t) : t);
|
|
422
422
|
}
|
|
423
|
-
function
|
|
424
|
-
var t =
|
|
423
|
+
function li() {
|
|
424
|
+
var t = Pe(ce++, 11);
|
|
425
425
|
if (!t.__) {
|
|
426
426
|
for (var e = j.__v; e !== null && !e.__m && e.__ !== null; ) e = e.__;
|
|
427
427
|
var n = e.__m || (e.__m = [0, 0]);
|
|
@@ -429,43 +429,43 @@ function ri() {
|
|
|
429
429
|
}
|
|
430
430
|
return t.__;
|
|
431
431
|
}
|
|
432
|
-
function
|
|
433
|
-
for (var t; t =
|
|
434
|
-
t.__H.__h.forEach(gt), t.__H.__h.forEach(
|
|
432
|
+
function Io() {
|
|
433
|
+
for (var t; t = oi.shift(); ) if (t.__P && t.__H) try {
|
|
434
|
+
t.__H.__h.forEach(gt), t.__H.__h.forEach(tn), t.__H.__h = [];
|
|
435
435
|
} catch (e) {
|
|
436
436
|
t.__H.__h = [], S.__e(e, t.__v);
|
|
437
437
|
}
|
|
438
438
|
}
|
|
439
439
|
S.__b = function(t) {
|
|
440
|
-
j = null,
|
|
440
|
+
j = null, Jn && Jn(t);
|
|
441
441
|
}, S.__ = function(t, e) {
|
|
442
|
-
t && e.__k && e.__k.__m && (t.__m = e.__k.__m),
|
|
442
|
+
t && e.__k && e.__k.__m && (t.__m = e.__k.__m), Xn && Xn(t, e);
|
|
443
443
|
}, S.__r = function(t) {
|
|
444
|
-
|
|
444
|
+
Kn && Kn(t), ce = 0;
|
|
445
445
|
var e = (j = t.__c).__H;
|
|
446
|
-
e && (
|
|
446
|
+
e && (Nt === j ? (e.__h = [], j.__h = [], e.__.forEach(function(n) {
|
|
447
447
|
n.__N && (n.__ = n.__N), n.u = n.__N = void 0;
|
|
448
|
-
})) : (e.__h.forEach(gt), e.__h.forEach(
|
|
448
|
+
})) : (e.__h.forEach(gt), e.__h.forEach(tn), e.__h = [], ce = 0)), Nt = j;
|
|
449
449
|
}, S.diffed = function(t) {
|
|
450
|
-
|
|
450
|
+
Zn && Zn(t);
|
|
451
451
|
var e = t.__c;
|
|
452
|
-
e && e.__H && (e.__H.__h.length && (
|
|
452
|
+
e && e.__H && (e.__H.__h.length && (oi.push(e) !== 1 && Wn === S.requestAnimationFrame || ((Wn = S.requestAnimationFrame) || $o)(Io)), e.__H.__.forEach(function(n) {
|
|
453
453
|
n.u && (n.__H = n.u), n.u = void 0;
|
|
454
|
-
})),
|
|
454
|
+
})), Nt = j = null;
|
|
455
455
|
}, S.__c = function(t, e) {
|
|
456
456
|
e.some(function(n) {
|
|
457
457
|
try {
|
|
458
458
|
n.__h.forEach(gt), n.__h = n.__h.filter(function(r) {
|
|
459
|
-
return !r.__ ||
|
|
459
|
+
return !r.__ || tn(r);
|
|
460
460
|
});
|
|
461
461
|
} catch (r) {
|
|
462
462
|
e.some(function(i) {
|
|
463
463
|
i.__h && (i.__h = []);
|
|
464
464
|
}), e = [], S.__e(r, n.__v);
|
|
465
465
|
}
|
|
466
|
-
}),
|
|
466
|
+
}), Gn && Gn(t, e);
|
|
467
467
|
}, S.unmount = function(t) {
|
|
468
|
-
|
|
468
|
+
Yn && Yn(t);
|
|
469
469
|
var e, n = t.__c;
|
|
470
470
|
n && n.__H && (n.__H.__.forEach(function(r) {
|
|
471
471
|
try {
|
|
@@ -475,49 +475,49 @@ S.__b = function(t) {
|
|
|
475
475
|
}
|
|
476
476
|
}), n.__H = void 0, e && S.__e(e, n.__v));
|
|
477
477
|
};
|
|
478
|
-
var
|
|
479
|
-
function
|
|
478
|
+
var er = typeof requestAnimationFrame == "function";
|
|
479
|
+
function $o(t) {
|
|
480
480
|
var e, n = function() {
|
|
481
|
-
clearTimeout(r),
|
|
481
|
+
clearTimeout(r), er && cancelAnimationFrame(e), setTimeout(t);
|
|
482
482
|
}, r = setTimeout(n, 35);
|
|
483
|
-
|
|
483
|
+
er && (e = requestAnimationFrame(n));
|
|
484
484
|
}
|
|
485
485
|
function gt(t) {
|
|
486
486
|
var e = j, n = t.__c;
|
|
487
487
|
typeof n == "function" && (t.__c = void 0, n()), j = e;
|
|
488
488
|
}
|
|
489
|
-
function
|
|
489
|
+
function tn(t) {
|
|
490
490
|
var e = j;
|
|
491
491
|
t.__c = t.__(), j = e;
|
|
492
492
|
}
|
|
493
|
-
function
|
|
493
|
+
function jn(t, e) {
|
|
494
494
|
return !t || t.length !== e.length || e.some(function(n, r) {
|
|
495
495
|
return n !== t[r];
|
|
496
496
|
});
|
|
497
497
|
}
|
|
498
|
-
function
|
|
498
|
+
function ci(t, e) {
|
|
499
499
|
return typeof e == "function" ? e(t) : e;
|
|
500
500
|
}
|
|
501
|
-
function
|
|
501
|
+
function ui(t, e) {
|
|
502
502
|
for (var n in e) t[n] = e[n];
|
|
503
503
|
return t;
|
|
504
504
|
}
|
|
505
|
-
function
|
|
505
|
+
function nn(t, e) {
|
|
506
506
|
for (var n in t) if (n !== "__source" && !(n in e)) return !0;
|
|
507
507
|
for (var r in e) if (r !== "__source" && t[r] !== e[r]) return !0;
|
|
508
508
|
return !1;
|
|
509
509
|
}
|
|
510
|
-
function
|
|
510
|
+
function hi(t, e) {
|
|
511
511
|
var n = e(), r = C({ t: { __: n, u: e } }), i = r[0].t, o = r[1];
|
|
512
512
|
return st(function() {
|
|
513
|
-
i.__ = n, i.u = e,
|
|
514
|
-
}, [t, n, e]),
|
|
515
|
-
return
|
|
516
|
-
|
|
513
|
+
i.__ = n, i.u = e, Qt(i) && o({ t: i });
|
|
514
|
+
}, [t, n, e]), R(function() {
|
|
515
|
+
return Qt(i) && o({ t: i }), t(function() {
|
|
516
|
+
Qt(i) && o({ t: i });
|
|
517
517
|
});
|
|
518
518
|
}, [t]), n;
|
|
519
519
|
}
|
|
520
|
-
function
|
|
520
|
+
function Qt(t) {
|
|
521
521
|
var e, n, r = t.u, i = t.__;
|
|
522
522
|
try {
|
|
523
523
|
var o = r();
|
|
@@ -526,80 +526,80 @@ function Nt(t) {
|
|
|
526
526
|
return !0;
|
|
527
527
|
}
|
|
528
528
|
}
|
|
529
|
-
function
|
|
529
|
+
function di(t) {
|
|
530
530
|
t();
|
|
531
531
|
}
|
|
532
|
-
function
|
|
532
|
+
function pi(t) {
|
|
533
533
|
return t;
|
|
534
534
|
}
|
|
535
|
-
function
|
|
536
|
-
return [!1,
|
|
535
|
+
function fi() {
|
|
536
|
+
return [!1, di];
|
|
537
537
|
}
|
|
538
|
-
var
|
|
539
|
-
function
|
|
538
|
+
var gi = st;
|
|
539
|
+
function rn(t, e) {
|
|
540
540
|
this.props = t, this.context = e;
|
|
541
541
|
}
|
|
542
|
-
function
|
|
542
|
+
function Eo(t, e) {
|
|
543
543
|
function n(i) {
|
|
544
544
|
var o = this.props.ref, s = o == i.ref;
|
|
545
|
-
return !s && o && (o.call ? o(null) : o.current = null), e ? !e(this.props, i) || !s :
|
|
545
|
+
return !s && o && (o.call ? o(null) : o.current = null), e ? !e(this.props, i) || !s : nn(this.props, i);
|
|
546
546
|
}
|
|
547
547
|
function r(i) {
|
|
548
|
-
return this.shouldComponentUpdate = n,
|
|
548
|
+
return this.shouldComponentUpdate = n, D(t, i);
|
|
549
549
|
}
|
|
550
550
|
return r.displayName = "Memo(" + (t.displayName || t.name) + ")", r.prototype.isReactComponent = !0, r.__f = !0, r.type = t, r;
|
|
551
551
|
}
|
|
552
|
-
(
|
|
553
|
-
return
|
|
552
|
+
(rn.prototype = new W()).isPureReactComponent = !0, rn.prototype.shouldComponentUpdate = function(t, e) {
|
|
553
|
+
return nn(this.props, t) || nn(this.state, e);
|
|
554
554
|
};
|
|
555
|
-
var
|
|
555
|
+
var tr = b.__b;
|
|
556
556
|
b.__b = function(t) {
|
|
557
|
-
t.type && t.type.__f && t.ref && (t.props.ref = t.ref, t.ref = null),
|
|
557
|
+
t.type && t.type.__f && t.ref && (t.props.ref = t.ref, t.ref = null), tr && tr(t);
|
|
558
558
|
};
|
|
559
|
-
var
|
|
560
|
-
function
|
|
559
|
+
var qo = typeof Symbol < "u" && Symbol.for && /* @__PURE__ */ Symbol.for("react.forward_ref") || 3911;
|
|
560
|
+
function Mo(t) {
|
|
561
561
|
function e(n) {
|
|
562
|
-
var r =
|
|
562
|
+
var r = ui({}, n);
|
|
563
563
|
return delete r.ref, t(r, n.ref || null);
|
|
564
564
|
}
|
|
565
|
-
return e.$$typeof =
|
|
565
|
+
return e.$$typeof = qo, e.render = t, e.prototype.isReactComponent = e.__f = !0, e.displayName = "ForwardRef(" + (t.displayName || t.name) + ")", e;
|
|
566
566
|
}
|
|
567
|
-
var
|
|
567
|
+
var nr = function(t, e) {
|
|
568
568
|
return t == null ? null : te(te(t).map(e));
|
|
569
|
-
},
|
|
569
|
+
}, Po = { map: nr, forEach: nr, count: function(t) {
|
|
570
570
|
return t ? te(t).length : 0;
|
|
571
571
|
}, only: function(t) {
|
|
572
572
|
var e = te(t);
|
|
573
573
|
if (e.length !== 1) throw "Children.only";
|
|
574
574
|
return e[0];
|
|
575
|
-
}, toArray: te },
|
|
575
|
+
}, toArray: te }, Lo = b.__e;
|
|
576
576
|
b.__e = function(t, e, n, r) {
|
|
577
577
|
if (t.then) {
|
|
578
578
|
for (var i, o = e; o = o.__; ) if ((i = o.__c) && i.__c) return e.__e == null && (e.__e = n.__e, e.__k = n.__k), i.__c(t, e);
|
|
579
579
|
}
|
|
580
|
-
|
|
580
|
+
Lo(t, e, n, r);
|
|
581
581
|
};
|
|
582
|
-
var
|
|
583
|
-
function
|
|
582
|
+
var rr = b.unmount;
|
|
583
|
+
function mi(t, e, n) {
|
|
584
584
|
return t && (t.__c && t.__c.__H && (t.__c.__H.__.forEach(function(r) {
|
|
585
585
|
typeof r.__c == "function" && r.__c();
|
|
586
|
-
}), t.__c.__H = null), (t =
|
|
587
|
-
return
|
|
586
|
+
}), t.__c.__H = null), (t = ui({}, t)).__c != null && (t.__c.__P === n && (t.__c.__P = e), t.__c.__e = !0, t.__c = null), t.__k = t.__k && t.__k.map(function(r) {
|
|
587
|
+
return mi(r, e, n);
|
|
588
588
|
})), t;
|
|
589
589
|
}
|
|
590
|
-
function
|
|
590
|
+
function xi(t, e, n) {
|
|
591
591
|
return t && n && (t.__v = null, t.__k = t.__k && t.__k.map(function(r) {
|
|
592
|
-
return
|
|
592
|
+
return xi(r, e, n);
|
|
593
593
|
}), t.__c && t.__c.__P === e && (t.__e && n.appendChild(t.__e), t.__c.__e = !0, t.__c.__P = n)), t;
|
|
594
594
|
}
|
|
595
595
|
function mt() {
|
|
596
596
|
this.__u = 0, this.o = null, this.__b = null;
|
|
597
597
|
}
|
|
598
|
-
function
|
|
598
|
+
function bi(t) {
|
|
599
599
|
var e = t.__.__c;
|
|
600
600
|
return e && e.__a && e.__a(t);
|
|
601
601
|
}
|
|
602
|
-
function
|
|
602
|
+
function Oo(t) {
|
|
603
603
|
var e, n, r;
|
|
604
604
|
function i(o) {
|
|
605
605
|
if (e || (e = t()).then(function(s) {
|
|
@@ -608,7 +608,7 @@ function Eo(t) {
|
|
|
608
608
|
r = s;
|
|
609
609
|
}), r) throw r;
|
|
610
610
|
if (!n) throw e;
|
|
611
|
-
return
|
|
611
|
+
return D(n, o);
|
|
612
612
|
}
|
|
613
613
|
return i.displayName = "Lazy", i.__f = !0, i;
|
|
614
614
|
}
|
|
@@ -617,11 +617,11 @@ function De() {
|
|
|
617
617
|
}
|
|
618
618
|
b.unmount = function(t) {
|
|
619
619
|
var e = t.__c;
|
|
620
|
-
e && e.__R && e.__R(), e && 32 & t.__u && (t.type = null),
|
|
620
|
+
e && e.__R && e.__R(), e && 32 & t.__u && (t.type = null), rr && rr(t);
|
|
621
621
|
}, (mt.prototype = new W()).__c = function(t, e) {
|
|
622
622
|
var n = e.__c, r = this;
|
|
623
623
|
r.o == null && (r.o = []), r.o.push(n);
|
|
624
|
-
var i =
|
|
624
|
+
var i = bi(r.__v), o = !1, s = function() {
|
|
625
625
|
o || (o = !0, n.__R = null, i ? i(l) : l());
|
|
626
626
|
};
|
|
627
627
|
n.__R = s;
|
|
@@ -629,7 +629,7 @@ b.unmount = function(t) {
|
|
|
629
629
|
if (!--r.__u) {
|
|
630
630
|
if (r.state.__a) {
|
|
631
631
|
var a = r.state.__a;
|
|
632
|
-
r.__v.__k[0] =
|
|
632
|
+
r.__v.__k[0] = xi(a, a.__c.__P, a.__c.__O);
|
|
633
633
|
}
|
|
634
634
|
var u;
|
|
635
635
|
for (r.setState({ __a: r.__b = null }); u = r.o.pop(); ) u.forceUpdate();
|
|
@@ -642,26 +642,26 @@ b.unmount = function(t) {
|
|
|
642
642
|
if (this.__b) {
|
|
643
643
|
if (this.__v.__k) {
|
|
644
644
|
var n = document.createElement("div"), r = this.__v.__k[0].__c;
|
|
645
|
-
this.__v.__k[0] =
|
|
645
|
+
this.__v.__k[0] = mi(this.__b, n, r.__O = r.__P);
|
|
646
646
|
}
|
|
647
647
|
this.__b = null;
|
|
648
648
|
}
|
|
649
|
-
var i = e.__a &&
|
|
650
|
-
return i && (i.__u &= -33), [
|
|
649
|
+
var i = e.__a && D(Q, null, t.fallback);
|
|
650
|
+
return i && (i.__u &= -33), [D(Q, null, e.__a ? null : t.children), i];
|
|
651
651
|
};
|
|
652
|
-
var
|
|
652
|
+
var ir = function(t, e, n) {
|
|
653
653
|
if (++n[1] === n[0] && t.l.delete(e), t.props.revealOrder && (t.props.revealOrder[0] !== "t" || !t.l.size)) for (n = t.i; n; ) {
|
|
654
654
|
for (; n.length > 3; ) n.pop()();
|
|
655
655
|
if (n[1] < n[0]) break;
|
|
656
656
|
t.i = n = n[2];
|
|
657
657
|
}
|
|
658
658
|
};
|
|
659
|
-
function
|
|
659
|
+
function zo(t) {
|
|
660
660
|
return this.getChildContext = function() {
|
|
661
661
|
return t.context;
|
|
662
662
|
}, t.children;
|
|
663
663
|
}
|
|
664
|
-
function
|
|
664
|
+
function No(t) {
|
|
665
665
|
var e = this, n = t.h;
|
|
666
666
|
if (e.componentWillUnmount = function() {
|
|
667
667
|
ge(null, e.v), e.v = null, e.h = null;
|
|
@@ -675,17 +675,17 @@ function Mo(t) {
|
|
|
675
675
|
this.childNodes.splice(this.childNodes.indexOf(i) >>> 1, 1), e.h.removeChild(i);
|
|
676
676
|
} };
|
|
677
677
|
}
|
|
678
|
-
ge(
|
|
678
|
+
ge(D(zo, { context: e.context }, t.__v), e.v);
|
|
679
679
|
}
|
|
680
|
-
function
|
|
681
|
-
var n =
|
|
680
|
+
function Qo(t, e) {
|
|
681
|
+
var n = D(No, { __v: t, h: e });
|
|
682
682
|
return n.containerInfo = e, n;
|
|
683
683
|
}
|
|
684
684
|
(De.prototype = new W()).__a = function(t) {
|
|
685
|
-
var e = this, n =
|
|
685
|
+
var e = this, n = bi(e.__v), r = e.l.get(t);
|
|
686
686
|
return r[0]++, function(i) {
|
|
687
687
|
var o = function() {
|
|
688
|
-
e.props.revealOrder ? (r.push(i),
|
|
688
|
+
e.props.revealOrder ? (r.push(i), ir(e, t, r)) : i();
|
|
689
689
|
};
|
|
690
690
|
n ? n(o) : o();
|
|
691
691
|
};
|
|
@@ -698,17 +698,17 @@ function Po(t, e) {
|
|
|
698
698
|
}, De.prototype.componentDidUpdate = De.prototype.componentDidMount = function() {
|
|
699
699
|
var t = this;
|
|
700
700
|
this.l.forEach(function(e, n) {
|
|
701
|
-
|
|
701
|
+
ir(t, n, e);
|
|
702
702
|
});
|
|
703
703
|
};
|
|
704
|
-
var
|
|
704
|
+
var vi = typeof Symbol < "u" && Symbol.for && /* @__PURE__ */ Symbol.for("react.element") || 60103, Uo = /^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/, Fo = /^on(Ani|Tra|Tou|BeforeInp|Compo)/, Do = /[A-Z0-9]/g, Bo = typeof document < "u", Vo = function(t) {
|
|
705
705
|
return (typeof Symbol < "u" && typeof /* @__PURE__ */ Symbol() == "symbol" ? /fil|che|rad/ : /fil|che|ra/).test(t);
|
|
706
706
|
};
|
|
707
|
-
function
|
|
707
|
+
function Ho(t, e, n) {
|
|
708
708
|
return e.__k == null && (e.textContent = ""), ge(t, e), typeof n == "function" && n(), t ? t.__c : null;
|
|
709
709
|
}
|
|
710
|
-
function
|
|
711
|
-
return
|
|
710
|
+
function Wo(t, e, n) {
|
|
711
|
+
return ii(t, e), typeof n == "function" && n(), t ? t.__c : null;
|
|
712
712
|
}
|
|
713
713
|
W.prototype.isReactComponent = {}, ["componentWillMount", "componentWillReceiveProps", "componentWillUpdate"].forEach(function(t) {
|
|
714
714
|
Object.defineProperty(W.prototype, t, { configurable: !0, get: function() {
|
|
@@ -717,82 +717,82 @@ W.prototype.isReactComponent = {}, ["componentWillMount", "componentWillReceiveP
|
|
|
717
717
|
Object.defineProperty(this, t, { configurable: !0, writable: !0, value: e });
|
|
718
718
|
} });
|
|
719
719
|
});
|
|
720
|
-
var
|
|
721
|
-
function
|
|
720
|
+
var or = b.event;
|
|
721
|
+
function Jo() {
|
|
722
722
|
}
|
|
723
|
-
function
|
|
723
|
+
function Ko() {
|
|
724
724
|
return this.cancelBubble;
|
|
725
725
|
}
|
|
726
|
-
function
|
|
726
|
+
function Zo() {
|
|
727
727
|
return this.defaultPrevented;
|
|
728
728
|
}
|
|
729
729
|
b.event = function(t) {
|
|
730
|
-
return
|
|
730
|
+
return or && (t = or(t)), t.persist = Jo, t.isPropagationStopped = Ko, t.isDefaultPrevented = Zo, t.nativeEvent = t;
|
|
731
731
|
};
|
|
732
|
-
var
|
|
732
|
+
var Sn, Go = { enumerable: !1, configurable: !0, get: function() {
|
|
733
733
|
return this.class;
|
|
734
|
-
} },
|
|
734
|
+
} }, sr = b.vnode;
|
|
735
735
|
b.vnode = function(t) {
|
|
736
736
|
typeof t.type == "string" && (function(e) {
|
|
737
737
|
var n = e.props, r = e.type, i = {}, o = r.indexOf("-") === -1;
|
|
738
738
|
for (var s in n) {
|
|
739
739
|
var l = n[s];
|
|
740
|
-
if (!(s === "value" && "defaultValue" in n && l == null ||
|
|
740
|
+
if (!(s === "value" && "defaultValue" in n && l == null || Bo && s === "children" && r === "noscript" || s === "class" || s === "className")) {
|
|
741
741
|
var a = s.toLowerCase();
|
|
742
|
-
s === "defaultValue" && "value" in n && n.value == null ? s = "value" : s === "download" && l === !0 ? l = "" : a === "translate" && l === "no" ? l = !1 : a[0] === "o" && a[1] === "n" ? a === "ondoubleclick" ? s = "ondblclick" : a !== "onchange" || r !== "input" && r !== "textarea" ||
|
|
742
|
+
s === "defaultValue" && "value" in n && n.value == null ? s = "value" : s === "download" && l === !0 ? l = "" : a === "translate" && l === "no" ? l = !1 : a[0] === "o" && a[1] === "n" ? a === "ondoubleclick" ? s = "ondblclick" : a !== "onchange" || r !== "input" && r !== "textarea" || Vo(n.type) ? a === "onfocus" ? s = "onfocusin" : a === "onblur" ? s = "onfocusout" : Fo.test(s) && (s = a) : a = s = "oninput" : o && Uo.test(s) ? s = s.replace(Do, "-$&").toLowerCase() : l === null && (l = void 0), a === "oninput" && i[s = a] && (s = "oninputCapture"), i[s] = l;
|
|
743
743
|
}
|
|
744
744
|
}
|
|
745
745
|
r == "select" && i.multiple && Array.isArray(i.value) && (i.value = te(n.children).forEach(function(u) {
|
|
746
746
|
u.props.selected = i.value.indexOf(u.props.value) != -1;
|
|
747
747
|
})), r == "select" && i.defaultValue != null && (i.value = te(n.children).forEach(function(u) {
|
|
748
748
|
u.props.selected = i.multiple ? i.defaultValue.indexOf(u.props.value) != -1 : i.defaultValue == u.props.value;
|
|
749
|
-
})), n.class && !n.className ? (i.class = n.class, Object.defineProperty(i, "className",
|
|
750
|
-
})(t), t.$$typeof =
|
|
749
|
+
})), n.class && !n.className ? (i.class = n.class, Object.defineProperty(i, "className", Go)) : (n.className && !n.class || n.class && n.className) && (i.class = i.className = n.className), e.props = i;
|
|
750
|
+
})(t), t.$$typeof = vi, sr && sr(t);
|
|
751
751
|
};
|
|
752
|
-
var
|
|
752
|
+
var ar = b.__r;
|
|
753
753
|
b.__r = function(t) {
|
|
754
|
-
|
|
754
|
+
ar && ar(t), Sn = t.__c;
|
|
755
755
|
};
|
|
756
|
-
var
|
|
756
|
+
var lr = b.diffed;
|
|
757
757
|
b.diffed = function(t) {
|
|
758
|
-
|
|
758
|
+
lr && lr(t);
|
|
759
759
|
var e = t.props, n = t.__e;
|
|
760
|
-
n != null && t.type === "textarea" && "value" in e && e.value !== n.value && (n.value = e.value == null ? "" : e.value),
|
|
760
|
+
n != null && t.type === "textarea" && "value" in e && e.value !== n.value && (n.value = e.value == null ? "" : e.value), Sn = null;
|
|
761
761
|
};
|
|
762
|
-
var
|
|
763
|
-
return
|
|
764
|
-
}, useCallback:
|
|
765
|
-
function
|
|
766
|
-
return
|
|
762
|
+
var Yo = { ReactCurrentDispatcher: { current: { readContext: function(t) {
|
|
763
|
+
return Sn.__n[t.__c].props.value;
|
|
764
|
+
}, useCallback: Te, useContext: It, useDebugValue: ai, useDeferredValue: pi, useEffect: R, useId: li, useImperativeHandle: si, useInsertionEffect: gi, useLayoutEffect: st, useMemo: J, useReducer: _n, useRef: ue, useState: C, useSyncExternalStore: hi, useTransition: fi } } };
|
|
765
|
+
function Xo(t) {
|
|
766
|
+
return D.bind(null, t);
|
|
767
767
|
}
|
|
768
|
-
function
|
|
769
|
-
return !!t && t.$$typeof ===
|
|
768
|
+
function $t(t) {
|
|
769
|
+
return !!t && t.$$typeof === vi;
|
|
770
770
|
}
|
|
771
|
-
function
|
|
772
|
-
return
|
|
771
|
+
function es(t) {
|
|
772
|
+
return $t(t) && t.type === Q;
|
|
773
773
|
}
|
|
774
|
-
function
|
|
774
|
+
function ts(t) {
|
|
775
775
|
return !!t && !!t.displayName && (typeof t.displayName == "string" || t.displayName instanceof String) && t.displayName.startsWith("Memo(");
|
|
776
776
|
}
|
|
777
|
-
function
|
|
778
|
-
return
|
|
777
|
+
function ns(t) {
|
|
778
|
+
return $t(t) ? Ro.apply(null, arguments) : t;
|
|
779
779
|
}
|
|
780
|
-
function
|
|
780
|
+
function rs(t) {
|
|
781
781
|
return !!t.__k && (ge(null, t), !0);
|
|
782
782
|
}
|
|
783
|
-
function
|
|
783
|
+
function is(t) {
|
|
784
784
|
return t && (t.base || t.nodeType === 1 && t) || null;
|
|
785
785
|
}
|
|
786
|
-
var
|
|
786
|
+
var os = function(t, e) {
|
|
787
787
|
return t(e);
|
|
788
|
-
},
|
|
788
|
+
}, ss = function(t, e) {
|
|
789
789
|
return t(e);
|
|
790
|
-
},
|
|
791
|
-
for (var we = 0,
|
|
792
|
-
X[we] =
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
function
|
|
790
|
+
}, as = Q, ls = $t, Cn = { useState: C, useId: li, useReducer: _n, useEffect: R, useLayoutEffect: st, useInsertionEffect: gi, useTransition: fi, useDeferredValue: pi, useSyncExternalStore: hi, startTransition: di, useRef: ue, useImperativeHandle: si, useMemo: J, useCallback: Te, useContext: It, useDebugValue: ai, version: "18.3.1", Children: Po, render: Ho, hydrate: Wo, unmountComponentAtNode: rs, createPortal: Qo, createElement: D, createContext: To, createFactory: Xo, cloneElement: ns, createRef: wo, Fragment: Q, isValidElement: $t, isElement: ls, isFragment: es, isMemo: ts, findDOMNode: is, Component: W, PureComponent: rn, memo: Eo, forwardRef: Mo, flushSync: ss, unstable_batchedUpdates: os, StrictMode: as, Suspense: mt, SuspenseList: De, lazy: Oo, __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: Yo }, X = [], F = [], cs = Uint8Array, Ut = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
|
791
|
+
for (var we = 0, us = Ut.length; we < us; ++we)
|
|
792
|
+
X[we] = Ut[we], F[Ut.charCodeAt(we)] = we;
|
|
793
|
+
F[45] = 62;
|
|
794
|
+
F[95] = 63;
|
|
795
|
+
function hs(t) {
|
|
796
796
|
var e = t.length;
|
|
797
797
|
if (e % 4 > 0)
|
|
798
798
|
throw new Error("Invalid string. Length must be a multiple of 4");
|
|
@@ -801,27 +801,27 @@ function ss(t) {
|
|
|
801
801
|
var r = n === e ? 0 : 4 - n % 4;
|
|
802
802
|
return [n, r];
|
|
803
803
|
}
|
|
804
|
-
function
|
|
804
|
+
function ds(t, e, n) {
|
|
805
805
|
return (e + n) * 3 / 4 - n;
|
|
806
806
|
}
|
|
807
807
|
function Ye(t) {
|
|
808
|
-
var e, n =
|
|
808
|
+
var e, n = hs(t), r = n[0], i = n[1], o = new cs(ds(t, r, i)), s = 0, l = i > 0 ? r - 4 : r, a;
|
|
809
809
|
for (a = 0; a < l; a += 4)
|
|
810
|
-
e =
|
|
811
|
-
return i === 2 && (e =
|
|
810
|
+
e = F[t.charCodeAt(a)] << 18 | F[t.charCodeAt(a + 1)] << 12 | F[t.charCodeAt(a + 2)] << 6 | F[t.charCodeAt(a + 3)], o[s++] = e >> 16 & 255, o[s++] = e >> 8 & 255, o[s++] = e & 255;
|
|
811
|
+
return i === 2 && (e = F[t.charCodeAt(a)] << 2 | F[t.charCodeAt(a + 1)] >> 4, o[s++] = e & 255), i === 1 && (e = F[t.charCodeAt(a)] << 10 | F[t.charCodeAt(a + 1)] << 4 | F[t.charCodeAt(a + 2)] >> 2, o[s++] = e >> 8 & 255, o[s++] = e & 255), o;
|
|
812
812
|
}
|
|
813
|
-
function
|
|
813
|
+
function ps(t) {
|
|
814
814
|
return X[t >> 18 & 63] + X[t >> 12 & 63] + X[t >> 6 & 63] + X[t & 63];
|
|
815
815
|
}
|
|
816
|
-
function
|
|
816
|
+
function fs(t, e, n) {
|
|
817
817
|
for (var r, i = [], o = e; o < n; o += 3)
|
|
818
|
-
r = (t[o] << 16 & 16711680) + (t[o + 1] << 8 & 65280) + (t[o + 2] & 255), i.push(
|
|
818
|
+
r = (t[o] << 16 & 16711680) + (t[o + 1] << 8 & 65280) + (t[o + 2] & 255), i.push(ps(r));
|
|
819
819
|
return i.join("");
|
|
820
820
|
}
|
|
821
821
|
function Xe(t) {
|
|
822
822
|
for (var e, n = t.length, r = n % 3, i = [], o = 16383, s = 0, l = n - r; s < l; s += o)
|
|
823
823
|
i.push(
|
|
824
|
-
|
|
824
|
+
fs(
|
|
825
825
|
t,
|
|
826
826
|
s,
|
|
827
827
|
s + o > l ? l : s + o
|
|
@@ -834,13 +834,13 @@ function Xe(t) {
|
|
|
834
834
|
function ie(t) {
|
|
835
835
|
if (t === void 0)
|
|
836
836
|
return {};
|
|
837
|
-
if (!
|
|
837
|
+
if (!yi(t))
|
|
838
838
|
throw new Error(
|
|
839
839
|
`The arguments to a Convex function must be an object. Received: ${t}`
|
|
840
840
|
);
|
|
841
841
|
return t;
|
|
842
842
|
}
|
|
843
|
-
function
|
|
843
|
+
function gs(t) {
|
|
844
844
|
if (typeof t > "u")
|
|
845
845
|
throw new Error(
|
|
846
846
|
"Client created with undefined deployment address. If you used an environment variable, check that it's set."
|
|
@@ -865,46 +865,46 @@ function us(t) {
|
|
|
865
865
|
`Invalid deployment address: "${t}" ends with .convex.site, which is used for HTTP Actions. Convex deployment URLs typically end with .convex.cloud? If you believe this URL is correct, use the \`skipConvexDeploymentUrlCheck\` option to bypass this.`
|
|
866
866
|
);
|
|
867
867
|
}
|
|
868
|
-
function
|
|
868
|
+
function yi(t) {
|
|
869
869
|
const e = typeof t == "object", n = Object.getPrototypeOf(t), r = n === null || n === Object.prototype || // Objects generated from other contexts (e.g. across Node.js `vm` modules) will not satisfy the previous
|
|
870
870
|
// conditions but are still simple objects.
|
|
871
871
|
n?.constructor?.name === "Object";
|
|
872
872
|
return e && r;
|
|
873
873
|
}
|
|
874
|
-
const
|
|
875
|
-
function
|
|
874
|
+
const ki = !0, $e = BigInt("-9223372036854775808"), Rn = BigInt("9223372036854775807"), on = BigInt("0"), ms = BigInt("8"), xs = BigInt("256");
|
|
875
|
+
function wi(t) {
|
|
876
876
|
return Number.isNaN(t) || !Number.isFinite(t) || Object.is(t, -0);
|
|
877
877
|
}
|
|
878
|
-
function
|
|
879
|
-
t <
|
|
878
|
+
function bs(t) {
|
|
879
|
+
t < on && (t -= $e + $e);
|
|
880
880
|
let e = t.toString(16);
|
|
881
881
|
e.length % 2 === 1 && (e = "0" + e);
|
|
882
882
|
const n = new Uint8Array(new ArrayBuffer(8));
|
|
883
883
|
let r = 0;
|
|
884
884
|
for (const i of e.match(/.{2}/g).reverse())
|
|
885
|
-
n.set([parseInt(i, 16)], r++), t >>=
|
|
885
|
+
n.set([parseInt(i, 16)], r++), t >>= ms;
|
|
886
886
|
return Xe(n);
|
|
887
887
|
}
|
|
888
|
-
function
|
|
888
|
+
function vs(t) {
|
|
889
889
|
const e = Ye(t);
|
|
890
890
|
if (e.byteLength !== 8)
|
|
891
891
|
throw new Error(
|
|
892
892
|
`Received ${e.byteLength} bytes, expected 8 for $integer`
|
|
893
893
|
);
|
|
894
|
-
let n =
|
|
894
|
+
let n = on, r = on;
|
|
895
895
|
for (const i of e)
|
|
896
|
-
n += BigInt(i) *
|
|
897
|
-
return n >
|
|
896
|
+
n += BigInt(i) * xs ** r, r++;
|
|
897
|
+
return n > Rn && (n += $e + $e), n;
|
|
898
898
|
}
|
|
899
|
-
function
|
|
900
|
-
if (t <
|
|
899
|
+
function ys(t) {
|
|
900
|
+
if (t < $e || Rn < t)
|
|
901
901
|
throw new Error(
|
|
902
902
|
`BigInt ${t} does not fit into a 64-bit signed integer.`
|
|
903
903
|
);
|
|
904
904
|
const e = new ArrayBuffer(8);
|
|
905
905
|
return new DataView(e).setBigInt64(0, t, !0), Xe(new Uint8Array(e));
|
|
906
906
|
}
|
|
907
|
-
function
|
|
907
|
+
function ks(t) {
|
|
908
908
|
const e = Ye(t);
|
|
909
909
|
if (e.byteLength !== 8)
|
|
910
910
|
throw new Error(
|
|
@@ -912,11 +912,11 @@ function ms(t) {
|
|
|
912
912
|
);
|
|
913
913
|
return new DataView(e.buffer).getBigInt64(0, !0);
|
|
914
914
|
}
|
|
915
|
-
const
|
|
916
|
-
function
|
|
917
|
-
if (t.length >
|
|
915
|
+
const ws = DataView.prototype.setBigInt64 ? ys : bs, _s = DataView.prototype.getBigInt64 ? ks : vs, cr = 1024;
|
|
916
|
+
function _i(t) {
|
|
917
|
+
if (t.length > cr)
|
|
918
918
|
throw new Error(
|
|
919
|
-
`Field name ${t} exceeds maximum field name length ${
|
|
919
|
+
`Field name ${t} exceeds maximum field name length ${cr}.`
|
|
920
920
|
);
|
|
921
921
|
if (t.startsWith("$"))
|
|
922
922
|
throw new Error(`Field name ${t} starts with a '$', which is reserved.`);
|
|
@@ -928,11 +928,11 @@ function bi(t) {
|
|
|
928
928
|
);
|
|
929
929
|
}
|
|
930
930
|
}
|
|
931
|
-
function
|
|
931
|
+
function Ee(t) {
|
|
932
932
|
if (t === null || typeof t == "boolean" || typeof t == "number" || typeof t == "string")
|
|
933
933
|
return t;
|
|
934
934
|
if (Array.isArray(t))
|
|
935
|
-
return t.map((r) =>
|
|
935
|
+
return t.map((r) => Ee(r));
|
|
936
936
|
if (typeof t != "object")
|
|
937
937
|
throw new Error(`Unexpected type of ${t}`);
|
|
938
938
|
const e = Object.entries(t);
|
|
@@ -946,7 +946,7 @@ function $e(t) {
|
|
|
946
946
|
if (r === "$integer") {
|
|
947
947
|
if (typeof t.$integer != "string")
|
|
948
948
|
throw new Error(`Malformed $integer field on ${t}`);
|
|
949
|
-
return
|
|
949
|
+
return _s(t.$integer);
|
|
950
950
|
}
|
|
951
951
|
if (r === "$float") {
|
|
952
952
|
if (typeof t.$float != "string")
|
|
@@ -956,8 +956,8 @@ function $e(t) {
|
|
|
956
956
|
throw new Error(
|
|
957
957
|
`Received ${i.byteLength} bytes, expected 8 for $float`
|
|
958
958
|
);
|
|
959
|
-
const o = new DataView(i.buffer).getFloat64(0,
|
|
960
|
-
if (!
|
|
959
|
+
const o = new DataView(i.buffer).getFloat64(0, ki);
|
|
960
|
+
if (!wi(o))
|
|
961
961
|
throw new Error(`Float ${o} should be encoded as a number`);
|
|
962
962
|
return o;
|
|
963
963
|
}
|
|
@@ -972,21 +972,21 @@ function $e(t) {
|
|
|
972
972
|
}
|
|
973
973
|
const n = {};
|
|
974
974
|
for (const [r, i] of Object.entries(t))
|
|
975
|
-
|
|
975
|
+
_i(r), n[r] = Ee(i);
|
|
976
976
|
return n;
|
|
977
977
|
}
|
|
978
|
-
const
|
|
978
|
+
const ur = 16384;
|
|
979
979
|
function We(t) {
|
|
980
980
|
const e = JSON.stringify(t, (n, r) => r === void 0 ? "undefined" : typeof r == "bigint" ? `${r.toString()}n` : r);
|
|
981
|
-
if (e.length >
|
|
981
|
+
if (e.length > ur) {
|
|
982
982
|
const n = "[...truncated]";
|
|
983
|
-
let r =
|
|
983
|
+
let r = ur - n.length;
|
|
984
984
|
const i = e.codePointAt(r - 1);
|
|
985
985
|
return i !== void 0 && i > 65535 && (r -= 1), e.substring(0, r) + n;
|
|
986
986
|
}
|
|
987
987
|
return e;
|
|
988
988
|
}
|
|
989
|
-
function
|
|
989
|
+
function sn(t, e, n, r) {
|
|
990
990
|
if (t === void 0) {
|
|
991
991
|
const s = n && ` (present at path ${n} in original object ${We(
|
|
992
992
|
e
|
|
@@ -998,16 +998,16 @@ function on(t, e, n, r) {
|
|
|
998
998
|
if (t === null)
|
|
999
999
|
return t;
|
|
1000
1000
|
if (typeof t == "bigint") {
|
|
1001
|
-
if (t <
|
|
1001
|
+
if (t < $e || Rn < t)
|
|
1002
1002
|
throw new Error(
|
|
1003
1003
|
`BigInt ${t} does not fit into a 64-bit signed integer.`
|
|
1004
1004
|
);
|
|
1005
|
-
return { $integer:
|
|
1005
|
+
return { $integer: ws(t) };
|
|
1006
1006
|
}
|
|
1007
1007
|
if (typeof t == "number")
|
|
1008
|
-
if (
|
|
1008
|
+
if (wi(t)) {
|
|
1009
1009
|
const s = new ArrayBuffer(8);
|
|
1010
|
-
return new DataView(s).setFloat64(0, t,
|
|
1010
|
+
return new DataView(s).setFloat64(0, t, ki), { $float: Xe(new Uint8Array(s)) };
|
|
1011
1011
|
} else
|
|
1012
1012
|
return t;
|
|
1013
1013
|
if (typeof t == "boolean" || typeof t == "string")
|
|
@@ -1016,7 +1016,7 @@ function on(t, e, n, r) {
|
|
|
1016
1016
|
return { $bytes: Xe(new Uint8Array(t)) };
|
|
1017
1017
|
if (Array.isArray(t))
|
|
1018
1018
|
return t.map(
|
|
1019
|
-
(s, l) =>
|
|
1019
|
+
(s, l) => sn(s, e, n + `[${l}]`)
|
|
1020
1020
|
);
|
|
1021
1021
|
if (t instanceof Set)
|
|
1022
1022
|
throw new Error(
|
|
@@ -1026,7 +1026,7 @@ function on(t, e, n, r) {
|
|
|
1026
1026
|
throw new Error(
|
|
1027
1027
|
Ft(n, "Map", [...t], e)
|
|
1028
1028
|
);
|
|
1029
|
-
if (!
|
|
1029
|
+
if (!yi(t)) {
|
|
1030
1030
|
const s = t?.constructor?.name, l = s ? `${s} ` : "";
|
|
1031
1031
|
throw new Error(
|
|
1032
1032
|
Ft(n, l, t, e)
|
|
@@ -1035,7 +1035,7 @@ function on(t, e, n, r) {
|
|
|
1035
1035
|
const i = {}, o = Object.entries(t);
|
|
1036
1036
|
o.sort(([s, l], [a, u]) => s === a ? 0 : s < a ? -1 : 1);
|
|
1037
1037
|
for (const [s, l] of o)
|
|
1038
|
-
l !== void 0 && (
|
|
1038
|
+
l !== void 0 && (_i(s), i[s] = sn(l, e, n + `.${s}`));
|
|
1039
1039
|
return i;
|
|
1040
1040
|
}
|
|
1041
1041
|
function Ft(t, e, n, r) {
|
|
@@ -1048,22 +1048,22 @@ function Ft(t, e, n, r) {
|
|
|
1048
1048
|
)} is not a supported Convex type.`;
|
|
1049
1049
|
}
|
|
1050
1050
|
function ne(t) {
|
|
1051
|
-
return
|
|
1051
|
+
return sn(t, t, "");
|
|
1052
1052
|
}
|
|
1053
|
-
var
|
|
1054
|
-
const
|
|
1055
|
-
class vt extends (
|
|
1053
|
+
var js = Object.defineProperty, Ss = (t, e, n) => e in t ? js(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, Dt = (t, e, n) => Ss(t, typeof e != "symbol" ? e + "" : e, n), hr, dr;
|
|
1054
|
+
const Cs = /* @__PURE__ */ Symbol.for("ConvexError");
|
|
1055
|
+
class vt extends (dr = Error, hr = Cs, dr) {
|
|
1056
1056
|
constructor(e) {
|
|
1057
|
-
super(typeof e == "string" ? e : We(e)), Dt(this, "name", "ConvexError"), Dt(this, "data"), Dt(this,
|
|
1057
|
+
super(typeof e == "string" ? e : We(e)), Dt(this, "name", "ConvexError"), Dt(this, "data"), Dt(this, hr, !0), this.data = e;
|
|
1058
1058
|
}
|
|
1059
1059
|
}
|
|
1060
|
-
const
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
const
|
|
1064
|
-
var
|
|
1065
|
-
const
|
|
1066
|
-
function
|
|
1060
|
+
const ji = () => Array.from({ length: 4 }, () => 0);
|
|
1061
|
+
ji();
|
|
1062
|
+
ji();
|
|
1063
|
+
const pr = "1.39.1";
|
|
1064
|
+
var Rs = Object.defineProperty, Ts = (t, e, n) => e in t ? Rs(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, fr = (t, e, n) => Ts(t, typeof e != "symbol" ? e + "" : e, n);
|
|
1065
|
+
const As = "color:rgb(0, 145, 255)";
|
|
1066
|
+
function Si(t) {
|
|
1067
1067
|
switch (t) {
|
|
1068
1068
|
case "query":
|
|
1069
1069
|
return "Q";
|
|
@@ -1075,9 +1075,9 @@ function yi(t) {
|
|
|
1075
1075
|
return "?";
|
|
1076
1076
|
}
|
|
1077
1077
|
}
|
|
1078
|
-
class
|
|
1078
|
+
class Ci {
|
|
1079
1079
|
constructor(e) {
|
|
1080
|
-
|
|
1080
|
+
fr(this, "_onLogLineFuncs"), fr(this, "_verbose"), this._onLogLineFuncs = {}, this._verbose = e.verbose;
|
|
1081
1081
|
}
|
|
1082
1082
|
addLogLineListener(e) {
|
|
1083
1083
|
let n = Math.random().toString(36).substring(2, 15);
|
|
@@ -1105,8 +1105,8 @@ class ki {
|
|
|
1105
1105
|
n("error", ...e);
|
|
1106
1106
|
}
|
|
1107
1107
|
}
|
|
1108
|
-
function
|
|
1109
|
-
const e = new
|
|
1108
|
+
function Ri(t) {
|
|
1109
|
+
const e = new Ci(t);
|
|
1110
1110
|
return e.addLogLineListener((n, ...r) => {
|
|
1111
1111
|
switch (n) {
|
|
1112
1112
|
case "debug":
|
|
@@ -1126,11 +1126,11 @@ function wi(t) {
|
|
|
1126
1126
|
}
|
|
1127
1127
|
}), e;
|
|
1128
1128
|
}
|
|
1129
|
-
function
|
|
1130
|
-
return new
|
|
1129
|
+
function Ti(t) {
|
|
1130
|
+
return new Ci(t);
|
|
1131
1131
|
}
|
|
1132
1132
|
function yt(t, e, n, r, i) {
|
|
1133
|
-
const o =
|
|
1133
|
+
const o = Si(n);
|
|
1134
1134
|
if (typeof i == "object" && (i = `ConvexError ${JSON.stringify(i.errorData, null, 2)}`), e === "info") {
|
|
1135
1135
|
const s = i.match(/^\[.*?\] /);
|
|
1136
1136
|
if (s === null) {
|
|
@@ -1140,19 +1140,19 @@ function yt(t, e, n, r, i) {
|
|
|
1140
1140
|
return;
|
|
1141
1141
|
}
|
|
1142
1142
|
const l = i.slice(1, s[0].length - 2), a = i.slice(s[0].length);
|
|
1143
|
-
t.log(`%c[CONVEX ${o}(${r})] [${l}]`,
|
|
1143
|
+
t.log(`%c[CONVEX ${o}(${r})] [${l}]`, As, a);
|
|
1144
1144
|
} else
|
|
1145
1145
|
t.error(`[CONVEX ${o}(${r})] ${i}`);
|
|
1146
1146
|
}
|
|
1147
|
-
function
|
|
1147
|
+
function Is(t, e) {
|
|
1148
1148
|
const n = `[CONVEX FATAL ERROR] ${e}`;
|
|
1149
1149
|
return t.error(n), new Error(n);
|
|
1150
1150
|
}
|
|
1151
1151
|
function Ce(t, e, n) {
|
|
1152
|
-
return `[CONVEX ${
|
|
1152
|
+
return `[CONVEX ${Si(t)}(${e})] ${n.errorMessage}
|
|
1153
1153
|
Called by client`;
|
|
1154
1154
|
}
|
|
1155
|
-
function
|
|
1155
|
+
function an(t, e) {
|
|
1156
1156
|
return e.data = t.errorData, e;
|
|
1157
1157
|
}
|
|
1158
1158
|
function me(t) {
|
|
@@ -1166,7 +1166,7 @@ function pe(t, e) {
|
|
|
1166
1166
|
args: ne(e)
|
|
1167
1167
|
});
|
|
1168
1168
|
}
|
|
1169
|
-
function
|
|
1169
|
+
function gr(t, e, n) {
|
|
1170
1170
|
const { initialNumItems: r, id: i } = n;
|
|
1171
1171
|
return JSON.stringify({
|
|
1172
1172
|
type: "paginated",
|
|
@@ -1175,8 +1175,8 @@ function dr(t, e, n) {
|
|
|
1175
1175
|
options: ne({ initialNumItems: r, id: i })
|
|
1176
1176
|
});
|
|
1177
1177
|
}
|
|
1178
|
-
var
|
|
1179
|
-
class
|
|
1178
|
+
var $s = Object.defineProperty, Es = (t, e, n) => e in t ? $s(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, G = (t, e, n) => Es(t, typeof e != "symbol" ? e + "" : e, n);
|
|
1179
|
+
class qs {
|
|
1180
1180
|
constructor() {
|
|
1181
1181
|
G(this, "nextQueryId"), G(this, "querySetVersion"), G(this, "querySet"), G(this, "queryIdToToken"), G(this, "identityVersion"), G(this, "auth"), G(this, "outstandingQueriesOlderThanRestart"), G(this, "outstandingAuthOlderThanRestart"), G(this, "paused"), G(this, "pendingQuerySetModifications"), this.nextQueryId = 0, this.querySetVersion = 0, this.identityVersion = 0, this.querySet = /* @__PURE__ */ new Map(), this.queryIdToToken = /* @__PURE__ */ new Map(), this.outstandingQueriesOlderThanRestart = /* @__PURE__ */ new Set(), this.outstandingAuthOlderThanRestart = !1, this.paused = !1, this.pendingQuerySetModifications = /* @__PURE__ */ new Map();
|
|
1182
1182
|
}
|
|
@@ -1381,8 +1381,8 @@ class Ts {
|
|
|
1381
1381
|
}
|
|
1382
1382
|
}
|
|
1383
1383
|
}
|
|
1384
|
-
var
|
|
1385
|
-
class
|
|
1384
|
+
var Ms = Object.defineProperty, Ps = (t, e, n) => e in t ? Ms(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, ht = (t, e, n) => Ps(t, typeof e != "symbol" ? e + "" : e, n);
|
|
1385
|
+
class Ls {
|
|
1386
1386
|
constructor(e, n) {
|
|
1387
1387
|
this.logger = e, this.markConnectionStateDirty = n, ht(this, "inflightRequests"), ht(this, "requestsOlderThanRestart"), ht(this, "inflightMutationsCount", 0), ht(this, "inflightActionsCount", 0), this.inflightRequests = /* @__PURE__ */ new Map(), this.requestsOlderThanRestart = /* @__PURE__ */ new Set();
|
|
1388
1388
|
}
|
|
@@ -1415,14 +1415,14 @@ class $s {
|
|
|
1415
1415
|
s = {
|
|
1416
1416
|
success: !0,
|
|
1417
1417
|
logLines: e.logLines,
|
|
1418
|
-
value:
|
|
1418
|
+
value: Ee(e.result)
|
|
1419
1419
|
}, l = () => o.onResult(s);
|
|
1420
1420
|
else {
|
|
1421
1421
|
const a = e.result, { errorData: u } = e;
|
|
1422
1422
|
yt(this.logger, "error", r, i, a), s = {
|
|
1423
1423
|
success: !1,
|
|
1424
1424
|
errorMessage: a,
|
|
1425
|
-
errorData: u !== void 0 ?
|
|
1425
|
+
errorData: u !== void 0 ? Ee(u) : void 0,
|
|
1426
1426
|
logLines: e.logLines
|
|
1427
1427
|
}, l = () => o.onResult(s);
|
|
1428
1428
|
}
|
|
@@ -1518,21 +1518,21 @@ class $s {
|
|
|
1518
1518
|
return this.inflightActionsCount;
|
|
1519
1519
|
}
|
|
1520
1520
|
}
|
|
1521
|
-
const et = /* @__PURE__ */ Symbol.for("functionName"),
|
|
1522
|
-
function
|
|
1523
|
-
return t[
|
|
1521
|
+
const et = /* @__PURE__ */ Symbol.for("functionName"), Os = /* @__PURE__ */ Symbol.for("toReferencePath");
|
|
1522
|
+
function zs(t) {
|
|
1523
|
+
return t[Os] ?? null;
|
|
1524
1524
|
}
|
|
1525
|
-
function
|
|
1525
|
+
function Ns(t) {
|
|
1526
1526
|
return t.startsWith("function://");
|
|
1527
1527
|
}
|
|
1528
|
-
function
|
|
1528
|
+
function Qs(t) {
|
|
1529
1529
|
let e;
|
|
1530
1530
|
if (typeof t == "string")
|
|
1531
|
-
|
|
1531
|
+
Ns(t) ? e = { functionHandle: t } : e = { name: t };
|
|
1532
1532
|
else if (t[et])
|
|
1533
1533
|
e = { name: t[et] };
|
|
1534
1534
|
else {
|
|
1535
|
-
const n =
|
|
1535
|
+
const n = zs(t);
|
|
1536
1536
|
if (!n)
|
|
1537
1537
|
throw new Error(`${t} is not a functionReference`);
|
|
1538
1538
|
e = { reference: n };
|
|
@@ -1540,7 +1540,7 @@ function Ms(t) {
|
|
|
1540
1540
|
return e;
|
|
1541
1541
|
}
|
|
1542
1542
|
function O(t) {
|
|
1543
|
-
const e =
|
|
1543
|
+
const e = Qs(t);
|
|
1544
1544
|
if (e.name === void 0)
|
|
1545
1545
|
throw e.functionHandle !== void 0 ? new Error(
|
|
1546
1546
|
`Expected function reference like "api.file.func" or "internal.file.func", but received function handle ${e.functionHandle}`
|
|
@@ -1555,15 +1555,15 @@ function O(t) {
|
|
|
1555
1555
|
throw new Error(`${t} is not a functionReference`);
|
|
1556
1556
|
return n;
|
|
1557
1557
|
}
|
|
1558
|
-
function
|
|
1558
|
+
function Ai(t) {
|
|
1559
1559
|
return { [et]: t };
|
|
1560
1560
|
}
|
|
1561
|
-
function
|
|
1561
|
+
function Ii(t = []) {
|
|
1562
1562
|
const e = {
|
|
1563
1563
|
get(n, r) {
|
|
1564
1564
|
if (typeof r == "string") {
|
|
1565
1565
|
const i = [...t, r];
|
|
1566
|
-
return
|
|
1566
|
+
return Ii(i);
|
|
1567
1567
|
} else if (r === et) {
|
|
1568
1568
|
if (t.length < 2) {
|
|
1569
1569
|
const s = ["api", ...t].join(".");
|
|
@@ -1578,8 +1578,8 @@ function Ci(t = []) {
|
|
|
1578
1578
|
};
|
|
1579
1579
|
return new Proxy({}, e);
|
|
1580
1580
|
}
|
|
1581
|
-
|
|
1582
|
-
var
|
|
1581
|
+
Ii();
|
|
1582
|
+
var Us = Object.defineProperty, Fs = (t, e, n) => e in t ? Us(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, kt = (t, e, n) => Fs(t, typeof e != "symbol" ? e + "" : e, n);
|
|
1583
1583
|
class tt {
|
|
1584
1584
|
constructor(e) {
|
|
1585
1585
|
kt(this, "queryResults"), kt(this, "modifiedQueries"), this.queryResults = e, this.modifiedQueries = [];
|
|
@@ -1621,7 +1621,7 @@ class tt {
|
|
|
1621
1621
|
return e.success ? e.value : void 0;
|
|
1622
1622
|
}
|
|
1623
1623
|
}
|
|
1624
|
-
class
|
|
1624
|
+
class Ds {
|
|
1625
1625
|
constructor() {
|
|
1626
1626
|
kt(this, "queryResults"), kt(this, "optimisticUpdates"), this.queryResults = /* @__PURE__ */ new Map(), this.optimisticUpdates = [];
|
|
1627
1627
|
}
|
|
@@ -1669,7 +1669,7 @@ class zs {
|
|
|
1669
1669
|
if (r !== void 0) {
|
|
1670
1670
|
if (r.success)
|
|
1671
1671
|
return r.value;
|
|
1672
|
-
throw r.errorData !== void 0 ?
|
|
1672
|
+
throw r.errorData !== void 0 ? an(
|
|
1673
1673
|
r,
|
|
1674
1674
|
new vt(
|
|
1675
1675
|
Ce("query", n.udfPath, r)
|
|
@@ -1689,10 +1689,10 @@ class zs {
|
|
|
1689
1689
|
return this.queryResults.get(e)?.result?.logLines;
|
|
1690
1690
|
}
|
|
1691
1691
|
}
|
|
1692
|
-
var
|
|
1692
|
+
var Bs = Object.defineProperty, Vs = (t, e, n) => e in t ? Bs(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, Bt = (t, e, n) => Vs(t, typeof e != "symbol" ? e + "" : e, n);
|
|
1693
1693
|
class L {
|
|
1694
1694
|
constructor(e, n) {
|
|
1695
|
-
|
|
1695
|
+
Bt(this, "low"), Bt(this, "high"), Bt(this, "__isUnsignedLong__"), this.low = e | 0, this.high = n | 0, this.__isUnsignedLong__ = !0;
|
|
1696
1696
|
}
|
|
1697
1697
|
static isLong(e) {
|
|
1698
1698
|
return (e && e.__isUnsignedLong__) === !0;
|
|
@@ -1719,7 +1719,7 @@ class L {
|
|
|
1719
1719
|
];
|
|
1720
1720
|
}
|
|
1721
1721
|
static fromNumber(e) {
|
|
1722
|
-
return isNaN(e) || e < 0 ?
|
|
1722
|
+
return isNaN(e) || e < 0 ? Hs : e >= Ws ? Js : new L(e % Je | 0, e / Je | 0);
|
|
1723
1723
|
}
|
|
1724
1724
|
toString() {
|
|
1725
1725
|
return (BigInt(this.high) * BigInt(Je) + BigInt(this.low)).toString();
|
|
@@ -1743,9 +1743,9 @@ class L {
|
|
|
1743
1743
|
return typeof e == "number" ? L.fromNumber(e) : new L(e.low, e.high);
|
|
1744
1744
|
}
|
|
1745
1745
|
}
|
|
1746
|
-
const
|
|
1747
|
-
var
|
|
1748
|
-
class
|
|
1746
|
+
const Hs = new L(0, 0), mr = 65536, Je = mr * mr, Ws = Je * Je, Js = new L(-1, -1);
|
|
1747
|
+
var Ks = Object.defineProperty, Zs = (t, e, n) => e in t ? Ks(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, dt = (t, e, n) => Zs(t, typeof e != "symbol" ? e + "" : e, n);
|
|
1748
|
+
class xr {
|
|
1749
1749
|
constructor(e, n) {
|
|
1750
1750
|
dt(this, "version"), dt(this, "remoteQuerySet"), dt(this, "queryPath"), dt(this, "logger"), this.version = { querySet: 0, ts: L.fromNumber(0), identity: 0 }, this.remoteQuerySet = /* @__PURE__ */ new Map(), this.queryPath = e, this.logger = n;
|
|
1751
1751
|
}
|
|
@@ -1762,7 +1762,7 @@ class fr {
|
|
|
1762
1762
|
if (i)
|
|
1763
1763
|
for (const s of r.logLines)
|
|
1764
1764
|
yt(this.logger, "info", "query", i, s);
|
|
1765
|
-
const o =
|
|
1765
|
+
const o = Ee(r.value ?? null);
|
|
1766
1766
|
this.remoteQuerySet.set(r.queryId, {
|
|
1767
1767
|
success: !0,
|
|
1768
1768
|
value: o,
|
|
@@ -1779,7 +1779,7 @@ class fr {
|
|
|
1779
1779
|
this.remoteQuerySet.set(r.queryId, {
|
|
1780
1780
|
success: !1,
|
|
1781
1781
|
errorMessage: r.errorMessage,
|
|
1782
|
-
errorData: o !== void 0 ?
|
|
1782
|
+
errorData: o !== void 0 ? Ee(o) : void 0,
|
|
1783
1783
|
logLines: r.logLines
|
|
1784
1784
|
});
|
|
1785
1785
|
break;
|
|
@@ -1800,15 +1800,15 @@ class fr {
|
|
|
1800
1800
|
return this.version.ts;
|
|
1801
1801
|
}
|
|
1802
1802
|
}
|
|
1803
|
-
function
|
|
1803
|
+
function Vt(t) {
|
|
1804
1804
|
const e = Ye(t);
|
|
1805
1805
|
return L.fromBytesLE(Array.from(e));
|
|
1806
1806
|
}
|
|
1807
|
-
function
|
|
1807
|
+
function Gs(t) {
|
|
1808
1808
|
const e = new Uint8Array(t.toBytesLE());
|
|
1809
1809
|
return Xe(e);
|
|
1810
1810
|
}
|
|
1811
|
-
function
|
|
1811
|
+
function br(t) {
|
|
1812
1812
|
switch (t.type) {
|
|
1813
1813
|
case "FatalError":
|
|
1814
1814
|
case "AuthError":
|
|
@@ -1817,22 +1817,22 @@ function gr(t) {
|
|
|
1817
1817
|
case "Ping":
|
|
1818
1818
|
return { ...t };
|
|
1819
1819
|
case "MutationResponse":
|
|
1820
|
-
return t.success ? { ...t, ts:
|
|
1820
|
+
return t.success ? { ...t, ts: Vt(t.ts) } : { ...t };
|
|
1821
1821
|
case "Transition":
|
|
1822
1822
|
return {
|
|
1823
1823
|
...t,
|
|
1824
1824
|
startVersion: {
|
|
1825
1825
|
...t.startVersion,
|
|
1826
|
-
ts:
|
|
1826
|
+
ts: Vt(t.startVersion.ts)
|
|
1827
1827
|
},
|
|
1828
1828
|
endVersion: {
|
|
1829
1829
|
...t.endVersion,
|
|
1830
|
-
ts:
|
|
1830
|
+
ts: Vt(t.endVersion.ts)
|
|
1831
1831
|
}
|
|
1832
1832
|
};
|
|
1833
1833
|
}
|
|
1834
1834
|
}
|
|
1835
|
-
function
|
|
1835
|
+
function Ys(t) {
|
|
1836
1836
|
switch (t.type) {
|
|
1837
1837
|
case "Authenticate":
|
|
1838
1838
|
case "ModifyQuerySet":
|
|
@@ -1843,20 +1843,20 @@ function Ws(t) {
|
|
|
1843
1843
|
case "Connect":
|
|
1844
1844
|
return t.maxObservedTimestamp !== void 0 ? {
|
|
1845
1845
|
...t,
|
|
1846
|
-
maxObservedTimestamp:
|
|
1846
|
+
maxObservedTimestamp: Gs(t.maxObservedTimestamp)
|
|
1847
1847
|
} : { ...t, maxObservedTimestamp: void 0 };
|
|
1848
1848
|
}
|
|
1849
1849
|
}
|
|
1850
|
-
var
|
|
1851
|
-
const
|
|
1850
|
+
var Xs = Object.defineProperty, ea = (t, e, n) => e in t ? Xs(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, $ = (t, e, n) => ea(t, typeof e != "symbol" ? e + "" : e, n);
|
|
1851
|
+
const ta = 1e3, na = 1001, ra = 1005, ia = 4040;
|
|
1852
1852
|
let xt;
|
|
1853
1853
|
function je() {
|
|
1854
1854
|
return xt === void 0 && (xt = Date.now()), typeof performance > "u" || !performance.now ? Date.now() : Math.round(xt + performance.now());
|
|
1855
1855
|
}
|
|
1856
|
-
function
|
|
1856
|
+
function vr() {
|
|
1857
1857
|
return `t=${Math.round((je() - xt) / 100) / 10}s`;
|
|
1858
1858
|
}
|
|
1859
|
-
const
|
|
1859
|
+
const $i = {
|
|
1860
1860
|
// A known error, e.g. during a restart or push
|
|
1861
1861
|
InternalServerError: { timeout: 1e3 },
|
|
1862
1862
|
// ErrorMetadata::overloaded() messages that we realy should back off
|
|
@@ -1876,18 +1876,18 @@ const Ri = {
|
|
|
1876
1876
|
SearchIndexTooLarge: { timeout: 3e3 },
|
|
1877
1877
|
TooManyWritesInTimePeriod: { timeout: 3e3 }
|
|
1878
1878
|
};
|
|
1879
|
-
function
|
|
1879
|
+
function oa(t) {
|
|
1880
1880
|
if (t === void 0) return "Unknown";
|
|
1881
1881
|
for (const e of Object.keys(
|
|
1882
|
-
|
|
1882
|
+
$i
|
|
1883
1883
|
))
|
|
1884
1884
|
if (t.startsWith(e))
|
|
1885
1885
|
return e;
|
|
1886
1886
|
return "Unknown";
|
|
1887
1887
|
}
|
|
1888
|
-
class
|
|
1888
|
+
class sa {
|
|
1889
1889
|
constructor(e, n, r, i, o, s) {
|
|
1890
|
-
this.markConnectionStateDirty = o, this.debug = s,
|
|
1890
|
+
this.markConnectionStateDirty = o, this.debug = s, $(this, "socket"), $(this, "connectionCount"), $(this, "_hasEverConnected", !1), $(this, "lastCloseReason"), $(this, "transitionChunkBuffer", null), $(this, "defaultInitialBackoff"), $(this, "maxBackoff"), $(this, "retries"), $(this, "serverInactivityThreshold"), $(this, "reconnectDueToServerInactivityTimeout"), $(this, "scheduledReconnect", null), $(this, "networkOnlineHandler", null), $(this, "pendingNetworkRecoveryInfo", null), $(this, "uri"), $(this, "onOpen"), $(this, "onResume"), $(this, "onMessage"), $(this, "webSocketConstructor"), $(this, "logger"), $(this, "onServerDisconnectError"), this.webSocketConstructor = r, this.socket = { state: "disconnected" }, this.connectionCount = 0, this.lastCloseReason = "InitialConnect", this.defaultInitialBackoff = 1e3, this.maxBackoff = 16e3, this.retries = 0, this.serverInactivityThreshold = 6e4, this.reconnectDueToServerInactivityTimeout = null, this.uri = e, this.onOpen = n.onOpen, this.onResume = n.onResume, this.onMessage = n.onMessage, this.onServerDisconnectError = n.onServerDisconnectError, this.logger = i, this.setupNetworkListener(), this.connect();
|
|
1891
1891
|
}
|
|
1892
1892
|
setSocketState(e) {
|
|
1893
1893
|
this.socket = e, this._logVerbose(
|
|
@@ -1918,7 +1918,7 @@ class ta {
|
|
|
1918
1918
|
if (this.transitionChunkBuffer.chunks.push(e.chunk), this.transitionChunkBuffer.chunks.length === e.totalParts) {
|
|
1919
1919
|
const n = this.transitionChunkBuffer.chunks.join("");
|
|
1920
1920
|
this.transitionChunkBuffer = null;
|
|
1921
|
-
const r =
|
|
1921
|
+
const r = br(JSON.parse(n));
|
|
1922
1922
|
if (r.type !== "Transition")
|
|
1923
1923
|
throw new Error(
|
|
1924
1924
|
`Expected Transition, got ${r.type} after assembling chunks`
|
|
@@ -1952,10 +1952,10 @@ class ta {
|
|
|
1952
1952
|
clientTs: je()
|
|
1953
1953
|
})), this.lastCloseReason !== "InitialConnect" && (this.lastCloseReason ? this.logger.log(
|
|
1954
1954
|
"WebSocket reconnected at",
|
|
1955
|
-
|
|
1955
|
+
vr(),
|
|
1956
1956
|
"after disconnect due to",
|
|
1957
1957
|
this.lastCloseReason
|
|
1958
|
-
) : this.logger.log("WebSocket reconnected at",
|
|
1958
|
+
) : this.logger.log("WebSocket reconnected at", vr())), this.connectionCount += 1, this.lastCloseReason = null, this.pendingNetworkRecoveryInfo !== null) {
|
|
1959
1959
|
const { timeSavedMs: n } = this.pendingNetworkRecoveryInfo;
|
|
1960
1960
|
this.pendingNetworkRecoveryInfo = null, this.sendMessage({
|
|
1961
1961
|
type: "Event",
|
|
@@ -1972,7 +1972,7 @@ class ta {
|
|
|
1972
1972
|
}, e.onmessage = (n) => {
|
|
1973
1973
|
this.resetServerInactivityTimeout();
|
|
1974
1974
|
const r = n.data.length;
|
|
1975
|
-
let i =
|
|
1975
|
+
let i = br(JSON.parse(n.data));
|
|
1976
1976
|
if (this._logVerbose(`received ws message with type ${i.type}`), i.type !== "Ping") {
|
|
1977
1977
|
if (i.type === "TransitionChunk") {
|
|
1978
1978
|
const o = this.assembleTransition(i);
|
|
@@ -1990,12 +1990,12 @@ class ta {
|
|
|
1990
1990
|
}), this.onMessage(i).hasSyncedPastLastReconnect && (this.retries = 0, this.markConnectionStateDirty());
|
|
1991
1991
|
}
|
|
1992
1992
|
}, e.onclose = (n) => {
|
|
1993
|
-
if (this._logVerbose("begin ws.onclose"), this.transitionChunkBuffer = null, this.lastCloseReason === null && (this.lastCloseReason = n.reason || `closed with code ${n.code}`), n.code !==
|
|
1994
|
-
n.code !==
|
|
1993
|
+
if (this._logVerbose("begin ws.onclose"), this.transitionChunkBuffer = null, this.lastCloseReason === null && (this.lastCloseReason = n.reason || `closed with code ${n.code}`), n.code !== ta && n.code !== na && // This commonly gets fired on mobile apps when the app is backgrounded
|
|
1994
|
+
n.code !== ra && n.code !== ia) {
|
|
1995
1995
|
let i = `WebSocket closed with code ${n.code}`;
|
|
1996
1996
|
n.reason && (i += `: ${n.reason}`), this.logger.log(i), this.onServerDisconnectError && n.reason && this.onServerDisconnectError(i);
|
|
1997
1997
|
}
|
|
1998
|
-
const r =
|
|
1998
|
+
const r = oa(n.reason);
|
|
1999
1999
|
this.scheduleReconnect(r);
|
|
2000
2000
|
};
|
|
2001
2001
|
}
|
|
@@ -2017,7 +2017,7 @@ class ta {
|
|
|
2017
2017
|
} : {}
|
|
2018
2018
|
};
|
|
2019
2019
|
if (this.socket.state === "ready" && this.socket.paused === "no") {
|
|
2020
|
-
const r =
|
|
2020
|
+
const r = Ys(e), i = JSON.stringify(r);
|
|
2021
2021
|
let o = !1;
|
|
2022
2022
|
try {
|
|
2023
2023
|
this.socket.ws.send(i), o = !0;
|
|
@@ -2247,7 +2247,7 @@ class ta {
|
|
|
2247
2247
|
this.logger.logVerbose(e);
|
|
2248
2248
|
}
|
|
2249
2249
|
nextBackoff(e) {
|
|
2250
|
-
const n = (e === "client" ? 100 : e === "Unknown" ? this.defaultInitialBackoff :
|
|
2250
|
+
const n = (e === "client" ? 100 : e === "Unknown" ? this.defaultInitialBackoff : $i[e].timeout) * Math.pow(2, this.retries);
|
|
2251
2251
|
this.retries += 1;
|
|
2252
2252
|
const r = Math.min(n, this.maxBackoff), i = r * (Math.random() - 0.5);
|
|
2253
2253
|
return r + i;
|
|
@@ -2276,19 +2276,19 @@ class ta {
|
|
|
2276
2276
|
});
|
|
2277
2277
|
}
|
|
2278
2278
|
}
|
|
2279
|
-
function
|
|
2280
|
-
return
|
|
2279
|
+
function aa() {
|
|
2280
|
+
return la();
|
|
2281
2281
|
}
|
|
2282
|
-
function
|
|
2282
|
+
function la() {
|
|
2283
2283
|
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (t) => {
|
|
2284
2284
|
const e = Math.random() * 16 | 0;
|
|
2285
2285
|
return (t === "x" ? e : e & 3 | 8).toString(16);
|
|
2286
2286
|
});
|
|
2287
2287
|
}
|
|
2288
|
-
class
|
|
2288
|
+
class Be extends Error {
|
|
2289
2289
|
}
|
|
2290
|
-
|
|
2291
|
-
function
|
|
2290
|
+
Be.prototype.name = "InvalidTokenError";
|
|
2291
|
+
function ca(t) {
|
|
2292
2292
|
return decodeURIComponent(
|
|
2293
2293
|
atob(t).replace(/(.)/g, (e, n) => {
|
|
2294
2294
|
let r = n.charCodeAt(0).toString(16).toUpperCase();
|
|
@@ -2296,7 +2296,7 @@ function ia(t) {
|
|
|
2296
2296
|
})
|
|
2297
2297
|
);
|
|
2298
2298
|
}
|
|
2299
|
-
function
|
|
2299
|
+
function ua(t) {
|
|
2300
2300
|
let e = t.replace(/-/g, "+").replace(/_/g, "/");
|
|
2301
2301
|
switch (e.length % 4) {
|
|
2302
2302
|
case 0:
|
|
@@ -2311,41 +2311,41 @@ function oa(t) {
|
|
|
2311
2311
|
throw new Error("base64 string is not of the correct length");
|
|
2312
2312
|
}
|
|
2313
2313
|
try {
|
|
2314
|
-
return
|
|
2314
|
+
return ca(e);
|
|
2315
2315
|
} catch {
|
|
2316
2316
|
return atob(e);
|
|
2317
2317
|
}
|
|
2318
2318
|
}
|
|
2319
|
-
function
|
|
2319
|
+
function Ei(t, e) {
|
|
2320
2320
|
if (typeof t != "string")
|
|
2321
|
-
throw new
|
|
2321
|
+
throw new Be("Invalid token specified: must be a string");
|
|
2322
2322
|
e || (e = {});
|
|
2323
2323
|
const n = e.header === !0 ? 0 : 1, r = t.split(".")[n];
|
|
2324
2324
|
if (typeof r != "string")
|
|
2325
|
-
throw new
|
|
2325
|
+
throw new Be(
|
|
2326
2326
|
`Invalid token specified: missing part #${n + 1}`
|
|
2327
2327
|
);
|
|
2328
2328
|
let i;
|
|
2329
2329
|
try {
|
|
2330
|
-
i =
|
|
2330
|
+
i = ua(r);
|
|
2331
2331
|
} catch (o) {
|
|
2332
|
-
throw new
|
|
2332
|
+
throw new Be(
|
|
2333
2333
|
`Invalid token specified: invalid base64 for part #${n + 1} (${o.message})`
|
|
2334
2334
|
);
|
|
2335
2335
|
}
|
|
2336
2336
|
try {
|
|
2337
2337
|
return JSON.parse(i);
|
|
2338
2338
|
} catch (o) {
|
|
2339
|
-
throw new
|
|
2339
|
+
throw new Be(
|
|
2340
2340
|
`Invalid token specified: invalid json for part #${n + 1} (${o.message})`
|
|
2341
2341
|
);
|
|
2342
2342
|
}
|
|
2343
2343
|
}
|
|
2344
|
-
var
|
|
2345
|
-
const
|
|
2346
|
-
class
|
|
2344
|
+
var ha = Object.defineProperty, da = (t, e, n) => e in t ? ha(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, U = (t, e, n) => da(t, typeof e != "symbol" ? e + "" : e, n);
|
|
2345
|
+
const pa = 480 * 60 * 60 * 1e3, yr = 2;
|
|
2346
|
+
class fa {
|
|
2347
2347
|
constructor(e, n, r) {
|
|
2348
|
-
|
|
2348
|
+
U(this, "authState", { state: "noAuth" }), U(this, "configVersion", 0), U(this, "syncState"), U(this, "authenticate"), U(this, "stopSocket"), U(this, "tryRestartSocket"), U(this, "pauseSocket"), U(this, "resumeSocket"), U(this, "clearAuth"), U(this, "logger"), U(this, "refreshTokenLeewaySeconds"), U(this, "tokenConfirmationAttempts", 0), this.syncState = e, this.authenticate = n.authenticate, this.stopSocket = n.stopSocket, this.tryRestartSocket = n.tryRestartSocket, this.pauseSocket = n.pauseSocket, this.resumeSocket = n.resumeSocket, this.clearAuth = n.clearAuth, this.logger = r.logger, this.refreshTokenLeewaySeconds = r.refreshTokenLeewaySeconds;
|
|
2349
2349
|
}
|
|
2350
2350
|
async setConfig(e, n) {
|
|
2351
2351
|
this.resetAuthState(), this._logVerbose("pausing WS for auth token fetch"), this.pauseSocket();
|
|
@@ -2394,14 +2394,14 @@ class ca {
|
|
|
2394
2394
|
if (this._logVerbose(`attempting to reauthenticate: ${e.error}`), // No way to fetch another token, kaboom
|
|
2395
2395
|
this.authState.state === "noAuth" || // We failed on a fresh token. After a small number of retries, we give up
|
|
2396
2396
|
// and clear the auth state to avoid infinite retries.
|
|
2397
|
-
this.authState.state === "waitingForServerConfirmationOfFreshToken" && this.tokenConfirmationAttempts >=
|
|
2397
|
+
this.authState.state === "waitingForServerConfirmationOfFreshToken" && this.tokenConfirmationAttempts >= yr) {
|
|
2398
2398
|
this.logger.error(
|
|
2399
2399
|
`Failed to authenticate: "${e.error}", check your server auth config`
|
|
2400
2400
|
), this.syncState.hasAuth() && this.syncState.clearAuth(), this.authState.state !== "noAuth" && this.setAndReportAuthFailed(this.authState.config.onAuthChange);
|
|
2401
2401
|
return;
|
|
2402
2402
|
}
|
|
2403
2403
|
this.authState.state === "waitingForServerConfirmationOfFreshToken" && (this.tokenConfirmationAttempts++, this._logVerbose(
|
|
2404
|
-
`retrying reauthentication, ${
|
|
2404
|
+
`retrying reauthentication, ${yr - this.tokenConfirmationAttempts} attempts remaining`
|
|
2405
2405
|
)), await this.stopSocket();
|
|
2406
2406
|
const n = await this.fetchTokenAndGuardAgainstRace(
|
|
2407
2407
|
this.authState.config.fetchToken,
|
|
@@ -2466,7 +2466,7 @@ class ca {
|
|
|
2466
2466
|
return;
|
|
2467
2467
|
}
|
|
2468
2468
|
let s = Math.min(
|
|
2469
|
-
|
|
2469
|
+
pa,
|
|
2470
2470
|
(o - this.refreshTokenLeewaySeconds) * 1e3
|
|
2471
2471
|
);
|
|
2472
2472
|
s <= 0 && (this.logger.warn(
|
|
@@ -2523,7 +2523,7 @@ class ca {
|
|
|
2523
2523
|
}
|
|
2524
2524
|
decodeToken(e) {
|
|
2525
2525
|
try {
|
|
2526
|
-
return
|
|
2526
|
+
return Ei(e);
|
|
2527
2527
|
} catch (n) {
|
|
2528
2528
|
return this._logVerbose(
|
|
2529
2529
|
`Error decoding token: ${n instanceof Error ? n.message : "Unknown error"}`
|
|
@@ -2534,34 +2534,34 @@ class ca {
|
|
|
2534
2534
|
this.logger.logVerbose(`${e} [v${this.configVersion}]`);
|
|
2535
2535
|
}
|
|
2536
2536
|
}
|
|
2537
|
-
const
|
|
2537
|
+
const ga = [
|
|
2538
2538
|
"convexClientConstructed",
|
|
2539
2539
|
"convexWebSocketOpen",
|
|
2540
2540
|
"convexFirstMessageReceived"
|
|
2541
2541
|
];
|
|
2542
|
-
function
|
|
2542
|
+
function ma(t, e) {
|
|
2543
2543
|
const n = { sessionId: e };
|
|
2544
2544
|
typeof performance > "u" || !performance.mark || performance.mark(t, { detail: n });
|
|
2545
2545
|
}
|
|
2546
|
-
function
|
|
2546
|
+
function xa(t) {
|
|
2547
2547
|
let e = t.name.slice(6);
|
|
2548
2548
|
return e = e.charAt(0).toLowerCase() + e.slice(1), {
|
|
2549
2549
|
name: e,
|
|
2550
2550
|
startTime: t.startTime
|
|
2551
2551
|
};
|
|
2552
2552
|
}
|
|
2553
|
-
function
|
|
2553
|
+
function ba(t) {
|
|
2554
2554
|
if (typeof performance > "u" || !performance.getEntriesByName)
|
|
2555
2555
|
return [];
|
|
2556
2556
|
const e = [];
|
|
2557
|
-
for (const n of
|
|
2557
|
+
for (const n of ga) {
|
|
2558
2558
|
const r = performance.getEntriesByName(n).filter((i) => i.entryType === "mark").filter((i) => i.detail.sessionId === t);
|
|
2559
2559
|
e.push(...r);
|
|
2560
2560
|
}
|
|
2561
|
-
return e.map(
|
|
2561
|
+
return e.map(xa);
|
|
2562
2562
|
}
|
|
2563
|
-
var
|
|
2564
|
-
class
|
|
2563
|
+
var va = Object.defineProperty, ya = (t, e, n) => e in t ? va(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, E = (t, e, n) => ya(t, typeof e != "symbol" ? e + "" : e, n);
|
|
2564
|
+
class ka {
|
|
2565
2565
|
/**
|
|
2566
2566
|
* @param address - The url of your Convex deployment, often provided
|
|
2567
2567
|
* by an environment variable. E.g. `https://small-mouse-123.convex.cloud`.
|
|
@@ -2571,7 +2571,7 @@ class ma {
|
|
|
2571
2571
|
* @param options - See {@link BaseConvexClientOptions} for a full description.
|
|
2572
2572
|
*/
|
|
2573
2573
|
constructor(e, n, r) {
|
|
2574
|
-
if (
|
|
2574
|
+
if (E(this, "address"), E(this, "state"), E(this, "requestManager"), E(this, "webSocketManager"), E(this, "authenticationManager"), E(this, "remoteQuerySet"), E(this, "optimisticQueryResults"), E(this, "_transitionHandlerCounter", 0), E(this, "_nextRequestId"), E(this, "_onTransitionFns", /* @__PURE__ */ new Map()), E(this, "_sessionId"), E(this, "firstMessageReceived", !1), E(this, "debug"), E(this, "logger"), E(this, "maxObservedTimestamp"), E(this, "connectionStateSubscribers", /* @__PURE__ */ new Map()), E(this, "nextConnectionStateSubscriberId", 0), E(this, "_lastPublishedConnectionState"), E(this, "markConnectionStateDirty", () => {
|
|
2575
2575
|
Promise.resolve().then(() => {
|
|
2576
2576
|
const f = this.connectionState();
|
|
2577
2577
|
if (JSON.stringify(f) !== JSON.stringify(this._lastPublishedConnectionState)) {
|
|
@@ -2580,20 +2580,20 @@ class ma {
|
|
|
2580
2580
|
g(f);
|
|
2581
2581
|
}
|
|
2582
2582
|
});
|
|
2583
|
-
}),
|
|
2584
|
-
this.debug &&
|
|
2583
|
+
}), E(this, "mark", (f) => {
|
|
2584
|
+
this.debug && ma(f, this.sessionId);
|
|
2585
2585
|
}), typeof e == "object")
|
|
2586
2586
|
throw new Error(
|
|
2587
2587
|
"Passing a ClientConfig object is no longer supported. Pass the URL of the Convex deployment as a string directly."
|
|
2588
2588
|
);
|
|
2589
|
-
r?.skipConvexDeploymentUrlCheck !== !0 &&
|
|
2589
|
+
r?.skipConvexDeploymentUrlCheck !== !0 && gs(e), r = { ...r };
|
|
2590
2590
|
const i = r.authRefreshTokenLeewaySeconds ?? 10;
|
|
2591
2591
|
let o = r.webSocketConstructor;
|
|
2592
2592
|
if (!o && typeof WebSocket > "u")
|
|
2593
2593
|
throw new Error(
|
|
2594
2594
|
"No WebSocket global variable defined! To use Convex in an environment without WebSocket try the HTTP client: https://docs.convex.dev/api/classes/browser.ConvexHttpClient"
|
|
2595
2595
|
);
|
|
2596
|
-
o = o || WebSocket, this.debug = r.reportDebugInfoToConvex ?? !1, this.address = e, this.logger = r.logger === !1 ?
|
|
2596
|
+
o = o || WebSocket, this.debug = r.reportDebugInfoToConvex ?? !1, this.address = e, this.logger = r.logger === !1 ? Ti({ verbose: r.verbose ?? !1 }) : r.logger !== !0 && r.logger ? r.logger : Ri({ verbose: r.verbose ?? !1 });
|
|
2597
2597
|
const s = e.search("://");
|
|
2598
2598
|
if (s === -1)
|
|
2599
2599
|
throw new Error("Provided address was not an absolute URL.");
|
|
@@ -2605,18 +2605,18 @@ class ma {
|
|
|
2605
2605
|
u = "wss";
|
|
2606
2606
|
else
|
|
2607
2607
|
throw new Error(`Unknown parent protocol ${a}`);
|
|
2608
|
-
const d = `${u}://${l}/api/${
|
|
2609
|
-
this.state = new
|
|
2608
|
+
const d = `${u}://${l}/api/${pr}/sync`;
|
|
2609
|
+
this.state = new qs(), this.remoteQuerySet = new xr(
|
|
2610
2610
|
(f) => this.state.queryPath(f),
|
|
2611
2611
|
this.logger
|
|
2612
|
-
), this.requestManager = new
|
|
2612
|
+
), this.requestManager = new Ls(
|
|
2613
2613
|
this.logger,
|
|
2614
2614
|
this.markConnectionStateDirty
|
|
2615
2615
|
);
|
|
2616
2616
|
const h = () => {
|
|
2617
2617
|
this.webSocketManager.pause(), this.state.pause();
|
|
2618
2618
|
};
|
|
2619
|
-
this.authenticationManager = new
|
|
2619
|
+
this.authenticationManager = new fa(
|
|
2620
2620
|
this.state,
|
|
2621
2621
|
{
|
|
2622
2622
|
authenticate: (f) => {
|
|
@@ -2635,9 +2635,9 @@ class ma {
|
|
|
2635
2635
|
logger: this.logger,
|
|
2636
2636
|
refreshTokenLeewaySeconds: i
|
|
2637
2637
|
}
|
|
2638
|
-
), this.optimisticQueryResults = new
|
|
2638
|
+
), this.optimisticQueryResults = new Ds(), this.addOnTransitionHandler((f) => {
|
|
2639
2639
|
n(f.queries.map((g) => g.token));
|
|
2640
|
-
}), this._nextRequestId = 0, this._sessionId =
|
|
2640
|
+
}), this._nextRequestId = 0, this._sessionId = aa();
|
|
2641
2641
|
const { unsavedChangesWarning: p } = r;
|
|
2642
2642
|
if (typeof window > "u" || typeof window.addEventListener > "u") {
|
|
2643
2643
|
if (p === !0)
|
|
@@ -2651,7 +2651,7 @@ class ma {
|
|
|
2651
2651
|
return (f || window.event).returnValue = g, g;
|
|
2652
2652
|
}
|
|
2653
2653
|
});
|
|
2654
|
-
this.webSocketManager = new
|
|
2654
|
+
this.webSocketManager = new sa(
|
|
2655
2655
|
d,
|
|
2656
2656
|
{
|
|
2657
2657
|
onOpen: (f) => {
|
|
@@ -2660,7 +2660,7 @@ class ma {
|
|
|
2660
2660
|
type: "Connect",
|
|
2661
2661
|
sessionId: this._sessionId,
|
|
2662
2662
|
maxObservedTimestamp: this.maxObservedTimestamp
|
|
2663
|
-
}), this.remoteQuerySet = new
|
|
2663
|
+
}), this.remoteQuerySet = new xr(
|
|
2664
2664
|
(x) => this.state.queryPath(x),
|
|
2665
2665
|
this.logger
|
|
2666
2666
|
);
|
|
@@ -2707,7 +2707,7 @@ class ma {
|
|
|
2707
2707
|
break;
|
|
2708
2708
|
}
|
|
2709
2709
|
case "FatalError": {
|
|
2710
|
-
const g =
|
|
2710
|
+
const g = Is(this.logger, f.error);
|
|
2711
2711
|
throw this.webSocketManager.terminate(), g;
|
|
2712
2712
|
}
|
|
2713
2713
|
}
|
|
@@ -2807,7 +2807,7 @@ class ma {
|
|
|
2807
2807
|
let n = {};
|
|
2808
2808
|
if (e && e.tokenType === "User")
|
|
2809
2809
|
try {
|
|
2810
|
-
n = e ?
|
|
2810
|
+
n = e ? Ei(e.value) : {};
|
|
2811
2811
|
} catch {
|
|
2812
2812
|
n = {};
|
|
2813
2813
|
}
|
|
@@ -2966,7 +2966,7 @@ class ma {
|
|
|
2966
2966
|
async mutation(e, n, r) {
|
|
2967
2967
|
const i = await this.mutationInternal(e, n, r);
|
|
2968
2968
|
if (!i.success)
|
|
2969
|
-
throw i.errorData !== void 0 ?
|
|
2969
|
+
throw i.errorData !== void 0 ? an(
|
|
2970
2970
|
i,
|
|
2971
2971
|
new vt(
|
|
2972
2972
|
Ce("mutation", e, i)
|
|
@@ -3050,7 +3050,7 @@ class ma {
|
|
|
3050
3050
|
async action(e, n) {
|
|
3051
3051
|
const r = await this.actionInternal(e, n);
|
|
3052
3052
|
if (!r.success)
|
|
3053
|
-
throw r.errorData !== void 0 ?
|
|
3053
|
+
throw r.errorData !== void 0 ? an(
|
|
3054
3054
|
r,
|
|
3055
3055
|
new vt(Ce("action", e, r))
|
|
3056
3056
|
) : new Error(Ce("action", e, r));
|
|
@@ -3109,7 +3109,7 @@ class ma {
|
|
|
3109
3109
|
*/
|
|
3110
3110
|
reportMarks() {
|
|
3111
3111
|
if (this.debug) {
|
|
3112
|
-
const e =
|
|
3112
|
+
const e = ba(this.sessionId);
|
|
3113
3113
|
this.webSocketManager.sendMessage({
|
|
3114
3114
|
type: "Event",
|
|
3115
3115
|
eventType: "ClientConnect",
|
|
@@ -3128,7 +3128,7 @@ class ma {
|
|
|
3128
3128
|
method: "POST",
|
|
3129
3129
|
headers: {
|
|
3130
3130
|
"Content-Type": "application/json",
|
|
3131
|
-
"Convex-Client": `npm-${
|
|
3131
|
+
"Convex-Client": `npm-${pr}`
|
|
3132
3132
|
},
|
|
3133
3133
|
body: JSON.stringify({ event: "LongWebsocketDisconnect" })
|
|
3134
3134
|
}).then((r) => {
|
|
@@ -3141,15 +3141,15 @@ class ma {
|
|
|
3141
3141
|
});
|
|
3142
3142
|
}
|
|
3143
3143
|
}
|
|
3144
|
-
function
|
|
3144
|
+
function Ht(t) {
|
|
3145
3145
|
if (typeof t != "object" || t === null || !Array.isArray(t.page) || typeof t.isDone != "boolean" || typeof t.continueCursor != "string")
|
|
3146
3146
|
throw new Error(`Not a valid paginated query result: ${t?.toString()}`);
|
|
3147
3147
|
return t;
|
|
3148
3148
|
}
|
|
3149
|
-
var
|
|
3150
|
-
class
|
|
3149
|
+
var wa = Object.defineProperty, _a = (t, e, n) => e in t ? wa(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, kr = (t, e, n) => _a(t, typeof e != "symbol" ? e + "" : e, n);
|
|
3150
|
+
class ja {
|
|
3151
3151
|
constructor(e, n) {
|
|
3152
|
-
this.client = e, this.onTransition = n,
|
|
3152
|
+
this.client = e, this.onTransition = n, kr(this, "paginatedQuerySet", /* @__PURE__ */ new Map()), kr(this, "lastTransitionTs"), this.lastTransitionTs = L.fromNumber(0), this.client.addOnTransitionHandler(
|
|
3153
3153
|
(r) => this.onBaseTransition(r)
|
|
3154
3154
|
);
|
|
3155
3155
|
}
|
|
@@ -3162,7 +3162,7 @@ class va {
|
|
|
3162
3162
|
* @returns Object with paginatedQueryToken and unsubscribe function
|
|
3163
3163
|
*/
|
|
3164
3164
|
subscribe(e, n, r) {
|
|
3165
|
-
const i = me(e), o =
|
|
3165
|
+
const i = me(e), o = gr(
|
|
3166
3166
|
i,
|
|
3167
3167
|
n,
|
|
3168
3168
|
r
|
|
@@ -3193,7 +3193,7 @@ class va {
|
|
|
3193
3193
|
* Throws an error when one of the pages has errored.
|
|
3194
3194
|
*/
|
|
3195
3195
|
localQueryResult(e, n, r) {
|
|
3196
|
-
const i = me(e), o =
|
|
3196
|
+
const i = me(e), o = gr(
|
|
3197
3197
|
i,
|
|
3198
3198
|
n,
|
|
3199
3199
|
r
|
|
@@ -3221,7 +3221,7 @@ class va {
|
|
|
3221
3221
|
o = !0, s = !1;
|
|
3222
3222
|
continue;
|
|
3223
3223
|
}
|
|
3224
|
-
const d =
|
|
3224
|
+
const d = Ht(u);
|
|
3225
3225
|
i = i.concat(d.page), s = !!d.isDone;
|
|
3226
3226
|
}
|
|
3227
3227
|
let l;
|
|
@@ -3266,7 +3266,7 @@ class va {
|
|
|
3266
3266
|
const r = this.queryTokenForLastPageOfPaginatedQuery(e), i = this.client.localQueryResultByToken(r);
|
|
3267
3267
|
if (!i)
|
|
3268
3268
|
return !1;
|
|
3269
|
-
const o =
|
|
3269
|
+
const o = Ht(i);
|
|
3270
3270
|
if (o.isDone)
|
|
3271
3271
|
return !1;
|
|
3272
3272
|
this.addPageToPaginatedQuery(
|
|
@@ -3324,7 +3324,7 @@ class va {
|
|
|
3324
3324
|
const u = s.get(a).queryToken, d = n(u);
|
|
3325
3325
|
if (!d)
|
|
3326
3326
|
continue;
|
|
3327
|
-
const h =
|
|
3327
|
+
const h = Ht(d);
|
|
3328
3328
|
h.splitCursor && (h.pageStatus === "SplitRecommended" || h.pageStatus === "SplitRequired" || // This client-driven page splitting condition will change in the future.
|
|
3329
3329
|
h.page.length > i.options.initialNumItems * 2) && this.splitPaginatedQueryPage(
|
|
3330
3330
|
i,
|
|
@@ -3422,7 +3422,7 @@ class va {
|
|
|
3422
3422
|
return n;
|
|
3423
3423
|
}
|
|
3424
3424
|
}
|
|
3425
|
-
function
|
|
3425
|
+
function Sa({
|
|
3426
3426
|
// (Synchronously) returns the current value of our subscription.
|
|
3427
3427
|
getCurrentValue: t,
|
|
3428
3428
|
// This function is passed an event handler to attach to the subscription.
|
|
@@ -3439,7 +3439,7 @@ function ya({
|
|
|
3439
3439
|
getCurrentValue: t,
|
|
3440
3440
|
subscribe: e,
|
|
3441
3441
|
value: i
|
|
3442
|
-
})),
|
|
3442
|
+
})), R(() => {
|
|
3443
3443
|
let o = !1;
|
|
3444
3444
|
const s = () => {
|
|
3445
3445
|
o || r((a) => {
|
|
@@ -3454,13 +3454,13 @@ function ya({
|
|
|
3454
3454
|
};
|
|
3455
3455
|
}, [t, e]), i;
|
|
3456
3456
|
}
|
|
3457
|
-
var
|
|
3458
|
-
const
|
|
3459
|
-
if (typeof
|
|
3457
|
+
var Ca = Object.defineProperty, Ra = (t, e, n) => e in t ? Ca(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, re = (t, e, n) => Ra(t, typeof e != "symbol" ? e + "" : e, n);
|
|
3458
|
+
const Ta = 5e3;
|
|
3459
|
+
if (typeof Cn > "u")
|
|
3460
3460
|
throw new Error("Required dependency 'react' not found");
|
|
3461
|
-
function
|
|
3461
|
+
function qi(t, e, n) {
|
|
3462
3462
|
function r(i) {
|
|
3463
|
-
return
|
|
3463
|
+
return Ea(i), e.mutation(t, i, {
|
|
3464
3464
|
optimisticUpdate: n
|
|
3465
3465
|
});
|
|
3466
3466
|
}
|
|
@@ -3471,10 +3471,10 @@ function Ai(t, e, n) {
|
|
|
3471
3471
|
t
|
|
3472
3472
|
)}`
|
|
3473
3473
|
);
|
|
3474
|
-
return
|
|
3474
|
+
return qi(t, e, i);
|
|
3475
3475
|
}, r;
|
|
3476
3476
|
}
|
|
3477
|
-
class
|
|
3477
|
+
class Aa {
|
|
3478
3478
|
/**
|
|
3479
3479
|
* @param address - The url of your Convex deployment, often provided
|
|
3480
3480
|
* by an environment variable. E.g. `https://small-mouse-123.convex.cloud`.
|
|
@@ -3491,7 +3491,7 @@ class ja {
|
|
|
3491
3491
|
);
|
|
3492
3492
|
if (!e.includes("://"))
|
|
3493
3493
|
throw new Error("Provided address was not an absolute URL.");
|
|
3494
|
-
this.address = e, this.listeners = /* @__PURE__ */ new Map(), this._logger = n?.logger === !1 ?
|
|
3494
|
+
this.address = e, this.listeners = /* @__PURE__ */ new Map(), this._logger = n?.logger === !1 ? Ti({ verbose: n?.verbose ?? !1 }) : n?.logger !== !0 && n?.logger ? n.logger : Ri({ verbose: n?.verbose ?? !1 }), this.options = { ...n, logger: this._logger };
|
|
3495
3495
|
}
|
|
3496
3496
|
/**
|
|
3497
3497
|
* Return the address for this client, useful for creating a new client.
|
|
@@ -3511,13 +3511,13 @@ class ja {
|
|
|
3511
3511
|
get sync() {
|
|
3512
3512
|
if (this.closed)
|
|
3513
3513
|
throw new Error("ConvexReactClient has already been closed.");
|
|
3514
|
-
return this.cachedSync ? this.cachedSync : (this.cachedSync = new
|
|
3514
|
+
return this.cachedSync ? this.cachedSync : (this.cachedSync = new ka(
|
|
3515
3515
|
this.address,
|
|
3516
3516
|
() => {
|
|
3517
3517
|
},
|
|
3518
3518
|
// Use the PaginatedQueryClient's transition instead.
|
|
3519
3519
|
this.options
|
|
3520
|
-
), this.adminAuth && this.cachedSync.setAdminAuth(this.adminAuth, this.fakeUserIdentity), this.cachedPaginatedQueryClient = new
|
|
3520
|
+
), this.adminAuth && this.cachedSync.setAdminAuth(this.adminAuth, this.fakeUserIdentity), this.cachedPaginatedQueryClient = new ja(
|
|
3521
3521
|
this.cachedSync,
|
|
3522
3522
|
(e) => this.handleTransition(e)
|
|
3523
3523
|
), this.cachedSync);
|
|
@@ -3627,7 +3627,7 @@ class ja {
|
|
|
3627
3627
|
* an optional extendSubscriptionFor for how long to subscribe to the query.
|
|
3628
3628
|
*/
|
|
3629
3629
|
prewarmQuery(e) {
|
|
3630
|
-
const n = e.extendSubscriptionFor ??
|
|
3630
|
+
const n = e.extendSubscriptionFor ?? Ta, r = this.watchQuery(e.query, e.args || {}).onUpdate(() => {
|
|
3631
3631
|
});
|
|
3632
3632
|
setTimeout(r, n);
|
|
3633
3633
|
}
|
|
@@ -3778,52 +3778,52 @@ class ja {
|
|
|
3778
3778
|
}
|
|
3779
3779
|
}
|
|
3780
3780
|
}
|
|
3781
|
-
const
|
|
3781
|
+
const Tn = Cn.createContext(
|
|
3782
3782
|
void 0
|
|
3783
3783
|
// in the future this will be a mocked client for testing
|
|
3784
3784
|
);
|
|
3785
|
-
function
|
|
3786
|
-
return
|
|
3785
|
+
function Ia() {
|
|
3786
|
+
return It(Tn);
|
|
3787
3787
|
}
|
|
3788
|
-
const
|
|
3789
|
-
|
|
3788
|
+
const $a = ({ client: t, children: e }) => Cn.createElement(
|
|
3789
|
+
Tn.Provider,
|
|
3790
3790
|
{ value: t },
|
|
3791
3791
|
e
|
|
3792
3792
|
);
|
|
3793
|
-
function
|
|
3794
|
-
const n = e[0] === "skip", r = e[0] === "skip" ? {} : ie(e[0]), i = typeof t == "string" ?
|
|
3793
|
+
function wr(t, ...e) {
|
|
3794
|
+
const n = e[0] === "skip", r = e[0] === "skip" ? {} : ie(e[0]), i = typeof t == "string" ? Ai(t) : t, o = O(i), s = J(
|
|
3795
3795
|
() => n ? {} : { query: { query: i, args: r } },
|
|
3796
3796
|
// Stringify args so args that are semantically the same don't trigger a
|
|
3797
3797
|
// rerender. Saves developers from adding `useMemo` on every args usage.
|
|
3798
3798
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
3799
3799
|
[JSON.stringify(ne(r)), o, n]
|
|
3800
|
-
), l =
|
|
3800
|
+
), l = La(s).query;
|
|
3801
3801
|
if (l instanceof Error)
|
|
3802
3802
|
throw l;
|
|
3803
3803
|
return l;
|
|
3804
3804
|
}
|
|
3805
|
-
function
|
|
3806
|
-
const e = typeof t == "string" ?
|
|
3805
|
+
function Et(t) {
|
|
3806
|
+
const e = typeof t == "string" ? Ai(t) : t, n = It(Tn);
|
|
3807
3807
|
if (n === void 0)
|
|
3808
3808
|
throw new Error(
|
|
3809
3809
|
"Could not find Convex client! `useMutation` must be used in the React component tree under `ConvexProvider`. Did you forget it? See https://docs.convex.dev/quick-start#set-up-convex-in-your-react-app"
|
|
3810
3810
|
);
|
|
3811
3811
|
return J(
|
|
3812
|
-
() =>
|
|
3812
|
+
() => qi(e, n),
|
|
3813
3813
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
3814
3814
|
[n, O(e)]
|
|
3815
3815
|
);
|
|
3816
3816
|
}
|
|
3817
|
-
function
|
|
3817
|
+
function Ea(t) {
|
|
3818
3818
|
if (typeof t == "object" && t !== null && "bubbles" in t && "persist" in t && "isDefaultPrevented" in t)
|
|
3819
3819
|
throw new Error(
|
|
3820
3820
|
"Convex function called with SyntheticEvent object. Did you use a Convex function as an event handler directly? Event handlers like onClick receive an event object as their first argument. These SyntheticEvent objects are not valid Convex values. Try wrapping the function like `const handler = () => myMutation();` and using `handler` in the event handler."
|
|
3821
3821
|
);
|
|
3822
3822
|
}
|
|
3823
|
-
var
|
|
3824
|
-
class
|
|
3823
|
+
var qa = Object.defineProperty, Ma = (t, e, n) => e in t ? qa(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, Wt = (t, e, n) => Ma(t, typeof e != "symbol" ? e + "" : e, n);
|
|
3824
|
+
class Pa {
|
|
3825
3825
|
constructor(e) {
|
|
3826
|
-
|
|
3826
|
+
Wt(this, "createWatch"), Wt(this, "queries"), Wt(this, "listeners"), this.createWatch = e, this.queries = {}, this.listeners = /* @__PURE__ */ new Set();
|
|
3827
3827
|
}
|
|
3828
3828
|
setQueries(e) {
|
|
3829
3829
|
for (const n of Object.keys(e)) {
|
|
@@ -3922,8 +3922,8 @@ class Ia {
|
|
|
3922
3922
|
e();
|
|
3923
3923
|
}
|
|
3924
3924
|
}
|
|
3925
|
-
function
|
|
3926
|
-
const e =
|
|
3925
|
+
function La(t) {
|
|
3926
|
+
const e = Ia();
|
|
3927
3927
|
if (e === void 0)
|
|
3928
3928
|
throw new Error(
|
|
3929
3929
|
"Could not find Convex client! `useQuery` must be used in the React component tree under `ConvexProvider`. Did you forget it? See https://docs.convex.dev/quick-start#set-up-convex-in-your-react-app"
|
|
@@ -3932,11 +3932,11 @@ function $a(t) {
|
|
|
3932
3932
|
journal: o,
|
|
3933
3933
|
paginationOptions: s
|
|
3934
3934
|
}) => s ? e.watchPaginatedQuery(r, i, s) : e.watchQuery(r, i, o ? { journal: o } : {}), [e]);
|
|
3935
|
-
return
|
|
3935
|
+
return Oa(t, n);
|
|
3936
3936
|
}
|
|
3937
|
-
function
|
|
3938
|
-
const [n] = C(() => new
|
|
3939
|
-
n.createWatch !== e && n.setCreateWatch(e),
|
|
3937
|
+
function Oa(t, e) {
|
|
3938
|
+
const [n] = C(() => new Pa(e));
|
|
3939
|
+
n.createWatch !== e && n.setCreateWatch(e), R(() => () => n.destroy(), [n]);
|
|
3940
3940
|
const r = J(
|
|
3941
3941
|
() => ({
|
|
3942
3942
|
getCurrentValue: () => n.getLocalResults(t),
|
|
@@ -3944,18 +3944,18 @@ function Ea(t, e) {
|
|
|
3944
3944
|
}),
|
|
3945
3945
|
[n, t]
|
|
3946
3946
|
);
|
|
3947
|
-
return
|
|
3947
|
+
return Sa(r);
|
|
3948
3948
|
}
|
|
3949
|
-
var
|
|
3950
|
-
function
|
|
3949
|
+
var za = /* @__PURE__ */ Symbol.for("preact-signals");
|
|
3950
|
+
function qt() {
|
|
3951
3951
|
if (ae > 1)
|
|
3952
3952
|
ae--;
|
|
3953
3953
|
else {
|
|
3954
3954
|
for (var t, e = !1; Ke !== void 0; ) {
|
|
3955
3955
|
var n = Ke;
|
|
3956
|
-
for (Ke = void 0,
|
|
3956
|
+
for (Ke = void 0, ln++; n !== void 0; ) {
|
|
3957
3957
|
var r = n.o;
|
|
3958
|
-
if (n.o = void 0, n.f &= -3, !(8 & n.f) &&
|
|
3958
|
+
if (n.o = void 0, n.f &= -3, !(8 & n.f) && Li(n)) try {
|
|
3959
3959
|
n.c();
|
|
3960
3960
|
} catch (i) {
|
|
3961
3961
|
e || (t = i, e = !0);
|
|
@@ -3963,20 +3963,20 @@ function Et() {
|
|
|
3963
3963
|
n = r;
|
|
3964
3964
|
}
|
|
3965
3965
|
}
|
|
3966
|
-
if (
|
|
3966
|
+
if (ln = 0, ae--, e) throw t;
|
|
3967
3967
|
}
|
|
3968
3968
|
}
|
|
3969
|
-
function
|
|
3969
|
+
function Na(t) {
|
|
3970
3970
|
if (ae > 0) return t();
|
|
3971
3971
|
ae++;
|
|
3972
3972
|
try {
|
|
3973
3973
|
return t();
|
|
3974
3974
|
} finally {
|
|
3975
|
-
|
|
3975
|
+
qt();
|
|
3976
3976
|
}
|
|
3977
3977
|
}
|
|
3978
3978
|
var w = void 0;
|
|
3979
|
-
function
|
|
3979
|
+
function Mi(t) {
|
|
3980
3980
|
var e = w;
|
|
3981
3981
|
w = void 0;
|
|
3982
3982
|
try {
|
|
@@ -3985,8 +3985,8 @@ function Ii(t) {
|
|
|
3985
3985
|
w = e;
|
|
3986
3986
|
}
|
|
3987
3987
|
}
|
|
3988
|
-
var Ke = void 0, ae = 0,
|
|
3989
|
-
function
|
|
3988
|
+
var Ke = void 0, ae = 0, ln = 0, wt = 0;
|
|
3989
|
+
function Pi(t) {
|
|
3990
3990
|
if (w !== void 0) {
|
|
3991
3991
|
var e = t.n;
|
|
3992
3992
|
if (e === void 0 || e.t !== w)
|
|
@@ -3998,13 +3998,13 @@ function $i(t) {
|
|
|
3998
3998
|
function M(t, e) {
|
|
3999
3999
|
this.v = t, this.i = 0, this.n = void 0, this.t = void 0, this.W = e?.watched, this.Z = e?.unwatched, this.name = e?.name;
|
|
4000
4000
|
}
|
|
4001
|
-
M.prototype.brand =
|
|
4001
|
+
M.prototype.brand = za;
|
|
4002
4002
|
M.prototype.h = function() {
|
|
4003
4003
|
return !0;
|
|
4004
4004
|
};
|
|
4005
4005
|
M.prototype.S = function(t) {
|
|
4006
4006
|
var e = this, n = this.t;
|
|
4007
|
-
n !== t && t.e === void 0 && (t.x = n, this.t = t, n !== void 0 ? n.e = t :
|
|
4007
|
+
n !== t && t.e === void 0 && (t.x = n, this.t = t, n !== void 0 ? n.e = t : Mi(function() {
|
|
4008
4008
|
var r;
|
|
4009
4009
|
(r = e.W) == null || r.call(e);
|
|
4010
4010
|
}));
|
|
@@ -4013,7 +4013,7 @@ M.prototype.U = function(t) {
|
|
|
4013
4013
|
var e = this;
|
|
4014
4014
|
if (this.t !== void 0) {
|
|
4015
4015
|
var n = t.e, r = t.x;
|
|
4016
|
-
n !== void 0 && (n.x = r, t.e = void 0), r !== void 0 && (r.e = n, t.x = void 0), t === this.t && (this.t = r, r === void 0 &&
|
|
4016
|
+
n !== void 0 && (n.x = r, t.e = void 0), r !== void 0 && (r.e = n, t.x = void 0), t === this.t && (this.t = r, r === void 0 && Mi(function() {
|
|
4017
4017
|
var i;
|
|
4018
4018
|
(i = e.Z) == null || i.call(e);
|
|
4019
4019
|
}));
|
|
@@ -4050,27 +4050,27 @@ M.prototype.peek = function() {
|
|
|
4050
4050
|
}
|
|
4051
4051
|
};
|
|
4052
4052
|
Object.defineProperty(M.prototype, "value", { get: function() {
|
|
4053
|
-
var t =
|
|
4053
|
+
var t = Pi(this);
|
|
4054
4054
|
return t !== void 0 && (t.i = this.i), this.v;
|
|
4055
4055
|
}, set: function(t) {
|
|
4056
4056
|
if (t !== this.v) {
|
|
4057
|
-
if (
|
|
4057
|
+
if (ln > 100) throw new Error("Cycle detected");
|
|
4058
4058
|
this.v = t, this.i++, wt++, ae++;
|
|
4059
4059
|
try {
|
|
4060
4060
|
for (var e = this.t; e !== void 0; e = e.x) e.t.N();
|
|
4061
4061
|
} finally {
|
|
4062
|
-
|
|
4062
|
+
qt();
|
|
4063
4063
|
}
|
|
4064
4064
|
}
|
|
4065
4065
|
} });
|
|
4066
|
-
function
|
|
4066
|
+
function A(t, e) {
|
|
4067
4067
|
return new M(t, e);
|
|
4068
4068
|
}
|
|
4069
|
-
function
|
|
4069
|
+
function Li(t) {
|
|
4070
4070
|
for (var e = t.s; e !== void 0; e = e.n) if (e.S.i !== e.i || !e.S.h() || e.S.i !== e.i) return !0;
|
|
4071
4071
|
return !1;
|
|
4072
4072
|
}
|
|
4073
|
-
function
|
|
4073
|
+
function Oi(t) {
|
|
4074
4074
|
for (var e = t.s; e !== void 0; e = e.n) {
|
|
4075
4075
|
var n = e.S.n;
|
|
4076
4076
|
if (n !== void 0 && (e.r = n), e.S.n = e, e.i = -1, e.n === void 0) {
|
|
@@ -4079,7 +4079,7 @@ function qi(t) {
|
|
|
4079
4079
|
}
|
|
4080
4080
|
}
|
|
4081
4081
|
}
|
|
4082
|
-
function
|
|
4082
|
+
function zi(t) {
|
|
4083
4083
|
for (var e = t.s, n = void 0; e !== void 0; ) {
|
|
4084
4084
|
var r = e.p;
|
|
4085
4085
|
e.i === -1 ? (e.S.U(e), r !== void 0 && (r.n = e.n), e.n !== void 0 && (e.n.p = r)) : n = e, e.S.n = e.r, e.r !== void 0 && (e.r = void 0), e = r;
|
|
@@ -4093,17 +4093,17 @@ ve.prototype = new M();
|
|
|
4093
4093
|
ve.prototype.h = function() {
|
|
4094
4094
|
if (this.f &= -3, 1 & this.f) return !1;
|
|
4095
4095
|
if ((36 & this.f) == 32 || (this.f &= -5, this.g === wt)) return !0;
|
|
4096
|
-
if (this.g = wt, this.f |= 1, this.i > 0 && !
|
|
4096
|
+
if (this.g = wt, this.f |= 1, this.i > 0 && !Li(this))
|
|
4097
4097
|
return this.f &= -2, !0;
|
|
4098
4098
|
var t = w;
|
|
4099
4099
|
try {
|
|
4100
|
-
|
|
4100
|
+
Oi(this), w = this;
|
|
4101
4101
|
var e = this.x();
|
|
4102
4102
|
(16 & this.f || this.v !== e || this.i === 0) && (this.v = e, this.f &= -17, this.i++);
|
|
4103
4103
|
} catch (n) {
|
|
4104
4104
|
this.v = n, this.f |= 16, this.i++;
|
|
4105
4105
|
}
|
|
4106
|
-
return w = t,
|
|
4106
|
+
return w = t, zi(this), this.f &= -2, !0;
|
|
4107
4107
|
};
|
|
4108
4108
|
ve.prototype.S = function(t) {
|
|
4109
4109
|
if (this.t === void 0) {
|
|
@@ -4126,14 +4126,14 @@ ve.prototype.N = function() {
|
|
|
4126
4126
|
};
|
|
4127
4127
|
Object.defineProperty(ve.prototype, "value", { get: function() {
|
|
4128
4128
|
if (1 & this.f) throw new Error("Cycle detected");
|
|
4129
|
-
var t =
|
|
4129
|
+
var t = Pi(this);
|
|
4130
4130
|
if (this.h(), t !== void 0 && (t.i = this.i), 16 & this.f) throw this.v;
|
|
4131
4131
|
return this.v;
|
|
4132
4132
|
} });
|
|
4133
|
-
function
|
|
4133
|
+
function cn(t, e) {
|
|
4134
4134
|
return new ve(t, e);
|
|
4135
4135
|
}
|
|
4136
|
-
function
|
|
4136
|
+
function Ni(t) {
|
|
4137
4137
|
var e = t.u;
|
|
4138
4138
|
if (t.u = void 0, typeof e == "function") {
|
|
4139
4139
|
ae++;
|
|
@@ -4142,24 +4142,24 @@ function Pi(t) {
|
|
|
4142
4142
|
try {
|
|
4143
4143
|
e();
|
|
4144
4144
|
} catch (r) {
|
|
4145
|
-
throw t.f &= -2, t.f |= 8,
|
|
4145
|
+
throw t.f &= -2, t.f |= 8, An(t), r;
|
|
4146
4146
|
} finally {
|
|
4147
|
-
w = n,
|
|
4147
|
+
w = n, qt();
|
|
4148
4148
|
}
|
|
4149
4149
|
}
|
|
4150
4150
|
}
|
|
4151
|
-
function
|
|
4151
|
+
function An(t) {
|
|
4152
4152
|
for (var e = t.s; e !== void 0; e = e.n) e.S.U(e);
|
|
4153
|
-
t.x = void 0, t.s = void 0,
|
|
4153
|
+
t.x = void 0, t.s = void 0, Ni(t);
|
|
4154
4154
|
}
|
|
4155
|
-
function
|
|
4155
|
+
function Qa(t) {
|
|
4156
4156
|
if (w !== this) throw new Error("Out-of-order effect");
|
|
4157
|
-
|
|
4157
|
+
zi(this), w = t, this.f &= -2, 8 & this.f && An(this), qt();
|
|
4158
4158
|
}
|
|
4159
|
-
function
|
|
4159
|
+
function Le(t, e) {
|
|
4160
4160
|
this.x = t, this.u = void 0, this.s = void 0, this.o = void 0, this.f = 32, this.name = e?.name;
|
|
4161
4161
|
}
|
|
4162
|
-
|
|
4162
|
+
Le.prototype.c = function() {
|
|
4163
4163
|
var t = this.S();
|
|
4164
4164
|
try {
|
|
4165
4165
|
if (8 & this.f || this.x === void 0) return;
|
|
@@ -4169,23 +4169,23 @@ Pe.prototype.c = function() {
|
|
|
4169
4169
|
t();
|
|
4170
4170
|
}
|
|
4171
4171
|
};
|
|
4172
|
-
|
|
4172
|
+
Le.prototype.S = function() {
|
|
4173
4173
|
if (1 & this.f) throw new Error("Cycle detected");
|
|
4174
|
-
this.f |= 1, this.f &= -9,
|
|
4174
|
+
this.f |= 1, this.f &= -9, Ni(this), Oi(this), ae++;
|
|
4175
4175
|
var t = w;
|
|
4176
|
-
return w = this,
|
|
4176
|
+
return w = this, Qa.bind(this, t);
|
|
4177
4177
|
};
|
|
4178
|
-
|
|
4178
|
+
Le.prototype.N = function() {
|
|
4179
4179
|
2 & this.f || (this.f |= 2, this.o = Ke, Ke = this);
|
|
4180
4180
|
};
|
|
4181
|
-
|
|
4182
|
-
this.f |= 8, 1 & this.f ||
|
|
4181
|
+
Le.prototype.d = function() {
|
|
4182
|
+
this.f |= 8, 1 & this.f || An(this);
|
|
4183
4183
|
};
|
|
4184
|
-
|
|
4184
|
+
Le.prototype.dispose = function() {
|
|
4185
4185
|
this.d();
|
|
4186
4186
|
};
|
|
4187
4187
|
function at(t, e) {
|
|
4188
|
-
var n = new
|
|
4188
|
+
var n = new Le(t, e);
|
|
4189
4189
|
try {
|
|
4190
4190
|
n.c();
|
|
4191
4191
|
} catch (i) {
|
|
@@ -4194,11 +4194,11 @@ function at(t, e) {
|
|
|
4194
4194
|
var r = n.d.bind(n);
|
|
4195
4195
|
return r[Symbol.dispose] = r, r;
|
|
4196
4196
|
}
|
|
4197
|
-
var
|
|
4197
|
+
var Qi, pt, Ua = typeof window < "u" && !!window.__PREACT_SIGNALS_DEVTOOLS__, Ui = [];
|
|
4198
4198
|
at(function() {
|
|
4199
|
-
|
|
4199
|
+
Qi = this.N;
|
|
4200
4200
|
})();
|
|
4201
|
-
function
|
|
4201
|
+
function Oe(t, e) {
|
|
4202
4202
|
b[t] = e.bind(null, b[t] || function() {
|
|
4203
4203
|
});
|
|
4204
4204
|
}
|
|
@@ -4209,21 +4209,21 @@ function _t(t) {
|
|
|
4209
4209
|
}
|
|
4210
4210
|
pt = t && t.S();
|
|
4211
4211
|
}
|
|
4212
|
-
function
|
|
4213
|
-
var e = this, n = t.data, r =
|
|
4212
|
+
function Fi(t) {
|
|
4213
|
+
var e = this, n = t.data, r = Re(n);
|
|
4214
4214
|
r.value = n;
|
|
4215
4215
|
var i = J(function() {
|
|
4216
4216
|
for (var l = e, a = e.__v; a = a.__; ) if (a.__c) {
|
|
4217
4217
|
a.__c.__$f |= 4;
|
|
4218
4218
|
break;
|
|
4219
4219
|
}
|
|
4220
|
-
var u =
|
|
4220
|
+
var u = cn(function() {
|
|
4221
4221
|
var f = r.value.value;
|
|
4222
4222
|
return f === 0 ? 0 : f === !0 ? "" : f || "";
|
|
4223
|
-
}), d =
|
|
4224
|
-
return !Array.isArray(u.value) && !
|
|
4223
|
+
}), d = cn(function() {
|
|
4224
|
+
return !Array.isArray(u.value) && !Hr(u.value);
|
|
4225
4225
|
}), h = at(function() {
|
|
4226
|
-
if (this.N =
|
|
4226
|
+
if (this.N = Di, d.value) {
|
|
4227
4227
|
var f = u.value;
|
|
4228
4228
|
l.__v && l.__v.__e && l.__v.__e.nodeType === 3 && (l.__v.__e.data = f);
|
|
4229
4229
|
}
|
|
@@ -4234,11 +4234,11 @@ function zi(t) {
|
|
|
4234
4234
|
}, []), o = i[0], s = i[1];
|
|
4235
4235
|
return o.value ? s.peek() : s.value;
|
|
4236
4236
|
}
|
|
4237
|
-
|
|
4238
|
-
Object.defineProperties(M.prototype, { constructor: { configurable: !0, value: void 0 }, type: { configurable: !0, value:
|
|
4237
|
+
Fi.displayName = "ReactiveTextNode";
|
|
4238
|
+
Object.defineProperties(M.prototype, { constructor: { configurable: !0, value: void 0 }, type: { configurable: !0, value: Fi }, props: { configurable: !0, get: function() {
|
|
4239
4239
|
return { data: this };
|
|
4240
4240
|
} }, __b: { configurable: !0, value: 1 } });
|
|
4241
|
-
|
|
4241
|
+
Oe("__b", function(t, e) {
|
|
4242
4242
|
if (typeof e.type == "string") {
|
|
4243
4243
|
var n, r = e.props;
|
|
4244
4244
|
for (var i in r) if (i !== "children") {
|
|
@@ -4248,7 +4248,7 @@ Le("__b", function(t, e) {
|
|
|
4248
4248
|
}
|
|
4249
4249
|
t(e);
|
|
4250
4250
|
});
|
|
4251
|
-
|
|
4251
|
+
Oe("__r", function(t, e) {
|
|
4252
4252
|
if (t(e), e.type !== Q) {
|
|
4253
4253
|
_t();
|
|
4254
4254
|
var n, r = e.__c;
|
|
@@ -4259,14 +4259,14 @@ Le("__r", function(t, e) {
|
|
|
4259
4259
|
}, { name: o }), s.c = i, s;
|
|
4260
4260
|
})(function() {
|
|
4261
4261
|
var i;
|
|
4262
|
-
|
|
4262
|
+
Ua && ((i = n.y) == null || i.call(n)), r.__$f |= 1, r.setState({});
|
|
4263
4263
|
}, typeof e.type == "function" ? e.type.displayName || e.type.name : ""))), _t(n);
|
|
4264
4264
|
}
|
|
4265
4265
|
});
|
|
4266
|
-
|
|
4266
|
+
Oe("__e", function(t, e, n, r) {
|
|
4267
4267
|
_t(), t(e, n, r);
|
|
4268
4268
|
});
|
|
4269
|
-
|
|
4269
|
+
Oe("diffed", function(t, e) {
|
|
4270
4270
|
_t();
|
|
4271
4271
|
var n;
|
|
4272
4272
|
if (typeof e.type == "string" && (n = e.__e)) {
|
|
@@ -4281,23 +4281,23 @@ Le("diffed", function(t, e) {
|
|
|
4281
4281
|
o = {}, n.U = o;
|
|
4282
4282
|
for (var a in r) {
|
|
4283
4283
|
var u = o[a], d = r[a];
|
|
4284
|
-
u === void 0 ? (u =
|
|
4284
|
+
u === void 0 ? (u = Fa(n, a, d, i), o[a] = u) : u.o(d, i);
|
|
4285
4285
|
}
|
|
4286
4286
|
}
|
|
4287
4287
|
}
|
|
4288
4288
|
t(e);
|
|
4289
4289
|
});
|
|
4290
|
-
function
|
|
4291
|
-
var i = e in t && t.ownerSVGElement === void 0, o =
|
|
4290
|
+
function Fa(t, e, n, r) {
|
|
4291
|
+
var i = e in t && t.ownerSVGElement === void 0, o = A(n);
|
|
4292
4292
|
return { o: function(s, l) {
|
|
4293
4293
|
o.value = s, r = l;
|
|
4294
4294
|
}, d: at(function() {
|
|
4295
|
-
this.N =
|
|
4295
|
+
this.N = Di;
|
|
4296
4296
|
var s = o.value.value;
|
|
4297
4297
|
r[e] !== s && (r[e] = s, i ? t[e] = s : s != null && (s !== !1 || e[4] === "-") ? t.setAttribute(e, s) : t.removeAttribute(e));
|
|
4298
4298
|
}) };
|
|
4299
4299
|
}
|
|
4300
|
-
|
|
4300
|
+
Oe("unmount", function(t, e) {
|
|
4301
4301
|
if (typeof e.type == "string") {
|
|
4302
4302
|
var n = e.__e;
|
|
4303
4303
|
if (n) {
|
|
@@ -4319,7 +4319,7 @@ Le("unmount", function(t, e) {
|
|
|
4319
4319
|
}
|
|
4320
4320
|
t(e);
|
|
4321
4321
|
});
|
|
4322
|
-
|
|
4322
|
+
Oe("__h", function(t, e, n, r) {
|
|
4323
4323
|
(r < 3 || r === 9) && (e.__$f |= 2), t(e, n, r);
|
|
4324
4324
|
});
|
|
4325
4325
|
W.prototype.shouldComponentUpdate = function(t, e) {
|
|
@@ -4334,32 +4334,32 @@ W.prototype.shouldComponentUpdate = function(t, e) {
|
|
|
4334
4334
|
for (var l in this.props) if (!(l in t)) return !0;
|
|
4335
4335
|
return !1;
|
|
4336
4336
|
};
|
|
4337
|
-
function
|
|
4337
|
+
function Re(t, e) {
|
|
4338
4338
|
return J(function() {
|
|
4339
|
-
return
|
|
4339
|
+
return A(t, e);
|
|
4340
4340
|
}, []);
|
|
4341
4341
|
}
|
|
4342
|
-
var
|
|
4342
|
+
var Da = function(t) {
|
|
4343
4343
|
queueMicrotask(function() {
|
|
4344
4344
|
queueMicrotask(t);
|
|
4345
4345
|
});
|
|
4346
4346
|
};
|
|
4347
|
-
function
|
|
4348
|
-
|
|
4349
|
-
for (var t; t =
|
|
4347
|
+
function Ba() {
|
|
4348
|
+
Na(function() {
|
|
4349
|
+
for (var t; t = Ui.shift(); ) Qi.call(t);
|
|
4350
4350
|
});
|
|
4351
4351
|
}
|
|
4352
|
-
function
|
|
4353
|
-
|
|
4352
|
+
function Di() {
|
|
4353
|
+
Ui.push(this) === 1 && (b.requestAnimationFrame || Da)(Ba);
|
|
4354
4354
|
}
|
|
4355
|
-
const q =
|
|
4356
|
-
function
|
|
4355
|
+
const q = A(!1), jt = A(void 0), le = A(void 0), un = A([]), hn = A([]), Bi = A(null);
|
|
4356
|
+
function Va(t) {
|
|
4357
4357
|
return t.replace(/\.convex\.site\b/, ".convex.cloud");
|
|
4358
4358
|
}
|
|
4359
|
-
function
|
|
4359
|
+
function Vi(t) {
|
|
4360
4360
|
return t.replace(/\.convex\.cloud\b/, ".convex.site");
|
|
4361
4361
|
}
|
|
4362
|
-
function
|
|
4362
|
+
function Ha(t, e) {
|
|
4363
4363
|
const n = t.title ?? e?.title ?? "Assistant";
|
|
4364
4364
|
return {
|
|
4365
4365
|
title: n,
|
|
@@ -4381,23 +4381,23 @@ function Fa(t, e) {
|
|
|
4381
4381
|
windowHeight: t.windowHeight ?? e?.windowHeight
|
|
4382
4382
|
};
|
|
4383
4383
|
}
|
|
4384
|
-
async function
|
|
4384
|
+
async function Wa(t, e, n, r) {
|
|
4385
4385
|
const i = new URL(`${t}/widget/config`);
|
|
4386
4386
|
i.searchParams.set("orgSlug", e), r && i.searchParams.set("projSlug", r);
|
|
4387
4387
|
const o = await fetch(i.toString(), { signal: n });
|
|
4388
4388
|
return o.ok ? o.json() : null;
|
|
4389
4389
|
}
|
|
4390
|
-
function
|
|
4390
|
+
function Ja(t, e, n) {
|
|
4391
4391
|
const [r, i] = C(null);
|
|
4392
|
-
return
|
|
4392
|
+
return R(() => {
|
|
4393
4393
|
i(null);
|
|
4394
|
-
const o = n ?? "https://festive-mouse-978.eu-west-1.convex.cloud", s = o ?
|
|
4394
|
+
const o = n ?? "https://festive-mouse-978.eu-west-1.convex.cloud", s = o ? Vi(o) : void 0;
|
|
4395
4395
|
if (!s || !t)
|
|
4396
4396
|
return;
|
|
4397
4397
|
const l = new AbortController();
|
|
4398
4398
|
async function a(u) {
|
|
4399
4399
|
try {
|
|
4400
|
-
const d = await
|
|
4400
|
+
const d = await Wa(u, t, l.signal, e);
|
|
4401
4401
|
d && i(d);
|
|
4402
4402
|
} catch (d) {
|
|
4403
4403
|
if (d instanceof Error && d.name === "AbortError")
|
|
@@ -4409,7 +4409,7 @@ function Ua(t, e, n) {
|
|
|
4409
4409
|
};
|
|
4410
4410
|
}, [t, e, n]), r;
|
|
4411
4411
|
}
|
|
4412
|
-
async function
|
|
4412
|
+
async function Hi(t, e, n) {
|
|
4413
4413
|
try {
|
|
4414
4414
|
const r = await fetch(`${e}/widget/bootstrap`, {
|
|
4415
4415
|
method: "POST",
|
|
@@ -4418,39 +4418,99 @@ async function Di(t, e, n) {
|
|
|
4418
4418
|
credentials: "omit"
|
|
4419
4419
|
});
|
|
4420
4420
|
if (r.ok) {
|
|
4421
|
-
const i = await r.json();
|
|
4422
|
-
return { ok: !0, token: i.token, excludePaths: i.excludePaths };
|
|
4421
|
+
const i = await r.json(), o = i.allowedUrls ?? (i.allowedUrl ? [i.allowedUrl] : []);
|
|
4422
|
+
return { ok: !0, token: i.token, excludePaths: i.excludePaths, allowedUrls: o };
|
|
4423
4423
|
}
|
|
4424
4424
|
return r.status === 403 ? { ok: !1, error: "unauthorized" } : r.status === 404 ? { ok: !1, error: "not_found" } : r.status === 429 ? { ok: !1, error: "rate_limited", retryAfterSec: Number(r.headers.get("Retry-After")) || 60 } : { ok: !1, error: "network" };
|
|
4425
4425
|
} catch {
|
|
4426
4426
|
return { ok: !1, error: "network" };
|
|
4427
4427
|
}
|
|
4428
4428
|
}
|
|
4429
|
-
function
|
|
4430
|
-
|
|
4431
|
-
|
|
4432
|
-
|
|
4429
|
+
function Ka(t, e) {
|
|
4430
|
+
return e.some((n) => n === "/" ? t === "/" : t === n || t.startsWith(n + "/"));
|
|
4431
|
+
}
|
|
4432
|
+
function _r(t, e) {
|
|
4433
|
+
try {
|
|
4434
|
+
const n = new URL(t), r = new URL(e);
|
|
4435
|
+
if (n.origin !== r.origin)
|
|
4436
|
+
return !1;
|
|
4437
|
+
const i = r.pathname.replace(/\/$/, "");
|
|
4438
|
+
if (!i)
|
|
4439
|
+
return !0;
|
|
4440
|
+
const o = n.pathname.replace(/\/$/, "");
|
|
4441
|
+
return o === i || o.startsWith(i + "/");
|
|
4442
|
+
} catch {
|
|
4443
|
+
return !1;
|
|
4444
|
+
}
|
|
4445
|
+
}
|
|
4446
|
+
function Za({
|
|
4447
|
+
orgSlug: t,
|
|
4448
|
+
projSlug: e,
|
|
4449
|
+
preToken: n,
|
|
4450
|
+
convexUrl: r,
|
|
4451
|
+
preAllowedUrls: i,
|
|
4452
|
+
preExcludedPaths: o
|
|
4453
|
+
}) {
|
|
4454
|
+
R(() => {
|
|
4455
|
+
const s = r ?? "https://festive-mouse-978.eu-west-1.convex.cloud", l = s ? Vi(s) : void 0;
|
|
4456
|
+
if (!l || !t)
|
|
4457
|
+
return;
|
|
4458
|
+
if (Bi.value = { orgSlug: t, projSlug: e, siteUrl: l }, n) {
|
|
4459
|
+
un.value = i ?? [], hn.value = o ?? [];
|
|
4433
4460
|
return;
|
|
4434
|
-
|
|
4461
|
+
}
|
|
4462
|
+
let a = !1;
|
|
4435
4463
|
return (async () => {
|
|
4436
|
-
const
|
|
4437
|
-
if (!
|
|
4438
|
-
if (
|
|
4439
|
-
le.value =
|
|
4464
|
+
const u = await Hi(t, l, e);
|
|
4465
|
+
if (!a)
|
|
4466
|
+
if (u.ok)
|
|
4467
|
+
le.value = u.token, un.value = u.allowedUrls, hn.value = u.excludePaths;
|
|
4440
4468
|
else {
|
|
4441
|
-
const
|
|
4442
|
-
|
|
4443
|
-
`[JexityChat]
|
|
4444
|
-
) :
|
|
4445
|
-
`[JexityChat] Bootstrap rate-limited for ${
|
|
4446
|
-
) : console.error(`[JexityChat] Bootstrap failed: ${
|
|
4469
|
+
const d = e ? `project '${t}/${e}'` : `org '${t}'`;
|
|
4470
|
+
u.error === "unauthorized" ? console.warn(
|
|
4471
|
+
`[JexityChat] Domain not authorized for ${d}. Check the widget's domain rules.`
|
|
4472
|
+
) : u.error === "not_found" ? console.error(`[JexityChat] No active widget config found for ${d}.`) : u.error === "rate_limited" ? console.error(
|
|
4473
|
+
`[JexityChat] Bootstrap rate-limited for ${d}. Retry after ${u.retryAfterSec ?? 60}s.`
|
|
4474
|
+
) : console.error(`[JexityChat] Bootstrap failed: ${u.error}`);
|
|
4447
4475
|
}
|
|
4448
4476
|
})(), () => {
|
|
4449
|
-
|
|
4477
|
+
a = !0;
|
|
4450
4478
|
};
|
|
4451
4479
|
}, [t, e, n, r]);
|
|
4452
4480
|
}
|
|
4453
|
-
const
|
|
4481
|
+
const St = /* @__PURE__ */ new Set();
|
|
4482
|
+
let jr = !1;
|
|
4483
|
+
function Ga() {
|
|
4484
|
+
if (jr)
|
|
4485
|
+
return;
|
|
4486
|
+
jr = !0;
|
|
4487
|
+
const t = history.pushState.bind(history), e = history.replaceState.bind(history);
|
|
4488
|
+
history.pushState = function(...n) {
|
|
4489
|
+
t(...n), St.forEach((r) => r());
|
|
4490
|
+
}, history.replaceState = function(...n) {
|
|
4491
|
+
e(...n), St.forEach((r) => r());
|
|
4492
|
+
};
|
|
4493
|
+
}
|
|
4494
|
+
function Ya(t) {
|
|
4495
|
+
return St.add(t), window.addEventListener("popstate", t), Ga(), () => {
|
|
4496
|
+
St.delete(t), window.removeEventListener("popstate", t);
|
|
4497
|
+
};
|
|
4498
|
+
}
|
|
4499
|
+
function Xa() {
|
|
4500
|
+
const t = Re(window.location.href);
|
|
4501
|
+
R(() => Ya(() => {
|
|
4502
|
+
t.value = window.location.href;
|
|
4503
|
+
}), []);
|
|
4504
|
+
const e = un.value, n = hn.value, r = new URL(t.value).pathname, i = Ka(r, n);
|
|
4505
|
+
return R(() => {
|
|
4506
|
+
i ? console.warn(
|
|
4507
|
+
`[JexityChat] Widget hidden — current path is in the exclude list: ${r}`
|
|
4508
|
+
) : e.length > 0 && !e.some((o) => _r(t.value, o)) && console.warn(
|
|
4509
|
+
`[JexityChat] Widget hidden — current page does not match path rule. Allowed: ${e.join(", ")}`
|
|
4510
|
+
);
|
|
4511
|
+
}, [t.value, e, n]), i ? !1 : e.length === 0 ? !0 : e.some((o) => _r(t.value, o));
|
|
4512
|
+
}
|
|
4513
|
+
const Wi = {
|
|
4454
4514
|
title: "Assistant",
|
|
4455
4515
|
statusOnline: "Online · Responds in seconds",
|
|
4456
4516
|
inputPlaceholder: "Type a message…",
|
|
@@ -4534,7 +4594,7 @@ Use it to resume this conversation from any device.`,
|
|
|
4534
4594
|
replyTo: "Reply to {name}",
|
|
4535
4595
|
sourcesCountOne: "{count} source",
|
|
4536
4596
|
sourcesCountOther: "{count} sources"
|
|
4537
|
-
},
|
|
4597
|
+
}, el = {
|
|
4538
4598
|
title: "Assistent",
|
|
4539
4599
|
statusOnline: "Online · Antwortet in Sekunden",
|
|
4540
4600
|
inputPlaceholder: "Nachricht eingeben…",
|
|
@@ -4618,134 +4678,134 @@ Verwenden Sie sie, um diese Unterhaltung auf jedem Gerät fortzusetzen.`,
|
|
|
4618
4678
|
replyTo: "Antworten an {name}",
|
|
4619
4679
|
sourcesCountOne: "{count} Quelle",
|
|
4620
4680
|
sourcesCountOther: "{count} Quellen"
|
|
4621
|
-
},
|
|
4681
|
+
}, tl = [
|
|
4622
4682
|
{ value: "de", label: "Deutsch", flag: "🇩🇪" },
|
|
4623
4683
|
{ value: "en", label: "English", flag: "🇬🇧" }
|
|
4624
|
-
],
|
|
4625
|
-
function
|
|
4626
|
-
return
|
|
4684
|
+
], nl = "de", rl = "jex-locale", In = A("de"), il = { en: Wi, de: el };
|
|
4685
|
+
function I() {
|
|
4686
|
+
return il[In.value] ?? Wi;
|
|
4627
4687
|
}
|
|
4628
|
-
function
|
|
4688
|
+
function Jt(t) {
|
|
4629
4689
|
if (!t)
|
|
4630
4690
|
return null;
|
|
4631
4691
|
const e = (t.split("-")[0] ?? "").toLowerCase();
|
|
4632
|
-
return
|
|
4692
|
+
return tl.some((n) => n.value === e) ? e : null;
|
|
4633
4693
|
}
|
|
4634
|
-
function
|
|
4635
|
-
const e =
|
|
4694
|
+
function Ji(t) {
|
|
4695
|
+
const e = Jt(t);
|
|
4636
4696
|
if (e)
|
|
4637
4697
|
return e;
|
|
4638
4698
|
try {
|
|
4639
|
-
const n =
|
|
4699
|
+
const n = Jt(localStorage.getItem(rl));
|
|
4640
4700
|
if (n)
|
|
4641
4701
|
return n;
|
|
4642
4702
|
} catch {
|
|
4643
4703
|
}
|
|
4644
4704
|
if (typeof navigator < "u") {
|
|
4645
|
-
const n =
|
|
4705
|
+
const n = Jt(navigator.language);
|
|
4646
4706
|
if (n)
|
|
4647
4707
|
return n;
|
|
4648
4708
|
}
|
|
4649
|
-
return
|
|
4709
|
+
return nl;
|
|
4650
4710
|
}
|
|
4651
|
-
function
|
|
4652
|
-
|
|
4711
|
+
function ol(t) {
|
|
4712
|
+
R(() => {
|
|
4653
4713
|
function e(n) {
|
|
4654
4714
|
const r = t ?? window.location.origin;
|
|
4655
4715
|
if (n.origin !== r || n.data?.type !== "jexity:config")
|
|
4656
4716
|
return;
|
|
4657
4717
|
const { locale: i } = n.data.payload;
|
|
4658
|
-
i && (
|
|
4718
|
+
i && (In.value = Ji(i));
|
|
4659
4719
|
}
|
|
4660
4720
|
return window.addEventListener("message", e), () => {
|
|
4661
4721
|
window.removeEventListener("message", e);
|
|
4662
4722
|
};
|
|
4663
4723
|
}, [t]);
|
|
4664
4724
|
}
|
|
4665
|
-
const
|
|
4666
|
-
function
|
|
4725
|
+
const Ki = "jex-session-history", Zi = Ki, Gi = 900 * 1e3, z = A([]), xe = A(null), Yi = cn(() => z.value.length > 0), Ze = A(null);
|
|
4726
|
+
function sl() {
|
|
4667
4727
|
return "JEX-" + Math.random().toString(36).slice(2, 8).toUpperCase();
|
|
4668
4728
|
}
|
|
4669
|
-
function
|
|
4729
|
+
function al(t) {
|
|
4670
4730
|
try {
|
|
4671
|
-
const e = sessionStorage.getItem(
|
|
4731
|
+
const e = sessionStorage.getItem(Zi);
|
|
4672
4732
|
if (!e)
|
|
4673
4733
|
return [];
|
|
4674
4734
|
const n = JSON.parse(e);
|
|
4675
|
-
return n.v !== 1 || !Array.isArray(n.entries) ? [] : n.entries.filter((r) => t - r.lastActivityAt <=
|
|
4735
|
+
return n.v !== 1 || !Array.isArray(n.entries) ? [] : n.entries.filter((r) => t - r.lastActivityAt <= Gi);
|
|
4676
4736
|
} catch {
|
|
4677
4737
|
return [];
|
|
4678
4738
|
}
|
|
4679
4739
|
}
|
|
4680
|
-
function
|
|
4740
|
+
function Mt(t) {
|
|
4681
4741
|
try {
|
|
4682
4742
|
const e = { v: 1, entries: t };
|
|
4683
|
-
sessionStorage.setItem(
|
|
4743
|
+
sessionStorage.setItem(Zi, JSON.stringify(e));
|
|
4684
4744
|
} catch {
|
|
4685
4745
|
}
|
|
4686
4746
|
}
|
|
4687
|
-
function
|
|
4688
|
-
const t = Date.now(), e =
|
|
4689
|
-
z.value = e,
|
|
4747
|
+
function ll() {
|
|
4748
|
+
const t = Date.now(), e = al(t);
|
|
4749
|
+
z.value = e, Mt(e), xe.value = e.length > 0 ? e[e.length - 1].ref : null;
|
|
4690
4750
|
}
|
|
4691
|
-
function
|
|
4692
|
-
const t =
|
|
4693
|
-
return z.value = n, xe.value = t,
|
|
4751
|
+
function Sr() {
|
|
4752
|
+
const t = sl(), e = Date.now(), n = [...z.value, { ref: t, startedAt: e, lastActivityAt: e }];
|
|
4753
|
+
return z.value = n, xe.value = t, Mt(n), t;
|
|
4694
4754
|
}
|
|
4695
|
-
function
|
|
4755
|
+
function Cr(t) {
|
|
4696
4756
|
const e = Date.now(), n = z.value.map(
|
|
4697
4757
|
(r) => r.ref === t ? { ...r, lastActivityAt: e } : r
|
|
4698
4758
|
);
|
|
4699
|
-
z.value = n, xe.value = t,
|
|
4759
|
+
z.value = n, xe.value = t, Mt(n);
|
|
4700
4760
|
}
|
|
4701
|
-
function
|
|
4761
|
+
function $n(t) {
|
|
4702
4762
|
if (!t)
|
|
4703
4763
|
return;
|
|
4704
4764
|
const e = Date.now(), n = z.value.map(
|
|
4705
4765
|
(r) => r.ref === t ? { ...r, lastActivityAt: e } : r
|
|
4706
4766
|
);
|
|
4707
|
-
z.value = n,
|
|
4767
|
+
z.value = n, Mt(n);
|
|
4708
4768
|
}
|
|
4709
|
-
const N =
|
|
4710
|
-
function
|
|
4711
|
-
return
|
|
4769
|
+
const N = A(Xi());
|
|
4770
|
+
function Xi() {
|
|
4771
|
+
return Yi.value ? [{ id: "home" }] : [{ id: "chat" }];
|
|
4712
4772
|
}
|
|
4713
|
-
function
|
|
4714
|
-
N.value =
|
|
4773
|
+
function cl() {
|
|
4774
|
+
N.value = Xi();
|
|
4715
4775
|
}
|
|
4716
|
-
const
|
|
4776
|
+
const ul = A("screen");
|
|
4717
4777
|
function fe(t) {
|
|
4718
4778
|
N.value = [...N.value, t];
|
|
4719
4779
|
}
|
|
4720
|
-
function
|
|
4780
|
+
function Ct() {
|
|
4721
4781
|
N.value.length > 1 && (N.value = N.value.slice(0, -1));
|
|
4722
4782
|
}
|
|
4723
|
-
function
|
|
4783
|
+
function dn(t) {
|
|
4724
4784
|
N.value = [...N.value.slice(0, -1), t];
|
|
4725
4785
|
}
|
|
4726
|
-
const
|
|
4727
|
-
function
|
|
4728
|
-
return
|
|
4729
|
-
|
|
4786
|
+
const hl = 6e4, nt = A(!1), pn = A(!1), fn = /* @__PURE__ */ new Set();
|
|
4787
|
+
function dl(t) {
|
|
4788
|
+
return fn.add(t), () => {
|
|
4789
|
+
fn.delete(t);
|
|
4730
4790
|
};
|
|
4731
4791
|
}
|
|
4732
|
-
function
|
|
4792
|
+
function pl() {
|
|
4733
4793
|
const t = xe.value;
|
|
4734
4794
|
return t ? z.value.find((e) => e.ref === t)?.lastActivityAt ?? null : null;
|
|
4735
4795
|
}
|
|
4736
|
-
function
|
|
4737
|
-
const e =
|
|
4796
|
+
function fl(t) {
|
|
4797
|
+
const e = pl();
|
|
4738
4798
|
return e === null ? !1 : Date.now() - e > t;
|
|
4739
4799
|
}
|
|
4740
|
-
function
|
|
4800
|
+
function Rr() {
|
|
4741
4801
|
if (!(nt.value && z.value.length === 0)) {
|
|
4742
4802
|
z.value = [], xe.value = null;
|
|
4743
4803
|
try {
|
|
4744
|
-
sessionStorage.removeItem(
|
|
4804
|
+
sessionStorage.removeItem(Ki);
|
|
4745
4805
|
} catch (t) {
|
|
4746
4806
|
console.warn("[JexityChat] Idle-lock storage clear failed:", t);
|
|
4747
4807
|
}
|
|
4748
|
-
for (const t of
|
|
4808
|
+
for (const t of fn)
|
|
4749
4809
|
try {
|
|
4750
4810
|
t();
|
|
4751
4811
|
} catch (e) {
|
|
@@ -4754,27 +4814,27 @@ function wr() {
|
|
|
4754
4814
|
N.value = [{ id: "home" }], nt.value = !0;
|
|
4755
4815
|
}
|
|
4756
4816
|
}
|
|
4757
|
-
function
|
|
4817
|
+
function Kt() {
|
|
4758
4818
|
nt.value && (nt.value = !1);
|
|
4759
4819
|
}
|
|
4760
|
-
function
|
|
4820
|
+
function gl(t = Gi) {
|
|
4761
4821
|
let e = null;
|
|
4762
4822
|
const n = () => {
|
|
4763
4823
|
if (document.visibilityState === "hidden") {
|
|
4764
4824
|
e = Date.now();
|
|
4765
4825
|
return;
|
|
4766
4826
|
}
|
|
4767
|
-
e !== null && Date.now() - e > t &&
|
|
4827
|
+
e !== null && Date.now() - e > t && Rr(), e = null;
|
|
4768
4828
|
};
|
|
4769
4829
|
document.addEventListener("visibilitychange", n);
|
|
4770
4830
|
const r = setInterval(() => {
|
|
4771
|
-
|
|
4772
|
-
},
|
|
4831
|
+
pn.value || fl(t) && Rr();
|
|
4832
|
+
}, hl);
|
|
4773
4833
|
return () => {
|
|
4774
4834
|
document.removeEventListener("visibilitychange", n), clearInterval(r), e = null;
|
|
4775
4835
|
};
|
|
4776
4836
|
}
|
|
4777
|
-
function
|
|
4837
|
+
function ml(t) {
|
|
4778
4838
|
const e = {}, { primaryColor: n, theme: r } = t;
|
|
4779
4839
|
if (n && (e["--jex-primary"] = n, e["--jex-bg-trigger"] = n, e["--jex-bg-header"] = n, e["--jex-bg-msg-user"] = n, e["--jex-bg-send-btn"] = n), t.accentColor && (e["--jex-accent"] = t.accentColor), r?.bg) {
|
|
4780
4840
|
const i = r.bg;
|
|
@@ -4790,7 +4850,7 @@ function al(t) {
|
|
|
4790
4850
|
}
|
|
4791
4851
|
return t.fontFamily && (e["--jex-font-family"] = t.fontFamily), t.fontSize && (e["--jex-font-size"] = `${t.fontSize}px`), t.borderRadius && (e["--jex-radius"] = t.borderRadius), t.windowWidth && (e["--jex-window-width"] = `${t.windowWidth}px`), t.windowHeight && (e["--jex-window-height"] = `${t.windowHeight}px`), Object.keys(e).length > 0 ? e : void 0;
|
|
4792
4852
|
}
|
|
4793
|
-
function
|
|
4853
|
+
function En({ size: t = 24 }) {
|
|
4794
4854
|
return /* @__PURE__ */ c("svg", { width: t, height: t, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", "aria-hidden": "true", children: [
|
|
4795
4855
|
/* @__PURE__ */ c("path", { d: "M12 8V4H8" }),
|
|
4796
4856
|
/* @__PURE__ */ c("rect", { width: "16", height: "12", x: "4", y: "8", rx: "2" }),
|
|
@@ -4800,33 +4860,33 @@ function An({ size: t = 24 }) {
|
|
|
4800
4860
|
/* @__PURE__ */ c("path", { d: "M9 13v2" })
|
|
4801
4861
|
] });
|
|
4802
4862
|
}
|
|
4803
|
-
function
|
|
4804
|
-
const t =
|
|
4863
|
+
function xl() {
|
|
4864
|
+
const t = I();
|
|
4805
4865
|
return N.value.length > 1 ? /* @__PURE__ */ c(
|
|
4806
4866
|
"button",
|
|
4807
4867
|
{
|
|
4808
4868
|
class: "jex-header-back",
|
|
4809
|
-
onClick:
|
|
4869
|
+
onClick: Ct,
|
|
4810
4870
|
"aria-label": t.back || "Go back",
|
|
4811
4871
|
children: /* @__PURE__ */ c("svg", { width: 20, height: 20, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", "aria-hidden": "true", children: /* @__PURE__ */ c("path", { d: "m15 18-6-6 6-6" }) })
|
|
4812
4872
|
}
|
|
4813
|
-
) : /* @__PURE__ */ c(
|
|
4873
|
+
) : /* @__PURE__ */ c(En, { size: 24 });
|
|
4814
4874
|
}
|
|
4815
|
-
function
|
|
4816
|
-
const e =
|
|
4875
|
+
function bl({ title: t }) {
|
|
4876
|
+
const e = I();
|
|
4817
4877
|
return /* @__PURE__ */ c("div", { class: "jex-header-info", children: [
|
|
4818
4878
|
/* @__PURE__ */ c("h3", { children: t }),
|
|
4819
4879
|
/* @__PURE__ */ c("p", { children: e.statusOnline })
|
|
4820
4880
|
] });
|
|
4821
4881
|
}
|
|
4822
|
-
function
|
|
4882
|
+
function eo({ size: t = 28 }) {
|
|
4823
4883
|
return /* @__PURE__ */ c("svg", { width: t, height: t, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", "aria-hidden": "true", children: [
|
|
4824
4884
|
/* @__PURE__ */ c("path", { d: "M18 6 6 18" }),
|
|
4825
4885
|
/* @__PURE__ */ c("path", { d: "m6 6 12 12" })
|
|
4826
4886
|
] });
|
|
4827
4887
|
}
|
|
4828
|
-
function
|
|
4829
|
-
const t =
|
|
4888
|
+
function vl() {
|
|
4889
|
+
const t = I();
|
|
4830
4890
|
return /* @__PURE__ */ c(
|
|
4831
4891
|
"button",
|
|
4832
4892
|
{
|
|
@@ -4837,27 +4897,27 @@ function ul() {
|
|
|
4837
4897
|
},
|
|
4838
4898
|
"aria-label": t.closeChatAriaLabel,
|
|
4839
4899
|
title: t.closeChatAriaLabel,
|
|
4840
|
-
children: /* @__PURE__ */ c(
|
|
4900
|
+
children: /* @__PURE__ */ c(eo, { size: 18 })
|
|
4841
4901
|
}
|
|
4842
4902
|
);
|
|
4843
4903
|
}
|
|
4844
|
-
function
|
|
4904
|
+
function yl({ action: t, showClose: e = !0 }) {
|
|
4845
4905
|
return !t && !e ? null : /* @__PURE__ */ c("div", { class: "jex-header-right", children: [
|
|
4846
4906
|
t,
|
|
4847
|
-
e && /* @__PURE__ */ c(
|
|
4907
|
+
e && /* @__PURE__ */ c(vl, {})
|
|
4848
4908
|
] });
|
|
4849
4909
|
}
|
|
4850
|
-
function
|
|
4910
|
+
function Tr({ title: t, rightAction: e, showClose: n = !0 }) {
|
|
4851
4911
|
return /* @__PURE__ */ c("header", { class: "jex-chat-header", children: [
|
|
4852
|
-
/* @__PURE__ */ c(
|
|
4853
|
-
/* @__PURE__ */ c(
|
|
4854
|
-
/* @__PURE__ */ c(
|
|
4912
|
+
/* @__PURE__ */ c(xl, {}),
|
|
4913
|
+
/* @__PURE__ */ c(bl, { title: t }),
|
|
4914
|
+
/* @__PURE__ */ c(yl, { action: e, showClose: n })
|
|
4855
4915
|
] });
|
|
4856
4916
|
}
|
|
4857
|
-
function
|
|
4917
|
+
function kl({ size: t = 14 }) {
|
|
4858
4918
|
return /* @__PURE__ */ c("svg", { width: t, height: t, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", "aria-hidden": "true", children: /* @__PURE__ */ c("path", { d: "M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z" }) });
|
|
4859
4919
|
}
|
|
4860
|
-
function
|
|
4920
|
+
function Ar() {
|
|
4861
4921
|
return /* @__PURE__ */ c("div", { class: "jex-widget-footer", children: /* @__PURE__ */ c(
|
|
4862
4922
|
"a",
|
|
4863
4923
|
{
|
|
@@ -4866,7 +4926,7 @@ function jr() {
|
|
|
4866
4926
|
rel: "noopener noreferrer",
|
|
4867
4927
|
class: "jex-branding",
|
|
4868
4928
|
children: [
|
|
4869
|
-
/* @__PURE__ */ c(
|
|
4929
|
+
/* @__PURE__ */ c(kl, { size: 14 }),
|
|
4870
4930
|
/* @__PURE__ */ c("span", { children: [
|
|
4871
4931
|
"Powered by ",
|
|
4872
4932
|
/* @__PURE__ */ c("strong", { children: "Jexity" })
|
|
@@ -4875,10 +4935,10 @@ function jr() {
|
|
|
4875
4935
|
}
|
|
4876
4936
|
) });
|
|
4877
4937
|
}
|
|
4878
|
-
function
|
|
4938
|
+
function to({ size: t = 28 }) {
|
|
4879
4939
|
return /* @__PURE__ */ c("svg", { width: t, height: t, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", "aria-hidden": "true", children: /* @__PURE__ */ c("path", { d: "M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z" }) });
|
|
4880
4940
|
}
|
|
4881
|
-
function
|
|
4941
|
+
function wl({ size: t = 24, ...e }) {
|
|
4882
4942
|
return /* @__PURE__ */ c(
|
|
4883
4943
|
"svg",
|
|
4884
4944
|
{
|
|
@@ -4895,53 +4955,53 @@ function pl({ size: t = 24, ...e }) {
|
|
|
4895
4955
|
}
|
|
4896
4956
|
);
|
|
4897
4957
|
}
|
|
4898
|
-
const
|
|
4899
|
-
chat: /* @__PURE__ */ c(
|
|
4900
|
-
bot: /* @__PURE__ */ c(
|
|
4901
|
-
sparkles: /* @__PURE__ */ c(
|
|
4902
|
-
},
|
|
4958
|
+
const _l = {
|
|
4959
|
+
chat: /* @__PURE__ */ c(to, { size: 28 }),
|
|
4960
|
+
bot: /* @__PURE__ */ c(En, { size: 28 }),
|
|
4961
|
+
sparkles: /* @__PURE__ */ c(wl, { size: 28 })
|
|
4962
|
+
}, jl = {
|
|
4903
4963
|
none: "0px",
|
|
4904
4964
|
sm: "0.5rem",
|
|
4905
4965
|
md: "0.75rem",
|
|
4906
4966
|
lg: "1.25rem",
|
|
4907
4967
|
full: "9999px"
|
|
4908
4968
|
};
|
|
4909
|
-
function
|
|
4910
|
-
const r =
|
|
4969
|
+
function Sl({ radius: t = "full", iconOption: e = "chat", label: n }) {
|
|
4970
|
+
const r = I(), i = n ?? r.fabLabel, o = i !== "";
|
|
4911
4971
|
return /* @__PURE__ */ c(
|
|
4912
4972
|
"button",
|
|
4913
4973
|
{
|
|
4914
4974
|
class: `jex-floating-button ${!q.value && o ? "jex-has-label" : ""}`,
|
|
4915
|
-
style: { borderRadius:
|
|
4975
|
+
style: { borderRadius: jl[t] ?? "9999px" },
|
|
4916
4976
|
onClick: () => {
|
|
4917
4977
|
q.value = !q.value;
|
|
4918
4978
|
},
|
|
4919
4979
|
"aria-label": q.value ? r.closeChatAriaLabel : r.openChatAriaLabel,
|
|
4920
|
-
children: q.value ? /* @__PURE__ */ c(
|
|
4921
|
-
|
|
4980
|
+
children: q.value ? /* @__PURE__ */ c(eo, { size: 28 }) : /* @__PURE__ */ c("div", { class: "jex-fab-inner", children: [
|
|
4981
|
+
_l[e],
|
|
4922
4982
|
o && /* @__PURE__ */ c("span", { class: "jex-fab-label", children: i })
|
|
4923
4983
|
] })
|
|
4924
4984
|
}
|
|
4925
4985
|
);
|
|
4926
4986
|
}
|
|
4927
|
-
function
|
|
4928
|
-
const r =
|
|
4987
|
+
function Cl({ title: t, onStartFresh: e, onResetSession: n }) {
|
|
4988
|
+
const r = I(), [i, o] = C("");
|
|
4929
4989
|
function s() {
|
|
4930
|
-
|
|
4990
|
+
Kt(), Ze.value = "fresh", n(), e(), fe({ id: "chat" });
|
|
4931
4991
|
}
|
|
4932
4992
|
function l(u) {
|
|
4933
|
-
|
|
4993
|
+
Kt(), Ze.value = "resume", n(), Cr(u), fe({ id: "chat" });
|
|
4934
4994
|
}
|
|
4935
4995
|
function a(u) {
|
|
4936
4996
|
u.preventDefault();
|
|
4937
4997
|
const d = i.trim().toUpperCase();
|
|
4938
|
-
d && (
|
|
4998
|
+
d && (Kt(), Ze.value = "resume", n(), Cr(d), fe({ id: "chat" }));
|
|
4939
4999
|
}
|
|
4940
5000
|
return /* @__PURE__ */ c("div", { class: "jex-home", children: [
|
|
4941
5001
|
nt.value && /* @__PURE__ */ c("div", { class: "jex-session-prompt", role: "status", children: /* @__PURE__ */ c("div", { class: "jex-session-prompt-text", children: r.sessionLocked }) }),
|
|
4942
5002
|
/* @__PURE__ */ c("div", { class: "jex-home-hero", children: [
|
|
4943
5003
|
/* @__PURE__ */ c("div", { class: "jex-home-avatar", children: [
|
|
4944
|
-
/* @__PURE__ */ c(
|
|
5004
|
+
/* @__PURE__ */ c(to, { size: 24 }),
|
|
4945
5005
|
/* @__PURE__ */ c("span", { class: "jex-home-status-dot" })
|
|
4946
5006
|
] }),
|
|
4947
5007
|
/* @__PURE__ */ c("div", { class: "jex-home-hero-text", children: [
|
|
@@ -4995,8 +5055,8 @@ function xl({ title: t, onStartFresh: e, onResetSession: n }) {
|
|
|
4995
5055
|
] })
|
|
4996
5056
|
] });
|
|
4997
5057
|
}
|
|
4998
|
-
function
|
|
4999
|
-
const e =
|
|
5058
|
+
function Rl({ title: t }) {
|
|
5059
|
+
const e = I();
|
|
5000
5060
|
return /* @__PURE__ */ c("div", { class: "jex-selection", children: [
|
|
5001
5061
|
/* @__PURE__ */ c("h2", { class: "jex-selection-title", children: e.howCanWeHelp }),
|
|
5002
5062
|
/* @__PURE__ */ c("div", { class: "jex-selection-options", children: [
|
|
@@ -5027,14 +5087,14 @@ function bl({ title: t }) {
|
|
|
5027
5087
|
] })
|
|
5028
5088
|
] });
|
|
5029
5089
|
}
|
|
5030
|
-
const
|
|
5090
|
+
const Tl = (...t) => t.filter((e, n, r) => !!e && e.trim() !== "" && r.indexOf(e) === n).join(" ").trim(), Ir = (t) => t.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), Al = (t) => t.replace(
|
|
5031
5091
|
/^([A-Z])|[\s-_]+(\w)/g,
|
|
5032
5092
|
(e, n, r) => r ? r.toUpperCase() : n.toLowerCase()
|
|
5033
|
-
),
|
|
5034
|
-
const e =
|
|
5093
|
+
), $r = (t) => {
|
|
5094
|
+
const e = Al(t);
|
|
5035
5095
|
return e.charAt(0).toUpperCase() + e.slice(1);
|
|
5036
5096
|
};
|
|
5037
|
-
var
|
|
5097
|
+
var Il = {
|
|
5038
5098
|
xmlns: "http://www.w3.org/2000/svg",
|
|
5039
5099
|
width: 24,
|
|
5040
5100
|
height: 24,
|
|
@@ -5045,12 +5105,12 @@ var kl = {
|
|
|
5045
5105
|
"stroke-linecap": "round",
|
|
5046
5106
|
"stroke-linejoin": "round"
|
|
5047
5107
|
};
|
|
5048
|
-
const
|
|
5108
|
+
const $l = (t) => {
|
|
5049
5109
|
for (const e in t)
|
|
5050
5110
|
if (e.startsWith("aria-") || e === "role" || e === "title")
|
|
5051
5111
|
return !0;
|
|
5052
5112
|
return !1;
|
|
5053
|
-
},
|
|
5113
|
+
}, El = ({
|
|
5054
5114
|
color: t = "currentColor",
|
|
5055
5115
|
size: e = 24,
|
|
5056
5116
|
strokeWidth: n = 2,
|
|
@@ -5059,44 +5119,44 @@ const wl = (t) => {
|
|
|
5059
5119
|
iconNode: o,
|
|
5060
5120
|
class: s = "",
|
|
5061
5121
|
...l
|
|
5062
|
-
}) =>
|
|
5122
|
+
}) => D(
|
|
5063
5123
|
"svg",
|
|
5064
5124
|
{
|
|
5065
|
-
...
|
|
5125
|
+
...Il,
|
|
5066
5126
|
width: String(e),
|
|
5067
5127
|
height: e,
|
|
5068
5128
|
stroke: t,
|
|
5069
5129
|
"stroke-width": r ? Number(n) * 24 / Number(e) : n,
|
|
5070
5130
|
class: ["lucide", s].join(" "),
|
|
5071
|
-
...!i &&
|
|
5131
|
+
...!i && !$l(l) && { "aria-hidden": "true" },
|
|
5072
5132
|
...l
|
|
5073
5133
|
},
|
|
5074
|
-
[...o.map(([a, u]) =>
|
|
5075
|
-
),
|
|
5076
|
-
const n = ({ class: r = "", className: i = "", children: o, ...s }) =>
|
|
5077
|
-
|
|
5134
|
+
[...o.map(([a, u]) => D(a, u)), ...te(i)]
|
|
5135
|
+
), ql = (t, e) => {
|
|
5136
|
+
const n = ({ class: r = "", className: i = "", children: o, ...s }) => D(
|
|
5137
|
+
El,
|
|
5078
5138
|
{
|
|
5079
5139
|
...s,
|
|
5080
5140
|
iconNode: e,
|
|
5081
|
-
class:
|
|
5082
|
-
`lucide-${
|
|
5083
|
-
`lucide-${
|
|
5141
|
+
class: Tl(
|
|
5142
|
+
`lucide-${Ir($r(t))}`,
|
|
5143
|
+
`lucide-${Ir(t)}`,
|
|
5084
5144
|
r,
|
|
5085
5145
|
i
|
|
5086
5146
|
)
|
|
5087
5147
|
},
|
|
5088
5148
|
o
|
|
5089
5149
|
);
|
|
5090
|
-
return n.displayName =
|
|
5091
|
-
},
|
|
5150
|
+
return n.displayName = $r(t), n;
|
|
5151
|
+
}, Ml = ql("corner-up-left", [
|
|
5092
5152
|
["path", { d: "M20 20v-7a4 4 0 0 0-4-4H4", key: "1nkjon" }],
|
|
5093
5153
|
["path", { d: "M9 14 4 9l5-5", key: "102s5s" }]
|
|
5094
5154
|
]);
|
|
5095
|
-
function
|
|
5155
|
+
function qn() {
|
|
5096
5156
|
return { async: !1, breaks: !1, extensions: null, gfm: !0, hooks: null, pedantic: !1, renderer: null, silent: !1, tokenizer: null, walkTokens: null };
|
|
5097
5157
|
}
|
|
5098
|
-
var ye =
|
|
5099
|
-
function
|
|
5158
|
+
var ye = qn();
|
|
5159
|
+
function no(t) {
|
|
5100
5160
|
ye = t;
|
|
5101
5161
|
}
|
|
5102
5162
|
var de = { exec: () => null };
|
|
@@ -5107,21 +5167,21 @@ function k(t, e = "") {
|
|
|
5107
5167
|
}, getRegex: () => new RegExp(n, e) };
|
|
5108
5168
|
return r;
|
|
5109
5169
|
}
|
|
5110
|
-
var
|
|
5170
|
+
var Pl = (() => {
|
|
5111
5171
|
try {
|
|
5112
5172
|
return !!new RegExp("(?<=1)(?<!1)");
|
|
5113
5173
|
} catch {
|
|
5114
5174
|
return !1;
|
|
5115
5175
|
}
|
|
5116
|
-
})(), P = { codeRemoveIndent: /^(?: {1,4}| {0,3}\t)/gm, outputLinkReplace: /\\([\[\]])/g, indentCodeCompensation: /^(\s+)(?:```)/, beginningSpace: /^\s+/, endingHash: /#$/, startingSpaceChar: /^ /, endingSpaceChar: / $/, nonSpaceChar: /[^ ]/, newLineCharGlobal: /\n/g, tabCharGlobal: /\t/g, multipleSpaceGlobal: /\s+/g, blankLine: /^[ \t]*$/, doubleBlankLine: /\n[ \t]*\n[ \t]*$/, blockquoteStart: /^ {0,3}>/, blockquoteSetextReplace: /\n {0,3}((?:=+|-+) *)(?=\n|$)/g, blockquoteSetextReplace2: /^ {0,3}>[ \t]?/gm, listReplaceNesting: /^ {1,4}(?=( {4})*[^ ])/g, listIsTask: /^\[[ xX]\] +\S/, listReplaceTask: /^\[[ xX]\] +/, listTaskCheckbox: /\[[ xX]\]/, anyLine: /\n.*\n/, hrefBrackets: /^<(.*)>$/, tableDelimiter: /[:|]/, tableAlignChars: /^\||\| *$/g, tableRowBlankLine: /\n[ \t]*$/, tableAlignRight: /^ *-+: *$/, tableAlignCenter: /^ *:-+: *$/, tableAlignLeft: /^ *:-+ *$/, startATag: /^<a /i, endATag: /^<\/a>/i, startPreScriptTag: /^<(pre|code|kbd|script)(\s|>)/i, endPreScriptTag: /^<\/(pre|code|kbd|script)(\s|>)/i, startAngleBracket: /^</, endAngleBracket: />$/, pedanticHrefTitle: /^([^'"]*[^\s])\s+(['"])(.*)\2/, unicodeAlphaNumeric: /[\p{L}\p{N}]/u, escapeTest: /[&<>"']/, escapeReplace: /[&<>"']/g, escapeTestNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/, escapeReplaceNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g, caret: /(^|[^\[])\^/g, percentDecode: /%25/g, findPipe: /\|/g, splitPipe: / \|/, slashPipe: /\\\|/g, carriageReturn: /\r\n|\r/g, spaceLine: /^ +$/gm, notSpaceStart: /^\S*/, endingNewline: /\n$/, listItemRegex: (t) => new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`), nextBulletRegex: (t) => new RegExp(`^ {0,${Math.min(3, t - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`), hrRegex: (t) => new RegExp(`^ {0,${Math.min(3, t - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`), fencesBeginRegex: (t) => new RegExp(`^ {0,${Math.min(3, t - 1)}}(?:\`\`\`|~~~)`), headingBeginRegex: (t) => new RegExp(`^ {0,${Math.min(3, t - 1)}}#`), htmlBeginRegex: (t) => new RegExp(`^ {0,${Math.min(3, t - 1)}}<(?:[a-z].*>|!--)`, "i"), blockquoteBeginRegex: (t) => new RegExp(`^ {0,${Math.min(3, t - 1)}}>`) },
|
|
5117
|
-
]`).replace("lheading",
|
|
5176
|
+
})(), P = { codeRemoveIndent: /^(?: {1,4}| {0,3}\t)/gm, outputLinkReplace: /\\([\[\]])/g, indentCodeCompensation: /^(\s+)(?:```)/, beginningSpace: /^\s+/, endingHash: /#$/, startingSpaceChar: /^ /, endingSpaceChar: / $/, nonSpaceChar: /[^ ]/, newLineCharGlobal: /\n/g, tabCharGlobal: /\t/g, multipleSpaceGlobal: /\s+/g, blankLine: /^[ \t]*$/, doubleBlankLine: /\n[ \t]*\n[ \t]*$/, blockquoteStart: /^ {0,3}>/, blockquoteSetextReplace: /\n {0,3}((?:=+|-+) *)(?=\n|$)/g, blockquoteSetextReplace2: /^ {0,3}>[ \t]?/gm, listReplaceNesting: /^ {1,4}(?=( {4})*[^ ])/g, listIsTask: /^\[[ xX]\] +\S/, listReplaceTask: /^\[[ xX]\] +/, listTaskCheckbox: /\[[ xX]\]/, anyLine: /\n.*\n/, hrefBrackets: /^<(.*)>$/, tableDelimiter: /[:|]/, tableAlignChars: /^\||\| *$/g, tableRowBlankLine: /\n[ \t]*$/, tableAlignRight: /^ *-+: *$/, tableAlignCenter: /^ *:-+: *$/, tableAlignLeft: /^ *:-+ *$/, startATag: /^<a /i, endATag: /^<\/a>/i, startPreScriptTag: /^<(pre|code|kbd|script)(\s|>)/i, endPreScriptTag: /^<\/(pre|code|kbd|script)(\s|>)/i, startAngleBracket: /^</, endAngleBracket: />$/, pedanticHrefTitle: /^([^'"]*[^\s])\s+(['"])(.*)\2/, unicodeAlphaNumeric: /[\p{L}\p{N}]/u, escapeTest: /[&<>"']/, escapeReplace: /[&<>"']/g, escapeTestNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/, escapeReplaceNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g, caret: /(^|[^\[])\^/g, percentDecode: /%25/g, findPipe: /\|/g, splitPipe: / \|/, slashPipe: /\\\|/g, carriageReturn: /\r\n|\r/g, spaceLine: /^ +$/gm, notSpaceStart: /^\S*/, endingNewline: /\n$/, listItemRegex: (t) => new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`), nextBulletRegex: (t) => new RegExp(`^ {0,${Math.min(3, t - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`), hrRegex: (t) => new RegExp(`^ {0,${Math.min(3, t - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`), fencesBeginRegex: (t) => new RegExp(`^ {0,${Math.min(3, t - 1)}}(?:\`\`\`|~~~)`), headingBeginRegex: (t) => new RegExp(`^ {0,${Math.min(3, t - 1)}}#`), htmlBeginRegex: (t) => new RegExp(`^ {0,${Math.min(3, t - 1)}}<(?:[a-z].*>|!--)`, "i"), blockquoteBeginRegex: (t) => new RegExp(`^ {0,${Math.min(3, t - 1)}}>`) }, Ll = /^(?:[ \t]*(?:\n|$))+/, Ol = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, zl = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, lt = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, Nl = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, Mn = / {0,3}(?:[*+-]|\d{1,9}[.)])/, ro = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, io = k(ro).replace(/bull/g, Mn).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/\|table/g, "").getRegex(), Ql = k(ro).replace(/bull/g, Mn).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/table/g, / {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(), Pn = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, Ul = /^[^\n]+/, Ln = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/, Fl = k(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", Ln).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), Dl = k(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, Mn).getRegex(), Pt = "address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul", On = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, Bl = k("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))", "i").replace("comment", On).replace("tag", Pt).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), oo = k(Pn).replace("hr", lt).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", Pt).getRegex(), Vl = k(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", oo).getRegex(), zn = { blockquote: Vl, code: Ol, def: Fl, fences: zl, heading: Nl, hr: lt, html: Bl, lheading: io, list: Dl, newline: Ll, paragraph: oo, table: de, text: Ul }, Er = k("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", lt).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3} )[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", Pt).getRegex(), Hl = { ...zn, lheading: Ql, table: Er, paragraph: k(Pn).replace("hr", lt).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", Er).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", Pt).getRegex() }, Wl = { ...zn, html: k(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment", On).replace(/tag/g, "(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(), def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/, heading: /^(#{1,6})(.*)(?:\n+|$)/, fences: de, lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/, paragraph: k(Pn).replace("hr", lt).replace("heading", ` *#{1,6} *[^
|
|
5177
|
+
]`).replace("lheading", io).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex() }, Jl = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, Kl = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, so = /^( {2,}|\\)\n(?!\s*$)/, Zl = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, ze = /[\p{P}\p{S}]/u, Lt = /[\s\p{P}\p{S}]/u, Nn = /[^\s\p{P}\p{S}]/u, Gl = k(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, Lt).getRegex(), ao = /(?!~)[\p{P}\p{S}]/u, Yl = /(?!~)[\s\p{P}\p{S}]/u, Xl = /(?:[^\s\p{P}\p{S}]|~)/u, ec = k(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", Pl ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex(), lo = /^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/, tc = k(lo, "u").replace(/punct/g, ze).getRegex(), nc = k(lo, "u").replace(/punct/g, ao).getRegex(), co = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", rc = k(co, "gu").replace(/notPunctSpace/g, Nn).replace(/punctSpace/g, Lt).replace(/punct/g, ze).getRegex(), ic = k(co, "gu").replace(/notPunctSpace/g, Xl).replace(/punctSpace/g, Yl).replace(/punct/g, ao).getRegex(), oc = k("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, Nn).replace(/punctSpace/g, Lt).replace(/punct/g, ze).getRegex(), sc = k(/^~~?(?:((?!~)punct)|[^\s~])/, "u").replace(/punct/g, ze).getRegex(), ac = "^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)", lc = k(ac, "gu").replace(/notPunctSpace/g, Nn).replace(/punctSpace/g, Lt).replace(/punct/g, ze).getRegex(), cc = k(/\\(punct)/, "gu").replace(/punct/g, ze).getRegex(), uc = k(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme", /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email", /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(), hc = k(On).replace("(?:-->|$)", "-->").getRegex(), dc = k("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment", hc).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), Rt = /(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/, pc = k(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label", Rt).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), uo = k(/^!?\[(label)\]\[(ref)\]/).replace("label", Rt).replace("ref", Ln).getRegex(), ho = k(/^!?\[(ref)\](?:\[\])?/).replace("ref", Ln).getRegex(), fc = k("reflink|nolink(?!\\()", "g").replace("reflink", uo).replace("nolink", ho).getRegex(), qr = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/, Qn = { _backpedal: de, anyPunctuation: cc, autolink: uc, blockSkip: ec, br: so, code: Kl, del: de, delLDelim: de, delRDelim: de, emStrongLDelim: tc, emStrongRDelimAst: rc, emStrongRDelimUnd: oc, escape: Jl, link: pc, nolink: ho, punctuation: Gl, reflink: uo, reflinkSearch: fc, tag: dc, text: Zl, url: de }, gc = { ...Qn, link: k(/^!?\[(label)\]\((.*?)\)/).replace("label", Rt).getRegex(), reflink: k(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", Rt).getRegex() }, gn = { ...Qn, emStrongRDelimAst: ic, emStrongLDelim: nc, delLDelim: sc, delRDelim: lc, url: k(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol", qr).replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(), _backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/, del: /^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/, text: k(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol", qr).getRegex() }, mc = { ...gn, br: k(so).replace("{2,}", "*").getRegex(), text: k(gn.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex() }, ft = { normal: zn, gfm: Hl, pedantic: Wl }, Qe = { normal: Qn, gfm: gn, breaks: mc, pedantic: gc }, xc = { "&": "&", "<": "<", ">": ">", '"': """, "'": "'" }, Mr = (t) => xc[t];
|
|
5118
5178
|
function Y(t, e) {
|
|
5119
5179
|
if (e) {
|
|
5120
|
-
if (P.escapeTest.test(t)) return t.replace(P.escapeReplace,
|
|
5121
|
-
} else if (P.escapeTestNoEncode.test(t)) return t.replace(P.escapeReplaceNoEncode,
|
|
5180
|
+
if (P.escapeTest.test(t)) return t.replace(P.escapeReplace, Mr);
|
|
5181
|
+
} else if (P.escapeTestNoEncode.test(t)) return t.replace(P.escapeReplaceNoEncode, Mr);
|
|
5122
5182
|
return t;
|
|
5123
5183
|
}
|
|
5124
|
-
function
|
|
5184
|
+
function Pr(t) {
|
|
5125
5185
|
try {
|
|
5126
5186
|
t = encodeURI(t).replace(P.percentDecode, "%");
|
|
5127
5187
|
} catch {
|
|
@@ -5129,7 +5189,7 @@ function Ir(t) {
|
|
|
5129
5189
|
}
|
|
5130
5190
|
return t;
|
|
5131
5191
|
}
|
|
5132
|
-
function
|
|
5192
|
+
function Lr(t, e) {
|
|
5133
5193
|
let n = t.replace(P.findPipe, (o, s, l) => {
|
|
5134
5194
|
let a = !1, u = s;
|
|
5135
5195
|
for (; --u >= 0 && l[u] === "\\"; ) a = !a;
|
|
@@ -5140,7 +5200,7 @@ function $r(t, e) {
|
|
|
5140
5200
|
for (; i < r.length; i++) r[i] = r[i].trim().replace(P.slashPipe, "|");
|
|
5141
5201
|
return r;
|
|
5142
5202
|
}
|
|
5143
|
-
function
|
|
5203
|
+
function Ue(t, e, n) {
|
|
5144
5204
|
let r = t.length;
|
|
5145
5205
|
if (r === 0) return "";
|
|
5146
5206
|
let i = 0;
|
|
@@ -5148,7 +5208,7 @@ function Qe(t, e, n) {
|
|
|
5148
5208
|
i++;
|
|
5149
5209
|
return t.slice(0, r - i);
|
|
5150
5210
|
}
|
|
5151
|
-
function
|
|
5211
|
+
function bc(t, e) {
|
|
5152
5212
|
if (t.indexOf(e[1]) === -1) return -1;
|
|
5153
5213
|
let n = 0;
|
|
5154
5214
|
for (let r = 0; r < t.length; r++) if (t[r] === "\\") r++;
|
|
@@ -5156,7 +5216,7 @@ function cc(t, e) {
|
|
|
5156
5216
|
else if (t[r] === e[1] && (n--, n < 0)) return r;
|
|
5157
5217
|
return n > 0 ? -2 : -1;
|
|
5158
5218
|
}
|
|
5159
|
-
function
|
|
5219
|
+
function vc(t, e = 0) {
|
|
5160
5220
|
let n = e, r = "";
|
|
5161
5221
|
for (let i of t) if (i === " ") {
|
|
5162
5222
|
let o = 4 - n % 4;
|
|
@@ -5164,13 +5224,13 @@ function uc(t, e = 0) {
|
|
|
5164
5224
|
} else r += i, n++;
|
|
5165
5225
|
return r;
|
|
5166
5226
|
}
|
|
5167
|
-
function
|
|
5227
|
+
function Or(t, e, n, r, i) {
|
|
5168
5228
|
let o = e.href, s = e.title || null, l = t[1].replace(i.other.outputLinkReplace, "$1");
|
|
5169
5229
|
r.state.inLink = !0;
|
|
5170
5230
|
let a = { type: t[0].charAt(0) === "!" ? "image" : "link", raw: n, href: o, title: s, text: l, tokens: r.inlineTokens(l) };
|
|
5171
5231
|
return r.state.inLink = !1, a;
|
|
5172
5232
|
}
|
|
5173
|
-
function
|
|
5233
|
+
function yc(t, e, n) {
|
|
5174
5234
|
let r = t.match(n.other.indentCodeCompensation);
|
|
5175
5235
|
if (r === null) return e;
|
|
5176
5236
|
let i = r[1];
|
|
@@ -5183,7 +5243,7 @@ function hc(t, e, n) {
|
|
|
5183
5243
|
}).join(`
|
|
5184
5244
|
`);
|
|
5185
5245
|
}
|
|
5186
|
-
var
|
|
5246
|
+
var Tt = class {
|
|
5187
5247
|
options;
|
|
5188
5248
|
rules;
|
|
5189
5249
|
lexer;
|
|
@@ -5198,14 +5258,14 @@ var Rt = class {
|
|
|
5198
5258
|
let e = this.rules.block.code.exec(t);
|
|
5199
5259
|
if (e) {
|
|
5200
5260
|
let n = e[0].replace(this.rules.other.codeRemoveIndent, "");
|
|
5201
|
-
return { type: "code", raw: e[0], codeBlockStyle: "indented", text: this.options.pedantic ? n :
|
|
5261
|
+
return { type: "code", raw: e[0], codeBlockStyle: "indented", text: this.options.pedantic ? n : Ue(n, `
|
|
5202
5262
|
`) };
|
|
5203
5263
|
}
|
|
5204
5264
|
}
|
|
5205
5265
|
fences(t) {
|
|
5206
5266
|
let e = this.rules.block.fences.exec(t);
|
|
5207
5267
|
if (e) {
|
|
5208
|
-
let n = e[0], r =
|
|
5268
|
+
let n = e[0], r = yc(n, e[3] || "", this.rules);
|
|
5209
5269
|
return { type: "code", raw: n, lang: e[2] ? e[2].trim().replace(this.rules.inline.anyPunctuation, "$1") : e[2], text: r };
|
|
5210
5270
|
}
|
|
5211
5271
|
}
|
|
@@ -5214,7 +5274,7 @@ var Rt = class {
|
|
|
5214
5274
|
if (e) {
|
|
5215
5275
|
let n = e[2].trim();
|
|
5216
5276
|
if (this.rules.other.endingHash.test(n)) {
|
|
5217
|
-
let r =
|
|
5277
|
+
let r = Ue(n, "#");
|
|
5218
5278
|
(this.options.pedantic || !r || this.rules.other.endingSpaceChar.test(r)) && (n = r.trim());
|
|
5219
5279
|
}
|
|
5220
5280
|
return { type: "heading", raw: e[0], depth: e[1].length, text: n, tokens: this.lexer.inline(n) };
|
|
@@ -5222,13 +5282,13 @@ var Rt = class {
|
|
|
5222
5282
|
}
|
|
5223
5283
|
hr(t) {
|
|
5224
5284
|
let e = this.rules.block.hr.exec(t);
|
|
5225
|
-
if (e) return { type: "hr", raw:
|
|
5285
|
+
if (e) return { type: "hr", raw: Ue(e[0], `
|
|
5226
5286
|
`) };
|
|
5227
5287
|
}
|
|
5228
5288
|
blockquote(t) {
|
|
5229
5289
|
let e = this.rules.block.blockquote.exec(t);
|
|
5230
5290
|
if (e) {
|
|
5231
|
-
let n =
|
|
5291
|
+
let n = Ue(e[0], `
|
|
5232
5292
|
`).split(`
|
|
5233
5293
|
`), r = "", i = "", o = [];
|
|
5234
5294
|
for (; n.length > 0; ) {
|
|
@@ -5275,16 +5335,16 @@ ${d}` : d;
|
|
|
5275
5335
|
let a = !1, u = "", d = "";
|
|
5276
5336
|
if (!(e = o.exec(t)) || this.rules.block.hr.test(t)) break;
|
|
5277
5337
|
u = e[0], t = t.substring(u.length);
|
|
5278
|
-
let h =
|
|
5338
|
+
let h = vc(e[2].split(`
|
|
5279
5339
|
`, 1)[0], e[1].length), p = t.split(`
|
|
5280
5340
|
`, 1)[0], f = !h.trim(), g = 0;
|
|
5281
5341
|
if (this.options.pedantic ? (g = 2, d = h.trimStart()) : f ? g = e[1].length + 1 : (g = h.search(this.rules.other.nonSpaceChar), g = g > 4 ? 1 : g, d = h.slice(g), g += e[1].length), f && this.rules.other.blankLine.test(p) && (u += p + `
|
|
5282
5342
|
`, t = t.substring(p.length + 1), a = !0), !a) {
|
|
5283
|
-
let m = this.rules.other.nextBulletRegex(g), x = this.rules.other.hrRegex(g), y = this.rules.other.fencesBeginRegex(g), v = this.rules.other.headingBeginRegex(g),
|
|
5343
|
+
let m = this.rules.other.nextBulletRegex(g), x = this.rules.other.hrRegex(g), y = this.rules.other.fencesBeginRegex(g), v = this.rules.other.headingBeginRegex(g), T = this.rules.other.htmlBeginRegex(g), K = this.rules.other.blockquoteBeginRegex(g);
|
|
5284
5344
|
for (; t; ) {
|
|
5285
5345
|
let se = t.split(`
|
|
5286
5346
|
`, 1)[0], B;
|
|
5287
|
-
if (p = se, this.options.pedantic ? (p = p.replace(this.rules.other.listReplaceNesting, " "), B = p) : B = p.replace(this.rules.other.tabCharGlobal, " "), y.test(p) || v.test(p) ||
|
|
5347
|
+
if (p = se, this.options.pedantic ? (p = p.replace(this.rules.other.listReplaceNesting, " "), B = p) : B = p.replace(this.rules.other.tabCharGlobal, " "), y.test(p) || v.test(p) || T.test(p) || K.test(p) || m.test(p) || x.test(p)) break;
|
|
5288
5348
|
if (B.search(this.rules.other.nonSpaceChar) >= g || !p.trim()) d += `
|
|
5289
5349
|
` + B.slice(g);
|
|
5290
5350
|
else {
|
|
@@ -5343,12 +5403,12 @@ ${d}` : d;
|
|
|
5343
5403
|
table(t) {
|
|
5344
5404
|
let e = this.rules.block.table.exec(t);
|
|
5345
5405
|
if (!e || !this.rules.other.tableDelimiter.test(e[2])) return;
|
|
5346
|
-
let n =
|
|
5406
|
+
let n = Lr(e[1]), r = e[2].replace(this.rules.other.tableAlignChars, "").split("|"), i = e[3]?.trim() ? e[3].replace(this.rules.other.tableRowBlankLine, "").split(`
|
|
5347
5407
|
`) : [], o = { type: "table", raw: e[0], header: [], align: [], rows: [] };
|
|
5348
5408
|
if (n.length === r.length) {
|
|
5349
5409
|
for (let s of r) this.rules.other.tableAlignRight.test(s) ? o.align.push("right") : this.rules.other.tableAlignCenter.test(s) ? o.align.push("center") : this.rules.other.tableAlignLeft.test(s) ? o.align.push("left") : o.align.push(null);
|
|
5350
5410
|
for (let s = 0; s < n.length; s++) o.header.push({ text: n[s], tokens: this.lexer.inline(n[s]), header: !0, align: o.align[s] });
|
|
5351
|
-
for (let s of i) o.rows.push(
|
|
5411
|
+
for (let s of i) o.rows.push(Lr(s, o.header.length).map((l, a) => ({ text: l, tokens: this.lexer.inline(l), header: !1, align: o.align[a] })));
|
|
5352
5412
|
return o;
|
|
5353
5413
|
}
|
|
5354
5414
|
}
|
|
@@ -5385,10 +5445,10 @@ ${d}` : d;
|
|
|
5385
5445
|
let n = e[2].trim();
|
|
5386
5446
|
if (!this.options.pedantic && this.rules.other.startAngleBracket.test(n)) {
|
|
5387
5447
|
if (!this.rules.other.endAngleBracket.test(n)) return;
|
|
5388
|
-
let o =
|
|
5448
|
+
let o = Ue(n.slice(0, -1), "\\");
|
|
5389
5449
|
if ((n.length - o.length) % 2 === 0) return;
|
|
5390
5450
|
} else {
|
|
5391
|
-
let o =
|
|
5451
|
+
let o = bc(e[2], "()");
|
|
5392
5452
|
if (o === -2) return;
|
|
5393
5453
|
if (o > -1) {
|
|
5394
5454
|
let s = (e[0].indexOf("!") === 0 ? 5 : 4) + e[1].length + o;
|
|
@@ -5400,7 +5460,7 @@ ${d}` : d;
|
|
|
5400
5460
|
let o = this.rules.other.pedanticHrefTitle.exec(r);
|
|
5401
5461
|
o && (r = o[1], i = o[3]);
|
|
5402
5462
|
} else i = e[3] ? e[3].slice(1, -1) : "";
|
|
5403
|
-
return r = r.trim(), this.rules.other.startAngleBracket.test(r) && (this.options.pedantic && !this.rules.other.endAngleBracket.test(n) ? r = r.slice(1) : r = r.slice(1, -1)),
|
|
5463
|
+
return r = r.trim(), this.rules.other.startAngleBracket.test(r) && (this.options.pedantic && !this.rules.other.endAngleBracket.test(n) ? r = r.slice(1) : r = r.slice(1, -1)), Or(e, { href: r && r.replace(this.rules.inline.anyPunctuation, "$1"), title: i && i.replace(this.rules.inline.anyPunctuation, "$1") }, e[0], this.lexer, this.rules);
|
|
5404
5464
|
}
|
|
5405
5465
|
}
|
|
5406
5466
|
reflink(t, e) {
|
|
@@ -5411,7 +5471,7 @@ ${d}` : d;
|
|
|
5411
5471
|
let o = n[0].charAt(0);
|
|
5412
5472
|
return { type: "text", raw: o, text: o };
|
|
5413
5473
|
}
|
|
5414
|
-
return
|
|
5474
|
+
return Or(n, i, n[0], this.lexer, this.rules);
|
|
5415
5475
|
}
|
|
5416
5476
|
}
|
|
5417
5477
|
emStrong(t, e, n = "") {
|
|
@@ -5496,25 +5556,25 @@ ${d}` : d;
|
|
|
5496
5556
|
return { type: "text", raw: e[0], text: e[0], escaped: n };
|
|
5497
5557
|
}
|
|
5498
5558
|
}
|
|
5499
|
-
}, V = class
|
|
5559
|
+
}, V = class mn {
|
|
5500
5560
|
tokens;
|
|
5501
5561
|
options;
|
|
5502
5562
|
state;
|
|
5503
5563
|
inlineQueue;
|
|
5504
5564
|
tokenizer;
|
|
5505
5565
|
constructor(e) {
|
|
5506
|
-
this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = e || ye, this.options.tokenizer = this.options.tokenizer || new
|
|
5507
|
-
let n = { other: P, block: ft.normal, inline:
|
|
5508
|
-
this.options.pedantic ? (n.block = ft.pedantic, n.inline =
|
|
5566
|
+
this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = e || ye, this.options.tokenizer = this.options.tokenizer || new Tt(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = { inLink: !1, inRawBlock: !1, top: !0 };
|
|
5567
|
+
let n = { other: P, block: ft.normal, inline: Qe.normal };
|
|
5568
|
+
this.options.pedantic ? (n.block = ft.pedantic, n.inline = Qe.pedantic) : this.options.gfm && (n.block = ft.gfm, this.options.breaks ? n.inline = Qe.breaks : n.inline = Qe.gfm), this.tokenizer.rules = n;
|
|
5509
5569
|
}
|
|
5510
5570
|
static get rules() {
|
|
5511
|
-
return { block: ft, inline:
|
|
5571
|
+
return { block: ft, inline: Qe };
|
|
5512
5572
|
}
|
|
5513
5573
|
static lex(e, n) {
|
|
5514
|
-
return new
|
|
5574
|
+
return new mn(n).lex(e);
|
|
5515
5575
|
}
|
|
5516
5576
|
static lexInline(e, n) {
|
|
5517
|
-
return new
|
|
5577
|
+
return new mn(n).inlineTokens(e);
|
|
5518
5578
|
}
|
|
5519
5579
|
lex(e) {
|
|
5520
5580
|
e = e.replace(P.carriageReturn, `
|
|
@@ -5704,7 +5764,7 @@ ${d}` : d;
|
|
|
5704
5764
|
}
|
|
5705
5765
|
return n;
|
|
5706
5766
|
}
|
|
5707
|
-
},
|
|
5767
|
+
}, At = class {
|
|
5708
5768
|
options;
|
|
5709
5769
|
parser;
|
|
5710
5770
|
constructor(t) {
|
|
@@ -5804,7 +5864,7 @@ ${t}</tr>
|
|
|
5804
5864
|
return `<del>${this.parser.parseInline(t)}</del>`;
|
|
5805
5865
|
}
|
|
5806
5866
|
link({ href: t, title: e, tokens: n }) {
|
|
5807
|
-
let r = this.parser.parseInline(n), i =
|
|
5867
|
+
let r = this.parser.parseInline(n), i = Pr(t);
|
|
5808
5868
|
if (i === null) return r;
|
|
5809
5869
|
t = i;
|
|
5810
5870
|
let o = '<a href="' + t + '"';
|
|
@@ -5812,7 +5872,7 @@ ${t}</tr>
|
|
|
5812
5872
|
}
|
|
5813
5873
|
image({ href: t, title: e, text: n, tokens: r }) {
|
|
5814
5874
|
r && (n = this.parser.parseInline(r, this.parser.textRenderer));
|
|
5815
|
-
let i =
|
|
5875
|
+
let i = Pr(t);
|
|
5816
5876
|
if (i === null) return Y(n);
|
|
5817
5877
|
t = i;
|
|
5818
5878
|
let o = `<img src="${t}" alt="${Y(n)}"`;
|
|
@@ -5821,7 +5881,7 @@ ${t}</tr>
|
|
|
5821
5881
|
text(t) {
|
|
5822
5882
|
return "tokens" in t && t.tokens ? this.parser.parseInline(t.tokens) : "escaped" in t && t.escaped ? t.text : Y(t.text);
|
|
5823
5883
|
}
|
|
5824
|
-
},
|
|
5884
|
+
}, Un = class {
|
|
5825
5885
|
strong({ text: t }) {
|
|
5826
5886
|
return t;
|
|
5827
5887
|
}
|
|
@@ -5852,18 +5912,18 @@ ${t}</tr>
|
|
|
5852
5912
|
checkbox({ raw: t }) {
|
|
5853
5913
|
return t;
|
|
5854
5914
|
}
|
|
5855
|
-
}, H = class
|
|
5915
|
+
}, H = class xn {
|
|
5856
5916
|
options;
|
|
5857
5917
|
renderer;
|
|
5858
5918
|
textRenderer;
|
|
5859
5919
|
constructor(e) {
|
|
5860
|
-
this.options = e || ye, this.options.renderer = this.options.renderer || new
|
|
5920
|
+
this.options = e || ye, this.options.renderer = this.options.renderer || new At(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new Un();
|
|
5861
5921
|
}
|
|
5862
5922
|
static parse(e, n) {
|
|
5863
|
-
return new
|
|
5923
|
+
return new xn(n).parse(e);
|
|
5864
5924
|
}
|
|
5865
5925
|
static parseInline(e, n) {
|
|
5866
|
-
return new
|
|
5926
|
+
return new xn(n).parseInline(e);
|
|
5867
5927
|
}
|
|
5868
5928
|
parse(e) {
|
|
5869
5929
|
this.renderer.parser = this;
|
|
@@ -6029,16 +6089,16 @@ ${t}</tr>
|
|
|
6029
6089
|
provideParser() {
|
|
6030
6090
|
return this.block ? H.parse : H.parseInline;
|
|
6031
6091
|
}
|
|
6032
|
-
},
|
|
6033
|
-
defaults =
|
|
6092
|
+
}, kc = class {
|
|
6093
|
+
defaults = qn();
|
|
6034
6094
|
options = this.setOptions;
|
|
6035
6095
|
parse = this.parseMarkdown(!0);
|
|
6036
6096
|
parseInline = this.parseMarkdown(!1);
|
|
6037
6097
|
Parser = H;
|
|
6038
|
-
Renderer =
|
|
6039
|
-
TextRenderer =
|
|
6098
|
+
Renderer = At;
|
|
6099
|
+
TextRenderer = Un;
|
|
6040
6100
|
Lexer = V;
|
|
6041
|
-
Tokenizer =
|
|
6101
|
+
Tokenizer = Tt;
|
|
6042
6102
|
Hooks = Ve;
|
|
6043
6103
|
constructor(...t) {
|
|
6044
6104
|
this.use(...t);
|
|
@@ -6087,7 +6147,7 @@ ${t}</tr>
|
|
|
6087
6147
|
}
|
|
6088
6148
|
"childTokens" in i && i.childTokens && (e.childTokens[i.name] = i.childTokens);
|
|
6089
6149
|
}), r.extensions = e), n.renderer) {
|
|
6090
|
-
let i = this.defaults.renderer || new
|
|
6150
|
+
let i = this.defaults.renderer || new At(this.defaults);
|
|
6091
6151
|
for (let o in n.renderer) {
|
|
6092
6152
|
if (!(o in i)) throw new Error(`renderer '${o}' does not exist`);
|
|
6093
6153
|
if (["options", "parser"].includes(o)) continue;
|
|
@@ -6100,7 +6160,7 @@ ${t}</tr>
|
|
|
6100
6160
|
r.renderer = i;
|
|
6101
6161
|
}
|
|
6102
6162
|
if (n.tokenizer) {
|
|
6103
|
-
let i = this.defaults.tokenizer || new
|
|
6163
|
+
let i = this.defaults.tokenizer || new Tt(this.defaults);
|
|
6104
6164
|
for (let o in n.tokenizer) {
|
|
6105
6165
|
if (!(o in i)) throw new Error(`tokenizer '${o}' does not exist`);
|
|
6106
6166
|
if (["options", "rules", "lexer"].includes(o)) continue;
|
|
@@ -6189,17 +6249,17 @@ Please report this to https://github.com/markedjs/marked.`, t) {
|
|
|
6189
6249
|
throw n;
|
|
6190
6250
|
};
|
|
6191
6251
|
}
|
|
6192
|
-
}, be = new
|
|
6252
|
+
}, be = new kc();
|
|
6193
6253
|
function _(t, e) {
|
|
6194
6254
|
return be.parse(t, e);
|
|
6195
6255
|
}
|
|
6196
6256
|
_.options = _.setOptions = function(t) {
|
|
6197
|
-
return be.setOptions(t), _.defaults = be.defaults,
|
|
6257
|
+
return be.setOptions(t), _.defaults = be.defaults, no(_.defaults), _;
|
|
6198
6258
|
};
|
|
6199
|
-
_.getDefaults =
|
|
6259
|
+
_.getDefaults = qn;
|
|
6200
6260
|
_.defaults = ye;
|
|
6201
6261
|
_.use = function(...t) {
|
|
6202
|
-
return be.use(...t), _.defaults = be.defaults,
|
|
6262
|
+
return be.use(...t), _.defaults = be.defaults, no(_.defaults), _;
|
|
6203
6263
|
};
|
|
6204
6264
|
_.walkTokens = function(t, e) {
|
|
6205
6265
|
return be.walkTokens(t, e);
|
|
@@ -6207,11 +6267,11 @@ _.walkTokens = function(t, e) {
|
|
|
6207
6267
|
_.parseInline = be.parseInline;
|
|
6208
6268
|
_.Parser = H;
|
|
6209
6269
|
_.parser = H.parse;
|
|
6210
|
-
_.Renderer =
|
|
6211
|
-
_.TextRenderer =
|
|
6270
|
+
_.Renderer = At;
|
|
6271
|
+
_.TextRenderer = Un;
|
|
6212
6272
|
_.Lexer = V;
|
|
6213
6273
|
_.lexer = V.lex;
|
|
6214
|
-
_.Tokenizer =
|
|
6274
|
+
_.Tokenizer = Tt;
|
|
6215
6275
|
_.Hooks = Ve;
|
|
6216
6276
|
_.parse = _;
|
|
6217
6277
|
_.options;
|
|
@@ -6225,7 +6285,7 @@ _.setOptions({
|
|
|
6225
6285
|
breaks: !0,
|
|
6226
6286
|
gfm: !0
|
|
6227
6287
|
});
|
|
6228
|
-
function
|
|
6288
|
+
function wc({ text: t }) {
|
|
6229
6289
|
const e = J(() => {
|
|
6230
6290
|
if (!t)
|
|
6231
6291
|
return "";
|
|
@@ -6234,51 +6294,78 @@ function pc({ text: t }) {
|
|
|
6234
6294
|
}, [t]);
|
|
6235
6295
|
return /* @__PURE__ */ c("div", { class: "jex-md", dangerouslySetInnerHTML: { __html: e } });
|
|
6236
6296
|
}
|
|
6237
|
-
const
|
|
6238
|
-
function
|
|
6297
|
+
const qe = A("");
|
|
6298
|
+
function _c(t) {
|
|
6239
6299
|
if (!t)
|
|
6240
6300
|
return;
|
|
6241
6301
|
const e = t.trim().split(/\s+/)[0];
|
|
6242
6302
|
if (!e)
|
|
6243
6303
|
return;
|
|
6244
|
-
const n = `@${e} `, r =
|
|
6245
|
-
r.includes(n) || r.includes(`@${e}`) || (
|
|
6304
|
+
const n = `@${e} `, r = qe.value;
|
|
6305
|
+
r.includes(n) || r.includes(`@${e}`) || (qe.value = r.trimStart() ? `${n}${r.trimStart()}` : n);
|
|
6246
6306
|
}
|
|
6247
|
-
const rt =
|
|
6248
|
-
function
|
|
6307
|
+
const rt = A(null), zr = A(Date.now()), oe = A([]), jc = 4, Sc = 8 * 1024 * 1024;
|
|
6308
|
+
function Cc() {
|
|
6249
6309
|
return typeof crypto < "u" && typeof crypto.randomUUID == "function" ? crypto.randomUUID() : `att-${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 11)}`;
|
|
6250
6310
|
}
|
|
6251
|
-
function
|
|
6252
|
-
const e = Array.from(t).filter((i) => i.type.startsWith("image/") && i.size <=
|
|
6311
|
+
function Rc(t) {
|
|
6312
|
+
const e = Array.from(t).filter((i) => i.type.startsWith("image/") && i.size <= Sc);
|
|
6253
6313
|
if (e.length === 0)
|
|
6254
6314
|
return;
|
|
6255
|
-
const n =
|
|
6315
|
+
const n = jc - oe.value.length;
|
|
6256
6316
|
if (n <= 0)
|
|
6257
6317
|
return;
|
|
6258
6318
|
const r = e.slice(0, n).map((i) => ({
|
|
6259
6319
|
// Falls back to a non-crypto id when host page is HTTP — see genAttachmentId.
|
|
6260
|
-
id:
|
|
6320
|
+
id: Cc(),
|
|
6261
6321
|
file: i,
|
|
6262
6322
|
previewUrl: URL.createObjectURL(i)
|
|
6263
6323
|
}));
|
|
6264
6324
|
oe.value = [...oe.value, ...r];
|
|
6265
6325
|
}
|
|
6266
|
-
function
|
|
6326
|
+
function Tc(t) {
|
|
6267
6327
|
const e = oe.value.find((n) => n.id === t);
|
|
6268
6328
|
e && URL.revokeObjectURL(e.previewUrl), oe.value = oe.value.filter((n) => n.id !== t);
|
|
6269
6329
|
}
|
|
6270
|
-
function
|
|
6330
|
+
function Ac() {
|
|
6271
6331
|
for (const t of oe.value)
|
|
6272
6332
|
URL.revokeObjectURL(t.previewUrl);
|
|
6273
6333
|
oe.value = [];
|
|
6274
6334
|
}
|
|
6275
|
-
|
|
6335
|
+
BigInt("-9223372036854775808");
|
|
6336
|
+
BigInt("9223372036854775807");
|
|
6337
|
+
BigInt("0");
|
|
6338
|
+
BigInt("8");
|
|
6339
|
+
BigInt("256");
|
|
6340
|
+
const Ic = /* @__PURE__ */ Symbol.for("functionName"), $c = /* @__PURE__ */ Symbol.for("toReferencePath");
|
|
6341
|
+
function po(t = []) {
|
|
6342
|
+
const e = {
|
|
6343
|
+
get(n, r) {
|
|
6344
|
+
if (typeof r == "string") {
|
|
6345
|
+
const i = [...t, r];
|
|
6346
|
+
return po(i);
|
|
6347
|
+
} else if (r === Ic) {
|
|
6348
|
+
if (t.length < 2) {
|
|
6349
|
+
const s = ["api", ...t].join(".");
|
|
6350
|
+
throw new Error(
|
|
6351
|
+
`API path is expected to be of the form \`api.moduleName.functionName\`. Found: \`${s}\``
|
|
6352
|
+
);
|
|
6353
|
+
}
|
|
6354
|
+
const i = t.slice(0, -1).join("/"), o = t[t.length - 1];
|
|
6355
|
+
return o === "default" ? i : i + ":" + o;
|
|
6356
|
+
} else return r === Symbol.toStringTag ? "FunctionReference" : void 0;
|
|
6357
|
+
}
|
|
6358
|
+
};
|
|
6359
|
+
return new Proxy({}, e);
|
|
6360
|
+
}
|
|
6361
|
+
const Ec = po();
|
|
6362
|
+
function fo(t, e) {
|
|
6276
6363
|
const n = {
|
|
6277
6364
|
get(r, i) {
|
|
6278
6365
|
if (typeof i == "string") {
|
|
6279
6366
|
const o = [...e, i];
|
|
6280
|
-
return
|
|
6281
|
-
} else if (i ===
|
|
6367
|
+
return fo(t, o);
|
|
6368
|
+
} else if (i === $c) {
|
|
6282
6369
|
if (e.length < 1) {
|
|
6283
6370
|
const o = [t, ...e].join(".");
|
|
6284
6371
|
throw new Error(
|
|
@@ -6292,34 +6379,34 @@ function lo(t, e) {
|
|
|
6292
6379
|
};
|
|
6293
6380
|
return new Proxy({}, n);
|
|
6294
6381
|
}
|
|
6295
|
-
const
|
|
6296
|
-
|
|
6297
|
-
function
|
|
6298
|
-
const r =
|
|
6382
|
+
const qc = () => fo("components", []), Me = Ec;
|
|
6383
|
+
qc();
|
|
6384
|
+
function Mc({ sessionId: t, visitorId: e, ensureSession: n }) {
|
|
6385
|
+
const r = Et(Me.functions.chat.public.conversations.send);
|
|
6299
6386
|
return async function(i) {
|
|
6300
6387
|
const o = t && e ? { sessionId: t, visitorId: e } : await n();
|
|
6301
6388
|
if (o) {
|
|
6302
|
-
|
|
6389
|
+
qe.value = "", Ac();
|
|
6303
6390
|
try {
|
|
6304
6391
|
const s = await r({
|
|
6305
6392
|
sessionId: o.sessionId,
|
|
6306
6393
|
visitorId: o.visitorId,
|
|
6307
6394
|
content: i
|
|
6308
6395
|
});
|
|
6309
|
-
s.ok ?
|
|
6396
|
+
s.ok ? $n(o.visitorId) : s.reason === "rate_limited" && (rt.value = Date.now() + s.retryAfterMs);
|
|
6310
6397
|
} catch (s) {
|
|
6311
6398
|
console.error("[jexity] Failed to send message:", s);
|
|
6312
6399
|
}
|
|
6313
6400
|
}
|
|
6314
6401
|
};
|
|
6315
6402
|
}
|
|
6316
|
-
function
|
|
6317
|
-
const t = rt.value, e =
|
|
6318
|
-
|
|
6403
|
+
function Pc() {
|
|
6404
|
+
const t = rt.value, e = zr.value;
|
|
6405
|
+
R(() => {
|
|
6319
6406
|
if (t === null)
|
|
6320
6407
|
return;
|
|
6321
6408
|
const i = setInterval(() => {
|
|
6322
|
-
|
|
6409
|
+
zr.value = Date.now();
|
|
6323
6410
|
}, 1e3), o = setTimeout(() => {
|
|
6324
6411
|
rt.value = null;
|
|
6325
6412
|
}, Math.max(0, t - Date.now()));
|
|
@@ -6330,35 +6417,35 @@ function _c() {
|
|
|
6330
6417
|
const n = t !== null, r = n ? Math.max(0, Math.ceil((t - e) / 1e3)) : 0;
|
|
6331
6418
|
return { isActive: n, remainingSeconds: r };
|
|
6332
6419
|
}
|
|
6333
|
-
function
|
|
6334
|
-
const t =
|
|
6420
|
+
function Lc() {
|
|
6421
|
+
const t = I(), { isActive: e, remainingSeconds: n } = Pc();
|
|
6335
6422
|
return e ? /* @__PURE__ */ c("div", { class: "jex-rate-limit-notice", role: "status", "aria-live": "polite", children: t.errorRateLimited.replace("{seconds}", String(n)) }) : null;
|
|
6336
6423
|
}
|
|
6337
|
-
const Se =
|
|
6338
|
-
function
|
|
6339
|
-
const t =
|
|
6424
|
+
const Se = A(null);
|
|
6425
|
+
function Oc() {
|
|
6426
|
+
const t = I(), e = Se.value;
|
|
6340
6427
|
if (e === null)
|
|
6341
6428
|
return null;
|
|
6342
6429
|
const n = e === "no-token" ? t.errorSessionNoToken : e === "unauthorized" ? t.errorSessionUnauthorized : e === "network" ? t.errorNetwork : t.somethingWentWrong;
|
|
6343
6430
|
return /* @__PURE__ */ c("div", { class: "jex-session-error-notice", role: "alert", "aria-live": "assertive", children: n });
|
|
6344
6431
|
}
|
|
6345
|
-
function
|
|
6432
|
+
function zc({ size: t = 18 }) {
|
|
6346
6433
|
return /* @__PURE__ */ c("svg", { width: t, height: t, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", "aria-hidden": "true", children: [
|
|
6347
6434
|
/* @__PURE__ */ c("path", { d: "M22 2 11 13" }),
|
|
6348
6435
|
/* @__PURE__ */ c("path", { d: "M22 2 15 22 11 13 2 9l20-7z" })
|
|
6349
6436
|
] });
|
|
6350
6437
|
}
|
|
6351
|
-
const
|
|
6352
|
-
function
|
|
6438
|
+
const Nr = 132;
|
|
6439
|
+
function Nc({ onSend: t }) {
|
|
6353
6440
|
const e = ue(null), n = ue(null);
|
|
6354
|
-
|
|
6441
|
+
R(() => {
|
|
6355
6442
|
const l = e.current;
|
|
6356
6443
|
if (!l)
|
|
6357
6444
|
return;
|
|
6358
6445
|
l.style.height = "0";
|
|
6359
|
-
const a = Math.min(l.scrollHeight,
|
|
6360
|
-
l.style.height = `${a}px`, l.style.overflowY = l.scrollHeight >
|
|
6361
|
-
}, [
|
|
6446
|
+
const a = Math.min(l.scrollHeight, Nr);
|
|
6447
|
+
l.style.height = `${a}px`, l.style.overflowY = l.scrollHeight > Nr ? "auto" : "hidden";
|
|
6448
|
+
}, [qe.value]);
|
|
6362
6449
|
function r(l) {
|
|
6363
6450
|
l.key === "Enter" && !l.shiftKey && (l.preventDefault(), t());
|
|
6364
6451
|
}
|
|
@@ -6367,7 +6454,7 @@ function Rc({ onSend: t }) {
|
|
|
6367
6454
|
}
|
|
6368
6455
|
function o(l) {
|
|
6369
6456
|
const a = l.currentTarget;
|
|
6370
|
-
a.files && a.files.length > 0 &&
|
|
6457
|
+
a.files && a.files.length > 0 && Rc(a.files), a.value = "";
|
|
6371
6458
|
}
|
|
6372
6459
|
function s(l) {
|
|
6373
6460
|
const a = l.target;
|
|
@@ -6375,8 +6462,8 @@ function Rc({ onSend: t }) {
|
|
|
6375
6462
|
}
|
|
6376
6463
|
return { textareaRef: e, fileInputRef: n, onKeyDown: r, onAttachClick: i, onFilesPicked: o, onCardClick: s };
|
|
6377
6464
|
}
|
|
6378
|
-
function
|
|
6379
|
-
const i =
|
|
6465
|
+
function Qc({ isStreaming: t, disabled: e, inputDisabled: n, onSend: r }) {
|
|
6466
|
+
const i = I(), o = qe, s = oe, { textareaRef: l, fileInputRef: a, onKeyDown: u, onAttachClick: d, onFilesPicked: h, onCardClick: p } = Nc({ onSend: r }), f = o.value.trim().length > 0, g = s.value.length > 0, m = (f || g) && !e;
|
|
6380
6467
|
return /* @__PURE__ */ c("div", { class: "jex-composer-card", onClick: p, children: [
|
|
6381
6468
|
g && /* @__PURE__ */ c("div", { class: "jex-composer-attachments", role: "list", children: s.value.map((x) => /* @__PURE__ */ c("div", { class: "jex-attachment-chip", role: "listitem", children: [
|
|
6382
6469
|
/* @__PURE__ */ c("img", { src: x.previewUrl, alt: x.file.name, class: "jex-attachment-thumb" }),
|
|
@@ -6387,7 +6474,7 @@ function Tc({ isStreaming: t, disabled: e, inputDisabled: n, onSend: r }) {
|
|
|
6387
6474
|
class: "jex-attachment-remove",
|
|
6388
6475
|
"aria-label": i.removeAttachmentAriaLabel,
|
|
6389
6476
|
onClick: () => {
|
|
6390
|
-
|
|
6477
|
+
Tc(x.id);
|
|
6391
6478
|
},
|
|
6392
6479
|
children: /* @__PURE__ */ c("svg", { width: "10", height: "10", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2.5", "stroke-linecap": "round", "stroke-linejoin": "round", "aria-hidden": "true", children: [
|
|
6393
6480
|
/* @__PURE__ */ c("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
|
|
@@ -6448,14 +6535,14 @@ function Tc({ isStreaming: t, disabled: e, inputDisabled: n, onSend: r }) {
|
|
|
6448
6535
|
onClick: r,
|
|
6449
6536
|
"aria-label": i.sendAriaLabel,
|
|
6450
6537
|
disabled: e || !f && !g,
|
|
6451
|
-
children: /* @__PURE__ */ c(
|
|
6538
|
+
children: /* @__PURE__ */ c(zc, { size: 16 })
|
|
6452
6539
|
}
|
|
6453
6540
|
)
|
|
6454
6541
|
] })
|
|
6455
6542
|
] });
|
|
6456
6543
|
}
|
|
6457
|
-
function
|
|
6458
|
-
const l =
|
|
6544
|
+
function Uc({ sessionId: t, visitorId: e, isLoading: n, isStreaming: r, sessionStatus: i, ensureSession: o, onStartFresh: s }) {
|
|
6545
|
+
const l = I(), a = qe, u = Mc({ sessionId: t, visitorId: e, ensureSession: o }), d = rt.value !== null && rt.value > Date.now(), h = n || r || d;
|
|
6459
6546
|
if (i === "resolved")
|
|
6460
6547
|
return /* @__PURE__ */ c("div", { class: "jex-chat-input-resolved", children: [
|
|
6461
6548
|
/* @__PURE__ */ c("div", { class: "jex-resolved-notice", children: l.sessionResolved }),
|
|
@@ -6476,10 +6563,10 @@ function Ac({ sessionId: t, visitorId: e, isLoading: n, isStreaming: r, sessionS
|
|
|
6476
6563
|
!f || h || await u(f);
|
|
6477
6564
|
}
|
|
6478
6565
|
return /* @__PURE__ */ c("div", { class: "jex-chat-input", children: [
|
|
6479
|
-
/* @__PURE__ */ c(
|
|
6480
|
-
/* @__PURE__ */ c(
|
|
6566
|
+
/* @__PURE__ */ c(Lc, {}),
|
|
6567
|
+
/* @__PURE__ */ c(Oc, {}),
|
|
6481
6568
|
/* @__PURE__ */ c(
|
|
6482
|
-
|
|
6569
|
+
Qc,
|
|
6483
6570
|
{
|
|
6484
6571
|
isStreaming: r,
|
|
6485
6572
|
disabled: h,
|
|
@@ -6489,20 +6576,20 @@ function Ac({ sessionId: t, visitorId: e, isLoading: n, isStreaming: r, sessionS
|
|
|
6489
6576
|
)
|
|
6490
6577
|
] });
|
|
6491
6578
|
}
|
|
6492
|
-
function
|
|
6579
|
+
function Fc(t) {
|
|
6493
6580
|
const e = t.trim().split(/\s+/).filter(Boolean);
|
|
6494
6581
|
return e.length === 0 ? "?" : e.map((n) => n[0]).join("").slice(0, 2).toUpperCase();
|
|
6495
6582
|
}
|
|
6496
6583
|
function _e({ text: t, streaming: e, error: n, authorId: r, authorName: i, authorImage: o, botAvatarUrl: s }) {
|
|
6497
|
-
const l =
|
|
6584
|
+
const l = I(), a = !!r, [u, d] = C(!1), h = Te(() => d(!0), []), p = l.replyTo.replace("{name}", i ?? ""), f = [
|
|
6498
6585
|
"jex-message bot",
|
|
6499
6586
|
n ? "jex-message-error" : ""
|
|
6500
6587
|
].filter(Boolean).join(" ");
|
|
6501
6588
|
return /* @__PURE__ */ c("div", { class: "jex-message-row bot", children: [
|
|
6502
|
-
/* @__PURE__ */ c("div", { class: `jex-avatar ${a ? "jex-avatar-agent" : "jex-avatar-bot"}`, children: a && o && !u ? /* @__PURE__ */ c("img", { src: o, alt: i ?? "", class: "jex-avatar-img", onError: h }) : a ? /* @__PURE__ */ c("span", { class: "jex-avatar-initials", children:
|
|
6589
|
+
/* @__PURE__ */ c("div", { class: `jex-avatar ${a ? "jex-avatar-agent" : "jex-avatar-bot"}`, children: a && o && !u ? /* @__PURE__ */ c("img", { src: o, alt: i ?? "", class: "jex-avatar-img", onError: h }) : a ? /* @__PURE__ */ c("span", { class: "jex-avatar-initials", children: Fc(i ?? "") }) : s && !u ? /* @__PURE__ */ c("img", { src: s, alt: "", class: "jex-avatar-img", onError: h }) : /* @__PURE__ */ c(En, { size: 14 }) }),
|
|
6503
6590
|
/* @__PURE__ */ c("div", { class: "jex-message-content", children: [
|
|
6504
6591
|
/* @__PURE__ */ c("div", { class: f, children: [
|
|
6505
|
-
/* @__PURE__ */ c(
|
|
6592
|
+
/* @__PURE__ */ c(wc, { text: t }),
|
|
6506
6593
|
e && /* @__PURE__ */ c("span", { class: "jex-streaming-cursor" })
|
|
6507
6594
|
] }),
|
|
6508
6595
|
a && i && /* @__PURE__ */ c("div", { class: "jex-message-author-row", children: [
|
|
@@ -6515,23 +6602,23 @@ function _e({ text: t, streaming: e, error: n, authorId: r, authorName: i, autho
|
|
|
6515
6602
|
"aria-label": p,
|
|
6516
6603
|
title: p,
|
|
6517
6604
|
onClick: () => {
|
|
6518
|
-
|
|
6605
|
+
_c(i);
|
|
6519
6606
|
},
|
|
6520
|
-
children: /* @__PURE__ */ c(
|
|
6607
|
+
children: /* @__PURE__ */ c(Ml, { size: 12 })
|
|
6521
6608
|
}
|
|
6522
6609
|
)
|
|
6523
6610
|
] })
|
|
6524
6611
|
] })
|
|
6525
6612
|
] });
|
|
6526
6613
|
}
|
|
6527
|
-
function
|
|
6614
|
+
function Dc({ text: t }) {
|
|
6528
6615
|
return /* @__PURE__ */ c("div", { class: "jex-message user", children: t });
|
|
6529
6616
|
}
|
|
6530
|
-
function
|
|
6531
|
-
return
|
|
6617
|
+
function go() {
|
|
6618
|
+
return Et(Me.functions.chat.public.helpdesk.submitEscalation);
|
|
6532
6619
|
}
|
|
6533
|
-
function
|
|
6534
|
-
const r =
|
|
6620
|
+
function Bc({ message: t, sessionId: e, visitorId: n }) {
|
|
6621
|
+
const r = I();
|
|
6535
6622
|
return t.formData ? /* @__PURE__ */ c("div", { class: "jex-inline-form-submitted", children: [
|
|
6536
6623
|
/* @__PURE__ */ c("span", { class: "jex-inline-form-check", children: "✓" }),
|
|
6537
6624
|
/* @__PURE__ */ c("div", { children: [
|
|
@@ -6543,7 +6630,7 @@ function Ec({ message: t, sessionId: e, visitorId: n }) {
|
|
|
6543
6630
|
] })
|
|
6544
6631
|
] })
|
|
6545
6632
|
] }) : /* @__PURE__ */ c("div", { class: "jex-message-row bot", children: /* @__PURE__ */ c(
|
|
6546
|
-
|
|
6633
|
+
Vc,
|
|
6547
6634
|
{
|
|
6548
6635
|
messageId: t._id,
|
|
6549
6636
|
sessionId: e,
|
|
@@ -6551,8 +6638,8 @@ function Ec({ message: t, sessionId: e, visitorId: n }) {
|
|
|
6551
6638
|
}
|
|
6552
6639
|
) });
|
|
6553
6640
|
}
|
|
6554
|
-
function
|
|
6555
|
-
const r =
|
|
6641
|
+
function Vc({ messageId: t, sessionId: e, visitorId: n }) {
|
|
6642
|
+
const r = I(), [i, o] = C(""), [s, l] = C(""), [a, u] = C(!1), d = go();
|
|
6556
6643
|
async function h(p) {
|
|
6557
6644
|
if (p.preventDefault(), !a) {
|
|
6558
6645
|
u(!0);
|
|
@@ -6607,14 +6694,14 @@ function qc({ messageId: t, sessionId: e, visitorId: n }) {
|
|
|
6607
6694
|
/* @__PURE__ */ c("div", { class: "jex-inline-form-consent", children: r.escalationConsent })
|
|
6608
6695
|
] });
|
|
6609
6696
|
}
|
|
6610
|
-
const
|
|
6697
|
+
const Hc = {
|
|
6611
6698
|
crawl: "🌐",
|
|
6612
6699
|
file: "📄",
|
|
6613
6700
|
snippet: "💡",
|
|
6614
6701
|
qa: "❓"
|
|
6615
6702
|
};
|
|
6616
|
-
function
|
|
6617
|
-
const e =
|
|
6703
|
+
function Wc({ sources: t }) {
|
|
6704
|
+
const e = I(), [n, r] = C(!1);
|
|
6618
6705
|
return t.length === 0 ? null : /* @__PURE__ */ c("div", { class: "jex-sources-row", children: [
|
|
6619
6706
|
/* @__PURE__ */ c(
|
|
6620
6707
|
"button",
|
|
@@ -6636,10 +6723,10 @@ function Pc({ sources: t }) {
|
|
|
6636
6723
|
}
|
|
6637
6724
|
),
|
|
6638
6725
|
n ? /* @__PURE__ */ c("div", { class: "jex-sources-pills", children: t.map((i, o) => {
|
|
6639
|
-
const s = i.sourceType === "crawl", l =
|
|
6726
|
+
const s = i.sourceType === "crawl", l = Jc(i), a = s && i.url ? `${i.title}
|
|
6640
6727
|
${i.url}` : i.title, u = /* @__PURE__ */ c(Q, { children: [
|
|
6641
6728
|
typeof i.id == "number" ? /* @__PURE__ */ c("span", { class: "jex-source-id", children: i.id }) : null,
|
|
6642
|
-
/* @__PURE__ */ c("span", { class: "jex-source-type", children:
|
|
6729
|
+
/* @__PURE__ */ c("span", { class: "jex-source-type", children: Hc[i.sourceType] }),
|
|
6643
6730
|
/* @__PURE__ */ c("span", { class: "jex-source-label", children: l }),
|
|
6644
6731
|
/* @__PURE__ */ c("span", { class: "jex-source-score", children: [
|
|
6645
6732
|
"· ",
|
|
@@ -6661,7 +6748,7 @@ ${i.url}` : i.title, u = /* @__PURE__ */ c(Q, { children: [
|
|
|
6661
6748
|
}) }) : null
|
|
6662
6749
|
] });
|
|
6663
6750
|
}
|
|
6664
|
-
function
|
|
6751
|
+
function Jc(t) {
|
|
6665
6752
|
if (t.sourceType === "crawl" && t.url)
|
|
6666
6753
|
try {
|
|
6667
6754
|
const e = new URL(t.url);
|
|
@@ -6670,25 +6757,25 @@ function Lc(t) {
|
|
|
6670
6757
|
}
|
|
6671
6758
|
return t.title;
|
|
6672
6759
|
}
|
|
6673
|
-
function
|
|
6760
|
+
function Kc() {
|
|
6674
6761
|
return /* @__PURE__ */ c("div", { class: "jex-typing", children: [
|
|
6675
6762
|
/* @__PURE__ */ c("span", {}),
|
|
6676
6763
|
/* @__PURE__ */ c("span", {}),
|
|
6677
6764
|
/* @__PURE__ */ c("span", {})
|
|
6678
6765
|
] });
|
|
6679
6766
|
}
|
|
6680
|
-
const
|
|
6681
|
-
function
|
|
6682
|
-
return t.replace(
|
|
6767
|
+
const Zc = /\s?\[\d+\]/g;
|
|
6768
|
+
function Qr(t) {
|
|
6769
|
+
return t.replace(Zc, "");
|
|
6683
6770
|
}
|
|
6684
|
-
function
|
|
6685
|
-
const l =
|
|
6686
|
-
return
|
|
6771
|
+
function Gc({ conversations: t, greeting: e, sessionNotFound: n, resumeFailed: r, onStartFresh: i, sessionId: o, visitorId: s }) {
|
|
6772
|
+
const l = I(), a = ue(null), [u, d] = C(null), h = ue(null);
|
|
6773
|
+
return R(() => {
|
|
6687
6774
|
if (!s || !t || t.length === 0)
|
|
6688
6775
|
return;
|
|
6689
6776
|
const p = t[t.length - 1];
|
|
6690
|
-
p.role === "assistant" && p.status !== "streaming" && p._id !== h.current && (h.current = p._id,
|
|
6691
|
-
}, [t, s]),
|
|
6777
|
+
p.role === "assistant" && p.status !== "streaming" && p._id !== h.current && (h.current = p._id, $n(s));
|
|
6778
|
+
}, [t, s]), R(() => {
|
|
6692
6779
|
a.current?.scrollIntoView({ behavior: "smooth" });
|
|
6693
6780
|
}, [t?.length, t?.at(-1)?.content]), /* @__PURE__ */ c("div", { class: "jex-chat-messages", children: [
|
|
6694
6781
|
/* @__PURE__ */ c(_e, { text: e }),
|
|
@@ -6712,7 +6799,7 @@ function Nc({ conversations: t, greeting: e, sessionNotFound: n, resumeFailed: r
|
|
|
6712
6799
|
return /* @__PURE__ */ c(_e, { text: g }, p._id);
|
|
6713
6800
|
}
|
|
6714
6801
|
if (p.contentType === "escalation-form" && o && s)
|
|
6715
|
-
return
|
|
6802
|
+
return ul.value === "screen" && !p.formData ? u === p._id ? null : /* @__PURE__ */ c("div", { class: "jex-inline-form jex-inline-form-card", children: [
|
|
6716
6803
|
/* @__PURE__ */ c("div", { class: "jex-inline-form-title", children: l.escalationPromptTitle }),
|
|
6717
6804
|
/* @__PURE__ */ c("div", { class: "jex-inline-form-subtitle", children: l.escalationPromptSubtitle }),
|
|
6718
6805
|
/* @__PURE__ */ c(
|
|
@@ -6737,19 +6824,19 @@ function Nc({ conversations: t, greeting: e, sessionNotFound: n, resumeFailed: r
|
|
|
6737
6824
|
children: l.escalationSkip
|
|
6738
6825
|
}
|
|
6739
6826
|
)
|
|
6740
|
-
] }, p._id) : /* @__PURE__ */ c(
|
|
6827
|
+
] }, p._id) : /* @__PURE__ */ c(Bc, { message: p, sessionId: o, visitorId: s }, p._id);
|
|
6741
6828
|
if (p.contentType === "escalation-confirm") {
|
|
6742
6829
|
const g = p.noticeKind === "escalation-confirmed" ? l.noticeEscalationConfirmed.replace("{name}", p.noticeData?.visitorName ?? "").replace("{email}", p.noticeData?.visitorEmail ?? "").replace("{ref}", p.noticeData?.visitorId ?? "") : p.content;
|
|
6743
6830
|
return /* @__PURE__ */ c(_e, { text: g }, p._id);
|
|
6744
6831
|
}
|
|
6745
6832
|
if (p.role === "user")
|
|
6746
|
-
return /* @__PURE__ */ c(
|
|
6833
|
+
return /* @__PURE__ */ c(Dc, { text: p.content }, p._id);
|
|
6747
6834
|
const f = {
|
|
6748
6835
|
authorId: p.authorId,
|
|
6749
6836
|
authorName: p.authorName,
|
|
6750
6837
|
authorImage: p.authorImage
|
|
6751
6838
|
};
|
|
6752
|
-
return p.status === "streaming" && p.content === "" ? /* @__PURE__ */ c(
|
|
6839
|
+
return p.status === "streaming" && p.content === "" ? /* @__PURE__ */ c(Kc, {}, p._id) : p.status === "streaming" ? /* @__PURE__ */ c(_e, { text: Qr(p.content), streaming: !0, ...f }, p._id) : p.status === "error" ? /* @__PURE__ */ c(
|
|
6753
6840
|
_e,
|
|
6754
6841
|
{
|
|
6755
6842
|
text: p.errorMessage ?? `${l.somethingWentWrong}. ${l.tryAgain}.`,
|
|
@@ -6758,16 +6845,16 @@ function Nc({ conversations: t, greeting: e, sessionNotFound: n, resumeFailed: r
|
|
|
6758
6845
|
},
|
|
6759
6846
|
p._id
|
|
6760
6847
|
) : /* @__PURE__ */ c("div", { children: [
|
|
6761
|
-
/* @__PURE__ */ c(_e, { text:
|
|
6762
|
-
p.sources && p.sources.length > 0 ? /* @__PURE__ */ c(
|
|
6848
|
+
/* @__PURE__ */ c(_e, { text: Qr(p.content), ...f }),
|
|
6849
|
+
p.sources && p.sources.length > 0 ? /* @__PURE__ */ c(Wc, { sources: p.sources }) : null
|
|
6763
6850
|
] }, p._id);
|
|
6764
6851
|
}),
|
|
6765
6852
|
/* @__PURE__ */ c("div", { ref: a })
|
|
6766
6853
|
] });
|
|
6767
6854
|
}
|
|
6768
|
-
function
|
|
6855
|
+
function bn({ message: t }) {
|
|
6769
6856
|
const [e, n] = C(!1);
|
|
6770
|
-
return
|
|
6857
|
+
return R(() => {
|
|
6771
6858
|
const r = setTimeout(() => {
|
|
6772
6859
|
n(!0);
|
|
6773
6860
|
}, 80);
|
|
@@ -6779,12 +6866,12 @@ function gn({ message: t }) {
|
|
|
6779
6866
|
t && /* @__PURE__ */ c("p", { class: "jex-loading-message", children: t })
|
|
6780
6867
|
] }) : null;
|
|
6781
6868
|
}
|
|
6782
|
-
function
|
|
6783
|
-
const n =
|
|
6784
|
-
|
|
6869
|
+
function Yc({ sessionId: t, visitorId: e }) {
|
|
6870
|
+
const n = wr(
|
|
6871
|
+
Me.functions.chat.public.conversations.listBySession,
|
|
6785
6872
|
t && e ? { sessionId: t, visitorId: e } : "skip"
|
|
6786
|
-
), r =
|
|
6787
|
-
|
|
6873
|
+
), r = wr(
|
|
6874
|
+
Me.functions.chat.public.sessions.getSessionStatus,
|
|
6788
6875
|
t && e ? { sessionId: t, visitorId: e } : "skip"
|
|
6789
6876
|
), i = t !== null && n === void 0, o = n?.some((s) => s.status === "streaming") ?? !1;
|
|
6790
6877
|
return {
|
|
@@ -6794,22 +6881,22 @@ function Qc({ sessionId: t, visitorId: e }) {
|
|
|
6794
6881
|
isStreaming: o
|
|
6795
6882
|
};
|
|
6796
6883
|
}
|
|
6797
|
-
function
|
|
6798
|
-
const h =
|
|
6884
|
+
function Xc({ greeting: t, orgSlug: e, projSlug: n, sessionId: r, visitorId: i, isLoading: o, sessionNotFound: s, resumeFailed: l, isOrgDeleted: a, ensureSession: u, startFresh: d }) {
|
|
6885
|
+
const h = I(), { conversations: p, sessionStatus: f, isLoading: g, isStreaming: m } = Yc({ sessionId: r, visitorId: i }), x = ue(
|
|
6799
6886
|
(() => {
|
|
6800
|
-
const
|
|
6801
|
-
return
|
|
6887
|
+
const T = Ze.peek();
|
|
6888
|
+
return T !== null ? T : Yi.peek() ? "resume" : "fresh";
|
|
6802
6889
|
})()
|
|
6803
6890
|
).current;
|
|
6804
|
-
return
|
|
6891
|
+
return R(() => {
|
|
6805
6892
|
Ze.value = null;
|
|
6806
|
-
}, []),
|
|
6893
|
+
}, []), R(() => {
|
|
6807
6894
|
u();
|
|
6808
|
-
}, [u]),
|
|
6809
|
-
i &&
|
|
6810
|
-
}, [i]), a ? /* @__PURE__ */ c("div", { class: "jex-chat-messages", children: /* @__PURE__ */ c("div", { class: "jex-session-notice", children: h.chatNoLongerAvailable }) }) : x === "fresh" && !r ? /* @__PURE__ */ c(
|
|
6895
|
+
}, [u]), R(() => {
|
|
6896
|
+
i && $n(i);
|
|
6897
|
+
}, [i]), a ? /* @__PURE__ */ c("div", { class: "jex-chat-messages", children: /* @__PURE__ */ c("div", { class: "jex-session-notice", children: h.chatNoLongerAvailable }) }) : x === "fresh" && !r ? /* @__PURE__ */ c(bn, { message: h.startingConversation }) : x === "resume" && (!r || g) ? /* @__PURE__ */ c(bn, { message: h.resumeConversation }) : /* @__PURE__ */ c(Q, { children: [
|
|
6811
6898
|
/* @__PURE__ */ c(
|
|
6812
|
-
|
|
6899
|
+
Gc,
|
|
6813
6900
|
{
|
|
6814
6901
|
conversations: p,
|
|
6815
6902
|
greeting: t,
|
|
@@ -6821,7 +6908,7 @@ function Fc({ greeting: t, orgSlug: e, projSlug: n, sessionId: r, visitorId: i,
|
|
|
6821
6908
|
}
|
|
6822
6909
|
),
|
|
6823
6910
|
/* @__PURE__ */ c(
|
|
6824
|
-
|
|
6911
|
+
Uc,
|
|
6825
6912
|
{
|
|
6826
6913
|
sessionId: r,
|
|
6827
6914
|
visitorId: i,
|
|
@@ -6834,8 +6921,8 @@ function Fc({ greeting: t, orgSlug: e, projSlug: n, sessionId: r, visitorId: i,
|
|
|
6834
6921
|
)
|
|
6835
6922
|
] });
|
|
6836
6923
|
}
|
|
6837
|
-
function
|
|
6838
|
-
const r =
|
|
6924
|
+
function eu({ formMessageId: t, sessionId: e, visitorId: n }) {
|
|
6925
|
+
const r = I(), [i, o] = C(""), [s, l] = C(""), a = go(), [u, d] = C(!1), [h, p] = C(null);
|
|
6839
6926
|
async function f(g) {
|
|
6840
6927
|
g.preventDefault(), d(!0), p(null);
|
|
6841
6928
|
try {
|
|
@@ -6845,7 +6932,7 @@ function Dc({ formMessageId: t, sessionId: e, visitorId: n }) {
|
|
|
6845
6932
|
formMessageId: t,
|
|
6846
6933
|
visitorName: i.trim(),
|
|
6847
6934
|
visitorEmail: s.trim()
|
|
6848
|
-
}),
|
|
6935
|
+
}), Ct();
|
|
6849
6936
|
} catch (m) {
|
|
6850
6937
|
console.error("[EscalationFormScreen] Submit failed:", m), p(r.escalationSubmitFailed);
|
|
6851
6938
|
} finally {
|
|
@@ -6889,15 +6976,15 @@ function Dc({ formMessageId: t, sessionId: e, visitorId: n }) {
|
|
|
6889
6976
|
] }),
|
|
6890
6977
|
/* @__PURE__ */ c("div", { class: "jex-inline-form-consent", style: { textAlign: "center", margin: "16px 0 8px 0" }, children: r.escalationConsent }),
|
|
6891
6978
|
/* @__PURE__ */ c("button", { class: "jex-escalation-skip", type: "button", onClick: () => {
|
|
6892
|
-
|
|
6979
|
+
Ct();
|
|
6893
6980
|
}, children: r.escalationSkip })
|
|
6894
6981
|
] });
|
|
6895
6982
|
}
|
|
6896
|
-
function
|
|
6897
|
-
return
|
|
6983
|
+
function tu() {
|
|
6984
|
+
return Et(Me.functions.chat.public.helpdesk.createEscalationRequest);
|
|
6898
6985
|
}
|
|
6899
|
-
function
|
|
6900
|
-
const n =
|
|
6986
|
+
function Ur({ sessionId: t, visitorId: e }) {
|
|
6987
|
+
const n = I(), [r, i] = C(!1), [o, s] = C(null), l = tu();
|
|
6901
6988
|
async function a() {
|
|
6902
6989
|
if (!t || !e)
|
|
6903
6990
|
return;
|
|
@@ -6940,23 +7027,23 @@ function Lr({ sessionId: t, visitorId: e }) {
|
|
|
6940
7027
|
o && /* @__PURE__ */ c("div", { class: "jex-handoff-error", role: "alert", children: o })
|
|
6941
7028
|
] });
|
|
6942
7029
|
}
|
|
6943
|
-
async function
|
|
6944
|
-
const t =
|
|
7030
|
+
async function nu() {
|
|
7031
|
+
const t = Bi.value;
|
|
6945
7032
|
if (!t)
|
|
6946
7033
|
return console.warn("[JexityChat] Bootstrap refresh skipped — inputs missing"), { ok: !1, reason: "no-inputs" };
|
|
6947
|
-
const e = await
|
|
7034
|
+
const e = await Hi(t.orgSlug, t.siteUrl, t.projSlug);
|
|
6948
7035
|
if (!e.ok)
|
|
6949
7036
|
return console.warn("[JexityChat] Bootstrap refresh failed:", e.error), { ok: !1, reason: e.error };
|
|
6950
7037
|
const n = e.token;
|
|
6951
7038
|
return le.value = n, { ok: !0, token: n };
|
|
6952
7039
|
}
|
|
6953
|
-
function
|
|
6954
|
-
return
|
|
7040
|
+
function Fr(t) {
|
|
7041
|
+
return mo(t) ? "unauthorized" : t instanceof Error && /network|fetch|failed to fetch/i.test(t.message) ? "network" : "unknown";
|
|
6955
7042
|
}
|
|
6956
|
-
function
|
|
7043
|
+
function mo(t) {
|
|
6957
7044
|
return t instanceof vt ? t.data?.code === "UNAUTHORIZED_ORIGIN" : !1;
|
|
6958
7045
|
}
|
|
6959
|
-
function
|
|
7046
|
+
function ru(t = 1e4) {
|
|
6960
7047
|
return le.value ? Promise.resolve(le.value) : new Promise((e) => {
|
|
6961
7048
|
let n = !1;
|
|
6962
7049
|
const r = (s) => {
|
|
@@ -6968,9 +7055,9 @@ function Vc(t = 1e4) {
|
|
|
6968
7055
|
});
|
|
6969
7056
|
});
|
|
6970
7057
|
}
|
|
6971
|
-
function
|
|
6972
|
-
const n = ue(null), r =
|
|
6973
|
-
const g = await
|
|
7058
|
+
function iu(t, e) {
|
|
7059
|
+
const n = ue(null), r = Re(!1), i = Re(!1), o = Re(!1), s = Re(null), l = Et(Me.functions.chat.public.sessions.createOrResume), a = async (f) => {
|
|
7060
|
+
const g = await ru();
|
|
6974
7061
|
if (!g)
|
|
6975
7062
|
return console.warn("[JexityChat] No bootstrap token after 10s — session creation blocked."), Se.value = "no-token", null;
|
|
6976
7063
|
const m = (v) => ({
|
|
@@ -6980,52 +7067,52 @@ function Hc(t, e) {
|
|
|
6980
7067
|
bootstrapToken: v,
|
|
6981
7068
|
...jt.value ? { source: jt.value } : {}
|
|
6982
7069
|
});
|
|
6983
|
-
|
|
7070
|
+
pn.value = !0;
|
|
6984
7071
|
let x;
|
|
6985
7072
|
try {
|
|
6986
7073
|
try {
|
|
6987
7074
|
x = await l(m(g));
|
|
6988
7075
|
} catch (v) {
|
|
6989
|
-
if (!
|
|
7076
|
+
if (!mo(v))
|
|
6990
7077
|
throw v;
|
|
6991
|
-
const
|
|
6992
|
-
if (!
|
|
6993
|
-
return Se.value =
|
|
6994
|
-
x = await l(m(
|
|
7078
|
+
const T = await nu();
|
|
7079
|
+
if (!T.ok)
|
|
7080
|
+
return Se.value = T.reason === "rate_limited" ? "network" : "unauthorized", null;
|
|
7081
|
+
x = await l(m(T.token));
|
|
6995
7082
|
}
|
|
6996
7083
|
} finally {
|
|
6997
|
-
|
|
7084
|
+
pn.value = !1;
|
|
6998
7085
|
}
|
|
6999
7086
|
Se.value = null, s.value = x.status;
|
|
7000
7087
|
const y = { sessionId: x.sessionId, visitorId: f };
|
|
7001
7088
|
return n.current = y, { session: y, result: x };
|
|
7002
|
-
}, u =
|
|
7089
|
+
}, u = Te(async () => {
|
|
7003
7090
|
if (n.current)
|
|
7004
7091
|
return n.current;
|
|
7005
7092
|
if (o.value)
|
|
7006
7093
|
return null;
|
|
7007
7094
|
r.value = !0;
|
|
7008
|
-
const f = xe.value !== null, g = xe.value ??
|
|
7095
|
+
const f = xe.value !== null, g = xe.value ?? Sr();
|
|
7009
7096
|
try {
|
|
7010
7097
|
const m = await a(g);
|
|
7011
7098
|
return m ? (f && m.result.isNew && (i.value = !0, o.value = !0), m.session) : null;
|
|
7012
7099
|
} catch (m) {
|
|
7013
|
-
return console.error("[JexityChat] Failed to create session:", m), Se.value =
|
|
7100
|
+
return console.error("[JexityChat] Failed to create session:", m), Se.value = Fr(m), null;
|
|
7014
7101
|
} finally {
|
|
7015
7102
|
r.value = !1;
|
|
7016
7103
|
}
|
|
7017
|
-
}, [t, e, l, r, i, o]), d =
|
|
7104
|
+
}, [t, e, l, r, i, o]), d = Te(() => {
|
|
7018
7105
|
n.current = null, i.value = !1, o.value = !1;
|
|
7019
7106
|
}, [i, o]);
|
|
7020
|
-
|
|
7021
|
-
const h =
|
|
7107
|
+
R(() => dl(d), [d]);
|
|
7108
|
+
const h = Te(async () => {
|
|
7022
7109
|
n.current = null, o.value = !1, i.value = !1;
|
|
7023
|
-
const f =
|
|
7110
|
+
const f = Sr();
|
|
7024
7111
|
r.value = !0;
|
|
7025
7112
|
try {
|
|
7026
7113
|
return (await a(f))?.session ?? null;
|
|
7027
7114
|
} catch (g) {
|
|
7028
|
-
return console.error("[JexityChat] Failed to create fresh session:", g), Se.value =
|
|
7115
|
+
return console.error("[JexityChat] Failed to create fresh session:", g), Se.value = Fr(g), null;
|
|
7029
7116
|
} finally {
|
|
7030
7117
|
r.value = !1;
|
|
7031
7118
|
}
|
|
@@ -7043,14 +7130,14 @@ function Hc(t, e) {
|
|
|
7043
7130
|
resetSession: d
|
|
7044
7131
|
};
|
|
7045
7132
|
}
|
|
7046
|
-
function
|
|
7047
|
-
const t =
|
|
7133
|
+
function ou() {
|
|
7134
|
+
const t = I(), [e, n] = C(""), [r, i] = C(""), [o, s] = C("");
|
|
7048
7135
|
async function l(a) {
|
|
7049
|
-
a.preventDefault(),
|
|
7136
|
+
a.preventDefault(), dn({ id: "loading", message: t.submittingTicket }), await new Promise((d) => {
|
|
7050
7137
|
setTimeout(d, 1200);
|
|
7051
7138
|
});
|
|
7052
7139
|
const u = "JEX-" + Math.random().toString(36).slice(2, 8).toUpperCase();
|
|
7053
|
-
|
|
7140
|
+
dn({ id: "confirmation", ref: u });
|
|
7054
7141
|
}
|
|
7055
7142
|
return /* @__PURE__ */ c("div", { class: "jex-form-screen", children: [
|
|
7056
7143
|
/* @__PURE__ */ c("h2", { class: "jex-form-title", children: t.submitTicket }),
|
|
@@ -7099,8 +7186,8 @@ function Wc() {
|
|
|
7099
7186
|
] })
|
|
7100
7187
|
] });
|
|
7101
7188
|
}
|
|
7102
|
-
function
|
|
7103
|
-
const e =
|
|
7189
|
+
function su({ ticketRef: t }) {
|
|
7190
|
+
const e = I();
|
|
7104
7191
|
return /* @__PURE__ */ c("div", { class: "jex-confirmation", children: [
|
|
7105
7192
|
/* @__PURE__ */ c("div", { class: "jex-confirmation-icon", "aria-hidden": "true", children: "✓" }),
|
|
7106
7193
|
/* @__PURE__ */ c("h2", { class: "jex-confirmation-title", children: e.ticketSubmitted }),
|
|
@@ -7119,8 +7206,8 @@ function Jc({ ticketRef: t }) {
|
|
|
7119
7206
|
)
|
|
7120
7207
|
] });
|
|
7121
7208
|
}
|
|
7122
|
-
function
|
|
7123
|
-
const r =
|
|
7209
|
+
function au({ message: t, onRetry: e, onBack: n }) {
|
|
7210
|
+
const r = I();
|
|
7124
7211
|
return /* @__PURE__ */ c("div", { class: "jex-overlay jex-error", children: [
|
|
7125
7212
|
/* @__PURE__ */ c("p", { class: "jex-error-message", children: t }),
|
|
7126
7213
|
/* @__PURE__ */ c("div", { class: "jex-error-actions", children: [
|
|
@@ -7129,25 +7216,25 @@ function Kc({ message: t, onRetry: e, onBack: n }) {
|
|
|
7129
7216
|
] })
|
|
7130
7217
|
] });
|
|
7131
7218
|
}
|
|
7132
|
-
function
|
|
7219
|
+
function Dr({ greeting: t, title: e, orgSlug: n, projSlug: r, sessionId: i, visitorId: o, isLoading: s, sessionNotFound: l, resumeFailed: a, isOrgDeleted: u, ensureSession: d, startFresh: h, resetSession: p }) {
|
|
7133
7220
|
const f = N.value, g = f[f.length - 1], m = [...f].reverse().find(
|
|
7134
7221
|
(x) => x.id === "confirmation"
|
|
7135
7222
|
);
|
|
7136
7223
|
return /* @__PURE__ */ c("div", { class: "jex-screen-container", children: [
|
|
7137
|
-
g.id === "home" && /* @__PURE__ */ c(
|
|
7138
|
-
g.id === "selection" && /* @__PURE__ */ c(
|
|
7139
|
-
g.id === "form" && /* @__PURE__ */ c(
|
|
7224
|
+
g.id === "home" && /* @__PURE__ */ c(Cl, { greeting: t, title: e, onStartFresh: h, onResetSession: p }),
|
|
7225
|
+
g.id === "selection" && /* @__PURE__ */ c(Rl, { title: e }),
|
|
7226
|
+
g.id === "form" && /* @__PURE__ */ c(ou, {}),
|
|
7140
7227
|
g.id === "escalation-form" && /* @__PURE__ */ c(
|
|
7141
|
-
|
|
7228
|
+
eu,
|
|
7142
7229
|
{
|
|
7143
7230
|
formMessageId: g.formMessageId,
|
|
7144
7231
|
sessionId: g.sessionId,
|
|
7145
7232
|
visitorId: g.visitorId
|
|
7146
7233
|
}
|
|
7147
7234
|
),
|
|
7148
|
-
g.id === "confirmation" && m && /* @__PURE__ */ c(
|
|
7235
|
+
g.id === "confirmation" && m && /* @__PURE__ */ c(su, { ticketRef: m.ref }),
|
|
7149
7236
|
g.id === "chat" && /* @__PURE__ */ c(
|
|
7150
|
-
|
|
7237
|
+
Xc,
|
|
7151
7238
|
{
|
|
7152
7239
|
greeting: t,
|
|
7153
7240
|
orgSlug: n,
|
|
@@ -7162,43 +7249,52 @@ function zr({ greeting: t, title: e, orgSlug: n, projSlug: r, sessionId: i, visi
|
|
|
7162
7249
|
startFresh: h
|
|
7163
7250
|
}
|
|
7164
7251
|
),
|
|
7165
|
-
g.id === "loading" && /* @__PURE__ */ c(
|
|
7252
|
+
g.id === "loading" && /* @__PURE__ */ c(bn, { message: g.message }),
|
|
7166
7253
|
g.id === "error" && /* @__PURE__ */ c(
|
|
7167
|
-
|
|
7254
|
+
au,
|
|
7168
7255
|
{
|
|
7169
7256
|
message: g.message,
|
|
7170
|
-
onRetry: () =>
|
|
7171
|
-
onBack:
|
|
7257
|
+
onRetry: () => dn({ id: "loading" }),
|
|
7258
|
+
onBack: Ct
|
|
7172
7259
|
}
|
|
7173
7260
|
)
|
|
7174
7261
|
] });
|
|
7175
7262
|
}
|
|
7176
|
-
function
|
|
7177
|
-
|
|
7178
|
-
|
|
7179
|
-
|
|
7180
|
-
|
|
7263
|
+
function lu({ options: t }) {
|
|
7264
|
+
return Za({
|
|
7265
|
+
orgSlug: t.orgSlug,
|
|
7266
|
+
projSlug: t.projSlug,
|
|
7267
|
+
preToken: t.bootstrapToken,
|
|
7268
|
+
convexUrl: t.convexUrl,
|
|
7269
|
+
preAllowedUrls: t.allowedUrls ?? [],
|
|
7270
|
+
preExcludedPaths: t.excludePaths
|
|
7271
|
+
}), Xa() ? /* @__PURE__ */ c(cu, { options: t }) : null;
|
|
7272
|
+
}
|
|
7273
|
+
function cu({ options: t }) {
|
|
7274
|
+
const e = Ja(t.orgSlug, t.projSlug, t.convexUrl);
|
|
7275
|
+
ol(t.parentOrigin), R(() => {
|
|
7276
|
+
ll(), cl();
|
|
7181
7277
|
}, []);
|
|
7182
|
-
const { sessionId: n, visitorId: r, isLoading: i, sessionNotFound: o, resumeFailed: s, isOrgDeleted: l, ensureSession: a, startFresh: u, resetSession: d } =
|
|
7183
|
-
|
|
7184
|
-
|
|
7185
|
-
}, [h.locale]),
|
|
7278
|
+
const { sessionId: n, visitorId: r, isLoading: i, sessionNotFound: o, resumeFailed: s, isOrgDeleted: l, ensureSession: a, startFresh: u, resetSession: d } = iu(t.orgSlug, t.projSlug), h = Ha(t, e);
|
|
7279
|
+
R(() => {
|
|
7280
|
+
In.value = Ji(h.locale);
|
|
7281
|
+
}, [h.locale]), R(() => {
|
|
7186
7282
|
if (!q.value || h.mode === "embedded" || !window.matchMedia("(max-width: 480px), (pointer: coarse) and (max-width: 768px)").matches)
|
|
7187
7283
|
return;
|
|
7188
|
-
const
|
|
7284
|
+
const T = document.documentElement.style.overflow;
|
|
7189
7285
|
return document.documentElement.style.overflow = "hidden", () => {
|
|
7190
|
-
document.documentElement.style.overflow =
|
|
7286
|
+
document.documentElement.style.overflow = T;
|
|
7191
7287
|
};
|
|
7192
|
-
}, [q.value, h.mode]),
|
|
7288
|
+
}, [q.value, h.mode]), R(() => {
|
|
7193
7289
|
if (h.mode !== "embedded")
|
|
7194
7290
|
try {
|
|
7195
|
-
return
|
|
7196
|
-
} catch (
|
|
7197
|
-
console.warn("[JexityChat] Idle-lock watcher failed to start:",
|
|
7291
|
+
return gl();
|
|
7292
|
+
} catch (T) {
|
|
7293
|
+
console.warn("[JexityChat] Idle-lock watcher failed to start:", T);
|
|
7198
7294
|
return;
|
|
7199
7295
|
}
|
|
7200
7296
|
}, [h.mode]);
|
|
7201
|
-
const p = h.position === "bottom-left", f = h.colorScheme === "dark" || h.colorScheme === "light" ? h.colorScheme : "", g =
|
|
7297
|
+
const p = h.position === "bottom-left", f = h.colorScheme === "dark" || h.colorScheme === "light" ? h.colorScheme : "", g = ml({
|
|
7202
7298
|
...t,
|
|
7203
7299
|
primaryColor: h.primaryColor,
|
|
7204
7300
|
accentColor: h.accentColor,
|
|
@@ -7215,15 +7311,15 @@ function Zc({ options: t }) {
|
|
|
7215
7311
|
style: v,
|
|
7216
7312
|
children: m ? /* @__PURE__ */ c("div", { class: "jex-embedded", children: [
|
|
7217
7313
|
/* @__PURE__ */ c(
|
|
7218
|
-
|
|
7314
|
+
Tr,
|
|
7219
7315
|
{
|
|
7220
7316
|
title: h.title,
|
|
7221
|
-
rightAction: y ? /* @__PURE__ */ c(
|
|
7317
|
+
rightAction: y ? /* @__PURE__ */ c(Ur, { sessionId: n, visitorId: r }) : null,
|
|
7222
7318
|
showClose: !m
|
|
7223
7319
|
}
|
|
7224
7320
|
),
|
|
7225
7321
|
/* @__PURE__ */ c(
|
|
7226
|
-
|
|
7322
|
+
Dr,
|
|
7227
7323
|
{
|
|
7228
7324
|
greeting: h.greeting,
|
|
7229
7325
|
title: h.title,
|
|
@@ -7240,18 +7336,18 @@ function Zc({ options: t }) {
|
|
|
7240
7336
|
resetSession: d
|
|
7241
7337
|
}
|
|
7242
7338
|
),
|
|
7243
|
-
!h.hideBranding && /* @__PURE__ */ c(
|
|
7339
|
+
!h.hideBranding && /* @__PURE__ */ c(Ar, {})
|
|
7244
7340
|
] }) : /* @__PURE__ */ c("div", { class: `jex-container${p ? " jex-pos-left" : ""}`, children: [
|
|
7245
7341
|
q.value && /* @__PURE__ */ c("div", { class: "jex-chat-window", children: [
|
|
7246
7342
|
/* @__PURE__ */ c(
|
|
7247
|
-
|
|
7343
|
+
Tr,
|
|
7248
7344
|
{
|
|
7249
7345
|
title: h.title,
|
|
7250
|
-
rightAction: y ? /* @__PURE__ */ c(
|
|
7346
|
+
rightAction: y ? /* @__PURE__ */ c(Ur, { sessionId: n, visitorId: r }) : null
|
|
7251
7347
|
}
|
|
7252
7348
|
),
|
|
7253
7349
|
/* @__PURE__ */ c(
|
|
7254
|
-
|
|
7350
|
+
Dr,
|
|
7255
7351
|
{
|
|
7256
7352
|
greeting: h.greeting,
|
|
7257
7353
|
title: h.title,
|
|
@@ -7268,10 +7364,10 @@ function Zc({ options: t }) {
|
|
|
7268
7364
|
resetSession: d
|
|
7269
7365
|
}
|
|
7270
7366
|
),
|
|
7271
|
-
!h.hideBranding && /* @__PURE__ */ c(
|
|
7367
|
+
!h.hideBranding && /* @__PURE__ */ c(Ar, {})
|
|
7272
7368
|
] }),
|
|
7273
7369
|
/* @__PURE__ */ c(
|
|
7274
|
-
|
|
7370
|
+
Sl,
|
|
7275
7371
|
{
|
|
7276
7372
|
iconOption: h.triggerIcon,
|
|
7277
7373
|
radius: h.triggerRadius,
|
|
@@ -7282,34 +7378,34 @@ function Zc({ options: t }) {
|
|
|
7282
7378
|
}
|
|
7283
7379
|
);
|
|
7284
7380
|
}
|
|
7285
|
-
const Gc = '.jex-widget{--jex-primary: #115A62;--jex-primary-hover: var(--jex-accent, color-mix(in srgb, var(--jex-primary) 85%, #000));--jex-radius: .75rem;--jex-font-family: "Inter", system-ui, -apple-system, sans-serif;--jex-font-size: 14px;--jex-window-width: 380px;--jex-window-height: 600px;--jex-shadow: 0 16px 48px -12px rgba(13, 127, 138, .25), 0 4px 16px rgba(0, 0, 0, .08);pointer-events:auto;--jex-bg-trigger: var(--jex-primary);--jex-bg-header: var(--jex-primary);--jex-bg-msg-user: var(--jex-primary);--jex-bg-send-btn: var(--jex-primary);--jex-bg-window: rgba(255, 255, 255, .95);--jex-bg-msg-bot: #f1f5f9;--jex-bg-input: rgba(247, 253, 253, .6);--jex-text-header: #ffffff;--jex-text-msg-user: #ffffff;--jex-text-msg-bot: #0f172a;--jex-text-main: #0f172a;--jex-text-muted: #64748b;--jex-bg-avatar-agent: #d1fae5;--jex-text-avatar-agent: #065f46;--jex-border-window: rgba(226, 232, 240, .8);--jex-border-input: rgba(203, 213, 225, .8);--jex-bg-glass: var(--jex-bg-window);--jex-border-glass: var(--jex-border-window);font-family:var(--jex-font-family);-webkit-font-smoothing:antialiased}.dark .jex-widget,.jex-widget.dark{--jex-primary: #1cb0bf;--jex-primary-hover: var(--jex-accent, color-mix(in srgb, var(--jex-primary) 85%, #000));--jex-bg-window: rgba(10, 15, 26, .95);--jex-bg-msg-bot: #233146;--jex-bg-input: rgba(10, 15, 26, .6);--jex-text-msg-bot: #f8fafc;--jex-text-main: #f8fafc;--jex-text-muted: #94a3b8;--jex-border-window: rgba(30, 41, 59, .8);--jex-border-input: rgba(51, 65, 85, .9);--jex-bg-avatar-agent: #064e3b;--jex-text-avatar-agent: #6ee7b7;--jex-bg-error: #3b1318;--jex-border-error: #5c1d24;--jex-text-error: #fca5a5}@media(prefers-color-scheme:dark){:host:not(.light) .jex-widget:not(.light){--jex-primary: #1cb0bf;--jex-primary-hover: var(--jex-accent, color-mix(in srgb, var(--jex-primary) 85%, #000));--jex-bg-window: rgba(10, 15, 26, .95);--jex-bg-msg-bot: #233146;--jex-bg-input: rgba(10, 15, 26, .6);--jex-text-msg-bot: #f8fafc;--jex-text-main: #f8fafc;--jex-text-muted: #94a3b8;--jex-border-window: rgba(30, 41, 59, .8);--jex-border-input: rgba(51, 65, 85, .9);--jex-bg-error: #3b1318;--jex-border-error: #5c1d24;--jex-text-error: #fca5a5}}.jex-widget *{box-sizing:border-box;margin:0;padding:0}.jex-container{position:fixed;bottom:24px;right:24px;display:flex;flex-direction:column;align-items:flex-end;gap:16px;z-index:9999}.jex-container.jex-pos-left{right:auto;left:24px;align-items:flex-start}:host(.jex-mode-embedded){display:block;width:100%;height:100%}:host(.jex-mode-embedded) .jex-widget{width:100%;height:100%}.jex-embedded{display:flex;flex-direction:column;width:100%;height:100%;background:var(--jex-bg-window);border:1px solid var(--jex-border-window);overflow:hidden}.jex-embedded .jex-screen-container{flex:1;overflow:hidden;display:flex;flex-direction:column}.jex-floating-button{height:56px;min-width:56px;padding:0;background:var(--jex-bg-trigger);color:var(--jex-text-header);border:none;cursor:pointer;display:flex;align-items:center;justify-content:center;box-shadow:var(--jex-shadow);transition:transform .3s cubic-bezier(.175,.885,.32,1.275),background .2s,width .3s ease,border-radius .3s ease}.jex-floating-button.jex-has-label{min-width:110px;padding:0 20px}.jex-fab-inner{display:flex;align-items:center;gap:12px}.jex-fab-label{font-size:15px;font-weight:600;white-space:nowrap}.jex-floating-button:hover{transform:scale(1.1);background:var(--jex-primary-hover)}.jex-floating-button:active{transform:scale(.95)}.jex-chat-window{width:var(--jex-window-width);height:var(--jex-window-height);max-height:calc(100vh - 120px);background:var(--jex-bg-window);backdrop-filter:blur(24px);-webkit-backdrop-filter:blur(24px);border:1px solid var(--jex-border-window);border-radius:calc(var(--jex-radius) * 2);box-shadow:var(--jex-shadow);display:flex;flex-direction:column;overflow:hidden;animation:jexSlideUp .4s cubic-bezier(.16,1,.3,1);transform-origin:bottom right;touch-action:manipulation}@keyframes jexSlideUp{0%{opacity:0;transform:scale(.8) translateY(20px)}to{opacity:1;transform:scale(1) translateY(0)}}@media(max-width:480px),(pointer:coarse)and (max-width:768px){.jex-chat-window{position:fixed;inset:0;width:100vw;height:100vh;height:100dvh;max-height:none;border:none;border-radius:0;animation:jexSlideUpMobile .3s cubic-bezier(.16,1,.3,1);transform-origin:bottom center}.jex-container:has(.jex-chat-window) .jex-floating-button{display:none}}@keyframes jexSlideUpMobile{0%{opacity:0;transform:translateY(100%)}to{opacity:1;transform:translateY(0)}}.jex-chat-header{padding:20px;background:var(--jex-bg-header);color:var(--jex-text-header);display:flex;align-items:center;gap:12px;flex-shrink:0}.jex-header-info h3{font-size:16px;font-weight:600;color:var(--jex-text-header);margin:0}.jex-header-info p{font-size:12px;opacity:.8;color:var(--jex-text-header);margin:0}.jex-header-right{margin-left:auto;display:flex;align-items:center;gap:4px}.jex-header-handoff{display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;background:transparent;border:1px solid color-mix(in srgb,currentColor 50%,transparent);border-radius:999px;padding:0;color:inherit;cursor:pointer;transition:background .15s ease,border-color .15s ease}.jex-header-handoff:hover:not(:disabled){background:color-mix(in srgb,currentColor 12%,transparent);border-color:currentColor}.jex-header-handoff:disabled{opacity:.5;cursor:not-allowed}.jex-header-close{display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;background:transparent;border:none;border-radius:999px;padding:0;color:inherit;cursor:pointer;transition:background .15s ease}.jex-header-close:hover{background:color-mix(in srgb,currentColor 14%,transparent)}.jex-handoff-error{position:absolute;top:100%;right:8px;background:#fee;color:#b00;padding:4px 8px;font-size:12px;border-radius:4px}.jex-header-back{background:none;border:none;color:var(--jex-text-header);cursor:pointer;padding:4px;display:flex;align-items:center;opacity:.8;transition:opacity .2s;flex-shrink:0}.jex-header-back:hover{opacity:1}.jex-screen-container{flex:1;overflow:hidden;display:flex;flex-direction:column}.jex-home{flex:1;display:flex;flex-direction:column;padding:24px;gap:20px;overflow-y:auto}.jex-home-hero{display:flex;align-items:center;gap:14px;animation:jexFadeIn .4s ease both}.jex-home-avatar{position:relative;width:48px;height:48px;border-radius:14px;background:var(--jex-primary);color:var(--jex-text-header);display:flex;align-items:center;justify-content:center;flex-shrink:0;box-shadow:0 4px 12px color-mix(in srgb,var(--jex-primary) 30%,transparent)}.jex-home-status-dot{position:absolute;bottom:-2px;right:-2px;width:14px;height:14px;border-radius:50%;background:#22c55e;border:2.5px solid var(--jex-bg-window);animation:jexPulse 2s ease-in-out infinite}@keyframes jexPulse{0%,to{box-shadow:0 0 #22c55e66}50%{box-shadow:0 0 0 6px #22c55e00}}.jex-home-hero-text{display:flex;flex-direction:column;gap:2px;min-width:0}.jex-home-title{font-size:17px;font-weight:700;color:var(--jex-text-main);margin:0;line-height:1.2;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.jex-home-status{font-size:12px;font-weight:500;color:#22c55e;letter-spacing:.02em}.jex-home-greeting{background:var(--jex-bg-msg-bot);border:1px solid var(--jex-border-window);border-radius:4px 16px 16px;padding:16px 18px;font-size:14px;line-height:1.55;color:var(--jex-text-main);animation:jexFadeIn .4s .1s ease both}.jex-home-greeting p{margin:0}@keyframes jexFadeIn{0%{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}.jex-home-actions{display:flex;flex-direction:column;gap:10px;animation:jexFadeIn .4s .2s ease both}.jex-home-start-btn{background:var(--jex-bg-send-btn);color:var(--jex-text-header);border:none;border-radius:12px;padding:14px 20px;font-size:15px;font-weight:600;cursor:pointer;font-family:inherit;transition:background .2s,transform .15s,box-shadow .2s;width:100%;box-shadow:0 2px 8px color-mix(in srgb,var(--jex-primary) 25%,transparent)}.jex-home-start-btn:hover{background:var(--jex-primary-hover);transform:translateY(-1px);box-shadow:0 4px 16px color-mix(in srgb,var(--jex-primary) 35%,transparent)}.jex-home-start-btn:active{transform:translateY(0);box-shadow:0 1px 4px color-mix(in srgb,var(--jex-primary) 20%,transparent)}.jex-home-resume-card{display:flex;flex-direction:column;gap:8px;width:100%;text-align:left;padding:16px 18px;border-radius:14px;border:1.5px solid var(--jex-primary);background:color-mix(in srgb,var(--jex-primary) 6%,var(--jex-bg-window));cursor:pointer;font-family:inherit;transition:background .2s,border-color .2s,transform .15s,box-shadow .2s;box-shadow:0 2px 8px color-mix(in srgb,var(--jex-primary) 12%,transparent)}.jex-home-resume-card:hover{background:color-mix(in srgb,var(--jex-primary) 10%,var(--jex-bg-window));transform:translateY(-1px);box-shadow:0 4px 16px color-mix(in srgb,var(--jex-primary) 20%,transparent)}.jex-home-resume-card:active{transform:translateY(0)}.jex-home-resume-top{display:flex;align-items:center;justify-content:space-between}.jex-home-resume-label{font-size:14px;font-weight:600;color:var(--jex-primary)}.jex-home-resume-arrow{color:var(--jex-primary);opacity:.6;transition:opacity .2s,transform .2s}.jex-home-resume-card:hover .jex-home-resume-arrow{opacity:1;transform:translate(2px)}.jex-home-resume-ref{font-family:ui-monospace,Cascadia Code,Fira Code,monospace;font-size:13px;font-weight:600;letter-spacing:.06em;color:var(--jex-text-muted)}.jex-home-history{display:flex;flex-direction:column;gap:8px}.jex-home-resume-meta{font-size:11px;opacity:.7;margin-top:4px}.jex-home-new-btn{background:transparent;color:var(--jex-text-muted);border:1px solid var(--jex-border-input);border-radius:12px;padding:12px 20px;font-size:14px;font-weight:500;cursor:pointer;font-family:inherit;transition:color .2s,border-color .2s,background .2s;width:100%}.jex-home-new-btn:hover{color:var(--jex-text-main);border-color:var(--jex-text-muted);background:color-mix(in srgb,var(--jex-primary) 3%,transparent)}.jex-session-ref{display:flex;align-items:center;gap:8px;padding:8px 12px;background:var(--jex-bg-msg-bot);border:1px solid var(--jex-border-window);border-radius:8px;font-size:12px}.jex-session-ref-label{color:var(--jex-text-muted);font-weight:500}.jex-session-ref-code{color:var(--jex-primary);font-weight:700;font-family:ui-monospace,Cascadia Code,monospace;letter-spacing:.05em}.jex-chat-messages{flex:1;padding:20px;overflow-y:auto;display:flex;flex-direction:column;gap:12px}.jex-message-row{display:flex;align-items:flex-end;gap:8px;max-width:85%}.jex-message-row.bot{align-self:flex-start}.jex-message-content{flex:1;min-width:0}.jex-avatar{width:24px;height:24px;border-radius:50%;flex-shrink:0;display:flex;align-items:center;justify-content:center;font-size:12px;margin-bottom:2px}.jex-avatar-bot{background:var(--jex-bg-msg-bot);color:var(--jex-primary)}.jex-avatar-agent{background:var(--jex-bg-avatar-agent)}.jex-avatar-img{width:100%;height:100%;border-radius:50%;object-fit:cover}.jex-avatar-initials{font-size:9px;font-weight:700;color:var(--jex-text-avatar-agent)}.jex-message-author-row{display:flex;align-items:center;gap:6px;margin-top:2px;padding-left:4px}.jex-message-author{font-size:10px;color:var(--jex-text-muted)}.jex-reply-tag-btn{display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;padding:0;border:none;border-radius:4px;background:transparent;color:var(--jex-text-muted, #6b7280);cursor:pointer;transition:background .15s,color .15s}.jex-reply-tag-btn:hover{background:#0000000f;color:var(--jex-primary, #115A62)}.jex-reply-tag-btn:focus-visible{outline:2px solid var(--jex-primary, #115A62);outline-offset:1px}.jex-message{padding:12px 16px;border-radius:18px;font-size:14px;line-height:1.4}.jex-message.bot{background:var(--jex-bg-msg-bot);border:1px solid var(--jex-border-window);color:var(--jex-text-msg-bot);border-bottom-left-radius:4px}.jex-message.user{align-self:flex-end;max-width:80%;background:var(--jex-bg-msg-user);color:var(--jex-text-msg-user);border-bottom-right-radius:4px}.jex-typing{align-self:flex-start;display:flex;gap:4px;padding:12px 16px}.jex-typing span{width:8px;height:8px;border-radius:50%;background:var(--jex-text-muted);animation:jexTypingDot 1.2s infinite ease-in-out}.jex-typing span:nth-child(2){animation-delay:.2s}.jex-typing span:nth-child(3){animation-delay:.4s}@keyframes jexTypingDot{0%,80%,to{transform:scale(.8);opacity:.4}40%{transform:scale(1);opacity:1}}.jex-md{word-break:break-word;overflow-wrap:anywhere}.jex-md p{margin:0 0 8px}.jex-md p:last-child{margin-bottom:0}.jex-md strong{font-weight:600}.jex-md em{font-style:italic}.jex-md ul,.jex-md ol{margin:0 0 8px;padding-left:20px}.jex-md ul:last-child,.jex-md ol:last-child{margin-bottom:0}.jex-md ul{list-style-type:disc}.jex-md ol{list-style-type:decimal}.jex-md li{margin-bottom:2px}.jex-md li:last-child{margin-bottom:0}.jex-md a{color:var(--jex-primary);text-decoration:underline;text-underline-offset:2px}.jex-md a:hover{opacity:.8}.jex-md code{background:#00000014;padding:1px 5px;border-radius:4px;font-size:.9em;font-family:ui-monospace,Cascadia Code,Fira Code,monospace}.jex-md pre{background:#0000000f;border-radius:8px;padding:10px 12px;margin:0 0 8px;overflow-x:auto;font-size:.85em}.jex-md pre:last-child{margin-bottom:0}.jex-md pre code{background:none;padding:0;border-radius:0;font-size:inherit}.jex-md h1,.jex-md h2,.jex-md h3,.jex-md h4{font-weight:600;margin:8px 0 4px}.jex-md h1:first-child,.jex-md h2:first-child,.jex-md h3:first-child,.jex-md h4:first-child{margin-top:0}.jex-md h3{font-size:1em}.jex-md h4{font-size:.95em}.jex-md hr{border:none;border-top:1px solid var(--jex-border-window);margin:8px 0}.jex-md blockquote{border-left:3px solid var(--jex-primary);margin:0 0 8px;padding:4px 12px;color:var(--jex-text-muted)}.jex-md blockquote:last-child{margin-bottom:0}.dark .jex-md code,.jex-widget.dark .jex-md code{background:#ffffff1a}.dark .jex-md pre,.jex-widget.dark .jex-md pre{background:#ffffff14}@media(prefers-color-scheme:dark){:host:not(.light) .jex-widget:not(.light) .jex-md code{background:#ffffff1a}:host:not(.light) .jex-widget:not(.light) .jex-md pre{background:#ffffff14}}.jex-streaming-cursor:after{content:"◊";margin-left:2px;animation:jexBlinkCursor .8s ease-in-out infinite}@keyframes jexBlinkCursor{0%,to{opacity:1}50%{opacity:0}}.jex-session-notice{align-self:center;text-align:center;padding:8px 16px;margin:8px 0;font-size:12px;color:var(--jex-text-muted);background:var(--jex-bg-input, #f1f5f9);border-radius:8px;line-height:1.4}.jex-message-error{background:var(--jex-bg-error, #fef2f2)!important;border-color:var(--jex-border-error, #fecaca)!important;color:var(--jex-text-error, #991b1b)!important}.jex-chat-input{padding:12px 16px;border-top:1px solid var(--jex-border-window);display:flex;flex-direction:column;gap:8px;flex-shrink:0}.jex-composer-card{display:flex;flex-direction:column;gap:6px;padding:10px 12px 8px;background:var(--jex-bg-input);border:1px solid var(--jex-border-input);border-radius:16px;cursor:text;transition:border-color .15s ease,background .15s ease,box-shadow .15s ease}.jex-composer-card:focus-within{border-color:var(--jex-primary);background:var(--jex-bg-window);box-shadow:0 0 0 3px color-mix(in srgb,var(--jex-primary, #115A62) 14%,transparent)}.jex-composer-attachments{display:flex;flex-wrap:wrap;gap:6px;padding:2px 2px 4px}.jex-attachment-chip{position:relative;width:44px;height:44px;border-radius:8px;overflow:hidden;background:var(--jex-bg-msg-bot, #f1f5f9);flex-shrink:0;box-shadow:0 1px 2px #0000000f}.jex-attachment-thumb{width:100%;height:100%;object-fit:cover;display:block;pointer-events:none}.jex-attachment-remove{position:absolute;top:2px;right:2px;width:16px;height:16px;padding:0;border:none;border-radius:50%;background:#0f172ac7;color:#fff;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;opacity:0;transition:opacity .12s ease,transform .12s ease}.jex-attachment-chip:hover .jex-attachment-remove,.jex-attachment-chip:focus-within .jex-attachment-remove{opacity:1}.jex-attachment-remove:hover{transform:scale(1.08)}.jex-composer-textarea{width:100%;min-height:22px;background:transparent;border:none;outline:none;resize:none;padding:2px 4px;color:var(--jex-text-main);font-family:inherit;font-size:16px;line-height:1.45;overflow-y:hidden}.jex-composer-textarea::placeholder{color:var(--jex-text-muted);opacity:.85}.jex-composer-textarea:disabled{cursor:not-allowed;opacity:.7}.jex-composer-actions{display:flex;align-items:center;justify-content:space-between;gap:8px}.jex-composer-actions-left{display:inline-flex;align-items:center;gap:4px}.jex-attach-btn{width:30px;height:30px;padding:0;border:none;border-radius:50%;background:transparent;color:var(--jex-text-muted);display:inline-flex;align-items:center;justify-content:center;cursor:pointer;transition:background .12s ease,color .12s ease,transform .12s ease}.jex-attach-btn:hover:not(:disabled){background:color-mix(in srgb,var(--jex-text-muted, #64748b) 12%,transparent);color:var(--jex-text-main)}.jex-attach-btn:active:not(:disabled){transform:scale(.92)}.jex-attach-btn:disabled{opacity:.4;cursor:not-allowed}.jex-visually-hidden{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.jex-rate-limit-notice{flex:1 0 100%;order:-1;margin-bottom:8px;padding:8px 12px;border-radius:10px;background:var(--jex-bg-msg-bot, #f1f5f9);color:var(--jex-text-muted, #64748b);font-size:12px;line-height:1.4;text-align:center}.jex-session-error-notice{flex:1 0 100%;order:-1;margin-bottom:8px;padding:8px 12px;border-radius:10px;background:var(--jex-bg-error, #fef2f2);border:1px solid var(--jex-border-error, #fecaca);color:var(--jex-text-error, #991b1b);font-size:12px;line-height:1.4;text-align:center}.jex-chat-input input{flex:1;background:var(--jex-bg-input);border:1px solid var(--jex-border-input);border-radius:12px;padding:10px 14px;color:var(--jex-text-main);outline:none;font-family:inherit;font-size:14px}.jex-chat-input input:focus{border-color:var(--jex-primary)}.jex-send-btn{background:color-mix(in srgb,var(--jex-text-muted, #64748b) 18%,transparent);color:var(--jex-text-muted);border:none;border-radius:999px;width:30px;height:30px;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;transition:background .15s ease,color .15s ease,opacity .15s ease,transform .15s ease;flex-shrink:0}.jex-send-btn-active{background:var(--jex-bg-send-btn, var(--jex-primary));color:var(--jex-text-header, #fff)}.jex-send-btn-active:hover:not(:disabled){background:var(--jex-primary-hover)}.jex-send-btn:active:not(:disabled){transform:scale(.9)}.jex-send-btn:disabled{opacity:.45;cursor:default}.jex-widget-footer{display:flex;align-items:center;justify-content:center;padding:8px 16px;border-top:1px solid var(--jex-border-glass);background:#00000005;flex-shrink:0}.jex-widget.dark .jex-widget-footer{background:#ffffff05}@media(prefers-color-scheme:dark){:host:not(.light) .jex-widget:not(.light) .jex-widget-footer{background:#ffffff05}}.jex-branding{display:flex;align-items:center;gap:6px;text-decoration:none;color:var(--jex-text-muted);font-size:11px;font-weight:500;transition:color .2s}.jex-branding:hover{color:var(--jex-text-main)}.jex-branding-icon{color:var(--jex-primary)}.jex-branding span strong{font-weight:700;color:var(--jex-text-main)}.jex-locale-select-wrapper{position:relative;display:flex;align-items:center}.jex-locale-select{appearance:none;-webkit-appearance:none;background:transparent;border:1px solid transparent;padding:4px 20px 4px 6px;border-radius:6px;font-family:inherit;font-size:11px;font-weight:600;color:var(--jex-text-muted);background-color:transparent;cursor:pointer;outline:none;transition:all .2s ease}.jex-locale-select option{background-color:#fff;color:#0f172a}.jex-locale-select:hover,.jex-locale-select:focus-visible{color:var(--jex-text-main);background:#0000000a}.jex-widget.dark .jex-locale-select:hover,.jex-widget.dark .jex-locale-select:focus-visible{background:#ffffff0d}.jex-widget.dark .jex-locale-select option{background-color:#0f172a;color:#f8fafc}@media(prefers-color-scheme:dark){:host:not(.light) .jex-widget:not(.light) .jex-locale-select:hover,:host:not(.light) .jex-widget:not(.light) .jex-locale-select:focus-visible{background:#ffffff0d}:host:not(.light) .jex-widget:not(.light) .jex-locale-select option{background-color:#0f172a;color:#f8fafc}}.jex-locale-select:focus-visible{border-color:var(--jex-primary)}.jex-locale-chevron{position:absolute;right:4px;pointer-events:none;color:var(--jex-text-muted);transition:color .2s ease}.jex-locale-select-wrapper:hover .jex-locale-chevron{color:var(--jex-text-main)}.jex-overlay{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;background:var(--jex-bg-window, #fff);z-index:10;padding:24px;text-align:center}.jex-loading-spinner{width:32px;height:32px;border:3px solid var(--jex-border-input, #e2e8f0);border-top-color:var(--jex-primary, #115A62);border-radius:50%;animation:jex-spin .7s linear infinite}@keyframes jex-spin{to{transform:rotate(360deg)}}.jex-loading-message{font-size:14px;color:var(--jex-text-muted, #64748b)}.jex-error-message{font-size:14px;color:var(--jex-text-main, #334155)}.jex-error-actions{display:flex;gap:8px}.jex-error-retry,.jex-error-back{padding:8px 16px;border-radius:8px;font-size:13px;font-weight:600;cursor:pointer;border:none}.jex-error-retry{background:var(--jex-primary, #115A62);color:#fff}.jex-error-back{background:transparent;color:var(--jex-text-muted, #64748b);border:1px solid var(--jex-border-input, #e2e8f0)}.jex-selection{display:flex;flex-direction:column;gap:12px;padding:24px 16px;height:100%}.jex-selection-title{font-size:16px;font-weight:700;color:var(--jex-text-main, #0f172a);margin:0 0 8px}.jex-selection-options{display:flex;flex-direction:column;gap:10px}.jex-selection-option{display:flex;flex-direction:column;align-items:flex-start;gap:2px;padding:16px;border-radius:12px;border:1px solid var(--jex-border-window, #e2e8f0);background:transparent;cursor:pointer;text-align:left;transition:border-color .15s ease,background .15s ease}.jex-selection-option:hover{border-color:var(--jex-primary, #115A62);background:color-mix(in srgb,var(--jex-primary, #115A62) 5%,transparent)}.jex-selection-icon{font-size:20px}.jex-selection-label{font-size:14px;font-weight:600;color:var(--jex-text-main, #0f172a)}.jex-selection-sub{font-size:12px;color:var(--jex-text-muted, #64748b)}.jex-form-screen{display:flex;flex-direction:column;padding:20px 16px;height:100%;overflow-y:auto}.jex-form-title{font-size:16px;font-weight:700;color:var(--jex-text-main, #0f172a);margin:0 0 16px}.jex-form{display:flex;flex-direction:column;gap:10px}.jex-form-input,.jex-form-textarea{padding:10px 12px;border-radius:8px;border:1px solid var(--jex-border-input, #e2e8f0);font-size:14px;background:transparent;color:var(--jex-text-main, #0f172a);outline:none}@media(pointer:coarse){.jex-form-input,.jex-form-textarea{font-size:16px}}.jex-form-input:focus,.jex-form-textarea:focus{border-color:var(--jex-primary, #115A62)}.jex-form-textarea{min-height:80px;resize:vertical}.jex-form-submit{padding:10px;border-radius:8px;border:none;background:var(--jex-primary, #115A62);color:#fff;font-size:14px;font-weight:600;cursor:pointer;margin-top:4px}.jex-inline-form{display:flex;flex-direction:column;gap:8px;padding:12px;background:var(--jex-bg-msg-bot, #f1f5f9);border:1px solid var(--jex-border-input, #e2e8f0);border-radius:var(--jex-radius, .75rem);width:100%}.jex-inline-form-title{font-weight:600;font-size:15px;color:var(--jex-text-main, #0f172a);margin:0}.jex-inline-form-subtitle{font-size:13px;color:var(--jex-text-muted, #64748b);line-height:1.4;margin:0 0 4px}.jex-inline-form-consent{font-size:11px;color:var(--jex-text-muted, #64748b);line-height:1.3;margin-top:4px;text-align:center}.jex-inline-form .jex-form-submit:disabled{opacity:.7;cursor:not-allowed}.jex-escalation-subtitle{font-size:13px;color:var(--jex-text-muted, #64748b);line-height:1.45;margin:0 0 8px}.jex-escalation-skip{padding:8px 12px;border:none;background:transparent;color:var(--jex-text-muted, #64748b);font-size:13px;cursor:pointer;text-decoration:underline;text-underline-offset:2px;text-align:center}.jex-escalation-skip:hover{color:var(--jex-text-main, #0f172a)}.jex-inline-form-card{position:relative;padding:14px;gap:8px}.jex-inline-form-dismiss{position:absolute;top:10px;right:10px;width:24px;height:24px;border-radius:50%;border:1px solid var(--jex-border-input, #e2e8f0);background:var(--jex-bg-window, #fff);color:var(--jex-text-muted, #64748b);font-size:12px;cursor:pointer;display:flex;align-items:center;justify-content:center;line-height:1}.jex-inline-form-dismiss:hover{background:var(--jex-bg-msg-bot, #f1f5f9);color:var(--jex-text-main, #0f172a)}.jex-inline-form-submitted{display:flex;align-items:center;gap:10px;padding:10px 12px;background:var(--jex-bg-msg-bot, #f1f5f9);border:1px solid var(--jex-border-input, #e2e8f0);border-radius:var(--jex-radius, .75rem);width:100%}.jex-inline-form-check{display:flex;align-items:center;justify-content:center;width:24px;height:24px;border-radius:50%;background:color-mix(in srgb,var(--jex-primary) 15%,transparent);color:var(--jex-primary, #115A62);font-size:14px;font-weight:700;flex-shrink:0}.jex-inline-form-submitted-title{font-weight:600;font-size:var(--jex-font-size, 14px);color:var(--jex-text-main, #0f172a)}.jex-inline-form-submitted-detail{font-size:12px;color:var(--jex-text-muted, #64748b);margin-top:2px}.jex-escalation-confirm{border-left:3px solid var(--jex-primary, #115A62);padding-left:8px}.jex-session-prompt{display:flex;flex-direction:column;align-items:center;gap:8px;padding:12px 16px;margin:8px 0;text-align:center}.jex-session-prompt-text{font-size:13px;color:var(--jex-text-muted, #64748b)}.jex-session-prompt-btn{padding:8px 16px;border-radius:8px;border:1px solid var(--jex-primary, #115A62);background:transparent;color:var(--jex-primary, #115A62);font-size:13px;font-weight:600;cursor:pointer}.jex-session-prompt-btn:hover{background:color-mix(in srgb,var(--jex-primary) 10%,transparent)}.jex-chat-input-resolved{display:flex;flex-direction:column;align-items:center;gap:10px;padding:14px 16px;border-top:1px solid var(--jex-border-input, #e2e8f0);background:var(--jex-bg-msg-bot, #f1f5f9);text-align:center}.jex-resolved-notice{font-size:13px;font-weight:500;color:var(--jex-text-muted, #64748b)}.jex-resolved-new-btn{padding:10px 20px;border-radius:8px;border:none;background:var(--jex-primary, #115A62);color:#fff;font-size:13px;font-weight:600;cursor:pointer;width:100%}.jex-resolved-new-btn:hover{opacity:.9}.jex-confirmation{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;padding:32px 24px;height:100%;text-align:center}.jex-confirmation-icon{width:48px;height:48px;border-radius:50%;background:color-mix(in srgb,var(--jex-primary, #115A62) 15%,transparent);color:var(--jex-primary, #115A62);font-size:22px;display:flex;align-items:center;justify-content:center}.jex-confirmation-title{font-size:18px;font-weight:700;color:var(--jex-text-main, #0f172a);margin:0}.jex-confirmation-body{font-size:13px;color:var(--jex-text-muted, #64748b);margin:0}.jex-confirmation-ref{font-size:20px;font-weight:700;letter-spacing:.05em;color:var(--jex-primary, #115A62);background:color-mix(in srgb,var(--jex-primary, #115A62) 10%,transparent);padding:10px 20px;border-radius:10px}.jex-confirmation-hint{font-size:12px;color:var(--jex-text-muted, #64748b);margin:0}.jex-confirmation-done{margin-top:8px;padding:10px 28px;border-radius:8px;border:none;background:var(--jex-primary, #115A62);color:#fff;font-size:14px;font-weight:600;cursor:pointer}.jex-home-lookup-link{background:none;border:none;font-size:12px;color:var(--jex-text-muted, #64748b);cursor:pointer;text-decoration:underline;padding:0;align-self:center}.jex-home-lookup{display:flex;gap:8px;width:100%;animation:jexFadeIn .4s .1s ease both}.jex-home-lookup-input{flex:1;padding:10px 14px;border-radius:10px;border:1px solid var(--jex-border-input, #e2e8f0);background:var(--jex-bg-input);color:var(--jex-text-main);font-size:14px;font-family:ui-monospace,Cascadia Code,Fira Code,monospace;letter-spacing:.04em;outline:none;transition:border-color .2s}@media(pointer:coarse){.jex-home-lookup-input{font-size:16px}}.jex-home-lookup-input::placeholder{font-family:inherit;letter-spacing:.04em;color:var(--jex-text-muted);opacity:.7}.jex-home-lookup-input:focus{border-color:var(--jex-primary, #115A62)}.jex-home-lookup-submit{padding:10px 16px;border-radius:10px;border:none;background:var(--jex-primary, #115A62);color:#fff;font-size:13px;font-weight:600;cursor:pointer;font-family:inherit;transition:background .2s,opacity .2s;flex-shrink:0}.jex-home-lookup-submit:hover:not(:disabled){background:var(--jex-primary-hover)}.jex-home-lookup-submit:disabled{opacity:.4;cursor:default}.jex-sources-row{margin-top:6px;margin-left:32px;display:flex;flex-direction:column;gap:6px}.jex-sources-toggle{display:inline-flex;align-items:center;gap:4px;padding:2px 8px;background:transparent;border:none;border-radius:6px;cursor:pointer;font-size:11px;color:var(--jex-text-muted, #6b7280);font-family:inherit;align-self:flex-start;transition:background .15s,color .15s}.jex-sources-toggle:hover{background:#0000000a;color:inherit}.jex-sources-icon{font-size:12px;line-height:1}.jex-sources-chevron{display:inline-block;font-size:10px;transition:transform .15s}.jex-sources-chevron--open{transform:rotate(180deg)}.jex-sources-pills{display:flex;flex-wrap:wrap;align-items:center;gap:6px}.jex-source-pill{display:inline-flex;align-items:center;gap:6px;max-width:240px;padding:2px 8px;border-radius:999px;border:1px solid rgba(0,0,0,.1);background:#0000000a;color:var(--jex-text-muted, #6b7280);font-size:11px;text-decoration:none;cursor:pointer;transition:background .15s,color .15s}.jex-source-pill:hover{background:#00000014;color:inherit}.jex-source-id{display:inline-flex;align-items:center;justify-content:center;min-width:16px;height:16px;padding:0 4px;border-radius:4px;background:var(--jex-primary, #115A62);color:#fff;font-size:10px;font-weight:600;line-height:1;flex-shrink:0;font-variant-numeric:tabular-nums}.jex-source-type{font-size:10px;flex-shrink:0}.jex-source-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:500}.jex-source-score{opacity:.6;flex-shrink:0;font-variant-numeric:tabular-nums}';
|
|
7286
|
-
function
|
|
7381
|
+
const uu = '.jex-widget{--jex-primary: #115A62;--jex-primary-hover: var(--jex-accent, color-mix(in srgb, var(--jex-primary) 85%, #000));--jex-radius: .75rem;--jex-font-family: "Inter", system-ui, -apple-system, sans-serif;--jex-font-size: 14px;--jex-window-width: 380px;--jex-window-height: 600px;--jex-shadow: 0 16px 48px -12px rgba(13, 127, 138, .25), 0 4px 16px rgba(0, 0, 0, .08);pointer-events:auto;--jex-bg-trigger: var(--jex-primary);--jex-bg-header: var(--jex-primary);--jex-bg-msg-user: var(--jex-primary);--jex-bg-send-btn: var(--jex-primary);--jex-bg-window: rgba(255, 255, 255, .95);--jex-bg-msg-bot: #f1f5f9;--jex-bg-input: rgba(247, 253, 253, .6);--jex-text-header: #ffffff;--jex-text-msg-user: #ffffff;--jex-text-msg-bot: #0f172a;--jex-text-main: #0f172a;--jex-text-muted: #64748b;--jex-bg-avatar-agent: #d1fae5;--jex-text-avatar-agent: #065f46;--jex-border-window: rgba(226, 232, 240, .8);--jex-border-input: rgba(203, 213, 225, .8);--jex-bg-glass: var(--jex-bg-window);--jex-border-glass: var(--jex-border-window);font-family:var(--jex-font-family);-webkit-font-smoothing:antialiased}.dark .jex-widget,.jex-widget.dark{--jex-primary: #1cb0bf;--jex-primary-hover: var(--jex-accent, color-mix(in srgb, var(--jex-primary) 85%, #000));--jex-bg-window: rgba(10, 15, 26, .95);--jex-bg-msg-bot: #233146;--jex-bg-input: rgba(10, 15, 26, .6);--jex-text-msg-bot: #f8fafc;--jex-text-main: #f8fafc;--jex-text-muted: #94a3b8;--jex-border-window: rgba(30, 41, 59, .8);--jex-border-input: rgba(51, 65, 85, .9);--jex-bg-avatar-agent: #064e3b;--jex-text-avatar-agent: #6ee7b7;--jex-bg-error: #3b1318;--jex-border-error: #5c1d24;--jex-text-error: #fca5a5}@media(prefers-color-scheme:dark){:host:not(.light) .jex-widget:not(.light){--jex-primary: #1cb0bf;--jex-primary-hover: var(--jex-accent, color-mix(in srgb, var(--jex-primary) 85%, #000));--jex-bg-window: rgba(10, 15, 26, .95);--jex-bg-msg-bot: #233146;--jex-bg-input: rgba(10, 15, 26, .6);--jex-text-msg-bot: #f8fafc;--jex-text-main: #f8fafc;--jex-text-muted: #94a3b8;--jex-border-window: rgba(30, 41, 59, .8);--jex-border-input: rgba(51, 65, 85, .9);--jex-bg-error: #3b1318;--jex-border-error: #5c1d24;--jex-text-error: #fca5a5}}.jex-widget *{box-sizing:border-box;margin:0;padding:0}.jex-container{position:fixed;bottom:24px;right:24px;display:flex;flex-direction:column;align-items:flex-end;gap:16px;z-index:9999}.jex-container.jex-pos-left{right:auto;left:24px;align-items:flex-start}:host(.jex-mode-embedded){display:block;width:100%;height:100%}:host(.jex-mode-embedded) .jex-widget{width:100%;height:100%}.jex-embedded{display:flex;flex-direction:column;width:100%;height:100%;background:var(--jex-bg-window);border:1px solid var(--jex-border-window);overflow:hidden}.jex-embedded .jex-screen-container{flex:1;overflow:hidden;display:flex;flex-direction:column}.jex-floating-button{height:56px;min-width:56px;padding:0;background:var(--jex-bg-trigger);color:var(--jex-text-header);border:none;cursor:pointer;display:flex;align-items:center;justify-content:center;box-shadow:var(--jex-shadow);transition:transform .3s cubic-bezier(.175,.885,.32,1.275),background .2s,width .3s ease,border-radius .3s ease}.jex-floating-button.jex-has-label{min-width:110px;padding:0 20px}.jex-fab-inner{display:flex;align-items:center;gap:12px}.jex-fab-label{font-size:15px;font-weight:600;white-space:nowrap}.jex-floating-button:hover{transform:scale(1.1);background:var(--jex-primary-hover)}.jex-floating-button:active{transform:scale(.95)}.jex-chat-window{width:var(--jex-window-width);height:var(--jex-window-height);max-height:calc(100vh - 120px);background:var(--jex-bg-window);backdrop-filter:blur(24px);-webkit-backdrop-filter:blur(24px);border:1px solid var(--jex-border-window);border-radius:calc(var(--jex-radius) * 2);box-shadow:var(--jex-shadow);display:flex;flex-direction:column;overflow:hidden;animation:jexSlideUp .4s cubic-bezier(.16,1,.3,1);transform-origin:bottom right;touch-action:manipulation}@keyframes jexSlideUp{0%{opacity:0;transform:scale(.8) translateY(20px)}to{opacity:1;transform:scale(1) translateY(0)}}@media(max-width:480px),(pointer:coarse)and (max-width:768px){.jex-chat-window{position:fixed;inset:0;width:100vw;height:100vh;height:100dvh;max-height:none;border:none;border-radius:0;animation:jexSlideUpMobile .3s cubic-bezier(.16,1,.3,1);transform-origin:bottom center}.jex-container:has(.jex-chat-window) .jex-floating-button{display:none}}@keyframes jexSlideUpMobile{0%{opacity:0;transform:translateY(100%)}to{opacity:1;transform:translateY(0)}}.jex-chat-header{padding:20px;background:var(--jex-bg-header);color:var(--jex-text-header);display:flex;align-items:center;gap:12px;flex-shrink:0}.jex-header-info h3{font-size:16px;font-weight:600;color:var(--jex-text-header);margin:0}.jex-header-info p{font-size:12px;opacity:.8;color:var(--jex-text-header);margin:0}.jex-header-right{margin-left:auto;display:flex;align-items:center;gap:4px}.jex-header-handoff{display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;background:transparent;border:1px solid color-mix(in srgb,currentColor 50%,transparent);border-radius:999px;padding:0;color:inherit;cursor:pointer;transition:background .15s ease,border-color .15s ease}.jex-header-handoff:hover:not(:disabled){background:color-mix(in srgb,currentColor 12%,transparent);border-color:currentColor}.jex-header-handoff:disabled{opacity:.5;cursor:not-allowed}.jex-header-close{display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;background:transparent;border:none;border-radius:999px;padding:0;color:inherit;cursor:pointer;transition:background .15s ease}.jex-header-close:hover{background:color-mix(in srgb,currentColor 14%,transparent)}.jex-handoff-error{position:absolute;top:100%;right:8px;background:#fee;color:#b00;padding:4px 8px;font-size:12px;border-radius:4px}.jex-header-back{background:none;border:none;color:var(--jex-text-header);cursor:pointer;padding:4px;display:flex;align-items:center;opacity:.8;transition:opacity .2s;flex-shrink:0}.jex-header-back:hover{opacity:1}.jex-screen-container{flex:1;overflow:hidden;display:flex;flex-direction:column}.jex-home{flex:1;display:flex;flex-direction:column;padding:24px;gap:20px;overflow-y:auto}.jex-home-hero{display:flex;align-items:center;gap:14px;animation:jexFadeIn .4s ease both}.jex-home-avatar{position:relative;width:48px;height:48px;border-radius:14px;background:var(--jex-primary);color:var(--jex-text-header);display:flex;align-items:center;justify-content:center;flex-shrink:0;box-shadow:0 4px 12px color-mix(in srgb,var(--jex-primary) 30%,transparent)}.jex-home-status-dot{position:absolute;bottom:-2px;right:-2px;width:14px;height:14px;border-radius:50%;background:#22c55e;border:2.5px solid var(--jex-bg-window);animation:jexPulse 2s ease-in-out infinite}@keyframes jexPulse{0%,to{box-shadow:0 0 #22c55e66}50%{box-shadow:0 0 0 6px #22c55e00}}.jex-home-hero-text{display:flex;flex-direction:column;gap:2px;min-width:0}.jex-home-title{font-size:17px;font-weight:700;color:var(--jex-text-main);margin:0;line-height:1.2;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.jex-home-status{font-size:12px;font-weight:500;color:#22c55e;letter-spacing:.02em}.jex-home-greeting{background:var(--jex-bg-msg-bot);border:1px solid var(--jex-border-window);border-radius:4px 16px 16px;padding:16px 18px;font-size:14px;line-height:1.55;color:var(--jex-text-main);animation:jexFadeIn .4s .1s ease both}.jex-home-greeting p{margin:0}@keyframes jexFadeIn{0%{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}.jex-home-actions{display:flex;flex-direction:column;gap:10px;animation:jexFadeIn .4s .2s ease both}.jex-home-start-btn{background:var(--jex-bg-send-btn);color:var(--jex-text-header);border:none;border-radius:12px;padding:14px 20px;font-size:15px;font-weight:600;cursor:pointer;font-family:inherit;transition:background .2s,transform .15s,box-shadow .2s;width:100%;box-shadow:0 2px 8px color-mix(in srgb,var(--jex-primary) 25%,transparent)}.jex-home-start-btn:hover{background:var(--jex-primary-hover);transform:translateY(-1px);box-shadow:0 4px 16px color-mix(in srgb,var(--jex-primary) 35%,transparent)}.jex-home-start-btn:active{transform:translateY(0);box-shadow:0 1px 4px color-mix(in srgb,var(--jex-primary) 20%,transparent)}.jex-home-resume-card{display:flex;flex-direction:column;gap:8px;width:100%;text-align:left;padding:16px 18px;border-radius:14px;border:1.5px solid var(--jex-primary);background:color-mix(in srgb,var(--jex-primary) 6%,var(--jex-bg-window));cursor:pointer;font-family:inherit;transition:background .2s,border-color .2s,transform .15s,box-shadow .2s;box-shadow:0 2px 8px color-mix(in srgb,var(--jex-primary) 12%,transparent)}.jex-home-resume-card:hover{background:color-mix(in srgb,var(--jex-primary) 10%,var(--jex-bg-window));transform:translateY(-1px);box-shadow:0 4px 16px color-mix(in srgb,var(--jex-primary) 20%,transparent)}.jex-home-resume-card:active{transform:translateY(0)}.jex-home-resume-top{display:flex;align-items:center;justify-content:space-between}.jex-home-resume-label{font-size:14px;font-weight:600;color:var(--jex-primary)}.jex-home-resume-arrow{color:var(--jex-primary);opacity:.6;transition:opacity .2s,transform .2s}.jex-home-resume-card:hover .jex-home-resume-arrow{opacity:1;transform:translate(2px)}.jex-home-resume-ref{font-family:ui-monospace,Cascadia Code,Fira Code,monospace;font-size:13px;font-weight:600;letter-spacing:.06em;color:var(--jex-text-muted)}.jex-home-history{display:flex;flex-direction:column;gap:8px}.jex-home-resume-meta{font-size:11px;opacity:.7;margin-top:4px}.jex-home-new-btn{background:transparent;color:var(--jex-text-muted);border:1px solid var(--jex-border-input);border-radius:12px;padding:12px 20px;font-size:14px;font-weight:500;cursor:pointer;font-family:inherit;transition:color .2s,border-color .2s,background .2s;width:100%}.jex-home-new-btn:hover{color:var(--jex-text-main);border-color:var(--jex-text-muted);background:color-mix(in srgb,var(--jex-primary) 3%,transparent)}.jex-session-ref{display:flex;align-items:center;gap:8px;padding:8px 12px;background:var(--jex-bg-msg-bot);border:1px solid var(--jex-border-window);border-radius:8px;font-size:12px}.jex-session-ref-label{color:var(--jex-text-muted);font-weight:500}.jex-session-ref-code{color:var(--jex-primary);font-weight:700;font-family:ui-monospace,Cascadia Code,monospace;letter-spacing:.05em}.jex-chat-messages{flex:1;padding:20px;overflow-y:auto;display:flex;flex-direction:column;gap:12px}.jex-message-row{display:flex;align-items:flex-end;gap:8px;max-width:85%}.jex-message-row.bot{align-self:flex-start}.jex-message-content{flex:1;min-width:0}.jex-avatar{width:24px;height:24px;border-radius:50%;flex-shrink:0;display:flex;align-items:center;justify-content:center;font-size:12px;margin-bottom:2px}.jex-avatar-bot{background:var(--jex-bg-msg-bot);color:var(--jex-primary)}.jex-avatar-agent{background:var(--jex-bg-avatar-agent)}.jex-avatar-img{width:100%;height:100%;border-radius:50%;object-fit:cover}.jex-avatar-initials{font-size:9px;font-weight:700;color:var(--jex-text-avatar-agent)}.jex-message-author-row{display:flex;align-items:center;gap:6px;margin-top:2px;padding-left:4px}.jex-message-author{font-size:10px;color:var(--jex-text-muted)}.jex-reply-tag-btn{display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;padding:0;border:none;border-radius:4px;background:transparent;color:var(--jex-text-muted, #6b7280);cursor:pointer;transition:background .15s,color .15s}.jex-reply-tag-btn:hover{background:#0000000f;color:var(--jex-primary, #115A62)}.jex-reply-tag-btn:focus-visible{outline:2px solid var(--jex-primary, #115A62);outline-offset:1px}.jex-message{padding:12px 16px;border-radius:18px;font-size:14px;line-height:1.4}.jex-message.bot{background:var(--jex-bg-msg-bot);border:1px solid var(--jex-border-window);color:var(--jex-text-msg-bot);border-bottom-left-radius:4px}.jex-message.user{align-self:flex-end;max-width:80%;background:var(--jex-bg-msg-user);color:var(--jex-text-msg-user);border-bottom-right-radius:4px}.jex-typing{align-self:flex-start;display:flex;gap:4px;padding:12px 16px}.jex-typing span{width:8px;height:8px;border-radius:50%;background:var(--jex-text-muted);animation:jexTypingDot 1.2s infinite ease-in-out}.jex-typing span:nth-child(2){animation-delay:.2s}.jex-typing span:nth-child(3){animation-delay:.4s}@keyframes jexTypingDot{0%,80%,to{transform:scale(.8);opacity:.4}40%{transform:scale(1);opacity:1}}.jex-md{word-break:break-word;overflow-wrap:anywhere}.jex-md p{margin:0 0 8px}.jex-md p:last-child{margin-bottom:0}.jex-md strong{font-weight:600}.jex-md em{font-style:italic}.jex-md ul,.jex-md ol{margin:0 0 8px;padding-left:20px}.jex-md ul:last-child,.jex-md ol:last-child{margin-bottom:0}.jex-md ul{list-style-type:disc}.jex-md ol{list-style-type:decimal}.jex-md li{margin-bottom:2px}.jex-md li:last-child{margin-bottom:0}.jex-md a{color:var(--jex-primary);text-decoration:underline;text-underline-offset:2px}.jex-md a:hover{opacity:.8}.jex-md code{background:#00000014;padding:1px 5px;border-radius:4px;font-size:.9em;font-family:ui-monospace,Cascadia Code,Fira Code,monospace}.jex-md pre{background:#0000000f;border-radius:8px;padding:10px 12px;margin:0 0 8px;overflow-x:auto;font-size:.85em}.jex-md pre:last-child{margin-bottom:0}.jex-md pre code{background:none;padding:0;border-radius:0;font-size:inherit}.jex-md h1,.jex-md h2,.jex-md h3,.jex-md h4{font-weight:600;margin:8px 0 4px}.jex-md h1:first-child,.jex-md h2:first-child,.jex-md h3:first-child,.jex-md h4:first-child{margin-top:0}.jex-md h3{font-size:1em}.jex-md h4{font-size:.95em}.jex-md hr{border:none;border-top:1px solid var(--jex-border-window);margin:8px 0}.jex-md blockquote{border-left:3px solid var(--jex-primary);margin:0 0 8px;padding:4px 12px;color:var(--jex-text-muted)}.jex-md blockquote:last-child{margin-bottom:0}.dark .jex-md code,.jex-widget.dark .jex-md code{background:#ffffff1a}.dark .jex-md pre,.jex-widget.dark .jex-md pre{background:#ffffff14}@media(prefers-color-scheme:dark){:host:not(.light) .jex-widget:not(.light) .jex-md code{background:#ffffff1a}:host:not(.light) .jex-widget:not(.light) .jex-md pre{background:#ffffff14}}.jex-streaming-cursor:after{content:"◊";margin-left:2px;animation:jexBlinkCursor .8s ease-in-out infinite}@keyframes jexBlinkCursor{0%,to{opacity:1}50%{opacity:0}}.jex-session-notice{align-self:center;text-align:center;padding:8px 16px;margin:8px 0;font-size:12px;color:var(--jex-text-muted);background:var(--jex-bg-input, #f1f5f9);border-radius:8px;line-height:1.4}.jex-message-error{background:var(--jex-bg-error, #fef2f2)!important;border-color:var(--jex-border-error, #fecaca)!important;color:var(--jex-text-error, #991b1b)!important}.jex-chat-input{padding:12px 16px;border-top:1px solid var(--jex-border-window);display:flex;flex-direction:column;gap:8px;flex-shrink:0}.jex-composer-card{display:flex;flex-direction:column;gap:6px;padding:10px 12px 8px;background:var(--jex-bg-input);border:1px solid var(--jex-border-input);border-radius:16px;cursor:text;transition:border-color .15s ease,background .15s ease,box-shadow .15s ease}.jex-composer-card:focus-within{border-color:var(--jex-primary);background:var(--jex-bg-window);box-shadow:0 0 0 3px color-mix(in srgb,var(--jex-primary, #115A62) 14%,transparent)}.jex-composer-attachments{display:flex;flex-wrap:wrap;gap:6px;padding:2px 2px 4px}.jex-attachment-chip{position:relative;width:44px;height:44px;border-radius:8px;overflow:hidden;background:var(--jex-bg-msg-bot, #f1f5f9);flex-shrink:0;box-shadow:0 1px 2px #0000000f}.jex-attachment-thumb{width:100%;height:100%;object-fit:cover;display:block;pointer-events:none}.jex-attachment-remove{position:absolute;top:2px;right:2px;width:16px;height:16px;padding:0;border:none;border-radius:50%;background:#0f172ac7;color:#fff;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;opacity:0;transition:opacity .12s ease,transform .12s ease}.jex-attachment-chip:hover .jex-attachment-remove,.jex-attachment-chip:focus-within .jex-attachment-remove{opacity:1}.jex-attachment-remove:hover{transform:scale(1.08)}.jex-composer-textarea{width:100%;min-height:22px;background:transparent;border:none;outline:none;resize:none;padding:2px 4px;color:var(--jex-text-main);font-family:inherit;font-size:16px;line-height:1.45;overflow-y:hidden}.jex-composer-textarea::placeholder{color:var(--jex-text-muted);opacity:.85}.jex-composer-textarea:disabled{cursor:not-allowed;opacity:.7}.jex-composer-actions{display:flex;align-items:center;justify-content:space-between;gap:8px}.jex-composer-actions-left{display:inline-flex;align-items:center;gap:4px}.jex-attach-btn{width:30px;height:30px;padding:0;border:none;border-radius:50%;background:transparent;color:var(--jex-text-muted);display:inline-flex;align-items:center;justify-content:center;cursor:pointer;transition:background .12s ease,color .12s ease,transform .12s ease}.jex-attach-btn:hover:not(:disabled){background:color-mix(in srgb,var(--jex-text-muted, #64748b) 12%,transparent);color:var(--jex-text-main)}.jex-attach-btn:active:not(:disabled){transform:scale(.92)}.jex-attach-btn:disabled{opacity:.4;cursor:not-allowed}.jex-visually-hidden{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.jex-rate-limit-notice{flex:1 0 100%;order:-1;margin-bottom:8px;padding:8px 12px;border-radius:10px;background:var(--jex-bg-msg-bot, #f1f5f9);color:var(--jex-text-muted, #64748b);font-size:12px;line-height:1.4;text-align:center}.jex-session-error-notice{flex:1 0 100%;order:-1;margin-bottom:8px;padding:8px 12px;border-radius:10px;background:var(--jex-bg-error, #fef2f2);border:1px solid var(--jex-border-error, #fecaca);color:var(--jex-text-error, #991b1b);font-size:12px;line-height:1.4;text-align:center}.jex-chat-input input{flex:1;background:var(--jex-bg-input);border:1px solid var(--jex-border-input);border-radius:12px;padding:10px 14px;color:var(--jex-text-main);outline:none;font-family:inherit;font-size:14px}.jex-chat-input input:focus{border-color:var(--jex-primary)}.jex-send-btn{background:color-mix(in srgb,var(--jex-text-muted, #64748b) 18%,transparent);color:var(--jex-text-muted);border:none;border-radius:999px;width:30px;height:30px;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;transition:background .15s ease,color .15s ease,opacity .15s ease,transform .15s ease;flex-shrink:0}.jex-send-btn-active{background:var(--jex-bg-send-btn, var(--jex-primary));color:var(--jex-text-header, #fff)}.jex-send-btn-active:hover:not(:disabled){background:var(--jex-primary-hover)}.jex-send-btn:active:not(:disabled){transform:scale(.9)}.jex-send-btn:disabled{opacity:.45;cursor:default}.jex-widget-footer{display:flex;align-items:center;justify-content:center;padding:8px 16px;border-top:1px solid var(--jex-border-glass);background:#00000005;flex-shrink:0}.jex-widget.dark .jex-widget-footer{background:#ffffff05}@media(prefers-color-scheme:dark){:host:not(.light) .jex-widget:not(.light) .jex-widget-footer{background:#ffffff05}}.jex-branding{display:flex;align-items:center;gap:6px;text-decoration:none;color:var(--jex-text-muted);font-size:11px;font-weight:500;transition:color .2s}.jex-branding:hover{color:var(--jex-text-main)}.jex-branding-icon{color:var(--jex-primary)}.jex-branding span strong{font-weight:700;color:var(--jex-text-main)}.jex-locale-select-wrapper{position:relative;display:flex;align-items:center}.jex-locale-select{appearance:none;-webkit-appearance:none;background:transparent;border:1px solid transparent;padding:4px 20px 4px 6px;border-radius:6px;font-family:inherit;font-size:11px;font-weight:600;color:var(--jex-text-muted);background-color:transparent;cursor:pointer;outline:none;transition:all .2s ease}.jex-locale-select option{background-color:#fff;color:#0f172a}.jex-locale-select:hover,.jex-locale-select:focus-visible{color:var(--jex-text-main);background:#0000000a}.jex-widget.dark .jex-locale-select:hover,.jex-widget.dark .jex-locale-select:focus-visible{background:#ffffff0d}.jex-widget.dark .jex-locale-select option{background-color:#0f172a;color:#f8fafc}@media(prefers-color-scheme:dark){:host:not(.light) .jex-widget:not(.light) .jex-locale-select:hover,:host:not(.light) .jex-widget:not(.light) .jex-locale-select:focus-visible{background:#ffffff0d}:host:not(.light) .jex-widget:not(.light) .jex-locale-select option{background-color:#0f172a;color:#f8fafc}}.jex-locale-select:focus-visible{border-color:var(--jex-primary)}.jex-locale-chevron{position:absolute;right:4px;pointer-events:none;color:var(--jex-text-muted);transition:color .2s ease}.jex-locale-select-wrapper:hover .jex-locale-chevron{color:var(--jex-text-main)}.jex-overlay{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;background:var(--jex-bg-window, #fff);z-index:10;padding:24px;text-align:center}.jex-loading-spinner{width:32px;height:32px;border:3px solid var(--jex-border-input, #e2e8f0);border-top-color:var(--jex-primary, #115A62);border-radius:50%;animation:jex-spin .7s linear infinite}@keyframes jex-spin{to{transform:rotate(360deg)}}.jex-loading-message{font-size:14px;color:var(--jex-text-muted, #64748b)}.jex-error-message{font-size:14px;color:var(--jex-text-main, #334155)}.jex-error-actions{display:flex;gap:8px}.jex-error-retry,.jex-error-back{padding:8px 16px;border-radius:8px;font-size:13px;font-weight:600;cursor:pointer;border:none}.jex-error-retry{background:var(--jex-primary, #115A62);color:#fff}.jex-error-back{background:transparent;color:var(--jex-text-muted, #64748b);border:1px solid var(--jex-border-input, #e2e8f0)}.jex-selection{display:flex;flex-direction:column;gap:12px;padding:24px 16px;height:100%}.jex-selection-title{font-size:16px;font-weight:700;color:var(--jex-text-main, #0f172a);margin:0 0 8px}.jex-selection-options{display:flex;flex-direction:column;gap:10px}.jex-selection-option{display:flex;flex-direction:column;align-items:flex-start;gap:2px;padding:16px;border-radius:12px;border:1px solid var(--jex-border-window, #e2e8f0);background:transparent;cursor:pointer;text-align:left;transition:border-color .15s ease,background .15s ease}.jex-selection-option:hover{border-color:var(--jex-primary, #115A62);background:color-mix(in srgb,var(--jex-primary, #115A62) 5%,transparent)}.jex-selection-icon{font-size:20px}.jex-selection-label{font-size:14px;font-weight:600;color:var(--jex-text-main, #0f172a)}.jex-selection-sub{font-size:12px;color:var(--jex-text-muted, #64748b)}.jex-form-screen{display:flex;flex-direction:column;padding:20px 16px;height:100%;overflow-y:auto}.jex-form-title{font-size:16px;font-weight:700;color:var(--jex-text-main, #0f172a);margin:0 0 16px}.jex-form{display:flex;flex-direction:column;gap:10px}.jex-form-input,.jex-form-textarea{padding:10px 12px;border-radius:8px;border:1px solid var(--jex-border-input, #e2e8f0);font-size:14px;background:transparent;color:var(--jex-text-main, #0f172a);outline:none}@media(pointer:coarse){.jex-form-input,.jex-form-textarea{font-size:16px}}.jex-form-input:focus,.jex-form-textarea:focus{border-color:var(--jex-primary, #115A62)}.jex-form-textarea{min-height:80px;resize:vertical}.jex-form-submit{padding:10px;border-radius:8px;border:none;background:var(--jex-primary, #115A62);color:#fff;font-size:14px;font-weight:600;cursor:pointer;margin-top:4px}.jex-inline-form{display:flex;flex-direction:column;gap:8px;padding:12px;background:var(--jex-bg-msg-bot, #f1f5f9);border:1px solid var(--jex-border-input, #e2e8f0);border-radius:var(--jex-radius, .75rem);width:100%}.jex-inline-form-title{font-weight:600;font-size:15px;color:var(--jex-text-main, #0f172a);margin:0}.jex-inline-form-subtitle{font-size:13px;color:var(--jex-text-muted, #64748b);line-height:1.4;margin:0 0 4px}.jex-inline-form-consent{font-size:11px;color:var(--jex-text-muted, #64748b);line-height:1.3;margin-top:4px;text-align:center}.jex-inline-form .jex-form-submit:disabled{opacity:.7;cursor:not-allowed}.jex-escalation-subtitle{font-size:13px;color:var(--jex-text-muted, #64748b);line-height:1.45;margin:0 0 8px}.jex-escalation-skip{padding:8px 12px;border:none;background:transparent;color:var(--jex-text-muted, #64748b);font-size:13px;cursor:pointer;text-decoration:underline;text-underline-offset:2px;text-align:center}.jex-escalation-skip:hover{color:var(--jex-text-main, #0f172a)}.jex-inline-form-card{position:relative;padding:14px;gap:8px}.jex-inline-form-dismiss{position:absolute;top:10px;right:10px;width:24px;height:24px;border-radius:50%;border:1px solid var(--jex-border-input, #e2e8f0);background:var(--jex-bg-window, #fff);color:var(--jex-text-muted, #64748b);font-size:12px;cursor:pointer;display:flex;align-items:center;justify-content:center;line-height:1}.jex-inline-form-dismiss:hover{background:var(--jex-bg-msg-bot, #f1f5f9);color:var(--jex-text-main, #0f172a)}.jex-inline-form-submitted{display:flex;align-items:center;gap:10px;padding:10px 12px;background:var(--jex-bg-msg-bot, #f1f5f9);border:1px solid var(--jex-border-input, #e2e8f0);border-radius:var(--jex-radius, .75rem);width:100%}.jex-inline-form-check{display:flex;align-items:center;justify-content:center;width:24px;height:24px;border-radius:50%;background:color-mix(in srgb,var(--jex-primary) 15%,transparent);color:var(--jex-primary, #115A62);font-size:14px;font-weight:700;flex-shrink:0}.jex-inline-form-submitted-title{font-weight:600;font-size:var(--jex-font-size, 14px);color:var(--jex-text-main, #0f172a)}.jex-inline-form-submitted-detail{font-size:12px;color:var(--jex-text-muted, #64748b);margin-top:2px}.jex-escalation-confirm{border-left:3px solid var(--jex-primary, #115A62);padding-left:8px}.jex-session-prompt{display:flex;flex-direction:column;align-items:center;gap:8px;padding:12px 16px;margin:8px 0;text-align:center}.jex-session-prompt-text{font-size:13px;color:var(--jex-text-muted, #64748b)}.jex-session-prompt-btn{padding:8px 16px;border-radius:8px;border:1px solid var(--jex-primary, #115A62);background:transparent;color:var(--jex-primary, #115A62);font-size:13px;font-weight:600;cursor:pointer}.jex-session-prompt-btn:hover{background:color-mix(in srgb,var(--jex-primary) 10%,transparent)}.jex-chat-input-resolved{display:flex;flex-direction:column;align-items:center;gap:10px;padding:14px 16px;border-top:1px solid var(--jex-border-input, #e2e8f0);background:var(--jex-bg-msg-bot, #f1f5f9);text-align:center}.jex-resolved-notice{font-size:13px;font-weight:500;color:var(--jex-text-muted, #64748b)}.jex-resolved-new-btn{padding:10px 20px;border-radius:8px;border:none;background:var(--jex-primary, #115A62);color:#fff;font-size:13px;font-weight:600;cursor:pointer;width:100%}.jex-resolved-new-btn:hover{opacity:.9}.jex-confirmation{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;padding:32px 24px;height:100%;text-align:center}.jex-confirmation-icon{width:48px;height:48px;border-radius:50%;background:color-mix(in srgb,var(--jex-primary, #115A62) 15%,transparent);color:var(--jex-primary, #115A62);font-size:22px;display:flex;align-items:center;justify-content:center}.jex-confirmation-title{font-size:18px;font-weight:700;color:var(--jex-text-main, #0f172a);margin:0}.jex-confirmation-body{font-size:13px;color:var(--jex-text-muted, #64748b);margin:0}.jex-confirmation-ref{font-size:20px;font-weight:700;letter-spacing:.05em;color:var(--jex-primary, #115A62);background:color-mix(in srgb,var(--jex-primary, #115A62) 10%,transparent);padding:10px 20px;border-radius:10px}.jex-confirmation-hint{font-size:12px;color:var(--jex-text-muted, #64748b);margin:0}.jex-confirmation-done{margin-top:8px;padding:10px 28px;border-radius:8px;border:none;background:var(--jex-primary, #115A62);color:#fff;font-size:14px;font-weight:600;cursor:pointer}.jex-home-lookup-link{background:none;border:none;font-size:12px;color:var(--jex-text-muted, #64748b);cursor:pointer;text-decoration:underline;padding:0;align-self:center}.jex-home-lookup{display:flex;gap:8px;width:100%;animation:jexFadeIn .4s .1s ease both}.jex-home-lookup-input{flex:1;padding:10px 14px;border-radius:10px;border:1px solid var(--jex-border-input, #e2e8f0);background:var(--jex-bg-input);color:var(--jex-text-main);font-size:14px;font-family:ui-monospace,Cascadia Code,Fira Code,monospace;letter-spacing:.04em;outline:none;transition:border-color .2s}@media(pointer:coarse){.jex-home-lookup-input{font-size:16px}}.jex-home-lookup-input::placeholder{font-family:inherit;letter-spacing:.04em;color:var(--jex-text-muted);opacity:.7}.jex-home-lookup-input:focus{border-color:var(--jex-primary, #115A62)}.jex-home-lookup-submit{padding:10px 16px;border-radius:10px;border:none;background:var(--jex-primary, #115A62);color:#fff;font-size:13px;font-weight:600;cursor:pointer;font-family:inherit;transition:background .2s,opacity .2s;flex-shrink:0}.jex-home-lookup-submit:hover:not(:disabled){background:var(--jex-primary-hover)}.jex-home-lookup-submit:disabled{opacity:.4;cursor:default}.jex-sources-row{margin-top:6px;margin-left:32px;display:flex;flex-direction:column;gap:6px}.jex-sources-toggle{display:inline-flex;align-items:center;gap:4px;padding:2px 8px;background:transparent;border:none;border-radius:6px;cursor:pointer;font-size:11px;color:var(--jex-text-muted, #6b7280);font-family:inherit;align-self:flex-start;transition:background .15s,color .15s}.jex-sources-toggle:hover{background:#0000000a;color:inherit}.jex-sources-icon{font-size:12px;line-height:1}.jex-sources-chevron{display:inline-block;font-size:10px;transition:transform .15s}.jex-sources-chevron--open{transform:rotate(180deg)}.jex-sources-pills{display:flex;flex-wrap:wrap;align-items:center;gap:6px}.jex-source-pill{display:inline-flex;align-items:center;gap:6px;max-width:240px;padding:2px 8px;border-radius:999px;border:1px solid rgba(0,0,0,.1);background:#0000000a;color:var(--jex-text-muted, #6b7280);font-size:11px;text-decoration:none;cursor:pointer;transition:background .15s,color .15s}.jex-source-pill:hover{background:#00000014;color:inherit}.jex-source-id{display:inline-flex;align-items:center;justify-content:center;min-width:16px;height:16px;padding:0 4px;border-radius:4px;background:var(--jex-primary, #115A62);color:#fff;font-size:10px;font-weight:600;line-height:1;flex-shrink:0;font-variant-numeric:tabular-nums}.jex-source-type{font-size:10px;flex-shrink:0}.jex-source-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:500}.jex-source-score{opacity:.6;flex-shrink:0;font-variant-numeric:tabular-nums}';
|
|
7382
|
+
function hu(t) {
|
|
7287
7383
|
const e = document.createElement("style");
|
|
7288
|
-
e.textContent =
|
|
7384
|
+
e.textContent = uu, t.appendChild(e);
|
|
7289
7385
|
}
|
|
7290
|
-
const
|
|
7291
|
-
let
|
|
7292
|
-
function
|
|
7293
|
-
const e = t ??
|
|
7386
|
+
const du = "https://festive-mouse-978.eu-west-1.convex.cloud";
|
|
7387
|
+
let Zt = null;
|
|
7388
|
+
function pu(t) {
|
|
7389
|
+
const e = t ?? du;
|
|
7294
7390
|
if (!e)
|
|
7295
7391
|
throw new Error("[jexity] No Convex URL — set VITE_CONVEX_URL at build time or data-convex-url on the script tag");
|
|
7296
|
-
return
|
|
7392
|
+
return Zt || (Zt = new Aa(Va(e))), Zt;
|
|
7297
7393
|
}
|
|
7298
|
-
function
|
|
7394
|
+
function fu(t, e) {
|
|
7299
7395
|
const n = t.shadowRoot ?? t.attachShadow({ mode: "open" });
|
|
7300
7396
|
for (; n.firstChild; )
|
|
7301
7397
|
n.removeChild(n.firstChild);
|
|
7302
|
-
|
|
7398
|
+
hu(n), jt.value = e.source, le.value = e.bootstrapToken, N.value = [{ id: "home" }], e.mode === "embedded" && (t.classList.add("jex-mode-embedded"), q.value = !0);
|
|
7303
7399
|
const r = document.createElement("div");
|
|
7304
7400
|
return e.mode === "embedded" && (r.style.cssText = "width:100%;height:100%"), n.appendChild(r), ge(
|
|
7305
|
-
/* @__PURE__ */ c(
|
|
7401
|
+
/* @__PURE__ */ c($a, { client: pu(e.convexUrl), children: /* @__PURE__ */ c(lu, { options: e }) }),
|
|
7306
7402
|
r
|
|
7307
7403
|
), function() {
|
|
7308
7404
|
ge(null, r), q.value = !1, jt.value = void 0, le.value = void 0, N.value = [{ id: "home" }];
|
|
7309
7405
|
};
|
|
7310
7406
|
}
|
|
7311
|
-
function
|
|
7312
|
-
const r =
|
|
7407
|
+
function gu(t, e, n) {
|
|
7408
|
+
const r = fu(t, e), i = /* @__PURE__ */ new Set(), o = q.subscribe((s) => {
|
|
7313
7409
|
for (const l of i)
|
|
7314
7410
|
l(s);
|
|
7315
7411
|
});
|
|
@@ -7337,21 +7433,21 @@ function nu(t, e, n) {
|
|
|
7337
7433
|
};
|
|
7338
7434
|
}
|
|
7339
7435
|
let Fe = null;
|
|
7340
|
-
function
|
|
7436
|
+
function mu(t) {
|
|
7341
7437
|
Fe && Fe.shutdown();
|
|
7342
7438
|
let e;
|
|
7343
7439
|
t.container ? e = typeof t.container == "string" ? document.querySelector(t.container) : t.container : (e = document.createElement("div"), e.id = "jexity-chat-widget", document.body.appendChild(e));
|
|
7344
|
-
const n =
|
|
7440
|
+
const n = gu(e, t, () => {
|
|
7345
7441
|
t.container || e.remove(), Fe === n && (Fe = null);
|
|
7346
7442
|
});
|
|
7347
7443
|
return Fe = n, n;
|
|
7348
7444
|
}
|
|
7349
|
-
const
|
|
7445
|
+
const xu = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
7350
7446
|
__proto__: null,
|
|
7351
|
-
JexityChat:
|
|
7447
|
+
JexityChat: mu
|
|
7352
7448
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
7353
7449
|
export {
|
|
7354
|
-
|
|
7355
|
-
|
|
7450
|
+
vu as JexityChatProvider,
|
|
7451
|
+
yu as useJexityChat
|
|
7356
7452
|
};
|
|
7357
7453
|
//# sourceMappingURL=react.mjs.map
|