@askdialog/dialog-vue 1.0.13 → 1.0.16
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/README.md +1 -0
- package/dist/App.vue.d.ts +1 -1
- package/dist/components/DialogProductBlock/DialogInput.vue.d.ts +12 -0
- package/dist/components/DialogProductBlock/DialogProductBlock.vue.d.ts +5 -1
- package/dist/components/index.d.ts +2 -1
- package/dist/dialog-vue.css +1 -1
- package/dist/dialog-vue.js +830 -733
- package/dist/dialog-vue.umd.cjs +5 -5
- package/dist/icons/ArrowIcon.vue.d.ts +5 -0
- package/package.json +2 -2
package/dist/dialog-vue.js
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as He, createElementBlock as Be, openBlock as ue, createElementVNode as K, toDisplayString as Ni, Fragment as Xs, renderList as xo, createVNode as Jt, createBlock as Kt, ref as Yt, withDirectives as Co, withKeys as Io, vModelText as Po, onMounted as Zs, watch as To, renderSlot as Fo, computed as bi, withCtx as Ro, createCommentVNode as $o } from "vue";
|
|
2
2
|
var Mr;
|
|
3
3
|
(function(r) {
|
|
4
4
|
r.OPEN_ASSISTANT = "open_assistant", r.CLOSE_ASSISTANT = "close_assistant", r.SEND_MESSAGE = "PRODUCT_QUESTION", r.SEND_GENERIC_QUESTION = "GENERIC_QUESTION";
|
|
5
5
|
})(Mr || (Mr = {}));
|
|
6
|
-
var
|
|
6
|
+
var ge, g = typeof window < "u" ? window : void 0, ie = typeof globalThis < "u" ? globalThis : g, en = Array.prototype, Dr = en.forEach, qr = en.indexOf, ne = ie == null ? void 0 : ie.navigator, k = ie == null ? void 0 : ie.document, te = ie == null ? void 0 : ie.location, Bi = ie == null ? void 0 : ie.fetch, Hi = ie != null && ie.XMLHttpRequest && "withCredentials" in new ie.XMLHttpRequest() ? ie.XMLHttpRequest : void 0, Nr = ie == null ? void 0 : ie.AbortController, J = ne == null ? void 0 : ne.userAgent, I = g ?? {}, Ce = { DEBUG: !1, LIB_VERSION: "1.236.4" }, wi = "$copy_autocapture", Oo = ["$snapshot", "$pageview", "$pageleave", "$set", "survey dismissed", "survey sent", "survey shown", "$identify", "$groupidentify", "$create_alias", "$$client_ingestion_warning", "$web_experiment_applied", "$feature_enrollment_update", "$feature_flag_called"];
|
|
7
7
|
(function(r) {
|
|
8
8
|
r.GZipJS = "gzip-js", r.Base64 = "base64";
|
|
9
|
-
})(
|
|
10
|
-
var
|
|
11
|
-
function
|
|
9
|
+
})(ge || (ge = {}));
|
|
10
|
+
var Lo = ["fatal", "error", "warning", "log", "info", "debug"];
|
|
11
|
+
function F(r, e) {
|
|
12
12
|
return r.indexOf(e) !== -1;
|
|
13
13
|
}
|
|
14
|
-
var
|
|
14
|
+
var di = function(r) {
|
|
15
15
|
return r.trim();
|
|
16
|
-
},
|
|
16
|
+
}, ji = function(r) {
|
|
17
17
|
return r.replace(/^\$/, "");
|
|
18
|
-
},
|
|
19
|
-
return
|
|
20
|
-
},
|
|
18
|
+
}, Ao = Array.isArray, tn = Object.prototype, rn = tn.hasOwnProperty, _i = tn.toString, D = Ao || function(r) {
|
|
19
|
+
return _i.call(r) === "[object Array]";
|
|
20
|
+
}, ce = (r) => typeof r == "function", q = (r) => r === Object(r) && !D(r), nt = (r) => {
|
|
21
21
|
if (q(r)) {
|
|
22
22
|
for (var e in r) if (rn.call(r, e)) return !1;
|
|
23
23
|
return !0;
|
|
24
24
|
}
|
|
25
25
|
return !1;
|
|
26
|
-
}, S = (r) => r === void 0, j = (r) =>
|
|
26
|
+
}, S = (r) => r === void 0, j = (r) => _i.call(r) == "[object String]", Ui = (r) => j(r) && r.trim().length === 0, je = (r) => r === null, R = (r) => S(r) || je(r), Y = (r) => _i.call(r) == "[object Number]", Ie = (r) => _i.call(r) === "[object Boolean]", Mo = (r) => r instanceof FormData, Do = (r) => F(Oo, r), sn = (r) => {
|
|
27
27
|
var e = { _log: function(t) {
|
|
28
|
-
if (g && (
|
|
28
|
+
if (g && (Ce.DEBUG || I.POSTHOG_DEBUG) && !S(g.console) && g.console) {
|
|
29
29
|
for (var i = ("__rrweb_original__" in g.console[t]) ? g.console[t].__rrweb_original__ : g.console[t], s = arguments.length, n = new Array(s > 1 ? s - 1 : 0), o = 1; o < s; o++) n[o - 1] = arguments[o];
|
|
30
30
|
i(r, ...n);
|
|
31
31
|
}
|
|
@@ -45,8 +45,8 @@ var li = function(r) {
|
|
|
45
45
|
e.error("You must initialize PostHog before calling ".concat(t));
|
|
46
46
|
}, createLogger: (t) => sn("".concat(r, " ").concat(t)) };
|
|
47
47
|
return e;
|
|
48
|
-
}, x = sn("[PostHog.js]"),
|
|
49
|
-
if (r.config.disable_external_dependency_loading) return
|
|
48
|
+
}, x = sn("[PostHog.js]"), Q = x.createLogger, qo = Q("[ExternalScriptsLoader]"), Br = (r, e, t) => {
|
|
49
|
+
if (r.config.disable_external_dependency_loading) return qo.warn("".concat(e, " was requested but loading of external scripts is disabled.")), t("Loading of external scripts is disabled");
|
|
50
50
|
var i = k == null ? void 0 : k.querySelectorAll("script");
|
|
51
51
|
if (i) {
|
|
52
52
|
for (var s = 0; s < i.length; s++) if (i[s].src === e) return t();
|
|
@@ -110,21 +110,21 @@ I.__PosthogExtensions__ = I.__PosthogExtensions__ || {}, I.__PosthogExtensions__
|
|
|
110
110
|
var i = r.requestRouter.endpointFor("api", e);
|
|
111
111
|
Br(r, i, t);
|
|
112
112
|
};
|
|
113
|
-
var
|
|
113
|
+
var Qt = {};
|
|
114
114
|
function qe(r, e, t) {
|
|
115
115
|
if (D(r)) {
|
|
116
116
|
if (Dr && r.forEach === Dr) r.forEach(e, t);
|
|
117
117
|
else if ("length" in r && r.length === +r.length) {
|
|
118
|
-
for (var i = 0, s = r.length; i < s; i++) if (i in r && e.call(t, r[i], i) ===
|
|
118
|
+
for (var i = 0, s = r.length; i < s; i++) if (i in r && e.call(t, r[i], i) === Qt) return;
|
|
119
119
|
}
|
|
120
120
|
}
|
|
121
121
|
}
|
|
122
122
|
function $(r, e, t) {
|
|
123
123
|
if (!R(r)) {
|
|
124
124
|
if (D(r)) return qe(r, e, t);
|
|
125
|
-
if (
|
|
126
|
-
for (var i of r.entries()) if (e.call(t, i[1], i[0]) ===
|
|
127
|
-
} else for (var s in r) if (rn.call(r, s) && e.call(t, r[s], s) ===
|
|
125
|
+
if (Mo(r)) {
|
|
126
|
+
for (var i of r.entries()) if (e.call(t, i[1], i[0]) === Qt) return;
|
|
127
|
+
} else for (var s in r) if (rn.call(r, s) && e.call(t, r[s], s) === Qt) return;
|
|
128
128
|
}
|
|
129
129
|
}
|
|
130
130
|
var H = function(r) {
|
|
@@ -132,7 +132,7 @@ var H = function(r) {
|
|
|
132
132
|
return qe(t, function(s) {
|
|
133
133
|
for (var n in s) s[n] !== void 0 && (r[n] = s[n]);
|
|
134
134
|
}), r;
|
|
135
|
-
},
|
|
135
|
+
}, hi = function(r) {
|
|
136
136
|
for (var e = arguments.length, t = new Array(e > 1 ? e - 1 : 0), i = 1; i < e; i++) t[i - 1] = arguments[i];
|
|
137
137
|
return qe(t, function(s) {
|
|
138
138
|
qe(s, function(n) {
|
|
@@ -150,7 +150,7 @@ var jr = function(r) {
|
|
|
150
150
|
} catch {
|
|
151
151
|
return;
|
|
152
152
|
}
|
|
153
|
-
},
|
|
153
|
+
}, No = function(r) {
|
|
154
154
|
return function() {
|
|
155
155
|
try {
|
|
156
156
|
for (var e = arguments.length, t = new Array(e), i = 0; i < e; i++) t[i] = arguments[i];
|
|
@@ -159,14 +159,14 @@ var jr = function(r) {
|
|
|
159
159
|
x.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."), x.critical(s);
|
|
160
160
|
}
|
|
161
161
|
};
|
|
162
|
-
},
|
|
162
|
+
}, Xt = function(r) {
|
|
163
163
|
var e = {};
|
|
164
164
|
return $(r, function(t, i) {
|
|
165
|
-
(j(t) && t.length > 0 ||
|
|
165
|
+
(j(t) && t.length > 0 || Y(t)) && (e[i] = t);
|
|
166
166
|
}), e;
|
|
167
167
|
};
|
|
168
|
-
function
|
|
169
|
-
return t = r, i = (n) => j(n) && !
|
|
168
|
+
function Bo(r, e) {
|
|
169
|
+
return t = r, i = (n) => j(n) && !je(e) ? n.slice(0, e) : n, s = /* @__PURE__ */ new Set(), function n(o, a) {
|
|
170
170
|
return o !== Object(o) ? i ? i(o, a) : o : s.has(o) ? void 0 : (s.add(o), D(o) ? (l = [], qe(o, (c) => {
|
|
171
171
|
l.push(n(c));
|
|
172
172
|
})) : (l = {}, $(o, (c, d) => {
|
|
@@ -176,12 +176,12 @@ function Mo(r, e) {
|
|
|
176
176
|
}(t);
|
|
177
177
|
var t, i, s;
|
|
178
178
|
}
|
|
179
|
-
var
|
|
180
|
-
function
|
|
179
|
+
var Ho = ["herokuapp.com", "vercel.app", "netlify.app"];
|
|
180
|
+
function jo(r) {
|
|
181
181
|
var e = r == null ? void 0 : r.hostname;
|
|
182
182
|
if (!j(e)) return !1;
|
|
183
183
|
var t = e.split(".").slice(-2).join(".");
|
|
184
|
-
for (var i of
|
|
184
|
+
for (var i of Ho) if (t === i) return !1;
|
|
185
185
|
return !0;
|
|
186
186
|
}
|
|
187
187
|
function on(r, e) {
|
|
@@ -191,12 +191,12 @@ function N(r, e, t, i) {
|
|
|
191
191
|
var { capture: s = !1, passive: n = !0 } = i ?? {};
|
|
192
192
|
r == null || r.addEventListener(e, t, { capture: s, passive: n });
|
|
193
193
|
}
|
|
194
|
-
var an = "$people_distinct_id",
|
|
194
|
+
var an = "$people_distinct_id", wt = "__alias", St = "__timers", Ur = "$autocapture_disabled_server_side", zi = "$heatmaps_enabled_server_side", zr = "$exception_capture_enabled_server_side", Wr = "$web_vitals_enabled_server_side", ln = "$dead_clicks_enabled_server_side", Vr = "$web_vitals_allowed_metrics", Wi = "$session_recording_enabled_server_side", Gr = "$console_log_recording_enabled_server_side", Jr = "$session_recording_network_payload_capture", Kr = "$session_recording_masking", Yr = "$session_recording_canvas_recording", Qr = "$replay_sample_rate", Xr = "$replay_minimum_duration", Zr = "$replay_script_config", Zt = "$sesid", kt = "$session_is_sampled", Si = "$session_recording_url_trigger_activated_session", ki = "$session_recording_event_trigger_activated_session", ot = "$enabled_feature_flags", Wt = "$early_access_features", Vi = "$feature_flag_details", Et = "$stored_person_properties", Je = "$stored_group_properties", Gi = "$surveys", At = "$surveys_activated", ei = "$flag_call_reported", ke = "$user_state", Ji = "$client_session_props", Ki = "$capture_rate_limit", Yi = "$initial_campaign_params", Qi = "$initial_referrer_info", Xi = "$initial_person_info", ti = "$epp", un = "__POSTHOG_TOOLBAR__", es = "$posthog_cookieless", Uo = [an, wt, "__cmpns", St, Wi, zi, Zt, ot, ke, Wt, Vi, Je, Et, Gi, ei, Ji, Ki, Yi, Qi, ti];
|
|
195
195
|
function ts(r) {
|
|
196
196
|
var e;
|
|
197
197
|
return r instanceof Element && (r.id === un || !((e = r.closest) === null || e === void 0 || !e.call(r, ".toolbar-global-fade-container")));
|
|
198
198
|
}
|
|
199
|
-
function
|
|
199
|
+
function pi(r) {
|
|
200
200
|
return !!r && r.nodeType === 1;
|
|
201
201
|
}
|
|
202
202
|
function Ne(r, e) {
|
|
@@ -208,14 +208,14 @@ function cn(r) {
|
|
|
208
208
|
function dn(r) {
|
|
209
209
|
return !!r && r.nodeType === 11;
|
|
210
210
|
}
|
|
211
|
-
function
|
|
212
|
-
return r ?
|
|
211
|
+
function yr(r) {
|
|
212
|
+
return r ? di(r).split(/\s+/) : [];
|
|
213
213
|
}
|
|
214
214
|
function is(r) {
|
|
215
215
|
var e = g == null ? void 0 : g.location.href;
|
|
216
216
|
return !!(e && r && r.some((t) => e.match(t)));
|
|
217
217
|
}
|
|
218
|
-
function
|
|
218
|
+
function ii(r) {
|
|
219
219
|
var e = "";
|
|
220
220
|
switch (typeof r.className) {
|
|
221
221
|
case "string":
|
|
@@ -227,30 +227,30 @@ function Zt(r) {
|
|
|
227
227
|
default:
|
|
228
228
|
e = "";
|
|
229
229
|
}
|
|
230
|
-
return
|
|
230
|
+
return yr(e);
|
|
231
231
|
}
|
|
232
232
|
function _n(r) {
|
|
233
|
-
return R(r) ? null :
|
|
233
|
+
return R(r) ? null : di(r).split(/(\s+)/).filter((e) => ct(e)).join("").replace(/[\r\n]/g, " ").replace(/[ ]+/g, " ").substring(0, 255);
|
|
234
234
|
}
|
|
235
|
-
function
|
|
235
|
+
function gi(r) {
|
|
236
236
|
var e = "";
|
|
237
|
-
return
|
|
237
|
+
return er(r) && !gn(r) && r.childNodes && r.childNodes.length && $(r.childNodes, function(t) {
|
|
238
238
|
var i;
|
|
239
239
|
cn(t) && t.textContent && (e += (i = _n(t.textContent)) !== null && i !== void 0 ? i : "");
|
|
240
|
-
}),
|
|
240
|
+
}), di(e);
|
|
241
241
|
}
|
|
242
242
|
function hn(r) {
|
|
243
243
|
return S(r.target) ? r.srcElement || null : (e = r.target) !== null && e !== void 0 && e.shadowRoot ? r.composedPath()[0] || null : r.target || null;
|
|
244
244
|
var e;
|
|
245
245
|
}
|
|
246
|
-
var
|
|
246
|
+
var Zi = ["a", "button", "form", "input", "select", "textarea", "label"];
|
|
247
247
|
function pn(r) {
|
|
248
248
|
var e = r.parentNode;
|
|
249
|
-
return !(!e || !
|
|
249
|
+
return !(!e || !pi(e)) && e;
|
|
250
250
|
}
|
|
251
|
-
function
|
|
251
|
+
function zo(r, e) {
|
|
252
252
|
var t = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : void 0, i = arguments.length > 3 ? arguments[3] : void 0, s = arguments.length > 4 ? arguments[4] : void 0;
|
|
253
|
-
if (!g || !r || Ne(r, "html") || !
|
|
253
|
+
if (!g || !r || Ne(r, "html") || !pi(r) || t != null && t.url_allowlist && !is(t.url_allowlist) || t != null && t.url_ignorelist && is(t.url_ignorelist)) return !1;
|
|
254
254
|
if (t != null && t.dom_event_allowlist) {
|
|
255
255
|
var n = t.dom_event_allowlist;
|
|
256
256
|
if (n && !n.some((_) => e.type === _)) return !1;
|
|
@@ -258,7 +258,7 @@ function Bo(r, e) {
|
|
|
258
258
|
for (var o = !1, a = [r], l = !0, c = r; c.parentNode && !Ne(c, "body"); ) if (dn(c.parentNode)) a.push(c.parentNode.host), c = c.parentNode.host;
|
|
259
259
|
else {
|
|
260
260
|
if (!(l = pn(c))) break;
|
|
261
|
-
if (i ||
|
|
261
|
+
if (i || Zi.indexOf(l.tagName.toLowerCase()) > -1) o = !0;
|
|
262
262
|
else {
|
|
263
263
|
var d = g.getComputedStyle(l);
|
|
264
264
|
d && d.getPropertyValue("cursor") === "pointer" && (o = !0);
|
|
@@ -301,15 +301,15 @@ function Bo(r, e) {
|
|
|
301
301
|
case "textarea":
|
|
302
302
|
return (s || ["change", "click"]).indexOf(e.type) >= 0;
|
|
303
303
|
default:
|
|
304
|
-
return o ? (s || ["click"]).indexOf(e.type) >= 0 : (s || ["click"]).indexOf(e.type) >= 0 && (
|
|
304
|
+
return o ? (s || ["click"]).indexOf(e.type) >= 0 : (s || ["click"]).indexOf(e.type) >= 0 && (Zi.indexOf(h) > -1 || r.getAttribute("contenteditable") === "true");
|
|
305
305
|
}
|
|
306
306
|
}
|
|
307
|
-
function
|
|
307
|
+
function er(r) {
|
|
308
308
|
for (var e = r; e.parentNode && !Ne(e, "body"); e = e.parentNode) {
|
|
309
|
-
var t =
|
|
310
|
-
if (
|
|
309
|
+
var t = ii(e);
|
|
310
|
+
if (F(t, "ph-sensitive") || F(t, "ph-no-capture")) return !1;
|
|
311
311
|
}
|
|
312
|
-
if (
|
|
312
|
+
if (F(ii(r), "ph-include")) return !0;
|
|
313
313
|
var i = r.type || "";
|
|
314
314
|
if (j(i)) switch (i.toLowerCase()) {
|
|
315
315
|
case "hidden":
|
|
@@ -322,28 +322,28 @@ function Xi(r) {
|
|
|
322
322
|
function gn(r) {
|
|
323
323
|
return !!(Ne(r, "input") && !["button", "checkbox", "submit", "reset"].includes(r.type) || Ne(r, "select") || Ne(r, "textarea") || r.getAttribute("contenteditable") === "true");
|
|
324
324
|
}
|
|
325
|
-
var vn = "(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11})",
|
|
326
|
-
function
|
|
325
|
+
var vn = "(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11})", Wo = new RegExp("^(?:".concat(vn, ")$")), Vo = new RegExp(vn), fn = "\\d{3}-?\\d{2}-?\\d{4}", Go = new RegExp("^(".concat(fn, ")$")), Jo = new RegExp("(".concat(fn, ")"));
|
|
326
|
+
function ct(r) {
|
|
327
327
|
var e = !(arguments.length > 1 && arguments[1] !== void 0) || arguments[1];
|
|
328
|
-
return !(R(r) || j(r) && (r =
|
|
328
|
+
return !(R(r) || j(r) && (r = di(r), (e ? Wo : Vo).test((r || "").replace(/[- ]/g, "")) || (e ? Go : Jo).test(r)));
|
|
329
329
|
}
|
|
330
330
|
function mn(r) {
|
|
331
|
-
var e =
|
|
332
|
-
return
|
|
331
|
+
var e = gi(r);
|
|
332
|
+
return ct(e = "".concat(e, " ").concat(yn(r)).trim()) ? e : "";
|
|
333
333
|
}
|
|
334
334
|
function yn(r) {
|
|
335
335
|
var e = "";
|
|
336
336
|
return r && r.childNodes && r.childNodes.length && $(r.childNodes, function(t) {
|
|
337
337
|
var i;
|
|
338
338
|
if (t && ((i = t.tagName) === null || i === void 0 ? void 0 : i.toLowerCase()) === "span") try {
|
|
339
|
-
var s =
|
|
339
|
+
var s = gi(t);
|
|
340
340
|
e = "".concat(e, " ").concat(s).trim(), t.childNodes && t.childNodes.length && (e = "".concat(e, " ").concat(yn(t)).trim());
|
|
341
341
|
} catch (n) {
|
|
342
342
|
x.error("[AutoCapture]", n);
|
|
343
343
|
}
|
|
344
344
|
}), e;
|
|
345
345
|
}
|
|
346
|
-
function
|
|
346
|
+
function Ko(r) {
|
|
347
347
|
return function(e) {
|
|
348
348
|
var t = e.map((i) => {
|
|
349
349
|
var s, n, o = "";
|
|
@@ -363,7 +363,7 @@ function Wo(r) {
|
|
|
363
363
|
return t.join(";");
|
|
364
364
|
}(function(e) {
|
|
365
365
|
return e.map((t) => {
|
|
366
|
-
var i, s, n = { text: (i = t.$el_text) === null || i === void 0 ? void 0 : i.slice(0, 400), tag_name: t.tag_name, href: (s = t.attr__href) === null || s === void 0 ? void 0 : s.slice(0, 2048), attr_class:
|
|
366
|
+
var i, s, n = { text: (i = t.$el_text) === null || i === void 0 ? void 0 : i.slice(0, 400), tag_name: t.tag_name, href: (s = t.attr__href) === null || s === void 0 ? void 0 : s.slice(0, 2048), attr_class: Yo(t), attr_id: t.attr__id, nth_child: t.nth_child, nth_of_type: t.nth_of_type, attributes: {} };
|
|
367
367
|
return zt(t).filter((o) => {
|
|
368
368
|
var [a] = o;
|
|
369
369
|
return a.indexOf("attr__") === 0;
|
|
@@ -377,9 +377,9 @@ function Wo(r) {
|
|
|
377
377
|
function rs(r) {
|
|
378
378
|
return r.replace(/"|\\"/g, '\\"');
|
|
379
379
|
}
|
|
380
|
-
function
|
|
380
|
+
function Yo(r) {
|
|
381
381
|
var e = r.attr__class;
|
|
382
|
-
return e ? D(e) ? e :
|
|
382
|
+
return e ? D(e) ? e : yr(e) : void 0;
|
|
383
383
|
}
|
|
384
384
|
class bn {
|
|
385
385
|
constructor() {
|
|
@@ -393,15 +393,15 @@ class bn {
|
|
|
393
393
|
return !1;
|
|
394
394
|
}
|
|
395
395
|
}
|
|
396
|
-
var
|
|
396
|
+
var Qo = ["localhost", "127.0.0.1"], dt = (r) => {
|
|
397
397
|
var e = k == null ? void 0 : k.createElement("a");
|
|
398
398
|
return S(e) ? null : (e.href = r, e);
|
|
399
|
-
},
|
|
399
|
+
}, Xo = function(r) {
|
|
400
400
|
var e, t, i = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "&", s = [];
|
|
401
401
|
return $(r, function(n, o) {
|
|
402
402
|
S(n) || S(o) || o === "undefined" || (e = encodeURIComponent(((a) => a instanceof File)(n) ? n.name : n.toString()), t = encodeURIComponent(o), s[s.length] = t + "=" + e);
|
|
403
403
|
}), s.join(i);
|
|
404
|
-
},
|
|
404
|
+
}, ri = function(r, e) {
|
|
405
405
|
for (var t, i = ((r.split("#")[0] || "").split(/\?(.*)/)[1] || "").replace(/^\?+/g, "").split("&"), s = 0; s < i.length; s++) {
|
|
406
406
|
var n = i[s].split("=");
|
|
407
407
|
if (n[0] === e) {
|
|
@@ -417,7 +417,7 @@ var Go = ["localhost", "127.0.0.1"], ct = (r) => {
|
|
|
417
417
|
x.error("Skipping decoding for malformed query param: " + o);
|
|
418
418
|
}
|
|
419
419
|
return o.replace(/\+/g, " ");
|
|
420
|
-
},
|
|
420
|
+
}, br = function(r, e, t) {
|
|
421
421
|
if (!r || !e || !e.length) return r;
|
|
422
422
|
for (var i = r.split("#"), s = i[0] || "", n = i[1], o = s.split("?"), a = o[1], l = o[0], c = (a || "").split("&"), d = [], u = 0; u < c.length; u++) {
|
|
423
423
|
var h = c[u].split("=");
|
|
@@ -425,64 +425,64 @@ var Go = ["localhost", "127.0.0.1"], ct = (r) => {
|
|
|
425
425
|
}
|
|
426
426
|
var _ = l;
|
|
427
427
|
return a != null && (_ += "?" + d.join("&")), n != null && (_ += "#" + n), _;
|
|
428
|
-
},
|
|
428
|
+
}, si = function(r, e) {
|
|
429
429
|
var t = r.match(new RegExp(e + "=([^&]*)"));
|
|
430
430
|
return t ? t[1] : null;
|
|
431
|
-
}, ss =
|
|
432
|
-
function
|
|
431
|
+
}, ss = Q("[AutoCapture]");
|
|
432
|
+
function Ei(r, e) {
|
|
433
433
|
return e.length > r ? e.slice(0, r) + "..." : e;
|
|
434
434
|
}
|
|
435
|
-
function
|
|
435
|
+
function Zo(r) {
|
|
436
436
|
if (r.previousElementSibling) return r.previousElementSibling;
|
|
437
437
|
var e = r;
|
|
438
438
|
do
|
|
439
439
|
e = e.previousSibling;
|
|
440
|
-
while (e && !
|
|
440
|
+
while (e && !pi(e));
|
|
441
441
|
return e;
|
|
442
442
|
}
|
|
443
|
-
function
|
|
443
|
+
function ea(r, e, t, i) {
|
|
444
444
|
var s = r.tagName.toLowerCase(), n = { tag_name: s };
|
|
445
|
-
|
|
446
|
-
var o =
|
|
445
|
+
Zi.indexOf(s) > -1 && !t && (s.toLowerCase() === "a" || s.toLowerCase() === "button" ? n.$el_text = Ei(1024, mn(r)) : n.$el_text = Ei(1024, gi(r)));
|
|
446
|
+
var o = ii(r);
|
|
447
447
|
o.length > 0 && (n.classes = o.filter(function(d) {
|
|
448
448
|
return d !== "";
|
|
449
449
|
})), $(r.attributes, function(d) {
|
|
450
450
|
var u;
|
|
451
|
-
if ((!gn(r) || ["name", "id", "class", "aria-label"].indexOf(d.name) !== -1) && (i == null || !i.includes(d.name)) && !e &&
|
|
451
|
+
if ((!gn(r) || ["name", "id", "class", "aria-label"].indexOf(d.name) !== -1) && (i == null || !i.includes(d.name)) && !e && ct(d.value) && (u = d.name, !j(u) || u.substring(0, 10) !== "_ngcontent" && u.substring(0, 7) !== "_nghost")) {
|
|
452
452
|
var h = d.value;
|
|
453
|
-
d.name === "class" && (h =
|
|
453
|
+
d.name === "class" && (h = yr(h).join(" ")), n["attr__" + d.name] = Ei(1024, h);
|
|
454
454
|
}
|
|
455
455
|
});
|
|
456
|
-
for (var a = 1, l = 1, c = r; c =
|
|
456
|
+
for (var a = 1, l = 1, c = r; c = Zo(c); ) a++, c.tagName === r.tagName && l++;
|
|
457
457
|
return n.nth_child = a, n.nth_of_type = l, n;
|
|
458
458
|
}
|
|
459
|
-
function
|
|
459
|
+
function ta(r, e) {
|
|
460
460
|
for (var t, i, { e: s, maskAllElementAttributes: n, maskAllText: o, elementAttributeIgnoreList: a, elementsChainAsString: l } = e, c = [r], d = r; d.parentNode && !Ne(d, "body"); ) dn(d.parentNode) ? (c.push(d.parentNode.host), d = d.parentNode.host) : (c.push(d.parentNode), d = d.parentNode);
|
|
461
461
|
var u, h = [], _ = {}, p = !1, v = !1;
|
|
462
462
|
if ($(c, (C) => {
|
|
463
|
-
var
|
|
464
|
-
C.tagName.toLowerCase() === "a" && (p = C.getAttribute("href"), p =
|
|
463
|
+
var T = er(C);
|
|
464
|
+
C.tagName.toLowerCase() === "a" && (p = C.getAttribute("href"), p = T && p && ct(p) && p), F(ii(C), "ph-no-capture") && (v = !0), h.push(ea(C, n, o, a));
|
|
465
465
|
var O = function(L) {
|
|
466
|
-
if (!
|
|
466
|
+
if (!er(L)) return {};
|
|
467
467
|
var P = {};
|
|
468
468
|
return $(L.attributes, function(M) {
|
|
469
469
|
if (M.name && M.name.indexOf("data-ph-capture-attribute") === 0) {
|
|
470
|
-
var z = M.name.replace("data-ph-capture-attribute-", ""),
|
|
471
|
-
z &&
|
|
470
|
+
var z = M.name.replace("data-ph-capture-attribute-", ""), he = M.value;
|
|
471
|
+
z && he && ct(he) && (P[z] = he);
|
|
472
472
|
}
|
|
473
473
|
}), P;
|
|
474
474
|
}(C);
|
|
475
475
|
H(_, O);
|
|
476
476
|
}), v) return { props: {}, explicitNoCapture: v };
|
|
477
|
-
if (o || (r.tagName.toLowerCase() === "a" || r.tagName.toLowerCase() === "button" ? h[0].$el_text = mn(r) : h[0].$el_text =
|
|
477
|
+
if (o || (r.tagName.toLowerCase() === "a" || r.tagName.toLowerCase() === "button" ? h[0].$el_text = mn(r) : h[0].$el_text = gi(r)), p) {
|
|
478
478
|
var b, y;
|
|
479
479
|
h[0].attr__href = p;
|
|
480
|
-
var m = (b =
|
|
480
|
+
var m = (b = dt(p)) === null || b === void 0 ? void 0 : b.host, E = g == null || (y = g.location) === null || y === void 0 ? void 0 : y.host;
|
|
481
481
|
m && E && m !== E && (u = p);
|
|
482
482
|
}
|
|
483
|
-
return { props: H({ $event_type: s.type, $ce_version: 1 }, l ? {} : { $elements: h }, { $elements_chain:
|
|
483
|
+
return { props: H({ $event_type: s.type, $ce_version: 1 }, l ? {} : { $elements: h }, { $elements_chain: Ko(h) }, (t = h[0]) !== null && t !== void 0 && t.$el_text ? { $el_text: (i = h[0]) === null || i === void 0 ? void 0 : i.$el_text } : {}, u && s.type === "click" ? { $external_click_url: u } : {}, _) };
|
|
484
484
|
}
|
|
485
|
-
class
|
|
485
|
+
class ia {
|
|
486
486
|
constructor(e) {
|
|
487
487
|
w(this, "_initialized", !1), w(this, "_isDisabledServerSide", null), w(this, "rageclicks", new bn()), w(this, "_elementsChainAsString", !1), this.instance = e, this._elementSelectors = null;
|
|
488
488
|
}
|
|
@@ -503,7 +503,7 @@ class Xo {
|
|
|
503
503
|
};
|
|
504
504
|
if (N(k, "submit", e, { capture: !0 }), N(k, "change", e, { capture: !0 }), N(k, "click", e, { capture: !0 }), this._config.capture_copied_text) {
|
|
505
505
|
var t = (i) => {
|
|
506
|
-
i = i || (g == null ? void 0 : g.event), this._captureEvent(i,
|
|
506
|
+
i = i || (g == null ? void 0 : g.event), this._captureEvent(i, wi);
|
|
507
507
|
};
|
|
508
508
|
N(k, "copy", t, { capture: !0 }), N(k, "cut", t, { capture: !0 });
|
|
509
509
|
}
|
|
@@ -530,7 +530,7 @@ class Xo {
|
|
|
530
530
|
}
|
|
531
531
|
get isEnabled() {
|
|
532
532
|
var e, t, i = (e = this.instance.persistence) === null || e === void 0 ? void 0 : e.props[Ur], s = this._isDisabledServerSide;
|
|
533
|
-
if (
|
|
533
|
+
if (je(s) && !Ie(i) && !this.instance.config.advanced_disable_decide) return !1;
|
|
534
534
|
var n = (t = this._isDisabledServerSide) !== null && t !== void 0 ? t : !!i;
|
|
535
535
|
return !!this.instance.config.autocapture && !n;
|
|
536
536
|
}
|
|
@@ -539,12 +539,12 @@ class Xo {
|
|
|
539
539
|
if (this.isEnabled) {
|
|
540
540
|
var i, s = hn(e);
|
|
541
541
|
cn(s) && (s = s.parentNode || null), t === "$autocapture" && e.type === "click" && e instanceof MouseEvent && this.instance.config.rageclick && (i = this.rageclicks) !== null && i !== void 0 && i.isRageClick(e.clientX, e.clientY, (/* @__PURE__ */ new Date()).getTime()) && this._captureEvent(e, "$rageclick");
|
|
542
|
-
var n = t ===
|
|
543
|
-
if (s &&
|
|
544
|
-
var { props: o, explicitNoCapture: a } =
|
|
542
|
+
var n = t === wi;
|
|
543
|
+
if (s && zo(s, e, this._config, n, n ? ["copy", "cut"] : void 0)) {
|
|
544
|
+
var { props: o, explicitNoCapture: a } = ta(s, { e, maskAllElementAttributes: this.instance.config.mask_all_element_attributes, maskAllText: this.instance.config.mask_all_text, elementAttributeIgnoreList: this._config.element_attribute_ignorelist, elementsChainAsString: this._elementsChainAsString });
|
|
545
545
|
if (a) return !1;
|
|
546
546
|
var l = this.getElementSelectors(s);
|
|
547
|
-
if (l && l.length > 0 && (o.$element_selectors = l), t ===
|
|
547
|
+
if (l && l.length > 0 && (o.$element_selectors = l), t === wi) {
|
|
548
548
|
var c, d = _n(g == null || (c = g.getSelection()) === null || c === void 0 ? void 0 : c.toString()), u = e.type || "clipboard";
|
|
549
549
|
if (!d) return !1;
|
|
550
550
|
o.$selected_content = d, o.$copy_type = u;
|
|
@@ -554,23 +554,23 @@ class Xo {
|
|
|
554
554
|
}
|
|
555
555
|
}
|
|
556
556
|
isBrowserSupported() {
|
|
557
|
-
return
|
|
557
|
+
return ce(k == null ? void 0 : k.querySelectorAll);
|
|
558
558
|
}
|
|
559
559
|
}
|
|
560
560
|
Math.trunc || (Math.trunc = function(r) {
|
|
561
561
|
return r < 0 ? Math.ceil(r) : Math.floor(r);
|
|
562
562
|
}), Number.isInteger || (Number.isInteger = function(r) {
|
|
563
|
-
return
|
|
563
|
+
return Y(r) && isFinite(r) && Math.floor(r) === r;
|
|
564
564
|
});
|
|
565
565
|
var ns = "0123456789abcdef";
|
|
566
|
-
class
|
|
566
|
+
class ni {
|
|
567
567
|
constructor(e) {
|
|
568
568
|
if (this.bytes = e, e.length !== 16) throw new TypeError("not 128-bit length");
|
|
569
569
|
}
|
|
570
570
|
static fromFieldsV7(e, t, i, s) {
|
|
571
571
|
if (!Number.isInteger(e) || !Number.isInteger(t) || !Number.isInteger(i) || !Number.isInteger(s) || e < 0 || t < 0 || i < 0 || s < 0 || e > 281474976710655 || t > 4095 || i > 1073741823 || s > 4294967295) throw new RangeError("invalid field value");
|
|
572
572
|
var n = new Uint8Array(16);
|
|
573
|
-
return n[0] = e / Math.pow(2, 40), n[1] = e / Math.pow(2, 32), n[2] = e / Math.pow(2, 24), n[3] = e / Math.pow(2, 16), n[4] = e / Math.pow(2, 8), n[5] = e, n[6] = 112 | t >>> 8, n[7] = t, n[8] = 128 | i >>> 24, n[9] = i >>> 16, n[10] = i >>> 8, n[11] = i, n[12] = s >>> 24, n[13] = s >>> 16, n[14] = s >>> 8, n[15] = s, new
|
|
573
|
+
return n[0] = e / Math.pow(2, 40), n[1] = e / Math.pow(2, 32), n[2] = e / Math.pow(2, 24), n[3] = e / Math.pow(2, 16), n[4] = e / Math.pow(2, 8), n[5] = e, n[6] = 112 | t >>> 8, n[7] = t, n[8] = 128 | i >>> 24, n[9] = i >>> 16, n[10] = i >>> 8, n[11] = i, n[12] = s >>> 24, n[13] = s >>> 16, n[14] = s >>> 8, n[15] = s, new ni(n);
|
|
574
574
|
}
|
|
575
575
|
toString() {
|
|
576
576
|
for (var e = "", t = 0; t < this.bytes.length; t++) e = e + ns.charAt(this.bytes[t] >>> 4) + ns.charAt(15 & this.bytes[t]), t !== 3 && t !== 5 && t !== 7 && t !== 9 || (e += "-");
|
|
@@ -578,7 +578,7 @@ class ii {
|
|
|
578
578
|
return e;
|
|
579
579
|
}
|
|
580
580
|
clone() {
|
|
581
|
-
return new
|
|
581
|
+
return new ni(this.bytes.slice(0));
|
|
582
582
|
}
|
|
583
583
|
equals(e) {
|
|
584
584
|
return this.compareTo(e) === 0;
|
|
@@ -591,9 +591,9 @@ class ii {
|
|
|
591
591
|
return 0;
|
|
592
592
|
}
|
|
593
593
|
}
|
|
594
|
-
class
|
|
594
|
+
class ra {
|
|
595
595
|
constructor() {
|
|
596
|
-
w(this, "_timestamp", 0), w(this, "_counter", 0), w(this, "_random", new
|
|
596
|
+
w(this, "_timestamp", 0), w(this, "_counter", 0), w(this, "_random", new sa());
|
|
597
597
|
}
|
|
598
598
|
generate() {
|
|
599
599
|
var e = this.generateOrAbort();
|
|
@@ -612,7 +612,7 @@ class Zo {
|
|
|
612
612
|
if (!(e + 1e4 > this._timestamp)) return;
|
|
613
613
|
this._counter++, this._counter > 4398046511103 && (this._timestamp++, this._resetCounter());
|
|
614
614
|
}
|
|
615
|
-
return
|
|
615
|
+
return ni.fromFieldsV7(this._timestamp, Math.trunc(this._counter / Math.pow(2, 30)), this._counter & Math.pow(2, 30) - 1, this._random.nextUint32());
|
|
616
616
|
}
|
|
617
617
|
_resetCounter() {
|
|
618
618
|
this._counter = 1024 * this._random.nextUint32() + (1023 & this._random.nextUint32());
|
|
@@ -624,7 +624,7 @@ var os, wn = (r) => {
|
|
|
624
624
|
return r;
|
|
625
625
|
};
|
|
626
626
|
g && !S(g.crypto) && crypto.getRandomValues && (wn = (r) => crypto.getRandomValues(r));
|
|
627
|
-
class
|
|
627
|
+
class sa {
|
|
628
628
|
constructor() {
|
|
629
629
|
w(this, "_buffer", new Uint32Array(8)), w(this, "_cursor", 1 / 0);
|
|
630
630
|
}
|
|
@@ -632,22 +632,22 @@ class ea {
|
|
|
632
632
|
return this._cursor >= this._buffer.length && (wn(this._buffer), this._cursor = 0), this._buffer[this._cursor++];
|
|
633
633
|
}
|
|
634
634
|
}
|
|
635
|
-
var Me = () =>
|
|
636
|
-
function
|
|
635
|
+
var Me = () => na().toString(), na = () => (os || (os = new ra())).generate(), oa = "Thu, 01 Jan 1970 00:00:00 GMT", ft = "", aa = /[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;
|
|
636
|
+
function la(r, e) {
|
|
637
637
|
if (e) {
|
|
638
638
|
var t = function(s) {
|
|
639
639
|
var n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : k;
|
|
640
|
-
if (
|
|
640
|
+
if (ft) return ft;
|
|
641
641
|
if (!n || ["localhost", "127.0.0.1"].includes(s)) return "";
|
|
642
|
-
for (var o = s.split("."), a = Math.min(o.length, 8), l = "dmn_chk_" + Me(), c = new RegExp("(^|;)\\s*" + l + "=1"); !
|
|
642
|
+
for (var o = s.split("."), a = Math.min(o.length, 8), l = "dmn_chk_" + Me(), c = new RegExp("(^|;)\\s*" + l + "=1"); !ft && a--; ) {
|
|
643
643
|
var d = o.slice(a).join("."), u = l + "=1;domain=." + d;
|
|
644
|
-
n.cookie = u, c.test(n.cookie) && (n.cookie = u + ";expires=" +
|
|
644
|
+
n.cookie = u, c.test(n.cookie) && (n.cookie = u + ";expires=" + oa, ft = d);
|
|
645
645
|
}
|
|
646
|
-
return
|
|
646
|
+
return ft;
|
|
647
647
|
}(r);
|
|
648
648
|
if (!t) {
|
|
649
649
|
var i = ((s) => {
|
|
650
|
-
var n = s.match(
|
|
650
|
+
var n = s.match(aa);
|
|
651
651
|
return n ? n[0] : "";
|
|
652
652
|
})(r);
|
|
653
653
|
i !== t && x.info("Warning: cookie subdomain discovery mismatch", i, t), t = i;
|
|
@@ -678,7 +678,7 @@ var Ae, Pe = { is_supported: () => !!k, error: function(r) {
|
|
|
678
678
|
return e;
|
|
679
679
|
}, set: function(r, e, t, i, s) {
|
|
680
680
|
if (k) try {
|
|
681
|
-
var n = "", o = "", a =
|
|
681
|
+
var n = "", o = "", a = la(k.location.hostname, i);
|
|
682
682
|
if (t) {
|
|
683
683
|
var l = /* @__PURE__ */ new Date();
|
|
684
684
|
l.setTime(l.getTime() + 24 * t * 60 * 60 * 1e3), n = "; expires=" + l.toUTCString();
|
|
@@ -695,8 +695,8 @@ var Ae, Pe = { is_supported: () => !!k, error: function(r) {
|
|
|
695
695
|
} catch {
|
|
696
696
|
return;
|
|
697
697
|
}
|
|
698
|
-
} },
|
|
699
|
-
if (!
|
|
698
|
+
} }, xi = null, U = { is_supported: function() {
|
|
699
|
+
if (!je(xi)) return xi;
|
|
700
700
|
var r = !0;
|
|
701
701
|
if (S(g)) r = !1;
|
|
702
702
|
else try {
|
|
@@ -705,7 +705,7 @@ var Ae, Pe = { is_supported: () => !!k, error: function(r) {
|
|
|
705
705
|
} catch {
|
|
706
706
|
r = !1;
|
|
707
707
|
}
|
|
708
|
-
return r || x.error("localStorage unsupported; falling back to cookie store"),
|
|
708
|
+
return r || x.error("localStorage unsupported; falling back to cookie store"), xi = r, r;
|
|
709
709
|
}, error: function(r) {
|
|
710
710
|
x.error("localStorage error: " + r);
|
|
711
711
|
}, get: function(r) {
|
|
@@ -733,7 +733,7 @@ var Ae, Pe = { is_supported: () => !!k, error: function(r) {
|
|
|
733
733
|
} catch (e) {
|
|
734
734
|
U.error(e);
|
|
735
735
|
}
|
|
736
|
-
} },
|
|
736
|
+
} }, ua = ["distinct_id", Zt, kt, ti, Xi], Mt = f(f({}, U), {}, { parse: function(r) {
|
|
737
737
|
try {
|
|
738
738
|
var e = {};
|
|
739
739
|
try {
|
|
@@ -749,7 +749,7 @@ var Ae, Pe = { is_supported: () => !!k, error: function(r) {
|
|
|
749
749
|
try {
|
|
750
750
|
U.set(r, e, void 0, void 0, n);
|
|
751
751
|
var o = {};
|
|
752
|
-
|
|
752
|
+
ua.forEach((a) => {
|
|
753
753
|
e[a] && (o[a] = e[a]);
|
|
754
754
|
}), Object.keys(o).length && Pe.set(r, o, t, i, s, n);
|
|
755
755
|
} catch (a) {
|
|
@@ -761,7 +761,7 @@ var Ae, Pe = { is_supported: () => !!k, error: function(r) {
|
|
|
761
761
|
} catch (t) {
|
|
762
762
|
U.error(t);
|
|
763
763
|
}
|
|
764
|
-
} }), Dt = {},
|
|
764
|
+
} }), Dt = {}, ca = { is_supported: function() {
|
|
765
765
|
return !0;
|
|
766
766
|
}, error: function(r) {
|
|
767
767
|
x.error("memoryStorage error: " + r);
|
|
@@ -773,16 +773,16 @@ var Ae, Pe = { is_supported: () => !!k, error: function(r) {
|
|
|
773
773
|
Dt[r] = e;
|
|
774
774
|
}, remove: function(r) {
|
|
775
775
|
delete Dt[r];
|
|
776
|
-
} },
|
|
777
|
-
if (!
|
|
778
|
-
if (
|
|
776
|
+
} }, ze = null, W = { is_supported: function() {
|
|
777
|
+
if (!je(ze)) return ze;
|
|
778
|
+
if (ze = !0, S(g)) ze = !1;
|
|
779
779
|
else try {
|
|
780
780
|
var r = "__support__";
|
|
781
|
-
W.set(r, "xyz"), W.get(r) !== '"xyz"' && (
|
|
781
|
+
W.set(r, "xyz"), W.get(r) !== '"xyz"' && (ze = !1), W.remove(r);
|
|
782
782
|
} catch {
|
|
783
|
-
|
|
783
|
+
ze = !1;
|
|
784
784
|
}
|
|
785
|
-
return
|
|
785
|
+
return ze;
|
|
786
786
|
}, error: function(r) {
|
|
787
787
|
x.error("sessionStorage error: ", r);
|
|
788
788
|
}, get: function(r) {
|
|
@@ -814,7 +814,7 @@ var Ae, Pe = { is_supported: () => !!k, error: function(r) {
|
|
|
814
814
|
(function(r) {
|
|
815
815
|
r[r.PENDING = -1] = "PENDING", r[r.DENIED = 0] = "DENIED", r[r.GRANTED = 1] = "GRANTED";
|
|
816
816
|
})(Ae || (Ae = {}));
|
|
817
|
-
class
|
|
817
|
+
class da {
|
|
818
818
|
constructor(e) {
|
|
819
819
|
this._instance = e;
|
|
820
820
|
}
|
|
@@ -854,12 +854,12 @@ class aa {
|
|
|
854
854
|
return this._persistentStore;
|
|
855
855
|
}
|
|
856
856
|
_getDnt() {
|
|
857
|
-
return !!this._config.respect_dnt && !!on([ne == null ? void 0 : ne.doNotTrack, ne == null ? void 0 : ne.msDoNotTrack, I.doNotTrack], (e) =>
|
|
857
|
+
return !!this._config.respect_dnt && !!on([ne == null ? void 0 : ne.doNotTrack, ne == null ? void 0 : ne.msDoNotTrack, I.doNotTrack], (e) => F([!0, 1, "1", "yes"], e));
|
|
858
858
|
}
|
|
859
859
|
}
|
|
860
|
-
var qt =
|
|
860
|
+
var qt = Q("[Dead Clicks]"), _a = () => !0, ha = (r) => {
|
|
861
861
|
var e, t = !((e = r.instance.persistence) === null || e === void 0 || !e.get_property(ln)), i = r.instance.config.capture_dead_clicks;
|
|
862
|
-
return
|
|
862
|
+
return Ie(i) ? i : t;
|
|
863
863
|
};
|
|
864
864
|
class Sn {
|
|
865
865
|
get lazyLoadedDeadClicksAutocapture() {
|
|
@@ -895,8 +895,8 @@ class Sn {
|
|
|
895
895
|
this._lazyLoadedDeadClicksAutocapture && (this._lazyLoadedDeadClicksAutocapture.stop(), this._lazyLoadedDeadClicksAutocapture = void 0, qt.info("stopping..."));
|
|
896
896
|
}
|
|
897
897
|
}
|
|
898
|
-
var
|
|
899
|
-
class
|
|
898
|
+
var Ci = Q("[ExceptionAutocapture]");
|
|
899
|
+
class pa {
|
|
900
900
|
constructor(e) {
|
|
901
901
|
var t;
|
|
902
902
|
w(this, "_startCapturing", () => {
|
|
@@ -906,7 +906,7 @@ class ca {
|
|
|
906
906
|
try {
|
|
907
907
|
!this._unwrapOnError && this.config.capture_unhandled_errors && (this._unwrapOnError = s(this.captureException.bind(this))), !this._unwrapUnhandledRejection && this.config.capture_unhandled_rejections && (this._unwrapUnhandledRejection = n(this.captureException.bind(this))), !this._unwrapConsoleError && this.config.capture_console_errors && (this._unwrapConsoleError = o(this.captureException.bind(this)));
|
|
908
908
|
} catch (a) {
|
|
909
|
-
|
|
909
|
+
Ci.error("failed to start", a), this._stopCapturing();
|
|
910
910
|
}
|
|
911
911
|
}
|
|
912
912
|
}), this.instance = e, this.remoteEnabled = !((t = this.instance.persistence) === null || t === void 0 || !t.props[zr]), this.config = this._requiredConfig(), this.startIfEnabled();
|
|
@@ -919,12 +919,12 @@ class ca {
|
|
|
919
919
|
return this.config.capture_console_errors || this.config.capture_unhandled_errors || this.config.capture_unhandled_rejections;
|
|
920
920
|
}
|
|
921
921
|
startIfEnabled() {
|
|
922
|
-
this.isEnabled && (
|
|
922
|
+
this.isEnabled && (Ci.info("enabled"), this._loadScript(this._startCapturing));
|
|
923
923
|
}
|
|
924
924
|
_loadScript(e) {
|
|
925
925
|
var t, i, s;
|
|
926
926
|
(t = I.__PosthogExtensions__) !== null && t !== void 0 && t.errorWrappingFunctions && e(), (i = I.__PosthogExtensions__) === null || i === void 0 || (s = i.loadExternalDependency) === null || s === void 0 || s.call(i, this.instance, "exception-autocapture", (n) => {
|
|
927
|
-
if (n) return
|
|
927
|
+
if (n) return Ci.error("failed to load script", n);
|
|
928
928
|
e();
|
|
929
929
|
});
|
|
930
930
|
}
|
|
@@ -965,15 +965,15 @@ function xn(r) {
|
|
|
965
965
|
function Vt(r, e) {
|
|
966
966
|
return Object.prototype.toString.call(r) === "[object ".concat(e, "]");
|
|
967
967
|
}
|
|
968
|
-
function
|
|
968
|
+
function Ii(r) {
|
|
969
969
|
return Vt(r, "DOMError");
|
|
970
970
|
}
|
|
971
|
-
var as = /\(error: (.*)\)/, ls = 50,
|
|
972
|
-
function
|
|
973
|
-
var s = { platform: "web:javascript", filename: r, function: e === "<anonymous>" ?
|
|
971
|
+
var as = /\(error: (.*)\)/, ls = 50, at = "?";
|
|
972
|
+
function Pi(r, e, t, i) {
|
|
973
|
+
var s = { platform: "web:javascript", filename: r, function: e === "<anonymous>" ? at : e, in_app: !0 };
|
|
974
974
|
return S(t) || (s.lineno = t), S(i) || (s.colno = i), s;
|
|
975
975
|
}
|
|
976
|
-
var
|
|
976
|
+
var ga = /^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i, va = /^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i, fa = /\((\S*)(?::(\d+))(?::(\d+))\)/, ma = /^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i, ya = /(\S+) line (\d+)(?: > eval line \d+)* > eval/i, ba = function() {
|
|
977
977
|
for (var r = arguments.length, e = new Array(r), t = 0; t < r; t++) e[t] = arguments[t];
|
|
978
978
|
var i = e.sort((s, n) => s[0] - n[0]).map((s) => s[1]);
|
|
979
979
|
return function(s) {
|
|
@@ -997,53 +997,53 @@ var da = /^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i, _a = /^\s*at (?:(.+?\)(?: \[.
|
|
|
997
997
|
return function(_) {
|
|
998
998
|
if (!_.length) return [];
|
|
999
999
|
var p = Array.from(_);
|
|
1000
|
-
return p.reverse(), p.slice(0, ls).map((v) => f(f({}, v), {}, { filename: v.filename ||
|
|
1000
|
+
return p.reverse(), p.slice(0, ls).map((v) => f(f({}, v), {}, { filename: v.filename || wa(p).filename, function: v.function || at }));
|
|
1001
1001
|
}(o);
|
|
1002
1002
|
};
|
|
1003
1003
|
}([30, (r) => {
|
|
1004
|
-
var e =
|
|
1004
|
+
var e = ga.exec(r);
|
|
1005
1005
|
if (e) {
|
|
1006
1006
|
var [, t, i, s] = e;
|
|
1007
|
-
return
|
|
1007
|
+
return Pi(t, at, +i, +s);
|
|
1008
1008
|
}
|
|
1009
|
-
var n =
|
|
1009
|
+
var n = va.exec(r);
|
|
1010
1010
|
if (n) {
|
|
1011
1011
|
if (n[2] && n[2].indexOf("eval") === 0) {
|
|
1012
|
-
var o =
|
|
1012
|
+
var o = fa.exec(n[2]);
|
|
1013
1013
|
o && (n[2] = o[1], n[3] = o[2], n[4] = o[3]);
|
|
1014
1014
|
}
|
|
1015
|
-
var [a, l] = cs(n[1] ||
|
|
1016
|
-
return
|
|
1015
|
+
var [a, l] = cs(n[1] || at, n[2]);
|
|
1016
|
+
return Pi(l, a, n[3] ? +n[3] : void 0, n[4] ? +n[4] : void 0);
|
|
1017
1017
|
}
|
|
1018
1018
|
}], [50, (r) => {
|
|
1019
|
-
var e =
|
|
1019
|
+
var e = ma.exec(r);
|
|
1020
1020
|
if (e) {
|
|
1021
1021
|
if (e[3] && e[3].indexOf(" > eval") > -1) {
|
|
1022
|
-
var t =
|
|
1022
|
+
var t = ya.exec(e[3]);
|
|
1023
1023
|
t && (e[1] = e[1] || "eval", e[3] = t[1], e[4] = t[2], e[5] = "");
|
|
1024
1024
|
}
|
|
1025
|
-
var i = e[3], s = e[1] ||
|
|
1026
|
-
return [s, i] = cs(s, i),
|
|
1025
|
+
var i = e[3], s = e[1] || at;
|
|
1026
|
+
return [s, i] = cs(s, i), Pi(i, s, e[4] ? +e[4] : void 0, e[5] ? +e[5] : void 0);
|
|
1027
1027
|
}
|
|
1028
1028
|
}]);
|
|
1029
|
-
function
|
|
1029
|
+
function wa(r) {
|
|
1030
1030
|
return r[r.length - 1] || {};
|
|
1031
1031
|
}
|
|
1032
|
-
var Nt, us,
|
|
1032
|
+
var Nt, us, Ti, cs = (r, e) => {
|
|
1033
1033
|
var t = r.indexOf("safari-extension") !== -1, i = r.indexOf("safari-web-extension") !== -1;
|
|
1034
|
-
return t || i ? [r.indexOf("@") !== -1 ? r.split("@")[0] :
|
|
1035
|
-
},
|
|
1036
|
-
function
|
|
1034
|
+
return t || i ? [r.indexOf("@") !== -1 ? r.split("@")[0] : at, t ? "safari-extension:".concat(e) : "safari-web-extension:".concat(e)] : [r, e];
|
|
1035
|
+
}, Sa = /^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;
|
|
1036
|
+
function wr(r) {
|
|
1037
1037
|
var e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0, t = r.stacktrace || r.stack || "", i = function(o) {
|
|
1038
|
-
return o &&
|
|
1038
|
+
return o && ka.test(o.message) ? 1 : 0;
|
|
1039
1039
|
}(r);
|
|
1040
1040
|
try {
|
|
1041
|
-
var s =
|
|
1041
|
+
var s = ba, n = function(o, a) {
|
|
1042
1042
|
var l = function(c) {
|
|
1043
1043
|
var d = globalThis._posthogChunkIds;
|
|
1044
1044
|
if (!d) return {};
|
|
1045
1045
|
var u = Object.keys(d);
|
|
1046
|
-
return
|
|
1046
|
+
return Ti && u.length === us || (us = u.length, Ti = u.reduce((h, _) => {
|
|
1047
1047
|
Nt || (Nt = {});
|
|
1048
1048
|
var p = Nt[_];
|
|
1049
1049
|
if (p) h[p[0]] = p[1];
|
|
@@ -1055,7 +1055,7 @@ function yr(r) {
|
|
|
1055
1055
|
}
|
|
1056
1056
|
}
|
|
1057
1057
|
return h;
|
|
1058
|
-
}, {})),
|
|
1058
|
+
}, {})), Ti;
|
|
1059
1059
|
}(a);
|
|
1060
1060
|
return o.forEach((c) => {
|
|
1061
1061
|
c.filename && (c.chunk_id = l[c.filename]);
|
|
@@ -1066,33 +1066,33 @@ function yr(r) {
|
|
|
1066
1066
|
}
|
|
1067
1067
|
return [];
|
|
1068
1068
|
}
|
|
1069
|
-
var
|
|
1070
|
-
function
|
|
1071
|
-
var t, i, s =
|
|
1069
|
+
var ka = /Minified React error #\d+;/i;
|
|
1070
|
+
function Ea(r, e) {
|
|
1071
|
+
var t, i, s = wr(r), n = (t = e == null ? void 0 : e.handled) === null || t === void 0 || t, o = (i = e == null ? void 0 : e.synthetic) !== null && i !== void 0 && i;
|
|
1072
1072
|
return { type: e != null && e.overrideExceptionType ? e.overrideExceptionType : r.name, value: function(a) {
|
|
1073
1073
|
var l = a.message;
|
|
1074
1074
|
return l.error && typeof l.error.message == "string" ? String(l.error.message) : String(l);
|
|
1075
1075
|
}(r), stacktrace: { frames: s, type: "raw" }, mechanism: { handled: n, synthetic: o } };
|
|
1076
1076
|
}
|
|
1077
1077
|
function Cn(r, e) {
|
|
1078
|
-
var t =
|
|
1078
|
+
var t = Ea(r, e);
|
|
1079
1079
|
return r.cause && xn(r.cause) && r.cause !== r ? [t, ...Cn(r.cause, { handled: e == null ? void 0 : e.handled, synthetic: e == null ? void 0 : e.synthetic })] : [t];
|
|
1080
1080
|
}
|
|
1081
|
-
function
|
|
1081
|
+
function Fi(r, e) {
|
|
1082
1082
|
return { $exception_list: Cn(r, e), $exception_level: "error" };
|
|
1083
1083
|
}
|
|
1084
|
-
function
|
|
1084
|
+
function Ri(r, e) {
|
|
1085
1085
|
var t, i, s, n = (t = e == null ? void 0 : e.handled) === null || t === void 0 || t, o = (i = e == null ? void 0 : e.synthetic) === null || i === void 0 || i, a = { type: e != null && e.overrideExceptionType ? e.overrideExceptionType : (s = e == null ? void 0 : e.defaultExceptionType) !== null && s !== void 0 ? s : "Error", value: r || (e == null ? void 0 : e.defaultExceptionMessage), mechanism: { handled: n, synthetic: o } };
|
|
1086
1086
|
if (e != null && e.syntheticException) {
|
|
1087
|
-
var l =
|
|
1087
|
+
var l = wr(e.syntheticException, 1);
|
|
1088
1088
|
l.length && (a.stacktrace = { frames: l, type: "raw" });
|
|
1089
1089
|
}
|
|
1090
1090
|
return { $exception_list: [a], $exception_level: "error" };
|
|
1091
1091
|
}
|
|
1092
|
-
function
|
|
1093
|
-
return j(r) && !
|
|
1092
|
+
function xa(r) {
|
|
1093
|
+
return j(r) && !Ui(r) && Lo.indexOf(r) >= 0;
|
|
1094
1094
|
}
|
|
1095
|
-
function
|
|
1095
|
+
function Ca(r, e) {
|
|
1096
1096
|
var t, i, s = (t = e == null ? void 0 : e.handled) === null || t === void 0 || t, n = (i = e == null ? void 0 : e.synthetic) === null || i === void 0 || i, o = e != null && e.overrideExceptionType ? e.overrideExceptionType : kn(r) ? r.constructor.name : "Error", a = "Non-Error 'exception' captured with keys: ".concat(function(d) {
|
|
1097
1097
|
var u = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 40, h = Object.keys(d);
|
|
1098
1098
|
if (h.sort(), !h.length) return "[object has no keys]";
|
|
@@ -1103,40 +1103,40 @@ function Sa(r, e) {
|
|
|
1103
1103
|
return "";
|
|
1104
1104
|
}(r)), l = { type: o, value: a, mechanism: { handled: s, synthetic: n } };
|
|
1105
1105
|
if (e != null && e.syntheticException) {
|
|
1106
|
-
var c =
|
|
1106
|
+
var c = wr(e == null ? void 0 : e.syntheticException, 1);
|
|
1107
1107
|
c.length && (l.stacktrace = { frames: c, type: "raw" });
|
|
1108
1108
|
}
|
|
1109
|
-
return { $exception_list: [l], $exception_level:
|
|
1109
|
+
return { $exception_list: [l], $exception_level: xa(r.level) ? r.level : "error" };
|
|
1110
1110
|
}
|
|
1111
|
-
function
|
|
1111
|
+
function Ia(r, e) {
|
|
1112
1112
|
var { error: t, event: i } = r, s = { $exception_list: [] }, n = t || i;
|
|
1113
|
-
if (
|
|
1113
|
+
if (Ii(n) || function(_) {
|
|
1114
1114
|
return Vt(_, "DOMException");
|
|
1115
1115
|
}(n)) {
|
|
1116
1116
|
var o = n;
|
|
1117
1117
|
if (function(_) {
|
|
1118
1118
|
return "stack" in _;
|
|
1119
|
-
}(n)) s =
|
|
1119
|
+
}(n)) s = Fi(n, e);
|
|
1120
1120
|
else {
|
|
1121
|
-
var a = o.name || (
|
|
1122
|
-
s =
|
|
1121
|
+
var a = o.name || (Ii(o) ? "DOMError" : "DOMException"), l = o.message ? "".concat(a, ": ").concat(o.message) : a, c = Ii(o) ? "DOMError" : "DOMException";
|
|
1122
|
+
s = Ri(l, f(f({}, e), {}, { overrideExceptionType: c, defaultExceptionMessage: l }));
|
|
1123
1123
|
}
|
|
1124
1124
|
return "code" in o && (s.$exception_DOMException_code = "".concat(o.code)), s;
|
|
1125
1125
|
}
|
|
1126
1126
|
if (function(_) {
|
|
1127
1127
|
return Vt(_, "ErrorEvent");
|
|
1128
|
-
}(n) && n.error) return
|
|
1129
|
-
if (xn(n)) return
|
|
1128
|
+
}(n) && n.error) return Fi(n.error, e);
|
|
1129
|
+
if (xn(n)) return Fi(n, e);
|
|
1130
1130
|
if (function(_) {
|
|
1131
1131
|
return Vt(_, "Object");
|
|
1132
|
-
}(n) || kn(n)) return
|
|
1132
|
+
}(n) || kn(n)) return Ca(n, e);
|
|
1133
1133
|
if (S(t) && j(i)) {
|
|
1134
|
-
var d = "Error", u = i, h = i.match(
|
|
1135
|
-
return h && (d = h[1], u = h[2]),
|
|
1134
|
+
var d = "Error", u = i, h = i.match(Sa);
|
|
1135
|
+
return h && (d = h[1], u = h[2]), Ri(u, f(f({}, e), {}, { overrideExceptionType: d, defaultExceptionMessage: u }));
|
|
1136
1136
|
}
|
|
1137
|
-
return
|
|
1137
|
+
return Ri(n, e);
|
|
1138
1138
|
}
|
|
1139
|
-
function
|
|
1139
|
+
function oi(r) {
|
|
1140
1140
|
var e, t;
|
|
1141
1141
|
return ((e = JSON.stringify(r, (t = [], function(i, s) {
|
|
1142
1142
|
if (q(s)) {
|
|
@@ -1146,46 +1146,46 @@ function ri(r) {
|
|
|
1146
1146
|
return s;
|
|
1147
1147
|
}))) === null || e === void 0 ? void 0 : e.length) || 0;
|
|
1148
1148
|
}
|
|
1149
|
-
function
|
|
1149
|
+
function tr(r) {
|
|
1150
1150
|
var e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 66060288e-1;
|
|
1151
1151
|
if (r.size >= e && r.data.length > 1) {
|
|
1152
1152
|
var t = Math.floor(r.data.length / 2), i = r.data.slice(0, t), s = r.data.slice(t);
|
|
1153
|
-
return [
|
|
1153
|
+
return [tr({ size: oi(i), data: i, sessionId: r.sessionId, windowId: r.windowId }), tr({ size: oi(s), data: s, sessionId: r.sessionId, windowId: r.windowId })].flatMap((n) => n);
|
|
1154
1154
|
}
|
|
1155
1155
|
return [r];
|
|
1156
1156
|
}
|
|
1157
|
-
var
|
|
1157
|
+
var Ee = ((r) => (r[r.DomContentLoaded = 0] = "DomContentLoaded", r[r.Load = 1] = "Load", r[r.FullSnapshot = 2] = "FullSnapshot", r[r.IncrementalSnapshot = 3] = "IncrementalSnapshot", r[r.Meta = 4] = "Meta", r[r.Custom = 5] = "Custom", r[r.Plugin = 6] = "Plugin", r))(Ee || {}), pe = ((r) => (r[r.Mutation = 0] = "Mutation", r[r.MouseMove = 1] = "MouseMove", r[r.MouseInteraction = 2] = "MouseInteraction", r[r.Scroll = 3] = "Scroll", r[r.ViewportResize = 4] = "ViewportResize", r[r.Input = 5] = "Input", r[r.TouchMove = 6] = "TouchMove", r[r.MediaInteraction = 7] = "MediaInteraction", r[r.StyleSheetRule = 8] = "StyleSheetRule", r[r.CanvasMutation = 9] = "CanvasMutation", r[r.Font = 10] = "Font", r[r.Log = 11] = "Log", r[r.Drag = 12] = "Drag", r[r.StyleDeclaration = 13] = "StyleDeclaration", r[r.Selection = 14] = "Selection", r[r.AdoptedStyleSheet = 15] = "AdoptedStyleSheet", r[r.CustomElement = 16] = "CustomElement", r))(pe || {}), ir = "[SessionRecording]", rr = "redacted", Bt = { initiatorTypes: ["audio", "beacon", "body", "css", "early-hint", "embed", "fetch", "frame", "iframe", "icon", "image", "img", "input", "link", "navigation", "object", "ping", "script", "track", "video", "xmlhttprequest"], maskRequestFn: (r) => r, recordHeaders: !1, recordBody: !1, recordInitialRequests: !1, recordPerformance: !1, performanceEntryTypeToObserve: ["first-input", "navigation", "paint", "resource"], payloadSizeLimitBytes: 1e6, payloadHostDenyList: [".lr-ingest.io", ".ingest.sentry.io", ".clarity.ms", "analytics.google.com"] }, Pa = ["authorization", "x-forwarded-for", "authorization", "cookie", "set-cookie", "x-api-key", "x-real-ip", "remote-addr", "forwarded", "proxy-authorization", "x-csrf-token", "x-csrftoken", "x-xsrf-token"], Ta = ["password", "secret", "passwd", "api_key", "apikey", "auth", "credentials", "mysql_pwd", "privatekey", "private_key", "token"], Fa = ["/s/", "/e/", "/i/"];
|
|
1158
1158
|
function ds(r, e, t, i) {
|
|
1159
1159
|
if (R(r)) return r;
|
|
1160
1160
|
var s = (e == null ? void 0 : e["content-length"]) || function(n) {
|
|
1161
1161
|
return new Blob([n]).size;
|
|
1162
1162
|
}(r);
|
|
1163
|
-
return j(s) && (s = parseInt(s)), s > t ?
|
|
1163
|
+
return j(s) && (s = parseInt(s)), s > t ? ir + " ".concat(i, " body too large to record (").concat(s, " bytes)") : r;
|
|
1164
1164
|
}
|
|
1165
1165
|
function _s(r, e) {
|
|
1166
1166
|
if (R(r)) return r;
|
|
1167
1167
|
var t = r;
|
|
1168
|
-
return
|
|
1168
|
+
return ct(t, !1) || (t = ir + " " + e + " body " + rr), $(Ta, (i) => {
|
|
1169
1169
|
var s, n;
|
|
1170
|
-
(s = t) !== null && s !== void 0 && s.length && ((n = t) === null || n === void 0 ? void 0 : n.indexOf(i)) !== -1 && (t =
|
|
1170
|
+
(s = t) !== null && s !== void 0 && s.length && ((n = t) === null || n === void 0 ? void 0 : n.indexOf(i)) !== -1 && (t = ir + " " + e + " body " + rr + " as might contain: " + i);
|
|
1171
1171
|
}), t;
|
|
1172
1172
|
}
|
|
1173
|
-
var
|
|
1173
|
+
var Ra = (r, e) => {
|
|
1174
1174
|
var t, i, s, n = { payloadSizeLimitBytes: Bt.payloadSizeLimitBytes, performanceEntryTypeToObserve: [...Bt.performanceEntryTypeToObserve], payloadHostDenyList: [...e.payloadHostDenyList || [], ...Bt.payloadHostDenyList] }, o = r.session_recording.recordHeaders !== !1 && e.recordHeaders, a = r.session_recording.recordBody !== !1 && e.recordBody, l = r.capture_performance !== !1 && e.recordPerformance, c = (t = n, s = Math.min(1e6, (i = t.payloadSizeLimitBytes) !== null && i !== void 0 ? i : 1e6), (h) => (h != null && h.requestBody && (h.requestBody = ds(h.requestBody, h.requestHeaders, s, "Request")), h != null && h.responseBody && (h.responseBody = ds(h.responseBody, h.responseHeaders, s, "Response")), h)), d = (h) => {
|
|
1175
1175
|
return c(((v, b) => {
|
|
1176
|
-
var y, m =
|
|
1176
|
+
var y, m = dt(v.name), E = b.indexOf("http") === 0 ? (y = dt(b)) === null || y === void 0 ? void 0 : y.pathname : b;
|
|
1177
1177
|
E === "/" && (E = "");
|
|
1178
1178
|
var C = m == null ? void 0 : m.pathname.replace(E || "", "");
|
|
1179
|
-
if (!(m && C &&
|
|
1179
|
+
if (!(m && C && Fa.some((T) => C.indexOf(T) === 0))) return v;
|
|
1180
1180
|
})((p = (_ = h).requestHeaders, R(p) || $(Object.keys(p ?? {}), (v) => {
|
|
1181
|
-
|
|
1181
|
+
Pa.includes(v.toLowerCase()) && (p[v] = rr);
|
|
1182
1182
|
}), _), r.api_host));
|
|
1183
1183
|
var _, p;
|
|
1184
|
-
}, u =
|
|
1185
|
-
return u &&
|
|
1184
|
+
}, u = ce(r.session_recording.maskNetworkRequestFn);
|
|
1185
|
+
return u && ce(r.session_recording.maskCapturedNetworkRequestFn) && x.warn("Both `maskNetworkRequestFn` and `maskCapturedNetworkRequestFn` are defined. `maskNetworkRequestFn` will be ignored."), u && (r.session_recording.maskCapturedNetworkRequestFn = (h) => {
|
|
1186
1186
|
var _ = r.session_recording.maskNetworkRequestFn({ url: h.name });
|
|
1187
1187
|
return f(f({}, h), {}, { name: _ == null ? void 0 : _.url });
|
|
1188
|
-
}), n.maskRequestFn =
|
|
1188
|
+
}), n.maskRequestFn = ce(r.session_recording.maskCapturedNetworkRequestFn) ? (h) => {
|
|
1189
1189
|
var _, p, v, b = d(h);
|
|
1190
1190
|
return b && (_ = (p = (v = r.session_recording).maskCapturedNetworkRequestFn) === null || p === void 0 ? void 0 : p.call(v, b)) !== null && _ !== void 0 ? _ : void 0;
|
|
1191
1191
|
} : (h) => function(_) {
|
|
@@ -1193,9 +1193,9 @@ var Ia = (r, e) => {
|
|
|
1193
1193
|
}(d(h)), f(f(f({}, Bt), n), {}, { recordHeaders: o, recordBody: a, recordPerformance: l, recordInitialRequests: l });
|
|
1194
1194
|
};
|
|
1195
1195
|
function le(r, e, t, i, s) {
|
|
1196
|
-
return e > t && (x.warn("min cannot be greater than max."), e = t),
|
|
1196
|
+
return e > t && (x.warn("min cannot be greater than max."), e = t), Y(r) ? r > t ? (i && x.warn(i + " cannot be greater than max: " + t + ". Using max value instead."), t) : r < e ? (i && x.warn(i + " cannot be less than min: " + e + ". Using min value instead."), e) : r : (i && x.warn(i + " must be a number. using max or fallback. max: " + t + ", fallback: " + s), le(s || t, e, t, i));
|
|
1197
1197
|
}
|
|
1198
|
-
class
|
|
1198
|
+
class $a {
|
|
1199
1199
|
constructor(e) {
|
|
1200
1200
|
var t, i, s = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
1201
1201
|
w(this, "_bucketSize", 100), w(this, "_refillRate", 10), w(this, "_mutationBuckets", {}), w(this, "_loggedTracker", {}), w(this, "_refillBuckets", () => {
|
|
@@ -1226,65 +1226,65 @@ class Pa {
|
|
|
1226
1226
|
}, 1e3);
|
|
1227
1227
|
}
|
|
1228
1228
|
}
|
|
1229
|
-
var
|
|
1230
|
-
for (var t = new
|
|
1231
|
-
var s = new
|
|
1229
|
+
var de = Uint8Array, re = Uint16Array, _t = Uint32Array, Sr = new de([0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, 0, 0, 0]), kr = new de([0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 0, 0]), hs = new de([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]), In = function(r, e) {
|
|
1230
|
+
for (var t = new re(31), i = 0; i < 31; ++i) t[i] = e += 1 << r[i - 1];
|
|
1231
|
+
var s = new _t(t[30]);
|
|
1232
1232
|
for (i = 1; i < 30; ++i) for (var n = t[i]; n < t[i + 1]; ++n) s[n] = n - t[i] << 5 | i;
|
|
1233
1233
|
return [t, s];
|
|
1234
|
-
}, Pn = In(
|
|
1235
|
-
|
|
1236
|
-
for (var ps = In(
|
|
1237
|
-
var
|
|
1238
|
-
|
|
1239
|
-
}
|
|
1240
|
-
var
|
|
1241
|
-
for (var i = r.length, s = 0, n = new
|
|
1242
|
-
var o, a = new
|
|
1234
|
+
}, Pn = In(Sr, 2), Oa = Pn[0], sr = Pn[1];
|
|
1235
|
+
Oa[28] = 258, sr[258] = 28;
|
|
1236
|
+
for (var ps = In(kr, 0)[1], Tn = new re(32768), A = 0; A < 32768; ++A) {
|
|
1237
|
+
var We = (43690 & A) >>> 1 | (21845 & A) << 1;
|
|
1238
|
+
We = (61680 & (We = (52428 & We) >>> 2 | (13107 & We) << 2)) >>> 4 | (3855 & We) << 4, Tn[A] = ((65280 & We) >>> 8 | (255 & We) << 8) >>> 1;
|
|
1239
|
+
}
|
|
1240
|
+
var Pt = function(r, e, t) {
|
|
1241
|
+
for (var i = r.length, s = 0, n = new re(e); s < i; ++s) ++n[r[s] - 1];
|
|
1242
|
+
var o, a = new re(e);
|
|
1243
1243
|
for (s = 0; s < e; ++s) a[s] = a[s - 1] + n[s - 1] << 1;
|
|
1244
|
-
for (o = new
|
|
1244
|
+
for (o = new re(i), s = 0; s < i; ++s) o[s] = Tn[a[r[s] - 1]++] >>> 15 - r[s];
|
|
1245
1245
|
return o;
|
|
1246
|
-
},
|
|
1247
|
-
for (A = 0; A < 144; ++A)
|
|
1248
|
-
for (A = 144; A < 256; ++A)
|
|
1249
|
-
for (A = 256; A < 280; ++A)
|
|
1250
|
-
for (A = 280; A < 288; ++A)
|
|
1251
|
-
var
|
|
1252
|
-
for (A = 0; A < 32; ++A)
|
|
1253
|
-
var
|
|
1246
|
+
}, Xe = new de(288);
|
|
1247
|
+
for (A = 0; A < 144; ++A) Xe[A] = 8;
|
|
1248
|
+
for (A = 144; A < 256; ++A) Xe[A] = 9;
|
|
1249
|
+
for (A = 256; A < 280; ++A) Xe[A] = 7;
|
|
1250
|
+
for (A = 280; A < 288; ++A) Xe[A] = 8;
|
|
1251
|
+
var ai = new de(32);
|
|
1252
|
+
for (A = 0; A < 32; ++A) ai[A] = 5;
|
|
1253
|
+
var La = Pt(Xe, 9), Aa = Pt(ai, 5), Fn = function(r) {
|
|
1254
1254
|
return (r / 8 >> 0) + (7 & r && 1);
|
|
1255
1255
|
}, Rn = function(r, e, t) {
|
|
1256
1256
|
(t == null || t > r.length) && (t = r.length);
|
|
1257
|
-
var i = new (r instanceof
|
|
1257
|
+
var i = new (r instanceof re ? re : r instanceof _t ? _t : de)(t - e);
|
|
1258
1258
|
return i.set(r.subarray(e, t)), i;
|
|
1259
|
-
},
|
|
1259
|
+
}, Se = function(r, e, t) {
|
|
1260
1260
|
t <<= 7 & e;
|
|
1261
1261
|
var i = e / 8 >> 0;
|
|
1262
1262
|
r[i] |= t, r[i + 1] |= t >>> 8;
|
|
1263
|
-
},
|
|
1263
|
+
}, mt = function(r, e, t) {
|
|
1264
1264
|
t <<= 7 & e;
|
|
1265
1265
|
var i = e / 8 >> 0;
|
|
1266
1266
|
r[i] |= t, r[i + 1] |= t >>> 8, r[i + 2] |= t >>> 16;
|
|
1267
|
-
},
|
|
1267
|
+
}, $i = function(r, e) {
|
|
1268
1268
|
for (var t = [], i = 0; i < r.length; ++i) r[i] && t.push({ s: i, f: r[i] });
|
|
1269
1269
|
var s = t.length, n = t.slice();
|
|
1270
|
-
if (!s) return [new
|
|
1270
|
+
if (!s) return [new de(0), 0];
|
|
1271
1271
|
if (s == 1) {
|
|
1272
|
-
var o = new
|
|
1272
|
+
var o = new de(t[0].s + 1);
|
|
1273
1273
|
return o[t[0].s] = 1, [o, 1];
|
|
1274
1274
|
}
|
|
1275
|
-
t.sort(function(
|
|
1276
|
-
return
|
|
1275
|
+
t.sort(function(T, O) {
|
|
1276
|
+
return T.f - O.f;
|
|
1277
1277
|
}), t.push({ s: -1, f: 25001 });
|
|
1278
1278
|
var a = t[0], l = t[1], c = 0, d = 1, u = 2;
|
|
1279
1279
|
for (t[0] = { s: -1, f: a.f + l.f, l: a, r: l }; d != s - 1; ) a = t[t[c].f < t[u].f ? c++ : u++], l = t[c != d && t[c].f < t[u].f ? c++ : u++], t[d++] = { s: -1, f: a.f + l.f, l: a, r: l };
|
|
1280
1280
|
var h = n[0].s;
|
|
1281
1281
|
for (i = 1; i < s; ++i) n[i].s > h && (h = n[i].s);
|
|
1282
|
-
var _ = new
|
|
1282
|
+
var _ = new re(h + 1), p = nr(t[d - 1], _, 0);
|
|
1283
1283
|
if (p > e) {
|
|
1284
1284
|
i = 0;
|
|
1285
1285
|
var v = 0, b = p - e, y = 1 << b;
|
|
1286
|
-
for (n.sort(function(
|
|
1287
|
-
return _[O.s] - _[
|
|
1286
|
+
for (n.sort(function(T, O) {
|
|
1287
|
+
return _[O.s] - _[T.s] || T.f - O.f;
|
|
1288
1288
|
}); i < s; ++i) {
|
|
1289
1289
|
var m = n[i].s;
|
|
1290
1290
|
if (!(_[m] > e)) break;
|
|
@@ -1300,12 +1300,12 @@ var Ta = It(Ye, 9), Ra = It(si, 5), Tn = function(r) {
|
|
|
1300
1300
|
}
|
|
1301
1301
|
p = e;
|
|
1302
1302
|
}
|
|
1303
|
-
return [new
|
|
1304
|
-
},
|
|
1305
|
-
return r.s == -1 ? Math.max(
|
|
1303
|
+
return [new de(_), p];
|
|
1304
|
+
}, nr = function(r, e, t) {
|
|
1305
|
+
return r.s == -1 ? Math.max(nr(r.l, e, t + 1), nr(r.r, e, t + 1)) : e[r.s] = t;
|
|
1306
1306
|
}, gs = function(r) {
|
|
1307
1307
|
for (var e = r.length; e && !r[--e]; ) ;
|
|
1308
|
-
for (var t = new
|
|
1308
|
+
for (var t = new re(++e), i = 0, s = r[0], n = 1, o = function(l) {
|
|
1309
1309
|
t[i++] = l;
|
|
1310
1310
|
}, a = 1; a <= e; ++a) if (r[a] == s && a != e) ++n;
|
|
1311
1311
|
else {
|
|
@@ -1320,125 +1320,125 @@ var Ta = It(Ye, 9), Ra = It(si, 5), Tn = function(r) {
|
|
|
1320
1320
|
n = 1, s = r[a];
|
|
1321
1321
|
}
|
|
1322
1322
|
return [t.subarray(0, i), e];
|
|
1323
|
-
},
|
|
1323
|
+
}, yt = function(r, e) {
|
|
1324
1324
|
for (var t = 0, i = 0; i < e.length; ++i) t += r[i] * e[i];
|
|
1325
1325
|
return t;
|
|
1326
|
-
},
|
|
1327
|
-
var i = t.length, s =
|
|
1326
|
+
}, or = function(r, e, t) {
|
|
1327
|
+
var i = t.length, s = Fn(e + 2);
|
|
1328
1328
|
r[s] = 255 & i, r[s + 1] = i >>> 8, r[s + 2] = 255 ^ r[s], r[s + 3] = 255 ^ r[s + 1];
|
|
1329
1329
|
for (var n = 0; n < i; ++n) r[s + n + 4] = t[n];
|
|
1330
1330
|
return 8 * (s + 4 + i);
|
|
1331
1331
|
}, vs = function(r, e, t, i, s, n, o, a, l, c, d) {
|
|
1332
|
-
|
|
1333
|
-
for (var u =
|
|
1334
|
-
for (P = 0; P <
|
|
1335
|
-
for (var M =
|
|
1336
|
-
var
|
|
1337
|
-
if (
|
|
1338
|
-
if (
|
|
1339
|
-
|
|
1340
|
-
var
|
|
1341
|
-
for (
|
|
1332
|
+
Se(e, d++, t), ++s[256];
|
|
1333
|
+
for (var u = $i(s, 15), h = u[0], _ = u[1], p = $i(n, 15), v = p[0], b = p[1], y = gs(h), m = y[0], E = y[1], C = gs(v), T = C[0], O = C[1], L = new re(19), P = 0; P < m.length; ++P) L[31 & m[P]]++;
|
|
1334
|
+
for (P = 0; P < T.length; ++P) L[31 & T[P]]++;
|
|
1335
|
+
for (var M = $i(L, 7), z = M[0], he = M[1], oe = 19; oe > 4 && !z[hs[oe - 1]]; --oe) ;
|
|
1336
|
+
var we, ve, fe, et, Te = c + 5 << 3, Ue = yt(s, Xe) + yt(n, ai) + o, me = yt(s, h) + yt(n, v) + o + 14 + 3 * oe + yt(L, z) + (2 * L[16] + 3 * L[17] + 7 * L[18]);
|
|
1337
|
+
if (Te <= Ue && Te <= me) return or(e, d, r.subarray(l, l + c));
|
|
1338
|
+
if (Se(e, d, 1 + (me < Ue)), d += 2, me < Ue) {
|
|
1339
|
+
we = Pt(h, _), ve = h, fe = Pt(v, b), et = v;
|
|
1340
|
+
var Fe = Pt(z, he);
|
|
1341
|
+
for (Se(e, d, E - 257), Se(e, d + 5, O - 1), Se(e, d + 10, oe - 4), d += 14, P = 0; P < oe; ++P) Se(e, d + 3 * P, z[hs[P]]);
|
|
1342
1342
|
d += 3 * oe;
|
|
1343
|
-
for (var
|
|
1344
|
-
var ae =
|
|
1343
|
+
for (var tt = [m, T], X = 0; X < 2; ++X) {
|
|
1344
|
+
var ae = tt[X];
|
|
1345
1345
|
for (P = 0; P < ae.length; ++P) {
|
|
1346
|
-
var
|
|
1347
|
-
|
|
1346
|
+
var se = 31 & ae[P];
|
|
1347
|
+
Se(e, d, Fe[se]), d += z[se], se > 15 && (Se(e, d, ae[P] >>> 5 & 127), d += ae[P] >>> 12);
|
|
1348
1348
|
}
|
|
1349
1349
|
}
|
|
1350
|
-
} else
|
|
1350
|
+
} else we = La, ve = Xe, fe = Aa, et = ai;
|
|
1351
1351
|
for (P = 0; P < a; ++P) if (i[P] > 255) {
|
|
1352
|
-
|
|
1353
|
-
var
|
|
1354
|
-
|
|
1355
|
-
} else
|
|
1356
|
-
return
|
|
1357
|
-
},
|
|
1358
|
-
for (var r = new
|
|
1352
|
+
se = i[P] >>> 18 & 31, mt(e, d, we[se + 257]), d += ve[se + 257], se > 7 && (Se(e, d, i[P] >>> 23 & 31), d += Sr[se]);
|
|
1353
|
+
var it = 31 & i[P];
|
|
1354
|
+
mt(e, d, fe[it]), d += et[it], it > 3 && (mt(e, d, i[P] >>> 5 & 8191), d += kr[it]);
|
|
1355
|
+
} else mt(e, d, we[i[P]]), d += ve[i[P]];
|
|
1356
|
+
return mt(e, d, we[256]), d + ve[256];
|
|
1357
|
+
}, Ma = new _t([65540, 131080, 131088, 131104, 262176, 1048704, 1048832, 2114560, 2117632]), Da = function() {
|
|
1358
|
+
for (var r = new _t(256), e = 0; e < 256; ++e) {
|
|
1359
1359
|
for (var t = e, i = 9; --i; ) t = (1 & t && 3988292384) ^ t >>> 1;
|
|
1360
1360
|
r[e] = t;
|
|
1361
1361
|
}
|
|
1362
1362
|
return r;
|
|
1363
|
-
}(),
|
|
1363
|
+
}(), qa = function() {
|
|
1364
1364
|
var r = 4294967295;
|
|
1365
1365
|
return { p: function(e) {
|
|
1366
|
-
for (var t = r, i = 0; i < e.length; ++i) t =
|
|
1366
|
+
for (var t = r, i = 0; i < e.length; ++i) t = Da[255 & t ^ e[i]] ^ t >>> 8;
|
|
1367
1367
|
r = t;
|
|
1368
1368
|
}, d: function() {
|
|
1369
1369
|
return 4294967295 ^ r;
|
|
1370
1370
|
} };
|
|
1371
|
-
},
|
|
1371
|
+
}, Na = function(r, e, t, i, s) {
|
|
1372
1372
|
return function(n, o, a, l, c, d) {
|
|
1373
|
-
var u = n.length, h = new
|
|
1373
|
+
var u = n.length, h = new de(l + u + 5 * (1 + Math.floor(u / 7e3)) + c), _ = h.subarray(l, h.length - c), p = 0;
|
|
1374
1374
|
if (!o || u < 8) for (var v = 0; v <= u; v += 65535) {
|
|
1375
1375
|
var b = v + 65535;
|
|
1376
|
-
b < u ? p =
|
|
1376
|
+
b < u ? p = or(_, p, n.subarray(v, b)) : (_[v] = d, p = or(_, p, n.subarray(v, u)));
|
|
1377
1377
|
}
|
|
1378
1378
|
else {
|
|
1379
|
-
for (var y =
|
|
1380
|
-
return (n[
|
|
1381
|
-
}, z = new
|
|
1382
|
-
var
|
|
1383
|
-
if (
|
|
1384
|
-
var
|
|
1385
|
-
if ((
|
|
1386
|
-
p = vs(n, _, 0, z,
|
|
1387
|
-
for (var
|
|
1388
|
-
for (
|
|
1379
|
+
for (var y = Ma[o - 1], m = y >>> 13, E = 8191 & y, C = (1 << a) - 1, T = new re(32768), O = new re(C + 1), L = Math.ceil(a / 3), P = 2 * L, M = function(yi) {
|
|
1380
|
+
return (n[yi] ^ n[yi + 1] << L ^ n[yi + 2] << P) & C;
|
|
1381
|
+
}, z = new _t(25e3), he = new re(288), oe = new re(32), we = 0, ve = 0, fe = (v = 0, 0), et = 0, Te = 0; v < u; ++v) {
|
|
1382
|
+
var Ue = M(v), me = 32767 & v, Fe = O[Ue];
|
|
1383
|
+
if (T[me] = Fe, O[Ue] = me, et <= v) {
|
|
1384
|
+
var tt = u - v;
|
|
1385
|
+
if ((we > 7e3 || fe > 24576) && tt > 423) {
|
|
1386
|
+
p = vs(n, _, 0, z, he, oe, ve, fe, Te, v - Te, p), fe = we = ve = 0, Te = v;
|
|
1387
|
+
for (var X = 0; X < 286; ++X) he[X] = 0;
|
|
1388
|
+
for (X = 0; X < 30; ++X) oe[X] = 0;
|
|
1389
1389
|
}
|
|
1390
|
-
var ae = 2,
|
|
1391
|
-
if (
|
|
1390
|
+
var ae = 2, se = 0, it = E, Re = me - Fe & 32767;
|
|
1391
|
+
if (tt > 2 && Ue == M(v - Re)) for (var wo = Math.min(m, tt) - 1, So = Math.min(32767, v), ko = Math.min(258, tt); Re <= So && --it && me != Fe; ) {
|
|
1392
1392
|
if (n[v + ae] == n[v + ae - Re]) {
|
|
1393
1393
|
for (var $e = 0; $e < ko && n[v + $e] == n[v + $e - Re]; ++$e) ;
|
|
1394
1394
|
if ($e > ae) {
|
|
1395
|
-
if (ae = $e,
|
|
1396
|
-
var Eo = Math.min(Re, $e - 2),
|
|
1397
|
-
for (
|
|
1398
|
-
var
|
|
1399
|
-
|
|
1395
|
+
if (ae = $e, se = Re, $e > wo) break;
|
|
1396
|
+
var Eo = Math.min(Re, $e - 2), $r = 0;
|
|
1397
|
+
for (X = 0; X < Eo; ++X) {
|
|
1398
|
+
var mi = v - Re + X + 32768 & 32767, Or = mi - T[mi] + 32768 & 32767;
|
|
1399
|
+
Or > $r && ($r = Or, Fe = mi);
|
|
1400
1400
|
}
|
|
1401
1401
|
}
|
|
1402
1402
|
}
|
|
1403
|
-
Re += (
|
|
1403
|
+
Re += (me = Fe) - (Fe = T[me]) + 32768 & 32767;
|
|
1404
1404
|
}
|
|
1405
|
-
if (
|
|
1406
|
-
z[
|
|
1407
|
-
var
|
|
1408
|
-
|
|
1409
|
-
} else z[
|
|
1405
|
+
if (se) {
|
|
1406
|
+
z[fe++] = 268435456 | sr[ae] << 18 | ps[se];
|
|
1407
|
+
var Lr = 31 & sr[ae], Ar = 31 & ps[se];
|
|
1408
|
+
ve += Sr[Lr] + kr[Ar], ++he[257 + Lr], ++oe[Ar], et = v + ae, ++we;
|
|
1409
|
+
} else z[fe++] = n[v], ++he[n[v]];
|
|
1410
1410
|
}
|
|
1411
1411
|
}
|
|
1412
|
-
p = vs(n, _, d, z,
|
|
1412
|
+
p = vs(n, _, d, z, he, oe, ve, fe, Te, v - Te, p);
|
|
1413
1413
|
}
|
|
1414
|
-
return Rn(h, 0, l +
|
|
1414
|
+
return Rn(h, 0, l + Fn(p) + c);
|
|
1415
1415
|
}(r, e.level == null ? 6 : e.level, e.mem == null ? Math.ceil(1.5 * Math.max(8, Math.min(13, Math.log(r.length)))) : 12 + e.mem, t, i, !0);
|
|
1416
|
-
},
|
|
1416
|
+
}, ar = function(r, e, t) {
|
|
1417
1417
|
for (; t; ++e) r[e] = t, t >>>= 8;
|
|
1418
|
-
},
|
|
1418
|
+
}, Ba = function(r, e) {
|
|
1419
1419
|
var t = e.filename;
|
|
1420
|
-
if (r[0] = 31, r[1] = 139, r[2] = 8, r[8] = e.level < 2 ? 4 : e.level == 9 ? 2 : 0, r[9] = 3, e.mtime != 0 &&
|
|
1420
|
+
if (r[0] = 31, r[1] = 139, r[2] = 8, r[8] = e.level < 2 ? 4 : e.level == 9 ? 2 : 0, r[9] = 3, e.mtime != 0 && ar(r, 4, Math.floor(new Date(e.mtime || Date.now()) / 1e3)), t) {
|
|
1421
1421
|
r[3] = 8;
|
|
1422
1422
|
for (var i = 0; i <= t.length; ++i) r[i + 10] = t.charCodeAt(i);
|
|
1423
1423
|
}
|
|
1424
|
-
},
|
|
1424
|
+
}, Ha = function(r) {
|
|
1425
1425
|
return 10 + (r.filename && r.filename.length + 1 || 0);
|
|
1426
1426
|
};
|
|
1427
1427
|
function $n(r, e) {
|
|
1428
1428
|
e === void 0 && (e = {});
|
|
1429
|
-
var t =
|
|
1429
|
+
var t = qa(), i = r.length;
|
|
1430
1430
|
t.p(r);
|
|
1431
|
-
var s =
|
|
1432
|
-
return
|
|
1431
|
+
var s = Na(r, e, Ha(e), 8), n = s.length;
|
|
1432
|
+
return Ba(s, e), ar(s, n - 8, t.d()), ar(s, n - 4, i), s;
|
|
1433
1433
|
}
|
|
1434
1434
|
function On(r, e) {
|
|
1435
1435
|
var t = r.length;
|
|
1436
1436
|
if (typeof TextEncoder < "u") return new TextEncoder().encode(r);
|
|
1437
|
-
for (var i = new
|
|
1437
|
+
for (var i = new de(r.length + (r.length >>> 1)), s = 0, n = function(c) {
|
|
1438
1438
|
i[s++] = c;
|
|
1439
1439
|
}, o = 0; o < t; ++o) {
|
|
1440
1440
|
if (s + 5 > i.length) {
|
|
1441
|
-
var a = new
|
|
1441
|
+
var a = new de(s + 8 + (t - o << 1));
|
|
1442
1442
|
a.set(i), i = a;
|
|
1443
1443
|
}
|
|
1444
1444
|
var l = r.charCodeAt(o);
|
|
@@ -1446,19 +1446,19 @@ function On(r, e) {
|
|
|
1446
1446
|
}
|
|
1447
1447
|
return Rn(i, 0, s);
|
|
1448
1448
|
}
|
|
1449
|
-
function
|
|
1449
|
+
function ja(r, e) {
|
|
1450
1450
|
return function(t) {
|
|
1451
1451
|
for (var i = 0, s = 0; s < t.length; s++) i = (i << 5) - i + t.charCodeAt(s), i |= 0;
|
|
1452
1452
|
return Math.abs(i);
|
|
1453
1453
|
}(r) % 100 < le(100 * e, 0, 100);
|
|
1454
1454
|
}
|
|
1455
|
-
var
|
|
1455
|
+
var xt = "[SessionRecording]", V = Q(xt);
|
|
1456
1456
|
function Ht() {
|
|
1457
1457
|
var r, e;
|
|
1458
1458
|
return I == null || (r = I.__PosthogExtensions__) === null || r === void 0 || (e = r.rrweb) === null || e === void 0 ? void 0 : e.record;
|
|
1459
1459
|
}
|
|
1460
|
-
var
|
|
1461
|
-
function
|
|
1460
|
+
var Ua = 3e5, za = [pe.MouseMove, pe.MouseInteraction, pe.Scroll, pe.ViewportResize, pe.Input, pe.TouchMove, pe.MediaInteraction, pe.Drag], fs = (r) => ({ rrwebMethod: r, enqueuedAt: Date.now(), attempt: 1 });
|
|
1461
|
+
function Ve(r) {
|
|
1462
1462
|
return function(e, t) {
|
|
1463
1463
|
for (var i = "", s = 0; s < e.length; ) {
|
|
1464
1464
|
var n = e[s++];
|
|
@@ -1468,12 +1468,12 @@ function ze(r) {
|
|
|
1468
1468
|
}($n(On(JSON.stringify(r))));
|
|
1469
1469
|
}
|
|
1470
1470
|
function ms(r) {
|
|
1471
|
-
return r.type ===
|
|
1471
|
+
return r.type === Ee.Custom && r.data.tag === "sessionIdle";
|
|
1472
1472
|
}
|
|
1473
1473
|
function ys(r, e) {
|
|
1474
1474
|
return e.some((t) => t.matching === "regex" && new RegExp(t.url).test(r));
|
|
1475
1475
|
}
|
|
1476
|
-
class
|
|
1476
|
+
class Wa {
|
|
1477
1477
|
get _sessionIdleThresholdMilliseconds() {
|
|
1478
1478
|
return this._instance.config.session_recording.session_idle_threshold_ms || 3e5;
|
|
1479
1479
|
}
|
|
@@ -1481,23 +1481,23 @@ class Ha {
|
|
|
1481
1481
|
return this._captureStarted;
|
|
1482
1482
|
}
|
|
1483
1483
|
get _sessionManager() {
|
|
1484
|
-
if (!this._instance.sessionManager) throw new Error(
|
|
1484
|
+
if (!this._instance.sessionManager) throw new Error(xt + " must be started with a valid sessionManager.");
|
|
1485
1485
|
return this._instance.sessionManager;
|
|
1486
1486
|
}
|
|
1487
1487
|
get _fullSnapshotIntervalMillis() {
|
|
1488
1488
|
var e, t;
|
|
1489
|
-
return this._triggerStatus === "trigger_pending" ? 6e4 : (e = (t = this._instance.config.session_recording) === null || t === void 0 ? void 0 : t.full_snapshot_interval_millis) !== null && e !== void 0 ? e :
|
|
1489
|
+
return this._triggerStatus === "trigger_pending" ? 6e4 : (e = (t = this._instance.config.session_recording) === null || t === void 0 ? void 0 : t.full_snapshot_interval_millis) !== null && e !== void 0 ? e : Ua;
|
|
1490
1490
|
}
|
|
1491
1491
|
get _isSampled() {
|
|
1492
|
-
var e = this._instance.get_property(
|
|
1493
|
-
return
|
|
1492
|
+
var e = this._instance.get_property(kt);
|
|
1493
|
+
return Ie(e) ? e : null;
|
|
1494
1494
|
}
|
|
1495
1495
|
get _sessionDuration() {
|
|
1496
1496
|
var e, t, i = (e = this._buffer) === null || e === void 0 ? void 0 : e.data[((t = this._buffer) === null || t === void 0 ? void 0 : t.data.length) - 1], { sessionStartTimestamp: s } = this._sessionManager.checkAndGetSessionAndWindowId(!0);
|
|
1497
1497
|
return i ? i.timestamp - s : null;
|
|
1498
1498
|
}
|
|
1499
1499
|
get _isRecordingEnabled() {
|
|
1500
|
-
var e = !!this._instance.get_property(
|
|
1500
|
+
var e = !!this._instance.get_property(Wi), t = !this._instance.config.disable_session_recording;
|
|
1501
1501
|
return g && e && t;
|
|
1502
1502
|
}
|
|
1503
1503
|
get _isConsoleLogCaptureEnabled() {
|
|
@@ -1513,7 +1513,7 @@ class Ha {
|
|
|
1513
1513
|
return { enabled: c, fps: le(d, 0, 12, "canvas recording fps", 4), quality: le(u, 0, 1, "canvas recording quality", 0.4) };
|
|
1514
1514
|
}
|
|
1515
1515
|
get _networkPayloadCapture() {
|
|
1516
|
-
var e, t, i = this._instance.get_property(Jr), s = { recordHeaders: (e = this._instance.config.session_recording) === null || e === void 0 ? void 0 : e.recordHeaders, recordBody: (t = this._instance.config.session_recording) === null || t === void 0 ? void 0 : t.recordBody }, n = (s == null ? void 0 : s.recordHeaders) || (i == null ? void 0 : i.recordHeaders), o = (s == null ? void 0 : s.recordBody) || (i == null ? void 0 : i.recordBody), a = q(this._instance.config.capture_performance) ? this._instance.config.capture_performance.network_timing : this._instance.config.capture_performance, l = !!(
|
|
1516
|
+
var e, t, i = this._instance.get_property(Jr), s = { recordHeaders: (e = this._instance.config.session_recording) === null || e === void 0 ? void 0 : e.recordHeaders, recordBody: (t = this._instance.config.session_recording) === null || t === void 0 ? void 0 : t.recordBody }, n = (s == null ? void 0 : s.recordHeaders) || (i == null ? void 0 : i.recordHeaders), o = (s == null ? void 0 : s.recordBody) || (i == null ? void 0 : i.recordBody), a = q(this._instance.config.capture_performance) ? this._instance.config.capture_performance.network_timing : this._instance.config.capture_performance, l = !!(Ie(a) ? a : i != null && i.capturePerformance);
|
|
1517
1517
|
return n || o || l ? { recordHeaders: n, recordBody: o, recordPerformance: l } : void 0;
|
|
1518
1518
|
}
|
|
1519
1519
|
get _masking() {
|
|
@@ -1522,22 +1522,22 @@ class Ha {
|
|
|
1522
1522
|
}
|
|
1523
1523
|
get _sampleRate() {
|
|
1524
1524
|
var e = this._instance.get_property(Qr);
|
|
1525
|
-
return
|
|
1525
|
+
return Y(e) ? e : null;
|
|
1526
1526
|
}
|
|
1527
1527
|
get _minimumDuration() {
|
|
1528
1528
|
var e = this._instance.get_property(Xr);
|
|
1529
|
-
return
|
|
1529
|
+
return Y(e) ? e : null;
|
|
1530
1530
|
}
|
|
1531
1531
|
get status() {
|
|
1532
|
-
return this._receivedDecide ? this._isRecordingEnabled ? this._isSampled === !1 ? "disabled" : this._urlBlocked ? "paused" : R(this._linkedFlag) || this._linkedFlagSeen ? this._triggerStatus === "trigger_pending" ? "buffering" :
|
|
1532
|
+
return this._receivedDecide ? this._isRecordingEnabled ? this._isSampled === !1 ? "disabled" : this._urlBlocked ? "paused" : R(this._linkedFlag) || this._linkedFlagSeen ? this._triggerStatus === "trigger_pending" ? "buffering" : Ie(this._isSampled) ? this._isSampled ? "sampled" : "disabled" : "active" : "buffering" : "disabled" : "buffering";
|
|
1533
1533
|
}
|
|
1534
1534
|
get _urlTriggerStatus() {
|
|
1535
1535
|
var e;
|
|
1536
|
-
return this._urlTriggers.length === 0 ? "trigger_disabled" : ((e = this._instance) === null || e === void 0 ? void 0 : e.get_property(
|
|
1536
|
+
return this._urlTriggers.length === 0 ? "trigger_disabled" : ((e = this._instance) === null || e === void 0 ? void 0 : e.get_property(Si)) === this._sessionId ? "trigger_activated" : "trigger_pending";
|
|
1537
1537
|
}
|
|
1538
1538
|
get _eventTriggerStatus() {
|
|
1539
1539
|
var e;
|
|
1540
|
-
return this._eventTriggers.length === 0 ? "trigger_disabled" : ((e = this._instance) === null || e === void 0 ? void 0 : e.get_property(
|
|
1540
|
+
return this._eventTriggers.length === 0 ? "trigger_disabled" : ((e = this._instance) === null || e === void 0 ? void 0 : e.get_property(ki)) === this._sessionId ? "trigger_activated" : "trigger_pending";
|
|
1541
1541
|
}
|
|
1542
1542
|
get _triggerStatus() {
|
|
1543
1543
|
var e = this._eventTriggerStatus === "trigger_activated" || this._urlTriggerStatus === "trigger_activated", t = this._eventTriggerStatus === "trigger_pending" || this._urlTriggerStatus === "trigger_pending";
|
|
@@ -1555,8 +1555,8 @@ class Ha {
|
|
|
1555
1555
|
var s = "window " + k.visibilityState;
|
|
1556
1556
|
this._tryAddCustomEvent(s, {});
|
|
1557
1557
|
}
|
|
1558
|
-
}), this._instance = e, this._captureStarted = !1, this._endpoint = "/s/", this._stopRrweb = void 0, this._receivedDecide = !1, !this._instance.sessionManager) throw V.error("started without valid sessionManager"), new Error(
|
|
1559
|
-
if (this._instance.config.__preview_experimental_cookieless_mode) throw new Error(
|
|
1558
|
+
}), this._instance = e, this._captureStarted = !1, this._endpoint = "/s/", this._stopRrweb = void 0, this._receivedDecide = !1, !this._instance.sessionManager) throw V.error("started without valid sessionManager"), new Error(xt + " started without valid sessionManager. This is a bug.");
|
|
1559
|
+
if (this._instance.config.__preview_experimental_cookieless_mode) throw new Error(xt + " cannot be used with __preview_experimental_cookieless_mode.");
|
|
1560
1560
|
var { sessionId: t, windowId: i } = this._sessionManager.checkAndGetSessionAndWindowId();
|
|
1561
1561
|
this._sessionId = t, this._windowId = i, this._buffer = this._clearBuffer(), this._sessionIdleThresholdMilliseconds >= this._sessionManager.sessionTimeoutMs && V.warn("session_idle_threshold_ms (".concat(this._sessionIdleThresholdMilliseconds, ") is greater than the session timeout (").concat(this._sessionManager.sessionTimeoutMs, "). Session will never be detected as idle"));
|
|
1562
1562
|
}
|
|
@@ -1573,7 +1573,7 @@ class Ha {
|
|
|
1573
1573
|
}
|
|
1574
1574
|
})), this._onSessionIdListener || (this._onSessionIdListener = this._sessionManager.onSessionId((t, i, s) => {
|
|
1575
1575
|
var n, o, a, l;
|
|
1576
|
-
s && (this._tryAddCustomEvent("$session_id_change", { sessionId: t, windowId: i, changeReason: s }), (n = this._instance) === null || n === void 0 || (o = n.persistence) === null || o === void 0 || o.unregister(
|
|
1576
|
+
s && (this._tryAddCustomEvent("$session_id_change", { sessionId: t, windowId: i, changeReason: s }), (n = this._instance) === null || n === void 0 || (o = n.persistence) === null || o === void 0 || o.unregister(ki), (a = this._instance) === null || a === void 0 || (l = a.persistence) === null || l === void 0 || l.unregister(Si));
|
|
1577
1577
|
}))) : this.stopRecording();
|
|
1578
1578
|
}
|
|
1579
1579
|
stopRecording() {
|
|
@@ -1582,13 +1582,13 @@ class Ha {
|
|
|
1582
1582
|
}
|
|
1583
1583
|
_resetSampling() {
|
|
1584
1584
|
var e;
|
|
1585
|
-
(e = this._instance.persistence) === null || e === void 0 || e.unregister(
|
|
1585
|
+
(e = this._instance.persistence) === null || e === void 0 || e.unregister(kt);
|
|
1586
1586
|
}
|
|
1587
1587
|
_makeSamplingDecision(e) {
|
|
1588
1588
|
var t, i = this._sessionId !== e, s = this._sampleRate;
|
|
1589
|
-
if (
|
|
1590
|
-
var n = this._isSampled, o = i || !
|
|
1591
|
-
o && (a ? this._reportStarted("sampled") : V.warn("Sample rate (".concat(s, ") has determined that this sessionId (").concat(e, ") will not be sent to the server.")), this._tryAddCustomEvent("samplingDecisionMade", { sampleRate: s, isSampled: a })), (t = this._instance.persistence) === null || t === void 0 || t.register({ [
|
|
1589
|
+
if (Y(s)) {
|
|
1590
|
+
var n = this._isSampled, o = i || !Ie(n), a = o ? ja(e, s) : n;
|
|
1591
|
+
o && (a ? this._reportStarted("sampled") : V.warn("Sample rate (".concat(s, ") has determined that this sessionId (").concat(e, ") will not be sent to the server.")), this._tryAddCustomEvent("samplingDecisionMade", { sampleRate: s, isSampled: a })), (t = this._instance.persistence) === null || t === void 0 || t.register({ [kt]: a });
|
|
1592
1592
|
} else this._resetSampling();
|
|
1593
1593
|
}
|
|
1594
1594
|
onRemoteConfig(e) {
|
|
@@ -1603,7 +1603,7 @@ class Ha {
|
|
|
1603
1603
|
(s = e.sessionRecording) !== null && s !== void 0 && s.urlTriggers && (this._urlTriggers = e.sessionRecording.urlTriggers), (n = e.sessionRecording) !== null && n !== void 0 && n.urlBlocklist && (this._urlBlocklist = e.sessionRecording.urlBlocklist), (o = e.sessionRecording) !== null && o !== void 0 && o.eventTriggers && (this._eventTriggers = e.sessionRecording.eventTriggers), this._receivedDecide = !0, this.startIfEnabledOrStop();
|
|
1604
1604
|
}
|
|
1605
1605
|
_setupSampling() {
|
|
1606
|
-
|
|
1606
|
+
Y(this._sampleRate) && R(this._samplingSessionListener) && (this._samplingSessionListener = this._sessionManager.onSessionId((e) => {
|
|
1607
1607
|
this._makeSamplingDecision(e);
|
|
1608
1608
|
}));
|
|
1609
1609
|
}
|
|
@@ -1613,7 +1613,7 @@ class Ha {
|
|
|
1613
1613
|
var n, o, a, l, c, d, u, h, _, p = (n = e.sessionRecording) === null || n === void 0 ? void 0 : n.sampleRate, v = R(p) ? null : parseFloat(p);
|
|
1614
1614
|
R(v) && this._resetSampling();
|
|
1615
1615
|
var b = (o = e.sessionRecording) === null || o === void 0 ? void 0 : o.minimumDurationMilliseconds;
|
|
1616
|
-
i.register({ [
|
|
1616
|
+
i.register({ [Wi]: !!e.sessionRecording, [Gr]: (a = e.sessionRecording) === null || a === void 0 ? void 0 : a.consoleLogRecordingEnabled, [Jr]: f({ capturePerformance: e.capturePerformance }, (l = e.sessionRecording) === null || l === void 0 ? void 0 : l.networkPayloadCapture), [Kr]: (c = e.sessionRecording) === null || c === void 0 ? void 0 : c.masking, [Yr]: { enabled: (d = e.sessionRecording) === null || d === void 0 ? void 0 : d.recordCanvas, fps: (u = e.sessionRecording) === null || u === void 0 ? void 0 : u.canvasFps, quality: (h = e.sessionRecording) === null || h === void 0 ? void 0 : h.canvasQuality }, [Qr]: v, [Xr]: S(b) ? null : b, [Zr]: (_ = e.sessionRecording) === null || _ === void 0 ? void 0 : _.scriptConfig });
|
|
1617
1617
|
};
|
|
1618
1618
|
s(), (t = this._persistDecideOnSessionListener) === null || t === void 0 || t.call(this), this._persistDecideOnSessionListener = this._sessionManager.onSessionId(s);
|
|
1619
1619
|
}
|
|
@@ -1637,7 +1637,7 @@ class Ha {
|
|
|
1637
1637
|
}
|
|
1638
1638
|
_isInteractiveEvent(e) {
|
|
1639
1639
|
var t;
|
|
1640
|
-
return e.type === 3 &&
|
|
1640
|
+
return e.type === 3 && za.indexOf((t = e.data) === null || t === void 0 ? void 0 : t.source) !== -1;
|
|
1641
1641
|
}
|
|
1642
1642
|
_updateWindowAndSessionIds(e) {
|
|
1643
1643
|
var t = this._isInteractiveEvent(e);
|
|
@@ -1671,14 +1671,14 @@ class Ha {
|
|
|
1671
1671
|
this._canvasRecording && this._canvasRecording.enabled && (n.recordCanvas = !0, n.sampling = { canvas: this._canvasRecording.fps }, n.dataURLOptions = { type: "image/webp", quality: this._canvasRecording.quality }), this._masking && (n.maskAllInputs = (t = this._masking.maskAllInputs) === null || t === void 0 || t, n.maskTextSelector = (i = this._masking.maskTextSelector) !== null && i !== void 0 ? i : void 0, n.blockSelector = (s = this._masking.blockSelector) !== null && s !== void 0 ? s : void 0);
|
|
1672
1672
|
var c = Ht();
|
|
1673
1673
|
if (c) {
|
|
1674
|
-
this._mutationRateLimiter = (e = this._mutationRateLimiter) !== null && e !== void 0 ? e : new
|
|
1674
|
+
this._mutationRateLimiter = (e = this._mutationRateLimiter) !== null && e !== void 0 ? e : new $a(c, { refillRate: this._instance.config.session_recording.__mutationRateLimiterRefillRate, bucketSize: this._instance.config.session_recording.__mutationRateLimiterBucketSize, onBlockedNode: (u, h) => {
|
|
1675
1675
|
var _ = "Too many mutations on node '".concat(u, "'. Rate limiting. This could be due to SVG animations or something similar");
|
|
1676
|
-
V.info(_, { node: h }), this.log(
|
|
1676
|
+
V.info(_, { node: h }), this.log(xt + " " + _, "warn");
|
|
1677
1677
|
} });
|
|
1678
1678
|
var d = this._gatherRRWebPlugins();
|
|
1679
1679
|
this._stopRrweb = c(f({ emit: (u) => {
|
|
1680
1680
|
this.onRRwebEmit(u);
|
|
1681
|
-
}, plugins: d }, n)), this._lastActivityTimestamp = Date.now(), this._isIdle =
|
|
1681
|
+
}, plugins: d }, n)), this._lastActivityTimestamp = Date.now(), this._isIdle = Ie(this._isIdle) ? this._isIdle : "unknown", this._tryAddCustomEvent("$session_options", { sessionRecordingOptions: n, activePlugins: d.map((u) => u == null ? void 0 : u.name) }), this._tryAddCustomEvent("$posthog_config", { config: this._instance.config });
|
|
1682
1682
|
} else V.error("onScriptLoaded was called but rrwebRecord is not available. This indicates something has gone wrong.");
|
|
1683
1683
|
}
|
|
1684
1684
|
_scheduleFullSnapshot() {
|
|
@@ -1693,20 +1693,20 @@ class Ha {
|
|
|
1693
1693
|
var e, t, i, s, n = [], o = (e = I.__PosthogExtensions__) === null || e === void 0 || (t = e.rrwebPlugins) === null || t === void 0 ? void 0 : t.getRecordConsolePlugin;
|
|
1694
1694
|
o && this._isConsoleLogCaptureEnabled && n.push(o());
|
|
1695
1695
|
var a = (i = I.__PosthogExtensions__) === null || i === void 0 || (s = i.rrwebPlugins) === null || s === void 0 ? void 0 : s.getRecordNetworkPlugin;
|
|
1696
|
-
return this._networkPayloadCapture &&
|
|
1696
|
+
return this._networkPayloadCapture && ce(a) && (!Qo.includes(location.hostname) || this._forceAllowLocalhostNetworkCapture ? n.push(a(Ra(this._instance.config, this._networkPayloadCapture))) : V.info("NetworkCapture not started because we are on localhost.")), n;
|
|
1697
1697
|
}
|
|
1698
1698
|
onRRwebEmit(e) {
|
|
1699
1699
|
var t;
|
|
1700
1700
|
if (this._processQueuedEvents(), e && q(e)) {
|
|
1701
|
-
if (e.type ===
|
|
1701
|
+
if (e.type === Ee.Meta) {
|
|
1702
1702
|
var i = this._maskUrl(e.data.href);
|
|
1703
1703
|
if (this._lastHref = i, !i) return;
|
|
1704
1704
|
e.data.href = i;
|
|
1705
1705
|
} else this._pageViewFallBack();
|
|
1706
1706
|
if (this._checkUrlTriggerConditions(), !this._urlBlocked || function(u) {
|
|
1707
|
-
return u.type ===
|
|
1707
|
+
return u.type === Ee.Custom && u.data.tag === "recording paused";
|
|
1708
1708
|
}(e)) {
|
|
1709
|
-
e.type ===
|
|
1709
|
+
e.type === Ee.FullSnapshot && this._scheduleFullSnapshot(), e.type === Ee.FullSnapshot && this._triggerStatus === "trigger_pending" && this._clearBuffer();
|
|
1710
1710
|
var s = this._mutationRateLimiter ? this._mutationRateLimiter.throttleMutations(e) : e;
|
|
1711
1711
|
if (s) {
|
|
1712
1712
|
var n = function(u) {
|
|
@@ -1727,16 +1727,16 @@ class Ha {
|
|
|
1727
1727
|
}
|
|
1728
1728
|
}
|
|
1729
1729
|
var c = (t = this._instance.config.session_recording.compress_events) === null || t === void 0 || t ? function(u) {
|
|
1730
|
-
if (
|
|
1730
|
+
if (oi(u) < 1024) return u;
|
|
1731
1731
|
try {
|
|
1732
|
-
if (u.type ===
|
|
1733
|
-
if (u.type ===
|
|
1734
|
-
if (u.type ===
|
|
1732
|
+
if (u.type === Ee.FullSnapshot) return f(f({}, u), {}, { data: Ve(u.data), cv: "2024-10" });
|
|
1733
|
+
if (u.type === Ee.IncrementalSnapshot && u.data.source === pe.Mutation) return f(f({}, u), {}, { cv: "2024-10", data: f(f({}, u.data), {}, { texts: Ve(u.data.texts), attributes: Ve(u.data.attributes), removes: Ve(u.data.removes), adds: Ve(u.data.adds) }) });
|
|
1734
|
+
if (u.type === Ee.IncrementalSnapshot && u.data.source === pe.StyleSheetRule) return f(f({}, u), {}, { cv: "2024-10", data: f(f({}, u.data), {}, { adds: u.data.adds ? Ve(u.data.adds) : void 0, removes: u.data.removes ? Ve(u.data.removes) : void 0 }) });
|
|
1735
1735
|
} catch (h) {
|
|
1736
1736
|
V.error("could not compress event - will use uncompressed event", h);
|
|
1737
1737
|
}
|
|
1738
1738
|
return u;
|
|
1739
|
-
}(n) : n, d = { $snapshot_bytes:
|
|
1739
|
+
}(n) : n, d = { $snapshot_bytes: oi(c), $snapshot_data: c, $session_id: this._sessionId, $window_id: this._windowId };
|
|
1740
1740
|
this.status !== "disabled" ? this._captureSnapshotBuffered(d) : this._clearBuffer();
|
|
1741
1741
|
}
|
|
1742
1742
|
}
|
|
@@ -1770,11 +1770,11 @@ class Ha {
|
|
|
1770
1770
|
}
|
|
1771
1771
|
_flushBuffer() {
|
|
1772
1772
|
this._flushBufferTimer && (clearTimeout(this._flushBufferTimer), this._flushBufferTimer = void 0);
|
|
1773
|
-
var e = this._minimumDuration, t = this._sessionDuration, i =
|
|
1773
|
+
var e = this._minimumDuration, t = this._sessionDuration, i = Y(t) && t >= 0, s = Y(e) && i && t < e;
|
|
1774
1774
|
return this.status === "buffering" || this.status === "paused" || this.status === "disabled" || s ? (this._flushBufferTimer = setTimeout(() => {
|
|
1775
1775
|
this._flushBuffer();
|
|
1776
|
-
}, 2e3), this._buffer) : (this._buffer.data.length > 0 &&
|
|
1777
|
-
this._captureSnapshot({ $snapshot_bytes: n.size, $snapshot_data: n.data, $session_id: n.sessionId, $window_id: n.windowId, $lib: "web", $lib_version:
|
|
1776
|
+
}, 2e3), this._buffer) : (this._buffer.data.length > 0 && tr(this._buffer).forEach((n) => {
|
|
1777
|
+
this._captureSnapshot({ $snapshot_bytes: n.size, $snapshot_data: n.data, $session_id: n.sessionId, $window_id: n.windowId, $lib: "web", $lib_version: Ce.LIB_VERSION });
|
|
1778
1778
|
}), this._clearBuffer());
|
|
1779
1779
|
}
|
|
1780
1780
|
_captureSnapshotBuffered(e) {
|
|
@@ -1794,7 +1794,7 @@ class Ha {
|
|
|
1794
1794
|
}
|
|
1795
1795
|
_activateTrigger(e) {
|
|
1796
1796
|
var t, i;
|
|
1797
|
-
this._triggerStatus === "trigger_pending" && ((t = this._instance) === null || t === void 0 || (i = t.persistence) === null || i === void 0 || i.register({ [e === "url" ?
|
|
1797
|
+
this._triggerStatus === "trigger_pending" && ((t = this._instance) === null || t === void 0 || (i = t.persistence) === null || i === void 0 || i.register({ [e === "url" ? Si : ki]: this._sessionId }), this._flushBuffer(), this._reportStarted(e + "_trigger_matched"));
|
|
1798
1798
|
}
|
|
1799
1799
|
_pauseRecording() {
|
|
1800
1800
|
this._urlBlocked || (this._urlBlocked = !0, clearInterval(this._fullSnapshotTimer), V.info("recording paused due to URL blocker"), this._tryAddCustomEvent("recording paused", { reason: "url blocker" }));
|
|
@@ -1816,21 +1816,21 @@ class Ha {
|
|
|
1816
1816
|
}
|
|
1817
1817
|
overrideSampling() {
|
|
1818
1818
|
var e;
|
|
1819
|
-
(e = this._instance.persistence) === null || e === void 0 || e.register({ [
|
|
1819
|
+
(e = this._instance.persistence) === null || e === void 0 || e.register({ [kt]: !0 }), this._tryTakeFullSnapshot(), this._reportStarted("sampling_overridden");
|
|
1820
1820
|
}
|
|
1821
1821
|
overrideTrigger(e) {
|
|
1822
1822
|
this._activateTrigger(e);
|
|
1823
1823
|
}
|
|
1824
1824
|
_reportStarted(e, t) {
|
|
1825
|
-
this._instance.register_for_session({ $session_recording_start_reason: e }), V.info(e.replace("_", " "), t),
|
|
1825
|
+
this._instance.register_for_session({ $session_recording_start_reason: e }), V.info(e.replace("_", " "), t), F(["recording_initialized", "session_id_changed"], e) || this._tryAddCustomEvent(e, t);
|
|
1826
1826
|
}
|
|
1827
1827
|
get sdkDebugProperties() {
|
|
1828
1828
|
var { sessionStartTimestamp: e } = this._sessionManager.checkAndGetSessionAndWindowId(!0);
|
|
1829
1829
|
return { $recording_status: this.status, $sdk_debug_replay_internal_buffer_length: this._buffer.data.length, $sdk_debug_replay_internal_buffer_size: this._buffer.size, $sdk_debug_current_session_duration: this._sessionDuration, $sdk_debug_session_start: e };
|
|
1830
1830
|
}
|
|
1831
1831
|
}
|
|
1832
|
-
var
|
|
1833
|
-
function
|
|
1832
|
+
var Oi = Q("[SegmentIntegration]");
|
|
1833
|
+
function Va(r, e) {
|
|
1834
1834
|
var t = r.config.segment;
|
|
1835
1835
|
if (!t) return e();
|
|
1836
1836
|
(function(i, s) {
|
|
@@ -1838,16 +1838,16 @@ function ja(r, e) {
|
|
|
1838
1838
|
if (!n) return s();
|
|
1839
1839
|
var o = (l) => {
|
|
1840
1840
|
var c = () => l.anonymousId() || Me();
|
|
1841
|
-
i.config.get_device_id = c, l.id() && (i.register({ distinct_id: l.id(), $device_id: c() }), i.persistence.set_property(
|
|
1841
|
+
i.config.get_device_id = c, l.id() && (i.register({ distinct_id: l.id(), $device_id: c() }), i.persistence.set_property(ke, "identified")), s();
|
|
1842
1842
|
}, a = n.user();
|
|
1843
|
-
"then" in a &&
|
|
1843
|
+
"then" in a && ce(a.then) ? a.then((l) => o(l)) : o(a);
|
|
1844
1844
|
})(r, () => {
|
|
1845
1845
|
t.register(((i) => {
|
|
1846
|
-
Promise && Promise.resolve ||
|
|
1846
|
+
Promise && Promise.resolve || Oi.warn("This browser does not have Promise support, and can not use the segment integration");
|
|
1847
1847
|
var s = (n, o) => {
|
|
1848
1848
|
var a;
|
|
1849
1849
|
if (!o) return n;
|
|
1850
|
-
n.event.userId || n.event.anonymousId === i.get_distinct_id() || (
|
|
1850
|
+
n.event.userId || n.event.anonymousId === i.get_distinct_id() || (Oi.info("No userId set, resetting PostHog"), i.reset()), n.event.userId && n.event.userId !== i.get_distinct_id() && (Oi.info("UserId set, identifying with PostHog"), i.identify(n.event.userId));
|
|
1851
1851
|
var l = i._calculate_event_properties(o, (a = n.event.properties) !== null && a !== void 0 ? a : {}, /* @__PURE__ */ new Date());
|
|
1852
1852
|
return n.event.properties = Object.assign({}, l, n.event.properties), n;
|
|
1853
1853
|
};
|
|
@@ -1870,18 +1870,18 @@ function An(r) {
|
|
|
1870
1870
|
return e && t && (p.$sentry_url = (i || "https://sentry.io/organizations/") + e + "/issues/?project=" + t + "&query=" + n.event_id), r.exceptions.sendExceptionEvent(p), n;
|
|
1871
1871
|
};
|
|
1872
1872
|
}
|
|
1873
|
-
class
|
|
1873
|
+
class Ga {
|
|
1874
1874
|
constructor(e, t, i, s, n) {
|
|
1875
1875
|
this.name = Ln, this.setupOnce = function(o) {
|
|
1876
1876
|
o(An(e, { organization: t, projectId: i, prefix: s, severityAllowList: n }));
|
|
1877
1877
|
};
|
|
1878
1878
|
}
|
|
1879
1879
|
}
|
|
1880
|
-
var
|
|
1880
|
+
var xe, Ja = g != null && g.location ? si(g.location.hash, "__posthog") || si(location.hash, "state") : null, bs = "_postHogToolbarParams", ws = Q("[Toolbar]");
|
|
1881
1881
|
(function(r) {
|
|
1882
1882
|
r[r.UNINITIALIZED = 0] = "UNINITIALIZED", r[r.LOADING = 1] = "LOADING", r[r.LOADED = 2] = "LOADED";
|
|
1883
|
-
})(
|
|
1884
|
-
class
|
|
1883
|
+
})(xe || (xe = {}));
|
|
1884
|
+
class Ka {
|
|
1885
1885
|
constructor(e) {
|
|
1886
1886
|
this.instance = e;
|
|
1887
1887
|
}
|
|
@@ -1890,7 +1890,7 @@ class Wa {
|
|
|
1890
1890
|
}
|
|
1891
1891
|
_getToolbarState() {
|
|
1892
1892
|
var e;
|
|
1893
|
-
return (e = I.ph_toolbar_state) !== null && e !== void 0 ? e :
|
|
1893
|
+
return (e = I.ph_toolbar_state) !== null && e !== void 0 ? e : xe.UNINITIALIZED;
|
|
1894
1894
|
}
|
|
1895
1895
|
maybeLoadToolbar() {
|
|
1896
1896
|
var e, t, i = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : void 0, s = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : void 0, n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : void 0;
|
|
@@ -1905,7 +1905,7 @@ class Wa {
|
|
|
1905
1905
|
}
|
|
1906
1906
|
s = g == null ? void 0 : g.localStorage;
|
|
1907
1907
|
}
|
|
1908
|
-
var o, a =
|
|
1908
|
+
var o, a = Ja || si(i.hash, "__posthog") || si(i.hash, "state"), l = a ? jr(() => JSON.parse(atob(decodeURIComponent(a)))) || jr(() => JSON.parse(decodeURIComponent(a))) : null;
|
|
1909
1909
|
return l && l.action === "ph_authorize" ? ((o = l).source = "url", o && Object.keys(o).length > 0 && (l.desiredHash ? i.hash = l.desiredHash : n ? n.replaceState(n.state, "", i.pathname + i.search) : i.hash = "")) : ((o = JSON.parse(s.getItem(bs) || "{}")).source = "localstorage", delete o.userIntent), !(!o.token || this.instance.config.token !== o.token) && (this.loadToolbar(o), !0);
|
|
1910
1910
|
} catch {
|
|
1911
1911
|
return !1;
|
|
@@ -1913,20 +1913,20 @@ class Wa {
|
|
|
1913
1913
|
}
|
|
1914
1914
|
_callLoadToolbar(e) {
|
|
1915
1915
|
var t = I.ph_load_toolbar || I.ph_load_editor;
|
|
1916
|
-
!R(t) &&
|
|
1916
|
+
!R(t) && ce(t) ? t(e, this.instance) : ws.warn("No toolbar load function found");
|
|
1917
1917
|
}
|
|
1918
1918
|
loadToolbar(e) {
|
|
1919
1919
|
var t = !(k == null || !k.getElementById(un));
|
|
1920
1920
|
if (!g || t) return !1;
|
|
1921
1921
|
var i = this.instance.requestRouter.region === "custom" && this.instance.config.advanced_disable_toolbar_metrics, s = f(f({ token: this.instance.config.token }, e), {}, { apiURL: this.instance.requestRouter.endpointFor("ui") }, i ? { instrument: !1 } : {});
|
|
1922
|
-
if (g.localStorage.setItem(bs, JSON.stringify(f(f({}, s), {}, { source: void 0 }))), this._getToolbarState() ===
|
|
1923
|
-
else if (this._getToolbarState() ===
|
|
1922
|
+
if (g.localStorage.setItem(bs, JSON.stringify(f(f({}, s), {}, { source: void 0 }))), this._getToolbarState() === xe.LOADED) this._callLoadToolbar(s);
|
|
1923
|
+
else if (this._getToolbarState() === xe.UNINITIALIZED) {
|
|
1924
1924
|
var n, o;
|
|
1925
|
-
this._setToolbarState(
|
|
1926
|
-
if (a) return ws.error("[Toolbar] Failed to load", a), void this._setToolbarState(
|
|
1927
|
-
this._setToolbarState(
|
|
1925
|
+
this._setToolbarState(xe.LOADING), (n = I.__PosthogExtensions__) === null || n === void 0 || (o = n.loadExternalDependency) === null || o === void 0 || o.call(n, this.instance, "toolbar", (a) => {
|
|
1926
|
+
if (a) return ws.error("[Toolbar] Failed to load", a), void this._setToolbarState(xe.UNINITIALIZED);
|
|
1927
|
+
this._setToolbarState(xe.LOADED), this._callLoadToolbar(s);
|
|
1928
1928
|
}), N(g, "turbolinks:load", () => {
|
|
1929
|
-
this._setToolbarState(
|
|
1929
|
+
this._setToolbarState(xe.UNINITIALIZED), this.loadToolbar(s);
|
|
1930
1930
|
});
|
|
1931
1931
|
}
|
|
1932
1932
|
return !0;
|
|
@@ -1939,8 +1939,8 @@ class Wa {
|
|
|
1939
1939
|
return this.maybeLoadToolbar(e, t, i);
|
|
1940
1940
|
}
|
|
1941
1941
|
}
|
|
1942
|
-
var
|
|
1943
|
-
class
|
|
1942
|
+
var Ya = Q("[TracingHeaders]");
|
|
1943
|
+
class Qa {
|
|
1944
1944
|
constructor(e) {
|
|
1945
1945
|
w(this, "_restoreXHRPatch", void 0), w(this, "_restoreFetchPatch", void 0), w(this, "_startCapturing", () => {
|
|
1946
1946
|
var t, i, s, n;
|
|
@@ -1950,7 +1950,7 @@ class Ga {
|
|
|
1950
1950
|
_loadScript(e) {
|
|
1951
1951
|
var t, i, s;
|
|
1952
1952
|
(t = I.__PosthogExtensions__) !== null && t !== void 0 && t.tracingHeadersPatchFns && e(), (i = I.__PosthogExtensions__) === null || i === void 0 || (s = i.loadExternalDependency) === null || s === void 0 || s.call(i, this._instance, "tracing-headers", (n) => {
|
|
1953
|
-
if (n) return
|
|
1953
|
+
if (n) return Ya.error("failed to load script", n);
|
|
1954
1954
|
e();
|
|
1955
1955
|
});
|
|
1956
1956
|
}
|
|
@@ -1959,8 +1959,8 @@ class Ga {
|
|
|
1959
1959
|
this._instance.config.__add_tracing_headers ? this._loadScript(this._startCapturing) : ((e = this._restoreXHRPatch) === null || e === void 0 || e.call(this), (t = this._restoreFetchPatch) === null || t === void 0 || t.call(this), this._restoreXHRPatch = void 0, this._restoreFetchPatch = void 0);
|
|
1960
1960
|
}
|
|
1961
1961
|
}
|
|
1962
|
-
var Oe =
|
|
1963
|
-
class
|
|
1962
|
+
var Oe = Q("[Web Vitals]"), Ss = 9e5;
|
|
1963
|
+
class Xa {
|
|
1964
1964
|
constructor(e) {
|
|
1965
1965
|
var t;
|
|
1966
1966
|
w(this, "_enabledServerSide", !1), w(this, "_initialized", !1), w(this, "_buffer", { url: void 0, metrics: [], firstMetricTimestamp: void 0 }), w(this, "_flushToCapture", () => {
|
|
@@ -1986,14 +1986,14 @@ class Ja {
|
|
|
1986
1986
|
return (q(this._instance.config.capture_performance) ? this._instance.config.capture_performance.web_vitals_delayed_flush_ms : void 0) || 5e3;
|
|
1987
1987
|
}
|
|
1988
1988
|
get _maxAllowedValue() {
|
|
1989
|
-
var e = q(this._instance.config.capture_performance) &&
|
|
1989
|
+
var e = q(this._instance.config.capture_performance) && Y(this._instance.config.capture_performance.__web_vitals_max_value) ? this._instance.config.capture_performance.__web_vitals_max_value : Ss;
|
|
1990
1990
|
return 0 < e && e <= 6e4 ? Ss : e;
|
|
1991
1991
|
}
|
|
1992
1992
|
get isEnabled() {
|
|
1993
|
-
var e =
|
|
1993
|
+
var e = te == null ? void 0 : te.protocol;
|
|
1994
1994
|
if (e !== "http:" && e !== "https:") return Oe.info("Web Vitals are disabled on non-http/https protocols"), !1;
|
|
1995
|
-
var t = q(this._instance.config.capture_performance) ? this._instance.config.capture_performance.web_vitals :
|
|
1996
|
-
return
|
|
1995
|
+
var t = q(this._instance.config.capture_performance) ? this._instance.config.capture_performance.web_vitals : Ie(this._instance.config.capture_performance) ? this._instance.config.capture_performance : void 0;
|
|
1996
|
+
return Ie(t) ? t : this._enabledServerSide;
|
|
1997
1997
|
}
|
|
1998
1998
|
startIfEnabled() {
|
|
1999
1999
|
this.isEnabled && !this._initialized && (Oe.info("enabled, starting..."), this._loadScript(this._startCapturing));
|
|
@@ -2013,14 +2013,14 @@ class Ja {
|
|
|
2013
2013
|
return e || Oe.error("Could not determine current URL"), e;
|
|
2014
2014
|
}
|
|
2015
2015
|
}
|
|
2016
|
-
var
|
|
2016
|
+
var Za = Q("[Heatmaps]");
|
|
2017
2017
|
function ks(r) {
|
|
2018
|
-
return q(r) && "clientX" in r && "clientY" in r &&
|
|
2018
|
+
return q(r) && "clientX" in r && "clientY" in r && Y(r.clientX) && Y(r.clientY);
|
|
2019
2019
|
}
|
|
2020
|
-
class
|
|
2020
|
+
class el {
|
|
2021
2021
|
constructor(e) {
|
|
2022
2022
|
var t;
|
|
2023
|
-
w(this, "rageclicks", new bn()), w(this, "_enabledServerSide", !1), w(this, "_initialized", !1), w(this, "_flushInterval", null), this.instance = e, this._enabledServerSide = !((t = this.instance.persistence) === null || t === void 0 || !t.props[
|
|
2023
|
+
w(this, "rageclicks", new bn()), w(this, "_enabledServerSide", !1), w(this, "_initialized", !1), w(this, "_flushInterval", null), this.instance = e, this._enabledServerSide = !((t = this.instance.persistence) === null || t === void 0 || !t.props[zi]);
|
|
2024
2024
|
}
|
|
2025
2025
|
get flushIntervalMilliseconds() {
|
|
2026
2026
|
var e = 5e3;
|
|
@@ -2032,7 +2032,7 @@ class Ya {
|
|
|
2032
2032
|
startIfEnabled() {
|
|
2033
2033
|
if (this.isEnabled) {
|
|
2034
2034
|
if (this._initialized) return;
|
|
2035
|
-
|
|
2035
|
+
Za.info("starting..."), this._setupListeners(), this._flushInterval = setInterval(this._flush.bind(this), this.flushIntervalMilliseconds);
|
|
2036
2036
|
} else {
|
|
2037
2037
|
var e, t;
|
|
2038
2038
|
clearInterval((e = this._flushInterval) !== null && e !== void 0 ? e : void 0), (t = this._deadClicksCapture) === null || t === void 0 || t.stop(), this.getAndClearBuffer();
|
|
@@ -2040,7 +2040,7 @@ class Ya {
|
|
|
2040
2040
|
}
|
|
2041
2041
|
onRemoteConfig(e) {
|
|
2042
2042
|
var t = !!e.heatmaps;
|
|
2043
|
-
this.instance.persistence && this.instance.persistence.register({ [
|
|
2043
|
+
this.instance.persistence && this.instance.persistence.register({ [zi]: t }), this._enabledServerSide = t, this.startIfEnabled();
|
|
2044
2044
|
}
|
|
2045
2045
|
getAndClearBuffer() {
|
|
2046
2046
|
var e = this._buffer;
|
|
@@ -2050,13 +2050,13 @@ class Ya {
|
|
|
2050
2050
|
this._onClick(e.originalEvent, "deadclick");
|
|
2051
2051
|
}
|
|
2052
2052
|
_setupListeners() {
|
|
2053
|
-
g && k && (N(g, "beforeunload", this._flush.bind(this)), N(k, "click", (e) => this._onClick(e || (g == null ? void 0 : g.event)), { capture: !0 }), N(k, "mousemove", (e) => this._onMouseMove(e || (g == null ? void 0 : g.event)), { capture: !0 }), this._deadClicksCapture = new Sn(this.instance,
|
|
2053
|
+
g && k && (N(g, "beforeunload", this._flush.bind(this)), N(k, "click", (e) => this._onClick(e || (g == null ? void 0 : g.event)), { capture: !0 }), N(k, "mousemove", (e) => this._onMouseMove(e || (g == null ? void 0 : g.event)), { capture: !0 }), this._deadClicksCapture = new Sn(this.instance, _a, this._onDeadClick.bind(this)), this._deadClicksCapture.startIfEnabled(), this._initialized = !0);
|
|
2054
2054
|
}
|
|
2055
2055
|
_getProperties(e, t) {
|
|
2056
2056
|
var i = this.instance.scrollManager.scrollY(), s = this.instance.scrollManager.scrollX(), n = this.instance.scrollManager.scrollElement(), o = function(a, l, c) {
|
|
2057
|
-
for (var d = a; d &&
|
|
2057
|
+
for (var d = a; d && pi(d) && !Ne(d, "body"); ) {
|
|
2058
2058
|
if (d === c) return !1;
|
|
2059
|
-
if (
|
|
2059
|
+
if (F(l, g == null ? void 0 : g.getComputedStyle(d).position)) return !0;
|
|
2060
2060
|
d = pn(d);
|
|
2061
2061
|
}
|
|
2062
2062
|
return !1;
|
|
@@ -2082,10 +2082,10 @@ class Ya {
|
|
|
2082
2082
|
}
|
|
2083
2083
|
}
|
|
2084
2084
|
_flush() {
|
|
2085
|
-
this._buffer && !
|
|
2085
|
+
this._buffer && !nt(this._buffer) && this.instance.capture("$$heatmap", { $heatmap_data: this.getAndClearBuffer() });
|
|
2086
2086
|
}
|
|
2087
2087
|
}
|
|
2088
|
-
class
|
|
2088
|
+
class tl {
|
|
2089
2089
|
constructor(e) {
|
|
2090
2090
|
this._instance = e;
|
|
2091
2091
|
}
|
|
@@ -2116,7 +2116,7 @@ class Qa {
|
|
|
2116
2116
|
return i.pathname && (s.$prev_pageview_pathname = i.pathname), i.timestamp && (s.$prev_pageview_duration = (e.getTime() - i.timestamp.getTime()) / 1e3), s;
|
|
2117
2117
|
}
|
|
2118
2118
|
}
|
|
2119
|
-
class
|
|
2119
|
+
class il {
|
|
2120
2120
|
constructor(e) {
|
|
2121
2121
|
this._instance = e;
|
|
2122
2122
|
}
|
|
@@ -2124,42 +2124,42 @@ class Xa {
|
|
|
2124
2124
|
this._instance.capture("$exception", e, { _noTruncate: !0, _batchKey: "exceptionEvent" });
|
|
2125
2125
|
}
|
|
2126
2126
|
}
|
|
2127
|
-
var
|
|
2128
|
-
return
|
|
2127
|
+
var _e = "Mobile", li = "iOS", be = "Android", Rt = "Tablet", Mn = be + " " + Rt, Dn = "iPad", qn = "Apple", Nn = qn + " Watch", $t = "Safari", ht = "BlackBerry", Bn = "Samsung", Hn = Bn + "Browser", jn = Bn + " Internet", Ze = "Chrome", rl = Ze + " OS", Un = Ze + " " + li, Er = "Internet Explorer", zn = Er + " " + _e, xr = "Opera", sl = xr + " Mini", Cr = "Edge", Wn = "Microsoft " + Cr, lt = "Firefox", Vn = lt + " " + li, Ot = "Nintendo", Lt = "PlayStation", ut = "Xbox", Gn = be + " " + _e, Jn = _e + " " + $t, Ct = "Windows", lr = Ct + " Phone", Es = "Nokia", ur = "Ouya", Kn = "Generic", nl = Kn + " " + _e.toLowerCase(), Yn = Kn + " " + Rt.toLowerCase(), cr = "Konqueror", ee = "(\\d+(\\.\\d+)?)", Li = new RegExp("Version/" + ee), ol = new RegExp(ut, "i"), al = new RegExp(Lt + " \\w+", "i"), ll = new RegExp(Ot + " \\w+", "i"), Ir = new RegExp(ht + "|PlayBook|BB10", "i"), ul = { "NT3.51": "NT 3.11", "NT4.0": "NT 4.0", "5.0": "2000", 5.1: "XP", 5.2: "XP", "6.0": "Vista", 6.1: "7", 6.2: "8", 6.3: "8.1", 6.4: "10", "10.0": "10" }, cl = (r, e) => e && F(e, qn) || function(t) {
|
|
2128
|
+
return F(t, $t) && !F(t, Ze) && !F(t, be);
|
|
2129
2129
|
}(r), Qn = function(r, e) {
|
|
2130
|
-
return e = e || "",
|
|
2131
|
-
},
|
|
2132
|
-
var t = Qn(r, e), i =
|
|
2130
|
+
return e = e || "", F(r, " OPR/") && F(r, "Mini") ? sl : F(r, " OPR/") ? xr : Ir.test(r) ? ht : F(r, "IE" + _e) || F(r, "WPDesktop") ? zn : F(r, Hn) ? jn : F(r, Cr) || F(r, "Edg/") ? Wn : F(r, "FBIOS") ? "Facebook " + _e : F(r, "UCWEB") || F(r, "UCBrowser") ? "UC Browser" : F(r, "CriOS") ? Un : F(r, "CrMo") || F(r, Ze) ? Ze : F(r, be) && F(r, $t) ? Gn : F(r, "FxiOS") ? Vn : F(r.toLowerCase(), cr.toLowerCase()) ? cr : cl(r, e) ? F(r, _e) ? Jn : $t : F(r, lt) ? lt : F(r, "MSIE") || F(r, "Trident/") ? Er : F(r, "Gecko") ? lt : "";
|
|
2131
|
+
}, dl = { [zn]: [new RegExp("rv:" + ee)], [Wn]: [new RegExp(Cr + "?\\/" + ee)], [Ze]: [new RegExp("(" + Ze + "|CrMo)\\/" + ee)], [Un]: [new RegExp("CriOS\\/" + ee)], "UC Browser": [new RegExp("(UCBrowser|UCWEB)\\/" + ee)], [$t]: [Li], [Jn]: [Li], [xr]: [new RegExp("(Opera|OPR)\\/" + ee)], [lt]: [new RegExp(lt + "\\/" + ee)], [Vn]: [new RegExp("FxiOS\\/" + ee)], [cr]: [new RegExp("Konqueror[:/]?" + ee, "i")], [ht]: [new RegExp(ht + " " + ee), Li], [Gn]: [new RegExp("android\\s" + ee, "i")], [jn]: [new RegExp(Hn + "\\/" + ee)], [Er]: [new RegExp("(rv:|MSIE )" + ee)], Mozilla: [new RegExp("rv:" + ee)] }, _l = function(r, e) {
|
|
2132
|
+
var t = Qn(r, e), i = dl[t];
|
|
2133
2133
|
if (S(i)) return null;
|
|
2134
2134
|
for (var s = 0; s < i.length; s++) {
|
|
2135
2135
|
var n = i[s], o = r.match(n);
|
|
2136
2136
|
if (o) return parseFloat(o[o.length - 2]);
|
|
2137
2137
|
}
|
|
2138
2138
|
return null;
|
|
2139
|
-
}, xs = [[new RegExp(
|
|
2140
|
-
if (/Phone/.test(e) || /WPDesktop/.test(e)) return [
|
|
2141
|
-
if (new RegExp(
|
|
2139
|
+
}, xs = [[new RegExp(ut + "; " + ut + " (.*?)[);]", "i"), (r) => [ut, r && r[1] || ""]], [new RegExp(Ot, "i"), [Ot, ""]], [new RegExp(Lt, "i"), [Lt, ""]], [Ir, [ht, ""]], [new RegExp(Ct, "i"), (r, e) => {
|
|
2140
|
+
if (/Phone/.test(e) || /WPDesktop/.test(e)) return [lr, ""];
|
|
2141
|
+
if (new RegExp(_e).test(e) && !/IEMobile\b/.test(e)) return [Ct + " " + _e, ""];
|
|
2142
2142
|
var t = /Windows NT ([0-9.]+)/i.exec(e);
|
|
2143
2143
|
if (t && t[1]) {
|
|
2144
|
-
var i = t[1], s =
|
|
2145
|
-
return /arm/i.test(e) && (s = "RT"), [
|
|
2144
|
+
var i = t[1], s = ul[i] || "";
|
|
2145
|
+
return /arm/i.test(e) && (s = "RT"), [Ct, s];
|
|
2146
2146
|
}
|
|
2147
|
-
return [
|
|
2147
|
+
return [Ct, ""];
|
|
2148
2148
|
}], [/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/, (r) => {
|
|
2149
2149
|
if (r && r[3]) {
|
|
2150
2150
|
var e = [r[3], r[4], r[5] || "0"];
|
|
2151
|
-
return [
|
|
2151
|
+
return [li, e.join(".")];
|
|
2152
2152
|
}
|
|
2153
|
-
return [
|
|
2153
|
+
return [li, ""];
|
|
2154
2154
|
}], [/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i, (r) => {
|
|
2155
2155
|
var e = "";
|
|
2156
2156
|
return r && r.length >= 3 && (e = S(r[2]) ? r[3] : r[2]), ["watchOS", e];
|
|
2157
|
-
}], [new RegExp("(" +
|
|
2157
|
+
}], [new RegExp("(" + be + " (\\d+)\\.(\\d+)\\.?(\\d+)?|" + be + ")", "i"), (r) => {
|
|
2158
2158
|
if (r && r[2]) {
|
|
2159
2159
|
var e = [r[2], r[3], r[4] || "0"];
|
|
2160
|
-
return [
|
|
2160
|
+
return [be, e.join(".")];
|
|
2161
2161
|
}
|
|
2162
|
-
return [
|
|
2162
|
+
return [be, ""];
|
|
2163
2163
|
}], [/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i, (r) => {
|
|
2164
2164
|
var e = ["Mac OS X", ""];
|
|
2165
2165
|
if (r && r[1]) {
|
|
@@ -2167,21 +2167,21 @@ var de = "Mobile", ni = "iOS", ye = "Android", Tt = "Tablet", Mn = ye + " " + Tt
|
|
|
2167
2167
|
e[1] = t.join(".");
|
|
2168
2168
|
}
|
|
2169
2169
|
return e;
|
|
2170
|
-
}], [/Mac/i, ["Mac OS X", ""]], [/CrOS/, [
|
|
2171
|
-
return
|
|
2170
|
+
}], [/Mac/i, ["Mac OS X", ""]], [/CrOS/, [rl, ""]], [/Linux|debian/i, ["Linux", ""]]], Xn = function(r) {
|
|
2171
|
+
return ll.test(r) ? Ot : al.test(r) ? Lt : ol.test(r) ? ut : new RegExp(ur, "i").test(r) ? ur : new RegExp("(" + lr + "|WPDesktop)", "i").test(r) ? lr : /iPad/.test(r) ? Dn : /iPod/.test(r) ? "iPod Touch" : /iPhone/.test(r) ? "iPhone" : /(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(r) ? Nn : Ir.test(r) ? ht : /(kobo)\s(ereader|touch)/i.test(r) ? "Kobo" : new RegExp(Es, "i").test(r) ? Es : /(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(r) || /(kf[a-z]+)( bui|\)).+silk\//i.test(r) ? "Kindle Fire" : /(Android|ZTE)/i.test(r) ? !new RegExp(_e).test(r) || /(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(r) ? /pixel[\daxl ]{1,6}/i.test(r) && !/pixel c/i.test(r) || /(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(r) || /lmy47v/i.test(r) && !/QTAQZ3/i.test(r) ? be : Mn : be : new RegExp("(pda|" + _e + ")", "i").test(r) ? nl : new RegExp(Rt, "i").test(r) && !new RegExp(Rt + " pc", "i").test(r) ? Yn : "";
|
|
2172
2172
|
}, Zn = function(r) {
|
|
2173
2173
|
var e = Xn(r);
|
|
2174
|
-
return e === Dn || e === Mn || e === "Kobo" || e === "Kindle Fire" || e === Yn ?
|
|
2175
|
-
}, jt = "https?://(.*)",
|
|
2174
|
+
return e === Dn || e === Mn || e === "Kobo" || e === "Kindle Fire" || e === Yn ? Rt : e === Ot || e === ut || e === Lt || e === ur ? "Console" : e === Nn ? "Wearable" : e ? _e : "Desktop";
|
|
2175
|
+
}, jt = "https?://(.*)", vi = ["gclid", "gclsrc", "dclid", "gbraid", "wbraid", "fbclid", "msclkid", "twclid", "li_fat_id", "igshid", "ttclid", "rdt_cid", "epik", "qclid", "sccid", "irclid", "_kx"], hl = hi(["utm_source", "utm_medium", "utm_campaign", "utm_content", "utm_term", "gad_source", "mc_cid"], vi), Pr = "<masked>";
|
|
2176
2176
|
function eo(r, e, t) {
|
|
2177
2177
|
if (!k) return {};
|
|
2178
|
-
var i = e ?
|
|
2179
|
-
return to(
|
|
2178
|
+
var i = e ? hi([], vi, t || []) : [];
|
|
2179
|
+
return to(br(k.URL, i, Pr), r);
|
|
2180
2180
|
}
|
|
2181
2181
|
function to(r, e) {
|
|
2182
|
-
var t =
|
|
2182
|
+
var t = hl.concat(e || []), i = {};
|
|
2183
2183
|
return $(t, function(s) {
|
|
2184
|
-
var n =
|
|
2184
|
+
var n = ri(r, s);
|
|
2185
2185
|
i[s] = n || null;
|
|
2186
2186
|
}), i;
|
|
2187
2187
|
}
|
|
@@ -2189,9 +2189,9 @@ function io(r) {
|
|
|
2189
2189
|
var e = function(n) {
|
|
2190
2190
|
return n ? n.search(jt + "google.([^/?]*)") === 0 ? "google" : n.search(jt + "bing.com") === 0 ? "bing" : n.search(jt + "yahoo.com") === 0 ? "yahoo" : n.search(jt + "duckduckgo.com") === 0 ? "duckduckgo" : null : null;
|
|
2191
2191
|
}(r), t = e != "yahoo" ? "q" : "p", i = {};
|
|
2192
|
-
if (!
|
|
2192
|
+
if (!je(e)) {
|
|
2193
2193
|
i.$search_engine = e;
|
|
2194
|
-
var s = k ?
|
|
2194
|
+
var s = k ? ri(k.referrer, t) : "";
|
|
2195
2195
|
s.length && (i.ph_keyword = s);
|
|
2196
2196
|
}
|
|
2197
2197
|
return i;
|
|
@@ -2203,14 +2203,14 @@ function ro() {
|
|
|
2203
2203
|
return (k == null ? void 0 : k.referrer) || "$direct";
|
|
2204
2204
|
}
|
|
2205
2205
|
function so(r, e) {
|
|
2206
|
-
var t = r ?
|
|
2207
|
-
return { r: ro().substring(0, 1e3), u: i ?
|
|
2206
|
+
var t = r ? hi([], vi, e || []) : [], i = te == null ? void 0 : te.href.substring(0, 1e3);
|
|
2207
|
+
return { r: ro().substring(0, 1e3), u: i ? br(i, t, Pr) : void 0 };
|
|
2208
2208
|
}
|
|
2209
2209
|
function no(r) {
|
|
2210
|
-
var e, { r: t, u: i } = r, s = { $referrer: t, $referring_domain: t == null ? void 0 : t == "$direct" ? "$direct" : (e =
|
|
2210
|
+
var e, { r: t, u: i } = r, s = { $referrer: t, $referring_domain: t == null ? void 0 : t == "$direct" ? "$direct" : (e = dt(t)) === null || e === void 0 ? void 0 : e.host };
|
|
2211
2211
|
if (i) {
|
|
2212
2212
|
s.$current_url = i;
|
|
2213
|
-
var n =
|
|
2213
|
+
var n = dt(i);
|
|
2214
2214
|
s.$host = n == null ? void 0 : n.host, s.$pathname = n == null ? void 0 : n.pathname;
|
|
2215
2215
|
var o = to(i);
|
|
2216
2216
|
H(s, o);
|
|
@@ -2228,29 +2228,29 @@ function oo() {
|
|
|
2228
2228
|
return;
|
|
2229
2229
|
}
|
|
2230
2230
|
}
|
|
2231
|
-
function
|
|
2231
|
+
function pl() {
|
|
2232
2232
|
try {
|
|
2233
2233
|
return (/* @__PURE__ */ new Date()).getTimezoneOffset();
|
|
2234
2234
|
} catch {
|
|
2235
2235
|
return;
|
|
2236
2236
|
}
|
|
2237
2237
|
}
|
|
2238
|
-
function
|
|
2238
|
+
function gl(r, e) {
|
|
2239
2239
|
if (!J) return {};
|
|
2240
|
-
var t, i = r ?
|
|
2240
|
+
var t, i = r ? hi([], vi, e || []) : [], [s, n] = function(o) {
|
|
2241
2241
|
for (var a = 0; a < xs.length; a++) {
|
|
2242
|
-
var [l, c] = xs[a], d = l.exec(o), u = d && (
|
|
2242
|
+
var [l, c] = xs[a], d = l.exec(o), u = d && (ce(c) ? c(d, o) : c);
|
|
2243
2243
|
if (u) return u;
|
|
2244
2244
|
}
|
|
2245
2245
|
return ["", ""];
|
|
2246
2246
|
}(J);
|
|
2247
|
-
return H(
|
|
2247
|
+
return H(Xt({ $os: s, $os_version: n, $browser: Qn(J, navigator.vendor), $device: Xn(J), $device_type: Zn(J), $timezone: oo(), $timezone_offset: pl() }), { $current_url: br(te == null ? void 0 : te.href, i, Pr), $host: te == null ? void 0 : te.host, $pathname: te == null ? void 0 : te.pathname, $raw_user_agent: J.length > 1e3 ? J.substring(0, 997) + "..." : J, $browser_version: _l(J, navigator.vendor), $browser_language: Cs(), $browser_language_prefix: (t = Cs(), typeof t == "string" ? t.split("-")[0] : void 0), $screen_height: g == null ? void 0 : g.screen.height, $screen_width: g == null ? void 0 : g.screen.width, $viewport_height: g == null ? void 0 : g.innerHeight, $viewport_width: g == null ? void 0 : g.innerWidth, $lib: "web", $lib_version: Ce.LIB_VERSION, $insert_id: Math.random().toString(36).substring(2, 10) + Math.random().toString(36).substring(2, 10), $time: Date.now() / 1e3 });
|
|
2248
2248
|
}
|
|
2249
|
-
var
|
|
2249
|
+
var dr, ye = Q("[FeatureFlags]"), Ai = "$active_feature_flags", rt = "$override_feature_flags", Is = "$feature_flag_payloads", bt = "$override_feature_flag_payloads", Ps = "$feature_flag_request_id", Ts = (r) => {
|
|
2250
2250
|
var e = {};
|
|
2251
2251
|
for (var [t, i] of zt(r || {})) i && (e[t] = i);
|
|
2252
2252
|
return e;
|
|
2253
|
-
},
|
|
2253
|
+
}, vl = (r) => {
|
|
2254
2254
|
var e = r.flags;
|
|
2255
2255
|
return e ? (r.featureFlags = Object.fromEntries(Object.keys(e).map((t) => {
|
|
2256
2256
|
var i;
|
|
@@ -2261,12 +2261,12 @@ var ur, me = Y("[FeatureFlags]"), Ri = "$active_feature_flags", tt = "$override_
|
|
|
2261
2261
|
}).map((t) => {
|
|
2262
2262
|
var i;
|
|
2263
2263
|
return [t, (i = e[t].metadata) === null || i === void 0 ? void 0 : i.payload];
|
|
2264
|
-
}))) :
|
|
2264
|
+
}))) : ye.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"), r;
|
|
2265
2265
|
};
|
|
2266
2266
|
(function(r) {
|
|
2267
2267
|
r.FeatureFlags = "feature_flags", r.Recordings = "recordings";
|
|
2268
|
-
})(
|
|
2269
|
-
class
|
|
2268
|
+
})(dr || (dr = {}));
|
|
2269
|
+
class fl {
|
|
2270
2270
|
constructor(e) {
|
|
2271
2271
|
w(this, "_override_warning", !1), w(this, "_hasLoadedFlags", !1), w(this, "_requestInFlight", !1), w(this, "_reloadingDisabled", !1), w(this, "_additionalReloadRequested", !1), w(this, "_decideCalled", !1), w(this, "_flagsLoadedFromRemote", !1), this._instance = e, this.featureFlagEventHandlers = [];
|
|
2272
2272
|
}
|
|
@@ -2284,26 +2284,26 @@ class hl {
|
|
|
2284
2284
|
return Object.keys(this.getFlagVariants());
|
|
2285
2285
|
}
|
|
2286
2286
|
getFlagsWithDetails() {
|
|
2287
|
-
var e = this._instance.get_property(
|
|
2287
|
+
var e = this._instance.get_property(Vi), t = this._instance.get_property(rt), i = this._instance.get_property(bt);
|
|
2288
2288
|
if (!i && !t) return e || {};
|
|
2289
2289
|
var s = H({}, e || {}), n = [.../* @__PURE__ */ new Set([...Object.keys(i || {}), ...Object.keys(t || {})])];
|
|
2290
2290
|
for (var o of n) {
|
|
2291
2291
|
var a, l, c = s[o], d = t == null ? void 0 : t[o], u = S(d) ? (a = c == null ? void 0 : c.enabled) !== null && a !== void 0 && a : !!d, h = S(d) ? c.variant : typeof d == "string" ? d : void 0, _ = i == null ? void 0 : i[o], p = f(f({}, c), {}, { enabled: u, variant: u ? h ?? (c == null ? void 0 : c.variant) : void 0 });
|
|
2292
2292
|
u !== (c == null ? void 0 : c.enabled) && (p.original_enabled = c == null ? void 0 : c.enabled), h !== (c == null ? void 0 : c.variant) && (p.original_variant = c == null ? void 0 : c.variant), _ && (p.metadata = f(f({}, c == null ? void 0 : c.metadata), {}, { payload: _, original_payload: c == null || (l = c.metadata) === null || l === void 0 ? void 0 : l.payload })), s[o] = p;
|
|
2293
2293
|
}
|
|
2294
|
-
return this._override_warning || (
|
|
2294
|
+
return this._override_warning || (ye.warn(" Overriding feature flag details!", { flagDetails: e, overriddenPayloads: i, finalDetails: s }), this._override_warning = !0), s;
|
|
2295
2295
|
}
|
|
2296
2296
|
getFlagVariants() {
|
|
2297
|
-
var e = this._instance.get_property(
|
|
2297
|
+
var e = this._instance.get_property(ot), t = this._instance.get_property(rt);
|
|
2298
2298
|
if (!t) return e || {};
|
|
2299
2299
|
for (var i = H({}, e), s = Object.keys(t), n = 0; n < s.length; n++) i[s[n]] = t[s[n]];
|
|
2300
|
-
return this._override_warning || (
|
|
2300
|
+
return this._override_warning || (ye.warn(" Overriding feature flags!", { enabledFlags: e, overriddenFlags: t, finalFlags: i }), this._override_warning = !0), i;
|
|
2301
2301
|
}
|
|
2302
2302
|
getFlagPayloads() {
|
|
2303
|
-
var e = this._instance.get_property(Is), t = this._instance.get_property(
|
|
2303
|
+
var e = this._instance.get_property(Is), t = this._instance.get_property(bt);
|
|
2304
2304
|
if (!t) return e || {};
|
|
2305
2305
|
for (var i = H({}, e || {}), s = Object.keys(t), n = 0; n < s.length; n++) i[s[n]] = t[s[n]];
|
|
2306
|
-
return this._override_warning || (
|
|
2306
|
+
return this._override_warning || (ye.warn(" Overriding feature flag payloads!", { flagPayloads: e, overriddenPayloads: t, finalPayloads: i }), this._override_warning = !0), i;
|
|
2307
2307
|
}
|
|
2308
2308
|
reloadFeatureFlags() {
|
|
2309
2309
|
this._reloadingDisabled || this._instance.config.advanced_disable_feature_flags || this._reloadDebouncer || (this._reloadDebouncer = setTimeout(() => {
|
|
@@ -2326,30 +2326,30 @@ class hl {
|
|
|
2326
2326
|
var t;
|
|
2327
2327
|
if (this._clearDebouncer(), !this._instance.config.advanced_disable_decide) if (this._requestInFlight) this._additionalReloadRequested = !0;
|
|
2328
2328
|
else {
|
|
2329
|
-
var i = { token: this._instance.config.token, distinct_id: this._instance.get_distinct_id(), groups: this._instance.getGroups(), $anon_distinct_id: this.$anon_distinct_id, person_properties: f(f({}, ((t = this._instance.persistence) === null || t === void 0 ? void 0 : t.get_initial_props()) || {}), this._instance.get_property(
|
|
2329
|
+
var i = { token: this._instance.config.token, distinct_id: this._instance.get_distinct_id(), groups: this._instance.getGroups(), $anon_distinct_id: this.$anon_distinct_id, person_properties: f(f({}, ((t = this._instance.persistence) === null || t === void 0 ? void 0 : t.get_initial_props()) || {}), this._instance.get_property(Et) || {}), group_properties: this._instance.get_property(Je) };
|
|
2330
2330
|
(e != null && e.disableFlags || this._instance.config.advanced_disable_feature_flags) && (i.disable_flags = !0);
|
|
2331
2331
|
var s = this._instance.config.__preview_flags_v2 && this._instance.config.__preview_remote_config;
|
|
2332
|
-
s && (i.timezone = oo()), this._requestInFlight = !0, this._instance._send_request({ method: "POST", url: this._instance.requestRouter.endpointFor("api", s ? "/flags/?v=2" : "/decide/?v=4"), data: i, compression: this._instance.config.disable_compression ? void 0 :
|
|
2332
|
+
s && (i.timezone = oo()), this._requestInFlight = !0, this._instance._send_request({ method: "POST", url: this._instance.requestRouter.endpointFor("api", s ? "/flags/?v=2" : "/decide/?v=4"), data: i, compression: this._instance.config.disable_compression ? void 0 : ge.Base64, timeout: this._instance.config.feature_flag_request_timeout_ms, callback: (n) => {
|
|
2333
2333
|
var o, a, l, c = !0;
|
|
2334
|
-
n.statusCode === 200 && (this._additionalReloadRequested || (this.$anon_distinct_id = void 0), c = !1), this._requestInFlight = !1, this._decideCalled || (this._decideCalled = !0, this._instance._onRemoteConfig((l = n.json) !== null && l !== void 0 ? l : {})), i.disable_flags && !this._additionalReloadRequested || (this._flagsLoadedFromRemote = !c, n.json && (o = n.json.quotaLimited) !== null && o !== void 0 && o.includes(
|
|
2334
|
+
n.statusCode === 200 && (this._additionalReloadRequested || (this.$anon_distinct_id = void 0), c = !1), this._requestInFlight = !1, this._decideCalled || (this._decideCalled = !0, this._instance._onRemoteConfig((l = n.json) !== null && l !== void 0 ? l : {})), i.disable_flags && !this._additionalReloadRequested || (this._flagsLoadedFromRemote = !c, n.json && (o = n.json.quotaLimited) !== null && o !== void 0 && o.includes(dr.FeatureFlags) ? ye.warn("You have hit your feature flags quota limit, and will not be able to load feature flags until the quota is reset. Please visit https://posthog.com/docs/billing/limits-alerts to learn more.") : (this.receivedFeatureFlags((a = n.json) !== null && a !== void 0 ? a : {}, c), this._additionalReloadRequested && (this._additionalReloadRequested = !1, this._callDecideEndpoint())));
|
|
2335
2335
|
} });
|
|
2336
2336
|
}
|
|
2337
2337
|
}
|
|
2338
2338
|
getFeatureFlag(e) {
|
|
2339
2339
|
var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
2340
2340
|
if (this._hasLoadedFlags || this.getFlags() && this.getFlags().length > 0) {
|
|
2341
|
-
var i = this.getFlagVariants()[e], s = "".concat(i), n = this._instance.get_property(Ps) || void 0, o = this._instance.get_property(
|
|
2341
|
+
var i = this.getFlagVariants()[e], s = "".concat(i), n = this._instance.get_property(Ps) || void 0, o = this._instance.get_property(ei) || {};
|
|
2342
2342
|
if ((t.send_event || !("send_event" in t)) && (!(e in o) || !o[e].includes(s))) {
|
|
2343
2343
|
var a, l, c, d, u, h, _, p, v, b, y;
|
|
2344
|
-
D(o[e]) ? o[e].push(s) : o[e] = [s], (a = this._instance.persistence) === null || a === void 0 || a.register({ [
|
|
2344
|
+
D(o[e]) ? o[e].push(s) : o[e] = [s], (a = this._instance.persistence) === null || a === void 0 || a.register({ [ei]: o });
|
|
2345
2345
|
var m = this.getFeatureFlagDetails(e), E = { $feature_flag: e, $feature_flag_response: i, $feature_flag_payload: this.getFeatureFlagPayload(e) || null, $feature_flag_request_id: n, $feature_flag_bootstrapped_response: ((l = this._instance.config.bootstrap) === null || l === void 0 || (c = l.featureFlags) === null || c === void 0 ? void 0 : c[e]) || null, $feature_flag_bootstrapped_payload: ((d = this._instance.config.bootstrap) === null || d === void 0 || (u = d.featureFlagPayloads) === null || u === void 0 ? void 0 : u[e]) || null, $used_bootstrap_value: !this._flagsLoadedFromRemote };
|
|
2346
2346
|
S(m == null || (h = m.metadata) === null || h === void 0 ? void 0 : h.version) || (E.$feature_flag_version = m.metadata.version);
|
|
2347
|
-
var C,
|
|
2348
|
-
|
|
2347
|
+
var C, T = (_ = m == null || (p = m.reason) === null || p === void 0 ? void 0 : p.description) !== null && _ !== void 0 ? _ : m == null || (v = m.reason) === null || v === void 0 ? void 0 : v.code;
|
|
2348
|
+
T && (E.$feature_flag_reason = T), m != null && (b = m.metadata) !== null && b !== void 0 && b.id && (E.$feature_flag_id = m.metadata.id), S(m == null ? void 0 : m.original_variant) && S(m == null ? void 0 : m.original_enabled) || (E.$feature_flag_original_response = S(m.original_variant) ? m.original_enabled : m.original_variant), m != null && (y = m.metadata) !== null && y !== void 0 && y.original_payload && (E.$feature_flag_original_payload = m == null || (C = m.metadata) === null || C === void 0 ? void 0 : C.original_payload), this._instance.capture("$feature_flag_called", E);
|
|
2349
2349
|
}
|
|
2350
2350
|
return i;
|
|
2351
2351
|
}
|
|
2352
|
-
|
|
2352
|
+
ye.warn('getFeatureFlag for key "' + e + `" failed. Feature flags didn't load in time.`);
|
|
2353
2353
|
}
|
|
2354
2354
|
getFeatureFlagDetails(e) {
|
|
2355
2355
|
return this.getFlagsWithDetails()[e];
|
|
@@ -2359,7 +2359,7 @@ class hl {
|
|
|
2359
2359
|
}
|
|
2360
2360
|
getRemoteConfigPayload(e, t) {
|
|
2361
2361
|
var i = this._instance.config.token;
|
|
2362
|
-
this._instance._send_request({ method: "POST", url: this._instance.requestRouter.endpointFor("api", "/decide/?v=4"), data: { distinct_id: this._instance.get_distinct_id(), token: i }, compression: this._instance.config.disable_compression ? void 0 :
|
|
2362
|
+
this._instance._send_request({ method: "POST", url: this._instance.requestRouter.endpointFor("api", "/decide/?v=4"), data: { distinct_id: this._instance.get_distinct_id(), token: i }, compression: this._instance.config.disable_compression ? void 0 : ge.Base64, timeout: this._instance.config.feature_flag_request_timeout_ms, callback: (s) => {
|
|
2363
2363
|
var n, o = (n = s.json) === null || n === void 0 ? void 0 : n.featureFlagPayloads;
|
|
2364
2364
|
t((o == null ? void 0 : o[e]) || void 0);
|
|
2365
2365
|
} });
|
|
@@ -2367,7 +2367,7 @@ class hl {
|
|
|
2367
2367
|
isFeatureEnabled(e) {
|
|
2368
2368
|
var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
2369
2369
|
if (this._hasLoadedFlags || this.getFlags() && this.getFlags().length > 0) return !!this.getFeatureFlag(e, t);
|
|
2370
|
-
|
|
2370
|
+
ye.warn('isFeatureEnabled for key "' + e + `" failed. Feature flags didn't load in time.`);
|
|
2371
2371
|
}
|
|
2372
2372
|
addFeatureFlagsHandler(e) {
|
|
2373
2373
|
this.featureFlagEventHandlers.push(e);
|
|
@@ -2380,17 +2380,17 @@ class hl {
|
|
|
2380
2380
|
this._hasLoadedFlags = !0;
|
|
2381
2381
|
var i = this.getFlagVariants(), s = this.getFlagPayloads(), n = this.getFlagsWithDetails();
|
|
2382
2382
|
(function(o, a) {
|
|
2383
|
-
var l = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, c = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {}, d = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : {}, u =
|
|
2383
|
+
var l = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, c = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {}, d = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : {}, u = vl(o), h = u.flags, _ = u.featureFlags, p = u.featureFlagPayloads;
|
|
2384
2384
|
if (_) {
|
|
2385
2385
|
var v = o.requestId;
|
|
2386
2386
|
if (D(_)) {
|
|
2387
|
-
|
|
2387
|
+
ye.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");
|
|
2388
2388
|
var b = {};
|
|
2389
2389
|
if (_) for (var y = 0; y < _.length; y++) b[_[y]] = !0;
|
|
2390
|
-
a && a.register({ [
|
|
2390
|
+
a && a.register({ [Ai]: _, [ot]: b });
|
|
2391
2391
|
} else {
|
|
2392
2392
|
var m = _, E = p, C = h;
|
|
2393
|
-
o.errorsWhileComputingFlags && (m = f(f({}, l), m), E = f(f({}, c), E), C = f(f({}, d), C)), a && a.register(f({ [
|
|
2393
|
+
o.errorsWhileComputingFlags && (m = f(f({}, l), m), E = f(f({}, c), E), C = f(f({}, d), C)), a && a.register(f({ [Ai]: Object.keys(Ts(m)), [ot]: m || {}, [Is]: E || {}, [Vi]: C || {} }, v ? { [Ps]: v } : {}));
|
|
2394
2394
|
}
|
|
2395
2395
|
}
|
|
2396
2396
|
})(e, this._instance.persistence, i, s, n), this._fireFeatureFlagsCallbacks(t);
|
|
@@ -2398,21 +2398,21 @@ class hl {
|
|
|
2398
2398
|
}
|
|
2399
2399
|
override(e) {
|
|
2400
2400
|
var t = arguments.length > 1 && arguments[1] !== void 0 && arguments[1];
|
|
2401
|
-
|
|
2401
|
+
ye.warn("override is deprecated. Please use overrideFeatureFlags instead."), this.overrideFeatureFlags({ flags: e, suppressWarning: t });
|
|
2402
2402
|
}
|
|
2403
2403
|
overrideFeatureFlags(e) {
|
|
2404
|
-
if (!this._instance.__loaded || !this._instance.persistence) return
|
|
2405
|
-
if (e === !1) return this._instance.persistence.unregister(
|
|
2404
|
+
if (!this._instance.__loaded || !this._instance.persistence) return ye.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");
|
|
2405
|
+
if (e === !1) return this._instance.persistence.unregister(rt), this._instance.persistence.unregister(bt), void this._fireFeatureFlagsCallbacks();
|
|
2406
2406
|
if (e && typeof e == "object" && ("flags" in e || "payloads" in e)) {
|
|
2407
2407
|
var t, i = e;
|
|
2408
2408
|
if (this._override_warning = !!((t = i.suppressWarning) !== null && t !== void 0 && t), "flags" in i) {
|
|
2409
|
-
if (i.flags === !1) this._instance.persistence.unregister(
|
|
2409
|
+
if (i.flags === !1) this._instance.persistence.unregister(rt);
|
|
2410
2410
|
else if (i.flags) if (D(i.flags)) {
|
|
2411
2411
|
for (var s = {}, n = 0; n < i.flags.length; n++) s[i.flags[n]] = !0;
|
|
2412
|
-
this._instance.persistence.register({ [
|
|
2413
|
-
} else this._instance.persistence.register({ [
|
|
2412
|
+
this._instance.persistence.register({ [rt]: s });
|
|
2413
|
+
} else this._instance.persistence.register({ [rt]: i.flags });
|
|
2414
2414
|
}
|
|
2415
|
-
return "payloads" in i && (i.payloads === !1 ? this._instance.persistence.unregister(
|
|
2415
|
+
return "payloads" in i && (i.payloads === !1 ? this._instance.persistence.unregister(bt) : i.payloads && this._instance.persistence.register({ [bt]: i.payloads })), void this._fireFeatureFlagsCallbacks();
|
|
2416
2416
|
}
|
|
2417
2417
|
this._fireFeatureFlagsCallbacks();
|
|
2418
2418
|
}
|
|
@@ -2427,7 +2427,7 @@ class hl {
|
|
|
2427
2427
|
var i, s = (this._instance.get_property(Wt) || []).find((l) => l.flagKey === e), n = { ["$feature_enrollment/".concat(e)]: t }, o = { $feature_flag: e, $feature_enrollment: t, $set: n };
|
|
2428
2428
|
s && (o.$early_access_feature_name = s.name), this._instance.capture("$feature_enrollment_update", o), this.setPersonPropertiesForFlags(n, !1);
|
|
2429
2429
|
var a = f(f({}, this.getFlagVariants()), {}, { [e]: t });
|
|
2430
|
-
(i = this._instance.persistence) === null || i === void 0 || i.register({ [
|
|
2430
|
+
(i = this._instance.persistence) === null || i === void 0 || i.register({ [Ai]: Object.keys(Ts(a)), [ot]: a }), this._fireFeatureFlagsCallbacks();
|
|
2431
2431
|
}
|
|
2432
2432
|
getEarlyAccessFeatures(e) {
|
|
2433
2433
|
var t = arguments.length > 1 && arguments[1] !== void 0 && arguments[1], i = arguments.length > 2 ? arguments[2] : void 0, s = this._instance.get_property(Wt), n = i ? "&".concat(i.map((o) => "stage=".concat(o)).join("&")) : "";
|
|
@@ -2449,27 +2449,27 @@ class hl {
|
|
|
2449
2449
|
this.featureFlagEventHandlers.forEach((s) => s(t, i, { errorsLoading: e }));
|
|
2450
2450
|
}
|
|
2451
2451
|
setPersonPropertiesForFlags(e) {
|
|
2452
|
-
var t = !(arguments.length > 1 && arguments[1] !== void 0) || arguments[1], i = this._instance.get_property(
|
|
2453
|
-
this._instance.register({ [
|
|
2452
|
+
var t = !(arguments.length > 1 && arguments[1] !== void 0) || arguments[1], i = this._instance.get_property(Et) || {};
|
|
2453
|
+
this._instance.register({ [Et]: f(f({}, i), e) }), t && this._instance.reloadFeatureFlags();
|
|
2454
2454
|
}
|
|
2455
2455
|
resetPersonPropertiesForFlags() {
|
|
2456
|
-
this._instance.unregister(
|
|
2456
|
+
this._instance.unregister(Et);
|
|
2457
2457
|
}
|
|
2458
2458
|
setGroupPropertiesForFlags(e) {
|
|
2459
|
-
var t = !(arguments.length > 1 && arguments[1] !== void 0) || arguments[1], i = this._instance.get_property(
|
|
2459
|
+
var t = !(arguments.length > 1 && arguments[1] !== void 0) || arguments[1], i = this._instance.get_property(Je) || {};
|
|
2460
2460
|
Object.keys(i).length !== 0 && Object.keys(i).forEach((s) => {
|
|
2461
2461
|
i[s] = f(f({}, i[s]), e[s]), delete e[s];
|
|
2462
|
-
}), this._instance.register({ [
|
|
2462
|
+
}), this._instance.register({ [Je]: f(f({}, i), e) }), t && this._instance.reloadFeatureFlags();
|
|
2463
2463
|
}
|
|
2464
2464
|
resetGroupPropertiesForFlags(e) {
|
|
2465
2465
|
if (e) {
|
|
2466
|
-
var t = this._instance.get_property(
|
|
2467
|
-
this._instance.register({ [
|
|
2468
|
-
} else this._instance.unregister(
|
|
2466
|
+
var t = this._instance.get_property(Je) || {};
|
|
2467
|
+
this._instance.register({ [Je]: f(f({}, t), {}, { [e]: {} }) });
|
|
2468
|
+
} else this._instance.unregister(Je);
|
|
2469
2469
|
}
|
|
2470
2470
|
}
|
|
2471
|
-
var
|
|
2472
|
-
class
|
|
2471
|
+
var ml = ["cookie", "localstorage", "localstorage+cookie", "sessionstorage", "memory"];
|
|
2472
|
+
class Mi {
|
|
2473
2473
|
constructor(e) {
|
|
2474
2474
|
this._config = e, this.props = {}, this.campaign_params_saved = !1, this.name = ((t) => {
|
|
2475
2475
|
var i = "";
|
|
@@ -2477,16 +2477,16 @@ class $i {
|
|
|
2477
2477
|
})(e), this.storage = this._buildStorage(e), this.load(), e.debug && x.info("Persistence loaded", e.persistence, f({}, this.props)), this.update_config(e, e), this.save();
|
|
2478
2478
|
}
|
|
2479
2479
|
_buildStorage(e) {
|
|
2480
|
-
|
|
2480
|
+
ml.indexOf(e.persistence.toLowerCase()) === -1 && (x.critical("Unknown persistence type " + e.persistence + "; falling back to localStorage+cookie"), e.persistence = "localStorage+cookie");
|
|
2481
2481
|
var t = e.persistence.toLowerCase();
|
|
2482
|
-
return t === "localstorage" && U.is_supported() ? U : t === "localstorage+cookie" && Mt.is_supported() ? Mt : t === "sessionstorage" && W.is_supported() ? W : t === "memory" ?
|
|
2482
|
+
return t === "localstorage" && U.is_supported() ? U : t === "localstorage+cookie" && Mt.is_supported() ? Mt : t === "sessionstorage" && W.is_supported() ? W : t === "memory" ? ca : t === "cookie" ? Pe : Mt.is_supported() ? Mt : Pe;
|
|
2483
2483
|
}
|
|
2484
2484
|
properties() {
|
|
2485
2485
|
var e = {};
|
|
2486
2486
|
return $(this.props, function(t, i) {
|
|
2487
|
-
if (i ===
|
|
2488
|
-
else a = i, l = !1, (
|
|
2489
|
-
if (l || (l = c === a)) return
|
|
2487
|
+
if (i === ot && q(t)) for (var s = Object.keys(t), n = 0; n < s.length; n++) e["$feature/".concat(s[n])] = t[s[n]];
|
|
2488
|
+
else a = i, l = !1, (je(o = Uo) ? l : qr && o.indexOf === qr ? o.indexOf(a) != -1 : ($(o, function(c) {
|
|
2489
|
+
if (l || (l = c === a)) return Qt;
|
|
2490
2490
|
}), l)) || (e[i] = t);
|
|
2491
2491
|
var o, a, l;
|
|
2492
2492
|
}), e;
|
|
@@ -2532,7 +2532,7 @@ class $i {
|
|
|
2532
2532
|
update_campaign_params() {
|
|
2533
2533
|
if (!this.campaign_params_saved) {
|
|
2534
2534
|
var e = eo(this._config.custom_campaign_params, this._config.mask_personal_data_properties, this._config.custom_personal_data_properties);
|
|
2535
|
-
|
|
2535
|
+
nt(Xt(e)) || this.register(e), this.campaign_params_saved = !0;
|
|
2536
2536
|
}
|
|
2537
2537
|
}
|
|
2538
2538
|
update_search_keyword() {
|
|
@@ -2541,26 +2541,26 @@ class $i {
|
|
|
2541
2541
|
}
|
|
2542
2542
|
update_referrer_info() {
|
|
2543
2543
|
var e;
|
|
2544
|
-
this.register_once({ $referrer: ro(), $referring_domain: k != null && k.referrer && ((e =
|
|
2544
|
+
this.register_once({ $referrer: ro(), $referring_domain: k != null && k.referrer && ((e = dt(k.referrer)) === null || e === void 0 ? void 0 : e.host) || "$direct" }, void 0);
|
|
2545
2545
|
}
|
|
2546
2546
|
set_initial_person_info() {
|
|
2547
|
-
this.props[
|
|
2547
|
+
this.props[Yi] || this.props[Qi] || this.register_once({ [Xi]: so(this._config.mask_personal_data_properties, this._config.custom_personal_data_properties) }, void 0);
|
|
2548
2548
|
}
|
|
2549
2549
|
get_referrer_info() {
|
|
2550
|
-
return
|
|
2550
|
+
return Xt({ $referrer: this.props.$referrer, $referring_domain: this.props.$referring_domain });
|
|
2551
2551
|
}
|
|
2552
2552
|
get_initial_props() {
|
|
2553
2553
|
var e = {};
|
|
2554
|
-
$([
|
|
2554
|
+
$([Qi, Yi], (o) => {
|
|
2555
2555
|
var a = this.props[o];
|
|
2556
2556
|
a && $(a, function(l, c) {
|
|
2557
|
-
e["$initial_" +
|
|
2557
|
+
e["$initial_" + ji(c)] = l;
|
|
2558
2558
|
});
|
|
2559
2559
|
});
|
|
2560
|
-
var t, i, s = this.props[
|
|
2560
|
+
var t, i, s = this.props[Xi];
|
|
2561
2561
|
if (s) {
|
|
2562
2562
|
var n = (t = no(s), i = {}, $(t, function(o, a) {
|
|
2563
|
-
i["$initial_".concat(
|
|
2563
|
+
i["$initial_".concat(ji(a))] = o;
|
|
2564
2564
|
}), i);
|
|
2565
2565
|
H(e, n);
|
|
2566
2566
|
}
|
|
@@ -2590,12 +2590,12 @@ class $i {
|
|
|
2590
2590
|
e !== this.secure && (this.secure = e, this.remove(), this.save());
|
|
2591
2591
|
}
|
|
2592
2592
|
set_event_timer(e, t) {
|
|
2593
|
-
var i = this.props[
|
|
2594
|
-
i[e] = t, this.props[
|
|
2593
|
+
var i = this.props[St] || {};
|
|
2594
|
+
i[e] = t, this.props[St] = i, this.save();
|
|
2595
2595
|
}
|
|
2596
2596
|
remove_event_timer(e) {
|
|
2597
|
-
var t = (this.props[
|
|
2598
|
-
return S(t) || (delete this.props[
|
|
2597
|
+
var t = (this.props[St] || {})[e];
|
|
2598
|
+
return S(t) || (delete this.props[St][e], this.save()), t;
|
|
2599
2599
|
}
|
|
2600
2600
|
get_property(e) {
|
|
2601
2601
|
return this.props[e];
|
|
@@ -2604,7 +2604,7 @@ class $i {
|
|
|
2604
2604
|
this.props[e] = t, this.save();
|
|
2605
2605
|
}
|
|
2606
2606
|
}
|
|
2607
|
-
var ao, B, lo,
|
|
2607
|
+
var ao, B, lo, Ke, Fs, uo, _r, co, Rs, hr, $s, Os, Ls, As, pr = {}, _o = [], yl = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i, Tr = Array.isArray;
|
|
2608
2608
|
function De(r, e) {
|
|
2609
2609
|
for (var t in e) r[t] = e[t];
|
|
2610
2610
|
return r;
|
|
@@ -2613,20 +2613,20 @@ function ho(r) {
|
|
|
2613
2613
|
var e = r.parentNode;
|
|
2614
2614
|
e && e.removeChild(r);
|
|
2615
2615
|
}
|
|
2616
|
-
function
|
|
2616
|
+
function Di(r, e, t, i, s) {
|
|
2617
2617
|
var n = { type: r, props: e, key: t, ref: i, __k: null, __: null, __b: 0, __e: null, __d: void 0, __c: null, constructor: void 0, __v: s ?? ++lo, __i: -1, __u: 0 };
|
|
2618
2618
|
return s == null && B.vnode != null && B.vnode(n), n;
|
|
2619
2619
|
}
|
|
2620
|
-
function
|
|
2620
|
+
function Fr(r) {
|
|
2621
2621
|
return r.children;
|
|
2622
2622
|
}
|
|
2623
2623
|
function Gt(r, e) {
|
|
2624
2624
|
this.props = r, this.context = e;
|
|
2625
2625
|
}
|
|
2626
|
-
function
|
|
2627
|
-
if (e == null) return r.__ ?
|
|
2626
|
+
function pt(r, e) {
|
|
2627
|
+
if (e == null) return r.__ ? pt(r.__, r.__i + 1) : null;
|
|
2628
2628
|
for (var t; e < r.__k.length; e++) if ((t = r.__k[e]) != null && t.__e != null) return t.__e;
|
|
2629
|
-
return typeof r.type == "function" ?
|
|
2629
|
+
return typeof r.type == "function" ? pt(r) : null;
|
|
2630
2630
|
}
|
|
2631
2631
|
function po(r) {
|
|
2632
2632
|
var e, t;
|
|
@@ -2638,23 +2638,23 @@ function po(r) {
|
|
|
2638
2638
|
return po(r);
|
|
2639
2639
|
}
|
|
2640
2640
|
}
|
|
2641
|
-
function
|
|
2642
|
-
(!r.__d && (r.__d = !0) &&
|
|
2641
|
+
function gr(r) {
|
|
2642
|
+
(!r.__d && (r.__d = !0) && Ke.push(r) && !ui.__r++ || Fs !== B.debounceRendering) && ((Fs = B.debounceRendering) || uo)(ui);
|
|
2643
2643
|
}
|
|
2644
|
-
function
|
|
2644
|
+
function ui() {
|
|
2645
2645
|
var r, e, t, i, s, n, o, a, l;
|
|
2646
|
-
for (
|
|
2647
|
-
|
|
2646
|
+
for (Ke.sort(_r); r = Ke.shift(); ) r.__d && (e = Ke.length, i = void 0, n = (s = (t = r).__v).__e, a = [], l = [], (o = t.__P) && ((i = De({}, s)).__v = s.__v + 1, B.vnode && B.vnode(i), fo(o, i, s, t.__n, o.ownerSVGElement !== void 0, 32 & s.__u ? [n] : null, a, n ?? pt(s), !!(32 & s.__u), l), i.__.__k[i.__i] = i, Sl(a, i, l), i.__e != n && po(i)), Ke.length > e && Ke.sort(_r));
|
|
2647
|
+
ui.__r = 0;
|
|
2648
2648
|
}
|
|
2649
2649
|
function go(r, e, t, i, s, n, o, a, l, c, d) {
|
|
2650
2650
|
var u, h, _, p, v, b = i && i.__k || _o, y = e.length;
|
|
2651
|
-
for (t.__d = l,
|
|
2651
|
+
for (t.__d = l, bl(t, e, b), l = t.__d, u = 0; u < y; u++) (_ = t.__k[u]) != null && typeof _ != "boolean" && typeof _ != "function" && (h = _.__i === -1 ? pr : b[_.__i] || pr, _.__i = u, fo(r, _, h, s, n, o, a, l, c, d), p = _.__e, _.ref && h.ref != _.ref && (h.ref && Rr(h.ref, null, _), d.push(_.ref, _.__c || p, _)), v == null && p != null && (v = p), 65536 & _.__u || h.__k === _.__k ? l = vo(_, l, r) : typeof _.type == "function" && _.__d !== void 0 ? l = _.__d : p && (l = p.nextSibling), _.__d = void 0, _.__u &= -196609);
|
|
2652
2652
|
t.__d = l, t.__e = v;
|
|
2653
2653
|
}
|
|
2654
|
-
function
|
|
2654
|
+
function bl(r, e, t) {
|
|
2655
2655
|
var i, s, n, o, a, l = e.length, c = t.length, d = c, u = 0;
|
|
2656
|
-
for (r.__k = [], i = 0; i < l; i++) (s = r.__k[i] = (s = e[i]) == null || typeof s == "boolean" || typeof s == "function" ? null : typeof s == "string" || typeof s == "number" || typeof s == "bigint" || s.constructor == String ?
|
|
2657
|
-
if (d) for (i = 0; i < c; i++) (n = t[i]) != null && (131072 & n.__u) == 0 && (n.__e == r.__d && (r.__d =
|
|
2656
|
+
for (r.__k = [], i = 0; i < l; i++) (s = r.__k[i] = (s = e[i]) == null || typeof s == "boolean" || typeof s == "function" ? null : typeof s == "string" || typeof s == "number" || typeof s == "bigint" || s.constructor == String ? Di(null, s, null, null, s) : Tr(s) ? Di(Fr, { children: s }, null, null, null) : s.constructor === void 0 && s.__b > 0 ? Di(s.type, s.props, s.key, s.ref ? s.ref : null, s.__v) : s) != null ? (s.__ = r, s.__b = r.__b + 1, a = wl(s, t, o = i + u, d), s.__i = a, n = null, a !== -1 && (d--, (n = t[a]) && (n.__u |= 131072)), n == null || n.__v === null ? (a == -1 && u--, typeof s.type != "function" && (s.__u |= 65536)) : a !== o && (a === o + 1 ? u++ : a > o ? d > l - o ? u += a - o : u-- : u = a < o && a == o - 1 ? a - o : 0, a !== i + u && (s.__u |= 65536))) : (n = t[i]) && n.key == null && n.__e && (n.__e == r.__d && (r.__d = pt(n)), vr(n, n, !1), t[i] = null, d--);
|
|
2657
|
+
if (d) for (i = 0; i < c; i++) (n = t[i]) != null && (131072 & n.__u) == 0 && (n.__e == r.__d && (r.__d = pt(n)), vr(n, n));
|
|
2658
2658
|
}
|
|
2659
2659
|
function vo(r, e, t) {
|
|
2660
2660
|
var i, s;
|
|
@@ -2664,7 +2664,7 @@ function vo(r, e, t) {
|
|
|
2664
2664
|
}
|
|
2665
2665
|
return r.__e != e && (t.insertBefore(r.__e, e || null), e = r.__e), e && e.nextSibling;
|
|
2666
2666
|
}
|
|
2667
|
-
function
|
|
2667
|
+
function wl(r, e, t, i) {
|
|
2668
2668
|
var s = r.key, n = r.type, o = t - 1, a = t + 1, l = e[t];
|
|
2669
2669
|
if (l === null || l && s == l.key && n === l.type) return t;
|
|
2670
2670
|
if (i > (l != null && (131072 & l.__u) == 0 ? 1 : 0)) for (; o >= 0 || a < e.length; ) {
|
|
@@ -2680,7 +2680,7 @@ function fl(r, e, t, i) {
|
|
|
2680
2680
|
return -1;
|
|
2681
2681
|
}
|
|
2682
2682
|
function Ms(r, e, t) {
|
|
2683
|
-
e[0] === "-" ? r.setProperty(e, t ?? "") : r[e] = t == null ? "" : typeof t != "number" ||
|
|
2683
|
+
e[0] === "-" ? r.setProperty(e, t ?? "") : r[e] = t == null ? "" : typeof t != "number" || yl.test(e) ? t : t + "px";
|
|
2684
2684
|
}
|
|
2685
2685
|
function Ut(r, e, t, i, s) {
|
|
2686
2686
|
var n;
|
|
@@ -2711,11 +2711,11 @@ function qs(r) {
|
|
|
2711
2711
|
return this.l[r.type + !0](B.event ? B.event(r) : r);
|
|
2712
2712
|
}
|
|
2713
2713
|
function fo(r, e, t, i, s, n, o, a, l, c) {
|
|
2714
|
-
var d, u, h, _, p, v, b, y, m, E, C,
|
|
2714
|
+
var d, u, h, _, p, v, b, y, m, E, C, T, O, L, P, M = e.type;
|
|
2715
2715
|
if (e.constructor !== void 0) return null;
|
|
2716
2716
|
128 & t.__u && (l = !!(32 & t.__u), n = [a = e.__e = t.__e]), (d = B.__b) && d(e);
|
|
2717
2717
|
e: if (typeof M == "function") try {
|
|
2718
|
-
if (y = e.props, m = (d = M.contextType) && i[d.__c], E = d ? m ? m.props.value : d.__ : i, t.__c ? b = (u = e.__c = t.__c).__ = u.__E : ("prototype" in M && M.prototype.render ? e.__c = u = new M(y, E) : (e.__c = u = new Gt(y, E), u.constructor = M, u.render =
|
|
2718
|
+
if (y = e.props, m = (d = M.contextType) && i[d.__c], E = d ? m ? m.props.value : d.__ : i, t.__c ? b = (u = e.__c = t.__c).__ = u.__E : ("prototype" in M && M.prototype.render ? e.__c = u = new M(y, E) : (e.__c = u = new Gt(y, E), u.constructor = M, u.render = El), m && m.sub(u), u.props = y, u.state || (u.state = {}), u.context = E, u.__n = i, h = u.__d = !0, u.__h = [], u._sb = []), u.__s == null && (u.__s = u.state), M.getDerivedStateFromProps != null && (u.__s == u.state && (u.__s = De({}, u.__s)), De(u.__s, M.getDerivedStateFromProps(y, u.__s))), _ = u.props, p = u.state, u.__v = e, h) M.getDerivedStateFromProps == null && u.componentWillMount != null && u.componentWillMount(), u.componentDidMount != null && u.__h.push(u.componentDidMount);
|
|
2719
2719
|
else {
|
|
2720
2720
|
if (M.getDerivedStateFromProps == null && y !== _ && u.componentWillReceiveProps != null && u.componentWillReceiveProps(y, E), !u.__e && (u.shouldComponentUpdate != null && u.shouldComponentUpdate(y, u.__s, E) === !1 || e.__v === t.__v)) {
|
|
2721
2721
|
for (e.__v !== t.__v && (u.props = y, u.state = u.__s, u.__d = !1), e.__e = t.__e, e.__k = t.__k, e.__k.forEach(function(z) {
|
|
@@ -2728,22 +2728,22 @@ function fo(r, e, t, i, s, n, o, a, l, c) {
|
|
|
2728
2728
|
u.componentDidUpdate(_, p, v);
|
|
2729
2729
|
});
|
|
2730
2730
|
}
|
|
2731
|
-
if (u.context = E, u.props = y, u.__P = r, u.__e = !1,
|
|
2732
|
-
for (u.state = u.__s, u.__d = !1,
|
|
2731
|
+
if (u.context = E, u.props = y, u.__P = r, u.__e = !1, T = B.__r, O = 0, "prototype" in M && M.prototype.render) {
|
|
2732
|
+
for (u.state = u.__s, u.__d = !1, T && T(e), d = u.render(u.props, u.state, u.context), L = 0; L < u._sb.length; L++) u.__h.push(u._sb[L]);
|
|
2733
2733
|
u._sb = [];
|
|
2734
2734
|
} else do
|
|
2735
|
-
u.__d = !1,
|
|
2735
|
+
u.__d = !1, T && T(e), d = u.render(u.props, u.state, u.context), u.state = u.__s;
|
|
2736
2736
|
while (u.__d && ++O < 25);
|
|
2737
|
-
u.state = u.__s, u.getChildContext != null && (i = De(De({}, i), u.getChildContext())), h || u.getSnapshotBeforeUpdate == null || (v = u.getSnapshotBeforeUpdate(_, p)), go(r,
|
|
2737
|
+
u.state = u.__s, u.getChildContext != null && (i = De(De({}, i), u.getChildContext())), h || u.getSnapshotBeforeUpdate == null || (v = u.getSnapshotBeforeUpdate(_, p)), go(r, Tr(P = d != null && d.type === Fr && d.key == null ? d.props.children : d) ? P : [P], e, t, i, s, n, o, a, l, c), u.base = e.__e, e.__u &= -161, u.__h.length && o.push(u), b && (u.__E = u.__ = null);
|
|
2738
2738
|
} catch (z) {
|
|
2739
2739
|
e.__v = null, l || n != null ? (e.__e = a, e.__u |= l ? 160 : 32, n[n.indexOf(a)] = null) : (e.__e = t.__e, e.__k = t.__k), B.__e(z, e, t);
|
|
2740
2740
|
}
|
|
2741
|
-
else n == null && e.__v === t.__v ? (e.__k = t.__k, e.__e = t.__e) : e.__e =
|
|
2741
|
+
else n == null && e.__v === t.__v ? (e.__k = t.__k, e.__e = t.__e) : e.__e = kl(t.__e, e, t, i, s, n, o, l, c);
|
|
2742
2742
|
(d = B.diffed) && d(e);
|
|
2743
2743
|
}
|
|
2744
|
-
function
|
|
2744
|
+
function Sl(r, e, t) {
|
|
2745
2745
|
e.__d = void 0;
|
|
2746
|
-
for (var i = 0; i < t.length; i++)
|
|
2746
|
+
for (var i = 0; i < t.length; i++) Rr(t[i], t[++i], t[++i]);
|
|
2747
2747
|
B.__c && B.__c(e, r), r.some(function(s) {
|
|
2748
2748
|
try {
|
|
2749
2749
|
r = s.__h, s.__h = [], r.some(function(n) {
|
|
@@ -2754,7 +2754,7 @@ function ml(r, e, t) {
|
|
|
2754
2754
|
}
|
|
2755
2755
|
});
|
|
2756
2756
|
}
|
|
2757
|
-
function
|
|
2757
|
+
function kl(r, e, t, i, s, n, o, a, l) {
|
|
2758
2758
|
var c, d, u, h, _, p, v, b = t.props, y = e.props, m = e.type;
|
|
2759
2759
|
if (m === "svg" && (s = !0), n != null) {
|
|
2760
2760
|
for (c = 0; c < n.length; c++) if ((_ = n[c]) && "setAttribute" in _ == !!m && (m ? _.localName === m : _.nodeType === 3)) {
|
|
@@ -2768,25 +2768,25 @@ function yl(r, e, t, i, s, n, o, a, l) {
|
|
|
2768
2768
|
}
|
|
2769
2769
|
if (m === null) b === y || a && r.data === y || (r.data = y);
|
|
2770
2770
|
else {
|
|
2771
|
-
if (n = n && ao.call(r.childNodes), b = t.props ||
|
|
2771
|
+
if (n = n && ao.call(r.childNodes), b = t.props || pr, !a && n != null) for (b = {}, c = 0; c < r.attributes.length; c++) b[(_ = r.attributes[c]).name] = _.value;
|
|
2772
2772
|
for (c in b) _ = b[c], c == "children" || (c == "dangerouslySetInnerHTML" ? u = _ : c === "key" || c in y || Ut(r, c, null, _, s));
|
|
2773
2773
|
for (c in y) _ = y[c], c == "children" ? h = _ : c == "dangerouslySetInnerHTML" ? d = _ : c == "value" ? p = _ : c == "checked" ? v = _ : c === "key" || a && typeof _ != "function" || b[c] === _ || Ut(r, c, _, b[c], s);
|
|
2774
2774
|
if (d) a || u && (d.__html === u.__html || d.__html === r.innerHTML) || (r.innerHTML = d.__html), e.__k = [];
|
|
2775
|
-
else if (u && (r.innerHTML = ""), go(r,
|
|
2775
|
+
else if (u && (r.innerHTML = ""), go(r, Tr(h) ? h : [h], e, t, i, s && m !== "foreignObject", n, o, n ? n[0] : t.__k && pt(t, 0), a, l), n != null) for (c = n.length; c--; ) n[c] != null && ho(n[c]);
|
|
2776
2776
|
a || (c = "value", p !== void 0 && (p !== r[c] || m === "progress" && !p || m === "option" && p !== b[c]) && Ut(r, c, p, b[c], !1), c = "checked", v !== void 0 && v !== r[c] && Ut(r, c, v, b[c], !1));
|
|
2777
2777
|
}
|
|
2778
2778
|
return r;
|
|
2779
2779
|
}
|
|
2780
|
-
function
|
|
2780
|
+
function Rr(r, e, t) {
|
|
2781
2781
|
try {
|
|
2782
2782
|
typeof r == "function" ? r(e) : r.current = e;
|
|
2783
2783
|
} catch (i) {
|
|
2784
2784
|
B.__e(i, t);
|
|
2785
2785
|
}
|
|
2786
2786
|
}
|
|
2787
|
-
function
|
|
2787
|
+
function vr(r, e, t) {
|
|
2788
2788
|
var i, s;
|
|
2789
|
-
if (B.unmount && B.unmount(r), (i = r.ref) && (i.current && i.current !== r.__e ||
|
|
2789
|
+
if (B.unmount && B.unmount(r), (i = r.ref) && (i.current && i.current !== r.__e || Rr(i, null, e)), (i = r.__c) != null) {
|
|
2790
2790
|
if (i.componentWillUnmount) try {
|
|
2791
2791
|
i.componentWillUnmount();
|
|
2792
2792
|
} catch (n) {
|
|
@@ -2794,10 +2794,10 @@ function pr(r, e, t) {
|
|
|
2794
2794
|
}
|
|
2795
2795
|
i.base = i.__P = null, r.__c = void 0;
|
|
2796
2796
|
}
|
|
2797
|
-
if (i = r.__k) for (s = 0; s < i.length; s++) i[s] &&
|
|
2797
|
+
if (i = r.__k) for (s = 0; s < i.length; s++) i[s] && vr(i[s], e, t || typeof r.type != "function");
|
|
2798
2798
|
t || r.__e == null || ho(r.__e), r.__ = r.__e = r.__d = void 0;
|
|
2799
2799
|
}
|
|
2800
|
-
function
|
|
2800
|
+
function El(r, e, t) {
|
|
2801
2801
|
return this.constructor(r, t);
|
|
2802
2802
|
}
|
|
2803
2803
|
ao = _o.slice, B = { __e: function(r, e, t, i) {
|
|
@@ -2809,16 +2809,16 @@ ao = _o.slice, B = { __e: function(r, e, t, i) {
|
|
|
2809
2809
|
throw r;
|
|
2810
2810
|
} }, lo = 0, Gt.prototype.setState = function(r, e) {
|
|
2811
2811
|
var t;
|
|
2812
|
-
t = this.__s != null && this.__s !== this.state ? this.__s : this.__s = De({}, this.state), typeof r == "function" && (r = r(De({}, t), this.props)), r && De(t, r), r != null && this.__v && (e && this._sb.push(e),
|
|
2812
|
+
t = this.__s != null && this.__s !== this.state ? this.__s : this.__s = De({}, this.state), typeof r == "function" && (r = r(De({}, t), this.props)), r && De(t, r), r != null && this.__v && (e && this._sb.push(e), gr(this));
|
|
2813
2813
|
}, Gt.prototype.forceUpdate = function(r) {
|
|
2814
|
-
this.__v && (this.__e = !0, r && this.__h.push(r),
|
|
2815
|
-
}, Gt.prototype.render =
|
|
2814
|
+
this.__v && (this.__e = !0, r && this.__h.push(r), gr(this));
|
|
2815
|
+
}, Gt.prototype.render = Fr, Ke = [], uo = typeof Promise == "function" ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, _r = function(r, e) {
|
|
2816
2816
|
return r.__v.__b - e.__v.__b;
|
|
2817
|
-
},
|
|
2817
|
+
}, ui.__r = 0, co = 0, function(r) {
|
|
2818
2818
|
r.Button = "button", r.Tab = "tab", r.Selector = "selector";
|
|
2819
2819
|
}(Rs || (Rs = {})), function(r) {
|
|
2820
2820
|
r.Left = "left", r.Center = "center", r.Right = "right", r.NextToTrigger = "next_to_trigger";
|
|
2821
|
-
}(
|
|
2821
|
+
}(hr || (hr = {})), function(r) {
|
|
2822
2822
|
r.Popover = "popover", r.API = "api", r.Widget = "widget";
|
|
2823
2823
|
}($s || ($s = {})), function(r) {
|
|
2824
2824
|
r.Open = "open", r.MultipleChoice = "multiple_choice", r.SingleChoice = "single_choice", r.Rating = "rating", r.Link = "link";
|
|
@@ -2827,7 +2827,7 @@ ao = _o.slice, B = { __e: function(r, e, t, i) {
|
|
|
2827
2827
|
}(Ls || (Ls = {})), function(r) {
|
|
2828
2828
|
r.Once = "once", r.Recurring = "recurring", r.Always = "always";
|
|
2829
2829
|
}(As || (As = {}));
|
|
2830
|
-
var
|
|
2830
|
+
var gt = function(r, e) {
|
|
2831
2831
|
if (!function(t) {
|
|
2832
2832
|
try {
|
|
2833
2833
|
new RegExp(t);
|
|
@@ -2841,11 +2841,11 @@ var pt = function(r, e) {
|
|
|
2841
2841
|
} catch {
|
|
2842
2842
|
return !1;
|
|
2843
2843
|
}
|
|
2844
|
-
},
|
|
2844
|
+
}, Z = Q("[Surveys]"), Ns = { icontains: (r, e) => r.some((t) => e.toLowerCase().includes(t.toLowerCase())), not_icontains: (r, e) => r.every((t) => !e.toLowerCase().includes(t.toLowerCase())), regex: (r, e) => r.some((t) => gt(e, t)), not_regex: (r, e) => r.every((t) => !gt(e, t)), exact: (r, e) => r.some((t) => e === t), is_not: (r, e) => r.every((t) => e !== t) };
|
|
2845
2845
|
function Bs(r) {
|
|
2846
2846
|
return r ?? "icontains";
|
|
2847
2847
|
}
|
|
2848
|
-
|
|
2848
|
+
hr.Right;
|
|
2849
2849
|
(function(r, e) {
|
|
2850
2850
|
var t = { __c: e = "__cC" + co++, __: r, Consumer: function(i, s) {
|
|
2851
2851
|
return i.children(s);
|
|
@@ -2855,7 +2855,7 @@ dr.Right;
|
|
|
2855
2855
|
return n;
|
|
2856
2856
|
}, this.shouldComponentUpdate = function(o) {
|
|
2857
2857
|
this.props.value !== o.value && s.some(function(a) {
|
|
2858
|
-
a.__e = !0,
|
|
2858
|
+
a.__e = !0, gr(a);
|
|
2859
2859
|
});
|
|
2860
2860
|
}, this.sub = function(o) {
|
|
2861
2861
|
s.push(o);
|
|
@@ -2883,7 +2883,7 @@ class mo {
|
|
|
2883
2883
|
for (var s of this._events["*"] || []) s(e, t);
|
|
2884
2884
|
}
|
|
2885
2885
|
}
|
|
2886
|
-
class
|
|
2886
|
+
class Ye {
|
|
2887
2887
|
constructor(e) {
|
|
2888
2888
|
w(this, "_debugEventEmitter", new mo()), w(this, "_checkStep", (t, i) => this._checkStepEvent(t, i) && this._checkStepUrl(t, i) && this._checkStepElement(t, i)), w(this, "_checkStepEvent", (t, i) => i == null || !i.event || (t == null ? void 0 : t.event) === (i == null ? void 0 : i.event)), this._instance = e, this._actionEvents = /* @__PURE__ */ new Set(), this._actionRegistry = /* @__PURE__ */ new Set();
|
|
2889
2889
|
}
|
|
@@ -2934,19 +2934,19 @@ class Je {
|
|
|
2934
2934
|
_checkStepUrl(e, t) {
|
|
2935
2935
|
if (t != null && t.url) {
|
|
2936
2936
|
var i, s = e == null || (i = e.properties) === null || i === void 0 ? void 0 : i.$current_url;
|
|
2937
|
-
if (!s || typeof s != "string" || !
|
|
2937
|
+
if (!s || typeof s != "string" || !Ye._matchString(s, t == null ? void 0 : t.url, (t == null ? void 0 : t.url_matching) || "contains")) return !1;
|
|
2938
2938
|
}
|
|
2939
2939
|
return !0;
|
|
2940
2940
|
}
|
|
2941
2941
|
static _matchString(e, t, i) {
|
|
2942
2942
|
switch (i) {
|
|
2943
2943
|
case "regex":
|
|
2944
|
-
return !!g &&
|
|
2944
|
+
return !!g && gt(e, t);
|
|
2945
2945
|
case "exact":
|
|
2946
2946
|
return t === e;
|
|
2947
2947
|
case "contains":
|
|
2948
|
-
var s =
|
|
2949
|
-
return
|
|
2948
|
+
var s = Ye._escapeStringRegexp(t).replace(/_/g, ".").replace(/%/g, ".*");
|
|
2949
|
+
return gt(e, s);
|
|
2950
2950
|
default:
|
|
2951
2951
|
return !1;
|
|
2952
2952
|
}
|
|
@@ -2955,7 +2955,7 @@ class Je {
|
|
|
2955
2955
|
return e.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&").replace(/-/g, "\\x2d");
|
|
2956
2956
|
}
|
|
2957
2957
|
_checkStepElement(e, t) {
|
|
2958
|
-
if ((t != null && t.href || t != null && t.tag_name || t != null && t.text) && !this._getElementsList(e).some((n) => !(t != null && t.href && !
|
|
2958
|
+
if ((t != null && t.href || t != null && t.tag_name || t != null && t.text) && !this._getElementsList(e).some((n) => !(t != null && t.href && !Ye._matchString(n.href || "", t == null ? void 0 : t.href, (t == null ? void 0 : t.href_matching) || "exact")) && (t == null || !t.tag_name || n.tag_name === (t == null ? void 0 : t.tag_name)) && !(t != null && t.text && !Ye._matchString(n.text || "", t == null ? void 0 : t.text, (t == null ? void 0 : t.text_matching) || "exact") && !Ye._matchString(n.$el_text || "", t == null ? void 0 : t.text, (t == null ? void 0 : t.text_matching) || "exact")))) return !1;
|
|
2959
2959
|
if (t != null && t.selector) {
|
|
2960
2960
|
var i, s = e == null || (i = e.properties) === null || i === void 0 ? void 0 : i.$element_selectors;
|
|
2961
2961
|
if (!s || !s.includes(t == null ? void 0 : t.selector)) return !1;
|
|
@@ -2966,7 +2966,7 @@ class Je {
|
|
|
2966
2966
|
return (e == null ? void 0 : e.properties.$elements) == null ? [] : e == null ? void 0 : e.properties.$elements;
|
|
2967
2967
|
}
|
|
2968
2968
|
}
|
|
2969
|
-
class
|
|
2969
|
+
class xl {
|
|
2970
2970
|
constructor(e) {
|
|
2971
2971
|
this._instance = e, this._eventToSurveys = /* @__PURE__ */ new Map(), this._actionToSurveys = /* @__PURE__ */ new Map();
|
|
2972
2972
|
}
|
|
@@ -2979,7 +2979,7 @@ class wl {
|
|
|
2979
2979
|
var s, n, o, a;
|
|
2980
2980
|
return ((s = i.conditions) === null || s === void 0 ? void 0 : s.actions) && ((n = i.conditions) === null || n === void 0 || (o = n.actions) === null || o === void 0 || (a = o.values) === null || a === void 0 ? void 0 : a.length) > 0;
|
|
2981
2981
|
});
|
|
2982
|
-
t.length !== 0 && (this._actionMatcher == null && (this._actionMatcher = new
|
|
2982
|
+
t.length !== 0 && (this._actionMatcher == null && (this._actionMatcher = new Ye(this._instance), this._actionMatcher.init(), this._actionMatcher._addActionHook((i) => {
|
|
2983
2983
|
this.onAction(i);
|
|
2984
2984
|
})), t.forEach((i) => {
|
|
2985
2985
|
var s, n, o, a, l, c, d, u, h, _;
|
|
@@ -3037,15 +3037,15 @@ class wl {
|
|
|
3037
3037
|
return this._actionMatcher;
|
|
3038
3038
|
}
|
|
3039
3039
|
}
|
|
3040
|
-
class
|
|
3040
|
+
class Cl {
|
|
3041
3041
|
constructor(e) {
|
|
3042
3042
|
w(this, "_isFetchingSurveys", !1), w(this, "_isInitializingSurveys", !1), w(this, "_surveyCallbacks", []), this._instance = e, this._surveyEventReceiver = null;
|
|
3043
3043
|
}
|
|
3044
3044
|
onRemoteConfig(e) {
|
|
3045
3045
|
var t = e.surveys;
|
|
3046
|
-
if (R(t)) return
|
|
3046
|
+
if (R(t)) return Z.warn("Decide not loaded yet. Not loading surveys.");
|
|
3047
3047
|
var i = D(t);
|
|
3048
|
-
this._hasSurveys = i ? t.length > 0 : t,
|
|
3048
|
+
this._hasSurveys = i ? t.length > 0 : t, Z.info("decide response received, hasSurveys: ".concat(this._hasSurveys)), this._hasSurveys && this.loadIfEnabled();
|
|
3049
3049
|
}
|
|
3050
3050
|
reset() {
|
|
3051
3051
|
localStorage.removeItem("lastSeenSurveyDate");
|
|
@@ -3059,8 +3059,8 @@ class Sl {
|
|
|
3059
3059
|
e.forEach((t) => localStorage.removeItem(t));
|
|
3060
3060
|
}
|
|
3061
3061
|
loadIfEnabled() {
|
|
3062
|
-
if (!this._surveyManager) if (this._isInitializingSurveys)
|
|
3063
|
-
else if (this._instance.config.disable_surveys)
|
|
3062
|
+
if (!this._surveyManager) if (this._isInitializingSurveys) Z.info("Already initializing surveys, skipping...");
|
|
3063
|
+
else if (this._instance.config.disable_surveys) Z.info("Disabled. Not loading surveys.");
|
|
3064
3064
|
else if (this._hasSurveys) {
|
|
3065
3065
|
var e = I == null ? void 0 : I.__PosthogExtensions__;
|
|
3066
3066
|
if (e) {
|
|
@@ -3078,14 +3078,14 @@ class Sl {
|
|
|
3078
3078
|
} finally {
|
|
3079
3079
|
this._isInitializingSurveys = !1;
|
|
3080
3080
|
}
|
|
3081
|
-
} else
|
|
3082
|
-
} else
|
|
3081
|
+
} else Z.error("PostHog Extensions not found.");
|
|
3082
|
+
} else Z.info("No surveys to load.");
|
|
3083
3083
|
}
|
|
3084
3084
|
_completeSurveyInitialization(e) {
|
|
3085
|
-
this._surveyManager = e(this._instance), this._surveyEventReceiver = new
|
|
3085
|
+
this._surveyManager = e(this._instance), this._surveyEventReceiver = new xl(this._instance), Z.info("Surveys loaded successfully"), this._notifySurveyCallbacks({ isLoaded: !0 });
|
|
3086
3086
|
}
|
|
3087
3087
|
_handleSurveyLoadError(e, t) {
|
|
3088
|
-
|
|
3088
|
+
Z.error(e, t), this._notifySurveyCallbacks({ isLoaded: !1, error: e });
|
|
3089
3089
|
}
|
|
3090
3090
|
onSurveysLoaded(e) {
|
|
3091
3091
|
return this._surveyCallbacks.push(e), this._surveyManager && this._notifySurveyCallbacks({ isLoaded: !0 }), () => {
|
|
@@ -3094,8 +3094,8 @@ class Sl {
|
|
|
3094
3094
|
}
|
|
3095
3095
|
getSurveys(e) {
|
|
3096
3096
|
var t = arguments.length > 1 && arguments[1] !== void 0 && arguments[1];
|
|
3097
|
-
if (this._instance.config.disable_surveys) return
|
|
3098
|
-
var i = this._instance.get_property(
|
|
3097
|
+
if (this._instance.config.disable_surveys) return Z.info("Disabled. Not loading surveys."), e([]);
|
|
3098
|
+
var i = this._instance.get_property(Gi);
|
|
3099
3099
|
if (i && !t) return e(i, { isLoaded: !0 });
|
|
3100
3100
|
if (this._isFetchingSurveys) return e([], { isLoaded: !1, error: "Surveys are already being loaded" });
|
|
3101
3101
|
try {
|
|
@@ -3105,13 +3105,13 @@ class Sl {
|
|
|
3105
3105
|
var o = s.statusCode;
|
|
3106
3106
|
if (o !== 200 || !s.json) {
|
|
3107
3107
|
var a = "Surveys API could not be loaded, status: ".concat(o);
|
|
3108
|
-
return
|
|
3108
|
+
return Z.error(a), e([], { isLoaded: !1, error: a });
|
|
3109
3109
|
}
|
|
3110
3110
|
var l, c = s.json.surveys || [], d = c.filter((u) => {
|
|
3111
|
-
var h, _, p, v, b, y, m, E, C,
|
|
3112
|
-
return ((h = u.conditions) === null || h === void 0 ? void 0 : h.events) && ((_ = u.conditions) === null || _ === void 0 || (p = _.events) === null || p === void 0 ? void 0 : p.values) && ((v = u.conditions) === null || v === void 0 || (b = v.events) === null || b === void 0 || (y = b.values) === null || y === void 0 ? void 0 : y.length) > 0 || ((m = u.conditions) === null || m === void 0 ? void 0 : m.actions) && ((E = u.conditions) === null || E === void 0 || (C = E.actions) === null || C === void 0 ? void 0 : C.values) && ((
|
|
3111
|
+
var h, _, p, v, b, y, m, E, C, T, O, L;
|
|
3112
|
+
return ((h = u.conditions) === null || h === void 0 ? void 0 : h.events) && ((_ = u.conditions) === null || _ === void 0 || (p = _.events) === null || p === void 0 ? void 0 : p.values) && ((v = u.conditions) === null || v === void 0 || (b = v.events) === null || b === void 0 || (y = b.values) === null || y === void 0 ? void 0 : y.length) > 0 || ((m = u.conditions) === null || m === void 0 ? void 0 : m.actions) && ((E = u.conditions) === null || E === void 0 || (C = E.actions) === null || C === void 0 ? void 0 : C.values) && ((T = u.conditions) === null || T === void 0 || (O = T.actions) === null || O === void 0 || (L = O.values) === null || L === void 0 ? void 0 : L.length) > 0;
|
|
3113
3113
|
});
|
|
3114
|
-
return d.length > 0 && ((l = this._surveyEventReceiver) === null || l === void 0 || l.register(d)), (n = this._instance.persistence) === null || n === void 0 || n.register({ [
|
|
3114
|
+
return d.length > 0 && ((l = this._surveyEventReceiver) === null || l === void 0 || l.register(d)), (n = this._instance.persistence) === null || n === void 0 || n.register({ [Gi]: c }), e(c, { isLoaded: !0 });
|
|
3115
3115
|
} });
|
|
3116
3116
|
} catch (s) {
|
|
3117
3117
|
throw this._isFetchingSurveys = !1, s;
|
|
@@ -3121,7 +3121,7 @@ class Sl {
|
|
|
3121
3121
|
for (var t of this._surveyCallbacks) try {
|
|
3122
3122
|
e.isLoaded ? this.getSurveys(t) : t([], e);
|
|
3123
3123
|
} catch (i) {
|
|
3124
|
-
|
|
3124
|
+
Z.error("Error in survey callback", i);
|
|
3125
3125
|
}
|
|
3126
3126
|
}
|
|
3127
3127
|
_isSurveyFeatureFlagEnabled(e) {
|
|
@@ -3151,7 +3151,7 @@ class Sl {
|
|
|
3151
3151
|
}), o = (s = this._surveyEventReceiver) === null || s === void 0 ? void 0 : s.getSurveys(), a = n.filter((l) => {
|
|
3152
3152
|
var c, d, u, h, _, p, v, b, y;
|
|
3153
3153
|
if (!(l.linked_flag_key || l.targeting_flag_key || l.internal_targeting_flag_key || (c = l.feature_flag_keys) !== null && c !== void 0 && c.length)) return !0;
|
|
3154
|
-
var m = this._isSurveyFeatureFlagEnabled(l.linked_flag_key), E = this._isSurveyFeatureFlagEnabled(l.targeting_flag_key), C = ((d = (u = l.conditions) === null || u === void 0 || (h = u.events) === null || h === void 0 || (_ = h.values) === null || _ === void 0 ? void 0 : _.length) !== null && d !== void 0 ? d : 0) > 0,
|
|
3154
|
+
var m = this._isSurveyFeatureFlagEnabled(l.linked_flag_key), E = this._isSurveyFeatureFlagEnabled(l.targeting_flag_key), C = ((d = (u = l.conditions) === null || u === void 0 || (h = u.events) === null || h === void 0 || (_ = h.values) === null || _ === void 0 ? void 0 : _.length) !== null && d !== void 0 ? d : 0) > 0, T = ((p = (v = l.conditions) === null || v === void 0 || (b = v.actions) === null || b === void 0 || (y = b.values) === null || y === void 0 ? void 0 : y.length) !== null && p !== void 0 ? p : 0) > 0, O = !C && !T || (o == null ? void 0 : o.includes(l.id)), L = this._canActivateRepeatedly(l) || this._isSurveyFeatureFlagEnabled(l.internal_targeting_flag_key), P = this.checkFlags(l);
|
|
3155
3155
|
return m && E && L && O && P;
|
|
3156
3156
|
});
|
|
3157
3157
|
return e(a);
|
|
@@ -3166,10 +3166,10 @@ class Sl {
|
|
|
3166
3166
|
}
|
|
3167
3167
|
_canActivateRepeatedly(e) {
|
|
3168
3168
|
var t;
|
|
3169
|
-
return R((t = I.__PosthogExtensions__) === null || t === void 0 ? void 0 : t.canActivateRepeatedly) ? (
|
|
3169
|
+
return R((t = I.__PosthogExtensions__) === null || t === void 0 ? void 0 : t.canActivateRepeatedly) ? (Z.warn("init was not called"), !1) : I.__PosthogExtensions__.canActivateRepeatedly(e);
|
|
3170
3170
|
}
|
|
3171
3171
|
canRenderSurvey(e) {
|
|
3172
|
-
if (R(this._surveyManager)) return
|
|
3172
|
+
if (R(this._surveyManager)) return Z.warn("init was not called"), { visible: !1, disabledReason: "SDK is not enabled or survey functionality is not yet loaded" };
|
|
3173
3173
|
var t = null;
|
|
3174
3174
|
return this.getSurveys((i) => {
|
|
3175
3175
|
var s = i.filter((n) => n.id === e)[0];
|
|
@@ -3177,7 +3177,7 @@ class Sl {
|
|
|
3177
3177
|
}), t;
|
|
3178
3178
|
}
|
|
3179
3179
|
canRenderSurveyAsync(e, t) {
|
|
3180
|
-
return R(this._surveyManager) ? (
|
|
3180
|
+
return R(this._surveyManager) ? (Z.warn("init was not called"), Promise.resolve({ visible: !1, disabledReason: "SDK is not enabled or survey functionality is not yet loaded" })) : new Promise((i) => {
|
|
3181
3181
|
this.getSurveys((s) => {
|
|
3182
3182
|
var n = s.filter((o) => o.id === e)[0];
|
|
3183
3183
|
i(n ? f({}, this._surveyManager.canRenderSurvey(n)) : { visible: !1, disabledReason: "Survey not found" });
|
|
@@ -3185,14 +3185,14 @@ class Sl {
|
|
|
3185
3185
|
});
|
|
3186
3186
|
}
|
|
3187
3187
|
renderSurvey(e, t) {
|
|
3188
|
-
R(this._surveyManager) ?
|
|
3188
|
+
R(this._surveyManager) ? Z.warn("init was not called") : this.getSurveys((i) => {
|
|
3189
3189
|
var s = i.filter((n) => n.id === e)[0];
|
|
3190
3190
|
this._surveyManager.renderSurvey(s, k == null ? void 0 : k.querySelector(t));
|
|
3191
3191
|
});
|
|
3192
3192
|
}
|
|
3193
3193
|
}
|
|
3194
|
-
var Hs =
|
|
3195
|
-
class
|
|
3194
|
+
var Hs = Q("[RateLimiter]");
|
|
3195
|
+
class Il {
|
|
3196
3196
|
constructor(e) {
|
|
3197
3197
|
var t, i;
|
|
3198
3198
|
w(this, "serverLimits", {}), w(this, "lastEventRateLimited", !1), w(this, "checkForLimiting", (s) => {
|
|
@@ -3207,18 +3207,18 @@ class kl {
|
|
|
3207
3207
|
}), this.instance = e, this.captureEventsPerSecond = ((t = e.config.rate_limiting) === null || t === void 0 ? void 0 : t.events_per_second) || 10, this.captureEventsBurstLimit = Math.max(((i = e.config.rate_limiting) === null || i === void 0 ? void 0 : i.events_burst_limit) || 10 * this.captureEventsPerSecond, this.captureEventsPerSecond), this.lastEventRateLimited = this.clientRateLimitContext(!0).isRateLimited;
|
|
3208
3208
|
}
|
|
3209
3209
|
clientRateLimitContext() {
|
|
3210
|
-
var e, t, i, s = arguments.length > 0 && arguments[0] !== void 0 && arguments[0], n = (/* @__PURE__ */ new Date()).getTime(), o = (e = (t = this.instance.persistence) === null || t === void 0 ? void 0 : t.get_property(
|
|
3210
|
+
var e, t, i, s = arguments.length > 0 && arguments[0] !== void 0 && arguments[0], n = (/* @__PURE__ */ new Date()).getTime(), o = (e = (t = this.instance.persistence) === null || t === void 0 ? void 0 : t.get_property(Ki)) !== null && e !== void 0 ? e : { tokens: this.captureEventsBurstLimit, last: n };
|
|
3211
3211
|
o.tokens += (n - o.last) / 1e3 * this.captureEventsPerSecond, o.last = n, o.tokens > this.captureEventsBurstLimit && (o.tokens = this.captureEventsBurstLimit);
|
|
3212
3212
|
var a = o.tokens < 1;
|
|
3213
|
-
return a || s || (o.tokens = Math.max(0, o.tokens - 1)), !a || this.lastEventRateLimited || s || this.instance.capture("$$client_ingestion_warning", { $$client_ingestion_warning_message: "posthog-js client rate limited. Config is set to ".concat(this.captureEventsPerSecond, " events per second and ").concat(this.captureEventsBurstLimit, " events burst limit.") }, { skip_client_rate_limiting: !0 }), this.lastEventRateLimited = a, (i = this.instance.persistence) === null || i === void 0 || i.set_property(
|
|
3213
|
+
return a || s || (o.tokens = Math.max(0, o.tokens - 1)), !a || this.lastEventRateLimited || s || this.instance.capture("$$client_ingestion_warning", { $$client_ingestion_warning_message: "posthog-js client rate limited. Config is set to ".concat(this.captureEventsPerSecond, " events per second and ").concat(this.captureEventsBurstLimit, " events burst limit.") }, { skip_client_rate_limiting: !0 }), this.lastEventRateLimited = a, (i = this.instance.persistence) === null || i === void 0 || i.set_property(Ki, o), { isRateLimited: a, remainingTokens: o.tokens };
|
|
3214
3214
|
}
|
|
3215
3215
|
isServerRateLimited(e) {
|
|
3216
3216
|
var t = this.serverLimits[e || "events"] || !1;
|
|
3217
3217
|
return t !== !1 && (/* @__PURE__ */ new Date()).getTime() < t;
|
|
3218
3218
|
}
|
|
3219
3219
|
}
|
|
3220
|
-
var
|
|
3221
|
-
class
|
|
3220
|
+
var Ge = Q("[RemoteConfig]");
|
|
3221
|
+
class Pl {
|
|
3222
3222
|
constructor(e) {
|
|
3223
3223
|
this._instance = e;
|
|
3224
3224
|
}
|
|
@@ -3228,7 +3228,7 @@ class El {
|
|
|
3228
3228
|
}
|
|
3229
3229
|
_loadRemoteConfigJs(e) {
|
|
3230
3230
|
var t, i, s;
|
|
3231
|
-
(t = I.__PosthogExtensions__) !== null && t !== void 0 && t.loadExternalDependency ? (i = I.__PosthogExtensions__) === null || i === void 0 || (s = i.loadExternalDependency) === null || s === void 0 || s.call(i, this._instance, "remote-config", () => e(this.remoteConfig)) : (
|
|
3231
|
+
(t = I.__PosthogExtensions__) !== null && t !== void 0 && t.loadExternalDependency ? (i = I.__PosthogExtensions__) === null || i === void 0 || (s = i.loadExternalDependency) === null || s === void 0 || s.call(i, this._instance, "remote-config", () => e(this.remoteConfig)) : (Ge.error("PostHog Extensions not found. Cannot load remote config."), e());
|
|
3232
3232
|
}
|
|
3233
3233
|
_loadRemoteConfigJSON(e) {
|
|
3234
3234
|
this._instance._send_request({ method: "GET", url: this._instance.requestRouter.endpointFor("assets", "/array/".concat(this._instance.config.token, "/config")), callback: (t) => {
|
|
@@ -3237,51 +3237,51 @@ class El {
|
|
|
3237
3237
|
}
|
|
3238
3238
|
load() {
|
|
3239
3239
|
try {
|
|
3240
|
-
if (this.remoteConfig) return
|
|
3241
|
-
if (this._instance.config.advanced_disable_decide) return void
|
|
3240
|
+
if (this.remoteConfig) return Ge.info("Using preloaded remote config", this.remoteConfig), void this._onRemoteConfig(this.remoteConfig);
|
|
3241
|
+
if (this._instance.config.advanced_disable_decide) return void Ge.warn("Remote config is disabled. Falling back to local config.");
|
|
3242
3242
|
this._loadRemoteConfigJs((e) => {
|
|
3243
|
-
if (!e) return
|
|
3243
|
+
if (!e) return Ge.info("No config found after loading remote JS config. Falling back to JSON."), void this._loadRemoteConfigJSON((t) => {
|
|
3244
3244
|
this._onRemoteConfig(t);
|
|
3245
3245
|
});
|
|
3246
3246
|
this._onRemoteConfig(e);
|
|
3247
3247
|
});
|
|
3248
3248
|
} catch (e) {
|
|
3249
|
-
|
|
3249
|
+
Ge.error("Error loading remote config", e);
|
|
3250
3250
|
}
|
|
3251
3251
|
}
|
|
3252
3252
|
_onRemoteConfig(e) {
|
|
3253
|
-
e ? this._instance.config.__preview_remote_config ? (this._instance._onRemoteConfig(e), e.hasFeatureFlags !== !1 && this._instance.featureFlags.ensureFlagsLoaded()) :
|
|
3253
|
+
e ? this._instance.config.__preview_remote_config ? (this._instance._onRemoteConfig(e), e.hasFeatureFlags !== !1 && this._instance.featureFlags.ensureFlagsLoaded()) : Ge.info("__preview_remote_config is disabled. Logging config instead", e) : Ge.error("Failed to fetch remote config from PostHog.");
|
|
3254
3254
|
}
|
|
3255
3255
|
}
|
|
3256
|
-
var
|
|
3256
|
+
var Tl = function(r) {
|
|
3257
3257
|
var e, t, i, s, n = "";
|
|
3258
3258
|
for (e = t = 0, i = (r = (r + "").replace(/\r\n/g, `
|
|
3259
3259
|
`).replace(/\r/g, `
|
|
3260
3260
|
`)).length, s = 0; s < i; s++) {
|
|
3261
3261
|
var o = r.charCodeAt(s), a = null;
|
|
3262
|
-
o < 128 ? t++ : a = o > 127 && o < 2048 ? String.fromCharCode(o >> 6 | 192, 63 & o | 128) : String.fromCharCode(o >> 12 | 224, o >> 6 & 63 | 128, 63 & o | 128),
|
|
3262
|
+
o < 128 ? t++ : a = o > 127 && o < 2048 ? String.fromCharCode(o >> 6 | 192, 63 & o | 128) : String.fromCharCode(o >> 12 | 224, o >> 6 & 63 | 128, 63 & o | 128), je(a) || (t > e && (n += r.substring(e, t)), n += a, e = t = s + 1);
|
|
3263
3263
|
}
|
|
3264
3264
|
return t > e && (n += r.substring(e, r.length)), n;
|
|
3265
|
-
},
|
|
3265
|
+
}, Fl = !!Hi || !!Bi, js = "text/plain", ci = (r, e) => {
|
|
3266
3266
|
var [t, i] = r.split("?"), s = f({}, e);
|
|
3267
3267
|
i == null || i.split("&").forEach((o) => {
|
|
3268
3268
|
var [a] = o.split("=");
|
|
3269
3269
|
delete s[a];
|
|
3270
3270
|
});
|
|
3271
|
-
var n =
|
|
3271
|
+
var n = Xo(s);
|
|
3272
3272
|
return n = n ? (i ? i + "&" : "") + n : i, "".concat(t, "?").concat(n);
|
|
3273
|
-
},
|
|
3273
|
+
}, It = (r, e) => JSON.stringify(r, (t, i) => typeof i == "bigint" ? i.toString() : i, e), qi = (r) => {
|
|
3274
3274
|
var { data: e, compression: t } = r;
|
|
3275
3275
|
if (e) {
|
|
3276
|
-
if (t ===
|
|
3277
|
-
var i = $n(On(
|
|
3276
|
+
if (t === ge.GZipJS) {
|
|
3277
|
+
var i = $n(On(It(e)), { mtime: 0 }), s = new Blob([i], { type: js });
|
|
3278
3278
|
return { contentType: js, body: s, estimatedSize: s.size };
|
|
3279
3279
|
}
|
|
3280
|
-
if (t ===
|
|
3280
|
+
if (t === ge.Base64) {
|
|
3281
3281
|
var n = function(l) {
|
|
3282
3282
|
var c, d, u, h, _, p = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=", v = 0, b = 0, y = "", m = [];
|
|
3283
3283
|
if (!l) return l;
|
|
3284
|
-
l =
|
|
3284
|
+
l = Tl(l);
|
|
3285
3285
|
do
|
|
3286
3286
|
c = (_ = l.charCodeAt(v++) << 16 | l.charCodeAt(v++) << 8 | l.charCodeAt(v++)) >> 18 & 63, d = _ >> 12 & 63, u = _ >> 6 & 63, h = 63 & _, m[b++] = p.charAt(c) + p.charAt(d) + p.charAt(u) + p.charAt(h);
|
|
3287
3287
|
while (v < l.length);
|
|
@@ -3293,15 +3293,15 @@ var xl = function(r) {
|
|
|
3293
3293
|
y = y.slice(0, -1) + "=";
|
|
3294
3294
|
}
|
|
3295
3295
|
return y;
|
|
3296
|
-
}(
|
|
3296
|
+
}(It(e)), o = ((l) => "data=" + encodeURIComponent(typeof l == "string" ? l : It(l)))(n);
|
|
3297
3297
|
return { contentType: "application/x-www-form-urlencoded", body: o, estimatedSize: new Blob([o]).size };
|
|
3298
3298
|
}
|
|
3299
|
-
var a =
|
|
3299
|
+
var a = It(e);
|
|
3300
3300
|
return { contentType: "application/json", body: a, estimatedSize: new Blob([a]).size };
|
|
3301
3301
|
}
|
|
3302
|
-
},
|
|
3303
|
-
|
|
3304
|
-
var e, t, { contentType: i, body: s, estimatedSize: n } = (e =
|
|
3302
|
+
}, Tt = [];
|
|
3303
|
+
Bi && Tt.push({ transport: "fetch", method: (r) => {
|
|
3304
|
+
var e, t, { contentType: i, body: s, estimatedSize: n } = (e = qi(r)) !== null && e !== void 0 ? e : {}, o = new Headers();
|
|
3305
3305
|
$(r.headers, function(d, u) {
|
|
3306
3306
|
o.append(u, d);
|
|
3307
3307
|
}), i && o.append("Content-Type", i);
|
|
@@ -3310,7 +3310,7 @@ qi && Pt.push({ transport: "fetch", method: (r) => {
|
|
|
3310
3310
|
var c = new Nr();
|
|
3311
3311
|
l = { signal: c.signal, timeout: setTimeout(() => c.abort(), r.timeout) };
|
|
3312
3312
|
}
|
|
3313
|
-
|
|
3313
|
+
Bi(a, f({ method: (r == null ? void 0 : r.method) || "GET", headers: o, keepalive: r.method === "POST" && (n || 0) < 52428.8, body: s, signal: (t = l) === null || t === void 0 ? void 0 : t.signal }, r.fetchOptions)).then((d) => d.text().then((u) => {
|
|
3314
3314
|
var h, _ = { statusCode: d.status, text: u };
|
|
3315
3315
|
if (d.status === 200) try {
|
|
3316
3316
|
_.json = JSON.parse(u);
|
|
@@ -3322,10 +3322,10 @@ qi && Pt.push({ transport: "fetch", method: (r) => {
|
|
|
3322
3322
|
var u;
|
|
3323
3323
|
x.error(d), (u = r.callback) === null || u === void 0 || u.call(r, { statusCode: 0, text: d });
|
|
3324
3324
|
}).finally(() => l ? clearTimeout(l.timeout) : null);
|
|
3325
|
-
} }),
|
|
3326
|
-
var e, t = new
|
|
3325
|
+
} }), Hi && Tt.push({ transport: "XHR", method: (r) => {
|
|
3326
|
+
var e, t = new Hi();
|
|
3327
3327
|
t.open(r.method || "GET", r.url, !0);
|
|
3328
|
-
var { contentType: i, body: s } = (e =
|
|
3328
|
+
var { contentType: i, body: s } = (e = qi(r)) !== null && e !== void 0 ? e : {};
|
|
3329
3329
|
$(r.headers, function(n, o) {
|
|
3330
3330
|
t.setRequestHeader(o, n);
|
|
3331
3331
|
}), i && t.setRequestHeader("Content-Type", i), r.timeout && (t.timeout = r.timeout), t.withCredentials = !0, t.onreadystatechange = () => {
|
|
@@ -3338,18 +3338,18 @@ qi && Pt.push({ transport: "fetch", method: (r) => {
|
|
|
3338
3338
|
(n = r.callback) === null || n === void 0 || n.call(r, o);
|
|
3339
3339
|
}
|
|
3340
3340
|
}, t.send(s);
|
|
3341
|
-
} }), ne != null && ne.sendBeacon &&
|
|
3342
|
-
var e =
|
|
3341
|
+
} }), ne != null && ne.sendBeacon && Tt.push({ transport: "sendBeacon", method: (r) => {
|
|
3342
|
+
var e = ci(r.url, { beacon: "1" });
|
|
3343
3343
|
try {
|
|
3344
|
-
var t, { contentType: i, body: s } = (t =
|
|
3344
|
+
var t, { contentType: i, body: s } = (t = qi(r)) !== null && t !== void 0 ? t : {}, n = typeof s == "string" ? new Blob([s], { type: i }) : s;
|
|
3345
3345
|
ne.sendBeacon(e, n);
|
|
3346
3346
|
} catch {
|
|
3347
3347
|
}
|
|
3348
3348
|
} });
|
|
3349
|
-
var
|
|
3350
|
-
class
|
|
3349
|
+
var fr = 3e3;
|
|
3350
|
+
class Rl {
|
|
3351
3351
|
constructor(e, t) {
|
|
3352
|
-
w(this, "_isPaused", !0), w(this, "_queue", []), this._flushTimeoutMs = le((t == null ? void 0 : t.flush_interval_ms) ||
|
|
3352
|
+
w(this, "_isPaused", !0), w(this, "_queue", []), this._flushTimeoutMs = le((t == null ? void 0 : t.flush_interval_ms) || fr, 250, 5e3, "flush interval", fr), this._sendRequest = e;
|
|
3353
3353
|
}
|
|
3354
3354
|
enqueue(e) {
|
|
3355
3355
|
this._queue.push(e), this._flushTimeout || this._setFlushTimeout();
|
|
@@ -3389,8 +3389,8 @@ class Il {
|
|
|
3389
3389
|
}), this._queue = [], e;
|
|
3390
3390
|
}
|
|
3391
3391
|
}
|
|
3392
|
-
var
|
|
3393
|
-
class
|
|
3392
|
+
var $l = ["retriesPerformedSoFar"];
|
|
3393
|
+
class Ol {
|
|
3394
3394
|
constructor(e) {
|
|
3395
3395
|
w(this, "_isPolling", !1), w(this, "_pollIntervalMs", 3e3), w(this, "_queue", []), this._instance = e, this._queue = [], this._areWeOnline = !0, !S(g) && "onLine" in g.navigator && (this._areWeOnline = g.navigator.onLine, N(g, "online", () => {
|
|
3396
3396
|
this._areWeOnline = !0, this._flush();
|
|
@@ -3402,8 +3402,8 @@ class Fl {
|
|
|
3402
3402
|
return this._queue.length;
|
|
3403
3403
|
}
|
|
3404
3404
|
retriableRequest(e) {
|
|
3405
|
-
var { retriesPerformedSoFar: t } = e, i = nn(e,
|
|
3406
|
-
|
|
3405
|
+
var { retriesPerformedSoFar: t } = e, i = nn(e, $l);
|
|
3406
|
+
Y(t) && t > 0 && (i.url = ci(i.url, { retry_count: t })), this._instance._send_request(f(f({}, i), {}, { callback: (s) => {
|
|
3407
3407
|
var n;
|
|
3408
3408
|
s.statusCode !== 200 && (s.statusCode < 400 || s.statusCode >= 500) && (t ?? 0) < 10 ? this._enqueue(f({ retriesPerformedSoFar: t }, i)) : (n = i.callback) === null || n === void 0 || n.call(i, s);
|
|
3409
3409
|
} }));
|
|
@@ -3437,7 +3437,7 @@ class Fl {
|
|
|
3437
3437
|
this._queue = [];
|
|
3438
3438
|
}
|
|
3439
3439
|
}
|
|
3440
|
-
class
|
|
3440
|
+
class Ll {
|
|
3441
3441
|
constructor(e) {
|
|
3442
3442
|
w(this, "_updateScrollData", () => {
|
|
3443
3443
|
var t, i, s, n;
|
|
@@ -3479,19 +3479,19 @@ class Tl {
|
|
|
3479
3479
|
return g && (g.scrollX || g.pageXOffset || g.document.documentElement.scrollLeft) || 0;
|
|
3480
3480
|
}
|
|
3481
3481
|
}
|
|
3482
|
-
var
|
|
3483
|
-
class
|
|
3482
|
+
var Al = (r) => so(r == null ? void 0 : r.config.mask_personal_data_properties, r == null ? void 0 : r.config.custom_personal_data_properties);
|
|
3483
|
+
class Ml {
|
|
3484
3484
|
constructor(e, t, i, s) {
|
|
3485
3485
|
w(this, "_onSessionIdCallback", (n) => {
|
|
3486
3486
|
var o = this._getStored();
|
|
3487
3487
|
if (!o || o.sessionId !== n) {
|
|
3488
3488
|
var a = { sessionId: n, props: this._sessionSourceParamGenerator(this._instance) };
|
|
3489
|
-
this._persistence.register({ [
|
|
3489
|
+
this._persistence.register({ [Ji]: a });
|
|
3490
3490
|
}
|
|
3491
|
-
}), this._instance = e, this._sessionIdManager = t, this._persistence = i, this._sessionSourceParamGenerator = s ||
|
|
3491
|
+
}), this._instance = e, this._sessionIdManager = t, this._persistence = i, this._sessionSourceParamGenerator = s || Al, this._sessionIdManager.onSessionId(this._onSessionIdCallback);
|
|
3492
3492
|
}
|
|
3493
3493
|
_getStored() {
|
|
3494
|
-
return this._persistence.props[
|
|
3494
|
+
return this._persistence.props[Ji];
|
|
3495
3495
|
}
|
|
3496
3496
|
getSetOnceProps() {
|
|
3497
3497
|
var e, t = (e = this._getStored()) === null || e === void 0 ? void 0 : e.props;
|
|
@@ -3499,13 +3499,13 @@ class $l {
|
|
|
3499
3499
|
}
|
|
3500
3500
|
getSessionProps() {
|
|
3501
3501
|
var e = {};
|
|
3502
|
-
return $(
|
|
3503
|
-
i === "$current_url" && (i = "url"), e["$session_entry_".concat(
|
|
3502
|
+
return $(Xt(this.getSetOnceProps()), (t, i) => {
|
|
3503
|
+
i === "$current_url" && (i = "url"), e["$session_entry_".concat(ji(i))] = t;
|
|
3504
3504
|
}), e;
|
|
3505
3505
|
}
|
|
3506
3506
|
}
|
|
3507
|
-
var Us =
|
|
3508
|
-
class
|
|
3507
|
+
var Us = Q("[SessionId]");
|
|
3508
|
+
class Dl {
|
|
3509
3509
|
constructor(e, t, i) {
|
|
3510
3510
|
var s;
|
|
3511
3511
|
if (w(this, "_sessionIdChangedHandlers", []), !e.persistence) throw new Error("SessionIdManager requires a PostHogPersistence instance");
|
|
@@ -3547,11 +3547,11 @@ class Ol {
|
|
|
3547
3547
|
return this._windowId ? this._windowId : this._canUseSessionStorage() ? W.parse(this._window_id_storage_key) : null;
|
|
3548
3548
|
}
|
|
3549
3549
|
_setSessionId(e, t, i) {
|
|
3550
|
-
e === this._sessionId && t === this._sessionActivityTimestamp && i === this._sessionStartTimestamp || (this._sessionStartTimestamp = i, this._sessionActivityTimestamp = t, this._sessionId = e, this._persistence.register({ [
|
|
3550
|
+
e === this._sessionId && t === this._sessionActivityTimestamp && i === this._sessionStartTimestamp || (this._sessionStartTimestamp = i, this._sessionActivityTimestamp = t, this._sessionId = e, this._persistence.register({ [Zt]: [t, e, i] }));
|
|
3551
3551
|
}
|
|
3552
3552
|
_getSessionId() {
|
|
3553
3553
|
if (this._sessionId && this._sessionActivityTimestamp && this._sessionStartTimestamp) return [this._sessionActivityTimestamp, this._sessionId, this._sessionStartTimestamp];
|
|
3554
|
-
var e = this._persistence.props[
|
|
3554
|
+
var e = this._persistence.props[Zt];
|
|
3555
3555
|
return D(e) && e.length === 2 && e.push(e[0]), e || [0, null, 0];
|
|
3556
3556
|
}
|
|
3557
3557
|
resetSessionId() {
|
|
@@ -3565,7 +3565,7 @@ class Ol {
|
|
|
3565
3565
|
checkAndGetSessionAndWindowId() {
|
|
3566
3566
|
var e = arguments.length > 0 && arguments[0] !== void 0 && arguments[0], t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : null;
|
|
3567
3567
|
if (this._config.__preview_experimental_cookieless_mode) throw new Error("checkAndGetSessionAndWindowId should not be called in __preview_experimental_cookieless_mode");
|
|
3568
|
-
var i = t || (/* @__PURE__ */ new Date()).getTime(), [s, n, o] = this._getSessionId(), a = this._getWindowId(), l =
|
|
3568
|
+
var i = t || (/* @__PURE__ */ new Date()).getTime(), [s, n, o] = this._getSessionId(), a = this._getWindowId(), l = Y(o) && o > 0 && Math.abs(i - o) > 864e5, c = !1, d = !n, u = !e && Math.abs(i - s) > this.sessionTimeoutMs;
|
|
3569
3569
|
d || u || l ? (n = this._sessionIdGenerator(), a = this._windowIdGenerator(), Us.info("new session ID generated", { sessionId: n, windowId: a, changeReason: { noSessionId: d, activityTimeout: u, sessionPastMaximumLength: l } }), o = i, c = !0) : a || (a = this._windowIdGenerator(), c = !0);
|
|
3570
3570
|
var h = s === 0 || !e || l ? i : s, _ = o === 0 ? (/* @__PURE__ */ new Date()).getTime() : o;
|
|
3571
3571
|
return this._setWindowId(a), this._setSessionId(n, h, _), e || this._resetIdleTimer(), c && this._sessionIdChangedHandlers.forEach((p) => p(n, a, c ? { noSessionId: d, activityTimeout: u, sessionPastMaximumLength: l } : void 0)), { sessionId: n, windowId: a, sessionStartTimestamp: _, changeReason: c ? { noSessionId: d, activityTimeout: u, sessionPastMaximumLength: l } : void 0, lastActivityTimestamp: s };
|
|
@@ -3576,8 +3576,8 @@ class Ol {
|
|
|
3576
3576
|
}, 1.1 * this.sessionTimeoutMs);
|
|
3577
3577
|
}
|
|
3578
3578
|
}
|
|
3579
|
-
var
|
|
3580
|
-
class
|
|
3579
|
+
var ql = ["$set_once", "$set"], Le = Q("[SiteApps]");
|
|
3580
|
+
class Nl {
|
|
3581
3581
|
constructor(e) {
|
|
3582
3582
|
this._instance = e, this._bufferedInvocations = [], this.apps = {};
|
|
3583
3583
|
}
|
|
@@ -3608,7 +3608,7 @@ class Al {
|
|
|
3608
3608
|
var c = {}, d = this._instance.get_property("$groups") || [], u = this._instance.get_property("$stored_group_properties") || {};
|
|
3609
3609
|
for (var [h, _] of Object.entries(u)) c[h] = { id: d[h], type: h, properties: _ };
|
|
3610
3610
|
var { $set_once: p, $set: v } = e;
|
|
3611
|
-
return { event: f(f({}, nn(e,
|
|
3611
|
+
return { event: f(f({}, nn(e, ql)), {}, { properties: f(f(f({}, e.properties), v ? { $set: f(f({}, (t = (i = e.properties) === null || i === void 0 ? void 0 : i.$set) !== null && t !== void 0 ? t : {}), v) } : {}), p ? { $set_once: f(f({}, (s = (n = e.properties) === null || n === void 0 ? void 0 : n.$set_once) !== null && s !== void 0 ? s : {}), p) } : {}), elements_chain: (o = (a = e.properties) === null || a === void 0 ? void 0 : a.$elements_chain) !== null && o !== void 0 ? o : "", distinct_id: (l = e.properties) === null || l === void 0 ? void 0 : l.distinct_id }), person: { properties: this._instance.get_property("$stored_person_properties") }, groups: c };
|
|
3612
3612
|
}
|
|
3613
3613
|
setupSiteApp(e) {
|
|
3614
3614
|
var t = this.apps[e.id], i = () => {
|
|
@@ -3664,10 +3664,10 @@ class Al {
|
|
|
3664
3664
|
} else Le.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');
|
|
3665
3665
|
}
|
|
3666
3666
|
}
|
|
3667
|
-
var
|
|
3667
|
+
var Qe, Bl = ["amazonbot", "amazonproductbot", "app.hypefactors.com", "applebot", "archive.org_bot", "awariobot", "backlinksextendedbot", "baiduspider", "bingbot", "bingpreview", "chrome-lighthouse", "dataforseobot", "deepscan", "duckduckbot", "facebookexternal", "facebookcatalog", "http://yandex.com/bots", "hubspot", "ia_archiver", "linkedinbot", "meta-externalagent", "mj12bot", "msnbot", "nessus", "petalbot", "pinterest", "prerender", "rogerbot", "screaming frog", "sebot-wa", "sitebulb", "slackbot", "slurp", "trendictionbot", "turnitin", "twitterbot", "vercelbot", "yahoo! slurp", "yandexbot", "zoombot", "bot.htm", "bot.php", "(bot;", "bot/", "crawler", "ahrefsbot", "ahrefssiteaudit", "semrushbot", "siteauditbot", "splitsignalbot", "gptbot", "oai-searchbot", "chatgpt-user", "perplexitybot", "better uptime bot", "sentryuptimebot", "uptimerobot", "headlesschrome", "cypress", "google-hoteladsverifier", "adsbot-google", "apis-google", "duplexweb-google", "feedfetcher-google", "google favicon", "google web preview", "google-read-aloud", "googlebot", "googleweblight", "mediapartners-google", "storebot-google", "bytespider"], zs = function(r, e) {
|
|
3668
3668
|
if (!r) return !1;
|
|
3669
3669
|
var t = r.toLowerCase();
|
|
3670
|
-
return
|
|
3670
|
+
return Bl.concat(e || []).some((i) => {
|
|
3671
3671
|
var s = i.toLowerCase();
|
|
3672
3672
|
return t.indexOf(s) !== -1;
|
|
3673
3673
|
});
|
|
@@ -3683,13 +3683,13 @@ var Ke, Ml = ["amazonbot", "amazonproductbot", "app.hypefactors.com", "applebot"
|
|
|
3683
3683
|
return !!r.webdriver;
|
|
3684
3684
|
};
|
|
3685
3685
|
function Ws(r, e, t) {
|
|
3686
|
-
return
|
|
3686
|
+
return It({ distinct_id: r, userPropertiesToSet: e, userPropertiesToSetOnce: t });
|
|
3687
3687
|
}
|
|
3688
3688
|
(function(r) {
|
|
3689
3689
|
r.US = "us", r.EU = "eu", r.CUSTOM = "custom";
|
|
3690
|
-
})(
|
|
3690
|
+
})(Qe || (Qe = {}));
|
|
3691
3691
|
var Vs = "i.posthog.com";
|
|
3692
|
-
class
|
|
3692
|
+
class Hl {
|
|
3693
3693
|
constructor(e) {
|
|
3694
3694
|
w(this, "_regionCache", {}), this.instance = e;
|
|
3695
3695
|
}
|
|
@@ -3702,12 +3702,12 @@ class Dl {
|
|
|
3702
3702
|
return t || (t = this.apiHost.replace(".".concat(Vs), ".posthog.com")), t === "https://app.posthog.com" ? "https://us.posthog.com" : t;
|
|
3703
3703
|
}
|
|
3704
3704
|
get region() {
|
|
3705
|
-
return this._regionCache[this.apiHost] || (/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost) ? this._regionCache[this.apiHost] =
|
|
3705
|
+
return this._regionCache[this.apiHost] || (/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost) ? this._regionCache[this.apiHost] = Qe.US : /https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost) ? this._regionCache[this.apiHost] = Qe.EU : this._regionCache[this.apiHost] = Qe.CUSTOM), this._regionCache[this.apiHost];
|
|
3706
3706
|
}
|
|
3707
3707
|
endpointFor(e) {
|
|
3708
3708
|
var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "";
|
|
3709
3709
|
if (t && (t = t[0] === "/" ? t : "/".concat(t)), e === "ui") return this.uiHost + t;
|
|
3710
|
-
if (this.region ===
|
|
3710
|
+
if (this.region === Qe.CUSTOM) return this.apiHost + t;
|
|
3711
3711
|
var i = Vs + t;
|
|
3712
3712
|
switch (e) {
|
|
3713
3713
|
case "assets":
|
|
@@ -3717,7 +3717,7 @@ class Dl {
|
|
|
3717
3717
|
}
|
|
3718
3718
|
}
|
|
3719
3719
|
}
|
|
3720
|
-
var
|
|
3720
|
+
var jl = { icontains: (r, e) => !!g && e.href.toLowerCase().indexOf(r.toLowerCase()) > -1, not_icontains: (r, e) => !!g && e.href.toLowerCase().indexOf(r.toLowerCase()) === -1, regex: (r, e) => !!g && gt(e.href, r), not_regex: (r, e) => !!g && !gt(e.href, r), exact: (r, e) => e.href === r, is_not: (r, e) => e.href !== r };
|
|
3721
3721
|
class G {
|
|
3722
3722
|
constructor(e) {
|
|
3723
3723
|
var t = this;
|
|
@@ -3756,7 +3756,7 @@ class G {
|
|
|
3756
3756
|
previewWebExperiment() {
|
|
3757
3757
|
var e = G.getWindowLocation();
|
|
3758
3758
|
if (e != null && e.search) {
|
|
3759
|
-
var t =
|
|
3759
|
+
var t = ri(e == null ? void 0 : e.search, "__experiment_id"), i = ri(e == null ? void 0 : e.search, "__experiment_variant");
|
|
3760
3760
|
t && i && (G._logInfo("previewing web experiments ".concat(t, " && ").concat(i)), this.getWebExperiments((s) => {
|
|
3761
3761
|
this._showPreviewWebExperiment(parseInt(t), i, s);
|
|
3762
3762
|
}, !1, !0));
|
|
@@ -3786,7 +3786,7 @@ class G {
|
|
|
3786
3786
|
var t;
|
|
3787
3787
|
if (R(e.conditions) || R((t = e.conditions) === null || t === void 0 ? void 0 : t.url)) return !0;
|
|
3788
3788
|
var i, s, n, o = G.getWindowLocation();
|
|
3789
|
-
return !!o && ((i = e.conditions) === null || i === void 0 || !i.url ||
|
|
3789
|
+
return !!o && ((i = e.conditions) === null || i === void 0 || !i.url || jl[(s = (n = e.conditions) === null || n === void 0 ? void 0 : n.urlMatchType) !== null && s !== void 0 ? s : "icontains"](e.conditions.url, o));
|
|
3790
3790
|
}
|
|
3791
3791
|
static getWindowLocation() {
|
|
3792
3792
|
return g == null ? void 0 : g.location;
|
|
@@ -3796,8 +3796,8 @@ class G {
|
|
|
3796
3796
|
if (R(e.conditions) || R((t = e.conditions) === null || t === void 0 ? void 0 : t.utm)) return !0;
|
|
3797
3797
|
var i = eo();
|
|
3798
3798
|
if (i.utm_source) {
|
|
3799
|
-
var s, n, o, a, l, c, d, u, h, _, p, v, b, y, m, E, C = (s = e.conditions) === null || s === void 0 || (n = s.utm) === null || n === void 0 || !n.utm_campaign || ((o = e.conditions) === null || o === void 0 || (a = o.utm) === null || a === void 0 ? void 0 : a.utm_campaign) == i.utm_campaign,
|
|
3800
|
-
return C && O && L &&
|
|
3799
|
+
var s, n, o, a, l, c, d, u, h, _, p, v, b, y, m, E, C = (s = e.conditions) === null || s === void 0 || (n = s.utm) === null || n === void 0 || !n.utm_campaign || ((o = e.conditions) === null || o === void 0 || (a = o.utm) === null || a === void 0 ? void 0 : a.utm_campaign) == i.utm_campaign, T = (l = e.conditions) === null || l === void 0 || (c = l.utm) === null || c === void 0 || !c.utm_source || ((d = e.conditions) === null || d === void 0 || (u = d.utm) === null || u === void 0 ? void 0 : u.utm_source) == i.utm_source, O = (h = e.conditions) === null || h === void 0 || (_ = h.utm) === null || _ === void 0 || !_.utm_medium || ((p = e.conditions) === null || p === void 0 || (v = p.utm) === null || v === void 0 ? void 0 : v.utm_medium) == i.utm_medium, L = (b = e.conditions) === null || b === void 0 || (y = b.utm) === null || y === void 0 || !y.utm_term || ((m = e.conditions) === null || m === void 0 || (E = m.utm) === null || E === void 0 ? void 0 : E.utm_term) == i.utm_term;
|
|
3800
|
+
return C && O && L && T;
|
|
3801
3801
|
}
|
|
3802
3802
|
return !1;
|
|
3803
3803
|
}
|
|
@@ -3827,7 +3827,7 @@ function Gs(r, e, t) {
|
|
|
3827
3827
|
if (!(e in r)) return () => {
|
|
3828
3828
|
};
|
|
3829
3829
|
var i = r[e], s = t(i);
|
|
3830
|
-
return
|
|
3830
|
+
return ce(s) && (s.prototype = s.prototype || {}, Object.defineProperties(s, { __posthog_wrapped__: { enumerable: !1, value: !0 } })), r[e] = s, () => {
|
|
3831
3831
|
r[e] = i;
|
|
3832
3832
|
};
|
|
3833
3833
|
} catch {
|
|
@@ -3835,7 +3835,7 @@ function Gs(r, e, t) {
|
|
|
3835
3835
|
};
|
|
3836
3836
|
}
|
|
3837
3837
|
}
|
|
3838
|
-
class
|
|
3838
|
+
class Ul {
|
|
3839
3839
|
constructor(e) {
|
|
3840
3840
|
var t;
|
|
3841
3841
|
this._instance = e, this._lastPathname = (g == null || (t = g.location) === null || t === void 0 ? void 0 : t.pathname) || "";
|
|
@@ -3880,20 +3880,20 @@ class Nl {
|
|
|
3880
3880
|
}
|
|
3881
3881
|
}
|
|
3882
3882
|
}
|
|
3883
|
-
var Ft = {},
|
|
3884
|
-
},
|
|
3883
|
+
var Ft = {}, mr = () => {
|
|
3884
|
+
}, st = "posthog", bo = !Fl && (J == null ? void 0 : J.indexOf("MSIE")) === -1 && (J == null ? void 0 : J.indexOf("Mozilla")) === -1, Js = () => {
|
|
3885
3885
|
var r;
|
|
3886
|
-
return { api_host: "https://us.i.posthog.com", ui_host: null, token: "", autocapture: !0, rageclick: !0, cross_subdomain_cookie:
|
|
3886
|
+
return { api_host: "https://us.i.posthog.com", ui_host: null, token: "", autocapture: !0, rageclick: !0, cross_subdomain_cookie: jo(k == null ? void 0 : k.location), persistence: "localStorage+cookie", persistence_name: "", loaded: mr, save_campaign_params: !0, custom_campaign_params: [], custom_blocked_useragents: [], save_referrer: !0, capture_pageview: !0, capture_pageleave: "if_capture_pageview", debug: te && j(te == null ? void 0 : te.search) && te.search.indexOf("__posthog_debug=true") !== -1 || !1, cookie_expiration: 365, upgrade: !1, disable_session_recording: !1, disable_persistence: !1, disable_web_experiments: !0, disable_surveys: !1, disable_external_dependency_loading: !1, enable_recording_console_log: void 0, secure_cookie: (g == null || (r = g.location) === null || r === void 0 ? void 0 : r.protocol) === "https:", ip: !0, opt_out_capturing_by_default: !1, opt_out_persistence_by_default: !1, opt_out_useragent_filter: !1, opt_out_capturing_persistence_type: "localStorage", opt_out_capturing_cookie_prefix: null, opt_in_site_apps: !1, property_denylist: [], respect_dnt: !1, sanitize_properties: null, request_headers: {}, request_batching: !0, properties_string_max_length: 65535, session_recording: {}, mask_all_element_attributes: !1, mask_all_text: !1, mask_personal_data_properties: !1, custom_personal_data_properties: [], advanced_disable_decide: !1, advanced_disable_feature_flags: !1, advanced_disable_feature_flags_on_first_load: !1, advanced_disable_toolbar_metrics: !1, feature_flag_request_timeout_ms: 3e3, surveys_request_timeout_ms: 1e4, on_request_error: (e) => {
|
|
3887
3887
|
var t = "Bad HTTP status: " + e.statusCode + " " + e.text;
|
|
3888
3888
|
x.error(t);
|
|
3889
|
-
}, get_device_id: (e) => e, capture_performance: void 0, name: "posthog", bootstrap: {}, disable_compression: !1, session_idle_timeout_seconds: 1800, person_profiles: "identified_only", before_send: void 0, request_queue_config: { flush_interval_ms:
|
|
3889
|
+
}, get_device_id: (e) => e, capture_performance: void 0, name: "posthog", bootstrap: {}, disable_compression: !1, session_idle_timeout_seconds: 1800, person_profiles: "identified_only", before_send: void 0, request_queue_config: { flush_interval_ms: fr }, _onCapture: mr };
|
|
3890
3890
|
}, Ks = (r) => {
|
|
3891
3891
|
var e = {};
|
|
3892
3892
|
S(r.process_person) || (e.person_profiles = r.process_person), S(r.xhr_headers) || (e.request_headers = r.xhr_headers), S(r.cookie_name) || (e.persistence_name = r.cookie_name), S(r.disable_cookie) || (e.disable_persistence = r.disable_cookie), S(r.store_google) || (e.save_campaign_params = r.store_google), S(r.verbose) || (e.debug = r.verbose);
|
|
3893
3893
|
var t = H({}, e, r);
|
|
3894
3894
|
return D(r.property_blacklist) && (S(r.property_denylist) ? t.property_denylist = r.property_blacklist : D(r.property_denylist) ? t.property_denylist = [...r.property_blacklist, ...r.property_denylist] : x.error("Invalid value for property_denylist config: " + r.property_denylist)), t;
|
|
3895
3895
|
};
|
|
3896
|
-
class
|
|
3896
|
+
class zl {
|
|
3897
3897
|
constructor() {
|
|
3898
3898
|
w(this, "__forceAllowLocalhost", !1);
|
|
3899
3899
|
}
|
|
@@ -3904,16 +3904,16 @@ class Bl {
|
|
|
3904
3904
|
x.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"), this.__forceAllowLocalhost = e;
|
|
3905
3905
|
}
|
|
3906
3906
|
}
|
|
3907
|
-
class
|
|
3907
|
+
class fi {
|
|
3908
3908
|
get decideEndpointWasHit() {
|
|
3909
3909
|
var e, t;
|
|
3910
3910
|
return (e = (t = this.featureFlags) === null || t === void 0 ? void 0 : t.hasLoadedFlags) !== null && e !== void 0 && e;
|
|
3911
3911
|
}
|
|
3912
3912
|
constructor() {
|
|
3913
|
-
w(this, "webPerformance", new
|
|
3913
|
+
w(this, "webPerformance", new zl()), w(this, "_personProcessingSetOncePropertiesSent", !1), w(this, "version", Ce.LIB_VERSION), w(this, "_internalEventEmitter", new mo()), this.config = Js(), this.SentryIntegration = Ga, this.sentryIntegration = (e) => function(t, i) {
|
|
3914
3914
|
var s = An(t, i);
|
|
3915
3915
|
return { name: Ln, processEvent: (n) => s(n) };
|
|
3916
|
-
}(this, e), this.__request_queue = [], this.__loaded = !1, this.analyticsDefaultEndpoint = "/e/", this._initialPageviewCaptured = !1, this._initialPersonProfilesConfig = null, this._cachedPersonProperties = null, this.featureFlags = new
|
|
3916
|
+
}(this, e), this.__request_queue = [], this.__loaded = !1, this.analyticsDefaultEndpoint = "/e/", this._initialPageviewCaptured = !1, this._initialPersonProfilesConfig = null, this._cachedPersonProperties = null, this.featureFlags = new fl(this), this.toolbar = new Ka(this), this.scrollManager = new Ll(this), this.pageViewManager = new tl(this), this.surveys = new Cl(this), this.experiments = new G(this), this.exceptions = new il(this), this.rateLimiter = new Il(this), this.requestRouter = new Hl(this), this.consent = new da(this), this.people = { set: (e, t, i) => {
|
|
3917
3917
|
var s = j(e) ? { [e]: t } : e;
|
|
3918
3918
|
this.setPersonProperties(s), i == null || i({});
|
|
3919
3919
|
}, set_once: (e, t, i) => {
|
|
@@ -3922,21 +3922,21 @@ class pi {
|
|
|
3922
3922
|
} }, this.on("eventCaptured", (e) => x.info('send "'.concat(e == null ? void 0 : e.event, '"'), e));
|
|
3923
3923
|
}
|
|
3924
3924
|
init(e, t, i) {
|
|
3925
|
-
if (i && i !==
|
|
3926
|
-
var s, n = (s = Ft[i]) !== null && s !== void 0 ? s : new
|
|
3927
|
-
return n._init(e, t, i), Ft[i] = n, Ft[
|
|
3925
|
+
if (i && i !== st) {
|
|
3926
|
+
var s, n = (s = Ft[i]) !== null && s !== void 0 ? s : new fi();
|
|
3927
|
+
return n._init(e, t, i), Ft[i] = n, Ft[st][i] = n, n;
|
|
3928
3928
|
}
|
|
3929
3929
|
return this._init(e, t, i);
|
|
3930
3930
|
}
|
|
3931
3931
|
_init(e) {
|
|
3932
3932
|
var t, i, s = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, n = arguments.length > 2 ? arguments[2] : void 0;
|
|
3933
|
-
if (S(e) ||
|
|
3933
|
+
if (S(e) || Ui(e)) return x.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"), this;
|
|
3934
3934
|
if (this.__loaded) return x.warn("You have already initialized PostHog! Re-initializing is a no-op"), this;
|
|
3935
|
-
this.__loaded = !0, this.config = {}, this._triggered_notifs = [], s.person_profiles && (this._initialPersonProfilesConfig = s.person_profiles), this.set_config(H({}, Js(), Ks(s), { name: n, token: e })), this.config.on_xhr_error && x.error("on_xhr_error is deprecated. Use on_request_error instead"), this.compression = s.disable_compression ? void 0 :
|
|
3935
|
+
this.__loaded = !0, this.config = {}, this._triggered_notifs = [], s.person_profiles && (this._initialPersonProfilesConfig = s.person_profiles), this.set_config(H({}, Js(), Ks(s), { name: n, token: e })), this.config.on_xhr_error && x.error("on_xhr_error is deprecated. Use on_request_error instead"), this.compression = s.disable_compression ? void 0 : ge.GZipJS, this.persistence = new Mi(this.config), this.sessionPersistence = this.config.persistence === "sessionStorage" || this.config.persistence === "memory" ? this.persistence : new Mi(f(f({}, this.config), {}, { persistence: "sessionStorage" }));
|
|
3936
3936
|
var o = f({}, this.persistence.props), a = f({}, this.sessionPersistence.props);
|
|
3937
|
-
if (this._requestQueue = new
|
|
3937
|
+
if (this._requestQueue = new Rl((y) => this._send_retriable_request(y), this.config.request_queue_config), this._retryQueue = new Ol(this), this.__request_queue = [], this.config.__preview_experimental_cookieless_mode || (this.sessionManager = new Dl(this), this.sessionPropsManager = new Ml(this, this.sessionManager, this.persistence)), new Qa(this).startIfEnabledOrStop(), this.siteApps = new Nl(this), (t = this.siteApps) === null || t === void 0 || t.init(), this.config.__preview_experimental_cookieless_mode || (this.sessionRecording = new Wa(this), this.sessionRecording.startIfEnabledOrStop()), this.config.disable_scroll_properties || this.scrollManager.startMeasuringScrollPosition(), this.autocapture = new ia(this), this.autocapture.startIfEnabled(), this.surveys.loadIfEnabled(), this.heatmaps = new el(this), this.heatmaps.startIfEnabled(), this.webVitalsAutocapture = new Xa(this), this.exceptionObserver = new pa(this), this.exceptionObserver.startIfEnabled(), this.deadClicksAutocapture = new Sn(this, ha), this.deadClicksAutocapture.startIfEnabled(), this.historyAutocapture = new Ul(this), this.historyAutocapture.startIfEnabled(), Ce.DEBUG = Ce.DEBUG || this.config.debug, Ce.DEBUG && x.info("Starting in debug mode", { this: this, config: s, thisC: f({}, this.config), p: o, s: a }), this._sync_opt_out_with_persistence(), ((i = s.bootstrap) === null || i === void 0 ? void 0 : i.distinctID) !== void 0) {
|
|
3938
3938
|
var l, c, d = this.config.get_device_id(Me()), u = (l = s.bootstrap) !== null && l !== void 0 && l.isIdentifiedID ? d : s.bootstrap.distinctID;
|
|
3939
|
-
this.persistence.set_property(
|
|
3939
|
+
this.persistence.set_property(ke, (c = s.bootstrap) !== null && c !== void 0 && c.isIdentifiedID ? "identified" : "anonymous"), this.register({ distinct_id: s.bootstrap.distinctID, $device_id: u });
|
|
3940
3940
|
}
|
|
3941
3941
|
if (this._hasBootstrappedFeatureFlags()) {
|
|
3942
3942
|
var h, _, p = Object.keys(((h = s.bootstrap) === null || h === void 0 ? void 0 : h.featureFlags) || {}).filter((y) => {
|
|
@@ -3946,24 +3946,24 @@ class pi {
|
|
|
3946
3946
|
var E, C;
|
|
3947
3947
|
return y[m] = ((E = s.bootstrap) === null || E === void 0 || (C = E.featureFlags) === null || C === void 0 ? void 0 : C[m]) || !1, y;
|
|
3948
3948
|
}, {}), v = Object.keys(((_ = s.bootstrap) === null || _ === void 0 ? void 0 : _.featureFlagPayloads) || {}).filter((y) => p[y]).reduce((y, m) => {
|
|
3949
|
-
var E, C,
|
|
3950
|
-
return (E = s.bootstrap) !== null && E !== void 0 && (C = E.featureFlagPayloads) !== null && C !== void 0 && C[m] && (y[m] = (
|
|
3949
|
+
var E, C, T, O;
|
|
3950
|
+
return (E = s.bootstrap) !== null && E !== void 0 && (C = E.featureFlagPayloads) !== null && C !== void 0 && C[m] && (y[m] = (T = s.bootstrap) === null || T === void 0 || (O = T.featureFlagPayloads) === null || O === void 0 ? void 0 : O[m]), y;
|
|
3951
3951
|
}, {});
|
|
3952
3952
|
this.featureFlags.receivedFeatureFlags({ featureFlags: p, featureFlagPayloads: v });
|
|
3953
3953
|
}
|
|
3954
3954
|
if (this.config.__preview_experimental_cookieless_mode) this.register_once({ distinct_id: es, $device_id: null }, "");
|
|
3955
3955
|
else if (!this.get_distinct_id()) {
|
|
3956
3956
|
var b = this.config.get_device_id(Me());
|
|
3957
|
-
this.register_once({ distinct_id: b, $device_id: b }, ""), this.persistence.set_property(
|
|
3957
|
+
this.register_once({ distinct_id: b, $device_id: b }, ""), this.persistence.set_property(ke, "anonymous");
|
|
3958
3958
|
}
|
|
3959
|
-
return N(g, "onpagehide" in self ? "pagehide" : "unload", this._handle_unload.bind(this), { passive: !1 }), this.toolbar.maybeLoadToolbar(), s.segment ?
|
|
3959
|
+
return N(g, "onpagehide" in self ? "pagehide" : "unload", this._handle_unload.bind(this), { passive: !1 }), this.toolbar.maybeLoadToolbar(), s.segment ? Va(this, () => this._loaded()) : this._loaded(), ce(this.config._onCapture) && this.config._onCapture !== mr && (x.warn("onCapture is deprecated. Please use `before_send` instead"), this.on("eventCaptured", (y) => this.config._onCapture(y.event, y))), this;
|
|
3960
3960
|
}
|
|
3961
3961
|
_onRemoteConfig(e) {
|
|
3962
3962
|
var t, i, s, n, o, a, l, c;
|
|
3963
3963
|
if (!k || !k.body) return x.info("document not ready yet, trying again in 500 milliseconds..."), void setTimeout(() => {
|
|
3964
3964
|
this._onRemoteConfig(e);
|
|
3965
3965
|
}, 500);
|
|
3966
|
-
this.compression = void 0, e.supportedCompression && !this.config.disable_compression && (this.compression =
|
|
3966
|
+
this.compression = void 0, e.supportedCompression && !this.config.disable_compression && (this.compression = F(e.supportedCompression, ge.GZipJS) ? ge.GZipJS : F(e.supportedCompression, ge.Base64) ? ge.Base64 : void 0), (t = e.analytics) !== null && t !== void 0 && t.endpoint && (this.analyticsDefaultEndpoint = e.analytics.endpoint), this.set_config({ person_profiles: this._initialPersonProfilesConfig ? this._initialPersonProfilesConfig : "identified_only" }), (i = this.siteApps) === null || i === void 0 || i.onRemoteConfig(e), (s = this.sessionRecording) === null || s === void 0 || s.onRemoteConfig(e), (n = this.autocapture) === null || n === void 0 || n.onRemoteConfig(e), (o = this.heatmaps) === null || o === void 0 || o.onRemoteConfig(e), this.surveys.onRemoteConfig(e), (a = this.webVitalsAutocapture) === null || a === void 0 || a.onRemoteConfig(e), (l = this.exceptionObserver) === null || l === void 0 || l.onRemoteConfig(e), (c = this.deadClicksAutocapture) === null || c === void 0 || c.onRemoteConfig(e);
|
|
3967
3967
|
}
|
|
3968
3968
|
_loaded() {
|
|
3969
3969
|
try {
|
|
@@ -3973,7 +3973,7 @@ class pi {
|
|
|
3973
3973
|
}
|
|
3974
3974
|
this._start_queue_if_opted_in(), this.config.capture_pageview && setTimeout(() => {
|
|
3975
3975
|
this.consent.isOptedIn() && this._captureInitialPageview();
|
|
3976
|
-
}, 1), new
|
|
3976
|
+
}, 1), new Pl(this).load(), this.featureFlags.decide();
|
|
3977
3977
|
}
|
|
3978
3978
|
_start_queue_if_opted_in() {
|
|
3979
3979
|
var e;
|
|
@@ -3987,10 +3987,10 @@ class pi {
|
|
|
3987
3987
|
this.config.request_batching ? (this._shouldCapturePageleave() && this.capture("$pageleave"), (e = this._requestQueue) === null || e === void 0 || e.unload(), (t = this._retryQueue) === null || t === void 0 || t.unload()) : this._shouldCapturePageleave() && this.capture("$pageleave", null, { transport: "sendBeacon" });
|
|
3988
3988
|
}
|
|
3989
3989
|
_send_request(e) {
|
|
3990
|
-
this.__loaded && (bo ? this.__request_queue.push(e) : this.rateLimiter.isServerRateLimited(e.batchKey) || (e.transport = e.transport || this.config.api_transport, e.url =
|
|
3990
|
+
this.__loaded && (bo ? this.__request_queue.push(e) : this.rateLimiter.isServerRateLimited(e.batchKey) || (e.transport = e.transport || this.config.api_transport, e.url = ci(e.url, { ip: this.config.ip ? 1 : 0 }), e.headers = f({}, this.config.request_headers), e.compression = e.compression === "best-available" ? this.compression : e.compression, e.fetchOptions = e.fetchOptions || this.config.fetch_options, ((t) => {
|
|
3991
3991
|
var i, s, n, o = f({}, t);
|
|
3992
|
-
o.timeout = o.timeout || 6e4, o.url =
|
|
3993
|
-
var a = (i = o.transport) !== null && i !== void 0 ? i : "fetch", l = (s = (n = on(
|
|
3992
|
+
o.timeout = o.timeout || 6e4, o.url = ci(o.url, { _: (/* @__PURE__ */ new Date()).getTime().toString(), ver: Ce.LIB_VERSION, compression: o.compression });
|
|
3993
|
+
var a = (i = o.transport) !== null && i !== void 0 ? i : "fetch", l = (s = (n = on(Tt, (c) => c.transport === a)) === null || n === void 0 ? void 0 : n.method) !== null && s !== void 0 ? s : Tt[0].method;
|
|
3994
3994
|
if (!l) throw new Error("No available transport method");
|
|
3995
3995
|
l(o);
|
|
3996
3996
|
})(f(f({}, e), {}, { callback: (t) => {
|
|
@@ -4004,7 +4004,7 @@ class pi {
|
|
|
4004
4004
|
_execute_array(e) {
|
|
4005
4005
|
var t, i = [], s = [], n = [];
|
|
4006
4006
|
qe(e, (a) => {
|
|
4007
|
-
a && (t = a[0], D(t) ? n.push(a) :
|
|
4007
|
+
a && (t = a[0], D(t) ? n.push(a) : ce(a) ? a.call(this) : D(a) && t === "alias" ? i.push(a) : D(a) && t.indexOf("capture") !== -1 && ce(this[t]) ? n.push(a) : s.push(a));
|
|
4008
4008
|
});
|
|
4009
4009
|
var o = function(a, l) {
|
|
4010
4010
|
qe(a, function(c) {
|
|
@@ -4036,9 +4036,9 @@ class pi {
|
|
|
4036
4036
|
var o = /* @__PURE__ */ new Date(), a = (i == null ? void 0 : i.timestamp) || o, l = Me(), c = { uuid: l, event: e, properties: this._calculate_event_properties(e, t || {}, a, l) };
|
|
4037
4037
|
n && (c.properties.$lib_rate_limit_remaining_tokens = n.remainingTokens), i != null && i.$set && (c.$set = i == null ? void 0 : i.$set);
|
|
4038
4038
|
var d = this._calculate_set_once_properties(i == null ? void 0 : i.$set_once);
|
|
4039
|
-
d && (c.$set_once = d), (c =
|
|
4039
|
+
d && (c.$set_once = d), (c = Bo(c, i != null && i._noTruncate ? null : this.config.properties_string_max_length)).timestamp = a, S(i == null ? void 0 : i.timestamp) || (c.properties.$event_time_override_provided = !0, c.properties.$event_time_override_system_time = o);
|
|
4040
4040
|
var u = f(f({}, c.properties.$set), c.$set);
|
|
4041
|
-
if (
|
|
4041
|
+
if (nt(u) || this.setPersonPropertiesForFlags(u), !R(this.config.before_send)) {
|
|
4042
4042
|
var h = this._runBeforeSend(c);
|
|
4043
4043
|
if (!h) return;
|
|
4044
4044
|
c = h;
|
|
@@ -4060,9 +4060,9 @@ class pi {
|
|
|
4060
4060
|
var n = this.persistence.remove_event_timer(e), o = f({}, t);
|
|
4061
4061
|
if (o.token = this.config.token, this.config.__preview_experimental_cookieless_mode && (o.$cookieless_mode = !0), e === "$snapshot") {
|
|
4062
4062
|
var a = f(f({}, this.persistence.properties()), this.sessionPersistence.properties());
|
|
4063
|
-
return o.distinct_id = a.distinct_id, (!j(o.distinct_id) && !
|
|
4063
|
+
return o.distinct_id = a.distinct_id, (!j(o.distinct_id) && !Y(o.distinct_id) || Ui(o.distinct_id)) && x.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"), o;
|
|
4064
4064
|
}
|
|
4065
|
-
var l, c =
|
|
4065
|
+
var l, c = gl(this.config.mask_personal_data_properties, this.config.custom_personal_data_properties);
|
|
4066
4066
|
if (this.sessionManager) {
|
|
4067
4067
|
var { sessionId: d, windowId: u } = this.sessionManager.checkAndGetSessionAndWindowId();
|
|
4068
4068
|
o.$session_id = d, o.$window_id = u;
|
|
@@ -4074,7 +4074,7 @@ class pi {
|
|
|
4074
4074
|
} catch (b) {
|
|
4075
4075
|
o.$sdk_debug_error_capturing_properties = String(b);
|
|
4076
4076
|
}
|
|
4077
|
-
if (this.requestRouter.region ===
|
|
4077
|
+
if (this.requestRouter.region === Qe.CUSTOM && (o.$lib_custom_api_host = this.config.api_host), l = e === "$pageview" ? this.pageViewManager.doPageView(i, s) : e === "$pageleave" ? this.pageViewManager.doPageLeave(i) : this.pageViewManager.doEvent(), o = H(o, l), e === "$pageview" && k && (o.title = k.title), !S(n)) {
|
|
4078
4078
|
var _ = i.getTime() - n;
|
|
4079
4079
|
o.$duration = parseFloat((_ / 1e3).toFixed(3));
|
|
4080
4080
|
}
|
|
@@ -4090,7 +4090,7 @@ class pi {
|
|
|
4090
4090
|
var t;
|
|
4091
4091
|
if (!this.persistence || !this._hasPersonProcessing() || this._personProcessingSetOncePropertiesSent) return e;
|
|
4092
4092
|
var i = this.persistence.get_initial_props(), s = (t = this.sessionPropsManager) === null || t === void 0 ? void 0 : t.getSetOnceProps(), n = H({}, i, s || {}, e || {}), o = this.config.sanitize_properties;
|
|
4093
|
-
return o && (x.error("sanitize_properties is deprecated. Use before_send instead"), n = o(n, "$set_once")), this._personProcessingSetOncePropertiesSent = !0,
|
|
4093
|
+
return o && (x.error("sanitize_properties is deprecated. Use before_send instead"), n = o(n, "$set_once")), this._personProcessingSetOncePropertiesSent = !0, nt(n) ? void 0 : n;
|
|
4094
4094
|
}
|
|
4095
4095
|
register(e, t) {
|
|
4096
4096
|
var i;
|
|
@@ -4173,7 +4173,7 @@ class pi {
|
|
|
4173
4173
|
}
|
|
4174
4174
|
identify(e, t, i) {
|
|
4175
4175
|
if (!this.__loaded || !this.persistence) return x.uninitializedWarning("posthog.identify");
|
|
4176
|
-
if (
|
|
4176
|
+
if (Y(e) && (e = e.toString(), x.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")), e) {
|
|
4177
4177
|
if (["distinct_id", "distinctid"].includes(e.toLowerCase())) x.critical('The string "'.concat(e, '" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.'));
|
|
4178
4178
|
else if (this._requirePersonProcessing("posthog.identify")) {
|
|
4179
4179
|
var s = this.get_distinct_id();
|
|
@@ -4181,9 +4181,9 @@ class pi {
|
|
|
4181
4181
|
var n = s;
|
|
4182
4182
|
this.register_once({ $had_persisted_distinct_id: !0, $device_id: n }, "");
|
|
4183
4183
|
}
|
|
4184
|
-
e !== s && e !== this.get_property(
|
|
4185
|
-
var o = (this.persistence.get_property(
|
|
4186
|
-
e !== s && o ? (this.persistence.set_property(
|
|
4184
|
+
e !== s && e !== this.get_property(wt) && (this.unregister(wt), this.register({ distinct_id: e }));
|
|
4185
|
+
var o = (this.persistence.get_property(ke) || "anonymous") === "anonymous";
|
|
4186
|
+
e !== s && o ? (this.persistence.set_property(ke, "identified"), this.setPersonPropertiesForFlags(f(f({}, i || {}), t || {}), !1), this.capture("$identify", { distinct_id: e, $anon_distinct_id: s }, { $set: t || {}, $set_once: i || {} }), this._cachedPersonProperties = Ws(e, t, i), this.featureFlags.setAnonymousDistinctId(s)) : (t || i) && this.setPersonProperties(t, i), e !== s && (this.reloadFeatureFlags(), this.unregister(ei));
|
|
4187
4187
|
}
|
|
4188
4188
|
} else x.error("Unique user id has not been set in posthog.identify");
|
|
4189
4189
|
}
|
|
@@ -4222,7 +4222,7 @@ class pi {
|
|
|
4222
4222
|
var t, i, s, n;
|
|
4223
4223
|
if (x.info("reset"), !this.__loaded) return x.uninitializedWarning("posthog.reset");
|
|
4224
4224
|
var o = this.get_property("$device_id");
|
|
4225
|
-
if (this.consent.reset(), (t = this.persistence) === null || t === void 0 || t.clear(), (i = this.sessionPersistence) === null || i === void 0 || i.clear(), this.surveys.reset(), (s = this.persistence) === null || s === void 0 || s.set_property(
|
|
4225
|
+
if (this.consent.reset(), (t = this.persistence) === null || t === void 0 || t.clear(), (i = this.sessionPersistence) === null || i === void 0 || i.clear(), this.surveys.reset(), (s = this.persistence) === null || s === void 0 || s.set_property(ke, "anonymous"), (n = this.sessionManager) === null || n === void 0 || n.resetSessionId(), this._cachedPersonProperties = null, this.config.__preview_experimental_cookieless_mode) this.register_once({ distinct_id: es, $device_id: null }, "");
|
|
4226
4226
|
else {
|
|
4227
4227
|
var a = this.config.get_device_id(Me());
|
|
4228
4228
|
this.register_once({ distinct_id: a, $device_id: e ? a : o }, "");
|
|
@@ -4251,11 +4251,11 @@ class pi {
|
|
|
4251
4251
|
return s;
|
|
4252
4252
|
}
|
|
4253
4253
|
alias(e, t) {
|
|
4254
|
-
return e === this.get_property(an) ? (x.critical("Attempting to create alias for existing People user - aborting."), -2) : this._requirePersonProcessing("posthog.alias") ? (S(t) && (t = this.get_distinct_id()), e !== t ? (this._register_single(
|
|
4254
|
+
return e === this.get_property(an) ? (x.critical("Attempting to create alias for existing People user - aborting."), -2) : this._requirePersonProcessing("posthog.alias") ? (S(t) && (t = this.get_distinct_id()), e !== t ? (this._register_single(wt, e), this.capture("$create_alias", { alias: e, distinct_id: t })) : (x.warn("alias matches current distinct_id - skipping api call."), this.identify(e), -1)) : void 0;
|
|
4255
4255
|
}
|
|
4256
4256
|
set_config(e) {
|
|
4257
4257
|
var t, i, s, n, o = f({}, this.config);
|
|
4258
|
-
q(e) && (H(this.config, Ks(e)), (t = this.persistence) === null || t === void 0 || t.update_config(this.config, o), this.sessionPersistence = this.config.persistence === "sessionStorage" || this.config.persistence === "memory" ? this.persistence : new
|
|
4258
|
+
q(e) && (H(this.config, Ks(e)), (t = this.persistence) === null || t === void 0 || t.update_config(this.config, o), this.sessionPersistence = this.config.persistence === "sessionStorage" || this.config.persistence === "memory" ? this.persistence : new Mi(f(f({}, this.config), {}, { persistence: "sessionStorage" })), U.is_supported() && U.get("ph_debug") === "true" && (this.config.debug = !0), this.config.debug && (Ce.DEBUG = !0, x.info("set_config", JSON.stringify({ config: e, oldConfig: o, newConfig: f({}, this.config) }, null, 2))), (i = this.sessionRecording) === null || i === void 0 || i.startIfEnabledOrStop(), (s = this.autocapture) === null || s === void 0 || s.startIfEnabled(), (n = this.heatmaps) === null || n === void 0 || n.startIfEnabled(), this.surveys.loadIfEnabled(), this._sync_opt_out_with_persistence());
|
|
4259
4259
|
}
|
|
4260
4260
|
startSessionRecording(e) {
|
|
4261
4261
|
var t = e === !0, i = { sampling: t || !(e == null || !e.sampling), linked_flag: t || !(e == null || !e.linked_flag), url_trigger: t || !(e == null || !e.url_trigger), event_trigger: t || !(e == null || !e.event_trigger) };
|
|
@@ -4274,7 +4274,7 @@ class pi {
|
|
|
4274
4274
|
}
|
|
4275
4275
|
captureException(e, t) {
|
|
4276
4276
|
var i = new Error("PostHog syntheticException");
|
|
4277
|
-
this.exceptions.sendExceptionEvent(f(f({},
|
|
4277
|
+
this.exceptions.sendExceptionEvent(f(f({}, Ia(((s) => s instanceof Error)(e) ? { error: e, event: e.message } : { event: e }, { syntheticException: i })), t));
|
|
4278
4278
|
}
|
|
4279
4279
|
loadToolbar(e) {
|
|
4280
4280
|
return this.toolbar.loadToolbar(e);
|
|
@@ -4288,16 +4288,16 @@ class pi {
|
|
|
4288
4288
|
return (t = this.sessionPersistence) === null || t === void 0 ? void 0 : t.props[e];
|
|
4289
4289
|
}
|
|
4290
4290
|
toString() {
|
|
4291
|
-
var e, t = (e = this.config.name) !== null && e !== void 0 ? e :
|
|
4292
|
-
return t !==
|
|
4291
|
+
var e, t = (e = this.config.name) !== null && e !== void 0 ? e : st;
|
|
4292
|
+
return t !== st && (t = st + "." + t), t;
|
|
4293
4293
|
}
|
|
4294
4294
|
_isIdentified() {
|
|
4295
4295
|
var e, t;
|
|
4296
|
-
return ((e = this.persistence) === null || e === void 0 ? void 0 : e.get_property(
|
|
4296
|
+
return ((e = this.persistence) === null || e === void 0 ? void 0 : e.get_property(ke)) === "identified" || ((t = this.sessionPersistence) === null || t === void 0 ? void 0 : t.get_property(ke)) === "identified";
|
|
4297
4297
|
}
|
|
4298
4298
|
_hasPersonProcessing() {
|
|
4299
4299
|
var e, t, i, s;
|
|
4300
|
-
return !(this.config.person_profiles === "never" || this.config.person_profiles === "identified_only" && !this._isIdentified() &&
|
|
4300
|
+
return !(this.config.person_profiles === "never" || this.config.person_profiles === "identified_only" && !this._isIdentified() && nt(this.getGroups()) && ((e = this.persistence) === null || e === void 0 || (t = e.props) === null || t === void 0 || !t[wt]) && ((i = this.persistence) === null || i === void 0 || (s = i.props) === null || s === void 0 || !s[ti]));
|
|
4301
4301
|
}
|
|
4302
4302
|
_shouldCapturePageleave() {
|
|
4303
4303
|
return this.config.capture_pageleave === !0 || this.config.capture_pageleave === "if_capture_pageview" && (this.config.capture_pageview === !0 || this.config.capture_pageview === "history_change");
|
|
@@ -4306,7 +4306,7 @@ class pi {
|
|
|
4306
4306
|
this._hasPersonProcessing() || this._requirePersonProcessing("posthog.createPersonProfile") && this.setPersonProperties({}, {});
|
|
4307
4307
|
}
|
|
4308
4308
|
_requirePersonProcessing(e) {
|
|
4309
|
-
return this.config.person_profiles === "never" ? (x.error(e + ' was called, but process_person is set to "never". This call will be ignored.'), !1) : (this._register_single(
|
|
4309
|
+
return this.config.person_profiles === "never" ? (x.error(e + ' was called, but process_person is set to "never". This call will be ignored.'), !1) : (this._register_single(ti, !0), !0);
|
|
4310
4310
|
}
|
|
4311
4311
|
_sync_opt_out_with_persistence() {
|
|
4312
4312
|
var e, t, i, s, n = this.consent.isOptedOut(), o = this.config.opt_out_persistence_by_default, a = this.config.disable_persistence || n && !!o;
|
|
@@ -4343,9 +4343,9 @@ class pi {
|
|
|
4343
4343
|
for (var s of t) {
|
|
4344
4344
|
if (i = s(i), R(i)) {
|
|
4345
4345
|
var n = "Event '".concat(e.event, "' was rejected in beforeSend function");
|
|
4346
|
-
return
|
|
4346
|
+
return Do(e.event) ? x.warn("".concat(n, ". This can cause unexpected behavior.")) : x.info(n), null;
|
|
4347
4347
|
}
|
|
4348
|
-
i.properties && !
|
|
4348
|
+
i.properties && !nt(i.properties) || x.warn("Event '".concat(e.event, "' has no properties after beforeSend function, this is likely an error."));
|
|
4349
4349
|
}
|
|
4350
4350
|
return i;
|
|
4351
4351
|
}
|
|
@@ -4361,10 +4361,10 @@ class pi {
|
|
|
4361
4361
|
}
|
|
4362
4362
|
}
|
|
4363
4363
|
(function(r, e) {
|
|
4364
|
-
for (var t = 0; t < e.length; t++) r.prototype[e[t]] =
|
|
4365
|
-
})(
|
|
4364
|
+
for (var t = 0; t < e.length; t++) r.prototype[e[t]] = No(r.prototype[e[t]]);
|
|
4365
|
+
})(fi, ["identify"]);
|
|
4366
4366
|
var Ys;
|
|
4367
|
-
Ys = Ft[
|
|
4367
|
+
Ys = Ft[st] = new fi(), function() {
|
|
4368
4368
|
function r() {
|
|
4369
4369
|
r.done || (r.done = !0, bo = !1, $(Ft, function(e) {
|
|
4370
4370
|
e._dom_loaded();
|
|
@@ -4376,7 +4376,7 @@ var Qs;
|
|
|
4376
4376
|
(function(r) {
|
|
4377
4377
|
r.USER_ADDED_TO_CART = "user_added_to_cart", r.USER_SUBMITTED_CHECKOUT = "user_submitted_checkout";
|
|
4378
4378
|
})(Qs || (Qs = {}));
|
|
4379
|
-
const
|
|
4379
|
+
const Wl = { class: "dialog-block-header-container" }, Vl = { class: "dialog-block-title" }, Gl = { class: "dialog-block-description" }, Jl = /* @__PURE__ */ He({
|
|
4380
4380
|
__name: "DialogBlockHeader",
|
|
4381
4381
|
props: {
|
|
4382
4382
|
title: {},
|
|
@@ -4384,32 +4384,32 @@ const Hl = { class: "dialog-block-header-container" }, jl = { class: "dialog-blo
|
|
|
4384
4384
|
},
|
|
4385
4385
|
setup(r) {
|
|
4386
4386
|
const e = r;
|
|
4387
|
-
return (t, i) => (
|
|
4388
|
-
|
|
4389
|
-
|
|
4387
|
+
return (t, i) => (ue(), Be("div", Wl, [
|
|
4388
|
+
K("div", Vl, Ni(e.title ?? "Your expert"), 1),
|
|
4389
|
+
K("div", Gl, Ni(e.description ?? "A question about this product?"), 1)
|
|
4390
4390
|
]));
|
|
4391
4391
|
}
|
|
4392
|
-
}),
|
|
4392
|
+
}), vt = (r, e) => {
|
|
4393
4393
|
const t = r.__vccOpts || r;
|
|
4394
4394
|
for (const [i, s] of e)
|
|
4395
4395
|
t[i] = s;
|
|
4396
4396
|
return t;
|
|
4397
|
-
},
|
|
4397
|
+
}, Kl = /* @__PURE__ */ vt(Jl, [["__scopeId", "data-v-6abd4066"]]), Yl = {
|
|
4398
4398
|
width: "20",
|
|
4399
4399
|
height: "20",
|
|
4400
4400
|
viewBox: "0 0 20 20",
|
|
4401
4401
|
fill: "none",
|
|
4402
4402
|
xmlns: "http://www.w3.org/2000/svg"
|
|
4403
|
-
},
|
|
4403
|
+
}, Ql = { "clip-path": "url(#clip0_466_934)" }, Xl = ["stroke"], Zl = ["stroke"], eu = /* @__PURE__ */ He({
|
|
4404
4404
|
__name: "AiStarsIcon",
|
|
4405
4405
|
props: {
|
|
4406
4406
|
color: {}
|
|
4407
4407
|
},
|
|
4408
4408
|
setup(r) {
|
|
4409
4409
|
const e = r;
|
|
4410
|
-
return (t, i) => (
|
|
4411
|
-
|
|
4412
|
-
|
|
4410
|
+
return (t, i) => (ue(), Be("svg", Yl, [
|
|
4411
|
+
K("g", Ql, [
|
|
4412
|
+
K("path", {
|
|
4413
4413
|
d: `M5.41675 10.8333L6.07046 12.1408C6.2917 12.5832 6.40232 12.8045 6.55011
|
|
4414
4414
|
12.9962C6.68124 13.1663 6.83375 13.3188 7.00388 13.45C7.19559 13.5977 7.41684
|
|
4415
4415
|
13.7084 7.85932 13.9296L9.16675 14.5833L7.85932 15.237C7.41684 15.4583 7.19559
|
|
@@ -4424,8 +4424,8 @@ const Hl = { class: "dialog-block-header-container" }, jl = { class: "dialog-blo
|
|
|
4424
4424
|
"stroke-width": "1.5",
|
|
4425
4425
|
"stroke-linecap": "round",
|
|
4426
4426
|
"stroke-linejoin": "round"
|
|
4427
|
-
}, null, 8,
|
|
4428
|
-
|
|
4427
|
+
}, null, 8, Xl),
|
|
4428
|
+
K("path", {
|
|
4429
4429
|
d: `M12.5001 1.66666L13.4823 4.22034C13.7173 4.83136 13.8348 5.13688 14.0175
|
|
4430
4430
|
5.39386C14.1795 5.62162 14.3785 5.82061 14.6062 5.98256C14.8632 6.16529 15.1687
|
|
4431
4431
|
6.2828 15.7797 6.5178L18.3334 7.49999L15.7797 8.48217C15.1687 8.71718 14.8632
|
|
@@ -4440,11 +4440,11 @@ const Hl = { class: "dialog-block-header-container" }, jl = { class: "dialog-blo
|
|
|
4440
4440
|
"stroke-width": "1.5",
|
|
4441
4441
|
"stroke-linecap": "round",
|
|
4442
4442
|
"stroke-linejoin": "round"
|
|
4443
|
-
}, null, 8,
|
|
4443
|
+
}, null, 8, Zl)
|
|
4444
4444
|
]),
|
|
4445
|
-
i[0] || (i[0] =
|
|
4446
|
-
|
|
4447
|
-
|
|
4445
|
+
i[0] || (i[0] = K("defs", null, [
|
|
4446
|
+
K("clipPath", { id: "clip0_466_934" }, [
|
|
4447
|
+
K("rect", {
|
|
4448
4448
|
width: "20",
|
|
4449
4449
|
height: "20",
|
|
4450
4450
|
fill: "white"
|
|
@@ -4453,7 +4453,7 @@ const Hl = { class: "dialog-block-header-container" }, jl = { class: "dialog-blo
|
|
|
4453
4453
|
], -1))
|
|
4454
4454
|
]));
|
|
4455
4455
|
}
|
|
4456
|
-
}),
|
|
4456
|
+
}), tu = ["onClick"], iu = { class: "dialog-block-suggestions-item-label" }, ru = /* @__PURE__ */ He({
|
|
4457
4457
|
__name: "DialogBlockSuggestions",
|
|
4458
4458
|
props: {
|
|
4459
4459
|
client: {},
|
|
@@ -4472,27 +4472,27 @@ const Hl = { class: "dialog-block-header-container" }, jl = { class: "dialog-blo
|
|
|
4472
4472
|
fromQuestionSuggestion: !0
|
|
4473
4473
|
});
|
|
4474
4474
|
};
|
|
4475
|
-
return (i, s) => (
|
|
4475
|
+
return (i, s) => (ue(!0), Be(Xs, null, xo(e.questions, (n) => (ue(), Be("button", {
|
|
4476
4476
|
key: n.question,
|
|
4477
4477
|
class: "dialog-block-suggestions-item",
|
|
4478
4478
|
onClick: (o) => t(n.question)
|
|
4479
4479
|
}, [
|
|
4480
|
-
|
|
4480
|
+
Jt(eu, {
|
|
4481
4481
|
class: "dialog-block-suggestions-item-icon",
|
|
4482
4482
|
color: e.client.theme.primaryColor
|
|
4483
4483
|
}, null, 8, ["color"]),
|
|
4484
|
-
|
|
4485
|
-
], 8,
|
|
4486
|
-
}
|
|
4487
|
-
}),
|
|
4488
|
-
function
|
|
4489
|
-
return
|
|
4490
|
-
e[0] || (e[0] =
|
|
4491
|
-
e[1] || (e[1] =
|
|
4492
|
-
e[2] || (e[2] =
|
|
4484
|
+
K("span", iu, Ni(n.question), 1)
|
|
4485
|
+
], 8, tu))), 128));
|
|
4486
|
+
}
|
|
4487
|
+
}), su = /* @__PURE__ */ vt(ru, [["__scopeId", "data-v-7a20db67"]]), nu = {};
|
|
4488
|
+
function ou(r, e) {
|
|
4489
|
+
return ue(), Be(Xs, null, [
|
|
4490
|
+
e[0] || (e[0] = K("div", { class: "dialog-block-suggestions-skeleton-item" }, null, -1)),
|
|
4491
|
+
e[1] || (e[1] = K("div", { class: "dialog-block-suggestions-skeleton-item" }, null, -1)),
|
|
4492
|
+
e[2] || (e[2] = K("div", { class: "dialog-block-suggestions-skeleton-item" }, null, -1))
|
|
4493
4493
|
], 64);
|
|
4494
4494
|
}
|
|
4495
|
-
const
|
|
4495
|
+
const au = /* @__PURE__ */ vt(nu, [["render", ou], ["__scopeId", "data-v-26a64b58"]]), lu = { class: "dialog-block-suggestions-container" }, uu = /* @__PURE__ */ He({
|
|
4496
4496
|
__name: "DialogBlockSuggestionsContainer",
|
|
4497
4497
|
props: {
|
|
4498
4498
|
client: {},
|
|
@@ -4504,8 +4504,8 @@ const ru = /* @__PURE__ */ Lt(tu, [["render", iu], ["__scopeId", "data-v-26a64b5
|
|
|
4504
4504
|
},
|
|
4505
4505
|
setup(r) {
|
|
4506
4506
|
const e = r;
|
|
4507
|
-
return (t, i) => (
|
|
4508
|
-
e.isLoading || !e.questions ? (
|
|
4507
|
+
return (t, i) => (ue(), Be("div", lu, [
|
|
4508
|
+
e.isLoading || !e.questions ? (ue(), Kt(au, { key: 0 })) : (ue(), Kt(su, {
|
|
4509
4509
|
key: 1,
|
|
4510
4510
|
client: e.client,
|
|
4511
4511
|
questions: e.questions,
|
|
@@ -4515,7 +4515,80 @@ const ru = /* @__PURE__ */ Lt(tu, [["render", iu], ["__scopeId", "data-v-26a64b5
|
|
|
4515
4515
|
}, null, 8, ["client", "questions", "product-id", "product-title", "selected-variant-id"]))
|
|
4516
4516
|
]));
|
|
4517
4517
|
}
|
|
4518
|
-
}),
|
|
4518
|
+
}), cu = /* @__PURE__ */ vt(uu, [["__scopeId", "data-v-4509a683"]]), du = {
|
|
4519
|
+
width: "20",
|
|
4520
|
+
height: "20",
|
|
4521
|
+
viewBox: "0 0 20 20",
|
|
4522
|
+
fill: "none",
|
|
4523
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
4524
|
+
}, _u = ["stroke"], hu = /* @__PURE__ */ He({
|
|
4525
|
+
__name: "ArrowIcon",
|
|
4526
|
+
props: {
|
|
4527
|
+
color: {}
|
|
4528
|
+
},
|
|
4529
|
+
setup(r) {
|
|
4530
|
+
const e = r;
|
|
4531
|
+
return (t, i) => (ue(), Be("svg", du, [
|
|
4532
|
+
K("path", {
|
|
4533
|
+
d: "M10 16.6667V3.33334M10 3.33334L5 8.33334M10 3.33334L15 8.33334",
|
|
4534
|
+
stroke: e.color || "#ffffff",
|
|
4535
|
+
"stroke-width": "1.5",
|
|
4536
|
+
"stroke-linecap": "round",
|
|
4537
|
+
"stroke-linejoin": "round"
|
|
4538
|
+
}, null, 8, _u)
|
|
4539
|
+
]));
|
|
4540
|
+
}
|
|
4541
|
+
}), pu = ["placeholder"], gu = ["disabled"], vu = /* @__PURE__ */ He({
|
|
4542
|
+
__name: "DialogInput",
|
|
4543
|
+
props: {
|
|
4544
|
+
client: {},
|
|
4545
|
+
placeholder: {},
|
|
4546
|
+
productId: {},
|
|
4547
|
+
productTitle: {},
|
|
4548
|
+
selectedVariantId: {}
|
|
4549
|
+
},
|
|
4550
|
+
setup(r) {
|
|
4551
|
+
const e = r, t = Yt(), i = Yt(""), s = () => {
|
|
4552
|
+
var o;
|
|
4553
|
+
(o = t.value) == null || o.focus();
|
|
4554
|
+
}, n = () => {
|
|
4555
|
+
const o = i.value;
|
|
4556
|
+
o.trim() && (e.client.sendProductMessage({
|
|
4557
|
+
productId: e.productId,
|
|
4558
|
+
productTitle: e.productTitle,
|
|
4559
|
+
selectedVariantId: e.selectedVariantId,
|
|
4560
|
+
question: o,
|
|
4561
|
+
fromQuestionSuggestion: !0
|
|
4562
|
+
}), i.value = "");
|
|
4563
|
+
};
|
|
4564
|
+
return (o, a) => (ue(), Be("div", {
|
|
4565
|
+
class: "dialog-input-wrapper",
|
|
4566
|
+
onClick: s
|
|
4567
|
+
}, [
|
|
4568
|
+
Co(K("input", {
|
|
4569
|
+
id: "dialog-ask-anything-input-ai-input",
|
|
4570
|
+
ref_key: "inputRef",
|
|
4571
|
+
ref: t,
|
|
4572
|
+
"onUpdate:modelValue": a[0] || (a[0] = (l) => i.value = l),
|
|
4573
|
+
class: "dialog-ask-anything-input-ai-input",
|
|
4574
|
+
placeholder: e.placeholder ?? "Ask anything...",
|
|
4575
|
+
onKeydown: Io(n, ["enter"])
|
|
4576
|
+
}, null, 40, pu), [
|
|
4577
|
+
[Po, i.value]
|
|
4578
|
+
]),
|
|
4579
|
+
K("button", {
|
|
4580
|
+
id: "send-message-button-ai-input",
|
|
4581
|
+
class: "dialog-input-submit",
|
|
4582
|
+
disabled: !i.value.trim(),
|
|
4583
|
+
onClick: n
|
|
4584
|
+
}, [
|
|
4585
|
+
Jt(hu, {
|
|
4586
|
+
color: e.client.theme.ctaTextColor
|
|
4587
|
+
}, null, 8, ["color"])
|
|
4588
|
+
], 8, gu)
|
|
4589
|
+
]));
|
|
4590
|
+
}
|
|
4591
|
+
}), fu = /* @__PURE__ */ vt(vu, [["__scopeId", "data-v-c5beb945"]]), mu = /* @__PURE__ */ He({
|
|
4519
4592
|
__name: "ThemeProvider",
|
|
4520
4593
|
props: {
|
|
4521
4594
|
theme: {}
|
|
@@ -4524,83 +4597,107 @@ const ru = /* @__PURE__ */ Lt(tu, [["render", iu], ["__scopeId", "data-v-26a64b5
|
|
|
4524
4597
|
const e = r, t = document.body, i = (n) => n.replace(/([A-Z])/g, "-$1").toLowerCase(), s = (n) => {
|
|
4525
4598
|
n && Object.keys(n).forEach((o) => {
|
|
4526
4599
|
const a = o, l = i(o);
|
|
4527
|
-
n[a] !== void 0
|
|
4528
|
-
|
|
4529
|
-
|
|
4530
|
-
|
|
4531
|
-
|
|
4532
|
-
|
|
4533
|
-
|
|
4534
|
-
|
|
4535
|
-
|
|
4600
|
+
if (n[a] !== void 0) {
|
|
4601
|
+
if (typeof n[a] == "object") {
|
|
4602
|
+
Object.keys(n[a]).forEach((c) => {
|
|
4603
|
+
var u;
|
|
4604
|
+
const d = c;
|
|
4605
|
+
if (d !== void 0) {
|
|
4606
|
+
const h = i(c), _ = n[a];
|
|
4607
|
+
t.style.setProperty(
|
|
4608
|
+
`--dialog-theme-${l}-${h}`,
|
|
4609
|
+
(u = _[d]) == null ? void 0 : u.toString()
|
|
4610
|
+
);
|
|
4611
|
+
}
|
|
4612
|
+
});
|
|
4613
|
+
return;
|
|
4614
|
+
}
|
|
4615
|
+
if (a === "ctaBorderType") {
|
|
4616
|
+
const c = n[a] === "rounded" ? "24px" : "0";
|
|
4617
|
+
t.style.setProperty(`--dialog-theme-${l}`, c);
|
|
4618
|
+
return;
|
|
4536
4619
|
}
|
|
4537
|
-
|
|
4538
|
-
|
|
4539
|
-
|
|
4540
|
-
|
|
4620
|
+
t.style.setProperty(
|
|
4621
|
+
`--dialog-theme-${l}`,
|
|
4622
|
+
n[a].toString()
|
|
4623
|
+
);
|
|
4624
|
+
}
|
|
4541
4625
|
});
|
|
4542
4626
|
};
|
|
4543
4627
|
return Zs(() => {
|
|
4544
4628
|
e.theme && s(e.theme);
|
|
4545
|
-
}),
|
|
4629
|
+
}), To(
|
|
4546
4630
|
() => e.theme,
|
|
4547
4631
|
(n) => {
|
|
4548
4632
|
n && s(n);
|
|
4549
4633
|
},
|
|
4550
4634
|
{ deep: !0 }
|
|
4551
|
-
), (n, o) =>
|
|
4635
|
+
), (n, o) => Fo(n.$slots, "default");
|
|
4552
4636
|
}
|
|
4553
|
-
}),
|
|
4637
|
+
}), yu = { class: "dialog-block-container" }, bu = /* @__PURE__ */ He({
|
|
4554
4638
|
__name: "DialogProductBlock",
|
|
4555
4639
|
props: {
|
|
4556
4640
|
client: {},
|
|
4557
4641
|
productId: {},
|
|
4558
4642
|
productTitle: {},
|
|
4559
|
-
selectedVariantId: {}
|
|
4643
|
+
selectedVariantId: { default: void 0 },
|
|
4644
|
+
enableInput: { type: Boolean, default: !0 }
|
|
4560
4645
|
},
|
|
4561
4646
|
setup(r) {
|
|
4562
|
-
const e = r, t =
|
|
4563
|
-
var
|
|
4564
|
-
return (
|
|
4565
|
-
}), n =
|
|
4566
|
-
var
|
|
4567
|
-
return (
|
|
4568
|
-
}), o =
|
|
4647
|
+
const e = r, t = Yt(!0), i = Yt(void 0), s = bi(() => {
|
|
4648
|
+
var l;
|
|
4649
|
+
return (l = i.value) == null ? void 0 : l.assistantName;
|
|
4650
|
+
}), n = bi(() => {
|
|
4651
|
+
var l;
|
|
4652
|
+
return (l = i.value) == null ? void 0 : l.description;
|
|
4653
|
+
}), o = bi(() => {
|
|
4654
|
+
var l;
|
|
4655
|
+
return (l = i.value) == null ? void 0 : l.inputPlaceholder;
|
|
4656
|
+
}), a = async () => {
|
|
4569
4657
|
try {
|
|
4570
|
-
const
|
|
4571
|
-
i.value =
|
|
4572
|
-
} catch (
|
|
4573
|
-
console.error("error",
|
|
4658
|
+
const l = await e.client.getSuggestions(e.productId);
|
|
4659
|
+
i.value = l, t.value = !1;
|
|
4660
|
+
} catch (l) {
|
|
4661
|
+
console.error("error", l);
|
|
4574
4662
|
}
|
|
4575
4663
|
};
|
|
4576
4664
|
return Zs(async () => {
|
|
4577
|
-
await
|
|
4578
|
-
}), (
|
|
4665
|
+
await a();
|
|
4666
|
+
}), (l, c) => (ue(), Kt(mu, {
|
|
4579
4667
|
theme: e.client.theme
|
|
4580
4668
|
}, {
|
|
4581
|
-
default:
|
|
4582
|
-
var
|
|
4669
|
+
default: Ro(() => {
|
|
4670
|
+
var d;
|
|
4583
4671
|
return [
|
|
4584
|
-
|
|
4585
|
-
|
|
4672
|
+
K("div", yu, [
|
|
4673
|
+
Jt(Kl, {
|
|
4586
4674
|
title: s.value,
|
|
4587
4675
|
description: n.value
|
|
4588
4676
|
}, null, 8, ["title", "description"]),
|
|
4589
|
-
|
|
4677
|
+
Jt(cu, {
|
|
4590
4678
|
client: e.client,
|
|
4591
|
-
questions: (
|
|
4679
|
+
questions: (d = i.value) == null ? void 0 : d.questions,
|
|
4592
4680
|
"is-loading": t.value,
|
|
4593
4681
|
"product-id": e.productId,
|
|
4594
4682
|
"product-title": e.productTitle,
|
|
4595
4683
|
"selected-variant-id": e == null ? void 0 : e.selectedVariantId
|
|
4596
|
-
}, null, 8, ["client", "questions", "is-loading", "product-id", "product-title", "selected-variant-id"])
|
|
4684
|
+
}, null, 8, ["client", "questions", "is-loading", "product-id", "product-title", "selected-variant-id"]),
|
|
4685
|
+
e.enableInput ? (ue(), Kt(fu, {
|
|
4686
|
+
key: 0,
|
|
4687
|
+
client: e.client,
|
|
4688
|
+
placeholder: o.value,
|
|
4689
|
+
"product-id": e.productId,
|
|
4690
|
+
"product-title": e.productTitle,
|
|
4691
|
+
"selected-variant-id": e == null ? void 0 : e.selectedVariantId
|
|
4692
|
+
}, null, 8, ["client", "placeholder", "product-id", "product-title", "selected-variant-id"])) : $o("", !0)
|
|
4597
4693
|
])
|
|
4598
4694
|
];
|
|
4599
4695
|
}),
|
|
4600
4696
|
_: 1
|
|
4601
4697
|
}, 8, ["theme"]));
|
|
4602
4698
|
}
|
|
4603
|
-
}),
|
|
4699
|
+
}), Su = /* @__PURE__ */ vt(bu, [["__scopeId", "data-v-6616d39e"]]);
|
|
4604
4700
|
export {
|
|
4605
|
-
|
|
4701
|
+
fu as DialogInput,
|
|
4702
|
+
Su as DialogProductBlock
|
|
4606
4703
|
};
|