@active-reach/web-sdk 1.43.5 → 1.43.6
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/aegis.min.js +1 -1
- package/dist/aegis.min.js.map +1 -1
- package/dist/inapp/AegisInAppManager.d.ts +15 -0
- package/dist/inapp/AegisInAppManager.d.ts.map +1 -1
- package/dist/inapp/page-url-rules.d.ts +32 -0
- package/dist/inapp/page-url-rules.d.ts.map +1 -0
- package/dist/index.js +106 -22
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -54,6 +54,8 @@ export interface InAppCampaign {
|
|
|
54
54
|
page_key?: 'bill' | 'rewards' | 'feedback' | 'reviews' | 'members';
|
|
55
55
|
surface?: string[];
|
|
56
56
|
target_screens?: string[];
|
|
57
|
+
page_url_match?: string | null;
|
|
58
|
+
page_url_exclude?: string | null;
|
|
57
59
|
journey_step_execution_id?: string | null;
|
|
58
60
|
}
|
|
59
61
|
/**
|
|
@@ -352,8 +354,11 @@ export declare class AegisInAppManager {
|
|
|
352
354
|
private filledSlots;
|
|
353
355
|
private slotSignatures;
|
|
354
356
|
private slotTimers;
|
|
357
|
+
private renderedSlots;
|
|
355
358
|
private slotObserver;
|
|
356
359
|
private slotRenderScheduled;
|
|
360
|
+
private slotsTornDown;
|
|
361
|
+
private lifecycleGen;
|
|
357
362
|
private slotUnfilledBeaconed;
|
|
358
363
|
private slotUnfilledSweepTimer;
|
|
359
364
|
/**
|
|
@@ -384,6 +389,16 @@ export declare class AegisInAppManager {
|
|
|
384
389
|
* - hosts that declare nothing keep the legacy render-everything default
|
|
385
390
|
*/
|
|
386
391
|
private matchesCurrentScreenOrSurface;
|
|
392
|
+
/** The page URL the server's page rules saw: what `refreshCampaigns` sends
|
|
393
|
+
* as `page_url` (pathname + search, credential values redacted). Null off
|
|
394
|
+
* the browser — no page, no filter (the server's rule too). */
|
|
395
|
+
private currentPageUrl;
|
|
396
|
+
/** The full client placement gate: screen/surface tier AND page rules, both
|
|
397
|
+
* mirroring `/v1/in-app/active`, applied to CACHED campaigns (the page may
|
|
398
|
+
* have changed since the fetch — SPA navigation). */
|
|
399
|
+
private isPlaceableHere;
|
|
400
|
+
/** Remove everything this manager injected into `slot` and stop its rotation. */
|
|
401
|
+
private clearSlotContent;
|
|
387
402
|
private ensureSlotObserver;
|
|
388
403
|
private renderIntoSlots;
|
|
389
404
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AegisInAppManager.d.ts","sourceRoot":"","sources":["../../src/inapp/AegisInAppManager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,KAAK,EAAiB,SAAS,EAAE,MAAM,aAAa,CAAC;AAC5D,OAAO,EAIL,KAAK,WAAW,EAEjB,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"AegisInAppManager.d.ts","sourceRoot":"","sources":["../../src/inapp/AegisInAppManager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,KAAK,EAAiB,SAAS,EAAE,MAAM,aAAa,CAAC;AAC5D,OAAO,EAIL,KAAK,WAAW,EAEjB,MAAM,WAAW,CAAC;AAiDnB,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EACA,OAAO,GACP,QAAQ,GACR,SAAS,GACT,aAAa,GACb,mBAAmB,GACnB,OAAO,GACP,KAAK,GACL,OAAO,GAEP,SAAS,GAET,gBAAgB,GAChB,YAAY,GACZ,cAAc,GACd,gBAAgB,GAChB,wBAAwB,GAGxB,iBAAiB,GACjB,aAAa,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MA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apps/cell-plane/app/services/in_app/page_url_rules.py). Both read ONE
|
|
6
|
+
* fixture file, `libs/web-sdk/src/inapp/__fixtures__/page-url-rules.json`, so
|
|
7
|
+
* the two cannot drift: change the semantics in both files and the fixtures in
|
|
8
|
+
* the same commit, or in none.
|
|
9
|
+
*
|
|
10
|
+
* Semantics (the server's, kept exactly, quirks included):
|
|
11
|
+
* - Each rule is a comma-separated list of patterns. `*` becomes `.*`; every
|
|
12
|
+
* other character is a regular-expression character as written.
|
|
13
|
+
* - A pattern matches when it matches at the START of the page URL (Python
|
|
14
|
+
* `re.match`): `/p/*` matches `/p/x`, not `/s/a/p/x`. Nothing anchors the
|
|
15
|
+
* end, so a trailing query string never stops a match.
|
|
16
|
+
* - `page_url_match`: when at least one non-empty pattern is listed, the page
|
|
17
|
+
* must match one of them.
|
|
18
|
+
* - `page_url_exclude`: the page must match none. An EMPTY piece (`"*\/p/*,"`)
|
|
19
|
+
* matches every URL, so a trailing comma excludes everywhere — the server
|
|
20
|
+
* has always behaved this way and the fixtures pin it.
|
|
21
|
+
* - No page URL, or an empty rule, applies no filter.
|
|
22
|
+
* - A pattern that is not a valid regular expression matches nothing.
|
|
23
|
+
*
|
|
24
|
+
* The page URL is what the SDK sends as `page_url` to `/v1/in-app/active`:
|
|
25
|
+
* pathname + search, credential values redacted.
|
|
26
|
+
*/
|
|
27
|
+
export interface PageUrlRules {
|
|
28
|
+
page_url_match?: string | null;
|
|
29
|
+
page_url_exclude?: string | null;
|
|
30
|
+
}
|
|
31
|
+
export declare function pageUrlRulesPass(rules: PageUrlRules | null | undefined, pageUrl: string | null | undefined): boolean;
|
|
32
|
+
//# sourceMappingURL=page-url-rules.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"page-url-rules.d.ts","sourceRoot":"","sources":["../../src/inapp/page-url-rules.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,WAAW,YAAY;IAC3B,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,gBAAgB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAClC;AAeD,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,YAAY,GAAG,IAAI,GAAG,SAAS,EACtC,OAAO,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GACjC,OAAO,CAsBT"}
|
package/dist/index.js
CHANGED
|
@@ -6362,6 +6362,33 @@ function scratchOutcome(resp) {
|
|
|
6362
6362
|
if (resp.won === false || (prize == null ? void 0 : prize.win) === false || (prize == null ? void 0 : prize.prize_type) === "no_prize") return false;
|
|
6363
6363
|
return void 0;
|
|
6364
6364
|
}
|
|
6365
|
+
function patternMatches(pattern, pageUrl) {
|
|
6366
|
+
let re;
|
|
6367
|
+
try {
|
|
6368
|
+
re = new RegExp(pattern.split("*").join(".*"), "y");
|
|
6369
|
+
} catch {
|
|
6370
|
+
return false;
|
|
6371
|
+
}
|
|
6372
|
+
re.lastIndex = 0;
|
|
6373
|
+
return re.test(pageUrl);
|
|
6374
|
+
}
|
|
6375
|
+
function pageUrlRulesPass(rules, pageUrl) {
|
|
6376
|
+
if (!rules || !pageUrl) return true;
|
|
6377
|
+
const match = rules.page_url_match;
|
|
6378
|
+
if (match) {
|
|
6379
|
+
const patterns = match.split(",").map((p) => p.trim()).filter((p) => p.length > 0);
|
|
6380
|
+
if (patterns.length > 0 && !patterns.some((p) => patternMatches(p, pageUrl))) {
|
|
6381
|
+
return false;
|
|
6382
|
+
}
|
|
6383
|
+
}
|
|
6384
|
+
const exclude = rules.page_url_exclude;
|
|
6385
|
+
if (exclude) {
|
|
6386
|
+
for (const piece of exclude.split(",")) {
|
|
6387
|
+
if (patternMatches(piece.trim(), pageUrl)) return false;
|
|
6388
|
+
}
|
|
6389
|
+
}
|
|
6390
|
+
return true;
|
|
6391
|
+
}
|
|
6365
6392
|
const RETURNING_MARKER_KEY = "aegis_returning_user";
|
|
6366
6393
|
const SESSION_VERDICT_KEY = "aegis_new_visitor_session";
|
|
6367
6394
|
let cachedVerdict = null;
|
|
@@ -6553,8 +6580,11 @@ const _AegisInAppManager = class _AegisInAppManager {
|
|
|
6553
6580
|
this.filledSlots = /* @__PURE__ */ new WeakSet();
|
|
6554
6581
|
this.slotSignatures = /* @__PURE__ */ new WeakMap();
|
|
6555
6582
|
this.slotTimers = /* @__PURE__ */ new WeakMap();
|
|
6583
|
+
this.renderedSlots = /* @__PURE__ */ new Set();
|
|
6556
6584
|
this.slotObserver = null;
|
|
6557
6585
|
this.slotRenderScheduled = false;
|
|
6586
|
+
this.slotsTornDown = false;
|
|
6587
|
+
this.lifecycleGen = 0;
|
|
6558
6588
|
this.slotUnfilledBeaconed = /* @__PURE__ */ new Set();
|
|
6559
6589
|
this.slotUnfilledSweepTimer = null;
|
|
6560
6590
|
this._pushOptInLoading = false;
|
|
@@ -6661,6 +6691,7 @@ const _AegisInAppManager = class _AegisInAppManager {
|
|
|
6661
6691
|
return this.register("error", handler);
|
|
6662
6692
|
}
|
|
6663
6693
|
async initialize() {
|
|
6694
|
+
this.slotsTornDown = false;
|
|
6664
6695
|
if (this.isInitialized) {
|
|
6665
6696
|
this.log("AegisInApp already initialized");
|
|
6666
6697
|
return;
|
|
@@ -7077,6 +7108,7 @@ const _AegisInAppManager = class _AegisInAppManager {
|
|
|
7077
7108
|
}, delay);
|
|
7078
7109
|
}
|
|
7079
7110
|
async refreshCampaigns() {
|
|
7111
|
+
const gen = this.lifecycleGen;
|
|
7080
7112
|
try {
|
|
7081
7113
|
const context = new URLSearchParams({
|
|
7082
7114
|
device_type: this.detectDeviceType(),
|
|
@@ -7123,10 +7155,12 @@ const _AegisInAppManager = class _AegisInAppManager {
|
|
|
7123
7155
|
headers,
|
|
7124
7156
|
credentials: "include"
|
|
7125
7157
|
});
|
|
7158
|
+
if (gen !== this.lifecycleGen) return;
|
|
7126
7159
|
if (!response.ok) {
|
|
7127
7160
|
throw new Error(`Failed to fetch campaigns: ${response.status}`);
|
|
7128
7161
|
}
|
|
7129
7162
|
const payload = await response.json();
|
|
7163
|
+
if (gen !== this.lifecycleGen) return;
|
|
7130
7164
|
this.campaigns = Array.isArray(payload) ? payload : [];
|
|
7131
7165
|
this.processABAssignments(this.campaigns);
|
|
7132
7166
|
this.rehydrateSuppressionFromStorage();
|
|
@@ -7140,6 +7174,7 @@ const _AegisInAppManager = class _AegisInAppManager {
|
|
|
7140
7174
|
this.renderIntoAnchors();
|
|
7141
7175
|
this.renderTokenAnchors();
|
|
7142
7176
|
} catch (error) {
|
|
7177
|
+
if (gen !== this.lifecycleGen) return;
|
|
7143
7178
|
this.emitError(error, { stage: "refresh-campaigns" });
|
|
7144
7179
|
this.log(`Error refreshing campaigns: ${error}`, "error");
|
|
7145
7180
|
}
|
|
@@ -7277,6 +7312,30 @@ const _AegisInAppManager = class _AegisInAppManager {
|
|
|
7277
7312
|
if (this.currentScreen !== null) return false;
|
|
7278
7313
|
return true;
|
|
7279
7314
|
}
|
|
7315
|
+
/** The page URL the server's page rules saw: what `refreshCampaigns` sends
|
|
7316
|
+
* as `page_url` (pathname + search, credential values redacted). Null off
|
|
7317
|
+
* the browser — no page, no filter (the server's rule too). */
|
|
7318
|
+
currentPageUrl() {
|
|
7319
|
+
if (typeof window === "undefined" || !window.location) return null;
|
|
7320
|
+
return redactUrl((window.location.pathname || "") + (window.location.search || ""));
|
|
7321
|
+
}
|
|
7322
|
+
/** The full client placement gate: screen/surface tier AND page rules, both
|
|
7323
|
+
* mirroring `/v1/in-app/active`, applied to CACHED campaigns (the page may
|
|
7324
|
+
* have changed since the fetch — SPA navigation). */
|
|
7325
|
+
isPlaceableHere(c) {
|
|
7326
|
+
return this.matchesCurrentScreenOrSurface(c) && pageUrlRulesPass(c, this.currentPageUrl());
|
|
7327
|
+
}
|
|
7328
|
+
/** Remove everything this manager injected into `slot` and stop its rotation. */
|
|
7329
|
+
clearSlotContent(slot) {
|
|
7330
|
+
const timer = this.slotTimers.get(slot);
|
|
7331
|
+
if (timer) {
|
|
7332
|
+
clearInterval(timer);
|
|
7333
|
+
this.slotTimers.delete(slot);
|
|
7334
|
+
}
|
|
7335
|
+
slot.querySelectorAll(
|
|
7336
|
+
":scope > [data-aegis-rotate-pane], :scope > [data-aegis-slot-rendered], :scope > [data-aegis-rotate-dots]"
|
|
7337
|
+
).forEach((n) => n.remove());
|
|
7338
|
+
}
|
|
7280
7339
|
// Re-fill slots that mount after a poll (SPA route changes). Observes the DOM
|
|
7281
7340
|
// once; when a new [data-aegis-slot] appears it re-runs renderIntoSlots from
|
|
7282
7341
|
// the cached campaigns (idempotent — already-filled slots are skipped). Does
|
|
@@ -7303,6 +7362,7 @@ const _AegisInAppManager = class _AegisInAppManager {
|
|
|
7303
7362
|
this.slotRenderScheduled = true;
|
|
7304
7363
|
const run = () => {
|
|
7305
7364
|
this.slotRenderScheduled = false;
|
|
7365
|
+
if (this.slotsTornDown) return;
|
|
7306
7366
|
this.renderIntoSlots();
|
|
7307
7367
|
};
|
|
7308
7368
|
if (typeof requestAnimationFrame === "function") requestAnimationFrame(run);
|
|
@@ -7312,15 +7372,23 @@ const _AegisInAppManager = class _AegisInAppManager {
|
|
|
7312
7372
|
}
|
|
7313
7373
|
renderIntoSlots() {
|
|
7314
7374
|
var _a, _b;
|
|
7315
|
-
if (typeof document === "undefined") return;
|
|
7375
|
+
if (typeof document === "undefined" || this.slotsTornDown) return;
|
|
7316
7376
|
this.ensureSlotObserver();
|
|
7317
7377
|
this.scheduleSlotUnfilledSweep();
|
|
7378
|
+
this.renderedSlots.forEach((slot) => {
|
|
7379
|
+
if (slot.isConnected === false) {
|
|
7380
|
+
const timer = this.slotTimers.get(slot);
|
|
7381
|
+
if (timer) clearInterval(timer);
|
|
7382
|
+
this.slotTimers.delete(slot);
|
|
7383
|
+
this.renderedSlots.delete(slot);
|
|
7384
|
+
}
|
|
7385
|
+
});
|
|
7318
7386
|
const slots = document.querySelectorAll("[data-aegis-slot]");
|
|
7319
7387
|
if (slots.length === 0) return;
|
|
7320
7388
|
const eligibleByCategory = /* @__PURE__ */ new Map();
|
|
7321
7389
|
const seenIds = /* @__PURE__ */ new Set();
|
|
7322
7390
|
for (const c of this.campaigns) {
|
|
7323
|
-
if (!this.
|
|
7391
|
+
if (!this.isPlaceableHere(c)) continue;
|
|
7324
7392
|
const modes = c.delivery_modes;
|
|
7325
7393
|
const category = c.widget_category;
|
|
7326
7394
|
if (!modes || !modes.includes("embedded_card")) continue;
|
|
@@ -7347,18 +7415,6 @@ const _AegisInAppManager = class _AegisInAppManager {
|
|
|
7347
7415
|
if (!key) return;
|
|
7348
7416
|
const list = eligibleByCategory.get(key);
|
|
7349
7417
|
if (!list || list.length === 0) return;
|
|
7350
|
-
const sig = list.map((c) => `${c.id}:${c.assigned_variant_id ?? ""}`).join(",");
|
|
7351
|
-
if (this.filledSlots.has(slot) && this.slotSignatures.get(slot) === sig) return;
|
|
7352
|
-
const oldTimer = this.slotTimers.get(slot);
|
|
7353
|
-
if (oldTimer) {
|
|
7354
|
-
clearInterval(oldTimer);
|
|
7355
|
-
this.slotTimers.delete(slot);
|
|
7356
|
-
}
|
|
7357
|
-
slot.querySelectorAll(
|
|
7358
|
-
":scope > [data-aegis-rotate-pane], :scope > [data-aegis-slot-rendered], :scope > [data-aegis-rotate-dots]"
|
|
7359
|
-
).forEach((n) => n.remove());
|
|
7360
|
-
this.slotSignatures.set(slot, sig);
|
|
7361
|
-
slot.querySelectorAll(":scope > [data-aegis-slot-default]").forEach((d) => d.remove());
|
|
7362
7418
|
const attrMs = parseInt(slot.getAttribute("data-aegis-slot-rotate") || "0", 10);
|
|
7363
7419
|
const declaredMs = list.reduce((m2, c) => {
|
|
7364
7420
|
var _a2;
|
|
@@ -7366,8 +7422,16 @@ const _AegisInAppManager = class _AegisInAppManager {
|
|
|
7366
7422
|
return Number.isFinite(v) && v > m2 ? v : m2;
|
|
7367
7423
|
}, 0);
|
|
7368
7424
|
const rotateMs = attrMs > 0 ? attrMs : declaredMs;
|
|
7425
|
+
const rotating = rotateMs > 0 && list.length > 1;
|
|
7426
|
+
const shown = rotating ? list : list.slice(0, 1);
|
|
7427
|
+
const sig = (rotating ? "rotate:" : "one:") + shown.map((c) => `${c.id}:${c.assigned_variant_id ?? ""}`).join(",");
|
|
7428
|
+
if (this.filledSlots.has(slot) && this.slotSignatures.get(slot) === sig) return;
|
|
7429
|
+
this.clearSlotContent(slot);
|
|
7430
|
+
this.slotSignatures.set(slot, sig);
|
|
7431
|
+
this.renderedSlots.add(slot);
|
|
7432
|
+
slot.querySelectorAll(":scope > [data-aegis-slot-default]").forEach((d) => d.remove());
|
|
7369
7433
|
const flush = slot.hasAttribute("data-aegis-slot-flush");
|
|
7370
|
-
if (
|
|
7434
|
+
if (rotating) {
|
|
7371
7435
|
this.renderRotatingSlot(slot, list, rotateMs, flush);
|
|
7372
7436
|
} else {
|
|
7373
7437
|
const host = document.createElement("div");
|
|
@@ -7414,7 +7478,7 @@ const _AegisInAppManager = class _AegisInAppManager {
|
|
|
7414
7478
|
});
|
|
7415
7479
|
const path = typeof window !== "undefined" ? window.location.pathname : "";
|
|
7416
7480
|
for (const c of this.campaigns) {
|
|
7417
|
-
if (!this.
|
|
7481
|
+
if (!this.isPlaceableHere(c)) continue;
|
|
7418
7482
|
if (!c.delivery_modes || !c.delivery_modes.includes("embedded_card")) continue;
|
|
7419
7483
|
const category = c.widget_category;
|
|
7420
7484
|
if (!category || present.has(category)) continue;
|
|
@@ -7509,9 +7573,13 @@ const _AegisInAppManager = class _AegisInAppManager {
|
|
|
7509
7573
|
});
|
|
7510
7574
|
};
|
|
7511
7575
|
let timer = null;
|
|
7512
|
-
const start = () =>
|
|
7513
|
-
|
|
7514
|
-
|
|
7576
|
+
const start = () => {
|
|
7577
|
+
const t = setInterval(() => {
|
|
7578
|
+
show(idx + 1);
|
|
7579
|
+
}, rotateMs);
|
|
7580
|
+
this.slotTimers.set(slot, t);
|
|
7581
|
+
return t;
|
|
7582
|
+
};
|
|
7515
7583
|
function show(i, fromClick = false) {
|
|
7516
7584
|
panes[idx].el.style.display = "none";
|
|
7517
7585
|
idx = (i % panes.length + panes.length) % panes.length;
|
|
@@ -7528,7 +7596,6 @@ const _AegisInAppManager = class _AegisInAppManager {
|
|
|
7528
7596
|
paintDots();
|
|
7529
7597
|
if (panes.length === 1) return;
|
|
7530
7598
|
timer = start();
|
|
7531
|
-
this.slotTimers.set(slot, timer);
|
|
7532
7599
|
if (typeof window !== "undefined") {
|
|
7533
7600
|
window.addEventListener("beforeunload", () => timer && clearInterval(timer), { once: true });
|
|
7534
7601
|
}
|
|
@@ -7553,7 +7620,7 @@ const _AegisInAppManager = class _AegisInAppManager {
|
|
|
7553
7620
|
var _a;
|
|
7554
7621
|
if (typeof document === "undefined") return;
|
|
7555
7622
|
for (const c of this.campaigns) {
|
|
7556
|
-
if (!this.
|
|
7623
|
+
if (!this.isPlaceableHere(c)) continue;
|
|
7557
7624
|
const modes = c.delivery_modes;
|
|
7558
7625
|
if (!modes || !modes.includes("embedded_card")) continue;
|
|
7559
7626
|
const ic = c.interactive_config;
|
|
@@ -12434,6 +12501,23 @@ const _AegisInAppManager = class _AegisInAppManager {
|
|
|
12434
12501
|
clearTimeout(this.refreshDebounceTimer);
|
|
12435
12502
|
this.refreshDebounceTimer = void 0;
|
|
12436
12503
|
}
|
|
12504
|
+
if (this.slotObserver) {
|
|
12505
|
+
this.slotObserver.disconnect();
|
|
12506
|
+
this.slotObserver = null;
|
|
12507
|
+
}
|
|
12508
|
+
this.slotRenderScheduled = false;
|
|
12509
|
+
this.slotsTornDown = true;
|
|
12510
|
+
this.lifecycleGen += 1;
|
|
12511
|
+
if (this.slotUnfilledSweepTimer) {
|
|
12512
|
+
clearTimeout(this.slotUnfilledSweepTimer);
|
|
12513
|
+
this.slotUnfilledSweepTimer = null;
|
|
12514
|
+
}
|
|
12515
|
+
this.renderedSlots.forEach((slot) => this.clearSlotContent(slot));
|
|
12516
|
+
this.renderedSlots.clear();
|
|
12517
|
+
this.filledSlots = /* @__PURE__ */ new WeakSet();
|
|
12518
|
+
this.slotSignatures = /* @__PURE__ */ new WeakMap();
|
|
12519
|
+
this.slotTimers = /* @__PURE__ */ new WeakMap();
|
|
12520
|
+
this.campaigns = [];
|
|
12437
12521
|
if (typeof document !== "undefined") {
|
|
12438
12522
|
document.querySelectorAll(
|
|
12439
12523
|
".aegis-in-app-banner, .aegis-in-app-modal-overlay, .aegis-in-app-fullscreen-overlay, .aegis-in-app-half-interstitial-overlay, .aegis-in-app-alert-overlay, .aegis-in-app-pip, .aegis-in-app-nps-overlay, .aegis-in-app-countdown-overlay, .aegis-in-app-rating-overlay, .aegis-in-app-poll-overlay, .aegis-in-app-quiz-overlay, .aegis-in-app-rating-card, .aegis-in-app-nps-card"
|
|
@@ -15077,7 +15161,7 @@ const _AegisMessageRuntime = class _AegisMessageRuntime {
|
|
|
15077
15161
|
this.initialized = false;
|
|
15078
15162
|
this.armedInAppTriggers = /* @__PURE__ */ new Set();
|
|
15079
15163
|
{
|
|
15080
|
-
const v = "1.43.
|
|
15164
|
+
const v = "1.43.6";
|
|
15081
15165
|
try {
|
|
15082
15166
|
globalThis.__AEGIS_SDK_VERSION__ = v;
|
|
15083
15167
|
} catch {
|