@active-reach/web-sdk 1.32.0 → 1.34.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"reviews.d.ts","sourceRoot":"","sources":["../../../src/inapp/renderers/reviews.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAG7C;iFACiF;AACjF,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;CACjB;AAuKD,wBAAgB,mBAAmB,CACjC,GAAG,EAAE,aAAa,EAClB,MAAM,EAAE,WAAW,EACnB,KAAK,EAAE,kBAAkB,GACxB,OAAO,CA8QT;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,aAAa,EAAE,KAAK,EAAE,kBAAkB,GAAG,IAAI,CAgCxF"}
1
+ {"version":3,"file":"reviews.d.ts","sourceRoot":"","sources":["../../../src/inapp/renderers/reviews.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAG7C;iFACiF;AACjF,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;CACjB;AAuKD,wBAAgB,mBAAmB,CACjC,GAAG,EAAE,aAAa,EAClB,MAAM,EAAE,WAAW,EACnB,KAAK,EAAE,kBAAkB,GACxB,OAAO,CAqRT;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,aAAa,EAAE,KAAK,EAAE,kBAAkB,GAAG,IAAI,CAgCxF"}
package/dist/index.js CHANGED
@@ -5170,7 +5170,9 @@ function renderReviewsInline(ctx, target, creds) {
5170
5170
  if (typeof document === "undefined" || !(creds == null ? void 0 : creds.apiHost) || !(creds == null ? void 0 : creds.writeKey)) return false;
5171
5171
  ensureInAppFont();
5172
5172
  const ic = ctx.campaign.interactive_config || {};
5173
- const accent = ctx.sanitizeColor(ctx.campaign.background_color || "#4169e1");
5173
+ const accent = ctx.sanitizeColor(
5174
+ target.getAttribute("data-accent") || ctx.campaign.background_color || "#4169e1"
5175
+ );
5174
5176
  const rawBrand = (target.getAttribute("data-brand-name") || String(ic.brand_name || "")).trim();
5175
5177
  const brand = (rawBrand.split(/\s[|·–-]\s/)[0] || "").trim() || "The store";
5176
5178
  const productId = target.getAttribute("data-product-id") || ctx.campaign.product_id || null;
@@ -5186,7 +5188,7 @@ function renderReviewsInline(ctx, target, creds) {
5186
5188
  return url.toString();
5187
5189
  }
5188
5190
  function fetchReviews() {
5189
- return fetch(buildUrl(), { method: "GET", headers: { "X-Aegis-Write-Key": creds.writeKey } }).then((r) => r.ok ? r.json() : null).catch(() => null);
5191
+ return fetch(buildUrl(), { method: "GET", cache: "no-store", headers: { "X-Aegis-Write-Key": creds.writeKey } }).then((r) => r.ok ? r.json() : null).catch(() => null);
5190
5192
  }
5191
5193
  let listContainer = null;
5192
5194
  function reviewCard(r) {
@@ -5297,7 +5299,7 @@ function renderReviewsInline(ctx, target, creds) {
5297
5299
  return bar;
5298
5300
  }
5299
5301
  function distributionPanel(dist, total) {
5300
- const box = el("div", "flex:1 1 260px;max-width:340px;display:flex;flex-direction:column;gap:7px;");
5302
+ const box = el("div", "flex:0 1 300px;width:300px;max-width:100%;display:flex;flex-direction:column;gap:7px;");
5301
5303
  for (let r = 5; r >= 1; r--) {
5302
5304
  const n = dist[String(r)] ?? 0;
5303
5305
  const pct = total > 0 ? Math.round(n / total * 100) : 0;
@@ -14226,13 +14228,25 @@ class AegisLoyaltyManager {
14226
14228
  this.giftCards = new GiftCardsClient(http);
14227
14229
  }
14228
14230
  }
14229
- class AegisMessageRuntime {
14231
+ const _AegisMessageRuntime = class _AegisMessageRuntime {
14230
14232
  // Context is held in ONE place — `intentRuleEvaluator.namespaces` (fed via
14231
14233
  // updateContext). The renderer cart reader + the cart_value signal are DERIVED
14232
14234
  // from it; there is no parallel cart/context store on the runtime.
14233
14235
  constructor(config) {
14234
14236
  var _a;
14235
14237
  this.initialized = false;
14238
+ if (!_AegisMessageRuntime._bannerPrinted) {
14239
+ _AegisMessageRuntime._bannerPrinted = true;
14240
+ try {
14241
+ const v = true ? "1.34.0" : "unknown";
14242
+ console.info(
14243
+ `%c[Aegis SDK]%c v${v} loaded`,
14244
+ "color:#fff;background:#7c3aed;padding:1px 6px;border-radius:4px;font-weight:700",
14245
+ "color:#7c3aed;font-weight:600"
14246
+ );
14247
+ } catch {
14248
+ }
14249
+ }
14236
14250
  const triggerEngine = config.triggerEngine ?? new TriggerEngine();
14237
14251
  const ownsTriggerEngine = !config.triggerEngine;
14238
14252
  this.contactId = config.contactId;
@@ -14557,7 +14571,9 @@ class AegisMessageRuntime {
14557
14571
  getCampaigns() {
14558
14572
  return this.inApp.campaigns ?? [];
14559
14573
  }
14560
- }
14574
+ };
14575
+ _AegisMessageRuntime._bannerPrinted = false;
14576
+ let AegisMessageRuntime = _AegisMessageRuntime;
14561
14577
  const COOKIE_NAME = "aegis_fpc";
14562
14578
  const COOKIE_MAX_AGE_DAYS = 365 * 2;
14563
14579
  class BootstrapError extends Error {