@sendbird/ai-agent-messenger-react 1.9.1 → 1.9.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{C7mYp-Sm.cjs → C69Walbl.cjs} +1 -1
- package/dist/cjs/{BvXblDCo.cjs → CWITOvpG.cjs} +1 -1
- package/dist/cjs/{BeDV3w9G.cjs → CgocqP2k.cjs} +1 -1
- package/dist/cjs/{BDAydJst.cjs → ClsAqq5g.cjs} +1 -1
- package/dist/cjs/{B2XEqEtH.cjs → CqvdwZYp.cjs} +1 -1
- package/dist/cjs/{CmZZbL5X.cjs → CsizPe_9.cjs} +1 -1
- package/dist/cjs/{Dnh-zu9I.cjs → Dr2B4zgv.cjs} +1 -1
- package/dist/cjs/{ByqY2Frw.cjs → DsZLsQaz.cjs} +1 -1
- package/dist/cjs/{BzFcEwZu.cjs → DzXaL8bA.cjs} +1 -1
- package/dist/cjs/a9HLj-8m.cjs +305 -0
- package/dist/cjs/{BxR58-VB.cjs → wXYFxrgy.cjs} +1 -1
- package/dist/es/{DINOaKB4.js → 4kOEVHcG.js} +1 -1
- package/dist/es/{BMhOEL86.js → B5VHGvmO.js} +18 -12
- package/dist/es/{Nxjx0s3h.js → BM371CV8.js} +18 -12
- package/dist/es/{DbVz_9m0.js → BOFQ9ECg.js} +18 -12
- package/dist/es/{BNtwGyTL.js → BSEBGgaE.js} +18 -12
- package/dist/es/{BqgL9sJP.js → BaOl2MtS.js} +18 -12
- package/dist/es/{BiYSaYUc.js → BgLqygas.js} +18 -12
- package/dist/es/{DuyZf1Vo.js → C67VQmho.js} +18 -12
- package/dist/es/{DS-fbH3S.js → CNevsYHB.js} +18 -12
- package/dist/es/{C3QOlRLQ.js → Do-qZ-xC.js} +126 -92
- package/dist/es/{DXvyPOw8.js → tJtF43ws.js} +18 -12
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +18 -8
- package/dist/index.js +14 -13
- package/package.json +2 -2
- package/dist/cjs/Bz6nAOkq.cjs +0 -305
|
@@ -146,7 +146,7 @@ function Wo(e, t, n) {
|
|
|
146
146
|
const o = /* @__PURE__ */ new Date(), s = new Date(((a = e.lastMessage) == null ? void 0 : a.createdAt) || e.createdAt), i = vo(o, s);
|
|
147
147
|
return i < 1 ? n.justNow : i < 60 ? n.minutesAgo(i) : yo(s) ? n.hoursAgo(_o(o, s)) : t(s, n.dateShortFormat);
|
|
148
148
|
}
|
|
149
|
-
const Go = "1.9.
|
|
149
|
+
const Go = "1.9.3", Be = "sb-agent", jo = Go, rr = "KEY_IMG_ASPECT_RATIO", qo = "*/*", F = {
|
|
150
150
|
BODY_MAX_WIDTH: 244,
|
|
151
151
|
WIDE_BODY_MAX_WIDTH: 640,
|
|
152
152
|
AVATAR_SIZE: 26,
|
|
@@ -512,7 +512,7 @@ function is({
|
|
|
512
512
|
});
|
|
513
513
|
}, [e, t, o, s, i, l, p, E, c]), U(() => () => {
|
|
514
514
|
x.chatSDK.disconnectWebSocket();
|
|
515
|
-
}, [x.chatSDK]), os(x.chatSDK), /* @__PURE__ */ r.createElement(ss, { value: x }, m);
|
|
515
|
+
}, [x.chatSDK]), os(x.chatSDK), /* @__PURE__ */ r.createElement(ss, { value: { ...x, context: i, language: o, countryCode: s } }, m);
|
|
516
516
|
}
|
|
517
517
|
const as = (e, t, n) => wo(e, t, { ...n, strictStreamingOrder: !0 });
|
|
518
518
|
var Mt = /* @__PURE__ */ ((e) => (e.ConversationClose = "conv.close", e))(Mt || {});
|
|
@@ -995,8 +995,8 @@ function Ls({
|
|
|
995
995
|
if (f === "manual")
|
|
996
996
|
E.warn("Received auto created user info but current session is manual. Ignoring auto created user info."), $ = { userId: g.userId, authToken: g.authToken };
|
|
997
997
|
else {
|
|
998
|
-
const { user_id:
|
|
999
|
-
y.messenger.setAnonUser({ userId:
|
|
998
|
+
const { user_id: ee, session_token: te, expire_at: le } = w.auto_created_user;
|
|
999
|
+
y.messenger.setAnonUser({ userId: ee, authToken: te, expireAt: le }), $ = { userId: ee, authToken: te };
|
|
1000
1000
|
}
|
|
1001
1001
|
else
|
|
1002
1002
|
$ = {
|
|
@@ -1006,8 +1006,8 @@ function Ls({
|
|
|
1006
1006
|
y.messenger.setSettings($.userId, w), t(w);
|
|
1007
1007
|
try {
|
|
1008
1008
|
await n(w, $), await x($, g == null ? void 0 : g.sessionHandler, i), await o(w, $);
|
|
1009
|
-
} catch (
|
|
1010
|
-
throw
|
|
1009
|
+
} catch (ee) {
|
|
1010
|
+
throw ee instanceof Error && (s(ee), E.error("useAuthentication.authenticate: failed to connect", ee)), ee;
|
|
1011
1011
|
}
|
|
1012
1012
|
return w;
|
|
1013
1013
|
}, [
|
|
@@ -1017,6 +1017,11 @@ function Ls({
|
|
|
1017
1017
|
g == null ? void 0 : g.userId,
|
|
1018
1018
|
g == null ? void 0 : g.sessionHandler,
|
|
1019
1019
|
g == null ? void 0 : g.authToken,
|
|
1020
|
+
c,
|
|
1021
|
+
d,
|
|
1022
|
+
m,
|
|
1023
|
+
p,
|
|
1024
|
+
l,
|
|
1020
1025
|
y.messenger.setAnonUser,
|
|
1021
1026
|
y.messenger.getSettings,
|
|
1022
1027
|
y.messenger.setSettings,
|
|
@@ -1112,7 +1117,7 @@ const Bs = () => {
|
|
|
1112
1117
|
function({ userSessionInfo: e, forceCreateChannel: t, children: n }, o) {
|
|
1113
1118
|
const { appId: s, aiAgentId: i, chatSDK: a, language: l, countryCode: c, context: d, cache: m, logger: p } = q(), { updateTheme: E } = Gt(), [y, x] = T(void 0), [b, f] = T(
|
|
1114
1119
|
void 0
|
|
1115
|
-
), [g, v] = T(null), [_, M] = T(null), [C, w] = T(null), [$, B] = T(null), { updateBaseAttachmentRules:
|
|
1120
|
+
), [g, v] = T(null), [_, M] = T(null), [C, w] = T(null), [$, B] = T(null), { updateBaseAttachmentRules: ee, createAttachmentRules: te } = Ts(), { shouldSyncCachedTemplate: le, syncCachedTemplates: xe } = Bs(), ve = ur(), { authenticate: Ie, deauthenticate: j } = Ls({
|
|
1116
1121
|
userSessionInfo: e,
|
|
1117
1122
|
forceCreateChannel: t,
|
|
1118
1123
|
onUpdateMessengerSettings: O(
|
|
@@ -1132,7 +1137,7 @@ const Bs = () => {
|
|
|
1132
1137
|
}), B({
|
|
1133
1138
|
type: G.image_type || "default_icon",
|
|
1134
1139
|
imageUrl: G.image_url
|
|
1135
|
-
}),
|
|
1140
|
+
}), ee(P);
|
|
1136
1141
|
},
|
|
1137
1142
|
[E]
|
|
1138
1143
|
),
|
|
@@ -1241,7 +1246,7 @@ const Bs = () => {
|
|
|
1241
1246
|
launcherInfo: $,
|
|
1242
1247
|
authenticate: Ie,
|
|
1243
1248
|
deauthenticate: j,
|
|
1244
|
-
createAttachmentRules:
|
|
1249
|
+
createAttachmentRules: te
|
|
1245
1250
|
}
|
|
1246
1251
|
},
|
|
1247
1252
|
n
|
|
@@ -2256,24 +2261,29 @@ const yi = /* @__PURE__ */ new Set(["free_text", "single_choice"]), _i = ({ csat
|
|
|
2256
2261
|
};
|
|
2257
2262
|
}, St = 5, Ci = (e) => e < 1e3 ? { speed: St * 0.5, chunkSize: 2 } : e < 2e3 ? { speed: St * 0.8, chunkSize: 2 } : { speed: St * 0.6, chunkSize: 3 }, Si = (e, t = !1) => {
|
|
2258
2263
|
const [n, o] = T(0), s = H(null), i = H(0), a = H(0), l = H(t);
|
|
2259
|
-
|
|
2264
|
+
U(() => {
|
|
2260
2265
|
if (!l.current) {
|
|
2261
2266
|
o(e.length);
|
|
2262
2267
|
return;
|
|
2263
2268
|
}
|
|
2264
|
-
o((
|
|
2269
|
+
o((d) => e.length < d ? (i.current = 0, a.current = 0, 0) : d);
|
|
2265
2270
|
}, [e]), U(() => {
|
|
2266
2271
|
if (!l.current || n >= e.length)
|
|
2267
2272
|
return;
|
|
2268
|
-
const
|
|
2269
|
-
i.current === 0 && (i.current =
|
|
2270
|
-
const
|
|
2271
|
-
|
|
2273
|
+
const d = (m) => {
|
|
2274
|
+
i.current === 0 && (i.current = m, a.current = m);
|
|
2275
|
+
const p = m - i.current, E = m - a.current, { speed: y, chunkSize: x } = Ci(E), b = y * x;
|
|
2276
|
+
p >= b && (o((f) => Math.min(f + x, e.length)), i.current = m), s.current = requestAnimationFrame(d);
|
|
2272
2277
|
};
|
|
2273
|
-
return s.current = requestAnimationFrame(
|
|
2278
|
+
return s.current = requestAnimationFrame(d), () => {
|
|
2274
2279
|
s.current && cancelAnimationFrame(s.current);
|
|
2275
2280
|
};
|
|
2276
|
-
}, [e.length, n])
|
|
2281
|
+
}, [e.length, n]);
|
|
2282
|
+
const c = l.current && n < e.length;
|
|
2283
|
+
return {
|
|
2284
|
+
displayedText: e.slice(0, n),
|
|
2285
|
+
isBuffering: c
|
|
2286
|
+
};
|
|
2277
2287
|
}, Ti = '@import"https://fonts.googleapis.com/css?family=Roboto:400,500,600,700&display=swap";.sb-message-template__border{position:relative}.sb-message-template__border:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;z-index:1;box-shadow:inset 0 0 0 var(--border-width) var(--border-color);border-radius:var(--border-radius);pointer-events:none}.sb-message-template__action{cursor:pointer}.sb-message-template__parent{font-family:Roboto,serif}.sb-message-template__text{font-family:inherit;font-size:14px;font-weight:400;font-stretch:normal;font-style:normal;letter-spacing:normal;text-align:left}.sb-message-template__text-button{font-family:inherit;background-color:#e0e0e0;text-align:center;padding:10px;border-radius:6px;font-size:14px;font-weight:600;font-stretch:normal;font-style:normal;letter-spacing:normal}.sendbird-theme--light .sb-message-template__text-button{color:#742ddd}.sendbird-theme--dark .sb-message-template__text-button{color:#c2a9fa}.sb-message-template__text-button:hover{opacity:1;box-shadow:#0000001a 0 1px 3px,#0000000f 0 1px 2px}.sb-message-template__text-button,.sb-message-template__image-button{cursor:pointer;border-style:none}.sb-message-template__parent{border-radius:unset;background-color:transparent;overflow:hidden}.sb-message-template__parent *{box-sizing:border-box;line-height:1.3}.sb-message-template__carousel{display:flex;width:100%;box-sizing:border-box;touch-action:pan-y}', Ai = {
|
|
2278
2288
|
conversation: {
|
|
2279
2289
|
input_placeholder: "Ask a question",
|
|
@@ -2410,18 +2420,13 @@ const yi = /* @__PURE__ */ new Set(["free_text", "single_choice"]), _i = ({ csat
|
|
|
2410
2420
|
});
|
|
2411
2421
|
}, wn = wi(Rt.strings), Mi = {
|
|
2412
2422
|
...wn,
|
|
2413
|
-
// Channel
|
|
2414
|
-
CHANNEL_FROZEN: "Channel frozen",
|
|
2415
2423
|
// Channel Header
|
|
2416
2424
|
HEADER_BUTTON__AGENT_HANDOFF: "Connect with an agent",
|
|
2417
2425
|
// Message Input
|
|
2418
2426
|
MESSAGE_INPUT__PLACE_HOLDER__SUGGESTED_REPLIES: "Select an option to continue",
|
|
2419
2427
|
// Common UI
|
|
2420
2428
|
BUTTON__CANCEL: "Cancel",
|
|
2421
|
-
BUTTON__SAVE: "Save",
|
|
2422
|
-
BUTTON__OK: "OK",
|
|
2423
2429
|
BUTTON__SUBMIT: "Submit",
|
|
2424
|
-
NO_NAME: "(No name)",
|
|
2425
2430
|
SUBMITTED: "Submitted",
|
|
2426
2431
|
TRY_AGAIN: "Please try again.",
|
|
2427
2432
|
// File Upload
|
|
@@ -2435,11 +2440,6 @@ const yi = /* @__PURE__ */ new Set(["free_text", "single_choice"]), _i = ({ csat
|
|
|
2435
2440
|
CSAT5_RATING_SCORE_3: "Okay",
|
|
2436
2441
|
CSAT5_RATING_SCORE_4: "Good",
|
|
2437
2442
|
CSAT5_RATING_SCORE_5: "Great",
|
|
2438
|
-
// Conversation list
|
|
2439
|
-
CONVERSATION_CLOSED_FOOTER_LABEL: "Your conversation has ended",
|
|
2440
|
-
START_NEW_CONVERSATION: "💬 Start a new conversation",
|
|
2441
|
-
RETURN_TO_CONVERSATION: "💬 Return to conversation",
|
|
2442
|
-
CONVERSATION_LIST__TOPICS_FALLBACK: "No category",
|
|
2443
2443
|
// Form
|
|
2444
2444
|
FORM_UNAVAILABLE: "Form is no longer available.",
|
|
2445
2445
|
FORM_NOT_SUPPORTED: "This form is not supported in the current version.",
|
|
@@ -2453,7 +2453,23 @@ const yi = /* @__PURE__ */ new Set(["free_text", "single_choice"]), _i = ({ csat
|
|
|
2453
2453
|
/** @deprecated Please use DATE_FORMAT__DATE_SHORT instead. **/
|
|
2454
2454
|
DATE_FORMAT__CONVERSATION_LIST__LIST_ITEM_TITLE: wn.DATE_FORMAT__DATE_SHORT,
|
|
2455
2455
|
/** @deprecated Unused string **/
|
|
2456
|
-
DATE_FORMAT__CONVERSATION_LIST__LIST_ITEM_TITLE_CAPTION: "h:mma"
|
|
2456
|
+
DATE_FORMAT__CONVERSATION_LIST__LIST_ITEM_TITLE_CAPTION: "h:mma",
|
|
2457
|
+
/** @deprecated Unused string **/
|
|
2458
|
+
CONVERSATION_LIST__TOPICS_FALLBACK: "No category",
|
|
2459
|
+
/** @deprecated Unused string **/
|
|
2460
|
+
CONVERSATION_CLOSED_FOOTER_LABEL: "Your conversation has ended",
|
|
2461
|
+
/** @deprecated Unused string **/
|
|
2462
|
+
START_NEW_CONVERSATION: "💬 Start a new conversation",
|
|
2463
|
+
/** @deprecated Unused string **/
|
|
2464
|
+
RETURN_TO_CONVERSATION: "💬 Return to conversation",
|
|
2465
|
+
/** @deprecated Unused string **/
|
|
2466
|
+
BUTTON__SAVE: "Save",
|
|
2467
|
+
/** @deprecated Unused string **/
|
|
2468
|
+
BUTTON__OK: "OK",
|
|
2469
|
+
/** @deprecated Unused string **/
|
|
2470
|
+
NO_NAME: "(No name)",
|
|
2471
|
+
/** @deprecated Unused string **/
|
|
2472
|
+
CHANNEL_FROZEN: "Channel frozen"
|
|
2457
2473
|
}, lt = {
|
|
2458
2474
|
language: Rt.language,
|
|
2459
2475
|
dateLocale: Rt.dateLocale,
|
|
@@ -2467,7 +2483,7 @@ async function Li(e) {
|
|
|
2467
2483
|
if (t) return t;
|
|
2468
2484
|
try {
|
|
2469
2485
|
if (Ii.has(e)) {
|
|
2470
|
-
const { default: n } = await $i(/* @__PURE__ */ Object.assign({ "./languages/de.ts": () => import("./
|
|
2486
|
+
const { default: n } = await $i(/* @__PURE__ */ Object.assign({ "./languages/de.ts": () => import("./C67VQmho.js"), "./languages/en.ts": () => Promise.resolve().then(() => Oi), "./languages/es.ts": () => import("./BOFQ9ECg.js"), "./languages/fr.ts": () => import("./BgLqygas.js"), "./languages/hi.ts": () => import("./CNevsYHB.js"), "./languages/it.ts": () => import("./BaOl2MtS.js"), "./languages/ja.ts": () => import("./tJtF43ws.js"), "./languages/ko.ts": () => import("./BSEBGgaE.js"), "./languages/pt.ts": () => import("./BM371CV8.js"), "./languages/tr.ts": () => import("./B5VHGvmO.js") }), `./languages/${e}.ts`, 3);
|
|
2471
2487
|
return Nt.set(e, n), n;
|
|
2472
2488
|
}
|
|
2473
2489
|
return lt;
|
|
@@ -2682,7 +2698,7 @@ function Gi({
|
|
|
2682
2698
|
}
|
|
2683
2699
|
const {
|
|
2684
2700
|
Provider: ji,
|
|
2685
|
-
useContext:
|
|
2701
|
+
useContext: Q
|
|
2686
2702
|
} = J("MessengerSession"), qi = Ge(function({ children: e, ...t }, n) {
|
|
2687
2703
|
return /* @__PURE__ */ r.createElement(Ps, { ref: n, ...t }, (o) => /* @__PURE__ */ r.createElement(Ki, { ...o }, e));
|
|
2688
2704
|
}), Ki = ({ children: e, ...t }) => {
|
|
@@ -2703,7 +2719,7 @@ const {
|
|
|
2703
2719
|
var g;
|
|
2704
2720
|
o.error("messengerSession: failed to initialize", f), (g = c == null ? void 0 : c.onInitializeFailed) == null || g.call(c, f);
|
|
2705
2721
|
});
|
|
2706
|
-
}, [n, s, i, d == null ? void 0 : d.userId
|
|
2722
|
+
}, [n, s, i, d == null ? void 0 : d.userId]), !E || !y || !x ? null : /* @__PURE__ */ r.createElement(
|
|
2707
2723
|
ji,
|
|
2708
2724
|
{
|
|
2709
2725
|
value: {
|
|
@@ -2891,19 +2907,19 @@ const xa = h.div`display:flex;flex-direction:column;align-items:flex-start;gap:$
|
|
|
2891
2907
|
`, ya = h.img`width:100%;height:100%;object-fit:cover;`, _a = h.video`width:100%;height:100%;object-fit:cover;`, Ca = "✱", yr = (e) => {
|
|
2892
2908
|
const t = new RegExp(`(\`+)([^\`]+?)\\1|(${Ca}+)`, "g");
|
|
2893
2909
|
return e.replace(t, (n, o, s, i) => o ? n : i ? `<span id=${ba} aria-label="masked-text">${i}</span>` : n);
|
|
2894
|
-
}, Sa = (e) => e.replace(/\*\*(.*?)\*\*/g, "<b>$1</b>"), Ta = L(async () => ({ default: (await import("./
|
|
2910
|
+
}, Sa = (e) => e.replace(/\*\*(.*?)\*\*/g, "<b>$1</b>"), Ta = L(async () => ({ default: (await import("./4kOEVHcG.js")).MarkdownText })), Aa = L(async () => ({ default: (await import("./Ch_6OPTz.js")).CodeBlock }));
|
|
2895
2911
|
function $n(e) {
|
|
2896
|
-
var
|
|
2897
|
-
const t = e.maxBodyWidth ?? F.BODY_MAX_WIDTH, n =
|
|
2912
|
+
var s, i;
|
|
2913
|
+
const t = e.maxBodyWidth ?? F.BODY_MAX_WIDTH, n = ne(() => Yo(e.message, yr), [e.message]), o = {
|
|
2898
2914
|
id: `${Ee}-text-body`,
|
|
2899
2915
|
$maxWidth: t,
|
|
2900
|
-
$color: (
|
|
2901
|
-
$bgColor: (
|
|
2916
|
+
$color: (s = e.customStyle) == null ? void 0 : s.bubbleContentColor,
|
|
2917
|
+
$bgColor: (i = e.customStyle) == null ? void 0 : i.bubbleBackgroundColor
|
|
2902
2918
|
};
|
|
2903
|
-
return
|
|
2904
|
-
var
|
|
2905
|
-
return (
|
|
2906
|
-
} },
|
|
2919
|
+
return n.length === 0 ? e.children ? /* @__PURE__ */ r.createElement(Mn, { ...o }, e.children) : null : /* @__PURE__ */ r.createElement(Mn, { ...o }, n.map((a, l) => a.type === "text" ? /* @__PURE__ */ r.createElement(On, { key: l, variant: "body3" }, /* @__PURE__ */ r.createElement(dt, { fallback: a.value }, /* @__PURE__ */ r.createElement(Ta, { onClickImage: (c) => {
|
|
2920
|
+
var d;
|
|
2921
|
+
return (d = e.onClickMedia) == null ? void 0 : d.call(e, { url: c, type: "image/*" });
|
|
2922
|
+
} }, a.value))) : a.type === "code" ? /* @__PURE__ */ r.createElement(dt, { key: l, fallback: /* @__PURE__ */ r.createElement(On, { variant: "body3" }, a.value) }, /* @__PURE__ */ r.createElement(Aa, { code: a.value, language: a.language })) : null), e.children);
|
|
2907
2923
|
}
|
|
2908
2924
|
const Mn = h.div`display:flex;flex-direction:column;border-radius:12px;overflow:hidden;max-width:${({ $maxWidth: e }) => e}px;${({ theme: e, $color: t, $bgColor: n }) => I`
|
|
2909
2925
|
color: ${t || e.colors.messageIncoming.text};
|
|
@@ -3587,23 +3603,27 @@ function fc(e) {
|
|
|
3587
3603
|
return /* @__PURE__ */ r.createElement(Ir, { ...e, testerMode: !1 });
|
|
3588
3604
|
}
|
|
3589
3605
|
function Ir(e) {
|
|
3590
|
-
var
|
|
3591
|
-
const { components: t } = Ve.useContext(),
|
|
3592
|
-
|
|
3606
|
+
var b, f, g, v, _, M, C;
|
|
3607
|
+
const { components: t } = Ve.useContext(), { displayedText: n, isBuffering: o } = Si(e.message, e.isStreaming), s = {
|
|
3608
|
+
...e,
|
|
3609
|
+
message: n,
|
|
3610
|
+
extendedMessagePayload: o ? {} : e.extendedMessagePayload
|
|
3611
|
+
}, i = !!s.isTyping, a = s.testerMode, l = !!((b = s.extendedMessagePayload) != null && b.form) && !((f = s.extendedMessagePayload) != null && f.form.canceled_at), c = !!((g = s.extendedMessagePayload) != null && g.message_template), d = !!((v = s.extendedMessagePayload) != null && v.cta_button), m = !!((_ = s.extendedMessagePayload) != null && _.citations) && s.extendedMessagePayload.citations.length > 0, p = !!s.createdAt, E = s.groupType === "top" || s.groupType === "single", y = s.groupType === "bottom" || s.groupType === "single", x = a ? 0 : F.AVATAR_SIZE;
|
|
3612
|
+
return /* @__PURE__ */ r.createElement(bc, { $marginBottom: i ? 0 : Wt(s.groupType) }, E && /* @__PURE__ */ r.createElement(Ec, null, !a && /* @__PURE__ */ r.createElement(t.SenderAvatar, { ...s }), /* @__PURE__ */ r.createElement(t.SenderName, { ...s })), /* @__PURE__ */ r.createElement(vc, null, /* @__PURE__ */ r.createElement(Tt, { $extraStartPadding: x }, i ? /* @__PURE__ */ r.createElement(t.TypingIndicator, { ...s }) : /* @__PURE__ */ r.createElement(t.MessageBody, { ...s }, d && /* @__PURE__ */ r.createElement("div", { style: { marginTop: 12, marginInline: 12 } }, /* @__PURE__ */ r.createElement(t.CTAButton, { ...s })), m && /* @__PURE__ */ r.createElement(t.Citation, { ...s }))), c && /* @__PURE__ */ r.createElement(Pn, { $startPadding: 0, $endPadding: 0 }, /* @__PURE__ */ r.createElement(
|
|
3593
3613
|
t.MessageTemplate,
|
|
3594
3614
|
{
|
|
3595
|
-
...
|
|
3596
|
-
messageTemplateErrorFallback:
|
|
3615
|
+
...s,
|
|
3616
|
+
messageTemplateErrorFallback: s.messageTemplateErrorFallback ?? /* @__PURE__ */ r.createElement(Tt, { $extraStartPadding: x }, /* @__PURE__ */ r.createElement(
|
|
3597
3617
|
t.MessageBody,
|
|
3598
3618
|
{
|
|
3599
|
-
...
|
|
3619
|
+
...s,
|
|
3600
3620
|
messageType: "user",
|
|
3601
|
-
message: ((
|
|
3621
|
+
message: ((C = (M = s.extendedMessagePayload) == null ? void 0 : M.message_template) == null ? void 0 : C.fallback_message) ?? "Cannot read this template."
|
|
3602
3622
|
}
|
|
3603
3623
|
)),
|
|
3604
|
-
messageTemplateLoadingFallback:
|
|
3624
|
+
messageTemplateLoadingFallback: s.messageTemplateLoadingFallback ?? /* @__PURE__ */ r.createElement(Tt, { $extraStartPadding: x }, /* @__PURE__ */ r.createElement(t.TypingIndicator, { ...s }))
|
|
3605
3625
|
}
|
|
3606
|
-
)),
|
|
3626
|
+
)), l && /* @__PURE__ */ r.createElement(Pn, { $extraStartPadding: x }, /* @__PURE__ */ r.createElement(t.Form, { ...s }))), y && p && /* @__PURE__ */ r.createElement(xc, { $extraStartPadding: x + 8 }, /* @__PURE__ */ r.createElement(t.SentTime, { ...s })), /* @__PURE__ */ r.createElement(Xn, null, !i && /* @__PURE__ */ r.createElement(Ye, { $extraStartPadding: x + 8 }, /* @__PURE__ */ r.createElement(t.Feedback, { ...s })), s.suggestedRepliesVisible && /* @__PURE__ */ r.createElement(t.SuggestedReplies, { ...s }), /* @__PURE__ */ r.createElement(t.MessageLogs, { ...s })));
|
|
3607
3627
|
}
|
|
3608
3628
|
const bc = h.div`display:flex;flex-direction:column;align-items:flex-start;margin-bottom:${({ $marginBottom: e }) => `${e}px`};
|
|
3609
3629
|
`, Ye = h.div`display:flex;align-self:stretch;justify-content:flex-start;${({ $startPadding: e = F.HORIZONTAL_PADDING, $endPadding: t = F.HORIZONTAL_PADDING, $extraStartPadding: n = 0 }) => `
|
|
@@ -4198,7 +4218,7 @@ const Le = () => {
|
|
|
4198
4218
|
}
|
|
4199
4219
|
));
|
|
4200
4220
|
}, _d = h.div`display:flex;gap:16px;margin:16px ${F.HORIZONTAL_PADDING}px 0;align-self:stretch;`, Cd = h.div`width:${({ width: e }) => e}px;background-color:${u.themedColor.textDisabled};border-radius:100px;flex-shrink:0;`, Sd = h(k)`margin-top:5px;`, Td = (e) => {
|
|
4201
|
-
const { chatSDK: t, handlers: n, logger: o } = K(), { aiAgentInfo: s } =
|
|
4221
|
+
const { chatSDK: t, handlers: n, logger: o } = K(), { aiAgentInfo: s } = Q(), i = H(/* @__PURE__ */ new Set()), a = (m) => {
|
|
4202
4222
|
if (!(n != null && n.onCustomEvent)) return;
|
|
4203
4223
|
fe(m) && m.sender.userId === s.userId && !be.isStreaming(m) && !i.current.has(m.messageId) && (o.debug("useCustomEventForMessageReceive: bot-message-received", m), n.onCustomEvent({ type: "bot-message-received", data: { message: m } }), i.current.add(m.messageId));
|
|
4204
4224
|
}, l = (m) => {
|
|
@@ -4258,7 +4278,7 @@ const kd = ({ onScrollAfterSendMessage: e }) => {
|
|
|
4258
4278
|
if (!e) return null;
|
|
4259
4279
|
const t = {};
|
|
4260
4280
|
return e.ai && Object.keys(e.ai).length > 0 && (t.ai_attrs = e.ai), e.safeguard && Object.keys(e.safeguard).length > 0 && (t.safeguard_attrs = e.safeguard), typeof e.use_prompt_cache == "boolean" && (t.use_prompt_cache = e.use_prompt_cache), Object.keys(t).length > 0 ? t : null;
|
|
4261
|
-
}, Lr = 50, kt = Lr -
|
|
4281
|
+
}, Lr = 50, kt = Lr - 40, {
|
|
4262
4282
|
Provider: $d,
|
|
4263
4283
|
useContext: Md
|
|
4264
4284
|
} = J("ConversationScroll"), zn = {
|
|
@@ -4326,7 +4346,7 @@ function Od({ scrollMode: e, children: t }) {
|
|
|
4326
4346
|
top: R.scrollHeight,
|
|
4327
4347
|
behavior: S ? "smooth" : "auto"
|
|
4328
4348
|
});
|
|
4329
|
-
}, []),
|
|
4349
|
+
}, []), ee = O(
|
|
4330
4350
|
(S) => {
|
|
4331
4351
|
S && (n.current = S, g === "fixed" && ($(), s.current.viewport = S.clientHeight, o.current = new MutationObserver(() => {
|
|
4332
4352
|
w();
|
|
@@ -4336,7 +4356,7 @@ function Od({ scrollMode: e, children: t }) {
|
|
|
4336
4356
|
})));
|
|
4337
4357
|
},
|
|
4338
4358
|
[g, w, $]
|
|
4339
|
-
),
|
|
4359
|
+
), te = O(() => {
|
|
4340
4360
|
const S = n.current;
|
|
4341
4361
|
if (!S) return;
|
|
4342
4362
|
const R = C(S, { messageType: "outgoing" });
|
|
@@ -4350,8 +4370,8 @@ function Od({ scrollMode: e, children: t }) {
|
|
|
4350
4370
|
}, xe = O(() => {
|
|
4351
4371
|
g === "fixed" && (x(!0), _());
|
|
4352
4372
|
}, [g]), ve = O(() => {
|
|
4353
|
-
g === "fixed" ? setTimeout(() =>
|
|
4354
|
-
}, [g,
|
|
4373
|
+
g === "fixed" ? setTimeout(() => te(), 300) : B();
|
|
4374
|
+
}, [g, te]), Ie = O(
|
|
4355
4375
|
(S) => {
|
|
4356
4376
|
i.current = S, g === "fixed" && _();
|
|
4357
4377
|
},
|
|
@@ -4368,7 +4388,7 @@ function Od({ scrollMode: e, children: t }) {
|
|
|
4368
4388
|
$d,
|
|
4369
4389
|
{
|
|
4370
4390
|
value: {
|
|
4371
|
-
ref:
|
|
4391
|
+
ref: ee,
|
|
4372
4392
|
state: {
|
|
4373
4393
|
bottomSpace: l,
|
|
4374
4394
|
shouldShowScrollButton: P
|
|
@@ -4409,7 +4429,7 @@ const {
|
|
|
4409
4429
|
children: s
|
|
4410
4430
|
}) => {
|
|
4411
4431
|
var v;
|
|
4412
|
-
const { config: i } = q(), { activeChannel: a, refreshActiveChannel: l, aiAgentInfo: c } =
|
|
4432
|
+
const { config: i } = q(), { activeChannel: a, refreshActiveChannel: l, aiAgentInfo: c } = Q(), { testerType: d } = Le(), m = Md(), p = ((v = i == null ? void 0 : i.conversation) == null ? void 0 : v.scrollMode) ?? "auto", { onBeforeSendMessage: E, onAfterSendMessage: y } = kd({
|
|
4413
4433
|
onScrollAfterSendMessage: () => {
|
|
4414
4434
|
m.actions.onAfterMessageSend();
|
|
4415
4435
|
}
|
|
@@ -4507,7 +4527,7 @@ function qd(e, t) {
|
|
|
4507
4527
|
return e.filter((n) => be.isWelcomeMessage(n, t));
|
|
4508
4528
|
}
|
|
4509
4529
|
const Kd = h.div`width:100%;height:100%;position:fixed;top:0;left:0;outline:none;`, Zd = h.div`height:64px;min-height:64px;box-sizing:border-box;display:flex;justify-content:space-between;border-bottom:1px solid ${u.themedColor.textDisabled};background-color:${u.themedColor.bg_50_600};@media screen and (max-width:768px){position:relative;}`, Yd = h.div`box-sizing:border-box;display:flex;flex-direction:row;align-items:center;height:64px;padding:16px 20px;width:calc(100% - 128px);`, Xd = h.div`margin-inline-end:8px;`, Jd = h.div`max-width:500px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:inline-block;@media screen and (max-width:768px){position:absolute;inset-inline-start:64px;top:10px;display:block;max-width:calc(100vw - 240px);}`, Qd = h.div`display:inline-block;margin-inline-start:8px;padding-top:5px;@media screen and (max-width:768px){position:absolute;inset-inline-start:56px;top:24px;}`, eu = h.div`display:flex;width:160px;justify-content:flex-end;`, tu = h.div`inset-inline-end:0;display:flex;flex-direction:row;`, Dr = h.div`width:64px;padding:21px;box-sizing:border-box;cursor:${(e) => e.disabled ? "not-allowed" : "pointer"};`, nu = h(Dr)`border-inline-start:1px solid ${u.themedColor.textDisabled};`, ru = h.div`width:100%;height:100%;display:flex;align-items:center;justify-content:center;`, ou = h.video`max-width:100%;max-height:100%;user-select:none;-webkit-user-drag:none;`, su = h.img`max-width:calc(90% - 60px);max-height:calc(90% - 60px);user-select:none;-webkit-user-drag:none;`, iu = h.div`max-width:100%;max-height:100%;display:flex;justify-content:center;align-items:center;`, au = ({ file: e, sender: t = {}, onClose: n, onDownloadClick: o }) => {
|
|
4510
|
-
const { type: s, url: i, name: a = "" } = e, { profileUrl: l, nickname: c, userId: d } = t, { aiAgentInfo: m } =
|
|
4530
|
+
const { type: s, url: i, name: a = "" } = e, { profileUrl: l, nickname: c, userId: d } = t, { aiAgentInfo: m } = Q();
|
|
4511
4531
|
return /* @__PURE__ */ r.createElement(
|
|
4512
4532
|
cu,
|
|
4513
4533
|
{
|
|
@@ -4595,7 +4615,7 @@ const Kd = h.div`width:100%;height:100%;position:fixed;top:0;left:0;outline:none
|
|
|
4595
4615
|
outline: none;
|
|
4596
4616
|
}
|
|
4597
4617
|
`, xu = () => {
|
|
4598
|
-
const { agentPreviewConfigs: e = {}, aiAgentId: t } = K(), { aiAgentInfo: n } =
|
|
4618
|
+
const { agentPreviewConfigs: e = {}, aiAgentId: t } = K(), { aiAgentInfo: n } = Q(), { stringSet: o, dateLocale: s } = z(), { messageSource: i } = ie(), { Template: a } = Ve.useContext(), l = e.welcomeMessages ?? [], c = i.messages, d = qd(c, t), m = c[d.length + 1], p = d[0] ?? m;
|
|
4599
4619
|
return {
|
|
4600
4620
|
/**
|
|
4601
4621
|
* Returns a list of messages filtered according to business requirements.
|
|
@@ -4677,21 +4697,21 @@ const Kd = h.div`width:100%;height:100%;position:fixed;top:0;left:0;outline:none
|
|
|
4677
4697
|
e.TALK_TO_AGENT
|
|
4678
4698
|
));
|
|
4679
4699
|
}, Tu = h.div`display:flex;justify-content:center;margin-bottom:16px;`, Au = h(k)`border-radius:6px;box-sizing:border-box;padding:10px 20px;border:1px solid ${u.themedColor.textDisabled};cursor:pointer;user-select:none;`, wu = () => {
|
|
4680
|
-
const { Template: e } = nn.useContext(), { Template: t } = Ve.useContext(), { Template: n } = rn.useContext(), [o, s] = T(null), [i, a] = T(null), { userSession: l, aiAgentInfo: c } =
|
|
4700
|
+
const { Template: e } = nn.useContext(), { Template: t } = Ve.useContext(), { Template: n } = rn.useContext(), [o, s] = T(null), [i, a] = T(null), { userSession: l, aiAgentInfo: c } = Q(), { cache: d, agentPreviewConfigs: m, chatSDK: p, state: E } = K(), { config: y } = q(), { stringSet: x, dateLocale: b } = z(), {
|
|
4681
4701
|
conversation: f,
|
|
4682
4702
|
channelSource: g,
|
|
4683
4703
|
messageSource: v,
|
|
4684
4704
|
scrollSource: _,
|
|
4685
4705
|
state: { input: M }
|
|
4686
|
-
} = ie(), { isActionbookTester: C } = Le(), { filteredMessages: w, shouldShowOriginalDate: $, renderAgentPreviewWelcomeMessages: B } = xu(),
|
|
4687
|
-
const j =
|
|
4706
|
+
} = ie(), { isActionbookTester: C } = Le(), { filteredMessages: w, shouldShowOriginalDate: $, renderAgentPreviewWelcomeMessages: B } = xu(), ee = gr(g.channel), te = (() => {
|
|
4707
|
+
const j = ee[0];
|
|
4688
4708
|
if (!j) return null;
|
|
4689
4709
|
const A = j.userId === c.userId;
|
|
4690
4710
|
return { user: A ? c : j, isBot: A };
|
|
4691
4711
|
})();
|
|
4692
4712
|
U(() => {
|
|
4693
|
-
_.actions.onTypingIndicatorUpdate(!!
|
|
4694
|
-
}, [!!
|
|
4713
|
+
_.actions.onTypingIndicatorUpdate(!!te);
|
|
4714
|
+
}, [!!te, _.actions.onTypingIndicatorUpdate]);
|
|
4695
4715
|
const le = Te(g.channel);
|
|
4696
4716
|
U(() => {
|
|
4697
4717
|
_.actions.onConversationClosed(le);
|
|
@@ -4722,12 +4742,12 @@ const Kd = h.div`width:100%;height:100%;position:fixed;top:0;left:0;outline:none
|
|
|
4722
4742
|
depsForResetScrollPositionToBottom: [v.initialized, v.messages.length !== 0],
|
|
4723
4743
|
bottomSpacerHeight: _.state.bottomSpace,
|
|
4724
4744
|
messageTopArea: /* @__PURE__ */ r.createElement(r.Fragment, null, /* @__PURE__ */ r.createElement(yu, { style: { marginTop: 16 } }), B()),
|
|
4725
|
-
messageBottomArea: /* @__PURE__ */ r.createElement(r.Fragment, null,
|
|
4745
|
+
messageBottomArea: /* @__PURE__ */ r.createElement(r.Fragment, null, te && /* @__PURE__ */ r.createElement("div", { id: `${oe}-message-item` }, /* @__PURE__ */ r.createElement(
|
|
4726
4746
|
t,
|
|
4727
4747
|
{
|
|
4728
4748
|
isTyping: !0,
|
|
4729
|
-
isBotMessage:
|
|
4730
|
-
sender:
|
|
4749
|
+
isBotMessage: te.isBot,
|
|
4750
|
+
sender: te.user,
|
|
4731
4751
|
messageType: "user",
|
|
4732
4752
|
groupType: "single",
|
|
4733
4753
|
message: ""
|
|
@@ -4880,7 +4900,7 @@ const Kd = h.div`width:100%;height:100%;position:fixed;top:0;left:0;outline:none
|
|
|
4880
4900
|
x.FAILED_MESSAGE_REMOVE
|
|
4881
4901
|
)));
|
|
4882
4902
|
}, ku = h.div`overflow-y:hidden;display:flex;flex:1;position:relative;`, Iu = h(bu)`position:absolute;bottom:20px;inset-inline-end:20px;`, $u = () => {
|
|
4883
|
-
const { stringSet: e } = z(), { connectionError: t } =
|
|
4903
|
+
const { stringSet: e } = z(), { connectionError: t } = Q(), { channelSource: n } = ie(), o = t || n.error;
|
|
4884
4904
|
if (o) {
|
|
4885
4905
|
const s = t ? void 0 : { label: e.RETRY, onClick: () => n.refetch() };
|
|
4886
4906
|
return /* @__PURE__ */ r.createElement(ze, { type: "error", label: o.message, action: s });
|
|
@@ -4905,7 +4925,7 @@ const Kd = h.div`width:100%;height:100%;position:fixed;top:0;left:0;outline:none
|
|
|
4905
4925
|
)) : null;
|
|
4906
4926
|
}, Pt = h.div`display:flex;justify-content:center;align-items:center;`, Ou = h(Pt)`flex-direction:column;padding-block:16px;background-color:${u.themedColor.bg_100_500};gap:8px;`, Nr = We(void 0), Lu = ({ children: e }) => {
|
|
4907
4927
|
var b;
|
|
4908
|
-
const { chatSDK: t } = K(), { createAttachmentRules: n } =
|
|
4928
|
+
const { chatSDK: t } = K(), { createAttachmentRules: n } = Q(), { stringSet: o } = z(), { channelSource: s } = ie(), [i, a] = T([]), [l, c] = T({
|
|
4909
4929
|
visible: !1,
|
|
4910
4930
|
title: ""
|
|
4911
4931
|
}), d = n({
|
|
@@ -5111,8 +5131,8 @@ const Ru = (e, t) => {
|
|
|
5111
5131
|
color: ${u.color.information.main};
|
|
5112
5132
|
`};
|
|
5113
5133
|
}
|
|
5114
|
-
`, Wu = L(() => import("./
|
|
5115
|
-
const { aiAgentInfo: e, userSession: t } =
|
|
5134
|
+
`, Wu = L(() => import("./4kOEVHcG.js").then((e) => ({ default: e.MarkdownText }))), Gu = () => {
|
|
5135
|
+
const { aiAgentInfo: e, userSession: t } = Q(), { messageSource: n, channelSource: o } = ie(), [s, i] = T(null), a = qt("special-notice", o.channel), l = O(() => o.channel ? a ? n.messages.some((c) => He(c, (t == null ? void 0 : t.userId) ?? "")) : !0 : null, [o.channel, a, n.messages, t == null ? void 0 : t.userId]);
|
|
5116
5136
|
return U(() => {
|
|
5117
5137
|
s || i(l());
|
|
5118
5138
|
}, [l, s]), s ? null : /* @__PURE__ */ r.createElement(zu, null, /* @__PURE__ */ r.createElement(Wu, null, e.specialNotice));
|
|
@@ -5121,7 +5141,7 @@ const Ru = (e, t) => {
|
|
|
5121
5141
|
const { testerType: e } = Le(), { channelSource: t } = ie(), n = Te(t.channel), o = !!e && ((s = t.channel) == null ? void 0 : s.isAIAgent);
|
|
5122
5142
|
return n && o ? /* @__PURE__ */ r.createElement(Mu, null) : /* @__PURE__ */ r.createElement(ju, null);
|
|
5123
5143
|
}, Pr = ({ channel: e, size: t = 40 }) => {
|
|
5124
|
-
const { userSession: n, aiAgentInfo: o } =
|
|
5144
|
+
const { userSession: n, aiAgentInfo: o } = Q(), { fallbackIcon: s, url: i } = fr({ channel: e, aiAgentInfo: o, userSession: n }), a = gt();
|
|
5125
5145
|
return i ? /* @__PURE__ */ r.createElement(Xt, { src: i, size: t }) : /* @__PURE__ */ r.createElement(Zu, { $size: t, $bgColor: a.colors.base.primary }, /* @__PURE__ */ r.createElement(D, { type: s, size: t * 0.55, color: a.colors.base.primaryContrastContent }));
|
|
5126
5146
|
}, Zu = h.div`width:${({ $size: e }) => e}px;height:${({ $size: e }) => e}px;border-radius:50%;background-color:${({ $bgColor: e }) => e};display:flex;align-items:center;justify-content:center;flex-shrink:0;`, Yu = ({ label: e, children: t, position: n = "top", disabled: o }) => o ? t : /* @__PURE__ */ r.createElement(Ut, null, t, /* @__PURE__ */ r.createElement(Qu, { $position: n }, /* @__PURE__ */ r.createElement(em, { variant: "caption1" }, e), /* @__PURE__ */ r.createElement(Xu, { $position: n }))), Xu = ({ $position: e }) => /* @__PURE__ */ r.createElement(
|
|
5127
5147
|
"svg",
|
|
@@ -5138,7 +5158,7 @@ const Ru = (e, t) => {
|
|
|
5138
5158
|
top: I`flex-direction:column;top:0;transform:translate(-50%,-100%);`,
|
|
5139
5159
|
bottom: I`flex-direction:column-reverse;bottom:0;transform:translate(-50%,100%);`
|
|
5140
5160
|
}, Ut = h.div`position:relative;`, Qu = h.div`display:flex;align-items:center;position:absolute;left:50%;z-index:${Oe.TOOLTIP};${({ $position: e }) => Ju[e]}opacity:0;transition:opacity 0.2s ease-in-out;pointer-events:none;${Ut}:hover &,${Ut}:focus-within &{opacity:1;}`, em = h(k)`padding:6px 8px;background:${u.themedColor.textHighEmphasis};color:${u.themedColor.textHighEmphasisInverse};border-radius:4px;font-size:12px;white-space:nowrap;`, tm = () => {
|
|
5141
|
-
const { state: e, logger: t, enableCloseConversationButton: n, enableExpandButton: o, dispatcher: s } = K(), { stringSet: i } = z(), { channelSource: a, onNavigateToConversationList: l } = ie(), { aiAgentInfo: c, userSession: d } =
|
|
5161
|
+
const { state: e, logger: t, enableCloseConversationButton: n, enableExpandButton: o, dispatcher: s } = K(), { stringSet: i } = z(), { channelSource: a, onNavigateToConversationList: l } = ie(), { aiAgentInfo: c, userSession: d } = Q(), m = a.channel, E = je() ? 24 : 16, y = fr({ channel: m, userSession: d, aiAgentInfo: c }), x = () => {
|
|
5142
5162
|
e.setOpened(!1);
|
|
5143
5163
|
}, b = async () => {
|
|
5144
5164
|
try {
|
|
@@ -5288,7 +5308,7 @@ const Em = h.div`display:flex;flex-shrink:0;flex-direction:row;align-items:cente
|
|
|
5288
5308
|
}
|
|
5289
5309
|
) : /* @__PURE__ */ r.createElement(ze, { type: "loading" });
|
|
5290
5310
|
}, km = () => {
|
|
5291
|
-
const { stringSet: e } = z(), { language: t, countryCode: n, context: o } = K(), { aiAgentInfo: s, refreshActiveChannel: i, createConversation: a, setActiveChannel: l } =
|
|
5311
|
+
const { stringSet: e } = z(), { language: t, countryCode: n, context: o } = K(), { aiAgentInfo: s, refreshActiveChannel: i, createConversation: a, setActiveChannel: l } = Q(), { onOpenConversationView: c } = Ur();
|
|
5292
5312
|
return /* @__PURE__ */ r.createElement(
|
|
5293
5313
|
Im,
|
|
5294
5314
|
{
|
|
@@ -5502,7 +5522,7 @@ const Jm = I`&:hover{transition:transform 250ms cubic-bezier(0.33,0,0,1);transfo
|
|
|
5502
5522
|
Close: ({ size: e }) => /* @__PURE__ */ r.createElement(D, { size: e, type: "chevron-down" })
|
|
5503
5523
|
};
|
|
5504
5524
|
function jr({ className: e, size: t }) {
|
|
5505
|
-
const { colors: n } = gt(), { dir: o, state: s } = K(), { launcherInfo: i } =
|
|
5525
|
+
const { colors: n } = gt(), { dir: o, state: s } = K(), { launcherInfo: i } = Q();
|
|
5506
5526
|
return og(), /* @__PURE__ */ r.createElement(
|
|
5507
5527
|
Xm,
|
|
5508
5528
|
{
|
|
@@ -5660,7 +5680,7 @@ const ge = {
|
|
|
5660
5680
|
s
|
|
5661
5681
|
)));
|
|
5662
5682
|
}, gg = ({ onOpenConversationView: e }) => {
|
|
5663
|
-
const { registerOnJoinedProactiveConversation: t } =
|
|
5683
|
+
const { registerOnJoinedProactiveConversation: t } = Q(), { navigation: n } = Kr();
|
|
5664
5684
|
return t(({ channel: o }) => {
|
|
5665
5685
|
e(o.url), n.navigate(ge.conv);
|
|
5666
5686
|
}), null;
|
|
@@ -5770,7 +5790,20 @@ const Cg = h.div`background:${({ theme: e }) => e.colors.base.background};displa
|
|
|
5770
5790
|
]), null;
|
|
5771
5791
|
}, Kg = Object.assign(Ag, {
|
|
5772
5792
|
Style: wg
|
|
5773
|
-
})
|
|
5793
|
+
}), Zg = (e) => {
|
|
5794
|
+
const { refreshActiveChannel: t } = Q(), [n, o] = T(!1), s = H(null), i = H(null);
|
|
5795
|
+
return U(() => {
|
|
5796
|
+
n && t().then(() => {
|
|
5797
|
+
var a;
|
|
5798
|
+
(a = s.current) == null || a.call(s), o(!1);
|
|
5799
|
+
}).catch((a) => {
|
|
5800
|
+
var l;
|
|
5801
|
+
(l = i.current) == null || l.call(i, a), o(!1);
|
|
5802
|
+
});
|
|
5803
|
+
}, [n]), O(() => new Promise((a, l) => {
|
|
5804
|
+
s.current = a, i.current = l, e().then(() => o(!0)).catch(l);
|
|
5805
|
+
}), [e]);
|
|
5806
|
+
};
|
|
5774
5807
|
export {
|
|
5775
5808
|
Yt as A,
|
|
5776
5809
|
Hr as C,
|
|
@@ -5785,25 +5818,26 @@ export {
|
|
|
5785
5818
|
Vr as a,
|
|
5786
5819
|
jm as b,
|
|
5787
5820
|
u as c,
|
|
5788
|
-
|
|
5821
|
+
Q as d,
|
|
5789
5822
|
Wg as e,
|
|
5790
5823
|
z as f,
|
|
5791
5824
|
qm as g,
|
|
5792
5825
|
qg as h,
|
|
5793
|
-
|
|
5794
|
-
|
|
5795
|
-
|
|
5796
|
-
|
|
5826
|
+
Zg as i,
|
|
5827
|
+
um as j,
|
|
5828
|
+
cn as k,
|
|
5829
|
+
Gg as l,
|
|
5797
5830
|
wi as m,
|
|
5798
|
-
|
|
5799
|
-
|
|
5800
|
-
|
|
5801
|
-
|
|
5802
|
-
|
|
5803
|
-
|
|
5804
|
-
|
|
5831
|
+
Rd as n,
|
|
5832
|
+
ie as o,
|
|
5833
|
+
Fm as p,
|
|
5834
|
+
dn as q,
|
|
5835
|
+
jg as r,
|
|
5836
|
+
pm as s,
|
|
5837
|
+
Ur as t,
|
|
5805
5838
|
K as u,
|
|
5806
|
-
|
|
5807
|
-
|
|
5808
|
-
|
|
5839
|
+
he as v,
|
|
5840
|
+
lr as w,
|
|
5841
|
+
$s as x,
|
|
5842
|
+
Cn as y
|
|
5809
5843
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { m as T } from "./
|
|
1
|
+
import { m as T } from "./Do-qZ-xC.js";
|
|
2
2
|
import { ja as o } from "date-fns/locale/ja";
|
|
3
3
|
const t = {
|
|
4
4
|
conversation: {
|
|
@@ -65,18 +65,13 @@ const t = {
|
|
|
65
65
|
dateLocale: o
|
|
66
66
|
}, a = T(e.strings), A = {
|
|
67
67
|
...a,
|
|
68
|
-
// Channel
|
|
69
|
-
CHANNEL_FROZEN: "チャンネルが凍結されました",
|
|
70
68
|
// Channel Header
|
|
71
69
|
HEADER_BUTTON__AGENT_HANDOFF: "エージェントに接続",
|
|
72
70
|
// Message Input
|
|
73
71
|
MESSAGE_INPUT__PLACE_HOLDER__SUGGESTED_REPLIES: "続行するにはオプションを選択してください",
|
|
74
72
|
// Common UI
|
|
75
73
|
BUTTON__CANCEL: "キャンセル",
|
|
76
|
-
BUTTON__SAVE: "保存",
|
|
77
|
-
BUTTON__OK: "OK",
|
|
78
74
|
BUTTON__SUBMIT: "送信",
|
|
79
|
-
NO_NAME: "(名前なし)",
|
|
80
75
|
SUBMITTED: "送信済み",
|
|
81
76
|
TRY_AGAIN: "もう一度お試しください。",
|
|
82
77
|
// File Upload
|
|
@@ -90,11 +85,6 @@ const t = {
|
|
|
90
85
|
CSAT5_RATING_SCORE_3: "普通",
|
|
91
86
|
CSAT5_RATING_SCORE_4: "良い",
|
|
92
87
|
CSAT5_RATING_SCORE_5: "素晴らしい",
|
|
93
|
-
// Conversation list
|
|
94
|
-
CONVERSATION_CLOSED_FOOTER_LABEL: "会話が終了しました",
|
|
95
|
-
START_NEW_CONVERSATION: "💬 新しい会話を始める",
|
|
96
|
-
RETURN_TO_CONVERSATION: "💬 会話に戻る",
|
|
97
|
-
CONVERSATION_LIST__TOPICS_FALLBACK: "カテゴリなし",
|
|
98
88
|
// Form
|
|
99
89
|
FORM_UNAVAILABLE: "このフォームはもう利用できません。",
|
|
100
90
|
FORM_NOT_SUPPORTED: "このフォームは現在のバージョンではサポートされていません。",
|
|
@@ -108,7 +98,23 @@ const t = {
|
|
|
108
98
|
/** @deprecated Please use DATE_FORMAT__DATE_SHORT instead. **/
|
|
109
99
|
DATE_FORMAT__CONVERSATION_LIST__LIST_ITEM_TITLE: a.DATE_FORMAT__DATE_SHORT,
|
|
110
100
|
/** @deprecated Unused string **/
|
|
111
|
-
DATE_FORMAT__CONVERSATION_LIST__LIST_ITEM_TITLE_CAPTION: "HH:mm"
|
|
101
|
+
DATE_FORMAT__CONVERSATION_LIST__LIST_ITEM_TITLE_CAPTION: "HH:mm",
|
|
102
|
+
/** @deprecated Unused string **/
|
|
103
|
+
CONVERSATION_LIST__TOPICS_FALLBACK: "カテゴリなし",
|
|
104
|
+
/** @deprecated Unused string **/
|
|
105
|
+
CONVERSATION_CLOSED_FOOTER_LABEL: "会話が終了しました",
|
|
106
|
+
/** @deprecated Unused string **/
|
|
107
|
+
START_NEW_CONVERSATION: "💬 新しい会話を始める",
|
|
108
|
+
/** @deprecated Unused string **/
|
|
109
|
+
RETURN_TO_CONVERSATION: "💬 会話に戻る",
|
|
110
|
+
/** @deprecated Unused string **/
|
|
111
|
+
BUTTON__SAVE: "保存",
|
|
112
|
+
/** @deprecated Unused string **/
|
|
113
|
+
BUTTON__OK: "OK",
|
|
114
|
+
/** @deprecated Unused string **/
|
|
115
|
+
NO_NAME: "(名前なし)",
|
|
116
|
+
/** @deprecated Unused string **/
|
|
117
|
+
CHANNEL_FROZEN: "チャンネルが凍結されました"
|
|
112
118
|
}, n = {
|
|
113
119
|
language: e.language,
|
|
114
120
|
dateLocale: e.dateLocale,
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./cjs/
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./cjs/a9HLj-8m.cjs");require("react");exports.AgentProviderContainer=e.AgentProviderContainer;exports.AgentUIProviderContainer=e.AgentUIProviderContainer;exports.AnonymousSessionInfo=e.AnonymousSessionInfo;exports.CSATType=e.CSATType;exports.Commands=e.DispatcherCommands;exports.Conversation=e.Conversation;exports.ConversationContext=e.ConversationContext;exports.ConversationContextProvider=e.ConversationContextProvider;exports.ConversationLayout=e.ConversationLayout;exports.ConversationList=e.ConversationList;exports.ConversationListContext=e.ConversationListContext;exports.ConversationListContextProvider=e.ConversationListContextProvider;exports.ConversationListItemLayout=e.ConversationListItemLayout;exports.ConversationListLayout=e.ConversationListLayout;exports.DefaultMessenger=e.DefaultMessenger;exports.FixedMessenger=e.FixedMessenger;exports.IncomingMessageLayout=e.IncomingMessageLayout;exports.LauncherBase=e.LauncherBase;exports.LogLevel=e.LogLevel;exports.ManualSessionInfo=e.ManualSessionInfo;exports.MessageLogs=e.MessageLogs;exports.OutgoingMessageLayout=e.OutgoingMessageLayout;exports.PlaceholderLayout=e.PlaceholderLayout;exports.SystemMessageLayout=e.SystemMessageLayout;exports.messengerDispatcher=e.messengerDispatcher;exports.useConversationContext=e.useConversationContext;exports.useConversationListContext=e.useConversationListContext;exports.useLocalizationContext=e.useLocalizationContext;exports.useMessengerContext=e.useMessengerContext;exports.useMessengerSessionContext=e.useMessengerSessionContext;exports.useRefreshActiveChannel=e.useRefreshActiveChannel;
|