@pendo/agent 2.321.1 → 2.322.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dom.esm.js +1 -1
- package/dist/pendo.module.js +887 -884
- package/dist/pendo.module.min.js +5 -151
- package/dist/servers.json +7 -7
- package/package.json +1 -1
package/dist/pendo.module.js
CHANGED
|
@@ -3967,8 +3967,8 @@ let SERVER = '';
|
|
|
3967
3967
|
let ASSET_HOST = '';
|
|
3968
3968
|
let ASSET_PATH = '';
|
|
3969
3969
|
let DESIGNER_SERVER = '';
|
|
3970
|
-
let VERSION = '2.
|
|
3971
|
-
let PACKAGE_VERSION = '2.
|
|
3970
|
+
let VERSION = '2.322.0_';
|
|
3971
|
+
let PACKAGE_VERSION = '2.322.0';
|
|
3972
3972
|
let LOADER = 'xhr';
|
|
3973
3973
|
/* eslint-enable web-sdk-eslint-rules/no-gulp-env-references */
|
|
3974
3974
|
/**
|
|
@@ -11677,9 +11677,9 @@ function isTrustedOrigin(host) {
|
|
|
11677
11677
|
/^https:\/\/hotfix-(ops|app)-([0-9]+-dot-)pendo-(au|eu|govramp|hsbc|io|jp-prod|us1)\.appspot\.com$/,
|
|
11678
11678
|
/^https:\/\/pendo-(au|eu|govramp|hsbc|io|jp-prod|us1)-static\.storage\.googleapis\.com$/,
|
|
11679
11679
|
/^https:\/\/([a-zA-Z0-9-]+\.)*pendo-dev\.com$/,
|
|
11680
|
-
/^https:\/\/([a-zA-Z0-9-]+-dot-)?pendo-(apollo|armada|atlas|batman|calypso|dap|dev|dr-us-east1|eu-dev|freeze|helix|link|magic|mcfly|ml|mobile-fbi|mobile-guides|mobile-hummus|mobile-plat|perfserf|voc|wildlings|ionchef|scrum-ops|security|test|uat|au|eu|govramp|hsbc|io|jp-prod|us1)\.appspot\.com$/,
|
|
11680
|
+
/^https:\/\/([a-zA-Z0-9-]+-dot-)?pendo-(apollo|armada|atlas|batman|calypso|dap|dev|dr-us-east1|eu-dev|freeze|helix|link|magic|mango|mcfly|ml|mobile-fbi|mobile-guides|mobile-hummus|mobile-plat|perfserf|voc|wildlings|ionchef|scrum-ops|security|test|uat|au|eu|govramp|hsbc|io|jp-prod|us1)\.appspot\.com$/,
|
|
11681
11681
|
/^https:\/\/(via|adopt|local)\.pendo\.(local|io):\d{4}$/,
|
|
11682
|
-
/^https:\/\/pendo-(apollo|armada|atlas|batman|calypso|dap|dev|dr-us-east1|eu-dev|freeze|helix|link|magic|mcfly|ml|mobile-fbi|mobile-guides|mobile-hummus|mobile-plat|perfserf|voc|wildlings|ionchef|scrum-ops|security|test|uat)-static\.storage\.googleapis\.com$/
|
|
11682
|
+
/^https:\/\/pendo-(apollo|armada|atlas|batman|calypso|dap|dev|dr-us-east1|eu-dev|freeze|helix|link|magic|mango|mcfly|ml|mobile-fbi|mobile-guides|mobile-hummus|mobile-plat|perfserf|voc|wildlings|ionchef|scrum-ops|security|test|uat)-static\.storage\.googleapis\.com$/
|
|
11683
11683
|
]; // eslint-disable-line web-sdk-eslint-rules/no-gulp-env-references
|
|
11684
11684
|
var adoptHost = ConfigReader.get('adoptHost');
|
|
11685
11685
|
if (adoptHost) {
|
|
@@ -35469,11 +35469,8 @@ var DesignerConnect = (function () {
|
|
|
35469
35469
|
globalPendo.log(pendo.app_name + ': listening to messages');
|
|
35470
35470
|
window.addEventListener('message', messageReceiver, false);
|
|
35471
35471
|
}
|
|
35472
|
-
if (window.opener && globalPendo._.isFunction(window.opener.postMessage)) {
|
|
35473
|
-
const designerTargetOrigin = pendo.getConfigValue('secureDesignerConnect') ? DESIGNER_SERVER : '*';
|
|
35474
|
-
window.opener.postMessage({ type: 'pendo::ready' }, designerTargetOrigin);
|
|
35475
|
-
}
|
|
35476
35472
|
globalPendo.onConnectMessage = onConnectMessage; // Designer still uses this in selection.js
|
|
35473
|
+
pluginAPI.Events.ready.on(onReady);
|
|
35477
35474
|
}
|
|
35478
35475
|
function teardown() {
|
|
35479
35476
|
removeListeners();
|
|
@@ -35488,6 +35485,13 @@ var DesignerConnect = (function () {
|
|
|
35488
35485
|
if (tempLaunchToken) {
|
|
35489
35486
|
tempLaunchToken = undefined;
|
|
35490
35487
|
}
|
|
35488
|
+
pluginAPI.Events.ready.off(onReady);
|
|
35489
|
+
}
|
|
35490
|
+
function onReady() {
|
|
35491
|
+
if (window.opener && globalPendo._.isFunction(window.opener.postMessage)) {
|
|
35492
|
+
const designerTargetOrigin = globalPendo.getConfigValue('secureDesignerConnect') ? DESIGNER_SERVER : '*';
|
|
35493
|
+
window.opener.postMessage({ type: 'pendo::ready' }, designerTargetOrigin);
|
|
35494
|
+
}
|
|
35491
35495
|
}
|
|
35492
35496
|
function onConnectMessage(data, msg) {
|
|
35493
35497
|
if (!globalPendo.designer) {
|
|
@@ -35536,6 +35540,10 @@ var DesignerConnect = (function () {
|
|
|
35536
35540
|
var token = msg.data.token;
|
|
35537
35541
|
if (!token)
|
|
35538
35542
|
return;
|
|
35543
|
+
if (token.publicAppId && token.publicAppId !== globalPendo.publicAppId) {
|
|
35544
|
+
globalPendo.log(`Designer launch information received was for public app ID ${token.publicAppId}, which does not match the current app ID ${globalPendo.publicAppId}. Ignoring launch request.`);
|
|
35545
|
+
return;
|
|
35546
|
+
}
|
|
35539
35547
|
tempLaunchToken = token;
|
|
35540
35548
|
registerMessageHandler('pendo-designer-launch::get-token', sendToken);
|
|
35541
35549
|
var defaultLaunchBucket = token.DADesigner ? 'da-designer' : 'in-app-designer';
|
|
@@ -40707,17 +40715,19 @@ function TextCapture() {
|
|
|
40707
40715
|
}
|
|
40708
40716
|
}
|
|
40709
40717
|
|
|
40710
|
-
|
|
40711
|
-
|
|
40712
|
-
|
|
40713
|
-
|
|
40714
|
-
|
|
40715
|
-
function lookupGuideButtons(domJson, buttons
|
|
40718
|
+
var substitutionRegex = '\\{(?:\\s?)([^.\\s]?visitor|account|parentAccount)\\.([^|\\s/]*)(?:\\s?\\|\\s?([^}]+|[\\/s]+))?(?:\\s?\\/\\s?){1}\\}';
|
|
40719
|
+
var skipStepString = '{skipStep:* *(auto|\\d+)\\/}';
|
|
40720
|
+
var goToMiddleString = '(?!0)(\\d+)';
|
|
40721
|
+
var goToString = "({goto-".concat(goToMiddleString, "\\/})");
|
|
40722
|
+
var containerSelector = '[id^="pendo-guide-container"]';
|
|
40723
|
+
function lookupGuideButtons(domJson, buttons) {
|
|
40724
|
+
if (buttons === void 0) { buttons = []; }
|
|
40716
40725
|
if (domJson.type === 'button' && domJson.actions) {
|
|
40717
40726
|
buttons.push(domJson);
|
|
40718
40727
|
}
|
|
40719
40728
|
if (domJson.children) {
|
|
40720
|
-
for (
|
|
40729
|
+
for (var _i = 0, _a = domJson.children; _i < _a.length; _i++) {
|
|
40730
|
+
var child = _a[_i];
|
|
40721
40731
|
lookupGuideButtons(child, buttons);
|
|
40722
40732
|
}
|
|
40723
40733
|
}
|
|
@@ -40746,15 +40756,16 @@ function removeMarkdownSyntax(element, textToReplace, replacementText, pendo) {
|
|
|
40746
40756
|
}
|
|
40747
40757
|
}
|
|
40748
40758
|
var guideMarkdownUtil = {
|
|
40749
|
-
substitutionRegex,
|
|
40750
|
-
skipStepString,
|
|
40751
|
-
goToString,
|
|
40752
|
-
containerSelector,
|
|
40753
|
-
lookupGuideButtons,
|
|
40754
|
-
removeMarkdownSyntax
|
|
40759
|
+
substitutionRegex: substitutionRegex,
|
|
40760
|
+
skipStepString: skipStepString,
|
|
40761
|
+
goToString: goToString,
|
|
40762
|
+
containerSelector: containerSelector,
|
|
40763
|
+
lookupGuideButtons: lookupGuideButtons,
|
|
40764
|
+
removeMarkdownSyntax: removeMarkdownSyntax
|
|
40755
40765
|
};
|
|
40756
40766
|
|
|
40757
|
-
function getZoneSafeMethod(_, method, target
|
|
40767
|
+
function getZoneSafeMethod(_, method, target) {
|
|
40768
|
+
if (target === void 0) { target = window; }
|
|
40758
40769
|
var zoneSymbol = '__symbol__';
|
|
40759
40770
|
/* global Zone */
|
|
40760
40771
|
if (typeof Zone !== 'undefined' && _.isFunction(Zone[zoneSymbol])) {
|
|
@@ -40767,20 +40778,20 @@ function getZoneSafeMethod(_, method, target = window) {
|
|
|
40767
40778
|
}
|
|
40768
40779
|
|
|
40769
40780
|
// Does not support submit and go to
|
|
40770
|
-
|
|
40771
|
-
|
|
40781
|
+
var goToRegex = new RegExp(guideMarkdownUtil.goToString);
|
|
40782
|
+
var PollBranching = {
|
|
40772
40783
|
name: 'PollBranching',
|
|
40773
|
-
script(step, guide, pendo) {
|
|
40774
|
-
|
|
40775
|
-
|
|
40784
|
+
script: function (step, guide, pendo) {
|
|
40785
|
+
var isAdvanceIntercepted = false;
|
|
40786
|
+
var branchingQuestions = initialBranchingSetup(step, pendo);
|
|
40776
40787
|
if (branchingQuestions) {
|
|
40777
40788
|
// If there are too many branching questions saved, exit and run the guide normally.
|
|
40778
40789
|
if (pendo._.size(branchingQuestions) > 1)
|
|
40779
40790
|
return;
|
|
40780
|
-
this.on('beforeAdvance', (evt)
|
|
40781
|
-
|
|
40782
|
-
|
|
40783
|
-
|
|
40791
|
+
this.on('beforeAdvance', function (evt) {
|
|
40792
|
+
var noResponseSelected = step.guideElement.find('[branching] .pendo-radio:checked').length === 0;
|
|
40793
|
+
var responseLabel = step.guideElement.find('[branching] .pendo-radio:checked + label')[0];
|
|
40794
|
+
var noGotoLabel;
|
|
40784
40795
|
if (responseLabel) {
|
|
40785
40796
|
noGotoLabel = pendo._.isNull(responseLabel.getAttribute('goToStep'));
|
|
40786
40797
|
}
|
|
@@ -40791,58 +40802,58 @@ const PollBranching = {
|
|
|
40791
40802
|
});
|
|
40792
40803
|
}
|
|
40793
40804
|
},
|
|
40794
|
-
test(step, guide, pendo) {
|
|
40805
|
+
test: function (step, guide, pendo) {
|
|
40795
40806
|
var _a;
|
|
40796
|
-
|
|
40807
|
+
var branchingQuestions = (_a = step.guideElement) === null || _a === void 0 ? void 0 : _a.find('._pendo-multi-choice-poll-question:contains("{branching/}")');
|
|
40797
40808
|
return !pendo._.isUndefined(branchingQuestions) && pendo._.size(branchingQuestions);
|
|
40798
40809
|
},
|
|
40799
|
-
designerListener(pendo) {
|
|
40800
|
-
|
|
40801
|
-
|
|
40810
|
+
designerListener: function (pendo) {
|
|
40811
|
+
var target = pendo.dom.getBody();
|
|
40812
|
+
var config = {
|
|
40802
40813
|
attributeFilter: ['data-layout'],
|
|
40803
40814
|
attributes: true,
|
|
40804
40815
|
childList: true,
|
|
40805
40816
|
characterData: true,
|
|
40806
40817
|
subtree: true
|
|
40807
40818
|
};
|
|
40808
|
-
|
|
40809
|
-
|
|
40819
|
+
var MutationObserver = getZoneSafeMethod(pendo._, 'MutationObserver');
|
|
40820
|
+
var observer = new MutationObserver(applyBranchingIndicators);
|
|
40810
40821
|
observer.observe(target, config);
|
|
40811
40822
|
function applyBranchingIndicators(mutations) {
|
|
40812
40823
|
pendo._.each(mutations, function (mutation) {
|
|
40813
40824
|
var _a;
|
|
40814
|
-
|
|
40825
|
+
var nodeHasQuerySelector = pendo._.isFunction((_a = mutation.addedNodes[0]) === null || _a === void 0 ? void 0 : _a.querySelector);
|
|
40815
40826
|
if (mutation.addedNodes.length && nodeHasQuerySelector) {
|
|
40816
40827
|
if (mutation.addedNodes[0].querySelector('._pendo-multi-choice-poll-select-border')) {
|
|
40817
40828
|
if (pendo._.size(pendo.dom('._pendo-multi-choice-poll-question:contains("{branching/}")'))) {
|
|
40818
40829
|
pendo
|
|
40819
40830
|
.dom('._pendo-multi-choice-poll-question:contains("{branching/}")')
|
|
40820
|
-
.each((question, index)
|
|
40821
|
-
pendo._.each(pendo.dom(
|
|
40831
|
+
.each(function (question, index) {
|
|
40832
|
+
pendo._.each(pendo.dom("#".concat(question.id, " *")), function (element) {
|
|
40822
40833
|
guideMarkdownUtil.removeMarkdownSyntax(element, '{branching/}', '', pendo);
|
|
40823
40834
|
});
|
|
40824
40835
|
pendo
|
|
40825
|
-
.dom(
|
|
40836
|
+
.dom("#".concat(question.id, " p"))
|
|
40826
40837
|
.css({ display: 'inline-block !important' })
|
|
40827
40838
|
.append(branchingIcon('#999', '20px'))
|
|
40828
40839
|
.attr({ title: 'Custom Branching Added' });
|
|
40829
|
-
|
|
40830
|
-
if (pendo.dom(
|
|
40840
|
+
var dataPendoPollId = question.getAttribute('data-pendo-poll-id');
|
|
40841
|
+
if (pendo.dom("._pendo-multi-choice-poll-question[data-pendo-poll-id=".concat(dataPendoPollId, "]"))[0]) {
|
|
40831
40842
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
40832
40843
|
pendo
|
|
40833
|
-
.dom(
|
|
40844
|
+
.dom("._pendo-multi-choice-poll-question[data-pendo-poll-id=".concat(dataPendoPollId, "]"))[0]
|
|
40834
40845
|
.textContent.trim();
|
|
40835
40846
|
}
|
|
40836
|
-
|
|
40847
|
+
var pollLabels = pendo.dom("label[for*=".concat(dataPendoPollId, "]"));
|
|
40837
40848
|
if (pendo._.size(pollLabels)) {
|
|
40838
|
-
pendo._.forEach(pollLabels, (label)
|
|
40849
|
+
pendo._.forEach(pollLabels, function (label) {
|
|
40839
40850
|
if (goToRegex.test(label.textContent)) {
|
|
40840
|
-
|
|
40851
|
+
var labelTitle = goToRegex.exec(label.textContent)[2];
|
|
40841
40852
|
guideMarkdownUtil.removeMarkdownSyntax(label, goToRegex, '', pendo);
|
|
40842
40853
|
pendo
|
|
40843
40854
|
.dom(label)
|
|
40844
40855
|
.append(branchingIcon('#999', '14px'))
|
|
40845
|
-
.attr({ title:
|
|
40856
|
+
.attr({ title: "Branching to step ".concat(labelTitle) });
|
|
40846
40857
|
}
|
|
40847
40858
|
});
|
|
40848
40859
|
}
|
|
@@ -40850,9 +40861,9 @@ const PollBranching = {
|
|
|
40850
40861
|
pendo
|
|
40851
40862
|
.dom(question)
|
|
40852
40863
|
.append(branchingErrorHTML(question.dataset.pendoPollId));
|
|
40853
|
-
pendo.dom(
|
|
40864
|
+
pendo.dom("#".concat(question.id, " #pendo-ps-branching-svg")).remove();
|
|
40854
40865
|
pendo
|
|
40855
|
-
.dom(
|
|
40866
|
+
.dom("#".concat(question.id, " p"))
|
|
40856
40867
|
.css({ display: 'inline-block !important' })
|
|
40857
40868
|
.append(branchingIcon('red', '20px'))
|
|
40858
40869
|
.attr({ title: 'Unsupported Branching configuration' });
|
|
@@ -40864,49 +40875,31 @@ const PollBranching = {
|
|
|
40864
40875
|
});
|
|
40865
40876
|
}
|
|
40866
40877
|
function branchingErrorHTML(dataPendoPollId) {
|
|
40867
|
-
return
|
|
40868
|
-
font-style: italic; margin-top: 0px;" class="branching-wrapper"
|
|
40869
|
-
name="${dataPendoPollId}">
|
|
40870
|
-
* Branching Error: Multiple branching polls not supported</div>`;
|
|
40878
|
+
return "<div style=\"text-align:lrft; font-size: 14px; color: red;\n font-style: italic; margin-top: 0px;\" class=\"branching-wrapper\"\n name=\"".concat(dataPendoPollId, "\">\n * Branching Error: Multiple branching polls not supported</div>");
|
|
40871
40879
|
}
|
|
40872
40880
|
function branchingIcon(color, size) {
|
|
40873
|
-
return
|
|
40874
|
-
style="margin-left: 5px;
|
|
40875
|
-
height:${size}; width:${size}; display:inline; vertical-align:middle;" xmlns="http://www.w3.org/2000/svg">
|
|
40876
|
-
<g stroke-width="0"></g>
|
|
40877
|
-
<g stroke-linecap="round" stroke-linejoin="round"></g>
|
|
40878
|
-
<g> <circle cx="4" cy="7" r="2" stroke="${color}"
|
|
40879
|
-
stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></circle>
|
|
40880
|
-
<circle cx="20" cy="7" r="2" stroke="${color}"
|
|
40881
|
-
stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></circle>
|
|
40882
|
-
<circle cx="20" cy="17" r="2" stroke="${color}" stroke-width="2"
|
|
40883
|
-
stroke-linecap="round" stroke-linejoin="round"></circle>
|
|
40884
|
-
<path d="M18 7H6" stroke="${color}" stroke-width="2"
|
|
40885
|
-
stroke-linecap="round" stroke-linejoin="round"></path>
|
|
40886
|
-
<path d="M7 7V7C8.65685 7 10 8.34315 10 10V15C10 16.1046 10.8954 17 12 17H18"
|
|
40887
|
-
stroke="${color}" stroke-width="2" stroke-linecap="round"
|
|
40888
|
-
stroke-linejoin="round"></path> </g></svg>`;
|
|
40881
|
+
return "<svg id=\"pendo-ps-branching-svg\" viewBox=\"0 0 24 24\" fill=\"none\"\n style=\"margin-left: 5px;\n height:".concat(size, "; width:").concat(size, "; display:inline; vertical-align:middle;\" xmlns=\"http://www.w3.org/2000/svg\">\n <g stroke-width=\"0\"></g>\n <g stroke-linecap=\"round\" stroke-linejoin=\"round\"></g>\n <g> <circle cx=\"4\" cy=\"7\" r=\"2\" stroke=\"").concat(color, "\"\n stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"></circle>\n <circle cx=\"20\" cy=\"7\" r=\"2\" stroke=\"").concat(color, "\"\n stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"></circle>\n <circle cx=\"20\" cy=\"17\" r=\"2\" stroke=\"").concat(color, "\" stroke-width=\"2\"\n stroke-linecap=\"round\" stroke-linejoin=\"round\"></circle>\n <path d=\"M18 7H6\" stroke=\"").concat(color, "\" stroke-width=\"2\"\n stroke-linecap=\"round\" stroke-linejoin=\"round\"></path>\n <path d=\"M7 7V7C8.65685 7 10 8.34315 10 10V15C10 16.1046 10.8954 17 12 17H18\"\n stroke=\"").concat(color, "\" stroke-width=\"2\" stroke-linecap=\"round\"\n stroke-linejoin=\"round\"></path> </g></svg>");
|
|
40889
40882
|
}
|
|
40890
40883
|
}
|
|
40891
40884
|
};
|
|
40892
40885
|
function initialBranchingSetup(step, pendo) {
|
|
40893
|
-
|
|
40894
|
-
pendo._.forEach(questions, (question)
|
|
40895
|
-
|
|
40896
|
-
pendo._.each(step.guideElement.find(
|
|
40886
|
+
var questions = step.guideElement.find('._pendo-multi-choice-poll-question:contains("{branching/}")');
|
|
40887
|
+
pendo._.forEach(questions, function (question) {
|
|
40888
|
+
var dataPendoPollId = question.getAttribute('data-pendo-poll-id');
|
|
40889
|
+
pendo._.each(step.guideElement.find("#".concat(question.id, " *")), function (element) {
|
|
40897
40890
|
guideMarkdownUtil.removeMarkdownSyntax(element, '{branching/}', '', pendo);
|
|
40898
40891
|
});
|
|
40899
|
-
|
|
40900
|
-
pendo._.forEach(pollLabels, (label)
|
|
40892
|
+
var pollLabels = step.guideElement.find("label[for*=".concat(dataPendoPollId, "]"));
|
|
40893
|
+
pendo._.forEach(pollLabels, function (label) {
|
|
40901
40894
|
if (pendo._.isNull(goToRegex.exec(label.textContent))) {
|
|
40902
40895
|
return;
|
|
40903
40896
|
}
|
|
40904
|
-
|
|
40905
|
-
|
|
40897
|
+
var gotoSubstring = goToRegex.exec(label.textContent)[1];
|
|
40898
|
+
var gotoIndex = goToRegex.exec(label.textContent)[2];
|
|
40906
40899
|
label.setAttribute('goToStep', gotoIndex);
|
|
40907
40900
|
guideMarkdownUtil.removeMarkdownSyntax(label, gotoSubstring, '', pendo);
|
|
40908
40901
|
});
|
|
40909
|
-
|
|
40902
|
+
var pollChoiceContainer = step.guideElement.find("[data-pendo-poll-id=".concat(dataPendoPollId, "]._pendo-multi-choice-poll-select-border"));
|
|
40910
40903
|
if (pollChoiceContainer && pollChoiceContainer.length) {
|
|
40911
40904
|
pollChoiceContainer[0].setAttribute('branching', '');
|
|
40912
40905
|
}
|
|
@@ -40915,24 +40908,24 @@ function initialBranchingSetup(step, pendo) {
|
|
|
40915
40908
|
}
|
|
40916
40909
|
function branchingGoToStep(event, step, guide, pendo) {
|
|
40917
40910
|
var _a;
|
|
40918
|
-
|
|
40919
|
-
|
|
40920
|
-
|
|
40921
|
-
|
|
40911
|
+
var checkedPollInputId = (_a = step.guideElement.find('[branching] input.pendo-radio[data-pendo-poll-id]:checked')[0]) === null || _a === void 0 ? void 0 : _a.id;
|
|
40912
|
+
var checkedPollLabel = step.guideElement.find("label[for=\"".concat(checkedPollInputId, "\"]"))[0];
|
|
40913
|
+
var checkedPollLabelStepIndex = checkedPollLabel === null || checkedPollLabel === void 0 ? void 0 : checkedPollLabel.getAttribute('goToStep');
|
|
40914
|
+
var pollStepIndex = checkedPollLabelStepIndex - 1;
|
|
40922
40915
|
if (pollStepIndex < 0)
|
|
40923
40916
|
return;
|
|
40924
|
-
|
|
40917
|
+
var destinationObject = {
|
|
40925
40918
|
destinationStepId: guide.steps[pollStepIndex].id,
|
|
40926
|
-
step
|
|
40919
|
+
step: step
|
|
40927
40920
|
};
|
|
40928
40921
|
pendo.goToStep(destinationObject);
|
|
40929
40922
|
event.cancel = true;
|
|
40930
40923
|
}
|
|
40931
40924
|
|
|
40932
|
-
|
|
40925
|
+
var MetadataSubstitution = {
|
|
40933
40926
|
name: 'MetadataSubstitution',
|
|
40934
|
-
script(step, guide, pendo) {
|
|
40935
|
-
|
|
40927
|
+
script: function (step, guide, pendo) {
|
|
40928
|
+
var placeholderData = findSubstitutableElements(pendo);
|
|
40936
40929
|
if (step.domJson) {
|
|
40937
40930
|
findSubstitutableUrlsInJson(step.domJson, placeholderData, pendo);
|
|
40938
40931
|
}
|
|
@@ -40940,22 +40933,22 @@ const MetadataSubstitution = {
|
|
|
40940
40933
|
pendo._.each(placeholderData, function (placeholder) {
|
|
40941
40934
|
processPlaceholder(placeholder, pendo);
|
|
40942
40935
|
});
|
|
40943
|
-
|
|
40944
|
-
|
|
40945
|
-
updateGuideContainer(containerId,
|
|
40936
|
+
var containerId = "pendo-g-".concat(step.id);
|
|
40937
|
+
var context_1 = step.guideElement;
|
|
40938
|
+
updateGuideContainer(containerId, context_1, pendo);
|
|
40946
40939
|
}
|
|
40947
40940
|
},
|
|
40948
|
-
designerListener(pendo) {
|
|
40949
|
-
|
|
40941
|
+
designerListener: function (pendo) {
|
|
40942
|
+
var target = pendo.dom.getBody();
|
|
40950
40943
|
if (pendo.designerv2) {
|
|
40951
40944
|
pendo.designerv2.runMetadataSubstitutionForDesignerPreview = function runMetadataSubstitutionForDesignerPreview() {
|
|
40952
40945
|
var _a;
|
|
40953
40946
|
if (!document.querySelector(guideMarkdownUtil.containerSelector))
|
|
40954
40947
|
return;
|
|
40955
|
-
|
|
40948
|
+
var step = (_a = pendo.designerv2.currentlyPreviewedGuide) === null || _a === void 0 ? void 0 : _a.steps[0];
|
|
40956
40949
|
if (!step)
|
|
40957
40950
|
return;
|
|
40958
|
-
|
|
40951
|
+
var placeholderData = findSubstitutableElements(pendo);
|
|
40959
40952
|
if (step.buildingBlocks) {
|
|
40960
40953
|
findSubstitutableUrlsInJson(step.buildingBlocks, placeholderData, pendo);
|
|
40961
40954
|
}
|
|
@@ -40965,32 +40958,32 @@ const MetadataSubstitution = {
|
|
|
40965
40958
|
return;
|
|
40966
40959
|
processPlaceholder(placeholder, pendo);
|
|
40967
40960
|
});
|
|
40968
|
-
|
|
40969
|
-
|
|
40970
|
-
updateGuideContainer(containerId,
|
|
40961
|
+
var containerId = "pendo-g-".concat(step.id);
|
|
40962
|
+
var context_2 = step.guideElement;
|
|
40963
|
+
updateGuideContainer(containerId, context_2, pendo);
|
|
40971
40964
|
}
|
|
40972
40965
|
};
|
|
40973
40966
|
}
|
|
40974
|
-
|
|
40967
|
+
var config = {
|
|
40975
40968
|
attributeFilter: ['data-layout'],
|
|
40976
40969
|
attributes: true,
|
|
40977
40970
|
childList: true,
|
|
40978
40971
|
characterData: true,
|
|
40979
40972
|
subtree: true
|
|
40980
40973
|
};
|
|
40981
|
-
|
|
40982
|
-
|
|
40974
|
+
var MutationObserver = getZoneSafeMethod(pendo._, 'MutationObserver');
|
|
40975
|
+
var observer = new MutationObserver(applySubstitutionIndicators);
|
|
40983
40976
|
observer.observe(target, config);
|
|
40984
40977
|
function applySubstitutionIndicators(mutations) {
|
|
40985
40978
|
pendo._.each(mutations, function (mutation) {
|
|
40986
40979
|
var _a;
|
|
40987
40980
|
if (mutation.addedNodes.length) {
|
|
40988
40981
|
if (document.querySelector(guideMarkdownUtil.containerSelector)) {
|
|
40989
|
-
|
|
40990
|
-
|
|
40982
|
+
var placeholderData = findSubstitutableElements(pendo);
|
|
40983
|
+
var step = (_a = pendo.designerv2.currentlyPreviewedGuide) === null || _a === void 0 ? void 0 : _a.steps[0];
|
|
40991
40984
|
if (!step)
|
|
40992
40985
|
return;
|
|
40993
|
-
|
|
40986
|
+
var pendoBlocks = step.buildingBlocks;
|
|
40994
40987
|
if (!pendo._.isUndefined(pendoBlocks)) {
|
|
40995
40988
|
findSubstitutableUrlsInJson(pendoBlocks, placeholderData, pendo);
|
|
40996
40989
|
}
|
|
@@ -41000,9 +40993,9 @@ const MetadataSubstitution = {
|
|
|
41000
40993
|
return;
|
|
41001
40994
|
processPlaceholder(placeholder, pendo);
|
|
41002
40995
|
});
|
|
41003
|
-
|
|
41004
|
-
|
|
41005
|
-
updateGuideContainer(containerId,
|
|
40996
|
+
var containerId = "pendo-g-".concat(step.id);
|
|
40997
|
+
var context_3 = step.guideElement;
|
|
40998
|
+
updateGuideContainer(containerId, context_3, pendo);
|
|
41006
40999
|
}
|
|
41007
41000
|
}
|
|
41008
41001
|
}
|
|
@@ -41011,18 +41004,18 @@ const MetadataSubstitution = {
|
|
|
41011
41004
|
}
|
|
41012
41005
|
};
|
|
41013
41006
|
function processPlaceholder(placeholder, pendo) {
|
|
41014
|
-
|
|
41015
|
-
|
|
41016
|
-
|
|
41007
|
+
var match;
|
|
41008
|
+
var data = placeholder.data, target = placeholder.target;
|
|
41009
|
+
var subRegex = new RegExp(guideMarkdownUtil.substitutionRegex);
|
|
41017
41010
|
while ((match = matchPlaceholder(placeholder, subRegex))) {
|
|
41018
|
-
|
|
41019
|
-
|
|
41011
|
+
var usedArrayPath = Array.isArray(match) && match.length >= 2;
|
|
41012
|
+
var currentStr = target === 'textContent'
|
|
41020
41013
|
? data[target]
|
|
41021
41014
|
: decodeURI((data.getAttribute && (target === 'href' || target === 'value') ? (data.getAttribute(target) || '') : data[target]));
|
|
41022
|
-
|
|
41015
|
+
var matched = usedArrayPath ? match : subRegex.exec(currentStr);
|
|
41023
41016
|
if (!matched)
|
|
41024
41017
|
continue;
|
|
41025
|
-
|
|
41018
|
+
var mdValue = getSubstituteValue(matched, pendo);
|
|
41026
41019
|
substituteMetadataByTarget(data, target, mdValue, matched);
|
|
41027
41020
|
}
|
|
41028
41021
|
}
|
|
@@ -41031,48 +41024,48 @@ function matchPlaceholder(placeholder, regex) {
|
|
|
41031
41024
|
return placeholder.data[placeholder.target].match(regex);
|
|
41032
41025
|
}
|
|
41033
41026
|
else {
|
|
41034
|
-
|
|
41027
|
+
var raw = placeholder.data.getAttribute && (placeholder.target === 'href' || placeholder.target === 'value')
|
|
41035
41028
|
? (placeholder.data.getAttribute(placeholder.target) || '')
|
|
41036
41029
|
: placeholder.data[placeholder.target];
|
|
41037
41030
|
return decodeURI(raw).match(regex);
|
|
41038
41031
|
}
|
|
41039
41032
|
}
|
|
41040
41033
|
function getMetadataValueCaseInsensitive(metadata, type, property) {
|
|
41041
|
-
|
|
41034
|
+
var kind = metadata && metadata[type];
|
|
41042
41035
|
if (!kind || typeof kind !== 'object')
|
|
41043
41036
|
return undefined;
|
|
41044
|
-
|
|
41037
|
+
var direct = Object.prototype.hasOwnProperty.call(kind, property) ? kind[property] : undefined;
|
|
41045
41038
|
if (direct !== undefined) {
|
|
41046
41039
|
return direct;
|
|
41047
41040
|
}
|
|
41048
|
-
|
|
41049
|
-
|
|
41050
|
-
|
|
41041
|
+
var propLower = property.toLowerCase();
|
|
41042
|
+
var key = Object.keys(kind).find(function (k) { return k.toLowerCase() === propLower; });
|
|
41043
|
+
var value = key !== undefined ? kind[key] : undefined;
|
|
41051
41044
|
return value;
|
|
41052
41045
|
}
|
|
41053
41046
|
function getSubstituteValue(match, pendo) {
|
|
41054
41047
|
if (pendo._.isUndefined(match[1]) || pendo._.isUndefined(match[2])) {
|
|
41055
41048
|
return;
|
|
41056
41049
|
}
|
|
41057
|
-
|
|
41058
|
-
|
|
41059
|
-
|
|
41050
|
+
var type = match[1];
|
|
41051
|
+
var property = match[2];
|
|
41052
|
+
var defaultValue = match[3];
|
|
41060
41053
|
if (pendo._.isUndefined(type) || pendo._.isUndefined(property)) {
|
|
41061
41054
|
return;
|
|
41062
41055
|
}
|
|
41063
|
-
|
|
41064
|
-
|
|
41056
|
+
var metadata = pendo.getSerializedMetadata();
|
|
41057
|
+
var mdValue = getMetadataValueCaseInsensitive(metadata, type, property);
|
|
41065
41058
|
if (mdValue === undefined || mdValue === null)
|
|
41066
41059
|
mdValue = defaultValue || '';
|
|
41067
41060
|
return mdValue;
|
|
41068
41061
|
}
|
|
41069
41062
|
function substituteMetadataByTarget(data, target, mdValue, matched) {
|
|
41070
|
-
|
|
41071
|
-
|
|
41063
|
+
var isElement = data && typeof data.getAttribute === 'function';
|
|
41064
|
+
var current = (target === 'href' || target === 'value') && isElement
|
|
41072
41065
|
? (data.getAttribute(target) || '')
|
|
41073
41066
|
: data[target];
|
|
41074
41067
|
if (target === 'href' || target === 'value') {
|
|
41075
|
-
|
|
41068
|
+
var safeValue = window.encodeURIComponent(String(mdValue === undefined || mdValue === null ? '' : mdValue));
|
|
41076
41069
|
data[target] = decodeURI(current).replace(matched[0], safeValue);
|
|
41077
41070
|
}
|
|
41078
41071
|
else {
|
|
@@ -41086,8 +41079,9 @@ function updateGuideContainer(containerId, context, pendo) {
|
|
|
41086
41079
|
pendo.flexElement(pendo.dom(guideMarkdownUtil.containerSelector));
|
|
41087
41080
|
pendo.BuildingBlocks.BuildingBlockGuides.recalculateGuideHeight(containerId, context);
|
|
41088
41081
|
}
|
|
41089
|
-
function findSubstitutableUrlsInJson(originalData, placeholderData
|
|
41090
|
-
|
|
41082
|
+
function findSubstitutableUrlsInJson(originalData, placeholderData, pendo) {
|
|
41083
|
+
if (placeholderData === void 0) { placeholderData = []; }
|
|
41084
|
+
var subRegex = new RegExp(guideMarkdownUtil.substitutionRegex);
|
|
41091
41085
|
if ((originalData.name === 'url' || originalData.name === 'href') && originalData.value) {
|
|
41092
41086
|
if (subRegex.test(originalData.value)) {
|
|
41093
41087
|
placeholderData.push({
|
|
@@ -41097,37 +41091,37 @@ function findSubstitutableUrlsInJson(originalData, placeholderData = [], pendo)
|
|
|
41097
41091
|
}
|
|
41098
41092
|
}
|
|
41099
41093
|
if (originalData.properties && originalData.id === 'href_link_block') {
|
|
41100
|
-
pendo._.each(originalData.properties, (prop)
|
|
41094
|
+
pendo._.each(originalData.properties, function (prop) {
|
|
41101
41095
|
findSubstitutableUrlsInJson(prop, placeholderData, pendo);
|
|
41102
41096
|
});
|
|
41103
41097
|
}
|
|
41104
41098
|
if (originalData.views) {
|
|
41105
|
-
pendo._.each(originalData.views, (view)
|
|
41099
|
+
pendo._.each(originalData.views, function (view) {
|
|
41106
41100
|
findSubstitutableUrlsInJson(view, placeholderData, pendo);
|
|
41107
41101
|
});
|
|
41108
41102
|
}
|
|
41109
41103
|
if (originalData.parameters) {
|
|
41110
|
-
pendo._.each(originalData.parameters, (param)
|
|
41104
|
+
pendo._.each(originalData.parameters, function (param) {
|
|
41111
41105
|
findSubstitutableUrlsInJson(param, placeholderData, pendo);
|
|
41112
41106
|
});
|
|
41113
41107
|
}
|
|
41114
41108
|
if (originalData.actions) {
|
|
41115
|
-
pendo._.each(originalData.actions, (action)
|
|
41109
|
+
pendo._.each(originalData.actions, function (action) {
|
|
41116
41110
|
findSubstitutableUrlsInJson(action, placeholderData, pendo);
|
|
41117
41111
|
});
|
|
41118
41112
|
}
|
|
41119
41113
|
if (originalData.children) {
|
|
41120
|
-
pendo._.each(originalData.children, (child)
|
|
41114
|
+
pendo._.each(originalData.children, function (child) {
|
|
41121
41115
|
findSubstitutableUrlsInJson(child, placeholderData, pendo);
|
|
41122
41116
|
});
|
|
41123
41117
|
}
|
|
41124
41118
|
return placeholderData;
|
|
41125
41119
|
}
|
|
41126
41120
|
function findSubstitutableElements(pendo) {
|
|
41127
|
-
|
|
41121
|
+
var elements = pendo.dom("".concat(guideMarkdownUtil.containerSelector, " *:not(.pendo-inline-ui)"));
|
|
41128
41122
|
return pendo._.chain(elements)
|
|
41129
41123
|
.filter(function (placeholder) {
|
|
41130
|
-
|
|
41124
|
+
var subRegex = new RegExp(guideMarkdownUtil.substitutionRegex);
|
|
41131
41125
|
if (placeholder.localName === 'a') {
|
|
41132
41126
|
return subRegex.test(decodeURI(placeholder.href)) || subRegex.test(placeholder.textContent);
|
|
41133
41127
|
}
|
|
@@ -41183,51 +41177,25 @@ function findSubstitutableElements(pendo) {
|
|
|
41183
41177
|
.value();
|
|
41184
41178
|
}
|
|
41185
41179
|
function substitutionIcon(color, size) {
|
|
41186
|
-
return (
|
|
41187
|
-
|
|
41188
|
-
|
|
41189
|
-
|
|
41190
|
-
|
|
41191
|
-
|
|
41192
|
-
transform="matrix(1, 0, 0, 1, 0, 0)rotate(0)">
|
|
41193
|
-
<g stroke-width="0"></g>
|
|
41194
|
-
<g stroke-linecap="round" stroke-linejoin="round"
|
|
41195
|
-
stroke="${color}" stroke-width="0.528"></g>
|
|
41196
|
-
<g><path fill-rule="evenodd" clip-rule="evenodd"
|
|
41197
|
-
d="M5 5.5C4.17157 5.5 3.5 6.17157 3.5 7V10C3.5 10.8284
|
|
41198
|
-
4.17157 11.5 5 11.5H8C8.82843 11.5 9.5 10.8284 9.5
|
|
41199
|
-
10V9H17V11C17 11.2761 17.2239 11.5 17.5 11.5C17.7761
|
|
41200
|
-
11.5 18 11.2761 18 11V8.5C18 8.22386 17.7761 8 17.5
|
|
41201
|
-
8H9.5V7C9.5 6.17157 8.82843 5.5 8 5.5H5ZM8.5 7C8.5
|
|
41202
|
-
6.72386 8.27614 6.5 8 6.5H5C4.72386 6.5 4.5 6.72386
|
|
41203
|
-
4.5 7V10C4.5 10.2761 4.72386 10.5 5 10.5H8C8.27614
|
|
41204
|
-
10.5 8.5 10.2761 8.5 10V7Z" fill="${color}"></path>
|
|
41205
|
-
<path fill-rule="evenodd" clip-rule="evenodd"
|
|
41206
|
-
d="M7 13C7 12.7239 6.77614 12.5 6.5 12.5C6.22386 12.5
|
|
41207
|
-
6 12.7239 6 13V15.5C6 15.7761 6.22386 16 6.5
|
|
41208
|
-
16H14.5V17C14.5 17.8284 15.1716 18.5 16 18.5H19C19.8284
|
|
41209
|
-
18.5 20.5 17.8284 20.5 17V14C20.5 13.1716 19.8284 12.5
|
|
41210
|
-
19 12.5H16C15.1716 12.5 14.5 13.1716 14.5
|
|
41211
|
-
14V15H7V13ZM15.5 17C15.5 17.2761 15.7239 17.5 16
|
|
41212
|
-
17.5H19C19.2761 17.5 19.5 17.2761 19.5 17V14C19.5
|
|
41213
|
-
13.7239 19.2761 13.5 19 13.5H16C15.7239 13.5 15.5
|
|
41214
|
-
13.7239 15.5 14V17Z" fill="${color}"></path> </g></svg></div>`);
|
|
41215
|
-
}
|
|
41216
|
-
|
|
41217
|
-
const requiredElement = '<span class="_pendo-required-indicator" style="color:red; font-style:italic;" title="Question is required"> *</span>';
|
|
41218
|
-
const requiredSyntax = '{required/}';
|
|
41219
|
-
const RequiredQuestions = {
|
|
41180
|
+
return ("<div title=\"Metadata Substitution added\">\n <svg id=\"pendo-ps-substitution-icon\" viewBox=\"0 0 24 24\"\n preserveAspectRatio=\"xMidYMid meet\"\n height=".concat(size, " width=").concat(size, " title=\"Metadata Substitution\"\n style=\"bottom:5px; right:10px; position: absolute;\"\n fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" stroke=\"").concat(color, "\"\n transform=\"matrix(1, 0, 0, 1, 0, 0)rotate(0)\">\n <g stroke-width=\"0\"></g>\n <g stroke-linecap=\"round\" stroke-linejoin=\"round\"\n stroke=\"").concat(color, "\" stroke-width=\"0.528\"></g>\n <g><path fill-rule=\"evenodd\" clip-rule=\"evenodd\"\n d=\"M5 5.5C4.17157 5.5 3.5 6.17157 3.5 7V10C3.5 10.8284\n 4.17157 11.5 5 11.5H8C8.82843 11.5 9.5 10.8284 9.5\n 10V9H17V11C17 11.2761 17.2239 11.5 17.5 11.5C17.7761\n 11.5 18 11.2761 18 11V8.5C18 8.22386 17.7761 8 17.5\n 8H9.5V7C9.5 6.17157 8.82843 5.5 8 5.5H5ZM8.5 7C8.5\n 6.72386 8.27614 6.5 8 6.5H5C4.72386 6.5 4.5 6.72386\n 4.5 7V10C4.5 10.2761 4.72386 10.5 5 10.5H8C8.27614\n 10.5 8.5 10.2761 8.5 10V7Z\" fill=\"").concat(color, "\"></path>\n <path fill-rule=\"evenodd\" clip-rule=\"evenodd\"\n d=\"M7 13C7 12.7239 6.77614 12.5 6.5 12.5C6.22386 12.5\n 6 12.7239 6 13V15.5C6 15.7761 6.22386 16 6.5\n 16H14.5V17C14.5 17.8284 15.1716 18.5 16 18.5H19C19.8284\n 18.5 20.5 17.8284 20.5 17V14C20.5 13.1716 19.8284 12.5\n 19 12.5H16C15.1716 12.5 14.5 13.1716 14.5\n 14V15H7V13ZM15.5 17C15.5 17.2761 15.7239 17.5 16\n 17.5H19C19.2761 17.5 19.5 17.2761 19.5 17V14C19.5\n 13.7239 19.2761 13.5 19 13.5H16C15.7239 13.5 15.5\n 13.7239 15.5 14V17Z\" fill=\"").concat(color, "\"></path> </g></svg></div>"));
|
|
41181
|
+
}
|
|
41182
|
+
|
|
41183
|
+
var requiredElement = '<span class="_pendo-required-indicator" style="color:red; font-style:italic;" title="Question is required"> *</span>';
|
|
41184
|
+
var requiredSyntax = '{required/}';
|
|
41185
|
+
var RequiredQuestions = {
|
|
41220
41186
|
name: 'RequiredQuestions',
|
|
41221
|
-
script(step, guide, pendo) {
|
|
41187
|
+
script: function (step, guide, pendo) {
|
|
41222
41188
|
var _a;
|
|
41223
|
-
|
|
41224
|
-
|
|
41225
|
-
|
|
41189
|
+
var requiredPollIds = [];
|
|
41190
|
+
var submitButtons = (_a = guideMarkdownUtil.lookupGuideButtons(step.domJson)) === null || _a === void 0 ? void 0 : _a.filter(function (button) {
|
|
41191
|
+
return button.actions.find(function (action) { return action.action === 'submitPoll' || action.action === 'submitPollAndGoToStep'; });
|
|
41192
|
+
});
|
|
41193
|
+
var requiredQuestions = processRequiredQuestions();
|
|
41226
41194
|
if (requiredQuestions) {
|
|
41227
|
-
pendo._.forEach(requiredQuestions, (question)
|
|
41195
|
+
pendo._.forEach(requiredQuestions, function (question) {
|
|
41228
41196
|
if (question.classList.contains('_pendo-open-text-poll-question')) {
|
|
41229
|
-
|
|
41230
|
-
step.attachEvent(step.guideElement.find(
|
|
41197
|
+
var pollId = question.dataset.pendoPollId;
|
|
41198
|
+
step.attachEvent(step.guideElement.find("[data-pendo-poll-id=".concat(pollId, "]._pendo-open-text-poll-input"))[0], 'input', function () {
|
|
41231
41199
|
evaluateRequiredQuestions(requiredQuestions);
|
|
41232
41200
|
});
|
|
41233
41201
|
}
|
|
@@ -41239,8 +41207,8 @@ const RequiredQuestions = {
|
|
|
41239
41207
|
});
|
|
41240
41208
|
}
|
|
41241
41209
|
function getEligibleQuestions() {
|
|
41242
|
-
|
|
41243
|
-
return pendo._.reduce(allQuestions, (eligibleQuestions, question)
|
|
41210
|
+
var allQuestions = step.guideElement.find("[class*=-poll-question]:contains(".concat(requiredSyntax, ")"));
|
|
41211
|
+
return pendo._.reduce(allQuestions, function (eligibleQuestions, question) {
|
|
41244
41212
|
if (question.classList.contains('_pendo-yes-no-poll-question'))
|
|
41245
41213
|
return eligibleQuestions;
|
|
41246
41214
|
eligibleQuestions.push(question);
|
|
@@ -41248,27 +41216,19 @@ const RequiredQuestions = {
|
|
|
41248
41216
|
}, []);
|
|
41249
41217
|
}
|
|
41250
41218
|
function processRequiredQuestions() {
|
|
41251
|
-
|
|
41219
|
+
var questions = getEligibleQuestions();
|
|
41252
41220
|
if (questions) {
|
|
41253
|
-
pendo._.forEach(questions, question
|
|
41254
|
-
|
|
41221
|
+
pendo._.forEach(questions, function (question) {
|
|
41222
|
+
var dataPendoPollId = question.getAttribute('data-pendo-poll-id');
|
|
41255
41223
|
requiredPollIds.push(dataPendoPollId);
|
|
41256
|
-
pendo._.each(step.guideElement.find(
|
|
41224
|
+
pendo._.each(step.guideElement.find("#".concat(question.id, " *, #").concat(question.id)), function (element) {
|
|
41257
41225
|
guideMarkdownUtil.removeMarkdownSyntax(element, requiredSyntax, '', pendo);
|
|
41258
41226
|
});
|
|
41259
|
-
step.guideElement.find(
|
|
41227
|
+
step.guideElement.find("#".concat(question.id, " p")).append(requiredElement);
|
|
41260
41228
|
});
|
|
41261
41229
|
}
|
|
41262
41230
|
if (pendo._.size(requiredPollIds)) {
|
|
41263
|
-
|
|
41264
|
-
id=_pendo-guide-required-disabled>
|
|
41265
|
-
._pendo-button:disabled, ._pendo-buttons[disabled] {
|
|
41266
|
-
border: 1px solid #999999 !important;
|
|
41267
|
-
background-color: #cccccc !important;
|
|
41268
|
-
color: #666666 !important;
|
|
41269
|
-
pointer-events: none !important;
|
|
41270
|
-
}
|
|
41271
|
-
</style>`;
|
|
41231
|
+
var disabledButtonStyles = "<style type=text/css\n id=_pendo-guide-required-disabled>\n ._pendo-button:disabled, ._pendo-buttons[disabled] {\n border: 1px solid #999999 !important;\n background-color: #cccccc !important;\n color: #666666 !important;\n pointer-events: none !important;\n }\n </style>";
|
|
41272
41232
|
if (pendo.dom('#_pendo-guide-required-disabled').length === 0) {
|
|
41273
41233
|
pendo.dom('head').append(disabledButtonStyles);
|
|
41274
41234
|
}
|
|
@@ -41279,15 +41239,11 @@ const RequiredQuestions = {
|
|
|
41279
41239
|
function evaluateRequiredQuestions(questions) {
|
|
41280
41240
|
if (questions.length === 0)
|
|
41281
41241
|
return;
|
|
41282
|
-
|
|
41283
|
-
|
|
41284
|
-
responses = responses.concat(pendo._.map(questions, (question)
|
|
41285
|
-
|
|
41286
|
-
|
|
41287
|
-
[data-pendo-poll-id=${pollId}] textarea,
|
|
41288
|
-
[data-pendo-poll-id=${pollId}] input:text,
|
|
41289
|
-
[data-pendo-poll-id=${pollId}] select,
|
|
41290
|
-
[data-pendo-poll-id=${pollId}] input:radio:checked`);
|
|
41242
|
+
var allRequiredComplete = true;
|
|
41243
|
+
var responses = [];
|
|
41244
|
+
responses = responses.concat(pendo._.map(questions, function (question) {
|
|
41245
|
+
var pollId = question.getAttribute('data-pendo-poll-id');
|
|
41246
|
+
var input = step.guideElement.find("\n [data-pendo-poll-id=".concat(pollId, "] textarea,\n [data-pendo-poll-id=").concat(pollId, "] input:text,\n [data-pendo-poll-id=").concat(pollId, "] select,\n [data-pendo-poll-id=").concat(pollId, "] input:radio:checked"));
|
|
41291
41247
|
if (input && input.length && input[0].value) {
|
|
41292
41248
|
return input[0].value;
|
|
41293
41249
|
}
|
|
@@ -41304,48 +41260,48 @@ const RequiredQuestions = {
|
|
|
41304
41260
|
}
|
|
41305
41261
|
function disableEligibleButtons(buttons) {
|
|
41306
41262
|
pendo._.each(buttons, function (button) {
|
|
41307
|
-
if (step.guideElement.find(
|
|
41308
|
-
step.guideElement.find(
|
|
41309
|
-
step.guideElement.find(
|
|
41263
|
+
if (step.guideElement.find("#".concat(button.props.id))[0]) {
|
|
41264
|
+
step.guideElement.find("#".concat(button.props.id))[0].disabled = true;
|
|
41265
|
+
step.guideElement.find("#".concat(button.props.id))[0].parentElement.title = 'Please complete all required questions.';
|
|
41310
41266
|
}
|
|
41311
41267
|
});
|
|
41312
41268
|
}
|
|
41313
41269
|
function enableEligibleButtons(buttons) {
|
|
41314
41270
|
pendo._.each(buttons, function (button) {
|
|
41315
|
-
if (step.guideElement.find(
|
|
41316
|
-
step.guideElement.find(
|
|
41317
|
-
step.guideElement.find(
|
|
41271
|
+
if (step.guideElement.find("#".concat(button.props.id))[0]) {
|
|
41272
|
+
step.guideElement.find("#".concat(button.props.id))[0].disabled = false;
|
|
41273
|
+
step.guideElement.find("#".concat(button.props.id))[0].parentElement.title = '';
|
|
41318
41274
|
}
|
|
41319
41275
|
});
|
|
41320
41276
|
}
|
|
41321
41277
|
},
|
|
41322
|
-
test(step, guide, pendo) {
|
|
41278
|
+
test: function (step, guide, pendo) {
|
|
41323
41279
|
var _a;
|
|
41324
|
-
|
|
41280
|
+
var requiredQuestions = (_a = step.guideElement) === null || _a === void 0 ? void 0 : _a.find("[class*=-poll-question]:contains(".concat(requiredSyntax, ")"));
|
|
41325
41281
|
return !pendo._.isUndefined(requiredQuestions) && pendo._.size(requiredQuestions);
|
|
41326
41282
|
},
|
|
41327
|
-
designerListener(pendo) {
|
|
41328
|
-
|
|
41329
|
-
|
|
41330
|
-
|
|
41283
|
+
designerListener: function (pendo) {
|
|
41284
|
+
var requiredQuestions = [];
|
|
41285
|
+
var target = pendo.dom.getBody();
|
|
41286
|
+
var config = {
|
|
41331
41287
|
attributeFilter: ['data-layout'],
|
|
41332
41288
|
attributes: true,
|
|
41333
41289
|
childList: true,
|
|
41334
41290
|
characterData: true,
|
|
41335
41291
|
subtree: true
|
|
41336
41292
|
};
|
|
41337
|
-
|
|
41338
|
-
|
|
41293
|
+
var MutationObserver = getZoneSafeMethod(pendo._, 'MutationObserver');
|
|
41294
|
+
var observer = new MutationObserver(applyRequiredIndicators);
|
|
41339
41295
|
observer.observe(target, config);
|
|
41340
41296
|
function applyRequiredIndicators(mutations) {
|
|
41341
41297
|
pendo._.each(mutations, function (mutation) {
|
|
41342
41298
|
var _a;
|
|
41343
|
-
|
|
41299
|
+
var nodeHasQuerySelector = pendo._.isFunction((_a = mutation.addedNodes[0]) === null || _a === void 0 ? void 0 : _a.querySelectorAll);
|
|
41344
41300
|
if (mutation.addedNodes.length && nodeHasQuerySelector) {
|
|
41345
|
-
|
|
41301
|
+
var eligiblePolls = mutation.addedNodes[0].querySelectorAll('[class*=-poll-wrapper], [class*=-poll-select-border]');
|
|
41346
41302
|
if (eligiblePolls) {
|
|
41347
41303
|
pendo._.each(eligiblePolls, function (poll) {
|
|
41348
|
-
|
|
41304
|
+
var dataPendoPollId;
|
|
41349
41305
|
if (poll.classList.contains('_pendo-open-text-poll-wrapper') ||
|
|
41350
41306
|
poll.classList.contains('_pendo-number-scale-poll-wrapper')) {
|
|
41351
41307
|
dataPendoPollId = poll.getAttribute('name');
|
|
@@ -41353,27 +41309,27 @@ const RequiredQuestions = {
|
|
|
41353
41309
|
else {
|
|
41354
41310
|
dataPendoPollId = poll.getAttribute('data-pendo-poll-id');
|
|
41355
41311
|
}
|
|
41356
|
-
|
|
41357
|
-
|
|
41312
|
+
var questionText;
|
|
41313
|
+
var pollQuesiton = pendo.dom("[class*=\"-poll-question\"][data-pendo-poll-id=".concat(dataPendoPollId, "]"))[0];
|
|
41358
41314
|
if (pollQuesiton) {
|
|
41359
|
-
questionText = pendo.dom(
|
|
41315
|
+
questionText = pendo.dom("[class*=\"-poll-question\"][data-pendo-poll-id=".concat(dataPendoPollId, "]"))[0].textContent;
|
|
41360
41316
|
}
|
|
41361
|
-
|
|
41317
|
+
var requiredSyntaxIndex = questionText.indexOf(requiredSyntax);
|
|
41362
41318
|
if (requiredSyntaxIndex > -1) {
|
|
41363
|
-
pendo._.each(pendo.dom(
|
|
41364
|
-
pendo._.each(pendo.dom(
|
|
41319
|
+
pendo._.each(pendo.dom("[data-pendo-poll-id=".concat(dataPendoPollId, "]:not(.pendo-radio)")), function (element) {
|
|
41320
|
+
pendo._.each(pendo.dom("#".concat(element.id, " *:not(\".pendo-radio\"), #").concat(element.id, ":not(\".pendo-radio\")")), function (item) {
|
|
41365
41321
|
guideMarkdownUtil.removeMarkdownSyntax(item, requiredSyntax, '', pendo);
|
|
41366
41322
|
});
|
|
41367
41323
|
});
|
|
41368
|
-
if (pendo.dom(
|
|
41369
|
-
pendo.dom(
|
|
41370
|
-
pendo.dom(
|
|
41324
|
+
if (pendo.dom(".bb-text[data-pendo-poll-id=".concat(dataPendoPollId, "] p")).length !== 0 || pendo.dom(".bb-text[data-pendo-poll-id=".concat(dataPendoPollId, "] li")).length !== 0) {
|
|
41325
|
+
pendo.dom(".bb-text[data-pendo-poll-id=".concat(dataPendoPollId, "] p")).append(requiredElement);
|
|
41326
|
+
pendo.dom(".bb-text[data-pendo-poll-id=".concat(dataPendoPollId, "] li")).append(requiredElement);
|
|
41371
41327
|
}
|
|
41372
41328
|
else {
|
|
41373
|
-
pendo.dom(
|
|
41329
|
+
pendo.dom(".bb-text[data-pendo-poll-id=".concat(dataPendoPollId, "]")).append(requiredElement);
|
|
41374
41330
|
}
|
|
41375
41331
|
if (pendo._.contains(requiredQuestions, dataPendoPollId)) {
|
|
41376
|
-
|
|
41332
|
+
var questionIndex = requiredQuestions.indexOf(dataPendoPollId);
|
|
41377
41333
|
if (questionIndex !== -1) {
|
|
41378
41334
|
requiredQuestions.splice(questionIndex, 1);
|
|
41379
41335
|
}
|
|
@@ -41384,7 +41340,7 @@ const RequiredQuestions = {
|
|
|
41384
41340
|
}
|
|
41385
41341
|
else {
|
|
41386
41342
|
if (pendo._.contains(requiredQuestions, dataPendoPollId)) {
|
|
41387
|
-
|
|
41343
|
+
var index = requiredQuestions.indexOf(dataPendoPollId);
|
|
41388
41344
|
if (index !== -1) {
|
|
41389
41345
|
requiredQuestions.splice(index, 1);
|
|
41390
41346
|
}
|
|
@@ -41398,54 +41354,54 @@ const RequiredQuestions = {
|
|
|
41398
41354
|
}
|
|
41399
41355
|
};
|
|
41400
41356
|
|
|
41401
|
-
|
|
41402
|
-
|
|
41403
|
-
script(step, guide, pendo) {
|
|
41404
|
-
|
|
41405
|
-
|
|
41406
|
-
|
|
41407
|
-
|
|
41408
|
-
|
|
41357
|
+
var skipStepRegex = new RegExp(guideMarkdownUtil.skipStepString);
|
|
41358
|
+
var SkipToEligibleStep = {
|
|
41359
|
+
script: function (step, guide, pendo) {
|
|
41360
|
+
var isAdvanceIntercepted = false;
|
|
41361
|
+
var isPreviousIntercepted = false;
|
|
41362
|
+
var guideContainer = step.guideElement.find(guideMarkdownUtil.containerSelector);
|
|
41363
|
+
var guideContainerAriaLabel = guideContainer.attr('aria-label');
|
|
41364
|
+
var stepNumberOrAuto = skipStepRegex.exec(guideContainerAriaLabel)[1];
|
|
41409
41365
|
if (guideContainer) {
|
|
41410
41366
|
guideContainer.attr({ 'aria-label': guideContainer.attr('aria-label').replace(skipStepRegex, '') });
|
|
41411
41367
|
}
|
|
41412
|
-
this.on('beforeAdvance', (evt)
|
|
41368
|
+
this.on('beforeAdvance', function (evt) {
|
|
41413
41369
|
if (guide.getPositionOfStep(step) === guide.steps.length || pendo._.isUndefined(stepNumberOrAuto))
|
|
41414
41370
|
return; // exit on the last step of a guide or when we don't have an argument
|
|
41415
|
-
|
|
41371
|
+
var eligibleStep = findEligibleSkipStep(stepNumberOrAuto, 'next');
|
|
41416
41372
|
if (!isAdvanceIntercepted && stepNumberOrAuto) {
|
|
41417
41373
|
isAdvanceIntercepted = true;
|
|
41418
|
-
pendo.goToStep({ destinationStepId: eligibleStep.id, step });
|
|
41374
|
+
pendo.goToStep({ destinationStepId: eligibleStep.id, step: step });
|
|
41419
41375
|
evt.cancel = true;
|
|
41420
41376
|
}
|
|
41421
41377
|
});
|
|
41422
|
-
this.on('beforePrevious', (evt)
|
|
41378
|
+
this.on('beforePrevious', function (evt) {
|
|
41423
41379
|
if (pendo._.isUndefined(stepNumberOrAuto))
|
|
41424
41380
|
return;
|
|
41425
|
-
|
|
41381
|
+
var eligibleStep = findEligibleSkipStep(stepNumberOrAuto, 'previous');
|
|
41426
41382
|
if (!isPreviousIntercepted && stepNumberOrAuto) {
|
|
41427
41383
|
isPreviousIntercepted = true;
|
|
41428
|
-
pendo.goToStep({ destinationStepId: eligibleStep.id, step });
|
|
41384
|
+
pendo.goToStep({ destinationStepId: eligibleStep.id, step: step });
|
|
41429
41385
|
evt.cancel = true;
|
|
41430
41386
|
}
|
|
41431
41387
|
});
|
|
41432
41388
|
function findEligibleSkipStep(stepNumber, direction) {
|
|
41433
41389
|
// Find the next eligible step by using getPosition of step (1 based)
|
|
41434
41390
|
// getPosition - 2 gives the previous step
|
|
41435
|
-
|
|
41436
|
-
|
|
41391
|
+
var skipForwardStep = findStepOnPage(guide.getPositionOfStep(step), 'next', stepNumber);
|
|
41392
|
+
var skipPreviousStep = findStepOnPage(guide.getPositionOfStep(step) - 2, 'previous', stepNumber);
|
|
41437
41393
|
if (skipForwardStep && direction == 'next') {
|
|
41438
|
-
pendo.goToStep({ destinationStepId: skipForwardStep, step });
|
|
41394
|
+
pendo.goToStep({ destinationStepId: skipForwardStep, step: step });
|
|
41439
41395
|
}
|
|
41440
41396
|
if (skipPreviousStep && direction == 'previous') {
|
|
41441
|
-
pendo.goToStep({ destinationStepId: skipPreviousStep, step });
|
|
41397
|
+
pendo.goToStep({ destinationStepId: skipPreviousStep, step: step });
|
|
41442
41398
|
}
|
|
41443
41399
|
return direction === 'next' ? skipForwardStep : skipPreviousStep;
|
|
41444
41400
|
}
|
|
41445
41401
|
function findStepOnPage(stepIndex, direction, stepNumber) {
|
|
41446
41402
|
if (pendo._.isNaN(stepIndex))
|
|
41447
41403
|
return;
|
|
41448
|
-
|
|
41404
|
+
var $step = guide.steps[stepIndex];
|
|
41449
41405
|
if ($step && !$step.canShow()) {
|
|
41450
41406
|
if (stepNumber !== 'auto') {
|
|
41451
41407
|
return guide.steps[stepNumber - 1];
|
|
@@ -41462,34 +41418,34 @@ const SkipToEligibleStep = {
|
|
|
41462
41418
|
}
|
|
41463
41419
|
}
|
|
41464
41420
|
},
|
|
41465
|
-
test(step, guide, pendo) {
|
|
41421
|
+
test: function (step, guide, pendo) {
|
|
41466
41422
|
var _a;
|
|
41467
|
-
|
|
41423
|
+
var guideContainerAriaLabel = (_a = step.guideElement) === null || _a === void 0 ? void 0 : _a.find(guideMarkdownUtil.containerSelector).attr('aria-label');
|
|
41468
41424
|
return pendo._.isString(guideContainerAriaLabel) && guideContainerAriaLabel.indexOf('{skipStep') !== -1;
|
|
41469
41425
|
},
|
|
41470
|
-
designerListener(pendo) {
|
|
41471
|
-
|
|
41472
|
-
|
|
41426
|
+
designerListener: function (pendo) {
|
|
41427
|
+
var target = pendo.dom.getBody();
|
|
41428
|
+
var config = {
|
|
41473
41429
|
attributeFilter: ['data-layout'],
|
|
41474
41430
|
attributes: true,
|
|
41475
41431
|
childList: true,
|
|
41476
41432
|
characterData: true,
|
|
41477
41433
|
subtree: true
|
|
41478
41434
|
};
|
|
41479
|
-
|
|
41480
|
-
|
|
41435
|
+
var MutationObserver = getZoneSafeMethod(pendo._, 'MutationObserver');
|
|
41436
|
+
var observer = new MutationObserver(applySkipStepIndicator);
|
|
41481
41437
|
observer.observe(target, config);
|
|
41482
41438
|
// create an observer instance
|
|
41483
41439
|
function applySkipStepIndicator(mutations) {
|
|
41484
41440
|
pendo._.each(mutations, function (mutation) {
|
|
41485
41441
|
var _a, _b;
|
|
41486
|
-
|
|
41442
|
+
var nodeHasQuerySelector = pendo._.isFunction((_a = mutation.addedNodes[0]) === null || _a === void 0 ? void 0 : _a.querySelectorAll);
|
|
41487
41443
|
if (mutation.addedNodes.length && nodeHasQuerySelector) {
|
|
41488
|
-
|
|
41489
|
-
|
|
41444
|
+
var guideContainer = mutation.addedNodes[0].querySelectorAll(guideMarkdownUtil.containerSelector);
|
|
41445
|
+
var guideContainerAriaLabel = (_b = guideContainer[0]) === null || _b === void 0 ? void 0 : _b.getAttribute('aria-label');
|
|
41490
41446
|
if (guideContainerAriaLabel) {
|
|
41491
41447
|
if (guideContainerAriaLabel.match(skipStepRegex)) {
|
|
41492
|
-
|
|
41448
|
+
var fullSkipStepString = guideContainerAriaLabel.match(skipStepRegex)[0];
|
|
41493
41449
|
guideContainerAriaLabel.replace(fullSkipStepString, '');
|
|
41494
41450
|
if (!pendo.dom('#_pendoSkipIcon').length) {
|
|
41495
41451
|
pendo.dom(guideMarkdownUtil.containerSelector).append(skipIcon('#999', '30px').trim());
|
|
@@ -41500,48 +41456,30 @@ const SkipToEligibleStep = {
|
|
|
41500
41456
|
});
|
|
41501
41457
|
}
|
|
41502
41458
|
function skipIcon(color, size) {
|
|
41503
|
-
return (
|
|
41504
|
-
width="${size}" height="${size}" viewBox="0 0 512.000000 512.000000"
|
|
41505
|
-
preserveAspectRatio="xMidYMid meet" style="bottom:5px; right:10px; position: absolute;">
|
|
41506
|
-
<g transform="translate(0.000000,512.000000) scale(0.100000,-0.100000)"
|
|
41507
|
-
fill="${color}" stroke="none">
|
|
41508
|
-
<path d="M2185 4469 c-363 -38 -739 -186 -1034 -407 -95 -71 -273 -243 -357
|
|
41509
|
-
-343 -205 -246 -364 -577 -429 -897 -25 -121 -45 -288 -45 -373 l0 -49 160 0
|
|
41510
|
-
160 0 0 48 c0 26 5 88 10 137 68 593 417 1103 940 1374 1100 570 2418 -137
|
|
41511
|
-
2560 -1374 5 -49 10 -111 10 -137 l0 -47 -155 -3 -155 -3 235 -235 235 -236
|
|
41512
|
-
235 236 235 235 -155 3 -155 3 0 48 c0 27 -5 95 -10 152 -100 989 -878 1767
|
|
41513
|
-
-1869 1868 -117 12 -298 12 -416 0z"/>
|
|
41514
|
-
<path d="M320 1440 l0 -160 160 0 160 0 0 160 0 160 -160 0 -160 0 0 -160z"/>
|
|
41515
|
-
<path d="M960 1440 l0 -160 160 0 160 0 0 160 0 160 -160 0 -160 0 0 -160z"/>
|
|
41516
|
-
<path d="M1600 1440 l0 -160 160 0 160 0 0 160 0 160 -160 0 -160 0 0 -160z"/>
|
|
41517
|
-
<path d="M2240 1440 l0 -160 160 0 160 0 0 160 0 160 -160 0 -160 0 0 -160z"/>
|
|
41518
|
-
<path d="M2880 1440 l0 -160 160 0 160 0 0 160 0 160 -160 0 -160 0 0 -160z"/>
|
|
41519
|
-
<path d="M3840 1440 l0 -160 480 0 480 0 0 160 0 160 -480 0 -480 0 0 -160z"/>
|
|
41520
|
-
</g></svg></div>
|
|
41521
|
-
`);
|
|
41459
|
+
return ("<div title=\"Skip step added\"><svg id=\"_pendoSkipIcon\" version=\"1.0\" xmlns=\"http://www.w3.org/2000/svg\"\n width=\"".concat(size, "\" height=\"").concat(size, "\" viewBox=\"0 0 512.000000 512.000000\"\n preserveAspectRatio=\"xMidYMid meet\" style=\"bottom:5px; right:10px; position: absolute;\">\n <g transform=\"translate(0.000000,512.000000) scale(0.100000,-0.100000)\"\n fill=\"").concat(color, "\" stroke=\"none\">\n <path d=\"M2185 4469 c-363 -38 -739 -186 -1034 -407 -95 -71 -273 -243 -357\n -343 -205 -246 -364 -577 -429 -897 -25 -121 -45 -288 -45 -373 l0 -49 160 0\n 160 0 0 48 c0 26 5 88 10 137 68 593 417 1103 940 1374 1100 570 2418 -137\n 2560 -1374 5 -49 10 -111 10 -137 l0 -47 -155 -3 -155 -3 235 -235 235 -236\n 235 236 235 235 -155 3 -155 3 0 48 c0 27 -5 95 -10 152 -100 989 -878 1767\n -1869 1868 -117 12 -298 12 -416 0z\"/>\n <path d=\"M320 1440 l0 -160 160 0 160 0 0 160 0 160 -160 0 -160 0 0 -160z\"/>\n <path d=\"M960 1440 l0 -160 160 0 160 0 0 160 0 160 -160 0 -160 0 0 -160z\"/>\n <path d=\"M1600 1440 l0 -160 160 0 160 0 0 160 0 160 -160 0 -160 0 0 -160z\"/>\n <path d=\"M2240 1440 l0 -160 160 0 160 0 0 160 0 160 -160 0 -160 0 0 -160z\"/>\n <path d=\"M2880 1440 l0 -160 160 0 160 0 0 160 0 160 -160 0 -160 0 0 -160z\"/>\n <path d=\"M3840 1440 l0 -160 480 0 480 0 0 160 0 160 -480 0 -480 0 0 -160z\"/>\n </g></svg></div>\n "));
|
|
41522
41460
|
}
|
|
41523
41461
|
}
|
|
41524
41462
|
};
|
|
41525
41463
|
|
|
41526
41464
|
function GuideMarkdown() {
|
|
41527
|
-
|
|
41528
|
-
|
|
41529
|
-
|
|
41465
|
+
var guideMarkdown;
|
|
41466
|
+
var pluginApi;
|
|
41467
|
+
var globalPendo;
|
|
41530
41468
|
return {
|
|
41531
41469
|
name: 'GuideMarkdown',
|
|
41532
41470
|
initialize: init,
|
|
41533
|
-
teardown
|
|
41471
|
+
teardown: teardown
|
|
41534
41472
|
};
|
|
41535
41473
|
function init(pendo, PluginAPI) {
|
|
41536
41474
|
globalPendo = pendo;
|
|
41537
41475
|
pluginApi = PluginAPI;
|
|
41538
|
-
|
|
41539
|
-
|
|
41476
|
+
var configReader = PluginAPI.ConfigReader;
|
|
41477
|
+
var GUIDEMARKDOWN_CONFIG = 'guideMarkdown';
|
|
41540
41478
|
configReader.addOption(GUIDEMARKDOWN_CONFIG, [
|
|
41541
41479
|
configReader.sources.SNIPPET_SRC,
|
|
41542
41480
|
configReader.sources.PENDO_CONFIG_SRC
|
|
41543
41481
|
], false);
|
|
41544
|
-
|
|
41482
|
+
var markdownScriptsEnabled = configReader.get(GUIDEMARKDOWN_CONFIG);
|
|
41545
41483
|
if (!markdownScriptsEnabled)
|
|
41546
41484
|
return;
|
|
41547
41485
|
guideMarkdown = [PollBranching, MetadataSubstitution, RequiredQuestions, SkipToEligibleStep];
|
|
@@ -42540,11 +42478,24 @@ function VocPortal() {
|
|
|
42540
42478
|
}
|
|
42541
42479
|
}`, container);
|
|
42542
42480
|
resizePortalIframe();
|
|
42481
|
+
clampContainerToViewport(container);
|
|
42543
42482
|
}
|
|
42544
42483
|
catch (err) {
|
|
42545
42484
|
pluginAPI.log.error('Error while adjusting RC module', err);
|
|
42546
42485
|
}
|
|
42547
42486
|
}
|
|
42487
|
+
function clampContainerToViewport(container) {
|
|
42488
|
+
if (!container)
|
|
42489
|
+
return;
|
|
42490
|
+
const leftPadding = 10;
|
|
42491
|
+
const rect = container.getBoundingClientRect();
|
|
42492
|
+
if (rect.left < leftPadding) {
|
|
42493
|
+
container.style.transform = `translateX(${leftPadding - rect.left}px)`;
|
|
42494
|
+
}
|
|
42495
|
+
else {
|
|
42496
|
+
container.style.transform = '';
|
|
42497
|
+
}
|
|
42498
|
+
}
|
|
42548
42499
|
function teardown() {
|
|
42549
42500
|
if (this.removeResizeEvent)
|
|
42550
42501
|
this.removeResizeEvent();
|
|
@@ -42567,8 +42518,8 @@ function Feedback() {
|
|
|
42567
42518
|
var widgetLoaded = false;
|
|
42568
42519
|
var feedbackAllowedProductId = '';
|
|
42569
42520
|
var initialized = false;
|
|
42570
|
-
|
|
42571
|
-
|
|
42521
|
+
var PING_COOKIE = 'feedback_ping_sent';
|
|
42522
|
+
var PING_COOKIE_EXPIRATION = 1000 * 60 * 60;
|
|
42572
42523
|
var overflowMediaQuery = '@media only screen and (max-device-width:1112px){#feedback-widget{overflow-y:scroll}}';
|
|
42573
42524
|
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%)}}';
|
|
42574
42525
|
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)}}';
|
|
@@ -42588,28 +42539,28 @@ function Feedback() {
|
|
|
42588
42539
|
feedbackStyles: 'pendo-feedback-styles',
|
|
42589
42540
|
feedbackFrameStyles: 'pendo-feedback-visible-buttons-styles'
|
|
42590
42541
|
};
|
|
42591
|
-
|
|
42592
|
-
|
|
42542
|
+
var globalPendo;
|
|
42543
|
+
var pluginApi;
|
|
42593
42544
|
return {
|
|
42594
42545
|
name: 'Feedback',
|
|
42595
|
-
initialize,
|
|
42596
|
-
teardown,
|
|
42597
|
-
validate
|
|
42546
|
+
initialize: initialize,
|
|
42547
|
+
teardown: teardown,
|
|
42548
|
+
validate: validate
|
|
42598
42549
|
};
|
|
42599
42550
|
function initialize(pendo, PluginAPI) {
|
|
42600
42551
|
globalPendo = pendo;
|
|
42601
42552
|
pluginApi = PluginAPI;
|
|
42602
42553
|
var publicFeedback = {
|
|
42603
|
-
ping,
|
|
42604
|
-
init,
|
|
42554
|
+
ping: ping,
|
|
42555
|
+
init: init,
|
|
42605
42556
|
initialized: getInitialized,
|
|
42606
|
-
loginAndRedirect,
|
|
42607
|
-
openFeedback,
|
|
42608
|
-
initializeFeedbackOnce,
|
|
42609
|
-
isFeedbackLoaded,
|
|
42610
|
-
convertPendoToFeedbackOptions,
|
|
42557
|
+
loginAndRedirect: loginAndRedirect,
|
|
42558
|
+
openFeedback: openFeedback,
|
|
42559
|
+
initializeFeedbackOnce: initializeFeedbackOnce,
|
|
42560
|
+
isFeedbackLoaded: isFeedbackLoaded,
|
|
42561
|
+
convertPendoToFeedbackOptions: convertPendoToFeedbackOptions,
|
|
42611
42562
|
isUnsupportedIE: pendo._.partial(isUnsupportedIE, PluginAPI),
|
|
42612
|
-
removeFeedbackWidget
|
|
42563
|
+
removeFeedbackWidget: removeFeedbackWidget
|
|
42613
42564
|
};
|
|
42614
42565
|
pendo.feedback = publicFeedback;
|
|
42615
42566
|
pendo.getFeedbackSettings = getFeedbackSettings;
|
|
@@ -42637,7 +42588,7 @@ function Feedback() {
|
|
|
42637
42588
|
*/
|
|
42638
42589
|
PluginAPI.agentStorage.registry.addLocal(PING_COOKIE, { duration: PING_COOKIE_EXPIRATION });
|
|
42639
42590
|
return {
|
|
42640
|
-
validate
|
|
42591
|
+
validate: validate
|
|
42641
42592
|
};
|
|
42642
42593
|
}
|
|
42643
42594
|
function teardown() {
|
|
@@ -42657,18 +42608,18 @@ function Feedback() {
|
|
|
42657
42608
|
return result;
|
|
42658
42609
|
}
|
|
42659
42610
|
function pingOrInitialize() {
|
|
42660
|
-
|
|
42611
|
+
var options = getPendoOptions();
|
|
42661
42612
|
if (initialized) {
|
|
42662
|
-
|
|
42613
|
+
var feedbackOptions = convertPendoToFeedbackOptions(options);
|
|
42663
42614
|
ping(feedbackOptions);
|
|
42664
42615
|
}
|
|
42665
42616
|
else if (shouldInitializeFeedback() && !globalPendo._.isEmpty(options)) {
|
|
42666
|
-
|
|
42667
|
-
init(options, settings)
|
|
42617
|
+
var settings = pluginApi.ConfigReader.get('feedbackSettings');
|
|
42618
|
+
init(options, settings)["catch"](globalPendo._.noop);
|
|
42668
42619
|
}
|
|
42669
42620
|
}
|
|
42670
42621
|
function handleIdentityChange(event) {
|
|
42671
|
-
|
|
42622
|
+
var visitorId = globalPendo._.get(event, 'data.0.visitor_id') || globalPendo._.get(event, 'data.0.options.visitor.id');
|
|
42672
42623
|
if (globalPendo.isAnonymousVisitor(visitorId)) {
|
|
42673
42624
|
removeFeedbackWidget();
|
|
42674
42625
|
return;
|
|
@@ -42738,9 +42689,9 @@ function Feedback() {
|
|
|
42738
42689
|
if (toSend.data && toSend.data !== '{}' && toSend.data !== 'null') {
|
|
42739
42690
|
return globalPendo.ajax
|
|
42740
42691
|
.postJSON(getFullUrl('/widget/pendo_ping'), toSend)
|
|
42741
|
-
.then((response)
|
|
42692
|
+
.then(function (response) {
|
|
42742
42693
|
onWidgetPingResponse(response);
|
|
42743
|
-
})
|
|
42694
|
+
})["catch"](function () { onPingFailure(); });
|
|
42744
42695
|
}
|
|
42745
42696
|
}
|
|
42746
42697
|
return pluginApi.q.resolve();
|
|
@@ -42874,10 +42825,10 @@ function Feedback() {
|
|
|
42874
42825
|
return globalPendo.ajax.postJSON(getFullUrl('/analytics'), toSend);
|
|
42875
42826
|
}
|
|
42876
42827
|
function addOverlay() {
|
|
42877
|
-
|
|
42828
|
+
var widget = globalPendo.dom("#".concat(elemIds.feedbackWidget));
|
|
42878
42829
|
if (!widget)
|
|
42879
42830
|
return;
|
|
42880
|
-
|
|
42831
|
+
var overlayStyles = {
|
|
42881
42832
|
'position': 'fixed',
|
|
42882
42833
|
'top': '0',
|
|
42883
42834
|
'right': '0',
|
|
@@ -42889,7 +42840,7 @@ function Feedback() {
|
|
|
42889
42840
|
'animation': 'pendoFeedbackFadeIn 0.5s 0s 1 alternate both',
|
|
42890
42841
|
'-webkit-animation': 'pendoFeedbackFadeIn 0.5s 0s 1 alternate both'
|
|
42891
42842
|
};
|
|
42892
|
-
|
|
42843
|
+
var overlayElement = globalPendo.dom(document.createElement('div'));
|
|
42893
42844
|
overlayElement.attr('id', 'feedback-overlay');
|
|
42894
42845
|
overlayElement.css(overlayStyles);
|
|
42895
42846
|
overlayElement.appendTo(widget.getParent());
|
|
@@ -42994,22 +42945,22 @@ function Feedback() {
|
|
|
42994
42945
|
}
|
|
42995
42946
|
}
|
|
42996
42947
|
function buildOuterTriggerDiv(positionInfo) {
|
|
42997
|
-
|
|
42998
|
-
|
|
42999
|
-
|
|
42948
|
+
var horizontalStyles = getHorizontalPositionStyles(positionInfo);
|
|
42949
|
+
var verticalStyles = getVerticalPositionStyles(positionInfo);
|
|
42950
|
+
var styles = globalPendo._.extend({
|
|
43000
42951
|
'position': 'fixed',
|
|
43001
42952
|
'height': '43px',
|
|
43002
42953
|
'opacity': '1 !important',
|
|
43003
42954
|
'z-index': '9001'
|
|
43004
42955
|
}, horizontalStyles, verticalStyles);
|
|
43005
|
-
|
|
42956
|
+
var outerTrigger = globalPendo.dom(document.createElement('div'));
|
|
43006
42957
|
outerTrigger.attr('id', elemIds.feedbackTrigger);
|
|
43007
42958
|
outerTrigger.css(styles);
|
|
43008
42959
|
outerTrigger.attr('data-turbolinks-permanent', '');
|
|
43009
42960
|
return outerTrigger;
|
|
43010
42961
|
}
|
|
43011
42962
|
function buildNotification() {
|
|
43012
|
-
|
|
42963
|
+
var styles = {
|
|
43013
42964
|
'background-color': '#D85039',
|
|
43014
42965
|
'color': '#fff',
|
|
43015
42966
|
'border-radius': '50%',
|
|
@@ -43026,20 +42977,20 @@ function Feedback() {
|
|
|
43026
42977
|
'animation-delay': '1s',
|
|
43027
42978
|
'animation-iteration-count': '1'
|
|
43028
42979
|
};
|
|
43029
|
-
|
|
42980
|
+
var notification = globalPendo.dom(document.createElement('span'));
|
|
43030
42981
|
notification.attr('id', 'feedback-trigger-notification');
|
|
43031
42982
|
notification.css(styles);
|
|
43032
42983
|
return notification;
|
|
43033
42984
|
}
|
|
43034
42985
|
function buildTriggerButton(settings, positionInfo) {
|
|
43035
|
-
|
|
42986
|
+
var borderRadius;
|
|
43036
42987
|
if (positionInfo.horizontalPosition === 'left') {
|
|
43037
42988
|
borderRadius = '0 0 5px 5px';
|
|
43038
42989
|
}
|
|
43039
42990
|
else {
|
|
43040
42991
|
borderRadius = '3px 3px 0 0';
|
|
43041
42992
|
}
|
|
43042
|
-
|
|
42993
|
+
var styles = {
|
|
43043
42994
|
'border': 'none',
|
|
43044
42995
|
'padding': '11px 18px 14px 18px',
|
|
43045
42996
|
'background-color': settings.triggerColor,
|
|
@@ -43050,32 +43001,21 @@ function Feedback() {
|
|
|
43050
43001
|
'cursor': 'pointer',
|
|
43051
43002
|
'text-align': 'left'
|
|
43052
43003
|
};
|
|
43053
|
-
|
|
43004
|
+
var triggerButton = globalPendo.dom(document.createElement('button'));
|
|
43054
43005
|
triggerButton.attr('id', elemIds.feedbackTriggerButton);
|
|
43055
43006
|
triggerButton.css(styles);
|
|
43056
43007
|
triggerButton.text(settings.triggerText);
|
|
43057
43008
|
return triggerButton;
|
|
43058
43009
|
}
|
|
43059
43010
|
function addTriggerPseudoStyles() {
|
|
43060
|
-
|
|
43061
|
-
#feedback-trigger button:hover {
|
|
43062
|
-
box-shadow: 0 -5px 20px rgba(0,0,0,.19) !important;
|
|
43063
|
-
outline: none !important;
|
|
43064
|
-
background: #3e566f !important;
|
|
43065
|
-
}
|
|
43066
|
-
#feedback-trigger button:focus {
|
|
43067
|
-
box-shadow: 0 -5px 20px rgba(0,0,0,.19) !important;
|
|
43068
|
-
outline: none !important;
|
|
43069
|
-
background: #3e566f !important;
|
|
43070
|
-
}
|
|
43071
|
-
`;
|
|
43011
|
+
var pseudoStyles = "\n #feedback-trigger button:hover {\n box-shadow: 0 -5px 20px rgba(0,0,0,.19) !important;\n outline: none !important;\n background: #3e566f !important;\n }\n #feedback-trigger button:focus {\n box-shadow: 0 -5px 20px rgba(0,0,0,.19) !important;\n outline: none !important;\n background: #3e566f !important;\n }\n ";
|
|
43072
43012
|
pluginApi.util.addInlineStyles('pendo-feedback-trigger-styles', pseudoStyles);
|
|
43073
43013
|
}
|
|
43074
43014
|
function createTrigger(settings, positionInfo) {
|
|
43075
43015
|
addTriggerPseudoStyles();
|
|
43076
|
-
|
|
43077
|
-
|
|
43078
|
-
|
|
43016
|
+
var triggerElement = buildOuterTriggerDiv(positionInfo);
|
|
43017
|
+
var notificationElement = buildNotification();
|
|
43018
|
+
var triggerButtonElement = buildTriggerButton(settings, positionInfo);
|
|
43079
43019
|
triggerElement.append(notificationElement);
|
|
43080
43020
|
triggerElement.append(triggerButtonElement);
|
|
43081
43021
|
triggerElement.appendTo(globalPendo.dom.getBody());
|
|
@@ -43099,7 +43039,7 @@ function Feedback() {
|
|
|
43099
43039
|
iframeWrapper.css(getWidgetOriginalStyles());
|
|
43100
43040
|
iframeWrapper.attr('id', elemIds.feedbackWidget);
|
|
43101
43041
|
iframeWrapper.attr('data-turbolinks-permanent', 'true');
|
|
43102
|
-
iframeWrapper.addClass(
|
|
43042
|
+
iframeWrapper.addClass("buttonIs-".concat(horizontalPosition));
|
|
43103
43043
|
return iframeWrapper;
|
|
43104
43044
|
}
|
|
43105
43045
|
function buildIframeContainer() {
|
|
@@ -43116,22 +43056,13 @@ function Feedback() {
|
|
|
43116
43056
|
return iframeContainer;
|
|
43117
43057
|
}
|
|
43118
43058
|
function addWidgetVisibleButtonStyles(buttonStylePosition) {
|
|
43119
|
-
|
|
43120
|
-
|
|
43121
|
-
.buttonIs-${side}.visible {
|
|
43122
|
-
${side}: 0 !important;
|
|
43123
|
-
width: 470px !important;
|
|
43124
|
-
animation-direction: alternate-reverse !important;
|
|
43125
|
-
animation: pendoFeedbackSlideFrom-${side} 0.5s 0s 1 alternate both !important;
|
|
43126
|
-
-webkit-animation: pendoFeedbackSlideFrom-${side} 0.5s 0s 1 alternate both !important;
|
|
43127
|
-
z-index: 9002 !important;
|
|
43128
|
-
}
|
|
43129
|
-
`;
|
|
43059
|
+
var side = buttonStylePosition === 'left' ? 'left' : 'right'; // just in case something was not left or right for some reason
|
|
43060
|
+
var styles = "\n .buttonIs-".concat(side, ".visible {\n ").concat(side, ": 0 !important;\n width: 470px !important;\n animation-direction: alternate-reverse !important;\n animation: pendoFeedbackSlideFrom-").concat(side, " 0.5s 0s 1 alternate both !important;\n -webkit-animation: pendoFeedbackSlideFrom-").concat(side, " 0.5s 0s 1 alternate both !important;\n z-index: 9002 !important;\n }\n ");
|
|
43130
43061
|
pluginApi.util.addInlineStyles(elemIds.feedbackFrameStyles, styles);
|
|
43131
43062
|
}
|
|
43132
43063
|
function initialiseWidgetFrame(horizontalPosition) {
|
|
43133
43064
|
addWidgetVisibleButtonStyles(horizontalPosition);
|
|
43134
|
-
|
|
43065
|
+
var iframeElement = buildIframeWrapper(horizontalPosition);
|
|
43135
43066
|
iframeElement.append(buildIframeContainer());
|
|
43136
43067
|
iframeElement.appendTo(globalPendo.dom.getBody());
|
|
43137
43068
|
subscribeToIframeMessages();
|
|
@@ -43155,7 +43086,7 @@ function Feedback() {
|
|
|
43155
43086
|
return widgetLoaded;
|
|
43156
43087
|
}
|
|
43157
43088
|
function getPendoOptions() {
|
|
43158
|
-
|
|
43089
|
+
var options = pluginApi.ConfigReader.getLocalConfig();
|
|
43159
43090
|
if (!globalPendo._.isObject(options))
|
|
43160
43091
|
options = {};
|
|
43161
43092
|
if (!globalPendo._.isObject(options.visitor))
|
|
@@ -43183,7 +43114,7 @@ function Feedback() {
|
|
|
43183
43114
|
return true;
|
|
43184
43115
|
}
|
|
43185
43116
|
function getQueryParam(url, paramName) {
|
|
43186
|
-
|
|
43117
|
+
var results = new RegExp('[?&]' + paramName + '=([^&#]*)').exec(url);
|
|
43187
43118
|
if (results == null) {
|
|
43188
43119
|
return null;
|
|
43189
43120
|
}
|
|
@@ -43200,13 +43131,13 @@ function Feedback() {
|
|
|
43200
43131
|
return pluginApi.q.reject();
|
|
43201
43132
|
if (!canInitFeedback(pendoOptions))
|
|
43202
43133
|
return pluginApi.q.reject();
|
|
43203
|
-
|
|
43134
|
+
var feedbackOptions = convertPendoToFeedbackOptions(pendoOptions);
|
|
43204
43135
|
try {
|
|
43205
|
-
|
|
43206
|
-
if (
|
|
43136
|
+
var fdbkDst_1 = getQueryParam(globalPendo.url.get(), 'fdbkDst');
|
|
43137
|
+
if (fdbkDst_1 && fdbkDst_1.startsWith('case')) {
|
|
43207
43138
|
initialized = true;
|
|
43208
43139
|
getFeedbackLoginUrl().then(function (loginUrl) {
|
|
43209
|
-
|
|
43140
|
+
var destinationUrl = loginUrl + '&fdbkDst=' + fdbkDst_1;
|
|
43210
43141
|
window.location.href = destinationUrl;
|
|
43211
43142
|
});
|
|
43212
43143
|
return;
|
|
@@ -43255,7 +43186,7 @@ function Feedback() {
|
|
|
43255
43186
|
function convertPendoToFeedbackOptions(options) {
|
|
43256
43187
|
var jwtOptions = pluginApi.agent.getJwtInfoCopy();
|
|
43257
43188
|
if (globalPendo._.isEmpty(jwtOptions)) {
|
|
43258
|
-
|
|
43189
|
+
var feedbackOptions = {};
|
|
43259
43190
|
feedbackOptions.user = globalPendo._.pick(options.visitor, 'id', 'full_name', 'firstName', 'lastName', 'email', 'tags', 'custom_allowed_products');
|
|
43260
43191
|
globalPendo._.extend(feedbackOptions.user, { allowed_products: [{ id: feedbackAllowedProductId }] });
|
|
43261
43192
|
feedbackOptions.account = globalPendo._.pick(options.account, 'id', 'name', 'monthly_value', 'is_paying', 'tags');
|
|
@@ -43362,13 +43293,15 @@ const testableAccessors$1 = {
|
|
|
43362
43293
|
Node: ["childNodes", "parentNode", "parentElement", "textContent"],
|
|
43363
43294
|
ShadowRoot: ["host", "styleSheets"],
|
|
43364
43295
|
Element: ["shadowRoot"],
|
|
43365
|
-
MutationObserver: []
|
|
43296
|
+
MutationObserver: [],
|
|
43297
|
+
EventTarget: []
|
|
43366
43298
|
};
|
|
43367
43299
|
const testableMethods$1 = {
|
|
43368
43300
|
Node: ["contains", "getRootNode"],
|
|
43369
43301
|
ShadowRoot: ["getSelection"],
|
|
43370
43302
|
Element: ["querySelector", "querySelectorAll"],
|
|
43371
|
-
MutationObserver: ["constructor"]
|
|
43303
|
+
MutationObserver: ["constructor"],
|
|
43304
|
+
EventTarget: ["addEventListener", "removeEventListener"]
|
|
43372
43305
|
};
|
|
43373
43306
|
const untaintedBasePrototype$1 = {};
|
|
43374
43307
|
function angularZoneUnpatchedAlternative$1(key) {
|
|
@@ -43443,11 +43376,26 @@ function getUntaintedAccessor$1(key, instance, accessor) {
|
|
|
43443
43376
|
}
|
|
43444
43377
|
const untaintedMethodCache$1 = {};
|
|
43445
43378
|
function getUntaintedMethod$1(key, instance, method) {
|
|
43379
|
+
var _a2, _b, _c;
|
|
43446
43380
|
const cacheKey = `${key}.${String(method)}`;
|
|
43447
43381
|
if (untaintedMethodCache$1[cacheKey])
|
|
43448
43382
|
return untaintedMethodCache$1[cacheKey].bind(
|
|
43449
43383
|
instance
|
|
43450
43384
|
);
|
|
43385
|
+
const zoneSymbol = (_b = (_a2 = globalThis == null ? void 0 : globalThis.Zone) == null ? void 0 : _a2.__symbol__) == null ? void 0 : _b.call(
|
|
43386
|
+
_a2,
|
|
43387
|
+
String(method)
|
|
43388
|
+
);
|
|
43389
|
+
if (zoneSymbol) {
|
|
43390
|
+
const classProto = (_c = globalThis[key]) == null ? void 0 : _c.prototype;
|
|
43391
|
+
const nativeFromZone = globalThis[zoneSymbol] ?? (classProto == null ? void 0 : classProto[zoneSymbol]);
|
|
43392
|
+
if (typeof nativeFromZone === "function") {
|
|
43393
|
+
untaintedMethodCache$1[cacheKey] = nativeFromZone;
|
|
43394
|
+
return nativeFromZone.bind(
|
|
43395
|
+
instance
|
|
43396
|
+
);
|
|
43397
|
+
}
|
|
43398
|
+
}
|
|
43451
43399
|
const untaintedPrototype = getUntaintedPrototype$1(key);
|
|
43452
43400
|
const untaintedMethod = untaintedPrototype[method];
|
|
43453
43401
|
if (typeof untaintedMethod !== "function") return instance[method];
|
|
@@ -43489,6 +43437,16 @@ function querySelector$1(n2, selectors) {
|
|
|
43489
43437
|
function querySelectorAll$1(n2, selectors) {
|
|
43490
43438
|
return getUntaintedMethod$1("Element", n2, "querySelectorAll")(selectors);
|
|
43491
43439
|
}
|
|
43440
|
+
function addEventListener$1(n2, type, listener, options) {
|
|
43441
|
+
getUntaintedMethod$1("EventTarget", n2, "addEventListener")(type, listener, options);
|
|
43442
|
+
}
|
|
43443
|
+
function removeEventListener$1(n2, type, listener, options) {
|
|
43444
|
+
getUntaintedMethod$1("EventTarget", n2, "removeEventListener")(
|
|
43445
|
+
type,
|
|
43446
|
+
listener,
|
|
43447
|
+
options
|
|
43448
|
+
);
|
|
43449
|
+
}
|
|
43492
43450
|
function mutationObserverCtor$1() {
|
|
43493
43451
|
return getUntaintedPrototype$1("MutationObserver").constructor;
|
|
43494
43452
|
}
|
|
@@ -43530,6 +43488,8 @@ const index$1 = {
|
|
|
43530
43488
|
shadowRoot: shadowRoot$1,
|
|
43531
43489
|
querySelector: querySelector$1,
|
|
43532
43490
|
querySelectorAll: querySelectorAll$1,
|
|
43491
|
+
addEventListener: addEventListener$1,
|
|
43492
|
+
removeEventListener: removeEventListener$1,
|
|
43533
43493
|
mutationObserver: mutationObserverCtor$1,
|
|
43534
43494
|
patch: patch$1
|
|
43535
43495
|
};
|
|
@@ -44959,13 +44919,15 @@ const testableAccessors = {
|
|
|
44959
44919
|
Node: ["childNodes", "parentNode", "parentElement", "textContent"],
|
|
44960
44920
|
ShadowRoot: ["host", "styleSheets"],
|
|
44961
44921
|
Element: ["shadowRoot"],
|
|
44962
|
-
MutationObserver: []
|
|
44922
|
+
MutationObserver: [],
|
|
44923
|
+
EventTarget: []
|
|
44963
44924
|
};
|
|
44964
44925
|
const testableMethods = {
|
|
44965
44926
|
Node: ["contains", "getRootNode"],
|
|
44966
44927
|
ShadowRoot: ["getSelection"],
|
|
44967
44928
|
Element: ["querySelector", "querySelectorAll"],
|
|
44968
|
-
MutationObserver: ["constructor"]
|
|
44929
|
+
MutationObserver: ["constructor"],
|
|
44930
|
+
EventTarget: ["addEventListener", "removeEventListener"]
|
|
44969
44931
|
};
|
|
44970
44932
|
const untaintedBasePrototype = {};
|
|
44971
44933
|
function angularZoneUnpatchedAlternative(key) {
|
|
@@ -45040,11 +45002,26 @@ function getUntaintedAccessor(key, instance, accessor) {
|
|
|
45040
45002
|
}
|
|
45041
45003
|
const untaintedMethodCache = {};
|
|
45042
45004
|
function getUntaintedMethod(key, instance, method) {
|
|
45005
|
+
var _a2, _b, _c;
|
|
45043
45006
|
const cacheKey = `${key}.${String(method)}`;
|
|
45044
45007
|
if (untaintedMethodCache[cacheKey])
|
|
45045
45008
|
return untaintedMethodCache[cacheKey].bind(
|
|
45046
45009
|
instance
|
|
45047
45010
|
);
|
|
45011
|
+
const zoneSymbol = (_b = (_a2 = globalThis == null ? void 0 : globalThis.Zone) == null ? void 0 : _a2.__symbol__) == null ? void 0 : _b.call(
|
|
45012
|
+
_a2,
|
|
45013
|
+
String(method)
|
|
45014
|
+
);
|
|
45015
|
+
if (zoneSymbol) {
|
|
45016
|
+
const classProto = (_c = globalThis[key]) == null ? void 0 : _c.prototype;
|
|
45017
|
+
const nativeFromZone = globalThis[zoneSymbol] ?? (classProto == null ? void 0 : classProto[zoneSymbol]);
|
|
45018
|
+
if (typeof nativeFromZone === "function") {
|
|
45019
|
+
untaintedMethodCache[cacheKey] = nativeFromZone;
|
|
45020
|
+
return nativeFromZone.bind(
|
|
45021
|
+
instance
|
|
45022
|
+
);
|
|
45023
|
+
}
|
|
45024
|
+
}
|
|
45048
45025
|
const untaintedPrototype = getUntaintedPrototype(key);
|
|
45049
45026
|
const untaintedMethod = untaintedPrototype[method];
|
|
45050
45027
|
if (typeof untaintedMethod !== "function") return instance[method];
|
|
@@ -45086,6 +45063,16 @@ function querySelector(n2, selectors) {
|
|
|
45086
45063
|
function querySelectorAll(n2, selectors) {
|
|
45087
45064
|
return getUntaintedMethod("Element", n2, "querySelectorAll")(selectors);
|
|
45088
45065
|
}
|
|
45066
|
+
function addEventListener(n2, type, listener, options) {
|
|
45067
|
+
getUntaintedMethod("EventTarget", n2, "addEventListener")(type, listener, options);
|
|
45068
|
+
}
|
|
45069
|
+
function removeEventListener(n2, type, listener, options) {
|
|
45070
|
+
getUntaintedMethod("EventTarget", n2, "removeEventListener")(
|
|
45071
|
+
type,
|
|
45072
|
+
listener,
|
|
45073
|
+
options
|
|
45074
|
+
);
|
|
45075
|
+
}
|
|
45089
45076
|
function mutationObserverCtor() {
|
|
45090
45077
|
return getUntaintedPrototype("MutationObserver").constructor;
|
|
45091
45078
|
}
|
|
@@ -45143,23 +45130,15 @@ const index = {
|
|
|
45143
45130
|
shadowRoot,
|
|
45144
45131
|
querySelector,
|
|
45145
45132
|
querySelectorAll,
|
|
45133
|
+
addEventListener,
|
|
45134
|
+
removeEventListener,
|
|
45146
45135
|
mutationObserver: mutationObserverCtor,
|
|
45147
45136
|
patch
|
|
45148
45137
|
};
|
|
45149
|
-
function getWindow(documentOrWindow) {
|
|
45150
|
-
const defaultView = documentOrWindow.defaultView;
|
|
45151
|
-
return defaultView ? defaultView : documentOrWindow;
|
|
45152
|
-
}
|
|
45153
45138
|
function on(type, fn, target = document) {
|
|
45154
|
-
const windowObj = getWindow(target);
|
|
45155
|
-
const nativeAddEventListener = getNative$1(
|
|
45156
|
-
"addEventListener",
|
|
45157
|
-
windowObj
|
|
45158
|
-
);
|
|
45159
|
-
const nativeRemoveEventListener = getNative$1("removeEventListener", windowObj);
|
|
45160
45139
|
const options = { capture: true, passive: true };
|
|
45161
|
-
|
|
45162
|
-
return () =>
|
|
45140
|
+
index.addEventListener(target, type, fn, options);
|
|
45141
|
+
return () => index.removeEventListener(target, type, fn, options);
|
|
45163
45142
|
}
|
|
45164
45143
|
const DEPARTED_MIRROR_ACCESS_WARNING = "Please stop import mirror directly. Instead of that,\r\nnow you can use replayer.getMirror() to access the mirror instance of a replayer,\r\nor you can use record.mirror to access the mirror instance during recording.";
|
|
45165
45144
|
let _mirror = {
|
|
@@ -46582,10 +46561,7 @@ function initStyleSheetObserver({ styleSheetRuleCb, mirror: mirror2, stylesheetM
|
|
|
46582
46561
|
adds: [{ rule, index: index2 }]
|
|
46583
46562
|
});
|
|
46584
46563
|
}
|
|
46585
|
-
|
|
46586
|
-
return target.apply(thisArg, argumentsList);
|
|
46587
|
-
} catch (e2) {
|
|
46588
|
-
}
|
|
46564
|
+
return target.apply(thisArg, argumentsList);
|
|
46589
46565
|
}
|
|
46590
46566
|
)
|
|
46591
46567
|
});
|
|
@@ -46610,10 +46586,7 @@ function initStyleSheetObserver({ styleSheetRuleCb, mirror: mirror2, stylesheetM
|
|
|
46610
46586
|
removes: [{ index: index2 }]
|
|
46611
46587
|
});
|
|
46612
46588
|
}
|
|
46613
|
-
|
|
46614
|
-
return target.apply(thisArg, argumentsList);
|
|
46615
|
-
} catch (e2) {
|
|
46616
|
-
}
|
|
46589
|
+
return target.apply(thisArg, argumentsList);
|
|
46617
46590
|
}
|
|
46618
46591
|
)
|
|
46619
46592
|
});
|
|
@@ -46717,10 +46690,7 @@ function initStyleSheetObserver({ styleSheetRuleCb, mirror: mirror2, stylesheetM
|
|
|
46717
46690
|
]
|
|
46718
46691
|
});
|
|
46719
46692
|
}
|
|
46720
|
-
|
|
46721
|
-
return target.apply(thisArg, argumentsList);
|
|
46722
|
-
} catch (e2) {
|
|
46723
|
-
}
|
|
46693
|
+
return target.apply(thisArg, argumentsList);
|
|
46724
46694
|
}
|
|
46725
46695
|
)
|
|
46726
46696
|
}
|
|
@@ -46745,10 +46715,7 @@ function initStyleSheetObserver({ styleSheetRuleCb, mirror: mirror2, stylesheetM
|
|
|
46745
46715
|
]
|
|
46746
46716
|
});
|
|
46747
46717
|
}
|
|
46748
|
-
|
|
46749
|
-
return target.apply(thisArg, argumentsList);
|
|
46750
|
-
} catch (e2) {
|
|
46751
|
-
}
|
|
46718
|
+
return target.apply(thisArg, argumentsList);
|
|
46752
46719
|
}
|
|
46753
46720
|
)
|
|
46754
46721
|
}
|
|
@@ -48754,31 +48721,32 @@ var n;
|
|
|
48754
48721
|
}(n || (n = {}));
|
|
48755
48722
|
return record; }
|
|
48756
48723
|
|
|
48757
|
-
|
|
48758
|
-
|
|
48724
|
+
var SessionRecorderBuffer = /** @class */ (function () {
|
|
48725
|
+
function SessionRecorderBuffer(interval, maxCount) {
|
|
48726
|
+
if (maxCount === void 0) { maxCount = Infinity; }
|
|
48759
48727
|
this.data = [];
|
|
48760
48728
|
this.sequenceNumber = 0;
|
|
48761
48729
|
this.interval = interval;
|
|
48762
48730
|
this.maxCount = maxCount;
|
|
48763
48731
|
this.doubledMaxCount = maxCount * 2;
|
|
48764
48732
|
}
|
|
48765
|
-
isEmpty() {
|
|
48733
|
+
SessionRecorderBuffer.prototype.isEmpty = function () {
|
|
48766
48734
|
return this.data.length === 0;
|
|
48767
|
-
}
|
|
48768
|
-
count() {
|
|
48735
|
+
};
|
|
48736
|
+
SessionRecorderBuffer.prototype.count = function () {
|
|
48769
48737
|
return this.data.length;
|
|
48770
|
-
}
|
|
48771
|
-
clear() {
|
|
48738
|
+
};
|
|
48739
|
+
SessionRecorderBuffer.prototype.clear = function () {
|
|
48772
48740
|
this.data.length = 0;
|
|
48773
|
-
}
|
|
48774
|
-
clearSequence() {
|
|
48741
|
+
};
|
|
48742
|
+
SessionRecorderBuffer.prototype.clearSequence = function () {
|
|
48775
48743
|
this.sequenceNumber = 0;
|
|
48776
|
-
}
|
|
48777
|
-
push(event) {
|
|
48744
|
+
};
|
|
48745
|
+
SessionRecorderBuffer.prototype.push = function (event) {
|
|
48778
48746
|
this.data.push(event);
|
|
48779
48747
|
this.checkRateLimit();
|
|
48780
|
-
}
|
|
48781
|
-
pack(envelope, _) {
|
|
48748
|
+
};
|
|
48749
|
+
SessionRecorderBuffer.prototype.pack = function (envelope, _) {
|
|
48782
48750
|
var eventsToSend = this.data.splice(0, this.maxCount);
|
|
48783
48751
|
envelope.recordingPayload = eventsToSend;
|
|
48784
48752
|
envelope.sequence = this.sequenceNumber;
|
|
@@ -48786,8 +48754,8 @@ class SessionRecorderBuffer {
|
|
|
48786
48754
|
if (eventsToSend.length) {
|
|
48787
48755
|
envelope.browserTime = eventsToSend[0].timestamp;
|
|
48788
48756
|
}
|
|
48789
|
-
envelope.recordingPayloadMetadata = _.map(eventsToSend, event
|
|
48790
|
-
|
|
48757
|
+
envelope.recordingPayloadMetadata = _.map(eventsToSend, function (event) {
|
|
48758
|
+
var metadata = _.pick(event, 'type', 'timestamp');
|
|
48791
48759
|
if (event.data) {
|
|
48792
48760
|
metadata.data = _.pick(event.data, 'source', 'type', 'x', 'y', 'id', 'height', 'width', 'href');
|
|
48793
48761
|
}
|
|
@@ -48795,18 +48763,30 @@ class SessionRecorderBuffer {
|
|
|
48795
48763
|
});
|
|
48796
48764
|
this.sequenceNumber += eventsToSend.length;
|
|
48797
48765
|
return envelope;
|
|
48798
|
-
}
|
|
48799
|
-
checkRateLimit() {
|
|
48800
|
-
|
|
48766
|
+
};
|
|
48767
|
+
SessionRecorderBuffer.prototype.checkRateLimit = function () {
|
|
48768
|
+
var length = this.data.length;
|
|
48801
48769
|
if (length >= this.doubledMaxCount && length % this.maxCount === 0) {
|
|
48802
|
-
|
|
48770
|
+
var elapsed = this.data[length - 1].timestamp - this.data[length - this.doubledMaxCount].timestamp;
|
|
48803
48771
|
if (elapsed <= this.interval && this.onRateLimit) {
|
|
48804
48772
|
this.onRateLimit();
|
|
48805
48773
|
}
|
|
48806
48774
|
}
|
|
48807
|
-
}
|
|
48808
|
-
|
|
48775
|
+
};
|
|
48776
|
+
return SessionRecorderBuffer;
|
|
48777
|
+
}());
|
|
48809
48778
|
|
|
48779
|
+
var __assign = function() {
|
|
48780
|
+
__assign = Object.assign || function __assign(t) {
|
|
48781
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
48782
|
+
s = arguments[i];
|
|
48783
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
48784
|
+
}
|
|
48785
|
+
return t;
|
|
48786
|
+
};
|
|
48787
|
+
return __assign.apply(this, arguments);
|
|
48788
|
+
};
|
|
48789
|
+
|
|
48810
48790
|
function __rest(s, e) {
|
|
48811
48791
|
var t = {};
|
|
48812
48792
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
@@ -48829,24 +48809,52 @@ function __awaiter(thisArg, _arguments, P, generator) {
|
|
|
48829
48809
|
});
|
|
48830
48810
|
}
|
|
48831
48811
|
|
|
48812
|
+
function __generator(thisArg, body) {
|
|
48813
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
48814
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
48815
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
48816
|
+
function step(op) {
|
|
48817
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
48818
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
48819
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
48820
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
48821
|
+
switch (op[0]) {
|
|
48822
|
+
case 0: case 1: t = op; break;
|
|
48823
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
48824
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
48825
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
48826
|
+
default:
|
|
48827
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
48828
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
48829
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
48830
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
48831
|
+
if (t[2]) _.ops.pop();
|
|
48832
|
+
_.trys.pop(); continue;
|
|
48833
|
+
}
|
|
48834
|
+
op = body.call(thisArg, _);
|
|
48835
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
48836
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
48837
|
+
}
|
|
48838
|
+
}
|
|
48839
|
+
|
|
48832
48840
|
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
48833
48841
|
var e = new Error(message);
|
|
48834
48842
|
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
48835
48843
|
};
|
|
48836
48844
|
|
|
48837
|
-
|
|
48838
|
-
|
|
48839
|
-
|
|
48840
|
-
|
|
48841
|
-
|
|
48845
|
+
var RECORDING_CONFIG_WORKERURL$1 = 'recording.workerUrl';
|
|
48846
|
+
var MAX_SIZE = 2000000;
|
|
48847
|
+
var RESOURCE_CACHING$1 = 'resourceCaching';
|
|
48848
|
+
var Transport = /** @class */ (function () {
|
|
48849
|
+
function Transport(WorkerClass, pendo, api) {
|
|
48842
48850
|
this.WorkerClass = WorkerClass;
|
|
48843
48851
|
this.pendo = pendo;
|
|
48844
48852
|
this.api = api;
|
|
48845
48853
|
this.maxSize = MAX_SIZE;
|
|
48846
|
-
this.lockID =
|
|
48854
|
+
this.lockID = "worker-lock-".concat(this.pendo.randomString(16));
|
|
48847
48855
|
this.isResourceCachingEnabled = this.api.ConfigReader.get(RESOURCE_CACHING$1);
|
|
48848
48856
|
}
|
|
48849
|
-
start(config) {
|
|
48857
|
+
Transport.prototype.start = function (config) {
|
|
48850
48858
|
if (config.disableWorker)
|
|
48851
48859
|
return;
|
|
48852
48860
|
if (!this.worker) {
|
|
@@ -48856,7 +48864,7 @@ class Transport {
|
|
|
48856
48864
|
this.worker = config.workerOverride;
|
|
48857
48865
|
}
|
|
48858
48866
|
else {
|
|
48859
|
-
|
|
48867
|
+
var workerUrl = this.api.ConfigReader.get(RECORDING_CONFIG_WORKERURL$1);
|
|
48860
48868
|
this.usesSelfHostedWorker = workerUrl != null;
|
|
48861
48869
|
this.worker = workerUrl ? new Worker(workerUrl) : new this.WorkerClass();
|
|
48862
48870
|
}
|
|
@@ -48870,34 +48878,35 @@ class Transport {
|
|
|
48870
48878
|
this.worker = null;
|
|
48871
48879
|
}
|
|
48872
48880
|
}
|
|
48873
|
-
}
|
|
48874
|
-
stop() {
|
|
48881
|
+
};
|
|
48882
|
+
Transport.prototype.stop = function () {
|
|
48875
48883
|
if (this.worker) {
|
|
48876
48884
|
this.worker.terminate();
|
|
48877
48885
|
delete this.worker;
|
|
48878
48886
|
}
|
|
48879
|
-
}
|
|
48880
|
-
send(envelope, isUnload, failureCount
|
|
48881
|
-
|
|
48882
|
-
|
|
48887
|
+
};
|
|
48888
|
+
Transport.prototype.send = function (envelope, isUnload, failureCount) {
|
|
48889
|
+
if (failureCount === void 0) { failureCount = 0; }
|
|
48890
|
+
var url = envelope.url;
|
|
48891
|
+
var payload = envelope.payload;
|
|
48883
48892
|
if (failureCount > 0) {
|
|
48884
|
-
url =
|
|
48893
|
+
url = "".concat(url, "&rt=").concat(failureCount);
|
|
48885
48894
|
}
|
|
48886
48895
|
if (this.worker && !isUnload && payload) {
|
|
48887
|
-
|
|
48888
|
-
|
|
48889
|
-
|
|
48890
|
-
|
|
48896
|
+
var deferred_1 = {};
|
|
48897
|
+
deferred_1.promise = new Promise$2(function (resolve, reject) {
|
|
48898
|
+
deferred_1.resolve = resolve;
|
|
48899
|
+
deferred_1.reject = reject;
|
|
48891
48900
|
});
|
|
48892
|
-
this.workerResponse =
|
|
48893
|
-
this.worker.postMessage({ url, payload, shouldCacheResources: this.isResourceCachingEnabled });
|
|
48894
|
-
return
|
|
48901
|
+
this.workerResponse = deferred_1;
|
|
48902
|
+
this.worker.postMessage({ url: url, payload: payload, shouldCacheResources: this.isResourceCachingEnabled });
|
|
48903
|
+
return deferred_1.promise;
|
|
48895
48904
|
}
|
|
48896
48905
|
else {
|
|
48897
48906
|
if (!envelope.body) {
|
|
48898
|
-
|
|
48907
|
+
var strPayload = JSON.stringify(payload);
|
|
48899
48908
|
if (strPayload.length > this.maxSize) {
|
|
48900
|
-
|
|
48909
|
+
var error = new Error('maximum recording payload size exceeded');
|
|
48901
48910
|
error.reason = 'HEAVY_EVENT';
|
|
48902
48911
|
error.context = {
|
|
48903
48912
|
size: strPayload.length,
|
|
@@ -48908,14 +48917,14 @@ class Transport {
|
|
|
48908
48917
|
envelope.body = this.pendo.compress(strPayload, 'binary');
|
|
48909
48918
|
delete envelope.payload;
|
|
48910
48919
|
}
|
|
48911
|
-
url =
|
|
48920
|
+
url = "".concat(url, "&ct=").concat(new Date().getTime());
|
|
48912
48921
|
return this.post(url, {
|
|
48913
48922
|
keepalive: isUnload,
|
|
48914
48923
|
body: envelope.body
|
|
48915
48924
|
});
|
|
48916
48925
|
}
|
|
48917
|
-
}
|
|
48918
|
-
post(url, options) {
|
|
48926
|
+
};
|
|
48927
|
+
Transport.prototype.post = function (url, options) {
|
|
48919
48928
|
options.method = 'POST';
|
|
48920
48929
|
if (options.keepalive && this.api.transmit.fetchKeepalive.supported()) {
|
|
48921
48930
|
return this.api.transmit.fetchKeepalive(url, options);
|
|
@@ -48927,46 +48936,57 @@ class Transport {
|
|
|
48927
48936
|
else {
|
|
48928
48937
|
return this.pendo.ajax.post(url, options.body);
|
|
48929
48938
|
}
|
|
48930
|
-
}
|
|
48931
|
-
_onMessage(messageEvent) {
|
|
48932
|
-
return __awaiter(this, void 0, void 0, function
|
|
48933
|
-
|
|
48934
|
-
|
|
48935
|
-
|
|
48936
|
-
|
|
48937
|
-
|
|
48938
|
-
|
|
48939
|
-
|
|
48940
|
-
|
|
48941
|
-
|
|
48942
|
-
|
|
48943
|
-
|
|
48944
|
-
|
|
48945
|
-
|
|
48946
|
-
|
|
48947
|
-
|
|
48948
|
-
|
|
48949
|
-
|
|
48950
|
-
|
|
48951
|
-
|
|
48939
|
+
};
|
|
48940
|
+
Transport.prototype._onMessage = function (messageEvent) {
|
|
48941
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
48942
|
+
return __generator(this, function (_a) {
|
|
48943
|
+
switch (_a.label) {
|
|
48944
|
+
case 0:
|
|
48945
|
+
if (!(messageEvent.data && messageEvent.data.ready)) return [3 /*break*/, 2];
|
|
48946
|
+
// When the lock is released, we can assume the worker was terminated or closed
|
|
48947
|
+
return [4 /*yield*/, navigator.locks.request(this.lockID, function () { })];
|
|
48948
|
+
case 1:
|
|
48949
|
+
// When the lock is released, we can assume the worker was terminated or closed
|
|
48950
|
+
_a.sent();
|
|
48951
|
+
this.onWorkerMessage({ type: 'workerDied' });
|
|
48952
|
+
_a.label = 2;
|
|
48953
|
+
case 2:
|
|
48954
|
+
// handle non-POST request responses from worker
|
|
48955
|
+
if (messageEvent.data && messageEvent.data.type) {
|
|
48956
|
+
this.onWorkerMessage(messageEvent.data);
|
|
48957
|
+
return [2 /*return*/];
|
|
48958
|
+
}
|
|
48959
|
+
// handle POST request response from worker
|
|
48960
|
+
if (messageEvent.data && messageEvent.data.error) {
|
|
48961
|
+
if ((messageEvent.data.status && messageEvent.data.status < 500) ||
|
|
48962
|
+
messageEvent.data.sequence == null) {
|
|
48963
|
+
this.api.log.critical('Failed to send recording data from web worker', { error: messageEvent.data.error });
|
|
48964
|
+
}
|
|
48965
|
+
if (this.workerResponse) {
|
|
48966
|
+
this.workerResponse.reject();
|
|
48967
|
+
this.workerResponse = null;
|
|
48968
|
+
}
|
|
48969
|
+
}
|
|
48970
|
+
if (this.workerResponse) {
|
|
48971
|
+
this.workerResponse.resolve();
|
|
48972
|
+
this.workerResponse = null;
|
|
48973
|
+
}
|
|
48974
|
+
return [2 /*return*/];
|
|
48952
48975
|
}
|
|
48953
|
-
}
|
|
48954
|
-
if (this.workerResponse) {
|
|
48955
|
-
this.workerResponse.resolve();
|
|
48956
|
-
this.workerResponse = null;
|
|
48957
|
-
}
|
|
48976
|
+
});
|
|
48958
48977
|
});
|
|
48959
|
-
}
|
|
48960
|
-
_onError() {
|
|
48978
|
+
};
|
|
48979
|
+
Transport.prototype._onError = function () {
|
|
48961
48980
|
if (this.onError) {
|
|
48962
48981
|
this.onError();
|
|
48963
48982
|
}
|
|
48964
|
-
}
|
|
48965
|
-
|
|
48983
|
+
};
|
|
48984
|
+
return Transport;
|
|
48985
|
+
}());
|
|
48966
48986
|
|
|
48967
|
-
|
|
48968
|
-
|
|
48969
|
-
|
|
48987
|
+
var ELEMENT_NODE = 1;
|
|
48988
|
+
var INPUT_MASK = '*'.repeat(10);
|
|
48989
|
+
var NUMBER_INPUT_MASK = '0'.repeat(10);
|
|
48970
48990
|
function isElementNode(node) {
|
|
48971
48991
|
if (!node)
|
|
48972
48992
|
return false;
|
|
@@ -48975,10 +48995,12 @@ function isElementNode(node) {
|
|
|
48975
48995
|
return true;
|
|
48976
48996
|
}
|
|
48977
48997
|
function getParent(elem) {
|
|
48978
|
-
|
|
48998
|
+
var isElementShadowRoot = typeof window.ShadowRoot !== 'undefined' && elem instanceof window.ShadowRoot && elem.host;
|
|
48979
48999
|
return isElementShadowRoot ? elem.host : elem.parentNode;
|
|
48980
49000
|
}
|
|
48981
|
-
function distanceToMatch(node, selector, limit
|
|
49001
|
+
function distanceToMatch(node, selector, limit, distance) {
|
|
49002
|
+
if (limit === void 0) { limit = Infinity; }
|
|
49003
|
+
if (distance === void 0) { distance = 0; }
|
|
48982
49004
|
if (distance > limit)
|
|
48983
49005
|
return -1;
|
|
48984
49006
|
if (!node)
|
|
@@ -48992,13 +49014,13 @@ function distanceToMatch(node, selector, limit = Infinity, distance = 0) {
|
|
|
48992
49014
|
return distanceToMatch(getParent(node), selector, limit, distance + 1);
|
|
48993
49015
|
}
|
|
48994
49016
|
function shouldMask(node, options) {
|
|
48995
|
-
|
|
49017
|
+
var maskAllText = options.maskAllText, maskTextSelector = options.maskTextSelector, unmaskTextSelector = options.unmaskTextSelector;
|
|
48996
49018
|
try {
|
|
48997
|
-
|
|
49019
|
+
var el = isElementNode(node) ? node : node.parentElement;
|
|
48998
49020
|
if (el === null)
|
|
48999
49021
|
return false;
|
|
49000
|
-
|
|
49001
|
-
|
|
49022
|
+
var maskDistance = -1;
|
|
49023
|
+
var unmaskDistance = -1;
|
|
49002
49024
|
if (maskAllText) {
|
|
49003
49025
|
unmaskDistance = distanceToMatch(el, unmaskTextSelector);
|
|
49004
49026
|
if (unmaskDistance < 0) {
|
|
@@ -49031,8 +49053,8 @@ function isNumberInput(element) {
|
|
|
49031
49053
|
}
|
|
49032
49054
|
function shouldMaskInput(element, maskInputOptions) {
|
|
49033
49055
|
if (maskInputOptions && isElementNode(element)) {
|
|
49034
|
-
|
|
49035
|
-
|
|
49056
|
+
var tagName = (element.tagName || '').toLowerCase();
|
|
49057
|
+
var type = (element.type || '').toLowerCase();
|
|
49036
49058
|
if (maskInputOptions[tagName] || maskInputOptions[type]) {
|
|
49037
49059
|
return true;
|
|
49038
49060
|
}
|
|
@@ -50519,12 +50541,12 @@ var WorkerFactory = /*#__PURE__*/createInlineWorkerFactory(/* rollup-plugin-web-
|
|
|
50519
50541
|
}
|
|
50520
50542
|
}
|
|
50521
50543
|
|
|
50522
|
-
|
|
50544
|
+
var ONE_HUNDRED_MB_IN_BYTES = 100 * 1024 * 1024;
|
|
50523
50545
|
function matchHostedResources(recordingEvent, stringifiedRecordingPayload) {
|
|
50524
|
-
|
|
50525
|
-
|
|
50546
|
+
var fontURLRegex = /https:\/\/[^"\\\s]+?\.(woff2?|ttf|otf|eot)(\?[^"\\\s]*)?\b/g;
|
|
50547
|
+
var matches = stringifiedRecordingPayload.match(fontURLRegex);
|
|
50526
50548
|
// de-duplicate matches
|
|
50527
|
-
|
|
50549
|
+
var hostedResources = matches ? Array.from(new Set(matches)) : [];
|
|
50528
50550
|
return {
|
|
50529
50551
|
type: 'recording',
|
|
50530
50552
|
visitorId: recordingEvent.visitorId,
|
|
@@ -50539,75 +50561,75 @@ var WorkerFactory = /*#__PURE__*/createInlineWorkerFactory(/* rollup-plugin-web-
|
|
|
50539
50561
|
recordingPayloadMetadata: [],
|
|
50540
50562
|
sequence: 0,
|
|
50541
50563
|
recordingPayloadCount: 0,
|
|
50542
|
-
hostedResources
|
|
50564
|
+
hostedResources: hostedResources
|
|
50543
50565
|
};
|
|
50544
50566
|
}
|
|
50545
50567
|
// keep in mind changes here may need addressing in the extension worker proxy as well
|
|
50546
50568
|
self.onmessage = function (e) {
|
|
50547
50569
|
try {
|
|
50548
50570
|
if (e.data.type === 'init' && e.data.lockID) {
|
|
50549
|
-
navigator.locks.request(e.data.lockID, ()
|
|
50571
|
+
navigator.locks.request(e.data.lockID, function () {
|
|
50550
50572
|
postMessage({ ready: true });
|
|
50551
50573
|
// This unresolved promise keeps the lock held with the worker until the worker is
|
|
50552
50574
|
// terminated at which point the lock is released.
|
|
50553
|
-
return new Promise$2(()
|
|
50575
|
+
return new Promise$2(function () { });
|
|
50554
50576
|
});
|
|
50555
50577
|
return;
|
|
50556
50578
|
}
|
|
50557
50579
|
if (e.data.url && e.data.payload) {
|
|
50558
|
-
|
|
50580
|
+
var _a = e.data, url = _a.url, payload = _a.payload, shouldCacheResources = _a.shouldCacheResources;
|
|
50559
50581
|
if (Object.keys(payload).length === 0) {
|
|
50560
50582
|
postMessage({
|
|
50561
50583
|
type: 'emptyPayload'
|
|
50562
50584
|
});
|
|
50563
50585
|
}
|
|
50564
|
-
|
|
50565
|
-
|
|
50586
|
+
var sequence_1 = payload.sequence;
|
|
50587
|
+
var stringifiedRecordingPayload = JSON.stringify(payload.recordingPayload);
|
|
50566
50588
|
// calculate and post back the recording payload size before the payload is compressed
|
|
50567
|
-
|
|
50568
|
-
|
|
50589
|
+
var recordingPayloadSize = new TextEncoder().encode(stringifiedRecordingPayload).length;
|
|
50590
|
+
var exceedsPayloadSizeLimit = recordingPayloadSize >= ONE_HUNDRED_MB_IN_BYTES;
|
|
50569
50591
|
postMessage({
|
|
50570
50592
|
type: 'recordingPayloadSize',
|
|
50571
|
-
recordingPayloadSize,
|
|
50572
|
-
exceedsPayloadSizeLimit
|
|
50593
|
+
recordingPayloadSize: recordingPayloadSize,
|
|
50594
|
+
exceedsPayloadSizeLimit: exceedsPayloadSizeLimit
|
|
50573
50595
|
});
|
|
50574
50596
|
// don't attempt to send the payload if it exceeds the allowed limit
|
|
50575
50597
|
if (exceedsPayloadSizeLimit)
|
|
50576
50598
|
return;
|
|
50577
50599
|
if (shouldCacheResources) {
|
|
50578
|
-
|
|
50600
|
+
var hostedResourcesEvent = matchHostedResources(payload, stringifiedRecordingPayload);
|
|
50579
50601
|
if (hostedResourcesEvent.hostedResources.length) {
|
|
50580
50602
|
postMessage({
|
|
50581
50603
|
type: 'hostedResources',
|
|
50582
|
-
hostedResourcesEvent
|
|
50604
|
+
hostedResourcesEvent: hostedResourcesEvent
|
|
50583
50605
|
});
|
|
50584
50606
|
}
|
|
50585
50607
|
}
|
|
50586
50608
|
payload.recordingSize = recordingPayloadSize;
|
|
50587
|
-
|
|
50609
|
+
var body = compress(payload, 'binary');
|
|
50588
50610
|
// we want to calculate ct (current time) as close as we can to the actual POST request
|
|
50589
50611
|
// so that it's as accurate as possible
|
|
50590
|
-
url =
|
|
50612
|
+
url = "".concat(url, "&ct=").concat(new Date().getTime());
|
|
50591
50613
|
fetch(url, {
|
|
50592
50614
|
method: 'POST',
|
|
50593
|
-
body
|
|
50615
|
+
body: body
|
|
50594
50616
|
}).then(function (response) {
|
|
50595
50617
|
if (response.status < 200 || response.status >= 300) {
|
|
50596
50618
|
postMessage({
|
|
50597
|
-
error: new Error(
|
|
50619
|
+
error: new Error("received status code ".concat(response.status, ": ").concat(response.statusText)),
|
|
50598
50620
|
status: response.status,
|
|
50599
|
-
sequence
|
|
50621
|
+
sequence: sequence_1
|
|
50600
50622
|
});
|
|
50601
50623
|
}
|
|
50602
50624
|
else {
|
|
50603
50625
|
postMessage({
|
|
50604
|
-
sequence
|
|
50626
|
+
sequence: sequence_1
|
|
50605
50627
|
});
|
|
50606
50628
|
}
|
|
50607
|
-
})
|
|
50629
|
+
})["catch"](function (e) {
|
|
50608
50630
|
postMessage({
|
|
50609
50631
|
error: e,
|
|
50610
|
-
sequence
|
|
50632
|
+
sequence: sequence_1
|
|
50611
50633
|
});
|
|
50612
50634
|
});
|
|
50613
50635
|
}
|
|
@@ -50642,12 +50664,12 @@ function createReplayPlugin() {
|
|
|
50642
50664
|
* limit of number of keys in an object
|
|
50643
50665
|
* if an object contains more keys than this limit, we would call its toString function directly
|
|
50644
50666
|
*/
|
|
50645
|
-
|
|
50667
|
+
var NUM_OF_KEYS_LIMIT = 50;
|
|
50646
50668
|
/**
|
|
50647
50669
|
* limit number of depth in an object
|
|
50648
50670
|
* if an object is too deep, toString process may cause browser OOM
|
|
50649
50671
|
*/
|
|
50650
|
-
|
|
50672
|
+
var DEPTH_OF_LIMIT = 4;
|
|
50651
50673
|
/**
|
|
50652
50674
|
* serialize an HTML element by creating a shallow clone of it with text content
|
|
50653
50675
|
* and return the resulting outerHTML string (without the subtree)
|
|
@@ -50658,8 +50680,8 @@ function serializeHTML(node) {
|
|
|
50658
50680
|
if (!node || node.nodeType !== node.ELEMENT_NODE) {
|
|
50659
50681
|
return '';
|
|
50660
50682
|
}
|
|
50661
|
-
|
|
50662
|
-
|
|
50683
|
+
var nodeClone = node.cloneNode(false);
|
|
50684
|
+
var textContent = node.textContent;
|
|
50663
50685
|
if (textContent) {
|
|
50664
50686
|
nodeClone.textContent = textContent;
|
|
50665
50687
|
}
|
|
@@ -50673,7 +50695,7 @@ function isObject(obj) {
|
|
|
50673
50695
|
return false;
|
|
50674
50696
|
if (typeof obj !== 'object')
|
|
50675
50697
|
return false;
|
|
50676
|
-
|
|
50698
|
+
var proto = Object.getPrototypeOf(obj);
|
|
50677
50699
|
return proto === Object.prototype || proto === null;
|
|
50678
50700
|
}
|
|
50679
50701
|
/**
|
|
@@ -50682,11 +50704,11 @@ function isObject(obj) {
|
|
|
50682
50704
|
function isObjTooDeep(obj, limit) {
|
|
50683
50705
|
if (limit === 0)
|
|
50684
50706
|
return true;
|
|
50685
|
-
|
|
50707
|
+
var keys = Object.keys(obj);
|
|
50686
50708
|
if (keys.length === 0)
|
|
50687
50709
|
return false;
|
|
50688
|
-
return keys.some(key
|
|
50689
|
-
|
|
50710
|
+
return keys.some(function (key) {
|
|
50711
|
+
var value = obj[key];
|
|
50690
50712
|
return isObject(value) && isObjTooDeep(value, limit - 1);
|
|
50691
50713
|
});
|
|
50692
50714
|
}
|
|
@@ -50702,7 +50724,7 @@ function shouldIgnore(_obj) {
|
|
|
50702
50724
|
return false;
|
|
50703
50725
|
}
|
|
50704
50726
|
// out of keys limit
|
|
50705
|
-
|
|
50727
|
+
var keys = Object.keys(_obj);
|
|
50706
50728
|
if (keys.length > NUM_OF_KEYS_LIMIT) {
|
|
50707
50729
|
return true;
|
|
50708
50730
|
}
|
|
@@ -50734,7 +50756,7 @@ function stringify(arg) {
|
|
|
50734
50756
|
return value.toString ? value.toString() : '[object Object]';
|
|
50735
50757
|
}
|
|
50736
50758
|
if (value instanceof ArrayBuffer)
|
|
50737
|
-
return
|
|
50759
|
+
return "ArrayBuffer { byteLength: ".concat(value.byteLength, " }");
|
|
50738
50760
|
if (value instanceof Error)
|
|
50739
50761
|
return value.name + ': ' + value.message;
|
|
50740
50762
|
if (value instanceof Node) {
|
|
@@ -50742,10 +50764,10 @@ function stringify(arg) {
|
|
|
50742
50764
|
}
|
|
50743
50765
|
// Handle events
|
|
50744
50766
|
if (value instanceof Event) {
|
|
50745
|
-
|
|
50767
|
+
var eventResult = {};
|
|
50746
50768
|
// eslint-disable-next-line guard-for-in
|
|
50747
|
-
for (
|
|
50748
|
-
|
|
50769
|
+
for (var eventKey in value) {
|
|
50770
|
+
var eventValue = value[eventKey];
|
|
50749
50771
|
eventResult[eventKey] = Array.isArray(eventValue) && eventValue[0] instanceof HTMLElement
|
|
50750
50772
|
? serializeHTML(eventValue[0])
|
|
50751
50773
|
: eventValue;
|
|
@@ -50756,30 +50778,31 @@ function stringify(arg) {
|
|
|
50756
50778
|
});
|
|
50757
50779
|
}
|
|
50758
50780
|
|
|
50759
|
-
|
|
50760
|
-
|
|
50781
|
+
var StackFrame = /** @class */ (function () {
|
|
50782
|
+
function StackFrame(obj) {
|
|
50761
50783
|
this.fileName = obj.fileName || '';
|
|
50762
50784
|
this.functionName = obj.functionName || '';
|
|
50763
50785
|
this.lineNumber = obj.lineNumber;
|
|
50764
50786
|
this.columnNumber = obj.columnNumber;
|
|
50765
50787
|
}
|
|
50766
|
-
toString() {
|
|
50767
|
-
|
|
50788
|
+
StackFrame.prototype.toString = function () {
|
|
50789
|
+
var _a = this, fileName = _a.fileName, functionName = _a.functionName, _b = _a.lineNumber, lineNumber = _b === void 0 ? '' : _b, _c = _a.columnNumber, columnNumber = _c === void 0 ? '' : _c;
|
|
50768
50790
|
return functionName
|
|
50769
|
-
?
|
|
50770
|
-
:
|
|
50771
|
-
}
|
|
50772
|
-
|
|
50773
|
-
|
|
50774
|
-
|
|
50775
|
-
|
|
50776
|
-
|
|
50777
|
-
|
|
50778
|
-
|
|
50791
|
+
? "".concat(functionName, " (").concat(fileName, ":").concat(lineNumber, ":").concat(columnNumber, ")")
|
|
50792
|
+
: "".concat(fileName, ":").concat(lineNumber, ":").concat(columnNumber);
|
|
50793
|
+
};
|
|
50794
|
+
return StackFrame;
|
|
50795
|
+
}());
|
|
50796
|
+
var FIREFOX_SAFARI_STACK_REGEXP = /(^|@)\S+:\d+/;
|
|
50797
|
+
var CHROME_EDGE_STACK_REGEXP = /^\s*at .*(\S+:\d+|\(native\))/m;
|
|
50798
|
+
var SAFARI_NATIVE_CODE_REGEXP = /^(eval@)?(\[native code])?$/;
|
|
50799
|
+
var LOCATION_REGEXP = /(.+?)(?::(\d+))?(?::(\d+))?$/;
|
|
50800
|
+
var DEFAULT_NUM_FRAMES_TO_SKIP = 5;
|
|
50801
|
+
var ErrorStackParser = {
|
|
50779
50802
|
/**
|
|
50780
50803
|
* Given an Error object, extract the most information from it.
|
|
50781
50804
|
*/
|
|
50782
|
-
parse(error, maxFramesToSave) {
|
|
50805
|
+
parse: function (error, maxFramesToSave) {
|
|
50783
50806
|
if (!(error === null || error === void 0 ? void 0 : error.stack))
|
|
50784
50807
|
return [];
|
|
50785
50808
|
// Chrome, Edge, Opera ≥15
|
|
@@ -50793,24 +50816,25 @@ const ErrorStackParser = {
|
|
|
50793
50816
|
return [];
|
|
50794
50817
|
},
|
|
50795
50818
|
// Separate line and column numbers from a string of the form: (URI:Line:Column)
|
|
50796
|
-
extractLocation(urlLike) {
|
|
50819
|
+
extractLocation: function (urlLike) {
|
|
50797
50820
|
// Fail-fast but return locations like "(native)"
|
|
50798
50821
|
if (urlLike.indexOf(':') === -1) {
|
|
50799
50822
|
return [urlLike];
|
|
50800
50823
|
}
|
|
50801
|
-
|
|
50824
|
+
var parts = LOCATION_REGEXP.exec(urlLike.replace(/[()]/g, ''));
|
|
50802
50825
|
if (!parts)
|
|
50803
|
-
throw new Error(
|
|
50826
|
+
throw new Error("Cannot parse given url: ".concat(urlLike));
|
|
50804
50827
|
return [parts[1], parts[2] || undefined, parts[3] || undefined];
|
|
50805
50828
|
},
|
|
50806
|
-
parseHelper
|
|
50807
|
-
|
|
50808
|
-
|
|
50809
|
-
|
|
50810
|
-
|
|
50811
|
-
|
|
50812
|
-
|
|
50813
|
-
|
|
50829
|
+
parseHelper: function (_a, error, maxFramesToSave, callback) {
|
|
50830
|
+
var regex = _a.regex, includeMatchedLine = _a.includeMatchedLine;
|
|
50831
|
+
var lines = error.stack.split('\n');
|
|
50832
|
+
var frames = [];
|
|
50833
|
+
var validFramesFound = 0;
|
|
50834
|
+
for (var i = 0; i < lines.length; i++) {
|
|
50835
|
+
var line = lines[i];
|
|
50836
|
+
var lineMatchesRegex = regex.test(line);
|
|
50837
|
+
var shouldSkipLine = (includeMatchedLine && !lineMatchesRegex) || // if line doesn't match regex and we want matched lines, skip it
|
|
50814
50838
|
(!includeMatchedLine && lineMatchesRegex); // if line does match regex but we don't want matched lines, skip it
|
|
50815
50839
|
if (shouldSkipLine)
|
|
50816
50840
|
continue;
|
|
@@ -50825,11 +50849,12 @@ const ErrorStackParser = {
|
|
|
50825
50849
|
}
|
|
50826
50850
|
return frames;
|
|
50827
50851
|
},
|
|
50828
|
-
parseChromiumStack(error, maxFramesToSave) {
|
|
50829
|
-
|
|
50830
|
-
|
|
50852
|
+
parseChromiumStack: function (error, maxFramesToSave) {
|
|
50853
|
+
var _this = this;
|
|
50854
|
+
return this.parseHelper({ regex: CHROME_EDGE_STACK_REGEXP, includeMatchedLine: true }, error, maxFramesToSave, function (line, frames) {
|
|
50855
|
+
var sanitizedLine;
|
|
50831
50856
|
if (line.indexOf('(eval ') > -1) {
|
|
50832
|
-
|
|
50857
|
+
var processedLine = line
|
|
50833
50858
|
.replace(/eval code/g, 'eval')
|
|
50834
50859
|
.replace(/(\(eval at [^()]*)|(\),.*$)/g, '');
|
|
50835
50860
|
sanitizedLine = processedLine.replace(/^\s+/, '').replace(/\(eval code/g, '(');
|
|
@@ -50839,7 +50864,7 @@ const ErrorStackParser = {
|
|
|
50839
50864
|
}
|
|
50840
50865
|
// capture and preserve the parenthesized location "(/foo/my bar.js:12:87)"
|
|
50841
50866
|
// in case it has spaces in it, as the string is split on \s+ later on
|
|
50842
|
-
|
|
50867
|
+
var location;
|
|
50843
50868
|
if (sanitizedLine.indexOf('(') > -1 && sanitizedLine.indexOf('):') > -1) {
|
|
50844
50869
|
location = sanitizedLine.match(/ (\((.+):(\d+):(\d+)\)$)/);
|
|
50845
50870
|
}
|
|
@@ -50847,22 +50872,23 @@ const ErrorStackParser = {
|
|
|
50847
50872
|
sanitizedLine = location
|
|
50848
50873
|
? sanitizedLine.replace(location[0], '')
|
|
50849
50874
|
: sanitizedLine;
|
|
50850
|
-
|
|
50875
|
+
var tokens = sanitizedLine.split(/\s+/).slice(1);
|
|
50851
50876
|
// if a location was matched, pass it to extractLocation() otherwise pop the last token
|
|
50852
|
-
|
|
50853
|
-
|
|
50854
|
-
|
|
50877
|
+
var locationParts = _this.extractLocation(location ? location[1] : tokens.pop() || '');
|
|
50878
|
+
var functionName = tokens.join(' ') || undefined;
|
|
50879
|
+
var fileName = (locationParts[0] === 'eval' || locationParts[0] === '<anonymous>') ? undefined : locationParts[0];
|
|
50855
50880
|
frames.push(new StackFrame({
|
|
50856
|
-
functionName,
|
|
50857
|
-
fileName,
|
|
50881
|
+
functionName: functionName,
|
|
50882
|
+
fileName: fileName,
|
|
50858
50883
|
lineNumber: locationParts[1],
|
|
50859
50884
|
columnNumber: locationParts[2]
|
|
50860
50885
|
}));
|
|
50861
50886
|
});
|
|
50862
50887
|
},
|
|
50863
|
-
parseFirefoxSafariStack(error, maxFramesToSave) {
|
|
50864
|
-
|
|
50865
|
-
|
|
50888
|
+
parseFirefoxSafariStack: function (error, maxFramesToSave) {
|
|
50889
|
+
var _this = this;
|
|
50890
|
+
return this.parseHelper({ regex: SAFARI_NATIVE_CODE_REGEXP, includeMatchedLine: false }, error, maxFramesToSave, function (line, frames) {
|
|
50891
|
+
var processedLine = line;
|
|
50866
50892
|
// Throw away eval information until we implement stacktrace.js/stackframe#8
|
|
50867
50893
|
if (processedLine.indexOf(' > eval') > -1) {
|
|
50868
50894
|
processedLine = processedLine.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g, ':$1');
|
|
@@ -50874,12 +50900,12 @@ const ErrorStackParser = {
|
|
|
50874
50900
|
}));
|
|
50875
50901
|
return;
|
|
50876
50902
|
}
|
|
50877
|
-
|
|
50878
|
-
|
|
50879
|
-
|
|
50880
|
-
|
|
50903
|
+
var functionNameRegex = /((.*".+"[^@]*)?[^@]*)(?:@)/;
|
|
50904
|
+
var matches = processedLine.match(functionNameRegex);
|
|
50905
|
+
var functionName = matches && matches[1] ? matches[1] : undefined;
|
|
50906
|
+
var locationParts = _this.extractLocation(processedLine.replace(functionNameRegex, ''));
|
|
50881
50907
|
frames.push(new StackFrame({
|
|
50882
|
-
functionName,
|
|
50908
|
+
functionName: functionName,
|
|
50883
50909
|
fileName: locationParts[0],
|
|
50884
50910
|
lineNumber: locationParts[1],
|
|
50885
50911
|
columnNumber: locationParts[2]
|
|
@@ -50914,7 +50940,7 @@ function includes(str, substring) {
|
|
|
50914
50940
|
function getResourceType(blockedURI, directive) {
|
|
50915
50941
|
if (!directive || typeof directive !== 'string')
|
|
50916
50942
|
return 'resource';
|
|
50917
|
-
|
|
50943
|
+
var d = directive.toLowerCase();
|
|
50918
50944
|
if (blockedURI === 'inline') {
|
|
50919
50945
|
if (includes(d, 'script-src-attr')) {
|
|
50920
50946
|
return 'inline event handler';
|
|
@@ -50973,11 +50999,12 @@ function getResourceType(blockedURI, directive) {
|
|
|
50973
50999
|
function getDirective(policy, directiveName) {
|
|
50974
51000
|
if (!policy || !directiveName)
|
|
50975
51001
|
return '';
|
|
50976
|
-
|
|
50977
|
-
for (
|
|
50978
|
-
|
|
50979
|
-
|
|
50980
|
-
|
|
51002
|
+
var needle = directiveName.toLowerCase();
|
|
51003
|
+
for (var _i = 0, _a = policy.split(';'); _i < _a.length; _i++) {
|
|
51004
|
+
var directive = _a[_i];
|
|
51005
|
+
var trimmed = directive.trim();
|
|
51006
|
+
var lower = trimmed.toLowerCase();
|
|
51007
|
+
if (lower === needle || lower.startsWith("".concat(needle, " "))) {
|
|
50981
51008
|
return trimmed;
|
|
50982
51009
|
}
|
|
50983
51010
|
}
|
|
@@ -50999,7 +51026,7 @@ function getDirective(policy, directiveName) {
|
|
|
50999
51026
|
function getArticle(phrase) {
|
|
51000
51027
|
if (!phrase || typeof phrase !== 'string')
|
|
51001
51028
|
return 'A';
|
|
51002
|
-
|
|
51029
|
+
var c = phrase.trim().charAt(0).toLowerCase();
|
|
51003
51030
|
return includes('aeiou', c) ? 'An' : 'A';
|
|
51004
51031
|
}
|
|
51005
51032
|
/**
|
|
@@ -51042,46 +51069,47 @@ function createCspViolationMessage(blockedURI, directive, isReportOnly, original
|
|
|
51042
51069
|
return 'Content Security Policy: Unknown violation occurred.';
|
|
51043
51070
|
}
|
|
51044
51071
|
try {
|
|
51045
|
-
|
|
51072
|
+
var reportOnlyText = isReportOnly ? ' (Report-Only)' : '';
|
|
51046
51073
|
// special case for frame-ancestors since it doesn't fit our template at all
|
|
51047
51074
|
if ((directive === null || directive === void 0 ? void 0 : directive.toLowerCase()) === 'frame-ancestors') {
|
|
51048
|
-
return
|
|
51075
|
+
return "Content Security Policy".concat(reportOnlyText, ": The display of ").concat(blockedURI, " in a frame was blocked because an ancestor violates your site's frame-ancestors policy.\nCurrent CSP: \"").concat(originalPolicy, "\".");
|
|
51049
51076
|
}
|
|
51050
|
-
|
|
51051
|
-
|
|
51052
|
-
|
|
51053
|
-
|
|
51054
|
-
|
|
51055
|
-
|
|
51056
|
-
return
|
|
51077
|
+
var resourceType = getResourceType(blockedURI, directive);
|
|
51078
|
+
var article = getArticle(resourceType);
|
|
51079
|
+
var source = formatBlockedUri(blockedURI);
|
|
51080
|
+
var directiveValue = getDirective(originalPolicy, directive);
|
|
51081
|
+
var policyDisplay = directiveValue || directive;
|
|
51082
|
+
var resourceDescription = "".concat(article, " ").concat(resourceType).concat(source ? " from ".concat(source) : '');
|
|
51083
|
+
return "Content Security Policy".concat(reportOnlyText, ": ").concat(resourceDescription, " was blocked by your site's `").concat(policyDisplay, "` policy.\nCurrent CSP: \"").concat(originalPolicy, "\".");
|
|
51057
51084
|
}
|
|
51058
51085
|
catch (error) {
|
|
51059
|
-
return
|
|
51086
|
+
return "Content Security Policy: Error formatting violation message: ".concat(error.message);
|
|
51060
51087
|
}
|
|
51061
51088
|
}
|
|
51062
51089
|
|
|
51063
|
-
|
|
51064
|
-
|
|
51090
|
+
var MAX_LENGTH = 1000;
|
|
51091
|
+
var PII_PATTERN = {
|
|
51065
51092
|
ip: /\b(?:\d{1,3}\.){3}\d{1,3}\b/g,
|
|
51066
51093
|
ssn: /\b\d{3}-\d{2}-\d{4}\b/g,
|
|
51067
51094
|
creditCard: /\b(?:\d[ -]?){12,18}\d\b/g,
|
|
51068
51095
|
httpsUrls: /https:\/\/[^\s]+/g,
|
|
51069
51096
|
email: /[\w._+-]+@[\w.-]+\.\w+/g
|
|
51070
51097
|
};
|
|
51071
|
-
|
|
51072
|
-
|
|
51073
|
-
|
|
51074
|
-
|
|
51075
|
-
|
|
51098
|
+
var PII_REPLACEMENT = '*'.repeat(10);
|
|
51099
|
+
var JSON_PII_KEYS = ['password', 'email', 'key', 'token', 'auth', 'authentication', 'phone', 'address', 'ssn'];
|
|
51100
|
+
var UNABLE_TO_DISPLAY_BODY = '[Unable to display body: detected PII could not be redacted]';
|
|
51101
|
+
var joinedKeys = JSON_PII_KEYS.join('|');
|
|
51102
|
+
var keyPattern = "\"([^\"]*(?:".concat(joinedKeys, ")[^\"]*)\"");
|
|
51076
51103
|
// only scrub strings, numbers, and booleans
|
|
51077
|
-
|
|
51104
|
+
var acceptedValues = '("([^"\\\\]*(?:\\\\.[^"\\\\]*)*")|(\\d+)|(true|false))';
|
|
51078
51105
|
/**
|
|
51079
51106
|
* Truncates a string to the max length
|
|
51080
51107
|
* @access private
|
|
51081
51108
|
* @param {String} string
|
|
51082
51109
|
* @returns {String}
|
|
51083
51110
|
*/
|
|
51084
|
-
function truncate(string, includeEllipsis
|
|
51111
|
+
function truncate(string, includeEllipsis) {
|
|
51112
|
+
if (includeEllipsis === void 0) { includeEllipsis = false; }
|
|
51085
51113
|
if (string.length <= MAX_LENGTH)
|
|
51086
51114
|
return string;
|
|
51087
51115
|
if (includeEllipsis) {
|
|
@@ -51098,7 +51126,7 @@ function truncate(string, includeEllipsis = false) {
|
|
|
51098
51126
|
* @returns {String}
|
|
51099
51127
|
*/
|
|
51100
51128
|
function generateLogKey(methodName, message, stackTrace) {
|
|
51101
|
-
return
|
|
51129
|
+
return "".concat(methodName, "|").concat(message, "|").concat(stackTrace);
|
|
51102
51130
|
}
|
|
51103
51131
|
/**
|
|
51104
51132
|
* Checks if a string has 2 or more digits, a https URL, or an email address
|
|
@@ -51115,12 +51143,13 @@ function mightContainPII(string) {
|
|
|
51115
51143
|
* @param {String} string
|
|
51116
51144
|
* @returns {String}
|
|
51117
51145
|
*/
|
|
51118
|
-
function scrubPII(
|
|
51146
|
+
function scrubPII(_a) {
|
|
51147
|
+
var string = _a.string, _ = _a._;
|
|
51119
51148
|
if (!string || typeof string !== 'string')
|
|
51120
51149
|
return string;
|
|
51121
51150
|
if (!mightContainPII(string))
|
|
51122
51151
|
return string;
|
|
51123
|
-
return _.reduce(_.values(PII_PATTERN), (str, pattern)
|
|
51152
|
+
return _.reduce(_.values(PII_PATTERN), function (str, pattern) { return str.replace(pattern, PII_REPLACEMENT); }, string);
|
|
51124
51153
|
}
|
|
51125
51154
|
/**
|
|
51126
51155
|
* Scrub PII from a stringified JSON object
|
|
@@ -51129,12 +51158,14 @@ function scrubPII({ string, _ }) {
|
|
|
51129
51158
|
* @returns {String}
|
|
51130
51159
|
*/
|
|
51131
51160
|
function scrubJsonPII(string) {
|
|
51132
|
-
|
|
51161
|
+
var fullScrubRegex = new RegExp("".concat(keyPattern, "\\s*:\\s*[\\{\\[]"), 'i');
|
|
51133
51162
|
if (fullScrubRegex.test(string)) {
|
|
51134
51163
|
return UNABLE_TO_DISPLAY_BODY;
|
|
51135
51164
|
}
|
|
51136
|
-
|
|
51137
|
-
return string.replace(keyValueScrubRegex, (match, key)
|
|
51165
|
+
var keyValueScrubRegex = new RegExp("".concat(keyPattern, "\\s*:\\s*").concat(acceptedValues), 'gi');
|
|
51166
|
+
return string.replace(keyValueScrubRegex, function (match, key) {
|
|
51167
|
+
return "\"".concat(key, "\":\"").concat(PII_REPLACEMENT, "\"");
|
|
51168
|
+
});
|
|
51138
51169
|
}
|
|
51139
51170
|
/**
|
|
51140
51171
|
* Checks if a string is a JSON object
|
|
@@ -51146,7 +51177,7 @@ function scrubJsonPII(string) {
|
|
|
51146
51177
|
function mightContainJson(string, contentType) {
|
|
51147
51178
|
if (!string || typeof string !== 'string')
|
|
51148
51179
|
return false;
|
|
51149
|
-
|
|
51180
|
+
var firstChar = string.charAt(0);
|
|
51150
51181
|
if (contentType && contentType.indexOf('application/json') !== -1) {
|
|
51151
51182
|
return true;
|
|
51152
51183
|
}
|
|
@@ -51159,19 +51190,20 @@ function mightContainJson(string, contentType) {
|
|
|
51159
51190
|
* @param {String} contentType
|
|
51160
51191
|
* @returns {String}
|
|
51161
51192
|
*/
|
|
51162
|
-
function maskSensitiveFields(
|
|
51193
|
+
function maskSensitiveFields(_a) {
|
|
51194
|
+
var string = _a.string, contentType = _a.contentType, _ = _a._;
|
|
51163
51195
|
if (!string || typeof string !== 'string')
|
|
51164
51196
|
return string;
|
|
51165
51197
|
if (mightContainJson(string, contentType)) {
|
|
51166
51198
|
string = scrubJsonPII(string);
|
|
51167
51199
|
}
|
|
51168
51200
|
if (mightContainPII(string)) {
|
|
51169
|
-
string = scrubPII({ string, _ });
|
|
51201
|
+
string = scrubPII({ string: string, _: _ });
|
|
51170
51202
|
}
|
|
51171
51203
|
return string;
|
|
51172
51204
|
}
|
|
51173
51205
|
|
|
51174
|
-
|
|
51206
|
+
var DEV_LOG_TYPE = 'devlog';
|
|
51175
51207
|
function createDevLogEnvelope(pluginAPI, globalPendo) {
|
|
51176
51208
|
return {
|
|
51177
51209
|
browser_time: pluginAPI.util.getNow(),
|
|
@@ -51182,12 +51214,12 @@ function createDevLogEnvelope(pluginAPI, globalPendo) {
|
|
|
51182
51214
|
};
|
|
51183
51215
|
}
|
|
51184
51216
|
|
|
51185
|
-
|
|
51186
|
-
|
|
51187
|
-
|
|
51188
|
-
|
|
51189
|
-
|
|
51190
|
-
|
|
51217
|
+
var TOKEN_MAX_SIZE = 100;
|
|
51218
|
+
var TOKEN_REFILL_RATE = 10;
|
|
51219
|
+
var TOKEN_REFRESH_INTERVAL = 1000;
|
|
51220
|
+
var MAX_UNCOMPRESSED_SIZE = 125000; // 125KB
|
|
51221
|
+
var DevlogBuffer = /** @class */ (function () {
|
|
51222
|
+
function DevlogBuffer(pendo, pluginAPI) {
|
|
51191
51223
|
this.pendo = pendo;
|
|
51192
51224
|
this.pluginAPI = pluginAPI;
|
|
51193
51225
|
this.events = [];
|
|
@@ -51198,36 +51230,36 @@ class DevlogBuffer {
|
|
|
51198
51230
|
this.lastRefillTime = this.pluginAPI.util.getNow();
|
|
51199
51231
|
this.nextRefillTime = this.lastRefillTime + TOKEN_REFRESH_INTERVAL;
|
|
51200
51232
|
}
|
|
51201
|
-
isEmpty() {
|
|
51233
|
+
DevlogBuffer.prototype.isEmpty = function () {
|
|
51202
51234
|
return this.events.length === 0 && this.payloads.length === 0;
|
|
51203
|
-
}
|
|
51204
|
-
refillTokens() {
|
|
51205
|
-
|
|
51235
|
+
};
|
|
51236
|
+
DevlogBuffer.prototype.refillTokens = function () {
|
|
51237
|
+
var now = this.pluginAPI.util.getNow();
|
|
51206
51238
|
if (now >= this.nextRefillTime) {
|
|
51207
|
-
|
|
51208
|
-
|
|
51209
|
-
|
|
51239
|
+
var timeSinceLastRefill = now - this.lastRefillTime;
|
|
51240
|
+
var secondsSinceLastRefill = Math.floor(timeSinceLastRefill / TOKEN_REFRESH_INTERVAL);
|
|
51241
|
+
var tokensToRefill = secondsSinceLastRefill * TOKEN_REFILL_RATE;
|
|
51210
51242
|
this.tokens = Math.min(this.tokens + tokensToRefill, TOKEN_MAX_SIZE);
|
|
51211
51243
|
this.lastRefillTime = now;
|
|
51212
51244
|
this.nextRefillTime = now + TOKEN_REFRESH_INTERVAL;
|
|
51213
51245
|
}
|
|
51214
|
-
}
|
|
51215
|
-
clear() {
|
|
51246
|
+
};
|
|
51247
|
+
DevlogBuffer.prototype.clear = function () {
|
|
51216
51248
|
this.events = [];
|
|
51217
51249
|
this.lastEvent = null;
|
|
51218
51250
|
this.uncompressedSize = 0;
|
|
51219
|
-
}
|
|
51220
|
-
hasTokenAvailable() {
|
|
51251
|
+
};
|
|
51252
|
+
DevlogBuffer.prototype.hasTokenAvailable = function () {
|
|
51221
51253
|
this.refillTokens();
|
|
51222
51254
|
return this.tokens > 0;
|
|
51223
|
-
}
|
|
51224
|
-
estimateEventSize(event) {
|
|
51255
|
+
};
|
|
51256
|
+
DevlogBuffer.prototype.estimateEventSize = function (event) {
|
|
51225
51257
|
return JSON.stringify(event).length;
|
|
51226
|
-
}
|
|
51227
|
-
push(event) {
|
|
51258
|
+
};
|
|
51259
|
+
DevlogBuffer.prototype.push = function (event) {
|
|
51228
51260
|
if (!this.hasTokenAvailable())
|
|
51229
51261
|
return false;
|
|
51230
|
-
|
|
51262
|
+
var eventSize = this.estimateEventSize(event);
|
|
51231
51263
|
if (this.uncompressedSize + eventSize > MAX_UNCOMPRESSED_SIZE) {
|
|
51232
51264
|
this.compressCurrentChunk();
|
|
51233
51265
|
}
|
|
@@ -51236,54 +51268,55 @@ class DevlogBuffer {
|
|
|
51236
51268
|
this.events.push(event);
|
|
51237
51269
|
this.tokens = Math.max(this.tokens - 1, 0);
|
|
51238
51270
|
return true;
|
|
51239
|
-
}
|
|
51240
|
-
compressCurrentChunk() {
|
|
51271
|
+
};
|
|
51272
|
+
DevlogBuffer.prototype.compressCurrentChunk = function () {
|
|
51241
51273
|
if (this.events.length === 0)
|
|
51242
51274
|
return;
|
|
51243
|
-
|
|
51275
|
+
var jzb = this.pendo.compress(this.events);
|
|
51244
51276
|
this.payloads.push(jzb);
|
|
51245
51277
|
this.clear();
|
|
51246
|
-
}
|
|
51247
|
-
generateUrl() {
|
|
51248
|
-
|
|
51278
|
+
};
|
|
51279
|
+
DevlogBuffer.prototype.generateUrl = function () {
|
|
51280
|
+
var queryParams = {
|
|
51249
51281
|
v: this.pendo.VERSION,
|
|
51250
51282
|
ct: this.pluginAPI.util.getNow()
|
|
51251
51283
|
};
|
|
51252
51284
|
return this.pluginAPI.transmit.buildBaseDataUrl(DEV_LOG_TYPE, this.pendo.apiKey, queryParams);
|
|
51253
|
-
}
|
|
51254
|
-
pack() {
|
|
51285
|
+
};
|
|
51286
|
+
DevlogBuffer.prototype.pack = function () {
|
|
51255
51287
|
if (this.isEmpty())
|
|
51256
51288
|
return;
|
|
51257
|
-
|
|
51289
|
+
var url = this.generateUrl();
|
|
51258
51290
|
this.compressCurrentChunk();
|
|
51259
|
-
|
|
51260
|
-
jzb,
|
|
51261
|
-
url
|
|
51262
|
-
}));
|
|
51291
|
+
var payloads = this.pendo._.map(this.payloads, function (jzb) { return ({
|
|
51292
|
+
jzb: jzb,
|
|
51293
|
+
url: url
|
|
51294
|
+
}); });
|
|
51263
51295
|
this.payloads = [];
|
|
51264
51296
|
return payloads;
|
|
51265
|
-
}
|
|
51266
|
-
|
|
51297
|
+
};
|
|
51298
|
+
return DevlogBuffer;
|
|
51299
|
+
}());
|
|
51267
51300
|
|
|
51268
|
-
|
|
51269
|
-
|
|
51301
|
+
var DevlogTransport = /** @class */ (function () {
|
|
51302
|
+
function DevlogTransport(globalPendo, pluginAPI) {
|
|
51270
51303
|
this.pendo = globalPendo;
|
|
51271
51304
|
this.pluginAPI = pluginAPI;
|
|
51272
51305
|
}
|
|
51273
|
-
buildGetUrl(baseUrl, jzb) {
|
|
51274
|
-
|
|
51306
|
+
DevlogTransport.prototype.buildGetUrl = function (baseUrl, jzb) {
|
|
51307
|
+
var params = {};
|
|
51275
51308
|
if (this.pluginAPI.agent.treatAsAdoptPartner()) {
|
|
51276
51309
|
this.pluginAPI.agent.addAccountIdParams(params, this.pendo.get_account_id(), this.pluginAPI.ConfigReader.get('oemAccountId'));
|
|
51277
51310
|
}
|
|
51278
|
-
|
|
51311
|
+
var jwtOptions = this.pluginAPI.agent.getJwtInfoCopy();
|
|
51279
51312
|
if (!this.pendo._.isEmpty(jwtOptions)) {
|
|
51280
51313
|
this.pendo._.extend(params, jwtOptions);
|
|
51281
51314
|
}
|
|
51282
51315
|
params.jzb = jzb;
|
|
51283
|
-
|
|
51284
|
-
return
|
|
51285
|
-
}
|
|
51286
|
-
get(url, options) {
|
|
51316
|
+
var queryString = this.pendo._.map(params, function (value, key) { return "".concat(key, "=").concat(value); }).join('&');
|
|
51317
|
+
return "".concat(baseUrl).concat(baseUrl.indexOf('?') !== -1 ? '&' : '?').concat(queryString);
|
|
51318
|
+
};
|
|
51319
|
+
DevlogTransport.prototype.get = function (url, options) {
|
|
51287
51320
|
options.method = 'GET';
|
|
51288
51321
|
if (this.pluginAPI.transmit.fetchKeepalive.supported()) {
|
|
51289
51322
|
return this.pluginAPI.transmit.fetchKeepalive(url, options);
|
|
@@ -51291,86 +51324,90 @@ class DevlogTransport {
|
|
|
51291
51324
|
else {
|
|
51292
51325
|
return this.pendo.ajax.get(url);
|
|
51293
51326
|
}
|
|
51294
|
-
}
|
|
51295
|
-
sendRequestWithGet
|
|
51296
|
-
|
|
51327
|
+
};
|
|
51328
|
+
DevlogTransport.prototype.sendRequestWithGet = function (_a) {
|
|
51329
|
+
var url = _a.url, jzb = _a.jzb;
|
|
51330
|
+
var getUrl = this.buildGetUrl(url, jzb);
|
|
51297
51331
|
return this.get(getUrl, {
|
|
51298
51332
|
headers: {
|
|
51299
51333
|
'Content-Type': 'application/octet-stream'
|
|
51300
51334
|
}
|
|
51301
51335
|
});
|
|
51302
|
-
}
|
|
51303
|
-
post(url, options) {
|
|
51336
|
+
};
|
|
51337
|
+
DevlogTransport.prototype.post = function (url, options) {
|
|
51304
51338
|
options.method = 'POST';
|
|
51305
51339
|
if (options.keepalive && this.pluginAPI.transmit.fetchKeepalive.supported()) {
|
|
51306
51340
|
return this.pluginAPI.transmit.fetchKeepalive(url, options);
|
|
51307
51341
|
}
|
|
51308
51342
|
else if (options.keepalive && this.pluginAPI.transmit.sendBeacon.supported()) {
|
|
51309
|
-
|
|
51343
|
+
var result = this.pluginAPI.transmit.sendBeacon(url, new Blob([options.body]));
|
|
51310
51344
|
return result ? Promise$2.resolve() : Promise$2.reject(new Error('sendBeacon failed to send devlog data'));
|
|
51311
51345
|
}
|
|
51312
51346
|
else {
|
|
51313
51347
|
return this.pendo.ajax.post(url, options.body);
|
|
51314
51348
|
}
|
|
51315
|
-
}
|
|
51316
|
-
sendRequestWithPost
|
|
51317
|
-
|
|
51318
|
-
|
|
51349
|
+
};
|
|
51350
|
+
DevlogTransport.prototype.sendRequestWithPost = function (_a, isUnload) {
|
|
51351
|
+
var url = _a.url, jzb = _a.jzb;
|
|
51352
|
+
var jwtOptions = this.pluginAPI.agent.getJwtInfoCopy();
|
|
51353
|
+
var bodyPayload = {
|
|
51319
51354
|
events: jzb,
|
|
51320
51355
|
browser_time: this.pluginAPI.util.getNow()
|
|
51321
51356
|
};
|
|
51322
51357
|
if (this.pluginAPI.agent.treatAsAdoptPartner()) {
|
|
51323
51358
|
this.pluginAPI.agent.addAccountIdParams(bodyPayload, this.pendo.get_account_id(), this.pluginAPI.ConfigReader.get('oemAccountId'));
|
|
51324
51359
|
}
|
|
51325
|
-
|
|
51360
|
+
var body = JSON.stringify(this.pendo._.extend(bodyPayload, jwtOptions));
|
|
51326
51361
|
return this.post(url, {
|
|
51327
|
-
body,
|
|
51362
|
+
body: body,
|
|
51328
51363
|
headers: {
|
|
51329
51364
|
'Content-Type': 'application/json'
|
|
51330
51365
|
},
|
|
51331
51366
|
keepalive: isUnload
|
|
51332
51367
|
});
|
|
51333
|
-
}
|
|
51334
|
-
sendRequest
|
|
51335
|
-
|
|
51368
|
+
};
|
|
51369
|
+
DevlogTransport.prototype.sendRequest = function (_a, isUnload) {
|
|
51370
|
+
var url = _a.url, jzb = _a.jzb;
|
|
51371
|
+
var compressedLength = jzb.length;
|
|
51336
51372
|
if (compressedLength <= this.pluginAPI.constants.ENCODED_EVENT_MAX_LENGTH && !this.pluginAPI.ConfigReader.get('sendEventsWithPostOnly')) {
|
|
51337
|
-
return this.sendRequestWithGet({ url, jzb });
|
|
51373
|
+
return this.sendRequestWithGet({ url: url, jzb: jzb });
|
|
51338
51374
|
}
|
|
51339
|
-
return this.sendRequestWithPost({ url, jzb }, isUnload);
|
|
51340
|
-
}
|
|
51341
|
-
|
|
51375
|
+
return this.sendRequestWithPost({ url: url, jzb: jzb }, isUnload);
|
|
51376
|
+
};
|
|
51377
|
+
return DevlogTransport;
|
|
51378
|
+
}());
|
|
51342
51379
|
|
|
51343
51380
|
function ConsoleCapture() {
|
|
51344
|
-
|
|
51345
|
-
|
|
51346
|
-
|
|
51347
|
-
|
|
51348
|
-
|
|
51349
|
-
|
|
51350
|
-
|
|
51351
|
-
|
|
51352
|
-
|
|
51353
|
-
|
|
51354
|
-
|
|
51355
|
-
|
|
51381
|
+
var pluginAPI;
|
|
51382
|
+
var _;
|
|
51383
|
+
var globalPendo;
|
|
51384
|
+
var buffer;
|
|
51385
|
+
var sendQueue;
|
|
51386
|
+
var sendInterval;
|
|
51387
|
+
var transport;
|
|
51388
|
+
var isPtmPaused;
|
|
51389
|
+
var isCapturingConsoleLogs = false;
|
|
51390
|
+
var CAPTURE_CONSOLE_CONFIG = 'captureConsoleLogs';
|
|
51391
|
+
var CONSOLE_METHODS = ['log', 'warn', 'error', 'info'];
|
|
51392
|
+
var DEV_LOG_SUB_TYPE = 'console';
|
|
51356
51393
|
// deduplicate logs
|
|
51357
|
-
|
|
51394
|
+
var lastLogKey = '';
|
|
51358
51395
|
return {
|
|
51359
51396
|
name: 'ConsoleCapture',
|
|
51360
|
-
initialize,
|
|
51361
|
-
teardown,
|
|
51362
|
-
addIntercepts,
|
|
51363
|
-
createConsoleEvent,
|
|
51364
|
-
captureStackTrace,
|
|
51365
|
-
send,
|
|
51366
|
-
setCaptureState,
|
|
51367
|
-
recordingStarted,
|
|
51368
|
-
recordingStopped,
|
|
51369
|
-
onAppHidden,
|
|
51370
|
-
onAppUnloaded,
|
|
51371
|
-
onPtmPaused,
|
|
51372
|
-
onPtmUnpaused,
|
|
51373
|
-
securityPolicyViolationFn,
|
|
51397
|
+
initialize: initialize,
|
|
51398
|
+
teardown: teardown,
|
|
51399
|
+
addIntercepts: addIntercepts,
|
|
51400
|
+
createConsoleEvent: createConsoleEvent,
|
|
51401
|
+
captureStackTrace: captureStackTrace,
|
|
51402
|
+
send: send,
|
|
51403
|
+
setCaptureState: setCaptureState,
|
|
51404
|
+
recordingStarted: recordingStarted,
|
|
51405
|
+
recordingStopped: recordingStopped,
|
|
51406
|
+
onAppHidden: onAppHidden,
|
|
51407
|
+
onAppUnloaded: onAppUnloaded,
|
|
51408
|
+
onPtmPaused: onPtmPaused,
|
|
51409
|
+
onPtmUnpaused: onPtmUnpaused,
|
|
51410
|
+
securityPolicyViolationFn: securityPolicyViolationFn,
|
|
51374
51411
|
get isCapturingConsoleLogs() {
|
|
51375
51412
|
return isCapturingConsoleLogs;
|
|
51376
51413
|
},
|
|
@@ -51387,16 +51424,16 @@ function ConsoleCapture() {
|
|
|
51387
51424
|
function initialize(pendo, PluginAPI) {
|
|
51388
51425
|
_ = pendo._;
|
|
51389
51426
|
pluginAPI = PluginAPI;
|
|
51390
|
-
|
|
51427
|
+
var ConfigReader = pluginAPI.ConfigReader;
|
|
51391
51428
|
ConfigReader.addOption(CAPTURE_CONSOLE_CONFIG, [ConfigReader.sources.PENDO_CONFIG_SRC], false);
|
|
51392
|
-
|
|
51429
|
+
var captureConsoleEnabled = ConfigReader.get(CAPTURE_CONSOLE_CONFIG);
|
|
51393
51430
|
if (!captureConsoleEnabled)
|
|
51394
51431
|
return;
|
|
51395
51432
|
globalPendo = pendo;
|
|
51396
51433
|
buffer = new DevlogBuffer(pendo, pluginAPI);
|
|
51397
51434
|
transport = new DevlogTransport(pendo, pluginAPI);
|
|
51398
51435
|
sendQueue = new pluginAPI.SendQueue(transport.sendRequest.bind(transport));
|
|
51399
|
-
sendInterval = setInterval(()
|
|
51436
|
+
sendInterval = setInterval(function () {
|
|
51400
51437
|
if (!sendQueue.failed()) {
|
|
51401
51438
|
send();
|
|
51402
51439
|
}
|
|
@@ -51422,17 +51459,19 @@ function ConsoleCapture() {
|
|
|
51422
51459
|
function onPtmUnpaused() {
|
|
51423
51460
|
isPtmPaused = false;
|
|
51424
51461
|
if (!buffer.isEmpty()) {
|
|
51425
|
-
for (
|
|
51426
|
-
|
|
51462
|
+
for (var _i = 0, _a = buffer.events; _i < _a.length; _i++) {
|
|
51463
|
+
var event_1 = _a[_i];
|
|
51464
|
+
pluginAPI.Events.eventCaptured.trigger(event_1);
|
|
51427
51465
|
}
|
|
51428
51466
|
send();
|
|
51429
51467
|
}
|
|
51430
51468
|
}
|
|
51431
|
-
function setCaptureState(
|
|
51469
|
+
function setCaptureState(_a) {
|
|
51470
|
+
var _b = _a === void 0 ? {} : _a, _c = _b.shouldCapture, shouldCapture = _c === void 0 ? false : _c, _d = _b.reason, reason = _d === void 0 ? '' : _d;
|
|
51432
51471
|
if (shouldCapture === isCapturingConsoleLogs)
|
|
51433
51472
|
return;
|
|
51434
51473
|
isCapturingConsoleLogs = shouldCapture;
|
|
51435
|
-
pluginAPI.log.info(
|
|
51474
|
+
pluginAPI.log.info("[ConsoleCapture] Console log capture ".concat(shouldCapture ? 'started' : 'stopped').concat(reason ? ": ".concat(reason) : ''));
|
|
51436
51475
|
}
|
|
51437
51476
|
function recordingStarted() {
|
|
51438
51477
|
setCaptureState({ shouldCapture: true, reason: 'recording started' });
|
|
@@ -51446,12 +51485,12 @@ function ConsoleCapture() {
|
|
|
51446
51485
|
}
|
|
51447
51486
|
function addIntercepts() {
|
|
51448
51487
|
_.each(CONSOLE_METHODS, function (methodName) {
|
|
51449
|
-
|
|
51488
|
+
var originalMethod = console[methodName];
|
|
51450
51489
|
if (!originalMethod)
|
|
51451
51490
|
return;
|
|
51452
51491
|
console[methodName] = _.wrap(originalMethod, function (originalFn) {
|
|
51453
51492
|
// slice 1 to omit originalFn
|
|
51454
|
-
|
|
51493
|
+
var args = _.toArray(arguments).slice(1);
|
|
51455
51494
|
originalFn.apply(console, args);
|
|
51456
51495
|
createConsoleEvent(args, methodName);
|
|
51457
51496
|
});
|
|
@@ -51463,10 +51502,10 @@ function ConsoleCapture() {
|
|
|
51463
51502
|
function securityPolicyViolationFn(evt) {
|
|
51464
51503
|
if (!evt || typeof evt !== 'object')
|
|
51465
51504
|
return;
|
|
51466
|
-
|
|
51467
|
-
|
|
51468
|
-
|
|
51469
|
-
|
|
51505
|
+
var blockedURI = evt.blockedURI, violatedDirective = evt.violatedDirective, effectiveDirective = evt.effectiveDirective, disposition = evt.disposition, originalPolicy = evt.originalPolicy;
|
|
51506
|
+
var directive = violatedDirective || effectiveDirective;
|
|
51507
|
+
var isReportOnly = disposition === 'report';
|
|
51508
|
+
var message = createCspViolationMessage(blockedURI, directive, isReportOnly, originalPolicy);
|
|
51470
51509
|
if (isReportOnly) {
|
|
51471
51510
|
createConsoleEvent([message], 'warn', { skipStackTrace: true, skipScrubPII: true });
|
|
51472
51511
|
}
|
|
@@ -51474,12 +51513,13 @@ function ConsoleCapture() {
|
|
|
51474
51513
|
createConsoleEvent([message], 'error', { skipStackTrace: true, skipScrubPII: true });
|
|
51475
51514
|
}
|
|
51476
51515
|
}
|
|
51477
|
-
function createConsoleEvent(args, methodName,
|
|
51516
|
+
function createConsoleEvent(args, methodName, _a) {
|
|
51517
|
+
var _b = _a === void 0 ? {} : _a, _c = _b.skipStackTrace, skipStackTrace = _c === void 0 ? false : _c, _d = _b.skipScrubPII, skipScrubPII = _d === void 0 ? false : _d;
|
|
51478
51518
|
if (!isCapturingConsoleLogs || !args || args.length === 0 || !_.contains(CONSOLE_METHODS, methodName))
|
|
51479
51519
|
return;
|
|
51480
51520
|
// stringify args
|
|
51481
|
-
|
|
51482
|
-
|
|
51521
|
+
var message = _.compact(_.map(args, function (arg) {
|
|
51522
|
+
var stringifiedArg;
|
|
51483
51523
|
try {
|
|
51484
51524
|
stringifiedArg = stringify(arg);
|
|
51485
51525
|
}
|
|
@@ -51491,22 +51531,22 @@ function ConsoleCapture() {
|
|
|
51491
51531
|
if (!message)
|
|
51492
51532
|
return;
|
|
51493
51533
|
// capture stack trace
|
|
51494
|
-
|
|
51534
|
+
var stackTrace = '';
|
|
51495
51535
|
if (!skipStackTrace) {
|
|
51496
|
-
|
|
51536
|
+
var maxStackFrames = methodName === 'error' ? 4 : 1;
|
|
51497
51537
|
stackTrace = captureStackTrace(maxStackFrames);
|
|
51498
51538
|
}
|
|
51499
51539
|
// truncate message and stack trace
|
|
51500
51540
|
message = truncate(message);
|
|
51501
51541
|
stackTrace = truncate(stackTrace);
|
|
51502
51542
|
// de-duplicate log
|
|
51503
|
-
|
|
51543
|
+
var logKey = generateLogKey(methodName, message, stackTrace);
|
|
51504
51544
|
if (isExistingDuplicateLog(logKey)) {
|
|
51505
51545
|
buffer.lastEvent.devLogCount++;
|
|
51506
51546
|
return;
|
|
51507
51547
|
}
|
|
51508
|
-
|
|
51509
|
-
|
|
51548
|
+
var devLogEnvelope = createDevLogEnvelope(pluginAPI, globalPendo);
|
|
51549
|
+
var consoleEvent = __assign(__assign({}, devLogEnvelope), { subType: DEV_LOG_SUB_TYPE, devLogLevel: methodName === 'log' ? 'info' : methodName, devLogMessage: skipScrubPII ? message : scrubPII({ string: message, _: _ }), devLogTrace: stackTrace, devLogCount: 1 });
|
|
51510
51550
|
if (!buffer.hasTokenAvailable())
|
|
51511
51551
|
return consoleEvent;
|
|
51512
51552
|
if (!isPtmPaused) {
|
|
@@ -51518,8 +51558,8 @@ function ConsoleCapture() {
|
|
|
51518
51558
|
}
|
|
51519
51559
|
function captureStackTrace(maxStackFrames) {
|
|
51520
51560
|
try {
|
|
51521
|
-
|
|
51522
|
-
return _.map(stackFrames, frame
|
|
51561
|
+
var stackFrames = ErrorStackParser.parse(new Error(), maxStackFrames);
|
|
51562
|
+
return _.map(stackFrames, function (frame) { return frame.toString(); }).join('\n');
|
|
51523
51563
|
}
|
|
51524
51564
|
catch (error) {
|
|
51525
51565
|
return '';
|
|
@@ -51531,21 +51571,22 @@ function ConsoleCapture() {
|
|
|
51531
51571
|
function updateLastLog(logKey) {
|
|
51532
51572
|
lastLogKey = logKey;
|
|
51533
51573
|
}
|
|
51534
|
-
function send(
|
|
51574
|
+
function send(_a) {
|
|
51575
|
+
var _b = _a === void 0 ? {} : _a, _c = _b.unload, unload = _c === void 0 ? false : _c, _d = _b.hidden, hidden = _d === void 0 ? false : _d;
|
|
51535
51576
|
if (!buffer || buffer.isEmpty())
|
|
51536
51577
|
return;
|
|
51537
51578
|
if (!globalPendo.isSendingEvents()) {
|
|
51538
51579
|
buffer.clear();
|
|
51539
51580
|
return;
|
|
51540
51581
|
}
|
|
51541
|
-
|
|
51582
|
+
var payloads = buffer.pack();
|
|
51542
51583
|
if (!payloads || payloads.length === 0)
|
|
51543
51584
|
return;
|
|
51544
51585
|
if (unload || hidden) {
|
|
51545
51586
|
sendQueue.drain(payloads, unload);
|
|
51546
51587
|
}
|
|
51547
51588
|
else {
|
|
51548
|
-
sendQueue.push(
|
|
51589
|
+
sendQueue.push.apply(sendQueue, payloads);
|
|
51549
51590
|
}
|
|
51550
51591
|
}
|
|
51551
51592
|
function teardown() {
|
|
@@ -51569,7 +51610,7 @@ function ConsoleCapture() {
|
|
|
51569
51610
|
_.each(CONSOLE_METHODS, function (methodName) {
|
|
51570
51611
|
if (!console[methodName])
|
|
51571
51612
|
return _.noop;
|
|
51572
|
-
|
|
51613
|
+
var unwrap = console[methodName]._pendoUnwrap;
|
|
51573
51614
|
if (_.isFunction(unwrap)) {
|
|
51574
51615
|
unwrap();
|
|
51575
51616
|
}
|
|
@@ -51975,18 +52016,20 @@ function NetworkCapture() {
|
|
|
51975
52016
|
}
|
|
51976
52017
|
}
|
|
51977
52018
|
|
|
51978
|
-
|
|
51979
|
-
|
|
51980
|
-
|
|
51981
|
-
|
|
51982
|
-
|
|
51983
|
-
|
|
51984
|
-
|
|
51985
|
-
|
|
51986
|
-
|
|
51987
|
-
|
|
51988
|
-
|
|
51989
|
-
|
|
52019
|
+
var PREDICT_STEP_REGEX = /\$\$predict\$\$/;
|
|
52020
|
+
var DRAG_THRESHOLD = 5;
|
|
52021
|
+
var STYLE_ID = 'pendo-predict-plugin-styles';
|
|
52022
|
+
var PREDICT_BASE_URL = 'https://predict.pendo.io';
|
|
52023
|
+
var GUIDE_BUTTON_IDENTIFIER = 'button:contains("token")';
|
|
52024
|
+
var pluginVersion = '1.0.1';
|
|
52025
|
+
var $ = function (id) { return document.getElementById(id); };
|
|
52026
|
+
var createElement = function (tag, attrs, parent) {
|
|
52027
|
+
if (attrs === void 0) { attrs = {}; }
|
|
52028
|
+
if (parent === void 0) { parent = null; }
|
|
52029
|
+
var el = document.createElement(tag);
|
|
52030
|
+
var entries = Object.entries(attrs);
|
|
52031
|
+
for (var i = 0; i < entries.length; i++) {
|
|
52032
|
+
var _a = entries[i], key = _a[0], value = _a[1];
|
|
51990
52033
|
if (key === 'className')
|
|
51991
52034
|
el.className = value;
|
|
51992
52035
|
else if (key === 'innerHTML')
|
|
@@ -51998,69 +52041,28 @@ const createElement = (tag, attrs = {}, parent = null) => {
|
|
|
51998
52041
|
parent.appendChild(el);
|
|
51999
52042
|
return el;
|
|
52000
52043
|
};
|
|
52001
|
-
|
|
52002
|
-
|
|
52044
|
+
var injectStyles = function (pendoContainerId, log) {
|
|
52045
|
+
if (log === void 0) { log = function () { }; }
|
|
52046
|
+
var styleId = "".concat(STYLE_ID, "-").concat(pendoContainerId);
|
|
52003
52047
|
if ($(styleId)) {
|
|
52004
|
-
log(
|
|
52048
|
+
log("[predict] style already exists, skipping: ".concat(styleId));
|
|
52005
52049
|
return;
|
|
52006
52050
|
}
|
|
52007
|
-
log(
|
|
52051
|
+
log("[predict] injecting styles: ".concat(styleId));
|
|
52008
52052
|
createElement('style', {
|
|
52009
52053
|
id: styleId,
|
|
52010
|
-
textContent:
|
|
52011
|
-
#${pendoContainerId} {
|
|
52012
|
-
display: none !important;
|
|
52013
|
-
}
|
|
52014
|
-
.frame-explanation {
|
|
52015
|
-
aspect-ratio: 16/9; overflow: hidden; min-height: 300px;
|
|
52016
|
-
width: 100vw; height: 100vh; background: transparent;
|
|
52017
|
-
position: fixed; bottom: 0; right: 0; z-index: 999999; border: none;
|
|
52018
|
-
visibility: hidden; opacity: 0; pointer-events: none;
|
|
52019
|
-
transition: opacity 0.1s ease-out, visibility 0s linear 0.1s;
|
|
52020
|
-
display: none;
|
|
52021
|
-
}
|
|
52022
|
-
.frame-explanation.is-visible {
|
|
52023
|
-
visibility: visible; opacity: 1; pointer-events: auto;
|
|
52024
|
-
transition: opacity 0.1s ease-out, visibility 0s linear 0s;
|
|
52025
|
-
}
|
|
52026
|
-
.frame-explanation.is-exists {
|
|
52027
|
-
display: block !important;
|
|
52028
|
-
}
|
|
52029
|
-
.floating-modal-container {
|
|
52030
|
-
position: fixed; top: 20px; right: 20px; z-index: 500000;
|
|
52031
|
-
visibility: hidden; opacity: 0; pointer-events: none;
|
|
52032
|
-
transition: opacity 0.1s ease-out, visibility 0s linear 0.1s;
|
|
52033
|
-
border-radius: 8px; box-shadow: 0px 4px 12px 0px rgba(0,0,0,0.15);
|
|
52034
|
-
overflow: hidden; width: 384px; height: 176px;
|
|
52035
|
-
}
|
|
52036
|
-
.floating-modal-container.is-visible {
|
|
52037
|
-
visibility: visible; opacity: 1; pointer-events: auto;
|
|
52038
|
-
transition: opacity 0.1s ease-out, visibility 0s linear 0s;
|
|
52039
|
-
}
|
|
52040
|
-
.floating-modal-container.is-dragging { will-change: left, top; }
|
|
52041
|
-
.floating-modal-drag-handle {
|
|
52042
|
-
position: absolute; left: 50%; transform: translateX(-50%);
|
|
52043
|
-
top: 5px; width: calc(100% - 46px); min-width: 166px; height: 17px;
|
|
52044
|
-
z-index: 9999; transition: left 0.2s ease, right 0.2s ease;
|
|
52045
|
-
display: flex; justify-content: center; align-items: center;
|
|
52046
|
-
}
|
|
52047
|
-
.floating-modal-drag-handle svg g { fill: #A0A0A0; }
|
|
52048
|
-
.floating-modal-drag-handle:hover { cursor: grab; }
|
|
52049
|
-
.floating-modal-drag-handle:hover svg g { fill: #1f2937; }
|
|
52050
|
-
.floating-modal-drag-handle.is-dragging { cursor: grabbing; }
|
|
52051
|
-
.floating-modal-drag-handle.is-collapsed { top: 0px; }
|
|
52052
|
-
.frame-floating-modal { width: 100%; height: 100%; background: white; border: none; display: block; }
|
|
52053
|
-
`
|
|
52054
|
+
textContent: "\n #".concat(pendoContainerId, " {\n display: none !important;\n }\n .frame-explanation {\n aspect-ratio: 16/9; overflow: hidden; min-height: 300px;\n width: 100vw; height: 100vh; background: transparent;\n position: fixed; bottom: 0; right: 0; z-index: 999999; border: none;\n visibility: hidden; opacity: 0; pointer-events: none;\n transition: opacity 0.1s ease-out, visibility 0s linear 0.1s;\n display: none;\n }\n .frame-explanation.is-visible {\n visibility: visible; opacity: 1; pointer-events: auto;\n transition: opacity 0.1s ease-out, visibility 0s linear 0s;\n }\n .frame-explanation.is-exists {\n display: block !important;\n }\n .floating-modal-container {\n position: fixed; top: 20px; right: 20px; z-index: 500000;\n visibility: hidden; opacity: 0; pointer-events: none;\n transition: opacity 0.1s ease-out, visibility 0s linear 0.1s;\n border-radius: 8px; box-shadow: 0px 4px 12px 0px rgba(0,0,0,0.15);\n overflow: hidden; width: 384px; height: 176px;\n }\n .floating-modal-container.is-visible {\n visibility: visible; opacity: 1; pointer-events: auto;\n transition: opacity 0.1s ease-out, visibility 0s linear 0s;\n }\n .floating-modal-container.is-dragging { will-change: left, top; }\n .floating-modal-drag-handle {\n position: absolute; left: 50%; transform: translateX(-50%);\n top: 5px; width: calc(100% - 46px); min-width: 166px; height: 17px;\n z-index: 9999; transition: left 0.2s ease, right 0.2s ease;\n display: flex; justify-content: center; align-items: center;\n }\n .floating-modal-drag-handle svg g { fill: #A0A0A0; }\n .floating-modal-drag-handle:hover { cursor: grab; }\n .floating-modal-drag-handle:hover svg g { fill: #1f2937; }\n .floating-modal-drag-handle.is-dragging { cursor: grabbing; }\n .floating-modal-drag-handle.is-collapsed { top: 0px; }\n .frame-floating-modal { width: 100%; height: 100%; background: white; border: none; display: block; }\n ")
|
|
52054
52055
|
}, document.head);
|
|
52055
52056
|
};
|
|
52056
|
-
|
|
52057
|
+
var getRecordIdFromUrl = function (recordRegex, log) {
|
|
52057
52058
|
var _a;
|
|
52058
|
-
|
|
52059
|
-
|
|
52060
|
-
|
|
52059
|
+
if (log === void 0) { log = function () { }; }
|
|
52060
|
+
var match = window.location.href.match(recordRegex);
|
|
52061
|
+
var recordId = (_a = match === null || match === void 0 ? void 0 : match[1]) !== null && _a !== void 0 ? _a : null;
|
|
52062
|
+
log("[predict] recordId found: ".concat(recordId));
|
|
52061
52063
|
return recordId;
|
|
52062
52064
|
};
|
|
52063
|
-
|
|
52065
|
+
var safeStringify = function (value, fallback) {
|
|
52064
52066
|
try {
|
|
52065
52067
|
return JSON.stringify(value);
|
|
52066
52068
|
}
|
|
@@ -52068,21 +52070,22 @@ const safeStringify = (value, fallback) => {
|
|
|
52068
52070
|
return fallback !== null && fallback !== void 0 ? fallback : '';
|
|
52069
52071
|
}
|
|
52070
52072
|
};
|
|
52071
|
-
|
|
52073
|
+
var safeParse = function (value, fallback, log) {
|
|
52074
|
+
if (log === void 0) { log = function () { }; }
|
|
52072
52075
|
try {
|
|
52073
52076
|
return JSON.parse(value);
|
|
52074
52077
|
}
|
|
52075
52078
|
catch (error) {
|
|
52076
|
-
log(
|
|
52079
|
+
log("[predict] JSON parse error: ".concat(error));
|
|
52077
52080
|
return fallback;
|
|
52078
52081
|
}
|
|
52079
52082
|
};
|
|
52080
|
-
|
|
52081
|
-
|
|
52082
|
-
|
|
52083
|
+
var buildQueryParams = function (params) {
|
|
52084
|
+
var urlParams = new URLSearchParams();
|
|
52085
|
+
var entries = Object.entries(params);
|
|
52083
52086
|
urlParams.set('pluginVersion', pluginVersion);
|
|
52084
|
-
for (
|
|
52085
|
-
|
|
52087
|
+
for (var i = 0; i < entries.length; i++) {
|
|
52088
|
+
var _a = entries[i], key = _a[0], value = _a[1];
|
|
52086
52089
|
if (value != null) {
|
|
52087
52090
|
urlParams.set(key, typeof value === 'object' ? safeStringify(value) : String(value));
|
|
52088
52091
|
}
|
|
@@ -52090,17 +52093,17 @@ const buildQueryParams = (params) => {
|
|
|
52090
52093
|
return urlParams.toString();
|
|
52091
52094
|
};
|
|
52092
52095
|
// ----- Drag & Drop -----
|
|
52093
|
-
|
|
52094
|
-
|
|
52095
|
-
|
|
52096
|
-
|
|
52097
|
-
|
|
52098
|
-
|
|
52099
|
-
|
|
52100
|
-
|
|
52101
|
-
|
|
52102
|
-
|
|
52103
|
-
|
|
52096
|
+
var setupDragAndDrop = function (handle, container) {
|
|
52097
|
+
var isDragging = false;
|
|
52098
|
+
var hasMoved = false;
|
|
52099
|
+
var isCollapsed = false;
|
|
52100
|
+
var startX = 0;
|
|
52101
|
+
var startY = 0;
|
|
52102
|
+
var initialLeft = 0;
|
|
52103
|
+
var initialTop = 0;
|
|
52104
|
+
var rafId = null;
|
|
52105
|
+
var iframe = container.querySelector('iframe');
|
|
52106
|
+
var onMouseDown = function (e) {
|
|
52104
52107
|
if (e.button !== 0)
|
|
52105
52108
|
return;
|
|
52106
52109
|
e.preventDefault();
|
|
@@ -52110,35 +52113,35 @@ const setupDragAndDrop = (handle, container) => {
|
|
|
52110
52113
|
container.classList.add('is-dragging');
|
|
52111
52114
|
if (iframe)
|
|
52112
52115
|
iframe.style.pointerEvents = 'none';
|
|
52113
|
-
|
|
52116
|
+
var rect = container.getBoundingClientRect();
|
|
52114
52117
|
initialLeft = rect.left;
|
|
52115
52118
|
initialTop = rect.top;
|
|
52116
|
-
container.style.left =
|
|
52119
|
+
container.style.left = "".concat(initialLeft, "px");
|
|
52117
52120
|
container.style.right = 'auto';
|
|
52118
52121
|
startX = e.clientX;
|
|
52119
52122
|
startY = e.clientY;
|
|
52120
52123
|
document.addEventListener('mousemove', onMouseMove);
|
|
52121
52124
|
document.addEventListener('mouseup', onMouseUp);
|
|
52122
52125
|
};
|
|
52123
|
-
|
|
52126
|
+
var onMouseMove = function (e) {
|
|
52124
52127
|
if (!isDragging)
|
|
52125
52128
|
return;
|
|
52126
|
-
|
|
52127
|
-
|
|
52129
|
+
var deltaX = e.clientX - startX;
|
|
52130
|
+
var deltaY = e.clientY - startY;
|
|
52128
52131
|
if (Math.abs(deltaX) > DRAG_THRESHOLD || Math.abs(deltaY) > DRAG_THRESHOLD) {
|
|
52129
52132
|
hasMoved = true;
|
|
52130
52133
|
}
|
|
52131
52134
|
if (rafId)
|
|
52132
52135
|
cancelAnimationFrame(rafId);
|
|
52133
|
-
rafId = requestAnimationFrame(()
|
|
52134
|
-
|
|
52135
|
-
|
|
52136
|
-
|
|
52137
|
-
container.style.left =
|
|
52138
|
-
container.style.top =
|
|
52136
|
+
rafId = requestAnimationFrame(function () {
|
|
52137
|
+
var rect = container.getBoundingClientRect();
|
|
52138
|
+
var newLeft = Math.max(0, Math.min(initialLeft + deltaX, window.innerWidth - rect.width));
|
|
52139
|
+
var newTop = Math.max(0, Math.min(initialTop + deltaY, window.innerHeight - rect.height));
|
|
52140
|
+
container.style.left = "".concat(newLeft, "px");
|
|
52141
|
+
container.style.top = "".concat(newTop, "px");
|
|
52139
52142
|
});
|
|
52140
52143
|
};
|
|
52141
|
-
|
|
52144
|
+
var onMouseUp = function (e) {
|
|
52142
52145
|
var _a;
|
|
52143
52146
|
if (!isDragging)
|
|
52144
52147
|
return;
|
|
@@ -52156,12 +52159,12 @@ const setupDragAndDrop = (handle, container) => {
|
|
|
52156
52159
|
(_a = iframe === null || iframe === void 0 ? void 0 : iframe.contentWindow) === null || _a === void 0 ? void 0 : _a.postMessage({ type: 'TRIGGER_EXPAND' }, PREDICT_BASE_URL);
|
|
52157
52160
|
}
|
|
52158
52161
|
};
|
|
52159
|
-
handle.setCollapsedState = (collapsed)
|
|
52162
|
+
handle.setCollapsedState = function (collapsed) {
|
|
52160
52163
|
isCollapsed = collapsed;
|
|
52161
52164
|
handle.classList.toggle('is-collapsed', collapsed);
|
|
52162
52165
|
};
|
|
52163
52166
|
handle.addEventListener('mousedown', onMouseDown);
|
|
52164
|
-
handle.cleanup = ()
|
|
52167
|
+
handle.cleanup = function () {
|
|
52165
52168
|
handle.removeEventListener('mousedown', onMouseDown);
|
|
52166
52169
|
document.removeEventListener('mousemove', onMouseMove);
|
|
52167
52170
|
document.removeEventListener('mouseup', onMouseUp);
|
|
@@ -52171,12 +52174,13 @@ const setupDragAndDrop = (handle, container) => {
|
|
|
52171
52174
|
return handle;
|
|
52172
52175
|
};
|
|
52173
52176
|
// ----- Explanation Iframe Creation -----
|
|
52174
|
-
|
|
52175
|
-
var
|
|
52176
|
-
|
|
52177
|
-
|
|
52178
|
-
|
|
52179
|
-
|
|
52177
|
+
var createExplanationIframe = function (_a) {
|
|
52178
|
+
var _b;
|
|
52179
|
+
var analysisId = _a.analysisId, recordId = _a.recordId, configuration = _a.configuration;
|
|
52180
|
+
var frameId = "frameExplanation-".concat(analysisId);
|
|
52181
|
+
(_b = $(frameId)) === null || _b === void 0 ? void 0 : _b.remove();
|
|
52182
|
+
var base = "".concat(PREDICT_BASE_URL, "/external/analysis/").concat(analysisId, "/prediction/drilldown/").concat(recordId);
|
|
52183
|
+
var params = buildQueryParams(configuration);
|
|
52180
52184
|
createElement('iframe', {
|
|
52181
52185
|
id: frameId,
|
|
52182
52186
|
className: 'frame-explanation',
|
|
@@ -52184,28 +52188,24 @@ const createExplanationIframe = ({ analysisId, recordId, configuration }) => {
|
|
|
52184
52188
|
loading: 'lazy',
|
|
52185
52189
|
referrerPolicy: 'strict-origin-when-cross-origin',
|
|
52186
52190
|
allowFullscreen: true,
|
|
52187
|
-
src:
|
|
52191
|
+
src: "".concat(base, "?").concat(params)
|
|
52188
52192
|
}, document.body);
|
|
52189
52193
|
};
|
|
52190
52194
|
// ----- Floating Modal Creation -----
|
|
52191
|
-
|
|
52192
|
-
var
|
|
52193
|
-
|
|
52194
|
-
|
|
52195
|
-
|
|
52196
|
-
|
|
52197
|
-
|
|
52198
|
-
|
|
52195
|
+
var createFloatingModal = function (_a) {
|
|
52196
|
+
var _b;
|
|
52197
|
+
var recordId = _a.recordId, configuration = _a.configuration;
|
|
52198
|
+
var flatIds = (_b = configuration.analysisIds) === null || _b === void 0 ? void 0 : _b.flat(Infinity);
|
|
52199
|
+
for (var i = 0; i < flatIds.length; i++) {
|
|
52200
|
+
createExplanationIframe({ analysisId: flatIds[i], recordId: recordId, configuration: configuration });
|
|
52201
|
+
}
|
|
52202
|
+
var container = createElement('div', { id: 'floatingModalContainer', className: 'floating-modal-container' }, document.body);
|
|
52203
|
+
var dragHandle = createElement('div', {
|
|
52199
52204
|
className: 'floating-modal-drag-handle',
|
|
52200
|
-
innerHTML:
|
|
52201
|
-
<g fill="#EBEBEB">
|
|
52202
|
-
<circle cx="3.33" cy="6" r="1.5"/><circle cx="8" cy="6" r="1.5"/><circle cx="12.67" cy="6" r="1.5"/>
|
|
52203
|
-
<circle cx="3.33" cy="10" r="1.5"/><circle cx="8" cy="10" r="1.5"/><circle cx="12.67" cy="10" r="1.5"/>
|
|
52204
|
-
</g>
|
|
52205
|
-
</svg>`
|
|
52205
|
+
innerHTML: "<svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" xmlns=\"http://www.w3.org/2000/svg\">\n <g fill=\"#EBEBEB\">\n <circle cx=\"3.33\" cy=\"6\" r=\"1.5\"/><circle cx=\"8\" cy=\"6\" r=\"1.5\"/><circle cx=\"12.67\" cy=\"6\" r=\"1.5\"/>\n <circle cx=\"3.33\" cy=\"10\" r=\"1.5\"/><circle cx=\"8\" cy=\"10\" r=\"1.5\"/><circle cx=\"12.67\" cy=\"10\" r=\"1.5\"/>\n </g>\n </svg>"
|
|
52206
52206
|
}, container);
|
|
52207
|
-
|
|
52208
|
-
|
|
52207
|
+
var baseUrl = "".concat(PREDICT_BASE_URL, "/external/analysis/prediction/summary/").concat(recordId);
|
|
52208
|
+
var params = buildQueryParams(configuration);
|
|
52209
52209
|
createElement('iframe', {
|
|
52210
52210
|
id: 'frameFloatingModal',
|
|
52211
52211
|
className: 'frame-floating-modal',
|
|
@@ -52213,133 +52213,136 @@ const createFloatingModal = ({ recordId, configuration }) => {
|
|
|
52213
52213
|
referrerPolicy: 'strict-origin-when-cross-origin',
|
|
52214
52214
|
allowFullscreen: true,
|
|
52215
52215
|
title: 'Floating Modal',
|
|
52216
|
-
src:
|
|
52216
|
+
src: "".concat(baseUrl, "?").concat(params)
|
|
52217
52217
|
}, container);
|
|
52218
52218
|
container.dragHandle = setupDragAndDrop(dragHandle, container);
|
|
52219
|
-
return ()
|
|
52219
|
+
return function () {
|
|
52220
52220
|
var _a, _b;
|
|
52221
52221
|
(_b = (_a = container.dragHandle) === null || _a === void 0 ? void 0 : _a.cleanup) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
52222
52222
|
container.remove();
|
|
52223
|
-
for (
|
|
52224
|
-
|
|
52223
|
+
for (var i = 0; i < flatIds.length; i++) {
|
|
52224
|
+
var frame = $("frameExplanation-".concat(flatIds[i]));
|
|
52225
52225
|
if (frame)
|
|
52226
52226
|
frame.remove();
|
|
52227
52227
|
}
|
|
52228
52228
|
};
|
|
52229
52229
|
};
|
|
52230
|
-
|
|
52231
|
-
|
|
52232
|
-
|
|
52230
|
+
var setupMessageListener = function (_a) {
|
|
52231
|
+
var token = _a.token, forceAccountId = _a.forceAccountId, cleanup = _a.cleanup, pendo = _a.pendo;
|
|
52232
|
+
var messageHandler = function (_a) {
|
|
52233
|
+
var _b;
|
|
52234
|
+
var origin = _a.origin, data = _a.data;
|
|
52233
52235
|
if (origin !== PREDICT_BASE_URL || !data || typeof data !== 'object')
|
|
52234
52236
|
return;
|
|
52235
|
-
|
|
52236
|
-
|
|
52237
|
-
|
|
52238
|
-
|
|
52237
|
+
var _c = data, type = _c.type, analysisId = _c.analysisId, height = _c.height, width = _c.width;
|
|
52238
|
+
var explanationFrame = $("frameExplanation-".concat(analysisId));
|
|
52239
|
+
var floatingModal = $('floatingModalContainer');
|
|
52240
|
+
var setFloatingModalSize = function () {
|
|
52239
52241
|
if (floatingModal) {
|
|
52240
|
-
floatingModal.style.height =
|
|
52241
|
-
floatingModal.style.width =
|
|
52242
|
+
floatingModal.style.height = "".concat(height, "px");
|
|
52243
|
+
floatingModal.style.width = "".concat(width, "px");
|
|
52242
52244
|
}
|
|
52243
52245
|
};
|
|
52244
|
-
|
|
52246
|
+
var setFloatingModalCollapsedState = function (collapsed) {
|
|
52245
52247
|
var _a, _b;
|
|
52246
52248
|
if (floatingModal)
|
|
52247
52249
|
(_b = (_a = floatingModal.dragHandle) === null || _a === void 0 ? void 0 : _a.setCollapsedState) === null || _b === void 0 ? void 0 : _b.call(_a, collapsed);
|
|
52248
52250
|
};
|
|
52249
|
-
|
|
52250
|
-
MODAL_INITIALIZED: ()
|
|
52251
|
+
var actions = {
|
|
52252
|
+
MODAL_INITIALIZED: function () {
|
|
52251
52253
|
var _a, _b, _c;
|
|
52252
|
-
|
|
52254
|
+
var iframe = $('frameFloatingModal');
|
|
52253
52255
|
if (iframe) {
|
|
52254
|
-
|
|
52255
|
-
|
|
52256
|
-
|
|
52256
|
+
var idToken = null;
|
|
52257
|
+
var extensionAPIKeys = null;
|
|
52258
|
+
var retrieveIDPToken = pendo.getConfigValue('retrieveIDPToken');
|
|
52257
52259
|
if (pendo._.isFunction(retrieveIDPToken)) {
|
|
52258
|
-
|
|
52260
|
+
var result = retrieveIDPToken();
|
|
52259
52261
|
if (result) {
|
|
52260
52262
|
idToken = result.idToken;
|
|
52261
52263
|
extensionAPIKeys = result.extensionAPIKeys;
|
|
52262
52264
|
}
|
|
52263
52265
|
}
|
|
52264
|
-
|
|
52265
|
-
|
|
52266
|
-
(_c = iframe.contentWindow) === null || _c === void 0 ? void 0 : _c.postMessage({ type: 'TOKEN_RECEIVED', token, idToken, extensionAPIKeys, visitorId, accountId }, PREDICT_BASE_URL);
|
|
52266
|
+
var visitorId = (_a = pendo === null || pendo === void 0 ? void 0 : pendo.getVisitorId) === null || _a === void 0 ? void 0 : _a.call(pendo);
|
|
52267
|
+
var accountId = forceAccountId !== null && forceAccountId !== void 0 ? forceAccountId : (_b = pendo === null || pendo === void 0 ? void 0 : pendo.getAccountId) === null || _b === void 0 ? void 0 : _b.call(pendo);
|
|
52268
|
+
(_c = iframe.contentWindow) === null || _c === void 0 ? void 0 : _c.postMessage({ type: 'TOKEN_RECEIVED', token: token, idToken: idToken, extensionAPIKeys: extensionAPIKeys, visitorId: visitorId, accountId: accountId }, PREDICT_BASE_URL);
|
|
52267
52269
|
}
|
|
52268
52270
|
},
|
|
52269
|
-
OPEN_EXPLANATION: ()
|
|
52271
|
+
OPEN_EXPLANATION: function () {
|
|
52270
52272
|
var _a;
|
|
52271
52273
|
explanationFrame === null || explanationFrame === void 0 ? void 0 : explanationFrame.classList.add('is-visible');
|
|
52272
52274
|
(_a = explanationFrame === null || explanationFrame === void 0 ? void 0 : explanationFrame.contentWindow) === null || _a === void 0 ? void 0 : _a.postMessage(data, PREDICT_BASE_URL);
|
|
52273
52275
|
},
|
|
52274
|
-
CLOSE_EXPLANATION: ()
|
|
52275
|
-
AUTH_ERROR_EXPLANATION: ()
|
|
52276
|
+
CLOSE_EXPLANATION: function () { return explanationFrame === null || explanationFrame === void 0 ? void 0 : explanationFrame.classList.remove('is-visible'); },
|
|
52277
|
+
AUTH_ERROR_EXPLANATION: function () {
|
|
52276
52278
|
explanationFrame === null || explanationFrame === void 0 ? void 0 : explanationFrame.classList.remove('is-visible');
|
|
52277
|
-
|
|
52279
|
+
var iframe = $('frameFloatingModal');
|
|
52278
52280
|
// eslint-disable-next-line no-self-assign
|
|
52279
52281
|
if (iframe)
|
|
52280
52282
|
iframe.src = iframe.src;
|
|
52281
52283
|
},
|
|
52282
|
-
DATA_READY: ()
|
|
52284
|
+
DATA_READY: function () {
|
|
52283
52285
|
floatingModal === null || floatingModal === void 0 ? void 0 : floatingModal.classList.add('is-visible');
|
|
52284
52286
|
setFloatingModalSize();
|
|
52285
52287
|
// Use analysisIds from the message data if available, otherwise use all IDs
|
|
52286
|
-
|
|
52287
|
-
for (
|
|
52288
|
-
|
|
52288
|
+
var idsToShow = data.analysisIds || [];
|
|
52289
|
+
for (var i = 0; i < idsToShow.length; i++) {
|
|
52290
|
+
var frame = $("frameExplanation-".concat(idsToShow[i]));
|
|
52289
52291
|
if (frame)
|
|
52290
52292
|
frame.classList.add('is-exists');
|
|
52291
52293
|
}
|
|
52292
52294
|
},
|
|
52293
|
-
AUTH_ERROR: ()
|
|
52295
|
+
AUTH_ERROR: function () {
|
|
52294
52296
|
floatingModal === null || floatingModal === void 0 ? void 0 : floatingModal.classList.add('is-visible');
|
|
52295
52297
|
setFloatingModalSize();
|
|
52296
52298
|
},
|
|
52297
52299
|
CLOSE_FLOATING_MODAL: cleanup,
|
|
52298
|
-
EXPAND_FLOATING_MODAL: ()
|
|
52300
|
+
EXPAND_FLOATING_MODAL: function () {
|
|
52299
52301
|
setFloatingModalSize();
|
|
52300
52302
|
setFloatingModalCollapsedState(false);
|
|
52301
52303
|
},
|
|
52302
|
-
COLLAPSE_FLOATING_MODAL: ()
|
|
52304
|
+
COLLAPSE_FLOATING_MODAL: function () {
|
|
52303
52305
|
setFloatingModalSize();
|
|
52304
52306
|
setFloatingModalCollapsedState(true);
|
|
52305
52307
|
}
|
|
52306
52308
|
};
|
|
52307
52309
|
if (type && type in actions) {
|
|
52308
|
-
(
|
|
52310
|
+
(_b = actions === null || actions === void 0 ? void 0 : actions[type]) === null || _b === void 0 ? void 0 : _b.call(actions);
|
|
52309
52311
|
}
|
|
52310
52312
|
};
|
|
52311
52313
|
window.addEventListener('message', messageHandler);
|
|
52312
|
-
return ()
|
|
52314
|
+
return function () { return window.removeEventListener('message', messageHandler); };
|
|
52313
52315
|
};
|
|
52314
|
-
|
|
52315
|
-
var
|
|
52316
|
+
var predictGuidesScript = function (_a) {
|
|
52317
|
+
var _b;
|
|
52318
|
+
var step = _a.step, pendo = _a.pendo, cleanupArray = _a.cleanupArray, cleanup = _a.cleanup, log = _a.log;
|
|
52316
52319
|
log('[predict] initializing');
|
|
52317
52320
|
// Before anything else, inject styles so that the guide will be hidden
|
|
52318
|
-
|
|
52321
|
+
var pendoContainerId = step === null || step === void 0 ? void 0 : step.containerId;
|
|
52319
52322
|
injectStyles(pendoContainerId, log);
|
|
52320
52323
|
if (cleanupArray.length > 0) {
|
|
52321
52324
|
log('[predict] cleanupArray is not empty');
|
|
52322
52325
|
return;
|
|
52323
52326
|
}
|
|
52324
52327
|
// ----- Extract Configuration -----
|
|
52325
|
-
|
|
52328
|
+
var guideButton = (_b = step.guideElement.find(GUIDE_BUTTON_IDENTIFIER)) === null || _b === void 0 ? void 0 : _b[0];
|
|
52326
52329
|
if (!guideButton) {
|
|
52327
52330
|
log('[predict] no guide button found, aborting');
|
|
52328
52331
|
return;
|
|
52329
52332
|
}
|
|
52330
|
-
|
|
52333
|
+
var _c = safeParse(guideButton.textContent, {}, log), token = _c.token, configuration = __rest(_c, ["token"]);
|
|
52331
52334
|
if (!configuration || !token) {
|
|
52332
52335
|
log('[predict] no configuration found, aborting');
|
|
52333
52336
|
return;
|
|
52334
52337
|
}
|
|
52335
|
-
|
|
52336
|
-
|
|
52338
|
+
var recordRegex = new RegExp("/".concat(configuration.recordRegexName, "/([a-zA-Z0-9]+)(?:/|$)"));
|
|
52339
|
+
var recordId = getRecordIdFromUrl(recordRegex, log);
|
|
52337
52340
|
if (!recordId) {
|
|
52338
52341
|
log('[predict] no recordId found in URL, aborting');
|
|
52339
52342
|
return;
|
|
52340
52343
|
}
|
|
52341
|
-
cleanupArray.push(setupMessageListener({ token, forceAccountId: configuration === null || configuration === void 0 ? void 0 : configuration.forceAccountId, cleanup, pendo }));
|
|
52342
|
-
cleanupArray.push(createFloatingModal({ recordId, configuration }));
|
|
52344
|
+
cleanupArray.push(setupMessageListener({ token: token, forceAccountId: configuration === null || configuration === void 0 ? void 0 : configuration.forceAccountId, cleanup: cleanup, pendo: pendo }));
|
|
52345
|
+
cleanupArray.push(createFloatingModal({ recordId: recordId, configuration: configuration }));
|
|
52343
52346
|
};
|
|
52344
52347
|
|
|
52345
52348
|
const PredictGuides = () => {
|