@microsoft/applicationinsights-debugplugin-js 2.8.4-nightly.2205-08 → 2.8.4
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/browser/{ai.dbg.2.8.4-nightly.2205-08.cjs.js → ai.dbg.2.8.4.cjs.js} +482 -482
- package/browser/ai.dbg.2.8.4.cjs.js.map +1 -0
- package/browser/ai.dbg.2.8.4.cjs.min.js +6 -0
- package/browser/ai.dbg.2.8.4.cjs.min.js.map +1 -0
- package/browser/{ai.dbg.2.8.4-nightly.2205-08.gbl.js → ai.dbg.2.8.4.gbl.js} +482 -482
- package/browser/ai.dbg.2.8.4.gbl.js.map +1 -0
- package/browser/ai.dbg.2.8.4.gbl.min.js +6 -0
- package/browser/ai.dbg.2.8.4.gbl.min.js.map +1 -0
- package/browser/ai.dbg.2.8.4.integrity.json +66 -0
- package/browser/{ai.dbg.2.8.4-nightly.2205-08.js → ai.dbg.2.8.4.js} +482 -482
- package/browser/ai.dbg.2.8.4.js.map +1 -0
- package/browser/ai.dbg.2.8.4.min.js +6 -0
- package/browser/ai.dbg.2.8.4.min.js.map +1 -0
- package/browser/ai.dbg.2.cjs.js +481 -481
- package/browser/ai.dbg.2.cjs.js.map +1 -1
- package/browser/ai.dbg.2.cjs.min.js +2 -2
- package/browser/ai.dbg.2.cjs.min.js.map +1 -1
- package/browser/ai.dbg.2.gbl.js +481 -481
- package/browser/ai.dbg.2.gbl.js.map +1 -1
- package/browser/ai.dbg.2.gbl.min.js +2 -2
- package/browser/ai.dbg.2.gbl.min.js.map +1 -1
- package/browser/ai.dbg.2.js +481 -481
- package/browser/ai.dbg.2.js.map +1 -1
- package/browser/ai.dbg.2.min.js +2 -2
- package/browser/ai.dbg.2.min.js.map +1 -1
- package/dist/applicationinsights-debugplugin-js.api.json +1 -1
- package/dist/applicationinsights-debugplugin-js.d.ts +1 -1
- package/dist/applicationinsights-debugplugin-js.js +481 -481
- package/dist/applicationinsights-debugplugin-js.js.map +1 -1
- package/dist/applicationinsights-debugplugin-js.min.js +2 -2
- package/dist/applicationinsights-debugplugin-js.min.js.map +1 -1
- package/dist/applicationinsights-debugplugin-js.rollup.d.ts +1 -1
- package/dist-esm/DebugPlugin.js +1 -1
- package/dist-esm/applicationinsights-debugplugin-js.js +1 -1
- package/dist-esm/components/Dashboard.js +1 -1
- package/dist-esm/components/LogEntry.js +1 -1
- package/dist-esm/components/debugBins.js +1 -1
- package/dist-esm/components/filterList.js +1 -1
- package/dist-esm/components/helpers.js +1 -1
- package/dist-esm/components/styleNodeSrc.js +1 -1
- package/dist-esm/interfaces/IDebugPluginConfig.js +1 -1
- package/package.json +54 -57
- package/types/tsdoc-metadata.json +1 -1
- package/browser/ai.dbg.2.8.4-nightly.2205-08.cjs.js.map +0 -1
- package/browser/ai.dbg.2.8.4-nightly.2205-08.cjs.min.js +0 -6
- package/browser/ai.dbg.2.8.4-nightly.2205-08.cjs.min.js.map +0 -1
- package/browser/ai.dbg.2.8.4-nightly.2205-08.gbl.js.map +0 -1
- package/browser/ai.dbg.2.8.4-nightly.2205-08.gbl.min.js +0 -6
- package/browser/ai.dbg.2.8.4-nightly.2205-08.gbl.min.js.map +0 -1
- package/browser/ai.dbg.2.8.4-nightly.2205-08.integrity.json +0 -66
- package/browser/ai.dbg.2.8.4-nightly.2205-08.js.map +0 -1
- package/browser/ai.dbg.2.8.4-nightly.2205-08.min.js +0 -6
- package/browser/ai.dbg.2.8.4-nightly.2205-08.min.js.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Application Insights JavaScript SDK - Debug Plugin, 2.8.4
|
|
2
|
+
* Application Insights JavaScript SDK - Debug Plugin, 2.8.4
|
|
3
3
|
* Copyright (c) Microsoft and contributors. All rights reserved.
|
|
4
4
|
*/
|
|
5
5
|
'use strict';
|
|
@@ -1275,7 +1275,7 @@ function newId(maxLength) {
|
|
|
1275
1275
|
}
|
|
1276
1276
|
|
|
1277
1277
|
var _objDefineProperty = ObjDefineProperty;
|
|
1278
|
-
var version = "2.8.4
|
|
1278
|
+
var version = "2.8.4";
|
|
1279
1279
|
var instanceName = "." + newId(6);
|
|
1280
1280
|
var _dataUid = 0;
|
|
1281
1281
|
function _createAccessor(target, prop, value) {
|
|
@@ -1346,6 +1346,458 @@ function createElmNodeData(name) {
|
|
|
1346
1346
|
return data;
|
|
1347
1347
|
}
|
|
1348
1348
|
|
|
1349
|
+
var strToGMTString = "toGMTString";
|
|
1350
|
+
var strToUTCString = "toUTCString";
|
|
1351
|
+
var strCookie = "cookie";
|
|
1352
|
+
var strExpires = "expires";
|
|
1353
|
+
var strEnabled = "enabled";
|
|
1354
|
+
var strIsCookieUseDisabled = "isCookieUseDisabled";
|
|
1355
|
+
var strDisableCookiesUsage = "disableCookiesUsage";
|
|
1356
|
+
var strConfigCookieMgr = "_ckMgr";
|
|
1357
|
+
var _supportsCookies = null;
|
|
1358
|
+
var _allowUaSameSite = null;
|
|
1359
|
+
var _parsedCookieValue = null;
|
|
1360
|
+
var _doc = getDocument();
|
|
1361
|
+
var _cookieCache = {};
|
|
1362
|
+
var _globalCookieConfig = {};
|
|
1363
|
+
function _gblCookieMgr(config, logger) {
|
|
1364
|
+
var inst = createCookieMgr[strConfigCookieMgr] || _globalCookieConfig[strConfigCookieMgr];
|
|
1365
|
+
if (!inst) {
|
|
1366
|
+
inst = createCookieMgr[strConfigCookieMgr] = createCookieMgr(config, logger);
|
|
1367
|
+
_globalCookieConfig[strConfigCookieMgr] = inst;
|
|
1368
|
+
}
|
|
1369
|
+
return inst;
|
|
1370
|
+
}
|
|
1371
|
+
function _isMgrEnabled(cookieMgr) {
|
|
1372
|
+
if (cookieMgr) {
|
|
1373
|
+
return cookieMgr.isEnabled();
|
|
1374
|
+
}
|
|
1375
|
+
return true;
|
|
1376
|
+
}
|
|
1377
|
+
function _createCookieMgrConfig(rootConfig) {
|
|
1378
|
+
var cookieMgrCfg = rootConfig.cookieCfg = rootConfig.cookieCfg || {};
|
|
1379
|
+
setValue(cookieMgrCfg, "domain", rootConfig.cookieDomain, isNotNullOrUndefined, isNullOrUndefined);
|
|
1380
|
+
setValue(cookieMgrCfg, "path", rootConfig.cookiePath || "/", null, isNullOrUndefined);
|
|
1381
|
+
if (isNullOrUndefined(cookieMgrCfg[strEnabled])) {
|
|
1382
|
+
var cookieEnabled = void 0;
|
|
1383
|
+
if (!isUndefined(rootConfig[strIsCookieUseDisabled])) {
|
|
1384
|
+
cookieEnabled = !rootConfig[strIsCookieUseDisabled];
|
|
1385
|
+
}
|
|
1386
|
+
if (!isUndefined(rootConfig[strDisableCookiesUsage])) {
|
|
1387
|
+
cookieEnabled = !rootConfig[strDisableCookiesUsage];
|
|
1388
|
+
}
|
|
1389
|
+
cookieMgrCfg[strEnabled] = cookieEnabled;
|
|
1390
|
+
}
|
|
1391
|
+
return cookieMgrCfg;
|
|
1392
|
+
}
|
|
1393
|
+
function createCookieMgr(rootConfig, logger) {
|
|
1394
|
+
var cookieMgrConfig = _createCookieMgrConfig(rootConfig || _globalCookieConfig);
|
|
1395
|
+
var _path = cookieMgrConfig.path || "/";
|
|
1396
|
+
var _domain = cookieMgrConfig.domain;
|
|
1397
|
+
var _enabled = cookieMgrConfig[strEnabled] !== false;
|
|
1398
|
+
var cookieMgr = {
|
|
1399
|
+
isEnabled: function () {
|
|
1400
|
+
var enabled = _enabled && areCookiesSupported(logger);
|
|
1401
|
+
var gblManager = _globalCookieConfig[strConfigCookieMgr];
|
|
1402
|
+
if (enabled && gblManager && cookieMgr !== gblManager) {
|
|
1403
|
+
enabled = _isMgrEnabled(gblManager);
|
|
1404
|
+
}
|
|
1405
|
+
return enabled;
|
|
1406
|
+
},
|
|
1407
|
+
setEnabled: function (value) {
|
|
1408
|
+
_enabled = value !== false;
|
|
1409
|
+
},
|
|
1410
|
+
set: function (name, value, maxAgeSec, domain, path) {
|
|
1411
|
+
var result = false;
|
|
1412
|
+
if (_isMgrEnabled(cookieMgr)) {
|
|
1413
|
+
var values = {};
|
|
1414
|
+
var theValue = strTrim(value || strEmpty$1);
|
|
1415
|
+
var idx = theValue.indexOf(";");
|
|
1416
|
+
if (idx !== -1) {
|
|
1417
|
+
theValue = strTrim(value.substring(0, idx));
|
|
1418
|
+
values = _extractParts(value.substring(idx + 1));
|
|
1419
|
+
}
|
|
1420
|
+
setValue(values, "domain", domain || _domain, isTruthy, isUndefined);
|
|
1421
|
+
if (!isNullOrUndefined(maxAgeSec)) {
|
|
1422
|
+
var _isIE = isIE();
|
|
1423
|
+
if (isUndefined(values[strExpires])) {
|
|
1424
|
+
var nowMs = dateNow();
|
|
1425
|
+
var expireMs = nowMs + (maxAgeSec * 1000);
|
|
1426
|
+
if (expireMs > 0) {
|
|
1427
|
+
var expiry = new Date();
|
|
1428
|
+
expiry.setTime(expireMs);
|
|
1429
|
+
setValue(values, strExpires, _formatDate(expiry, !_isIE ? strToUTCString : strToGMTString) || _formatDate(expiry, _isIE ? strToGMTString : strToUTCString) || strEmpty$1, isTruthy);
|
|
1430
|
+
}
|
|
1431
|
+
}
|
|
1432
|
+
if (!_isIE) {
|
|
1433
|
+
setValue(values, "max-age", strEmpty$1 + maxAgeSec, null, isUndefined);
|
|
1434
|
+
}
|
|
1435
|
+
}
|
|
1436
|
+
var location_1 = getLocation();
|
|
1437
|
+
if (location_1 && location_1.protocol === "https:") {
|
|
1438
|
+
setValue(values, "secure", null, null, isUndefined);
|
|
1439
|
+
if (_allowUaSameSite === null) {
|
|
1440
|
+
_allowUaSameSite = !uaDisallowsSameSiteNone((getNavigator() || {}).userAgent);
|
|
1441
|
+
}
|
|
1442
|
+
if (_allowUaSameSite) {
|
|
1443
|
+
setValue(values, "SameSite", "None", null, isUndefined);
|
|
1444
|
+
}
|
|
1445
|
+
}
|
|
1446
|
+
setValue(values, "path", path || _path, null, isUndefined);
|
|
1447
|
+
var setCookieFn = cookieMgrConfig.setCookie || _setCookieValue;
|
|
1448
|
+
setCookieFn(name, _formatCookieValue(theValue, values));
|
|
1449
|
+
result = true;
|
|
1450
|
+
}
|
|
1451
|
+
return result;
|
|
1452
|
+
},
|
|
1453
|
+
get: function (name) {
|
|
1454
|
+
var value = strEmpty$1;
|
|
1455
|
+
if (_isMgrEnabled(cookieMgr)) {
|
|
1456
|
+
value = (cookieMgrConfig.getCookie || _getCookieValue)(name);
|
|
1457
|
+
}
|
|
1458
|
+
return value;
|
|
1459
|
+
},
|
|
1460
|
+
del: function (name, path) {
|
|
1461
|
+
var result = false;
|
|
1462
|
+
if (_isMgrEnabled(cookieMgr)) {
|
|
1463
|
+
result = cookieMgr.purge(name, path);
|
|
1464
|
+
}
|
|
1465
|
+
return result;
|
|
1466
|
+
},
|
|
1467
|
+
purge: function (name, path) {
|
|
1468
|
+
var _a;
|
|
1469
|
+
var result = false;
|
|
1470
|
+
if (areCookiesSupported(logger)) {
|
|
1471
|
+
var values = (_a = {},
|
|
1472
|
+
_a["path"] = path ? path : "/",
|
|
1473
|
+
_a[strExpires] = "Thu, 01 Jan 1970 00:00:01 GMT",
|
|
1474
|
+
_a);
|
|
1475
|
+
if (!isIE()) {
|
|
1476
|
+
values["max-age"] = "0";
|
|
1477
|
+
}
|
|
1478
|
+
var delCookie = cookieMgrConfig.delCookie || _setCookieValue;
|
|
1479
|
+
delCookie(name, _formatCookieValue(strEmpty$1, values));
|
|
1480
|
+
result = true;
|
|
1481
|
+
}
|
|
1482
|
+
return result;
|
|
1483
|
+
}
|
|
1484
|
+
};
|
|
1485
|
+
cookieMgr[strConfigCookieMgr] = cookieMgr;
|
|
1486
|
+
return cookieMgr;
|
|
1487
|
+
}
|
|
1488
|
+
function areCookiesSupported(logger) {
|
|
1489
|
+
if (_supportsCookies === null) {
|
|
1490
|
+
_supportsCookies = false;
|
|
1491
|
+
try {
|
|
1492
|
+
var doc = _doc || {};
|
|
1493
|
+
_supportsCookies = doc[strCookie] !== undefined;
|
|
1494
|
+
}
|
|
1495
|
+
catch (e) {
|
|
1496
|
+
_throwInternal(logger, 2 , 68 , "Cannot access document.cookie - " + getExceptionName(e), { exception: dumpObj(e) });
|
|
1497
|
+
}
|
|
1498
|
+
}
|
|
1499
|
+
return _supportsCookies;
|
|
1500
|
+
}
|
|
1501
|
+
function _extractParts(theValue) {
|
|
1502
|
+
var values = {};
|
|
1503
|
+
if (theValue && theValue.length) {
|
|
1504
|
+
var parts = strTrim(theValue).split(";");
|
|
1505
|
+
arrForEach(parts, function (thePart) {
|
|
1506
|
+
thePart = strTrim(thePart || strEmpty$1);
|
|
1507
|
+
if (thePart) {
|
|
1508
|
+
var idx = thePart.indexOf("=");
|
|
1509
|
+
if (idx === -1) {
|
|
1510
|
+
values[thePart] = null;
|
|
1511
|
+
}
|
|
1512
|
+
else {
|
|
1513
|
+
values[strTrim(thePart.substring(0, idx))] = strTrim(thePart.substring(idx + 1));
|
|
1514
|
+
}
|
|
1515
|
+
}
|
|
1516
|
+
});
|
|
1517
|
+
}
|
|
1518
|
+
return values;
|
|
1519
|
+
}
|
|
1520
|
+
function _formatDate(theDate, func) {
|
|
1521
|
+
if (isFunction(theDate[func])) {
|
|
1522
|
+
return theDate[func]();
|
|
1523
|
+
}
|
|
1524
|
+
return null;
|
|
1525
|
+
}
|
|
1526
|
+
function _formatCookieValue(value, values) {
|
|
1527
|
+
var cookieValue = value || strEmpty$1;
|
|
1528
|
+
objForEachKey(values, function (name, theValue) {
|
|
1529
|
+
cookieValue += "; " + name + (!isNullOrUndefined(theValue) ? "=" + theValue : strEmpty$1);
|
|
1530
|
+
});
|
|
1531
|
+
return cookieValue;
|
|
1532
|
+
}
|
|
1533
|
+
function _getCookieValue(name) {
|
|
1534
|
+
var cookieValue = strEmpty$1;
|
|
1535
|
+
if (_doc) {
|
|
1536
|
+
var theCookie = _doc[strCookie] || strEmpty$1;
|
|
1537
|
+
if (_parsedCookieValue !== theCookie) {
|
|
1538
|
+
_cookieCache = _extractParts(theCookie);
|
|
1539
|
+
_parsedCookieValue = theCookie;
|
|
1540
|
+
}
|
|
1541
|
+
cookieValue = strTrim(_cookieCache[name] || strEmpty$1);
|
|
1542
|
+
}
|
|
1543
|
+
return cookieValue;
|
|
1544
|
+
}
|
|
1545
|
+
function _setCookieValue(name, cookieValue) {
|
|
1546
|
+
if (_doc) {
|
|
1547
|
+
_doc[strCookie] = name + "=" + cookieValue;
|
|
1548
|
+
}
|
|
1549
|
+
}
|
|
1550
|
+
function uaDisallowsSameSiteNone(userAgent) {
|
|
1551
|
+
if (!isString(userAgent)) {
|
|
1552
|
+
return false;
|
|
1553
|
+
}
|
|
1554
|
+
if (strContains(userAgent, "CPU iPhone OS 12") || strContains(userAgent, "iPad; CPU OS 12")) {
|
|
1555
|
+
return true;
|
|
1556
|
+
}
|
|
1557
|
+
if (strContains(userAgent, "Macintosh; Intel Mac OS X 10_14") && strContains(userAgent, "Version/") && strContains(userAgent, "Safari")) {
|
|
1558
|
+
return true;
|
|
1559
|
+
}
|
|
1560
|
+
if (strContains(userAgent, "Macintosh; Intel Mac OS X 10_14") && strEndsWith(userAgent, "AppleWebKit/605.1.15 (KHTML, like Gecko)")) {
|
|
1561
|
+
return true;
|
|
1562
|
+
}
|
|
1563
|
+
if (strContains(userAgent, "Chrome/5") || strContains(userAgent, "Chrome/6")) {
|
|
1564
|
+
return true;
|
|
1565
|
+
}
|
|
1566
|
+
if (strContains(userAgent, "UnrealEngine") && !strContains(userAgent, "Chrome")) {
|
|
1567
|
+
return true;
|
|
1568
|
+
}
|
|
1569
|
+
if (strContains(userAgent, "UCBrowser/12") || strContains(userAgent, "UCBrowser/11")) {
|
|
1570
|
+
return true;
|
|
1571
|
+
}
|
|
1572
|
+
return false;
|
|
1573
|
+
}
|
|
1574
|
+
|
|
1575
|
+
var strOnPrefix = "on";
|
|
1576
|
+
var strAttachEvent = "attachEvent";
|
|
1577
|
+
var strAddEventHelper = "addEventListener";
|
|
1578
|
+
var strEvents = "events";
|
|
1579
|
+
createUniqueNamespace("aiEvtPageHide");
|
|
1580
|
+
createUniqueNamespace("aiEvtPageShow");
|
|
1581
|
+
var rRemoveEmptyNs = /\.[\.]+/g;
|
|
1582
|
+
var rRemoveTrailingEmptyNs = /[\.]+$/;
|
|
1583
|
+
var _guid = 1;
|
|
1584
|
+
var elmNodeData = createElmNodeData("events");
|
|
1585
|
+
var eventNamespace = /^([^.]*)(?:\.(.+)|)/;
|
|
1586
|
+
function _normalizeNamespace(name) {
|
|
1587
|
+
if (name && name.replace) {
|
|
1588
|
+
return name.replace(/^\s*\.*|\.*\s*$/g, "");
|
|
1589
|
+
}
|
|
1590
|
+
return name;
|
|
1591
|
+
}
|
|
1592
|
+
function _getEvtNamespace(eventName, evtNamespace) {
|
|
1593
|
+
if (evtNamespace) {
|
|
1594
|
+
var theNamespace_1 = "";
|
|
1595
|
+
if (isArray(evtNamespace)) {
|
|
1596
|
+
theNamespace_1 = "";
|
|
1597
|
+
arrForEach(evtNamespace, function (name) {
|
|
1598
|
+
name = _normalizeNamespace(name);
|
|
1599
|
+
if (name) {
|
|
1600
|
+
if (name[0] !== ".") {
|
|
1601
|
+
name = "." + name;
|
|
1602
|
+
}
|
|
1603
|
+
theNamespace_1 += name;
|
|
1604
|
+
}
|
|
1605
|
+
});
|
|
1606
|
+
}
|
|
1607
|
+
else {
|
|
1608
|
+
theNamespace_1 = _normalizeNamespace(evtNamespace);
|
|
1609
|
+
}
|
|
1610
|
+
if (theNamespace_1) {
|
|
1611
|
+
if (theNamespace_1[0] !== ".") {
|
|
1612
|
+
theNamespace_1 = "." + theNamespace_1;
|
|
1613
|
+
}
|
|
1614
|
+
eventName = (eventName || "") + theNamespace_1;
|
|
1615
|
+
}
|
|
1616
|
+
}
|
|
1617
|
+
var parsedEvent = (eventNamespace.exec(eventName || "") || []);
|
|
1618
|
+
return {
|
|
1619
|
+
type: parsedEvent[1],
|
|
1620
|
+
ns: ((parsedEvent[2] || "").replace(rRemoveEmptyNs, ".").replace(rRemoveTrailingEmptyNs, "").split(".").sort()).join(".")
|
|
1621
|
+
};
|
|
1622
|
+
}
|
|
1623
|
+
function _getRegisteredEvents(target, evtName, addDefault) {
|
|
1624
|
+
if (addDefault === void 0) { addDefault = true; }
|
|
1625
|
+
var aiEvts = elmNodeData.get(target, strEvents, {}, addDefault);
|
|
1626
|
+
var registeredEvents = aiEvts[evtName];
|
|
1627
|
+
if (!registeredEvents) {
|
|
1628
|
+
registeredEvents = aiEvts[evtName] = [];
|
|
1629
|
+
}
|
|
1630
|
+
return registeredEvents;
|
|
1631
|
+
}
|
|
1632
|
+
function _doAttach(obj, evtName, handlerRef, useCapture) {
|
|
1633
|
+
var result = false;
|
|
1634
|
+
if (obj && evtName && evtName.type && handlerRef) {
|
|
1635
|
+
if (obj[strAddEventHelper]) {
|
|
1636
|
+
obj[strAddEventHelper](evtName.type, handlerRef, useCapture);
|
|
1637
|
+
result = true;
|
|
1638
|
+
}
|
|
1639
|
+
else if (obj[strAttachEvent]) {
|
|
1640
|
+
obj[strAttachEvent](strOnPrefix + evtName.type, handlerRef);
|
|
1641
|
+
result = true;
|
|
1642
|
+
}
|
|
1643
|
+
}
|
|
1644
|
+
return result;
|
|
1645
|
+
}
|
|
1646
|
+
function eventOn(target, eventName, handlerRef, evtNamespace, useCapture) {
|
|
1647
|
+
if (useCapture === void 0) { useCapture = false; }
|
|
1648
|
+
var result = false;
|
|
1649
|
+
if (target) {
|
|
1650
|
+
try {
|
|
1651
|
+
var evtName = _getEvtNamespace(eventName, evtNamespace);
|
|
1652
|
+
result = _doAttach(target, evtName, handlerRef, useCapture);
|
|
1653
|
+
if (result && elmNodeData.accept(target)) {
|
|
1654
|
+
var registeredEvent = {
|
|
1655
|
+
guid: _guid++,
|
|
1656
|
+
evtName: evtName,
|
|
1657
|
+
handler: handlerRef,
|
|
1658
|
+
capture: useCapture
|
|
1659
|
+
};
|
|
1660
|
+
_getRegisteredEvents(target, evtName.type).push(registeredEvent);
|
|
1661
|
+
}
|
|
1662
|
+
}
|
|
1663
|
+
catch (e) {
|
|
1664
|
+
}
|
|
1665
|
+
}
|
|
1666
|
+
return result;
|
|
1667
|
+
}
|
|
1668
|
+
function attachEvent(obj, eventNameWithoutOn, handlerRef, useCapture) {
|
|
1669
|
+
if (useCapture === void 0) { useCapture = false; }
|
|
1670
|
+
return eventOn(obj, eventNameWithoutOn, handlerRef, null, useCapture);
|
|
1671
|
+
}
|
|
1672
|
+
function addEventHandler(eventName, callback, evtNamespace) {
|
|
1673
|
+
var result = false;
|
|
1674
|
+
var w = getWindow();
|
|
1675
|
+
if (w) {
|
|
1676
|
+
result = eventOn(w, eventName, callback, evtNamespace);
|
|
1677
|
+
result = eventOn(w["body"], eventName, callback, evtNamespace) || result;
|
|
1678
|
+
}
|
|
1679
|
+
var doc = getDocument();
|
|
1680
|
+
if (doc) {
|
|
1681
|
+
result = eventOn(doc, eventName, callback, evtNamespace) || result;
|
|
1682
|
+
}
|
|
1683
|
+
return result;
|
|
1684
|
+
}
|
|
1685
|
+
|
|
1686
|
+
var _cookieMgrs = null;
|
|
1687
|
+
var _canUseCookies;
|
|
1688
|
+
function newGuid() {
|
|
1689
|
+
function randomHexDigit() {
|
|
1690
|
+
return randomValue(15);
|
|
1691
|
+
}
|
|
1692
|
+
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(GuidRegex, function (c) {
|
|
1693
|
+
var r = (randomHexDigit() | 0), v = (c === "x" ? r : r & 0x3 | 0x8);
|
|
1694
|
+
return v.toString(16);
|
|
1695
|
+
});
|
|
1696
|
+
}
|
|
1697
|
+
function perfNow() {
|
|
1698
|
+
var perf = getPerformance();
|
|
1699
|
+
if (perf && perf.now) {
|
|
1700
|
+
return perf.now();
|
|
1701
|
+
}
|
|
1702
|
+
return dateNow();
|
|
1703
|
+
}
|
|
1704
|
+
function generateW3CId() {
|
|
1705
|
+
var hexValues = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f"];
|
|
1706
|
+
var oct = strEmpty$1, tmp;
|
|
1707
|
+
for (var a = 0; a < 4; a++) {
|
|
1708
|
+
tmp = random32();
|
|
1709
|
+
oct +=
|
|
1710
|
+
hexValues[tmp & 0xF] +
|
|
1711
|
+
hexValues[tmp >> 4 & 0xF] +
|
|
1712
|
+
hexValues[tmp >> 8 & 0xF] +
|
|
1713
|
+
hexValues[tmp >> 12 & 0xF] +
|
|
1714
|
+
hexValues[tmp >> 16 & 0xF] +
|
|
1715
|
+
hexValues[tmp >> 20 & 0xF] +
|
|
1716
|
+
hexValues[tmp >> 24 & 0xF] +
|
|
1717
|
+
hexValues[tmp >> 28 & 0xF];
|
|
1718
|
+
}
|
|
1719
|
+
var clockSequenceHi = hexValues[8 + (random32() & 0x03) | 0];
|
|
1720
|
+
return oct.substr(0, 8) + oct.substr(9, 4) + "4" + oct.substr(13, 3) + clockSequenceHi + oct.substr(16, 3) + oct.substr(19, 12);
|
|
1721
|
+
}
|
|
1722
|
+
var CoreUtils = {
|
|
1723
|
+
_canUseCookies: undefined,
|
|
1724
|
+
isTypeof: isTypeof,
|
|
1725
|
+
isUndefined: isUndefined,
|
|
1726
|
+
isNullOrUndefined: isNullOrUndefined,
|
|
1727
|
+
hasOwnProperty: hasOwnProperty,
|
|
1728
|
+
isFunction: isFunction,
|
|
1729
|
+
isObject: isObject,
|
|
1730
|
+
isDate: isDate,
|
|
1731
|
+
isArray: isArray,
|
|
1732
|
+
isError: isError,
|
|
1733
|
+
isString: isString,
|
|
1734
|
+
isNumber: isNumber,
|
|
1735
|
+
isBoolean: isBoolean,
|
|
1736
|
+
toISOString: toISOString,
|
|
1737
|
+
arrForEach: arrForEach,
|
|
1738
|
+
arrIndexOf: arrIndexOf,
|
|
1739
|
+
arrMap: arrMap,
|
|
1740
|
+
arrReduce: arrReduce,
|
|
1741
|
+
strTrim: strTrim,
|
|
1742
|
+
objCreate: objCreateFn,
|
|
1743
|
+
objKeys: objKeys,
|
|
1744
|
+
objDefineAccessors: objDefineAccessors,
|
|
1745
|
+
addEventHandler: addEventHandler,
|
|
1746
|
+
dateNow: dateNow,
|
|
1747
|
+
isIE: isIE,
|
|
1748
|
+
disableCookies: disableCookies,
|
|
1749
|
+
newGuid: newGuid,
|
|
1750
|
+
perfNow: perfNow,
|
|
1751
|
+
newId: newId,
|
|
1752
|
+
randomValue: randomValue,
|
|
1753
|
+
random32: random32,
|
|
1754
|
+
mwcRandomSeed: mwcRandomSeed,
|
|
1755
|
+
mwcRandom32: mwcRandom32,
|
|
1756
|
+
generateW3CId: generateW3CId
|
|
1757
|
+
};
|
|
1758
|
+
var GuidRegex = /[xy]/g;
|
|
1759
|
+
function _legacyCookieMgr(config, logger) {
|
|
1760
|
+
var cookieMgr = _gblCookieMgr(config, logger);
|
|
1761
|
+
var legacyCanUseCookies = CoreUtils._canUseCookies;
|
|
1762
|
+
if (_cookieMgrs === null) {
|
|
1763
|
+
_cookieMgrs = [];
|
|
1764
|
+
_canUseCookies = legacyCanUseCookies;
|
|
1765
|
+
objDefineAccessors(CoreUtils, "_canUseCookies", function () {
|
|
1766
|
+
return _canUseCookies;
|
|
1767
|
+
}, function (value) {
|
|
1768
|
+
_canUseCookies = value;
|
|
1769
|
+
arrForEach(_cookieMgrs, function (mgr) {
|
|
1770
|
+
mgr.setEnabled(value);
|
|
1771
|
+
});
|
|
1772
|
+
});
|
|
1773
|
+
}
|
|
1774
|
+
if (arrIndexOf(_cookieMgrs, cookieMgr) === -1) {
|
|
1775
|
+
_cookieMgrs.push(cookieMgr);
|
|
1776
|
+
}
|
|
1777
|
+
if (isBoolean(legacyCanUseCookies)) {
|
|
1778
|
+
cookieMgr.setEnabled(legacyCanUseCookies);
|
|
1779
|
+
}
|
|
1780
|
+
if (isBoolean(_canUseCookies)) {
|
|
1781
|
+
cookieMgr.setEnabled(_canUseCookies);
|
|
1782
|
+
}
|
|
1783
|
+
return cookieMgr;
|
|
1784
|
+
}
|
|
1785
|
+
function disableCookies() {
|
|
1786
|
+
_legacyCookieMgr().setEnabled(false);
|
|
1787
|
+
}
|
|
1788
|
+
function canUseCookies(logger) {
|
|
1789
|
+
return _legacyCookieMgr(null, logger).isEnabled();
|
|
1790
|
+
}
|
|
1791
|
+
function getCookie(logger, name) {
|
|
1792
|
+
return _legacyCookieMgr(null, logger).get(name);
|
|
1793
|
+
}
|
|
1794
|
+
function setCookie(logger, name, value, domain) {
|
|
1795
|
+
_legacyCookieMgr(null, logger).set(name, value, null, domain);
|
|
1796
|
+
}
|
|
1797
|
+
function deleteCookie(logger, name) {
|
|
1798
|
+
return _legacyCookieMgr(null, logger).del(name);
|
|
1799
|
+
}
|
|
1800
|
+
|
|
1349
1801
|
var pluginStateData = createElmNodeData("plugin");
|
|
1350
1802
|
function _getPluginState(plugin) {
|
|
1351
1803
|
return pluginStateData.get(plugin, "state", {}, true);
|
|
@@ -1668,261 +2120,35 @@ function createTelemetryPluginProxy(plugin, config, core) {
|
|
|
1668
2120
|
pluginState[strTeardown] = true;
|
|
1669
2121
|
pluginState[strIsInitialized] = false;
|
|
1670
2122
|
if (plugin[strTeardown] && plugin[strTeardown](unloadCtx, unloadState) === true) {
|
|
1671
|
-
hasRun = true;
|
|
1672
|
-
}
|
|
1673
|
-
}
|
|
1674
|
-
}
|
|
1675
|
-
return hasRun;
|
|
1676
|
-
}
|
|
1677
|
-
if (!_processChain(unloadCtx, _callTeardown, "unload", function () { }, unloadState.isAsync)) {
|
|
1678
|
-
unloadCtx.processNext(unloadState);
|
|
1679
|
-
}
|
|
1680
|
-
}
|
|
1681
|
-
function _updatePlugin(updateCtx, updateState) {
|
|
1682
|
-
function _callUpdate() {
|
|
1683
|
-
var hasRun = false;
|
|
1684
|
-
if (plugin) {
|
|
1685
|
-
var pluginState = _getPluginState(plugin);
|
|
1686
|
-
var pluginCore = plugin[strCore] || pluginState.core;
|
|
1687
|
-
if (plugin && (!pluginCore || pluginCore === updateCtx[strCore]()) && !pluginState[strTeardown]) {
|
|
1688
|
-
if (plugin[strUpdate] && plugin[strUpdate](updateCtx, updateState) === true) {
|
|
1689
|
-
hasRun = true;
|
|
1690
|
-
}
|
|
1691
|
-
}
|
|
1692
|
-
}
|
|
1693
|
-
return hasRun;
|
|
1694
|
-
}
|
|
1695
|
-
if (!_processChain(updateCtx, _callUpdate, "update", function () { }, false)) {
|
|
1696
|
-
updateCtx.processNext(updateState);
|
|
1697
|
-
}
|
|
1698
|
-
}
|
|
1699
|
-
return objFreeze(proxyChain);
|
|
1700
|
-
}
|
|
1701
|
-
|
|
1702
|
-
var strToGMTString = "toGMTString";
|
|
1703
|
-
var strToUTCString = "toUTCString";
|
|
1704
|
-
var strCookie = "cookie";
|
|
1705
|
-
var strExpires = "expires";
|
|
1706
|
-
var strEnabled = "enabled";
|
|
1707
|
-
var strIsCookieUseDisabled = "isCookieUseDisabled";
|
|
1708
|
-
var strDisableCookiesUsage = "disableCookiesUsage";
|
|
1709
|
-
var strConfigCookieMgr = "_ckMgr";
|
|
1710
|
-
var _supportsCookies = null;
|
|
1711
|
-
var _allowUaSameSite = null;
|
|
1712
|
-
var _parsedCookieValue = null;
|
|
1713
|
-
var _doc = getDocument();
|
|
1714
|
-
var _cookieCache = {};
|
|
1715
|
-
var _globalCookieConfig = {};
|
|
1716
|
-
function _gblCookieMgr(config, logger) {
|
|
1717
|
-
var inst = createCookieMgr[strConfigCookieMgr] || _globalCookieConfig[strConfigCookieMgr];
|
|
1718
|
-
if (!inst) {
|
|
1719
|
-
inst = createCookieMgr[strConfigCookieMgr] = createCookieMgr(config, logger);
|
|
1720
|
-
_globalCookieConfig[strConfigCookieMgr] = inst;
|
|
1721
|
-
}
|
|
1722
|
-
return inst;
|
|
1723
|
-
}
|
|
1724
|
-
function _isMgrEnabled(cookieMgr) {
|
|
1725
|
-
if (cookieMgr) {
|
|
1726
|
-
return cookieMgr.isEnabled();
|
|
1727
|
-
}
|
|
1728
|
-
return true;
|
|
1729
|
-
}
|
|
1730
|
-
function _createCookieMgrConfig(rootConfig) {
|
|
1731
|
-
var cookieMgrCfg = rootConfig.cookieCfg = rootConfig.cookieCfg || {};
|
|
1732
|
-
setValue(cookieMgrCfg, "domain", rootConfig.cookieDomain, isNotNullOrUndefined, isNullOrUndefined);
|
|
1733
|
-
setValue(cookieMgrCfg, "path", rootConfig.cookiePath || "/", null, isNullOrUndefined);
|
|
1734
|
-
if (isNullOrUndefined(cookieMgrCfg[strEnabled])) {
|
|
1735
|
-
var cookieEnabled = void 0;
|
|
1736
|
-
if (!isUndefined(rootConfig[strIsCookieUseDisabled])) {
|
|
1737
|
-
cookieEnabled = !rootConfig[strIsCookieUseDisabled];
|
|
1738
|
-
}
|
|
1739
|
-
if (!isUndefined(rootConfig[strDisableCookiesUsage])) {
|
|
1740
|
-
cookieEnabled = !rootConfig[strDisableCookiesUsage];
|
|
1741
|
-
}
|
|
1742
|
-
cookieMgrCfg[strEnabled] = cookieEnabled;
|
|
1743
|
-
}
|
|
1744
|
-
return cookieMgrCfg;
|
|
1745
|
-
}
|
|
1746
|
-
function createCookieMgr(rootConfig, logger) {
|
|
1747
|
-
var cookieMgrConfig = _createCookieMgrConfig(rootConfig || _globalCookieConfig);
|
|
1748
|
-
var _path = cookieMgrConfig.path || "/";
|
|
1749
|
-
var _domain = cookieMgrConfig.domain;
|
|
1750
|
-
var _enabled = cookieMgrConfig[strEnabled] !== false;
|
|
1751
|
-
var cookieMgr = {
|
|
1752
|
-
isEnabled: function () {
|
|
1753
|
-
var enabled = _enabled && areCookiesSupported(logger);
|
|
1754
|
-
var gblManager = _globalCookieConfig[strConfigCookieMgr];
|
|
1755
|
-
if (enabled && gblManager && cookieMgr !== gblManager) {
|
|
1756
|
-
enabled = _isMgrEnabled(gblManager);
|
|
1757
|
-
}
|
|
1758
|
-
return enabled;
|
|
1759
|
-
},
|
|
1760
|
-
setEnabled: function (value) {
|
|
1761
|
-
_enabled = value !== false;
|
|
1762
|
-
},
|
|
1763
|
-
set: function (name, value, maxAgeSec, domain, path) {
|
|
1764
|
-
var result = false;
|
|
1765
|
-
if (_isMgrEnabled(cookieMgr)) {
|
|
1766
|
-
var values = {};
|
|
1767
|
-
var theValue = strTrim(value || strEmpty$1);
|
|
1768
|
-
var idx = theValue.indexOf(";");
|
|
1769
|
-
if (idx !== -1) {
|
|
1770
|
-
theValue = strTrim(value.substring(0, idx));
|
|
1771
|
-
values = _extractParts(value.substring(idx + 1));
|
|
1772
|
-
}
|
|
1773
|
-
setValue(values, "domain", domain || _domain, isTruthy, isUndefined);
|
|
1774
|
-
if (!isNullOrUndefined(maxAgeSec)) {
|
|
1775
|
-
var _isIE = isIE();
|
|
1776
|
-
if (isUndefined(values[strExpires])) {
|
|
1777
|
-
var nowMs = dateNow();
|
|
1778
|
-
var expireMs = nowMs + (maxAgeSec * 1000);
|
|
1779
|
-
if (expireMs > 0) {
|
|
1780
|
-
var expiry = new Date();
|
|
1781
|
-
expiry.setTime(expireMs);
|
|
1782
|
-
setValue(values, strExpires, _formatDate(expiry, !_isIE ? strToUTCString : strToGMTString) || _formatDate(expiry, _isIE ? strToGMTString : strToUTCString) || strEmpty$1, isTruthy);
|
|
1783
|
-
}
|
|
1784
|
-
}
|
|
1785
|
-
if (!_isIE) {
|
|
1786
|
-
setValue(values, "max-age", strEmpty$1 + maxAgeSec, null, isUndefined);
|
|
1787
|
-
}
|
|
1788
|
-
}
|
|
1789
|
-
var location_1 = getLocation();
|
|
1790
|
-
if (location_1 && location_1.protocol === "https:") {
|
|
1791
|
-
setValue(values, "secure", null, null, isUndefined);
|
|
1792
|
-
if (_allowUaSameSite === null) {
|
|
1793
|
-
_allowUaSameSite = !uaDisallowsSameSiteNone((getNavigator() || {}).userAgent);
|
|
1794
|
-
}
|
|
1795
|
-
if (_allowUaSameSite) {
|
|
1796
|
-
setValue(values, "SameSite", "None", null, isUndefined);
|
|
1797
|
-
}
|
|
1798
|
-
}
|
|
1799
|
-
setValue(values, "path", path || _path, null, isUndefined);
|
|
1800
|
-
var setCookieFn = cookieMgrConfig.setCookie || _setCookieValue;
|
|
1801
|
-
setCookieFn(name, _formatCookieValue(theValue, values));
|
|
1802
|
-
result = true;
|
|
1803
|
-
}
|
|
1804
|
-
return result;
|
|
1805
|
-
},
|
|
1806
|
-
get: function (name) {
|
|
1807
|
-
var value = strEmpty$1;
|
|
1808
|
-
if (_isMgrEnabled(cookieMgr)) {
|
|
1809
|
-
value = (cookieMgrConfig.getCookie || _getCookieValue)(name);
|
|
1810
|
-
}
|
|
1811
|
-
return value;
|
|
1812
|
-
},
|
|
1813
|
-
del: function (name, path) {
|
|
1814
|
-
var result = false;
|
|
1815
|
-
if (_isMgrEnabled(cookieMgr)) {
|
|
1816
|
-
result = cookieMgr.purge(name, path);
|
|
1817
|
-
}
|
|
1818
|
-
return result;
|
|
1819
|
-
},
|
|
1820
|
-
purge: function (name, path) {
|
|
1821
|
-
var _a;
|
|
1822
|
-
var result = false;
|
|
1823
|
-
if (areCookiesSupported(logger)) {
|
|
1824
|
-
var values = (_a = {},
|
|
1825
|
-
_a["path"] = path ? path : "/",
|
|
1826
|
-
_a[strExpires] = "Thu, 01 Jan 1970 00:00:01 GMT",
|
|
1827
|
-
_a);
|
|
1828
|
-
if (!isIE()) {
|
|
1829
|
-
values["max-age"] = "0";
|
|
1830
|
-
}
|
|
1831
|
-
var delCookie = cookieMgrConfig.delCookie || _setCookieValue;
|
|
1832
|
-
delCookie(name, _formatCookieValue(strEmpty$1, values));
|
|
1833
|
-
result = true;
|
|
1834
|
-
}
|
|
1835
|
-
return result;
|
|
1836
|
-
}
|
|
1837
|
-
};
|
|
1838
|
-
cookieMgr[strConfigCookieMgr] = cookieMgr;
|
|
1839
|
-
return cookieMgr;
|
|
1840
|
-
}
|
|
1841
|
-
function areCookiesSupported(logger) {
|
|
1842
|
-
if (_supportsCookies === null) {
|
|
1843
|
-
_supportsCookies = false;
|
|
1844
|
-
try {
|
|
1845
|
-
var doc = _doc || {};
|
|
1846
|
-
_supportsCookies = doc[strCookie] !== undefined;
|
|
1847
|
-
}
|
|
1848
|
-
catch (e) {
|
|
1849
|
-
_throwInternal(logger, 2 , 68 , "Cannot access document.cookie - " + getExceptionName(e), { exception: dumpObj(e) });
|
|
1850
|
-
}
|
|
1851
|
-
}
|
|
1852
|
-
return _supportsCookies;
|
|
1853
|
-
}
|
|
1854
|
-
function _extractParts(theValue) {
|
|
1855
|
-
var values = {};
|
|
1856
|
-
if (theValue && theValue.length) {
|
|
1857
|
-
var parts = strTrim(theValue).split(";");
|
|
1858
|
-
arrForEach(parts, function (thePart) {
|
|
1859
|
-
thePart = strTrim(thePart || strEmpty$1);
|
|
1860
|
-
if (thePart) {
|
|
1861
|
-
var idx = thePart.indexOf("=");
|
|
1862
|
-
if (idx === -1) {
|
|
1863
|
-
values[thePart] = null;
|
|
1864
|
-
}
|
|
1865
|
-
else {
|
|
1866
|
-
values[strTrim(thePart.substring(0, idx))] = strTrim(thePart.substring(idx + 1));
|
|
1867
|
-
}
|
|
1868
|
-
}
|
|
1869
|
-
});
|
|
1870
|
-
}
|
|
1871
|
-
return values;
|
|
1872
|
-
}
|
|
1873
|
-
function _formatDate(theDate, func) {
|
|
1874
|
-
if (isFunction(theDate[func])) {
|
|
1875
|
-
return theDate[func]();
|
|
1876
|
-
}
|
|
1877
|
-
return null;
|
|
1878
|
-
}
|
|
1879
|
-
function _formatCookieValue(value, values) {
|
|
1880
|
-
var cookieValue = value || strEmpty$1;
|
|
1881
|
-
objForEachKey(values, function (name, theValue) {
|
|
1882
|
-
cookieValue += "; " + name + (!isNullOrUndefined(theValue) ? "=" + theValue : strEmpty$1);
|
|
1883
|
-
});
|
|
1884
|
-
return cookieValue;
|
|
1885
|
-
}
|
|
1886
|
-
function _getCookieValue(name) {
|
|
1887
|
-
var cookieValue = strEmpty$1;
|
|
1888
|
-
if (_doc) {
|
|
1889
|
-
var theCookie = _doc[strCookie] || strEmpty$1;
|
|
1890
|
-
if (_parsedCookieValue !== theCookie) {
|
|
1891
|
-
_cookieCache = _extractParts(theCookie);
|
|
1892
|
-
_parsedCookieValue = theCookie;
|
|
1893
|
-
}
|
|
1894
|
-
cookieValue = strTrim(_cookieCache[name] || strEmpty$1);
|
|
1895
|
-
}
|
|
1896
|
-
return cookieValue;
|
|
1897
|
-
}
|
|
1898
|
-
function _setCookieValue(name, cookieValue) {
|
|
1899
|
-
if (_doc) {
|
|
1900
|
-
_doc[strCookie] = name + "=" + cookieValue;
|
|
1901
|
-
}
|
|
1902
|
-
}
|
|
1903
|
-
function uaDisallowsSameSiteNone(userAgent) {
|
|
1904
|
-
if (!isString(userAgent)) {
|
|
1905
|
-
return false;
|
|
1906
|
-
}
|
|
1907
|
-
if (strContains(userAgent, "CPU iPhone OS 12") || strContains(userAgent, "iPad; CPU OS 12")) {
|
|
1908
|
-
return true;
|
|
1909
|
-
}
|
|
1910
|
-
if (strContains(userAgent, "Macintosh; Intel Mac OS X 10_14") && strContains(userAgent, "Version/") && strContains(userAgent, "Safari")) {
|
|
1911
|
-
return true;
|
|
1912
|
-
}
|
|
1913
|
-
if (strContains(userAgent, "Macintosh; Intel Mac OS X 10_14") && strEndsWith(userAgent, "AppleWebKit/605.1.15 (KHTML, like Gecko)")) {
|
|
1914
|
-
return true;
|
|
1915
|
-
}
|
|
1916
|
-
if (strContains(userAgent, "Chrome/5") || strContains(userAgent, "Chrome/6")) {
|
|
1917
|
-
return true;
|
|
1918
|
-
}
|
|
1919
|
-
if (strContains(userAgent, "UnrealEngine") && !strContains(userAgent, "Chrome")) {
|
|
1920
|
-
return true;
|
|
2123
|
+
hasRun = true;
|
|
2124
|
+
}
|
|
2125
|
+
}
|
|
2126
|
+
}
|
|
2127
|
+
return hasRun;
|
|
2128
|
+
}
|
|
2129
|
+
if (!_processChain(unloadCtx, _callTeardown, "unload", function () { }, unloadState.isAsync)) {
|
|
2130
|
+
unloadCtx.processNext(unloadState);
|
|
2131
|
+
}
|
|
1921
2132
|
}
|
|
1922
|
-
|
|
1923
|
-
|
|
2133
|
+
function _updatePlugin(updateCtx, updateState) {
|
|
2134
|
+
function _callUpdate() {
|
|
2135
|
+
var hasRun = false;
|
|
2136
|
+
if (plugin) {
|
|
2137
|
+
var pluginState = _getPluginState(plugin);
|
|
2138
|
+
var pluginCore = plugin[strCore] || pluginState.core;
|
|
2139
|
+
if (plugin && (!pluginCore || pluginCore === updateCtx[strCore]()) && !pluginState[strTeardown]) {
|
|
2140
|
+
if (plugin[strUpdate] && plugin[strUpdate](updateCtx, updateState) === true) {
|
|
2141
|
+
hasRun = true;
|
|
2142
|
+
}
|
|
2143
|
+
}
|
|
2144
|
+
}
|
|
2145
|
+
return hasRun;
|
|
2146
|
+
}
|
|
2147
|
+
if (!_processChain(updateCtx, _callUpdate, "update", function () { }, false)) {
|
|
2148
|
+
updateCtx.processNext(updateState);
|
|
2149
|
+
}
|
|
1924
2150
|
}
|
|
1925
|
-
return
|
|
2151
|
+
return objFreeze(proxyChain);
|
|
1926
2152
|
}
|
|
1927
2153
|
|
|
1928
2154
|
var strExtensionConfig = "extensionConfig";
|
|
@@ -2098,232 +2324,6 @@ var BaseTelemetryPlugin = /** @class */ (function () {
|
|
|
2098
2324
|
return BaseTelemetryPlugin;
|
|
2099
2325
|
}());
|
|
2100
2326
|
|
|
2101
|
-
var strOnPrefix = "on";
|
|
2102
|
-
var strAttachEvent = "attachEvent";
|
|
2103
|
-
var strAddEventHelper = "addEventListener";
|
|
2104
|
-
var strEvents = "events";
|
|
2105
|
-
createUniqueNamespace("aiEvtPageHide");
|
|
2106
|
-
createUniqueNamespace("aiEvtPageShow");
|
|
2107
|
-
var rRemoveEmptyNs = /\.[\.]+/g;
|
|
2108
|
-
var rRemoveTrailingEmptyNs = /[\.]+$/;
|
|
2109
|
-
var _guid = 1;
|
|
2110
|
-
var elmNodeData = createElmNodeData("events");
|
|
2111
|
-
var eventNamespace = /^([^.]*)(?:\.(.+)|)/;
|
|
2112
|
-
function _normalizeNamespace(name) {
|
|
2113
|
-
if (name && name.replace) {
|
|
2114
|
-
return name.replace(/^\s*\.*|\.*\s*$/g, "");
|
|
2115
|
-
}
|
|
2116
|
-
return name;
|
|
2117
|
-
}
|
|
2118
|
-
function _getEvtNamespace(eventName, evtNamespace) {
|
|
2119
|
-
if (evtNamespace) {
|
|
2120
|
-
var theNamespace_1 = "";
|
|
2121
|
-
if (isArray(evtNamespace)) {
|
|
2122
|
-
theNamespace_1 = "";
|
|
2123
|
-
arrForEach(evtNamespace, function (name) {
|
|
2124
|
-
name = _normalizeNamespace(name);
|
|
2125
|
-
if (name) {
|
|
2126
|
-
if (name[0] !== ".") {
|
|
2127
|
-
name = "." + name;
|
|
2128
|
-
}
|
|
2129
|
-
theNamespace_1 += name;
|
|
2130
|
-
}
|
|
2131
|
-
});
|
|
2132
|
-
}
|
|
2133
|
-
else {
|
|
2134
|
-
theNamespace_1 = _normalizeNamespace(evtNamespace);
|
|
2135
|
-
}
|
|
2136
|
-
if (theNamespace_1) {
|
|
2137
|
-
if (theNamespace_1[0] !== ".") {
|
|
2138
|
-
theNamespace_1 = "." + theNamespace_1;
|
|
2139
|
-
}
|
|
2140
|
-
eventName = (eventName || "") + theNamespace_1;
|
|
2141
|
-
}
|
|
2142
|
-
}
|
|
2143
|
-
var parsedEvent = (eventNamespace.exec(eventName || "") || []);
|
|
2144
|
-
return {
|
|
2145
|
-
type: parsedEvent[1],
|
|
2146
|
-
ns: ((parsedEvent[2] || "").replace(rRemoveEmptyNs, ".").replace(rRemoveTrailingEmptyNs, "").split(".").sort()).join(".")
|
|
2147
|
-
};
|
|
2148
|
-
}
|
|
2149
|
-
function _getRegisteredEvents(target, evtName, addDefault) {
|
|
2150
|
-
if (addDefault === void 0) { addDefault = true; }
|
|
2151
|
-
var aiEvts = elmNodeData.get(target, strEvents, {}, addDefault);
|
|
2152
|
-
var registeredEvents = aiEvts[evtName];
|
|
2153
|
-
if (!registeredEvents) {
|
|
2154
|
-
registeredEvents = aiEvts[evtName] = [];
|
|
2155
|
-
}
|
|
2156
|
-
return registeredEvents;
|
|
2157
|
-
}
|
|
2158
|
-
function _doAttach(obj, evtName, handlerRef, useCapture) {
|
|
2159
|
-
var result = false;
|
|
2160
|
-
if (obj && evtName && evtName.type && handlerRef) {
|
|
2161
|
-
if (obj[strAddEventHelper]) {
|
|
2162
|
-
obj[strAddEventHelper](evtName.type, handlerRef, useCapture);
|
|
2163
|
-
result = true;
|
|
2164
|
-
}
|
|
2165
|
-
else if (obj[strAttachEvent]) {
|
|
2166
|
-
obj[strAttachEvent](strOnPrefix + evtName.type, handlerRef);
|
|
2167
|
-
result = true;
|
|
2168
|
-
}
|
|
2169
|
-
}
|
|
2170
|
-
return result;
|
|
2171
|
-
}
|
|
2172
|
-
function eventOn(target, eventName, handlerRef, evtNamespace, useCapture) {
|
|
2173
|
-
if (useCapture === void 0) { useCapture = false; }
|
|
2174
|
-
var result = false;
|
|
2175
|
-
if (target) {
|
|
2176
|
-
try {
|
|
2177
|
-
var evtName = _getEvtNamespace(eventName, evtNamespace);
|
|
2178
|
-
result = _doAttach(target, evtName, handlerRef, useCapture);
|
|
2179
|
-
if (result && elmNodeData.accept(target)) {
|
|
2180
|
-
var registeredEvent = {
|
|
2181
|
-
guid: _guid++,
|
|
2182
|
-
evtName: evtName,
|
|
2183
|
-
handler: handlerRef,
|
|
2184
|
-
capture: useCapture
|
|
2185
|
-
};
|
|
2186
|
-
_getRegisteredEvents(target, evtName.type).push(registeredEvent);
|
|
2187
|
-
}
|
|
2188
|
-
}
|
|
2189
|
-
catch (e) {
|
|
2190
|
-
}
|
|
2191
|
-
}
|
|
2192
|
-
return result;
|
|
2193
|
-
}
|
|
2194
|
-
function attachEvent(obj, eventNameWithoutOn, handlerRef, useCapture) {
|
|
2195
|
-
if (useCapture === void 0) { useCapture = false; }
|
|
2196
|
-
return eventOn(obj, eventNameWithoutOn, handlerRef, null, useCapture);
|
|
2197
|
-
}
|
|
2198
|
-
function addEventHandler(eventName, callback, evtNamespace) {
|
|
2199
|
-
var result = false;
|
|
2200
|
-
var w = getWindow();
|
|
2201
|
-
if (w) {
|
|
2202
|
-
result = eventOn(w, eventName, callback, evtNamespace);
|
|
2203
|
-
result = eventOn(w["body"], eventName, callback, evtNamespace) || result;
|
|
2204
|
-
}
|
|
2205
|
-
var doc = getDocument();
|
|
2206
|
-
if (doc) {
|
|
2207
|
-
result = eventOn(doc, eventName, callback, evtNamespace) || result;
|
|
2208
|
-
}
|
|
2209
|
-
return result;
|
|
2210
|
-
}
|
|
2211
|
-
|
|
2212
|
-
var _cookieMgrs = null;
|
|
2213
|
-
var _canUseCookies;
|
|
2214
|
-
function newGuid() {
|
|
2215
|
-
function randomHexDigit() {
|
|
2216
|
-
return randomValue(15);
|
|
2217
|
-
}
|
|
2218
|
-
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(GuidRegex, function (c) {
|
|
2219
|
-
var r = (randomHexDigit() | 0), v = (c === "x" ? r : r & 0x3 | 0x8);
|
|
2220
|
-
return v.toString(16);
|
|
2221
|
-
});
|
|
2222
|
-
}
|
|
2223
|
-
function perfNow() {
|
|
2224
|
-
var perf = getPerformance();
|
|
2225
|
-
if (perf && perf.now) {
|
|
2226
|
-
return perf.now();
|
|
2227
|
-
}
|
|
2228
|
-
return dateNow();
|
|
2229
|
-
}
|
|
2230
|
-
function generateW3CId() {
|
|
2231
|
-
var hexValues = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f"];
|
|
2232
|
-
var oct = strEmpty$1, tmp;
|
|
2233
|
-
for (var a = 0; a < 4; a++) {
|
|
2234
|
-
tmp = random32();
|
|
2235
|
-
oct +=
|
|
2236
|
-
hexValues[tmp & 0xF] +
|
|
2237
|
-
hexValues[tmp >> 4 & 0xF] +
|
|
2238
|
-
hexValues[tmp >> 8 & 0xF] +
|
|
2239
|
-
hexValues[tmp >> 12 & 0xF] +
|
|
2240
|
-
hexValues[tmp >> 16 & 0xF] +
|
|
2241
|
-
hexValues[tmp >> 20 & 0xF] +
|
|
2242
|
-
hexValues[tmp >> 24 & 0xF] +
|
|
2243
|
-
hexValues[tmp >> 28 & 0xF];
|
|
2244
|
-
}
|
|
2245
|
-
var clockSequenceHi = hexValues[8 + (random32() & 0x03) | 0];
|
|
2246
|
-
return oct.substr(0, 8) + oct.substr(9, 4) + "4" + oct.substr(13, 3) + clockSequenceHi + oct.substr(16, 3) + oct.substr(19, 12);
|
|
2247
|
-
}
|
|
2248
|
-
var CoreUtils = {
|
|
2249
|
-
_canUseCookies: undefined,
|
|
2250
|
-
isTypeof: isTypeof,
|
|
2251
|
-
isUndefined: isUndefined,
|
|
2252
|
-
isNullOrUndefined: isNullOrUndefined,
|
|
2253
|
-
hasOwnProperty: hasOwnProperty,
|
|
2254
|
-
isFunction: isFunction,
|
|
2255
|
-
isObject: isObject,
|
|
2256
|
-
isDate: isDate,
|
|
2257
|
-
isArray: isArray,
|
|
2258
|
-
isError: isError,
|
|
2259
|
-
isString: isString,
|
|
2260
|
-
isNumber: isNumber,
|
|
2261
|
-
isBoolean: isBoolean,
|
|
2262
|
-
toISOString: toISOString,
|
|
2263
|
-
arrForEach: arrForEach,
|
|
2264
|
-
arrIndexOf: arrIndexOf,
|
|
2265
|
-
arrMap: arrMap,
|
|
2266
|
-
arrReduce: arrReduce,
|
|
2267
|
-
strTrim: strTrim,
|
|
2268
|
-
objCreate: objCreateFn,
|
|
2269
|
-
objKeys: objKeys,
|
|
2270
|
-
objDefineAccessors: objDefineAccessors,
|
|
2271
|
-
addEventHandler: addEventHandler,
|
|
2272
|
-
dateNow: dateNow,
|
|
2273
|
-
isIE: isIE,
|
|
2274
|
-
disableCookies: disableCookies,
|
|
2275
|
-
newGuid: newGuid,
|
|
2276
|
-
perfNow: perfNow,
|
|
2277
|
-
newId: newId,
|
|
2278
|
-
randomValue: randomValue,
|
|
2279
|
-
random32: random32,
|
|
2280
|
-
mwcRandomSeed: mwcRandomSeed,
|
|
2281
|
-
mwcRandom32: mwcRandom32,
|
|
2282
|
-
generateW3CId: generateW3CId
|
|
2283
|
-
};
|
|
2284
|
-
var GuidRegex = /[xy]/g;
|
|
2285
|
-
function _legacyCookieMgr(config, logger) {
|
|
2286
|
-
var cookieMgr = _gblCookieMgr(config, logger);
|
|
2287
|
-
var legacyCanUseCookies = CoreUtils._canUseCookies;
|
|
2288
|
-
if (_cookieMgrs === null) {
|
|
2289
|
-
_cookieMgrs = [];
|
|
2290
|
-
_canUseCookies = legacyCanUseCookies;
|
|
2291
|
-
objDefineAccessors(CoreUtils, "_canUseCookies", function () {
|
|
2292
|
-
return _canUseCookies;
|
|
2293
|
-
}, function (value) {
|
|
2294
|
-
_canUseCookies = value;
|
|
2295
|
-
arrForEach(_cookieMgrs, function (mgr) {
|
|
2296
|
-
mgr.setEnabled(value);
|
|
2297
|
-
});
|
|
2298
|
-
});
|
|
2299
|
-
}
|
|
2300
|
-
if (arrIndexOf(_cookieMgrs, cookieMgr) === -1) {
|
|
2301
|
-
_cookieMgrs.push(cookieMgr);
|
|
2302
|
-
}
|
|
2303
|
-
if (isBoolean(legacyCanUseCookies)) {
|
|
2304
|
-
cookieMgr.setEnabled(legacyCanUseCookies);
|
|
2305
|
-
}
|
|
2306
|
-
if (isBoolean(_canUseCookies)) {
|
|
2307
|
-
cookieMgr.setEnabled(_canUseCookies);
|
|
2308
|
-
}
|
|
2309
|
-
return cookieMgr;
|
|
2310
|
-
}
|
|
2311
|
-
function disableCookies() {
|
|
2312
|
-
_legacyCookieMgr().setEnabled(false);
|
|
2313
|
-
}
|
|
2314
|
-
function canUseCookies(logger) {
|
|
2315
|
-
return _legacyCookieMgr(null, logger).isEnabled();
|
|
2316
|
-
}
|
|
2317
|
-
function getCookie(logger, name) {
|
|
2318
|
-
return _legacyCookieMgr(null, logger).get(name);
|
|
2319
|
-
}
|
|
2320
|
-
function setCookie(logger, name, value, domain) {
|
|
2321
|
-
_legacyCookieMgr(null, logger).set(name, value, null, domain);
|
|
2322
|
-
}
|
|
2323
|
-
function deleteCookie(logger, name) {
|
|
2324
|
-
return _legacyCookieMgr(null, logger).del(name);
|
|
2325
|
-
}
|
|
2326
|
-
|
|
2327
2327
|
var aiInstrumentHooks = "_aiHooks";
|
|
2328
2328
|
var cbNames = [
|
|
2329
2329
|
"req", "rsp", "hkErr", "fnErr"
|
|
@@ -3900,4 +3900,4 @@ var DebugPlugin = /** @class */ (function (_super) {
|
|
|
3900
3900
|
var DebugPlugin$1 = DebugPlugin;
|
|
3901
3901
|
|
|
3902
3902
|
exports.DebugPlugin = DebugPlugin$1;
|
|
3903
|
-
//# sourceMappingURL=ai.dbg.2.8.4
|
|
3903
|
+
//# sourceMappingURL=ai.dbg.2.8.4.cjs.js.map
|