@pendo/agent 2.321.2 → 2.322.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -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.321.2_';
3971
- let PACKAGE_VERSION = '2.321.2';
3970
+ let VERSION = '2.322.1_';
3971
+ let PACKAGE_VERSION = '2.322.1';
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) {
@@ -28384,12 +28384,22 @@ function registerPlugin(plugin) {
28384
28384
  }
28385
28385
  registeredPlugins.push(plugin);
28386
28386
  if (initialized$1) {
28387
- plugin.initialize(pendo$1, PluginAPI);
28387
+ try {
28388
+ plugin.initialize(pendo$1, PluginAPI);
28389
+ }
28390
+ catch (error) {
28391
+ log.error(`Error initializing plugin ${plugin.name}:`, error);
28392
+ }
28388
28393
  }
28389
28394
  }
28390
28395
  function initializePlugins() {
28391
28396
  _.each(registeredPlugins, function (plugin) {
28392
- plugin.initialize(pendo$1, PluginAPI);
28397
+ try {
28398
+ plugin.initialize(pendo$1, PluginAPI);
28399
+ }
28400
+ catch (error) {
28401
+ log.error(`Error initializing plugin ${plugin.name}:`, error);
28402
+ }
28393
28403
  });
28394
28404
  initialized$1 = true;
28395
28405
  return teardownPlugins;
@@ -28397,7 +28407,12 @@ function initializePlugins() {
28397
28407
  function teardownPlugins() {
28398
28408
  _.each(registeredPlugins, function (plugin) {
28399
28409
  if (_.isFunction(plugin.teardown)) {
28400
- plugin.teardown(pendo$1, PluginAPI);
28410
+ try {
28411
+ plugin.teardown(pendo$1, PluginAPI);
28412
+ }
28413
+ catch (error) {
28414
+ log.error(`Error tearing down plugin ${plugin.name}:`, error);
28415
+ }
28401
28416
  }
28402
28417
  });
28403
28418
  initialized$1 = false;
@@ -28405,7 +28420,12 @@ function teardownPlugins() {
28405
28420
  function validatePlugins(skipLogging) {
28406
28421
  return _.map(registeredPlugins, function (plugin) {
28407
28422
  if (plugin.validate && !skipLogging) {
28408
- plugin.validate(pendo$1, PluginAPI);
28423
+ try {
28424
+ plugin.validate(pendo$1, PluginAPI);
28425
+ }
28426
+ catch (error) {
28427
+ log.error(`Error validating plugin ${plugin.name}:`, error);
28428
+ }
28409
28429
  }
28410
28430
  return plugin.name;
28411
28431
  });
@@ -35469,11 +35489,8 @@ var DesignerConnect = (function () {
35469
35489
  globalPendo.log(pendo.app_name + ': listening to messages');
35470
35490
  window.addEventListener('message', messageReceiver, false);
35471
35491
  }
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
35492
  globalPendo.onConnectMessage = onConnectMessage; // Designer still uses this in selection.js
35493
+ pluginAPI.Events.ready.on(onReady);
35477
35494
  }
35478
35495
  function teardown() {
35479
35496
  removeListeners();
@@ -35488,6 +35505,13 @@ var DesignerConnect = (function () {
35488
35505
  if (tempLaunchToken) {
35489
35506
  tempLaunchToken = undefined;
35490
35507
  }
35508
+ pluginAPI.Events.ready.off(onReady);
35509
+ }
35510
+ function onReady() {
35511
+ if (window.opener && globalPendo._.isFunction(window.opener.postMessage)) {
35512
+ const designerTargetOrigin = globalPendo.getConfigValue('secureDesignerConnect') ? DESIGNER_SERVER : '*';
35513
+ window.opener.postMessage({ type: 'pendo::ready' }, designerTargetOrigin);
35514
+ }
35491
35515
  }
35492
35516
  function onConnectMessage(data, msg) {
35493
35517
  if (!globalPendo.designer) {
@@ -35536,6 +35560,10 @@ var DesignerConnect = (function () {
35536
35560
  var token = msg.data.token;
35537
35561
  if (!token)
35538
35562
  return;
35563
+ if (token.publicAppId && token.publicAppId !== globalPendo.publicAppId) {
35564
+ 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.`);
35565
+ return;
35566
+ }
35539
35567
  tempLaunchToken = token;
35540
35568
  registerMessageHandler('pendo-designer-launch::get-token', sendToken);
35541
35569
  var defaultLaunchBucket = token.DADesigner ? 'da-designer' : 'in-app-designer';
@@ -40770,20 +40798,20 @@ function getZoneSafeMethod(_, method, target) {
40770
40798
  }
40771
40799
 
40772
40800
  // Does not support submit and go to
40773
- const goToRegex = new RegExp(guideMarkdownUtil.goToString);
40774
- const PollBranching = {
40801
+ var goToRegex = new RegExp(guideMarkdownUtil.goToString);
40802
+ var PollBranching = {
40775
40803
  name: 'PollBranching',
40776
- script(step, guide, pendo) {
40777
- let isAdvanceIntercepted = false;
40778
- const branchingQuestions = initialBranchingSetup(step, pendo);
40804
+ script: function (step, guide, pendo) {
40805
+ var isAdvanceIntercepted = false;
40806
+ var branchingQuestions = initialBranchingSetup(step, pendo);
40779
40807
  if (branchingQuestions) {
40780
40808
  // If there are too many branching questions saved, exit and run the guide normally.
40781
40809
  if (pendo._.size(branchingQuestions) > 1)
40782
40810
  return;
40783
- this.on('beforeAdvance', (evt) => {
40784
- const noResponseSelected = step.guideElement.find('[branching] .pendo-radio:checked').length === 0;
40785
- const responseLabel = step.guideElement.find('[branching] .pendo-radio:checked + label')[0];
40786
- let noGotoLabel;
40811
+ this.on('beforeAdvance', function (evt) {
40812
+ var noResponseSelected = step.guideElement.find('[branching] .pendo-radio:checked').length === 0;
40813
+ var responseLabel = step.guideElement.find('[branching] .pendo-radio:checked + label')[0];
40814
+ var noGotoLabel;
40787
40815
  if (responseLabel) {
40788
40816
  noGotoLabel = pendo._.isNull(responseLabel.getAttribute('goToStep'));
40789
40817
  }
@@ -40794,58 +40822,58 @@ const PollBranching = {
40794
40822
  });
40795
40823
  }
40796
40824
  },
40797
- test(step, guide, pendo) {
40825
+ test: function (step, guide, pendo) {
40798
40826
  var _a;
40799
- let branchingQuestions = (_a = step.guideElement) === null || _a === void 0 ? void 0 : _a.find('._pendo-multi-choice-poll-question:contains("{branching/}")');
40827
+ var branchingQuestions = (_a = step.guideElement) === null || _a === void 0 ? void 0 : _a.find('._pendo-multi-choice-poll-question:contains("{branching/}")');
40800
40828
  return !pendo._.isUndefined(branchingQuestions) && pendo._.size(branchingQuestions);
40801
40829
  },
40802
- designerListener(pendo) {
40803
- const target = pendo.dom.getBody();
40804
- const config = {
40830
+ designerListener: function (pendo) {
40831
+ var target = pendo.dom.getBody();
40832
+ var config = {
40805
40833
  attributeFilter: ['data-layout'],
40806
40834
  attributes: true,
40807
40835
  childList: true,
40808
40836
  characterData: true,
40809
40837
  subtree: true
40810
40838
  };
40811
- const MutationObserver = getZoneSafeMethod(pendo._, 'MutationObserver');
40812
- const observer = new MutationObserver(applyBranchingIndicators);
40839
+ var MutationObserver = getZoneSafeMethod(pendo._, 'MutationObserver');
40840
+ var observer = new MutationObserver(applyBranchingIndicators);
40813
40841
  observer.observe(target, config);
40814
40842
  function applyBranchingIndicators(mutations) {
40815
40843
  pendo._.each(mutations, function (mutation) {
40816
40844
  var _a;
40817
- const nodeHasQuerySelector = pendo._.isFunction((_a = mutation.addedNodes[0]) === null || _a === void 0 ? void 0 : _a.querySelector);
40845
+ var nodeHasQuerySelector = pendo._.isFunction((_a = mutation.addedNodes[0]) === null || _a === void 0 ? void 0 : _a.querySelector);
40818
40846
  if (mutation.addedNodes.length && nodeHasQuerySelector) {
40819
40847
  if (mutation.addedNodes[0].querySelector('._pendo-multi-choice-poll-select-border')) {
40820
40848
  if (pendo._.size(pendo.dom('._pendo-multi-choice-poll-question:contains("{branching/}")'))) {
40821
40849
  pendo
40822
40850
  .dom('._pendo-multi-choice-poll-question:contains("{branching/}")')
40823
- .each((question, index) => {
40824
- pendo._.each(pendo.dom(`#${question.id} *`), (element) => {
40851
+ .each(function (question, index) {
40852
+ pendo._.each(pendo.dom("#".concat(question.id, " *")), function (element) {
40825
40853
  guideMarkdownUtil.removeMarkdownSyntax(element, '{branching/}', '', pendo);
40826
40854
  });
40827
40855
  pendo
40828
- .dom(`#${question.id} p`)
40856
+ .dom("#".concat(question.id, " p"))
40829
40857
  .css({ display: 'inline-block !important' })
40830
40858
  .append(branchingIcon('#999', '20px'))
40831
40859
  .attr({ title: 'Custom Branching Added' });
40832
- let dataPendoPollId = question.getAttribute('data-pendo-poll-id');
40833
- if (pendo.dom(`._pendo-multi-choice-poll-question[data-pendo-poll-id=${dataPendoPollId}]`)[0]) {
40860
+ var dataPendoPollId = question.getAttribute('data-pendo-poll-id');
40861
+ if (pendo.dom("._pendo-multi-choice-poll-question[data-pendo-poll-id=".concat(dataPendoPollId, "]"))[0]) {
40834
40862
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
40835
40863
  pendo
40836
- .dom(`._pendo-multi-choice-poll-question[data-pendo-poll-id=${dataPendoPollId}]`)[0]
40864
+ .dom("._pendo-multi-choice-poll-question[data-pendo-poll-id=".concat(dataPendoPollId, "]"))[0]
40837
40865
  .textContent.trim();
40838
40866
  }
40839
- let pollLabels = pendo.dom(`label[for*=${dataPendoPollId}]`);
40867
+ var pollLabels = pendo.dom("label[for*=".concat(dataPendoPollId, "]"));
40840
40868
  if (pendo._.size(pollLabels)) {
40841
- pendo._.forEach(pollLabels, (label) => {
40869
+ pendo._.forEach(pollLabels, function (label) {
40842
40870
  if (goToRegex.test(label.textContent)) {
40843
- let labelTitle = goToRegex.exec(label.textContent)[2];
40871
+ var labelTitle = goToRegex.exec(label.textContent)[2];
40844
40872
  guideMarkdownUtil.removeMarkdownSyntax(label, goToRegex, '', pendo);
40845
40873
  pendo
40846
40874
  .dom(label)
40847
40875
  .append(branchingIcon('#999', '14px'))
40848
- .attr({ title: `Branching to step ${labelTitle}` });
40876
+ .attr({ title: "Branching to step ".concat(labelTitle) });
40849
40877
  }
40850
40878
  });
40851
40879
  }
@@ -40853,9 +40881,9 @@ const PollBranching = {
40853
40881
  pendo
40854
40882
  .dom(question)
40855
40883
  .append(branchingErrorHTML(question.dataset.pendoPollId));
40856
- pendo.dom(`#${question.id} #pendo-ps-branching-svg`).remove();
40884
+ pendo.dom("#".concat(question.id, " #pendo-ps-branching-svg")).remove();
40857
40885
  pendo
40858
- .dom(`#${question.id} p`)
40886
+ .dom("#".concat(question.id, " p"))
40859
40887
  .css({ display: 'inline-block !important' })
40860
40888
  .append(branchingIcon('red', '20px'))
40861
40889
  .attr({ title: 'Unsupported Branching configuration' });
@@ -40867,49 +40895,31 @@ const PollBranching = {
40867
40895
  });
40868
40896
  }
40869
40897
  function branchingErrorHTML(dataPendoPollId) {
40870
- return `<div style="text-align:lrft; font-size: 14px; color: red;
40871
- font-style: italic; margin-top: 0px;" class="branching-wrapper"
40872
- name="${dataPendoPollId}">
40873
- * Branching Error: Multiple branching polls not supported</div>`;
40898
+ 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>");
40874
40899
  }
40875
40900
  function branchingIcon(color, size) {
40876
- return `<svg id="pendo-ps-branching-svg" viewBox="0 0 24 24" fill="none"
40877
- style="margin-left: 5px;
40878
- height:${size}; width:${size}; display:inline; vertical-align:middle;" xmlns="http://www.w3.org/2000/svg">
40879
- <g stroke-width="0"></g>
40880
- <g stroke-linecap="round" stroke-linejoin="round"></g>
40881
- <g> <circle cx="4" cy="7" r="2" stroke="${color}"
40882
- stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></circle>
40883
- <circle cx="20" cy="7" r="2" stroke="${color}"
40884
- stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></circle>
40885
- <circle cx="20" cy="17" r="2" stroke="${color}" stroke-width="2"
40886
- stroke-linecap="round" stroke-linejoin="round"></circle>
40887
- <path d="M18 7H6" stroke="${color}" stroke-width="2"
40888
- stroke-linecap="round" stroke-linejoin="round"></path>
40889
- <path d="M7 7V7C8.65685 7 10 8.34315 10 10V15C10 16.1046 10.8954 17 12 17H18"
40890
- stroke="${color}" stroke-width="2" stroke-linecap="round"
40891
- stroke-linejoin="round"></path> </g></svg>`;
40901
+ 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>");
40892
40902
  }
40893
40903
  }
40894
40904
  };
40895
40905
  function initialBranchingSetup(step, pendo) {
40896
- const questions = step.guideElement.find('._pendo-multi-choice-poll-question:contains("{branching/}")');
40897
- pendo._.forEach(questions, (question) => {
40898
- let dataPendoPollId = question.getAttribute('data-pendo-poll-id');
40899
- pendo._.each(step.guideElement.find(`#${question.id} *`), (element) => {
40906
+ var questions = step.guideElement.find('._pendo-multi-choice-poll-question:contains("{branching/}")');
40907
+ pendo._.forEach(questions, function (question) {
40908
+ var dataPendoPollId = question.getAttribute('data-pendo-poll-id');
40909
+ pendo._.each(step.guideElement.find("#".concat(question.id, " *")), function (element) {
40900
40910
  guideMarkdownUtil.removeMarkdownSyntax(element, '{branching/}', '', pendo);
40901
40911
  });
40902
- let pollLabels = step.guideElement.find(`label[for*=${dataPendoPollId}]`);
40903
- pendo._.forEach(pollLabels, (label) => {
40912
+ var pollLabels = step.guideElement.find("label[for*=".concat(dataPendoPollId, "]"));
40913
+ pendo._.forEach(pollLabels, function (label) {
40904
40914
  if (pendo._.isNull(goToRegex.exec(label.textContent))) {
40905
40915
  return;
40906
40916
  }
40907
- let gotoSubstring = goToRegex.exec(label.textContent)[1];
40908
- let gotoIndex = goToRegex.exec(label.textContent)[2];
40917
+ var gotoSubstring = goToRegex.exec(label.textContent)[1];
40918
+ var gotoIndex = goToRegex.exec(label.textContent)[2];
40909
40919
  label.setAttribute('goToStep', gotoIndex);
40910
40920
  guideMarkdownUtil.removeMarkdownSyntax(label, gotoSubstring, '', pendo);
40911
40921
  });
40912
- let pollChoiceContainer = step.guideElement.find(`[data-pendo-poll-id=${dataPendoPollId}]._pendo-multi-choice-poll-select-border`);
40922
+ var pollChoiceContainer = step.guideElement.find("[data-pendo-poll-id=".concat(dataPendoPollId, "]._pendo-multi-choice-poll-select-border"));
40913
40923
  if (pollChoiceContainer && pollChoiceContainer.length) {
40914
40924
  pollChoiceContainer[0].setAttribute('branching', '');
40915
40925
  }
@@ -40918,24 +40928,24 @@ function initialBranchingSetup(step, pendo) {
40918
40928
  }
40919
40929
  function branchingGoToStep(event, step, guide, pendo) {
40920
40930
  var _a;
40921
- let checkedPollInputId = (_a = step.guideElement.find('[branching] input.pendo-radio[data-pendo-poll-id]:checked')[0]) === null || _a === void 0 ? void 0 : _a.id;
40922
- let checkedPollLabel = step.guideElement.find(`label[for="${checkedPollInputId}"]`)[0];
40923
- let checkedPollLabelStepIndex = checkedPollLabel === null || checkedPollLabel === void 0 ? void 0 : checkedPollLabel.getAttribute('goToStep');
40924
- let pollStepIndex = checkedPollLabelStepIndex - 1;
40931
+ var checkedPollInputId = (_a = step.guideElement.find('[branching] input.pendo-radio[data-pendo-poll-id]:checked')[0]) === null || _a === void 0 ? void 0 : _a.id;
40932
+ var checkedPollLabel = step.guideElement.find("label[for=\"".concat(checkedPollInputId, "\"]"))[0];
40933
+ var checkedPollLabelStepIndex = checkedPollLabel === null || checkedPollLabel === void 0 ? void 0 : checkedPollLabel.getAttribute('goToStep');
40934
+ var pollStepIndex = checkedPollLabelStepIndex - 1;
40925
40935
  if (pollStepIndex < 0)
40926
40936
  return;
40927
- const destinationObject = {
40937
+ var destinationObject = {
40928
40938
  destinationStepId: guide.steps[pollStepIndex].id,
40929
- step
40939
+ step: step
40930
40940
  };
40931
40941
  pendo.goToStep(destinationObject);
40932
40942
  event.cancel = true;
40933
40943
  }
40934
40944
 
40935
- const MetadataSubstitution = {
40945
+ var MetadataSubstitution = {
40936
40946
  name: 'MetadataSubstitution',
40937
- script(step, guide, pendo) {
40938
- const placeholderData = findSubstitutableElements(pendo);
40947
+ script: function (step, guide, pendo) {
40948
+ var placeholderData = findSubstitutableElements(pendo);
40939
40949
  if (step.domJson) {
40940
40950
  findSubstitutableUrlsInJson(step.domJson, placeholderData, pendo);
40941
40951
  }
@@ -40943,22 +40953,22 @@ const MetadataSubstitution = {
40943
40953
  pendo._.each(placeholderData, function (placeholder) {
40944
40954
  processPlaceholder(placeholder, pendo);
40945
40955
  });
40946
- const containerId = `pendo-g-${step.id}`;
40947
- const context = step.guideElement;
40948
- updateGuideContainer(containerId, context, pendo);
40956
+ var containerId = "pendo-g-".concat(step.id);
40957
+ var context_1 = step.guideElement;
40958
+ updateGuideContainer(containerId, context_1, pendo);
40949
40959
  }
40950
40960
  },
40951
- designerListener(pendo) {
40952
- const target = pendo.dom.getBody();
40961
+ designerListener: function (pendo) {
40962
+ var target = pendo.dom.getBody();
40953
40963
  if (pendo.designerv2) {
40954
40964
  pendo.designerv2.runMetadataSubstitutionForDesignerPreview = function runMetadataSubstitutionForDesignerPreview() {
40955
40965
  var _a;
40956
40966
  if (!document.querySelector(guideMarkdownUtil.containerSelector))
40957
40967
  return;
40958
- const step = (_a = pendo.designerv2.currentlyPreviewedGuide) === null || _a === void 0 ? void 0 : _a.steps[0];
40968
+ var step = (_a = pendo.designerv2.currentlyPreviewedGuide) === null || _a === void 0 ? void 0 : _a.steps[0];
40959
40969
  if (!step)
40960
40970
  return;
40961
- const placeholderData = findSubstitutableElements(pendo);
40971
+ var placeholderData = findSubstitutableElements(pendo);
40962
40972
  if (step.buildingBlocks) {
40963
40973
  findSubstitutableUrlsInJson(step.buildingBlocks, placeholderData, pendo);
40964
40974
  }
@@ -40968,32 +40978,32 @@ const MetadataSubstitution = {
40968
40978
  return;
40969
40979
  processPlaceholder(placeholder, pendo);
40970
40980
  });
40971
- const containerId = `pendo-g-${step.id}`;
40972
- const context = step.guideElement;
40973
- updateGuideContainer(containerId, context, pendo);
40981
+ var containerId = "pendo-g-".concat(step.id);
40982
+ var context_2 = step.guideElement;
40983
+ updateGuideContainer(containerId, context_2, pendo);
40974
40984
  }
40975
40985
  };
40976
40986
  }
40977
- const config = {
40987
+ var config = {
40978
40988
  attributeFilter: ['data-layout'],
40979
40989
  attributes: true,
40980
40990
  childList: true,
40981
40991
  characterData: true,
40982
40992
  subtree: true
40983
40993
  };
40984
- const MutationObserver = getZoneSafeMethod(pendo._, 'MutationObserver');
40985
- const observer = new MutationObserver(applySubstitutionIndicators);
40994
+ var MutationObserver = getZoneSafeMethod(pendo._, 'MutationObserver');
40995
+ var observer = new MutationObserver(applySubstitutionIndicators);
40986
40996
  observer.observe(target, config);
40987
40997
  function applySubstitutionIndicators(mutations) {
40988
40998
  pendo._.each(mutations, function (mutation) {
40989
40999
  var _a;
40990
41000
  if (mutation.addedNodes.length) {
40991
41001
  if (document.querySelector(guideMarkdownUtil.containerSelector)) {
40992
- const placeholderData = findSubstitutableElements(pendo);
40993
- const step = (_a = pendo.designerv2.currentlyPreviewedGuide) === null || _a === void 0 ? void 0 : _a.steps[0];
41002
+ var placeholderData = findSubstitutableElements(pendo);
41003
+ var step = (_a = pendo.designerv2.currentlyPreviewedGuide) === null || _a === void 0 ? void 0 : _a.steps[0];
40994
41004
  if (!step)
40995
41005
  return;
40996
- const pendoBlocks = step.buildingBlocks;
41006
+ var pendoBlocks = step.buildingBlocks;
40997
41007
  if (!pendo._.isUndefined(pendoBlocks)) {
40998
41008
  findSubstitutableUrlsInJson(pendoBlocks, placeholderData, pendo);
40999
41009
  }
@@ -41003,9 +41013,9 @@ const MetadataSubstitution = {
41003
41013
  return;
41004
41014
  processPlaceholder(placeholder, pendo);
41005
41015
  });
41006
- const containerId = `pendo-g-${step.id}`;
41007
- const context = step.guideElement;
41008
- updateGuideContainer(containerId, context, pendo);
41016
+ var containerId = "pendo-g-".concat(step.id);
41017
+ var context_3 = step.guideElement;
41018
+ updateGuideContainer(containerId, context_3, pendo);
41009
41019
  }
41010
41020
  }
41011
41021
  }
@@ -41014,18 +41024,18 @@ const MetadataSubstitution = {
41014
41024
  }
41015
41025
  };
41016
41026
  function processPlaceholder(placeholder, pendo) {
41017
- let match;
41018
- const { data, target } = placeholder;
41019
- const subRegex = new RegExp(guideMarkdownUtil.substitutionRegex);
41027
+ var match;
41028
+ var data = placeholder.data, target = placeholder.target;
41029
+ var subRegex = new RegExp(guideMarkdownUtil.substitutionRegex);
41020
41030
  while ((match = matchPlaceholder(placeholder, subRegex))) {
41021
- const usedArrayPath = Array.isArray(match) && match.length >= 2;
41022
- const currentStr = target === 'textContent'
41031
+ var usedArrayPath = Array.isArray(match) && match.length >= 2;
41032
+ var currentStr = target === 'textContent'
41023
41033
  ? data[target]
41024
41034
  : decodeURI((data.getAttribute && (target === 'href' || target === 'value') ? (data.getAttribute(target) || '') : data[target]));
41025
- const matched = usedArrayPath ? match : subRegex.exec(currentStr);
41035
+ var matched = usedArrayPath ? match : subRegex.exec(currentStr);
41026
41036
  if (!matched)
41027
41037
  continue;
41028
- const mdValue = getSubstituteValue(matched, pendo);
41038
+ var mdValue = getSubstituteValue(matched, pendo);
41029
41039
  substituteMetadataByTarget(data, target, mdValue, matched);
41030
41040
  }
41031
41041
  }
@@ -41034,48 +41044,48 @@ function matchPlaceholder(placeholder, regex) {
41034
41044
  return placeholder.data[placeholder.target].match(regex);
41035
41045
  }
41036
41046
  else {
41037
- const raw = placeholder.data.getAttribute && (placeholder.target === 'href' || placeholder.target === 'value')
41047
+ var raw = placeholder.data.getAttribute && (placeholder.target === 'href' || placeholder.target === 'value')
41038
41048
  ? (placeholder.data.getAttribute(placeholder.target) || '')
41039
41049
  : placeholder.data[placeholder.target];
41040
41050
  return decodeURI(raw).match(regex);
41041
41051
  }
41042
41052
  }
41043
41053
  function getMetadataValueCaseInsensitive(metadata, type, property) {
41044
- const kind = metadata && metadata[type];
41054
+ var kind = metadata && metadata[type];
41045
41055
  if (!kind || typeof kind !== 'object')
41046
41056
  return undefined;
41047
- const direct = Object.prototype.hasOwnProperty.call(kind, property) ? kind[property] : undefined;
41057
+ var direct = Object.prototype.hasOwnProperty.call(kind, property) ? kind[property] : undefined;
41048
41058
  if (direct !== undefined) {
41049
41059
  return direct;
41050
41060
  }
41051
- const propLower = property.toLowerCase();
41052
- const key = Object.keys(kind).find(k => k.toLowerCase() === propLower);
41053
- const value = key !== undefined ? kind[key] : undefined;
41061
+ var propLower = property.toLowerCase();
41062
+ var key = Object.keys(kind).find(function (k) { return k.toLowerCase() === propLower; });
41063
+ var value = key !== undefined ? kind[key] : undefined;
41054
41064
  return value;
41055
41065
  }
41056
41066
  function getSubstituteValue(match, pendo) {
41057
41067
  if (pendo._.isUndefined(match[1]) || pendo._.isUndefined(match[2])) {
41058
41068
  return;
41059
41069
  }
41060
- let type = match[1];
41061
- let property = match[2];
41062
- let defaultValue = match[3];
41070
+ var type = match[1];
41071
+ var property = match[2];
41072
+ var defaultValue = match[3];
41063
41073
  if (pendo._.isUndefined(type) || pendo._.isUndefined(property)) {
41064
41074
  return;
41065
41075
  }
41066
- const metadata = pendo.getSerializedMetadata();
41067
- let mdValue = getMetadataValueCaseInsensitive(metadata, type, property);
41076
+ var metadata = pendo.getSerializedMetadata();
41077
+ var mdValue = getMetadataValueCaseInsensitive(metadata, type, property);
41068
41078
  if (mdValue === undefined || mdValue === null)
41069
41079
  mdValue = defaultValue || '';
41070
41080
  return mdValue;
41071
41081
  }
41072
41082
  function substituteMetadataByTarget(data, target, mdValue, matched) {
41073
- const isElement = data && typeof data.getAttribute === 'function';
41074
- const current = (target === 'href' || target === 'value') && isElement
41083
+ var isElement = data && typeof data.getAttribute === 'function';
41084
+ var current = (target === 'href' || target === 'value') && isElement
41075
41085
  ? (data.getAttribute(target) || '')
41076
41086
  : data[target];
41077
41087
  if (target === 'href' || target === 'value') {
41078
- const safeValue = window.encodeURIComponent(String(mdValue === undefined || mdValue === null ? '' : mdValue));
41088
+ var safeValue = window.encodeURIComponent(String(mdValue === undefined || mdValue === null ? '' : mdValue));
41079
41089
  data[target] = decodeURI(current).replace(matched[0], safeValue);
41080
41090
  }
41081
41091
  else {
@@ -41089,8 +41099,9 @@ function updateGuideContainer(containerId, context, pendo) {
41089
41099
  pendo.flexElement(pendo.dom(guideMarkdownUtil.containerSelector));
41090
41100
  pendo.BuildingBlocks.BuildingBlockGuides.recalculateGuideHeight(containerId, context);
41091
41101
  }
41092
- function findSubstitutableUrlsInJson(originalData, placeholderData = [], pendo) {
41093
- const subRegex = new RegExp(guideMarkdownUtil.substitutionRegex);
41102
+ function findSubstitutableUrlsInJson(originalData, placeholderData, pendo) {
41103
+ if (placeholderData === void 0) { placeholderData = []; }
41104
+ var subRegex = new RegExp(guideMarkdownUtil.substitutionRegex);
41094
41105
  if ((originalData.name === 'url' || originalData.name === 'href') && originalData.value) {
41095
41106
  if (subRegex.test(originalData.value)) {
41096
41107
  placeholderData.push({
@@ -41100,37 +41111,37 @@ function findSubstitutableUrlsInJson(originalData, placeholderData = [], pendo)
41100
41111
  }
41101
41112
  }
41102
41113
  if (originalData.properties && originalData.id === 'href_link_block') {
41103
- pendo._.each(originalData.properties, (prop) => {
41114
+ pendo._.each(originalData.properties, function (prop) {
41104
41115
  findSubstitutableUrlsInJson(prop, placeholderData, pendo);
41105
41116
  });
41106
41117
  }
41107
41118
  if (originalData.views) {
41108
- pendo._.each(originalData.views, (view) => {
41119
+ pendo._.each(originalData.views, function (view) {
41109
41120
  findSubstitutableUrlsInJson(view, placeholderData, pendo);
41110
41121
  });
41111
41122
  }
41112
41123
  if (originalData.parameters) {
41113
- pendo._.each(originalData.parameters, (param) => {
41124
+ pendo._.each(originalData.parameters, function (param) {
41114
41125
  findSubstitutableUrlsInJson(param, placeholderData, pendo);
41115
41126
  });
41116
41127
  }
41117
41128
  if (originalData.actions) {
41118
- pendo._.each(originalData.actions, (action) => {
41129
+ pendo._.each(originalData.actions, function (action) {
41119
41130
  findSubstitutableUrlsInJson(action, placeholderData, pendo);
41120
41131
  });
41121
41132
  }
41122
41133
  if (originalData.children) {
41123
- pendo._.each(originalData.children, (child) => {
41134
+ pendo._.each(originalData.children, function (child) {
41124
41135
  findSubstitutableUrlsInJson(child, placeholderData, pendo);
41125
41136
  });
41126
41137
  }
41127
41138
  return placeholderData;
41128
41139
  }
41129
41140
  function findSubstitutableElements(pendo) {
41130
- let elements = pendo.dom(`${guideMarkdownUtil.containerSelector} *:not(.pendo-inline-ui)`);
41141
+ var elements = pendo.dom("".concat(guideMarkdownUtil.containerSelector, " *:not(.pendo-inline-ui)"));
41131
41142
  return pendo._.chain(elements)
41132
41143
  .filter(function (placeholder) {
41133
- const subRegex = new RegExp(guideMarkdownUtil.substitutionRegex);
41144
+ var subRegex = new RegExp(guideMarkdownUtil.substitutionRegex);
41134
41145
  if (placeholder.localName === 'a') {
41135
41146
  return subRegex.test(decodeURI(placeholder.href)) || subRegex.test(placeholder.textContent);
41136
41147
  }
@@ -41186,51 +41197,25 @@ function findSubstitutableElements(pendo) {
41186
41197
  .value();
41187
41198
  }
41188
41199
  function substitutionIcon(color, size) {
41189
- return (`<div title="Metadata Substitution added">
41190
- <svg id="pendo-ps-substitution-icon" viewBox="0 0 24 24"
41191
- preserveAspectRatio="xMidYMid meet"
41192
- height=${size} width=${size} title="Metadata Substitution"
41193
- style="bottom:5px; right:10px; position: absolute;"
41194
- fill="none" xmlns="http://www.w3.org/2000/svg" stroke="${color}"
41195
- transform="matrix(1, 0, 0, 1, 0, 0)rotate(0)">
41196
- <g stroke-width="0"></g>
41197
- <g stroke-linecap="round" stroke-linejoin="round"
41198
- stroke="${color}" stroke-width="0.528"></g>
41199
- <g><path fill-rule="evenodd" clip-rule="evenodd"
41200
- d="M5 5.5C4.17157 5.5 3.5 6.17157 3.5 7V10C3.5 10.8284
41201
- 4.17157 11.5 5 11.5H8C8.82843 11.5 9.5 10.8284 9.5
41202
- 10V9H17V11C17 11.2761 17.2239 11.5 17.5 11.5C17.7761
41203
- 11.5 18 11.2761 18 11V8.5C18 8.22386 17.7761 8 17.5
41204
- 8H9.5V7C9.5 6.17157 8.82843 5.5 8 5.5H5ZM8.5 7C8.5
41205
- 6.72386 8.27614 6.5 8 6.5H5C4.72386 6.5 4.5 6.72386
41206
- 4.5 7V10C4.5 10.2761 4.72386 10.5 5 10.5H8C8.27614
41207
- 10.5 8.5 10.2761 8.5 10V7Z" fill="${color}"></path>
41208
- <path fill-rule="evenodd" clip-rule="evenodd"
41209
- d="M7 13C7 12.7239 6.77614 12.5 6.5 12.5C6.22386 12.5
41210
- 6 12.7239 6 13V15.5C6 15.7761 6.22386 16 6.5
41211
- 16H14.5V17C14.5 17.8284 15.1716 18.5 16 18.5H19C19.8284
41212
- 18.5 20.5 17.8284 20.5 17V14C20.5 13.1716 19.8284 12.5
41213
- 19 12.5H16C15.1716 12.5 14.5 13.1716 14.5
41214
- 14V15H7V13ZM15.5 17C15.5 17.2761 15.7239 17.5 16
41215
- 17.5H19C19.2761 17.5 19.5 17.2761 19.5 17V14C19.5
41216
- 13.7239 19.2761 13.5 19 13.5H16C15.7239 13.5 15.5
41217
- 13.7239 15.5 14V17Z" fill="${color}"></path> </g></svg></div>`);
41218
- }
41219
-
41220
- const requiredElement = '<span class="_pendo-required-indicator" style="color:red; font-style:italic;" title="Question is required"> *</span>';
41221
- const requiredSyntax = '{required/}';
41222
- const RequiredQuestions = {
41200
+ 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>"));
41201
+ }
41202
+
41203
+ var requiredElement = '<span class="_pendo-required-indicator" style="color:red; font-style:italic;" title="Question is required"> *</span>';
41204
+ var requiredSyntax = '{required/}';
41205
+ var RequiredQuestions = {
41223
41206
  name: 'RequiredQuestions',
41224
- script(step, guide, pendo) {
41207
+ script: function (step, guide, pendo) {
41225
41208
  var _a;
41226
- let requiredPollIds = [];
41227
- let submitButtons = (_a = guideMarkdownUtil.lookupGuideButtons(step.domJson)) === null || _a === void 0 ? void 0 : _a.filter(button => button.actions.find(action => action.action === 'submitPoll' || action.action === 'submitPollAndGoToStep'));
41228
- const requiredQuestions = processRequiredQuestions();
41209
+ var requiredPollIds = [];
41210
+ var submitButtons = (_a = guideMarkdownUtil.lookupGuideButtons(step.domJson)) === null || _a === void 0 ? void 0 : _a.filter(function (button) {
41211
+ return button.actions.find(function (action) { return action.action === 'submitPoll' || action.action === 'submitPollAndGoToStep'; });
41212
+ });
41213
+ var requiredQuestions = processRequiredQuestions();
41229
41214
  if (requiredQuestions) {
41230
- pendo._.forEach(requiredQuestions, (question) => {
41215
+ pendo._.forEach(requiredQuestions, function (question) {
41231
41216
  if (question.classList.contains('_pendo-open-text-poll-question')) {
41232
- let pollId = question.dataset.pendoPollId;
41233
- step.attachEvent(step.guideElement.find(`[data-pendo-poll-id=${pollId}]._pendo-open-text-poll-input`)[0], 'input', function () {
41217
+ var pollId = question.dataset.pendoPollId;
41218
+ step.attachEvent(step.guideElement.find("[data-pendo-poll-id=".concat(pollId, "]._pendo-open-text-poll-input"))[0], 'input', function () {
41234
41219
  evaluateRequiredQuestions(requiredQuestions);
41235
41220
  });
41236
41221
  }
@@ -41242,8 +41227,8 @@ const RequiredQuestions = {
41242
41227
  });
41243
41228
  }
41244
41229
  function getEligibleQuestions() {
41245
- const allQuestions = step.guideElement.find(`[class*=-poll-question]:contains(${requiredSyntax})`);
41246
- return pendo._.reduce(allQuestions, (eligibleQuestions, question) => {
41230
+ var allQuestions = step.guideElement.find("[class*=-poll-question]:contains(".concat(requiredSyntax, ")"));
41231
+ return pendo._.reduce(allQuestions, function (eligibleQuestions, question) {
41247
41232
  if (question.classList.contains('_pendo-yes-no-poll-question'))
41248
41233
  return eligibleQuestions;
41249
41234
  eligibleQuestions.push(question);
@@ -41251,27 +41236,19 @@ const RequiredQuestions = {
41251
41236
  }, []);
41252
41237
  }
41253
41238
  function processRequiredQuestions() {
41254
- let questions = getEligibleQuestions();
41239
+ var questions = getEligibleQuestions();
41255
41240
  if (questions) {
41256
- pendo._.forEach(questions, question => {
41257
- let dataPendoPollId = question.getAttribute('data-pendo-poll-id');
41241
+ pendo._.forEach(questions, function (question) {
41242
+ var dataPendoPollId = question.getAttribute('data-pendo-poll-id');
41258
41243
  requiredPollIds.push(dataPendoPollId);
41259
- pendo._.each(step.guideElement.find(`#${question.id} *, #${question.id}`), (element) => {
41244
+ pendo._.each(step.guideElement.find("#".concat(question.id, " *, #").concat(question.id)), function (element) {
41260
41245
  guideMarkdownUtil.removeMarkdownSyntax(element, requiredSyntax, '', pendo);
41261
41246
  });
41262
- step.guideElement.find(`#${question.id} p`).append(requiredElement);
41247
+ step.guideElement.find("#".concat(question.id, " p")).append(requiredElement);
41263
41248
  });
41264
41249
  }
41265
41250
  if (pendo._.size(requiredPollIds)) {
41266
- const disabledButtonStyles = `<style type=text/css
41267
- id=_pendo-guide-required-disabled>
41268
- ._pendo-button:disabled, ._pendo-buttons[disabled] {
41269
- border: 1px solid #999999 !important;
41270
- background-color: #cccccc !important;
41271
- color: #666666 !important;
41272
- pointer-events: none !important;
41273
- }
41274
- </style>`;
41251
+ 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>";
41275
41252
  if (pendo.dom('#_pendo-guide-required-disabled').length === 0) {
41276
41253
  pendo.dom('head').append(disabledButtonStyles);
41277
41254
  }
@@ -41282,15 +41259,11 @@ const RequiredQuestions = {
41282
41259
  function evaluateRequiredQuestions(questions) {
41283
41260
  if (questions.length === 0)
41284
41261
  return;
41285
- let allRequiredComplete = true;
41286
- let responses = [];
41287
- responses = responses.concat(pendo._.map(questions, (question) => {
41288
- let pollId = question.getAttribute('data-pendo-poll-id');
41289
- let input = step.guideElement.find(`
41290
- [data-pendo-poll-id=${pollId}] textarea,
41291
- [data-pendo-poll-id=${pollId}] input:text,
41292
- [data-pendo-poll-id=${pollId}] select,
41293
- [data-pendo-poll-id=${pollId}] input:radio:checked`);
41262
+ var allRequiredComplete = true;
41263
+ var responses = [];
41264
+ responses = responses.concat(pendo._.map(questions, function (question) {
41265
+ var pollId = question.getAttribute('data-pendo-poll-id');
41266
+ 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"));
41294
41267
  if (input && input.length && input[0].value) {
41295
41268
  return input[0].value;
41296
41269
  }
@@ -41307,48 +41280,48 @@ const RequiredQuestions = {
41307
41280
  }
41308
41281
  function disableEligibleButtons(buttons) {
41309
41282
  pendo._.each(buttons, function (button) {
41310
- if (step.guideElement.find(`#${button.props.id}`)[0]) {
41311
- step.guideElement.find(`#${button.props.id}`)[0].disabled = true;
41312
- step.guideElement.find(`#${button.props.id}`)[0].parentElement.title = 'Please complete all required questions.';
41283
+ if (step.guideElement.find("#".concat(button.props.id))[0]) {
41284
+ step.guideElement.find("#".concat(button.props.id))[0].disabled = true;
41285
+ step.guideElement.find("#".concat(button.props.id))[0].parentElement.title = 'Please complete all required questions.';
41313
41286
  }
41314
41287
  });
41315
41288
  }
41316
41289
  function enableEligibleButtons(buttons) {
41317
41290
  pendo._.each(buttons, function (button) {
41318
- if (step.guideElement.find(`#${button.props.id}`)[0]) {
41319
- step.guideElement.find(`#${button.props.id}`)[0].disabled = false;
41320
- step.guideElement.find(`#${button.props.id}`)[0].parentElement.title = '';
41291
+ if (step.guideElement.find("#".concat(button.props.id))[0]) {
41292
+ step.guideElement.find("#".concat(button.props.id))[0].disabled = false;
41293
+ step.guideElement.find("#".concat(button.props.id))[0].parentElement.title = '';
41321
41294
  }
41322
41295
  });
41323
41296
  }
41324
41297
  },
41325
- test(step, guide, pendo) {
41298
+ test: function (step, guide, pendo) {
41326
41299
  var _a;
41327
- let requiredQuestions = (_a = step.guideElement) === null || _a === void 0 ? void 0 : _a.find(`[class*=-poll-question]:contains(${requiredSyntax})`);
41300
+ var requiredQuestions = (_a = step.guideElement) === null || _a === void 0 ? void 0 : _a.find("[class*=-poll-question]:contains(".concat(requiredSyntax, ")"));
41328
41301
  return !pendo._.isUndefined(requiredQuestions) && pendo._.size(requiredQuestions);
41329
41302
  },
41330
- designerListener(pendo) {
41331
- const requiredQuestions = [];
41332
- const target = pendo.dom.getBody();
41333
- const config = {
41303
+ designerListener: function (pendo) {
41304
+ var requiredQuestions = [];
41305
+ var target = pendo.dom.getBody();
41306
+ var config = {
41334
41307
  attributeFilter: ['data-layout'],
41335
41308
  attributes: true,
41336
41309
  childList: true,
41337
41310
  characterData: true,
41338
41311
  subtree: true
41339
41312
  };
41340
- const MutationObserver = getZoneSafeMethod(pendo._, 'MutationObserver');
41341
- const observer = new MutationObserver(applyRequiredIndicators);
41313
+ var MutationObserver = getZoneSafeMethod(pendo._, 'MutationObserver');
41314
+ var observer = new MutationObserver(applyRequiredIndicators);
41342
41315
  observer.observe(target, config);
41343
41316
  function applyRequiredIndicators(mutations) {
41344
41317
  pendo._.each(mutations, function (mutation) {
41345
41318
  var _a;
41346
- const nodeHasQuerySelector = pendo._.isFunction((_a = mutation.addedNodes[0]) === null || _a === void 0 ? void 0 : _a.querySelectorAll);
41319
+ var nodeHasQuerySelector = pendo._.isFunction((_a = mutation.addedNodes[0]) === null || _a === void 0 ? void 0 : _a.querySelectorAll);
41347
41320
  if (mutation.addedNodes.length && nodeHasQuerySelector) {
41348
- let eligiblePolls = mutation.addedNodes[0].querySelectorAll('[class*=-poll-wrapper], [class*=-poll-select-border]');
41321
+ var eligiblePolls = mutation.addedNodes[0].querySelectorAll('[class*=-poll-wrapper], [class*=-poll-select-border]');
41349
41322
  if (eligiblePolls) {
41350
41323
  pendo._.each(eligiblePolls, function (poll) {
41351
- let dataPendoPollId;
41324
+ var dataPendoPollId;
41352
41325
  if (poll.classList.contains('_pendo-open-text-poll-wrapper') ||
41353
41326
  poll.classList.contains('_pendo-number-scale-poll-wrapper')) {
41354
41327
  dataPendoPollId = poll.getAttribute('name');
@@ -41356,27 +41329,27 @@ const RequiredQuestions = {
41356
41329
  else {
41357
41330
  dataPendoPollId = poll.getAttribute('data-pendo-poll-id');
41358
41331
  }
41359
- let questionText;
41360
- const pollQuesiton = pendo.dom(`[class*="-poll-question"][data-pendo-poll-id=${dataPendoPollId}]`)[0];
41332
+ var questionText;
41333
+ var pollQuesiton = pendo.dom("[class*=\"-poll-question\"][data-pendo-poll-id=".concat(dataPendoPollId, "]"))[0];
41361
41334
  if (pollQuesiton) {
41362
- questionText = pendo.dom(`[class*="-poll-question"][data-pendo-poll-id=${dataPendoPollId}]`)[0].textContent;
41335
+ questionText = pendo.dom("[class*=\"-poll-question\"][data-pendo-poll-id=".concat(dataPendoPollId, "]"))[0].textContent;
41363
41336
  }
41364
- const requiredSyntaxIndex = questionText.indexOf(requiredSyntax);
41337
+ var requiredSyntaxIndex = questionText.indexOf(requiredSyntax);
41365
41338
  if (requiredSyntaxIndex > -1) {
41366
- pendo._.each(pendo.dom(`[data-pendo-poll-id=${dataPendoPollId}]:not(.pendo-radio)`), (element) => {
41367
- pendo._.each(pendo.dom(`#${element.id} *:not(".pendo-radio"), #${element.id}:not(".pendo-radio")`), (item) => {
41339
+ pendo._.each(pendo.dom("[data-pendo-poll-id=".concat(dataPendoPollId, "]:not(.pendo-radio)")), function (element) {
41340
+ pendo._.each(pendo.dom("#".concat(element.id, " *:not(\".pendo-radio\"), #").concat(element.id, ":not(\".pendo-radio\")")), function (item) {
41368
41341
  guideMarkdownUtil.removeMarkdownSyntax(item, requiredSyntax, '', pendo);
41369
41342
  });
41370
41343
  });
41371
- if (pendo.dom(`.bb-text[data-pendo-poll-id=${dataPendoPollId}] p`).length !== 0 || pendo.dom(`.bb-text[data-pendo-poll-id=${dataPendoPollId}] li`).length !== 0) {
41372
- pendo.dom(`.bb-text[data-pendo-poll-id=${dataPendoPollId}] p`).append(requiredElement);
41373
- pendo.dom(`.bb-text[data-pendo-poll-id=${dataPendoPollId}] li`).append(requiredElement);
41344
+ 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) {
41345
+ pendo.dom(".bb-text[data-pendo-poll-id=".concat(dataPendoPollId, "] p")).append(requiredElement);
41346
+ pendo.dom(".bb-text[data-pendo-poll-id=".concat(dataPendoPollId, "] li")).append(requiredElement);
41374
41347
  }
41375
41348
  else {
41376
- pendo.dom(`.bb-text[data-pendo-poll-id=${dataPendoPollId}]`).append(requiredElement);
41349
+ pendo.dom(".bb-text[data-pendo-poll-id=".concat(dataPendoPollId, "]")).append(requiredElement);
41377
41350
  }
41378
41351
  if (pendo._.contains(requiredQuestions, dataPendoPollId)) {
41379
- let questionIndex = requiredQuestions.indexOf(dataPendoPollId);
41352
+ var questionIndex = requiredQuestions.indexOf(dataPendoPollId);
41380
41353
  if (questionIndex !== -1) {
41381
41354
  requiredQuestions.splice(questionIndex, 1);
41382
41355
  }
@@ -41387,7 +41360,7 @@ const RequiredQuestions = {
41387
41360
  }
41388
41361
  else {
41389
41362
  if (pendo._.contains(requiredQuestions, dataPendoPollId)) {
41390
- let index = requiredQuestions.indexOf(dataPendoPollId);
41363
+ var index = requiredQuestions.indexOf(dataPendoPollId);
41391
41364
  if (index !== -1) {
41392
41365
  requiredQuestions.splice(index, 1);
41393
41366
  }
@@ -41401,54 +41374,54 @@ const RequiredQuestions = {
41401
41374
  }
41402
41375
  };
41403
41376
 
41404
- const skipStepRegex = new RegExp(guideMarkdownUtil.skipStepString);
41405
- const SkipToEligibleStep = {
41406
- script(step, guide, pendo) {
41407
- let isAdvanceIntercepted = false;
41408
- let isPreviousIntercepted = false;
41409
- let guideContainer = step.guideElement.find(guideMarkdownUtil.containerSelector);
41410
- let guideContainerAriaLabel = guideContainer.attr('aria-label');
41411
- let stepNumberOrAuto = skipStepRegex.exec(guideContainerAriaLabel)[1];
41377
+ var skipStepRegex = new RegExp(guideMarkdownUtil.skipStepString);
41378
+ var SkipToEligibleStep = {
41379
+ script: function (step, guide, pendo) {
41380
+ var isAdvanceIntercepted = false;
41381
+ var isPreviousIntercepted = false;
41382
+ var guideContainer = step.guideElement.find(guideMarkdownUtil.containerSelector);
41383
+ var guideContainerAriaLabel = guideContainer.attr('aria-label');
41384
+ var stepNumberOrAuto = skipStepRegex.exec(guideContainerAriaLabel)[1];
41412
41385
  if (guideContainer) {
41413
41386
  guideContainer.attr({ 'aria-label': guideContainer.attr('aria-label').replace(skipStepRegex, '') });
41414
41387
  }
41415
- this.on('beforeAdvance', (evt) => {
41388
+ this.on('beforeAdvance', function (evt) {
41416
41389
  if (guide.getPositionOfStep(step) === guide.steps.length || pendo._.isUndefined(stepNumberOrAuto))
41417
41390
  return; // exit on the last step of a guide or when we don't have an argument
41418
- let eligibleStep = findEligibleSkipStep(stepNumberOrAuto, 'next');
41391
+ var eligibleStep = findEligibleSkipStep(stepNumberOrAuto, 'next');
41419
41392
  if (!isAdvanceIntercepted && stepNumberOrAuto) {
41420
41393
  isAdvanceIntercepted = true;
41421
- pendo.goToStep({ destinationStepId: eligibleStep.id, step });
41394
+ pendo.goToStep({ destinationStepId: eligibleStep.id, step: step });
41422
41395
  evt.cancel = true;
41423
41396
  }
41424
41397
  });
41425
- this.on('beforePrevious', (evt) => {
41398
+ this.on('beforePrevious', function (evt) {
41426
41399
  if (pendo._.isUndefined(stepNumberOrAuto))
41427
41400
  return;
41428
- let eligibleStep = findEligibleSkipStep(stepNumberOrAuto, 'previous');
41401
+ var eligibleStep = findEligibleSkipStep(stepNumberOrAuto, 'previous');
41429
41402
  if (!isPreviousIntercepted && stepNumberOrAuto) {
41430
41403
  isPreviousIntercepted = true;
41431
- pendo.goToStep({ destinationStepId: eligibleStep.id, step });
41404
+ pendo.goToStep({ destinationStepId: eligibleStep.id, step: step });
41432
41405
  evt.cancel = true;
41433
41406
  }
41434
41407
  });
41435
41408
  function findEligibleSkipStep(stepNumber, direction) {
41436
41409
  // Find the next eligible step by using getPosition of step (1 based)
41437
41410
  // getPosition - 2 gives the previous step
41438
- let skipForwardStep = findStepOnPage(guide.getPositionOfStep(step), 'next', stepNumber);
41439
- let skipPreviousStep = findStepOnPage(guide.getPositionOfStep(step) - 2, 'previous', stepNumber);
41411
+ var skipForwardStep = findStepOnPage(guide.getPositionOfStep(step), 'next', stepNumber);
41412
+ var skipPreviousStep = findStepOnPage(guide.getPositionOfStep(step) - 2, 'previous', stepNumber);
41440
41413
  if (skipForwardStep && direction == 'next') {
41441
- pendo.goToStep({ destinationStepId: skipForwardStep, step });
41414
+ pendo.goToStep({ destinationStepId: skipForwardStep, step: step });
41442
41415
  }
41443
41416
  if (skipPreviousStep && direction == 'previous') {
41444
- pendo.goToStep({ destinationStepId: skipPreviousStep, step });
41417
+ pendo.goToStep({ destinationStepId: skipPreviousStep, step: step });
41445
41418
  }
41446
41419
  return direction === 'next' ? skipForwardStep : skipPreviousStep;
41447
41420
  }
41448
41421
  function findStepOnPage(stepIndex, direction, stepNumber) {
41449
41422
  if (pendo._.isNaN(stepIndex))
41450
41423
  return;
41451
- let $step = guide.steps[stepIndex];
41424
+ var $step = guide.steps[stepIndex];
41452
41425
  if ($step && !$step.canShow()) {
41453
41426
  if (stepNumber !== 'auto') {
41454
41427
  return guide.steps[stepNumber - 1];
@@ -41465,34 +41438,34 @@ const SkipToEligibleStep = {
41465
41438
  }
41466
41439
  }
41467
41440
  },
41468
- test(step, guide, pendo) {
41441
+ test: function (step, guide, pendo) {
41469
41442
  var _a;
41470
- const guideContainerAriaLabel = (_a = step.guideElement) === null || _a === void 0 ? void 0 : _a.find(guideMarkdownUtil.containerSelector).attr('aria-label');
41443
+ var guideContainerAriaLabel = (_a = step.guideElement) === null || _a === void 0 ? void 0 : _a.find(guideMarkdownUtil.containerSelector).attr('aria-label');
41471
41444
  return pendo._.isString(guideContainerAriaLabel) && guideContainerAriaLabel.indexOf('{skipStep') !== -1;
41472
41445
  },
41473
- designerListener(pendo) {
41474
- const target = pendo.dom.getBody();
41475
- const config = {
41446
+ designerListener: function (pendo) {
41447
+ var target = pendo.dom.getBody();
41448
+ var config = {
41476
41449
  attributeFilter: ['data-layout'],
41477
41450
  attributes: true,
41478
41451
  childList: true,
41479
41452
  characterData: true,
41480
41453
  subtree: true
41481
41454
  };
41482
- const MutationObserver = getZoneSafeMethod(pendo._, 'MutationObserver');
41483
- const observer = new MutationObserver(applySkipStepIndicator);
41455
+ var MutationObserver = getZoneSafeMethod(pendo._, 'MutationObserver');
41456
+ var observer = new MutationObserver(applySkipStepIndicator);
41484
41457
  observer.observe(target, config);
41485
41458
  // create an observer instance
41486
41459
  function applySkipStepIndicator(mutations) {
41487
41460
  pendo._.each(mutations, function (mutation) {
41488
41461
  var _a, _b;
41489
- const nodeHasQuerySelector = pendo._.isFunction((_a = mutation.addedNodes[0]) === null || _a === void 0 ? void 0 : _a.querySelectorAll);
41462
+ var nodeHasQuerySelector = pendo._.isFunction((_a = mutation.addedNodes[0]) === null || _a === void 0 ? void 0 : _a.querySelectorAll);
41490
41463
  if (mutation.addedNodes.length && nodeHasQuerySelector) {
41491
- let guideContainer = mutation.addedNodes[0].querySelectorAll(guideMarkdownUtil.containerSelector);
41492
- let guideContainerAriaLabel = (_b = guideContainer[0]) === null || _b === void 0 ? void 0 : _b.getAttribute('aria-label');
41464
+ var guideContainer = mutation.addedNodes[0].querySelectorAll(guideMarkdownUtil.containerSelector);
41465
+ var guideContainerAriaLabel = (_b = guideContainer[0]) === null || _b === void 0 ? void 0 : _b.getAttribute('aria-label');
41493
41466
  if (guideContainerAriaLabel) {
41494
41467
  if (guideContainerAriaLabel.match(skipStepRegex)) {
41495
- let fullSkipStepString = guideContainerAriaLabel.match(skipStepRegex)[0];
41468
+ var fullSkipStepString = guideContainerAriaLabel.match(skipStepRegex)[0];
41496
41469
  guideContainerAriaLabel.replace(fullSkipStepString, '');
41497
41470
  if (!pendo.dom('#_pendoSkipIcon').length) {
41498
41471
  pendo.dom(guideMarkdownUtil.containerSelector).append(skipIcon('#999', '30px').trim());
@@ -41503,48 +41476,30 @@ const SkipToEligibleStep = {
41503
41476
  });
41504
41477
  }
41505
41478
  function skipIcon(color, size) {
41506
- return (`<div title="Skip step added"><svg id="_pendoSkipIcon" version="1.0" xmlns="http://www.w3.org/2000/svg"
41507
- width="${size}" height="${size}" viewBox="0 0 512.000000 512.000000"
41508
- preserveAspectRatio="xMidYMid meet" style="bottom:5px; right:10px; position: absolute;">
41509
- <g transform="translate(0.000000,512.000000) scale(0.100000,-0.100000)"
41510
- fill="${color}" stroke="none">
41511
- <path d="M2185 4469 c-363 -38 -739 -186 -1034 -407 -95 -71 -273 -243 -357
41512
- -343 -205 -246 -364 -577 -429 -897 -25 -121 -45 -288 -45 -373 l0 -49 160 0
41513
- 160 0 0 48 c0 26 5 88 10 137 68 593 417 1103 940 1374 1100 570 2418 -137
41514
- 2560 -1374 5 -49 10 -111 10 -137 l0 -47 -155 -3 -155 -3 235 -235 235 -236
41515
- 235 236 235 235 -155 3 -155 3 0 48 c0 27 -5 95 -10 152 -100 989 -878 1767
41516
- -1869 1868 -117 12 -298 12 -416 0z"/>
41517
- <path d="M320 1440 l0 -160 160 0 160 0 0 160 0 160 -160 0 -160 0 0 -160z"/>
41518
- <path d="M960 1440 l0 -160 160 0 160 0 0 160 0 160 -160 0 -160 0 0 -160z"/>
41519
- <path d="M1600 1440 l0 -160 160 0 160 0 0 160 0 160 -160 0 -160 0 0 -160z"/>
41520
- <path d="M2240 1440 l0 -160 160 0 160 0 0 160 0 160 -160 0 -160 0 0 -160z"/>
41521
- <path d="M2880 1440 l0 -160 160 0 160 0 0 160 0 160 -160 0 -160 0 0 -160z"/>
41522
- <path d="M3840 1440 l0 -160 480 0 480 0 0 160 0 160 -480 0 -480 0 0 -160z"/>
41523
- </g></svg></div>
41524
- `);
41479
+ 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 "));
41525
41480
  }
41526
41481
  }
41527
41482
  };
41528
41483
 
41529
41484
  function GuideMarkdown() {
41530
- let guideMarkdown;
41531
- let pluginApi;
41532
- let globalPendo;
41485
+ var guideMarkdown;
41486
+ var pluginApi;
41487
+ var globalPendo;
41533
41488
  return {
41534
41489
  name: 'GuideMarkdown',
41535
41490
  initialize: init,
41536
- teardown
41491
+ teardown: teardown
41537
41492
  };
41538
41493
  function init(pendo, PluginAPI) {
41539
41494
  globalPendo = pendo;
41540
41495
  pluginApi = PluginAPI;
41541
- const configReader = PluginAPI.ConfigReader;
41542
- const GUIDEMARKDOWN_CONFIG = 'guideMarkdown';
41496
+ var configReader = PluginAPI.ConfigReader;
41497
+ var GUIDEMARKDOWN_CONFIG = 'guideMarkdown';
41543
41498
  configReader.addOption(GUIDEMARKDOWN_CONFIG, [
41544
41499
  configReader.sources.SNIPPET_SRC,
41545
41500
  configReader.sources.PENDO_CONFIG_SRC
41546
41501
  ], false);
41547
- const markdownScriptsEnabled = configReader.get(GUIDEMARKDOWN_CONFIG);
41502
+ var markdownScriptsEnabled = configReader.get(GUIDEMARKDOWN_CONFIG);
41548
41503
  if (!markdownScriptsEnabled)
41549
41504
  return;
41550
41505
  guideMarkdown = [PollBranching, MetadataSubstitution, RequiredQuestions, SkipToEligibleStep];
@@ -42543,11 +42498,24 @@ function VocPortal() {
42543
42498
  }
42544
42499
  }`, container);
42545
42500
  resizePortalIframe();
42501
+ clampContainerToViewport(container);
42546
42502
  }
42547
42503
  catch (err) {
42548
42504
  pluginAPI.log.error('Error while adjusting RC module', err);
42549
42505
  }
42550
42506
  }
42507
+ function clampContainerToViewport(container) {
42508
+ if (!container)
42509
+ return;
42510
+ const leftPadding = 10;
42511
+ const rect = container.getBoundingClientRect();
42512
+ if (rect.left < leftPadding) {
42513
+ container.style.transform = `translateX(${leftPadding - rect.left}px)`;
42514
+ }
42515
+ else {
42516
+ container.style.transform = '';
42517
+ }
42518
+ }
42551
42519
  function teardown() {
42552
42520
  if (this.removeResizeEvent)
42553
42521
  this.removeResizeEvent();
@@ -42570,8 +42538,8 @@ function Feedback() {
42570
42538
  var widgetLoaded = false;
42571
42539
  var feedbackAllowedProductId = '';
42572
42540
  var initialized = false;
42573
- const PING_COOKIE = 'feedback_ping_sent';
42574
- const PING_COOKIE_EXPIRATION = 1000 * 60 * 60;
42541
+ var PING_COOKIE = 'feedback_ping_sent';
42542
+ var PING_COOKIE_EXPIRATION = 1000 * 60 * 60;
42575
42543
  var overflowMediaQuery = '@media only screen and (max-device-width:1112px){#feedback-widget{overflow-y:scroll}}';
42576
42544
  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%)}}';
42577
42545
  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)}}';
@@ -42591,28 +42559,28 @@ function Feedback() {
42591
42559
  feedbackStyles: 'pendo-feedback-styles',
42592
42560
  feedbackFrameStyles: 'pendo-feedback-visible-buttons-styles'
42593
42561
  };
42594
- let globalPendo;
42595
- let pluginApi;
42562
+ var globalPendo;
42563
+ var pluginApi;
42596
42564
  return {
42597
42565
  name: 'Feedback',
42598
- initialize,
42599
- teardown,
42600
- validate
42566
+ initialize: initialize,
42567
+ teardown: teardown,
42568
+ validate: validate
42601
42569
  };
42602
42570
  function initialize(pendo, PluginAPI) {
42603
42571
  globalPendo = pendo;
42604
42572
  pluginApi = PluginAPI;
42605
42573
  var publicFeedback = {
42606
- ping,
42607
- init,
42574
+ ping: ping,
42575
+ init: init,
42608
42576
  initialized: getInitialized,
42609
- loginAndRedirect,
42610
- openFeedback,
42611
- initializeFeedbackOnce,
42612
- isFeedbackLoaded,
42613
- convertPendoToFeedbackOptions,
42577
+ loginAndRedirect: loginAndRedirect,
42578
+ openFeedback: openFeedback,
42579
+ initializeFeedbackOnce: initializeFeedbackOnce,
42580
+ isFeedbackLoaded: isFeedbackLoaded,
42581
+ convertPendoToFeedbackOptions: convertPendoToFeedbackOptions,
42614
42582
  isUnsupportedIE: pendo._.partial(isUnsupportedIE, PluginAPI),
42615
- removeFeedbackWidget
42583
+ removeFeedbackWidget: removeFeedbackWidget
42616
42584
  };
42617
42585
  pendo.feedback = publicFeedback;
42618
42586
  pendo.getFeedbackSettings = getFeedbackSettings;
@@ -42640,7 +42608,7 @@ function Feedback() {
42640
42608
  */
42641
42609
  PluginAPI.agentStorage.registry.addLocal(PING_COOKIE, { duration: PING_COOKIE_EXPIRATION });
42642
42610
  return {
42643
- validate
42611
+ validate: validate
42644
42612
  };
42645
42613
  }
42646
42614
  function teardown() {
@@ -42660,18 +42628,18 @@ function Feedback() {
42660
42628
  return result;
42661
42629
  }
42662
42630
  function pingOrInitialize() {
42663
- const options = getPendoOptions();
42631
+ var options = getPendoOptions();
42664
42632
  if (initialized) {
42665
- const feedbackOptions = convertPendoToFeedbackOptions(options);
42633
+ var feedbackOptions = convertPendoToFeedbackOptions(options);
42666
42634
  ping(feedbackOptions);
42667
42635
  }
42668
42636
  else if (shouldInitializeFeedback() && !globalPendo._.isEmpty(options)) {
42669
- const settings = pluginApi.ConfigReader.get('feedbackSettings');
42670
- init(options, settings).catch(globalPendo._.noop);
42637
+ var settings = pluginApi.ConfigReader.get('feedbackSettings');
42638
+ init(options, settings)["catch"](globalPendo._.noop);
42671
42639
  }
42672
42640
  }
42673
42641
  function handleIdentityChange(event) {
42674
- const visitorId = globalPendo._.get(event, 'data.0.visitor_id') || globalPendo._.get(event, 'data.0.options.visitor.id');
42642
+ var visitorId = globalPendo._.get(event, 'data.0.visitor_id') || globalPendo._.get(event, 'data.0.options.visitor.id');
42675
42643
  if (globalPendo.isAnonymousVisitor(visitorId)) {
42676
42644
  removeFeedbackWidget();
42677
42645
  return;
@@ -42741,9 +42709,9 @@ function Feedback() {
42741
42709
  if (toSend.data && toSend.data !== '{}' && toSend.data !== 'null') {
42742
42710
  return globalPendo.ajax
42743
42711
  .postJSON(getFullUrl('/widget/pendo_ping'), toSend)
42744
- .then((response) => {
42712
+ .then(function (response) {
42745
42713
  onWidgetPingResponse(response);
42746
- }).catch(() => { onPingFailure(); });
42714
+ })["catch"](function () { onPingFailure(); });
42747
42715
  }
42748
42716
  }
42749
42717
  return pluginApi.q.resolve();
@@ -42877,10 +42845,10 @@ function Feedback() {
42877
42845
  return globalPendo.ajax.postJSON(getFullUrl('/analytics'), toSend);
42878
42846
  }
42879
42847
  function addOverlay() {
42880
- const widget = globalPendo.dom(`#${elemIds.feedbackWidget}`);
42848
+ var widget = globalPendo.dom("#".concat(elemIds.feedbackWidget));
42881
42849
  if (!widget)
42882
42850
  return;
42883
- const overlayStyles = {
42851
+ var overlayStyles = {
42884
42852
  'position': 'fixed',
42885
42853
  'top': '0',
42886
42854
  'right': '0',
@@ -42892,7 +42860,7 @@ function Feedback() {
42892
42860
  'animation': 'pendoFeedbackFadeIn 0.5s 0s 1 alternate both',
42893
42861
  '-webkit-animation': 'pendoFeedbackFadeIn 0.5s 0s 1 alternate both'
42894
42862
  };
42895
- const overlayElement = globalPendo.dom(document.createElement('div'));
42863
+ var overlayElement = globalPendo.dom(document.createElement('div'));
42896
42864
  overlayElement.attr('id', 'feedback-overlay');
42897
42865
  overlayElement.css(overlayStyles);
42898
42866
  overlayElement.appendTo(widget.getParent());
@@ -42997,22 +42965,22 @@ function Feedback() {
42997
42965
  }
42998
42966
  }
42999
42967
  function buildOuterTriggerDiv(positionInfo) {
43000
- const horizontalStyles = getHorizontalPositionStyles(positionInfo);
43001
- const verticalStyles = getVerticalPositionStyles(positionInfo);
43002
- const styles = globalPendo._.extend({
42968
+ var horizontalStyles = getHorizontalPositionStyles(positionInfo);
42969
+ var verticalStyles = getVerticalPositionStyles(positionInfo);
42970
+ var styles = globalPendo._.extend({
43003
42971
  'position': 'fixed',
43004
42972
  'height': '43px',
43005
42973
  'opacity': '1 !important',
43006
42974
  'z-index': '9001'
43007
42975
  }, horizontalStyles, verticalStyles);
43008
- const outerTrigger = globalPendo.dom(document.createElement('div'));
42976
+ var outerTrigger = globalPendo.dom(document.createElement('div'));
43009
42977
  outerTrigger.attr('id', elemIds.feedbackTrigger);
43010
42978
  outerTrigger.css(styles);
43011
42979
  outerTrigger.attr('data-turbolinks-permanent', '');
43012
42980
  return outerTrigger;
43013
42981
  }
43014
42982
  function buildNotification() {
43015
- const styles = {
42983
+ var styles = {
43016
42984
  'background-color': '#D85039',
43017
42985
  'color': '#fff',
43018
42986
  'border-radius': '50%',
@@ -43029,20 +42997,20 @@ function Feedback() {
43029
42997
  'animation-delay': '1s',
43030
42998
  'animation-iteration-count': '1'
43031
42999
  };
43032
- const notification = globalPendo.dom(document.createElement('span'));
43000
+ var notification = globalPendo.dom(document.createElement('span'));
43033
43001
  notification.attr('id', 'feedback-trigger-notification');
43034
43002
  notification.css(styles);
43035
43003
  return notification;
43036
43004
  }
43037
43005
  function buildTriggerButton(settings, positionInfo) {
43038
- let borderRadius;
43006
+ var borderRadius;
43039
43007
  if (positionInfo.horizontalPosition === 'left') {
43040
43008
  borderRadius = '0 0 5px 5px';
43041
43009
  }
43042
43010
  else {
43043
43011
  borderRadius = '3px 3px 0 0';
43044
43012
  }
43045
- const styles = {
43013
+ var styles = {
43046
43014
  'border': 'none',
43047
43015
  'padding': '11px 18px 14px 18px',
43048
43016
  'background-color': settings.triggerColor,
@@ -43053,32 +43021,21 @@ function Feedback() {
43053
43021
  'cursor': 'pointer',
43054
43022
  'text-align': 'left'
43055
43023
  };
43056
- const triggerButton = globalPendo.dom(document.createElement('button'));
43024
+ var triggerButton = globalPendo.dom(document.createElement('button'));
43057
43025
  triggerButton.attr('id', elemIds.feedbackTriggerButton);
43058
43026
  triggerButton.css(styles);
43059
43027
  triggerButton.text(settings.triggerText);
43060
43028
  return triggerButton;
43061
43029
  }
43062
43030
  function addTriggerPseudoStyles() {
43063
- const pseudoStyles = `
43064
- #feedback-trigger button:hover {
43065
- box-shadow: 0 -5px 20px rgba(0,0,0,.19) !important;
43066
- outline: none !important;
43067
- background: #3e566f !important;
43068
- }
43069
- #feedback-trigger button:focus {
43070
- box-shadow: 0 -5px 20px rgba(0,0,0,.19) !important;
43071
- outline: none !important;
43072
- background: #3e566f !important;
43073
- }
43074
- `;
43031
+ 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 ";
43075
43032
  pluginApi.util.addInlineStyles('pendo-feedback-trigger-styles', pseudoStyles);
43076
43033
  }
43077
43034
  function createTrigger(settings, positionInfo) {
43078
43035
  addTriggerPseudoStyles();
43079
- const triggerElement = buildOuterTriggerDiv(positionInfo);
43080
- const notificationElement = buildNotification();
43081
- const triggerButtonElement = buildTriggerButton(settings, positionInfo);
43036
+ var triggerElement = buildOuterTriggerDiv(positionInfo);
43037
+ var notificationElement = buildNotification();
43038
+ var triggerButtonElement = buildTriggerButton(settings, positionInfo);
43082
43039
  triggerElement.append(notificationElement);
43083
43040
  triggerElement.append(triggerButtonElement);
43084
43041
  triggerElement.appendTo(globalPendo.dom.getBody());
@@ -43102,7 +43059,7 @@ function Feedback() {
43102
43059
  iframeWrapper.css(getWidgetOriginalStyles());
43103
43060
  iframeWrapper.attr('id', elemIds.feedbackWidget);
43104
43061
  iframeWrapper.attr('data-turbolinks-permanent', 'true');
43105
- iframeWrapper.addClass(`buttonIs-${horizontalPosition}`);
43062
+ iframeWrapper.addClass("buttonIs-".concat(horizontalPosition));
43106
43063
  return iframeWrapper;
43107
43064
  }
43108
43065
  function buildIframeContainer() {
@@ -43119,22 +43076,13 @@ function Feedback() {
43119
43076
  return iframeContainer;
43120
43077
  }
43121
43078
  function addWidgetVisibleButtonStyles(buttonStylePosition) {
43122
- let side = buttonStylePosition === 'left' ? 'left' : 'right'; // just in case something was not left or right for some reason
43123
- const styles = `
43124
- .buttonIs-${side}.visible {
43125
- ${side}: 0 !important;
43126
- width: 470px !important;
43127
- animation-direction: alternate-reverse !important;
43128
- animation: pendoFeedbackSlideFrom-${side} 0.5s 0s 1 alternate both !important;
43129
- -webkit-animation: pendoFeedbackSlideFrom-${side} 0.5s 0s 1 alternate both !important;
43130
- z-index: 9002 !important;
43131
- }
43132
- `;
43079
+ var side = buttonStylePosition === 'left' ? 'left' : 'right'; // just in case something was not left or right for some reason
43080
+ 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 ");
43133
43081
  pluginApi.util.addInlineStyles(elemIds.feedbackFrameStyles, styles);
43134
43082
  }
43135
43083
  function initialiseWidgetFrame(horizontalPosition) {
43136
43084
  addWidgetVisibleButtonStyles(horizontalPosition);
43137
- const iframeElement = buildIframeWrapper(horizontalPosition);
43085
+ var iframeElement = buildIframeWrapper(horizontalPosition);
43138
43086
  iframeElement.append(buildIframeContainer());
43139
43087
  iframeElement.appendTo(globalPendo.dom.getBody());
43140
43088
  subscribeToIframeMessages();
@@ -43158,7 +43106,7 @@ function Feedback() {
43158
43106
  return widgetLoaded;
43159
43107
  }
43160
43108
  function getPendoOptions() {
43161
- let options = pluginApi.ConfigReader.getLocalConfig();
43109
+ var options = pluginApi.ConfigReader.getLocalConfig();
43162
43110
  if (!globalPendo._.isObject(options))
43163
43111
  options = {};
43164
43112
  if (!globalPendo._.isObject(options.visitor))
@@ -43186,7 +43134,7 @@ function Feedback() {
43186
43134
  return true;
43187
43135
  }
43188
43136
  function getQueryParam(url, paramName) {
43189
- const results = new RegExp('[?&]' + paramName + '=([^&#]*)').exec(url);
43137
+ var results = new RegExp('[?&]' + paramName + '=([^&#]*)').exec(url);
43190
43138
  if (results == null) {
43191
43139
  return null;
43192
43140
  }
@@ -43203,13 +43151,13 @@ function Feedback() {
43203
43151
  return pluginApi.q.reject();
43204
43152
  if (!canInitFeedback(pendoOptions))
43205
43153
  return pluginApi.q.reject();
43206
- const feedbackOptions = convertPendoToFeedbackOptions(pendoOptions);
43154
+ var feedbackOptions = convertPendoToFeedbackOptions(pendoOptions);
43207
43155
  try {
43208
- const fdbkDst = getQueryParam(globalPendo.url.get(), 'fdbkDst');
43209
- if (fdbkDst && fdbkDst.startsWith('case')) {
43156
+ var fdbkDst_1 = getQueryParam(globalPendo.url.get(), 'fdbkDst');
43157
+ if (fdbkDst_1 && fdbkDst_1.startsWith('case')) {
43210
43158
  initialized = true;
43211
43159
  getFeedbackLoginUrl().then(function (loginUrl) {
43212
- const destinationUrl = loginUrl + '&fdbkDst=' + fdbkDst;
43160
+ var destinationUrl = loginUrl + '&fdbkDst=' + fdbkDst_1;
43213
43161
  window.location.href = destinationUrl;
43214
43162
  });
43215
43163
  return;
@@ -43258,7 +43206,7 @@ function Feedback() {
43258
43206
  function convertPendoToFeedbackOptions(options) {
43259
43207
  var jwtOptions = pluginApi.agent.getJwtInfoCopy();
43260
43208
  if (globalPendo._.isEmpty(jwtOptions)) {
43261
- const feedbackOptions = {};
43209
+ var feedbackOptions = {};
43262
43210
  feedbackOptions.user = globalPendo._.pick(options.visitor, 'id', 'full_name', 'firstName', 'lastName', 'email', 'tags', 'custom_allowed_products');
43263
43211
  globalPendo._.extend(feedbackOptions.user, { allowed_products: [{ id: feedbackAllowedProductId }] });
43264
43212
  feedbackOptions.account = globalPendo._.pick(options.account, 'id', 'name', 'monthly_value', 'is_paying', 'tags');
@@ -43365,13 +43313,15 @@ const testableAccessors$1 = {
43365
43313
  Node: ["childNodes", "parentNode", "parentElement", "textContent"],
43366
43314
  ShadowRoot: ["host", "styleSheets"],
43367
43315
  Element: ["shadowRoot"],
43368
- MutationObserver: []
43316
+ MutationObserver: [],
43317
+ EventTarget: []
43369
43318
  };
43370
43319
  const testableMethods$1 = {
43371
43320
  Node: ["contains", "getRootNode"],
43372
43321
  ShadowRoot: ["getSelection"],
43373
43322
  Element: ["querySelector", "querySelectorAll"],
43374
- MutationObserver: ["constructor"]
43323
+ MutationObserver: ["constructor"],
43324
+ EventTarget: ["addEventListener", "removeEventListener"]
43375
43325
  };
43376
43326
  const untaintedBasePrototype$1 = {};
43377
43327
  function angularZoneUnpatchedAlternative$1(key) {
@@ -43446,11 +43396,26 @@ function getUntaintedAccessor$1(key, instance, accessor) {
43446
43396
  }
43447
43397
  const untaintedMethodCache$1 = {};
43448
43398
  function getUntaintedMethod$1(key, instance, method) {
43399
+ var _a2, _b, _c;
43449
43400
  const cacheKey = `${key}.${String(method)}`;
43450
43401
  if (untaintedMethodCache$1[cacheKey])
43451
43402
  return untaintedMethodCache$1[cacheKey].bind(
43452
43403
  instance
43453
43404
  );
43405
+ const zoneSymbol = (_b = (_a2 = globalThis == null ? void 0 : globalThis.Zone) == null ? void 0 : _a2.__symbol__) == null ? void 0 : _b.call(
43406
+ _a2,
43407
+ String(method)
43408
+ );
43409
+ if (zoneSymbol) {
43410
+ const classProto = (_c = globalThis[key]) == null ? void 0 : _c.prototype;
43411
+ const nativeFromZone = globalThis[zoneSymbol] ?? (classProto == null ? void 0 : classProto[zoneSymbol]);
43412
+ if (typeof nativeFromZone === "function") {
43413
+ untaintedMethodCache$1[cacheKey] = nativeFromZone;
43414
+ return nativeFromZone.bind(
43415
+ instance
43416
+ );
43417
+ }
43418
+ }
43454
43419
  const untaintedPrototype = getUntaintedPrototype$1(key);
43455
43420
  const untaintedMethod = untaintedPrototype[method];
43456
43421
  if (typeof untaintedMethod !== "function") return instance[method];
@@ -43492,6 +43457,16 @@ function querySelector$1(n2, selectors) {
43492
43457
  function querySelectorAll$1(n2, selectors) {
43493
43458
  return getUntaintedMethod$1("Element", n2, "querySelectorAll")(selectors);
43494
43459
  }
43460
+ function addEventListener$1(n2, type, listener, options) {
43461
+ getUntaintedMethod$1("EventTarget", n2, "addEventListener")(type, listener, options);
43462
+ }
43463
+ function removeEventListener$1(n2, type, listener, options) {
43464
+ getUntaintedMethod$1("EventTarget", n2, "removeEventListener")(
43465
+ type,
43466
+ listener,
43467
+ options
43468
+ );
43469
+ }
43495
43470
  function mutationObserverCtor$1() {
43496
43471
  return getUntaintedPrototype$1("MutationObserver").constructor;
43497
43472
  }
@@ -43533,6 +43508,8 @@ const index$1 = {
43533
43508
  shadowRoot: shadowRoot$1,
43534
43509
  querySelector: querySelector$1,
43535
43510
  querySelectorAll: querySelectorAll$1,
43511
+ addEventListener: addEventListener$1,
43512
+ removeEventListener: removeEventListener$1,
43536
43513
  mutationObserver: mutationObserverCtor$1,
43537
43514
  patch: patch$1
43538
43515
  };
@@ -44962,13 +44939,15 @@ const testableAccessors = {
44962
44939
  Node: ["childNodes", "parentNode", "parentElement", "textContent"],
44963
44940
  ShadowRoot: ["host", "styleSheets"],
44964
44941
  Element: ["shadowRoot"],
44965
- MutationObserver: []
44942
+ MutationObserver: [],
44943
+ EventTarget: []
44966
44944
  };
44967
44945
  const testableMethods = {
44968
44946
  Node: ["contains", "getRootNode"],
44969
44947
  ShadowRoot: ["getSelection"],
44970
44948
  Element: ["querySelector", "querySelectorAll"],
44971
- MutationObserver: ["constructor"]
44949
+ MutationObserver: ["constructor"],
44950
+ EventTarget: ["addEventListener", "removeEventListener"]
44972
44951
  };
44973
44952
  const untaintedBasePrototype = {};
44974
44953
  function angularZoneUnpatchedAlternative(key) {
@@ -45043,11 +45022,26 @@ function getUntaintedAccessor(key, instance, accessor) {
45043
45022
  }
45044
45023
  const untaintedMethodCache = {};
45045
45024
  function getUntaintedMethod(key, instance, method) {
45025
+ var _a2, _b, _c;
45046
45026
  const cacheKey = `${key}.${String(method)}`;
45047
45027
  if (untaintedMethodCache[cacheKey])
45048
45028
  return untaintedMethodCache[cacheKey].bind(
45049
45029
  instance
45050
45030
  );
45031
+ const zoneSymbol = (_b = (_a2 = globalThis == null ? void 0 : globalThis.Zone) == null ? void 0 : _a2.__symbol__) == null ? void 0 : _b.call(
45032
+ _a2,
45033
+ String(method)
45034
+ );
45035
+ if (zoneSymbol) {
45036
+ const classProto = (_c = globalThis[key]) == null ? void 0 : _c.prototype;
45037
+ const nativeFromZone = globalThis[zoneSymbol] ?? (classProto == null ? void 0 : classProto[zoneSymbol]);
45038
+ if (typeof nativeFromZone === "function") {
45039
+ untaintedMethodCache[cacheKey] = nativeFromZone;
45040
+ return nativeFromZone.bind(
45041
+ instance
45042
+ );
45043
+ }
45044
+ }
45051
45045
  const untaintedPrototype = getUntaintedPrototype(key);
45052
45046
  const untaintedMethod = untaintedPrototype[method];
45053
45047
  if (typeof untaintedMethod !== "function") return instance[method];
@@ -45089,6 +45083,16 @@ function querySelector(n2, selectors) {
45089
45083
  function querySelectorAll(n2, selectors) {
45090
45084
  return getUntaintedMethod("Element", n2, "querySelectorAll")(selectors);
45091
45085
  }
45086
+ function addEventListener(n2, type, listener, options) {
45087
+ getUntaintedMethod("EventTarget", n2, "addEventListener")(type, listener, options);
45088
+ }
45089
+ function removeEventListener(n2, type, listener, options) {
45090
+ getUntaintedMethod("EventTarget", n2, "removeEventListener")(
45091
+ type,
45092
+ listener,
45093
+ options
45094
+ );
45095
+ }
45092
45096
  function mutationObserverCtor() {
45093
45097
  return getUntaintedPrototype("MutationObserver").constructor;
45094
45098
  }
@@ -45146,23 +45150,15 @@ const index = {
45146
45150
  shadowRoot,
45147
45151
  querySelector,
45148
45152
  querySelectorAll,
45153
+ addEventListener,
45154
+ removeEventListener,
45149
45155
  mutationObserver: mutationObserverCtor,
45150
45156
  patch
45151
45157
  };
45152
- function getWindow(documentOrWindow) {
45153
- const defaultView = documentOrWindow.defaultView;
45154
- return defaultView ? defaultView : documentOrWindow;
45155
- }
45156
45158
  function on(type, fn, target = document) {
45157
- const windowObj = getWindow(target);
45158
- const nativeAddEventListener = getNative$1(
45159
- "addEventListener",
45160
- windowObj
45161
- );
45162
- const nativeRemoveEventListener = getNative$1("removeEventListener", windowObj);
45163
45159
  const options = { capture: true, passive: true };
45164
- nativeAddEventListener.call(target, type, fn, options);
45165
- return () => nativeRemoveEventListener.call(target, type, fn, options);
45160
+ index.addEventListener(target, type, fn, options);
45161
+ return () => index.removeEventListener(target, type, fn, options);
45166
45162
  }
45167
45163
  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.";
45168
45164
  let _mirror = {
@@ -48800,6 +48796,17 @@ var SessionRecorderBuffer = /** @class */ (function () {
48800
48796
  return SessionRecorderBuffer;
48801
48797
  }());
48802
48798
 
48799
+ var __assign = function() {
48800
+ __assign = Object.assign || function __assign(t) {
48801
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
48802
+ s = arguments[i];
48803
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
48804
+ }
48805
+ return t;
48806
+ };
48807
+ return __assign.apply(this, arguments);
48808
+ };
48809
+
48803
48810
  function __rest(s, e) {
48804
48811
  var t = {};
48805
48812
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
@@ -50953,7 +50960,7 @@ function includes(str, substring) {
50953
50960
  function getResourceType(blockedURI, directive) {
50954
50961
  if (!directive || typeof directive !== 'string')
50955
50962
  return 'resource';
50956
- const d = directive.toLowerCase();
50963
+ var d = directive.toLowerCase();
50957
50964
  if (blockedURI === 'inline') {
50958
50965
  if (includes(d, 'script-src-attr')) {
50959
50966
  return 'inline event handler';
@@ -51012,11 +51019,12 @@ function getResourceType(blockedURI, directive) {
51012
51019
  function getDirective(policy, directiveName) {
51013
51020
  if (!policy || !directiveName)
51014
51021
  return '';
51015
- const needle = directiveName.toLowerCase();
51016
- for (const directive of policy.split(';')) {
51017
- const trimmed = directive.trim();
51018
- const lower = trimmed.toLowerCase();
51019
- if (lower === needle || lower.startsWith(`${needle} `)) {
51022
+ var needle = directiveName.toLowerCase();
51023
+ for (var _i = 0, _a = policy.split(';'); _i < _a.length; _i++) {
51024
+ var directive = _a[_i];
51025
+ var trimmed = directive.trim();
51026
+ var lower = trimmed.toLowerCase();
51027
+ if (lower === needle || lower.startsWith("".concat(needle, " "))) {
51020
51028
  return trimmed;
51021
51029
  }
51022
51030
  }
@@ -51038,7 +51046,7 @@ function getDirective(policy, directiveName) {
51038
51046
  function getArticle(phrase) {
51039
51047
  if (!phrase || typeof phrase !== 'string')
51040
51048
  return 'A';
51041
- const c = phrase.trim().charAt(0).toLowerCase();
51049
+ var c = phrase.trim().charAt(0).toLowerCase();
51042
51050
  return includes('aeiou', c) ? 'An' : 'A';
51043
51051
  }
51044
51052
  /**
@@ -51081,46 +51089,47 @@ function createCspViolationMessage(blockedURI, directive, isReportOnly, original
51081
51089
  return 'Content Security Policy: Unknown violation occurred.';
51082
51090
  }
51083
51091
  try {
51084
- const reportOnlyText = isReportOnly ? ' (Report-Only)' : '';
51092
+ var reportOnlyText = isReportOnly ? ' (Report-Only)' : '';
51085
51093
  // special case for frame-ancestors since it doesn't fit our template at all
51086
51094
  if ((directive === null || directive === void 0 ? void 0 : directive.toLowerCase()) === 'frame-ancestors') {
51087
- return `Content Security Policy${reportOnlyText}: The display of ${blockedURI} in a frame was blocked because an ancestor violates your site's frame-ancestors policy.\nCurrent CSP: "${originalPolicy}".`;
51095
+ 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, "\".");
51088
51096
  }
51089
- const resourceType = getResourceType(blockedURI, directive);
51090
- const article = getArticle(resourceType);
51091
- const source = formatBlockedUri(blockedURI);
51092
- const directiveValue = getDirective(originalPolicy, directive);
51093
- const policyDisplay = directiveValue || directive;
51094
- const resourceDescription = `${article} ${resourceType}${source ? ` from ${source}` : ''}`;
51095
- return `Content Security Policy${reportOnlyText}: ${resourceDescription} was blocked by your site's \`${policyDisplay}\` policy.\nCurrent CSP: "${originalPolicy}".`;
51097
+ var resourceType = getResourceType(blockedURI, directive);
51098
+ var article = getArticle(resourceType);
51099
+ var source = formatBlockedUri(blockedURI);
51100
+ var directiveValue = getDirective(originalPolicy, directive);
51101
+ var policyDisplay = directiveValue || directive;
51102
+ var resourceDescription = "".concat(article, " ").concat(resourceType).concat(source ? " from ".concat(source) : '');
51103
+ return "Content Security Policy".concat(reportOnlyText, ": ").concat(resourceDescription, " was blocked by your site's `").concat(policyDisplay, "` policy.\nCurrent CSP: \"").concat(originalPolicy, "\".");
51096
51104
  }
51097
51105
  catch (error) {
51098
- return `Content Security Policy: Error formatting violation message: ${error.message}`;
51106
+ return "Content Security Policy: Error formatting violation message: ".concat(error.message);
51099
51107
  }
51100
51108
  }
51101
51109
 
51102
- const MAX_LENGTH = 1000;
51103
- const PII_PATTERN = {
51110
+ var MAX_LENGTH = 1000;
51111
+ var PII_PATTERN = {
51104
51112
  ip: /\b(?:\d{1,3}\.){3}\d{1,3}\b/g,
51105
51113
  ssn: /\b\d{3}-\d{2}-\d{4}\b/g,
51106
51114
  creditCard: /\b(?:\d[ -]?){12,18}\d\b/g,
51107
51115
  httpsUrls: /https:\/\/[^\s]+/g,
51108
51116
  email: /[\w._+-]+@[\w.-]+\.\w+/g
51109
51117
  };
51110
- const PII_REPLACEMENT = '*'.repeat(10);
51111
- const JSON_PII_KEYS = ['password', 'email', 'key', 'token', 'auth', 'authentication', 'phone', 'address', 'ssn'];
51112
- const UNABLE_TO_DISPLAY_BODY = '[Unable to display body: detected PII could not be redacted]';
51113
- const joinedKeys = JSON_PII_KEYS.join('|');
51114
- const keyPattern = `"([^"]*(?:${joinedKeys})[^"]*)"`;
51118
+ var PII_REPLACEMENT = '*'.repeat(10);
51119
+ var JSON_PII_KEYS = ['password', 'email', 'key', 'token', 'auth', 'authentication', 'phone', 'address', 'ssn'];
51120
+ var UNABLE_TO_DISPLAY_BODY = '[Unable to display body: detected PII could not be redacted]';
51121
+ var joinedKeys = JSON_PII_KEYS.join('|');
51122
+ var keyPattern = "\"([^\"]*(?:".concat(joinedKeys, ")[^\"]*)\"");
51115
51123
  // only scrub strings, numbers, and booleans
51116
- const acceptedValues = '("([^"\\\\]*(?:\\\\.[^"\\\\]*)*")|(\\d+)|(true|false))';
51124
+ var acceptedValues = '("([^"\\\\]*(?:\\\\.[^"\\\\]*)*")|(\\d+)|(true|false))';
51117
51125
  /**
51118
51126
  * Truncates a string to the max length
51119
51127
  * @access private
51120
51128
  * @param {String} string
51121
51129
  * @returns {String}
51122
51130
  */
51123
- function truncate(string, includeEllipsis = false) {
51131
+ function truncate(string, includeEllipsis) {
51132
+ if (includeEllipsis === void 0) { includeEllipsis = false; }
51124
51133
  if (string.length <= MAX_LENGTH)
51125
51134
  return string;
51126
51135
  if (includeEllipsis) {
@@ -51137,7 +51146,7 @@ function truncate(string, includeEllipsis = false) {
51137
51146
  * @returns {String}
51138
51147
  */
51139
51148
  function generateLogKey(methodName, message, stackTrace) {
51140
- return `${methodName}|${message}|${stackTrace}`;
51149
+ return "".concat(methodName, "|").concat(message, "|").concat(stackTrace);
51141
51150
  }
51142
51151
  /**
51143
51152
  * Checks if a string has 2 or more digits, a https URL, or an email address
@@ -51154,12 +51163,13 @@ function mightContainPII(string) {
51154
51163
  * @param {String} string
51155
51164
  * @returns {String}
51156
51165
  */
51157
- function scrubPII({ string, _ }) {
51166
+ function scrubPII(_a) {
51167
+ var string = _a.string, _ = _a._;
51158
51168
  if (!string || typeof string !== 'string')
51159
51169
  return string;
51160
51170
  if (!mightContainPII(string))
51161
51171
  return string;
51162
- return _.reduce(_.values(PII_PATTERN), (str, pattern) => str.replace(pattern, PII_REPLACEMENT), string);
51172
+ return _.reduce(_.values(PII_PATTERN), function (str, pattern) { return str.replace(pattern, PII_REPLACEMENT); }, string);
51163
51173
  }
51164
51174
  /**
51165
51175
  * Scrub PII from a stringified JSON object
@@ -51168,12 +51178,14 @@ function scrubPII({ string, _ }) {
51168
51178
  * @returns {String}
51169
51179
  */
51170
51180
  function scrubJsonPII(string) {
51171
- const fullScrubRegex = new RegExp(`${keyPattern}\\s*:\\s*[\\{\\[]`, 'i');
51181
+ var fullScrubRegex = new RegExp("".concat(keyPattern, "\\s*:\\s*[\\{\\[]"), 'i');
51172
51182
  if (fullScrubRegex.test(string)) {
51173
51183
  return UNABLE_TO_DISPLAY_BODY;
51174
51184
  }
51175
- const keyValueScrubRegex = new RegExp(`${keyPattern}\\s*:\\s*${acceptedValues}`, 'gi');
51176
- return string.replace(keyValueScrubRegex, (match, key) => `"${key}":"${PII_REPLACEMENT}"`);
51185
+ var keyValueScrubRegex = new RegExp("".concat(keyPattern, "\\s*:\\s*").concat(acceptedValues), 'gi');
51186
+ return string.replace(keyValueScrubRegex, function (match, key) {
51187
+ return "\"".concat(key, "\":\"").concat(PII_REPLACEMENT, "\"");
51188
+ });
51177
51189
  }
51178
51190
  /**
51179
51191
  * Checks if a string is a JSON object
@@ -51185,7 +51197,7 @@ function scrubJsonPII(string) {
51185
51197
  function mightContainJson(string, contentType) {
51186
51198
  if (!string || typeof string !== 'string')
51187
51199
  return false;
51188
- const firstChar = string.charAt(0);
51200
+ var firstChar = string.charAt(0);
51189
51201
  if (contentType && contentType.indexOf('application/json') !== -1) {
51190
51202
  return true;
51191
51203
  }
@@ -51198,19 +51210,20 @@ function mightContainJson(string, contentType) {
51198
51210
  * @param {String} contentType
51199
51211
  * @returns {String}
51200
51212
  */
51201
- function maskSensitiveFields({ string, contentType, _ }) {
51213
+ function maskSensitiveFields(_a) {
51214
+ var string = _a.string, contentType = _a.contentType, _ = _a._;
51202
51215
  if (!string || typeof string !== 'string')
51203
51216
  return string;
51204
51217
  if (mightContainJson(string, contentType)) {
51205
51218
  string = scrubJsonPII(string);
51206
51219
  }
51207
51220
  if (mightContainPII(string)) {
51208
- string = scrubPII({ string, _ });
51221
+ string = scrubPII({ string: string, _: _ });
51209
51222
  }
51210
51223
  return string;
51211
51224
  }
51212
51225
 
51213
- const DEV_LOG_TYPE = 'devlog';
51226
+ var DEV_LOG_TYPE = 'devlog';
51214
51227
  function createDevLogEnvelope(pluginAPI, globalPendo) {
51215
51228
  return {
51216
51229
  browser_time: pluginAPI.util.getNow(),
@@ -51221,12 +51234,12 @@ function createDevLogEnvelope(pluginAPI, globalPendo) {
51221
51234
  };
51222
51235
  }
51223
51236
 
51224
- const TOKEN_MAX_SIZE = 100;
51225
- const TOKEN_REFILL_RATE = 10;
51226
- const TOKEN_REFRESH_INTERVAL = 1000;
51227
- const MAX_UNCOMPRESSED_SIZE = 125000; // 125KB
51228
- class DevlogBuffer {
51229
- constructor(pendo, pluginAPI) {
51237
+ var TOKEN_MAX_SIZE = 100;
51238
+ var TOKEN_REFILL_RATE = 10;
51239
+ var TOKEN_REFRESH_INTERVAL = 1000;
51240
+ var MAX_UNCOMPRESSED_SIZE = 125000; // 125KB
51241
+ var DevlogBuffer = /** @class */ (function () {
51242
+ function DevlogBuffer(pendo, pluginAPI) {
51230
51243
  this.pendo = pendo;
51231
51244
  this.pluginAPI = pluginAPI;
51232
51245
  this.events = [];
@@ -51237,36 +51250,36 @@ class DevlogBuffer {
51237
51250
  this.lastRefillTime = this.pluginAPI.util.getNow();
51238
51251
  this.nextRefillTime = this.lastRefillTime + TOKEN_REFRESH_INTERVAL;
51239
51252
  }
51240
- isEmpty() {
51253
+ DevlogBuffer.prototype.isEmpty = function () {
51241
51254
  return this.events.length === 0 && this.payloads.length === 0;
51242
- }
51243
- refillTokens() {
51244
- const now = this.pluginAPI.util.getNow();
51255
+ };
51256
+ DevlogBuffer.prototype.refillTokens = function () {
51257
+ var now = this.pluginAPI.util.getNow();
51245
51258
  if (now >= this.nextRefillTime) {
51246
- const timeSinceLastRefill = now - this.lastRefillTime;
51247
- const secondsSinceLastRefill = Math.floor(timeSinceLastRefill / TOKEN_REFRESH_INTERVAL);
51248
- const tokensToRefill = secondsSinceLastRefill * TOKEN_REFILL_RATE;
51259
+ var timeSinceLastRefill = now - this.lastRefillTime;
51260
+ var secondsSinceLastRefill = Math.floor(timeSinceLastRefill / TOKEN_REFRESH_INTERVAL);
51261
+ var tokensToRefill = secondsSinceLastRefill * TOKEN_REFILL_RATE;
51249
51262
  this.tokens = Math.min(this.tokens + tokensToRefill, TOKEN_MAX_SIZE);
51250
51263
  this.lastRefillTime = now;
51251
51264
  this.nextRefillTime = now + TOKEN_REFRESH_INTERVAL;
51252
51265
  }
51253
- }
51254
- clear() {
51266
+ };
51267
+ DevlogBuffer.prototype.clear = function () {
51255
51268
  this.events = [];
51256
51269
  this.lastEvent = null;
51257
51270
  this.uncompressedSize = 0;
51258
- }
51259
- hasTokenAvailable() {
51271
+ };
51272
+ DevlogBuffer.prototype.hasTokenAvailable = function () {
51260
51273
  this.refillTokens();
51261
51274
  return this.tokens > 0;
51262
- }
51263
- estimateEventSize(event) {
51275
+ };
51276
+ DevlogBuffer.prototype.estimateEventSize = function (event) {
51264
51277
  return JSON.stringify(event).length;
51265
- }
51266
- push(event) {
51278
+ };
51279
+ DevlogBuffer.prototype.push = function (event) {
51267
51280
  if (!this.hasTokenAvailable())
51268
51281
  return false;
51269
- const eventSize = this.estimateEventSize(event);
51282
+ var eventSize = this.estimateEventSize(event);
51270
51283
  if (this.uncompressedSize + eventSize > MAX_UNCOMPRESSED_SIZE) {
51271
51284
  this.compressCurrentChunk();
51272
51285
  }
@@ -51275,54 +51288,55 @@ class DevlogBuffer {
51275
51288
  this.events.push(event);
51276
51289
  this.tokens = Math.max(this.tokens - 1, 0);
51277
51290
  return true;
51278
- }
51279
- compressCurrentChunk() {
51291
+ };
51292
+ DevlogBuffer.prototype.compressCurrentChunk = function () {
51280
51293
  if (this.events.length === 0)
51281
51294
  return;
51282
- const jzb = this.pendo.compress(this.events);
51295
+ var jzb = this.pendo.compress(this.events);
51283
51296
  this.payloads.push(jzb);
51284
51297
  this.clear();
51285
- }
51286
- generateUrl() {
51287
- const queryParams = {
51298
+ };
51299
+ DevlogBuffer.prototype.generateUrl = function () {
51300
+ var queryParams = {
51288
51301
  v: this.pendo.VERSION,
51289
51302
  ct: this.pluginAPI.util.getNow()
51290
51303
  };
51291
51304
  return this.pluginAPI.transmit.buildBaseDataUrl(DEV_LOG_TYPE, this.pendo.apiKey, queryParams);
51292
- }
51293
- pack() {
51305
+ };
51306
+ DevlogBuffer.prototype.pack = function () {
51294
51307
  if (this.isEmpty())
51295
51308
  return;
51296
- const url = this.generateUrl();
51309
+ var url = this.generateUrl();
51297
51310
  this.compressCurrentChunk();
51298
- const payloads = this.pendo._.map(this.payloads, (jzb) => ({
51299
- jzb,
51300
- url
51301
- }));
51311
+ var payloads = this.pendo._.map(this.payloads, function (jzb) { return ({
51312
+ jzb: jzb,
51313
+ url: url
51314
+ }); });
51302
51315
  this.payloads = [];
51303
51316
  return payloads;
51304
- }
51305
- }
51317
+ };
51318
+ return DevlogBuffer;
51319
+ }());
51306
51320
 
51307
- class DevlogTransport {
51308
- constructor(globalPendo, pluginAPI) {
51321
+ var DevlogTransport = /** @class */ (function () {
51322
+ function DevlogTransport(globalPendo, pluginAPI) {
51309
51323
  this.pendo = globalPendo;
51310
51324
  this.pluginAPI = pluginAPI;
51311
51325
  }
51312
- buildGetUrl(baseUrl, jzb) {
51313
- const params = {};
51326
+ DevlogTransport.prototype.buildGetUrl = function (baseUrl, jzb) {
51327
+ var params = {};
51314
51328
  if (this.pluginAPI.agent.treatAsAdoptPartner()) {
51315
51329
  this.pluginAPI.agent.addAccountIdParams(params, this.pendo.get_account_id(), this.pluginAPI.ConfigReader.get('oemAccountId'));
51316
51330
  }
51317
- const jwtOptions = this.pluginAPI.agent.getJwtInfoCopy();
51331
+ var jwtOptions = this.pluginAPI.agent.getJwtInfoCopy();
51318
51332
  if (!this.pendo._.isEmpty(jwtOptions)) {
51319
51333
  this.pendo._.extend(params, jwtOptions);
51320
51334
  }
51321
51335
  params.jzb = jzb;
51322
- const queryString = this.pendo._.map(params, (value, key) => `${key}=${value}`).join('&');
51323
- return `${baseUrl}${baseUrl.indexOf('?') !== -1 ? '&' : '?'}${queryString}`;
51324
- }
51325
- get(url, options) {
51336
+ var queryString = this.pendo._.map(params, function (value, key) { return "".concat(key, "=").concat(value); }).join('&');
51337
+ return "".concat(baseUrl).concat(baseUrl.indexOf('?') !== -1 ? '&' : '?').concat(queryString);
51338
+ };
51339
+ DevlogTransport.prototype.get = function (url, options) {
51326
51340
  options.method = 'GET';
51327
51341
  if (this.pluginAPI.transmit.fetchKeepalive.supported()) {
51328
51342
  return this.pluginAPI.transmit.fetchKeepalive(url, options);
@@ -51330,86 +51344,90 @@ class DevlogTransport {
51330
51344
  else {
51331
51345
  return this.pendo.ajax.get(url);
51332
51346
  }
51333
- }
51334
- sendRequestWithGet({ url, jzb }) {
51335
- const getUrl = this.buildGetUrl(url, jzb);
51347
+ };
51348
+ DevlogTransport.prototype.sendRequestWithGet = function (_a) {
51349
+ var url = _a.url, jzb = _a.jzb;
51350
+ var getUrl = this.buildGetUrl(url, jzb);
51336
51351
  return this.get(getUrl, {
51337
51352
  headers: {
51338
51353
  'Content-Type': 'application/octet-stream'
51339
51354
  }
51340
51355
  });
51341
- }
51342
- post(url, options) {
51356
+ };
51357
+ DevlogTransport.prototype.post = function (url, options) {
51343
51358
  options.method = 'POST';
51344
51359
  if (options.keepalive && this.pluginAPI.transmit.fetchKeepalive.supported()) {
51345
51360
  return this.pluginAPI.transmit.fetchKeepalive(url, options);
51346
51361
  }
51347
51362
  else if (options.keepalive && this.pluginAPI.transmit.sendBeacon.supported()) {
51348
- const result = this.pluginAPI.transmit.sendBeacon(url, new Blob([options.body]));
51363
+ var result = this.pluginAPI.transmit.sendBeacon(url, new Blob([options.body]));
51349
51364
  return result ? Promise$2.resolve() : Promise$2.reject(new Error('sendBeacon failed to send devlog data'));
51350
51365
  }
51351
51366
  else {
51352
51367
  return this.pendo.ajax.post(url, options.body);
51353
51368
  }
51354
- }
51355
- sendRequestWithPost({ url, jzb }, isUnload) {
51356
- const jwtOptions = this.pluginAPI.agent.getJwtInfoCopy();
51357
- const bodyPayload = {
51369
+ };
51370
+ DevlogTransport.prototype.sendRequestWithPost = function (_a, isUnload) {
51371
+ var url = _a.url, jzb = _a.jzb;
51372
+ var jwtOptions = this.pluginAPI.agent.getJwtInfoCopy();
51373
+ var bodyPayload = {
51358
51374
  events: jzb,
51359
51375
  browser_time: this.pluginAPI.util.getNow()
51360
51376
  };
51361
51377
  if (this.pluginAPI.agent.treatAsAdoptPartner()) {
51362
51378
  this.pluginAPI.agent.addAccountIdParams(bodyPayload, this.pendo.get_account_id(), this.pluginAPI.ConfigReader.get('oemAccountId'));
51363
51379
  }
51364
- const body = JSON.stringify(this.pendo._.extend(bodyPayload, jwtOptions));
51380
+ var body = JSON.stringify(this.pendo._.extend(bodyPayload, jwtOptions));
51365
51381
  return this.post(url, {
51366
- body,
51382
+ body: body,
51367
51383
  headers: {
51368
51384
  'Content-Type': 'application/json'
51369
51385
  },
51370
51386
  keepalive: isUnload
51371
51387
  });
51372
- }
51373
- sendRequest({ url, jzb }, isUnload) {
51374
- const compressedLength = jzb.length;
51388
+ };
51389
+ DevlogTransport.prototype.sendRequest = function (_a, isUnload) {
51390
+ var url = _a.url, jzb = _a.jzb;
51391
+ var compressedLength = jzb.length;
51375
51392
  if (compressedLength <= this.pluginAPI.constants.ENCODED_EVENT_MAX_LENGTH && !this.pluginAPI.ConfigReader.get('sendEventsWithPostOnly')) {
51376
- return this.sendRequestWithGet({ url, jzb });
51393
+ return this.sendRequestWithGet({ url: url, jzb: jzb });
51377
51394
  }
51378
- return this.sendRequestWithPost({ url, jzb }, isUnload);
51379
- }
51380
- }
51395
+ return this.sendRequestWithPost({ url: url, jzb: jzb }, isUnload);
51396
+ };
51397
+ return DevlogTransport;
51398
+ }());
51381
51399
 
51382
51400
  function ConsoleCapture() {
51383
- let pluginAPI;
51384
- let _;
51385
- let globalPendo;
51386
- let buffer;
51387
- let sendQueue;
51388
- let sendInterval;
51389
- let transport;
51390
- let isPtmPaused;
51391
- let isCapturingConsoleLogs = false;
51392
- const CAPTURE_CONSOLE_CONFIG = 'captureConsoleLogs';
51393
- const CONSOLE_METHODS = ['log', 'warn', 'error', 'info'];
51394
- const DEV_LOG_SUB_TYPE = 'console';
51401
+ var pluginAPI;
51402
+ var _;
51403
+ var globalPendo;
51404
+ var buffer;
51405
+ var sendQueue;
51406
+ var sendInterval;
51407
+ var transport;
51408
+ var isPtmPaused;
51409
+ var isCapturingConsoleLogs = false;
51410
+ var CAPTURE_CONSOLE_CONFIG = 'captureConsoleLogs';
51411
+ var CONSOLE_METHODS = ['log', 'warn', 'error', 'info'];
51412
+ var DEV_LOG_SUB_TYPE = 'console';
51395
51413
  // deduplicate logs
51396
- let lastLogKey = '';
51414
+ var lastLogKey = '';
51397
51415
  return {
51398
51416
  name: 'ConsoleCapture',
51399
- initialize,
51400
- teardown,
51401
- addIntercepts,
51402
- createConsoleEvent,
51403
- captureStackTrace,
51404
- send,
51405
- setCaptureState,
51406
- recordingStarted,
51407
- recordingStopped,
51408
- onAppHidden,
51409
- onAppUnloaded,
51410
- onPtmPaused,
51411
- onPtmUnpaused,
51412
- securityPolicyViolationFn,
51417
+ initialize: initialize,
51418
+ teardown: teardown,
51419
+ addIntercepts: addIntercepts,
51420
+ createConsoleEvent: createConsoleEvent,
51421
+ captureStackTrace: captureStackTrace,
51422
+ send: send,
51423
+ setCaptureState: setCaptureState,
51424
+ recordingStarted: recordingStarted,
51425
+ recordingStopped: recordingStopped,
51426
+ onAppHidden: onAppHidden,
51427
+ onAppUnloaded: onAppUnloaded,
51428
+ onPtmPaused: onPtmPaused,
51429
+ onPtmUnpaused: onPtmUnpaused,
51430
+ securityPolicyViolationFn: securityPolicyViolationFn,
51413
51431
  get isCapturingConsoleLogs() {
51414
51432
  return isCapturingConsoleLogs;
51415
51433
  },
@@ -51426,16 +51444,16 @@ function ConsoleCapture() {
51426
51444
  function initialize(pendo, PluginAPI) {
51427
51445
  _ = pendo._;
51428
51446
  pluginAPI = PluginAPI;
51429
- const { ConfigReader } = pluginAPI;
51447
+ var ConfigReader = pluginAPI.ConfigReader;
51430
51448
  ConfigReader.addOption(CAPTURE_CONSOLE_CONFIG, [ConfigReader.sources.PENDO_CONFIG_SRC], false);
51431
- const captureConsoleEnabled = ConfigReader.get(CAPTURE_CONSOLE_CONFIG);
51449
+ var captureConsoleEnabled = ConfigReader.get(CAPTURE_CONSOLE_CONFIG);
51432
51450
  if (!captureConsoleEnabled)
51433
51451
  return;
51434
51452
  globalPendo = pendo;
51435
51453
  buffer = new DevlogBuffer(pendo, pluginAPI);
51436
51454
  transport = new DevlogTransport(pendo, pluginAPI);
51437
51455
  sendQueue = new pluginAPI.SendQueue(transport.sendRequest.bind(transport));
51438
- sendInterval = setInterval(() => {
51456
+ sendInterval = setInterval(function () {
51439
51457
  if (!sendQueue.failed()) {
51440
51458
  send();
51441
51459
  }
@@ -51461,17 +51479,19 @@ function ConsoleCapture() {
51461
51479
  function onPtmUnpaused() {
51462
51480
  isPtmPaused = false;
51463
51481
  if (!buffer.isEmpty()) {
51464
- for (const event of buffer.events) {
51465
- pluginAPI.Events.eventCaptured.trigger(event);
51482
+ for (var _i = 0, _a = buffer.events; _i < _a.length; _i++) {
51483
+ var event_1 = _a[_i];
51484
+ pluginAPI.Events.eventCaptured.trigger(event_1);
51466
51485
  }
51467
51486
  send();
51468
51487
  }
51469
51488
  }
51470
- function setCaptureState({ shouldCapture = false, reason = '' } = {}) {
51489
+ function setCaptureState(_a) {
51490
+ var _b = _a === void 0 ? {} : _a, _c = _b.shouldCapture, shouldCapture = _c === void 0 ? false : _c, _d = _b.reason, reason = _d === void 0 ? '' : _d;
51471
51491
  if (shouldCapture === isCapturingConsoleLogs)
51472
51492
  return;
51473
51493
  isCapturingConsoleLogs = shouldCapture;
51474
- pluginAPI.log.info(`[ConsoleCapture] Console log capture ${shouldCapture ? 'started' : 'stopped'}${reason ? `: ${reason}` : ''}`);
51494
+ pluginAPI.log.info("[ConsoleCapture] Console log capture ".concat(shouldCapture ? 'started' : 'stopped').concat(reason ? ": ".concat(reason) : ''));
51475
51495
  }
51476
51496
  function recordingStarted() {
51477
51497
  setCaptureState({ shouldCapture: true, reason: 'recording started' });
@@ -51480,17 +51500,23 @@ function ConsoleCapture() {
51480
51500
  setCaptureState({ shouldCapture: false, reason: 'recording stopped' });
51481
51501
  }
51482
51502
  function readyHandler() {
51483
- addIntercepts();
51484
- pluginAPI.attachEventInternal(window, 'securitypolicyviolation', securityPolicyViolationFn);
51503
+ try {
51504
+ addIntercepts();
51505
+ pluginAPI.attachEventInternal(window, 'securitypolicyviolation', securityPolicyViolationFn);
51506
+ }
51507
+ catch (error) {
51508
+ pluginAPI.log.error('Error setting up console capture intercepts: ', error);
51509
+ teardown();
51510
+ }
51485
51511
  }
51486
51512
  function addIntercepts() {
51487
51513
  _.each(CONSOLE_METHODS, function (methodName) {
51488
- const originalMethod = console[methodName];
51514
+ var originalMethod = console[methodName];
51489
51515
  if (!originalMethod)
51490
51516
  return;
51491
51517
  console[methodName] = _.wrap(originalMethod, function (originalFn) {
51492
51518
  // slice 1 to omit originalFn
51493
- const args = _.toArray(arguments).slice(1);
51519
+ var args = _.toArray(arguments).slice(1);
51494
51520
  originalFn.apply(console, args);
51495
51521
  createConsoleEvent(args, methodName);
51496
51522
  });
@@ -51502,10 +51528,10 @@ function ConsoleCapture() {
51502
51528
  function securityPolicyViolationFn(evt) {
51503
51529
  if (!evt || typeof evt !== 'object')
51504
51530
  return;
51505
- const { blockedURI, violatedDirective, effectiveDirective, disposition, originalPolicy } = evt;
51506
- const directive = violatedDirective || effectiveDirective;
51507
- const isReportOnly = disposition === 'report';
51508
- const message = createCspViolationMessage(blockedURI, directive, isReportOnly, originalPolicy);
51531
+ var blockedURI = evt.blockedURI, violatedDirective = evt.violatedDirective, effectiveDirective = evt.effectiveDirective, disposition = evt.disposition, originalPolicy = evt.originalPolicy;
51532
+ var directive = violatedDirective || effectiveDirective;
51533
+ var isReportOnly = disposition === 'report';
51534
+ var message = createCspViolationMessage(blockedURI, directive, isReportOnly, originalPolicy);
51509
51535
  if (isReportOnly) {
51510
51536
  createConsoleEvent([message], 'warn', { skipStackTrace: true, skipScrubPII: true });
51511
51537
  }
@@ -51513,12 +51539,13 @@ function ConsoleCapture() {
51513
51539
  createConsoleEvent([message], 'error', { skipStackTrace: true, skipScrubPII: true });
51514
51540
  }
51515
51541
  }
51516
- function createConsoleEvent(args, methodName, { skipStackTrace = false, skipScrubPII = false } = {}) {
51542
+ function createConsoleEvent(args, methodName, _a) {
51543
+ var _b = _a === void 0 ? {} : _a, _c = _b.skipStackTrace, skipStackTrace = _c === void 0 ? false : _c, _d = _b.skipScrubPII, skipScrubPII = _d === void 0 ? false : _d;
51517
51544
  if (!isCapturingConsoleLogs || !args || args.length === 0 || !_.contains(CONSOLE_METHODS, methodName))
51518
51545
  return;
51519
51546
  // stringify args
51520
- let message = _.compact(_.map(args, arg => {
51521
- let stringifiedArg;
51547
+ var message = _.compact(_.map(args, function (arg) {
51548
+ var stringifiedArg;
51522
51549
  try {
51523
51550
  stringifiedArg = stringify(arg);
51524
51551
  }
@@ -51530,22 +51557,22 @@ function ConsoleCapture() {
51530
51557
  if (!message)
51531
51558
  return;
51532
51559
  // capture stack trace
51533
- let stackTrace = '';
51560
+ var stackTrace = '';
51534
51561
  if (!skipStackTrace) {
51535
- const maxStackFrames = methodName === 'error' ? 4 : 1;
51562
+ var maxStackFrames = methodName === 'error' ? 4 : 1;
51536
51563
  stackTrace = captureStackTrace(maxStackFrames);
51537
51564
  }
51538
51565
  // truncate message and stack trace
51539
51566
  message = truncate(message);
51540
51567
  stackTrace = truncate(stackTrace);
51541
51568
  // de-duplicate log
51542
- const logKey = generateLogKey(methodName, message, stackTrace);
51569
+ var logKey = generateLogKey(methodName, message, stackTrace);
51543
51570
  if (isExistingDuplicateLog(logKey)) {
51544
51571
  buffer.lastEvent.devLogCount++;
51545
51572
  return;
51546
51573
  }
51547
- const devLogEnvelope = createDevLogEnvelope(pluginAPI, globalPendo);
51548
- const consoleEvent = Object.assign(Object.assign({}, devLogEnvelope), { subType: DEV_LOG_SUB_TYPE, devLogLevel: methodName === 'log' ? 'info' : methodName, devLogMessage: skipScrubPII ? message : scrubPII({ string: message, _ }), devLogTrace: stackTrace, devLogCount: 1 });
51574
+ var devLogEnvelope = createDevLogEnvelope(pluginAPI, globalPendo);
51575
+ 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 });
51549
51576
  if (!buffer.hasTokenAvailable())
51550
51577
  return consoleEvent;
51551
51578
  if (!isPtmPaused) {
@@ -51557,8 +51584,8 @@ function ConsoleCapture() {
51557
51584
  }
51558
51585
  function captureStackTrace(maxStackFrames) {
51559
51586
  try {
51560
- const stackFrames = ErrorStackParser.parse(new Error(), maxStackFrames);
51561
- return _.map(stackFrames, frame => frame.toString()).join('\n');
51587
+ var stackFrames = ErrorStackParser.parse(new Error(), maxStackFrames);
51588
+ return _.map(stackFrames, function (frame) { return frame.toString(); }).join('\n');
51562
51589
  }
51563
51590
  catch (error) {
51564
51591
  return '';
@@ -51570,21 +51597,22 @@ function ConsoleCapture() {
51570
51597
  function updateLastLog(logKey) {
51571
51598
  lastLogKey = logKey;
51572
51599
  }
51573
- function send({ unload = false, hidden = false } = {}) {
51600
+ function send(_a) {
51601
+ var _b = _a === void 0 ? {} : _a, _c = _b.unload, unload = _c === void 0 ? false : _c, _d = _b.hidden, hidden = _d === void 0 ? false : _d;
51574
51602
  if (!buffer || buffer.isEmpty())
51575
51603
  return;
51576
51604
  if (!globalPendo.isSendingEvents()) {
51577
51605
  buffer.clear();
51578
51606
  return;
51579
51607
  }
51580
- const payloads = buffer.pack();
51608
+ var payloads = buffer.pack();
51581
51609
  if (!payloads || payloads.length === 0)
51582
51610
  return;
51583
51611
  if (unload || hidden) {
51584
51612
  sendQueue.drain(payloads, unload);
51585
51613
  }
51586
51614
  else {
51587
- sendQueue.push(...payloads);
51615
+ sendQueue.push.apply(sendQueue, payloads);
51588
51616
  }
51589
51617
  }
51590
51618
  function teardown() {
@@ -51608,7 +51636,7 @@ function ConsoleCapture() {
51608
51636
  _.each(CONSOLE_METHODS, function (methodName) {
51609
51637
  if (!console[methodName])
51610
51638
  return _.noop;
51611
- const unwrap = console[methodName]._pendoUnwrap;
51639
+ var unwrap = console[methodName]._pendoUnwrap;
51612
51640
  if (_.isFunction(unwrap)) {
51613
51641
  unwrap();
51614
51642
  }