@chatsystem/client 2.0.0 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +33 -0
- package/dist/index.cjs +16 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +121 -106
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -1
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as S, jsxs as ne, Fragment as Ct } from "react/jsx-runtime";
|
|
2
2
|
import * as et from "react";
|
|
3
|
-
import We, { useState as ae, useEffect as Ee, useMemo as Ft, createContext as Tn, useContext as Ge, useRef as
|
|
3
|
+
import We, { useState as ae, useEffect as Ee, useMemo as Ft, createContext as Tn, useContext as Ge, useRef as le, useCallback as ot, forwardRef as Hu, useImperativeHandle as Kd, useLayoutEffect as Jd, useId as Zd } from "react";
|
|
4
4
|
import Sr, { createPortal as ef } from "react-dom";
|
|
5
5
|
import tf from "lottie-react";
|
|
6
6
|
import { DotLottieReact as nf } from "@lottiefiles/dotlottie-react";
|
|
@@ -203,13 +203,13 @@ function af() {
|
|
|
203
203
|
function ue(j) {
|
|
204
204
|
return D(j) === a;
|
|
205
205
|
}
|
|
206
|
-
function
|
|
206
|
+
function de(j) {
|
|
207
207
|
return D(j) === i;
|
|
208
208
|
}
|
|
209
209
|
function Le(j) {
|
|
210
210
|
return D(j) === f;
|
|
211
211
|
}
|
|
212
|
-
Me.AsyncMode = x, Me.ConcurrentMode = p, Me.ContextConsumer = O, Me.ContextProvider = M, Me.Element = Y, Me.ForwardRef = v, Me.Fragment = H, Me.Lazy = $, Me.Memo = V, Me.Portal = z, Me.Profiler = J, Me.StrictMode = me, Me.Suspense = re, Me.isAsyncMode = Re, Me.isConcurrentMode = b, Me.isContextConsumer = G, Me.isContextProvider = ie, Me.isElement = _, Me.isForwardRef = Z, Me.isFragment = ee, Me.isLazy = Q, Me.isMemo = se, Me.isPortal = oe, Me.isProfiler = ue, Me.isStrictMode =
|
|
212
|
+
Me.AsyncMode = x, Me.ConcurrentMode = p, Me.ContextConsumer = O, Me.ContextProvider = M, Me.Element = Y, Me.ForwardRef = v, Me.Fragment = H, Me.Lazy = $, Me.Memo = V, Me.Portal = z, Me.Profiler = J, Me.StrictMode = me, Me.Suspense = re, Me.isAsyncMode = Re, Me.isConcurrentMode = b, Me.isContextConsumer = G, Me.isContextProvider = ie, Me.isElement = _, Me.isForwardRef = Z, Me.isFragment = ee, Me.isLazy = Q, Me.isMemo = se, Me.isPortal = oe, Me.isProfiler = ue, Me.isStrictMode = de, Me.isSuspense = Le, Me.isValidElementType = k, Me.typeOf = D;
|
|
213
213
|
})()), Me;
|
|
214
214
|
}
|
|
215
215
|
var Bs;
|
|
@@ -3770,8 +3770,8 @@ const vh = {
|
|
|
3770
3770
|
"chatbot.interactiveWidget.cancelled": "Cancelled",
|
|
3771
3771
|
"chatbot.interactiveWidget.unavailable": "This interaction is no longer available.",
|
|
3772
3772
|
"chatbot.interactiveWidget.preview.notice": "Demo mode — this form reproduces the real experience. Submitting it does not create a request or transmit your answers.",
|
|
3773
|
-
"chatbot.interactiveWidget.preview.completed": "
|
|
3774
|
-
"chatbot.interactiveWidget.preview.cancelled": "
|
|
3773
|
+
"chatbot.interactiveWidget.preview.completed": "You have tested this form. No request was sent and your answers were not transmitted.",
|
|
3774
|
+
"chatbot.interactiveWidget.preview.cancelled": "You have closed the demo form. No information was transmitted."
|
|
3775
3775
|
}, kh = {
|
|
3776
3776
|
"generic.language.english": "Anglais",
|
|
3777
3777
|
"generic.language.french": "Français",
|
|
@@ -3830,8 +3830,8 @@ const vh = {
|
|
|
3830
3830
|
"chatbot.interactiveWidget.cancelled": "Annulé",
|
|
3831
3831
|
"chatbot.interactiveWidget.unavailable": "Cette interaction n’est plus disponible.",
|
|
3832
3832
|
"chatbot.interactiveWidget.preview.notice": "Mode démo — ce formulaire reproduit l’expérience réelle. Son envoi ne crée aucune demande et ne transmet pas vos réponses.",
|
|
3833
|
-
"chatbot.interactiveWidget.preview.completed": "
|
|
3834
|
-
"chatbot.interactiveWidget.preview.cancelled": "
|
|
3833
|
+
"chatbot.interactiveWidget.preview.completed": "Vous avez testé ce formulaire. Aucune demande n’a été envoyée et vos réponses n’ont pas été transmises.",
|
|
3834
|
+
"chatbot.interactiveWidget.preview.cancelled": "Vous avez fermé le formulaire de démonstration. Aucune information n’a été transmise."
|
|
3835
3835
|
};
|
|
3836
3836
|
var Tt = /* @__PURE__ */ ((e) => (e.FRENCH = "fr-FR", e.ENGLISH = "en-US", e))(Tt || {});
|
|
3837
3837
|
const ni = {
|
|
@@ -5729,11 +5729,11 @@ function dm({
|
|
|
5729
5729
|
() => rm(m)
|
|
5730
5730
|
), [k, D] = ae(null), [x, p] = ae("idle"), [O, M] = ae(
|
|
5731
5731
|
() => im(m)
|
|
5732
|
-
), Y =
|
|
5732
|
+
), Y = le(null), v = le(
|
|
5733
5733
|
d
|
|
5734
|
-
), H =
|
|
5734
|
+
), H = le(!1), $ = le(null), V = le(
|
|
5735
5735
|
sm(m)
|
|
5736
|
-
), z =
|
|
5736
|
+
), z = le(ts(m)), J = le(!1), me = le(0), re = le(null), Oe = h !== "ai", Re = g?.discussionId === n.discussionId, b = Oe && g?.status === "closed", G = Z0({
|
|
5737
5737
|
isCustomerSupportMode: Oe,
|
|
5738
5738
|
isClosed: b,
|
|
5739
5739
|
hasTransportFailed: I === "failed",
|
|
@@ -5762,7 +5762,7 @@ function dm({
|
|
|
5762
5762
|
isWaitingForFirstProviderReply: ie,
|
|
5763
5763
|
socketStatus: I,
|
|
5764
5764
|
state: g
|
|
5765
|
-
}),
|
|
5765
|
+
}), de = ue !== null;
|
|
5766
5766
|
Ee(() => {
|
|
5767
5767
|
if (r !== "notLoading" || n.items.length === 0) return;
|
|
5768
5768
|
const F = Re ? g : null;
|
|
@@ -6106,7 +6106,7 @@ function dm({
|
|
|
6106
6106
|
isCustomerSupportMode: Oe,
|
|
6107
6107
|
isCustomerSupportClosed: b,
|
|
6108
6108
|
customerSupportStatusMessage: G,
|
|
6109
|
-
isCustomerSupportInputDisabled:
|
|
6109
|
+
isCustomerSupportInputDisabled: de,
|
|
6110
6110
|
customerSupportInputDisabledReason: ue,
|
|
6111
6111
|
enterCustomerSupportMode: Ye,
|
|
6112
6112
|
flushPendingCustomerSupportHandoff: ht,
|
|
@@ -6218,7 +6218,7 @@ const mr = (e, t) => `chatsystem:interaction:v2:${e}:${t}`, mm = (e, t, n) => {
|
|
|
6218
6218
|
}), d = Cc({
|
|
6219
6219
|
appToken: t,
|
|
6220
6220
|
agentId: n
|
|
6221
|
-
}), f =
|
|
6221
|
+
}), f = le(null), m = le(s), h = le(/* @__PURE__ */ new Set()), T = le(null), g = le(null), A = le(/* @__PURE__ */ new Set()), I = le(/* @__PURE__ */ new Set()), w = le(null), k = le(null), D = le(null);
|
|
6222
6222
|
D.current || (D.current = new hm(r));
|
|
6223
6223
|
const x = D.current, [p, O] = ae(0);
|
|
6224
6224
|
(!f.current || m.current !== s) && (m.current = s, f.current = new _0(s)), Ee(() => {
|
|
@@ -6249,7 +6249,7 @@ const mr = (e, t) => `chatsystem:interaction:v2:${e}:${t}`, mm = (e, t, n) => {
|
|
|
6249
6249
|
updateInteractiveWidget: ee,
|
|
6250
6250
|
chatboxBootState: Q,
|
|
6251
6251
|
resetConversationRequestId: se
|
|
6252
|
-
} = ai(), [oe, ue] = ae("notLoading"), [
|
|
6252
|
+
} = ai(), [oe, ue] = ae("notLoading"), [de, Le] = ae(
|
|
6253
6253
|
null
|
|
6254
6254
|
), [j, De] = ae(
|
|
6255
6255
|
me
|
|
@@ -6290,7 +6290,7 @@ const mr = (e, t) => `chatsystem:interaction:v2:${e}:${t}`, mm = (e, t, n) => {
|
|
|
6290
6290
|
addMessageToCurrentConversation: b,
|
|
6291
6291
|
chatboxBootState: Q,
|
|
6292
6292
|
resetConversationRequestId: se
|
|
6293
|
-
}), it =
|
|
6293
|
+
}), it = le(
|
|
6294
6294
|
null
|
|
6295
6295
|
);
|
|
6296
6296
|
it.current || (it.current = new W0({
|
|
@@ -6321,7 +6321,7 @@ const mr = (e, t) => `chatsystem:interaction:v2:${e}:${t}`, mm = (e, t, n) => {
|
|
|
6321
6321
|
re.discussionId,
|
|
6322
6322
|
ht
|
|
6323
6323
|
]);
|
|
6324
|
-
const Ls =
|
|
6324
|
+
const Ls = le(
|
|
6325
6325
|
se
|
|
6326
6326
|
);
|
|
6327
6327
|
Ee(() => {
|
|
@@ -6629,7 +6629,7 @@ const mr = (e, t) => `chatsystem:interaction:v2:${e}:${t}`, mm = (e, t, n) => {
|
|
|
6629
6629
|
appToken: t,
|
|
6630
6630
|
agentId: n,
|
|
6631
6631
|
loadingStatus: oe,
|
|
6632
|
-
numberOfSteps:
|
|
6632
|
+
numberOfSteps: de,
|
|
6633
6633
|
currentStepName: j,
|
|
6634
6634
|
currentStepNumber: Qe,
|
|
6635
6635
|
isAtMaxMessages: at,
|
|
@@ -7085,7 +7085,7 @@ const Rm = Hu(function({
|
|
|
7085
7085
|
onEnd: O,
|
|
7086
7086
|
onFrame: M
|
|
7087
7087
|
}, Y) {
|
|
7088
|
-
const v = hr(), H =
|
|
7088
|
+
const v = hr(), H = le(null), $ = le(null), [V, z] = ae(null), [J, me] = ae(null), [re, Oe] = ae(null), [Re, b] = ae(!1), [G, ie] = ae(!!f), [_, Z] = ae(h), ee = le(1), [Q, se] = ae(null), oe = Math.max(
|
|
7089
7089
|
1,
|
|
7090
7090
|
Math.floor(typeof window < "u" && window.devicePixelRatio || 1)
|
|
7091
7091
|
);
|
|
@@ -7124,30 +7124,30 @@ const Rm = Hu(function({
|
|
|
7124
7124
|
Se = !0;
|
|
7125
7125
|
};
|
|
7126
7126
|
}, [V, c, n, r, i, a, v]);
|
|
7127
|
-
const ue = Q?.frameWidth ?? n,
|
|
7127
|
+
const ue = Q?.frameWidth ?? n, de = Q?.frameHeight ?? r, Le = Q?.columns ?? i, j = Q?.rows ?? a, De = Q?.gutterX ?? s, Qe = Q?.gutterY ?? o, nt = Q?.originX ?? D ?? 0, at = Q?.originY ?? x ?? 0, rt = Ft(() => {
|
|
7128
7128
|
if (c && c.length > 0) return { cols: 0, rows: 0 };
|
|
7129
|
-
if (!re || !ue || !
|
|
7129
|
+
if (!re || !ue || !de)
|
|
7130
7130
|
return { cols: 0, rows: 0 };
|
|
7131
|
-
const Se = Le ?? Math.floor((re.w + De) / (ue + De)), Be = j ?? Math.floor((re.h + Qe) / (
|
|
7131
|
+
const Se = Le ?? Math.floor((re.w + De) / (ue + De)), Be = j ?? Math.floor((re.h + Qe) / (de + Qe));
|
|
7132
7132
|
return { cols: Math.max(0, Se), rows: Math.max(0, Be) };
|
|
7133
7133
|
}, [
|
|
7134
7134
|
c,
|
|
7135
7135
|
re,
|
|
7136
7136
|
ue,
|
|
7137
|
-
|
|
7137
|
+
de,
|
|
7138
7138
|
Le,
|
|
7139
7139
|
j,
|
|
7140
7140
|
De,
|
|
7141
7141
|
Qe
|
|
7142
7142
|
]), Ye = Ft(() => {
|
|
7143
7143
|
if (c?.length) return c;
|
|
7144
|
-
if (!ue || !
|
|
7144
|
+
if (!ue || !de) return [];
|
|
7145
7145
|
const { cols: Se, rows: Be } = rt;
|
|
7146
7146
|
if (!Se || !Be) return [];
|
|
7147
7147
|
const ke = Math.min(u ?? Se * Be, Se * Be), F = [];
|
|
7148
7148
|
for (let N = 0; N < ke; N++) {
|
|
7149
|
-
const P = N % Se, K = Math.floor(N / Se), ce = nt + P * (ue + De), xe = at + K * (
|
|
7150
|
-
F.push({ x: ce, y: xe, w: ue, h:
|
|
7149
|
+
const P = N % Se, K = Math.floor(N / Se), ce = nt + P * (ue + De), xe = at + K * (de + Qe);
|
|
7150
|
+
F.push({ x: ce, y: xe, w: ue, h: de });
|
|
7151
7151
|
}
|
|
7152
7152
|
if (V && F.length) {
|
|
7153
7153
|
const N = document.createElement("canvas");
|
|
@@ -7173,7 +7173,7 @@ const Rm = Hu(function({
|
|
|
7173
7173
|
rt,
|
|
7174
7174
|
u,
|
|
7175
7175
|
ue,
|
|
7176
|
-
|
|
7176
|
+
de,
|
|
7177
7177
|
De,
|
|
7178
7178
|
Qe,
|
|
7179
7179
|
V,
|
|
@@ -7350,13 +7350,15 @@ const is = ({ facet: e }) => {
|
|
|
7350
7350
|
)
|
|
7351
7351
|
] });
|
|
7352
7352
|
}, Dm = ({
|
|
7353
|
-
|
|
7354
|
-
|
|
7353
|
+
launcherRef: e,
|
|
7354
|
+
isWidgetOpen: t,
|
|
7355
|
+
setIsWidgetOpen: n
|
|
7355
7356
|
}) => {
|
|
7356
|
-
const { companySettings:
|
|
7357
|
+
const { companySettings: r } = Ge(Ht);
|
|
7357
7358
|
return /* @__PURE__ */ ne(
|
|
7358
7359
|
"div",
|
|
7359
7360
|
{
|
|
7361
|
+
ref: e,
|
|
7360
7362
|
className: `launcher
|
|
7361
7363
|
fixed
|
|
7362
7364
|
z-[999999999]
|
|
@@ -7369,15 +7371,15 @@ const is = ({ facet: e }) => {
|
|
|
7369
7371
|
justify-center
|
|
7370
7372
|
items-center
|
|
7371
7373
|
`,
|
|
7372
|
-
onClick: () =>
|
|
7374
|
+
onClick: () => n(!t),
|
|
7373
7375
|
children: [
|
|
7374
|
-
!
|
|
7376
|
+
!t && /* @__PURE__ */ S(
|
|
7375
7377
|
is,
|
|
7376
7378
|
{
|
|
7377
|
-
facet:
|
|
7379
|
+
facet: r.agent.display[X.AgentDisplayFacetRoleType.LAUNCHER]
|
|
7378
7380
|
}
|
|
7379
7381
|
),
|
|
7380
|
-
|
|
7382
|
+
t && /* @__PURE__ */ S(Fc, { className: "w-6 h-6", fill: "white" })
|
|
7381
7383
|
]
|
|
7382
7384
|
}
|
|
7383
7385
|
);
|
|
@@ -11099,11 +11101,11 @@ function eb(e, t, n) {
|
|
|
11099
11101
|
function G(Q) {
|
|
11100
11102
|
return se;
|
|
11101
11103
|
function se(oe) {
|
|
11102
|
-
const ue = oe !== null && Q[oe],
|
|
11104
|
+
const ue = oe !== null && Q[oe], de = oe !== null && Q.null, Le = [
|
|
11103
11105
|
// To do: add more extension tests.
|
|
11104
11106
|
/* c8 ignore next 2 */
|
|
11105
11107
|
...Array.isArray(ue) ? ue : ue ? [ue] : [],
|
|
11106
|
-
...Array.isArray(
|
|
11108
|
+
...Array.isArray(de) ? de : de ? [de] : []
|
|
11107
11109
|
];
|
|
11108
11110
|
return ie(Le)(oe);
|
|
11109
11111
|
}
|
|
@@ -11370,10 +11372,10 @@ function yb(e) {
|
|
|
11370
11372
|
blockQuote: a(ue),
|
|
11371
11373
|
characterEscape: Y,
|
|
11372
11374
|
characterReference: Y,
|
|
11373
|
-
codeFenced: a(
|
|
11375
|
+
codeFenced: a(de),
|
|
11374
11376
|
codeFencedFenceInfo: s,
|
|
11375
11377
|
codeFencedFenceMeta: s,
|
|
11376
|
-
codeIndented: a(
|
|
11378
|
+
codeIndented: a(de, s),
|
|
11377
11379
|
codeText: a(Le, s),
|
|
11378
11380
|
codeTextData: Y,
|
|
11379
11381
|
data: Y,
|
|
@@ -11786,7 +11788,7 @@ function yb(e) {
|
|
|
11786
11788
|
children: []
|
|
11787
11789
|
};
|
|
11788
11790
|
}
|
|
11789
|
-
function
|
|
11791
|
+
function de() {
|
|
11790
11792
|
return {
|
|
11791
11793
|
type: "code",
|
|
11792
11794
|
lang: null,
|
|
@@ -22309,7 +22311,7 @@ function lS(e, {
|
|
|
22309
22311
|
threshold: i = 0,
|
|
22310
22312
|
dedupeKey: a
|
|
22311
22313
|
} = {}) {
|
|
22312
|
-
const s =
|
|
22314
|
+
const s = le(!1), o = le();
|
|
22313
22315
|
return ot(
|
|
22314
22316
|
(c) => {
|
|
22315
22317
|
if (o.current?.(), o.current = void 0, !c || s.current) return;
|
|
@@ -22607,10 +22609,10 @@ const Rd = ({
|
|
|
22607
22609
|
defaultMessage: "Demo mode — this form reproduces the real experience. Submitting it does not create a request or transmit your answers."
|
|
22608
22610
|
}), d = n.formatMessage({
|
|
22609
22611
|
id: "chatbot.interactiveWidget.preview.completed",
|
|
22610
|
-
defaultMessage: "
|
|
22612
|
+
defaultMessage: "You have tested this form. No request was sent and your answers were not transmitted."
|
|
22611
22613
|
}), f = n.formatMessage({
|
|
22612
22614
|
id: "chatbot.interactiveWidget.preview.cancelled",
|
|
22613
|
-
defaultMessage: "
|
|
22615
|
+
defaultMessage: "You have closed the demo form. No information was transmitted."
|
|
22614
22616
|
}), m = (T, g) => {
|
|
22615
22617
|
T.kind === "open_url" && window.open(T.url, "_blank", "noopener,noreferrer"), t.submitInteractiveWidget({
|
|
22616
22618
|
instanceId: e.instanceId,
|
|
@@ -22956,7 +22958,7 @@ const Rd = ({
|
|
|
22956
22958
|
)
|
|
22957
22959
|
] });
|
|
22958
22960
|
function yS(e, t, n) {
|
|
22959
|
-
let [r, i] = ae(e || t), a =
|
|
22961
|
+
let [r, i] = ae(e || t), a = le(e !== void 0), s = e !== void 0;
|
|
22960
22962
|
Ee(() => {
|
|
22961
22963
|
let c = a.current;
|
|
22962
22964
|
c !== s && console.warn(`WARN: A component changed from ${c ? "controlled" : "uncontrolled"} to ${s ? "controlled" : "uncontrolled"}.`), a.current = s;
|
|
@@ -22987,7 +22989,7 @@ const jr = {
|
|
|
22987
22989
|
}, Ld = /* @__PURE__ */ We.createContext(jr), _S = /* @__PURE__ */ We.createContext(!1);
|
|
22988
22990
|
let SS = !!(typeof window < "u" && window.document && window.document.createElement), ta = /* @__PURE__ */ new WeakMap();
|
|
22989
22991
|
function CS(e = !1) {
|
|
22990
|
-
let t = Ge(Ld), n =
|
|
22992
|
+
let t = Ge(Ld), n = le(null);
|
|
22991
22993
|
if (n.current === null && !e) {
|
|
22992
22994
|
var r, i;
|
|
22993
22995
|
let a = (i = We.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED) === null || i === void 0 || (r = i.ReactCurrentOwner) === null || r === void 0 ? void 0 : r.current;
|
|
@@ -23042,7 +23044,7 @@ function RS() {
|
|
|
23042
23044
|
const Cn = typeof document < "u" ? We.useLayoutEffect : () => {
|
|
23043
23045
|
};
|
|
23044
23046
|
function mn(e) {
|
|
23045
|
-
const t =
|
|
23047
|
+
const t = le(null);
|
|
23046
23048
|
return Cn(() => {
|
|
23047
23049
|
t.current = e;
|
|
23048
23050
|
}, [
|
|
@@ -23053,7 +23055,7 @@ function mn(e) {
|
|
|
23053
23055
|
}, []);
|
|
23054
23056
|
}
|
|
23055
23057
|
function OS(e) {
|
|
23056
|
-
let [t, n] = ae(e), r =
|
|
23058
|
+
let [t, n] = ae(e), r = le(null), i = mn(() => {
|
|
23057
23059
|
if (!r.current) return;
|
|
23058
23060
|
let s = r.current.next();
|
|
23059
23061
|
if (s.done) {
|
|
@@ -23075,7 +23077,7 @@ function OS(e) {
|
|
|
23075
23077
|
}
|
|
23076
23078
|
let LS = !!(typeof window < "u" && window.document && window.document.createElement), qr = /* @__PURE__ */ new Map();
|
|
23077
23079
|
function Xr(e) {
|
|
23078
|
-
let [t, n] = ae(e), r =
|
|
23080
|
+
let [t, n] = ae(e), r = le(null), i = AS(t), a = ot((s) => {
|
|
23079
23081
|
r.current = s;
|
|
23080
23082
|
}, []);
|
|
23081
23083
|
return LS && qr.set(i, a), Cn(() => {
|
|
@@ -23267,7 +23269,7 @@ function KS(e) {
|
|
|
23267
23269
|
return e.mozInputSource === 0 && e.isTrusted ? !0 : jS() && e.pointerType ? e.type === "click" && e.buttons === 1 : e.detail === 0 && !e.pointerType;
|
|
23268
23270
|
}
|
|
23269
23271
|
function JS(e, t, n) {
|
|
23270
|
-
let r =
|
|
23272
|
+
let r = le(t), i = mn(() => {
|
|
23271
23273
|
n && n(r.current);
|
|
23272
23274
|
});
|
|
23273
23275
|
Ee(() => {
|
|
@@ -23306,7 +23308,7 @@ class eC {
|
|
|
23306
23308
|
}
|
|
23307
23309
|
}
|
|
23308
23310
|
function tC(e) {
|
|
23309
|
-
let t =
|
|
23311
|
+
let t = le({
|
|
23310
23312
|
isFocused: !1,
|
|
23311
23313
|
observer: null
|
|
23312
23314
|
});
|
|
@@ -23532,7 +23534,7 @@ function fC(e) {
|
|
|
23532
23534
|
return r;
|
|
23533
23535
|
}
|
|
23534
23536
|
function hC(e, t) {
|
|
23535
|
-
let { focusProps: n } = nC(e), { keyboardProps: r } = uC(e), i = Kr(n, r), a = fC(t), s = e.isDisabled ? {} : a, o =
|
|
23537
|
+
let { focusProps: n } = nC(e), { keyboardProps: r } = uC(e), i = Kr(n, r), a = fC(t), s = e.isDisabled ? {} : a, o = le(e.autoFocus);
|
|
23536
23538
|
return Ee(() => {
|
|
23537
23539
|
o.current && t.current && cC(t.current), o.current = !1;
|
|
23538
23540
|
}, [
|
|
@@ -23667,7 +23669,7 @@ function yC(e) {
|
|
|
23667
23669
|
let A = Ft(() => vu(T ? [] : f), [
|
|
23668
23670
|
T,
|
|
23669
23671
|
f
|
|
23670
|
-
]), I =
|
|
23672
|
+
]), I = le(Xn), [w, k] = ae(Xn), D = le(Xn), x = () => {
|
|
23671
23673
|
if (!p) return;
|
|
23672
23674
|
O(!1);
|
|
23673
23675
|
let v = c || a || I.current;
|
|
@@ -23848,7 +23850,7 @@ const xC = (e) => e.charCodeAt(e.length - 1) === 10, AC = (e) => {
|
|
|
23848
23850
|
onPressMicButton: m,
|
|
23849
23851
|
LoadingComponent: h,
|
|
23850
23852
|
onPressLoadingButton: T
|
|
23851
|
-
} = e, g =
|
|
23853
|
+
} = e, g = le(null), { labelProps: A, inputProps: I } = IC(
|
|
23852
23854
|
{
|
|
23853
23855
|
...e,
|
|
23854
23856
|
inputElementType: "textarea"
|
|
@@ -24125,7 +24127,7 @@ class LC {
|
|
|
24125
24127
|
}
|
|
24126
24128
|
}
|
|
24127
24129
|
const DC = (e) => {
|
|
24128
|
-
const t =
|
|
24130
|
+
const t = le(null), n = le(null), r = le(new LC()), i = le(null), [a, s] = ae(!1), o = () => {
|
|
24129
24131
|
const d = t.current;
|
|
24130
24132
|
if (!d) return;
|
|
24131
24133
|
const f = r.current.observeViewport({
|
|
@@ -24568,7 +24570,7 @@ const DC = (e) => {
|
|
|
24568
24570
|
}
|
|
24569
24571
|
) });
|
|
24570
24572
|
function zC() {
|
|
24571
|
-
const [e, t] = ae("idle"), [n, r] = ae(null), [i, a] = ae(0), s =
|
|
24573
|
+
const [e, t] = ae("idle"), [n, r] = ae(null), [i, a] = ae(0), s = le(null), o = le(null), u = le([]), c = le(null), d = le(null), f = le(null), m = le(null), h = ot(() => {
|
|
24572
24574
|
m.current !== null && (cancelAnimationFrame(m.current), m.current = null);
|
|
24573
24575
|
try {
|
|
24574
24576
|
f.current?.disconnect();
|
|
@@ -24804,7 +24806,7 @@ const YC = ({
|
|
|
24804
24806
|
}) => e.length === 0 || n || r || i ? !1 : !t.some(
|
|
24805
24807
|
(s) => s.userType === "user"
|
|
24806
24808
|
), Vd = ({ containerClassName: e }) => {
|
|
24807
|
-
const t =
|
|
24809
|
+
const t = le(null), n = Mc(), {
|
|
24808
24810
|
appToken: r,
|
|
24809
24811
|
loadingStatus: i,
|
|
24810
24812
|
numberOfSteps: a,
|
|
@@ -24849,7 +24851,7 @@ const YC = ({
|
|
|
24849
24851
|
resetConversation: Q,
|
|
24850
24852
|
archivedConversation: se,
|
|
24851
24853
|
setArchivedConversationAsMain: oe
|
|
24852
|
-
} = ai(), { companySettings: ue } = Ge(Ht), { recentMessagesTranslation:
|
|
24854
|
+
} = ai(), { companySettings: ue } = Ge(Ht), { recentMessagesTranslation: de } = es(), {
|
|
24853
24855
|
scrollToBottom: Le,
|
|
24854
24856
|
showScrollButton: j,
|
|
24855
24857
|
messagesContainerRef: De,
|
|
@@ -24929,7 +24931,7 @@ const YC = ({
|
|
|
24929
24931
|
j && /* @__PURE__ */ S(
|
|
24930
24932
|
FC,
|
|
24931
24933
|
{
|
|
24932
|
-
label:
|
|
24934
|
+
label: de,
|
|
24933
24935
|
onClick: () => Le({ smooth: !0, sticky: !0 })
|
|
24934
24936
|
}
|
|
24935
24937
|
),
|
|
@@ -25220,8 +25222,8 @@ function XC() {
|
|
|
25220
25222
|
function A(b) {
|
|
25221
25223
|
if (process.env.NODE_ENV !== "production")
|
|
25222
25224
|
var G = {}, ie = 0;
|
|
25223
|
-
function _(ee, Q, se, oe, ue,
|
|
25224
|
-
if (oe = oe || m,
|
|
25225
|
+
function _(ee, Q, se, oe, ue, de, Le) {
|
|
25226
|
+
if (oe = oe || m, de = de || se, Le !== n) {
|
|
25225
25227
|
if (u) {
|
|
25226
25228
|
var j = new Error(
|
|
25227
25229
|
"Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types"
|
|
@@ -25231,11 +25233,11 @@ function XC() {
|
|
|
25231
25233
|
var De = oe + ":" + se;
|
|
25232
25234
|
!G[De] && // Avoid spamming the console because they are often not actionable except for lib authors
|
|
25233
25235
|
ie < 3 && (a(
|
|
25234
|
-
"You are manually calling a React.PropTypes validation function for the `" +
|
|
25236
|
+
"You are manually calling a React.PropTypes validation function for the `" + de + "` prop on `" + oe + "`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."
|
|
25235
25237
|
), G[De] = !0, ie++);
|
|
25236
25238
|
}
|
|
25237
25239
|
}
|
|
25238
|
-
return Q[se] == null ? ee ? Q[se] === null ? new g("The " + ue + " `" +
|
|
25240
|
+
return Q[se] == null ? ee ? Q[se] === null ? new g("The " + ue + " `" + de + "` is marked as required " + ("in `" + oe + "`, but its value is `null`.")) : new g("The " + ue + " `" + de + "` is marked as required in " + ("`" + oe + "`, but its value is `undefined`.")) : null : b(Q, se, oe, ue, de);
|
|
25239
25241
|
}
|
|
25240
25242
|
var Z = _.bind(null, !1);
|
|
25241
25243
|
return Z.isRequired = _.bind(null, !0), Z;
|
|
@@ -25244,9 +25246,9 @@ function XC() {
|
|
|
25244
25246
|
function G(ie, _, Z, ee, Q, se) {
|
|
25245
25247
|
var oe = ie[_], ue = me(oe);
|
|
25246
25248
|
if (ue !== b) {
|
|
25247
|
-
var
|
|
25249
|
+
var de = re(oe);
|
|
25248
25250
|
return new g(
|
|
25249
|
-
"Invalid " + ee + " `" + Q + "` of type " + ("`" +
|
|
25251
|
+
"Invalid " + ee + " `" + Q + "` of type " + ("`" + de + "` supplied to `" + Z + "`, expected ") + ("`" + b + "`."),
|
|
25250
25252
|
{ expectedType: b }
|
|
25251
25253
|
);
|
|
25252
25254
|
}
|
|
@@ -25267,9 +25269,9 @@ function XC() {
|
|
|
25267
25269
|
return new g("Invalid " + ee + " `" + Q + "` of type " + ("`" + oe + "` supplied to `" + Z + "`, expected an array."));
|
|
25268
25270
|
}
|
|
25269
25271
|
for (var ue = 0; ue < se.length; ue++) {
|
|
25270
|
-
var
|
|
25271
|
-
if (
|
|
25272
|
-
return
|
|
25272
|
+
var de = b(se, ue, Z, ee, Q + "[" + ue + "]", n);
|
|
25273
|
+
if (de instanceof Error)
|
|
25274
|
+
return de;
|
|
25273
25275
|
}
|
|
25274
25276
|
return null;
|
|
25275
25277
|
}
|
|
@@ -25333,9 +25335,9 @@ function XC() {
|
|
|
25333
25335
|
return new g("Invalid " + ee + " `" + Q + "` of type " + ("`" + oe + "` supplied to `" + Z + "`, expected an object."));
|
|
25334
25336
|
for (var ue in se)
|
|
25335
25337
|
if (r(se, ue)) {
|
|
25336
|
-
var
|
|
25337
|
-
if (
|
|
25338
|
-
return
|
|
25338
|
+
var de = b(se, ue, Z, ee, Q + "." + ue, n);
|
|
25339
|
+
if (de instanceof Error)
|
|
25340
|
+
return de;
|
|
25339
25341
|
}
|
|
25340
25342
|
return null;
|
|
25341
25343
|
}
|
|
@@ -25352,8 +25354,8 @@ function XC() {
|
|
|
25352
25354
|
), s;
|
|
25353
25355
|
}
|
|
25354
25356
|
function _(Z, ee, Q, se, oe) {
|
|
25355
|
-
for (var ue = [],
|
|
25356
|
-
var Le = b[
|
|
25357
|
+
for (var ue = [], de = 0; de < b.length; de++) {
|
|
25358
|
+
var Le = b[de], j = Le(Z, ee, Q, se, oe, n);
|
|
25357
25359
|
if (j == null)
|
|
25358
25360
|
return null;
|
|
25359
25361
|
j.data && r(j.data, "expectedType") && ue.push(j.data.expectedType);
|
|
@@ -25380,10 +25382,10 @@ function XC() {
|
|
|
25380
25382
|
if (oe !== "object")
|
|
25381
25383
|
return new g("Invalid " + ee + " `" + Q + "` of type `" + oe + "` " + ("supplied to `" + Z + "`, expected `object`."));
|
|
25382
25384
|
for (var ue in b) {
|
|
25383
|
-
var
|
|
25384
|
-
if (typeof
|
|
25385
|
-
return H(Z, ee, Q, ue, re(
|
|
25386
|
-
var Le =
|
|
25385
|
+
var de = b[ue];
|
|
25386
|
+
if (typeof de != "function")
|
|
25387
|
+
return H(Z, ee, Q, ue, re(de));
|
|
25388
|
+
var Le = de(se, ue, Z, ee, Q + "." + ue, n);
|
|
25387
25389
|
if (Le)
|
|
25388
25390
|
return Le;
|
|
25389
25391
|
}
|
|
@@ -25397,16 +25399,16 @@ function XC() {
|
|
|
25397
25399
|
if (oe !== "object")
|
|
25398
25400
|
return new g("Invalid " + ee + " `" + Q + "` of type `" + oe + "` " + ("supplied to `" + Z + "`, expected `object`."));
|
|
25399
25401
|
var ue = t({}, ie[_], b);
|
|
25400
|
-
for (var
|
|
25401
|
-
var Le = b[
|
|
25402
|
-
if (r(b,
|
|
25403
|
-
return H(Z, ee, Q,
|
|
25402
|
+
for (var de in ue) {
|
|
25403
|
+
var Le = b[de];
|
|
25404
|
+
if (r(b, de) && typeof Le != "function")
|
|
25405
|
+
return H(Z, ee, Q, de, re(Le));
|
|
25404
25406
|
if (!Le)
|
|
25405
25407
|
return new g(
|
|
25406
|
-
"Invalid " + ee + " `" + Q + "` key `" +
|
|
25408
|
+
"Invalid " + ee + " `" + Q + "` key `" + de + "` supplied to `" + Z + "`.\nBad object: " + JSON.stringify(ie[_], null, " ") + `
|
|
25407
25409
|
Valid keys: ` + JSON.stringify(Object.keys(b), null, " ")
|
|
25408
25410
|
);
|
|
25409
|
-
var j = Le(se,
|
|
25411
|
+
var j = Le(se, de, Z, ee, Q + "." + de, n);
|
|
25410
25412
|
if (j)
|
|
25411
25413
|
return j;
|
|
25412
25414
|
}
|
|
@@ -26157,7 +26159,7 @@ const jd = () => {
|
|
|
26157
26159
|
className: t = "",
|
|
26158
26160
|
tone: n = "light"
|
|
26159
26161
|
}) => {
|
|
26160
|
-
const [r, i] = ae(!1), a =
|
|
26162
|
+
const [r, i] = ae(!1), a = le(null), { openMenuTranslation: s, startNewDiscussionTranslation: o } = jd();
|
|
26161
26163
|
Ee(() => {
|
|
26162
26164
|
if (!r) return;
|
|
26163
26165
|
const c = (f) => {
|
|
@@ -26290,15 +26292,15 @@ const jd = () => {
|
|
|
26290
26292
|
{
|
|
26291
26293
|
ref: t,
|
|
26292
26294
|
className: `
|
|
26293
|
-
fixed z-[2147483647]
|
|
26294
|
-
inset-0 w-screen h-[100svh] rounded-none
|
|
26295
|
+
chatBox chatsystem-widget-window fixed z-[2147483647]
|
|
26296
|
+
inset-0 w-screen h-[100svh] rounded-none bg-white md:rounded-xl
|
|
26295
26297
|
md:inset-auto md:bottom-[calc(80px+1rem)] md:right-6
|
|
26296
26298
|
md:w-[min(100vw-1rem,400px)]
|
|
26297
26299
|
md:h-[clamp(420px,70dvh,640px)]
|
|
26298
26300
|
flex flex-col
|
|
26299
26301
|
`,
|
|
26300
26302
|
children: [
|
|
26301
|
-
/* @__PURE__ */ ne("div", { className: "
|
|
26303
|
+
/* @__PURE__ */ ne("div", { className: "chatsystem-widget-surface h-full w-full min-h-0 shadow-xl flex flex-col overflow-hidden", children: [
|
|
26302
26304
|
/* @__PURE__ */ ne(
|
|
26303
26305
|
"div",
|
|
26304
26306
|
{
|
|
@@ -26338,36 +26340,37 @@ const jd = () => {
|
|
|
26338
26340
|
);
|
|
26339
26341
|
}
|
|
26340
26342
|
), oI = ({
|
|
26341
|
-
|
|
26342
|
-
|
|
26343
|
+
launcherRef: e,
|
|
26344
|
+
isWidgetOpen: t,
|
|
26345
|
+
setIsWidgetOpen: n
|
|
26343
26346
|
}) => {
|
|
26344
|
-
const
|
|
26347
|
+
const r = le(null);
|
|
26345
26348
|
return Ee(() => {
|
|
26346
|
-
if (!
|
|
26347
|
-
const
|
|
26348
|
-
const
|
|
26349
|
-
if (!
|
|
26350
|
-
const
|
|
26351
|
-
if (
|
|
26352
|
-
if (s.includes(
|
|
26349
|
+
if (!t) return;
|
|
26350
|
+
const i = (a) => {
|
|
26351
|
+
const s = r.current;
|
|
26352
|
+
if (!s) return;
|
|
26353
|
+
const o = e.current, u = typeof a.composedPath == "function" ? a.composedPath() : [];
|
|
26354
|
+
if (u.length > 0) {
|
|
26355
|
+
if (u.includes(s) || o && u.includes(o)) return;
|
|
26353
26356
|
} else {
|
|
26354
|
-
const
|
|
26355
|
-
if (
|
|
26357
|
+
const c = a.target;
|
|
26358
|
+
if (c && (s.contains(c) || o?.contains(c))) return;
|
|
26356
26359
|
}
|
|
26357
|
-
|
|
26360
|
+
n(!1);
|
|
26358
26361
|
};
|
|
26359
|
-
return document.addEventListener("pointerdown",
|
|
26360
|
-
document.removeEventListener("pointerdown",
|
|
26362
|
+
return document.addEventListener("pointerdown", i, !0), () => {
|
|
26363
|
+
document.removeEventListener("pointerdown", i, !0);
|
|
26361
26364
|
};
|
|
26362
|
-
}, [
|
|
26365
|
+
}, [t, n, e]), /* @__PURE__ */ S("div", { children: /* @__PURE__ */ S(
|
|
26363
26366
|
Os,
|
|
26364
26367
|
{
|
|
26365
|
-
nodeRef:
|
|
26366
|
-
in:
|
|
26368
|
+
nodeRef: r,
|
|
26369
|
+
in: t,
|
|
26367
26370
|
timeout: 200,
|
|
26368
26371
|
classNames: "menuTransition",
|
|
26369
26372
|
unmountOnExit: !0,
|
|
26370
|
-
children: /* @__PURE__ */ S(sI, { ref:
|
|
26373
|
+
children: /* @__PURE__ */ S(sI, { ref: r, setIsWidgetOpen: n })
|
|
26371
26374
|
}
|
|
26372
26375
|
) });
|
|
26373
26376
|
}, uI = () => {
|
|
@@ -26382,12 +26385,13 @@ const jd = () => {
|
|
|
26382
26385
|
};
|
|
26383
26386
|
var Zt = /* @__PURE__ */ ((e) => (e.LAUNCHER = "launcher", e.CHATBOX = "chatbox", e))(Zt || {});
|
|
26384
26387
|
const cI = ({ displayMode: e }) => {
|
|
26385
|
-
const [t, n] = ae(!1);
|
|
26388
|
+
const [t, n] = ae(!1), r = le(null);
|
|
26386
26389
|
return /* @__PURE__ */ ne(Ct, { children: [
|
|
26387
26390
|
e === Zt.LAUNCHER && /* @__PURE__ */ ne(Ct, { children: [
|
|
26388
26391
|
/* @__PURE__ */ S(
|
|
26389
26392
|
Dm,
|
|
26390
26393
|
{
|
|
26394
|
+
launcherRef: r,
|
|
26391
26395
|
isWidgetOpen: t,
|
|
26392
26396
|
setIsWidgetOpen: n
|
|
26393
26397
|
}
|
|
@@ -26395,6 +26399,7 @@ const cI = ({ displayMode: e }) => {
|
|
|
26395
26399
|
/* @__PURE__ */ S(
|
|
26396
26400
|
oI,
|
|
26397
26401
|
{
|
|
26402
|
+
launcherRef: r,
|
|
26398
26403
|
isWidgetOpen: t,
|
|
26399
26404
|
setIsWidgetOpen: n
|
|
26400
26405
|
}
|
|
@@ -26440,7 +26445,7 @@ const cI = ({ displayMode: e }) => {
|
|
|
26440
26445
|
}
|
|
26441
26446
|
});
|
|
26442
26447
|
function mI(e, t = {}, n, r) {
|
|
26443
|
-
const i = hr(), { id: a, nonce: s, target: o, disableConstructable: u } = t, c = o, d =
|
|
26448
|
+
const i = hr(), { id: a, nonce: s, target: o, disableConstructable: u } = t, c = o, d = le(null), f = le(null);
|
|
26444
26449
|
Ee(() => {
|
|
26445
26450
|
if (!o) return;
|
|
26446
26451
|
if (!e) {
|
|
@@ -28553,6 +28558,16 @@ video {
|
|
|
28553
28558
|
word-break: break-word;
|
|
28554
28559
|
}
|
|
28555
28560
|
|
|
28561
|
+
/* The legacy .chatBox selector owns window positioning and appearance. */
|
|
28562
|
+
.chatsystem-widget-window {
|
|
28563
|
+
overflow: visible;
|
|
28564
|
+
}
|
|
28565
|
+
|
|
28566
|
+
.chatsystem-widget-surface {
|
|
28567
|
+
background: inherit;
|
|
28568
|
+
border-radius: inherit;
|
|
28569
|
+
}
|
|
28570
|
+
|
|
28556
28571
|
/*
|
|
28557
28572
|
* Tailwind Preflight removes native list markers. Restore editorial Markdown
|
|
28558
28573
|
* semantics only inside the public chat surface so navigation and controls are
|
|
@@ -29027,7 +29042,7 @@ function _I({
|
|
|
29027
29042
|
cssHref: e,
|
|
29028
29043
|
displayMode: t = Zt.LAUNCHER
|
|
29029
29044
|
}) {
|
|
29030
|
-
const n = dI(t), r = n === Zt.LAUNCHER ? "body" : "inline", i = Zd().replace(/[^a-zA-Z0-9_-]/g, ""), a =
|
|
29045
|
+
const n = dI(t), r = n === Zt.LAUNCHER ? "body" : "inline", i = Zd().replace(/[^a-zA-Z0-9_-]/g, ""), a = le(null), [s, o] = ae(null), [u, c] = ae(null);
|
|
29031
29046
|
return Ee(() => {
|
|
29032
29047
|
if (typeof document > "u") return;
|
|
29033
29048
|
const d = r === "inline" ? a.current : document.body;
|