UNPKG

@braze/web-sdk

Version:

Braze SDK for web sites and other JS platforms.

52 lines (51 loc) 1.05 kB
import { STORAGE_KEYS as s } from "./storage-manager.js"; import f from "./subscription-manager.js"; import { logger as b, IndexedDBAdapter as et } from "../../shared-lib/index.js"; export default class Gt { constructor(t, i, s) { (this.j = t), (this.gh = i), (this.bh = s), (this.j = t), (this.gh = i || !1), (this.bh = s), (this.Sh = new f()), (this.Ah = 0), (this.ph = 1); } Fh() { return this.gh; } kh() { return this.j.St(s.It.fh); } setSdkAuthenticationSignature(t) { const i = this.kh(); this.j.Pt(s.It.fh, t); const e = et._s.Xs; new et(e, b).setItem(e.Ws.wh, this.ph, t), i !== t && this.ct(); } jh() { this.j.Vt(s.It.fh); const t = et._s.Xs; new et(t, b).ge(t.Ws.wh, this.ph); } subscribeToSdkAuthenticationFailures(t) { return this.bh.Ut(t); } Ch(t) { this.bh.A(t); } xh() { this.Sh.removeAllSubscriptions(); } Eh() { this.Ah += 1; } Ih() { return this.Ah; } ct() { this.Ah = 0; } }