@pendo/agent 2.320.0 → 2.320.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dom.esm.js +1 -1
- package/dist/pendo.module.js +120 -113
- package/dist/pendo.module.min.js +3 -3
- package/dist/servers.json +7 -7
- package/package.json +1 -1
package/dist/dom.esm.js
CHANGED
|
@@ -7484,7 +7484,7 @@ function applyMatrix2dRect(matrix2d, rect) {
|
|
|
7484
7484
|
return transformedRect;
|
|
7485
7485
|
}
|
|
7486
7486
|
|
|
7487
|
-
var VERSION = '2.320.
|
|
7487
|
+
var VERSION = '2.320.1_';
|
|
7488
7488
|
|
|
7489
7489
|
var decodeURIComponent = _.isFunction(window.decodeURIComponent) ? window.decodeURIComponent : _.identity;
|
|
7490
7490
|
|
package/dist/pendo.module.js
CHANGED
|
@@ -3967,8 +3967,8 @@ let SERVER = '';
|
|
|
3967
3967
|
let ASSET_HOST = '';
|
|
3968
3968
|
let ASSET_PATH = '';
|
|
3969
3969
|
let DESIGNER_SERVER = '';
|
|
3970
|
-
let VERSION = '2.320.
|
|
3971
|
-
let PACKAGE_VERSION = '2.320.
|
|
3970
|
+
let VERSION = '2.320.1_';
|
|
3971
|
+
let PACKAGE_VERSION = '2.320.1';
|
|
3972
3972
|
let LOADER = 'xhr';
|
|
3973
3973
|
/* eslint-enable web-sdk-eslint-rules/no-gulp-env-references */
|
|
3974
3974
|
/**
|
|
@@ -28990,8 +28990,8 @@ const initialize = makeSafe(function (options) {
|
|
|
28990
28990
|
// Register handlers passed through pendo_options
|
|
28991
28991
|
teardownFns.push(forwardInternalEvents(Events));
|
|
28992
28992
|
registerEventHandlers(options);
|
|
28993
|
-
teardownFns.push(initGuides(observer)); // this is safe. loadGuides actually does the loading.
|
|
28994
28993
|
teardownFns.push(initializeCrossFrameChannel(store));
|
|
28994
|
+
teardownFns.push(initGuides(observer)); // this is safe. loadGuides actually does the loading.
|
|
28995
28995
|
teardownFns.push(P2AutoLaunch.loadPluginJs());
|
|
28996
28996
|
teardownFns.push(initIdentityEvents()); // setup identify and meta event listeners
|
|
28997
28997
|
teardownFns.push(wirePage());
|
|
@@ -51583,59 +51583,59 @@ function ConsoleCapture() {
|
|
|
51583
51583
|
}
|
|
51584
51584
|
|
|
51585
51585
|
function NetworkCapture() {
|
|
51586
|
-
|
|
51587
|
-
|
|
51588
|
-
|
|
51589
|
-
|
|
51590
|
-
|
|
51591
|
-
|
|
51592
|
-
|
|
51593
|
-
|
|
51594
|
-
|
|
51595
|
-
|
|
51596
|
-
|
|
51597
|
-
|
|
51598
|
-
|
|
51599
|
-
|
|
51600
|
-
|
|
51601
|
-
|
|
51602
|
-
|
|
51603
|
-
|
|
51604
|
-
|
|
51605
|
-
|
|
51606
|
-
|
|
51607
|
-
|
|
51586
|
+
var pluginAPI;
|
|
51587
|
+
var globalPendo;
|
|
51588
|
+
var requestMap = {};
|
|
51589
|
+
var buffer;
|
|
51590
|
+
var sendQueue;
|
|
51591
|
+
var sendInterval;
|
|
51592
|
+
var transport;
|
|
51593
|
+
var isPtmPaused;
|
|
51594
|
+
var requestBodyCb;
|
|
51595
|
+
var responseBodyCb;
|
|
51596
|
+
var pendoDevlogBaseUrl;
|
|
51597
|
+
var isCapturingNetworkLogs = false;
|
|
51598
|
+
var excludeRequestUrls = [];
|
|
51599
|
+
var CAPTURE_NETWORK_CONFIG = 'captureNetworkRequests';
|
|
51600
|
+
var NETWORK_SUB_TYPE = 'network';
|
|
51601
|
+
var NETWORK_LOGS_CONFIG = 'networkLogs';
|
|
51602
|
+
var NETWORK_LOGS_CONFIG_ALLOWED_REQUEST_HEADERS = 'networkLogs.allowedRequestHeaders';
|
|
51603
|
+
var NETWORK_LOGS_CONFIG_ALLOWED_RESPONSE_HEADERS = 'networkLogs.allowedResponseHeaders';
|
|
51604
|
+
var NETWORK_LOGS_CONFIG_CAPTURE_REQUEST_BODY = 'networkLogs.captureRequestBody';
|
|
51605
|
+
var NETWORK_LOGS_CONFIG_CAPTURE_RESPONSE_BODY = 'networkLogs.captureResponseBody';
|
|
51606
|
+
var NETWORK_LOGS_CONFIG_EXCLUDE_REQUEST_URLS = 'networkLogs.excludeRequestUrls';
|
|
51607
|
+
var allowedRequestHeaders = {
|
|
51608
51608
|
'content-type': true, 'content-length': true, 'accept': true, 'accept-language': true
|
|
51609
51609
|
};
|
|
51610
|
-
|
|
51610
|
+
var allowedResponseHeaders = {
|
|
51611
51611
|
'cache-control': true, 'content-length': true, 'content-type': true, 'content-language': true
|
|
51612
51612
|
};
|
|
51613
51613
|
return {
|
|
51614
51614
|
name: 'NetworkCapture',
|
|
51615
|
-
initialize,
|
|
51616
|
-
teardown,
|
|
51617
|
-
handleRequest,
|
|
51618
|
-
handleResponse,
|
|
51619
|
-
handleError,
|
|
51620
|
-
startCapture,
|
|
51621
|
-
createNetworkEvent,
|
|
51622
|
-
send,
|
|
51623
|
-
onPtmPaused,
|
|
51624
|
-
onPtmUnpaused,
|
|
51625
|
-
onAppHidden,
|
|
51626
|
-
onAppUnloaded,
|
|
51627
|
-
setCaptureState,
|
|
51628
|
-
recordingStarted,
|
|
51629
|
-
recordingStopped,
|
|
51630
|
-
addConfigOptions,
|
|
51631
|
-
processHeaderConfig,
|
|
51632
|
-
extractHeaders,
|
|
51633
|
-
setupBodyCallbacks,
|
|
51634
|
-
processBody,
|
|
51635
|
-
processRequestBody,
|
|
51636
|
-
processResponseBody,
|
|
51637
|
-
buildExcludeRequestUrls,
|
|
51638
|
-
isUrlExcluded,
|
|
51615
|
+
initialize: initialize,
|
|
51616
|
+
teardown: teardown,
|
|
51617
|
+
handleRequest: handleRequest,
|
|
51618
|
+
handleResponse: handleResponse,
|
|
51619
|
+
handleError: handleError,
|
|
51620
|
+
startCapture: startCapture,
|
|
51621
|
+
createNetworkEvent: createNetworkEvent,
|
|
51622
|
+
send: send,
|
|
51623
|
+
onPtmPaused: onPtmPaused,
|
|
51624
|
+
onPtmUnpaused: onPtmUnpaused,
|
|
51625
|
+
onAppHidden: onAppHidden,
|
|
51626
|
+
onAppUnloaded: onAppUnloaded,
|
|
51627
|
+
setCaptureState: setCaptureState,
|
|
51628
|
+
recordingStarted: recordingStarted,
|
|
51629
|
+
recordingStopped: recordingStopped,
|
|
51630
|
+
addConfigOptions: addConfigOptions,
|
|
51631
|
+
processHeaderConfig: processHeaderConfig,
|
|
51632
|
+
extractHeaders: extractHeaders,
|
|
51633
|
+
setupBodyCallbacks: setupBodyCallbacks,
|
|
51634
|
+
processBody: processBody,
|
|
51635
|
+
processRequestBody: processRequestBody,
|
|
51636
|
+
processResponseBody: processResponseBody,
|
|
51637
|
+
buildExcludeRequestUrls: buildExcludeRequestUrls,
|
|
51638
|
+
isUrlExcluded: isUrlExcluded,
|
|
51639
51639
|
get isCapturingNetworkLogs() {
|
|
51640
51640
|
return isCapturingNetworkLogs;
|
|
51641
51641
|
},
|
|
@@ -51670,9 +51670,9 @@ function NetworkCapture() {
|
|
|
51670
51670
|
function initialize(pendo, PluginAPI) {
|
|
51671
51671
|
pluginAPI = PluginAPI;
|
|
51672
51672
|
globalPendo = pendo;
|
|
51673
|
-
|
|
51673
|
+
var ConfigReader = pluginAPI.ConfigReader;
|
|
51674
51674
|
ConfigReader.addOption(CAPTURE_NETWORK_CONFIG, [ConfigReader.sources.PENDO_CONFIG_SRC], false);
|
|
51675
|
-
|
|
51675
|
+
var captureNetworkEnabled = ConfigReader.get(CAPTURE_NETWORK_CONFIG);
|
|
51676
51676
|
if (!captureNetworkEnabled)
|
|
51677
51677
|
return;
|
|
51678
51678
|
buffer = new DevlogBuffer(pendo, pluginAPI);
|
|
@@ -51683,7 +51683,7 @@ function NetworkCapture() {
|
|
|
51683
51683
|
processHeaderConfig(NETWORK_LOGS_CONFIG_ALLOWED_RESPONSE_HEADERS, allowedResponseHeaders);
|
|
51684
51684
|
setupBodyCallbacks();
|
|
51685
51685
|
buildExcludeRequestUrls();
|
|
51686
|
-
sendInterval = setInterval(()
|
|
51686
|
+
sendInterval = setInterval(function () {
|
|
51687
51687
|
if (!sendQueue.failed()) {
|
|
51688
51688
|
send();
|
|
51689
51689
|
}
|
|
@@ -51699,7 +51699,7 @@ function NetworkCapture() {
|
|
|
51699
51699
|
pendoDevlogBaseUrl = pluginAPI.transmit.buildBaseDataUrl(DEV_LOG_TYPE, globalPendo.apiKey);
|
|
51700
51700
|
}
|
|
51701
51701
|
function addConfigOptions() {
|
|
51702
|
-
|
|
51702
|
+
var ConfigReader = pluginAPI.ConfigReader;
|
|
51703
51703
|
ConfigReader.addOption(NETWORK_LOGS_CONFIG, [ConfigReader.sources.SNIPPET_SRC], {});
|
|
51704
51704
|
/**
|
|
51705
51705
|
* Additional request headers to capture in network logs.
|
|
@@ -51758,17 +51758,17 @@ function NetworkCapture() {
|
|
|
51758
51758
|
ConfigReader.addOption(NETWORK_LOGS_CONFIG_EXCLUDE_REQUEST_URLS, [ConfigReader.sources.SNIPPET_SRC], []);
|
|
51759
51759
|
}
|
|
51760
51760
|
function processHeaderConfig(configHeaderName, targetHeaders) {
|
|
51761
|
-
|
|
51761
|
+
var configHeaders = pluginAPI.ConfigReader.get(configHeaderName);
|
|
51762
51762
|
if (!configHeaders || configHeaders.length === 0)
|
|
51763
51763
|
return;
|
|
51764
|
-
globalPendo._.each(configHeaders, (header)
|
|
51764
|
+
globalPendo._.each(configHeaders, function (header) {
|
|
51765
51765
|
if (!header || !globalPendo._.isString(header))
|
|
51766
51766
|
return;
|
|
51767
51767
|
targetHeaders[header.toLowerCase()] = true;
|
|
51768
51768
|
});
|
|
51769
51769
|
}
|
|
51770
51770
|
function setupBodyCallbacks() {
|
|
51771
|
-
|
|
51771
|
+
var config = pluginAPI.ConfigReader.get(NETWORK_LOGS_CONFIG);
|
|
51772
51772
|
if (!config)
|
|
51773
51773
|
return;
|
|
51774
51774
|
if (globalPendo._.isFunction(config.captureRequestBody)) {
|
|
@@ -51779,11 +51779,11 @@ function NetworkCapture() {
|
|
|
51779
51779
|
}
|
|
51780
51780
|
}
|
|
51781
51781
|
function buildExcludeRequestUrls() {
|
|
51782
|
-
|
|
51782
|
+
var requestUrls = pluginAPI.ConfigReader.get(NETWORK_LOGS_CONFIG_EXCLUDE_REQUEST_URLS);
|
|
51783
51783
|
if (!requestUrls || requestUrls.length === 0)
|
|
51784
51784
|
return;
|
|
51785
|
-
globalPendo._.each(requestUrls, (requestUrl)
|
|
51786
|
-
|
|
51785
|
+
globalPendo._.each(requestUrls, function (requestUrl) {
|
|
51786
|
+
var processedRequestUrl = processUrlPattern(requestUrl);
|
|
51787
51787
|
if (!processedRequestUrl)
|
|
51788
51788
|
return;
|
|
51789
51789
|
excludeRequestUrls.push(processedRequestUrl);
|
|
@@ -51792,13 +51792,13 @@ function NetworkCapture() {
|
|
|
51792
51792
|
function processUrlPattern(url) {
|
|
51793
51793
|
if (!url)
|
|
51794
51794
|
return;
|
|
51795
|
-
|
|
51795
|
+
var isRegex = globalPendo._.isRegExp(url);
|
|
51796
51796
|
if (!globalPendo._.isString(url) && !isRegex)
|
|
51797
51797
|
return;
|
|
51798
51798
|
if (isRegex)
|
|
51799
51799
|
return url;
|
|
51800
|
-
|
|
51801
|
-
return new RegExp(
|
|
51800
|
+
var escapedUrl = pluginAPI.util.escapeRegExp(url);
|
|
51801
|
+
return new RegExp("^".concat(escapedUrl, "$"));
|
|
51802
51802
|
}
|
|
51803
51803
|
function onPtmPaused() {
|
|
51804
51804
|
isPtmPaused = true;
|
|
@@ -51806,8 +51806,9 @@ function NetworkCapture() {
|
|
|
51806
51806
|
function onPtmUnpaused() {
|
|
51807
51807
|
isPtmPaused = false;
|
|
51808
51808
|
if (!buffer.isEmpty()) {
|
|
51809
|
-
for (
|
|
51810
|
-
|
|
51809
|
+
for (var _i = 0, _a = buffer.events; _i < _a.length; _i++) {
|
|
51810
|
+
var event_1 = _a[_i];
|
|
51811
|
+
pluginAPI.Events.eventCaptured.trigger(event_1);
|
|
51811
51812
|
}
|
|
51812
51813
|
send();
|
|
51813
51814
|
}
|
|
@@ -51818,11 +51819,12 @@ function NetworkCapture() {
|
|
|
51818
51819
|
function onAppUnloaded() {
|
|
51819
51820
|
send({ unload: true });
|
|
51820
51821
|
}
|
|
51821
|
-
function setCaptureState(
|
|
51822
|
+
function setCaptureState(_a) {
|
|
51823
|
+
var _b = _a === void 0 ? {} : _a, _c = _b.shouldCapture, shouldCapture = _c === void 0 ? false : _c, _d = _b.reason, reason = _d === void 0 ? '' : _d;
|
|
51822
51824
|
if (shouldCapture === isCapturingNetworkLogs)
|
|
51823
51825
|
return;
|
|
51824
51826
|
isCapturingNetworkLogs = shouldCapture;
|
|
51825
|
-
pluginAPI.log.info(
|
|
51827
|
+
pluginAPI.log.info("[NetworkCapture] Network request capture ".concat(shouldCapture ? 'started' : 'stopped').concat(reason ? ": ".concat(reason) : ''));
|
|
51826
51828
|
}
|
|
51827
51829
|
function recordingStarted() {
|
|
51828
51830
|
return setCaptureState({ shouldCapture: true, reason: 'recording started' });
|
|
@@ -51857,7 +51859,7 @@ function NetworkCapture() {
|
|
|
51857
51859
|
return false;
|
|
51858
51860
|
if (excludeRequestUrls.length === 0)
|
|
51859
51861
|
return false;
|
|
51860
|
-
return globalPendo._.some(excludeRequestUrls, (excludeRequestUrl)
|
|
51862
|
+
return globalPendo._.some(excludeRequestUrls, function (excludeRequestUrl) {
|
|
51861
51863
|
return excludeRequestUrl.test(url);
|
|
51862
51864
|
});
|
|
51863
51865
|
}
|
|
@@ -51871,7 +51873,7 @@ function NetworkCapture() {
|
|
|
51871
51873
|
return;
|
|
51872
51874
|
if (!response)
|
|
51873
51875
|
return;
|
|
51874
|
-
|
|
51876
|
+
var request = requestMap[response.requestId];
|
|
51875
51877
|
if (!request)
|
|
51876
51878
|
return;
|
|
51877
51879
|
// Skip capturing successful devlog events to avoid infinite loops
|
|
@@ -51883,9 +51885,9 @@ function NetworkCapture() {
|
|
|
51883
51885
|
delete requestMap[response.requestId];
|
|
51884
51886
|
return;
|
|
51885
51887
|
}
|
|
51886
|
-
|
|
51887
|
-
request,
|
|
51888
|
-
response
|
|
51888
|
+
var networkEvent = createNetworkEvent({
|
|
51889
|
+
request: request,
|
|
51890
|
+
response: response
|
|
51889
51891
|
});
|
|
51890
51892
|
if (!isPtmPaused) {
|
|
51891
51893
|
pluginAPI.Events.eventCaptured.trigger(networkEvent);
|
|
@@ -51893,7 +51895,8 @@ function NetworkCapture() {
|
|
|
51893
51895
|
buffer.push(networkEvent);
|
|
51894
51896
|
delete requestMap[response.requestId];
|
|
51895
51897
|
}
|
|
51896
|
-
function handleError(
|
|
51898
|
+
function handleError(_a) {
|
|
51899
|
+
var error = _a.error, context = _a.context;
|
|
51897
51900
|
if (!isCapturingNetworkLogs)
|
|
51898
51901
|
return;
|
|
51899
51902
|
if (error.requestId && requestMap[error.requestId]) {
|
|
@@ -51907,13 +51910,13 @@ function NetworkCapture() {
|
|
|
51907
51910
|
}
|
|
51908
51911
|
}
|
|
51909
51912
|
function extractHeaders(headers, allowedHeaders) {
|
|
51910
|
-
|
|
51913
|
+
var _a = globalPendo._, keys = _a.keys, reduce = _a.reduce;
|
|
51911
51914
|
if (!headers || !allowedHeaders)
|
|
51912
51915
|
return [];
|
|
51913
|
-
return reduce(keys(headers), (acc, key)
|
|
51914
|
-
|
|
51916
|
+
return reduce(keys(headers), function (acc, key) {
|
|
51917
|
+
var normalizedKey = key.toLowerCase();
|
|
51915
51918
|
if (allowedHeaders[normalizedKey]) {
|
|
51916
|
-
acc.push(
|
|
51919
|
+
acc.push("".concat(key, ": ").concat(headers[key]));
|
|
51917
51920
|
}
|
|
51918
51921
|
return acc;
|
|
51919
51922
|
}, []);
|
|
@@ -51921,15 +51924,16 @@ function NetworkCapture() {
|
|
|
51921
51924
|
function processBody(body, contentType) {
|
|
51922
51925
|
if (!body || !globalPendo._.isString(body))
|
|
51923
51926
|
return '';
|
|
51924
|
-
|
|
51927
|
+
var processedBody = maskSensitiveFields({ string: body, contentType: contentType, _: globalPendo._ });
|
|
51925
51928
|
return truncate(processedBody, true);
|
|
51926
51929
|
}
|
|
51927
|
-
function processRequestBody(
|
|
51930
|
+
function processRequestBody(_a) {
|
|
51931
|
+
var request = _a.request;
|
|
51928
51932
|
if (!request || !request.body || !requestBodyCb)
|
|
51929
51933
|
return '';
|
|
51930
51934
|
try {
|
|
51931
|
-
|
|
51932
|
-
|
|
51935
|
+
var body = requestBodyCb(request.body, { request: request });
|
|
51936
|
+
var contentType = globalPendo._.get(request, 'headers.content-type', '');
|
|
51933
51937
|
return processBody(body, contentType);
|
|
51934
51938
|
}
|
|
51935
51939
|
catch (error) {
|
|
@@ -51937,12 +51941,13 @@ function NetworkCapture() {
|
|
|
51937
51941
|
return '[Failed to process request body]';
|
|
51938
51942
|
}
|
|
51939
51943
|
}
|
|
51940
|
-
function processResponseBody(
|
|
51944
|
+
function processResponseBody(_a) {
|
|
51945
|
+
var response = _a.response;
|
|
51941
51946
|
if (!response || !response.body || !responseBodyCb)
|
|
51942
51947
|
return '';
|
|
51943
51948
|
try {
|
|
51944
|
-
|
|
51945
|
-
|
|
51949
|
+
var body = responseBodyCb(response.body, { response: response });
|
|
51950
|
+
var contentType = globalPendo._.get(response, 'headers.content-type', '');
|
|
51946
51951
|
return processBody(body, contentType);
|
|
51947
51952
|
}
|
|
51948
51953
|
catch (error) {
|
|
@@ -51950,32 +51955,34 @@ function NetworkCapture() {
|
|
|
51950
51955
|
return '[Failed to process response body]';
|
|
51951
51956
|
}
|
|
51952
51957
|
}
|
|
51953
|
-
function createNetworkEvent(
|
|
51954
|
-
|
|
51955
|
-
|
|
51956
|
-
|
|
51957
|
-
|
|
51958
|
+
function createNetworkEvent(_a) {
|
|
51959
|
+
var request = _a.request, response = _a.response;
|
|
51960
|
+
var devLogEnvelope = createDevLogEnvelope(pluginAPI, globalPendo);
|
|
51961
|
+
var requestHeaders = extractHeaders(request.headers, allowedRequestHeaders);
|
|
51962
|
+
var responseHeaders = extractHeaders(response.headers, allowedResponseHeaders);
|
|
51963
|
+
var networkEvent = __assign(__assign({}, devLogEnvelope), { subType: NETWORK_SUB_TYPE, devLogMethod: request.method, devLogStatusCode: response.status, devLogRequestUrl: request.url, devLogRequestHeaders: requestHeaders, devLogResponseHeaders: responseHeaders, devLogCount: 1 });
|
|
51958
51964
|
if (requestBodyCb) {
|
|
51959
|
-
networkEvent.devLogRequestBody = processRequestBody({ request });
|
|
51965
|
+
networkEvent.devLogRequestBody = processRequestBody({ request: request });
|
|
51960
51966
|
}
|
|
51961
51967
|
if (responseBodyCb) {
|
|
51962
|
-
networkEvent.devLogResponseBody = processResponseBody({ response });
|
|
51968
|
+
networkEvent.devLogResponseBody = processResponseBody({ response: response });
|
|
51963
51969
|
}
|
|
51964
51970
|
return networkEvent;
|
|
51965
51971
|
}
|
|
51966
|
-
function send(
|
|
51972
|
+
function send(_a) {
|
|
51973
|
+
var _b = _a === void 0 ? {} : _a, _c = _b.unload, unload = _c === void 0 ? false : _c, _d = _b.hidden, hidden = _d === void 0 ? false : _d;
|
|
51967
51974
|
if (!buffer || buffer.isEmpty())
|
|
51968
51975
|
return;
|
|
51969
51976
|
if (!globalPendo.isSendingEvents()) {
|
|
51970
51977
|
buffer.clear();
|
|
51971
51978
|
return;
|
|
51972
51979
|
}
|
|
51973
|
-
|
|
51980
|
+
var payloads = buffer.pack();
|
|
51974
51981
|
if (unload || hidden) {
|
|
51975
51982
|
sendQueue.drain(payloads, unload);
|
|
51976
51983
|
}
|
|
51977
51984
|
else {
|
|
51978
|
-
sendQueue.push(
|
|
51985
|
+
sendQueue.push.apply(sendQueue, payloads);
|
|
51979
51986
|
}
|
|
51980
51987
|
}
|
|
51981
51988
|
}
|
|
@@ -52309,13 +52316,13 @@ var predictGuidesScript = function (_a) {
|
|
|
52309
52316
|
cleanupArray.push(createFloatingModal({ recordId: recordId, configuration: configuration }));
|
|
52310
52317
|
};
|
|
52311
52318
|
|
|
52312
|
-
|
|
52313
|
-
|
|
52314
|
-
|
|
52315
|
-
|
|
52319
|
+
var PredictGuides = function () {
|
|
52320
|
+
var pluginApiRef = null;
|
|
52321
|
+
var cleanupArray = [];
|
|
52322
|
+
var cleanup = function () {
|
|
52316
52323
|
var _a;
|
|
52317
52324
|
(_a = pluginApiRef === null || pluginApiRef === void 0 ? void 0 : pluginApiRef.log) === null || _a === void 0 ? void 0 : _a.debug('[predict] cleaning up');
|
|
52318
|
-
for (
|
|
52325
|
+
for (var i = 0; i < cleanupArray.length; i++) {
|
|
52319
52326
|
try {
|
|
52320
52327
|
cleanupArray[i]();
|
|
52321
52328
|
}
|
|
@@ -52323,44 +52330,44 @@ const PredictGuides = () => {
|
|
|
52323
52330
|
}
|
|
52324
52331
|
cleanupArray = [];
|
|
52325
52332
|
};
|
|
52326
|
-
|
|
52333
|
+
var initialize = function (_pendo, PluginAPI) {
|
|
52327
52334
|
pluginApiRef = PluginAPI;
|
|
52328
|
-
|
|
52329
|
-
|
|
52335
|
+
var configReader = PluginAPI.ConfigReader;
|
|
52336
|
+
var PREDICT_GUIDES_CONFIG = 'predictGuides';
|
|
52330
52337
|
configReader.addOption(PREDICT_GUIDES_CONFIG, [
|
|
52331
52338
|
configReader.sources.SNIPPET_SRC,
|
|
52332
52339
|
configReader.sources.PENDO_CONFIG_SRC
|
|
52333
52340
|
], false);
|
|
52334
|
-
|
|
52341
|
+
var predictGuidesEnabled = configReader.get(PREDICT_GUIDES_CONFIG);
|
|
52335
52342
|
if (!predictGuidesEnabled)
|
|
52336
52343
|
return;
|
|
52337
|
-
|
|
52344
|
+
var log = PluginAPI.log.debug.bind(PluginAPI.log);
|
|
52338
52345
|
pluginApiRef.Events.urlChanged.on(cleanup);
|
|
52339
|
-
|
|
52346
|
+
var script = {
|
|
52340
52347
|
name: 'PredictFrameScript',
|
|
52341
|
-
script(step, _guide, pendo) {
|
|
52342
|
-
predictGuidesScript({ step, pendo, cleanupArray, cleanup, log });
|
|
52343
|
-
this.on('unmounted', (evt)
|
|
52348
|
+
script: function (step, _guide, pendo) {
|
|
52349
|
+
predictGuidesScript({ step: step, pendo: pendo, cleanupArray: cleanupArray, cleanup: cleanup, log: log });
|
|
52350
|
+
this.on('unmounted', function (evt) {
|
|
52344
52351
|
if (evt.reason !== 'hidden')
|
|
52345
52352
|
cleanup();
|
|
52346
52353
|
});
|
|
52347
52354
|
},
|
|
52348
|
-
test(step, _guide) {
|
|
52349
|
-
|
|
52355
|
+
test: function (step, _guide) {
|
|
52356
|
+
var stepName = step.name || '';
|
|
52350
52357
|
return PREDICT_STEP_REGEX.test(stepName);
|
|
52351
52358
|
}
|
|
52352
52359
|
};
|
|
52353
52360
|
pluginApiRef.GlobalRuntime.addGlobalScript(script);
|
|
52354
52361
|
};
|
|
52355
|
-
|
|
52362
|
+
var teardown = function () {
|
|
52356
52363
|
var _a, _b;
|
|
52357
52364
|
cleanup();
|
|
52358
52365
|
(_b = (_a = pluginApiRef === null || pluginApiRef === void 0 ? void 0 : pluginApiRef.Events) === null || _a === void 0 ? void 0 : _a.urlChanged) === null || _b === void 0 ? void 0 : _b.off(cleanup);
|
|
52359
52366
|
};
|
|
52360
52367
|
return {
|
|
52361
52368
|
name: 'PredictGuides',
|
|
52362
|
-
initialize,
|
|
52363
|
-
teardown
|
|
52369
|
+
initialize: initialize,
|
|
52370
|
+
teardown: teardown
|
|
52364
52371
|
};
|
|
52365
52372
|
};
|
|
52366
52373
|
|