@leanbase-giangnd/js 0.3.2 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +788 -85
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.mjs +789 -86
- package/dist/index.mjs.map +1 -1
- package/dist/leanbase.iife.js +2529 -510
- package/dist/leanbase.iife.js.map +1 -1
- package/package.json +2 -1
- package/src/extensions/replay/external/lazy-loaded-session-recorder.ts +89 -15
- package/src/extensions/replay/session-recording.ts +9 -6
- package/src/version.ts +1 -1
package/dist/leanbase.iife.js
CHANGED
|
@@ -313,9 +313,9 @@ var leanbase = (function () {
|
|
|
313
313
|
return '[object Array]' === type_utils_toString.call(obj);
|
|
314
314
|
};
|
|
315
315
|
const isFunction = (x)=>'function' == typeof x;
|
|
316
|
-
const isObject = (x)=>x === Object(x) && !isArray(x);
|
|
316
|
+
const isObject$1 = (x)=>x === Object(x) && !isArray(x);
|
|
317
317
|
const isEmptyObject = (x)=>{
|
|
318
|
-
if (isObject(x)) {
|
|
318
|
+
if (isObject$1(x)) {
|
|
319
319
|
for(const key in x)if (type_utils_hasOwnProperty.call(x, key)) return false;
|
|
320
320
|
return true;
|
|
321
321
|
}
|
|
@@ -329,6 +329,7 @@ var leanbase = (function () {
|
|
|
329
329
|
const isNumber = (x)=>'[object Number]' == type_utils_toString.call(x);
|
|
330
330
|
const isBoolean = (x)=>'[object Boolean]' === type_utils_toString.call(x);
|
|
331
331
|
const isFormData = (x)=>x instanceof FormData;
|
|
332
|
+
const isFile = (x)=>x instanceof File;
|
|
332
333
|
const isPlainError = (x)=>x instanceof Error;
|
|
333
334
|
|
|
334
335
|
function clampToRange(value, min, max, logger, fallbackValue) {
|
|
@@ -1906,7 +1907,7 @@ var leanbase = (function () {
|
|
|
1906
1907
|
|
|
1907
1908
|
/* eslint-disable no-console */
|
|
1908
1909
|
const PREFIX = '[Leanbase]';
|
|
1909
|
-
const logger$
|
|
1910
|
+
const logger$3 = {
|
|
1910
1911
|
info: (...args) => {
|
|
1911
1912
|
if (typeof console !== 'undefined') {
|
|
1912
1913
|
console.log(PREFIX, ...args);
|
|
@@ -2204,7 +2205,7 @@ var leanbase = (function () {
|
|
|
2204
2205
|
if (!matchedSubDomain) {
|
|
2205
2206
|
const originalMatch = originalCookieDomainFn(hostname);
|
|
2206
2207
|
if (originalMatch !== matchedSubDomain) {
|
|
2207
|
-
logger$
|
|
2208
|
+
logger$3.info('Warning: cookie subdomain discovery mismatch', originalMatch, matchedSubDomain);
|
|
2208
2209
|
}
|
|
2209
2210
|
matchedSubDomain = originalMatch;
|
|
2210
2211
|
}
|
|
@@ -2216,7 +2217,7 @@ var leanbase = (function () {
|
|
|
2216
2217
|
const cookieStore = {
|
|
2217
2218
|
_is_supported: () => !!document$1,
|
|
2218
2219
|
_error: function (msg) {
|
|
2219
|
-
logger$
|
|
2220
|
+
logger$3.error('cookieStore error: ' + msg);
|
|
2220
2221
|
},
|
|
2221
2222
|
_get: function (name) {
|
|
2222
2223
|
if (!document$1) {
|
|
@@ -2265,7 +2266,7 @@ var leanbase = (function () {
|
|
|
2265
2266
|
const new_cookie_val = name + '=' + encodeURIComponent(JSON.stringify(value)) + expires + '; SameSite=Lax; path=/' + cdomain + secure;
|
|
2266
2267
|
// 4096 bytes is the size at which some browsers (e.g. firefox) will not store a cookie, warn slightly before that
|
|
2267
2268
|
if (new_cookie_val.length > 4096 * 0.9) {
|
|
2268
|
-
logger$
|
|
2269
|
+
logger$3.warn('cookieStore warning: large cookie, len=' + new_cookie_val.length);
|
|
2269
2270
|
}
|
|
2270
2271
|
document$1.cookie = new_cookie_val;
|
|
2271
2272
|
return new_cookie_val;
|
|
@@ -2307,13 +2308,13 @@ var leanbase = (function () {
|
|
|
2307
2308
|
supported = false;
|
|
2308
2309
|
}
|
|
2309
2310
|
if (!supported) {
|
|
2310
|
-
logger$
|
|
2311
|
+
logger$3.error('localStorage unsupported; falling back to cookie store');
|
|
2311
2312
|
}
|
|
2312
2313
|
_localStorage_supported = supported;
|
|
2313
2314
|
return supported;
|
|
2314
2315
|
},
|
|
2315
2316
|
_error: function (msg) {
|
|
2316
|
-
logger$
|
|
2317
|
+
logger$3.error('localStorage error: ' + msg);
|
|
2317
2318
|
},
|
|
2318
2319
|
_get: function (name) {
|
|
2319
2320
|
try {
|
|
@@ -2399,7 +2400,7 @@ var leanbase = (function () {
|
|
|
2399
2400
|
return true;
|
|
2400
2401
|
},
|
|
2401
2402
|
_error: function (msg) {
|
|
2402
|
-
logger$
|
|
2403
|
+
logger$3.error('memoryStorage error: ' + msg);
|
|
2403
2404
|
},
|
|
2404
2405
|
_get: function (name) {
|
|
2405
2406
|
return memoryStorage[name] || null;
|
|
@@ -2440,7 +2441,7 @@ var leanbase = (function () {
|
|
|
2440
2441
|
return sessionStorageSupported;
|
|
2441
2442
|
},
|
|
2442
2443
|
_error: function (msg) {
|
|
2443
|
-
logger$
|
|
2444
|
+
logger$3.error('sessionStorage error: ', msg);
|
|
2444
2445
|
},
|
|
2445
2446
|
_get: function (name) {
|
|
2446
2447
|
try {
|
|
@@ -2489,6 +2490,21 @@ var leanbase = (function () {
|
|
|
2489
2490
|
location.href = url;
|
|
2490
2491
|
return location;
|
|
2491
2492
|
};
|
|
2493
|
+
const formDataToQuery = function (formdata, arg_separator = '&') {
|
|
2494
|
+
let use_val;
|
|
2495
|
+
let use_key;
|
|
2496
|
+
const tph_arr = [];
|
|
2497
|
+
each(formdata, function (val, key) {
|
|
2498
|
+
// the key might be literally the string undefined for e.g. if {undefined: 'something'}
|
|
2499
|
+
if (isUndefined(val) || isUndefined(key) || key === 'undefined') {
|
|
2500
|
+
return;
|
|
2501
|
+
}
|
|
2502
|
+
use_val = encodeURIComponent(isFile(val) ? val.name : val.toString());
|
|
2503
|
+
use_key = encodeURIComponent(key);
|
|
2504
|
+
tph_arr[tph_arr.length] = use_key + '=' + use_val;
|
|
2505
|
+
});
|
|
2506
|
+
return tph_arr.join(arg_separator);
|
|
2507
|
+
};
|
|
2492
2508
|
// NOTE: Once we get rid of IE11/op_mini we can start using URLSearchParams
|
|
2493
2509
|
const getQueryParam = function (url, param) {
|
|
2494
2510
|
const withoutHash = url.split('#')[0] || '';
|
|
@@ -2512,7 +2528,7 @@ var leanbase = (function () {
|
|
|
2512
2528
|
try {
|
|
2513
2529
|
result = decodeURIComponent(result);
|
|
2514
2530
|
} catch {
|
|
2515
|
-
logger$
|
|
2531
|
+
logger$3.error('Skipping decoding for malformed query param: ' + result);
|
|
2516
2532
|
}
|
|
2517
2533
|
return result.replace(/\+/g, ' ');
|
|
2518
2534
|
}
|
|
@@ -2846,7 +2862,7 @@ var leanbase = (function () {
|
|
|
2846
2862
|
}
|
|
2847
2863
|
};
|
|
2848
2864
|
|
|
2849
|
-
var version = "0.
|
|
2865
|
+
var version = "0.4.0";
|
|
2850
2866
|
var packageInfo = {
|
|
2851
2867
|
version: version};
|
|
2852
2868
|
|
|
@@ -3111,7 +3127,7 @@ var leanbase = (function () {
|
|
|
3111
3127
|
this._storage = this._buildStorage(config);
|
|
3112
3128
|
this.load();
|
|
3113
3129
|
if (config.debug) {
|
|
3114
|
-
logger$
|
|
3130
|
+
logger$3.info('Persistence loaded', config['persistence'], {
|
|
3115
3131
|
...this.props
|
|
3116
3132
|
});
|
|
3117
3133
|
}
|
|
@@ -3127,7 +3143,7 @@ var leanbase = (function () {
|
|
|
3127
3143
|
}
|
|
3128
3144
|
_buildStorage(config) {
|
|
3129
3145
|
if (CASE_INSENSITIVE_PERSISTENCE_TYPES.indexOf(config['persistence'].toLowerCase()) === -1) {
|
|
3130
|
-
logger$
|
|
3146
|
+
logger$3.info('Unknown persistence type ' + config['persistence'] + '; falling back to localStorage+cookie');
|
|
3131
3147
|
config['persistence'] = 'localStorage+cookie';
|
|
3132
3148
|
}
|
|
3133
3149
|
let store;
|
|
@@ -3153,7 +3169,7 @@ var leanbase = (function () {
|
|
|
3153
3169
|
const p = {};
|
|
3154
3170
|
// Filter out reserved properties
|
|
3155
3171
|
each(this.props, function (v, k) {
|
|
3156
|
-
if (k === ENABLED_FEATURE_FLAGS && isObject(v)) {
|
|
3172
|
+
if (k === ENABLED_FEATURE_FLAGS && isObject$1(v)) {
|
|
3157
3173
|
const keys = Object.keys(v);
|
|
3158
3174
|
for (let i = 0; i < keys.length; i++) {
|
|
3159
3175
|
p[`$feature/${keys[i]}`] = v[keys[i]];
|
|
@@ -3198,7 +3214,7 @@ var leanbase = (function () {
|
|
|
3198
3214
|
* @param {number=} days
|
|
3199
3215
|
*/
|
|
3200
3216
|
register_once(props, default_value, days) {
|
|
3201
|
-
if (isObject(props)) {
|
|
3217
|
+
if (isObject$1(props)) {
|
|
3202
3218
|
if (isUndefined(default_value)) {
|
|
3203
3219
|
default_value = 'None';
|
|
3204
3220
|
}
|
|
@@ -3222,7 +3238,7 @@ var leanbase = (function () {
|
|
|
3222
3238
|
* @param {number=} days
|
|
3223
3239
|
*/
|
|
3224
3240
|
register(props, days) {
|
|
3225
|
-
if (isObject(props)) {
|
|
3241
|
+
if (isObject$1(props)) {
|
|
3226
3242
|
this._expire_days = isUndefined(days) ? this._default_expiry : days;
|
|
3227
3243
|
let hasChanges = false;
|
|
3228
3244
|
each(props, (val, prop) => {
|
|
@@ -3763,7 +3779,7 @@ var leanbase = (function () {
|
|
|
3763
3779
|
text = `${text} ${getNestedSpanText(child)}`.trim();
|
|
3764
3780
|
}
|
|
3765
3781
|
} catch (e) {
|
|
3766
|
-
logger$
|
|
3782
|
+
logger$3.error('[AutoCapture]', e);
|
|
3767
3783
|
}
|
|
3768
3784
|
}
|
|
3769
3785
|
});
|
|
@@ -4057,7 +4073,7 @@ var leanbase = (function () {
|
|
|
4057
4073
|
this._elementSelectors = null;
|
|
4058
4074
|
}
|
|
4059
4075
|
get _config() {
|
|
4060
|
-
const config = isObject(this.instance.config.autocapture) ? this.instance.config.autocapture : {};
|
|
4076
|
+
const config = isObject$1(this.instance.config.autocapture) ? this.instance.config.autocapture : {};
|
|
4061
4077
|
// precompile the regex
|
|
4062
4078
|
config.url_allowlist = config.url_allowlist?.map(url => new RegExp(url));
|
|
4063
4079
|
config.url_ignorelist = config.url_ignorelist?.map(url => new RegExp(url));
|
|
@@ -4065,7 +4081,7 @@ var leanbase = (function () {
|
|
|
4065
4081
|
}
|
|
4066
4082
|
_addDomEventHandlers() {
|
|
4067
4083
|
if (!this.isBrowserSupported()) {
|
|
4068
|
-
logger$
|
|
4084
|
+
logger$3.info('Disabling Automatic Event Collection because this browser is not supported');
|
|
4069
4085
|
return;
|
|
4070
4086
|
}
|
|
4071
4087
|
if (!win || !document$1) {
|
|
@@ -4076,7 +4092,7 @@ var leanbase = (function () {
|
|
|
4076
4092
|
try {
|
|
4077
4093
|
this._captureEvent(e);
|
|
4078
4094
|
} catch (error) {
|
|
4079
|
-
logger$
|
|
4095
|
+
logger$3.error('Failed to capture event', error);
|
|
4080
4096
|
}
|
|
4081
4097
|
};
|
|
4082
4098
|
addEventListener(document$1, 'submit', handler, {
|
|
@@ -4261,7 +4277,7 @@ var leanbase = (function () {
|
|
|
4261
4277
|
this._windowIdGenerator = windowIdGenerator || uuidv7;
|
|
4262
4278
|
const persistenceName = this._config['persistence_name'] || this._config['token'];
|
|
4263
4279
|
const desiredTimeout = this._config['session_idle_timeout_seconds'] || DEFAULT_SESSION_IDLE_TIMEOUT_SECONDS;
|
|
4264
|
-
this._sessionTimeoutMs = clampToRange(desiredTimeout, MIN_SESSION_IDLE_TIMEOUT_SECONDS, MAX_SESSION_IDLE_TIMEOUT_SECONDS, logger$
|
|
4280
|
+
this._sessionTimeoutMs = clampToRange(desiredTimeout, MIN_SESSION_IDLE_TIMEOUT_SECONDS, MAX_SESSION_IDLE_TIMEOUT_SECONDS, logger$3, DEFAULT_SESSION_IDLE_TIMEOUT_SECONDS) * 1000;
|
|
4265
4281
|
instance.register({
|
|
4266
4282
|
$configured_session_timeout_ms: this._sessionTimeoutMs
|
|
4267
4283
|
});
|
|
@@ -4288,7 +4304,7 @@ var leanbase = (function () {
|
|
|
4288
4304
|
const sessionStartTimestamp = uuid7ToTimestampMs(this._config.bootstrap.sessionID);
|
|
4289
4305
|
this._setSessionId(this._config.bootstrap.sessionID, new Date().getTime(), sessionStartTimestamp);
|
|
4290
4306
|
} catch (e) {
|
|
4291
|
-
logger$
|
|
4307
|
+
logger$3.error('Invalid sessionID in bootstrap', e);
|
|
4292
4308
|
}
|
|
4293
4309
|
}
|
|
4294
4310
|
this._listenToReloadWindow();
|
|
@@ -4429,7 +4445,7 @@ var leanbase = (function () {
|
|
|
4429
4445
|
if (noSessionId || activityTimeout || sessionPastMaximumLength) {
|
|
4430
4446
|
sessionId = this._sessionIdGenerator();
|
|
4431
4447
|
windowId = this._windowIdGenerator();
|
|
4432
|
-
logger$
|
|
4448
|
+
logger$3.info('new session ID generated', {
|
|
4433
4449
|
sessionId,
|
|
4434
4450
|
windowId,
|
|
4435
4451
|
changeReason: {
|
|
@@ -4618,10 +4634,10 @@ var leanbase = (function () {
|
|
|
4618
4634
|
lastContentY = Math.ceil(lastContentY);
|
|
4619
4635
|
maxContentY = Math.ceil(maxContentY);
|
|
4620
4636
|
// if the maximum scroll height is near 0, then the percentage is 1
|
|
4621
|
-
const lastScrollPercentage = maxScrollHeight <= 1 ? 1 : clampToRange(lastScrollY / maxScrollHeight, 0, 1, logger$
|
|
4622
|
-
const maxScrollPercentage = maxScrollHeight <= 1 ? 1 : clampToRange(maxScrollY / maxScrollHeight, 0, 1, logger$
|
|
4623
|
-
const lastContentPercentage = maxContentHeight <= 1 ? 1 : clampToRange(lastContentY / maxContentHeight, 0, 1, logger$
|
|
4624
|
-
const maxContentPercentage = maxContentHeight <= 1 ? 1 : clampToRange(maxContentY / maxContentHeight, 0, 1, logger$
|
|
4637
|
+
const lastScrollPercentage = maxScrollHeight <= 1 ? 1 : clampToRange(lastScrollY / maxScrollHeight, 0, 1, logger$3);
|
|
4638
|
+
const maxScrollPercentage = maxScrollHeight <= 1 ? 1 : clampToRange(maxScrollY / maxScrollHeight, 0, 1, logger$3);
|
|
4639
|
+
const lastContentPercentage = maxContentHeight <= 1 ? 1 : clampToRange(lastContentY / maxContentHeight, 0, 1, logger$3);
|
|
4640
|
+
const maxContentPercentage = maxContentHeight <= 1 ? 1 : clampToRange(maxContentY / maxContentHeight, 0, 1, logger$3);
|
|
4625
4641
|
properties = extend(properties, {
|
|
4626
4642
|
$prev_pageview_last_scroll: lastScrollY,
|
|
4627
4643
|
$prev_pageview_last_scroll_percentage: lastScrollPercentage,
|
|
@@ -4886,17 +4902,17 @@ var leanbase = (function () {
|
|
|
4886
4902
|
|
|
4887
4903
|
const _createLogger = prefix => {
|
|
4888
4904
|
return {
|
|
4889
|
-
info: (...args) => logger$
|
|
4890
|
-
warn: (...args) => logger$
|
|
4891
|
-
error: (...args) => logger$
|
|
4892
|
-
critical: (...args) => logger$
|
|
4905
|
+
info: (...args) => logger$3.info(prefix, ...args),
|
|
4906
|
+
warn: (...args) => logger$3.warn(prefix, ...args),
|
|
4907
|
+
error: (...args) => logger$3.error(prefix, ...args),
|
|
4908
|
+
critical: (...args) => logger$3.critical(prefix, ...args),
|
|
4893
4909
|
uninitializedWarning: methodName => {
|
|
4894
|
-
logger$
|
|
4910
|
+
logger$3.error(prefix, `You must initialize Leanbase before calling ${methodName}`);
|
|
4895
4911
|
},
|
|
4896
4912
|
createLogger: additionalPrefix => _createLogger(`${prefix} ${additionalPrefix}`)
|
|
4897
4913
|
};
|
|
4898
4914
|
};
|
|
4899
|
-
const logger$
|
|
4915
|
+
const logger$2 = _createLogger('[Leanbase]');
|
|
4900
4916
|
const createLogger = _createLogger;
|
|
4901
4917
|
|
|
4902
4918
|
const LOGGER_PREFIX$2 = '[SessionRecording]';
|
|
@@ -4970,7 +4986,7 @@ var leanbase = (function () {
|
|
|
4970
4986
|
// people can have arbitrarily large payloads on their site, but we don't want to ingest them
|
|
4971
4987
|
const limitPayloadSize = options => {
|
|
4972
4988
|
// the smallest of 1MB or the specified limit if there is one
|
|
4973
|
-
const limit = Math.min(1000000, options.payloadSizeLimitBytes);
|
|
4989
|
+
const limit = Math.min(1000000, options.payloadSizeLimitBytes ?? 1000000);
|
|
4974
4990
|
return data => {
|
|
4975
4991
|
if (data?.requestBody) {
|
|
4976
4992
|
data.requestBody = enforcePayloadSizeLimit(data.requestBody, data.requestHeaders, limit, 'Request');
|
|
@@ -5028,7 +5044,7 @@ var leanbase = (function () {
|
|
|
5028
5044
|
const enforcedCleaningFn = d => payloadLimiter(ignorePostHogPaths(removeAuthorizationHeader(d), instanceConfig.host || ''));
|
|
5029
5045
|
const hasDeprecatedMaskFunction = isFunction(sessionRecordingConfig.maskNetworkRequestFn);
|
|
5030
5046
|
if (hasDeprecatedMaskFunction && isFunction(sessionRecordingConfig.maskCapturedNetworkRequestFn)) {
|
|
5031
|
-
logger$
|
|
5047
|
+
logger$2.warn('Both `maskNetworkRequestFn` and `maskCapturedNetworkRequestFn` are defined. `maskNetworkRequestFn` will be ignored.');
|
|
5032
5048
|
}
|
|
5033
5049
|
if (hasDeprecatedMaskFunction) {
|
|
5034
5050
|
sessionRecordingConfig.maskCapturedNetworkRequestFn = data => {
|
|
@@ -5136,8 +5152,8 @@ var leanbase = (function () {
|
|
|
5136
5152
|
this.urlBlocked = false;
|
|
5137
5153
|
}
|
|
5138
5154
|
onConfig(config) {
|
|
5139
|
-
this._urlTriggers = (isEagerLoadedConfig(config) ? isObject(config.sessionRecording) ? config.sessionRecording?.urlTriggers : [] : config?.urlTriggers) || [];
|
|
5140
|
-
this._urlBlocklist = (isEagerLoadedConfig(config) ? isObject(config.sessionRecording) ? config.sessionRecording?.urlBlocklist : [] : config?.urlBlocklist) || [];
|
|
5155
|
+
this._urlTriggers = (isEagerLoadedConfig(config) ? isObject$1(config.sessionRecording) ? config.sessionRecording?.urlTriggers : [] : config?.urlTriggers) || [];
|
|
5156
|
+
this._urlBlocklist = (isEagerLoadedConfig(config) ? isObject$1(config.sessionRecording) ? config.sessionRecording?.urlBlocklist : [] : config?.urlBlocklist) || [];
|
|
5141
5157
|
}
|
|
5142
5158
|
/**
|
|
5143
5159
|
* @deprecated Use onConfig instead
|
|
@@ -5206,12 +5222,12 @@ var leanbase = (function () {
|
|
|
5206
5222
|
return result;
|
|
5207
5223
|
}
|
|
5208
5224
|
onConfig(config, onStarted) {
|
|
5209
|
-
this.linkedFlag = (isEagerLoadedConfig(config) ? isObject(config.sessionRecording) ? config.sessionRecording?.linkedFlag : null : config?.linkedFlag) || null;
|
|
5225
|
+
this.linkedFlag = (isEagerLoadedConfig(config) ? isObject$1(config.sessionRecording) ? config.sessionRecording?.linkedFlag : null : config?.linkedFlag) || null;
|
|
5210
5226
|
if (!isNullish(this.linkedFlag) && !this.linkedFlagSeen) {
|
|
5211
5227
|
const linkedFlag = isString(this.linkedFlag) ? this.linkedFlag : this.linkedFlag.flag;
|
|
5212
5228
|
const linkedVariant = isString(this.linkedFlag) ? null : this.linkedFlag.variant;
|
|
5213
5229
|
this._flagListenerCleanup = this._instance.onFeatureFlags(flags => {
|
|
5214
|
-
const flagIsPresent = isObject(flags) && linkedFlag in flags;
|
|
5230
|
+
const flagIsPresent = isObject$1(flags) && linkedFlag in flags;
|
|
5215
5231
|
let linkedFlagMatches = false;
|
|
5216
5232
|
if (flagIsPresent) {
|
|
5217
5233
|
const variantForFlagKey = flags[linkedFlag];
|
|
@@ -5247,7 +5263,7 @@ var leanbase = (function () {
|
|
|
5247
5263
|
this._eventTriggers = [];
|
|
5248
5264
|
}
|
|
5249
5265
|
onConfig(config) {
|
|
5250
|
-
this._eventTriggers = (isEagerLoadedConfig(config) ? isObject(config.sessionRecording) ? config.sessionRecording?.eventTriggers : [] : config?.eventTriggers) || [];
|
|
5266
|
+
this._eventTriggers = (isEagerLoadedConfig(config) ? isObject$1(config.sessionRecording) ? config.sessionRecording?.eventTriggers : [] : config?.eventTriggers) || [];
|
|
5251
5267
|
}
|
|
5252
5268
|
/**
|
|
5253
5269
|
* @deprecated Use onConfig instead
|
|
@@ -5346,7 +5362,7 @@ var leanbase = (function () {
|
|
|
5346
5362
|
function circularReferenceReplacer() {
|
|
5347
5363
|
const ancestors = [];
|
|
5348
5364
|
return function (_key, value) {
|
|
5349
|
-
if (isObject(value)) {
|
|
5365
|
+
if (isObject$1(value)) {
|
|
5350
5366
|
// `this` is the object that value is contained in,
|
|
5351
5367
|
// i.e., its direct parent.
|
|
5352
5368
|
while (ancestors.length > 0 && ancestors[ancestors.length - 1] !== this) {
|
|
@@ -5377,7 +5393,7 @@ var leanbase = (function () {
|
|
|
5377
5393
|
const event = _event;
|
|
5378
5394
|
const MAX_STRING_SIZE = 2000; // Maximum number of characters allowed in a string
|
|
5379
5395
|
const MAX_STRINGS_PER_LOG = 10; // A log can consist of multiple strings (e.g. consol.log('string1', 'string2'))
|
|
5380
|
-
if (event && isObject(event) && event.type === PLUGIN_EVENT_TYPE && isObject(event.data) && event.data.plugin === CONSOLE_LOG_PLUGIN_NAME) {
|
|
5396
|
+
if (event && isObject$1(event) && event.type === PLUGIN_EVENT_TYPE && isObject$1(event.data) && event.data.plugin === CONSOLE_LOG_PLUGIN_NAME) {
|
|
5381
5397
|
// Note: event.data.payload.payload comes from rr-web, and is an array of strings
|
|
5382
5398
|
if (event.data.payload.payload.length > MAX_STRINGS_PER_LOG) {
|
|
5383
5399
|
event.data.payload.payload = event.data.payload.payload.slice(0, MAX_STRINGS_PER_LOG);
|
|
@@ -5441,7 +5457,7 @@ var leanbase = (function () {
|
|
|
5441
5457
|
}
|
|
5442
5458
|
return [b, r];
|
|
5443
5459
|
};
|
|
5444
|
-
var _a$
|
|
5460
|
+
var _a$2 = freb(fleb, 2), fl = _a$2[0], revfl = _a$2[1];
|
|
5445
5461
|
// we can ignore the fact that the other numbers are wrong; they never happen anyway
|
|
5446
5462
|
fl[28] = 258, revfl[258] = 28;
|
|
5447
5463
|
var _b = freb(fdeb, 0), revfd = _b[1];
|
|
@@ -6059,7 +6075,7 @@ var leanbase = (function () {
|
|
|
6059
6075
|
refillInterval: 1000,
|
|
6060
6076
|
// one second
|
|
6061
6077
|
_onBucketRateLimited: this._onNodeRateLimited,
|
|
6062
|
-
_logger: logger$
|
|
6078
|
+
_logger: logger$2
|
|
6063
6079
|
});
|
|
6064
6080
|
}
|
|
6065
6081
|
reset() {
|
|
@@ -6083,7 +6099,7 @@ var leanbase = (function () {
|
|
|
6083
6099
|
* receives percent as a number between 0 and 1
|
|
6084
6100
|
*/
|
|
6085
6101
|
function sampleOnProperty(prop, percent) {
|
|
6086
|
-
return simpleHash(prop) % 100 < clampToRange(percent * 100, 0, 100, logger$
|
|
6102
|
+
return simpleHash(prop) % 100 < clampToRange(percent * 100, 0, 100, logger$2);
|
|
6087
6103
|
}
|
|
6088
6104
|
|
|
6089
6105
|
/* eslint-disable posthog-js/no-direct-function-check */
|
|
@@ -6114,7 +6130,7 @@ var leanbase = (function () {
|
|
|
6114
6130
|
const RECORDING_BUFFER_TIMEOUT = 2000; // 2 seconds
|
|
6115
6131
|
const SESSION_RECORDING_BATCH_KEY = 'recordings';
|
|
6116
6132
|
const LOGGER_PREFIX$1 = '[SessionRecording]';
|
|
6117
|
-
const logger = createLogger(LOGGER_PREFIX$1);
|
|
6133
|
+
const logger$1 = createLogger(LOGGER_PREFIX$1);
|
|
6118
6134
|
const ACTIVE_SOURCES = [IncrementalSource$1.MouseMove, IncrementalSource$1.MouseInteraction, IncrementalSource$1.Scroll, IncrementalSource$1.ViewportResize, IncrementalSource$1.Input, IncrementalSource$1.TouchMove, IncrementalSource$1.MediaInteraction, IncrementalSource$1.Drag];
|
|
6119
6135
|
const newQueuedEvent = rrwebMethod => ({
|
|
6120
6136
|
rrwebMethod,
|
|
@@ -6163,7 +6179,7 @@ var leanbase = (function () {
|
|
|
6163
6179
|
return rr;
|
|
6164
6180
|
}
|
|
6165
6181
|
} catch (e) {
|
|
6166
|
-
logger.error('could not dynamically load rrweb', e);
|
|
6182
|
+
logger$1.error('could not dynamically load rrweb', e);
|
|
6167
6183
|
}
|
|
6168
6184
|
return null;
|
|
6169
6185
|
}
|
|
@@ -6210,7 +6226,7 @@ var leanbase = (function () {
|
|
|
6210
6226
|
};
|
|
6211
6227
|
}
|
|
6212
6228
|
} catch (e) {
|
|
6213
|
-
logger.error('could not compress event - will use uncompressed event', e);
|
|
6229
|
+
logger$1.error('could not compress event - will use uncompressed event', e);
|
|
6214
6230
|
}
|
|
6215
6231
|
return event;
|
|
6216
6232
|
}
|
|
@@ -6247,6 +6263,11 @@ var leanbase = (function () {
|
|
|
6247
6263
|
}
|
|
6248
6264
|
}
|
|
6249
6265
|
class LazyLoadedSessionRecording {
|
|
6266
|
+
_debug(...args) {
|
|
6267
|
+
if (this._instance?.config?.debug) {
|
|
6268
|
+
logger$1.info(...args);
|
|
6269
|
+
}
|
|
6270
|
+
}
|
|
6250
6271
|
get sessionId() {
|
|
6251
6272
|
return this._sessionId;
|
|
6252
6273
|
}
|
|
@@ -6261,9 +6282,9 @@ var leanbase = (function () {
|
|
|
6261
6282
|
if (!this._loggedPermanentlyDisabled) {
|
|
6262
6283
|
this._loggedPermanentlyDisabled = true;
|
|
6263
6284
|
if (error) {
|
|
6264
|
-
logger.error(`replay disabled: ${reason}`, error);
|
|
6285
|
+
logger$1.error(`replay disabled: ${reason}`, error);
|
|
6265
6286
|
} else {
|
|
6266
|
-
logger.error(`replay disabled: ${reason}`);
|
|
6287
|
+
logger$1.error(`replay disabled: ${reason}`);
|
|
6267
6288
|
}
|
|
6268
6289
|
}
|
|
6269
6290
|
}
|
|
@@ -6363,7 +6384,7 @@ var leanbase = (function () {
|
|
|
6363
6384
|
this._eventTriggerMatching = new EventTriggerMatching(this._instance);
|
|
6364
6385
|
this._buffer = this._clearBuffer();
|
|
6365
6386
|
if (this._sessionIdleThresholdMilliseconds >= this._sessionManager.sessionTimeoutMs) {
|
|
6366
|
-
logger.warn(`session_idle_threshold_ms (${this._sessionIdleThresholdMilliseconds}) is greater than the session timeout (${this._sessionManager.sessionTimeoutMs}). Session will never be detected as idle`);
|
|
6387
|
+
logger$1.warn(`session_idle_threshold_ms (${this._sessionIdleThresholdMilliseconds}) is greater than the session timeout (${this._sessionManager.sessionTimeoutMs}). Session will never be detected as idle`);
|
|
6367
6388
|
}
|
|
6368
6389
|
}
|
|
6369
6390
|
get _masking() {
|
|
@@ -6414,12 +6435,12 @@ var leanbase = (function () {
|
|
|
6414
6435
|
const headersOptIn = networkPayloadCapture_client_side?.recordHeaders === true;
|
|
6415
6436
|
const bodyOptIn = networkPayloadCapture_client_side?.recordBody === true;
|
|
6416
6437
|
const clientPerformanceConfig = this._instance.config.capture_performance;
|
|
6417
|
-
const clientPerformanceOptIn = isObject(clientPerformanceConfig) ? !!clientPerformanceConfig.network_timing : !!clientPerformanceConfig;
|
|
6438
|
+
const clientPerformanceOptIn = isObject$1(clientPerformanceConfig) ? !!clientPerformanceConfig.network_timing : !!clientPerformanceConfig;
|
|
6418
6439
|
const serverAllowsHeaders = networkPayloadCapture_server_side?.recordHeaders ?? true;
|
|
6419
6440
|
const serverAllowsBody = networkPayloadCapture_server_side?.recordBody ?? true;
|
|
6420
6441
|
const capturePerfResponse = networkPayloadCapture_server_side?.capturePerformance;
|
|
6421
6442
|
const serverAllowsPerformance = (() => {
|
|
6422
|
-
if (isObject(capturePerfResponse)) {
|
|
6443
|
+
if (isObject$1(capturePerfResponse)) {
|
|
6423
6444
|
return !!capturePerfResponse.network_timing;
|
|
6424
6445
|
}
|
|
6425
6446
|
return capturePerfResponse ?? true;
|
|
@@ -6437,25 +6458,62 @@ var leanbase = (function () {
|
|
|
6437
6458
|
payloadHostDenyList: networkPayloadCapture_server_side?.payloadHostDenyList
|
|
6438
6459
|
};
|
|
6439
6460
|
}
|
|
6440
|
-
|
|
6461
|
+
async _loadConsolePlugin() {
|
|
6462
|
+
try {
|
|
6463
|
+
const mod = await Promise.resolve().then(function () { return rrwebPluginConsoleRecord; });
|
|
6464
|
+
const factory = mod?.getRecordConsolePlugin ?? mod?.default?.getRecordConsolePlugin;
|
|
6465
|
+
if (typeof factory === 'function') {
|
|
6466
|
+
const plugin = factory();
|
|
6467
|
+
this._debug('Console plugin loaded');
|
|
6468
|
+
return plugin;
|
|
6469
|
+
}
|
|
6470
|
+
logger$1.warn('console plugin factory unavailable after import');
|
|
6471
|
+
} catch (e) {
|
|
6472
|
+
logger$1.warn('could not load console plugin', e);
|
|
6473
|
+
}
|
|
6474
|
+
return null;
|
|
6475
|
+
}
|
|
6476
|
+
async _loadNetworkPlugin(networkPayloadCapture) {
|
|
6477
|
+
try {
|
|
6478
|
+
const mod = await Promise.resolve().then(function () { return networkPlugin; });
|
|
6479
|
+
const factory = mod?.getRecordNetworkPlugin ?? mod?.default?.getRecordNetworkPlugin;
|
|
6480
|
+
if (typeof factory === 'function') {
|
|
6481
|
+
const options = buildNetworkRequestOptions(this._instance.config, networkPayloadCapture);
|
|
6482
|
+
const plugin = factory(options);
|
|
6483
|
+
this._debug('Network plugin loaded');
|
|
6484
|
+
return plugin;
|
|
6485
|
+
}
|
|
6486
|
+
logger$1.warn('network plugin factory unavailable after import');
|
|
6487
|
+
} catch (e) {
|
|
6488
|
+
logger$1.warn('could not load network plugin', e);
|
|
6489
|
+
}
|
|
6490
|
+
return null;
|
|
6491
|
+
}
|
|
6492
|
+
async _gatherRRWebPlugins() {
|
|
6441
6493
|
const plugins = [];
|
|
6494
|
+
if (!win) {
|
|
6495
|
+
return plugins;
|
|
6496
|
+
}
|
|
6442
6497
|
if (this._isConsoleLogCaptureEnabled) {
|
|
6443
|
-
|
|
6498
|
+
const consolePlugin = await this._loadConsolePlugin();
|
|
6499
|
+
if (consolePlugin) {
|
|
6500
|
+
plugins.push(consolePlugin);
|
|
6501
|
+
}
|
|
6444
6502
|
}
|
|
6445
6503
|
if (this._networkPayloadCapture) {
|
|
6446
6504
|
const canRecordNetwork = !isLocalhost() || this._forceAllowLocalhostNetworkCapture;
|
|
6447
6505
|
if (canRecordNetwork) {
|
|
6448
|
-
const
|
|
6449
|
-
|
|
6450
|
-
|
|
6451
|
-
plugins.push(networkFactory(buildNetworkRequestOptions(this._instance.config, this._networkPayloadCapture)));
|
|
6452
|
-
} else {
|
|
6453
|
-
logger.info('Network plugin factory not available yet; skipping network plugin');
|
|
6506
|
+
const networkPlugin = await this._loadNetworkPlugin(this._networkPayloadCapture);
|
|
6507
|
+
if (networkPlugin) {
|
|
6508
|
+
plugins.push(networkPlugin);
|
|
6454
6509
|
}
|
|
6455
6510
|
} else {
|
|
6456
|
-
|
|
6511
|
+
this._debug('NetworkCapture not started because we are on localhost.');
|
|
6457
6512
|
}
|
|
6458
6513
|
}
|
|
6514
|
+
if (plugins.length > 0) {
|
|
6515
|
+
this._debug('Replay plugins loaded', plugins.map(p => p.name));
|
|
6516
|
+
}
|
|
6459
6517
|
return plugins;
|
|
6460
6518
|
}
|
|
6461
6519
|
_maskUrl(url) {
|
|
@@ -6484,7 +6542,7 @@ var leanbase = (function () {
|
|
|
6484
6542
|
rrwebMethod: queuedRRWebEvent.rrwebMethod
|
|
6485
6543
|
});
|
|
6486
6544
|
} else {
|
|
6487
|
-
logger.warn('could not emit queued rrweb event.', e, queuedRRWebEvent);
|
|
6545
|
+
logger$1.warn('could not emit queued rrweb event.', e, queuedRRWebEvent);
|
|
6488
6546
|
}
|
|
6489
6547
|
return false;
|
|
6490
6548
|
}
|
|
@@ -6596,7 +6654,7 @@ var leanbase = (function () {
|
|
|
6596
6654
|
this._urlTriggerMatching.urlBlocked = true;
|
|
6597
6655
|
// Clear the snapshot timer since we don't want new snapshots while paused
|
|
6598
6656
|
clearInterval(this._fullSnapshotTimer);
|
|
6599
|
-
logger.info('recording paused due to URL blocker');
|
|
6657
|
+
logger$1.info('recording paused due to URL blocker');
|
|
6600
6658
|
this._tryAddCustomEvent('recording paused', {
|
|
6601
6659
|
reason: 'url blocker'
|
|
6602
6660
|
});
|
|
@@ -6615,7 +6673,7 @@ var leanbase = (function () {
|
|
|
6615
6673
|
this._tryAddCustomEvent('recording resumed', {
|
|
6616
6674
|
reason: 'left blocked url'
|
|
6617
6675
|
});
|
|
6618
|
-
logger.info('recording resumed');
|
|
6676
|
+
logger$1.info('recording resumed');
|
|
6619
6677
|
}
|
|
6620
6678
|
_activateTrigger(triggerType) {
|
|
6621
6679
|
if (!this.isStarted || !this._recording || !this._isFullyReady) {
|
|
@@ -6638,7 +6696,7 @@ var leanbase = (function () {
|
|
|
6638
6696
|
if (!persistedConfig) {
|
|
6639
6697
|
return undefined;
|
|
6640
6698
|
}
|
|
6641
|
-
const parsedConfig = isObject(persistedConfig) ? persistedConfig : JSON.parse(persistedConfig);
|
|
6699
|
+
const parsedConfig = isObject$1(persistedConfig) ? persistedConfig : JSON.parse(persistedConfig);
|
|
6642
6700
|
return parsedConfig;
|
|
6643
6701
|
}
|
|
6644
6702
|
async start(startReason) {
|
|
@@ -6648,7 +6706,7 @@ var leanbase = (function () {
|
|
|
6648
6706
|
this._isFullyReady = false;
|
|
6649
6707
|
const config = this._remoteConfig;
|
|
6650
6708
|
if (!config) {
|
|
6651
|
-
logger.info('remote config must be stored in persistence before recording can start');
|
|
6709
|
+
logger$1.info('remote config must be stored in persistence before recording can start');
|
|
6652
6710
|
return;
|
|
6653
6711
|
}
|
|
6654
6712
|
// We want to ensure the sessionManager is reset if necessary on loading the recorder
|
|
@@ -6731,7 +6789,7 @@ var leanbase = (function () {
|
|
|
6731
6789
|
});
|
|
6732
6790
|
}
|
|
6733
6791
|
} catch (e) {
|
|
6734
|
-
logger.error('Could not add $pageview to rrweb session', e);
|
|
6792
|
+
logger$1.error('Could not add $pageview to rrweb session', e);
|
|
6735
6793
|
}
|
|
6736
6794
|
});
|
|
6737
6795
|
}
|
|
@@ -6776,17 +6834,30 @@ var leanbase = (function () {
|
|
|
6776
6834
|
this._stopRrweb = undefined;
|
|
6777
6835
|
this._isFullyReady = false;
|
|
6778
6836
|
this._hasReportedRecordingInitialized = false;
|
|
6779
|
-
logger.info('stopped');
|
|
6837
|
+
logger$1.info('stopped');
|
|
6780
6838
|
}
|
|
6781
6839
|
_snapshotIngestionUrl() {
|
|
6782
6840
|
const endpointFor = this._instance?.requestRouter?.endpointFor;
|
|
6783
|
-
|
|
6841
|
+
// Prefer requestRouter (parity with Browser SDK)
|
|
6842
|
+
if (typeof endpointFor === 'function') {
|
|
6843
|
+
try {
|
|
6844
|
+
return endpointFor('api', this._endpoint);
|
|
6845
|
+
} catch {
|
|
6846
|
+
return null;
|
|
6847
|
+
}
|
|
6848
|
+
}
|
|
6849
|
+
// Fallback: construct from host/api_host if requestRouter is unavailable (older IIFE builds)
|
|
6850
|
+
const host = (this._instance.config.api_host || this._instance.config.host || '').trim();
|
|
6851
|
+
if (!host) {
|
|
6784
6852
|
return null;
|
|
6785
6853
|
}
|
|
6786
6854
|
try {
|
|
6787
|
-
|
|
6855
|
+
// eslint-disable-next-line compat/compat
|
|
6856
|
+
return new URL(this._endpoint, host).href;
|
|
6788
6857
|
} catch {
|
|
6789
|
-
|
|
6858
|
+
const normalizedHost = host.endsWith('/') ? host.slice(0, -1) : host;
|
|
6859
|
+
const normalizedEndpoint = this._endpoint.startsWith('/') ? this._endpoint : `/${this._endpoint}`;
|
|
6860
|
+
return `${normalizedHost}${normalizedEndpoint}`;
|
|
6790
6861
|
}
|
|
6791
6862
|
}
|
|
6792
6863
|
_canCaptureSnapshots() {
|
|
@@ -6803,7 +6874,7 @@ var leanbase = (function () {
|
|
|
6803
6874
|
}
|
|
6804
6875
|
try {
|
|
6805
6876
|
this._processQueuedEvents();
|
|
6806
|
-
if (!rawEvent || !isObject(rawEvent)) {
|
|
6877
|
+
if (!rawEvent || !isObject$1(rawEvent)) {
|
|
6807
6878
|
return;
|
|
6808
6879
|
}
|
|
6809
6880
|
if (rawEvent.type === EventType$1.Meta) {
|
|
@@ -6871,7 +6942,7 @@ var leanbase = (function () {
|
|
|
6871
6942
|
}
|
|
6872
6943
|
this._captureSnapshotBuffered(properties);
|
|
6873
6944
|
} catch (e) {
|
|
6874
|
-
logger.error('error processing rrweb event', e);
|
|
6945
|
+
logger$1.error('error processing rrweb event', e);
|
|
6875
6946
|
}
|
|
6876
6947
|
}
|
|
6877
6948
|
get status() {
|
|
@@ -6962,7 +7033,7 @@ var leanbase = (function () {
|
|
|
6962
7033
|
if (!this._canCaptureSnapshots()) {
|
|
6963
7034
|
if (!this._loggedMissingEndpointFor) {
|
|
6964
7035
|
this._loggedMissingEndpointFor = true;
|
|
6965
|
-
logger.warn('snapshot capture skipped because requestRouter.endpointFor is unavailable');
|
|
7036
|
+
logger$1.warn('snapshot capture skipped because requestRouter.endpointFor is unavailable');
|
|
6966
7037
|
}
|
|
6967
7038
|
this._flushBufferTimer = setTimeout(() => {
|
|
6968
7039
|
this._flushBuffer();
|
|
@@ -7005,7 +7076,7 @@ var leanbase = (function () {
|
|
|
7005
7076
|
if (!url) {
|
|
7006
7077
|
if (!this._loggedMissingEndpointFor) {
|
|
7007
7078
|
this._loggedMissingEndpointFor = true;
|
|
7008
|
-
logger.warn('snapshot capture skipped because requestRouter.endpointFor is unavailable');
|
|
7079
|
+
logger$1.warn('snapshot capture skipped because requestRouter.endpointFor is unavailable');
|
|
7009
7080
|
}
|
|
7010
7081
|
return;
|
|
7011
7082
|
}
|
|
@@ -7018,7 +7089,7 @@ var leanbase = (function () {
|
|
|
7018
7089
|
skip_client_rate_limiting: true
|
|
7019
7090
|
});
|
|
7020
7091
|
} catch (e) {
|
|
7021
|
-
logger.error('failed to capture snapshot', e);
|
|
7092
|
+
logger$1.error('failed to capture snapshot', e);
|
|
7022
7093
|
}
|
|
7023
7094
|
}
|
|
7024
7095
|
_snapshotUrl() {
|
|
@@ -7077,9 +7148,9 @@ var leanbase = (function () {
|
|
|
7077
7148
|
});
|
|
7078
7149
|
const message = startReason.replace('_', ' ');
|
|
7079
7150
|
if (typeof tagPayload === 'undefined') {
|
|
7080
|
-
logger.info(message);
|
|
7151
|
+
logger$1.info(message);
|
|
7081
7152
|
} else {
|
|
7082
|
-
logger.info(message, tagPayload);
|
|
7153
|
+
logger$1.info(message, tagPayload);
|
|
7083
7154
|
}
|
|
7084
7155
|
if (!includes(['recording_initialized', 'session_id_changed'], startReason)) {
|
|
7085
7156
|
this._tryAddCustomEvent(startReason, tagPayload);
|
|
@@ -7180,7 +7251,7 @@ var leanbase = (function () {
|
|
|
7180
7251
|
if (shouldSample) {
|
|
7181
7252
|
this._reportStarted(SAMPLED);
|
|
7182
7253
|
} else {
|
|
7183
|
-
logger.warn(`Sample rate (${currentSampleRate}) has determined that this sessionId (${sessionId}) will not be sent to the server.`);
|
|
7254
|
+
logger$1.warn(`Sample rate (${currentSampleRate}) has determined that this sessionId (${sessionId}) will not be sent to the server.`);
|
|
7184
7255
|
}
|
|
7185
7256
|
this._tryAddCustomEvent('samplingDecisionMade', {
|
|
7186
7257
|
sampleRate: currentSampleRate,
|
|
@@ -7203,7 +7274,7 @@ var leanbase = (function () {
|
|
|
7203
7274
|
this._activateTrigger('event');
|
|
7204
7275
|
}
|
|
7205
7276
|
} catch (e) {
|
|
7206
|
-
logger.error('Could not activate event trigger', e);
|
|
7277
|
+
logger$1.error('Could not activate event trigger', e);
|
|
7207
7278
|
}
|
|
7208
7279
|
});
|
|
7209
7280
|
}
|
|
@@ -7285,7 +7356,7 @@ var leanbase = (function () {
|
|
|
7285
7356
|
this._disablePermanently('rrweb record function unavailable');
|
|
7286
7357
|
return;
|
|
7287
7358
|
}
|
|
7288
|
-
const activePlugins = this._gatherRRWebPlugins();
|
|
7359
|
+
const activePlugins = await this._gatherRRWebPlugins();
|
|
7289
7360
|
let stopHandler;
|
|
7290
7361
|
try {
|
|
7291
7362
|
stopHandler = rrwebRecord({
|
|
@@ -7294,7 +7365,7 @@ var leanbase = (function () {
|
|
|
7294
7365
|
this.onRRwebEmit(event);
|
|
7295
7366
|
} catch (e) {
|
|
7296
7367
|
// never throw from rrweb emit handler
|
|
7297
|
-
logger.error('error in rrweb emit handler', e);
|
|
7368
|
+
logger$1.error('error in rrweb emit handler', e);
|
|
7298
7369
|
}
|
|
7299
7370
|
},
|
|
7300
7371
|
plugins: activePlugins,
|
|
@@ -7319,7 +7390,7 @@ var leanbase = (function () {
|
|
|
7319
7390
|
bucketSize: this._instance.config.session_recording?.__mutationThrottlerBucketSize,
|
|
7320
7391
|
onBlockedNode: (id, node) => {
|
|
7321
7392
|
const message = `Too many mutations on node '${id}'. Rate limiting. This could be due to SVG animations or something similar`;
|
|
7322
|
-
logger.info(message, {
|
|
7393
|
+
logger$1.info(message, {
|
|
7323
7394
|
node: node
|
|
7324
7395
|
});
|
|
7325
7396
|
this.log(LOGGER_PREFIX$1 + ' ' + message, 'warn');
|
|
@@ -7346,11 +7417,16 @@ var leanbase = (function () {
|
|
|
7346
7417
|
/* eslint-disable posthog-js/no-direct-function-check */
|
|
7347
7418
|
const LOGGER_PREFIX = '[SessionRecording]';
|
|
7348
7419
|
const log = {
|
|
7349
|
-
info: (...args) => logger$
|
|
7350
|
-
warn: (...args) => logger$
|
|
7351
|
-
error: (...args) => logger$
|
|
7420
|
+
info: (...args) => logger$3.info(LOGGER_PREFIX, ...args),
|
|
7421
|
+
warn: (...args) => logger$3.warn(LOGGER_PREFIX, ...args),
|
|
7422
|
+
error: (...args) => logger$3.error(LOGGER_PREFIX, ...args)
|
|
7352
7423
|
};
|
|
7353
7424
|
class SessionRecording {
|
|
7425
|
+
_debug(...args) {
|
|
7426
|
+
if (this._instance?.config?.debug) {
|
|
7427
|
+
log.info(...args);
|
|
7428
|
+
}
|
|
7429
|
+
}
|
|
7354
7430
|
get started() {
|
|
7355
7431
|
return !!this._lazyLoadedSessionRecording?.isStarted;
|
|
7356
7432
|
}
|
|
@@ -7388,8 +7464,10 @@ var leanbase = (function () {
|
|
|
7388
7464
|
}
|
|
7389
7465
|
const canRunReplay = !isUndefined(Object.assign) && !isUndefined(Array.from);
|
|
7390
7466
|
if (this._isRecordingEnabled && canRunReplay) {
|
|
7467
|
+
this._debug('Session replay enabled; starting recorder');
|
|
7391
7468
|
this._lazyLoadAndStart(startReason);
|
|
7392
7469
|
} else {
|
|
7470
|
+
this._debug('Session replay disabled; stopping recorder');
|
|
7393
7471
|
this.stopRecording();
|
|
7394
7472
|
}
|
|
7395
7473
|
}
|
|
@@ -7461,18 +7539,15 @@ var leanbase = (function () {
|
|
|
7461
7539
|
log.info('skipping remote config with no sessionRecording', response);
|
|
7462
7540
|
return;
|
|
7463
7541
|
}
|
|
7464
|
-
this._receivedFlags = true;
|
|
7465
|
-
if (response.sessionRecording === false) {
|
|
7466
|
-
return;
|
|
7467
|
-
}
|
|
7468
7542
|
this._persistRemoteConfig(response);
|
|
7543
|
+
this._receivedFlags = true;
|
|
7469
7544
|
this.startIfEnabledOrStop();
|
|
7470
7545
|
}
|
|
7471
7546
|
log(message, level = 'log') {
|
|
7472
7547
|
if (this._lazyLoadedSessionRecording?.log) {
|
|
7473
7548
|
this._lazyLoadedSessionRecording.log(message, level);
|
|
7474
7549
|
} else {
|
|
7475
|
-
logger$
|
|
7550
|
+
logger$3.warn('log called before recorder was ready');
|
|
7476
7551
|
}
|
|
7477
7552
|
}
|
|
7478
7553
|
get _scriptName() {
|
|
@@ -7495,10 +7570,10 @@ var leanbase = (function () {
|
|
|
7495
7570
|
try {
|
|
7496
7571
|
const maybePromise = this._lazyLoadedSessionRecording.start(startReason);
|
|
7497
7572
|
if (maybePromise && typeof maybePromise.catch === 'function') {
|
|
7498
|
-
maybePromise.catch(e => logger$
|
|
7573
|
+
maybePromise.catch(e => logger$3.error('error starting session recording', e));
|
|
7499
7574
|
}
|
|
7500
7575
|
} catch (e) {
|
|
7501
|
-
logger$
|
|
7576
|
+
logger$3.error('error starting session recording', e);
|
|
7502
7577
|
}
|
|
7503
7578
|
return;
|
|
7504
7579
|
}
|
|
@@ -7511,10 +7586,10 @@ var leanbase = (function () {
|
|
|
7511
7586
|
try {
|
|
7512
7587
|
const maybePromise = this._lazyLoadedSessionRecording.start(startReason);
|
|
7513
7588
|
if (maybePromise && typeof maybePromise.catch === 'function') {
|
|
7514
|
-
maybePromise.catch(e => logger$
|
|
7589
|
+
maybePromise.catch(e => logger$3.error('error starting session recording', e));
|
|
7515
7590
|
}
|
|
7516
7591
|
} catch (e) {
|
|
7517
|
-
logger$
|
|
7592
|
+
logger$3.error('error starting session recording', e);
|
|
7518
7593
|
}
|
|
7519
7594
|
}
|
|
7520
7595
|
/**
|
|
@@ -7671,12 +7746,12 @@ var leanbase = (function () {
|
|
|
7671
7746
|
}, 1);
|
|
7672
7747
|
}
|
|
7673
7748
|
const triggerRemoteConfigLoad = reason => {
|
|
7674
|
-
logger$
|
|
7749
|
+
logger$3.info(`remote config load triggered via ${reason}`);
|
|
7675
7750
|
void this.loadRemoteConfig();
|
|
7676
7751
|
};
|
|
7677
7752
|
if (document$1) {
|
|
7678
7753
|
if (document$1.readyState === 'loading') {
|
|
7679
|
-
logger$
|
|
7754
|
+
logger$3.info('remote config load deferred until DOMContentLoaded');
|
|
7680
7755
|
const onDomReady = () => {
|
|
7681
7756
|
document$1?.removeEventListener('DOMContentLoaded', onDomReady);
|
|
7682
7757
|
triggerRemoteConfigLoad('dom');
|
|
@@ -7769,7 +7844,7 @@ var leanbase = (function () {
|
|
|
7769
7844
|
try {
|
|
7770
7845
|
this.sessionRecording.startIfEnabledOrStop();
|
|
7771
7846
|
} catch (e) {
|
|
7772
|
-
logger$
|
|
7847
|
+
logger$3.error('Failed to start session recording', e);
|
|
7773
7848
|
}
|
|
7774
7849
|
}
|
|
7775
7850
|
fetch(url, options) {
|
|
@@ -7783,7 +7858,7 @@ var leanbase = (function () {
|
|
|
7783
7858
|
const oldConfig = {
|
|
7784
7859
|
...this.config
|
|
7785
7860
|
};
|
|
7786
|
-
if (isObject(config)) {
|
|
7861
|
+
if (isObject$1(config)) {
|
|
7787
7862
|
extend(this.config, config);
|
|
7788
7863
|
if (!this.config.api_host && this.config.host) {
|
|
7789
7864
|
this.config.api_host = this.config.host;
|
|
@@ -7835,7 +7910,7 @@ var leanbase = (function () {
|
|
|
7835
7910
|
};
|
|
7836
7911
|
properties['distinct_id'] = persistenceProps.distinct_id;
|
|
7837
7912
|
if (!(isString(properties['distinct_id']) || isNumber(properties['distinct_id'])) || isEmptyString(properties['distinct_id'])) {
|
|
7838
|
-
logger$
|
|
7913
|
+
logger$3.error('Invalid distinct_id for replay event. This indicates a bug in your implementation');
|
|
7839
7914
|
}
|
|
7840
7915
|
return properties;
|
|
7841
7916
|
}
|
|
@@ -7910,11 +7985,11 @@ var leanbase = (function () {
|
|
|
7910
7985
|
return;
|
|
7911
7986
|
}
|
|
7912
7987
|
if (isUndefined(event) || !isString(event)) {
|
|
7913
|
-
logger$
|
|
7988
|
+
logger$3.error('No event name provided to posthog.capture');
|
|
7914
7989
|
return;
|
|
7915
7990
|
}
|
|
7916
7991
|
if (properties?.$current_url && !isString(properties?.$current_url)) {
|
|
7917
|
-
logger$
|
|
7992
|
+
logger$3.error('Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value.');
|
|
7918
7993
|
delete properties?.$current_url;
|
|
7919
7994
|
}
|
|
7920
7995
|
this.sessionPersistence.update_search_keyword();
|
|
@@ -8052,13 +8127,13 @@ var leanbase = (function () {
|
|
|
8052
8127
|
g.Leanbase = g.leanbase;
|
|
8053
8128
|
})(globalThis);
|
|
8054
8129
|
|
|
8055
|
-
var __defProp = Object.defineProperty;
|
|
8056
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8057
|
-
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
8058
|
-
var _a;
|
|
8059
|
-
var __defProp$1 = Object.defineProperty;
|
|
8060
|
-
var __defNormalProp$1 = (obj, key, value) => key in obj ? __defProp$1(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8061
|
-
var __publicField$1 = (obj, key, value) => __defNormalProp$1(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
8130
|
+
var __defProp$2 = Object.defineProperty;
|
|
8131
|
+
var __defNormalProp$2 = (obj, key, value) => key in obj ? __defProp$2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8132
|
+
var __publicField$2 = (obj, key, value) => __defNormalProp$2(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
8133
|
+
var _a$1;
|
|
8134
|
+
var __defProp$1$1 = Object.defineProperty;
|
|
8135
|
+
var __defNormalProp$1$1 = (obj, key, value) => key in obj ? __defProp$1$1(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8136
|
+
var __publicField$1$1 = (obj, key, value) => __defNormalProp$1$1(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
8062
8137
|
var NodeType$2 = /* @__PURE__ */ ((NodeType2) => {
|
|
8063
8138
|
NodeType2[NodeType2["Document"] = 0] = "Document";
|
|
8064
8139
|
NodeType2[NodeType2["DocumentType"] = 1] = "DocumentType";
|
|
@@ -8068,13 +8143,13 @@ var leanbase = (function () {
|
|
|
8068
8143
|
NodeType2[NodeType2["Comment"] = 5] = "Comment";
|
|
8069
8144
|
return NodeType2;
|
|
8070
8145
|
})(NodeType$2 || {});
|
|
8071
|
-
const testableAccessors$1 = {
|
|
8146
|
+
const testableAccessors$1$1 = {
|
|
8072
8147
|
Node: ["childNodes", "parentNode", "parentElement", "textContent"],
|
|
8073
8148
|
ShadowRoot: ["host", "styleSheets"],
|
|
8074
8149
|
Element: ["shadowRoot", "querySelector", "querySelectorAll"],
|
|
8075
8150
|
MutationObserver: []
|
|
8076
8151
|
};
|
|
8077
|
-
const testableMethods$1 = {
|
|
8152
|
+
const testableMethods$1$1 = {
|
|
8078
8153
|
Node: ["contains", "getRootNode"],
|
|
8079
8154
|
ShadowRoot: ["getSelection"],
|
|
8080
8155
|
Element: [],
|
|
@@ -8104,13 +8179,13 @@ var leanbase = (function () {
|
|
|
8104
8179
|
}
|
|
8105
8180
|
}
|
|
8106
8181
|
|
|
8107
|
-
const untaintedBasePrototype$1 = {};
|
|
8108
|
-
function getUntaintedPrototype$1(key) {
|
|
8109
|
-
if (untaintedBasePrototype$1[key])
|
|
8110
|
-
return untaintedBasePrototype$1[key];
|
|
8182
|
+
const untaintedBasePrototype$1$1 = {};
|
|
8183
|
+
function getUntaintedPrototype$1$1(key) {
|
|
8184
|
+
if (untaintedBasePrototype$1$1[key])
|
|
8185
|
+
return untaintedBasePrototype$1$1[key];
|
|
8111
8186
|
const defaultObj = angularZoneUnpatchedAlternative(key) || globalThis[key];
|
|
8112
8187
|
const defaultPrototype = defaultObj.prototype;
|
|
8113
|
-
const accessorNames = key in testableAccessors$1 ? testableAccessors$1[key] : void 0;
|
|
8188
|
+
const accessorNames = key in testableAccessors$1$1 ? testableAccessors$1$1[key] : void 0;
|
|
8114
8189
|
const isUntaintedAccessors = Boolean(
|
|
8115
8190
|
accessorNames && // @ts-expect-error 2345
|
|
8116
8191
|
accessorNames.every(
|
|
@@ -8122,7 +8197,7 @@ var leanbase = (function () {
|
|
|
8122
8197
|
}
|
|
8123
8198
|
)
|
|
8124
8199
|
);
|
|
8125
|
-
const methodNames = key in testableMethods$1 ? testableMethods$1[key] : void 0;
|
|
8200
|
+
const methodNames = key in testableMethods$1$1 ? testableMethods$1$1[key] : void 0;
|
|
8126
8201
|
const isUntaintedMethods = Boolean(
|
|
8127
8202
|
methodNames && methodNames.every(
|
|
8128
8203
|
// @ts-expect-error 2345
|
|
@@ -8133,7 +8208,7 @@ var leanbase = (function () {
|
|
|
8133
8208
|
)
|
|
8134
8209
|
);
|
|
8135
8210
|
if (isUntaintedAccessors && isUntaintedMethods) {
|
|
8136
|
-
untaintedBasePrototype$1[key] = defaultObj.prototype;
|
|
8211
|
+
untaintedBasePrototype$1$1[key] = defaultObj.prototype;
|
|
8137
8212
|
return defaultObj.prototype;
|
|
8138
8213
|
}
|
|
8139
8214
|
try {
|
|
@@ -8144,104 +8219,104 @@ var leanbase = (function () {
|
|
|
8144
8219
|
const untaintedObject = win[key].prototype;
|
|
8145
8220
|
document.body.removeChild(iframeEl);
|
|
8146
8221
|
if (!untaintedObject) return defaultObj.prototype;
|
|
8147
|
-
return untaintedBasePrototype$1[key] = untaintedObject;
|
|
8222
|
+
return untaintedBasePrototype$1$1[key] = untaintedObject;
|
|
8148
8223
|
} catch {
|
|
8149
8224
|
return defaultObj.prototype;
|
|
8150
8225
|
}
|
|
8151
8226
|
}
|
|
8152
|
-
const untaintedAccessorCache$1 = {};
|
|
8153
|
-
function getUntaintedAccessor$1(key, instance, accessor) {
|
|
8227
|
+
const untaintedAccessorCache$1$1 = {};
|
|
8228
|
+
function getUntaintedAccessor$1$1(key, instance, accessor) {
|
|
8154
8229
|
var _a2;
|
|
8155
8230
|
const cacheKey = `${key}.${String(accessor)}`;
|
|
8156
|
-
if (untaintedAccessorCache$1[cacheKey])
|
|
8157
|
-
return untaintedAccessorCache$1[cacheKey].call(
|
|
8231
|
+
if (untaintedAccessorCache$1$1[cacheKey])
|
|
8232
|
+
return untaintedAccessorCache$1$1[cacheKey].call(
|
|
8158
8233
|
instance
|
|
8159
8234
|
);
|
|
8160
|
-
const untaintedPrototype = getUntaintedPrototype$1(key);
|
|
8235
|
+
const untaintedPrototype = getUntaintedPrototype$1$1(key);
|
|
8161
8236
|
const untaintedAccessor = (_a2 = Object.getOwnPropertyDescriptor(
|
|
8162
8237
|
untaintedPrototype,
|
|
8163
8238
|
accessor
|
|
8164
8239
|
)) == null ? void 0 : _a2.get;
|
|
8165
8240
|
if (!untaintedAccessor) return instance[accessor];
|
|
8166
|
-
untaintedAccessorCache$1[cacheKey] = untaintedAccessor;
|
|
8241
|
+
untaintedAccessorCache$1$1[cacheKey] = untaintedAccessor;
|
|
8167
8242
|
return untaintedAccessor.call(instance);
|
|
8168
8243
|
}
|
|
8169
|
-
const untaintedMethodCache$1 = {};
|
|
8170
|
-
function getUntaintedMethod$1(key, instance, method) {
|
|
8244
|
+
const untaintedMethodCache$1$1 = {};
|
|
8245
|
+
function getUntaintedMethod$1$1(key, instance, method) {
|
|
8171
8246
|
const cacheKey = `${key}.${String(method)}`;
|
|
8172
|
-
if (untaintedMethodCache$1[cacheKey])
|
|
8173
|
-
return untaintedMethodCache$1[cacheKey].bind(
|
|
8247
|
+
if (untaintedMethodCache$1$1[cacheKey])
|
|
8248
|
+
return untaintedMethodCache$1$1[cacheKey].bind(
|
|
8174
8249
|
instance
|
|
8175
8250
|
);
|
|
8176
|
-
const untaintedPrototype = getUntaintedPrototype$1(key);
|
|
8251
|
+
const untaintedPrototype = getUntaintedPrototype$1$1(key);
|
|
8177
8252
|
const untaintedMethod = untaintedPrototype[method];
|
|
8178
8253
|
if (typeof untaintedMethod !== "function") return instance[method];
|
|
8179
|
-
untaintedMethodCache$1[cacheKey] = untaintedMethod;
|
|
8254
|
+
untaintedMethodCache$1$1[cacheKey] = untaintedMethod;
|
|
8180
8255
|
return untaintedMethod.bind(instance);
|
|
8181
8256
|
}
|
|
8182
|
-
function childNodes$1(n2) {
|
|
8183
|
-
return getUntaintedAccessor$1("Node", n2, "childNodes");
|
|
8257
|
+
function childNodes$1$1(n2) {
|
|
8258
|
+
return getUntaintedAccessor$1$1("Node", n2, "childNodes");
|
|
8184
8259
|
}
|
|
8185
|
-
function parentNode$1(n2) {
|
|
8186
|
-
return getUntaintedAccessor$1("Node", n2, "parentNode");
|
|
8260
|
+
function parentNode$1$1(n2) {
|
|
8261
|
+
return getUntaintedAccessor$1$1("Node", n2, "parentNode");
|
|
8187
8262
|
}
|
|
8188
|
-
function parentElement$1(n2) {
|
|
8189
|
-
return getUntaintedAccessor$1("Node", n2, "parentElement");
|
|
8263
|
+
function parentElement$1$1(n2) {
|
|
8264
|
+
return getUntaintedAccessor$1$1("Node", n2, "parentElement");
|
|
8190
8265
|
}
|
|
8191
|
-
function textContent$1(n2) {
|
|
8192
|
-
return getUntaintedAccessor$1("Node", n2, "textContent");
|
|
8266
|
+
function textContent$1$1(n2) {
|
|
8267
|
+
return getUntaintedAccessor$1$1("Node", n2, "textContent");
|
|
8193
8268
|
}
|
|
8194
|
-
function contains$1(n2, other) {
|
|
8195
|
-
return getUntaintedMethod$1("Node", n2, "contains")(other);
|
|
8269
|
+
function contains$1$1(n2, other) {
|
|
8270
|
+
return getUntaintedMethod$1$1("Node", n2, "contains")(other);
|
|
8196
8271
|
}
|
|
8197
|
-
function getRootNode$1(n2) {
|
|
8198
|
-
return getUntaintedMethod$1("Node", n2, "getRootNode")();
|
|
8272
|
+
function getRootNode$1$1(n2) {
|
|
8273
|
+
return getUntaintedMethod$1$1("Node", n2, "getRootNode")();
|
|
8199
8274
|
}
|
|
8200
|
-
function host$1(n2) {
|
|
8275
|
+
function host$1$1(n2) {
|
|
8201
8276
|
if (!n2 || !("host" in n2)) return null;
|
|
8202
|
-
return getUntaintedAccessor$1("ShadowRoot", n2, "host");
|
|
8277
|
+
return getUntaintedAccessor$1$1("ShadowRoot", n2, "host");
|
|
8203
8278
|
}
|
|
8204
|
-
function styleSheets$1(n2) {
|
|
8279
|
+
function styleSheets$1$1(n2) {
|
|
8205
8280
|
return n2.styleSheets;
|
|
8206
8281
|
}
|
|
8207
|
-
function shadowRoot$1(n2) {
|
|
8282
|
+
function shadowRoot$1$1(n2) {
|
|
8208
8283
|
if (!n2 || !("shadowRoot" in n2)) return null;
|
|
8209
|
-
return getUntaintedAccessor$1("Element", n2, "shadowRoot");
|
|
8210
|
-
}
|
|
8211
|
-
function querySelector$1(n2, selectors) {
|
|
8212
|
-
return getUntaintedAccessor$1("Element", n2, "querySelector")(selectors);
|
|
8213
|
-
}
|
|
8214
|
-
function querySelectorAll$1(n2, selectors) {
|
|
8215
|
-
return getUntaintedAccessor$1("Element", n2, "querySelectorAll")(selectors);
|
|
8216
|
-
}
|
|
8217
|
-
function mutationObserverCtor$1() {
|
|
8218
|
-
return getUntaintedPrototype$1("MutationObserver").constructor;
|
|
8219
|
-
}
|
|
8220
|
-
const index$1 = {
|
|
8221
|
-
childNodes: childNodes$1,
|
|
8222
|
-
parentNode: parentNode$1,
|
|
8223
|
-
parentElement: parentElement$1,
|
|
8224
|
-
textContent: textContent$1,
|
|
8225
|
-
contains: contains$1,
|
|
8226
|
-
getRootNode: getRootNode$1,
|
|
8227
|
-
host: host$1,
|
|
8228
|
-
styleSheets: styleSheets$1,
|
|
8229
|
-
shadowRoot: shadowRoot$1,
|
|
8230
|
-
querySelector: querySelector$1,
|
|
8231
|
-
querySelectorAll: querySelectorAll$1,
|
|
8232
|
-
mutationObserver: mutationObserverCtor$1
|
|
8284
|
+
return getUntaintedAccessor$1$1("Element", n2, "shadowRoot");
|
|
8285
|
+
}
|
|
8286
|
+
function querySelector$1$1(n2, selectors) {
|
|
8287
|
+
return getUntaintedAccessor$1$1("Element", n2, "querySelector")(selectors);
|
|
8288
|
+
}
|
|
8289
|
+
function querySelectorAll$1$1(n2, selectors) {
|
|
8290
|
+
return getUntaintedAccessor$1$1("Element", n2, "querySelectorAll")(selectors);
|
|
8291
|
+
}
|
|
8292
|
+
function mutationObserverCtor$1$1() {
|
|
8293
|
+
return getUntaintedPrototype$1$1("MutationObserver").constructor;
|
|
8294
|
+
}
|
|
8295
|
+
const index$1$1 = {
|
|
8296
|
+
childNodes: childNodes$1$1,
|
|
8297
|
+
parentNode: parentNode$1$1,
|
|
8298
|
+
parentElement: parentElement$1$1,
|
|
8299
|
+
textContent: textContent$1$1,
|
|
8300
|
+
contains: contains$1$1,
|
|
8301
|
+
getRootNode: getRootNode$1$1,
|
|
8302
|
+
host: host$1$1,
|
|
8303
|
+
styleSheets: styleSheets$1$1,
|
|
8304
|
+
shadowRoot: shadowRoot$1$1,
|
|
8305
|
+
querySelector: querySelector$1$1,
|
|
8306
|
+
querySelectorAll: querySelectorAll$1$1,
|
|
8307
|
+
mutationObserver: mutationObserverCtor$1$1
|
|
8233
8308
|
};
|
|
8234
8309
|
function isElement(n2) {
|
|
8235
8310
|
return n2.nodeType === n2.ELEMENT_NODE;
|
|
8236
8311
|
}
|
|
8237
|
-
function isShadowRoot(n2) {
|
|
8312
|
+
function isShadowRoot$1(n2) {
|
|
8238
8313
|
const hostEl = (
|
|
8239
8314
|
// anchor and textarea elements also have a `host` property
|
|
8240
8315
|
// but only shadow roots have a `mode` property
|
|
8241
|
-
n2 && "host" in n2 && "mode" in n2 && index$1.host(n2) || null
|
|
8316
|
+
n2 && "host" in n2 && "mode" in n2 && index$1$1.host(n2) || null
|
|
8242
8317
|
);
|
|
8243
8318
|
return Boolean(
|
|
8244
|
-
hostEl && "shadowRoot" in hostEl && index$1.shadowRoot(hostEl) === n2
|
|
8319
|
+
hostEl && "shadowRoot" in hostEl && index$1$1.shadowRoot(hostEl) === n2
|
|
8245
8320
|
);
|
|
8246
8321
|
}
|
|
8247
8322
|
function isNativeShadowDom(shadowRoot2) {
|
|
@@ -8327,10 +8402,10 @@ var leanbase = (function () {
|
|
|
8327
8402
|
function findStylesheet(doc, href) {
|
|
8328
8403
|
return Array.from(doc.styleSheets).find((s) => s.href === href);
|
|
8329
8404
|
}
|
|
8330
|
-
class Mirror {
|
|
8405
|
+
let Mirror$1 = class Mirror {
|
|
8331
8406
|
constructor() {
|
|
8332
|
-
__publicField$1(this, "idNodeMap", /* @__PURE__ */ new Map());
|
|
8333
|
-
__publicField$1(this, "nodeMetaMap", /* @__PURE__ */ new WeakMap());
|
|
8407
|
+
__publicField$1$1(this, "idNodeMap", /* @__PURE__ */ new Map());
|
|
8408
|
+
__publicField$1$1(this, "nodeMetaMap", /* @__PURE__ */ new WeakMap());
|
|
8334
8409
|
}
|
|
8335
8410
|
getId(n2) {
|
|
8336
8411
|
var _a2;
|
|
@@ -8381,9 +8456,9 @@ var leanbase = (function () {
|
|
|
8381
8456
|
this.idNodeMap = /* @__PURE__ */ new Map();
|
|
8382
8457
|
this.nodeMetaMap = /* @__PURE__ */ new WeakMap();
|
|
8383
8458
|
}
|
|
8384
|
-
}
|
|
8385
|
-
function createMirror$2() {
|
|
8386
|
-
return new Mirror();
|
|
8459
|
+
};
|
|
8460
|
+
function createMirror$2$1() {
|
|
8461
|
+
return new Mirror$1();
|
|
8387
8462
|
}
|
|
8388
8463
|
function maskInputValue({
|
|
8389
8464
|
element,
|
|
@@ -8499,7 +8574,7 @@ var leanbase = (function () {
|
|
|
8499
8574
|
}
|
|
8500
8575
|
let _id = 1;
|
|
8501
8576
|
const tagNameRegex = new RegExp("[^a-z0-9-_:]");
|
|
8502
|
-
const IGNORED_NODE = -2;
|
|
8577
|
+
const IGNORED_NODE$1 = -2;
|
|
8503
8578
|
function genId() {
|
|
8504
8579
|
return _id++;
|
|
8505
8580
|
}
|
|
@@ -8638,11 +8713,11 @@ var leanbase = (function () {
|
|
|
8638
8713
|
}
|
|
8639
8714
|
return false;
|
|
8640
8715
|
}
|
|
8641
|
-
function classMatchesRegex(node2, regex, checkAncestors) {
|
|
8716
|
+
function classMatchesRegex$1(node2, regex, checkAncestors) {
|
|
8642
8717
|
if (!node2) return false;
|
|
8643
8718
|
if (node2.nodeType !== node2.ELEMENT_NODE) {
|
|
8644
8719
|
if (!checkAncestors) return false;
|
|
8645
|
-
return classMatchesRegex(index$1.parentNode(node2), regex, checkAncestors);
|
|
8720
|
+
return classMatchesRegex$1(index$1$1.parentNode(node2), regex, checkAncestors);
|
|
8646
8721
|
}
|
|
8647
8722
|
for (let eIndex = node2.classList.length; eIndex--; ) {
|
|
8648
8723
|
const className = node2.classList[eIndex];
|
|
@@ -8651,19 +8726,19 @@ var leanbase = (function () {
|
|
|
8651
8726
|
}
|
|
8652
8727
|
}
|
|
8653
8728
|
if (!checkAncestors) return false;
|
|
8654
|
-
return classMatchesRegex(index$1.parentNode(node2), regex, checkAncestors);
|
|
8729
|
+
return classMatchesRegex$1(index$1$1.parentNode(node2), regex, checkAncestors);
|
|
8655
8730
|
}
|
|
8656
8731
|
function needMaskingText(node2, maskTextClass, maskTextSelector, checkAncestors) {
|
|
8657
8732
|
let el;
|
|
8658
8733
|
if (isElement(node2)) {
|
|
8659
8734
|
el = node2;
|
|
8660
|
-
if (!index$1.childNodes(el).length) {
|
|
8735
|
+
if (!index$1$1.childNodes(el).length) {
|
|
8661
8736
|
return false;
|
|
8662
8737
|
}
|
|
8663
|
-
} else if (index$1.parentElement(node2) === null) {
|
|
8738
|
+
} else if (index$1$1.parentElement(node2) === null) {
|
|
8664
8739
|
return false;
|
|
8665
8740
|
} else {
|
|
8666
|
-
el = index$1.parentElement(node2);
|
|
8741
|
+
el = index$1$1.parentElement(node2);
|
|
8667
8742
|
}
|
|
8668
8743
|
try {
|
|
8669
8744
|
if (typeof maskTextClass === "string") {
|
|
@@ -8673,7 +8748,7 @@ var leanbase = (function () {
|
|
|
8673
8748
|
if (el.classList.contains(maskTextClass)) return true;
|
|
8674
8749
|
}
|
|
8675
8750
|
} else {
|
|
8676
|
-
if (classMatchesRegex(el, maskTextClass, checkAncestors)) return true;
|
|
8751
|
+
if (classMatchesRegex$1(el, maskTextClass, checkAncestors)) return true;
|
|
8677
8752
|
}
|
|
8678
8753
|
if (maskTextSelector) {
|
|
8679
8754
|
if (checkAncestors) {
|
|
@@ -8812,7 +8887,7 @@ var leanbase = (function () {
|
|
|
8812
8887
|
case n2.COMMENT_NODE:
|
|
8813
8888
|
return {
|
|
8814
8889
|
type: NodeType$2.Comment,
|
|
8815
|
-
textContent: index$1.textContent(n2) || "",
|
|
8890
|
+
textContent: index$1$1.textContent(n2) || "",
|
|
8816
8891
|
rootId
|
|
8817
8892
|
};
|
|
8818
8893
|
default:
|
|
@@ -8827,9 +8902,9 @@ var leanbase = (function () {
|
|
|
8827
8902
|
function serializeTextNode(n2, options) {
|
|
8828
8903
|
var _a2;
|
|
8829
8904
|
const { needsMask, maskTextFn, rootId } = options;
|
|
8830
|
-
const parent = index$1.parentNode(n2);
|
|
8905
|
+
const parent = index$1$1.parentNode(n2);
|
|
8831
8906
|
const parentTagName = parent && parent.tagName;
|
|
8832
|
-
let text = index$1.textContent(n2);
|
|
8907
|
+
let text = index$1$1.textContent(n2);
|
|
8833
8908
|
const isStyle = parentTagName === "STYLE" ? true : void 0;
|
|
8834
8909
|
const isScript = parentTagName === "SCRIPT" ? true : void 0;
|
|
8835
8910
|
if (isStyle && text) {
|
|
@@ -8850,7 +8925,7 @@ var leanbase = (function () {
|
|
|
8850
8925
|
text = "SCRIPT_PLACEHOLDER";
|
|
8851
8926
|
}
|
|
8852
8927
|
if (!isStyle && !isScript && text && needsMask) {
|
|
8853
|
-
text = maskTextFn ? maskTextFn(text, index$1.parentElement(n2)) : text.replace(/[\S]/g, "*");
|
|
8928
|
+
text = maskTextFn ? maskTextFn(text, index$1$1.parentElement(n2)) : text.replace(/[\S]/g, "*");
|
|
8854
8929
|
}
|
|
8855
8930
|
return {
|
|
8856
8931
|
type: NodeType$2.Text,
|
|
@@ -8924,7 +8999,7 @@ var leanbase = (function () {
|
|
|
8924
8999
|
}
|
|
8925
9000
|
}
|
|
8926
9001
|
if (tagName === "style" && n2.sheet && // TODO: Currently we only try to get dynamic stylesheet when it is an empty style element
|
|
8927
|
-
!(n2.innerText || index$1.textContent(n2) || "").trim().length) {
|
|
9002
|
+
!(n2.innerText || index$1$1.textContent(n2) || "").trim().length) {
|
|
8928
9003
|
const cssText = stringifyStylesheet(
|
|
8929
9004
|
n2.sheet
|
|
8930
9005
|
);
|
|
@@ -9175,13 +9250,13 @@ var leanbase = (function () {
|
|
|
9175
9250
|
if (mirror2.hasNode(n2)) {
|
|
9176
9251
|
id = mirror2.getId(n2);
|
|
9177
9252
|
} else if (slimDOMExcluded(_serializedNode, slimDOMOptions) || !preserveWhiteSpace && _serializedNode.type === NodeType$2.Text && !_serializedNode.isStyle && !_serializedNode.textContent.replace(/^\s+|\s+$/gm, "").length) {
|
|
9178
|
-
id = IGNORED_NODE;
|
|
9253
|
+
id = IGNORED_NODE$1;
|
|
9179
9254
|
} else {
|
|
9180
9255
|
id = genId();
|
|
9181
9256
|
}
|
|
9182
9257
|
const serializedNode = Object.assign(_serializedNode, { id });
|
|
9183
9258
|
mirror2.add(n2, serializedNode);
|
|
9184
|
-
if (id === IGNORED_NODE) {
|
|
9259
|
+
if (id === IGNORED_NODE$1) {
|
|
9185
9260
|
return null;
|
|
9186
9261
|
}
|
|
9187
9262
|
if (onSerialize) {
|
|
@@ -9191,7 +9266,7 @@ var leanbase = (function () {
|
|
|
9191
9266
|
if (serializedNode.type === NodeType$2.Element) {
|
|
9192
9267
|
recordChild = recordChild && !serializedNode.needBlock;
|
|
9193
9268
|
delete serializedNode.needBlock;
|
|
9194
|
-
const shadowRootEl = index$1.shadowRoot(n2);
|
|
9269
|
+
const shadowRootEl = index$1$1.shadowRoot(n2);
|
|
9195
9270
|
if (shadowRootEl && isNativeShadowDom(shadowRootEl))
|
|
9196
9271
|
serializedNode.isShadowHost = true;
|
|
9197
9272
|
}
|
|
@@ -9226,7 +9301,7 @@ var leanbase = (function () {
|
|
|
9226
9301
|
};
|
|
9227
9302
|
if (serializedNode.type === NodeType$2.Element && serializedNode.tagName === "textarea" && serializedNode.attributes.value !== void 0) ;
|
|
9228
9303
|
else {
|
|
9229
|
-
for (const childN of Array.from(index$1.childNodes(n2))) {
|
|
9304
|
+
for (const childN of Array.from(index$1$1.childNodes(n2))) {
|
|
9230
9305
|
const serializedChildNode = serializeNodeWithId(childN, bypassOptions);
|
|
9231
9306
|
if (serializedChildNode) {
|
|
9232
9307
|
serializedNode.childNodes.push(serializedChildNode);
|
|
@@ -9234,8 +9309,8 @@ var leanbase = (function () {
|
|
|
9234
9309
|
}
|
|
9235
9310
|
}
|
|
9236
9311
|
let shadowRootEl = null;
|
|
9237
|
-
if (isElement(n2) && (shadowRootEl = index$1.shadowRoot(n2))) {
|
|
9238
|
-
for (const childN of Array.from(index$1.childNodes(shadowRootEl))) {
|
|
9312
|
+
if (isElement(n2) && (shadowRootEl = index$1$1.shadowRoot(n2))) {
|
|
9313
|
+
for (const childN of Array.from(index$1$1.childNodes(shadowRootEl))) {
|
|
9239
9314
|
const serializedChildNode = serializeNodeWithId(childN, bypassOptions);
|
|
9240
9315
|
if (serializedChildNode) {
|
|
9241
9316
|
isNativeShadowDom(shadowRootEl) && (serializedChildNode.isShadow = true);
|
|
@@ -9244,8 +9319,8 @@ var leanbase = (function () {
|
|
|
9244
9319
|
}
|
|
9245
9320
|
}
|
|
9246
9321
|
}
|
|
9247
|
-
const parent = index$1.parentNode(n2);
|
|
9248
|
-
if (parent && isShadowRoot(parent) && isNativeShadowDom(parent)) {
|
|
9322
|
+
const parent = index$1$1.parentNode(n2);
|
|
9323
|
+
if (parent && isShadowRoot$1(parent) && isNativeShadowDom(parent)) {
|
|
9249
9324
|
serializedNode.isShadow = true;
|
|
9250
9325
|
}
|
|
9251
9326
|
if (serializedNode.type === NodeType$2.Element && serializedNode.tagName === "iframe") {
|
|
@@ -9335,7 +9410,7 @@ var leanbase = (function () {
|
|
|
9335
9410
|
}
|
|
9336
9411
|
function snapshot(n2, options) {
|
|
9337
9412
|
const {
|
|
9338
|
-
mirror: mirror2 = new Mirror(),
|
|
9413
|
+
mirror: mirror2 = new Mirror$1(),
|
|
9339
9414
|
blockClass = "rr-block",
|
|
9340
9415
|
blockSelector = null,
|
|
9341
9416
|
maskTextClass = "rr-mask",
|
|
@@ -9419,7 +9494,7 @@ var leanbase = (function () {
|
|
|
9419
9494
|
});
|
|
9420
9495
|
}
|
|
9421
9496
|
// Removed postcss
|
|
9422
|
-
class BaseRRNode {
|
|
9497
|
+
let BaseRRNode$1 = class BaseRRNode {
|
|
9423
9498
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any
|
|
9424
9499
|
constructor(..._args) {
|
|
9425
9500
|
__publicField2(this, "parentElement", null);
|
|
@@ -9475,14 +9550,14 @@ var leanbase = (function () {
|
|
|
9475
9550
|
toString() {
|
|
9476
9551
|
return "RRNode";
|
|
9477
9552
|
}
|
|
9478
|
-
}
|
|
9479
|
-
const testableAccessors = {
|
|
9553
|
+
};
|
|
9554
|
+
const testableAccessors$2 = {
|
|
9480
9555
|
Node: ["childNodes", "parentNode", "parentElement", "textContent"],
|
|
9481
9556
|
ShadowRoot: ["host", "styleSheets"],
|
|
9482
9557
|
Element: ["shadowRoot", "querySelector", "querySelectorAll"],
|
|
9483
9558
|
MutationObserver: []
|
|
9484
9559
|
};
|
|
9485
|
-
const testableMethods = {
|
|
9560
|
+
const testableMethods$2 = {
|
|
9486
9561
|
Node: ["contains", "getRootNode"],
|
|
9487
9562
|
ShadowRoot: ["getSelection"],
|
|
9488
9563
|
Element: [],
|
|
@@ -9511,13 +9586,13 @@ var leanbase = (function () {
|
|
|
9511
9586
|
}
|
|
9512
9587
|
}
|
|
9513
9588
|
|
|
9514
|
-
const untaintedBasePrototype = {};
|
|
9515
|
-
function getUntaintedPrototype(key) {
|
|
9516
|
-
if (untaintedBasePrototype[key])
|
|
9517
|
-
return untaintedBasePrototype[key];
|
|
9589
|
+
const untaintedBasePrototype$2 = {};
|
|
9590
|
+
function getUntaintedPrototype$2(key) {
|
|
9591
|
+
if (untaintedBasePrototype$2[key])
|
|
9592
|
+
return untaintedBasePrototype$2[key];
|
|
9518
9593
|
const defaultObj = angularZoneUnpatchedAlternative$1(key) ||globalThis[key];
|
|
9519
9594
|
const defaultPrototype = defaultObj.prototype;
|
|
9520
|
-
const accessorNames = key in testableAccessors ? testableAccessors[key] : void 0;
|
|
9595
|
+
const accessorNames = key in testableAccessors$2 ? testableAccessors$2[key] : void 0;
|
|
9521
9596
|
const isUntaintedAccessors = Boolean(
|
|
9522
9597
|
accessorNames && // @ts-expect-error 2345
|
|
9523
9598
|
accessorNames.every(
|
|
@@ -9529,7 +9604,7 @@ var leanbase = (function () {
|
|
|
9529
9604
|
}
|
|
9530
9605
|
)
|
|
9531
9606
|
);
|
|
9532
|
-
const methodNames = key in testableMethods ? testableMethods[key] : void 0;
|
|
9607
|
+
const methodNames = key in testableMethods$2 ? testableMethods$2[key] : void 0;
|
|
9533
9608
|
const isUntaintedMethods = Boolean(
|
|
9534
9609
|
methodNames && methodNames.every(
|
|
9535
9610
|
// @ts-expect-error 2345
|
|
@@ -9540,7 +9615,7 @@ var leanbase = (function () {
|
|
|
9540
9615
|
)
|
|
9541
9616
|
);
|
|
9542
9617
|
if (isUntaintedAccessors && isUntaintedMethods) {
|
|
9543
|
-
untaintedBasePrototype[key] = defaultObj.prototype;
|
|
9618
|
+
untaintedBasePrototype$2[key] = defaultObj.prototype;
|
|
9544
9619
|
return defaultObj.prototype;
|
|
9545
9620
|
}
|
|
9546
9621
|
try {
|
|
@@ -9551,131 +9626,131 @@ var leanbase = (function () {
|
|
|
9551
9626
|
const untaintedObject = win[key].prototype;
|
|
9552
9627
|
document.body.removeChild(iframeEl);
|
|
9553
9628
|
if (!untaintedObject) return defaultPrototype;
|
|
9554
|
-
return untaintedBasePrototype[key] = untaintedObject;
|
|
9629
|
+
return untaintedBasePrototype$2[key] = untaintedObject;
|
|
9555
9630
|
} catch {
|
|
9556
9631
|
return defaultPrototype;
|
|
9557
9632
|
}
|
|
9558
9633
|
}
|
|
9559
|
-
const untaintedAccessorCache = {};
|
|
9560
|
-
function getUntaintedAccessor(key, instance, accessor) {
|
|
9634
|
+
const untaintedAccessorCache$2 = {};
|
|
9635
|
+
function getUntaintedAccessor$2(key, instance, accessor) {
|
|
9561
9636
|
var _a2;
|
|
9562
9637
|
const cacheKey = `${key}.${String(accessor)}`;
|
|
9563
|
-
if (untaintedAccessorCache[cacheKey])
|
|
9564
|
-
return untaintedAccessorCache[cacheKey].call(
|
|
9638
|
+
if (untaintedAccessorCache$2[cacheKey])
|
|
9639
|
+
return untaintedAccessorCache$2[cacheKey].call(
|
|
9565
9640
|
instance
|
|
9566
9641
|
);
|
|
9567
|
-
const untaintedPrototype = getUntaintedPrototype(key);
|
|
9642
|
+
const untaintedPrototype = getUntaintedPrototype$2(key);
|
|
9568
9643
|
const untaintedAccessor = (_a2 = Object.getOwnPropertyDescriptor(
|
|
9569
9644
|
untaintedPrototype,
|
|
9570
9645
|
accessor
|
|
9571
9646
|
)) == null ? void 0 : _a2.get;
|
|
9572
9647
|
if (!untaintedAccessor) return instance[accessor];
|
|
9573
|
-
untaintedAccessorCache[cacheKey] = untaintedAccessor;
|
|
9648
|
+
untaintedAccessorCache$2[cacheKey] = untaintedAccessor;
|
|
9574
9649
|
return untaintedAccessor.call(instance);
|
|
9575
9650
|
}
|
|
9576
|
-
const untaintedMethodCache = {};
|
|
9577
|
-
function getUntaintedMethod(key, instance, method) {
|
|
9651
|
+
const untaintedMethodCache$2 = {};
|
|
9652
|
+
function getUntaintedMethod$2(key, instance, method) {
|
|
9578
9653
|
const cacheKey = `${key}.${String(method)}`;
|
|
9579
|
-
if (untaintedMethodCache[cacheKey])
|
|
9580
|
-
return untaintedMethodCache[cacheKey].bind(
|
|
9654
|
+
if (untaintedMethodCache$2[cacheKey])
|
|
9655
|
+
return untaintedMethodCache$2[cacheKey].bind(
|
|
9581
9656
|
instance
|
|
9582
9657
|
);
|
|
9583
|
-
const untaintedPrototype = getUntaintedPrototype(key);
|
|
9658
|
+
const untaintedPrototype = getUntaintedPrototype$2(key);
|
|
9584
9659
|
const untaintedMethod = untaintedPrototype[method];
|
|
9585
9660
|
if (typeof untaintedMethod !== "function") return instance[method];
|
|
9586
|
-
untaintedMethodCache[cacheKey] = untaintedMethod;
|
|
9661
|
+
untaintedMethodCache$2[cacheKey] = untaintedMethod;
|
|
9587
9662
|
return untaintedMethod.bind(instance);
|
|
9588
9663
|
}
|
|
9589
|
-
function childNodes(n2) {
|
|
9590
|
-
return getUntaintedAccessor("Node", n2, "childNodes");
|
|
9664
|
+
function childNodes$2(n2) {
|
|
9665
|
+
return getUntaintedAccessor$2("Node", n2, "childNodes");
|
|
9591
9666
|
}
|
|
9592
|
-
function parentNode(n2) {
|
|
9593
|
-
return getUntaintedAccessor("Node", n2, "parentNode");
|
|
9667
|
+
function parentNode$2(n2) {
|
|
9668
|
+
return getUntaintedAccessor$2("Node", n2, "parentNode");
|
|
9594
9669
|
}
|
|
9595
|
-
function parentElement(n2) {
|
|
9596
|
-
return getUntaintedAccessor("Node", n2, "parentElement");
|
|
9670
|
+
function parentElement$2(n2) {
|
|
9671
|
+
return getUntaintedAccessor$2("Node", n2, "parentElement");
|
|
9597
9672
|
}
|
|
9598
|
-
function textContent(n2) {
|
|
9599
|
-
return getUntaintedAccessor("Node", n2, "textContent");
|
|
9673
|
+
function textContent$2(n2) {
|
|
9674
|
+
return getUntaintedAccessor$2("Node", n2, "textContent");
|
|
9600
9675
|
}
|
|
9601
|
-
function contains(n2, other) {
|
|
9602
|
-
return getUntaintedMethod("Node", n2, "contains")(other);
|
|
9676
|
+
function contains$2(n2, other) {
|
|
9677
|
+
return getUntaintedMethod$2("Node", n2, "contains")(other);
|
|
9603
9678
|
}
|
|
9604
|
-
function getRootNode(n2) {
|
|
9605
|
-
return getUntaintedMethod("Node", n2, "getRootNode")();
|
|
9679
|
+
function getRootNode$2(n2) {
|
|
9680
|
+
return getUntaintedMethod$2("Node", n2, "getRootNode")();
|
|
9606
9681
|
}
|
|
9607
|
-
function host(n2) {
|
|
9682
|
+
function host$2(n2) {
|
|
9608
9683
|
if (!n2 || !("host" in n2)) return null;
|
|
9609
|
-
return getUntaintedAccessor("ShadowRoot", n2, "host");
|
|
9684
|
+
return getUntaintedAccessor$2("ShadowRoot", n2, "host");
|
|
9610
9685
|
}
|
|
9611
|
-
function styleSheets(n2) {
|
|
9686
|
+
function styleSheets$2(n2) {
|
|
9612
9687
|
return n2.styleSheets;
|
|
9613
9688
|
}
|
|
9614
|
-
function shadowRoot(n2) {
|
|
9689
|
+
function shadowRoot$2(n2) {
|
|
9615
9690
|
if (!n2 || !("shadowRoot" in n2)) return null;
|
|
9616
|
-
return getUntaintedAccessor("Element", n2, "shadowRoot");
|
|
9617
|
-
}
|
|
9618
|
-
function querySelector(n2, selectors) {
|
|
9619
|
-
return getUntaintedAccessor("Element", n2, "querySelector")(selectors);
|
|
9620
|
-
}
|
|
9621
|
-
function querySelectorAll(n2, selectors) {
|
|
9622
|
-
return getUntaintedAccessor("Element", n2, "querySelectorAll")(selectors);
|
|
9623
|
-
}
|
|
9624
|
-
function mutationObserverCtor() {
|
|
9625
|
-
return getUntaintedPrototype("MutationObserver").constructor;
|
|
9626
|
-
}
|
|
9627
|
-
const index = {
|
|
9628
|
-
childNodes,
|
|
9629
|
-
parentNode,
|
|
9630
|
-
parentElement,
|
|
9631
|
-
textContent,
|
|
9632
|
-
contains,
|
|
9633
|
-
getRootNode,
|
|
9634
|
-
host,
|
|
9635
|
-
styleSheets,
|
|
9636
|
-
shadowRoot,
|
|
9637
|
-
querySelector,
|
|
9638
|
-
querySelectorAll,
|
|
9639
|
-
mutationObserver: mutationObserverCtor
|
|
9691
|
+
return getUntaintedAccessor$2("Element", n2, "shadowRoot");
|
|
9692
|
+
}
|
|
9693
|
+
function querySelector$2(n2, selectors) {
|
|
9694
|
+
return getUntaintedAccessor$2("Element", n2, "querySelector")(selectors);
|
|
9695
|
+
}
|
|
9696
|
+
function querySelectorAll$2(n2, selectors) {
|
|
9697
|
+
return getUntaintedAccessor$2("Element", n2, "querySelectorAll")(selectors);
|
|
9698
|
+
}
|
|
9699
|
+
function mutationObserverCtor$2() {
|
|
9700
|
+
return getUntaintedPrototype$2("MutationObserver").constructor;
|
|
9701
|
+
}
|
|
9702
|
+
const index$2 = {
|
|
9703
|
+
childNodes: childNodes$2,
|
|
9704
|
+
parentNode: parentNode$2,
|
|
9705
|
+
parentElement: parentElement$2,
|
|
9706
|
+
textContent: textContent$2,
|
|
9707
|
+
contains: contains$2,
|
|
9708
|
+
getRootNode: getRootNode$2,
|
|
9709
|
+
host: host$2,
|
|
9710
|
+
styleSheets: styleSheets$2,
|
|
9711
|
+
shadowRoot: shadowRoot$2,
|
|
9712
|
+
querySelector: querySelector$2,
|
|
9713
|
+
querySelectorAll: querySelectorAll$2,
|
|
9714
|
+
mutationObserver: mutationObserverCtor$2
|
|
9640
9715
|
};
|
|
9641
|
-
function on(type, fn, target = document) {
|
|
9716
|
+
function on$1(type, fn, target = document) {
|
|
9642
9717
|
const options = { capture: true, passive: true };
|
|
9643
9718
|
target.addEventListener(type, fn, options);
|
|
9644
9719
|
return () => target.removeEventListener(type, fn, options);
|
|
9645
9720
|
}
|
|
9646
|
-
const DEPARTED_MIRROR_ACCESS_WARNING = "Please stop import mirror directly. Instead of that,\r\nnow you can use replayer.getMirror() to access the mirror instance of a replayer,\r\nor you can use record.mirror to access the mirror instance during recording.";
|
|
9647
|
-
let _mirror = {
|
|
9721
|
+
const DEPARTED_MIRROR_ACCESS_WARNING$1 = "Please stop import mirror directly. Instead of that,\r\nnow you can use replayer.getMirror() to access the mirror instance of a replayer,\r\nor you can use record.mirror to access the mirror instance during recording.";
|
|
9722
|
+
let _mirror$1 = {
|
|
9648
9723
|
map: {},
|
|
9649
9724
|
getId() {
|
|
9650
|
-
console.error(DEPARTED_MIRROR_ACCESS_WARNING);
|
|
9725
|
+
console.error(DEPARTED_MIRROR_ACCESS_WARNING$1);
|
|
9651
9726
|
return -1;
|
|
9652
9727
|
},
|
|
9653
9728
|
getNode() {
|
|
9654
|
-
console.error(DEPARTED_MIRROR_ACCESS_WARNING);
|
|
9729
|
+
console.error(DEPARTED_MIRROR_ACCESS_WARNING$1);
|
|
9655
9730
|
return null;
|
|
9656
9731
|
},
|
|
9657
9732
|
removeNodeFromMap() {
|
|
9658
|
-
console.error(DEPARTED_MIRROR_ACCESS_WARNING);
|
|
9733
|
+
console.error(DEPARTED_MIRROR_ACCESS_WARNING$1);
|
|
9659
9734
|
},
|
|
9660
9735
|
has() {
|
|
9661
|
-
console.error(DEPARTED_MIRROR_ACCESS_WARNING);
|
|
9736
|
+
console.error(DEPARTED_MIRROR_ACCESS_WARNING$1);
|
|
9662
9737
|
return false;
|
|
9663
9738
|
},
|
|
9664
9739
|
reset() {
|
|
9665
|
-
console.error(DEPARTED_MIRROR_ACCESS_WARNING);
|
|
9740
|
+
console.error(DEPARTED_MIRROR_ACCESS_WARNING$1);
|
|
9666
9741
|
}
|
|
9667
9742
|
};
|
|
9668
9743
|
if (typeof window !== "undefined" && window.Proxy && window.Reflect) {
|
|
9669
|
-
_mirror = new Proxy(_mirror, {
|
|
9744
|
+
_mirror$1 = new Proxy(_mirror$1, {
|
|
9670
9745
|
get(target, prop, receiver) {
|
|
9671
9746
|
if (prop === "map") {
|
|
9672
|
-
console.error(DEPARTED_MIRROR_ACCESS_WARNING);
|
|
9747
|
+
console.error(DEPARTED_MIRROR_ACCESS_WARNING$1);
|
|
9673
9748
|
}
|
|
9674
9749
|
return Reflect.get(target, prop, receiver);
|
|
9675
9750
|
}
|
|
9676
9751
|
});
|
|
9677
9752
|
}
|
|
9678
|
-
function throttle(func, wait, options = {}) {
|
|
9753
|
+
function throttle$1(func, wait, options = {}) {
|
|
9679
9754
|
let timeout = null;
|
|
9680
9755
|
let previous = 0;
|
|
9681
9756
|
return function(...args) {
|
|
@@ -9701,7 +9776,7 @@ var leanbase = (function () {
|
|
|
9701
9776
|
}
|
|
9702
9777
|
};
|
|
9703
9778
|
}
|
|
9704
|
-
function hookSetter(target, key, d, isRevoked, win = window) {
|
|
9779
|
+
function hookSetter$1(target, key, d, isRevoked, win = window) {
|
|
9705
9780
|
const original = win.Object.getOwnPropertyDescriptor(target, key);
|
|
9706
9781
|
win.Object.defineProperty(
|
|
9707
9782
|
target,
|
|
@@ -9717,9 +9792,9 @@ var leanbase = (function () {
|
|
|
9717
9792
|
}
|
|
9718
9793
|
}
|
|
9719
9794
|
);
|
|
9720
|
-
return () => hookSetter(target, key, original || {}, true);
|
|
9795
|
+
return () => hookSetter$1(target, key, original || {}, true);
|
|
9721
9796
|
}
|
|
9722
|
-
function patch(source, name, replacement) {
|
|
9797
|
+
function patch$2(source, name, replacement) {
|
|
9723
9798
|
try {
|
|
9724
9799
|
if (!(name in source)) {
|
|
9725
9800
|
return () => {
|
|
@@ -9745,36 +9820,36 @@ var leanbase = (function () {
|
|
|
9745
9820
|
};
|
|
9746
9821
|
}
|
|
9747
9822
|
}
|
|
9748
|
-
let nowTimestamp = Date.now;
|
|
9823
|
+
let nowTimestamp$1 = Date.now;
|
|
9749
9824
|
if (!/* @__PURE__ */ /[1-9][0-9]{12}/.test(Date.now().toString())) {
|
|
9750
|
-
nowTimestamp = () => (/* @__PURE__ */ new Date()).getTime();
|
|
9825
|
+
nowTimestamp$1 = () => (/* @__PURE__ */ new Date()).getTime();
|
|
9751
9826
|
}
|
|
9752
|
-
function getWindowScroll(win) {
|
|
9827
|
+
function getWindowScroll$1(win) {
|
|
9753
9828
|
var _a2, _b, _c, _d;
|
|
9754
9829
|
const doc = win.document;
|
|
9755
9830
|
return {
|
|
9756
|
-
left: doc.scrollingElement ? doc.scrollingElement.scrollLeft : win.pageXOffset !== void 0 ? win.pageXOffset : doc.documentElement.scrollLeft || (doc == null ? void 0 : doc.body) && ((_a2 = index.parentElement(doc.body)) == null ? void 0 : _a2.scrollLeft) || ((_b = doc == null ? void 0 : doc.body) == null ? void 0 : _b.scrollLeft) || 0,
|
|
9757
|
-
top: doc.scrollingElement ? doc.scrollingElement.scrollTop : win.pageYOffset !== void 0 ? win.pageYOffset : (doc == null ? void 0 : doc.documentElement.scrollTop) || (doc == null ? void 0 : doc.body) && ((_c = index.parentElement(doc.body)) == null ? void 0 : _c.scrollTop) || ((_d = doc == null ? void 0 : doc.body) == null ? void 0 : _d.scrollTop) || 0
|
|
9831
|
+
left: doc.scrollingElement ? doc.scrollingElement.scrollLeft : win.pageXOffset !== void 0 ? win.pageXOffset : doc.documentElement.scrollLeft || (doc == null ? void 0 : doc.body) && ((_a2 = index$2.parentElement(doc.body)) == null ? void 0 : _a2.scrollLeft) || ((_b = doc == null ? void 0 : doc.body) == null ? void 0 : _b.scrollLeft) || 0,
|
|
9832
|
+
top: doc.scrollingElement ? doc.scrollingElement.scrollTop : win.pageYOffset !== void 0 ? win.pageYOffset : (doc == null ? void 0 : doc.documentElement.scrollTop) || (doc == null ? void 0 : doc.body) && ((_c = index$2.parentElement(doc.body)) == null ? void 0 : _c.scrollTop) || ((_d = doc == null ? void 0 : doc.body) == null ? void 0 : _d.scrollTop) || 0
|
|
9758
9833
|
};
|
|
9759
9834
|
}
|
|
9760
|
-
function getWindowHeight() {
|
|
9835
|
+
function getWindowHeight$1() {
|
|
9761
9836
|
return window.innerHeight || document.documentElement && document.documentElement.clientHeight || document.body && document.body.clientHeight;
|
|
9762
9837
|
}
|
|
9763
|
-
function getWindowWidth() {
|
|
9838
|
+
function getWindowWidth$1() {
|
|
9764
9839
|
return window.innerWidth || document.documentElement && document.documentElement.clientWidth || document.body && document.body.clientWidth;
|
|
9765
9840
|
}
|
|
9766
|
-
function closestElementOfNode(node2) {
|
|
9841
|
+
function closestElementOfNode$1(node2) {
|
|
9767
9842
|
if (!node2) {
|
|
9768
9843
|
return null;
|
|
9769
9844
|
}
|
|
9770
|
-
const el = node2.nodeType === node2.ELEMENT_NODE ? node2 : index.parentElement(node2);
|
|
9845
|
+
const el = node2.nodeType === node2.ELEMENT_NODE ? node2 : index$2.parentElement(node2);
|
|
9771
9846
|
return el;
|
|
9772
9847
|
}
|
|
9773
|
-
function isBlocked(node2, blockClass, blockSelector, checkAncestors) {
|
|
9848
|
+
function isBlocked$1(node2, blockClass, blockSelector, checkAncestors) {
|
|
9774
9849
|
if (!node2) {
|
|
9775
9850
|
return false;
|
|
9776
9851
|
}
|
|
9777
|
-
const el = closestElementOfNode(node2);
|
|
9852
|
+
const el = closestElementOfNode$1(node2);
|
|
9778
9853
|
if (!el) {
|
|
9779
9854
|
return false;
|
|
9780
9855
|
}
|
|
@@ -9783,7 +9858,7 @@ var leanbase = (function () {
|
|
|
9783
9858
|
if (el.classList.contains(blockClass)) return true;
|
|
9784
9859
|
if (checkAncestors && el.closest("." + blockClass) !== null) return true;
|
|
9785
9860
|
} else {
|
|
9786
|
-
if (classMatchesRegex(el, blockClass, checkAncestors)) return true;
|
|
9861
|
+
if (classMatchesRegex$1(el, blockClass, checkAncestors)) return true;
|
|
9787
9862
|
}
|
|
9788
9863
|
} catch (e2) {
|
|
9789
9864
|
}
|
|
@@ -9793,36 +9868,36 @@ var leanbase = (function () {
|
|
|
9793
9868
|
}
|
|
9794
9869
|
return false;
|
|
9795
9870
|
}
|
|
9796
|
-
function isSerialized(n2, mirror2) {
|
|
9871
|
+
function isSerialized$1(n2, mirror2) {
|
|
9797
9872
|
return mirror2.getId(n2) !== -1;
|
|
9798
9873
|
}
|
|
9799
|
-
function isIgnored(n2, mirror2, slimDOMOptions) {
|
|
9874
|
+
function isIgnored$1(n2, mirror2, slimDOMOptions) {
|
|
9800
9875
|
if (n2.tagName === "TITLE" && slimDOMOptions.headTitleMutations) {
|
|
9801
9876
|
return true;
|
|
9802
9877
|
}
|
|
9803
|
-
return mirror2.getId(n2) === IGNORED_NODE;
|
|
9878
|
+
return mirror2.getId(n2) === IGNORED_NODE$1;
|
|
9804
9879
|
}
|
|
9805
|
-
function isAncestorRemoved(target, mirror2) {
|
|
9806
|
-
if (isShadowRoot(target)) {
|
|
9880
|
+
function isAncestorRemoved$1(target, mirror2) {
|
|
9881
|
+
if (isShadowRoot$1(target)) {
|
|
9807
9882
|
return false;
|
|
9808
9883
|
}
|
|
9809
9884
|
const id = mirror2.getId(target);
|
|
9810
9885
|
if (!mirror2.has(id)) {
|
|
9811
9886
|
return true;
|
|
9812
9887
|
}
|
|
9813
|
-
const parent = index.parentNode(target);
|
|
9888
|
+
const parent = index$2.parentNode(target);
|
|
9814
9889
|
if (parent && parent.nodeType === target.DOCUMENT_NODE) {
|
|
9815
9890
|
return false;
|
|
9816
9891
|
}
|
|
9817
9892
|
if (!parent) {
|
|
9818
9893
|
return true;
|
|
9819
9894
|
}
|
|
9820
|
-
return isAncestorRemoved(parent, mirror2);
|
|
9895
|
+
return isAncestorRemoved$1(parent, mirror2);
|
|
9821
9896
|
}
|
|
9822
|
-
function legacy_isTouchEvent(event) {
|
|
9897
|
+
function legacy_isTouchEvent$1(event) {
|
|
9823
9898
|
return Boolean(event.changedTouches);
|
|
9824
9899
|
}
|
|
9825
|
-
function polyfill$1(win = window) {
|
|
9900
|
+
function polyfill$1$1(win = window) {
|
|
9826
9901
|
if ("NodeList" in win && !win.NodeList.prototype.forEach) {
|
|
9827
9902
|
win.NodeList.prototype.forEach = Array.prototype.forEach;
|
|
9828
9903
|
}
|
|
@@ -9830,26 +9905,26 @@ var leanbase = (function () {
|
|
|
9830
9905
|
win.DOMTokenList.prototype.forEach = Array.prototype.forEach;
|
|
9831
9906
|
}
|
|
9832
9907
|
}
|
|
9833
|
-
function isSerializedIframe(n2, mirror2) {
|
|
9908
|
+
function isSerializedIframe$1(n2, mirror2) {
|
|
9834
9909
|
return Boolean(n2.nodeName === "IFRAME" && mirror2.getMeta(n2));
|
|
9835
9910
|
}
|
|
9836
|
-
function isSerializedStylesheet(n2, mirror2) {
|
|
9911
|
+
function isSerializedStylesheet$1(n2, mirror2) {
|
|
9837
9912
|
return Boolean(
|
|
9838
9913
|
n2.nodeName === "LINK" && n2.nodeType === n2.ELEMENT_NODE && n2.getAttribute && n2.getAttribute("rel") === "stylesheet" && mirror2.getMeta(n2)
|
|
9839
9914
|
);
|
|
9840
9915
|
}
|
|
9841
|
-
function hasShadowRoot(n2) {
|
|
9916
|
+
function hasShadowRoot$1(n2) {
|
|
9842
9917
|
if (!n2) return false;
|
|
9843
|
-
if (n2 instanceof BaseRRNode && "shadowRoot" in n2) {
|
|
9918
|
+
if (n2 instanceof BaseRRNode$1 && "shadowRoot" in n2) {
|
|
9844
9919
|
return Boolean(n2.shadowRoot);
|
|
9845
9920
|
}
|
|
9846
|
-
return Boolean(index.shadowRoot(n2));
|
|
9921
|
+
return Boolean(index$2.shadowRoot(n2));
|
|
9847
9922
|
}
|
|
9848
|
-
class StyleSheetMirror {
|
|
9923
|
+
let StyleSheetMirror$1 = class StyleSheetMirror {
|
|
9849
9924
|
constructor() {
|
|
9850
|
-
__publicField(this, "id", 1);
|
|
9851
|
-
__publicField(this, "styleIDMap", /* @__PURE__ */ new WeakMap());
|
|
9852
|
-
__publicField(this, "idStyleMap", /* @__PURE__ */ new Map());
|
|
9925
|
+
__publicField$2(this, "id", 1);
|
|
9926
|
+
__publicField$2(this, "styleIDMap", /* @__PURE__ */ new WeakMap());
|
|
9927
|
+
__publicField$2(this, "idStyleMap", /* @__PURE__ */ new Map());
|
|
9853
9928
|
}
|
|
9854
9929
|
getId(stylesheet) {
|
|
9855
9930
|
return this.styleIDMap.get(stylesheet) ?? -1;
|
|
@@ -9881,31 +9956,31 @@ var leanbase = (function () {
|
|
|
9881
9956
|
generateId() {
|
|
9882
9957
|
return this.id++;
|
|
9883
9958
|
}
|
|
9884
|
-
}
|
|
9885
|
-
function getShadowHost(n2) {
|
|
9959
|
+
};
|
|
9960
|
+
function getShadowHost$1(n2) {
|
|
9886
9961
|
var _a2;
|
|
9887
9962
|
let shadowHost = null;
|
|
9888
|
-
if ("getRootNode" in n2 && ((_a2 = index.getRootNode(n2)) == null ? void 0 : _a2.nodeType) === Node.DOCUMENT_FRAGMENT_NODE && index.host(index.getRootNode(n2)))
|
|
9889
|
-
shadowHost = index.host(index.getRootNode(n2));
|
|
9963
|
+
if ("getRootNode" in n2 && ((_a2 = index$2.getRootNode(n2)) == null ? void 0 : _a2.nodeType) === Node.DOCUMENT_FRAGMENT_NODE && index$2.host(index$2.getRootNode(n2)))
|
|
9964
|
+
shadowHost = index$2.host(index$2.getRootNode(n2));
|
|
9890
9965
|
return shadowHost;
|
|
9891
9966
|
}
|
|
9892
|
-
function getRootShadowHost(n2) {
|
|
9967
|
+
function getRootShadowHost$1(n2) {
|
|
9893
9968
|
let rootShadowHost = n2;
|
|
9894
9969
|
let shadowHost;
|
|
9895
|
-
while (shadowHost = getShadowHost(rootShadowHost))
|
|
9970
|
+
while (shadowHost = getShadowHost$1(rootShadowHost))
|
|
9896
9971
|
rootShadowHost = shadowHost;
|
|
9897
9972
|
return rootShadowHost;
|
|
9898
9973
|
}
|
|
9899
|
-
function shadowHostInDom(n2) {
|
|
9974
|
+
function shadowHostInDom$1(n2) {
|
|
9900
9975
|
const doc = n2.ownerDocument;
|
|
9901
9976
|
if (!doc) return false;
|
|
9902
|
-
const shadowHost = getRootShadowHost(n2);
|
|
9903
|
-
return index.contains(doc, shadowHost);
|
|
9977
|
+
const shadowHost = getRootShadowHost$1(n2);
|
|
9978
|
+
return index$2.contains(doc, shadowHost);
|
|
9904
9979
|
}
|
|
9905
|
-
function inDom(n2) {
|
|
9980
|
+
function inDom$1(n2) {
|
|
9906
9981
|
const doc = n2.ownerDocument;
|
|
9907
9982
|
if (!doc) return false;
|
|
9908
|
-
return index.contains(doc, n2) || shadowHostInDom(n2);
|
|
9983
|
+
return index$2.contains(doc, n2) || shadowHostInDom$1(n2);
|
|
9909
9984
|
}
|
|
9910
9985
|
var EventType = /* @__PURE__ */ ((EventType2) => {
|
|
9911
9986
|
EventType2[EventType2["DomContentLoaded"] = 0] = "DomContentLoaded";
|
|
@@ -9976,9 +10051,9 @@ var leanbase = (function () {
|
|
|
9976
10051
|
}
|
|
9977
10052
|
class DoubleLinkedList {
|
|
9978
10053
|
constructor() {
|
|
9979
|
-
__publicField(this, "length", 0);
|
|
9980
|
-
__publicField(this, "head", null);
|
|
9981
|
-
__publicField(this, "tail", null);
|
|
10054
|
+
__publicField$2(this, "length", 0);
|
|
10055
|
+
__publicField$2(this, "head", null);
|
|
10056
|
+
__publicField$2(this, "tail", null);
|
|
9982
10057
|
}
|
|
9983
10058
|
get(position) {
|
|
9984
10059
|
if (position >= this.length) {
|
|
@@ -10054,44 +10129,44 @@ var leanbase = (function () {
|
|
|
10054
10129
|
const moveKey = (id, parentId) => `${id}@${parentId}`;
|
|
10055
10130
|
class MutationBuffer {
|
|
10056
10131
|
constructor() {
|
|
10057
|
-
__publicField(this, "frozen", false);
|
|
10058
|
-
__publicField(this, "locked", false);
|
|
10059
|
-
__publicField(this, "texts", []);
|
|
10060
|
-
__publicField(this, "attributes", []);
|
|
10061
|
-
__publicField(this, "attributeMap", /* @__PURE__ */ new WeakMap());
|
|
10062
|
-
__publicField(this, "removes", []);
|
|
10063
|
-
__publicField(this, "mapRemoves", []);
|
|
10064
|
-
__publicField(this, "movedMap", {});
|
|
10065
|
-
__publicField(this, "addedSet", /* @__PURE__ */ new Set());
|
|
10066
|
-
__publicField(this, "movedSet", /* @__PURE__ */ new Set());
|
|
10067
|
-
__publicField(this, "droppedSet", /* @__PURE__ */ new Set());
|
|
10068
|
-
__publicField(this, "mutationCb");
|
|
10069
|
-
__publicField(this, "blockClass");
|
|
10070
|
-
__publicField(this, "blockSelector");
|
|
10071
|
-
__publicField(this, "maskTextClass");
|
|
10072
|
-
__publicField(this, "maskTextSelector");
|
|
10073
|
-
__publicField(this, "inlineStylesheet");
|
|
10074
|
-
__publicField(this, "maskInputOptions");
|
|
10075
|
-
__publicField(this, "maskTextFn");
|
|
10076
|
-
__publicField(this, "maskInputFn");
|
|
10077
|
-
__publicField(this, "keepIframeSrcFn");
|
|
10078
|
-
__publicField(this, "recordCanvas");
|
|
10079
|
-
__publicField(this, "inlineImages");
|
|
10080
|
-
__publicField(this, "slimDOMOptions");
|
|
10081
|
-
__publicField(this, "dataURLOptions");
|
|
10082
|
-
__publicField(this, "doc");
|
|
10083
|
-
__publicField(this, "mirror");
|
|
10084
|
-
__publicField(this, "iframeManager");
|
|
10085
|
-
__publicField(this, "stylesheetManager");
|
|
10086
|
-
__publicField(this, "shadowDomManager");
|
|
10087
|
-
__publicField(this, "canvasManager");
|
|
10088
|
-
__publicField(this, "processedNodeManager");
|
|
10089
|
-
__publicField(this, "unattachedDoc");
|
|
10090
|
-
__publicField(this, "processMutations", (mutations) => {
|
|
10132
|
+
__publicField$2(this, "frozen", false);
|
|
10133
|
+
__publicField$2(this, "locked", false);
|
|
10134
|
+
__publicField$2(this, "texts", []);
|
|
10135
|
+
__publicField$2(this, "attributes", []);
|
|
10136
|
+
__publicField$2(this, "attributeMap", /* @__PURE__ */ new WeakMap());
|
|
10137
|
+
__publicField$2(this, "removes", []);
|
|
10138
|
+
__publicField$2(this, "mapRemoves", []);
|
|
10139
|
+
__publicField$2(this, "movedMap", {});
|
|
10140
|
+
__publicField$2(this, "addedSet", /* @__PURE__ */ new Set());
|
|
10141
|
+
__publicField$2(this, "movedSet", /* @__PURE__ */ new Set());
|
|
10142
|
+
__publicField$2(this, "droppedSet", /* @__PURE__ */ new Set());
|
|
10143
|
+
__publicField$2(this, "mutationCb");
|
|
10144
|
+
__publicField$2(this, "blockClass");
|
|
10145
|
+
__publicField$2(this, "blockSelector");
|
|
10146
|
+
__publicField$2(this, "maskTextClass");
|
|
10147
|
+
__publicField$2(this, "maskTextSelector");
|
|
10148
|
+
__publicField$2(this, "inlineStylesheet");
|
|
10149
|
+
__publicField$2(this, "maskInputOptions");
|
|
10150
|
+
__publicField$2(this, "maskTextFn");
|
|
10151
|
+
__publicField$2(this, "maskInputFn");
|
|
10152
|
+
__publicField$2(this, "keepIframeSrcFn");
|
|
10153
|
+
__publicField$2(this, "recordCanvas");
|
|
10154
|
+
__publicField$2(this, "inlineImages");
|
|
10155
|
+
__publicField$2(this, "slimDOMOptions");
|
|
10156
|
+
__publicField$2(this, "dataURLOptions");
|
|
10157
|
+
__publicField$2(this, "doc");
|
|
10158
|
+
__publicField$2(this, "mirror");
|
|
10159
|
+
__publicField$2(this, "iframeManager");
|
|
10160
|
+
__publicField$2(this, "stylesheetManager");
|
|
10161
|
+
__publicField$2(this, "shadowDomManager");
|
|
10162
|
+
__publicField$2(this, "canvasManager");
|
|
10163
|
+
__publicField$2(this, "processedNodeManager");
|
|
10164
|
+
__publicField$2(this, "unattachedDoc");
|
|
10165
|
+
__publicField$2(this, "processMutations", (mutations) => {
|
|
10091
10166
|
mutations.forEach(this.processMutation);
|
|
10092
10167
|
this.emit();
|
|
10093
10168
|
});
|
|
10094
|
-
__publicField(this, "emit", () => {
|
|
10169
|
+
__publicField$2(this, "emit", () => {
|
|
10095
10170
|
if (this.frozen || this.locked) {
|
|
10096
10171
|
return;
|
|
10097
10172
|
}
|
|
@@ -10100,19 +10175,19 @@ var leanbase = (function () {
|
|
|
10100
10175
|
const addList = new DoubleLinkedList();
|
|
10101
10176
|
const getNextId = (n2) => {
|
|
10102
10177
|
let ns = n2;
|
|
10103
|
-
let nextId = IGNORED_NODE;
|
|
10104
|
-
while (nextId === IGNORED_NODE) {
|
|
10178
|
+
let nextId = IGNORED_NODE$1;
|
|
10179
|
+
while (nextId === IGNORED_NODE$1) {
|
|
10105
10180
|
ns = ns && ns.nextSibling;
|
|
10106
10181
|
nextId = ns && this.mirror.getId(ns);
|
|
10107
10182
|
}
|
|
10108
10183
|
return nextId;
|
|
10109
10184
|
};
|
|
10110
10185
|
const pushAdd = (n2) => {
|
|
10111
|
-
const parent = index.parentNode(n2);
|
|
10112
|
-
if (!parent || !inDom(n2) || parent.tagName === "TEXTAREA") {
|
|
10186
|
+
const parent = index$2.parentNode(n2);
|
|
10187
|
+
if (!parent || !inDom$1(n2) || parent.tagName === "TEXTAREA") {
|
|
10113
10188
|
return;
|
|
10114
10189
|
}
|
|
10115
|
-
const parentId = isShadowRoot(parent) ? this.mirror.getId(getShadowHost(n2)) : this.mirror.getId(parent);
|
|
10190
|
+
const parentId = isShadowRoot$1(parent) ? this.mirror.getId(getShadowHost$1(n2)) : this.mirror.getId(parent);
|
|
10116
10191
|
const nextId = getNextId(n2);
|
|
10117
10192
|
if (parentId === -1 || nextId === -1) {
|
|
10118
10193
|
return addList.addNode(n2);
|
|
@@ -10135,16 +10210,16 @@ var leanbase = (function () {
|
|
|
10135
10210
|
recordCanvas: this.recordCanvas,
|
|
10136
10211
|
inlineImages: this.inlineImages,
|
|
10137
10212
|
onSerialize: (currentN) => {
|
|
10138
|
-
if (isSerializedIframe(currentN, this.mirror)) {
|
|
10213
|
+
if (isSerializedIframe$1(currentN, this.mirror)) {
|
|
10139
10214
|
this.iframeManager.addIframe(currentN);
|
|
10140
10215
|
}
|
|
10141
|
-
if (isSerializedStylesheet(currentN, this.mirror)) {
|
|
10216
|
+
if (isSerializedStylesheet$1(currentN, this.mirror)) {
|
|
10142
10217
|
this.stylesheetManager.trackLinkElement(
|
|
10143
10218
|
currentN
|
|
10144
10219
|
);
|
|
10145
10220
|
}
|
|
10146
|
-
if (hasShadowRoot(n2)) {
|
|
10147
|
-
this.shadowDomManager.addShadowRoot(index.shadowRoot(n2), this.doc);
|
|
10221
|
+
if (hasShadowRoot$1(n2)) {
|
|
10222
|
+
this.shadowDomManager.addShadowRoot(index$2.shadowRoot(n2), this.doc);
|
|
10148
10223
|
}
|
|
10149
10224
|
},
|
|
10150
10225
|
onIframeLoad: (iframe, childSn) => {
|
|
@@ -10168,7 +10243,7 @@ var leanbase = (function () {
|
|
|
10168
10243
|
this.mirror.removeNodeFromMap(this.mapRemoves.shift());
|
|
10169
10244
|
}
|
|
10170
10245
|
for (const n2 of this.movedSet) {
|
|
10171
|
-
if (isParentRemoved(this.removes, n2, this.mirror) && !this.movedSet.has(index.parentNode(n2))) {
|
|
10246
|
+
if (isParentRemoved(this.removes, n2, this.mirror) && !this.movedSet.has(index$2.parentNode(n2))) {
|
|
10172
10247
|
continue;
|
|
10173
10248
|
}
|
|
10174
10249
|
pushAdd(n2);
|
|
@@ -10186,7 +10261,7 @@ var leanbase = (function () {
|
|
|
10186
10261
|
while (addList.length) {
|
|
10187
10262
|
let node2 = null;
|
|
10188
10263
|
if (candidate) {
|
|
10189
|
-
const parentId = this.mirror.getId(index.parentNode(candidate.value));
|
|
10264
|
+
const parentId = this.mirror.getId(index$2.parentNode(candidate.value));
|
|
10190
10265
|
const nextId = getNextId(candidate.value);
|
|
10191
10266
|
if (parentId !== -1 && nextId !== -1) {
|
|
10192
10267
|
node2 = candidate;
|
|
@@ -10198,7 +10273,7 @@ var leanbase = (function () {
|
|
|
10198
10273
|
const _node = tailNode;
|
|
10199
10274
|
tailNode = tailNode.previous;
|
|
10200
10275
|
if (_node) {
|
|
10201
|
-
const parentId = this.mirror.getId(index.parentNode(_node.value));
|
|
10276
|
+
const parentId = this.mirror.getId(index$2.parentNode(_node.value));
|
|
10202
10277
|
const nextId = getNextId(_node.value);
|
|
10203
10278
|
if (nextId === -1) continue;
|
|
10204
10279
|
else if (parentId !== -1) {
|
|
@@ -10206,9 +10281,9 @@ var leanbase = (function () {
|
|
|
10206
10281
|
break;
|
|
10207
10282
|
} else {
|
|
10208
10283
|
const unhandledNode = _node.value;
|
|
10209
|
-
const parent = index.parentNode(unhandledNode);
|
|
10284
|
+
const parent = index$2.parentNode(unhandledNode);
|
|
10210
10285
|
if (parent && parent.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {
|
|
10211
|
-
const shadowHost = index.host(parent);
|
|
10286
|
+
const shadowHost = index$2.host(parent);
|
|
10212
10287
|
const parentId2 = this.mirror.getId(shadowHost);
|
|
10213
10288
|
if (parentId2 !== -1) {
|
|
10214
10289
|
node2 = _node;
|
|
@@ -10232,7 +10307,7 @@ var leanbase = (function () {
|
|
|
10232
10307
|
const payload = {
|
|
10233
10308
|
texts: this.texts.map((text) => {
|
|
10234
10309
|
const n2 = text.node;
|
|
10235
|
-
const parent = index.parentNode(n2);
|
|
10310
|
+
const parent = index$2.parentNode(n2);
|
|
10236
10311
|
if (parent && parent.tagName === "TEXTAREA") {
|
|
10237
10312
|
this.genTextAreaValueMutation(parent);
|
|
10238
10313
|
}
|
|
@@ -10273,7 +10348,7 @@ var leanbase = (function () {
|
|
|
10273
10348
|
this.movedMap = {};
|
|
10274
10349
|
this.mutationCb(payload);
|
|
10275
10350
|
});
|
|
10276
|
-
__publicField(this, "genTextAreaValueMutation", (textarea) => {
|
|
10351
|
+
__publicField$2(this, "genTextAreaValueMutation", (textarea) => {
|
|
10277
10352
|
let item = this.attributeMap.get(textarea);
|
|
10278
10353
|
if (!item) {
|
|
10279
10354
|
item = {
|
|
@@ -10286,18 +10361,18 @@ var leanbase = (function () {
|
|
|
10286
10361
|
this.attributeMap.set(textarea, item);
|
|
10287
10362
|
}
|
|
10288
10363
|
item.attributes.value = Array.from(
|
|
10289
|
-
index.childNodes(textarea),
|
|
10290
|
-
(cn) => index.textContent(cn) || ""
|
|
10364
|
+
index$2.childNodes(textarea),
|
|
10365
|
+
(cn) => index$2.textContent(cn) || ""
|
|
10291
10366
|
).join("");
|
|
10292
10367
|
});
|
|
10293
|
-
__publicField(this, "processMutation", (m) => {
|
|
10294
|
-
if (isIgnored(m.target, this.mirror, this.slimDOMOptions)) {
|
|
10368
|
+
__publicField$2(this, "processMutation", (m) => {
|
|
10369
|
+
if (isIgnored$1(m.target, this.mirror, this.slimDOMOptions)) {
|
|
10295
10370
|
return;
|
|
10296
10371
|
}
|
|
10297
10372
|
switch (m.type) {
|
|
10298
10373
|
case "characterData": {
|
|
10299
|
-
const value = index.textContent(m.target);
|
|
10300
|
-
if (!isBlocked(m.target, this.blockClass, this.blockSelector, false) && value !== m.oldValue) {
|
|
10374
|
+
const value = index$2.textContent(m.target);
|
|
10375
|
+
if (!isBlocked$1(m.target, this.blockClass, this.blockSelector, false) && value !== m.oldValue) {
|
|
10301
10376
|
this.texts.push({
|
|
10302
10377
|
value: needMaskingText(
|
|
10303
10378
|
m.target,
|
|
@@ -10305,7 +10380,7 @@ var leanbase = (function () {
|
|
|
10305
10380
|
this.maskTextSelector,
|
|
10306
10381
|
true
|
|
10307
10382
|
// checkAncestors
|
|
10308
|
-
) && value ? this.maskTextFn ? this.maskTextFn(value, closestElementOfNode(m.target)) : value.replace(/[\S]/g, "*") : value,
|
|
10383
|
+
) && value ? this.maskTextFn ? this.maskTextFn(value, closestElementOfNode$1(m.target)) : value.replace(/[\S]/g, "*") : value,
|
|
10309
10384
|
node: m.target
|
|
10310
10385
|
});
|
|
10311
10386
|
}
|
|
@@ -10326,7 +10401,7 @@ var leanbase = (function () {
|
|
|
10326
10401
|
maskInputFn: this.maskInputFn
|
|
10327
10402
|
});
|
|
10328
10403
|
}
|
|
10329
|
-
if (isBlocked(m.target, this.blockClass, this.blockSelector, false) || value === m.oldValue) {
|
|
10404
|
+
if (isBlocked$1(m.target, this.blockClass, this.blockSelector, false) || value === m.oldValue) {
|
|
10330
10405
|
return;
|
|
10331
10406
|
}
|
|
10332
10407
|
let item = this.attributeMap.get(m.target);
|
|
@@ -10398,7 +10473,7 @@ var leanbase = (function () {
|
|
|
10398
10473
|
break;
|
|
10399
10474
|
}
|
|
10400
10475
|
case "childList": {
|
|
10401
|
-
if (isBlocked(m.target, this.blockClass, this.blockSelector, true))
|
|
10476
|
+
if (isBlocked$1(m.target, this.blockClass, this.blockSelector, true))
|
|
10402
10477
|
return;
|
|
10403
10478
|
if (m.target.tagName === "TEXTAREA") {
|
|
10404
10479
|
this.genTextAreaValueMutation(m.target);
|
|
@@ -10407,22 +10482,22 @@ var leanbase = (function () {
|
|
|
10407
10482
|
m.addedNodes.forEach((n2) => this.genAdds(n2, m.target));
|
|
10408
10483
|
m.removedNodes.forEach((n2) => {
|
|
10409
10484
|
const nodeId = this.mirror.getId(n2);
|
|
10410
|
-
const parentId = isShadowRoot(m.target) ? this.mirror.getId(index.host(m.target)) : this.mirror.getId(m.target);
|
|
10411
|
-
if (isBlocked(m.target, this.blockClass, this.blockSelector, false) || isIgnored(n2, this.mirror, this.slimDOMOptions) || !isSerialized(n2, this.mirror)) {
|
|
10485
|
+
const parentId = isShadowRoot$1(m.target) ? this.mirror.getId(index$2.host(m.target)) : this.mirror.getId(m.target);
|
|
10486
|
+
if (isBlocked$1(m.target, this.blockClass, this.blockSelector, false) || isIgnored$1(n2, this.mirror, this.slimDOMOptions) || !isSerialized$1(n2, this.mirror)) {
|
|
10412
10487
|
return;
|
|
10413
10488
|
}
|
|
10414
10489
|
if (this.addedSet.has(n2)) {
|
|
10415
10490
|
deepDelete(this.addedSet, n2);
|
|
10416
10491
|
this.droppedSet.add(n2);
|
|
10417
10492
|
} else if (this.addedSet.has(m.target) && nodeId === -1) ;
|
|
10418
|
-
else if (isAncestorRemoved(m.target, this.mirror)) ;
|
|
10493
|
+
else if (isAncestorRemoved$1(m.target, this.mirror)) ;
|
|
10419
10494
|
else if (this.movedSet.has(n2) && this.movedMap[moveKey(nodeId, parentId)]) {
|
|
10420
10495
|
deepDelete(this.movedSet, n2);
|
|
10421
10496
|
} else {
|
|
10422
10497
|
this.removes.push({
|
|
10423
10498
|
parentId,
|
|
10424
10499
|
id: nodeId,
|
|
10425
|
-
isShadow: isShadowRoot(m.target) && isNativeShadowDom(m.target) ? true : void 0
|
|
10500
|
+
isShadow: isShadowRoot$1(m.target) && isNativeShadowDom(m.target) ? true : void 0
|
|
10426
10501
|
});
|
|
10427
10502
|
}
|
|
10428
10503
|
this.mapRemoves.push(n2);
|
|
@@ -10431,11 +10506,11 @@ var leanbase = (function () {
|
|
|
10431
10506
|
}
|
|
10432
10507
|
}
|
|
10433
10508
|
});
|
|
10434
|
-
__publicField(this, "genAdds", (n2, target) => {
|
|
10509
|
+
__publicField$2(this, "genAdds", (n2, target) => {
|
|
10435
10510
|
if (this.processedNodeManager.inOtherBuffer(n2, this)) return;
|
|
10436
10511
|
if (this.addedSet.has(n2) || this.movedSet.has(n2)) return;
|
|
10437
10512
|
if (this.mirror.hasNode(n2)) {
|
|
10438
|
-
if (isIgnored(n2, this.mirror, this.slimDOMOptions)) {
|
|
10513
|
+
if (isIgnored$1(n2, this.mirror, this.slimDOMOptions)) {
|
|
10439
10514
|
return;
|
|
10440
10515
|
}
|
|
10441
10516
|
this.movedSet.add(n2);
|
|
@@ -10450,10 +10525,10 @@ var leanbase = (function () {
|
|
|
10450
10525
|
this.addedSet.add(n2);
|
|
10451
10526
|
this.droppedSet.delete(n2);
|
|
10452
10527
|
}
|
|
10453
|
-
if (!isBlocked(n2, this.blockClass, this.blockSelector, false)) {
|
|
10454
|
-
index.childNodes(n2).forEach((childN) => this.genAdds(childN));
|
|
10455
|
-
if (hasShadowRoot(n2)) {
|
|
10456
|
-
index.childNodes(index.shadowRoot(n2)).forEach((childN) => {
|
|
10528
|
+
if (!isBlocked$1(n2, this.blockClass, this.blockSelector, false)) {
|
|
10529
|
+
index$2.childNodes(n2).forEach((childN) => this.genAdds(childN));
|
|
10530
|
+
if (hasShadowRoot$1(n2)) {
|
|
10531
|
+
index$2.childNodes(index$2.shadowRoot(n2)).forEach((childN) => {
|
|
10457
10532
|
this.processedNodeManager.add(childN, this);
|
|
10458
10533
|
this.genAdds(childN, n2);
|
|
10459
10534
|
});
|
|
@@ -10516,20 +10591,20 @@ var leanbase = (function () {
|
|
|
10516
10591
|
}
|
|
10517
10592
|
function deepDelete(addsSet, n2) {
|
|
10518
10593
|
addsSet.delete(n2);
|
|
10519
|
-
index.childNodes(n2).forEach((childN) => deepDelete(addsSet, childN));
|
|
10594
|
+
index$2.childNodes(n2).forEach((childN) => deepDelete(addsSet, childN));
|
|
10520
10595
|
}
|
|
10521
10596
|
function isParentRemoved(removes, n2, mirror2) {
|
|
10522
10597
|
if (removes.length === 0) return false;
|
|
10523
10598
|
return _isParentRemoved(removes, n2, mirror2);
|
|
10524
10599
|
}
|
|
10525
10600
|
function _isParentRemoved(removes, n2, mirror2) {
|
|
10526
|
-
let node2 = index.parentNode(n2);
|
|
10601
|
+
let node2 = index$2.parentNode(n2);
|
|
10527
10602
|
while (node2) {
|
|
10528
10603
|
const parentId = mirror2.getId(node2);
|
|
10529
10604
|
if (removes.some((r2) => r2.id === parentId)) {
|
|
10530
10605
|
return true;
|
|
10531
10606
|
}
|
|
10532
|
-
node2 = index.parentNode(node2);
|
|
10607
|
+
node2 = index$2.parentNode(node2);
|
|
10533
10608
|
}
|
|
10534
10609
|
return false;
|
|
10535
10610
|
}
|
|
@@ -10538,7 +10613,7 @@ var leanbase = (function () {
|
|
|
10538
10613
|
return _isAncestorInSet(set, n2);
|
|
10539
10614
|
}
|
|
10540
10615
|
function _isAncestorInSet(set, n2) {
|
|
10541
|
-
const parent = index.parentNode(n2);
|
|
10616
|
+
const parent = index$2.parentNode(n2);
|
|
10542
10617
|
if (!parent) {
|
|
10543
10618
|
return false;
|
|
10544
10619
|
}
|
|
@@ -10589,7 +10664,7 @@ var leanbase = (function () {
|
|
|
10589
10664
|
const mutationBuffer = new MutationBuffer();
|
|
10590
10665
|
mutationBuffers.push(mutationBuffer);
|
|
10591
10666
|
mutationBuffer.init(options);
|
|
10592
|
-
const observer = new (mutationObserverCtor())(
|
|
10667
|
+
const observer = new (mutationObserverCtor$2())(
|
|
10593
10668
|
callbackWrapper(mutationBuffer.processMutations.bind(mutationBuffer))
|
|
10594
10669
|
);
|
|
10595
10670
|
observer.observe(rootEl, {
|
|
@@ -10616,7 +10691,7 @@ var leanbase = (function () {
|
|
|
10616
10691
|
const callbackThreshold = typeof sampling.mousemoveCallback === "number" ? sampling.mousemoveCallback : 500;
|
|
10617
10692
|
let positions = [];
|
|
10618
10693
|
let timeBaseline;
|
|
10619
|
-
const wrappedCb = throttle(
|
|
10694
|
+
const wrappedCb = throttle$1(
|
|
10620
10695
|
callbackWrapper(
|
|
10621
10696
|
(source) => {
|
|
10622
10697
|
const totalOffset = Date.now() - timeBaseline;
|
|
@@ -10634,18 +10709,18 @@ var leanbase = (function () {
|
|
|
10634
10709
|
callbackThreshold
|
|
10635
10710
|
);
|
|
10636
10711
|
const updatePosition = callbackWrapper(
|
|
10637
|
-
throttle(
|
|
10712
|
+
throttle$1(
|
|
10638
10713
|
callbackWrapper((evt) => {
|
|
10639
10714
|
const target = getEventTarget(evt);
|
|
10640
|
-
const { clientX, clientY } = legacy_isTouchEvent(evt) ? evt.changedTouches[0] : evt;
|
|
10715
|
+
const { clientX, clientY } = legacy_isTouchEvent$1(evt) ? evt.changedTouches[0] : evt;
|
|
10641
10716
|
if (!timeBaseline) {
|
|
10642
|
-
timeBaseline = nowTimestamp();
|
|
10717
|
+
timeBaseline = nowTimestamp$1();
|
|
10643
10718
|
}
|
|
10644
10719
|
positions.push({
|
|
10645
10720
|
x: clientX,
|
|
10646
10721
|
y: clientY,
|
|
10647
10722
|
id: mirror2.getId(target),
|
|
10648
|
-
timeOffset: nowTimestamp() - timeBaseline
|
|
10723
|
+
timeOffset: nowTimestamp$1() - timeBaseline
|
|
10649
10724
|
});
|
|
10650
10725
|
wrappedCb(
|
|
10651
10726
|
typeof DragEvent !== "undefined" && evt instanceof DragEvent ? IncrementalSource.Drag : evt instanceof MouseEvent ? IncrementalSource.MouseMove : IncrementalSource.TouchMove
|
|
@@ -10658,9 +10733,9 @@ var leanbase = (function () {
|
|
|
10658
10733
|
)
|
|
10659
10734
|
);
|
|
10660
10735
|
const handlers = [
|
|
10661
|
-
on("mousemove", updatePosition, doc),
|
|
10662
|
-
on("touchmove", updatePosition, doc),
|
|
10663
|
-
on("drag", updatePosition, doc)
|
|
10736
|
+
on$1("mousemove", updatePosition, doc),
|
|
10737
|
+
on$1("touchmove", updatePosition, doc),
|
|
10738
|
+
on$1("drag", updatePosition, doc)
|
|
10664
10739
|
];
|
|
10665
10740
|
return callbackWrapper(() => {
|
|
10666
10741
|
handlers.forEach((h) => h());
|
|
@@ -10684,7 +10759,7 @@ var leanbase = (function () {
|
|
|
10684
10759
|
const getHandler = (eventKey) => {
|
|
10685
10760
|
return (event) => {
|
|
10686
10761
|
const target = getEventTarget(event);
|
|
10687
|
-
if (isBlocked(target, blockClass, blockSelector, true)) {
|
|
10762
|
+
if (isBlocked$1(target, blockClass, blockSelector, true)) {
|
|
10688
10763
|
return;
|
|
10689
10764
|
}
|
|
10690
10765
|
let pointerType = null;
|
|
@@ -10708,7 +10783,7 @@ var leanbase = (function () {
|
|
|
10708
10783
|
thisEventKey = "TouchEnd";
|
|
10709
10784
|
}
|
|
10710
10785
|
} else if (pointerType === PointerTypes.Pen) ;
|
|
10711
|
-
} else if (legacy_isTouchEvent(event)) {
|
|
10786
|
+
} else if (legacy_isTouchEvent$1(event)) {
|
|
10712
10787
|
pointerType = PointerTypes.Touch;
|
|
10713
10788
|
}
|
|
10714
10789
|
if (pointerType !== null) {
|
|
@@ -10720,7 +10795,7 @@ var leanbase = (function () {
|
|
|
10720
10795
|
pointerType = currentPointerType;
|
|
10721
10796
|
currentPointerType = null;
|
|
10722
10797
|
}
|
|
10723
|
-
const e2 = legacy_isTouchEvent(event) ? event.changedTouches[0] : event;
|
|
10798
|
+
const e2 = legacy_isTouchEvent$1(event) ? event.changedTouches[0] : event;
|
|
10724
10799
|
if (!e2) {
|
|
10725
10800
|
return;
|
|
10726
10801
|
}
|
|
@@ -10754,7 +10829,7 @@ var leanbase = (function () {
|
|
|
10754
10829
|
return;
|
|
10755
10830
|
}
|
|
10756
10831
|
}
|
|
10757
|
-
handlers.push(on(eventName, handler, doc));
|
|
10832
|
+
handlers.push(on$1(eventName, handler, doc));
|
|
10758
10833
|
});
|
|
10759
10834
|
return callbackWrapper(() => {
|
|
10760
10835
|
handlers.forEach((h) => h());
|
|
@@ -10769,15 +10844,15 @@ var leanbase = (function () {
|
|
|
10769
10844
|
sampling
|
|
10770
10845
|
}) {
|
|
10771
10846
|
const updatePosition = callbackWrapper(
|
|
10772
|
-
throttle(
|
|
10847
|
+
throttle$1(
|
|
10773
10848
|
callbackWrapper((evt) => {
|
|
10774
10849
|
const target = getEventTarget(evt);
|
|
10775
|
-
if (!target || isBlocked(target, blockClass, blockSelector, true)) {
|
|
10850
|
+
if (!target || isBlocked$1(target, blockClass, blockSelector, true)) {
|
|
10776
10851
|
return;
|
|
10777
10852
|
}
|
|
10778
10853
|
const id = mirror2.getId(target);
|
|
10779
10854
|
if (target === doc && doc.defaultView) {
|
|
10780
|
-
const scrollLeftTop = getWindowScroll(doc.defaultView);
|
|
10855
|
+
const scrollLeftTop = getWindowScroll$1(doc.defaultView);
|
|
10781
10856
|
scrollCb({
|
|
10782
10857
|
id,
|
|
10783
10858
|
x: scrollLeftTop.left,
|
|
@@ -10794,16 +10869,16 @@ var leanbase = (function () {
|
|
|
10794
10869
|
sampling.scroll || 100
|
|
10795
10870
|
)
|
|
10796
10871
|
);
|
|
10797
|
-
return on("scroll", updatePosition, doc);
|
|
10872
|
+
return on$1("scroll", updatePosition, doc);
|
|
10798
10873
|
}
|
|
10799
10874
|
function initViewportResizeObserver({ viewportResizeCb }, { win }) {
|
|
10800
10875
|
let lastH = -1;
|
|
10801
10876
|
let lastW = -1;
|
|
10802
10877
|
const updateDimension = callbackWrapper(
|
|
10803
|
-
throttle(
|
|
10878
|
+
throttle$1(
|
|
10804
10879
|
callbackWrapper(() => {
|
|
10805
|
-
const height = getWindowHeight();
|
|
10806
|
-
const width = getWindowWidth();
|
|
10880
|
+
const height = getWindowHeight$1();
|
|
10881
|
+
const width = getWindowWidth$1();
|
|
10807
10882
|
if (lastH !== height || lastW !== width) {
|
|
10808
10883
|
viewportResizeCb({
|
|
10809
10884
|
width: Number(width),
|
|
@@ -10816,7 +10891,7 @@ var leanbase = (function () {
|
|
|
10816
10891
|
200
|
|
10817
10892
|
)
|
|
10818
10893
|
);
|
|
10819
|
-
return on("resize", updateDimension, win);
|
|
10894
|
+
return on$1("resize", updateDimension, win);
|
|
10820
10895
|
}
|
|
10821
10896
|
const INPUT_TAGS = ["INPUT", "TEXTAREA", "SELECT"];
|
|
10822
10897
|
const lastInputValueMap = /* @__PURE__ */ new WeakMap();
|
|
@@ -10838,9 +10913,9 @@ var leanbase = (function () {
|
|
|
10838
10913
|
const userTriggered = event.isTrusted;
|
|
10839
10914
|
const tagName = target && target.tagName;
|
|
10840
10915
|
if (target && tagName === "OPTION") {
|
|
10841
|
-
target = index.parentElement(target);
|
|
10916
|
+
target = index$2.parentElement(target);
|
|
10842
10917
|
}
|
|
10843
|
-
if (!target || !tagName || INPUT_TAGS.indexOf(tagName) < 0 || isBlocked(target, blockClass, blockSelector, true)) {
|
|
10918
|
+
if (!target || !tagName || INPUT_TAGS.indexOf(tagName) < 0 || isBlocked$1(target, blockClass, blockSelector, true)) {
|
|
10844
10919
|
return;
|
|
10845
10920
|
}
|
|
10846
10921
|
if (target.classList.contains(ignoreClass) || ignoreSelector && target.matches(ignoreSelector)) {
|
|
@@ -10891,7 +10966,7 @@ var leanbase = (function () {
|
|
|
10891
10966
|
}
|
|
10892
10967
|
const events = sampling.input === "last" ? ["change"] : ["input", "change"];
|
|
10893
10968
|
const handlers = events.map(
|
|
10894
|
-
(eventName) => on(eventName, callbackWrapper(eventHandler), doc)
|
|
10969
|
+
(eventName) => on$1(eventName, callbackWrapper(eventHandler), doc)
|
|
10895
10970
|
);
|
|
10896
10971
|
const currentWindow = doc.defaultView;
|
|
10897
10972
|
if (!currentWindow) {
|
|
@@ -10915,7 +10990,7 @@ var leanbase = (function () {
|
|
|
10915
10990
|
if (propertyDescriptor && propertyDescriptor.set) {
|
|
10916
10991
|
handlers.push(
|
|
10917
10992
|
...hookProperties.map(
|
|
10918
|
-
(p) => hookSetter(
|
|
10993
|
+
(p) => hookSetter$1(
|
|
10919
10994
|
p[0],
|
|
10920
10995
|
p[1],
|
|
10921
10996
|
{
|
|
@@ -11165,7 +11240,7 @@ var leanbase = (function () {
|
|
|
11165
11240
|
var _a2, _b, _c;
|
|
11166
11241
|
let hostId = null;
|
|
11167
11242
|
if (host2.nodeName === "#document") hostId = mirror2.getId(host2);
|
|
11168
|
-
else hostId = mirror2.getId(index.host(host2));
|
|
11243
|
+
else hostId = mirror2.getId(index$2.host(host2));
|
|
11169
11244
|
const patchTarget = host2.nodeName === "#document" ? (_a2 = host2.defaultView) == null ? void 0 : _a2.Document : (_c = (_b = host2.ownerDocument) == null ? void 0 : _b.defaultView) == null ? void 0 : _c.ShadowRoot;
|
|
11170
11245
|
const originalPropertyDescriptor = (patchTarget == null ? void 0 : patchTarget.prototype) ? Object.getOwnPropertyDescriptor(
|
|
11171
11246
|
patchTarget == null ? void 0 : patchTarget.prototype,
|
|
@@ -11284,10 +11359,10 @@ var leanbase = (function () {
|
|
|
11284
11359
|
doc
|
|
11285
11360
|
}) {
|
|
11286
11361
|
const handler = callbackWrapper(
|
|
11287
|
-
(type) => throttle(
|
|
11362
|
+
(type) => throttle$1(
|
|
11288
11363
|
callbackWrapper((event) => {
|
|
11289
11364
|
const target = getEventTarget(event);
|
|
11290
|
-
if (!target || isBlocked(target, blockClass, blockSelector, true)) {
|
|
11365
|
+
if (!target || isBlocked$1(target, blockClass, blockSelector, true)) {
|
|
11291
11366
|
return;
|
|
11292
11367
|
}
|
|
11293
11368
|
const { currentTime, volume, muted, playbackRate, loop } = target;
|
|
@@ -11305,11 +11380,11 @@ var leanbase = (function () {
|
|
|
11305
11380
|
)
|
|
11306
11381
|
);
|
|
11307
11382
|
const handlers = [
|
|
11308
|
-
on("play", handler(MediaInteractions.Play), doc),
|
|
11309
|
-
on("pause", handler(MediaInteractions.Pause), doc),
|
|
11310
|
-
on("seeked", handler(MediaInteractions.Seeked), doc),
|
|
11311
|
-
on("volumechange", handler(MediaInteractions.VolumeChange), doc),
|
|
11312
|
-
on("ratechange", handler(MediaInteractions.RateChange), doc)
|
|
11383
|
+
on$1("play", handler(MediaInteractions.Play), doc),
|
|
11384
|
+
on$1("pause", handler(MediaInteractions.Pause), doc),
|
|
11385
|
+
on$1("seeked", handler(MediaInteractions.Seeked), doc),
|
|
11386
|
+
on$1("volumechange", handler(MediaInteractions.VolumeChange), doc),
|
|
11387
|
+
on$1("ratechange", handler(MediaInteractions.RateChange), doc)
|
|
11313
11388
|
];
|
|
11314
11389
|
return callbackWrapper(() => {
|
|
11315
11390
|
handlers.forEach((h) => h());
|
|
@@ -11334,7 +11409,7 @@ var leanbase = (function () {
|
|
|
11334
11409
|
});
|
|
11335
11410
|
return fontFace;
|
|
11336
11411
|
};
|
|
11337
|
-
const restoreHandler = patch(
|
|
11412
|
+
const restoreHandler = patch$2(
|
|
11338
11413
|
doc.fonts,
|
|
11339
11414
|
"add",
|
|
11340
11415
|
function(original) {
|
|
@@ -11373,7 +11448,7 @@ var leanbase = (function () {
|
|
|
11373
11448
|
for (let i2 = 0; i2 < count; i2++) {
|
|
11374
11449
|
const range = selection.getRangeAt(i2);
|
|
11375
11450
|
const { startContainer, startOffset, endContainer, endOffset } = range;
|
|
11376
|
-
const blocked = isBlocked(startContainer, blockClass, blockSelector, true) || isBlocked(endContainer, blockClass, blockSelector, true);
|
|
11451
|
+
const blocked = isBlocked$1(startContainer, blockClass, blockSelector, true) || isBlocked$1(endContainer, blockClass, blockSelector, true);
|
|
11377
11452
|
if (blocked) continue;
|
|
11378
11453
|
ranges.push({
|
|
11379
11454
|
start: mirror2.getId(startContainer),
|
|
@@ -11385,7 +11460,7 @@ var leanbase = (function () {
|
|
|
11385
11460
|
selectionCb({ ranges });
|
|
11386
11461
|
});
|
|
11387
11462
|
updateSelection();
|
|
11388
|
-
return on("selectionchange", updateSelection);
|
|
11463
|
+
return on$1("selectionchange", updateSelection);
|
|
11389
11464
|
}
|
|
11390
11465
|
function initCustomElementObserver({
|
|
11391
11466
|
doc,
|
|
@@ -11394,7 +11469,7 @@ var leanbase = (function () {
|
|
|
11394
11469
|
const win = doc.defaultView;
|
|
11395
11470
|
if (!win || !win.customElements) return () => {
|
|
11396
11471
|
};
|
|
11397
|
-
const restoreHandler = patch(
|
|
11472
|
+
const restoreHandler = patch$2(
|
|
11398
11473
|
win.customElements,
|
|
11399
11474
|
"define",
|
|
11400
11475
|
function(original) {
|
|
@@ -11584,8 +11659,8 @@ var leanbase = (function () {
|
|
|
11584
11659
|
}
|
|
11585
11660
|
class CrossOriginIframeMirror {
|
|
11586
11661
|
constructor(generateIdFn) {
|
|
11587
|
-
__publicField(this, "iframeIdToRemoteIdMap", /* @__PURE__ */ new WeakMap());
|
|
11588
|
-
__publicField(this, "iframeRemoteIdToIdMap", /* @__PURE__ */ new WeakMap());
|
|
11662
|
+
__publicField$2(this, "iframeIdToRemoteIdMap", /* @__PURE__ */ new WeakMap());
|
|
11663
|
+
__publicField$2(this, "iframeRemoteIdToIdMap", /* @__PURE__ */ new WeakMap());
|
|
11589
11664
|
this.generateIdFn = generateIdFn;
|
|
11590
11665
|
}
|
|
11591
11666
|
getId(iframe, remoteId, idToRemoteMap, remoteToIdMap) {
|
|
@@ -11645,17 +11720,17 @@ var leanbase = (function () {
|
|
|
11645
11720
|
}
|
|
11646
11721
|
class IframeManager {
|
|
11647
11722
|
constructor(options) {
|
|
11648
|
-
__publicField(this, "iframes", /* @__PURE__ */ new WeakMap());
|
|
11649
|
-
__publicField(this, "crossOriginIframeMap", /* @__PURE__ */ new WeakMap());
|
|
11650
|
-
__publicField(this, "crossOriginIframeMirror", new CrossOriginIframeMirror(genId));
|
|
11651
|
-
__publicField(this, "crossOriginIframeStyleMirror");
|
|
11652
|
-
__publicField(this, "crossOriginIframeRootIdMap", /* @__PURE__ */ new WeakMap());
|
|
11653
|
-
__publicField(this, "mirror");
|
|
11654
|
-
__publicField(this, "mutationCb");
|
|
11655
|
-
__publicField(this, "wrappedEmit");
|
|
11656
|
-
__publicField(this, "loadListener");
|
|
11657
|
-
__publicField(this, "stylesheetManager");
|
|
11658
|
-
__publicField(this, "recordCrossOriginIframes");
|
|
11723
|
+
__publicField$2(this, "iframes", /* @__PURE__ */ new WeakMap());
|
|
11724
|
+
__publicField$2(this, "crossOriginIframeMap", /* @__PURE__ */ new WeakMap());
|
|
11725
|
+
__publicField$2(this, "crossOriginIframeMirror", new CrossOriginIframeMirror(genId));
|
|
11726
|
+
__publicField$2(this, "crossOriginIframeStyleMirror");
|
|
11727
|
+
__publicField$2(this, "crossOriginIframeRootIdMap", /* @__PURE__ */ new WeakMap());
|
|
11728
|
+
__publicField$2(this, "mirror");
|
|
11729
|
+
__publicField$2(this, "mutationCb");
|
|
11730
|
+
__publicField$2(this, "wrappedEmit");
|
|
11731
|
+
__publicField$2(this, "loadListener");
|
|
11732
|
+
__publicField$2(this, "stylesheetManager");
|
|
11733
|
+
__publicField$2(this, "recordCrossOriginIframes");
|
|
11659
11734
|
this.mutationCb = options.mutationCb;
|
|
11660
11735
|
this.wrappedEmit = options.wrappedEmit;
|
|
11661
11736
|
this.stylesheetManager = options.stylesheetManager;
|
|
@@ -11879,12 +11954,12 @@ var leanbase = (function () {
|
|
|
11879
11954
|
}
|
|
11880
11955
|
class ShadowDomManager {
|
|
11881
11956
|
constructor(options) {
|
|
11882
|
-
__publicField(this, "shadowDoms", /* @__PURE__ */ new WeakSet());
|
|
11883
|
-
__publicField(this, "mutationCb");
|
|
11884
|
-
__publicField(this, "scrollCb");
|
|
11885
|
-
__publicField(this, "bypassOptions");
|
|
11886
|
-
__publicField(this, "mirror");
|
|
11887
|
-
__publicField(this, "restoreHandlers", []);
|
|
11957
|
+
__publicField$2(this, "shadowDoms", /* @__PURE__ */ new WeakSet());
|
|
11958
|
+
__publicField$2(this, "mutationCb");
|
|
11959
|
+
__publicField$2(this, "scrollCb");
|
|
11960
|
+
__publicField$2(this, "bypassOptions");
|
|
11961
|
+
__publicField$2(this, "mirror");
|
|
11962
|
+
__publicField$2(this, "restoreHandlers", []);
|
|
11888
11963
|
this.mutationCb = options.mutationCb;
|
|
11889
11964
|
this.scrollCb = options.scrollCb;
|
|
11890
11965
|
this.bypassOptions = options.bypassOptions;
|
|
@@ -11924,7 +11999,7 @@ var leanbase = (function () {
|
|
|
11924
11999
|
if (shadowRoot2.adoptedStyleSheets && shadowRoot2.adoptedStyleSheets.length > 0)
|
|
11925
12000
|
this.bypassOptions.stylesheetManager.adoptStyleSheets(
|
|
11926
12001
|
shadowRoot2.adoptedStyleSheets,
|
|
11927
|
-
this.mirror.getId(index.host(shadowRoot2))
|
|
12002
|
+
this.mirror.getId(index$2.host(shadowRoot2))
|
|
11928
12003
|
);
|
|
11929
12004
|
this.restoreHandlers.push(
|
|
11930
12005
|
initAdoptedStyleSheetObserver(
|
|
@@ -11953,14 +12028,14 @@ var leanbase = (function () {
|
|
|
11953
12028
|
patchAttachShadow(element, doc) {
|
|
11954
12029
|
const manager = this;
|
|
11955
12030
|
this.restoreHandlers.push(
|
|
11956
|
-
patch(
|
|
12031
|
+
patch$2(
|
|
11957
12032
|
element.prototype,
|
|
11958
12033
|
"attachShadow",
|
|
11959
12034
|
function(original) {
|
|
11960
12035
|
return function(option) {
|
|
11961
12036
|
const sRoot = original.call(this, option);
|
|
11962
|
-
const shadowRootEl = index.shadowRoot(this);
|
|
11963
|
-
if (shadowRootEl && inDom(this))
|
|
12037
|
+
const shadowRootEl = index$2.shadowRoot(this);
|
|
12038
|
+
if (shadowRootEl && inDom$1(this))
|
|
11964
12039
|
manager.addShadowRoot(shadowRootEl, doc);
|
|
11965
12040
|
return sRoot;
|
|
11966
12041
|
};
|
|
@@ -11979,18 +12054,18 @@ var leanbase = (function () {
|
|
|
11979
12054
|
this.shadowDoms = /* @__PURE__ */ new WeakSet();
|
|
11980
12055
|
}
|
|
11981
12056
|
}
|
|
11982
|
-
var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
|
11983
|
-
var lookup = typeof Uint8Array === "undefined" ? [] : new Uint8Array(256);
|
|
11984
|
-
for (var i$1 = 0; i$1 < chars.length; i$1++) {
|
|
11985
|
-
lookup[chars.charCodeAt(i$1)] = i$1;
|
|
12057
|
+
var chars$1 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
|
12058
|
+
var lookup$1 = typeof Uint8Array === "undefined" ? [] : new Uint8Array(256);
|
|
12059
|
+
for (var i$1$1 = 0; i$1$1 < chars$1.length; i$1$1++) {
|
|
12060
|
+
lookup$1[chars$1.charCodeAt(i$1$1)] = i$1$1;
|
|
11986
12061
|
}
|
|
11987
12062
|
var encode = function(arraybuffer) {
|
|
11988
12063
|
var bytes = new Uint8Array(arraybuffer), i2, len = bytes.length, base64 = "";
|
|
11989
12064
|
for (i2 = 0; i2 < len; i2 += 3) {
|
|
11990
|
-
base64 += chars[bytes[i2] >> 2];
|
|
11991
|
-
base64 += chars[(bytes[i2] & 3) << 4 | bytes[i2 + 1] >> 4];
|
|
11992
|
-
base64 += chars[(bytes[i2 + 1] & 15) << 2 | bytes[i2 + 2] >> 6];
|
|
11993
|
-
base64 += chars[bytes[i2 + 2] & 63];
|
|
12065
|
+
base64 += chars$1[bytes[i2] >> 2];
|
|
12066
|
+
base64 += chars$1[(bytes[i2] & 3) << 4 | bytes[i2 + 1] >> 4];
|
|
12067
|
+
base64 += chars$1[(bytes[i2 + 1] & 15) << 2 | bytes[i2 + 2] >> 6];
|
|
12068
|
+
base64 += chars$1[bytes[i2 + 2] & 63];
|
|
11994
12069
|
}
|
|
11995
12070
|
if (len % 3 === 2) {
|
|
11996
12071
|
base64 = base64.substring(0, base64.length - 1) + "=";
|
|
@@ -12123,12 +12198,12 @@ var leanbase = (function () {
|
|
|
12123
12198
|
if (typeof win.CanvasRenderingContext2D.prototype[prop] !== "function") {
|
|
12124
12199
|
continue;
|
|
12125
12200
|
}
|
|
12126
|
-
const restoreHandler = patch(
|
|
12201
|
+
const restoreHandler = patch$2(
|
|
12127
12202
|
win.CanvasRenderingContext2D.prototype,
|
|
12128
12203
|
prop,
|
|
12129
12204
|
function(original) {
|
|
12130
12205
|
return function(...args) {
|
|
12131
|
-
if (!isBlocked(this.canvas, blockClass, blockSelector, true)) {
|
|
12206
|
+
if (!isBlocked$1(this.canvas, blockClass, blockSelector, true)) {
|
|
12132
12207
|
setTimeout(() => {
|
|
12133
12208
|
const recordArgs = serializeArgs(args, win, this);
|
|
12134
12209
|
cb(this.canvas, {
|
|
@@ -12144,7 +12219,7 @@ var leanbase = (function () {
|
|
|
12144
12219
|
);
|
|
12145
12220
|
handlers.push(restoreHandler);
|
|
12146
12221
|
} catch {
|
|
12147
|
-
const hookHandler = hookSetter(
|
|
12222
|
+
const hookHandler = hookSetter$1(
|
|
12148
12223
|
win.CanvasRenderingContext2D.prototype,
|
|
12149
12224
|
prop,
|
|
12150
12225
|
{
|
|
@@ -12171,12 +12246,12 @@ var leanbase = (function () {
|
|
|
12171
12246
|
function initCanvasContextObserver(win, blockClass, blockSelector, setPreserveDrawingBufferToTrue) {
|
|
12172
12247
|
const handlers = [];
|
|
12173
12248
|
try {
|
|
12174
|
-
const restoreHandler = patch(
|
|
12249
|
+
const restoreHandler = patch$2(
|
|
12175
12250
|
win.HTMLCanvasElement.prototype,
|
|
12176
12251
|
"getContext",
|
|
12177
12252
|
function(original) {
|
|
12178
12253
|
return function(contextType, ...args) {
|
|
12179
|
-
if (!isBlocked(this, blockClass, blockSelector, true)) {
|
|
12254
|
+
if (!isBlocked$1(this, blockClass, blockSelector, true)) {
|
|
12180
12255
|
const ctxName = getNormalizedContextName(contextType);
|
|
12181
12256
|
if (!("__context" in this)) this.__context = ctxName;
|
|
12182
12257
|
if (setPreserveDrawingBufferToTrue && ["webgl", "webgl2"].includes(ctxName)) {
|
|
@@ -12223,14 +12298,14 @@ var leanbase = (function () {
|
|
|
12223
12298
|
if (typeof prototype[prop] !== "function") {
|
|
12224
12299
|
continue;
|
|
12225
12300
|
}
|
|
12226
|
-
const restoreHandler = patch(
|
|
12301
|
+
const restoreHandler = patch$2(
|
|
12227
12302
|
prototype,
|
|
12228
12303
|
prop,
|
|
12229
12304
|
function(original) {
|
|
12230
12305
|
return function(...args) {
|
|
12231
12306
|
const result2 = original.apply(this, args);
|
|
12232
12307
|
saveWebGLVar(result2, win, this);
|
|
12233
|
-
if ("tagName" in this.canvas && !isBlocked(this.canvas, blockClass, blockSelector, true)) {
|
|
12308
|
+
if ("tagName" in this.canvas && !isBlocked$1(this.canvas, blockClass, blockSelector, true)) {
|
|
12234
12309
|
const recordArgs = serializeArgs(args, win, this);
|
|
12235
12310
|
const mutation = {
|
|
12236
12311
|
type,
|
|
@@ -12245,7 +12320,7 @@ var leanbase = (function () {
|
|
|
12245
12320
|
);
|
|
12246
12321
|
handlers.push(restoreHandler);
|
|
12247
12322
|
} catch {
|
|
12248
|
-
const hookHandler = hookSetter(prototype, prop, {
|
|
12323
|
+
const hookHandler = hookSetter$1(prototype, prop, {
|
|
12249
12324
|
set(v2) {
|
|
12250
12325
|
cb(this.canvas, {
|
|
12251
12326
|
type,
|
|
@@ -12288,9 +12363,9 @@ var leanbase = (function () {
|
|
|
12288
12363
|
handlers.forEach((h) => h());
|
|
12289
12364
|
};
|
|
12290
12365
|
}
|
|
12291
|
-
const encodedJs = "KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=";
|
|
12292
|
-
const decodeBase64 = (base64) => Uint8Array.from(atob(base64), (c2) => c2.charCodeAt(0));
|
|
12293
|
-
const blob = typeof window !== "undefined" && window.Blob && new Blob([decodeBase64(encodedJs)], { type: "text/javascript;charset=utf-8" });
|
|
12366
|
+
const encodedJs$1 = "KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=";
|
|
12367
|
+
const decodeBase64$1 = (base64) => Uint8Array.from(atob(base64), (c2) => c2.charCodeAt(0));
|
|
12368
|
+
const blob = typeof window !== "undefined" && window.Blob && new Blob([decodeBase64$1(encodedJs$1)], { type: "text/javascript;charset=utf-8" });
|
|
12294
12369
|
function WorkerWrapper(options) {
|
|
12295
12370
|
let objURL;
|
|
12296
12371
|
try {
|
|
@@ -12305,7 +12380,7 @@ var leanbase = (function () {
|
|
|
12305
12380
|
return worker;
|
|
12306
12381
|
} catch (e2) {
|
|
12307
12382
|
return new Worker(
|
|
12308
|
-
"data:text/javascript;base64," + encodedJs,
|
|
12383
|
+
"data:text/javascript;base64," + encodedJs$1,
|
|
12309
12384
|
{
|
|
12310
12385
|
name: options == null ? void 0 : options.name
|
|
12311
12386
|
}
|
|
@@ -12316,14 +12391,14 @@ var leanbase = (function () {
|
|
|
12316
12391
|
}
|
|
12317
12392
|
class CanvasManager {
|
|
12318
12393
|
constructor(options) {
|
|
12319
|
-
__publicField(this, "pendingCanvasMutations", /* @__PURE__ */ new Map());
|
|
12320
|
-
__publicField(this, "rafStamps", { latestId: 0, invokeId: null });
|
|
12321
|
-
__publicField(this, "mirror");
|
|
12322
|
-
__publicField(this, "mutationCb");
|
|
12323
|
-
__publicField(this, "resetObservers");
|
|
12324
|
-
__publicField(this, "frozen", false);
|
|
12325
|
-
__publicField(this, "locked", false);
|
|
12326
|
-
__publicField(this, "processMutation", (target, mutation) => {
|
|
12394
|
+
__publicField$2(this, "pendingCanvasMutations", /* @__PURE__ */ new Map());
|
|
12395
|
+
__publicField$2(this, "rafStamps", { latestId: 0, invokeId: null });
|
|
12396
|
+
__publicField$2(this, "mirror");
|
|
12397
|
+
__publicField$2(this, "mutationCb");
|
|
12398
|
+
__publicField$2(this, "resetObservers");
|
|
12399
|
+
__publicField$2(this, "frozen", false);
|
|
12400
|
+
__publicField$2(this, "locked", false);
|
|
12401
|
+
__publicField$2(this, "processMutation", (target, mutation) => {
|
|
12327
12402
|
const newFrame = this.rafStamps.invokeId && this.rafStamps.latestId !== this.rafStamps.invokeId;
|
|
12328
12403
|
if (newFrame || !this.rafStamps.invokeId)
|
|
12329
12404
|
this.rafStamps.invokeId = this.rafStamps.latestId;
|
|
@@ -12416,7 +12491,7 @@ var leanbase = (function () {
|
|
|
12416
12491
|
const matchedCanvas = [];
|
|
12417
12492
|
const searchCanvas = (root) => {
|
|
12418
12493
|
root.querySelectorAll("canvas").forEach((canvas) => {
|
|
12419
|
-
if (!isBlocked(canvas, blockClass, blockSelector, true)) {
|
|
12494
|
+
if (!isBlocked$1(canvas, blockClass, blockSelector, true)) {
|
|
12420
12495
|
matchedCanvas.push(canvas);
|
|
12421
12496
|
}
|
|
12422
12497
|
});
|
|
@@ -12537,10 +12612,10 @@ var leanbase = (function () {
|
|
|
12537
12612
|
}
|
|
12538
12613
|
class StylesheetManager {
|
|
12539
12614
|
constructor(options) {
|
|
12540
|
-
__publicField(this, "trackedLinkElements", /* @__PURE__ */ new WeakSet());
|
|
12541
|
-
__publicField(this, "mutationCb");
|
|
12542
|
-
__publicField(this, "adoptedStyleSheetCb");
|
|
12543
|
-
__publicField(this, "styleMirror", new StyleSheetMirror());
|
|
12615
|
+
__publicField$2(this, "trackedLinkElements", /* @__PURE__ */ new WeakSet());
|
|
12616
|
+
__publicField$2(this, "mutationCb");
|
|
12617
|
+
__publicField$2(this, "adoptedStyleSheetCb");
|
|
12618
|
+
__publicField$2(this, "styleMirror", new StyleSheetMirror$1());
|
|
12544
12619
|
this.mutationCb = options.mutationCb;
|
|
12545
12620
|
this.adoptedStyleSheetCb = options.adoptedStyleSheetCb;
|
|
12546
12621
|
}
|
|
@@ -12598,8 +12673,8 @@ var leanbase = (function () {
|
|
|
12598
12673
|
}
|
|
12599
12674
|
class ProcessedNodeManager {
|
|
12600
12675
|
constructor() {
|
|
12601
|
-
__publicField(this, "nodeMap", /* @__PURE__ */ new WeakMap());
|
|
12602
|
-
__publicField(this, "active", false);
|
|
12676
|
+
__publicField$2(this, "nodeMap", /* @__PURE__ */ new WeakMap());
|
|
12677
|
+
__publicField$2(this, "active", false);
|
|
12603
12678
|
}
|
|
12604
12679
|
inOtherBuffer(node2, thisBuffer) {
|
|
12605
12680
|
const buffers = this.nodeMap.get(node2);
|
|
@@ -12626,13 +12701,13 @@ var leanbase = (function () {
|
|
|
12626
12701
|
if (Array.from([1], (x2) => x2 * 2)[0] !== 2) {
|
|
12627
12702
|
const cleanFrame = document.createElement("iframe");
|
|
12628
12703
|
document.body.appendChild(cleanFrame);
|
|
12629
|
-
Array.from = ((_a = cleanFrame.contentWindow) == null ? void 0 : _a.Array.from) || Array.from;
|
|
12704
|
+
Array.from = ((_a$1 = cleanFrame.contentWindow) == null ? void 0 : _a$1.Array.from) || Array.from;
|
|
12630
12705
|
document.body.removeChild(cleanFrame);
|
|
12631
12706
|
}
|
|
12632
12707
|
} catch (err) {
|
|
12633
12708
|
console.debug("Unable to override Array.from", err);
|
|
12634
12709
|
}
|
|
12635
|
-
const mirror = createMirror$2();
|
|
12710
|
+
const mirror = createMirror$2$1();
|
|
12636
12711
|
function record(options = {}) {
|
|
12637
12712
|
const {
|
|
12638
12713
|
emit,
|
|
@@ -12723,7 +12798,7 @@ var leanbase = (function () {
|
|
|
12723
12798
|
headMetaDescKeywords: _slimDOMOptions === "all",
|
|
12724
12799
|
headTitleMutations: _slimDOMOptions === "all"
|
|
12725
12800
|
} : _slimDOMOptions ? _slimDOMOptions : {};
|
|
12726
|
-
polyfill$1();
|
|
12801
|
+
polyfill$1$1();
|
|
12727
12802
|
let lastFullSnapshotEvent;
|
|
12728
12803
|
let incrementalSnapshotCount = 0;
|
|
12729
12804
|
const eventProcessor = (e2) => {
|
|
@@ -12741,7 +12816,7 @@ var leanbase = (function () {
|
|
|
12741
12816
|
wrappedEmit = (r2, isCheckout) => {
|
|
12742
12817
|
var _a2;
|
|
12743
12818
|
const e2 = r2;
|
|
12744
|
-
e2.timestamp = nowTimestamp();
|
|
12819
|
+
e2.timestamp = nowTimestamp$1();
|
|
12745
12820
|
if (((_a2 = mutationBuffers[0]) == null ? void 0 : _a2.isFrozen()) && e2.type !== EventType.FullSnapshot && !(e2.type === EventType.IncrementalSnapshot && e2.data.source === IncrementalSource.Mutation)) {
|
|
12746
12821
|
mutationBuffers.forEach((buf) => buf.unfreeze());
|
|
12747
12822
|
}
|
|
@@ -12865,8 +12940,8 @@ var leanbase = (function () {
|
|
|
12865
12940
|
type: EventType.Meta,
|
|
12866
12941
|
data: {
|
|
12867
12942
|
href: window.location.href,
|
|
12868
|
-
width: getWindowWidth(),
|
|
12869
|
-
height: getWindowHeight()
|
|
12943
|
+
width: getWindowWidth$1(),
|
|
12944
|
+
height: getWindowHeight$1()
|
|
12870
12945
|
}
|
|
12871
12946
|
},
|
|
12872
12947
|
isCheckout
|
|
@@ -12889,14 +12964,14 @@ var leanbase = (function () {
|
|
|
12889
12964
|
recordCanvas,
|
|
12890
12965
|
inlineImages,
|
|
12891
12966
|
onSerialize: (n2) => {
|
|
12892
|
-
if (isSerializedIframe(n2, mirror)) {
|
|
12967
|
+
if (isSerializedIframe$1(n2, mirror)) {
|
|
12893
12968
|
iframeManager.addIframe(n2);
|
|
12894
12969
|
}
|
|
12895
|
-
if (isSerializedStylesheet(n2, mirror)) {
|
|
12970
|
+
if (isSerializedStylesheet$1(n2, mirror)) {
|
|
12896
12971
|
stylesheetManager.trackLinkElement(n2);
|
|
12897
12972
|
}
|
|
12898
|
-
if (hasShadowRoot(n2)) {
|
|
12899
|
-
shadowDomManager.addShadowRoot(index.shadowRoot(n2), document);
|
|
12973
|
+
if (hasShadowRoot$1(n2)) {
|
|
12974
|
+
shadowDomManager.addShadowRoot(index$2.shadowRoot(n2), document);
|
|
12900
12975
|
}
|
|
12901
12976
|
},
|
|
12902
12977
|
onIframeLoad: (iframe, childSn) => {
|
|
@@ -12916,7 +12991,7 @@ var leanbase = (function () {
|
|
|
12916
12991
|
type: EventType.FullSnapshot,
|
|
12917
12992
|
data: {
|
|
12918
12993
|
node: node2,
|
|
12919
|
-
initialOffset: getWindowScroll(window)
|
|
12994
|
+
initialOffset: getWindowScroll$1(window)
|
|
12920
12995
|
}
|
|
12921
12996
|
},
|
|
12922
12997
|
isCheckout
|
|
@@ -13069,7 +13144,7 @@ var leanbase = (function () {
|
|
|
13069
13144
|
init();
|
|
13070
13145
|
} else {
|
|
13071
13146
|
handlers.push(
|
|
13072
|
-
on("DOMContentLoaded", () => {
|
|
13147
|
+
on$1("DOMContentLoaded", () => {
|
|
13073
13148
|
wrappedEmit({
|
|
13074
13149
|
type: EventType.DomContentLoaded,
|
|
13075
13150
|
data: {}
|
|
@@ -13078,7 +13153,7 @@ var leanbase = (function () {
|
|
|
13078
13153
|
})
|
|
13079
13154
|
);
|
|
13080
13155
|
handlers.push(
|
|
13081
|
-
on(
|
|
13156
|
+
on$1(
|
|
13082
13157
|
"load",
|
|
13083
13158
|
() => {
|
|
13084
13159
|
wrappedEmit({
|
|
@@ -13123,16 +13198,1960 @@ var leanbase = (function () {
|
|
|
13123
13198
|
takeFullSnapshot$1(isCheckout);
|
|
13124
13199
|
};
|
|
13125
13200
|
record.mirror = mirror;
|
|
13126
|
-
var n;
|
|
13201
|
+
var n$1;
|
|
13127
13202
|
!function(t2) {
|
|
13128
13203
|
t2[t2.NotStarted = 0] = "NotStarted", t2[t2.Running = 1] = "Running", t2[t2.Stopped = 2] = "Stopped";
|
|
13129
|
-
}(n || (n = {}));
|
|
13204
|
+
}(n$1 || (n$1 = {}));
|
|
13130
13205
|
|
|
13131
13206
|
var record$1 = /*#__PURE__*/Object.freeze({
|
|
13132
13207
|
__proto__: null,
|
|
13133
13208
|
record: record
|
|
13134
13209
|
});
|
|
13135
13210
|
|
|
13211
|
+
var __defProp = Object.defineProperty;
|
|
13212
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
13213
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
13214
|
+
var __defProp2 = Object.defineProperty;
|
|
13215
|
+
var __defNormalProp2 = (obj, key, value) => key in obj ? __defProp2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
13216
|
+
var __publicField2$1 = (obj, key, value) => __defNormalProp2(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
13217
|
+
var _a;
|
|
13218
|
+
var __defProp$1 = Object.defineProperty;
|
|
13219
|
+
var __defNormalProp$1 = (obj, key, value) => key in obj ? __defProp$1(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
13220
|
+
var __publicField$1 = (obj, key, value) => __defNormalProp$1(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
13221
|
+
const testableAccessors$1 = {
|
|
13222
|
+
Node: ["childNodes", "parentNode", "parentElement", "textContent"],
|
|
13223
|
+
ShadowRoot: ["host", "styleSheets"],
|
|
13224
|
+
Element: ["shadowRoot", "querySelector", "querySelectorAll"],
|
|
13225
|
+
MutationObserver: []
|
|
13226
|
+
};
|
|
13227
|
+
const testableMethods$1 = {
|
|
13228
|
+
Node: ["contains", "getRootNode"],
|
|
13229
|
+
ShadowRoot: ["getSelection"],
|
|
13230
|
+
Element: [],
|
|
13231
|
+
MutationObserver: ["constructor"]
|
|
13232
|
+
};
|
|
13233
|
+
const untaintedBasePrototype$1 = {};
|
|
13234
|
+
function getUntaintedPrototype$1(key) {
|
|
13235
|
+
if (untaintedBasePrototype$1[key])
|
|
13236
|
+
return untaintedBasePrototype$1[key];
|
|
13237
|
+
const defaultObj = globalThis[key];
|
|
13238
|
+
const defaultPrototype = defaultObj.prototype;
|
|
13239
|
+
const accessorNames = key in testableAccessors$1 ? testableAccessors$1[key] : void 0;
|
|
13240
|
+
const isUntaintedAccessors = Boolean(
|
|
13241
|
+
accessorNames && // @ts-expect-error 2345
|
|
13242
|
+
accessorNames.every(
|
|
13243
|
+
(accessor) => {
|
|
13244
|
+
var _a2, _b;
|
|
13245
|
+
return Boolean(
|
|
13246
|
+
(_b = (_a2 = Object.getOwnPropertyDescriptor(defaultPrototype, accessor)) == null ? void 0 : _a2.get) == null ? void 0 : _b.toString().includes("[native code]")
|
|
13247
|
+
);
|
|
13248
|
+
}
|
|
13249
|
+
)
|
|
13250
|
+
);
|
|
13251
|
+
const methodNames = key in testableMethods$1 ? testableMethods$1[key] : void 0;
|
|
13252
|
+
const isUntaintedMethods = Boolean(
|
|
13253
|
+
methodNames && methodNames.every(
|
|
13254
|
+
// @ts-expect-error 2345
|
|
13255
|
+
(method) => {
|
|
13256
|
+
var _a2;
|
|
13257
|
+
return typeof defaultPrototype[method] === "function" && ((_a2 = defaultPrototype[method]) == null ? void 0 : _a2.toString().includes("[native code]"));
|
|
13258
|
+
}
|
|
13259
|
+
)
|
|
13260
|
+
);
|
|
13261
|
+
if (isUntaintedAccessors && isUntaintedMethods) {
|
|
13262
|
+
untaintedBasePrototype$1[key] = defaultObj.prototype;
|
|
13263
|
+
return defaultObj.prototype;
|
|
13264
|
+
}
|
|
13265
|
+
try {
|
|
13266
|
+
const iframeEl = document.createElement("iframe");
|
|
13267
|
+
document.body.appendChild(iframeEl);
|
|
13268
|
+
const win = iframeEl.contentWindow;
|
|
13269
|
+
if (!win) return defaultObj.prototype;
|
|
13270
|
+
const untaintedObject = win[key].prototype;
|
|
13271
|
+
document.body.removeChild(iframeEl);
|
|
13272
|
+
if (!untaintedObject) return defaultPrototype;
|
|
13273
|
+
return untaintedBasePrototype$1[key] = untaintedObject;
|
|
13274
|
+
} catch {
|
|
13275
|
+
return defaultPrototype;
|
|
13276
|
+
}
|
|
13277
|
+
}
|
|
13278
|
+
const untaintedAccessorCache$1 = {};
|
|
13279
|
+
function getUntaintedAccessor$1(key, instance, accessor) {
|
|
13280
|
+
var _a2;
|
|
13281
|
+
const cacheKey = `${key}.${String(accessor)}`;
|
|
13282
|
+
if (untaintedAccessorCache$1[cacheKey])
|
|
13283
|
+
return untaintedAccessorCache$1[cacheKey].call(
|
|
13284
|
+
instance
|
|
13285
|
+
);
|
|
13286
|
+
const untaintedPrototype = getUntaintedPrototype$1(key);
|
|
13287
|
+
const untaintedAccessor = (_a2 = Object.getOwnPropertyDescriptor(
|
|
13288
|
+
untaintedPrototype,
|
|
13289
|
+
accessor
|
|
13290
|
+
)) == null ? void 0 : _a2.get;
|
|
13291
|
+
if (!untaintedAccessor) return instance[accessor];
|
|
13292
|
+
untaintedAccessorCache$1[cacheKey] = untaintedAccessor;
|
|
13293
|
+
return untaintedAccessor.call(instance);
|
|
13294
|
+
}
|
|
13295
|
+
const untaintedMethodCache$1 = {};
|
|
13296
|
+
function getUntaintedMethod$1(key, instance, method) {
|
|
13297
|
+
const cacheKey = `${key}.${String(method)}`;
|
|
13298
|
+
if (untaintedMethodCache$1[cacheKey])
|
|
13299
|
+
return untaintedMethodCache$1[cacheKey].bind(
|
|
13300
|
+
instance
|
|
13301
|
+
);
|
|
13302
|
+
const untaintedPrototype = getUntaintedPrototype$1(key);
|
|
13303
|
+
const untaintedMethod = untaintedPrototype[method];
|
|
13304
|
+
if (typeof untaintedMethod !== "function") return instance[method];
|
|
13305
|
+
untaintedMethodCache$1[cacheKey] = untaintedMethod;
|
|
13306
|
+
return untaintedMethod.bind(instance);
|
|
13307
|
+
}
|
|
13308
|
+
function childNodes$1(n2) {
|
|
13309
|
+
return getUntaintedAccessor$1("Node", n2, "childNodes");
|
|
13310
|
+
}
|
|
13311
|
+
function parentNode$1(n2) {
|
|
13312
|
+
return getUntaintedAccessor$1("Node", n2, "parentNode");
|
|
13313
|
+
}
|
|
13314
|
+
function parentElement$1(n2) {
|
|
13315
|
+
return getUntaintedAccessor$1("Node", n2, "parentElement");
|
|
13316
|
+
}
|
|
13317
|
+
function textContent$1(n2) {
|
|
13318
|
+
return getUntaintedAccessor$1("Node", n2, "textContent");
|
|
13319
|
+
}
|
|
13320
|
+
function contains$1(n2, other) {
|
|
13321
|
+
return getUntaintedMethod$1("Node", n2, "contains")(other);
|
|
13322
|
+
}
|
|
13323
|
+
function getRootNode$1(n2) {
|
|
13324
|
+
return getUntaintedMethod$1("Node", n2, "getRootNode")();
|
|
13325
|
+
}
|
|
13326
|
+
function host$1(n2) {
|
|
13327
|
+
if (!n2 || !("host" in n2)) return null;
|
|
13328
|
+
return getUntaintedAccessor$1("ShadowRoot", n2, "host");
|
|
13329
|
+
}
|
|
13330
|
+
function styleSheets$1(n2) {
|
|
13331
|
+
return n2.styleSheets;
|
|
13332
|
+
}
|
|
13333
|
+
function shadowRoot$1(n2) {
|
|
13334
|
+
if (!n2 || !("shadowRoot" in n2)) return null;
|
|
13335
|
+
return getUntaintedAccessor$1("Element", n2, "shadowRoot");
|
|
13336
|
+
}
|
|
13337
|
+
function querySelector$1(n2, selectors) {
|
|
13338
|
+
return getUntaintedAccessor$1("Element", n2, "querySelector")(selectors);
|
|
13339
|
+
}
|
|
13340
|
+
function querySelectorAll$1(n2, selectors) {
|
|
13341
|
+
return getUntaintedAccessor$1("Element", n2, "querySelectorAll")(selectors);
|
|
13342
|
+
}
|
|
13343
|
+
function mutationObserverCtor$1() {
|
|
13344
|
+
return getUntaintedPrototype$1("MutationObserver").constructor;
|
|
13345
|
+
}
|
|
13346
|
+
const index$1 = {
|
|
13347
|
+
childNodes: childNodes$1,
|
|
13348
|
+
parentNode: parentNode$1,
|
|
13349
|
+
parentElement: parentElement$1,
|
|
13350
|
+
textContent: textContent$1,
|
|
13351
|
+
contains: contains$1,
|
|
13352
|
+
getRootNode: getRootNode$1,
|
|
13353
|
+
host: host$1,
|
|
13354
|
+
styleSheets: styleSheets$1,
|
|
13355
|
+
shadowRoot: shadowRoot$1,
|
|
13356
|
+
querySelector: querySelector$1,
|
|
13357
|
+
querySelectorAll: querySelectorAll$1,
|
|
13358
|
+
mutationObserver: mutationObserverCtor$1
|
|
13359
|
+
};
|
|
13360
|
+
function isShadowRoot(n2) {
|
|
13361
|
+
const hostEl = (
|
|
13362
|
+
// anchor and textarea elements also have a `host` property
|
|
13363
|
+
// but only shadow roots have a `mode` property
|
|
13364
|
+
n2 && "host" in n2 && "mode" in n2 && index$1.host(n2) || null
|
|
13365
|
+
);
|
|
13366
|
+
return Boolean(
|
|
13367
|
+
hostEl && "shadowRoot" in hostEl && index$1.shadowRoot(hostEl) === n2
|
|
13368
|
+
);
|
|
13369
|
+
}
|
|
13370
|
+
class Mirror {
|
|
13371
|
+
constructor() {
|
|
13372
|
+
__publicField$1(this, "idNodeMap", /* @__PURE__ */ new Map());
|
|
13373
|
+
__publicField$1(this, "nodeMetaMap", /* @__PURE__ */ new WeakMap());
|
|
13374
|
+
}
|
|
13375
|
+
getId(n2) {
|
|
13376
|
+
var _a2;
|
|
13377
|
+
if (!n2) return -1;
|
|
13378
|
+
const id = (_a2 = this.getMeta(n2)) == null ? void 0 : _a2.id;
|
|
13379
|
+
return id ?? -1;
|
|
13380
|
+
}
|
|
13381
|
+
getNode(id) {
|
|
13382
|
+
return this.idNodeMap.get(id) || null;
|
|
13383
|
+
}
|
|
13384
|
+
getIds() {
|
|
13385
|
+
return Array.from(this.idNodeMap.keys());
|
|
13386
|
+
}
|
|
13387
|
+
getMeta(n2) {
|
|
13388
|
+
return this.nodeMetaMap.get(n2) || null;
|
|
13389
|
+
}
|
|
13390
|
+
// removes the node from idNodeMap
|
|
13391
|
+
// doesn't remove the node from nodeMetaMap
|
|
13392
|
+
removeNodeFromMap(n2) {
|
|
13393
|
+
const id = this.getId(n2);
|
|
13394
|
+
this.idNodeMap.delete(id);
|
|
13395
|
+
if (n2.childNodes) {
|
|
13396
|
+
n2.childNodes.forEach(
|
|
13397
|
+
(childNode) => this.removeNodeFromMap(childNode)
|
|
13398
|
+
);
|
|
13399
|
+
}
|
|
13400
|
+
}
|
|
13401
|
+
has(id) {
|
|
13402
|
+
return this.idNodeMap.has(id);
|
|
13403
|
+
}
|
|
13404
|
+
hasNode(node2) {
|
|
13405
|
+
return this.nodeMetaMap.has(node2);
|
|
13406
|
+
}
|
|
13407
|
+
add(n2, meta) {
|
|
13408
|
+
const id = meta.id;
|
|
13409
|
+
this.idNodeMap.set(id, n2);
|
|
13410
|
+
this.nodeMetaMap.set(n2, meta);
|
|
13411
|
+
}
|
|
13412
|
+
replace(id, n2) {
|
|
13413
|
+
const oldNode = this.getNode(id);
|
|
13414
|
+
if (oldNode) {
|
|
13415
|
+
const meta = this.nodeMetaMap.get(oldNode);
|
|
13416
|
+
if (meta) this.nodeMetaMap.set(n2, meta);
|
|
13417
|
+
}
|
|
13418
|
+
this.idNodeMap.set(id, n2);
|
|
13419
|
+
}
|
|
13420
|
+
reset() {
|
|
13421
|
+
this.idNodeMap = /* @__PURE__ */ new Map();
|
|
13422
|
+
this.nodeMetaMap = /* @__PURE__ */ new WeakMap();
|
|
13423
|
+
}
|
|
13424
|
+
}
|
|
13425
|
+
function createMirror$2() {
|
|
13426
|
+
return new Mirror();
|
|
13427
|
+
}
|
|
13428
|
+
const IGNORED_NODE = -2;
|
|
13429
|
+
function classMatchesRegex(node2, regex, checkAncestors) {
|
|
13430
|
+
if (!node2) return false;
|
|
13431
|
+
if (node2.nodeType !== node2.ELEMENT_NODE) {
|
|
13432
|
+
if (!checkAncestors) return false;
|
|
13433
|
+
return classMatchesRegex(index$1.parentNode(node2), regex, checkAncestors);
|
|
13434
|
+
}
|
|
13435
|
+
for (let eIndex = node2.classList.length; eIndex--; ) {
|
|
13436
|
+
const className = node2.classList[eIndex];
|
|
13437
|
+
if (regex.test(className)) {
|
|
13438
|
+
return true;
|
|
13439
|
+
}
|
|
13440
|
+
}
|
|
13441
|
+
if (!checkAncestors) return false;
|
|
13442
|
+
return classMatchesRegex(index$1.parentNode(node2), regex, checkAncestors);
|
|
13443
|
+
}
|
|
13444
|
+
// Removed postcss here
|
|
13445
|
+
class BaseRRNode {
|
|
13446
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any
|
|
13447
|
+
constructor(..._args) {
|
|
13448
|
+
__publicField22(this, "parentElement", null);
|
|
13449
|
+
__publicField22(this, "parentNode", null);
|
|
13450
|
+
__publicField22(this, "ownerDocument");
|
|
13451
|
+
__publicField22(this, "firstChild", null);
|
|
13452
|
+
__publicField22(this, "lastChild", null);
|
|
13453
|
+
__publicField22(this, "previousSibling", null);
|
|
13454
|
+
__publicField22(this, "nextSibling", null);
|
|
13455
|
+
__publicField22(this, "ELEMENT_NODE", 1);
|
|
13456
|
+
__publicField22(this, "TEXT_NODE", 3);
|
|
13457
|
+
__publicField22(this, "nodeType");
|
|
13458
|
+
__publicField22(this, "nodeName");
|
|
13459
|
+
__publicField22(this, "RRNodeType");
|
|
13460
|
+
}
|
|
13461
|
+
get childNodes() {
|
|
13462
|
+
const childNodes2 = [];
|
|
13463
|
+
let childIterator = this.firstChild;
|
|
13464
|
+
while (childIterator) {
|
|
13465
|
+
childNodes2.push(childIterator);
|
|
13466
|
+
childIterator = childIterator.nextSibling;
|
|
13467
|
+
}
|
|
13468
|
+
return childNodes2;
|
|
13469
|
+
}
|
|
13470
|
+
contains(node2) {
|
|
13471
|
+
if (!(node2 instanceof BaseRRNode)) return false;
|
|
13472
|
+
else if (node2.ownerDocument !== this.ownerDocument) return false;
|
|
13473
|
+
else if (node2 === this) return true;
|
|
13474
|
+
while (node2.parentNode) {
|
|
13475
|
+
if (node2.parentNode === this) return true;
|
|
13476
|
+
node2 = node2.parentNode;
|
|
13477
|
+
}
|
|
13478
|
+
return false;
|
|
13479
|
+
}
|
|
13480
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
13481
|
+
appendChild(_newChild) {
|
|
13482
|
+
throw new Error(
|
|
13483
|
+
`RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.`
|
|
13484
|
+
);
|
|
13485
|
+
}
|
|
13486
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
13487
|
+
insertBefore(_newChild, _refChild) {
|
|
13488
|
+
throw new Error(
|
|
13489
|
+
`RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.`
|
|
13490
|
+
);
|
|
13491
|
+
}
|
|
13492
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
13493
|
+
removeChild(_node) {
|
|
13494
|
+
throw new Error(
|
|
13495
|
+
`RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.`
|
|
13496
|
+
);
|
|
13497
|
+
}
|
|
13498
|
+
toString() {
|
|
13499
|
+
return "RRNode";
|
|
13500
|
+
}
|
|
13501
|
+
}
|
|
13502
|
+
const testableAccessors = {
|
|
13503
|
+
Node: ["childNodes", "parentNode", "parentElement", "textContent"],
|
|
13504
|
+
ShadowRoot: ["host", "styleSheets"],
|
|
13505
|
+
Element: ["shadowRoot", "querySelector", "querySelectorAll"],
|
|
13506
|
+
MutationObserver: []
|
|
13507
|
+
};
|
|
13508
|
+
const testableMethods = {
|
|
13509
|
+
Node: ["contains", "getRootNode"],
|
|
13510
|
+
ShadowRoot: ["getSelection"],
|
|
13511
|
+
Element: [],
|
|
13512
|
+
MutationObserver: ["constructor"]
|
|
13513
|
+
};
|
|
13514
|
+
const untaintedBasePrototype = {};
|
|
13515
|
+
function getUntaintedPrototype(key) {
|
|
13516
|
+
if (untaintedBasePrototype[key])
|
|
13517
|
+
return untaintedBasePrototype[key];
|
|
13518
|
+
const defaultObj = globalThis[key];
|
|
13519
|
+
const defaultPrototype = defaultObj.prototype;
|
|
13520
|
+
const accessorNames = key in testableAccessors ? testableAccessors[key] : void 0;
|
|
13521
|
+
const isUntaintedAccessors = Boolean(
|
|
13522
|
+
accessorNames && // @ts-expect-error 2345
|
|
13523
|
+
accessorNames.every(
|
|
13524
|
+
(accessor) => {
|
|
13525
|
+
var _a2, _b;
|
|
13526
|
+
return Boolean(
|
|
13527
|
+
(_b = (_a2 = Object.getOwnPropertyDescriptor(defaultPrototype, accessor)) == null ? void 0 : _a2.get) == null ? void 0 : _b.toString().includes("[native code]")
|
|
13528
|
+
);
|
|
13529
|
+
}
|
|
13530
|
+
)
|
|
13531
|
+
);
|
|
13532
|
+
const methodNames = key in testableMethods ? testableMethods[key] : void 0;
|
|
13533
|
+
const isUntaintedMethods = Boolean(
|
|
13534
|
+
methodNames && methodNames.every(
|
|
13535
|
+
// @ts-expect-error 2345
|
|
13536
|
+
(method) => {
|
|
13537
|
+
var _a2;
|
|
13538
|
+
return typeof defaultPrototype[method] === "function" && ((_a2 = defaultPrototype[method]) == null ? void 0 : _a2.toString().includes("[native code]"));
|
|
13539
|
+
}
|
|
13540
|
+
)
|
|
13541
|
+
);
|
|
13542
|
+
if (isUntaintedAccessors && isUntaintedMethods) {
|
|
13543
|
+
untaintedBasePrototype[key] = defaultObj.prototype;
|
|
13544
|
+
return defaultObj.prototype;
|
|
13545
|
+
}
|
|
13546
|
+
try {
|
|
13547
|
+
const iframeEl = document.createElement("iframe");
|
|
13548
|
+
document.body.appendChild(iframeEl);
|
|
13549
|
+
const win = iframeEl.contentWindow;
|
|
13550
|
+
if (!win) return defaultObj.prototype;
|
|
13551
|
+
const untaintedObject = win[key].prototype;
|
|
13552
|
+
document.body.removeChild(iframeEl);
|
|
13553
|
+
if (!untaintedObject) return defaultPrototype;
|
|
13554
|
+
return untaintedBasePrototype[key] = untaintedObject;
|
|
13555
|
+
} catch {
|
|
13556
|
+
return defaultPrototype;
|
|
13557
|
+
}
|
|
13558
|
+
}
|
|
13559
|
+
const untaintedAccessorCache = {};
|
|
13560
|
+
function getUntaintedAccessor(key, instance, accessor) {
|
|
13561
|
+
var _a2;
|
|
13562
|
+
const cacheKey = `${key}.${String(accessor)}`;
|
|
13563
|
+
if (untaintedAccessorCache[cacheKey])
|
|
13564
|
+
return untaintedAccessorCache[cacheKey].call(
|
|
13565
|
+
instance
|
|
13566
|
+
);
|
|
13567
|
+
const untaintedPrototype = getUntaintedPrototype(key);
|
|
13568
|
+
const untaintedAccessor = (_a2 = Object.getOwnPropertyDescriptor(
|
|
13569
|
+
untaintedPrototype,
|
|
13570
|
+
accessor
|
|
13571
|
+
)) == null ? void 0 : _a2.get;
|
|
13572
|
+
if (!untaintedAccessor) return instance[accessor];
|
|
13573
|
+
untaintedAccessorCache[cacheKey] = untaintedAccessor;
|
|
13574
|
+
return untaintedAccessor.call(instance);
|
|
13575
|
+
}
|
|
13576
|
+
const untaintedMethodCache = {};
|
|
13577
|
+
function getUntaintedMethod(key, instance, method) {
|
|
13578
|
+
const cacheKey = `${key}.${String(method)}`;
|
|
13579
|
+
if (untaintedMethodCache[cacheKey])
|
|
13580
|
+
return untaintedMethodCache[cacheKey].bind(
|
|
13581
|
+
instance
|
|
13582
|
+
);
|
|
13583
|
+
const untaintedPrototype = getUntaintedPrototype(key);
|
|
13584
|
+
const untaintedMethod = untaintedPrototype[method];
|
|
13585
|
+
if (typeof untaintedMethod !== "function") return instance[method];
|
|
13586
|
+
untaintedMethodCache[cacheKey] = untaintedMethod;
|
|
13587
|
+
return untaintedMethod.bind(instance);
|
|
13588
|
+
}
|
|
13589
|
+
function childNodes(n2) {
|
|
13590
|
+
return getUntaintedAccessor("Node", n2, "childNodes");
|
|
13591
|
+
}
|
|
13592
|
+
function parentNode(n2) {
|
|
13593
|
+
return getUntaintedAccessor("Node", n2, "parentNode");
|
|
13594
|
+
}
|
|
13595
|
+
function parentElement(n2) {
|
|
13596
|
+
return getUntaintedAccessor("Node", n2, "parentElement");
|
|
13597
|
+
}
|
|
13598
|
+
function textContent(n2) {
|
|
13599
|
+
return getUntaintedAccessor("Node", n2, "textContent");
|
|
13600
|
+
}
|
|
13601
|
+
function contains(n2, other) {
|
|
13602
|
+
return getUntaintedMethod("Node", n2, "contains")(other);
|
|
13603
|
+
}
|
|
13604
|
+
function getRootNode(n2) {
|
|
13605
|
+
return getUntaintedMethod("Node", n2, "getRootNode")();
|
|
13606
|
+
}
|
|
13607
|
+
function host(n2) {
|
|
13608
|
+
if (!n2 || !("host" in n2)) return null;
|
|
13609
|
+
return getUntaintedAccessor("ShadowRoot", n2, "host");
|
|
13610
|
+
}
|
|
13611
|
+
function styleSheets(n2) {
|
|
13612
|
+
return n2.styleSheets;
|
|
13613
|
+
}
|
|
13614
|
+
function shadowRoot(n2) {
|
|
13615
|
+
if (!n2 || !("shadowRoot" in n2)) return null;
|
|
13616
|
+
return getUntaintedAccessor("Element", n2, "shadowRoot");
|
|
13617
|
+
}
|
|
13618
|
+
function querySelector(n2, selectors) {
|
|
13619
|
+
return getUntaintedAccessor("Element", n2, "querySelector")(selectors);
|
|
13620
|
+
}
|
|
13621
|
+
function querySelectorAll(n2, selectors) {
|
|
13622
|
+
return getUntaintedAccessor("Element", n2, "querySelectorAll")(selectors);
|
|
13623
|
+
}
|
|
13624
|
+
function mutationObserverCtor() {
|
|
13625
|
+
return getUntaintedPrototype("MutationObserver").constructor;
|
|
13626
|
+
}
|
|
13627
|
+
const index = {
|
|
13628
|
+
childNodes,
|
|
13629
|
+
parentNode,
|
|
13630
|
+
parentElement,
|
|
13631
|
+
textContent,
|
|
13632
|
+
contains,
|
|
13633
|
+
getRootNode,
|
|
13634
|
+
host,
|
|
13635
|
+
styleSheets,
|
|
13636
|
+
shadowRoot,
|
|
13637
|
+
querySelector,
|
|
13638
|
+
querySelectorAll,
|
|
13639
|
+
mutationObserver: mutationObserverCtor
|
|
13640
|
+
};
|
|
13641
|
+
function on(type, fn, target = document) {
|
|
13642
|
+
const options = { capture: true, passive: true };
|
|
13643
|
+
target.addEventListener(type, fn, options);
|
|
13644
|
+
return () => target.removeEventListener(type, fn, options);
|
|
13645
|
+
}
|
|
13646
|
+
const DEPARTED_MIRROR_ACCESS_WARNING = "Please stop import mirror directly. Instead of that,\r\nnow you can use replayer.getMirror() to access the mirror instance of a replayer,\r\nor you can use record.mirror to access the mirror instance during recording.";
|
|
13647
|
+
let _mirror = {
|
|
13648
|
+
map: {},
|
|
13649
|
+
getId() {
|
|
13650
|
+
console.error(DEPARTED_MIRROR_ACCESS_WARNING);
|
|
13651
|
+
return -1;
|
|
13652
|
+
},
|
|
13653
|
+
getNode() {
|
|
13654
|
+
console.error(DEPARTED_MIRROR_ACCESS_WARNING);
|
|
13655
|
+
return null;
|
|
13656
|
+
},
|
|
13657
|
+
removeNodeFromMap() {
|
|
13658
|
+
console.error(DEPARTED_MIRROR_ACCESS_WARNING);
|
|
13659
|
+
},
|
|
13660
|
+
has() {
|
|
13661
|
+
console.error(DEPARTED_MIRROR_ACCESS_WARNING);
|
|
13662
|
+
return false;
|
|
13663
|
+
},
|
|
13664
|
+
reset() {
|
|
13665
|
+
console.error(DEPARTED_MIRROR_ACCESS_WARNING);
|
|
13666
|
+
}
|
|
13667
|
+
};
|
|
13668
|
+
if (typeof window !== "undefined" && window.Proxy && window.Reflect) {
|
|
13669
|
+
_mirror = new Proxy(_mirror, {
|
|
13670
|
+
get(target, prop, receiver) {
|
|
13671
|
+
if (prop === "map") {
|
|
13672
|
+
console.error(DEPARTED_MIRROR_ACCESS_WARNING);
|
|
13673
|
+
}
|
|
13674
|
+
return Reflect.get(target, prop, receiver);
|
|
13675
|
+
}
|
|
13676
|
+
});
|
|
13677
|
+
}
|
|
13678
|
+
function throttle(func, wait, options = {}) {
|
|
13679
|
+
let timeout = null;
|
|
13680
|
+
let previous = 0;
|
|
13681
|
+
return function(...args) {
|
|
13682
|
+
const now = Date.now();
|
|
13683
|
+
if (!previous && options.leading === false) {
|
|
13684
|
+
previous = now;
|
|
13685
|
+
}
|
|
13686
|
+
const remaining = wait - (now - previous);
|
|
13687
|
+
const context = this;
|
|
13688
|
+
if (remaining <= 0 || remaining > wait) {
|
|
13689
|
+
if (timeout) {
|
|
13690
|
+
clearTimeout(timeout);
|
|
13691
|
+
timeout = null;
|
|
13692
|
+
}
|
|
13693
|
+
previous = now;
|
|
13694
|
+
func.apply(context, args);
|
|
13695
|
+
} else if (!timeout && options.trailing !== false) {
|
|
13696
|
+
timeout = setTimeout(() => {
|
|
13697
|
+
previous = options.leading === false ? 0 : Date.now();
|
|
13698
|
+
timeout = null;
|
|
13699
|
+
func.apply(context, args);
|
|
13700
|
+
}, remaining);
|
|
13701
|
+
}
|
|
13702
|
+
};
|
|
13703
|
+
}
|
|
13704
|
+
function hookSetter(target, key, d, isRevoked, win = window) {
|
|
13705
|
+
const original = win.Object.getOwnPropertyDescriptor(target, key);
|
|
13706
|
+
win.Object.defineProperty(
|
|
13707
|
+
target,
|
|
13708
|
+
key,
|
|
13709
|
+
isRevoked ? d : {
|
|
13710
|
+
set(value) {
|
|
13711
|
+
setTimeout(() => {
|
|
13712
|
+
d.set.call(this, value);
|
|
13713
|
+
}, 0);
|
|
13714
|
+
if (original && original.set) {
|
|
13715
|
+
original.set.call(this, value);
|
|
13716
|
+
}
|
|
13717
|
+
}
|
|
13718
|
+
}
|
|
13719
|
+
);
|
|
13720
|
+
return () => hookSetter(target, key, original || {}, true);
|
|
13721
|
+
}
|
|
13722
|
+
function patch$1(source, name, replacement) {
|
|
13723
|
+
try {
|
|
13724
|
+
if (!(name in source)) {
|
|
13725
|
+
return () => {
|
|
13726
|
+
};
|
|
13727
|
+
}
|
|
13728
|
+
const original = source[name];
|
|
13729
|
+
const wrapped = replacement(original);
|
|
13730
|
+
if (typeof wrapped === "function") {
|
|
13731
|
+
wrapped.prototype = wrapped.prototype || {};
|
|
13732
|
+
Object.defineProperties(wrapped, {
|
|
13733
|
+
__rrweb_original__: {
|
|
13734
|
+
enumerable: false,
|
|
13735
|
+
value: original
|
|
13736
|
+
}
|
|
13737
|
+
});
|
|
13738
|
+
}
|
|
13739
|
+
source[name] = wrapped;
|
|
13740
|
+
return () => {
|
|
13741
|
+
source[name] = original;
|
|
13742
|
+
};
|
|
13743
|
+
} catch {
|
|
13744
|
+
return () => {
|
|
13745
|
+
};
|
|
13746
|
+
}
|
|
13747
|
+
}
|
|
13748
|
+
let nowTimestamp = Date.now;
|
|
13749
|
+
if (!/* @__PURE__ */ /[1-9][0-9]{12}/.test(Date.now().toString())) {
|
|
13750
|
+
nowTimestamp = () => (/* @__PURE__ */ new Date()).getTime();
|
|
13751
|
+
}
|
|
13752
|
+
function getWindowScroll(win) {
|
|
13753
|
+
var _a2, _b, _c, _d;
|
|
13754
|
+
const doc = win.document;
|
|
13755
|
+
return {
|
|
13756
|
+
left: doc.scrollingElement ? doc.scrollingElement.scrollLeft : win.pageXOffset !== void 0 ? win.pageXOffset : doc.documentElement.scrollLeft || (doc == null ? void 0 : doc.body) && ((_a2 = index.parentElement(doc.body)) == null ? void 0 : _a2.scrollLeft) || ((_b = doc == null ? void 0 : doc.body) == null ? void 0 : _b.scrollLeft) || 0,
|
|
13757
|
+
top: doc.scrollingElement ? doc.scrollingElement.scrollTop : win.pageYOffset !== void 0 ? win.pageYOffset : (doc == null ? void 0 : doc.documentElement.scrollTop) || (doc == null ? void 0 : doc.body) && ((_c = index.parentElement(doc.body)) == null ? void 0 : _c.scrollTop) || ((_d = doc == null ? void 0 : doc.body) == null ? void 0 : _d.scrollTop) || 0
|
|
13758
|
+
};
|
|
13759
|
+
}
|
|
13760
|
+
function getWindowHeight() {
|
|
13761
|
+
return window.innerHeight || document.documentElement && document.documentElement.clientHeight || document.body && document.body.clientHeight;
|
|
13762
|
+
}
|
|
13763
|
+
function getWindowWidth() {
|
|
13764
|
+
return window.innerWidth || document.documentElement && document.documentElement.clientWidth || document.body && document.body.clientWidth;
|
|
13765
|
+
}
|
|
13766
|
+
function closestElementOfNode(node2) {
|
|
13767
|
+
if (!node2) {
|
|
13768
|
+
return null;
|
|
13769
|
+
}
|
|
13770
|
+
const el = node2.nodeType === node2.ELEMENT_NODE ? node2 : index.parentElement(node2);
|
|
13771
|
+
return el;
|
|
13772
|
+
}
|
|
13773
|
+
function isBlocked(node2, blockClass, blockSelector, checkAncestors) {
|
|
13774
|
+
if (!node2) {
|
|
13775
|
+
return false;
|
|
13776
|
+
}
|
|
13777
|
+
const el = closestElementOfNode(node2);
|
|
13778
|
+
if (!el) {
|
|
13779
|
+
return false;
|
|
13780
|
+
}
|
|
13781
|
+
try {
|
|
13782
|
+
if (typeof blockClass === "string") {
|
|
13783
|
+
if (el.classList.contains(blockClass)) return true;
|
|
13784
|
+
if (checkAncestors && el.closest("." + blockClass) !== null) return true;
|
|
13785
|
+
} else {
|
|
13786
|
+
if (classMatchesRegex(el, blockClass, checkAncestors)) return true;
|
|
13787
|
+
}
|
|
13788
|
+
} catch (e2) {
|
|
13789
|
+
}
|
|
13790
|
+
if (blockSelector) {
|
|
13791
|
+
if (el.matches(blockSelector)) return true;
|
|
13792
|
+
if (checkAncestors && el.closest(blockSelector) !== null) return true;
|
|
13793
|
+
}
|
|
13794
|
+
return false;
|
|
13795
|
+
}
|
|
13796
|
+
function isSerialized(n2, mirror2) {
|
|
13797
|
+
return mirror2.getId(n2) !== -1;
|
|
13798
|
+
}
|
|
13799
|
+
function isIgnored(n2, mirror2, slimDOMOptions) {
|
|
13800
|
+
if (n2.tagName === "TITLE" && slimDOMOptions.headTitleMutations) {
|
|
13801
|
+
return true;
|
|
13802
|
+
}
|
|
13803
|
+
return mirror2.getId(n2) === IGNORED_NODE;
|
|
13804
|
+
}
|
|
13805
|
+
function isAncestorRemoved(target, mirror2) {
|
|
13806
|
+
if (isShadowRoot(target)) {
|
|
13807
|
+
return false;
|
|
13808
|
+
}
|
|
13809
|
+
const id = mirror2.getId(target);
|
|
13810
|
+
if (!mirror2.has(id)) {
|
|
13811
|
+
return true;
|
|
13812
|
+
}
|
|
13813
|
+
const parent = index.parentNode(target);
|
|
13814
|
+
if (parent && parent.nodeType === target.DOCUMENT_NODE) {
|
|
13815
|
+
return false;
|
|
13816
|
+
}
|
|
13817
|
+
if (!parent) {
|
|
13818
|
+
return true;
|
|
13819
|
+
}
|
|
13820
|
+
return isAncestorRemoved(parent, mirror2);
|
|
13821
|
+
}
|
|
13822
|
+
function legacy_isTouchEvent(event) {
|
|
13823
|
+
return Boolean(event.changedTouches);
|
|
13824
|
+
}
|
|
13825
|
+
function polyfill$1(win = window) {
|
|
13826
|
+
if ("NodeList" in win && !win.NodeList.prototype.forEach) {
|
|
13827
|
+
win.NodeList.prototype.forEach = Array.prototype.forEach;
|
|
13828
|
+
}
|
|
13829
|
+
if ("DOMTokenList" in win && !win.DOMTokenList.prototype.forEach) {
|
|
13830
|
+
win.DOMTokenList.prototype.forEach = Array.prototype.forEach;
|
|
13831
|
+
}
|
|
13832
|
+
}
|
|
13833
|
+
function queueToResolveTrees(queue) {
|
|
13834
|
+
const queueNodeMap = {};
|
|
13835
|
+
const putIntoMap = (m, parent) => {
|
|
13836
|
+
const nodeInTree = {
|
|
13837
|
+
value: m,
|
|
13838
|
+
parent,
|
|
13839
|
+
children: []
|
|
13840
|
+
};
|
|
13841
|
+
queueNodeMap[m.node.id] = nodeInTree;
|
|
13842
|
+
return nodeInTree;
|
|
13843
|
+
};
|
|
13844
|
+
const queueNodeTrees = [];
|
|
13845
|
+
for (const mutation of queue) {
|
|
13846
|
+
const { nextId, parentId } = mutation;
|
|
13847
|
+
if (nextId && nextId in queueNodeMap) {
|
|
13848
|
+
const nextInTree = queueNodeMap[nextId];
|
|
13849
|
+
if (nextInTree.parent) {
|
|
13850
|
+
const idx = nextInTree.parent.children.indexOf(nextInTree);
|
|
13851
|
+
nextInTree.parent.children.splice(
|
|
13852
|
+
idx,
|
|
13853
|
+
0,
|
|
13854
|
+
putIntoMap(mutation, nextInTree.parent)
|
|
13855
|
+
);
|
|
13856
|
+
} else {
|
|
13857
|
+
const idx = queueNodeTrees.indexOf(nextInTree);
|
|
13858
|
+
queueNodeTrees.splice(idx, 0, putIntoMap(mutation, null));
|
|
13859
|
+
}
|
|
13860
|
+
continue;
|
|
13861
|
+
}
|
|
13862
|
+
if (parentId in queueNodeMap) {
|
|
13863
|
+
const parentInTree = queueNodeMap[parentId];
|
|
13864
|
+
parentInTree.children.push(putIntoMap(mutation, parentInTree));
|
|
13865
|
+
continue;
|
|
13866
|
+
}
|
|
13867
|
+
queueNodeTrees.push(putIntoMap(mutation, null));
|
|
13868
|
+
}
|
|
13869
|
+
return queueNodeTrees;
|
|
13870
|
+
}
|
|
13871
|
+
function iterateResolveTree(tree, cb) {
|
|
13872
|
+
cb(tree.value);
|
|
13873
|
+
for (let i2 = tree.children.length - 1; i2 >= 0; i2--) {
|
|
13874
|
+
iterateResolveTree(tree.children[i2], cb);
|
|
13875
|
+
}
|
|
13876
|
+
}
|
|
13877
|
+
function isSerializedIframe(n2, mirror2) {
|
|
13878
|
+
return Boolean(n2.nodeName === "IFRAME" && mirror2.getMeta(n2));
|
|
13879
|
+
}
|
|
13880
|
+
function isSerializedStylesheet(n2, mirror2) {
|
|
13881
|
+
return Boolean(
|
|
13882
|
+
n2.nodeName === "LINK" && n2.nodeType === n2.ELEMENT_NODE && n2.getAttribute && n2.getAttribute("rel") === "stylesheet" && mirror2.getMeta(n2)
|
|
13883
|
+
);
|
|
13884
|
+
}
|
|
13885
|
+
function getBaseDimension(node2, rootIframe) {
|
|
13886
|
+
var _a2, _b;
|
|
13887
|
+
const frameElement = (_b = (_a2 = node2.ownerDocument) == null ? void 0 : _a2.defaultView) == null ? void 0 : _b.frameElement;
|
|
13888
|
+
if (!frameElement || frameElement === rootIframe) {
|
|
13889
|
+
return {
|
|
13890
|
+
x: 0,
|
|
13891
|
+
y: 0,
|
|
13892
|
+
relativeScale: 1,
|
|
13893
|
+
absoluteScale: 1
|
|
13894
|
+
};
|
|
13895
|
+
}
|
|
13896
|
+
const frameDimension = frameElement.getBoundingClientRect();
|
|
13897
|
+
const frameBaseDimension = getBaseDimension(frameElement, rootIframe);
|
|
13898
|
+
const relativeScale = frameDimension.height / frameElement.clientHeight;
|
|
13899
|
+
return {
|
|
13900
|
+
x: frameDimension.x * frameBaseDimension.relativeScale + frameBaseDimension.x,
|
|
13901
|
+
y: frameDimension.y * frameBaseDimension.relativeScale + frameBaseDimension.y,
|
|
13902
|
+
relativeScale,
|
|
13903
|
+
absoluteScale: frameBaseDimension.absoluteScale * relativeScale
|
|
13904
|
+
};
|
|
13905
|
+
}
|
|
13906
|
+
function hasShadowRoot(n2) {
|
|
13907
|
+
if (!n2) return false;
|
|
13908
|
+
if (n2 instanceof BaseRRNode && "shadowRoot" in n2) {
|
|
13909
|
+
return Boolean(n2.shadowRoot);
|
|
13910
|
+
}
|
|
13911
|
+
return Boolean(index.shadowRoot(n2));
|
|
13912
|
+
}
|
|
13913
|
+
function getNestedRule(rules2, position) {
|
|
13914
|
+
const rule2 = rules2[position[0]];
|
|
13915
|
+
if (position.length === 1) {
|
|
13916
|
+
return rule2;
|
|
13917
|
+
} else {
|
|
13918
|
+
return getNestedRule(
|
|
13919
|
+
rule2.cssRules[position[1]].cssRules,
|
|
13920
|
+
position.slice(2)
|
|
13921
|
+
);
|
|
13922
|
+
}
|
|
13923
|
+
}
|
|
13924
|
+
function getPositionsAndIndex(nestedIndex) {
|
|
13925
|
+
const positions = [...nestedIndex];
|
|
13926
|
+
const index2 = positions.pop();
|
|
13927
|
+
return { positions, index: index2 };
|
|
13928
|
+
}
|
|
13929
|
+
function uniqueTextMutations(mutations) {
|
|
13930
|
+
const idSet = /* @__PURE__ */ new Set();
|
|
13931
|
+
const uniqueMutations = [];
|
|
13932
|
+
for (let i2 = mutations.length; i2--; ) {
|
|
13933
|
+
const mutation = mutations[i2];
|
|
13934
|
+
if (!idSet.has(mutation.id)) {
|
|
13935
|
+
uniqueMutations.push(mutation);
|
|
13936
|
+
idSet.add(mutation.id);
|
|
13937
|
+
}
|
|
13938
|
+
}
|
|
13939
|
+
return uniqueMutations;
|
|
13940
|
+
}
|
|
13941
|
+
class StyleSheetMirror {
|
|
13942
|
+
constructor() {
|
|
13943
|
+
__publicField2$1(this, "id", 1);
|
|
13944
|
+
__publicField2$1(this, "styleIDMap", /* @__PURE__ */ new WeakMap());
|
|
13945
|
+
__publicField2$1(this, "idStyleMap", /* @__PURE__ */ new Map());
|
|
13946
|
+
}
|
|
13947
|
+
getId(stylesheet) {
|
|
13948
|
+
return this.styleIDMap.get(stylesheet) ?? -1;
|
|
13949
|
+
}
|
|
13950
|
+
has(stylesheet) {
|
|
13951
|
+
return this.styleIDMap.has(stylesheet);
|
|
13952
|
+
}
|
|
13953
|
+
/**
|
|
13954
|
+
* @returns If the stylesheet is in the mirror, returns the id of the stylesheet. If not, return the new assigned id.
|
|
13955
|
+
*/
|
|
13956
|
+
add(stylesheet, id) {
|
|
13957
|
+
if (this.has(stylesheet)) return this.getId(stylesheet);
|
|
13958
|
+
let newId;
|
|
13959
|
+
if (id === void 0) {
|
|
13960
|
+
newId = this.id++;
|
|
13961
|
+
} else newId = id;
|
|
13962
|
+
this.styleIDMap.set(stylesheet, newId);
|
|
13963
|
+
this.idStyleMap.set(newId, stylesheet);
|
|
13964
|
+
return newId;
|
|
13965
|
+
}
|
|
13966
|
+
getStyle(id) {
|
|
13967
|
+
return this.idStyleMap.get(id) || null;
|
|
13968
|
+
}
|
|
13969
|
+
reset() {
|
|
13970
|
+
this.styleIDMap = /* @__PURE__ */ new WeakMap();
|
|
13971
|
+
this.idStyleMap = /* @__PURE__ */ new Map();
|
|
13972
|
+
this.id = 1;
|
|
13973
|
+
}
|
|
13974
|
+
generateId() {
|
|
13975
|
+
return this.id++;
|
|
13976
|
+
}
|
|
13977
|
+
}
|
|
13978
|
+
function getShadowHost(n2) {
|
|
13979
|
+
var _a2;
|
|
13980
|
+
let shadowHost = null;
|
|
13981
|
+
if ("getRootNode" in n2 && ((_a2 = index.getRootNode(n2)) == null ? void 0 : _a2.nodeType) === Node.DOCUMENT_FRAGMENT_NODE && index.host(index.getRootNode(n2)))
|
|
13982
|
+
shadowHost = index.host(index.getRootNode(n2));
|
|
13983
|
+
return shadowHost;
|
|
13984
|
+
}
|
|
13985
|
+
function getRootShadowHost(n2) {
|
|
13986
|
+
let rootShadowHost = n2;
|
|
13987
|
+
let shadowHost;
|
|
13988
|
+
while (shadowHost = getShadowHost(rootShadowHost))
|
|
13989
|
+
rootShadowHost = shadowHost;
|
|
13990
|
+
return rootShadowHost;
|
|
13991
|
+
}
|
|
13992
|
+
function shadowHostInDom(n2) {
|
|
13993
|
+
const doc = n2.ownerDocument;
|
|
13994
|
+
if (!doc) return false;
|
|
13995
|
+
const shadowHost = getRootShadowHost(n2);
|
|
13996
|
+
return index.contains(doc, shadowHost);
|
|
13997
|
+
}
|
|
13998
|
+
function inDom(n2) {
|
|
13999
|
+
const doc = n2.ownerDocument;
|
|
14000
|
+
if (!doc) return false;
|
|
14001
|
+
return index.contains(doc, n2) || shadowHostInDom(n2);
|
|
14002
|
+
}
|
|
14003
|
+
const utils = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
14004
|
+
__proto__: null,
|
|
14005
|
+
StyleSheetMirror,
|
|
14006
|
+
get _mirror() {
|
|
14007
|
+
return _mirror;
|
|
14008
|
+
},
|
|
14009
|
+
closestElementOfNode,
|
|
14010
|
+
getBaseDimension,
|
|
14011
|
+
getNestedRule,
|
|
14012
|
+
getPositionsAndIndex,
|
|
14013
|
+
getRootShadowHost,
|
|
14014
|
+
getShadowHost,
|
|
14015
|
+
getWindowHeight,
|
|
14016
|
+
getWindowScroll,
|
|
14017
|
+
getWindowWidth,
|
|
14018
|
+
hasShadowRoot,
|
|
14019
|
+
hookSetter,
|
|
14020
|
+
inDom,
|
|
14021
|
+
isAncestorRemoved,
|
|
14022
|
+
isBlocked,
|
|
14023
|
+
isIgnored,
|
|
14024
|
+
isSerialized,
|
|
14025
|
+
isSerializedIframe,
|
|
14026
|
+
isSerializedStylesheet,
|
|
14027
|
+
iterateResolveTree,
|
|
14028
|
+
legacy_isTouchEvent,
|
|
14029
|
+
get nowTimestamp() {
|
|
14030
|
+
return nowTimestamp;
|
|
14031
|
+
},
|
|
14032
|
+
on,
|
|
14033
|
+
patch: patch$1,
|
|
14034
|
+
polyfill: polyfill$1,
|
|
14035
|
+
queueToResolveTrees,
|
|
14036
|
+
shadowHostInDom,
|
|
14037
|
+
throttle,
|
|
14038
|
+
uniqueTextMutations
|
|
14039
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
14040
|
+
var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
|
14041
|
+
var lookup = typeof Uint8Array === "undefined" ? [] : new Uint8Array(256);
|
|
14042
|
+
for (var i$1 = 0; i$1 < chars.length; i$1++) {
|
|
14043
|
+
lookup[chars.charCodeAt(i$1)] = i$1;
|
|
14044
|
+
}
|
|
14045
|
+
const encodedJs = "KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=";
|
|
14046
|
+
const decodeBase64 = (base64) => Uint8Array.from(atob(base64), (c2) => c2.charCodeAt(0));
|
|
14047
|
+
typeof window !== "undefined" && window.Blob && new Blob([decodeBase64(encodedJs)], { type: "text/javascript;charset=utf-8" });
|
|
14048
|
+
try {
|
|
14049
|
+
if (Array.from([1], (x2) => x2 * 2)[0] !== 2) {
|
|
14050
|
+
const cleanFrame = document.createElement("iframe");
|
|
14051
|
+
document.body.appendChild(cleanFrame);
|
|
14052
|
+
Array.from = ((_a = cleanFrame.contentWindow) == null ? void 0 : _a.Array.from) || Array.from;
|
|
14053
|
+
document.body.removeChild(cleanFrame);
|
|
14054
|
+
}
|
|
14055
|
+
} catch (err) {
|
|
14056
|
+
console.debug("Unable to override Array.from", err);
|
|
14057
|
+
}
|
|
14058
|
+
createMirror$2();
|
|
14059
|
+
var n;
|
|
14060
|
+
!function(t2) {
|
|
14061
|
+
t2[t2.NotStarted = 0] = "NotStarted", t2[t2.Running = 1] = "Running", t2[t2.Stopped = 2] = "Stopped";
|
|
14062
|
+
}(n || (n = {}));
|
|
14063
|
+
class StackFrame {
|
|
14064
|
+
constructor(obj) {
|
|
14065
|
+
__publicField(this, "fileName");
|
|
14066
|
+
__publicField(this, "functionName");
|
|
14067
|
+
__publicField(this, "lineNumber");
|
|
14068
|
+
__publicField(this, "columnNumber");
|
|
14069
|
+
this.fileName = obj.fileName || "";
|
|
14070
|
+
this.functionName = obj.functionName || "";
|
|
14071
|
+
this.lineNumber = obj.lineNumber;
|
|
14072
|
+
this.columnNumber = obj.columnNumber;
|
|
14073
|
+
}
|
|
14074
|
+
toString() {
|
|
14075
|
+
const lineNumber = this.lineNumber || "";
|
|
14076
|
+
const columnNumber = this.columnNumber || "";
|
|
14077
|
+
if (this.functionName)
|
|
14078
|
+
return `${this.functionName} (${this.fileName}:${lineNumber}:${columnNumber})`;
|
|
14079
|
+
return `${this.fileName}:${lineNumber}:${columnNumber}`;
|
|
14080
|
+
}
|
|
14081
|
+
}
|
|
14082
|
+
const FIREFOX_SAFARI_STACK_REGEXP = /(^|@)\S+:\d+/;
|
|
14083
|
+
const CHROME_IE_STACK_REGEXP = /^\s*at .*(\S+:\d+|\(native\))/m;
|
|
14084
|
+
const SAFARI_NATIVE_CODE_REGEXP = /^(eval@)?(\[native code])?$/;
|
|
14085
|
+
const ErrorStackParser = {
|
|
14086
|
+
/**
|
|
14087
|
+
* Given an Error object, extract the most information from it.
|
|
14088
|
+
*/
|
|
14089
|
+
parse: function(error) {
|
|
14090
|
+
if (!error) {
|
|
14091
|
+
return [];
|
|
14092
|
+
}
|
|
14093
|
+
if (
|
|
14094
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
14095
|
+
// @ts-ignore
|
|
14096
|
+
typeof error.stacktrace !== "undefined" || // eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
14097
|
+
// @ts-ignore
|
|
14098
|
+
typeof error["opera#sourceloc"] !== "undefined"
|
|
14099
|
+
) {
|
|
14100
|
+
return this.parseOpera(
|
|
14101
|
+
error
|
|
14102
|
+
);
|
|
14103
|
+
} else if (error.stack && error.stack.match(CHROME_IE_STACK_REGEXP)) {
|
|
14104
|
+
return this.parseV8OrIE(error);
|
|
14105
|
+
} else if (error.stack) {
|
|
14106
|
+
return this.parseFFOrSafari(error);
|
|
14107
|
+
} else {
|
|
14108
|
+
console.warn(
|
|
14109
|
+
"[console-record-plugin]: Failed to parse error object:",
|
|
14110
|
+
error
|
|
14111
|
+
);
|
|
14112
|
+
return [];
|
|
14113
|
+
}
|
|
14114
|
+
},
|
|
14115
|
+
// Separate line and column numbers from a string of the form: (URI:Line:Column)
|
|
14116
|
+
extractLocation: function(urlLike) {
|
|
14117
|
+
if (urlLike.indexOf(":") === -1) {
|
|
14118
|
+
return [urlLike];
|
|
14119
|
+
}
|
|
14120
|
+
const regExp = /(.+?)(?::(\d+))?(?::(\d+))?$/;
|
|
14121
|
+
const parts = regExp.exec(urlLike.replace(/[()]/g, ""));
|
|
14122
|
+
if (!parts) throw new Error(`Cannot parse given url: ${urlLike}`);
|
|
14123
|
+
return [parts[1], parts[2] || void 0, parts[3] || void 0];
|
|
14124
|
+
},
|
|
14125
|
+
parseV8OrIE: function(error) {
|
|
14126
|
+
const filtered = error.stack.split("\n").filter(function(line) {
|
|
14127
|
+
return !!line.match(CHROME_IE_STACK_REGEXP);
|
|
14128
|
+
}, this);
|
|
14129
|
+
return filtered.map(function(line) {
|
|
14130
|
+
if (line.indexOf("(eval ") > -1) {
|
|
14131
|
+
line = line.replace(/eval code/g, "eval").replace(/(\(eval at [^()]*)|(\),.*$)/g, "");
|
|
14132
|
+
}
|
|
14133
|
+
let sanitizedLine = line.replace(/^\s+/, "").replace(/\(eval code/g, "(");
|
|
14134
|
+
const location = sanitizedLine.match(/ (\((.+):(\d+):(\d+)\)$)/);
|
|
14135
|
+
sanitizedLine = location ? sanitizedLine.replace(location[0], "") : sanitizedLine;
|
|
14136
|
+
const tokens = sanitizedLine.split(/\s+/).slice(1);
|
|
14137
|
+
const locationParts = this.extractLocation(
|
|
14138
|
+
location ? location[1] : tokens.pop()
|
|
14139
|
+
);
|
|
14140
|
+
const functionName = tokens.join(" ") || void 0;
|
|
14141
|
+
const fileName = ["eval", "<anonymous>"].indexOf(locationParts[0]) > -1 ? void 0 : locationParts[0];
|
|
14142
|
+
return new StackFrame({
|
|
14143
|
+
functionName,
|
|
14144
|
+
fileName,
|
|
14145
|
+
lineNumber: locationParts[1],
|
|
14146
|
+
columnNumber: locationParts[2]
|
|
14147
|
+
});
|
|
14148
|
+
}, this);
|
|
14149
|
+
},
|
|
14150
|
+
parseFFOrSafari: function(error) {
|
|
14151
|
+
const filtered = error.stack.split("\n").filter(function(line) {
|
|
14152
|
+
return !line.match(SAFARI_NATIVE_CODE_REGEXP);
|
|
14153
|
+
}, this);
|
|
14154
|
+
return filtered.map(function(line) {
|
|
14155
|
+
if (line.indexOf(" > eval") > -1) {
|
|
14156
|
+
line = line.replace(
|
|
14157
|
+
/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,
|
|
14158
|
+
":$1"
|
|
14159
|
+
);
|
|
14160
|
+
}
|
|
14161
|
+
if (line.indexOf("@") === -1 && line.indexOf(":") === -1) {
|
|
14162
|
+
return new StackFrame({
|
|
14163
|
+
functionName: line
|
|
14164
|
+
});
|
|
14165
|
+
} else {
|
|
14166
|
+
const functionNameRegex = /((.*".+"[^@]*)?[^@]*)(?:@)/;
|
|
14167
|
+
const matches = line.match(functionNameRegex);
|
|
14168
|
+
const functionName = matches && matches[1] ? matches[1] : void 0;
|
|
14169
|
+
const locationParts = this.extractLocation(
|
|
14170
|
+
line.replace(functionNameRegex, "")
|
|
14171
|
+
);
|
|
14172
|
+
return new StackFrame({
|
|
14173
|
+
functionName,
|
|
14174
|
+
fileName: locationParts[0],
|
|
14175
|
+
lineNumber: locationParts[1],
|
|
14176
|
+
columnNumber: locationParts[2]
|
|
14177
|
+
});
|
|
14178
|
+
}
|
|
14179
|
+
}, this);
|
|
14180
|
+
},
|
|
14181
|
+
parseOpera: function(e) {
|
|
14182
|
+
if (!e.stacktrace || e.message.indexOf("\n") > -1 && e.message.split("\n").length > e.stacktrace.split("\n").length) {
|
|
14183
|
+
return this.parseOpera9(e);
|
|
14184
|
+
} else if (!e.stack) {
|
|
14185
|
+
return this.parseOpera10(e);
|
|
14186
|
+
} else {
|
|
14187
|
+
return this.parseOpera11(e);
|
|
14188
|
+
}
|
|
14189
|
+
},
|
|
14190
|
+
parseOpera9: function(e) {
|
|
14191
|
+
const lineRE = /Line (\d+).*script (?:in )?(\S+)/i;
|
|
14192
|
+
const lines = e.message.split("\n");
|
|
14193
|
+
const result2 = [];
|
|
14194
|
+
for (let i = 2, len = lines.length; i < len; i += 2) {
|
|
14195
|
+
const match = lineRE.exec(lines[i]);
|
|
14196
|
+
if (match) {
|
|
14197
|
+
result2.push(
|
|
14198
|
+
new StackFrame({
|
|
14199
|
+
fileName: match[2],
|
|
14200
|
+
lineNumber: parseFloat(match[1])
|
|
14201
|
+
})
|
|
14202
|
+
);
|
|
14203
|
+
}
|
|
14204
|
+
}
|
|
14205
|
+
return result2;
|
|
14206
|
+
},
|
|
14207
|
+
parseOpera10: function(e) {
|
|
14208
|
+
const lineRE = /Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i;
|
|
14209
|
+
const lines = e.stacktrace.split("\n");
|
|
14210
|
+
const result2 = [];
|
|
14211
|
+
for (let i = 0, len = lines.length; i < len; i += 2) {
|
|
14212
|
+
const match = lineRE.exec(lines[i]);
|
|
14213
|
+
if (match) {
|
|
14214
|
+
result2.push(
|
|
14215
|
+
new StackFrame({
|
|
14216
|
+
functionName: match[3] || void 0,
|
|
14217
|
+
fileName: match[2],
|
|
14218
|
+
lineNumber: parseFloat(match[1])
|
|
14219
|
+
})
|
|
14220
|
+
);
|
|
14221
|
+
}
|
|
14222
|
+
}
|
|
14223
|
+
return result2;
|
|
14224
|
+
},
|
|
14225
|
+
// Opera 10.65+ Error.stack very similar to FF/Safari
|
|
14226
|
+
parseOpera11: function(error) {
|
|
14227
|
+
const filtered = error.stack.split("\n").filter(function(line) {
|
|
14228
|
+
return !!line.match(FIREFOX_SAFARI_STACK_REGEXP) && !line.match(/^Error created at/);
|
|
14229
|
+
}, this);
|
|
14230
|
+
return filtered.map(function(line) {
|
|
14231
|
+
const tokens = line.split("@");
|
|
14232
|
+
const locationParts = this.extractLocation(tokens.pop());
|
|
14233
|
+
const functionCall = tokens.shift() || "";
|
|
14234
|
+
const functionName = functionCall.replace(/<anonymous function(: (\w+))?>/, "$2").replace(/\([^)]*\)/g, "") || void 0;
|
|
14235
|
+
return new StackFrame({
|
|
14236
|
+
functionName,
|
|
14237
|
+
fileName: locationParts[0],
|
|
14238
|
+
lineNumber: locationParts[1],
|
|
14239
|
+
columnNumber: locationParts[2]
|
|
14240
|
+
});
|
|
14241
|
+
}, this);
|
|
14242
|
+
}
|
|
14243
|
+
};
|
|
14244
|
+
function pathToSelector(node2) {
|
|
14245
|
+
if (!node2 || !node2.outerHTML) {
|
|
14246
|
+
return "";
|
|
14247
|
+
}
|
|
14248
|
+
let path = "";
|
|
14249
|
+
while (node2.parentElement) {
|
|
14250
|
+
let name = node2.localName;
|
|
14251
|
+
if (!name) {
|
|
14252
|
+
break;
|
|
14253
|
+
}
|
|
14254
|
+
name = name.toLowerCase();
|
|
14255
|
+
const parent = node2.parentElement;
|
|
14256
|
+
const domSiblings = [];
|
|
14257
|
+
if (parent.children && parent.children.length > 0) {
|
|
14258
|
+
for (let i = 0; i < parent.children.length; i++) {
|
|
14259
|
+
const sibling = parent.children[i];
|
|
14260
|
+
if (sibling.localName && sibling.localName.toLowerCase) {
|
|
14261
|
+
if (sibling.localName.toLowerCase() === name) {
|
|
14262
|
+
domSiblings.push(sibling);
|
|
14263
|
+
}
|
|
14264
|
+
}
|
|
14265
|
+
}
|
|
14266
|
+
}
|
|
14267
|
+
if (domSiblings.length > 1) {
|
|
14268
|
+
name += `:eq(${domSiblings.indexOf(node2)})`;
|
|
14269
|
+
}
|
|
14270
|
+
path = name + (path ? ">" + path : "");
|
|
14271
|
+
node2 = parent;
|
|
14272
|
+
}
|
|
14273
|
+
return path;
|
|
14274
|
+
}
|
|
14275
|
+
function isObject(obj) {
|
|
14276
|
+
return Object.prototype.toString.call(obj) === "[object Object]";
|
|
14277
|
+
}
|
|
14278
|
+
function isObjTooDeep(obj, limit) {
|
|
14279
|
+
if (limit === 0) {
|
|
14280
|
+
return true;
|
|
14281
|
+
}
|
|
14282
|
+
const keys = Object.keys(obj);
|
|
14283
|
+
for (const key of keys) {
|
|
14284
|
+
if (isObject(obj[key]) && isObjTooDeep(obj[key], limit - 1)) {
|
|
14285
|
+
return true;
|
|
14286
|
+
}
|
|
14287
|
+
}
|
|
14288
|
+
return false;
|
|
14289
|
+
}
|
|
14290
|
+
function stringify(obj, stringifyOptions) {
|
|
14291
|
+
const options = {
|
|
14292
|
+
numOfKeysLimit: 50,
|
|
14293
|
+
depthOfLimit: 4
|
|
14294
|
+
};
|
|
14295
|
+
Object.assign(options, stringifyOptions);
|
|
14296
|
+
const stack = [];
|
|
14297
|
+
const keys = [];
|
|
14298
|
+
return JSON.stringify(
|
|
14299
|
+
obj,
|
|
14300
|
+
function(key, value) {
|
|
14301
|
+
if (stack.length > 0) {
|
|
14302
|
+
const thisPos = stack.indexOf(this);
|
|
14303
|
+
~thisPos ? stack.splice(thisPos + 1) : stack.push(this);
|
|
14304
|
+
~thisPos ? keys.splice(thisPos, Infinity, key) : keys.push(key);
|
|
14305
|
+
if (~stack.indexOf(value)) {
|
|
14306
|
+
if (stack[0] === value) {
|
|
14307
|
+
value = "[Circular ~]";
|
|
14308
|
+
} else {
|
|
14309
|
+
value = "[Circular ~." + keys.slice(0, stack.indexOf(value)).join(".") + "]";
|
|
14310
|
+
}
|
|
14311
|
+
}
|
|
14312
|
+
} else {
|
|
14313
|
+
stack.push(value);
|
|
14314
|
+
}
|
|
14315
|
+
if (value === null) return value;
|
|
14316
|
+
if (value === void 0) return "undefined";
|
|
14317
|
+
if (shouldIgnore(value)) {
|
|
14318
|
+
return toString(value);
|
|
14319
|
+
}
|
|
14320
|
+
if (typeof value === "bigint") {
|
|
14321
|
+
return value.toString() + "n";
|
|
14322
|
+
}
|
|
14323
|
+
if (value instanceof Event) {
|
|
14324
|
+
const eventResult = {};
|
|
14325
|
+
for (const eventKey in value) {
|
|
14326
|
+
const eventValue = value[eventKey];
|
|
14327
|
+
if (Array.isArray(eventValue)) {
|
|
14328
|
+
eventResult[eventKey] = pathToSelector(
|
|
14329
|
+
eventValue.length ? eventValue[0] : null
|
|
14330
|
+
);
|
|
14331
|
+
} else {
|
|
14332
|
+
eventResult[eventKey] = eventValue;
|
|
14333
|
+
}
|
|
14334
|
+
}
|
|
14335
|
+
return eventResult;
|
|
14336
|
+
} else if (value instanceof Node) {
|
|
14337
|
+
if (value instanceof HTMLElement) {
|
|
14338
|
+
return value ? value.outerHTML : "";
|
|
14339
|
+
}
|
|
14340
|
+
return value.nodeName;
|
|
14341
|
+
} else if (value instanceof Error) {
|
|
14342
|
+
return value.stack ? value.stack + "\nEnd of stack for Error object" : value.name + ": " + value.message;
|
|
14343
|
+
}
|
|
14344
|
+
return value;
|
|
14345
|
+
}
|
|
14346
|
+
);
|
|
14347
|
+
function shouldIgnore(_obj) {
|
|
14348
|
+
if (isObject(_obj) && Object.keys(_obj).length > options.numOfKeysLimit) {
|
|
14349
|
+
return true;
|
|
14350
|
+
}
|
|
14351
|
+
if (typeof _obj === "function") {
|
|
14352
|
+
return true;
|
|
14353
|
+
}
|
|
14354
|
+
if (isObject(_obj) && isObjTooDeep(_obj, options.depthOfLimit)) {
|
|
14355
|
+
return true;
|
|
14356
|
+
}
|
|
14357
|
+
return false;
|
|
14358
|
+
}
|
|
14359
|
+
function toString(_obj) {
|
|
14360
|
+
let str = _obj.toString();
|
|
14361
|
+
if (options.stringLengthLimit && str.length > options.stringLengthLimit) {
|
|
14362
|
+
str = `${str.slice(0, options.stringLengthLimit)}...`;
|
|
14363
|
+
}
|
|
14364
|
+
return str;
|
|
14365
|
+
}
|
|
14366
|
+
}
|
|
14367
|
+
const defaultLogOptions = {
|
|
14368
|
+
level: [
|
|
14369
|
+
"assert",
|
|
14370
|
+
"clear",
|
|
14371
|
+
"count",
|
|
14372
|
+
"countReset",
|
|
14373
|
+
"debug",
|
|
14374
|
+
"dir",
|
|
14375
|
+
"dirxml",
|
|
14376
|
+
"error",
|
|
14377
|
+
"group",
|
|
14378
|
+
"groupCollapsed",
|
|
14379
|
+
"groupEnd",
|
|
14380
|
+
"info",
|
|
14381
|
+
"log",
|
|
14382
|
+
"table",
|
|
14383
|
+
"time",
|
|
14384
|
+
"timeEnd",
|
|
14385
|
+
"timeLog",
|
|
14386
|
+
"trace",
|
|
14387
|
+
"warn"
|
|
14388
|
+
],
|
|
14389
|
+
lengthThreshold: 1e3,
|
|
14390
|
+
logger: "console"
|
|
14391
|
+
};
|
|
14392
|
+
function initLogObserver(cb, win, options) {
|
|
14393
|
+
const logOptions = options ? Object.assign({}, defaultLogOptions, options) : defaultLogOptions;
|
|
14394
|
+
const loggerType = logOptions.logger;
|
|
14395
|
+
if (!loggerType) {
|
|
14396
|
+
return () => {
|
|
14397
|
+
};
|
|
14398
|
+
}
|
|
14399
|
+
let logger;
|
|
14400
|
+
if (typeof loggerType === "string") {
|
|
14401
|
+
logger = win[loggerType];
|
|
14402
|
+
} else {
|
|
14403
|
+
logger = loggerType;
|
|
14404
|
+
}
|
|
14405
|
+
let logCount = 0;
|
|
14406
|
+
let inStack = false;
|
|
14407
|
+
const cancelHandlers = [];
|
|
14408
|
+
if (logOptions.level.includes("error")) {
|
|
14409
|
+
const errorHandler = (event) => {
|
|
14410
|
+
const message = event.message, error = event.error;
|
|
14411
|
+
const trace = ErrorStackParser.parse(error).map(
|
|
14412
|
+
(stackFrame) => stackFrame.toString()
|
|
14413
|
+
);
|
|
14414
|
+
const payload = [stringify(message, logOptions.stringifyOptions)];
|
|
14415
|
+
cb({
|
|
14416
|
+
level: "error",
|
|
14417
|
+
trace,
|
|
14418
|
+
payload
|
|
14419
|
+
});
|
|
14420
|
+
};
|
|
14421
|
+
win.addEventListener("error", errorHandler);
|
|
14422
|
+
cancelHandlers.push(() => {
|
|
14423
|
+
win.removeEventListener("error", errorHandler);
|
|
14424
|
+
});
|
|
14425
|
+
const unhandledrejectionHandler = (event) => {
|
|
14426
|
+
let error;
|
|
14427
|
+
let payload;
|
|
14428
|
+
if (event.reason instanceof Error) {
|
|
14429
|
+
error = event.reason;
|
|
14430
|
+
payload = [
|
|
14431
|
+
stringify(
|
|
14432
|
+
`Uncaught (in promise) ${error.name}: ${error.message}`,
|
|
14433
|
+
logOptions.stringifyOptions
|
|
14434
|
+
)
|
|
14435
|
+
];
|
|
14436
|
+
} else {
|
|
14437
|
+
error = new Error();
|
|
14438
|
+
payload = [
|
|
14439
|
+
stringify("Uncaught (in promise)", logOptions.stringifyOptions),
|
|
14440
|
+
stringify(event.reason, logOptions.stringifyOptions)
|
|
14441
|
+
];
|
|
14442
|
+
}
|
|
14443
|
+
const trace = ErrorStackParser.parse(error).map(
|
|
14444
|
+
(stackFrame) => stackFrame.toString()
|
|
14445
|
+
);
|
|
14446
|
+
cb({
|
|
14447
|
+
level: "error",
|
|
14448
|
+
trace,
|
|
14449
|
+
payload
|
|
14450
|
+
});
|
|
14451
|
+
};
|
|
14452
|
+
win.addEventListener("unhandledrejection", unhandledrejectionHandler);
|
|
14453
|
+
cancelHandlers.push(() => {
|
|
14454
|
+
win.removeEventListener("unhandledrejection", unhandledrejectionHandler);
|
|
14455
|
+
});
|
|
14456
|
+
}
|
|
14457
|
+
for (const levelType of logOptions.level) {
|
|
14458
|
+
cancelHandlers.push(replace(logger, levelType));
|
|
14459
|
+
}
|
|
14460
|
+
return () => {
|
|
14461
|
+
cancelHandlers.forEach((h) => h());
|
|
14462
|
+
};
|
|
14463
|
+
function replace(_logger, level) {
|
|
14464
|
+
if (!_logger[level]) {
|
|
14465
|
+
return () => {
|
|
14466
|
+
};
|
|
14467
|
+
}
|
|
14468
|
+
return utils.patch(
|
|
14469
|
+
_logger,
|
|
14470
|
+
level,
|
|
14471
|
+
(original) => {
|
|
14472
|
+
return (...args) => {
|
|
14473
|
+
original.apply(this, args);
|
|
14474
|
+
if (level === "assert" && !!args[0]) {
|
|
14475
|
+
return;
|
|
14476
|
+
}
|
|
14477
|
+
if (inStack) {
|
|
14478
|
+
return;
|
|
14479
|
+
}
|
|
14480
|
+
inStack = true;
|
|
14481
|
+
try {
|
|
14482
|
+
const trace = ErrorStackParser.parse(new Error()).map((stackFrame) => stackFrame.toString()).splice(1);
|
|
14483
|
+
const argsForPayload = level === "assert" ? args.slice(1) : args;
|
|
14484
|
+
const payload = argsForPayload.map(
|
|
14485
|
+
(s) => stringify(s, logOptions.stringifyOptions)
|
|
14486
|
+
);
|
|
14487
|
+
logCount++;
|
|
14488
|
+
if (logCount < logOptions.lengthThreshold) {
|
|
14489
|
+
cb({
|
|
14490
|
+
level,
|
|
14491
|
+
trace,
|
|
14492
|
+
payload
|
|
14493
|
+
});
|
|
14494
|
+
} else if (logCount === logOptions.lengthThreshold) {
|
|
14495
|
+
cb({
|
|
14496
|
+
level: "warn",
|
|
14497
|
+
trace: [],
|
|
14498
|
+
payload: [
|
|
14499
|
+
stringify("The number of log records reached the threshold.")
|
|
14500
|
+
]
|
|
14501
|
+
});
|
|
14502
|
+
}
|
|
14503
|
+
} catch (error) {
|
|
14504
|
+
original("rrweb logger error:", error, ...args);
|
|
14505
|
+
} finally {
|
|
14506
|
+
inStack = false;
|
|
14507
|
+
}
|
|
14508
|
+
};
|
|
14509
|
+
}
|
|
14510
|
+
);
|
|
14511
|
+
}
|
|
14512
|
+
}
|
|
14513
|
+
const PLUGIN_NAME = "rrweb/console@1";
|
|
14514
|
+
const getRecordConsolePlugin = (options) => ({
|
|
14515
|
+
name: PLUGIN_NAME,
|
|
14516
|
+
observer: initLogObserver,
|
|
14517
|
+
options
|
|
14518
|
+
});
|
|
14519
|
+
|
|
14520
|
+
var rrwebPluginConsoleRecord = /*#__PURE__*/Object.freeze({
|
|
14521
|
+
__proto__: null,
|
|
14522
|
+
PLUGIN_NAME: PLUGIN_NAME,
|
|
14523
|
+
getRecordConsolePlugin: getRecordConsolePlugin
|
|
14524
|
+
});
|
|
14525
|
+
|
|
14526
|
+
function patch(source, name, replacement) {
|
|
14527
|
+
try {
|
|
14528
|
+
if (!(name in source)) {
|
|
14529
|
+
return () => {
|
|
14530
|
+
//
|
|
14531
|
+
};
|
|
14532
|
+
}
|
|
14533
|
+
const original = source[name];
|
|
14534
|
+
const wrapped = replacement(original);
|
|
14535
|
+
if (isFunction(wrapped)) {
|
|
14536
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
14537
|
+
wrapped.prototype = wrapped.prototype || {};
|
|
14538
|
+
Object.defineProperties(wrapped, {
|
|
14539
|
+
__posthog_wrapped__: {
|
|
14540
|
+
enumerable: false,
|
|
14541
|
+
value: true
|
|
14542
|
+
}
|
|
14543
|
+
});
|
|
14544
|
+
}
|
|
14545
|
+
source[name] = wrapped;
|
|
14546
|
+
return () => {
|
|
14547
|
+
source[name] = original;
|
|
14548
|
+
};
|
|
14549
|
+
} catch {
|
|
14550
|
+
return () => {
|
|
14551
|
+
//
|
|
14552
|
+
};
|
|
14553
|
+
}
|
|
14554
|
+
}
|
|
14555
|
+
|
|
14556
|
+
function hostnameFromURL(url) {
|
|
14557
|
+
try {
|
|
14558
|
+
if (typeof url === 'string') {
|
|
14559
|
+
return new URL(url).hostname;
|
|
14560
|
+
}
|
|
14561
|
+
if ('url' in url) {
|
|
14562
|
+
return new URL(url.url).hostname;
|
|
14563
|
+
}
|
|
14564
|
+
return url.hostname;
|
|
14565
|
+
} catch {
|
|
14566
|
+
return null;
|
|
14567
|
+
}
|
|
14568
|
+
}
|
|
14569
|
+
function isHostOnDenyList(url, options) {
|
|
14570
|
+
const hostname = hostnameFromURL(url);
|
|
14571
|
+
const defaultNotDenied = {
|
|
14572
|
+
hostname,
|
|
14573
|
+
isHostDenied: false
|
|
14574
|
+
};
|
|
14575
|
+
if (!options.payloadHostDenyList?.length || !hostname?.trim().length) {
|
|
14576
|
+
return defaultNotDenied;
|
|
14577
|
+
}
|
|
14578
|
+
for (const deny of options.payloadHostDenyList) {
|
|
14579
|
+
if (hostname.endsWith(deny)) {
|
|
14580
|
+
return {
|
|
14581
|
+
hostname,
|
|
14582
|
+
isHostDenied: true
|
|
14583
|
+
};
|
|
14584
|
+
}
|
|
14585
|
+
}
|
|
14586
|
+
return defaultNotDenied;
|
|
14587
|
+
}
|
|
14588
|
+
|
|
14589
|
+
/// <reference lib="dom" />
|
|
14590
|
+
const logger = createLogger('[Recorder]');
|
|
14591
|
+
const isNavigationTiming = entry => entry.entryType === 'navigation';
|
|
14592
|
+
const isResourceTiming = entry => entry.entryType === 'resource';
|
|
14593
|
+
function findLast(array, predicate) {
|
|
14594
|
+
const length = array.length;
|
|
14595
|
+
for (let i = length - 1; i >= 0; i -= 1) {
|
|
14596
|
+
if (predicate(array[i])) {
|
|
14597
|
+
return array[i];
|
|
14598
|
+
}
|
|
14599
|
+
}
|
|
14600
|
+
return undefined;
|
|
14601
|
+
}
|
|
14602
|
+
function isDocument(value) {
|
|
14603
|
+
return !!value && typeof value === 'object' && 'nodeType' in value && value.nodeType === 9;
|
|
14604
|
+
}
|
|
14605
|
+
function initPerformanceObserver(cb, win, options) {
|
|
14606
|
+
// if we are only observing timings then we could have a single observer for all types, with buffer true,
|
|
14607
|
+
// but we are going to filter by initiatorType _if we are wrapping fetch and xhr as the wrapped functions
|
|
14608
|
+
// will deal with those.
|
|
14609
|
+
// so we have a block which captures requests from before fetch/xhr is wrapped
|
|
14610
|
+
// these are marked `isInitial` so playback can display them differently if needed
|
|
14611
|
+
// they will never have method/status/headers/body because they are pre-wrapping that provides that
|
|
14612
|
+
if (options.recordInitialRequests) {
|
|
14613
|
+
const initialPerformanceEntries = win.performance.getEntries().filter(entry => isNavigationTiming(entry) || isResourceTiming(entry) && options.initiatorTypes.includes(entry.initiatorType));
|
|
14614
|
+
cb({
|
|
14615
|
+
requests: initialPerformanceEntries.flatMap(entry => prepareRequest({
|
|
14616
|
+
entry,
|
|
14617
|
+
method: undefined,
|
|
14618
|
+
status: undefined,
|
|
14619
|
+
networkRequest: {},
|
|
14620
|
+
isInitial: true
|
|
14621
|
+
})),
|
|
14622
|
+
isInitial: true
|
|
14623
|
+
});
|
|
14624
|
+
}
|
|
14625
|
+
const observer = new win.PerformanceObserver(entries => {
|
|
14626
|
+
// if recordBody or recordHeaders is true then we don't want to record fetch or xhr here
|
|
14627
|
+
// as the wrapped functions will do that. Otherwise, this filter becomes a noop
|
|
14628
|
+
// because we do want to record them here
|
|
14629
|
+
const wrappedInitiatorFilter = entry => options.recordBody || options.recordHeaders ? entry.initiatorType !== 'xmlhttprequest' && entry.initiatorType !== 'fetch' : true;
|
|
14630
|
+
const performanceEntries = entries.getEntries().filter(entry => isNavigationTiming(entry) || isResourceTiming(entry) && options.initiatorTypes.includes(entry.initiatorType) &&
|
|
14631
|
+
// TODO if we are _only_ capturing timing we don't want to filter initiator here
|
|
14632
|
+
wrappedInitiatorFilter(entry));
|
|
14633
|
+
cb({
|
|
14634
|
+
requests: performanceEntries.flatMap(entry => prepareRequest({
|
|
14635
|
+
entry,
|
|
14636
|
+
method: undefined,
|
|
14637
|
+
status: undefined,
|
|
14638
|
+
networkRequest: {}
|
|
14639
|
+
}))
|
|
14640
|
+
});
|
|
14641
|
+
});
|
|
14642
|
+
// compat checked earlier
|
|
14643
|
+
// eslint-disable-next-line compat/compat
|
|
14644
|
+
const entryTypes = PerformanceObserver.supportedEntryTypes.filter(x => options.performanceEntryTypeToObserve.includes(x));
|
|
14645
|
+
// initial records are gathered above, so we don't need to observe and buffer each type separately
|
|
14646
|
+
observer.observe({
|
|
14647
|
+
entryTypes
|
|
14648
|
+
});
|
|
14649
|
+
return () => {
|
|
14650
|
+
observer.disconnect();
|
|
14651
|
+
};
|
|
14652
|
+
}
|
|
14653
|
+
function shouldRecordHeaders(type, recordHeaders) {
|
|
14654
|
+
return !!recordHeaders && (isBoolean(recordHeaders) || recordHeaders[type]);
|
|
14655
|
+
}
|
|
14656
|
+
function shouldRecordBody({
|
|
14657
|
+
type,
|
|
14658
|
+
recordBody,
|
|
14659
|
+
headers,
|
|
14660
|
+
url
|
|
14661
|
+
}) {
|
|
14662
|
+
function matchesContentType(contentTypes) {
|
|
14663
|
+
const contentTypeHeader = Object.keys(headers).find(key => key.toLowerCase() === 'content-type');
|
|
14664
|
+
const contentType = contentTypeHeader && headers[contentTypeHeader];
|
|
14665
|
+
return contentTypes.some(ct => contentType?.includes(ct));
|
|
14666
|
+
}
|
|
14667
|
+
/**
|
|
14668
|
+
* particularly in canvas applications we see many requests to blob URLs
|
|
14669
|
+
* e.g. blob:https://video_url
|
|
14670
|
+
* these blob/object URLs are local to the browser, we can never capture that body
|
|
14671
|
+
* so we can just return false here
|
|
14672
|
+
*/
|
|
14673
|
+
function isBlobURL(url) {
|
|
14674
|
+
try {
|
|
14675
|
+
if (typeof url === 'string') {
|
|
14676
|
+
return url.startsWith('blob:');
|
|
14677
|
+
}
|
|
14678
|
+
if (url instanceof URL) {
|
|
14679
|
+
return url.protocol === 'blob:';
|
|
14680
|
+
}
|
|
14681
|
+
if (url instanceof Request) {
|
|
14682
|
+
return isBlobURL(url.url);
|
|
14683
|
+
}
|
|
14684
|
+
return false;
|
|
14685
|
+
} catch {
|
|
14686
|
+
return false;
|
|
14687
|
+
}
|
|
14688
|
+
}
|
|
14689
|
+
if (!recordBody) return false;
|
|
14690
|
+
if (isBlobURL(url)) return false;
|
|
14691
|
+
if (isBoolean(recordBody)) return true;
|
|
14692
|
+
if (isArray(recordBody)) return matchesContentType(recordBody);
|
|
14693
|
+
const recordBodyType = recordBody[type];
|
|
14694
|
+
if (isBoolean(recordBodyType)) return recordBodyType;
|
|
14695
|
+
return matchesContentType(recordBodyType);
|
|
14696
|
+
}
|
|
14697
|
+
async function getRequestPerformanceEntry(win, initiatorType, url, start, end, attempt = 0) {
|
|
14698
|
+
if (attempt > 10) {
|
|
14699
|
+
logger.warn('Failed to get performance entry for request', {
|
|
14700
|
+
url,
|
|
14701
|
+
initiatorType
|
|
14702
|
+
});
|
|
14703
|
+
return null;
|
|
14704
|
+
}
|
|
14705
|
+
const urlPerformanceEntries = win.performance.getEntriesByName(url);
|
|
14706
|
+
const performanceEntry = findLast(urlPerformanceEntries, entry => isResourceTiming(entry) && entry.initiatorType === initiatorType && (isUndefined(start) || entry.startTime >= start) && (isUndefined(end) || entry.startTime <= end));
|
|
14707
|
+
if (!performanceEntry) {
|
|
14708
|
+
await new Promise(resolve => setTimeout(resolve, 50 * attempt));
|
|
14709
|
+
return getRequestPerformanceEntry(win, initiatorType, url, start, end, attempt + 1);
|
|
14710
|
+
}
|
|
14711
|
+
return performanceEntry;
|
|
14712
|
+
}
|
|
14713
|
+
/**
|
|
14714
|
+
* According to MDN https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/response
|
|
14715
|
+
* xhr response is typed as any but can be an ArrayBuffer, a Blob, a Document, a JavaScript object,
|
|
14716
|
+
* or a string, depending on the value of XMLHttpRequest.responseType, that contains the response entity body.
|
|
14717
|
+
*
|
|
14718
|
+
* XHR request body is Document | XMLHttpRequestBodyInit | null | undefined
|
|
14719
|
+
*/
|
|
14720
|
+
function _tryReadXHRBody({
|
|
14721
|
+
body,
|
|
14722
|
+
options,
|
|
14723
|
+
url
|
|
14724
|
+
}) {
|
|
14725
|
+
if (isNullish(body)) {
|
|
14726
|
+
return null;
|
|
14727
|
+
}
|
|
14728
|
+
const {
|
|
14729
|
+
hostname,
|
|
14730
|
+
isHostDenied
|
|
14731
|
+
} = isHostOnDenyList(url, options);
|
|
14732
|
+
if (isHostDenied) {
|
|
14733
|
+
return hostname + ' is in deny list';
|
|
14734
|
+
}
|
|
14735
|
+
if (isString(body)) {
|
|
14736
|
+
return body;
|
|
14737
|
+
}
|
|
14738
|
+
if (isDocument(body)) {
|
|
14739
|
+
return body.textContent;
|
|
14740
|
+
}
|
|
14741
|
+
if (isFormData(body)) {
|
|
14742
|
+
return formDataToQuery(body);
|
|
14743
|
+
}
|
|
14744
|
+
if (isObject$1(body)) {
|
|
14745
|
+
try {
|
|
14746
|
+
return JSON.stringify(body);
|
|
14747
|
+
} catch {
|
|
14748
|
+
return '[SessionReplay] Failed to stringify response object';
|
|
14749
|
+
}
|
|
14750
|
+
}
|
|
14751
|
+
return '[SessionReplay] Cannot read body of type ' + toString.call(body);
|
|
14752
|
+
}
|
|
14753
|
+
function initXhrObserver(cb, win, options) {
|
|
14754
|
+
if (!options.initiatorTypes.includes('xmlhttprequest')) {
|
|
14755
|
+
return () => {
|
|
14756
|
+
//
|
|
14757
|
+
};
|
|
14758
|
+
}
|
|
14759
|
+
const recordRequestHeaders = shouldRecordHeaders('request', options.recordHeaders);
|
|
14760
|
+
const recordResponseHeaders = shouldRecordHeaders('response', options.recordHeaders);
|
|
14761
|
+
const restorePatch = patch(win.XMLHttpRequest.prototype, 'open',
|
|
14762
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
14763
|
+
// @ts-ignore
|
|
14764
|
+
originalOpen => {
|
|
14765
|
+
return function (method, url, async = true, username, password) {
|
|
14766
|
+
// because this function is returned in its actual context `this` _is_ an XMLHttpRequest
|
|
14767
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
14768
|
+
// @ts-ignore
|
|
14769
|
+
const xhr = this;
|
|
14770
|
+
// check IE earlier than this, we only initialize if Request is present
|
|
14771
|
+
// eslint-disable-next-line compat/compat
|
|
14772
|
+
const req = new Request(url);
|
|
14773
|
+
const networkRequest = {};
|
|
14774
|
+
let start;
|
|
14775
|
+
let end;
|
|
14776
|
+
const requestHeaders = {};
|
|
14777
|
+
const originalSetRequestHeader = xhr.setRequestHeader.bind(xhr);
|
|
14778
|
+
xhr.setRequestHeader = (header, value) => {
|
|
14779
|
+
requestHeaders[header] = value;
|
|
14780
|
+
return originalSetRequestHeader(header, value);
|
|
14781
|
+
};
|
|
14782
|
+
if (recordRequestHeaders) {
|
|
14783
|
+
networkRequest.requestHeaders = requestHeaders;
|
|
14784
|
+
}
|
|
14785
|
+
const originalSend = xhr.send.bind(xhr);
|
|
14786
|
+
xhr.send = body => {
|
|
14787
|
+
if (shouldRecordBody({
|
|
14788
|
+
type: 'request',
|
|
14789
|
+
headers: requestHeaders,
|
|
14790
|
+
url,
|
|
14791
|
+
recordBody: options.recordBody
|
|
14792
|
+
})) {
|
|
14793
|
+
networkRequest.requestBody = _tryReadXHRBody({
|
|
14794
|
+
body,
|
|
14795
|
+
options,
|
|
14796
|
+
url
|
|
14797
|
+
});
|
|
14798
|
+
}
|
|
14799
|
+
start = win.performance.now();
|
|
14800
|
+
return originalSend(body);
|
|
14801
|
+
};
|
|
14802
|
+
const readyStateListener = () => {
|
|
14803
|
+
if (xhr.readyState !== xhr.DONE) {
|
|
14804
|
+
return;
|
|
14805
|
+
}
|
|
14806
|
+
// Clean up the listener immediately when done to prevent memory leaks
|
|
14807
|
+
xhr.removeEventListener('readystatechange', readyStateListener);
|
|
14808
|
+
end = win.performance.now();
|
|
14809
|
+
const responseHeaders = {};
|
|
14810
|
+
const rawHeaders = xhr.getAllResponseHeaders();
|
|
14811
|
+
const headers = rawHeaders.trim().split(/[\r\n]+/);
|
|
14812
|
+
headers.forEach(line => {
|
|
14813
|
+
const parts = line.split(': ');
|
|
14814
|
+
const header = parts.shift();
|
|
14815
|
+
const value = parts.join(': ');
|
|
14816
|
+
if (header) {
|
|
14817
|
+
responseHeaders[header] = value;
|
|
14818
|
+
}
|
|
14819
|
+
});
|
|
14820
|
+
if (recordResponseHeaders) {
|
|
14821
|
+
networkRequest.responseHeaders = responseHeaders;
|
|
14822
|
+
}
|
|
14823
|
+
if (shouldRecordBody({
|
|
14824
|
+
type: 'response',
|
|
14825
|
+
headers: responseHeaders,
|
|
14826
|
+
url,
|
|
14827
|
+
recordBody: options.recordBody
|
|
14828
|
+
})) {
|
|
14829
|
+
networkRequest.responseBody = _tryReadXHRBody({
|
|
14830
|
+
body: xhr.response,
|
|
14831
|
+
options,
|
|
14832
|
+
url
|
|
14833
|
+
});
|
|
14834
|
+
}
|
|
14835
|
+
getRequestPerformanceEntry(win, 'xmlhttprequest', req.url, start, end).then(entry => {
|
|
14836
|
+
const requests = prepareRequest({
|
|
14837
|
+
entry,
|
|
14838
|
+
method: method,
|
|
14839
|
+
status: xhr?.status,
|
|
14840
|
+
networkRequest,
|
|
14841
|
+
start,
|
|
14842
|
+
end,
|
|
14843
|
+
url: url.toString(),
|
|
14844
|
+
initiatorType: 'xmlhttprequest'
|
|
14845
|
+
});
|
|
14846
|
+
cb({
|
|
14847
|
+
requests
|
|
14848
|
+
});
|
|
14849
|
+
}).catch(() => {
|
|
14850
|
+
//
|
|
14851
|
+
});
|
|
14852
|
+
};
|
|
14853
|
+
// This is very tricky code, and making it passive won't bring many performance benefits,
|
|
14854
|
+
// so let's ignore the rule here.
|
|
14855
|
+
// eslint-disable-next-line posthog-js/no-add-event-listener
|
|
14856
|
+
xhr.addEventListener('readystatechange', readyStateListener);
|
|
14857
|
+
originalOpen.call(xhr, method, url, async, username, password);
|
|
14858
|
+
};
|
|
14859
|
+
});
|
|
14860
|
+
return () => {
|
|
14861
|
+
restorePatch();
|
|
14862
|
+
};
|
|
14863
|
+
}
|
|
14864
|
+
/**
|
|
14865
|
+
* Check if this PerformanceEntry is either a PerformanceResourceTiming or a PerformanceNavigationTiming
|
|
14866
|
+
* NB PerformanceNavigationTiming extends PerformanceResourceTiming
|
|
14867
|
+
* Here we don't care which interface it implements as both expose `serverTimings`
|
|
14868
|
+
*/
|
|
14869
|
+
const exposesServerTiming = event => !isNull(event) && (event.entryType === 'navigation' || event.entryType === 'resource');
|
|
14870
|
+
function prepareRequest({
|
|
14871
|
+
entry,
|
|
14872
|
+
method,
|
|
14873
|
+
status,
|
|
14874
|
+
networkRequest,
|
|
14875
|
+
isInitial,
|
|
14876
|
+
start,
|
|
14877
|
+
end,
|
|
14878
|
+
url,
|
|
14879
|
+
initiatorType
|
|
14880
|
+
}) {
|
|
14881
|
+
start = entry ? entry.startTime : start;
|
|
14882
|
+
end = entry ? entry.responseEnd : end;
|
|
14883
|
+
// kudos to sentry javascript sdk for excellent background on why to use Date.now() here
|
|
14884
|
+
// https://github.com/getsentry/sentry-javascript/blob/e856e40b6e71a73252e788cd42b5260f81c9c88e/packages/utils/src/time.ts#L70
|
|
14885
|
+
// can't start observer if performance.now() is not available
|
|
14886
|
+
// eslint-disable-next-line compat/compat
|
|
14887
|
+
const timeOrigin = Math.floor(Date.now() - performance.now());
|
|
14888
|
+
// clickhouse can't ingest timestamps that are floats
|
|
14889
|
+
// (in this case representing fractions of a millisecond we don't care about anyway)
|
|
14890
|
+
// use timeOrigin if we really can't gather a start time
|
|
14891
|
+
const timestamp = Math.floor(timeOrigin + (start || 0));
|
|
14892
|
+
const entryJSON = entry ? entry.toJSON() : {
|
|
14893
|
+
name: url
|
|
14894
|
+
};
|
|
14895
|
+
const requests = [{
|
|
14896
|
+
...entryJSON,
|
|
14897
|
+
startTime: isUndefined(start) ? undefined : Math.round(start),
|
|
14898
|
+
endTime: isUndefined(end) ? undefined : Math.round(end),
|
|
14899
|
+
timeOrigin,
|
|
14900
|
+
timestamp,
|
|
14901
|
+
method: method,
|
|
14902
|
+
initiatorType: initiatorType ? initiatorType : entry ? entry.initiatorType : undefined,
|
|
14903
|
+
status,
|
|
14904
|
+
requestHeaders: networkRequest.requestHeaders,
|
|
14905
|
+
requestBody: networkRequest.requestBody,
|
|
14906
|
+
responseHeaders: networkRequest.responseHeaders,
|
|
14907
|
+
responseBody: networkRequest.responseBody,
|
|
14908
|
+
isInitial
|
|
14909
|
+
}];
|
|
14910
|
+
if (exposesServerTiming(entry)) {
|
|
14911
|
+
for (const timing of entry.serverTiming || []) {
|
|
14912
|
+
requests.push({
|
|
14913
|
+
timeOrigin,
|
|
14914
|
+
timestamp,
|
|
14915
|
+
startTime: Math.round(entry.startTime),
|
|
14916
|
+
name: timing.name,
|
|
14917
|
+
duration: timing.duration,
|
|
14918
|
+
// the spec has a closed list of possible types
|
|
14919
|
+
// https://developer.mozilla.org/en-US/docs/Web/API/PerformanceEntry/entryType
|
|
14920
|
+
// but, we need to know this was a server timing so that we know to
|
|
14921
|
+
// match it to the appropriate navigation or resource timing
|
|
14922
|
+
// that matching will have to be on timestamp and $current_url
|
|
14923
|
+
entryType: 'serverTiming'
|
|
14924
|
+
});
|
|
14925
|
+
}
|
|
14926
|
+
}
|
|
14927
|
+
return requests;
|
|
14928
|
+
}
|
|
14929
|
+
const contentTypePrefixDenyList = ['video/', 'audio/'];
|
|
14930
|
+
function _checkForCannotReadResponseBody({
|
|
14931
|
+
r,
|
|
14932
|
+
options,
|
|
14933
|
+
url
|
|
14934
|
+
}) {
|
|
14935
|
+
if (r.headers.get('Transfer-Encoding') === 'chunked') {
|
|
14936
|
+
return 'Chunked Transfer-Encoding is not supported';
|
|
14937
|
+
}
|
|
14938
|
+
// `get` and `has` are case-insensitive
|
|
14939
|
+
// but return the header value with the casing that was supplied
|
|
14940
|
+
const contentType = r.headers.get('Content-Type')?.toLowerCase();
|
|
14941
|
+
const contentTypeIsDenied = contentTypePrefixDenyList.some(prefix => contentType?.startsWith(prefix));
|
|
14942
|
+
if (contentType && contentTypeIsDenied) {
|
|
14943
|
+
return `Content-Type ${contentType} is not supported`;
|
|
14944
|
+
}
|
|
14945
|
+
const {
|
|
14946
|
+
hostname,
|
|
14947
|
+
isHostDenied
|
|
14948
|
+
} = isHostOnDenyList(url, options);
|
|
14949
|
+
if (isHostDenied) {
|
|
14950
|
+
return hostname + ' is in deny list';
|
|
14951
|
+
}
|
|
14952
|
+
return null;
|
|
14953
|
+
}
|
|
14954
|
+
function _tryReadBody(r) {
|
|
14955
|
+
// there are now already multiple places where we're using Promise...
|
|
14956
|
+
// eslint-disable-next-line compat/compat
|
|
14957
|
+
return new Promise((resolve, reject) => {
|
|
14958
|
+
const timeout = setTimeout(() => resolve('[SessionReplay] Timeout while trying to read body'), 500);
|
|
14959
|
+
try {
|
|
14960
|
+
r.clone().text().then(txt => resolve(txt), reason => reject(reason)).finally(() => clearTimeout(timeout));
|
|
14961
|
+
} catch {
|
|
14962
|
+
clearTimeout(timeout);
|
|
14963
|
+
resolve('[SessionReplay] Failed to read body');
|
|
14964
|
+
}
|
|
14965
|
+
});
|
|
14966
|
+
}
|
|
14967
|
+
async function _tryReadRequestBody({
|
|
14968
|
+
r,
|
|
14969
|
+
options,
|
|
14970
|
+
url
|
|
14971
|
+
}) {
|
|
14972
|
+
const {
|
|
14973
|
+
hostname,
|
|
14974
|
+
isHostDenied
|
|
14975
|
+
} = isHostOnDenyList(url, options);
|
|
14976
|
+
if (isHostDenied) {
|
|
14977
|
+
return Promise.resolve(hostname + ' is in deny list');
|
|
14978
|
+
}
|
|
14979
|
+
return _tryReadBody(r);
|
|
14980
|
+
}
|
|
14981
|
+
async function _tryReadResponseBody({
|
|
14982
|
+
r,
|
|
14983
|
+
options,
|
|
14984
|
+
url
|
|
14985
|
+
}) {
|
|
14986
|
+
const cannotReadBodyReason = _checkForCannotReadResponseBody({
|
|
14987
|
+
r,
|
|
14988
|
+
options,
|
|
14989
|
+
url
|
|
14990
|
+
});
|
|
14991
|
+
if (!isNull(cannotReadBodyReason)) {
|
|
14992
|
+
return Promise.resolve(cannotReadBodyReason);
|
|
14993
|
+
}
|
|
14994
|
+
return _tryReadBody(r);
|
|
14995
|
+
}
|
|
14996
|
+
function initFetchObserver(cb, win, options) {
|
|
14997
|
+
if (!options.initiatorTypes.includes('fetch')) {
|
|
14998
|
+
return () => {
|
|
14999
|
+
//
|
|
15000
|
+
};
|
|
15001
|
+
}
|
|
15002
|
+
const recordRequestHeaders = shouldRecordHeaders('request', options.recordHeaders);
|
|
15003
|
+
const recordResponseHeaders = shouldRecordHeaders('response', options.recordHeaders);
|
|
15004
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
15005
|
+
// @ts-ignore
|
|
15006
|
+
const restorePatch = patch(win, 'fetch', originalFetch => {
|
|
15007
|
+
return async function (url, init) {
|
|
15008
|
+
// check IE earlier than this, we only initialize if Request is present
|
|
15009
|
+
// eslint-disable-next-line compat/compat
|
|
15010
|
+
const req = new Request(url, init);
|
|
15011
|
+
let res;
|
|
15012
|
+
const networkRequest = {};
|
|
15013
|
+
let start;
|
|
15014
|
+
let end;
|
|
15015
|
+
try {
|
|
15016
|
+
const requestHeaders = {};
|
|
15017
|
+
req.headers.forEach((value, header) => {
|
|
15018
|
+
requestHeaders[header] = value;
|
|
15019
|
+
});
|
|
15020
|
+
if (recordRequestHeaders) {
|
|
15021
|
+
networkRequest.requestHeaders = requestHeaders;
|
|
15022
|
+
}
|
|
15023
|
+
if (shouldRecordBody({
|
|
15024
|
+
type: 'request',
|
|
15025
|
+
headers: requestHeaders,
|
|
15026
|
+
url,
|
|
15027
|
+
recordBody: options.recordBody
|
|
15028
|
+
})) {
|
|
15029
|
+
networkRequest.requestBody = await _tryReadRequestBody({
|
|
15030
|
+
r: req,
|
|
15031
|
+
options,
|
|
15032
|
+
url
|
|
15033
|
+
});
|
|
15034
|
+
}
|
|
15035
|
+
start = win.performance.now();
|
|
15036
|
+
res = await originalFetch(req);
|
|
15037
|
+
end = win.performance.now();
|
|
15038
|
+
const responseHeaders = {};
|
|
15039
|
+
res.headers.forEach((value, header) => {
|
|
15040
|
+
responseHeaders[header] = value;
|
|
15041
|
+
});
|
|
15042
|
+
if (recordResponseHeaders) {
|
|
15043
|
+
networkRequest.responseHeaders = responseHeaders;
|
|
15044
|
+
}
|
|
15045
|
+
if (shouldRecordBody({
|
|
15046
|
+
type: 'response',
|
|
15047
|
+
headers: responseHeaders,
|
|
15048
|
+
url,
|
|
15049
|
+
recordBody: options.recordBody
|
|
15050
|
+
})) {
|
|
15051
|
+
networkRequest.responseBody = await _tryReadResponseBody({
|
|
15052
|
+
r: res,
|
|
15053
|
+
options,
|
|
15054
|
+
url
|
|
15055
|
+
});
|
|
15056
|
+
}
|
|
15057
|
+
return res;
|
|
15058
|
+
} finally {
|
|
15059
|
+
getRequestPerformanceEntry(win, 'fetch', req.url, start, end).then(entry => {
|
|
15060
|
+
const requests = prepareRequest({
|
|
15061
|
+
entry,
|
|
15062
|
+
method: req.method,
|
|
15063
|
+
status: res?.status,
|
|
15064
|
+
networkRequest,
|
|
15065
|
+
start,
|
|
15066
|
+
end,
|
|
15067
|
+
url: req.url,
|
|
15068
|
+
initiatorType: 'fetch'
|
|
15069
|
+
});
|
|
15070
|
+
cb({
|
|
15071
|
+
requests
|
|
15072
|
+
});
|
|
15073
|
+
}).catch(() => {
|
|
15074
|
+
//
|
|
15075
|
+
});
|
|
15076
|
+
}
|
|
15077
|
+
};
|
|
15078
|
+
});
|
|
15079
|
+
return () => {
|
|
15080
|
+
restorePatch();
|
|
15081
|
+
};
|
|
15082
|
+
}
|
|
15083
|
+
let initialisedHandler = null;
|
|
15084
|
+
function initNetworkObserver(callback, win,
|
|
15085
|
+
// top window or in an iframe
|
|
15086
|
+
options) {
|
|
15087
|
+
if (!('performance' in win)) {
|
|
15088
|
+
return () => {
|
|
15089
|
+
//
|
|
15090
|
+
};
|
|
15091
|
+
}
|
|
15092
|
+
if (initialisedHandler) {
|
|
15093
|
+
logger.warn('Network observer already initialised, doing nothing');
|
|
15094
|
+
return () => {
|
|
15095
|
+
// the first caller should already have this handler and will be responsible for teardown
|
|
15096
|
+
};
|
|
15097
|
+
}
|
|
15098
|
+
const networkOptions = options ? Object.assign({}, defaultNetworkOptions, options) : defaultNetworkOptions;
|
|
15099
|
+
const cb = data => {
|
|
15100
|
+
const requests = [];
|
|
15101
|
+
data.requests.forEach(request => {
|
|
15102
|
+
const maskedRequest = networkOptions.maskRequestFn(request);
|
|
15103
|
+
if (maskedRequest) {
|
|
15104
|
+
requests.push(maskedRequest);
|
|
15105
|
+
}
|
|
15106
|
+
});
|
|
15107
|
+
if (requests.length > 0) {
|
|
15108
|
+
callback({
|
|
15109
|
+
...data,
|
|
15110
|
+
requests
|
|
15111
|
+
});
|
|
15112
|
+
}
|
|
15113
|
+
};
|
|
15114
|
+
const performanceObserver = initPerformanceObserver(cb, win, networkOptions);
|
|
15115
|
+
// only wrap fetch and xhr if headers or body are being recorded
|
|
15116
|
+
let xhrObserver = () => {};
|
|
15117
|
+
let fetchObserver = () => {};
|
|
15118
|
+
if (networkOptions.recordHeaders || networkOptions.recordBody) {
|
|
15119
|
+
xhrObserver = initXhrObserver(cb, win, networkOptions);
|
|
15120
|
+
fetchObserver = initFetchObserver(cb, win, networkOptions);
|
|
15121
|
+
}
|
|
15122
|
+
const teardown = () => {
|
|
15123
|
+
performanceObserver();
|
|
15124
|
+
xhrObserver();
|
|
15125
|
+
fetchObserver();
|
|
15126
|
+
// allow future observers to initialize after cleanup
|
|
15127
|
+
initialisedHandler = null;
|
|
15128
|
+
};
|
|
15129
|
+
initialisedHandler = teardown;
|
|
15130
|
+
return teardown;
|
|
15131
|
+
}
|
|
15132
|
+
// use the plugin name so that when this functionality is adopted into rrweb
|
|
15133
|
+
// we can remove this plugin and use the core functionality with the same data
|
|
15134
|
+
const NETWORK_PLUGIN_NAME = 'rrweb/network@1';
|
|
15135
|
+
// TODO how should this be typed?
|
|
15136
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
15137
|
+
// @ts-ignore
|
|
15138
|
+
const getRecordNetworkPlugin = options => {
|
|
15139
|
+
return {
|
|
15140
|
+
name: NETWORK_PLUGIN_NAME,
|
|
15141
|
+
observer: initNetworkObserver,
|
|
15142
|
+
options: options
|
|
15143
|
+
};
|
|
15144
|
+
};
|
|
15145
|
+
// rrweb/networ@1 ends
|
|
15146
|
+
|
|
15147
|
+
var networkPlugin = /*#__PURE__*/Object.freeze({
|
|
15148
|
+
__proto__: null,
|
|
15149
|
+
NETWORK_PLUGIN_NAME: NETWORK_PLUGIN_NAME,
|
|
15150
|
+
findLast: findLast,
|
|
15151
|
+
getRecordNetworkPlugin: getRecordNetworkPlugin,
|
|
15152
|
+
shouldRecordBody: shouldRecordBody
|
|
15153
|
+
});
|
|
15154
|
+
|
|
13136
15155
|
return api;
|
|
13137
15156
|
|
|
13138
15157
|
})();
|