@brainfish-ai/widgets-initiator 1.7.3 → 1.7.4
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/types/initIframeTrigger/index.d.ts +2 -0
- package/dist/types/initIframeTrigger/types.d.ts +5 -0
- package/dist/web.cjs.js +7 -7
- package/dist/web.cjs.js.map +1 -1
- package/dist/web.js +135 -135
- package/dist/web.js.map +1 -1
- package/package.json +1 -1
package/dist/web.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
var
|
|
1
|
+
var Te = Object.defineProperty, We = Object.defineProperties;
|
|
2
2
|
var Le = Object.getOwnPropertyDescriptors;
|
|
3
|
-
var
|
|
4
|
-
var Fe = Object.prototype.hasOwnProperty,
|
|
5
|
-
var L = (a, t, n) => t in a ?
|
|
3
|
+
var he = Object.getOwnPropertySymbols;
|
|
4
|
+
var Fe = Object.prototype.hasOwnProperty, $e = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var L = (a, t, n) => t in a ? Te(a, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : a[t] = n, F = (a, t) => {
|
|
6
6
|
for (var n in t || (t = {}))
|
|
7
7
|
Fe.call(t, n) && L(a, n, t[n]);
|
|
8
|
-
if (
|
|
9
|
-
for (var n of
|
|
10
|
-
|
|
8
|
+
if (he)
|
|
9
|
+
for (var n of he(t))
|
|
10
|
+
$e.call(t, n) && L(a, n, t[n]);
|
|
11
11
|
return a;
|
|
12
|
-
},
|
|
12
|
+
}, $ = (a, t) => We(a, Le(t));
|
|
13
13
|
var _ = (a, t, n) => L(a, typeof t != "symbol" ? t + "" : t, n);
|
|
14
14
|
var b = (a, t, n) => new Promise((s, i) => {
|
|
15
15
|
var r = (l) => {
|
|
@@ -27,21 +27,21 @@ var b = (a, t, n) => new Promise((s, i) => {
|
|
|
27
27
|
}, d = (l) => l.done ? s(l.value) : Promise.resolve(l.value).then(r, e);
|
|
28
28
|
d((n = n.apply(a, t)).next());
|
|
29
29
|
});
|
|
30
|
-
var
|
|
30
|
+
var B, R;
|
|
31
31
|
(function() {
|
|
32
32
|
try {
|
|
33
33
|
var a = typeof window != "undefined" ? window : typeof global != "undefined" ? global : typeof self != "undefined" ? self : {}, t = new a.Error().stack;
|
|
34
|
-
t && (a._sentryDebugIds = a._sentryDebugIds || {}, a._sentryDebugIds[t] = "
|
|
34
|
+
t && (a._sentryDebugIds = a._sentryDebugIds || {}, a._sentryDebugIds[t] = "de6234f7-c3b5-4101-84b9-7575b725e615", a._sentryDebugIdIdentifier = "sentry-dbid-de6234f7-c3b5-4101-84b9-7575b725e615");
|
|
35
35
|
} catch (n) {
|
|
36
36
|
}
|
|
37
|
-
})(), (typeof window != "undefined" ? window : typeof global != "undefined" ? global : typeof self != "undefined" ? self : {}).SENTRY_RELEASE = { id: "
|
|
37
|
+
})(), (typeof window != "undefined" ? window : typeof global != "undefined" ? global : typeof self != "undefined" ? self : {}).SENTRY_RELEASE = { id: "79568b60a6dcead8ae3203baa697b7db5d6b3dbb" }, function(a) {
|
|
38
38
|
a.Sidebar = "sidebar", a.Searchbar = "searchbar";
|
|
39
|
-
}(
|
|
40
|
-
class
|
|
39
|
+
}(B || (B = {})), B.Sidebar, B.Searchbar;
|
|
40
|
+
class de extends Error {
|
|
41
41
|
constructor(n, s) {
|
|
42
42
|
super(n, s);
|
|
43
43
|
_(this, "cause");
|
|
44
|
-
this.name = "BrainfishWidgetError", this.cause = s == null ? void 0 : s.cause, Error.captureStackTrace && Error.captureStackTrace(this,
|
|
44
|
+
this.name = "BrainfishWidgetError", this.cause = s == null ? void 0 : s.cause, Error.captureStackTrace && Error.captureStackTrace(this, de), this.cause instanceof Error && this.cause.stack && (this.stack = this.stack + `
|
|
45
45
|
Caused by: ` + this.cause.stack);
|
|
46
46
|
}
|
|
47
47
|
toJSON() {
|
|
@@ -50,8 +50,8 @@ Caused by: ` + this.cause.stack);
|
|
|
50
50
|
}
|
|
51
51
|
(function(a) {
|
|
52
52
|
a.LINK = "link", a.CALLBACK = "callback", a.EMAIL = "email", a.PHONE = "phone";
|
|
53
|
-
})(
|
|
54
|
-
const
|
|
53
|
+
})(R || (R = {}));
|
|
54
|
+
const S = (a, t, n, s) => {
|
|
55
55
|
let i = n, r = {};
|
|
56
56
|
if (t instanceof Error) try {
|
|
57
57
|
r = JSON.parse(t.message), i += ` - ${r.message || t.message}`;
|
|
@@ -62,9 +62,9 @@ const k = (a, t, n, s) => {
|
|
|
62
62
|
((e, d, l) => {
|
|
63
63
|
if (!navigator || navigator.userAgent.toLowerCase().includes("headless")) return;
|
|
64
64
|
const o = d.toJSON();
|
|
65
|
-
fetch(`${e || "https://app.brainfi.sh"}/api/trackError.widget.create`, { method: "POST", headers: { "Content-Type": "application/json", "api-key": l }, body: JSON.stringify({ error: `WebWidgetVersion: 1.7.
|
|
66
|
-
})(a, new
|
|
67
|
-
},
|
|
65
|
+
fetch(`${e || "https://app.brainfi.sh"}/api/trackError.widget.create`, { method: "POST", headers: { "Content-Type": "application/json", "api-key": l }, body: JSON.stringify({ error: `WebWidgetVersion: 1.7.4. ${d.message}`, stack: d.stack, cause: { message: o.message, stack: o.stack, cause: o.cause } }) });
|
|
66
|
+
})(a, new de(i, { cause: r }), s);
|
|
67
|
+
}, He = (a) => b(void 0, null, function* () {
|
|
68
68
|
let { widgetKey: t, apiHost: n } = a;
|
|
69
69
|
return function(s, i, r) {
|
|
70
70
|
return b(this, null, function* () {
|
|
@@ -76,7 +76,7 @@ const k = (a, t, n, s) => {
|
|
|
76
76
|
if (!o) throw new Error("Error loading config: empty response");
|
|
77
77
|
return o;
|
|
78
78
|
} catch (l) {
|
|
79
|
-
if (e = l, d++, d >= 3) throw
|
|
79
|
+
if (e = l, d++, d >= 3) throw S(s, l, "Error fetching config", r), e;
|
|
80
80
|
yield new Promise((o) => setTimeout(o, 500));
|
|
81
81
|
}
|
|
82
82
|
});
|
|
@@ -85,9 +85,9 @@ const k = (a, t, n, s) => {
|
|
|
85
85
|
let { config: t, apiKey: n, apiHost: s } = a;
|
|
86
86
|
const i = t.settings || {};
|
|
87
87
|
return ["bodyActionButtons", "footerActionButtons", "nextBestActions"].forEach((r) => {
|
|
88
|
-
i[r] && (i[r] = i[r].map((e) => e.type ===
|
|
89
|
-
}),
|
|
90
|
-
},
|
|
88
|
+
i[r] && (i[r] = i[r].map((e) => e.type === R.CALLBACK && e.value ? $(F({}, e), { value: new Function(`return ${e.value}`)() }) : e));
|
|
89
|
+
}), $(F({}, t), { settings: i, apiHost: s, widgetMode: t.widgetType, apiKey: n });
|
|
90
|
+
}, le = (a) => (a == null ? void 0 : a.apiHost) || "https://app.brainfi.sh", H = (() => {
|
|
91
91
|
if (typeof window == "undefined") return;
|
|
92
92
|
const a = window.navigator.userAgent;
|
|
93
93
|
if (!(a.match(/iPad/i) || a.match(/iPhone/i))) return !1;
|
|
@@ -96,11 +96,11 @@ const k = (a, t, n, s) => {
|
|
|
96
96
|
})(), ze = (a) => b(void 0, null, function* () {
|
|
97
97
|
let { apiHost: t, widgetKey: n, version: s } = a;
|
|
98
98
|
try {
|
|
99
|
-
const i = `https://cdn.jsdelivr.net/npm/@brainfish-ai/search-widget@${s}/dist/web.js`, r =
|
|
99
|
+
const i = `https://cdn.jsdelivr.net/npm/@brainfish-ai/search-widget@${s}/dist/web.js`, r = H ? i.replace("web.js", "web.umd.js") : i;
|
|
100
100
|
return { widget: yield ((d) => b(void 0, null, function* () {
|
|
101
101
|
return document.getElementById("brainfish-widget") ? window.Brainfish : new Promise((l, o) => {
|
|
102
102
|
const f = document.createElement("script");
|
|
103
|
-
f.id = "brainfish-widget", f.src = d, f.type =
|
|
103
|
+
f.id = "brainfish-widget", f.src = d, f.type = H ? "text/javascript" : "module", f.async = !0, f.crossOrigin = "anonymous", f.onload = () => {
|
|
104
104
|
setTimeout(() => {
|
|
105
105
|
const c = window.Brainfish;
|
|
106
106
|
c ? l(c) : o(new Error("Failed to load Brainfish module"));
|
|
@@ -108,16 +108,16 @@ const k = (a, t, n, s) => {
|
|
|
108
108
|
}, f.onerror = (c) => {
|
|
109
109
|
const u = c, g = { message: `Failed to load script: ${d}`, type: u.type, fileName: u.filename, lineNumber: u.lineno, columnNumber: u.colno, error: u.error ? u.error.toString() : "Unknown error" };
|
|
110
110
|
o(new Error(JSON.stringify(g)));
|
|
111
|
-
},
|
|
111
|
+
}, H || document.head.appendChild(f);
|
|
112
112
|
});
|
|
113
113
|
}))(r) };
|
|
114
114
|
} catch (i) {
|
|
115
|
-
|
|
115
|
+
S(t, i, i.message, n);
|
|
116
116
|
}
|
|
117
|
-
}),
|
|
118
|
-
const n =
|
|
117
|
+
}), me = /* @__PURE__ */ new Set(), Re = (a, t) => b(void 0, null, function* () {
|
|
118
|
+
const n = le(a.overrides);
|
|
119
119
|
try {
|
|
120
|
-
if (
|
|
120
|
+
if (me.has(a.widgetKey)) return;
|
|
121
121
|
const s = yield ze({ apiHost: n, widgetKey: a.widgetKey, version: t.version || "latest" });
|
|
122
122
|
if (s) {
|
|
123
123
|
const { widget: i } = s, r = Ke({ config: t, apiKey: a.widgetKey, apiHost: n });
|
|
@@ -129,32 +129,32 @@ const k = (a, t, n, s) => {
|
|
|
129
129
|
return o.forEach((c) => f.set(c.label, c)), Array.from(f.values());
|
|
130
130
|
}(t.settings[d], l));
|
|
131
131
|
}), function(e, d) {
|
|
132
|
-
d.widgetType ===
|
|
133
|
-
}(i, r),
|
|
132
|
+
d.widgetType === B.Searchbar || d.widgetType === "Search" ? e.SearchWidget.initStandard(d) : e.HelpWidget.initPopup(d);
|
|
133
|
+
}(i, r), me.add(a.widgetKey), i;
|
|
134
134
|
}
|
|
135
135
|
} catch (s) {
|
|
136
|
-
|
|
136
|
+
S(n, s, s.message, a.widgetKey);
|
|
137
137
|
}
|
|
138
138
|
});
|
|
139
|
-
let
|
|
140
|
-
const
|
|
139
|
+
let be = !1;
|
|
140
|
+
const qe = function(s, i, r) {
|
|
141
141
|
return b(this, arguments, function* (a, t, n) {
|
|
142
142
|
let e = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : "", d = arguments.length > 4 && arguments[4] !== void 0 && arguments[4], l = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : [];
|
|
143
|
-
if (t ||
|
|
143
|
+
if (t || S(n, new Error("Access key is required"), "Access key is required", a), !be) try {
|
|
144
144
|
const o = (() => {
|
|
145
145
|
if (typeof window == "undefined" || typeof navigator == "undefined") return !1;
|
|
146
146
|
const f = navigator, c = window, u = (f.doNotTrack || c.doNotTrack || f.msDoNotTrack || "0").toString().toLowerCase();
|
|
147
147
|
return ["1", "yes", "true"].includes(u);
|
|
148
148
|
})();
|
|
149
|
-
window.BrainfishAnalytics("init", { apiUrl: e, accessKey: t, trackScreenViews: !o, trackAttributes: !o, trackOutgoingLinks: !o, enableRecording: !o && d, recordingBlocklist: l }),
|
|
149
|
+
window.BrainfishAnalytics("init", { apiUrl: e, accessKey: t, trackScreenViews: !o, trackAttributes: !o, trackOutgoingLinks: !o, enableRecording: !o && d, recordingBlocklist: l }), be = !0, yield ((f, c) => b(this, null, function* () {
|
|
150
150
|
if (document.getElementById("brainfish-analytics")) return window.BrainfishAnalytics;
|
|
151
151
|
const u = document.createElement("script");
|
|
152
152
|
u.id = "brainfish-analytics", u.src = "https://cdn.jsdelivr.net/npm/@brainfish-ai/web-tracker@latest/dist/tracker.js", u.type = "module", u.async = !0, u.crossOrigin = "anonymous", u.onerror = () => {
|
|
153
|
-
|
|
153
|
+
S(f, new Error(`Failed to load script: ${u.src}`), `Failed to load script: ${u.src}`, c);
|
|
154
154
|
}, document.head.appendChild(u);
|
|
155
155
|
}))(n, a);
|
|
156
156
|
} catch (o) {
|
|
157
|
-
|
|
157
|
+
S(n, o, "Failed to initialize BrainfishAnalytics", a);
|
|
158
158
|
}
|
|
159
159
|
});
|
|
160
160
|
};
|
|
@@ -166,7 +166,7 @@ function x(a, t) {
|
|
|
166
166
|
s.setAttribute(r, e);
|
|
167
167
|
}), s;
|
|
168
168
|
}
|
|
169
|
-
const
|
|
169
|
+
const T = "bf-iframe-container", W = "bf-trigger-button";
|
|
170
170
|
class v {
|
|
171
171
|
static get isWidgetOpen() {
|
|
172
172
|
return this.isOpen;
|
|
@@ -209,13 +209,13 @@ class v {
|
|
|
209
209
|
}
|
|
210
210
|
}
|
|
211
211
|
_(v, "isOpen", !1), _(v, "button", null), _(v, "icon", null), _(v, "isButtonHidden", !1);
|
|
212
|
-
function
|
|
212
|
+
function Ne(a) {
|
|
213
213
|
let { widgetHost: t, apiHost: n, widgetKey: s, signal: i } = a;
|
|
214
214
|
window.addEventListener("message", (r) => {
|
|
215
215
|
if (r.origin !== t) return;
|
|
216
216
|
const { type: e } = r.data;
|
|
217
217
|
if (e === "TOGGLE_WIDGET_SIZE" && function() {
|
|
218
|
-
const d = document.querySelector(`.${
|
|
218
|
+
const d = document.querySelector(`.${T}`);
|
|
219
219
|
d.classList.contains("expanded") ? d.classList.remove("expanded") : d.classList.add("expanded");
|
|
220
220
|
}(), e === "TRACK_EVENT") {
|
|
221
221
|
if (!window.BrainfishAnalytics) return;
|
|
@@ -235,10 +235,10 @@ function Re(a) {
|
|
|
235
235
|
}
|
|
236
236
|
}, { signal: i });
|
|
237
237
|
}
|
|
238
|
-
function
|
|
238
|
+
function ue(a) {
|
|
239
239
|
return a && a.__esModule && Object.prototype.hasOwnProperty.call(a, "default") ? a.default : a;
|
|
240
240
|
}
|
|
241
|
-
var q = { exports: {} }, N = { exports: {} },
|
|
241
|
+
var q = { exports: {} }, N = { exports: {} }, D = { exports: {} };
|
|
242
242
|
(function(a, t) {
|
|
243
243
|
function n(i) {
|
|
244
244
|
return Math.round(255 * i);
|
|
@@ -253,8 +253,8 @@ var q = { exports: {} }, N = { exports: {} }, R = { exports: {} };
|
|
|
253
253
|
var h = e - o / 2;
|
|
254
254
|
return d(c + h, u + h, g + h);
|
|
255
255
|
}, a.exports = t.default;
|
|
256
|
-
})(
|
|
257
|
-
var
|
|
256
|
+
})(D, D.exports);
|
|
257
|
+
var fe = D.exports, J = { exports: {} };
|
|
258
258
|
(function(a, t) {
|
|
259
259
|
t.__esModule = !0, t.default = void 0;
|
|
260
260
|
var n = { aliceblue: "f0f8ff", antiquewhite: "faebd7", aqua: "00ffff", aquamarine: "7fffd4", azure: "f0ffff", beige: "f5f5dc", bisque: "ffe4c4", black: "000", blanchedalmond: "ffebcd", blue: "0000ff", blueviolet: "8a2be2", brown: "a52a2a", burlywood: "deb887", cadetblue: "5f9ea0", chartreuse: "7fff00", chocolate: "d2691e", coral: "ff7f50", cornflowerblue: "6495ed", cornsilk: "fff8dc", crimson: "dc143c", cyan: "00ffff", darkblue: "00008b", darkcyan: "008b8b", darkgoldenrod: "b8860b", darkgray: "a9a9a9", darkgreen: "006400", darkgrey: "a9a9a9", darkkhaki: "bdb76b", darkmagenta: "8b008b", darkolivegreen: "556b2f", darkorange: "ff8c00", darkorchid: "9932cc", darkred: "8b0000", darksalmon: "e9967a", darkseagreen: "8fbc8f", darkslateblue: "483d8b", darkslategray: "2f4f4f", darkslategrey: "2f4f4f", darkturquoise: "00ced1", darkviolet: "9400d3", deeppink: "ff1493", deepskyblue: "00bfff", dimgray: "696969", dimgrey: "696969", dodgerblue: "1e90ff", firebrick: "b22222", floralwhite: "fffaf0", forestgreen: "228b22", fuchsia: "ff00ff", gainsboro: "dcdcdc", ghostwhite: "f8f8ff", gold: "ffd700", goldenrod: "daa520", gray: "808080", green: "008000", greenyellow: "adff2f", grey: "808080", honeydew: "f0fff0", hotpink: "ff69b4", indianred: "cd5c5c", indigo: "4b0082", ivory: "fffff0", khaki: "f0e68c", lavender: "e6e6fa", lavenderblush: "fff0f5", lawngreen: "7cfc00", lemonchiffon: "fffacd", lightblue: "add8e6", lightcoral: "f08080", lightcyan: "e0ffff", lightgoldenrodyellow: "fafad2", lightgray: "d3d3d3", lightgreen: "90ee90", lightgrey: "d3d3d3", lightpink: "ffb6c1", lightsalmon: "ffa07a", lightseagreen: "20b2aa", lightskyblue: "87cefa", lightslategray: "789", lightslategrey: "789", lightsteelblue: "b0c4de", lightyellow: "ffffe0", lime: "0f0", limegreen: "32cd32", linen: "faf0e6", magenta: "f0f", maroon: "800000", mediumaquamarine: "66cdaa", mediumblue: "0000cd", mediumorchid: "ba55d3", mediumpurple: "9370db", mediumseagreen: "3cb371", mediumslateblue: "7b68ee", mediumspringgreen: "00fa9a", mediumturquoise: "48d1cc", mediumvioletred: "c71585", midnightblue: "191970", mintcream: "f5fffa", mistyrose: "ffe4e1", moccasin: "ffe4b5", navajowhite: "ffdead", navy: "000080", oldlace: "fdf5e6", olive: "808000", olivedrab: "6b8e23", orange: "ffa500", orangered: "ff4500", orchid: "da70d6", palegoldenrod: "eee8aa", palegreen: "98fb98", paleturquoise: "afeeee", palevioletred: "db7093", papayawhip: "ffefd5", peachpuff: "ffdab9", peru: "cd853f", pink: "ffc0cb", plum: "dda0dd", powderblue: "b0e0e6", purple: "800080", rebeccapurple: "639", red: "f00", rosybrown: "bc8f8f", royalblue: "4169e1", saddlebrown: "8b4513", salmon: "fa8072", sandybrown: "f4a460", seagreen: "2e8b57", seashell: "fff5ee", sienna: "a0522d", silver: "c0c0c0", skyblue: "87ceeb", slateblue: "6a5acd", slategray: "708090", slategrey: "708090", snow: "fffafa", springgreen: "00ff7f", steelblue: "4682b4", tan: "d2b48c", teal: "008080", thistle: "d8bfd8", tomato: "ff6347", turquoise: "40e0d0", violet: "ee82ee", wheat: "f5deb3", white: "fff", whitesmoke: "f5f5f5", yellow: "ff0", yellowgreen: "9acd32" };
|
|
@@ -263,8 +263,8 @@ var ue = R.exports, D = { exports: {} };
|
|
|
263
263
|
var i = s.toLowerCase();
|
|
264
264
|
return n[i] ? "#" + n[i] : s;
|
|
265
265
|
}, a.exports = t.default;
|
|
266
|
-
})(
|
|
267
|
-
var De =
|
|
266
|
+
})(J, J.exports);
|
|
267
|
+
var De = J.exports, Y = { exports: {} };
|
|
268
268
|
(function(a, t) {
|
|
269
269
|
function n(l) {
|
|
270
270
|
var o = typeof Map == "function" ? /* @__PURE__ */ new Map() : void 0;
|
|
@@ -480,15 +480,15 @@ To pass a single animation please supply them in simple values, e.g. animation('
|
|
|
480
480
|
for (var h = arguments.length, p = new Array(h > 1 ? h - 1 : 0), m = 1; m < h; m++) p[m - 1] = arguments[m];
|
|
481
481
|
g = l.call(this, d.apply(void 0, [e[u]].concat(p))) || this;
|
|
482
482
|
}
|
|
483
|
-
return function(
|
|
484
|
-
if (
|
|
485
|
-
return
|
|
483
|
+
return function(k) {
|
|
484
|
+
if (k === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
485
|
+
return k;
|
|
486
486
|
}(g);
|
|
487
487
|
}
|
|
488
488
|
return f = l, (o = c).prototype = Object.create(f.prototype), o.prototype.constructor = o, i(o, f), c;
|
|
489
489
|
}(n(Error)), a.exports = t.default;
|
|
490
490
|
})(Y, Y.exports);
|
|
491
|
-
var
|
|
491
|
+
var C = Y.exports;
|
|
492
492
|
(function(a, t) {
|
|
493
493
|
t.__esModule = !0, t.default = function(h) {
|
|
494
494
|
if (typeof h != "string") throw new i.default(3);
|
|
@@ -500,8 +500,8 @@ var S = Y.exports;
|
|
|
500
500
|
}
|
|
501
501
|
if (p.match(l)) return { red: parseInt("" + p[1] + p[1], 16), green: parseInt("" + p[2] + p[2], 16), blue: parseInt("" + p[3] + p[3], 16) };
|
|
502
502
|
if (p.match(o)) {
|
|
503
|
-
var
|
|
504
|
-
return { red: parseInt("" + p[1] + p[1], 16), green: parseInt("" + p[2] + p[2], 16), blue: parseInt("" + p[3] + p[3], 16), alpha:
|
|
503
|
+
var k = parseFloat((parseInt("" + p[4] + p[4], 16) / 255).toFixed(2));
|
|
504
|
+
return { red: parseInt("" + p[1] + p[1], 16), green: parseInt("" + p[2] + p[2], 16), blue: parseInt("" + p[3] + p[3], 16), alpha: k };
|
|
505
505
|
}
|
|
506
506
|
var A = f.exec(p);
|
|
507
507
|
if (A) return { red: parseInt("" + A[1], 10), green: parseInt("" + A[2], 10), blue: parseInt("" + A[3], 10) };
|
|
@@ -509,26 +509,26 @@ var S = Y.exports;
|
|
|
509
509
|
if (y) return { red: parseInt("" + y[1], 10), green: parseInt("" + y[2], 10), blue: parseInt("" + y[3], 10), alpha: parseFloat("" + y[4]) > 1 ? parseFloat("" + y[4]) / 100 : parseFloat("" + y[4]) };
|
|
510
510
|
var I = u.exec(p);
|
|
511
511
|
if (I) {
|
|
512
|
-
var Ae = parseInt("" + I[1], 10), Ie = parseInt("" + I[2], 10) / 100, Oe = parseInt("" + I[3], 10) / 100,
|
|
513
|
-
if (!O) throw new i.default(4, p,
|
|
512
|
+
var Ae = parseInt("" + I[1], 10), Ie = parseInt("" + I[2], 10) / 100, Oe = parseInt("" + I[3], 10) / 100, pe = "rgb(" + (0, n.default)(Ae, Ie, Oe) + ")", O = f.exec(pe);
|
|
513
|
+
if (!O) throw new i.default(4, p, pe);
|
|
514
514
|
return { red: parseInt("" + O[1], 10), green: parseInt("" + O[2], 10), blue: parseInt("" + O[3], 10) };
|
|
515
515
|
}
|
|
516
516
|
var w = g.exec(p.substring(0, 50));
|
|
517
517
|
if (w) {
|
|
518
|
-
var Me = parseInt("" + w[1], 10), je = parseInt("" + w[2], 10) / 100,
|
|
519
|
-
if (!M) throw new i.default(4, p,
|
|
518
|
+
var Me = parseInt("" + w[1], 10), je = parseInt("" + w[2], 10) / 100, Pe = parseInt("" + w[3], 10) / 100, ge = "rgb(" + (0, n.default)(Me, je, Pe) + ")", M = f.exec(ge);
|
|
519
|
+
if (!M) throw new i.default(4, p, ge);
|
|
520
520
|
return { red: parseInt("" + M[1], 10), green: parseInt("" + M[2], 10), blue: parseInt("" + M[3], 10), alpha: parseFloat("" + w[4]) > 1 ? parseFloat("" + w[4]) / 100 : parseFloat("" + w[4]) };
|
|
521
521
|
}
|
|
522
522
|
throw new i.default(5);
|
|
523
523
|
};
|
|
524
|
-
var n = r(
|
|
524
|
+
var n = r(fe), s = r(De), i = r(C);
|
|
525
525
|
function r(h) {
|
|
526
526
|
return h && h.__esModule ? h : { default: h };
|
|
527
527
|
}
|
|
528
528
|
var e = /^#[a-fA-F0-9]{6}$/, d = /^#[a-fA-F0-9]{8}$/, l = /^#[a-fA-F0-9]{3}$/, o = /^#[a-fA-F0-9]{4}$/, f = /^rgb\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*\)$/i, c = /^rgb(?:a)?\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,|\/)\s*([-+]?\d*[.]?\d+[%]?)\s*\)$/i, u = /^hsl\(\s*(\d{0,3}[.]?[0-9]+(?:deg)?)\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*\)$/i, g = /^hsl(?:a)?\(\s*(\d{0,3}[.]?[0-9]+(?:deg)?)\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,|\/)\s*([-+]?\d*[.]?\d+[%]?)\s*\)$/i;
|
|
529
529
|
a.exports = t.default;
|
|
530
530
|
})(N, N.exports);
|
|
531
|
-
var
|
|
531
|
+
var ce = N.exports;
|
|
532
532
|
(function(a, t) {
|
|
533
533
|
t.__esModule = !0, t.default = function(i) {
|
|
534
534
|
if (i === "transparent") return 0;
|
|
@@ -538,11 +538,11 @@ var fe = N.exports;
|
|
|
538
538
|
}), d = e[0], l = e[1], o = e[2];
|
|
539
539
|
return parseFloat((0.2126 * d + 0.7152 * l + 0.0722 * o).toFixed(3));
|
|
540
540
|
};
|
|
541
|
-
var n, s = (n =
|
|
541
|
+
var n, s = (n = ce) && n.__esModule ? n : { default: n };
|
|
542
542
|
a.exports = t.default;
|
|
543
543
|
})(q, q.exports);
|
|
544
|
-
const
|
|
545
|
-
var
|
|
544
|
+
const Je = ue(q.exports);
|
|
545
|
+
var U = { exports: {} }, G = { exports: {} };
|
|
546
546
|
(function(a, t) {
|
|
547
547
|
function n(s, i, r) {
|
|
548
548
|
return function() {
|
|
@@ -553,12 +553,12 @@ var J = { exports: {} }, U = { exports: {} };
|
|
|
553
553
|
t.__esModule = !0, t.default = function(s) {
|
|
554
554
|
return n(s, s.length, []);
|
|
555
555
|
}, a.exports = t.default;
|
|
556
|
-
})(
|
|
557
|
-
var
|
|
558
|
-
|
|
556
|
+
})(G, G.exports);
|
|
557
|
+
var ve, j, we = G.exports, V = { exports: {} };
|
|
558
|
+
ve = V, (j = V.exports).__esModule = !0, j.default = void 0, j.default = function(a, t, n) {
|
|
559
559
|
return Math.max(a, Math.min(t, n));
|
|
560
|
-
},
|
|
561
|
-
var xe =
|
|
560
|
+
}, ve.exports = j.default;
|
|
561
|
+
var xe = V.exports, Z = { exports: {} }, Q = { exports: {} };
|
|
562
562
|
(function(a, t) {
|
|
563
563
|
t.__esModule = !0, t.default = void 0, t.default = function(n) {
|
|
564
564
|
var s, i = n.red / 255, r = n.green / 255, e = n.blue / 255, d = Math.max(i, r, e), l = Math.min(i, r, e), o = (d + l) / 2;
|
|
@@ -576,35 +576,35 @@ var xe = G.exports, V = { exports: {} }, Z = { exports: {} };
|
|
|
576
576
|
}
|
|
577
577
|
return s *= 60, n.alpha !== void 0 ? { hue: s, saturation: c, lightness: o, alpha: n.alpha } : { hue: s, saturation: c, lightness: o };
|
|
578
578
|
}, a.exports = t.default;
|
|
579
|
-
})(
|
|
580
|
-
var
|
|
579
|
+
})(Q, Q.exports);
|
|
580
|
+
var Ye = Q.exports;
|
|
581
581
|
(function(a, t) {
|
|
582
582
|
t.__esModule = !0, t.default = function(r) {
|
|
583
583
|
return (0, s.default)((0, n.default)(r));
|
|
584
584
|
};
|
|
585
|
-
var n = i(
|
|
585
|
+
var n = i(ce), s = i(Ye);
|
|
586
586
|
function i(r) {
|
|
587
587
|
return r && r.__esModule ? r : { default: r };
|
|
588
588
|
}
|
|
589
589
|
a.exports = t.default;
|
|
590
|
-
})(
|
|
591
|
-
var
|
|
590
|
+
})(Z, Z.exports);
|
|
591
|
+
var Se = Z.exports, X = { exports: {} }, ee = { exports: {} }, te = { exports: {} }, ne = { exports: {} };
|
|
592
592
|
(function(a, t) {
|
|
593
593
|
t.__esModule = !0, t.default = void 0, t.default = function(n) {
|
|
594
594
|
return n.length === 7 && n[1] === n[2] && n[3] === n[4] && n[5] === n[6] ? "#" + n[1] + n[3] + n[5] : n;
|
|
595
595
|
}, a.exports = t.default;
|
|
596
|
-
})(
|
|
597
|
-
var
|
|
596
|
+
})(ne, ne.exports);
|
|
597
|
+
var ke = ne.exports, re = { exports: {} };
|
|
598
598
|
(function(a, t) {
|
|
599
599
|
t.__esModule = !0, t.default = void 0, t.default = function(n) {
|
|
600
600
|
var s = n.toString(16);
|
|
601
601
|
return s.length === 1 ? "0" + s : s;
|
|
602
602
|
}, a.exports = t.default;
|
|
603
|
-
})(
|
|
604
|
-
var
|
|
603
|
+
})(re, re.exports);
|
|
604
|
+
var _e = re.exports;
|
|
605
605
|
(function(a, t) {
|
|
606
606
|
t.__esModule = !0, t.default = void 0;
|
|
607
|
-
var n = r(
|
|
607
|
+
var n = r(fe), s = r(ke), i = r(_e);
|
|
608
608
|
function r(l) {
|
|
609
609
|
return l && l.__esModule ? l : { default: l };
|
|
610
610
|
}
|
|
@@ -617,47 +617,47 @@ var Se = ne.exports;
|
|
|
617
617
|
t.default = function(l, o, f) {
|
|
618
618
|
return (0, n.default)(l, o, f, d);
|
|
619
619
|
}, a.exports = t.default;
|
|
620
|
-
})(
|
|
621
|
-
var Ce =
|
|
620
|
+
})(te, te.exports);
|
|
621
|
+
var Ce = te.exports;
|
|
622
622
|
(function(a, t) {
|
|
623
623
|
t.__esModule = !0, t.default = function(r, e, d) {
|
|
624
624
|
if (typeof r == "number" && typeof e == "number" && typeof d == "number") return (0, n.default)(r, e, d);
|
|
625
625
|
if (typeof r == "object" && e === void 0 && d === void 0) return (0, n.default)(r.hue, r.saturation, r.lightness);
|
|
626
626
|
throw new s.default(1);
|
|
627
627
|
};
|
|
628
|
-
var n = i(Ce), s = i(
|
|
628
|
+
var n = i(Ce), s = i(C);
|
|
629
629
|
function i(r) {
|
|
630
630
|
return r && r.__esModule ? r : { default: r };
|
|
631
631
|
}
|
|
632
632
|
a.exports = t.default;
|
|
633
|
-
})(
|
|
634
|
-
var Ue =
|
|
633
|
+
})(ee, ee.exports);
|
|
634
|
+
var Ue = ee.exports, ae = { exports: {} };
|
|
635
635
|
(function(a, t) {
|
|
636
636
|
t.__esModule = !0, t.default = function(e, d, l, o) {
|
|
637
637
|
if (typeof e == "number" && typeof d == "number" && typeof l == "number" && typeof o == "number") return o >= 1 ? (0, n.default)(e, d, l) : "rgba(" + (0, s.default)(e, d, l) + "," + o + ")";
|
|
638
638
|
if (typeof e == "object" && d === void 0 && l === void 0 && o === void 0) return e.alpha >= 1 ? (0, n.default)(e.hue, e.saturation, e.lightness) : "rgba(" + (0, s.default)(e.hue, e.saturation, e.lightness) + "," + e.alpha + ")";
|
|
639
639
|
throw new i.default(2);
|
|
640
640
|
};
|
|
641
|
-
var n = r(Ce), s = r(
|
|
641
|
+
var n = r(Ce), s = r(fe), i = r(C);
|
|
642
642
|
function r(e) {
|
|
643
643
|
return e && e.__esModule ? e : { default: e };
|
|
644
644
|
}
|
|
645
645
|
a.exports = t.default;
|
|
646
|
-
})(
|
|
647
|
-
var Ge =
|
|
646
|
+
})(ae, ae.exports);
|
|
647
|
+
var Ge = ae.exports, ie = { exports: {} };
|
|
648
648
|
(function(a, t) {
|
|
649
649
|
t.__esModule = !0, t.default = function(e, d, l) {
|
|
650
650
|
if (typeof e == "number" && typeof d == "number" && typeof l == "number") return (0, n.default)("#" + (0, s.default)(e) + (0, s.default)(d) + (0, s.default)(l));
|
|
651
651
|
if (typeof e == "object" && d === void 0 && l === void 0) return (0, n.default)("#" + (0, s.default)(e.red) + (0, s.default)(e.green) + (0, s.default)(e.blue));
|
|
652
652
|
throw new i.default(6);
|
|
653
653
|
};
|
|
654
|
-
var n = r(
|
|
654
|
+
var n = r(ke), s = r(_e), i = r(C);
|
|
655
655
|
function r(e) {
|
|
656
656
|
return e && e.__esModule ? e : { default: e };
|
|
657
657
|
}
|
|
658
658
|
a.exports = t.default;
|
|
659
|
-
})(
|
|
660
|
-
var Ee =
|
|
659
|
+
})(ie, ie.exports);
|
|
660
|
+
var Ee = ie.exports, oe = { exports: {} };
|
|
661
661
|
(function(a, t) {
|
|
662
662
|
t.__esModule = !0, t.default = function(e, d, l, o) {
|
|
663
663
|
if (typeof e == "string" && typeof d == "number") {
|
|
@@ -668,13 +668,13 @@ var Ee = ae.exports, ie = { exports: {} };
|
|
|
668
668
|
if (typeof e == "object" && d === void 0 && l === void 0 && o === void 0) return e.alpha >= 1 ? (0, s.default)(e.red, e.green, e.blue) : "rgba(" + e.red + "," + e.green + "," + e.blue + "," + e.alpha + ")";
|
|
669
669
|
throw new i.default(7);
|
|
670
670
|
};
|
|
671
|
-
var n = r(
|
|
671
|
+
var n = r(ce), s = r(Ee), i = r(C);
|
|
672
672
|
function r(e) {
|
|
673
673
|
return e && e.__esModule ? e : { default: e };
|
|
674
674
|
}
|
|
675
675
|
a.exports = t.default;
|
|
676
|
-
})(
|
|
677
|
-
var Ve =
|
|
676
|
+
})(oe, oe.exports);
|
|
677
|
+
var Ve = oe.exports;
|
|
678
678
|
(function(a, t) {
|
|
679
679
|
t.__esModule = !0, t.default = function(u) {
|
|
680
680
|
if (typeof u != "object") throw new e.default(8);
|
|
@@ -684,7 +684,7 @@ var Ve = ie.exports;
|
|
|
684
684
|
if (f(u)) return (0, n.default)(u);
|
|
685
685
|
throw new e.default(8);
|
|
686
686
|
};
|
|
687
|
-
var n = d(Ue), s = d(Ge), i = d(Ee), r = d(Ve), e = d(
|
|
687
|
+
var n = d(Ue), s = d(Ge), i = d(Ee), r = d(Ve), e = d(C);
|
|
688
688
|
function d(u) {
|
|
689
689
|
return u && u.__esModule ? u : { default: u };
|
|
690
690
|
}
|
|
@@ -698,11 +698,11 @@ var Ve = ie.exports;
|
|
|
698
698
|
return typeof u.hue == "number" && typeof u.saturation == "number" && typeof u.lightness == "number" && typeof u.alpha == "number";
|
|
699
699
|
};
|
|
700
700
|
a.exports = t.default;
|
|
701
|
-
})(
|
|
702
|
-
var Be =
|
|
701
|
+
})(X, X.exports);
|
|
702
|
+
var Be = X.exports;
|
|
703
703
|
(function(a, t) {
|
|
704
704
|
t.__esModule = !0, t.default = void 0;
|
|
705
|
-
var n = e(we), s = e(xe), i = e(
|
|
705
|
+
var n = e(we), s = e(xe), i = e(Se), r = e(Be);
|
|
706
706
|
function e(o) {
|
|
707
707
|
return o && o.__esModule ? o : { default: o };
|
|
708
708
|
}
|
|
@@ -721,12 +721,12 @@ var Be = Q.exports;
|
|
|
721
721
|
return (0, r.default)(d({}, c, { lightness: (0, s.default)(0, 1, c.lightness - parseFloat(o)) }));
|
|
722
722
|
});
|
|
723
723
|
t.default = l, a.exports = t.default;
|
|
724
|
-
})(
|
|
725
|
-
const Ze =
|
|
726
|
-
var
|
|
724
|
+
})(U, U.exports);
|
|
725
|
+
const Ze = ue(U.exports);
|
|
726
|
+
var se = { exports: {} };
|
|
727
727
|
(function(a, t) {
|
|
728
728
|
t.__esModule = !0, t.default = void 0;
|
|
729
|
-
var n = e(we), s = e(xe), i = e(
|
|
729
|
+
var n = e(we), s = e(xe), i = e(Se), r = e(Be);
|
|
730
730
|
function e(o) {
|
|
731
731
|
return o && o.__esModule ? o : { default: o };
|
|
732
732
|
}
|
|
@@ -745,8 +745,8 @@ var oe = { exports: {} };
|
|
|
745
745
|
return (0, r.default)(d({}, c, { lightness: (0, s.default)(0, 1, c.lightness + parseFloat(o)) }));
|
|
746
746
|
});
|
|
747
747
|
t.default = l, a.exports = t.default;
|
|
748
|
-
})(
|
|
749
|
-
const Qe =
|
|
748
|
+
})(se, se.exports);
|
|
749
|
+
const Qe = ue(se.exports);
|
|
750
750
|
function Xe(a) {
|
|
751
751
|
if (!document.querySelector("style[data-widget-styles]")) {
|
|
752
752
|
var t, n;
|
|
@@ -754,7 +754,7 @@ function Xe(a) {
|
|
|
754
754
|
let s = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "#000", i = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "FFF";
|
|
755
755
|
const r = document.createElement("style");
|
|
756
756
|
r.attributes.setNamedItem(document.createAttribute("data-widget-styles"));
|
|
757
|
-
const e =
|
|
757
|
+
const e = Je(s) > 0.5;
|
|
758
758
|
r.textContent = `
|
|
759
759
|
.bf-trigger-button{position:fixed;bottom:16px;right:16px;width:36px;height:36px;border-radius:50%;border:none;box-shadow:0 1px 6px #0000000f,0 2px 32px #00000029;transition:transform 167ms cubic-bezier(.33,0,0,1);box-sizing:content-box;display:flex;align-items:center;justify-content:center;cursor:pointer;z-index:1000;padding:12px;gap:10px;overflow:hidden}.bf-trigger-button.hidden{display:none}.trigger-button-icon{display:flex;align-items:center;justify-content:center;width:36px;height:36px;position:relative}.trigger-button-icon svg{width:100%;height:100%;position:absolute;inset:0}.trigger-button-icon>svg>path{transition:transform .3s ease,opacity .3s ease;transform:scale(.5);transform-origin:center;opacity:0}.trigger-button-icon .fish-icon{display:none}.trigger-button-icon .fish-icon.visible{display:block}.trigger-button-icon svg.visible{display:block}.trigger-button-icon>svg.visible>path{opacity:1;transform:scale(1)}.trigger-iframe{position:relative;width:100%;height:100%;border:none;outline:none;transform:translateZ(0)}.bf-iframe-container{display:none;position:fixed;z-index:2147483000000;background-color:#fff;bottom:0;right:0;width:100vw;height:100vh;border:none;overflow:hidden;opacity:0;pointer-events:none;transform:translateY(20px);transition:opacity .3s ease,transform .3s ease,width .2s ease-in-out,height .2s ease-in-out}.bf-iframe-container.open{display:block;opacity:1;transform:translateY(0);pointer-events:auto;top:0;left:0}@media (min-width: 576px){.bf-iframe-container{bottom:80px;right:24px;width:448px;height:min(750px,calc(100vh - 80px));border-radius:8px;border:1px solid var(--Dark-300, #D4D4D4);box-shadow:0 20px 25px -5px #1212171a,0 10px 10px -5px #1212170a}.bf-iframe-container.open{top:unset;left:unset}.bf-iframe-container.expanded{width:min(calc(448px * 1.35),calc(100vw - 16px));height:min(calc(750px * 1.35),calc(100vh - 80px))}}.iframe-loading-indicator{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);display:flex;align-items:center;justify-content:center;z-index:10}.spinner{width:24px;height:24px;border:2px solid rgba(0,0,0,.1);border-radius:50%;border-top-color:#3498db;animation:spin 1s ease-in-out infinite}@keyframes spin{to{transform:rotate(360deg)}}.loading-error{width:24px;height:24px;position:relative;display:flex;align-items:center;justify-content:center}.loading-error:before,.loading-error:after{content:"";position:absolute;width:16px;height:2px;background-color:#e74c3c;border-radius:2px}.loading-error:before{transform:rotate(45deg)}.loading-error:after{transform:rotate(-45deg)}
|
|
760
760
|
.${W} { background: ${s}; }
|
|
@@ -794,7 +794,7 @@ function tt(a, t) {
|
|
|
794
794
|
r.observe(document.body), t.addEventListener("abort", () => r.disconnect());
|
|
795
795
|
})();
|
|
796
796
|
}
|
|
797
|
-
function
|
|
797
|
+
function K(a) {
|
|
798
798
|
const t = new TextEncoder().encode(a);
|
|
799
799
|
if (typeof window != "undefined" && typeof window.btoa == "function") {
|
|
800
800
|
const n = Array.from(t, (s) => String.fromCharCode(s)).join("");
|
|
@@ -810,7 +810,7 @@ function nt(a, t, n) {
|
|
|
810
810
|
if (s) v.initialize({ isButtonHidden: s });
|
|
811
811
|
else {
|
|
812
812
|
const { button: l, icon: o } = function(f, c) {
|
|
813
|
-
const u = x("button", W, { id: `trigger-button-${f}`, "aria-controls":
|
|
813
|
+
const u = x("button", W, { id: `trigger-button-${f}`, "aria-controls": T, "aria-expanded": "false", "data-name": W }), g = x("div", "trigger-button-icon", { "aria-hidden": "true" });
|
|
814
814
|
return g.innerHTML = c ? `
|
|
815
815
|
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="currentColor" viewBox="0 0 256 256" class="close-icon">
|
|
816
816
|
<path d="M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z"></path>
|
|
@@ -828,7 +828,7 @@ function nt(a, t, n) {
|
|
|
828
828
|
r.appendChild(l), v.initialize({ button: l, icon: o });
|
|
829
829
|
}
|
|
830
830
|
const { iframeContainer: e, iframe: d } = function(l) {
|
|
831
|
-
const o = x("div",
|
|
831
|
+
const o = x("div", T, { id: T, "aria-live": "polite", "aria-hidden": "true" }), f = x("div", "iframe-loading-indicator"), c = x("div", "spinner");
|
|
832
832
|
f.setAttribute("aria-label", "Loading content"), f.setAttribute("role", "status"), f.appendChild(c), o.appendChild(f);
|
|
833
833
|
const u = x("iframe", "trigger-iframe", { src: l, sandbox: "allow-scripts allow-same-origin allow-popups allow-forms", allow: "clipboard-write", role: "dialog" });
|
|
834
834
|
return u.style.opacity = "0", u.addEventListener("load", () => {
|
|
@@ -842,33 +842,33 @@ function nt(a, t, n) {
|
|
|
842
842
|
return r.appendChild(e), { fragment: r, iframe: d };
|
|
843
843
|
}
|
|
844
844
|
const rt = (a, t) => {
|
|
845
|
-
const n =
|
|
845
|
+
const n = le(a.overrides), s = ((i = a.overrides) == null ? void 0 : i.widgetHost) || "https://agent.brainfi.sh";
|
|
846
846
|
var i;
|
|
847
|
-
const { theme: r, settings: e } = t, d = `${s}/?widgetKey=${a.widgetKey}&themeParam=${
|
|
847
|
+
const { theme: r, settings: e } = t, d = K(JSON.stringify(a.redirectRules)), l = `${s}/?widgetKey=${a.widgetKey}&themeParam=${K(JSON.stringify(r))}&settingsParam=${K(JSON.stringify(e))}${a.redirectRules ? `&redirectRulesParam=${d}` : ""}`, o = e == null ? void 0 : e.hideTriggerButton, f = e == null ? void 0 : e.triggerButtonIcon;
|
|
848
848
|
try {
|
|
849
|
-
if (
|
|
850
|
-
return !!document.getElementById(`trigger-button-${
|
|
849
|
+
if (c = a.widgetKey, ye.has(c) || function(k) {
|
|
850
|
+
return !!document.getElementById(`trigger-button-${k}`);
|
|
851
851
|
}(a.widgetKey)) return;
|
|
852
852
|
Xe(t);
|
|
853
|
-
const { fragment:
|
|
854
|
-
|
|
853
|
+
const { fragment: u, iframe: g } = nt(a.widgetKey, l, { isButtonHidden: o || !1, triggerButtonIcon: f || "" }), h = new AbortController(), { signal: p } = h;
|
|
854
|
+
g.onload = () => {
|
|
855
855
|
setTimeout(() => {
|
|
856
|
-
et(
|
|
856
|
+
et(g, p), Ne({ widgetHost: s, apiHost: n, widgetKey: a.widgetKey, signal: p }), tt(g, p);
|
|
857
857
|
}, 0);
|
|
858
|
-
}, document.body.appendChild(
|
|
859
|
-
const
|
|
860
|
-
|
|
858
|
+
}, document.body.appendChild(u), ye.add(a.widgetKey);
|
|
859
|
+
const m = () => {
|
|
860
|
+
h.abort(), window.removeEventListener("beforeunload", m);
|
|
861
861
|
};
|
|
862
|
-
return void window.addEventListener("beforeunload",
|
|
863
|
-
} catch (
|
|
864
|
-
(function(
|
|
865
|
-
|
|
866
|
-
})(n,
|
|
862
|
+
return void window.addEventListener("beforeunload", m);
|
|
863
|
+
} catch (u) {
|
|
864
|
+
(function(g, h, p) {
|
|
865
|
+
S(g, h, h.message, p);
|
|
866
|
+
})(n, u, a.widgetKey);
|
|
867
867
|
}
|
|
868
|
-
var
|
|
868
|
+
var c;
|
|
869
869
|
};
|
|
870
|
-
let
|
|
871
|
-
const
|
|
870
|
+
let P = null;
|
|
871
|
+
const E = typeof window != "undefined" && window.Brainfish ? window.Brainfish : (P || (P = /* @__PURE__ */ function() {
|
|
872
872
|
let a = [], t = null;
|
|
873
873
|
function n(i, r) {
|
|
874
874
|
if (t) {
|
|
@@ -906,16 +906,16 @@ const C = typeof window != "undefined" && window.Brainfish ? window.Brainfish :
|
|
|
906
906
|
n(r, e);
|
|
907
907
|
}
|
|
908
908
|
} };
|
|
909
|
-
}(), typeof window != "undefined" && (window.Brainfish =
|
|
910
|
-
let
|
|
911
|
-
|
|
909
|
+
}(), typeof window != "undefined" && (window.Brainfish = P)), P);
|
|
910
|
+
let z = null;
|
|
911
|
+
E.Widgets.isReady = !1, E.Widgets.identify = (a) => {
|
|
912
912
|
window.BrainfishAnalytics("identify", a);
|
|
913
|
-
},
|
|
913
|
+
}, E.Widgets.init = (a) => b(void 0, null, function* () {
|
|
914
914
|
window && (window.BrainfishAnalytics = window.BrainfishAnalytics || function() {
|
|
915
915
|
for (var r = arguments.length, e = new Array(r), d = 0; d < r; d++) e[d] = arguments[d];
|
|
916
916
|
(window.BrainfishAnalytics.q = window.BrainfishAnalytics.q || []).push(e);
|
|
917
917
|
});
|
|
918
|
-
const t =
|
|
918
|
+
const t = le(a.overrides), n = ((s = a.overrides) == null ? void 0 : s.analyticsApiHost) || "";
|
|
919
919
|
var s;
|
|
920
920
|
let i;
|
|
921
921
|
if (a.config) i = JSON.parse(((r) => {
|
|
@@ -928,24 +928,24 @@ C.Widgets.isReady = !1, C.Widgets.identify = (a) => {
|
|
|
928
928
|
throw new Error("[utils.base64Decode]: Unsupported environment");
|
|
929
929
|
})(a.config));
|
|
930
930
|
else {
|
|
931
|
-
const { config: r } = yield
|
|
931
|
+
const { config: r } = yield He({ widgetKey: a.widgetKey, apiHost: t });
|
|
932
932
|
i = r;
|
|
933
933
|
}
|
|
934
|
-
|
|
934
|
+
z || (z = function(r, e, d, l) {
|
|
935
935
|
return b(this, null, function* () {
|
|
936
936
|
var o, f, c, u;
|
|
937
937
|
const g = ((o = r.overrides) === null || o === void 0 ? void 0 : o.enableRecording) || (e == null || (f = e.settings) === null || f === void 0 ? void 0 : f.enableRecording) || !1, h = ((c = r.overrides) === null || c === void 0 ? void 0 : c.version) || (e == null ? void 0 : e.version), p = [];
|
|
938
|
-
h != null && h.startsWith("2.") ? rt(r, e) : p.push(
|
|
938
|
+
h != null && h.startsWith("2.") ? rt(r, e) : p.push(Re(r, e)), p.push(qe(r.widgetKey, e.trackingToken || "", d, l, g, (e == null || (u = e.settings) === null || u === void 0 ? void 0 : u.recordingBlocklist) || []));
|
|
939
939
|
const [m] = yield Promise.allSettled(p);
|
|
940
|
-
m && m.status === "fulfilled" && m.value &&
|
|
940
|
+
m && m.status === "fulfilled" && m.value && E._setRealBrainfish(m.value);
|
|
941
941
|
});
|
|
942
|
-
}(a, i, t, n)), yield
|
|
942
|
+
}(a, i, t, n)), yield z, E.Widgets.isReady = !0, window.dispatchEvent(new Event("onBrainfishReady"));
|
|
943
943
|
});
|
|
944
944
|
const it = function() {
|
|
945
945
|
typeof window != "undefined" && window.BrainfishAnalytics && window.BrainfishAnalytics(...arguments);
|
|
946
946
|
};
|
|
947
947
|
export {
|
|
948
948
|
it as BrainfishAnalytics,
|
|
949
|
-
|
|
949
|
+
E as default
|
|
950
950
|
};
|
|
951
951
|
//# sourceMappingURL=web.js.map
|