@pendo/agent 2.320.2 → 2.320.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/dist/dom.esm.js +1 -1
- package/dist/pendo.module.js +112 -119
- package/dist/pendo.module.min.js +2 -2
- 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.4_';
|
|
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.4_';
|
|
3971
|
+
let PACKAGE_VERSION = '2.320.4';
|
|
3972
3972
|
let LOADER = 'xhr';
|
|
3973
3973
|
/* eslint-enable web-sdk-eslint-rules/no-gulp-env-references */
|
|
3974
3974
|
/**
|
|
@@ -51525,59 +51525,59 @@ function ConsoleCapture() {
|
|
|
51525
51525
|
}
|
|
51526
51526
|
|
|
51527
51527
|
function NetworkCapture() {
|
|
51528
|
-
|
|
51529
|
-
|
|
51530
|
-
|
|
51531
|
-
|
|
51532
|
-
|
|
51533
|
-
|
|
51534
|
-
|
|
51535
|
-
|
|
51536
|
-
|
|
51537
|
-
|
|
51538
|
-
|
|
51539
|
-
|
|
51540
|
-
|
|
51541
|
-
|
|
51542
|
-
|
|
51543
|
-
|
|
51544
|
-
|
|
51545
|
-
|
|
51546
|
-
|
|
51547
|
-
|
|
51548
|
-
|
|
51549
|
-
|
|
51528
|
+
let pluginAPI;
|
|
51529
|
+
let globalPendo;
|
|
51530
|
+
let requestMap = {};
|
|
51531
|
+
let buffer;
|
|
51532
|
+
let sendQueue;
|
|
51533
|
+
let sendInterval;
|
|
51534
|
+
let transport;
|
|
51535
|
+
let isPtmPaused;
|
|
51536
|
+
let requestBodyCb;
|
|
51537
|
+
let responseBodyCb;
|
|
51538
|
+
let pendoDevlogBaseUrl;
|
|
51539
|
+
let isCapturingNetworkLogs = false;
|
|
51540
|
+
let excludeRequestUrls = [];
|
|
51541
|
+
const CAPTURE_NETWORK_CONFIG = 'captureNetworkRequests';
|
|
51542
|
+
const NETWORK_SUB_TYPE = 'network';
|
|
51543
|
+
const NETWORK_LOGS_CONFIG = 'networkLogs';
|
|
51544
|
+
const NETWORK_LOGS_CONFIG_ALLOWED_REQUEST_HEADERS = 'networkLogs.allowedRequestHeaders';
|
|
51545
|
+
const NETWORK_LOGS_CONFIG_ALLOWED_RESPONSE_HEADERS = 'networkLogs.allowedResponseHeaders';
|
|
51546
|
+
const NETWORK_LOGS_CONFIG_CAPTURE_REQUEST_BODY = 'networkLogs.captureRequestBody';
|
|
51547
|
+
const NETWORK_LOGS_CONFIG_CAPTURE_RESPONSE_BODY = 'networkLogs.captureResponseBody';
|
|
51548
|
+
const NETWORK_LOGS_CONFIG_EXCLUDE_REQUEST_URLS = 'networkLogs.excludeRequestUrls';
|
|
51549
|
+
const allowedRequestHeaders = {
|
|
51550
51550
|
'content-type': true, 'content-length': true, 'accept': true, 'accept-language': true
|
|
51551
51551
|
};
|
|
51552
|
-
|
|
51552
|
+
const allowedResponseHeaders = {
|
|
51553
51553
|
'cache-control': true, 'content-length': true, 'content-type': true, 'content-language': true
|
|
51554
51554
|
};
|
|
51555
51555
|
return {
|
|
51556
51556
|
name: 'NetworkCapture',
|
|
51557
|
-
initialize
|
|
51558
|
-
teardown
|
|
51559
|
-
handleRequest
|
|
51560
|
-
handleResponse
|
|
51561
|
-
handleError
|
|
51562
|
-
startCapture
|
|
51563
|
-
createNetworkEvent
|
|
51564
|
-
send
|
|
51565
|
-
onPtmPaused
|
|
51566
|
-
onPtmUnpaused
|
|
51567
|
-
onAppHidden
|
|
51568
|
-
onAppUnloaded
|
|
51569
|
-
setCaptureState
|
|
51570
|
-
recordingStarted
|
|
51571
|
-
recordingStopped
|
|
51572
|
-
addConfigOptions
|
|
51573
|
-
processHeaderConfig
|
|
51574
|
-
extractHeaders
|
|
51575
|
-
setupBodyCallbacks
|
|
51576
|
-
processBody
|
|
51577
|
-
processRequestBody
|
|
51578
|
-
processResponseBody
|
|
51579
|
-
buildExcludeRequestUrls
|
|
51580
|
-
isUrlExcluded
|
|
51557
|
+
initialize,
|
|
51558
|
+
teardown,
|
|
51559
|
+
handleRequest,
|
|
51560
|
+
handleResponse,
|
|
51561
|
+
handleError,
|
|
51562
|
+
startCapture,
|
|
51563
|
+
createNetworkEvent,
|
|
51564
|
+
send,
|
|
51565
|
+
onPtmPaused,
|
|
51566
|
+
onPtmUnpaused,
|
|
51567
|
+
onAppHidden,
|
|
51568
|
+
onAppUnloaded,
|
|
51569
|
+
setCaptureState,
|
|
51570
|
+
recordingStarted,
|
|
51571
|
+
recordingStopped,
|
|
51572
|
+
addConfigOptions,
|
|
51573
|
+
processHeaderConfig,
|
|
51574
|
+
extractHeaders,
|
|
51575
|
+
setupBodyCallbacks,
|
|
51576
|
+
processBody,
|
|
51577
|
+
processRequestBody,
|
|
51578
|
+
processResponseBody,
|
|
51579
|
+
buildExcludeRequestUrls,
|
|
51580
|
+
isUrlExcluded,
|
|
51581
51581
|
get isCapturingNetworkLogs() {
|
|
51582
51582
|
return isCapturingNetworkLogs;
|
|
51583
51583
|
},
|
|
@@ -51612,9 +51612,9 @@ function NetworkCapture() {
|
|
|
51612
51612
|
function initialize(pendo, PluginAPI) {
|
|
51613
51613
|
pluginAPI = PluginAPI;
|
|
51614
51614
|
globalPendo = pendo;
|
|
51615
|
-
|
|
51615
|
+
const { ConfigReader } = pluginAPI;
|
|
51616
51616
|
ConfigReader.addOption(CAPTURE_NETWORK_CONFIG, [ConfigReader.sources.PENDO_CONFIG_SRC], false);
|
|
51617
|
-
|
|
51617
|
+
const captureNetworkEnabled = ConfigReader.get(CAPTURE_NETWORK_CONFIG);
|
|
51618
51618
|
if (!captureNetworkEnabled)
|
|
51619
51619
|
return;
|
|
51620
51620
|
buffer = new DevlogBuffer(pendo, pluginAPI);
|
|
@@ -51625,7 +51625,7 @@ function NetworkCapture() {
|
|
|
51625
51625
|
processHeaderConfig(NETWORK_LOGS_CONFIG_ALLOWED_RESPONSE_HEADERS, allowedResponseHeaders);
|
|
51626
51626
|
setupBodyCallbacks();
|
|
51627
51627
|
buildExcludeRequestUrls();
|
|
51628
|
-
sendInterval = setInterval(
|
|
51628
|
+
sendInterval = setInterval(() => {
|
|
51629
51629
|
if (!sendQueue.failed()) {
|
|
51630
51630
|
send();
|
|
51631
51631
|
}
|
|
@@ -51641,7 +51641,7 @@ function NetworkCapture() {
|
|
|
51641
51641
|
pendoDevlogBaseUrl = pluginAPI.transmit.buildBaseDataUrl(DEV_LOG_TYPE, globalPendo.apiKey);
|
|
51642
51642
|
}
|
|
51643
51643
|
function addConfigOptions() {
|
|
51644
|
-
|
|
51644
|
+
const { ConfigReader } = pluginAPI;
|
|
51645
51645
|
ConfigReader.addOption(NETWORK_LOGS_CONFIG, [ConfigReader.sources.SNIPPET_SRC], {});
|
|
51646
51646
|
/**
|
|
51647
51647
|
* Additional request headers to capture in network logs.
|
|
@@ -51700,17 +51700,17 @@ function NetworkCapture() {
|
|
|
51700
51700
|
ConfigReader.addOption(NETWORK_LOGS_CONFIG_EXCLUDE_REQUEST_URLS, [ConfigReader.sources.SNIPPET_SRC], []);
|
|
51701
51701
|
}
|
|
51702
51702
|
function processHeaderConfig(configHeaderName, targetHeaders) {
|
|
51703
|
-
|
|
51703
|
+
const configHeaders = pluginAPI.ConfigReader.get(configHeaderName);
|
|
51704
51704
|
if (!configHeaders || configHeaders.length === 0)
|
|
51705
51705
|
return;
|
|
51706
|
-
globalPendo._.each(configHeaders,
|
|
51706
|
+
globalPendo._.each(configHeaders, (header) => {
|
|
51707
51707
|
if (!header || !globalPendo._.isString(header))
|
|
51708
51708
|
return;
|
|
51709
51709
|
targetHeaders[header.toLowerCase()] = true;
|
|
51710
51710
|
});
|
|
51711
51711
|
}
|
|
51712
51712
|
function setupBodyCallbacks() {
|
|
51713
|
-
|
|
51713
|
+
const config = pluginAPI.ConfigReader.get(NETWORK_LOGS_CONFIG);
|
|
51714
51714
|
if (!config)
|
|
51715
51715
|
return;
|
|
51716
51716
|
if (globalPendo._.isFunction(config.captureRequestBody)) {
|
|
@@ -51721,11 +51721,11 @@ function NetworkCapture() {
|
|
|
51721
51721
|
}
|
|
51722
51722
|
}
|
|
51723
51723
|
function buildExcludeRequestUrls() {
|
|
51724
|
-
|
|
51724
|
+
const requestUrls = pluginAPI.ConfigReader.get(NETWORK_LOGS_CONFIG_EXCLUDE_REQUEST_URLS);
|
|
51725
51725
|
if (!requestUrls || requestUrls.length === 0)
|
|
51726
51726
|
return;
|
|
51727
|
-
globalPendo._.each(requestUrls,
|
|
51728
|
-
|
|
51727
|
+
globalPendo._.each(requestUrls, (requestUrl) => {
|
|
51728
|
+
const processedRequestUrl = processUrlPattern(requestUrl);
|
|
51729
51729
|
if (!processedRequestUrl)
|
|
51730
51730
|
return;
|
|
51731
51731
|
excludeRequestUrls.push(processedRequestUrl);
|
|
@@ -51734,13 +51734,13 @@ function NetworkCapture() {
|
|
|
51734
51734
|
function processUrlPattern(url) {
|
|
51735
51735
|
if (!url)
|
|
51736
51736
|
return;
|
|
51737
|
-
|
|
51737
|
+
const isRegex = globalPendo._.isRegExp(url);
|
|
51738
51738
|
if (!globalPendo._.isString(url) && !isRegex)
|
|
51739
51739
|
return;
|
|
51740
51740
|
if (isRegex)
|
|
51741
51741
|
return url;
|
|
51742
|
-
|
|
51743
|
-
return new RegExp(
|
|
51742
|
+
const escapedUrl = pluginAPI.util.escapeRegExp(url);
|
|
51743
|
+
return new RegExp(`^${escapedUrl}$`);
|
|
51744
51744
|
}
|
|
51745
51745
|
function onPtmPaused() {
|
|
51746
51746
|
isPtmPaused = true;
|
|
@@ -51748,9 +51748,8 @@ function NetworkCapture() {
|
|
|
51748
51748
|
function onPtmUnpaused() {
|
|
51749
51749
|
isPtmPaused = false;
|
|
51750
51750
|
if (!buffer.isEmpty()) {
|
|
51751
|
-
for (
|
|
51752
|
-
|
|
51753
|
-
pluginAPI.Events.eventCaptured.trigger(event_1);
|
|
51751
|
+
for (const event of buffer.events) {
|
|
51752
|
+
pluginAPI.Events.eventCaptured.trigger(event);
|
|
51754
51753
|
}
|
|
51755
51754
|
send();
|
|
51756
51755
|
}
|
|
@@ -51761,12 +51760,11 @@ function NetworkCapture() {
|
|
|
51761
51760
|
function onAppUnloaded() {
|
|
51762
51761
|
send({ unload: true });
|
|
51763
51762
|
}
|
|
51764
|
-
function setCaptureState(
|
|
51765
|
-
var _b = _a === void 0 ? {} : _a, _c = _b.shouldCapture, shouldCapture = _c === void 0 ? false : _c, _d = _b.reason, reason = _d === void 0 ? '' : _d;
|
|
51763
|
+
function setCaptureState({ shouldCapture = false, reason = '' } = {}) {
|
|
51766
51764
|
if (shouldCapture === isCapturingNetworkLogs)
|
|
51767
51765
|
return;
|
|
51768
51766
|
isCapturingNetworkLogs = shouldCapture;
|
|
51769
|
-
pluginAPI.log.info(
|
|
51767
|
+
pluginAPI.log.info(`[NetworkCapture] Network request capture ${shouldCapture ? 'started' : 'stopped'}${reason ? `: ${reason}` : ''}`);
|
|
51770
51768
|
}
|
|
51771
51769
|
function recordingStarted() {
|
|
51772
51770
|
return setCaptureState({ shouldCapture: true, reason: 'recording started' });
|
|
@@ -51801,7 +51799,7 @@ function NetworkCapture() {
|
|
|
51801
51799
|
return false;
|
|
51802
51800
|
if (excludeRequestUrls.length === 0)
|
|
51803
51801
|
return false;
|
|
51804
|
-
return globalPendo._.some(excludeRequestUrls,
|
|
51802
|
+
return globalPendo._.some(excludeRequestUrls, (excludeRequestUrl) => {
|
|
51805
51803
|
return excludeRequestUrl.test(url);
|
|
51806
51804
|
});
|
|
51807
51805
|
}
|
|
@@ -51815,7 +51813,7 @@ function NetworkCapture() {
|
|
|
51815
51813
|
return;
|
|
51816
51814
|
if (!response)
|
|
51817
51815
|
return;
|
|
51818
|
-
|
|
51816
|
+
const request = requestMap[response.requestId];
|
|
51819
51817
|
if (!request)
|
|
51820
51818
|
return;
|
|
51821
51819
|
// Skip capturing successful devlog events to avoid infinite loops
|
|
@@ -51827,9 +51825,9 @@ function NetworkCapture() {
|
|
|
51827
51825
|
delete requestMap[response.requestId];
|
|
51828
51826
|
return;
|
|
51829
51827
|
}
|
|
51830
|
-
|
|
51831
|
-
request
|
|
51832
|
-
response
|
|
51828
|
+
const networkEvent = createNetworkEvent({
|
|
51829
|
+
request,
|
|
51830
|
+
response
|
|
51833
51831
|
});
|
|
51834
51832
|
if (!isPtmPaused) {
|
|
51835
51833
|
pluginAPI.Events.eventCaptured.trigger(networkEvent);
|
|
@@ -51837,8 +51835,7 @@ function NetworkCapture() {
|
|
|
51837
51835
|
buffer.push(networkEvent);
|
|
51838
51836
|
delete requestMap[response.requestId];
|
|
51839
51837
|
}
|
|
51840
|
-
function handleError(
|
|
51841
|
-
var error = _a.error, context = _a.context;
|
|
51838
|
+
function handleError({ error, context }) {
|
|
51842
51839
|
if (!isCapturingNetworkLogs)
|
|
51843
51840
|
return;
|
|
51844
51841
|
if (error.requestId && requestMap[error.requestId]) {
|
|
@@ -51852,13 +51849,13 @@ function NetworkCapture() {
|
|
|
51852
51849
|
}
|
|
51853
51850
|
}
|
|
51854
51851
|
function extractHeaders(headers, allowedHeaders) {
|
|
51855
|
-
|
|
51852
|
+
const { keys, reduce } = globalPendo._;
|
|
51856
51853
|
if (!headers || !allowedHeaders)
|
|
51857
51854
|
return [];
|
|
51858
|
-
return reduce(keys(headers),
|
|
51859
|
-
|
|
51855
|
+
return reduce(keys(headers), (acc, key) => {
|
|
51856
|
+
const normalizedKey = key.toLowerCase();
|
|
51860
51857
|
if (allowedHeaders[normalizedKey]) {
|
|
51861
|
-
acc.push(
|
|
51858
|
+
acc.push(`${key}: ${headers[key]}`);
|
|
51862
51859
|
}
|
|
51863
51860
|
return acc;
|
|
51864
51861
|
}, []);
|
|
@@ -51866,16 +51863,15 @@ function NetworkCapture() {
|
|
|
51866
51863
|
function processBody(body, contentType) {
|
|
51867
51864
|
if (!body || !globalPendo._.isString(body))
|
|
51868
51865
|
return '';
|
|
51869
|
-
|
|
51866
|
+
const processedBody = maskSensitiveFields({ string: body, contentType, _: globalPendo._ });
|
|
51870
51867
|
return truncate(processedBody, true);
|
|
51871
51868
|
}
|
|
51872
|
-
function processRequestBody(
|
|
51873
|
-
var request = _a.request;
|
|
51869
|
+
function processRequestBody({ request }) {
|
|
51874
51870
|
if (!request || !request.body || !requestBodyCb)
|
|
51875
51871
|
return '';
|
|
51876
51872
|
try {
|
|
51877
|
-
|
|
51878
|
-
|
|
51873
|
+
const body = requestBodyCb(request.body, { request });
|
|
51874
|
+
const contentType = globalPendo._.get(request, 'headers.content-type', '');
|
|
51879
51875
|
return processBody(body, contentType);
|
|
51880
51876
|
}
|
|
51881
51877
|
catch (error) {
|
|
@@ -51883,13 +51879,12 @@ function NetworkCapture() {
|
|
|
51883
51879
|
return '[Failed to process request body]';
|
|
51884
51880
|
}
|
|
51885
51881
|
}
|
|
51886
|
-
function processResponseBody(
|
|
51887
|
-
var response = _a.response;
|
|
51882
|
+
function processResponseBody({ response }) {
|
|
51888
51883
|
if (!response || !response.body || !responseBodyCb)
|
|
51889
51884
|
return '';
|
|
51890
51885
|
try {
|
|
51891
|
-
|
|
51892
|
-
|
|
51886
|
+
const body = responseBodyCb(response.body, { response });
|
|
51887
|
+
const contentType = globalPendo._.get(response, 'headers.content-type', '');
|
|
51893
51888
|
return processBody(body, contentType);
|
|
51894
51889
|
}
|
|
51895
51890
|
catch (error) {
|
|
@@ -51897,34 +51892,32 @@ function NetworkCapture() {
|
|
|
51897
51892
|
return '[Failed to process response body]';
|
|
51898
51893
|
}
|
|
51899
51894
|
}
|
|
51900
|
-
function createNetworkEvent(
|
|
51901
|
-
|
|
51902
|
-
|
|
51903
|
-
|
|
51904
|
-
|
|
51905
|
-
var networkEvent = __assign(__assign({}, devLogEnvelope), { subType: NETWORK_SUB_TYPE, devLogMethod: request.method, devLogStatusCode: response.status, devLogRequestUrl: request.url, devLogRequestHeaders: requestHeaders, devLogResponseHeaders: responseHeaders, devLogCount: 1 });
|
|
51895
|
+
function createNetworkEvent({ request, response }) {
|
|
51896
|
+
const devLogEnvelope = createDevLogEnvelope(pluginAPI, globalPendo);
|
|
51897
|
+
const requestHeaders = extractHeaders(request.headers, allowedRequestHeaders);
|
|
51898
|
+
const responseHeaders = extractHeaders(response.headers, allowedResponseHeaders);
|
|
51899
|
+
const networkEvent = Object.assign(Object.assign({}, devLogEnvelope), { subType: NETWORK_SUB_TYPE, devLogMethod: request.method, devLogStatusCode: response.status, devLogRequestUrl: request.url, devLogRequestHeaders: requestHeaders, devLogResponseHeaders: responseHeaders, devLogCount: 1 });
|
|
51906
51900
|
if (requestBodyCb) {
|
|
51907
|
-
networkEvent.devLogRequestBody = processRequestBody({ request
|
|
51901
|
+
networkEvent.devLogRequestBody = processRequestBody({ request });
|
|
51908
51902
|
}
|
|
51909
51903
|
if (responseBodyCb) {
|
|
51910
|
-
networkEvent.devLogResponseBody = processResponseBody({ response
|
|
51904
|
+
networkEvent.devLogResponseBody = processResponseBody({ response });
|
|
51911
51905
|
}
|
|
51912
51906
|
return networkEvent;
|
|
51913
51907
|
}
|
|
51914
|
-
function send(
|
|
51915
|
-
var _b = _a === void 0 ? {} : _a, _c = _b.unload, unload = _c === void 0 ? false : _c, _d = _b.hidden, hidden = _d === void 0 ? false : _d;
|
|
51908
|
+
function send({ unload = false, hidden = false } = {}) {
|
|
51916
51909
|
if (!buffer || buffer.isEmpty())
|
|
51917
51910
|
return;
|
|
51918
51911
|
if (!globalPendo.isSendingEvents()) {
|
|
51919
51912
|
buffer.clear();
|
|
51920
51913
|
return;
|
|
51921
51914
|
}
|
|
51922
|
-
|
|
51915
|
+
const payloads = buffer.pack();
|
|
51923
51916
|
if (unload || hidden) {
|
|
51924
51917
|
sendQueue.drain(payloads, unload);
|
|
51925
51918
|
}
|
|
51926
51919
|
else {
|
|
51927
|
-
sendQueue.push
|
|
51920
|
+
sendQueue.push(...payloads);
|
|
51928
51921
|
}
|
|
51929
51922
|
}
|
|
51930
51923
|
}
|
|
@@ -52258,13 +52251,13 @@ var predictGuidesScript = function (_a) {
|
|
|
52258
52251
|
cleanupArray.push(createFloatingModal({ recordId: recordId, configuration: configuration }));
|
|
52259
52252
|
};
|
|
52260
52253
|
|
|
52261
|
-
|
|
52262
|
-
|
|
52263
|
-
|
|
52264
|
-
|
|
52254
|
+
const PredictGuides = () => {
|
|
52255
|
+
let pluginApiRef = null;
|
|
52256
|
+
let cleanupArray = [];
|
|
52257
|
+
const cleanup = () => {
|
|
52265
52258
|
var _a;
|
|
52266
52259
|
(_a = pluginApiRef === null || pluginApiRef === void 0 ? void 0 : pluginApiRef.log) === null || _a === void 0 ? void 0 : _a.debug('[predict] cleaning up');
|
|
52267
|
-
for (
|
|
52260
|
+
for (let i = 0; i < cleanupArray.length; i++) {
|
|
52268
52261
|
try {
|
|
52269
52262
|
cleanupArray[i]();
|
|
52270
52263
|
}
|
|
@@ -52272,44 +52265,44 @@ var PredictGuides = function () {
|
|
|
52272
52265
|
}
|
|
52273
52266
|
cleanupArray = [];
|
|
52274
52267
|
};
|
|
52275
|
-
|
|
52268
|
+
const initialize = (_pendo, PluginAPI) => {
|
|
52276
52269
|
pluginApiRef = PluginAPI;
|
|
52277
|
-
|
|
52278
|
-
|
|
52270
|
+
const configReader = PluginAPI.ConfigReader;
|
|
52271
|
+
const PREDICT_GUIDES_CONFIG = 'predictGuides';
|
|
52279
52272
|
configReader.addOption(PREDICT_GUIDES_CONFIG, [
|
|
52280
52273
|
configReader.sources.SNIPPET_SRC,
|
|
52281
52274
|
configReader.sources.PENDO_CONFIG_SRC
|
|
52282
52275
|
], false);
|
|
52283
|
-
|
|
52276
|
+
const predictGuidesEnabled = configReader.get(PREDICT_GUIDES_CONFIG);
|
|
52284
52277
|
if (!predictGuidesEnabled)
|
|
52285
52278
|
return;
|
|
52286
|
-
|
|
52279
|
+
const log = PluginAPI.log.debug.bind(PluginAPI.log);
|
|
52287
52280
|
pluginApiRef.Events.urlChanged.on(cleanup);
|
|
52288
|
-
|
|
52281
|
+
const script = {
|
|
52289
52282
|
name: 'PredictFrameScript',
|
|
52290
|
-
script
|
|
52291
|
-
predictGuidesScript({ step
|
|
52292
|
-
this.on('unmounted',
|
|
52283
|
+
script(step, _guide, pendo) {
|
|
52284
|
+
predictGuidesScript({ step, pendo, cleanupArray, cleanup, log });
|
|
52285
|
+
this.on('unmounted', (evt) => {
|
|
52293
52286
|
if (evt.reason !== 'hidden')
|
|
52294
52287
|
cleanup();
|
|
52295
52288
|
});
|
|
52296
52289
|
},
|
|
52297
|
-
test
|
|
52298
|
-
|
|
52290
|
+
test(step, _guide) {
|
|
52291
|
+
const stepName = step.name || '';
|
|
52299
52292
|
return PREDICT_STEP_REGEX.test(stepName);
|
|
52300
52293
|
}
|
|
52301
52294
|
};
|
|
52302
52295
|
pluginApiRef.GlobalRuntime.addGlobalScript(script);
|
|
52303
52296
|
};
|
|
52304
|
-
|
|
52297
|
+
const teardown = () => {
|
|
52305
52298
|
var _a, _b;
|
|
52306
52299
|
cleanup();
|
|
52307
52300
|
(_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);
|
|
52308
52301
|
};
|
|
52309
52302
|
return {
|
|
52310
52303
|
name: 'PredictGuides',
|
|
52311
|
-
initialize
|
|
52312
|
-
teardown
|
|
52304
|
+
initialize,
|
|
52305
|
+
teardown
|
|
52313
52306
|
};
|
|
52314
52307
|
};
|
|
52315
52308
|
|