@brainfish-ai/widgets-initiator 1.7.0-alpha.5 → 1.7.0-alpha.6
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/web.cjs.js +6 -6
- package/dist/web.cjs.js.map +1 -1
- package/dist/web.js +332 -336
- package/dist/web.js.map +1 -1
- package/package.json +1 -1
package/dist/web.js
CHANGED
|
@@ -2,46 +2,46 @@ var Fe = Object.defineProperty, Le = Object.defineProperties;
|
|
|
2
2
|
var $e = Object.getOwnPropertyDescriptors;
|
|
3
3
|
var ge = Object.getOwnPropertySymbols;
|
|
4
4
|
var We = Object.prototype.hasOwnProperty, Ke = Object.prototype.propertyIsEnumerable;
|
|
5
|
-
var F = (a, t,
|
|
6
|
-
for (var
|
|
7
|
-
We.call(t,
|
|
5
|
+
var F = (a, t, r) => t in a ? Fe(a, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : a[t] = r, L = (a, t) => {
|
|
6
|
+
for (var r in t || (t = {}))
|
|
7
|
+
We.call(t, r) && F(a, r, t[r]);
|
|
8
8
|
if (ge)
|
|
9
|
-
for (var
|
|
10
|
-
Ke.call(t,
|
|
9
|
+
for (var r of ge(t))
|
|
10
|
+
Ke.call(t, r) && F(a, r, t[r]);
|
|
11
11
|
return a;
|
|
12
12
|
}, $ = (a, t) => Le(a, $e(t));
|
|
13
|
-
var k = (a, t,
|
|
14
|
-
var m = (a, t,
|
|
15
|
-
var
|
|
13
|
+
var k = (a, t, r) => F(a, typeof t != "symbol" ? t + "" : t, r);
|
|
14
|
+
var m = (a, t, r) => new Promise((d, o) => {
|
|
15
|
+
var n = (s) => {
|
|
16
16
|
try {
|
|
17
|
-
|
|
17
|
+
i(r.next(s));
|
|
18
18
|
} catch (l) {
|
|
19
19
|
o(l);
|
|
20
20
|
}
|
|
21
|
-
}, e = (
|
|
21
|
+
}, e = (s) => {
|
|
22
22
|
try {
|
|
23
|
-
|
|
23
|
+
i(r.throw(s));
|
|
24
24
|
} catch (l) {
|
|
25
25
|
o(l);
|
|
26
26
|
}
|
|
27
|
-
},
|
|
28
|
-
|
|
27
|
+
}, i = (s) => s.done ? d(s.value) : Promise.resolve(s.value).then(n, e);
|
|
28
|
+
i((r = r.apply(a, t)).next());
|
|
29
29
|
});
|
|
30
30
|
var S, H;
|
|
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] = "
|
|
35
|
-
} catch (
|
|
34
|
+
t && (a._sentryDebugIds = a._sentryDebugIds || {}, a._sentryDebugIds[t] = "ef3d6dd3-1c8b-462d-bfc6-c7cd629e6c2a", a._sentryDebugIdIdentifier = "sentry-dbid-ef3d6dd3-1c8b-462d-bfc6-c7cd629e6c2a");
|
|
35
|
+
} catch (r) {
|
|
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: "9a381691e353ad27b69792e87217d32d705b3020" }, function(a) {
|
|
38
38
|
a.Sidebar = "sidebar", a.Searchbar = "searchbar";
|
|
39
39
|
}(S || (S = {})), S.Sidebar, S.Searchbar;
|
|
40
40
|
class se extends Error {
|
|
41
|
-
constructor(
|
|
42
|
-
super(
|
|
41
|
+
constructor(r, d) {
|
|
42
|
+
super(r, d);
|
|
43
43
|
k(this, "cause");
|
|
44
|
-
this.name = "BrainfishWidgetError", this.cause =
|
|
44
|
+
this.name = "BrainfishWidgetError", this.cause = d == null ? void 0 : d.cause, Error.captureStackTrace && Error.captureStackTrace(this, se), this.cause instanceof Error && this.cause.stack && (this.stack = this.stack + `
|
|
45
45
|
Caused by: ` + this.cause.stack);
|
|
46
46
|
}
|
|
47
47
|
toJSON() {
|
|
@@ -51,42 +51,42 @@ Caused by: ` + this.cause.stack);
|
|
|
51
51
|
(function(a) {
|
|
52
52
|
a.LINK = "link", a.CALLBACK = "callback", a.EMAIL = "email", a.PHONE = "phone";
|
|
53
53
|
})(H || (H = {}));
|
|
54
|
-
const x = (a, t,
|
|
55
|
-
let o =
|
|
54
|
+
const x = (a, t, r, d) => {
|
|
55
|
+
let o = r, n = {};
|
|
56
56
|
if (t instanceof Error) try {
|
|
57
|
-
|
|
57
|
+
n = JSON.parse(t.message), o += ` - ${n.message || t.message}`;
|
|
58
58
|
} catch (e) {
|
|
59
59
|
o += ` - ${t.message}`;
|
|
60
60
|
}
|
|
61
61
|
else o += ` - ${String(t)}`;
|
|
62
|
-
((e,
|
|
62
|
+
((e, i, s) => {
|
|
63
63
|
if (!navigator || navigator.userAgent.toLowerCase().includes("headless")) return;
|
|
64
|
-
const l =
|
|
65
|
-
fetch(`${e || "https://app.brainfi.sh"}/api/trackError.widget.create`, { method: "POST", headers: { "Content-Type": "application/json", "api-key":
|
|
66
|
-
})(a, new se(o, { cause:
|
|
64
|
+
const l = i.toJSON();
|
|
65
|
+
fetch(`${e || "https://app.brainfi.sh"}/api/trackError.widget.create`, { method: "POST", headers: { "Content-Type": "application/json", "api-key": s }, body: JSON.stringify({ error: `WebWidgetVersion: 1.7.0-alpha.6. ${i.message}`, stack: i.stack, cause: { message: l.message, stack: l.stack, cause: l.cause } }) });
|
|
66
|
+
})(a, new se(o, { cause: n }), d);
|
|
67
67
|
}, De = (a) => m(void 0, null, function* () {
|
|
68
|
-
let { widgetKey: t, apiHost:
|
|
69
|
-
return function(
|
|
68
|
+
let { widgetKey: t, apiHost: r } = a;
|
|
69
|
+
return function(d, o, n) {
|
|
70
70
|
return m(this, null, function* () {
|
|
71
|
-
let e,
|
|
72
|
-
for (;
|
|
73
|
-
const
|
|
74
|
-
if (!
|
|
75
|
-
const l = yield
|
|
71
|
+
let e, i = 0;
|
|
72
|
+
for (; i < 3; ) try {
|
|
73
|
+
const s = yield fetch(`${d}${o}`, { method: "POST", headers: { "Content-Type": "application/json", "api-key": n } });
|
|
74
|
+
if (!s.ok) throw new Error(`API call failed with status: ${s.status}`);
|
|
75
|
+
const l = yield s.json();
|
|
76
76
|
if (!l) throw new Error("Error loading config: empty response");
|
|
77
77
|
return l;
|
|
78
|
-
} catch (
|
|
79
|
-
if (e =
|
|
78
|
+
} catch (s) {
|
|
79
|
+
if (e = s, i++, i >= 3) throw x(d, s, "Error fetching config", n), e;
|
|
80
80
|
yield new Promise((l) => setTimeout(l, 500));
|
|
81
81
|
}
|
|
82
82
|
});
|
|
83
|
-
}(
|
|
83
|
+
}(r, "/api/searchWidgets.getConfigByKey", t);
|
|
84
84
|
}), He = (a) => {
|
|
85
|
-
let { config: t, apiKey:
|
|
85
|
+
let { config: t, apiKey: r, apiHost: d } = a;
|
|
86
86
|
const o = t.settings || {};
|
|
87
|
-
return ["bodyActionButtons", "footerActionButtons", "nextBestActions"].forEach((
|
|
88
|
-
o[
|
|
89
|
-
}), $(L({}, t), { settings: o, apiHost:
|
|
87
|
+
return ["bodyActionButtons", "footerActionButtons", "nextBestActions"].forEach((n) => {
|
|
88
|
+
o[n] && (o[n] = o[n].map((e) => e.type === H.CALLBACK && e.value ? $(L({}, e), { value: new Function(`return ${e.value}`)() }) : e));
|
|
89
|
+
}), $(L({}, t), { settings: o, apiHost: d, widgetMode: t.widgetType, apiKey: r });
|
|
90
90
|
}, de = (a) => (a == null ? void 0 : a.apiHost) || "https://app.brainfi.sh", W = (() => {
|
|
91
91
|
if (typeof window == "undefined") return;
|
|
92
92
|
const a = window.navigator.userAgent;
|
|
@@ -94,59 +94,59 @@ const x = (a, t, n, i) => {
|
|
|
94
94
|
const t = a.match(/OS (\d+)_/i);
|
|
95
95
|
return t && parseInt(t[1], 10) <= 14;
|
|
96
96
|
})(), Ne = (a) => m(void 0, null, function* () {
|
|
97
|
-
let { apiHost: t, widgetKey:
|
|
97
|
+
let { apiHost: t, widgetKey: r, version: d } = a;
|
|
98
98
|
try {
|
|
99
|
-
const o = `https://cdn.jsdelivr.net/npm/@brainfish-ai/search-widget@${
|
|
100
|
-
return { widget: yield ((
|
|
101
|
-
return document.getElementById("brainfish-widget") ? window.Brainfish : new Promise((
|
|
99
|
+
const o = `https://cdn.jsdelivr.net/npm/@brainfish-ai/search-widget@${d}/dist/web.js`, n = W ? o.replace("web.js", "web.umd.js") : o;
|
|
100
|
+
return { widget: yield ((i) => m(void 0, null, function* () {
|
|
101
|
+
return document.getElementById("brainfish-widget") ? window.Brainfish : new Promise((s, l) => {
|
|
102
102
|
const u = document.createElement("script");
|
|
103
|
-
u.id = "brainfish-widget", u.src =
|
|
103
|
+
u.id = "brainfish-widget", u.src = i, u.type = W ? "text/javascript" : "module", u.async = !0, u.crossOrigin = "anonymous", u.onload = () => {
|
|
104
104
|
setTimeout(() => {
|
|
105
105
|
const c = window.Brainfish;
|
|
106
|
-
c ?
|
|
106
|
+
c ? s(c) : l(new Error("Failed to load Brainfish module"));
|
|
107
107
|
}, 200);
|
|
108
108
|
}, u.onerror = (c) => {
|
|
109
|
-
const f = c, g = { message: `Failed to load script: ${
|
|
109
|
+
const f = c, g = { message: `Failed to load script: ${i}`, type: f.type, fileName: f.filename, lineNumber: f.lineno, columnNumber: f.colno, error: f.error ? f.error.toString() : "Unknown error" };
|
|
110
110
|
l(new Error(JSON.stringify(g)));
|
|
111
111
|
}, W || document.head.appendChild(u);
|
|
112
112
|
});
|
|
113
|
-
}))(
|
|
113
|
+
}))(n) };
|
|
114
114
|
} catch (o) {
|
|
115
|
-
x(t, o, o.message,
|
|
115
|
+
x(t, o, o.message, r);
|
|
116
116
|
}
|
|
117
117
|
}), he = /* @__PURE__ */ new Set(), ze = (a, t) => m(void 0, null, function* () {
|
|
118
|
-
const
|
|
118
|
+
const r = de(a.overrides);
|
|
119
119
|
try {
|
|
120
120
|
if (he.has(a.widgetKey)) return;
|
|
121
|
-
const
|
|
122
|
-
if (
|
|
123
|
-
const { widget: o } =
|
|
121
|
+
const d = yield Ne({ apiHost: r, widgetKey: a.widgetKey, version: t.version || "latest" });
|
|
122
|
+
if (d) {
|
|
123
|
+
const { widget: o } = d, n = He({ config: t, apiKey: a.widgetKey, apiHost: r });
|
|
124
124
|
return a.overrides && t.settings && Object.entries(a.overrides).forEach((e) => {
|
|
125
|
-
let [
|
|
126
|
-
t.settings &&
|
|
125
|
+
let [i, s] = e;
|
|
126
|
+
t.settings && i in t.settings && (t.settings[i] = function() {
|
|
127
127
|
let l = arguments.length > 1 ? arguments[1] : void 0;
|
|
128
128
|
const u = new Map((arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : []).map((c) => [c.label, c]));
|
|
129
129
|
return l.forEach((c) => u.set(c.label, c)), Array.from(u.values());
|
|
130
|
-
}(t.settings[
|
|
131
|
-
}), function(e,
|
|
132
|
-
|
|
133
|
-
}(o,
|
|
130
|
+
}(t.settings[i], s));
|
|
131
|
+
}), function(e, i) {
|
|
132
|
+
i.widgetType === S.Searchbar || i.widgetType === "Search" ? e.SearchWidget.initStandard(i) : e.HelpWidget.initPopup(i);
|
|
133
|
+
}(o, n), he.add(a.widgetKey), o;
|
|
134
134
|
}
|
|
135
|
-
} catch (
|
|
136
|
-
x(
|
|
135
|
+
} catch (d) {
|
|
136
|
+
x(r, d, d.message, a.widgetKey);
|
|
137
137
|
}
|
|
138
138
|
});
|
|
139
139
|
let me = !1;
|
|
140
|
-
const qe = function(
|
|
141
|
-
return m(this, arguments, function* (a, t,
|
|
142
|
-
let e = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : "",
|
|
143
|
-
if (t || x(
|
|
144
|
-
const
|
|
140
|
+
const qe = function(d, o, n) {
|
|
141
|
+
return m(this, arguments, function* (a, t, r) {
|
|
142
|
+
let e = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : "", i = arguments.length > 4 && arguments[4] !== void 0 && arguments[4];
|
|
143
|
+
if (t || x(r, new Error("Access key is required"), "Access key is required", a), !me) try {
|
|
144
|
+
const s = (() => {
|
|
145
145
|
if (typeof window == "undefined" || typeof navigator == "undefined") return !1;
|
|
146
146
|
const u = navigator, c = window, f = (u.doNotTrack || c.doNotTrack || u.msDoNotTrack || "0").toString().toLowerCase();
|
|
147
147
|
return ["1", "yes", "true"].includes(f);
|
|
148
148
|
})();
|
|
149
|
-
window.BrainfishAnalytics("init", { apiUrl: e, accessKey: t, trackScreenViews: !
|
|
149
|
+
window.BrainfishAnalytics("init", { apiUrl: e, accessKey: t, trackScreenViews: !s, trackAttributes: !s, trackOutgoingLinks: !s, enableRecording: !s && i });
|
|
150
150
|
const l = window.BrainfishAnalytics;
|
|
151
151
|
window.BrainfishAnalytics = function() {
|
|
152
152
|
for (var u = arguments.length, c = new Array(u), f = 0; f < u; f++) c[f] = arguments[f];
|
|
@@ -158,34 +158,34 @@ const qe = function(i, o, r) {
|
|
|
158
158
|
f.id = "brainfish-analytics", f.src = "https://cdn.jsdelivr.net/npm/@brainfish-ai/web-tracker@latest/dist/tracker.js", f.type = "module", f.async = !0, f.crossOrigin = "anonymous", f.onerror = () => {
|
|
159
159
|
x(u, new Error(`Failed to load script: ${f.src}`), `Failed to load script: ${f.src}`, c);
|
|
160
160
|
}, document.head.appendChild(f);
|
|
161
|
-
}))(
|
|
162
|
-
} catch (
|
|
163
|
-
x(
|
|
161
|
+
}))(r, a);
|
|
162
|
+
} catch (s) {
|
|
163
|
+
x(r, s, "Failed to initialize BrainfishAnalytics", a);
|
|
164
164
|
}
|
|
165
165
|
});
|
|
166
166
|
};
|
|
167
|
-
function
|
|
168
|
-
let
|
|
169
|
-
const
|
|
170
|
-
return
|
|
171
|
-
let [
|
|
172
|
-
|
|
173
|
-
}),
|
|
167
|
+
function M(a, t) {
|
|
168
|
+
let r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
|
|
169
|
+
const d = document.createElement(a);
|
|
170
|
+
return d.className = t, Object.entries(r).forEach((o) => {
|
|
171
|
+
let [n, e] = o;
|
|
172
|
+
d.setAttribute(n, e);
|
|
173
|
+
}), d;
|
|
174
174
|
}
|
|
175
175
|
const P = "bf-iframe-container", j = "bf-trigger-button";
|
|
176
176
|
class v {
|
|
177
177
|
static get isWidgetOpen() {
|
|
178
178
|
return this.isOpen;
|
|
179
179
|
}
|
|
180
|
-
static initialize(t,
|
|
181
|
-
this.button = t, this.icon =
|
|
180
|
+
static initialize(t, r) {
|
|
181
|
+
this.button = t, this.icon = r, t.addEventListener("click", () => this.toggleIframeVisibility());
|
|
182
182
|
}
|
|
183
183
|
static toggleIframeVisibility() {
|
|
184
184
|
if (!this.button || !this.icon) return;
|
|
185
185
|
this.isOpen = !this.isOpen;
|
|
186
|
-
const t = this.icon.querySelector(".fish-icon"),
|
|
187
|
-
var
|
|
188
|
-
this.isOpen ? (
|
|
186
|
+
const t = this.icon.querySelector(".fish-icon"), r = this.icon.querySelector(".close-icon"), d = document.querySelector(".bf-iframe-container"), o = d == null ? void 0 : d.querySelector("iframe");
|
|
187
|
+
var n;
|
|
188
|
+
this.isOpen ? (d == null || d.classList.add("open"), d == null || d.setAttribute("aria-hidden", "false"), this.button.setAttribute("aria-expanded", "true"), t.classList.remove("visible"), r.classList.add("visible"), o == null || (n = o.contentWindow) === null || n === void 0 || n.postMessage({ type: "FOCUS_SEARCH_FIELD" }, "*"), window.BrainfishAnalytics("track", "Open Widget"), document.body.clientWidth <= 576 && this.hideTriggerButton()) : (d == null || d.classList.remove("open"), d == null || d.setAttribute("aria-hidden", "true"), this.button.setAttribute("aria-expanded", "false"), r.classList.remove("visible"), t.classList.add("visible"), this.showTriggerButton(), window.BrainfishAnalytics("track", "Close Widget"));
|
|
189
189
|
}
|
|
190
190
|
static showTriggerButton() {
|
|
191
191
|
var t;
|
|
@@ -197,41 +197,26 @@ class v {
|
|
|
197
197
|
}
|
|
198
198
|
}
|
|
199
199
|
k(v, "isOpen", !1), k(v, "button", null), k(v, "icon", null);
|
|
200
|
-
const K = [];
|
|
201
200
|
function Re(a) {
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
}), n.addEventListener("load", () => {
|
|
207
|
-
((i) => {
|
|
208
|
-
if (i.contentWindow) for (; K.length > 0; ) {
|
|
209
|
-
const o = K.shift();
|
|
210
|
-
o && i.contentWindow.postMessage({ type: "IDENTIFY_DATA", data: o.detail }, "*");
|
|
211
|
-
}
|
|
212
|
-
})(n);
|
|
213
|
-
}), t.appendChild(n), { iframeContainer: t, iframe: n };
|
|
214
|
-
}
|
|
215
|
-
function Ye(a) {
|
|
216
|
-
let { widgetHost: t, apiHost: n, widgetKey: i, signal: o } = a;
|
|
217
|
-
window.addEventListener("message", (r) => {
|
|
218
|
-
if (r.origin !== t) return;
|
|
219
|
-
const { type: e } = r.data;
|
|
201
|
+
let { widgetHost: t, apiHost: r, widgetKey: d, signal: o } = a;
|
|
202
|
+
window.addEventListener("message", (n) => {
|
|
203
|
+
if (n.origin !== t) return;
|
|
204
|
+
const { type: e } = n.data;
|
|
220
205
|
if (e === "TOGGLE_WIDGET_SIZE" && function() {
|
|
221
|
-
const
|
|
222
|
-
|
|
206
|
+
const i = document.querySelector(`.${P}`);
|
|
207
|
+
i.classList.contains("expanded") ? i.classList.remove("expanded") : i.classList.add("expanded");
|
|
223
208
|
}(), e === "TRACK_EVENT") {
|
|
224
209
|
if (!window.BrainfishAnalytics) return;
|
|
225
|
-
const { eventName:
|
|
226
|
-
window.BrainfishAnalytics("track",
|
|
210
|
+
const { eventName: i, data: s } = n.data;
|
|
211
|
+
window.BrainfishAnalytics("track", i, s);
|
|
227
212
|
}
|
|
228
213
|
if (e === "CLOSE_WIDGET" && (window.BrainfishAnalytics("track", "Close Widget"), v.toggleIframeVisibility()), e === "NEXT_BEST_ACTION_CLICKED") {
|
|
229
|
-
const { action:
|
|
230
|
-
if (!["function", "callback"].includes(
|
|
231
|
-
if (window.__bfCallbacks = window.__bfCallbacks || {}, window.__bfCallbacks[
|
|
232
|
-
const f = `${
|
|
214
|
+
const { action: i, searchQueryId: s, query: l, answer: u } = n.data, c = { action: i, searchQueryId: s };
|
|
215
|
+
if (!["function", "callback"].includes(i.type)) return void console.error("Invalid action type", i);
|
|
216
|
+
if (window.__bfCallbacks = window.__bfCallbacks || {}, window.__bfCallbacks[i.id]) return void window.__bfCallbacks[i.id](l, u, c);
|
|
217
|
+
const f = `${r}/api/searchWidgets.callback.codeblocks?apiKey=${d}&codeblockId=${i.id}`, g = document.createElement("script");
|
|
233
218
|
g.src = f, document.head.appendChild(g), g.onload = () => {
|
|
234
|
-
window.__bfCallbacks[
|
|
219
|
+
window.__bfCallbacks[i.id](l, u, c), setTimeout(() => {
|
|
235
220
|
document.head.removeChild(g);
|
|
236
221
|
}, 300);
|
|
237
222
|
};
|
|
@@ -243,35 +228,35 @@ function le(a) {
|
|
|
243
228
|
}
|
|
244
229
|
var N = { exports: {} }, z = { exports: {} }, q = { exports: {} };
|
|
245
230
|
(function(a, t) {
|
|
246
|
-
function
|
|
231
|
+
function r(o) {
|
|
247
232
|
return Math.round(255 * o);
|
|
248
233
|
}
|
|
249
|
-
function
|
|
250
|
-
return
|
|
234
|
+
function d(o, n, e) {
|
|
235
|
+
return r(o) + "," + r(n) + "," + r(e);
|
|
251
236
|
}
|
|
252
|
-
t.__esModule = !0, t.default = void 0, t.default = function(o,
|
|
253
|
-
if (
|
|
254
|
-
var
|
|
255
|
-
|
|
237
|
+
t.__esModule = !0, t.default = void 0, t.default = function(o, n, e, i) {
|
|
238
|
+
if (i === void 0 && (i = d), n === 0) return i(e, e, e);
|
|
239
|
+
var s = (o % 360 + 360) % 360 / 60, l = (1 - Math.abs(2 * e - 1)) * n, u = l * (1 - Math.abs(s % 2 - 1)), c = 0, f = 0, g = 0;
|
|
240
|
+
s >= 0 && s < 1 ? (c = l, f = u) : s >= 1 && s < 2 ? (c = u, f = l) : s >= 2 && s < 3 ? (f = l, g = u) : s >= 3 && s < 4 ? (f = u, g = l) : s >= 4 && s < 5 ? (c = u, g = l) : s >= 5 && s < 6 && (c = l, g = u);
|
|
256
241
|
var h = e - l / 2;
|
|
257
|
-
return
|
|
242
|
+
return i(c + h, f + h, g + h);
|
|
258
243
|
}, a.exports = t.default;
|
|
259
244
|
})(q, q.exports);
|
|
260
245
|
var ue = q.exports, R = { exports: {} };
|
|
261
246
|
(function(a, t) {
|
|
262
247
|
t.__esModule = !0, t.default = void 0;
|
|
263
|
-
var
|
|
264
|
-
t.default = function(
|
|
265
|
-
if (typeof
|
|
266
|
-
var o =
|
|
267
|
-
return
|
|
248
|
+
var r = { 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" };
|
|
249
|
+
t.default = function(d) {
|
|
250
|
+
if (typeof d != "string") return d;
|
|
251
|
+
var o = d.toLowerCase();
|
|
252
|
+
return r[o] ? "#" + r[o] : d;
|
|
268
253
|
}, a.exports = t.default;
|
|
269
254
|
})(R, R.exports);
|
|
270
|
-
var
|
|
255
|
+
var Ye = R.exports, Y = { exports: {} };
|
|
271
256
|
(function(a, t) {
|
|
272
|
-
function
|
|
257
|
+
function r(s) {
|
|
273
258
|
var l = typeof Map == "function" ? /* @__PURE__ */ new Map() : void 0;
|
|
274
|
-
return
|
|
259
|
+
return r = function(u) {
|
|
275
260
|
if (u === null || !function(f) {
|
|
276
261
|
try {
|
|
277
262
|
return Function.toString.call(f).indexOf("[native code]") !== -1;
|
|
@@ -286,35 +271,35 @@ var Je = R.exports, Y = { exports: {} };
|
|
|
286
271
|
}
|
|
287
272
|
function c() {
|
|
288
273
|
return function(f, g, h) {
|
|
289
|
-
if (
|
|
274
|
+
if (d()) return Reflect.construct.apply(null, arguments);
|
|
290
275
|
var p = [null];
|
|
291
276
|
p.push.apply(p, g);
|
|
292
277
|
var b = new (f.bind.apply(f, p))();
|
|
293
278
|
return h && o(b, h.prototype), b;
|
|
294
|
-
}(u, arguments,
|
|
279
|
+
}(u, arguments, n(this).constructor);
|
|
295
280
|
}
|
|
296
281
|
return c.prototype = Object.create(u.prototype, { constructor: { value: c, enumerable: !1, writable: !0, configurable: !0 } }), o(c, u);
|
|
297
|
-
},
|
|
282
|
+
}, r(s);
|
|
298
283
|
}
|
|
299
|
-
function
|
|
284
|
+
function d() {
|
|
300
285
|
try {
|
|
301
|
-
var
|
|
286
|
+
var s = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
|
|
302
287
|
}));
|
|
303
288
|
} catch (l) {
|
|
304
289
|
}
|
|
305
|
-
return (
|
|
306
|
-
return !!
|
|
290
|
+
return (d = function() {
|
|
291
|
+
return !!s;
|
|
307
292
|
})();
|
|
308
293
|
}
|
|
309
|
-
function o(
|
|
294
|
+
function o(s, l) {
|
|
310
295
|
return o = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(u, c) {
|
|
311
296
|
return u.__proto__ = c, u;
|
|
312
|
-
}, o(
|
|
297
|
+
}, o(s, l);
|
|
313
298
|
}
|
|
314
|
-
function
|
|
315
|
-
return
|
|
299
|
+
function n(s) {
|
|
300
|
+
return n = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(l) {
|
|
316
301
|
return l.__proto__ || Object.getPrototypeOf(l);
|
|
317
|
-
},
|
|
302
|
+
}, n(s);
|
|
318
303
|
}
|
|
319
304
|
t.__esModule = !0, t.default = void 0;
|
|
320
305
|
var e = { 1: `Passed invalid arguments to hsl, please pass multiple numbers e.g. hsl(360, 0.75, 0.4) or an object e.g. rgb({ hue: 255, saturation: 0.4, lightness: 0.75 }).
|
|
@@ -466,42 +451,42 @@ To pass a single animation please supply them in simple values, e.g. animation('
|
|
|
466
451
|
|
|
467
452
|
`, 78: `base must be set in "px" or "%" but you set it in "%s".
|
|
468
453
|
` };
|
|
469
|
-
function
|
|
470
|
-
for (var
|
|
454
|
+
function i() {
|
|
455
|
+
for (var s = arguments.length, l = new Array(s), u = 0; u < s; u++) l[u] = arguments[u];
|
|
471
456
|
var c, f = l[0], g = [];
|
|
472
457
|
for (c = 1; c < l.length; c += 1) g.push(l[c]);
|
|
473
458
|
return g.forEach(function(h) {
|
|
474
459
|
f = f.replace(/%[a-z]/, h);
|
|
475
460
|
}), f;
|
|
476
461
|
}
|
|
477
|
-
t.default = function(
|
|
462
|
+
t.default = function(s) {
|
|
478
463
|
var l, u;
|
|
479
464
|
function c(f) {
|
|
480
465
|
var g;
|
|
481
|
-
if (process.env.NODE_ENV === "production") g =
|
|
466
|
+
if (process.env.NODE_ENV === "production") g = s.call(this, "An error occurred. See https://github.com/styled-components/polished/blob/main/src/internalHelpers/errors.md#" + f + " for more information.") || this;
|
|
482
467
|
else {
|
|
483
468
|
for (var h = arguments.length, p = new Array(h > 1 ? h - 1 : 0), b = 1; b < h; b++) p[b - 1] = arguments[b];
|
|
484
|
-
g =
|
|
469
|
+
g = s.call(this, i.apply(void 0, [e[f]].concat(p))) || this;
|
|
485
470
|
}
|
|
486
471
|
return function(C) {
|
|
487
472
|
if (C === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
488
473
|
return C;
|
|
489
474
|
}(g);
|
|
490
475
|
}
|
|
491
|
-
return u =
|
|
492
|
-
}(
|
|
476
|
+
return u = s, (l = c).prototype = Object.create(u.prototype), l.prototype.constructor = l, o(l, u), c;
|
|
477
|
+
}(r(Error)), a.exports = t.default;
|
|
493
478
|
})(Y, Y.exports);
|
|
494
479
|
var _ = Y.exports;
|
|
495
480
|
(function(a, t) {
|
|
496
481
|
t.__esModule = !0, t.default = function(h) {
|
|
497
482
|
if (typeof h != "string") throw new o.default(3);
|
|
498
|
-
var p = (0,
|
|
483
|
+
var p = (0, d.default)(h);
|
|
499
484
|
if (p.match(e)) return { red: parseInt("" + p[1] + p[2], 16), green: parseInt("" + p[3] + p[4], 16), blue: parseInt("" + p[5] + p[6], 16) };
|
|
500
|
-
if (p.match(
|
|
485
|
+
if (p.match(i)) {
|
|
501
486
|
var b = parseFloat((parseInt("" + p[7] + p[8], 16) / 255).toFixed(2));
|
|
502
487
|
return { red: parseInt("" + p[1] + p[2], 16), green: parseInt("" + p[3] + p[4], 16), blue: parseInt("" + p[5] + p[6], 16), alpha: b };
|
|
503
488
|
}
|
|
504
|
-
if (p.match(
|
|
489
|
+
if (p.match(s)) return { red: parseInt("" + p[1] + p[1], 16), green: parseInt("" + p[2] + p[2], 16), blue: parseInt("" + p[3] + p[3], 16) };
|
|
505
490
|
if (p.match(l)) {
|
|
506
491
|
var C = parseFloat((parseInt("" + p[4] + p[4], 16) / 255).toFixed(2));
|
|
507
492
|
return { red: parseInt("" + p[1] + p[1], 16), green: parseInt("" + p[2] + p[2], 16), blue: parseInt("" + p[3] + p[3], 16), alpha: C };
|
|
@@ -512,186 +497,186 @@ var _ = Y.exports;
|
|
|
512
497
|
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]) };
|
|
513
498
|
var A = f.exec(p);
|
|
514
499
|
if (A) {
|
|
515
|
-
var Oe = parseInt("" + A[1], 10), Me = parseInt("" + A[2], 10) / 100, Be = parseInt("" + A[3], 10) / 100, ce = "rgb(" + (0,
|
|
500
|
+
var Oe = parseInt("" + A[1], 10), Me = parseInt("" + A[2], 10) / 100, Be = parseInt("" + A[3], 10) / 100, ce = "rgb(" + (0, r.default)(Oe, Me, Be) + ")", I = u.exec(ce);
|
|
516
501
|
if (!I) throw new o.default(4, p, ce);
|
|
517
502
|
return { red: parseInt("" + I[1], 10), green: parseInt("" + I[2], 10), blue: parseInt("" + I[3], 10) };
|
|
518
503
|
}
|
|
519
504
|
var w = g.exec(p.substring(0, 50));
|
|
520
505
|
if (w) {
|
|
521
|
-
var Te = parseInt("" + w[1], 10), Pe = parseInt("" + w[2], 10) / 100, je = parseInt("" + w[3], 10) / 100, pe = "rgb(" + (0,
|
|
506
|
+
var Te = parseInt("" + w[1], 10), Pe = parseInt("" + w[2], 10) / 100, je = parseInt("" + w[3], 10) / 100, pe = "rgb(" + (0, r.default)(Te, Pe, je) + ")", O = u.exec(pe);
|
|
522
507
|
if (!O) throw new o.default(4, p, pe);
|
|
523
508
|
return { red: parseInt("" + O[1], 10), green: parseInt("" + O[2], 10), blue: parseInt("" + O[3], 10), alpha: parseFloat("" + w[4]) > 1 ? parseFloat("" + w[4]) / 100 : parseFloat("" + w[4]) };
|
|
524
509
|
}
|
|
525
510
|
throw new o.default(5);
|
|
526
511
|
};
|
|
527
|
-
var
|
|
528
|
-
function
|
|
512
|
+
var r = n(ue), d = n(Ye), o = n(_);
|
|
513
|
+
function n(h) {
|
|
529
514
|
return h && h.__esModule ? h : { default: h };
|
|
530
515
|
}
|
|
531
|
-
var e = /^#[a-fA-F0-9]{6}$/,
|
|
516
|
+
var e = /^#[a-fA-F0-9]{6}$/, i = /^#[a-fA-F0-9]{8}$/, s = /^#[a-fA-F0-9]{3}$/, l = /^#[a-fA-F0-9]{4}$/, u = /^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, f = /^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;
|
|
532
517
|
a.exports = t.default;
|
|
533
518
|
})(z, z.exports);
|
|
534
519
|
var fe = z.exports;
|
|
535
520
|
(function(a, t) {
|
|
536
521
|
t.__esModule = !0, t.default = function(o) {
|
|
537
522
|
if (o === "transparent") return 0;
|
|
538
|
-
var
|
|
539
|
-
var c =
|
|
523
|
+
var n = (0, d.default)(o), e = Object.keys(n).map(function(u) {
|
|
524
|
+
var c = n[u] / 255;
|
|
540
525
|
return c <= 0.03928 ? c / 12.92 : Math.pow((c + 0.055) / 1.055, 2.4);
|
|
541
|
-
}),
|
|
542
|
-
return parseFloat((0.2126 *
|
|
526
|
+
}), i = e[0], s = e[1], l = e[2];
|
|
527
|
+
return parseFloat((0.2126 * i + 0.7152 * s + 0.0722 * l).toFixed(3));
|
|
543
528
|
};
|
|
544
|
-
var
|
|
529
|
+
var r, d = (r = fe) && r.__esModule ? r : { default: r };
|
|
545
530
|
a.exports = t.default;
|
|
546
531
|
})(N, N.exports);
|
|
547
|
-
const
|
|
532
|
+
const Je = le(N.exports);
|
|
548
533
|
var J = { exports: {} }, U = { exports: {} };
|
|
549
534
|
(function(a, t) {
|
|
550
|
-
function
|
|
535
|
+
function r(d, o, n) {
|
|
551
536
|
return function() {
|
|
552
|
-
var e =
|
|
553
|
-
return e.length >= o ?
|
|
537
|
+
var e = n.concat(Array.prototype.slice.call(arguments));
|
|
538
|
+
return e.length >= o ? d.apply(this, e) : r(d, o, e);
|
|
554
539
|
};
|
|
555
540
|
}
|
|
556
|
-
t.__esModule = !0, t.default = function(
|
|
557
|
-
return
|
|
541
|
+
t.__esModule = !0, t.default = function(d) {
|
|
542
|
+
return r(d, d.length, []);
|
|
558
543
|
}, a.exports = t.default;
|
|
559
544
|
})(U, U.exports);
|
|
560
|
-
var be,
|
|
561
|
-
be = G, (
|
|
562
|
-
return Math.max(a, Math.min(t,
|
|
563
|
-
}, be.exports =
|
|
545
|
+
var be, B, xe = U.exports, G = { exports: {} };
|
|
546
|
+
be = G, (B = G.exports).__esModule = !0, B.default = void 0, B.default = function(a, t, r) {
|
|
547
|
+
return Math.max(a, Math.min(t, r));
|
|
548
|
+
}, be.exports = B.default;
|
|
564
549
|
var _e = G.exports, V = { exports: {} }, Z = { exports: {} };
|
|
565
550
|
(function(a, t) {
|
|
566
|
-
t.__esModule = !0, t.default = void 0, t.default = function(
|
|
567
|
-
var
|
|
568
|
-
if (
|
|
569
|
-
var u =
|
|
570
|
-
switch (
|
|
551
|
+
t.__esModule = !0, t.default = void 0, t.default = function(r) {
|
|
552
|
+
var d, o = r.red / 255, n = r.green / 255, e = r.blue / 255, i = Math.max(o, n, e), s = Math.min(o, n, e), l = (i + s) / 2;
|
|
553
|
+
if (i === s) return r.alpha !== void 0 ? { hue: 0, saturation: 0, lightness: l, alpha: r.alpha } : { hue: 0, saturation: 0, lightness: l };
|
|
554
|
+
var u = i - s, c = l > 0.5 ? u / (2 - i - s) : u / (i + s);
|
|
555
|
+
switch (i) {
|
|
571
556
|
case o:
|
|
572
|
-
|
|
557
|
+
d = (n - e) / u + (n < e ? 6 : 0);
|
|
573
558
|
break;
|
|
574
|
-
case
|
|
575
|
-
|
|
559
|
+
case n:
|
|
560
|
+
d = (e - o) / u + 2;
|
|
576
561
|
break;
|
|
577
562
|
default:
|
|
578
|
-
|
|
563
|
+
d = (o - n) / u + 4;
|
|
579
564
|
}
|
|
580
|
-
return
|
|
565
|
+
return d *= 60, r.alpha !== void 0 ? { hue: d, saturation: c, lightness: l, alpha: r.alpha } : { hue: d, saturation: c, lightness: l };
|
|
581
566
|
}, a.exports = t.default;
|
|
582
567
|
})(Z, Z.exports);
|
|
583
|
-
var
|
|
568
|
+
var Ue = Z.exports;
|
|
584
569
|
(function(a, t) {
|
|
585
|
-
t.__esModule = !0, t.default = function(
|
|
586
|
-
return (0,
|
|
570
|
+
t.__esModule = !0, t.default = function(n) {
|
|
571
|
+
return (0, d.default)((0, r.default)(n));
|
|
587
572
|
};
|
|
588
|
-
var
|
|
589
|
-
function o(
|
|
590
|
-
return
|
|
573
|
+
var r = o(fe), d = o(Ue);
|
|
574
|
+
function o(n) {
|
|
575
|
+
return n && n.__esModule ? n : { default: n };
|
|
591
576
|
}
|
|
592
577
|
a.exports = t.default;
|
|
593
578
|
})(V, V.exports);
|
|
594
579
|
var ke = V.exports, Q = { exports: {} }, X = { exports: {} }, ee = { exports: {} }, te = { exports: {} };
|
|
595
580
|
(function(a, t) {
|
|
596
|
-
t.__esModule = !0, t.default = void 0, t.default = function(
|
|
597
|
-
return
|
|
581
|
+
t.__esModule = !0, t.default = void 0, t.default = function(r) {
|
|
582
|
+
return r.length === 7 && r[1] === r[2] && r[3] === r[4] && r[5] === r[6] ? "#" + r[1] + r[3] + r[5] : r;
|
|
598
583
|
}, a.exports = t.default;
|
|
599
584
|
})(te, te.exports);
|
|
600
585
|
var Se = te.exports, ne = { exports: {} };
|
|
601
586
|
(function(a, t) {
|
|
602
|
-
t.__esModule = !0, t.default = void 0, t.default = function(
|
|
603
|
-
var
|
|
604
|
-
return
|
|
587
|
+
t.__esModule = !0, t.default = void 0, t.default = function(r) {
|
|
588
|
+
var d = r.toString(16);
|
|
589
|
+
return d.length === 1 ? "0" + d : d;
|
|
605
590
|
}, a.exports = t.default;
|
|
606
591
|
})(ne, ne.exports);
|
|
607
592
|
var Ce = ne.exports;
|
|
608
593
|
(function(a, t) {
|
|
609
594
|
t.__esModule = !0, t.default = void 0;
|
|
610
|
-
var
|
|
611
|
-
function
|
|
612
|
-
return
|
|
595
|
+
var r = n(ue), d = n(Se), o = n(Ce);
|
|
596
|
+
function n(s) {
|
|
597
|
+
return s && s.__esModule ? s : { default: s };
|
|
613
598
|
}
|
|
614
|
-
function e(
|
|
615
|
-
return (0, o.default)(Math.round(255 *
|
|
599
|
+
function e(s) {
|
|
600
|
+
return (0, o.default)(Math.round(255 * s));
|
|
616
601
|
}
|
|
617
|
-
function s
|
|
618
|
-
return (0,
|
|
602
|
+
function i(s, l, u) {
|
|
603
|
+
return (0, d.default)("#" + e(s) + e(l) + e(u));
|
|
619
604
|
}
|
|
620
|
-
t.default = function(
|
|
621
|
-
return (0,
|
|
605
|
+
t.default = function(s, l, u) {
|
|
606
|
+
return (0, r.default)(s, l, u, i);
|
|
622
607
|
}, a.exports = t.default;
|
|
623
608
|
})(ee, ee.exports);
|
|
624
609
|
var Ee = ee.exports;
|
|
625
610
|
(function(a, t) {
|
|
626
|
-
t.__esModule = !0, t.default = function(
|
|
627
|
-
if (typeof
|
|
628
|
-
if (typeof
|
|
629
|
-
throw new
|
|
611
|
+
t.__esModule = !0, t.default = function(n, e, i) {
|
|
612
|
+
if (typeof n == "number" && typeof e == "number" && typeof i == "number") return (0, r.default)(n, e, i);
|
|
613
|
+
if (typeof n == "object" && e === void 0 && i === void 0) return (0, r.default)(n.hue, n.saturation, n.lightness);
|
|
614
|
+
throw new d.default(1);
|
|
630
615
|
};
|
|
631
|
-
var
|
|
632
|
-
function o(
|
|
633
|
-
return
|
|
616
|
+
var r = o(Ee), d = o(_);
|
|
617
|
+
function o(n) {
|
|
618
|
+
return n && n.__esModule ? n : { default: n };
|
|
634
619
|
}
|
|
635
620
|
a.exports = t.default;
|
|
636
621
|
})(X, X.exports);
|
|
637
|
-
var
|
|
622
|
+
var Ge = X.exports, re = { exports: {} };
|
|
638
623
|
(function(a, t) {
|
|
639
|
-
t.__esModule = !0, t.default = function(e,
|
|
640
|
-
if (typeof e == "number" && typeof
|
|
641
|
-
if (typeof e == "object" &&
|
|
624
|
+
t.__esModule = !0, t.default = function(e, i, s, l) {
|
|
625
|
+
if (typeof e == "number" && typeof i == "number" && typeof s == "number" && typeof l == "number") return l >= 1 ? (0, r.default)(e, i, s) : "rgba(" + (0, d.default)(e, i, s) + "," + l + ")";
|
|
626
|
+
if (typeof e == "object" && i === void 0 && s === void 0 && l === void 0) return e.alpha >= 1 ? (0, r.default)(e.hue, e.saturation, e.lightness) : "rgba(" + (0, d.default)(e.hue, e.saturation, e.lightness) + "," + e.alpha + ")";
|
|
642
627
|
throw new o.default(2);
|
|
643
628
|
};
|
|
644
|
-
var
|
|
645
|
-
function
|
|
629
|
+
var r = n(Ee), d = n(ue), o = n(_);
|
|
630
|
+
function n(e) {
|
|
646
631
|
return e && e.__esModule ? e : { default: e };
|
|
647
632
|
}
|
|
648
633
|
a.exports = t.default;
|
|
649
634
|
})(re, re.exports);
|
|
650
|
-
var
|
|
635
|
+
var Ve = re.exports, ae = { exports: {} };
|
|
651
636
|
(function(a, t) {
|
|
652
|
-
t.__esModule = !0, t.default = function(e,
|
|
653
|
-
if (typeof e == "number" && typeof
|
|
654
|
-
if (typeof e == "object" &&
|
|
637
|
+
t.__esModule = !0, t.default = function(e, i, s) {
|
|
638
|
+
if (typeof e == "number" && typeof i == "number" && typeof s == "number") return (0, r.default)("#" + (0, d.default)(e) + (0, d.default)(i) + (0, d.default)(s));
|
|
639
|
+
if (typeof e == "object" && i === void 0 && s === void 0) return (0, r.default)("#" + (0, d.default)(e.red) + (0, d.default)(e.green) + (0, d.default)(e.blue));
|
|
655
640
|
throw new o.default(6);
|
|
656
641
|
};
|
|
657
|
-
var
|
|
658
|
-
function
|
|
642
|
+
var r = n(Se), d = n(Ce), o = n(_);
|
|
643
|
+
function n(e) {
|
|
659
644
|
return e && e.__esModule ? e : { default: e };
|
|
660
645
|
}
|
|
661
646
|
a.exports = t.default;
|
|
662
647
|
})(ae, ae.exports);
|
|
663
648
|
var Ae = ae.exports, oe = { exports: {} };
|
|
664
649
|
(function(a, t) {
|
|
665
|
-
t.__esModule = !0, t.default = function(e,
|
|
666
|
-
if (typeof e == "string" && typeof
|
|
667
|
-
var u = (0,
|
|
668
|
-
return "rgba(" + u.red + "," + u.green + "," + u.blue + "," +
|
|
650
|
+
t.__esModule = !0, t.default = function(e, i, s, l) {
|
|
651
|
+
if (typeof e == "string" && typeof i == "number") {
|
|
652
|
+
var u = (0, r.default)(e);
|
|
653
|
+
return "rgba(" + u.red + "," + u.green + "," + u.blue + "," + i + ")";
|
|
669
654
|
}
|
|
670
|
-
if (typeof e == "number" && typeof
|
|
671
|
-
if (typeof e == "object" &&
|
|
655
|
+
if (typeof e == "number" && typeof i == "number" && typeof s == "number" && typeof l == "number") return l >= 1 ? (0, d.default)(e, i, s) : "rgba(" + e + "," + i + "," + s + "," + l + ")";
|
|
656
|
+
if (typeof e == "object" && i === void 0 && s === void 0 && l === void 0) return e.alpha >= 1 ? (0, d.default)(e.red, e.green, e.blue) : "rgba(" + e.red + "," + e.green + "," + e.blue + "," + e.alpha + ")";
|
|
672
657
|
throw new o.default(7);
|
|
673
658
|
};
|
|
674
|
-
var
|
|
675
|
-
function
|
|
659
|
+
var r = n(fe), d = n(Ae), o = n(_);
|
|
660
|
+
function n(e) {
|
|
676
661
|
return e && e.__esModule ? e : { default: e };
|
|
677
662
|
}
|
|
678
663
|
a.exports = t.default;
|
|
679
664
|
})(oe, oe.exports);
|
|
680
|
-
var
|
|
665
|
+
var Ze = oe.exports;
|
|
681
666
|
(function(a, t) {
|
|
682
667
|
t.__esModule = !0, t.default = function(f) {
|
|
683
668
|
if (typeof f != "object") throw new e.default(8);
|
|
684
|
-
if (l(f)) return (0,
|
|
685
|
-
if (
|
|
686
|
-
if (c(f)) return (0,
|
|
687
|
-
if (u(f)) return (0,
|
|
669
|
+
if (l(f)) return (0, n.default)(f);
|
|
670
|
+
if (s(f)) return (0, o.default)(f);
|
|
671
|
+
if (c(f)) return (0, d.default)(f);
|
|
672
|
+
if (u(f)) return (0, r.default)(f);
|
|
688
673
|
throw new e.default(8);
|
|
689
674
|
};
|
|
690
|
-
var
|
|
691
|
-
function
|
|
675
|
+
var r = i(Ge), d = i(Ve), o = i(Ae), n = i(Ze), e = i(_);
|
|
676
|
+
function i(f) {
|
|
692
677
|
return f && f.__esModule ? f : { default: f };
|
|
693
678
|
}
|
|
694
|
-
var
|
|
679
|
+
var s = function(f) {
|
|
695
680
|
return typeof f.red == "number" && typeof f.green == "number" && typeof f.blue == "number" && (typeof f.alpha != "number" || f.alpha === void 0);
|
|
696
681
|
}, l = function(f) {
|
|
697
682
|
return typeof f.red == "number" && typeof f.green == "number" && typeof f.blue == "number" && typeof f.alpha == "number";
|
|
@@ -705,222 +690,233 @@ var Qe = oe.exports;
|
|
|
705
690
|
var Ie = Q.exports;
|
|
706
691
|
(function(a, t) {
|
|
707
692
|
t.__esModule = !0, t.default = void 0;
|
|
708
|
-
var
|
|
693
|
+
var r = e(xe), d = e(_e), o = e(ke), n = e(Ie);
|
|
709
694
|
function e(l) {
|
|
710
695
|
return l && l.__esModule ? l : { default: l };
|
|
711
696
|
}
|
|
712
|
-
function
|
|
713
|
-
return
|
|
697
|
+
function i() {
|
|
698
|
+
return i = Object.assign ? Object.assign.bind() : function(l) {
|
|
714
699
|
for (var u = 1; u < arguments.length; u++) {
|
|
715
700
|
var c = arguments[u];
|
|
716
701
|
for (var f in c) Object.prototype.hasOwnProperty.call(c, f) && (l[f] = c[f]);
|
|
717
702
|
}
|
|
718
703
|
return l;
|
|
719
|
-
},
|
|
704
|
+
}, i.apply(this, arguments);
|
|
720
705
|
}
|
|
721
|
-
var
|
|
706
|
+
var s = (0, r.default)(function(l, u) {
|
|
722
707
|
if (u === "transparent") return u;
|
|
723
708
|
var c = (0, o.default)(u);
|
|
724
|
-
return (0,
|
|
709
|
+
return (0, n.default)(i({}, c, { lightness: (0, d.default)(0, 1, c.lightness - parseFloat(l)) }));
|
|
725
710
|
});
|
|
726
|
-
t.default =
|
|
711
|
+
t.default = s, a.exports = t.default;
|
|
727
712
|
})(J, J.exports);
|
|
728
|
-
const
|
|
713
|
+
const Qe = le(J.exports);
|
|
729
714
|
var ie = { exports: {} };
|
|
730
715
|
(function(a, t) {
|
|
731
716
|
t.__esModule = !0, t.default = void 0;
|
|
732
|
-
var
|
|
717
|
+
var r = e(xe), d = e(_e), o = e(ke), n = e(Ie);
|
|
733
718
|
function e(l) {
|
|
734
719
|
return l && l.__esModule ? l : { default: l };
|
|
735
720
|
}
|
|
736
|
-
function
|
|
737
|
-
return
|
|
721
|
+
function i() {
|
|
722
|
+
return i = Object.assign ? Object.assign.bind() : function(l) {
|
|
738
723
|
for (var u = 1; u < arguments.length; u++) {
|
|
739
724
|
var c = arguments[u];
|
|
740
725
|
for (var f in c) Object.prototype.hasOwnProperty.call(c, f) && (l[f] = c[f]);
|
|
741
726
|
}
|
|
742
727
|
return l;
|
|
743
|
-
},
|
|
728
|
+
}, i.apply(this, arguments);
|
|
744
729
|
}
|
|
745
|
-
var
|
|
730
|
+
var s = (0, r.default)(function(l, u) {
|
|
746
731
|
if (u === "transparent") return u;
|
|
747
732
|
var c = (0, o.default)(u);
|
|
748
|
-
return (0,
|
|
733
|
+
return (0, n.default)(i({}, c, { lightness: (0, d.default)(0, 1, c.lightness + parseFloat(l)) }));
|
|
749
734
|
});
|
|
750
|
-
t.default =
|
|
735
|
+
t.default = s, a.exports = t.default;
|
|
751
736
|
})(ie, ie.exports);
|
|
752
|
-
const
|
|
753
|
-
function
|
|
737
|
+
const Xe = le(ie.exports);
|
|
738
|
+
function et(a) {
|
|
754
739
|
if (!document.querySelector("style[data-widget-styles]")) {
|
|
755
|
-
var t,
|
|
740
|
+
var t, r;
|
|
756
741
|
(function() {
|
|
757
|
-
let
|
|
758
|
-
const
|
|
759
|
-
|
|
760
|
-
const e =
|
|
761
|
-
|
|
742
|
+
let d = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "#000", o = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "FFF";
|
|
743
|
+
const n = document.createElement("style");
|
|
744
|
+
n.attributes.setNamedItem(document.createAttribute("data-widget-styles"));
|
|
745
|
+
const e = Je(d) > 0.5;
|
|
746
|
+
n.textContent = `
|
|
762
747
|
.bf-trigger-button{position:fixed;bottom:16px;right:16px;width:56px;height:56px;border-radius:50%;border:none;box-shadow:0 20px 25px -5px #1212171a,0 10px 10px -5px #1212170a;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{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 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{position:fixed;bottom:0;right:0;width:100vw;height:100vh;border:none;overflow:hidden;z-index:999;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{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))}}
|
|
763
|
-
.${j} { background: ${
|
|
748
|
+
.${j} { background: ${d}; }
|
|
764
749
|
.${j}:hover {
|
|
765
|
-
background: ${e ?
|
|
750
|
+
background: ${e ? Qe(0.05, d) : Xe(0.05, d)};
|
|
766
751
|
}
|
|
767
752
|
.trigger-button-icon { color: ${o}; }
|
|
768
|
-
`, document.head.appendChild(
|
|
769
|
-
})((a == null || (t = a.theme) === null || t === void 0 ? void 0 : t.inputButtonBgColor) || "#007bff", (a == null || (
|
|
753
|
+
`, document.head.appendChild(n);
|
|
754
|
+
})((a == null || (t = a.theme) === null || t === void 0 ? void 0 : t.inputButtonBgColor) || "#007bff", (a == null || (r = a.theme) === null || r === void 0 ? void 0 : r.textBaseColor) || "#ffffff");
|
|
770
755
|
}
|
|
771
756
|
}
|
|
772
|
-
function
|
|
773
|
-
const
|
|
774
|
-
((
|
|
757
|
+
function tt(a, t) {
|
|
758
|
+
const r = () => {
|
|
759
|
+
((d) => {
|
|
775
760
|
var o;
|
|
776
|
-
(o = a.contentWindow) === null || o === void 0 || o.postMessage({ type: "UPDATE_BODY_CLASS", isDarkMode:
|
|
761
|
+
(o = a.contentWindow) === null || o === void 0 || o.postMessage({ type: "UPDATE_BODY_CLASS", isDarkMode: d }, "*");
|
|
777
762
|
})(document.body.classList.contains("dark"));
|
|
778
763
|
};
|
|
779
|
-
|
|
780
|
-
const
|
|
781
|
-
|
|
764
|
+
r(), (() => {
|
|
765
|
+
const d = new MutationObserver(r);
|
|
766
|
+
d.observe(document.body, { attributes: !0, attributeFilter: ["class"] }), t.addEventListener("abort", () => d.disconnect());
|
|
782
767
|
})();
|
|
783
768
|
}
|
|
784
|
-
function
|
|
785
|
-
let
|
|
786
|
-
const
|
|
787
|
-
((
|
|
769
|
+
function nt(a, t) {
|
|
770
|
+
let r;
|
|
771
|
+
const d = () => {
|
|
772
|
+
((n) => {
|
|
788
773
|
var e;
|
|
789
|
-
const
|
|
790
|
-
(e = a.contentWindow) === null || e === void 0 || e.postMessage(
|
|
774
|
+
const i = { type: "UPDATE_BODY_CLASS", isMobile: n };
|
|
775
|
+
(e = a.contentWindow) === null || e === void 0 || e.postMessage(i, "*"), n && (v.isWidgetOpen ? v.hideTriggerButton() : v.showTriggerButton());
|
|
791
776
|
})(document.body.clientWidth <= 576);
|
|
792
777
|
}, o = () => {
|
|
793
|
-
|
|
778
|
+
r && clearTimeout(r), r = window.setTimeout(d, 300);
|
|
794
779
|
};
|
|
795
|
-
|
|
796
|
-
const
|
|
797
|
-
|
|
780
|
+
d(), (() => {
|
|
781
|
+
const n = new ResizeObserver(o);
|
|
782
|
+
n.observe(document.body), t.addEventListener("abort", () => n.disconnect());
|
|
798
783
|
})();
|
|
799
784
|
}
|
|
800
785
|
function ve(a) {
|
|
801
786
|
const t = new TextEncoder().encode(a);
|
|
802
787
|
if (typeof window != "undefined" && typeof window.btoa == "function") {
|
|
803
|
-
const
|
|
804
|
-
return btoa(
|
|
788
|
+
const r = Array.from(t, (d) => String.fromCharCode(d)).join("");
|
|
789
|
+
return btoa(r);
|
|
805
790
|
}
|
|
806
791
|
if (typeof Buffer != "undefined") return Buffer.from(t).toString("base64");
|
|
807
792
|
throw new Error("[utils.base64Encode]: Unsupported environment");
|
|
808
793
|
}
|
|
809
|
-
const ye = /* @__PURE__ */ new Set();
|
|
810
|
-
function
|
|
811
|
-
const
|
|
812
|
-
const
|
|
813
|
-
return
|
|
794
|
+
const ye = /* @__PURE__ */ new Set(), K = [];
|
|
795
|
+
function rt(a, t) {
|
|
796
|
+
const r = document.createDocumentFragment(), d = function(e) {
|
|
797
|
+
const i = M("button", j, { id: `trigger-button-${e}`, "aria-controls": P, "aria-expanded": "false", "data-name": j }), s = M("div", "trigger-button-icon", { "aria-hidden": "true" });
|
|
798
|
+
return s.innerHTML = `
|
|
814
799
|
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="currentColor" viewBox="0 0 256 256" class="close-icon">
|
|
815
800
|
<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>
|
|
816
801
|
</svg>
|
|
817
802
|
<svg width="24" height="14" viewBox="0 0 24 14" fill="none" xmlns="http://www.w3.org/2000/svg" class="fish-icon visible">
|
|
818
803
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M1.71844 10.3882L4.60606 6.98384L1.71844 3.58375C1.4014 3.21362 1.44424 2.65841 1.81269 2.33993C1.97978 2.1979 2.65242 1.98701 3.04657 2.43461L5.78425 5.65824C6.14281 5.29523 6.51693 4.95924 6.90479 4.65114C8.88976 3.07437 11.2345 2.22803 13.6931 2.22803C16.9492 2.22803 20.0039 3.71718 22.2917 6.41142C22.5702 6.74282 22.5702 7.22916 22.2917 7.56056C20.0039 10.2591 16.9492 11.744 13.6931 11.744C11.2348 11.744 8.89035 10.8948 6.90554 9.31995C6.51741 9.01199 6.14304 8.67628 5.78425 8.31374L3.04657 11.5374C2.72953 11.9075 2.18114 11.9505 1.81269 11.632C1.44852 11.3179 1.40568 10.7584 1.71844 10.3882ZM5.93026 10.4683C8.17161 12.2599 10.8546 13.25 13.6931 13.25C17.4881 13.25 21.019 11.4034 23.4447 8.52942C24.1873 7.64571 24.1843 6.31801 23.4397 5.43663C20.8944 2.43919 17.4337 0.722025 13.6931 0.722025C10.8555 0.722025 8.17194 1.70845 5.92952 3.50276L4.17682 1.43933C3.57943 0.760929 2.79325 0.630009 2.25286 0.662947C1.98116 0.679506 1.73125 0.736852 1.51895 0.811846C1.26839 0.900352 1.03017 1.02718 0.827835 1.20058C-0.165283 2.05903 -0.283916 3.561 0.574656 4.56345L2.63075 6.98445L0.568104 9.41623C-0.272133 10.4106 -0.166523 11.9125 0.827835 12.7714C1.81372 13.6243 3.34308 13.5062 4.19036 12.5171L5.93026 10.4683Z" fill="currentColor"/>
|
|
819
804
|
</svg>
|
|
820
|
-
`,
|
|
821
|
-
}(a), { iframeContainer: o, iframe:
|
|
822
|
-
|
|
805
|
+
`, i.setAttribute("aria-label", "Open Brainfish widget"), i.appendChild(s), v.initialize(i, s), i;
|
|
806
|
+
}(a), { iframeContainer: o, iframe: n } = function(e) {
|
|
807
|
+
const i = M("div", P, { id: P, "aria-live": "polite", "aria-hidden": "true" }), s = M("iframe", "trigger-iframe", { src: e, sandbox: "allow-scripts allow-same-origin allow-popups allow-forms", allow: "clipboard-write", role: "dialog" });
|
|
808
|
+
return i.appendChild(s), { iframeContainer: i, iframe: s };
|
|
809
|
+
}(t);
|
|
810
|
+
return r.appendChild(d), r.appendChild(o), { fragment: r, iframe: n };
|
|
823
811
|
}
|
|
824
|
-
const
|
|
825
|
-
const
|
|
812
|
+
const at = (a, t) => {
|
|
813
|
+
const r = de(a.overrides), d = ((o = a.overrides) == null ? void 0 : o.widgetHost) || "https://agent.brainfi.sh";
|
|
826
814
|
var o;
|
|
827
|
-
const { theme:
|
|
815
|
+
const { theme: n, settings: e } = t, i = `${d}/?widgetKey=${a.widgetKey}&themeParam=${ve(JSON.stringify(n))}&settingsParam=${ve(JSON.stringify(e))}`;
|
|
828
816
|
try {
|
|
829
|
-
if (
|
|
817
|
+
if (s = a.widgetKey, ye.has(s) || function(h) {
|
|
830
818
|
return !!document.getElementById(`trigger-button-${h}`);
|
|
831
819
|
}(a.widgetKey)) return;
|
|
832
|
-
|
|
833
|
-
const { fragment: l, iframe: u } =
|
|
820
|
+
et(t);
|
|
821
|
+
const { fragment: l, iframe: u } = rt(a.widgetKey, i), c = new AbortController(), { signal: f } = c;
|
|
834
822
|
u.onload = () => {
|
|
835
823
|
setTimeout(() => {
|
|
836
|
-
|
|
824
|
+
tt(u, f), Re({ widgetHost: d, apiHost: r, widgetKey: a.widgetKey, signal: f }), nt(u, f), ((h) => {
|
|
825
|
+
if (h.contentWindow) for (; K.length > 0; ) {
|
|
826
|
+
const p = K.shift();
|
|
827
|
+
p && h.contentWindow.postMessage({ type: "IDENTIFY_DATA", data: p.detail }, "*");
|
|
828
|
+
}
|
|
829
|
+
})(u);
|
|
837
830
|
}, 0);
|
|
838
831
|
}, document.body.appendChild(l), ye.add(a.widgetKey);
|
|
839
832
|
const g = () => {
|
|
840
833
|
c.abort(), window.removeEventListener("beforeunload", g);
|
|
841
834
|
};
|
|
842
|
-
return
|
|
835
|
+
return window.addEventListener("beforeunload", g), void window.addEventListener("brainfish:identify", (h) => {
|
|
836
|
+
const p = h;
|
|
837
|
+
u.contentWindow ? u.contentWindow.postMessage({ type: "IDENTIFY_DATA", data: p.detail }, "*") : K.push(p);
|
|
838
|
+
});
|
|
843
839
|
} catch (l) {
|
|
844
840
|
(function(u, c, f) {
|
|
845
841
|
x(u, c, c.message, f);
|
|
846
|
-
})(
|
|
842
|
+
})(r, l, a.widgetKey);
|
|
847
843
|
}
|
|
848
|
-
var
|
|
844
|
+
var s;
|
|
849
845
|
};
|
|
850
|
-
let
|
|
851
|
-
const we = typeof window != "undefined" && window.Brainfish ? window.Brainfish : (
|
|
846
|
+
let T = null;
|
|
847
|
+
const we = typeof window != "undefined" && window.Brainfish ? window.Brainfish : (T || (T = /* @__PURE__ */ function() {
|
|
852
848
|
let a = [], t = null;
|
|
853
|
-
function
|
|
849
|
+
function r(o, n) {
|
|
854
850
|
if (t) {
|
|
855
851
|
const e = o.split(".");
|
|
856
|
-
let
|
|
857
|
-
for (let l = 0; l < e.length - 1; l++)
|
|
858
|
-
const
|
|
859
|
-
if (typeof
|
|
860
|
-
} else a.push([o,
|
|
852
|
+
let i = t;
|
|
853
|
+
for (let l = 0; l < e.length - 1; l++) i = i[e[l]];
|
|
854
|
+
const s = i[e[e.length - 1]];
|
|
855
|
+
if (typeof s == "function") return s.apply(i, n);
|
|
856
|
+
} else a.push([o, n]);
|
|
861
857
|
}
|
|
862
858
|
return { Widgets: { init: function() {
|
|
863
|
-
for (var o = arguments.length,
|
|
864
|
-
return
|
|
859
|
+
for (var o = arguments.length, n = new Array(o), e = 0; e < o; e++) n[e] = arguments[e];
|
|
860
|
+
return r("Widgets.init", n);
|
|
865
861
|
} }, SearchWidget: { initStandard: function() {
|
|
866
|
-
for (var o = arguments.length,
|
|
867
|
-
return
|
|
862
|
+
for (var o = arguments.length, n = new Array(o), e = 0; e < o; e++) n[e] = arguments[e];
|
|
863
|
+
return r("SearchWidget.initStandard", n);
|
|
868
864
|
} }, HelpWidget: { initPopup: function() {
|
|
869
|
-
for (var o = arguments.length,
|
|
870
|
-
return
|
|
865
|
+
for (var o = arguments.length, n = new Array(o), e = 0; e < o; e++) n[e] = arguments[e];
|
|
866
|
+
return r("HelpWidget.initPopup", n);
|
|
871
867
|
}, close: function() {
|
|
872
|
-
for (var o = arguments.length,
|
|
873
|
-
return
|
|
868
|
+
for (var o = arguments.length, n = new Array(o), e = 0; e < o; e++) n[e] = arguments[e];
|
|
869
|
+
return r("HelpWidget.close", n);
|
|
874
870
|
}, open: function() {
|
|
875
|
-
for (var o = arguments.length,
|
|
876
|
-
return
|
|
871
|
+
for (var o = arguments.length, n = new Array(o), e = 0; e < o; e++) n[e] = arguments[e];
|
|
872
|
+
return r("HelpWidget.open", n);
|
|
877
873
|
}, toggle: function() {
|
|
878
|
-
for (var o = arguments.length,
|
|
879
|
-
return
|
|
874
|
+
for (var o = arguments.length, n = new Array(o), e = 0; e < o; e++) n[e] = arguments[e];
|
|
875
|
+
return r("HelpWidget.toggle", n);
|
|
880
876
|
} }, _setRealBrainfish: function(o) {
|
|
881
877
|
for (t = o; a.length > 0; ) {
|
|
882
|
-
const [
|
|
883
|
-
n
|
|
878
|
+
const [n, e] = a.shift();
|
|
879
|
+
r(n, e);
|
|
884
880
|
}
|
|
885
881
|
} };
|
|
886
|
-
}(), typeof window != "undefined" && (window.Brainfish =
|
|
882
|
+
}(), typeof window != "undefined" && (window.Brainfish = T)), T);
|
|
887
883
|
let D = null;
|
|
888
884
|
we.Widgets.init = (a) => m(void 0, null, function* () {
|
|
889
885
|
window && (window.BrainfishAnalytics = window.BrainfishAnalytics || function() {
|
|
890
|
-
for (var
|
|
886
|
+
for (var n = arguments.length, e = new Array(n), i = 0; i < n; i++) e[i] = arguments[i];
|
|
891
887
|
(window.BrainfishAnalytics.q = window.BrainfishAnalytics.q || []).push(e);
|
|
892
888
|
});
|
|
893
|
-
const t = de(a.overrides),
|
|
894
|
-
var
|
|
889
|
+
const t = de(a.overrides), r = ((d = a.overrides) == null ? void 0 : d.analyticsApiHost) || "";
|
|
890
|
+
var d;
|
|
895
891
|
let o;
|
|
896
|
-
if (a.config) o = JSON.parse(((
|
|
892
|
+
if (a.config) o = JSON.parse(((n) => {
|
|
897
893
|
if (typeof window != "undefined" && typeof window.atob == "function") {
|
|
898
|
-
const e = atob(
|
|
899
|
-
for (let l = 0; l <
|
|
900
|
-
return new TextDecoder().decode(
|
|
894
|
+
const e = atob(n), i = e.length, s = new Uint8Array(i);
|
|
895
|
+
for (let l = 0; l < i; l++) s[l] = e.charCodeAt(l);
|
|
896
|
+
return new TextDecoder().decode(s);
|
|
901
897
|
}
|
|
902
|
-
if (typeof Buffer != "undefined") return Buffer.from(
|
|
898
|
+
if (typeof Buffer != "undefined") return Buffer.from(n, "base64").toString("utf-8");
|
|
903
899
|
throw new Error("[utils.base64Decode]: Unsupported environment");
|
|
904
900
|
})(a.config));
|
|
905
901
|
else {
|
|
906
|
-
const { config:
|
|
907
|
-
o =
|
|
902
|
+
const { config: n } = yield De({ widgetKey: a.widgetKey, apiHost: t });
|
|
903
|
+
o = n;
|
|
908
904
|
}
|
|
909
|
-
D || (D = function(
|
|
905
|
+
D || (D = function(n, e, i, s) {
|
|
910
906
|
return m(this, null, function* () {
|
|
911
907
|
var l, u, c;
|
|
912
|
-
const f = ((l =
|
|
913
|
-
g != null && g.startsWith("2.") ?
|
|
908
|
+
const f = ((l = n.overrides) === null || l === void 0 ? void 0 : l.enableRecording) || (e == null || (u = e.settings) === null || u === void 0 ? void 0 : u.enableRecording) || !1, g = ((c = n.overrides) === null || c === void 0 ? void 0 : c.version) || (e == null ? void 0 : e.version), h = [];
|
|
909
|
+
g != null && g.startsWith("2.") ? at(n, e) : h.push(ze(n, e)), h.push(qe(n.widgetKey, e.trackingToken || "", i, s, f));
|
|
914
910
|
const [p] = yield Promise.allSettled(h);
|
|
915
911
|
p && p.status === "fulfilled" && p.value && we._setRealBrainfish(p.value);
|
|
916
912
|
});
|
|
917
|
-
}(a, o, t,
|
|
913
|
+
}(a, o, t, r)), yield D;
|
|
918
914
|
});
|
|
919
|
-
const
|
|
915
|
+
const it = function() {
|
|
920
916
|
typeof window != "undefined" && window.BrainfishAnalytics && window.BrainfishAnalytics(...arguments);
|
|
921
917
|
};
|
|
922
918
|
export {
|
|
923
|
-
|
|
919
|
+
it as BrainfishAnalytics,
|
|
924
920
|
we as default
|
|
925
921
|
};
|
|
926
922
|
//# sourceMappingURL=web.js.map
|