@pendo/agent 2.328.1 → 2.328.2
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 +11 -3
- package/dist/pendo.module.js +563 -464
- package/dist/pendo.module.min.js +106 -8
- package/dist/servers.json +7 -7
- package/package.json +1 -1
package/dist/pendo.module.js
CHANGED
|
@@ -2916,7 +2916,15 @@ var ConfigReader = (function () {
|
|
|
2916
2916
|
addOption('disableAutoInitialize');
|
|
2917
2917
|
/**
|
|
2918
2918
|
* If set to `true` the web SDK will wait for the host application to be both loaded and visible before
|
|
2919
|
-
* starting the initialization process.
|
|
2919
|
+
* starting the initialization process. Only the first call to `initialize` is honored while waiting
|
|
2920
|
+
* for visibility; subsequent calls are rejected and logged. This setting takes precedence over
|
|
2921
|
+
* `initializeImmediately`.
|
|
2922
|
+
*
|
|
2923
|
+
* This is a server-delivered setting and cannot be provided through the options passed to
|
|
2924
|
+
* `pendo.initialize`: the visibility gate runs before those options are read.
|
|
2925
|
+
*
|
|
2926
|
+
* This relies on the Page Visibility API. In browsers that do not support `document.visibilityState`,
|
|
2927
|
+
* enabling this option will defer initialization indefinitely.
|
|
2920
2928
|
*
|
|
2921
2929
|
* @access public
|
|
2922
2930
|
* @category Config/Core
|
|
@@ -2924,7 +2932,7 @@ var ConfigReader = (function () {
|
|
|
2924
2932
|
* @default false
|
|
2925
2933
|
* @type {boolean}
|
|
2926
2934
|
*/
|
|
2927
|
-
addOption('initializeWhenVisible', [
|
|
2935
|
+
addOption('initializeWhenVisible', [PENDO_CONFIG_SRC], false);
|
|
2928
2936
|
/**
|
|
2929
2937
|
* Although the name refers to cookies, if set to `true` the web SDK will not persist any data in local
|
|
2930
2938
|
* storage or cookies and will rely only on memory.
|
|
@@ -4002,8 +4010,8 @@ let SERVER = '';
|
|
|
4002
4010
|
let ASSET_HOST = '';
|
|
4003
4011
|
let ASSET_PATH = '';
|
|
4004
4012
|
let DESIGNER_SERVER = '';
|
|
4005
|
-
let VERSION = '2.328.
|
|
4006
|
-
let PACKAGE_VERSION = '2.328.
|
|
4013
|
+
let VERSION = '2.328.2_';
|
|
4014
|
+
let PACKAGE_VERSION = '2.328.2';
|
|
4007
4015
|
let LOADER = 'xhr';
|
|
4008
4016
|
/* eslint-enable web-sdk-eslint-rules/no-gulp-env-references */
|
|
4009
4017
|
/**
|
|
@@ -22089,22 +22097,6 @@ var whenLoadedCall = function (callback, win) {
|
|
|
22089
22097
|
}
|
|
22090
22098
|
return _.noop;
|
|
22091
22099
|
};
|
|
22092
|
-
const whenVisibleCall = (callback, win = window) => {
|
|
22093
|
-
const { document } = win;
|
|
22094
|
-
const waitForVis = ConfigReader.get('initializeWhenVisible', false);
|
|
22095
|
-
if (!waitForVis || document.visibilityState === 'visible') {
|
|
22096
|
-
callback();
|
|
22097
|
-
return _.noop;
|
|
22098
|
-
}
|
|
22099
|
-
const stopVisListener = attachEventInternal(document, 'visibilitychange', () => {
|
|
22100
|
-
if (document.visibilityState === 'visible') {
|
|
22101
|
-
callback();
|
|
22102
|
-
// need to shut this down immediately as visibility can continue to change
|
|
22103
|
-
stopVisListener();
|
|
22104
|
-
}
|
|
22105
|
-
});
|
|
22106
|
-
return stopVisListener;
|
|
22107
|
-
};
|
|
22108
22100
|
|
|
22109
22101
|
class GuideTypeIdentifier {
|
|
22110
22102
|
constructor(identificationFn, typeName) {
|
|
@@ -29016,6 +29008,44 @@ function applyDoNotTrackConfigOverrides(options) {
|
|
|
29016
29008
|
// ----------------------------------------------------------------------------------
|
|
29017
29009
|
let initializeCounter = 0;
|
|
29018
29010
|
const initializeImmediately = 'initializeImmediately';
|
|
29011
|
+
const initializeWhenVisible = 'initializeWhenVisible';
|
|
29012
|
+
const teardownFns = [];
|
|
29013
|
+
// State for the visibility gate. Only the first gated initialize() call is
|
|
29014
|
+
// honored — it attaches the single visibilitychange listener and its arguments
|
|
29015
|
+
// replay once the document becomes visible. Any later calls while the gate is
|
|
29016
|
+
// pending are rejected and ignored. Must live at module scope so later
|
|
29017
|
+
// initialize() calls can see a gate is active; null when no gate is active.
|
|
29018
|
+
let pendingInitializeArgs = null;
|
|
29019
|
+
function shouldGateOnVisibility() {
|
|
29020
|
+
return ConfigReader.get(initializeWhenVisible, false) &&
|
|
29021
|
+
typeof document !== 'undefined' &&
|
|
29022
|
+
document.visibilityState !== 'visible';
|
|
29023
|
+
}
|
|
29024
|
+
function gateInitializeOnVisibility(args) {
|
|
29025
|
+
if (pendingInitializeArgs !== null) {
|
|
29026
|
+
log.warn('pendo.initialize call rejected: an earlier call is already waiting for the document to become visible.');
|
|
29027
|
+
return;
|
|
29028
|
+
}
|
|
29029
|
+
pendingInitializeArgs = args;
|
|
29030
|
+
let stopVisibilityListener = attachEvent(document, 'visibilitychange', () => {
|
|
29031
|
+
if (document.visibilityState !== 'visible')
|
|
29032
|
+
return;
|
|
29033
|
+
if (stopVisibilityListener) {
|
|
29034
|
+
stopVisibilityListener();
|
|
29035
|
+
stopVisibilityListener = null;
|
|
29036
|
+
}
|
|
29037
|
+
const pendingArgs = pendingInitializeArgs;
|
|
29038
|
+
pendingInitializeArgs = null;
|
|
29039
|
+
initialize.apply(null, pendingArgs);
|
|
29040
|
+
});
|
|
29041
|
+
teardownFns.push(() => {
|
|
29042
|
+
if (stopVisibilityListener) {
|
|
29043
|
+
stopVisibilityListener();
|
|
29044
|
+
stopVisibilityListener = null;
|
|
29045
|
+
}
|
|
29046
|
+
pendingInitializeArgs = null;
|
|
29047
|
+
});
|
|
29048
|
+
}
|
|
29019
29049
|
/**
|
|
29020
29050
|
* Initializes the Pendo Web SDK in a browser window. This function only needs to be called once per page load. Any subsequent calls, without first having called `teardown`, will be ignored.
|
|
29021
29051
|
* Once the web SDK has been initialized, any updates to identity or metadata should be done using `identify` or `updateOptions`.
|
|
@@ -29048,8 +29078,16 @@ const initializeImmediately = 'initializeImmediately';
|
|
|
29048
29078
|
}
|
|
29049
29079
|
});
|
|
29050
29080
|
*/
|
|
29051
|
-
const teardownFns = [];
|
|
29052
29081
|
function initialize(options) {
|
|
29082
|
+
if (shouldGateOnVisibility()) {
|
|
29083
|
+
try {
|
|
29084
|
+
gateInitializeOnVisibility(_.toArray(arguments));
|
|
29085
|
+
}
|
|
29086
|
+
catch (e) {
|
|
29087
|
+
log.critical('pendo.initialize failed while gating on visibility.', e);
|
|
29088
|
+
}
|
|
29089
|
+
return;
|
|
29090
|
+
}
|
|
29053
29091
|
if (document.readyState !== 'complete' && !(_.get(options, initializeImmediately) || ConfigReader.get(initializeImmediately))) {
|
|
29054
29092
|
try {
|
|
29055
29093
|
enqueueCall(pendo$1, 'initialize', arguments);
|
|
@@ -29303,9 +29341,7 @@ function startup(callQueue, autoInitialize) {
|
|
|
29303
29341
|
autoInitialize();
|
|
29304
29342
|
}
|
|
29305
29343
|
else {
|
|
29306
|
-
teardownFns.push(whenLoadedCall(
|
|
29307
|
-
teardownFns.push(whenVisibleCall(autoInitialize));
|
|
29308
|
-
}));
|
|
29344
|
+
teardownFns.push(whenLoadedCall(autoInitialize));
|
|
29309
29345
|
}
|
|
29310
29346
|
}
|
|
29311
29347
|
/**
|
|
@@ -41607,20 +41643,20 @@ function getZoneSafeMethod(_, method, target) {
|
|
|
41607
41643
|
}
|
|
41608
41644
|
|
|
41609
41645
|
// Does not support submit and go to
|
|
41610
|
-
|
|
41611
|
-
|
|
41646
|
+
const goToRegex = new RegExp(guideMarkdownUtil.goToString);
|
|
41647
|
+
const PollBranching = {
|
|
41612
41648
|
name: 'PollBranching',
|
|
41613
|
-
script
|
|
41614
|
-
|
|
41615
|
-
|
|
41649
|
+
script(step, guide, pendo) {
|
|
41650
|
+
let isAdvanceIntercepted = false;
|
|
41651
|
+
const branchingQuestions = initialBranchingSetup(step, pendo);
|
|
41616
41652
|
if (branchingQuestions) {
|
|
41617
41653
|
// If there are too many branching questions saved, exit and run the guide normally.
|
|
41618
41654
|
if (pendo._.size(branchingQuestions) > 1)
|
|
41619
41655
|
return;
|
|
41620
|
-
this.on('beforeAdvance',
|
|
41621
|
-
|
|
41622
|
-
|
|
41623
|
-
|
|
41656
|
+
this.on('beforeAdvance', (evt) => {
|
|
41657
|
+
const noResponseSelected = step.guideElement.find('[branching] .pendo-radio:checked').length === 0;
|
|
41658
|
+
const responseLabel = step.guideElement.find('[branching] .pendo-radio:checked + label')[0];
|
|
41659
|
+
let noGotoLabel;
|
|
41624
41660
|
if (responseLabel) {
|
|
41625
41661
|
noGotoLabel = pendo._.isNull(responseLabel.getAttribute('goToStep'));
|
|
41626
41662
|
}
|
|
@@ -41631,58 +41667,58 @@ var PollBranching = {
|
|
|
41631
41667
|
});
|
|
41632
41668
|
}
|
|
41633
41669
|
},
|
|
41634
|
-
test
|
|
41670
|
+
test(step, guide, pendo) {
|
|
41635
41671
|
var _a;
|
|
41636
|
-
|
|
41672
|
+
let branchingQuestions = (_a = step.guideElement) === null || _a === void 0 ? void 0 : _a.find('._pendo-multi-choice-poll-question:contains("{branching/}")');
|
|
41637
41673
|
return !pendo._.isUndefined(branchingQuestions) && pendo._.size(branchingQuestions);
|
|
41638
41674
|
},
|
|
41639
|
-
designerListener
|
|
41640
|
-
|
|
41641
|
-
|
|
41675
|
+
designerListener(pendo) {
|
|
41676
|
+
const target = pendo.dom.getBody();
|
|
41677
|
+
const config = {
|
|
41642
41678
|
attributeFilter: ['data-layout'],
|
|
41643
41679
|
attributes: true,
|
|
41644
41680
|
childList: true,
|
|
41645
41681
|
characterData: true,
|
|
41646
41682
|
subtree: true
|
|
41647
41683
|
};
|
|
41648
|
-
|
|
41649
|
-
|
|
41684
|
+
const MutationObserver = getZoneSafeMethod(pendo._, 'MutationObserver');
|
|
41685
|
+
const observer = new MutationObserver(applyBranchingIndicators);
|
|
41650
41686
|
observer.observe(target, config);
|
|
41651
41687
|
function applyBranchingIndicators(mutations) {
|
|
41652
41688
|
pendo._.each(mutations, function (mutation) {
|
|
41653
41689
|
var _a;
|
|
41654
|
-
|
|
41690
|
+
const nodeHasQuerySelector = pendo._.isFunction((_a = mutation.addedNodes[0]) === null || _a === void 0 ? void 0 : _a.querySelector);
|
|
41655
41691
|
if (mutation.addedNodes.length && nodeHasQuerySelector) {
|
|
41656
41692
|
if (mutation.addedNodes[0].querySelector('._pendo-multi-choice-poll-select-border')) {
|
|
41657
41693
|
if (pendo._.size(pendo.dom('._pendo-multi-choice-poll-question:contains("{branching/}")'))) {
|
|
41658
41694
|
pendo
|
|
41659
41695
|
.dom('._pendo-multi-choice-poll-question:contains("{branching/}")')
|
|
41660
|
-
.each(
|
|
41661
|
-
pendo._.each(pendo.dom(
|
|
41696
|
+
.each((question, index) => {
|
|
41697
|
+
pendo._.each(pendo.dom(`#${question.id} *`), (element) => {
|
|
41662
41698
|
guideMarkdownUtil.removeMarkdownSyntax(element, '{branching/}', '', pendo);
|
|
41663
41699
|
});
|
|
41664
41700
|
pendo
|
|
41665
|
-
.dom(
|
|
41701
|
+
.dom(`#${question.id} p`)
|
|
41666
41702
|
.css({ display: 'inline-block !important' })
|
|
41667
41703
|
.append(branchingIcon('#999', '20px'))
|
|
41668
41704
|
.attr({ title: 'Custom Branching Added' });
|
|
41669
|
-
|
|
41670
|
-
if (pendo.dom(
|
|
41705
|
+
let dataPendoPollId = question.getAttribute('data-pendo-poll-id');
|
|
41706
|
+
if (pendo.dom(`._pendo-multi-choice-poll-question[data-pendo-poll-id=${dataPendoPollId}]`)[0]) {
|
|
41671
41707
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
41672
41708
|
pendo
|
|
41673
|
-
.dom(
|
|
41709
|
+
.dom(`._pendo-multi-choice-poll-question[data-pendo-poll-id=${dataPendoPollId}]`)[0]
|
|
41674
41710
|
.textContent.trim();
|
|
41675
41711
|
}
|
|
41676
|
-
|
|
41712
|
+
let pollLabels = pendo.dom(`label[for*=${dataPendoPollId}]`);
|
|
41677
41713
|
if (pendo._.size(pollLabels)) {
|
|
41678
|
-
pendo._.forEach(pollLabels,
|
|
41714
|
+
pendo._.forEach(pollLabels, (label) => {
|
|
41679
41715
|
if (goToRegex.test(label.textContent)) {
|
|
41680
|
-
|
|
41716
|
+
let labelTitle = goToRegex.exec(label.textContent)[2];
|
|
41681
41717
|
guideMarkdownUtil.removeMarkdownSyntax(label, goToRegex, '', pendo);
|
|
41682
41718
|
pendo
|
|
41683
41719
|
.dom(label)
|
|
41684
41720
|
.append(branchingIcon('#999', '14px'))
|
|
41685
|
-
.attr({ title:
|
|
41721
|
+
.attr({ title: `Branching to step ${labelTitle}` });
|
|
41686
41722
|
}
|
|
41687
41723
|
});
|
|
41688
41724
|
}
|
|
@@ -41690,9 +41726,9 @@ var PollBranching = {
|
|
|
41690
41726
|
pendo
|
|
41691
41727
|
.dom(question)
|
|
41692
41728
|
.append(branchingErrorHTML(question.dataset.pendoPollId));
|
|
41693
|
-
pendo.dom(
|
|
41729
|
+
pendo.dom(`#${question.id} #pendo-ps-branching-svg`).remove();
|
|
41694
41730
|
pendo
|
|
41695
|
-
.dom(
|
|
41731
|
+
.dom(`#${question.id} p`)
|
|
41696
41732
|
.css({ display: 'inline-block !important' })
|
|
41697
41733
|
.append(branchingIcon('red', '20px'))
|
|
41698
41734
|
.attr({ title: 'Unsupported Branching configuration' });
|
|
@@ -41704,31 +41740,49 @@ var PollBranching = {
|
|
|
41704
41740
|
});
|
|
41705
41741
|
}
|
|
41706
41742
|
function branchingErrorHTML(dataPendoPollId) {
|
|
41707
|
-
return
|
|
41743
|
+
return `<div style="text-align:lrft; font-size: 14px; color: red;
|
|
41744
|
+
font-style: italic; margin-top: 0px;" class="branching-wrapper"
|
|
41745
|
+
name="${dataPendoPollId}">
|
|
41746
|
+
* Branching Error: Multiple branching polls not supported</div>`;
|
|
41708
41747
|
}
|
|
41709
41748
|
function branchingIcon(color, size) {
|
|
41710
|
-
return
|
|
41749
|
+
return `<svg id="pendo-ps-branching-svg" viewBox="0 0 24 24" fill="none"
|
|
41750
|
+
style="margin-left: 5px;
|
|
41751
|
+
height:${size}; width:${size}; display:inline; vertical-align:middle;" xmlns="http://www.w3.org/2000/svg">
|
|
41752
|
+
<g stroke-width="0"></g>
|
|
41753
|
+
<g stroke-linecap="round" stroke-linejoin="round"></g>
|
|
41754
|
+
<g> <circle cx="4" cy="7" r="2" stroke="${color}"
|
|
41755
|
+
stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></circle>
|
|
41756
|
+
<circle cx="20" cy="7" r="2" stroke="${color}"
|
|
41757
|
+
stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></circle>
|
|
41758
|
+
<circle cx="20" cy="17" r="2" stroke="${color}" stroke-width="2"
|
|
41759
|
+
stroke-linecap="round" stroke-linejoin="round"></circle>
|
|
41760
|
+
<path d="M18 7H6" stroke="${color}" stroke-width="2"
|
|
41761
|
+
stroke-linecap="round" stroke-linejoin="round"></path>
|
|
41762
|
+
<path d="M7 7V7C8.65685 7 10 8.34315 10 10V15C10 16.1046 10.8954 17 12 17H18"
|
|
41763
|
+
stroke="${color}" stroke-width="2" stroke-linecap="round"
|
|
41764
|
+
stroke-linejoin="round"></path> </g></svg>`;
|
|
41711
41765
|
}
|
|
41712
41766
|
}
|
|
41713
41767
|
};
|
|
41714
41768
|
function initialBranchingSetup(step, pendo) {
|
|
41715
|
-
|
|
41716
|
-
pendo._.forEach(questions,
|
|
41717
|
-
|
|
41718
|
-
pendo._.each(step.guideElement.find(
|
|
41769
|
+
const questions = step.guideElement.find('._pendo-multi-choice-poll-question:contains("{branching/}")');
|
|
41770
|
+
pendo._.forEach(questions, (question) => {
|
|
41771
|
+
let dataPendoPollId = question.getAttribute('data-pendo-poll-id');
|
|
41772
|
+
pendo._.each(step.guideElement.find(`#${question.id} *`), (element) => {
|
|
41719
41773
|
guideMarkdownUtil.removeMarkdownSyntax(element, '{branching/}', '', pendo);
|
|
41720
41774
|
});
|
|
41721
|
-
|
|
41722
|
-
pendo._.forEach(pollLabels,
|
|
41775
|
+
let pollLabels = step.guideElement.find(`label[for*=${dataPendoPollId}]`);
|
|
41776
|
+
pendo._.forEach(pollLabels, (label) => {
|
|
41723
41777
|
if (pendo._.isNull(goToRegex.exec(label.textContent))) {
|
|
41724
41778
|
return;
|
|
41725
41779
|
}
|
|
41726
|
-
|
|
41727
|
-
|
|
41780
|
+
let gotoSubstring = goToRegex.exec(label.textContent)[1];
|
|
41781
|
+
let gotoIndex = goToRegex.exec(label.textContent)[2];
|
|
41728
41782
|
label.setAttribute('goToStep', gotoIndex);
|
|
41729
41783
|
guideMarkdownUtil.removeMarkdownSyntax(label, gotoSubstring, '', pendo);
|
|
41730
41784
|
});
|
|
41731
|
-
|
|
41785
|
+
let pollChoiceContainer = step.guideElement.find(`[data-pendo-poll-id=${dataPendoPollId}]._pendo-multi-choice-poll-select-border`);
|
|
41732
41786
|
if (pollChoiceContainer && pollChoiceContainer.length) {
|
|
41733
41787
|
pollChoiceContainer[0].setAttribute('branching', '');
|
|
41734
41788
|
}
|
|
@@ -41737,24 +41791,24 @@ function initialBranchingSetup(step, pendo) {
|
|
|
41737
41791
|
}
|
|
41738
41792
|
function branchingGoToStep(event, step, guide, pendo) {
|
|
41739
41793
|
var _a;
|
|
41740
|
-
|
|
41741
|
-
|
|
41742
|
-
|
|
41743
|
-
|
|
41794
|
+
let checkedPollInputId = (_a = step.guideElement.find('[branching] input.pendo-radio[data-pendo-poll-id]:checked')[0]) === null || _a === void 0 ? void 0 : _a.id;
|
|
41795
|
+
let checkedPollLabel = step.guideElement.find(`label[for="${checkedPollInputId}"]`)[0];
|
|
41796
|
+
let checkedPollLabelStepIndex = checkedPollLabel === null || checkedPollLabel === void 0 ? void 0 : checkedPollLabel.getAttribute('goToStep');
|
|
41797
|
+
let pollStepIndex = checkedPollLabelStepIndex - 1;
|
|
41744
41798
|
if (pollStepIndex < 0)
|
|
41745
41799
|
return;
|
|
41746
|
-
|
|
41800
|
+
const destinationObject = {
|
|
41747
41801
|
destinationStepId: guide.steps[pollStepIndex].id,
|
|
41748
|
-
step
|
|
41802
|
+
step
|
|
41749
41803
|
};
|
|
41750
41804
|
pendo.goToStep(destinationObject);
|
|
41751
41805
|
event.cancel = true;
|
|
41752
41806
|
}
|
|
41753
41807
|
|
|
41754
|
-
|
|
41808
|
+
const MetadataSubstitution = {
|
|
41755
41809
|
name: 'MetadataSubstitution',
|
|
41756
|
-
script
|
|
41757
|
-
|
|
41810
|
+
script(step, guide, pendo) {
|
|
41811
|
+
const placeholderData = findSubstitutableElements(pendo);
|
|
41758
41812
|
if (step.domJson) {
|
|
41759
41813
|
findSubstitutableUrlsInJson(step.domJson, placeholderData, pendo);
|
|
41760
41814
|
}
|
|
@@ -41762,22 +41816,22 @@ var MetadataSubstitution = {
|
|
|
41762
41816
|
pendo._.each(placeholderData, function (placeholder) {
|
|
41763
41817
|
processPlaceholder(placeholder, pendo);
|
|
41764
41818
|
});
|
|
41765
|
-
|
|
41766
|
-
|
|
41767
|
-
updateGuideContainer(containerId,
|
|
41819
|
+
const containerId = `pendo-g-${step.id}`;
|
|
41820
|
+
const context = step.guideElement;
|
|
41821
|
+
updateGuideContainer(containerId, context, pendo);
|
|
41768
41822
|
}
|
|
41769
41823
|
},
|
|
41770
|
-
designerListener
|
|
41771
|
-
|
|
41824
|
+
designerListener(pendo) {
|
|
41825
|
+
const target = pendo.dom.getBody();
|
|
41772
41826
|
if (pendo.designerv2) {
|
|
41773
41827
|
pendo.designerv2.runMetadataSubstitutionForDesignerPreview = function runMetadataSubstitutionForDesignerPreview() {
|
|
41774
41828
|
var _a;
|
|
41775
41829
|
if (!document.querySelector(guideMarkdownUtil.containerSelector))
|
|
41776
41830
|
return;
|
|
41777
|
-
|
|
41831
|
+
const step = (_a = pendo.designerv2.currentlyPreviewedGuide) === null || _a === void 0 ? void 0 : _a.steps[0];
|
|
41778
41832
|
if (!step)
|
|
41779
41833
|
return;
|
|
41780
|
-
|
|
41834
|
+
const placeholderData = findSubstitutableElements(pendo);
|
|
41781
41835
|
if (step.buildingBlocks) {
|
|
41782
41836
|
findSubstitutableUrlsInJson(step.buildingBlocks, placeholderData, pendo);
|
|
41783
41837
|
}
|
|
@@ -41787,32 +41841,32 @@ var MetadataSubstitution = {
|
|
|
41787
41841
|
return;
|
|
41788
41842
|
processPlaceholder(placeholder, pendo);
|
|
41789
41843
|
});
|
|
41790
|
-
|
|
41791
|
-
|
|
41792
|
-
updateGuideContainer(containerId,
|
|
41844
|
+
const containerId = `pendo-g-${step.id}`;
|
|
41845
|
+
const context = step.guideElement;
|
|
41846
|
+
updateGuideContainer(containerId, context, pendo);
|
|
41793
41847
|
}
|
|
41794
41848
|
};
|
|
41795
41849
|
}
|
|
41796
|
-
|
|
41850
|
+
const config = {
|
|
41797
41851
|
attributeFilter: ['data-layout'],
|
|
41798
41852
|
attributes: true,
|
|
41799
41853
|
childList: true,
|
|
41800
41854
|
characterData: true,
|
|
41801
41855
|
subtree: true
|
|
41802
41856
|
};
|
|
41803
|
-
|
|
41804
|
-
|
|
41857
|
+
const MutationObserver = getZoneSafeMethod(pendo._, 'MutationObserver');
|
|
41858
|
+
const observer = new MutationObserver(applySubstitutionIndicators);
|
|
41805
41859
|
observer.observe(target, config);
|
|
41806
41860
|
function applySubstitutionIndicators(mutations) {
|
|
41807
41861
|
pendo._.each(mutations, function (mutation) {
|
|
41808
41862
|
var _a;
|
|
41809
41863
|
if (mutation.addedNodes.length) {
|
|
41810
41864
|
if (document.querySelector(guideMarkdownUtil.containerSelector)) {
|
|
41811
|
-
|
|
41812
|
-
|
|
41865
|
+
const placeholderData = findSubstitutableElements(pendo);
|
|
41866
|
+
const step = (_a = pendo.designerv2.currentlyPreviewedGuide) === null || _a === void 0 ? void 0 : _a.steps[0];
|
|
41813
41867
|
if (!step)
|
|
41814
41868
|
return;
|
|
41815
|
-
|
|
41869
|
+
const pendoBlocks = step.buildingBlocks;
|
|
41816
41870
|
if (!pendo._.isUndefined(pendoBlocks)) {
|
|
41817
41871
|
findSubstitutableUrlsInJson(pendoBlocks, placeholderData, pendo);
|
|
41818
41872
|
}
|
|
@@ -41822,9 +41876,9 @@ var MetadataSubstitution = {
|
|
|
41822
41876
|
return;
|
|
41823
41877
|
processPlaceholder(placeholder, pendo);
|
|
41824
41878
|
});
|
|
41825
|
-
|
|
41826
|
-
|
|
41827
|
-
updateGuideContainer(containerId,
|
|
41879
|
+
const containerId = `pendo-g-${step.id}`;
|
|
41880
|
+
const context = step.guideElement;
|
|
41881
|
+
updateGuideContainer(containerId, context, pendo);
|
|
41828
41882
|
}
|
|
41829
41883
|
}
|
|
41830
41884
|
}
|
|
@@ -41833,18 +41887,18 @@ var MetadataSubstitution = {
|
|
|
41833
41887
|
}
|
|
41834
41888
|
};
|
|
41835
41889
|
function processPlaceholder(placeholder, pendo) {
|
|
41836
|
-
|
|
41837
|
-
|
|
41838
|
-
|
|
41890
|
+
let match;
|
|
41891
|
+
const { data, target } = placeholder;
|
|
41892
|
+
const subRegex = new RegExp(guideMarkdownUtil.substitutionRegex);
|
|
41839
41893
|
while ((match = matchPlaceholder(placeholder, subRegex))) {
|
|
41840
|
-
|
|
41841
|
-
|
|
41894
|
+
const usedArrayPath = Array.isArray(match) && match.length >= 2;
|
|
41895
|
+
const currentStr = target === 'textContent'
|
|
41842
41896
|
? data[target]
|
|
41843
41897
|
: decodeURI((data.getAttribute && (target === 'href' || target === 'value') ? (data.getAttribute(target) || '') : data[target]));
|
|
41844
|
-
|
|
41898
|
+
const matched = usedArrayPath ? match : subRegex.exec(currentStr);
|
|
41845
41899
|
if (!matched)
|
|
41846
41900
|
continue;
|
|
41847
|
-
|
|
41901
|
+
const mdValue = getSubstituteValue(matched, pendo);
|
|
41848
41902
|
substituteMetadataByTarget(data, target, mdValue, matched);
|
|
41849
41903
|
}
|
|
41850
41904
|
}
|
|
@@ -41853,48 +41907,48 @@ function matchPlaceholder(placeholder, regex) {
|
|
|
41853
41907
|
return placeholder.data[placeholder.target].match(regex);
|
|
41854
41908
|
}
|
|
41855
41909
|
else {
|
|
41856
|
-
|
|
41910
|
+
const raw = placeholder.data.getAttribute && (placeholder.target === 'href' || placeholder.target === 'value')
|
|
41857
41911
|
? (placeholder.data.getAttribute(placeholder.target) || '')
|
|
41858
41912
|
: placeholder.data[placeholder.target];
|
|
41859
41913
|
return decodeURI(raw).match(regex);
|
|
41860
41914
|
}
|
|
41861
41915
|
}
|
|
41862
41916
|
function getMetadataValueCaseInsensitive(metadata, type, property) {
|
|
41863
|
-
|
|
41917
|
+
const kind = metadata && metadata[type];
|
|
41864
41918
|
if (!kind || typeof kind !== 'object')
|
|
41865
41919
|
return undefined;
|
|
41866
|
-
|
|
41920
|
+
const direct = Object.prototype.hasOwnProperty.call(kind, property) ? kind[property] : undefined;
|
|
41867
41921
|
if (direct !== undefined) {
|
|
41868
41922
|
return direct;
|
|
41869
41923
|
}
|
|
41870
|
-
|
|
41871
|
-
|
|
41872
|
-
|
|
41924
|
+
const propLower = property.toLowerCase();
|
|
41925
|
+
const key = Object.keys(kind).find(k => k.toLowerCase() === propLower);
|
|
41926
|
+
const value = key !== undefined ? kind[key] : undefined;
|
|
41873
41927
|
return value;
|
|
41874
41928
|
}
|
|
41875
41929
|
function getSubstituteValue(match, pendo) {
|
|
41876
41930
|
if (pendo._.isUndefined(match[1]) || pendo._.isUndefined(match[2])) {
|
|
41877
41931
|
return;
|
|
41878
41932
|
}
|
|
41879
|
-
|
|
41880
|
-
|
|
41881
|
-
|
|
41933
|
+
let type = match[1];
|
|
41934
|
+
let property = match[2];
|
|
41935
|
+
let defaultValue = match[3];
|
|
41882
41936
|
if (pendo._.isUndefined(type) || pendo._.isUndefined(property)) {
|
|
41883
41937
|
return;
|
|
41884
41938
|
}
|
|
41885
|
-
|
|
41886
|
-
|
|
41939
|
+
const metadata = pendo.getSerializedMetadata();
|
|
41940
|
+
let mdValue = getMetadataValueCaseInsensitive(metadata, type, property);
|
|
41887
41941
|
if (mdValue === undefined || mdValue === null)
|
|
41888
41942
|
mdValue = defaultValue || '';
|
|
41889
41943
|
return mdValue;
|
|
41890
41944
|
}
|
|
41891
41945
|
function substituteMetadataByTarget(data, target, mdValue, matched) {
|
|
41892
|
-
|
|
41893
|
-
|
|
41946
|
+
const isElement = data && typeof data.getAttribute === 'function';
|
|
41947
|
+
const current = (target === 'href' || target === 'value') && isElement
|
|
41894
41948
|
? (data.getAttribute(target) || '')
|
|
41895
41949
|
: data[target];
|
|
41896
41950
|
if (target === 'href' || target === 'value') {
|
|
41897
|
-
|
|
41951
|
+
const safeValue = window.encodeURIComponent(String(mdValue === undefined || mdValue === null ? '' : mdValue));
|
|
41898
41952
|
data[target] = decodeURI(current).replace(matched[0], safeValue);
|
|
41899
41953
|
}
|
|
41900
41954
|
else {
|
|
@@ -41908,9 +41962,8 @@ function updateGuideContainer(containerId, context, pendo) {
|
|
|
41908
41962
|
pendo.flexElement(pendo.dom(guideMarkdownUtil.containerSelector));
|
|
41909
41963
|
pendo.BuildingBlocks.BuildingBlockGuides.recalculateGuideHeight(containerId, context);
|
|
41910
41964
|
}
|
|
41911
|
-
function findSubstitutableUrlsInJson(originalData, placeholderData, pendo) {
|
|
41912
|
-
|
|
41913
|
-
var subRegex = new RegExp(guideMarkdownUtil.substitutionRegex);
|
|
41965
|
+
function findSubstitutableUrlsInJson(originalData, placeholderData = [], pendo) {
|
|
41966
|
+
const subRegex = new RegExp(guideMarkdownUtil.substitutionRegex);
|
|
41914
41967
|
if ((originalData.name === 'url' || originalData.name === 'href') && originalData.value) {
|
|
41915
41968
|
if (subRegex.test(originalData.value)) {
|
|
41916
41969
|
placeholderData.push({
|
|
@@ -41920,37 +41973,37 @@ function findSubstitutableUrlsInJson(originalData, placeholderData, pendo) {
|
|
|
41920
41973
|
}
|
|
41921
41974
|
}
|
|
41922
41975
|
if (originalData.properties && originalData.id === 'href_link_block') {
|
|
41923
|
-
pendo._.each(originalData.properties,
|
|
41976
|
+
pendo._.each(originalData.properties, (prop) => {
|
|
41924
41977
|
findSubstitutableUrlsInJson(prop, placeholderData, pendo);
|
|
41925
41978
|
});
|
|
41926
41979
|
}
|
|
41927
41980
|
if (originalData.views) {
|
|
41928
|
-
pendo._.each(originalData.views,
|
|
41981
|
+
pendo._.each(originalData.views, (view) => {
|
|
41929
41982
|
findSubstitutableUrlsInJson(view, placeholderData, pendo);
|
|
41930
41983
|
});
|
|
41931
41984
|
}
|
|
41932
41985
|
if (originalData.parameters) {
|
|
41933
|
-
pendo._.each(originalData.parameters,
|
|
41986
|
+
pendo._.each(originalData.parameters, (param) => {
|
|
41934
41987
|
findSubstitutableUrlsInJson(param, placeholderData, pendo);
|
|
41935
41988
|
});
|
|
41936
41989
|
}
|
|
41937
41990
|
if (originalData.actions) {
|
|
41938
|
-
pendo._.each(originalData.actions,
|
|
41991
|
+
pendo._.each(originalData.actions, (action) => {
|
|
41939
41992
|
findSubstitutableUrlsInJson(action, placeholderData, pendo);
|
|
41940
41993
|
});
|
|
41941
41994
|
}
|
|
41942
41995
|
if (originalData.children) {
|
|
41943
|
-
pendo._.each(originalData.children,
|
|
41996
|
+
pendo._.each(originalData.children, (child) => {
|
|
41944
41997
|
findSubstitutableUrlsInJson(child, placeholderData, pendo);
|
|
41945
41998
|
});
|
|
41946
41999
|
}
|
|
41947
42000
|
return placeholderData;
|
|
41948
42001
|
}
|
|
41949
42002
|
function findSubstitutableElements(pendo) {
|
|
41950
|
-
|
|
42003
|
+
let elements = pendo.dom(`${guideMarkdownUtil.containerSelector} *:not(.pendo-inline-ui)`);
|
|
41951
42004
|
return pendo._.chain(elements)
|
|
41952
42005
|
.filter(function (placeholder) {
|
|
41953
|
-
|
|
42006
|
+
const subRegex = new RegExp(guideMarkdownUtil.substitutionRegex);
|
|
41954
42007
|
if (placeholder.localName === 'a') {
|
|
41955
42008
|
return subRegex.test(decodeURI(placeholder.href)) || subRegex.test(placeholder.textContent);
|
|
41956
42009
|
}
|
|
@@ -42006,25 +42059,51 @@ function findSubstitutableElements(pendo) {
|
|
|
42006
42059
|
.value();
|
|
42007
42060
|
}
|
|
42008
42061
|
function substitutionIcon(color, size) {
|
|
42009
|
-
return (
|
|
42010
|
-
|
|
42011
|
-
|
|
42012
|
-
|
|
42013
|
-
|
|
42014
|
-
|
|
42062
|
+
return (`<div title="Metadata Substitution added">
|
|
42063
|
+
<svg id="pendo-ps-substitution-icon" viewBox="0 0 24 24"
|
|
42064
|
+
preserveAspectRatio="xMidYMid meet"
|
|
42065
|
+
height=${size} width=${size} title="Metadata Substitution"
|
|
42066
|
+
style="bottom:5px; right:10px; position: absolute;"
|
|
42067
|
+
fill="none" xmlns="http://www.w3.org/2000/svg" stroke="${color}"
|
|
42068
|
+
transform="matrix(1, 0, 0, 1, 0, 0)rotate(0)">
|
|
42069
|
+
<g stroke-width="0"></g>
|
|
42070
|
+
<g stroke-linecap="round" stroke-linejoin="round"
|
|
42071
|
+
stroke="${color}" stroke-width="0.528"></g>
|
|
42072
|
+
<g><path fill-rule="evenodd" clip-rule="evenodd"
|
|
42073
|
+
d="M5 5.5C4.17157 5.5 3.5 6.17157 3.5 7V10C3.5 10.8284
|
|
42074
|
+
4.17157 11.5 5 11.5H8C8.82843 11.5 9.5 10.8284 9.5
|
|
42075
|
+
10V9H17V11C17 11.2761 17.2239 11.5 17.5 11.5C17.7761
|
|
42076
|
+
11.5 18 11.2761 18 11V8.5C18 8.22386 17.7761 8 17.5
|
|
42077
|
+
8H9.5V7C9.5 6.17157 8.82843 5.5 8 5.5H5ZM8.5 7C8.5
|
|
42078
|
+
6.72386 8.27614 6.5 8 6.5H5C4.72386 6.5 4.5 6.72386
|
|
42079
|
+
4.5 7V10C4.5 10.2761 4.72386 10.5 5 10.5H8C8.27614
|
|
42080
|
+
10.5 8.5 10.2761 8.5 10V7Z" fill="${color}"></path>
|
|
42081
|
+
<path fill-rule="evenodd" clip-rule="evenodd"
|
|
42082
|
+
d="M7 13C7 12.7239 6.77614 12.5 6.5 12.5C6.22386 12.5
|
|
42083
|
+
6 12.7239 6 13V15.5C6 15.7761 6.22386 16 6.5
|
|
42084
|
+
16H14.5V17C14.5 17.8284 15.1716 18.5 16 18.5H19C19.8284
|
|
42085
|
+
18.5 20.5 17.8284 20.5 17V14C20.5 13.1716 19.8284 12.5
|
|
42086
|
+
19 12.5H16C15.1716 12.5 14.5 13.1716 14.5
|
|
42087
|
+
14V15H7V13ZM15.5 17C15.5 17.2761 15.7239 17.5 16
|
|
42088
|
+
17.5H19C19.2761 17.5 19.5 17.2761 19.5 17V14C19.5
|
|
42089
|
+
13.7239 19.2761 13.5 19 13.5H16C15.7239 13.5 15.5
|
|
42090
|
+
13.7239 15.5 14V17Z" fill="${color}"></path> </g></svg></div>`);
|
|
42091
|
+
}
|
|
42092
|
+
|
|
42093
|
+
const requiredElement = '<span class="_pendo-required-indicator" style="color:red; font-style:italic;" title="Question is required"> *</span>';
|
|
42094
|
+
const requiredSyntax = '{required/}';
|
|
42095
|
+
const RequiredQuestions = {
|
|
42015
42096
|
name: 'RequiredQuestions',
|
|
42016
|
-
script
|
|
42097
|
+
script(step, guide, pendo) {
|
|
42017
42098
|
var _a;
|
|
42018
|
-
|
|
42019
|
-
|
|
42020
|
-
|
|
42021
|
-
});
|
|
42022
|
-
var requiredQuestions = processRequiredQuestions();
|
|
42099
|
+
let requiredPollIds = [];
|
|
42100
|
+
let submitButtons = (_a = guideMarkdownUtil.lookupGuideButtons(step.domJson)) === null || _a === void 0 ? void 0 : _a.filter(button => button.actions.find(action => action.action === 'submitPoll' || action.action === 'submitPollAndGoToStep'));
|
|
42101
|
+
const requiredQuestions = processRequiredQuestions();
|
|
42023
42102
|
if (requiredQuestions) {
|
|
42024
|
-
pendo._.forEach(requiredQuestions,
|
|
42103
|
+
pendo._.forEach(requiredQuestions, (question) => {
|
|
42025
42104
|
if (question.classList.contains('_pendo-open-text-poll-question')) {
|
|
42026
|
-
|
|
42027
|
-
step.attachEvent(step.guideElement.find(
|
|
42105
|
+
let pollId = question.dataset.pendoPollId;
|
|
42106
|
+
step.attachEvent(step.guideElement.find(`[data-pendo-poll-id=${pollId}]._pendo-open-text-poll-input`)[0], 'input', function () {
|
|
42028
42107
|
evaluateRequiredQuestions(requiredQuestions);
|
|
42029
42108
|
});
|
|
42030
42109
|
}
|
|
@@ -42036,13 +42115,11 @@ var RequiredQuestions = {
|
|
|
42036
42115
|
});
|
|
42037
42116
|
}
|
|
42038
42117
|
function getEligibleQuestions() {
|
|
42039
|
-
|
|
42040
|
-
|
|
42041
|
-
|
|
42042
|
-
|
|
42043
|
-
|
|
42044
|
-
var allQuestions = pendo._.uniq(pollQuestions.concat(surveyQuestions));
|
|
42045
|
-
return pendo._.reduce(allQuestions, function (eligibleQuestions, question) {
|
|
42118
|
+
const pollQuestions = pendo._.toArray(step.guideElement.find(`[class*=-poll-question]:contains(${requiredSyntax})`));
|
|
42119
|
+
const surveyMatches = pendo._.toArray(step.guideElement.find(`[data-pendo-poll-id]:contains(${requiredSyntax})`));
|
|
42120
|
+
const surveyQuestions = pendo._.filter(surveyMatches, (candidate) => !pendo._.some(surveyMatches, (other) => other !== candidate && candidate.contains(other)));
|
|
42121
|
+
const allQuestions = pendo._.uniq(pollQuestions.concat(surveyQuestions));
|
|
42122
|
+
return pendo._.reduce(allQuestions, (eligibleQuestions, question) => {
|
|
42046
42123
|
if (question.classList.contains('_pendo-yes-no-poll-question'))
|
|
42047
42124
|
return eligibleQuestions;
|
|
42048
42125
|
eligibleQuestions.push(question);
|
|
@@ -42050,24 +42127,22 @@ var RequiredQuestions = {
|
|
|
42050
42127
|
}, []);
|
|
42051
42128
|
}
|
|
42052
42129
|
function ownsRequiredText(element) {
|
|
42053
|
-
return pendo._.some(element.childNodes,
|
|
42054
|
-
return node.nodeType === 3 && node.nodeValue && node.nodeValue.indexOf(requiredSyntax) !== -1;
|
|
42055
|
-
});
|
|
42130
|
+
return pendo._.some(element.childNodes, (node) => node.nodeType === 3 && node.nodeValue && node.nodeValue.indexOf(requiredSyntax) !== -1);
|
|
42056
42131
|
}
|
|
42057
42132
|
function processRequiredQuestions() {
|
|
42058
|
-
|
|
42133
|
+
let questions = getEligibleQuestions();
|
|
42059
42134
|
if (questions) {
|
|
42060
|
-
pendo._.forEach(questions,
|
|
42061
|
-
|
|
42135
|
+
pendo._.forEach(questions, question => {
|
|
42136
|
+
let dataPendoPollId = question.getAttribute('data-pendo-poll-id');
|
|
42062
42137
|
requiredPollIds.push(dataPendoPollId);
|
|
42063
|
-
|
|
42064
|
-
|
|
42065
|
-
pendo._.each(candidates,
|
|
42138
|
+
const candidates = step.guideElement.find(`#${question.id} *, #${question.id}`);
|
|
42139
|
+
const textHost = pendo._.find(candidates, ownsRequiredText) || question;
|
|
42140
|
+
pendo._.each(candidates, (element) => {
|
|
42066
42141
|
guideMarkdownUtil.removeMarkdownSyntax(element, requiredSyntax, '', pendo);
|
|
42067
42142
|
});
|
|
42068
|
-
|
|
42143
|
+
const textHostEl = pendo.dom(textHost);
|
|
42069
42144
|
if (textHostEl.find('._pendo-required-indicator').length === 0) {
|
|
42070
|
-
|
|
42145
|
+
const questionParagraph = textHostEl.find('p');
|
|
42071
42146
|
if (questionParagraph && questionParagraph.length) {
|
|
42072
42147
|
pendo.dom(questionParagraph[0]).append(requiredElement);
|
|
42073
42148
|
}
|
|
@@ -42078,7 +42153,15 @@ var RequiredQuestions = {
|
|
|
42078
42153
|
});
|
|
42079
42154
|
}
|
|
42080
42155
|
if (pendo._.size(requiredPollIds)) {
|
|
42081
|
-
|
|
42156
|
+
const disabledButtonStyles = `<style type=text/css
|
|
42157
|
+
id=_pendo-guide-required-disabled>
|
|
42158
|
+
._pendo-button:disabled, ._pendo-buttons[disabled] {
|
|
42159
|
+
border: 1px solid #999999 !important;
|
|
42160
|
+
background-color: #cccccc !important;
|
|
42161
|
+
color: #666666 !important;
|
|
42162
|
+
pointer-events: none !important;
|
|
42163
|
+
}
|
|
42164
|
+
</style>`;
|
|
42082
42165
|
if (pendo.dom('#_pendo-guide-required-disabled').length === 0) {
|
|
42083
42166
|
pendo.dom('head').append(disabledButtonStyles);
|
|
42084
42167
|
}
|
|
@@ -42089,11 +42172,15 @@ var RequiredQuestions = {
|
|
|
42089
42172
|
function evaluateRequiredQuestions(questions) {
|
|
42090
42173
|
if (questions.length === 0)
|
|
42091
42174
|
return;
|
|
42092
|
-
|
|
42093
|
-
|
|
42094
|
-
responses = responses.concat(pendo._.map(questions,
|
|
42095
|
-
|
|
42096
|
-
|
|
42175
|
+
let allRequiredComplete = true;
|
|
42176
|
+
let responses = [];
|
|
42177
|
+
responses = responses.concat(pendo._.map(questions, (question) => {
|
|
42178
|
+
let pollId = question.getAttribute('data-pendo-poll-id');
|
|
42179
|
+
let input = step.guideElement.find(`
|
|
42180
|
+
[data-pendo-poll-id=${pollId}] textarea,
|
|
42181
|
+
[data-pendo-poll-id=${pollId}] input:text,
|
|
42182
|
+
[data-pendo-poll-id=${pollId}] select,
|
|
42183
|
+
[data-pendo-poll-id=${pollId}] input:radio:checked`);
|
|
42097
42184
|
if (input && input.length && input[0].value) {
|
|
42098
42185
|
return input[0].value;
|
|
42099
42186
|
}
|
|
@@ -42110,50 +42197,50 @@ var RequiredQuestions = {
|
|
|
42110
42197
|
}
|
|
42111
42198
|
function disableEligibleButtons(buttons) {
|
|
42112
42199
|
pendo._.each(buttons, function (button) {
|
|
42113
|
-
if (step.guideElement.find(
|
|
42114
|
-
step.guideElement.find(
|
|
42115
|
-
step.guideElement.find(
|
|
42200
|
+
if (step.guideElement.find(`#${button.props.id}`)[0]) {
|
|
42201
|
+
step.guideElement.find(`#${button.props.id}`)[0].disabled = true;
|
|
42202
|
+
step.guideElement.find(`#${button.props.id}`)[0].parentElement.title = 'Please complete all required questions.';
|
|
42116
42203
|
}
|
|
42117
42204
|
});
|
|
42118
42205
|
}
|
|
42119
42206
|
function enableEligibleButtons(buttons) {
|
|
42120
42207
|
pendo._.each(buttons, function (button) {
|
|
42121
|
-
if (step.guideElement.find(
|
|
42122
|
-
step.guideElement.find(
|
|
42123
|
-
step.guideElement.find(
|
|
42208
|
+
if (step.guideElement.find(`#${button.props.id}`)[0]) {
|
|
42209
|
+
step.guideElement.find(`#${button.props.id}`)[0].disabled = false;
|
|
42210
|
+
step.guideElement.find(`#${button.props.id}`)[0].parentElement.title = '';
|
|
42124
42211
|
}
|
|
42125
42212
|
});
|
|
42126
42213
|
}
|
|
42127
42214
|
},
|
|
42128
|
-
test
|
|
42215
|
+
test(step, guide, pendo) {
|
|
42129
42216
|
var _a, _b;
|
|
42130
|
-
|
|
42131
|
-
|
|
42217
|
+
const pollQuestions = (_a = step.guideElement) === null || _a === void 0 ? void 0 : _a.find(`[class*=-poll-question]:contains(${requiredSyntax})`);
|
|
42218
|
+
const surveyQuestions = (_b = step.guideElement) === null || _b === void 0 ? void 0 : _b.find(`[data-pendo-poll-id]:contains(${requiredSyntax})`);
|
|
42132
42219
|
return (!pendo._.isUndefined(pollQuestions) && pendo._.size(pollQuestions)) ||
|
|
42133
42220
|
(!pendo._.isUndefined(surveyQuestions) && pendo._.size(surveyQuestions));
|
|
42134
42221
|
},
|
|
42135
|
-
designerListener
|
|
42136
|
-
|
|
42137
|
-
|
|
42138
|
-
|
|
42222
|
+
designerListener(pendo) {
|
|
42223
|
+
const requiredQuestions = [];
|
|
42224
|
+
const target = pendo.dom.getBody();
|
|
42225
|
+
const config = {
|
|
42139
42226
|
attributeFilter: ['data-layout'],
|
|
42140
42227
|
attributes: true,
|
|
42141
42228
|
childList: true,
|
|
42142
42229
|
characterData: true,
|
|
42143
42230
|
subtree: true
|
|
42144
42231
|
};
|
|
42145
|
-
|
|
42146
|
-
|
|
42232
|
+
const MutationObserver = getZoneSafeMethod(pendo._, 'MutationObserver');
|
|
42233
|
+
const observer = new MutationObserver(applyRequiredIndicators);
|
|
42147
42234
|
observer.observe(target, config);
|
|
42148
42235
|
function applyRequiredIndicators(mutations) {
|
|
42149
42236
|
pendo._.each(mutations, function (mutation) {
|
|
42150
42237
|
var _a;
|
|
42151
|
-
|
|
42238
|
+
const nodeHasQuerySelector = pendo._.isFunction((_a = mutation.addedNodes[0]) === null || _a === void 0 ? void 0 : _a.querySelectorAll);
|
|
42152
42239
|
if (mutation.addedNodes.length && nodeHasQuerySelector) {
|
|
42153
|
-
|
|
42240
|
+
let eligiblePolls = mutation.addedNodes[0].querySelectorAll('[class*=-poll-wrapper], [class*=-poll-select-border], [id^=survey-item-wrapper__]');
|
|
42154
42241
|
if (eligiblePolls) {
|
|
42155
42242
|
pendo._.each(eligiblePolls, function (poll) {
|
|
42156
|
-
|
|
42243
|
+
let dataPendoPollId;
|
|
42157
42244
|
if (poll.classList.contains('_pendo-open-text-poll-wrapper') ||
|
|
42158
42245
|
poll.classList.contains('_pendo-number-scale-poll-wrapper')) {
|
|
42159
42246
|
dataPendoPollId = poll.getAttribute('name');
|
|
@@ -42161,31 +42248,31 @@ var RequiredQuestions = {
|
|
|
42161
42248
|
else {
|
|
42162
42249
|
dataPendoPollId = poll.getAttribute('data-pendo-poll-id');
|
|
42163
42250
|
}
|
|
42164
|
-
|
|
42165
|
-
|
|
42166
|
-
pendo.dom(
|
|
42251
|
+
let questionText;
|
|
42252
|
+
const questionElement = pendo.dom(`[class*="-poll-question"][data-pendo-poll-id=${dataPendoPollId}]`)[0] ||
|
|
42253
|
+
pendo.dom(`.bb-text[data-pendo-poll-id=${dataPendoPollId}]`)[0];
|
|
42167
42254
|
if (questionElement) {
|
|
42168
42255
|
questionText = questionElement.textContent;
|
|
42169
42256
|
}
|
|
42170
|
-
|
|
42257
|
+
const requiredSyntaxIndex = questionText ? questionText.indexOf(requiredSyntax) : -1;
|
|
42171
42258
|
if (requiredSyntaxIndex > -1) {
|
|
42172
|
-
pendo._.each(pendo.dom(
|
|
42173
|
-
pendo._.each(pendo.dom(
|
|
42259
|
+
pendo._.each(pendo.dom(`[data-pendo-poll-id=${dataPendoPollId}]:not(.pendo-radio)`), (element) => {
|
|
42260
|
+
pendo._.each(pendo.dom(`#${element.id} *:not(".pendo-radio"), #${element.id}:not(".pendo-radio")`), (item) => {
|
|
42174
42261
|
guideMarkdownUtil.removeMarkdownSyntax(item, requiredSyntax, '', pendo);
|
|
42175
42262
|
});
|
|
42176
42263
|
});
|
|
42177
|
-
|
|
42178
|
-
|
|
42179
|
-
|
|
42180
|
-
|
|
42181
|
-
pendo._.each(pendo.dom(
|
|
42182
|
-
pendo._.each(el.childNodes,
|
|
42264
|
+
const pollTextSelector = `.bb-text[data-pendo-poll-id=${dataPendoPollId}]`;
|
|
42265
|
+
const pollParagraphSelector = `${pollTextSelector} p`;
|
|
42266
|
+
const pollListItemSelector = `${pollTextSelector} li`;
|
|
42267
|
+
const pollIndicatorSelector = `${pollTextSelector} ._pendo-required-indicator`;
|
|
42268
|
+
pendo._.each(pendo.dom(`${pollParagraphSelector}, ${pollListItemSelector}`), (el) => {
|
|
42269
|
+
pendo._.each(el.childNodes, (node) => {
|
|
42183
42270
|
if (node.nodeType === 3 && node.nodeValue.indexOf(requiredSyntax) !== -1) {
|
|
42184
42271
|
node.nodeValue = node.nodeValue.split(requiredSyntax).join('');
|
|
42185
42272
|
}
|
|
42186
42273
|
});
|
|
42187
42274
|
});
|
|
42188
|
-
|
|
42275
|
+
const hasIndicator = pendo.dom(pollIndicatorSelector).length !== 0;
|
|
42189
42276
|
if (!hasIndicator) {
|
|
42190
42277
|
if (pendo.dom(pollParagraphSelector).length !== 0 || pendo.dom(pollListItemSelector).length !== 0) {
|
|
42191
42278
|
pendo.dom(pollParagraphSelector).append(requiredElement);
|
|
@@ -42196,7 +42283,7 @@ var RequiredQuestions = {
|
|
|
42196
42283
|
}
|
|
42197
42284
|
}
|
|
42198
42285
|
if (pendo._.contains(requiredQuestions, dataPendoPollId)) {
|
|
42199
|
-
|
|
42286
|
+
let questionIndex = requiredQuestions.indexOf(dataPendoPollId);
|
|
42200
42287
|
if (questionIndex !== -1) {
|
|
42201
42288
|
requiredQuestions.splice(questionIndex, 1);
|
|
42202
42289
|
}
|
|
@@ -42207,7 +42294,7 @@ var RequiredQuestions = {
|
|
|
42207
42294
|
}
|
|
42208
42295
|
else {
|
|
42209
42296
|
if (pendo._.contains(requiredQuestions, dataPendoPollId)) {
|
|
42210
|
-
|
|
42297
|
+
let index = requiredQuestions.indexOf(dataPendoPollId);
|
|
42211
42298
|
if (index !== -1) {
|
|
42212
42299
|
requiredQuestions.splice(index, 1);
|
|
42213
42300
|
}
|
|
@@ -42221,54 +42308,54 @@ var RequiredQuestions = {
|
|
|
42221
42308
|
}
|
|
42222
42309
|
};
|
|
42223
42310
|
|
|
42224
|
-
|
|
42225
|
-
|
|
42226
|
-
script
|
|
42227
|
-
|
|
42228
|
-
|
|
42229
|
-
|
|
42230
|
-
|
|
42231
|
-
|
|
42311
|
+
const skipStepRegex = new RegExp(guideMarkdownUtil.skipStepString);
|
|
42312
|
+
const SkipToEligibleStep = {
|
|
42313
|
+
script(step, guide, pendo) {
|
|
42314
|
+
let isAdvanceIntercepted = false;
|
|
42315
|
+
let isPreviousIntercepted = false;
|
|
42316
|
+
let guideContainer = step.guideElement.find(guideMarkdownUtil.containerSelector);
|
|
42317
|
+
let guideContainerAriaLabel = guideContainer.attr('aria-label');
|
|
42318
|
+
let stepNumberOrAuto = skipStepRegex.exec(guideContainerAriaLabel)[1];
|
|
42232
42319
|
if (guideContainer) {
|
|
42233
42320
|
guideContainer.attr({ 'aria-label': guideContainer.attr('aria-label').replace(skipStepRegex, '') });
|
|
42234
42321
|
}
|
|
42235
|
-
this.on('beforeAdvance',
|
|
42322
|
+
this.on('beforeAdvance', (evt) => {
|
|
42236
42323
|
if (guide.getPositionOfStep(step) === guide.steps.length || pendo._.isUndefined(stepNumberOrAuto))
|
|
42237
42324
|
return; // exit on the last step of a guide or when we don't have an argument
|
|
42238
|
-
|
|
42325
|
+
let eligibleStep = findEligibleSkipStep(stepNumberOrAuto, 'next');
|
|
42239
42326
|
if (!isAdvanceIntercepted && stepNumberOrAuto) {
|
|
42240
42327
|
isAdvanceIntercepted = true;
|
|
42241
|
-
pendo.goToStep({ destinationStepId: eligibleStep.id, step
|
|
42328
|
+
pendo.goToStep({ destinationStepId: eligibleStep.id, step });
|
|
42242
42329
|
evt.cancel = true;
|
|
42243
42330
|
}
|
|
42244
42331
|
});
|
|
42245
|
-
this.on('beforePrevious',
|
|
42332
|
+
this.on('beforePrevious', (evt) => {
|
|
42246
42333
|
if (pendo._.isUndefined(stepNumberOrAuto))
|
|
42247
42334
|
return;
|
|
42248
|
-
|
|
42335
|
+
let eligibleStep = findEligibleSkipStep(stepNumberOrAuto, 'previous');
|
|
42249
42336
|
if (!isPreviousIntercepted && stepNumberOrAuto) {
|
|
42250
42337
|
isPreviousIntercepted = true;
|
|
42251
|
-
pendo.goToStep({ destinationStepId: eligibleStep.id, step
|
|
42338
|
+
pendo.goToStep({ destinationStepId: eligibleStep.id, step });
|
|
42252
42339
|
evt.cancel = true;
|
|
42253
42340
|
}
|
|
42254
42341
|
});
|
|
42255
42342
|
function findEligibleSkipStep(stepNumber, direction) {
|
|
42256
42343
|
// Find the next eligible step by using getPosition of step (1 based)
|
|
42257
42344
|
// getPosition - 2 gives the previous step
|
|
42258
|
-
|
|
42259
|
-
|
|
42345
|
+
let skipForwardStep = findStepOnPage(guide.getPositionOfStep(step), 'next', stepNumber);
|
|
42346
|
+
let skipPreviousStep = findStepOnPage(guide.getPositionOfStep(step) - 2, 'previous', stepNumber);
|
|
42260
42347
|
if (skipForwardStep && direction == 'next') {
|
|
42261
|
-
pendo.goToStep({ destinationStepId: skipForwardStep, step
|
|
42348
|
+
pendo.goToStep({ destinationStepId: skipForwardStep, step });
|
|
42262
42349
|
}
|
|
42263
42350
|
if (skipPreviousStep && direction == 'previous') {
|
|
42264
|
-
pendo.goToStep({ destinationStepId: skipPreviousStep, step
|
|
42351
|
+
pendo.goToStep({ destinationStepId: skipPreviousStep, step });
|
|
42265
42352
|
}
|
|
42266
42353
|
return direction === 'next' ? skipForwardStep : skipPreviousStep;
|
|
42267
42354
|
}
|
|
42268
42355
|
function findStepOnPage(stepIndex, direction, stepNumber) {
|
|
42269
42356
|
if (pendo._.isNaN(stepIndex))
|
|
42270
42357
|
return;
|
|
42271
|
-
|
|
42358
|
+
let $step = guide.steps[stepIndex];
|
|
42272
42359
|
if ($step && !$step.canShow()) {
|
|
42273
42360
|
if (stepNumber !== 'auto') {
|
|
42274
42361
|
return guide.steps[stepNumber - 1];
|
|
@@ -42285,34 +42372,34 @@ var SkipToEligibleStep = {
|
|
|
42285
42372
|
}
|
|
42286
42373
|
}
|
|
42287
42374
|
},
|
|
42288
|
-
test
|
|
42375
|
+
test(step, guide, pendo) {
|
|
42289
42376
|
var _a;
|
|
42290
|
-
|
|
42377
|
+
const guideContainerAriaLabel = (_a = step.guideElement) === null || _a === void 0 ? void 0 : _a.find(guideMarkdownUtil.containerSelector).attr('aria-label');
|
|
42291
42378
|
return pendo._.isString(guideContainerAriaLabel) && guideContainerAriaLabel.indexOf('{skipStep') !== -1;
|
|
42292
42379
|
},
|
|
42293
|
-
designerListener
|
|
42294
|
-
|
|
42295
|
-
|
|
42380
|
+
designerListener(pendo) {
|
|
42381
|
+
const target = pendo.dom.getBody();
|
|
42382
|
+
const config = {
|
|
42296
42383
|
attributeFilter: ['data-layout'],
|
|
42297
42384
|
attributes: true,
|
|
42298
42385
|
childList: true,
|
|
42299
42386
|
characterData: true,
|
|
42300
42387
|
subtree: true
|
|
42301
42388
|
};
|
|
42302
|
-
|
|
42303
|
-
|
|
42389
|
+
const MutationObserver = getZoneSafeMethod(pendo._, 'MutationObserver');
|
|
42390
|
+
const observer = new MutationObserver(applySkipStepIndicator);
|
|
42304
42391
|
observer.observe(target, config);
|
|
42305
42392
|
// create an observer instance
|
|
42306
42393
|
function applySkipStepIndicator(mutations) {
|
|
42307
42394
|
pendo._.each(mutations, function (mutation) {
|
|
42308
42395
|
var _a, _b;
|
|
42309
|
-
|
|
42396
|
+
const nodeHasQuerySelector = pendo._.isFunction((_a = mutation.addedNodes[0]) === null || _a === void 0 ? void 0 : _a.querySelectorAll);
|
|
42310
42397
|
if (mutation.addedNodes.length && nodeHasQuerySelector) {
|
|
42311
|
-
|
|
42312
|
-
|
|
42398
|
+
let guideContainer = mutation.addedNodes[0].querySelectorAll(guideMarkdownUtil.containerSelector);
|
|
42399
|
+
let guideContainerAriaLabel = (_b = guideContainer[0]) === null || _b === void 0 ? void 0 : _b.getAttribute('aria-label');
|
|
42313
42400
|
if (guideContainerAriaLabel) {
|
|
42314
42401
|
if (guideContainerAriaLabel.match(skipStepRegex)) {
|
|
42315
|
-
|
|
42402
|
+
let fullSkipStepString = guideContainerAriaLabel.match(skipStepRegex)[0];
|
|
42316
42403
|
guideContainerAriaLabel.replace(fullSkipStepString, '');
|
|
42317
42404
|
if (!pendo.dom('#_pendoSkipIcon').length) {
|
|
42318
42405
|
pendo.dom(guideMarkdownUtil.containerSelector).append(skipIcon('#999', '30px').trim());
|
|
@@ -42323,30 +42410,48 @@ var SkipToEligibleStep = {
|
|
|
42323
42410
|
});
|
|
42324
42411
|
}
|
|
42325
42412
|
function skipIcon(color, size) {
|
|
42326
|
-
return (
|
|
42413
|
+
return (`<div title="Skip step added"><svg id="_pendoSkipIcon" version="1.0" xmlns="http://www.w3.org/2000/svg"
|
|
42414
|
+
width="${size}" height="${size}" viewBox="0 0 512.000000 512.000000"
|
|
42415
|
+
preserveAspectRatio="xMidYMid meet" style="bottom:5px; right:10px; position: absolute;">
|
|
42416
|
+
<g transform="translate(0.000000,512.000000) scale(0.100000,-0.100000)"
|
|
42417
|
+
fill="${color}" stroke="none">
|
|
42418
|
+
<path d="M2185 4469 c-363 -38 -739 -186 -1034 -407 -95 -71 -273 -243 -357
|
|
42419
|
+
-343 -205 -246 -364 -577 -429 -897 -25 -121 -45 -288 -45 -373 l0 -49 160 0
|
|
42420
|
+
160 0 0 48 c0 26 5 88 10 137 68 593 417 1103 940 1374 1100 570 2418 -137
|
|
42421
|
+
2560 -1374 5 -49 10 -111 10 -137 l0 -47 -155 -3 -155 -3 235 -235 235 -236
|
|
42422
|
+
235 236 235 235 -155 3 -155 3 0 48 c0 27 -5 95 -10 152 -100 989 -878 1767
|
|
42423
|
+
-1869 1868 -117 12 -298 12 -416 0z"/>
|
|
42424
|
+
<path d="M320 1440 l0 -160 160 0 160 0 0 160 0 160 -160 0 -160 0 0 -160z"/>
|
|
42425
|
+
<path d="M960 1440 l0 -160 160 0 160 0 0 160 0 160 -160 0 -160 0 0 -160z"/>
|
|
42426
|
+
<path d="M1600 1440 l0 -160 160 0 160 0 0 160 0 160 -160 0 -160 0 0 -160z"/>
|
|
42427
|
+
<path d="M2240 1440 l0 -160 160 0 160 0 0 160 0 160 -160 0 -160 0 0 -160z"/>
|
|
42428
|
+
<path d="M2880 1440 l0 -160 160 0 160 0 0 160 0 160 -160 0 -160 0 0 -160z"/>
|
|
42429
|
+
<path d="M3840 1440 l0 -160 480 0 480 0 0 160 0 160 -480 0 -480 0 0 -160z"/>
|
|
42430
|
+
</g></svg></div>
|
|
42431
|
+
`);
|
|
42327
42432
|
}
|
|
42328
42433
|
}
|
|
42329
42434
|
};
|
|
42330
42435
|
|
|
42331
42436
|
function GuideMarkdown() {
|
|
42332
|
-
|
|
42333
|
-
|
|
42334
|
-
|
|
42437
|
+
let guideMarkdown;
|
|
42438
|
+
let pluginApi;
|
|
42439
|
+
let globalPendo;
|
|
42335
42440
|
return {
|
|
42336
42441
|
name: 'GuideMarkdown',
|
|
42337
42442
|
initialize: init,
|
|
42338
|
-
teardown
|
|
42443
|
+
teardown
|
|
42339
42444
|
};
|
|
42340
42445
|
function init(pendo, PluginAPI) {
|
|
42341
42446
|
globalPendo = pendo;
|
|
42342
42447
|
pluginApi = PluginAPI;
|
|
42343
|
-
|
|
42344
|
-
|
|
42448
|
+
const configReader = PluginAPI.ConfigReader;
|
|
42449
|
+
const GUIDEMARKDOWN_CONFIG = 'guideMarkdown';
|
|
42345
42450
|
configReader.addOption(GUIDEMARKDOWN_CONFIG, [
|
|
42346
42451
|
configReader.sources.SNIPPET_SRC,
|
|
42347
42452
|
configReader.sources.PENDO_CONFIG_SRC
|
|
42348
42453
|
], false);
|
|
42349
|
-
|
|
42454
|
+
const markdownScriptsEnabled = configReader.get(GUIDEMARKDOWN_CONFIG);
|
|
42350
42455
|
if (!markdownScriptsEnabled)
|
|
42351
42456
|
return;
|
|
42352
42457
|
guideMarkdown = [PollBranching, MetadataSubstitution, RequiredQuestions, SkipToEligibleStep];
|
|
@@ -43385,8 +43490,8 @@ function Feedback() {
|
|
|
43385
43490
|
var widgetLoaded = false;
|
|
43386
43491
|
var feedbackAllowedProductId = '';
|
|
43387
43492
|
var initialized = false;
|
|
43388
|
-
|
|
43389
|
-
|
|
43493
|
+
const PING_COOKIE = 'feedback_ping_sent';
|
|
43494
|
+
const PING_COOKIE_EXPIRATION = 1000 * 60 * 60;
|
|
43390
43495
|
var overflowMediaQuery = '@media only screen and (max-device-width:1112px){#feedback-widget{overflow-y:scroll}}';
|
|
43391
43496
|
var slideIn = '@-webkit-keyframes pendoFeedbackSlideIn{from{opacity:0;transform:translate(145px,0) rotate(270deg) translateY(-50%)}to{opacity:1;transform:translate(50%,0) rotate(270deg) translateY(-50%)}}@keyframes pendoFeedbackSlideIn{from{opacity:0;transform:translate(145px,0) rotate(270deg) translateY(-50%)}to{opacity:1;transform:translate(50%,0) rotate(270deg) translateY(-50%)}}';
|
|
43392
43497
|
var slideInLeft = '@-webkit-keyframes pendoFeedbackSlideIn-left{from{opacity:0;transform:rotate(270deg) translateX(-55%) translateY(-55%)}to{opacity:1;transform:rotate(270deg) translateX(-55%) translateY(0)}}@keyframes pendoFeedbackSlideIn-left{from{opacity:0;transform:rotate(270deg) translateX(-55%) translateY(-55%)}to{opacity:1;transform:rotate(270deg) translateX(-55%) translateY(0)}}';
|
|
@@ -43406,28 +43511,28 @@ function Feedback() {
|
|
|
43406
43511
|
feedbackStyles: 'pendo-feedback-styles',
|
|
43407
43512
|
feedbackFrameStyles: 'pendo-feedback-visible-buttons-styles'
|
|
43408
43513
|
};
|
|
43409
|
-
|
|
43410
|
-
|
|
43514
|
+
let globalPendo;
|
|
43515
|
+
let pluginApi;
|
|
43411
43516
|
return {
|
|
43412
43517
|
name: 'Feedback',
|
|
43413
|
-
initialize
|
|
43414
|
-
teardown
|
|
43415
|
-
validate
|
|
43518
|
+
initialize,
|
|
43519
|
+
teardown,
|
|
43520
|
+
validate
|
|
43416
43521
|
};
|
|
43417
43522
|
function initialize(pendo, PluginAPI) {
|
|
43418
43523
|
globalPendo = pendo;
|
|
43419
43524
|
pluginApi = PluginAPI;
|
|
43420
43525
|
var publicFeedback = {
|
|
43421
|
-
ping
|
|
43422
|
-
init
|
|
43526
|
+
ping,
|
|
43527
|
+
init,
|
|
43423
43528
|
initialized: getInitialized,
|
|
43424
|
-
loginAndRedirect
|
|
43425
|
-
openFeedback
|
|
43426
|
-
initializeFeedbackOnce
|
|
43427
|
-
isFeedbackLoaded
|
|
43428
|
-
convertPendoToFeedbackOptions
|
|
43529
|
+
loginAndRedirect,
|
|
43530
|
+
openFeedback,
|
|
43531
|
+
initializeFeedbackOnce,
|
|
43532
|
+
isFeedbackLoaded,
|
|
43533
|
+
convertPendoToFeedbackOptions,
|
|
43429
43534
|
isUnsupportedIE: pendo._.partial(isUnsupportedIE, PluginAPI),
|
|
43430
|
-
removeFeedbackWidget
|
|
43535
|
+
removeFeedbackWidget
|
|
43431
43536
|
};
|
|
43432
43537
|
pendo.feedback = publicFeedback;
|
|
43433
43538
|
pendo.getFeedbackSettings = getFeedbackSettings;
|
|
@@ -43455,7 +43560,7 @@ function Feedback() {
|
|
|
43455
43560
|
*/
|
|
43456
43561
|
PluginAPI.agentStorage.registry.addLocal(PING_COOKIE, { duration: PING_COOKIE_EXPIRATION });
|
|
43457
43562
|
return {
|
|
43458
|
-
validate
|
|
43563
|
+
validate
|
|
43459
43564
|
};
|
|
43460
43565
|
}
|
|
43461
43566
|
function teardown() {
|
|
@@ -43475,18 +43580,18 @@ function Feedback() {
|
|
|
43475
43580
|
return result;
|
|
43476
43581
|
}
|
|
43477
43582
|
function pingOrInitialize() {
|
|
43478
|
-
|
|
43583
|
+
const options = getPendoOptions();
|
|
43479
43584
|
if (initialized) {
|
|
43480
|
-
|
|
43585
|
+
const feedbackOptions = convertPendoToFeedbackOptions(options);
|
|
43481
43586
|
ping(feedbackOptions);
|
|
43482
43587
|
}
|
|
43483
43588
|
else if (shouldInitializeFeedback() && !globalPendo._.isEmpty(options)) {
|
|
43484
|
-
|
|
43485
|
-
init(options, settings)
|
|
43589
|
+
const settings = pluginApi.ConfigReader.get('feedbackSettings');
|
|
43590
|
+
init(options, settings).catch(globalPendo._.noop);
|
|
43486
43591
|
}
|
|
43487
43592
|
}
|
|
43488
43593
|
function handleIdentityChange(event) {
|
|
43489
|
-
|
|
43594
|
+
const visitorId = globalPendo._.get(event, 'data.0.visitor_id') || globalPendo._.get(event, 'data.0.options.visitor.id');
|
|
43490
43595
|
if (globalPendo.isAnonymousVisitor(visitorId)) {
|
|
43491
43596
|
removeFeedbackWidget();
|
|
43492
43597
|
return;
|
|
@@ -43556,9 +43661,9 @@ function Feedback() {
|
|
|
43556
43661
|
if (toSend.data && toSend.data !== '{}' && toSend.data !== 'null') {
|
|
43557
43662
|
return globalPendo.ajax
|
|
43558
43663
|
.postJSON(getFullUrl('/widget/pendo_ping'), toSend)
|
|
43559
|
-
.then(
|
|
43664
|
+
.then((response) => {
|
|
43560
43665
|
onWidgetPingResponse(response);
|
|
43561
|
-
})
|
|
43666
|
+
}).catch(() => { onPingFailure(); });
|
|
43562
43667
|
}
|
|
43563
43668
|
}
|
|
43564
43669
|
return pluginApi.q.resolve();
|
|
@@ -43692,10 +43797,10 @@ function Feedback() {
|
|
|
43692
43797
|
return globalPendo.ajax.postJSON(getFullUrl('/analytics'), toSend);
|
|
43693
43798
|
}
|
|
43694
43799
|
function addOverlay() {
|
|
43695
|
-
|
|
43800
|
+
const widget = globalPendo.dom(`#${elemIds.feedbackWidget}`);
|
|
43696
43801
|
if (!widget)
|
|
43697
43802
|
return;
|
|
43698
|
-
|
|
43803
|
+
const overlayStyles = {
|
|
43699
43804
|
'position': 'fixed',
|
|
43700
43805
|
'top': '0',
|
|
43701
43806
|
'right': '0',
|
|
@@ -43707,7 +43812,7 @@ function Feedback() {
|
|
|
43707
43812
|
'animation': 'pendoFeedbackFadeIn 0.5s 0s 1 alternate both',
|
|
43708
43813
|
'-webkit-animation': 'pendoFeedbackFadeIn 0.5s 0s 1 alternate both'
|
|
43709
43814
|
};
|
|
43710
|
-
|
|
43815
|
+
const overlayElement = globalPendo.dom(document.createElement('div'));
|
|
43711
43816
|
overlayElement.attr('id', 'feedback-overlay');
|
|
43712
43817
|
overlayElement.css(overlayStyles);
|
|
43713
43818
|
overlayElement.appendTo(widget.getParent());
|
|
@@ -43812,22 +43917,22 @@ function Feedback() {
|
|
|
43812
43917
|
}
|
|
43813
43918
|
}
|
|
43814
43919
|
function buildOuterTriggerDiv(positionInfo) {
|
|
43815
|
-
|
|
43816
|
-
|
|
43817
|
-
|
|
43920
|
+
const horizontalStyles = getHorizontalPositionStyles(positionInfo);
|
|
43921
|
+
const verticalStyles = getVerticalPositionStyles(positionInfo);
|
|
43922
|
+
const styles = globalPendo._.extend({
|
|
43818
43923
|
'position': 'fixed',
|
|
43819
43924
|
'height': '43px',
|
|
43820
43925
|
'opacity': '1 !important',
|
|
43821
43926
|
'z-index': '9001'
|
|
43822
43927
|
}, horizontalStyles, verticalStyles);
|
|
43823
|
-
|
|
43928
|
+
const outerTrigger = globalPendo.dom(document.createElement('div'));
|
|
43824
43929
|
outerTrigger.attr('id', elemIds.feedbackTrigger);
|
|
43825
43930
|
outerTrigger.css(styles);
|
|
43826
43931
|
outerTrigger.attr('data-turbolinks-permanent', '');
|
|
43827
43932
|
return outerTrigger;
|
|
43828
43933
|
}
|
|
43829
43934
|
function buildNotification() {
|
|
43830
|
-
|
|
43935
|
+
const styles = {
|
|
43831
43936
|
'background-color': '#D85039',
|
|
43832
43937
|
'color': '#fff',
|
|
43833
43938
|
'border-radius': '50%',
|
|
@@ -43844,20 +43949,20 @@ function Feedback() {
|
|
|
43844
43949
|
'animation-delay': '1s',
|
|
43845
43950
|
'animation-iteration-count': '1'
|
|
43846
43951
|
};
|
|
43847
|
-
|
|
43952
|
+
const notification = globalPendo.dom(document.createElement('span'));
|
|
43848
43953
|
notification.attr('id', 'feedback-trigger-notification');
|
|
43849
43954
|
notification.css(styles);
|
|
43850
43955
|
return notification;
|
|
43851
43956
|
}
|
|
43852
43957
|
function buildTriggerButton(settings, positionInfo) {
|
|
43853
|
-
|
|
43958
|
+
let borderRadius;
|
|
43854
43959
|
if (positionInfo.horizontalPosition === 'left') {
|
|
43855
43960
|
borderRadius = '0 0 5px 5px';
|
|
43856
43961
|
}
|
|
43857
43962
|
else {
|
|
43858
43963
|
borderRadius = '3px 3px 0 0';
|
|
43859
43964
|
}
|
|
43860
|
-
|
|
43965
|
+
const styles = {
|
|
43861
43966
|
'border': 'none',
|
|
43862
43967
|
'padding': '11px 18px 14px 18px',
|
|
43863
43968
|
'background-color': settings.triggerColor,
|
|
@@ -43868,21 +43973,32 @@ function Feedback() {
|
|
|
43868
43973
|
'cursor': 'pointer',
|
|
43869
43974
|
'text-align': 'left'
|
|
43870
43975
|
};
|
|
43871
|
-
|
|
43976
|
+
const triggerButton = globalPendo.dom(document.createElement('button'));
|
|
43872
43977
|
triggerButton.attr('id', elemIds.feedbackTriggerButton);
|
|
43873
43978
|
triggerButton.css(styles);
|
|
43874
43979
|
triggerButton.text(settings.triggerText);
|
|
43875
43980
|
return triggerButton;
|
|
43876
43981
|
}
|
|
43877
43982
|
function addTriggerPseudoStyles() {
|
|
43878
|
-
|
|
43983
|
+
const pseudoStyles = `
|
|
43984
|
+
#feedback-trigger button:hover {
|
|
43985
|
+
box-shadow: 0 -5px 20px rgba(0,0,0,.19) !important;
|
|
43986
|
+
outline: none !important;
|
|
43987
|
+
background: #3e566f !important;
|
|
43988
|
+
}
|
|
43989
|
+
#feedback-trigger button:focus {
|
|
43990
|
+
box-shadow: 0 -5px 20px rgba(0,0,0,.19) !important;
|
|
43991
|
+
outline: none !important;
|
|
43992
|
+
background: #3e566f !important;
|
|
43993
|
+
}
|
|
43994
|
+
`;
|
|
43879
43995
|
pluginApi.util.addInlineStyles('pendo-feedback-trigger-styles', pseudoStyles);
|
|
43880
43996
|
}
|
|
43881
43997
|
function createTrigger(settings, positionInfo) {
|
|
43882
43998
|
addTriggerPseudoStyles();
|
|
43883
|
-
|
|
43884
|
-
|
|
43885
|
-
|
|
43999
|
+
const triggerElement = buildOuterTriggerDiv(positionInfo);
|
|
44000
|
+
const notificationElement = buildNotification();
|
|
44001
|
+
const triggerButtonElement = buildTriggerButton(settings, positionInfo);
|
|
43886
44002
|
triggerElement.append(notificationElement);
|
|
43887
44003
|
triggerElement.append(triggerButtonElement);
|
|
43888
44004
|
triggerElement.appendTo(globalPendo.dom.getBody());
|
|
@@ -43906,7 +44022,7 @@ function Feedback() {
|
|
|
43906
44022
|
iframeWrapper.css(getWidgetOriginalStyles());
|
|
43907
44023
|
iframeWrapper.attr('id', elemIds.feedbackWidget);
|
|
43908
44024
|
iframeWrapper.attr('data-turbolinks-permanent', 'true');
|
|
43909
|
-
iframeWrapper.addClass(
|
|
44025
|
+
iframeWrapper.addClass(`buttonIs-${horizontalPosition}`);
|
|
43910
44026
|
return iframeWrapper;
|
|
43911
44027
|
}
|
|
43912
44028
|
function buildIframeContainer() {
|
|
@@ -43923,13 +44039,22 @@ function Feedback() {
|
|
|
43923
44039
|
return iframeContainer;
|
|
43924
44040
|
}
|
|
43925
44041
|
function addWidgetVisibleButtonStyles(buttonStylePosition) {
|
|
43926
|
-
|
|
43927
|
-
|
|
44042
|
+
let side = buttonStylePosition === 'left' ? 'left' : 'right'; // just in case something was not left or right for some reason
|
|
44043
|
+
const styles = `
|
|
44044
|
+
.buttonIs-${side}.visible {
|
|
44045
|
+
${side}: 0 !important;
|
|
44046
|
+
width: 470px !important;
|
|
44047
|
+
animation-direction: alternate-reverse !important;
|
|
44048
|
+
animation: pendoFeedbackSlideFrom-${side} 0.5s 0s 1 alternate both !important;
|
|
44049
|
+
-webkit-animation: pendoFeedbackSlideFrom-${side} 0.5s 0s 1 alternate both !important;
|
|
44050
|
+
z-index: 9002 !important;
|
|
44051
|
+
}
|
|
44052
|
+
`;
|
|
43928
44053
|
pluginApi.util.addInlineStyles(elemIds.feedbackFrameStyles, styles);
|
|
43929
44054
|
}
|
|
43930
44055
|
function initialiseWidgetFrame(horizontalPosition) {
|
|
43931
44056
|
addWidgetVisibleButtonStyles(horizontalPosition);
|
|
43932
|
-
|
|
44057
|
+
const iframeElement = buildIframeWrapper(horizontalPosition);
|
|
43933
44058
|
iframeElement.append(buildIframeContainer());
|
|
43934
44059
|
iframeElement.appendTo(globalPendo.dom.getBody());
|
|
43935
44060
|
subscribeToIframeMessages();
|
|
@@ -43953,7 +44078,7 @@ function Feedback() {
|
|
|
43953
44078
|
return widgetLoaded;
|
|
43954
44079
|
}
|
|
43955
44080
|
function getPendoOptions() {
|
|
43956
|
-
|
|
44081
|
+
let options = pluginApi.ConfigReader.getLocalConfig();
|
|
43957
44082
|
if (!globalPendo._.isObject(options))
|
|
43958
44083
|
options = {};
|
|
43959
44084
|
if (!globalPendo._.isObject(options.visitor))
|
|
@@ -43981,7 +44106,7 @@ function Feedback() {
|
|
|
43981
44106
|
return true;
|
|
43982
44107
|
}
|
|
43983
44108
|
function getQueryParam(url, paramName) {
|
|
43984
|
-
|
|
44109
|
+
const results = new RegExp('[?&]' + paramName + '=([^&#]*)').exec(url);
|
|
43985
44110
|
if (results == null) {
|
|
43986
44111
|
return null;
|
|
43987
44112
|
}
|
|
@@ -43998,13 +44123,13 @@ function Feedback() {
|
|
|
43998
44123
|
return pluginApi.q.reject();
|
|
43999
44124
|
if (!canInitFeedback(pendoOptions))
|
|
44000
44125
|
return pluginApi.q.reject();
|
|
44001
|
-
|
|
44126
|
+
const feedbackOptions = convertPendoToFeedbackOptions(pendoOptions);
|
|
44002
44127
|
try {
|
|
44003
|
-
|
|
44004
|
-
if (
|
|
44128
|
+
const fdbkDst = getQueryParam(globalPendo.url.get(), 'fdbkDst');
|
|
44129
|
+
if (fdbkDst && fdbkDst.startsWith('case')) {
|
|
44005
44130
|
initialized = true;
|
|
44006
44131
|
getFeedbackLoginUrl().then(function (loginUrl) {
|
|
44007
|
-
|
|
44132
|
+
const destinationUrl = loginUrl + '&fdbkDst=' + fdbkDst;
|
|
44008
44133
|
window.location.href = destinationUrl;
|
|
44009
44134
|
});
|
|
44010
44135
|
return;
|
|
@@ -44053,7 +44178,7 @@ function Feedback() {
|
|
|
44053
44178
|
function convertPendoToFeedbackOptions(options) {
|
|
44054
44179
|
var jwtOptions = pluginApi.agent.getJwtInfoCopy();
|
|
44055
44180
|
if (globalPendo._.isEmpty(jwtOptions)) {
|
|
44056
|
-
|
|
44181
|
+
const feedbackOptions = {};
|
|
44057
44182
|
feedbackOptions.user = globalPendo._.pick(options.visitor, 'id', 'full_name', 'firstName', 'lastName', 'email', 'tags', 'custom_allowed_products');
|
|
44058
44183
|
globalPendo._.extend(feedbackOptions.user, { allowed_products: [{ id: feedbackAllowedProductId }] });
|
|
44059
44184
|
feedbackOptions.account = globalPendo._.pick(options.account, 'id', 'name', 'monthly_value', 'is_paying', 'tags');
|
|
@@ -49643,17 +49768,6 @@ var SessionRecorderBuffer = /** @class */ (function () {
|
|
|
49643
49768
|
return SessionRecorderBuffer;
|
|
49644
49769
|
}());
|
|
49645
49770
|
|
|
49646
|
-
var __assign = function() {
|
|
49647
|
-
__assign = Object.assign || function __assign(t) {
|
|
49648
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
49649
|
-
s = arguments[i];
|
|
49650
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
49651
|
-
}
|
|
49652
|
-
return t;
|
|
49653
|
-
};
|
|
49654
|
-
return __assign.apply(this, arguments);
|
|
49655
|
-
};
|
|
49656
|
-
|
|
49657
49771
|
function __rest(s, e) {
|
|
49658
49772
|
var t = {};
|
|
49659
49773
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
@@ -51818,7 +51932,7 @@ function includes(str, substring) {
|
|
|
51818
51932
|
function getResourceType(blockedURI, directive) {
|
|
51819
51933
|
if (!directive || typeof directive !== 'string')
|
|
51820
51934
|
return 'resource';
|
|
51821
|
-
|
|
51935
|
+
const d = directive.toLowerCase();
|
|
51822
51936
|
if (blockedURI === 'inline') {
|
|
51823
51937
|
if (includes(d, 'script-src-attr')) {
|
|
51824
51938
|
return 'inline event handler';
|
|
@@ -51877,12 +51991,11 @@ function getResourceType(blockedURI, directive) {
|
|
|
51877
51991
|
function getDirective(policy, directiveName) {
|
|
51878
51992
|
if (!policy || !directiveName)
|
|
51879
51993
|
return '';
|
|
51880
|
-
|
|
51881
|
-
for (
|
|
51882
|
-
|
|
51883
|
-
|
|
51884
|
-
|
|
51885
|
-
if (lower === needle || lower.startsWith("".concat(needle, " "))) {
|
|
51994
|
+
const needle = directiveName.toLowerCase();
|
|
51995
|
+
for (const directive of policy.split(';')) {
|
|
51996
|
+
const trimmed = directive.trim();
|
|
51997
|
+
const lower = trimmed.toLowerCase();
|
|
51998
|
+
if (lower === needle || lower.startsWith(`${needle} `)) {
|
|
51886
51999
|
return trimmed;
|
|
51887
52000
|
}
|
|
51888
52001
|
}
|
|
@@ -51904,7 +52017,7 @@ function getDirective(policy, directiveName) {
|
|
|
51904
52017
|
function getArticle(phrase) {
|
|
51905
52018
|
if (!phrase || typeof phrase !== 'string')
|
|
51906
52019
|
return 'A';
|
|
51907
|
-
|
|
52020
|
+
const c = phrase.trim().charAt(0).toLowerCase();
|
|
51908
52021
|
return includes('aeiou', c) ? 'An' : 'A';
|
|
51909
52022
|
}
|
|
51910
52023
|
/**
|
|
@@ -51947,47 +52060,46 @@ function createCspViolationMessage(blockedURI, directive, isReportOnly, original
|
|
|
51947
52060
|
return 'Content Security Policy: Unknown violation occurred.';
|
|
51948
52061
|
}
|
|
51949
52062
|
try {
|
|
51950
|
-
|
|
52063
|
+
const reportOnlyText = isReportOnly ? ' (Report-Only)' : '';
|
|
51951
52064
|
// special case for frame-ancestors since it doesn't fit our template at all
|
|
51952
52065
|
if ((directive === null || directive === void 0 ? void 0 : directive.toLowerCase()) === 'frame-ancestors') {
|
|
51953
|
-
return
|
|
52066
|
+
return `Content Security Policy${reportOnlyText}: The display of ${blockedURI} in a frame was blocked because an ancestor violates your site's frame-ancestors policy.\nCurrent CSP: "${originalPolicy}".`;
|
|
51954
52067
|
}
|
|
51955
|
-
|
|
51956
|
-
|
|
51957
|
-
|
|
51958
|
-
|
|
51959
|
-
|
|
51960
|
-
|
|
51961
|
-
return
|
|
52068
|
+
const resourceType = getResourceType(blockedURI, directive);
|
|
52069
|
+
const article = getArticle(resourceType);
|
|
52070
|
+
const source = formatBlockedUri(blockedURI);
|
|
52071
|
+
const directiveValue = getDirective(originalPolicy, directive);
|
|
52072
|
+
const policyDisplay = directiveValue || directive;
|
|
52073
|
+
const resourceDescription = `${article} ${resourceType}${source ? ` from ${source}` : ''}`;
|
|
52074
|
+
return `Content Security Policy${reportOnlyText}: ${resourceDescription} was blocked by your site's \`${policyDisplay}\` policy.\nCurrent CSP: "${originalPolicy}".`;
|
|
51962
52075
|
}
|
|
51963
52076
|
catch (error) {
|
|
51964
|
-
return
|
|
52077
|
+
return `Content Security Policy: Error formatting violation message: ${error.message}`;
|
|
51965
52078
|
}
|
|
51966
52079
|
}
|
|
51967
52080
|
|
|
51968
|
-
|
|
51969
|
-
|
|
52081
|
+
const MAX_LENGTH = 1000;
|
|
52082
|
+
const PII_PATTERN = {
|
|
51970
52083
|
ip: /\b(?:\d{1,3}\.){3}\d{1,3}\b/g,
|
|
51971
52084
|
ssn: /\b\d{3}-\d{2}-\d{4}\b/g,
|
|
51972
52085
|
creditCard: /\b(?:\d[ -]?){12,18}\d\b/g,
|
|
51973
52086
|
httpsUrls: /https:\/\/[^\s]+/g,
|
|
51974
52087
|
email: /[\w._+-]+@[\w.-]+\.\w+/g
|
|
51975
52088
|
};
|
|
51976
|
-
|
|
51977
|
-
|
|
51978
|
-
|
|
51979
|
-
|
|
51980
|
-
|
|
52089
|
+
const PII_REPLACEMENT = '*'.repeat(10);
|
|
52090
|
+
const JSON_PII_KEYS = ['password', 'email', 'key', 'token', 'auth', 'authentication', 'phone', 'address', 'ssn'];
|
|
52091
|
+
const UNABLE_TO_DISPLAY_BODY = '[Unable to display body: detected PII could not be redacted]';
|
|
52092
|
+
const joinedKeys = JSON_PII_KEYS.join('|');
|
|
52093
|
+
const keyPattern = `"([^"]*(?:${joinedKeys})[^"]*)"`;
|
|
51981
52094
|
// only scrub strings, numbers, and booleans
|
|
51982
|
-
|
|
52095
|
+
const acceptedValues = '("([^"\\\\]*(?:\\\\.[^"\\\\]*)*")|(\\d+)|(true|false))';
|
|
51983
52096
|
/**
|
|
51984
52097
|
* Truncates a string to the max length
|
|
51985
52098
|
* @access private
|
|
51986
52099
|
* @param {String} string
|
|
51987
52100
|
* @returns {String}
|
|
51988
52101
|
*/
|
|
51989
|
-
function truncate(string, includeEllipsis) {
|
|
51990
|
-
if (includeEllipsis === void 0) { includeEllipsis = false; }
|
|
52102
|
+
function truncate(string, includeEllipsis = false) {
|
|
51991
52103
|
if (string.length <= MAX_LENGTH)
|
|
51992
52104
|
return string;
|
|
51993
52105
|
if (includeEllipsis) {
|
|
@@ -52004,7 +52116,7 @@ function truncate(string, includeEllipsis) {
|
|
|
52004
52116
|
* @returns {String}
|
|
52005
52117
|
*/
|
|
52006
52118
|
function generateLogKey(methodName, message, stackTrace) {
|
|
52007
|
-
return
|
|
52119
|
+
return `${methodName}|${message}|${stackTrace}`;
|
|
52008
52120
|
}
|
|
52009
52121
|
/**
|
|
52010
52122
|
* Checks if a string has 2 or more digits, a https URL, or an email address
|
|
@@ -52021,13 +52133,12 @@ function mightContainPII(string) {
|
|
|
52021
52133
|
* @param {String} string
|
|
52022
52134
|
* @returns {String}
|
|
52023
52135
|
*/
|
|
52024
|
-
function scrubPII(
|
|
52025
|
-
var string = _a.string, _ = _a._;
|
|
52136
|
+
function scrubPII({ string, _ }) {
|
|
52026
52137
|
if (!string || typeof string !== 'string')
|
|
52027
52138
|
return string;
|
|
52028
52139
|
if (!mightContainPII(string))
|
|
52029
52140
|
return string;
|
|
52030
|
-
return _.reduce(_.values(PII_PATTERN),
|
|
52141
|
+
return _.reduce(_.values(PII_PATTERN), (str, pattern) => str.replace(pattern, PII_REPLACEMENT), string);
|
|
52031
52142
|
}
|
|
52032
52143
|
/**
|
|
52033
52144
|
* Scrub PII from a stringified JSON object
|
|
@@ -52036,14 +52147,12 @@ function scrubPII(_a) {
|
|
|
52036
52147
|
* @returns {String}
|
|
52037
52148
|
*/
|
|
52038
52149
|
function scrubJsonPII(string) {
|
|
52039
|
-
|
|
52150
|
+
const fullScrubRegex = new RegExp(`${keyPattern}\\s*:\\s*[\\{\\[]`, 'i');
|
|
52040
52151
|
if (fullScrubRegex.test(string)) {
|
|
52041
52152
|
return UNABLE_TO_DISPLAY_BODY;
|
|
52042
52153
|
}
|
|
52043
|
-
|
|
52044
|
-
return string.replace(keyValueScrubRegex,
|
|
52045
|
-
return "\"".concat(key, "\":\"").concat(PII_REPLACEMENT, "\"");
|
|
52046
|
-
});
|
|
52154
|
+
const keyValueScrubRegex = new RegExp(`${keyPattern}\\s*:\\s*${acceptedValues}`, 'gi');
|
|
52155
|
+
return string.replace(keyValueScrubRegex, (match, key) => `"${key}":"${PII_REPLACEMENT}"`);
|
|
52047
52156
|
}
|
|
52048
52157
|
/**
|
|
52049
52158
|
* Checks if a string is a JSON object
|
|
@@ -52055,7 +52164,7 @@ function scrubJsonPII(string) {
|
|
|
52055
52164
|
function mightContainJson(string, contentType) {
|
|
52056
52165
|
if (!string || typeof string !== 'string')
|
|
52057
52166
|
return false;
|
|
52058
|
-
|
|
52167
|
+
const firstChar = string.charAt(0);
|
|
52059
52168
|
if (contentType && contentType.indexOf('application/json') !== -1) {
|
|
52060
52169
|
return true;
|
|
52061
52170
|
}
|
|
@@ -52068,20 +52177,19 @@ function mightContainJson(string, contentType) {
|
|
|
52068
52177
|
* @param {String} contentType
|
|
52069
52178
|
* @returns {String}
|
|
52070
52179
|
*/
|
|
52071
|
-
function maskSensitiveFields(
|
|
52072
|
-
var string = _a.string, contentType = _a.contentType, _ = _a._;
|
|
52180
|
+
function maskSensitiveFields({ string, contentType, _ }) {
|
|
52073
52181
|
if (!string || typeof string !== 'string')
|
|
52074
52182
|
return string;
|
|
52075
52183
|
if (mightContainJson(string, contentType)) {
|
|
52076
52184
|
string = scrubJsonPII(string);
|
|
52077
52185
|
}
|
|
52078
52186
|
if (mightContainPII(string)) {
|
|
52079
|
-
string = scrubPII({ string
|
|
52187
|
+
string = scrubPII({ string, _ });
|
|
52080
52188
|
}
|
|
52081
52189
|
return string;
|
|
52082
52190
|
}
|
|
52083
52191
|
|
|
52084
|
-
|
|
52192
|
+
const DEV_LOG_TYPE = 'devlog';
|
|
52085
52193
|
function createDevLogEnvelope(pluginAPI, globalPendo) {
|
|
52086
52194
|
return {
|
|
52087
52195
|
browser_time: pluginAPI.util.getNow(),
|
|
@@ -52092,12 +52200,12 @@ function createDevLogEnvelope(pluginAPI, globalPendo) {
|
|
|
52092
52200
|
};
|
|
52093
52201
|
}
|
|
52094
52202
|
|
|
52095
|
-
|
|
52096
|
-
|
|
52097
|
-
|
|
52098
|
-
|
|
52099
|
-
|
|
52100
|
-
|
|
52203
|
+
const TOKEN_MAX_SIZE = 100;
|
|
52204
|
+
const TOKEN_REFILL_RATE = 10;
|
|
52205
|
+
const TOKEN_REFRESH_INTERVAL = 1000;
|
|
52206
|
+
const MAX_UNCOMPRESSED_SIZE = 125000; // 125KB
|
|
52207
|
+
class DevlogBuffer {
|
|
52208
|
+
constructor(pendo, pluginAPI) {
|
|
52101
52209
|
this.pendo = pendo;
|
|
52102
52210
|
this.pluginAPI = pluginAPI;
|
|
52103
52211
|
this.events = [];
|
|
@@ -52108,36 +52216,36 @@ var DevlogBuffer = /** @class */ (function () {
|
|
|
52108
52216
|
this.lastRefillTime = this.pluginAPI.util.getNow();
|
|
52109
52217
|
this.nextRefillTime = this.lastRefillTime + TOKEN_REFRESH_INTERVAL;
|
|
52110
52218
|
}
|
|
52111
|
-
|
|
52219
|
+
isEmpty() {
|
|
52112
52220
|
return this.events.length === 0 && this.payloads.length === 0;
|
|
52113
|
-
}
|
|
52114
|
-
|
|
52115
|
-
|
|
52221
|
+
}
|
|
52222
|
+
refillTokens() {
|
|
52223
|
+
const now = this.pluginAPI.util.getNow();
|
|
52116
52224
|
if (now >= this.nextRefillTime) {
|
|
52117
|
-
|
|
52118
|
-
|
|
52119
|
-
|
|
52225
|
+
const timeSinceLastRefill = now - this.lastRefillTime;
|
|
52226
|
+
const secondsSinceLastRefill = Math.floor(timeSinceLastRefill / TOKEN_REFRESH_INTERVAL);
|
|
52227
|
+
const tokensToRefill = secondsSinceLastRefill * TOKEN_REFILL_RATE;
|
|
52120
52228
|
this.tokens = Math.min(this.tokens + tokensToRefill, TOKEN_MAX_SIZE);
|
|
52121
52229
|
this.lastRefillTime = now;
|
|
52122
52230
|
this.nextRefillTime = now + TOKEN_REFRESH_INTERVAL;
|
|
52123
52231
|
}
|
|
52124
|
-
}
|
|
52125
|
-
|
|
52232
|
+
}
|
|
52233
|
+
clear() {
|
|
52126
52234
|
this.events = [];
|
|
52127
52235
|
this.lastEvent = null;
|
|
52128
52236
|
this.uncompressedSize = 0;
|
|
52129
|
-
}
|
|
52130
|
-
|
|
52237
|
+
}
|
|
52238
|
+
hasTokenAvailable() {
|
|
52131
52239
|
this.refillTokens();
|
|
52132
52240
|
return this.tokens > 0;
|
|
52133
|
-
}
|
|
52134
|
-
|
|
52241
|
+
}
|
|
52242
|
+
estimateEventSize(event) {
|
|
52135
52243
|
return JSON.stringify(event).length;
|
|
52136
|
-
}
|
|
52137
|
-
|
|
52244
|
+
}
|
|
52245
|
+
push(event) {
|
|
52138
52246
|
if (!this.hasTokenAvailable())
|
|
52139
52247
|
return false;
|
|
52140
|
-
|
|
52248
|
+
const eventSize = this.estimateEventSize(event);
|
|
52141
52249
|
if (this.uncompressedSize + eventSize > MAX_UNCOMPRESSED_SIZE) {
|
|
52142
52250
|
this.compressCurrentChunk();
|
|
52143
52251
|
}
|
|
@@ -52146,55 +52254,54 @@ var DevlogBuffer = /** @class */ (function () {
|
|
|
52146
52254
|
this.events.push(event);
|
|
52147
52255
|
this.tokens = Math.max(this.tokens - 1, 0);
|
|
52148
52256
|
return true;
|
|
52149
|
-
}
|
|
52150
|
-
|
|
52257
|
+
}
|
|
52258
|
+
compressCurrentChunk() {
|
|
52151
52259
|
if (this.events.length === 0)
|
|
52152
52260
|
return;
|
|
52153
|
-
|
|
52261
|
+
const jzb = this.pendo.compress(this.events);
|
|
52154
52262
|
this.payloads.push(jzb);
|
|
52155
52263
|
this.clear();
|
|
52156
|
-
}
|
|
52157
|
-
|
|
52158
|
-
|
|
52264
|
+
}
|
|
52265
|
+
generateUrl() {
|
|
52266
|
+
const queryParams = {
|
|
52159
52267
|
v: this.pendo.VERSION,
|
|
52160
52268
|
ct: this.pluginAPI.util.getNow()
|
|
52161
52269
|
};
|
|
52162
52270
|
return this.pluginAPI.transmit.buildBaseDataUrl(DEV_LOG_TYPE, this.pendo.apiKey, queryParams);
|
|
52163
|
-
}
|
|
52164
|
-
|
|
52271
|
+
}
|
|
52272
|
+
pack() {
|
|
52165
52273
|
if (this.isEmpty())
|
|
52166
52274
|
return;
|
|
52167
|
-
|
|
52275
|
+
const url = this.generateUrl();
|
|
52168
52276
|
this.compressCurrentChunk();
|
|
52169
|
-
|
|
52170
|
-
jzb
|
|
52171
|
-
url
|
|
52172
|
-
})
|
|
52277
|
+
const payloads = this.pendo._.map(this.payloads, (jzb) => ({
|
|
52278
|
+
jzb,
|
|
52279
|
+
url
|
|
52280
|
+
}));
|
|
52173
52281
|
this.payloads = [];
|
|
52174
52282
|
return payloads;
|
|
52175
|
-
}
|
|
52176
|
-
|
|
52177
|
-
}());
|
|
52283
|
+
}
|
|
52284
|
+
}
|
|
52178
52285
|
|
|
52179
|
-
|
|
52180
|
-
|
|
52286
|
+
class DevlogTransport {
|
|
52287
|
+
constructor(globalPendo, pluginAPI) {
|
|
52181
52288
|
this.pendo = globalPendo;
|
|
52182
52289
|
this.pluginAPI = pluginAPI;
|
|
52183
52290
|
}
|
|
52184
|
-
|
|
52185
|
-
|
|
52291
|
+
buildGetUrl(baseUrl, jzb) {
|
|
52292
|
+
const params = {};
|
|
52186
52293
|
if (this.pluginAPI.agent.treatAsAdoptPartner()) {
|
|
52187
52294
|
this.pluginAPI.agent.addAccountIdParams(params, this.pendo.get_account_id(), this.pluginAPI.ConfigReader.get('oemAccountId'));
|
|
52188
52295
|
}
|
|
52189
|
-
|
|
52296
|
+
const jwtOptions = this.pluginAPI.agent.getJwtInfoCopy();
|
|
52190
52297
|
if (!this.pendo._.isEmpty(jwtOptions)) {
|
|
52191
52298
|
this.pendo._.extend(params, jwtOptions);
|
|
52192
52299
|
}
|
|
52193
52300
|
params.jzb = jzb;
|
|
52194
|
-
|
|
52195
|
-
return
|
|
52196
|
-
}
|
|
52197
|
-
|
|
52301
|
+
const queryString = this.pendo._.map(params, (value, key) => `${key}=${value}`).join('&');
|
|
52302
|
+
return `${baseUrl}${baseUrl.indexOf('?') !== -1 ? '&' : '?'}${queryString}`;
|
|
52303
|
+
}
|
|
52304
|
+
get(url, options) {
|
|
52198
52305
|
options.method = 'GET';
|
|
52199
52306
|
if (this.pluginAPI.transmit.fetchKeepalive.supported()) {
|
|
52200
52307
|
return this.pluginAPI.transmit.fetchKeepalive(url, options);
|
|
@@ -52202,90 +52309,86 @@ var DevlogTransport = /** @class */ (function () {
|
|
|
52202
52309
|
else {
|
|
52203
52310
|
return this.pendo.ajax.get(url);
|
|
52204
52311
|
}
|
|
52205
|
-
}
|
|
52206
|
-
|
|
52207
|
-
|
|
52208
|
-
var getUrl = this.buildGetUrl(url, jzb);
|
|
52312
|
+
}
|
|
52313
|
+
sendRequestWithGet({ url, jzb }) {
|
|
52314
|
+
const getUrl = this.buildGetUrl(url, jzb);
|
|
52209
52315
|
return this.get(getUrl, {
|
|
52210
52316
|
headers: {
|
|
52211
52317
|
'Content-Type': 'application/octet-stream'
|
|
52212
52318
|
}
|
|
52213
52319
|
});
|
|
52214
|
-
}
|
|
52215
|
-
|
|
52320
|
+
}
|
|
52321
|
+
post(url, options) {
|
|
52216
52322
|
options.method = 'POST';
|
|
52217
52323
|
if (options.keepalive && this.pluginAPI.transmit.fetchKeepalive.supported()) {
|
|
52218
52324
|
return this.pluginAPI.transmit.fetchKeepalive(url, options);
|
|
52219
52325
|
}
|
|
52220
52326
|
else if (options.keepalive && this.pluginAPI.transmit.sendBeacon.supported()) {
|
|
52221
|
-
|
|
52327
|
+
const result = this.pluginAPI.transmit.sendBeacon(url, new Blob([options.body]));
|
|
52222
52328
|
return result ? Promise$2.resolve() : Promise$2.reject(new Error('sendBeacon failed to send devlog data'));
|
|
52223
52329
|
}
|
|
52224
52330
|
else {
|
|
52225
52331
|
return this.pendo.ajax.post(url, options.body);
|
|
52226
52332
|
}
|
|
52227
|
-
}
|
|
52228
|
-
|
|
52229
|
-
|
|
52230
|
-
|
|
52231
|
-
var bodyPayload = {
|
|
52333
|
+
}
|
|
52334
|
+
sendRequestWithPost({ url, jzb }, isUnload) {
|
|
52335
|
+
const jwtOptions = this.pluginAPI.agent.getJwtInfoCopy();
|
|
52336
|
+
const bodyPayload = {
|
|
52232
52337
|
events: jzb,
|
|
52233
52338
|
browser_time: this.pluginAPI.util.getNow()
|
|
52234
52339
|
};
|
|
52235
52340
|
if (this.pluginAPI.agent.treatAsAdoptPartner()) {
|
|
52236
52341
|
this.pluginAPI.agent.addAccountIdParams(bodyPayload, this.pendo.get_account_id(), this.pluginAPI.ConfigReader.get('oemAccountId'));
|
|
52237
52342
|
}
|
|
52238
|
-
|
|
52343
|
+
const body = JSON.stringify(this.pendo._.extend(bodyPayload, jwtOptions));
|
|
52239
52344
|
return this.post(url, {
|
|
52240
|
-
body
|
|
52345
|
+
body,
|
|
52241
52346
|
headers: {
|
|
52242
52347
|
'Content-Type': 'application/json'
|
|
52243
52348
|
},
|
|
52244
52349
|
keepalive: isUnload
|
|
52245
52350
|
});
|
|
52246
|
-
}
|
|
52247
|
-
|
|
52248
|
-
|
|
52249
|
-
var compressedLength = jzb.length;
|
|
52351
|
+
}
|
|
52352
|
+
sendRequest({ url, jzb }, isUnload) {
|
|
52353
|
+
const compressedLength = jzb.length;
|
|
52250
52354
|
if (compressedLength <= this.pluginAPI.constants.ENCODED_EVENT_MAX_LENGTH && !this.pluginAPI.ConfigReader.get('sendEventsWithPostOnly')) {
|
|
52251
|
-
return this.sendRequestWithGet({ url
|
|
52355
|
+
return this.sendRequestWithGet({ url, jzb });
|
|
52252
52356
|
}
|
|
52253
|
-
return this.sendRequestWithPost({ url
|
|
52254
|
-
}
|
|
52255
|
-
|
|
52256
|
-
}());
|
|
52357
|
+
return this.sendRequestWithPost({ url, jzb }, isUnload);
|
|
52358
|
+
}
|
|
52359
|
+
}
|
|
52257
52360
|
|
|
52258
52361
|
function ConsoleCapture() {
|
|
52259
|
-
|
|
52260
|
-
|
|
52261
|
-
|
|
52262
|
-
|
|
52263
|
-
|
|
52264
|
-
|
|
52265
|
-
|
|
52266
|
-
|
|
52267
|
-
|
|
52268
|
-
|
|
52269
|
-
|
|
52270
|
-
|
|
52362
|
+
let pluginAPI;
|
|
52363
|
+
let _;
|
|
52364
|
+
let globalPendo;
|
|
52365
|
+
let buffer;
|
|
52366
|
+
let sendQueue;
|
|
52367
|
+
let sendInterval;
|
|
52368
|
+
let transport;
|
|
52369
|
+
let isPtmPaused;
|
|
52370
|
+
let isCapturingConsoleLogs = false;
|
|
52371
|
+
const CAPTURE_CONSOLE_CONFIG = 'captureConsoleLogs';
|
|
52372
|
+
const CONSOLE_METHODS = ['log', 'warn', 'error', 'info'];
|
|
52373
|
+
const DEV_LOG_SUB_TYPE = 'console';
|
|
52271
52374
|
// deduplicate logs
|
|
52272
|
-
|
|
52375
|
+
let lastLogKey = '';
|
|
52273
52376
|
return {
|
|
52274
52377
|
name: 'ConsoleCapture',
|
|
52275
|
-
initialize
|
|
52276
|
-
teardown
|
|
52277
|
-
addIntercepts
|
|
52278
|
-
createConsoleEvent
|
|
52279
|
-
captureStackTrace
|
|
52280
|
-
send
|
|
52281
|
-
setCaptureState
|
|
52282
|
-
recordingStarted
|
|
52283
|
-
recordingStopped
|
|
52284
|
-
onAppHidden
|
|
52285
|
-
onAppUnloaded
|
|
52286
|
-
onPtmPaused
|
|
52287
|
-
onPtmUnpaused
|
|
52288
|
-
securityPolicyViolationFn
|
|
52378
|
+
initialize,
|
|
52379
|
+
teardown,
|
|
52380
|
+
addIntercepts,
|
|
52381
|
+
createConsoleEvent,
|
|
52382
|
+
captureStackTrace,
|
|
52383
|
+
send,
|
|
52384
|
+
setCaptureState,
|
|
52385
|
+
recordingStarted,
|
|
52386
|
+
recordingStopped,
|
|
52387
|
+
onAppHidden,
|
|
52388
|
+
onAppUnloaded,
|
|
52389
|
+
onPtmPaused,
|
|
52390
|
+
onPtmUnpaused,
|
|
52391
|
+
securityPolicyViolationFn,
|
|
52289
52392
|
get isCapturingConsoleLogs() {
|
|
52290
52393
|
return isCapturingConsoleLogs;
|
|
52291
52394
|
},
|
|
@@ -52302,16 +52405,16 @@ function ConsoleCapture() {
|
|
|
52302
52405
|
function initialize(pendo, PluginAPI) {
|
|
52303
52406
|
_ = pendo._;
|
|
52304
52407
|
pluginAPI = PluginAPI;
|
|
52305
|
-
|
|
52408
|
+
const { ConfigReader } = pluginAPI;
|
|
52306
52409
|
ConfigReader.addOption(CAPTURE_CONSOLE_CONFIG, [ConfigReader.sources.PENDO_CONFIG_SRC], false);
|
|
52307
|
-
|
|
52410
|
+
const captureConsoleEnabled = ConfigReader.get(CAPTURE_CONSOLE_CONFIG);
|
|
52308
52411
|
if (!captureConsoleEnabled)
|
|
52309
52412
|
return;
|
|
52310
52413
|
globalPendo = pendo;
|
|
52311
52414
|
buffer = new DevlogBuffer(pendo, pluginAPI);
|
|
52312
52415
|
transport = new DevlogTransport(pendo, pluginAPI);
|
|
52313
52416
|
sendQueue = new pluginAPI.SendQueue(transport.sendRequest.bind(transport));
|
|
52314
|
-
sendInterval = setInterval(
|
|
52417
|
+
sendInterval = setInterval(() => {
|
|
52315
52418
|
if (!sendQueue.failed()) {
|
|
52316
52419
|
send();
|
|
52317
52420
|
}
|
|
@@ -52337,19 +52440,17 @@ function ConsoleCapture() {
|
|
|
52337
52440
|
function onPtmUnpaused() {
|
|
52338
52441
|
isPtmPaused = false;
|
|
52339
52442
|
if (!buffer.isEmpty()) {
|
|
52340
|
-
for (
|
|
52341
|
-
|
|
52342
|
-
pluginAPI.Events.eventCaptured.trigger(event_1);
|
|
52443
|
+
for (const event of buffer.events) {
|
|
52444
|
+
pluginAPI.Events.eventCaptured.trigger(event);
|
|
52343
52445
|
}
|
|
52344
52446
|
send();
|
|
52345
52447
|
}
|
|
52346
52448
|
}
|
|
52347
|
-
function setCaptureState(
|
|
52348
|
-
var _b = _a === void 0 ? {} : _a, _c = _b.shouldCapture, shouldCapture = _c === void 0 ? false : _c, _d = _b.reason, reason = _d === void 0 ? '' : _d;
|
|
52449
|
+
function setCaptureState({ shouldCapture = false, reason = '' } = {}) {
|
|
52349
52450
|
if (shouldCapture === isCapturingConsoleLogs)
|
|
52350
52451
|
return;
|
|
52351
52452
|
isCapturingConsoleLogs = shouldCapture;
|
|
52352
|
-
pluginAPI.log.info(
|
|
52453
|
+
pluginAPI.log.info(`[ConsoleCapture] Console log capture ${shouldCapture ? 'started' : 'stopped'}${reason ? `: ${reason}` : ''}`);
|
|
52353
52454
|
}
|
|
52354
52455
|
function recordingStarted() {
|
|
52355
52456
|
setCaptureState({ shouldCapture: true, reason: 'recording started' });
|
|
@@ -52369,12 +52470,12 @@ function ConsoleCapture() {
|
|
|
52369
52470
|
}
|
|
52370
52471
|
function addIntercepts() {
|
|
52371
52472
|
_.each(CONSOLE_METHODS, function (methodName) {
|
|
52372
|
-
|
|
52473
|
+
const originalMethod = console[methodName];
|
|
52373
52474
|
if (!originalMethod)
|
|
52374
52475
|
return;
|
|
52375
52476
|
console[methodName] = _.wrap(originalMethod, function (originalFn) {
|
|
52376
52477
|
// slice 1 to omit originalFn
|
|
52377
|
-
|
|
52478
|
+
const args = _.toArray(arguments).slice(1);
|
|
52378
52479
|
originalFn.apply(console, args);
|
|
52379
52480
|
createConsoleEvent(args, methodName);
|
|
52380
52481
|
});
|
|
@@ -52386,10 +52487,10 @@ function ConsoleCapture() {
|
|
|
52386
52487
|
function securityPolicyViolationFn(evt) {
|
|
52387
52488
|
if (!evt || typeof evt !== 'object')
|
|
52388
52489
|
return;
|
|
52389
|
-
|
|
52390
|
-
|
|
52391
|
-
|
|
52392
|
-
|
|
52490
|
+
const { blockedURI, violatedDirective, effectiveDirective, disposition, originalPolicy } = evt;
|
|
52491
|
+
const directive = violatedDirective || effectiveDirective;
|
|
52492
|
+
const isReportOnly = disposition === 'report';
|
|
52493
|
+
const message = createCspViolationMessage(blockedURI, directive, isReportOnly, originalPolicy);
|
|
52393
52494
|
if (isReportOnly) {
|
|
52394
52495
|
createConsoleEvent([message], 'warn', { skipStackTrace: true, skipScrubPII: true });
|
|
52395
52496
|
}
|
|
@@ -52397,13 +52498,12 @@ function ConsoleCapture() {
|
|
|
52397
52498
|
createConsoleEvent([message], 'error', { skipStackTrace: true, skipScrubPII: true });
|
|
52398
52499
|
}
|
|
52399
52500
|
}
|
|
52400
|
-
function createConsoleEvent(args, methodName,
|
|
52401
|
-
var _b = _a === void 0 ? {} : _a, _c = _b.skipStackTrace, skipStackTrace = _c === void 0 ? false : _c, _d = _b.skipScrubPII, skipScrubPII = _d === void 0 ? false : _d;
|
|
52501
|
+
function createConsoleEvent(args, methodName, { skipStackTrace = false, skipScrubPII = false } = {}) {
|
|
52402
52502
|
if (!isCapturingConsoleLogs || !args || args.length === 0 || !_.contains(CONSOLE_METHODS, methodName))
|
|
52403
52503
|
return;
|
|
52404
52504
|
// stringify args
|
|
52405
|
-
|
|
52406
|
-
|
|
52505
|
+
let message = _.compact(_.map(args, arg => {
|
|
52506
|
+
let stringifiedArg;
|
|
52407
52507
|
try {
|
|
52408
52508
|
stringifiedArg = stringify(arg);
|
|
52409
52509
|
}
|
|
@@ -52415,22 +52515,22 @@ function ConsoleCapture() {
|
|
|
52415
52515
|
if (!message)
|
|
52416
52516
|
return;
|
|
52417
52517
|
// capture stack trace
|
|
52418
|
-
|
|
52518
|
+
let stackTrace = '';
|
|
52419
52519
|
if (!skipStackTrace) {
|
|
52420
|
-
|
|
52520
|
+
const maxStackFrames = methodName === 'error' ? 4 : 1;
|
|
52421
52521
|
stackTrace = captureStackTrace(maxStackFrames);
|
|
52422
52522
|
}
|
|
52423
52523
|
// truncate message and stack trace
|
|
52424
52524
|
message = truncate(message);
|
|
52425
52525
|
stackTrace = truncate(stackTrace);
|
|
52426
52526
|
// de-duplicate log
|
|
52427
|
-
|
|
52527
|
+
const logKey = generateLogKey(methodName, message, stackTrace);
|
|
52428
52528
|
if (isExistingDuplicateLog(logKey)) {
|
|
52429
52529
|
buffer.lastEvent.devLogCount++;
|
|
52430
52530
|
return;
|
|
52431
52531
|
}
|
|
52432
|
-
|
|
52433
|
-
|
|
52532
|
+
const devLogEnvelope = createDevLogEnvelope(pluginAPI, globalPendo);
|
|
52533
|
+
const consoleEvent = Object.assign(Object.assign({}, devLogEnvelope), { subType: DEV_LOG_SUB_TYPE, devLogLevel: methodName === 'log' ? 'info' : methodName, devLogMessage: skipScrubPII ? message : scrubPII({ string: message, _ }), devLogTrace: stackTrace, devLogCount: 1 });
|
|
52434
52534
|
if (!buffer.hasTokenAvailable())
|
|
52435
52535
|
return consoleEvent;
|
|
52436
52536
|
if (!isPtmPaused) {
|
|
@@ -52442,8 +52542,8 @@ function ConsoleCapture() {
|
|
|
52442
52542
|
}
|
|
52443
52543
|
function captureStackTrace(maxStackFrames) {
|
|
52444
52544
|
try {
|
|
52445
|
-
|
|
52446
|
-
return _.map(stackFrames,
|
|
52545
|
+
const stackFrames = ErrorStackParser.parse(new Error(), maxStackFrames);
|
|
52546
|
+
return _.map(stackFrames, frame => frame.toString()).join('\n');
|
|
52447
52547
|
}
|
|
52448
52548
|
catch (error) {
|
|
52449
52549
|
return '';
|
|
@@ -52455,22 +52555,21 @@ function ConsoleCapture() {
|
|
|
52455
52555
|
function updateLastLog(logKey) {
|
|
52456
52556
|
lastLogKey = logKey;
|
|
52457
52557
|
}
|
|
52458
|
-
function send(
|
|
52459
|
-
var _b = _a === void 0 ? {} : _a, _c = _b.unload, unload = _c === void 0 ? false : _c, _d = _b.hidden, hidden = _d === void 0 ? false : _d;
|
|
52558
|
+
function send({ unload = false, hidden = false } = {}) {
|
|
52460
52559
|
if (!buffer || buffer.isEmpty())
|
|
52461
52560
|
return;
|
|
52462
52561
|
if (!globalPendo.isSendingEvents()) {
|
|
52463
52562
|
buffer.clear();
|
|
52464
52563
|
return;
|
|
52465
52564
|
}
|
|
52466
|
-
|
|
52565
|
+
const payloads = buffer.pack();
|
|
52467
52566
|
if (!payloads || payloads.length === 0)
|
|
52468
52567
|
return;
|
|
52469
52568
|
if (unload || hidden) {
|
|
52470
52569
|
sendQueue.drain(payloads, unload);
|
|
52471
52570
|
}
|
|
52472
52571
|
else {
|
|
52473
|
-
sendQueue.push
|
|
52572
|
+
sendQueue.push(...payloads);
|
|
52474
52573
|
}
|
|
52475
52574
|
}
|
|
52476
52575
|
function teardown() {
|
|
@@ -52494,7 +52593,7 @@ function ConsoleCapture() {
|
|
|
52494
52593
|
_.each(CONSOLE_METHODS, function (methodName) {
|
|
52495
52594
|
if (!console[methodName])
|
|
52496
52595
|
return _.noop;
|
|
52497
|
-
|
|
52596
|
+
const unwrap = console[methodName]._pendoUnwrap;
|
|
52498
52597
|
if (_.isFunction(unwrap)) {
|
|
52499
52598
|
unwrap();
|
|
52500
52599
|
}
|