@_solaris/messenger-widget 0.5.16 → 0.5.17
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/iframe/iframe.css +1 -1
- package/dist/iframe/iframe.js +6 -6
- package/dist/messenger.cjs +3 -3
- package/dist/messenger.js +86 -65
- package/dist/snippet.js +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/messenger.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { reactive as Fe, openBlock as c, createElementBlock as u, normalizeStyle as q, normalizeClass as O, toDisplayString as v, resolveComponent as E, createVNode as V, Transition as
|
|
1
|
+
import { reactive as Fe, openBlock as c, createElementBlock as u, normalizeStyle as q, normalizeClass as O, toDisplayString as v, resolveComponent as E, createVNode as V, Transition as Ue, withCtx as Pe, Fragment as R, renderList as j, withKeys as ue, withModifiers as Y, createElementVNode as o, createCommentVNode as w, createBlock as U, withDirectives as K, vModelText as X, createTextVNode as pe, resolveDynamicComponent as je, renderSlot as De, vModelCheckbox as ze, vModelSelect as He, markRaw as ke } from "vue";
|
|
2
2
|
const qe = [
|
|
3
3
|
"connected",
|
|
4
4
|
"message",
|
|
@@ -88,7 +88,10 @@ function We(e) {
|
|
|
88
88
|
headers: s(),
|
|
89
89
|
body: JSON.stringify({
|
|
90
90
|
origin: t.origin,
|
|
91
|
-
...t.token ? { token: t.token } : {}
|
|
91
|
+
...t.token ? { token: t.token } : {},
|
|
92
|
+
// Déclaration de mode du marchand (validée serveur contre
|
|
93
|
+
// widgets.allow_unauthenticated). Le serveur 400 si mismatch.
|
|
94
|
+
allowUnauthenticated: d.allowUnauthenticated === !0
|
|
92
95
|
})
|
|
93
96
|
}
|
|
94
97
|
);
|
|
@@ -175,7 +178,7 @@ function We(e) {
|
|
|
175
178
|
`/conversations/${encodeURIComponent(d)}/messages${y}`
|
|
176
179
|
);
|
|
177
180
|
}
|
|
178
|
-
async function
|
|
181
|
+
async function P(d, f) {
|
|
179
182
|
se();
|
|
180
183
|
const _ = {
|
|
181
184
|
client_msg_id: f.client_msg_id,
|
|
@@ -309,7 +312,7 @@ function We(e) {
|
|
|
309
312
|
patchConversation: M,
|
|
310
313
|
markConversationRead: F,
|
|
311
314
|
listMessages: N,
|
|
312
|
-
postMessage:
|
|
315
|
+
postMessage: P,
|
|
313
316
|
postCallback: W,
|
|
314
317
|
uploadAttachment: Z,
|
|
315
318
|
signAttachment: ee,
|
|
@@ -616,7 +619,7 @@ function Qe(e) {
|
|
|
616
619
|
}
|
|
617
620
|
return null;
|
|
618
621
|
}
|
|
619
|
-
async function
|
|
622
|
+
async function P(h, { rating: m, comment: g } = {}) {
|
|
620
623
|
const d = t.conversations.find((y) => y.id === h), _ = {
|
|
621
624
|
...(d == null ? void 0 : d.metadata) || {},
|
|
622
625
|
feedback: {
|
|
@@ -753,7 +756,7 @@ function Qe(e) {
|
|
|
753
756
|
send: z,
|
|
754
757
|
clickCallback: M,
|
|
755
758
|
signAttachment: N,
|
|
756
|
-
submitFeedback:
|
|
759
|
+
submitFeedback: P,
|
|
757
760
|
getPendingApproval: W,
|
|
758
761
|
getActionInFlight: ee,
|
|
759
762
|
getLatestSuggestions: te,
|
|
@@ -1701,8 +1704,8 @@ function Nt(e, t, n, i, r, s) {
|
|
|
1701
1704
|
onFocusin: t[3] || (t[3] = (l) => e.$emit("hover", !0)),
|
|
1702
1705
|
onFocusout: t[4] || (t[4] = (l) => e.$emit("hover", !1))
|
|
1703
1706
|
}, [
|
|
1704
|
-
V(
|
|
1705
|
-
default:
|
|
1707
|
+
V(Ue, { name: "wm-peek" }, {
|
|
1708
|
+
default: Pe(() => [
|
|
1706
1709
|
s.visiblePeeks.length ? (c(), u("div", {
|
|
1707
1710
|
key: 0,
|
|
1708
1711
|
class: O(["wm-peekStack", { "wm-peekStack--multi": s.visiblePeeks.length > 1 }])
|
|
@@ -1805,7 +1808,7 @@ function Nt(e, t, n, i, r, s) {
|
|
|
1805
1808
|
], 8, Et)
|
|
1806
1809
|
], 32);
|
|
1807
1810
|
}
|
|
1808
|
-
const Ft = /* @__PURE__ */ B(kt, [["render", Nt], ["__scopeId", "data-v-9d7efc48"]]),
|
|
1811
|
+
const Ft = /* @__PURE__ */ B(kt, [["render", Nt], ["__scopeId", "data-v-9d7efc48"]]), Ut = {
|
|
1809
1812
|
name: "WmAIAvatar",
|
|
1810
1813
|
props: {
|
|
1811
1814
|
size: { type: Number, default: 26 },
|
|
@@ -1834,7 +1837,7 @@ const Ft = /* @__PURE__ */ B(kt, [["render", Nt], ["__scopeId", "data-v-9d7efc48
|
|
|
1834
1837
|
return ve(this.name);
|
|
1835
1838
|
}
|
|
1836
1839
|
}
|
|
1837
|
-
},
|
|
1840
|
+
}, Pt = {
|
|
1838
1841
|
key: 0,
|
|
1839
1842
|
class: "wm-aiav__pulse"
|
|
1840
1843
|
}, jt = ["src", "alt"], Dt = ["width", "height"];
|
|
@@ -1847,7 +1850,7 @@ function zt(e, t, n, i, r, s) {
|
|
|
1847
1850
|
"--wm-avr": n.size * 0.32 + "px"
|
|
1848
1851
|
})
|
|
1849
1852
|
}, [
|
|
1850
|
-
n.pulse ? (c(), u("div",
|
|
1853
|
+
n.pulse ? (c(), u("div", Pt)) : w("", !0),
|
|
1851
1854
|
o("div", {
|
|
1852
1855
|
class: O(["wm-aiav__inner", {
|
|
1853
1856
|
"wm-aiav__inner--glow": n.pulse,
|
|
@@ -1896,7 +1899,7 @@ function zt(e, t, n, i, r, s) {
|
|
|
1896
1899
|
], 6)
|
|
1897
1900
|
], 6);
|
|
1898
1901
|
}
|
|
1899
|
-
const le = /* @__PURE__ */ B(
|
|
1902
|
+
const le = /* @__PURE__ */ B(Ut, [["render", zt], ["__scopeId", "data-v-6f7f685d"]]), Ht = {
|
|
1900
1903
|
name: "WmTeamAvatars",
|
|
1901
1904
|
props: {
|
|
1902
1905
|
members: { type: Array, default: () => [] },
|
|
@@ -2031,7 +2034,7 @@ function on(e, t, n, i, r, s) {
|
|
|
2031
2034
|
o("div", en, [
|
|
2032
2035
|
o("div", tn, v(n.title), 1)
|
|
2033
2036
|
]),
|
|
2034
|
-
s.hasTeam ? (c(),
|
|
2037
|
+
s.hasTeam ? (c(), U(l, {
|
|
2035
2038
|
key: 0,
|
|
2036
2039
|
members: s.displayedTeamMembers,
|
|
2037
2040
|
"response-label": ""
|
|
@@ -2279,7 +2282,7 @@ const Te = {
|
|
|
2279
2282
|
}, On = {
|
|
2280
2283
|
key: 1,
|
|
2281
2284
|
class: "wm-onb__section"
|
|
2282
|
-
}, Ln = { class: "wm-onb__section-title" }, In = { class: "wm-onb__search" }, Rn = ["placeholder", "aria-label"], En = { class: "wm-onb__list" }, Bn = ["onClick"], Nn = ["aria-label"], Fn = { class: "wm-onb__thread-body" },
|
|
2285
|
+
}, Ln = { class: "wm-onb__section-title" }, In = { class: "wm-onb__search" }, Rn = ["placeholder", "aria-label"], En = { class: "wm-onb__list" }, Bn = ["onClick"], Nn = ["aria-label"], Fn = { class: "wm-onb__thread-body" }, Un = { class: "wm-onb__thread-title" }, Pn = ["innerHTML"], jn = { class: "wm-onb__thread-meta" }, Dn = {
|
|
2283
2286
|
key: 0,
|
|
2284
2287
|
class: "wm-onb__thread-time"
|
|
2285
2288
|
}, zn = {
|
|
@@ -2440,11 +2443,11 @@ function Hn(e, t, n, i, r, s) {
|
|
|
2440
2443
|
}, null, 8, Nn)) : w("", !0)
|
|
2441
2444
|
], 2),
|
|
2442
2445
|
o("span", Fn, [
|
|
2443
|
-
o("span",
|
|
2446
|
+
o("span", Un, v(l.title), 1),
|
|
2444
2447
|
o("span", {
|
|
2445
2448
|
class: "wm-onb__thread-preview",
|
|
2446
2449
|
innerHTML: s.renderPreview(l.preview)
|
|
2447
|
-
}, null, 8,
|
|
2450
|
+
}, null, 8, Pn)
|
|
2448
2451
|
]),
|
|
2449
2452
|
o("span", jn, [
|
|
2450
2453
|
s.formatTs(l._ts) ? (c(), u("span", Dn, v(s.formatTs(l._ts)), 1)) : w("", !0),
|
|
@@ -2778,7 +2781,7 @@ const Ss = {
|
|
|
2778
2781
|
key: 1,
|
|
2779
2782
|
class: "wm-art__footer wm-tk__footer"
|
|
2780
2783
|
};
|
|
2781
|
-
function
|
|
2784
|
+
function Us(e, t, n, i, r, s) {
|
|
2782
2785
|
return c(), u("div", Ms, [
|
|
2783
2786
|
o("div", Ts, [
|
|
2784
2787
|
o("div", xs, v(n.data.title), 1),
|
|
@@ -2897,10 +2900,10 @@ function Ps(e, t, n, i, r, s) {
|
|
|
2897
2900
|
])) : w("", !0)
|
|
2898
2901
|
]);
|
|
2899
2902
|
}
|
|
2900
|
-
const
|
|
2903
|
+
const Ps = /* @__PURE__ */ B(Ss, [["render", Us], ["__scopeId", "data-v-5f30c914"]]), js = {
|
|
2901
2904
|
form_response: ds,
|
|
2902
2905
|
info_card: Cs,
|
|
2903
|
-
ticket:
|
|
2906
|
+
ticket: Ps
|
|
2904
2907
|
}, Ds = {
|
|
2905
2908
|
name: "WmArtifactRenderer",
|
|
2906
2909
|
props: {
|
|
@@ -2917,7 +2920,7 @@ const Us = /* @__PURE__ */ B(Ss, [["render", Ps], ["__scopeId", "data-v-5f30c914
|
|
|
2917
2920
|
}
|
|
2918
2921
|
};
|
|
2919
2922
|
function zs(e, t, n, i, r, s) {
|
|
2920
|
-
return s.component ? (c(),
|
|
2923
|
+
return s.component ? (c(), U(je(s.component), {
|
|
2921
2924
|
key: 0,
|
|
2922
2925
|
data: n.artifact.data
|
|
2923
2926
|
}, null, 8, ["data"])) : w("", !0);
|
|
@@ -3493,8 +3496,8 @@ const cr = {
|
|
|
3493
3496
|
cornersFor(e, t) {
|
|
3494
3497
|
var Z, ee, te;
|
|
3495
3498
|
const n = e.items, i = (Z = n[t]) == null ? void 0 : Z.kind, r = (ee = n[t - 1]) == null ? void 0 : ee.kind, s = (te = n[t + 1]) == null ? void 0 : te.kind, a = e.role === "user", l = 14, p = 4, k = r == null ? void 0 : r.bottom, b = s == null ? void 0 : s.top, T = this.widthByKey[this.rowKeyOf(e, t)], I = this.widthByKey[this.rowKeyOf(e, t - 1)], A = this.widthByKey[this.rowKeyOf(e, t + 1)], z = 0.5, M = ($, ne, G) => $ != null && T != null ? $ + z >= T : ne === G || ne === "card" && G === "bubble";
|
|
3496
|
-
let F = l, N = l,
|
|
3497
|
-
return a ? (k && (N = p), (b || !s) && (
|
|
3499
|
+
let F = l, N = l, P = l, W = l;
|
|
3500
|
+
return a ? (k && (N = p), (b || !s) && (P = p), k && M(I, k, i == null ? void 0 : i.top) && (F = p), b && M(A, b, i == null ? void 0 : i.bottom) && (W = p)) : (k && (F = p), (b || !s) && (W = p), k && M(I, k, i == null ? void 0 : i.top) && (N = p), b && M(A, b, i == null ? void 0 : i.bottom) && (P = p)), { tl: F, tr: N, br: P, bl: W };
|
|
3498
3501
|
},
|
|
3499
3502
|
// Inline style emitting the four corner CSS variables. Set on
|
|
3500
3503
|
// `.wm-list__row` so they cascade to Bubble/ActionResult/
|
|
@@ -3695,13 +3698,13 @@ function Lr(e, t, n, i, r, s) {
|
|
|
3695
3698
|
}, [
|
|
3696
3699
|
A.role !== "user" ? (c(), u("div", Cr, [
|
|
3697
3700
|
F === A.items.length - 1 ? (c(), u(R, { key: 0 }, [
|
|
3698
|
-
A.role === "ai" ? (c(),
|
|
3701
|
+
A.role === "ai" ? (c(), U(a, {
|
|
3699
3702
|
key: 0,
|
|
3700
3703
|
size: 26,
|
|
3701
3704
|
tail: !0,
|
|
3702
3705
|
name: n.aiAgentName,
|
|
3703
3706
|
"image-url": n.aiAgentAvatarUrl
|
|
3704
|
-
}, null, 8, ["name", "image-url"])) : (c(),
|
|
3707
|
+
}, null, 8, ["name", "image-url"])) : (c(), U(l, {
|
|
3705
3708
|
key: 1,
|
|
3706
3709
|
name: A.agentName,
|
|
3707
3710
|
"avatar-url": A.agentAvatarUrl,
|
|
@@ -3710,24 +3713,24 @@ function Lr(e, t, n, i, r, s) {
|
|
|
3710
3713
|
}, null, 8, ["name", "avatar-url"]))
|
|
3711
3714
|
], 64)) : w("", !0)
|
|
3712
3715
|
])) : w("", !0),
|
|
3713
|
-
M.renderAs === "action" ? (c(),
|
|
3716
|
+
M.renderAs === "action" ? (c(), U(p, {
|
|
3714
3717
|
key: 1,
|
|
3715
3718
|
state: M.message.payload.state,
|
|
3716
3719
|
label: s.actionLabel(M.message),
|
|
3717
3720
|
detail: s.actionDetail(M.message)
|
|
3718
|
-
}, null, 8, ["state", "label", "detail"])) : M.renderAs === "admin-pending" ? (c(),
|
|
3721
|
+
}, null, 8, ["state", "label", "detail"])) : M.renderAs === "admin-pending" ? (c(), U(p, {
|
|
3719
3722
|
key: 2,
|
|
3720
3723
|
state: "awaiting",
|
|
3721
3724
|
label: s.t("messageList.approvalRequestSent"),
|
|
3722
3725
|
detail: M.message.text_md || ""
|
|
3723
|
-
}, null, 8, ["label", "detail"])) : M.renderAs === "artifact-of-action" ? (c(),
|
|
3726
|
+
}, null, 8, ["label", "detail"])) : M.renderAs === "artifact-of-action" ? (c(), U(k, {
|
|
3724
3727
|
key: 3,
|
|
3725
3728
|
artifact: s.actionArtifact(M.message)
|
|
3726
|
-
}, null, 8, ["artifact"])) : M.renderAs === "artifact" ? (c(),
|
|
3729
|
+
}, null, 8, ["artifact"])) : M.renderAs === "artifact" ? (c(), U(k, {
|
|
3727
3730
|
key: 4,
|
|
3728
3731
|
artifact: s.artifactOf(M.message)
|
|
3729
3732
|
}, null, 8, ["artifact"])) : (c(), u("div", Ar, [
|
|
3730
|
-
M.message.text_md ? (c(),
|
|
3733
|
+
M.message.text_md ? (c(), U(b, {
|
|
3731
3734
|
key: 0,
|
|
3732
3735
|
role: A.role,
|
|
3733
3736
|
text: M.message.text_md
|
|
@@ -3740,8 +3743,8 @@ function Lr(e, t, n, i, r, s) {
|
|
|
3740
3743
|
}, [
|
|
3741
3744
|
(c(!0), u(R, null, j(s.attachmentsOf(
|
|
3742
3745
|
M.message
|
|
3743
|
-
), (N,
|
|
3744
|
-
key: `${s.messageKey(M.message)}-att-${
|
|
3746
|
+
), (N, P) => (c(), U(T, {
|
|
3747
|
+
key: `${s.messageKey(M.message)}-att-${P}`,
|
|
3745
3748
|
attachment: N
|
|
3746
3749
|
}, null, 8, ["attachment"]))), 128))
|
|
3747
3750
|
], 2)) : w("", !0)
|
|
@@ -3909,7 +3912,7 @@ const Fr = [
|
|
|
3909
3912
|
labelKey: "composer.recordScreen",
|
|
3910
3913
|
path: "M23 7l-7 5 7 5V7z M1 5a2 2 0 012-2h12a2 2 0 012 2v14a2 2 0 01-2 2H3a2 2 0 01-2-2V5z"
|
|
3911
3914
|
}
|
|
3912
|
-
],
|
|
3915
|
+
], Ur = {
|
|
3913
3916
|
name: "WmComposer",
|
|
3914
3917
|
inject: {
|
|
3915
3918
|
// Translator shared by the Messenger shell; French fallback when
|
|
@@ -4041,7 +4044,7 @@ const Fr = [
|
|
|
4041
4044
|
}
|
|
4042
4045
|
}
|
|
4043
4046
|
}
|
|
4044
|
-
},
|
|
4047
|
+
}, Pr = { class: "wm-compose-wrap" }, jr = {
|
|
4045
4048
|
key: 0,
|
|
4046
4049
|
class: "wm-rec"
|
|
4047
4050
|
}, Dr = { class: "wm-rec__lbl" }, zr = {
|
|
@@ -4055,7 +4058,7 @@ const Fr = [
|
|
|
4055
4058
|
"aria-hidden": "true"
|
|
4056
4059
|
}, Vr = ["d"], Kr = ["placeholder", "disabled"], Wr = { class: "wm-compose__actions" }, Gr = ["title", "aria-label", "disabled"], Yr = ["disabled", "aria-label"];
|
|
4057
4060
|
function Jr(e, t, n, i, r, s) {
|
|
4058
|
-
return c(), u("div",
|
|
4061
|
+
return c(), u("div", Pr, [
|
|
4059
4062
|
r.recording ? (c(), u("div", jr, [
|
|
4060
4063
|
t[8] || (t[8] = o("span", {
|
|
4061
4064
|
class: "wm-rec__dot",
|
|
@@ -4166,7 +4169,7 @@ function Jr(e, t, n, i, r, s) {
|
|
|
4166
4169
|
], 34)
|
|
4167
4170
|
]);
|
|
4168
4171
|
}
|
|
4169
|
-
const Qr = /* @__PURE__ */ B(
|
|
4172
|
+
const Qr = /* @__PURE__ */ B(Ur, [["render", Jr], ["__scopeId", "data-v-aa81dbb8"]]), Xr = {
|
|
4170
4173
|
name: "WmSuggestionChips",
|
|
4171
4174
|
props: {
|
|
4172
4175
|
items: { type: Array, default: () => [] },
|
|
@@ -4398,7 +4401,7 @@ const hi = /* @__PURE__ */ new Set([
|
|
|
4398
4401
|
key: 2,
|
|
4399
4402
|
class: "wm-form__doneLbl"
|
|
4400
4403
|
};
|
|
4401
|
-
function
|
|
4404
|
+
function Ui(e, t, n, i, r, s) {
|
|
4402
4405
|
const a = E("AIAvatar");
|
|
4403
4406
|
return c(), u("div", fi, [
|
|
4404
4407
|
o("div", gi, [
|
|
@@ -4535,7 +4538,7 @@ function Pi(e, t, n, i, r, s) {
|
|
|
4535
4538
|
], 32)
|
|
4536
4539
|
]);
|
|
4537
4540
|
}
|
|
4538
|
-
const
|
|
4541
|
+
const Pi = /* @__PURE__ */ B(mi, [["render", Ui], ["__scopeId", "data-v-fe65cc56"]]), ji = {
|
|
4539
4542
|
name: "WmFeedback",
|
|
4540
4543
|
inject: {
|
|
4541
4544
|
// Translator shared by the Messenger shell; French fallback when
|
|
@@ -4955,7 +4958,7 @@ const Sa = /* @__PURE__ */ B(fa, [["render", Aa], ["__scopeId", "data-v-6d5f94a8
|
|
|
4955
4958
|
Composer: Qr,
|
|
4956
4959
|
SuggestionChips: ti,
|
|
4957
4960
|
ApprovalCard: ui,
|
|
4958
|
-
FormCard:
|
|
4961
|
+
FormCard: Pi,
|
|
4959
4962
|
Feedback: Xi,
|
|
4960
4963
|
MoreMenu: ma,
|
|
4961
4964
|
RenameDialog: Sa
|
|
@@ -5068,6 +5071,11 @@ const Sa = /* @__PURE__ */ B(fa, [["render", Aa], ["__scopeId", "data-v-6d5f94a8
|
|
|
5068
5071
|
// { customer: { name?, email?, ...named variables } }. Push au
|
|
5069
5072
|
// serveur via PATCH /customers/me au boot.
|
|
5070
5073
|
parentContext: null,
|
|
5074
|
+
// Déclaration du marchand : `true` = site qui accepte des
|
|
5075
|
+
// visiteurs (lazy boot toujours), `false` = app fermée (eager
|
|
5076
|
+
// boot autorisé si marker cookie valide). Doit matcher
|
|
5077
|
+
// `widgets.allow_unauthenticated` côté serveur.
|
|
5078
|
+
parentAllowUnauthenticated: !1,
|
|
5071
5079
|
parentInitReceived: !1,
|
|
5072
5080
|
parentInitDeferred: null
|
|
5073
5081
|
};
|
|
@@ -5561,7 +5569,19 @@ const Sa = /* @__PURE__ */ B(fa, [["render", Aa], ["__scopeId", "data-v-6d5f94a8
|
|
|
5561
5569
|
onParentMessage(e) {
|
|
5562
5570
|
var n;
|
|
5563
5571
|
const t = e == null ? void 0 : e.data;
|
|
5564
|
-
!t || typeof t != "object" || t.type !== "INIT" || (this.parentOrigin = e.origin, this.parentToken = typeof t.token == "string" ? t.token : "", this.parentContext = t.context && typeof t.context == "object" ? t.context : null, this.parentInitReceived = !0, (n = this.parentInitDeferred) != null && n._resolve && this.parentInitDeferred._resolve())
|
|
5572
|
+
!t || typeof t != "object" || t.type !== "INIT" || (this.parentOrigin = e.origin, this.parentToken = typeof t.token == "string" ? t.token : "", this.parentContext = t.context && typeof t.context == "object" ? t.context : null, this.parentAllowUnauthenticated = t.allowUnauthenticated === !0, this.parentInitReceived = !0, (n = this.parentInitDeferred) != null && n._resolve && this.parentInitDeferred._resolve(), !this.isEmbedded && !this.isOpen && !this.parentAllowUnauthenticated && this.hasValidSessionMarker() && this.boot().catch((i) => {
|
|
5573
|
+
console.warn("[messenger] eager boot failed", i);
|
|
5574
|
+
}));
|
|
5575
|
+
},
|
|
5576
|
+
// Cherche le marker cookie `messenger_session_marker` (non-httpOnly,
|
|
5577
|
+
// posé par /session côté serveur pour les linked uniquement). Valeur
|
|
5578
|
+
// = timestamp ms epoch de l'expiration de la session.
|
|
5579
|
+
hasValidSessionMarker() {
|
|
5580
|
+
if (typeof document > "u") return !1;
|
|
5581
|
+
const t = (document.cookie || "").match(/(?:^|; )messenger_session_marker=([^;]+)/);
|
|
5582
|
+
if (!t) return !1;
|
|
5583
|
+
const n = parseInt(t[1], 10);
|
|
5584
|
+
return Number.isFinite(n) ? n > Date.now() : !1;
|
|
5565
5585
|
},
|
|
5566
5586
|
async boot() {
|
|
5567
5587
|
var e, t;
|
|
@@ -5579,7 +5599,8 @@ const Sa = /* @__PURE__ */ B(fa, [["render", Aa], ["__scopeId", "data-v-6d5f94a8
|
|
|
5579
5599
|
const n = ((e = this.parentContext) == null ? void 0 : e.customer) || ((t = this.context) == null ? void 0 : t.customer);
|
|
5580
5600
|
n && typeof n == "object" && await this.store.applyCustomer(n), await this.store.start({
|
|
5581
5601
|
origin: this.parentOrigin,
|
|
5582
|
-
token: this.parentToken || void 0
|
|
5602
|
+
token: this.parentToken || void 0,
|
|
5603
|
+
allowUnauthenticated: this.parentAllowUnauthenticated
|
|
5583
5604
|
}), this.setupLiveReveal();
|
|
5584
5605
|
} catch (n) {
|
|
5585
5606
|
console.error("[ww-messenger] bootstrap failed", n), this.bootError = (n == null ? void 0 : n.message) || String(n);
|
|
@@ -5671,12 +5692,12 @@ const Sa = /* @__PURE__ */ B(fa, [["render", Aa], ["__scopeId", "data-v-6d5f94a8
|
|
|
5671
5692
|
const n = (((A = this.launcherPeeks) == null ? void 0 : A.length) ?? 0) > 0, i = this.launcherHovered ? 28 : 16, r = Math.ceil(t.width), s = Math.ceil(t.height), a = (M = (z = this.$el) == null ? void 0 : z.querySelector) == null ? void 0 : M.call(z, ".wm-launcher"), l = a == null ? void 0 : a.getBoundingClientRect(), p = (N = (F = this.$el) == null ? void 0 : F.querySelectorAll) == null ? void 0 : N.call(F, ".wm-peek"), k = p && p.length ? p[p.length - 1] : null;
|
|
5672
5693
|
let b = null;
|
|
5673
5694
|
if (k) {
|
|
5674
|
-
const
|
|
5695
|
+
const P = k.getBoundingClientRect();
|
|
5675
5696
|
b = {
|
|
5676
|
-
width: Math.ceil(
|
|
5677
|
-
height: Math.ceil(
|
|
5678
|
-
rightOffset: Math.max(0, Math.ceil(t.right -
|
|
5679
|
-
bottomOffset: Math.max(0, Math.ceil(t.bottom -
|
|
5697
|
+
width: Math.ceil(P.width),
|
|
5698
|
+
height: Math.ceil(P.height),
|
|
5699
|
+
rightOffset: Math.max(0, Math.ceil(t.right - P.right)),
|
|
5700
|
+
bottomOffset: Math.max(0, Math.ceil(t.bottom - P.bottom))
|
|
5680
5701
|
};
|
|
5681
5702
|
}
|
|
5682
5703
|
this.notifyParentResize("closed", {
|
|
@@ -5916,16 +5937,16 @@ const Sa = /* @__PURE__ */ B(fa, [["render", Aa], ["__scopeId", "data-v-6d5f94a8
|
|
|
5916
5937
|
class: "wm-actionWait",
|
|
5917
5938
|
role: "status",
|
|
5918
5939
|
"aria-live": "polite"
|
|
5919
|
-
}, Fa = { class: "wm-actionWait__lbl" },
|
|
5940
|
+
}, Fa = { class: "wm-actionWait__lbl" }, Ua = {
|
|
5920
5941
|
key: 2,
|
|
5921
5942
|
class: "wm-attached"
|
|
5922
|
-
},
|
|
5943
|
+
}, Pa = ["aria-label", "onClick"];
|
|
5923
5944
|
function ja(e, t, n, i, r, s) {
|
|
5924
5945
|
const a = E("Launcher"), l = E("Header"), p = E("Onboarding"), k = E("MessageList"), b = E("ApprovalCard"), T = E("FormCard"), I = E("Feedback"), A = E("SuggestionChips"), z = E("Composer"), M = E("MoreMenu"), F = E("RenameDialog");
|
|
5925
5946
|
return c(), u("div", {
|
|
5926
5947
|
class: O(["wm-root", `wm-root--${n.displayMode}`])
|
|
5927
5948
|
}, [
|
|
5928
|
-
!r.isOpen && !s.isEmbedded ? (c(),
|
|
5949
|
+
!r.isOpen && !s.isEmbedded ? (c(), U(a, {
|
|
5929
5950
|
key: 0,
|
|
5930
5951
|
"unread-count": s.unreadCount,
|
|
5931
5952
|
peeks: s.launcherPeeks,
|
|
@@ -6024,7 +6045,7 @@ function ja(e, t, n, i, r, s) {
|
|
|
6024
6045
|
}, null, 8, ["messages", "streaming-active", "date-label", "conversation-id", "loading-more", "has-more", "unread-anchor-id", "unread-boundary-ts", "ai-agent-name", "ai-agent-avatar-url", "onLoadMore"]),
|
|
6025
6046
|
o("div", Ea, [
|
|
6026
6047
|
s.floatVisible ? (c(), u("div", Ba, [
|
|
6027
|
-
s.approvalReady ? (c(),
|
|
6048
|
+
s.approvalReady ? (c(), U(b, {
|
|
6028
6049
|
key: 0,
|
|
6029
6050
|
action: s.approvalTitle,
|
|
6030
6051
|
detail: s.approvalDetail,
|
|
@@ -6032,18 +6053,18 @@ function ja(e, t, n, i, r, s) {
|
|
|
6032
6053
|
"agent-name": s.agentName,
|
|
6033
6054
|
"agent-avatar-url": s.agentAvatarUrl,
|
|
6034
6055
|
onCallback: s.onApprovalCallback
|
|
6035
|
-
}, null, 8, ["action", "detail", "callbacks", "agent-name", "agent-avatar-url", "onCallback"])) : s.pendingForm ? (c(),
|
|
6056
|
+
}, null, 8, ["action", "detail", "callbacks", "agent-name", "agent-avatar-url", "onCallback"])) : s.pendingForm ? (c(), U(T, {
|
|
6036
6057
|
key: s.pendingForm.message && s.pendingForm.message.id,
|
|
6037
6058
|
form: s.pendingForm.form,
|
|
6038
6059
|
"agent-name": s.agentName,
|
|
6039
6060
|
"agent-avatar-url": s.agentAvatarUrl,
|
|
6040
6061
|
onSubmit: s.onFormSubmit
|
|
6041
|
-
}, null, 8, ["form", "agent-name", "agent-avatar-url", "onSubmit"])) : s.showFeedback ? (c(),
|
|
6062
|
+
}, null, 8, ["form", "agent-name", "agent-avatar-url", "onSubmit"])) : s.showFeedback ? (c(), U(I, {
|
|
6042
6063
|
key: 2,
|
|
6043
6064
|
busy: r.feedbackBusy,
|
|
6044
6065
|
done: r.feedbackDone,
|
|
6045
6066
|
onSubmit: s.onFeedback
|
|
6046
|
-
}, null, 8, ["busy", "done", "onSubmit"])) : (c(),
|
|
6067
|
+
}, null, 8, ["busy", "done", "onSubmit"])) : (c(), U(A, {
|
|
6047
6068
|
key: 3,
|
|
6048
6069
|
items: s.suggestions,
|
|
6049
6070
|
onSelect: s.onSuggestion
|
|
@@ -6057,7 +6078,7 @@ function ja(e, t, n, i, r, s) {
|
|
|
6057
6078
|
o("span", Fa, v(s.t("action.inProgress", {
|
|
6058
6079
|
name: s.actionInFlightName
|
|
6059
6080
|
})), 1)
|
|
6060
|
-
])) : (c(),
|
|
6081
|
+
])) : (c(), U(z, {
|
|
6061
6082
|
key: 2,
|
|
6062
6083
|
ref: "composer",
|
|
6063
6084
|
modelValue: r.draft,
|
|
@@ -6069,7 +6090,7 @@ function ja(e, t, n, i, r, s) {
|
|
|
6069
6090
|
onAttach: s.onAttach
|
|
6070
6091
|
}, null, 8, ["modelValue", "placeholder", "disabled", "attach-label", "onSend", "onAttach"]))
|
|
6071
6092
|
]),
|
|
6072
|
-
r.moreOpen ? (c(),
|
|
6093
|
+
r.moreOpen ? (c(), U(M, {
|
|
6073
6094
|
key: 0,
|
|
6074
6095
|
"can-rename": !!s.currentConv && !s.currentConv._draft,
|
|
6075
6096
|
"can-export": !!s.currentConv && !s.currentConv._draft,
|
|
@@ -6082,16 +6103,16 @@ function ja(e, t, n, i, r, s) {
|
|
|
6082
6103
|
onBrowserNotifToggle: e.onBrowserNotifToggle,
|
|
6083
6104
|
onAction: s.onMoreAction
|
|
6084
6105
|
}, null, 8, ["can-rename", "can-export", "sound-enabled", "browser-notif-enabled", "status-url", "help-url", "onSoundToggle", "onBrowserNotifToggle", "onAction"])) : w("", !0),
|
|
6085
|
-
r.renameDialogOpen && s.currentConv && !s.currentConv._draft ? (c(),
|
|
6106
|
+
r.renameDialogOpen && s.currentConv && !s.currentConv._draft ? (c(), U(F, {
|
|
6086
6107
|
key: 1,
|
|
6087
6108
|
"initial-value": s.currentConv.name || "",
|
|
6088
6109
|
title: s.t("rename.dialogTitle"),
|
|
6089
6110
|
onClose: t[3] || (t[3] = (N) => r.renameDialogOpen = !1),
|
|
6090
6111
|
onSubmit: s.onRenameSubmit
|
|
6091
6112
|
}, null, 8, ["initial-value", "title", "onSubmit"])) : w("", !0),
|
|
6092
|
-
r.pendingAttachments.length ? (c(), u("div",
|
|
6093
|
-
(c(!0), u(R, null, j(r.pendingAttachments, (N,
|
|
6094
|
-
key:
|
|
6113
|
+
r.pendingAttachments.length ? (c(), u("div", Ua, [
|
|
6114
|
+
(c(!0), u(R, null, j(r.pendingAttachments, (N, P) => (c(), u("div", {
|
|
6115
|
+
key: P,
|
|
6095
6116
|
class: "wm-attached__chip"
|
|
6096
6117
|
}, [
|
|
6097
6118
|
t[10] || (t[10] = o("svg", {
|
|
@@ -6111,7 +6132,7 @@ function ja(e, t, n, i, r, s) {
|
|
|
6111
6132
|
o("button", {
|
|
6112
6133
|
type: "button",
|
|
6113
6134
|
"aria-label": s.t("attachment.remove"),
|
|
6114
|
-
onClick: (W) => r.pendingAttachments.splice(
|
|
6135
|
+
onClick: (W) => r.pendingAttachments.splice(P, 1)
|
|
6115
6136
|
}, [...t[9] || (t[9] = [
|
|
6116
6137
|
o("svg", {
|
|
6117
6138
|
width: "10",
|
|
@@ -6126,10 +6147,10 @@ function ja(e, t, n, i, r, s) {
|
|
|
6126
6147
|
}, [
|
|
6127
6148
|
o("path", { d: "M18 6L6 18M6 6l12 12" })
|
|
6128
6149
|
], -1)
|
|
6129
|
-
])], 8,
|
|
6150
|
+
])], 8, Pa)
|
|
6130
6151
|
]))), 128))
|
|
6131
6152
|
])) : w("", !0)
|
|
6132
|
-
], 64)) : (c(),
|
|
6153
|
+
], 64)) : (c(), U(p, {
|
|
6133
6154
|
key: 1,
|
|
6134
6155
|
"welcome-message": s.widgetWelcomeMessage,
|
|
6135
6156
|
subtitle: s.widgetSubtitle,
|
|
@@ -6142,7 +6163,7 @@ function ja(e, t, n, i, r, s) {
|
|
|
6142
6163
|
onSelect: s.onQuickLink,
|
|
6143
6164
|
onResume: s.onDrawerPick
|
|
6144
6165
|
}, null, 8, ["welcome-message", "subtitle", "agent-name", "default-icon-url", "quick-links", "open-threads", "busy", "onStart", "onSelect", "onResume"])),
|
|
6145
|
-
r.moreOpen && !s.currentConv ? (c(),
|
|
6166
|
+
r.moreOpen && !s.currentConv ? (c(), U(M, {
|
|
6146
6167
|
key: 3,
|
|
6147
6168
|
"can-rename": !1,
|
|
6148
6169
|
"can-export": !1,
|
|
@@ -6159,7 +6180,7 @@ function ja(e, t, n, i, r, s) {
|
|
|
6159
6180
|
], 6)) : w("", !0)
|
|
6160
6181
|
], 2);
|
|
6161
6182
|
}
|
|
6162
|
-
const Ha = /* @__PURE__ */ B(Ma, [["render", ja], ["__scopeId", "data-v-
|
|
6183
|
+
const Ha = /* @__PURE__ */ B(Ma, [["render", ja], ["__scopeId", "data-v-015ad802"]]), qa = "0.5.17";
|
|
6163
6184
|
export {
|
|
6164
6185
|
le as AIAvatar,
|
|
6165
6186
|
ge as AVATAR_COLORS,
|
|
@@ -6168,14 +6189,14 @@ export {
|
|
|
6168
6189
|
ds as ArtifactFormResponse,
|
|
6169
6190
|
Cs as ArtifactInfoCard,
|
|
6170
6191
|
Hs as ArtifactRenderer,
|
|
6171
|
-
|
|
6192
|
+
Ps as ArtifactTicket,
|
|
6172
6193
|
er as AttachmentPreview,
|
|
6173
6194
|
rr as Bubble,
|
|
6174
6195
|
Qr as Composer,
|
|
6175
6196
|
Ze as DEFAULT_BASE_URL,
|
|
6176
6197
|
ie as DEFAULT_LANGUAGE,
|
|
6177
6198
|
Xi as Feedback,
|
|
6178
|
-
|
|
6199
|
+
Pi as FormCard,
|
|
6179
6200
|
ln as Header,
|
|
6180
6201
|
Re as HumanAvatar,
|
|
6181
6202
|
Ft as Launcher,
|
package/dist/snippet.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var Messenger=function(l){"use strict";let n=null,d=null,r=null,c="",u=null;function
|
|
1
|
+
var Messenger=function(l){"use strict";let n=null,d=null,r=null,c="",u=null;function y(e){n&&w();const i=e.widgetId||"",a=e.baseUrl||"";c=e.widgetOrigin||a;const o=e.token||"",h=e.context&&typeof e.context=="object"?e.context:null,s=e.displayMode||"floating",g=e.language||"",p=e.allowUnauthenticated===!0;if(!i||!c){console.warn("[messenger] init skipped — missing widgetId or widgetOrigin");return}const x=new URL(`${T(c)}/widget/${encodeURIComponent(i)}`);s!=="floating"&&x.searchParams.set("display_mode",s),g&&x.searchParams.set("language",g),n=document.createElement("iframe"),n.src=x.toString(),n.title="Messenger",n.setAttribute("aria-label","Messenger"),n.setAttribute("allow","clipboard-write; microphone"),n.setAttribute("data-messenger-widget",""),v(n,s,"closed"),document.body.appendChild(n),d=document.createElement("div"),d.setAttribute("data-messenger-shadow",""),m(d,{hidden:!0}),document.body.appendChild(d),r=document.createElement("div"),r.setAttribute("data-messenger-peek-shadow",""),f(r,{hidden:!0}),document.body.appendChild(r);let b=!1;const E=()=>{b||!n||(b=!0,n.contentWindow.postMessage({type:"INIT",origin:window.location.origin,token:o||null,context:h||null,allowUnauthenticated:p},c))};u=M=>{if(M.origin!==c)return;const t=M.data;!t||typeof t!="object"||(t.type==="READY"?E():t.type==="RESIZE"&&n&&(v(n,t.displayMode||s,t.state,{width:t.width,height:t.height}),d&&(t.state==="closed"&&t.launcherWidth&&t.launcherHeight?m(d,{width:t.launcherWidth,height:t.launcherHeight,hovered:!!t.launcherHovered}):m(d,{hidden:!0})),r&&(t.state==="closed"&&t.peek?f(r,{...t.peek,hovered:!!t.peekHovered}):f(r,{hidden:!0}))))},window.addEventListener("message",u),n.addEventListener("load",E),setTimeout(()=>{b||console.warn("[messenger] iframe did not boot after",1e4,"ms — check CSP frame-ancestors and network")},1e4)}function w(){u&&(window.removeEventListener("message",u),u=null),n&&(n.remove(),n=null),d&&(d.remove(),d=null),r&&(r.remove(),r=null),c=""}function m(e,i){if(i.hidden){e.style.cssText="display:none";return}const a=i.width||64,o=i.height||64,h=i.hovered?"0 8px 22px rgba(0, 0, 0, 0.26)":"0 4px 14px rgba(0, 0, 0, 0.18)";e.style.cssText=["position:fixed","pointer-events:none","bottom:8px","right:8px",`width:${a}px`,`height:${o}px`,"border-radius:50%","background:transparent",`box-shadow:${h}`,"transition:box-shadow 100ms ease, width 100ms ease, height 100ms ease","z-index:2147483646"].join(";")}function f(e,i){if(i.hidden){e.style.cssText="display:none";return}const a=i.width||286,o=i.height||80,h=8+(i.rightOffset||0),s=8+(i.bottomOffset||0),g=i.hovered?"0 6px 18px rgba(0, 0, 0, 0.16)":"0 3px 10px rgba(0, 0, 0, 0.10)";e.style.cssText=["position:fixed","pointer-events:none",`bottom:${s}px`,`right:${h}px`,`width:${a}px`,`height:${o}px`,"border-radius:16px 16px 8px 16px","background:transparent",`box-shadow:${g}`,"transition:box-shadow 100ms ease, width 100ms ease, height 100ms ease, right 100ms ease, bottom 100ms ease","z-index:2147483646"].join(";")}function T(e){return e.endsWith("/")?e.slice(0,-1):e}function v(e,i,a,o){const h=["position:fixed","border:0","z-index:2147483647","color-scheme:normal","background:transparent"];let s;if(i==="embedded")s=["inset:0","width:100%","height:100%"];else if(a==="closed"){const g=o&&o.width>0?o.width:80,p=o&&o.height>0?o.height:80;s=["bottom:0","right:0",`width:${g}px`,`height:${p}px`]}else i==="sheet"?s=["top:0","bottom:0","right:0","width:min(470px, 100vw)","height:100vh"]:s=["bottom:0","right:0","width:460px","height:720px","max-width:100vw","max-height:100vh"];e.style.cssText=h.concat(s).join(";")}const S="0.5.17",k={init:y,destroy:w,version:S};return l.default=k,l.destroy=w,l.init=y,l.version=S,Object.defineProperties(l,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}}),l}({});
|