@qaiddev/thumbs-embed 1.10.0 → 1.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/annotate.d.ts +2 -0
- package/dist/chunks/annotate-5zJWs-aB.js +357 -0
- package/dist/chunks/annotate-5zJWs-aB.js.map +1 -0
- package/dist/chunks/core-CL1dwdaN.js +1342 -0
- package/dist/chunks/core-CL1dwdaN.js.map +1 -0
- package/dist/chunks/modal-DccueVYZ.js +222 -0
- package/dist/chunks/modal-DccueVYZ.js.map +1 -0
- package/dist/chunks/recording-CPzxRL7f.js +323 -0
- package/dist/chunks/recording-CPzxRL7f.js.map +1 -0
- package/dist/chunks/{targeting-Dz6z1BYl.js → targeting-mahtuPpo.js} +107 -105
- package/dist/chunks/targeting-mahtuPpo.js.map +1 -0
- package/dist/embed.d.ts +9 -3
- package/dist/index.js +320 -292
- package/dist/index.js.map +1 -1
- package/dist/loader.js +4 -2
- package/dist/loader.js.map +1 -1
- package/dist/modal.d.ts +2 -0
- package/dist/qaid.umd.cjs +10 -10
- package/dist/qaid.umd.cjs.map +1 -1
- package/dist/recording.d.ts +2 -0
- package/dist/targeting.d.ts +2 -0
- package/package.json +3 -3
- package/dist/chunks/annotate-D-o8xCV9.js +0 -421
- package/dist/chunks/annotate-D-o8xCV9.js.map +0 -1
- package/dist/chunks/loader-BVNyi56k.js +0 -1253
- package/dist/chunks/loader-BVNyi56k.js.map +0 -1
- package/dist/chunks/modal-DwwbWQ-F.js +0 -220
- package/dist/chunks/modal-DwwbWQ-F.js.map +0 -1
- package/dist/chunks/recording-CcfOfIC7.js +0 -321
- package/dist/chunks/recording-CcfOfIC7.js.map +0 -1
- package/dist/chunks/targeting-Dz6z1BYl.js.map +0 -1
|
@@ -0,0 +1,1342 @@
|
|
|
1
|
+
const Mt = `<svg xmlns="http://www.w3.org/2000/svg" class="qaid-icon" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
|
|
2
|
+
<path stroke-linecap="round" stroke-linejoin="round" d="M14 10h4.764a2 2 0 011.789 2.894l-3.5 7A2 2 0 0115.263 21h-4.017c-.163 0-.326-.02-.485-.06L7 20m7-10V5a2 2 0 00-2-2h-.095c-.5 0-.905.405-.905.905 0 .714-.211 1.412-.608 2.006L7 11v9m7-10h-2M7 20H5a2 2 0 01-2-2v-6a2 2 0 012-2h2.5"/>
|
|
3
|
+
</svg>`, Lt = `<svg xmlns="http://www.w3.org/2000/svg" class="qaid-icon" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
|
|
4
|
+
<path stroke-linecap="round" stroke-linejoin="round" d="M10 14H5.236a2 2 0 01-1.789-2.894l3.5-7A2 2 0 018.737 3h4.018a2 2 0 01.485.06l3.76.94m-7 10v5a2 2 0 002 2h.095c.5 0 .905-.405.905-.905 0-.714.211-1.412.608-2.006L17 13V4m-7 10h2m5-10h2a2 2 0 012 2v6a2 2 0 01-2 2h-2.5"/>
|
|
5
|
+
</svg>`, Ht = `<svg xmlns="http://www.w3.org/2000/svg" class="qaid-icon" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
|
|
6
|
+
<path stroke-linecap="round" stroke-linejoin="round" d="M15.75 10.5l4.72-4.72a.75.75 0 011.28.53v11.38a.75.75 0 01-1.28.53l-4.72-4.72M4.5 18.75h9a2.25 2.25 0 002.25-2.25v-9a2.25 2.25 0 00-2.25-2.25h-9A2.25 2.25 0 002.25 7.5v9a2.25 2.25 0 002.25 2.25z"/>
|
|
7
|
+
</svg>`, Bt = `<svg xmlns="http://www.w3.org/2000/svg" class="qaid-icon" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
|
|
8
|
+
<path stroke-linecap="round" stroke-linejoin="round" d="M8 10h8M8 14h5m-9 6l3.5-3.5H18a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v14z"/>
|
|
9
|
+
</svg>`, Ee = `<svg xmlns="http://www.w3.org/2000/svg" class="qaid-icon" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
|
|
10
|
+
<rect x="4" y="6" width="16" height="12" rx="1" stroke-linejoin="round"/>
|
|
11
|
+
</svg>`, Ie = `<svg xmlns="http://www.w3.org/2000/svg" class="qaid-icon" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
|
|
12
|
+
<path stroke-linecap="round" stroke-linejoin="round" d="M5 19L19 5m0 0h-8m8 0v8"/>
|
|
13
|
+
</svg>`, De = `<svg xmlns="http://www.w3.org/2000/svg" class="qaid-icon" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
|
|
14
|
+
<path stroke-linecap="round" stroke-linejoin="round" d="M12 20h9M16.5 3.5a2.121 2.121 0 013 3L7 19l-4 1 1-4L16.5 3.5z"/>
|
|
15
|
+
</svg>`, Me = `<svg xmlns="http://www.w3.org/2000/svg" class="qaid-icon" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
|
|
16
|
+
<path stroke-linecap="round" stroke-linejoin="round" d="M12 3s6 6.4 6 10a6 6 0 01-12 0c0-3.6 6-10 6-10z"/>
|
|
17
|
+
</svg>`, Le = `<svg xmlns="http://www.w3.org/2000/svg" class="qaid-icon" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
|
|
18
|
+
<path stroke-linecap="round" stroke-linejoin="round" d="M9 14L4 9l5-5M4 9h11a5 5 0 010 10h-4"/>
|
|
19
|
+
</svg>`, He = `<svg xmlns="http://www.w3.org/2000/svg" class="qaid-icon" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
|
|
20
|
+
<path stroke-linecap="round" stroke-linejoin="round" d="M20 6L9 17l-5-5"/>
|
|
21
|
+
</svg>`, Be = `<svg xmlns="http://www.w3.org/2000/svg" class="qaid-icon" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
|
|
22
|
+
<path stroke-linecap="round" stroke-linejoin="round" d="M12 6v8m0 4h.01"/>
|
|
23
|
+
</svg>`, Oe = `<svg xmlns="http://www.w3.org/2000/svg" class="qaid-icon" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
|
|
24
|
+
<path stroke-linecap="round" stroke-linejoin="round" d="M6 6l12 12M18 6L6 18"/>
|
|
25
|
+
</svg>`, Ot = "button{cursor:pointer}.qaid-buttons{display:flex;gap:.5rem}.qaid-buttons.qaid-vertical{flex-direction:column}.qaid-buttons.qaid-auto-container{position:fixed;z-index:50}.qaid-buttons.qaid-auto-container.qaid-bottom-right{bottom:1rem;right:1rem}.qaid-buttons.qaid-auto-container.qaid-bottom-left{bottom:1rem;left:1rem}.qaid-buttons.qaid-auto-container.qaid-top-right{top:1rem;right:1rem}.qaid-buttons.qaid-auto-container.qaid-top-left{top:1rem;left:1rem}.qaid-buttons.qaid-incognito{opacity:0;transition:opacity .2s ease-in-out}.qaid-buttons.qaid-incognito:hover{opacity:1}.qaid-buttons.qaid-dismissed{display:none!important}.qaid-dismiss-btn{width:20px;height:20px;padding:0;border:none;border-radius:50%;background:#0006;color:#fff;display:flex;align-items:center;justify-content:center;align-self:center;opacity:0;transition:opacity .15s,background .15s;cursor:pointer;pointer-events:auto;-webkit-appearance:none;appearance:none}.qaid-dismiss-btn:hover{background:#0009}.qaid-buttons:hover .qaid-dismiss-btn{opacity:1}button.qaid-btn-structural{display:inline-flex;align-items:center;justify-content:center;cursor:pointer;-webkit-appearance:none;appearance:none}.qaid-icon{width:24px;height:24px}:where(button.qaid-btn-structural)>svg:where(:not(.qaid-icon):not([width])){width:var(--qaid-icon-size, 24px);height:var(--qaid-icon-size, 24px)}.qaid-btn-structural:not(:has(svg)),.qaid-btn:not(:has(svg)){font-size:var(--qaid-icon-size, 24px);line-height:1}.qaid-emoji-icon{font-size:var(--qaid-icon-size, 24px);line-height:1}.qaid-buttons,.qaid-buttons *,.qaid-modal-container,.qaid-modal-container *{cursor:pointer!important}.qaid-tooltip-wrapper{position:relative}.qaid-tooltip-text{position:fixed;padding:.5rem .75rem;background:#1f2937;color:#fff;font-size:var(--qaid-font-size, 16px);font-weight:600;border-radius:.5rem;white-space:nowrap;opacity:0;pointer-events:none;transition:opacity .15s;z-index:99999}.qaid-tooltip-text.qaid-tooltip-visible{opacity:1}button.qaid-btn-record:hover{background:#dc2626;color:#fff}button:focus-visible,textarea:focus-visible,a:focus-visible,[tabindex]:focus-visible,[role=button]:focus-visible{outline:2px solid var(--qaid-marker, #6365f1);outline-offset:2px}.qaid-buttons.qaid-incognito:focus-within{opacity:1}.qaid-buttons:focus-within .qaid-dismiss-btn,.qaid-dismiss-btn:focus-visible{opacity:1}.qaid-dismiss-btn{min-width:24px;min-height:24px}@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation:none!important;transition:none!important;scroll-behavior:auto!important}}@media(forced-colors:active){button:focus-visible,textarea:focus-visible,a:focus-visible,[tabindex]:focus-visible,[role=button]:focus-visible{outline:2px solid CanvasText;outline-offset:2px}}", Rt = "body.qaid-targeting,body.qaid-targeting *{cursor:none!important}";
|
|
26
|
+
let b = 0;
|
|
27
|
+
const Pt = "button.qaid-btn{width:var(--qaid-btn-size);height:var(--qaid-btn-size);border-radius:50%;border:none;background:#f3f4f6;color:#374151;display:flex;align-items:center;justify-content:center;cursor:pointer;box-shadow:0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -1px rgba(0,0,0,.06);transition:background-color .2s,color .2s,transform .2s;-webkit-appearance:none;appearance:none;--qaid-hover-up-bg:var(--qaid-positive);--qaid-hover-up-color:#fff;--qaid-hover-down-bg:var(--qaid-negative);--qaid-hover-down-color:#fff}button.qaid-btn:hover{transform:scale(1.05)}button.qaid-btn-up:hover{background:var(--qaid-hover-up-bg);color:var(--qaid-hover-up-color)}button.qaid-btn-down:hover{background:var(--qaid-hover-down-bg);color:var(--qaid-hover-down-color)}button.qaid-btn-feedback:hover{background:var(--qaid-marker,#6365f1);color:var(--qaid-marker-text,#fff)}button.qaid-btn svg{width:var(--qaid-icon-size);height:var(--qaid-icon-size)}", zt = {
|
|
28
|
+
small: 36,
|
|
29
|
+
medium: 48,
|
|
30
|
+
large: 64
|
|
31
|
+
}, Ft = {
|
|
32
|
+
small: 18,
|
|
33
|
+
medium: 24,
|
|
34
|
+
large: 32
|
|
35
|
+
};
|
|
36
|
+
function Nt(e, t, o) {
|
|
37
|
+
const [i, s, n] = [e, t, o].map((a) => (a = a / 255, a <= 0.03928 ? a / 12.92 : Math.pow((a + 0.055) / 1.055, 2.4)));
|
|
38
|
+
return 0.2126 * i + 0.7152 * s + 0.0722 * n;
|
|
39
|
+
}
|
|
40
|
+
function Ut(e) {
|
|
41
|
+
if (e.startsWith("#")) {
|
|
42
|
+
const o = e.slice(1), i = o.length === 3 ? o.split("").map((n) => n + n).join("") : o, s = parseInt(i, 16);
|
|
43
|
+
return {
|
|
44
|
+
r: s >> 16 & 255,
|
|
45
|
+
g: s >> 8 & 255,
|
|
46
|
+
b: s & 255
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
const t = e.match(/rgb\((\d+),\s*(\d+),\s*(\d+)\)/);
|
|
50
|
+
return t ? {
|
|
51
|
+
r: parseInt(t[1]),
|
|
52
|
+
g: parseInt(t[2]),
|
|
53
|
+
b: parseInt(t[3])
|
|
54
|
+
} : null;
|
|
55
|
+
}
|
|
56
|
+
function _t(e) {
|
|
57
|
+
const t = Ut(e);
|
|
58
|
+
return t && Nt(t.r, t.g, t.b) > 0.4 ? "black" : "white";
|
|
59
|
+
}
|
|
60
|
+
function Vt(e = {}) {
|
|
61
|
+
const {
|
|
62
|
+
positiveColor: t = "rgb(0, 200, 83)",
|
|
63
|
+
negativeColor: o = "rgb(255, 0, 0)",
|
|
64
|
+
markerColor: i = "#6365f1",
|
|
65
|
+
buttonSize: s = "medium",
|
|
66
|
+
modalWidth: n = 400,
|
|
67
|
+
backdropOpacity: a = 0.3,
|
|
68
|
+
fontFamily: l = "system-ui, -apple-system, sans-serif",
|
|
69
|
+
fontSize: c = 16
|
|
70
|
+
} = e, d = zt[s], r = Ft[s], u = _t(i);
|
|
71
|
+
return {
|
|
72
|
+
"--qaid-positive": t,
|
|
73
|
+
"--qaid-negative": o,
|
|
74
|
+
"--qaid-marker": i,
|
|
75
|
+
"--qaid-marker-text": u,
|
|
76
|
+
"--qaid-btn-size": `${d}px`,
|
|
77
|
+
"--qaid-icon-size": `${r}px`,
|
|
78
|
+
"--qaid-modal-width": `${n}px`,
|
|
79
|
+
"--qaid-backdrop-opacity": String(a),
|
|
80
|
+
"--qaid-font-family": l,
|
|
81
|
+
"--qaid-font-size": `${c}px`
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
function $t(e, t) {
|
|
85
|
+
for (const [o, i] of Object.entries(t))
|
|
86
|
+
e.style.setProperty(o, i);
|
|
87
|
+
}
|
|
88
|
+
function X() {
|
|
89
|
+
return Ot + Pt;
|
|
90
|
+
}
|
|
91
|
+
function Kt() {
|
|
92
|
+
if (b++, b > 1) return;
|
|
93
|
+
const e = document.createElement("style");
|
|
94
|
+
e.id = "qaid-styles", e.textContent = Rt, document.head.appendChild(e);
|
|
95
|
+
}
|
|
96
|
+
function Qt() {
|
|
97
|
+
b <= 0 || (b--, b === 0 && document.getElementById("qaid-styles")?.remove());
|
|
98
|
+
}
|
|
99
|
+
const Y = "data-qaid-a11y-live", jt = "position:absolute;width:1px;height:1px;margin:-1px;padding:0;border:0;overflow:hidden;clip:rect(0 0 0 0);clip-path:inset(50%);white-space:nowrap;", Wt = [
|
|
100
|
+
"a[href]",
|
|
101
|
+
"button",
|
|
102
|
+
"input",
|
|
103
|
+
"textarea",
|
|
104
|
+
"select",
|
|
105
|
+
"[tabindex]"
|
|
106
|
+
].join(",");
|
|
107
|
+
function Xt(e) {
|
|
108
|
+
return e.ownerDocument || document;
|
|
109
|
+
}
|
|
110
|
+
function Yt(e, t) {
|
|
111
|
+
const o = t ? "assertive" : "polite", i = e.querySelector(
|
|
112
|
+
`[${Y}="${o}"]`
|
|
113
|
+
);
|
|
114
|
+
if (i) return i;
|
|
115
|
+
const n = Xt(e).createElement("div");
|
|
116
|
+
return n.setAttribute(Y, o), n.setAttribute("role", t ? "alert" : "status"), n.setAttribute("aria-live", t ? "assertive" : "polite"), n.setAttribute("aria-atomic", "true"), n.style.cssText = jt, e.appendChild(n), n;
|
|
117
|
+
}
|
|
118
|
+
function Jt(e, t, o = {}) {
|
|
119
|
+
const i = Yt(e, !!o.assertive);
|
|
120
|
+
i.textContent = "", i.textContent = t;
|
|
121
|
+
}
|
|
122
|
+
function Gt(e) {
|
|
123
|
+
return e.hasAttribute("disabled") ? !0 : e.disabled === !0;
|
|
124
|
+
}
|
|
125
|
+
function Zt(e) {
|
|
126
|
+
let t = e;
|
|
127
|
+
for (; t; ) {
|
|
128
|
+
if (t.hasAttribute("hidden")) return !0;
|
|
129
|
+
const o = t.style;
|
|
130
|
+
if (o && (o.display === "none" || o.visibility === "hidden" || o.visibility === "collapse"))
|
|
131
|
+
return !0;
|
|
132
|
+
t = t.parentElement;
|
|
133
|
+
}
|
|
134
|
+
return !1;
|
|
135
|
+
}
|
|
136
|
+
function J(e) {
|
|
137
|
+
return Array.from(
|
|
138
|
+
e.querySelectorAll(Wt)
|
|
139
|
+
).filter((o) => !(o.getAttribute("tabindex") === "-1" || o instanceof HTMLInputElement && o.type === "hidden" || o instanceof HTMLAnchorElement && !o.getAttribute("href") || Gt(o) || Zt(o)));
|
|
140
|
+
}
|
|
141
|
+
function it(e) {
|
|
142
|
+
let t = e.activeElement;
|
|
143
|
+
for (; t && t.shadowRoot && t.shadowRoot.activeElement; )
|
|
144
|
+
t = t.shadowRoot.activeElement;
|
|
145
|
+
return t instanceof HTMLElement ? t : null;
|
|
146
|
+
}
|
|
147
|
+
function te(e) {
|
|
148
|
+
const t = e.ownerDocument || document;
|
|
149
|
+
let o = !1;
|
|
150
|
+
const i = (n) => {
|
|
151
|
+
if (n.key !== "Tab") return;
|
|
152
|
+
const a = J(e);
|
|
153
|
+
if (a.length === 0) {
|
|
154
|
+
n.preventDefault(), e.focus();
|
|
155
|
+
return;
|
|
156
|
+
}
|
|
157
|
+
const l = a[0], c = a[a.length - 1], d = it(t), r = d ? a.indexOf(d) !== -1 : !1;
|
|
158
|
+
n.shiftKey ? (!r || d === l) && (n.preventDefault(), c.focus()) : (!r || d === c) && (n.preventDefault(), l.focus());
|
|
159
|
+
};
|
|
160
|
+
e.addEventListener("keydown", i);
|
|
161
|
+
const s = J(e);
|
|
162
|
+
return s.length > 0 ? s[0].focus() : (e.hasAttribute("tabindex") || (e.setAttribute("tabindex", "-1"), o = !0), e.focus()), {
|
|
163
|
+
release() {
|
|
164
|
+
e.removeEventListener("keydown", i), o && (e.removeAttribute("tabindex"), o = !1);
|
|
165
|
+
}
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
function ee() {
|
|
169
|
+
return it(document);
|
|
170
|
+
}
|
|
171
|
+
function oe(e) {
|
|
172
|
+
if (!(!e || typeof e.focus != "function"))
|
|
173
|
+
try {
|
|
174
|
+
e.focus();
|
|
175
|
+
} catch {
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
function ie(e, t = {}) {
|
|
179
|
+
e.setAttribute("role", "dialog"), e.setAttribute("aria-modal", "true"), t.labelledbyId && e.setAttribute("aria-labelledby", t.labelledbyId), t.describedbyId && e.setAttribute("aria-describedby", t.describedbyId), t.label && e.setAttribute("aria-label", t.label);
|
|
180
|
+
}
|
|
181
|
+
function ne(e, t) {
|
|
182
|
+
let o = e;
|
|
183
|
+
for (; o && o !== t; ) {
|
|
184
|
+
const i = o.parentNode;
|
|
185
|
+
if (i === t) return o;
|
|
186
|
+
if (i && i.host) {
|
|
187
|
+
o = i.host;
|
|
188
|
+
continue;
|
|
189
|
+
}
|
|
190
|
+
if (!i) return null;
|
|
191
|
+
o = i;
|
|
192
|
+
}
|
|
193
|
+
return null;
|
|
194
|
+
}
|
|
195
|
+
function se(e) {
|
|
196
|
+
const o = (e.ownerDocument || document).body;
|
|
197
|
+
if (!o) return () => {
|
|
198
|
+
};
|
|
199
|
+
const i = ne(e, o), s = [];
|
|
200
|
+
return Array.from(o.children).forEach((n) => {
|
|
201
|
+
if (!(n instanceof HTMLElement) || i && n === i) return;
|
|
202
|
+
const a = n.inert === !0, l = n.getAttribute("aria-hidden");
|
|
203
|
+
a && l === "true" || (n.inert = !0, n.setAttribute("aria-hidden", "true"), s.push({ el: n, prevInert: a, prevAriaHidden: l }));
|
|
204
|
+
}), function() {
|
|
205
|
+
for (; s.length; ) {
|
|
206
|
+
const a = s.pop();
|
|
207
|
+
a.el.inert = a.prevInert, a.prevAriaHidden === null ? a.el.removeAttribute("aria-hidden") : a.el.setAttribute("aria-hidden", a.prevAriaHidden);
|
|
208
|
+
}
|
|
209
|
+
};
|
|
210
|
+
}
|
|
211
|
+
const nt = {
|
|
212
|
+
width: 400,
|
|
213
|
+
height: 280,
|
|
214
|
+
arrowHeight: 12,
|
|
215
|
+
gap: 8,
|
|
216
|
+
viewportPadding: 16
|
|
217
|
+
};
|
|
218
|
+
function ae(e, t, o, i, s) {
|
|
219
|
+
const n = e.y, a = t - (e.y + e.height);
|
|
220
|
+
if (a >= o + i)
|
|
221
|
+
return {
|
|
222
|
+
top: e.y + e.height + i,
|
|
223
|
+
position: "below"
|
|
224
|
+
};
|
|
225
|
+
if (n >= o + i)
|
|
226
|
+
return {
|
|
227
|
+
top: e.y - o - i,
|
|
228
|
+
position: "above"
|
|
229
|
+
};
|
|
230
|
+
const l = a > n ? "below" : "above";
|
|
231
|
+
let c;
|
|
232
|
+
return l === "below" ? c = Math.min(
|
|
233
|
+
e.y + e.height + i,
|
|
234
|
+
t - o - s
|
|
235
|
+
) : c = Math.max(s, e.y - o - i), { top: c, position: l };
|
|
236
|
+
}
|
|
237
|
+
function re(e, t, o, i) {
|
|
238
|
+
let n = e.x + e.width / 2 - o / 2;
|
|
239
|
+
return n = Math.max(i, Math.min(n, t - o - i)), n;
|
|
240
|
+
}
|
|
241
|
+
function de(e, t, o, i = 24, s = 24) {
|
|
242
|
+
const a = e.clickX - t - s / 2;
|
|
243
|
+
return Math.max(i, Math.min(a, o - i - s / 2));
|
|
244
|
+
}
|
|
245
|
+
function le(e, t, o, i = nt) {
|
|
246
|
+
const s = i.height + i.arrowHeight, n = ae(
|
|
247
|
+
e,
|
|
248
|
+
o,
|
|
249
|
+
s,
|
|
250
|
+
i.gap,
|
|
251
|
+
i.viewportPadding
|
|
252
|
+
), a = re(
|
|
253
|
+
e,
|
|
254
|
+
t,
|
|
255
|
+
i.width,
|
|
256
|
+
i.viewportPadding
|
|
257
|
+
);
|
|
258
|
+
return {
|
|
259
|
+
top: n.top,
|
|
260
|
+
left: a,
|
|
261
|
+
position: n.position
|
|
262
|
+
};
|
|
263
|
+
}
|
|
264
|
+
function ce(e, t, o, i = {}) {
|
|
265
|
+
const s = i.gap ?? 8;
|
|
266
|
+
let n = e.bottom + s;
|
|
267
|
+
n + t.height > o.height - s && (n = e.top - t.height - s);
|
|
268
|
+
let a = e.left;
|
|
269
|
+
return a < s ? a = s : a + t.width > o.width - s && (a = o.width - t.width - s), n < s ? n = s : n + t.height > o.height - s && (n = o.height - t.height - s), { top: n, left: a };
|
|
270
|
+
}
|
|
271
|
+
function Re(e, t, o, i = nt) {
|
|
272
|
+
const s = le(e, t, o, i), n = de(
|
|
273
|
+
e,
|
|
274
|
+
s.left,
|
|
275
|
+
i.width
|
|
276
|
+
);
|
|
277
|
+
return {
|
|
278
|
+
modal: s,
|
|
279
|
+
arrow: { left: n }
|
|
280
|
+
};
|
|
281
|
+
}
|
|
282
|
+
const ue = 20;
|
|
283
|
+
function he(e) {
|
|
284
|
+
const t = [], o = console.error, i = console.warn, s = console.log, n = (a, l) => {
|
|
285
|
+
const c = {
|
|
286
|
+
message: l.map((d) => String(d)).join(" "),
|
|
287
|
+
timestamp: Date.now(),
|
|
288
|
+
level: a
|
|
289
|
+
};
|
|
290
|
+
t.length >= ue && t.shift(), t.push(c), e && e(c);
|
|
291
|
+
};
|
|
292
|
+
return console.error = function(...a) {
|
|
293
|
+
n("error", a), o.apply(console, a);
|
|
294
|
+
}, console.warn = function(...a) {
|
|
295
|
+
n("warn", a), i.apply(console, a);
|
|
296
|
+
}, console.log = function(...a) {
|
|
297
|
+
n("log", a), s.apply(console, a);
|
|
298
|
+
}, {
|
|
299
|
+
errors: t,
|
|
300
|
+
restore: () => {
|
|
301
|
+
console.error = o, console.warn = i, console.log = s;
|
|
302
|
+
}
|
|
303
|
+
};
|
|
304
|
+
}
|
|
305
|
+
function Pe(e, t, o) {
|
|
306
|
+
const i = document.createElement(e);
|
|
307
|
+
if (t)
|
|
308
|
+
for (const [s, n] of Object.entries(t))
|
|
309
|
+
s === "className" ? i.className = n : i.setAttribute(s, n);
|
|
310
|
+
return i;
|
|
311
|
+
}
|
|
312
|
+
function fe(e = 640) {
|
|
313
|
+
return typeof window < "u" && window.innerWidth < e;
|
|
314
|
+
}
|
|
315
|
+
function ze(e, t, o) {
|
|
316
|
+
const i = o.map((n) => n.style.visibility);
|
|
317
|
+
o.forEach((n) => n.style.visibility = "hidden");
|
|
318
|
+
const s = document.elementFromPoint(e, t);
|
|
319
|
+
return o.forEach((n, a) => n.style.visibility = i[a]), s;
|
|
320
|
+
}
|
|
321
|
+
function Fe(e) {
|
|
322
|
+
return e ? e.hasAttribute("data-qaid-embed") || e.hasAttribute("data-qaid-embed-overlay") ? !0 : !!e.closest("[data-qaid-embed], [data-qaid-embed-overlay]") : !1;
|
|
323
|
+
}
|
|
324
|
+
function Ne(e, t = 0) {
|
|
325
|
+
const o = e.getBoundingClientRect();
|
|
326
|
+
return {
|
|
327
|
+
x: o.left - t,
|
|
328
|
+
y: o.top - t,
|
|
329
|
+
width: o.width + t * 2,
|
|
330
|
+
height: o.height + t * 2
|
|
331
|
+
};
|
|
332
|
+
}
|
|
333
|
+
const pe = "https://unpkg.com/@qaiddev/quests-embed@1/dist/qaid-quests.js", be = (e) => (
|
|
334
|
+
// The URL is a runtime value, not a static specifier — keep Vite from
|
|
335
|
+
// trying to analyze/bundle it.
|
|
336
|
+
import(
|
|
337
|
+
/* @vite-ignore */
|
|
338
|
+
e
|
|
339
|
+
)
|
|
340
|
+
);
|
|
341
|
+
let me = be, p = null, x = null;
|
|
342
|
+
const S = /* @__PURE__ */ new Map(), C = /* @__PURE__ */ new Map();
|
|
343
|
+
function st(e, t) {
|
|
344
|
+
return `${e.replace(/\/+$/, "")}/${encodeURIComponent(t)}/definition`;
|
|
345
|
+
}
|
|
346
|
+
function ge(e) {
|
|
347
|
+
if (S.has(e)) return Promise.resolve();
|
|
348
|
+
const t = C.get(e);
|
|
349
|
+
if (t) return t;
|
|
350
|
+
const o = fetch(e, { headers: { Accept: "application/json" } }).then((i) => i.ok ? i.json() : null).then((i) => {
|
|
351
|
+
i && S.set(e, i);
|
|
352
|
+
}).catch(() => {
|
|
353
|
+
}).finally(() => {
|
|
354
|
+
C.delete(e);
|
|
355
|
+
});
|
|
356
|
+
return C.set(e, o), o;
|
|
357
|
+
}
|
|
358
|
+
function at(e) {
|
|
359
|
+
return p && x === e || (x = e, p = Promise.resolve(me(e)).then((t) => {
|
|
360
|
+
const o = t;
|
|
361
|
+
if (!o || typeof o.QaidQuests != "function")
|
|
362
|
+
throw new Error("quests module has no QaidQuests export");
|
|
363
|
+
return o;
|
|
364
|
+
}).catch((t) => {
|
|
365
|
+
throw p = null, x = null, t;
|
|
366
|
+
})), p;
|
|
367
|
+
}
|
|
368
|
+
async function ve(e) {
|
|
369
|
+
const t = await at(e.moduleUrl), o = e.base.replace(/\/+$/, ""), i = st(o, e.questId), s = (l) => l != null ? { feedbackId: l } : void 0;
|
|
370
|
+
let n;
|
|
371
|
+
const a = e.feedbackId;
|
|
372
|
+
return a instanceof Promise ? n = t.QaidQuests.supports?.asyncMetadata ? a.then(s, () => {
|
|
373
|
+
}) : s(await a.catch(() => null)) : n = s(a ?? null), new t.QaidQuests({
|
|
374
|
+
endpoint: `${o}/responses`,
|
|
375
|
+
configUrl: i,
|
|
376
|
+
// Only a definition already in hand. One still loading is left to the
|
|
377
|
+
// widget, which shows its own loading state instead of nothing.
|
|
378
|
+
questionnaire: S.get(i),
|
|
379
|
+
apiKey: e.apiKey || void 0,
|
|
380
|
+
metadata: n,
|
|
381
|
+
onClose: e.onClose
|
|
382
|
+
});
|
|
383
|
+
}
|
|
384
|
+
const G = "qaid_visitor_id", Z = "qaid_hide_feedback", ye = [
|
|
385
|
+
"#ef4444",
|
|
386
|
+
"#f59e0b",
|
|
387
|
+
"#22c55e",
|
|
388
|
+
"#3b82f6",
|
|
389
|
+
"#111827",
|
|
390
|
+
"#ffffff"
|
|
391
|
+
];
|
|
392
|
+
function we() {
|
|
393
|
+
return typeof window.matchMedia == "function" && window.matchMedia("(pointer: coarse)").matches;
|
|
394
|
+
}
|
|
395
|
+
function A(e) {
|
|
396
|
+
return e ? `${Z}_${e}` : Z;
|
|
397
|
+
}
|
|
398
|
+
function ke(e) {
|
|
399
|
+
try {
|
|
400
|
+
return localStorage.getItem(A(e)) === "1";
|
|
401
|
+
} catch {
|
|
402
|
+
return !1;
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
function tt(e, t = !0) {
|
|
406
|
+
try {
|
|
407
|
+
t ? localStorage.setItem(A(e), "1") : localStorage.removeItem(A(e));
|
|
408
|
+
} catch {
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
function et() {
|
|
412
|
+
const e = typeof crypto < "u" ? crypto : void 0;
|
|
413
|
+
if (e && typeof e.randomUUID == "function") return e.randomUUID();
|
|
414
|
+
const t = new Uint8Array(16);
|
|
415
|
+
if (e && typeof e.getRandomValues == "function")
|
|
416
|
+
e.getRandomValues(t);
|
|
417
|
+
else
|
|
418
|
+
for (let i = 0; i < t.length; i++) t[i] = Math.floor(Math.random() * 256);
|
|
419
|
+
t[6] = t[6] & 15 | 64, t[8] = t[8] & 63 | 128;
|
|
420
|
+
const o = Array.from(t, (i) => i.toString(16).padStart(2, "0")).join("");
|
|
421
|
+
return `${o.slice(0, 8)}-${o.slice(8, 12)}-${o.slice(12, 16)}-${o.slice(16, 20)}-${o.slice(20)}`;
|
|
422
|
+
}
|
|
423
|
+
function qe() {
|
|
424
|
+
try {
|
|
425
|
+
let e = localStorage.getItem(G);
|
|
426
|
+
return e || (e = et(), localStorage.setItem(G, e)), e;
|
|
427
|
+
} catch {
|
|
428
|
+
return et();
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
function ot(e, t) {
|
|
432
|
+
const o = document.createElement("style");
|
|
433
|
+
o.setAttribute("data-qaid-feature", ""), o.textContent = t;
|
|
434
|
+
const i = e.querySelectorAll("style[data-qaid-base], style[data-qaid-feature]"), s = i[i.length - 1];
|
|
435
|
+
e.insertBefore(o, s ? s.nextSibling : e.firstChild);
|
|
436
|
+
}
|
|
437
|
+
class xe {
|
|
438
|
+
config;
|
|
439
|
+
state = "IDLE";
|
|
440
|
+
feedbackData = {
|
|
441
|
+
feedbackType: null,
|
|
442
|
+
elementSelector: null,
|
|
443
|
+
elementText: null,
|
|
444
|
+
consoleErrors: []
|
|
445
|
+
};
|
|
446
|
+
selectedBounds = {
|
|
447
|
+
x: 0,
|
|
448
|
+
y: 0,
|
|
449
|
+
width: 0,
|
|
450
|
+
height: 0,
|
|
451
|
+
clickX: 0,
|
|
452
|
+
clickY: 0,
|
|
453
|
+
visible: !1
|
|
454
|
+
};
|
|
455
|
+
/**
|
|
456
|
+
* This feedback's record id, once its POST answers (null if it failed).
|
|
457
|
+
* The message box and a linked quest open without waiting for it; the
|
|
458
|
+
* PATCHes that need the id wait on this instead.
|
|
459
|
+
*/
|
|
460
|
+
feedbackIdPromise = Promise.resolve(null);
|
|
461
|
+
questsPrewarmed = !1;
|
|
462
|
+
// A quest launched from a button (in place of the message box), if any.
|
|
463
|
+
activeQuest = null;
|
|
464
|
+
isMobile = !1;
|
|
465
|
+
visitorId;
|
|
466
|
+
// Console capture
|
|
467
|
+
consoleCapture = null;
|
|
468
|
+
// Video recording — the whole subsystem lives in a lazily-loaded chunk
|
|
469
|
+
// (recording.ts); a thumbs-only visitor never downloads it.
|
|
470
|
+
recording = null;
|
|
471
|
+
// Element targeting — also a lazily-loaded chunk (targeting.ts).
|
|
472
|
+
targeting = null;
|
|
473
|
+
targetingPrewarmed = !1;
|
|
474
|
+
// Preload-on-intent: warm the lazily-split feature chunks before first use.
|
|
475
|
+
prewarmHandle = null;
|
|
476
|
+
prewarmIsTimeout = !1;
|
|
477
|
+
videoPrewarmed = !1;
|
|
478
|
+
screenshotPrewarmed = !1;
|
|
479
|
+
// Shadow DOM
|
|
480
|
+
shadowHost = null;
|
|
481
|
+
shadowRoot = null;
|
|
482
|
+
// Overlay shadow DOM (always on document.body for full-page coverage)
|
|
483
|
+
overlayShadowHost = null;
|
|
484
|
+
overlayShadowRoot = null;
|
|
485
|
+
// DOM elements (inside shadow root)
|
|
486
|
+
buttonsContainer = null;
|
|
487
|
+
isUserProvidedContainer = !1;
|
|
488
|
+
// The message modal lives in a lazily-loaded chunk (modal.ts).
|
|
489
|
+
modal = null;
|
|
490
|
+
modalPrewarmed = !1;
|
|
491
|
+
dismissBtn = null;
|
|
492
|
+
// Per-instance CSS variables
|
|
493
|
+
cssVars = {};
|
|
494
|
+
activeThumbBtn = null;
|
|
495
|
+
// Tracks whether the pending activation came from the keyboard (Enter/Space)
|
|
496
|
+
// rather than a pointer, so targeting can avoid elementFromPoint(0,0).
|
|
497
|
+
keyboardActivation = !1;
|
|
498
|
+
// Accessibility: dialog focus management
|
|
499
|
+
dialogTrigger = null;
|
|
500
|
+
dialogTrap = null;
|
|
501
|
+
dialogRestoreInert = null;
|
|
502
|
+
// Unique id suffix for aria-labelledby/describedby references
|
|
503
|
+
uid = Math.random().toString(36).slice(2, 9);
|
|
504
|
+
// Bound event handlers
|
|
505
|
+
boundKeyDown;
|
|
506
|
+
boundResize;
|
|
507
|
+
// Start with buttons slid off-screen (localStorage dismiss, no animation)
|
|
508
|
+
_startDismissed = !1;
|
|
509
|
+
// DOM persistence (survives framework client-side navigation)
|
|
510
|
+
destroyed = !1;
|
|
511
|
+
domObserver = null;
|
|
512
|
+
boundBeforeSwap = null;
|
|
513
|
+
constructor(t) {
|
|
514
|
+
this.config = {
|
|
515
|
+
endpoint: t.endpoint,
|
|
516
|
+
apiKey: t.apiKey ?? "",
|
|
517
|
+
container: t.container ?? "",
|
|
518
|
+
buttonClass: t.buttonClass ?? "",
|
|
519
|
+
direction: t.direction ?? "horizontal",
|
|
520
|
+
position: t.position ?? "bottom-right",
|
|
521
|
+
offset: {
|
|
522
|
+
x: t.offset?.x ?? 16,
|
|
523
|
+
y: t.offset?.y ?? 16
|
|
524
|
+
},
|
|
525
|
+
zIndex: t.zIndex ?? 50,
|
|
526
|
+
skipTargeting: t.skipTargeting ?? !1,
|
|
527
|
+
singleButton: t.singleButton ?? !1,
|
|
528
|
+
feedbackMode: t.feedbackMode ?? "target",
|
|
529
|
+
colors: {
|
|
530
|
+
positive: t.colors?.positive ?? "rgb(0, 200, 83)",
|
|
531
|
+
negative: t.colors?.negative ?? "rgb(255, 0, 0)",
|
|
532
|
+
marker: t.colors?.marker ?? "#6365f1"
|
|
533
|
+
},
|
|
534
|
+
buttonSize: t.buttonSize ?? "medium",
|
|
535
|
+
text: {
|
|
536
|
+
tooltip: t.text?.tooltip ?? "",
|
|
537
|
+
modalTitle: t.text?.modalTitle ?? "Thank you for your feedback!",
|
|
538
|
+
modalSubtitle: t.text?.modalSubtitle ?? "Would you like to add a message to help us understand your feedback better?",
|
|
539
|
+
placeholder: t.text?.placeholder ?? "Optional: Tell us more about your experience...",
|
|
540
|
+
submitButton: t.text?.submitButton ?? "Submit",
|
|
541
|
+
skipButton: t.text?.skipButton ?? "Skip",
|
|
542
|
+
positiveLabel: t.text?.positiveLabel ?? "Send positive feedback",
|
|
543
|
+
negativeLabel: t.text?.negativeLabel ?? "Send negative feedback",
|
|
544
|
+
recordLabel: t.text?.recordLabel ?? "Record a screen recording",
|
|
545
|
+
dismissLabel: t.text?.dismissLabel ?? "Hide Feedback",
|
|
546
|
+
feedbackLabel: t.text?.feedbackLabel ?? "Send feedback",
|
|
547
|
+
confirmationTitle: t.text?.confirmationTitle ?? "Thank you!",
|
|
548
|
+
confirmationMessage: t.text?.confirmationMessage ?? "Your feedback has been received.",
|
|
549
|
+
confirmationClose: t.text?.confirmationClose ?? "Close",
|
|
550
|
+
errorTitle: t.text?.errorTitle ?? "Message not sent",
|
|
551
|
+
errorMessage: t.text?.errorMessage ?? "Something went wrong, so we did not get your message. Please try again later."
|
|
552
|
+
},
|
|
553
|
+
hideConfirmation: t.hideConfirmation ?? !1,
|
|
554
|
+
modalWidth: t.modalWidth ?? 400,
|
|
555
|
+
backdropOpacity: t.backdropOpacity ?? 0.3,
|
|
556
|
+
fontFamily: t.fontFamily ?? "system-ui, -apple-system, sans-serif",
|
|
557
|
+
fontSize: t.fontSize ?? 16,
|
|
558
|
+
captureScreenshot: t.captureScreenshot ?? !1,
|
|
559
|
+
annotate: t.annotate ?? !0,
|
|
560
|
+
annotationColor: t.annotationColor ?? t.colors?.marker ?? "#6365f1",
|
|
561
|
+
annotationPalette: t.annotationPalette ?? ye,
|
|
562
|
+
screenshotMethod: t.screenshotMethod ?? "permission",
|
|
563
|
+
screenshotOptions: {
|
|
564
|
+
quality: t.screenshotOptions?.quality ?? 0.8,
|
|
565
|
+
maxWidth: t.screenshotOptions?.maxWidth ?? 1280,
|
|
566
|
+
maxHeight: t.screenshotOptions?.maxHeight ?? 800
|
|
567
|
+
},
|
|
568
|
+
incognito: t.incognito ?? !1,
|
|
569
|
+
hideDismiss: t.hideDismiss ?? !1,
|
|
570
|
+
positiveIcon: t.positiveIcon ?? "",
|
|
571
|
+
negativeIcon: t.negativeIcon ?? "",
|
|
572
|
+
feedbackIcon: t.feedbackIcon ?? "",
|
|
573
|
+
hideThumbs: t.hideThumbs ?? !1,
|
|
574
|
+
css: t.css ?? "",
|
|
575
|
+
captureVideo: t.captureVideo ?? !1,
|
|
576
|
+
videoOptions: {
|
|
577
|
+
maxDuration: t.videoOptions?.maxDuration ?? 15,
|
|
578
|
+
redaction: t.videoOptions?.redaction ?? !1
|
|
579
|
+
},
|
|
580
|
+
recordIcon: t.recordIcon ?? "",
|
|
581
|
+
quests: {
|
|
582
|
+
base: t.quests?.base ?? "",
|
|
583
|
+
up: t.quests?.up ?? "",
|
|
584
|
+
down: t.quests?.down ?? "",
|
|
585
|
+
video: t.quests?.video ?? "",
|
|
586
|
+
// Quest service reuses the feedback API key unless overridden.
|
|
587
|
+
apiKey: t.quests?.apiKey ?? t.apiKey ?? "",
|
|
588
|
+
moduleUrl: t.quests?.moduleUrl ?? pe
|
|
589
|
+
}
|
|
590
|
+
}, this.boundKeyDown = this.handleKeyDown.bind(this), this.boundResize = this.handleResize.bind(this), this.visitorId = qe(), this.init();
|
|
591
|
+
}
|
|
592
|
+
applyVars(t) {
|
|
593
|
+
$t(t, this.cssVars);
|
|
594
|
+
}
|
|
595
|
+
/**
|
|
596
|
+
* Announce a message via the shared visually-hidden live regions.
|
|
597
|
+
* Prefer the overlay shadow root (which hosts every transient surface and
|
|
598
|
+
* is never inerted by its own dialogs) so announcements are not suppressed
|
|
599
|
+
* while a dialog aria-hides the main button host.
|
|
600
|
+
*/
|
|
601
|
+
announceMsg(t, o = !1) {
|
|
602
|
+
const i = this.overlayShadowRoot ?? this.shadowRoot;
|
|
603
|
+
i && Jt(i, t, { assertive: o });
|
|
604
|
+
}
|
|
605
|
+
/**
|
|
606
|
+
* Turn a transient surface into an accessible modal dialog: save the
|
|
607
|
+
* invoking control, apply dialog semantics, trap focus, and inert the
|
|
608
|
+
* background. Paired with closeDialogA11y() on every close path.
|
|
609
|
+
*/
|
|
610
|
+
openDialogA11y(t, o) {
|
|
611
|
+
this.dialogTrigger = ee(), ie(t, o), this.dialogTrap = te(t), this.dialogRestoreInert = se(t);
|
|
612
|
+
}
|
|
613
|
+
closeDialogA11y() {
|
|
614
|
+
this.dialogTrap?.release(), this.dialogTrap = null, this.dialogRestoreInert && (this.dialogRestoreInert(), this.dialogRestoreInert = null), oe(this.dialogTrigger), this.dialogTrigger = null;
|
|
615
|
+
}
|
|
616
|
+
clearActiveThumb() {
|
|
617
|
+
this.activeThumbBtn && (this.activeThumbBtn.setAttribute("aria-pressed", "false"), this.activeThumbBtn = null);
|
|
618
|
+
}
|
|
619
|
+
init() {
|
|
620
|
+
Kt(), this.cssVars = Vt({
|
|
621
|
+
positiveColor: this.config.colors.positive,
|
|
622
|
+
negativeColor: this.config.colors.negative,
|
|
623
|
+
markerColor: this.config.colors.marker,
|
|
624
|
+
buttonSize: this.config.buttonSize,
|
|
625
|
+
modalWidth: this.config.modalWidth,
|
|
626
|
+
backdropOpacity: this.config.backdropOpacity,
|
|
627
|
+
fontFamily: this.config.fontFamily,
|
|
628
|
+
fontSize: this.config.fontSize
|
|
629
|
+
}), !this.config.hideDismiss && ke(this.config.apiKey) && (this._startDismissed = !0), this.checkMobile(), window.addEventListener("resize", this.boundResize), this.createEmbed(), this.consoleCapture = he((t) => {
|
|
630
|
+
this.feedbackData.consoleErrors = this.consoleCapture?.errors ?? [];
|
|
631
|
+
}), this.feedbackData.consoleErrors = this.consoleCapture.errors, this.observeDom(), (this.config.captureVideo && this.videoSupported() || this.config.captureScreenshot || this.linkedQuestIds().length > 0) && this.schedulePrewarm(() => {
|
|
632
|
+
this.config.captureVideo && this.videoSupported() && this.prewarmVideo(), this.config.captureScreenshot && this.prewarmScreenshot(), this.prewarmQuests();
|
|
633
|
+
});
|
|
634
|
+
}
|
|
635
|
+
/**
|
|
636
|
+
* Best-effort preload of a lazily-split feature chunk so its first use is
|
|
637
|
+
* instant. Warming fetches + compiles (and defines) the module; the feature
|
|
638
|
+
* modules have no load-time side effects, so this is safe. Errors are
|
|
639
|
+
* swallowed — a failed preload just falls back to an on-demand load.
|
|
640
|
+
*/
|
|
641
|
+
prewarmVideo() {
|
|
642
|
+
this.videoPrewarmed || (this.videoPrewarmed = !0, import("./recording-CPzxRL7f.js").catch(() => {
|
|
643
|
+
}), import("./video-Bd_29-rK.js").catch(() => {
|
|
644
|
+
}));
|
|
645
|
+
}
|
|
646
|
+
prewarmScreenshot() {
|
|
647
|
+
this.screenshotPrewarmed || (this.screenshotPrewarmed = !0, (this.shouldCaptureViaDom() ? import("./screenshot-dom-CME7tYRE.js") : import("./screenshot-DYOKg2bS.js")).catch(() => {
|
|
648
|
+
}), this.config.annotate && import("./annotate-5zJWs-aB.js").catch(() => {
|
|
649
|
+
}));
|
|
650
|
+
}
|
|
651
|
+
/** Quest ids linked to any button, when quest launching is on. */
|
|
652
|
+
linkedQuestIds() {
|
|
653
|
+
const t = this.config.quests;
|
|
654
|
+
return t.base ? [t.up, t.down, t.video].filter((o) => o) : [];
|
|
655
|
+
}
|
|
656
|
+
/**
|
|
657
|
+
* Load the quests module and fetch every linked quest's definition, so a
|
|
658
|
+
* click opens the quest with no network wait. Both are best-effort: a miss
|
|
659
|
+
* just means the quest loads on click, as it always did.
|
|
660
|
+
*/
|
|
661
|
+
prewarmQuests() {
|
|
662
|
+
if (this.questsPrewarmed) return;
|
|
663
|
+
const t = this.linkedQuestIds();
|
|
664
|
+
if (t.length !== 0) {
|
|
665
|
+
this.questsPrewarmed = !0, at(this.config.quests.moduleUrl).catch(() => {
|
|
666
|
+
});
|
|
667
|
+
for (const o of t)
|
|
668
|
+
ge(st(this.config.quests.base, o));
|
|
669
|
+
}
|
|
670
|
+
}
|
|
671
|
+
/** Run fn when the main thread is idle; cancelled by destroy(). */
|
|
672
|
+
schedulePrewarm(t) {
|
|
673
|
+
const o = window, i = () => {
|
|
674
|
+
this.destroyed || t();
|
|
675
|
+
};
|
|
676
|
+
typeof o.requestIdleCallback == "function" ? (this.prewarmIsTimeout = !1, this.prewarmHandle = o.requestIdleCallback(i, { timeout: 2e3 })) : (this.prewarmIsTimeout = !0, this.prewarmHandle = window.setTimeout(i, 1200));
|
|
677
|
+
}
|
|
678
|
+
/**
|
|
679
|
+
* Watch for the shadow hosts being removed from the DOM by framework
|
|
680
|
+
* client-side navigation (e.g. Astro View Transitions swapping <body>
|
|
681
|
+
* contents, or any SPA router that replaces DOM subtrees). If the host
|
|
682
|
+
* is disconnected and destroy() wasn't called, re-append it.
|
|
683
|
+
*
|
|
684
|
+
* Also hooks into Astro's `astro:before-swap` when available, which
|
|
685
|
+
* lets us carry elements into the new document before the swap happens
|
|
686
|
+
* (avoids a flash of the widget disappearing and reappearing).
|
|
687
|
+
*/
|
|
688
|
+
observeDom() {
|
|
689
|
+
this.boundBeforeSwap = (t) => {
|
|
690
|
+
const o = t.newDocument;
|
|
691
|
+
!o || this.destroyed || (this.shadowHost && o.body.appendChild(this.shadowHost), this.overlayShadowHost && o.body.appendChild(this.overlayShadowHost));
|
|
692
|
+
}, document.addEventListener("astro:before-swap", this.boundBeforeSwap), this.domObserver = new MutationObserver(() => {
|
|
693
|
+
this.destroyed || (this.shadowHost && !this.shadowHost.isConnected && document.body.appendChild(this.shadowHost), this.overlayShadowHost && !this.overlayShadowHost.isConnected && document.body.appendChild(this.overlayShadowHost));
|
|
694
|
+
}), this.domObserver.observe(document.body, { childList: !0 });
|
|
695
|
+
}
|
|
696
|
+
checkMobile() {
|
|
697
|
+
this.isMobile = fe();
|
|
698
|
+
}
|
|
699
|
+
handleResize() {
|
|
700
|
+
this.checkMobile();
|
|
701
|
+
}
|
|
702
|
+
createEmbed() {
|
|
703
|
+
this.shadowHost = document.createElement("div"), this.shadowHost.setAttribute("data-qaid-embed", ""), this.shadowHost.style.position = "static", this.shadowHost.style.display = "contents";
|
|
704
|
+
let t = null;
|
|
705
|
+
this.config.container && (t = document.querySelector(this.config.container)), t ? (t.appendChild(this.shadowHost), this.isUserProvidedContainer = !0, this.config.hideDismiss = !0) : (this.shadowHost.style.position = "fixed", this.shadowHost.style.display = "block", this.shadowHost.style.inset = "0", this.shadowHost.style.pointerEvents = "none", this.shadowHost.style.zIndex = String(this.config.zIndex), document.body.appendChild(this.shadowHost)), this.shadowRoot = this.shadowHost.attachShadow({ mode: "open" });
|
|
706
|
+
const o = document.createElement("style");
|
|
707
|
+
if (o.setAttribute("data-qaid-base", ""), o.textContent = X(), this.shadowRoot.appendChild(o), this.config.css) {
|
|
708
|
+
const d = document.createElement("style");
|
|
709
|
+
d.textContent = this.config.css, this.shadowRoot.appendChild(d);
|
|
710
|
+
}
|
|
711
|
+
const i = this.config.direction === "vertical" ? "qaid-vertical" : "";
|
|
712
|
+
if (this.isUserProvidedContainer)
|
|
713
|
+
this.buttonsContainer = document.createElement("div"), this.buttonsContainer.className = `qaid-buttons qaid-${this.config.position} ${i}`.trim(), this.config.incognito && this.buttonsContainer.classList.add("qaid-incognito");
|
|
714
|
+
else {
|
|
715
|
+
this.buttonsContainer = document.createElement("div"), this.buttonsContainer.className = `qaid-buttons qaid-auto-container qaid-${this.config.position} ${i}${this.config.incognito ? " qaid-incognito" : ""}`.trim(), this.buttonsContainer.style.pointerEvents = "auto";
|
|
716
|
+
const { x: d, y: r } = this.config.offset;
|
|
717
|
+
this.config.position.includes("right") ? this.buttonsContainer.style.right = `${d}px` : this.buttonsContainer.style.left = `${d}px`, this.config.position.includes("bottom") ? this.buttonsContainer.style.bottom = `${r}px` : this.buttonsContainer.style.top = `${r}px`;
|
|
718
|
+
}
|
|
719
|
+
this.applyVars(this.buttonsContainer), this.shadowRoot.appendChild(this.buttonsContainer), this.buttonsContainer.addEventListener("keydown", (d) => {
|
|
720
|
+
(d.key === "Enter" || d.key === " " || d.key === "Spacebar") && (this.keyboardActivation = !0);
|
|
721
|
+
}), this.buttonsContainer.addEventListener("mousedown", () => {
|
|
722
|
+
this.keyboardActivation = !1;
|
|
723
|
+
}), this.buttonsContainer.addEventListener("pointerdown", () => {
|
|
724
|
+
this.keyboardActivation = !1;
|
|
725
|
+
});
|
|
726
|
+
const s = !!this.config.buttonClass, n = s ? `qaid-btn-structural ${this.config.buttonClass}` : "qaid-btn", l = this.config.text.tooltip || "Feedback for us?", c = document.createElement("div");
|
|
727
|
+
if (c.className = "qaid-tooltip-text", c.textContent = l, this.applyVars(c), this.shadowRoot.appendChild(c), this.tooltipElement = c, this.config.singleButton) {
|
|
728
|
+
const d = document.createElement("div");
|
|
729
|
+
d.className = "qaid-tooltip-wrapper";
|
|
730
|
+
const r = document.createElement("button");
|
|
731
|
+
r.type = "button", r.className = s ? `${n} qaid-btn-feedback` : "qaid-btn qaid-btn-feedback", r.setAttribute("aria-label", this.config.text.feedbackLabel), r.innerHTML = this.config.feedbackIcon || Bt, r.addEventListener("click", (u) => this.handleThumbClick("neutral", u.currentTarget, u)), r.addEventListener("mouseenter", () => {
|
|
732
|
+
this.prewarmTargeting(), this.showTooltip(r);
|
|
733
|
+
}), r.addEventListener("mouseleave", () => this.hideTooltip()), d.appendChild(r), this.buttonsContainer.appendChild(d);
|
|
734
|
+
} else if (!this.config.hideThumbs) {
|
|
735
|
+
const d = document.createElement("div");
|
|
736
|
+
d.className = "qaid-tooltip-wrapper";
|
|
737
|
+
const r = document.createElement("button");
|
|
738
|
+
r.type = "button", r.className = s ? `${n} qaid-btn-up` : "qaid-btn qaid-btn-up", r.setAttribute("aria-label", this.config.text.positiveLabel), r.innerHTML = this.config.positiveIcon || Mt, r.addEventListener("click", (f) => this.handleThumbClick("up", f.currentTarget, f)), r.addEventListener("mouseenter", () => {
|
|
739
|
+
this.prewarmTargeting(), this.prewarmQuests(), this.showTooltip(r);
|
|
740
|
+
}), r.addEventListener("mouseleave", () => this.hideTooltip()), d.appendChild(r);
|
|
741
|
+
const u = document.createElement("div");
|
|
742
|
+
u.className = "qaid-tooltip-wrapper";
|
|
743
|
+
const h = document.createElement("button");
|
|
744
|
+
h.type = "button", h.className = s ? `${n} qaid-btn-down` : "qaid-btn qaid-btn-down", h.setAttribute("aria-label", this.config.text.negativeLabel), h.innerHTML = this.config.negativeIcon || Lt, h.addEventListener("click", (f) => this.handleThumbClick("down", f.currentTarget, f)), h.addEventListener("mouseenter", () => {
|
|
745
|
+
this.prewarmTargeting(), this.prewarmQuests(), this.showTooltip(h);
|
|
746
|
+
}), h.addEventListener("mouseleave", () => this.hideTooltip()), u.appendChild(h), this.buttonsContainer.appendChild(d), this.buttonsContainer.appendChild(u);
|
|
747
|
+
}
|
|
748
|
+
if (this.config.captureVideo && this.videoSupported()) {
|
|
749
|
+
const d = document.createElement("div");
|
|
750
|
+
d.className = "qaid-tooltip-wrapper";
|
|
751
|
+
const r = document.createElement("button");
|
|
752
|
+
r.type = "button", r.className = s ? `${n} qaid-btn-record` : "qaid-btn qaid-btn-record", r.setAttribute("aria-label", this.config.text.recordLabel), r.innerHTML = this.config.recordIcon || Ht, r.addEventListener("click", () => {
|
|
753
|
+
this.ensureRecording().then(
|
|
754
|
+
(h) => this.config.videoOptions.redaction ? h.startPicking() : h.startRecording()
|
|
755
|
+
);
|
|
756
|
+
});
|
|
757
|
+
const u = () => this.prewarmVideo();
|
|
758
|
+
r.addEventListener("mouseenter", () => {
|
|
759
|
+
u(), this.showTooltip(r);
|
|
760
|
+
}), r.addEventListener("focus", u), r.addEventListener("touchstart", u, { passive: !0 }), r.addEventListener("mouseleave", () => this.hideTooltip()), d.appendChild(r), this.buttonsContainer.appendChild(d);
|
|
761
|
+
}
|
|
762
|
+
this.config.hideDismiss || (this.dismissBtn = document.createElement("button"), this.dismissBtn.type = "button", this.dismissBtn.className = "qaid-dismiss-btn", this.dismissBtn.setAttribute("aria-label", this.config.text.dismissLabel), this.dismissBtn.title = this.config.text.dismissLabel, this.dismissBtn.innerHTML = '<svg width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M2 2l8 8M10 2l-8 8" stroke="currentColor" stroke-width="2" stroke-linecap="round"/></svg>', this.dismissBtn.addEventListener("click", (d) => {
|
|
763
|
+
d.stopPropagation(), this.handleDismiss();
|
|
764
|
+
}), this.buttonsContainer.insertBefore(this.dismissBtn, this.buttonsContainer.firstChild), this._startDismissed && this.buttonsContainer.classList.add("qaid-dismissed"));
|
|
765
|
+
}
|
|
766
|
+
/**
|
|
767
|
+
* Lazily create a separate overlay shadow host on document.body.
|
|
768
|
+
* This host contains all full-page elements (targeting overlay, marker,
|
|
769
|
+
* backdrop, modal, recording indicator, video preview) so they escape
|
|
770
|
+
* clip-path / transform containing blocks in user containers.
|
|
771
|
+
*/
|
|
772
|
+
ensureOverlayHost() {
|
|
773
|
+
if (this.overlayShadowRoot) return this.overlayShadowRoot;
|
|
774
|
+
this.overlayShadowHost = document.createElement("div"), this.overlayShadowHost.setAttribute("data-qaid-embed-overlay", ""), this.overlayShadowHost.style.position = "fixed", this.overlayShadowHost.style.inset = "0", this.overlayShadowHost.style.pointerEvents = "none", this.overlayShadowHost.style.zIndex = String(this.config.zIndex), document.body.appendChild(this.overlayShadowHost), this.overlayShadowRoot = this.overlayShadowHost.attachShadow({ mode: "open" });
|
|
775
|
+
const t = document.createElement("style");
|
|
776
|
+
t.setAttribute("data-qaid-base", ""), t.textContent = X(), this.overlayShadowRoot.appendChild(t);
|
|
777
|
+
for (const o of this.featureStyles) ot(this.overlayShadowRoot, o);
|
|
778
|
+
if (this.config.css) {
|
|
779
|
+
const o = document.createElement("style");
|
|
780
|
+
o.textContent = this.config.css, this.overlayShadowRoot.appendChild(o);
|
|
781
|
+
}
|
|
782
|
+
return this.overlayShadowRoot;
|
|
783
|
+
}
|
|
784
|
+
/** The styles of every feature chunk loaded so far, in load order. */
|
|
785
|
+
featureStyles = [];
|
|
786
|
+
/**
|
|
787
|
+
* Add a feature chunk's styles to both shadow roots. The core stylesheet
|
|
788
|
+
* styles only the buttons; the message box, targeting, video and markup
|
|
789
|
+
* editor bring their own CSS with their chunk, so a page that never opens
|
|
790
|
+
* them never downloads it.
|
|
791
|
+
*/
|
|
792
|
+
addFeatureStyles(t) {
|
|
793
|
+
if (!this.featureStyles.includes(t)) {
|
|
794
|
+
this.featureStyles.push(t);
|
|
795
|
+
for (const o of [this.shadowRoot, this.overlayShadowRoot])
|
|
796
|
+
o && ot(o, t);
|
|
797
|
+
}
|
|
798
|
+
}
|
|
799
|
+
tooltipElement = null;
|
|
800
|
+
showTooltip(t) {
|
|
801
|
+
const o = this.tooltipElement;
|
|
802
|
+
o.style.visibility = "hidden", o.classList.add("qaid-tooltip-visible");
|
|
803
|
+
const i = t.getBoundingClientRect(), s = o.getBoundingClientRect(), { top: n, left: a } = ce(
|
|
804
|
+
i,
|
|
805
|
+
s,
|
|
806
|
+
{ width: window.innerWidth, height: window.innerHeight }
|
|
807
|
+
);
|
|
808
|
+
o.style.top = `${n}px`, o.style.left = `${a}px`, o.style.visibility = "visible";
|
|
809
|
+
}
|
|
810
|
+
hideTooltip() {
|
|
811
|
+
this.tooltipElement.classList.remove("qaid-tooltip-visible");
|
|
812
|
+
}
|
|
813
|
+
handleDismiss() {
|
|
814
|
+
this.buttonsContainer.classList.add("qaid-dismissed"), tt(this.config.apiKey, !0);
|
|
815
|
+
}
|
|
816
|
+
handleThumbClick(t, o, i) {
|
|
817
|
+
if (this.buttonsContainer?.classList.contains("qaid-incognito") && (this.buttonsContainer.classList.remove("qaid-incognito"), tt(this.config.apiKey, !1)), this.prewarmModal(), this.config.skipTargeting || this.config.feedbackMode === "annotate")
|
|
818
|
+
this.submitDirectFeedback(t, o);
|
|
819
|
+
else {
|
|
820
|
+
this.activeThumbBtn = o, o.setAttribute("aria-pressed", "true");
|
|
821
|
+
const s = this.keyboardActivation;
|
|
822
|
+
this.keyboardActivation = !1, this.ensureTargeting().then((n) => {
|
|
823
|
+
this.destroyed || (s ? n.startKeyboard(t) : n.startPointer(t, i));
|
|
824
|
+
});
|
|
825
|
+
}
|
|
826
|
+
}
|
|
827
|
+
submitDirectFeedback(t, o) {
|
|
828
|
+
this.feedbackData.feedbackType = t, this.feedbackData.elementSelector = null, this.feedbackData.elementText = null;
|
|
829
|
+
const i = o.getBoundingClientRect();
|
|
830
|
+
this.selectedBounds = {
|
|
831
|
+
x: i.left,
|
|
832
|
+
y: i.top,
|
|
833
|
+
width: i.width,
|
|
834
|
+
height: i.height,
|
|
835
|
+
clickX: i.left + i.width / 2,
|
|
836
|
+
clickY: i.top + i.height / 2,
|
|
837
|
+
visible: !1
|
|
838
|
+
}, this.submitFeedback();
|
|
839
|
+
}
|
|
840
|
+
handleKeyDown(t) {
|
|
841
|
+
if (t.key === "Escape") {
|
|
842
|
+
if (this.recording?.handleEscape()) return;
|
|
843
|
+
this.state === "TARGETING" ? this.targeting?.cancel() : this.state === "MODAL_OPEN" && this.modal?.close();
|
|
844
|
+
}
|
|
845
|
+
}
|
|
846
|
+
/** Whether to capture the screenshot with the DOM/canvas method (html2canvas)
|
|
847
|
+
* instead of the permission-based Screen Capture API. Explicit "dom" wins;
|
|
848
|
+
* otherwise DOM is used on touch devices to avoid the getDisplayMedia prompt. */
|
|
849
|
+
shouldCaptureViaDom() {
|
|
850
|
+
return this.config.screenshotMethod === "dom" || we();
|
|
851
|
+
}
|
|
852
|
+
/**
|
|
853
|
+
* Open the full-screen annotation editor over the captured screenshot,
|
|
854
|
+
* reusing the overlay shadow host and the shared dialog a11y helpers.
|
|
855
|
+
* Resolves with the composited WebP data URL, or null when the user skips
|
|
856
|
+
* (caller keeps the original). Pointer events on the overlay host are
|
|
857
|
+
* enabled while the editor is open and restored on close.
|
|
858
|
+
*/
|
|
859
|
+
async openAnnotationEditor(t) {
|
|
860
|
+
const o = this.ensureOverlayHost(), i = this.overlayShadowHost, s = i.style.pointerEvents;
|
|
861
|
+
i.style.pointerEvents = "auto";
|
|
862
|
+
try {
|
|
863
|
+
const { openAnnotationEditor: n, styles: a } = await import("./annotate-5zJWs-aB.js");
|
|
864
|
+
return this.addFeatureStyles(a), await n({
|
|
865
|
+
dataUrl: t,
|
|
866
|
+
root: o,
|
|
867
|
+
quality: this.config.screenshotOptions.quality,
|
|
868
|
+
color: this.config.annotationColor,
|
|
869
|
+
palette: this.config.annotationPalette,
|
|
870
|
+
applyVars: (l) => this.applyVars(l),
|
|
871
|
+
announce: (l, c) => this.announceMsg(l, c),
|
|
872
|
+
openDialog: (l, c) => this.openDialogA11y(l, c),
|
|
873
|
+
closeDialog: () => this.closeDialogA11y()
|
|
874
|
+
});
|
|
875
|
+
} catch (n) {
|
|
876
|
+
return console.error("Annotation editor failed to open:", n), null;
|
|
877
|
+
} finally {
|
|
878
|
+
i.style.pointerEvents = s;
|
|
879
|
+
}
|
|
880
|
+
}
|
|
881
|
+
async submitFeedback() {
|
|
882
|
+
let t = null;
|
|
883
|
+
if (this.config.captureScreenshot || this.config.feedbackMode === "annotate")
|
|
884
|
+
try {
|
|
885
|
+
if (this.shouldCaptureViaDom()) {
|
|
886
|
+
const { captureDomScreenshot: a } = await import("./screenshot-dom-CME7tYRE.js");
|
|
887
|
+
t = await a(this.config.screenshotOptions);
|
|
888
|
+
} else {
|
|
889
|
+
const { captureScreenshot: a } = await import("./screenshot-DYOKg2bS.js");
|
|
890
|
+
t = await a(this.config.screenshotOptions);
|
|
891
|
+
}
|
|
892
|
+
t && this.announceMsg("Screenshot captured");
|
|
893
|
+
} catch (a) {
|
|
894
|
+
console.error("Screenshot capture failed:", a), t = null;
|
|
895
|
+
}
|
|
896
|
+
t && this.config.annotate && (t = await this.openAnnotationEditor(t) ?? t);
|
|
897
|
+
const i = this.feedbackData.elementSelector ? {
|
|
898
|
+
x: this.selectedBounds.x,
|
|
899
|
+
y: this.selectedBounds.y,
|
|
900
|
+
width: this.selectedBounds.width,
|
|
901
|
+
height: this.selectedBounds.height
|
|
902
|
+
} : null, s = {
|
|
903
|
+
feedbackType: this.feedbackData.feedbackType,
|
|
904
|
+
pageUrl: window.location.href,
|
|
905
|
+
apiKey: this.config.apiKey || void 0,
|
|
906
|
+
elementSelector: this.feedbackData.elementSelector,
|
|
907
|
+
elementText: this.feedbackData.elementText,
|
|
908
|
+
consoleErrors: [...this.feedbackData.consoleErrors],
|
|
909
|
+
screenWidth: window.innerWidth,
|
|
910
|
+
screenHeight: window.innerHeight,
|
|
911
|
+
clickX: this.selectedBounds.clickX,
|
|
912
|
+
clickY: this.selectedBounds.clickY,
|
|
913
|
+
scrollX: window.scrollX,
|
|
914
|
+
scrollY: window.scrollY,
|
|
915
|
+
screenshot: t,
|
|
916
|
+
visitorId: this.visitorId,
|
|
917
|
+
// Include element bounds and user agent for server-side screenshot fallback
|
|
918
|
+
elementBounds: i,
|
|
919
|
+
userAgent: navigator.userAgent
|
|
920
|
+
};
|
|
921
|
+
this.feedbackIdPromise = this.postFeedback(s);
|
|
922
|
+
const n = this.feedbackData.feedbackType;
|
|
923
|
+
if (n && n !== "neutral" && await this.tryLaunchQuest(n, this.feedbackIdPromise)) {
|
|
924
|
+
this.resetFeedbackUi();
|
|
925
|
+
return;
|
|
926
|
+
}
|
|
927
|
+
this.state = "MODAL_OPEN";
|
|
928
|
+
try {
|
|
929
|
+
const a = await this.ensureModal();
|
|
930
|
+
if (this.destroyed) return;
|
|
931
|
+
a.open(), this.overlayShadowHost && (this.overlayShadowHost.style.pointerEvents = "auto");
|
|
932
|
+
} catch (a) {
|
|
933
|
+
console.error("Failed to open the feedback modal:", a), this.announceMsg("Thank you for your feedback!", !0), this.resetFeedbackUi();
|
|
934
|
+
}
|
|
935
|
+
}
|
|
936
|
+
/** POST the feedback. Resolves to the new record's id, or null if it failed. */
|
|
937
|
+
async postFeedback(t) {
|
|
938
|
+
try {
|
|
939
|
+
const o = await fetch(this.config.endpoint, {
|
|
940
|
+
method: "POST",
|
|
941
|
+
headers: { "Content-Type": "application/json" },
|
|
942
|
+
body: JSON.stringify(t)
|
|
943
|
+
});
|
|
944
|
+
if (o.ok) {
|
|
945
|
+
const i = await o.json();
|
|
946
|
+
return this.announceMsg("Feedback sent"), i.id;
|
|
947
|
+
}
|
|
948
|
+
} catch (o) {
|
|
949
|
+
console.error("Failed to submit feedback:", o), this.announceMsg("Failed to send feedback", !0);
|
|
950
|
+
}
|
|
951
|
+
return null;
|
|
952
|
+
}
|
|
953
|
+
/**
|
|
954
|
+
* Quest id linked to `type`, or "" when quest launching is disabled
|
|
955
|
+
* (no `base`) or this button has no quest configured.
|
|
956
|
+
*/
|
|
957
|
+
questIdFor(t) {
|
|
958
|
+
const o = this.config.quests;
|
|
959
|
+
return o.base && o[t] || "";
|
|
960
|
+
}
|
|
961
|
+
/**
|
|
962
|
+
* Launch the quest linked to `type`, if any. Resolves `true` when a quest
|
|
963
|
+
* was configured and the widget launched; `false` when no quest is
|
|
964
|
+
* configured or the widget failed to load (caller falls back to its
|
|
965
|
+
* normal UI). The created feedback record id is passed through so the
|
|
966
|
+
* quest response can be joined back to it server-side.
|
|
967
|
+
*/
|
|
968
|
+
async tryLaunchQuest(t, o) {
|
|
969
|
+
const i = this.questIdFor(t);
|
|
970
|
+
if (!i) return !1;
|
|
971
|
+
try {
|
|
972
|
+
return this.activeQuest?.destroy(), this.activeQuest = await ve({
|
|
973
|
+
questId: i,
|
|
974
|
+
base: this.config.quests.base,
|
|
975
|
+
apiKey: this.config.quests.apiKey || void 0,
|
|
976
|
+
moduleUrl: this.config.quests.moduleUrl,
|
|
977
|
+
feedbackId: o,
|
|
978
|
+
onClose: () => {
|
|
979
|
+
this.activeQuest = null;
|
|
980
|
+
}
|
|
981
|
+
}), !0;
|
|
982
|
+
} catch (s) {
|
|
983
|
+
return console.error("Failed to launch quest:", s), this.activeQuest = null, !1;
|
|
984
|
+
}
|
|
985
|
+
}
|
|
986
|
+
/**
|
|
987
|
+
* Reset the thumbs targeting/marker UI back to idle without opening or
|
|
988
|
+
* closing the message modal. Shared by closeModal() and the quest-launch
|
|
989
|
+
* path (which bypasses the modal entirely).
|
|
990
|
+
*/
|
|
991
|
+
resetFeedbackUi() {
|
|
992
|
+
this.targeting?.hideMarker(), this.overlayShadowHost && (this.overlayShadowHost.style.pointerEvents = "none"), this.state = "IDLE", this.feedbackIdPromise = Promise.resolve(null), this.feedbackData.feedbackType = null, this.feedbackData.elementSelector = null, this.feedbackData.elementText = null, this.selectedBounds.visible = !1;
|
|
993
|
+
}
|
|
994
|
+
/**
|
|
995
|
+
* Lazily load and instantiate the modal controller. The message modal lives
|
|
996
|
+
* in a separate chunk, fetched the first time it opens (and pre-warmed while
|
|
997
|
+
* the user targets an element — see prewarmModal).
|
|
998
|
+
*/
|
|
999
|
+
async ensureModal() {
|
|
1000
|
+
if (!this.modal) {
|
|
1001
|
+
const { ModalController: t, styles: o } = await import("./modal-DccueVYZ.js");
|
|
1002
|
+
this.addFeatureStyles(o), this.modal = new t(this.makeModalHost());
|
|
1003
|
+
}
|
|
1004
|
+
return this.modal;
|
|
1005
|
+
}
|
|
1006
|
+
/** Narrow view of the embed the modal controller talks back through. */
|
|
1007
|
+
makeModalHost() {
|
|
1008
|
+
const t = this;
|
|
1009
|
+
return {
|
|
1010
|
+
get config() {
|
|
1011
|
+
return t.config;
|
|
1012
|
+
},
|
|
1013
|
+
get uid() {
|
|
1014
|
+
return t.uid;
|
|
1015
|
+
},
|
|
1016
|
+
get isMobile() {
|
|
1017
|
+
return t.isMobile;
|
|
1018
|
+
},
|
|
1019
|
+
get state() {
|
|
1020
|
+
return t.state;
|
|
1021
|
+
},
|
|
1022
|
+
get boundKeyDown() {
|
|
1023
|
+
return t.boundKeyDown;
|
|
1024
|
+
},
|
|
1025
|
+
get feedbackData() {
|
|
1026
|
+
return t.feedbackData;
|
|
1027
|
+
},
|
|
1028
|
+
get selectedBounds() {
|
|
1029
|
+
return t.selectedBounds;
|
|
1030
|
+
},
|
|
1031
|
+
whenFeedbackId: () => t.feedbackIdPromise,
|
|
1032
|
+
ensureOverlayHost: () => t.ensureOverlayHost(),
|
|
1033
|
+
applyVars: (o) => t.applyVars(o),
|
|
1034
|
+
announceMsg: (o, i) => t.announceMsg(o, i),
|
|
1035
|
+
openDialogA11y: (o, i) => t.openDialogA11y(o, i),
|
|
1036
|
+
closeDialogA11y: () => t.closeDialogA11y(),
|
|
1037
|
+
resetFeedbackUi: () => t.resetFeedbackUi()
|
|
1038
|
+
};
|
|
1039
|
+
}
|
|
1040
|
+
/** Warm the modal chunk while the user is targeting, so it opens instantly. */
|
|
1041
|
+
prewarmModal() {
|
|
1042
|
+
this.modalPrewarmed || (this.modalPrewarmed = !0, import("./modal-DccueVYZ.js").catch(() => {
|
|
1043
|
+
}));
|
|
1044
|
+
}
|
|
1045
|
+
/**
|
|
1046
|
+
* Lazily load and instantiate the targeting controller. The subsystem (with
|
|
1047
|
+
* element-selector) lives in a separate chunk, fetched the first time the
|
|
1048
|
+
* user targets — pre-warmed on thumb-button hover (see prewarmTargeting).
|
|
1049
|
+
*/
|
|
1050
|
+
async ensureTargeting() {
|
|
1051
|
+
if (!this.targeting) {
|
|
1052
|
+
const { TargetingController: t, styles: o } = await import("./targeting-mahtuPpo.js");
|
|
1053
|
+
this.addFeatureStyles(o), this.targeting = new t(this.makeTargetingHost());
|
|
1054
|
+
}
|
|
1055
|
+
return this.targeting;
|
|
1056
|
+
}
|
|
1057
|
+
/** Narrow view of the embed the targeting controller talks back through. */
|
|
1058
|
+
makeTargetingHost() {
|
|
1059
|
+
const t = this;
|
|
1060
|
+
return {
|
|
1061
|
+
get config() {
|
|
1062
|
+
return t.config;
|
|
1063
|
+
},
|
|
1064
|
+
get cssVars() {
|
|
1065
|
+
return t.cssVars;
|
|
1066
|
+
},
|
|
1067
|
+
get state() {
|
|
1068
|
+
return t.state;
|
|
1069
|
+
},
|
|
1070
|
+
get shadowHost() {
|
|
1071
|
+
return t.shadowHost;
|
|
1072
|
+
},
|
|
1073
|
+
get overlayShadowHost() {
|
|
1074
|
+
return t.overlayShadowHost;
|
|
1075
|
+
},
|
|
1076
|
+
get boundKeyDown() {
|
|
1077
|
+
return t.boundKeyDown;
|
|
1078
|
+
},
|
|
1079
|
+
get feedbackData() {
|
|
1080
|
+
return t.feedbackData;
|
|
1081
|
+
},
|
|
1082
|
+
get selectedBounds() {
|
|
1083
|
+
return t.selectedBounds;
|
|
1084
|
+
},
|
|
1085
|
+
setState: (o) => {
|
|
1086
|
+
t.state = o;
|
|
1087
|
+
},
|
|
1088
|
+
ensureOverlayHost: () => t.ensureOverlayHost(),
|
|
1089
|
+
applyVars: (o) => t.applyVars(o),
|
|
1090
|
+
announceMsg: (o, i) => t.announceMsg(o, i),
|
|
1091
|
+
clearActiveThumb: () => t.clearActiveThumb(),
|
|
1092
|
+
submitFeedback: () => t.submitFeedback()
|
|
1093
|
+
};
|
|
1094
|
+
}
|
|
1095
|
+
/** Warm the targeting chunk on thumb-button hover, before the click. */
|
|
1096
|
+
prewarmTargeting() {
|
|
1097
|
+
this.targetingPrewarmed || this.config.skipTargeting || (this.targetingPrewarmed = !0, import("./targeting-mahtuPpo.js").catch(() => {
|
|
1098
|
+
}));
|
|
1099
|
+
}
|
|
1100
|
+
// ==================== Video Recording ====================
|
|
1101
|
+
/**
|
|
1102
|
+
* Cheap synchronous capability check so the record button can render without
|
|
1103
|
+
* pulling in the (lazily-loaded) video subsystem. Mirrors
|
|
1104
|
+
* isVideoRecordingSupported() in video-capture.ts.
|
|
1105
|
+
*/
|
|
1106
|
+
videoSupported() {
|
|
1107
|
+
return typeof navigator < "u" && !!navigator.mediaDevices && typeof navigator.mediaDevices.getDisplayMedia == "function" && typeof MediaRecorder < "u";
|
|
1108
|
+
}
|
|
1109
|
+
/**
|
|
1110
|
+
* Lazily load and instantiate the recording controller. The whole recording
|
|
1111
|
+
* subsystem lives in a separate chunk, fetched only the first time the record
|
|
1112
|
+
* button is used (and pre-warmed on hover — see prewarmVideo).
|
|
1113
|
+
*/
|
|
1114
|
+
async ensureRecording() {
|
|
1115
|
+
if (!this.recording) {
|
|
1116
|
+
const { RecordingController: t, styles: o } = await import("./recording-CPzxRL7f.js");
|
|
1117
|
+
this.addFeatureStyles(o), this.recording = new t(this.makeRecordingHost());
|
|
1118
|
+
}
|
|
1119
|
+
return this.recording;
|
|
1120
|
+
}
|
|
1121
|
+
/** Narrow view of the embed the recording controller talks back through. */
|
|
1122
|
+
makeRecordingHost() {
|
|
1123
|
+
const t = this;
|
|
1124
|
+
return {
|
|
1125
|
+
get config() {
|
|
1126
|
+
return t.config;
|
|
1127
|
+
},
|
|
1128
|
+
get visitorId() {
|
|
1129
|
+
return t.visitorId;
|
|
1130
|
+
},
|
|
1131
|
+
get uid() {
|
|
1132
|
+
return t.uid;
|
|
1133
|
+
},
|
|
1134
|
+
get overlayShadowHost() {
|
|
1135
|
+
return t.overlayShadowHost;
|
|
1136
|
+
},
|
|
1137
|
+
get consoleCapture() {
|
|
1138
|
+
return t.consoleCapture;
|
|
1139
|
+
},
|
|
1140
|
+
get boundKeyDown() {
|
|
1141
|
+
return t.boundKeyDown;
|
|
1142
|
+
},
|
|
1143
|
+
get state() {
|
|
1144
|
+
return t.state;
|
|
1145
|
+
},
|
|
1146
|
+
setState: (o) => {
|
|
1147
|
+
t.state = o;
|
|
1148
|
+
},
|
|
1149
|
+
ensureOverlayHost: () => t.ensureOverlayHost(),
|
|
1150
|
+
applyVars: (o) => t.applyVars(o),
|
|
1151
|
+
announceMsg: (o, i) => t.announceMsg(o, i),
|
|
1152
|
+
openDialogA11y: (o, i) => t.openDialogA11y(o, i),
|
|
1153
|
+
closeDialogA11y: () => t.closeDialogA11y(),
|
|
1154
|
+
setButtonsDisabled: (o) => t.setButtonsDisabled(o),
|
|
1155
|
+
tryLaunchQuest: (o, i) => t.tryLaunchQuest(o, i)
|
|
1156
|
+
};
|
|
1157
|
+
}
|
|
1158
|
+
setButtonsDisabled(t) {
|
|
1159
|
+
if (!this.buttonsContainer) return;
|
|
1160
|
+
this.buttonsContainer.querySelectorAll("button.qaid-btn, button.qaid-btn-structural").forEach((i) => {
|
|
1161
|
+
t ? i.classList.contains("qaid-btn-record") || (i.disabled = !0, i.style.opacity = "0.5") : (i.disabled = !1, i.style.opacity = "");
|
|
1162
|
+
});
|
|
1163
|
+
}
|
|
1164
|
+
/**
|
|
1165
|
+
* Destroy the embed and clean up all resources
|
|
1166
|
+
*/
|
|
1167
|
+
destroy() {
|
|
1168
|
+
if (this.destroyed = !0, this.domObserver && (this.domObserver.disconnect(), this.domObserver = null), this.boundBeforeSwap && (document.removeEventListener("astro:before-swap", this.boundBeforeSwap), this.boundBeforeSwap = null), this.targeting?.destroy(), this.targeting = null, this.clearActiveThumb(), this.closeDialogA11y(), this.prewarmHandle !== null) {
|
|
1169
|
+
const t = window;
|
|
1170
|
+
this.prewarmIsTimeout ? clearTimeout(this.prewarmHandle) : t.cancelIdleCallback?.(this.prewarmHandle), this.prewarmHandle = null;
|
|
1171
|
+
}
|
|
1172
|
+
this.recording?.destroy(), this.recording = null, this.modal?.destroy(), this.modal = null, this.activeQuest?.destroy(), this.activeQuest = null, this.consoleCapture && (this.consoleCapture.restore(), this.consoleCapture = null), window.removeEventListener("resize", this.boundResize), document.removeEventListener("keydown", this.boundKeyDown), document.body.classList.remove("qaid-targeting", "qaid-type-up"), document.body.style.removeProperty("--qaid-positive"), document.body.style.removeProperty("--qaid-negative"), this.shadowHost && (this.shadowHost.remove(), this.shadowHost = null, this.shadowRoot = null), this.overlayShadowHost && (this.overlayShadowHost.remove(), this.overlayShadowHost = null, this.overlayShadowRoot = null), this.buttonsContainer = null, this.dismissBtn = null, this.tooltipElement = null, Qt();
|
|
1173
|
+
}
|
|
1174
|
+
}
|
|
1175
|
+
function rt(e) {
|
|
1176
|
+
return document.querySelector(e)?.textContent?.trim() ?? "";
|
|
1177
|
+
}
|
|
1178
|
+
function Ce() {
|
|
1179
|
+
const e = document.querySelector(
|
|
1180
|
+
'script[type="application/json"][data-feedback-config]'
|
|
1181
|
+
);
|
|
1182
|
+
if (!e) return null;
|
|
1183
|
+
const t = e.textContent?.trim();
|
|
1184
|
+
if (!t) return null;
|
|
1185
|
+
try {
|
|
1186
|
+
const o = JSON.parse(t);
|
|
1187
|
+
return o.cssSelector && !o.css && (o.css = rt(o.cssSelector), delete o.cssSelector), o;
|
|
1188
|
+
} catch {
|
|
1189
|
+
return null;
|
|
1190
|
+
}
|
|
1191
|
+
}
|
|
1192
|
+
function dt(e, t, o) {
|
|
1193
|
+
console.warn(`[thumbs-embed] Ignoring ${e}="${t}": expected ${o}.`);
|
|
1194
|
+
}
|
|
1195
|
+
function Se(e) {
|
|
1196
|
+
const t = [];
|
|
1197
|
+
let o = 0, i = "";
|
|
1198
|
+
for (const s of e)
|
|
1199
|
+
s === "(" && o++, s === ")" && (o = Math.max(0, o - 1)), s === "," && o === 0 ? (t.push(i.trim()), i = "") : i += s;
|
|
1200
|
+
return t.push(i.trim()), t;
|
|
1201
|
+
}
|
|
1202
|
+
function Ae(e, t) {
|
|
1203
|
+
if (t === null) return;
|
|
1204
|
+
const o = t.trim();
|
|
1205
|
+
let i = null;
|
|
1206
|
+
if (o.startsWith("[") || o.startsWith("{"))
|
|
1207
|
+
try {
|
|
1208
|
+
i = JSON.parse(o);
|
|
1209
|
+
} catch {
|
|
1210
|
+
i = null;
|
|
1211
|
+
}
|
|
1212
|
+
else
|
|
1213
|
+
i = Se(o);
|
|
1214
|
+
if (Array.isArray(i) && i.length > 0 && i.every((s) => typeof s == "string" && s.trim() !== ""))
|
|
1215
|
+
return i.map((s) => s.trim());
|
|
1216
|
+
dt(e, t, "a JSON array of colours or a comma-separated list");
|
|
1217
|
+
}
|
|
1218
|
+
function m(e, t) {
|
|
1219
|
+
if (t !== null) {
|
|
1220
|
+
if (t.trim() === "") {
|
|
1221
|
+
dt(e, t, "a non-empty label");
|
|
1222
|
+
return;
|
|
1223
|
+
}
|
|
1224
|
+
return t;
|
|
1225
|
+
}
|
|
1226
|
+
}
|
|
1227
|
+
function Te(e) {
|
|
1228
|
+
const t = e.getAttribute("data-endpoint");
|
|
1229
|
+
if (!t) return null;
|
|
1230
|
+
const o = e.getAttribute("data-position"), i = e.getAttribute("data-zindex"), s = e.getAttribute("data-positive-color"), n = e.getAttribute("data-negative-color"), a = e.getAttribute("data-marker-color"), l = e.getAttribute("data-container"), c = e.getAttribute("data-button-class"), d = e.getAttribute("data-skip-targeting"), r = e.getAttribute("data-hide-confirmation"), u = e.getAttribute("data-single-button"), h = e.getAttribute("data-feedback-mode"), f = e.getAttribute("data-incognito"), lt = e.getAttribute("data-button-size"), g = e.getAttribute("data-offset-x"), v = e.getAttribute("data-offset-y"), T = e.getAttribute("data-modal-width"), E = e.getAttribute("data-backdrop-opacity"), ct = e.getAttribute("data-font-family"), I = e.getAttribute("data-font-size"), D = e.getAttribute("data-tooltip"), M = e.getAttribute("data-modal-title"), L = e.getAttribute("data-confirmation-title"), H = e.getAttribute("data-confirmation-message"), B = e.getAttribute("data-confirmation-close"), O = e.getAttribute("data-error-title"), R = e.getAttribute("data-error-message"), P = e.getAttribute("data-modal-subtitle"), z = e.getAttribute("data-placeholder"), F = e.getAttribute("data-submit-button"), N = e.getAttribute("data-skip-button"), ut = e.getAttribute("data-positive-icon"), ht = e.getAttribute("data-negative-icon"), ft = e.getAttribute("data-feedback-icon"), U = e.getAttribute("data-feedback-label"), pt = e.getAttribute("data-api-key"), bt = e.getAttribute("data-capture-screenshot"), mt = e.getAttribute("data-annotate"), gt = e.getAttribute("data-annotation-color"), y = e.getAttribute("data-screenshot-quality"), w = e.getAttribute("data-screenshot-max-width"), k = e.getAttribute("data-screenshot-max-height"), vt = e.getAttribute("data-capture-video"), _ = e.getAttribute("data-video-redaction"), yt = e.getAttribute("data-hide-thumbs"), wt = e.getAttribute("data-hide-dismiss"), q = e.getAttribute("data-video-max-duration"), kt = e.getAttribute("data-screenshot-method"), qt = e.getAttribute("data-direction"), V = e.getAttribute("data-css-selector"), xt = e.getAttribute("data-css"), $ = m("data-positive-label", e.getAttribute("data-positive-label")), K = m("data-negative-label", e.getAttribute("data-negative-label")), Q = m("data-record-label", e.getAttribute("data-record-label")), j = m("data-dismiss-label", e.getAttribute("data-dismiss-label")), Ct = Ae(
|
|
1231
|
+
"data-annotation-palette",
|
|
1232
|
+
e.getAttribute("data-annotation-palette")
|
|
1233
|
+
), St = e.getAttribute("data-record-icon"), W = e.getAttribute("data-quest-base"), At = e.getAttribute("data-quest-up"), Tt = e.getAttribute("data-quest-down"), Et = e.getAttribute("data-quest-video"), It = e.getAttribute("data-quest-api-key"), Dt = e.getAttribute("data-quest-module-url");
|
|
1234
|
+
return {
|
|
1235
|
+
endpoint: t,
|
|
1236
|
+
// Inline CSS wins over a selector, as `css` wins over `cssSelector` in
|
|
1237
|
+
// the JSON block.
|
|
1238
|
+
css: xt || (V ? rt(V) : void 0),
|
|
1239
|
+
apiKey: pt ?? void 0,
|
|
1240
|
+
captureScreenshot: bt === "true" ? !0 : void 0,
|
|
1241
|
+
// Annotation is on by default; only an explicit "false" disables it.
|
|
1242
|
+
annotate: mt === "false" ? !1 : void 0,
|
|
1243
|
+
annotationColor: gt ?? void 0,
|
|
1244
|
+
annotationPalette: Ct,
|
|
1245
|
+
screenshotOptions: y || w || k ? {
|
|
1246
|
+
quality: y ? parseFloat(y) : void 0,
|
|
1247
|
+
maxWidth: w ? parseInt(w, 10) : void 0,
|
|
1248
|
+
maxHeight: k ? parseInt(k, 10) : void 0
|
|
1249
|
+
} : void 0,
|
|
1250
|
+
container: l ?? void 0,
|
|
1251
|
+
buttonClass: c ?? void 0,
|
|
1252
|
+
direction: qt ?? void 0,
|
|
1253
|
+
position: o ?? void 0,
|
|
1254
|
+
zIndex: i ? parseInt(i, 10) : void 0,
|
|
1255
|
+
skipTargeting: d === "true" ? !0 : void 0,
|
|
1256
|
+
hideConfirmation: r === "true" ? !0 : void 0,
|
|
1257
|
+
singleButton: u === "true" ? !0 : void 0,
|
|
1258
|
+
feedbackMode: h ?? void 0,
|
|
1259
|
+
incognito: f === "true" ? !0 : void 0,
|
|
1260
|
+
buttonSize: lt ?? void 0,
|
|
1261
|
+
offset: g || v ? {
|
|
1262
|
+
x: g ? parseInt(g, 10) : void 0,
|
|
1263
|
+
y: v ? parseInt(v, 10) : void 0
|
|
1264
|
+
} : void 0,
|
|
1265
|
+
modalWidth: T ? parseInt(T, 10) : void 0,
|
|
1266
|
+
backdropOpacity: E ? parseFloat(E) : void 0,
|
|
1267
|
+
fontFamily: ct ?? void 0,
|
|
1268
|
+
fontSize: I ? parseInt(I, 10) : void 0,
|
|
1269
|
+
colors: {
|
|
1270
|
+
positive: s ?? void 0,
|
|
1271
|
+
negative: n ?? void 0,
|
|
1272
|
+
marker: a ?? void 0
|
|
1273
|
+
},
|
|
1274
|
+
text: D || M || P || z || F || N || U || L || H || B || O || R || $ || K || Q || j ? {
|
|
1275
|
+
tooltip: D ?? void 0,
|
|
1276
|
+
modalTitle: M ?? void 0,
|
|
1277
|
+
modalSubtitle: P ?? void 0,
|
|
1278
|
+
placeholder: z ?? void 0,
|
|
1279
|
+
submitButton: F ?? void 0,
|
|
1280
|
+
skipButton: N ?? void 0,
|
|
1281
|
+
feedbackLabel: U ?? void 0,
|
|
1282
|
+
confirmationTitle: L ?? void 0,
|
|
1283
|
+
confirmationMessage: H ?? void 0,
|
|
1284
|
+
confirmationClose: B ?? void 0,
|
|
1285
|
+
errorTitle: O ?? void 0,
|
|
1286
|
+
errorMessage: R ?? void 0,
|
|
1287
|
+
positiveLabel: $,
|
|
1288
|
+
negativeLabel: K,
|
|
1289
|
+
recordLabel: Q,
|
|
1290
|
+
dismissLabel: j
|
|
1291
|
+
} : void 0,
|
|
1292
|
+
positiveIcon: ut ?? void 0,
|
|
1293
|
+
recordIcon: St ?? void 0,
|
|
1294
|
+
negativeIcon: ht ?? void 0,
|
|
1295
|
+
feedbackIcon: ft ?? void 0,
|
|
1296
|
+
screenshotMethod: kt ?? void 0,
|
|
1297
|
+
captureVideo: vt === "true" ? !0 : void 0,
|
|
1298
|
+
hideThumbs: yt === "true" ? !0 : void 0,
|
|
1299
|
+
hideDismiss: wt === "true" ? !0 : void 0,
|
|
1300
|
+
videoOptions: q || _ ? {
|
|
1301
|
+
maxDuration: q ? parseInt(q, 10) : void 0,
|
|
1302
|
+
redaction: _ === "true" ? !0 : void 0
|
|
1303
|
+
} : void 0,
|
|
1304
|
+
quests: W ? {
|
|
1305
|
+
base: W,
|
|
1306
|
+
up: At ?? void 0,
|
|
1307
|
+
down: Tt ?? void 0,
|
|
1308
|
+
video: Et ?? void 0,
|
|
1309
|
+
apiKey: It ?? void 0,
|
|
1310
|
+
moduleUrl: Dt ?? void 0
|
|
1311
|
+
} : void 0
|
|
1312
|
+
};
|
|
1313
|
+
}
|
|
1314
|
+
function Ue() {
|
|
1315
|
+
if (typeof document > "u") return;
|
|
1316
|
+
const e = () => {
|
|
1317
|
+
const t = document.currentScript ?? document.querySelector("script[data-endpoint]"), o = Ce() ?? (t ? Te(t) : null);
|
|
1318
|
+
o?.endpoint && new xe(o);
|
|
1319
|
+
};
|
|
1320
|
+
document.readyState === "loading" ? document.addEventListener("DOMContentLoaded", e) : e();
|
|
1321
|
+
}
|
|
1322
|
+
export {
|
|
1323
|
+
Ie as A,
|
|
1324
|
+
Me as B,
|
|
1325
|
+
He as D,
|
|
1326
|
+
Be as E,
|
|
1327
|
+
Bt as F,
|
|
1328
|
+
De as P,
|
|
1329
|
+
xe as Q,
|
|
1330
|
+
Ee as R,
|
|
1331
|
+
Oe as S,
|
|
1332
|
+
Mt as T,
|
|
1333
|
+
Le as U,
|
|
1334
|
+
Ue as a,
|
|
1335
|
+
Re as b,
|
|
1336
|
+
Pe as c,
|
|
1337
|
+
Lt as d,
|
|
1338
|
+
ze as e,
|
|
1339
|
+
Ne as g,
|
|
1340
|
+
Fe as i
|
|
1341
|
+
};
|
|
1342
|
+
//# sourceMappingURL=core-CL1dwdaN.js.map
|