@brainfish-ai/widgets-initiator 1.4.0-alpha.2 → 1.4.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/types/initIframeTrigger/components/IframeContainer.d.ts +5 -0
- package/dist/types/initIframeTrigger/components/TriggerButton.d.ts +1 -0
- package/dist/types/initIframeTrigger/constants/classes.d.ts +2 -0
- package/dist/types/initIframeTrigger/index.d.ts +0 -1
- package/dist/types/initIframeTrigger/listeners/initBodyResizeObserver.d.ts +1 -0
- package/dist/types/initIframeTrigger/listeners/initMessageListener.d.ts +1 -0
- package/dist/types/initIframeTrigger/listeners/observeColorSchemeChanges.d.ts +1 -0
- package/dist/types/initIframeTrigger/managers/IframeStateManager.d.ts +10 -0
- package/dist/types/initIframeTrigger/utils/insertStyles.d.ts +2 -0
- package/dist/web.cjs.js +11 -11
- package/dist/web.cjs.js.map +1 -1
- package/dist/web.js +478 -432
- package/dist/web.js.map +1 -1
- package/package.json +1 -1
- package/dist/types/initIframeTrigger/insertStyles.d.ts +0 -1
package/dist/web.js
CHANGED
|
@@ -1,47 +1,47 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
for (var
|
|
7
|
-
|
|
8
|
-
if (
|
|
9
|
-
for (var
|
|
10
|
-
$e.call(t,
|
|
1
|
+
var Be = Object.defineProperty, Fe = Object.defineProperties;
|
|
2
|
+
var Le = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var pe = Object.getOwnPropertySymbols;
|
|
4
|
+
var Te = Object.prototype.hasOwnProperty, $e = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var L = (a, t, n) => t in a ? Be(a, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : a[t] = n, T = (a, t) => {
|
|
6
|
+
for (var n in t || (t = {}))
|
|
7
|
+
Te.call(t, n) && L(a, n, t[n]);
|
|
8
|
+
if (pe)
|
|
9
|
+
for (var n of pe(t))
|
|
10
|
+
$e.call(t, n) && L(a, n, t[n]);
|
|
11
11
|
return a;
|
|
12
|
-
},
|
|
13
|
-
var
|
|
14
|
-
var
|
|
15
|
-
var
|
|
12
|
+
}, $ = (a, t) => Fe(a, Le(t));
|
|
13
|
+
var S = (a, t, n) => L(a, typeof t != "symbol" ? t + "" : t, n);
|
|
14
|
+
var m = (a, t, n) => new Promise((i, o) => {
|
|
15
|
+
var r = (s) => {
|
|
16
16
|
try {
|
|
17
|
-
|
|
18
|
-
} catch (
|
|
19
|
-
o(
|
|
17
|
+
u(n.next(s));
|
|
18
|
+
} catch (l) {
|
|
19
|
+
o(l);
|
|
20
20
|
}
|
|
21
21
|
}, e = (s) => {
|
|
22
22
|
try {
|
|
23
|
-
|
|
24
|
-
} catch (
|
|
25
|
-
o(
|
|
23
|
+
u(n.throw(s));
|
|
24
|
+
} catch (l) {
|
|
25
|
+
o(l);
|
|
26
26
|
}
|
|
27
|
-
},
|
|
28
|
-
|
|
27
|
+
}, u = (s) => s.done ? i(s.value) : Promise.resolve(s.value).then(r, e);
|
|
28
|
+
u((n = n.apply(a, t)).next());
|
|
29
29
|
});
|
|
30
|
-
var
|
|
30
|
+
var k, z;
|
|
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] = "52c6e1d3-d916-4a77-9618-d7c072224b32", a._sentryDebugIdIdentifier = "sentry-dbid-52c6e1d3-d916-4a77-9618-d7c072224b32");
|
|
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: "7028da603df62f0b0587e92a9047f179a3c96188" }, function(a) {
|
|
38
38
|
a.Sidebar = "sidebar", a.Searchbar = "searchbar";
|
|
39
|
-
}(
|
|
40
|
-
class
|
|
41
|
-
constructor(
|
|
42
|
-
super(
|
|
43
|
-
|
|
44
|
-
this.name = "BrainfishWidgetError", this.cause =
|
|
39
|
+
}(k || (k = {})), k.Sidebar, k.Searchbar;
|
|
40
|
+
class ie extends Error {
|
|
41
|
+
constructor(n, i) {
|
|
42
|
+
super(n, i);
|
|
43
|
+
S(this, "cause");
|
|
44
|
+
this.name = "BrainfishWidgetError", this.cause = i == null ? void 0 : i.cause, Error.captureStackTrace && Error.captureStackTrace(this, ie), this.cause instanceof Error && this.cause.stack && (this.stack = this.stack + `
|
|
45
45
|
Caused by: ` + this.cause.stack);
|
|
46
46
|
}
|
|
47
47
|
toJSON() {
|
|
@@ -50,194 +50,234 @@ 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
|
|
55
|
-
let o =
|
|
53
|
+
})(z || (z = {}));
|
|
54
|
+
const x = (a, t, n, i) => {
|
|
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,
|
|
62
|
+
((e, u, s) => {
|
|
63
63
|
if (!navigator || navigator.userAgent.toLowerCase().includes("headless")) return;
|
|
64
|
-
const
|
|
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.4.0-
|
|
66
|
-
})(a, new
|
|
67
|
-
},
|
|
68
|
-
let { widgetKey: t, apiHost:
|
|
69
|
-
return function(
|
|
70
|
-
return
|
|
71
|
-
let e,
|
|
72
|
-
for (;
|
|
73
|
-
const s = yield fetch(`${
|
|
64
|
+
const l = u.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.4.0-beta.1. ${u.message}`, stack: u.stack, cause: { message: l.message, stack: l.stack, cause: l.cause } }) });
|
|
66
|
+
})(a, new ie(o, { cause: r }), i);
|
|
67
|
+
}, We = (a) => m(void 0, null, function* () {
|
|
68
|
+
let { widgetKey: t, apiHost: n } = a;
|
|
69
|
+
return function(i, o, r) {
|
|
70
|
+
return m(this, null, function* () {
|
|
71
|
+
let e, u = 0;
|
|
72
|
+
for (; u < 3; ) try {
|
|
73
|
+
const s = yield fetch(`${i}${o}`, { method: "POST", headers: { "Content-Type": "application/json", "api-key": r } });
|
|
74
74
|
if (!s.ok) throw new Error(`API call failed with status: ${s.status}`);
|
|
75
|
-
const
|
|
76
|
-
if (!
|
|
77
|
-
return
|
|
75
|
+
const l = yield s.json();
|
|
76
|
+
if (!l) throw new Error("Error loading config: empty response");
|
|
77
|
+
return l;
|
|
78
78
|
} catch (s) {
|
|
79
|
-
if (e = s,
|
|
80
|
-
yield new Promise((
|
|
79
|
+
if (e = s, u++, u >= 3) throw x(i, s, "Error fetching config", r), e;
|
|
80
|
+
yield new Promise((l) => setTimeout(l, 500));
|
|
81
81
|
}
|
|
82
82
|
});
|
|
83
|
-
}(
|
|
83
|
+
}(n, "/api/searchWidgets.getConfigByKey", t);
|
|
84
84
|
}), Ke = (a) => {
|
|
85
|
-
let { config: t, apiKey:
|
|
85
|
+
let { config: t, apiKey: n, apiHost: i } = a;
|
|
86
86
|
const o = t.settings || {};
|
|
87
|
-
return ["bodyActionButtons", "footerActionButtons", "nextBestActions"].forEach((
|
|
88
|
-
o[
|
|
89
|
-
}),
|
|
90
|
-
},
|
|
87
|
+
return ["bodyActionButtons", "footerActionButtons", "nextBestActions"].forEach((r) => {
|
|
88
|
+
o[r] && (o[r] = o[r].map((e) => e.type === z.CALLBACK && e.value ? $(T({}, e), { value: new Function(`return ${e.value}`)() }) : e));
|
|
89
|
+
}), $(T({}, t), { settings: o, apiHost: i, widgetMode: t.widgetType, apiKey: n });
|
|
90
|
+
}, se = (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
|
+
})(), ze = (a) => m(void 0, null, function* () {
|
|
97
|
+
let { apiHost: t, widgetKey: n, version: i } = 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((s,
|
|
102
|
-
const
|
|
103
|
-
|
|
99
|
+
const o = `https://cdn.jsdelivr.net/npm/@brainfish-ai/search-widget@${i}/dist/web.js`, r = W ? o.replace("web.js", "web.umd.js") : o;
|
|
100
|
+
return { widget: yield ((u) => m(void 0, null, function* () {
|
|
101
|
+
return document.getElementById("brainfish-widget") ? window.Brainfish : new Promise((s, l) => {
|
|
102
|
+
const d = document.createElement("script");
|
|
103
|
+
d.id = "brainfish-widget", d.src = u, d.type = W ? "text/javascript" : "module", d.async = !0, d.crossOrigin = "anonymous", d.onload = () => {
|
|
104
104
|
setTimeout(() => {
|
|
105
105
|
const c = window.Brainfish;
|
|
106
|
-
c ? s(c) :
|
|
106
|
+
c ? s(c) : l(new Error("Failed to load Brainfish module"));
|
|
107
107
|
}, 200);
|
|
108
|
-
},
|
|
109
|
-
const f = c, h = { message: `Failed to load script: ${
|
|
110
|
-
|
|
111
|
-
},
|
|
108
|
+
}, d.onerror = (c) => {
|
|
109
|
+
const f = c, h = { message: `Failed to load script: ${u}`, type: f.type, fileName: f.filename, lineNumber: f.lineno, columnNumber: f.colno, error: f.error ? f.error.toString() : "Unknown error" };
|
|
110
|
+
l(new Error(JSON.stringify(h)));
|
|
111
|
+
}, W || document.head.appendChild(d);
|
|
112
112
|
});
|
|
113
|
-
}))(
|
|
113
|
+
}))(r) };
|
|
114
114
|
} catch (o) {
|
|
115
|
-
|
|
115
|
+
x(t, o, o.message, n);
|
|
116
116
|
}
|
|
117
|
-
}),
|
|
118
|
-
const
|
|
117
|
+
}), ge = /* @__PURE__ */ new Set(), He = (a, t) => m(void 0, null, function* () {
|
|
118
|
+
const n = se(a.overrides);
|
|
119
119
|
try {
|
|
120
|
-
if (
|
|
121
|
-
const
|
|
122
|
-
if (
|
|
123
|
-
const { widget: o } =
|
|
120
|
+
if (ge.has(a.widgetKey)) return;
|
|
121
|
+
const i = yield ze({ apiHost: n, widgetKey: a.widgetKey, version: t.version || "latest" });
|
|
122
|
+
if (i) {
|
|
123
|
+
const { widget: o } = i, r = Ke({ config: t, apiKey: a.widgetKey, apiHost: n });
|
|
124
124
|
return a.overrides && t.settings && Object.entries(a.overrides).forEach((e) => {
|
|
125
|
-
let [
|
|
126
|
-
t.settings &&
|
|
127
|
-
let
|
|
128
|
-
const
|
|
129
|
-
return
|
|
130
|
-
}(t.settings[
|
|
131
|
-
}), function(e,
|
|
132
|
-
|
|
133
|
-
}(o,
|
|
125
|
+
let [u, s] = e;
|
|
126
|
+
t.settings && u in t.settings && (t.settings[u] = function() {
|
|
127
|
+
let l = arguments.length > 1 ? arguments[1] : void 0;
|
|
128
|
+
const d = new Map((arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : []).map((c) => [c.label, c]));
|
|
129
|
+
return l.forEach((c) => d.set(c.label, c)), Array.from(d.values());
|
|
130
|
+
}(t.settings[u], s));
|
|
131
|
+
}), function(e, u) {
|
|
132
|
+
u.widgetType === k.Searchbar || u.widgetType === "Search" ? e.SearchWidget.initStandard(u) : e.HelpWidget.initPopup(u);
|
|
133
|
+
}(o, r), ge.add(a.widgetKey), o;
|
|
134
134
|
}
|
|
135
|
-
} catch (
|
|
136
|
-
|
|
135
|
+
} catch (i) {
|
|
136
|
+
x(n, i, i.message, a.widgetKey);
|
|
137
137
|
}
|
|
138
138
|
});
|
|
139
|
-
let
|
|
140
|
-
const
|
|
141
|
-
return
|
|
142
|
-
let e = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : void 0,
|
|
143
|
-
if (t ||
|
|
144
|
-
window.BrainfishAnalytics("init", { apiUrl: e, accessKey: t, trackScreenViews: !0, trackAttributes: !0, trackOutgoingLinks: !0, enableRecording:
|
|
139
|
+
let he = !1;
|
|
140
|
+
const qe = function(i, o, r) {
|
|
141
|
+
return m(this, arguments, function* (a, t, n) {
|
|
142
|
+
let e = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : void 0, u = arguments.length > 4 && arguments[4] !== void 0 && arguments[4];
|
|
143
|
+
if (t || x(n, new Error("Access key is required"), "Access key is required", a), !he) try {
|
|
144
|
+
window.BrainfishAnalytics("init", { apiUrl: e, accessKey: t, trackScreenViews: !0, trackAttributes: !0, trackOutgoingLinks: !0, enableRecording: u }), he = !0, yield ((s, l) => m(this, null, function* () {
|
|
145
145
|
if (document.getElementById("brainfish-analytics")) return window.BrainfishAnalytics;
|
|
146
|
-
const
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
}, document.head.appendChild(
|
|
150
|
-
}))(
|
|
146
|
+
const d = document.createElement("script");
|
|
147
|
+
d.id = "brainfish-analytics", d.src = "https://cdn.jsdelivr.net/npm/@brainfish-ai/web-tracker@latest/dist/tracker.js", d.type = "module", d.async = !0, d.crossOrigin = "anonymous", d.onerror = () => {
|
|
148
|
+
x(s, new Error(`Failed to load script: ${d.src}`), `Failed to load script: ${d.src}`, l);
|
|
149
|
+
}, document.head.appendChild(d);
|
|
150
|
+
}))(n, a);
|
|
151
151
|
} catch (s) {
|
|
152
|
-
|
|
152
|
+
x(n, s, "Failed to initialize BrainfishAnalytics", a);
|
|
153
153
|
}
|
|
154
154
|
});
|
|
155
155
|
};
|
|
156
|
-
function
|
|
157
|
-
let
|
|
158
|
-
const
|
|
159
|
-
return
|
|
160
|
-
let [
|
|
161
|
-
|
|
162
|
-
}),
|
|
156
|
+
function I(a, t) {
|
|
157
|
+
let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
|
|
158
|
+
const i = document.createElement(a);
|
|
159
|
+
return i.className = t, Object.entries(n).forEach((o) => {
|
|
160
|
+
let [r, e] = o;
|
|
161
|
+
i.setAttribute(r, e);
|
|
162
|
+
}), i;
|
|
163
163
|
}
|
|
164
|
-
|
|
164
|
+
const B = "bf-iframe-container", F = "bf-trigger-button";
|
|
165
|
+
class v {
|
|
166
|
+
static get isWidgetOpen() {
|
|
167
|
+
return this.isOpen;
|
|
168
|
+
}
|
|
169
|
+
static initialize(t, n) {
|
|
170
|
+
this.button = t, this.icon = n, t.addEventListener("click", () => this.toggleIframeVisibility());
|
|
171
|
+
}
|
|
172
|
+
static toggleIframeVisibility() {
|
|
173
|
+
if (!this.button || !this.icon) return;
|
|
174
|
+
this.isOpen = !this.isOpen;
|
|
175
|
+
const t = this.icon.querySelector(".fish-icon"), n = this.icon.querySelector(".close-icon"), i = document.querySelector(".bf-iframe-container"), o = i == null ? void 0 : i.querySelector("iframe");
|
|
176
|
+
var r;
|
|
177
|
+
this.isOpen ? (i == null || i.classList.add("open"), i == null || i.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 <= 768 && this.hideTriggerButton()) : (i == null || i.classList.remove("open"), i == null || i.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"));
|
|
178
|
+
}
|
|
179
|
+
static showTriggerButton() {
|
|
180
|
+
var t;
|
|
181
|
+
(t = this.button) === null || t === void 0 || t.classList.remove("hidden");
|
|
182
|
+
}
|
|
183
|
+
static hideTriggerButton() {
|
|
184
|
+
var t;
|
|
185
|
+
(t = this.button) === null || t === void 0 || t.classList.add("hidden");
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
S(v, "isOpen", !1), S(v, "button", null), S(v, "icon", null);
|
|
189
|
+
function Re(a, t) {
|
|
190
|
+
window.addEventListener("message", (n) => {
|
|
191
|
+
if (n.origin !== a) return;
|
|
192
|
+
const { type: i } = n.data;
|
|
193
|
+
if (i === "TOGGLE_WIDGET_SIZE" && function() {
|
|
194
|
+
const o = document.querySelector(`.${B}`);
|
|
195
|
+
o.classList.contains("expanded") ? o.classList.remove("expanded") : o.classList.add("expanded");
|
|
196
|
+
}(), i === "TRACK_EVENT") {
|
|
197
|
+
if (!window.BrainfishAnalytics) return;
|
|
198
|
+
const { eventName: o, data: r } = n.data;
|
|
199
|
+
window.BrainfishAnalytics("track", o, r);
|
|
200
|
+
}
|
|
201
|
+
i === "CLOSE_WIDGET" && (window.BrainfishAnalytics("track", "Close Widget"), v.toggleIframeVisibility());
|
|
202
|
+
}, { signal: t });
|
|
203
|
+
}
|
|
204
|
+
function le(a) {
|
|
165
205
|
return a && a.__esModule && Object.prototype.hasOwnProperty.call(a, "default") ? a.default : a;
|
|
166
206
|
}
|
|
167
|
-
var
|
|
207
|
+
var H = { exports: {} }, q = { exports: {} }, R = { exports: {} };
|
|
168
208
|
(function(a, t) {
|
|
169
|
-
function
|
|
209
|
+
function n(o) {
|
|
170
210
|
return Math.round(255 * o);
|
|
171
211
|
}
|
|
172
|
-
function
|
|
173
|
-
return
|
|
212
|
+
function i(o, r, e) {
|
|
213
|
+
return n(o) + "," + n(r) + "," + n(e);
|
|
174
214
|
}
|
|
175
|
-
t.__esModule = !0, t.default = void 0, t.default = function(o,
|
|
176
|
-
if (
|
|
177
|
-
var s = (o % 360 + 360) % 360 / 60,
|
|
178
|
-
s >= 0 && s < 1 ? (c =
|
|
179
|
-
var g = e -
|
|
180
|
-
return
|
|
215
|
+
t.__esModule = !0, t.default = void 0, t.default = function(o, r, e, u) {
|
|
216
|
+
if (u === void 0 && (u = i), r === 0) return u(e, e, e);
|
|
217
|
+
var s = (o % 360 + 360) % 360 / 60, l = (1 - Math.abs(2 * e - 1)) * r, d = l * (1 - Math.abs(s % 2 - 1)), c = 0, f = 0, h = 0;
|
|
218
|
+
s >= 0 && s < 1 ? (c = l, f = d) : s >= 1 && s < 2 ? (c = d, f = l) : s >= 2 && s < 3 ? (f = l, h = d) : s >= 3 && s < 4 ? (f = d, h = l) : s >= 4 && s < 5 ? (c = d, h = l) : s >= 5 && s < 6 && (c = l, h = d);
|
|
219
|
+
var g = e - l / 2;
|
|
220
|
+
return u(c + g, f + g, h + g);
|
|
181
221
|
}, a.exports = t.default;
|
|
182
|
-
})(
|
|
183
|
-
var
|
|
222
|
+
})(R, R.exports);
|
|
223
|
+
var ue = R.exports, D = { exports: {} };
|
|
184
224
|
(function(a, t) {
|
|
185
225
|
t.__esModule = !0, t.default = void 0;
|
|
186
|
-
var
|
|
187
|
-
t.default = function(
|
|
188
|
-
if (typeof
|
|
189
|
-
var o =
|
|
190
|
-
return
|
|
226
|
+
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" };
|
|
227
|
+
t.default = function(i) {
|
|
228
|
+
if (typeof i != "string") return i;
|
|
229
|
+
var o = i.toLowerCase();
|
|
230
|
+
return n[o] ? "#" + n[o] : i;
|
|
191
231
|
}, a.exports = t.default;
|
|
192
|
-
})(
|
|
193
|
-
var
|
|
232
|
+
})(D, D.exports);
|
|
233
|
+
var De = D.exports, N = { exports: {} };
|
|
194
234
|
(function(a, t) {
|
|
195
|
-
function
|
|
196
|
-
var
|
|
197
|
-
return
|
|
198
|
-
if (
|
|
235
|
+
function n(s) {
|
|
236
|
+
var l = typeof Map == "function" ? /* @__PURE__ */ new Map() : void 0;
|
|
237
|
+
return n = function(d) {
|
|
238
|
+
if (d === null || !function(f) {
|
|
199
239
|
try {
|
|
200
240
|
return Function.toString.call(f).indexOf("[native code]") !== -1;
|
|
201
241
|
} catch (h) {
|
|
202
242
|
return typeof f == "function";
|
|
203
243
|
}
|
|
204
|
-
}(
|
|
205
|
-
if (typeof
|
|
206
|
-
if (
|
|
207
|
-
if (
|
|
208
|
-
|
|
244
|
+
}(d)) return d;
|
|
245
|
+
if (typeof d != "function") throw new TypeError("Super expression must either be null or a function");
|
|
246
|
+
if (l !== void 0) {
|
|
247
|
+
if (l.has(d)) return l.get(d);
|
|
248
|
+
l.set(d, c);
|
|
209
249
|
}
|
|
210
250
|
function c() {
|
|
211
251
|
return function(f, h, g) {
|
|
212
|
-
if (
|
|
252
|
+
if (i()) return Reflect.construct.apply(null, arguments);
|
|
213
253
|
var p = [null];
|
|
214
254
|
p.push.apply(p, h);
|
|
215
|
-
var
|
|
216
|
-
return g && o(
|
|
217
|
-
}(
|
|
255
|
+
var b = new (f.bind.apply(f, p))();
|
|
256
|
+
return g && o(b, g.prototype), b;
|
|
257
|
+
}(d, arguments, r(this).constructor);
|
|
218
258
|
}
|
|
219
|
-
return c.prototype = Object.create(
|
|
220
|
-
},
|
|
259
|
+
return c.prototype = Object.create(d.prototype, { constructor: { value: c, enumerable: !1, writable: !0, configurable: !0 } }), o(c, d);
|
|
260
|
+
}, n(s);
|
|
221
261
|
}
|
|
222
|
-
function
|
|
262
|
+
function i() {
|
|
223
263
|
try {
|
|
224
264
|
var s = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
|
|
225
265
|
}));
|
|
226
|
-
} catch (
|
|
266
|
+
} catch (l) {
|
|
227
267
|
}
|
|
228
|
-
return (
|
|
268
|
+
return (i = function() {
|
|
229
269
|
return !!s;
|
|
230
270
|
})();
|
|
231
271
|
}
|
|
232
|
-
function o(s,
|
|
233
|
-
return o = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(
|
|
234
|
-
return
|
|
235
|
-
}, o(s,
|
|
272
|
+
function o(s, l) {
|
|
273
|
+
return o = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(d, c) {
|
|
274
|
+
return d.__proto__ = c, d;
|
|
275
|
+
}, o(s, l);
|
|
236
276
|
}
|
|
237
|
-
function
|
|
238
|
-
return
|
|
239
|
-
return
|
|
240
|
-
},
|
|
277
|
+
function r(s) {
|
|
278
|
+
return r = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(l) {
|
|
279
|
+
return l.__proto__ || Object.getPrototypeOf(l);
|
|
280
|
+
}, r(s);
|
|
241
281
|
}
|
|
242
282
|
t.__esModule = !0, t.default = void 0;
|
|
243
283
|
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 }).
|
|
@@ -389,436 +429,442 @@ To pass a single animation please supply them in simple values, e.g. animation('
|
|
|
389
429
|
|
|
390
430
|
`, 78: `base must be set in "px" or "%" but you set it in "%s".
|
|
391
431
|
` };
|
|
392
|
-
function
|
|
393
|
-
for (var s = arguments.length,
|
|
394
|
-
var c, f =
|
|
395
|
-
for (c = 1; c <
|
|
432
|
+
function u() {
|
|
433
|
+
for (var s = arguments.length, l = new Array(s), d = 0; d < s; d++) l[d] = arguments[d];
|
|
434
|
+
var c, f = l[0], h = [];
|
|
435
|
+
for (c = 1; c < l.length; c += 1) h.push(l[c]);
|
|
396
436
|
return h.forEach(function(g) {
|
|
397
437
|
f = f.replace(/%[a-z]/, g);
|
|
398
438
|
}), f;
|
|
399
439
|
}
|
|
400
440
|
t.default = function(s) {
|
|
401
|
-
var
|
|
441
|
+
var l, d;
|
|
402
442
|
function c(f) {
|
|
403
443
|
var h;
|
|
404
444
|
if (process.env.NODE_ENV === "production") h = s.call(this, "An error occurred. See https://github.com/styled-components/polished/blob/main/src/internalHelpers/errors.md#" + f + " for more information.") || this;
|
|
405
445
|
else {
|
|
406
|
-
for (var g = arguments.length, p = new Array(g > 1 ? g - 1 : 0),
|
|
407
|
-
h = s.call(this,
|
|
446
|
+
for (var g = arguments.length, p = new Array(g > 1 ? g - 1 : 0), b = 1; b < g; b++) p[b - 1] = arguments[b];
|
|
447
|
+
h = s.call(this, u.apply(void 0, [e[f]].concat(p))) || this;
|
|
408
448
|
}
|
|
409
|
-
return function(
|
|
410
|
-
if (
|
|
411
|
-
return
|
|
449
|
+
return function(C) {
|
|
450
|
+
if (C === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
451
|
+
return C;
|
|
412
452
|
}(h);
|
|
413
453
|
}
|
|
414
|
-
return
|
|
415
|
-
}(
|
|
416
|
-
})(
|
|
417
|
-
var
|
|
454
|
+
return d = s, (l = c).prototype = Object.create(d.prototype), l.prototype.constructor = l, o(l, d), c;
|
|
455
|
+
}(n(Error)), a.exports = t.default;
|
|
456
|
+
})(N, N.exports);
|
|
457
|
+
var _ = N.exports;
|
|
418
458
|
(function(a, t) {
|
|
419
459
|
t.__esModule = !0, t.default = function(g) {
|
|
420
460
|
if (typeof g != "string") throw new o.default(3);
|
|
421
|
-
var p = (0,
|
|
461
|
+
var p = (0, i.default)(g);
|
|
422
462
|
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) };
|
|
423
|
-
if (p.match(
|
|
424
|
-
var
|
|
425
|
-
return { red: parseInt("" + p[1] + p[2], 16), green: parseInt("" + p[3] + p[4], 16), blue: parseInt("" + p[5] + p[6], 16), alpha:
|
|
463
|
+
if (p.match(u)) {
|
|
464
|
+
var b = parseFloat((parseInt("" + p[7] + p[8], 16) / 255).toFixed(2));
|
|
465
|
+
return { red: parseInt("" + p[1] + p[2], 16), green: parseInt("" + p[3] + p[4], 16), blue: parseInt("" + p[5] + p[6], 16), alpha: b };
|
|
426
466
|
}
|
|
427
467
|
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) };
|
|
428
|
-
if (p.match(
|
|
429
|
-
var
|
|
430
|
-
return { red: parseInt("" + p[1] + p[1], 16), green: parseInt("" + p[2] + p[2], 16), blue: parseInt("" + p[3] + p[3], 16), alpha:
|
|
468
|
+
if (p.match(l)) {
|
|
469
|
+
var C = parseFloat((parseInt("" + p[4] + p[4], 16) / 255).toFixed(2));
|
|
470
|
+
return { red: parseInt("" + p[1] + p[1], 16), green: parseInt("" + p[2] + p[2], 16), blue: parseInt("" + p[3] + p[3], 16), alpha: C };
|
|
431
471
|
}
|
|
432
|
-
var
|
|
433
|
-
if (
|
|
434
|
-
var
|
|
435
|
-
if (
|
|
436
|
-
var
|
|
437
|
-
if (
|
|
438
|
-
var
|
|
439
|
-
if (!
|
|
440
|
-
return { red: parseInt("" +
|
|
472
|
+
var E = d.exec(p);
|
|
473
|
+
if (E) return { red: parseInt("" + E[1], 10), green: parseInt("" + E[2], 10), blue: parseInt("" + E[3], 10) };
|
|
474
|
+
var y = c.exec(p.substring(0, 50));
|
|
475
|
+
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]) };
|
|
476
|
+
var A = f.exec(p);
|
|
477
|
+
if (A) {
|
|
478
|
+
var Ae = parseInt("" + A[1], 10), Oe = parseInt("" + A[2], 10) / 100, Me = parseInt("" + A[3], 10) / 100, fe = "rgb(" + (0, n.default)(Ae, Oe, Me) + ")", O = d.exec(fe);
|
|
479
|
+
if (!O) throw new o.default(4, p, fe);
|
|
480
|
+
return { red: parseInt("" + O[1], 10), green: parseInt("" + O[2], 10), blue: parseInt("" + O[3], 10) };
|
|
441
481
|
}
|
|
442
|
-
var
|
|
443
|
-
if (
|
|
444
|
-
var
|
|
445
|
-
if (!
|
|
446
|
-
return { red: parseInt("" +
|
|
482
|
+
var w = h.exec(p.substring(0, 50));
|
|
483
|
+
if (w) {
|
|
484
|
+
var Ie = parseInt("" + w[1], 10), Pe = parseInt("" + w[2], 10) / 100, je = parseInt("" + w[3], 10) / 100, ce = "rgb(" + (0, n.default)(Ie, Pe, je) + ")", M = d.exec(ce);
|
|
485
|
+
if (!M) throw new o.default(4, p, ce);
|
|
486
|
+
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]) };
|
|
447
487
|
}
|
|
448
488
|
throw new o.default(5);
|
|
449
489
|
};
|
|
450
|
-
var
|
|
451
|
-
function
|
|
490
|
+
var n = r(ue), i = r(De), o = r(_);
|
|
491
|
+
function r(g) {
|
|
452
492
|
return g && g.__esModule ? g : { default: g };
|
|
453
493
|
}
|
|
454
|
-
var e = /^#[a-fA-F0-9]{6}$/,
|
|
494
|
+
var e = /^#[a-fA-F0-9]{6}$/, u = /^#[a-fA-F0-9]{8}$/, s = /^#[a-fA-F0-9]{3}$/, l = /^#[a-fA-F0-9]{4}$/, d = /^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, h = /^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;
|
|
455
495
|
a.exports = t.default;
|
|
456
|
-
})(
|
|
457
|
-
var
|
|
496
|
+
})(q, q.exports);
|
|
497
|
+
var de = q.exports;
|
|
458
498
|
(function(a, t) {
|
|
459
499
|
t.__esModule = !0, t.default = function(o) {
|
|
460
500
|
if (o === "transparent") return 0;
|
|
461
|
-
var
|
|
462
|
-
var c =
|
|
501
|
+
var r = (0, i.default)(o), e = Object.keys(r).map(function(d) {
|
|
502
|
+
var c = r[d] / 255;
|
|
463
503
|
return c <= 0.03928 ? c / 12.92 : Math.pow((c + 0.055) / 1.055, 2.4);
|
|
464
|
-
}),
|
|
465
|
-
return parseFloat((0.2126 *
|
|
504
|
+
}), u = e[0], s = e[1], l = e[2];
|
|
505
|
+
return parseFloat((0.2126 * u + 0.7152 * s + 0.0722 * l).toFixed(3));
|
|
466
506
|
};
|
|
467
|
-
var
|
|
507
|
+
var n, i = (n = de) && n.__esModule ? n : { default: n };
|
|
468
508
|
a.exports = t.default;
|
|
469
|
-
})(
|
|
470
|
-
const
|
|
471
|
-
var
|
|
509
|
+
})(H, H.exports);
|
|
510
|
+
const Ne = le(H.exports);
|
|
511
|
+
var Y = { exports: {} }, G = { exports: {} };
|
|
472
512
|
(function(a, t) {
|
|
473
|
-
function
|
|
513
|
+
function n(i, o, r) {
|
|
474
514
|
return function() {
|
|
475
|
-
var e =
|
|
476
|
-
return e.length >= o ?
|
|
515
|
+
var e = r.concat(Array.prototype.slice.call(arguments));
|
|
516
|
+
return e.length >= o ? i.apply(this, e) : n(i, o, e);
|
|
477
517
|
};
|
|
478
518
|
}
|
|
479
|
-
t.__esModule = !0, t.default = function(
|
|
480
|
-
return
|
|
519
|
+
t.__esModule = !0, t.default = function(i) {
|
|
520
|
+
return n(i, i.length, []);
|
|
481
521
|
}, a.exports = t.default;
|
|
482
|
-
})(
|
|
483
|
-
var
|
|
484
|
-
|
|
485
|
-
return Math.max(a, Math.min(t,
|
|
486
|
-
},
|
|
487
|
-
var
|
|
522
|
+
})(G, G.exports);
|
|
523
|
+
var me, P, ye = G.exports, V = { exports: {} };
|
|
524
|
+
me = V, (P = V.exports).__esModule = !0, P.default = void 0, P.default = function(a, t, n) {
|
|
525
|
+
return Math.max(a, Math.min(t, n));
|
|
526
|
+
}, me.exports = P.default;
|
|
527
|
+
var we = V.exports, J = { exports: {} }, U = { exports: {} };
|
|
488
528
|
(function(a, t) {
|
|
489
|
-
t.__esModule = !0, t.default = void 0, t.default = function(
|
|
490
|
-
var
|
|
491
|
-
if (
|
|
492
|
-
var
|
|
493
|
-
switch (
|
|
529
|
+
t.__esModule = !0, t.default = void 0, t.default = function(n) {
|
|
530
|
+
var i, o = n.red / 255, r = n.green / 255, e = n.blue / 255, u = Math.max(o, r, e), s = Math.min(o, r, e), l = (u + s) / 2;
|
|
531
|
+
if (u === s) return n.alpha !== void 0 ? { hue: 0, saturation: 0, lightness: l, alpha: n.alpha } : { hue: 0, saturation: 0, lightness: l };
|
|
532
|
+
var d = u - s, c = l > 0.5 ? d / (2 - u - s) : d / (u + s);
|
|
533
|
+
switch (u) {
|
|
494
534
|
case o:
|
|
495
|
-
|
|
535
|
+
i = (r - e) / d + (r < e ? 6 : 0);
|
|
496
536
|
break;
|
|
497
|
-
case
|
|
498
|
-
|
|
537
|
+
case r:
|
|
538
|
+
i = (e - o) / d + 2;
|
|
499
539
|
break;
|
|
500
540
|
default:
|
|
501
|
-
|
|
541
|
+
i = (o - r) / d + 4;
|
|
502
542
|
}
|
|
503
|
-
return
|
|
543
|
+
return i *= 60, n.alpha !== void 0 ? { hue: i, saturation: c, lightness: l, alpha: n.alpha } : { hue: i, saturation: c, lightness: l };
|
|
504
544
|
}, a.exports = t.default;
|
|
505
|
-
})(
|
|
506
|
-
var
|
|
545
|
+
})(U, U.exports);
|
|
546
|
+
var Ye = U.exports;
|
|
507
547
|
(function(a, t) {
|
|
508
|
-
t.__esModule = !0, t.default = function(
|
|
509
|
-
return (0,
|
|
548
|
+
t.__esModule = !0, t.default = function(r) {
|
|
549
|
+
return (0, i.default)((0, n.default)(r));
|
|
510
550
|
};
|
|
511
|
-
var
|
|
512
|
-
function o(
|
|
513
|
-
return
|
|
551
|
+
var n = o(de), i = o(Ye);
|
|
552
|
+
function o(r) {
|
|
553
|
+
return r && r.__esModule ? r : { default: r };
|
|
514
554
|
}
|
|
515
555
|
a.exports = t.default;
|
|
516
|
-
})(
|
|
517
|
-
var
|
|
556
|
+
})(J, J.exports);
|
|
557
|
+
var xe = J.exports, Z = { exports: {} }, Q = { exports: {} }, X = { exports: {} }, ee = { exports: {} };
|
|
518
558
|
(function(a, t) {
|
|
519
|
-
t.__esModule = !0, t.default = void 0, t.default = function(
|
|
520
|
-
return
|
|
559
|
+
t.__esModule = !0, t.default = void 0, t.default = function(n) {
|
|
560
|
+
return n.length === 7 && n[1] === n[2] && n[3] === n[4] && n[5] === n[6] ? "#" + n[1] + n[3] + n[5] : n;
|
|
521
561
|
}, a.exports = t.default;
|
|
522
|
-
})(
|
|
523
|
-
var
|
|
562
|
+
})(ee, ee.exports);
|
|
563
|
+
var _e = ee.exports, te = { exports: {} };
|
|
524
564
|
(function(a, t) {
|
|
525
|
-
t.__esModule = !0, t.default = void 0, t.default = function(
|
|
526
|
-
var
|
|
527
|
-
return
|
|
565
|
+
t.__esModule = !0, t.default = void 0, t.default = function(n) {
|
|
566
|
+
var i = n.toString(16);
|
|
567
|
+
return i.length === 1 ? "0" + i : i;
|
|
528
568
|
}, a.exports = t.default;
|
|
529
|
-
})(
|
|
530
|
-
var
|
|
569
|
+
})(te, te.exports);
|
|
570
|
+
var Se = te.exports;
|
|
531
571
|
(function(a, t) {
|
|
532
572
|
t.__esModule = !0, t.default = void 0;
|
|
533
|
-
var
|
|
534
|
-
function
|
|
573
|
+
var n = r(ue), i = r(_e), o = r(Se);
|
|
574
|
+
function r(s) {
|
|
535
575
|
return s && s.__esModule ? s : { default: s };
|
|
536
576
|
}
|
|
537
577
|
function e(s) {
|
|
538
578
|
return (0, o.default)(Math.round(255 * s));
|
|
539
579
|
}
|
|
540
|
-
function
|
|
541
|
-
return (0,
|
|
580
|
+
function u(s, l, d) {
|
|
581
|
+
return (0, i.default)("#" + e(s) + e(l) + e(d));
|
|
542
582
|
}
|
|
543
|
-
t.default = function(s,
|
|
544
|
-
return (0,
|
|
583
|
+
t.default = function(s, l, d) {
|
|
584
|
+
return (0, n.default)(s, l, d, u);
|
|
545
585
|
}, a.exports = t.default;
|
|
546
|
-
})(
|
|
547
|
-
var ke =
|
|
586
|
+
})(X, X.exports);
|
|
587
|
+
var ke = X.exports;
|
|
548
588
|
(function(a, t) {
|
|
549
|
-
t.__esModule = !0, t.default = function(
|
|
550
|
-
if (typeof
|
|
551
|
-
if (typeof
|
|
552
|
-
throw new
|
|
589
|
+
t.__esModule = !0, t.default = function(r, e, u) {
|
|
590
|
+
if (typeof r == "number" && typeof e == "number" && typeof u == "number") return (0, n.default)(r, e, u);
|
|
591
|
+
if (typeof r == "object" && e === void 0 && u === void 0) return (0, n.default)(r.hue, r.saturation, r.lightness);
|
|
592
|
+
throw new i.default(1);
|
|
553
593
|
};
|
|
554
|
-
var
|
|
555
|
-
function o(
|
|
556
|
-
return
|
|
594
|
+
var n = o(ke), i = o(_);
|
|
595
|
+
function o(r) {
|
|
596
|
+
return r && r.__esModule ? r : { default: r };
|
|
557
597
|
}
|
|
558
598
|
a.exports = t.default;
|
|
559
|
-
})(
|
|
560
|
-
var
|
|
599
|
+
})(Q, Q.exports);
|
|
600
|
+
var Ge = Q.exports, ne = { exports: {} };
|
|
561
601
|
(function(a, t) {
|
|
562
|
-
t.__esModule = !0, t.default = function(e,
|
|
563
|
-
if (typeof e == "number" && typeof
|
|
564
|
-
if (typeof e == "object" &&
|
|
602
|
+
t.__esModule = !0, t.default = function(e, u, s, l) {
|
|
603
|
+
if (typeof e == "number" && typeof u == "number" && typeof s == "number" && typeof l == "number") return l >= 1 ? (0, n.default)(e, u, s) : "rgba(" + (0, i.default)(e, u, s) + "," + l + ")";
|
|
604
|
+
if (typeof e == "object" && u === void 0 && s === void 0 && l === void 0) return e.alpha >= 1 ? (0, n.default)(e.hue, e.saturation, e.lightness) : "rgba(" + (0, i.default)(e.hue, e.saturation, e.lightness) + "," + e.alpha + ")";
|
|
565
605
|
throw new o.default(2);
|
|
566
606
|
};
|
|
567
|
-
var
|
|
568
|
-
function
|
|
607
|
+
var n = r(ke), i = r(ue), o = r(_);
|
|
608
|
+
function r(e) {
|
|
569
609
|
return e && e.__esModule ? e : { default: e };
|
|
570
610
|
}
|
|
571
611
|
a.exports = t.default;
|
|
572
|
-
})(
|
|
573
|
-
var
|
|
612
|
+
})(ne, ne.exports);
|
|
613
|
+
var Ve = ne.exports, re = { exports: {} };
|
|
574
614
|
(function(a, t) {
|
|
575
|
-
t.__esModule = !0, t.default = function(e,
|
|
576
|
-
if (typeof e == "number" && typeof
|
|
577
|
-
if (typeof e == "object" &&
|
|
615
|
+
t.__esModule = !0, t.default = function(e, u, s) {
|
|
616
|
+
if (typeof e == "number" && typeof u == "number" && typeof s == "number") return (0, n.default)("#" + (0, i.default)(e) + (0, i.default)(u) + (0, i.default)(s));
|
|
617
|
+
if (typeof e == "object" && u === void 0 && s === void 0) return (0, n.default)("#" + (0, i.default)(e.red) + (0, i.default)(e.green) + (0, i.default)(e.blue));
|
|
578
618
|
throw new o.default(6);
|
|
579
619
|
};
|
|
580
|
-
var
|
|
581
|
-
function
|
|
620
|
+
var n = r(_e), i = r(Se), o = r(_);
|
|
621
|
+
function r(e) {
|
|
582
622
|
return e && e.__esModule ? e : { default: e };
|
|
583
623
|
}
|
|
584
624
|
a.exports = t.default;
|
|
585
|
-
})(
|
|
586
|
-
var
|
|
625
|
+
})(re, re.exports);
|
|
626
|
+
var Ce = re.exports, ae = { exports: {} };
|
|
587
627
|
(function(a, t) {
|
|
588
|
-
t.__esModule = !0, t.default = function(e,
|
|
589
|
-
if (typeof e == "string" && typeof
|
|
590
|
-
var
|
|
591
|
-
return "rgba(" +
|
|
628
|
+
t.__esModule = !0, t.default = function(e, u, s, l) {
|
|
629
|
+
if (typeof e == "string" && typeof u == "number") {
|
|
630
|
+
var d = (0, n.default)(e);
|
|
631
|
+
return "rgba(" + d.red + "," + d.green + "," + d.blue + "," + u + ")";
|
|
592
632
|
}
|
|
593
|
-
if (typeof e == "number" && typeof
|
|
594
|
-
if (typeof e == "object" &&
|
|
633
|
+
if (typeof e == "number" && typeof u == "number" && typeof s == "number" && typeof l == "number") return l >= 1 ? (0, i.default)(e, u, s) : "rgba(" + e + "," + u + "," + s + "," + l + ")";
|
|
634
|
+
if (typeof e == "object" && u === void 0 && s === void 0 && l === void 0) return e.alpha >= 1 ? (0, i.default)(e.red, e.green, e.blue) : "rgba(" + e.red + "," + e.green + "," + e.blue + "," + e.alpha + ")";
|
|
595
635
|
throw new o.default(7);
|
|
596
636
|
};
|
|
597
|
-
var
|
|
598
|
-
function
|
|
637
|
+
var n = r(de), i = r(Ce), o = r(_);
|
|
638
|
+
function r(e) {
|
|
599
639
|
return e && e.__esModule ? e : { default: e };
|
|
600
640
|
}
|
|
601
641
|
a.exports = t.default;
|
|
602
|
-
})(
|
|
603
|
-
var
|
|
642
|
+
})(ae, ae.exports);
|
|
643
|
+
var Je = ae.exports;
|
|
604
644
|
(function(a, t) {
|
|
605
645
|
t.__esModule = !0, t.default = function(f) {
|
|
606
646
|
if (typeof f != "object") throw new e.default(8);
|
|
607
|
-
if (
|
|
647
|
+
if (l(f)) return (0, r.default)(f);
|
|
608
648
|
if (s(f)) return (0, o.default)(f);
|
|
609
|
-
if (c(f)) return (0,
|
|
610
|
-
if (
|
|
649
|
+
if (c(f)) return (0, i.default)(f);
|
|
650
|
+
if (d(f)) return (0, n.default)(f);
|
|
611
651
|
throw new e.default(8);
|
|
612
652
|
};
|
|
613
|
-
var
|
|
614
|
-
function
|
|
653
|
+
var n = u(Ge), i = u(Ve), o = u(Ce), r = u(Je), e = u(_);
|
|
654
|
+
function u(f) {
|
|
615
655
|
return f && f.__esModule ? f : { default: f };
|
|
616
656
|
}
|
|
617
657
|
var s = function(f) {
|
|
618
658
|
return typeof f.red == "number" && typeof f.green == "number" && typeof f.blue == "number" && (typeof f.alpha != "number" || f.alpha === void 0);
|
|
619
|
-
},
|
|
659
|
+
}, l = function(f) {
|
|
620
660
|
return typeof f.red == "number" && typeof f.green == "number" && typeof f.blue == "number" && typeof f.alpha == "number";
|
|
621
|
-
},
|
|
661
|
+
}, d = function(f) {
|
|
622
662
|
return typeof f.hue == "number" && typeof f.saturation == "number" && typeof f.lightness == "number" && (typeof f.alpha != "number" || f.alpha === void 0);
|
|
623
663
|
}, c = function(f) {
|
|
624
664
|
return typeof f.hue == "number" && typeof f.saturation == "number" && typeof f.lightness == "number" && typeof f.alpha == "number";
|
|
625
665
|
};
|
|
626
666
|
a.exports = t.default;
|
|
627
|
-
})(
|
|
628
|
-
var
|
|
667
|
+
})(Z, Z.exports);
|
|
668
|
+
var Ee = Z.exports;
|
|
629
669
|
(function(a, t) {
|
|
630
670
|
t.__esModule = !0, t.default = void 0;
|
|
631
|
-
var
|
|
632
|
-
function e(
|
|
633
|
-
return
|
|
634
|
-
}
|
|
635
|
-
function
|
|
636
|
-
return
|
|
637
|
-
for (var
|
|
638
|
-
var c = arguments[
|
|
639
|
-
for (var f in c) Object.prototype.hasOwnProperty.call(c, f) && (
|
|
671
|
+
var n = e(ye), i = e(we), o = e(xe), r = e(Ee);
|
|
672
|
+
function e(l) {
|
|
673
|
+
return l && l.__esModule ? l : { default: l };
|
|
674
|
+
}
|
|
675
|
+
function u() {
|
|
676
|
+
return u = Object.assign ? Object.assign.bind() : function(l) {
|
|
677
|
+
for (var d = 1; d < arguments.length; d++) {
|
|
678
|
+
var c = arguments[d];
|
|
679
|
+
for (var f in c) Object.prototype.hasOwnProperty.call(c, f) && (l[f] = c[f]);
|
|
640
680
|
}
|
|
641
|
-
return
|
|
642
|
-
},
|
|
681
|
+
return l;
|
|
682
|
+
}, u.apply(this, arguments);
|
|
643
683
|
}
|
|
644
|
-
var s = (0,
|
|
645
|
-
if (
|
|
646
|
-
var c = (0, o.default)(
|
|
647
|
-
return (0,
|
|
684
|
+
var s = (0, n.default)(function(l, d) {
|
|
685
|
+
if (d === "transparent") return d;
|
|
686
|
+
var c = (0, o.default)(d);
|
|
687
|
+
return (0, r.default)(u({}, c, { lightness: (0, i.default)(0, 1, c.lightness - parseFloat(l)) }));
|
|
648
688
|
});
|
|
649
689
|
t.default = s, a.exports = t.default;
|
|
650
|
-
})(
|
|
651
|
-
const
|
|
652
|
-
var
|
|
690
|
+
})(Y, Y.exports);
|
|
691
|
+
const Ue = le(Y.exports);
|
|
692
|
+
var oe = { exports: {} };
|
|
653
693
|
(function(a, t) {
|
|
654
694
|
t.__esModule = !0, t.default = void 0;
|
|
655
|
-
var
|
|
656
|
-
function e(
|
|
657
|
-
return
|
|
658
|
-
}
|
|
659
|
-
function
|
|
660
|
-
return
|
|
661
|
-
for (var
|
|
662
|
-
var c = arguments[
|
|
663
|
-
for (var f in c) Object.prototype.hasOwnProperty.call(c, f) && (
|
|
695
|
+
var n = e(ye), i = e(we), o = e(xe), r = e(Ee);
|
|
696
|
+
function e(l) {
|
|
697
|
+
return l && l.__esModule ? l : { default: l };
|
|
698
|
+
}
|
|
699
|
+
function u() {
|
|
700
|
+
return u = Object.assign ? Object.assign.bind() : function(l) {
|
|
701
|
+
for (var d = 1; d < arguments.length; d++) {
|
|
702
|
+
var c = arguments[d];
|
|
703
|
+
for (var f in c) Object.prototype.hasOwnProperty.call(c, f) && (l[f] = c[f]);
|
|
664
704
|
}
|
|
665
|
-
return
|
|
666
|
-
},
|
|
705
|
+
return l;
|
|
706
|
+
}, u.apply(this, arguments);
|
|
667
707
|
}
|
|
668
|
-
var s = (0,
|
|
669
|
-
if (
|
|
670
|
-
var c = (0, o.default)(
|
|
671
|
-
return (0,
|
|
708
|
+
var s = (0, n.default)(function(l, d) {
|
|
709
|
+
if (d === "transparent") return d;
|
|
710
|
+
var c = (0, o.default)(d);
|
|
711
|
+
return (0, r.default)(u({}, c, { lightness: (0, i.default)(0, 1, c.lightness + parseFloat(l)) }));
|
|
672
712
|
});
|
|
673
713
|
t.default = s, a.exports = t.default;
|
|
674
|
-
})(
|
|
675
|
-
const Ze =
|
|
676
|
-
function
|
|
714
|
+
})(oe, oe.exports);
|
|
715
|
+
const Ze = le(oe.exports);
|
|
716
|
+
function Qe(a) {
|
|
677
717
|
if (!document.querySelector("style[data-widget-styles]")) {
|
|
678
|
-
var t,
|
|
718
|
+
var t, n;
|
|
679
719
|
(function() {
|
|
680
|
-
let
|
|
681
|
-
const
|
|
682
|
-
|
|
683
|
-
const e =
|
|
684
|
-
|
|
685
|
-
.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}.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: 768px){.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))}}
|
|
686
|
-
.${
|
|
687
|
-
.${
|
|
688
|
-
background: ${e ?
|
|
720
|
+
let i = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "#000", o = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "FFF";
|
|
721
|
+
const r = document.createElement("style");
|
|
722
|
+
r.attributes.setNamedItem(document.createAttribute("data-widget-styles"));
|
|
723
|
+
const e = Ne(i) > 0.5;
|
|
724
|
+
r.textContent = `
|
|
725
|
+
.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: 768px){.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))}}
|
|
726
|
+
.${F} { background: ${i}; }
|
|
727
|
+
.${F}:hover {
|
|
728
|
+
background: ${e ? Ue(0.05, i) : Ze(0.05, i)};
|
|
689
729
|
}
|
|
690
730
|
.trigger-button-icon { color: ${o}; }
|
|
691
|
-
`, document.head.appendChild(
|
|
692
|
-
})((a == null || (t = a.theme) === null || t === void 0 ? void 0 : t.inputButtonBgColor) || "#007bff", (a == null || (
|
|
731
|
+
`, document.head.appendChild(r);
|
|
732
|
+
})((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");
|
|
693
733
|
}
|
|
694
734
|
}
|
|
695
|
-
function
|
|
696
|
-
const
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
735
|
+
function Xe(a, t) {
|
|
736
|
+
const n = () => {
|
|
737
|
+
((i) => {
|
|
738
|
+
var o;
|
|
739
|
+
(o = a.contentWindow) === null || o === void 0 || o.postMessage({ type: "UPDATE_BODY_CLASS", isDarkMode: i }, "*");
|
|
740
|
+
})(document.body.classList.contains("dark"));
|
|
741
|
+
};
|
|
742
|
+
n(), (() => {
|
|
743
|
+
const i = new MutationObserver(n);
|
|
744
|
+
i.observe(document.body, { attributes: !0, attributeFilter: ["class"] }), t.addEventListener("abort", () => i.disconnect());
|
|
745
|
+
})();
|
|
746
|
+
}
|
|
747
|
+
function et(a, t) {
|
|
748
|
+
let n;
|
|
749
|
+
const i = () => {
|
|
750
|
+
((r) => {
|
|
751
|
+
var e;
|
|
752
|
+
const u = { type: "UPDATE_BODY_CLASS", isMobile: r };
|
|
753
|
+
(e = a.contentWindow) === null || e === void 0 || e.postMessage(u, "*"), r && (v.isWidgetOpen ? v.hideTriggerButton() : v.showTriggerButton());
|
|
754
|
+
})(document.body.clientWidth <= 768);
|
|
755
|
+
}, o = () => {
|
|
756
|
+
n && clearTimeout(n), n = window.setTimeout(i, 300);
|
|
757
|
+
};
|
|
758
|
+
i(), (() => {
|
|
759
|
+
const r = new ResizeObserver(o);
|
|
760
|
+
r.observe(document.body), t.addEventListener("abort", () => r.disconnect());
|
|
761
|
+
})();
|
|
762
|
+
}
|
|
763
|
+
const be = /* @__PURE__ */ new Set();
|
|
764
|
+
function tt(a, t) {
|
|
765
|
+
const n = document.createDocumentFragment(), i = function(e) {
|
|
766
|
+
const u = I("button", F, { id: `trigger-button-${e}`, "aria-controls": B, "aria-expanded": "false", "data-name": F }), s = I("div", "trigger-button-icon", { "aria-hidden": "true" });
|
|
767
|
+
return s.innerHTML = `
|
|
768
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="currentColor" viewBox="0 0 256 256" class="close-icon">
|
|
769
|
+
<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>
|
|
700
770
|
</svg>
|
|
701
771
|
<svg width="24" height="14" viewBox="0 0 24 14" fill="none" xmlns="http://www.w3.org/2000/svg" class="fish-icon visible">
|
|
702
772
|
<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"/>
|
|
703
773
|
</svg>
|
|
704
|
-
`,
|
|
705
|
-
|
|
706
|
-
const
|
|
707
|
-
|
|
708
|
-
n = !n;
|
|
709
|
-
const s = document.querySelector(`.${k}`), i = s == null ? void 0 : s.querySelector("iframe");
|
|
710
|
-
var u;
|
|
711
|
-
n ? (s == null || s.classList.add("open"), s == null || s.setAttribute("aria-hidden", "false"), l.setAttribute("aria-expanded", "true"), e.classList.remove("visible"), d.classList.add("visible"), i == null || (u = i.contentWindow) === null || u === void 0 || u.postMessage({ type: "FOCUS_SEARCH_FIELD" }, "*")) : (s == null || s.classList.remove("open"), s == null || s.setAttribute("aria-hidden", "true"), l.setAttribute("aria-expanded", "false"), d.classList.remove("visible"), e.classList.add("visible"));
|
|
712
|
-
});
|
|
713
|
-
}(t, r), t;
|
|
714
|
-
}
|
|
715
|
-
function Qe(a, t) {
|
|
716
|
-
const r = document.createDocumentFragment(), l = Ue(a), o = function(n) {
|
|
717
|
-
const e = P("div", k, { id: k, "aria-live": "polite", "aria-hidden": "true" }), d = P("iframe", "trigger-iframe", { src: n, sandbox: "allow-scripts allow-same-origin allow-popups", allow: "clipboard-write", role: "dialog" });
|
|
718
|
-
return e.appendChild(d), e;
|
|
774
|
+
`, u.setAttribute("aria-label", "Open Brainfish widget"), u.appendChild(s), v.initialize(u, s), u;
|
|
775
|
+
}(a), { iframeContainer: o, iframe: r } = function(e) {
|
|
776
|
+
const u = I("div", B, { id: B, "aria-live": "polite", "aria-hidden": "true" }), s = I("iframe", "trigger-iframe", { src: e, sandbox: "allow-scripts allow-same-origin allow-popups", allow: "clipboard-write", role: "dialog" });
|
|
777
|
+
return u.appendChild(s), { iframeContainer: u, iframe: s };
|
|
719
778
|
}(t);
|
|
720
|
-
return
|
|
721
|
-
}
|
|
722
|
-
function Xe(a) {
|
|
723
|
-
const t = new AbortController(), { signal: r } = t;
|
|
724
|
-
return window.addEventListener("message", (l) => {
|
|
725
|
-
if (l.origin !== a) return;
|
|
726
|
-
const { type: o } = l.data;
|
|
727
|
-
if (o === "TOGGLE_WIDGET_SIZE" && function() {
|
|
728
|
-
const n = document.querySelector(`.${k}`);
|
|
729
|
-
n.classList.contains("expanded") ? n.classList.remove("expanded") : n.classList.add("expanded");
|
|
730
|
-
}(), o === "TRACK_EVENT") {
|
|
731
|
-
if (!window.BrainfishAnalytics) return;
|
|
732
|
-
const { eventName: n, data: e } = l.data;
|
|
733
|
-
window.BrainfishAnalytics("track", n, e);
|
|
734
|
-
}
|
|
735
|
-
}, { signal: r }), t;
|
|
779
|
+
return n.appendChild(i), n.appendChild(o), { fragment: n, iframe: r };
|
|
736
780
|
}
|
|
737
|
-
const
|
|
738
|
-
const
|
|
781
|
+
const nt = (a, t) => {
|
|
782
|
+
const n = se(a.overrides), i = ((o = a.overrides) == null ? void 0 : o.widgetHost) || void 0;
|
|
739
783
|
var o;
|
|
740
|
-
const
|
|
784
|
+
const r = `${i}/?widgetKey=${a.widgetKey}`;
|
|
741
785
|
try {
|
|
742
|
-
if (e = a.widgetKey,
|
|
743
|
-
return !!document.getElementById(`trigger-button-${
|
|
786
|
+
if (e = a.widgetKey, be.has(e) || function(f) {
|
|
787
|
+
return !!document.getElementById(`trigger-button-${f}`);
|
|
744
788
|
}(a.widgetKey)) return;
|
|
745
|
-
|
|
746
|
-
const
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
789
|
+
Qe(t);
|
|
790
|
+
const { fragment: u, iframe: s } = tt(a.widgetKey, r), l = new AbortController(), { signal: d } = l;
|
|
791
|
+
s.onload = () => {
|
|
792
|
+
setTimeout(() => {
|
|
793
|
+
Xe(s, d), Re(i, d), et(s, d);
|
|
794
|
+
}, 0);
|
|
795
|
+
}, document.body.appendChild(u), be.add(a.widgetKey);
|
|
796
|
+
const c = () => {
|
|
797
|
+
l.abort(), window.removeEventListener("beforeunload", c);
|
|
752
798
|
};
|
|
753
|
-
return void window.addEventListener("beforeunload",
|
|
754
|
-
} catch (
|
|
755
|
-
(function(s,
|
|
756
|
-
|
|
757
|
-
})(
|
|
799
|
+
return void window.addEventListener("beforeunload", c);
|
|
800
|
+
} catch (u) {
|
|
801
|
+
(function(s, l, d) {
|
|
802
|
+
x(s, l, l.message, d);
|
|
803
|
+
})(n, u, a.widgetKey);
|
|
758
804
|
}
|
|
759
805
|
var e;
|
|
760
806
|
};
|
|
761
|
-
let
|
|
762
|
-
const
|
|
807
|
+
let j = null;
|
|
808
|
+
const ve = typeof window != "undefined" && window.Brainfish ? window.Brainfish : (j || (j = /* @__PURE__ */ function() {
|
|
763
809
|
let a = [], t = null;
|
|
764
|
-
function
|
|
810
|
+
function n(o, r) {
|
|
765
811
|
if (t) {
|
|
766
812
|
const e = o.split(".");
|
|
767
|
-
let
|
|
768
|
-
for (let
|
|
769
|
-
const s =
|
|
770
|
-
if (typeof s == "function") return s.apply(
|
|
771
|
-
} else a.push([o,
|
|
813
|
+
let u = t;
|
|
814
|
+
for (let l = 0; l < e.length - 1; l++) u = u[e[l]];
|
|
815
|
+
const s = u[e[e.length - 1]];
|
|
816
|
+
if (typeof s == "function") return s.apply(u, r);
|
|
817
|
+
} else a.push([o, r]);
|
|
772
818
|
}
|
|
773
819
|
return { Widgets: { init: function() {
|
|
774
|
-
for (var o = arguments.length,
|
|
775
|
-
return
|
|
820
|
+
for (var o = arguments.length, r = new Array(o), e = 0; e < o; e++) r[e] = arguments[e];
|
|
821
|
+
return n("Widgets.init", r);
|
|
776
822
|
} }, SearchWidget: { initStandard: function() {
|
|
777
|
-
for (var o = arguments.length,
|
|
778
|
-
return
|
|
823
|
+
for (var o = arguments.length, r = new Array(o), e = 0; e < o; e++) r[e] = arguments[e];
|
|
824
|
+
return n("SearchWidget.initStandard", r);
|
|
779
825
|
} }, HelpWidget: { initPopup: function() {
|
|
780
|
-
for (var o = arguments.length,
|
|
781
|
-
return
|
|
826
|
+
for (var o = arguments.length, r = new Array(o), e = 0; e < o; e++) r[e] = arguments[e];
|
|
827
|
+
return n("HelpWidget.initPopup", r);
|
|
782
828
|
}, close: function() {
|
|
783
|
-
for (var o = arguments.length,
|
|
784
|
-
return
|
|
829
|
+
for (var o = arguments.length, r = new Array(o), e = 0; e < o; e++) r[e] = arguments[e];
|
|
830
|
+
return n("HelpWidget.close", r);
|
|
785
831
|
}, open: function() {
|
|
786
|
-
for (var o = arguments.length,
|
|
787
|
-
return
|
|
832
|
+
for (var o = arguments.length, r = new Array(o), e = 0; e < o; e++) r[e] = arguments[e];
|
|
833
|
+
return n("HelpWidget.open", r);
|
|
788
834
|
}, toggle: function() {
|
|
789
|
-
for (var o = arguments.length,
|
|
790
|
-
return
|
|
835
|
+
for (var o = arguments.length, r = new Array(o), e = 0; e < o; e++) r[e] = arguments[e];
|
|
836
|
+
return n("HelpWidget.toggle", r);
|
|
791
837
|
} }, _setRealBrainfish: function(o) {
|
|
792
838
|
for (t = o; a.length > 0; ) {
|
|
793
|
-
const [
|
|
794
|
-
r
|
|
839
|
+
const [r, e] = a.shift();
|
|
840
|
+
n(r, e);
|
|
795
841
|
}
|
|
796
842
|
} };
|
|
797
|
-
}(), typeof window != "undefined" && (window.Brainfish =
|
|
798
|
-
let
|
|
799
|
-
|
|
843
|
+
}(), typeof window != "undefined" && (window.Brainfish = j)), j);
|
|
844
|
+
let K = null;
|
|
845
|
+
ve.Widgets.init = (a) => m(void 0, null, function* () {
|
|
800
846
|
window && (window.BrainfishAnalytics = window.BrainfishAnalytics || function() {
|
|
801
|
-
for (var
|
|
847
|
+
for (var r = arguments.length, e = new Array(r), u = 0; u < r; u++) e[u] = arguments[u];
|
|
802
848
|
(window.BrainfishAnalytics.q = window.BrainfishAnalytics.q || []).push(e);
|
|
803
849
|
});
|
|
804
|
-
const t =
|
|
805
|
-
var
|
|
806
|
-
const { config: o } = yield
|
|
807
|
-
|
|
808
|
-
return
|
|
809
|
-
var
|
|
810
|
-
const
|
|
811
|
-
|
|
812
|
-
const [
|
|
813
|
-
|
|
850
|
+
const t = se(a.overrides), n = ((i = a.overrides) == null ? void 0 : i.analyticsApiHost) || void 0;
|
|
851
|
+
var i;
|
|
852
|
+
const { config: o } = yield We({ widgetKey: a.widgetKey, apiHost: t });
|
|
853
|
+
K || (K = function(r, e, u, s) {
|
|
854
|
+
return m(this, null, function* () {
|
|
855
|
+
var l, d, c;
|
|
856
|
+
const f = ((l = r.overrides) === null || l === void 0 ? void 0 : l.enableRecording) || (e == null || (d = e.settings) === null || d === void 0 ? void 0 : d.enableRecording) || !1, h = ((c = r.overrides) === null || c === void 0 ? void 0 : c.version) || (e == null ? void 0 : e.version), g = [];
|
|
857
|
+
h != null && h.startsWith("2.") ? nt(r, e) : g.push(He(r, e)), g.push(qe(r.widgetKey, e.trackingToken || "", u, s, f));
|
|
858
|
+
const [p] = yield Promise.allSettled(g);
|
|
859
|
+
p && p.status === "fulfilled" && p.value && ve._setRealBrainfish(p.value);
|
|
814
860
|
});
|
|
815
|
-
}(a, o, t,
|
|
861
|
+
}(a, o, t, n)), yield K;
|
|
816
862
|
});
|
|
817
|
-
const
|
|
863
|
+
const at = function() {
|
|
818
864
|
typeof window != "undefined" && window.BrainfishAnalytics && window.BrainfishAnalytics(...arguments);
|
|
819
865
|
};
|
|
820
866
|
export {
|
|
821
|
-
|
|
822
|
-
|
|
867
|
+
at as BrainfishAnalytics,
|
|
868
|
+
ve as default
|
|
823
869
|
};
|
|
824
870
|
//# sourceMappingURL=web.js.map
|