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