@usereq/widget 1.0.0-experimental.1 → 1.0.0-experimental.2
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/README.md +12 -8
- package/dist/embed.js +5 -5
- package/dist/embed.js.map +1 -1
- package/dist/embed.mjs +683 -673
- package/dist/embed.mjs.map +1 -1
- package/package.json +1 -1
package/dist/embed.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
async function
|
|
1
|
+
async function tn(e) {
|
|
2
2
|
const t = e.getReader(), n = new TextDecoder();
|
|
3
3
|
let r = "", o = "";
|
|
4
4
|
const i = [], a = /* @__PURE__ */ new Map(), u = (d) => {
|
|
@@ -47,42 +47,42 @@ async function en(e) {
|
|
|
47
47
|
})
|
|
48
48
|
};
|
|
49
49
|
}
|
|
50
|
-
function
|
|
50
|
+
function re(e) {
|
|
51
51
|
"@babel/helpers - typeof";
|
|
52
|
-
return
|
|
52
|
+
return re = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(t) {
|
|
53
53
|
return typeof t;
|
|
54
54
|
} : function(t) {
|
|
55
55
|
return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
|
|
56
|
-
},
|
|
56
|
+
}, re(e);
|
|
57
57
|
}
|
|
58
|
-
function
|
|
59
|
-
if (
|
|
58
|
+
function nn(e, t) {
|
|
59
|
+
if (re(e) != "object" || !e) return e;
|
|
60
60
|
var n = e[Symbol.toPrimitive];
|
|
61
61
|
if (n !== void 0) {
|
|
62
62
|
var r = n.call(e, t || "default");
|
|
63
|
-
if (
|
|
63
|
+
if (re(r) != "object") return r;
|
|
64
64
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
65
65
|
}
|
|
66
66
|
return (t === "string" ? String : Number)(e);
|
|
67
67
|
}
|
|
68
|
-
function
|
|
69
|
-
var t =
|
|
70
|
-
return
|
|
68
|
+
function rn(e) {
|
|
69
|
+
var t = nn(e, "string");
|
|
70
|
+
return re(t) == "symbol" ? t : t + "";
|
|
71
71
|
}
|
|
72
|
-
function
|
|
73
|
-
return (t =
|
|
72
|
+
function je(e, t, n) {
|
|
73
|
+
return (t = rn(t)) in e ? Object.defineProperty(e, t, {
|
|
74
74
|
value: n,
|
|
75
75
|
enumerable: !0,
|
|
76
76
|
configurable: !0,
|
|
77
77
|
writable: !0
|
|
78
78
|
}) : e[t] = n, e;
|
|
79
79
|
}
|
|
80
|
-
var
|
|
80
|
+
var V = class extends Error {
|
|
81
81
|
constructor(e, t, n) {
|
|
82
|
-
super(n),
|
|
82
|
+
super(n), je(this, "status", void 0), je(this, "code", void 0), this.status = e, this.code = t;
|
|
83
83
|
}
|
|
84
84
|
};
|
|
85
|
-
async function
|
|
85
|
+
async function se(e) {
|
|
86
86
|
let t = "request_failed", n = `The request failed (${e.status}).`;
|
|
87
87
|
try {
|
|
88
88
|
var r, o;
|
|
@@ -90,9 +90,9 @@ async function oe(e) {
|
|
|
90
90
|
!((r = i.error) === null || r === void 0) && r.code && (t = i.error.code), !((o = i.error) === null || o === void 0) && o.message && (n = i.error.message);
|
|
91
91
|
} catch {
|
|
92
92
|
}
|
|
93
|
-
throw new
|
|
93
|
+
throw new V(e.status, t, n);
|
|
94
94
|
}
|
|
95
|
-
var
|
|
95
|
+
var Le = (e, t = {}) => ({
|
|
96
96
|
method: "POST",
|
|
97
97
|
headers: {
|
|
98
98
|
"Content-Type": "application/json",
|
|
@@ -100,29 +100,29 @@ var We = (e, t = {}) => ({
|
|
|
100
100
|
},
|
|
101
101
|
body: JSON.stringify(e)
|
|
102
102
|
});
|
|
103
|
-
async function
|
|
103
|
+
async function on(e, t, n) {
|
|
104
104
|
const r = await fetch(`${e.base}/api/embed/${t}/${n}`);
|
|
105
|
-
return r.ok ? r.json() :
|
|
105
|
+
return r.ok ? r.json() : se(r);
|
|
106
106
|
}
|
|
107
|
-
async function on(e, t) {
|
|
108
|
-
const n = await fetch(`${e.base}/api/embed/sessions`, We(t));
|
|
109
|
-
return n.ok ? n.json() : oe(n);
|
|
110
|
-
}
|
|
111
|
-
var Le = (e) => ({ Authorization: `Bearer ${e}` });
|
|
112
107
|
async function sn(e, t) {
|
|
113
|
-
const n = await fetch(`${e.base}/api/embed/sessions
|
|
114
|
-
return n.ok ? n.json() :
|
|
108
|
+
const n = await fetch(`${e.base}/api/embed/sessions`, Le(t));
|
|
109
|
+
return n.ok ? n.json() : se(n);
|
|
115
110
|
}
|
|
111
|
+
var Ne = (e) => ({ Authorization: `Bearer ${e}` });
|
|
116
112
|
async function an(e, t) {
|
|
113
|
+
const n = await fetch(`${e.base}/api/embed/sessions/current`, { headers: Ne(t) });
|
|
114
|
+
return n.ok ? n.json() : se(n);
|
|
115
|
+
}
|
|
116
|
+
async function ln(e, t) {
|
|
117
117
|
const n = await fetch(`${e.base}/api/embed/sessions/current/end`, {
|
|
118
118
|
method: "POST",
|
|
119
|
-
headers:
|
|
119
|
+
headers: Ne(t)
|
|
120
120
|
});
|
|
121
|
-
return n.ok ? n.json() :
|
|
121
|
+
return n.ok ? n.json() : se(n);
|
|
122
122
|
}
|
|
123
|
-
async function
|
|
123
|
+
async function cn(e, t, n, r, o) {
|
|
124
124
|
const i = await fetch(`${e.base}/api/embed/chat`, {
|
|
125
|
-
...
|
|
125
|
+
...Le({
|
|
126
126
|
message: {
|
|
127
127
|
id: n.id,
|
|
128
128
|
role: "user",
|
|
@@ -132,15 +132,15 @@ async function ln(e, t, n, r, o) {
|
|
|
132
132
|
}]
|
|
133
133
|
},
|
|
134
134
|
trigger: r
|
|
135
|
-
},
|
|
135
|
+
}, Ne(t)),
|
|
136
136
|
signal: o
|
|
137
137
|
});
|
|
138
|
-
return !i.ok || !i.body ?
|
|
138
|
+
return !i.ok || !i.body ? se(i) : tn(i.body);
|
|
139
139
|
}
|
|
140
|
-
async function
|
|
140
|
+
async function un(e, t) {
|
|
141
141
|
try {
|
|
142
142
|
const n = await fetch(`${e.base}/api/embed/events`, {
|
|
143
|
-
...
|
|
143
|
+
...Le(t),
|
|
144
144
|
keepalive: !0
|
|
145
145
|
});
|
|
146
146
|
return n.ok ? await n.json() : null;
|
|
@@ -148,31 +148,31 @@ async function cn(e, t) {
|
|
|
148
148
|
return null;
|
|
149
149
|
}
|
|
150
150
|
}
|
|
151
|
-
var
|
|
152
|
-
function
|
|
153
|
-
return
|
|
151
|
+
var X = (e) => typeof e == "object" && e !== null;
|
|
152
|
+
function xt(e) {
|
|
153
|
+
return X(e) && typeof e.id == "string" && X(e.config) && typeof e.config.type == "string" && X(e.config.appearance) && Array.isArray(e.rules);
|
|
154
154
|
}
|
|
155
|
-
function
|
|
156
|
-
return
|
|
155
|
+
function dn(e) {
|
|
156
|
+
return X(e) && typeof e.id == "string" && typeof e.mode == "string" && X(e.config) && Array.isArray(e.members) && e.members.every((t) => X(t) && xt(t.widget)) && Array.isArray(e.rules);
|
|
157
157
|
}
|
|
158
|
-
function
|
|
159
|
-
return !
|
|
158
|
+
function fn(e, t) {
|
|
159
|
+
return !X(e) || e.kind !== t ? null : t === "widget" && xt(e.payload) || t === "group" && dn(e.payload) ? e : null;
|
|
160
160
|
}
|
|
161
|
-
var
|
|
161
|
+
var Se, I, wt, pn, U, tt, St, kt, Me, pe, te, $t, Oe, Be, De, hn, me = {}, be = [], _n = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i, ke = Array.isArray;
|
|
162
162
|
function L(e, t) {
|
|
163
163
|
for (var n in t) e[n] = t[n];
|
|
164
164
|
return e;
|
|
165
165
|
}
|
|
166
|
-
function
|
|
166
|
+
function Ue(e) {
|
|
167
167
|
e && e.parentNode && e.parentNode.removeChild(e);
|
|
168
168
|
}
|
|
169
|
-
function
|
|
169
|
+
function gn(e, t, n) {
|
|
170
170
|
var r, o, i, a = {};
|
|
171
171
|
for (i in t) i == "key" ? r = t[i] : i == "ref" ? o = t[i] : a[i] = t[i];
|
|
172
|
-
if (arguments.length > 2 && (a.children = arguments.length > 3 ?
|
|
173
|
-
return
|
|
172
|
+
if (arguments.length > 2 && (a.children = arguments.length > 3 ? Se.call(arguments, 2) : n), typeof e == "function" && e.defaultProps != null) for (i in e.defaultProps) a[i] === void 0 && (a[i] = e.defaultProps[i]);
|
|
173
|
+
return he(e, a, r, o, null);
|
|
174
174
|
}
|
|
175
|
-
function
|
|
175
|
+
function he(e, t, n, r, o) {
|
|
176
176
|
var i = {
|
|
177
177
|
type: e,
|
|
178
178
|
props: t,
|
|
@@ -184,68 +184,68 @@ function pe(e, t, n, r, o) {
|
|
|
184
184
|
__e: null,
|
|
185
185
|
__c: null,
|
|
186
186
|
constructor: void 0,
|
|
187
|
-
__v: o == null ? ++
|
|
187
|
+
__v: o == null ? ++wt : o,
|
|
188
188
|
__i: -1,
|
|
189
189
|
__u: 0
|
|
190
190
|
};
|
|
191
|
-
return o == null &&
|
|
191
|
+
return o == null && I.vnode != null && I.vnode(i), i;
|
|
192
192
|
}
|
|
193
|
-
function
|
|
193
|
+
function Y(e) {
|
|
194
194
|
return e.children;
|
|
195
195
|
}
|
|
196
|
-
function
|
|
196
|
+
function _e(e, t) {
|
|
197
197
|
this.props = e, this.context = t;
|
|
198
198
|
}
|
|
199
|
-
function
|
|
200
|
-
if (t == null) return e.__ ?
|
|
199
|
+
function Z(e, t) {
|
|
200
|
+
if (t == null) return e.__ ? Z(e.__, e.__i + 1) : null;
|
|
201
201
|
for (var n; t < e.__k.length; t++) if ((n = e.__k[t]) != null && n.__e != null) return n.__e;
|
|
202
|
-
return typeof e.type == "function" ?
|
|
202
|
+
return typeof e.type == "function" ? Z(e) : null;
|
|
203
203
|
}
|
|
204
|
-
function
|
|
204
|
+
function mn(e) {
|
|
205
205
|
if (e.__P && e.__d) {
|
|
206
206
|
var t = e.__v, n = t.__e, r = [], o = [], i = L({}, t);
|
|
207
|
-
i.__v = t.__v + 1,
|
|
207
|
+
i.__v = t.__v + 1, I.vnode && I.vnode(i), Ye(e.__P, i, t, e.__n, e.__P.namespaceURI, 32 & t.__u ? [n] : null, r, n == null ? Z(t) : n, !!(32 & t.__u), o), i.__v = t.__v, i.__.__k[i.__i] = i, Mt(r, i, o), t.__e = t.__ = null, i.__e != n && Ct(i);
|
|
208
208
|
}
|
|
209
209
|
}
|
|
210
|
-
function
|
|
210
|
+
function Ct(e) {
|
|
211
211
|
if ((e = e.__) != null && e.__c != null) return e.__e = e.__c.base = null, e.__k.some(function(t) {
|
|
212
212
|
if (t != null && t.__e != null) return e.__e = e.__c.base = t.__e;
|
|
213
|
-
}),
|
|
213
|
+
}), Ct(e);
|
|
214
214
|
}
|
|
215
|
-
function
|
|
216
|
-
(!e.__d && (e.__d = !0) &&
|
|
215
|
+
function nt(e) {
|
|
216
|
+
(!e.__d && (e.__d = !0) && U.push(e) && !ve.__r++ || tt != I.debounceRendering) && ((tt = I.debounceRendering) || St)(ve);
|
|
217
217
|
}
|
|
218
|
-
function
|
|
218
|
+
function ve() {
|
|
219
219
|
try {
|
|
220
|
-
for (var e, t = 1;
|
|
220
|
+
for (var e, t = 1; U.length; ) U.length > t && U.sort(kt), e = U.shift(), t = U.length, mn(e);
|
|
221
221
|
} finally {
|
|
222
|
-
|
|
222
|
+
U.length = ve.__r = 0;
|
|
223
223
|
}
|
|
224
224
|
}
|
|
225
|
-
function
|
|
226
|
-
var h, l, p, m, x,
|
|
227
|
-
for (d =
|
|
225
|
+
function qt(e, t, n, r, o, i, a, u, d, c, f) {
|
|
226
|
+
var h, l, p, m, x, b, _ = r && r.__k || be, g = t.length;
|
|
227
|
+
for (d = bn(n, t, _, d, g), h = 0; h < g; h++) (p = n.__k[h]) != null && (l = p.__i != -1 && _[p.__i] || me, p.__i = h, b = Ye(e, p, l, o, i, a, u, d, c, f), m = p.__e, p.ref && l.ref != p.ref && (l.ref && Ge(l.ref, null, p), f.push(p.ref, p.__c || m, p)), x == null && m != null && (x = m), 4 & p.__u ? (d = It(p, d, e), l.__e && (l.__e = null)) : typeof p.type == "function" && b !== void 0 ? d = b : m && (d = m.nextSibling), p.__u &= -7);
|
|
228
228
|
return n.__e = x, d;
|
|
229
229
|
}
|
|
230
|
-
function
|
|
230
|
+
function bn(e, t, n, r, o) {
|
|
231
231
|
var i, a, u, d, c, f = n.length, h = f, l = 0;
|
|
232
|
-
for (e.__k = new Array(o), i = 0; i < o; i++) (a = t[i]) != null && typeof a != "boolean" && typeof a != "function" ? (typeof a == "string" || typeof a == "number" || typeof a == "bigint" || a.constructor == String ? a = e.__k[i] =
|
|
233
|
-
if (h) for (i = 0; i < f; i++) (u = n[i]) != null && (2 & u.__u) == 0 && (u.__e == r && (r =
|
|
232
|
+
for (e.__k = new Array(o), i = 0; i < o; i++) (a = t[i]) != null && typeof a != "boolean" && typeof a != "function" ? (typeof a == "string" || typeof a == "number" || typeof a == "bigint" || a.constructor == String ? a = e.__k[i] = he(null, a, null, null, null) : ke(a) ? a = e.__k[i] = he(Y, { children: a }, null, null, null) : a.constructor === void 0 && a.__b > 0 ? a = e.__k[i] = he(a.type, a.props, a.key, a.ref ? a.ref : null, a.__v) : e.__k[i] = a, d = i + l, a.__ = e, a.__b = e.__b + 1, u = null, (c = a.__i = vn(a, n, d, h)) != -1 && (h--, (u = n[c]) && (u.__u |= 2)), u == null || u.__v == null ? (c == -1 && (o > f ? l-- : o < f && l++), typeof a.type != "function" && (a.__u |= 4)) : c != d && (c == d - 1 ? l-- : c == d + 1 ? l++ : (c > d ? l-- : l++, a.__u |= 4))) : e.__k[i] = null;
|
|
233
|
+
if (h) for (i = 0; i < f; i++) (u = n[i]) != null && (2 & u.__u) == 0 && (u.__e == r && (r = Z(u)), At(u, u));
|
|
234
234
|
return r;
|
|
235
235
|
}
|
|
236
|
-
function
|
|
236
|
+
function It(e, t, n) {
|
|
237
237
|
var r, o;
|
|
238
238
|
if (typeof e.type == "function") {
|
|
239
|
-
for (r = e.__k, o = 0; r && o < r.length; o++) r[o] && (r[o].__ = e, t =
|
|
239
|
+
for (r = e.__k, o = 0; r && o < r.length; o++) r[o] && (r[o].__ = e, t = It(r[o], t, n));
|
|
240
240
|
return t;
|
|
241
241
|
}
|
|
242
|
-
e.__e != t && (t && e.type && !t.parentNode && (t =
|
|
242
|
+
e.__e != t && (t && e.type && !t.parentNode && (t = Z(e)), t = n.insertBefore(e.__e, t || null));
|
|
243
243
|
do
|
|
244
244
|
t = t && t.nextSibling;
|
|
245
245
|
while (t != null && t.nodeType == 8);
|
|
246
246
|
return t;
|
|
247
247
|
}
|
|
248
|
-
function
|
|
248
|
+
function vn(e, t, n, r) {
|
|
249
249
|
var o, i, a, u = e.key, d = e.type, c = t[n], f = c != null && (2 & c.__u) == 0;
|
|
250
250
|
if (c === null && u == null || f && u == c.key && d == c.type) return n;
|
|
251
251
|
if (r > (f ? 1 : 0)) {
|
|
@@ -253,17 +253,17 @@ function bn(e, t, n, r) {
|
|
|
253
253
|
}
|
|
254
254
|
return -1;
|
|
255
255
|
}
|
|
256
|
-
function
|
|
257
|
-
t[0] == "-" ? e.setProperty(t, n == null ? "" : n) : e[t] = n == null ? "" : typeof n != "number" ||
|
|
256
|
+
function rt(e, t, n) {
|
|
257
|
+
t[0] == "-" ? e.setProperty(t, n == null ? "" : n) : e[t] = n == null ? "" : typeof n != "number" || _n.test(t) ? n : n + "px";
|
|
258
258
|
}
|
|
259
|
-
function
|
|
259
|
+
function ue(e, t, n, r, o) {
|
|
260
260
|
var i, a;
|
|
261
261
|
e: if (t == "style") if (typeof n == "string") e.style.cssText = n;
|
|
262
262
|
else {
|
|
263
|
-
if (typeof r == "string" && (e.style.cssText = r = ""), r) for (t in r) n && t in n ||
|
|
264
|
-
if (n) for (t in n) r && n[t] == r[t] ||
|
|
263
|
+
if (typeof r == "string" && (e.style.cssText = r = ""), r) for (t in r) n && t in n || rt(e.style, t, "");
|
|
264
|
+
if (n) for (t in n) r && n[t] == r[t] || rt(e.style, t, n[t]);
|
|
265
265
|
}
|
|
266
|
-
else if (t[0] == "o" && t[1] == "n") i = t != (t = t.replace(
|
|
266
|
+
else if (t[0] == "o" && t[1] == "n") i = t != (t = t.replace($t, "$1")), a = t.toLowerCase(), t = a in e || t == "onFocusOut" || t == "onFocusIn" ? a.slice(2) : t.slice(2), e.l || (e.l = {}), e.l[t + i] = n, n ? r ? n[te] = r[te] : (n[te] = Oe, e.addEventListener(t, i ? De : Be, i)) : e.removeEventListener(t, i ? De : Be, i);
|
|
267
267
|
else {
|
|
268
268
|
if (o == "http://www.w3.org/2000/svg") t = t.replace(/xlink(H|:h)/, "h").replace(/sName$/, "s");
|
|
269
269
|
else if (t != "width" && t != "height" && t != "href" && t != "list" && t != "form" && t != "tabIndex" && t != "download" && t != "rowSpan" && t != "colSpan" && t != "role" && t != "popover" && t in e) try {
|
|
@@ -274,72 +274,72 @@ function ce(e, t, n, r, o) {
|
|
|
274
274
|
typeof n == "function" || (n == null || n === !1 && t[4] != "-" ? e.removeAttribute(t) : e.setAttribute(t, t == "popover" && n == 1 ? "" : n));
|
|
275
275
|
}
|
|
276
276
|
}
|
|
277
|
-
function
|
|
277
|
+
function it(e) {
|
|
278
278
|
return function(t) {
|
|
279
279
|
if (this.l) {
|
|
280
280
|
var n = this.l[t.type + e];
|
|
281
|
-
if (t[
|
|
282
|
-
else if (t[
|
|
283
|
-
return n(
|
|
281
|
+
if (t[pe] == null) t[pe] = Oe++;
|
|
282
|
+
else if (t[pe] < n[te]) return;
|
|
283
|
+
return n(I.event ? I.event(t) : t);
|
|
284
284
|
}
|
|
285
285
|
};
|
|
286
286
|
}
|
|
287
287
|
function Ye(e, t, n, r, o, i, a, u, d, c) {
|
|
288
|
-
var f, h, l, p, m, x,
|
|
288
|
+
var f, h, l, p, m, x, b, _, g, y, $, q, z, S, C, w, T = t.type;
|
|
289
289
|
if (t.constructor !== void 0) return null;
|
|
290
|
-
128 & n.__u && (d = !!(32 & n.__u), i = [u = t.__e = n.__e]), (f =
|
|
290
|
+
128 & n.__u && (d = !!(32 & n.__u), i = [u = t.__e = n.__e]), (f = I.__b) && f(t);
|
|
291
291
|
e: if (typeof T == "function") {
|
|
292
292
|
h = a.length;
|
|
293
293
|
try {
|
|
294
|
-
if (g = t.props, y = T.prototype && T.prototype.render, $ = (f = T.contextType) && r[f.__c],
|
|
294
|
+
if (g = t.props, y = T.prototype && T.prototype.render, $ = (f = T.contextType) && r[f.__c], q = f ? $ ? $.props.value : f.__ : r, n.__c ? _ = (l = t.__c = n.__c).__ = l.__E : (y ? t.__c = l = new T(g, q) : (t.__c = l = new _e(g, q), l.constructor = T, l.render = xn), $ && $.sub(l), l.state || (l.state = {}), l.__n = r, p = l.__d = !0, l.__h = [], l._sb = []), y && l.__s == null && (l.__s = l.state), y && T.getDerivedStateFromProps != null && (l.__s == l.state && (l.__s = L({}, l.__s)), L(l.__s, T.getDerivedStateFromProps(g, l.__s))), m = l.props, x = l.state, l.__v = t, p) y && T.getDerivedStateFromProps == null && l.componentWillMount != null && l.componentWillMount(), y && l.componentDidMount != null && l.__h.push(l.componentDidMount);
|
|
295
295
|
else {
|
|
296
|
-
if (y && T.getDerivedStateFromProps == null && g !== m && l.componentWillReceiveProps != null && l.componentWillReceiveProps(g,
|
|
296
|
+
if (y && T.getDerivedStateFromProps == null && g !== m && l.componentWillReceiveProps != null && l.componentWillReceiveProps(g, q), t.__v == n.__v || !l.__e && l.shouldComponentUpdate != null && l.shouldComponentUpdate(g, l.__s, q) === !1) {
|
|
297
297
|
t.__v != n.__v && (l.props = g, l.state = l.__s, l.__d = !1), t.__e = n.__e, t.__k = n.__k, t.__k.some(function(M) {
|
|
298
298
|
M && (M.__ = t);
|
|
299
|
-
}),
|
|
299
|
+
}), be.push.apply(l.__h, l._sb), l._sb = [], l.__h.length && a.push(l), u = Z(n);
|
|
300
300
|
break e;
|
|
301
301
|
}
|
|
302
|
-
l.componentWillUpdate != null && l.componentWillUpdate(g, l.__s,
|
|
303
|
-
l.componentDidUpdate(m, x,
|
|
302
|
+
l.componentWillUpdate != null && l.componentWillUpdate(g, l.__s, q), y && l.componentDidUpdate != null && l.__h.push(function() {
|
|
303
|
+
l.componentDidUpdate(m, x, b);
|
|
304
304
|
});
|
|
305
305
|
}
|
|
306
|
-
if (l.context =
|
|
306
|
+
if (l.context = q, l.props = g, l.__P = e, l.__e = !1, z = I.__r, S = 0, y) l.state = l.__s, l.__d = !1, z && z(t), f = l.render(l.props, l.state, l.context), be.push.apply(l.__h, l._sb), l._sb = [];
|
|
307
307
|
else do
|
|
308
|
-
l.__d = !1,
|
|
309
|
-
while (l.__d && ++
|
|
310
|
-
l.state = l.__s, l.getChildContext != null && (r = L(L({}, r), l.getChildContext())), y && !p && l.getSnapshotBeforeUpdate != null && (
|
|
308
|
+
l.__d = !1, z && z(t), f = l.render(l.props, l.state, l.context), l.state = l.__s;
|
|
309
|
+
while (l.__d && ++S < 25);
|
|
310
|
+
l.state = l.__s, l.getChildContext != null && (r = L(L({}, r), l.getChildContext())), y && !p && l.getSnapshotBeforeUpdate != null && (b = l.getSnapshotBeforeUpdate(m, x)), C = f != null && f.type === Y && f.key == null ? zt(f.props.children) : f, u = qt(e, ke(C) ? C : [C], t, n, r, o, i, a, u, d, c), l.base = t.__e, t.__u &= -161, l.__h.length && a.push(l), _ && (l.__E = l.__ = null);
|
|
311
311
|
} catch (M) {
|
|
312
312
|
if (a.length = h, t.__v = null, d || i != null) {
|
|
313
313
|
if (M.then) {
|
|
314
314
|
for (t.__u |= d ? 160 : 128; u && u.nodeType == 8 && u.nextSibling; ) u = u.nextSibling;
|
|
315
315
|
i != null && (i[i.indexOf(u)] = null), t.__e = u;
|
|
316
|
-
} else if (i != null) for (
|
|
316
|
+
} else if (i != null) for (w = i.length; w--; ) Ue(i[w]);
|
|
317
317
|
} else t.__e = n.__e;
|
|
318
|
-
t.__k == null && (t.__k = n.__k || []), M.then ||
|
|
318
|
+
t.__k == null && (t.__k = n.__k || []), M.then || Tt(t), I.__e(M, t, n);
|
|
319
319
|
}
|
|
320
|
-
} else i == null && t.__v == n.__v ? (t.__k = n.__k, t.__e = n.__e) : u = t.__e =
|
|
321
|
-
return (f =
|
|
320
|
+
} else i == null && t.__v == n.__v ? (t.__k = n.__k, t.__e = n.__e) : u = t.__e = yn(n.__e, t, n, r, o, i, a, d, c);
|
|
321
|
+
return (f = I.diffed) && f(t), 128 & t.__u ? void 0 : u;
|
|
322
322
|
}
|
|
323
|
-
function
|
|
324
|
-
e && (e.__c && (e.__c.__e = !0), e.__k && e.__k.some(
|
|
323
|
+
function Tt(e) {
|
|
324
|
+
e && (e.__c && (e.__c.__e = !0), e.__k && e.__k.some(Tt));
|
|
325
325
|
}
|
|
326
|
-
function
|
|
327
|
-
for (var r = 0; r < n.length; r++)
|
|
328
|
-
|
|
326
|
+
function Mt(e, t, n) {
|
|
327
|
+
for (var r = 0; r < n.length; r++) Ge(n[r], n[++r], n[++r]);
|
|
328
|
+
I.__c && I.__c(t, e), e.some(function(o) {
|
|
329
329
|
try {
|
|
330
330
|
e = o.__h, o.__h = [], e.some(function(i) {
|
|
331
331
|
i.call(o);
|
|
332
332
|
});
|
|
333
333
|
} catch (i) {
|
|
334
|
-
|
|
334
|
+
I.__e(i, o.__v);
|
|
335
335
|
}
|
|
336
336
|
});
|
|
337
337
|
}
|
|
338
|
-
function
|
|
339
|
-
return typeof e != "object" || e == null || e.__b > 0 ? e :
|
|
338
|
+
function zt(e) {
|
|
339
|
+
return typeof e != "object" || e == null || e.__b > 0 ? e : ke(e) ? e.map(zt) : e.constructor !== void 0 ? null : L({}, e);
|
|
340
340
|
}
|
|
341
|
-
function
|
|
342
|
-
var c, f, h, l, p, m, x,
|
|
341
|
+
function yn(e, t, n, r, o, i, a, u, d) {
|
|
342
|
+
var c, f, h, l, p, m, x, b = n.props || me, _ = t.props, g = t.type;
|
|
343
343
|
if (g == "svg" ? o = "http://www.w3.org/2000/svg" : g == "math" ? o = "http://www.w3.org/1998/Math/MathML" : o || (o = "http://www.w3.org/1999/xhtml"), i != null) {
|
|
344
344
|
for (c = 0; c < i.length; c++) if ((p = i[c]) && "setAttribute" in p == !!g && (g ? p.localName == g : p.nodeType == 3)) {
|
|
345
345
|
e = p, i[c] = null;
|
|
@@ -348,84 +348,84 @@ function vn(e, t, n, r, o, i, a, u, d) {
|
|
|
348
348
|
}
|
|
349
349
|
if (e == null) {
|
|
350
350
|
if (g == null) return document.createTextNode(_);
|
|
351
|
-
e = document.createElementNS(o, g, _.is && _), u && (
|
|
351
|
+
e = document.createElementNS(o, g, _.is && _), u && (I.__m && I.__m(t, i), u = !1), i = null;
|
|
352
352
|
}
|
|
353
|
-
if (g == null)
|
|
353
|
+
if (g == null) b === _ || u && e.data == _ || (e.data = _);
|
|
354
354
|
else {
|
|
355
|
-
if (i = g == "textarea" && _.defaultValue != null ? null : i &&
|
|
356
|
-
for (c in
|
|
357
|
-
for (c in _) p = _[c], c == "children" ? l = p : c == "dangerouslySetInnerHTML" ? f = p : c == "value" ? m = p : c == "checked" ? x = p : u && typeof p != "function" ||
|
|
355
|
+
if (i = g == "textarea" && _.defaultValue != null ? null : i && Se.call(e.childNodes), !u && i != null) for (b = {}, c = 0; c < e.attributes.length; c++) b[(p = e.attributes[c]).name] = p.value;
|
|
356
|
+
for (c in b) p = b[c], c == "dangerouslySetInnerHTML" ? h = p : c == "children" || c in _ || c == "value" && "defaultValue" in _ || c == "checked" && "defaultChecked" in _ || ue(e, c, null, p, o);
|
|
357
|
+
for (c in _) p = _[c], c == "children" ? l = p : c == "dangerouslySetInnerHTML" ? f = p : c == "value" ? m = p : c == "checked" ? x = p : u && typeof p != "function" || b[c] === p || ue(e, c, p, b[c], o);
|
|
358
358
|
if (f) u || h && (f.__html == h.__html || f.__html == e.innerHTML) || (e.innerHTML = f.__html), t.__k = [];
|
|
359
|
-
else if (h && (e.innerHTML = ""),
|
|
360
|
-
u && g != "textarea" || (c = "value", g == "progress" && m == null ? e.removeAttribute("value") : m != null && (m !== e[c] || g == "progress" && !m || g == "option" && m !=
|
|
359
|
+
else if (h && (e.innerHTML = ""), qt(t.type == "template" ? e.content : e, ke(l) ? l : [l], t, n, r, g == "foreignObject" ? "http://www.w3.org/1999/xhtml" : o, i, a, i ? i[0] : n.__k && Z(n, 0), u, d), i != null) for (c = i.length; c--; ) Ue(i[c]);
|
|
360
|
+
u && g != "textarea" || (c = "value", g == "progress" && m == null ? e.removeAttribute("value") : m != null && (m !== e[c] || g == "progress" && !m || g == "option" && m != b[c]) && ue(e, c, m, b[c], o), c = "checked", x != null && x != e[c] && ue(e, c, x, b[c], o));
|
|
361
361
|
}
|
|
362
362
|
return e;
|
|
363
363
|
}
|
|
364
|
-
function
|
|
364
|
+
function Ge(e, t, n) {
|
|
365
365
|
try {
|
|
366
366
|
if (typeof e == "function") {
|
|
367
367
|
var r = typeof e.__u == "function";
|
|
368
368
|
r && e.__u(), r && t == null || (e.__u = e(t));
|
|
369
369
|
} else e.current = t;
|
|
370
370
|
} catch (o) {
|
|
371
|
-
|
|
371
|
+
I.__e(o, n);
|
|
372
372
|
}
|
|
373
373
|
}
|
|
374
374
|
function At(e, t, n) {
|
|
375
375
|
var r, o;
|
|
376
|
-
if (
|
|
376
|
+
if (I.unmount && I.unmount(e), (r = e.ref) && (r.current && r.current != e.__e || Ge(r, null, t)), (r = e.__c) != null) {
|
|
377
377
|
if (r.componentWillUnmount) try {
|
|
378
378
|
r.componentWillUnmount();
|
|
379
379
|
} catch (i) {
|
|
380
|
-
|
|
380
|
+
I.__e(i, t);
|
|
381
381
|
}
|
|
382
382
|
r.base = r.__P = r.__n = null;
|
|
383
383
|
}
|
|
384
384
|
if (r = e.__k) for (o = 0; o < r.length; o++) r[o] && At(r[o], t, n || typeof e.type != "function");
|
|
385
|
-
n ||
|
|
385
|
+
n || Ue(e.__e), e.__c = e.__ = e.__e = void 0;
|
|
386
386
|
}
|
|
387
|
-
function
|
|
387
|
+
function xn(e, t, n) {
|
|
388
388
|
return this.constructor(e, n);
|
|
389
389
|
}
|
|
390
|
-
function
|
|
390
|
+
function ot(e, t, n) {
|
|
391
391
|
var r, o, i, a;
|
|
392
|
-
t == document && (t = document.documentElement),
|
|
392
|
+
t == document && (t = document.documentElement), I.__ && I.__(e, t), o = (r = typeof n == "function") ? null : n && n.__k || t.__k, i = [], a = [], Ye(t, e = (!r && n || t).__k = gn(Y, null, [e]), o || me, me, t.namespaceURI, !r && n ? [n] : o ? null : t.firstChild ? Se.call(t.childNodes) : null, i, !r && n ? n : o ? o.__e : t.firstChild, r, a), Mt(i, e, a), e.props.children = null;
|
|
393
393
|
}
|
|
394
|
-
|
|
394
|
+
Se = be.slice, I = { __e: function(e, t, n, r) {
|
|
395
395
|
for (var o, i, a; t = t.__; ) if ((o = t.__c) && !o.__) try {
|
|
396
396
|
if ((i = o.constructor) && i.getDerivedStateFromError != null && (o.setState(i.getDerivedStateFromError(e)), a = o.__d), o.componentDidCatch != null && (o.componentDidCatch(e, r || {}), a = o.__d), a) return o.__E = o;
|
|
397
397
|
} catch (u) {
|
|
398
398
|
e = u;
|
|
399
399
|
}
|
|
400
400
|
throw e;
|
|
401
|
-
} },
|
|
401
|
+
} }, wt = 0, pn = function(e) {
|
|
402
402
|
return e != null && e.constructor === void 0;
|
|
403
|
-
},
|
|
403
|
+
}, _e.prototype.setState = function(e, t) {
|
|
404
404
|
var n = this.__s != null && this.__s != this.state ? this.__s : this.__s = L({}, this.state);
|
|
405
|
-
typeof e == "function" && (e = e(L({}, n), this.props)), e && L(n, e), e != null && this.__v && (t && this._sb.push(t),
|
|
406
|
-
},
|
|
407
|
-
this.__v && (this.__e = !0, e && this.__h.push(e),
|
|
408
|
-
},
|
|
405
|
+
typeof e == "function" && (e = e(L({}, n), this.props)), e && L(n, e), e != null && this.__v && (t && this._sb.push(t), nt(this));
|
|
406
|
+
}, _e.prototype.forceUpdate = function(e) {
|
|
407
|
+
this.__v && (this.__e = !0, e && this.__h.push(e), nt(this));
|
|
408
|
+
}, _e.prototype.render = Y, U = [], St = typeof Promise == "function" ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, kt = function(e, t) {
|
|
409
409
|
return e.__v.__b - t.__v.__b;
|
|
410
|
-
},
|
|
411
|
-
var
|
|
412
|
-
function
|
|
413
|
-
|
|
414
|
-
var n =
|
|
410
|
+
}, ve.__r = 0, Me = Math.random().toString(8), pe = "__d" + Me, te = "__a" + Me, $t = /(PointerCapture)$|Capture$/i, Oe = 0, Be = it(!1), De = it(!0), hn = 0;
|
|
411
|
+
var ie, H, ze, st, oe = 0, Ht = [], R = I, at = R.__b, lt = R.__r, ct = R.diffed, ut = R.__c, dt = R.unmount, ft = R.__;
|
|
412
|
+
function Ke(e, t) {
|
|
413
|
+
R.__h && R.__h(H, e, oe || t), oe = 0;
|
|
414
|
+
var n = H.__H || (H.__H = {
|
|
415
415
|
__: [],
|
|
416
416
|
__h: []
|
|
417
417
|
});
|
|
418
418
|
return e >= n.__.length && n.__.push({}), n.__[e];
|
|
419
419
|
}
|
|
420
420
|
function E(e) {
|
|
421
|
-
return
|
|
421
|
+
return oe = 1, wn(Et, e);
|
|
422
422
|
}
|
|
423
|
-
function
|
|
424
|
-
var r =
|
|
425
|
-
if (r.t = e, !r.__c && (r.__ = [n ? n(t) :
|
|
423
|
+
function wn(e, t, n) {
|
|
424
|
+
var r = Ke(ie++, 2);
|
|
425
|
+
if (r.t = e, !r.__c && (r.__ = [n ? n(t) : Et(void 0, t), function(u) {
|
|
426
426
|
var d = r.__N ? r.__N[0] : r.__[0], c = r.t(d, u);
|
|
427
427
|
d !== c && (r.__N = [c, r.__[1]], r.__c.setState({}));
|
|
428
|
-
}], r.__c =
|
|
428
|
+
}], r.__c = H, !H.__f)) {
|
|
429
429
|
var o = function(u, d, c) {
|
|
430
430
|
if (!r.__c.__H) return !0;
|
|
431
431
|
var f = !1, h = r.__c.props !== u;
|
|
@@ -441,109 +441,109 @@ function xn(e, t, n) {
|
|
|
441
441
|
}
|
|
442
442
|
return !f || h;
|
|
443
443
|
};
|
|
444
|
-
|
|
445
|
-
var i =
|
|
446
|
-
|
|
444
|
+
H.__f = !0;
|
|
445
|
+
var i = H.shouldComponentUpdate, a = H.componentWillUpdate;
|
|
446
|
+
H.componentWillUpdate = function(u, d, c) {
|
|
447
447
|
if (this.__e) {
|
|
448
448
|
var f = i;
|
|
449
449
|
i = void 0, o(u, d, c), i = f;
|
|
450
450
|
}
|
|
451
451
|
a && a.call(this, u, d, c);
|
|
452
|
-
},
|
|
452
|
+
}, H.shouldComponentUpdate = o;
|
|
453
453
|
}
|
|
454
454
|
return r.__N || r.__;
|
|
455
455
|
}
|
|
456
456
|
function P(e, t) {
|
|
457
|
-
var n =
|
|
458
|
-
!
|
|
457
|
+
var n = Ke(ie++, 3);
|
|
458
|
+
!R.__s && Rt(n.__H, t) && (n.__ = e, n.u = t, H.__H.__h.push(n));
|
|
459
459
|
}
|
|
460
460
|
function D(e) {
|
|
461
|
-
return
|
|
461
|
+
return oe = 5, ye(function() {
|
|
462
462
|
return { current: e };
|
|
463
463
|
}, []);
|
|
464
464
|
}
|
|
465
|
-
function
|
|
466
|
-
var n =
|
|
465
|
+
function ye(e, t) {
|
|
466
|
+
var n = Ke(ie++, 7);
|
|
467
467
|
return Rt(n.__H, t) && (n.__ = e(), n.__H = t, n.__h = e), n.__;
|
|
468
468
|
}
|
|
469
469
|
function O(e, t) {
|
|
470
|
-
return
|
|
470
|
+
return oe = 8, ye(function() {
|
|
471
471
|
return e;
|
|
472
472
|
}, t);
|
|
473
473
|
}
|
|
474
|
-
function
|
|
475
|
-
for (var e; e =
|
|
474
|
+
function Sn() {
|
|
475
|
+
for (var e; e = Ht.shift(); ) {
|
|
476
476
|
var t = e.__H;
|
|
477
477
|
if (e.__P && t) try {
|
|
478
|
-
t.__h.some(
|
|
478
|
+
t.__h.some(ge), t.__h.some(We), t.__h = [];
|
|
479
479
|
} catch (n) {
|
|
480
|
-
t.__h = [],
|
|
480
|
+
t.__h = [], R.__e(n, e.__v);
|
|
481
481
|
}
|
|
482
482
|
}
|
|
483
483
|
}
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
},
|
|
487
|
-
e && t.__k && t.__k.__m && (e.__m = t.__k.__m),
|
|
488
|
-
},
|
|
489
|
-
|
|
490
|
-
var t = (
|
|
491
|
-
t && (
|
|
484
|
+
R.__b = function(e) {
|
|
485
|
+
H = null, at && at(e);
|
|
486
|
+
}, R.__ = function(e, t) {
|
|
487
|
+
e && t.__k && t.__k.__m && (e.__m = t.__k.__m), ft && ft(e, t);
|
|
488
|
+
}, R.__r = function(e) {
|
|
489
|
+
lt && lt(e), ie = 0;
|
|
490
|
+
var t = (H = e.__c).__H;
|
|
491
|
+
t && (ze === H ? (t.__h = [], H.__h = [], t.__.some(function(n) {
|
|
492
492
|
n.__N && (n.__ = n.__N), n.u = n.__N = void 0;
|
|
493
|
-
})) : (t.__h.some(
|
|
494
|
-
},
|
|
495
|
-
|
|
493
|
+
})) : (t.__h.some(ge), t.__h.some(We), t.__h = [], ie = 0)), ze = H;
|
|
494
|
+
}, R.diffed = function(e) {
|
|
495
|
+
ct && ct(e);
|
|
496
496
|
var t = e.__c;
|
|
497
|
-
t && t.__H && (t.__H.__h.length && (
|
|
497
|
+
t && t.__H && (t.__H.__h.length && (Ht.push(t) !== 1 && st === R.requestAnimationFrame || ((st = R.requestAnimationFrame) || kn)(Sn)), t.__H.__.some(function(n) {
|
|
498
498
|
n.u && (n.__H = n.u, n.u = void 0);
|
|
499
|
-
})),
|
|
500
|
-
},
|
|
499
|
+
})), ze = H = null;
|
|
500
|
+
}, R.__c = function(e, t) {
|
|
501
501
|
t.some(function(n) {
|
|
502
502
|
try {
|
|
503
|
-
n.__h.some(
|
|
504
|
-
return !r.__ ||
|
|
503
|
+
n.__h.some(ge), n.__h = n.__h.filter(function(r) {
|
|
504
|
+
return !r.__ || We(r);
|
|
505
505
|
});
|
|
506
506
|
} catch (r) {
|
|
507
507
|
t.some(function(o) {
|
|
508
508
|
o.__h && (o.__h = []);
|
|
509
|
-
}), t = [],
|
|
509
|
+
}), t = [], R.__e(r, n.__v);
|
|
510
510
|
}
|
|
511
|
-
}),
|
|
512
|
-
},
|
|
513
|
-
|
|
511
|
+
}), ut && ut(e, t);
|
|
512
|
+
}, R.unmount = function(e) {
|
|
513
|
+
dt && dt(e);
|
|
514
514
|
var t, n = e.__c;
|
|
515
515
|
n && n.__H && (n.__H.__.some(function(r) {
|
|
516
516
|
try {
|
|
517
|
-
|
|
517
|
+
ge(r);
|
|
518
518
|
} catch (o) {
|
|
519
519
|
t = o;
|
|
520
520
|
}
|
|
521
|
-
}), n.__H = void 0, t &&
|
|
521
|
+
}), n.__H = void 0, t && R.__e(t, n.__v));
|
|
522
522
|
};
|
|
523
|
-
var
|
|
524
|
-
function
|
|
523
|
+
var pt = typeof requestAnimationFrame == "function";
|
|
524
|
+
function kn(e) {
|
|
525
525
|
var t, n = function() {
|
|
526
|
-
clearTimeout(r),
|
|
526
|
+
clearTimeout(r), pt && cancelAnimationFrame(t), setTimeout(e);
|
|
527
527
|
}, r = setTimeout(n, 35);
|
|
528
|
-
|
|
528
|
+
pt && (t = requestAnimationFrame(n));
|
|
529
529
|
}
|
|
530
|
-
function
|
|
531
|
-
var t =
|
|
532
|
-
typeof n == "function" && (e.__c = void 0, n()),
|
|
530
|
+
function ge(e) {
|
|
531
|
+
var t = H, n = e.__c;
|
|
532
|
+
typeof n == "function" && (e.__c = void 0, n()), H = t;
|
|
533
533
|
}
|
|
534
|
-
function
|
|
535
|
-
var t =
|
|
536
|
-
e.__c = e.__(),
|
|
534
|
+
function We(e) {
|
|
535
|
+
var t = H;
|
|
536
|
+
e.__c = e.__(), H = t;
|
|
537
537
|
}
|
|
538
538
|
function Rt(e, t) {
|
|
539
539
|
return !e || e.length !== t.length || t.some(function(n, r) {
|
|
540
540
|
return n !== e[r];
|
|
541
541
|
});
|
|
542
542
|
}
|
|
543
|
-
function
|
|
543
|
+
function Et(e, t) {
|
|
544
544
|
return typeof t == "function" ? t(e) : t;
|
|
545
545
|
}
|
|
546
|
-
var
|
|
546
|
+
var $n = `
|
|
547
547
|
:host{all:initial;display:contents;font-family:system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;font-size:14px;line-height:1.4;-webkit-font-smoothing:antialiased;color:#15171e}
|
|
548
548
|
:host([hidden]){display:none}
|
|
549
549
|
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
|
|
@@ -576,50 +576,50 @@ img,video{display:block;max-width:100%}
|
|
|
576
576
|
@keyframes uq-slide{from{transform:translateY(100%)}to{transform:none}}
|
|
577
577
|
@media (prefers-reduced-motion:reduce){.uq-rise,.uq-fade,.uq-slide,.uq-dots span{animation:none}.uq-drawer{transition:none}}
|
|
578
578
|
`;
|
|
579
|
-
function
|
|
579
|
+
function ae(e, t) {
|
|
580
580
|
try {
|
|
581
581
|
return window[e].getItem(t);
|
|
582
582
|
} catch {
|
|
583
583
|
return null;
|
|
584
584
|
}
|
|
585
585
|
}
|
|
586
|
-
function
|
|
586
|
+
function le(e, t, n) {
|
|
587
587
|
try {
|
|
588
588
|
window[e].setItem(t, n);
|
|
589
589
|
} catch {
|
|
590
590
|
}
|
|
591
591
|
}
|
|
592
|
-
function
|
|
592
|
+
function Pt(e, t) {
|
|
593
593
|
try {
|
|
594
594
|
window[e].removeItem(t);
|
|
595
595
|
} catch {
|
|
596
596
|
}
|
|
597
597
|
}
|
|
598
|
-
var
|
|
599
|
-
function
|
|
598
|
+
var Cn = 2e3, qn = 20, In = 100;
|
|
599
|
+
function Ve(e = Date.now()) {
|
|
600
600
|
const t = /* @__PURE__ */ new Uint8Array(16);
|
|
601
601
|
crypto.getRandomValues(t), t[0] = e / 2 ** 40 & 255, t[1] = e / 2 ** 32 & 255, t[2] = e / 2 ** 24 & 255, t[3] = e / 2 ** 16 & 255, t[4] = e / 256 & 255, t[5] = e & 255, t[6] = t[6] & 15 | 112, t[8] = t[8] & 63 | 128;
|
|
602
602
|
const n = Array.from(t, (r) => r.toString(16).padStart(2, "0")).join("");
|
|
603
603
|
return `${n.slice(0, 8)}-${n.slice(8, 12)}-${n.slice(12, 16)}-${n.slice(16, 20)}-${n.slice(20)}`;
|
|
604
604
|
}
|
|
605
|
-
var
|
|
606
|
-
function
|
|
607
|
-
const e =
|
|
605
|
+
var ht = "usereq:visitor";
|
|
606
|
+
function Ft() {
|
|
607
|
+
const e = ae("localStorage", ht);
|
|
608
608
|
if (e) return e;
|
|
609
|
-
const t =
|
|
610
|
-
return
|
|
609
|
+
const t = Ve();
|
|
610
|
+
return le("localStorage", ht, t), t;
|
|
611
611
|
}
|
|
612
|
-
function
|
|
612
|
+
function Tn(e, t) {
|
|
613
613
|
const n = [];
|
|
614
614
|
let r = null;
|
|
615
|
-
const o =
|
|
615
|
+
const o = Ft(), i = () => {
|
|
616
616
|
for (r !== null && (window.clearTimeout(r), r = null); n.length > 0; ) {
|
|
617
|
-
const u = n.splice(0,
|
|
618
|
-
|
|
617
|
+
const u = n.splice(0, In);
|
|
618
|
+
un(e, { events: u });
|
|
619
619
|
}
|
|
620
620
|
}, a = (u, d = {}) => {
|
|
621
621
|
n.push({
|
|
622
|
-
id:
|
|
622
|
+
id: Ve(),
|
|
623
623
|
type: u,
|
|
624
624
|
embedKind: t.kind,
|
|
625
625
|
embedId: t.id,
|
|
@@ -629,7 +629,7 @@ function In(e, t) {
|
|
|
629
629
|
url: window.location.href.slice(0, 2e3),
|
|
630
630
|
occurredAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
631
631
|
payload: d.payload
|
|
632
|
-
}), n.length >=
|
|
632
|
+
}), n.length >= qn ? i() : r === null && (r = window.setTimeout(i, Cn));
|
|
633
633
|
};
|
|
634
634
|
return window.addEventListener("pagehide", i), document.addEventListener("visibilitychange", () => {
|
|
635
635
|
document.visibilityState === "hidden" && i();
|
|
@@ -638,7 +638,7 @@ function In(e, t) {
|
|
|
638
638
|
flush: i
|
|
639
639
|
};
|
|
640
640
|
}
|
|
641
|
-
var
|
|
641
|
+
var jt = (e) => `usereq:once:${e}`;
|
|
642
642
|
function Ae(e, t, n) {
|
|
643
643
|
switch (e) {
|
|
644
644
|
case "is":
|
|
@@ -655,7 +655,7 @@ function Ae(e, t, n) {
|
|
|
655
655
|
}
|
|
656
656
|
}
|
|
657
657
|
}
|
|
658
|
-
function
|
|
658
|
+
function Mn(e, t) {
|
|
659
659
|
switch (e.kind) {
|
|
660
660
|
case "path":
|
|
661
661
|
return e.value === "*" || Ae(e.op, t.path, e.value);
|
|
@@ -668,13 +668,13 @@ function Tn(e, t) {
|
|
|
668
668
|
return Ae(e.op, t.referrer, e.value);
|
|
669
669
|
}
|
|
670
670
|
}
|
|
671
|
-
function
|
|
671
|
+
function zn(e, t) {
|
|
672
672
|
for (const n of e)
|
|
673
|
-
if (!(n.once &&
|
|
673
|
+
if (!(n.once && ae("sessionStorage", jt(n.id))) && n.conditions.every((r) => Mn(r, t)))
|
|
674
674
|
return n;
|
|
675
675
|
return null;
|
|
676
676
|
}
|
|
677
|
-
function
|
|
677
|
+
function Bt(e, t, n) {
|
|
678
678
|
let r = !1, o = () => {
|
|
679
679
|
};
|
|
680
680
|
const i = () => {
|
|
@@ -742,30 +742,30 @@ function jt(e, t, n) {
|
|
|
742
742
|
r = !0, o();
|
|
743
743
|
};
|
|
744
744
|
}
|
|
745
|
-
function
|
|
746
|
-
const r =
|
|
747
|
-
return r ?
|
|
748
|
-
r.once &&
|
|
745
|
+
function Dt(e, t, n) {
|
|
746
|
+
const r = zn(e, t);
|
|
747
|
+
return r ? Bt(r.trigger, r.triggerParams, () => {
|
|
748
|
+
r.once && le("sessionStorage", jt(r.id), "1"), n(r);
|
|
749
749
|
}) : () => {
|
|
750
750
|
};
|
|
751
751
|
}
|
|
752
|
-
var
|
|
752
|
+
var _t = (e) => `usereq:split:${e}`, Wt = (e) => `usereq:seq:${e}`;
|
|
753
753
|
function An(e) {
|
|
754
754
|
let t = 2166136261;
|
|
755
755
|
for (let n = 0; n < e.length; n++)
|
|
756
756
|
t ^= e.charCodeAt(n), t = Math.imul(t, 16777619);
|
|
757
757
|
return t >>> 0;
|
|
758
758
|
}
|
|
759
|
-
function
|
|
759
|
+
function $e(e) {
|
|
760
760
|
return [...e].sort((t, n) => t.position - n.position);
|
|
761
761
|
}
|
|
762
|
-
function
|
|
763
|
-
const t =
|
|
762
|
+
function Hn(e) {
|
|
763
|
+
const t = $e(e.members);
|
|
764
764
|
if (t.length === 0) return null;
|
|
765
|
-
const n =
|
|
765
|
+
const n = ae("localStorage", _t(e.id)), r = n ? t.find((u) => u.widget.id === n) : void 0;
|
|
766
766
|
if (r) return r;
|
|
767
767
|
const o = t.reduce((u, d) => u + d.weight, 0);
|
|
768
|
-
let i = An(`${
|
|
768
|
+
let i = An(`${Ft()}:${e.config.salt}`) % o, a = t[t.length - 1];
|
|
769
769
|
for (const u of t) {
|
|
770
770
|
if (i < u.weight) {
|
|
771
771
|
a = u;
|
|
@@ -773,50 +773,50 @@ function zn(e) {
|
|
|
773
773
|
}
|
|
774
774
|
i -= u.weight;
|
|
775
775
|
}
|
|
776
|
-
return
|
|
776
|
+
return le("localStorage", _t(e.id), a.widget.id), a;
|
|
777
777
|
}
|
|
778
|
-
function
|
|
778
|
+
function Lt(e) {
|
|
779
779
|
var t, n;
|
|
780
|
-
const r =
|
|
780
|
+
const r = $e(e.members);
|
|
781
781
|
if (r.length === 0) return null;
|
|
782
|
-
const o = Number((t =
|
|
782
|
+
const o = Number((t = ae("sessionStorage", Wt(e.id))) !== null && t !== void 0 ? t : 0);
|
|
783
783
|
return (n = r[Number.isFinite(o) ? Math.min(o, r.length - 1) : 0]) !== null && n !== void 0 ? n : null;
|
|
784
784
|
}
|
|
785
785
|
function Rn(e, t, n) {
|
|
786
786
|
if (!t.advanceOn) return () => {
|
|
787
787
|
};
|
|
788
|
-
const r =
|
|
789
|
-
return
|
|
788
|
+
const r = $e(e.members), o = r.findIndex((i) => i.widget.id === t.widget.id);
|
|
789
|
+
return Bt(t.advanceOn.kind, t.advanceOn.params, () => {
|
|
790
790
|
var i;
|
|
791
791
|
const a = o + 1 < r.length ? o + 1 : null;
|
|
792
792
|
if (a === null) {
|
|
793
793
|
n(null);
|
|
794
794
|
return;
|
|
795
795
|
}
|
|
796
|
-
|
|
796
|
+
le("sessionStorage", Wt(e.id), String(a)), n((i = r[a]) !== null && i !== void 0 ? i : null);
|
|
797
797
|
});
|
|
798
798
|
}
|
|
799
|
-
function
|
|
799
|
+
function En(e) {
|
|
800
800
|
switch (e.mode) {
|
|
801
801
|
case "split": {
|
|
802
|
-
const t =
|
|
802
|
+
const t = Hn(e);
|
|
803
803
|
return t ? [t.widget] : [];
|
|
804
804
|
}
|
|
805
805
|
case "sequence": {
|
|
806
|
-
const t =
|
|
806
|
+
const t = Lt(e);
|
|
807
807
|
return t ? [t.widget] : [];
|
|
808
808
|
}
|
|
809
809
|
case "parallel":
|
|
810
|
-
return
|
|
810
|
+
return $e(e.members).map((t) => t.widget);
|
|
811
811
|
}
|
|
812
812
|
}
|
|
813
|
-
function
|
|
813
|
+
function Pn(e) {
|
|
814
814
|
var t, n, r, o;
|
|
815
815
|
if (e) return e === "dark";
|
|
816
|
-
const i = (t =
|
|
816
|
+
const i = (t = gt(getComputedStyle(document.body).backgroundColor)) !== null && t !== void 0 ? t : gt(getComputedStyle(document.documentElement).backgroundColor);
|
|
817
817
|
return i !== null ? i < 0.5 : (n = (r = (o = window).matchMedia) === null || r === void 0 ? void 0 : r.call(o, "(prefers-color-scheme: dark)").matches) !== null && n !== void 0 ? n : !1;
|
|
818
818
|
}
|
|
819
|
-
function
|
|
819
|
+
function gt(e) {
|
|
820
820
|
const t = /rgba?\(\s*(\d+)[,\s]+(\d+)[,\s]+(\d+)(?:[,\s/]+([\d.]+))?/.exec(e);
|
|
821
821
|
if (!t || (t[4] === void 0 ? 1 : Number(t[4])) < 0.5) return null;
|
|
822
822
|
const [n, r, o] = [
|
|
@@ -826,10 +826,10 @@ function _t(e) {
|
|
|
826
826
|
];
|
|
827
827
|
return (0.299 * n + 0.587 * r + 0.114 * o) / 255;
|
|
828
828
|
}
|
|
829
|
-
function
|
|
829
|
+
function Fn(e = window.innerWidth) {
|
|
830
830
|
return e < 640 ? "mobile" : e < 1024 ? "tablet" : "desktop";
|
|
831
831
|
}
|
|
832
|
-
function
|
|
832
|
+
function jn() {
|
|
833
833
|
const e = new URL(window.location.href), t = {};
|
|
834
834
|
for (const n of [
|
|
835
835
|
"source",
|
|
@@ -846,10 +846,10 @@ function Fn() {
|
|
|
846
846
|
path: e.pathname,
|
|
847
847
|
referrer: document.referrer.slice(0, 2e3),
|
|
848
848
|
utm: t,
|
|
849
|
-
device:
|
|
849
|
+
device: Fn()
|
|
850
850
|
};
|
|
851
851
|
}
|
|
852
|
-
function
|
|
852
|
+
function Nt(e) {
|
|
853
853
|
const t = e.replace("#", "");
|
|
854
854
|
return {
|
|
855
855
|
r: parseInt(t.slice(0, 2), 16),
|
|
@@ -857,26 +857,26 @@ function Lt(e) {
|
|
|
857
857
|
b: parseInt(t.slice(4, 6), 16)
|
|
858
858
|
};
|
|
859
859
|
}
|
|
860
|
-
function
|
|
861
|
-
const { r: t, g: n, b: r } =
|
|
860
|
+
function Bn(e) {
|
|
861
|
+
const { r: t, g: n, b: r } = Nt(e);
|
|
862
862
|
return (0.299 * t + 0.587 * n + 0.114 * r) / 255 > 0.62 ? "#15171e" : "#ffffff";
|
|
863
863
|
}
|
|
864
|
-
var
|
|
865
|
-
function
|
|
864
|
+
var ce = (e) => e ? "245,245,241" : "21,23,30";
|
|
865
|
+
function Dn(e, t) {
|
|
866
866
|
const n = e.appearance, r = n.accent;
|
|
867
867
|
return {
|
|
868
868
|
accent: r,
|
|
869
869
|
accentFill: (() => {
|
|
870
870
|
if (n.alpha >= 100) return r;
|
|
871
|
-
const { r: o, g: i, b: a } =
|
|
871
|
+
const { r: o, g: i, b: a } = Nt(r);
|
|
872
872
|
return `rgba(${o},${i},${a},${n.alpha / 100})`;
|
|
873
873
|
})(),
|
|
874
|
-
accentText:
|
|
874
|
+
accentText: Bn(r),
|
|
875
875
|
rad: n.radius,
|
|
876
876
|
isGlass: e.type === "chat" && e.variant === "stream" && n.skin === "glass",
|
|
877
877
|
isMessenger: e.type === "chat" && e.variant === "bubble" && e.preset === "facebook-messenger",
|
|
878
878
|
hostDark: t,
|
|
879
|
-
ink:
|
|
879
|
+
ink: ce(t),
|
|
880
880
|
surfaceBg: t ? "#181b22" : "#ffffff",
|
|
881
881
|
side: n.position === "bottom-right" ? { right: n.offsetX } : { left: n.offsetX },
|
|
882
882
|
offsetY: n.offsetY
|
|
@@ -886,7 +886,7 @@ function k(e, t, n) {
|
|
|
886
886
|
const r = e.appearance.parts[t], o = [`uq-${t}`];
|
|
887
887
|
return n && o.push(n), r && o.push(r.trim()), o.join(" ");
|
|
888
888
|
}
|
|
889
|
-
var
|
|
889
|
+
var Wn = 0;
|
|
890
890
|
function s(e, t, n, r, o, i) {
|
|
891
891
|
t || (t = {});
|
|
892
892
|
var a, u, d = t;
|
|
@@ -902,14 +902,14 @@ function s(e, t, n, r, o, i) {
|
|
|
902
902
|
__e: null,
|
|
903
903
|
__c: null,
|
|
904
904
|
constructor: void 0,
|
|
905
|
-
__v: --
|
|
905
|
+
__v: --Wn,
|
|
906
906
|
__i: -1,
|
|
907
907
|
__u: 0,
|
|
908
908
|
__source: o,
|
|
909
909
|
__self: i
|
|
910
910
|
};
|
|
911
911
|
if (typeof e == "function" && (a = e.defaultProps)) for (u in a) d[u] === void 0 && (d[u] = a[u]);
|
|
912
|
-
return
|
|
912
|
+
return I.vnode && I.vnode(c), c;
|
|
913
913
|
}
|
|
914
914
|
function j({ size: e, children: t }) {
|
|
915
915
|
return /* @__PURE__ */ s("svg", {
|
|
@@ -926,7 +926,7 @@ function j({ size: e, children: t }) {
|
|
|
926
926
|
children: t
|
|
927
927
|
});
|
|
928
928
|
}
|
|
929
|
-
var
|
|
929
|
+
var Ot = ({ size: e }) => /* @__PURE__ */ s(j, {
|
|
930
930
|
size: e,
|
|
931
931
|
children: [
|
|
932
932
|
/* @__PURE__ */ s("path", { d: "M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z" }),
|
|
@@ -938,23 +938,23 @@ var Nt = ({ size: e }) => /* @__PURE__ */ s(j, {
|
|
|
938
938
|
r: "2"
|
|
939
939
|
})
|
|
940
940
|
]
|
|
941
|
-
}),
|
|
941
|
+
}), Ut = ({ size: e }) => /* @__PURE__ */ s(j, {
|
|
942
942
|
size: e,
|
|
943
943
|
children: [/* @__PURE__ */ s("path", { d: "M5 12h14" }), /* @__PURE__ */ s("path", { d: "m12 5 7 7-7 7" })]
|
|
944
|
-
}),
|
|
944
|
+
}), Ce = ({ size: e }) => /* @__PURE__ */ s(j, {
|
|
945
945
|
size: e,
|
|
946
946
|
children: [/* @__PURE__ */ s("path", { d: "M18 6 6 18" }), /* @__PURE__ */ s("path", { d: "m6 6 12 12" })]
|
|
947
|
-
}),
|
|
947
|
+
}), Xe = ({ size: e }) => /* @__PURE__ */ s(j, {
|
|
948
948
|
size: e,
|
|
949
949
|
children: [
|
|
950
950
|
/* @__PURE__ */ s("path", { d: "M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719" }),
|
|
951
951
|
/* @__PURE__ */ s("path", { d: "m15 9-6 6" }),
|
|
952
952
|
/* @__PURE__ */ s("path", { d: "m9 9 6 6" })
|
|
953
953
|
]
|
|
954
|
-
}),
|
|
954
|
+
}), Ln = ({ size: e }) => /* @__PURE__ */ s(j, {
|
|
955
955
|
size: e,
|
|
956
956
|
children: /* @__PURE__ */ s("path", { d: "M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384" })
|
|
957
|
-
}),
|
|
957
|
+
}), Nn = ({ size: e }) => /* @__PURE__ */ s(j, {
|
|
958
958
|
size: e,
|
|
959
959
|
children: [/* @__PURE__ */ s("path", { d: "m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5" }), /* @__PURE__ */ s("rect", {
|
|
960
960
|
x: "2",
|
|
@@ -963,7 +963,7 @@ var Nt = ({ size: e }) => /* @__PURE__ */ s(j, {
|
|
|
963
963
|
height: "12",
|
|
964
964
|
rx: "2"
|
|
965
965
|
})]
|
|
966
|
-
}),
|
|
966
|
+
}), On = ({ size: e }) => /* @__PURE__ */ s(j, {
|
|
967
967
|
size: e,
|
|
968
968
|
children: [
|
|
969
969
|
/* @__PURE__ */ s("circle", {
|
|
@@ -977,20 +977,20 @@ var Nt = ({ size: e }) => /* @__PURE__ */ s(j, {
|
|
|
977
977
|
}), Yt = ({ size: e }) => /* @__PURE__ */ s(j, {
|
|
978
978
|
size: e,
|
|
979
979
|
children: /* @__PURE__ */ s("path", { d: "m6 9 6 6 6-6" })
|
|
980
|
-
}),
|
|
980
|
+
}), Un = ({ size: e }) => /* @__PURE__ */ s(j, {
|
|
981
981
|
size: e,
|
|
982
982
|
children: /* @__PURE__ */ s("path", { d: "M5 12h14" })
|
|
983
983
|
}), Yn = ({ size: e }) => /* @__PURE__ */ s(j, {
|
|
984
984
|
size: e,
|
|
985
985
|
children: [/* @__PURE__ */ s("path", { d: "M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z" }), /* @__PURE__ */ s("path", { d: "m21.854 2.147-10.94 10.939" })]
|
|
986
|
-
}),
|
|
986
|
+
}), Gn = ({ size: e }) => /* @__PURE__ */ s(j, {
|
|
987
987
|
size: e,
|
|
988
988
|
children: [
|
|
989
989
|
/* @__PURE__ */ s("path", { d: "M15 3h6v6" }),
|
|
990
990
|
/* @__PURE__ */ s("path", { d: "M10 14 21 3" }),
|
|
991
991
|
/* @__PURE__ */ s("path", { d: "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6" })
|
|
992
992
|
]
|
|
993
|
-
}),
|
|
993
|
+
}), Kn = ({ size: e, d: t }) => /* @__PURE__ */ s("svg", {
|
|
994
994
|
xmlns: "http://www.w3.org/2000/svg",
|
|
995
995
|
width: e,
|
|
996
996
|
height: e,
|
|
@@ -999,7 +999,7 @@ var Nt = ({ size: e }) => /* @__PURE__ */ s(j, {
|
|
|
999
999
|
"aria-hidden": "true",
|
|
1000
1000
|
children: /* @__PURE__ */ s("path", { d: t })
|
|
1001
1001
|
});
|
|
1002
|
-
function
|
|
1002
|
+
function Vn({ payload: e, look: t, reporter: n, open: r, setOpen: o, pinned: i }) {
|
|
1003
1003
|
var a;
|
|
1004
1004
|
const u = e.config, { accentFill: d, accentText: c, rad: f } = t;
|
|
1005
1005
|
if (!r) return null;
|
|
@@ -1064,38 +1064,87 @@ function Kn({ payload: e, look: t, reporter: n, open: r, setOpen: o, pinned: i }
|
|
|
1064
1064
|
justifyContent: "center",
|
|
1065
1065
|
opacity: 0.7
|
|
1066
1066
|
},
|
|
1067
|
-
children: /* @__PURE__ */ s(
|
|
1067
|
+
children: /* @__PURE__ */ s(Ce, { size: 14 })
|
|
1068
1068
|
})
|
|
1069
1069
|
]
|
|
1070
1070
|
});
|
|
1071
1071
|
}
|
|
1072
|
-
var
|
|
1072
|
+
var K = {
|
|
1073
|
+
panelWidth: 340,
|
|
1074
|
+
panelHeight: 480,
|
|
1075
|
+
launcherSize: 44,
|
|
1076
|
+
panelGap: 10
|
|
1077
|
+
}, v = {
|
|
1078
|
+
accent: "#7B5BFF",
|
|
1079
|
+
gradient: "linear-gradient(135deg,#00B2FF 0%,#006AFF 38%,#8E5BFF 100%)",
|
|
1080
|
+
blue: "#0084FF",
|
|
1081
|
+
surface: {
|
|
1082
|
+
light: "#ffffff",
|
|
1083
|
+
dark: "#242526"
|
|
1084
|
+
},
|
|
1085
|
+
bubble: {
|
|
1086
|
+
light: "#f5f5f5",
|
|
1087
|
+
dark: "#404040"
|
|
1088
|
+
},
|
|
1089
|
+
muted: {
|
|
1090
|
+
light: "#8e8e8e",
|
|
1091
|
+
dark: "#a8a8a8"
|
|
1092
|
+
},
|
|
1093
|
+
border: {
|
|
1094
|
+
light: "rgba(0,0,0,.1)",
|
|
1095
|
+
dark: "rgba(255,255,255,.12)"
|
|
1096
|
+
},
|
|
1097
|
+
panelWidth: 372,
|
|
1098
|
+
panelHeight: 520,
|
|
1099
|
+
panelRadius: 24,
|
|
1100
|
+
panelGap: 14,
|
|
1101
|
+
panelShadow: "0 8px 32px rgba(0,0,0,.16)",
|
|
1102
|
+
launcherSize: 60,
|
|
1103
|
+
launcherShadow: "0 6px 20px rgba(123,91,255,.4)",
|
|
1104
|
+
badgeSize: 20,
|
|
1105
|
+
logo: "M12 2C6.48 2 2 6.18 2 11.32c0 2.93 1.45 5.55 3.7 7.27v3.4l3.39-1.86a10.5 10.5 0 0 0 2.91.41c5.52 0 10-4.18 10-9.22S17.52 2 12 2Zm1.06 12.42-2.55-2.72-4.97 2.72 5.46-5.8 2.61 2.72 4.91-2.72-5.46 5.8Z",
|
|
1106
|
+
headerAvatar: 40,
|
|
1107
|
+
headerButton: 28,
|
|
1108
|
+
headerIcon: 18,
|
|
1109
|
+
nameFont: 15,
|
|
1110
|
+
avatarSize: 28,
|
|
1111
|
+
bubbleRadius: 18,
|
|
1112
|
+
bubbleFont: 14,
|
|
1113
|
+
bubblePadding: "6px 12px",
|
|
1114
|
+
bubbleMaxWidth: "78%",
|
|
1115
|
+
ctaShadow: "0 4px 12px rgba(123,91,255,.32)",
|
|
1116
|
+
composerPlaceholder: "Aa",
|
|
1117
|
+
composerRadius: 24,
|
|
1118
|
+
composerHeight: 36,
|
|
1119
|
+
sendSize: 36,
|
|
1120
|
+
sendIcon: 20
|
|
1121
|
+
}, He = {
|
|
1073
1122
|
holdMs: 1260,
|
|
1074
1123
|
gapMs: 1520,
|
|
1075
1124
|
jitterMs: 100
|
|
1076
1125
|
};
|
|
1077
|
-
function
|
|
1126
|
+
function Xn(e, t = Math.random) {
|
|
1078
1127
|
const n = [];
|
|
1079
1128
|
let r = 0;
|
|
1080
1129
|
for (let o = 0; o < e; o++) {
|
|
1081
|
-
if (o === 0) r +=
|
|
1130
|
+
if (o === 0) r += He.holdMs;
|
|
1082
1131
|
else {
|
|
1083
|
-
const i = Math.round((t() * 2 - 1) *
|
|
1084
|
-
r += Math.max(0,
|
|
1132
|
+
const i = Math.round((t() * 2 - 1) * He.jitterMs);
|
|
1133
|
+
r += Math.max(0, He.gapMs + i);
|
|
1085
1134
|
}
|
|
1086
1135
|
n.push(r);
|
|
1087
1136
|
}
|
|
1088
1137
|
return n;
|
|
1089
1138
|
}
|
|
1090
|
-
var
|
|
1091
|
-
function
|
|
1092
|
-
const n =
|
|
1139
|
+
var xe = (e) => `usereq:session:${e}`;
|
|
1140
|
+
function Jn(e, t = Date.now()) {
|
|
1141
|
+
const n = ae("localStorage", xe(e));
|
|
1093
1142
|
if (!n) return null;
|
|
1094
1143
|
try {
|
|
1095
1144
|
const r = JSON.parse(n);
|
|
1096
1145
|
if (typeof r != "object" || r === null || !("token" in r) || typeof r.token != "string" || !("conversationId" in r) || typeof r.conversationId != "string" || !("expiresAt" in r) || typeof r.expiresAt != "string") return null;
|
|
1097
1146
|
const o = Date.parse(r.expiresAt);
|
|
1098
|
-
return !Number.isFinite(o) || o <= t ? (
|
|
1147
|
+
return !Number.isFinite(o) || o <= t ? (Pt("localStorage", xe(e)), null) : {
|
|
1099
1148
|
token: r.token,
|
|
1100
1149
|
conversationId: r.conversationId,
|
|
1101
1150
|
expiresAt: r.expiresAt
|
|
@@ -1104,13 +1153,13 @@ function Xn(e, t = Date.now()) {
|
|
|
1104
1153
|
return null;
|
|
1105
1154
|
}
|
|
1106
1155
|
}
|
|
1107
|
-
function
|
|
1108
|
-
|
|
1109
|
-
}
|
|
1110
|
-
function Zn(e) {
|
|
1111
|
-
Et("localStorage", ye(e));
|
|
1156
|
+
function Zn(e, t) {
|
|
1157
|
+
le("localStorage", xe(e), JSON.stringify(t));
|
|
1112
1158
|
}
|
|
1113
1159
|
function Qn(e) {
|
|
1160
|
+
Pt("localStorage", xe(e));
|
|
1161
|
+
}
|
|
1162
|
+
function er(e) {
|
|
1114
1163
|
const t = e.parts.map((n) => n.text).filter((n) => n.trim());
|
|
1115
1164
|
return t.length === 0 ? null : {
|
|
1116
1165
|
id: e.id,
|
|
@@ -1119,46 +1168,46 @@ function Qn(e) {
|
|
|
1119
1168
|
shown: t.length
|
|
1120
1169
|
};
|
|
1121
1170
|
}
|
|
1122
|
-
function
|
|
1123
|
-
const [o, i] = E([]), [a, u] = E(!1), [d, c] = E(null), [f, h] = E(null), [l, p] = E(null), m = D(null), x = D(null),
|
|
1124
|
-
for (const
|
|
1125
|
-
|
|
1171
|
+
function tr(e, t, n, r) {
|
|
1172
|
+
const [o, i] = E([]), [a, u] = E(!1), [d, c] = E(null), [f, h] = E(null), [l, p] = E(null), m = D(null), x = D(null), b = D([]), _ = D(null), g = () => {
|
|
1173
|
+
for (const S of b.current) window.clearTimeout(S);
|
|
1174
|
+
b.current = [];
|
|
1126
1175
|
};
|
|
1127
1176
|
P(() => () => g(), []);
|
|
1128
1177
|
const y = t.id, $ = O(() => {
|
|
1129
|
-
m.current = null, h(null),
|
|
1178
|
+
m.current = null, h(null), Qn(y);
|
|
1130
1179
|
}, [y]);
|
|
1131
1180
|
P(() => {
|
|
1132
|
-
const
|
|
1133
|
-
if (!
|
|
1134
|
-
let
|
|
1181
|
+
const S = Jn(y);
|
|
1182
|
+
if (!S) return;
|
|
1183
|
+
let C = !1;
|
|
1135
1184
|
return m.current = {
|
|
1136
|
-
token:
|
|
1137
|
-
conversationId:
|
|
1138
|
-
}, h(
|
|
1139
|
-
if (!
|
|
1140
|
-
if (
|
|
1185
|
+
token: S.token,
|
|
1186
|
+
conversationId: S.conversationId
|
|
1187
|
+
}, h(S.conversationId), an(e, S.token).then((w) => {
|
|
1188
|
+
if (!C) {
|
|
1189
|
+
if (w.ended) {
|
|
1141
1190
|
$();
|
|
1142
1191
|
return;
|
|
1143
1192
|
}
|
|
1144
|
-
i(
|
|
1145
|
-
const M =
|
|
1193
|
+
i(w.messages.flatMap((T) => {
|
|
1194
|
+
const M = er(T);
|
|
1146
1195
|
return M ? [M] : [];
|
|
1147
1196
|
}));
|
|
1148
1197
|
}
|
|
1149
|
-
}).catch((
|
|
1150
|
-
|
|
1198
|
+
}).catch((w) => {
|
|
1199
|
+
C || w instanceof V && w.status < 500 && $();
|
|
1151
1200
|
}), () => {
|
|
1152
|
-
|
|
1201
|
+
C = !0;
|
|
1153
1202
|
};
|
|
1154
1203
|
}, [
|
|
1155
1204
|
e,
|
|
1156
1205
|
y,
|
|
1157
1206
|
$
|
|
1158
1207
|
]);
|
|
1159
|
-
const
|
|
1208
|
+
const q = O(async () => {
|
|
1160
1209
|
if (m.current) return m.current;
|
|
1161
|
-
const
|
|
1210
|
+
const S = await sn(e, {
|
|
1162
1211
|
kind: n.kind,
|
|
1163
1212
|
id: n.id,
|
|
1164
1213
|
widgetId: n.kind === "group" ? t.id : void 0,
|
|
@@ -1167,13 +1216,13 @@ function er(e, t, n, r) {
|
|
|
1167
1216
|
utm: Object.keys(r.utm).length ? r.utm : void 0
|
|
1168
1217
|
});
|
|
1169
1218
|
return m.current = {
|
|
1170
|
-
token:
|
|
1171
|
-
conversationId:
|
|
1172
|
-
},
|
|
1173
|
-
token:
|
|
1174
|
-
conversationId:
|
|
1175
|
-
expiresAt:
|
|
1176
|
-
}), h(
|
|
1219
|
+
token: S.token,
|
|
1220
|
+
conversationId: S.conversationId
|
|
1221
|
+
}, Zn(y, {
|
|
1222
|
+
token: S.token,
|
|
1223
|
+
conversationId: S.conversationId,
|
|
1224
|
+
expiresAt: S.expiresAt
|
|
1225
|
+
}), h(S.conversationId), m.current;
|
|
1177
1226
|
}, [
|
|
1178
1227
|
e,
|
|
1179
1228
|
n.kind,
|
|
@@ -1181,13 +1230,13 @@ function er(e, t, n, r) {
|
|
|
1181
1230
|
t.id,
|
|
1182
1231
|
r,
|
|
1183
1232
|
y
|
|
1184
|
-
]),
|
|
1185
|
-
var
|
|
1186
|
-
(
|
|
1233
|
+
]), z = O(async (S, C) => {
|
|
1234
|
+
var w;
|
|
1235
|
+
(w = x.current) === null || w === void 0 || w.abort();
|
|
1187
1236
|
const T = new AbortController();
|
|
1188
1237
|
x.current = T, g(), u(!0), c(null);
|
|
1189
1238
|
try {
|
|
1190
|
-
const { token: M } = await
|
|
1239
|
+
const { token: M } = await q(), G = await cn(e, M, S, C, T.signal);
|
|
1191
1240
|
if (T.signal.aborted) return;
|
|
1192
1241
|
const F = G.parts.filter((W) => W.trim());
|
|
1193
1242
|
if (F.length === 0) throw new Error("The agent did not answer. Try again.");
|
|
@@ -1196,19 +1245,19 @@ function er(e, t, n, r) {
|
|
|
1196
1245
|
role: "assistant",
|
|
1197
1246
|
parts: F,
|
|
1198
1247
|
shown: 0
|
|
1199
|
-
}]),
|
|
1248
|
+
}]), b.current = Xn(F.length).map((W, ee) => window.setTimeout(() => {
|
|
1200
1249
|
i((N) => N.map((B) => B.id === G.id ? {
|
|
1201
1250
|
...B,
|
|
1202
|
-
shown:
|
|
1203
|
-
} : B)),
|
|
1251
|
+
shown: ee + 1
|
|
1252
|
+
} : B)), ee === F.length - 1 && u(!1);
|
|
1204
1253
|
}, W));
|
|
1205
1254
|
} catch (M) {
|
|
1206
1255
|
if (T.signal.aborted) return;
|
|
1207
|
-
M instanceof
|
|
1256
|
+
M instanceof V && (M.status === 401 || M.status === 409) && $(), u(!1), c(M instanceof V ? M.message : M instanceof TypeError ? "Could not reach the agent. Try again." : M instanceof Error && M.message ? M.message : "Something went wrong. Try again.");
|
|
1208
1257
|
}
|
|
1209
1258
|
}, [
|
|
1210
1259
|
e,
|
|
1211
|
-
|
|
1260
|
+
q,
|
|
1212
1261
|
$
|
|
1213
1262
|
]);
|
|
1214
1263
|
return {
|
|
@@ -1217,37 +1266,37 @@ function er(e, t, n, r) {
|
|
|
1217
1266
|
error: d,
|
|
1218
1267
|
sessionId: f,
|
|
1219
1268
|
stopping: l,
|
|
1220
|
-
send: O((
|
|
1221
|
-
const
|
|
1222
|
-
if (!
|
|
1223
|
-
const
|
|
1224
|
-
id:
|
|
1225
|
-
text:
|
|
1269
|
+
send: O((S) => {
|
|
1270
|
+
const C = S.trim().slice(0, 4e3);
|
|
1271
|
+
if (!C || a || l) return;
|
|
1272
|
+
const w = {
|
|
1273
|
+
id: Ve(),
|
|
1274
|
+
text: C
|
|
1226
1275
|
};
|
|
1227
|
-
_.current =
|
|
1228
|
-
id:
|
|
1276
|
+
_.current = w, i((T) => [...T, {
|
|
1277
|
+
id: w.id,
|
|
1229
1278
|
role: "user",
|
|
1230
|
-
parts: [
|
|
1279
|
+
parts: [C],
|
|
1231
1280
|
shown: 1
|
|
1232
|
-
}]),
|
|
1281
|
+
}]), z(w, "submit-message");
|
|
1233
1282
|
}, [
|
|
1234
1283
|
a,
|
|
1235
1284
|
l,
|
|
1236
|
-
|
|
1285
|
+
z
|
|
1237
1286
|
]),
|
|
1238
1287
|
retry: O(() => {
|
|
1239
|
-
!_.current || a || l ||
|
|
1288
|
+
!_.current || a || l || z(_.current, "regenerate-message");
|
|
1240
1289
|
}, [
|
|
1241
1290
|
a,
|
|
1242
1291
|
l,
|
|
1243
|
-
|
|
1292
|
+
z
|
|
1244
1293
|
]),
|
|
1245
1294
|
stop: O(() => {
|
|
1246
|
-
var
|
|
1247
|
-
(
|
|
1248
|
-
...
|
|
1249
|
-
shown:
|
|
1250
|
-
} :
|
|
1295
|
+
var S;
|
|
1296
|
+
(S = x.current) === null || S === void 0 || S.abort(), x.current = null, g(), i((C) => C.map((w) => w.role === "assistant" && w.shown < w.parts.length ? {
|
|
1297
|
+
...w,
|
|
1298
|
+
shown: w.parts.length
|
|
1299
|
+
} : w)), u(!1);
|
|
1251
1300
|
}, []),
|
|
1252
1301
|
askToStop: O(() => {
|
|
1253
1302
|
!m.current || a || p({
|
|
@@ -1255,9 +1304,9 @@ function er(e, t, n, r) {
|
|
|
1255
1304
|
error: null
|
|
1256
1305
|
});
|
|
1257
1306
|
}, [a]),
|
|
1258
|
-
answerStop: O(async (
|
|
1259
|
-
const
|
|
1260
|
-
if (!
|
|
1307
|
+
answerStop: O(async (S) => {
|
|
1308
|
+
const C = m.current;
|
|
1309
|
+
if (!S || !C) {
|
|
1261
1310
|
p(null);
|
|
1262
1311
|
return;
|
|
1263
1312
|
}
|
|
@@ -1266,12 +1315,12 @@ function er(e, t, n, r) {
|
|
|
1266
1315
|
error: null
|
|
1267
1316
|
});
|
|
1268
1317
|
try {
|
|
1269
|
-
await
|
|
1270
|
-
} catch (
|
|
1271
|
-
if (!(
|
|
1318
|
+
await ln(e, C.token);
|
|
1319
|
+
} catch (w) {
|
|
1320
|
+
if (!(w instanceof V && (w.status === 401 || w.status === 409))) {
|
|
1272
1321
|
p({
|
|
1273
1322
|
busy: !1,
|
|
1274
|
-
error:
|
|
1323
|
+
error: w instanceof V ? w.message : "Could not stop the conversation. Try again."
|
|
1275
1324
|
});
|
|
1276
1325
|
return;
|
|
1277
1326
|
}
|
|
@@ -1280,7 +1329,7 @@ function er(e, t, n, r) {
|
|
|
1280
1329
|
}, [e, $])
|
|
1281
1330
|
};
|
|
1282
1331
|
}
|
|
1283
|
-
function
|
|
1332
|
+
function nr() {
|
|
1284
1333
|
const e = "(max-width: 639px)", [t, n] = E(() => {
|
|
1285
1334
|
var r, o, i;
|
|
1286
1335
|
return (r = (o = (i = window).matchMedia) === null || o === void 0 ? void 0 : o.call(i, e).matches) !== null && r !== void 0 ? r : !1;
|
|
@@ -1293,8 +1342,8 @@ function tr() {
|
|
|
1293
1342
|
return i.addEventListener("change", a), () => i.removeEventListener("change", a);
|
|
1294
1343
|
}, []), t;
|
|
1295
1344
|
}
|
|
1296
|
-
var
|
|
1297
|
-
function
|
|
1345
|
+
var rr = 0.5, mt = 120, Re = () => document.documentElement.clientHeight;
|
|
1346
|
+
function Gt({ look: e, pinned: t, onClose: n, children: r }) {
|
|
1298
1347
|
const [o, i] = E("half"), [a, u] = E(null), d = D(null), c = D(null), f = (_) => {
|
|
1299
1348
|
const g = d.current;
|
|
1300
1349
|
g && (_.currentTarget.setPointerCapture(_.pointerId), c.current = {
|
|
@@ -1310,31 +1359,31 @@ function Ut({ look: e, pinned: t, onClose: n, children: r }) {
|
|
|
1310
1359
|
const y = _.timeStamp - g.lastAt;
|
|
1311
1360
|
y > 0 && (g.velocity = (_.clientY - g.lastY) / y), g.lastY = _.clientY, g.lastAt = _.timeStamp;
|
|
1312
1361
|
const $ = g.startHeight + (g.startY - _.clientY);
|
|
1313
|
-
u(Math.max(
|
|
1362
|
+
u(Math.max(mt, Math.min(Re(), $)));
|
|
1314
1363
|
}, l = () => {
|
|
1315
1364
|
const _ = c.current;
|
|
1316
1365
|
if (!_) return;
|
|
1317
1366
|
c.current = null;
|
|
1318
|
-
const g = Math.max(
|
|
1367
|
+
const g = Math.max(mt, Math.min(Re(), _.startHeight + (_.startY - _.lastY))), y = Re();
|
|
1319
1368
|
let $;
|
|
1320
|
-
if (_.velocity < -0.5 ? $ = "full" : _.velocity >
|
|
1369
|
+
if (_.velocity < -0.5 ? $ = "full" : _.velocity > rr ? $ = o === "full" ? "half" : "closed" : g > y * 0.75 ? $ = "full" : g < y * 0.3 ? $ = "closed" : $ = "half", u(null), $ === "closed") {
|
|
1321
1370
|
t ? i("half") : n();
|
|
1322
1371
|
return;
|
|
1323
1372
|
}
|
|
1324
1373
|
i($);
|
|
1325
|
-
}, { ink: p, surfaceBg: m, rad: x } = e,
|
|
1374
|
+
}, { ink: p, surfaceBg: m, rad: x } = e, b = o === "full" && a === null;
|
|
1326
1375
|
return /* @__PURE__ */ s("div", {
|
|
1327
1376
|
ref: d,
|
|
1328
1377
|
class: [
|
|
1329
1378
|
"uq-fixed uq-drawer uq-slide",
|
|
1330
|
-
|
|
1379
|
+
b ? "uq-drawer-full" : "uq-drawer-half",
|
|
1331
1380
|
a !== null && "uq-drawer-held"
|
|
1332
1381
|
].filter(Boolean).join(" "),
|
|
1333
1382
|
role: "dialog",
|
|
1334
1383
|
"aria-modal": "false",
|
|
1335
1384
|
style: {
|
|
1336
1385
|
height: a !== null ? a : void 0,
|
|
1337
|
-
borderRadius:
|
|
1386
|
+
borderRadius: b ? 0 : `${x}px ${x}px 0 0`,
|
|
1338
1387
|
borderTop: `1px solid rgba(${p},.12)`,
|
|
1339
1388
|
background: m,
|
|
1340
1389
|
boxShadow: "0 -12px 40px rgba(0,0,0,.18)"
|
|
@@ -1345,84 +1394,40 @@ function Ut({ look: e, pinned: t, onClose: n, children: r }) {
|
|
|
1345
1394
|
onPointerMove: h,
|
|
1346
1395
|
onPointerUp: l,
|
|
1347
1396
|
onPointerCancel: l,
|
|
1348
|
-
"aria-label":
|
|
1397
|
+
"aria-label": b ? "Drag down to shrink or close" : "Drag up to expand",
|
|
1349
1398
|
style: { background: m },
|
|
1350
1399
|
children: /* @__PURE__ */ s("span", { style: { background: `rgba(${p},.25)` } })
|
|
1351
1400
|
}), r]
|
|
1352
1401
|
});
|
|
1353
1402
|
}
|
|
1354
|
-
var
|
|
1355
|
-
|
|
1356
|
-
gradient: "linear-gradient(135deg,#00B2FF 0%,#006AFF 38%,#8E5BFF 100%)",
|
|
1357
|
-
blue: "#0084FF",
|
|
1358
|
-
surface: {
|
|
1359
|
-
light: "#ffffff",
|
|
1360
|
-
dark: "#242526"
|
|
1361
|
-
},
|
|
1362
|
-
bubble: {
|
|
1363
|
-
light: "#f5f5f5",
|
|
1364
|
-
dark: "#404040"
|
|
1365
|
-
},
|
|
1366
|
-
muted: {
|
|
1367
|
-
light: "#8e8e8e",
|
|
1368
|
-
dark: "#a8a8a8"
|
|
1369
|
-
},
|
|
1370
|
-
border: {
|
|
1371
|
-
light: "rgba(0,0,0,.1)",
|
|
1372
|
-
dark: "rgba(255,255,255,.12)"
|
|
1373
|
-
},
|
|
1374
|
-
panelWidth: 372,
|
|
1375
|
-
panelHeight: 520,
|
|
1376
|
-
panelRadius: 24,
|
|
1377
|
-
panelGap: 14,
|
|
1378
|
-
panelShadow: "0 8px 32px rgba(0,0,0,.16)",
|
|
1379
|
-
launcherSize: 60,
|
|
1380
|
-
launcherShadow: "0 6px 20px rgba(123,91,255,.4)",
|
|
1381
|
-
badgeSize: 20,
|
|
1382
|
-
logo: "M12 2C6.48 2 2 6.18 2 11.32c0 2.93 1.45 5.55 3.7 7.27v3.4l3.39-1.86a10.5 10.5 0 0 0 2.91.41c5.52 0 10-4.18 10-9.22S17.52 2 12 2Zm1.06 12.42-2.55-2.72-4.97 2.72 5.46-5.8 2.61 2.72 4.91-2.72-5.46 5.8Z",
|
|
1383
|
-
headerAvatar: 40,
|
|
1384
|
-
headerButton: 28,
|
|
1385
|
-
headerIcon: 18,
|
|
1386
|
-
nameFont: 15,
|
|
1387
|
-
avatarSize: 28,
|
|
1388
|
-
bubbleRadius: 18,
|
|
1389
|
-
bubbleFont: 14,
|
|
1390
|
-
bubblePadding: "6px 12px",
|
|
1391
|
-
bubbleMaxWidth: "78%",
|
|
1392
|
-
ctaShadow: "0 4px 12px rgba(123,91,255,.32)",
|
|
1393
|
-
composerPlaceholder: "Aa",
|
|
1394
|
-
composerRadius: 24,
|
|
1395
|
-
composerHeight: 36,
|
|
1396
|
-
sendSize: 36,
|
|
1397
|
-
sendIcon: 20
|
|
1398
|
-
}, rr = 3600, Xe = (e) => e.welcome || "Hi! Ask me anything before you buy.";
|
|
1399
|
-
function Gt(e, t = "Type your message…") {
|
|
1403
|
+
var ir = 3600, Je = (e) => e.welcome || "Hi! Ask me anything before you buy.";
|
|
1404
|
+
function Kt(e, t = "Type your message…") {
|
|
1400
1405
|
const n = e.spotlights.filter((a) => a.trim()), [r, o] = E(0);
|
|
1401
1406
|
P(() => {
|
|
1402
1407
|
if (n.length < 2) return;
|
|
1403
|
-
const a = window.setInterval(() => o((u) => u + 1),
|
|
1408
|
+
const a = window.setInterval(() => o((u) => u + 1), ir);
|
|
1404
1409
|
return () => window.clearInterval(a);
|
|
1405
1410
|
}, [n.length]);
|
|
1406
1411
|
const i = e.placeholder || t;
|
|
1407
1412
|
return n.length ? n[r % n.length] : i;
|
|
1408
1413
|
}
|
|
1409
|
-
function
|
|
1414
|
+
function qe(e) {
|
|
1410
1415
|
const t = D(null);
|
|
1411
1416
|
return P(() => {
|
|
1412
1417
|
const n = t.current;
|
|
1413
1418
|
n && (n.scrollTop = n.scrollHeight);
|
|
1414
1419
|
}, e), t;
|
|
1415
1420
|
}
|
|
1416
|
-
function
|
|
1421
|
+
function Vt(e) {
|
|
1417
1422
|
const t = e ? "dark" : "light";
|
|
1418
1423
|
return {
|
|
1419
|
-
surface:
|
|
1420
|
-
bubble:
|
|
1421
|
-
muted:
|
|
1422
|
-
border:
|
|
1424
|
+
surface: v.surface[t],
|
|
1425
|
+
bubble: v.bubble[t],
|
|
1426
|
+
muted: v.muted[t],
|
|
1427
|
+
border: v.border[t]
|
|
1423
1428
|
};
|
|
1424
1429
|
}
|
|
1425
|
-
var
|
|
1430
|
+
var J = (e, t = {}) => ({
|
|
1426
1431
|
width: e,
|
|
1427
1432
|
height: e,
|
|
1428
1433
|
borderRadius: "50%",
|
|
@@ -1432,7 +1437,7 @@ var X = (e, t = {}) => ({
|
|
|
1432
1437
|
flexShrink: 0,
|
|
1433
1438
|
...t
|
|
1434
1439
|
});
|
|
1435
|
-
function
|
|
1440
|
+
function Ze({ payload: e, size: t, font: n, palette: r, fallback: o }) {
|
|
1436
1441
|
var i, a, u, d;
|
|
1437
1442
|
const c = (i = (a = e.agent) === null || a === void 0 ? void 0 : a.name) !== null && i !== void 0 ? i : null, f = (u = (d = e.agent) === null || d === void 0 ? void 0 : d.avatarUrl) !== null && u !== void 0 ? u : null;
|
|
1438
1443
|
return f ? /* @__PURE__ */ s("img", {
|
|
@@ -1440,9 +1445,9 @@ function Je({ payload: e, size: t, font: n, palette: r, fallback: o }) {
|
|
|
1440
1445
|
alt: "",
|
|
1441
1446
|
width: t,
|
|
1442
1447
|
height: t,
|
|
1443
|
-
style:
|
|
1448
|
+
style: J(t, { objectFit: "cover" })
|
|
1444
1449
|
}) : /* @__PURE__ */ s("span", {
|
|
1445
|
-
style:
|
|
1450
|
+
style: J(t, {
|
|
1446
1451
|
background: r.bubble,
|
|
1447
1452
|
color: r.muted,
|
|
1448
1453
|
fontSize: n,
|
|
@@ -1452,7 +1457,7 @@ function Je({ payload: e, size: t, font: n, palette: r, fallback: o }) {
|
|
|
1452
1457
|
children: c ? c.trim().charAt(0).toUpperCase() : "A"
|
|
1453
1458
|
});
|
|
1454
1459
|
}
|
|
1455
|
-
function
|
|
1460
|
+
function Ee({ text: e, mine: t, runStart: n, look: r, config: o, payload: i, palette: a, children: u }) {
|
|
1456
1461
|
return /* @__PURE__ */ s("div", {
|
|
1457
1462
|
class: "uq-rise",
|
|
1458
1463
|
style: {
|
|
@@ -1462,23 +1467,23 @@ function He({ text: e, mine: t, runStart: n, look: r, config: o, payload: i, pal
|
|
|
1462
1467
|
justifyContent: t ? "flex-end" : "flex-start",
|
|
1463
1468
|
marginTop: n ? 6 : 2
|
|
1464
1469
|
},
|
|
1465
|
-
children: [!t && (n ? /* @__PURE__ */ s(
|
|
1470
|
+
children: [!t && (n ? /* @__PURE__ */ s(Ze, {
|
|
1466
1471
|
payload: i,
|
|
1467
|
-
size:
|
|
1472
|
+
size: v.avatarSize,
|
|
1468
1473
|
font: 12,
|
|
1469
1474
|
palette: a
|
|
1470
1475
|
}) : /* @__PURE__ */ s("span", { style: {
|
|
1471
|
-
width:
|
|
1476
|
+
width: v.avatarSize,
|
|
1472
1477
|
flexShrink: 0
|
|
1473
1478
|
} })), /* @__PURE__ */ s("div", {
|
|
1474
1479
|
class: k(o, t ? "userMessage" : "botMessage"),
|
|
1475
1480
|
style: {
|
|
1476
|
-
maxWidth:
|
|
1477
|
-
padding: u ? "8px 12px" :
|
|
1478
|
-
borderRadius:
|
|
1479
|
-
background: t ?
|
|
1481
|
+
maxWidth: v.bubbleMaxWidth,
|
|
1482
|
+
padding: u ? "8px 12px" : v.bubblePadding,
|
|
1483
|
+
borderRadius: v.bubbleRadius,
|
|
1484
|
+
background: t ? v.gradient : a.bubble,
|
|
1480
1485
|
color: t ? "#fff" : `rgb(${r.ink})`,
|
|
1481
|
-
fontSize:
|
|
1486
|
+
fontSize: v.bubbleFont,
|
|
1482
1487
|
lineHeight: 1.375,
|
|
1483
1488
|
whiteSpace: "pre-wrap",
|
|
1484
1489
|
overflowWrap: "anywhere"
|
|
@@ -1487,7 +1492,7 @@ function He({ text: e, mine: t, runStart: n, look: r, config: o, payload: i, pal
|
|
|
1487
1492
|
})]
|
|
1488
1493
|
});
|
|
1489
1494
|
}
|
|
1490
|
-
function
|
|
1495
|
+
function or({ chat: e, stopping: t }) {
|
|
1491
1496
|
const n = {
|
|
1492
1497
|
padding: "6px 12px",
|
|
1493
1498
|
borderRadius: 999,
|
|
@@ -1521,8 +1526,8 @@ function ir({ chat: e, stopping: t }) {
|
|
|
1521
1526
|
disabled: t.busy,
|
|
1522
1527
|
style: {
|
|
1523
1528
|
...n,
|
|
1524
|
-
border: `1px solid ${
|
|
1525
|
-
color:
|
|
1529
|
+
border: `1px solid ${v.blue}`,
|
|
1530
|
+
color: v.blue
|
|
1526
1531
|
},
|
|
1527
1532
|
children: "Keep chatting"
|
|
1528
1533
|
}), /* @__PURE__ */ s("button", {
|
|
@@ -1531,7 +1536,7 @@ function ir({ chat: e, stopping: t }) {
|
|
|
1531
1536
|
disabled: t.busy,
|
|
1532
1537
|
style: {
|
|
1533
1538
|
...n,
|
|
1534
|
-
background:
|
|
1539
|
+
background: v.gradient,
|
|
1535
1540
|
color: "#fff"
|
|
1536
1541
|
},
|
|
1537
1542
|
children: t.busy ? "Stopping…" : "Stop conversation"
|
|
@@ -1545,68 +1550,68 @@ function ir({ chat: e, stopping: t }) {
|
|
|
1545
1550
|
]
|
|
1546
1551
|
});
|
|
1547
1552
|
}
|
|
1548
|
-
function
|
|
1553
|
+
function bt({ payload: e, config: t, look: n, chat: r, focus: o, onCta: i, mobile: a, fill: u = !1, onMinimize: d, onClose: c }) {
|
|
1549
1554
|
var f, h, l, p;
|
|
1550
|
-
const m =
|
|
1555
|
+
const m = Vt(n.hostDark), { surface: x, bubble: b, muted: _, border: g } = m, y = Kt(t, v.composerPlaceholder), $ = (f = (h = e.agent) === null || h === void 0 ? void 0 : h.name) !== null && f !== void 0 ? f : null, q = !!(!((l = e.agent) === null || l === void 0) && l.live), z = qe([
|
|
1551
1556
|
r.turns,
|
|
1552
1557
|
r.busy,
|
|
1553
1558
|
r.error,
|
|
1554
1559
|
r.stopping
|
|
1555
|
-
]), [
|
|
1560
|
+
]), [S, C] = E(""), w = D(null);
|
|
1556
1561
|
P(() => {
|
|
1557
|
-
var
|
|
1558
|
-
o > 0 && ((
|
|
1562
|
+
var A;
|
|
1563
|
+
o > 0 && ((A = w.current) === null || A === void 0 || A.focus());
|
|
1559
1564
|
}, [o]);
|
|
1560
|
-
const T =
|
|
1561
|
-
|
|
1565
|
+
const T = q && !r.stopping, M = (A) => {
|
|
1566
|
+
A.preventDefault(), T && (r.send(S), C(""));
|
|
1562
1567
|
}, G = !((p = t.cta) === null || p === void 0 || (p = p.href) === null || p === void 0) && p.trim() ? t.cta : null, F = [{
|
|
1563
1568
|
key: "welcome",
|
|
1564
|
-
text:
|
|
1569
|
+
text: Je(t),
|
|
1565
1570
|
mine: !1
|
|
1566
1571
|
}];
|
|
1567
|
-
for (const
|
|
1572
|
+
for (const A of r.turns) if (A.role === "user") {
|
|
1568
1573
|
var W;
|
|
1569
1574
|
F.push({
|
|
1570
|
-
key:
|
|
1571
|
-
text: (W =
|
|
1575
|
+
key: A.id,
|
|
1576
|
+
text: (W = A.parts[0]) !== null && W !== void 0 ? W : "",
|
|
1572
1577
|
mine: !0
|
|
1573
1578
|
});
|
|
1574
|
-
} else
|
|
1579
|
+
} else A.parts.slice(0, A.shown).forEach((Q, Ie) => {
|
|
1575
1580
|
F.push({
|
|
1576
|
-
key: `${
|
|
1577
|
-
text:
|
|
1581
|
+
key: `${A.id}:${Ie}`,
|
|
1582
|
+
text: Q,
|
|
1578
1583
|
mine: !1
|
|
1579
1584
|
});
|
|
1580
1585
|
});
|
|
1581
|
-
const
|
|
1586
|
+
const ee = F[F.length - 1], N = (A, Q, Ie, Te, et) => /* @__PURE__ */ s("button", {
|
|
1582
1587
|
type: "button",
|
|
1583
|
-
class:
|
|
1584
|
-
onClick:
|
|
1585
|
-
disabled: !
|
|
1586
|
-
"aria-label":
|
|
1587
|
-
style:
|
|
1588
|
-
color:
|
|
1589
|
-
opacity:
|
|
1588
|
+
class: et ? k(t, et) : void 0,
|
|
1589
|
+
onClick: Te,
|
|
1590
|
+
disabled: !Te,
|
|
1591
|
+
"aria-label": Q,
|
|
1592
|
+
style: J(a ? 36 : v.headerButton, {
|
|
1593
|
+
color: Ie,
|
|
1594
|
+
opacity: Te ? 1 : 0.6
|
|
1590
1595
|
}),
|
|
1591
|
-
children:
|
|
1592
|
-
}), B =
|
|
1596
|
+
children: A
|
|
1597
|
+
}), B = v.headerIcon;
|
|
1593
1598
|
return /* @__PURE__ */ s("div", {
|
|
1594
1599
|
class: k(t, "panel"),
|
|
1595
1600
|
style: {
|
|
1596
1601
|
display: "flex",
|
|
1597
1602
|
flexDirection: "column",
|
|
1598
|
-
borderRadius: u ? 0 :
|
|
1603
|
+
borderRadius: u ? 0 : v.panelRadius,
|
|
1599
1604
|
overflow: "hidden",
|
|
1600
1605
|
border: u ? void 0 : `1px solid ${g}`,
|
|
1601
|
-
boxShadow: u ? void 0 :
|
|
1606
|
+
boxShadow: u ? void 0 : v.panelShadow,
|
|
1602
1607
|
background: x,
|
|
1603
1608
|
color: `rgb(${n.ink})`,
|
|
1604
1609
|
...u ? {
|
|
1605
1610
|
flex: 1,
|
|
1606
1611
|
minHeight: 0
|
|
1607
1612
|
} : {
|
|
1608
|
-
height:
|
|
1609
|
-
maxHeight: `calc(100vh - ${n.offsetY +
|
|
1613
|
+
height: v.panelHeight,
|
|
1614
|
+
maxHeight: `calc(100vh - ${n.offsetY + v.launcherSize + v.panelGap + 12}px)`
|
|
1610
1615
|
}
|
|
1611
1616
|
},
|
|
1612
1617
|
children: [
|
|
@@ -1620,9 +1625,9 @@ function mt({ payload: e, config: t, look: n, chat: r, focus: o, onCta: i, mobil
|
|
|
1620
1625
|
borderBottom: `1px solid ${g}`
|
|
1621
1626
|
},
|
|
1622
1627
|
children: [
|
|
1623
|
-
/* @__PURE__ */ s(
|
|
1628
|
+
/* @__PURE__ */ s(Ze, {
|
|
1624
1629
|
payload: e,
|
|
1625
|
-
size:
|
|
1630
|
+
size: v.headerAvatar,
|
|
1626
1631
|
font: 14,
|
|
1627
1632
|
palette: m
|
|
1628
1633
|
}),
|
|
@@ -1636,7 +1641,7 @@ function mt({ payload: e, config: t, look: n, chat: r, focus: o, onCta: i, mobil
|
|
|
1636
1641
|
},
|
|
1637
1642
|
children: [/* @__PURE__ */ s("span", {
|
|
1638
1643
|
style: {
|
|
1639
|
-
fontSize:
|
|
1644
|
+
fontSize: v.nameFont,
|
|
1640
1645
|
fontWeight: 600,
|
|
1641
1646
|
overflow: "hidden",
|
|
1642
1647
|
textOverflow: "ellipsis",
|
|
@@ -1652,16 +1657,16 @@ function mt({ payload: e, config: t, look: n, chat: r, focus: o, onCta: i, mobil
|
|
|
1652
1657
|
children: /* @__PURE__ */ s(Yt, { size: 16 })
|
|
1653
1658
|
})]
|
|
1654
1659
|
}),
|
|
1655
|
-
N(/* @__PURE__ */ s(
|
|
1656
|
-
N(/* @__PURE__ */ s(
|
|
1657
|
-
N(/* @__PURE__ */ s(
|
|
1658
|
-
r.sessionId && N(/* @__PURE__ */ s(
|
|
1659
|
-
d && N(/* @__PURE__ */ s(
|
|
1660
|
-
c && N(/* @__PURE__ */ s(
|
|
1660
|
+
N(/* @__PURE__ */ s(Ln, { size: B }), "Call (unavailable)", v.blue),
|
|
1661
|
+
N(/* @__PURE__ */ s(Nn, { size: B }), "Video call (unavailable)", v.blue),
|
|
1662
|
+
N(/* @__PURE__ */ s(On, { size: B }), "Details (unavailable)", _),
|
|
1663
|
+
r.sessionId && N(/* @__PURE__ */ s(Xe, { size: B }), "Stop conversation", _, r.busy || r.stopping ? void 0 : r.askToStop, "stopButton"),
|
|
1664
|
+
d && N(/* @__PURE__ */ s(Un, { size: B }), "Minimize chat", _, d),
|
|
1665
|
+
c && N(/* @__PURE__ */ s(Ce, { size: B }), "Close chat", _, c, "close")
|
|
1661
1666
|
]
|
|
1662
1667
|
}),
|
|
1663
1668
|
/* @__PURE__ */ s("div", {
|
|
1664
|
-
ref:
|
|
1669
|
+
ref: z,
|
|
1665
1670
|
style: {
|
|
1666
1671
|
flex: 1,
|
|
1667
1672
|
minHeight: 0,
|
|
@@ -1672,30 +1677,30 @@ function mt({ payload: e, config: t, look: n, chat: r, focus: o, onCta: i, mobil
|
|
|
1672
1677
|
overscrollBehavior: "contain"
|
|
1673
1678
|
},
|
|
1674
1679
|
children: [
|
|
1675
|
-
F.map((
|
|
1676
|
-
text:
|
|
1677
|
-
mine:
|
|
1678
|
-
runStart:
|
|
1680
|
+
F.map((A, Q) => /* @__PURE__ */ s(Ee, {
|
|
1681
|
+
text: A.text,
|
|
1682
|
+
mine: A.mine,
|
|
1683
|
+
runStart: Q === 0 || F[Q - 1].mine !== A.mine,
|
|
1679
1684
|
look: n,
|
|
1680
1685
|
config: t,
|
|
1681
1686
|
payload: e,
|
|
1682
1687
|
palette: m
|
|
1683
|
-
},
|
|
1684
|
-
r.stopping && /* @__PURE__ */ s(
|
|
1688
|
+
}, A.key)),
|
|
1689
|
+
r.stopping && /* @__PURE__ */ s(Ee, {
|
|
1685
1690
|
mine: !1,
|
|
1686
|
-
runStart:
|
|
1691
|
+
runStart: ee.mine,
|
|
1687
1692
|
look: n,
|
|
1688
1693
|
config: t,
|
|
1689
1694
|
payload: e,
|
|
1690
1695
|
palette: m,
|
|
1691
|
-
children: /* @__PURE__ */ s(
|
|
1696
|
+
children: /* @__PURE__ */ s(or, {
|
|
1692
1697
|
chat: r,
|
|
1693
1698
|
stopping: r.stopping
|
|
1694
1699
|
})
|
|
1695
1700
|
}),
|
|
1696
|
-
r.busy && /* @__PURE__ */ s(
|
|
1701
|
+
r.busy && /* @__PURE__ */ s(Ee, {
|
|
1697
1702
|
mine: !1,
|
|
1698
|
-
runStart:
|
|
1703
|
+
runStart: ee.mine,
|
|
1699
1704
|
look: n,
|
|
1700
1705
|
config: t,
|
|
1701
1706
|
payload: e,
|
|
@@ -1726,7 +1731,7 @@ function mt({ payload: e, config: t, look: n, chat: r, focus: o, onCta: i, mobil
|
|
|
1726
1731
|
display: "flex",
|
|
1727
1732
|
gap: 8,
|
|
1728
1733
|
marginTop: 6,
|
|
1729
|
-
paddingLeft:
|
|
1734
|
+
paddingLeft: v.avatarSize + 6,
|
|
1730
1735
|
fontSize: 12,
|
|
1731
1736
|
color: _
|
|
1732
1737
|
},
|
|
@@ -1734,7 +1739,7 @@ function mt({ payload: e, config: t, look: n, chat: r, focus: o, onCta: i, mobil
|
|
|
1734
1739
|
type: "button",
|
|
1735
1740
|
onClick: r.retry,
|
|
1736
1741
|
style: {
|
|
1737
|
-
color:
|
|
1742
|
+
color: v.blue,
|
|
1738
1743
|
fontWeight: 500,
|
|
1739
1744
|
textDecoration: "underline"
|
|
1740
1745
|
},
|
|
@@ -1761,13 +1766,13 @@ function mt({ payload: e, config: t, look: n, chat: r, focus: o, onCta: i, mobil
|
|
|
1761
1766
|
gap: 6,
|
|
1762
1767
|
padding: "8px 16px",
|
|
1763
1768
|
borderRadius: 999,
|
|
1764
|
-
background:
|
|
1769
|
+
background: v.gradient,
|
|
1765
1770
|
color: "#fff",
|
|
1766
1771
|
fontSize: 14,
|
|
1767
1772
|
fontWeight: 600,
|
|
1768
|
-
boxShadow:
|
|
1773
|
+
boxShadow: v.ctaShadow
|
|
1769
1774
|
},
|
|
1770
|
-
children: [G.label || "Learn more", /* @__PURE__ */ s(
|
|
1775
|
+
children: [G.label || "Learn more", /* @__PURE__ */ s(Gn, { size: 16 })]
|
|
1771
1776
|
})
|
|
1772
1777
|
}),
|
|
1773
1778
|
/* @__PURE__ */ s("form", {
|
|
@@ -1781,10 +1786,10 @@ function mt({ payload: e, config: t, look: n, chat: r, focus: o, onCta: i, mobil
|
|
|
1781
1786
|
borderTop: `1px solid ${g}`
|
|
1782
1787
|
},
|
|
1783
1788
|
children: [/* @__PURE__ */ s("input", {
|
|
1784
|
-
ref:
|
|
1789
|
+
ref: w,
|
|
1785
1790
|
type: "text",
|
|
1786
|
-
value:
|
|
1787
|
-
onInput: (
|
|
1791
|
+
value: S,
|
|
1792
|
+
onInput: (A) => C(A.target.value),
|
|
1788
1793
|
placeholder: y,
|
|
1789
1794
|
disabled: !T,
|
|
1790
1795
|
maxLength: 4e3,
|
|
@@ -1792,10 +1797,10 @@ function mt({ payload: e, config: t, look: n, chat: r, focus: o, onCta: i, mobil
|
|
|
1792
1797
|
autoComplete: "off",
|
|
1793
1798
|
style: {
|
|
1794
1799
|
flex: 1,
|
|
1795
|
-
minHeight:
|
|
1800
|
+
minHeight: v.composerHeight,
|
|
1796
1801
|
padding: "0 12px",
|
|
1797
|
-
borderRadius:
|
|
1798
|
-
background:
|
|
1802
|
+
borderRadius: v.composerRadius,
|
|
1803
|
+
background: b,
|
|
1799
1804
|
color: `rgb(${n.ink})`,
|
|
1800
1805
|
fontSize: a ? 16 : 14,
|
|
1801
1806
|
"--uq-placeholder": _
|
|
@@ -1805,7 +1810,7 @@ function mt({ payload: e, config: t, look: n, chat: r, focus: o, onCta: i, mobil
|
|
|
1805
1810
|
class: k(t, "sendButton"),
|
|
1806
1811
|
onClick: r.stop,
|
|
1807
1812
|
"aria-label": "Stop",
|
|
1808
|
-
style:
|
|
1813
|
+
style: J(v.sendSize, { color: v.blue }),
|
|
1809
1814
|
children: /* @__PURE__ */ s("span", { style: {
|
|
1810
1815
|
width: 10,
|
|
1811
1816
|
height: 10,
|
|
@@ -1815,31 +1820,31 @@ function mt({ payload: e, config: t, look: n, chat: r, focus: o, onCta: i, mobil
|
|
|
1815
1820
|
}) : /* @__PURE__ */ s("button", {
|
|
1816
1821
|
type: "submit",
|
|
1817
1822
|
class: k(t, "sendButton"),
|
|
1818
|
-
disabled: !T || !
|
|
1823
|
+
disabled: !T || !S.trim(),
|
|
1819
1824
|
"aria-label": "Send",
|
|
1820
|
-
style:
|
|
1821
|
-
color:
|
|
1822
|
-
opacity: T &&
|
|
1825
|
+
style: J(v.sendSize, {
|
|
1826
|
+
color: v.blue,
|
|
1827
|
+
opacity: T && S.trim() ? 1 : 0.5
|
|
1823
1828
|
}),
|
|
1824
|
-
children: /* @__PURE__ */ s(Yn, { size:
|
|
1829
|
+
children: /* @__PURE__ */ s(Yn, { size: v.sendIcon })
|
|
1825
1830
|
})]
|
|
1826
1831
|
})
|
|
1827
1832
|
]
|
|
1828
1833
|
});
|
|
1829
1834
|
}
|
|
1830
|
-
function
|
|
1831
|
-
const f =
|
|
1835
|
+
function sr({ payload: e, config: t, look: n, chat: r, mobile: o, focus: i, open: a, setOpen: u, pinned: d, onCta: c }) {
|
|
1836
|
+
const f = Vt(n.hostDark), { side: h, offsetY: l } = n, p = d ? void 0 : () => u(!1);
|
|
1832
1837
|
if (a && o) {
|
|
1833
1838
|
const m = {
|
|
1834
1839
|
...n,
|
|
1835
1840
|
surfaceBg: f.surface,
|
|
1836
|
-
rad:
|
|
1841
|
+
rad: v.panelRadius
|
|
1837
1842
|
};
|
|
1838
|
-
return /* @__PURE__ */ s(
|
|
1843
|
+
return /* @__PURE__ */ s(Gt, {
|
|
1839
1844
|
look: m,
|
|
1840
1845
|
pinned: d,
|
|
1841
1846
|
onClose: () => u(!1),
|
|
1842
|
-
children: /* @__PURE__ */ s(
|
|
1847
|
+
children: /* @__PURE__ */ s(bt, {
|
|
1843
1848
|
payload: e,
|
|
1844
1849
|
config: t,
|
|
1845
1850
|
look: n,
|
|
@@ -1852,14 +1857,14 @@ function or({ payload: e, config: t, look: n, chat: r, mobile: o, focus: i, open
|
|
|
1852
1857
|
})
|
|
1853
1858
|
});
|
|
1854
1859
|
}
|
|
1855
|
-
return /* @__PURE__ */ s(
|
|
1860
|
+
return /* @__PURE__ */ s(Y, { children: [a && /* @__PURE__ */ s("div", {
|
|
1856
1861
|
class: "uq-fixed uq-rise",
|
|
1857
1862
|
style: {
|
|
1858
|
-
bottom: l +
|
|
1859
|
-
width:
|
|
1863
|
+
bottom: l + v.launcherSize + v.panelGap,
|
|
1864
|
+
width: v.panelWidth,
|
|
1860
1865
|
...h
|
|
1861
1866
|
},
|
|
1862
|
-
children: /* @__PURE__ */ s(
|
|
1867
|
+
children: /* @__PURE__ */ s(bt, {
|
|
1863
1868
|
payload: e,
|
|
1864
1869
|
config: t,
|
|
1865
1870
|
look: n,
|
|
@@ -1880,16 +1885,16 @@ function or({ payload: e, config: t, look: n, chat: r, mobile: o, focus: i, open
|
|
|
1880
1885
|
},
|
|
1881
1886
|
style: {
|
|
1882
1887
|
bottom: l,
|
|
1883
|
-
...
|
|
1888
|
+
...J(v.launcherSize, { boxShadow: v.launcherShadow }),
|
|
1884
1889
|
...h
|
|
1885
1890
|
},
|
|
1886
|
-
children: [/* @__PURE__ */ s(
|
|
1891
|
+
children: [/* @__PURE__ */ s(Ze, {
|
|
1887
1892
|
payload: e,
|
|
1888
|
-
size:
|
|
1893
|
+
size: v.launcherSize,
|
|
1889
1894
|
font: 16,
|
|
1890
1895
|
palette: f,
|
|
1891
1896
|
fallback: {
|
|
1892
|
-
background:
|
|
1897
|
+
background: v.gradient,
|
|
1893
1898
|
color: "#fff"
|
|
1894
1899
|
}
|
|
1895
1900
|
}), a ? /* @__PURE__ */ s("span", {
|
|
@@ -1909,21 +1914,21 @@ function or({ payload: e, config: t, look: n, chat: r, mobile: o, focus: i, open
|
|
|
1909
1914
|
position: "absolute",
|
|
1910
1915
|
right: -4,
|
|
1911
1916
|
bottom: -4,
|
|
1912
|
-
...
|
|
1913
|
-
background:
|
|
1917
|
+
...J(v.badgeSize, {
|
|
1918
|
+
background: v.accent,
|
|
1914
1919
|
color: "#fff",
|
|
1915
1920
|
boxShadow: `0 0 0 2px ${f.surface}`
|
|
1916
1921
|
})
|
|
1917
1922
|
},
|
|
1918
|
-
children: /* @__PURE__ */ s(
|
|
1923
|
+
children: /* @__PURE__ */ s(Kn, {
|
|
1919
1924
|
size: 12,
|
|
1920
|
-
d:
|
|
1925
|
+
d: v.logo
|
|
1921
1926
|
})
|
|
1922
1927
|
})]
|
|
1923
1928
|
})] });
|
|
1924
1929
|
}
|
|
1925
|
-
function
|
|
1926
|
-
const a =
|
|
1930
|
+
function ne({ text: e, mine: t, onDark: n, look: r, config: o, children: i }) {
|
|
1931
|
+
const a = ce(n), { isGlass: u, accentFill: d, accentText: c, rad: f } = r;
|
|
1927
1932
|
return /* @__PURE__ */ s("div", {
|
|
1928
1933
|
class: k(o, t ? "userMessage" : "botMessage", "uq-rise"),
|
|
1929
1934
|
style: {
|
|
@@ -1943,7 +1948,7 @@ function te({ text: e, mine: t, onDark: n, look: r, config: o, children: i }) {
|
|
|
1943
1948
|
children: i != null ? i : e
|
|
1944
1949
|
});
|
|
1945
1950
|
}
|
|
1946
|
-
var
|
|
1951
|
+
var ar = (e) => /* @__PURE__ */ s(ne, {
|
|
1947
1952
|
mine: !1,
|
|
1948
1953
|
...e,
|
|
1949
1954
|
children: /* @__PURE__ */ s("span", {
|
|
@@ -1956,7 +1961,7 @@ var sr = (e) => /* @__PURE__ */ s(te, {
|
|
|
1956
1961
|
]
|
|
1957
1962
|
})
|
|
1958
1963
|
});
|
|
1959
|
-
function
|
|
1964
|
+
function lr({ chat: e, onDark: t, look: n, config: r }) {
|
|
1960
1965
|
const o = e.stopping;
|
|
1961
1966
|
if (!o) return null;
|
|
1962
1967
|
const { isGlass: i, accent: a, accentFill: u, accentText: d, rad: c } = n, f = i ? "#fff" : a, h = {
|
|
@@ -1967,7 +1972,7 @@ function ar({ chat: e, onDark: t, look: n, config: r }) {
|
|
|
1967
1972
|
lineHeight: 1.3,
|
|
1968
1973
|
opacity: o.busy ? 0.6 : 1
|
|
1969
1974
|
};
|
|
1970
|
-
return /* @__PURE__ */ s(
|
|
1975
|
+
return /* @__PURE__ */ s(ne, {
|
|
1971
1976
|
mine: !1,
|
|
1972
1977
|
onDark: t,
|
|
1973
1978
|
look: n,
|
|
@@ -2022,9 +2027,9 @@ function ar({ chat: e, onDark: t, look: n, config: r }) {
|
|
|
2022
2027
|
})
|
|
2023
2028
|
});
|
|
2024
2029
|
}
|
|
2025
|
-
function
|
|
2030
|
+
function Xt({ config: e, look: t, onDark: n, chat: r, size: o }) {
|
|
2026
2031
|
if (!r.sessionId) return null;
|
|
2027
|
-
const i =
|
|
2032
|
+
const i = ce(n), a = !r.busy && !r.stopping;
|
|
2028
2033
|
return /* @__PURE__ */ s("button", {
|
|
2029
2034
|
type: "button",
|
|
2030
2035
|
class: k(e, "stopButton"),
|
|
@@ -2042,10 +2047,10 @@ function Vt({ config: e, look: t, onDark: n, chat: r, size: o }) {
|
|
|
2042
2047
|
justifyContent: "center",
|
|
2043
2048
|
flexShrink: 0
|
|
2044
2049
|
},
|
|
2045
|
-
children: /* @__PURE__ */ s(
|
|
2050
|
+
children: /* @__PURE__ */ s(Xe, { size: o - 9 })
|
|
2046
2051
|
});
|
|
2047
2052
|
}
|
|
2048
|
-
function
|
|
2053
|
+
function Jt({ config: e, look: t, onClick: n }) {
|
|
2049
2054
|
var r;
|
|
2050
2055
|
const o = !((r = e.cta) === null || r === void 0 || (r = r.href) === null || r === void 0) && r.trim() ? e.cta : null;
|
|
2051
2056
|
return o ? /* @__PURE__ */ s("a", {
|
|
@@ -2068,14 +2073,14 @@ function Xt({ config: e, look: t, onClick: n }) {
|
|
|
2068
2073
|
children: o.label || "Learn more"
|
|
2069
2074
|
}) : null;
|
|
2070
2075
|
}
|
|
2071
|
-
function
|
|
2072
|
-
const d =
|
|
2076
|
+
function Zt({ config: e, look: t, onDark: n, hint: r, chat: o, disabled: i, focus: a, withStop: u = !1 }) {
|
|
2077
|
+
const d = ce(n), { isGlass: c, accentFill: f, accentText: h, rad: l } = t, [p, m] = E(""), x = D(null);
|
|
2073
2078
|
P(() => {
|
|
2074
2079
|
var y;
|
|
2075
2080
|
a > 0 && ((y = x.current) === null || y === void 0 || y.focus());
|
|
2076
2081
|
}, [a]);
|
|
2077
|
-
const
|
|
2078
|
-
y.preventDefault(), !
|
|
2082
|
+
const b = i || !!o.stopping, _ = (y) => {
|
|
2083
|
+
y.preventDefault(), !b && (o.send(p), m(""));
|
|
2079
2084
|
}, g = c ? "rgba(255,255,255,.75)" : `rgba(${d},${n ? 0.6 : 0.45})`;
|
|
2080
2085
|
return /* @__PURE__ */ s("form", {
|
|
2081
2086
|
class: k(e, "composer"),
|
|
@@ -2097,7 +2102,7 @@ function Jt({ config: e, look: t, onDark: n, hint: r, chat: o, disabled: i, focu
|
|
|
2097
2102
|
value: p,
|
|
2098
2103
|
onInput: (y) => m(y.target.value),
|
|
2099
2104
|
placeholder: r || "Message…",
|
|
2100
|
-
disabled:
|
|
2105
|
+
disabled: b,
|
|
2101
2106
|
maxLength: 4e3,
|
|
2102
2107
|
"aria-label": "Message",
|
|
2103
2108
|
autoComplete: "off",
|
|
@@ -2108,7 +2113,7 @@ function Jt({ config: e, look: t, onDark: n, hint: r, chat: o, disabled: i, focu
|
|
|
2108
2113
|
"--uq-placeholder": g
|
|
2109
2114
|
}
|
|
2110
2115
|
}),
|
|
2111
|
-
u && /* @__PURE__ */ s(
|
|
2116
|
+
u && /* @__PURE__ */ s(Xt, {
|
|
2112
2117
|
config: e,
|
|
2113
2118
|
look: t,
|
|
2114
2119
|
onDark: n,
|
|
@@ -2140,7 +2145,7 @@ function Jt({ config: e, look: t, onDark: n, hint: r, chat: o, disabled: i, focu
|
|
|
2140
2145
|
}) : /* @__PURE__ */ s("button", {
|
|
2141
2146
|
type: "submit",
|
|
2142
2147
|
class: k(e, "sendButton"),
|
|
2143
|
-
disabled:
|
|
2148
|
+
disabled: b,
|
|
2144
2149
|
"aria-label": "Send",
|
|
2145
2150
|
style: {
|
|
2146
2151
|
width: 24,
|
|
@@ -2152,43 +2157,43 @@ function Jt({ config: e, look: t, onDark: n, hint: r, chat: o, disabled: i, focu
|
|
|
2152
2157
|
alignItems: "center",
|
|
2153
2158
|
justifyContent: "center",
|
|
2154
2159
|
flexShrink: 0,
|
|
2155
|
-
opacity:
|
|
2160
|
+
opacity: b ? 0.5 : 1
|
|
2156
2161
|
},
|
|
2157
|
-
children: /* @__PURE__ */ s(
|
|
2162
|
+
children: /* @__PURE__ */ s(Ut, { size: 13 })
|
|
2158
2163
|
})
|
|
2159
2164
|
]
|
|
2160
2165
|
});
|
|
2161
2166
|
}
|
|
2162
|
-
function
|
|
2163
|
-
const i =
|
|
2164
|
-
return /* @__PURE__ */ s(
|
|
2165
|
-
/* @__PURE__ */ s(
|
|
2167
|
+
function Qe({ welcome: e, chat: t, onDark: n, look: r, config: o }) {
|
|
2168
|
+
const i = ce(n);
|
|
2169
|
+
return /* @__PURE__ */ s(Y, { children: [
|
|
2170
|
+
/* @__PURE__ */ s(ne, {
|
|
2166
2171
|
text: e,
|
|
2167
2172
|
mine: !1,
|
|
2168
2173
|
onDark: n,
|
|
2169
2174
|
look: r,
|
|
2170
2175
|
config: o
|
|
2171
2176
|
}),
|
|
2172
|
-
t.turns.map((a) => a.role === "user" ? /* @__PURE__ */ s(
|
|
2177
|
+
t.turns.map((a) => a.role === "user" ? /* @__PURE__ */ s(ne, {
|
|
2173
2178
|
text: a.parts[0],
|
|
2174
2179
|
mine: !0,
|
|
2175
2180
|
onDark: n,
|
|
2176
2181
|
look: r,
|
|
2177
2182
|
config: o
|
|
2178
|
-
}, a.id) : a.parts.slice(0, a.shown).map((u, d) => /* @__PURE__ */ s(
|
|
2183
|
+
}, a.id) : a.parts.slice(0, a.shown).map((u, d) => /* @__PURE__ */ s(ne, {
|
|
2179
2184
|
text: u,
|
|
2180
2185
|
mine: !1,
|
|
2181
2186
|
onDark: n,
|
|
2182
2187
|
look: r,
|
|
2183
2188
|
config: o
|
|
2184
2189
|
}, `${a.id}:${d}`))),
|
|
2185
|
-
/* @__PURE__ */ s(
|
|
2190
|
+
/* @__PURE__ */ s(lr, {
|
|
2186
2191
|
chat: t,
|
|
2187
2192
|
onDark: n,
|
|
2188
2193
|
look: r,
|
|
2189
2194
|
config: o
|
|
2190
2195
|
}),
|
|
2191
|
-
t.busy && /* @__PURE__ */ s(
|
|
2196
|
+
t.busy && /* @__PURE__ */ s(ar, {
|
|
2192
2197
|
onDark: n,
|
|
2193
2198
|
look: r,
|
|
2194
2199
|
config: o
|
|
@@ -2216,29 +2221,32 @@ function Ze({ welcome: e, chat: t, onDark: n, look: r, config: o }) {
|
|
|
2216
2221
|
})
|
|
2217
2222
|
] });
|
|
2218
2223
|
}
|
|
2219
|
-
function
|
|
2220
|
-
var
|
|
2221
|
-
const { ink:
|
|
2224
|
+
function Pe({ payload: e, config: t, look: n, chat: r, shadow: o, hint: i, focus: a, onCta: u, fill: d = !1, height: c = K.panelHeight, maxHeight: f, onClose: h }) {
|
|
2225
|
+
var l, p, m;
|
|
2226
|
+
const { ink: x, surfaceBg: b, hostDark: _, accentFill: g, accentText: y, rad: $ } = n, q = (l = (p = e.agent) === null || p === void 0 ? void 0 : p.name) !== null && l !== void 0 ? l : null, z = q ? q.trim().charAt(0).toUpperCase() : "A", S = Je(t), C = qe([
|
|
2222
2227
|
r.turns,
|
|
2223
2228
|
r.busy,
|
|
2224
2229
|
r.error,
|
|
2225
2230
|
r.stopping
|
|
2226
|
-
]), w = !!(!((
|
|
2231
|
+
]), w = !!(!((m = e.agent) === null || m === void 0) && m.live);
|
|
2227
2232
|
return /* @__PURE__ */ s("div", {
|
|
2228
2233
|
class: k(t, "panel"),
|
|
2229
2234
|
style: {
|
|
2230
2235
|
width: "100%",
|
|
2231
|
-
borderRadius: d ? 0 :
|
|
2236
|
+
borderRadius: d ? 0 : $,
|
|
2232
2237
|
overflow: "hidden",
|
|
2233
|
-
border: d ? void 0 : `1px solid rgba(${
|
|
2238
|
+
border: d ? void 0 : `1px solid rgba(${x},.12)`,
|
|
2234
2239
|
boxShadow: o ? "0 18px 44px rgba(0,0,0,.16)" : void 0,
|
|
2235
|
-
background:
|
|
2240
|
+
background: b,
|
|
2241
|
+
display: "flex",
|
|
2242
|
+
flexDirection: "column",
|
|
2236
2243
|
...d ? {
|
|
2237
2244
|
flex: 1,
|
|
2238
|
-
minHeight: 0
|
|
2239
|
-
|
|
2240
|
-
|
|
2241
|
-
|
|
2245
|
+
minHeight: 0
|
|
2246
|
+
} : {
|
|
2247
|
+
height: c,
|
|
2248
|
+
maxHeight: f
|
|
2249
|
+
}
|
|
2242
2250
|
},
|
|
2243
2251
|
children: [
|
|
2244
2252
|
/* @__PURE__ */ s("div", {
|
|
@@ -2248,8 +2256,8 @@ function Ee({ payload: e, config: t, look: n, chat: r, shadow: o, hint: i, focus
|
|
|
2248
2256
|
alignItems: "center",
|
|
2249
2257
|
gap: 8,
|
|
2250
2258
|
padding: "10px 12px",
|
|
2251
|
-
background:
|
|
2252
|
-
color:
|
|
2259
|
+
background: g,
|
|
2260
|
+
color: y
|
|
2253
2261
|
},
|
|
2254
2262
|
children: [
|
|
2255
2263
|
/* @__PURE__ */ s("span", {
|
|
@@ -2263,16 +2271,16 @@ function Ee({ payload: e, config: t, look: n, chat: r, shadow: o, hint: i, focus
|
|
|
2263
2271
|
justifyContent: "center",
|
|
2264
2272
|
fontSize: 10,
|
|
2265
2273
|
fontWeight: 600,
|
|
2266
|
-
color:
|
|
2274
|
+
color: y
|
|
2267
2275
|
},
|
|
2268
|
-
children:
|
|
2276
|
+
children: z
|
|
2269
2277
|
}),
|
|
2270
2278
|
/* @__PURE__ */ s("span", {
|
|
2271
2279
|
style: {
|
|
2272
2280
|
fontSize: 12,
|
|
2273
2281
|
fontWeight: 500
|
|
2274
2282
|
},
|
|
2275
|
-
children:
|
|
2283
|
+
children: q ? q.split("—")[0].trim() : "Chat"
|
|
2276
2284
|
}),
|
|
2277
2285
|
/* @__PURE__ */ s("span", {
|
|
2278
2286
|
style: {
|
|
@@ -2291,21 +2299,21 @@ function Ee({ payload: e, config: t, look: n, chat: r, shadow: o, hint: i, focus
|
|
|
2291
2299
|
style: {
|
|
2292
2300
|
width: 28,
|
|
2293
2301
|
height: 28,
|
|
2294
|
-
marginRight:
|
|
2302
|
+
marginRight: h ? 0 : -6,
|
|
2295
2303
|
borderRadius: "50%",
|
|
2296
2304
|
display: "flex",
|
|
2297
2305
|
alignItems: "center",
|
|
2298
2306
|
justifyContent: "center",
|
|
2299
|
-
color:
|
|
2307
|
+
color: y,
|
|
2300
2308
|
opacity: r.busy || r.stopping ? 0.5 : 0.9,
|
|
2301
2309
|
flexShrink: 0
|
|
2302
2310
|
},
|
|
2303
|
-
children: /* @__PURE__ */ s(
|
|
2311
|
+
children: /* @__PURE__ */ s(Xe, { size: 15 })
|
|
2304
2312
|
}),
|
|
2305
|
-
|
|
2313
|
+
h && /* @__PURE__ */ s("button", {
|
|
2306
2314
|
type: "button",
|
|
2307
2315
|
class: k(t, "close"),
|
|
2308
|
-
onClick:
|
|
2316
|
+
onClick: h,
|
|
2309
2317
|
"aria-label": "Close chat",
|
|
2310
2318
|
style: {
|
|
2311
2319
|
width: 28,
|
|
@@ -2315,31 +2323,30 @@ function Ee({ payload: e, config: t, look: n, chat: r, shadow: o, hint: i, focus
|
|
|
2315
2323
|
display: "flex",
|
|
2316
2324
|
alignItems: "center",
|
|
2317
2325
|
justifyContent: "center",
|
|
2318
|
-
color:
|
|
2326
|
+
color: y,
|
|
2319
2327
|
flexShrink: 0
|
|
2320
2328
|
},
|
|
2321
|
-
children: /* @__PURE__ */ s(
|
|
2329
|
+
children: /* @__PURE__ */ s(Ce, { size: 16 })
|
|
2322
2330
|
})
|
|
2323
2331
|
]
|
|
2324
2332
|
}),
|
|
2325
2333
|
/* @__PURE__ */ s("div", {
|
|
2326
|
-
ref:
|
|
2334
|
+
ref: C,
|
|
2327
2335
|
style: {
|
|
2328
2336
|
display: "flex",
|
|
2329
2337
|
flexDirection: "column",
|
|
2330
2338
|
gap: 7,
|
|
2331
2339
|
padding: 12,
|
|
2332
|
-
background:
|
|
2333
|
-
|
|
2334
|
-
|
|
2335
|
-
minHeight: d ? 0 : void 0,
|
|
2340
|
+
background: b,
|
|
2341
|
+
flex: 1,
|
|
2342
|
+
minHeight: 0,
|
|
2336
2343
|
overflowY: "auto",
|
|
2337
2344
|
overscrollBehavior: "contain"
|
|
2338
2345
|
},
|
|
2339
|
-
children: /* @__PURE__ */ s(
|
|
2340
|
-
welcome:
|
|
2346
|
+
children: /* @__PURE__ */ s(Qe, {
|
|
2347
|
+
welcome: S,
|
|
2341
2348
|
chat: r,
|
|
2342
|
-
onDark:
|
|
2349
|
+
onDark: _,
|
|
2343
2350
|
look: n,
|
|
2344
2351
|
config: t
|
|
2345
2352
|
})
|
|
@@ -2350,16 +2357,16 @@ function Ee({ payload: e, config: t, look: n, chat: r, shadow: o, hint: i, focus
|
|
|
2350
2357
|
flexDirection: "column",
|
|
2351
2358
|
gap: 8,
|
|
2352
2359
|
padding: "0 12px 12px",
|
|
2353
|
-
background:
|
|
2360
|
+
background: b
|
|
2354
2361
|
},
|
|
2355
|
-
children: [/* @__PURE__ */ s(
|
|
2362
|
+
children: [/* @__PURE__ */ s(Jt, {
|
|
2356
2363
|
config: t,
|
|
2357
2364
|
look: n,
|
|
2358
2365
|
onClick: u
|
|
2359
|
-
}), /* @__PURE__ */ s(
|
|
2366
|
+
}), /* @__PURE__ */ s(Zt, {
|
|
2360
2367
|
config: t,
|
|
2361
2368
|
look: n,
|
|
2362
|
-
onDark:
|
|
2369
|
+
onDark: _,
|
|
2363
2370
|
hint: i,
|
|
2364
2371
|
chat: r,
|
|
2365
2372
|
disabled: !w,
|
|
@@ -2369,17 +2376,17 @@ function Ee({ payload: e, config: t, look: n, chat: r, shadow: o, hint: i, focus
|
|
|
2369
2376
|
]
|
|
2370
2377
|
});
|
|
2371
2378
|
}
|
|
2372
|
-
function
|
|
2379
|
+
function cr({ payload: e, look: t, api: n, embed: r, page: o, reporter: i, open: a, setOpen: u, pinned: d, focus: c }) {
|
|
2373
2380
|
var f;
|
|
2374
|
-
const h = e.config, l =
|
|
2375
|
-
var
|
|
2381
|
+
const h = e.config, l = tr(n, e, r, o), p = Kt(h), { accentFill: m, accentText: x, rad: b, side: _, offsetY: g } = t, y = nr(), $ = !!(!((f = e.agent) === null || f === void 0) && f.live), q = Je(h), z = () => {
|
|
2382
|
+
var C, w;
|
|
2376
2383
|
return i.report("cta.clicked", {
|
|
2377
2384
|
widgetId: e.id,
|
|
2378
|
-
sessionId: (
|
|
2379
|
-
payload: { href: (
|
|
2385
|
+
sessionId: (C = l.sessionId) !== null && C !== void 0 ? C : void 0,
|
|
2386
|
+
payload: { href: (w = h.cta) === null || w === void 0 ? void 0 : w.href }
|
|
2380
2387
|
});
|
|
2381
2388
|
};
|
|
2382
|
-
if (t.isMessenger) return /* @__PURE__ */ s(
|
|
2389
|
+
if (t.isMessenger) return /* @__PURE__ */ s(sr, {
|
|
2383
2390
|
payload: e,
|
|
2384
2391
|
config: h,
|
|
2385
2392
|
look: t,
|
|
@@ -2389,14 +2396,15 @@ function lr({ payload: e, look: t, api: n, embed: r, page: o, reporter: i, open:
|
|
|
2389
2396
|
open: a,
|
|
2390
2397
|
setOpen: u,
|
|
2391
2398
|
pinned: d,
|
|
2392
|
-
onCta:
|
|
2399
|
+
onCta: z
|
|
2393
2400
|
});
|
|
2394
|
-
if (h.variant === "bubble")
|
|
2395
|
-
|
|
2401
|
+
if (h.variant === "bubble") {
|
|
2402
|
+
const C = g + K.launcherSize + K.panelGap;
|
|
2403
|
+
return a && y ? /* @__PURE__ */ s(Gt, {
|
|
2396
2404
|
look: t,
|
|
2397
2405
|
pinned: d,
|
|
2398
2406
|
onClose: () => u(!1),
|
|
2399
|
-
children: /* @__PURE__ */ s(
|
|
2407
|
+
children: /* @__PURE__ */ s(Pe, {
|
|
2400
2408
|
payload: e,
|
|
2401
2409
|
config: h,
|
|
2402
2410
|
look: t,
|
|
@@ -2404,18 +2412,18 @@ function lr({ payload: e, look: t, api: n, embed: r, page: o, reporter: i, open:
|
|
|
2404
2412
|
shadow: !1,
|
|
2405
2413
|
hint: p,
|
|
2406
2414
|
focus: c,
|
|
2407
|
-
onCta:
|
|
2415
|
+
onCta: z,
|
|
2408
2416
|
fill: !0,
|
|
2409
2417
|
onClose: d ? void 0 : () => u(!1)
|
|
2410
2418
|
})
|
|
2411
|
-
}) : /* @__PURE__ */ s(
|
|
2419
|
+
}) : /* @__PURE__ */ s(Y, { children: [a && /* @__PURE__ */ s("div", {
|
|
2412
2420
|
class: "uq-fixed uq-rise",
|
|
2413
2421
|
style: {
|
|
2414
|
-
bottom:
|
|
2415
|
-
width:
|
|
2422
|
+
bottom: C,
|
|
2423
|
+
width: K.panelWidth,
|
|
2416
2424
|
..._
|
|
2417
2425
|
},
|
|
2418
|
-
children: /* @__PURE__ */ s(
|
|
2426
|
+
children: /* @__PURE__ */ s(Pe, {
|
|
2419
2427
|
payload: e,
|
|
2420
2428
|
config: h,
|
|
2421
2429
|
look: t,
|
|
@@ -2423,7 +2431,8 @@ function lr({ payload: e, look: t, api: n, embed: r, page: o, reporter: i, open:
|
|
|
2423
2431
|
shadow: !0,
|
|
2424
2432
|
hint: p,
|
|
2425
2433
|
focus: c,
|
|
2426
|
-
onCta:
|
|
2434
|
+
onCta: z,
|
|
2435
|
+
maxHeight: `calc(100vh - ${C + 12}px)`
|
|
2427
2436
|
})
|
|
2428
2437
|
}), /* @__PURE__ */ s("button", {
|
|
2429
2438
|
type: "button",
|
|
@@ -2435,9 +2444,9 @@ function lr({ payload: e, look: t, api: n, embed: r, page: o, reporter: i, open:
|
|
|
2435
2444
|
},
|
|
2436
2445
|
style: {
|
|
2437
2446
|
bottom: g,
|
|
2438
|
-
width:
|
|
2439
|
-
height:
|
|
2440
|
-
borderRadius: Math.min(
|
|
2447
|
+
width: K.launcherSize,
|
|
2448
|
+
height: K.launcherSize,
|
|
2449
|
+
borderRadius: Math.min(K.launcherSize / 2, b * 2),
|
|
2441
2450
|
background: m,
|
|
2442
2451
|
color: x,
|
|
2443
2452
|
display: "flex",
|
|
@@ -2446,11 +2455,12 @@ function lr({ payload: e, look: t, api: n, embed: r, page: o, reporter: i, open:
|
|
|
2446
2455
|
boxShadow: "0 10px 26px rgba(0,0,0,.24)",
|
|
2447
2456
|
..._
|
|
2448
2457
|
},
|
|
2449
|
-
children: /* @__PURE__ */ s(
|
|
2458
|
+
children: /* @__PURE__ */ s(Ot, { size: 20 })
|
|
2450
2459
|
})] });
|
|
2460
|
+
}
|
|
2451
2461
|
if (h.variant === "box") return /* @__PURE__ */ s("div", {
|
|
2452
2462
|
class: "uq-inline",
|
|
2453
|
-
children: /* @__PURE__ */ s(
|
|
2463
|
+
children: /* @__PURE__ */ s(Pe, {
|
|
2454
2464
|
payload: e,
|
|
2455
2465
|
config: h,
|
|
2456
2466
|
look: t,
|
|
@@ -2458,10 +2468,10 @@ function lr({ payload: e, look: t, api: n, embed: r, page: o, reporter: i, open:
|
|
|
2458
2468
|
shadow: !1,
|
|
2459
2469
|
hint: p,
|
|
2460
2470
|
focus: c,
|
|
2461
|
-
onCta:
|
|
2471
|
+
onCta: z
|
|
2462
2472
|
})
|
|
2463
2473
|
});
|
|
2464
|
-
const
|
|
2474
|
+
const S = {
|
|
2465
2475
|
payload: e,
|
|
2466
2476
|
config: h,
|
|
2467
2477
|
look: t,
|
|
@@ -2470,13 +2480,13 @@ function lr({ payload: e, look: t, api: n, embed: r, page: o, reporter: i, open:
|
|
|
2470
2480
|
mobile: y,
|
|
2471
2481
|
focus: c,
|
|
2472
2482
|
live: $,
|
|
2473
|
-
welcome:
|
|
2474
|
-
onCta:
|
|
2483
|
+
welcome: q,
|
|
2484
|
+
onCta: z
|
|
2475
2485
|
};
|
|
2476
|
-
return h.variant === "chatbar" ? /* @__PURE__ */ s(
|
|
2486
|
+
return h.variant === "chatbar" ? /* @__PURE__ */ s(ur, { ...S }) : /* @__PURE__ */ s(dr, { ...S });
|
|
2477
2487
|
}
|
|
2478
|
-
function
|
|
2479
|
-
const { ink: d, hostDark: c, accentFill: f, accentText: h, rad: l } = t, p =
|
|
2488
|
+
function ur({ config: e, look: t, chat: n, hint: r, mobile: o, focus: i, live: a, welcome: u }) {
|
|
2489
|
+
const { ink: d, hostDark: c, accentFill: f, accentText: h, rad: l } = t, p = qe([
|
|
2480
2490
|
n.turns,
|
|
2481
2491
|
n.busy,
|
|
2482
2492
|
n.error,
|
|
@@ -2505,7 +2515,7 @@ function cr({ config: e, look: t, chat: n, hint: r, mobile: o, focus: i, live: a
|
|
|
2505
2515
|
maxHeight: "min(50vh, 320px)",
|
|
2506
2516
|
overflowY: "auto"
|
|
2507
2517
|
},
|
|
2508
|
-
children: /* @__PURE__ */ s(
|
|
2518
|
+
children: /* @__PURE__ */ s(Qe, {
|
|
2509
2519
|
welcome: u,
|
|
2510
2520
|
chat: n,
|
|
2511
2521
|
onDark: c,
|
|
@@ -2532,7 +2542,7 @@ function cr({ config: e, look: t, chat: n, hint: r, mobile: o, focus: i, live: a
|
|
|
2532
2542
|
justifyContent: "center",
|
|
2533
2543
|
flexShrink: 0
|
|
2534
2544
|
},
|
|
2535
|
-
children: /* @__PURE__ */ s(
|
|
2545
|
+
children: /* @__PURE__ */ s(Ot, { size: 14 })
|
|
2536
2546
|
}),
|
|
2537
2547
|
/* @__PURE__ */ s("span", {
|
|
2538
2548
|
class: k(e, "botMessage"),
|
|
@@ -2549,9 +2559,9 @@ function cr({ config: e, look: t, chat: n, hint: r, mobile: o, focus: i, live: a
|
|
|
2549
2559
|
}),
|
|
2550
2560
|
/* @__PURE__ */ s("form", {
|
|
2551
2561
|
class: k(e, "composer"),
|
|
2552
|
-
onSubmit: (
|
|
2553
|
-
|
|
2554
|
-
const _ =
|
|
2562
|
+
onSubmit: (b) => {
|
|
2563
|
+
b.preventDefault();
|
|
2564
|
+
const _ = b.currentTarget.elements.namedItem("message");
|
|
2555
2565
|
!_ || x || (n.send(_.value), _.value = "");
|
|
2556
2566
|
},
|
|
2557
2567
|
style: {
|
|
@@ -2573,8 +2583,8 @@ function cr({ config: e, look: t, chat: n, hint: r, mobile: o, focus: i, live: a
|
|
|
2573
2583
|
maxLength: 4e3,
|
|
2574
2584
|
"aria-label": "Message",
|
|
2575
2585
|
autoComplete: "off",
|
|
2576
|
-
ref: (
|
|
2577
|
-
|
|
2586
|
+
ref: (b) => {
|
|
2587
|
+
b && i > 0 && b.focus();
|
|
2578
2588
|
},
|
|
2579
2589
|
style: {
|
|
2580
2590
|
flex: 1,
|
|
@@ -2583,7 +2593,7 @@ function cr({ config: e, look: t, chat: n, hint: r, mobile: o, focus: i, live: a
|
|
|
2583
2593
|
"--uq-placeholder": `rgba(${d},.45)`
|
|
2584
2594
|
}
|
|
2585
2595
|
}),
|
|
2586
|
-
/* @__PURE__ */ s(
|
|
2596
|
+
/* @__PURE__ */ s(Xt, {
|
|
2587
2597
|
config: e,
|
|
2588
2598
|
look: t,
|
|
2589
2599
|
onDark: c,
|
|
@@ -2612,7 +2622,7 @@ function cr({ config: e, look: t, chat: n, hint: r, mobile: o, focus: i, live: a
|
|
|
2612
2622
|
height: 7,
|
|
2613
2623
|
background: "currentColor",
|
|
2614
2624
|
borderRadius: 1
|
|
2615
|
-
} }) : /* @__PURE__ */ s(
|
|
2625
|
+
} }) : /* @__PURE__ */ s(Ut, { size: 12 })
|
|
2616
2626
|
})
|
|
2617
2627
|
]
|
|
2618
2628
|
})
|
|
@@ -2620,8 +2630,8 @@ function cr({ config: e, look: t, chat: n, hint: r, mobile: o, focus: i, live: a
|
|
|
2620
2630
|
})]
|
|
2621
2631
|
});
|
|
2622
2632
|
}
|
|
2623
|
-
function
|
|
2624
|
-
const { hostDark: c, side: f, offsetY: h } = t, l = c, p =
|
|
2633
|
+
function dr({ config: e, look: t, chat: n, hint: r, mobile: o, focus: i, live: a, welcome: u, onCta: d }) {
|
|
2634
|
+
const { hostDark: c, side: f, offsetY: h } = t, l = c, p = qe([
|
|
2625
2635
|
n.turns,
|
|
2626
2636
|
n.busy,
|
|
2627
2637
|
n.error,
|
|
@@ -2647,7 +2657,7 @@ function ur({ config: e, look: t, chat: n, hint: r, mobile: o, focus: i, live: a
|
|
|
2647
2657
|
maxHeight: "min(60vh, 420px)",
|
|
2648
2658
|
overflowY: "auto"
|
|
2649
2659
|
},
|
|
2650
|
-
children: /* @__PURE__ */ s(
|
|
2660
|
+
children: /* @__PURE__ */ s(Qe, {
|
|
2651
2661
|
welcome: u,
|
|
2652
2662
|
chat: n,
|
|
2653
2663
|
onDark: l,
|
|
@@ -2655,12 +2665,12 @@ function ur({ config: e, look: t, chat: n, hint: r, mobile: o, focus: i, live: a
|
|
|
2655
2665
|
config: e
|
|
2656
2666
|
})
|
|
2657
2667
|
}),
|
|
2658
|
-
/* @__PURE__ */ s(
|
|
2668
|
+
/* @__PURE__ */ s(Jt, {
|
|
2659
2669
|
config: e,
|
|
2660
2670
|
look: t,
|
|
2661
2671
|
onClick: d
|
|
2662
2672
|
}),
|
|
2663
|
-
/* @__PURE__ */ s(
|
|
2673
|
+
/* @__PURE__ */ s(Zt, {
|
|
2664
2674
|
config: e,
|
|
2665
2675
|
look: t,
|
|
2666
2676
|
onDark: l,
|
|
@@ -2673,8 +2683,8 @@ function ur({ config: e, look: t, chat: n, hint: r, mobile: o, focus: i, live: a
|
|
|
2673
2683
|
]
|
|
2674
2684
|
});
|
|
2675
2685
|
}
|
|
2676
|
-
var
|
|
2677
|
-
function
|
|
2686
|
+
var fr = (e) => /^https?:\/\//i.test(e);
|
|
2687
|
+
function pr({ config: e, block: t, index: n, look: r, onCta: o }) {
|
|
2678
2688
|
const { ink: i, accent: a, accentFill: u, accentText: d, rad: c } = r, f = [
|
|
2679
2689
|
"uq-block",
|
|
2680
2690
|
`uq-block-${t.kind}`,
|
|
@@ -2710,7 +2720,7 @@ function fr({ config: e, block: t, index: n, look: r, onCta: o }) {
|
|
|
2710
2720
|
children: t.text
|
|
2711
2721
|
});
|
|
2712
2722
|
case "media":
|
|
2713
|
-
return !t.src || !
|
|
2723
|
+
return !t.src || !fr(t.src) ? null : t.mediaType === "video" ? /* @__PURE__ */ s("video", {
|
|
2714
2724
|
...l,
|
|
2715
2725
|
src: t.src,
|
|
2716
2726
|
muted: !0,
|
|
@@ -2783,7 +2793,7 @@ function fr({ config: e, block: t, index: n, look: r, onCta: o }) {
|
|
|
2783
2793
|
});
|
|
2784
2794
|
}
|
|
2785
2795
|
}
|
|
2786
|
-
function
|
|
2796
|
+
function hr({ payload: e, look: t, reporter: n, open: r, setOpen: o, pinned: i }) {
|
|
2787
2797
|
const a = e.config, { ink: u, surfaceBg: d, rad: c } = t;
|
|
2788
2798
|
if (!r) return null;
|
|
2789
2799
|
const f = () => {
|
|
@@ -2841,8 +2851,8 @@ function pr({ payload: e, look: t, reporter: n, open: r, setOpen: o, pinned: i }
|
|
|
2841
2851
|
justifyContent: "center",
|
|
2842
2852
|
color: `rgba(${u},.55)`
|
|
2843
2853
|
},
|
|
2844
|
-
children: /* @__PURE__ */ s(
|
|
2845
|
-
}), a.blocks.map((l, p) => /* @__PURE__ */ s(
|
|
2854
|
+
children: /* @__PURE__ */ s(Ce, { size: 14 })
|
|
2855
|
+
}), a.blocks.map((l, p) => /* @__PURE__ */ s(pr, {
|
|
2846
2856
|
config: a,
|
|
2847
2857
|
block: l,
|
|
2848
2858
|
index: p,
|
|
@@ -2852,12 +2862,12 @@ function pr({ payload: e, look: t, reporter: n, open: r, setOpen: o, pinned: i }
|
|
|
2852
2862
|
})
|
|
2853
2863
|
});
|
|
2854
2864
|
}
|
|
2855
|
-
var
|
|
2856
|
-
function
|
|
2865
|
+
var _r = 3600;
|
|
2866
|
+
function gr({ payload: e, look: t, open: n }) {
|
|
2857
2867
|
const r = e.config, { ink: o, accent: i, surfaceBg: a, rad: u } = t, d = r.quotes, [c, f] = E(0);
|
|
2858
2868
|
if (P(() => {
|
|
2859
2869
|
if (d.length < 2) return;
|
|
2860
|
-
const p = window.setInterval(() => f((m) => m + 1),
|
|
2870
|
+
const p = window.setInterval(() => f((m) => m + 1), _r);
|
|
2861
2871
|
return () => window.clearInterval(p);
|
|
2862
2872
|
}, [d.length]), !n || d.length === 0) return null;
|
|
2863
2873
|
const h = c % d.length, l = d[h];
|
|
@@ -2932,7 +2942,7 @@ function _r({ payload: e, look: t, open: n }) {
|
|
|
2932
2942
|
})
|
|
2933
2943
|
});
|
|
2934
2944
|
}
|
|
2935
|
-
function
|
|
2945
|
+
function mr(e) {
|
|
2936
2946
|
switch (e.config.type) {
|
|
2937
2947
|
case "chat":
|
|
2938
2948
|
case "exit-popup":
|
|
@@ -2942,7 +2952,7 @@ function gr(e) {
|
|
|
2942
2952
|
return !0;
|
|
2943
2953
|
}
|
|
2944
2954
|
}
|
|
2945
|
-
function
|
|
2955
|
+
function br(e) {
|
|
2946
2956
|
return e.rules.length > 0 || e.config.type !== "exit-popup" ? e.rules : [{
|
|
2947
2957
|
id: `default:${e.id}`,
|
|
2948
2958
|
trigger: "exit_intent",
|
|
@@ -2956,20 +2966,20 @@ function mr(e) {
|
|
|
2956
2966
|
}
|
|
2957
2967
|
}];
|
|
2958
2968
|
}
|
|
2959
|
-
function
|
|
2960
|
-
const u =
|
|
2961
|
-
l(
|
|
2962
|
-
}, y = ({ autoStart:
|
|
2963
|
-
f(!0), m(
|
|
2969
|
+
function Qt({ payload: e, api: t, embed: n, page: r, reporter: o, hostDark: i, kick: a = null }) {
|
|
2970
|
+
const u = ye(() => Dn(e.config, i), [e, i]), d = ye(() => br(e), [e]), [c, f] = E(d.length === 0), [h, l] = E(() => d.length === 0 && mr(e)), [p, m] = E(!1), [x, b] = E(0), _ = D(h), g = (q) => {
|
|
2971
|
+
l(q), q !== _.current && (_.current = q, o.report(q ? "surface.opened" : "surface.closed", { widgetId: e.id }));
|
|
2972
|
+
}, y = ({ autoStart: q, pinned: z }) => {
|
|
2973
|
+
f(!0), m(z), g(!0), q && b((S) => S + 1);
|
|
2964
2974
|
};
|
|
2965
|
-
if (P(() =>
|
|
2975
|
+
if (P(() => Dt(d, r, (q) => {
|
|
2966
2976
|
o.report("rule.fired", {
|
|
2967
2977
|
widgetId: e.id,
|
|
2968
2978
|
payload: {
|
|
2969
|
-
ruleId:
|
|
2970
|
-
trigger:
|
|
2979
|
+
ruleId: q.id,
|
|
2980
|
+
trigger: q.trigger
|
|
2971
2981
|
}
|
|
2972
|
-
}), y(
|
|
2982
|
+
}), y(q.actionConfig);
|
|
2973
2983
|
}), [e.id]), P(() => {
|
|
2974
2984
|
a && y(a.action);
|
|
2975
2985
|
}, [a]), !c) return null;
|
|
@@ -2987,16 +2997,16 @@ function Zt({ payload: e, api: t, embed: n, page: r, reporter: o, hostDark: i, k
|
|
|
2987
2997
|
};
|
|
2988
2998
|
switch (e.config.type) {
|
|
2989
2999
|
case "chat":
|
|
2990
|
-
return /* @__PURE__ */ s(
|
|
3000
|
+
return /* @__PURE__ */ s(cr, { ...$ });
|
|
2991
3001
|
case "exit-popup":
|
|
2992
|
-
return /* @__PURE__ */ s(
|
|
3002
|
+
return /* @__PURE__ */ s(hr, { ...$ });
|
|
2993
3003
|
case "banner":
|
|
2994
|
-
return /* @__PURE__ */ s(
|
|
3004
|
+
return /* @__PURE__ */ s(Vn, { ...$ });
|
|
2995
3005
|
case "testimonial":
|
|
2996
|
-
return /* @__PURE__ */ s(
|
|
3006
|
+
return /* @__PURE__ */ s(gr, { ...$ });
|
|
2997
3007
|
}
|
|
2998
3008
|
}
|
|
2999
|
-
function
|
|
3009
|
+
function vr(e) {
|
|
3000
3010
|
const t = [], n = e.config.appearance.customCss.trim();
|
|
3001
3011
|
return n && t.push(n), e.config.type === "exit-popup" && e.config.blocks.forEach((r, o) => {
|
|
3002
3012
|
const i = r.css.trim();
|
|
@@ -3004,18 +3014,18 @@ function br(e) {
|
|
|
3004
3014
|
}), t.join(`
|
|
3005
3015
|
`);
|
|
3006
3016
|
}
|
|
3007
|
-
function
|
|
3017
|
+
function yr(e) {
|
|
3008
3018
|
return e.kind === "widget" ? [e.payload] : e.payload.members.map((t) => t.widget);
|
|
3009
3019
|
}
|
|
3010
|
-
var
|
|
3020
|
+
var xr = {
|
|
3011
3021
|
report: () => {
|
|
3012
3022
|
},
|
|
3013
3023
|
flush: () => {
|
|
3014
3024
|
}
|
|
3015
3025
|
};
|
|
3016
|
-
function
|
|
3017
|
-
const [n, r] = E(e.rules.length === 0), [o, i] = E(null), [a, u] = E(() =>
|
|
3018
|
-
return P(() =>
|
|
3026
|
+
function wr({ group: e, ...t }) {
|
|
3027
|
+
const [n, r] = E(e.rules.length === 0), [o, i] = E(null), [a, u] = E(() => En(e));
|
|
3028
|
+
return P(() => Dt(e.rules, t.page, (d) => {
|
|
3019
3029
|
t.reporter.report("rule.fired", { payload: {
|
|
3020
3030
|
ruleId: d.id,
|
|
3021
3031
|
trigger: d.trigger
|
|
@@ -3028,7 +3038,7 @@ function xr({ group: e, ...t }) {
|
|
|
3028
3038
|
});
|
|
3029
3039
|
}), [e.id]), P(() => {
|
|
3030
3040
|
if (e.mode !== "sequence" || !n) return;
|
|
3031
|
-
const d =
|
|
3041
|
+
const d = Lt(e);
|
|
3032
3042
|
if (d)
|
|
3033
3043
|
return Rn(e, d, (c) => u(c ? [c.widget] : []));
|
|
3034
3044
|
}, [
|
|
@@ -3036,47 +3046,47 @@ function xr({ group: e, ...t }) {
|
|
|
3036
3046
|
e.mode,
|
|
3037
3047
|
n,
|
|
3038
3048
|
a
|
|
3039
|
-
]), n ? /* @__PURE__ */ s(
|
|
3049
|
+
]), n ? /* @__PURE__ */ s(Y, { children: a.map((d) => /* @__PURE__ */ s("div", {
|
|
3040
3050
|
"data-uq-widget": d.id,
|
|
3041
3051
|
style: "display:contents",
|
|
3042
|
-
children: /* @__PURE__ */ s(
|
|
3052
|
+
children: /* @__PURE__ */ s(Qt, {
|
|
3043
3053
|
payload: d,
|
|
3044
3054
|
kick: o,
|
|
3045
3055
|
...t
|
|
3046
3056
|
})
|
|
3047
3057
|
}, d.id)) }) : null;
|
|
3048
3058
|
}
|
|
3049
|
-
function
|
|
3059
|
+
function Sr({ snapshot: e, ...t }) {
|
|
3050
3060
|
const n = {
|
|
3051
3061
|
kind: e.kind,
|
|
3052
3062
|
id: e.payload.id
|
|
3053
3063
|
};
|
|
3054
|
-
return e.kind === "group" ? /* @__PURE__ */ s(
|
|
3064
|
+
return e.kind === "group" ? /* @__PURE__ */ s(wr, {
|
|
3055
3065
|
group: e.payload,
|
|
3056
3066
|
embed: n,
|
|
3057
3067
|
...t
|
|
3058
3068
|
}) : /* @__PURE__ */ s("div", {
|
|
3059
3069
|
"data-uq-widget": e.payload.id,
|
|
3060
3070
|
style: "display:contents",
|
|
3061
|
-
children: /* @__PURE__ */ s(
|
|
3071
|
+
children: /* @__PURE__ */ s(Qt, {
|
|
3062
3072
|
payload: e.payload,
|
|
3063
3073
|
embed: n,
|
|
3064
3074
|
...t
|
|
3065
3075
|
})
|
|
3066
3076
|
});
|
|
3067
3077
|
}
|
|
3068
|
-
function
|
|
3078
|
+
function kr(e, t, n = {}) {
|
|
3069
3079
|
var r, o, i;
|
|
3070
3080
|
const a = (r = t.shadowRoot) !== null && r !== void 0 ? r : t.attachShadow({ mode: "open" }), u = { base: ((o = n.apiUrl) !== null && o !== void 0 ? o : "https://api.usereq.com").replace(/\/+$/, "") }, d = {
|
|
3071
3081
|
kind: e.kind,
|
|
3072
3082
|
id: e.payload.id
|
|
3073
|
-
}, c = n.silent ?
|
|
3083
|
+
}, c = n.silent ? xr : Tn(u, d), f = Pn((i = n.theme) !== null && i !== void 0 ? i : null), h = jn(), l = document.createElement("style");
|
|
3074
3084
|
a.appendChild(l);
|
|
3075
3085
|
const p = document.createElement("div");
|
|
3076
3086
|
p.setAttribute("data-uq-root", ""), p.style.display = "contents", a.appendChild(p);
|
|
3077
3087
|
const m = (x) => {
|
|
3078
|
-
l.textContent = [
|
|
3079
|
-
`),
|
|
3088
|
+
l.textContent = [$n, ...yr(x).map(vr)].join(`
|
|
3089
|
+
`), ot(/* @__PURE__ */ s(Sr, {
|
|
3080
3090
|
snapshot: x,
|
|
3081
3091
|
api: u,
|
|
3082
3092
|
page: h,
|
|
@@ -3087,30 +3097,30 @@ function Sr(e, t, n = {}) {
|
|
|
3087
3097
|
return m(e), c.report("embed.loaded", { payload: { version: e.payload.version } }), {
|
|
3088
3098
|
update: m,
|
|
3089
3099
|
unmount: () => {
|
|
3090
|
-
|
|
3100
|
+
ot(null, p), c.flush(), l.remove(), p.remove();
|
|
3091
3101
|
}
|
|
3092
3102
|
};
|
|
3093
3103
|
}
|
|
3094
|
-
function
|
|
3104
|
+
function en(e, t) {
|
|
3095
3105
|
if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object");
|
|
3096
3106
|
}
|
|
3097
|
-
function
|
|
3098
|
-
|
|
3107
|
+
function $r(e, t) {
|
|
3108
|
+
en(e, t), t.add(e);
|
|
3099
3109
|
}
|
|
3100
|
-
function
|
|
3101
|
-
|
|
3110
|
+
function vt(e, t, n) {
|
|
3111
|
+
en(e, t), t.set(e, n);
|
|
3102
3112
|
}
|
|
3103
|
-
function
|
|
3113
|
+
function we(e, t, n) {
|
|
3104
3114
|
if (typeof e == "function" ? e === t : e.has(t)) return arguments.length < 3 ? t : n;
|
|
3105
3115
|
throw new TypeError("Private element is not present on this object");
|
|
3106
3116
|
}
|
|
3107
|
-
function
|
|
3108
|
-
return e.get(
|
|
3117
|
+
function de(e, t) {
|
|
3118
|
+
return e.get(we(e, t));
|
|
3109
3119
|
}
|
|
3110
|
-
function
|
|
3111
|
-
return e.set(
|
|
3120
|
+
function fe(e, t, n) {
|
|
3121
|
+
return e.set(we(e, t), n), n;
|
|
3112
3122
|
}
|
|
3113
|
-
var
|
|
3123
|
+
var Cr = {
|
|
3114
3124
|
widget: {
|
|
3115
3125
|
element: "usereq-widget",
|
|
3116
3126
|
attribute: "widget-id"
|
|
@@ -3120,66 +3130,66 @@ var $r = {
|
|
|
3120
3130
|
attribute: "group-id"
|
|
3121
3131
|
}
|
|
3122
3132
|
};
|
|
3123
|
-
function
|
|
3133
|
+
function Fe(e) {
|
|
3124
3134
|
console.warn(`[usereq] ${e}`);
|
|
3125
3135
|
}
|
|
3126
|
-
function
|
|
3127
|
-
const { element: t, attribute: n } =
|
|
3136
|
+
function yt(e) {
|
|
3137
|
+
const { element: t, attribute: n } = Cr[e];
|
|
3128
3138
|
if (customElements.get(t)) return;
|
|
3129
3139
|
var r = /* @__PURE__ */ new WeakMap(), o = /* @__PURE__ */ new WeakMap(), i = /* @__PURE__ */ new WeakSet();
|
|
3130
3140
|
class a extends HTMLElement {
|
|
3131
3141
|
constructor(...c) {
|
|
3132
|
-
super(...c),
|
|
3142
|
+
super(...c), $r(this, i), vt(this, r, null), vt(this, o, 0);
|
|
3133
3143
|
}
|
|
3134
3144
|
connectedCallback() {
|
|
3135
|
-
|
|
3145
|
+
we(i, this, u).call(this);
|
|
3136
3146
|
}
|
|
3137
3147
|
disconnectedCallback() {
|
|
3138
3148
|
var c;
|
|
3139
|
-
(c =
|
|
3149
|
+
(c = de(r, this)) === null || c === void 0 || c.unmount(), fe(r, this, null);
|
|
3140
3150
|
}
|
|
3141
3151
|
attributeChangedCallback(c, f, h) {
|
|
3142
|
-
f !== h && this.isConnected &&
|
|
3152
|
+
f !== h && this.isConnected && we(i, this, u).call(this);
|
|
3143
3153
|
}
|
|
3144
3154
|
}
|
|
3145
3155
|
async function u() {
|
|
3146
3156
|
var d, c, f, h;
|
|
3147
3157
|
const l = (d = this.getAttribute(n)) === null || d === void 0 ? void 0 : d.trim();
|
|
3148
3158
|
if (!l) return;
|
|
3149
|
-
const p =
|
|
3150
|
-
(f =
|
|
3151
|
-
const m = ((h = this.getAttribute("api-url")) !== null && h !== void 0 ? h : "https://api.usereq.com").replace(/\/+$/, ""), x = this.getAttribute("theme"),
|
|
3159
|
+
const p = fe(o, this, (c = de(o, this), ++c));
|
|
3160
|
+
(f = de(r, this)) === null || f === void 0 || f.unmount(), fe(r, this, null);
|
|
3161
|
+
const m = ((h = this.getAttribute("api-url")) !== null && h !== void 0 ? h : "https://api.usereq.com").replace(/\/+$/, ""), x = this.getAttribute("theme"), b = x === "light" || x === "dark" ? x : null;
|
|
3152
3162
|
let _;
|
|
3153
3163
|
try {
|
|
3154
|
-
const g = await
|
|
3155
|
-
_ =
|
|
3164
|
+
const g = await on({ base: m }, e, l);
|
|
3165
|
+
_ = fn(g, e);
|
|
3156
3166
|
} catch (g) {
|
|
3157
|
-
g instanceof
|
|
3167
|
+
g instanceof V ? Fe(`${t} ${l}: ${g.message} (${g.code})`) : Fe(`${t} ${l}: could not reach ${m}.`);
|
|
3158
3168
|
return;
|
|
3159
3169
|
}
|
|
3160
|
-
if (!(p !==
|
|
3170
|
+
if (!(p !== de(o, this) || !this.isConnected)) {
|
|
3161
3171
|
if (!_) {
|
|
3162
|
-
|
|
3172
|
+
Fe(`${t} ${l}: the response was not a ${e} snapshot.`);
|
|
3163
3173
|
return;
|
|
3164
3174
|
}
|
|
3165
|
-
|
|
3175
|
+
fe(r, this, kr(_, this, {
|
|
3166
3176
|
apiUrl: m,
|
|
3167
|
-
theme:
|
|
3177
|
+
theme: b
|
|
3168
3178
|
}));
|
|
3169
3179
|
}
|
|
3170
3180
|
}
|
|
3171
|
-
|
|
3181
|
+
je(a, "observedAttributes", [
|
|
3172
3182
|
n,
|
|
3173
3183
|
"api-url",
|
|
3174
3184
|
"theme"
|
|
3175
3185
|
]), customElements.define(t, a);
|
|
3176
3186
|
}
|
|
3177
|
-
function
|
|
3178
|
-
|
|
3187
|
+
function qr() {
|
|
3188
|
+
yt("widget"), yt("group");
|
|
3179
3189
|
}
|
|
3180
|
-
|
|
3190
|
+
qr();
|
|
3181
3191
|
export {
|
|
3182
|
-
|
|
3192
|
+
kr as render
|
|
3183
3193
|
};
|
|
3184
3194
|
|
|
3185
3195
|
//# sourceMappingURL=embed.mjs.map
|