@ada-support/embed2 1.0.74 → 1.0.77

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.
@@ -8788,7 +8788,7 @@ var client = new error_tracker_BrowserClient({
8788
8788
  return event;
8789
8789
  },
8790
8790
  environment: "production",
8791
- release: "1.0.74-98a17a0",
8791
+ release: "1.0.77-12e8ab2",
8792
8792
  sampleRate: 0.25,
8793
8793
  autoSessionTracking: false,
8794
8794
  // Integrations don't seem to work with Sentry: https://github.com/getsentry/sentry-javascript/issues/2541
@@ -9490,7 +9490,7 @@ function getEmbedURL(_ref) {
9490
9490
  polyfillVersionString = "legacy";
9491
9491
  }
9492
9492
 
9493
- return concat_default()(_context5 = concat_default()(_context6 = concat_default()(_context7 = "".concat(host, "/embed/")).call(_context7, polyfillVersionString, "/")).call(_context6, frameName, "/")).call(_context5, "98a17a0", "/index.html");
9493
+ return concat_default()(_context5 = concat_default()(_context6 = concat_default()(_context7 = "".concat(host, "/embed/")).call(_context7, polyfillVersionString, "/")).call(_context6, frameName, "/")).call(_context5, "12e8ab2", "/index.html");
9494
9494
  }
9495
9495
  /**
9496
9496
  * Generate the Chat / API URL
@@ -10397,8 +10397,20 @@ var get_browser_language_getBrowserLanguage = function getBrowserLanguage() {
10397
10397
 
10398
10398
  /* harmony default export */ var get_browser_language = (get_browser_language_getBrowserLanguage);
10399
10399
  ;// CONCATENATED MODULE: ./src/services/helpers.ts
10400
+
10400
10401
  var NO_OP_FUNCTION = function NO_OP_FUNCTION() {// Do nothing
10401
10402
  };
10403
+ function isStartOptions(input) {
10404
+ if (!(_typeof(input) === "object")) {
10405
+ return false;
10406
+ }
10407
+
10408
+ if (input === null) {
10409
+ return false;
10410
+ }
10411
+
10412
+ return typeof input.handle === "string";
10413
+ }
10402
10414
  ;// CONCATENATED MODULE: ./src/campaigns/campaign.ts
10403
10415
 
10404
10416
 
@@ -12763,8 +12775,7 @@ var Container = /*#__PURE__*/function (_Component) {
12763
12775
  chatterInLiveChat = _this$props2.chatterInLiveChat,
12764
12776
  messageService = _this$props2.messageService,
12765
12777
  wasCampaignShownButNowClosed = _this$props2.wasCampaignShownButNowClosed,
12766
- isChatEmpty = _this$props2.isChatEmpty,
12767
- setState = _this$props2.setState;
12778
+ isChatEmpty = _this$props2.isChatEmpty;
12768
12779
  var adaReadyCallback = adaSettings.adaReadyCallback,
12769
12780
  toggleCallback = adaSettings.toggleCallback;
12770
12781
 
@@ -12836,14 +12847,6 @@ var Container = /*#__PURE__*/function (_Component) {
12836
12847
  }); // If the campaign has not been closed (i.e. is still visible), send the follow up response
12837
12848
  } else if (isChatEmpty) {
12838
12849
  chatChannel.postMessage(SEND_GREETING);
12839
- } // We want to reset the state because there's a possibility
12840
- // that a user might engage with another campaign on another page path
12841
-
12842
-
12843
- if (wasCampaignShownButNowClosed) {
12844
- setState({
12845
- wasCampaignShownButNowClosed: false
12846
- });
12847
12850
  }
12848
12851
 
12849
12852
  this.setState({
@@ -14344,7 +14347,7 @@ window.__AdaEmbedConstructor = Embed;
14344
14347
  /* harmony export */ });
14345
14348
  var isModern = new RegExp("((CPU[ +]OS|iPhone[ +]OS|CPU[ +]iPhone|CPU IPhone OS)[ +]+(15|(1[6-9]|[2-9]\\d|\\d{3,}))[_.]\\d+(?:[_.]\\d+)?)|((Chromium|Chrome)\\/(99|([1-9]\\d\\d|\\d{4,}))\\.\\d+(?:\\.\\d+)?)|(Version\\/(15|(1[6-9]|[2-9]\\d|\\d{3,}))\\.\\d+(?:\\.\\d+)? Safari\\/)|(Firefox\\/(98|(99|\\d{3,}))\\.\\d+\\.\\d+)|(Firefox\\/(98|(99|\\d{3,}))\\.\\d+(pre|[ab]\\d+[a-z]*)?)").test(navigator.userAgent);
14346
14349
  var isProduction = "production" === "production";
14347
- var embed2Version = "98a17a0";
14350
+ var embed2Version = "12e8ab2";
14348
14351
 
14349
14352
  /***/ }),
14350
14353
 
@@ -14690,9 +14693,9 @@ function _log() {
14690
14693
  service: "embed",
14691
14694
  env: "production",
14692
14695
  embedVersion: 2,
14693
- version: "1.0.74",
14696
+ version: "1.0.77",
14694
14697
  isNpm: true,
14695
- commitHash: "98a17a0"
14698
+ commitHash: "12e8ab2"
14696
14699
  }))
14697
14700
  });
14698
14701
 
@@ -25633,7 +25636,7 @@ function _loadEmbed() {
25633
25636
  polyfillVersionString = "legacy";
25634
25637
  }
25635
25638
 
25636
- embedScriptSource = concat_default()(_context17 = concat_default()(_context18 = "".concat(host, "/embed/")).call(_context18, polyfillVersionString, "/client/")).call(_context17, "98a17a0", "/index.js");
25639
+ embedScriptSource = concat_default()(_context17 = concat_default()(_context18 = "".concat(host, "/embed/")).call(_context18, polyfillVersionString, "/client/")).call(_context17, "12e8ab2", "/index.js");
25637
25640
  }
25638
25641
 
25639
25642
  clientScriptExists = Boolean( true || // The client script is bundled with npm module
@@ -25759,7 +25762,10 @@ function createEmbedObject() {
25759
25762
  (0,logger/* log */.cM)("Embed start", {
25760
25763
  handle: adaSettings.handle,
25761
25764
  embedSettings: adaSettings,
25762
- hostPage: window.location.href
25765
+ hostPage: window.location.href,
25766
+ adaScriptURL: function (scriptElement) {
25767
+ return scriptElement ? scriptElement.src : null;
25768
+ }(document.getElementById("__ada"))
25763
25769
  });
25764
25770
  return _context2.abrupt("return", embed.initialized);
25765
25771
 
@@ -1 +1,3 @@
1
+ import type { StartOptions } from "common/types/store-state";
1
2
  export declare const NO_OP_FUNCTION: () => void;
3
+ export declare function isStartOptions(input: unknown): input is StartOptions;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ada-support/embed2",
3
- "version": "1.0.74",
3
+ "version": "1.0.77",
4
4
  "description": "",
5
5
  "main": "dist/npm-entry",
6
6
  "typings": "dist/npm-entry/index.d.ts",
@@ -76,7 +76,7 @@
76
76
  "eslint-plugin-cypress": "^2.11.3",
77
77
  "eslint-plugin-sonarjs": "^0.11.0",
78
78
  "husky": "^7.0.0",
79
- "jest": "^27.3.1",
79
+ "jest": "^27.5.1",
80
80
  "jest-localstorage-mock": "^2.4.0",
81
81
  "lint-staged": "^11.2.3",
82
82
  "npm-run-all": "^4.1.5",
@@ -100,7 +100,7 @@
100
100
  "@babel/preset-typescript": "^7.16.7",
101
101
  "@babel/runtime-corejs3": "^7.15.4",
102
102
  "@sentry/browser": "^6.17.1",
103
- "@sentry/webpack-plugin": "^1.18.4",
103
+ "@sentry/webpack-plugin": "^1.18.8",
104
104
  "babel-loader": "^8.2.3",
105
105
  "babel-preset-preact": "^2.0.0",
106
106
  "browserslist-useragent-regexp": "^3.0.2",