@evelan/jexity-widget 0.8.0 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/react.mjs CHANGED
@@ -1,10 +1,10 @@
1
- import { createContext as Mi, useState as Oi, useRef as At, useEffect as Li, createElement as An, useContext as Ni } from "react";
2
- const yr = Mi(null);
3
- function Jl(t) {
4
- const { children: e, ...n } = t, [r, i] = Oi(!1), s = At(null), o = At(null), l = At(null), a = n.mode === "embedded";
5
- Li(() => {
1
+ import { createContext as Oi, useState as Li, useRef as At, useEffect as Ni, createElement as In, useContext as zi } from "react";
2
+ const vr = Oi(null);
3
+ function Zl(t) {
4
+ const { children: e, ...n } = t, [r, i] = Li(!1), s = At(null), o = At(null), l = At(null), a = n.mode === "embedded";
5
+ Ni(() => {
6
6
  let d = !1;
7
- return Promise.resolve().then(() => Wl).then(
7
+ return Promise.resolve().then(() => Hl).then(
8
8
  (c) => {
9
9
  if (d)
10
10
  return;
@@ -31,40 +31,40 @@ function Jl(t) {
31
31
  },
32
32
  isOpen: r
33
33
  };
34
- return An(
35
- yr.Provider,
34
+ return In(
35
+ vr.Provider,
36
36
  { value: u },
37
- a ? An("div", {
37
+ a ? In("div", {
38
38
  ref: l,
39
39
  style: { width: "100%", height: "100%" }
40
40
  }) : e
41
41
  );
42
42
  }
43
- function Zl() {
44
- const t = Ni(yr);
43
+ function Gl() {
44
+ const t = zi(vr);
45
45
  if (!t)
46
46
  throw new Error("useJexityChat must be used within a <JexityChatProvider>");
47
47
  return t;
48
48
  }
49
- var Ye, m, vr, _r, le, In, kr, wr, jr, rn, Vt, Bt, Sr, We = {}, Cr = [], zi = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i, Xe = Array.isArray;
49
+ var Ke, m, _r, kr, le, $n, wr, jr, Sr, sn, Vt, Bt, Cr, Ue = {}, Rr = [], Qi = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i, Ye = Array.isArray;
50
50
  function K(t, e) {
51
51
  for (var n in e) t[n] = e[n];
52
52
  return t;
53
53
  }
54
- function sn(t) {
54
+ function on(t) {
55
55
  t && t.parentNode && t.parentNode.removeChild(t);
56
56
  }
57
- function ne(t, e, n) {
57
+ function re(t, e, n) {
58
58
  var r, i, s, o = {};
59
59
  for (s in e) s == "key" ? r = e[s] : s == "ref" ? i = e[s] : o[s] = e[s];
60
- if (arguments.length > 2 && (o.children = arguments.length > 3 ? Ye.call(arguments, 2) : n), typeof t == "function" && t.defaultProps != null) for (s in t.defaultProps) o[s] === void 0 && (o[s] = t.defaultProps[s]);
61
- return Be(t, o, r, i, null);
60
+ if (arguments.length > 2 && (o.children = arguments.length > 3 ? Ke.call(arguments, 2) : n), typeof t == "function" && t.defaultProps != null) for (s in t.defaultProps) o[s] === void 0 && (o[s] = t.defaultProps[s]);
61
+ return Ve(t, o, r, i, null);
62
62
  }
63
- function Be(t, e, n, r, i) {
64
- var s = { 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 };
63
+ function Ve(t, e, n, r, i) {
64
+ var s = { type: t, props: e, key: n, ref: r, __k: null, __: null, __b: 0, __e: null, __c: null, constructor: void 0, __v: i ?? ++_r, __i: -1, __u: 0 };
65
65
  return i == null && m.vnode != null && m.vnode(s), s;
66
66
  }
67
- function Qi() {
67
+ function Vi() {
68
68
  return { current: null };
69
69
  }
70
70
  function B(t) {
@@ -73,57 +73,57 @@ function B(t) {
73
73
  function Q(t, e) {
74
74
  this.props = t, this.context = e;
75
75
  }
76
- function Ce(t, e) {
77
- if (e == null) return t.__ ? Ce(t.__, t.__i + 1) : null;
76
+ function Se(t, e) {
77
+ if (e == null) return t.__ ? Se(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" ? Ce(t) : null;
79
+ return typeof t.type == "function" ? Se(t) : null;
80
80
  }
81
- function Rr(t) {
81
+ function Tr(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 Rr(t);
88
+ return Tr(t);
89
89
  }
90
90
  }
91
91
  function Ft(t) {
92
- (!t.__d && (t.__d = !0) && le.push(t) && !dt.__r++ || In != m.debounceRendering) && ((In = m.debounceRendering) || kr)(dt);
92
+ (!t.__d && (t.__d = !0) && le.push(t) && !ht.__r++ || $n != m.debounceRendering) && (($n = m.debounceRendering) || wr)(ht);
93
93
  }
94
- function dt() {
95
- for (var t, e, n, r, i, s, o, l = 1; le.length; ) le.length > l && le.sort(wr), t = le.shift(), l = le.length, t.__d && (n = void 0, r = void 0, i = (r = (e = t).__v).__e, s = [], o = [], e.__P && ((n = K({}, r)).__v = r.__v + 1, m.vnode && m.vnode(n), on(e.__P, n, r, e.__n, e.__P.namespaceURI, 32 & r.__u ? [i] : null, s, i ?? Ce(r), !!(32 & r.__u), o), n.__v = r.__v, n.__.__k[n.__i] = n, Ir(s, n, o), r.__e = r.__ = null, n.__e != i && Rr(n)));
96
- dt.__r = 0;
94
+ function ht() {
95
+ for (var t, e, n, r, i, s, o, l = 1; le.length; ) le.length > l && le.sort(jr), t = le.shift(), l = le.length, t.__d && (n = void 0, r = void 0, i = (r = (e = t).__v).__e, s = [], o = [], e.__P && ((n = K({}, r)).__v = r.__v + 1, m.vnode && m.vnode(n), an(e.__P, n, r, e.__n, e.__P.namespaceURI, 32 & r.__u ? [i] : null, s, i ?? Se(r), !!(32 & r.__u), o), n.__v = r.__v, n.__.__k[n.__i] = n, $r(s, n, o), r.__e = r.__ = null, n.__e != i && Tr(n)));
96
+ ht.__r = 0;
97
97
  }
98
- function Tr(t, e, n, r, i, s, o, l, a, u, d) {
99
- var c, f, p, g, k, w, v, _ = r && r.__k || Cr, U = e.length;
100
- for (a = Vi(n, e, _, a, U), c = 0; c < U; c++) (p = n.__k[c]) != null && (f = p.__i == -1 ? We : _[p.__i] || We, p.__i = c, w = on(t, p, f, i, s, o, l, a, u, d), g = p.__e, p.ref && f.ref != p.ref && (f.ref && an(f.ref, null, p), d.push(p.ref, p.__c || g, p)), k == null && g != null && (k = g), (v = !!(4 & p.__u)) || f.__k === p.__k ? a = Ar(p, a, t, v) : typeof p.type == "function" && w !== void 0 ? a = w : g && (a = g.nextSibling), p.__u &= -7);
98
+ function Ar(t, e, n, r, i, s, o, l, a, u, d) {
99
+ var c, f, p, g, k, w, v, _ = r && r.__k || Rr, U = e.length;
100
+ for (a = Bi(n, e, _, a, U), c = 0; c < U; c++) (p = n.__k[c]) != null && (f = p.__i == -1 ? Ue : _[p.__i] || Ue, p.__i = c, w = an(t, p, f, i, s, o, l, a, u, d), g = p.__e, p.ref && f.ref != p.ref && (f.ref && ln(f.ref, null, p), d.push(p.ref, p.__c || g, p)), k == null && g != null && (k = g), (v = !!(4 & p.__u)) || f.__k === p.__k ? a = Ir(p, a, t, v) : typeof p.type == "function" && w !== void 0 ? a = w : g && (a = g.nextSibling), p.__u &= -7);
101
101
  return n.__e = k, a;
102
102
  }
103
- function Vi(t, e, n, r, i) {
103
+ function Bi(t, e, n, r, i) {
104
104
  var s, o, l, a, u, d = n.length, c = d, f = 0;
105
- for (t.__k = new Array(i), s = 0; s < i; s++) (o = e[s]) != null && typeof o != "boolean" && typeof o != "function" ? (a = s + f, (o = t.__k[s] = typeof o == "string" || typeof o == "number" || typeof o == "bigint" || o.constructor == String ? Be(null, o, null, null, null) : Xe(o) ? Be(B, { children: o }, null, null, null) : o.constructor == null && o.__b > 0 ? Be(o.type, o.props, o.key, o.ref ? o.ref : null, o.__v) : o).__ = t, o.__b = t.__b + 1, l = null, (u = o.__i = Bi(o, n, a, c)) != -1 && (c--, (l = n[u]) && (l.__u |= 2)), l == null || l.__v == null ? (u == -1 && (i > d ? f-- : i < d && f++), typeof o.type != "function" && (o.__u |= 4)) : u != a && (u == a - 1 ? f-- : u == a + 1 ? f++ : (u > a ? f-- : f++, o.__u |= 4))) : t.__k[s] = null;
106
- if (c) for (s = 0; s < d; s++) (l = n[s]) != null && (2 & l.__u) == 0 && (l.__e == r && (r = Ce(l)), qr(l, l));
105
+ for (t.__k = new Array(i), s = 0; s < i; s++) (o = e[s]) != null && typeof o != "boolean" && typeof o != "function" ? (a = s + f, (o = t.__k[s] = typeof o == "string" || typeof o == "number" || typeof o == "bigint" || o.constructor == String ? Ve(null, o, null, null, null) : Ye(o) ? Ve(B, { children: o }, null, null, null) : o.constructor == null && o.__b > 0 ? Ve(o.type, o.props, o.key, o.ref ? o.ref : null, o.__v) : o).__ = t, o.__b = t.__b + 1, l = null, (u = o.__i = Fi(o, n, a, c)) != -1 && (c--, (l = n[u]) && (l.__u |= 2)), l == null || l.__v == null ? (u == -1 && (i > d ? f-- : i < d && f++), typeof o.type != "function" && (o.__u |= 4)) : u != a && (u == a - 1 ? f-- : u == a + 1 ? f++ : (u > a ? f-- : f++, o.__u |= 4))) : t.__k[s] = null;
106
+ if (c) for (s = 0; s < d; s++) (l = n[s]) != null && (2 & l.__u) == 0 && (l.__e == r && (r = Se(l)), Er(l, l));
107
107
  return r;
108
108
  }
109
- function Ar(t, e, n, r) {
109
+ function Ir(t, e, n, r) {
110
110
  var i, s;
111
111
  if (typeof t.type == "function") {
112
- for (i = t.__k, s = 0; i && s < i.length; s++) i[s] && (i[s].__ = t, e = Ar(i[s], e, n, r));
112
+ for (i = t.__k, s = 0; i && s < i.length; s++) i[s] && (i[s].__ = t, e = Ir(i[s], e, n, r));
113
113
  return e;
114
114
  }
115
- t.__e != e && (r && (e && t.type && !e.parentNode && (e = Ce(t)), n.insertBefore(t.__e, e || null)), e = t.__e);
115
+ t.__e != e && (r && (e && t.type && !e.parentNode && (e = Se(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);
119
119
  return e;
120
120
  }
121
- function te(t, e) {
122
- return e = e || [], t == null || typeof t == "boolean" || (Xe(t) ? t.some(function(n) {
123
- te(n, e);
121
+ function ne(t, e) {
122
+ return e = e || [], t == null || typeof t == "boolean" || (Ye(t) ? t.some(function(n) {
123
+ ne(n, e);
124
124
  }) : e.push(t)), e;
125
125
  }
126
- function Bi(t, e, n, r) {
126
+ function Fi(t, e, n, r) {
127
127
  var i, s, o, 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 Bi(t, e, n, r) {
131
131
  }
132
132
  return -1;
133
133
  }
134
- function $n(t, e, n) {
135
- e[0] == "-" ? t.setProperty(e, n ?? "") : t[e] = n == null ? "" : typeof n != "number" || zi.test(e) ? n : n + "px";
134
+ function qn(t, e, n) {
135
+ e[0] == "-" ? t.setProperty(e, n ?? "") : t[e] = n == null ? "" : typeof n != "number" || Qi.test(e) ? n : n + "px";
136
136
  }
137
- function it(t, e, n, r, i) {
137
+ function rt(t, e, n, r, i) {
138
138
  var s, o;
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 || $n(t.style, e, "");
142
- if (n) for (e in n) r && n[e] == r[e] || $n(t.style, e, n[e]);
141
+ if (typeof r == "string" && (t.style.cssText = r = ""), r) for (e in r) n && e in n || qn(t.style, e, "");
142
+ if (n) for (e in n) r && n[e] == r[e] || qn(t.style, e, n[e]);
143
143
  }
144
- else if (e[0] == "o" && e[1] == "n") s = e != (e = e.replace(jr, "$1")), o = e.toLowerCase(), e = o in t || e == "onFocusOut" || e == "onFocusIn" ? o.slice(2) : e.slice(2), t.l || (t.l = {}), t.l[e + s] = n, n ? r ? n.u = r.u : (n.u = rn, t.addEventListener(e, s ? Bt : Vt, s)) : t.removeEventListener(e, s ? Bt : Vt, s);
144
+ else if (e[0] == "o" && e[1] == "n") s = e != (e = e.replace(Sr, "$1")), o = e.toLowerCase(), e = o in t || e == "onFocusOut" || e == "onFocusIn" ? o.slice(2) : e.slice(2), t.l || (t.l = {}), t.l[e + s] = n, n ? r ? n.u = r.u : (n.u = sn, t.addEventListener(e, s ? Bt : Vt, s)) : t.removeEventListener(e, s ? Bt : Vt, s);
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 it(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 qn(t) {
155
+ function En(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 = rn++;
159
+ if (e.t == null) e.t = sn++;
160
160
  else if (e.t < n.u) return;
161
161
  return n(m.event ? m.event(e) : e);
162
162
  }
163
163
  };
164
164
  }
165
- function on(t, e, n, r, i, s, o, l, a, u) {
166
- var d, c, f, p, g, k, w, v, _, U, W, ie, L, Tn, rt, Me, Tt, H = e.type;
165
+ function an(t, e, n, r, i, s, o, l, a, u) {
166
+ var d, c, f, p, g, k, w, v, _, U, W, ie, L, An, nt, Pe, Tt, H = e.type;
167
167
  if (e.constructor != null) return null;
168
168
  128 & n.__u && (a = !!(32 & n.__u), s = [l = e.__e = n.__e]), (d = m.__b) && d(e);
169
169
  e: if (typeof H == "function") try {
170
- if (v = e.props, _ = "prototype" in H && H.prototype.render, U = (d = H.contextType) && r[d.__c], W = d ? U ? U.props.value : d.__ : r, n.__c ? w = (c = e.__c = n.__c).__ = c.__E : (_ ? e.__c = c = new H(v, W) : (e.__c = c = new Q(v, W), c.constructor = H, c.render = Di), U && U.sub(c), c.props = v, c.state || (c.state = {}), c.context = W, c.__n = r, f = c.__d = !0, c.__h = [], c._sb = []), _ && c.__s == null && (c.__s = c.state), _ && H.getDerivedStateFromProps != null && (c.__s == c.state && (c.__s = K({}, c.__s)), K(c.__s, H.getDerivedStateFromProps(v, c.__s))), p = c.props, g = c.state, c.__v = e, f) _ && H.getDerivedStateFromProps == null && c.componentWillMount != null && c.componentWillMount(), _ && c.componentDidMount != null && c.__h.push(c.componentDidMount);
170
+ if (v = e.props, _ = "prototype" in H && H.prototype.render, U = (d = H.contextType) && r[d.__c], W = d ? U ? U.props.value : d.__ : r, n.__c ? w = (c = e.__c = n.__c).__ = c.__E : (_ ? e.__c = c = new H(v, W) : (e.__c = c = new Q(v, W), c.constructor = H, c.render = Ui), U && U.sub(c), c.props = v, c.state || (c.state = {}), c.context = W, c.__n = r, f = c.__d = !0, c.__h = [], c._sb = []), _ && c.__s == null && (c.__s = c.state), _ && H.getDerivedStateFromProps != null && (c.__s == c.state && (c.__s = K({}, c.__s)), K(c.__s, H.getDerivedStateFromProps(v, c.__s))), p = c.props, g = c.state, c.__v = e, f) _ && H.getDerivedStateFromProps == null && c.componentWillMount != null && c.componentWillMount(), _ && c.componentDidMount != null && c.__h.push(c.componentDidMount);
171
171
  else {
172
172
  if (_ && H.getDerivedStateFromProps == null && v !== p && c.componentWillReceiveProps != null && c.componentWillReceiveProps(v, W), !c.__e && c.shouldComponentUpdate != null && c.shouldComponentUpdate(v, c.__s, W) === !1 || e.__v == n.__v) {
173
173
  for (e.__v != n.__v && (c.props = v, c.state = c.__s, c.__d = !1), e.__e = n.__e, e.__k = n.__k, e.__k.some(function(xe) {
@@ -180,32 +180,32 @@ function on(t, e, n, r, i, s, o, l, a, u) {
180
180
  c.componentDidUpdate(p, g, k);
181
181
  });
182
182
  }
183
- if (c.context = W, c.props = v, c.__P = t, c.__e = !1, L = m.__r, Tn = 0, _) {
184
- for (c.state = c.__s, c.__d = !1, L && L(e), d = c.render(c.props, c.state, c.context), rt = 0; rt < c._sb.length; rt++) c.__h.push(c._sb[rt]);
183
+ if (c.context = W, c.props = v, c.__P = t, c.__e = !1, L = m.__r, An = 0, _) {
184
+ for (c.state = c.__s, c.__d = !1, L && L(e), d = c.render(c.props, c.state, c.context), nt = 0; nt < c._sb.length; nt++) c.__h.push(c._sb[nt]);
185
185
  c._sb = [];
186
186
  } else do
187
187
  c.__d = !1, L && L(e), d = c.render(c.props, c.state, c.context), c.state = c.__s;
188
- while (c.__d && ++Tn < 25);
189
- c.state = c.__s, c.getChildContext != null && (r = K(K({}, r), c.getChildContext())), _ && !f && c.getSnapshotBeforeUpdate != null && (k = c.getSnapshotBeforeUpdate(p, g)), Me = d, d != null && d.type === B && d.key == null && (Me = $r(d.props.children)), l = Tr(t, Xe(Me) ? Me : [Me], e, n, r, i, s, o, l, a, u), c.base = e.__e, e.__u &= -161, c.__h.length && o.push(c), w && (c.__E = c.__ = null);
188
+ while (c.__d && ++An < 25);
189
+ c.state = c.__s, c.getChildContext != null && (r = K(K({}, r), c.getChildContext())), _ && !f && c.getSnapshotBeforeUpdate != null && (k = c.getSnapshotBeforeUpdate(p, g)), Pe = d, d != null && d.type === B && d.key == null && (Pe = qr(d.props.children)), l = Ar(t, Ye(Pe) ? Pe : [Pe], e, n, r, i, s, o, l, a, u), c.base = e.__e, e.__u &= -161, c.__h.length && o.push(c), w && (c.__E = c.__ = null);
190
190
  } catch (xe) {
191
191
  if (e.__v = null, a || s != null) if (xe.then) {
192
192
  for (e.__u |= a ? 160 : 128; l && l.nodeType == 8 && l.nextSibling; ) l = l.nextSibling;
193
193
  s[s.indexOf(l)] = null, e.__e = l;
194
194
  } else {
195
- for (Tt = s.length; Tt--; ) sn(s[Tt]);
195
+ for (Tt = s.length; Tt--; ) on(s[Tt]);
196
196
  Dt(e);
197
197
  }
198
198
  else e.__e = n.__e, e.__k = n.__k, xe.then || Dt(e);
199
199
  m.__e(xe, e, n);
200
200
  }
201
- else s == null && e.__v == n.__v ? (e.__k = n.__k, e.__e = n.__e) : l = e.__e = Fi(n.__e, e, n, r, i, s, o, a, u);
201
+ else s == null && e.__v == n.__v ? (e.__k = n.__k, e.__e = n.__e) : l = e.__e = Di(n.__e, e, n, r, i, s, o, a, u);
202
202
  return (d = m.diffed) && d(e), 128 & e.__u ? void 0 : l;
203
203
  }
204
204
  function Dt(t) {
205
205
  t && t.__c && (t.__c.__e = !0), t && t.__k && t.__k.forEach(Dt);
206
206
  }
207
- function Ir(t, e, n) {
208
- for (var r = 0; r < n.length; r++) an(n[r], n[++r], n[++r]);
207
+ function $r(t, e, n) {
208
+ for (var r = 0; r < n.length; r++) ln(n[r], n[++r], n[++r]);
209
209
  m.__c && m.__c(e, t), t.some(function(i) {
210
210
  try {
211
211
  t = i.__h, i.__h = [], t.some(function(s) {
@@ -216,10 +216,10 @@ function Ir(t, e, n) {
216
216
  }
217
217
  });
218
218
  }
219
- function $r(t) {
220
- return typeof t != "object" || t == null || t.__b && t.__b > 0 ? t : Xe(t) ? t.map($r) : K({}, t);
219
+ function qr(t) {
220
+ return typeof t != "object" || t == null || t.__b && t.__b > 0 ? t : Ye(t) ? t.map(qr) : K({}, t);
221
221
  }
222
- function Fi(t, e, n, r, i, s, o, l, a) {
222
+ function Di(t, e, n, r, i, s, o, l, a) {
223
223
  var u, d, c, f, p, g, k, w = n.props, v = e.props, _ = e.type;
224
224
  if (_ == "svg" ? i = "http://www.w3.org/2000/svg" : _ == "math" ? i = "http://www.w3.org/1998/Math/MathML" : i || (i = "http://www.w3.org/1999/xhtml"), s != null) {
225
225
  for (u = 0; u < s.length; u++) if ((p = s[u]) && "setAttribute" in p == !!_ && (_ ? p.localName == _ : p.nodeType == 3)) {
@@ -233,22 +233,22 @@ function Fi(t, e, n, r, i, s, o, l, a) {
233
233
  }
234
234
  if (_ == null) w === v || l && t.data == v || (t.data = v);
235
235
  else {
236
- if (s = s && Ye.call(t.childNodes), w = n.props || We, !l && s != null) for (w = {}, u = 0; u < t.attributes.length; u++) w[(p = t.attributes[u]).name] = p.value;
236
+ if (s = s && Ke.call(t.childNodes), w = n.props || Ue, !l && s != null) for (w = {}, u = 0; u < t.attributes.length; u++) w[(p = t.attributes[u]).name] = p.value;
237
237
  for (u in w) if (p = w[u], u != "children") {
238
238
  if (u == "dangerouslySetInnerHTML") c = p;
239
239
  else if (!(u in v)) {
240
240
  if (u == "value" && "defaultValue" in v || u == "checked" && "defaultChecked" in v) continue;
241
- it(t, u, null, p, i);
241
+ rt(t, u, null, p, i);
242
242
  }
243
243
  }
244
- for (u in v) p = v[u], u == "children" ? f = p : u == "dangerouslySetInnerHTML" ? d = p : u == "value" ? g = p : u == "checked" ? k = p : l && typeof p != "function" || w[u] === p || it(t, u, p, w[u], i);
244
+ for (u in v) p = v[u], u == "children" ? f = p : u == "dangerouslySetInnerHTML" ? d = p : u == "value" ? g = p : u == "checked" ? k = p : l && typeof p != "function" || w[u] === p || rt(t, u, p, w[u], i);
245
245
  if (d) l || c && (d.__html == c.__html || d.__html == t.innerHTML) || (t.innerHTML = d.__html), e.__k = [];
246
- else if (c && (t.innerHTML = ""), Tr(e.type == "template" ? t.content : t, Xe(f) ? f : [f], e, n, r, _ == "foreignObject" ? "http://www.w3.org/1999/xhtml" : i, s, o, s ? s[0] : n.__k && Ce(n, 0), l, a), s != null) for (u = s.length; u--; ) sn(s[u]);
247
- l || (u = "value", _ == "progress" && g == null ? t.removeAttribute("value") : g != null && (g !== t[u] || _ == "progress" && !g || _ == "option" && g != w[u]) && it(t, u, g, w[u], i), u = "checked", k != null && k != t[u] && it(t, u, k, w[u], i));
246
+ else if (c && (t.innerHTML = ""), Ar(e.type == "template" ? t.content : t, Ye(f) ? f : [f], e, n, r, _ == "foreignObject" ? "http://www.w3.org/1999/xhtml" : i, s, o, s ? s[0] : n.__k && Se(n, 0), l, a), s != null) for (u = s.length; u--; ) on(s[u]);
247
+ l || (u = "value", _ == "progress" && g == null ? t.removeAttribute("value") : g != null && (g !== t[u] || _ == "progress" && !g || _ == "option" && g != w[u]) && rt(t, u, g, w[u], i), u = "checked", k != null && k != t[u] && rt(t, u, k, w[u], i));
248
248
  }
249
249
  return t;
250
250
  }
251
- function an(t, e, n) {
251
+ function ln(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 an(t, e, n) {
258
258
  m.__e(i, n);
259
259
  }
260
260
  }
261
- function qr(t, e, n) {
261
+ function Er(t, e, n) {
262
262
  var r, i;
263
- if (m.unmount && m.unmount(t), (r = t.ref) && (r.current && r.current != t.__e || an(r, null, e)), (r = t.__c) != null) {
263
+ if (m.unmount && m.unmount(t), (r = t.ref) && (r.current && r.current != t.__e || ln(r, null, e)), (r = t.__c) != null) {
264
264
  if (r.componentWillUnmount) try {
265
265
  r.componentWillUnmount();
266
266
  } catch (s) {
@@ -268,25 +268,25 @@ function qr(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] && qr(r[i], e, n || typeof t.type != "function");
272
- n || sn(t.__e), t.__c = t.__ = t.__e = void 0;
271
+ if (r = t.__k) for (i = 0; i < r.length; i++) r[i] && Er(r[i], e, n || typeof t.type != "function");
272
+ n || on(t.__e), t.__c = t.__ = t.__e = void 0;
273
273
  }
274
- function Di(t, e, n) {
274
+ function Ui(t, e, n) {
275
275
  return this.constructor(t, n);
276
276
  }
277
277
  function he(t, e, n) {
278
278
  var r, i, s, o;
279
- e == document && (e = document.documentElement), m.__ && m.__(t, e), i = (r = typeof n == "function") ? null : n && n.__k || e.__k, s = [], o = [], on(e, t = (!r && n || e).__k = ne(B, null, [t]), i || We, We, e.namespaceURI, !r && n ? [n] : i ? null : e.firstChild ? Ye.call(e.childNodes) : null, s, !r && n ? n : i ? i.__e : e.firstChild, r, o), Ir(s, t, o);
279
+ e == document && (e = document.documentElement), m.__ && m.__(t, e), i = (r = typeof n == "function") ? null : n && n.__k || e.__k, s = [], o = [], an(e, t = (!r && n || e).__k = re(B, null, [t]), i || Ue, Ue, e.namespaceURI, !r && n ? [n] : i ? null : e.firstChild ? Ke.call(e.childNodes) : null, s, !r && n ? n : i ? i.__e : e.firstChild, r, o), $r(s, t, o);
280
280
  }
281
- function Er(t, e) {
282
- he(t, e, Er);
281
+ function Pr(t, e) {
282
+ he(t, e, Pr);
283
283
  }
284
- function Ui(t, e, n) {
284
+ function Wi(t, e, n) {
285
285
  var r, i, s, o, l = K({}, t.props);
286
286
  for (s in t.type && t.type.defaultProps && (o = t.type.defaultProps), e) s == "key" ? r = e[s] : s == "ref" ? i = e[s] : l[s] = e[s] === void 0 && o != null ? o[s] : e[s];
287
- return arguments.length > 2 && (l.children = arguments.length > 3 ? Ye.call(arguments, 2) : n), Be(t.type, l, r || t.key, i || t.ref, null);
287
+ return arguments.length > 2 && (l.children = arguments.length > 3 ? Ke.call(arguments, 2) : n), Ve(t.type, l, r || t.key, i || t.ref, null);
288
288
  }
289
- function Wi(t) {
289
+ function Hi(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() {
@@ -305,48 +305,48 @@ function Wi(t) {
305
305
  };
306
306
  }), n.children;
307
307
  }
308
- return e.__c = "__cC" + Sr++, e.__ = t, e.Provider = e.__l = (e.Consumer = function(n, r) {
308
+ return e.__c = "__cC" + Cr++, 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
- Ye = Cr.slice, m = { __e: function(t, e, n, r) {
312
+ Ke = Rr.slice, m = { __e: function(t, e, n, r) {
313
313
  for (var i, s, o; e = e.__; ) if ((i = e.__c) && !i.__) try {
314
314
  if ((s = i.constructor) && s.getDerivedStateFromError != null && (i.setState(s.getDerivedStateFromError(t)), o = i.__d), i.componentDidCatch != null && (i.componentDidCatch(t, r || {}), o = i.__d), o) return i.__E = i;
315
315
  } catch (l) {
316
316
  t = l;
317
317
  }
318
318
  throw t;
319
- } }, vr = 0, _r = function(t) {
319
+ } }, _r = 0, kr = function(t) {
320
320
  return t != null && t.constructor == null;
321
321
  }, Q.prototype.setState = function(t, e) {
322
322
  var n;
323
323
  n = this.__s != null && this.__s != this.state ? this.__s : this.__s = K({}, this.state), typeof t == "function" && (t = t(K({}, n), this.props)), t && K(n, t), t != null && this.__v && (e && this._sb.push(e), Ft(this));
324
324
  }, Q.prototype.forceUpdate = function(t) {
325
325
  this.__v && (this.__e = !0, t && this.__h.push(t), Ft(this));
326
- }, Q.prototype.render = B, le = [], kr = typeof Promise == "function" ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, wr = function(t, e) {
326
+ }, Q.prototype.render = B, le = [], 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
- }, dt.__r = 0, jr = /(PointerCapture)$|Capture$/i, rn = 0, Vt = qn(!1), Bt = qn(!0), Sr = 0;
329
- var Hi = 0;
328
+ }, ht.__r = 0, Sr = /(PointerCapture)$|Capture$/i, sn = 0, Vt = En(!1), Bt = En(!0), Cr = 0;
329
+ var Ji = 0;
330
330
  function h(t, e, n, r, i, s) {
331
331
  e || (e = {});
332
332
  var o, l, a = e;
333
333
  if ("ref" in a) for (l in a = {}, e) l == "ref" ? o = e[l] : a[l] = e[l];
334
- var u = { type: t, props: a, key: n, ref: o, __k: null, __: null, __b: 0, __e: null, __c: null, constructor: void 0, __v: --Hi, __i: -1, __u: 0, __source: i, __self: s };
334
+ var u = { type: t, props: a, key: n, ref: o, __k: null, __: null, __b: 0, __e: null, __c: null, constructor: void 0, __v: --Ji, __i: -1, __u: 0, __source: i, __self: s };
335
335
  if (typeof t == "function" && (o = t.defaultProps)) for (l in o) a[l] === void 0 && (a[l] = o[l]);
336
336
  return m.vnode && m.vnode(u), u;
337
337
  }
338
- var oe, j, It, En, Re = 0, Pr = [], S = m, Pn = S.__b, Mn = S.__r, On = S.diffed, Ln = S.__c, Nn = S.unmount, zn = S.__;
339
- function $e(t, e) {
340
- S.__h && S.__h(j, t, Re || e), Re = 0;
338
+ var oe, j, It, Pn, Ce = 0, Mr = [], S = m, Mn = S.__b, On = S.__r, Ln = S.diffed, Nn = S.__c, zn = S.unmount, Qn = S.__;
339
+ function Ie(t, e) {
340
+ S.__h && S.__h(j, t, Ce || e), Ce = 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 T(t) {
345
- return Re = 1, ln(Nr, t);
345
+ return Ce = 1, cn(zr, t);
346
346
  }
347
- function ln(t, e, n) {
348
- var r = $e(oe++, 2);
349
- if (r.t = t, !r.__c && (r.__ = [n ? n(e) : Nr(void 0, e), function(l) {
347
+ function cn(t, e, n) {
348
+ var r = Ie(oe++, 2);
349
+ if (r.t = t, !r.__c && (r.__ = [n ? n(e) : zr(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)) {
@@ -379,20 +379,20 @@ function ln(t, e, n) {
379
379
  return r.__N || r.__;
380
380
  }
381
381
  function F(t, e) {
382
- var n = $e(oe++, 3);
383
- !S.__s && cn(n.__H, e) && (n.__ = t, n.u = e, j.__H.__h.push(n));
382
+ var n = Ie(oe++, 3);
383
+ !S.__s && un(n.__H, e) && (n.__ = t, n.u = e, j.__H.__h.push(n));
384
384
  }
385
- function et(t, e) {
386
- var n = $e(oe++, 4);
387
- !S.__s && cn(n.__H, e) && (n.__ = t, n.u = e, j.__h.push(n));
385
+ function Xe(t, e) {
386
+ var n = Ie(oe++, 4);
387
+ !S.__s && un(n.__H, e) && (n.__ = t, n.u = e, j.__h.push(n));
388
388
  }
389
389
  function vt(t) {
390
- return Re = 5, D(function() {
390
+ return Ce = 5, D(function() {
391
391
  return { current: t };
392
392
  }, []);
393
393
  }
394
- function Mr(t, e, n) {
395
- Re = 6, et(function() {
394
+ function Or(t, e, n) {
395
+ Ce = 6, Xe(function() {
396
396
  if (typeof t == "function") {
397
397
  var r = t(e());
398
398
  return function() {
@@ -405,23 +405,23 @@ function Mr(t, e, n) {
405
405
  }, n == null ? n : n.concat(t));
406
406
  }
407
407
  function D(t, e) {
408
- var n = $e(oe++, 7);
409
- return cn(n.__H, e) && (n.__ = t(), n.__H = e, n.__h = t), n.__;
408
+ var n = Ie(oe++, 7);
409
+ return un(n.__H, e) && (n.__ = t(), n.__H = e, n.__h = t), n.__;
410
410
  }
411
- function He(t, e) {
412
- return Re = 8, D(function() {
411
+ function We(t, e) {
412
+ return Ce = 8, D(function() {
413
413
  return t;
414
414
  }, e);
415
415
  }
416
416
  function _t(t) {
417
- var e = j.context[t.__c], n = $e(oe++, 9);
417
+ var e = j.context[t.__c], n = Ie(oe++, 9);
418
418
  return n.c = t, e ? (n.__ == null && (n.__ = !0, e.sub(j)), e.props.value) : t.__;
419
419
  }
420
- function Or(t, e) {
420
+ function Lr(t, e) {
421
421
  S.useDebugValue && S.useDebugValue(e ? e(t) : t);
422
422
  }
423
- function Lr() {
424
- var t = $e(oe++, 11);
423
+ function Nr() {
424
+ var t = Ie(oe++, 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,33 +429,33 @@ function Lr() {
429
429
  }
430
430
  return t.__;
431
431
  }
432
- function Ji() {
433
- for (var t; t = Pr.shift(); ) if (t.__P && t.__H) try {
434
- t.__H.__h.forEach(ct), t.__H.__h.forEach(Ut), t.__H.__h = [];
432
+ function Zi() {
433
+ for (var t; t = Mr.shift(); ) if (t.__P && t.__H) try {
434
+ t.__H.__h.forEach(lt), t.__H.__h.forEach(Ut), 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, Pn && Pn(t);
440
+ j = null, Mn && Mn(t);
441
441
  }, S.__ = function(t, e) {
442
- t && e.__k && e.__k.__m && (t.__m = e.__k.__m), zn && zn(t, e);
442
+ t && e.__k && e.__k.__m && (t.__m = e.__k.__m), Qn && Qn(t, e);
443
443
  }, S.__r = function(t) {
444
- Mn && Mn(t), oe = 0;
444
+ On && On(t), oe = 0;
445
445
  var e = (j = t.__c).__H;
446
446
  e && (It === 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(ct), e.__h.forEach(Ut), e.__h = [], oe = 0)), It = j;
448
+ })) : (e.__h.forEach(lt), e.__h.forEach(Ut), e.__h = [], oe = 0)), It = j;
449
449
  }, S.diffed = function(t) {
450
- On && On(t);
450
+ Ln && Ln(t);
451
451
  var e = t.__c;
452
- e && e.__H && (e.__H.__h.length && (Pr.push(e) !== 1 && En === S.requestAnimationFrame || ((En = S.requestAnimationFrame) || Zi)(Ji)), e.__H.__.forEach(function(n) {
452
+ e && e.__H && (e.__H.__h.length && (Mr.push(e) !== 1 && Pn === S.requestAnimationFrame || ((Pn = S.requestAnimationFrame) || Gi)(Zi)), e.__H.__.forEach(function(n) {
453
453
  n.u && (n.__H = n.u), n.u = void 0;
454
454
  })), It = j = null;
455
455
  }, S.__c = function(t, e) {
456
456
  e.some(function(n) {
457
457
  try {
458
- n.__h.forEach(ct), n.__h = n.__h.filter(function(r) {
458
+ n.__h.forEach(lt), n.__h = n.__h.filter(function(r) {
459
459
  return !r.__ || Ut(r);
460
460
  });
461
461
  } catch (r) {
@@ -463,26 +463,26 @@ S.__b = function(t) {
463
463
  i.__h && (i.__h = []);
464
464
  }), e = [], S.__e(r, n.__v);
465
465
  }
466
- }), Ln && Ln(t, e);
466
+ }), Nn && Nn(t, e);
467
467
  }, S.unmount = function(t) {
468
- Nn && Nn(t);
468
+ zn && zn(t);
469
469
  var e, n = t.__c;
470
470
  n && n.__H && (n.__H.__.forEach(function(r) {
471
471
  try {
472
- ct(r);
472
+ lt(r);
473
473
  } catch (i) {
474
474
  e = i;
475
475
  }
476
476
  }), n.__H = void 0, e && S.__e(e, n.__v));
477
477
  };
478
- var Qn = typeof requestAnimationFrame == "function";
479
- function Zi(t) {
478
+ var Vn = typeof requestAnimationFrame == "function";
479
+ function Gi(t) {
480
480
  var e, n = function() {
481
- clearTimeout(r), Qn && cancelAnimationFrame(e), setTimeout(t);
481
+ clearTimeout(r), Vn && cancelAnimationFrame(e), setTimeout(t);
482
482
  }, r = setTimeout(n, 35);
483
- Qn && (e = requestAnimationFrame(n));
483
+ Vn && (e = requestAnimationFrame(n));
484
484
  }
485
- function ct(t) {
485
+ function lt(t) {
486
486
  var e = j, n = t.__c;
487
487
  typeof n == "function" && (t.__c = void 0, n()), j = e;
488
488
  }
@@ -490,15 +490,15 @@ function Ut(t) {
490
490
  var e = j;
491
491
  t.__c = t.__(), j = e;
492
492
  }
493
- function cn(t, e) {
493
+ function un(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 Nr(t, e) {
498
+ function zr(t, e) {
499
499
  return typeof e == "function" ? e(t) : e;
500
500
  }
501
- function zr(t, e) {
501
+ function Qr(t, e) {
502
502
  for (var n in e) t[n] = e[n];
503
503
  return t;
504
504
  }
@@ -507,9 +507,9 @@ function Wt(t, e) {
507
507
  for (var r in e) if (r !== "__source" && t[r] !== e[r]) return !0;
508
508
  return !1;
509
509
  }
510
- function Qr(t, e) {
510
+ function Vr(t, e) {
511
511
  var n = e(), r = T({ t: { __: n, u: e } }), i = r[0].t, s = r[1];
512
- return et(function() {
512
+ return Xe(function() {
513
513
  i.__ = n, i.u = e, $t(i) && s({ t: i });
514
514
  }, [t, n, e]), F(function() {
515
515
  return $t(i) && s({ t: i }), t(function() {
@@ -526,80 +526,80 @@ function $t(t) {
526
526
  return !0;
527
527
  }
528
528
  }
529
- function Vr(t) {
529
+ function Br(t) {
530
530
  t();
531
531
  }
532
- function Br(t) {
532
+ function Fr(t) {
533
533
  return t;
534
534
  }
535
- function Fr() {
536
- return [!1, Vr];
535
+ function Dr() {
536
+ return [!1, Br];
537
537
  }
538
- var Dr = et;
538
+ var Ur = Xe;
539
539
  function Ht(t, e) {
540
540
  this.props = t, this.context = e;
541
541
  }
542
- function Gi(t, e) {
542
+ function Ki(t, e) {
543
543
  function n(i) {
544
544
  var s = this.props.ref, o = s == i.ref;
545
545
  return !o && s && (s.call ? s(null) : s.current = null), e ? !e(this.props, i) || !o : Wt(this.props, i);
546
546
  }
547
547
  function r(i) {
548
- return this.shouldComponentUpdate = n, ne(t, i);
548
+ return this.shouldComponentUpdate = n, re(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
552
  (Ht.prototype = new Q()).isPureReactComponent = !0, Ht.prototype.shouldComponentUpdate = function(t, e) {
553
553
  return Wt(this.props, t) || Wt(this.state, e);
554
554
  };
555
- var Vn = m.__b;
555
+ var Bn = m.__b;
556
556
  m.__b = function(t) {
557
- t.type && t.type.__f && t.ref && (t.props.ref = t.ref, t.ref = null), Vn && Vn(t);
557
+ t.type && t.type.__f && t.ref && (t.props.ref = t.ref, t.ref = null), Bn && Bn(t);
558
558
  };
559
- var Ki = typeof Symbol < "u" && Symbol.for && /* @__PURE__ */ Symbol.for("react.forward_ref") || 3911;
560
- function Yi(t) {
559
+ var Yi = typeof Symbol < "u" && Symbol.for && /* @__PURE__ */ Symbol.for("react.forward_ref") || 3911;
560
+ function Xi(t) {
561
561
  function e(n) {
562
- var r = zr({}, n);
562
+ var r = Qr({}, n);
563
563
  return delete r.ref, t(r, n.ref || null);
564
564
  }
565
- return e.$$typeof = Ki, e.render = t, e.prototype.isReactComponent = e.__f = !0, e.displayName = "ForwardRef(" + (t.displayName || t.name) + ")", e;
565
+ return e.$$typeof = Yi, e.render = t, e.prototype.isReactComponent = e.__f = !0, e.displayName = "ForwardRef(" + (t.displayName || t.name) + ")", e;
566
566
  }
567
- var Bn = function(t, e) {
568
- return t == null ? null : te(te(t).map(e));
569
- }, Xi = { map: Bn, forEach: Bn, count: function(t) {
570
- return t ? te(t).length : 0;
567
+ var Fn = function(t, e) {
568
+ return t == null ? null : ne(ne(t).map(e));
569
+ }, es = { map: Fn, forEach: Fn, count: function(t) {
570
+ return t ? ne(t).length : 0;
571
571
  }, only: function(t) {
572
- var e = te(t);
572
+ var e = ne(t);
573
573
  if (e.length !== 1) throw "Children.only";
574
574
  return e[0];
575
- }, toArray: te }, es = m.__e;
575
+ }, toArray: ne }, ts = m.__e;
576
576
  m.__e = function(t, e, n, r) {
577
577
  if (t.then) {
578
578
  for (var i, s = e; s = s.__; ) if ((i = s.__c) && i.__c) return e.__e == null && (e.__e = n.__e, e.__k = n.__k), i.__c(t, e);
579
579
  }
580
- es(t, e, n, r);
580
+ ts(t, e, n, r);
581
581
  };
582
- var Fn = m.unmount;
583
- function Ur(t, e, n) {
582
+ var Dn = m.unmount;
583
+ function Wr(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 = zr({}, 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 Ur(r, e, n);
586
+ }), t.__c.__H = null), (t = Qr({}, 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 Wr(r, e, n);
588
588
  })), t;
589
589
  }
590
- function Wr(t, e, n) {
590
+ function Hr(t, e, n) {
591
591
  return t && n && (t.__v = null, t.__k = t.__k && t.__k.map(function(r) {
592
- return Wr(r, e, n);
592
+ return Hr(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
- function ut() {
595
+ function ct() {
596
596
  this.__u = 0, this.o = null, this.__b = null;
597
597
  }
598
- function Hr(t) {
598
+ function Jr(t) {
599
599
  var e = t.__.__c;
600
600
  return e && e.__a && e.__a(t);
601
601
  }
602
- function ts(t) {
602
+ function ns(t) {
603
603
  var e, n, r;
604
604
  function i(s) {
605
605
  if (e || (e = t()).then(function(o) {
@@ -608,20 +608,20 @@ function ts(t) {
608
608
  r = o;
609
609
  }), r) throw r;
610
610
  if (!n) throw e;
611
- return ne(n, s);
611
+ return re(n, s);
612
612
  }
613
613
  return i.displayName = "Lazy", i.__f = !0, i;
614
614
  }
615
- function ze() {
615
+ function Ne() {
616
616
  this.i = null, this.l = null;
617
617
  }
618
618
  m.unmount = function(t) {
619
619
  var e = t.__c;
620
- e && e.__R && e.__R(), e && 32 & t.__u && (t.type = null), Fn && Fn(t);
621
- }, (ut.prototype = new Q()).__c = function(t, e) {
620
+ e && e.__R && e.__R(), e && 32 & t.__u && (t.type = null), Dn && Dn(t);
621
+ }, (ct.prototype = new Q()).__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 = Hr(r.__v), s = !1, o = function() {
624
+ var i = Jr(r.__v), s = !1, o = function() {
625
625
  s || (s = !0, n.__R = null, i ? i(l) : l());
626
626
  };
627
627
  n.__R = o;
@@ -629,39 +629,39 @@ m.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] = Wr(a, a.__c.__P, a.__c.__O);
632
+ r.__v.__k[0] = Hr(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();
636
636
  }
637
637
  };
638
638
  r.__u++ || 32 & e.__u || r.setState({ __a: r.__b = r.__v.__k[0] }), t.then(o, o);
639
- }, ut.prototype.componentWillUnmount = function() {
639
+ }, ct.prototype.componentWillUnmount = function() {
640
640
  this.o = [];
641
- }, ut.prototype.render = function(t, e) {
641
+ }, ct.prototype.render = function(t, e) {
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] = Ur(this.__b, n, r.__O = r.__P);
645
+ this.__v.__k[0] = Wr(this.__b, n, r.__O = r.__P);
646
646
  }
647
647
  this.__b = null;
648
648
  }
649
- var i = e.__a && ne(B, null, t.fallback);
650
- return i && (i.__u &= -33), [ne(B, null, e.__a ? null : t.children), i];
649
+ var i = e.__a && re(B, null, t.fallback);
650
+ return i && (i.__u &= -33), [re(B, null, e.__a ? null : t.children), i];
651
651
  };
652
- var Dn = function(t, e, n) {
652
+ var Un = 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 ns(t) {
659
+ function rs(t) {
660
660
  return this.getChildContext = function() {
661
661
  return t.context;
662
662
  }, t.children;
663
663
  }
664
- function rs(t) {
664
+ function is(t) {
665
665
  var e = this, n = t.h;
666
666
  if (e.componentWillUnmount = function() {
667
667
  he(null, e.v), e.v = null, e.h = null;
@@ -675,40 +675,40 @@ function rs(t) {
675
675
  this.childNodes.splice(this.childNodes.indexOf(i) >>> 1, 1), e.h.removeChild(i);
676
676
  } };
677
677
  }
678
- he(ne(ns, { context: e.context }, t.__v), e.v);
678
+ he(re(rs, { context: e.context }, t.__v), e.v);
679
679
  }
680
- function is(t, e) {
681
- var n = ne(rs, { __v: t, h: e });
680
+ function ss(t, e) {
681
+ var n = re(is, { __v: t, h: e });
682
682
  return n.containerInfo = e, n;
683
683
  }
684
- (ze.prototype = new Q()).__a = function(t) {
685
- var e = this, n = Hr(e.__v), r = e.l.get(t);
684
+ (Ne.prototype = new Q()).__a = function(t) {
685
+ var e = this, n = Jr(e.__v), r = e.l.get(t);
686
686
  return r[0]++, function(i) {
687
687
  var s = function() {
688
- e.props.revealOrder ? (r.push(i), Dn(e, t, r)) : i();
688
+ e.props.revealOrder ? (r.push(i), Un(e, t, r)) : i();
689
689
  };
690
690
  n ? n(s) : s();
691
691
  };
692
- }, ze.prototype.render = function(t) {
692
+ }, Ne.prototype.render = function(t) {
693
693
  this.i = null, this.l = /* @__PURE__ */ new Map();
694
- var e = te(t.children);
694
+ var e = ne(t.children);
695
695
  t.revealOrder && t.revealOrder[0] === "b" && e.reverse();
696
696
  for (var n = e.length; n--; ) this.l.set(e[n], this.i = [1, 0, this.i]);
697
697
  return t.children;
698
- }, ze.prototype.componentDidUpdate = ze.prototype.componentDidMount = function() {
698
+ }, Ne.prototype.componentDidUpdate = Ne.prototype.componentDidMount = function() {
699
699
  var t = this;
700
700
  this.l.forEach(function(e, n) {
701
- Dn(t, n, e);
701
+ Un(t, n, e);
702
702
  });
703
703
  };
704
- var Jr = typeof Symbol < "u" && Symbol.for && /* @__PURE__ */ Symbol.for("react.element") || 60103, ss = /^(?: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]/, os = /^on(Ani|Tra|Tou|BeforeInp|Compo)/, as = /[A-Z0-9]/g, ls = typeof document < "u", cs = function(t) {
704
+ var Zr = typeof Symbol < "u" && Symbol.for && /* @__PURE__ */ Symbol.for("react.element") || 60103, os = /^(?: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]/, as = /^on(Ani|Tra|Tou|BeforeInp|Compo)/, ls = /[A-Z0-9]/g, cs = typeof document < "u", us = function(t) {
705
705
  return (typeof Symbol < "u" && typeof /* @__PURE__ */ Symbol() == "symbol" ? /fil|che|rad/ : /fil|che|ra/).test(t);
706
706
  };
707
- function us(t, e, n) {
707
+ function hs(t, e, n) {
708
708
  return e.__k == null && (e.textContent = ""), he(t, e), typeof n == "function" && n(), t ? t.__c : null;
709
709
  }
710
- function hs(t, e, n) {
711
- return Er(t, e), typeof n == "function" && n(), t ? t.__c : null;
710
+ function ds(t, e, n) {
711
+ return Pr(t, e), typeof n == "function" && n(), t ? t.__c : null;
712
712
  }
713
713
  Q.prototype.isReactComponent = {}, ["componentWillMount", "componentWillReceiveProps", "componentWillUpdate"].forEach(function(t) {
714
714
  Object.defineProperty(Q.prototype, t, { configurable: !0, get: function() {
@@ -717,82 +717,82 @@ Q.prototype.isReactComponent = {}, ["componentWillMount", "componentWillReceiveP
717
717
  Object.defineProperty(this, t, { configurable: !0, writable: !0, value: e });
718
718
  } });
719
719
  });
720
- var Un = m.event;
721
- function ds() {
722
- }
720
+ var Wn = m.event;
723
721
  function ps() {
724
- return this.cancelBubble;
725
722
  }
726
723
  function fs() {
724
+ return this.cancelBubble;
725
+ }
726
+ function gs() {
727
727
  return this.defaultPrevented;
728
728
  }
729
729
  m.event = function(t) {
730
- return Un && (t = Un(t)), t.persist = ds, t.isPropagationStopped = ps, t.isDefaultPrevented = fs, t.nativeEvent = t;
730
+ return Wn && (t = Wn(t)), t.persist = ps, t.isPropagationStopped = fs, t.isDefaultPrevented = gs, t.nativeEvent = t;
731
731
  };
732
- var un, gs = { enumerable: !1, configurable: !0, get: function() {
732
+ var hn, ms = { enumerable: !1, configurable: !0, get: function() {
733
733
  return this.class;
734
- } }, Wn = m.vnode;
734
+ } }, Hn = m.vnode;
735
735
  m.vnode = function(t) {
736
736
  typeof t.type == "string" && (function(e) {
737
737
  var n = e.props, r = e.type, i = {}, s = r.indexOf("-") === -1;
738
738
  for (var o in n) {
739
739
  var l = n[o];
740
- if (!(o === "value" && "defaultValue" in n && l == null || ls && o === "children" && r === "noscript" || o === "class" || o === "className")) {
740
+ if (!(o === "value" && "defaultValue" in n && l == null || cs && o === "children" && r === "noscript" || o === "class" || o === "className")) {
741
741
  var a = o.toLowerCase();
742
- o === "defaultValue" && "value" in n && n.value == null ? o = "value" : o === "download" && l === !0 ? l = "" : a === "translate" && l === "no" ? l = !1 : a[0] === "o" && a[1] === "n" ? a === "ondoubleclick" ? o = "ondblclick" : a !== "onchange" || r !== "input" && r !== "textarea" || cs(n.type) ? a === "onfocus" ? o = "onfocusin" : a === "onblur" ? o = "onfocusout" : os.test(o) && (o = a) : a = o = "oninput" : s && ss.test(o) ? o = o.replace(as, "-$&").toLowerCase() : l === null && (l = void 0), a === "oninput" && i[o = a] && (o = "oninputCapture"), i[o] = l;
742
+ o === "defaultValue" && "value" in n && n.value == null ? o = "value" : o === "download" && l === !0 ? l = "" : a === "translate" && l === "no" ? l = !1 : a[0] === "o" && a[1] === "n" ? a === "ondoubleclick" ? o = "ondblclick" : a !== "onchange" || r !== "input" && r !== "textarea" || us(n.type) ? a === "onfocus" ? o = "onfocusin" : a === "onblur" ? o = "onfocusout" : as.test(o) && (o = a) : a = o = "oninput" : s && os.test(o) ? o = o.replace(ls, "-$&").toLowerCase() : l === null && (l = void 0), a === "oninput" && i[o = a] && (o = "oninputCapture"), i[o] = l;
743
743
  }
744
744
  }
745
- r == "select" && i.multiple && Array.isArray(i.value) && (i.value = te(n.children).forEach(function(u) {
745
+ r == "select" && i.multiple && Array.isArray(i.value) && (i.value = ne(n.children).forEach(function(u) {
746
746
  u.props.selected = i.value.indexOf(u.props.value) != -1;
747
- })), r == "select" && i.defaultValue != null && (i.value = te(n.children).forEach(function(u) {
747
+ })), r == "select" && i.defaultValue != null && (i.value = ne(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", gs)) : (n.className && !n.class || n.class && n.className) && (i.class = i.className = n.className), e.props = i;
750
- })(t), t.$$typeof = Jr, Wn && Wn(t);
749
+ })), n.class && !n.className ? (i.class = n.class, Object.defineProperty(i, "className", ms)) : (n.className && !n.class || n.class && n.className) && (i.class = i.className = n.className), e.props = i;
750
+ })(t), t.$$typeof = Zr, Hn && Hn(t);
751
751
  };
752
- var Hn = m.__r;
752
+ var Jn = m.__r;
753
753
  m.__r = function(t) {
754
- Hn && Hn(t), un = t.__c;
754
+ Jn && Jn(t), hn = t.__c;
755
755
  };
756
- var Jn = m.diffed;
756
+ var Zn = m.diffed;
757
757
  m.diffed = function(t) {
758
- Jn && Jn(t);
758
+ Zn && Zn(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), un = null;
760
+ n != null && t.type === "textarea" && "value" in e && e.value !== n.value && (n.value = e.value == null ? "" : e.value), hn = null;
761
761
  };
762
- var ms = { ReactCurrentDispatcher: { current: { readContext: function(t) {
763
- return un.__n[t.__c].props.value;
764
- }, useCallback: He, useContext: _t, useDebugValue: Or, useDeferredValue: Br, useEffect: F, useId: Lr, useImperativeHandle: Mr, useInsertionEffect: Dr, useLayoutEffect: et, useMemo: D, useReducer: ln, useRef: vt, useState: T, useSyncExternalStore: Qr, useTransition: Fr } } };
765
- function xs(t) {
766
- return ne.bind(null, t);
762
+ var xs = { ReactCurrentDispatcher: { current: { readContext: function(t) {
763
+ return hn.__n[t.__c].props.value;
764
+ }, useCallback: We, useContext: _t, useDebugValue: Lr, useDeferredValue: Fr, useEffect: F, useId: Nr, useImperativeHandle: Or, useInsertionEffect: Ur, useLayoutEffect: Xe, useMemo: D, useReducer: cn, useRef: vt, useState: T, useSyncExternalStore: Vr, useTransition: Dr } } };
765
+ function bs(t) {
766
+ return re.bind(null, t);
767
767
  }
768
768
  function kt(t) {
769
- return !!t && t.$$typeof === Jr;
770
- }
771
- function bs(t) {
772
- return kt(t) && t.type === B;
769
+ return !!t && t.$$typeof === Zr;
773
770
  }
774
771
  function ys(t) {
775
- return !!t && !!t.displayName && (typeof t.displayName == "string" || t.displayName instanceof String) && t.displayName.startsWith("Memo(");
772
+ return kt(t) && t.type === B;
776
773
  }
777
774
  function vs(t) {
778
- return kt(t) ? Ui.apply(null, arguments) : t;
775
+ return !!t && !!t.displayName && (typeof t.displayName == "string" || t.displayName instanceof String) && t.displayName.startsWith("Memo(");
779
776
  }
780
777
  function _s(t) {
781
- return !!t.__k && (he(null, t), !0);
778
+ return kt(t) ? Wi.apply(null, arguments) : t;
782
779
  }
783
780
  function ks(t) {
781
+ return !!t.__k && (he(null, t), !0);
782
+ }
783
+ function ws(t) {
784
784
  return t && (t.base || t.nodeType === 1 && t) || null;
785
785
  }
786
- var ws = function(t, e) {
786
+ var js = function(t, e) {
787
787
  return t(e);
788
- }, js = function(t, e) {
788
+ }, Ss = function(t, e) {
789
789
  return t(e);
790
- }, Ss = B, Cs = kt, hn = { useState: T, useId: Lr, useReducer: ln, useEffect: F, useLayoutEffect: et, useInsertionEffect: Dr, useTransition: Fr, useDeferredValue: Br, useSyncExternalStore: Qr, startTransition: Vr, useRef: vt, useImperativeHandle: Mr, useMemo: D, useCallback: He, useContext: _t, useDebugValue: Or, version: "18.3.1", Children: Xi, render: us, hydrate: hs, unmountComponentAtNode: _s, createPortal: is, createElement: ne, createContext: Wi, createFactory: xs, cloneElement: vs, createRef: Qi, Fragment: B, isValidElement: kt, isElement: Cs, isFragment: bs, isMemo: ys, findDOMNode: ks, Component: Q, PureComponent: Ht, memo: Gi, forwardRef: Yi, flushSync: js, unstable_batchedUpdates: ws, StrictMode: Ss, Suspense: ut, SuspenseList: ze, lazy: ts, __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: ms }, G = [], O = [], Rs = Uint8Array, qt = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
791
- for (var be = 0, Ts = qt.length; be < Ts; ++be)
790
+ }, Cs = B, Rs = kt, dn = { useState: T, useId: Nr, useReducer: cn, useEffect: F, useLayoutEffect: Xe, useInsertionEffect: Ur, useTransition: Dr, useDeferredValue: Fr, useSyncExternalStore: Vr, startTransition: Br, useRef: vt, useImperativeHandle: Or, useMemo: D, useCallback: We, useContext: _t, useDebugValue: Lr, version: "18.3.1", Children: es, render: hs, hydrate: ds, unmountComponentAtNode: ks, createPortal: ss, createElement: re, createContext: Hi, createFactory: bs, cloneElement: _s, createRef: Vi, Fragment: B, isValidElement: kt, isElement: Rs, isFragment: ys, isMemo: vs, findDOMNode: ws, Component: Q, PureComponent: Ht, memo: Ki, forwardRef: Xi, flushSync: Ss, unstable_batchedUpdates: js, StrictMode: Cs, Suspense: ct, SuspenseList: Ne, lazy: ns, __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: xs }, G = [], O = [], Ts = Uint8Array, qt = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
791
+ for (var be = 0, As = qt.length; be < As; ++be)
792
792
  G[be] = qt[be], O[qt.charCodeAt(be)] = be;
793
793
  O[45] = 62;
794
794
  O[95] = 63;
795
- function As(t) {
795
+ function Is(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 As(t) {
801
801
  var r = n === e ? 0 : 4 - n % 4;
802
802
  return [n, r];
803
803
  }
804
- function Is(t, e, n) {
804
+ function $s(t, e, n) {
805
805
  return (e + n) * 3 / 4 - n;
806
806
  }
807
- function Je(t) {
808
- var e, n = As(t), r = n[0], i = n[1], s = new Rs(Is(t, r, i)), o = 0, l = i > 0 ? r - 4 : r, a;
807
+ function He(t) {
808
+ var e, n = Is(t), r = n[0], i = n[1], s = new Ts($s(t, r, i)), o = 0, l = i > 0 ? r - 4 : r, a;
809
809
  for (a = 0; a < l; a += 4)
810
810
  e = O[t.charCodeAt(a)] << 18 | O[t.charCodeAt(a + 1)] << 12 | O[t.charCodeAt(a + 2)] << 6 | O[t.charCodeAt(a + 3)], s[o++] = e >> 16 & 255, s[o++] = e >> 8 & 255, s[o++] = e & 255;
811
811
  return i === 2 && (e = O[t.charCodeAt(a)] << 2 | O[t.charCodeAt(a + 1)] >> 4, s[o++] = e & 255), i === 1 && (e = O[t.charCodeAt(a)] << 10 | O[t.charCodeAt(a + 1)] << 4 | O[t.charCodeAt(a + 2)] >> 2, s[o++] = e >> 8 & 255, s[o++] = e & 255), s;
812
812
  }
813
- function $s(t) {
813
+ function qs(t) {
814
814
  return G[t >> 18 & 63] + G[t >> 12 & 63] + G[t >> 6 & 63] + G[t & 63];
815
815
  }
816
- function qs(t, e, n) {
816
+ function Es(t, e, n) {
817
817
  for (var r, i = [], s = e; s < n; s += 3)
818
- r = (t[s] << 16 & 16711680) + (t[s + 1] << 8 & 65280) + (t[s + 2] & 255), i.push($s(r));
818
+ r = (t[s] << 16 & 16711680) + (t[s + 1] << 8 & 65280) + (t[s + 2] & 255), i.push(qs(r));
819
819
  return i.join("");
820
820
  }
821
- function Ze(t) {
821
+ function Je(t) {
822
822
  for (var e, n = t.length, r = n % 3, i = [], s = 16383, o = 0, l = n - r; o < l; o += s)
823
823
  i.push(
824
- qs(
824
+ Es(
825
825
  t,
826
826
  o,
827
827
  o + s > l ? l : o + s
@@ -831,16 +831,16 @@ function Ze(t) {
831
831
  G[e >> 10] + G[e >> 4 & 63] + G[e << 2 & 63] + "="
832
832
  )), i.join("");
833
833
  }
834
- function ee(t) {
834
+ function te(t) {
835
835
  if (t === void 0)
836
836
  return {};
837
- if (!Zr(t))
837
+ if (!Gr(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 Es(t) {
843
+ function Ps(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,58 +865,58 @@ function Es(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 Zr(t) {
868
+ function Gr(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 Gr = !0, Te = BigInt("-9223372036854775808"), dn = BigInt("9223372036854775807"), Jt = BigInt("0"), Ps = BigInt("8"), Ms = BigInt("256");
875
- function Kr(t) {
874
+ const Kr = !0, Re = BigInt("-9223372036854775808"), pn = BigInt("9223372036854775807"), Jt = BigInt("0"), Ms = BigInt("8"), Os = BigInt("256");
875
+ function Yr(t) {
876
876
  return Number.isNaN(t) || !Number.isFinite(t) || Object.is(t, -0);
877
877
  }
878
- function Os(t) {
879
- t < Jt && (t -= Te + Te);
878
+ function Ls(t) {
879
+ t < Jt && (t -= Re + Re);
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 >>= Ps;
886
- return Ze(n);
885
+ n.set([parseInt(i, 16)], r++), t >>= Ms;
886
+ return Je(n);
887
887
  }
888
- function Ls(t) {
889
- const e = Je(t);
888
+ function Ns(t) {
889
+ const e = He(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
894
  let n = Jt, r = Jt;
895
895
  for (const i of e)
896
- n += BigInt(i) * Ms ** r, r++;
897
- return n > dn && (n += Te + Te), n;
896
+ n += BigInt(i) * Os ** r, r++;
897
+ return n > pn && (n += Re + Re), n;
898
898
  }
899
- function Ns(t) {
900
- if (t < Te || dn < t)
899
+ function zs(t) {
900
+ if (t < Re || pn < 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
- return new DataView(e).setBigInt64(0, t, !0), Ze(new Uint8Array(e));
905
+ return new DataView(e).setBigInt64(0, t, !0), Je(new Uint8Array(e));
906
906
  }
907
- function zs(t) {
908
- const e = Je(t);
907
+ function Qs(t) {
908
+ const e = He(t);
909
909
  if (e.byteLength !== 8)
910
910
  throw new Error(
911
911
  `Received ${e.byteLength} bytes, expected 8 for $integer`
912
912
  );
913
913
  return new DataView(e.buffer).getBigInt64(0, !0);
914
914
  }
915
- const Qs = DataView.prototype.setBigInt64 ? Ns : Os, Vs = DataView.prototype.getBigInt64 ? zs : Ls, Zn = 1024;
916
- function Yr(t) {
917
- if (t.length > Zn)
915
+ const Vs = DataView.prototype.setBigInt64 ? zs : Ls, Bs = DataView.prototype.getBigInt64 ? Qs : Ns, Gn = 1024;
916
+ function Xr(t) {
917
+ if (t.length > Gn)
918
918
  throw new Error(
919
- `Field name ${t} exceeds maximum field name length ${Zn}.`
919
+ `Field name ${t} exceeds maximum field name length ${Gn}.`
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 Yr(t) {
928
928
  );
929
929
  }
930
930
  }
931
- function Ae(t) {
931
+ function Te(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) => Ae(r));
935
+ return t.map((r) => Te(r));
936
936
  if (typeof t != "object")
937
937
  throw new Error(`Unexpected type of ${t}`);
938
938
  const e = Object.entries(t);
@@ -941,23 +941,23 @@ function Ae(t) {
941
941
  if (r === "$bytes") {
942
942
  if (typeof t.$bytes != "string")
943
943
  throw new Error(`Malformed $bytes field on ${t}`);
944
- return Je(t.$bytes).buffer;
944
+ return He(t.$bytes).buffer;
945
945
  }
946
946
  if (r === "$integer") {
947
947
  if (typeof t.$integer != "string")
948
948
  throw new Error(`Malformed $integer field on ${t}`);
949
- return Vs(t.$integer);
949
+ return Bs(t.$integer);
950
950
  }
951
951
  if (r === "$float") {
952
952
  if (typeof t.$float != "string")
953
953
  throw new Error(`Malformed $float field on ${t}`);
954
- const i = Je(t.$float);
954
+ const i = He(t.$float);
955
955
  if (i.byteLength !== 8)
956
956
  throw new Error(
957
957
  `Received ${i.byteLength} bytes, expected 8 for $float`
958
958
  );
959
- const s = new DataView(i.buffer).getFloat64(0, Gr);
960
- if (!Kr(s))
959
+ const s = new DataView(i.buffer).getFloat64(0, Kr);
960
+ if (!Yr(s))
961
961
  throw new Error(`Float ${s} should be encoded as a number`);
962
962
  return s;
963
963
  }
@@ -972,15 +972,15 @@ function Ae(t) {
972
972
  }
973
973
  const n = {};
974
974
  for (const [r, i] of Object.entries(t))
975
- Yr(r), n[r] = Ae(i);
975
+ Xr(r), n[r] = Te(i);
976
976
  return n;
977
977
  }
978
- const Gn = 16384;
979
- function Fe(t) {
978
+ const Kn = 16384;
979
+ function Be(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 > Gn) {
981
+ if (e.length > Kn) {
982
982
  const n = "[...truncated]";
983
- let r = Gn - n.length;
983
+ let r = Kn - 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
  }
@@ -988,7 +988,7 @@ function Fe(t) {
988
988
  }
989
989
  function Zt(t, e, n, r) {
990
990
  if (t === void 0) {
991
- const o = n && ` (present at path ${n} in original object ${Fe(
991
+ const o = n && ` (present at path ${n} in original object ${Be(
992
992
  e
993
993
  )})`;
994
994
  throw new Error(
@@ -998,22 +998,22 @@ function Zt(t, e, n, r) {
998
998
  if (t === null)
999
999
  return t;
1000
1000
  if (typeof t == "bigint") {
1001
- if (t < Te || dn < t)
1001
+ if (t < Re || pn < t)
1002
1002
  throw new Error(
1003
1003
  `BigInt ${t} does not fit into a 64-bit signed integer.`
1004
1004
  );
1005
- return { $integer: Qs(t) };
1005
+ return { $integer: Vs(t) };
1006
1006
  }
1007
1007
  if (typeof t == "number")
1008
- if (Kr(t)) {
1008
+ if (Yr(t)) {
1009
1009
  const o = new ArrayBuffer(8);
1010
- return new DataView(o).setFloat64(0, t, Gr), { $float: Ze(new Uint8Array(o)) };
1010
+ return new DataView(o).setFloat64(0, t, Kr), { $float: Je(new Uint8Array(o)) };
1011
1011
  } else
1012
1012
  return t;
1013
1013
  if (typeof t == "boolean" || typeof t == "string")
1014
1014
  return t;
1015
1015
  if (t instanceof ArrayBuffer)
1016
- return { $bytes: Ze(new Uint8Array(t)) };
1016
+ return { $bytes: Je(new Uint8Array(t)) };
1017
1017
  if (Array.isArray(t))
1018
1018
  return t.map(
1019
1019
  (o, l) => Zt(o, e, n + `[${l}]`)
@@ -1026,7 +1026,7 @@ function Zt(t, e, n, r) {
1026
1026
  throw new Error(
1027
1027
  Et(n, "Map", [...t], e)
1028
1028
  );
1029
- if (!Zr(t)) {
1029
+ if (!Gr(t)) {
1030
1030
  const o = t?.constructor?.name, l = o ? `${o} ` : "";
1031
1031
  throw new Error(
1032
1032
  Et(n, l, t, e)
@@ -1035,35 +1035,35 @@ function Zt(t, e, n, r) {
1035
1035
  const i = {}, s = Object.entries(t);
1036
1036
  s.sort(([o, l], [a, u]) => o === a ? 0 : o < a ? -1 : 1);
1037
1037
  for (const [o, l] of s)
1038
- l !== void 0 && (Yr(o), i[o] = Zt(l, e, n + `.${o}`));
1038
+ l !== void 0 && (Xr(o), i[o] = Zt(l, e, n + `.${o}`));
1039
1039
  return i;
1040
1040
  }
1041
1041
  function Et(t, e, n, r) {
1042
- return t ? `${e}${Fe(
1042
+ return t ? `${e}${Be(
1043
1043
  n
1044
- )} is not a supported Convex type (present at path ${t} in original object ${Fe(
1044
+ )} is not a supported Convex type (present at path ${t} in original object ${Be(
1045
1045
  r
1046
- )}). To learn about Convex's supported types, see https://docs.convex.dev/using/types.` : `${e}${Fe(
1046
+ )}). To learn about Convex's supported types, see https://docs.convex.dev/using/types.` : `${e}${Be(
1047
1047
  n
1048
1048
  )} is not a supported Convex type.`;
1049
1049
  }
1050
1050
  function Y(t) {
1051
1051
  return Zt(t, t, "");
1052
1052
  }
1053
- var Bs = Object.defineProperty, Fs = (t, e, n) => e in t ? Bs(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, Pt = (t, e, n) => Fs(t, typeof e != "symbol" ? e + "" : e, n), Kn, Yn;
1054
- const Ds = /* @__PURE__ */ Symbol.for("ConvexError");
1055
- class Gt extends (Yn = Error, Kn = Ds, Yn) {
1053
+ var Fs = Object.defineProperty, Ds = (t, e, n) => e in t ? Fs(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, Pt = (t, e, n) => Ds(t, typeof e != "symbol" ? e + "" : e, n), Yn, Xn;
1054
+ const Us = /* @__PURE__ */ Symbol.for("ConvexError");
1055
+ class Gt extends (Xn = Error, Yn = Us, Xn) {
1056
1056
  constructor(e) {
1057
- super(typeof e == "string" ? e : Fe(e)), Pt(this, "name", "ConvexError"), Pt(this, "data"), Pt(this, Kn, !0), this.data = e;
1057
+ super(typeof e == "string" ? e : Be(e)), Pt(this, "name", "ConvexError"), Pt(this, "data"), Pt(this, Yn, !0), this.data = e;
1058
1058
  }
1059
1059
  }
1060
- const Xr = () => Array.from({ length: 4 }, () => 0);
1061
- Xr();
1062
- Xr();
1063
- const Xn = "1.35.1";
1064
- var Us = Object.defineProperty, Ws = (t, e, n) => e in t ? Us(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, er = (t, e, n) => Ws(t, typeof e != "symbol" ? e + "" : e, n);
1065
- const Hs = "color:rgb(0, 145, 255)";
1066
- function ei(t) {
1060
+ const ei = () => Array.from({ length: 4 }, () => 0);
1061
+ ei();
1062
+ ei();
1063
+ const er = "1.35.1";
1064
+ var Ws = Object.defineProperty, Hs = (t, e, n) => e in t ? Ws(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, tr = (t, e, n) => Hs(t, typeof e != "symbol" ? e + "" : e, n);
1065
+ const Js = "color:rgb(0, 145, 255)";
1066
+ function ti(t) {
1067
1067
  switch (t) {
1068
1068
  case "query":
1069
1069
  return "Q";
@@ -1075,9 +1075,9 @@ function ei(t) {
1075
1075
  return "?";
1076
1076
  }
1077
1077
  }
1078
- class ti {
1078
+ class ni {
1079
1079
  constructor(e) {
1080
- er(this, "_onLogLineFuncs"), er(this, "_verbose"), this._onLogLineFuncs = {}, this._verbose = e.verbose;
1080
+ tr(this, "_onLogLineFuncs"), tr(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 ti {
1105
1105
  n("error", ...e);
1106
1106
  }
1107
1107
  }
1108
- function ni(t) {
1109
- const e = new ti(t);
1108
+ function ri(t) {
1109
+ const e = new ni(t);
1110
1110
  return e.addLogLineListener((n, ...r) => {
1111
1111
  switch (n) {
1112
1112
  case "debug":
@@ -1126,11 +1126,11 @@ function ni(t) {
1126
1126
  }
1127
1127
  }), e;
1128
1128
  }
1129
- function ri(t) {
1130
- return new ti(t);
1129
+ function ii(t) {
1130
+ return new ni(t);
1131
1131
  }
1132
- function pt(t, e, n, r, i) {
1133
- const s = ei(n);
1132
+ function dt(t, e, n, r, i) {
1133
+ const s = ti(n);
1134
1134
  if (typeof i == "object" && (i = `ConvexError ${JSON.stringify(i.errorData, null, 2)}`), e === "info") {
1135
1135
  const o = i.match(/^\[.*?\] /);
1136
1136
  if (o === null) {
@@ -1140,16 +1140,16 @@ function pt(t, e, n, r, i) {
1140
1140
  return;
1141
1141
  }
1142
1142
  const l = i.slice(1, o[0].length - 2), a = i.slice(o[0].length);
1143
- t.log(`%c[CONVEX ${s}(${r})] [${l}]`, Hs, a);
1143
+ t.log(`%c[CONVEX ${s}(${r})] [${l}]`, Js, a);
1144
1144
  } else
1145
1145
  t.error(`[CONVEX ${s}(${r})] ${i}`);
1146
1146
  }
1147
- function Js(t, e) {
1147
+ function Zs(t, e) {
1148
1148
  const n = `[CONVEX FATAL ERROR] ${e}`;
1149
1149
  return t.error(n), new Error(n);
1150
1150
  }
1151
1151
  function _e(t, e, n) {
1152
- return `[CONVEX ${ei(t)}(${e})] ${n.errorMessage}
1152
+ return `[CONVEX ${ti(t)}(${e})] ${n.errorMessage}
1153
1153
  Called by client`;
1154
1154
  }
1155
1155
  function Kt(t, e) {
@@ -1166,7 +1166,7 @@ function ue(t, e) {
1166
1166
  args: Y(e)
1167
1167
  });
1168
1168
  }
1169
- function tr(t, e, n) {
1169
+ function nr(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 tr(t, e, n) {
1175
1175
  options: Y({ initialNumItems: r, id: i })
1176
1176
  });
1177
1177
  }
1178
- var Zs = Object.defineProperty, Gs = (t, e, n) => e in t ? Zs(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, J = (t, e, n) => Gs(t, typeof e != "symbol" ? e + "" : e, n);
1179
- class Ks {
1178
+ var Gs = Object.defineProperty, Ks = (t, e, n) => e in t ? Gs(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, J = (t, e, n) => Ks(t, typeof e != "symbol" ? e + "" : e, n);
1179
+ class Ys {
1180
1180
  constructor() {
1181
1181
  J(this, "nextQueryId"), J(this, "querySetVersion"), J(this, "querySet"), J(this, "queryIdToToken"), J(this, "identityVersion"), J(this, "auth"), J(this, "outstandingQueriesOlderThanRestart"), J(this, "outstandingAuthOlderThanRestart"), J(this, "paused"), J(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,10 +1381,10 @@ class Ks {
1381
1381
  }
1382
1382
  }
1383
1383
  }
1384
- var Ys = Object.defineProperty, Xs = (t, e, n) => e in t ? Ys(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, st = (t, e, n) => Xs(t, typeof e != "symbol" ? e + "" : e, n);
1385
- class eo {
1384
+ var Xs = Object.defineProperty, eo = (t, e, n) => e in t ? Xs(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, it = (t, e, n) => eo(t, typeof e != "symbol" ? e + "" : e, n);
1385
+ class to {
1386
1386
  constructor(e, n) {
1387
- this.logger = e, this.markConnectionStateDirty = n, st(this, "inflightRequests"), st(this, "requestsOlderThanRestart"), st(this, "inflightMutationsCount", 0), st(this, "inflightActionsCount", 0), this.inflightRequests = /* @__PURE__ */ new Map(), this.requestsOlderThanRestart = /* @__PURE__ */ new Set();
1387
+ this.logger = e, this.markConnectionStateDirty = n, it(this, "inflightRequests"), it(this, "requestsOlderThanRestart"), it(this, "inflightMutationsCount", 0), it(this, "inflightActionsCount", 0), this.inflightRequests = /* @__PURE__ */ new Map(), this.requestsOlderThanRestart = /* @__PURE__ */ new Set();
1388
1388
  }
1389
1389
  request(e, n) {
1390
1390
  const r = new Promise((i) => {
@@ -1408,21 +1408,21 @@ class eo {
1408
1408
  return null;
1409
1409
  const r = n.message.type === "Mutation" ? "mutation" : "action", i = n.message.udfPath;
1410
1410
  for (const a of e.logLines)
1411
- pt(this.logger, "info", r, i, a);
1411
+ dt(this.logger, "info", r, i, a);
1412
1412
  const s = n.status;
1413
1413
  let o, l;
1414
1414
  if (e.success)
1415
1415
  o = {
1416
1416
  success: !0,
1417
1417
  logLines: e.logLines,
1418
- value: Ae(e.result)
1418
+ value: Te(e.result)
1419
1419
  }, l = () => s.onResult(o);
1420
1420
  else {
1421
1421
  const a = e.result, { errorData: u } = e;
1422
- pt(this.logger, "error", r, i, a), o = {
1422
+ dt(this.logger, "error", r, i, a), o = {
1423
1423
  success: !1,
1424
1424
  errorMessage: a,
1425
- errorData: u !== void 0 ? Ae(u) : void 0,
1425
+ errorData: u !== void 0 ? Te(u) : void 0,
1426
1426
  logLines: e.logLines
1427
1427
  }, l = () => s.onResult(o);
1428
1428
  }
@@ -1518,21 +1518,21 @@ class eo {
1518
1518
  return this.inflightActionsCount;
1519
1519
  }
1520
1520
  }
1521
- const Ge = /* @__PURE__ */ Symbol.for("functionName"), ii = /* @__PURE__ */ Symbol.for("toReferencePath");
1522
- function to(t) {
1523
- return t[ii] ?? null;
1524
- }
1521
+ const Ze = /* @__PURE__ */ Symbol.for("functionName"), si = /* @__PURE__ */ Symbol.for("toReferencePath");
1525
1522
  function no(t) {
1526
- return t.startsWith("function://");
1523
+ return t[si] ?? null;
1527
1524
  }
1528
1525
  function ro(t) {
1526
+ return t.startsWith("function://");
1527
+ }
1528
+ function io(t) {
1529
1529
  let e;
1530
1530
  if (typeof t == "string")
1531
- no(t) ? e = { functionHandle: t } : e = { name: t };
1532
- else if (t[Ge])
1533
- e = { name: t[Ge] };
1531
+ ro(t) ? e = { functionHandle: t } : e = { name: t };
1532
+ else if (t[Ze])
1533
+ e = { name: t[Ze] };
1534
1534
  else {
1535
- const n = to(t);
1535
+ const n = no(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 ro(t) {
1540
1540
  return e;
1541
1541
  }
1542
1542
  function E(t) {
1543
- const e = ro(t);
1543
+ const e = io(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}`
@@ -1550,21 +1550,21 @@ function E(t) {
1550
1550
  `Expected function reference like "api.file.func" or "internal.file.func", but received ${JSON.stringify(e)}`
1551
1551
  );
1552
1552
  if (typeof t == "string") return t;
1553
- const n = t[Ge];
1553
+ const n = t[Ze];
1554
1554
  if (!n)
1555
1555
  throw new Error(`${t} is not a functionReference`);
1556
1556
  return n;
1557
1557
  }
1558
- function si(t) {
1559
- return { [Ge]: t };
1558
+ function oi(t) {
1559
+ return { [Ze]: t };
1560
1560
  }
1561
- function oi(t = []) {
1561
+ function ai(t = []) {
1562
1562
  const e = {
1563
1563
  get(n, r) {
1564
1564
  if (typeof r == "string") {
1565
1565
  const i = [...t, r];
1566
- return oi(i);
1567
- } else if (r === Ge) {
1566
+ return ai(i);
1567
+ } else if (r === Ze) {
1568
1568
  if (t.length < 2) {
1569
1569
  const o = ["api", ...t].join(".");
1570
1570
  throw new Error(
@@ -1578,30 +1578,30 @@ function oi(t = []) {
1578
1578
  };
1579
1579
  return new Proxy({}, e);
1580
1580
  }
1581
- const io = oi();
1582
- var so = Object.defineProperty, oo = (t, e, n) => e in t ? so(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, ft = (t, e, n) => oo(t, typeof e != "symbol" ? e + "" : e, n);
1583
- class Ke {
1581
+ const so = ai();
1582
+ var oo = Object.defineProperty, ao = (t, e, n) => e in t ? oo(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, pt = (t, e, n) => ao(t, typeof e != "symbol" ? e + "" : e, n);
1583
+ class Ge {
1584
1584
  constructor(e) {
1585
- ft(this, "queryResults"), ft(this, "modifiedQueries"), this.queryResults = e, this.modifiedQueries = [];
1585
+ pt(this, "queryResults"), pt(this, "modifiedQueries"), this.queryResults = e, this.modifiedQueries = [];
1586
1586
  }
1587
1587
  getQuery(e, ...n) {
1588
- const r = ee(n[0]), i = E(e), s = this.queryResults.get(
1588
+ const r = te(n[0]), i = E(e), s = this.queryResults.get(
1589
1589
  ue(i, r)
1590
1590
  );
1591
1591
  if (s !== void 0)
1592
- return Ke.queryValue(s.result);
1592
+ return Ge.queryValue(s.result);
1593
1593
  }
1594
1594
  getAllQueries(e) {
1595
1595
  const n = [], r = E(e);
1596
1596
  for (const i of this.queryResults.values())
1597
1597
  i.udfPath === de(r) && n.push({
1598
1598
  args: i.args,
1599
- value: Ke.queryValue(i.result)
1599
+ value: Ge.queryValue(i.result)
1600
1600
  });
1601
1601
  return n;
1602
1602
  }
1603
1603
  setQuery(e, n, r) {
1604
- const i = ee(n), s = E(e), o = ue(s, i);
1604
+ const i = te(n), s = E(e), o = ue(s, i);
1605
1605
  let l;
1606
1606
  r === void 0 ? l = void 0 : l = {
1607
1607
  success: !0,
@@ -1621,9 +1621,9 @@ class Ke {
1621
1621
  return e.success ? e.value : void 0;
1622
1622
  }
1623
1623
  }
1624
- class ao {
1624
+ class lo {
1625
1625
  constructor() {
1626
- ft(this, "queryResults"), ft(this, "optimisticUpdates"), this.queryResults = /* @__PURE__ */ new Map(), this.optimisticUpdates = [];
1626
+ pt(this, "queryResults"), pt(this, "optimisticUpdates"), this.queryResults = /* @__PURE__ */ new Map(), this.optimisticUpdates = [];
1627
1627
  }
1628
1628
  /**
1629
1629
  * Apply all optimistic updates on top of server query results
@@ -1632,7 +1632,7 @@ class ao {
1632
1632
  this.optimisticUpdates = this.optimisticUpdates.filter((o) => !n.has(o.mutationId));
1633
1633
  const r = this.queryResults;
1634
1634
  this.queryResults = new Map(e);
1635
- const i = new Ke(this.queryResults);
1635
+ const i = new Ge(this.queryResults);
1636
1636
  for (const o of this.optimisticUpdates)
1637
1637
  o.update(i);
1638
1638
  const s = [];
@@ -1647,7 +1647,7 @@ class ao {
1647
1647
  update: e,
1648
1648
  mutationId: n
1649
1649
  });
1650
- const r = new Ke(this.queryResults);
1650
+ const r = new Ge(this.queryResults);
1651
1651
  return e(r), r.modifiedQueries;
1652
1652
  }
1653
1653
  /**
@@ -1689,7 +1689,7 @@ class ao {
1689
1689
  return this.queryResults.get(e)?.result?.logLines;
1690
1690
  }
1691
1691
  }
1692
- var lo = Object.defineProperty, co = (t, e, n) => e in t ? lo(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, Mt = (t, e, n) => co(t, typeof e != "symbol" ? e + "" : e, n);
1692
+ var co = Object.defineProperty, uo = (t, e, n) => e in t ? co(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, Mt = (t, e, n) => uo(t, typeof e != "symbol" ? e + "" : e, n);
1693
1693
  class q {
1694
1694
  constructor(e, n) {
1695
1695
  Mt(this, "low"), Mt(this, "high"), Mt(this, "__isUnsignedLong__"), this.low = e | 0, this.high = n | 0, this.__isUnsignedLong__ = !0;
@@ -1719,10 +1719,10 @@ class q {
1719
1719
  ];
1720
1720
  }
1721
1721
  static fromNumber(e) {
1722
- return isNaN(e) || e < 0 ? uo : e >= ho ? po : new q(e % De | 0, e / De | 0);
1722
+ return isNaN(e) || e < 0 ? ho : e >= po ? fo : new q(e % Fe | 0, e / Fe | 0);
1723
1723
  }
1724
1724
  toString() {
1725
- return (BigInt(this.high) * BigInt(De) + BigInt(this.low)).toString();
1725
+ return (BigInt(this.high) * BigInt(Fe) + BigInt(this.low)).toString();
1726
1726
  }
1727
1727
  equals(e) {
1728
1728
  return q.isLong(e) || (e = q.fromValue(e)), this.high >>> 31 === 1 && e.high >>> 31 === 1 ? !1 : this.high === e.high && this.low === e.low;
@@ -1743,11 +1743,11 @@ class q {
1743
1743
  return typeof e == "number" ? q.fromNumber(e) : new q(e.low, e.high);
1744
1744
  }
1745
1745
  }
1746
- const uo = new q(0, 0), nr = 65536, De = nr * nr, ho = De * De, po = new q(-1, -1);
1747
- var fo = Object.defineProperty, go = (t, e, n) => e in t ? fo(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, ot = (t, e, n) => go(t, typeof e != "symbol" ? e + "" : e, n);
1748
- class rr {
1746
+ const ho = new q(0, 0), rr = 65536, Fe = rr * rr, po = Fe * Fe, fo = new q(-1, -1);
1747
+ var go = Object.defineProperty, mo = (t, e, n) => e in t ? go(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, st = (t, e, n) => mo(t, typeof e != "symbol" ? e + "" : e, n);
1748
+ class ir {
1749
1749
  constructor(e, n) {
1750
- ot(this, "version"), ot(this, "remoteQuerySet"), ot(this, "queryPath"), ot(this, "logger"), this.version = { querySet: 0, ts: q.fromNumber(0), identity: 0 }, this.remoteQuerySet = /* @__PURE__ */ new Map(), this.queryPath = e, this.logger = n;
1750
+ st(this, "version"), st(this, "remoteQuerySet"), st(this, "queryPath"), st(this, "logger"), this.version = { querySet: 0, ts: q.fromNumber(0), identity: 0 }, this.remoteQuerySet = /* @__PURE__ */ new Map(), this.queryPath = e, this.logger = n;
1751
1751
  }
1752
1752
  transition(e) {
1753
1753
  const n = e.startVersion;
@@ -1761,8 +1761,8 @@ class rr {
1761
1761
  const i = this.queryPath(r.queryId);
1762
1762
  if (i)
1763
1763
  for (const o of r.logLines)
1764
- pt(this.logger, "info", "query", i, o);
1765
- const s = Ae(r.value ?? null);
1764
+ dt(this.logger, "info", "query", i, o);
1765
+ const s = Te(r.value ?? null);
1766
1766
  this.remoteQuerySet.set(r.queryId, {
1767
1767
  success: !0,
1768
1768
  value: s,
@@ -1774,12 +1774,12 @@ class rr {
1774
1774
  const i = this.queryPath(r.queryId);
1775
1775
  if (i)
1776
1776
  for (const o of r.logLines)
1777
- pt(this.logger, "info", "query", i, o);
1777
+ dt(this.logger, "info", "query", i, o);
1778
1778
  const { errorData: s } = r;
1779
1779
  this.remoteQuerySet.set(r.queryId, {
1780
1780
  success: !1,
1781
1781
  errorMessage: r.errorMessage,
1782
- errorData: s !== void 0 ? Ae(s) : void 0,
1782
+ errorData: s !== void 0 ? Te(s) : void 0,
1783
1783
  logLines: r.logLines
1784
1784
  });
1785
1785
  break;
@@ -1801,14 +1801,14 @@ class rr {
1801
1801
  }
1802
1802
  }
1803
1803
  function Ot(t) {
1804
- const e = Je(t);
1804
+ const e = He(t);
1805
1805
  return q.fromBytesLE(Array.from(e));
1806
1806
  }
1807
- function mo(t) {
1807
+ function xo(t) {
1808
1808
  const e = new Uint8Array(t.toBytesLE());
1809
- return Ze(e);
1809
+ return Je(e);
1810
1810
  }
1811
- function ir(t) {
1811
+ function sr(t) {
1812
1812
  switch (t.type) {
1813
1813
  case "FatalError":
1814
1814
  case "AuthError":
@@ -1832,7 +1832,7 @@ function ir(t) {
1832
1832
  };
1833
1833
  }
1834
1834
  }
1835
- function xo(t) {
1835
+ function bo(t) {
1836
1836
  switch (t.type) {
1837
1837
  case "Authenticate":
1838
1838
  case "ModifyQuerySet":
@@ -1843,20 +1843,20 @@ function xo(t) {
1843
1843
  case "Connect":
1844
1844
  return t.maxObservedTimestamp !== void 0 ? {
1845
1845
  ...t,
1846
- maxObservedTimestamp: mo(t.maxObservedTimestamp)
1846
+ maxObservedTimestamp: xo(t.maxObservedTimestamp)
1847
1847
  } : { ...t, maxObservedTimestamp: void 0 };
1848
1848
  }
1849
1849
  }
1850
- var bo = Object.defineProperty, yo = (t, e, n) => e in t ? bo(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, C = (t, e, n) => yo(t, typeof e != "symbol" ? e + "" : e, n);
1851
- const vo = 1e3, _o = 1001, ko = 1005, wo = 4040;
1852
- let ht;
1850
+ var yo = Object.defineProperty, vo = (t, e, n) => e in t ? yo(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, C = (t, e, n) => vo(t, typeof e != "symbol" ? e + "" : e, n);
1851
+ const _o = 1e3, ko = 1001, wo = 1005, jo = 4040;
1852
+ let ut;
1853
1853
  function ve() {
1854
- return ht === void 0 && (ht = Date.now()), typeof performance > "u" || !performance.now ? Date.now() : Math.round(ht + performance.now());
1854
+ return ut === void 0 && (ut = Date.now()), typeof performance > "u" || !performance.now ? Date.now() : Math.round(ut + performance.now());
1855
1855
  }
1856
- function sr() {
1857
- return `t=${Math.round((ve() - ht) / 100) / 10}s`;
1856
+ function or() {
1857
+ return `t=${Math.round((ve() - ut) / 100) / 10}s`;
1858
1858
  }
1859
- const ai = {
1859
+ const li = {
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,16 +1876,16 @@ const ai = {
1876
1876
  SearchIndexTooLarge: { timeout: 3e3 },
1877
1877
  TooManyWritesInTimePeriod: { timeout: 3e3 }
1878
1878
  };
1879
- function jo(t) {
1879
+ function So(t) {
1880
1880
  if (t === void 0) return "Unknown";
1881
1881
  for (const e of Object.keys(
1882
- ai
1882
+ li
1883
1883
  ))
1884
1884
  if (t.startsWith(e))
1885
1885
  return e;
1886
1886
  return "Unknown";
1887
1887
  }
1888
- class So {
1888
+ class Co {
1889
1889
  constructor(e, n, r, i, s, o) {
1890
1890
  this.markConnectionStateDirty = s, this.debug = o, C(this, "socket"), C(this, "connectionCount"), C(this, "_hasEverConnected", !1), C(this, "lastCloseReason"), C(this, "transitionChunkBuffer", null), C(this, "defaultInitialBackoff"), C(this, "maxBackoff"), C(this, "retries"), C(this, "serverInactivityThreshold"), C(this, "reconnectDueToServerInactivityTimeout"), C(this, "scheduledReconnect", null), C(this, "networkOnlineHandler", null), C(this, "pendingNetworkRecoveryInfo", null), C(this, "uri"), C(this, "onOpen"), C(this, "onResume"), C(this, "onMessage"), C(this, "webSocketConstructor"), C(this, "logger"), C(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
  }
@@ -1918,7 +1918,7 @@ class So {
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 = ir(JSON.parse(n));
1921
+ const r = sr(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 So {
1952
1952
  clientTs: ve()
1953
1953
  })), this.lastCloseReason !== "InitialConnect" && (this.lastCloseReason ? this.logger.log(
1954
1954
  "WebSocket reconnected at",
1955
- sr(),
1955
+ or(),
1956
1956
  "after disconnect due to",
1957
1957
  this.lastCloseReason
1958
- ) : this.logger.log("WebSocket reconnected at", sr())), this.connectionCount += 1, this.lastCloseReason = null, this.pendingNetworkRecoveryInfo !== null) {
1958
+ ) : this.logger.log("WebSocket reconnected at", or())), 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 So {
1972
1972
  }, e.onmessage = (n) => {
1973
1973
  this.resetServerInactivityTimeout();
1974
1974
  const r = n.data.length;
1975
- let i = ir(JSON.parse(n.data));
1975
+ let i = sr(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 s = this.assembleTransition(i);
@@ -1990,12 +1990,12 @@ class So {
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 !== vo && n.code !== _o && // This commonly gets fired on mobile apps when the app is backgrounded
1994
- n.code !== ko && n.code !== wo) {
1993
+ if (this._logVerbose("begin ws.onclose"), this.transitionChunkBuffer = null, this.lastCloseReason === null && (this.lastCloseReason = n.reason || `closed with code ${n.code}`), n.code !== _o && n.code !== ko && // This commonly gets fired on mobile apps when the app is backgrounded
1994
+ n.code !== wo && n.code !== jo) {
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 = jo(n.reason);
1998
+ const r = So(n.reason);
1999
1999
  this.scheduleReconnect(r);
2000
2000
  };
2001
2001
  }
@@ -2017,7 +2017,7 @@ class So {
2017
2017
  } : {}
2018
2018
  };
2019
2019
  if (this.socket.state === "ready" && this.socket.paused === "no") {
2020
- const r = xo(e), i = JSON.stringify(r);
2020
+ const r = bo(e), i = JSON.stringify(r);
2021
2021
  let s = !1;
2022
2022
  try {
2023
2023
  this.socket.ws.send(i), s = !0;
@@ -2247,7 +2247,7 @@ class So {
2247
2247
  this.logger.logVerbose(e);
2248
2248
  }
2249
2249
  nextBackoff(e) {
2250
- const n = (e === "client" ? 100 : e === "Unknown" ? this.defaultInitialBackoff : ai[e].timeout) * Math.pow(2, this.retries);
2250
+ const n = (e === "client" ? 100 : e === "Unknown" ? this.defaultInitialBackoff : li[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 So {
2276
2276
  });
2277
2277
  }
2278
2278
  }
2279
- function Co() {
2280
- return Ro();
2281
- }
2282
2279
  function Ro() {
2280
+ return To();
2281
+ }
2282
+ function To() {
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 Qe extends Error {
2288
+ class ze extends Error {
2289
2289
  }
2290
- Qe.prototype.name = "InvalidTokenError";
2291
- function To(t) {
2290
+ ze.prototype.name = "InvalidTokenError";
2291
+ function Ao(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 To(t) {
2296
2296
  })
2297
2297
  );
2298
2298
  }
2299
- function Ao(t) {
2299
+ function Io(t) {
2300
2300
  let e = t.replace(/-/g, "+").replace(/_/g, "/");
2301
2301
  switch (e.length % 4) {
2302
2302
  case 0:
@@ -2311,39 +2311,39 @@ function Ao(t) {
2311
2311
  throw new Error("base64 string is not of the correct length");
2312
2312
  }
2313
2313
  try {
2314
- return To(e);
2314
+ return Ao(e);
2315
2315
  } catch {
2316
2316
  return atob(e);
2317
2317
  }
2318
2318
  }
2319
- function li(t, e) {
2319
+ function ci(t, e) {
2320
2320
  if (typeof t != "string")
2321
- throw new Qe("Invalid token specified: must be a string");
2321
+ throw new ze("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 Qe(
2325
+ throw new ze(
2326
2326
  `Invalid token specified: missing part #${n + 1}`
2327
2327
  );
2328
2328
  let i;
2329
2329
  try {
2330
- i = Ao(r);
2330
+ i = Io(r);
2331
2331
  } catch (s) {
2332
- throw new Qe(
2332
+ throw new ze(
2333
2333
  `Invalid token specified: invalid base64 for part #${n + 1} (${s.message})`
2334
2334
  );
2335
2335
  }
2336
2336
  try {
2337
2337
  return JSON.parse(i);
2338
2338
  } catch (s) {
2339
- throw new Qe(
2339
+ throw new ze(
2340
2340
  `Invalid token specified: invalid json for part #${n + 1} (${s.message})`
2341
2341
  );
2342
2342
  }
2343
2343
  }
2344
- var Io = Object.defineProperty, $o = (t, e, n) => e in t ? Io(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, M = (t, e, n) => $o(t, typeof e != "symbol" ? e + "" : e, n);
2345
- const qo = 480 * 60 * 60 * 1e3, or = 2;
2346
- class Eo {
2344
+ var $o = Object.defineProperty, qo = (t, e, n) => e in t ? $o(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, M = (t, e, n) => qo(t, typeof e != "symbol" ? e + "" : e, n);
2345
+ const Eo = 480 * 60 * 60 * 1e3, ar = 2;
2346
+ class Po {
2347
2347
  constructor(e, n, r) {
2348
2348
  M(this, "authState", { state: "noAuth" }), M(this, "configVersion", 0), M(this, "syncState"), M(this, "authenticate"), M(this, "stopSocket"), M(this, "tryRestartSocket"), M(this, "pauseSocket"), M(this, "resumeSocket"), M(this, "clearAuth"), M(this, "logger"), M(this, "refreshTokenLeewaySeconds"), M(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
  }
@@ -2394,14 +2394,14 @@ class Eo {
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 >= or) {
2397
+ this.authState.state === "waitingForServerConfirmationOfFreshToken" && this.tokenConfirmationAttempts >= ar) {
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, ${or - this.tokenConfirmationAttempts} attempts remaining`
2404
+ `retrying reauthentication, ${ar - 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 Eo {
2466
2466
  return;
2467
2467
  }
2468
2468
  let o = Math.min(
2469
- qo,
2469
+ Eo,
2470
2470
  (s - this.refreshTokenLeewaySeconds) * 1e3
2471
2471
  );
2472
2472
  o <= 0 && (this.logger.warn(
@@ -2523,7 +2523,7 @@ class Eo {
2523
2523
  }
2524
2524
  decodeToken(e) {
2525
2525
  try {
2526
- return li(e);
2526
+ return ci(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 Eo {
2534
2534
  this.logger.logVerbose(`${e} [v${this.configVersion}]`);
2535
2535
  }
2536
2536
  }
2537
- const Po = [
2537
+ const Mo = [
2538
2538
  "convexClientConstructed",
2539
2539
  "convexWebSocketOpen",
2540
2540
  "convexFirstMessageReceived"
2541
2541
  ];
2542
- function Mo(t, e) {
2542
+ function Oo(t, e) {
2543
2543
  const n = { sessionId: e };
2544
2544
  typeof performance > "u" || !performance.mark || performance.mark(t, { detail: n });
2545
2545
  }
2546
- function Oo(t) {
2546
+ function Lo(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 Lo(t) {
2553
+ function No(t) {
2554
2554
  if (typeof performance > "u" || !performance.getEntriesByName)
2555
2555
  return [];
2556
2556
  const e = [];
2557
- for (const n of Po) {
2557
+ for (const n of Mo) {
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(Oo);
2561
+ return e.map(Lo);
2562
2562
  }
2563
- var No = Object.defineProperty, zo = (t, e, n) => e in t ? No(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, R = (t, e, n) => zo(t, typeof e != "symbol" ? e + "" : e, n);
2564
- class Qo {
2563
+ var zo = Object.defineProperty, Qo = (t, e, n) => e in t ? zo(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, R = (t, e, n) => Qo(t, typeof e != "symbol" ? e + "" : e, n);
2564
+ class Vo {
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`.
@@ -2581,19 +2581,19 @@ class Qo {
2581
2581
  }
2582
2582
  });
2583
2583
  }), R(this, "mark", (p) => {
2584
- this.debug && Mo(p, this.sessionId);
2584
+ this.debug && Oo(p, 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 && Es(e), r = { ...r };
2589
+ r?.skipConvexDeploymentUrlCheck !== !0 && Ps(e), r = { ...r };
2590
2590
  const i = r.authRefreshTokenLeewaySeconds ?? 10;
2591
2591
  let s = r.webSocketConstructor;
2592
2592
  if (!s && 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
- s = s || WebSocket, this.debug = r.reportDebugInfoToConvex ?? !1, this.address = e, this.logger = r.logger === !1 ? ri({ verbose: r.verbose ?? !1 }) : r.logger !== !0 && r.logger ? r.logger : ni({ verbose: r.verbose ?? !1 });
2596
+ s = s || WebSocket, this.debug = r.reportDebugInfoToConvex ?? !1, this.address = e, this.logger = r.logger === !1 ? ii({ verbose: r.verbose ?? !1 }) : r.logger !== !0 && r.logger ? r.logger : ri({ verbose: r.verbose ?? !1 });
2597
2597
  const o = e.search("://");
2598
2598
  if (o === -1)
2599
2599
  throw new Error("Provided address was not an absolute URL.");
@@ -2605,18 +2605,18 @@ class Qo {
2605
2605
  u = "wss";
2606
2606
  else
2607
2607
  throw new Error(`Unknown parent protocol ${a}`);
2608
- const d = `${u}://${l}/api/${Xn}/sync`;
2609
- this.state = new Ks(), this.remoteQuerySet = new rr(
2608
+ const d = `${u}://${l}/api/${er}/sync`;
2609
+ this.state = new Ys(), this.remoteQuerySet = new ir(
2610
2610
  (p) => this.state.queryPath(p),
2611
2611
  this.logger
2612
- ), this.requestManager = new eo(
2612
+ ), this.requestManager = new to(
2613
2613
  this.logger,
2614
2614
  this.markConnectionStateDirty
2615
2615
  );
2616
2616
  const c = () => {
2617
2617
  this.webSocketManager.pause(), this.state.pause();
2618
2618
  };
2619
- this.authenticationManager = new Eo(
2619
+ this.authenticationManager = new Po(
2620
2620
  this.state,
2621
2621
  {
2622
2622
  authenticate: (p) => {
@@ -2635,9 +2635,9 @@ class Qo {
2635
2635
  logger: this.logger,
2636
2636
  refreshTokenLeewaySeconds: i
2637
2637
  }
2638
- ), this.optimisticQueryResults = new ao(), this.addOnTransitionHandler((p) => {
2638
+ ), this.optimisticQueryResults = new lo(), this.addOnTransitionHandler((p) => {
2639
2639
  n(p.queries.map((g) => g.token));
2640
- }), this._nextRequestId = 0, this._sessionId = Co();
2640
+ }), this._nextRequestId = 0, this._sessionId = Ro();
2641
2641
  const { unsavedChangesWarning: f } = r;
2642
2642
  if (typeof window > "u" || typeof window.addEventListener > "u") {
2643
2643
  if (f === !0)
@@ -2651,7 +2651,7 @@ class Qo {
2651
2651
  return (p || window.event).returnValue = g, g;
2652
2652
  }
2653
2653
  });
2654
- this.webSocketManager = new So(
2654
+ this.webSocketManager = new Co(
2655
2655
  d,
2656
2656
  {
2657
2657
  onOpen: (p) => {
@@ -2660,7 +2660,7 @@ class Qo {
2660
2660
  type: "Connect",
2661
2661
  sessionId: this._sessionId,
2662
2662
  maxObservedTimestamp: this.maxObservedTimestamp
2663
- }), this.remoteQuerySet = new rr(
2663
+ }), this.remoteQuerySet = new ir(
2664
2664
  (w) => this.state.queryPath(w),
2665
2665
  this.logger
2666
2666
  );
@@ -2707,7 +2707,7 @@ class Qo {
2707
2707
  break;
2708
2708
  }
2709
2709
  case "FatalError": {
2710
- const g = Js(this.logger, p.error);
2710
+ const g = Zs(this.logger, p.error);
2711
2711
  throw this.webSocketManager.terminate(), g;
2712
2712
  }
2713
2713
  }
@@ -2807,7 +2807,7 @@ class Qo {
2807
2807
  let n = {};
2808
2808
  if (e && e.tokenType === "User")
2809
2809
  try {
2810
- n = e ? li(e.value) : {};
2810
+ n = e ? ci(e.value) : {};
2811
2811
  } catch {
2812
2812
  n = {};
2813
2813
  }
@@ -2853,7 +2853,7 @@ class Qo {
2853
2853
  * query and an `unsubscribe` callback.
2854
2854
  */
2855
2855
  subscribe(e, n, r) {
2856
- const i = ee(n), { modification: s, queryToken: o, unsubscribe: l } = this.state.subscribe(
2856
+ const i = te(n), { modification: s, queryToken: o, unsubscribe: l } = this.state.subscribe(
2857
2857
  e,
2858
2858
  i,
2859
2859
  r?.journal,
@@ -2874,7 +2874,7 @@ class Qo {
2874
2874
  * query or its value has been set optimistically.
2875
2875
  */
2876
2876
  localQueryResult(e, n) {
2877
- const r = ee(n), i = ue(e, r);
2877
+ const r = te(n), i = ue(e, r);
2878
2878
  return this.optimisticQueryResults.queryResult(i);
2879
2879
  }
2880
2880
  /**
@@ -2902,7 +2902,7 @@ class Qo {
2902
2902
  * @internal
2903
2903
  */
2904
2904
  localQueryLogs(e, n) {
2905
- const r = ee(n), i = ue(e, r);
2905
+ const r = te(n), i = ue(e, r);
2906
2906
  return this.optimisticQueryResults.queryLogs(i);
2907
2907
  }
2908
2908
  /**
@@ -2915,7 +2915,7 @@ class Qo {
2915
2915
  * @returns The query's {@link QueryJournal} or `undefined`.
2916
2916
  */
2917
2917
  queryJournal(e, n) {
2918
- const r = ee(n), i = ue(e, r);
2918
+ const r = te(n), i = ue(e, r);
2919
2919
  return this.state.queryJournal(i);
2920
2920
  }
2921
2921
  /**
@@ -2990,7 +2990,7 @@ class Qo {
2990
2990
  * @internal
2991
2991
  */
2992
2992
  enqueueMutation(e, n, r, i) {
2993
- const s = ee(n);
2993
+ const s = te(n);
2994
2994
  this.tryReportLongDisconnect();
2995
2995
  const o = this.nextRequestId;
2996
2996
  if (this._nextRequestId++, r !== void 0) {
@@ -3060,7 +3060,7 @@ class Qo {
3060
3060
  * @internal
3061
3061
  */
3062
3062
  async actionInternal(e, n, r) {
3063
- const i = ee(n), s = this.nextRequestId;
3063
+ const i = te(n), s = this.nextRequestId;
3064
3064
  this._nextRequestId++, this.tryReportLongDisconnect();
3065
3065
  const o = {
3066
3066
  type: "Action",
@@ -3109,7 +3109,7 @@ class Qo {
3109
3109
  */
3110
3110
  reportMarks() {
3111
3111
  if (this.debug) {
3112
- const e = Lo(this.sessionId);
3112
+ const e = No(this.sessionId);
3113
3113
  this.webSocketManager.sendMessage({
3114
3114
  type: "Event",
3115
3115
  eventType: "ClientConnect",
@@ -3128,7 +3128,7 @@ class Qo {
3128
3128
  method: "POST",
3129
3129
  headers: {
3130
3130
  "Content-Type": "application/json",
3131
- "Convex-Client": `npm-${Xn}`
3131
+ "Convex-Client": `npm-${er}`
3132
3132
  },
3133
3133
  body: JSON.stringify({ event: "LongWebsocketDisconnect" })
3134
3134
  }).then((r) => {
@@ -3146,10 +3146,10 @@ function Lt(t) {
3146
3146
  throw new Error(`Not a valid paginated query result: ${t?.toString()}`);
3147
3147
  return t;
3148
3148
  }
3149
- var Vo = Object.defineProperty, Bo = (t, e, n) => e in t ? Vo(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, ar = (t, e, n) => Bo(t, typeof e != "symbol" ? e + "" : e, n);
3150
- class Fo {
3149
+ var Bo = Object.defineProperty, Fo = (t, e, n) => e in t ? Bo(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, lr = (t, e, n) => Fo(t, typeof e != "symbol" ? e + "" : e, n);
3150
+ class Do {
3151
3151
  constructor(e, n) {
3152
- this.client = e, this.onTransition = n, ar(this, "paginatedQuerySet", /* @__PURE__ */ new Map()), ar(this, "lastTransitionTs"), this.lastTransitionTs = q.fromNumber(0), this.client.addOnTransitionHandler(
3152
+ this.client = e, this.onTransition = n, lr(this, "paginatedQuerySet", /* @__PURE__ */ new Map()), lr(this, "lastTransitionTs"), this.lastTransitionTs = q.fromNumber(0), this.client.addOnTransitionHandler(
3153
3153
  (r) => this.onBaseTransition(r)
3154
3154
  );
3155
3155
  }
@@ -3162,7 +3162,7 @@ class Fo {
3162
3162
  * @returns Object with paginatedQueryToken and unsubscribe function
3163
3163
  */
3164
3164
  subscribe(e, n, r) {
3165
- const i = de(e), s = tr(
3165
+ const i = de(e), s = nr(
3166
3166
  i,
3167
3167
  n,
3168
3168
  r
@@ -3193,7 +3193,7 @@ class Fo {
3193
3193
  * Throws an error when one of the pages has errored.
3194
3194
  */
3195
3195
  localQueryResult(e, n, r) {
3196
- const i = de(e), s = tr(
3196
+ const i = de(e), s = nr(
3197
3197
  i,
3198
3198
  n,
3199
3199
  r
@@ -3422,7 +3422,7 @@ class Fo {
3422
3422
  return n;
3423
3423
  }
3424
3424
  }
3425
- function Do({
3425
+ function Uo({
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.
@@ -3454,13 +3454,13 @@ function Do({
3454
3454
  };
3455
3455
  }, [t, e]), i;
3456
3456
  }
3457
- var Uo = Object.defineProperty, Wo = (t, e, n) => e in t ? Uo(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, X = (t, e, n) => Wo(t, typeof e != "symbol" ? e + "" : e, n);
3458
- const Ho = 5e3;
3459
- if (typeof hn > "u")
3457
+ var Wo = Object.defineProperty, Ho = (t, e, n) => e in t ? Wo(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, ee = (t, e, n) => Ho(t, typeof e != "symbol" ? e + "" : e, n);
3458
+ const Jo = 5e3;
3459
+ if (typeof dn > "u")
3460
3460
  throw new Error("Required dependency 'react' not found");
3461
- function ci(t, e, n) {
3461
+ function ui(t, e, n) {
3462
3462
  function r(i) {
3463
- return Ko(i), e.mutation(t, i, {
3463
+ return Yo(i), e.mutation(t, i, {
3464
3464
  optimisticUpdate: n
3465
3465
  });
3466
3466
  }
@@ -3471,17 +3471,17 @@ function ci(t, e, n) {
3471
3471
  t
3472
3472
  )}`
3473
3473
  );
3474
- return ci(t, e, i);
3474
+ return ui(t, e, i);
3475
3475
  }, r;
3476
3476
  }
3477
- class Jo {
3477
+ class Zo {
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`.
3481
3481
  * @param options - See {@link ConvexReactClientOptions} for a full description.
3482
3482
  */
3483
3483
  constructor(e, n) {
3484
- if (X(this, "address"), X(this, "cachedSync"), X(this, "cachedPaginatedQueryClient"), X(this, "listeners"), X(this, "options"), X(this, "closed", !1), X(this, "_logger"), X(this, "adminAuth"), X(this, "fakeUserIdentity"), e === void 0)
3484
+ if (ee(this, "address"), ee(this, "cachedSync"), ee(this, "cachedPaginatedQueryClient"), ee(this, "listeners"), ee(this, "options"), ee(this, "closed", !1), ee(this, "_logger"), ee(this, "adminAuth"), ee(this, "fakeUserIdentity"), e === void 0)
3485
3485
  throw new Error(
3486
3486
  "No address provided to ConvexReactClient.\nIf trying to deploy to production, make sure to follow all the instructions found at https://docs.convex.dev/production/hosting/\nIf running locally, make sure to run `convex dev` and ensure the .env.local file is populated."
3487
3487
  );
@@ -3491,7 +3491,7 @@ class Jo {
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 ? ri({ verbose: n?.verbose ?? !1 }) : n?.logger !== !0 && n?.logger ? n.logger : ni({ verbose: n?.verbose ?? !1 }), this.options = { ...n, logger: this._logger };
3494
+ this.address = e, this.listeners = /* @__PURE__ */ new Map(), this._logger = n?.logger === !1 ? ii({ 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 Jo {
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 Qo(
3514
+ return this.cachedSync ? this.cachedSync : (this.cachedSync = new Vo(
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 Fo(
3520
+ ), this.adminAuth && this.cachedSync.setAdminAuth(this.adminAuth, this.fakeUserIdentity), this.cachedPaginatedQueryClient = new Do(
3521
3521
  this.cachedSync,
3522
3522
  (e) => this.handleTransition(e)
3523
3523
  ), this.cachedSync);
@@ -3627,7 +3627,7 @@ class Jo {
3627
3627
  * an optional extendSubscriptionFor for how long to subscribe to the query.
3628
3628
  */
3629
3629
  prewarmQuery(e) {
3630
- const n = e.extendSubscriptionFor ?? Ho, r = this.watchQuery(e.query, e.args || {}).onUpdate(() => {
3630
+ const n = e.extendSubscriptionFor ?? Jo, r = this.watchQuery(e.query, e.args || {}).onUpdate(() => {
3631
3631
  });
3632
3632
  setTimeout(r, n);
3633
3633
  }
@@ -3778,50 +3778,50 @@ class Jo {
3778
3778
  }
3779
3779
  }
3780
3780
  }
3781
- const pn = hn.createContext(
3781
+ const fn = dn.createContext(
3782
3782
  void 0
3783
3783
  // in the future this will be a mocked client for testing
3784
3784
  );
3785
- function Zo() {
3786
- return _t(pn);
3785
+ function Go() {
3786
+ return _t(fn);
3787
3787
  }
3788
- const Go = ({ client: t, children: e }) => hn.createElement(
3789
- pn.Provider,
3788
+ const Ko = ({ client: t, children: e }) => dn.createElement(
3789
+ fn.Provider,
3790
3790
  { value: t },
3791
3791
  e
3792
3792
  );
3793
- function lr(t, ...e) {
3794
- const n = e[0] === "skip", r = e[0] === "skip" ? {} : ee(e[0]), i = typeof t == "string" ? si(t) : t, s = E(i), o = D(
3793
+ function cr(t, ...e) {
3794
+ const n = e[0] === "skip", r = e[0] === "skip" ? {} : te(e[0]), i = typeof t == "string" ? oi(t) : t, s = E(i), o = D(
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(Y(r)), s, n]
3800
- ), l = ta(o).query;
3800
+ ), l = na(o).query;
3801
3801
  if (l instanceof Error)
3802
3802
  throw l;
3803
3803
  return l;
3804
3804
  }
3805
3805
  function wt(t) {
3806
- const e = typeof t == "string" ? si(t) : t, n = _t(pn);
3806
+ const e = typeof t == "string" ? oi(t) : t, n = _t(fn);
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 D(
3812
- () => ci(e, n),
3812
+ () => ui(e, n),
3813
3813
  // eslint-disable-next-line react-hooks/exhaustive-deps
3814
3814
  [n, E(e)]
3815
3815
  );
3816
3816
  }
3817
- function Ko(t) {
3817
+ function Yo(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 Yo = Object.defineProperty, Xo = (t, e, n) => e in t ? Yo(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, Nt = (t, e, n) => Xo(t, typeof e != "symbol" ? e + "" : e, n);
3824
- class ea {
3823
+ var Xo = Object.defineProperty, ea = (t, e, n) => e in t ? Xo(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, Nt = (t, e, n) => ea(t, typeof e != "symbol" ? e + "" : e, n);
3824
+ class ta {
3825
3825
  constructor(e) {
3826
3826
  Nt(this, "createWatch"), Nt(this, "queries"), Nt(this, "listeners"), this.createWatch = e, this.queries = {}, this.listeners = /* @__PURE__ */ new Set();
3827
3827
  }
@@ -3922,8 +3922,8 @@ class ea {
3922
3922
  e();
3923
3923
  }
3924
3924
  }
3925
- function ta(t) {
3926
- const e = Zo();
3925
+ function na(t) {
3926
+ const e = Go();
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,10 +3932,10 @@ function ta(t) {
3932
3932
  journal: s,
3933
3933
  paginationOptions: o
3934
3934
  }) => o ? e.watchPaginatedQuery(r, i, o) : e.watchQuery(r, i, s ? { journal: s } : {}), [e]);
3935
- return na(t, n);
3935
+ return ra(t, n);
3936
3936
  }
3937
- function na(t, e) {
3938
- const [n] = T(() => new ea(e));
3937
+ function ra(t, e) {
3938
+ const [n] = T(() => new ta(e));
3939
3939
  n.createWatch !== e && n.setCreateWatch(e), F(() => () => n.destroy(), [n]);
3940
3940
  const r = D(
3941
3941
  () => ({
@@ -3944,18 +3944,18 @@ function na(t, e) {
3944
3944
  }),
3945
3945
  [n, t]
3946
3946
  );
3947
- return Do(r);
3947
+ return Uo(r);
3948
3948
  }
3949
- var ra = /* @__PURE__ */ Symbol.for("preact-signals");
3949
+ var ia = /* @__PURE__ */ Symbol.for("preact-signals");
3950
3950
  function jt() {
3951
3951
  if (se > 1)
3952
3952
  se--;
3953
3953
  else {
3954
- for (var t, e = !1; Ue !== void 0; ) {
3955
- var n = Ue;
3956
- for (Ue = void 0, Yt++; n !== void 0; ) {
3954
+ for (var t, e = !1; De !== void 0; ) {
3955
+ var n = De;
3956
+ for (De = void 0, Yt++; n !== void 0; ) {
3957
3957
  var r = n.o;
3958
- if (n.o = void 0, n.f &= -3, !(8 & n.f) && di(n)) try {
3958
+ if (n.o = void 0, n.f &= -3, !(8 & n.f) && pi(n)) try {
3959
3959
  n.c();
3960
3960
  } catch (i) {
3961
3961
  e || (t = i, e = !0);
@@ -3966,7 +3966,7 @@ function jt() {
3966
3966
  if (Yt = 0, se--, e) throw t;
3967
3967
  }
3968
3968
  }
3969
- function ia(t) {
3969
+ function sa(t) {
3970
3970
  if (se > 0) return t();
3971
3971
  se++;
3972
3972
  try {
@@ -3976,7 +3976,7 @@ function ia(t) {
3976
3976
  }
3977
3977
  }
3978
3978
  var b = void 0;
3979
- function ui(t) {
3979
+ function hi(t) {
3980
3980
  var e = b;
3981
3981
  b = void 0;
3982
3982
  try {
@@ -3985,8 +3985,8 @@ function ui(t) {
3985
3985
  b = e;
3986
3986
  }
3987
3987
  }
3988
- var Ue = void 0, se = 0, Yt = 0, gt = 0;
3989
- function hi(t) {
3988
+ var De = void 0, se = 0, Yt = 0, ft = 0;
3989
+ function di(t) {
3990
3990
  if (b !== void 0) {
3991
3991
  var e = t.n;
3992
3992
  if (e === void 0 || e.t !== b)
@@ -3998,13 +3998,13 @@ function hi(t) {
3998
3998
  function A(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
- A.prototype.brand = ra;
4001
+ A.prototype.brand = ia;
4002
4002
  A.prototype.h = function() {
4003
4003
  return !0;
4004
4004
  };
4005
4005
  A.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 : ui(function() {
4007
+ n !== t && t.e === void 0 && (t.x = n, this.t = t, n !== void 0 ? n.e = t : hi(function() {
4008
4008
  var r;
4009
4009
  (r = e.W) == null || r.call(e);
4010
4010
  }));
@@ -4013,7 +4013,7 @@ A.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 && ui(function() {
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 && hi(function() {
4017
4017
  var i;
4018
4018
  (i = e.Z) == null || i.call(e);
4019
4019
  }));
@@ -4021,7 +4021,7 @@ A.prototype.U = function(t) {
4021
4021
  };
4022
4022
  A.prototype.subscribe = function(t) {
4023
4023
  var e = this;
4024
- return tt(function() {
4024
+ return et(function() {
4025
4025
  var n = e.value, r = b;
4026
4026
  b = void 0;
4027
4027
  try {
@@ -4050,12 +4050,12 @@ A.prototype.peek = function() {
4050
4050
  }
4051
4051
  };
4052
4052
  Object.defineProperty(A.prototype, "value", { get: function() {
4053
- var t = hi(this);
4053
+ var t = di(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
4057
  if (Yt > 100) throw new Error("Cycle detected");
4058
- this.v = t, this.i++, gt++, se++;
4058
+ this.v = t, this.i++, ft++, se++;
4059
4059
  try {
4060
4060
  for (var e = this.t; e !== void 0; e = e.x) e.t.N();
4061
4061
  } finally {
@@ -4063,14 +4063,14 @@ Object.defineProperty(A.prototype, "value", { get: function() {
4063
4063
  }
4064
4064
  }
4065
4065
  } });
4066
- function re(t, e) {
4066
+ function X(t, e) {
4067
4067
  return new A(t, e);
4068
4068
  }
4069
- function di(t) {
4069
+ function pi(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 pi(t) {
4073
+ function fi(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 pi(t) {
4079
4079
  }
4080
4080
  }
4081
4081
  }
4082
- function fi(t) {
4082
+ function gi(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;
@@ -4087,23 +4087,23 @@ function fi(t) {
4087
4087
  t.s = n;
4088
4088
  }
4089
4089
  function ge(t, e) {
4090
- A.call(this, void 0), this.x = t, this.s = void 0, this.g = gt - 1, this.f = 4, this.W = e?.watched, this.Z = e?.unwatched, this.name = e?.name;
4090
+ A.call(this, void 0), this.x = t, this.s = void 0, this.g = ft - 1, this.f = 4, this.W = e?.watched, this.Z = e?.unwatched, this.name = e?.name;
4091
4091
  }
4092
4092
  ge.prototype = new A();
4093
4093
  ge.prototype.h = function() {
4094
4094
  if (this.f &= -3, 1 & this.f) return !1;
4095
- if ((36 & this.f) == 32 || (this.f &= -5, this.g === gt)) return !0;
4096
- if (this.g = gt, this.f |= 1, this.i > 0 && !di(this))
4095
+ if ((36 & this.f) == 32 || (this.f &= -5, this.g === ft)) return !0;
4096
+ if (this.g = ft, this.f |= 1, this.i > 0 && !pi(this))
4097
4097
  return this.f &= -2, !0;
4098
4098
  var t = b;
4099
4099
  try {
4100
- pi(this), b = this;
4100
+ fi(this), b = 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 b = t, fi(this), this.f &= -2, !0;
4106
+ return b = t, gi(this), this.f &= -2, !0;
4107
4107
  };
4108
4108
  ge.prototype.S = function(t) {
4109
4109
  if (this.t === void 0) {
@@ -4126,14 +4126,14 @@ ge.prototype.N = function() {
4126
4126
  };
4127
4127
  Object.defineProperty(ge.prototype, "value", { get: function() {
4128
4128
  if (1 & this.f) throw new Error("Cycle detected");
4129
- var t = hi(this);
4129
+ var t = di(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 cr(t, e) {
4133
+ function ur(t, e) {
4134
4134
  return new ge(t, e);
4135
4135
  }
4136
- function gi(t) {
4136
+ function mi(t) {
4137
4137
  var e = t.u;
4138
4138
  if (t.u = void 0, typeof e == "function") {
4139
4139
  se++;
@@ -4142,24 +4142,24 @@ function gi(t) {
4142
4142
  try {
4143
4143
  e();
4144
4144
  } catch (r) {
4145
- throw t.f &= -2, t.f |= 8, fn(t), r;
4145
+ throw t.f &= -2, t.f |= 8, gn(t), r;
4146
4146
  } finally {
4147
4147
  b = n, jt();
4148
4148
  }
4149
4149
  }
4150
4150
  }
4151
- function fn(t) {
4151
+ function gn(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, gi(t);
4153
+ t.x = void 0, t.s = void 0, mi(t);
4154
4154
  }
4155
- function sa(t) {
4155
+ function oa(t) {
4156
4156
  if (b !== this) throw new Error("Out-of-order effect");
4157
- fi(this), b = t, this.f &= -2, 8 & this.f && fn(this), jt();
4157
+ gi(this), b = t, this.f &= -2, 8 & this.f && gn(this), jt();
4158
4158
  }
4159
- function qe(t, e) {
4159
+ function $e(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
- qe.prototype.c = function() {
4162
+ $e.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 @@ qe.prototype.c = function() {
4169
4169
  t();
4170
4170
  }
4171
4171
  };
4172
- qe.prototype.S = function() {
4172
+ $e.prototype.S = function() {
4173
4173
  if (1 & this.f) throw new Error("Cycle detected");
4174
- this.f |= 1, this.f &= -9, gi(this), pi(this), se++;
4174
+ this.f |= 1, this.f &= -9, mi(this), fi(this), se++;
4175
4175
  var t = b;
4176
- return b = this, sa.bind(this, t);
4176
+ return b = this, oa.bind(this, t);
4177
4177
  };
4178
- qe.prototype.N = function() {
4179
- 2 & this.f || (this.f |= 2, this.o = Ue, Ue = this);
4178
+ $e.prototype.N = function() {
4179
+ 2 & this.f || (this.f |= 2, this.o = De, De = this);
4180
4180
  };
4181
- qe.prototype.d = function() {
4182
- this.f |= 8, 1 & this.f || fn(this);
4181
+ $e.prototype.d = function() {
4182
+ this.f |= 8, 1 & this.f || gn(this);
4183
4183
  };
4184
- qe.prototype.dispose = function() {
4184
+ $e.prototype.dispose = function() {
4185
4185
  this.d();
4186
4186
  };
4187
- function tt(t, e) {
4188
- var n = new qe(t, e);
4187
+ function et(t, e) {
4188
+ var n = new $e(t, e);
4189
4189
  try {
4190
4190
  n.c();
4191
4191
  } catch (i) {
@@ -4194,22 +4194,22 @@ function tt(t, e) {
4194
4194
  var r = n.d.bind(n);
4195
4195
  return r[Symbol.dispose] = r, r;
4196
4196
  }
4197
- var mi, at, oa = typeof window < "u" && !!window.__PREACT_SIGNALS_DEVTOOLS__, xi = [];
4198
- tt(function() {
4199
- mi = this.N;
4197
+ var xi, ot, aa = typeof window < "u" && !!window.__PREACT_SIGNALS_DEVTOOLS__, bi = [];
4198
+ et(function() {
4199
+ xi = this.N;
4200
4200
  })();
4201
- function Ee(t, e) {
4201
+ function qe(t, e) {
4202
4202
  m[t] = e.bind(null, m[t] || function() {
4203
4203
  });
4204
4204
  }
4205
- function mt(t) {
4206
- if (at) {
4207
- var e = at;
4208
- at = void 0, e();
4205
+ function gt(t) {
4206
+ if (ot) {
4207
+ var e = ot;
4208
+ ot = void 0, e();
4209
4209
  }
4210
- at = t && t.S();
4210
+ ot = t && t.S();
4211
4211
  }
4212
- function bi(t) {
4212
+ function yi(t) {
4213
4213
  var e = this, n = t.data, r = ke(n);
4214
4214
  r.value = n;
4215
4215
  var i = D(function() {
@@ -4217,13 +4217,13 @@ function bi(t) {
4217
4217
  a.__c.__$f |= 4;
4218
4218
  break;
4219
4219
  }
4220
- var u = cr(function() {
4220
+ var u = ur(function() {
4221
4221
  var p = r.value.value;
4222
4222
  return p === 0 ? 0 : p === !0 ? "" : p || "";
4223
- }), d = cr(function() {
4224
- return !Array.isArray(u.value) && !_r(u.value);
4225
- }), c = tt(function() {
4226
- if (this.N = yi, d.value) {
4223
+ }), d = ur(function() {
4224
+ return !Array.isArray(u.value) && !kr(u.value);
4225
+ }), c = et(function() {
4226
+ if (this.N = vi, d.value) {
4227
4227
  var p = u.value;
4228
4228
  l.__v && l.__v.__e && l.__v.__e.nodeType === 3 && (l.__v.__e.data = p);
4229
4229
  }
@@ -4234,11 +4234,11 @@ function bi(t) {
4234
4234
  }, []), s = i[0], o = i[1];
4235
4235
  return s.value ? o.peek() : o.value;
4236
4236
  }
4237
- bi.displayName = "ReactiveTextNode";
4238
- Object.defineProperties(A.prototype, { constructor: { configurable: !0, value: void 0 }, type: { configurable: !0, value: bi }, props: { configurable: !0, get: function() {
4237
+ yi.displayName = "ReactiveTextNode";
4238
+ Object.defineProperties(A.prototype, { constructor: { configurable: !0, value: void 0 }, type: { configurable: !0, value: yi }, props: { configurable: !0, get: function() {
4239
4239
  return { data: this };
4240
4240
  } }, __b: { configurable: !0, value: 1 } });
4241
- Ee("__b", function(t, e) {
4241
+ qe("__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,26 +4248,26 @@ Ee("__b", function(t, e) {
4248
4248
  }
4249
4249
  t(e);
4250
4250
  });
4251
- Ee("__r", function(t, e) {
4251
+ qe("__r", function(t, e) {
4252
4252
  if (t(e), e.type !== B) {
4253
- mt();
4253
+ gt();
4254
4254
  var n, r = e.__c;
4255
4255
  r && (r.__$f &= -2, (n = r.__$u) === void 0 && (r.__$u = n = (function(i, s) {
4256
4256
  var o;
4257
- return tt(function() {
4257
+ return et(function() {
4258
4258
  o = this;
4259
4259
  }, { name: s }), o.c = i, o;
4260
4260
  })(function() {
4261
4261
  var i;
4262
- oa && ((i = n.y) == null || i.call(n)), r.__$f |= 1, r.setState({});
4263
- }, typeof e.type == "function" ? e.type.displayName || e.type.name : ""))), mt(n);
4262
+ aa && ((i = n.y) == null || i.call(n)), r.__$f |= 1, r.setState({});
4263
+ }, typeof e.type == "function" ? e.type.displayName || e.type.name : ""))), gt(n);
4264
4264
  }
4265
4265
  });
4266
- Ee("__e", function(t, e, n, r) {
4267
- mt(), t(e, n, r);
4266
+ qe("__e", function(t, e, n, r) {
4267
+ gt(), t(e, n, r);
4268
4268
  });
4269
- Ee("diffed", function(t, e) {
4270
- mt();
4269
+ qe("diffed", function(t, e) {
4270
+ gt();
4271
4271
  var n;
4272
4272
  if (typeof e.type == "string" && (n = e.__e)) {
4273
4273
  var r = e.__np, i = e.props;
@@ -4281,23 +4281,23 @@ Ee("diffed", function(t, e) {
4281
4281
  s = {}, n.U = s;
4282
4282
  for (var a in r) {
4283
4283
  var u = s[a], d = r[a];
4284
- u === void 0 ? (u = aa(n, a, d, i), s[a] = u) : u.o(d, i);
4284
+ u === void 0 ? (u = la(n, a, d, i), s[a] = u) : u.o(d, i);
4285
4285
  }
4286
4286
  }
4287
4287
  }
4288
4288
  t(e);
4289
4289
  });
4290
- function aa(t, e, n, r) {
4291
- var i = e in t && t.ownerSVGElement === void 0, s = re(n);
4290
+ function la(t, e, n, r) {
4291
+ var i = e in t && t.ownerSVGElement === void 0, s = X(n);
4292
4292
  return { o: function(o, l) {
4293
4293
  s.value = o, r = l;
4294
- }, d: tt(function() {
4295
- this.N = yi;
4294
+ }, d: et(function() {
4295
+ this.N = vi;
4296
4296
  var o = s.value.value;
4297
4297
  r[e] !== o && (r[e] = o, i ? t[e] = o : o != null && (o !== !1 || e[4] === "-") ? t.setAttribute(e, o) : t.removeAttribute(e));
4298
4298
  }) };
4299
4299
  }
4300
- Ee("unmount", function(t, e) {
4300
+ qe("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 @@ Ee("unmount", function(t, e) {
4319
4319
  }
4320
4320
  t(e);
4321
4321
  });
4322
- Ee("__h", function(t, e, n, r) {
4322
+ qe("__h", function(t, e, n, r) {
4323
4323
  (r < 3 || r === 9) && (e.__$f |= 2), t(e, n, r);
4324
4324
  });
4325
4325
  Q.prototype.shouldComponentUpdate = function(t, e) {
@@ -4336,30 +4336,30 @@ Q.prototype.shouldComponentUpdate = function(t, e) {
4336
4336
  };
4337
4337
  function ke(t, e) {
4338
4338
  return D(function() {
4339
- return re(t, e);
4339
+ return X(t, e);
4340
4340
  }, []);
4341
4341
  }
4342
- var la = function(t) {
4342
+ var ca = function(t) {
4343
4343
  queueMicrotask(function() {
4344
4344
  queueMicrotask(t);
4345
4345
  });
4346
4346
  };
4347
- function ca() {
4348
- ia(function() {
4349
- for (var t; t = xi.shift(); ) mi.call(t);
4347
+ function ua() {
4348
+ sa(function() {
4349
+ for (var t; t = bi.shift(); ) xi.call(t);
4350
4350
  });
4351
4351
  }
4352
- function yi() {
4353
- xi.push(this) === 1 && (m.requestAnimationFrame || la)(ca);
4352
+ function vi() {
4353
+ bi.push(this) === 1 && (m.requestAnimationFrame || ca)(ua);
4354
4354
  }
4355
- const I = re(!1), we = re(void 0);
4356
- function ua(t) {
4355
+ const I = X(!1), mt = X(void 0), Xt = X(void 0);
4356
+ function ha(t) {
4357
4357
  return t.replace(/\.convex\.site\b/, ".convex.cloud");
4358
4358
  }
4359
- function ha(t) {
4359
+ function da(t) {
4360
4360
  return t.replace(/\.convex\.cloud\b/, ".convex.site");
4361
4361
  }
4362
- function da(t, e) {
4362
+ function pa(t, e) {
4363
4363
  const n = t.title ?? e?.title ?? "Assistant";
4364
4364
  return {
4365
4365
  title: n,
@@ -4381,21 +4381,21 @@ function da(t, e) {
4381
4381
  windowHeight: t.windowHeight ?? e?.windowHeight
4382
4382
  };
4383
4383
  }
4384
- async function pa(t, e, n) {
4384
+ async function fa(t, e, n) {
4385
4385
  const r = `${t}/widget/config?orgSlug=${encodeURIComponent(e)}`, i = await fetch(r, { signal: n });
4386
4386
  return i.ok ? i.json() : null;
4387
4387
  }
4388
- function fa(t, e) {
4388
+ function ga(t, e) {
4389
4389
  const [n, r] = T(null);
4390
4390
  return F(() => {
4391
4391
  r(null);
4392
- const i = e ?? "https://festive-mouse-978.eu-west-1.convex.cloud", s = i ? ha(i) : void 0;
4392
+ const i = e ?? "https://festive-mouse-978.eu-west-1.convex.cloud", s = i ? da(i) : void 0;
4393
4393
  if (!s || !t)
4394
4394
  return;
4395
4395
  const o = new AbortController();
4396
4396
  async function l(a) {
4397
4397
  try {
4398
- const u = await pa(a, t, o.signal);
4398
+ const u = await fa(a, t, o.signal);
4399
4399
  u && r(u);
4400
4400
  } catch (u) {
4401
4401
  if (u instanceof Error && u.name === "AbortError")
@@ -4407,7 +4407,7 @@ function fa(t, e) {
4407
4407
  };
4408
4408
  }, [t, e]), n;
4409
4409
  }
4410
- const vi = {
4410
+ const _i = {
4411
4411
  title: "Assistant",
4412
4412
  statusOnline: "Online · Responds in seconds",
4413
4413
  inputPlaceholder: "Type a message…",
@@ -4462,7 +4462,7 @@ const vi = {
4462
4462
  somethingWentWrong: "Something went wrong",
4463
4463
  fabLabel: "Chat with us",
4464
4464
  chatNoLongerAvailable: "This chat is no longer available."
4465
- }, ga = {
4465
+ }, ma = {
4466
4466
  title: "Assistent",
4467
4467
  statusOnline: "Online · Antwortet in Sekunden",
4468
4468
  inputPlaceholder: "Nachricht eingeben…",
@@ -4517,25 +4517,25 @@ const vi = {
4517
4517
  somethingWentWrong: "Etwas ist schiefgelaufen",
4518
4518
  fabLabel: "Chatte mit uns",
4519
4519
  chatNoLongerAvailable: "Dieser Chat ist nicht mehr verfügbar."
4520
- }, ma = [
4520
+ }, xa = [
4521
4521
  { value: "de", label: "Deutsch", flag: "🇩🇪" },
4522
4522
  { value: "en", label: "English", flag: "🇬🇧" }
4523
- ], xa = "de", ba = "jex-locale", gn = re("de"), ya = { en: vi, de: ga };
4523
+ ], ba = "de", ya = "jex-locale", mn = X("de"), va = { en: _i, de: ma };
4524
4524
  function P() {
4525
- return ya[gn.value] ?? vi;
4525
+ return va[mn.value] ?? _i;
4526
4526
  }
4527
4527
  function zt(t) {
4528
4528
  if (!t)
4529
4529
  return null;
4530
4530
  const e = (t.split("-")[0] ?? "").toLowerCase();
4531
- return ma.some((n) => n.value === e) ? e : null;
4531
+ return xa.some((n) => n.value === e) ? e : null;
4532
4532
  }
4533
- function _i(t) {
4533
+ function ki(t) {
4534
4534
  const e = zt(t);
4535
4535
  if (e)
4536
4536
  return e;
4537
4537
  try {
4538
- const n = zt(localStorage.getItem(ba));
4538
+ const n = zt(localStorage.getItem(ya));
4539
4539
  if (n)
4540
4540
  return n;
4541
4541
  } catch {
@@ -4545,51 +4545,51 @@ function _i(t) {
4545
4545
  if (n)
4546
4546
  return n;
4547
4547
  }
4548
- return xa;
4548
+ return ba;
4549
4549
  }
4550
- function va(t) {
4550
+ function _a(t) {
4551
4551
  F(() => {
4552
4552
  function e(n) {
4553
4553
  const r = t ?? window.location.origin;
4554
4554
  if (n.origin !== r || n.data?.type !== "jexity:config")
4555
4555
  return;
4556
4556
  const { locale: i } = n.data.payload;
4557
- i && (gn.value = _i(i));
4557
+ i && (mn.value = ki(i));
4558
4558
  }
4559
4559
  return window.addEventListener("message", e), () => {
4560
4560
  window.removeEventListener("message", e);
4561
4561
  };
4562
4562
  }, [t]);
4563
4563
  }
4564
- const mn = "jex-session-ref", St = "jex-session-active", ae = re(null), pe = re(!1);
4565
- function _a() {
4564
+ const xn = "jex-session-ref", St = "jex-session-active", ae = X(null), pe = X(!1);
4565
+ function ka() {
4566
4566
  return "JEX-" + Math.random().toString(36).slice(2, 8).toUpperCase();
4567
4567
  }
4568
- function ka() {
4568
+ function wa() {
4569
4569
  try {
4570
- const t = sessionStorage.getItem(mn), e = sessionStorage.getItem(St);
4570
+ const t = sessionStorage.getItem(xn), e = sessionStorage.getItem(St);
4571
4571
  ae.value = t ?? null, pe.value = t !== null && e === "true";
4572
4572
  } catch {
4573
4573
  ae.value = null, pe.value = !1;
4574
4574
  }
4575
4575
  }
4576
- function Xt() {
4577
- const t = _a();
4576
+ function en() {
4577
+ const t = ka();
4578
4578
  ae.value = t, pe.value = !1;
4579
4579
  try {
4580
- sessionStorage.setItem(mn, t), sessionStorage.removeItem(St);
4580
+ sessionStorage.setItem(xn, t), sessionStorage.removeItem(St);
4581
4581
  } catch {
4582
4582
  }
4583
4583
  return t;
4584
4584
  }
4585
- function wa(t) {
4585
+ function ja(t) {
4586
4586
  ae.value = t, pe.value = !0;
4587
4587
  try {
4588
- sessionStorage.setItem(mn, t), sessionStorage.setItem(St, "true");
4588
+ sessionStorage.setItem(xn, t), sessionStorage.setItem(St, "true");
4589
4589
  } catch {
4590
4590
  }
4591
4591
  }
4592
- function ja() {
4592
+ function Sa() {
4593
4593
  if (ae.value) {
4594
4594
  pe.value = !0;
4595
4595
  try {
@@ -4598,7 +4598,7 @@ function ja() {
4598
4598
  }
4599
4599
  }
4600
4600
  }
4601
- function Sa(t) {
4601
+ function Ca(t) {
4602
4602
  const e = {}, { primaryColor: n, theme: r } = t;
4603
4603
  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) {
4604
4604
  const i = r.bg;
@@ -4614,17 +4614,17 @@ function Sa(t) {
4614
4614
  }
4615
4615
  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;
4616
4616
  }
4617
- const V = re([{ id: "home" }]), Ca = re("screen");
4618
- function je(t) {
4617
+ const V = X([{ id: "home" }]), Ra = X("screen");
4618
+ function we(t) {
4619
4619
  V.value = [...V.value, t];
4620
4620
  }
4621
- function xn() {
4621
+ function bn() {
4622
4622
  V.value.length > 1 && (V.value = V.value.slice(0, -1));
4623
4623
  }
4624
- function Se(t) {
4624
+ function je(t) {
4625
4625
  V.value = [...V.value.slice(0, -1), t];
4626
4626
  }
4627
- function bn({ size: t = 24 }) {
4627
+ function yn({ size: t = 24 }) {
4628
4628
  return /* @__PURE__ */ h("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: [
4629
4629
  /* @__PURE__ */ h("path", { d: "M12 8V4H8" }),
4630
4630
  /* @__PURE__ */ h("rect", { width: "16", height: "12", x: "4", y: "8", rx: "2" }),
@@ -4634,29 +4634,29 @@ function bn({ size: t = 24 }) {
4634
4634
  /* @__PURE__ */ h("path", { d: "M9 13v2" })
4635
4635
  ] });
4636
4636
  }
4637
- function ur({ title: t }) {
4637
+ function hr({ title: t }) {
4638
4638
  const e = P(), n = V.value.length > 1;
4639
4639
  return /* @__PURE__ */ h("header", { class: "jex-chat-header", children: [
4640
4640
  n && /* @__PURE__ */ h(
4641
4641
  "button",
4642
4642
  {
4643
4643
  class: "jex-header-back",
4644
- onClick: xn,
4644
+ onClick: bn,
4645
4645
  "aria-label": e.back || "Go back",
4646
4646
  children: /* @__PURE__ */ h("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__ */ h("path", { d: "m15 18-6-6 6-6" }) })
4647
4647
  }
4648
4648
  ),
4649
- !n && /* @__PURE__ */ h(bn, { size: 24 }),
4649
+ !n && /* @__PURE__ */ h(yn, { size: 24 }),
4650
4650
  /* @__PURE__ */ h("div", { class: "jex-header-info", children: [
4651
4651
  /* @__PURE__ */ h("h3", { children: t }),
4652
4652
  /* @__PURE__ */ h("p", { children: e.statusOnline })
4653
4653
  ] })
4654
4654
  ] });
4655
4655
  }
4656
- function Ra({ size: t = 14 }) {
4656
+ function Ta({ size: t = 14 }) {
4657
4657
  return /* @__PURE__ */ h("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__ */ h("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" }) });
4658
4658
  }
4659
- function hr() {
4659
+ function dr() {
4660
4660
  return /* @__PURE__ */ h("div", { class: "jex-widget-footer", children: /* @__PURE__ */ h(
4661
4661
  "a",
4662
4662
  {
@@ -4665,7 +4665,7 @@ function hr() {
4665
4665
  rel: "noopener noreferrer",
4666
4666
  class: "jex-branding",
4667
4667
  children: [
4668
- /* @__PURE__ */ h(Ra, { size: 14 }),
4668
+ /* @__PURE__ */ h(Ta, { size: 14 }),
4669
4669
  /* @__PURE__ */ h("span", { children: [
4670
4670
  "Powered by ",
4671
4671
  /* @__PURE__ */ h("strong", { children: "Jexity" })
@@ -4674,16 +4674,16 @@ function hr() {
4674
4674
  }
4675
4675
  ) });
4676
4676
  }
4677
- function ki({ size: t = 28 }) {
4677
+ function wi({ size: t = 28 }) {
4678
4678
  return /* @__PURE__ */ h("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__ */ h("path", { d: "M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z" }) });
4679
4679
  }
4680
- function Ta({ size: t = 28 }) {
4680
+ function Aa({ size: t = 28 }) {
4681
4681
  return /* @__PURE__ */ h("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: [
4682
4682
  /* @__PURE__ */ h("path", { d: "M18 6 6 18" }),
4683
4683
  /* @__PURE__ */ h("path", { d: "m6 6 12 12" })
4684
4684
  ] });
4685
4685
  }
4686
- function Aa({ size: t = 24, ...e }) {
4686
+ function Ia({ size: t = 24, ...e }) {
4687
4687
  return /* @__PURE__ */ h(
4688
4688
  "svg",
4689
4689
  {
@@ -4700,52 +4700,52 @@ function Aa({ size: t = 24, ...e }) {
4700
4700
  }
4701
4701
  );
4702
4702
  }
4703
- const Ia = {
4704
- chat: /* @__PURE__ */ h(ki, { size: 28 }),
4705
- bot: /* @__PURE__ */ h(bn, { size: 28 }),
4706
- sparkles: /* @__PURE__ */ h(Aa, { size: 28 })
4707
- }, $a = {
4703
+ const $a = {
4704
+ chat: /* @__PURE__ */ h(wi, { size: 28 }),
4705
+ bot: /* @__PURE__ */ h(yn, { size: 28 }),
4706
+ sparkles: /* @__PURE__ */ h(Ia, { size: 28 })
4707
+ }, qa = {
4708
4708
  none: "0px",
4709
4709
  sm: "0.5rem",
4710
4710
  md: "0.75rem",
4711
4711
  lg: "1.25rem",
4712
4712
  full: "9999px"
4713
4713
  };
4714
- function qa({ radius: t = "full", iconOption: e = "chat", label: n }) {
4714
+ function Ea({ radius: t = "full", iconOption: e = "chat", label: n }) {
4715
4715
  const r = P(), i = n ?? r.fabLabel, s = i !== "";
4716
4716
  return /* @__PURE__ */ h(
4717
4717
  "button",
4718
4718
  {
4719
4719
  class: `jex-floating-button ${!I.value && s ? "jex-has-label" : ""}`,
4720
- style: { borderRadius: $a[t] ?? "9999px" },
4720
+ style: { borderRadius: qa[t] ?? "9999px" },
4721
4721
  onClick: () => {
4722
4722
  I.value = !I.value;
4723
4723
  },
4724
4724
  "aria-label": I.value ? r.closeChatAriaLabel : r.openChatAriaLabel,
4725
- children: I.value ? /* @__PURE__ */ h(Ta, { size: 28 }) : /* @__PURE__ */ h("div", { class: "jex-fab-inner", children: [
4726
- Ia[e],
4725
+ children: I.value ? /* @__PURE__ */ h(Aa, { size: 28 }) : /* @__PURE__ */ h("div", { class: "jex-fab-inner", children: [
4726
+ $a[e],
4727
4727
  s && /* @__PURE__ */ h("span", { class: "jex-fab-label", children: i })
4728
4728
  ] })
4729
4729
  }
4730
4730
  );
4731
4731
  }
4732
- function Ea({ title: t }) {
4732
+ function Pa({ title: t }) {
4733
4733
  const e = P(), n = ae.value, [r, i] = T("");
4734
4734
  function s() {
4735
- Xt(), je({ id: "chat" });
4735
+ en(), we({ id: "chat" });
4736
4736
  }
4737
4737
  function o() {
4738
- je({ id: "chat" });
4738
+ we({ id: "chat" });
4739
4739
  }
4740
4740
  function l(a) {
4741
4741
  a.preventDefault();
4742
4742
  const u = r.trim().toUpperCase();
4743
- u && (wa(u), je({ id: "chat" }));
4743
+ u && (ja(u), we({ id: "chat" }));
4744
4744
  }
4745
4745
  return /* @__PURE__ */ h("div", { class: "jex-home", children: [
4746
4746
  /* @__PURE__ */ h("div", { class: "jex-home-hero", children: [
4747
4747
  /* @__PURE__ */ h("div", { class: "jex-home-avatar", children: [
4748
- /* @__PURE__ */ h(ki, { size: 24 }),
4748
+ /* @__PURE__ */ h(wi, { size: 24 }),
4749
4749
  /* @__PURE__ */ h("span", { class: "jex-home-status-dot" })
4750
4750
  ] }),
4751
4751
  /* @__PURE__ */ h("div", { class: "jex-home-hero-text", children: [
@@ -4788,7 +4788,7 @@ function Ea({ title: t }) {
4788
4788
  ] })
4789
4789
  ] });
4790
4790
  }
4791
- function Pa({ title: t }) {
4791
+ function Ma({ title: t }) {
4792
4792
  const e = P();
4793
4793
  return /* @__PURE__ */ h("div", { class: "jex-selection", children: [
4794
4794
  /* @__PURE__ */ h("h2", { class: "jex-selection-title", children: e.howCanWeHelp }),
@@ -4797,7 +4797,7 @@ function Pa({ title: t }) {
4797
4797
  "button",
4798
4798
  {
4799
4799
  class: "jex-selection-option",
4800
- onClick: () => je({ id: "chat" }),
4800
+ onClick: () => we({ id: "chat" }),
4801
4801
  children: [
4802
4802
  /* @__PURE__ */ h("span", { class: "jex-selection-icon", children: "💬" }),
4803
4803
  /* @__PURE__ */ h("span", { class: "jex-selection-label", children: e.chatWith.replace("{title}", t) }),
@@ -4809,7 +4809,7 @@ function Pa({ title: t }) {
4809
4809
  "button",
4810
4810
  {
4811
4811
  class: "jex-selection-option",
4812
- onClick: () => je({ id: "form" }),
4812
+ onClick: () => we({ id: "form" }),
4813
4813
  children: [
4814
4814
  /* @__PURE__ */ h("span", { class: "jex-selection-icon", children: "📝" }),
4815
4815
  /* @__PURE__ */ h("span", { class: "jex-selection-label", children: e.submitTicket }),
@@ -4820,13 +4820,13 @@ function Pa({ title: t }) {
4820
4820
  ] })
4821
4821
  ] });
4822
4822
  }
4823
- function wi(t, e) {
4823
+ function ji(t, e) {
4824
4824
  const n = {
4825
4825
  get(r, i) {
4826
4826
  if (typeof i == "string") {
4827
4827
  const s = [...e, i];
4828
- return wi(t, s);
4829
- } else if (i === ii) {
4828
+ return ji(t, s);
4829
+ } else if (i === si) {
4830
4830
  if (e.length < 1) {
4831
4831
  const s = [t, ...e].join(".");
4832
4832
  throw new Error(
@@ -4840,70 +4840,66 @@ function wi(t, e) {
4840
4840
  };
4841
4841
  return new Proxy({}, n);
4842
4842
  }
4843
- const Ma = () => wi("components", []), Ie = io;
4844
- Ma();
4845
- function Oa(t) {
4846
- const e = vt(null), n = ke(!1), r = ke(!1), i = ke(!1), s = ke(null), o = wt(Ie.functions.chat.public.sessions.createOrResume), l = He(async () => {
4843
+ const Oa = () => ji("components", []), Ae = so;
4844
+ Oa();
4845
+ function La(t) {
4846
+ const e = vt(null), n = ke(!1), r = ke(!1), i = ke(!1), s = ke(null), o = wt(Ae.functions.chat.public.sessions.createOrResume), l = async (c) => {
4847
+ const f = Xt.value;
4848
+ if (!f)
4849
+ return console.warn("[JexityChat] No bootstrap token — session creation blocked."), null;
4850
+ const p = await o({
4851
+ orgSlug: t,
4852
+ visitorId: c,
4853
+ bootstrapToken: f,
4854
+ ...mt.value ? { source: mt.value } : {}
4855
+ });
4856
+ s.value = p.status;
4857
+ const g = { sessionId: p.sessionId, visitorId: c };
4858
+ return e.current = g, { session: g, result: p };
4859
+ }, a = We(async () => {
4847
4860
  if (e.current)
4848
4861
  return e.current;
4849
4862
  if (i.value)
4850
4863
  return null;
4851
4864
  n.value = !0;
4852
- const d = ae.value !== null, c = ae.value ?? Xt();
4865
+ const c = ae.value !== null, f = ae.value ?? en();
4853
4866
  try {
4854
- const f = await o({
4855
- orgSlug: t,
4856
- visitorId: c,
4857
- ...we.value ? { source: we.value } : {}
4858
- });
4859
- if (s.value = f.status, d && f.isNew) {
4860
- r.value = !0, i.value = !0;
4861
- const g = { sessionId: f.sessionId, visitorId: c };
4862
- return e.current = g, g;
4863
- }
4864
- const p = { sessionId: f.sessionId, visitorId: c };
4865
- return e.current = p, p;
4866
- } catch (f) {
4867
- return console.error("[jexity] Failed to create session:", f), null;
4867
+ const p = await l(f);
4868
+ return p ? (c && p.result.isNew && (r.value = !0, i.value = !0), p.session) : null;
4869
+ } catch (p) {
4870
+ return console.error("[JexityChat] Failed to create session:", p), null;
4868
4871
  } finally {
4869
4872
  n.value = !1;
4870
4873
  }
4871
- }, [t, o, n, r, i]), a = He(async () => {
4874
+ }, [t, o, n, r, i]), u = We(async () => {
4872
4875
  e.current = null, i.value = !1, r.value = !1;
4873
- const d = Xt();
4876
+ const c = en();
4874
4877
  n.value = !0;
4875
4878
  try {
4876
- const c = await o({
4877
- orgSlug: t,
4878
- visitorId: d,
4879
- ...we.value ? { source: we.value } : {}
4880
- });
4881
- s.value = c.status;
4882
- const f = { sessionId: c.sessionId, visitorId: d };
4883
- return e.current = f, f;
4884
- } catch (c) {
4885
- return console.error("[jexity] Failed to create fresh session:", c), null;
4879
+ return (await l(c))?.session ?? null;
4880
+ } catch (f) {
4881
+ return console.error("[JexityChat] Failed to create fresh session:", f), null;
4886
4882
  } finally {
4887
4883
  n.value = !1;
4888
4884
  }
4889
- }, [t, o, n, r, i, s]), u = e.current;
4885
+ }, [t, o, n, r, i, s]), d = e.current;
4890
4886
  return {
4891
- sessionId: u?.sessionId ?? null,
4892
- visitorId: u?.visitorId ?? null,
4887
+ sessionId: d?.sessionId ?? null,
4888
+ visitorId: d?.visitorId ?? null,
4893
4889
  isLoading: n.value,
4894
4890
  sessionNotFound: r.value,
4895
4891
  resumeFailed: i.value,
4896
4892
  sessionStatus: s.value,
4897
4893
  isOrgDeleted: s.value === "org_deleted",
4898
- ensureSession: l,
4899
- startFresh: a
4894
+ ensureSession: a,
4895
+ startFresh: u
4900
4896
  };
4901
4897
  }
4902
- function yn() {
4898
+ function vn() {
4903
4899
  return { async: !1, breaks: !1, extensions: null, gfm: !0, hooks: null, pedantic: !1, renderer: null, silent: !1, tokenizer: null, walkTokens: null };
4904
4900
  }
4905
- var me = yn();
4906
- function ji(t) {
4901
+ var me = vn();
4902
+ function Si(t) {
4907
4903
  me = t;
4908
4904
  }
4909
4905
  var ce = { exec: () => null };
@@ -4914,21 +4910,21 @@ function x(t, e = "") {
4914
4910
  }, getRegex: () => new RegExp(n, e) };
4915
4911
  return r;
4916
4912
  }
4917
- var La = (() => {
4913
+ var Na = (() => {
4918
4914
  try {
4919
4915
  return !!new RegExp("(?<=1)(?<!1)");
4920
4916
  } catch {
4921
4917
  return !1;
4922
4918
  }
4923
- })(), $ = { 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)}}>`) }, Na = /^(?:[ \t]*(?:\n|$))+/, za = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, Qa = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, nt = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, Va = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, vn = / {0,3}(?:[*+-]|\d{1,9}[.)])/, Si = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, Ci = x(Si).replace(/bull/g, vn).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(), Ba = x(Si).replace(/bull/g, vn).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(), _n = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, Fa = /^[^\n]+/, kn = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/, Da = x(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", kn).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), Ua = x(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, vn).getRegex(), Ct = "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", wn = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, Wa = x("^ {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", wn).replace("tag", Ct).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), Ri = x(_n).replace("hr", nt).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", Ct).getRegex(), Ha = x(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", Ri).getRegex(), jn = { blockquote: Ha, code: za, def: Da, fences: Qa, heading: Va, hr: nt, html: Wa, lheading: Ci, list: Ua, newline: Na, paragraph: Ri, table: ce, text: Fa }, dr = x("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", nt).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", Ct).getRegex(), Ja = { ...jn, lheading: Ba, table: dr, paragraph: x(_n).replace("hr", nt).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", dr).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", Ct).getRegex() }, Za = { ...jn, html: x(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment", wn).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: ce, lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/, paragraph: x(_n).replace("hr", nt).replace("heading", ` *#{1,6} *[^
4924
- ]`).replace("lheading", Ci).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex() }, Ga = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, Ka = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, Ti = /^( {2,}|\\)\n(?!\s*$)/, Ya = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, Pe = /[\p{P}\p{S}]/u, Rt = /[\s\p{P}\p{S}]/u, Sn = /[^\s\p{P}\p{S}]/u, Xa = x(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, Rt).getRegex(), Ai = /(?!~)[\p{P}\p{S}]/u, el = /(?!~)[\s\p{P}\p{S}]/u, tl = /(?:[^\s\p{P}\p{S}]|~)/u, nl = x(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", La ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex(), Ii = /^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/, rl = x(Ii, "u").replace(/punct/g, Pe).getRegex(), il = x(Ii, "u").replace(/punct/g, Ai).getRegex(), $i = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", sl = x($i, "gu").replace(/notPunctSpace/g, Sn).replace(/punctSpace/g, Rt).replace(/punct/g, Pe).getRegex(), ol = x($i, "gu").replace(/notPunctSpace/g, tl).replace(/punctSpace/g, el).replace(/punct/g, Ai).getRegex(), al = x("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, Sn).replace(/punctSpace/g, Rt).replace(/punct/g, Pe).getRegex(), ll = x(/^~~?(?:((?!~)punct)|[^\s~])/, "u").replace(/punct/g, Pe).getRegex(), cl = "^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)", ul = x(cl, "gu").replace(/notPunctSpace/g, Sn).replace(/punctSpace/g, Rt).replace(/punct/g, Pe).getRegex(), hl = x(/\\(punct)/, "gu").replace(/punct/g, Pe).getRegex(), dl = x(/^<(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(), pl = x(wn).replace("(?:-->|$)", "-->").getRegex(), fl = x("^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", pl).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), xt = /(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/, gl = x(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label", xt).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), qi = x(/^!?\[(label)\]\[(ref)\]/).replace("label", xt).replace("ref", kn).getRegex(), Ei = x(/^!?\[(ref)\](?:\[\])?/).replace("ref", kn).getRegex(), ml = x("reflink|nolink(?!\\()", "g").replace("reflink", qi).replace("nolink", Ei).getRegex(), pr = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/, Cn = { _backpedal: ce, anyPunctuation: hl, autolink: dl, blockSkip: nl, br: Ti, code: Ka, del: ce, delLDelim: ce, delRDelim: ce, emStrongLDelim: rl, emStrongRDelimAst: sl, emStrongRDelimUnd: al, escape: Ga, link: gl, nolink: Ei, punctuation: Xa, reflink: qi, reflinkSearch: ml, tag: fl, text: Ya, url: ce }, xl = { ...Cn, link: x(/^!?\[(label)\]\((.*?)\)/).replace("label", xt).getRegex(), reflink: x(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", xt).getRegex() }, en = { ...Cn, emStrongRDelimAst: ol, emStrongLDelim: il, delLDelim: ll, delRDelim: ul, url: x(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol", pr).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: x(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol", pr).getRegex() }, bl = { ...en, br: x(Ti).replace("{2,}", "*").getRegex(), text: x(en.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex() }, lt = { normal: jn, gfm: Ja, pedantic: Za }, Oe = { normal: Cn, gfm: en, breaks: bl, pedantic: xl }, yl = { "&": "&amp;", "<": "&lt;", ">": "&gt;", '"': "&quot;", "'": "&#39;" }, fr = (t) => yl[t];
4919
+ })(), $ = { 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)}}>`) }, za = /^(?:[ \t]*(?:\n|$))+/, Qa = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, Va = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, tt = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, Ba = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, _n = / {0,3}(?:[*+-]|\d{1,9}[.)])/, Ci = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, Ri = x(Ci).replace(/bull/g, _n).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(), Fa = x(Ci).replace(/bull/g, _n).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(), kn = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, Da = /^[^\n]+/, wn = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/, Ua = x(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", wn).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), Wa = x(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, _n).getRegex(), Ct = "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", jn = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, Ha = x("^ {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", jn).replace("tag", Ct).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), Ti = x(kn).replace("hr", tt).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", Ct).getRegex(), Ja = x(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", Ti).getRegex(), Sn = { blockquote: Ja, code: Qa, def: Ua, fences: Va, heading: Ba, hr: tt, html: Ha, lheading: Ri, list: Wa, newline: za, paragraph: Ti, table: ce, text: Da }, pr = x("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", tt).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", Ct).getRegex(), Za = { ...Sn, lheading: Fa, table: pr, paragraph: x(kn).replace("hr", tt).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", pr).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", Ct).getRegex() }, Ga = { ...Sn, html: x(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment", jn).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: ce, lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/, paragraph: x(kn).replace("hr", tt).replace("heading", ` *#{1,6} *[^
4920
+ ]`).replace("lheading", Ri).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex() }, Ka = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, Ya = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, Ai = /^( {2,}|\\)\n(?!\s*$)/, Xa = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, Ee = /[\p{P}\p{S}]/u, Rt = /[\s\p{P}\p{S}]/u, Cn = /[^\s\p{P}\p{S}]/u, el = x(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, Rt).getRegex(), Ii = /(?!~)[\p{P}\p{S}]/u, tl = /(?!~)[\s\p{P}\p{S}]/u, nl = /(?:[^\s\p{P}\p{S}]|~)/u, rl = x(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", Na ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex(), $i = /^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/, il = x($i, "u").replace(/punct/g, Ee).getRegex(), sl = x($i, "u").replace(/punct/g, Ii).getRegex(), qi = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", ol = x(qi, "gu").replace(/notPunctSpace/g, Cn).replace(/punctSpace/g, Rt).replace(/punct/g, Ee).getRegex(), al = x(qi, "gu").replace(/notPunctSpace/g, nl).replace(/punctSpace/g, tl).replace(/punct/g, Ii).getRegex(), ll = x("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, Cn).replace(/punctSpace/g, Rt).replace(/punct/g, Ee).getRegex(), cl = x(/^~~?(?:((?!~)punct)|[^\s~])/, "u").replace(/punct/g, Ee).getRegex(), ul = "^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)", hl = x(ul, "gu").replace(/notPunctSpace/g, Cn).replace(/punctSpace/g, Rt).replace(/punct/g, Ee).getRegex(), dl = x(/\\(punct)/, "gu").replace(/punct/g, Ee).getRegex(), pl = x(/^<(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(), fl = x(jn).replace("(?:-->|$)", "-->").getRegex(), gl = x("^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", fl).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), xt = /(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/, ml = x(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label", xt).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), Ei = x(/^!?\[(label)\]\[(ref)\]/).replace("label", xt).replace("ref", wn).getRegex(), Pi = x(/^!?\[(ref)\](?:\[\])?/).replace("ref", wn).getRegex(), xl = x("reflink|nolink(?!\\()", "g").replace("reflink", Ei).replace("nolink", Pi).getRegex(), fr = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/, Rn = { _backpedal: ce, anyPunctuation: dl, autolink: pl, blockSkip: rl, br: Ai, code: Ya, del: ce, delLDelim: ce, delRDelim: ce, emStrongLDelim: il, emStrongRDelimAst: ol, emStrongRDelimUnd: ll, escape: Ka, link: ml, nolink: Pi, punctuation: el, reflink: Ei, reflinkSearch: xl, tag: gl, text: Xa, url: ce }, bl = { ...Rn, link: x(/^!?\[(label)\]\((.*?)\)/).replace("label", xt).getRegex(), reflink: x(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", xt).getRegex() }, tn = { ...Rn, emStrongRDelimAst: al, emStrongLDelim: sl, delLDelim: cl, delRDelim: hl, url: x(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol", fr).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: x(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol", fr).getRegex() }, yl = { ...tn, br: x(Ai).replace("{2,}", "*").getRegex(), text: x(tn.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex() }, at = { normal: Sn, gfm: Za, pedantic: Ga }, Me = { normal: Rn, gfm: tn, breaks: yl, pedantic: bl }, vl = { "&": "&amp;", "<": "&lt;", ">": "&gt;", '"': "&quot;", "'": "&#39;" }, gr = (t) => vl[t];
4925
4921
  function Z(t, e) {
4926
4922
  if (e) {
4927
- if ($.escapeTest.test(t)) return t.replace($.escapeReplace, fr);
4928
- } else if ($.escapeTestNoEncode.test(t)) return t.replace($.escapeReplaceNoEncode, fr);
4923
+ if ($.escapeTest.test(t)) return t.replace($.escapeReplace, gr);
4924
+ } else if ($.escapeTestNoEncode.test(t)) return t.replace($.escapeReplaceNoEncode, gr);
4929
4925
  return t;
4930
4926
  }
4931
- function gr(t) {
4927
+ function mr(t) {
4932
4928
  try {
4933
4929
  t = encodeURI(t).replace($.percentDecode, "%");
4934
4930
  } catch {
@@ -4936,7 +4932,7 @@ function gr(t) {
4936
4932
  }
4937
4933
  return t;
4938
4934
  }
4939
- function mr(t, e) {
4935
+ function xr(t, e) {
4940
4936
  let n = t.replace($.findPipe, (s, o, l) => {
4941
4937
  let a = !1, u = o;
4942
4938
  for (; --u >= 0 && l[u] === "\\"; ) a = !a;
@@ -4947,7 +4943,7 @@ function mr(t, e) {
4947
4943
  for (; i < r.length; i++) r[i] = r[i].trim().replace($.slashPipe, "|");
4948
4944
  return r;
4949
4945
  }
4950
- function Le(t, e, n) {
4946
+ function Oe(t, e, n) {
4951
4947
  let r = t.length;
4952
4948
  if (r === 0) return "";
4953
4949
  let i = 0;
@@ -4955,7 +4951,7 @@ function Le(t, e, n) {
4955
4951
  i++;
4956
4952
  return t.slice(0, r - i);
4957
4953
  }
4958
- function vl(t, e) {
4954
+ function _l(t, e) {
4959
4955
  if (t.indexOf(e[1]) === -1) return -1;
4960
4956
  let n = 0;
4961
4957
  for (let r = 0; r < t.length; r++) if (t[r] === "\\") r++;
@@ -4963,7 +4959,7 @@ function vl(t, e) {
4963
4959
  else if (t[r] === e[1] && (n--, n < 0)) return r;
4964
4960
  return n > 0 ? -2 : -1;
4965
4961
  }
4966
- function _l(t, e = 0) {
4962
+ function kl(t, e = 0) {
4967
4963
  let n = e, r = "";
4968
4964
  for (let i of t) if (i === " ") {
4969
4965
  let s = 4 - n % 4;
@@ -4971,13 +4967,13 @@ function _l(t, e = 0) {
4971
4967
  } else r += i, n++;
4972
4968
  return r;
4973
4969
  }
4974
- function xr(t, e, n, r, i) {
4970
+ function br(t, e, n, r, i) {
4975
4971
  let s = e.href, o = e.title || null, l = t[1].replace(i.other.outputLinkReplace, "$1");
4976
4972
  r.state.inLink = !0;
4977
4973
  let a = { type: t[0].charAt(0) === "!" ? "image" : "link", raw: n, href: s, title: o, text: l, tokens: r.inlineTokens(l) };
4978
4974
  return r.state.inLink = !1, a;
4979
4975
  }
4980
- function kl(t, e, n) {
4976
+ function wl(t, e, n) {
4981
4977
  let r = t.match(n.other.indentCodeCompensation);
4982
4978
  if (r === null) return e;
4983
4979
  let i = r[1];
@@ -5005,14 +5001,14 @@ var bt = class {
5005
5001
  let e = this.rules.block.code.exec(t);
5006
5002
  if (e) {
5007
5003
  let n = e[0].replace(this.rules.other.codeRemoveIndent, "");
5008
- return { type: "code", raw: e[0], codeBlockStyle: "indented", text: this.options.pedantic ? n : Le(n, `
5004
+ return { type: "code", raw: e[0], codeBlockStyle: "indented", text: this.options.pedantic ? n : Oe(n, `
5009
5005
  `) };
5010
5006
  }
5011
5007
  }
5012
5008
  fences(t) {
5013
5009
  let e = this.rules.block.fences.exec(t);
5014
5010
  if (e) {
5015
- let n = e[0], r = kl(n, e[3] || "", this.rules);
5011
+ let n = e[0], r = wl(n, e[3] || "", this.rules);
5016
5012
  return { type: "code", raw: n, lang: e[2] ? e[2].trim().replace(this.rules.inline.anyPunctuation, "$1") : e[2], text: r };
5017
5013
  }
5018
5014
  }
@@ -5021,7 +5017,7 @@ var bt = class {
5021
5017
  if (e) {
5022
5018
  let n = e[2].trim();
5023
5019
  if (this.rules.other.endingHash.test(n)) {
5024
- let r = Le(n, "#");
5020
+ let r = Oe(n, "#");
5025
5021
  (this.options.pedantic || !r || this.rules.other.endingSpaceChar.test(r)) && (n = r.trim());
5026
5022
  }
5027
5023
  return { type: "heading", raw: e[0], depth: e[1].length, text: n, tokens: this.lexer.inline(n) };
@@ -5029,13 +5025,13 @@ var bt = class {
5029
5025
  }
5030
5026
  hr(t) {
5031
5027
  let e = this.rules.block.hr.exec(t);
5032
- if (e) return { type: "hr", raw: Le(e[0], `
5028
+ if (e) return { type: "hr", raw: Oe(e[0], `
5033
5029
  `) };
5034
5030
  }
5035
5031
  blockquote(t) {
5036
5032
  let e = this.rules.block.blockquote.exec(t);
5037
5033
  if (e) {
5038
- let n = Le(e[0], `
5034
+ let n = Oe(e[0], `
5039
5035
  `).split(`
5040
5036
  `), r = "", i = "", s = [];
5041
5037
  for (; n.length > 0; ) {
@@ -5082,7 +5078,7 @@ ${d}` : d;
5082
5078
  let a = !1, u = "", d = "";
5083
5079
  if (!(e = s.exec(t)) || this.rules.block.hr.test(t)) break;
5084
5080
  u = e[0], t = t.substring(u.length);
5085
- let c = _l(e[2].split(`
5081
+ let c = kl(e[2].split(`
5086
5082
  `, 1)[0], e[1].length), f = t.split(`
5087
5083
  `, 1)[0], p = !c.trim(), g = 0;
5088
5084
  if (this.options.pedantic ? (g = 2, d = c.trimStart()) : p ? g = e[1].length + 1 : (g = c.search(this.rules.other.nonSpaceChar), g = g > 4 ? 1 : g, d = c.slice(g), g += e[1].length), p && this.rules.other.blankLine.test(f) && (u += f + `
@@ -5150,12 +5146,12 @@ ${d}` : d;
5150
5146
  table(t) {
5151
5147
  let e = this.rules.block.table.exec(t);
5152
5148
  if (!e || !this.rules.other.tableDelimiter.test(e[2])) return;
5153
- let n = mr(e[1]), r = e[2].replace(this.rules.other.tableAlignChars, "").split("|"), i = e[3]?.trim() ? e[3].replace(this.rules.other.tableRowBlankLine, "").split(`
5149
+ let n = xr(e[1]), r = e[2].replace(this.rules.other.tableAlignChars, "").split("|"), i = e[3]?.trim() ? e[3].replace(this.rules.other.tableRowBlankLine, "").split(`
5154
5150
  `) : [], s = { type: "table", raw: e[0], header: [], align: [], rows: [] };
5155
5151
  if (n.length === r.length) {
5156
5152
  for (let o of r) this.rules.other.tableAlignRight.test(o) ? s.align.push("right") : this.rules.other.tableAlignCenter.test(o) ? s.align.push("center") : this.rules.other.tableAlignLeft.test(o) ? s.align.push("left") : s.align.push(null);
5157
5153
  for (let o = 0; o < n.length; o++) s.header.push({ text: n[o], tokens: this.lexer.inline(n[o]), header: !0, align: s.align[o] });
5158
- for (let o of i) s.rows.push(mr(o, s.header.length).map((l, a) => ({ text: l, tokens: this.lexer.inline(l), header: !1, align: s.align[a] })));
5154
+ for (let o of i) s.rows.push(xr(o, s.header.length).map((l, a) => ({ text: l, tokens: this.lexer.inline(l), header: !1, align: s.align[a] })));
5159
5155
  return s;
5160
5156
  }
5161
5157
  }
@@ -5192,10 +5188,10 @@ ${d}` : d;
5192
5188
  let n = e[2].trim();
5193
5189
  if (!this.options.pedantic && this.rules.other.startAngleBracket.test(n)) {
5194
5190
  if (!this.rules.other.endAngleBracket.test(n)) return;
5195
- let s = Le(n.slice(0, -1), "\\");
5191
+ let s = Oe(n.slice(0, -1), "\\");
5196
5192
  if ((n.length - s.length) % 2 === 0) return;
5197
5193
  } else {
5198
- let s = vl(e[2], "()");
5194
+ let s = _l(e[2], "()");
5199
5195
  if (s === -2) return;
5200
5196
  if (s > -1) {
5201
5197
  let o = (e[0].indexOf("!") === 0 ? 5 : 4) + e[1].length + s;
@@ -5207,7 +5203,7 @@ ${d}` : d;
5207
5203
  let s = this.rules.other.pedanticHrefTitle.exec(r);
5208
5204
  s && (r = s[1], i = s[3]);
5209
5205
  } else i = e[3] ? e[3].slice(1, -1) : "";
5210
- 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)), xr(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);
5206
+ 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)), br(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);
5211
5207
  }
5212
5208
  }
5213
5209
  reflink(t, e) {
@@ -5218,7 +5214,7 @@ ${d}` : d;
5218
5214
  let s = n[0].charAt(0);
5219
5215
  return { type: "text", raw: s, text: s };
5220
5216
  }
5221
- return xr(n, i, n[0], this.lexer, this.rules);
5217
+ return br(n, i, n[0], this.lexer, this.rules);
5222
5218
  }
5223
5219
  }
5224
5220
  emStrong(t, e, n = "") {
@@ -5303,7 +5299,7 @@ ${d}` : d;
5303
5299
  return { type: "text", raw: e[0], text: e[0], escaped: n };
5304
5300
  }
5305
5301
  }
5306
- }, N = class tn {
5302
+ }, N = class nn {
5307
5303
  tokens;
5308
5304
  options;
5309
5305
  state;
@@ -5311,17 +5307,17 @@ ${d}` : d;
5311
5307
  tokenizer;
5312
5308
  constructor(e) {
5313
5309
  this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = e || me, this.options.tokenizer = this.options.tokenizer || new bt(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = { inLink: !1, inRawBlock: !1, top: !0 };
5314
- let n = { other: $, block: lt.normal, inline: Oe.normal };
5315
- this.options.pedantic ? (n.block = lt.pedantic, n.inline = Oe.pedantic) : this.options.gfm && (n.block = lt.gfm, this.options.breaks ? n.inline = Oe.breaks : n.inline = Oe.gfm), this.tokenizer.rules = n;
5310
+ let n = { other: $, block: at.normal, inline: Me.normal };
5311
+ this.options.pedantic ? (n.block = at.pedantic, n.inline = Me.pedantic) : this.options.gfm && (n.block = at.gfm, this.options.breaks ? n.inline = Me.breaks : n.inline = Me.gfm), this.tokenizer.rules = n;
5316
5312
  }
5317
5313
  static get rules() {
5318
- return { block: lt, inline: Oe };
5314
+ return { block: at, inline: Me };
5319
5315
  }
5320
5316
  static lex(e, n) {
5321
- return new tn(n).lex(e);
5317
+ return new nn(n).lex(e);
5322
5318
  }
5323
5319
  static lexInline(e, n) {
5324
- return new tn(n).inlineTokens(e);
5320
+ return new nn(n).inlineTokens(e);
5325
5321
  }
5326
5322
  lex(e) {
5327
5323
  e = e.replace($.carriageReturn, `
@@ -5611,7 +5607,7 @@ ${t}</tr>
5611
5607
  return `<del>${this.parser.parseInline(t)}</del>`;
5612
5608
  }
5613
5609
  link({ href: t, title: e, tokens: n }) {
5614
- let r = this.parser.parseInline(n), i = gr(t);
5610
+ let r = this.parser.parseInline(n), i = mr(t);
5615
5611
  if (i === null) return r;
5616
5612
  t = i;
5617
5613
  let s = '<a href="' + t + '"';
@@ -5619,7 +5615,7 @@ ${t}</tr>
5619
5615
  }
5620
5616
  image({ href: t, title: e, text: n, tokens: r }) {
5621
5617
  r && (n = this.parser.parseInline(r, this.parser.textRenderer));
5622
- let i = gr(t);
5618
+ let i = mr(t);
5623
5619
  if (i === null) return Z(n);
5624
5620
  t = i;
5625
5621
  let s = `<img src="${t}" alt="${Z(n)}"`;
@@ -5628,7 +5624,7 @@ ${t}</tr>
5628
5624
  text(t) {
5629
5625
  return "tokens" in t && t.tokens ? this.parser.parseInline(t.tokens) : "escaped" in t && t.escaped ? t.text : Z(t.text);
5630
5626
  }
5631
- }, Rn = class {
5627
+ }, Tn = class {
5632
5628
  strong({ text: t }) {
5633
5629
  return t;
5634
5630
  }
@@ -5659,18 +5655,18 @@ ${t}</tr>
5659
5655
  checkbox({ raw: t }) {
5660
5656
  return t;
5661
5657
  }
5662
- }, z = class nn {
5658
+ }, z = class rn {
5663
5659
  options;
5664
5660
  renderer;
5665
5661
  textRenderer;
5666
5662
  constructor(e) {
5667
- this.options = e || me, this.options.renderer = this.options.renderer || new yt(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new Rn();
5663
+ this.options = e || me, this.options.renderer = this.options.renderer || new yt(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new Tn();
5668
5664
  }
5669
5665
  static parse(e, n) {
5670
- return new nn(n).parse(e);
5666
+ return new rn(n).parse(e);
5671
5667
  }
5672
5668
  static parseInline(e, n) {
5673
- return new nn(n).parseInline(e);
5669
+ return new rn(n).parseInline(e);
5674
5670
  }
5675
5671
  parse(e) {
5676
5672
  this.renderer.parser = this;
@@ -5810,7 +5806,7 @@ ${t}</tr>
5810
5806
  }
5811
5807
  return r;
5812
5808
  }
5813
- }, Ve = class {
5809
+ }, Qe = class {
5814
5810
  options;
5815
5811
  block;
5816
5812
  constructor(t) {
@@ -5836,17 +5832,17 @@ ${t}</tr>
5836
5832
  provideParser() {
5837
5833
  return this.block ? z.parse : z.parseInline;
5838
5834
  }
5839
- }, wl = class {
5840
- defaults = yn();
5835
+ }, jl = class {
5836
+ defaults = vn();
5841
5837
  options = this.setOptions;
5842
5838
  parse = this.parseMarkdown(!0);
5843
5839
  parseInline = this.parseMarkdown(!1);
5844
5840
  Parser = z;
5845
5841
  Renderer = yt;
5846
- TextRenderer = Rn;
5842
+ TextRenderer = Tn;
5847
5843
  Lexer = N;
5848
5844
  Tokenizer = bt;
5849
- Hooks = Ve;
5845
+ Hooks = Qe;
5850
5846
  constructor(...t) {
5851
5847
  this.use(...t);
5852
5848
  }
@@ -5920,13 +5916,13 @@ ${t}</tr>
5920
5916
  r.tokenizer = i;
5921
5917
  }
5922
5918
  if (n.hooks) {
5923
- let i = this.defaults.hooks || new Ve();
5919
+ let i = this.defaults.hooks || new Qe();
5924
5920
  for (let s in n.hooks) {
5925
5921
  if (!(s in i)) throw new Error(`hook '${s}' does not exist`);
5926
5922
  if (["options", "block"].includes(s)) continue;
5927
5923
  let o = s, l = n.hooks[o], a = i[o];
5928
- Ve.passThroughHooks.has(s) ? i[o] = (u) => {
5929
- if (this.defaults.async && Ve.passThroughHooksRespectAsync.has(s)) return (async () => {
5924
+ Qe.passThroughHooks.has(s) ? i[o] = (u) => {
5925
+ if (this.defaults.async && Qe.passThroughHooksRespectAsync.has(s)) return (async () => {
5930
5926
  let c = await l.call(i, u);
5931
5927
  return a.call(i, c);
5932
5928
  })();
@@ -5996,17 +5992,17 @@ Please report this to https://github.com/markedjs/marked.`, t) {
5996
5992
  throw n;
5997
5993
  };
5998
5994
  }
5999
- }, fe = new wl();
5995
+ }, fe = new jl();
6000
5996
  function y(t, e) {
6001
5997
  return fe.parse(t, e);
6002
5998
  }
6003
5999
  y.options = y.setOptions = function(t) {
6004
- return fe.setOptions(t), y.defaults = fe.defaults, ji(y.defaults), y;
6000
+ return fe.setOptions(t), y.defaults = fe.defaults, Si(y.defaults), y;
6005
6001
  };
6006
- y.getDefaults = yn;
6002
+ y.getDefaults = vn;
6007
6003
  y.defaults = me;
6008
6004
  y.use = function(...t) {
6009
- return fe.use(...t), y.defaults = fe.defaults, ji(y.defaults), y;
6005
+ return fe.use(...t), y.defaults = fe.defaults, Si(y.defaults), y;
6010
6006
  };
6011
6007
  y.walkTokens = function(t, e) {
6012
6008
  return fe.walkTokens(t, e);
@@ -6015,11 +6011,11 @@ y.parseInline = fe.parseInline;
6015
6011
  y.Parser = z;
6016
6012
  y.parser = z.parse;
6017
6013
  y.Renderer = yt;
6018
- y.TextRenderer = Rn;
6014
+ y.TextRenderer = Tn;
6019
6015
  y.Lexer = N;
6020
6016
  y.lexer = N.lex;
6021
6017
  y.Tokenizer = bt;
6022
- y.Hooks = Ve;
6018
+ y.Hooks = Qe;
6023
6019
  y.parse = y;
6024
6020
  y.options;
6025
6021
  y.setOptions;
@@ -6032,7 +6028,7 @@ y.setOptions({
6032
6028
  breaks: !0,
6033
6029
  gfm: !0
6034
6030
  });
6035
- function jl({ text: t }) {
6031
+ function Sl({ text: t }) {
6036
6032
  const e = D(() => {
6037
6033
  if (!t)
6038
6034
  return "";
@@ -6041,30 +6037,30 @@ function jl({ text: t }) {
6041
6037
  }, [t]);
6042
6038
  return /* @__PURE__ */ h("div", { class: "jex-md", dangerouslySetInnerHTML: { __html: e } });
6043
6039
  }
6044
- function Sl(t) {
6040
+ function Cl(t) {
6045
6041
  const e = t.trim().split(/\s+/).filter(Boolean);
6046
6042
  return e.length === 0 ? "?" : e.map((n) => n[0]).join("").slice(0, 2).toUpperCase();
6047
6043
  }
6048
6044
  function ye({ text: t, streaming: e, error: n, authorId: r, authorName: i, authorImage: s, botAvatarUrl: o }) {
6049
- const l = !!r, [a, u] = T(!1), d = He(() => u(!0), []), c = [
6045
+ const l = !!r, [a, u] = T(!1), d = We(() => u(!0), []), c = [
6050
6046
  "jex-message bot",
6051
6047
  n ? "jex-message-error" : ""
6052
6048
  ].filter(Boolean).join(" ");
6053
6049
  return /* @__PURE__ */ h("div", { class: "jex-message-row bot", children: [
6054
- /* @__PURE__ */ h("div", { class: `jex-avatar ${l ? "jex-avatar-agent" : "jex-avatar-bot"}`, children: l && s && !a ? /* @__PURE__ */ h("img", { src: s, alt: i ?? "", class: "jex-avatar-img", onError: d }) : l ? /* @__PURE__ */ h("span", { class: "jex-avatar-initials", children: Sl(i ?? "") }) : o && !a ? /* @__PURE__ */ h("img", { src: o, alt: "", class: "jex-avatar-img", onError: d }) : /* @__PURE__ */ h(bn, { size: 14 }) }),
6050
+ /* @__PURE__ */ h("div", { class: `jex-avatar ${l ? "jex-avatar-agent" : "jex-avatar-bot"}`, children: l && s && !a ? /* @__PURE__ */ h("img", { src: s, alt: i ?? "", class: "jex-avatar-img", onError: d }) : l ? /* @__PURE__ */ h("span", { class: "jex-avatar-initials", children: Cl(i ?? "") }) : o && !a ? /* @__PURE__ */ h("img", { src: o, alt: "", class: "jex-avatar-img", onError: d }) : /* @__PURE__ */ h(yn, { size: 14 }) }),
6055
6051
  /* @__PURE__ */ h("div", { class: "jex-message-content", children: [
6056
6052
  /* @__PURE__ */ h("div", { class: c, children: [
6057
- /* @__PURE__ */ h(jl, { text: t }),
6053
+ /* @__PURE__ */ h(Sl, { text: t }),
6058
6054
  e && /* @__PURE__ */ h("span", { class: "jex-streaming-cursor" })
6059
6055
  ] }),
6060
6056
  l && i && /* @__PURE__ */ h("span", { class: "jex-message-author", children: i })
6061
6057
  ] })
6062
6058
  ] });
6063
6059
  }
6064
- function Cl({ text: t }) {
6060
+ function Rl({ text: t }) {
6065
6061
  return /* @__PURE__ */ h("div", { class: "jex-message user", children: t });
6066
6062
  }
6067
- function Rl({ message: t, sessionId: e, visitorId: n }) {
6063
+ function Tl({ message: t, sessionId: e, visitorId: n }) {
6068
6064
  const r = P();
6069
6065
  return t.formData ? /* @__PURE__ */ h("div", { class: "jex-inline-form-submitted", children: [
6070
6066
  /* @__PURE__ */ h("span", { class: "jex-inline-form-check", children: "✓" }),
@@ -6077,7 +6073,7 @@ function Rl({ message: t, sessionId: e, visitorId: n }) {
6077
6073
  ] })
6078
6074
  ] })
6079
6075
  ] }) : /* @__PURE__ */ h("div", { class: "jex-message-row bot", children: /* @__PURE__ */ h(
6080
- Tl,
6076
+ Al,
6081
6077
  {
6082
6078
  messageId: t._id,
6083
6079
  sessionId: e,
@@ -6085,8 +6081,8 @@ function Rl({ message: t, sessionId: e, visitorId: n }) {
6085
6081
  }
6086
6082
  ) });
6087
6083
  }
6088
- function Tl({ messageId: t, sessionId: e, visitorId: n }) {
6089
- const r = P(), [i, s] = T(""), [o, l] = T(""), [a, u] = T(!1), d = wt(Ie.functions.chat.public.helpdesk.submitEscalation);
6084
+ function Al({ messageId: t, sessionId: e, visitorId: n }) {
6085
+ const r = P(), [i, s] = T(""), [o, l] = T(""), [a, u] = T(!1), d = wt(Ae.functions.chat.public.helpdesk.submitEscalation);
6090
6086
  async function c(f) {
6091
6087
  if (f.preventDefault(), !a) {
6092
6088
  u(!0);
@@ -6141,14 +6137,14 @@ function Tl({ messageId: t, sessionId: e, visitorId: n }) {
6141
6137
  /* @__PURE__ */ h("div", { class: "jex-inline-form-consent", children: r.escalationConsent })
6142
6138
  ] });
6143
6139
  }
6144
- function Al() {
6140
+ function Il() {
6145
6141
  return /* @__PURE__ */ h("div", { class: "jex-typing", children: [
6146
6142
  /* @__PURE__ */ h("span", {}),
6147
6143
  /* @__PURE__ */ h("span", {}),
6148
6144
  /* @__PURE__ */ h("span", {})
6149
6145
  ] });
6150
6146
  }
6151
- function Il({ conversations: t, greeting: e, sessionNotFound: n, resumeFailed: r, onStartFresh: i, sessionId: s, visitorId: o }) {
6147
+ function $l({ conversations: t, greeting: e, sessionNotFound: n, resumeFailed: r, onStartFresh: i, sessionId: s, visitorId: o }) {
6152
6148
  const l = P(), a = vt(null), [u, d] = T(null);
6153
6149
  return F(() => {
6154
6150
  a.current?.scrollIntoView({ behavior: "smooth" });
@@ -6172,7 +6168,7 @@ function Il({ conversations: t, greeting: e, sessionNotFound: n, resumeFailed: r
6172
6168
  if (c.contentType === "human-notice")
6173
6169
  return /* @__PURE__ */ h(ye, { text: c.content }, c._id);
6174
6170
  if (c.contentType === "escalation-form" && s && o)
6175
- return Ca.value === "screen" && !c.formData ? u === c._id ? null : /* @__PURE__ */ h("div", { class: "jex-inline-form jex-inline-form-card", children: [
6171
+ return Ra.value === "screen" && !c.formData ? u === c._id ? null : /* @__PURE__ */ h("div", { class: "jex-inline-form jex-inline-form-card", children: [
6176
6172
  /* @__PURE__ */ h("div", { class: "jex-inline-form-title", children: l.escalationPromptTitle }),
6177
6173
  /* @__PURE__ */ h("div", { class: "jex-inline-form-subtitle", children: l.escalationPromptSubtitle }),
6178
6174
  /* @__PURE__ */ h(
@@ -6181,7 +6177,7 @@ function Il({ conversations: t, greeting: e, sessionNotFound: n, resumeFailed: r
6181
6177
  class: "jex-form-submit",
6182
6178
  type: "button",
6183
6179
  onClick: () => {
6184
- je({ id: "escalation-form", formMessageId: c._id, sessionId: s, visitorId: o });
6180
+ we({ id: "escalation-form", formMessageId: c._id, sessionId: s, visitorId: o });
6185
6181
  },
6186
6182
  children: l.escalationPromptSubmit
6187
6183
  }
@@ -6197,17 +6193,17 @@ function Il({ conversations: t, greeting: e, sessionNotFound: n, resumeFailed: r
6197
6193
  children: l.escalationSkip
6198
6194
  }
6199
6195
  )
6200
- ] }, c._id) : /* @__PURE__ */ h(Rl, { message: c, sessionId: s, visitorId: o }, c._id);
6196
+ ] }, c._id) : /* @__PURE__ */ h(Tl, { message: c, sessionId: s, visitorId: o }, c._id);
6201
6197
  if (c.contentType === "escalation-confirm")
6202
6198
  return /* @__PURE__ */ h(ye, { text: c.content }, c._id);
6203
6199
  if (c.role === "user")
6204
- return /* @__PURE__ */ h(Cl, { text: c.content }, c._id);
6200
+ return /* @__PURE__ */ h(Rl, { text: c.content }, c._id);
6205
6201
  const f = {
6206
6202
  authorId: c.authorId,
6207
6203
  authorName: c.authorName,
6208
6204
  authorImage: c.authorImage
6209
6205
  };
6210
- return c.status === "streaming" && c.content === "" ? /* @__PURE__ */ h(Al, {}, c._id) : c.status === "streaming" ? /* @__PURE__ */ h(ye, { text: c.content, streaming: !0, ...f }, c._id) : c.status === "error" ? /* @__PURE__ */ h(
6206
+ return c.status === "streaming" && c.content === "" ? /* @__PURE__ */ h(Il, {}, c._id) : c.status === "streaming" ? /* @__PURE__ */ h(ye, { text: c.content, streaming: !0, ...f }, c._id) : c.status === "error" ? /* @__PURE__ */ h(
6211
6207
  ye,
6212
6208
  {
6213
6209
  text: c.errorMessage ?? `${l.somethingWentWrong}. ${l.tryAgain}.`,
@@ -6220,14 +6216,14 @@ function Il({ conversations: t, greeting: e, sessionNotFound: n, resumeFailed: r
6220
6216
  /* @__PURE__ */ h("div", { ref: a })
6221
6217
  ] });
6222
6218
  }
6223
- function $l({ size: t = 18 }) {
6219
+ function ql({ size: t = 18 }) {
6224
6220
  return /* @__PURE__ */ h("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: [
6225
6221
  /* @__PURE__ */ h("path", { d: "M22 2 11 13" }),
6226
6222
  /* @__PURE__ */ h("path", { d: "M22 2 15 22 11 13 2 9l20-7z" })
6227
6223
  ] });
6228
6224
  }
6229
- function ql({ sessionId: t, visitorId: e, isLoading: n, isStreaming: r, sessionStatus: i, ensureSession: s, onStartFresh: o }) {
6230
- const l = P(), a = ke(""), u = wt(Ie.functions.chat.public.conversations.send), d = n || r;
6225
+ function El({ sessionId: t, visitorId: e, isLoading: n, isStreaming: r, sessionStatus: i, ensureSession: s, onStartFresh: o }) {
6226
+ const l = P(), a = ke(""), u = wt(Ae.functions.chat.public.conversations.send), d = n || r;
6231
6227
  if (i === "resolved")
6232
6228
  return /* @__PURE__ */ h("div", { class: "jex-chat-input-resolved", children: [
6233
6229
  /* @__PURE__ */ h("div", { class: "jex-resolved-notice", children: l.sessionResolved }),
@@ -6248,7 +6244,7 @@ function ql({ sessionId: t, visitorId: e, isLoading: n, isStreaming: r, sessionS
6248
6244
  if (!f || d)
6249
6245
  return;
6250
6246
  const p = t && e ? { sessionId: t, visitorId: e } : await s();
6251
- p && (ja(), a.value = "", u({
6247
+ p && (Sa(), a.value = "", u({
6252
6248
  sessionId: p.sessionId,
6253
6249
  visitorId: p.visitorId,
6254
6250
  content: f
@@ -6280,30 +6276,30 @@ function ql({ sessionId: t, visitorId: e, isLoading: n, isStreaming: r, sessionS
6280
6276
  onClick: c,
6281
6277
  "aria-label": l.sendAriaLabel,
6282
6278
  disabled: d,
6283
- children: /* @__PURE__ */ h($l, { size: 18 })
6279
+ children: /* @__PURE__ */ h(ql, { size: 18 })
6284
6280
  }
6285
6281
  )
6286
6282
  ] });
6287
6283
  }
6288
- function Pi({ message: t }) {
6284
+ function Mi({ message: t }) {
6289
6285
  return /* @__PURE__ */ h("div", { class: "jex-overlay jex-loading", children: [
6290
6286
  /* @__PURE__ */ h("div", { class: "jex-loading-spinner", "aria-hidden": "true" }),
6291
6287
  t && /* @__PURE__ */ h("p", { class: "jex-loading-message", children: t })
6292
6288
  ] });
6293
6289
  }
6294
- function El({ greeting: t, orgSlug: e }) {
6295
- const n = P(), { sessionId: r, visitorId: i, isLoading: s, sessionNotFound: o, resumeFailed: l, isOrgDeleted: a, ensureSession: u, startFresh: d } = Oa(e), c = lr(
6296
- Ie.functions.chat.public.conversations.listBySession,
6290
+ function Pl({ greeting: t, orgSlug: e }) {
6291
+ const n = P(), { sessionId: r, visitorId: i, isLoading: s, sessionNotFound: o, resumeFailed: l, isOrgDeleted: a, ensureSession: u, startFresh: d } = La(e), c = cr(
6292
+ Ae.functions.chat.public.conversations.listBySession,
6297
6293
  r && i ? { sessionId: r, visitorId: i } : "skip"
6298
- ), f = lr(
6299
- Ie.functions.chat.public.sessions.getSessionStatus,
6294
+ ), f = cr(
6295
+ Ae.functions.chat.public.sessions.getSessionStatus,
6300
6296
  r && i ? { sessionId: r, visitorId: i } : "skip"
6301
6297
  ), p = r !== null && c === void 0, g = c?.some((k) => k.status === "streaming") ?? !1;
6302
6298
  return F(() => {
6303
6299
  pe.value && !r && u();
6304
- }, [u, r]), a ? /* @__PURE__ */ h("div", { class: "jex-chat-messages", children: /* @__PURE__ */ h("div", { class: "jex-session-notice", children: n.chatNoLongerAvailable }) }) : s || p && pe.value ? /* @__PURE__ */ h(Pi, { message: n.resumeConversation }) : /* @__PURE__ */ h(B, { children: [
6300
+ }, [u, r]), a ? /* @__PURE__ */ h("div", { class: "jex-chat-messages", children: /* @__PURE__ */ h("div", { class: "jex-session-notice", children: n.chatNoLongerAvailable }) }) : s || p && pe.value ? /* @__PURE__ */ h(Mi, { message: n.resumeConversation }) : /* @__PURE__ */ h(B, { children: [
6305
6301
  /* @__PURE__ */ h(
6306
- Il,
6302
+ $l,
6307
6303
  {
6308
6304
  conversations: c,
6309
6305
  greeting: t,
@@ -6315,7 +6311,7 @@ function El({ greeting: t, orgSlug: e }) {
6315
6311
  }
6316
6312
  ),
6317
6313
  /* @__PURE__ */ h(
6318
- ql,
6314
+ El,
6319
6315
  {
6320
6316
  sessionId: r,
6321
6317
  visitorId: i,
@@ -6328,10 +6324,10 @@ function El({ greeting: t, orgSlug: e }) {
6328
6324
  )
6329
6325
  ] });
6330
6326
  }
6331
- function Pl({ formMessageId: t, sessionId: e, visitorId: n }) {
6332
- const r = P(), [i, s] = T(""), [o, l] = T(""), a = wt(Ie.functions.chat.public.helpdesk.submitEscalation);
6327
+ function Ml({ formMessageId: t, sessionId: e, visitorId: n }) {
6328
+ const r = P(), [i, s] = T(""), [o, l] = T(""), a = wt(Ae.functions.chat.public.helpdesk.submitEscalation);
6333
6329
  async function u(d) {
6334
- d.preventDefault(), Se({ id: "loading", message: r.escalationSubmitting });
6330
+ d.preventDefault(), je({ id: "loading", message: r.escalationSubmitting });
6335
6331
  try {
6336
6332
  const c = await a({
6337
6333
  sessionId: e,
@@ -6340,9 +6336,9 @@ function Pl({ formMessageId: t, sessionId: e, visitorId: n }) {
6340
6336
  visitorName: i.trim(),
6341
6337
  visitorEmail: o.trim()
6342
6338
  });
6343
- Se({ id: "confirmation", ref: c.ticketRef });
6339
+ je({ id: "confirmation", ref: c.ticketRef });
6344
6340
  } catch (c) {
6345
- console.error("[EscalationFormScreen] Submit failed:", c), Se({ id: "error", message: r.escalationSubmitFailed });
6341
+ console.error("[EscalationFormScreen] Submit failed:", c), je({ id: "error", message: r.escalationSubmitFailed });
6346
6342
  }
6347
6343
  }
6348
6344
  return /* @__PURE__ */ h("div", { class: "jex-form-screen", children: [
@@ -6381,18 +6377,18 @@ function Pl({ formMessageId: t, sessionId: e, visitorId: n }) {
6381
6377
  ] }),
6382
6378
  /* @__PURE__ */ h("div", { class: "jex-inline-form-consent", style: { textAlign: "center", margin: "16px 0 8px 0" }, children: r.escalationConsent }),
6383
6379
  /* @__PURE__ */ h("button", { class: "jex-escalation-skip", type: "button", onClick: () => {
6384
- xn();
6380
+ bn();
6385
6381
  }, children: r.escalationSkip })
6386
6382
  ] });
6387
6383
  }
6388
- function Ml() {
6384
+ function Ol() {
6389
6385
  const t = P(), [e, n] = T(""), [r, i] = T(""), [s, o] = T("");
6390
6386
  async function l(a) {
6391
- a.preventDefault(), Se({ id: "loading", message: t.submittingTicket }), await new Promise((d) => {
6387
+ a.preventDefault(), je({ id: "loading", message: t.submittingTicket }), await new Promise((d) => {
6392
6388
  setTimeout(d, 1200);
6393
6389
  });
6394
6390
  const u = "JEX-" + Math.random().toString(36).slice(2, 8).toUpperCase();
6395
- Se({ id: "confirmation", ref: u });
6391
+ je({ id: "confirmation", ref: u });
6396
6392
  }
6397
6393
  return /* @__PURE__ */ h("div", { class: "jex-form-screen", children: [
6398
6394
  /* @__PURE__ */ h("h2", { class: "jex-form-title", children: t.submitTicket }),
@@ -6441,7 +6437,7 @@ function Ml() {
6441
6437
  ] })
6442
6438
  ] });
6443
6439
  }
6444
- function Ol({ ticketRef: t }) {
6440
+ function Ll({ ticketRef: t }) {
6445
6441
  const e = P();
6446
6442
  return /* @__PURE__ */ h("div", { class: "jex-confirmation", children: [
6447
6443
  /* @__PURE__ */ h("div", { class: "jex-confirmation-icon", "aria-hidden": "true", children: "✓" }),
@@ -6461,7 +6457,7 @@ function Ol({ ticketRef: t }) {
6461
6457
  )
6462
6458
  ] });
6463
6459
  }
6464
- function Ll({ message: t, onRetry: e, onBack: n }) {
6460
+ function Nl({ message: t, onRetry: e, onBack: n }) {
6465
6461
  const r = P();
6466
6462
  return /* @__PURE__ */ h("div", { class: "jex-overlay jex-error", children: [
6467
6463
  /* @__PURE__ */ h("p", { class: "jex-error-message", children: t }),
@@ -6471,45 +6467,45 @@ function Ll({ message: t, onRetry: e, onBack: n }) {
6471
6467
  ] })
6472
6468
  ] });
6473
6469
  }
6474
- function br({ greeting: t, title: e, orgSlug: n }) {
6470
+ function yr({ greeting: t, title: e, orgSlug: n }) {
6475
6471
  const r = V.value, i = r[r.length - 1], s = r.findLast(
6476
6472
  (o) => o.id === "confirmation"
6477
6473
  );
6478
6474
  return /* @__PURE__ */ h("div", { class: "jex-screen-container", children: [
6479
- i.id === "home" && /* @__PURE__ */ h(Ea, { greeting: t, title: e }),
6480
- i.id === "selection" && /* @__PURE__ */ h(Pa, { title: e }),
6481
- i.id === "form" && /* @__PURE__ */ h(Ml, {}),
6475
+ i.id === "home" && /* @__PURE__ */ h(Pa, { greeting: t, title: e }),
6476
+ i.id === "selection" && /* @__PURE__ */ h(Ma, { title: e }),
6477
+ i.id === "form" && /* @__PURE__ */ h(Ol, {}),
6482
6478
  i.id === "escalation-form" && /* @__PURE__ */ h(
6483
- Pl,
6479
+ Ml,
6484
6480
  {
6485
6481
  formMessageId: i.formMessageId,
6486
6482
  sessionId: i.sessionId,
6487
6483
  visitorId: i.visitorId
6488
6484
  }
6489
6485
  ),
6490
- i.id === "confirmation" && s && /* @__PURE__ */ h(Ol, { ticketRef: s.ref }),
6491
- i.id === "chat" && /* @__PURE__ */ h(El, { greeting: t, orgSlug: n }),
6492
- i.id === "loading" && /* @__PURE__ */ h(Pi, { message: i.message }),
6486
+ i.id === "confirmation" && s && /* @__PURE__ */ h(Ll, { ticketRef: s.ref }),
6487
+ i.id === "chat" && /* @__PURE__ */ h(Pl, { greeting: t, orgSlug: n }),
6488
+ i.id === "loading" && /* @__PURE__ */ h(Mi, { message: i.message }),
6493
6489
  i.id === "error" && /* @__PURE__ */ h(
6494
- Ll,
6490
+ Nl,
6495
6491
  {
6496
6492
  message: i.message,
6497
- onRetry: () => Se({ id: "loading" }),
6498
- onBack: xn
6493
+ onRetry: () => je({ id: "loading" }),
6494
+ onBack: bn
6499
6495
  }
6500
6496
  )
6501
6497
  ] });
6502
6498
  }
6503
- function Nl({ options: t }) {
6504
- const e = fa(t.orgSlug, t.convexUrl);
6505
- va(t.parentOrigin), F(() => {
6506
- ka();
6499
+ function zl({ options: t }) {
6500
+ const e = ga(t.orgSlug, t.convexUrl);
6501
+ _a(t.parentOrigin), F(() => {
6502
+ wa();
6507
6503
  }, []);
6508
- const n = da(t, e);
6504
+ const n = pa(t, e);
6509
6505
  F(() => {
6510
- gn.value = _i(n.locale);
6506
+ mn.value = ki(n.locale);
6511
6507
  }, [n.locale]);
6512
- const r = n.position === "bottom-left", i = n.colorScheme === "dark" || n.colorScheme === "light" ? n.colorScheme : "", s = Sa({
6508
+ const r = n.position === "bottom-left", i = n.colorScheme === "dark" || n.colorScheme === "light" ? n.colorScheme : "", s = Ca({
6513
6509
  ...t,
6514
6510
  primaryColor: n.primaryColor,
6515
6511
  accentColor: n.accentColor,
@@ -6525,17 +6521,17 @@ function Nl({ options: t }) {
6525
6521
  class: `jex-widget ${i}`.trim(),
6526
6522
  style: l,
6527
6523
  children: o ? /* @__PURE__ */ h("div", { class: "jex-embedded", children: [
6528
- /* @__PURE__ */ h(ur, { title: n.title }),
6529
- /* @__PURE__ */ h(br, { greeting: n.greeting, title: n.title, orgSlug: t.orgSlug }),
6530
- !n.hideBranding && /* @__PURE__ */ h(hr, {})
6524
+ /* @__PURE__ */ h(hr, { title: n.title }),
6525
+ /* @__PURE__ */ h(yr, { greeting: n.greeting, title: n.title, orgSlug: t.orgSlug }),
6526
+ !n.hideBranding && /* @__PURE__ */ h(dr, {})
6531
6527
  ] }) : /* @__PURE__ */ h("div", { class: `jex-container${r ? " jex-pos-left" : ""}`, children: [
6532
6528
  I.value && /* @__PURE__ */ h("div", { class: "jex-chat-window", children: [
6533
- /* @__PURE__ */ h(ur, { title: n.title }),
6534
- /* @__PURE__ */ h(br, { greeting: n.greeting, title: n.title, orgSlug: t.orgSlug }),
6535
- !n.hideBranding && /* @__PURE__ */ h(hr, {})
6529
+ /* @__PURE__ */ h(hr, { title: n.title }),
6530
+ /* @__PURE__ */ h(yr, { greeting: n.greeting, title: n.title, orgSlug: t.orgSlug }),
6531
+ !n.hideBranding && /* @__PURE__ */ h(dr, {})
6536
6532
  ] }),
6537
6533
  /* @__PURE__ */ h(
6538
- qa,
6534
+ Ea,
6539
6535
  {
6540
6536
  iconOption: n.triggerIcon,
6541
6537
  radius: n.triggerRadius,
@@ -6546,34 +6542,34 @@ function Nl({ options: t }) {
6546
6542
  }
6547
6543
  );
6548
6544
  }
6549
- const zl = '.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}@keyframes jexSlideUp{0%{opacity:0;transform:scale(.8) translateY(20px)}to{opacity:1;transform:scale(1) 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-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-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{display:block;font-size:10px;color:var(--jex-text-muted);margin-top:2px;padding-left:4px}.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:16px;border-top:1px solid var(--jex-border-window);display:flex;gap:8px;flex-shrink:0}.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:var(--jex-bg-send-btn);color:var(--jex-text-header);border:none;border-radius:12px;width:40px;height:40px;display:flex;align-items:center;justify-content:center;cursor:pointer;transition:all .2s cubic-bezier(.175,.885,.32,1.275);flex-shrink:0}.jex-send-btn:hover{transform:scale(1.05);background:var(--jex-primary-hover)}.jex-send-btn:active{transform:scale(.95)}.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}.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:13px;font-family:ui-monospace,Cascadia Code,Fira Code,monospace;letter-spacing:.04em;outline:none;transition:border-color .2s}.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}';
6550
- function Ql(t) {
6545
+ const Ql = '.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}@keyframes jexSlideUp{0%{opacity:0;transform:scale(.8) translateY(20px)}to{opacity:1;transform:scale(1) 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-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-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{display:block;font-size:10px;color:var(--jex-text-muted);margin-top:2px;padding-left:4px}.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:16px;border-top:1px solid var(--jex-border-window);display:flex;gap:8px;flex-shrink:0}.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:var(--jex-bg-send-btn);color:var(--jex-text-header);border:none;border-radius:12px;width:40px;height:40px;display:flex;align-items:center;justify-content:center;cursor:pointer;transition:all .2s cubic-bezier(.175,.885,.32,1.275);flex-shrink:0}.jex-send-btn:hover{transform:scale(1.05);background:var(--jex-primary-hover)}.jex-send-btn:active{transform:scale(.95)}.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}.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:13px;font-family:ui-monospace,Cascadia Code,Fira Code,monospace;letter-spacing:.04em;outline:none;transition:border-color .2s}.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}';
6546
+ function Vl(t) {
6551
6547
  const e = document.createElement("style");
6552
- e.textContent = zl, t.appendChild(e);
6548
+ e.textContent = Ql, t.appendChild(e);
6553
6549
  }
6554
- const Vl = "https://festive-mouse-978.eu-west-1.convex.cloud";
6550
+ const Bl = "https://festive-mouse-978.eu-west-1.convex.cloud";
6555
6551
  let Qt = null;
6556
- function Bl(t) {
6557
- const e = t ?? Vl;
6552
+ function Fl(t) {
6553
+ const e = t ?? Bl;
6558
6554
  if (!e)
6559
6555
  throw new Error("[jexity] No Convex URL — set VITE_CONVEX_URL at build time or data-convex-url on the script tag");
6560
- return Qt || (Qt = new Jo(ua(e))), Qt;
6556
+ return Qt || (Qt = new Zo(ha(e))), Qt;
6561
6557
  }
6562
- function Fl(t, e) {
6558
+ function Dl(t, e) {
6563
6559
  const n = t.shadowRoot ?? t.attachShadow({ mode: "open" });
6564
6560
  for (; n.firstChild; )
6565
6561
  n.removeChild(n.firstChild);
6566
- Ql(n), we.value = e.source, V.value = [{ id: "home" }], e.mode === "embedded" && (t.classList.add("jex-mode-embedded"), I.value = !0);
6562
+ Vl(n), mt.value = e.source, Xt.value = e.bootstrapToken, V.value = [{ id: "home" }], e.mode === "embedded" && (t.classList.add("jex-mode-embedded"), I.value = !0);
6567
6563
  const r = document.createElement("div");
6568
6564
  return e.mode === "embedded" && (r.style.cssText = "width:100%;height:100%"), n.appendChild(r), he(
6569
- /* @__PURE__ */ h(Go, { client: Bl(e.convexUrl), children: /* @__PURE__ */ h(Nl, { options: e }) }),
6565
+ /* @__PURE__ */ h(Ko, { client: Fl(e.convexUrl), children: /* @__PURE__ */ h(zl, { options: e }) }),
6570
6566
  r
6571
6567
  ), function() {
6572
- he(null, r), I.value = !1, we.value = void 0, V.value = [{ id: "home" }];
6568
+ he(null, r), I.value = !1, mt.value = void 0, Xt.value = void 0, V.value = [{ id: "home" }];
6573
6569
  };
6574
6570
  }
6575
- function Dl(t, e, n) {
6576
- const r = Fl(t, e), i = /* @__PURE__ */ new Set(), s = I.subscribe((o) => {
6571
+ function Ul(t, e, n) {
6572
+ const r = Dl(t, e), i = /* @__PURE__ */ new Set(), s = I.subscribe((o) => {
6577
6573
  for (const l of i)
6578
6574
  l(o);
6579
6575
  });
@@ -6600,22 +6596,22 @@ function Dl(t, e, n) {
6600
6596
  }
6601
6597
  };
6602
6598
  }
6603
- let Ne = null;
6604
- function Ul(t) {
6605
- Ne && Ne.shutdown();
6599
+ let Le = null;
6600
+ function Wl(t) {
6601
+ Le && Le.shutdown();
6606
6602
  let e;
6607
6603
  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));
6608
- const n = Dl(e, t, () => {
6609
- t.container || e.remove(), Ne === n && (Ne = null);
6604
+ const n = Ul(e, t, () => {
6605
+ t.container || e.remove(), Le === n && (Le = null);
6610
6606
  });
6611
- return Ne = n, n;
6607
+ return Le = n, n;
6612
6608
  }
6613
- const Wl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
6609
+ const Hl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
6614
6610
  __proto__: null,
6615
- JexityChat: Ul
6611
+ JexityChat: Wl
6616
6612
  }, Symbol.toStringTag, { value: "Module" }));
6617
6613
  export {
6618
- Jl as JexityChatProvider,
6619
- Zl as useJexityChat
6614
+ Zl as JexityChatProvider,
6615
+ Gl as useJexityChat
6620
6616
  };
6621
6617
  //# sourceMappingURL=react.mjs.map