@ada-support/embed2 1.14.21 → 1.14.23

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.
@@ -1,3 +1,4 @@
1
1
  export declare function getProcessedPath(path: string): string;
2
2
  export declare function getPathSearchRegex(path: string): RegExp;
3
+ export declare const stripTrailingSlash: (value: string) => string;
3
4
  export declare function doesUrlMatchPath(url: string, path: string): boolean;
@@ -16119,7 +16119,7 @@ const client = new BrowserClient({
16119
16119
  return event;
16120
16120
  },
16121
16121
  environment: "production",
16122
- release: "1.14.21-7e99166",
16122
+ release: "1.14.23-66c65db",
16123
16123
  sampleRate: 0.25,
16124
16124
  autoSessionTracking: false,
16125
16125
  // Integrations don't seem to work with Sentry: https://github.com/getsentry/sentry-javascript/issues/2541
@@ -16750,7 +16750,7 @@ function getEmbedURL(_ref) {
16750
16750
  } else {
16751
16751
  host = `http://${handle}.localhost:${ports.localhost.default}`;
16752
16752
  }
16753
- return `${host}/embed/${frameName}/${"7e99166"}/index.html`;
16753
+ return `${host}/embed/${frameName}/${"66c65db"}/index.html`;
16754
16754
  }
16755
16755
  function constructQueryString(query) {
16756
16756
  return Object.keys(query).map(key => {
@@ -17586,9 +17586,9 @@ async function log(message, extra, options) {
17586
17586
  service: "embed",
17587
17587
  env: "production",
17588
17588
  embedVersion: 2,
17589
- version: "1.14.21",
17589
+ version: "1.14.23",
17590
17590
  isNpm: true,
17591
- commitHash: "7e99166"
17591
+ commitHash: "66c65db"
17592
17592
  }))
17593
17593
  });
17594
17594
  }
@@ -17615,16 +17615,23 @@ function getPathSearchRegex(path) {
17615
17615
  const newPath = hasTrailingWildcard ? `${escaped}(/.*)?` : escaped;
17616
17616
  return new RegExp(`^${newPath}$`);
17617
17617
  }
17618
+
17619
+ // A trailing slash is not significant. docs.ada.cx documents "Exactly Matches" as matching
17620
+ // `https://www.example.com/checkout/` for a `https://www.example.com/checkout` condition,
17621
+ // and the `ends-with` arm in TriggerConditionEvaluator already tolerates one the same way —
17622
+ // so `equals` requiring an exact slash was the odd one out, not the documented behaviour.
17623
+ const stripTrailingSlash = value => value.endsWith("/") ? value.slice(0, -1) : value;
17618
17624
  function doesUrlMatchPath(url, path) {
17619
- const processedUrl = getProcessedPath(url);
17620
- const processedPath = getProcessedPath(path);
17625
+ // Normalized on BOTH sides, so it does not matter which of the page URL or the authored
17626
+ // condition carries the slash.
17627
+ const processedUrl = stripTrailingSlash(getProcessedPath(url));
17628
+ const processedPath = stripTrailingSlash(getProcessedPath(path));
17621
17629
  const pathRegex = getPathSearchRegex(processedPath);
17622
17630
  const matches = pathRegex.exec(processedUrl);
17623
17631
  return matches !== null;
17624
17632
  }
17625
17633
  ;// ./src/common/helpers/TriggerConditionEvaluator.ts
17626
17634
 
17627
- const stripTrailingSlash = url => url.endsWith("/") ? url.slice(0, -1) : url;
17628
17635
  const evalUrlMatchTriggerCondition = (triggerConditions, url) => {
17629
17636
  /**
17630
17637
  * Behaviour
@@ -20394,7 +20401,7 @@ class ChatFrame extends d {
20394
20401
  log("Chat frame mount", {
20395
20402
  handle,
20396
20403
  chatUrl: this.url,
20397
- embedVersion: "7e99166".slice(0, 7),
20404
+ embedVersion: "66c65db".slice(0, 7),
20398
20405
  embedSettings: adaSettings
20399
20406
  });
20400
20407
 
@@ -20482,7 +20489,7 @@ class ChatFrame extends d {
20482
20489
  const hostPageUrlParams = new URL(window.location.href).searchParams;
20483
20490
  const smsToken = hostPageUrlParams.get("adaSMSToken");
20484
20491
  const queryParams = {
20485
- embedVersion: "7e99166".slice(0, 7),
20492
+ embedVersion: "66c65db".slice(0, 7),
20486
20493
  greeting,
20487
20494
  language,
20488
20495
  skipGreeting,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ada-support/embed2",
3
- "version": "1.14.21",
3
+ "version": "1.14.23",
4
4
  "description": "",
5
5
  "main": "dist/npm-entry",
6
6
  "typings": "dist/npm-entry/index-npm.d.ts",
@@ -115,4 +115,4 @@
115
115
  "publishConfig": {
116
116
  "access": "public"
117
117
  }
118
- }
118
+ }