@pendo/agent 2.292.0 → 2.292.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/dom.esm.js CHANGED
@@ -7312,7 +7312,7 @@ function getScreenPosition(element) {
7312
7312
  };
7313
7313
  }
7314
7314
 
7315
- var VERSION = '2.292.0_';
7315
+ var VERSION = '2.292.2_';
7316
7316
 
7317
7317
  var decodeURIComponent = _.isFunction(window.decodeURIComponent) ? window.decodeURIComponent : _.identity;
7318
7318
 
@@ -8805,17 +8805,6 @@ var removeNode = function (domNode) {
8805
8805
  domNode.parentNode.removeChild(domNode);
8806
8806
  }
8807
8807
  };
8808
- var getElements = _.compose(function (arrLike) {
8809
- return Array.prototype.slice.call(arrLike);
8810
- }, function (tag, document) {
8811
- try {
8812
- return SizzleProxy(tag, document);
8813
- }
8814
- catch (e) {
8815
- writeMessage('error using sizzle: ' + e);
8816
- return document.getElementsByTagName(tag);
8817
- }
8818
- });
8819
8808
  var pickBestBODY = function (b1, b2) {
8820
8809
  try {
8821
8810
  // check children.length, check Height, check Width?
@@ -8830,9 +8819,9 @@ var pickBestBODY = function (b1, b2) {
8830
8819
  }
8831
8820
  };
8832
8821
  var getBody = function (_document) {
8833
- _document = _document || document;
8822
+ if (_document === void 0) { _document = document; }
8834
8823
  try {
8835
- var bds = getElements('body', _document);
8824
+ var bds = Array.prototype.slice.call(_document.getElementsByTagName('body'));
8836
8825
  if (bds && bds.length > 1) {
8837
8826
  bds.sort(pickBestBODY);
8838
8827
  return bds[0] || _document.body;
@@ -438,7 +438,7 @@ function loadAsModule(config) {
438
438
  }
439
439
  function createPendoObject(config) {
440
440
  var windowOrMountPoint = loadAsModule(config) ? {} : window;
441
- const agentScriptTag = findAgentScriptTag(document.getElementsByTagName('script'), config.apiKey);
441
+ const agentScriptTag = document.currentScript || findAgentScriptTag(document.getElementsByTagName('script'), config.apiKey);
442
442
  let globalKey = config.pendoGlobalKey || 'pendo';
443
443
  if (agentScriptTag) {
444
444
  globalKey = agentScriptTag.getAttribute('data-pendo-global-key') || globalKey;
@@ -463,9 +463,6 @@ function shouldUseUnminifiedAgent(config, debuggingEnabled) {
463
463
  return !isExtension(config) && isMinifiedAgent(config) && debuggingEnabled;
464
464
  }
465
465
  function findAgentScriptTag(scripts = [], apiKey) {
466
- if (document.currentScript) {
467
- return document.currentScript;
468
- }
469
466
  const regex = /^https:\/\/[\w\-.]*cdn[\w\-.]*\.(pendo-dev\.com|pendo\.io)\/agent\/static\/([\w]{8}-[\w]{4}-[\w]{4}-[\w]{4}-[\w]{12}|PENDO_API_KEY)\/pendo\.js$/g;
470
467
  for (let i = 0; i < scripts.length; i++) {
471
468
  const script = scripts[i];
@@ -3911,8 +3908,8 @@ var SERVER = '';
3911
3908
  var ASSET_HOST = '';
3912
3909
  var ASSET_PATH = '';
3913
3910
  var DESIGNER_SERVER = '';
3914
- var VERSION = '2.292.0_';
3915
- var PACKAGE_VERSION = '2.292.0';
3911
+ var VERSION = '2.292.2_';
3912
+ var PACKAGE_VERSION = '2.292.2';
3916
3913
  var LOADER = 'xhr';
3917
3914
  /* eslint-enable agent-eslint-rules/no-gulp-env-references */
3918
3915
  /**
@@ -10140,17 +10137,6 @@ var removeNode = function (domNode) {
10140
10137
  domNode.parentNode.removeChild(domNode);
10141
10138
  }
10142
10139
  };
10143
- var getElements = _.compose(function (arrLike) {
10144
- return Array.prototype.slice.call(arrLike);
10145
- }, function (tag, document) {
10146
- try {
10147
- return SizzleProxy(tag, document);
10148
- }
10149
- catch (e) {
10150
- writeMessage('error using sizzle: ' + e);
10151
- return document.getElementsByTagName(tag);
10152
- }
10153
- });
10154
10140
  var pickBestBODY = function (b1, b2) {
10155
10141
  try {
10156
10142
  // check children.length, check Height, check Width?
@@ -10164,10 +10150,9 @@ var pickBestBODY = function (b1, b2) {
10164
10150
  return 0;
10165
10151
  }
10166
10152
  };
10167
- var getBody = function (_document) {
10168
- _document = _document || document;
10153
+ var getBody = function (_document = document) {
10169
10154
  try {
10170
- var bds = getElements('body', _document);
10155
+ var bds = Array.prototype.slice.call(_document.getElementsByTagName('body'));
10171
10156
  if (bds && bds.length > 1) {
10172
10157
  bds.sort(pickBestBODY);
10173
10158
  return bds[0] || _document.body;
@@ -24004,8 +23989,13 @@ class GuideCache {
24004
23989
  return;
24005
23990
  cachedStep.seenState = lastGuideStepSeen.state;
24006
23991
  cachedStep.seenReason = lastGuideStepSeen.seenReason;
24007
- cachedStep.dismissCount = lastGuideStepSeen.dismissCount;
24008
- cachedStep.snoozeEndTime = lastGuideStepSeen.snoozeEndTime;
23992
+ cachedStep.lastSeenAt = lastGuideStepSeen.time;
23993
+ if (lastGuideStepSeen.dismissCount != null) {
23994
+ cachedStep.dismissCount = lastGuideStepSeen.dismissCount;
23995
+ }
23996
+ if (lastGuideStepSeen.snoozeEndTime != null) {
23997
+ cachedStep.snoozeEndTime = lastGuideStepSeen.snoozeEndTime;
23998
+ }
24009
23999
  return this.save(cachedGuide);
24010
24000
  }
24011
24001
  list(visitorId, now = getNow()) {